@nebula.js/stardust 4.0.0-alpha.0 → 4.0.0-alpha.2

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 v4.0.0-alpha.0
2
+ * @nebula.js/stardust v4.0.0-alpha.2
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -8,7 +8,7 @@ import * as React from 'react';
8
8
  import React__default, { useState as useState$1, useEffect as useEffect$1, forwardRef, useMemo as useMemo$1, useImperativeHandle as useImperativeHandle$1, useReducer, useCallback, useLayoutEffect as useLayoutEffect$1, PureComponent, useRef, createElement, useContext } from 'react';
9
9
  import ReactDOM from 'react-dom';
10
10
  import { CacheProvider, ThemeContext as ThemeContext$2 } from '@emotion/react';
11
- import { Checkbox, Radio, Typography, FormControlLabel, Grid, Tooltip, Paper, IconButton, Popover, MenuList, MenuItem, ListItemIcon, Divider, InputAdornment, OutlinedInput, Badge, List, ListItem, Button, Box, Icon, CircularProgress } from '@mui/material';
11
+ import { Checkbox, Radio, Typography, FormControlLabel, Box, Grid, Tooltip, Paper, IconButton, Popover, MenuList, MenuItem, ListItemIcon, Divider, InputAdornment, OutlinedInput, Badge, List, ListItem, Button, Icon, CircularProgress } from '@mui/material';
12
12
  import styled$3 from '@emotion/styled';
13
13
 
14
14
  function getAugmentedNamespace(n) {
@@ -973,6 +973,26 @@ var Listbox_Dismiss = {
973
973
  "zh-TW": "解除"
974
974
  }
975
975
  };
976
+ var Listbox_DrillDown = {
977
+ id: "Listbox.DrillDown",
978
+ locale: {
979
+ "de-DE": "Drilldown-Dimension",
980
+ "en-US": "Drill-down dimension",
981
+ "es-ES": "Dimensión jerárquica",
982
+ "fr-FR": "Dimension hiérarchique",
983
+ "it-IT": "Dimensione drill-down",
984
+ "ja-JP": "軸のドリルダウン",
985
+ "ko-KR": "드릴다운 차원",
986
+ "nl-NL": "Drill-downdimensie",
987
+ "pl-PL": "Wymiar hierarchiczny",
988
+ "pt-BR": "Dimensão de detalhamento",
989
+ "ru-RU": "Детализированное измерение",
990
+ "sv-SE": "Hierarkisk dimension",
991
+ "tr-TR": "Detaya inme boyutu",
992
+ "zh-CN": "钻取维度",
993
+ "zh-TW": "向下探查維度"
994
+ }
995
+ };
976
996
  var Listbox_ItemsOverflow = {
977
997
  id: "Listbox.ItemsOverflow",
978
998
  locale: {
@@ -1613,17 +1633,12 @@ var Visualization_UnfulfilledCalculationCondition = {
1613
1633
  "zh-TW": "不符計算條件"
1614
1634
  }
1615
1635
  };
1616
- var Listbox_DrillDown = {
1617
- id: "Listbox.DrillDown",
1618
- locale: {
1619
- "en-US": "Drill-down dimension"
1620
- }
1621
- };
1622
1636
  var all = {
1623
1637
  Cancel: Cancel$1,
1624
1638
  CurrentSelections_All: CurrentSelections_All,
1625
1639
  CurrentSelections_Of: CurrentSelections_Of,
1626
1640
  Listbox_Dismiss: Listbox_Dismiss,
1641
+ Listbox_DrillDown: Listbox_DrillDown,
1627
1642
  Listbox_ItemsOverflow: Listbox_ItemsOverflow,
1628
1643
  Listbox_Lock: Listbox_Lock,
1629
1644
  Listbox_NoMatchesForYourTerms: Listbox_NoMatchesForYourTerms,
@@ -1655,8 +1670,7 @@ var all = {
1655
1670
  Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
1656
1671
  Visualization_Invalid_Measure: Visualization_Invalid_Measure,
1657
1672
  Visualization_LayoutError: Visualization_LayoutError,
1658
- Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition,
1659
- Listbox_DrillDown: Listbox_DrillDown
1673
+ Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
1660
1674
  };
1661
1675
 
1662
1676
  function appLocaleFn(language) {
@@ -2737,9 +2751,34 @@ var darkRawJSON = {
2737
2751
  color: color$1
2738
2752
  };
2739
2753
 
2754
+ var object = {
2755
+ listBox: {
2756
+ backgroundColor: "#ffffff",
2757
+ title: {
2758
+ main: {
2759
+ color: "#404040",
2760
+ fontSize: "14px",
2761
+ fontWeight: "bold"
2762
+ }
2763
+ },
2764
+ content: {
2765
+ color: "#404040",
2766
+ fontSize: "12px"
2767
+ }
2768
+ }
2769
+ };
2770
+ var baseInheritRawJSON = {
2771
+ object: object
2772
+ };
2773
+
2774
+ /* eslint no-underscore-dangle:0 */
2740
2775
  function setTheme(t, resolve) {
2741
2776
  const colorRawJSON = t.type === 'dark' ? darkRawJSON : lightRawJSON;
2742
- const root = extend$1(true, {}, baseRawJSON, colorRawJSON);
2777
+ let baseInherit = baseInheritRawJSON;
2778
+ if (t._inherit === false || t._inherit === 'false') {
2779
+ baseInherit = {};
2780
+ }
2781
+ const root = extend$1(true, {}, baseRawJSON, colorRawJSON, baseInherit);
2743
2782
  // avoid merging known array objects as it could cause issues if they are of different types (pyramid vs class) or length
2744
2783
  const rawThemeJSON = extend$1(true, {}, root, {
2745
2784
  scales: null,
@@ -3383,15 +3422,21 @@ const LOAD_THEME_TIMEOUT = 5000;
3383
3422
  function appTheme() {
3384
3423
  let {
3385
3424
  themes = [],
3425
+ loadTheme,
3386
3426
  root
3387
3427
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3388
3428
  const wrappedTheme = theme();
3389
3429
  const setTheme = async themeId => {
3390
- const found = themes.filter(t => t.id === themeId)[0];
3430
+ let found = themes.filter(t => t.id === themeId)[0];
3391
3431
  let muiTheme = themeId === 'dark' ? 'dark' : 'light';
3432
+ if (!found && loadTheme) {
3433
+ found = {
3434
+ load: loadTheme
3435
+ };
3436
+ }
3392
3437
  if (found && found.load) {
3393
3438
  try {
3394
- const raw = await Promise.race([found.load(), timed(LOAD_THEME_TIMEOUT, {
3439
+ const raw = await Promise.race([found.load(themeId), timed(LOAD_THEME_TIMEOUT, {
3395
3440
  __timedOut: true
3396
3441
  })]);
3397
3442
  if (raw.__timedOut) {
@@ -7756,7 +7801,7 @@ const light = {
7756
7801
  disabled: 'rgba(0, 0, 0, 0.3)'
7757
7802
  },
7758
7803
  action: {
7759
- active: colors.grey25,
7804
+ active: '#545454',
7760
7805
  // color for actionable things like icon buttons
7761
7806
  hover: 'rgba(0, 0, 0, 0.03)',
7762
7807
  // color for hoverable things like list items
@@ -7896,10 +7941,21 @@ const overrides = theme => ({
7896
7941
  padding: 7,
7897
7942
  borderRadius: 2,
7898
7943
  border: '1px solid transparent',
7899
- // should ideally use $focusVisible, but that messes up focus in all other places where Iconbutton is used (Checkbox, Switch etc)
7900
- '&:focus': {
7944
+ '&:hover': {
7945
+ backgroundColor: theme.palette.btn.hover
7946
+ },
7947
+ '&:focus-visible': {
7901
7948
  borderColor: theme.palette.custom.focusBorder,
7902
7949
  boxShadow: "0 0 0 2px ".concat(theme.palette.custom.focusOutline)
7950
+ },
7951
+ '&:active': {
7952
+ borderColor: 'transparent',
7953
+ boxShadow: 'none',
7954
+ backgroundColor: theme.palette.btn.active
7955
+ },
7956
+ '&:not(:active):not(:focus-visible)': {
7957
+ borderColor: 'transparent',
7958
+ boxShadow: 'none'
7903
7959
  }
7904
7960
  }
7905
7961
  },
@@ -7987,7 +8043,7 @@ function create$3(definition) {
7987
8043
  return cache[key];
7988
8044
  }
7989
8045
 
7990
- const NEBULA_VERSION_HASH = "b1a6" ;
8046
+ const NEBULA_VERSION_HASH = "9a45" ;
7991
8047
  ClassNameGenerator$1.configure(componentName => {
7992
8048
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
7993
8049
  });
@@ -8195,7 +8251,7 @@ function boot(_ref2) {
8195
8251
  const appRef = React__default.createRef();
8196
8252
  const element = document.createElement('div');
8197
8253
  element.style.display = 'none';
8198
- element.setAttribute('data-nebulajs-version', "4.0.0-alpha.0" );
8254
+ element.setAttribute('data-nebulajs-version', "4.0.0-alpha.2" );
8199
8255
  element.setAttribute('data-app-id', app.id);
8200
8256
  document.body.appendChild(element);
8201
8257
  const root = client.createRoot(element);
@@ -9067,7 +9123,7 @@ function useSelectionsInteractions(_ref) {
9067
9123
  doSelect();
9068
9124
  }, []);
9069
9125
  const onMouseDown = useCallback(event => {
9070
- if (selectionState.selectDisabled()) {
9126
+ if (event.button !== 0 || selectionState.selectDisabled()) {
9071
9127
  return;
9072
9128
  }
9073
9129
  const elemNumber = +event.currentTarget.getAttribute('data-n');
@@ -9088,7 +9144,7 @@ function useSelectionsInteractions(_ref) {
9088
9144
  handleSingleSelectKey(event, event.currentTarget);
9089
9145
  }, []);
9090
9146
  const onMouseUp = useCallback(event => {
9091
- if (!currentSelect.current.active) {
9147
+ if (event.button !== 0 || !currentSelect.current.active) {
9092
9148
  return;
9093
9149
  }
9094
9150
  currentSelect.current.active = false;
@@ -9098,9 +9154,9 @@ function useSelectionsInteractions(_ref) {
9098
9154
  }
9099
9155
  doSelect();
9100
9156
  }, []);
9101
- const onMouseUpDoc = useCallback(() => {
9157
+ const onMouseUpDoc = useCallback(event => {
9102
9158
  // Ensure we end interactions when mouseup happens outside the Listbox.
9103
- if (!currentSelect.current.active) {
9159
+ if (event.button !== 0 || !currentSelect.current.active) {
9104
9160
  return;
9105
9161
  }
9106
9162
  currentSelect.current.active = false;
@@ -9127,17 +9183,19 @@ function useSelectionsInteractions(_ref) {
9127
9183
  };
9128
9184
  }, [onMouseUpDoc]);
9129
9185
  useEffect$1(() => {
9130
- const onDeactivated = () => {
9186
+ const clearItemStates = () => {
9131
9187
  selectionState.clearItemStates(false);
9132
9188
  };
9133
9189
  const onCleared = () => {
9134
9190
  selectionState.clearItemStates(true);
9135
9191
  selectionState.triggerStateChanged();
9136
9192
  };
9137
- selections.on('deactivated', onDeactivated);
9193
+ selections.on('clearItemStates', clearItemStates);
9194
+ selections.on('deactivated', clearItemStates);
9138
9195
  selections.on('cleared', onCleared);
9139
9196
  return () => {
9140
- selections.removeListener('activated', onDeactivated);
9197
+ selections.removeListener('clearItemStates', clearItemStates);
9198
+ selections.removeListener('deactivated', clearItemStates);
9141
9199
  selections.removeListener('cleared', onCleared);
9142
9200
  };
9143
9201
  }, [selections]);
@@ -9367,15 +9425,29 @@ function getListboxInlineKeyboardNavigation(_ref2) {
9367
9425
  constraints
9368
9426
  } = _ref2;
9369
9427
  const focusInsideListbox = element => {
9370
- const fieldElement = element.querySelector('.search input, .value.selector, .value, .ActionsToolbar-* button');
9428
+ const fieldElement = element.querySelector('.search input, .value.selector, .value, .ActionsToolbar-item button');
9371
9429
  setKeyboardActive(true);
9372
9430
  if (fieldElement) {
9373
9431
  fieldElement.focus();
9374
9432
  }
9375
9433
  };
9376
- const focusContainer = element => {
9377
- setKeyboardActive(false);
9378
- element.focus();
9434
+ const changeFocus = event => {
9435
+ var _event$target;
9436
+ if ((_event$target = event.target) !== null && _event$target !== void 0 && _event$target.classList.contains('listbox-container')) {
9437
+ // Focus currently on a listbox
9438
+ // Esc on a list box should move the focus to its parent, i.e. a filter pane if any
9439
+ setKeyboardActive(false);
9440
+ } else {
9441
+ var _event$target2, _event$target3, _event$currentTarget, _event$currentTarget2;
9442
+ // Focus currently on a row
9443
+ // Esc on a row should move the focus to its parent, i.e. a listbox
9444
+ // First unfocus the row
9445
+ (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.setAttribute('tabIndex', '-1');
9446
+ (_event$target3 = event.target) === null || _event$target3 === void 0 ? void 0 : _event$target3.blur();
9447
+ // Then focus the listbox
9448
+ (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.setAttribute('tabIndex', '0');
9449
+ (_event$currentTarget2 = event.currentTarget) === null || _event$currentTarget2 === void 0 ? void 0 : _event$currentTarget2.focus();
9450
+ }
9379
9451
  };
9380
9452
  const updateKeyScrollOnHover = newState => {
9381
9453
  if (hovering) {
@@ -9399,7 +9471,7 @@ function getListboxInlineKeyboardNavigation(_ref2) {
9399
9471
  focusInsideListbox(event.currentTarget);
9400
9472
  break;
9401
9473
  case KEYS.ESCAPE:
9402
- focusContainer(event.currentTarget);
9474
+ changeFocus(event);
9403
9475
  break;
9404
9476
  case KEYS.ARROW_UP:
9405
9477
  updateKeyScrollOnHover({
@@ -9411,6 +9483,10 @@ function getListboxInlineKeyboardNavigation(_ref2) {
9411
9483
  down: 1
9412
9484
  });
9413
9485
  break;
9486
+ case KEYS.ARROW_LEFT:
9487
+ case KEYS.ARROW_RIGHT:
9488
+ return;
9489
+ // let it propagate to top-level
9414
9490
  case KEYS.PAGE_UP:
9415
9491
  updateKeyScrollOnHover({
9416
9492
  up: currentScrollIndex.stop - currentScrollIndex.start
@@ -9538,28 +9614,20 @@ const joinClassNames = namesArray => namesArray.filter(c => !!c).join(' ').trim(
9538
9614
  const getBarWidth = _ref => {
9539
9615
  let {
9540
9616
  qFrequency,
9541
- checkboxes,
9542
9617
  frequencyMax
9543
9618
  } = _ref;
9544
9619
  const freqStr = String(qFrequency);
9545
9620
  const isPercent = freqStr.substring(freqStr.length - 1) === '%';
9546
9621
  const freq = parseFloat(isPercent ? freqStr : qFrequency);
9547
- const rightSlice = checkboxes ? "(".concat(barWithCheckboxLeftPadPx, "px + ").concat(barPadPx + barBorderWidthPx * 2, "px)") : "".concat(barPadPx * 2 + barBorderWidthPx * 2, "px");
9548
9622
  const width = isPercent ? freq : freq / frequencyMax * 100;
9549
- return "calc(".concat(width, "% - ").concat(rightSlice, ")");
9550
- };
9551
- const getFrequencyText = _ref2 => {
9552
- let {
9553
- cell
9554
- } = _ref2;
9555
- if (cell) {
9556
- return cell.qFrequency ? cell.qFrequency : frequencyTextNone;
9557
- }
9558
- return '';
9623
+ return "".concat(width, "%");
9559
9624
  };
9625
+ const getFrequencyText = qFrequency => qFrequency || frequencyTextNone;
9560
9626
 
9561
- const ICON_PADDING = 7;
9562
9627
  const CELL_PADDING_LEFT = 9;
9628
+ const ICON_WIDTH = 12;
9629
+ const ICON_PADDING = 7;
9630
+ const BUTTON_ICON_WIDTH = ICON_WIDTH + (ICON_PADDING + 1) * 2; // 1 is border width
9563
9631
 
9564
9632
  const getSelectedStyle = _ref => {
9565
9633
  let {
@@ -9583,8 +9651,10 @@ const ellipsis = {
9583
9651
  textOverflow: 'ellipsis',
9584
9652
  whiteSpace: 'nowrap'
9585
9653
  };
9654
+ const iconWidth = 24; // tick and lock icon width in px
9655
+
9586
9656
  const RowColRoot = styled$1('div', {
9587
- shouldForwardProp: prop => !['flexBasisProp', 'isGridMode', 'isGridCol', 'dense', 'frequencyWidth'].includes(prop)
9657
+ shouldForwardProp: prop => !['flexBasisProp', 'isGridMode', 'isGridCol', 'dense', 'frequencyWidth', 'showIcon', 'checkboxes'].includes(prop)
9588
9658
  })(_ref2 => {
9589
9659
  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;
9590
9660
  let {
@@ -9593,7 +9663,9 @@ const RowColRoot = styled$1('div', {
9593
9663
  isGridMode,
9594
9664
  isGridCol,
9595
9665
  dense,
9596
- frequencyWidth
9666
+ frequencyWidth,
9667
+ showIcon,
9668
+ checkboxes
9597
9669
  } = _ref2;
9598
9670
  return {
9599
9671
  '&:focus': {
@@ -9602,6 +9674,14 @@ const RowColRoot = styled$1('div', {
9602
9674
  '&:focus-visible': {
9603
9675
  outline: 'none'
9604
9676
  },
9677
+ '& .value': {
9678
+ '&:focus': {
9679
+ boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder, " !important")
9680
+ },
9681
+ '&:focus-visible': {
9682
+ outline: 'none'
9683
+ }
9684
+ },
9605
9685
  ["& .".concat(rowColClasses.row)]: {
9606
9686
  flexWrap: 'nowrap',
9607
9687
  color: (_theme$listBox$conten = (_theme$listBox = theme.listBox) === null || _theme$listBox === void 0 ? void 0 : (_theme$listBox$conten2 = _theme$listBox.content) === null || _theme$listBox$conten2 === void 0 ? void 0 : _theme$listBox$conten2.color) !== null && _theme$listBox$conten !== void 0 ? _theme$listBox$conten : theme.palette.text.primary
@@ -9630,7 +9710,7 @@ const RowColRoot = styled$1('div', {
9630
9710
  flexBasis: flexBasisProp,
9631
9711
  lineHeight: '16px',
9632
9712
  userSelect: 'none',
9633
- paddingRight: '1px'
9713
+ paddingRight: showIcon || checkboxes ? '1px' : "".concat(iconWidth, "px")
9634
9714
  }, ellipsis), {}, {
9635
9715
  whiteSpace: 'pre',
9636
9716
  // to keep white-space on highlight
@@ -9672,9 +9752,9 @@ const RowColRoot = styled$1('div', {
9672
9752
  ["& .".concat(rowColClasses.icon)]: {
9673
9753
  display: 'flex',
9674
9754
  justifyContent: 'center',
9675
- width: 24,
9676
- minWidth: 24,
9677
- maxWidth: 24
9755
+ width: iconWidth,
9756
+ minWidth: iconWidth,
9757
+ maxWidth: iconWidth
9678
9758
  },
9679
9759
  // Selection styles (S=Selected, XS=ExcludedSelected, A=Available, X=Excluded).
9680
9760
  ["& .".concat(rowColClasses.S)]: _objectSpread2(_objectSpread2({}, getSelectedStyle({
@@ -9686,7 +9766,7 @@ const RowColRoot = styled$1('div', {
9686
9766
  theme
9687
9767
  })), {}, {
9688
9768
  background: theme.palette.selected.excluded,
9689
- color: theme.palette.selected.mainContrastText,
9769
+ color: theme.palette.selected.excludedContrastText,
9690
9770
  border: isGridMode ? 'none' : undefined
9691
9771
  }),
9692
9772
  ["& .".concat(rowColClasses.A)]: {
@@ -9712,27 +9792,38 @@ const RowColRoot = styled$1('div', {
9712
9792
  alignItems: 'center'
9713
9793
  },
9714
9794
  ["& .".concat(rowColClasses.bar)]: {
9715
- border: "".concat(barBorderWidthPx, "px solid"),
9716
- borderColor: '#D9D9D9',
9717
9795
  height: dense ? '16px' : '20px',
9718
9796
  position: 'absolute',
9719
9797
  zIndex: '-1',
9720
9798
  alignSelf: 'center',
9721
- left: "".concat(barPadPx, "px"),
9722
- transition: 'width 0.2s',
9723
- backgroundColor: '#FAFAFA'
9799
+ left: barPadPx,
9800
+ width: "calc(100% - ".concat(barPadPx * 2, "px)"),
9801
+ display: 'flex',
9802
+ alignItems: 'center',
9803
+ '& .bar-filled': {
9804
+ border: "".concat(barBorderWidthPx, "px solid"),
9805
+ borderColor: '#D9D9D9',
9806
+ transition: 'width 0.2s',
9807
+ backgroundColor: '#FAFAFA',
9808
+ height: '100%'
9809
+ }
9724
9810
  },
9725
9811
  ["& .".concat(rowColClasses.barSelected)]: {
9726
- opacity: '30%',
9727
9812
  zIndex: '0',
9728
- background: theme.palette.background.lighter
9813
+ '& .bar-filled': {
9814
+ opacity: '30%',
9815
+ background: theme.palette.background.lighter
9816
+ }
9729
9817
  },
9730
9818
  ["& .".concat(rowColClasses.barWithCheckbox)]: {
9731
- left: "".concat(barWithCheckboxLeftPadPx, "px")
9819
+ left: barWithCheckboxLeftPadPx,
9820
+ width: "calc(100% - ".concat(barWithCheckboxLeftPadPx + barPadPx, "px)")
9732
9821
  },
9733
9822
  ["& .".concat(rowColClasses.barSelectedWithCheckbox)]: {
9734
- background: '#BFE5D0',
9735
- borderColor: '#BFE5D0'
9823
+ '& .bar-filled': {
9824
+ background: '#BFE5D0',
9825
+ borderColor: '#BFE5D0'
9826
+ }
9736
9827
  },
9737
9828
  ["& .".concat(rowColClasses.excludedTextWithCheckbox)]: {
9738
9829
  color: '#828282',
@@ -9908,6 +9999,7 @@ function ValueField(_ref) {
9908
9999
  color: color,
9909
10000
  align: valueTextAlign
9910
10001
  }, /*#__PURE__*/React__default.createElement("span", {
10002
+ dir: "auto",
9911
10003
  style: {
9912
10004
  whiteSpace: 'pre'
9913
10005
  }
@@ -10093,29 +10185,27 @@ var Field$1 = React__default.memo(Field);
10093
10185
 
10094
10186
  function Histogram(_ref) {
10095
10187
  let {
10096
- cell,
10188
+ qFrequency,
10097
10189
  histogram,
10098
10190
  checkboxes,
10099
10191
  isSelected,
10100
10192
  frequencyMax
10101
10193
  } = _ref;
10102
- const hasHistogramBar = cell && histogram && getFrequencyText({
10103
- cell
10104
- }) !== frequencyTextNone;
10194
+ const hasHistogramBar = qFrequency && histogram && getFrequencyText(qFrequency) !== frequencyTextNone;
10105
10195
  if (!hasHistogramBar) {
10106
10196
  return undefined;
10107
10197
  }
10108
10198
  const width = getBarWidth({
10109
- qFrequency: cell.qFrequency,
10199
+ qFrequency,
10110
10200
  checkboxes,
10111
10201
  frequencyMax
10112
10202
  });
10113
- return /*#__PURE__*/React__default.createElement("div", {
10114
- className: joinClassNames([rowColClasses.bar, checkboxes && rowColClasses.barWithCheckbox, isSelected && (checkboxes ? rowColClasses.barSelectedWithCheckbox : rowColClasses.barSelected)]),
10115
- style: {
10116
- width
10117
- }
10118
- });
10203
+ return /*#__PURE__*/React__default.createElement(Box, {
10204
+ className: joinClassNames([rowColClasses.bar, checkboxes && rowColClasses.barWithCheckbox, isSelected && (checkboxes ? rowColClasses.barSelectedWithCheckbox : rowColClasses.barSelected)])
10205
+ }, /*#__PURE__*/React__default.createElement(Box, {
10206
+ className: "bar-filled",
10207
+ width: width
10208
+ }));
10119
10209
  }
10120
10210
 
10121
10211
  function Frequency(_ref) {
@@ -10140,9 +10230,7 @@ function Frequency(_ref) {
10140
10230
  cell,
10141
10231
  checkboxes
10142
10232
  }) && rowColClasses.excludedTextWithCheckbox])
10143
- }, getFrequencyText({
10144
- cell
10145
- })));
10233
+ }, getFrequencyText(cell === null || cell === void 0 ? void 0 : cell.qFrequency)));
10146
10234
  }
10147
10235
 
10148
10236
  function getGridItemSizes(_ref) {
@@ -10243,6 +10331,7 @@ function RowColumn(_ref) {
10243
10331
  histogram = false,
10244
10332
  keyboard,
10245
10333
  showGray = true,
10334
+ showTick: sizePermitsTick = true,
10246
10335
  columnCount = 1,
10247
10336
  rowCount = 1,
10248
10337
  dataOffset,
@@ -10305,7 +10394,7 @@ function RowColumn(_ref) {
10305
10394
  pages,
10306
10395
  cellIndex
10307
10396
  }), [pages, cellIndex]);
10308
- const isSelected = (cell === null || cell === void 0 ? void 0 : cell.qState) === 'S' || (cell === null || cell === void 0 ? void 0 : cell.qState) === 'XS' || (cell === null || cell === void 0 ? void 0 : cell.qState) === 'L';
10397
+ const isSelected = (cell === null || cell === void 0 ? void 0 : cell.qState) === 'S' || (cell === null || cell === void 0 ? void 0 : cell.qState) === 'XS' || (cell === null || cell === void 0 ? void 0 : cell.qState) === 'L' || (cell === null || cell === void 0 ? void 0 : cell.qState) === 'XL';
10309
10398
  const classArr = useMemo$1(() => getValueStateClasses({
10310
10399
  column,
10311
10400
  histogram,
@@ -10314,10 +10403,6 @@ function RowColumn(_ref) {
10314
10403
  showGray
10315
10404
  }), [cell === null || cell === void 0 ? void 0 : cell.qState, histogram, dense, checkboxes]);
10316
10405
  const preventContextMenu = useCallback(event => {
10317
- if (checkboxes) {
10318
- // Event will not propagate in the checkbox/radiobutton case
10319
- onClick(event);
10320
- }
10321
10406
  event.preventDefault();
10322
10407
  }, [checkboxes]);
10323
10408
  if (!cell) {
@@ -10332,7 +10417,11 @@ function RowColumn(_ref) {
10332
10417
  ltr: 'left'
10333
10418
  };
10334
10419
  if (isAutoTextAlign) {
10335
- valueTextAlign = isNumeric ? 'right' : dirToTextAlignMap[direction];
10420
+ if (!isNumeric) {
10421
+ valueTextAlign = dirToTextAlignMap[direction];
10422
+ } else {
10423
+ valueTextAlign = direction === 'rtl' ? 'left' : 'right';
10424
+ }
10336
10425
  } else {
10337
10426
  valueTextAlign = (textAlign === null || textAlign === void 0 ? void 0 : textAlign.align) || 'left';
10338
10427
  }
@@ -10351,22 +10440,26 @@ function RowColumn(_ref) {
10351
10440
  display: 'flex',
10352
10441
  fontSize: '8px'
10353
10442
  };
10354
- const showLock = isSelected && isLocked;
10355
- const showTick = !checkboxes && isSelected && !isLocked;
10356
10443
  const cellStyle = {
10357
10444
  display: 'flex',
10358
10445
  alignItems: 'center',
10359
10446
  minWidth: 0,
10360
10447
  flexGrow: 1,
10361
- paddingLeft: checkboxes ? 0 : undefined,
10448
+ paddingLeft: direction === 'rtl' ? 8 : checkboxes ? 0 : undefined,
10449
+ paddingRight: checkboxes ? 0 : direction === 'rtl' ? 8 : 0,
10362
10450
  justifyContent: valueTextAlign
10363
10451
  };
10364
10452
  const isFirstElement = index === 0;
10365
10453
  const flexBasisVal = checkboxes ? 'auto' : 'max-content';
10454
+ const showLock = isSelected && isLocked;
10455
+ const showTick = !checkboxes && isSelected && !isLocked && sizePermitsTick;
10456
+ const showIcon = !checkboxes && (showTick || showLock);
10366
10457
  return /*#__PURE__*/React__default.createElement(RowColRoot$1, {
10367
10458
  className: rowColClasses.barContainer,
10368
10459
  flexBasisProp: flexBasisVal,
10369
10460
  style: styles,
10461
+ showIcon: showIcon,
10462
+ checkboxes: checkboxes,
10370
10463
  isGridCol: isGridCol,
10371
10464
  isGridMode: dataLayout === 'grid',
10372
10465
  dense: dense,
@@ -10392,8 +10485,8 @@ function RowColumn(_ref) {
10392
10485
  role: column ? 'column' : 'row',
10393
10486
  tabIndex: isFirstElement && (!keyboard.enabled || keyboard.active) ? 0 : -1,
10394
10487
  "data-n": cell === null || cell === void 0 ? void 0 : cell.qElemNumber
10395
- }, /*#__PURE__*/React__default.createElement(Histogram, {
10396
- cell: cell,
10488
+ }, (cell === null || cell === void 0 ? void 0 : cell.qFrequency) && /*#__PURE__*/React__default.createElement(Histogram, {
10489
+ qFrequency: cell === null || cell === void 0 ? void 0 : cell.qFrequency,
10397
10490
  histogram: histogram,
10398
10491
  checkboxes: checkboxes,
10399
10492
  isSelected: isSelected,
@@ -10435,14 +10528,10 @@ function RowColumn(_ref) {
10435
10528
  checkboxes: checkboxes,
10436
10529
  dense: dense,
10437
10530
  showGray: showGray
10438
- }), !checkboxes && /*#__PURE__*/React__default.createElement(Grid, {
10531
+ }), showIcon && /*#__PURE__*/React__default.createElement(Grid, {
10439
10532
  item: true,
10440
10533
  className: rowColClasses.icon
10441
- }, !showLock && !showTick && /*#__PURE__*/React__default.createElement("span", {
10442
- style: {
10443
- minWidth: '12px'
10444
- }
10445
- }), showLock && /*#__PURE__*/React__default.createElement(Lock, {
10534
+ }, showLock && /*#__PURE__*/React__default.createElement(Lock, {
10446
10535
  style: iconStyles,
10447
10536
  size: "small"
10448
10537
  }), showTick && /*#__PURE__*/React__default.createElement(Tick, {
@@ -11976,6 +12065,8 @@ function handleSetOverflowDisclaimer(_ref) {
11976
12065
  overflowDisclaimer.set(show);
11977
12066
  }
11978
12067
 
12068
+ const REMOVE_TICK_LIMIT = 80; // an item width equal to or less than this, will hide the select tick
12069
+
11979
12070
  const {
11980
12071
  StyledFixedSizeList,
11981
12072
  StyledFixedSizeGrid
@@ -12007,20 +12098,23 @@ function getListBoxComponents(_ref) {
12007
12098
  focusListItems,
12008
12099
  setCurrentScrollIndex,
12009
12100
  constraints,
12101
+ frequencyMax,
12010
12102
  freqIsAllowed
12011
12103
  } = _ref;
12012
12104
  const {
12013
- layoutOptions = {},
12014
- frequencyMax
12105
+ layoutOptions = {}
12015
12106
  } = layout || {};
12016
12107
  const {
12108
+ columnWidth,
12017
12109
  itemPadding,
12018
12110
  listHeight,
12019
- itemSize,
12111
+ itemHeight,
12020
12112
  rowCount,
12021
12113
  columnCount,
12022
12114
  frequencyWidth
12023
12115
  } = sizes || {};
12116
+ const itemWidth = layoutOptions.dataLayout === 'grid' ? columnWidth : width;
12117
+ const showTick = itemWidth > REMOVE_TICK_LIMIT;
12024
12118
 
12025
12119
  // Options common for List and Grid.
12026
12120
  const commonComponentOptions = {
@@ -12054,8 +12148,10 @@ function getListBoxComponents(_ref) {
12054
12148
  histogram,
12055
12149
  keyboard,
12056
12150
  showGray,
12151
+ showTick,
12057
12152
  dataOffset: local.current.dataOffset,
12058
- focusListItems
12153
+ focusListItems,
12154
+ direction
12059
12155
  });
12060
12156
  const List = _ref2 => {
12061
12157
  let {
@@ -12075,7 +12171,7 @@ function getListBoxComponents(_ref) {
12075
12171
  itemData: _objectSpread2(_objectSpread2({}, commonItemData), {}, {
12076
12172
  listCount
12077
12173
  }),
12078
- itemSize: itemSize,
12174
+ itemSize: itemHeight,
12079
12175
  onItemsRendered: renderProps => {
12080
12176
  var _layout$qListObject, _layout$qListObject$q;
12081
12177
  setCurrentScrollIndex({
@@ -12106,14 +12202,13 @@ function getListBoxComponents(_ref) {
12106
12202
  ref
12107
12203
  } = _ref3;
12108
12204
  const {
12109
- columnWidth,
12110
12205
  overflowStyling,
12111
12206
  scrollBarWidth
12112
12207
  } = sizes;
12113
12208
  const {
12114
12209
  layoutOrder
12115
12210
  } = layoutOptions || {};
12116
- const gridHeight = Math.min(listHeight, rowCount * itemSize + scrollBarWidth);
12211
+ const gridHeight = Math.min(listHeight, rowCount * itemHeight + scrollBarWidth);
12117
12212
  // eslint-disable-next-line no-param-reassign
12118
12213
  local.current.listRef = ref;
12119
12214
  const handleGridItemsRendered = renderProps => {
@@ -12152,7 +12247,7 @@ function getListBoxComponents(_ref) {
12152
12247
  columnCount: columnCount,
12153
12248
  columnWidth: columnWidth,
12154
12249
  rowCount: rowCount,
12155
- rowHeight: itemSize,
12250
+ rowHeight: itemHeight,
12156
12251
  style: _objectSpread2({}, overflowStyling),
12157
12252
  itemData: _objectSpread2(_objectSpread2({}, commonItemData), {}, {
12158
12253
  column: undefined,
@@ -12169,11 +12264,65 @@ function getListBoxComponents(_ref) {
12169
12264
  };
12170
12265
  }
12171
12266
 
12172
- const scrollBarWidth = 10; // TODO: ignore this - instead set the styling only show on hover...
12267
+ function calculateColumnMode(_ref) {
12268
+ let {
12269
+ maxVisibleRows,
12270
+ itemHeight,
12271
+ listCount,
12272
+ listHeight,
12273
+ columnAutoWidth,
12274
+ containerWidth,
12275
+ itemMinWidth
12276
+ } = _ref;
12277
+ let rowCount;
12278
+ const maxRows = (maxVisibleRows === null || maxVisibleRows === void 0 ? void 0 : maxVisibleRows.maxRows) || 3;
12279
+ const autoRowCount = Math.floor(listHeight / itemHeight);
12280
+ if (maxVisibleRows.auto !== false) {
12281
+ rowCount = autoRowCount;
12282
+ } else {
12283
+ rowCount = Math.min(listCount, maxRows, autoRowCount);
12284
+ }
12285
+ const columnCount = Math.ceil(listCount / rowCount);
12286
+ const columnWidth = Math.max(columnAutoWidth, containerWidth / columnCount, itemMinWidth);
12287
+ return {
12288
+ columnWidth,
12289
+ columnCount,
12290
+ rowCount
12291
+ };
12292
+ }
12173
12293
 
12174
- const ITEM_MIN_WIDTH = 56;
12294
+ const SCROLL_BAR_WIDTH = 10; // TODO: ignore this - instead set the styling only show on hover...
12175
12295
  const ITEM_MAX_WIDTH = 150;
12176
12296
  const FREQUENCY_WIDTH = 40;
12297
+ const ITEM_MIN_WIDTH = 56;
12298
+ const CHECKBOX_WIDTH = 20;
12299
+
12300
+ function calculateRowMode(_ref) {
12301
+ let {
12302
+ maxVisibleColumns,
12303
+ listCount,
12304
+ containerWidth,
12305
+ columnAutoWidth,
12306
+ itemMinWidth
12307
+ } = _ref;
12308
+ const maxColumns = (maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.maxColumns) || 3;
12309
+ const innerWidth = containerWidth - SCROLL_BAR_WIDTH;
12310
+ let columnCount;
12311
+ const autoColumnCount = Math.min(listCount, Math.ceil(innerWidth / Math.max(itemMinWidth, columnAutoWidth))); // TODO: smarter sizing... based on glyph count + font size etc...??
12312
+ if ((maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.auto) !== false) {
12313
+ columnCount = autoColumnCount;
12314
+ } else {
12315
+ columnCount = Math.min(listCount, maxColumns, autoColumnCount);
12316
+ }
12317
+ const columnWidth = innerWidth / columnCount;
12318
+ const rowCount = Math.ceil(listCount / columnCount);
12319
+ return {
12320
+ rowCount,
12321
+ columnWidth,
12322
+ columnCount
12323
+ };
12324
+ }
12325
+
12177
12326
  function getListSizes(_ref) {
12178
12327
  let {
12179
12328
  layout,
@@ -12182,7 +12331,8 @@ function getListSizes(_ref) {
12182
12331
  listCount,
12183
12332
  count,
12184
12333
  textWidth,
12185
- freqIsAllowed
12334
+ freqIsAllowed,
12335
+ checkboxes
12186
12336
  } = _ref;
12187
12337
  const {
12188
12338
  layoutOptions = {}
@@ -12195,50 +12345,60 @@ function getListSizes(_ref) {
12195
12345
  dataLayout
12196
12346
  } = layoutOptions;
12197
12347
  const frequencyAddWidth = freqIsAllowed ? FREQUENCY_WIDTH : 0;
12198
- const columnAutoWidth = Math.max(Math.min(ITEM_MAX_WIDTH, textWidth + 18 + frequencyAddWidth), ITEM_MIN_WIDTH + frequencyAddWidth);
12348
+ const checkboxAddWidth = checkboxes ? CHECKBOX_WIDTH : 0;
12349
+ const dynamicItemMinWidth = ITEM_MIN_WIDTH + frequencyAddWidth + checkboxAddWidth;
12350
+ const columnAutoWidth = Math.max(Math.min(ITEM_MAX_WIDTH, textWidth + 18 + frequencyAddWidth + checkboxAddWidth), dynamicItemMinWidth);
12199
12351
  let overflowStyling;
12200
12352
  let columnCount;
12201
12353
  let columnWidth;
12202
12354
  let rowCount;
12203
12355
  const isGridMode = dataLayout === 'grid';
12204
12356
  const itemPadding = 4;
12205
- const denseItemSize = 20;
12206
- const normalItemSize = isGridMode ? 32 : 29;
12207
- let itemSize = dense ? denseItemSize : normalItemSize;
12357
+ const denseItemHeight = 20;
12358
+ const normalItemHeight = isGridMode ? 32 : 29;
12359
+ let itemHeight = dense ? denseItemHeight : normalItemHeight;
12208
12360
  if (isGridMode) {
12209
12361
  // Emulate a margin between items using padding, since the list library
12210
12362
  // needs an explicit row height and cannot handle margins.
12211
- itemSize += itemPadding;
12363
+ itemHeight += itemPadding;
12212
12364
  }
12213
- const listHeight = height !== null && height !== void 0 ? height : 8 * itemSize;
12365
+ const listHeight = height !== null && height !== void 0 ? height : 8 * itemHeight;
12214
12366
  if (layoutOrder) {
12215
12367
  // Modify container width to achieve the exact design with 8px margins on each side (left and right).
12216
12368
  let containerWidth = width;
12217
12369
  if (layoutOrder === 'row') {
12218
- containerWidth += itemPadding * 2;
12219
12370
  overflowStyling = {
12220
12371
  overflowX: 'hidden'
12221
12372
  };
12222
- const maxColumns = (maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.maxColumns) || 3;
12223
- if ((maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.auto) !== false) {
12224
- columnCount = Math.min(listCount, Math.ceil((containerWidth - scrollBarWidth) / columnAutoWidth)); // TODO: smarter sizing... based on glyph count + font size etc...??
12225
- } else {
12226
- columnCount = Math.min(listCount, maxColumns);
12227
- }
12228
- rowCount = Math.ceil(listCount / columnCount);
12229
- columnWidth = (containerWidth - scrollBarWidth) / columnCount;
12373
+ containerWidth += itemPadding * 2;
12374
+ ({
12375
+ rowCount,
12376
+ columnWidth,
12377
+ columnCount
12378
+ } = calculateRowMode({
12379
+ maxVisibleColumns,
12380
+ listCount,
12381
+ containerWidth,
12382
+ columnAutoWidth,
12383
+ itemMinWidth: dynamicItemMinWidth
12384
+ }));
12230
12385
  } else {
12231
12386
  overflowStyling = {
12232
12387
  overflowY: 'hidden'
12233
12388
  };
12234
- const maxRows = (maxVisibleRows === null || maxVisibleRows === void 0 ? void 0 : maxVisibleRows.maxRows) || 3;
12235
- if (maxVisibleRows.auto !== false) {
12236
- rowCount = Math.floor(listHeight / itemSize);
12237
- } else {
12238
- rowCount = Math.min(listCount, maxRows);
12239
- }
12240
- columnCount = Math.ceil(listCount / rowCount);
12241
- columnWidth = Math.max(columnAutoWidth, containerWidth / columnCount);
12389
+ ({
12390
+ rowCount,
12391
+ columnWidth,
12392
+ columnCount
12393
+ } = calculateColumnMode({
12394
+ maxVisibleRows,
12395
+ itemHeight,
12396
+ listCount,
12397
+ listHeight,
12398
+ columnAutoWidth,
12399
+ containerWidth,
12400
+ itemMinWidth: dynamicItemMinWidth
12401
+ }));
12242
12402
  }
12243
12403
  }
12244
12404
  columnCount = (dataLayout === 'singleColumn' ? 1 : columnCount) || 1;
@@ -12255,9 +12415,9 @@ function getListSizes(_ref) {
12255
12415
  columnWidth,
12256
12416
  rowCount,
12257
12417
  overflowStyling,
12258
- itemSize,
12418
+ itemHeight,
12259
12419
  listHeight,
12260
- scrollBarWidth,
12420
+ scrollBarWidth: SCROLL_BAR_WIDTH,
12261
12421
  count,
12262
12422
  listCount: limitedListCount,
12263
12423
  maxCount: {
@@ -12306,9 +12466,9 @@ function getHorizontalMinBatchSize(_ref) {
12306
12466
  width,
12307
12467
  columnWidth,
12308
12468
  listHeight,
12309
- itemSize
12469
+ itemHeight
12310
12470
  } = _ref;
12311
- const visibleCellsCount = Math.ceil(width / columnWidth) * Math.ceil(listHeight / itemSize);
12471
+ const visibleCellsCount = Math.ceil(width / columnWidth) * Math.ceil(listHeight / itemHeight);
12312
12472
  const minSize = visibleCellsCount * 2;
12313
12473
  return minSize;
12314
12474
  }
@@ -12776,12 +12936,48 @@ function getFrequencyAllowed(_ref) {
12776
12936
  return !!(widthPermitsFreq && (hasValidFreqOption || frequencyEnabled));
12777
12937
  }
12778
12938
 
12939
+ const escapeField = field => {
12940
+ if (!field) {
12941
+ return field;
12942
+ }
12943
+ return "".concat(field.replace(/\]/g, ']]'));
12944
+ };
12945
+ const needToFetchFrequencyMax = layout => (layout === null || layout === void 0 ? void 0 : layout.frequencyMax) === 'fetch';
12946
+ const getFrequencyMaxExpression = field => {
12947
+ const escapedField = escapeField(field);
12948
+ return "Max(AGGR(Count(".concat(escapedField, "), ").concat(escapedField, "))");
12949
+ };
12950
+ const getFrequencyMax = async (layout, app) => {
12951
+ const dimInfo = layout.qListObject.qDimensionInfo;
12952
+ const field = dimInfo.qGroupFieldDefs[dimInfo.qGroupPos];
12953
+ const expression = getFrequencyMaxExpression(field);
12954
+ const evaluadedExpression = await app.evaluateEx(expression);
12955
+ return evaluadedExpression.qNumber;
12956
+ };
12957
+
12958
+ const useFrequencyMax = (app, layout) => {
12959
+ const [frequencyMax, setFrequencyMax] = useState$1();
12960
+ const needFetch = needToFetchFrequencyMax(layout);
12961
+ useEffect$1(() => {
12962
+ if (!needFetch) {
12963
+ return;
12964
+ }
12965
+ const fetch = async () => {
12966
+ const newValue = await getFrequencyMax(layout, app);
12967
+ setFrequencyMax(newValue);
12968
+ };
12969
+ fetch();
12970
+ }, [needFetch && layout]);
12971
+ return needFetch ? frequencyMax : layout === null || layout === void 0 ? void 0 : layout.frequencyMax;
12972
+ };
12973
+
12779
12974
  const _excluded$4 = ["isLoadingData"];
12780
12975
  const DEFAULT_MIN_BATCH_SIZE = 100;
12781
12976
  function ListBox(_ref) {
12782
12977
  var _layout$qListObject$q, _loaderRef$current, _loaderRef$current$_l, _loaderRef$current$_l2;
12783
12978
  let {
12784
12979
  model,
12980
+ app,
12785
12981
  constraints,
12786
12982
  layout,
12787
12983
  selections,
@@ -12948,7 +13144,8 @@ function ListBox(_ref) {
12948
13144
  listCount: unlimitedListCount,
12949
13145
  count,
12950
13146
  textWidth,
12951
- freqIsAllowed
13147
+ freqIsAllowed,
13148
+ checkboxes
12952
13149
  });
12953
13150
  if (sizes.columnWidth) {
12954
13151
  // In grid mode, where we have a dynamic item width, get a second opinion on showing/hiding frequency.
@@ -13012,6 +13209,7 @@ function ListBox(_ref) {
13012
13209
  last
13013
13210
  }))
13014
13211
  });
13212
+ const frequencyMax = useFrequencyMax(app, layout);
13015
13213
  const {
13016
13214
  List,
13017
13215
  Grid
@@ -13045,19 +13243,20 @@ function ListBox(_ref) {
13045
13243
  focusListItems: getFocusState(),
13046
13244
  setCurrentScrollIndex: currentScrollIndex.set,
13047
13245
  constraints,
13246
+ frequencyMax,
13048
13247
  freqIsAllowed
13049
13248
  });
13050
13249
  const {
13051
13250
  columnWidth,
13052
13251
  listHeight,
13053
- itemSize
13252
+ itemHeight
13054
13253
  } = sizes || {};
13055
13254
  if (!isVertical) {
13056
13255
  minimumBatchSize = getHorizontalMinBatchSize({
13057
13256
  width,
13058
13257
  columnWidth,
13059
13258
  listHeight,
13060
- itemSize
13259
+ itemHeight
13061
13260
  });
13062
13261
  }
13063
13262
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !listCount && /*#__PURE__*/React__default.createElement(ListBoxDisclaimer, {
@@ -13233,6 +13432,7 @@ const Item = React__default.forwardRef((_ref, ref) => {
13233
13432
  style: style,
13234
13433
  className: ActionElement.className,
13235
13434
  size: "large",
13435
+ disableRipple: true,
13236
13436
  "aria-expanded": ariaExpanded,
13237
13437
  "aria-controls": "moreMenuList"
13238
13438
  }, hasSvgIconShape && SvgIcon$2(item.getSvgIconShape()), addAnchor && /*#__PURE__*/React__default.createElement("div", {
@@ -13415,6 +13615,7 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
13415
13615
 
13416
13616
  const PREFIX$7 = 'ActionsToolbar';
13417
13617
  const classes$7 = {
13618
+ item: "".concat(PREFIX$7, "-item"),
13418
13619
  itemSpacing: "".concat(PREFIX$7, "-itemSpacing"),
13419
13620
  firstItemSpacing: "".concat(PREFIX$7, "-firstItemSpacing"),
13420
13621
  lastItemSpacing: "".concat(PREFIX$7, "-lastItemSpacing")
@@ -13451,25 +13652,27 @@ const ActionsGroup = React__default.forwardRef((_ref2, ref) => {
13451
13652
  actions = [],
13452
13653
  first = false,
13453
13654
  last = false,
13454
- addAnchor = false
13655
+ addAnchor = false,
13656
+ isRtl = false
13455
13657
  } = _ref2;
13456
13658
  return actions.length > 0 ? /*#__PURE__*/React__default.createElement(Grid, {
13457
13659
  item: true,
13458
13660
  container: true,
13459
13661
  gap: 0,
13662
+ flexDirection: isRtl ? 'row-reverse' : 'row',
13460
13663
  wrap: "nowrap"
13461
13664
  }, actions.map((e, ix) => {
13462
13665
  let cls = [];
13463
13666
  const isFirstItem = first && ix === 0;
13464
13667
  const isLastItem = last && actions.length - 1 === ix;
13465
13668
  if (isFirstItem && !isLastItem) {
13466
- cls = [classes$7.firstItemSpacing];
13669
+ cls = [classes$7.firstItemSpacing, classes$7.item];
13467
13670
  }
13468
13671
  if (isLastItem && !isFirstItem) {
13469
- cls = [...cls, classes$7.lastItemSpacing];
13672
+ cls = [...cls, classes$7.lastItemSpacing, classes$7.item];
13470
13673
  }
13471
13674
  if (!isFirstItem && !isLastItem && cls.length === 0) {
13472
- cls = [classes$7.itemSpacing];
13675
+ cls = [classes$7.itemSpacing, classes$7.item];
13473
13676
  }
13474
13677
  return /*#__PURE__*/React__default.createElement(Grid, {
13475
13678
  item: true,
@@ -13518,7 +13721,9 @@ function ActionsToolbar(_ref3) {
13518
13721
  anchorEl: null
13519
13722
  },
13520
13723
  focusHandler = null,
13521
- actionsRefMock = null // for testing
13724
+ actionsRefMock = null,
13725
+ // for testing
13726
+ direction = 'ltr'
13522
13727
  } = _ref3;
13523
13728
  const defaultSelectionActions = useDefaultSelectionActions(selections);
13524
13729
  const {
@@ -13591,12 +13796,16 @@ function ActionsToolbar(_ref3) {
13591
13796
  const showActions = newActions.length > 0;
13592
13797
  const showMore = moreActions.length > 0;
13593
13798
  const showDivider = showActions && selections.show || showMore && selections.show;
13799
+ const isRtl = direction === 'rtl';
13594
13800
  const Actions = /*#__PURE__*/React__default.createElement(Grid, {
13595
13801
  ref: actionsRef,
13596
13802
  onKeyDown: tabCallback,
13597
13803
  container: true,
13598
13804
  gap: 0,
13599
- wrap: "nowrap"
13805
+ wrap: "nowrap",
13806
+ sx: {
13807
+ flexDirection: isRtl ? 'row-reverse' : 'row'
13808
+ }
13600
13809
  }, showActions && /*#__PURE__*/React__default.createElement(ActionsGroup, {
13601
13810
  actions: newActions,
13602
13811
  first: true,
@@ -13617,7 +13826,8 @@ function ActionsToolbar(_ref3) {
13617
13826
  })), selections.show && /*#__PURE__*/React__default.createElement(ActionsGroup, {
13618
13827
  actions: defaultSelectionActions,
13619
13828
  first: !showActions && !showMore,
13620
- last: true
13829
+ last: true,
13830
+ isRtl: isRtl
13621
13831
  }), showMoreItems && /*#__PURE__*/React__default.createElement(More$1, {
13622
13832
  show: showMoreItems,
13623
13833
  actions: moreActions,
@@ -13640,7 +13850,7 @@ function ActionsToolbar(_ref3) {
13640
13850
  className: ActionToolbarElement.className,
13641
13851
  style: {
13642
13852
  pointerEvents: 'auto',
13643
- padding: theme.spacing(1, 1)
13853
+ padding: theme.spacing(0.8)
13644
13854
  }
13645
13855
  }
13646
13856
  }, Actions) : show && Actions;
@@ -13673,7 +13883,8 @@ const StyledOutlinedInput = styled$1(OutlinedInput)(_ref2 => {
13673
13883
  theme
13674
13884
  } = _ref2;
13675
13885
  return {
13676
- color: (_theme$listBox2 = theme.listBox) === null || _theme$listBox2 === void 0 ? void 0 : (_theme$listBox2$conte = _theme$listBox2.content) === null || _theme$listBox2$conte === void 0 ? void 0 : _theme$listBox2$conte.color
13886
+ color: (_theme$listBox2 = theme.listBox) === null || _theme$listBox2 === void 0 ? void 0 : (_theme$listBox2$conte = _theme$listBox2.content) === null || _theme$listBox2$conte === void 0 ? void 0 : _theme$listBox2$conte.color,
13887
+ display: 'flex'
13677
13888
  };
13678
13889
  });
13679
13890
  function ListBoxSearch(_ref3) {
@@ -13686,7 +13897,8 @@ function ListBoxSearch(_ref3) {
13686
13897
  visible = true,
13687
13898
  autoFocus = true,
13688
13899
  wildCardSearch = false,
13689
- searchEnabled
13900
+ searchEnabled,
13901
+ direction
13690
13902
  } = _ref3;
13691
13903
  const {
13692
13904
  translator
@@ -13698,6 +13910,8 @@ function ListBoxSearch(_ref3) {
13698
13910
  const {
13699
13911
  getStoreValue
13700
13912
  } = useDataStore(model);
13913
+ const isRtl = direction === 'rtl';
13914
+ const inpuTextAlign = isRtl ? 'right' : 'left';
13701
13915
  const cancel = () => selections.isActive() && selections.cancel();
13702
13916
  const abortSearch = async () => {
13703
13917
  if (!selections.isModal()) {
@@ -13785,6 +13999,7 @@ function ListBoxSearch(_ref3) {
13785
13999
  className: "search",
13786
14000
  sx: [{
13787
14001
  border: 'none',
14002
+ fontSize: 14,
13788
14003
  borderRadius: 0,
13789
14004
  backgroundColor: 'transparent',
13790
14005
  '& fieldset': {
@@ -13803,6 +14018,8 @@ function ListBoxSearch(_ref3) {
13803
14018
  paddingTop: '5px',
13804
14019
  paddingBottom: '5px'
13805
14020
  }
14021
+ }, {
14022
+ flexDirection: isRtl ? 'row-reverse' : 'row'
13806
14023
  }],
13807
14024
  inputRef: inputRef,
13808
14025
  size: "small",
@@ -13814,7 +14031,10 @@ function ListBoxSearch(_ref3) {
13814
14031
  onKeyDown: onKeyDown,
13815
14032
  autoFocus: autoFocus,
13816
14033
  inputProps: {
13817
- tabIndex: keyboard && (!keyboard.enabled || keyboard.active) ? 0 : -1
14034
+ tabIndex: keyboard && (!keyboard.enabled || keyboard.active) ? 0 : -1,
14035
+ style: {
14036
+ textAlign: "".concat(inpuTextAlign)
14037
+ }
13818
14038
  }
13819
14039
  });
13820
14040
  }
@@ -14360,6 +14580,7 @@ function ListBoxPopover(_ref) {
14360
14580
  autoFocus: autoFocus !== null && autoFocus !== void 0 ? autoFocus : true
14361
14581
  }), /*#__PURE__*/React__default.createElement(ListBox, {
14362
14582
  model: model,
14583
+ app: app,
14363
14584
  layout: layout,
14364
14585
  selections: selections,
14365
14586
  selectionState: selectionState$1,
@@ -15633,27 +15854,77 @@ const drillDown = props => _objectSpread2(_objectSpread2({}, props), {}, {
15633
15854
  var DrillDownIcon = (props => SvgIcon$2(drillDown(props)));
15634
15855
 
15635
15856
  const addListboxTheme = themeApi => {
15636
- const getListboxStyle = prop => themeApi.getStyle('object', '', "listBox.".concat(prop));
15857
+ const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
15637
15858
  return {
15638
- backgroundColor: getListboxStyle('backgroundColor'),
15859
+ backgroundColor: getListboxStyle('', 'backgroundColor'),
15639
15860
  title: {
15640
15861
  main: {
15641
- color: getListboxStyle('title.main.color'),
15642
- fontSize: getListboxStyle('title.main.fontSize'),
15643
- fontFamily: getListboxStyle('title.main.fontFamily')
15862
+ color: getListboxStyle('title.main', 'color'),
15863
+ fontSize: getListboxStyle('title.main', 'fontSize'),
15864
+ fontFamily: getListboxStyle('title.main', 'fontFamily'),
15865
+ fontWeight: getListboxStyle('title.main', 'fontWeight')
15644
15866
  }
15645
15867
  },
15646
15868
  content: {
15647
- color: getListboxStyle('content.color'),
15648
- fontSize: getListboxStyle('content.fontSize'),
15649
- fontFamily: getListboxStyle('content.fontFamily')
15869
+ color: getListboxStyle('content', 'color'),
15870
+ fontSize: getListboxStyle('content', 'fontSize'),
15871
+ fontFamily: getListboxStyle('content', 'fontFamily')
15650
15872
  }
15651
15873
  };
15652
15874
  };
15653
15875
 
15876
+ function showToolbarDetached(_ref) {
15877
+ var _containerRef$current, _containerRef$current2, _titleRef$current$cli, _titleRef$current, _titleRef$current2, _titleRef$current3;
15878
+ let {
15879
+ containerRef,
15880
+ titleRef,
15881
+ iconsWidth
15882
+ } = _ref;
15883
+ const containerWidth = (_containerRef$current = containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.clientWidth) !== null && _containerRef$current !== void 0 ? _containerRef$current : 0;
15884
+ const padding = 16;
15885
+ const contentWidth = ((_titleRef$current$cli = titleRef === null || titleRef === void 0 ? void 0 : (_titleRef$current = titleRef.current) === null || _titleRef$current === void 0 ? void 0 : _titleRef$current.clientWidth) !== null && _titleRef$current$cli !== void 0 ? _titleRef$current$cli : 0) + iconsWidth + padding;
15886
+ const actionToolbarWidth = 128;
15887
+ const notSufficientSpace = containerWidth < contentWidth + actionToolbarWidth;
15888
+ const isTruncated = (titleRef === null || titleRef === void 0 ? void 0 : (_titleRef$current2 = titleRef.current) === null || _titleRef$current2 === void 0 ? void 0 : _titleRef$current2.scrollWidth) > (titleRef === null || titleRef === void 0 ? void 0 : (_titleRef$current3 = titleRef.current) === null || _titleRef$current3 === void 0 ? void 0 : _titleRef$current3.offsetWidth);
15889
+ return !!(notSufficientSpace | isTruncated);
15890
+ }
15891
+
15892
+ function getListboxActionProps(_ref) {
15893
+ let {
15894
+ isPopover,
15895
+ showToolbar,
15896
+ containerRef,
15897
+ isLocked,
15898
+ listboxSelectionToolbarItems,
15899
+ selections
15900
+ } = _ref;
15901
+ return {
15902
+ show: showToolbar && !isPopover,
15903
+ popover: {
15904
+ show: showToolbar && isPopover,
15905
+ anchorEl: containerRef.current
15906
+ },
15907
+ more: {
15908
+ enabled: !isLocked,
15909
+ actions: listboxSelectionToolbarItems,
15910
+ popoverProps: {
15911
+ elevation: 0
15912
+ },
15913
+ popoverPaperStyle: {
15914
+ boxShadow: '0 12px 8px -8px rgba(0, 0, 0, 0.2)',
15915
+ minWidth: '250px'
15916
+ }
15917
+ },
15918
+ selections: {
15919
+ show: showToolbar,
15920
+ api: selections,
15921
+ onConfirm: () => {},
15922
+ onCancel: () => {}
15923
+ }
15924
+ };
15925
+ }
15926
+
15654
15927
  const PREFIX$4 = 'ListBoxInline';
15655
- const searchIconWidth = 28;
15656
- const drillDownIconWidth = 24;
15657
15928
  const classes$4 = {
15658
15929
  listBoxHeader: "".concat(PREFIX$4, "-listBoxHeader"),
15659
15930
  screenReaderOnly: "".concat(PREFIX$4, "-screenReaderOnly"),
@@ -15671,8 +15942,8 @@ const StyledGrid$3 = styled$1(Grid, {
15671
15942
  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,
15672
15943
  ["& .".concat(classes$4.listBoxHeader)]: {
15673
15944
  alignSelf: 'center',
15674
- display: 'inline-flex',
15675
- width: "calc(100% - ".concat(searchIconWidth, "px)")
15945
+ display: 'flex',
15946
+ width: "calc(100% - ".concat(BUTTON_ICON_WIDTH, "px)")
15676
15947
  },
15677
15948
  ["& .".concat(classes$4.screenReaderOnly)]: {
15678
15949
  position: 'absolute',
@@ -15682,18 +15953,25 @@ const StyledGrid$3 = styled$1(Grid, {
15682
15953
  },
15683
15954
  ["& .".concat(classes$4.listboxWrapper)]: {
15684
15955
  padding: containerPadding
15956
+ },
15957
+ '&:focus': {
15958
+ boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder, " !important")
15959
+ },
15960
+ '&:focus-visible': {
15961
+ outline: 'none'
15685
15962
  }
15686
15963
  };
15687
15964
  });
15688
15965
  const Title = styled$1(Typography)(_ref2 => {
15689
- var _theme$listBox2, _theme$listBox2$title, _theme$listBox2$title2, _theme$listBox3, _theme$listBox3$title, _theme$listBox3$title2, _theme$listBox4, _theme$listBox4$title, _theme$listBox4$title2;
15966
+ var _theme$listBox2, _theme$listBox2$title, _theme$listBox2$title2, _theme$listBox3, _theme$listBox3$title, _theme$listBox3$title2, _theme$listBox4, _theme$listBox4$title, _theme$listBox4$title2, _theme$listBox5, _theme$listBox5$title, _theme$listBox5$title2;
15690
15967
  let {
15691
15968
  theme
15692
15969
  } = _ref2;
15693
15970
  return {
15694
15971
  color: (_theme$listBox2 = theme.listBox) === null || _theme$listBox2 === void 0 ? void 0 : (_theme$listBox2$title = _theme$listBox2.title) === null || _theme$listBox2$title === void 0 ? void 0 : (_theme$listBox2$title2 = _theme$listBox2$title.main) === null || _theme$listBox2$title2 === void 0 ? void 0 : _theme$listBox2$title2.color,
15695
15972
  fontSize: (_theme$listBox3 = theme.listBox) === null || _theme$listBox3 === void 0 ? void 0 : (_theme$listBox3$title = _theme$listBox3.title) === null || _theme$listBox3$title === void 0 ? void 0 : (_theme$listBox3$title2 = _theme$listBox3$title.main) === null || _theme$listBox3$title2 === void 0 ? void 0 : _theme$listBox3$title2.fontSize,
15696
- fontFamily: (_theme$listBox4 = theme.listBox) === null || _theme$listBox4 === void 0 ? void 0 : (_theme$listBox4$title = _theme$listBox4.title) === null || _theme$listBox4$title === void 0 ? void 0 : (_theme$listBox4$title2 = _theme$listBox4$title.main) === null || _theme$listBox4$title2 === void 0 ? void 0 : _theme$listBox4$title2.fontFamily
15973
+ fontFamily: (_theme$listBox4 = theme.listBox) === null || _theme$listBox4 === void 0 ? void 0 : (_theme$listBox4$title = _theme$listBox4.title) === null || _theme$listBox4$title === void 0 ? void 0 : (_theme$listBox4$title2 = _theme$listBox4$title.main) === null || _theme$listBox4$title2 === void 0 ? void 0 : _theme$listBox4$title2.fontFamily,
15974
+ fontWeight: ((_theme$listBox5 = theme.listBox) === null || _theme$listBox5 === void 0 ? void 0 : (_theme$listBox5$title = _theme$listBox5.title) === null || _theme$listBox5$title === void 0 ? void 0 : (_theme$listBox5$title2 = _theme$listBox5$title.main) === null || _theme$listBox5$title2 === void 0 ? void 0 : _theme$listBox5$title2.fontWeight) || 'bold'
15697
15975
  };
15698
15976
  });
15699
15977
  function ListBoxInline(_ref3) {
@@ -15746,7 +16024,6 @@ function ListBoxInline(_ref3) {
15746
16024
  constraints
15747
16025
  } = useContext(InstanceContext);
15748
16026
  theme.listBox = addListboxTheme(themeApi);
15749
- const moreAlignTo = useRef();
15750
16027
  const containerRef = useRef();
15751
16028
  const [searchContainer, searchContainerRef] = useRefWithCallback();
15752
16029
  const [showToolbar, setShowToolbar] = useState$1(false);
@@ -15764,6 +16041,7 @@ function ListBoxInline(_ref3) {
15764
16041
  stop: 0
15765
16042
  });
15766
16043
  const [appSelections] = useAppSelections(app);
16044
+ const titleRef = useRef(null);
15767
16045
  const [selectionState$1] = useState$1(() => selectionState());
15768
16046
  const {
15769
16047
  handleKeyDown,
@@ -15790,6 +16068,7 @@ function ListBoxInline(_ref3) {
15790
16068
  if ((layout === null || layout === void 0 ? void 0 : layout.toolbar) !== undefined) {
15791
16069
  toolbar = layout.toolbar;
15792
16070
  }
16071
+ const toolbarDetachedOnly = toolbar && (layout === null || layout === void 0 ? void 0 : layout.title) === '';
15793
16072
  toolbar = toolbar && (layout === null || layout === void 0 ? void 0 : layout.title) !== '';
15794
16073
  useEffect$1(() => {
15795
16074
  const show = () => {
@@ -15806,15 +16085,15 @@ function ListBoxInline(_ref3) {
15806
16085
  };
15807
16086
  if (selections) {
15808
16087
  if (!selections.isModal()) {
15809
- selections.on('deactivated', hide);
15810
16088
  selections.on('activated', show);
16089
+ selections.on('deactivated', hide);
15811
16090
  }
15812
16091
  setShowToolbar(selections.isActive());
15813
16092
  }
15814
16093
  return () => {
15815
16094
  if (selections && selections.removeListener) {
15816
- selections.removeListener('deactivated', show);
15817
- selections.removeListener('activated', hide);
16095
+ selections.removeListener('activated', show);
16096
+ selections.removeListener('deactivated', hide);
15818
16097
  }
15819
16098
  };
15820
16099
  }, [selections, toolbar]);
@@ -15832,38 +16111,46 @@ function ListBoxInline(_ref3) {
15832
16111
  return null;
15833
16112
  }
15834
16113
  const isLocked = layout.qListObject.qDimensionInfo.qLocked === true;
16114
+ const isRtl = direction === 'rtl';
15835
16115
  const isDrillDown = layout.qListObject.qDimensionInfo.qGrouping === 'H';
15836
- const listboxSelectionToolbarItems = toolbar ? createListboxSelectionToolbar({
16116
+ const listboxSelectionToolbarItems = createListboxSelectionToolbar({
15837
16117
  layout,
15838
16118
  model,
15839
16119
  translator,
15840
16120
  selectionState: selectionState$1
15841
- }) : [];
15842
- const showSearchToggle = search === 'toggle' && showSearch;
15843
- const searchVisible = (search === true || showSearchToggle) && !selectDisabled();
16121
+ });
15844
16122
  const {
16123
+ wildCardSearch,
16124
+ searchEnabled,
15845
16125
  layoutOptions = {}
15846
16126
  } = layout;
16127
+ const showSearchToggle = search === 'toggle' && showSearch;
16128
+ const searchVisible = (search === true || showSearchToggle) && !selectDisabled() && searchEnabled !== false;
15847
16129
  const dense = (_layoutOptions$dense = layoutOptions.dense) !== null && _layoutOptions$dense !== void 0 ? _layoutOptions$dense : false;
15848
16130
  const searchHeight = dense ? 27 : 40;
15849
16131
  const extraheight = dense ? 39 : 49;
15850
- const minHeight = 49 + (searchVisible ? searchHeight : 0) + extraheight;
16132
+ const searchAddHeight = searchVisible ? searchHeight : 0;
16133
+ const minHeight = toolbar ? 49 + searchAddHeight + extraheight : 0;
15851
16134
  const headerHeight = 32;
15852
- const {
15853
- wildCardSearch,
15854
- searchEnabled
15855
- } = layout;
15856
16135
  const onShowSearch = () => {
15857
16136
  const newValue = !showSearch;
15858
16137
  setShowSearch(newValue);
15859
16138
  };
16139
+ const getActionToolbarProps = isPopover => getListboxActionProps({
16140
+ isPopover,
16141
+ showToolbar,
16142
+ containerRef,
16143
+ isLocked,
16144
+ listboxSelectionToolbarItems,
16145
+ selections
16146
+ });
15860
16147
  const shouldAutoFocus = searchVisible && search === 'toggle';
15861
16148
  const showSearchIcon = searchEnabled !== false && search === 'toggle' && !(constraints !== null && constraints !== void 0 && constraints.active);
15862
16149
  const showSearchOrLockIcon = isLocked || showSearchIcon;
15863
16150
  const showIcons = showSearchOrLockIcon || isDrillDown;
15864
- const iconsWidth = (showSearchOrLockIcon ? searchIconWidth : 0) + (isDrillDown ? drillDownIconWidth : 0);
15865
- const drillDownPaddingLeft = showSearchOrLockIcon ? 0 : ICON_PADDING;
15866
- const headerPaddingLeft = CELL_PADDING_LEFT - (showIcons ? ICON_PADDING : 0);
16151
+ 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
16152
+ const headerPaddingLeft = CELL_PADDING_LEFT - (showSearchOrLockIcon ? ICON_PADDING : 0);
16153
+ const headerPaddingRight = isRtl ? CELL_PADDING_LEFT - (showIcons ? ICON_PADDING : 0) : 0;
15867
16154
 
15868
16155
  // Add a container padding for grid mode to harmonize with the grid item margins (should sum to 8px).
15869
16156
  const isGridMode = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.dataLayout) === 'grid';
@@ -15871,7 +16158,9 @@ function ListBoxInline(_ref3) {
15871
16158
  if (isGridMode) {
15872
16159
  containerPadding = layoutOptions.layoutOrder === 'row' ? '2px 4px' : '2px 6px 2px 4px';
15873
16160
  }
15874
- return /*#__PURE__*/React__default.createElement(StyledGrid$3, {
16161
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, toolbarDetachedOnly && /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$6({
16162
+ direction: direction
16163
+ }, getActionToolbarProps(true))), /*#__PURE__*/React__default.createElement(StyledGrid$3, {
15875
16164
  className: "listbox-container",
15876
16165
  container: true,
15877
16166
  tabIndex: keyboard.enabled && !keyboard.active ? 0 : -1,
@@ -15892,13 +16181,20 @@ function ListBoxInline(_ref3) {
15892
16181
  container: true,
15893
16182
  style: {
15894
16183
  padding: theme.spacing(1),
15895
- paddingLeft: "".concat(headerPaddingLeft, "px")
16184
+ paddingLeft: "".concat(headerPaddingLeft, "px"),
16185
+ paddingRight: "".concat(headerPaddingRight, "px")
16186
+ },
16187
+ sx: {
16188
+ flexDirection: isRtl ? 'row-reverse' : 'row'
15896
16189
  },
15897
16190
  wrap: "nowrap"
15898
16191
  }, /*#__PURE__*/React__default.createElement(Grid, {
15899
16192
  item: true,
15900
16193
  container: true,
15901
16194
  height: headerHeight,
16195
+ sx: {
16196
+ flexDirection: isRtl ? 'row-reverse' : 'row'
16197
+ },
15902
16198
  wrap: "nowrap"
15903
16199
  }, showIcons && /*#__PURE__*/React__default.createElement(Grid, {
15904
16200
  item: true,
@@ -15908,12 +16204,13 @@ function ListBoxInline(_ref3) {
15908
16204
  width: iconsWidth
15909
16205
  }
15910
16206
  }, isLocked ? /*#__PURE__*/React__default.createElement(IconButton, {
16207
+ title: translator.get('SelectionToolbar.ClickToUnlock'),
15911
16208
  tabIndex: -1,
15912
16209
  onClick: unlock,
15913
16210
  disabled: selectDisabled(),
15914
16211
  size: "large"
15915
16212
  }, /*#__PURE__*/React__default.createElement(Lock, {
15916
- title: translator.get('Listbox.Unlock'),
16213
+ disableRipple: true,
15917
16214
  style: {
15918
16215
  fontSize: '12px'
15919
16216
  }
@@ -15922,66 +16219,52 @@ function ListBoxInline(_ref3) {
15922
16219
  tabIndex: -1,
15923
16220
  title: translator.get('Listbox.Search'),
15924
16221
  size: "large",
16222
+ disableRipple: true,
15925
16223
  "data-testid": "search-toggle-btn"
15926
16224
  }, /*#__PURE__*/React__default.createElement(SearchIcon, {
15927
16225
  style: {
15928
16226
  fontSize: '12px'
15929
16227
  }
15930
- })), isDrillDown && /*#__PURE__*/React__default.createElement(IconButton, {
16228
+ })), isDrillDown && /*#__PURE__*/React__default.createElement(DrillDownIcon, {
15931
16229
  tabIndex: -1,
15932
16230
  title: translator.get('Listbox.DrillDown'),
15933
16231
  size: "large",
15934
- sx: {
15935
- paddingLeft: "".concat(drillDownPaddingLeft, "px")
15936
- }
15937
- }, /*#__PURE__*/React__default.createElement(DrillDownIcon, {
15938
16232
  style: {
15939
16233
  fontSize: '12px'
15940
16234
  }
15941
- }))), /*#__PURE__*/React__default.createElement(Grid, {
16235
+ })), /*#__PURE__*/React__default.createElement(Grid, {
15942
16236
  item: true,
16237
+ sx: {
16238
+ justifyContent: isRtl ? 'flex-end' : 'flex-start'
16239
+ },
15943
16240
  className: classes$4.listBoxHeader
15944
16241
  }, /*#__PURE__*/React__default.createElement(Title, {
15945
16242
  variant: "h6",
15946
16243
  noWrap: true,
16244
+ ref: titleRef,
15947
16245
  title: layout.title
15948
16246
  }, layout.title))), /*#__PURE__*/React__default.createElement(Grid, {
15949
16247
  item: true,
15950
16248
  xs: true
15951
16249
  }), /*#__PURE__*/React__default.createElement(Grid, {
15952
16250
  item: true
15953
- }, /*#__PURE__*/React__default.createElement(ActionsToolbar, {
15954
- more: {
15955
- enabled: !isLocked,
15956
- actions: listboxSelectionToolbarItems,
15957
- alignTo: moreAlignTo,
15958
- popoverProps: {
15959
- elevation: 0
15960
- },
15961
- popoverPaperStyle: {
15962
- boxShadow: '0 12px 8px -8px rgba(0, 0, 0, 0.2)',
15963
- minWidth: '250px'
15964
- }
15965
- },
15966
- selections: {
15967
- show: showToolbar,
15968
- api: selections,
15969
- onConfirm: () => {},
15970
- onCancel: () => {}
15971
- }
15972
- }))), /*#__PURE__*/React__default.createElement(Grid, {
16251
+ }, /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$6({
16252
+ direction: direction
16253
+ }, getActionToolbarProps(showToolbarDetached({
16254
+ containerRef,
16255
+ titleRef,
16256
+ iconsWidth
16257
+ })))))), /*#__PURE__*/React__default.createElement(Grid, {
15973
16258
  item: true,
15974
16259
  container: true,
15975
16260
  direction: "column",
15976
16261
  style: {
15977
16262
  height: '100%',
15978
- minHeight: "".concat(minHeight, "px")
16263
+ minHeight: '50px'
15979
16264
  },
15980
16265
  role: "region",
15981
16266
  "aria-label": translator.get('Listbox.ResultFilterLabel')
15982
- }, /*#__PURE__*/React__default.createElement("div", {
15983
- ref: moreAlignTo
15984
- }), /*#__PURE__*/React__default.createElement(Grid, {
16267
+ }, /*#__PURE__*/React__default.createElement(Grid, {
15985
16268
  item: true,
15986
16269
  ref: searchContainerRef
15987
16270
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -15997,7 +16280,8 @@ function ListBoxInline(_ref3) {
15997
16280
  autoFocus: shouldAutoFocus,
15998
16281
  searchContainerRef: searchContainerRef,
15999
16282
  wildCardSearch: wildCardSearch,
16000
- searchEnabled: searchEnabled
16283
+ searchEnabled: searchEnabled,
16284
+ direction: direction
16001
16285
  })), /*#__PURE__*/React__default.createElement(Grid, {
16002
16286
  item: true,
16003
16287
  xs: true,
@@ -16011,6 +16295,7 @@ function ListBoxInline(_ref3) {
16011
16295
  } = _ref4;
16012
16296
  return /*#__PURE__*/React__default.createElement(ListBox, {
16013
16297
  model: model,
16298
+ app: app,
16014
16299
  constraints: constraints,
16015
16300
  layout: layout,
16016
16301
  selections: selections,
@@ -16042,7 +16327,7 @@ function ListBoxInline(_ref3) {
16042
16327
  set: setCurrentScrollIndex
16043
16328
  }
16044
16329
  });
16045
- }))));
16330
+ })))));
16046
16331
  }
16047
16332
  const ListBoxInlineMemoed = React__default.memo(ListBoxInline);
16048
16333
  function IsolateUseLayoutWrapper(_ref5) {
@@ -16118,7 +16403,13 @@ function useOnTheFlyModel(_ref) {
16118
16403
  const dim = await app.getDimension(fieldIdentifier.qLibraryId);
16119
16404
  const dimLayout = await dim.getLayout();
16120
16405
  setFallbackTitle(dimLayout.qDim.title);
16121
- setFieldDef(dimLayout.qDim.qFieldDefs ? dimLayout.qDim.qFieldDefs[0] : '');
16406
+ if (dimLayout.qDim.qGrouping === 'N') {
16407
+ setFieldDef(dimLayout.qDim.qFieldDefs ? dimLayout.qDim.qFieldDefs[0] : '');
16408
+ } else {
16409
+ setFieldDef({
16410
+ multiFieldDim: true
16411
+ });
16412
+ }
16122
16413
  setIsFetching(false);
16123
16414
  } catch (e) {
16124
16415
  setIsFetching(false);
@@ -16228,11 +16519,16 @@ function useOnTheFlyModel(_ref) {
16228
16519
  listdef.qListObjectDef.qDef.qFieldDefs = [fieldIdentifier];
16229
16520
  fieldName = fieldIdentifier;
16230
16521
  }
16231
- if (frequencyMode !== 'N' || histogram) {
16232
- const field = fieldIdentifier.qLibraryId ? fieldDef : fieldName;
16233
- listdef.frequencyMax = {
16234
- qValueExpression: "Max(AGGR(Count([".concat(field, "]), [").concat(field, "]))")
16235
- };
16522
+ if (frequencyMode !== 'P' && histogram) {
16523
+ if (fieldDef !== null && fieldDef !== void 0 && fieldDef.multiFieldDim) {
16524
+ listdef.frequencyMax = 'fetch';
16525
+ // maybe for all lib dimension to handle if it properties change
16526
+ } else {
16527
+ const field = fieldIdentifier.qLibraryId ? fieldDef : fieldName;
16528
+ listdef.frequencyMax = {
16529
+ qValueExpression: getFrequencyMaxExpression(field)
16530
+ };
16531
+ }
16236
16532
  }
16237
16533
  const [sessionModel] = useSessionModel(listdef, isFetching ? null : app, fieldName, stateName);
16238
16534
  useEffect$1(() => {
@@ -16336,7 +16632,7 @@ function ListBoxWrapper(_ref) {
16336
16632
  options
16337
16633
  });
16338
16634
  const elementRef = useRef(element);
16339
- const selections = hasExternalSelectionsApi ? options.selectionsApi : useObjectSelections(app, model, [elementRef, '.njs-action-toolbar-more'], options)[0];
16635
+ const selections = hasExternalSelectionsApi ? options.selectionsApi : useObjectSelections(app, model, [elementRef, '.njs-action-toolbar-more', '.njs-action-toolbar-popover'], options)[0];
16340
16636
  const opts = useMemo$1(() => _objectSpread2(_objectSpread2({}, options), {}, {
16341
16637
  selections,
16342
16638
  model,
@@ -23583,6 +23879,7 @@ const mergeArray = function () {
23583
23879
  const mergeConfigs = (base, c) => ({
23584
23880
  context: mergeObj(base.context, c.context),
23585
23881
  load: c.load || base.load,
23882
+ loadTheme: c.loadTheme || base.loadTheme,
23586
23883
  snapshot: _objectSpread2({}, c.snapshot || base.snapshot),
23587
23884
  types: mergeArray(base.types, c.types),
23588
23885
  themes: mergeArray(base.themes, c.themes),
@@ -23629,6 +23926,7 @@ function nuked() {
23629
23926
  });
23630
23927
  const appTheme$1 = appTheme({
23631
23928
  themes: configuration.themes,
23929
+ loadTheme: configuration.loadTheme,
23632
23930
  root
23633
23931
  });
23634
23932
  currentContext.themeApi = appTheme$1.externalAPI;