File tree Expand file tree Collapse file tree 4 files changed +16
-9
lines changed
pluggableWidgets/gallery-web/src
shared/widget-plugin-grid/src/selection/stores Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ function useCreateGalleryScope(props: GalleryContainerProps): GalleryRootScope {
102102 props . itemSelection ,
103103 props . datasource ,
104104 props . onSelectionChange ,
105- "always keep"
105+ props . keepSelection ? "always keep" : "always clear "
106106 ) ;
107107 const itemSelectHelper = useItemSelectHelper ( props . itemSelection , selectionHelper ) ;
108108
Original file line number Diff line number Diff line change 191191 <description >Assistive technology will read this upon reaching each gallery item.</description >
192192 </property >
193193 <property key =" sCountFmtSingular" type =" textTemplate" required =" false" >
194- <caption >Row count singular</caption >
195- <description >Must include '%d' to denote number position ('%d row selected')</description >
194+ <caption >Item count singular</caption >
195+ <description >Must include '%d' to denote number position ('%d item selected')</description >
196196 </property >
197197 <property key =" sCountFmtPlural" type =" textTemplate" required =" false" >
198- <caption >Row count plural</caption >
199- <description >Must include '%d' to denote number position ('%d rows selected')</description >
198+ <caption >Item count plural</caption >
199+ <description >Must include '%d' to denote number position ('%d items selected')</description >
200200 </property >
201201 </propertyGroup >
202202 </propertyGroup >
Original file line number Diff line number Diff line change @@ -74,7 +74,10 @@ export class GalleryStore extends BaseControllerHost {
7474 showTotalCount : spec . showTotalCount
7575 } ) ;
7676
77- this . selectionCountStore = new SelectionCountStore ( spec . gate ) ;
77+ this . selectionCountStore = new SelectionCountStore ( spec . gate , {
78+ singular : "%d item selected" ,
79+ plural : "%d items selected"
80+ } ) ;
7881
7982 this . _filtersHost = new CustomFilterHost ( ) ;
8083
Original file line number Diff line number Diff line change @@ -10,8 +10,12 @@ type Gate = DerivedPropsGate<{
1010
1111export class SelectionCountStore {
1212 private gate : Gate ;
13+ private singular : string = "%d row selected" ;
14+ private plural : string = "%d rows selected" ;
1315
14- constructor ( gate : Gate ) {
16+ constructor ( gate : Gate , spec : { singular ?: string ; plural ?: string } = { } ) {
17+ this . singular = spec . singular ?? this . singular ;
18+ this . plural = spec . plural ?? this . plural ;
1519 this . gate = gate ;
1620
1721 makeObservable ( this , {
@@ -23,11 +27,11 @@ export class SelectionCountStore {
2327 }
2428
2529 get fmtSingular ( ) : string {
26- return this . gate . props . sCountFmtSingular ?. value || "%d row selected" ;
30+ return this . gate . props . sCountFmtSingular ?. value || this . singular ;
2731 }
2832
2933 get fmtPlural ( ) : string {
30- return this . gate . props . sCountFmtPlural ?. value || "%d rows selected" ;
34+ return this . gate . props . sCountFmtPlural ?. value || this . plural ;
3135 }
3236
3337 get selectedCount ( ) : number {
You can’t perform that action at this time.
0 commit comments