@nebula.js/stardust 5.10.1 → 5.12.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 +261 -54
- 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 +328 -94
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +9 -9
- package/dist/stardust.js.map +1 -1
- package/package.json +12 -12
- package/types/index.d.ts +13 -3
package/core/esm/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v5.
|
|
2
|
+
* @nebula.js/stardust v5.12.0
|
|
3
3
|
* Copyright (c) 2025 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -16,7 +16,7 @@ function getDefaultExportFromCjs (x) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function getAugmentedNamespace(n) {
|
|
19
|
-
if (n
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
|
|
20
20
|
var f = n.default;
|
|
21
21
|
if (typeof f == "function") {
|
|
22
22
|
var a = function a () {
|
|
@@ -2905,11 +2905,13 @@ var object$2 = {
|
|
|
2905
2905
|
title: {
|
|
2906
2906
|
main: {
|
|
2907
2907
|
color: "@B50",
|
|
2908
|
-
fontSize: "15px"
|
|
2908
|
+
fontSize: "15px",
|
|
2909
|
+
backgroundColor: "transparent"
|
|
2909
2910
|
},
|
|
2910
2911
|
subTitle: {
|
|
2911
2912
|
color: "@B50",
|
|
2912
|
-
fontSize: "12px"
|
|
2913
|
+
fontSize: "12px",
|
|
2914
|
+
backgroundColor: "transparent"
|
|
2913
2915
|
},
|
|
2914
2916
|
footer: {
|
|
2915
2917
|
color: "@B50",
|
|
@@ -4849,12 +4851,13 @@ function theme$1(resolvedTheme) {
|
|
|
4849
4851
|
uiPalettes() {
|
|
4850
4852
|
const pals = [];
|
|
4851
4853
|
resolvedTheme.palettes.ui.forEach(s => {
|
|
4854
|
+
const colors = s.colors[0] !== 'none' ? ['none', ...s.colors] : s.colors;
|
|
4852
4855
|
pals.push({
|
|
4853
4856
|
key: 'ui',
|
|
4854
4857
|
name: s.name,
|
|
4855
4858
|
translation: s.translation,
|
|
4856
4859
|
type: 'row',
|
|
4857
|
-
colors
|
|
4860
|
+
colors
|
|
4858
4861
|
});
|
|
4859
4862
|
});
|
|
4860
4863
|
return pals;
|
|
@@ -4870,7 +4873,7 @@ function theme$1(resolvedTheme) {
|
|
|
4870
4873
|
others: resolvedTheme.dataColors.othersColor
|
|
4871
4874
|
};
|
|
4872
4875
|
},
|
|
4873
|
-
uiColor(c
|
|
4876
|
+
uiColor(c) {
|
|
4874
4877
|
const indexIsValid = typeof (c === null || c === void 0 ? void 0 : c.index) === 'number' && !Number.isNaN(c === null || c === void 0 ? void 0 : c.index);
|
|
4875
4878
|
const colorIsValid = typeof (c === null || c === void 0 ? void 0 : c.color) === 'string';
|
|
4876
4879
|
const somethingIsValid = indexIsValid || colorIsValid;
|
|
@@ -4878,8 +4881,6 @@ function theme$1(resolvedTheme) {
|
|
|
4878
4881
|
return undefined;
|
|
4879
4882
|
}
|
|
4880
4883
|
const getColor = () => {
|
|
4881
|
-
// eslint-disable-next-line no-param-reassign
|
|
4882
|
-
shift = !!shift;
|
|
4883
4884
|
if ((c === null || c === void 0 ? void 0 : c.index) < 0 || typeof (c === null || c === void 0 ? void 0 : c.index) === 'undefined') {
|
|
4884
4885
|
return c.color;
|
|
4885
4886
|
}
|
|
@@ -4889,10 +4890,10 @@ function theme$1(resolvedTheme) {
|
|
|
4889
4890
|
if (!uiPalette) {
|
|
4890
4891
|
return c.color;
|
|
4891
4892
|
}
|
|
4892
|
-
if (typeof uiPalette.colors[c.index
|
|
4893
|
+
if (typeof uiPalette.colors[c.index] === 'undefined') {
|
|
4893
4894
|
return c.color;
|
|
4894
4895
|
}
|
|
4895
|
-
return uiPalette.colors[c.index
|
|
4896
|
+
return uiPalette.colors[c.index];
|
|
4896
4897
|
};
|
|
4897
4898
|
const color = getColor();
|
|
4898
4899
|
if (c.alpha === undefined || c.alpha >= 1 || c.alpha < 0) {
|
|
@@ -5319,12 +5320,10 @@ function theme() {
|
|
|
5319
5320
|
* @param {object} c
|
|
5320
5321
|
* @param {number=} c.index
|
|
5321
5322
|
* @param {string=} c.color
|
|
5322
|
-
* @param {boolean=} supportNone Shifts the palette index by one to account for the "none" color
|
|
5323
5323
|
* @returns {string} The resolved color.
|
|
5324
5324
|
*
|
|
5325
5325
|
* @example
|
|
5326
5326
|
* theme.getColorPickerColor({ index: 1 });
|
|
5327
|
-
* theme.getColorPickerColor({ index: 1 }, true);
|
|
5328
5327
|
* theme.getColorPickerColor({ color: 'red' });
|
|
5329
5328
|
*/
|
|
5330
5329
|
getColorPickerColor() {
|
|
@@ -10011,7 +10010,10 @@ function createTheme(options = {}, ...args) {
|
|
|
10011
10010
|
typography: typographyInput = {}
|
|
10012
10011
|
} = options,
|
|
10013
10012
|
other = _objectWithoutPropertiesLoose$1(options, _excluded$8);
|
|
10014
|
-
if (options.vars
|
|
10013
|
+
if (options.vars &&
|
|
10014
|
+
// The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
|
|
10015
|
+
// `generateCssVars` is the closest identifier for checking that the `options` is a result of `extendTheme` with CSS variables so that user can create new theme for nested ThemeProvider.
|
|
10016
|
+
options.generateCssVars === undefined) {
|
|
10015
10017
|
throw new Error(formatMuiErrorMessage$1(18));
|
|
10016
10018
|
}
|
|
10017
10019
|
const palette = createPalette(paletteInput);
|
|
@@ -10374,9 +10376,21 @@ function ThemeProvider(_ref) {
|
|
|
10374
10376
|
} = _ref,
|
|
10375
10377
|
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$7);
|
|
10376
10378
|
const scopedTheme = themeInput[THEME_ID];
|
|
10379
|
+
let finalTheme = scopedTheme || themeInput;
|
|
10380
|
+
if (typeof themeInput !== 'function') {
|
|
10381
|
+
if (scopedTheme && !scopedTheme.vars) {
|
|
10382
|
+
finalTheme = _extends$5({}, scopedTheme, {
|
|
10383
|
+
vars: null
|
|
10384
|
+
});
|
|
10385
|
+
} else if (themeInput && !themeInput.vars) {
|
|
10386
|
+
finalTheme = _extends$5({}, themeInput, {
|
|
10387
|
+
vars: null
|
|
10388
|
+
});
|
|
10389
|
+
}
|
|
10390
|
+
}
|
|
10377
10391
|
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$5({}, props, {
|
|
10378
10392
|
themeId: scopedTheme ? THEME_ID : undefined,
|
|
10379
|
-
theme:
|
|
10393
|
+
theme: finalTheme
|
|
10380
10394
|
}));
|
|
10381
10395
|
}
|
|
10382
10396
|
|
|
@@ -10754,7 +10768,7 @@ function create$3(definition) {
|
|
|
10754
10768
|
return cache[key];
|
|
10755
10769
|
}
|
|
10756
10770
|
|
|
10757
|
-
const NEBULA_VERSION_HASH = "
|
|
10771
|
+
const NEBULA_VERSION_HASH = "02d6";
|
|
10758
10772
|
ClassNameGenerator.configure(componentName => {
|
|
10759
10773
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
10760
10774
|
});
|
|
@@ -10813,6 +10827,7 @@ var createKeyStore = (function () {
|
|
|
10813
10827
|
let applyMiddleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => {};
|
|
10814
10828
|
const sharedState = initialState;
|
|
10815
10829
|
const hookListeners = [];
|
|
10830
|
+
const subscribedListeners = {};
|
|
10816
10831
|
const store = {
|
|
10817
10832
|
get: key => sharedState[key],
|
|
10818
10833
|
set: (key, value) => {
|
|
@@ -10820,7 +10835,7 @@ var createKeyStore = (function () {
|
|
|
10820
10835
|
throw new Error("Invalid key: ".concat(JSON.stringify(key)));
|
|
10821
10836
|
}
|
|
10822
10837
|
sharedState[key] = value;
|
|
10823
|
-
applyMiddleware({
|
|
10838
|
+
subscribedListeners[key] = applyMiddleware({
|
|
10824
10839
|
type: 'SET',
|
|
10825
10840
|
value
|
|
10826
10841
|
});
|
|
@@ -10834,6 +10849,11 @@ var createKeyStore = (function () {
|
|
|
10834
10849
|
},
|
|
10835
10850
|
dispatch: forceNewState => {
|
|
10836
10851
|
hookListeners.forEach(listener => listener(forceNewState ? {} : sharedState));
|
|
10852
|
+
},
|
|
10853
|
+
destroy: () => {
|
|
10854
|
+
Object.keys(subscribedListeners).forEach(key => {
|
|
10855
|
+
subscribedListeners[key] && subscribedListeners[key]();
|
|
10856
|
+
});
|
|
10837
10857
|
}
|
|
10838
10858
|
};
|
|
10839
10859
|
const useKeyStore = () => {
|
|
@@ -10870,6 +10890,7 @@ function initializeStores$1(appId) {
|
|
|
10870
10890
|
modelChangedStore.dispatch(true); // Force new state to trigger hooks
|
|
10871
10891
|
};
|
|
10872
10892
|
const unsubscribe = () => {
|
|
10893
|
+
model.removeListener('closed', unsubscribe);
|
|
10873
10894
|
model.removeListener('changed', onChanged);
|
|
10874
10895
|
rpcResultStore.clear(model.id);
|
|
10875
10896
|
rpcRequestStore.clear(model.id);
|
|
@@ -10882,9 +10903,7 @@ function initializeStores$1(appId) {
|
|
|
10882
10903
|
case 'SET':
|
|
10883
10904
|
if (!initialized) {
|
|
10884
10905
|
model.on('changed', onChanged);
|
|
10885
|
-
model.once('closed',
|
|
10886
|
-
unsubscribe();
|
|
10887
|
-
});
|
|
10906
|
+
model.once('closed', unsubscribe);
|
|
10888
10907
|
}
|
|
10889
10908
|
break;
|
|
10890
10909
|
}
|
|
@@ -10901,8 +10920,12 @@ function initializeStores$1(appId) {
|
|
|
10901
10920
|
modelStore.clear(model.id);
|
|
10902
10921
|
};
|
|
10903
10922
|
};
|
|
10923
|
+
const destroy = () => {
|
|
10924
|
+
modelStore.destroy();
|
|
10925
|
+
};
|
|
10904
10926
|
return {
|
|
10905
10927
|
subscribe,
|
|
10928
|
+
destroy,
|
|
10906
10929
|
useModelStore,
|
|
10907
10930
|
modelStore,
|
|
10908
10931
|
useModelChangedStore,
|
|
@@ -10986,7 +11009,7 @@ function boot(_ref2) {
|
|
|
10986
11009
|
const appRef = React__default.createRef();
|
|
10987
11010
|
const element = document.createElement('div');
|
|
10988
11011
|
element.style.display = 'none';
|
|
10989
|
-
element.setAttribute('data-nebulajs-version', "5.
|
|
11012
|
+
element.setAttribute('data-nebulajs-version', "5.12.0");
|
|
10990
11013
|
element.setAttribute('data-app-id', app.id);
|
|
10991
11014
|
document.body.appendChild(element);
|
|
10992
11015
|
if (context) {
|
|
@@ -11003,6 +11026,7 @@ function boot(_ref2) {
|
|
|
11003
11026
|
selectionStore: selectionStore
|
|
11004
11027
|
}));
|
|
11005
11028
|
const cells = {};
|
|
11029
|
+
const cellsUnmount = {};
|
|
11006
11030
|
const components = [];
|
|
11007
11031
|
return [{
|
|
11008
11032
|
toggleFocusOfCells(cellIdToFocus) {
|
|
@@ -11011,11 +11035,14 @@ function boot(_ref2) {
|
|
|
11011
11035
|
});
|
|
11012
11036
|
},
|
|
11013
11037
|
cells,
|
|
11014
|
-
addCell(id, cell) {
|
|
11038
|
+
addCell(id, cell, unmount) {
|
|
11015
11039
|
cells[id] = cell;
|
|
11040
|
+
cellsUnmount[id] = unmount;
|
|
11016
11041
|
},
|
|
11017
11042
|
removeCell(id) {
|
|
11018
11043
|
delete cells[id];
|
|
11044
|
+
cellsUnmount[id]();
|
|
11045
|
+
delete cellsUnmount[id];
|
|
11019
11046
|
},
|
|
11020
11047
|
add(component) {
|
|
11021
11048
|
(async () => {
|
|
@@ -11049,6 +11076,12 @@ function boot(_ref2) {
|
|
|
11049
11076
|
}
|
|
11050
11077
|
appRef.current.setContext(ctx);
|
|
11051
11078
|
})();
|
|
11079
|
+
},
|
|
11080
|
+
destroy() {
|
|
11081
|
+
Object.keys(cellsUnmount).forEach(c => {
|
|
11082
|
+
cellsUnmount[c]();
|
|
11083
|
+
});
|
|
11084
|
+
modelStore.destroy();
|
|
11052
11085
|
}
|
|
11053
11086
|
}, modelStore, selectionStore, appRef, rendered];
|
|
11054
11087
|
}
|
|
@@ -12375,12 +12408,12 @@ const RowColRoot = styled('div', {
|
|
|
12375
12408
|
},
|
|
12376
12409
|
// The leaf node, containing the label text.
|
|
12377
12410
|
["& .".concat(rowColClasses.labelText)]: _objectSpread2(_objectSpread2({
|
|
12378
|
-
lineHeight: '
|
|
12411
|
+
lineHeight: '24px',
|
|
12379
12412
|
userSelect: 'none',
|
|
12380
12413
|
paddingRight: '1px'
|
|
12381
12414
|
}, ellipsis), contentFontStyles),
|
|
12382
12415
|
["& .".concat(rowColClasses.labelDense)]: {
|
|
12383
|
-
|
|
12416
|
+
lineHeight: 18
|
|
12384
12417
|
},
|
|
12385
12418
|
// Highlight is added to labelText spans, which are created as children to original labelText,
|
|
12386
12419
|
// when a search string is matched.
|
|
@@ -18225,10 +18258,9 @@ function resolveProperty(path, attribute, theme, objectType) {
|
|
|
18225
18258
|
return undefined;
|
|
18226
18259
|
}
|
|
18227
18260
|
|
|
18228
|
-
const supportNone = true;
|
|
18229
18261
|
function resolveColor(colorObj, path, attribute, theme, objectType) {
|
|
18230
18262
|
if (colorObj && theme) {
|
|
18231
|
-
return colorObj.color !== 'none' ? theme.getColorPickerColor(colorObj
|
|
18263
|
+
return colorObj.color !== 'none' ? theme.getColorPickerColor(colorObj) : undefined;
|
|
18232
18264
|
}
|
|
18233
18265
|
return resolveProperty(path, attribute, theme, objectType);
|
|
18234
18266
|
}
|
|
@@ -18351,7 +18383,8 @@ function resolveTextStyle(textComp, target, theme, objectType) {
|
|
|
18351
18383
|
return {
|
|
18352
18384
|
fontFamily: textProps.fontFamily || theme.getStyle("object.".concat(objectType), "title.".concat(target), 'fontFamily'),
|
|
18353
18385
|
fontSize: textProps.fontSize || theme.getStyle("object.".concat(objectType), "title.".concat(target), 'fontSize'),
|
|
18354
|
-
color: textProps.color && textProps.color.color !== 'none' ? theme.getColorPickerColor(textProps.color
|
|
18386
|
+
color: textProps.color && textProps.color.color !== 'none' ? theme.getColorPickerColor(textProps.color) : theme.getStyle("object.".concat(objectType), target, 'color'),
|
|
18387
|
+
backgroundColor: textProps.backgroundColor || theme.getStyle("object.".concat(objectType), "title.".concat(target), 'backgroundColor'),
|
|
18355
18388
|
fontWeight: fontStyle.includes('bold') ? 'bold' : 'normal',
|
|
18356
18389
|
fontStyle: fontStyle.includes('italic') ? 'italic' : 'normal',
|
|
18357
18390
|
textDecoration: fontStyle.includes('underline') ? 'underline' : 'initial'
|
|
@@ -18422,7 +18455,7 @@ function getBackgroundColor(_ref2) {
|
|
|
18422
18455
|
bgColor
|
|
18423
18456
|
}, themeApi, 'listBox');
|
|
18424
18457
|
} else {
|
|
18425
|
-
color = themeApi.getColorPickerColor(bgColor === null || bgColor === void 0 ? void 0 : bgColor.color
|
|
18458
|
+
color = themeApi.getColorPickerColor(bgColor === null || bgColor === void 0 ? void 0 : bgColor.color);
|
|
18426
18459
|
}
|
|
18427
18460
|
return color;
|
|
18428
18461
|
}
|
|
@@ -18447,7 +18480,7 @@ function getStyles(_ref3) {
|
|
|
18447
18480
|
} = _ref3;
|
|
18448
18481
|
const overrides = getOverridesAsObject(components);
|
|
18449
18482
|
const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
|
|
18450
|
-
const getColorPickerColor = c => (c === null || c === void 0 ? void 0 : c.index) > 0 || c !== null && c !== void 0 && c.color ? themeApi.getColorPickerColor(c
|
|
18483
|
+
const getColorPickerColor = c => (c === null || c === void 0 ? void 0 : c.index) > 0 || c !== null && c !== void 0 && c.color ? themeApi.getColorPickerColor(c) : undefined;
|
|
18451
18484
|
const selections = getSelectionColors({
|
|
18452
18485
|
getColorPickerColor,
|
|
18453
18486
|
theme,
|
|
@@ -23153,7 +23186,8 @@ const StyledGrid = styled(Grid)(_ref => {
|
|
|
23153
23186
|
return {
|
|
23154
23187
|
["& .".concat(classes.itemStyle)]: {
|
|
23155
23188
|
minWidth: 0,
|
|
23156
|
-
paddingTop: theme.spacing(1)
|
|
23189
|
+
paddingTop: theme.spacing(1),
|
|
23190
|
+
width: '100%'
|
|
23157
23191
|
}
|
|
23158
23192
|
};
|
|
23159
23193
|
});
|
|
@@ -23407,6 +23441,70 @@ class RenderError extends Error {
|
|
|
23407
23441
|
}
|
|
23408
23442
|
}
|
|
23409
23443
|
|
|
23444
|
+
const NP_PADDINH_IN_CARDS_WITHOUT_TITLE = ['action-button', 'sn-nav-menu'];
|
|
23445
|
+
const NO_PADDING_IN_CARDS = ['pivot-table', 'table', 'sn-table', 'sn-pivot-table', 'kpi', 'map', 'filterpane', 'sn-calendar', 'sn-filter-pane', 'sn-layout-container', 'sn-listbox', 'sn-shape', 'sn-tabbed-container'];
|
|
23446
|
+
const shouldUseCardPadding = _ref => {
|
|
23447
|
+
let {
|
|
23448
|
+
isCardTheme,
|
|
23449
|
+
layout,
|
|
23450
|
+
isError
|
|
23451
|
+
} = _ref;
|
|
23452
|
+
const visualization = layout === null || layout === void 0 ? void 0 : layout.visualization;
|
|
23453
|
+
if (!isCardTheme) {
|
|
23454
|
+
return false;
|
|
23455
|
+
}
|
|
23456
|
+
if (isError) {
|
|
23457
|
+
return true;
|
|
23458
|
+
}
|
|
23459
|
+
if (NO_PADDING_IN_CARDS.indexOf(visualization) !== -1) {
|
|
23460
|
+
return false;
|
|
23461
|
+
}
|
|
23462
|
+
const showTitle = layout === null || layout === void 0 ? void 0 : layout.showTitles;
|
|
23463
|
+
if (!showTitle && NP_PADDINH_IN_CARDS_WITHOUT_TITLE.indexOf(visualization) !== -1) {
|
|
23464
|
+
return false;
|
|
23465
|
+
}
|
|
23466
|
+
return true;
|
|
23467
|
+
};
|
|
23468
|
+
const getPadding = _ref2 => {
|
|
23469
|
+
let {
|
|
23470
|
+
layout,
|
|
23471
|
+
isError,
|
|
23472
|
+
senseTheme,
|
|
23473
|
+
titleStyles
|
|
23474
|
+
} = _ref2;
|
|
23475
|
+
const isCardTheme = senseTheme === null || senseTheme === void 0 ? void 0 : senseTheme.getStyle('', '', '_cards');
|
|
23476
|
+
const cardPadding = shouldUseCardPadding({
|
|
23477
|
+
isCardTheme,
|
|
23478
|
+
layout,
|
|
23479
|
+
isError
|
|
23480
|
+
});
|
|
23481
|
+
if (isCardTheme) {
|
|
23482
|
+
const showTitle = (layout === null || layout === void 0 ? void 0 : layout.showTitles) && !!(layout !== null && layout !== void 0 && layout.title);
|
|
23483
|
+
const showSubtitle = (layout === null || layout === void 0 ? void 0 : layout.showTitles) && !!(layout !== null && layout !== void 0 && layout.subtitle);
|
|
23484
|
+
const showFootnote = (layout === null || layout === void 0 ? void 0 : layout.showTitles) && !!(layout !== null && layout !== void 0 && layout.footnote);
|
|
23485
|
+
if (showTitle && cardPadding) {
|
|
23486
|
+
// eslint-disable-next-line no-param-reassign
|
|
23487
|
+
titleStyles.main.padding = '10px 10px 0';
|
|
23488
|
+
}
|
|
23489
|
+
if (showSubtitle && cardPadding) {
|
|
23490
|
+
// eslint-disable-next-line no-param-reassign
|
|
23491
|
+
titleStyles.subTitle.padding = showTitle ? '0 10px' : '10px 10px 0';
|
|
23492
|
+
}
|
|
23493
|
+
if (showFootnote) {
|
|
23494
|
+
// eslint-disable-next-line no-param-reassign
|
|
23495
|
+
titleStyles.footer.borderTop = '1px solid #d9d9d9';
|
|
23496
|
+
// eslint-disable-next-line no-param-reassign
|
|
23497
|
+
titleStyles.footer.padding = '6px 10px';
|
|
23498
|
+
}
|
|
23499
|
+
let bodyPadding;
|
|
23500
|
+
if (cardPadding) {
|
|
23501
|
+
bodyPadding = "".concat(showTitle || showSubtitle ? '0' : '10px', " 10px ").concat(showFootnote ? '0' : '5px');
|
|
23502
|
+
}
|
|
23503
|
+
return bodyPadding;
|
|
23504
|
+
}
|
|
23505
|
+
return undefined;
|
|
23506
|
+
};
|
|
23507
|
+
|
|
23410
23508
|
/**
|
|
23411
23509
|
* @interface
|
|
23412
23510
|
* @extends HTMLElement
|
|
@@ -23415,6 +23513,15 @@ const CellElement = {
|
|
|
23415
23513
|
/** @type {'njs-cell'} */
|
|
23416
23514
|
className: 'njs-cell'
|
|
23417
23515
|
};
|
|
23516
|
+
|
|
23517
|
+
/**
|
|
23518
|
+
* @interface
|
|
23519
|
+
* @extends HTMLElement
|
|
23520
|
+
*/
|
|
23521
|
+
const CellBody = {
|
|
23522
|
+
/** @type {'njs-cell-body'} */
|
|
23523
|
+
className: 'njs-cell-body'
|
|
23524
|
+
};
|
|
23418
23525
|
const initialState = err => ({
|
|
23419
23526
|
loading: false,
|
|
23420
23527
|
loaded: false,
|
|
@@ -23696,6 +23803,7 @@ const loadType = async _ref5 => {
|
|
|
23696
23803
|
}
|
|
23697
23804
|
};
|
|
23698
23805
|
const Cell = forwardRef((_ref6, ref) => {
|
|
23806
|
+
var _halo$public$galaxy;
|
|
23699
23807
|
let {
|
|
23700
23808
|
halo,
|
|
23701
23809
|
model: inputModel,
|
|
@@ -23945,6 +24053,25 @@ const Cell = forwardRef((_ref6, ref) => {
|
|
|
23945
24053
|
appLayout: appLayout
|
|
23946
24054
|
});
|
|
23947
24055
|
}
|
|
24056
|
+
const flags = (_halo$public$galaxy = halo.public.galaxy) === null || _halo$public$galaxy === void 0 ? void 0 : _halo$public$galaxy.flags;
|
|
24057
|
+
let useOldCellPadding;
|
|
24058
|
+
let bodyPadding;
|
|
24059
|
+
if (disableCellPadding) {
|
|
24060
|
+
useOldCellPadding = false;
|
|
24061
|
+
bodyPadding = undefined;
|
|
24062
|
+
} else if (!(flags !== null && flags !== void 0 && flags.isEnabled('VNA-13_CELLPADDING_FROM_THEME'))) {
|
|
24063
|
+
useOldCellPadding = true;
|
|
24064
|
+
bodyPadding = undefined;
|
|
24065
|
+
} else {
|
|
24066
|
+
const senseTheme = halo.public.theme;
|
|
24067
|
+
useOldCellPadding = false;
|
|
24068
|
+
bodyPadding = getPadding({
|
|
24069
|
+
layout,
|
|
24070
|
+
isError: state.error,
|
|
24071
|
+
senseTheme,
|
|
24072
|
+
titleStyles
|
|
24073
|
+
});
|
|
24074
|
+
}
|
|
23948
24075
|
return /*#__PURE__*/React__default.createElement(Paper, {
|
|
23949
24076
|
style: {
|
|
23950
24077
|
position: 'relative',
|
|
@@ -23976,7 +24103,7 @@ const Cell = forwardRef((_ref6, ref) => {
|
|
|
23976
24103
|
position: 'relative',
|
|
23977
24104
|
width: '100%',
|
|
23978
24105
|
height: '100%'
|
|
23979
|
-
},
|
|
24106
|
+
}, useOldCellPadding ? {
|
|
23980
24107
|
padding: theme.spacing(1)
|
|
23981
24108
|
} : {}), state.longRunningQuery ? {
|
|
23982
24109
|
opacity: '0.3'
|
|
@@ -23993,9 +24120,12 @@ const Cell = forwardRef((_ref6, ref) => {
|
|
|
23993
24120
|
onKeyDown: keyboardNavigation ? handleKeyDown : null,
|
|
23994
24121
|
item: true,
|
|
23995
24122
|
xs: true,
|
|
23996
|
-
|
|
24123
|
+
className: CellBody.className,
|
|
24124
|
+
style: _objectSpread2({
|
|
23997
24125
|
height: '100%'
|
|
23998
|
-
},
|
|
24126
|
+
}, bodyPadding ? {
|
|
24127
|
+
padding: bodyPadding
|
|
24128
|
+
} : {}),
|
|
23999
24129
|
ref: contentRef
|
|
24000
24130
|
}, Content), cellNode && layout && state.sn && /*#__PURE__*/React__default.createElement(Footer, {
|
|
24001
24131
|
layout: layout,
|
|
@@ -24045,7 +24175,7 @@ function glue$1(_ref) {
|
|
|
24045
24175
|
model.on('closed', unmount);
|
|
24046
24176
|
root.add(portal);
|
|
24047
24177
|
// Cannot use model.id as it is not unique in a given mashup
|
|
24048
|
-
root.addCell(currentId, cellRef);
|
|
24178
|
+
root.addCell(currentId, cellRef, unmount);
|
|
24049
24179
|
return [unmount, cellRef];
|
|
24050
24180
|
}
|
|
24051
24181
|
|
|
@@ -26228,9 +26358,20 @@ const noop = () => {};
|
|
|
26228
26358
|
* @returns {ExportFormat}
|
|
26229
26359
|
*/
|
|
26230
26360
|
|
|
26361
|
+
/**
|
|
26362
|
+
* @callback onPropertyChange
|
|
26363
|
+
* @param {qix.GenericObjectProperties} properties
|
|
26364
|
+
*/
|
|
26365
|
+
|
|
26366
|
+
/**
|
|
26367
|
+
* @interface QAEProperties
|
|
26368
|
+
* @property {qix.GenericObjectProperties=} initial
|
|
26369
|
+
* @property {onPropertyChange=} onChange
|
|
26370
|
+
*/
|
|
26371
|
+
|
|
26231
26372
|
/**
|
|
26232
26373
|
* @interface QAEDefinition
|
|
26233
|
-
* @property {qix.GenericObjectProperties=} properties
|
|
26374
|
+
* @property {(QAEProperties|qix.GenericObjectProperties)=} properties
|
|
26234
26375
|
* @property {object=} data
|
|
26235
26376
|
* @property {DataTarget[]} data.targets
|
|
26236
26377
|
* @property {importProperties=} importProperties
|
|
@@ -27041,21 +27182,28 @@ const SheetElement = {
|
|
|
27041
27182
|
/** @type {'njs-sheet'} */
|
|
27042
27183
|
className: 'njs-sheet'
|
|
27043
27184
|
};
|
|
27044
|
-
function getCellRenderer(cell, halo, initialSnOptions, initialSnPlugins, initialError, onMount, navigation) {
|
|
27185
|
+
function getCellRenderer(cell, halo, initialSnOptions, initialSnPlugins, initialError, onMount, navigation, onError) {
|
|
27186
|
+
var _halo$public$galaxy;
|
|
27045
27187
|
const {
|
|
27046
27188
|
x,
|
|
27047
27189
|
y,
|
|
27048
27190
|
width,
|
|
27049
27191
|
height
|
|
27050
27192
|
} = cell.bounds;
|
|
27193
|
+
const style = {
|
|
27194
|
+
left: "".concat(x, "%"),
|
|
27195
|
+
top: "".concat(y, "%"),
|
|
27196
|
+
width: "".concat(width, "%"),
|
|
27197
|
+
height: "".concat(height, "%"),
|
|
27198
|
+
position: 'absolute'
|
|
27199
|
+
};
|
|
27200
|
+
const flags = (_halo$public$galaxy = halo.public.galaxy) === null || _halo$public$galaxy === void 0 ? void 0 : _halo$public$galaxy.flags;
|
|
27201
|
+
if (flags !== null && flags !== void 0 && flags.isEnabled('VNA-13_CELLPADDING_FROM_THEME')) {
|
|
27202
|
+
style.boxSizing = 'border-box';
|
|
27203
|
+
style.padding = '4px';
|
|
27204
|
+
}
|
|
27051
27205
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
27052
|
-
style:
|
|
27053
|
-
left: "".concat(x, "%"),
|
|
27054
|
-
top: "".concat(y, "%"),
|
|
27055
|
-
width: "".concat(width, "%"),
|
|
27056
|
-
height: "".concat(height, "%"),
|
|
27057
|
-
position: 'absolute'
|
|
27058
|
-
},
|
|
27206
|
+
style: style,
|
|
27059
27207
|
key: cell.model.id
|
|
27060
27208
|
}, /*#__PURE__*/React__default.createElement(Cell, {
|
|
27061
27209
|
ref: cell.cellRef,
|
|
@@ -27066,7 +27214,8 @@ function getCellRenderer(cell, halo, initialSnOptions, initialSnPlugins, initial
|
|
|
27066
27214
|
initialSnPlugins: initialSnPlugins,
|
|
27067
27215
|
initialError: initialError,
|
|
27068
27216
|
onMount: onMount,
|
|
27069
|
-
navigation: navigation
|
|
27217
|
+
navigation: navigation,
|
|
27218
|
+
onError: onError
|
|
27070
27219
|
}));
|
|
27071
27220
|
}
|
|
27072
27221
|
function getBounds(pos, columns, rows) {
|
|
@@ -27090,7 +27239,8 @@ const Sheet = forwardRef((_ref, ref) => {
|
|
|
27090
27239
|
initialError,
|
|
27091
27240
|
onMount,
|
|
27092
27241
|
unmount,
|
|
27093
|
-
navigation
|
|
27242
|
+
navigation,
|
|
27243
|
+
onError
|
|
27094
27244
|
} = _ref;
|
|
27095
27245
|
const {
|
|
27096
27246
|
root
|
|
@@ -27105,6 +27255,11 @@ const Sheet = forwardRef((_ref, ref) => {
|
|
|
27105
27255
|
const [bgColor, setBgColor] = useState$1(undefined);
|
|
27106
27256
|
const [bgImage, setBgImage] = useState$1(undefined);
|
|
27107
27257
|
const [deepHash, setDeepHash] = useState$1('');
|
|
27258
|
+
const renderState = useRef$1({
|
|
27259
|
+
cellCount: 0,
|
|
27260
|
+
cellsRendered: 0,
|
|
27261
|
+
initialRender: false
|
|
27262
|
+
});
|
|
27108
27263
|
navigation === null || navigation === void 0 || (_navigation$setCurren = navigation.setCurrentSheetId) === null || _navigation$setCurren === void 0 || _navigation$setCurren.call(navigation, model.id);
|
|
27109
27264
|
/// For each object
|
|
27110
27265
|
useEffect$1(() => {
|
|
@@ -27125,6 +27280,15 @@ const Sheet = forwardRef((_ref, ref) => {
|
|
|
27125
27280
|
root.removeCell(c.currentId);
|
|
27126
27281
|
});
|
|
27127
27282
|
const lCells = layout.cells;
|
|
27283
|
+
renderState.cellCount = lCells.length;
|
|
27284
|
+
renderState.cellsRendered = 0;
|
|
27285
|
+
const renderCallback = () => {
|
|
27286
|
+
renderState.cellsRendered++;
|
|
27287
|
+
if (renderState.cellsRendered === renderState.cellCount && !renderState.initialRender) {
|
|
27288
|
+
renderState.initialRender = true;
|
|
27289
|
+
initialSnOptions.onInitialRender();
|
|
27290
|
+
}
|
|
27291
|
+
};
|
|
27128
27292
|
const {
|
|
27129
27293
|
columns,
|
|
27130
27294
|
rows
|
|
@@ -27152,7 +27316,10 @@ const Sheet = forwardRef((_ref, ref) => {
|
|
|
27152
27316
|
cellRef: React__default.createRef(),
|
|
27153
27317
|
currentId: uid(),
|
|
27154
27318
|
mounted,
|
|
27155
|
-
mountedPromise
|
|
27319
|
+
mountedPromise,
|
|
27320
|
+
options: _objectSpread2(_objectSpread2({}, initialSnOptions), {
|
|
27321
|
+
onInitialRender: renderCallback
|
|
27322
|
+
})
|
|
27156
27323
|
};
|
|
27157
27324
|
}));
|
|
27158
27325
|
cs.forEach(c => root.addCell(c.currentId, c.cellRef));
|
|
@@ -27169,7 +27336,7 @@ const Sheet = forwardRef((_ref, ref) => {
|
|
|
27169
27336
|
model.on('closed', onModelClose);
|
|
27170
27337
|
return () => model.removeListener('closed', onModelClose);
|
|
27171
27338
|
}, [model]);
|
|
27172
|
-
const cellRenderers = useMemo$1(() => cells ? cells.map(c => getCellRenderer(c, halo,
|
|
27339
|
+
const cellRenderers = useMemo$1(() => cells ? cells.map(c => getCellRenderer(c, halo, c.options, initialSnPlugins, initialError, c.mounted, navigation, onError)) : [], [cells]);
|
|
27173
27340
|
useEffect$1(() => {
|
|
27174
27341
|
const bgComp = layout !== null && layout !== void 0 && layout.components ? layout.components.find(comp => comp.key === 'general') : null;
|
|
27175
27342
|
setBgColor(resolveBgColor(bgComp, halo.public.theme));
|
|
@@ -27219,7 +27386,8 @@ function glue(_ref) {
|
|
|
27219
27386
|
initialSnPlugins,
|
|
27220
27387
|
onMount,
|
|
27221
27388
|
initialError,
|
|
27222
|
-
navigation
|
|
27389
|
+
navigation,
|
|
27390
|
+
onError
|
|
27223
27391
|
} = _ref;
|
|
27224
27392
|
const {
|
|
27225
27393
|
root
|
|
@@ -27238,7 +27406,8 @@ function glue(_ref) {
|
|
|
27238
27406
|
initialError: initialError,
|
|
27239
27407
|
onMount: onMount,
|
|
27240
27408
|
unmount: unmount,
|
|
27241
|
-
navigation: navigation
|
|
27409
|
+
navigation: navigation,
|
|
27410
|
+
onError: onError
|
|
27242
27411
|
}), element, model.id);
|
|
27243
27412
|
navigation.setSheetRef(sheetRef);
|
|
27244
27413
|
root.add(portal);
|
|
@@ -27252,26 +27421,42 @@ function sheet() {
|
|
|
27252
27421
|
halo,
|
|
27253
27422
|
navigation,
|
|
27254
27423
|
initialError,
|
|
27255
|
-
onDestroy = async () => {}
|
|
27424
|
+
onDestroy = async () => {},
|
|
27425
|
+
onRender = () => {},
|
|
27426
|
+
onError = () => {}
|
|
27256
27427
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
27257
27428
|
let unmountSheet = noopi;
|
|
27258
27429
|
let sheetRef = null;
|
|
27259
27430
|
let mountedReference = null;
|
|
27260
27431
|
let onMount = null;
|
|
27432
|
+
let onRenderResolve = null;
|
|
27261
27433
|
const mounted = new Promise(resolve => {
|
|
27262
27434
|
onMount = resolve;
|
|
27263
27435
|
});
|
|
27436
|
+
const rendered = new Promise(resolve => {
|
|
27437
|
+
onRenderResolve = resolve;
|
|
27438
|
+
});
|
|
27439
|
+
const createOnInitialRender = override => () => {
|
|
27440
|
+
override === null || override === void 0 || override(); // from options.onInitialRender
|
|
27441
|
+
onRenderResolve(); // internal promise in viz to wait for render
|
|
27442
|
+
onRender(); // from RenderConfig
|
|
27443
|
+
};
|
|
27264
27444
|
let initialSnOptions = {};
|
|
27265
27445
|
let initialSnPlugins = [];
|
|
27266
27446
|
const setSnOptions = async opts => {
|
|
27447
|
+
const override = opts.onInitialRender;
|
|
27267
27448
|
if (mountedReference) {
|
|
27268
27449
|
(async () => {
|
|
27269
27450
|
await mounted;
|
|
27270
|
-
sheetRef.current.setSnOptions(_objectSpread2(_objectSpread2({}, initialSnOptions), opts)
|
|
27451
|
+
sheetRef.current.setSnOptions(_objectSpread2(_objectSpread2(_objectSpread2({}, initialSnOptions), opts), {
|
|
27452
|
+
onInitialRender: createOnInitialRender(override)
|
|
27453
|
+
}));
|
|
27271
27454
|
})();
|
|
27272
27455
|
} else {
|
|
27273
27456
|
// Handle setting options before mount
|
|
27274
|
-
initialSnOptions = _objectSpread2(_objectSpread2({}, initialSnOptions), opts)
|
|
27457
|
+
initialSnOptions = _objectSpread2(_objectSpread2(_objectSpread2({}, initialSnOptions), opts), {
|
|
27458
|
+
onInitialRender: createOnInitialRender(override)
|
|
27459
|
+
});
|
|
27275
27460
|
}
|
|
27276
27461
|
};
|
|
27277
27462
|
const setSnPlugins = async plugins => {
|
|
@@ -27318,6 +27503,15 @@ function sheet() {
|
|
|
27318
27503
|
* @type {Navigation}
|
|
27319
27504
|
*/
|
|
27320
27505
|
navigation,
|
|
27506
|
+
/**
|
|
27507
|
+
* Gets the specific api that a Viz exposes.
|
|
27508
|
+
* @private currently empty and private
|
|
27509
|
+
* @returns {Promise<object>} object that contains the internal Viz api.
|
|
27510
|
+
*/
|
|
27511
|
+
async getImperativeHandle() {
|
|
27512
|
+
await rendered;
|
|
27513
|
+
return sheetRef.current.getImperativeHandle();
|
|
27514
|
+
},
|
|
27321
27515
|
/**
|
|
27322
27516
|
* Destroys the sheet and removes it from the the DOM.
|
|
27323
27517
|
* @example
|
|
@@ -27350,7 +27544,8 @@ function sheet() {
|
|
|
27350
27544
|
initialSnPlugins,
|
|
27351
27545
|
initialError,
|
|
27352
27546
|
onMount,
|
|
27353
|
-
navigation
|
|
27547
|
+
navigation,
|
|
27548
|
+
onError
|
|
27354
27549
|
});
|
|
27355
27550
|
return mounted;
|
|
27356
27551
|
},
|
|
@@ -27385,12 +27580,18 @@ function sheet() {
|
|
|
27385
27580
|
/* eslint no-underscore-dangle:0 */
|
|
27386
27581
|
async function initSheet(model, optional, halo, navigation, initialError) {
|
|
27387
27582
|
let onDestroy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : async () => {};
|
|
27583
|
+
const {
|
|
27584
|
+
onRender,
|
|
27585
|
+
onError
|
|
27586
|
+
} = optional;
|
|
27388
27587
|
const api = sheet({
|
|
27389
27588
|
model,
|
|
27390
27589
|
halo,
|
|
27391
27590
|
navigation,
|
|
27392
27591
|
initialError,
|
|
27393
|
-
onDestroy
|
|
27592
|
+
onDestroy,
|
|
27593
|
+
onRender,
|
|
27594
|
+
onError
|
|
27394
27595
|
});
|
|
27395
27596
|
if (optional.options) {
|
|
27396
27597
|
api.__DO_NOT_USE__.options(optional.options);
|
|
@@ -27533,7 +27734,9 @@ async function getObject(_ref, halo, store) {
|
|
|
27533
27734
|
return initSheet(model, {
|
|
27534
27735
|
options,
|
|
27535
27736
|
plugins,
|
|
27536
|
-
element
|
|
27737
|
+
element,
|
|
27738
|
+
onRender,
|
|
27739
|
+
onError
|
|
27537
27740
|
}, halo, navigation);
|
|
27538
27741
|
}
|
|
27539
27742
|
return init(model, {
|
|
@@ -29414,6 +29617,10 @@ function nuked() {
|
|
|
29414
29617
|
}
|
|
29415
29618
|
return createSessionObject(cfg, halo, modelStore);
|
|
29416
29619
|
},
|
|
29620
|
+
// TODO - document
|
|
29621
|
+
destroy: async () => {
|
|
29622
|
+
root.destroy();
|
|
29623
|
+
},
|
|
29417
29624
|
/**
|
|
29418
29625
|
* Creates a visualization model
|
|
29419
29626
|
* @param {CreateConfig} cfg The create configuration.
|