@nebula.js/stardust 4.0.0-alpha.1 → 4.0.0-alpha.3
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 +508 -183
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +3 -3
- package/core/esm/index.js.map +1 -1
- package/dist/stardust.dev.js +507 -182
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +13 -13
- package/dist/stardust.js.map +1 -1
- package/package.json +9 -9
- package/types/index.d.ts +1 -1
package/core/esm/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v4.0.0-alpha.
|
|
2
|
+
* @nebula.js/stardust v4.0.0-alpha.3
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|
|
@@ -7998,7 +8043,7 @@ function create$3(definition) {
|
|
|
7998
8043
|
return cache[key];
|
|
7999
8044
|
}
|
|
8000
8045
|
|
|
8001
|
-
const NEBULA_VERSION_HASH = "
|
|
8046
|
+
const NEBULA_VERSION_HASH = "ee80" ;
|
|
8002
8047
|
ClassNameGenerator$1.configure(componentName => {
|
|
8003
8048
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
8004
8049
|
});
|
|
@@ -8206,7 +8251,7 @@ function boot(_ref2) {
|
|
|
8206
8251
|
const appRef = React__default.createRef();
|
|
8207
8252
|
const element = document.createElement('div');
|
|
8208
8253
|
element.style.display = 'none';
|
|
8209
|
-
element.setAttribute('data-nebulajs-version', "4.0.0-alpha.
|
|
8254
|
+
element.setAttribute('data-nebulajs-version', "4.0.0-alpha.3" );
|
|
8210
8255
|
element.setAttribute('data-app-id', app.id);
|
|
8211
8256
|
document.body.appendChild(element);
|
|
8212
8257
|
const root = client.createRoot(element);
|
|
@@ -9280,6 +9325,8 @@ const KEYS = Object.freeze({
|
|
|
9280
9325
|
function getFieldKeyboardNavigation(_ref) {
|
|
9281
9326
|
let {
|
|
9282
9327
|
select,
|
|
9328
|
+
selectAll,
|
|
9329
|
+
onCtrlF,
|
|
9283
9330
|
confirm,
|
|
9284
9331
|
cancel,
|
|
9285
9332
|
setScrollPosition,
|
|
@@ -9299,7 +9346,8 @@ function getFieldKeyboardNavigation(_ref) {
|
|
|
9299
9346
|
const {
|
|
9300
9347
|
keyCode,
|
|
9301
9348
|
shiftKey = false,
|
|
9302
|
-
ctrlKey = false
|
|
9349
|
+
ctrlKey = false,
|
|
9350
|
+
metaKey = false
|
|
9303
9351
|
} = event.nativeEvent;
|
|
9304
9352
|
switch (keyCode) {
|
|
9305
9353
|
case KEYS.SHIFT:
|
|
@@ -9354,6 +9402,18 @@ function getFieldKeyboardNavigation(_ref) {
|
|
|
9354
9402
|
}
|
|
9355
9403
|
setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('end');
|
|
9356
9404
|
break;
|
|
9405
|
+
case KEYS.A:
|
|
9406
|
+
if (ctrlKey || metaKey) {
|
|
9407
|
+
selectAll();
|
|
9408
|
+
break;
|
|
9409
|
+
}
|
|
9410
|
+
return;
|
|
9411
|
+
case KEYS.F:
|
|
9412
|
+
if (ctrlKey || metaKey) {
|
|
9413
|
+
onCtrlF();
|
|
9414
|
+
break;
|
|
9415
|
+
}
|
|
9416
|
+
return;
|
|
9357
9417
|
default:
|
|
9358
9418
|
return;
|
|
9359
9419
|
// don't stop propagation since we want to outsource keydown to other handlers.
|
|
@@ -9380,15 +9440,29 @@ function getListboxInlineKeyboardNavigation(_ref2) {
|
|
|
9380
9440
|
constraints
|
|
9381
9441
|
} = _ref2;
|
|
9382
9442
|
const focusInsideListbox = element => {
|
|
9383
|
-
const fieldElement = element.querySelector('.search input, .value.selector, .value, .ActionsToolbar
|
|
9443
|
+
const fieldElement = element.querySelector('.search input, .value.selector, .value, .ActionsToolbar-item button');
|
|
9384
9444
|
setKeyboardActive(true);
|
|
9385
9445
|
if (fieldElement) {
|
|
9386
9446
|
fieldElement.focus();
|
|
9387
9447
|
}
|
|
9388
9448
|
};
|
|
9389
|
-
const
|
|
9390
|
-
|
|
9391
|
-
|
|
9449
|
+
const changeFocus = event => {
|
|
9450
|
+
var _event$target;
|
|
9451
|
+
if ((_event$target = event.target) !== null && _event$target !== void 0 && _event$target.classList.contains('listbox-container')) {
|
|
9452
|
+
// Focus currently on a listbox
|
|
9453
|
+
// Esc on a list box should move the focus to its parent, i.e. a filter pane if any
|
|
9454
|
+
setKeyboardActive(false);
|
|
9455
|
+
} else {
|
|
9456
|
+
var _event$target2, _event$target3, _event$currentTarget, _event$currentTarget2;
|
|
9457
|
+
// Focus currently on a row
|
|
9458
|
+
// Esc on a row should move the focus to its parent, i.e. a listbox
|
|
9459
|
+
// First unfocus the row
|
|
9460
|
+
(_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.setAttribute('tabIndex', '-1');
|
|
9461
|
+
(_event$target3 = event.target) === null || _event$target3 === void 0 ? void 0 : _event$target3.blur();
|
|
9462
|
+
// Then focus the listbox
|
|
9463
|
+
(_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 ? void 0 : _event$currentTarget.setAttribute('tabIndex', '0');
|
|
9464
|
+
(_event$currentTarget2 = event.currentTarget) === null || _event$currentTarget2 === void 0 ? void 0 : _event$currentTarget2.focus();
|
|
9465
|
+
}
|
|
9392
9466
|
};
|
|
9393
9467
|
const updateKeyScrollOnHover = newState => {
|
|
9394
9468
|
if (hovering) {
|
|
@@ -9412,7 +9486,7 @@ function getListboxInlineKeyboardNavigation(_ref2) {
|
|
|
9412
9486
|
focusInsideListbox(event.currentTarget);
|
|
9413
9487
|
break;
|
|
9414
9488
|
case KEYS.ESCAPE:
|
|
9415
|
-
|
|
9489
|
+
changeFocus(event);
|
|
9416
9490
|
break;
|
|
9417
9491
|
case KEYS.ARROW_UP:
|
|
9418
9492
|
updateKeyScrollOnHover({
|
|
@@ -9424,6 +9498,10 @@ function getListboxInlineKeyboardNavigation(_ref2) {
|
|
|
9424
9498
|
down: 1
|
|
9425
9499
|
});
|
|
9426
9500
|
break;
|
|
9501
|
+
case KEYS.ARROW_LEFT:
|
|
9502
|
+
case KEYS.ARROW_RIGHT:
|
|
9503
|
+
return;
|
|
9504
|
+
// let it propagate to top-level
|
|
9427
9505
|
case KEYS.PAGE_UP:
|
|
9428
9506
|
updateKeyScrollOnHover({
|
|
9429
9507
|
up: currentScrollIndex.stop - currentScrollIndex.start
|
|
@@ -9551,25 +9629,15 @@ const joinClassNames = namesArray => namesArray.filter(c => !!c).join(' ').trim(
|
|
|
9551
9629
|
const getBarWidth = _ref => {
|
|
9552
9630
|
let {
|
|
9553
9631
|
qFrequency,
|
|
9554
|
-
checkboxes,
|
|
9555
9632
|
frequencyMax
|
|
9556
9633
|
} = _ref;
|
|
9557
9634
|
const freqStr = String(qFrequency);
|
|
9558
9635
|
const isPercent = freqStr.substring(freqStr.length - 1) === '%';
|
|
9559
9636
|
const freq = parseFloat(isPercent ? freqStr : qFrequency);
|
|
9560
|
-
const rightSlice = checkboxes ? "(".concat(barWithCheckboxLeftPadPx, "px + ").concat(barPadPx + barBorderWidthPx * 2, "px)") : "".concat(barPadPx * 2 + barBorderWidthPx * 2, "px");
|
|
9561
9637
|
const width = isPercent ? freq : freq / frequencyMax * 100;
|
|
9562
|
-
return "
|
|
9563
|
-
};
|
|
9564
|
-
const getFrequencyText = _ref2 => {
|
|
9565
|
-
let {
|
|
9566
|
-
cell
|
|
9567
|
-
} = _ref2;
|
|
9568
|
-
if (cell) {
|
|
9569
|
-
return cell.qFrequency ? cell.qFrequency : frequencyTextNone;
|
|
9570
|
-
}
|
|
9571
|
-
return '';
|
|
9638
|
+
return "".concat(width, "%");
|
|
9572
9639
|
};
|
|
9640
|
+
const getFrequencyText = qFrequency => qFrequency || frequencyTextNone;
|
|
9573
9641
|
|
|
9574
9642
|
const CELL_PADDING_LEFT = 9;
|
|
9575
9643
|
const ICON_WIDTH = 12;
|
|
@@ -9598,8 +9666,10 @@ const ellipsis = {
|
|
|
9598
9666
|
textOverflow: 'ellipsis',
|
|
9599
9667
|
whiteSpace: 'nowrap'
|
|
9600
9668
|
};
|
|
9669
|
+
const iconWidth = 24; // tick and lock icon width in px
|
|
9670
|
+
|
|
9601
9671
|
const RowColRoot = styled$1('div', {
|
|
9602
|
-
shouldForwardProp: prop => !['flexBasisProp', 'isGridMode', 'isGridCol', 'dense', 'frequencyWidth'].includes(prop)
|
|
9672
|
+
shouldForwardProp: prop => !['flexBasisProp', 'isGridMode', 'isGridCol', 'dense', 'frequencyWidth', 'showIcon', 'checkboxes'].includes(prop)
|
|
9603
9673
|
})(_ref2 => {
|
|
9604
9674
|
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;
|
|
9605
9675
|
let {
|
|
@@ -9608,7 +9678,9 @@ const RowColRoot = styled$1('div', {
|
|
|
9608
9678
|
isGridMode,
|
|
9609
9679
|
isGridCol,
|
|
9610
9680
|
dense,
|
|
9611
|
-
frequencyWidth
|
|
9681
|
+
frequencyWidth,
|
|
9682
|
+
showIcon,
|
|
9683
|
+
checkboxes
|
|
9612
9684
|
} = _ref2;
|
|
9613
9685
|
return {
|
|
9614
9686
|
'&:focus': {
|
|
@@ -9617,6 +9689,14 @@ const RowColRoot = styled$1('div', {
|
|
|
9617
9689
|
'&:focus-visible': {
|
|
9618
9690
|
outline: 'none'
|
|
9619
9691
|
},
|
|
9692
|
+
'& .value': {
|
|
9693
|
+
'&:focus': {
|
|
9694
|
+
boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder, " !important")
|
|
9695
|
+
},
|
|
9696
|
+
'&:focus-visible': {
|
|
9697
|
+
outline: 'none'
|
|
9698
|
+
}
|
|
9699
|
+
},
|
|
9620
9700
|
["& .".concat(rowColClasses.row)]: {
|
|
9621
9701
|
flexWrap: 'nowrap',
|
|
9622
9702
|
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
|
|
@@ -9645,7 +9725,7 @@ const RowColRoot = styled$1('div', {
|
|
|
9645
9725
|
flexBasis: flexBasisProp,
|
|
9646
9726
|
lineHeight: '16px',
|
|
9647
9727
|
userSelect: 'none',
|
|
9648
|
-
paddingRight: '1px'
|
|
9728
|
+
paddingRight: showIcon || checkboxes ? '1px' : "".concat(iconWidth, "px")
|
|
9649
9729
|
}, ellipsis), {}, {
|
|
9650
9730
|
whiteSpace: 'pre',
|
|
9651
9731
|
// to keep white-space on highlight
|
|
@@ -9687,9 +9767,9 @@ const RowColRoot = styled$1('div', {
|
|
|
9687
9767
|
["& .".concat(rowColClasses.icon)]: {
|
|
9688
9768
|
display: 'flex',
|
|
9689
9769
|
justifyContent: 'center',
|
|
9690
|
-
width:
|
|
9691
|
-
minWidth:
|
|
9692
|
-
maxWidth:
|
|
9770
|
+
width: iconWidth,
|
|
9771
|
+
minWidth: iconWidth,
|
|
9772
|
+
maxWidth: iconWidth
|
|
9693
9773
|
},
|
|
9694
9774
|
// Selection styles (S=Selected, XS=ExcludedSelected, A=Available, X=Excluded).
|
|
9695
9775
|
["& .".concat(rowColClasses.S)]: _objectSpread2(_objectSpread2({}, getSelectedStyle({
|
|
@@ -9717,7 +9797,7 @@ const RowColRoot = styled$1('div', {
|
|
|
9717
9797
|
["& .".concat(rowColClasses.frequencyCount)]: _objectSpread2(_objectSpread2({
|
|
9718
9798
|
justifyContent: 'flex-end'
|
|
9719
9799
|
}, ellipsis), {}, {
|
|
9720
|
-
flex: "0 1 ".concat(frequencyWidth, "px"),
|
|
9800
|
+
flex: "0 1 ".concat(frequencyWidth + (showIcon || checkboxes ? 0 : iconWidth), "px"),
|
|
9721
9801
|
textAlign: 'right',
|
|
9722
9802
|
paddingLeft: '2px'
|
|
9723
9803
|
}),
|
|
@@ -9727,27 +9807,38 @@ const RowColRoot = styled$1('div', {
|
|
|
9727
9807
|
alignItems: 'center'
|
|
9728
9808
|
},
|
|
9729
9809
|
["& .".concat(rowColClasses.bar)]: {
|
|
9730
|
-
border: "".concat(barBorderWidthPx, "px solid"),
|
|
9731
|
-
borderColor: '#D9D9D9',
|
|
9732
9810
|
height: dense ? '16px' : '20px',
|
|
9733
9811
|
position: 'absolute',
|
|
9734
9812
|
zIndex: '-1',
|
|
9735
9813
|
alignSelf: 'center',
|
|
9736
|
-
left:
|
|
9737
|
-
|
|
9738
|
-
|
|
9814
|
+
left: barPadPx,
|
|
9815
|
+
width: "calc(100% - ".concat(barPadPx * 2, "px)"),
|
|
9816
|
+
display: 'flex',
|
|
9817
|
+
alignItems: 'center',
|
|
9818
|
+
'& .bar-filled': {
|
|
9819
|
+
border: "".concat(barBorderWidthPx, "px solid"),
|
|
9820
|
+
borderColor: '#D9D9D9',
|
|
9821
|
+
transition: 'width 0.2s',
|
|
9822
|
+
backgroundColor: '#FAFAFA',
|
|
9823
|
+
height: '100%'
|
|
9824
|
+
}
|
|
9739
9825
|
},
|
|
9740
9826
|
["& .".concat(rowColClasses.barSelected)]: {
|
|
9741
|
-
opacity: '30%',
|
|
9742
9827
|
zIndex: '0',
|
|
9743
|
-
|
|
9828
|
+
'& .bar-filled': {
|
|
9829
|
+
opacity: '30%',
|
|
9830
|
+
background: theme.palette.background.lighter
|
|
9831
|
+
}
|
|
9744
9832
|
},
|
|
9745
9833
|
["& .".concat(rowColClasses.barWithCheckbox)]: {
|
|
9746
|
-
left:
|
|
9834
|
+
left: barWithCheckboxLeftPadPx,
|
|
9835
|
+
width: "calc(100% - ".concat(barWithCheckboxLeftPadPx + barPadPx, "px)")
|
|
9747
9836
|
},
|
|
9748
9837
|
["& .".concat(rowColClasses.barSelectedWithCheckbox)]: {
|
|
9749
|
-
|
|
9750
|
-
|
|
9838
|
+
'& .bar-filled': {
|
|
9839
|
+
background: '#BFE5D0',
|
|
9840
|
+
borderColor: '#BFE5D0'
|
|
9841
|
+
}
|
|
9751
9842
|
},
|
|
9752
9843
|
["& .".concat(rowColClasses.excludedTextWithCheckbox)]: {
|
|
9753
9844
|
color: '#828282',
|
|
@@ -9923,6 +10014,7 @@ function ValueField(_ref) {
|
|
|
9923
10014
|
color: color,
|
|
9924
10015
|
align: valueTextAlign
|
|
9925
10016
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
10017
|
+
dir: "auto",
|
|
9926
10018
|
style: {
|
|
9927
10019
|
whiteSpace: 'pre'
|
|
9928
10020
|
}
|
|
@@ -10108,29 +10200,27 @@ var Field$1 = React__default.memo(Field);
|
|
|
10108
10200
|
|
|
10109
10201
|
function Histogram(_ref) {
|
|
10110
10202
|
let {
|
|
10111
|
-
|
|
10203
|
+
qFrequency,
|
|
10112
10204
|
histogram,
|
|
10113
10205
|
checkboxes,
|
|
10114
10206
|
isSelected,
|
|
10115
10207
|
frequencyMax
|
|
10116
10208
|
} = _ref;
|
|
10117
|
-
const hasHistogramBar =
|
|
10118
|
-
cell
|
|
10119
|
-
}) !== frequencyTextNone;
|
|
10209
|
+
const hasHistogramBar = qFrequency && histogram && getFrequencyText(qFrequency) !== frequencyTextNone;
|
|
10120
10210
|
if (!hasHistogramBar) {
|
|
10121
10211
|
return undefined;
|
|
10122
10212
|
}
|
|
10123
10213
|
const width = getBarWidth({
|
|
10124
|
-
qFrequency
|
|
10214
|
+
qFrequency,
|
|
10125
10215
|
checkboxes,
|
|
10126
10216
|
frequencyMax
|
|
10127
10217
|
});
|
|
10128
|
-
return /*#__PURE__*/React__default.createElement(
|
|
10129
|
-
className: joinClassNames([rowColClasses.bar, checkboxes && rowColClasses.barWithCheckbox, isSelected && (checkboxes ? rowColClasses.barSelectedWithCheckbox : rowColClasses.barSelected)])
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
});
|
|
10218
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
10219
|
+
className: joinClassNames([rowColClasses.bar, checkboxes && rowColClasses.barWithCheckbox, isSelected && (checkboxes ? rowColClasses.barSelectedWithCheckbox : rowColClasses.barSelected)])
|
|
10220
|
+
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
10221
|
+
className: "bar-filled",
|
|
10222
|
+
width: width
|
|
10223
|
+
}));
|
|
10134
10224
|
}
|
|
10135
10225
|
|
|
10136
10226
|
function Frequency(_ref) {
|
|
@@ -10155,9 +10245,7 @@ function Frequency(_ref) {
|
|
|
10155
10245
|
cell,
|
|
10156
10246
|
checkboxes
|
|
10157
10247
|
}) && rowColClasses.excludedTextWithCheckbox])
|
|
10158
|
-
}, getFrequencyText(
|
|
10159
|
-
cell
|
|
10160
|
-
})));
|
|
10248
|
+
}, getFrequencyText(cell === null || cell === void 0 ? void 0 : cell.qFrequency)));
|
|
10161
10249
|
}
|
|
10162
10250
|
|
|
10163
10251
|
function getGridItemSizes(_ref) {
|
|
@@ -10258,6 +10346,7 @@ function RowColumn(_ref) {
|
|
|
10258
10346
|
histogram = false,
|
|
10259
10347
|
keyboard,
|
|
10260
10348
|
showGray = true,
|
|
10349
|
+
showTick: sizePermitsTick = true,
|
|
10261
10350
|
columnCount = 1,
|
|
10262
10351
|
rowCount = 1,
|
|
10263
10352
|
dataOffset,
|
|
@@ -10343,7 +10432,11 @@ function RowColumn(_ref) {
|
|
|
10343
10432
|
ltr: 'left'
|
|
10344
10433
|
};
|
|
10345
10434
|
if (isAutoTextAlign) {
|
|
10346
|
-
|
|
10435
|
+
if (!isNumeric) {
|
|
10436
|
+
valueTextAlign = dirToTextAlignMap[direction];
|
|
10437
|
+
} else {
|
|
10438
|
+
valueTextAlign = direction === 'rtl' ? 'left' : 'right';
|
|
10439
|
+
}
|
|
10347
10440
|
} else {
|
|
10348
10441
|
valueTextAlign = (textAlign === null || textAlign === void 0 ? void 0 : textAlign.align) || 'left';
|
|
10349
10442
|
}
|
|
@@ -10362,22 +10455,26 @@ function RowColumn(_ref) {
|
|
|
10362
10455
|
display: 'flex',
|
|
10363
10456
|
fontSize: '8px'
|
|
10364
10457
|
};
|
|
10365
|
-
const showLock = isSelected && isLocked;
|
|
10366
|
-
const showTick = !checkboxes && isSelected && !isLocked;
|
|
10367
10458
|
const cellStyle = {
|
|
10368
10459
|
display: 'flex',
|
|
10369
10460
|
alignItems: 'center',
|
|
10370
10461
|
minWidth: 0,
|
|
10371
10462
|
flexGrow: 1,
|
|
10372
|
-
paddingLeft: checkboxes ? 0 : undefined,
|
|
10463
|
+
paddingLeft: direction === 'rtl' ? 8 : checkboxes ? 0 : undefined,
|
|
10464
|
+
paddingRight: checkboxes ? 0 : direction === 'rtl' ? 8 : 0,
|
|
10373
10465
|
justifyContent: valueTextAlign
|
|
10374
10466
|
};
|
|
10375
10467
|
const isFirstElement = index === 0;
|
|
10376
10468
|
const flexBasisVal = checkboxes ? 'auto' : 'max-content';
|
|
10469
|
+
const showLock = isSelected && isLocked;
|
|
10470
|
+
const showTick = !checkboxes && isSelected && !isLocked && sizePermitsTick;
|
|
10471
|
+
const showIcon = !checkboxes && (showTick || showLock);
|
|
10377
10472
|
return /*#__PURE__*/React__default.createElement(RowColRoot$1, {
|
|
10378
10473
|
className: rowColClasses.barContainer,
|
|
10379
10474
|
flexBasisProp: flexBasisVal,
|
|
10380
10475
|
style: styles,
|
|
10476
|
+
showIcon: showIcon,
|
|
10477
|
+
checkboxes: checkboxes,
|
|
10381
10478
|
isGridCol: isGridCol,
|
|
10382
10479
|
isGridMode: dataLayout === 'grid',
|
|
10383
10480
|
dense: dense,
|
|
@@ -10403,8 +10500,8 @@ function RowColumn(_ref) {
|
|
|
10403
10500
|
role: column ? 'column' : 'row',
|
|
10404
10501
|
tabIndex: isFirstElement && (!keyboard.enabled || keyboard.active) ? 0 : -1,
|
|
10405
10502
|
"data-n": cell === null || cell === void 0 ? void 0 : cell.qElemNumber
|
|
10406
|
-
}, /*#__PURE__*/React__default.createElement(Histogram, {
|
|
10407
|
-
cell: cell,
|
|
10503
|
+
}, (cell === null || cell === void 0 ? void 0 : cell.qFrequency) && /*#__PURE__*/React__default.createElement(Histogram, {
|
|
10504
|
+
qFrequency: cell === null || cell === void 0 ? void 0 : cell.qFrequency,
|
|
10408
10505
|
histogram: histogram,
|
|
10409
10506
|
checkboxes: checkboxes,
|
|
10410
10507
|
isSelected: isSelected,
|
|
@@ -10446,14 +10543,10 @@ function RowColumn(_ref) {
|
|
|
10446
10543
|
checkboxes: checkboxes,
|
|
10447
10544
|
dense: dense,
|
|
10448
10545
|
showGray: showGray
|
|
10449
|
-
}),
|
|
10546
|
+
}), showIcon && /*#__PURE__*/React__default.createElement(Grid, {
|
|
10450
10547
|
item: true,
|
|
10451
10548
|
className: rowColClasses.icon
|
|
10452
|
-
},
|
|
10453
|
-
style: {
|
|
10454
|
-
minWidth: '12px'
|
|
10455
|
-
}
|
|
10456
|
-
}), showLock && /*#__PURE__*/React__default.createElement(Lock, {
|
|
10549
|
+
}, showLock && /*#__PURE__*/React__default.createElement(Lock, {
|
|
10457
10550
|
style: iconStyles,
|
|
10458
10551
|
size: "small"
|
|
10459
10552
|
}), showTick && /*#__PURE__*/React__default.createElement(Tick, {
|
|
@@ -11987,6 +12080,8 @@ function handleSetOverflowDisclaimer(_ref) {
|
|
|
11987
12080
|
overflowDisclaimer.set(show);
|
|
11988
12081
|
}
|
|
11989
12082
|
|
|
12083
|
+
const REMOVE_TICK_LIMIT = 80; // an item width equal to or less than this, will hide the select tick
|
|
12084
|
+
|
|
11990
12085
|
const {
|
|
11991
12086
|
StyledFixedSizeList,
|
|
11992
12087
|
StyledFixedSizeGrid
|
|
@@ -12005,6 +12100,8 @@ function getListBoxComponents(_ref) {
|
|
|
12005
12100
|
histogram,
|
|
12006
12101
|
isSingleSelect,
|
|
12007
12102
|
select,
|
|
12103
|
+
selectAll,
|
|
12104
|
+
onCtrlF,
|
|
12008
12105
|
textAlign,
|
|
12009
12106
|
selections,
|
|
12010
12107
|
keyboard,
|
|
@@ -12018,20 +12115,23 @@ function getListBoxComponents(_ref) {
|
|
|
12018
12115
|
focusListItems,
|
|
12019
12116
|
setCurrentScrollIndex,
|
|
12020
12117
|
constraints,
|
|
12118
|
+
frequencyMax,
|
|
12021
12119
|
freqIsAllowed
|
|
12022
12120
|
} = _ref;
|
|
12023
12121
|
const {
|
|
12024
|
-
layoutOptions = {}
|
|
12025
|
-
frequencyMax
|
|
12122
|
+
layoutOptions = {}
|
|
12026
12123
|
} = layout || {};
|
|
12027
12124
|
const {
|
|
12125
|
+
columnWidth,
|
|
12028
12126
|
itemPadding,
|
|
12029
12127
|
listHeight,
|
|
12030
|
-
|
|
12128
|
+
itemHeight,
|
|
12031
12129
|
rowCount,
|
|
12032
12130
|
columnCount,
|
|
12033
12131
|
frequencyWidth
|
|
12034
12132
|
} = sizes || {};
|
|
12133
|
+
const itemWidth = layoutOptions.dataLayout === 'grid' ? columnWidth : width;
|
|
12134
|
+
const showTick = itemWidth > REMOVE_TICK_LIMIT;
|
|
12035
12135
|
|
|
12036
12136
|
// Options common for List and Grid.
|
|
12037
12137
|
const commonComponentOptions = {
|
|
@@ -12059,14 +12159,18 @@ function getListBoxComponents(_ref) {
|
|
|
12059
12159
|
select,
|
|
12060
12160
|
confirm: () => selections === null || selections === void 0 ? void 0 : selections.confirm.call(selections),
|
|
12061
12161
|
cancel: () => selections === null || selections === void 0 ? void 0 : selections.cancel.call(selections),
|
|
12062
|
-
setScrollPosition
|
|
12162
|
+
setScrollPosition,
|
|
12163
|
+
selectAll,
|
|
12164
|
+
onCtrlF
|
|
12063
12165
|
},
|
|
12064
12166
|
frequencyMax,
|
|
12065
12167
|
histogram,
|
|
12066
12168
|
keyboard,
|
|
12067
12169
|
showGray,
|
|
12170
|
+
showTick,
|
|
12068
12171
|
dataOffset: local.current.dataOffset,
|
|
12069
|
-
focusListItems
|
|
12172
|
+
focusListItems,
|
|
12173
|
+
direction
|
|
12070
12174
|
});
|
|
12071
12175
|
const List = _ref2 => {
|
|
12072
12176
|
let {
|
|
@@ -12086,7 +12190,7 @@ function getListBoxComponents(_ref) {
|
|
|
12086
12190
|
itemData: _objectSpread2(_objectSpread2({}, commonItemData), {}, {
|
|
12087
12191
|
listCount
|
|
12088
12192
|
}),
|
|
12089
|
-
itemSize:
|
|
12193
|
+
itemSize: itemHeight,
|
|
12090
12194
|
onItemsRendered: renderProps => {
|
|
12091
12195
|
var _layout$qListObject, _layout$qListObject$q;
|
|
12092
12196
|
setCurrentScrollIndex({
|
|
@@ -12117,14 +12221,13 @@ function getListBoxComponents(_ref) {
|
|
|
12117
12221
|
ref
|
|
12118
12222
|
} = _ref3;
|
|
12119
12223
|
const {
|
|
12120
|
-
columnWidth,
|
|
12121
12224
|
overflowStyling,
|
|
12122
12225
|
scrollBarWidth
|
|
12123
12226
|
} = sizes;
|
|
12124
12227
|
const {
|
|
12125
12228
|
layoutOrder
|
|
12126
12229
|
} = layoutOptions || {};
|
|
12127
|
-
const gridHeight = Math.min(listHeight, rowCount *
|
|
12230
|
+
const gridHeight = Math.min(listHeight, rowCount * itemHeight + scrollBarWidth);
|
|
12128
12231
|
// eslint-disable-next-line no-param-reassign
|
|
12129
12232
|
local.current.listRef = ref;
|
|
12130
12233
|
const handleGridItemsRendered = renderProps => {
|
|
@@ -12163,7 +12266,7 @@ function getListBoxComponents(_ref) {
|
|
|
12163
12266
|
columnCount: columnCount,
|
|
12164
12267
|
columnWidth: columnWidth,
|
|
12165
12268
|
rowCount: rowCount,
|
|
12166
|
-
rowHeight:
|
|
12269
|
+
rowHeight: itemHeight,
|
|
12167
12270
|
style: _objectSpread2({}, overflowStyling),
|
|
12168
12271
|
itemData: _objectSpread2(_objectSpread2({}, commonItemData), {}, {
|
|
12169
12272
|
column: undefined,
|
|
@@ -12180,11 +12283,65 @@ function getListBoxComponents(_ref) {
|
|
|
12180
12283
|
};
|
|
12181
12284
|
}
|
|
12182
12285
|
|
|
12183
|
-
|
|
12286
|
+
function calculateColumnMode(_ref) {
|
|
12287
|
+
let {
|
|
12288
|
+
maxVisibleRows,
|
|
12289
|
+
itemHeight,
|
|
12290
|
+
listCount,
|
|
12291
|
+
listHeight,
|
|
12292
|
+
columnAutoWidth,
|
|
12293
|
+
containerWidth,
|
|
12294
|
+
itemMinWidth
|
|
12295
|
+
} = _ref;
|
|
12296
|
+
let rowCount;
|
|
12297
|
+
const maxRows = (maxVisibleRows === null || maxVisibleRows === void 0 ? void 0 : maxVisibleRows.maxRows) || 3;
|
|
12298
|
+
const autoRowCount = Math.floor(listHeight / itemHeight);
|
|
12299
|
+
if (maxVisibleRows.auto !== false) {
|
|
12300
|
+
rowCount = autoRowCount;
|
|
12301
|
+
} else {
|
|
12302
|
+
rowCount = Math.min(listCount, maxRows, autoRowCount);
|
|
12303
|
+
}
|
|
12304
|
+
const columnCount = Math.ceil(listCount / rowCount);
|
|
12305
|
+
const columnWidth = Math.max(columnAutoWidth, containerWidth / columnCount, itemMinWidth);
|
|
12306
|
+
return {
|
|
12307
|
+
columnWidth,
|
|
12308
|
+
columnCount,
|
|
12309
|
+
rowCount
|
|
12310
|
+
};
|
|
12311
|
+
}
|
|
12184
12312
|
|
|
12185
|
-
const
|
|
12313
|
+
const SCROLL_BAR_WIDTH = 10; // TODO: ignore this - instead set the styling only show on hover...
|
|
12186
12314
|
const ITEM_MAX_WIDTH = 150;
|
|
12187
12315
|
const FREQUENCY_WIDTH = 40;
|
|
12316
|
+
const ITEM_MIN_WIDTH = 56;
|
|
12317
|
+
const CHECKBOX_WIDTH = 20;
|
|
12318
|
+
|
|
12319
|
+
function calculateRowMode(_ref) {
|
|
12320
|
+
let {
|
|
12321
|
+
maxVisibleColumns,
|
|
12322
|
+
listCount,
|
|
12323
|
+
containerWidth,
|
|
12324
|
+
columnAutoWidth,
|
|
12325
|
+
itemMinWidth
|
|
12326
|
+
} = _ref;
|
|
12327
|
+
const maxColumns = (maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.maxColumns) || 3;
|
|
12328
|
+
const innerWidth = containerWidth - SCROLL_BAR_WIDTH;
|
|
12329
|
+
let columnCount;
|
|
12330
|
+
const autoColumnCount = Math.min(listCount, Math.ceil(innerWidth / Math.max(itemMinWidth, columnAutoWidth))); // TODO: smarter sizing... based on glyph count + font size etc...??
|
|
12331
|
+
if ((maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.auto) !== false) {
|
|
12332
|
+
columnCount = autoColumnCount;
|
|
12333
|
+
} else {
|
|
12334
|
+
columnCount = Math.min(listCount, maxColumns, autoColumnCount);
|
|
12335
|
+
}
|
|
12336
|
+
const columnWidth = innerWidth / columnCount;
|
|
12337
|
+
const rowCount = Math.ceil(listCount / columnCount);
|
|
12338
|
+
return {
|
|
12339
|
+
rowCount,
|
|
12340
|
+
columnWidth,
|
|
12341
|
+
columnCount
|
|
12342
|
+
};
|
|
12343
|
+
}
|
|
12344
|
+
|
|
12188
12345
|
function getListSizes(_ref) {
|
|
12189
12346
|
let {
|
|
12190
12347
|
layout,
|
|
@@ -12193,7 +12350,8 @@ function getListSizes(_ref) {
|
|
|
12193
12350
|
listCount,
|
|
12194
12351
|
count,
|
|
12195
12352
|
textWidth,
|
|
12196
|
-
freqIsAllowed
|
|
12353
|
+
freqIsAllowed,
|
|
12354
|
+
checkboxes
|
|
12197
12355
|
} = _ref;
|
|
12198
12356
|
const {
|
|
12199
12357
|
layoutOptions = {}
|
|
@@ -12206,50 +12364,60 @@ function getListSizes(_ref) {
|
|
|
12206
12364
|
dataLayout
|
|
12207
12365
|
} = layoutOptions;
|
|
12208
12366
|
const frequencyAddWidth = freqIsAllowed ? FREQUENCY_WIDTH : 0;
|
|
12209
|
-
const
|
|
12367
|
+
const checkboxAddWidth = checkboxes ? CHECKBOX_WIDTH : 0;
|
|
12368
|
+
const dynamicItemMinWidth = ITEM_MIN_WIDTH + frequencyAddWidth + checkboxAddWidth;
|
|
12369
|
+
const columnAutoWidth = Math.max(Math.min(ITEM_MAX_WIDTH, textWidth + 18 + frequencyAddWidth + checkboxAddWidth), dynamicItemMinWidth);
|
|
12210
12370
|
let overflowStyling;
|
|
12211
12371
|
let columnCount;
|
|
12212
12372
|
let columnWidth;
|
|
12213
12373
|
let rowCount;
|
|
12214
12374
|
const isGridMode = dataLayout === 'grid';
|
|
12215
12375
|
const itemPadding = 4;
|
|
12216
|
-
const
|
|
12217
|
-
const
|
|
12218
|
-
let
|
|
12376
|
+
const denseItemHeight = 20;
|
|
12377
|
+
const normalItemHeight = isGridMode ? 32 : 29;
|
|
12378
|
+
let itemHeight = dense ? denseItemHeight : normalItemHeight;
|
|
12219
12379
|
if (isGridMode) {
|
|
12220
12380
|
// Emulate a margin between items using padding, since the list library
|
|
12221
12381
|
// needs an explicit row height and cannot handle margins.
|
|
12222
|
-
|
|
12382
|
+
itemHeight += itemPadding;
|
|
12223
12383
|
}
|
|
12224
|
-
const listHeight = height !== null && height !== void 0 ? height : 8 *
|
|
12384
|
+
const listHeight = height !== null && height !== void 0 ? height : 8 * itemHeight;
|
|
12225
12385
|
if (layoutOrder) {
|
|
12226
12386
|
// Modify container width to achieve the exact design with 8px margins on each side (left and right).
|
|
12227
12387
|
let containerWidth = width;
|
|
12228
12388
|
if (layoutOrder === 'row') {
|
|
12229
|
-
containerWidth += itemPadding * 2;
|
|
12230
12389
|
overflowStyling = {
|
|
12231
12390
|
overflowX: 'hidden'
|
|
12232
12391
|
};
|
|
12233
|
-
|
|
12234
|
-
|
|
12235
|
-
|
|
12236
|
-
|
|
12237
|
-
columnCount
|
|
12238
|
-
}
|
|
12239
|
-
|
|
12240
|
-
|
|
12392
|
+
containerWidth += itemPadding * 2;
|
|
12393
|
+
({
|
|
12394
|
+
rowCount,
|
|
12395
|
+
columnWidth,
|
|
12396
|
+
columnCount
|
|
12397
|
+
} = calculateRowMode({
|
|
12398
|
+
maxVisibleColumns,
|
|
12399
|
+
listCount,
|
|
12400
|
+
containerWidth,
|
|
12401
|
+
columnAutoWidth,
|
|
12402
|
+
itemMinWidth: dynamicItemMinWidth
|
|
12403
|
+
}));
|
|
12241
12404
|
} else {
|
|
12242
12405
|
overflowStyling = {
|
|
12243
12406
|
overflowY: 'hidden'
|
|
12244
12407
|
};
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
|
|
12248
|
-
|
|
12249
|
-
|
|
12250
|
-
|
|
12251
|
-
|
|
12252
|
-
|
|
12408
|
+
({
|
|
12409
|
+
rowCount,
|
|
12410
|
+
columnWidth,
|
|
12411
|
+
columnCount
|
|
12412
|
+
} = calculateColumnMode({
|
|
12413
|
+
maxVisibleRows,
|
|
12414
|
+
itemHeight,
|
|
12415
|
+
listCount,
|
|
12416
|
+
listHeight,
|
|
12417
|
+
columnAutoWidth,
|
|
12418
|
+
containerWidth,
|
|
12419
|
+
itemMinWidth: dynamicItemMinWidth
|
|
12420
|
+
}));
|
|
12253
12421
|
}
|
|
12254
12422
|
}
|
|
12255
12423
|
columnCount = (dataLayout === 'singleColumn' ? 1 : columnCount) || 1;
|
|
@@ -12266,9 +12434,9 @@ function getListSizes(_ref) {
|
|
|
12266
12434
|
columnWidth,
|
|
12267
12435
|
rowCount,
|
|
12268
12436
|
overflowStyling,
|
|
12269
|
-
|
|
12437
|
+
itemHeight,
|
|
12270
12438
|
listHeight,
|
|
12271
|
-
scrollBarWidth,
|
|
12439
|
+
scrollBarWidth: SCROLL_BAR_WIDTH,
|
|
12272
12440
|
count,
|
|
12273
12441
|
listCount: limitedListCount,
|
|
12274
12442
|
maxCount: {
|
|
@@ -12317,9 +12485,9 @@ function getHorizontalMinBatchSize(_ref) {
|
|
|
12317
12485
|
width,
|
|
12318
12486
|
columnWidth,
|
|
12319
12487
|
listHeight,
|
|
12320
|
-
|
|
12488
|
+
itemHeight
|
|
12321
12489
|
} = _ref;
|
|
12322
|
-
const visibleCellsCount = Math.ceil(width / columnWidth) * Math.ceil(listHeight /
|
|
12490
|
+
const visibleCellsCount = Math.ceil(width / columnWidth) * Math.ceil(listHeight / itemHeight);
|
|
12323
12491
|
const minSize = visibleCellsCount * 2;
|
|
12324
12492
|
return minSize;
|
|
12325
12493
|
}
|
|
@@ -12787,12 +12955,53 @@ function getFrequencyAllowed(_ref) {
|
|
|
12787
12955
|
return !!(widthPermitsFreq && (hasValidFreqOption || frequencyEnabled));
|
|
12788
12956
|
}
|
|
12789
12957
|
|
|
12958
|
+
const escapeField = field => {
|
|
12959
|
+
if (!field) {
|
|
12960
|
+
return field;
|
|
12961
|
+
}
|
|
12962
|
+
return "".concat(field.replace(/\]/g, ']]'));
|
|
12963
|
+
};
|
|
12964
|
+
const needToFetchFrequencyMax = layout => (layout === null || layout === void 0 ? void 0 : layout.frequencyMax) === 'fetch';
|
|
12965
|
+
const getFrequencyMaxExpression = field => {
|
|
12966
|
+
const escapedField = escapeField(field);
|
|
12967
|
+
return "Max(AGGR(Count(".concat(escapedField, "), ").concat(escapedField, "))");
|
|
12968
|
+
};
|
|
12969
|
+
const getFrequencyMax = async (layout, app) => {
|
|
12970
|
+
const dimInfo = layout.qListObject.qDimensionInfo;
|
|
12971
|
+
const field = dimInfo.qGroupFieldDefs[dimInfo.qGroupPos];
|
|
12972
|
+
const expression = getFrequencyMaxExpression(field);
|
|
12973
|
+
const evaluadedExpression = await app.evaluateEx(expression);
|
|
12974
|
+
return evaluadedExpression.qNumber;
|
|
12975
|
+
};
|
|
12976
|
+
|
|
12977
|
+
const useFrequencyMax = (app, layout) => {
|
|
12978
|
+
const needFetch = needToFetchFrequencyMax(layout);
|
|
12979
|
+
const [frequencyMax, setFrequencyMax] = useState$1();
|
|
12980
|
+
const [awaitingFrequencyMax, setAwaitingFrequencyMax] = useState$1(needFetch);
|
|
12981
|
+
useEffect$1(() => {
|
|
12982
|
+
if (!needFetch) {
|
|
12983
|
+
return;
|
|
12984
|
+
}
|
|
12985
|
+
const fetch = async () => {
|
|
12986
|
+
const newValue = await getFrequencyMax(layout, app);
|
|
12987
|
+
setFrequencyMax(newValue);
|
|
12988
|
+
setAwaitingFrequencyMax(false);
|
|
12989
|
+
};
|
|
12990
|
+
fetch();
|
|
12991
|
+
}, [needFetch && layout]);
|
|
12992
|
+
return {
|
|
12993
|
+
frequencyMax: needFetch ? frequencyMax : layout === null || layout === void 0 ? void 0 : layout.frequencyMax,
|
|
12994
|
+
awaitingFrequencyMax
|
|
12995
|
+
};
|
|
12996
|
+
};
|
|
12997
|
+
|
|
12790
12998
|
const _excluded$4 = ["isLoadingData"];
|
|
12791
12999
|
const DEFAULT_MIN_BATCH_SIZE = 100;
|
|
12792
13000
|
function ListBox(_ref) {
|
|
12793
13001
|
var _layout$qListObject$q, _loaderRef$current, _loaderRef$current$_l, _loaderRef$current$_l2;
|
|
12794
13002
|
let {
|
|
12795
13003
|
model,
|
|
13004
|
+
app,
|
|
12796
13005
|
constraints,
|
|
12797
13006
|
layout,
|
|
12798
13007
|
selections,
|
|
@@ -12816,7 +13025,9 @@ function ListBox(_ref) {
|
|
|
12816
13025
|
},
|
|
12817
13026
|
currentScrollIndex = {
|
|
12818
13027
|
set: () => {}
|
|
12819
|
-
}
|
|
13028
|
+
},
|
|
13029
|
+
renderedCallback,
|
|
13030
|
+
onCtrlF
|
|
12820
13031
|
} = _ref;
|
|
12821
13032
|
const [initScrollPosIsSet, setInitScrollPosIsSet] = useState$1(false);
|
|
12822
13033
|
const isSingleSelect = !!(layout && layout.qListObject.qDimensionInfo.qIsOneAndOnlyOne);
|
|
@@ -12836,6 +13047,10 @@ function ListBox(_ref) {
|
|
|
12836
13047
|
|
|
12837
13048
|
// The time from scroll end until new data is being fetched, may be exposed in API later on.
|
|
12838
13049
|
const scrollTimeout = 0;
|
|
13050
|
+
const {
|
|
13051
|
+
frequencyMax,
|
|
13052
|
+
awaitingFrequencyMax
|
|
13053
|
+
} = useFrequencyMax(app, layout);
|
|
12839
13054
|
const _useItemsLoader = useItemsLoader({
|
|
12840
13055
|
local,
|
|
12841
13056
|
loaderRef,
|
|
@@ -12861,11 +13076,15 @@ function ListBox(_ref) {
|
|
|
12861
13076
|
if (itemsLoader !== null && itemsLoader !== void 0 && itemsLoader.pages) {
|
|
12862
13077
|
selectionState.update({
|
|
12863
13078
|
setPages,
|
|
12864
|
-
pages: itemsLoader
|
|
13079
|
+
pages: itemsLoader.pages,
|
|
12865
13080
|
isSingleSelect,
|
|
12866
13081
|
selectDisabled,
|
|
12867
13082
|
layout
|
|
12868
13083
|
});
|
|
13084
|
+
if (itemsLoader.pages.length && !awaitingFrequencyMax) {
|
|
13085
|
+
// All necessary data fetching done - signal rendering done!
|
|
13086
|
+
renderedCallback();
|
|
13087
|
+
}
|
|
12869
13088
|
}
|
|
12870
13089
|
const isItemLoaded = useCallback(index => {
|
|
12871
13090
|
if (!(pages !== null && pages !== void 0 && pages.length) || !local.current.validPages) {
|
|
@@ -12959,7 +13178,8 @@ function ListBox(_ref) {
|
|
|
12959
13178
|
listCount: unlimitedListCount,
|
|
12960
13179
|
count,
|
|
12961
13180
|
textWidth,
|
|
12962
|
-
freqIsAllowed
|
|
13181
|
+
freqIsAllowed,
|
|
13182
|
+
checkboxes
|
|
12963
13183
|
});
|
|
12964
13184
|
if (sizes.columnWidth) {
|
|
12965
13185
|
// In grid mode, where we have a dynamic item width, get a second opinion on showing/hiding frequency.
|
|
@@ -13023,6 +13243,10 @@ function ListBox(_ref) {
|
|
|
13023
13243
|
last
|
|
13024
13244
|
}))
|
|
13025
13245
|
});
|
|
13246
|
+
const selectAll = () => {
|
|
13247
|
+
selectionState.clearItemStates(false);
|
|
13248
|
+
model.selectListObjectAll('/qListObjectDef');
|
|
13249
|
+
};
|
|
13026
13250
|
const {
|
|
13027
13251
|
List,
|
|
13028
13252
|
Grid
|
|
@@ -13038,6 +13262,8 @@ function ListBox(_ref) {
|
|
|
13038
13262
|
showGray,
|
|
13039
13263
|
interactionEvents,
|
|
13040
13264
|
select,
|
|
13265
|
+
selectAll,
|
|
13266
|
+
onCtrlF,
|
|
13041
13267
|
textAlign,
|
|
13042
13268
|
isVertical,
|
|
13043
13269
|
pages,
|
|
@@ -13056,19 +13282,20 @@ function ListBox(_ref) {
|
|
|
13056
13282
|
focusListItems: getFocusState(),
|
|
13057
13283
|
setCurrentScrollIndex: currentScrollIndex.set,
|
|
13058
13284
|
constraints,
|
|
13285
|
+
frequencyMax,
|
|
13059
13286
|
freqIsAllowed
|
|
13060
13287
|
});
|
|
13061
13288
|
const {
|
|
13062
13289
|
columnWidth,
|
|
13063
13290
|
listHeight,
|
|
13064
|
-
|
|
13291
|
+
itemHeight
|
|
13065
13292
|
} = sizes || {};
|
|
13066
13293
|
if (!isVertical) {
|
|
13067
13294
|
minimumBatchSize = getHorizontalMinBatchSize({
|
|
13068
13295
|
width,
|
|
13069
13296
|
columnWidth,
|
|
13070
13297
|
listHeight,
|
|
13071
|
-
|
|
13298
|
+
itemHeight
|
|
13072
13299
|
});
|
|
13073
13300
|
}
|
|
13074
13301
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !listCount && /*#__PURE__*/React__default.createElement(ListBoxDisclaimer, {
|
|
@@ -13427,6 +13654,7 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
|
|
|
13427
13654
|
|
|
13428
13655
|
const PREFIX$7 = 'ActionsToolbar';
|
|
13429
13656
|
const classes$7 = {
|
|
13657
|
+
item: "".concat(PREFIX$7, "-item"),
|
|
13430
13658
|
itemSpacing: "".concat(PREFIX$7, "-itemSpacing"),
|
|
13431
13659
|
firstItemSpacing: "".concat(PREFIX$7, "-firstItemSpacing"),
|
|
13432
13660
|
lastItemSpacing: "".concat(PREFIX$7, "-lastItemSpacing")
|
|
@@ -13463,25 +13691,27 @@ const ActionsGroup = React__default.forwardRef((_ref2, ref) => {
|
|
|
13463
13691
|
actions = [],
|
|
13464
13692
|
first = false,
|
|
13465
13693
|
last = false,
|
|
13466
|
-
addAnchor = false
|
|
13694
|
+
addAnchor = false,
|
|
13695
|
+
isRtl = false
|
|
13467
13696
|
} = _ref2;
|
|
13468
13697
|
return actions.length > 0 ? /*#__PURE__*/React__default.createElement(Grid, {
|
|
13469
13698
|
item: true,
|
|
13470
13699
|
container: true,
|
|
13471
13700
|
gap: 0,
|
|
13701
|
+
flexDirection: isRtl ? 'row-reverse' : 'row',
|
|
13472
13702
|
wrap: "nowrap"
|
|
13473
13703
|
}, actions.map((e, ix) => {
|
|
13474
13704
|
let cls = [];
|
|
13475
13705
|
const isFirstItem = first && ix === 0;
|
|
13476
13706
|
const isLastItem = last && actions.length - 1 === ix;
|
|
13477
13707
|
if (isFirstItem && !isLastItem) {
|
|
13478
|
-
cls = [classes$7.firstItemSpacing];
|
|
13708
|
+
cls = [classes$7.firstItemSpacing, classes$7.item];
|
|
13479
13709
|
}
|
|
13480
13710
|
if (isLastItem && !isFirstItem) {
|
|
13481
|
-
cls = [...cls, classes$7.lastItemSpacing];
|
|
13711
|
+
cls = [...cls, classes$7.lastItemSpacing, classes$7.item];
|
|
13482
13712
|
}
|
|
13483
13713
|
if (!isFirstItem && !isLastItem && cls.length === 0) {
|
|
13484
|
-
cls = [classes$7.itemSpacing];
|
|
13714
|
+
cls = [classes$7.itemSpacing, classes$7.item];
|
|
13485
13715
|
}
|
|
13486
13716
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
13487
13717
|
item: true,
|
|
@@ -13530,7 +13760,9 @@ function ActionsToolbar(_ref3) {
|
|
|
13530
13760
|
anchorEl: null
|
|
13531
13761
|
},
|
|
13532
13762
|
focusHandler = null,
|
|
13533
|
-
actionsRefMock = null
|
|
13763
|
+
actionsRefMock = null,
|
|
13764
|
+
// for testing
|
|
13765
|
+
direction = 'ltr'
|
|
13534
13766
|
} = _ref3;
|
|
13535
13767
|
const defaultSelectionActions = useDefaultSelectionActions(selections);
|
|
13536
13768
|
const {
|
|
@@ -13603,12 +13835,16 @@ function ActionsToolbar(_ref3) {
|
|
|
13603
13835
|
const showActions = newActions.length > 0;
|
|
13604
13836
|
const showMore = moreActions.length > 0;
|
|
13605
13837
|
const showDivider = showActions && selections.show || showMore && selections.show;
|
|
13838
|
+
const isRtl = direction === 'rtl';
|
|
13606
13839
|
const Actions = /*#__PURE__*/React__default.createElement(Grid, {
|
|
13607
13840
|
ref: actionsRef,
|
|
13608
13841
|
onKeyDown: tabCallback,
|
|
13609
13842
|
container: true,
|
|
13610
13843
|
gap: 0,
|
|
13611
|
-
wrap: "nowrap"
|
|
13844
|
+
wrap: "nowrap",
|
|
13845
|
+
sx: {
|
|
13846
|
+
flexDirection: isRtl ? 'row-reverse' : 'row'
|
|
13847
|
+
}
|
|
13612
13848
|
}, showActions && /*#__PURE__*/React__default.createElement(ActionsGroup, {
|
|
13613
13849
|
actions: newActions,
|
|
13614
13850
|
first: true,
|
|
@@ -13629,7 +13865,8 @@ function ActionsToolbar(_ref3) {
|
|
|
13629
13865
|
})), selections.show && /*#__PURE__*/React__default.createElement(ActionsGroup, {
|
|
13630
13866
|
actions: defaultSelectionActions,
|
|
13631
13867
|
first: !showActions && !showMore,
|
|
13632
|
-
last: true
|
|
13868
|
+
last: true,
|
|
13869
|
+
isRtl: isRtl
|
|
13633
13870
|
}), showMoreItems && /*#__PURE__*/React__default.createElement(More$1, {
|
|
13634
13871
|
show: showMoreItems,
|
|
13635
13872
|
actions: moreActions,
|
|
@@ -13685,7 +13922,8 @@ const StyledOutlinedInput = styled$1(OutlinedInput)(_ref2 => {
|
|
|
13685
13922
|
theme
|
|
13686
13923
|
} = _ref2;
|
|
13687
13924
|
return {
|
|
13688
|
-
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
|
|
13925
|
+
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,
|
|
13926
|
+
display: 'flex'
|
|
13689
13927
|
};
|
|
13690
13928
|
});
|
|
13691
13929
|
function ListBoxSearch(_ref3) {
|
|
@@ -13698,7 +13936,9 @@ function ListBoxSearch(_ref3) {
|
|
|
13698
13936
|
visible = true,
|
|
13699
13937
|
autoFocus = true,
|
|
13700
13938
|
wildCardSearch = false,
|
|
13701
|
-
searchEnabled
|
|
13939
|
+
searchEnabled,
|
|
13940
|
+
direction,
|
|
13941
|
+
hide
|
|
13702
13942
|
} = _ref3;
|
|
13703
13943
|
const {
|
|
13704
13944
|
translator
|
|
@@ -13710,6 +13950,8 @@ function ListBoxSearch(_ref3) {
|
|
|
13710
13950
|
const {
|
|
13711
13951
|
getStoreValue
|
|
13712
13952
|
} = useDataStore(model);
|
|
13953
|
+
const isRtl = direction === 'rtl';
|
|
13954
|
+
const inpuTextAlign = isRtl ? 'right' : 'left';
|
|
13713
13955
|
const cancel = () => selections.isActive() && selections.cancel();
|
|
13714
13956
|
const abortSearch = async () => {
|
|
13715
13957
|
if (!selections.isModal()) {
|
|
@@ -13782,6 +14024,16 @@ function ListBoxSearch(_ref3) {
|
|
|
13782
14024
|
e.preventDefault();
|
|
13783
14025
|
e.stopPropagation();
|
|
13784
14026
|
break;
|
|
14027
|
+
case 'f':
|
|
14028
|
+
case 'F':
|
|
14029
|
+
if (e.ctrlKey || e.metaKey) {
|
|
14030
|
+
if (hide) {
|
|
14031
|
+
hide();
|
|
14032
|
+
}
|
|
14033
|
+
e.preventDefault();
|
|
14034
|
+
e.stopPropagation();
|
|
14035
|
+
}
|
|
14036
|
+
break;
|
|
13785
14037
|
}
|
|
13786
14038
|
return response;
|
|
13787
14039
|
};
|
|
@@ -13797,6 +14049,7 @@ function ListBoxSearch(_ref3) {
|
|
|
13797
14049
|
className: "search",
|
|
13798
14050
|
sx: [{
|
|
13799
14051
|
border: 'none',
|
|
14052
|
+
fontSize: 14,
|
|
13800
14053
|
borderRadius: 0,
|
|
13801
14054
|
backgroundColor: 'transparent',
|
|
13802
14055
|
'& fieldset': {
|
|
@@ -13815,6 +14068,8 @@ function ListBoxSearch(_ref3) {
|
|
|
13815
14068
|
paddingTop: '5px',
|
|
13816
14069
|
paddingBottom: '5px'
|
|
13817
14070
|
}
|
|
14071
|
+
}, {
|
|
14072
|
+
flexDirection: isRtl ? 'row-reverse' : 'row'
|
|
13818
14073
|
}],
|
|
13819
14074
|
inputRef: inputRef,
|
|
13820
14075
|
size: "small",
|
|
@@ -13826,7 +14081,10 @@ function ListBoxSearch(_ref3) {
|
|
|
13826
14081
|
onKeyDown: onKeyDown,
|
|
13827
14082
|
autoFocus: autoFocus,
|
|
13828
14083
|
inputProps: {
|
|
13829
|
-
tabIndex: keyboard && (!keyboard.enabled || keyboard.active) ? 0 : -1
|
|
14084
|
+
tabIndex: keyboard && (!keyboard.enabled || keyboard.active) ? 0 : -1,
|
|
14085
|
+
style: {
|
|
14086
|
+
textAlign: "".concat(inpuTextAlign)
|
|
14087
|
+
}
|
|
13830
14088
|
}
|
|
13831
14089
|
});
|
|
13832
14090
|
}
|
|
@@ -14233,6 +14491,7 @@ function ListBoxPopover(_ref) {
|
|
|
14233
14491
|
const open = show && Boolean(alignTo.current);
|
|
14234
14492
|
const [listCount, setListCount] = useState$1(0);
|
|
14235
14493
|
const theme = useTheme$1();
|
|
14494
|
+
const searchContainerRef = useRef();
|
|
14236
14495
|
const [model] = useSessionModel({
|
|
14237
14496
|
qInfo: {
|
|
14238
14497
|
qType: 'njsListbox'
|
|
@@ -14294,6 +14553,10 @@ function ListBoxPopover(_ref) {
|
|
|
14294
14553
|
translator,
|
|
14295
14554
|
selectionState: selectionState$1
|
|
14296
14555
|
});
|
|
14556
|
+
const onCtrlF = () => {
|
|
14557
|
+
const input = searchContainerRef.current.querySelector('input');
|
|
14558
|
+
input === null || input === void 0 ? void 0 : input.focus();
|
|
14559
|
+
};
|
|
14297
14560
|
const hasSelections$1 = hasSelections(layout);
|
|
14298
14561
|
return /*#__PURE__*/React__default.createElement(Popover, {
|
|
14299
14562
|
open: open,
|
|
@@ -14360,7 +14623,10 @@ function ListBoxPopover(_ref) {
|
|
|
14360
14623
|
xs: true
|
|
14361
14624
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
14362
14625
|
ref: moreAlignTo
|
|
14363
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
14626
|
+
}), /*#__PURE__*/React__default.createElement(Grid, {
|
|
14627
|
+
item: true,
|
|
14628
|
+
ref: searchContainerRef
|
|
14629
|
+
}, /*#__PURE__*/React__default.createElement(ListBoxSearch, {
|
|
14364
14630
|
visible: true,
|
|
14365
14631
|
model: model,
|
|
14366
14632
|
listCount: listCount,
|
|
@@ -14370,13 +14636,15 @@ function ListBoxPopover(_ref) {
|
|
|
14370
14636
|
enabled: false
|
|
14371
14637
|
},
|
|
14372
14638
|
autoFocus: autoFocus !== null && autoFocus !== void 0 ? autoFocus : true
|
|
14373
|
-
}), /*#__PURE__*/React__default.createElement(ListBox, {
|
|
14639
|
+
})), /*#__PURE__*/React__default.createElement(ListBox, {
|
|
14374
14640
|
model: model,
|
|
14641
|
+
app: app,
|
|
14375
14642
|
layout: layout,
|
|
14376
14643
|
selections: selections,
|
|
14377
14644
|
selectionState: selectionState$1,
|
|
14378
14645
|
direction: "ltr",
|
|
14379
|
-
onSetListCount: c => setListCount(c)
|
|
14646
|
+
onSetListCount: c => setListCount(c),
|
|
14647
|
+
onCtrlF: onCtrlF
|
|
14380
14648
|
}))));
|
|
14381
14649
|
}
|
|
14382
14650
|
|
|
@@ -15645,20 +15913,21 @@ const drillDown = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
15645
15913
|
var DrillDownIcon = (props => SvgIcon$2(drillDown(props)));
|
|
15646
15914
|
|
|
15647
15915
|
const addListboxTheme = themeApi => {
|
|
15648
|
-
const getListboxStyle = prop => themeApi.getStyle('object',
|
|
15916
|
+
const getListboxStyle = (path, prop) => themeApi.getStyle('object.listBox', path, prop);
|
|
15649
15917
|
return {
|
|
15650
|
-
backgroundColor: getListboxStyle('backgroundColor'),
|
|
15918
|
+
backgroundColor: getListboxStyle('', 'backgroundColor'),
|
|
15651
15919
|
title: {
|
|
15652
15920
|
main: {
|
|
15653
|
-
color: getListboxStyle('title.main
|
|
15654
|
-
fontSize: getListboxStyle('title.main
|
|
15655
|
-
fontFamily: getListboxStyle('title.main
|
|
15921
|
+
color: getListboxStyle('title.main', 'color'),
|
|
15922
|
+
fontSize: getListboxStyle('title.main', 'fontSize'),
|
|
15923
|
+
fontFamily: getListboxStyle('title.main', 'fontFamily'),
|
|
15924
|
+
fontWeight: getListboxStyle('title.main', 'fontWeight')
|
|
15656
15925
|
}
|
|
15657
15926
|
},
|
|
15658
15927
|
content: {
|
|
15659
|
-
color: getListboxStyle('content
|
|
15660
|
-
fontSize: getListboxStyle('content
|
|
15661
|
-
fontFamily: getListboxStyle('content
|
|
15928
|
+
color: getListboxStyle('content', 'color'),
|
|
15929
|
+
fontSize: getListboxStyle('content', 'fontSize'),
|
|
15930
|
+
fontFamily: getListboxStyle('content', 'fontFamily')
|
|
15662
15931
|
}
|
|
15663
15932
|
};
|
|
15664
15933
|
};
|
|
@@ -15732,7 +16001,7 @@ const StyledGrid$3 = styled$1(Grid, {
|
|
|
15732
16001
|
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,
|
|
15733
16002
|
["& .".concat(classes$4.listBoxHeader)]: {
|
|
15734
16003
|
alignSelf: 'center',
|
|
15735
|
-
display: '
|
|
16004
|
+
display: 'flex',
|
|
15736
16005
|
width: "calc(100% - ".concat(BUTTON_ICON_WIDTH, "px)")
|
|
15737
16006
|
},
|
|
15738
16007
|
["& .".concat(classes$4.screenReaderOnly)]: {
|
|
@@ -15743,18 +16012,25 @@ const StyledGrid$3 = styled$1(Grid, {
|
|
|
15743
16012
|
},
|
|
15744
16013
|
["& .".concat(classes$4.listboxWrapper)]: {
|
|
15745
16014
|
padding: containerPadding
|
|
16015
|
+
},
|
|
16016
|
+
'&:focus:not(:hover)': {
|
|
16017
|
+
boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder, " !important")
|
|
16018
|
+
},
|
|
16019
|
+
'&:focus-visible': {
|
|
16020
|
+
outline: 'none'
|
|
15746
16021
|
}
|
|
15747
16022
|
};
|
|
15748
16023
|
});
|
|
15749
16024
|
const Title = styled$1(Typography)(_ref2 => {
|
|
15750
|
-
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;
|
|
16025
|
+
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;
|
|
15751
16026
|
let {
|
|
15752
16027
|
theme
|
|
15753
16028
|
} = _ref2;
|
|
15754
16029
|
return {
|
|
15755
16030
|
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,
|
|
15756
16031
|
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,
|
|
15757
|
-
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
|
|
16032
|
+
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,
|
|
16033
|
+
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'
|
|
15758
16034
|
};
|
|
15759
16035
|
});
|
|
15760
16036
|
function ListBoxInline(_ref3) {
|
|
@@ -15779,7 +16055,8 @@ function ListBoxInline(_ref3) {
|
|
|
15779
16055
|
postProcessPages = undefined,
|
|
15780
16056
|
calculatePagesHeight,
|
|
15781
16057
|
showGray = true,
|
|
15782
|
-
scrollState = undefined
|
|
16058
|
+
scrollState = undefined,
|
|
16059
|
+
renderedCallback
|
|
15783
16060
|
} = options;
|
|
15784
16061
|
let {
|
|
15785
16062
|
toolbar = true
|
|
@@ -15894,6 +16171,7 @@ function ListBoxInline(_ref3) {
|
|
|
15894
16171
|
return null;
|
|
15895
16172
|
}
|
|
15896
16173
|
const isLocked = layout.qListObject.qDimensionInfo.qLocked === true;
|
|
16174
|
+
const isRtl = direction === 'rtl';
|
|
15897
16175
|
const isDrillDown = layout.qListObject.qDimensionInfo.qGrouping === 'H';
|
|
15898
16176
|
const listboxSelectionToolbarItems = createListboxSelectionToolbar({
|
|
15899
16177
|
layout,
|
|
@@ -15901,24 +16179,31 @@ function ListBoxInline(_ref3) {
|
|
|
15901
16179
|
translator,
|
|
15902
16180
|
selectionState: selectionState$1
|
|
15903
16181
|
});
|
|
15904
|
-
const showSearchToggle = search === 'toggle' && showSearch;
|
|
15905
|
-
const searchVisible = (search === true || showSearchToggle) && !selectDisabled();
|
|
15906
16182
|
const {
|
|
16183
|
+
wildCardSearch,
|
|
16184
|
+
searchEnabled,
|
|
15907
16185
|
layoutOptions = {}
|
|
15908
16186
|
} = layout;
|
|
16187
|
+
const showSearchToggle = search === 'toggle' && showSearch;
|
|
16188
|
+
const searchVisible = (search === true || showSearchToggle) && !selectDisabled() && searchEnabled !== false;
|
|
15909
16189
|
const dense = (_layoutOptions$dense = layoutOptions.dense) !== null && _layoutOptions$dense !== void 0 ? _layoutOptions$dense : false;
|
|
15910
16190
|
const searchHeight = dense ? 27 : 40;
|
|
15911
16191
|
const extraheight = dense ? 39 : 49;
|
|
15912
|
-
const
|
|
16192
|
+
const searchAddHeight = searchVisible ? searchHeight : 0;
|
|
16193
|
+
const minHeight = toolbar ? 49 + searchAddHeight + extraheight : 0;
|
|
15913
16194
|
const headerHeight = 32;
|
|
15914
|
-
const {
|
|
15915
|
-
wildCardSearch,
|
|
15916
|
-
searchEnabled
|
|
15917
|
-
} = layout;
|
|
15918
16195
|
const onShowSearch = () => {
|
|
15919
16196
|
const newValue = !showSearch;
|
|
15920
16197
|
setShowSearch(newValue);
|
|
15921
16198
|
};
|
|
16199
|
+
const onCtrlF = () => {
|
|
16200
|
+
if (search === 'toggle') {
|
|
16201
|
+
onShowSearch();
|
|
16202
|
+
} else {
|
|
16203
|
+
const input = searchContainer.current.querySelector('input');
|
|
16204
|
+
input === null || input === void 0 ? void 0 : input.focus();
|
|
16205
|
+
}
|
|
16206
|
+
};
|
|
15922
16207
|
const getActionToolbarProps = isPopover => getListboxActionProps({
|
|
15923
16208
|
isPopover,
|
|
15924
16209
|
showToolbar,
|
|
@@ -15933,6 +16218,7 @@ function ListBoxInline(_ref3) {
|
|
|
15933
16218
|
const showIcons = showSearchOrLockIcon || isDrillDown;
|
|
15934
16219
|
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
|
|
15935
16220
|
const headerPaddingLeft = CELL_PADDING_LEFT - (showSearchOrLockIcon ? ICON_PADDING : 0);
|
|
16221
|
+
const headerPaddingRight = isRtl ? CELL_PADDING_LEFT - (showIcons ? ICON_PADDING : 0) : 0;
|
|
15936
16222
|
|
|
15937
16223
|
// Add a container padding for grid mode to harmonize with the grid item margins (should sum to 8px).
|
|
15938
16224
|
const isGridMode = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.dataLayout) === 'grid';
|
|
@@ -15940,7 +16226,9 @@ function ListBoxInline(_ref3) {
|
|
|
15940
16226
|
if (isGridMode) {
|
|
15941
16227
|
containerPadding = layoutOptions.layoutOrder === 'row' ? '2px 4px' : '2px 6px 2px 4px';
|
|
15942
16228
|
}
|
|
15943
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, toolbarDetachedOnly && /*#__PURE__*/React__default.createElement(ActionsToolbar,
|
|
16229
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, toolbarDetachedOnly && /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$6({
|
|
16230
|
+
direction: direction
|
|
16231
|
+
}, getActionToolbarProps(true))), /*#__PURE__*/React__default.createElement(StyledGrid$3, {
|
|
15944
16232
|
className: "listbox-container",
|
|
15945
16233
|
container: true,
|
|
15946
16234
|
tabIndex: keyboard.enabled && !keyboard.active ? 0 : -1,
|
|
@@ -15961,13 +16249,20 @@ function ListBoxInline(_ref3) {
|
|
|
15961
16249
|
container: true,
|
|
15962
16250
|
style: {
|
|
15963
16251
|
padding: theme.spacing(1),
|
|
15964
|
-
paddingLeft: "".concat(headerPaddingLeft, "px")
|
|
16252
|
+
paddingLeft: "".concat(headerPaddingLeft, "px"),
|
|
16253
|
+
paddingRight: "".concat(headerPaddingRight, "px")
|
|
16254
|
+
},
|
|
16255
|
+
sx: {
|
|
16256
|
+
flexDirection: isRtl ? 'row-reverse' : 'row'
|
|
15965
16257
|
},
|
|
15966
16258
|
wrap: "nowrap"
|
|
15967
16259
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
15968
16260
|
item: true,
|
|
15969
16261
|
container: true,
|
|
15970
16262
|
height: headerHeight,
|
|
16263
|
+
sx: {
|
|
16264
|
+
flexDirection: isRtl ? 'row-reverse' : 'row'
|
|
16265
|
+
},
|
|
15971
16266
|
wrap: "nowrap"
|
|
15972
16267
|
}, showIcons && /*#__PURE__*/React__default.createElement(Grid, {
|
|
15973
16268
|
item: true,
|
|
@@ -15977,12 +16272,12 @@ function ListBoxInline(_ref3) {
|
|
|
15977
16272
|
width: iconsWidth
|
|
15978
16273
|
}
|
|
15979
16274
|
}, isLocked ? /*#__PURE__*/React__default.createElement(IconButton, {
|
|
16275
|
+
title: translator.get('SelectionToolbar.ClickToUnlock'),
|
|
15980
16276
|
tabIndex: -1,
|
|
15981
16277
|
onClick: unlock,
|
|
15982
16278
|
disabled: selectDisabled(),
|
|
15983
16279
|
size: "large"
|
|
15984
16280
|
}, /*#__PURE__*/React__default.createElement(Lock, {
|
|
15985
|
-
title: translator.get('Listbox.Unlock'),
|
|
15986
16281
|
disableRipple: true,
|
|
15987
16282
|
style: {
|
|
15988
16283
|
fontSize: '12px'
|
|
@@ -16007,6 +16302,9 @@ function ListBoxInline(_ref3) {
|
|
|
16007
16302
|
}
|
|
16008
16303
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
16009
16304
|
item: true,
|
|
16305
|
+
sx: {
|
|
16306
|
+
justifyContent: isRtl ? 'flex-end' : 'flex-start'
|
|
16307
|
+
},
|
|
16010
16308
|
className: classes$4.listBoxHeader
|
|
16011
16309
|
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
16012
16310
|
variant: "h6",
|
|
@@ -16018,17 +16316,19 @@ function ListBoxInline(_ref3) {
|
|
|
16018
16316
|
xs: true
|
|
16019
16317
|
}), /*#__PURE__*/React__default.createElement(Grid, {
|
|
16020
16318
|
item: true
|
|
16021
|
-
}, /*#__PURE__*/React__default.createElement(ActionsToolbar,
|
|
16319
|
+
}, /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$6({
|
|
16320
|
+
direction: direction
|
|
16321
|
+
}, getActionToolbarProps(showToolbarDetached({
|
|
16022
16322
|
containerRef,
|
|
16023
16323
|
titleRef,
|
|
16024
16324
|
iconsWidth
|
|
16025
|
-
}))))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
16325
|
+
})))))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
16026
16326
|
item: true,
|
|
16027
16327
|
container: true,
|
|
16028
16328
|
direction: "column",
|
|
16029
16329
|
style: {
|
|
16030
16330
|
height: '100%',
|
|
16031
|
-
minHeight:
|
|
16331
|
+
minHeight: '50px'
|
|
16032
16332
|
},
|
|
16033
16333
|
role: "region",
|
|
16034
16334
|
"aria-label": translator.get('Listbox.ResultFilterLabel')
|
|
@@ -16046,9 +16346,10 @@ function ListBoxInline(_ref3) {
|
|
|
16046
16346
|
visible: searchVisible,
|
|
16047
16347
|
search: search,
|
|
16048
16348
|
autoFocus: shouldAutoFocus,
|
|
16049
|
-
searchContainerRef: searchContainerRef,
|
|
16050
16349
|
wildCardSearch: wildCardSearch,
|
|
16051
|
-
searchEnabled: searchEnabled
|
|
16350
|
+
searchEnabled: searchEnabled,
|
|
16351
|
+
direction: direction,
|
|
16352
|
+
hide: showSearchIcon && onShowSearch
|
|
16052
16353
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
16053
16354
|
item: true,
|
|
16054
16355
|
xs: true,
|
|
@@ -16062,6 +16363,7 @@ function ListBoxInline(_ref3) {
|
|
|
16062
16363
|
} = _ref4;
|
|
16063
16364
|
return /*#__PURE__*/React__default.createElement(ListBox, {
|
|
16064
16365
|
model: model,
|
|
16366
|
+
app: app,
|
|
16065
16367
|
constraints: constraints,
|
|
16066
16368
|
layout: layout,
|
|
16067
16369
|
selections: selections,
|
|
@@ -16091,7 +16393,9 @@ function ListBoxInline(_ref3) {
|
|
|
16091
16393
|
currentScrollIndex: {
|
|
16092
16394
|
state: currentScrollIndex,
|
|
16093
16395
|
set: setCurrentScrollIndex
|
|
16094
|
-
}
|
|
16396
|
+
},
|
|
16397
|
+
renderedCallback: renderedCallback,
|
|
16398
|
+
onCtrlF: onCtrlF
|
|
16095
16399
|
});
|
|
16096
16400
|
})))));
|
|
16097
16401
|
}
|
|
@@ -16169,7 +16473,13 @@ function useOnTheFlyModel(_ref) {
|
|
|
16169
16473
|
const dim = await app.getDimension(fieldIdentifier.qLibraryId);
|
|
16170
16474
|
const dimLayout = await dim.getLayout();
|
|
16171
16475
|
setFallbackTitle(dimLayout.qDim.title);
|
|
16172
|
-
|
|
16476
|
+
if (dimLayout.qDim.qGrouping === 'N') {
|
|
16477
|
+
setFieldDef(dimLayout.qDim.qFieldDefs ? dimLayout.qDim.qFieldDefs[0] : '');
|
|
16478
|
+
} else {
|
|
16479
|
+
setFieldDef({
|
|
16480
|
+
multiFieldDim: true
|
|
16481
|
+
});
|
|
16482
|
+
}
|
|
16173
16483
|
setIsFetching(false);
|
|
16174
16484
|
} catch (e) {
|
|
16175
16485
|
setIsFetching(false);
|
|
@@ -16279,11 +16589,16 @@ function useOnTheFlyModel(_ref) {
|
|
|
16279
16589
|
listdef.qListObjectDef.qDef.qFieldDefs = [fieldIdentifier];
|
|
16280
16590
|
fieldName = fieldIdentifier;
|
|
16281
16591
|
}
|
|
16282
|
-
if (frequencyMode !== '
|
|
16283
|
-
|
|
16284
|
-
|
|
16285
|
-
|
|
16286
|
-
}
|
|
16592
|
+
if (frequencyMode !== 'P' && histogram) {
|
|
16593
|
+
if (fieldDef !== null && fieldDef !== void 0 && fieldDef.multiFieldDim) {
|
|
16594
|
+
listdef.frequencyMax = 'fetch';
|
|
16595
|
+
// maybe for all lib dimension to handle if it properties change
|
|
16596
|
+
} else {
|
|
16597
|
+
const field = fieldIdentifier.qLibraryId ? fieldDef : fieldName;
|
|
16598
|
+
listdef.frequencyMax = {
|
|
16599
|
+
qValueExpression: getFrequencyMaxExpression(field)
|
|
16600
|
+
};
|
|
16601
|
+
}
|
|
16287
16602
|
}
|
|
16288
16603
|
const [sessionModel] = useSessionModel(listdef, isFetching ? null : app, fieldName, stateName);
|
|
16289
16604
|
useEffect$1(() => {
|
|
@@ -16360,7 +16675,8 @@ function ListBoxWrapper(_ref) {
|
|
|
16360
16675
|
qId,
|
|
16361
16676
|
stateName,
|
|
16362
16677
|
element,
|
|
16363
|
-
options
|
|
16678
|
+
options,
|
|
16679
|
+
renderedCallback
|
|
16364
16680
|
} = _ref;
|
|
16365
16681
|
const {
|
|
16366
16682
|
isExistingObject,
|
|
@@ -16391,7 +16707,8 @@ function ListBoxWrapper(_ref) {
|
|
|
16391
16707
|
const opts = useMemo$1(() => _objectSpread2(_objectSpread2({}, options), {}, {
|
|
16392
16708
|
selections,
|
|
16393
16709
|
model,
|
|
16394
|
-
app
|
|
16710
|
+
app,
|
|
16711
|
+
renderedCallback
|
|
16395
16712
|
}), [options, selections, model, app]);
|
|
16396
16713
|
if (!selections || !model) {
|
|
16397
16714
|
return null;
|
|
@@ -16407,7 +16724,8 @@ function ListBoxPortal(_ref2) {
|
|
|
16407
16724
|
fieldIdentifier,
|
|
16408
16725
|
qId,
|
|
16409
16726
|
stateName = '$',
|
|
16410
|
-
options = {}
|
|
16727
|
+
options = {},
|
|
16728
|
+
renderedCallback
|
|
16411
16729
|
} = _ref2;
|
|
16412
16730
|
return ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(ListBoxWrapper, {
|
|
16413
16731
|
app: app,
|
|
@@ -16415,7 +16733,8 @@ function ListBoxPortal(_ref2) {
|
|
|
16415
16733
|
fieldIdentifier: fieldIdentifier,
|
|
16416
16734
|
qId: qId,
|
|
16417
16735
|
stateName: stateName,
|
|
16418
|
-
options: options
|
|
16736
|
+
options: options,
|
|
16737
|
+
renderedCallback: renderedCallback
|
|
16419
16738
|
}), element, uid());
|
|
16420
16739
|
}
|
|
16421
16740
|
|
|
@@ -23634,6 +23953,7 @@ const mergeArray = function () {
|
|
|
23634
23953
|
const mergeConfigs = (base, c) => ({
|
|
23635
23954
|
context: mergeObj(base.context, c.context),
|
|
23636
23955
|
load: c.load || base.load,
|
|
23956
|
+
loadTheme: c.loadTheme || base.loadTheme,
|
|
23637
23957
|
snapshot: _objectSpread2({}, c.snapshot || base.snapshot),
|
|
23638
23958
|
types: mergeArray(base.types, c.types),
|
|
23639
23959
|
themes: mergeArray(base.themes, c.themes),
|
|
@@ -23680,6 +24000,7 @@ function nuked() {
|
|
|
23680
24000
|
});
|
|
23681
24001
|
const appTheme$1 = appTheme({
|
|
23682
24002
|
themes: configuration.themes,
|
|
24003
|
+
loadTheme: configuration.loadTheme,
|
|
23683
24004
|
root
|
|
23684
24005
|
});
|
|
23685
24006
|
currentContext.themeApi = appTheme$1.externalAPI;
|
|
@@ -23938,13 +24259,14 @@ function nuked() {
|
|
|
23938
24259
|
* @param {boolean=} [options.dense=false] Reduces padding and text size (not applicable for existing objects)
|
|
23939
24260
|
* @param {string=} [options.stateName="$"] Sets the state to make selections in (not applicable for existing objects)
|
|
23940
24261
|
* @param {object=} [options.properties={}] Properties object to extend default properties with
|
|
24262
|
+
* @returns {Promise<void>} A promise that resolves when the data is fetched.
|
|
23941
24263
|
*
|
|
23942
24264
|
* @since 1.1.0
|
|
23943
24265
|
* @instance
|
|
23944
24266
|
* @example
|
|
23945
24267
|
* fieldInstance.mount(element);
|
|
23946
24268
|
*/
|
|
23947
|
-
mount(element) {
|
|
24269
|
+
async mount(element) {
|
|
23948
24270
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
23949
24271
|
if (!element) {
|
|
23950
24272
|
throw new Error("Element for ".concat(fieldName || qId, " not provided"));
|
|
@@ -23954,18 +24276,21 @@ function nuked() {
|
|
|
23954
24276
|
}
|
|
23955
24277
|
const onSelectionActivated = () => fieldSels.emit('selectionActivated');
|
|
23956
24278
|
const onSelectionDeactivated = () => fieldSels.emit('selectionDeactivated');
|
|
23957
|
-
|
|
23958
|
-
|
|
23959
|
-
|
|
23960
|
-
|
|
23961
|
-
|
|
23962
|
-
|
|
23963
|
-
|
|
23964
|
-
|
|
23965
|
-
|
|
23966
|
-
|
|
24279
|
+
return new Promise(resolve => {
|
|
24280
|
+
this._instance = ListBoxPortal({
|
|
24281
|
+
element,
|
|
24282
|
+
app,
|
|
24283
|
+
fieldIdentifier,
|
|
24284
|
+
qId,
|
|
24285
|
+
options: getOptions$1(_objectSpread2({
|
|
24286
|
+
onSelectionActivated,
|
|
24287
|
+
onSelectionDeactivated
|
|
24288
|
+
}, options)),
|
|
24289
|
+
stateName: options.stateName || '$',
|
|
24290
|
+
renderedCallback: resolve
|
|
24291
|
+
});
|
|
24292
|
+
root.add(this._instance);
|
|
23967
24293
|
});
|
|
23968
|
-
root.add(this._instance);
|
|
23969
24294
|
},
|
|
23970
24295
|
/**
|
|
23971
24296
|
* Unmounts the field listbox from the DOM.
|