@xh/hoist 77.0.0-SNAPSHOT.1761257771095 → 77.0.0-SNAPSHOT.1761690719868
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 +27 -0
- package/admin/jsonsearch/impl/JsonSearchImplModel.ts +1 -1
- package/admin/tabs/activity/tracking/ActivityTrackingModel.ts +1 -1
- package/admin/tabs/cluster/instances/logs/LogDisplayModel.ts +1 -1
- package/admin/tabs/cluster/instances/logs/levels/LogLevelDialogModel.ts +1 -1
- package/admin/tabs/general/config/ConfigPanelModel.ts +1 -1
- package/admin/tabs/monitor/editor/MonitorEditorDialog.ts +1 -1
- package/admin/tabs/userData/jsonblob/JsonBlobModel.ts +1 -1
- package/admin/tabs/userData/prefs/UserPreferenceModel.ts +1 -1
- package/admin/tabs/userData/prefs/editor/PrefEditorModel.ts +1 -1
- package/admin/tabs/userData/users/UserModel.ts +1 -0
- package/build/types/core/AppSpec.d.ts +14 -7
- package/build/types/data/Field.d.ts +18 -9
- package/build/types/data/Store.d.ts +2 -1
- package/build/types/data/cube/Query.d.ts +1 -1
- package/build/types/data/cube/ViewRowData.d.ts +2 -0
- package/cmp/chart/impl/copyToClipboard.ts +14 -8
- package/cmp/grid/Grid.ts +3 -2
- package/cmp/grid/impl/MenuSupport.ts +10 -15
- package/cmp/treemap/TreeMap.ts +4 -14
- package/cmp/treemap/TreeMapModel.ts +2 -2
- package/core/AppSpec.ts +14 -7
- package/data/Field.ts +24 -20
- package/data/Store.ts +21 -8
- package/data/cube/Query.ts +1 -1
- package/data/cube/ViewRowData.ts +3 -0
- package/data/cube/row/AggregateRow.ts +1 -0
- package/data/cube/row/BucketRow.ts +1 -0
- package/data/cube/row/LeafRow.ts +1 -1
- package/format/FormatNumber.ts +2 -2
- package/kit/highcharts/index.ts +2 -2
- package/package.json +1 -1
- package/promise/Promise.ts +3 -3
- package/tsconfig.tsbuildinfo +1 -1
package/data/Store.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface StoreConfig {
|
|
|
44
44
|
* Default configs applied to `Field` instances constructed internally by this Store.
|
|
45
45
|
* @see FieldSpec
|
|
46
46
|
*/
|
|
47
|
-
fieldDefaults?:
|
|
47
|
+
fieldDefaults?: Omit<FieldSpec, 'name'>;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Specification for producing an immutable unique id for each record. May be provided as
|
|
@@ -978,17 +978,20 @@ export class Store extends HoistBase {
|
|
|
978
978
|
this.summaryRecords = null;
|
|
979
979
|
}
|
|
980
980
|
|
|
981
|
-
private parseFields(
|
|
981
|
+
private parseFields(
|
|
982
|
+
fields: Array<string | FieldSpec | Field>,
|
|
983
|
+
defaults: Omit<FieldSpec, 'name'>
|
|
984
|
+
): Field[] {
|
|
982
985
|
const ret = fields.map(f => {
|
|
983
986
|
if (f instanceof Field) return f;
|
|
984
987
|
|
|
985
|
-
|
|
988
|
+
let fieldSpec: FieldSpec = isString(f) ? {name: f} : f;
|
|
986
989
|
|
|
987
990
|
if (!isEmpty(defaults)) {
|
|
988
|
-
|
|
991
|
+
fieldSpec = defaultsDeep({}, fieldSpec, defaults);
|
|
989
992
|
}
|
|
990
993
|
|
|
991
|
-
return new this.defaultFieldClass(
|
|
994
|
+
return new this.defaultFieldClass(fieldSpec);
|
|
992
995
|
});
|
|
993
996
|
|
|
994
997
|
throwIf(
|
|
@@ -1041,26 +1044,36 @@ export class Store extends HoistBase {
|
|
|
1041
1044
|
return ret;
|
|
1042
1045
|
}
|
|
1043
1046
|
|
|
1044
|
-
private createRecords(
|
|
1047
|
+
private createRecords(
|
|
1048
|
+
rawData: PlainObject[],
|
|
1049
|
+
parent: StoreRecord,
|
|
1050
|
+
recordMap: Map<StoreRecordId, StoreRecord> = new Map(),
|
|
1051
|
+
summaryRecordIds: Set<StoreRecordId> = this.summaryRecordIds
|
|
1052
|
+
) {
|
|
1045
1053
|
const {loadTreeData, loadTreeDataFrom} = this;
|
|
1054
|
+
|
|
1046
1055
|
rawData.forEach(raw => {
|
|
1047
1056
|
const rec = this.createRecord(raw, parent),
|
|
1048
1057
|
{id} = rec;
|
|
1049
1058
|
|
|
1050
1059
|
throwIf(
|
|
1051
|
-
recordMap.has(id) ||
|
|
1060
|
+
recordMap.has(id) || summaryRecordIds.has(id),
|
|
1052
1061
|
`ID ${id} is not unique. Use the 'Store.idSpec' config to resolve a unique ID for each record.`
|
|
1053
1062
|
);
|
|
1054
1063
|
|
|
1055
1064
|
recordMap.set(id, rec);
|
|
1056
1065
|
|
|
1057
1066
|
if (loadTreeData && raw[loadTreeDataFrom]) {
|
|
1058
|
-
this.createRecords(raw[loadTreeDataFrom], rec, recordMap);
|
|
1067
|
+
this.createRecords(raw[loadTreeDataFrom], rec, recordMap, summaryRecordIds);
|
|
1059
1068
|
}
|
|
1060
1069
|
});
|
|
1061
1070
|
return recordMap;
|
|
1062
1071
|
}
|
|
1063
1072
|
|
|
1073
|
+
private get summaryRecordIds(): Set<StoreRecordId> {
|
|
1074
|
+
return new Set(this.summaryRecords?.map(it => it.id) ?? []);
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1064
1077
|
private parseRaw(data: PlainObject): PlainObject {
|
|
1065
1078
|
// a) create/prepare the data object
|
|
1066
1079
|
const ret = Object.create(this._dataDefaults);
|
package/data/cube/Query.ts
CHANGED
|
@@ -109,7 +109,7 @@ export interface QueryConfig {
|
|
|
109
109
|
*
|
|
110
110
|
* This can be used to break selected aggregations into sub-groups dynamically, without having
|
|
111
111
|
* to define another dimension in the Cube and have it apply to all aggregations. See the
|
|
112
|
-
* {@link BucketSpec} interface for additional information.
|
|
112
|
+
* {@link BucketSpecFn} type and {@link BucketSpec} interface for additional information.
|
|
113
113
|
*
|
|
114
114
|
* Defaults to {@link Cube.bucketSpecFn}.
|
|
115
115
|
*/
|
package/data/cube/ViewRowData.ts
CHANGED
|
@@ -19,6 +19,9 @@ export class ViewRowData {
|
|
|
19
19
|
/** Unique id. */
|
|
20
20
|
id: string;
|
|
21
21
|
|
|
22
|
+
/** Denotes a type for the row */
|
|
23
|
+
cubeRowType: 'leaf' | 'aggregate' | 'bucket';
|
|
24
|
+
|
|
22
25
|
/**
|
|
23
26
|
* Label of the row. The dimension value or, for leaf rows. the underlying cubeId.
|
|
24
27
|
* Suitable for display, although apps will typically wish to customize leaf row rendering.
|
package/data/cube/row/LeafRow.ts
CHANGED
|
@@ -33,8 +33,8 @@ export class LeafRow extends BaseRow {
|
|
|
33
33
|
|
|
34
34
|
constructor(view: View, id: string, rawRecord: StoreRecord) {
|
|
35
35
|
super(view, id);
|
|
36
|
-
|
|
37
36
|
this.cubeRecordId = rawRecord.id;
|
|
37
|
+
this.data.cubeRowType = 'leaf';
|
|
38
38
|
this.data.cubeLabel = rawRecord.id.toString();
|
|
39
39
|
this.data.cubeDimension = null;
|
|
40
40
|
|
package/format/FormatNumber.ts
CHANGED
|
@@ -397,13 +397,13 @@ function fmtNumberString(
|
|
|
397
397
|
ret += sign;
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
if (isString(prefix)) {
|
|
400
|
+
if (isString(prefix) && prefix.trim()) {
|
|
401
401
|
ret += prefix;
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
ret += str;
|
|
405
405
|
|
|
406
|
-
if (isString(label)) {
|
|
406
|
+
if (isString(label) && label.trim()) {
|
|
407
407
|
if (labelCls) {
|
|
408
408
|
ret += fmtSpan(label, {className: labelCls, asHtml});
|
|
409
409
|
} else {
|
package/kit/highcharts/index.ts
CHANGED
|
@@ -9,8 +9,8 @@ import {checkVersion, logError} from '@xh/hoist/utils/js';
|
|
|
9
9
|
|
|
10
10
|
export let Highcharts = null;
|
|
11
11
|
|
|
12
|
-
const MIN_VERSION = '
|
|
13
|
-
const MAX_VERSION = '
|
|
12
|
+
const MIN_VERSION = '11.1.0';
|
|
13
|
+
const MAX_VERSION = '11.*.*';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Expose application versions of Highcharts to Hoist.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "77.0.0-SNAPSHOT.
|
|
3
|
+
"version": "77.0.0-SNAPSHOT.1761690719868",
|
|
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",
|
package/promise/Promise.ts
CHANGED
|
@@ -132,15 +132,15 @@ export function waitFor(
|
|
|
132
132
|
condition: () => boolean,
|
|
133
133
|
{interval = 50, timeout = 5 * SECONDS}: {interval?: number; timeout?: number} = {}
|
|
134
134
|
): Promise<void> {
|
|
135
|
-
if (
|
|
136
|
-
if (
|
|
135
|
+
if (interval <= 0) throw new Error('Invalid interval');
|
|
136
|
+
if (timeout != null && timeout <= 0) throw new Error('Invalid timeout');
|
|
137
137
|
|
|
138
138
|
const startTime = Date.now();
|
|
139
139
|
return new Promise((resolve, reject) => {
|
|
140
140
|
const resolveOnMet = () => {
|
|
141
141
|
if (condition()) {
|
|
142
142
|
resolve();
|
|
143
|
-
} else if (olderThan(startTime, timeout)) {
|
|
143
|
+
} else if (timeout != null && olderThan(startTime, timeout)) {
|
|
144
144
|
reject(Exception.timeout({interval: Date.now() - startTime}));
|
|
145
145
|
} else {
|
|
146
146
|
setTimeout(resolveOnMet, interval);
|