@xh/hoist 73.0.0-SNAPSHOT.1746483592964 → 73.0.0-SNAPSHOT.1746553761854
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 +4 -0
- package/admin/tabs/activity/tracking/ActivityTrackingPanel.ts +3 -2
- package/admin/tabs/activity/tracking/detail/ActivityDetailView.ts +2 -2
- package/build/types/cmp/grid/Types.d.ts +4 -1
- package/build/types/desktop/cmp/grid/impl/filter/headerfilter/values/ValuesTabModel.d.ts +2 -0
- package/cmp/grid/Types.ts +4 -1
- package/cmp/grid/filter/GridFilterModel.ts +1 -1
- package/desktop/cmp/grid/impl/filter/headerfilter/values/ValuesTab.scss +13 -0
- package/desktop/cmp/grid/impl/filter/headerfilter/values/ValuesTab.ts +29 -2
- package/desktop/cmp/grid/impl/filter/headerfilter/values/ValuesTabModel.ts +37 -15
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -127,6 +127,10 @@
|
|
|
127
127
|
|
|
128
128
|
### 🎁 New Features
|
|
129
129
|
|
|
130
|
+
* Improvements to Grid columns `HeaderFilter` component:
|
|
131
|
+
* `GridFilterModel` `commitOnChage` now set to `false` by default
|
|
132
|
+
* Addition of ability to append terms to active filter **only** when `commitOnChage:false`
|
|
133
|
+
* Column header filtering functionality now similar to Excel on Windows
|
|
130
134
|
* Introduced a new "JSON Search" feature to the Hoist Admin Console, accessible from the Config,
|
|
131
135
|
User Preference, and JSON Blob tabs. Supports searching JSON values stored within these objects
|
|
132
136
|
to filter and match data using JSON Path expressions.
|
|
@@ -145,6 +145,7 @@ const filterBar = hoistCmp.factory<ActivityTrackingModel>(({model}) => {
|
|
|
145
145
|
});
|
|
146
146
|
|
|
147
147
|
const aggregateView = hoistCmp.factory<ActivityTrackingModel>(({model}) => {
|
|
148
|
+
const {gridModel} = model;
|
|
148
149
|
return panel({
|
|
149
150
|
collapsedTitle: 'Aggregate Activity',
|
|
150
151
|
collapsedIcon: Icon.users(),
|
|
@@ -159,8 +160,8 @@ const aggregateView = hoistCmp.factory<ActivityTrackingModel>(({model}) => {
|
|
|
159
160
|
items: [
|
|
160
161
|
groupingChooser({flex: 10, maxWidth: 300}),
|
|
161
162
|
filler(),
|
|
162
|
-
colChooserButton(),
|
|
163
|
-
exportButton()
|
|
163
|
+
colChooserButton({gridModel}),
|
|
164
|
+
exportButton({gridModel})
|
|
164
165
|
]
|
|
165
166
|
}),
|
|
166
167
|
items: [
|
|
@@ -40,11 +40,11 @@ const tbar = hoistCmp.factory<ActivityDetailModel>(({model}) => {
|
|
|
40
40
|
compact: true,
|
|
41
41
|
items: [
|
|
42
42
|
filler(),
|
|
43
|
-
gridCountLabel({unit: 'entry'}),
|
|
43
|
+
gridCountLabel({gridModel, unit: 'entry'}),
|
|
44
44
|
'-',
|
|
45
45
|
gridFindField({gridModel, key: gridModel.xhId, width: 250}),
|
|
46
46
|
colChooserButton({gridModel}),
|
|
47
|
-
exportButton()
|
|
47
|
+
exportButton({gridModel})
|
|
48
48
|
]
|
|
49
49
|
});
|
|
50
50
|
});
|
|
@@ -60,7 +60,10 @@ export interface GridFilterModelConfig {
|
|
|
60
60
|
* gridModel's store.
|
|
61
61
|
*/
|
|
62
62
|
bind?: Store | View;
|
|
63
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* True to update filters immediately after each change made in the column-based filter UI.
|
|
65
|
+
* Defaults to False.
|
|
66
|
+
*/
|
|
64
67
|
commitOnChange?: boolean;
|
|
65
68
|
/**
|
|
66
69
|
* Specifies the fields this model supports for filtering. Should be configs for
|
|
@@ -11,6 +11,7 @@ export declare class ValuesTabModel extends HoistModel {
|
|
|
11
11
|
pendingValues: any[];
|
|
12
12
|
/** Bound search term for `StoreFilterField` */
|
|
13
13
|
filterText: string;
|
|
14
|
+
combineCurrentFilters: boolean;
|
|
14
15
|
/** FieldFilter output by this model. */
|
|
15
16
|
get filter(): FieldFilterSpec;
|
|
16
17
|
get allVisibleRecsChecked(): boolean;
|
|
@@ -26,6 +27,7 @@ export declare class ValuesTabModel extends HoistModel {
|
|
|
26
27
|
reset(): void;
|
|
27
28
|
setRecsChecked(isChecked: boolean, values: any[]): void;
|
|
28
29
|
toggleAllRecsChecked(): void;
|
|
30
|
+
setPendingValues(): void;
|
|
29
31
|
private getFilter;
|
|
30
32
|
private doSyncWithFilter;
|
|
31
33
|
private syncGrid;
|
package/cmp/grid/Types.ts
CHANGED
|
@@ -90,7 +90,10 @@ export interface GridFilterModelConfig {
|
|
|
90
90
|
*/
|
|
91
91
|
bind?: Store | View;
|
|
92
92
|
|
|
93
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* True to update filters immediately after each change made in the column-based filter UI.
|
|
95
|
+
* Defaults to False.
|
|
96
|
+
*/
|
|
94
97
|
commitOnChange?: boolean;
|
|
95
98
|
|
|
96
99
|
/**
|
|
@@ -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 = false, fieldSpecs, fieldSpecDefaults}: GridFilterModelConfig,
|
|
50
50
|
gridModel: GridModel
|
|
51
51
|
) {
|
|
52
52
|
super();
|
|
@@ -1,4 +1,17 @@
|
|
|
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
|
+
span {
|
|
10
|
+
font-size: var(--xh-grid-compact-header-font-size-px);
|
|
11
|
+
color: var(--xh-grid-header-text-color);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
2
15
|
&__hidden-values-message {
|
|
3
16
|
display: flex;
|
|
4
17
|
padding: var(--xh-pad-half-px);
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
7
|
import {grid} from '@xh/hoist/cmp/grid';
|
|
8
|
-
import {div, placeholder, vframe} from '@xh/hoist/cmp/layout';
|
|
8
|
+
import {div, hframe, placeholder, span, vbox, vframe} from '@xh/hoist/cmp/layout';
|
|
9
9
|
import {storeFilterField} from '@xh/hoist/cmp/store';
|
|
10
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';
|
|
12
13
|
import {panel} from '@xh/hoist/desktop/cmp/panel';
|
|
13
14
|
import {toolbar} from '@xh/hoist/desktop/cmp/toolbar';
|
|
14
15
|
import {Icon} from '@xh/hoist/icon';
|
|
@@ -47,7 +48,33 @@ const tbar = hoistCmp.factory(() => {
|
|
|
47
48
|
const body = hoistCmp.factory<ValuesTabModel>(({model}) => {
|
|
48
49
|
const {isCustomFilter} = model.headerFilterModel;
|
|
49
50
|
if (isCustomFilter) return customFilterPlaceholder();
|
|
50
|
-
return vframe(grid(), hiddenValuesMessage());
|
|
51
|
+
return vframe(storeFilterSelect(), grid(), hiddenValuesMessage());
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const storeFilterSelect = hoistCmp.factory<ValuesTabModel>(({model}) => {
|
|
55
|
+
const {gridModel, allVisibleRecsChecked, filterText, headerFilterModel} = model,
|
|
56
|
+
{store} = gridModel;
|
|
57
|
+
return vbox({
|
|
58
|
+
className: 'store-filter-header',
|
|
59
|
+
items: [
|
|
60
|
+
hframe(
|
|
61
|
+
checkbox({
|
|
62
|
+
disabled: store.empty,
|
|
63
|
+
displayUnsetState: true,
|
|
64
|
+
value: allVisibleRecsChecked,
|
|
65
|
+
onChange: () => model.toggleAllRecsChecked()
|
|
66
|
+
}),
|
|
67
|
+
span(`(Select All${filterText ? ' Search Results' : ''})`)
|
|
68
|
+
),
|
|
69
|
+
hframe({
|
|
70
|
+
omit: !filterText || store.empty || headerFilterModel.commitOnChange,
|
|
71
|
+
items: [
|
|
72
|
+
checkbox({bind: 'combineCurrentFilters'}),
|
|
73
|
+
span(`Add current selection to filter`)
|
|
74
|
+
]
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
});
|
|
51
78
|
});
|
|
52
79
|
|
|
53
80
|
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, isEmpty, partition, uniq, without} from 'lodash';
|
|
13
|
+
import {castArray, difference, flatten, isEmpty, map, partition, uniq, without} from 'lodash';
|
|
14
14
|
|
|
15
15
|
export class ValuesTabModel extends HoistModel {
|
|
16
16
|
override xhImpl = true;
|
|
@@ -26,6 +26,12 @@ 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
|
+
|
|
29
35
|
/** FieldFilter output by this model. */
|
|
30
36
|
@computed.struct
|
|
31
37
|
get filter(): FieldFilterSpec {
|
|
@@ -81,11 +87,18 @@ export class ValuesTabModel extends HoistModel {
|
|
|
81
87
|
this.headerFilterModel = headerFilterModel;
|
|
82
88
|
this.gridModel = this.createGridModel();
|
|
83
89
|
|
|
84
|
-
this.addReaction(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
this.addReaction(
|
|
91
|
+
{
|
|
92
|
+
track: () => this.pendingValues,
|
|
93
|
+
run: () => this.syncGrid(),
|
|
94
|
+
fireImmediately: true
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
track: () => [this.filterText, this.combineCurrentFilters],
|
|
98
|
+
run: () => this.setPendingValues(),
|
|
99
|
+
debounce: 300
|
|
100
|
+
}
|
|
101
|
+
);
|
|
89
102
|
}
|
|
90
103
|
|
|
91
104
|
syncWithFilter() {
|
|
@@ -115,6 +128,23 @@ export class ValuesTabModel extends HoistModel {
|
|
|
115
128
|
//-------------------
|
|
116
129
|
// Implementation
|
|
117
130
|
//-------------------
|
|
131
|
+
@action
|
|
132
|
+
setPendingValues() {
|
|
133
|
+
if (!this.filterText) {
|
|
134
|
+
this.doSyncWithFilter();
|
|
135
|
+
this.syncGrid();
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const {records} = this.gridModel.store,
|
|
140
|
+
currentFilterValues = flatten(map(this.columnFilters, 'value')),
|
|
141
|
+
values = map(records, it => it.get('value'));
|
|
142
|
+
|
|
143
|
+
this.pendingValues = uniq(
|
|
144
|
+
this.combineCurrentFilters ? [...currentFilterValues, ...values] : values
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
118
148
|
private getFilter() {
|
|
119
149
|
const {gridFilterModel, pendingValues, values, valueCount, field} = this,
|
|
120
150
|
included = pendingValues.map(it => gridFilterModel.fromDisplayValue(it)),
|
|
@@ -217,17 +247,10 @@ export class ValuesTabModel extends HoistModel {
|
|
|
217
247
|
onRowClicked: ({data: record}) => {
|
|
218
248
|
this.setRecsChecked(!record.get('isChecked'), record.get('value'));
|
|
219
249
|
},
|
|
250
|
+
hideHeaders: true,
|
|
220
251
|
columns: [
|
|
221
252
|
{
|
|
222
253
|
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
|
-
},
|
|
231
254
|
width: 28,
|
|
232
255
|
autosizable: false,
|
|
233
256
|
pinned: true,
|
|
@@ -245,7 +268,6 @@ export class ValuesTabModel extends HoistModel {
|
|
|
245
268
|
},
|
|
246
269
|
{
|
|
247
270
|
field: 'value',
|
|
248
|
-
displayName: '(Select All)',
|
|
249
271
|
align: 'left',
|
|
250
272
|
comparator: (v1, v2, sortDir, abs, {defaultComparator}) => {
|
|
251
273
|
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.1746553761854",
|
|
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",
|