@xh/hoist 73.0.0-SNAPSHOT.1745976013413 → 73.0.0-SNAPSHOT.1746050068813
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 +10 -1
- package/admin/AdminUtils.ts +5 -0
- package/admin/App.scss +6 -0
- package/admin/AppModel.ts +19 -7
- package/admin/{tabs/client/clients/ClientsColumns.ts → columns/Clients.ts} +20 -53
- package/admin/columns/Core.ts +34 -35
- package/admin/columns/Rest.ts +8 -0
- package/admin/columns/Tracking.ts +144 -42
- package/admin/columns/index.ts +1 -0
- package/admin/tabs/activity/tracking/ActivityTracking.scss +18 -0
- package/admin/tabs/activity/tracking/ActivityTrackingModel.ts +309 -210
- package/admin/tabs/activity/tracking/ActivityTrackingPanel.ts +81 -51
- package/admin/tabs/activity/tracking/chart/AggChartModel.ts +218 -0
- package/admin/tabs/activity/tracking/chart/AggChartPanel.ts +61 -0
- package/admin/tabs/activity/tracking/datafields/DataFieldsEditor.ts +147 -0
- package/admin/tabs/activity/tracking/datafields/DataFieldsEditorModel.ts +133 -0
- package/admin/tabs/activity/tracking/detail/ActivityDetailModel.ts +123 -59
- package/admin/tabs/activity/tracking/detail/ActivityDetailView.ts +110 -54
- package/admin/tabs/client/ClientTab.ts +2 -4
- package/admin/tabs/client/clients/ClientsModel.ts +10 -11
- package/admin/tabs/cluster/instances/memory/MemoryMonitorModel.ts +1 -2
- package/admin/tabs/general/GeneralTab.ts +2 -0
- package/build/types/admin/AdminUtils.d.ts +2 -0
- package/build/types/admin/AppModel.d.ts +4 -1
- package/build/types/admin/{tabs/client/clients/ClientsColumns.d.ts → columns/Clients.d.ts} +3 -7
- package/build/types/admin/columns/Core.d.ts +5 -5
- package/build/types/admin/columns/Rest.d.ts +1 -0
- package/build/types/admin/columns/Tracking.d.ts +13 -4
- package/build/types/admin/columns/index.d.ts +1 -0
- package/build/types/admin/tabs/activity/tracking/ActivityTrackingModel.d.ts +31 -28
- package/build/types/admin/tabs/activity/tracking/chart/AggChartModel.d.ts +33 -0
- package/build/types/admin/tabs/activity/tracking/chart/AggChartPanel.d.ts +2 -0
- package/build/types/admin/tabs/activity/tracking/datafields/DataFieldsEditor.d.ts +2 -0
- package/build/types/admin/tabs/activity/tracking/datafields/DataFieldsEditorModel.d.ts +46 -0
- package/build/types/admin/tabs/activity/tracking/detail/ActivityDetailModel.d.ts +14 -1
- package/build/types/cmp/form/FormModel.d.ts +19 -30
- package/build/types/cmp/form/field/SubformsFieldModel.d.ts +25 -22
- package/build/types/core/HoistBase.d.ts +2 -2
- package/build/types/data/cube/CubeField.d.ts +4 -5
- package/build/types/desktop/cmp/appOption/AutoRefreshAppOption.d.ts +3 -3
- package/build/types/desktop/cmp/appOption/ThemeAppOption.d.ts +3 -3
- package/cmp/error/ErrorBoundaryModel.ts +1 -1
- package/cmp/form/FormModel.ts +20 -28
- package/cmp/form/field/SubformsFieldModel.ts +28 -22
- package/cmp/grid/columns/DatesTimes.ts +1 -2
- package/cmp/grid/impl/GridHScrollbar.ts +1 -2
- package/core/HoistBase.ts +12 -12
- package/data/cube/CubeField.ts +17 -18
- package/package.json +1 -1
- package/svc/TrackService.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/admin/tabs/activity/tracking/charts/ChartsModel.ts +0 -218
- package/admin/tabs/activity/tracking/charts/ChartsPanel.ts +0 -76
- package/build/types/admin/tabs/activity/tracking/charts/ChartsModel.d.ts +0 -34
- package/build/types/admin/tabs/activity/tracking/charts/ChartsPanel.d.ts +0 -2
- /package/admin/tabs/{client → general}/feedback/FeedbackPanel.ts +0 -0
- /package/build/types/admin/tabs/{client → general}/feedback/FeedbackPanel.d.ts +0 -0
|
@@ -13,9 +13,8 @@ import {LoadSpec, managed, XH} from '@xh/hoist/core';
|
|
|
13
13
|
import {lengthIs, required} from '@xh/hoist/data';
|
|
14
14
|
import {fmtTime, numberRenderer} from '@xh/hoist/format';
|
|
15
15
|
import {Icon} from '@xh/hoist/icon';
|
|
16
|
-
import {bindable, makeObservable} from '@xh/hoist/mobx';
|
|
16
|
+
import {bindable, makeObservable, observable, runInAction} from '@xh/hoist/mobx';
|
|
17
17
|
import {forOwn, orderBy, sortBy} from 'lodash';
|
|
18
|
-
import {observable, runInAction} from 'mobx';
|
|
19
18
|
|
|
20
19
|
export interface PastInstance {
|
|
21
20
|
name: string;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
7
|
import {configPanel} from '@xh/hoist/admin/tabs/general/config/ConfigPanel';
|
|
8
|
+
import {feedbackPanel} from '@xh/hoist/admin/tabs/general/feedback/FeedbackPanel';
|
|
8
9
|
import {tabContainer} from '@xh/hoist/cmp/tab';
|
|
9
10
|
import {hoistCmp} from '@xh/hoist/core';
|
|
10
11
|
import {Icon} from '@xh/hoist/icon';
|
|
@@ -19,6 +20,7 @@ export const generalTab = hoistCmp.factory(() =>
|
|
|
19
20
|
tabs: [
|
|
20
21
|
{id: 'about', icon: Icon.info(), content: aboutPanel},
|
|
21
22
|
{id: 'config', icon: Icon.settings(), content: configPanel},
|
|
23
|
+
{id: 'feedback', icon: Icon.comment(), content: feedbackPanel},
|
|
22
24
|
{id: 'alertBanner', icon: Icon.bullhorn(), content: alertBannerPanel}
|
|
23
25
|
]
|
|
24
26
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AppModel } from '@xh/hoist/admin/AppModel';
|
|
1
2
|
/**
|
|
2
3
|
* Generate a standardized filename for an Admin module grid export, without datestamp.
|
|
3
4
|
*/
|
|
@@ -7,3 +8,4 @@ export declare function exportFilename(moduleName: string): string;
|
|
|
7
8
|
* Returned as a closure to ensure current date is evaluated at export time.
|
|
8
9
|
*/
|
|
9
10
|
export declare function exportFilenameWithDate(moduleName: string): () => string;
|
|
11
|
+
export declare function getAppModel<T extends AppModel>(): T;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { TabConfig, TabContainerModel } from '@xh/hoist/cmp/tab';
|
|
2
|
+
import { ViewManagerModel } from '@xh/hoist/cmp/viewmanager';
|
|
2
3
|
import { HoistAppModel } from '@xh/hoist/core';
|
|
3
4
|
import { Route } from 'router5';
|
|
4
5
|
export declare class AppModel extends HoistAppModel {
|
|
5
|
-
static instance: AppModel;
|
|
6
6
|
tabModel: TabContainerModel;
|
|
7
|
+
viewManagerModels: Record<string, ViewManagerModel>;
|
|
7
8
|
static get readonly(): boolean;
|
|
8
9
|
constructor();
|
|
10
|
+
initAsync(): Promise<void>;
|
|
9
11
|
getRoutes(): Route[];
|
|
10
12
|
getAppMenuButtonExtraItems(): any[];
|
|
11
13
|
getTabRoutes(): Route[];
|
|
@@ -13,4 +15,5 @@ export declare class AppModel extends HoistAppModel {
|
|
|
13
15
|
/** Open the primary business-facing application, typically 'app'. */
|
|
14
16
|
openPrimaryApp(): void;
|
|
15
17
|
getPrimaryAppCode(): string;
|
|
18
|
+
initViewManagerModelsAsync(): Promise<void>;
|
|
16
19
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { ColumnSpec } from '@xh/hoist/cmp/grid/columns';
|
|
2
|
+
export declare const createdTime: ColumnSpec;
|
|
2
3
|
export declare const isOpen: ColumnSpec;
|
|
3
4
|
export declare const key: ColumnSpec;
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const sentMessageCount: ColumnSpec;
|
|
5
|
+
export declare const lastReceivedTime: ColumnSpec;
|
|
6
6
|
export declare const lastSentTime: ColumnSpec;
|
|
7
7
|
export declare const receivedMessageCount: ColumnSpec;
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const appVersion: ColumnSpec;
|
|
10
|
-
export declare const appBuild: ColumnSpec;
|
|
11
|
-
export declare const loadId: ColumnSpec;
|
|
12
|
-
export declare const tabId: ColumnSpec;
|
|
8
|
+
export declare const sentMessageCount: ColumnSpec;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ColumnSpec } from '@xh/hoist/cmp/grid';
|
|
3
|
-
export declare const
|
|
4
|
-
export declare
|
|
3
|
+
export declare const badgeCol: ColumnSpec;
|
|
4
|
+
export declare function badgeRenderer(v: any): "-" | import("react").ReactElement<import("@xh/hoist/cmp/badge").BadgeProps, any>;
|
|
5
5
|
export declare const description: ColumnSpec;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const name: ColumnSpec;
|
|
7
7
|
export declare const note: ColumnSpec;
|
|
8
|
+
export declare const notes: ColumnSpec;
|
|
8
9
|
export declare const timestampNoYear: ColumnSpec;
|
|
9
|
-
export declare
|
|
10
|
-
export declare const badgeCol: ColumnSpec;
|
|
10
|
+
export declare const type: ColumnSpec;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ColumnSpec } from '@xh/hoist/cmp/grid/columns';
|
|
2
2
|
export declare const dateCreated: ColumnSpec;
|
|
3
|
+
export declare const dateCreatedNoYear: ColumnSpec;
|
|
3
4
|
export declare const dateCreatedWithSec: ColumnSpec;
|
|
4
5
|
export declare const lastUpdated: ColumnSpec;
|
|
5
6
|
export declare const lastUpdatedBy: ColumnSpec;
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import { ColumnSpec } from '@xh/hoist/cmp/grid/columns';
|
|
2
|
+
import { TrackSeverity } from '@xh/hoist/core';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
export declare const appBuild: ColumnSpec;
|
|
2
5
|
export declare const appEnvironment: ColumnSpec;
|
|
3
6
|
export declare const appVersion: ColumnSpec;
|
|
4
7
|
export declare const browser: ColumnSpec;
|
|
5
|
-
export declare const severity: ColumnSpec;
|
|
6
8
|
export declare const category: ColumnSpec;
|
|
9
|
+
export declare const correlationId: ColumnSpec;
|
|
7
10
|
export declare const data: ColumnSpec;
|
|
8
11
|
export declare const day: ColumnSpec;
|
|
12
|
+
export declare const dayRange: ColumnSpec;
|
|
9
13
|
export declare const device: ColumnSpec;
|
|
14
|
+
export declare const deviceIcon: ColumnSpec;
|
|
10
15
|
export declare const elapsed: ColumnSpec;
|
|
11
16
|
export declare const entryCount: ColumnSpec;
|
|
12
17
|
export declare const entryId: ColumnSpec;
|
|
13
|
-
export declare const correlationId: ColumnSpec;
|
|
14
18
|
export declare const error: ColumnSpec;
|
|
19
|
+
export declare const instance: ColumnSpec;
|
|
20
|
+
export declare const loadId: ColumnSpec;
|
|
15
21
|
export declare const msg: ColumnSpec;
|
|
22
|
+
export declare const severity: ColumnSpec;
|
|
23
|
+
export declare const severityIcon: ColumnSpec;
|
|
24
|
+
export declare function getSeverityIcon(severity: TrackSeverity): ReactElement;
|
|
25
|
+
export declare const tabId: ColumnSpec;
|
|
16
26
|
export declare const url: ColumnSpec;
|
|
17
|
-
export declare const
|
|
27
|
+
export declare const urlPathOnly: ColumnSpec;
|
|
18
28
|
export declare const userAgent: ColumnSpec;
|
|
19
29
|
export declare const userAlertedFlag: ColumnSpec;
|
|
20
30
|
export declare const userMessageFlag: ColumnSpec;
|
|
21
|
-
export declare const dayRange: ColumnSpec;
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
+
import { ActivityTrackingDataFieldSpec, DataFieldsEditorModel } from '@xh/hoist/admin/tabs/activity/tracking/datafields/DataFieldsEditorModel';
|
|
1
2
|
import { FilterChooserModel } from '@xh/hoist/cmp/filter';
|
|
2
3
|
import { FormModel } from '@xh/hoist/cmp/form';
|
|
3
|
-
import { GridModel } from '@xh/hoist/cmp/grid';
|
|
4
|
+
import { ColumnSpec, GridModel } from '@xh/hoist/cmp/grid';
|
|
4
5
|
import { GroupingChooserModel } from '@xh/hoist/cmp/grouping';
|
|
5
|
-
import { HoistModel, LoadSpec } from '@xh/hoist/core';
|
|
6
|
+
import { HoistModel, LoadSpec, PlainObject } from '@xh/hoist/core';
|
|
6
7
|
import { Cube } from '@xh/hoist/data';
|
|
7
8
|
import { LocalDate } from '@xh/hoist/utils/datetime';
|
|
8
|
-
export declare const PERSIST_ACTIVITY: {
|
|
9
|
-
localStorageKey: string;
|
|
10
|
-
};
|
|
11
9
|
export declare class ActivityTrackingModel extends HoistModel {
|
|
12
|
-
|
|
13
|
-
localStorageKey: string;
|
|
14
|
-
};
|
|
10
|
+
/** FormModel for server-side querying controls. */
|
|
15
11
|
formModel: FormModel;
|
|
12
|
+
/** Models for data-handling components - can be rebuilt due to change in dataFields. */
|
|
16
13
|
groupingChooserModel: GroupingChooserModel;
|
|
17
14
|
cube: Cube;
|
|
18
15
|
filterChooserModel: FilterChooserModel;
|
|
19
16
|
gridModel: GridModel;
|
|
20
|
-
|
|
21
|
-
get dimensions(): string[];
|
|
17
|
+
dataFieldsEditorModel: DataFieldsEditorModel;
|
|
22
18
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* Formerly summarized server-side filters, but was misleading w/new filtering.
|
|
19
|
+
* Optional spec for fields to be extracted from additional `data` returned by track entries
|
|
20
|
+
* and promoted to top-level columns in the grids. Supports dot-delimited paths as names.
|
|
26
21
|
*/
|
|
27
|
-
|
|
22
|
+
dataFields: ActivityTrackingDataFieldSpec[];
|
|
23
|
+
showFilterChooser: boolean;
|
|
24
|
+
get enabled(): boolean;
|
|
25
|
+
get dimensions(): string[];
|
|
28
26
|
get endDay(): LocalDate;
|
|
27
|
+
get hasFilter(): boolean;
|
|
29
28
|
get maxRowOptions(): {
|
|
30
29
|
value: number;
|
|
31
30
|
label: string;
|
|
@@ -33,24 +32,28 @@ export declare class ActivityTrackingModel extends HoistModel {
|
|
|
33
32
|
get maxRows(): number;
|
|
34
33
|
/** True if data loaded from the server has been topped by maxRows. */
|
|
35
34
|
get maxRowsReached(): boolean;
|
|
35
|
+
get dataFieldCols(): ColumnSpec[];
|
|
36
|
+
get viewManagerModel(): import("../../../../cmp/viewmanager").ViewManagerModel<PlainObject>;
|
|
36
37
|
private _monthFormat;
|
|
37
|
-
private _defaultDims;
|
|
38
38
|
constructor();
|
|
39
39
|
doLoadAsync(loadSpec: LoadSpec): Promise<void>;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
adjustDates(dir: any): void;
|
|
40
|
+
setDataFields(dataFields: ActivityTrackingDataFieldSpec[]): void;
|
|
41
|
+
toggleFilterChooser(): void;
|
|
42
|
+
adjustDates(dir: 'add' | 'subtract'): void;
|
|
44
43
|
adjustStartDate(value: any, unit: any): void;
|
|
45
44
|
isInterval(value: any, unit: any): boolean;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
getComparableValForDim
|
|
52
|
-
private get defaultStartDay();
|
|
53
|
-
private get defaultEndDay();
|
|
54
|
-
private loadLookupsAsync;
|
|
45
|
+
getDisplayName(fieldName: string): string;
|
|
46
|
+
private createQueryFormModel;
|
|
47
|
+
private loadGridAsync;
|
|
48
|
+
private separateLeafRows;
|
|
49
|
+
private cubeLabelComparator;
|
|
50
|
+
private getComparableValForDim;
|
|
55
51
|
private get query();
|
|
52
|
+
private createAndSetCoreModels;
|
|
53
|
+
private createCube;
|
|
54
|
+
private createFilterChooserModel;
|
|
55
|
+
private createGroupingChooserModel;
|
|
56
|
+
private createGridModel;
|
|
57
|
+
private processRawTrackLog;
|
|
58
|
+
private getDfRenderer;
|
|
56
59
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ChartModel } from '@xh/hoist/cmp/chart';
|
|
2
|
+
import { HoistModel, SelectOption } from '@xh/hoist/core';
|
|
3
|
+
import { ActivityTrackingModel } from '../ActivityTrackingModel';
|
|
4
|
+
export declare class AggChartModel extends HoistModel {
|
|
5
|
+
activityTrackingModel: ActivityTrackingModel;
|
|
6
|
+
/**
|
|
7
|
+
* Metric to chart on Y axis - one of:
|
|
8
|
+
* - entryCount - count of total track log entries within the primary dim group.
|
|
9
|
+
* - count - count of unique secondary dim values within the primary dim group.
|
|
10
|
+
* - elapsed - avg elapsed time in ms for the primary dim group.
|
|
11
|
+
* - any other numeric, aggregated custom data field metrics, if so configured
|
|
12
|
+
*/
|
|
13
|
+
metric: string;
|
|
14
|
+
get metricLabel(): string;
|
|
15
|
+
incWeekends: boolean;
|
|
16
|
+
chartModel: ChartModel;
|
|
17
|
+
get showAsTimeseries(): boolean;
|
|
18
|
+
get selectableMetrics(): SelectOption[];
|
|
19
|
+
constructor();
|
|
20
|
+
onLinked(): void;
|
|
21
|
+
private get cube();
|
|
22
|
+
private get dimensions();
|
|
23
|
+
private get primaryDim();
|
|
24
|
+
private get primaryDimLabel();
|
|
25
|
+
private get secondaryDim();
|
|
26
|
+
private get secondaryDimLabel();
|
|
27
|
+
private get data();
|
|
28
|
+
private createChartModel;
|
|
29
|
+
private selectRow;
|
|
30
|
+
private loadChart;
|
|
31
|
+
private getSeriesData;
|
|
32
|
+
private getDisplayName;
|
|
33
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ActivityTrackingModel } from '@xh/hoist/admin/tabs/activity/tracking/ActivityTrackingModel';
|
|
2
|
+
import { FormModel, SubformsFieldModel } from '@xh/hoist/cmp/form';
|
|
3
|
+
import { HoistModel } from '@xh/hoist/core';
|
|
4
|
+
import { AggregatorToken, FieldType } from '@xh/hoist/data';
|
|
5
|
+
/**
|
|
6
|
+
* Slimmed down {@link CubeFieldSpec} for persisted specs of fields to be extracted from the `data`
|
|
7
|
+
* block of loaded track statements and promoted to top-level columns in the grids. These are the
|
|
8
|
+
* entities (stored on parent `ActivityTrackingModel`) that are edited by the this component.
|
|
9
|
+
*/
|
|
10
|
+
export interface ActivityTrackingDataFieldSpec {
|
|
11
|
+
/**
|
|
12
|
+
* Path to field data within the `data` block of each track log entry. Can be dot-delimited for
|
|
13
|
+
* nested data (e.g. `timings.preAuth`). See {@link ActivityTrackingModel.processRawTrackLog}.
|
|
14
|
+
*/
|
|
15
|
+
path: string;
|
|
16
|
+
/**
|
|
17
|
+
* Normalized name for the field for use in Cube/Grid - adds `df_` prefix to avoid conflicts
|
|
18
|
+
* and strips out dot-delimiters. See {@link ActivityTrackingModel.setDataFields}.
|
|
19
|
+
*/
|
|
20
|
+
name: string;
|
|
21
|
+
displayName?: string;
|
|
22
|
+
type?: FieldType;
|
|
23
|
+
isDimension?: boolean;
|
|
24
|
+
aggregator?: AggregatorToken;
|
|
25
|
+
}
|
|
26
|
+
export declare class DataFieldsEditorModel extends HoistModel {
|
|
27
|
+
showEditor: boolean;
|
|
28
|
+
formModel: FormModel;
|
|
29
|
+
private parentModel;
|
|
30
|
+
aggTokens: AggregatorToken[];
|
|
31
|
+
get dataFields(): SubformsFieldModel;
|
|
32
|
+
get appliedDataFieldCount(): number;
|
|
33
|
+
get hasAppliedDataFields(): boolean;
|
|
34
|
+
constructor(parentModel: ActivityTrackingModel);
|
|
35
|
+
show(): void;
|
|
36
|
+
applyAndClose(): void;
|
|
37
|
+
close(): void;
|
|
38
|
+
addField(): void;
|
|
39
|
+
cloneField(formModel: FormModel): void;
|
|
40
|
+
private syncFromParent;
|
|
41
|
+
/**
|
|
42
|
+
* Normalize field specs and set onto parent.
|
|
43
|
+
* Note, will de-dupe fields by name w/o any alert to user.
|
|
44
|
+
*/
|
|
45
|
+
private syncToParent;
|
|
46
|
+
}
|
|
@@ -6,11 +6,24 @@ export declare class ActivityDetailModel extends HoistModel {
|
|
|
6
6
|
activityTrackingModel: ActivityTrackingModel;
|
|
7
7
|
gridModel: GridModel;
|
|
8
8
|
formModel: FormModel;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Optional dot-delimited path(s) to filter the displayed `data` payload down to a particular
|
|
11
|
+
* node or nodes, for easier browsing of records with a large data payload. Multiple paths
|
|
12
|
+
* can be separated with `|`.
|
|
13
|
+
*/
|
|
14
|
+
formattedDataFilterPath: string;
|
|
15
|
+
/** Stringified, pretty-printed, optionally path-filtered `data` payload. */
|
|
16
|
+
formattedData: string;
|
|
17
|
+
get hasExtraTrackData(): boolean;
|
|
10
18
|
get hasSelection(): boolean;
|
|
11
19
|
constructor();
|
|
12
20
|
onLinked(): void;
|
|
13
21
|
private showActivityEntriesAsync;
|
|
14
22
|
private getAllLeafRows;
|
|
23
|
+
/** Extract data from a (detail) grid record and flush it into our form for display. */
|
|
15
24
|
private showEntryDetail;
|
|
25
|
+
private updateFormattedData;
|
|
26
|
+
private createAndSetCoreModels;
|
|
27
|
+
private createGridModel;
|
|
28
|
+
private createSingleEntryFormModel;
|
|
16
29
|
}
|
|
@@ -3,9 +3,7 @@ import { ValidationState } from '@xh/hoist/data';
|
|
|
3
3
|
import { BaseFieldConfig, BaseFieldModel } from './field/BaseFieldModel';
|
|
4
4
|
import { SubformsFieldConfig, SubformsFieldModel } from './field/SubformsFieldModel';
|
|
5
5
|
export interface FormConfig {
|
|
6
|
-
/**
|
|
7
|
-
* FieldModels, or configurations to create them, for all data fields managed by this FormModel.
|
|
8
|
-
*/
|
|
6
|
+
/** FieldModels, or configs to create them, for all data fields managed by the model. */
|
|
9
7
|
fields?: Array<BaseFieldModel | BaseFieldConfig | SubformsFieldConfig | SubformsFieldModel>;
|
|
10
8
|
/** Map of initial values for fields in this model. */
|
|
11
9
|
initialValues?: PlainObject;
|
|
@@ -22,28 +20,32 @@ export interface FormPersistOptions extends PersistOptions {
|
|
|
22
20
|
/** If excluding a subset of all fields, provide an array of field names. */
|
|
23
21
|
excludeFields?: string[];
|
|
24
22
|
}
|
|
23
|
+
export interface FormValidateOptions {
|
|
24
|
+
/** True to trigger display of validation errors (if any) by bound `FormField`s after validation is complete. */
|
|
25
|
+
display?: boolean;
|
|
26
|
+
}
|
|
25
27
|
/**
|
|
26
|
-
* FormModel is the main entry point for Form specification. This Model's `fields`
|
|
27
|
-
* multiple FieldModel instances, which in turn hold the state of user
|
|
28
|
-
* validation rules around editing that data.
|
|
28
|
+
* FormModel is the main entry point for Form specification. This Model's `fields` object references
|
|
29
|
+
* multiple {@link FieldModel} instances, keyed by name, which in turn hold the state of user-
|
|
30
|
+
* edited data and the validation rules around editing that data.
|
|
29
31
|
*
|
|
30
32
|
* A complete representation of all fields and data within a Form can be produced via this model's
|
|
31
|
-
*
|
|
33
|
+
* {@link getData} method, making it easy to harvest all values for e.g. submission to a server.
|
|
32
34
|
*
|
|
33
|
-
* Individual field values are also available as observables via this model's
|
|
34
|
-
* application model can setup a reaction to track changes to any value and execute app-specific
|
|
35
|
+
* Individual field values are also available as observables via this model's {@link values} proxy.
|
|
36
|
+
* An application model can setup a reaction to track changes to any value and execute app-specific
|
|
35
37
|
* logic such as disabling one field based on the state of another, or setting up cascading options.
|
|
36
38
|
*
|
|
37
39
|
* This Model provides an overall validation state, determined by the current validation state of
|
|
38
40
|
* its fields as per their configured rules and constraints.
|
|
39
41
|
*
|
|
40
|
-
* FormModels can be nested via
|
|
41
|
-
* manages a collection of child FormModels. This
|
|
42
|
+
* FormModels can be nested via {@link SubformsFieldModel}s, a specialized type of FieldModel that
|
|
43
|
+
* itself manages a collection of child FormModels. This enables forms to support editing of
|
|
42
44
|
* dynamic collections of complex objects with their own internal validation rules (e.g. a FormModel
|
|
43
45
|
* representing a market order might have multiple nested FormModels to represent execution splits,
|
|
44
46
|
* where each split has its own internal fields for broker, quantity, and time).
|
|
45
47
|
*
|
|
46
|
-
* @
|
|
48
|
+
* See {@link FieldModel} for details on state/validation maintained at the individual field level.
|
|
47
49
|
*/
|
|
48
50
|
export declare class FormModel extends HoistModel {
|
|
49
51
|
/** Container object for FieldModel instances, keyed by field name.*/
|
|
@@ -95,7 +97,6 @@ export declare class FormModel extends HoistModel {
|
|
|
95
97
|
init(initialValues?: PlainObject): void;
|
|
96
98
|
/**
|
|
97
99
|
* Set the value of one or more fields on this form.
|
|
98
|
-
*
|
|
99
100
|
* @param values - map of field name to value.
|
|
100
101
|
*/
|
|
101
102
|
setValues(values: PlainObject): void;
|
|
@@ -103,16 +104,12 @@ export declare class FormModel extends HoistModel {
|
|
|
103
104
|
get isDirty(): boolean;
|
|
104
105
|
/**
|
|
105
106
|
* The Field that is currently focused on this form.
|
|
106
|
-
*
|
|
107
|
-
* @see FieldModel.focus() for important information on this method
|
|
108
|
-
* and its limitations.
|
|
107
|
+
* See {@link FieldModel.focus} for important information on this method and its limitations.
|
|
109
108
|
*/
|
|
110
109
|
get focusedField(): BaseFieldModel;
|
|
111
110
|
/**
|
|
112
111
|
* Focus a field on this form.
|
|
113
|
-
*
|
|
114
|
-
* @see FieldModel.focus() for important information on this method
|
|
115
|
-
* and its limitations.
|
|
112
|
+
* See {@link FieldModel.focus} for important information on this method and its limitations.
|
|
116
113
|
*/
|
|
117
114
|
focusField(name: string): void;
|
|
118
115
|
get validationState(): ValidationState;
|
|
@@ -122,17 +119,9 @@ export declare class FormModel extends HoistModel {
|
|
|
122
119
|
get isValid(): boolean;
|
|
123
120
|
/** List of all validation errors for this form. */
|
|
124
121
|
get allErrors(): string[];
|
|
125
|
-
/**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
* @param opts - set 'display' to true to trigger the display of
|
|
129
|
-
* validation errors (if any) by bound FormField components after validation
|
|
130
|
-
* is complete.
|
|
131
|
-
*/
|
|
132
|
-
validateAsync(opts?: {
|
|
133
|
-
display?: boolean;
|
|
134
|
-
}): Promise<boolean>;
|
|
135
|
-
/** Trigger the display of validation errors (if any) by bound FormField components. */
|
|
122
|
+
/** Recompute all validations and return true if the form is valid. */
|
|
123
|
+
validateAsync(opts?: FormValidateOptions): Promise<boolean>;
|
|
124
|
+
/** Trigger the display of validation errors (if any) by bound `FormField`s. */
|
|
136
125
|
displayValidation(): void;
|
|
137
126
|
private createValuesProxy;
|
|
138
127
|
private initPersist;
|
|
@@ -4,32 +4,43 @@ import { FormModel } from '../FormModel';
|
|
|
4
4
|
import { BaseFieldModel, BaseFieldConfig } from './BaseFieldModel';
|
|
5
5
|
import { FormConfig } from '../FormModel';
|
|
6
6
|
export interface SubformsFieldConfig extends BaseFieldConfig {
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Config for a {@link FormModel} to be auto-created to manage and validate the data for each
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
8
11
|
subforms: FormConfig;
|
|
9
12
|
/**
|
|
10
|
-
* Initial value of this field.
|
|
11
|
-
*
|
|
13
|
+
* Initial value of this field. If a function, will be executed dynamically when form is
|
|
14
|
+
* initialized to provide value.
|
|
12
15
|
*/
|
|
13
16
|
initialValue?: any[];
|
|
14
17
|
}
|
|
18
|
+
export interface SubformAddOptions {
|
|
19
|
+
/** Initial values for the new object/subform. */
|
|
20
|
+
initialValues?: PlainObject;
|
|
21
|
+
/** Index within the collection where the new subform should be inserted. */
|
|
22
|
+
index?: number;
|
|
23
|
+
}
|
|
15
24
|
/**
|
|
16
|
-
* A data field in a form whose value is a collection of
|
|
25
|
+
* A data field in a form whose value is a collection of nested objects - all of the same shape, but
|
|
26
|
+
* with arbitrary internal complexity. A dedicated {@link FormModel} is auto-created to manage and
|
|
27
|
+
* validate each object independently.
|
|
17
28
|
*
|
|
18
|
-
* Applications should initialize this field with an array of objects.
|
|
19
|
-
*
|
|
29
|
+
* Applications should initialize this field with an array of objects. These values will be loaded
|
|
30
|
+
* into an array of managed FormModels which will form the value of this field.
|
|
20
31
|
*
|
|
21
32
|
* Applications should *not* modify the value property directly, unless they wish to reinitialize
|
|
22
|
-
* all existing form contents to new values.
|
|
23
|
-
* adjust the contents of
|
|
33
|
+
* all existing form contents to new values. Call {@link add} or {@link remove} on one of these
|
|
34
|
+
* fields to adjust the contents of its collection while preserving existing state.
|
|
24
35
|
*
|
|
25
|
-
* Validation rules for the entire collection may be specified as for any field, but
|
|
26
|
-
*
|
|
27
|
-
* validation state.
|
|
36
|
+
* Validation rules for the entire collection may be specified as for any field, but validations on
|
|
37
|
+
* the subforms will also bubble up to this field, affecting its overall validation state.
|
|
28
38
|
*/
|
|
29
39
|
export declare class SubformsFieldModel extends BaseFieldModel {
|
|
40
|
+
/** (Sub)FormModels created by this model, tracked to support cleanup. */
|
|
30
41
|
private createdModels;
|
|
31
42
|
private formConfig;
|
|
32
|
-
private origInitialValues;
|
|
43
|
+
private readonly origInitialValues;
|
|
33
44
|
constructor({ subforms, initialValue, ...rest }: SubformsFieldConfig);
|
|
34
45
|
get hasFocus(): boolean;
|
|
35
46
|
focus(): void;
|
|
@@ -49,16 +60,8 @@ export declare class SubformsFieldModel extends BaseFieldModel {
|
|
|
49
60
|
display?: boolean;
|
|
50
61
|
}): Promise<boolean>;
|
|
51
62
|
protected deriveValidationState(): ValidationState;
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
* @param initialValues - object containing initial values for new record.
|
|
56
|
-
* @param index - index in collection where subform should be inserted.
|
|
57
|
-
*/
|
|
58
|
-
add(opts?: {
|
|
59
|
-
initialValues?: PlainObject;
|
|
60
|
-
index?: number;
|
|
61
|
-
}): void;
|
|
63
|
+
/** Add a new object (subform) to this field's collection. */
|
|
64
|
+
add(opts?: SubformAddOptions): void;
|
|
62
65
|
remove(formModel: FormModel): void;
|
|
63
66
|
private parseValue;
|
|
64
67
|
private cleanupModels;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PersistOptions, DebounceSpec, Some } from './';
|
|
2
1
|
import { comparer } from '@xh/hoist/mobx';
|
|
3
2
|
import { IAutorunOptions, IReactionOptions } from 'mobx/dist/api/autorun';
|
|
4
|
-
import {
|
|
3
|
+
import { IEqualsComparer, IReactionDisposer } from 'mobx/dist/internal';
|
|
4
|
+
import { DebounceSpec, PersistOptions, Some } from './';
|
|
5
5
|
export interface HoistBaseClass {
|
|
6
6
|
new (...args: any[]): HoistBase;
|
|
7
7
|
isHoistBase: boolean;
|
|
@@ -3,11 +3,8 @@ import { Aggregator, AverageAggregator, AverageStrictAggregator, ChildCountAggre
|
|
|
3
3
|
export interface CubeFieldSpec extends FieldSpec {
|
|
4
4
|
/** True to allow this field to be used for grouping.*/
|
|
5
5
|
isDimension?: boolean;
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
* same (e.g. 'MAX').
|
|
9
|
-
*/
|
|
10
|
-
aggregator?: Aggregator | 'AVG' | 'AVG_STRICT' | 'CHILD_COUNT' | 'LEAF_COUNT' | 'MAX' | 'MIN' | 'NULL' | 'SINGLE' | 'SUM' | 'SUM_STRICT' | 'UNIQUE';
|
|
6
|
+
/** Instance of a Hoist Cube {@link Aggregator} or string token alias for one. */
|
|
7
|
+
aggregator?: Aggregator | AggregatorToken;
|
|
11
8
|
/** Function to determine if aggregation should be performed at a given level of a query result. */
|
|
12
9
|
canAggregateFn?: CanAggregateFn;
|
|
13
10
|
/** True if any further groupings below this dimension would be derivative (have only one member). */
|
|
@@ -19,6 +16,8 @@ export interface CubeFieldSpec extends FieldSpec {
|
|
|
19
16
|
*/
|
|
20
17
|
parentDimension?: string;
|
|
21
18
|
}
|
|
19
|
+
/** Convenient (and serializable) alias for one of Hoist's Cube {@link Aggregator} classes. */
|
|
20
|
+
export type AggregatorToken = 'AVG' | 'AVG_STRICT' | 'CHILD_COUNT' | 'LEAF_COUNT' | 'MAX' | 'MIN' | 'NULL' | 'SINGLE' | 'SUM' | 'SUM_STRICT' | 'UNIQUE';
|
|
22
21
|
/**
|
|
23
22
|
* @param dimension - dimension of aggregation
|
|
24
23
|
* @param value - value of record on dimension
|
|
@@ -86,7 +86,7 @@ export declare const autoRefreshAppOption: ({ formFieldProps, inputProps }?: Aut
|
|
|
86
86
|
suppressContentEditableWarning?: boolean;
|
|
87
87
|
suppressHydrationWarning?: boolean;
|
|
88
88
|
accessKey?: string;
|
|
89
|
-
autoCapitalize?: "
|
|
89
|
+
autoCapitalize?: "none" | "off" | "on" | "sentences" | "words" | "characters" | (string & {});
|
|
90
90
|
autoFocus?: boolean;
|
|
91
91
|
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only";
|
|
92
92
|
dir?: string;
|
|
@@ -121,7 +121,7 @@ export declare const autoRefreshAppOption: ({ formFieldProps, inputProps }?: Aut
|
|
|
121
121
|
results?: number;
|
|
122
122
|
security?: string;
|
|
123
123
|
unselectable?: "off" | "on";
|
|
124
|
-
inputMode?: "
|
|
124
|
+
inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal";
|
|
125
125
|
is?: string;
|
|
126
126
|
"aria-activedescendant"?: string;
|
|
127
127
|
"aria-atomic"?: boolean | "true" | "false";
|
|
@@ -140,7 +140,7 @@ export declare const autoRefreshAppOption: ({ formFieldProps, inputProps }?: Aut
|
|
|
140
140
|
"aria-description"?: string;
|
|
141
141
|
"aria-details"?: string;
|
|
142
142
|
"aria-disabled"?: boolean | "true" | "false";
|
|
143
|
-
"aria-dropeffect"?: "
|
|
143
|
+
"aria-dropeffect"?: "none" | "link" | "copy" | "execute" | "move" | "popup";
|
|
144
144
|
"aria-errormessage"?: string;
|
|
145
145
|
"aria-expanded"?: boolean | "true" | "false";
|
|
146
146
|
"aria-flowto"?: string;
|
|
@@ -84,7 +84,7 @@ export declare const themeAppOption: ({ formFieldProps, inputProps }?: ThemeAppO
|
|
|
84
84
|
suppressContentEditableWarning?: boolean;
|
|
85
85
|
suppressHydrationWarning?: boolean;
|
|
86
86
|
accessKey?: string;
|
|
87
|
-
autoCapitalize?: "
|
|
87
|
+
autoCapitalize?: "none" | "off" | "on" | "sentences" | "words" | "characters" | (string & {});
|
|
88
88
|
autoFocus?: boolean;
|
|
89
89
|
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only";
|
|
90
90
|
dir?: string;
|
|
@@ -119,7 +119,7 @@ export declare const themeAppOption: ({ formFieldProps, inputProps }?: ThemeAppO
|
|
|
119
119
|
results?: number;
|
|
120
120
|
security?: string;
|
|
121
121
|
unselectable?: "off" | "on";
|
|
122
|
-
inputMode?: "
|
|
122
|
+
inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal";
|
|
123
123
|
is?: string;
|
|
124
124
|
"aria-activedescendant"?: string;
|
|
125
125
|
"aria-atomic"?: boolean | "true" | "false";
|
|
@@ -138,7 +138,7 @@ export declare const themeAppOption: ({ formFieldProps, inputProps }?: ThemeAppO
|
|
|
138
138
|
"aria-description"?: string;
|
|
139
139
|
"aria-details"?: string;
|
|
140
140
|
"aria-disabled"?: boolean | "true" | "false";
|
|
141
|
-
"aria-dropeffect"?: "
|
|
141
|
+
"aria-dropeffect"?: "none" | "link" | "copy" | "execute" | "move" | "popup";
|
|
142
142
|
"aria-errormessage"?: string;
|
|
143
143
|
"aria-expanded"?: boolean | "true" | "false";
|
|
144
144
|
"aria-flowto"?: string;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
7
|
import {ExceptionHandlerOptions, HoistModel, XH} from '@xh/hoist/core';
|
|
8
|
+
import {action, makeObservable, observable} from '@xh/hoist/mobx';
|
|
8
9
|
import {isFunction} from 'lodash';
|
|
9
|
-
import {action, makeObservable, observable} from 'mobx';
|
|
10
10
|
import {ReactNode} from 'react';
|
|
11
11
|
|
|
12
12
|
export interface ErrorBoundaryConfig {
|