@nebula.js/stardust 3.0.0-alpha0 → 3.0.0-alpha3

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v3.0.0-alpha0
2
+ * @nebula.js/stardust v3.0.0-alpha3
3
3
  * Copyright (c) 2022 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -16197,7 +16197,7 @@
16197
16197
  return cache[key];
16198
16198
  }
16199
16199
 
16200
- const NEBULA_VERSION_HASH = "30d9" ;
16200
+ const NEBULA_VERSION_HASH = "2bc2" ;
16201
16201
  ClassNameGenerator.configure(componentName => {
16202
16202
 
16203
16203
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
@@ -16770,7 +16770,7 @@
16770
16770
  const appRef = React.createRef();
16771
16771
  const element = document.createElement('div');
16772
16772
  element.style.display = 'none';
16773
- element.setAttribute('data-nebulajs-version', "3.0.0-alpha0" );
16773
+ element.setAttribute('data-nebulajs-version', "3.0.0-alpha3" );
16774
16774
  element.setAttribute('data-app-id', app.id);
16775
16775
  document.body.appendChild(element);
16776
16776
  ReactDOM.render( /*#__PURE__*/React.createElement(NebulaApp, {
@@ -31322,8 +31322,7 @@
31322
31322
  disableRipple: true,
31323
31323
  size: dense ? 'small' : 'medium',
31324
31324
  sx: dense && {
31325
- padding: '0px',
31326
- paddingLeft: '6px'
31325
+ padding: '0px 0px 0px 12px'
31327
31326
  }
31328
31327
  });
31329
31328
  }
@@ -31646,7 +31645,8 @@
31646
31645
  paddingRight: '8px'
31647
31646
  },
31648
31647
  ["&.".concat(classes$a.barContainer)]: {
31649
- position: 'relative'
31648
+ height: '100%',
31649
+ display: 'inline-block'
31650
31650
  },
31651
31651
  ["& .".concat(classes$a.bar)]: {
31652
31652
  border: "".concat(barBorderWidthPx, "px solid"),
@@ -31672,7 +31672,8 @@
31672
31672
  borderColor: '#BFE5D0'
31673
31673
  },
31674
31674
  ["& .".concat(classes$a.excludedTextWithCheckbox)]: {
31675
- color: '#828282'
31675
+ color: '#828282',
31676
+ fontStyle: 'italic'
31676
31677
  }
31677
31678
  };
31678
31679
  });
@@ -31681,8 +31682,7 @@
31681
31682
  let {
31682
31683
  index,
31683
31684
  style,
31684
- data,
31685
- column = false
31685
+ data
31686
31686
  } = _ref3;
31687
31687
  const {
31688
31688
  onClick,
@@ -31691,6 +31691,7 @@
31691
31691
  onMouseEnter,
31692
31692
  pages,
31693
31693
  isLocked,
31694
+ column = false,
31694
31695
  checkboxes = false,
31695
31696
  dense = false,
31696
31697
  frequencyMode = 'N',
@@ -32807,8 +32808,9 @@
32807
32808
  const onKeyDown = e => {
32808
32809
  switch (e.key) {
32809
32810
  case 'Enter':
32810
- model.acceptListObjectSearch(TREE_PATH, true);
32811
- setValue('');
32811
+ // This is disabled to "solve" QB-10955 with the lowest risk
32812
+ // await model.acceptListObjectSearch(TREE_PATH, true);
32813
+ // setValue('');
32812
32814
  break;
32813
32815
 
32814
32816
  case 'Escape':
@@ -33410,15 +33412,14 @@
33410
33412
 
33411
33413
  const PREFIX$6 = 'MultiState';
33412
33414
  const classes$6 = {
33413
- item: "".concat(PREFIX$6, "-item"),
33414
- badge: "".concat(PREFIX$6, "-badge")
33415
+ item: "".concat(PREFIX$6, "-item")
33415
33416
  };
33416
- const StyledListBoxPopover = styled(ListBoxPopover)(_ref => {
33417
+ const StyledGrid$5 = styled(Grid)(_ref => {
33417
33418
  let {
33418
33419
  theme
33419
33420
  } = _ref;
33420
33421
  return {
33421
- ["& .".concat(classes$6.item)]: {
33422
+ ["&.".concat(classes$6.item)]: {
33422
33423
  backgroundColor: theme.palette.background.paper,
33423
33424
  position: 'relative',
33424
33425
  cursor: 'pointer',
@@ -33428,9 +33429,6 @@
33428
33429
  },
33429
33430
  height: '100%',
33430
33431
  alignItems: 'center'
33431
- },
33432
- ["& .".concat(classes$6.badge)]: {
33433
- padding: theme.spacing(0, 1)
33434
33432
  }
33435
33433
  };
33436
33434
  });
@@ -33489,7 +33487,9 @@
33489
33487
  xs: true,
33490
33488
  zeroMinWidth: true
33491
33489
  }, /*#__PURE__*/React.createElement(Badge, {
33492
- className: classes$6.badge,
33490
+ style: {
33491
+ padding: '0px 8px'
33492
+ },
33493
33493
  color: "secondary",
33494
33494
  badgeContent: field.states.length
33495
33495
  }, /*#__PURE__*/React.createElement(Typography, {
@@ -33559,12 +33559,12 @@
33559
33559
  }
33560
33560
  }
33561
33561
  }, Fields);
33562
- const Component = moreAlignTo ? PopoverFields : /*#__PURE__*/React.createElement(Grid, {
33562
+ const Component = moreAlignTo ? PopoverFields : /*#__PURE__*/React.createElement(StyledGrid$5, {
33563
33563
  container: true,
33564
33564
  gap: 0,
33565
33565
  className: classes$6.item,
33566
33566
  onClick: handleShowFields
33567
- }, Header, showFields && PopoverFields, showStateIx > -1 && /*#__PURE__*/React.createElement(StyledListBoxPopover, {
33567
+ }, Header, showFields && PopoverFields, showStateIx > -1 && /*#__PURE__*/React.createElement(ListBoxPopover, {
33568
33568
  alignTo: alignTo,
33569
33569
  show: showStateIx > -1,
33570
33570
  close: handleCloseShowState,
@@ -33572,7 +33572,7 @@
33572
33572
  fieldName: field.selections[showStateIx].qField,
33573
33573
  stateName: field.states[showStateIx]
33574
33574
  }));
33575
- return moreAlignTo && showStateIx > -1 ? /*#__PURE__*/React.createElement(StyledListBoxPopover, {
33575
+ return moreAlignTo && showStateIx > -1 ? /*#__PURE__*/React.createElement(ListBoxPopover, {
33576
33576
  alignTo: alignTo,
33577
33577
  show: showStateIx > -1,
33578
33578
  close: handleCloseShowState,
@@ -34469,7 +34469,7 @@
34469
34469
  * user interact outside of passed element ref.
34470
34470
  */
34471
34471
 
34472
- function useConfirmUnfocus(ref, selections) {
34472
+ function useConfirmUnfocus(ref, selections, shouldConfirmOnBlur) {
34473
34473
  const [_isConfirmed, _setIsConfirmed] = react.exports.useState(false); // Wrap state in ref to use inside eventListener callback
34474
34474
 
34475
34475
  const isConfirmedRef = react.exports.useRef(_isConfirmed);
@@ -34481,6 +34481,8 @@
34481
34481
  };
34482
34482
 
34483
34483
  react.exports.useEffect(() => {
34484
+ if (!shouldConfirmOnBlur) return undefined;
34485
+
34484
34486
  const handleEvent = event => {
34485
34487
  const interactInside = ref.current && ref.current.contains(event.target);
34486
34488
  const isConfirmed = isConfirmedRef.current;
@@ -34499,7 +34501,7 @@
34499
34501
  document.removeEventListener('mousedown', handleEvent);
34500
34502
  document.removeEventListener('keydown', handleEvent);
34501
34503
  };
34502
- }, [ref, selections]);
34504
+ }, [ref, selections, shouldConfirmOnBlur]);
34503
34505
  }
34504
34506
 
34505
34507
  const PREFIX$4 = 'ListBoxInline';
@@ -34541,7 +34543,8 @@
34541
34543
  showGray = true,
34542
34544
  sortByState = 1,
34543
34545
  scrollState = undefined,
34544
- setCount = undefined
34546
+ setCount = undefined,
34547
+ shouldConfirmOnBlur = undefined
34545
34548
  } = options;
34546
34549
  let {
34547
34550
  frequencyMode,
@@ -34696,7 +34699,7 @@
34696
34699
  }
34697
34700
  }, [selections]);
34698
34701
  const listBoxRef = react.exports.useRef(null);
34699
- useConfirmUnfocus(listBoxRef, selections);
34702
+ useConfirmUnfocus(listBoxRef, selections, shouldConfirmOnBlur);
34700
34703
  react.exports.useEffect(() => {
34701
34704
  if (!searchContainer || !searchContainer.current) {
34702
34705
  return;
@@ -34722,7 +34725,9 @@
34722
34725
  const counts = layout.qListObject.qDimensionInfo.qStateCounts;
34723
34726
  const hasSelections = counts.qSelected + counts.qSelectedExcluded + counts.qLocked + counts.qLockedExcluded > 0;
34724
34727
  const searchVisible = (search === true || search === 'toggle' && showSearch) && !selectDisabled();
34725
- const minHeight = 49 + (searchVisible ? 40 : 0) + 49;
34728
+ const searchHeight = dense ? 27 : 40;
34729
+ const extraheight = dense ? 39 : 49;
34730
+ const minHeight = 49 + (searchVisible ? searchHeight : 0) + extraheight;
34726
34731
 
34727
34732
  const onShowSearch = () => {
34728
34733
  const newValue = !showSearch;
@@ -37215,7 +37220,7 @@
37215
37220
 
37216
37221
  load(layout.visualization, withVersion);
37217
37222
  return () => {};
37218
- }, [types, state.sn, model, layout, appLayout, language]); // Long running query
37223
+ }, [types, state.sn, model, selections, layout, appLayout, language]); // Long running query
37219
37224
 
37220
37225
  react.exports.useEffect(() => {
37221
37226
  if (!validating) {
@@ -42002,6 +42007,7 @@
42002
42007
  * @property {{setScrollPos:function(number):void, initScrollPos:number}} [options.scrollState=] Object including a setScrollPos function that sets current scroll position index. A initial scroll position index.
42003
42008
  * @property {number=} [options.sortByState=1] Sort by state, detault 1 = sort descending, 0 = no sorting, -1 sort ascending.
42004
42009
  * @property {function(number):void} [options.setCount=] A function that gets called with the length of the data in the Listbox.
42010
+ * @property {boolean} [options.shouldConfirmOnBlur=] A boolean that determines if the listbox should actively confirm selections on blur events.
42005
42011
  */
42006
42012
 
42007
42013
  /**
@@ -42427,7 +42433,7 @@
42427
42433
  var enigmaMocker_dev = {exports: {}};
42428
42434
 
42429
42435
  /*
42430
- * @nebula.js/enigma-mocker v2.11.0
42436
+ * @nebula.js/enigma-mocker v3.0.0-alpha2
42431
42437
  * Copyright (c) 2022 QlikTech International AB
42432
42438
  * Released under the MIT license.
42433
42439
  */