@nebula.js/stardust 4.8.0 → 4.9.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 +157 -55
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +3 -3
- package/core/esm/index.js.map +1 -1
- package/dist/stardust.dev.js +157 -55
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +3 -3
- package/dist/stardust.js.map +1 -1
- package/package.json +9 -9
- package/types/index.d.ts +21 -10
package/core/esm/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v4.
|
|
2
|
+
* @nebula.js/stardust v4.9.0
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -708,26 +708,26 @@ var runtime = {exports: {}};
|
|
|
708
708
|
}
|
|
709
709
|
})(runtime);
|
|
710
710
|
|
|
711
|
-
function ownKeys(
|
|
712
|
-
var
|
|
711
|
+
function ownKeys(e, r) {
|
|
712
|
+
var t = Object.keys(e);
|
|
713
713
|
if (Object.getOwnPropertySymbols) {
|
|
714
|
-
var
|
|
715
|
-
|
|
716
|
-
return Object.getOwnPropertyDescriptor(
|
|
717
|
-
})),
|
|
718
|
-
}
|
|
719
|
-
return
|
|
720
|
-
}
|
|
721
|
-
function _objectSpread2(
|
|
722
|
-
for (var
|
|
723
|
-
var
|
|
724
|
-
|
|
725
|
-
_defineProperty(
|
|
726
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
727
|
-
Object.defineProperty(
|
|
714
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
715
|
+
r && (o = o.filter(function (r) {
|
|
716
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
717
|
+
})), t.push.apply(t, o);
|
|
718
|
+
}
|
|
719
|
+
return t;
|
|
720
|
+
}
|
|
721
|
+
function _objectSpread2(e) {
|
|
722
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
723
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
724
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
725
|
+
_defineProperty(e, r, t[r]);
|
|
726
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
727
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
728
728
|
});
|
|
729
729
|
}
|
|
730
|
-
return
|
|
730
|
+
return e;
|
|
731
731
|
}
|
|
732
732
|
function _defineProperty(obj, key, value) {
|
|
733
733
|
key = _toPropertyKey(key);
|
|
@@ -8551,7 +8551,7 @@ function create$3(definition) {
|
|
|
8551
8551
|
return cache[key];
|
|
8552
8552
|
}
|
|
8553
8553
|
|
|
8554
|
-
const NEBULA_VERSION_HASH = "
|
|
8554
|
+
const NEBULA_VERSION_HASH = "8934" ;
|
|
8555
8555
|
ClassNameGenerator$1.configure(componentName => {
|
|
8556
8556
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
8557
8557
|
});
|
|
@@ -8812,7 +8812,7 @@ function boot(_ref2) {
|
|
|
8812
8812
|
const appRef = React__default.createRef();
|
|
8813
8813
|
const element = document.createElement('div');
|
|
8814
8814
|
element.style.display = 'none';
|
|
8815
|
-
element.setAttribute('data-nebulajs-version', "4.
|
|
8815
|
+
element.setAttribute('data-nebulajs-version', "4.9.0" );
|
|
8816
8816
|
element.setAttribute('data-app-id', app.id);
|
|
8817
8817
|
document.body.appendChild(element);
|
|
8818
8818
|
if (context) {
|
|
@@ -10015,6 +10015,7 @@ const barWithCheckboxLeftPadPx = 29;
|
|
|
10015
10015
|
const GRID_ROW_HEIGHT = 32;
|
|
10016
10016
|
const LIST_ROW_HEIGHT = 29;
|
|
10017
10017
|
const DENSE_ROW_HEIGHT = 20; // same for both list and grid in dense mode
|
|
10018
|
+
const GRID_ITEM_PADDING = 4;
|
|
10018
10019
|
|
|
10019
10020
|
const joinClassNames = namesArray => namesArray.filter(c => !!c).join(' ').trim();
|
|
10020
10021
|
const getBarWidth = _ref => {
|
|
@@ -10689,7 +10690,8 @@ function getGridItemSizes(_ref) {
|
|
|
10689
10690
|
let {
|
|
10690
10691
|
dataLayout,
|
|
10691
10692
|
layoutOrder,
|
|
10692
|
-
itemPadding
|
|
10693
|
+
itemPadding,
|
|
10694
|
+
fillHeight
|
|
10693
10695
|
} = _ref;
|
|
10694
10696
|
// Simulate margin/padding by making the item smaller than its container.
|
|
10695
10697
|
if (dataLayout === 'singleColumn') {
|
|
@@ -10701,14 +10703,14 @@ function getGridItemSizes(_ref) {
|
|
|
10701
10703
|
switch (layoutOrder) {
|
|
10702
10704
|
case 'row':
|
|
10703
10705
|
return {
|
|
10704
|
-
height: "calc(100% - ".concat(itemPadding, "px)"),
|
|
10706
|
+
height: fillHeight ? '100%' : "calc(100% - ".concat(itemPadding, "px)"),
|
|
10705
10707
|
width: "calc(100% - ".concat(2 * itemPadding, "px)"),
|
|
10706
10708
|
position: 'absolute',
|
|
10707
10709
|
left: 4
|
|
10708
10710
|
};
|
|
10709
10711
|
case 'column':
|
|
10710
10712
|
return {
|
|
10711
|
-
height: "calc(100% - ".concat(itemPadding, "px)"),
|
|
10713
|
+
height: fillHeight ? '100%' : "calc(100% - ".concat(itemPadding, "px)"),
|
|
10712
10714
|
width: "calc(100% - ".concat(2 * itemPadding, "px)"),
|
|
10713
10715
|
position: 'absolute',
|
|
10714
10716
|
left: 4
|
|
@@ -10719,21 +10721,23 @@ function getGridItemSizes(_ref) {
|
|
|
10719
10721
|
}
|
|
10720
10722
|
|
|
10721
10723
|
const ItemGrid = styled$1(Grid, {
|
|
10722
|
-
shouldForwardProp: prop => !['dataLayout', 'layoutOrder', 'itemPadding', 'cellPaddingRight', 'direction'].includes(prop)
|
|
10724
|
+
shouldForwardProp: prop => !['dataLayout', 'layoutOrder', 'itemPadding', 'cellPaddingRight', 'direction', 'fillHeight'].includes(prop)
|
|
10723
10725
|
})(_ref => {
|
|
10724
10726
|
let {
|
|
10725
10727
|
dataLayout,
|
|
10726
10728
|
layoutOrder,
|
|
10727
10729
|
itemPadding,
|
|
10728
10730
|
cellPaddingRight,
|
|
10729
|
-
direction
|
|
10731
|
+
direction,
|
|
10732
|
+
fillHeight
|
|
10730
10733
|
} = _ref;
|
|
10731
10734
|
const att = "padding".concat(direction === 'rtl' ? 'Left' : 'Right');
|
|
10732
10735
|
return {
|
|
10733
10736
|
["&.".concat(rowColClasses.fieldRoot)]: _objectSpread2(_objectSpread2({}, getGridItemSizes({
|
|
10734
10737
|
dataLayout,
|
|
10735
10738
|
layoutOrder,
|
|
10736
|
-
itemPadding
|
|
10739
|
+
itemPadding,
|
|
10740
|
+
fillHeight
|
|
10737
10741
|
})), {}, {
|
|
10738
10742
|
[att]: cellPaddingRight ? '8px' : undefined
|
|
10739
10743
|
})
|
|
@@ -11174,7 +11178,8 @@ function RowColumn(_ref) {
|
|
|
11174
11178
|
showSearch,
|
|
11175
11179
|
isModal,
|
|
11176
11180
|
contentFontStyle,
|
|
11177
|
-
styles
|
|
11181
|
+
styles,
|
|
11182
|
+
fillHeight
|
|
11178
11183
|
} = data;
|
|
11179
11184
|
const {
|
|
11180
11185
|
dense = false,
|
|
@@ -11202,6 +11207,7 @@ function RowColumn(_ref) {
|
|
|
11202
11207
|
}
|
|
11203
11208
|
const padding = 0;
|
|
11204
11209
|
styleOverrides = _objectSpread2(_objectSpread2({}, style), {}, {
|
|
11210
|
+
height: fillHeight ? '100%' : style.height,
|
|
11205
11211
|
left: padding + (columnIndex === 0 ? style.left : Number(style.left) + columnIndex * padding),
|
|
11206
11212
|
// right: columnIndex === columnCount ? style.right : Number(style.right) + columnIndex * padding,
|
|
11207
11213
|
top: rowIndex === 0 ? style.top : Number(style.top) + rowIndex * padding
|
|
@@ -11338,7 +11344,8 @@ function RowColumn(_ref) {
|
|
|
11338
11344
|
onContextMenu: preventContextMenu,
|
|
11339
11345
|
tabIndex: isFirstElement && keyboard.innerTabStops ? 0 : -1,
|
|
11340
11346
|
"data-n": cell === null || cell === void 0 ? void 0 : cell.qElemNumber,
|
|
11341
|
-
direction: direction
|
|
11347
|
+
direction: direction,
|
|
11348
|
+
fillHeight: fillHeight
|
|
11342
11349
|
}, (cell === null || cell === void 0 ? void 0 : cell.qFrequency) && /*#__PURE__*/React__default.createElement(Histogram, {
|
|
11343
11350
|
qFrequency: cell === null || cell === void 0 ? void 0 : cell.qFrequency,
|
|
11344
11351
|
histogram: histogram,
|
|
@@ -12236,7 +12243,7 @@ function createListComponent(_ref) {
|
|
|
12236
12243
|
scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
|
|
12237
12244
|
return {
|
|
12238
12245
|
isScrolling: true,
|
|
12239
|
-
scrollDirection: prevState.scrollOffset <
|
|
12246
|
+
scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',
|
|
12240
12247
|
scrollOffset: scrollOffset,
|
|
12241
12248
|
scrollUpdateWasRequested: false
|
|
12242
12249
|
};
|
|
@@ -12978,6 +12985,7 @@ function getListBoxComponents(_ref) {
|
|
|
12978
12985
|
className: classes$9.styledScrollbars
|
|
12979
12986
|
};
|
|
12980
12987
|
const isLocked = layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo.qLocked;
|
|
12988
|
+
const fillHeight = listHeight <= itemHeight;
|
|
12981
12989
|
|
|
12982
12990
|
// Item data common for List and Grid.
|
|
12983
12991
|
const commonItemData = _objectSpread2(_objectSpread2({
|
|
@@ -13011,7 +13019,8 @@ function getListBoxComponents(_ref) {
|
|
|
13011
13019
|
translator,
|
|
13012
13020
|
showSearch,
|
|
13013
13021
|
isModal,
|
|
13014
|
-
styles
|
|
13022
|
+
styles,
|
|
13023
|
+
fillHeight
|
|
13015
13024
|
});
|
|
13016
13025
|
const List = _ref2 => {
|
|
13017
13026
|
let {
|
|
@@ -13208,6 +13217,21 @@ function getMeasureText(layoutOrNumber) {
|
|
|
13208
13217
|
return measureString;
|
|
13209
13218
|
}
|
|
13210
13219
|
|
|
13220
|
+
function getItemHeight(_ref) {
|
|
13221
|
+
let {
|
|
13222
|
+
isGridMode,
|
|
13223
|
+
dense
|
|
13224
|
+
} = _ref;
|
|
13225
|
+
const normalItemHeight = isGridMode ? GRID_ROW_HEIGHT : LIST_ROW_HEIGHT;
|
|
13226
|
+
let itemHeight = dense ? DENSE_ROW_HEIGHT : normalItemHeight;
|
|
13227
|
+
if (isGridMode) {
|
|
13228
|
+
// Emulate a margin between items using padding, since the list library
|
|
13229
|
+
// needs an explicit row height and cannot handle margins.
|
|
13230
|
+
itemHeight += GRID_ITEM_PADDING;
|
|
13231
|
+
}
|
|
13232
|
+
return itemHeight;
|
|
13233
|
+
}
|
|
13234
|
+
|
|
13211
13235
|
function useListSizes(_ref) {
|
|
13212
13236
|
let {
|
|
13213
13237
|
layout,
|
|
@@ -13263,14 +13287,10 @@ function useListSizes(_ref) {
|
|
|
13263
13287
|
let columnWidth;
|
|
13264
13288
|
let rowCount;
|
|
13265
13289
|
const isGridMode = dataLayout === 'grid';
|
|
13266
|
-
const
|
|
13267
|
-
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
// Emulate a margin between items using padding, since the list library
|
|
13271
|
-
// needs an explicit row height and cannot handle margins.
|
|
13272
|
-
itemHeight += itemPadding;
|
|
13273
|
-
}
|
|
13290
|
+
const itemHeight = getItemHeight({
|
|
13291
|
+
isGridMode,
|
|
13292
|
+
dense
|
|
13293
|
+
});
|
|
13274
13294
|
const listHeight = height !== null && height !== void 0 ? height : 8 * itemHeight;
|
|
13275
13295
|
if (layoutOrder) {
|
|
13276
13296
|
// Modify container width to achieve the exact design with 8px margins on each side (left and right).
|
|
@@ -13279,7 +13299,7 @@ function useListSizes(_ref) {
|
|
|
13279
13299
|
overflowStyling = {
|
|
13280
13300
|
overflowX: 'hidden'
|
|
13281
13301
|
};
|
|
13282
|
-
containerWidth +=
|
|
13302
|
+
containerWidth += GRID_ITEM_PADDING * 2;
|
|
13283
13303
|
({
|
|
13284
13304
|
rowCount,
|
|
13285
13305
|
columnWidth,
|
|
@@ -13334,7 +13354,7 @@ function useListSizes(_ref) {
|
|
|
13334
13354
|
row: maxRowCount,
|
|
13335
13355
|
column: maxColumnCount
|
|
13336
13356
|
},
|
|
13337
|
-
itemPadding,
|
|
13357
|
+
itemPadding: GRID_ITEM_PADDING,
|
|
13338
13358
|
textWidth,
|
|
13339
13359
|
freqMinWidth,
|
|
13340
13360
|
freqMaxWidth
|
|
@@ -19153,6 +19173,33 @@ function isDirectQueryEnabled(_ref) {
|
|
|
19153
19173
|
return isDQ;
|
|
19154
19174
|
}
|
|
19155
19175
|
|
|
19176
|
+
function getContainerPadding(_ref) {
|
|
19177
|
+
let {
|
|
19178
|
+
isGridMode,
|
|
19179
|
+
dense,
|
|
19180
|
+
height,
|
|
19181
|
+
layoutOrder
|
|
19182
|
+
} = _ref;
|
|
19183
|
+
let containerPadding;
|
|
19184
|
+
if (isGridMode) {
|
|
19185
|
+
const itemHeight = getItemHeight({
|
|
19186
|
+
isGridMode,
|
|
19187
|
+
dense
|
|
19188
|
+
});
|
|
19189
|
+
let paddingY;
|
|
19190
|
+
if (itemHeight > height) {
|
|
19191
|
+
paddingY = '0px';
|
|
19192
|
+
} else {
|
|
19193
|
+
paddingY = '2px';
|
|
19194
|
+
}
|
|
19195
|
+
containerPadding = layoutOrder === 'row' ? "".concat(paddingY, " 4px") : "".concat(paddingY, " 6px ").concat(paddingY, " 4px");
|
|
19196
|
+
} else {
|
|
19197
|
+
containerPadding = undefined; // to prevent overriding any default padding
|
|
19198
|
+
}
|
|
19199
|
+
|
|
19200
|
+
return containerPadding;
|
|
19201
|
+
}
|
|
19202
|
+
|
|
19156
19203
|
const PREFIX$4 = 'ListBoxInline';
|
|
19157
19204
|
const classes$4 = {
|
|
19158
19205
|
listBoxHeader: "".concat(PREFIX$4, "-listBoxHeader"),
|
|
@@ -19231,7 +19278,7 @@ const isModal = _ref4 => {
|
|
|
19231
19278
|
return (_app$isInModalSelecti = (_app$isInModalSelecti2 = app.isInModalSelection) === null || _app$isInModalSelecti2 === void 0 ? void 0 : _app$isInModalSelecti2.call(app)) !== null && _app$isInModalSelecti !== void 0 ? _app$isInModalSelecti : appSelections.isInModal();
|
|
19232
19279
|
};
|
|
19233
19280
|
function ListBoxInline(_ref5) {
|
|
19234
|
-
var _layout$qListObject, _layout$qListObject2, _layoutOptions$dense;
|
|
19281
|
+
var _layout$qListObject, _layout$qListObject2, _layoutOptions$dense, _containerRef$current;
|
|
19235
19282
|
let {
|
|
19236
19283
|
options,
|
|
19237
19284
|
layout
|
|
@@ -19457,10 +19504,12 @@ function ListBoxInline(_ref5) {
|
|
|
19457
19504
|
|
|
19458
19505
|
// Add a container padding for grid mode to harmonize with the grid item margins (should sum to 8px).
|
|
19459
19506
|
const isGridMode = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.dataLayout) === 'grid';
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
|
|
19463
|
-
|
|
19507
|
+
const containerPadding = getContainerPadding({
|
|
19508
|
+
isGridMode,
|
|
19509
|
+
dense,
|
|
19510
|
+
height: (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight,
|
|
19511
|
+
layoutOrder: layoutOptions.layoutOrder
|
|
19512
|
+
});
|
|
19464
19513
|
const searchIconComp = constraints !== null && constraints !== void 0 && constraints.active ? /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
19465
19514
|
title: translator.get('Listbox.Search'),
|
|
19466
19515
|
size: "large",
|
|
@@ -19500,6 +19549,7 @@ function ListBoxInline(_ref5) {
|
|
|
19500
19549
|
if (isInvalid) {
|
|
19501
19550
|
renderedCallback === null || renderedCallback === void 0 || renderedCallback();
|
|
19502
19551
|
}
|
|
19552
|
+
const listBoxMinHeight = showToolbarWithTitle ? DENSE_ROW_HEIGHT + SCROLL_BAR_WIDTH : 0;
|
|
19503
19553
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showDetachedToolbarOnly && /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$5({
|
|
19504
19554
|
direction: direction
|
|
19505
19555
|
}, getActionToolbarProps(true))), /*#__PURE__*/React__default.createElement(StyledGrid$3, {
|
|
@@ -19565,10 +19615,8 @@ function ListBoxInline(_ref5) {
|
|
|
19565
19615
|
item: true,
|
|
19566
19616
|
container: true,
|
|
19567
19617
|
direction: "column",
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
minHeight: DENSE_ROW_HEIGHT + SCROLL_BAR_WIDTH
|
|
19571
|
-
},
|
|
19618
|
+
height: "100%",
|
|
19619
|
+
minHeight: listBoxMinHeight,
|
|
19572
19620
|
role: "region",
|
|
19573
19621
|
"aria-label": translator.get('Listbox.ResultFilterLabel')
|
|
19574
19622
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -21321,7 +21369,8 @@ const convertTo = async _ref2 => {
|
|
|
21321
21369
|
model,
|
|
21322
21370
|
cellRef,
|
|
21323
21371
|
newType,
|
|
21324
|
-
properties
|
|
21372
|
+
properties,
|
|
21373
|
+
viewDataMode = false
|
|
21325
21374
|
} = _ref2;
|
|
21326
21375
|
const propertyTree = properties ? {
|
|
21327
21376
|
qProperty: properties
|
|
@@ -21342,7 +21391,8 @@ const convertTo = async _ref2 => {
|
|
|
21342
21391
|
}
|
|
21343
21392
|
const exportFormat = exportProperties({
|
|
21344
21393
|
propertyTree,
|
|
21345
|
-
hypercubePath: helpers.getHypercubePath(sourceQae)
|
|
21394
|
+
hypercubePath: helpers.getHypercubePath(sourceQae),
|
|
21395
|
+
viewDataMode
|
|
21346
21396
|
});
|
|
21347
21397
|
const initial = utils.getValue(targetQae, 'properties.initial', {});
|
|
21348
21398
|
const initialProperties = _objectSpread2({
|
|
@@ -21355,7 +21405,8 @@ const convertTo = async _ref2 => {
|
|
|
21355
21405
|
exportFormat,
|
|
21356
21406
|
initialProperties,
|
|
21357
21407
|
dataDefinition: utils.getValue(targetQae, 'data.targets.0.', {}),
|
|
21358
|
-
hypercubePath: helpers.getHypercubePath(targetQae)
|
|
21408
|
+
hypercubePath: helpers.getHypercubePath(targetQae),
|
|
21409
|
+
viewDataMode
|
|
21359
21410
|
});
|
|
21360
21411
|
return newPropertyTree;
|
|
21361
21412
|
};
|
|
@@ -22374,7 +22425,7 @@ const loadType = async _ref5 => {
|
|
|
22374
22425
|
const Cell = forwardRef((_ref6, ref) => {
|
|
22375
22426
|
let {
|
|
22376
22427
|
halo,
|
|
22377
|
-
model,
|
|
22428
|
+
model: inputModel,
|
|
22378
22429
|
initialSnOptions,
|
|
22379
22430
|
initialSnPlugins,
|
|
22380
22431
|
initialError,
|
|
@@ -22399,6 +22450,7 @@ const Cell = forwardRef((_ref6, ref) => {
|
|
|
22399
22450
|
const theme = useTheme$1();
|
|
22400
22451
|
const [cellRef, cellRect, cellNode] = useRect$1();
|
|
22401
22452
|
const [state, dispatch] = useReducer(contentReducer, initialState(initialError));
|
|
22453
|
+
const [model, setModel] = useState$1(inputModel);
|
|
22402
22454
|
const [layout, {
|
|
22403
22455
|
validating,
|
|
22404
22456
|
canCancel,
|
|
@@ -22552,6 +22604,7 @@ const Cell = forwardRef((_ref6, ref) => {
|
|
|
22552
22604
|
},
|
|
22553
22605
|
setSnOptions,
|
|
22554
22606
|
setSnPlugins,
|
|
22607
|
+
setModel,
|
|
22555
22608
|
getImperativeHandle() {
|
|
22556
22609
|
var _state$sn;
|
|
22557
22610
|
if ((_state$sn = state.sn) !== null && _state$sn !== void 0 && _state$sn.component && typeof state.sn.component.getImperativeHandle === 'function') {
|
|
@@ -25037,6 +25090,7 @@ function viz() {
|
|
|
25037
25090
|
let mountedReference = null;
|
|
25038
25091
|
let onMount = null;
|
|
25039
25092
|
let onRender = null;
|
|
25093
|
+
let viewDataObjectId;
|
|
25040
25094
|
const mounted = new Promise(resolve => {
|
|
25041
25095
|
onMount = resolve;
|
|
25042
25096
|
});
|
|
@@ -25174,6 +25228,49 @@ function viz() {
|
|
|
25174
25228
|
});
|
|
25175
25229
|
return propertyTree;
|
|
25176
25230
|
},
|
|
25231
|
+
/**
|
|
25232
|
+
* Toggles the chart to a data view of the chart.
|
|
25233
|
+
*
|
|
25234
|
+
* The chart will be toggled to the type defined in the nebula context (dataViewType).
|
|
25235
|
+
*
|
|
25236
|
+
* The default dataViewType for nebula is sn-table. The specified chart type needs to be registered as well, in order to make it possible to render the data view.
|
|
25237
|
+
*
|
|
25238
|
+
* @experimental
|
|
25239
|
+
* @since 4.9.0
|
|
25240
|
+
* @param {boolean=} showDataView - If included, forces the chart into a specific state. True will show data view, and false will show the original chart. If not included it will always toggle between the two views.
|
|
25241
|
+
*/
|
|
25242
|
+
async toggleDataView(showDataView) {
|
|
25243
|
+
let newModel;
|
|
25244
|
+
if (!viewDataObjectId && showDataView !== false) {
|
|
25245
|
+
let newType = halo.config.context.dataViewType;
|
|
25246
|
+
const oldProperties = await model.getEffectiveProperties();
|
|
25247
|
+
// Check if dataViewType is registered. Otherwise potentially fallback to table
|
|
25248
|
+
if (!halo.types.getSupportedVersion(newType)) {
|
|
25249
|
+
if (halo.types.getSupportedVersion('table')) {
|
|
25250
|
+
newType = 'table';
|
|
25251
|
+
} else {
|
|
25252
|
+
throw new Error('No data view type registered');
|
|
25253
|
+
}
|
|
25254
|
+
}
|
|
25255
|
+
const propertyTree = await convertTo({
|
|
25256
|
+
halo,
|
|
25257
|
+
model,
|
|
25258
|
+
cellRef,
|
|
25259
|
+
newType,
|
|
25260
|
+
properties: oldProperties,
|
|
25261
|
+
viewDataMode: true
|
|
25262
|
+
});
|
|
25263
|
+
newModel = await halo.app.createSessionObject(propertyTree.qProperty);
|
|
25264
|
+
viewDataObjectId = newModel.id;
|
|
25265
|
+
} else if (viewDataObjectId && showDataView !== true) {
|
|
25266
|
+
newModel = model;
|
|
25267
|
+
await halo.app.destroySessionObject(viewDataObjectId);
|
|
25268
|
+
viewDataObjectId = undefined;
|
|
25269
|
+
}
|
|
25270
|
+
if (newModel) {
|
|
25271
|
+
cellRef.current.setModel(newModel);
|
|
25272
|
+
}
|
|
25273
|
+
},
|
|
25177
25274
|
/**
|
|
25178
25275
|
* Listens to custom events from inside the visualization. See useEmitter
|
|
25179
25276
|
* @experimental
|
|
@@ -25308,7 +25405,6 @@ function viz() {
|
|
|
25308
25405
|
// setOptions() {}, // applied soft patch
|
|
25309
25406
|
// resize() {},
|
|
25310
25407
|
// show() {},
|
|
25311
|
-
// toggleDataView() {},
|
|
25312
25408
|
};
|
|
25313
25409
|
|
|
25314
25410
|
return api;
|
|
@@ -28120,7 +28216,13 @@ const DEFAULT_CONTEXT = /** @lends Context */{
|
|
|
28120
28216
|
/** @type {boolean=} */
|
|
28121
28217
|
keyboardNavigation: false,
|
|
28122
28218
|
/** @type {boolean=} */
|
|
28123
|
-
disableCellPadding: false
|
|
28219
|
+
disableCellPadding: false,
|
|
28220
|
+
/**
|
|
28221
|
+
* Type used for toggling to the data view (toggleDataView)
|
|
28222
|
+
* This type need to be registered as well
|
|
28223
|
+
* @type {string=}
|
|
28224
|
+
* */
|
|
28225
|
+
dataViewType: 'sn-table'
|
|
28124
28226
|
};
|
|
28125
28227
|
DEFAULT_CONFIG.context = DEFAULT_CONTEXT;
|
|
28126
28228
|
|