@nebula.js/stardust 4.8.1 → 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 +80 -26
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +2 -2
- package/core/esm/index.js.map +1 -1
- package/dist/stardust.dev.js +80 -26
- 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) {
|
|
@@ -21369,7 +21369,8 @@ const convertTo = async _ref2 => {
|
|
|
21369
21369
|
model,
|
|
21370
21370
|
cellRef,
|
|
21371
21371
|
newType,
|
|
21372
|
-
properties
|
|
21372
|
+
properties,
|
|
21373
|
+
viewDataMode = false
|
|
21373
21374
|
} = _ref2;
|
|
21374
21375
|
const propertyTree = properties ? {
|
|
21375
21376
|
qProperty: properties
|
|
@@ -21390,7 +21391,8 @@ const convertTo = async _ref2 => {
|
|
|
21390
21391
|
}
|
|
21391
21392
|
const exportFormat = exportProperties({
|
|
21392
21393
|
propertyTree,
|
|
21393
|
-
hypercubePath: helpers.getHypercubePath(sourceQae)
|
|
21394
|
+
hypercubePath: helpers.getHypercubePath(sourceQae),
|
|
21395
|
+
viewDataMode
|
|
21394
21396
|
});
|
|
21395
21397
|
const initial = utils.getValue(targetQae, 'properties.initial', {});
|
|
21396
21398
|
const initialProperties = _objectSpread2({
|
|
@@ -21403,7 +21405,8 @@ const convertTo = async _ref2 => {
|
|
|
21403
21405
|
exportFormat,
|
|
21404
21406
|
initialProperties,
|
|
21405
21407
|
dataDefinition: utils.getValue(targetQae, 'data.targets.0.', {}),
|
|
21406
|
-
hypercubePath: helpers.getHypercubePath(targetQae)
|
|
21408
|
+
hypercubePath: helpers.getHypercubePath(targetQae),
|
|
21409
|
+
viewDataMode
|
|
21407
21410
|
});
|
|
21408
21411
|
return newPropertyTree;
|
|
21409
21412
|
};
|
|
@@ -22422,7 +22425,7 @@ const loadType = async _ref5 => {
|
|
|
22422
22425
|
const Cell = forwardRef((_ref6, ref) => {
|
|
22423
22426
|
let {
|
|
22424
22427
|
halo,
|
|
22425
|
-
model,
|
|
22428
|
+
model: inputModel,
|
|
22426
22429
|
initialSnOptions,
|
|
22427
22430
|
initialSnPlugins,
|
|
22428
22431
|
initialError,
|
|
@@ -22447,6 +22450,7 @@ const Cell = forwardRef((_ref6, ref) => {
|
|
|
22447
22450
|
const theme = useTheme$1();
|
|
22448
22451
|
const [cellRef, cellRect, cellNode] = useRect$1();
|
|
22449
22452
|
const [state, dispatch] = useReducer(contentReducer, initialState(initialError));
|
|
22453
|
+
const [model, setModel] = useState$1(inputModel);
|
|
22450
22454
|
const [layout, {
|
|
22451
22455
|
validating,
|
|
22452
22456
|
canCancel,
|
|
@@ -22600,6 +22604,7 @@ const Cell = forwardRef((_ref6, ref) => {
|
|
|
22600
22604
|
},
|
|
22601
22605
|
setSnOptions,
|
|
22602
22606
|
setSnPlugins,
|
|
22607
|
+
setModel,
|
|
22603
22608
|
getImperativeHandle() {
|
|
22604
22609
|
var _state$sn;
|
|
22605
22610
|
if ((_state$sn = state.sn) !== null && _state$sn !== void 0 && _state$sn.component && typeof state.sn.component.getImperativeHandle === 'function') {
|
|
@@ -25085,6 +25090,7 @@ function viz() {
|
|
|
25085
25090
|
let mountedReference = null;
|
|
25086
25091
|
let onMount = null;
|
|
25087
25092
|
let onRender = null;
|
|
25093
|
+
let viewDataObjectId;
|
|
25088
25094
|
const mounted = new Promise(resolve => {
|
|
25089
25095
|
onMount = resolve;
|
|
25090
25096
|
});
|
|
@@ -25222,6 +25228,49 @@ function viz() {
|
|
|
25222
25228
|
});
|
|
25223
25229
|
return propertyTree;
|
|
25224
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
|
+
},
|
|
25225
25274
|
/**
|
|
25226
25275
|
* Listens to custom events from inside the visualization. See useEmitter
|
|
25227
25276
|
* @experimental
|
|
@@ -25356,7 +25405,6 @@ function viz() {
|
|
|
25356
25405
|
// setOptions() {}, // applied soft patch
|
|
25357
25406
|
// resize() {},
|
|
25358
25407
|
// show() {},
|
|
25359
|
-
// toggleDataView() {},
|
|
25360
25408
|
};
|
|
25361
25409
|
|
|
25362
25410
|
return api;
|
|
@@ -28168,7 +28216,13 @@ const DEFAULT_CONTEXT = /** @lends Context */{
|
|
|
28168
28216
|
/** @type {boolean=} */
|
|
28169
28217
|
keyboardNavigation: false,
|
|
28170
28218
|
/** @type {boolean=} */
|
|
28171
|
-
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'
|
|
28172
28226
|
};
|
|
28173
28227
|
DEFAULT_CONFIG.context = DEFAULT_CONTEXT;
|
|
28174
28228
|
|