@@ -29,7 +29,7 @@ import {
29
29
withFunction ,
30
30
WrapContextNodeV2 ,
31
31
} from "lowcoder-core" ;
32
- import { JSONArray , JSONValue } from "util/jsonTypes" ;
32
+ import { JSONArray , JSONObject , JSONValue } from "util/jsonTypes" ;
33
33
import { depthEqual , lastValueIfEqual , shallowEqual } from "util/objectUtils" ;
34
34
import { CompTree , getAllCompItems , IContainer } from "../containerBase" ;
35
35
import { SimpleContainerComp , toSimpleContainerData } from "../containerBase/simpleContainerComp" ;
@@ -40,6 +40,7 @@ import { listPropertyView } from "./listViewPropertyView";
40
40
import { getData } from "./listViewUtils" ;
41
41
import { withMethodExposing } from "comps/generators/withMethodExposing" ;
42
42
import { SliderControl } from "@lowcoder-ee/comps/controls/sliderControl" ;
43
+ import { eventHandlerControl , sortChangeEvent } from "@lowcoder-ee/comps/controls/eventHandlerControl" ;
43
44
44
45
const childrenMap = {
45
46
noOfRows : withIsLoadingMethod ( NumberOrJSONObjectArrayControl ) , // FIXME: migrate "noOfRows" to "data"
@@ -62,6 +63,7 @@ const childrenMap = {
62
63
horizontal : withDefault ( BoolControl , false ) ,
63
64
minHorizontalWidth : withDefault ( RadiusControl , '100px' ) ,
64
65
enableSorting : withDefault ( BoolControl , false ) ,
66
+ onEvent : eventHandlerControl ( [ sortChangeEvent ] as const ) ,
65
67
} ;
66
68
67
69
const ListViewTmpComp = new UICompBuilder ( childrenMap , ( ) => < > </ > )
@@ -183,6 +185,15 @@ ListViewPropertyComp = withExposingConfigs(ListViewPropertyComp, [
183
185
return data ;
184
186
} ,
185
187
} ) ,
188
+ depsConfig ( {
189
+ name : "sortedData" ,
190
+ desc : trans ( "listView.dataDesc" ) ,
191
+ depKeys : [ "listData" ] ,
192
+ func : ( input ) => {
193
+ const { data } = getData ( input . listData as JSONObject [ ] ) ;
194
+ return data ;
195
+ } ,
196
+ } ) ,
186
197
new CompDepsConfig (
187
198
"pageNo" ,
188
199
( comp ) => ( { index : comp . children . pagination . children . pageNo . exposingNode ( ) } ) ,
0 commit comments