@nebula.js/stardust 4.0.2 → 4.0.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "module": "esm/index.js",
3
3
  "peerDependencies": {
4
- "@mui/material": "^5.12.3",
4
+ "@mui/material": "^5.13.0",
5
5
  "@mui/icons-material": "^5.11.16",
6
6
  "@emotion/react": "^11.11.0",
7
7
  "@emotion/styled": "^11.11.0",
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v4.0.2
2
+ * @nebula.js/stardust v4.0.4
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -16399,7 +16399,7 @@
16399
16399
  return cache[key];
16400
16400
  }
16401
16401
 
16402
- const NEBULA_VERSION_HASH = "5bae" ;
16402
+ const NEBULA_VERSION_HASH = "ef4e" ;
16403
16403
  ClassNameGenerator$1.configure(componentName => {
16404
16404
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
16405
16405
  });
@@ -16457,7 +16457,6 @@
16457
16457
 
16458
16458
  const [useAppSelectionsStore, appSelectionsStore] = createKeyStore({});
16459
16459
  const [useAppModalStore, appModalStore] = createKeyStore({});
16460
- const [useObjectSelectionsStore, objectSelectionsStore] = createKeyStore({});
16461
16460
  const [useModalObjectStore, modalObjectStore] = createKeyStore({});
16462
16461
 
16463
16462
  /* eslint no-underscore-dangle: 0 */
@@ -16468,18 +16467,26 @@
16468
16467
  const key = "".concat(app.id);
16469
16468
  const end = async function () {
16470
16469
  let accept = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
16471
- const model = modalObjectStore.get(key);
16470
+ const {
16471
+ model,
16472
+ objectSelections
16473
+ } = modalObjectStore.get(key) || {};
16472
16474
  if (model) {
16473
16475
  await model.endSelections(accept);
16474
16476
  modalObjectStore.clear(key);
16475
- const objectSelections = objectSelectionsStore.get(model.id);
16476
16477
  objectSelections.emit('deactivated');
16477
16478
  }
16478
16479
  };
16479
- const begin = async function (model, path) {
16480
- let accept = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
16480
+ const begin = async _ref2 => {
16481
+ var _modalObjectStore$get;
16482
+ let {
16483
+ model,
16484
+ paths,
16485
+ accept = true,
16486
+ objectSelections
16487
+ } = _ref2;
16481
16488
  // Quick return if it's already in modal
16482
- if (model === modalObjectStore.get(key)) {
16489
+ if (objectSelections === ((_modalObjectStore$get = modalObjectStore.get(key)) === null || _modalObjectStore$get === void 0 ? void 0 : _modalObjectStore$get.objectSelections)) {
16483
16490
  return;
16484
16491
  }
16485
16492
 
@@ -16487,12 +16494,18 @@
16487
16494
  end(accept);
16488
16495
 
16489
16496
  // Pending modal
16490
- modalObjectStore.set(key, model);
16491
- const p = Array.isArray(path) ? path : [path];
16497
+ modalObjectStore.set(key, {
16498
+ model,
16499
+ objectSelections
16500
+ });
16501
+ const p = Array.isArray(paths) ? paths : [paths];
16492
16502
  const beginSelections = async skipRetry => {
16493
16503
  try {
16494
16504
  await model.beginSelections(p);
16495
- modalObjectStore.set(key, model); // We have a modal
16505
+ modalObjectStore.set(key, {
16506
+ model,
16507
+ objectSelections
16508
+ }); // We have a modal
16496
16509
  } catch (err) {
16497
16510
  if (err.code === 6003 && !skipRetry) {
16498
16511
  await app.abortModal(accept);
@@ -16520,9 +16533,10 @@
16520
16533
  isInModal() {
16521
16534
  return !!modalObjectStore.get(key);
16522
16535
  },
16523
- isModal(object) {
16536
+ isModal(objectSelections) {
16537
+ var _modalObjectStore$get2;
16524
16538
  // TODO check model state
16525
- return object ? modalObjectStore.get(key) === object : !!modalObjectStore.get(key);
16539
+ return objectSelections ? ((_modalObjectStore$get2 = modalObjectStore.get(key)) === null || _modalObjectStore$get2 === void 0 ? void 0 : _modalObjectStore$get2.objectSelections) === objectSelections : !!modalObjectStore.get(key);
16526
16540
  },
16527
16541
  forward() {
16528
16542
  return appModal.end().then(() => app.forward());
@@ -16646,7 +16660,7 @@
16646
16660
  const appRef = React.createRef();
16647
16661
  const element = document.createElement('div');
16648
16662
  element.style.display = 'none';
16649
- element.setAttribute('data-nebulajs-version', "4.0.2" );
16663
+ element.setAttribute('data-nebulajs-version', "4.0.4" );
16650
16664
  element.setAttribute('data-app-id', app.id);
16651
16665
  document.body.appendChild(element);
16652
16666
  if (context) {
@@ -28088,7 +28102,12 @@
28088
28102
  }
28089
28103
  isActive = true;
28090
28104
  this.emit('activated');
28091
- return appModal.begin(model, paths, true);
28105
+ return appModal.begin({
28106
+ model,
28107
+ paths,
28108
+ accept: true,
28109
+ objectSelections: api
28110
+ });
28092
28111
  },
28093
28112
  /**
28094
28113
  * @returns {Promise<undefined>}
@@ -28175,12 +28194,17 @@
28175
28194
  /**
28176
28195
  * @returns {boolean}
28177
28196
  */
28178
- isModal: () => appSelections.isModal(model),
28197
+ isModal: () => appSelections.isModal(api),
28179
28198
  /**
28180
28199
  * @param {string[]} paths
28181
28200
  * @returns {Promise<undefined>}
28182
28201
  */
28183
- goModal: paths => appModal.begin(model, paths, false),
28202
+ goModal: paths => appModal.begin({
28203
+ model,
28204
+ paths,
28205
+ accept: false,
28206
+ objectSelections: api
28207
+ }),
28184
28208
  /**
28185
28209
  * @param {boolean} [accept=false]
28186
28210
  * @returns {Promise<undefined>}
@@ -28220,20 +28244,16 @@
28220
28244
  const elementsArr = Array.isArray(elements) ? elements : [elements];
28221
28245
  const [appSelections] = useAppSelections(app);
28222
28246
  const [layout] = useLayout$1(model);
28223
- const key = model ? model.id : null;
28224
28247
  const [appModalStore] = useAppModalStore();
28225
- const [objectSelectionsStore] = useObjectSelectionsStore();
28226
28248
  const appModal = appModalStore.get(app.id);
28227
- let objectSelections = objectSelectionsStore.get(key);
28249
+ const [objectSelections, setObjectSelections] = reactExports.useState();
28228
28250
  reactExports.useEffect(() => {
28229
28251
  if (!appSelections || !model || objectSelections) return;
28230
- objectSelections = createObjectSelections({
28252
+ setObjectSelections(createObjectSelections({
28231
28253
  appSelections,
28232
28254
  appModal,
28233
28255
  model
28234
- });
28235
- objectSelectionsStore.set(key, objectSelections);
28236
- objectSelectionsStore.dispatch(true);
28256
+ }));
28237
28257
  }, [appSelections, model]);
28238
28258
  reactExports.useEffect(() => {
28239
28259
  if (!objectSelections) return () => {};
@@ -29098,8 +29118,10 @@
29098
29118
  const [containerRef, containerRect] = useRect$1();
29099
29119
  const [maxItems, setMaxItems] = reactExports.useState(0);
29100
29120
  const isInListboxPopover = () => {
29101
- const object = modalObjectStore.get(app.id);
29102
- return object && object.genericType === 'njsListbox';
29121
+ const {
29122
+ model
29123
+ } = modalObjectStore.get(app.id) || {};
29124
+ return (model === null || model === void 0 ? void 0 : model.genericType) === 'njsListbox';
29103
29125
  };
29104
29126
  reactExports.useEffect(() => {
29105
29127
  if (!containerRect) return;
@@ -30345,6 +30367,9 @@
30345
30367
  fontSize: '12px'
30346
30368
  }
30347
30369
  }));
30370
+ if (isInvalid) {
30371
+ renderedCallback === null || renderedCallback === void 0 ? void 0 : renderedCallback();
30372
+ }
30348
30373
  return /*#__PURE__*/React.createElement(React.Fragment, null, showDetachedToolbarOnly && /*#__PURE__*/React.createElement(ActionsToolbar, _extends$7({
30349
30374
  direction: direction
30350
30375
  }, getActionToolbarProps(true))), /*#__PURE__*/React.createElement(StyledGrid$3, {
@@ -33557,7 +33582,7 @@
33557
33582
  height: '100%'
33558
33583
  },
33559
33584
  ref: contentRef
33560
- }, Content), /*#__PURE__*/React.createElement(Footer, {
33585
+ }, Content), cellNode && layout && state.sn && /*#__PURE__*/React.createElement(Footer, {
33561
33586
  layout: layout,
33562
33587
  titleStyles: titleStyles
33563
33588
  })), state.longRunningQuery && /*#__PURE__*/React.createElement(LongRunningQuery, {
@@ -38407,7 +38432,7 @@
38407
38432
  },
38408
38433
  getSupportedVersion: (name, propertyVersion) => {
38409
38434
  if (!tc[name]) {
38410
- return null;
38435
+ return undefined;
38411
38436
  }
38412
38437
  return tc[name].getMatchingVersionFromProperties(propertyVersion);
38413
38438
  },