@xh/hoist 88.0.0 → 88.1.1
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 +43 -0
- package/appcontainer/AppStateModel.ts +8 -7
- package/build/types/appcontainer/AppStateModel.d.ts +0 -4
- package/build/types/cmp/store/StoreFilterField.d.ts +11 -9
- package/build/types/cmp/store/impl/StoreFilterFieldImplModel.d.ts +10 -2
- package/build/types/cmp/zoneGrid/ZoneGridModel.d.ts +6 -1
- package/build/types/desktop/cmp/grid/find/GridFindField.d.ts +11 -7
- package/build/types/desktop/cmp/grid/find/impl/GridFindFieldImplModel.d.ts +5 -1
- package/build/types/security/BaseOAuthClient.d.ts +10 -3
- package/build/types/security/Types.d.ts +5 -0
- package/build/types/security/msal/MsalClient.d.ts +2 -3
- package/cmp/store/StoreFilterField.ts +11 -9
- package/cmp/store/impl/StoreFilterFieldImplModel.ts +56 -27
- package/cmp/zoneGrid/ZoneGridModel.ts +22 -1
- package/desktop/cmp/dash/container/DashContainerModel.ts +12 -10
- package/desktop/cmp/form/FormField.ts +25 -8
- package/desktop/cmp/grid/find/GridFindField.ts +12 -8
- package/desktop/cmp/grid/find/impl/GridFindFieldImplModel.ts +59 -35
- package/docs/codemod/v88/codemod-add-accessor.mjs +1 -1
- package/docs/codemod/v88/codemod-mobx7-rename.mjs +3 -3
- package/docs/codemod/v88/codemod-remove-makeObservable.mjs +1 -1
- package/docs/upgrade-notes/v88-upgrade-notes.md +23 -4
- package/package.json +1 -1
- package/public/preflight.js +3 -1
- package/security/BaseOAuthClient.ts +17 -3
- package/security/README.md +4 -0
- package/security/Types.ts +6 -0
- package/security/authzero/AuthZeroClient.ts +11 -5
- package/security/msal/MsalClient.ts +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,49 @@
|
|
|
12
12
|
3. Plain ASCII punctuation only. Use " - " for in-sentence breaks, never an em dash.
|
|
13
13
|
-->
|
|
14
14
|
|
|
15
|
+
## 88.1.1 - 2026-10-06
|
|
16
|
+
|
|
17
|
+
### 🤖 AI Docs + Tooling
|
|
18
|
+
|
|
19
|
+
* Fixed the `@persist` ordering check in the v88 upgrade notes. It missed the stacked
|
|
20
|
+
`@persist.with({...})` form and flagged fields that were already in the correct order. The check
|
|
21
|
+
for removed `*Col` aliases now matches whole words only.
|
|
22
|
+
* Added a step to the v88 upgrade notes to restart the hoist-react MCP server after installing v88.
|
|
23
|
+
* The v88 codemods now print file paths relative to the working directory.
|
|
24
|
+
|
|
25
|
+
## 88.1.0 - 2026-10-01
|
|
26
|
+
|
|
27
|
+
### 🎁 New Features
|
|
28
|
+
|
|
29
|
+
* Both `StoreFilterField` and `GridFindField` now fully support `ZoneGrid`. Their `gridModel` prop
|
|
30
|
+
accepts a `ZoneGridModel`, in which case they search the fields mapped to the grid's zones, not
|
|
31
|
+
its two zone columns. With no prop, both bind to the nearest `GridModel` or `ZoneGridModel` in
|
|
32
|
+
context. Both now also re-derive their searchable fields when columns are shown or hidden, not
|
|
33
|
+
only when the grid's columns are replaced.
|
|
34
|
+
* `BaseOAuthClient.initAsync()` now accepts an optional `CallContextLike`, and tags its span with
|
|
35
|
+
`xh.auth.method` (`acquireSilent`, `ssoSilent`, `loginPopup`, or `loginRedirect`) so auth latency
|
|
36
|
+
can be broken down by token path. Both `MsalClient` and `AuthZeroClient` report the method, also
|
|
37
|
+
available as `BaseOAuthClient.lastAuthMethod`. Apps opt in by passing the ctx from
|
|
38
|
+
`HoistAuthModel.completeAuthAsync()` to `client.initAsync(ctx)`.
|
|
39
|
+
|
|
40
|
+
### 🐞 Bug Fixes
|
|
41
|
+
* Fixed `defaultReadonlyRenderer` reformatting plain strings that happen to parse as JSON scalars -
|
|
42
|
+
e.g. a JsonBlob token like `3473e37` rendered as `3.473e+40` in read-only form fields. Only JSON
|
|
43
|
+
objects and arrays are now pretty-printed, and other strings render as-is.
|
|
44
|
+
* Fixed `StoreFilterField` ignoring changes to its `gridModel` or `store` props after mount.
|
|
45
|
+
* Fixed app load tracking recording inflated load times for pages hidden at any point during load,
|
|
46
|
+
such as a page opened in a background tab or switched away from while loading. These loads now
|
|
47
|
+
omit `elapsed` and report `hiddenDuringLoad: true` in their data. This also drops them from the
|
|
48
|
+
server's `xh.client.load.*` metrics.
|
|
49
|
+
* Fixed `DashContainer` views intermittently rendering blank until their tab was re-selected or
|
|
50
|
+
dragged. Active state was set on a fixed timer that could fire before the view's model existed,
|
|
51
|
+
most often on slower clients. Affected tabs could also miss their context menu and title updates.
|
|
52
|
+
|
|
53
|
+
### ✨ Styles
|
|
54
|
+
|
|
55
|
+
* Increased the default width of `GridFindField` from 180px to 240px, leaving room to type once its
|
|
56
|
+
match count and nav buttons appear.
|
|
57
|
+
|
|
15
58
|
## 88.0.0 - 2026-09-29
|
|
16
59
|
|
|
17
60
|
### 💥 Breaking Changes (upgrade difficulty: 🔴 HIGH - TC39 decorators + Rsbuild, AG Grid 36, MobX 7, removals)
|
|
@@ -24,10 +24,7 @@ export class AppStateModel extends HoistModel {
|
|
|
24
24
|
suspendData: AppSuspendData;
|
|
25
25
|
accessDeniedMessage: string = 'Access Denied';
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
* Timestamp when the app first started loading, prior to even JS download/eval.
|
|
29
|
-
* Read from timestamp set on window within index.html.
|
|
30
|
-
*/
|
|
27
|
+
// Captured by preflight.js, before any Hoist JS has loaded.
|
|
31
28
|
readonly loadStarted: number = window['_xhLoadTimestamp'];
|
|
32
29
|
readonly timings: Record<AppState, number> = {} as Record<AppState, number>;
|
|
33
30
|
|
|
@@ -82,24 +79,28 @@ export class AppStateModel extends HoistModel {
|
|
|
82
79
|
// Implementation
|
|
83
80
|
//------------------
|
|
84
81
|
private trackLoad() {
|
|
85
|
-
const {timings, loadStarted} = this;
|
|
86
82
|
this.addReaction({
|
|
87
83
|
when: () => this.state === 'RUNNING',
|
|
88
84
|
run: () => {
|
|
85
|
+
const {timings, loadStarted} = this,
|
|
86
|
+
loginTime = timings.LOGIN_REQUIRED ?? 0,
|
|
87
|
+
hiddenDuringLoad = window['_xhWasHidden'];
|
|
89
88
|
XH.track({
|
|
90
89
|
category: 'App',
|
|
91
90
|
message: `Loaded ${XH.clientAppCode}`,
|
|
92
91
|
timestamp: loadStarted,
|
|
93
|
-
|
|
92
|
+
// Hidden pages may be throttled, elapsed time is misleading
|
|
93
|
+
elapsed: hiddenDuringLoad ? null : Date.now() - loadStarted - loginTime,
|
|
94
94
|
data: {
|
|
95
95
|
timings: mapKeys(timings, (v, k) => camelCase(k)),
|
|
96
|
+
hiddenDuringLoad,
|
|
96
97
|
clientHealth: XH.clientHealthService.getReport(),
|
|
97
98
|
window: this.getWindowData(),
|
|
98
99
|
screen: this.getScreenData()
|
|
99
100
|
},
|
|
100
101
|
omit: !XH.appSpec.trackAppLoad
|
|
101
102
|
});
|
|
102
|
-
this.logDebug('Load timings',
|
|
103
|
+
this.logDebug('Load timings', timings);
|
|
103
104
|
}
|
|
104
105
|
});
|
|
105
106
|
}
|
|
@@ -11,10 +11,6 @@ export declare class AppStateModel extends HoistModel {
|
|
|
11
11
|
lastActivityMs: number;
|
|
12
12
|
suspendData: AppSuspendData;
|
|
13
13
|
accessDeniedMessage: string;
|
|
14
|
-
/**
|
|
15
|
-
* Timestamp when the app first started loading, prior to even JS download/eval.
|
|
16
|
-
* Read from timestamp set on window within index.html.
|
|
17
|
-
*/
|
|
18
14
|
readonly loadStarted: number;
|
|
19
15
|
readonly timings: Record<AppState, number>;
|
|
20
16
|
private lastStateChangeTime;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GridModel } from '@xh/hoist/cmp/grid';
|
|
2
|
+
import type { ZoneGridModel } from '@xh/hoist/cmp/zoneGrid';
|
|
2
3
|
import { DefaultHoistProps, HoistModel } from '@xh/hoist/core';
|
|
3
4
|
import type { FilterMatchMode, FilterTestFn, Store } from '@xh/hoist/data';
|
|
4
5
|
export interface StoreFilterFieldProps extends DefaultHoistProps {
|
|
@@ -23,11 +24,12 @@ export interface StoreFilterFieldProps extends DefaultHoistProps {
|
|
|
23
24
|
*/
|
|
24
25
|
filterBuffer?: number;
|
|
25
26
|
/**
|
|
26
|
-
* GridModel whose Store this control should filter. When given a GridModel,
|
|
27
|
-
* will, by default, use the fields for all *visible* columns when matching, as
|
|
28
|
-
* groupBy field.
|
|
27
|
+
* GridModel or ZoneGridModel whose Store this control should filter. When given a GridModel,
|
|
28
|
+
* this component will, by default, use the fields for all *visible* columns when matching, as
|
|
29
|
+
* well as any groupBy field. When given a ZoneGridModel, it uses the fields currently mapped
|
|
30
|
+
* to any of its zones. Do not configure this and `store` on the same component.
|
|
29
31
|
*/
|
|
30
|
-
gridModel?: GridModel;
|
|
32
|
+
gridModel?: GridModel | ZoneGridModel;
|
|
31
33
|
/**
|
|
32
34
|
* Names of field(s) to include in search. Required if neither a store nor gridModel are
|
|
33
35
|
* provided, as otherwise fields cannot be inferred.
|
|
@@ -61,11 +63,11 @@ export interface StoreFilterFieldProps extends DefaultHoistProps {
|
|
|
61
63
|
* its value to the value of configured fields on a candidate object. If any field values match, the
|
|
62
64
|
* object itself is considered a match.
|
|
63
65
|
*
|
|
64
|
-
* This component is designed to be bound to a Store via either its `store` OR `gridModel` props
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* to auto-generate the fields in the store to be included in the filter and
|
|
68
|
-
* apply the filter to the Store.
|
|
66
|
+
* This component is designed to be bound to a Store via either its `store` OR `gridModel` props,
|
|
67
|
+
* the latter accepting either a GridModel or a ZoneGridModel. If not configured with either, it
|
|
68
|
+
* binds by default to the nearest GridModel or ZoneGridModel found in context. Binding in this way
|
|
69
|
+
* allows the component to auto-generate the fields in the store to be included in the filter and
|
|
70
|
+
* to automatically apply the filter to the Store.
|
|
69
71
|
*
|
|
70
72
|
* In cases where the application is combining this filter with other filters, or applying
|
|
71
73
|
* additional application logic, the filter can be managed manually by setting `autoApply` to
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GridModel } from '@xh/hoist/cmp/grid';
|
|
2
|
+
import { ZoneGridModel } from '@xh/hoist/cmp/zoneGrid';
|
|
2
3
|
import { HoistModel } from '@xh/hoist/core';
|
|
3
4
|
import type { FilterMatchMode, StoreRecord } from '@xh/hoist/data';
|
|
4
5
|
import { Store } from '@xh/hoist/data';
|
|
@@ -8,11 +9,12 @@ import { Store } from '@xh/hoist/data';
|
|
|
8
9
|
export declare class StoreFilterFieldImplModel extends HoistModel {
|
|
9
10
|
xhImpl: boolean;
|
|
10
11
|
model: any;
|
|
11
|
-
gridModel: GridModel;
|
|
12
|
-
store: Store;
|
|
13
12
|
private filter;
|
|
14
13
|
private bufferedApplyFilter;
|
|
15
14
|
get matchMode(): FilterMatchMode;
|
|
15
|
+
/** GridModel or ZoneGridModel to filter - from props, or the nearest found in context. */
|
|
16
|
+
get boundModel(): GridModel | ZoneGridModel;
|
|
17
|
+
get store(): Store;
|
|
16
18
|
onLinked(): void;
|
|
17
19
|
get filterText(): string;
|
|
18
20
|
setFilterText(v: string): void;
|
|
@@ -20,4 +22,10 @@ export declare class StoreFilterFieldImplModel extends HoistModel {
|
|
|
20
22
|
regenerateFilter(): void;
|
|
21
23
|
getActiveFields(): string[];
|
|
22
24
|
getValGetters(fieldName: string): ((record: StoreRecord) => any)[] | ((rec: StoreRecord) => any);
|
|
25
|
+
private get innerGridModel();
|
|
26
|
+
/**
|
|
27
|
+
* Columns whose fields the user can see, and so should be able to search. A ZoneGrid renders
|
|
28
|
+
* its mapped fields within two zone columns, so use the columns backing those fields instead.
|
|
29
|
+
*/
|
|
30
|
+
private getSearchColumns;
|
|
23
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CellClickedEvent, CellContextMenuEvent, CellDoubleClickedEvent, RowClickedEvent, RowDoubleClickedEvent } from '@xh/hoist/kit/ag-grid';
|
|
2
|
-
import { ColumnRenderer, ColumnSpec, GridContextMenuItemLike, GridContextMenuSpec, GridGroupSortFn, GridModel, GridSorter, GridSorterLike, GroupRowRenderer, RowClassFn, RowClassRuleFn, TreeStyle } from '@xh/hoist/cmp/grid';
|
|
2
|
+
import { Column, ColumnRenderer, ColumnSpec, GridContextMenuItemLike, GridContextMenuSpec, GridGroupSortFn, GridModel, GridSorter, GridSorterLike, GroupRowRenderer, RowClassFn, RowClassRuleFn, TreeStyle } from '@xh/hoist/cmp/grid';
|
|
3
3
|
import { Awaitable, HoistModel, LoadSpec, PlainObject, Some, Thunkable, VSide } from '@xh/hoist/core';
|
|
4
4
|
import { Store, StoreConfig, StoreRecordOrId, StoreSelectionConfig, StoreSelectionModel, StoreTransaction } from '@xh/hoist/data';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
@@ -242,6 +242,11 @@ export declare class ZoneGridModel extends HoistModel {
|
|
|
242
242
|
restoreDefaultsAsync(): Promise<boolean>;
|
|
243
243
|
showMapper(): void;
|
|
244
244
|
setMappings(mappings: Record<Zone, Some<string | ZoneMapping>>): void;
|
|
245
|
+
/**
|
|
246
|
+
* Columns backing the fields currently mapped to any zone. These columns are hidden within the
|
|
247
|
+
* underlying GridModel, but their fields are what the user sees rendered within each row.
|
|
248
|
+
*/
|
|
249
|
+
getMappedColumns(): Column[];
|
|
245
250
|
getDefaultContextMenu: () => GridContextMenuItemLike[];
|
|
246
251
|
get sortBy(): GridSorter;
|
|
247
252
|
setSortBy(cfg: GridSorterLike): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GridModel } from '@xh/hoist/cmp/grid';
|
|
2
|
+
import type { ZoneGridModel } from '@xh/hoist/cmp/zoneGrid';
|
|
2
3
|
import { LayoutProps } from '@xh/hoist/core';
|
|
3
4
|
import type { FilterMatchMode } from '@xh/hoist/data';
|
|
4
5
|
import { TextInputProps } from '@xh/hoist/desktop/cmp/input';
|
|
@@ -6,10 +7,12 @@ import '@xh/hoist/desktop/register';
|
|
|
6
7
|
import './GridFindField.scss';
|
|
7
8
|
export interface GridFindFieldProps extends TextInputProps, LayoutProps {
|
|
8
9
|
/**
|
|
9
|
-
* GridModel whose data this control should search.
|
|
10
|
-
* fields for all *visible* columns when matching, as
|
|
10
|
+
* GridModel or ZoneGridModel whose data this control should search. When given a GridModel,
|
|
11
|
+
* this component will, by default, use the fields for all *visible* columns when matching, as
|
|
12
|
+
* well as any groupBy field. When given a ZoneGridModel, it uses the fields currently mapped
|
|
13
|
+
* to any of its zones.
|
|
11
14
|
*/
|
|
12
|
-
gridModel?: GridModel;
|
|
15
|
+
gridModel?: GridModel | ZoneGridModel;
|
|
13
16
|
/** Mode to use when searching (default 'startWord'). */
|
|
14
17
|
matchMode?: FilterMatchMode;
|
|
15
18
|
/**
|
|
@@ -29,10 +32,11 @@ export interface GridFindFieldProps extends TextInputProps, LayoutProps {
|
|
|
29
32
|
* the entered search term based on simple word-boundary matching of its value to the value of
|
|
30
33
|
* configured fields on a record. If any field values match, the record itself is considered a match.
|
|
31
34
|
*
|
|
32
|
-
* This component is designed to be bound to a GridModel via `gridModel` prop.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* be searched by the field and to automatically select
|
|
35
|
+
* This component is designed to be bound to a GridModel or ZoneGridModel via its `gridModel` prop.
|
|
36
|
+
* If not configured, it binds by default to the nearest GridModel or ZoneGridModel found in
|
|
37
|
+
* context. Binding in this way allows the component to
|
|
38
|
+
* auto-generate the fields in the store to be searched by the field and to automatically select
|
|
39
|
+
* the results in the Grid.
|
|
36
40
|
*
|
|
37
41
|
* Fields to be searched can be automatically determined from the bound Grid's Store, and/or
|
|
38
42
|
* customized via the include/excludeFields props. See prop comments for details.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GridModel } from '@xh/hoist/cmp/grid';
|
|
2
|
+
import { ZoneGridModel } from '@xh/hoist/cmp/zoneGrid';
|
|
2
3
|
import { HoistModel } from '@xh/hoist/core';
|
|
3
4
|
import type { FilterMatchMode, StoreRecord } from '@xh/hoist/data';
|
|
4
5
|
import { TextInputModel } from '@xh/hoist/desktop/cmp/input';
|
|
@@ -21,7 +22,8 @@ export declare class GridFindFieldImplModel extends HoistModel {
|
|
|
21
22
|
get hasFocus(): boolean;
|
|
22
23
|
get hasQuery(): boolean;
|
|
23
24
|
get hasResults(): boolean;
|
|
24
|
-
|
|
25
|
+
/** GridModel or ZoneGridModel to search - from props, or the nearest found in context. */
|
|
26
|
+
get boundModel(): GridModel | ZoneGridModel;
|
|
25
27
|
onLinked(): void;
|
|
26
28
|
selectPrev(): void;
|
|
27
29
|
selectNext(): void;
|
|
@@ -29,4 +31,6 @@ export declare class GridFindFieldImplModel extends HoistModel {
|
|
|
29
31
|
private getRecords;
|
|
30
32
|
private getActiveFields;
|
|
31
33
|
private getValGetters;
|
|
34
|
+
private get innerGridModel();
|
|
35
|
+
private getSearchColumns;
|
|
32
36
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HoistBase } from '@xh/hoist/core';
|
|
1
|
+
import { CallContextLike, HoistBase } from '@xh/hoist/core';
|
|
2
2
|
import { Token } from '@xh/hoist/security/Token';
|
|
3
|
-
import { AccessTokenSpec, TokenMap } from './Types';
|
|
3
|
+
import { AccessTokenSpec, AuthMethod, TokenMap } from './Types';
|
|
4
4
|
export type LoginMethod = 'REDIRECT' | 'POPUP';
|
|
5
5
|
/**
|
|
6
6
|
* Base configuration shared by all OAuth client implementations. Extended by
|
|
@@ -92,6 +92,8 @@ export declare abstract class BaseOAuthClient<C extends BaseOAuthClientConfig<S>
|
|
|
92
92
|
protected idScopes: string[];
|
|
93
93
|
/** Specification for Access Tokens */
|
|
94
94
|
protected accessSpecs: Record<string, S>;
|
|
95
|
+
/** Method of last successful authentication for this client, if any. */
|
|
96
|
+
lastAuthMethod: AuthMethod;
|
|
95
97
|
private timer;
|
|
96
98
|
private lastRefreshAttempt;
|
|
97
99
|
private TIMER_INTERVAL;
|
|
@@ -100,8 +102,11 @@ export declare abstract class BaseOAuthClient<C extends BaseOAuthClientConfig<S>
|
|
|
100
102
|
constructor(config: C);
|
|
101
103
|
/**
|
|
102
104
|
* Main entry point for this object.
|
|
105
|
+
*
|
|
106
|
+
* @param ctx - tracing context, typically the one supplied to
|
|
107
|
+
* {@link HoistAuthModel.completeAuthAsync}.
|
|
103
108
|
*/
|
|
104
|
-
initAsync(): Promise<void>;
|
|
109
|
+
initAsync(ctx?: CallContextLike): Promise<void>;
|
|
105
110
|
/**
|
|
106
111
|
* Request an interactive login with the underlying OAuth provider.
|
|
107
112
|
*/
|
|
@@ -144,6 +149,8 @@ export declare abstract class BaseOAuthClient<C extends BaseOAuthClientConfig<S>
|
|
|
144
149
|
protected abstract fetchAccessTokenAsync(spec: S, useCache: boolean): Promise<Token>;
|
|
145
150
|
protected abstract doLogoutAsync(): Promise<void>;
|
|
146
151
|
protected abstract interactiveLoginNeeded(exception: unknown): boolean;
|
|
152
|
+
/** Record the path by which authentication completed. Call from `doInitAsync` and login impls. */
|
|
153
|
+
protected noteAuthComplete(authMethod: AuthMethod): void;
|
|
147
154
|
protected get redirectUrl(): string;
|
|
148
155
|
protected get postLogoutRedirectUrl(): string;
|
|
149
156
|
protected get loginMethod(): LoginMethod;
|
|
@@ -12,3 +12,8 @@ export interface AccessTokenSpec {
|
|
|
12
12
|
scopes: string[];
|
|
13
13
|
}
|
|
14
14
|
export type TokenMap = Record<string, Token>;
|
|
15
|
+
/**
|
|
16
|
+
* Path by which an OAuth client completed authentication. Not every client uses every path -
|
|
17
|
+
* e.g. only `MsalClient` supports `ssoSilent`.
|
|
18
|
+
*/
|
|
19
|
+
export type AuthMethod = 'acquireSilent' | 'ssoSilent' | 'loginPopup' | 'loginRedirect';
|
|
@@ -3,7 +3,7 @@ import { LogLevel } from '@azure/msal-browser';
|
|
|
3
3
|
import { PlainObject } from '@xh/hoist/core';
|
|
4
4
|
import { Token } from '@xh/hoist/security/Token';
|
|
5
5
|
import { BaseOAuthClient, BaseOAuthClientConfig } from '../BaseOAuthClient';
|
|
6
|
-
import { AccessTokenSpec, TokenMap } from '../Types';
|
|
6
|
+
import { AccessTokenSpec, AuthMethod, TokenMap } from '../Types';
|
|
7
7
|
/**
|
|
8
8
|
* Configuration for a {@link MsalClient} - the Microsoft Entra ID (Azure AD) OAuth client.
|
|
9
9
|
* Extends {@link BaseOAuthClientConfig} with MSAL-specific options.
|
|
@@ -122,10 +122,9 @@ export declare class MsalClient extends BaseOAuthClient<MsalClientConfig, MsalTo
|
|
|
122
122
|
private get loginExtraScopesToConsent();
|
|
123
123
|
private get refreshOffsetArgs();
|
|
124
124
|
private setAccount;
|
|
125
|
-
|
|
125
|
+
protected noteAuthComplete(authMethod: AuthMethod): void;
|
|
126
126
|
private authRequestCore;
|
|
127
127
|
}
|
|
128
|
-
type AuthMethod = 'acquireSilent' | 'ssoSilent' | 'loginPopup' | 'loginRedirect';
|
|
129
128
|
/**
|
|
130
129
|
* Telemetry produced by this client (if enabled) + included in {@link ClientHealthService}
|
|
131
130
|
* reporting. Leverages MSAL's opt-in support for emitting performance events.
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Copyright © 2026 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
7
|
import type {GridModel} from '@xh/hoist/cmp/grid';
|
|
8
|
+
import type {ZoneGridModel} from '@xh/hoist/cmp/zoneGrid';
|
|
8
9
|
import {DefaultHoistProps, hoistCmp, HoistModel, useLocalModel, XH} from '@xh/hoist/core';
|
|
9
10
|
import type {FilterMatchMode, FilterTestFn, Store} from '@xh/hoist/data';
|
|
10
11
|
import {storeFilterFieldImpl as desktopStoreFilterFieldImpl} from '@xh/hoist/dynamics/desktop';
|
|
@@ -37,11 +38,12 @@ export interface StoreFilterFieldProps extends DefaultHoistProps {
|
|
|
37
38
|
filterBuffer?: number;
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
|
-
* GridModel whose Store this control should filter. When given a GridModel,
|
|
41
|
-
* will, by default, use the fields for all *visible* columns when matching, as
|
|
42
|
-
* groupBy field.
|
|
41
|
+
* GridModel or ZoneGridModel whose Store this control should filter. When given a GridModel,
|
|
42
|
+
* this component will, by default, use the fields for all *visible* columns when matching, as
|
|
43
|
+
* well as any groupBy field. When given a ZoneGridModel, it uses the fields currently mapped
|
|
44
|
+
* to any of its zones. Do not configure this and `store` on the same component.
|
|
43
45
|
*/
|
|
44
|
-
gridModel?: GridModel;
|
|
46
|
+
gridModel?: GridModel | ZoneGridModel;
|
|
45
47
|
|
|
46
48
|
/**
|
|
47
49
|
* Names of field(s) to include in search. Required if neither a store nor gridModel are
|
|
@@ -83,11 +85,11 @@ export interface StoreFilterFieldProps extends DefaultHoistProps {
|
|
|
83
85
|
* its value to the value of configured fields on a candidate object. If any field values match, the
|
|
84
86
|
* object itself is considered a match.
|
|
85
87
|
*
|
|
86
|
-
* This component is designed to be bound to a Store via either its `store` OR `gridModel` props
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* to auto-generate the fields in the store to be included in the filter and
|
|
90
|
-
* apply the filter to the Store.
|
|
88
|
+
* This component is designed to be bound to a Store via either its `store` OR `gridModel` props,
|
|
89
|
+
* the latter accepting either a GridModel or a ZoneGridModel. If not configured with either, it
|
|
90
|
+
* binds by default to the nearest GridModel or ZoneGridModel found in context. Binding in this way
|
|
91
|
+
* allows the component to auto-generate the fields in the store to be included in the filter and
|
|
92
|
+
* to automatically apply the filter to the Store.
|
|
91
93
|
*
|
|
92
94
|
* In cases where the application is combining this filter with other filters, or applying
|
|
93
95
|
* additional application logic, the filter can be managed manually by setting `autoApply` to
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Copyright © 2026 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
|
-
import {GridModel} from '@xh/hoist/cmp/grid';
|
|
7
|
+
import {Column, GridModel} from '@xh/hoist/cmp/grid';
|
|
8
|
+
import {ZoneGridModel} from '@xh/hoist/cmp/zoneGrid';
|
|
8
9
|
import {HoistModel, lookup} from '@xh/hoist/core';
|
|
9
10
|
import type {FilterMatchMode, StoreRecord} from '@xh/hoist/data';
|
|
10
11
|
import {appendFilter, getFilterRegex, Store} from '@xh/hoist/data';
|
|
11
|
-
import {action, compareStructural} from '@xh/hoist/mobx';
|
|
12
|
-
import {stripTags, throwIf, warnIf
|
|
12
|
+
import {action, compareStructural, computed} from '@xh/hoist/mobx';
|
|
13
|
+
import {stripTags, throwIf, warnIf} from '@xh/hoist/utils/js';
|
|
13
14
|
import {
|
|
14
15
|
debounce,
|
|
15
16
|
filter,
|
|
@@ -30,9 +31,6 @@ export class StoreFilterFieldImplModel extends HoistModel {
|
|
|
30
31
|
|
|
31
32
|
@lookup('*') model;
|
|
32
33
|
|
|
33
|
-
gridModel: GridModel;
|
|
34
|
-
store: Store;
|
|
35
|
-
|
|
36
34
|
private filter: (rec: StoreRecord) => boolean;
|
|
37
35
|
private bufferedApplyFilter;
|
|
38
36
|
|
|
@@ -40,28 +38,42 @@ export class StoreFilterFieldImplModel extends HoistModel {
|
|
|
40
38
|
return this.componentProps.matchMode ?? 'startWord';
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
/** GridModel or ZoneGridModel to filter - from props, or the nearest found in context. */
|
|
42
|
+
@computed
|
|
43
|
+
get boundModel(): GridModel | ZoneGridModel {
|
|
44
|
+
const {gridModel, store} = this.componentProps;
|
|
45
|
+
if (store) return null;
|
|
46
|
+
return (
|
|
47
|
+
gridModel ??
|
|
48
|
+
this.lookupModel(it => it instanceof GridModel || it instanceof ZoneGridModel)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
45
51
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
@computed
|
|
53
|
+
get store(): Store {
|
|
54
|
+
return this.componentProps.store ?? this.boundModel?.store ?? null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
override onLinked() {
|
|
58
|
+
const {componentProps, store} = this,
|
|
59
|
+
{bind, includeFields, filterBuffer = 200} = componentProps;
|
|
60
|
+
throwIf(
|
|
61
|
+
componentProps.gridModel && componentProps.store,
|
|
62
|
+
"Cannot specify both 'gridModel' and 'store' props."
|
|
63
|
+
);
|
|
51
64
|
warnIf(
|
|
52
|
-
!
|
|
65
|
+
!store && isEmpty(includeFields),
|
|
53
66
|
"Must specify one of 'gridModel', 'store', or 'includeFields' or the filter will be a no-op."
|
|
54
67
|
);
|
|
55
68
|
throwIf(!store && !bind, "Must specify either 'bind' or a 'store' in StoreFilterField.");
|
|
56
|
-
this.store = store;
|
|
57
|
-
this.gridModel = gridModel;
|
|
58
69
|
|
|
59
70
|
this.bufferedApplyFilter = debounce(() => this.applyFilter(), filterBuffer);
|
|
60
71
|
|
|
61
72
|
this.addReaction(
|
|
62
73
|
{
|
|
63
|
-
track: () => [this.filterText,
|
|
74
|
+
track: () => [this.store, this.filterText, ...this.getSearchColumns()],
|
|
64
75
|
run: () => this.regenerateFilter(),
|
|
76
|
+
equals: 'shallow',
|
|
65
77
|
fireImmediately: true
|
|
66
78
|
},
|
|
67
79
|
{
|
|
@@ -134,22 +146,22 @@ export class StoreFilterFieldImplModel extends HoistModel {
|
|
|
134
146
|
}
|
|
135
147
|
|
|
136
148
|
getActiveFields(): string[] {
|
|
137
|
-
const {
|
|
149
|
+
const {boundModel, store, componentProps} = this,
|
|
138
150
|
{includeFields, excludeFields} = componentProps;
|
|
139
151
|
|
|
140
152
|
let ret = store ? ['id', ...store.fieldNames] : [];
|
|
141
153
|
if (includeFields) ret = store ? intersection(ret, includeFields) : includeFields;
|
|
142
154
|
if (excludeFields) ret = without(ret, ...excludeFields);
|
|
143
155
|
|
|
144
|
-
if (
|
|
145
|
-
const
|
|
156
|
+
if (boundModel) {
|
|
157
|
+
const searchCols = this.getSearchColumns();
|
|
146
158
|
|
|
147
159
|
// Push on dot-delimited grid column fields. These are supported by Grid and traverse
|
|
148
160
|
// sub-objects in StoreRecord.data to display nested properties. Given that Grid treats these
|
|
149
161
|
// as first-class fields and displays them w/o the need for renderers, we want to
|
|
150
162
|
// include them here. (But only if their "root" is in the field list derived from the
|
|
151
163
|
// Store and any given include/excludeField configs.)
|
|
152
|
-
|
|
164
|
+
searchCols.forEach(col => {
|
|
153
165
|
const {fieldPath} = col;
|
|
154
166
|
if (!isArray(fieldPath)) return;
|
|
155
167
|
|
|
@@ -167,7 +179,7 @@ export class StoreFilterFieldImplModel extends HoistModel {
|
|
|
167
179
|
ret = ret.filter(f => {
|
|
168
180
|
return (
|
|
169
181
|
(includeFields && includeFields.includes(f)) ||
|
|
170
|
-
|
|
182
|
+
searchCols.find(c => c.field === f)
|
|
171
183
|
);
|
|
172
184
|
});
|
|
173
185
|
}
|
|
@@ -176,7 +188,7 @@ export class StoreFilterFieldImplModel extends HoistModel {
|
|
|
176
188
|
}
|
|
177
189
|
|
|
178
190
|
getValGetters(fieldName: string) {
|
|
179
|
-
const {
|
|
191
|
+
const {boundModel} = this;
|
|
180
192
|
|
|
181
193
|
// If a GridModel has been configured, the user is looking at rendered values in a grid and
|
|
182
194
|
// would reasonably expect the filter to work off what they see. Rendering can be expensive,
|
|
@@ -185,12 +197,12 @@ export class StoreFilterFieldImplModel extends HoistModel {
|
|
|
185
197
|
// with a flag to manage performance tradeoffs.
|
|
186
198
|
//
|
|
187
199
|
// Note corresponding impl. in GridFindFieldModel - review together if updating.
|
|
188
|
-
if (
|
|
189
|
-
const {store} =
|
|
200
|
+
if (boundModel) {
|
|
201
|
+
const {store} = boundModel,
|
|
190
202
|
field = store.getField(fieldName);
|
|
191
203
|
|
|
192
204
|
if (field?.type === 'date' || field?.type === 'localDate') {
|
|
193
|
-
const cols = filter(
|
|
205
|
+
const cols = filter(this.getSearchColumns(), {field: fieldName});
|
|
194
206
|
|
|
195
207
|
// Empty return if no columns - even if this field has been force-included,
|
|
196
208
|
// we can't match it if we can't render it.
|
|
@@ -203,7 +215,7 @@ export class StoreFilterFieldImplModel extends HoistModel {
|
|
|
203
215
|
record,
|
|
204
216
|
field: field.name,
|
|
205
217
|
column,
|
|
206
|
-
gridModel,
|
|
218
|
+
gridModel: this.innerGridModel,
|
|
207
219
|
store,
|
|
208
220
|
agParams: null
|
|
209
221
|
},
|
|
@@ -221,4 +233,21 @@ export class StoreFilterFieldImplModel extends HoistModel {
|
|
|
221
233
|
? (rec: StoreRecord) => get(rec.data, fieldName)
|
|
222
234
|
: (rec: StoreRecord) => rec.data[fieldName];
|
|
223
235
|
}
|
|
236
|
+
|
|
237
|
+
private get innerGridModel(): GridModel {
|
|
238
|
+
const {boundModel} = this;
|
|
239
|
+
return boundModel instanceof ZoneGridModel ? boundModel.gridModel : boundModel;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Columns whose fields the user can see, and so should be able to search. A ZoneGrid renders
|
|
244
|
+
* its mapped fields within two zone columns, so use the columns backing those fields instead.
|
|
245
|
+
*/
|
|
246
|
+
private getSearchColumns(): Column[] {
|
|
247
|
+
const {boundModel} = this;
|
|
248
|
+
if (!boundModel) return [];
|
|
249
|
+
return boundModel instanceof ZoneGridModel
|
|
250
|
+
? boundModel.getMappedColumns()
|
|
251
|
+
: boundModel.getVisibleLeafColumns();
|
|
252
|
+
}
|
|
224
253
|
}
|
|
@@ -56,7 +56,17 @@ import {
|
|
|
56
56
|
import {Icon} from '@xh/hoist/icon';
|
|
57
57
|
import {action, observableRef, bindableRef} from '@xh/hoist/mobx';
|
|
58
58
|
import {executeIfFunction, throwIf, withDefault} from '@xh/hoist/utils/js';
|
|
59
|
-
import {
|
|
59
|
+
import {
|
|
60
|
+
castArray,
|
|
61
|
+
find,
|
|
62
|
+
flatMap,
|
|
63
|
+
forOwn,
|
|
64
|
+
isEmpty,
|
|
65
|
+
isFinite,
|
|
66
|
+
isPlainObject,
|
|
67
|
+
isString,
|
|
68
|
+
uniq
|
|
69
|
+
} from 'lodash';
|
|
60
70
|
import {ReactNode} from 'react';
|
|
61
71
|
import {initPersist} from './impl/InitPersist';
|
|
62
72
|
import {ZoneMapperConfig, ZoneMapperModel} from './impl/ZoneMapperModel';
|
|
@@ -445,6 +455,17 @@ export class ZoneGridModel extends HoistModel {
|
|
|
445
455
|
this.gridModel.setColumns(this.getColumns());
|
|
446
456
|
}
|
|
447
457
|
|
|
458
|
+
/**
|
|
459
|
+
* Columns backing the fields currently mapped to any zone. These columns are hidden within the
|
|
460
|
+
* underlying GridModel, but their fields are what the user sees rendered within each row.
|
|
461
|
+
*/
|
|
462
|
+
getMappedColumns(): Column[] {
|
|
463
|
+
const fields = uniq(
|
|
464
|
+
flatMap(this.mappings, zoneMappings => zoneMappings.map(it => it.field))
|
|
465
|
+
);
|
|
466
|
+
return this.gridModel.getLeafColumns().filter(col => fields.includes(col.field));
|
|
467
|
+
}
|
|
468
|
+
|
|
448
469
|
getDefaultContextMenu = (): GridContextMenuItemLike[] => [
|
|
449
470
|
'filter',
|
|
450
471
|
'-',
|
|
@@ -30,7 +30,6 @@ import {
|
|
|
30
30
|
isEqual,
|
|
31
31
|
isFinite,
|
|
32
32
|
isNil,
|
|
33
|
-
last,
|
|
34
33
|
partition,
|
|
35
34
|
reject,
|
|
36
35
|
startCase
|
|
@@ -262,6 +261,16 @@ export class DashContainerModel
|
|
|
262
261
|
{
|
|
263
262
|
track: () => this.viewState,
|
|
264
263
|
run: () => this.updateState()
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
// ViewModels are created async as GL's React roots render, after GL has fired its
|
|
267
|
+
// own active item events. Sync active state and tab headers once they exist.
|
|
268
|
+
track: () => [this.goldenLayout, this.viewModels],
|
|
269
|
+
run: () => {
|
|
270
|
+
this.refreshActiveViews();
|
|
271
|
+
this.updateTabHeaders();
|
|
272
|
+
},
|
|
273
|
+
debounce: 0
|
|
265
274
|
}
|
|
266
275
|
);
|
|
267
276
|
}
|
|
@@ -336,13 +345,8 @@ export class DashContainerModel
|
|
|
336
345
|
this.destroyGoldenLayout();
|
|
337
346
|
this.goldenLayout = this.createGoldenLayout(containerEl, stateWithViewModelIds);
|
|
338
347
|
})
|
|
339
|
-
//
|
|
348
|
+
// Hold the mask briefly while GL's React roots render and views settle.
|
|
340
349
|
.wait(500)
|
|
341
|
-
.then(() => {
|
|
342
|
-
if (refIsStale()) return;
|
|
343
|
-
this.refreshActiveViews();
|
|
344
|
-
this.updateTabHeaders();
|
|
345
|
-
})
|
|
346
350
|
.linkTo(this.loadingStateTask)
|
|
347
351
|
);
|
|
348
352
|
}
|
|
@@ -378,8 +382,6 @@ export class DashContainerModel
|
|
|
378
382
|
|
|
379
383
|
if (!isFinite(index)) index = container.contentItems.length;
|
|
380
384
|
container.addChild(goldenLayoutConfig(viewSpec, this.genViewId(specId)), index);
|
|
381
|
-
const stack = container.isStack ? container : last(container.contentItems);
|
|
382
|
-
wait(1).then(() => this.onStackActiveItemChange(stack));
|
|
383
385
|
}
|
|
384
386
|
|
|
385
387
|
/**
|
|
@@ -753,7 +755,7 @@ export class DashContainerModel
|
|
|
753
755
|
track: () => model.fullTitle,
|
|
754
756
|
run: () => {
|
|
755
757
|
// Item lookup requires a mounted react component and can miss during
|
|
756
|
-
// a GL (re)build -
|
|
758
|
+
// a GL (re)build - the viewModels reaction in the constructor covers it.
|
|
757
759
|
const item = this.getItemByViewModel(viewModelId);
|
|
758
760
|
if (!item?.tab) return;
|
|
759
761
|
|