@nebula.js/stardust 4.9.0 → 5.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/esm/dev.js +545 -444
- 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 +551 -451
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +14 -14
- package/dist/stardust.js.map +1 -1
- package/package.json +12 -12
package/dist/stardust.dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust
|
|
2
|
+
* @nebula.js/stardust v5.0.0-alpha.1
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -296,8 +296,9 @@
|
|
|
296
296
|
throw arg;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
// Be forgiving, per
|
|
300
|
-
// https://
|
|
299
|
+
// Be forgiving, per GeneratorResume behavior specified since ES2015:
|
|
300
|
+
// ES2015 spec, step 3: https://262.ecma-international.org/6.0/#sec-generatorresume
|
|
301
|
+
// Latest spec, step 2: https://tc39.es/ecma262/#sec-generatorresume
|
|
301
302
|
return doneResult();
|
|
302
303
|
}
|
|
303
304
|
context.method = method;
|
|
@@ -357,7 +358,7 @@
|
|
|
357
358
|
var method = delegate.iterator[methodName];
|
|
358
359
|
if (method === undefined$1) {
|
|
359
360
|
// A .throw or .return when the delegate iterator has no .throw
|
|
360
|
-
// method, or a missing .next
|
|
361
|
+
// method, or a missing .next method, always terminate the
|
|
361
362
|
// yield* loop.
|
|
362
363
|
context.delegate = null;
|
|
363
364
|
|
|
@@ -496,7 +497,7 @@
|
|
|
496
497
|
};
|
|
497
498
|
};
|
|
498
499
|
function values(iterable) {
|
|
499
|
-
if (iterable
|
|
500
|
+
if (iterable != null) {
|
|
500
501
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
501
502
|
if (iteratorMethod) {
|
|
502
503
|
return iteratorMethod.call(iterable);
|
|
@@ -722,26 +723,26 @@
|
|
|
722
723
|
}
|
|
723
724
|
})(runtime);
|
|
724
725
|
|
|
725
|
-
function ownKeys(
|
|
726
|
-
var
|
|
726
|
+
function ownKeys(object, enumerableOnly) {
|
|
727
|
+
var keys = Object.keys(object);
|
|
727
728
|
if (Object.getOwnPropertySymbols) {
|
|
728
|
-
var
|
|
729
|
-
|
|
730
|
-
return Object.getOwnPropertyDescriptor(
|
|
731
|
-
})),
|
|
732
|
-
}
|
|
733
|
-
return
|
|
734
|
-
}
|
|
735
|
-
function _objectSpread2(
|
|
736
|
-
for (var
|
|
737
|
-
var
|
|
738
|
-
|
|
739
|
-
_defineProperty(
|
|
740
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
741
|
-
Object.defineProperty(
|
|
729
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
730
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
731
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
732
|
+
})), keys.push.apply(keys, symbols);
|
|
733
|
+
}
|
|
734
|
+
return keys;
|
|
735
|
+
}
|
|
736
|
+
function _objectSpread2(target) {
|
|
737
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
738
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
739
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
740
|
+
_defineProperty(target, key, source[key]);
|
|
741
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
742
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
742
743
|
});
|
|
743
744
|
}
|
|
744
|
-
return
|
|
745
|
+
return target;
|
|
745
746
|
}
|
|
746
747
|
function _defineProperty(obj, key, value) {
|
|
747
748
|
key = _toPropertyKey(key);
|
|
@@ -2876,7 +2877,7 @@
|
|
|
2876
2877
|
|
|
2877
2878
|
var extend$2 = /*@__PURE__*/getDefaultExportFromCjs(extend$1);
|
|
2878
2879
|
|
|
2879
|
-
var fontSize = "
|
|
2880
|
+
var fontSize = "12px";
|
|
2880
2881
|
var fontFamily = "'Source Sans Pro', 'Arial', 'sans-serif'";
|
|
2881
2882
|
var backgroundColor$1 = "transparent";
|
|
2882
2883
|
var dataColors = {
|
|
@@ -3241,15 +3242,14 @@
|
|
|
3241
3242
|
},
|
|
3242
3243
|
dataColors() {
|
|
3243
3244
|
/** @interface Theme~DataColorSpecials */
|
|
3244
|
-
return
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
);
|
|
3245
|
+
return /** @lends Theme~DataColorSpecials */{
|
|
3246
|
+
/** @type {string} */
|
|
3247
|
+
primary: resolvedTheme.dataColors.primaryColor,
|
|
3248
|
+
/** @type {string} */
|
|
3249
|
+
nil: resolvedTheme.dataColors.nullColor,
|
|
3250
|
+
/** @type {string} */
|
|
3251
|
+
others: resolvedTheme.dataColors.othersColor
|
|
3252
|
+
};
|
|
3253
3253
|
},
|
|
3254
3254
|
uiColor(c, shift) {
|
|
3255
3255
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -3575,7 +3575,6 @@
|
|
|
3575
3575
|
}
|
|
3576
3576
|
});
|
|
3577
3577
|
}
|
|
3578
|
-
|
|
3579
3578
|
styleResolver.resolveRawTheme = raw => {
|
|
3580
3579
|
// TODO - validate format
|
|
3581
3580
|
const c = extend$2(true, {}, raw);
|
|
@@ -4542,7 +4541,6 @@
|
|
|
4542
4541
|
});
|
|
4543
4542
|
return reactExports.useRef((...args) =>
|
|
4544
4543
|
// @ts-expect-error hide `this`
|
|
4545
|
-
// tslint:disable-next-line:ban-comma-operator
|
|
4546
4544
|
(0, ref.current)(...args)).current;
|
|
4547
4545
|
}
|
|
4548
4546
|
|
|
@@ -4811,6 +4809,7 @@
|
|
|
4811
4809
|
|
|
4812
4810
|
// If GlobalStateSlot is changed, GLOBAL_STATE_CLASSES in
|
|
4813
4811
|
// \packages\api-docs-builder\utils\parseSlotsAndClasses.ts must be updated accordingly.
|
|
4812
|
+
|
|
4814
4813
|
const globalStateClassesMapping = {
|
|
4815
4814
|
active: 'active',
|
|
4816
4815
|
checked: 'checked',
|
|
@@ -6952,7 +6951,7 @@
|
|
|
6952
6951
|
}
|
|
6953
6952
|
|
|
6954
6953
|
/**
|
|
6955
|
-
* @mui/styled-engine v5.
|
|
6954
|
+
* @mui/styled-engine v5.15.0
|
|
6956
6955
|
*
|
|
6957
6956
|
* @license MIT
|
|
6958
6957
|
* This source code is licensed under the MIT license found in the
|
|
@@ -7031,7 +7030,6 @@
|
|
|
7031
7030
|
// desktop
|
|
7032
7031
|
xl: 1536 // large screen
|
|
7033
7032
|
},
|
|
7034
|
-
|
|
7035
7033
|
unit = 'px',
|
|
7036
7034
|
step = 5
|
|
7037
7035
|
} = breakpoints,
|
|
@@ -7106,7 +7104,6 @@
|
|
|
7106
7104
|
// desktop
|
|
7107
7105
|
xl: 1536 // large screen
|
|
7108
7106
|
};
|
|
7109
|
-
|
|
7110
7107
|
const defaultBreakpoints = {
|
|
7111
7108
|
// Sorted ASC by size. That's important.
|
|
7112
7109
|
// It can't be configured as it's used statically for propTypes.
|
|
@@ -7408,8 +7405,6 @@
|
|
|
7408
7405
|
|
|
7409
7406
|
// The different signatures imply different meaning for their arguments that can't be expressed structurally.
|
|
7410
7407
|
// We express the difference with variable names.
|
|
7411
|
-
/* tslint:disable:unified-signatures */
|
|
7412
|
-
/* tslint:enable:unified-signatures */
|
|
7413
7408
|
|
|
7414
7409
|
function createSpacing(spacingInput = 8) {
|
|
7415
7410
|
// Already transformed.
|
|
@@ -7463,51 +7458,25 @@
|
|
|
7463
7458
|
}
|
|
7464
7459
|
return `${value}px solid`;
|
|
7465
7460
|
}
|
|
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
|
-
});
|
|
7461
|
+
function createBorderStyle(prop, transform) {
|
|
7462
|
+
return style$2({
|
|
7463
|
+
prop,
|
|
7464
|
+
themeKey: 'borders',
|
|
7465
|
+
transform
|
|
7466
|
+
});
|
|
7467
|
+
}
|
|
7468
|
+
const border = createBorderStyle('border', borderTransform);
|
|
7469
|
+
const borderTop = createBorderStyle('borderTop', borderTransform);
|
|
7470
|
+
const borderRight = createBorderStyle('borderRight', borderTransform);
|
|
7471
|
+
const borderBottom = createBorderStyle('borderBottom', borderTransform);
|
|
7472
|
+
const borderLeft = createBorderStyle('borderLeft', borderTransform);
|
|
7473
|
+
const borderColor = createBorderStyle('borderColor');
|
|
7474
|
+
const borderTopColor = createBorderStyle('borderTopColor');
|
|
7475
|
+
const borderRightColor = createBorderStyle('borderRightColor');
|
|
7476
|
+
const borderBottomColor = createBorderStyle('borderBottomColor');
|
|
7477
|
+
const borderLeftColor = createBorderStyle('borderLeftColor');
|
|
7478
|
+
const outline = createBorderStyle('outline', borderTransform);
|
|
7479
|
+
const outlineColor = createBorderStyle('outlineColor');
|
|
7511
7480
|
|
|
7512
7481
|
// false positive
|
|
7513
7482
|
// eslint-disable-next-line react/function-component-definition
|
|
@@ -7523,7 +7492,7 @@
|
|
|
7523
7492
|
};
|
|
7524
7493
|
borderRadius$1.propTypes = {};
|
|
7525
7494
|
borderRadius$1.filterProps = ['borderRadius'];
|
|
7526
|
-
compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius$1);
|
|
7495
|
+
compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius$1, outline, outlineColor);
|
|
7527
7496
|
|
|
7528
7497
|
// false positive
|
|
7529
7498
|
// eslint-disable-next-line react/function-component-definition
|
|
@@ -7721,6 +7690,13 @@
|
|
|
7721
7690
|
borderLeftColor: {
|
|
7722
7691
|
themeKey: 'palette'
|
|
7723
7692
|
},
|
|
7693
|
+
outline: {
|
|
7694
|
+
themeKey: 'borders',
|
|
7695
|
+
transform: borderTransform
|
|
7696
|
+
},
|
|
7697
|
+
outlineColor: {
|
|
7698
|
+
themeKey: 'palette'
|
|
7699
|
+
},
|
|
7724
7700
|
borderRadius: {
|
|
7725
7701
|
themeKey: 'shape.borderRadius',
|
|
7726
7702
|
style: borderRadius$1
|
|
@@ -8030,7 +8006,6 @@
|
|
|
8030
8006
|
if (!sx) {
|
|
8031
8007
|
return null; // Emotion & styled-components will neglect null
|
|
8032
8008
|
}
|
|
8033
|
-
|
|
8034
8009
|
const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig$1;
|
|
8035
8010
|
|
|
8036
8011
|
/*
|
|
@@ -8697,7 +8672,6 @@
|
|
|
8697
8672
|
if (color.type !== 'color') {
|
|
8698
8673
|
val /= 255; // normalized
|
|
8699
8674
|
}
|
|
8700
|
-
|
|
8701
8675
|
return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;
|
|
8702
8676
|
});
|
|
8703
8677
|
|
|
@@ -10960,7 +10934,6 @@
|
|
|
10960
10934
|
'&::-moz-focus-inner': {
|
|
10961
10935
|
borderStyle: 'none' // Remove Firefox dotted outline.
|
|
10962
10936
|
},
|
|
10963
|
-
|
|
10964
10937
|
[`&.${buttonBaseClasses$1.disabled}`]: {
|
|
10965
10938
|
pointerEvents: 'none',
|
|
10966
10939
|
// Disable link interactions
|
|
@@ -11127,7 +11100,7 @@
|
|
|
11127
11100
|
});
|
|
11128
11101
|
const handleKeyUp = useEventCallback(event => {
|
|
11129
11102
|
// calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
|
|
11130
|
-
// https://codesandbox.io/
|
|
11103
|
+
// https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0
|
|
11131
11104
|
if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
|
|
11132
11105
|
keydownRef.current = false;
|
|
11133
11106
|
rippleRef.current.stop(event, () => {
|
|
@@ -11820,7 +11793,7 @@
|
|
|
11820
11793
|
return cache[key];
|
|
11821
11794
|
}
|
|
11822
11795
|
|
|
11823
|
-
const NEBULA_VERSION_HASH = "
|
|
11796
|
+
const NEBULA_VERSION_HASH = "5ec7" ;
|
|
11824
11797
|
ClassNameGenerator$1.configure(componentName => {
|
|
11825
11798
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
11826
11799
|
});
|
|
@@ -11831,9 +11804,49 @@
|
|
|
11831
11804
|
translator: null,
|
|
11832
11805
|
constraints: {},
|
|
11833
11806
|
interactions: {},
|
|
11834
|
-
themeApi: null
|
|
11807
|
+
themeApi: null,
|
|
11808
|
+
modelStore: {},
|
|
11809
|
+
selectionStore: {}
|
|
11835
11810
|
});
|
|
11836
11811
|
|
|
11812
|
+
const DEFAULT_INTERACTIONS = {
|
|
11813
|
+
active: true,
|
|
11814
|
+
select: true,
|
|
11815
|
+
passive: true,
|
|
11816
|
+
edit: false
|
|
11817
|
+
};
|
|
11818
|
+
function pickConstraintsOrInteractions(context) {
|
|
11819
|
+
const {
|
|
11820
|
+
constraints = {},
|
|
11821
|
+
interactions = {}
|
|
11822
|
+
} = context;
|
|
11823
|
+
// If some interaction is defined, then we use that
|
|
11824
|
+
if (Object.keys(interactions).length > 0) {
|
|
11825
|
+
return interactions;
|
|
11826
|
+
}
|
|
11827
|
+
const ret = {};
|
|
11828
|
+
Object.keys(constraints).forEach(state => {
|
|
11829
|
+
ret[state] = !constraints[state];
|
|
11830
|
+
});
|
|
11831
|
+
return ret;
|
|
11832
|
+
}
|
|
11833
|
+
function unifyContraintsAndInteractions(context) {
|
|
11834
|
+
const interactions = {};
|
|
11835
|
+
const constraints = {};
|
|
11836
|
+
const definedSettings = pickConstraintsOrInteractions(context);
|
|
11837
|
+
Object.keys(DEFAULT_INTERACTIONS).forEach(state => {
|
|
11838
|
+
if (definedSettings[state] !== undefined) {
|
|
11839
|
+
interactions[state] = definedSettings[state];
|
|
11840
|
+
constraints[state] = !definedSettings[state];
|
|
11841
|
+
} else {
|
|
11842
|
+
interactions[state] = DEFAULT_INTERACTIONS[state];
|
|
11843
|
+
constraints[state] = !DEFAULT_INTERACTIONS[state];
|
|
11844
|
+
}
|
|
11845
|
+
});
|
|
11846
|
+
context.constraints = constraints;
|
|
11847
|
+
context.interactions = interactions;
|
|
11848
|
+
}
|
|
11849
|
+
|
|
11837
11850
|
var createKeyStore = (function () {
|
|
11838
11851
|
let initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11839
11852
|
let applyMiddleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => {};
|
|
@@ -11876,169 +11889,97 @@
|
|
|
11876
11889
|
return [useKeyStore, store];
|
|
11877
11890
|
});
|
|
11878
11891
|
|
|
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;
|
|
11892
|
+
function initializeStores$1(appId) {
|
|
11893
|
+
const [useRpcResultStore, rpcResultStore] = createKeyStore({});
|
|
11894
|
+
const [useRpcRequestStore, rpcRequestStore] = createKeyStore({});
|
|
11895
|
+
const [useRpcRequestSessionModelStore, rpcRequestSessionModelStore] = createKeyStore({});
|
|
11896
|
+
const [useRpcRequestModelStore, rpcRequestModelStore] = createKeyStore({});
|
|
11897
|
+
const [useModelChangedStore, modelChangedStore] = createKeyStore({});
|
|
11898
|
+
const [, modelInitializedStore] = createKeyStore({});
|
|
11899
|
+
const modelStoreMiddleware = _ref => {
|
|
11903
11900
|
let {
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
}
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11901
|
+
type,
|
|
11902
|
+
value: model
|
|
11903
|
+
} = _ref;
|
|
11904
|
+
const initialized = modelInitializedStore.get(model.id);
|
|
11905
|
+
modelInitializedStore.set(model.id, {});
|
|
11906
|
+
const onChanged = () => {
|
|
11907
|
+
rpcRequestStore.clear(model.id);
|
|
11908
|
+
modelChangedStore.set(model.id, {});
|
|
11909
|
+
modelChangedStore.dispatch(true); // Force new state to trigger hooks
|
|
11910
|
+
};
|
|
11911
|
+
const unsubscribe = () => {
|
|
11912
|
+
model.removeListener('changed', onChanged);
|
|
11913
|
+
rpcResultStore.clear(model.id);
|
|
11914
|
+
rpcRequestStore.clear(model.id);
|
|
11915
|
+
rpcRequestSessionModelStore.clear(model.id);
|
|
11916
|
+
rpcRequestModelStore.clear(model.id);
|
|
11917
|
+
modelChangedStore.clear(model.id);
|
|
11918
|
+
modelInitializedStore.clear(model.id);
|
|
11919
|
+
};
|
|
11920
|
+
switch (type) {
|
|
11921
|
+
case 'SET':
|
|
11922
|
+
if (!initialized) {
|
|
11923
|
+
model.on('changed', onChanged);
|
|
11924
|
+
model.once('closed', () => {
|
|
11925
|
+
unsubscribe();
|
|
11926
|
+
});
|
|
11927
|
+
}
|
|
11928
|
+
break;
|
|
11912
11929
|
}
|
|
11913
|
-
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
model
|
|
11920
|
-
objectSelections
|
|
11930
|
+
return unsubscribe;
|
|
11931
|
+
};
|
|
11932
|
+
const [useModelStore, modelStore] = createKeyStore({}, modelStoreMiddleware);
|
|
11933
|
+
const subscribe = model => {
|
|
11934
|
+
const unsubscribe = modelStoreMiddleware({
|
|
11935
|
+
type: 'SET',
|
|
11936
|
+
value: model
|
|
11921
11937
|
});
|
|
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
|
-
}
|
|
11938
|
+
return () => {
|
|
11939
|
+
unsubscribe();
|
|
11940
|
+
modelStore.clear(model.id);
|
|
11938
11941
|
};
|
|
11939
|
-
|
|
11940
|
-
await beginSelections();
|
|
11941
|
-
};
|
|
11942
|
-
const appModal = {
|
|
11943
|
-
begin,
|
|
11944
|
-
end
|
|
11945
11942
|
};
|
|
11946
|
-
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
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
|
-
}
|
|
11943
|
+
return {
|
|
11944
|
+
subscribe,
|
|
11945
|
+
useModelStore,
|
|
11946
|
+
modelStore,
|
|
11947
|
+
useModelChangedStore,
|
|
11948
|
+
useRpcResultStore,
|
|
11949
|
+
rpcResultStore,
|
|
11950
|
+
useRpcRequestStore,
|
|
11951
|
+
rpcRequestStore,
|
|
11952
|
+
useRpcRequestModelStore,
|
|
11953
|
+
rpcRequestModelStore,
|
|
11954
|
+
useRpcRequestSessionModelStore,
|
|
11955
|
+
rpcRequestSessionModelStore,
|
|
11956
|
+
modelChangedStore,
|
|
11957
|
+
appId
|
|
11975
11958
|
};
|
|
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
11959
|
}
|
|
11996
11960
|
|
|
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;
|
|
11961
|
+
function initializeStores(appId) {
|
|
11962
|
+
const [useAppSelectionsStore, appSelectionsStore] = createKeyStore({});
|
|
11963
|
+
const [useAppModalStore, appModalStore] = createKeyStore({});
|
|
11964
|
+
const [useModalObjectStore, modalObjectStore] = createKeyStore({});
|
|
11965
|
+
return {
|
|
11966
|
+
useAppSelectionsStore,
|
|
11967
|
+
useAppModalStore,
|
|
11968
|
+
appSelectionsStore,
|
|
11969
|
+
appModalStore,
|
|
11970
|
+
useModalObjectStore,
|
|
11971
|
+
modalObjectStore,
|
|
11972
|
+
appId
|
|
11973
|
+
};
|
|
12033
11974
|
}
|
|
12034
11975
|
|
|
12035
11976
|
const NebulaApp = reactExports.forwardRef((_ref, ref) => {
|
|
12036
11977
|
let {
|
|
12037
11978
|
initialContext,
|
|
12038
|
-
|
|
12039
|
-
|
|
11979
|
+
renderCallback,
|
|
11980
|
+
modelStore,
|
|
11981
|
+
selectionStore
|
|
12040
11982
|
} = _ref;
|
|
12041
|
-
const [appSelections] = useAppSelections(app);
|
|
12042
11983
|
const [context, setContext] = reactExports.useState(initialContext);
|
|
12043
11984
|
const [muiThemeName, setMuiThemeName] = reactExports.useState();
|
|
12044
11985
|
const {
|
|
@@ -12058,9 +11999,12 @@
|
|
|
12058
11999
|
setComponents([...comps]);
|
|
12059
12000
|
},
|
|
12060
12001
|
setMuiThemeName,
|
|
12061
|
-
setContext: ctx => setContext(oldContext => JSON.stringify(oldContext) !== JSON.stringify(ctx) ? ctx : oldContext)
|
|
12062
|
-
getAppSelections: () => appSelections
|
|
12002
|
+
setContext: ctx => setContext(oldContext => JSON.stringify(oldContext) !== JSON.stringify(ctx) ? ctx : oldContext)
|
|
12063
12003
|
}), []);
|
|
12004
|
+
if (context) {
|
|
12005
|
+
context.modelStore = modelStore;
|
|
12006
|
+
context.selectionStore = selectionStore;
|
|
12007
|
+
}
|
|
12064
12008
|
return /*#__PURE__*/React.createElement(StyledEngineProvider, {
|
|
12065
12009
|
injectFirst: true
|
|
12066
12010
|
}, /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
@@ -12081,18 +12025,21 @@
|
|
|
12081
12025
|
const appRef = React.createRef();
|
|
12082
12026
|
const element = document.createElement('div');
|
|
12083
12027
|
element.style.display = 'none';
|
|
12084
|
-
element.setAttribute('data-nebulajs-version', "
|
|
12028
|
+
element.setAttribute('data-nebulajs-version', "5.0.0-alpha.1" );
|
|
12085
12029
|
element.setAttribute('data-app-id', app.id);
|
|
12086
12030
|
document.body.appendChild(element);
|
|
12087
12031
|
if (context) {
|
|
12088
12032
|
unifyContraintsAndInteractions(context);
|
|
12089
12033
|
}
|
|
12034
|
+
const modelStore = initializeStores$1(app.id);
|
|
12035
|
+
const selectionStore = initializeStores(app.id);
|
|
12090
12036
|
const root = client.createRoot(element);
|
|
12091
12037
|
root.render( /*#__PURE__*/React.createElement(NebulaApp, {
|
|
12092
12038
|
ref: appRef,
|
|
12093
|
-
app: app,
|
|
12094
12039
|
initialContext: context,
|
|
12095
|
-
renderCallback: resolveRender
|
|
12040
|
+
renderCallback: resolveRender,
|
|
12041
|
+
modelStore: modelStore,
|
|
12042
|
+
selectionStore: selectionStore
|
|
12096
12043
|
}));
|
|
12097
12044
|
const cells = {};
|
|
12098
12045
|
const components = [];
|
|
@@ -12141,12 +12088,8 @@
|
|
|
12141
12088
|
}
|
|
12142
12089
|
appRef.current.setContext(ctx);
|
|
12143
12090
|
})();
|
|
12144
|
-
},
|
|
12145
|
-
getAppSelections: async () => {
|
|
12146
|
-
await rendered;
|
|
12147
|
-
return appRef.current.getAppSelections();
|
|
12148
12091
|
}
|
|
12149
|
-
}, appRef, rendered];
|
|
12092
|
+
}, modelStore, selectionStore, appRef, rendered];
|
|
12150
12093
|
}
|
|
12151
12094
|
|
|
12152
12095
|
function getSvgIconUtilityClass(slot) {
|
|
@@ -16141,13 +16084,11 @@
|
|
|
16141
16084
|
// IE11
|
|
16142
16085
|
'&:focus::-ms-input-placeholder': placeholderVisible // Edge
|
|
16143
16086
|
},
|
|
16144
|
-
|
|
16145
16087
|
[`&.${inputBaseClasses$1.disabled}`]: {
|
|
16146
16088
|
opacity: 1,
|
|
16147
16089
|
// Reset iOS opacity
|
|
16148
16090
|
WebkitTextFillColor: (theme.vars || theme).palette.text.disabled // Fix opacity Safari bug
|
|
16149
16091
|
},
|
|
16150
|
-
|
|
16151
16092
|
'&:-webkit-autofill': {
|
|
16152
16093
|
animationDuration: '5000s',
|
|
16153
16094
|
animationName: 'mui-auto-fill'
|
|
@@ -16888,11 +16829,14 @@
|
|
|
16888
16829
|
});
|
|
16889
16830
|
var Badge$1 = Badge;
|
|
16890
16831
|
|
|
16832
|
+
const boxClasses = generateUtilityClasses('MuiBox', ['root']);
|
|
16833
|
+
var boxClasses$1 = boxClasses;
|
|
16834
|
+
|
|
16891
16835
|
const defaultTheme = createTheme();
|
|
16892
16836
|
const Box = createBox({
|
|
16893
16837
|
themeId: THEME_ID,
|
|
16894
16838
|
defaultTheme,
|
|
16895
|
-
defaultClassName:
|
|
16839
|
+
defaultClassName: boxClasses$1.root,
|
|
16896
16840
|
generateClassName: ClassNameGenerator$1.generate
|
|
16897
16841
|
});
|
|
16898
16842
|
var Box$1 = Box;
|
|
@@ -17245,7 +17189,6 @@
|
|
|
17245
17189
|
})({
|
|
17246
17190
|
display: 'block' // Keeps the progress centered
|
|
17247
17191
|
});
|
|
17248
|
-
|
|
17249
17192
|
const CircularProgressCircle = styled$1('circle', {
|
|
17250
17193
|
name: 'MuiCircularProgress',
|
|
17251
17194
|
slot: 'Circle',
|
|
@@ -18672,10 +18615,10 @@
|
|
|
18672
18615
|
color: "text.secondary",
|
|
18673
18616
|
children: children
|
|
18674
18617
|
}) : /*#__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", {
|
|
18618
|
+
children: [position === 'start' ? ( /* notranslate needed while Google Translate will not fix zero-width space issue */_span$1 || (_span$1 = /*#__PURE__*/jsxRuntimeExports.jsx("span", {
|
|
18676
18619
|
className: "notranslate",
|
|
18677
18620
|
children: "\u200B"
|
|
18678
|
-
})) : null, children]
|
|
18621
|
+
}))) : null, children]
|
|
18679
18622
|
})
|
|
18680
18623
|
}))
|
|
18681
18624
|
});
|
|
@@ -20849,57 +20792,36 @@
|
|
|
20849
20792
|
});
|
|
20850
20793
|
var Tooltip$1 = Tooltip;
|
|
20851
20794
|
|
|
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
|
-
};
|
|
20795
|
+
function useModelStore() {
|
|
20796
|
+
const {
|
|
20797
|
+
useModelStore: useFunc
|
|
20798
|
+
} = reactExports.useContext(InstanceContext).modelStore;
|
|
20799
|
+
return useFunc();
|
|
20800
|
+
}
|
|
20801
|
+
function useModelChangedStore() {
|
|
20802
|
+
const {
|
|
20803
|
+
useModelChangedStore: useFunc
|
|
20804
|
+
} = reactExports.useContext(InstanceContext).modelStore;
|
|
20805
|
+
return useFunc();
|
|
20806
|
+
}
|
|
20807
|
+
function useRpcResultStore() {
|
|
20808
|
+
const {
|
|
20809
|
+
useRpcResultStore: useFunc
|
|
20810
|
+
} = reactExports.useContext(InstanceContext).modelStore;
|
|
20811
|
+
return useFunc();
|
|
20812
|
+
}
|
|
20813
|
+
function useRpcRequestStore() {
|
|
20814
|
+
const {
|
|
20815
|
+
useRpcRequestStore: useFunc
|
|
20816
|
+
} = reactExports.useContext(InstanceContext).modelStore;
|
|
20817
|
+
return useFunc();
|
|
20818
|
+
}
|
|
20819
|
+
function useRpcRequestSessionModelStore() {
|
|
20820
|
+
const {
|
|
20821
|
+
useRpcRequestSessionModelStore: useFunc
|
|
20822
|
+
} = reactExports.useContext(InstanceContext).modelStore;
|
|
20823
|
+
return useFunc();
|
|
20824
|
+
}
|
|
20903
20825
|
|
|
20904
20826
|
function useSessionModel(definition, app) {
|
|
20905
20827
|
const key = app ? "".concat(app.id, "/").concat(JSON.stringify(definition)) : null;
|
|
@@ -22027,7 +21949,6 @@
|
|
|
22027
21949
|
if (frequencyMode === 'P') {
|
|
22028
21950
|
return sizes.freqMinWidth; // because it will never grow beyond "100.0%"
|
|
22029
21951
|
}
|
|
22030
|
-
|
|
22031
21952
|
return sizes.freqMaxWidth;
|
|
22032
21953
|
};
|
|
22033
21954
|
const getSelectedStyle = _ref3 => {
|
|
@@ -23034,7 +22955,6 @@
|
|
|
23034
22955
|
} else {
|
|
23035
22956
|
return; // propagate to other Esc handler
|
|
23036
22957
|
}
|
|
23037
|
-
|
|
23038
22958
|
break;
|
|
23039
22959
|
case KEYS.HOME:
|
|
23040
22960
|
focusListItems.setFirst(true);
|
|
@@ -23068,7 +22988,6 @@
|
|
|
23068
22988
|
return;
|
|
23069
22989
|
// don't stop propagation since we want to outsource keydown to other handlers.
|
|
23070
22990
|
}
|
|
23071
|
-
|
|
23072
22991
|
if (elementToFocus) {
|
|
23073
22992
|
elementToFocus.focus();
|
|
23074
22993
|
}
|
|
@@ -23234,7 +23153,6 @@
|
|
|
23234
23153
|
if (!cell) {
|
|
23235
23154
|
return null; // prevent rendering empty rows
|
|
23236
23155
|
}
|
|
23237
|
-
|
|
23238
23156
|
const isGridCol = dataLayout === 'grid' && layoutOrder === 'column';
|
|
23239
23157
|
const label = (_cell$qText = cell === null || cell === void 0 ? void 0 : cell.qText) !== null && _cell$qText !== void 0 ? _cell$qText : '';
|
|
23240
23158
|
// Search highlights. Split up labelText span into several and add the highlighted class to matching sub-strings.
|
|
@@ -25977,7 +25895,6 @@
|
|
|
25977
25895
|
if (s.scrollPosition === 'overflowEnd') {
|
|
25978
25896
|
return; // Do keyScroll.reset() in fetchData() to avoid scrolling to top.
|
|
25979
25897
|
}
|
|
25980
|
-
|
|
25981
25898
|
keyScroll.reset();
|
|
25982
25899
|
}, [keyScroll.state.up, keyScroll.state.down, keyScroll.state.scrollPosition]);
|
|
25983
25900
|
const {
|
|
@@ -26762,6 +26679,7 @@
|
|
|
26762
26679
|
fontSize: 14,
|
|
26763
26680
|
borderRadius: 0,
|
|
26764
26681
|
backgroundColor: styles.search.backgroundColor,
|
|
26682
|
+
backdropFilter: styles.background.backgroundImage ? styles.search.backdropFilter : undefined,
|
|
26765
26683
|
paddingLeft: "".concat(CELL_PADDING_LEFT, "px"),
|
|
26766
26684
|
flexDirection: isRtl ? 'row-reverse' : 'row',
|
|
26767
26685
|
'& fieldset': {
|
|
@@ -26769,6 +26687,9 @@
|
|
|
26769
26687
|
borderWidth: '1px 0 1px 0',
|
|
26770
26688
|
borderRadius: 0
|
|
26771
26689
|
},
|
|
26690
|
+
'&.Mui-focused fieldset': {
|
|
26691
|
+
borderColor: "".concat(styles.search.highlightBorderColor, " !important")
|
|
26692
|
+
},
|
|
26772
26693
|
'& .MuiInputBase-root': _objectSpread2({}, styles.search),
|
|
26773
26694
|
'& *': {
|
|
26774
26695
|
color: styles.search.color
|
|
@@ -26776,9 +26697,6 @@
|
|
|
26776
26697
|
'& input': {
|
|
26777
26698
|
color: styles.search.color,
|
|
26778
26699
|
textAlign: isRtl ? 'right' : 'left'
|
|
26779
|
-
},
|
|
26780
|
-
'&.Mui-focused fieldset.OutlinedInput-notchedOutline': {
|
|
26781
|
-
borderColor: "".concat(styles.search.highlightBorderColor, " !important")
|
|
26782
26700
|
}
|
|
26783
26701
|
}, denseProps);
|
|
26784
26702
|
});
|
|
@@ -26956,6 +26874,128 @@
|
|
|
26956
26874
|
});
|
|
26957
26875
|
}
|
|
26958
26876
|
|
|
26877
|
+
/* eslint no-underscore-dangle: 0 */
|
|
26878
|
+
function createAppSelections(_ref) {
|
|
26879
|
+
let {
|
|
26880
|
+
app,
|
|
26881
|
+
selectionStore
|
|
26882
|
+
} = _ref;
|
|
26883
|
+
const key = "".concat(app.id);
|
|
26884
|
+
const {
|
|
26885
|
+
modalObjectStore,
|
|
26886
|
+
appModalStore
|
|
26887
|
+
} = selectionStore;
|
|
26888
|
+
const end = async function () {
|
|
26889
|
+
let accept = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
26890
|
+
const {
|
|
26891
|
+
model,
|
|
26892
|
+
objectSelections
|
|
26893
|
+
} = modalObjectStore.get(key) || {};
|
|
26894
|
+
if (model) {
|
|
26895
|
+
await model.endSelections(accept);
|
|
26896
|
+
modalObjectStore.clear(key);
|
|
26897
|
+
objectSelections.emit('deactivated');
|
|
26898
|
+
}
|
|
26899
|
+
};
|
|
26900
|
+
const begin = async _ref2 => {
|
|
26901
|
+
var _modalObjectStore$get;
|
|
26902
|
+
let {
|
|
26903
|
+
model,
|
|
26904
|
+
paths,
|
|
26905
|
+
accept = true,
|
|
26906
|
+
objectSelections
|
|
26907
|
+
} = _ref2;
|
|
26908
|
+
// Quick return if it's already in modal
|
|
26909
|
+
if (objectSelections === ((_modalObjectStore$get = modalObjectStore.get(key)) === null || _modalObjectStore$get === void 0 ? void 0 : _modalObjectStore$get.objectSelections)) {
|
|
26910
|
+
return;
|
|
26911
|
+
}
|
|
26912
|
+
|
|
26913
|
+
// If other model is in modal state end it
|
|
26914
|
+
end(accept);
|
|
26915
|
+
|
|
26916
|
+
// Pending modal
|
|
26917
|
+
modalObjectStore.set(key, {
|
|
26918
|
+
model,
|
|
26919
|
+
objectSelections
|
|
26920
|
+
});
|
|
26921
|
+
const p = Array.isArray(paths) ? paths : [paths];
|
|
26922
|
+
const beginSelections = async skipRetry => {
|
|
26923
|
+
try {
|
|
26924
|
+
await model.beginSelections(p);
|
|
26925
|
+
modalObjectStore.set(key, {
|
|
26926
|
+
model,
|
|
26927
|
+
objectSelections
|
|
26928
|
+
}); // We have a modal
|
|
26929
|
+
} catch (err) {
|
|
26930
|
+
if (err.code === 6003 && !skipRetry) {
|
|
26931
|
+
await app.abortModal(accept);
|
|
26932
|
+
beginSelections(true);
|
|
26933
|
+
} else {
|
|
26934
|
+
modalObjectStore.clear(key); // No modal
|
|
26935
|
+
}
|
|
26936
|
+
}
|
|
26937
|
+
};
|
|
26938
|
+
await beginSelections();
|
|
26939
|
+
};
|
|
26940
|
+
const appModal = {
|
|
26941
|
+
begin,
|
|
26942
|
+
end
|
|
26943
|
+
};
|
|
26944
|
+
appModalStore.set(key, appModal);
|
|
26945
|
+
|
|
26946
|
+
/**
|
|
26947
|
+
* @class
|
|
26948
|
+
* @alias AppSelections
|
|
26949
|
+
*/
|
|
26950
|
+
const appSelections = {
|
|
26951
|
+
model: app,
|
|
26952
|
+
isInModal() {
|
|
26953
|
+
return !!modalObjectStore.get(key);
|
|
26954
|
+
},
|
|
26955
|
+
isModal(objectSelections) {
|
|
26956
|
+
var _modalObjectStore$get2;
|
|
26957
|
+
// TODO check model state
|
|
26958
|
+
return objectSelections ? ((_modalObjectStore$get2 = modalObjectStore.get(key)) === null || _modalObjectStore$get2 === void 0 ? void 0 : _modalObjectStore$get2.objectSelections) === objectSelections : !!modalObjectStore.get(key);
|
|
26959
|
+
},
|
|
26960
|
+
forward() {
|
|
26961
|
+
return appModal.end().then(() => app.forward());
|
|
26962
|
+
},
|
|
26963
|
+
back() {
|
|
26964
|
+
return appModal.end().then(() => app.back());
|
|
26965
|
+
},
|
|
26966
|
+
clear() {
|
|
26967
|
+
return appModal.end().then(() => app.clearAll());
|
|
26968
|
+
},
|
|
26969
|
+
clearField(field) {
|
|
26970
|
+
let state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '$';
|
|
26971
|
+
return appModal.end().then(() => app.getField(field, state).then(f => f.clear()));
|
|
26972
|
+
}
|
|
26973
|
+
};
|
|
26974
|
+
return appSelections;
|
|
26975
|
+
}
|
|
26976
|
+
function useAppSelections(app) {
|
|
26977
|
+
if (!app.session) {
|
|
26978
|
+
// assume the app is mocked if session is undefined
|
|
26979
|
+
return [];
|
|
26980
|
+
}
|
|
26981
|
+
const {
|
|
26982
|
+
selectionStore
|
|
26983
|
+
} = reactExports.useContext(InstanceContext);
|
|
26984
|
+
const [appSelectionsStore] = selectionStore.useAppSelectionsStore();
|
|
26985
|
+
const key = app ? app.id : null;
|
|
26986
|
+
let appSelections = appSelectionsStore.get(key);
|
|
26987
|
+
reactExports.useEffect(() => {
|
|
26988
|
+
if (!app || appSelections) return;
|
|
26989
|
+
appSelections = createAppSelections({
|
|
26990
|
+
app,
|
|
26991
|
+
selectionStore
|
|
26992
|
+
});
|
|
26993
|
+
appSelectionsStore.set(key, appSelections);
|
|
26994
|
+
appSelectionsStore.dispatch(true);
|
|
26995
|
+
}, [app]);
|
|
26996
|
+
return [appSelections];
|
|
26997
|
+
}
|
|
26998
|
+
|
|
26959
26999
|
function eventmixin (obj) {
|
|
26960
27000
|
/* eslint no-param-reassign: 0 */
|
|
26961
27001
|
Object.keys(EventEmitter$1.prototype).forEach(key => {
|
|
@@ -27199,7 +27239,9 @@
|
|
|
27199
27239
|
const elementsArr = Array.isArray(elements) ? elements : [elements];
|
|
27200
27240
|
const [appSelections] = useAppSelections(app);
|
|
27201
27241
|
const [layout] = useLayout$1(model);
|
|
27202
|
-
const
|
|
27242
|
+
const {
|
|
27243
|
+
appModalStore
|
|
27244
|
+
} = reactExports.useContext(InstanceContext).selectionStore;
|
|
27203
27245
|
const appModal = appModalStore.get(app.id);
|
|
27204
27246
|
const [objectSelections, setObjectSelections] = reactExports.useState();
|
|
27205
27247
|
reactExports.useEffect(() => {
|
|
@@ -28546,7 +28588,6 @@
|
|
|
28546
28588
|
this._lumi = 0.299 * this._r + 0.587 * this._g + 0.114 * this._b; // option 2
|
|
28547
28589
|
// 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
28590
|
}
|
|
28549
|
-
|
|
28550
28591
|
return this._lumi;
|
|
28551
28592
|
}
|
|
28552
28593
|
|
|
@@ -29105,7 +29146,7 @@
|
|
|
29105
29146
|
function resolveBgColor(comp, theme, objectType) {
|
|
29106
29147
|
const bgColor = comp === null || comp === void 0 ? void 0 : comp.bgColor;
|
|
29107
29148
|
if (bgColor && theme) {
|
|
29108
|
-
if (bgColor.useExpression) {
|
|
29149
|
+
if (bgColor.useExpression || bgColor.useColorExpression) {
|
|
29109
29150
|
return theme.validateColor(bgColor.colorExpression);
|
|
29110
29151
|
}
|
|
29111
29152
|
}
|
|
@@ -29200,24 +29241,25 @@
|
|
|
29200
29241
|
return overrides;
|
|
29201
29242
|
}
|
|
29202
29243
|
function getSelectionColors(_ref) {
|
|
29203
|
-
var _overrides$theme, _theme$palette, _overrides$theme$cont, _overrides$theme2, _overrides$selections,
|
|
29244
|
+
var _overrides$theme, _theme$palette, _overrides$theme$cont, _overrides$theme2, _overrides$selections, _theme$palette2, _theme$palette3, _theme$palette4, _theme$palette5, _theme$palette6, _theme$palette7, _theme$palette8, _theme$palette9, _theme$palette10, _theme$palette11;
|
|
29204
29245
|
let {
|
|
29246
|
+
getColorPickerColor,
|
|
29205
29247
|
theme,
|
|
29206
29248
|
getListboxStyle,
|
|
29207
29249
|
overrides,
|
|
29208
29250
|
checkboxes
|
|
29209
29251
|
} = _ref;
|
|
29210
|
-
const componentContentTextColor = (_overrides$theme = overrides.theme) === null || _overrides$theme === void 0 || (_overrides$theme = _overrides$theme.content) === null || _overrides$theme === void 0
|
|
29211
|
-
const desiredTextColor = componentContentTextColor || getListboxStyle('content', 'color') || ((_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.text.primary);
|
|
29252
|
+
const componentContentTextColor = (_overrides$theme = overrides.theme) === null || _overrides$theme === void 0 || (_overrides$theme = _overrides$theme.content) === null || _overrides$theme === void 0 ? void 0 : _overrides$theme.fontColor;
|
|
29253
|
+
const desiredTextColor = getColorPickerColor(componentContentTextColor) || getListboxStyle('content', 'color') || ((_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.text.primary);
|
|
29212
29254
|
const useContrastTextColor = !checkboxes && ((_overrides$theme$cont = (_overrides$theme2 = overrides.theme) === null || _overrides$theme2 === void 0 || (_overrides$theme2 = _overrides$theme2.content) === null || _overrides$theme2 === void 0 ? void 0 : _overrides$theme2.useContrastColor) !== null && _overrides$theme$cont !== void 0 ? _overrides$theme$cont : true);
|
|
29213
29255
|
|
|
29214
29256
|
// Background colors
|
|
29215
29257
|
const selectionColors = ((_overrides$selections = overrides.selections) === null || _overrides$selections === void 0 ? void 0 : _overrides$selections.colors) || {};
|
|
29216
|
-
const selected = (
|
|
29217
|
-
const alternative = (
|
|
29218
|
-
const excluded = (
|
|
29219
|
-
const selectedExcluded = (
|
|
29220
|
-
const possible = (
|
|
29258
|
+
const selected = getColorPickerColor(selectionColors.selected) || ((_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.selected.main) || '#009845';
|
|
29259
|
+
const alternative = getColorPickerColor(selectionColors.alternative) || ((_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.selected.alternative) || '#E4E4E4';
|
|
29260
|
+
const excluded = getColorPickerColor(selectionColors.excluded) || ((_theme$palette4 = theme.palette) === null || _theme$palette4 === void 0 ? void 0 : _theme$palette4.selected.excluded) || '#A9A9A9';
|
|
29261
|
+
const selectedExcluded = getColorPickerColor(selectionColors.selectedExcluded) || ((_theme$palette5 = theme.palette) === null || _theme$palette5 === void 0 ? void 0 : _theme$palette5.selected.selectedExcluded) || '#A9A9A9';
|
|
29262
|
+
const possible = getColorPickerColor(selectionColors.possible) || getListboxStyle('', 'backgroundColor') || ((_theme$palette6 = theme.palette) === null || _theme$palette6 === void 0 ? void 0 : _theme$palette6.selected.possible) || '#FFFFFF';
|
|
29221
29263
|
|
|
29222
29264
|
// Font colors
|
|
29223
29265
|
let selectedContrast = desiredTextColor || ((_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.selected.selectedContrastText);
|
|
@@ -29261,8 +29303,7 @@
|
|
|
29261
29303
|
bgColor
|
|
29262
29304
|
}, themeApi, 'listBox');
|
|
29263
29305
|
} else {
|
|
29264
|
-
|
|
29265
|
-
color = (_themeApi$getColorPic = themeApi.getColorPickerColor(bgColor, true)) === null || _themeApi$getColorPic === void 0 ? void 0 : _themeApi$getColorPic.color;
|
|
29306
|
+
color = themeApi.getColorPickerColor(bgColor === null || bgColor === void 0 ? void 0 : bgColor.color, false);
|
|
29266
29307
|
}
|
|
29267
29308
|
return color;
|
|
29268
29309
|
}
|
|
@@ -29282,14 +29323,16 @@
|
|
|
29282
29323
|
} = _ref3;
|
|
29283
29324
|
const overrides = getOverridesAsObject(components);
|
|
29284
29325
|
const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
|
|
29326
|
+
const getColorPickerColor = c => (c === null || c === void 0 ? void 0 : c.index) > 0 || c !== null && c !== void 0 && c.color ? themeApi.getColorPickerColor(c, false) : undefined;
|
|
29285
29327
|
const selections = getSelectionColors({
|
|
29328
|
+
getColorPickerColor,
|
|
29286
29329
|
theme,
|
|
29287
29330
|
getListboxStyle,
|
|
29288
29331
|
overrides,
|
|
29289
29332
|
checkboxes
|
|
29290
29333
|
});
|
|
29291
29334
|
const themeOverrides = overrides.theme || {};
|
|
29292
|
-
const headerColor = ((_themeOverrides$heade = themeOverrides.header) === null || _themeOverrides$heade === void 0
|
|
29335
|
+
const headerColor = getColorPickerColor((_themeOverrides$heade = themeOverrides.header) === null || _themeOverrides$heade === void 0 ? void 0 : _themeOverrides$heade.fontColor) || getListboxStyle('title.main', 'color');
|
|
29293
29336
|
const bgComponentColor = getBackgroundColor({
|
|
29294
29337
|
themeApi,
|
|
29295
29338
|
themeOverrides
|
|
@@ -29332,8 +29375,9 @@
|
|
|
29332
29375
|
search: {
|
|
29333
29376
|
color: searchColor,
|
|
29334
29377
|
borderColor: theme.palette.divider,
|
|
29335
|
-
highlightBorderColor: theme.palette.
|
|
29336
|
-
backgroundColor: searchBgColor
|
|
29378
|
+
highlightBorderColor: theme.palette.custom.focusBorder,
|
|
29379
|
+
backgroundColor: searchBgColor,
|
|
29380
|
+
backdropFilter: 'blur(8px)'
|
|
29337
29381
|
},
|
|
29338
29382
|
selections
|
|
29339
29383
|
};
|
|
@@ -29599,7 +29643,6 @@
|
|
|
29599
29643
|
segments.forEach((s, i) => {
|
|
29600
29644
|
s.offset = i ? segments[i - 1].offset + segments[i - 1].ratio : 0; // eslint-disable-line
|
|
29601
29645
|
});
|
|
29602
|
-
|
|
29603
29646
|
let Header = null;
|
|
29604
29647
|
let Icon = null;
|
|
29605
29648
|
let SegmentsIndicator = null;
|
|
@@ -30052,7 +30095,9 @@
|
|
|
30052
30095
|
items: [],
|
|
30053
30096
|
more: []
|
|
30054
30097
|
});
|
|
30055
|
-
const
|
|
30098
|
+
const {
|
|
30099
|
+
modalObjectStore
|
|
30100
|
+
} = reactExports.useContext(InstanceContext).selectionStore;
|
|
30056
30101
|
const [containerRef, containerRect] = useRect$1();
|
|
30057
30102
|
const [maxItems, setMaxItems] = reactExports.useState(0);
|
|
30058
30103
|
const isInListboxPopover = () => {
|
|
@@ -30830,7 +30875,6 @@
|
|
|
30830
30875
|
if (!event.target.classList.contains('listbox-container')) {
|
|
30831
30876
|
break; // don't mess with keydown handlers within the listbox (e.g. row seletion)
|
|
30832
30877
|
}
|
|
30833
|
-
|
|
30834
30878
|
keyboard.focus();
|
|
30835
30879
|
prevent();
|
|
30836
30880
|
break;
|
|
@@ -31013,9 +31057,8 @@
|
|
|
31013
31057
|
}
|
|
31014
31058
|
containerPadding = layoutOrder === 'row' ? "".concat(paddingY, " 4px") : "".concat(paddingY, " 6px ").concat(paddingY, " 4px");
|
|
31015
31059
|
} else {
|
|
31016
|
-
containerPadding = undefined;
|
|
31060
|
+
containerPadding = undefined;
|
|
31017
31061
|
}
|
|
31018
|
-
|
|
31019
31062
|
return containerPadding;
|
|
31020
31063
|
}
|
|
31021
31064
|
|
|
@@ -31087,7 +31130,6 @@
|
|
|
31087
31130
|
paddingRight: '1px' // make place for italic font style
|
|
31088
31131
|
});
|
|
31089
31132
|
});
|
|
31090
|
-
|
|
31091
31133
|
const isModal = _ref4 => {
|
|
31092
31134
|
var _app$isInModalSelecti, _app$isInModalSelecti2;
|
|
31093
31135
|
let {
|
|
@@ -31962,7 +32004,6 @@
|
|
|
31962
32004
|
frequencyMode: getFrequencyModeLetter(options.frequencyMode) // stick to letter option hereafter
|
|
31963
32005
|
});
|
|
31964
32006
|
}
|
|
31965
|
-
|
|
31966
32007
|
const [changeCount, setChangeCount] = reactExports.useState(0);
|
|
31967
32008
|
reactExports.useEffect(() => {
|
|
31968
32009
|
if (changeCount) {
|
|
@@ -32364,7 +32405,6 @@
|
|
|
32364
32405
|
{
|
|
32365
32406
|
console.warn('Attempting to add fields to an object without a specified data target'); // eslint-disable-line no-console
|
|
32366
32407
|
}
|
|
32367
|
-
|
|
32368
32408
|
return;
|
|
32369
32409
|
}
|
|
32370
32410
|
const {
|
|
@@ -32463,7 +32503,6 @@
|
|
|
32463
32503
|
if (step === '') {
|
|
32464
32504
|
continue; // eslint-disable-line no-continue
|
|
32465
32505
|
}
|
|
32466
|
-
|
|
32467
32506
|
if (dataContainer[step] === undefined || dataContainer[step] === null) {
|
|
32468
32507
|
return defaultValue;
|
|
32469
32508
|
}
|
|
@@ -32633,7 +32672,6 @@
|
|
|
32633
32672
|
function getOthersLabel() {
|
|
32634
32673
|
return 'Others'; // TODO: translator.get('properties.dimensionLimits.others')
|
|
32635
32674
|
}
|
|
32636
|
-
|
|
32637
32675
|
function createDefaultDimension(dimensionDef, dimensionProperties) {
|
|
32638
32676
|
const def = extend$2(true, {}, dimensionProperties, dimensionDef);
|
|
32639
32677
|
if (!utils.getValue(def, 'qOtherTotalSpec.qOtherCounted')) {
|
|
@@ -33159,7 +33197,6 @@
|
|
|
33159
33197
|
}
|
|
33160
33198
|
return undefined; // TODO: add listbox and other
|
|
33161
33199
|
};
|
|
33162
|
-
|
|
33163
33200
|
const getExportPropertiesFnc = qae => {
|
|
33164
33201
|
if (qae.exportProperties) {
|
|
33165
33202
|
return qae.exportProperties;
|
|
@@ -33174,7 +33211,6 @@
|
|
|
33174
33211
|
}
|
|
33175
33212
|
return undefined; // TODO: add listbox and other
|
|
33176
33213
|
};
|
|
33177
|
-
|
|
33178
33214
|
const getImportPropertiesFnc = qae => {
|
|
33179
33215
|
if (qae.importProperties) {
|
|
33180
33216
|
return qae.importProperties;
|
|
@@ -35212,7 +35248,6 @@
|
|
|
35212
35248
|
hooks.macro = null;
|
|
35213
35249
|
maybeEndChain(hooks); // eslint-disable-line no-use-before-define
|
|
35214
35250
|
}
|
|
35215
|
-
|
|
35216
35251
|
function maybeEndChain(hooks) {
|
|
35217
35252
|
if (hooks.pendingPromises.length || hooks.micro || hooks.macro) {
|
|
35218
35253
|
return;
|
|
@@ -36749,7 +36784,6 @@
|
|
|
36749
36784
|
if (steps[i] === '') {
|
|
36750
36785
|
continue; // eslint-disable-line no-continue
|
|
36751
36786
|
}
|
|
36752
|
-
|
|
36753
36787
|
if (typeof dataContainer[steps[i]] === 'undefined') {
|
|
36754
36788
|
return defaultValue;
|
|
36755
36789
|
}
|
|
@@ -37225,7 +37259,6 @@
|
|
|
37225
37259
|
// resize() {},
|
|
37226
37260
|
// show() {},
|
|
37227
37261
|
};
|
|
37228
|
-
|
|
37229
37262
|
return api;
|
|
37230
37263
|
}
|
|
37231
37264
|
|
|
@@ -37287,7 +37320,7 @@
|
|
|
37287
37320
|
* };
|
|
37288
37321
|
* nebbie.render(createConfig);
|
|
37289
37322
|
*/
|
|
37290
|
-
async function createSessionObject(_ref, halo) {
|
|
37323
|
+
async function createSessionObject(_ref, halo, store) {
|
|
37291
37324
|
let {
|
|
37292
37325
|
type,
|
|
37293
37326
|
version,
|
|
@@ -37300,6 +37333,10 @@
|
|
|
37300
37333
|
} = _ref;
|
|
37301
37334
|
let mergedProps = {};
|
|
37302
37335
|
const children = [];
|
|
37336
|
+
const {
|
|
37337
|
+
modelStore,
|
|
37338
|
+
subscribe
|
|
37339
|
+
} = store;
|
|
37303
37340
|
let error;
|
|
37304
37341
|
try {
|
|
37305
37342
|
const t = halo.types.get({
|
|
@@ -37331,7 +37368,6 @@
|
|
|
37331
37368
|
};
|
|
37332
37369
|
// console.error(e); // eslint-disable-line
|
|
37333
37370
|
}
|
|
37334
|
-
|
|
37335
37371
|
const model = await halo.app.createSessionObject(mergedProps);
|
|
37336
37372
|
if (children.length > 0) {
|
|
37337
37373
|
await model.setFullPropertyTree({
|
|
@@ -37365,7 +37401,7 @@
|
|
|
37365
37401
|
* @property {EngineAPI.IGenericObjectProperties=} properties
|
|
37366
37402
|
*/
|
|
37367
37403
|
|
|
37368
|
-
async function createObject(_ref, halo, generateOnly) {
|
|
37404
|
+
async function createObject(_ref, halo, generateOnly, store) {
|
|
37369
37405
|
let {
|
|
37370
37406
|
type,
|
|
37371
37407
|
version,
|
|
@@ -37375,6 +37411,9 @@
|
|
|
37375
37411
|
} = _ref;
|
|
37376
37412
|
let mergedProps = {};
|
|
37377
37413
|
const children = [];
|
|
37414
|
+
const {
|
|
37415
|
+
modelStore
|
|
37416
|
+
} = store;
|
|
37378
37417
|
// let error;
|
|
37379
37418
|
try {
|
|
37380
37419
|
const t = halo.types.get({
|
|
@@ -37410,7 +37449,6 @@
|
|
|
37410
37449
|
}
|
|
37411
37450
|
// console.error(e); // eslint-disable-line
|
|
37412
37451
|
}
|
|
37413
|
-
|
|
37414
37452
|
if (!generateOnly) {
|
|
37415
37453
|
const model = await halo.app.createObject(mergedProps);
|
|
37416
37454
|
if (children.length > 0) {
|
|
@@ -37425,13 +37463,17 @@
|
|
|
37425
37463
|
return mergedProps;
|
|
37426
37464
|
}
|
|
37427
37465
|
|
|
37428
|
-
async function getObject$1(_ref, halo) {
|
|
37466
|
+
async function getObject$1(_ref, halo, store) {
|
|
37429
37467
|
let {
|
|
37430
37468
|
id,
|
|
37431
37469
|
options,
|
|
37432
37470
|
plugins,
|
|
37433
37471
|
element
|
|
37434
37472
|
} = _ref;
|
|
37473
|
+
const {
|
|
37474
|
+
modelStore,
|
|
37475
|
+
rpcRequestModelStore
|
|
37476
|
+
} = store;
|
|
37435
37477
|
const key = "".concat(id);
|
|
37436
37478
|
let rpc = rpcRequestModelStore.get(key);
|
|
37437
37479
|
if (!rpc) {
|
|
@@ -37508,7 +37550,8 @@
|
|
|
37508
37550
|
} = halo;
|
|
37509
37551
|
const [layout] = useLayout$1(model);
|
|
37510
37552
|
const {
|
|
37511
|
-
theme: themeName
|
|
37553
|
+
theme: themeName,
|
|
37554
|
+
modelStore
|
|
37512
37555
|
} = reactExports.useContext(InstanceContext);
|
|
37513
37556
|
const [cells, setCells] = reactExports.useState([]);
|
|
37514
37557
|
const [bgColor, setBgColor] = reactExports.useState(undefined);
|
|
@@ -37553,7 +37596,7 @@
|
|
|
37553
37596
|
}
|
|
37554
37597
|
const vs = await getObject$1({
|
|
37555
37598
|
id: c.name
|
|
37556
|
-
}, halo);
|
|
37599
|
+
}, halo, modelStore);
|
|
37557
37600
|
return {
|
|
37558
37601
|
model: vs.model,
|
|
37559
37602
|
id: c.name,
|
|
@@ -37787,13 +37830,17 @@
|
|
|
37787
37830
|
return api;
|
|
37788
37831
|
}
|
|
37789
37832
|
|
|
37790
|
-
async function getObject(_ref, halo) {
|
|
37833
|
+
async function getObject(_ref, halo, store) {
|
|
37791
37834
|
let {
|
|
37792
37835
|
id,
|
|
37793
37836
|
options,
|
|
37794
37837
|
plugins,
|
|
37795
37838
|
element
|
|
37796
37839
|
} = _ref;
|
|
37840
|
+
const {
|
|
37841
|
+
modelStore,
|
|
37842
|
+
rpcRequestModelStore
|
|
37843
|
+
} = store;
|
|
37797
37844
|
const key = "".concat(id);
|
|
37798
37845
|
let rpc = rpcRequestModelStore.get(key);
|
|
37799
37846
|
if (!rpc) {
|
|
@@ -37822,15 +37869,14 @@
|
|
|
37822
37869
|
* @interface Flags
|
|
37823
37870
|
*/
|
|
37824
37871
|
|
|
37825
|
-
return
|
|
37826
|
-
|
|
37827
|
-
|
|
37828
|
-
|
|
37829
|
-
|
|
37830
|
-
|
|
37831
|
-
|
|
37832
|
-
|
|
37833
|
-
);
|
|
37872
|
+
return /** @lends Flags */{
|
|
37873
|
+
/**
|
|
37874
|
+
* Checks whether the specified flag is enabled.
|
|
37875
|
+
* @param {string} flag - The value flag to check.
|
|
37876
|
+
* @returns {boolean} True if the specified flag is enabled, false otherwise.
|
|
37877
|
+
*/
|
|
37878
|
+
isEnabled: f => flags[f] === true
|
|
37879
|
+
};
|
|
37834
37880
|
}
|
|
37835
37881
|
|
|
37836
37882
|
var iterator;
|
|
@@ -38277,6 +38323,7 @@
|
|
|
38277
38323
|
|
|
38278
38324
|
// A linked list to keep track of recently-used-ness
|
|
38279
38325
|
const Yallist = yallist;
|
|
38326
|
+
|
|
38280
38327
|
const MAX = Symbol('max');
|
|
38281
38328
|
const LENGTH = Symbol('length');
|
|
38282
38329
|
const LENGTH_CALCULATOR = Symbol('lengthCalculator');
|
|
@@ -38287,6 +38334,7 @@
|
|
|
38287
38334
|
const LRU_LIST = Symbol('lruList');
|
|
38288
38335
|
const CACHE = Symbol('cache');
|
|
38289
38336
|
const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
|
|
38337
|
+
|
|
38290
38338
|
const naiveLength = () => 1;
|
|
38291
38339
|
|
|
38292
38340
|
// lruList is a yallist where the head is the youngest
|
|
@@ -38298,18 +38346,23 @@
|
|
|
38298
38346
|
// cache is a Map (or PseudoMap) that matches the keys to
|
|
38299
38347
|
// the Yallist.Node object.
|
|
38300
38348
|
class LRUCache {
|
|
38301
|
-
constructor(options) {
|
|
38302
|
-
if (typeof options === 'number')
|
|
38303
|
-
max: options
|
|
38304
|
-
|
|
38305
|
-
if (!options)
|
|
38306
|
-
|
|
38349
|
+
constructor (options) {
|
|
38350
|
+
if (typeof options === 'number')
|
|
38351
|
+
options = { max: options };
|
|
38352
|
+
|
|
38353
|
+
if (!options)
|
|
38354
|
+
options = {};
|
|
38355
|
+
|
|
38356
|
+
if (options.max && (typeof options.max !== 'number' || options.max < 0))
|
|
38357
|
+
throw new TypeError('max must be a non-negative number')
|
|
38307
38358
|
// Kind of weird to have a default max of Infinity, but oh well.
|
|
38308
38359
|
this[MAX] = options.max || Infinity;
|
|
38360
|
+
|
|
38309
38361
|
const lc = options.length || naiveLength;
|
|
38310
|
-
this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc;
|
|
38362
|
+
this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc;
|
|
38311
38363
|
this[ALLOW_STALE] = options.stale || false;
|
|
38312
|
-
if (options.maxAge && typeof options.maxAge !== 'number')
|
|
38364
|
+
if (options.maxAge && typeof options.maxAge !== 'number')
|
|
38365
|
+
throw new TypeError('maxAge must be a number')
|
|
38313
38366
|
this[MAX_AGE] = options.maxAge || 0;
|
|
38314
38367
|
this[DISPOSE] = options.dispose;
|
|
38315
38368
|
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
|
|
@@ -38318,32 +38371,40 @@
|
|
|
38318
38371
|
}
|
|
38319
38372
|
|
|
38320
38373
|
// resize the cache when the max changes.
|
|
38321
|
-
set max(mL) {
|
|
38322
|
-
if (typeof mL !== 'number' || mL < 0)
|
|
38374
|
+
set max (mL) {
|
|
38375
|
+
if (typeof mL !== 'number' || mL < 0)
|
|
38376
|
+
throw new TypeError('max must be a non-negative number')
|
|
38377
|
+
|
|
38323
38378
|
this[MAX] = mL || Infinity;
|
|
38324
38379
|
trim(this);
|
|
38325
38380
|
}
|
|
38326
|
-
get max() {
|
|
38327
|
-
return this[MAX]
|
|
38381
|
+
get max () {
|
|
38382
|
+
return this[MAX]
|
|
38328
38383
|
}
|
|
38329
|
-
|
|
38384
|
+
|
|
38385
|
+
set allowStale (allowStale) {
|
|
38330
38386
|
this[ALLOW_STALE] = !!allowStale;
|
|
38331
38387
|
}
|
|
38332
|
-
get allowStale() {
|
|
38333
|
-
return this[ALLOW_STALE]
|
|
38388
|
+
get allowStale () {
|
|
38389
|
+
return this[ALLOW_STALE]
|
|
38334
38390
|
}
|
|
38335
|
-
|
|
38336
|
-
|
|
38391
|
+
|
|
38392
|
+
set maxAge (mA) {
|
|
38393
|
+
if (typeof mA !== 'number')
|
|
38394
|
+
throw new TypeError('maxAge must be a non-negative number')
|
|
38395
|
+
|
|
38337
38396
|
this[MAX_AGE] = mA;
|
|
38338
38397
|
trim(this);
|
|
38339
38398
|
}
|
|
38340
|
-
get maxAge() {
|
|
38341
|
-
return this[MAX_AGE]
|
|
38399
|
+
get maxAge () {
|
|
38400
|
+
return this[MAX_AGE]
|
|
38342
38401
|
}
|
|
38343
38402
|
|
|
38344
38403
|
// resize the cache when the lengthCalculator changes.
|
|
38345
|
-
set lengthCalculator(lC) {
|
|
38346
|
-
if (typeof lC !== 'function')
|
|
38404
|
+
set lengthCalculator (lC) {
|
|
38405
|
+
if (typeof lC !== 'function')
|
|
38406
|
+
lC = naiveLength;
|
|
38407
|
+
|
|
38347
38408
|
if (lC !== this[LENGTH_CALCULATOR]) {
|
|
38348
38409
|
this[LENGTH_CALCULATOR] = lC;
|
|
38349
38410
|
this[LENGTH] = 0;
|
|
@@ -38354,16 +38415,12 @@
|
|
|
38354
38415
|
}
|
|
38355
38416
|
trim(this);
|
|
38356
38417
|
}
|
|
38357
|
-
get lengthCalculator() {
|
|
38358
|
-
|
|
38359
|
-
}
|
|
38360
|
-
get
|
|
38361
|
-
|
|
38362
|
-
|
|
38363
|
-
get itemCount() {
|
|
38364
|
-
return this[LRU_LIST].length;
|
|
38365
|
-
}
|
|
38366
|
-
rforEach(fn, thisp) {
|
|
38418
|
+
get lengthCalculator () { return this[LENGTH_CALCULATOR] }
|
|
38419
|
+
|
|
38420
|
+
get length () { return this[LENGTH] }
|
|
38421
|
+
get itemCount () { return this[LRU_LIST].length }
|
|
38422
|
+
|
|
38423
|
+
rforEach (fn, thisp) {
|
|
38367
38424
|
thisp = thisp || this;
|
|
38368
38425
|
for (let walker = this[LRU_LIST].tail; walker !== null;) {
|
|
38369
38426
|
const prev = walker.prev;
|
|
@@ -38371,7 +38428,8 @@
|
|
|
38371
38428
|
walker = prev;
|
|
38372
38429
|
}
|
|
38373
38430
|
}
|
|
38374
|
-
|
|
38431
|
+
|
|
38432
|
+
forEach (fn, thisp) {
|
|
38375
38433
|
thisp = thisp || this;
|
|
38376
38434
|
for (let walker = this[LRU_LIST].head; walker !== null;) {
|
|
38377
38435
|
const next = walker.next;
|
|
@@ -38379,49 +38437,65 @@
|
|
|
38379
38437
|
walker = next;
|
|
38380
38438
|
}
|
|
38381
38439
|
}
|
|
38382
|
-
|
|
38383
|
-
|
|
38440
|
+
|
|
38441
|
+
keys () {
|
|
38442
|
+
return this[LRU_LIST].toArray().map(k => k.key)
|
|
38384
38443
|
}
|
|
38385
|
-
|
|
38386
|
-
|
|
38444
|
+
|
|
38445
|
+
values () {
|
|
38446
|
+
return this[LRU_LIST].toArray().map(k => k.value)
|
|
38387
38447
|
}
|
|
38388
|
-
|
|
38389
|
-
|
|
38448
|
+
|
|
38449
|
+
reset () {
|
|
38450
|
+
if (this[DISPOSE] &&
|
|
38451
|
+
this[LRU_LIST] &&
|
|
38452
|
+
this[LRU_LIST].length) {
|
|
38390
38453
|
this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
|
|
38391
38454
|
}
|
|
38455
|
+
|
|
38392
38456
|
this[CACHE] = new Map(); // hash of items by key
|
|
38393
38457
|
this[LRU_LIST] = new Yallist(); // list of items in order of use recency
|
|
38394
38458
|
this[LENGTH] = 0; // length of items in the list
|
|
38395
38459
|
}
|
|
38396
38460
|
|
|
38397
|
-
dump() {
|
|
38398
|
-
return this[LRU_LIST].map(hit =>
|
|
38399
|
-
|
|
38400
|
-
|
|
38401
|
-
|
|
38402
|
-
|
|
38461
|
+
dump () {
|
|
38462
|
+
return this[LRU_LIST].map(hit =>
|
|
38463
|
+
isStale(this, hit) ? false : {
|
|
38464
|
+
k: hit.key,
|
|
38465
|
+
v: hit.value,
|
|
38466
|
+
e: hit.now + (hit.maxAge || 0)
|
|
38467
|
+
}).toArray().filter(h => h)
|
|
38403
38468
|
}
|
|
38404
|
-
|
|
38405
|
-
|
|
38469
|
+
|
|
38470
|
+
dumpLru () {
|
|
38471
|
+
return this[LRU_LIST]
|
|
38406
38472
|
}
|
|
38407
|
-
|
|
38473
|
+
|
|
38474
|
+
set (key, value, maxAge) {
|
|
38408
38475
|
maxAge = maxAge || this[MAX_AGE];
|
|
38409
|
-
|
|
38476
|
+
|
|
38477
|
+
if (maxAge && typeof maxAge !== 'number')
|
|
38478
|
+
throw new TypeError('maxAge must be a number')
|
|
38479
|
+
|
|
38410
38480
|
const now = maxAge ? Date.now() : 0;
|
|
38411
38481
|
const len = this[LENGTH_CALCULATOR](value, key);
|
|
38482
|
+
|
|
38412
38483
|
if (this[CACHE].has(key)) {
|
|
38413
38484
|
if (len > this[MAX]) {
|
|
38414
38485
|
del(this, this[CACHE].get(key));
|
|
38415
|
-
return false
|
|
38486
|
+
return false
|
|
38416
38487
|
}
|
|
38488
|
+
|
|
38417
38489
|
const node = this[CACHE].get(key);
|
|
38418
38490
|
const item = node.value;
|
|
38419
38491
|
|
|
38420
38492
|
// dispose of the old one before overwriting
|
|
38421
38493
|
// split out into 2 ifs for better coverage tracking
|
|
38422
38494
|
if (this[DISPOSE]) {
|
|
38423
|
-
if (!this[NO_DISPOSE_ON_SET])
|
|
38495
|
+
if (!this[NO_DISPOSE_ON_SET])
|
|
38496
|
+
this[DISPOSE](key, item.value);
|
|
38424
38497
|
}
|
|
38498
|
+
|
|
38425
38499
|
item.now = now;
|
|
38426
38500
|
item.maxAge = maxAge;
|
|
38427
38501
|
item.value = value;
|
|
@@ -38429,44 +38503,57 @@
|
|
|
38429
38503
|
item.length = len;
|
|
38430
38504
|
this.get(key);
|
|
38431
38505
|
trim(this);
|
|
38432
|
-
return true
|
|
38506
|
+
return true
|
|
38433
38507
|
}
|
|
38508
|
+
|
|
38434
38509
|
const hit = new Entry(key, value, len, now, maxAge);
|
|
38435
38510
|
|
|
38436
38511
|
// oversized objects fall out of cache automatically.
|
|
38437
38512
|
if (hit.length > this[MAX]) {
|
|
38438
|
-
if (this[DISPOSE])
|
|
38439
|
-
|
|
38513
|
+
if (this[DISPOSE])
|
|
38514
|
+
this[DISPOSE](key, value);
|
|
38515
|
+
|
|
38516
|
+
return false
|
|
38440
38517
|
}
|
|
38518
|
+
|
|
38441
38519
|
this[LENGTH] += hit.length;
|
|
38442
38520
|
this[LRU_LIST].unshift(hit);
|
|
38443
38521
|
this[CACHE].set(key, this[LRU_LIST].head);
|
|
38444
38522
|
trim(this);
|
|
38445
|
-
return true
|
|
38523
|
+
return true
|
|
38446
38524
|
}
|
|
38447
|
-
|
|
38448
|
-
|
|
38525
|
+
|
|
38526
|
+
has (key) {
|
|
38527
|
+
if (!this[CACHE].has(key)) return false
|
|
38449
38528
|
const hit = this[CACHE].get(key).value;
|
|
38450
|
-
return !isStale(this, hit)
|
|
38529
|
+
return !isStale(this, hit)
|
|
38451
38530
|
}
|
|
38452
|
-
|
|
38453
|
-
|
|
38531
|
+
|
|
38532
|
+
get (key) {
|
|
38533
|
+
return get(this, key, true)
|
|
38454
38534
|
}
|
|
38455
|
-
|
|
38456
|
-
|
|
38535
|
+
|
|
38536
|
+
peek (key) {
|
|
38537
|
+
return get(this, key, false)
|
|
38457
38538
|
}
|
|
38458
|
-
|
|
38539
|
+
|
|
38540
|
+
pop () {
|
|
38459
38541
|
const node = this[LRU_LIST].tail;
|
|
38460
|
-
if (!node)
|
|
38542
|
+
if (!node)
|
|
38543
|
+
return null
|
|
38544
|
+
|
|
38461
38545
|
del(this, node);
|
|
38462
|
-
return node.value
|
|
38546
|
+
return node.value
|
|
38463
38547
|
}
|
|
38464
|
-
|
|
38548
|
+
|
|
38549
|
+
del (key) {
|
|
38465
38550
|
del(this, this[CACHE].get(key));
|
|
38466
38551
|
}
|
|
38467
|
-
|
|
38552
|
+
|
|
38553
|
+
load (arr) {
|
|
38468
38554
|
// reset the cache
|
|
38469
38555
|
this.reset();
|
|
38556
|
+
|
|
38470
38557
|
const now = Date.now();
|
|
38471
38558
|
// A previous serialized cache has the most recent items first
|
|
38472
38559
|
for (let l = arr.length - 1; l >= 0; l--) {
|
|
@@ -38474,7 +38561,8 @@
|
|
|
38474
38561
|
const expiresAt = hit.e || 0;
|
|
38475
38562
|
if (expiresAt === 0)
|
|
38476
38563
|
// the item was created without expiration in a non aged cache
|
|
38477
|
-
this.set(hit.k, hit.v);
|
|
38564
|
+
this.set(hit.k, hit.v);
|
|
38565
|
+
else {
|
|
38478
38566
|
const maxAge = expiresAt - now;
|
|
38479
38567
|
// dont add already expired items
|
|
38480
38568
|
if (maxAge > 0) {
|
|
@@ -38483,34 +38571,44 @@
|
|
|
38483
38571
|
}
|
|
38484
38572
|
}
|
|
38485
38573
|
}
|
|
38486
|
-
|
|
38574
|
+
|
|
38575
|
+
prune () {
|
|
38487
38576
|
this[CACHE].forEach((value, key) => get(this, key, false));
|
|
38488
38577
|
}
|
|
38489
38578
|
}
|
|
38579
|
+
|
|
38490
38580
|
const get = (self, key, doUse) => {
|
|
38491
38581
|
const node = self[CACHE].get(key);
|
|
38492
38582
|
if (node) {
|
|
38493
38583
|
const hit = node.value;
|
|
38494
38584
|
if (isStale(self, hit)) {
|
|
38495
38585
|
del(self, node);
|
|
38496
|
-
if (!self[ALLOW_STALE])
|
|
38586
|
+
if (!self[ALLOW_STALE])
|
|
38587
|
+
return undefined
|
|
38497
38588
|
} else {
|
|
38498
38589
|
if (doUse) {
|
|
38499
|
-
if (self[UPDATE_AGE_ON_GET])
|
|
38590
|
+
if (self[UPDATE_AGE_ON_GET])
|
|
38591
|
+
node.value.now = Date.now();
|
|
38500
38592
|
self[LRU_LIST].unshiftNode(node);
|
|
38501
38593
|
}
|
|
38502
38594
|
}
|
|
38503
|
-
return hit.value
|
|
38595
|
+
return hit.value
|
|
38504
38596
|
}
|
|
38505
38597
|
};
|
|
38598
|
+
|
|
38506
38599
|
const isStale = (self, hit) => {
|
|
38507
|
-
if (!hit || !hit.maxAge && !self[MAX_AGE])
|
|
38600
|
+
if (!hit || (!hit.maxAge && !self[MAX_AGE]))
|
|
38601
|
+
return false
|
|
38602
|
+
|
|
38508
38603
|
const diff = Date.now() - hit.now;
|
|
38509
|
-
return hit.maxAge ? diff > hit.maxAge
|
|
38604
|
+
return hit.maxAge ? diff > hit.maxAge
|
|
38605
|
+
: self[MAX_AGE] && (diff > self[MAX_AGE])
|
|
38510
38606
|
};
|
|
38607
|
+
|
|
38511
38608
|
const trim = self => {
|
|
38512
38609
|
if (self[LENGTH] > self[MAX]) {
|
|
38513
|
-
for (let walker = self[LRU_LIST].tail;
|
|
38610
|
+
for (let walker = self[LRU_LIST].tail;
|
|
38611
|
+
self[LENGTH] > self[MAX] && walker !== null;) {
|
|
38514
38612
|
// We know that we're about to delete this one, and also
|
|
38515
38613
|
// what the next least recently used key will be, so just
|
|
38516
38614
|
// go ahead and set it now.
|
|
@@ -38520,17 +38618,21 @@
|
|
|
38520
38618
|
}
|
|
38521
38619
|
}
|
|
38522
38620
|
};
|
|
38621
|
+
|
|
38523
38622
|
const del = (self, node) => {
|
|
38524
38623
|
if (node) {
|
|
38525
38624
|
const hit = node.value;
|
|
38526
|
-
if (self[DISPOSE])
|
|
38625
|
+
if (self[DISPOSE])
|
|
38626
|
+
self[DISPOSE](hit.key, hit.value);
|
|
38627
|
+
|
|
38527
38628
|
self[LENGTH] -= hit.length;
|
|
38528
38629
|
self[CACHE].delete(hit.key);
|
|
38529
38630
|
self[LRU_LIST].removeNode(node);
|
|
38530
38631
|
}
|
|
38531
38632
|
};
|
|
38633
|
+
|
|
38532
38634
|
class Entry {
|
|
38533
|
-
constructor(key, value, length, now, maxAge) {
|
|
38635
|
+
constructor (key, value, length, now, maxAge) {
|
|
38534
38636
|
this.key = key;
|
|
38535
38637
|
this.value = value;
|
|
38536
38638
|
this.length = length;
|
|
@@ -38538,14 +38640,18 @@
|
|
|
38538
38640
|
this.maxAge = maxAge || 0;
|
|
38539
38641
|
}
|
|
38540
38642
|
}
|
|
38643
|
+
|
|
38541
38644
|
const forEachStep = (self, fn, node, thisp) => {
|
|
38542
38645
|
let hit = node.value;
|
|
38543
38646
|
if (isStale(self, hit)) {
|
|
38544
38647
|
del(self, node);
|
|
38545
|
-
if (!self[ALLOW_STALE])
|
|
38648
|
+
if (!self[ALLOW_STALE])
|
|
38649
|
+
hit = undefined;
|
|
38546
38650
|
}
|
|
38547
|
-
if (hit)
|
|
38651
|
+
if (hit)
|
|
38652
|
+
fn.call(thisp, hit.value, hit.key, self);
|
|
38548
38653
|
};
|
|
38654
|
+
|
|
38549
38655
|
var lruCache = LRUCache;
|
|
38550
38656
|
|
|
38551
38657
|
// parse out just the options we care about
|
|
@@ -39752,7 +39858,6 @@
|
|
|
39752
39858
|
{
|
|
39753
39859
|
console.warn(e); // eslint-disable-line no-console
|
|
39754
39860
|
}
|
|
39755
|
-
|
|
39756
39861
|
throw new Error("Failed to load visualization: '".concat(sKey, "'"));
|
|
39757
39862
|
});
|
|
39758
39863
|
}
|
|
@@ -39885,7 +39990,6 @@
|
|
|
39885
39990
|
{
|
|
39886
39991
|
console.warn("Visualization ".concat(name, " is not registered. Adding it now.")); // eslint-disable-line no-console
|
|
39887
39992
|
}
|
|
39888
|
-
|
|
39889
39993
|
this.register({
|
|
39890
39994
|
name,
|
|
39891
39995
|
version
|
|
@@ -39896,7 +40000,6 @@
|
|
|
39896
40000
|
{
|
|
39897
40001
|
console.warn("Version ".concat(version, " of ").concat(name, " is not registered. Falling back to version ").concat(versionToUse)); // eslint-disable-line no-console
|
|
39898
40002
|
}
|
|
39899
|
-
|
|
39900
40003
|
version = versionToUse;
|
|
39901
40004
|
}
|
|
39902
40005
|
return tc[name].get(version) || p.get(typeInfo);
|
|
@@ -40106,7 +40209,7 @@
|
|
|
40106
40209
|
let currentContext = _objectSpread2(_objectSpread2({}, configuration.context), {}, {
|
|
40107
40210
|
translator: locale.translator
|
|
40108
40211
|
});
|
|
40109
|
-
const [root] = boot({
|
|
40212
|
+
const [root, modelStore] = boot({
|
|
40110
40213
|
app,
|
|
40111
40214
|
context: currentContext
|
|
40112
40215
|
});
|
|
@@ -40132,7 +40235,6 @@
|
|
|
40132
40235
|
translator: locale.translator,
|
|
40133
40236
|
nebbie: null // actual value is set further down
|
|
40134
40237
|
};
|
|
40135
|
-
|
|
40136
40238
|
const halo = {
|
|
40137
40239
|
app,
|
|
40138
40240
|
root,
|
|
@@ -40200,9 +40302,9 @@
|
|
|
40200
40302
|
render: async cfg => {
|
|
40201
40303
|
await currentThemePromise;
|
|
40202
40304
|
if (cfg.id) {
|
|
40203
|
-
return getObject(cfg, halo);
|
|
40305
|
+
return getObject(cfg, halo, modelStore);
|
|
40204
40306
|
}
|
|
40205
|
-
return createSessionObject(cfg, halo);
|
|
40307
|
+
return createSessionObject(cfg, halo, modelStore);
|
|
40206
40308
|
},
|
|
40207
40309
|
/**
|
|
40208
40310
|
* Creates a visualization model
|
|
@@ -40218,7 +40320,7 @@
|
|
|
40218
40320
|
* }
|
|
40219
40321
|
* );
|
|
40220
40322
|
*/
|
|
40221
|
-
create: async cfg => createObject(cfg, halo, false),
|
|
40323
|
+
create: async cfg => createObject(cfg, halo, false, modelStore),
|
|
40222
40324
|
/**
|
|
40223
40325
|
* Generates properties for a visualization object
|
|
40224
40326
|
* @param {CreateConfig} cfg The create configuration.
|
|
@@ -40281,7 +40383,6 @@
|
|
|
40281
40383
|
*/
|
|
40282
40384
|
selections: async () => {
|
|
40283
40385
|
if (!selectionsApi) {
|
|
40284
|
-
// const appSelections = await root.getAppSelections(); // Don't expose this for now
|
|
40285
40386
|
selectionsApi = /** @lends AppSelections# */{
|
|
40286
40387
|
/**
|
|
40287
40388
|
* Mounts the app selection UI into the provided HTMLElement.
|
|
@@ -40294,7 +40395,6 @@
|
|
|
40294
40395
|
{
|
|
40295
40396
|
console.error('Already mounted'); // eslint-disable-line no-console
|
|
40296
40397
|
}
|
|
40297
|
-
|
|
40298
40398
|
return;
|
|
40299
40399
|
}
|
|
40300
40400
|
selectionsComponentReference = mount({
|