@nebula.js/stardust 2.11.0 → 2.12.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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v2.11.0
2
+ * @nebula.js/stardust v2.12.0
3
3
  * Copyright (c) 2022 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -11321,7 +11321,7 @@
11321
11321
  return [appSelections, navState];
11322
11322
  }
11323
11323
 
11324
- const NEBULA_VERSION_HASH = "6c1e" ;
11324
+ const NEBULA_VERSION_HASH = "32d7" ;
11325
11325
  let counter = 0;
11326
11326
  const NebulaApp = react.exports.forwardRef((_ref, ref) => {
11327
11327
  let {
@@ -11381,7 +11381,7 @@
11381
11381
  const appRef = React.createRef();
11382
11382
  const element = document.createElement('div');
11383
11383
  element.style.display = 'none';
11384
- element.setAttribute('data-nebulajs-version', "2.11.0" );
11384
+ element.setAttribute('data-nebulajs-version', "2.12.0" );
11385
11385
  element.setAttribute('data-app-id', app.id);
11386
11386
  document.body.appendChild(element);
11387
11387
  ReactDOM.render( /*#__PURE__*/React.createElement(NebulaApp, {
@@ -34329,7 +34329,10 @@
34329
34329
  const [selected, setSelected] = react.exports.useState([]);
34330
34330
  const [isRangeSelection, setIsRangeSelection] = react.exports.useState(false);
34331
34331
  const [preSelected, setPreSelected] = react.exports.useState([]);
34332
- const elemNumbersOrdered = getElemNumbersFromPages(pages); // Select values for real, by calling the backend.
34332
+ const elemNumbersOrdered = getElemNumbersFromPages(pages);
34333
+ react.exports.useEffect(() => {
34334
+ setIsSingleSelect(singleSelect);
34335
+ }, [singleSelect]); // Select values for real, by calling the backend.
34333
34336
 
34334
34337
  const select = async function () {
34335
34338
  let elemNumbers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
@@ -34423,7 +34426,7 @@
34423
34426
  setSelectingValues(false);
34424
34427
  setIsRangeSelection(false);
34425
34428
  setIsSingleSelect(singleSelect);
34426
- }, []);
34429
+ }, [singleSelect]);
34427
34430
  const onMouseEnter = react.exports.useCallback(event => {
34428
34431
  if (isSingleSelect || !mouseDown || selectingValues || selectDisabled()) {
34429
34432
  return;
@@ -34449,7 +34452,7 @@
34449
34452
  return () => {
34450
34453
  doc.removeEventListener('mouseup', onMouseUpDoc);
34451
34454
  };
34452
- }, []);
34455
+ }, [onMouseUpDoc]);
34453
34456
  react.exports.useEffect(() => {
34454
34457
  if (selectingValues || mouseDown) {
34455
34458
  return;
@@ -35332,7 +35335,8 @@
35332
35335
  showGray = true,
35333
35336
  scrollState,
35334
35337
  sortByState,
35335
- selectDisabled = () => false
35338
+ selectDisabled = () => false,
35339
+ setCount
35336
35340
  } = _ref2;
35337
35341
  const [layout] = useLayout$1(model);
35338
35342
  const isSingleSelect = !!(layout && layout.qListObject.qDimensionInfo.qIsOneAndOnlyOne);
@@ -35429,6 +35433,10 @@
35429
35433
 
35430
35434
  react.exports.useEffect(() => {
35431
35435
  fetchData();
35436
+
35437
+ if (typeof setCount === 'function' && layout) {
35438
+ setCount(layout.qListObject.qSize.qcy);
35439
+ }
35432
35440
  }, [layout]);
35433
35441
  react.exports.useEffect(() => {
35434
35442
  if (!instantPages || isLoadingData) {
@@ -35563,6 +35571,10 @@
35563
35571
  translator
35564
35572
  } = _ref;
35565
35573
 
35574
+ if (layout.qListObject.qDimensionInfo.qIsOneAndOnlyOne) {
35575
+ return [];
35576
+ }
35577
+
35566
35578
  const canSelectAll = () => ['qOption', 'qAlternative', 'qExcluded', 'qDeselected'].some(sc => layout.qListObject.qDimensionInfo.qStateCounts[sc] > 0);
35567
35579
 
35568
35580
  const canSelectPossible = () => ['qOption'].some(sc => layout.qListObject.qDimensionInfo.qStateCounts[sc] > 0);
@@ -36287,7 +36299,7 @@
36287
36299
  */
36288
36300
  canClear() {
36289
36301
  if (layout && layout.qListObject && layout.qListObject.qDimensionInfo) {
36290
- return !layout.qListObject.qDimensionInfo.qLocked;
36302
+ return !layout.qListObject.qDimensionInfo.qLocked && !layout.qListObject.qDimensionInfo.qIsOneAndOnlyOne;
36291
36303
  }
36292
36304
 
36293
36305
  return hasSelected;
@@ -36636,17 +36648,23 @@
36636
36648
  lineHeight: '16px'
36637
36649
  }
36638
36650
  }, label));
36639
- Icon = selection.qLocked ? /*#__PURE__*/React.createElement(StyledGrid, {
36640
- item: true
36641
- }, /*#__PURE__*/React.createElement(IconButton$1, null, /*#__PURE__*/React.createElement(Lock, null))) : /*#__PURE__*/React.createElement(StyledGrid, {
36642
- item: true
36643
- }, /*#__PURE__*/React.createElement(IconButton$1, {
36644
- title: translator.get('Selection.Clear'),
36645
- onClick: e => {
36646
- e.stopPropagation();
36647
- api.clearField(selection.qField, field.states[stateIx]);
36648
- }
36649
- }, /*#__PURE__*/React.createElement(Remove, null)));
36651
+
36652
+ if (selection.qLocked) {
36653
+ Icon = /*#__PURE__*/React.createElement(StyledGrid, {
36654
+ item: true
36655
+ }, /*#__PURE__*/React.createElement(IconButton$1, null, /*#__PURE__*/React.createElement(Lock, null)));
36656
+ } else if (!selection.qOneAndOnlyOne) {
36657
+ Icon = /*#__PURE__*/React.createElement(StyledGrid, {
36658
+ item: true
36659
+ }, /*#__PURE__*/React.createElement(IconButton$1, {
36660
+ title: translator.get('Selection.Clear'),
36661
+ onClick: e => {
36662
+ e.stopPropagation();
36663
+ api.clearField(selection.qField, field.states[stateIx]);
36664
+ }
36665
+ }, /*#__PURE__*/React.createElement(Remove, null)));
36666
+ }
36667
+
36650
36668
  SegmentsIndicator = /*#__PURE__*/React.createElement("div", {
36651
36669
  style: {
36652
36670
  height: '4px',
@@ -37804,7 +37822,8 @@
37804
37822
  selectDisabled = () => false,
37805
37823
  showGray = true,
37806
37824
  sortByState = 1,
37807
- scrollState = undefined
37825
+ scrollState = undefined,
37826
+ setCount = undefined
37808
37827
  } = options;
37809
37828
  let {
37810
37829
  frequencyMode,
@@ -38093,7 +38112,8 @@
38093
38112
  keyboard: keyboard,
38094
38113
  showGray: showGray,
38095
38114
  scrollState: scrollState,
38096
- sortByState: sortByState
38115
+ sortByState: sortByState,
38116
+ setCount: setCount
38097
38117
  });
38098
38118
  })));
38099
38119
  }
@@ -45283,6 +45303,7 @@
45283
45303
  * @property {ReceiverFunction} [options.update] A function which receives an update function which upon call will trigger a data fetch.
45284
45304
  * @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.
45285
45305
  * @property {number=} [options.sortByState=1] Sort by state, detault 1 = sort descending, 0 = no sorting, -1 sort ascending.
45306
+ * @property {function(number):void} [options.setCount=] A function that gets called with the length of the data in the Listbox.
45286
45307
  */
45287
45308
 
45288
45309
  /**
@@ -45706,7 +45727,7 @@
45706
45727
  var enigmaMocker_dev = {exports: {}};
45707
45728
 
45708
45729
  /*
45709
- * @nebula.js/enigma-mocker v2.10.0
45730
+ * @nebula.js/enigma-mocker v2.11.0
45710
45731
  * Copyright (c) 2022 QlikTech International AB
45711
45732
  * Released under the MIT license.
45712
45733
  */