@nebula.js/stardust 5.0.0 → 5.0.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 CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v5.0.0
2
+ * @nebula.js/stardust v5.0.1
3
3
  * Copyright (c) 2024 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -742,7 +742,7 @@ function _toPrimitive(t, r) {
742
742
  }
743
743
  function _toPropertyKey(t) {
744
744
  var i = _toPrimitive(t, "string");
745
- return "symbol" == typeof i ? i : String(i);
745
+ return "symbol" == typeof i ? i : i + "";
746
746
  }
747
747
  function _defineProperty(obj, key, value) {
748
748
  key = _toPropertyKey(key);
@@ -5262,7 +5262,7 @@ function GlobalStyles(props) {
5262
5262
  }
5263
5263
 
5264
5264
  /**
5265
- * @mui/styled-engine v5.15.11
5265
+ * @mui/styled-engine v5.15.14
5266
5266
  *
5267
5267
  * @license MIT
5268
5268
  * This source code is licensed under the MIT license found in the
@@ -7746,7 +7746,7 @@ function emphasize(color, coefficient = 0.15) {
7746
7746
  }
7747
7747
  function private_safeEmphasize(color, coefficient, warning) {
7748
7748
  try {
7749
- return private_safeEmphasize(color, coefficient);
7749
+ return emphasize(color, coefficient);
7750
7750
  } catch (error) {
7751
7751
  if (warning && "production" !== 'production') {
7752
7752
  console.warn(warning);
@@ -8467,7 +8467,7 @@ Object.defineProperty(createStyled$1, "__esModule", {
8467
8467
  value: true
8468
8468
  });
8469
8469
  var _default = createStyled$1.default = createStyled;
8470
- var shouldForwardProp_1 = createStyled$1.shouldForwardProp = shouldForwardProp;
8470
+ createStyled$1.shouldForwardProp = shouldForwardProp;
8471
8471
  createStyled$1.systemDefaultTheme = void 0;
8472
8472
  var _extends2 = _interopRequireDefault$1(require_extends());
8473
8473
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault$1(requireObjectWithoutPropertiesLoose());
@@ -8695,11 +8695,18 @@ function createStyled(input = {}) {
8695
8695
  };
8696
8696
  }
8697
8697
 
8698
- const rootShouldForwardProp = prop => shouldForwardProp_1(prop) && prop !== 'classes';
8698
+ // copied from @mui/system/createStyled
8699
+ function slotShouldForwardProp(prop) {
8700
+ return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
8701
+ }
8702
+
8703
+ const rootShouldForwardProp = prop => slotShouldForwardProp(prop) && prop !== 'classes';
8704
+ var rootShouldForwardProp$1 = rootShouldForwardProp;
8705
+
8699
8706
  const styled = _default({
8700
8707
  themeId: THEME_ID,
8701
8708
  defaultTheme: defaultTheme$1,
8702
- rootShouldForwardProp
8709
+ rootShouldForwardProp: rootShouldForwardProp$1
8703
8710
  });
8704
8711
 
8705
8712
  const _excluded$7 = ["theme"];
@@ -9094,7 +9101,7 @@ function create$3(definition) {
9094
9101
  return cache[key];
9095
9102
  }
9096
9103
 
9097
- const NEBULA_VERSION_HASH = "e6be" ;
9104
+ const NEBULA_VERSION_HASH = "19bb" ;
9098
9105
  ClassNameGenerator.configure(componentName => {
9099
9106
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
9100
9107
  });
@@ -9326,7 +9333,7 @@ function boot(_ref2) {
9326
9333
  const appRef = React__default.createRef();
9327
9334
  const element = document.createElement('div');
9328
9335
  element.style.display = 'none';
9329
- element.setAttribute('data-nebulajs-version', "5.0.0" );
9336
+ element.setAttribute('data-nebulajs-version', "5.0.1" );
9330
9337
  element.setAttribute('data-app-id', app.id);
9331
9338
  document.body.appendChild(element);
9332
9339
  if (context) {
@@ -14072,7 +14079,7 @@ const SvgIconRoot = styled('svg', {
14072
14079
  height: '1em',
14073
14080
  display: 'inline-block',
14074
14081
  // the <svg> will define the property that has `currentColor`
14075
- // e.g. heroicons uses fill="none" and stroke="currentColor"
14082
+ // for example heroicons uses fill="none" and stroke="currentColor"
14076
14083
  fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',
14077
14084
  flexShrink: 0,
14078
14085
  transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
@@ -15606,9 +15613,6 @@ function ListBoxSearch(_ref2) {
15606
15613
  setValue(WILDCARD);
15607
15614
  setWildcardOn(true);
15608
15615
  }
15609
- if (!selectionState.selectDisabled() && !selections.isModal()) {
15610
- selections.begin(['/qListObjectDef']);
15611
- }
15612
15616
  };
15613
15617
  const hasHits = () => {
15614
15618
  const listCount = getStoreValue("listCount");
@@ -20045,7 +20049,14 @@ const dimensionTypes = {
20045
20049
  drillDown: 'H',
20046
20050
  cyclic: 'C'
20047
20051
  };
20048
- const createDimensionIconData = (dimInfo, app) => {
20052
+ const createDimensionIconData = _ref => {
20053
+ let {
20054
+ dimInfo,
20055
+ app,
20056
+ selections,
20057
+ isPopover,
20058
+ active
20059
+ } = _ref;
20049
20060
  switch (dimInfo.qGrouping) {
20050
20061
  case dimensionTypes.drillDown:
20051
20062
  return {
@@ -20054,20 +20065,26 @@ const createDimensionIconData = (dimInfo, app) => {
20054
20065
  onClick: undefined
20055
20066
  };
20056
20067
  case dimensionTypes.cyclic:
20057
- return {
20058
- icon: app ? ReloadIcon : CyclicIcon,
20059
- tooltip: 'Listbox.Cyclic',
20060
- onClick: app ? () => {
20061
- app.getDimension(dimInfo.qLibraryId).then(dimensionModel => {
20062
- if (!dimensionModel.stepCycle) {
20063
- // eslint-disable-next-line no-console
20064
- console.log("engine api spec version doesn't have support for function stepCycle");
20065
- return;
20068
+ {
20069
+ const clickable = app && active;
20070
+ return {
20071
+ icon: clickable ? ReloadIcon : CyclicIcon,
20072
+ tooltip: 'Listbox.Cyclic',
20073
+ onClick: clickable ? () => {
20074
+ if (!isPopover) {
20075
+ selections.confirm();
20066
20076
  }
20067
- dimensionModel.stepCycle(1);
20068
- }).catch(() => null);
20069
- } : undefined
20070
- };
20077
+ app.getDimension(dimInfo.qLibraryId).then(dimensionModel => {
20078
+ if (!dimensionModel.stepCycle) {
20079
+ // eslint-disable-next-line no-console
20080
+ console.log("engine api spec version doesn't have support for function stepCycle");
20081
+ return;
20082
+ }
20083
+ dimensionModel.stepCycle(1);
20084
+ }).catch(() => null);
20085
+ } : undefined
20086
+ };
20087
+ }
20071
20088
  default:
20072
20089
  return undefined;
20073
20090
  }
@@ -20087,7 +20104,8 @@ function DimensionIcon(_ref) {
20087
20104
  let {
20088
20105
  iconData,
20089
20106
  translator,
20090
- iconStyle
20107
+ iconStyle,
20108
+ disabled
20091
20109
  } = _ref;
20092
20110
  if (!iconData) return undefined;
20093
20111
  const {
@@ -20104,7 +20122,8 @@ function DimensionIcon(_ref) {
20104
20122
  tabIndex: -1,
20105
20123
  title: title,
20106
20124
  size: "large",
20107
- disableRipple: true
20125
+ disableRipple: true,
20126
+ disabled: disabled
20108
20127
  }, /*#__PURE__*/React__default.createElement(Icon, {
20109
20128
  style: iconStyle
20110
20129
  })) : /*#__PURE__*/React__default.createElement(Icon, {
@@ -20172,7 +20191,8 @@ function ListBoxHeader(_ref2) {
20172
20191
  selections,
20173
20192
  keyboard,
20174
20193
  autoConfirm,
20175
- app
20194
+ app,
20195
+ isInSelection
20176
20196
  } = _ref2;
20177
20197
  const [isToolbarDetached, setIsToolbarDetached] = useState$1(showDetachedToolbarOnly);
20178
20198
  const [isLocked, setLocked] = useState$1(layout === null || layout === void 0 || (_layout$qListObject = layout.qListObject) === null || _layout$qListObject === void 0 || (_layout$qListObject = _layout$qListObject.qDimensionInfo) === null || _layout$qListObject === void 0 ? void 0 : _layout$qListObject.qLocked);
@@ -20182,7 +20202,13 @@ function ListBoxHeader(_ref2) {
20182
20202
  setLocked(layout === null || layout === void 0 || (_layout$qListObject2 = layout.qListObject) === null || _layout$qListObject2 === void 0 || (_layout$qListObject2 = _layout$qListObject2.qDimensionInfo) === null || _layout$qListObject2 === void 0 ? void 0 : _layout$qListObject2.qLocked);
20183
20203
  }, [layout === null || layout === void 0 || (_layout$qListObject3 = layout.qListObject) === null || _layout$qListObject3 === void 0 || (_layout$qListObject3 = _layout$qListObject3.qDimensionInfo) === null || _layout$qListObject3 === void 0 ? void 0 : _layout$qListObject3.qLocked]);
20184
20204
  const titleRef = useRef(null);
20185
- const iconData = iconUtils.createDimensionIconData(layout === null || layout === void 0 || (_layout$qListObject4 = layout.qListObject) === null || _layout$qListObject4 === void 0 ? void 0 : _layout$qListObject4.qDimensionInfo, app);
20205
+ const iconData = iconUtils.createDimensionIconData({
20206
+ dimInfo: layout === null || layout === void 0 || (_layout$qListObject4 = layout.qListObject) === null || _layout$qListObject4 === void 0 ? void 0 : _layout$qListObject4.qDimensionInfo,
20207
+ app,
20208
+ selections,
20209
+ isPopover,
20210
+ active: !(constraints !== null && constraints !== void 0 && constraints.active)
20211
+ });
20186
20212
  const showUnlock = showLock && isLocked;
20187
20213
  const showLockIcon = !showLock && isLocked; // shows instead of the cover button when field/dim is locked.
20188
20214
  const showLeftIcon = showSearchIcon || showLockIcon || iconData; // the left-most icon outside of the actions/selections toolbar.
@@ -20293,6 +20319,7 @@ function ListBoxHeader(_ref2) {
20293
20319
  }, lockedIconComp || showSearchIcon && searchIconComp, /*#__PURE__*/React__default.createElement(DimensionIcon, {
20294
20320
  iconData: iconData,
20295
20321
  iconStyle: iconStyle,
20322
+ disabled: isInSelection && isPopover,
20296
20323
  translator: translator
20297
20324
  })), /*#__PURE__*/React__default.createElement(Grid, {
20298
20325
  item: true,
@@ -20453,6 +20480,7 @@ function ListBoxInline(_ref3) {
20453
20480
  }), [app, appSelections]);
20454
20481
  const isInvalid = layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo.qError;
20455
20482
  const errorText = isInvalid && constraints.active ? 'Visualization.Invalid.Dimension' : 'Visualization.Incomplete';
20483
+ const [isInSelection, setIsInSelection] = useState$1(false);
20456
20484
  const {
20457
20485
  handleKeyDown,
20458
20486
  handleOnMouseEnter,
@@ -20481,9 +20509,11 @@ function ListBoxInline(_ref3) {
20481
20509
  }
20482
20510
  const show = () => {
20483
20511
  setShowToolbar(true);
20512
+ setIsInSelection(true);
20484
20513
  };
20485
20514
  const hide = () => {
20486
20515
  setShowToolbar(false);
20516
+ setIsInSelection(false);
20487
20517
  if (search === 'toggle') {
20488
20518
  setShowSearch(false);
20489
20519
  }
@@ -20491,7 +20521,6 @@ function ListBoxInline(_ref3) {
20491
20521
  if (isPopover) {
20492
20522
  // When isPopover, toolbar == false will be ignored.
20493
20523
  if (!selections.isActive()) {
20494
- selections.begin('/qListObjectDef');
20495
20524
  selections.on('activated', show);
20496
20525
  selections.on('deactivated', hide);
20497
20526
  }
@@ -20586,7 +20615,8 @@ function ListBoxInline(_ref3) {
20586
20615
  model: model,
20587
20616
  selectionState: selectionState$1,
20588
20617
  selections: selections,
20589
- keyboard: keyboard
20618
+ keyboard: keyboard,
20619
+ isInSelection: isInSelection
20590
20620
  });
20591
20621
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showDetachedToolbarOnly && listBoxHeader, /*#__PURE__*/React__default.createElement(StyledGrid$3, {
20592
20622
  className: "listbox-container",