@xh/hoist 73.0.0-SNAPSHOT.1747088840379 → 73.0.0-SNAPSHOT.1747146913330
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.
- package/CHANGELOG.md +0 -4
- package/appcontainer/AppStateModel.ts +0 -3
- package/build/types/cmp/grid/Types.d.ts +1 -4
- package/build/types/cmp/store/StoreFilterField.d.ts +3 -2
- package/build/types/desktop/cmp/grid/impl/filter/headerfilter/values/ValuesTabModel.d.ts +0 -3
- package/cmp/grid/Types.ts +1 -4
- package/cmp/grid/filter/GridFilterModel.ts +1 -1
- package/cmp/store/StoreFilterField.ts +3 -2
- package/desktop/cmp/grid/impl/filter/headerfilter/values/ValuesTab.scss +0 -14
- package/desktop/cmp/grid/impl/filter/headerfilter/values/ValuesTab.ts +4 -49
- package/desktop/cmp/grid/impl/filter/headerfilter/values/ValuesTabModel.ts +15 -60
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -35,10 +35,6 @@
|
|
|
35
35
|
allow the client to do a potentially interactive popup login during the session to re-establish
|
|
36
36
|
the login. This is especially useful to allow recovery from expired or invalidated refresh
|
|
37
37
|
tokens.
|
|
38
|
-
* Improvements to Grid columns `HeaderFilter` component:
|
|
39
|
-
* `GridFilterModel` `commitOnChage` now set to `false` by default
|
|
40
|
-
* Addition of ability to append terms to active filter **only** when `commitOnChage:false`
|
|
41
|
-
* Grid column header filtering functionality now similar to Excel on Windows
|
|
42
38
|
|
|
43
39
|
### 🐞 Bug Fixes
|
|
44
40
|
|
|
@@ -92,14 +92,11 @@ export class AppStateModel extends HoistModel {
|
|
|
92
92
|
timestamp: loadStarted,
|
|
93
93
|
elapsed: Date.now() - loadStarted - (timings.LOGIN_REQUIRED ?? 0),
|
|
94
94
|
data: {
|
|
95
|
-
loadId: XH.loadId,
|
|
96
|
-
tabId: XH.tabId,
|
|
97
95
|
timings: mapKeys(timings, (v, k) => camelCase(k)),
|
|
98
96
|
clientHealth: XH.clientHealthService.getReport(),
|
|
99
97
|
window: this.getWindowData(),
|
|
100
98
|
screen: this.getScreenData()
|
|
101
99
|
},
|
|
102
|
-
logData: ['loadId', 'tabId'],
|
|
103
100
|
omit: !XH.appSpec.trackAppLoad
|
|
104
101
|
})
|
|
105
102
|
});
|
|
@@ -60,10 +60,7 @@ export interface GridFilterModelConfig {
|
|
|
60
60
|
* gridModel's store.
|
|
61
61
|
*/
|
|
62
62
|
bind?: Store | View;
|
|
63
|
-
/**
|
|
64
|
-
* True to update filters immediately after each change made in the column-based filter UI.
|
|
65
|
-
* Defaults to False.
|
|
66
|
-
*/
|
|
63
|
+
/** True (default) to update filters immediately after each change made in the column-based filter UI.*/
|
|
67
64
|
commitOnChange?: boolean;
|
|
68
65
|
/**
|
|
69
66
|
* Specifies the fields this model supports for filtering. Should be configs for
|
|
@@ -11,8 +11,9 @@ export interface StoreFilterFieldProps extends DefaultHoistProps {
|
|
|
11
11
|
autoApply?: boolean;
|
|
12
12
|
/**
|
|
13
13
|
* Field on optional model to which this component should bind its raw (text) value to persist
|
|
14
|
-
* across renders. Specify this field to control the state of this component directly
|
|
15
|
-
*
|
|
14
|
+
* across renders. Specify this field to control the state of this component directly or if
|
|
15
|
+
* deliberately not connecting this component to a Store/GridModel. These are both advanced
|
|
16
|
+
* use-cases - this prop is typically left unset.
|
|
16
17
|
*/
|
|
17
18
|
bind?: string;
|
|
18
19
|
/** Names of field(s) to exclude from search. Cannot be used with `includeFields`. */
|
|
@@ -11,7 +11,6 @@ export declare class ValuesTabModel extends HoistModel {
|
|
|
11
11
|
pendingValues: any[];
|
|
12
12
|
/** Bound search term for `StoreFilterField` */
|
|
13
13
|
filterText: string;
|
|
14
|
-
combineCurrentFilters: boolean;
|
|
15
14
|
/** FieldFilter output by this model. */
|
|
16
15
|
get filter(): FieldFilterSpec;
|
|
17
16
|
get allVisibleRecsChecked(): boolean;
|
|
@@ -27,8 +26,6 @@ export declare class ValuesTabModel extends HoistModel {
|
|
|
27
26
|
reset(): void;
|
|
28
27
|
setRecsChecked(isChecked: boolean, values: any[]): void;
|
|
29
28
|
toggleAllRecsChecked(): void;
|
|
30
|
-
filterTextReaction(): void;
|
|
31
|
-
combineCurrentFiltersToggleReaction(): void;
|
|
32
29
|
private getFilter;
|
|
33
30
|
private doSyncWithFilter;
|
|
34
31
|
private syncGrid;
|
package/cmp/grid/Types.ts
CHANGED
|
@@ -90,10 +90,7 @@ export interface GridFilterModelConfig {
|
|
|
90
90
|
*/
|
|
91
91
|
bind?: Store | View;
|
|
92
92
|
|
|
93
|
-
/**
|
|
94
|
-
* True to update filters immediately after each change made in the column-based filter UI.
|
|
95
|
-
* Defaults to False.
|
|
96
|
-
*/
|
|
93
|
+
/** True (default) to update filters immediately after each change made in the column-based filter UI.*/
|
|
97
94
|
commitOnChange?: boolean;
|
|
98
95
|
|
|
99
96
|
/**
|
|
@@ -46,7 +46,7 @@ export class GridFilterModel extends HoistModel {
|
|
|
46
46
|
static BLANK_PLACEHOLDER = '[blank]';
|
|
47
47
|
|
|
48
48
|
constructor(
|
|
49
|
-
{bind, commitOnChange =
|
|
49
|
+
{bind, commitOnChange = true, fieldSpecs, fieldSpecDefaults}: GridFilterModelConfig,
|
|
50
50
|
gridModel: GridModel
|
|
51
51
|
) {
|
|
52
52
|
super();
|
|
@@ -21,8 +21,9 @@ export interface StoreFilterFieldProps extends DefaultHoistProps {
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Field on optional model to which this component should bind its raw (text) value to persist
|
|
24
|
-
* across renders. Specify this field to control the state of this component directly
|
|
25
|
-
*
|
|
24
|
+
* across renders. Specify this field to control the state of this component directly or if
|
|
25
|
+
* deliberately not connecting this component to a Store/GridModel. These are both advanced
|
|
26
|
+
* use-cases - this prop is typically left unset.
|
|
26
27
|
*/
|
|
27
28
|
bind?: string;
|
|
28
29
|
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
.xh-values-filter-tab {
|
|
2
|
-
.store-filter-header {
|
|
3
|
-
padding: 5px 7px;
|
|
4
|
-
border-bottom: 1px solid var(--xh-grid-header-border-color);
|
|
5
|
-
row-gap: 5px;
|
|
6
|
-
.bp5-control-indicator {
|
|
7
|
-
font-size: 1em;
|
|
8
|
-
}
|
|
9
|
-
label {
|
|
10
|
-
font-size: var(--xh-grid-compact-header-font-size-px);
|
|
11
|
-
color: var(--xh-grid-header-text-color);
|
|
12
|
-
cursor: pointer;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
2
|
&__hidden-values-message {
|
|
17
3
|
display: flex;
|
|
18
4
|
padding: var(--xh-pad-half-px);
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
7
|
import {grid} from '@xh/hoist/cmp/grid';
|
|
8
|
-
import {div,
|
|
8
|
+
import {div, placeholder, vframe} from '@xh/hoist/cmp/layout';
|
|
9
9
|
import {storeFilterField} from '@xh/hoist/cmp/store';
|
|
10
|
-
import {
|
|
10
|
+
import {hoistCmp, uses} from '@xh/hoist/core';
|
|
11
11
|
import {button} from '@xh/hoist/desktop/cmp/button';
|
|
12
|
-
import {checkbox} from '@xh/hoist/desktop/cmp/input';
|
|
13
12
|
import {panel} from '@xh/hoist/desktop/cmp/panel';
|
|
14
13
|
import {toolbar} from '@xh/hoist/desktop/cmp/toolbar';
|
|
15
14
|
import {Icon} from '@xh/hoist/icon';
|
|
@@ -40,8 +39,7 @@ const tbar = hoistCmp.factory(() => {
|
|
|
40
39
|
placeholder: 'Search...',
|
|
41
40
|
flex: 1,
|
|
42
41
|
autoFocus: true,
|
|
43
|
-
matchMode: 'any'
|
|
44
|
-
includeFields: ['value']
|
|
42
|
+
matchMode: 'any'
|
|
45
43
|
})
|
|
46
44
|
);
|
|
47
45
|
});
|
|
@@ -49,50 +47,7 @@ const tbar = hoistCmp.factory(() => {
|
|
|
49
47
|
const body = hoistCmp.factory<ValuesTabModel>(({model}) => {
|
|
50
48
|
const {isCustomFilter} = model.headerFilterModel;
|
|
51
49
|
if (isCustomFilter) return customFilterPlaceholder();
|
|
52
|
-
return vframe(
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const storeFilterSelect = hoistCmp.factory<ValuesTabModel>(({model}) => {
|
|
56
|
-
const {gridModel, allVisibleRecsChecked, filterText, headerFilterModel} = model,
|
|
57
|
-
{store} = gridModel,
|
|
58
|
-
selectAllId = XH.genId(),
|
|
59
|
-
addToFilterId = XH.genId();
|
|
60
|
-
|
|
61
|
-
return vbox({
|
|
62
|
-
className: 'store-filter-header',
|
|
63
|
-
items: [
|
|
64
|
-
hframe(
|
|
65
|
-
checkbox({
|
|
66
|
-
id: selectAllId,
|
|
67
|
-
disabled: store.empty,
|
|
68
|
-
displayUnsetState: true,
|
|
69
|
-
value: allVisibleRecsChecked,
|
|
70
|
-
onChange: () => model.toggleAllRecsChecked()
|
|
71
|
-
}),
|
|
72
|
-
label({
|
|
73
|
-
htmlFor: selectAllId,
|
|
74
|
-
item: `(Select All${filterText ? ' Search Results' : ''})`
|
|
75
|
-
})
|
|
76
|
-
),
|
|
77
|
-
hframe({
|
|
78
|
-
omit:
|
|
79
|
-
!filterText ||
|
|
80
|
-
!model.columnFilters.length ||
|
|
81
|
-
store.empty ||
|
|
82
|
-
headerFilterModel.commitOnChange,
|
|
83
|
-
items: [
|
|
84
|
-
checkbox({
|
|
85
|
-
id: addToFilterId,
|
|
86
|
-
bind: 'combineCurrentFilters'
|
|
87
|
-
}),
|
|
88
|
-
label({
|
|
89
|
-
htmlFor: addToFilterId,
|
|
90
|
-
item: 'Add current selection to filter'
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
});
|
|
50
|
+
return vframe(grid(), hiddenValuesMessage());
|
|
96
51
|
});
|
|
97
52
|
|
|
98
53
|
const customFilterPlaceholder = hoistCmp.factory<ValuesTabModel>(({model}) => {
|
|
@@ -10,7 +10,7 @@ import {FieldFilterSpec} from '@xh/hoist/data';
|
|
|
10
10
|
import {HeaderFilterModel} from '../HeaderFilterModel';
|
|
11
11
|
import {checkbox} from '@xh/hoist/desktop/cmp/input';
|
|
12
12
|
import {action, bindable, computed, makeObservable, observable} from '@xh/hoist/mobx';
|
|
13
|
-
import {castArray, difference,
|
|
13
|
+
import {castArray, difference, isEmpty, partition, uniq, without} from 'lodash';
|
|
14
14
|
|
|
15
15
|
export class ValuesTabModel extends HoistModel {
|
|
16
16
|
override xhImpl = true;
|
|
@@ -26,12 +26,6 @@ export class ValuesTabModel extends HoistModel {
|
|
|
26
26
|
/** Bound search term for `StoreFilterField` */
|
|
27
27
|
@bindable filterText: string = null;
|
|
28
28
|
|
|
29
|
-
/*
|
|
30
|
-
* Available only when commit on change is false merge
|
|
31
|
-
* current filter with pendingValues on commit
|
|
32
|
-
*/
|
|
33
|
-
@bindable combineCurrentFilters: boolean = false;
|
|
34
|
-
|
|
35
29
|
/** FieldFilter output by this model. */
|
|
36
30
|
@computed.struct
|
|
37
31
|
get filter(): FieldFilterSpec {
|
|
@@ -87,22 +81,11 @@ export class ValuesTabModel extends HoistModel {
|
|
|
87
81
|
this.headerFilterModel = headerFilterModel;
|
|
88
82
|
this.gridModel = this.createGridModel();
|
|
89
83
|
|
|
90
|
-
this.addReaction(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
track: () => this.filterText,
|
|
98
|
-
run: () => this.filterTextReaction(),
|
|
99
|
-
debounce: 300
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
track: () => this.combineCurrentFilters,
|
|
103
|
-
run: () => this.combineCurrentFiltersToggleReaction()
|
|
104
|
-
}
|
|
105
|
-
);
|
|
84
|
+
this.addReaction({
|
|
85
|
+
track: () => this.pendingValues,
|
|
86
|
+
run: () => this.syncGrid(),
|
|
87
|
+
fireImmediately: true
|
|
88
|
+
});
|
|
106
89
|
}
|
|
107
90
|
|
|
108
91
|
syncWithFilter() {
|
|
@@ -132,42 +115,6 @@ export class ValuesTabModel extends HoistModel {
|
|
|
132
115
|
//-------------------
|
|
133
116
|
// Implementation
|
|
134
117
|
//-------------------
|
|
135
|
-
@action
|
|
136
|
-
filterTextReaction() {
|
|
137
|
-
if (!this.filterText) {
|
|
138
|
-
this.combineCurrentFilters = false;
|
|
139
|
-
this.doSyncWithFilter();
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const {records} = this.gridModel.store,
|
|
144
|
-
currentFilterValues = flatten(map(this.columnFilters, 'value')),
|
|
145
|
-
checkedRecs = records.filter(
|
|
146
|
-
it =>
|
|
147
|
-
this.headerFilterModel.commitOnChange ||
|
|
148
|
-
currentFilterValues.length ||
|
|
149
|
-
it.get('isChecked')
|
|
150
|
-
),
|
|
151
|
-
values = map(checkedRecs, it => it.get('value'));
|
|
152
|
-
|
|
153
|
-
this.pendingValues = uniq(
|
|
154
|
-
this.combineCurrentFilters ? [...currentFilterValues, ...values] : values
|
|
155
|
-
);
|
|
156
|
-
}
|
|
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
|
-
|
|
171
118
|
private getFilter() {
|
|
172
119
|
const {gridFilterModel, pendingValues, values, valueCount, field} = this,
|
|
173
120
|
included = pendingValues.map(it => gridFilterModel.fromDisplayValue(it)),
|
|
@@ -270,10 +217,17 @@ export class ValuesTabModel extends HoistModel {
|
|
|
270
217
|
onRowClicked: ({data: record}) => {
|
|
271
218
|
this.setRecsChecked(!record.get('isChecked'), record.get('value'));
|
|
272
219
|
},
|
|
273
|
-
hideHeaders: true,
|
|
274
220
|
columns: [
|
|
275
221
|
{
|
|
276
222
|
field: 'isChecked',
|
|
223
|
+
headerName: ({gridModel}) => {
|
|
224
|
+
return checkbox({
|
|
225
|
+
disabled: gridModel.store.empty,
|
|
226
|
+
displayUnsetState: true,
|
|
227
|
+
value: this.allVisibleRecsChecked,
|
|
228
|
+
onChange: () => this.toggleAllRecsChecked()
|
|
229
|
+
});
|
|
230
|
+
},
|
|
277
231
|
width: 28,
|
|
278
232
|
autosizable: false,
|
|
279
233
|
pinned: true,
|
|
@@ -291,6 +245,7 @@ export class ValuesTabModel extends HoistModel {
|
|
|
291
245
|
},
|
|
292
246
|
{
|
|
293
247
|
field: 'value',
|
|
248
|
+
displayName: '(Select All)',
|
|
294
249
|
align: 'left',
|
|
295
250
|
comparator: (v1, v2, sortDir, abs, {defaultComparator}) => {
|
|
296
251
|
const mul = sortDir === 'desc' ? -1 : 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "73.0.0-SNAPSHOT.
|
|
3
|
+
"version": "73.0.0-SNAPSHOT.1747146913330",
|
|
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",
|