@nebula.js/stardust 4.0.0-alpha.3 → 4.0.0-alpha.5

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 v4.0.0-alpha.3
2
+ * @nebula.js/stardust v4.0.0-alpha.5
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -1560,6 +1560,26 @@
1560
1560
  "zh-TW": "選取可能值"
1561
1561
  }
1562
1562
  };
1563
+ var SelectionToolbar_ClickToUnlock = {
1564
+ id: "SelectionToolbar.ClickToUnlock",
1565
+ locale: {
1566
+ "de-DE": "Klicken zum Freigeben",
1567
+ "en-US": "Click to unlock",
1568
+ "es-ES": "Haga clic para desbloquearla",
1569
+ "fr-FR": "Cliquez pour déverrouiller",
1570
+ "it-IT": "Fare clic per sbloccare",
1571
+ "ja-JP": "クリックしてロック解除",
1572
+ "ko-KR": "잠금을 해제하려면 클릭하십시오.",
1573
+ "nl-NL": "Klik om te ontgrendelen",
1574
+ "pl-PL": "Aby odblokować, kliknij",
1575
+ "pt-BR": "Clique para destravar",
1576
+ "ru-RU": "Щелкните, чтобы разблокировать",
1577
+ "sv-SE": "Klicka för att låsa upp",
1578
+ "tr-TR": "Kilidi kaldırmak için tıklayın",
1579
+ "zh-CN": "单击以解锁",
1580
+ "zh-TW": "按一下以解除鎖定"
1581
+ }
1582
+ };
1563
1583
  var Visualization_Incomplete = {
1564
1584
  id: "Visualization.Incomplete",
1565
1585
  locale: {
@@ -1731,6 +1751,7 @@
1731
1751
  Selection_SelectAlternative: Selection_SelectAlternative,
1732
1752
  Selection_SelectExcluded: Selection_SelectExcluded,
1733
1753
  Selection_SelectPossible: Selection_SelectPossible,
1754
+ SelectionToolbar_ClickToUnlock: SelectionToolbar_ClickToUnlock,
1734
1755
  Visualization_Incomplete: Visualization_Incomplete,
1735
1756
  Visualization_Incomplete_Dimensions: Visualization_Incomplete_Dimensions,
1736
1757
  Visualization_Incomplete_Measures: Visualization_Incomplete_Measures,
@@ -15399,7 +15420,7 @@
15399
15420
  return cache[key];
15400
15421
  }
15401
15422
 
15402
- const NEBULA_VERSION_HASH = "ee80" ;
15423
+ const NEBULA_VERSION_HASH = "6643" ;
15403
15424
  ClassNameGenerator$1.configure(componentName => {
15404
15425
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
15405
15426
  });
@@ -15607,7 +15628,7 @@
15607
15628
  const appRef = React.createRef();
15608
15629
  const element = document.createElement('div');
15609
15630
  element.style.display = 'none';
15610
- element.setAttribute('data-nebulajs-version', "4.0.0-alpha.3" );
15631
+ element.setAttribute('data-nebulajs-version', "4.0.0-alpha.5" );
15611
15632
  element.setAttribute('data-app-id', app.id);
15612
15633
  document.body.appendChild(element);
15613
15634
  const root = client.createRoot(element);
@@ -22251,6 +22272,16 @@
22251
22272
  return clazzArr;
22252
22273
  };
22253
22274
 
22275
+ const CELL_PADDING_LEFT = 9;
22276
+ const ICON_WIDTH = 12;
22277
+ const ICON_PADDING = 7;
22278
+ const BUTTON_ICON_WIDTH = ICON_WIDTH + (ICON_PADDING + 1) * 2; // 1 is border width
22279
+ const REMOVE_TICK_LIMIT = 80; // an item width equal to or less than this, will hide the select tick
22280
+ const SCROLL_BAR_WIDTH = 10; // TODO: ignore this - instead set the styling only show on hover...
22281
+ const ITEM_MAX_WIDTH = 150;
22282
+ const FREQUENCY_WIDTH = 40;
22283
+ const ITEM_MIN_WIDTH = 56;
22284
+ const CHECKBOX_WIDTH = 20;
22254
22285
  const frequencyTextNone = '-';
22255
22286
  const barPadPx = 4;
22256
22287
  const barBorderWidthPx = 1;
@@ -22270,11 +22301,6 @@
22270
22301
  };
22271
22302
  const getFrequencyText = qFrequency => qFrequency || frequencyTextNone;
22272
22303
 
22273
- const CELL_PADDING_LEFT = 9;
22274
- const ICON_WIDTH = 12;
22275
- const ICON_PADDING = 7;
22276
- const BUTTON_ICON_WIDTH = ICON_WIDTH + (ICON_PADDING + 1) * 2; // 1 is border width
22277
-
22278
22304
  const getSelectedStyle = _ref => {
22279
22305
  let {
22280
22306
  theme
@@ -22300,7 +22326,7 @@
22300
22326
  const iconWidth = 24; // tick and lock icon width in px
22301
22327
 
22302
22328
  const RowColRoot = styled$1('div', {
22303
- shouldForwardProp: prop => !['flexBasisProp', 'isGridMode', 'isGridCol', 'dense', 'frequencyWidth', 'showIcon', 'checkboxes'].includes(prop)
22329
+ shouldForwardProp: prop => !['flexBasisProp', 'isGridMode', 'isGridCol', 'dense', 'frequencyWidth'].includes(prop)
22304
22330
  })(_ref2 => {
22305
22331
  var _theme$listBox$conten, _theme$listBox, _theme$listBox$conten2, _theme$listBox$conten3, _theme$listBox2, _theme$listBox2$conte, _theme$listBox3, _theme$listBox3$conte, _theme$listBox4, _theme$listBox4$conte;
22306
22332
  let {
@@ -22309,9 +22335,7 @@
22309
22335
  isGridMode,
22310
22336
  isGridCol,
22311
22337
  dense,
22312
- frequencyWidth,
22313
- showIcon,
22314
- checkboxes
22338
+ frequencyWidth
22315
22339
  } = _ref2;
22316
22340
  return {
22317
22341
  '&:focus': {
@@ -22356,7 +22380,7 @@
22356
22380
  flexBasis: flexBasisProp,
22357
22381
  lineHeight: '16px',
22358
22382
  userSelect: 'none',
22359
- paddingRight: showIcon || checkboxes ? '1px' : "".concat(iconWidth, "px")
22383
+ paddingRight: '1px'
22360
22384
  }, ellipsis), {}, {
22361
22385
  whiteSpace: 'pre',
22362
22386
  // to keep white-space on highlight
@@ -22394,6 +22418,12 @@
22394
22418
  paddingRight: '2px'
22395
22419
  })
22396
22420
  },
22421
+ ["& .".concat(rowColClasses.checkboxLabel, " .").concat(rowColClasses.labelText)]: {
22422
+ width: 'auto'
22423
+ },
22424
+ ["& .".concat(rowColClasses.checkboxLabel, " .").concat(rowColClasses.labelText, ".").concat(rowColClasses.highlighted)]: {
22425
+ width: 'auto'
22426
+ },
22397
22427
  // The icons container holding tick and lock, shown inside fields.
22398
22428
  ["& .".concat(rowColClasses.icon)]: {
22399
22429
  display: 'flex',
@@ -22428,7 +22458,7 @@
22428
22458
  ["& .".concat(rowColClasses.frequencyCount)]: _objectSpread2(_objectSpread2({
22429
22459
  justifyContent: 'flex-end'
22430
22460
  }, ellipsis), {}, {
22431
- flex: "0 1 ".concat(frequencyWidth + (showIcon || checkboxes ? 0 : iconWidth), "px"),
22461
+ flex: "0 1 ".concat(frequencyWidth, "px"),
22432
22462
  textAlign: 'right',
22433
22463
  paddingLeft: '2px'
22434
22464
  }),
@@ -22734,9 +22764,12 @@
22734
22764
  labels,
22735
22765
  dense,
22736
22766
  showGray,
22737
- checkboxes
22767
+ checkboxes,
22768
+ textDirection
22738
22769
  } = _ref;
22739
- return /*#__PURE__*/React.createElement(React.Fragment, null, labels.map((_ref2, index) => {
22770
+ return /*#__PURE__*/React.createElement("div", {
22771
+ dir: textDirection
22772
+ }, labels.map((_ref2, index) => {
22740
22773
  let [label, highlighted] = _ref2;
22741
22774
  const key = "".concat(index);
22742
22775
  return /*#__PURE__*/React.createElement(ValueField, {
@@ -22762,13 +22795,15 @@
22762
22795
  cell,
22763
22796
  isGridCol,
22764
22797
  isSingleSelect,
22765
- valueTextAlign
22798
+ valueTextAlign,
22799
+ textDirection
22766
22800
  } = _ref3;
22767
22801
  const LWR = /*#__PURE__*/React.createElement(LabelsWithRanges, {
22768
22802
  labels: labels,
22769
22803
  dense: dense,
22770
22804
  showGray: showGray,
22771
- checkboxes: checkboxes
22805
+ checkboxes: checkboxes,
22806
+ textDirection: textDirection
22772
22807
  });
22773
22808
  return checkboxes ? /*#__PURE__*/React.createElement(CheckboxField, {
22774
22809
  onChange: onChange,
@@ -22919,7 +22954,7 @@
22919
22954
  dataLayout,
22920
22955
  layoutOrder,
22921
22956
  itemPadding,
22922
- checkboxes
22957
+ cellPaddingRight
22923
22958
  } = _ref;
22924
22959
  return {
22925
22960
  ["&.".concat(rowColClasses.fieldRoot)]: _objectSpread2(_objectSpread2({}, getGridItemSizes({
@@ -22927,7 +22962,7 @@
22927
22962
  layoutOrder,
22928
22963
  itemPadding
22929
22964
  })), {}, {
22930
- paddingRight: checkboxes ? '8px' : undefined
22965
+ paddingRight: cellPaddingRight ? '8px' : undefined
22931
22966
  })
22932
22967
  };
22933
22968
  });
@@ -22948,6 +22983,55 @@
22948
22983
  return c;
22949
22984
  }
22950
22985
 
22986
+ // Source: https://en.wikipedia.org/wiki/Bi-directional_text and http://www.unicode.org/Public/6.0.0/ucd/UnicodeData.txt
22987
+ // 3 types of strong direction characters: L (strong left-to-right), R(strong right-to-left, Hebrew) and AL(strong right-to-left, Arabic language)
22988
+ const rangesOfLChars = '[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02B8\u02BB-\u02C1\u02D0-\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376-\u037D\u0386\u0388-\u03F5\u03F7-\u0482\u048A-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u097F\u0982-\u09B9\u09BD-\u09C0\u09C7-\u09CC\u09CE-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u0A03-\u0A39\u0A3E-\u0A40\u0A59-\u0A6F\u0A72-\u0A74\u0A83-\u0AB9\u0ABD-\u0AC0\u0AC9-\u0ACC\u0AD0-\u0AE1\u0AE6-\u0AEF\u0B02-\u0B39\u0B3D-\u0B3E\u0B40\u0B47-\u0B4C\u0B57-\u0B61\u0B66-\u0B77\u0B83-\u0BBF\u0BC1-\u0BCC\u0BD0-\u0BF2\u0C01-\u0C3D\u0C41-\u0C44\u0C58-\u0C61\u0C66-\u0C6F\u0C7F-\u0CB9\u0CBD-\u0CCB\u0CD5-\u0CE1\u0CE6-\u0D40\u0D46-\u0D4C\u0D4E-\u0D61\u0D66-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0E30\u0E32-\u0E33\u0E40-\u0E46\u0E4F-\u0EB0\u0EB2-\u0EB3\u0EBD-\u0EC6\u0ED0-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u102C\u1031\u1038\u103B-\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083-\u1084\u1087-\u108C\u108E-\u109C\u109E-\u135A\u1360-\u138F\u13A0-\u13F4\u1401-\u167F\u1681-\u169A\u16A0-\u1711\u1720-\u1731\u1735-\u1751\u1760-\u1770\u1780-\u17B6\u17BE-\u17C5\u17C7-\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u18A8\u18AA-\u191C\u1923-\u1926\u1929-\u1931\u1933-\u1938\u1946-\u19DA\u1A00-\u1A16\u1A19-\u1A55\u1A57\u1A61\u1A63-\u1A64\u1A6D-\u1A72\u1A80-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B6A\u1B74-\u1B7C\u1B82-\u1BA1\u1BA6-\u1BA7\u1BAA-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2-\u1C2B\u1C34-\u1C35\u1C3B-\u1C7F\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1DBF\u1E00-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FFC\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E-\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2D00-\u2D70\u2D80-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u31BA\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA66E\uA680-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA925\uA92E-\uA946\uA952-\uA97C\uA983-\uA9B2\uA9B4-\uA9B5\uA9BA-\uA9BB\uA9BD-\uAA28\uAA2F-\uAA30\uAA33-\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2-\uABE4\uABE6-\uABE7\uABE9-\uABEC\uABF0-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]';
22989
+ const rangesOfRChars = '[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u07C0-\u07EA\u07F4-\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB4F]';
22990
+ const rangesOfALChars = '[\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u070D\u0710\u0712-\u072F\u074D-\u07A5\u07B1\uFB50-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]';
22991
+ const rangesOfNChars = '[\u0009-\u000D\u001C-\u0022\u0026-\u002A\u003B-\u0040\u005B-\u0060\u007B-\u007E\u0085\u00A1\u00A6-\u00A9\u00AB-\u00AC\u00AE-\u00AF\u00B4\u00B6-\u00B8\u00BB-\u00BF\u00D7\u00F7\u02B9-\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u02FF\u0374-\u0375\u037E-\u0385\u0387\u03F6\u058A\u0606-\u0607\u060E-\u060F\u06DE\u06E9\u07F6-\u07F9\u0BF3-\u0BF8\u0BFA\u0C78-\u0C7E\u0F3A-\u0F3D\u1390-\u1399\u1400\u1680\u169B-\u169C\u17F0-\u180A\u180E\u1940-\u1945\u19DE-\u19FF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD-\u200A\u2010-\u2029\u2035-\u2043\u2045-\u205F\u207C-\u207E\u208C-\u208E\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u213A-\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u2211\u2214-\u2335\u237B-\u2394\u2396-\u2487\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B59\u2CE5-\u2CEA\u2CF9-\u2CFF\u2E00-\u3004\u3008-\u3020\u3030\u3036-\u3037\u303D-\u303F\u309B-\u309C\u30A0\u30FB\u31C0-\u31E3\u321D-\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE-\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA673\uA67E-\uA67F\uA700-\uA721\uA788\uA828-\uA82B\uA874-\uA877\uFD3E-\uFD3F\uFDFD\uFE10-\uFE19\uFE30-\uFE4F\uFE51\uFE54\uFE56-\uFE5E\uFE60-\uFE61\uFE64-\uFE68\uFE6B\uFF01-\uFF02\uFF06-\uFF0A\uFF1B-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE2-\uFFE4\uFFE8-\uFFFD]';
22992
+ // eslint-disable-next-line no-misleading-character-class
22993
+ const rangesOfLRgExp = new RegExp(rangesOfLChars);
22994
+ const rangesOfRRgExp = new RegExp(rangesOfRChars);
22995
+ const rangesOfALRgExp = new RegExp(rangesOfALChars);
22996
+ const rangesOfNRgExp = new RegExp(rangesOfNChars);
22997
+ const
22998
+ // left-to-right marker
22999
+ lrm = String.fromCharCode(8206); // right-to-left marker
23000
+
23001
+ const rlm = String.fromCharCode(8207);
23002
+ function isLtrChar(c) {
23003
+ return rangesOfLRgExp.test(c);
23004
+ }
23005
+ function isRtlChar(c) {
23006
+ return rangesOfRRgExp.test(c) || rangesOfALRgExp.test(c);
23007
+ }
23008
+ function isNeutralChar(c) {
23009
+ return rangesOfNRgExp.test(c);
23010
+ }
23011
+ function detectTextDirection(s) {
23012
+ const n = s ? s.length : 0;
23013
+ let i;
23014
+ let c;
23015
+ for (i = 0; i < n; i++) {
23016
+ c = s[i];
23017
+ if (isLtrChar(c)) {
23018
+ return 'ltr';
23019
+ }
23020
+ if (isRtlChar(c)) {
23021
+ return 'rtl';
23022
+ }
23023
+ }
23024
+ return 'ltr';
23025
+ }
23026
+ var rtlUtil = {
23027
+ detectTextDirection,
23028
+ isLtrChar,
23029
+ isRtlChar,
23030
+ isNeutralChar,
23031
+ lrm,
23032
+ rlm
23033
+ };
23034
+
22951
23035
  function RowColumn(_ref) {
22952
23036
  var _cell$qText, _cell$qHighlightRange, _cell$qHighlightRange2;
22953
23037
  let {
@@ -22977,7 +23061,7 @@
22977
23061
  histogram = false,
22978
23062
  keyboard,
22979
23063
  showGray = true,
22980
- showTick: sizePermitsTick = true,
23064
+ showTick: sizePermitsTickOrLock = true,
22981
23065
  columnCount = 1,
22982
23066
  rowCount = 1,
22983
23067
  dataOffset,
@@ -23073,7 +23157,7 @@
23073
23157
  }
23074
23158
  const isGridCol = dataLayout === 'grid' && layoutOrder === 'column';
23075
23159
  const label = (_cell$qText = cell === null || cell === void 0 ? void 0 : cell.qText) !== null && _cell$qText !== void 0 ? _cell$qText : '';
23076
-
23160
+ const textDirection = rtlUtil.detectTextDirection(label);
23077
23161
  // Search highlights. Split up labelText span into several and add the highlighted class to matching sub-strings.
23078
23162
 
23079
23163
  let labels;
@@ -23098,23 +23182,23 @@
23098
23182
  const isFirstElement = index === 0;
23099
23183
  const flexBasisVal = checkboxes ? 'auto' : 'max-content';
23100
23184
  const showLock = isSelected && isLocked;
23101
- const showTick = !checkboxes && isSelected && !isLocked && sizePermitsTick;
23102
- const showIcon = !checkboxes && (showTick || showLock);
23185
+ const showTick = !checkboxes && isSelected && !isLocked;
23186
+ const showIcon = !checkboxes && sizePermitsTickOrLock;
23187
+ const cellPaddingRight = checkboxes || !sizePermitsTickOrLock;
23103
23188
  return /*#__PURE__*/React.createElement(RowColRoot$1, {
23104
23189
  className: rowColClasses.barContainer,
23105
23190
  flexBasisProp: flexBasisVal,
23106
23191
  style: styles,
23107
- showIcon: showIcon,
23108
- checkboxes: checkboxes,
23109
23192
  isGridCol: isGridCol,
23110
23193
  isGridMode: dataLayout === 'grid',
23111
23194
  dense: dense,
23112
- frequencyWidth: frequencyWidth
23195
+ frequencyWidth: frequencyWidth,
23196
+ "data-testid": "listbox.item"
23113
23197
  }, /*#__PURE__*/React.createElement(ItemGrid, {
23114
23198
  ref: rowRef,
23115
23199
  container: true,
23116
23200
  dataLayout: dataLayout,
23117
- checkboxes: checkboxes,
23201
+ cellPaddingRight: cellPaddingRight,
23118
23202
  layoutOrder: layoutOrder,
23119
23203
  itemPadding: itemPadding,
23120
23204
  gap: 0,
@@ -23155,7 +23239,8 @@
23155
23239
  cell: cell,
23156
23240
  isGridCol: isGridCol,
23157
23241
  isSingleSelect: isSingleSelect,
23158
- valueTextAlign: valueTextAlign
23242
+ valueTextAlign: valueTextAlign,
23243
+ textDirection: textDirection
23159
23244
  }) : /*#__PURE__*/React.createElement(Field$1, {
23160
23245
  onChange: onChange,
23161
23246
  label: label,
@@ -24711,8 +24796,6 @@
24711
24796
  overflowDisclaimer.set(show);
24712
24797
  }
24713
24798
 
24714
- const REMOVE_TICK_LIMIT = 80; // an item width equal to or less than this, will hide the select tick
24715
-
24716
24799
  const {
24717
24800
  StyledFixedSizeList,
24718
24801
  StyledFixedSizeGrid
@@ -24941,12 +25024,6 @@
24941
25024
  };
24942
25025
  }
24943
25026
 
24944
- const SCROLL_BAR_WIDTH = 10; // TODO: ignore this - instead set the styling only show on hover...
24945
- const ITEM_MAX_WIDTH = 150;
24946
- const FREQUENCY_WIDTH = 40;
24947
- const ITEM_MIN_WIDTH = 56;
24948
- const CHECKBOX_WIDTH = 20;
24949
-
24950
25027
  function calculateRowMode(_ref) {
24951
25028
  let {
24952
25029
  maxVisibleColumns,
@@ -24958,7 +25035,7 @@
24958
25035
  const maxColumns = (maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.maxColumns) || 3;
24959
25036
  const innerWidth = containerWidth - SCROLL_BAR_WIDTH;
24960
25037
  let columnCount;
24961
- const autoColumnCount = Math.min(listCount, Math.ceil(innerWidth / Math.max(itemMinWidth, columnAutoWidth))); // TODO: smarter sizing... based on glyph count + font size etc...??
25038
+ const autoColumnCount = Math.min(listCount, Math.max(1, Math.round(innerWidth / Math.max(itemMinWidth, columnAutoWidth)))); // TODO: smarter sizing... based on glyph count + font size etc...??
24962
25039
  if ((maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.auto) !== false) {
24963
25040
  columnCount = autoColumnCount;
24964
25041
  } else {
@@ -24996,8 +25073,16 @@
24996
25073
  } = layoutOptions;
24997
25074
  const frequencyAddWidth = freqIsAllowed ? FREQUENCY_WIDTH : 0;
24998
25075
  const checkboxAddWidth = checkboxes ? CHECKBOX_WIDTH : 0;
24999
- const dynamicItemMinWidth = ITEM_MIN_WIDTH + frequencyAddWidth + checkboxAddWidth;
25000
- const columnAutoWidth = Math.max(Math.min(ITEM_MAX_WIDTH, textWidth + 18 + frequencyAddWidth + checkboxAddWidth), dynamicItemMinWidth);
25076
+ const tickIconWidth = CHECKBOX_WIDTH;
25077
+ let dynamicItemMinWidth = ITEM_MIN_WIDTH + frequencyAddWidth + checkboxAddWidth;
25078
+ if (!checkboxes && dynamicItemMinWidth >= REMOVE_TICK_LIMIT) {
25079
+ dynamicItemMinWidth += tickIconWidth;
25080
+ }
25081
+ let columnAutoWidth = textWidth + 18 + frequencyAddWidth + checkboxAddWidth;
25082
+ if (!checkboxes && columnAutoWidth >= REMOVE_TICK_LIMIT) {
25083
+ columnAutoWidth += tickIconWidth;
25084
+ }
25085
+ columnAutoWidth = Math.min(ITEM_MAX_WIDTH, Math.max(columnAutoWidth, dynamicItemMinWidth));
25001
25086
  let overflowStyling;
25002
25087
  let columnCount;
25003
25088
  let columnWidth;
@@ -25444,7 +25529,10 @@
25444
25529
  if (!field) {
25445
25530
  return field;
25446
25531
  }
25447
- return "".concat(field.replace(/\]/g, ']]'));
25532
+ if (/^[A-Za-z][A-Za-z0-9_]*$/.test(field)) {
25533
+ return field;
25534
+ }
25535
+ return "[".concat(field.replace(/\]/g, ']]'), "]");
25448
25536
  };
25449
25537
  const needToFetchFrequencyMax = layout => (layout === null || layout === void 0 ? void 0 : layout.frequencyMax) === 'fetch';
25450
25538
  const getFrequencyMaxExpression = field => {
@@ -25568,7 +25656,7 @@
25568
25656
  });
25569
25657
  if (itemsLoader.pages.length && !awaitingFrequencyMax) {
25570
25658
  // All necessary data fetching done - signal rendering done!
25571
- renderedCallback();
25659
+ renderedCallback === null || renderedCallback === void 0 ? void 0 : renderedCallback();
25572
25660
  }
25573
25661
  }
25574
25662
  const isItemLoaded = reactExports.useCallback(index => {
@@ -25958,7 +26046,8 @@
25958
26046
  size: "large",
25959
26047
  disableRipple: true,
25960
26048
  "aria-expanded": ariaExpanded,
25961
- "aria-controls": "moreMenuList"
26049
+ "aria-controls": "moreMenuList",
26050
+ "data-testid": "actions-toolbar-".concat(item.key)
25962
26051
  }, hasSvgIconShape && SvgIcon(item.getSvgIconShape()), addAnchor && /*#__PURE__*/React.createElement("div", {
25963
26052
  ref: ref,
25964
26053
  style: {
@@ -26214,15 +26303,12 @@
26214
26303
  const popoverStyle = {
26215
26304
  pointerEvents: 'none'
26216
26305
  };
26217
- const popoverAnchorOrigin = {
26218
- vertical: 'top',
26219
- horizontal: 'right'
26220
- };
26221
26306
  const popoverTransformOrigin = {
26222
26307
  vertical: 'bottom',
26223
26308
  horizontal: 'right'
26224
26309
  };
26225
26310
  function ActionsToolbar(_ref3) {
26311
+ var _popover$anchorEl$cli, _popover$anchorEl;
26226
26312
  let {
26227
26313
  show = true,
26228
26314
  actions = [],
@@ -26261,6 +26347,10 @@
26261
26347
  const dividerStyle = reactExports.useMemo(() => ({
26262
26348
  margin: theme.spacing(0.5, 0)
26263
26349
  }));
26350
+ const popoverAnchorOrigin = {
26351
+ vertical: 15,
26352
+ horizontal: ((_popover$anchorEl$cli = (_popover$anchorEl = popover.anchorEl) === null || _popover$anchorEl === void 0 ? void 0 : _popover$anchorEl.clientWidth) !== null && _popover$anchorEl$cli !== void 0 ? _popover$anchorEl$cli : 0) - 7
26353
+ };
26264
26354
  const getEnabledButton = last => {
26265
26355
  const actionsElement = actionsRef.current || actionsRefMock;
26266
26356
  if (!actionsElement) return null;
@@ -28475,19 +28565,20 @@
28475
28565
  listboxWrapper: "".concat(PREFIX$4, "-listboxWrapper")
28476
28566
  };
28477
28567
  const StyledGrid$3 = styled$1(Grid$1, {
28478
- shouldForwardProp: p => !['containerPadding'].includes(p)
28568
+ shouldForwardProp: p => !['containerPadding', 'hasIcon'].includes(p)
28479
28569
  })(_ref => {
28480
28570
  var _theme$listBox$backgr, _theme$listBox;
28481
28571
  let {
28482
28572
  theme,
28483
- containerPadding
28573
+ containerPadding,
28574
+ hasIcon
28484
28575
  } = _ref;
28485
28576
  return {
28486
28577
  backgroundColor: (_theme$listBox$backgr = (_theme$listBox = theme.listBox) === null || _theme$listBox === void 0 ? void 0 : _theme$listBox.backgroundColor) !== null && _theme$listBox$backgr !== void 0 ? _theme$listBox$backgr : theme.palette.background.default,
28487
28578
  ["& .".concat(classes$4.listBoxHeader)]: {
28488
28579
  alignSelf: 'center',
28489
28580
  display: 'flex',
28490
- width: "calc(100% - ".concat(BUTTON_ICON_WIDTH, "px)")
28581
+ width: "calc(100% - ".concat(hasIcon ? BUTTON_ICON_WIDTH : 0, "px)")
28491
28582
  },
28492
28583
  ["& .".concat(classes$4.screenReaderOnly)]: {
28493
28584
  position: 'absolute',
@@ -28618,9 +28709,6 @@
28618
28709
  reactExports.useEffect(() => {
28619
28710
  const show = () => {
28620
28711
  setShowToolbar(true);
28621
- if (search === 'toggle' && toolbar === false) {
28622
- setShowSearch(true);
28623
- }
28624
28712
  };
28625
28713
  const hide = () => {
28626
28714
  setShowToolbar(false);
@@ -28698,7 +28786,7 @@
28698
28786
  selections
28699
28787
  });
28700
28788
  const shouldAutoFocus = searchVisible && search === 'toggle';
28701
- const showSearchIcon = searchEnabled !== false && search === 'toggle' && !(constraints !== null && constraints !== void 0 && constraints.active);
28789
+ const showSearchIcon = searchEnabled !== false && search === 'toggle';
28702
28790
  const showSearchOrLockIcon = isLocked || showSearchIcon;
28703
28791
  const showIcons = showSearchOrLockIcon || isDrillDown;
28704
28792
  const iconsWidth = (showSearchOrLockIcon ? BUTTON_ICON_WIDTH : 0) + (isDrillDown ? ICON_WIDTH + ICON_PADDING : 0); // Drill-down icon needs padding right so there is space between the icon and the title
@@ -28711,6 +28799,42 @@
28711
28799
  if (isGridMode) {
28712
28800
  containerPadding = layoutOptions.layoutOrder === 'row' ? '2px 4px' : '2px 6px 2px 4px';
28713
28801
  }
28802
+ const searchIconComp = constraints !== null && constraints !== void 0 && constraints.active ? /*#__PURE__*/React.createElement(SearchIcon, {
28803
+ title: translator.get('Listbox.Search'),
28804
+ size: "large",
28805
+ style: {
28806
+ fontSize: '12px',
28807
+ padding: '7px'
28808
+ }
28809
+ }) : /*#__PURE__*/React.createElement(IconButton$1, {
28810
+ onClick: onShowSearch,
28811
+ tabIndex: -1,
28812
+ title: translator.get('Listbox.Search'),
28813
+ size: "large",
28814
+ disableRipple: true,
28815
+ "data-testid": "search-toggle-btn"
28816
+ }, /*#__PURE__*/React.createElement(SearchIcon, {
28817
+ style: {
28818
+ fontSize: '12px'
28819
+ }
28820
+ }));
28821
+ const lockIconComp = selectDisabled() ? /*#__PURE__*/React.createElement(Lock, {
28822
+ size: "large",
28823
+ style: {
28824
+ fontSize: '12px',
28825
+ padding: '7px'
28826
+ }
28827
+ }) : /*#__PURE__*/React.createElement(IconButton$1, {
28828
+ title: translator.get('SelectionToolbar.ClickToUnlock'),
28829
+ tabIndex: -1,
28830
+ onClick: unlock,
28831
+ size: "large"
28832
+ }, /*#__PURE__*/React.createElement(Lock, {
28833
+ disableRipple: true,
28834
+ style: {
28835
+ fontSize: '12px'
28836
+ }
28837
+ }));
28714
28838
  return /*#__PURE__*/React.createElement(React.Fragment, null, toolbarDetachedOnly && /*#__PURE__*/React.createElement(ActionsToolbar, _extends$8({
28715
28839
  direction: direction
28716
28840
  }, getActionToolbarProps(true))), /*#__PURE__*/React.createElement(StyledGrid$3, {
@@ -28728,7 +28852,8 @@
28728
28852
  onKeyDown: handleKeyDown,
28729
28853
  onMouseEnter: handleOnMouseEnter,
28730
28854
  onMouseLeave: handleOnMouseLeave,
28731
- ref: containerRef
28855
+ ref: containerRef,
28856
+ hasIcon: showIcons
28732
28857
  }, toolbar && /*#__PURE__*/React.createElement(Grid$1, {
28733
28858
  item: true,
28734
28859
  container: true,
@@ -28756,29 +28881,7 @@
28756
28881
  alignItems: 'center',
28757
28882
  width: iconsWidth
28758
28883
  }
28759
- }, isLocked ? /*#__PURE__*/React.createElement(IconButton$1, {
28760
- title: translator.get('SelectionToolbar.ClickToUnlock'),
28761
- tabIndex: -1,
28762
- onClick: unlock,
28763
- disabled: selectDisabled(),
28764
- size: "large"
28765
- }, /*#__PURE__*/React.createElement(Lock, {
28766
- disableRipple: true,
28767
- style: {
28768
- fontSize: '12px'
28769
- }
28770
- })) : showSearchIcon && /*#__PURE__*/React.createElement(IconButton$1, {
28771
- onClick: onShowSearch,
28772
- tabIndex: -1,
28773
- title: translator.get('Listbox.Search'),
28774
- size: "large",
28775
- disableRipple: true,
28776
- "data-testid": "search-toggle-btn"
28777
- }, /*#__PURE__*/React.createElement(SearchIcon, {
28778
- style: {
28779
- fontSize: '12px'
28780
- }
28781
- })), isDrillDown && /*#__PURE__*/React.createElement(DrillDownIcon, {
28884
+ }, isLocked ? lockIconComp : showSearchIcon && searchIconComp, isDrillDown && /*#__PURE__*/React.createElement(DrillDownIcon, {
28782
28885
  tabIndex: -1,
28783
28886
  title: translator.get('Listbox.DrillDown'),
28784
28887
  size: "large",
@@ -31314,12 +31417,21 @@
31314
31417
  });
31315
31418
  return sn;
31316
31419
  } catch (err) {
31317
- dispatch({
31318
- type: 'ERROR',
31319
- error: {
31320
- title: err.message
31321
- }
31322
- });
31420
+ if (!version) {
31421
+ dispatch({
31422
+ type: 'ERROR',
31423
+ error: {
31424
+ title: "Could not find a version of '".concat(visualization, "' that supports current object version. Did you forget to register ").concat(visualization, "?")
31425
+ }
31426
+ });
31427
+ } else {
31428
+ dispatch({
31429
+ type: 'ERROR',
31430
+ error: {
31431
+ title: err.message
31432
+ }
31433
+ });
31434
+ }
31323
31435
  }
31324
31436
  return undefined;
31325
31437
  };
@@ -31476,15 +31588,6 @@
31476
31588
 
31477
31589
  // Load supernova
31478
31590
  const withVersion = types.getSupportedVersion(layout.visualization, layout.version);
31479
- if (!withVersion) {
31480
- dispatch({
31481
- type: 'ERROR',
31482
- error: {
31483
- title: "Could not find a version of '".concat(layout.visualization, "' that supports current object version. Did you forget to register ").concat(layout.visualization, "?")
31484
- }
31485
- });
31486
- return undefined;
31487
- }
31488
31591
  load(layout.visualization, withVersion);
31489
31592
  return () => {};
31490
31593
  }, [types, state.sn, model, selections, layout, appLayout, language]);