11import { createContextWithStub , FilterAPI } from "@mendix/widget-plugin-filtering/context" ;
22import { CombinedFilter } from "@mendix/widget-plugin-filtering/stores/generic/CombinedFilter" ;
33import { CustomFilterHost } from "@mendix/widget-plugin-filtering/stores/generic/CustomFilterHost" ;
4- import { DatasourceService } from "@mendix/widget-plugin-grid/main" ;
5- import { SelectionCountStore } from "@mendix/widget-plugin-grid/selection/stores/SelectionCountStore" ;
4+ import { DatasourceService , SelectionCounterViewModel } from "@mendix/widget-plugin-grid/main" ;
5+
66import { DerivedPropsGate , SetupHost } from "@mendix/widget-plugin-mobx-kit/main" ;
77import { generateUUID } from "@mendix/widget-plugin-platform/framework/generate-uuid" ;
88import { SortAPI } from "@mendix/widget-plugin-sorting/react/context" ;
@@ -23,6 +23,7 @@ interface DynamicProps {
2323 itemSelection ?: SelectionSingleValue | SelectionMultiValue ;
2424 sCountFmtSingular ?: DynamicValue < string > ;
2525 sCountFmtPlural ?: DynamicValue < string > ;
26+ selectionCountPosition : "top" | "bottom" | "off" ;
2627}
2728
2829interface StaticProps {
@@ -55,7 +56,7 @@ export class GalleryStore extends SetupHost {
5556 readonly filterAPI : FilterAPI ;
5657 readonly sortAPI : SortAPI ;
5758 loaderCtrl : DerivedLoaderController ;
58- selectionCountStore : SelectionCountStore ;
59+ selectionCountStore : SelectionCounterViewModel ;
5960
6061 constructor ( spec : GalleryStoreSpec ) {
6162 super ( ) ;
@@ -72,7 +73,7 @@ export class GalleryStore extends SetupHost {
7273 showTotalCount : spec . showTotalCount
7374 } ) ;
7475
75- this . selectionCountStore = new SelectionCountStore ( spec . gate ) ;
76+ this . selectionCountStore = new SelectionCounterViewModel ( spec . gate , spec . gate . props . selectionCountPosition ) ;
7677
7778 this . _filtersHost = new CustomFilterHost ( ) ;
7879
0 commit comments