@nebula.js/stardust 4.8.1 → 5.0.0-alpha.0
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/core/esm/dev.js +421 -326
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +4 -4
- package/core/esm/index.js.map +1 -1
- package/core/package.json +2 -2
- package/dist/stardust.dev.js +426 -328
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +14 -14
- package/dist/stardust.js.map +1 -1
- package/package.json +11 -11
- package/types/index.d.ts +11 -0
package/dist/stardust.dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust
|
|
2
|
+
* @nebula.js/stardust v5.0.0-alpha.0
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -3241,15 +3241,14 @@
|
|
|
3241
3241
|
},
|
|
3242
3242
|
dataColors() {
|
|
3243
3243
|
/** @interface Theme~DataColorSpecials */
|
|
3244
|
-
return
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
);
|
|
3244
|
+
return /** @lends Theme~DataColorSpecials */{
|
|
3245
|
+
/** @type {string} */
|
|
3246
|
+
primary: resolvedTheme.dataColors.primaryColor,
|
|
3247
|
+
/** @type {string} */
|
|
3248
|
+
nil: resolvedTheme.dataColors.nullColor,
|
|
3249
|
+
/** @type {string} */
|
|
3250
|
+
others: resolvedTheme.dataColors.othersColor
|
|
3251
|
+
};
|
|
3253
3252
|
},
|
|
3254
3253
|
uiColor(c, shift) {
|
|
3255
3254
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -3575,7 +3574,6 @@
|
|
|
3575
3574
|
}
|
|
3576
3575
|
});
|
|
3577
3576
|
}
|
|
3578
|
-
|
|
3579
3577
|
styleResolver.resolveRawTheme = raw => {
|
|
3580
3578
|
// TODO - validate format
|
|
3581
3579
|
const c = extend$2(true, {}, raw);
|
|
@@ -6952,7 +6950,7 @@
|
|
|
6952
6950
|
}
|
|
6953
6951
|
|
|
6954
6952
|
/**
|
|
6955
|
-
* @mui/styled-engine v5.14.
|
|
6953
|
+
* @mui/styled-engine v5.14.19
|
|
6956
6954
|
*
|
|
6957
6955
|
* @license MIT
|
|
6958
6956
|
* This source code is licensed under the MIT license found in the
|
|
@@ -7463,51 +7461,25 @@
|
|
|
7463
7461
|
}
|
|
7464
7462
|
return `${value}px solid`;
|
|
7465
7463
|
}
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
const
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
const
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
});
|
|
7486
|
-
const borderLeft = style$2({
|
|
7487
|
-
prop: 'borderLeft',
|
|
7488
|
-
themeKey: 'borders',
|
|
7489
|
-
transform: borderTransform
|
|
7490
|
-
});
|
|
7491
|
-
const borderColor = style$2({
|
|
7492
|
-
prop: 'borderColor',
|
|
7493
|
-
themeKey: 'palette'
|
|
7494
|
-
});
|
|
7495
|
-
const borderTopColor = style$2({
|
|
7496
|
-
prop: 'borderTopColor',
|
|
7497
|
-
themeKey: 'palette'
|
|
7498
|
-
});
|
|
7499
|
-
const borderRightColor = style$2({
|
|
7500
|
-
prop: 'borderRightColor',
|
|
7501
|
-
themeKey: 'palette'
|
|
7502
|
-
});
|
|
7503
|
-
const borderBottomColor = style$2({
|
|
7504
|
-
prop: 'borderBottomColor',
|
|
7505
|
-
themeKey: 'palette'
|
|
7506
|
-
});
|
|
7507
|
-
const borderLeftColor = style$2({
|
|
7508
|
-
prop: 'borderLeftColor',
|
|
7509
|
-
themeKey: 'palette'
|
|
7510
|
-
});
|
|
7464
|
+
function createBorderStyle(prop, transform) {
|
|
7465
|
+
return style$2({
|
|
7466
|
+
prop,
|
|
7467
|
+
themeKey: 'borders',
|
|
7468
|
+
transform
|
|
7469
|
+
});
|
|
7470
|
+
}
|
|
7471
|
+
const border = createBorderStyle('border', borderTransform);
|
|
7472
|
+
const borderTop = createBorderStyle('borderTop', borderTransform);
|
|
7473
|
+
const borderRight = createBorderStyle('borderRight', borderTransform);
|
|
7474
|
+
const borderBottom = createBorderStyle('borderBottom', borderTransform);
|
|
7475
|
+
const borderLeft = createBorderStyle('borderLeft', borderTransform);
|
|
7476
|
+
const borderColor = createBorderStyle('borderColor');
|
|
7477
|
+
const borderTopColor = createBorderStyle('borderTopColor');
|
|
7478
|
+
const borderRightColor = createBorderStyle('borderRightColor');
|
|
7479
|
+
const borderBottomColor = createBorderStyle('borderBottomColor');
|
|
7480
|
+
const borderLeftColor = createBorderStyle('borderLeftColor');
|
|
7481
|
+
const outline = createBorderStyle('outline', borderTransform);
|
|
7482
|
+
const outlineColor = createBorderStyle('outlineColor');
|
|
7511
7483
|
|
|
7512
7484
|
// false positive
|
|
7513
7485
|
// eslint-disable-next-line react/function-component-definition
|
|
@@ -7523,7 +7495,7 @@
|
|
|
7523
7495
|
};
|
|
7524
7496
|
borderRadius$1.propTypes = {};
|
|
7525
7497
|
borderRadius$1.filterProps = ['borderRadius'];
|
|
7526
|
-
compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius$1);
|
|
7498
|
+
compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius$1, outline, outlineColor);
|
|
7527
7499
|
|
|
7528
7500
|
// false positive
|
|
7529
7501
|
// eslint-disable-next-line react/function-component-definition
|
|
@@ -7721,6 +7693,13 @@
|
|
|
7721
7693
|
borderLeftColor: {
|
|
7722
7694
|
themeKey: 'palette'
|
|
7723
7695
|
},
|
|
7696
|
+
outline: {
|
|
7697
|
+
themeKey: 'borders',
|
|
7698
|
+
transform: borderTransform
|
|
7699
|
+
},
|
|
7700
|
+
outlineColor: {
|
|
7701
|
+
themeKey: 'palette'
|
|
7702
|
+
},
|
|
7724
7703
|
borderRadius: {
|
|
7725
7704
|
themeKey: 'shape.borderRadius',
|
|
7726
7705
|
style: borderRadius$1
|
|
@@ -11820,7 +11799,7 @@
|
|
|
11820
11799
|
return cache[key];
|
|
11821
11800
|
}
|
|
11822
11801
|
|
|
11823
|
-
const NEBULA_VERSION_HASH = "
|
|
11802
|
+
const NEBULA_VERSION_HASH = "117f" ;
|
|
11824
11803
|
ClassNameGenerator$1.configure(componentName => {
|
|
11825
11804
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
11826
11805
|
});
|
|
@@ -11831,9 +11810,49 @@
|
|
|
11831
11810
|
translator: null,
|
|
11832
11811
|
constraints: {},
|
|
11833
11812
|
interactions: {},
|
|
11834
|
-
themeApi: null
|
|
11813
|
+
themeApi: null,
|
|
11814
|
+
modelStore: {},
|
|
11815
|
+
selectionStore: {}
|
|
11835
11816
|
});
|
|
11836
11817
|
|
|
11818
|
+
const DEFAULT_INTERACTIONS = {
|
|
11819
|
+
active: true,
|
|
11820
|
+
select: true,
|
|
11821
|
+
passive: true,
|
|
11822
|
+
edit: false
|
|
11823
|
+
};
|
|
11824
|
+
function pickConstraintsOrInteractions(context) {
|
|
11825
|
+
const {
|
|
11826
|
+
constraints = {},
|
|
11827
|
+
interactions = {}
|
|
11828
|
+
} = context;
|
|
11829
|
+
// If some interaction is defined, then we use that
|
|
11830
|
+
if (Object.keys(interactions).length > 0) {
|
|
11831
|
+
return interactions;
|
|
11832
|
+
}
|
|
11833
|
+
const ret = {};
|
|
11834
|
+
Object.keys(constraints).forEach(state => {
|
|
11835
|
+
ret[state] = !constraints[state];
|
|
11836
|
+
});
|
|
11837
|
+
return ret;
|
|
11838
|
+
}
|
|
11839
|
+
function unifyContraintsAndInteractions(context) {
|
|
11840
|
+
const interactions = {};
|
|
11841
|
+
const constraints = {};
|
|
11842
|
+
const definedSettings = pickConstraintsOrInteractions(context);
|
|
11843
|
+
Object.keys(DEFAULT_INTERACTIONS).forEach(state => {
|
|
11844
|
+
if (definedSettings[state] !== undefined) {
|
|
11845
|
+
interactions[state] = definedSettings[state];
|
|
11846
|
+
constraints[state] = !definedSettings[state];
|
|
11847
|
+
} else {
|
|
11848
|
+
interactions[state] = DEFAULT_INTERACTIONS[state];
|
|
11849
|
+
constraints[state] = !DEFAULT_INTERACTIONS[state];
|
|
11850
|
+
}
|
|
11851
|
+
});
|
|
11852
|
+
context.constraints = constraints;
|
|
11853
|
+
context.interactions = interactions;
|
|
11854
|
+
}
|
|
11855
|
+
|
|
11837
11856
|
var createKeyStore = (function () {
|
|
11838
11857
|
let initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11839
11858
|
let applyMiddleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => {};
|
|
@@ -11876,169 +11895,97 @@
|
|
|
11876
11895
|
return [useKeyStore, store];
|
|
11877
11896
|
});
|
|
11878
11897
|
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
} = _ref;
|
|
11888
|
-
const key = "".concat(app.id);
|
|
11889
|
-
const end = async function () {
|
|
11890
|
-
let accept = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
11891
|
-
const {
|
|
11892
|
-
model,
|
|
11893
|
-
objectSelections
|
|
11894
|
-
} = modalObjectStore.get(key) || {};
|
|
11895
|
-
if (model) {
|
|
11896
|
-
await model.endSelections(accept);
|
|
11897
|
-
modalObjectStore.clear(key);
|
|
11898
|
-
objectSelections.emit('deactivated');
|
|
11899
|
-
}
|
|
11900
|
-
};
|
|
11901
|
-
const begin = async _ref2 => {
|
|
11902
|
-
var _modalObjectStore$get;
|
|
11898
|
+
function initializeStores$1(appId) {
|
|
11899
|
+
const [useRpcResultStore, rpcResultStore] = createKeyStore({});
|
|
11900
|
+
const [useRpcRequestStore, rpcRequestStore] = createKeyStore({});
|
|
11901
|
+
const [useRpcRequestSessionModelStore, rpcRequestSessionModelStore] = createKeyStore({});
|
|
11902
|
+
const [useRpcRequestModelStore, rpcRequestModelStore] = createKeyStore({});
|
|
11903
|
+
const [useModelChangedStore, modelChangedStore] = createKeyStore({});
|
|
11904
|
+
const [, modelInitializedStore] = createKeyStore({});
|
|
11905
|
+
const modelStoreMiddleware = _ref => {
|
|
11903
11906
|
let {
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
}
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11907
|
+
type,
|
|
11908
|
+
value: model
|
|
11909
|
+
} = _ref;
|
|
11910
|
+
const initialized = modelInitializedStore.get(model.id);
|
|
11911
|
+
modelInitializedStore.set(model.id, {});
|
|
11912
|
+
const onChanged = () => {
|
|
11913
|
+
rpcRequestStore.clear(model.id);
|
|
11914
|
+
modelChangedStore.set(model.id, {});
|
|
11915
|
+
modelChangedStore.dispatch(true); // Force new state to trigger hooks
|
|
11916
|
+
};
|
|
11917
|
+
const unsubscribe = () => {
|
|
11918
|
+
model.removeListener('changed', onChanged);
|
|
11919
|
+
rpcResultStore.clear(model.id);
|
|
11920
|
+
rpcRequestStore.clear(model.id);
|
|
11921
|
+
rpcRequestSessionModelStore.clear(model.id);
|
|
11922
|
+
rpcRequestModelStore.clear(model.id);
|
|
11923
|
+
modelChangedStore.clear(model.id);
|
|
11924
|
+
modelInitializedStore.clear(model.id);
|
|
11925
|
+
};
|
|
11926
|
+
switch (type) {
|
|
11927
|
+
case 'SET':
|
|
11928
|
+
if (!initialized) {
|
|
11929
|
+
model.on('changed', onChanged);
|
|
11930
|
+
model.once('closed', () => {
|
|
11931
|
+
unsubscribe();
|
|
11932
|
+
});
|
|
11933
|
+
}
|
|
11934
|
+
break;
|
|
11912
11935
|
}
|
|
11913
|
-
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
model
|
|
11920
|
-
objectSelections
|
|
11936
|
+
return unsubscribe;
|
|
11937
|
+
};
|
|
11938
|
+
const [useModelStore, modelStore] = createKeyStore({}, modelStoreMiddleware);
|
|
11939
|
+
const subscribe = model => {
|
|
11940
|
+
const unsubscribe = modelStoreMiddleware({
|
|
11941
|
+
type: 'SET',
|
|
11942
|
+
value: model
|
|
11921
11943
|
});
|
|
11922
|
-
|
|
11923
|
-
|
|
11924
|
-
|
|
11925
|
-
await model.beginSelections(p);
|
|
11926
|
-
modalObjectStore.set(key, {
|
|
11927
|
-
model,
|
|
11928
|
-
objectSelections
|
|
11929
|
-
}); // We have a modal
|
|
11930
|
-
} catch (err) {
|
|
11931
|
-
if (err.code === 6003 && !skipRetry) {
|
|
11932
|
-
await app.abortModal(accept);
|
|
11933
|
-
beginSelections(true);
|
|
11934
|
-
} else {
|
|
11935
|
-
modalObjectStore.clear(key); // No modal
|
|
11936
|
-
}
|
|
11937
|
-
}
|
|
11944
|
+
return () => {
|
|
11945
|
+
unsubscribe();
|
|
11946
|
+
modelStore.clear(model.id);
|
|
11938
11947
|
};
|
|
11939
|
-
|
|
11940
|
-
await beginSelections();
|
|
11941
11948
|
};
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
isModal(objectSelections) {
|
|
11958
|
-
var _modalObjectStore$get2;
|
|
11959
|
-
// TODO check model state
|
|
11960
|
-
return objectSelections ? ((_modalObjectStore$get2 = modalObjectStore.get(key)) === null || _modalObjectStore$get2 === void 0 ? void 0 : _modalObjectStore$get2.objectSelections) === objectSelections : !!modalObjectStore.get(key);
|
|
11961
|
-
},
|
|
11962
|
-
forward() {
|
|
11963
|
-
return appModal.end().then(() => app.forward());
|
|
11964
|
-
},
|
|
11965
|
-
back() {
|
|
11966
|
-
return appModal.end().then(() => app.back());
|
|
11967
|
-
},
|
|
11968
|
-
clear() {
|
|
11969
|
-
return appModal.end().then(() => app.clearAll());
|
|
11970
|
-
},
|
|
11971
|
-
clearField(field) {
|
|
11972
|
-
let state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '$';
|
|
11973
|
-
return appModal.end().then(() => app.getField(field, state).then(f => f.clear()));
|
|
11974
|
-
}
|
|
11949
|
+
return {
|
|
11950
|
+
subscribe,
|
|
11951
|
+
useModelStore,
|
|
11952
|
+
modelStore,
|
|
11953
|
+
useModelChangedStore,
|
|
11954
|
+
useRpcResultStore,
|
|
11955
|
+
rpcResultStore,
|
|
11956
|
+
useRpcRequestStore,
|
|
11957
|
+
rpcRequestStore,
|
|
11958
|
+
useRpcRequestModelStore,
|
|
11959
|
+
rpcRequestModelStore,
|
|
11960
|
+
useRpcRequestSessionModelStore,
|
|
11961
|
+
rpcRequestSessionModelStore,
|
|
11962
|
+
modelChangedStore,
|
|
11963
|
+
appId
|
|
11975
11964
|
};
|
|
11976
|
-
return appSelections;
|
|
11977
|
-
}
|
|
11978
|
-
function useAppSelections(app) {
|
|
11979
|
-
if (!app.session) {
|
|
11980
|
-
// assume the app is mocked if session is undefined
|
|
11981
|
-
return [];
|
|
11982
|
-
}
|
|
11983
|
-
const [appSelectionsStore] = useAppSelectionsStore();
|
|
11984
|
-
const key = app ? app.id : null;
|
|
11985
|
-
let appSelections = appSelectionsStore.get(key);
|
|
11986
|
-
reactExports.useEffect(() => {
|
|
11987
|
-
if (!app || appSelections) return;
|
|
11988
|
-
appSelections = createAppSelections({
|
|
11989
|
-
app
|
|
11990
|
-
});
|
|
11991
|
-
appSelectionsStore.set(key, appSelections);
|
|
11992
|
-
appSelectionsStore.dispatch(true);
|
|
11993
|
-
}, [app]);
|
|
11994
|
-
return [appSelections];
|
|
11995
11965
|
}
|
|
11996
11966
|
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
12007
|
-
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
return interactions;
|
|
12011
|
-
}
|
|
12012
|
-
const ret = {};
|
|
12013
|
-
Object.keys(constraints).forEach(state => {
|
|
12014
|
-
ret[state] = !constraints[state];
|
|
12015
|
-
});
|
|
12016
|
-
return ret;
|
|
12017
|
-
}
|
|
12018
|
-
function unifyContraintsAndInteractions(context) {
|
|
12019
|
-
const interactions = {};
|
|
12020
|
-
const constraints = {};
|
|
12021
|
-
const definedSettings = pickConstraintsOrInteractions(context);
|
|
12022
|
-
Object.keys(DEFAULT_INTERACTIONS).forEach(state => {
|
|
12023
|
-
if (definedSettings[state] !== undefined) {
|
|
12024
|
-
interactions[state] = definedSettings[state];
|
|
12025
|
-
constraints[state] = !definedSettings[state];
|
|
12026
|
-
} else {
|
|
12027
|
-
interactions[state] = DEFAULT_INTERACTIONS[state];
|
|
12028
|
-
constraints[state] = !DEFAULT_INTERACTIONS[state];
|
|
12029
|
-
}
|
|
12030
|
-
});
|
|
12031
|
-
context.constraints = constraints;
|
|
12032
|
-
context.interactions = interactions;
|
|
11967
|
+
function initializeStores(appId) {
|
|
11968
|
+
const [useAppSelectionsStore, appSelectionsStore] = createKeyStore({});
|
|
11969
|
+
const [useAppModalStore, appModalStore] = createKeyStore({});
|
|
11970
|
+
const [useModalObjectStore, modalObjectStore] = createKeyStore({});
|
|
11971
|
+
return {
|
|
11972
|
+
useAppSelectionsStore,
|
|
11973
|
+
useAppModalStore,
|
|
11974
|
+
appSelectionsStore,
|
|
11975
|
+
appModalStore,
|
|
11976
|
+
useModalObjectStore,
|
|
11977
|
+
modalObjectStore,
|
|
11978
|
+
appId
|
|
11979
|
+
};
|
|
12033
11980
|
}
|
|
12034
11981
|
|
|
12035
11982
|
const NebulaApp = reactExports.forwardRef((_ref, ref) => {
|
|
12036
11983
|
let {
|
|
12037
11984
|
initialContext,
|
|
12038
|
-
|
|
12039
|
-
|
|
11985
|
+
renderCallback,
|
|
11986
|
+
modelStore,
|
|
11987
|
+
selectionStore
|
|
12040
11988
|
} = _ref;
|
|
12041
|
-
const [appSelections] = useAppSelections(app);
|
|
12042
11989
|
const [context, setContext] = reactExports.useState(initialContext);
|
|
12043
11990
|
const [muiThemeName, setMuiThemeName] = reactExports.useState();
|
|
12044
11991
|
const {
|
|
@@ -12058,9 +12005,12 @@
|
|
|
12058
12005
|
setComponents([...comps]);
|
|
12059
12006
|
},
|
|
12060
12007
|
setMuiThemeName,
|
|
12061
|
-
setContext: ctx => setContext(oldContext => JSON.stringify(oldContext) !== JSON.stringify(ctx) ? ctx : oldContext)
|
|
12062
|
-
getAppSelections: () => appSelections
|
|
12008
|
+
setContext: ctx => setContext(oldContext => JSON.stringify(oldContext) !== JSON.stringify(ctx) ? ctx : oldContext)
|
|
12063
12009
|
}), []);
|
|
12010
|
+
if (context) {
|
|
12011
|
+
context.modelStore = modelStore;
|
|
12012
|
+
context.selectionStore = selectionStore;
|
|
12013
|
+
}
|
|
12064
12014
|
return /*#__PURE__*/React.createElement(StyledEngineProvider, {
|
|
12065
12015
|
injectFirst: true
|
|
12066
12016
|
}, /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
@@ -12081,18 +12031,21 @@
|
|
|
12081
12031
|
const appRef = React.createRef();
|
|
12082
12032
|
const element = document.createElement('div');
|
|
12083
12033
|
element.style.display = 'none';
|
|
12084
|
-
element.setAttribute('data-nebulajs-version', "
|
|
12034
|
+
element.setAttribute('data-nebulajs-version', "5.0.0-alpha.0" );
|
|
12085
12035
|
element.setAttribute('data-app-id', app.id);
|
|
12086
12036
|
document.body.appendChild(element);
|
|
12087
12037
|
if (context) {
|
|
12088
12038
|
unifyContraintsAndInteractions(context);
|
|
12089
12039
|
}
|
|
12040
|
+
const modelStore = initializeStores$1(app.id);
|
|
12041
|
+
const selectionStore = initializeStores(app.id);
|
|
12090
12042
|
const root = client.createRoot(element);
|
|
12091
12043
|
root.render( /*#__PURE__*/React.createElement(NebulaApp, {
|
|
12092
12044
|
ref: appRef,
|
|
12093
|
-
app: app,
|
|
12094
12045
|
initialContext: context,
|
|
12095
|
-
renderCallback: resolveRender
|
|
12046
|
+
renderCallback: resolveRender,
|
|
12047
|
+
modelStore: modelStore,
|
|
12048
|
+
selectionStore: selectionStore
|
|
12096
12049
|
}));
|
|
12097
12050
|
const cells = {};
|
|
12098
12051
|
const components = [];
|
|
@@ -12141,12 +12094,8 @@
|
|
|
12141
12094
|
}
|
|
12142
12095
|
appRef.current.setContext(ctx);
|
|
12143
12096
|
})();
|
|
12144
|
-
},
|
|
12145
|
-
getAppSelections: async () => {
|
|
12146
|
-
await rendered;
|
|
12147
|
-
return appRef.current.getAppSelections();
|
|
12148
12097
|
}
|
|
12149
|
-
}, appRef, rendered];
|
|
12098
|
+
}, modelStore, selectionStore, appRef, rendered];
|
|
12150
12099
|
}
|
|
12151
12100
|
|
|
12152
12101
|
function getSvgIconUtilityClass(slot) {
|
|
@@ -16888,11 +16837,14 @@
|
|
|
16888
16837
|
});
|
|
16889
16838
|
var Badge$1 = Badge;
|
|
16890
16839
|
|
|
16840
|
+
const boxClasses = generateUtilityClasses('MuiBox', ['root']);
|
|
16841
|
+
var boxClasses$1 = boxClasses;
|
|
16842
|
+
|
|
16891
16843
|
const defaultTheme = createTheme();
|
|
16892
16844
|
const Box = createBox({
|
|
16893
16845
|
themeId: THEME_ID,
|
|
16894
16846
|
defaultTheme,
|
|
16895
|
-
defaultClassName:
|
|
16847
|
+
defaultClassName: boxClasses$1.root,
|
|
16896
16848
|
generateClassName: ClassNameGenerator$1.generate
|
|
16897
16849
|
});
|
|
16898
16850
|
var Box$1 = Box;
|
|
@@ -18672,10 +18624,10 @@
|
|
|
18672
18624
|
color: "text.secondary",
|
|
18673
18625
|
children: children
|
|
18674
18626
|
}) : /*#__PURE__*/jsxRuntimeExports.jsxs(reactExports.Fragment, {
|
|
18675
|
-
children: [position === 'start' ? /* notranslate needed while Google Translate will not fix zero-width space issue */_span$1 || (_span$1 = /*#__PURE__*/jsxRuntimeExports.jsx("span", {
|
|
18627
|
+
children: [position === 'start' ? ( /* notranslate needed while Google Translate will not fix zero-width space issue */_span$1 || (_span$1 = /*#__PURE__*/jsxRuntimeExports.jsx("span", {
|
|
18676
18628
|
className: "notranslate",
|
|
18677
18629
|
children: "\u200B"
|
|
18678
|
-
})) : null, children]
|
|
18630
|
+
}))) : null, children]
|
|
18679
18631
|
})
|
|
18680
18632
|
}))
|
|
18681
18633
|
});
|
|
@@ -20849,57 +20801,36 @@
|
|
|
20849
20801
|
});
|
|
20850
20802
|
var Tooltip$1 = Tooltip;
|
|
20851
20803
|
|
|
20852
|
-
|
|
20853
|
-
|
|
20854
|
-
|
|
20855
|
-
|
|
20856
|
-
|
|
20857
|
-
|
|
20858
|
-
|
|
20859
|
-
|
|
20860
|
-
|
|
20861
|
-
|
|
20862
|
-
|
|
20863
|
-
|
|
20864
|
-
|
|
20865
|
-
const
|
|
20866
|
-
|
|
20867
|
-
|
|
20868
|
-
|
|
20869
|
-
|
|
20870
|
-
|
|
20871
|
-
const
|
|
20872
|
-
|
|
20873
|
-
|
|
20874
|
-
|
|
20875
|
-
|
|
20876
|
-
|
|
20877
|
-
|
|
20878
|
-
|
|
20879
|
-
};
|
|
20880
|
-
|
|
20881
|
-
|
|
20882
|
-
if (!initialized) {
|
|
20883
|
-
model.on('changed', onChanged);
|
|
20884
|
-
model.once('closed', () => {
|
|
20885
|
-
unsubscribe();
|
|
20886
|
-
});
|
|
20887
|
-
}
|
|
20888
|
-
break;
|
|
20889
|
-
}
|
|
20890
|
-
return unsubscribe;
|
|
20891
|
-
};
|
|
20892
|
-
const [useModelStore, modelStore] = createKeyStore({}, modelStoreMiddleware);
|
|
20893
|
-
const subscribe = model => {
|
|
20894
|
-
const unsubscribe = modelStoreMiddleware({
|
|
20895
|
-
type: 'SET',
|
|
20896
|
-
value: model
|
|
20897
|
-
});
|
|
20898
|
-
return () => {
|
|
20899
|
-
unsubscribe();
|
|
20900
|
-
modelStore.clear(model.id);
|
|
20901
|
-
};
|
|
20902
|
-
};
|
|
20804
|
+
function useModelStore() {
|
|
20805
|
+
const {
|
|
20806
|
+
useModelStore: useFunc
|
|
20807
|
+
} = reactExports.useContext(InstanceContext).modelStore;
|
|
20808
|
+
return useFunc();
|
|
20809
|
+
}
|
|
20810
|
+
function useModelChangedStore() {
|
|
20811
|
+
const {
|
|
20812
|
+
useModelChangedStore: useFunc
|
|
20813
|
+
} = reactExports.useContext(InstanceContext).modelStore;
|
|
20814
|
+
return useFunc();
|
|
20815
|
+
}
|
|
20816
|
+
function useRpcResultStore() {
|
|
20817
|
+
const {
|
|
20818
|
+
useRpcResultStore: useFunc
|
|
20819
|
+
} = reactExports.useContext(InstanceContext).modelStore;
|
|
20820
|
+
return useFunc();
|
|
20821
|
+
}
|
|
20822
|
+
function useRpcRequestStore() {
|
|
20823
|
+
const {
|
|
20824
|
+
useRpcRequestStore: useFunc
|
|
20825
|
+
} = reactExports.useContext(InstanceContext).modelStore;
|
|
20826
|
+
return useFunc();
|
|
20827
|
+
}
|
|
20828
|
+
function useRpcRequestSessionModelStore() {
|
|
20829
|
+
const {
|
|
20830
|
+
useRpcRequestSessionModelStore: useFunc
|
|
20831
|
+
} = reactExports.useContext(InstanceContext).modelStore;
|
|
20832
|
+
return useFunc();
|
|
20833
|
+
}
|
|
20903
20834
|
|
|
20904
20835
|
function useSessionModel(definition, app) {
|
|
20905
20836
|
const key = app ? "".concat(app.id, "/").concat(JSON.stringify(definition)) : null;
|
|
@@ -22027,7 +21958,6 @@
|
|
|
22027
21958
|
if (frequencyMode === 'P') {
|
|
22028
21959
|
return sizes.freqMinWidth; // because it will never grow beyond "100.0%"
|
|
22029
21960
|
}
|
|
22030
|
-
|
|
22031
21961
|
return sizes.freqMaxWidth;
|
|
22032
21962
|
};
|
|
22033
21963
|
const getSelectedStyle = _ref3 => {
|
|
@@ -23034,7 +22964,6 @@
|
|
|
23034
22964
|
} else {
|
|
23035
22965
|
return; // propagate to other Esc handler
|
|
23036
22966
|
}
|
|
23037
|
-
|
|
23038
22967
|
break;
|
|
23039
22968
|
case KEYS.HOME:
|
|
23040
22969
|
focusListItems.setFirst(true);
|
|
@@ -23068,7 +22997,6 @@
|
|
|
23068
22997
|
return;
|
|
23069
22998
|
// don't stop propagation since we want to outsource keydown to other handlers.
|
|
23070
22999
|
}
|
|
23071
|
-
|
|
23072
23000
|
if (elementToFocus) {
|
|
23073
23001
|
elementToFocus.focus();
|
|
23074
23002
|
}
|
|
@@ -23234,7 +23162,6 @@
|
|
|
23234
23162
|
if (!cell) {
|
|
23235
23163
|
return null; // prevent rendering empty rows
|
|
23236
23164
|
}
|
|
23237
|
-
|
|
23238
23165
|
const isGridCol = dataLayout === 'grid' && layoutOrder === 'column';
|
|
23239
23166
|
const label = (_cell$qText = cell === null || cell === void 0 ? void 0 : cell.qText) !== null && _cell$qText !== void 0 ? _cell$qText : '';
|
|
23240
23167
|
// Search highlights. Split up labelText span into several and add the highlighted class to matching sub-strings.
|
|
@@ -25977,7 +25904,6 @@
|
|
|
25977
25904
|
if (s.scrollPosition === 'overflowEnd') {
|
|
25978
25905
|
return; // Do keyScroll.reset() in fetchData() to avoid scrolling to top.
|
|
25979
25906
|
}
|
|
25980
|
-
|
|
25981
25907
|
keyScroll.reset();
|
|
25982
25908
|
}, [keyScroll.state.up, keyScroll.state.down, keyScroll.state.scrollPosition]);
|
|
25983
25909
|
const {
|
|
@@ -26956,6 +26882,128 @@
|
|
|
26956
26882
|
});
|
|
26957
26883
|
}
|
|
26958
26884
|
|
|
26885
|
+
/* eslint no-underscore-dangle: 0 */
|
|
26886
|
+
function createAppSelections(_ref) {
|
|
26887
|
+
let {
|
|
26888
|
+
app,
|
|
26889
|
+
selectionStore
|
|
26890
|
+
} = _ref;
|
|
26891
|
+
const key = "".concat(app.id);
|
|
26892
|
+
const {
|
|
26893
|
+
modalObjectStore,
|
|
26894
|
+
appModalStore
|
|
26895
|
+
} = selectionStore;
|
|
26896
|
+
const end = async function () {
|
|
26897
|
+
let accept = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
26898
|
+
const {
|
|
26899
|
+
model,
|
|
26900
|
+
objectSelections
|
|
26901
|
+
} = modalObjectStore.get(key) || {};
|
|
26902
|
+
if (model) {
|
|
26903
|
+
await model.endSelections(accept);
|
|
26904
|
+
modalObjectStore.clear(key);
|
|
26905
|
+
objectSelections.emit('deactivated');
|
|
26906
|
+
}
|
|
26907
|
+
};
|
|
26908
|
+
const begin = async _ref2 => {
|
|
26909
|
+
var _modalObjectStore$get;
|
|
26910
|
+
let {
|
|
26911
|
+
model,
|
|
26912
|
+
paths,
|
|
26913
|
+
accept = true,
|
|
26914
|
+
objectSelections
|
|
26915
|
+
} = _ref2;
|
|
26916
|
+
// Quick return if it's already in modal
|
|
26917
|
+
if (objectSelections === ((_modalObjectStore$get = modalObjectStore.get(key)) === null || _modalObjectStore$get === void 0 ? void 0 : _modalObjectStore$get.objectSelections)) {
|
|
26918
|
+
return;
|
|
26919
|
+
}
|
|
26920
|
+
|
|
26921
|
+
// If other model is in modal state end it
|
|
26922
|
+
end(accept);
|
|
26923
|
+
|
|
26924
|
+
// Pending modal
|
|
26925
|
+
modalObjectStore.set(key, {
|
|
26926
|
+
model,
|
|
26927
|
+
objectSelections
|
|
26928
|
+
});
|
|
26929
|
+
const p = Array.isArray(paths) ? paths : [paths];
|
|
26930
|
+
const beginSelections = async skipRetry => {
|
|
26931
|
+
try {
|
|
26932
|
+
await model.beginSelections(p);
|
|
26933
|
+
modalObjectStore.set(key, {
|
|
26934
|
+
model,
|
|
26935
|
+
objectSelections
|
|
26936
|
+
}); // We have a modal
|
|
26937
|
+
} catch (err) {
|
|
26938
|
+
if (err.code === 6003 && !skipRetry) {
|
|
26939
|
+
await app.abortModal(accept);
|
|
26940
|
+
beginSelections(true);
|
|
26941
|
+
} else {
|
|
26942
|
+
modalObjectStore.clear(key); // No modal
|
|
26943
|
+
}
|
|
26944
|
+
}
|
|
26945
|
+
};
|
|
26946
|
+
await beginSelections();
|
|
26947
|
+
};
|
|
26948
|
+
const appModal = {
|
|
26949
|
+
begin,
|
|
26950
|
+
end
|
|
26951
|
+
};
|
|
26952
|
+
appModalStore.set(key, appModal);
|
|
26953
|
+
|
|
26954
|
+
/**
|
|
26955
|
+
* @class
|
|
26956
|
+
* @alias AppSelections
|
|
26957
|
+
*/
|
|
26958
|
+
const appSelections = {
|
|
26959
|
+
model: app,
|
|
26960
|
+
isInModal() {
|
|
26961
|
+
return !!modalObjectStore.get(key);
|
|
26962
|
+
},
|
|
26963
|
+
isModal(objectSelections) {
|
|
26964
|
+
var _modalObjectStore$get2;
|
|
26965
|
+
// TODO check model state
|
|
26966
|
+
return objectSelections ? ((_modalObjectStore$get2 = modalObjectStore.get(key)) === null || _modalObjectStore$get2 === void 0 ? void 0 : _modalObjectStore$get2.objectSelections) === objectSelections : !!modalObjectStore.get(key);
|
|
26967
|
+
},
|
|
26968
|
+
forward() {
|
|
26969
|
+
return appModal.end().then(() => app.forward());
|
|
26970
|
+
},
|
|
26971
|
+
back() {
|
|
26972
|
+
return appModal.end().then(() => app.back());
|
|
26973
|
+
},
|
|
26974
|
+
clear() {
|
|
26975
|
+
return appModal.end().then(() => app.clearAll());
|
|
26976
|
+
},
|
|
26977
|
+
clearField(field) {
|
|
26978
|
+
let state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '$';
|
|
26979
|
+
return appModal.end().then(() => app.getField(field, state).then(f => f.clear()));
|
|
26980
|
+
}
|
|
26981
|
+
};
|
|
26982
|
+
return appSelections;
|
|
26983
|
+
}
|
|
26984
|
+
function useAppSelections(app) {
|
|
26985
|
+
if (!app.session) {
|
|
26986
|
+
// assume the app is mocked if session is undefined
|
|
26987
|
+
return [];
|
|
26988
|
+
}
|
|
26989
|
+
const {
|
|
26990
|
+
selectionStore
|
|
26991
|
+
} = reactExports.useContext(InstanceContext);
|
|
26992
|
+
const [appSelectionsStore] = selectionStore.useAppSelectionsStore();
|
|
26993
|
+
const key = app ? app.id : null;
|
|
26994
|
+
let appSelections = appSelectionsStore.get(key);
|
|
26995
|
+
reactExports.useEffect(() => {
|
|
26996
|
+
if (!app || appSelections) return;
|
|
26997
|
+
appSelections = createAppSelections({
|
|
26998
|
+
app,
|
|
26999
|
+
selectionStore
|
|
27000
|
+
});
|
|
27001
|
+
appSelectionsStore.set(key, appSelections);
|
|
27002
|
+
appSelectionsStore.dispatch(true);
|
|
27003
|
+
}, [app]);
|
|
27004
|
+
return [appSelections];
|
|
27005
|
+
}
|
|
27006
|
+
|
|
26959
27007
|
function eventmixin (obj) {
|
|
26960
27008
|
/* eslint no-param-reassign: 0 */
|
|
26961
27009
|
Object.keys(EventEmitter$1.prototype).forEach(key => {
|
|
@@ -27199,7 +27247,9 @@
|
|
|
27199
27247
|
const elementsArr = Array.isArray(elements) ? elements : [elements];
|
|
27200
27248
|
const [appSelections] = useAppSelections(app);
|
|
27201
27249
|
const [layout] = useLayout$1(model);
|
|
27202
|
-
const
|
|
27250
|
+
const {
|
|
27251
|
+
appModalStore
|
|
27252
|
+
} = reactExports.useContext(InstanceContext).selectionStore;
|
|
27203
27253
|
const appModal = appModalStore.get(app.id);
|
|
27204
27254
|
const [objectSelections, setObjectSelections] = reactExports.useState();
|
|
27205
27255
|
reactExports.useEffect(() => {
|
|
@@ -28546,7 +28596,6 @@
|
|
|
28546
28596
|
this._lumi = 0.299 * this._r + 0.587 * this._g + 0.114 * this._b; // option 2
|
|
28547
28597
|
// this._lumi = Math.sqrt( 0.241 * this._r * this._r + 0.691 * this._g * this._g + 0.068 * this._b * this._b ); // option 3
|
|
28548
28598
|
}
|
|
28549
|
-
|
|
28550
28599
|
return this._lumi;
|
|
28551
28600
|
}
|
|
28552
28601
|
|
|
@@ -29599,7 +29648,6 @@
|
|
|
29599
29648
|
segments.forEach((s, i) => {
|
|
29600
29649
|
s.offset = i ? segments[i - 1].offset + segments[i - 1].ratio : 0; // eslint-disable-line
|
|
29601
29650
|
});
|
|
29602
|
-
|
|
29603
29651
|
let Header = null;
|
|
29604
29652
|
let Icon = null;
|
|
29605
29653
|
let SegmentsIndicator = null;
|
|
@@ -30052,7 +30100,9 @@
|
|
|
30052
30100
|
items: [],
|
|
30053
30101
|
more: []
|
|
30054
30102
|
});
|
|
30055
|
-
const
|
|
30103
|
+
const {
|
|
30104
|
+
modalObjectStore
|
|
30105
|
+
} = reactExports.useContext(InstanceContext).selectionStore;
|
|
30056
30106
|
const [containerRef, containerRect] = useRect$1();
|
|
30057
30107
|
const [maxItems, setMaxItems] = reactExports.useState(0);
|
|
30058
30108
|
const isInListboxPopover = () => {
|
|
@@ -30830,7 +30880,6 @@
|
|
|
30830
30880
|
if (!event.target.classList.contains('listbox-container')) {
|
|
30831
30881
|
break; // don't mess with keydown handlers within the listbox (e.g. row seletion)
|
|
30832
30882
|
}
|
|
30833
|
-
|
|
30834
30883
|
keyboard.focus();
|
|
30835
30884
|
prevent();
|
|
30836
30885
|
break;
|
|
@@ -31015,7 +31064,6 @@
|
|
|
31015
31064
|
} else {
|
|
31016
31065
|
containerPadding = undefined; // to prevent overriding any default padding
|
|
31017
31066
|
}
|
|
31018
|
-
|
|
31019
31067
|
return containerPadding;
|
|
31020
31068
|
}
|
|
31021
31069
|
|
|
@@ -31087,7 +31135,6 @@
|
|
|
31087
31135
|
paddingRight: '1px' // make place for italic font style
|
|
31088
31136
|
});
|
|
31089
31137
|
});
|
|
31090
|
-
|
|
31091
31138
|
const isModal = _ref4 => {
|
|
31092
31139
|
var _app$isInModalSelecti, _app$isInModalSelecti2;
|
|
31093
31140
|
let {
|
|
@@ -31962,7 +32009,6 @@
|
|
|
31962
32009
|
frequencyMode: getFrequencyModeLetter(options.frequencyMode) // stick to letter option hereafter
|
|
31963
32010
|
});
|
|
31964
32011
|
}
|
|
31965
|
-
|
|
31966
32012
|
const [changeCount, setChangeCount] = reactExports.useState(0);
|
|
31967
32013
|
reactExports.useEffect(() => {
|
|
31968
32014
|
if (changeCount) {
|
|
@@ -32364,7 +32410,6 @@
|
|
|
32364
32410
|
{
|
|
32365
32411
|
console.warn('Attempting to add fields to an object without a specified data target'); // eslint-disable-line no-console
|
|
32366
32412
|
}
|
|
32367
|
-
|
|
32368
32413
|
return;
|
|
32369
32414
|
}
|
|
32370
32415
|
const {
|
|
@@ -32463,7 +32508,6 @@
|
|
|
32463
32508
|
if (step === '') {
|
|
32464
32509
|
continue; // eslint-disable-line no-continue
|
|
32465
32510
|
}
|
|
32466
|
-
|
|
32467
32511
|
if (dataContainer[step] === undefined || dataContainer[step] === null) {
|
|
32468
32512
|
return defaultValue;
|
|
32469
32513
|
}
|
|
@@ -32633,7 +32677,6 @@
|
|
|
32633
32677
|
function getOthersLabel() {
|
|
32634
32678
|
return 'Others'; // TODO: translator.get('properties.dimensionLimits.others')
|
|
32635
32679
|
}
|
|
32636
|
-
|
|
32637
32680
|
function createDefaultDimension(dimensionDef, dimensionProperties) {
|
|
32638
32681
|
const def = extend$2(true, {}, dimensionProperties, dimensionDef);
|
|
32639
32682
|
if (!utils.getValue(def, 'qOtherTotalSpec.qOtherCounted')) {
|
|
@@ -33159,7 +33202,6 @@
|
|
|
33159
33202
|
}
|
|
33160
33203
|
return undefined; // TODO: add listbox and other
|
|
33161
33204
|
};
|
|
33162
|
-
|
|
33163
33205
|
const getExportPropertiesFnc = qae => {
|
|
33164
33206
|
if (qae.exportProperties) {
|
|
33165
33207
|
return qae.exportProperties;
|
|
@@ -33174,7 +33216,6 @@
|
|
|
33174
33216
|
}
|
|
33175
33217
|
return undefined; // TODO: add listbox and other
|
|
33176
33218
|
};
|
|
33177
|
-
|
|
33178
33219
|
const getImportPropertiesFnc = qae => {
|
|
33179
33220
|
if (qae.importProperties) {
|
|
33180
33221
|
return qae.importProperties;
|
|
@@ -33188,7 +33229,8 @@
|
|
|
33188
33229
|
model,
|
|
33189
33230
|
cellRef,
|
|
33190
33231
|
newType,
|
|
33191
|
-
properties
|
|
33232
|
+
properties,
|
|
33233
|
+
viewDataMode = false
|
|
33192
33234
|
} = _ref2;
|
|
33193
33235
|
const propertyTree = properties ? {
|
|
33194
33236
|
qProperty: properties
|
|
@@ -33209,7 +33251,8 @@
|
|
|
33209
33251
|
}
|
|
33210
33252
|
const exportFormat = exportProperties({
|
|
33211
33253
|
propertyTree,
|
|
33212
|
-
hypercubePath: helpers.getHypercubePath(sourceQae)
|
|
33254
|
+
hypercubePath: helpers.getHypercubePath(sourceQae),
|
|
33255
|
+
viewDataMode
|
|
33213
33256
|
});
|
|
33214
33257
|
const initial = utils.getValue(targetQae, 'properties.initial', {});
|
|
33215
33258
|
const initialProperties = _objectSpread2({
|
|
@@ -33222,7 +33265,8 @@
|
|
|
33222
33265
|
exportFormat,
|
|
33223
33266
|
initialProperties,
|
|
33224
33267
|
dataDefinition: utils.getValue(targetQae, 'data.targets.0.', {}),
|
|
33225
|
-
hypercubePath: helpers.getHypercubePath(targetQae)
|
|
33268
|
+
hypercubePath: helpers.getHypercubePath(targetQae),
|
|
33269
|
+
viewDataMode
|
|
33226
33270
|
});
|
|
33227
33271
|
return newPropertyTree;
|
|
33228
33272
|
};
|
|
@@ -34241,7 +34285,7 @@
|
|
|
34241
34285
|
const Cell = reactExports.forwardRef((_ref6, ref) => {
|
|
34242
34286
|
let {
|
|
34243
34287
|
halo,
|
|
34244
|
-
model,
|
|
34288
|
+
model: inputModel,
|
|
34245
34289
|
initialSnOptions,
|
|
34246
34290
|
initialSnPlugins,
|
|
34247
34291
|
initialError,
|
|
@@ -34266,6 +34310,7 @@
|
|
|
34266
34310
|
const theme = useTheme$1();
|
|
34267
34311
|
const [cellRef, cellRect, cellNode] = useRect$1();
|
|
34268
34312
|
const [state, dispatch] = reactExports.useReducer(contentReducer, initialState(initialError));
|
|
34313
|
+
const [model, setModel] = reactExports.useState(inputModel);
|
|
34269
34314
|
const [layout, {
|
|
34270
34315
|
validating,
|
|
34271
34316
|
canCancel,
|
|
@@ -34419,6 +34464,7 @@
|
|
|
34419
34464
|
},
|
|
34420
34465
|
setSnOptions,
|
|
34421
34466
|
setSnPlugins,
|
|
34467
|
+
setModel,
|
|
34422
34468
|
getImperativeHandle() {
|
|
34423
34469
|
var _state$sn;
|
|
34424
34470
|
if ((_state$sn = state.sn) !== null && _state$sn !== void 0 && _state$sn.component && typeof state.sn.component.getImperativeHandle === 'function') {
|
|
@@ -35207,7 +35253,6 @@
|
|
|
35207
35253
|
hooks.macro = null;
|
|
35208
35254
|
maybeEndChain(hooks); // eslint-disable-line no-use-before-define
|
|
35209
35255
|
}
|
|
35210
|
-
|
|
35211
35256
|
function maybeEndChain(hooks) {
|
|
35212
35257
|
if (hooks.pendingPromises.length || hooks.micro || hooks.macro) {
|
|
35213
35258
|
return;
|
|
@@ -36744,7 +36789,6 @@
|
|
|
36744
36789
|
if (steps[i] === '') {
|
|
36745
36790
|
continue; // eslint-disable-line no-continue
|
|
36746
36791
|
}
|
|
36747
|
-
|
|
36748
36792
|
if (typeof dataContainer[steps[i]] === 'undefined') {
|
|
36749
36793
|
return defaultValue;
|
|
36750
36794
|
}
|
|
@@ -36904,6 +36948,7 @@
|
|
|
36904
36948
|
let mountedReference = null;
|
|
36905
36949
|
let onMount = null;
|
|
36906
36950
|
let onRender = null;
|
|
36951
|
+
let viewDataObjectId;
|
|
36907
36952
|
const mounted = new Promise(resolve => {
|
|
36908
36953
|
onMount = resolve;
|
|
36909
36954
|
});
|
|
@@ -37041,6 +37086,49 @@
|
|
|
37041
37086
|
});
|
|
37042
37087
|
return propertyTree;
|
|
37043
37088
|
},
|
|
37089
|
+
/**
|
|
37090
|
+
* Toggles the chart to a data view of the chart.
|
|
37091
|
+
*
|
|
37092
|
+
* The chart will be toggled to the type defined in the nebula context (dataViewType).
|
|
37093
|
+
*
|
|
37094
|
+
* The default dataViewType for nebula is sn-table. The specified chart type needs to be registered as well, in order to make it possible to render the data view.
|
|
37095
|
+
*
|
|
37096
|
+
* @experimental
|
|
37097
|
+
* @since 4.9.0
|
|
37098
|
+
* @param {boolean=} showDataView - If included, forces the chart into a specific state. True will show data view, and false will show the original chart. If not included it will always toggle between the two views.
|
|
37099
|
+
*/
|
|
37100
|
+
async toggleDataView(showDataView) {
|
|
37101
|
+
let newModel;
|
|
37102
|
+
if (!viewDataObjectId && showDataView !== false) {
|
|
37103
|
+
let newType = halo.config.context.dataViewType;
|
|
37104
|
+
const oldProperties = await model.getEffectiveProperties();
|
|
37105
|
+
// Check if dataViewType is registered. Otherwise potentially fallback to table
|
|
37106
|
+
if (!halo.types.getSupportedVersion(newType)) {
|
|
37107
|
+
if (halo.types.getSupportedVersion('table')) {
|
|
37108
|
+
newType = 'table';
|
|
37109
|
+
} else {
|
|
37110
|
+
throw new Error('No data view type registered');
|
|
37111
|
+
}
|
|
37112
|
+
}
|
|
37113
|
+
const propertyTree = await convertTo({
|
|
37114
|
+
halo,
|
|
37115
|
+
model,
|
|
37116
|
+
cellRef,
|
|
37117
|
+
newType,
|
|
37118
|
+
properties: oldProperties,
|
|
37119
|
+
viewDataMode: true
|
|
37120
|
+
});
|
|
37121
|
+
newModel = await halo.app.createSessionObject(propertyTree.qProperty);
|
|
37122
|
+
viewDataObjectId = newModel.id;
|
|
37123
|
+
} else if (viewDataObjectId && showDataView !== true) {
|
|
37124
|
+
newModel = model;
|
|
37125
|
+
await halo.app.destroySessionObject(viewDataObjectId);
|
|
37126
|
+
viewDataObjectId = undefined;
|
|
37127
|
+
}
|
|
37128
|
+
if (newModel) {
|
|
37129
|
+
cellRef.current.setModel(newModel);
|
|
37130
|
+
}
|
|
37131
|
+
},
|
|
37044
37132
|
/**
|
|
37045
37133
|
* Listens to custom events from inside the visualization. See useEmitter
|
|
37046
37134
|
* @experimental
|
|
@@ -37175,9 +37263,7 @@
|
|
|
37175
37263
|
// setOptions() {}, // applied soft patch
|
|
37176
37264
|
// resize() {},
|
|
37177
37265
|
// show() {},
|
|
37178
|
-
// toggleDataView() {},
|
|
37179
37266
|
};
|
|
37180
|
-
|
|
37181
37267
|
return api;
|
|
37182
37268
|
}
|
|
37183
37269
|
|
|
@@ -37239,7 +37325,7 @@
|
|
|
37239
37325
|
* };
|
|
37240
37326
|
* nebbie.render(createConfig);
|
|
37241
37327
|
*/
|
|
37242
|
-
async function createSessionObject(_ref, halo) {
|
|
37328
|
+
async function createSessionObject(_ref, halo, store) {
|
|
37243
37329
|
let {
|
|
37244
37330
|
type,
|
|
37245
37331
|
version,
|
|
@@ -37252,6 +37338,10 @@
|
|
|
37252
37338
|
} = _ref;
|
|
37253
37339
|
let mergedProps = {};
|
|
37254
37340
|
const children = [];
|
|
37341
|
+
const {
|
|
37342
|
+
modelStore,
|
|
37343
|
+
subscribe
|
|
37344
|
+
} = store;
|
|
37255
37345
|
let error;
|
|
37256
37346
|
try {
|
|
37257
37347
|
const t = halo.types.get({
|
|
@@ -37283,7 +37373,6 @@
|
|
|
37283
37373
|
};
|
|
37284
37374
|
// console.error(e); // eslint-disable-line
|
|
37285
37375
|
}
|
|
37286
|
-
|
|
37287
37376
|
const model = await halo.app.createSessionObject(mergedProps);
|
|
37288
37377
|
if (children.length > 0) {
|
|
37289
37378
|
await model.setFullPropertyTree({
|
|
@@ -37317,7 +37406,7 @@
|
|
|
37317
37406
|
* @property {EngineAPI.IGenericObjectProperties=} properties
|
|
37318
37407
|
*/
|
|
37319
37408
|
|
|
37320
|
-
async function createObject(_ref, halo, generateOnly) {
|
|
37409
|
+
async function createObject(_ref, halo, generateOnly, store) {
|
|
37321
37410
|
let {
|
|
37322
37411
|
type,
|
|
37323
37412
|
version,
|
|
@@ -37327,6 +37416,9 @@
|
|
|
37327
37416
|
} = _ref;
|
|
37328
37417
|
let mergedProps = {};
|
|
37329
37418
|
const children = [];
|
|
37419
|
+
const {
|
|
37420
|
+
modelStore
|
|
37421
|
+
} = store;
|
|
37330
37422
|
// let error;
|
|
37331
37423
|
try {
|
|
37332
37424
|
const t = halo.types.get({
|
|
@@ -37362,7 +37454,6 @@
|
|
|
37362
37454
|
}
|
|
37363
37455
|
// console.error(e); // eslint-disable-line
|
|
37364
37456
|
}
|
|
37365
|
-
|
|
37366
37457
|
if (!generateOnly) {
|
|
37367
37458
|
const model = await halo.app.createObject(mergedProps);
|
|
37368
37459
|
if (children.length > 0) {
|
|
@@ -37377,13 +37468,17 @@
|
|
|
37377
37468
|
return mergedProps;
|
|
37378
37469
|
}
|
|
37379
37470
|
|
|
37380
|
-
async function getObject$1(_ref, halo) {
|
|
37471
|
+
async function getObject$1(_ref, halo, store) {
|
|
37381
37472
|
let {
|
|
37382
37473
|
id,
|
|
37383
37474
|
options,
|
|
37384
37475
|
plugins,
|
|
37385
37476
|
element
|
|
37386
37477
|
} = _ref;
|
|
37478
|
+
const {
|
|
37479
|
+
modelStore,
|
|
37480
|
+
rpcRequestModelStore
|
|
37481
|
+
} = store;
|
|
37387
37482
|
const key = "".concat(id);
|
|
37388
37483
|
let rpc = rpcRequestModelStore.get(key);
|
|
37389
37484
|
if (!rpc) {
|
|
@@ -37460,7 +37555,8 @@
|
|
|
37460
37555
|
} = halo;
|
|
37461
37556
|
const [layout] = useLayout$1(model);
|
|
37462
37557
|
const {
|
|
37463
|
-
theme: themeName
|
|
37558
|
+
theme: themeName,
|
|
37559
|
+
modelStore
|
|
37464
37560
|
} = reactExports.useContext(InstanceContext);
|
|
37465
37561
|
const [cells, setCells] = reactExports.useState([]);
|
|
37466
37562
|
const [bgColor, setBgColor] = reactExports.useState(undefined);
|
|
@@ -37505,7 +37601,7 @@
|
|
|
37505
37601
|
}
|
|
37506
37602
|
const vs = await getObject$1({
|
|
37507
37603
|
id: c.name
|
|
37508
|
-
}, halo);
|
|
37604
|
+
}, halo, modelStore);
|
|
37509
37605
|
return {
|
|
37510
37606
|
model: vs.model,
|
|
37511
37607
|
id: c.name,
|
|
@@ -37739,13 +37835,17 @@
|
|
|
37739
37835
|
return api;
|
|
37740
37836
|
}
|
|
37741
37837
|
|
|
37742
|
-
async function getObject(_ref, halo) {
|
|
37838
|
+
async function getObject(_ref, halo, store) {
|
|
37743
37839
|
let {
|
|
37744
37840
|
id,
|
|
37745
37841
|
options,
|
|
37746
37842
|
plugins,
|
|
37747
37843
|
element
|
|
37748
37844
|
} = _ref;
|
|
37845
|
+
const {
|
|
37846
|
+
modelStore,
|
|
37847
|
+
rpcRequestModelStore
|
|
37848
|
+
} = store;
|
|
37749
37849
|
const key = "".concat(id);
|
|
37750
37850
|
let rpc = rpcRequestModelStore.get(key);
|
|
37751
37851
|
if (!rpc) {
|
|
@@ -37774,15 +37874,14 @@
|
|
|
37774
37874
|
* @interface Flags
|
|
37775
37875
|
*/
|
|
37776
37876
|
|
|
37777
|
-
return
|
|
37778
|
-
|
|
37779
|
-
|
|
37780
|
-
|
|
37781
|
-
|
|
37782
|
-
|
|
37783
|
-
|
|
37784
|
-
|
|
37785
|
-
);
|
|
37877
|
+
return /** @lends Flags */{
|
|
37878
|
+
/**
|
|
37879
|
+
* Checks whether the specified flag is enabled.
|
|
37880
|
+
* @param {string} flag - The value flag to check.
|
|
37881
|
+
* @returns {boolean} True if the specified flag is enabled, false otherwise.
|
|
37882
|
+
*/
|
|
37883
|
+
isEnabled: f => flags[f] === true
|
|
37884
|
+
};
|
|
37786
37885
|
}
|
|
37787
37886
|
|
|
37788
37887
|
var iterator;
|
|
@@ -38345,7 +38444,6 @@
|
|
|
38345
38444
|
this[LRU_LIST] = new Yallist(); // list of items in order of use recency
|
|
38346
38445
|
this[LENGTH] = 0; // length of items in the list
|
|
38347
38446
|
}
|
|
38348
|
-
|
|
38349
38447
|
dump() {
|
|
38350
38448
|
return this[LRU_LIST].map(hit => isStale(this, hit) ? false : {
|
|
38351
38449
|
k: hit.key,
|
|
@@ -39704,7 +39802,6 @@
|
|
|
39704
39802
|
{
|
|
39705
39803
|
console.warn(e); // eslint-disable-line no-console
|
|
39706
39804
|
}
|
|
39707
|
-
|
|
39708
39805
|
throw new Error("Failed to load visualization: '".concat(sKey, "'"));
|
|
39709
39806
|
});
|
|
39710
39807
|
}
|
|
@@ -39837,7 +39934,6 @@
|
|
|
39837
39934
|
{
|
|
39838
39935
|
console.warn("Visualization ".concat(name, " is not registered. Adding it now.")); // eslint-disable-line no-console
|
|
39839
39936
|
}
|
|
39840
|
-
|
|
39841
39937
|
this.register({
|
|
39842
39938
|
name,
|
|
39843
39939
|
version
|
|
@@ -39848,7 +39944,6 @@
|
|
|
39848
39944
|
{
|
|
39849
39945
|
console.warn("Version ".concat(version, " of ").concat(name, " is not registered. Falling back to version ").concat(versionToUse)); // eslint-disable-line no-console
|
|
39850
39946
|
}
|
|
39851
|
-
|
|
39852
39947
|
version = versionToUse;
|
|
39853
39948
|
}
|
|
39854
39949
|
return tc[name].get(version) || p.get(typeInfo);
|
|
@@ -39987,7 +40082,13 @@
|
|
|
39987
40082
|
/** @type {boolean=} */
|
|
39988
40083
|
keyboardNavigation: false,
|
|
39989
40084
|
/** @type {boolean=} */
|
|
39990
|
-
disableCellPadding: false
|
|
40085
|
+
disableCellPadding: false,
|
|
40086
|
+
/**
|
|
40087
|
+
* Type used for toggling to the data view (toggleDataView)
|
|
40088
|
+
* This type need to be registered as well
|
|
40089
|
+
* @type {string=}
|
|
40090
|
+
* */
|
|
40091
|
+
dataViewType: 'sn-table'
|
|
39991
40092
|
};
|
|
39992
40093
|
DEFAULT_CONFIG.context = DEFAULT_CONTEXT;
|
|
39993
40094
|
|
|
@@ -40052,7 +40153,7 @@
|
|
|
40052
40153
|
let currentContext = _objectSpread2(_objectSpread2({}, configuration.context), {}, {
|
|
40053
40154
|
translator: locale.translator
|
|
40054
40155
|
});
|
|
40055
|
-
const [root] = boot({
|
|
40156
|
+
const [root, modelStore] = boot({
|
|
40056
40157
|
app,
|
|
40057
40158
|
context: currentContext
|
|
40058
40159
|
});
|
|
@@ -40078,7 +40179,6 @@
|
|
|
40078
40179
|
translator: locale.translator,
|
|
40079
40180
|
nebbie: null // actual value is set further down
|
|
40080
40181
|
};
|
|
40081
|
-
|
|
40082
40182
|
const halo = {
|
|
40083
40183
|
app,
|
|
40084
40184
|
root,
|
|
@@ -40146,9 +40246,9 @@
|
|
|
40146
40246
|
render: async cfg => {
|
|
40147
40247
|
await currentThemePromise;
|
|
40148
40248
|
if (cfg.id) {
|
|
40149
|
-
return getObject(cfg, halo);
|
|
40249
|
+
return getObject(cfg, halo, modelStore);
|
|
40150
40250
|
}
|
|
40151
|
-
return createSessionObject(cfg, halo);
|
|
40251
|
+
return createSessionObject(cfg, halo, modelStore);
|
|
40152
40252
|
},
|
|
40153
40253
|
/**
|
|
40154
40254
|
* Creates a visualization model
|
|
@@ -40164,7 +40264,7 @@
|
|
|
40164
40264
|
* }
|
|
40165
40265
|
* );
|
|
40166
40266
|
*/
|
|
40167
|
-
create: async cfg => createObject(cfg, halo, false),
|
|
40267
|
+
create: async cfg => createObject(cfg, halo, false, modelStore),
|
|
40168
40268
|
/**
|
|
40169
40269
|
* Generates properties for a visualization object
|
|
40170
40270
|
* @param {CreateConfig} cfg The create configuration.
|
|
@@ -40227,7 +40327,6 @@
|
|
|
40227
40327
|
*/
|
|
40228
40328
|
selections: async () => {
|
|
40229
40329
|
if (!selectionsApi) {
|
|
40230
|
-
// const appSelections = await root.getAppSelections(); // Don't expose this for now
|
|
40231
40330
|
selectionsApi = /** @lends AppSelections# */{
|
|
40232
40331
|
/**
|
|
40233
40332
|
* Mounts the app selection UI into the provided HTMLElement.
|
|
@@ -40240,7 +40339,6 @@
|
|
|
40240
40339
|
{
|
|
40241
40340
|
console.error('Already mounted'); // eslint-disable-line no-console
|
|
40242
40341
|
}
|
|
40243
|
-
|
|
40244
40342
|
return;
|
|
40245
40343
|
}
|
|
40246
40344
|
selectionsComponentReference = mount({
|