@xh/hoist 73.0.0-SNAPSHOT.1746638889909 → 73.0.0-SNAPSHOT.1746647244798

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,8 @@ export declare class ValuesTabModel extends HoistModel {
27
27
  reset(): void;
28
28
  setRecsChecked(isChecked: boolean, values: any[]): void;
29
29
  toggleAllRecsChecked(): void;
30
- setPendingValues(): void;
30
+ filterTextReaction(): void;
31
+ combineCurrentFiltersToggleReaction(): void;
31
32
  private getFilter;
32
33
  private doSyncWithFilter;
33
34
  private syncGrid;
@@ -55,6 +55,7 @@ const body = hoistCmp.factory<ValuesTabModel>(({model}) => {
55
55
  const storeFilterSelect = hoistCmp.factory<ValuesTabModel>(({model}) => {
56
56
  const {gridModel, allVisibleRecsChecked, filterText, headerFilterModel} = model,
57
57
  {store} = gridModel;
58
+
58
59
  return vbox({
59
60
  className: 'store-filter-header',
60
61
  items: [
@@ -68,7 +69,11 @@ const storeFilterSelect = hoistCmp.factory<ValuesTabModel>(({model}) => {
68
69
  span(`(Select All${filterText ? ' Search Results' : ''})`)
69
70
  ),
70
71
  hframe({
71
- omit: !filterText || store.empty || headerFilterModel.commitOnChange,
72
+ omit:
73
+ !filterText ||
74
+ !model.columnFilters.length ||
75
+ store.empty ||
76
+ headerFilterModel.commitOnChange,
72
77
  items: [
73
78
  checkbox({bind: 'combineCurrentFilters'}),
74
79
  span(`Add current selection to filter`)
@@ -94,9 +94,13 @@ export class ValuesTabModel extends HoistModel {
94
94
  fireImmediately: true
95
95
  },
96
96
  {
97
- track: () => [this.filterText, this.combineCurrentFilters],
98
- run: () => this.setPendingValues(),
97
+ track: () => this.filterText,
98
+ run: () => this.filterTextReaction(),
99
99
  debounce: 300
100
+ },
101
+ {
102
+ track: () => this.combineCurrentFilters,
103
+ run: () => this.combineCurrentFiltersToggleReaction()
100
104
  }
101
105
  );
102
106
  }
@@ -129,10 +133,10 @@ export class ValuesTabModel extends HoistModel {
129
133
  // Implementation
130
134
  //-------------------
131
135
  @action
132
- setPendingValues() {
136
+ filterTextReaction() {
133
137
  if (!this.filterText) {
138
+ this.combineCurrentFilters = false;
134
139
  this.doSyncWithFilter();
135
- this.syncGrid();
136
140
  return;
137
141
  }
138
142
 
@@ -151,6 +155,19 @@ export class ValuesTabModel extends HoistModel {
151
155
  );
152
156
  }
153
157
 
158
+ @action combineCurrentFiltersToggleReaction() {
159
+ if (!this.filterText) return;
160
+
161
+ const {records} = this.gridModel.store,
162
+ currentFilterValues = flatten(map(this.columnFilters, 'value')),
163
+ checkedRecs = records.filter(it => it.get('isChecked')),
164
+ values = map(checkedRecs, it => it.get('value'));
165
+
166
+ this.pendingValues = uniq(
167
+ this.combineCurrentFilters ? [...currentFilterValues, ...values] : values
168
+ );
169
+ }
170
+
154
171
  private getFilter() {
155
172
  const {gridFilterModel, pendingValues, values, valueCount, field} = this,
156
173
  included = pendingValues.map(it => gridFilterModel.fromDisplayValue(it)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "73.0.0-SNAPSHOT.1746638889909",
3
+ "version": "73.0.0-SNAPSHOT.1746647244798",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",