@nebula.js/stardust 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/esm/dev.js +442 -138
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +3 -3
- package/core/esm/index.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/stardust.dev.js +459 -157
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +11 -11
- package/dist/stardust.js.map +1 -1
- package/package.json +10 -10
- package/types/index.d.ts +25 -8
package/core/esm/dev.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v3.
|
|
2
|
+
* @nebula.js/stardust v3.2.0
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as React from 'react';
|
|
8
|
-
import React__default, { useState as useState$1, useEffect as useEffect$1, useReducer, forwardRef, useMemo as useMemo$1, useImperativeHandle as useImperativeHandle$1, useCallback, useLayoutEffect as useLayoutEffect$1, PureComponent, createElement, useContext
|
|
8
|
+
import React__default, { useState as useState$1, useEffect as useEffect$1, useReducer, forwardRef, useMemo as useMemo$1, useImperativeHandle as useImperativeHandle$1, 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
11
|
import { Checkbox, Radio, Grid, Typography, FormControlLabel, Tooltip, Paper, IconButton, Popover, MenuList, MenuItem, ListItemIcon, Divider, InputAdornment, OutlinedInput, Badge, List, ListItem, Button, Box, Icon, CircularProgress } from '@mui/material';
|
|
@@ -953,6 +953,46 @@ var CurrentSelections_Of = {
|
|
|
953
953
|
"zh-TW": "{0}/ {1}"
|
|
954
954
|
}
|
|
955
955
|
};
|
|
956
|
+
var Listbox_Dismiss = {
|
|
957
|
+
id: "Listbox.Dismiss",
|
|
958
|
+
locale: {
|
|
959
|
+
"de-DE": "Schließen",
|
|
960
|
+
"en-US": "Dismiss",
|
|
961
|
+
"es-ES": "Descartar",
|
|
962
|
+
"fr-FR": "Ignorer",
|
|
963
|
+
"it-IT": "Ignora",
|
|
964
|
+
"ja-JP": "却下",
|
|
965
|
+
"ko-KR": "해제",
|
|
966
|
+
"nl-NL": "Overslaan",
|
|
967
|
+
"pl-PL": "Zamknij",
|
|
968
|
+
"pt-BR": "Ignorar",
|
|
969
|
+
"ru-RU": "Пропустить",
|
|
970
|
+
"sv-SE": "Hoppa över",
|
|
971
|
+
"tr-TR": "Kapat",
|
|
972
|
+
"zh-CN": "离开",
|
|
973
|
+
"zh-TW": "解除"
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
var Listbox_ItemsOverflow = {
|
|
977
|
+
id: "Listbox.ItemsOverflow",
|
|
978
|
+
locale: {
|
|
979
|
+
"de-DE": "Derzeit wird ein eingeschränkter Datensatz angezeigt, verwenden Sie die Suche, um die Größe zu reduzieren",
|
|
980
|
+
"en-US": "Currently showing a limited data set, use search to reduce the size",
|
|
981
|
+
"es-ES": "Actualmente se muestra un conjunto de datos limitado, utilice la búsqueda para reducir el tamaño",
|
|
982
|
+
"fr-FR": "Ensemble de données limité actuellement affiché. Utilisez la rechercher pour réduire la taille.",
|
|
983
|
+
"it-IT": "Attualmente visualizzato un set di dati limitato; utilizzare la ricerca per ridurre le dimensioni",
|
|
984
|
+
"ja-JP": "現在表示されているデータ セットは制限されているため、検索を使ってサイズを縮小してください",
|
|
985
|
+
"ko-KR": "현재 제한된 데이터 집합이 표시되고 있습니다. 검색을 사용하여 크기를 줄이십시오.",
|
|
986
|
+
"nl-NL": "Er wordt momenteel een beperkte gegevensverzameling getoond, gebruik Zoeken om de omvang te verkleinen",
|
|
987
|
+
"pl-PL": "Wyświetlany jest ograniczony zestaw danych. Użyj wyszukiwania, aby zmniejszyć rozmiar.",
|
|
988
|
+
"pt-BR": "Atualmente mostrando um conjunto de dados limitado, use a pesquisa para reduzir o tamanho",
|
|
989
|
+
"ru-RU": "Сейчас отображается ограниченный набор данных. Используйте поиск, чтобы уменьшить размер.",
|
|
990
|
+
"sv-SE": "En begränsad datauppsättning visas. Använd sök för att minska storleken",
|
|
991
|
+
"tr-TR": "Şu anda sınırlı bir veri kümesi gösteriliyor. Boyutu azaltmak için arama işlevini kullanın",
|
|
992
|
+
"zh-CN": "目前显示有限的数据集,使用搜索来减少大小",
|
|
993
|
+
"zh-TW": "目前顯示有限資料集,請使用搜尋減少大小"
|
|
994
|
+
}
|
|
995
|
+
};
|
|
956
996
|
var Listbox_Lock = {
|
|
957
997
|
id: "Listbox.Lock",
|
|
958
998
|
locale: {
|
|
@@ -973,6 +1013,26 @@ var Listbox_Lock = {
|
|
|
973
1013
|
"zh-TW": "鎖定選項"
|
|
974
1014
|
}
|
|
975
1015
|
};
|
|
1016
|
+
var Listbox_NoMatchesForYourTerms = {
|
|
1017
|
+
id: "Listbox.NoMatchesForYourTerms",
|
|
1018
|
+
locale: {
|
|
1019
|
+
"de-DE": "Für Ihre Suche wurden keine Übereinstimmungen gefunden.",
|
|
1020
|
+
"en-US": "There are no matches for your search.",
|
|
1021
|
+
"es-ES": "No hay resultados para su búsqueda.",
|
|
1022
|
+
"fr-FR": "Aucun résultat ne correspond à votre recherche.",
|
|
1023
|
+
"it-IT": "Non è stata trovata alcuna corrispondenza per questa ricerca.",
|
|
1024
|
+
"ja-JP": "検索に一致するものがありません。",
|
|
1025
|
+
"ko-KR": "검색에 대해 일치하는 항목이 없습니다.",
|
|
1026
|
+
"nl-NL": "Er zijn geen overeenkomsten voor uw zoekopdracht.",
|
|
1027
|
+
"pl-PL": "Brak dopasowań dla tego wyszukiwania.",
|
|
1028
|
+
"pt-BR": "Não há correspondências para sua pesquisa.",
|
|
1029
|
+
"ru-RU": "Нет совпадений по вашему поисковому запросу.",
|
|
1030
|
+
"sv-SE": "Det finns inga matchningar för din sökning.",
|
|
1031
|
+
"tr-TR": "Aramanızla eşleşen sonuç yok.",
|
|
1032
|
+
"zh-CN": "您的搜索条件没有任何匹配结果。",
|
|
1033
|
+
"zh-TW": "沒有與您搜尋相符的項目。"
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
976
1036
|
var Listbox_ResultFilterLabel = {
|
|
977
1037
|
id: "Listbox.ResultFilterLabel",
|
|
978
1038
|
locale: {
|
|
@@ -993,26 +1053,6 @@ var Listbox_ResultFilterLabel = {
|
|
|
993
1053
|
"zh-TW": "搜尋結果篩選"
|
|
994
1054
|
}
|
|
995
1055
|
};
|
|
996
|
-
var Listbox_NoMatchesForYourTerms = {
|
|
997
|
-
id: "Listbox.NoMatchesForYourTerms",
|
|
998
|
-
locale: {
|
|
999
|
-
"de-DE": "Für Ihre Suche wurden keine Übereinstimmungen gefunden.",
|
|
1000
|
-
"en-US": "There are no matches for your search.",
|
|
1001
|
-
"es-ES": "No hay resultados para su búsqueda.",
|
|
1002
|
-
"fr-FR": "Aucun résultat ne correspond à votre recherche.",
|
|
1003
|
-
"it-IT": "Non esistono corrispondenze per la ricerca.",
|
|
1004
|
-
"ja-JP": "検索に一致するものがありません。",
|
|
1005
|
-
"ko-KR": "검색에 대해 일치하는 항목이 없습니다.",
|
|
1006
|
-
"nl-NL": "Er zijn geen overeenkomsten voor uw zoekopdracht.",
|
|
1007
|
-
"pl-PL": "Brak dopasowań dla tego wyszukiwania.",
|
|
1008
|
-
"pt-BR": "Não há correspondências para sua pesquisa.",
|
|
1009
|
-
"ru-RU": "Нет совпадений для искомого текста.",
|
|
1010
|
-
"sv-SE": "Det finns inga matchningar för din sökning.",
|
|
1011
|
-
"tr-TR": "Aramanızla eşleşen sonuç yok.",
|
|
1012
|
-
"zh-CN": "您的搜索条件没有任何匹配结果。",
|
|
1013
|
-
"zh-TW": "沒有與您搜尋相符的項目。"
|
|
1014
|
-
}
|
|
1015
|
-
};
|
|
1016
1056
|
var Listbox_ScreenReaderInstructions = {
|
|
1017
1057
|
id: "Listbox.ScreenReaderInstructions",
|
|
1018
1058
|
locale: {
|
|
@@ -1573,25 +1613,15 @@ var Visualization_UnfulfilledCalculationCondition = {
|
|
|
1573
1613
|
"zh-TW": "不符計算條件"
|
|
1574
1614
|
}
|
|
1575
1615
|
};
|
|
1576
|
-
var Listbox_ItemsOverflow = {
|
|
1577
|
-
id: "Listbox.ItemsOverflow",
|
|
1578
|
-
locale: {
|
|
1579
|
-
"en-US": "Currently showing a limited data set, use search to reduce the size"
|
|
1580
|
-
}
|
|
1581
|
-
};
|
|
1582
|
-
var Listbox_Dismiss = {
|
|
1583
|
-
id: "Listbox.Dismiss",
|
|
1584
|
-
locale: {
|
|
1585
|
-
"en-US": "Dismiss"
|
|
1586
|
-
}
|
|
1587
|
-
};
|
|
1588
1616
|
var all = {
|
|
1589
1617
|
Cancel: Cancel$1,
|
|
1590
1618
|
CurrentSelections_All: CurrentSelections_All,
|
|
1591
1619
|
CurrentSelections_Of: CurrentSelections_Of,
|
|
1620
|
+
Listbox_Dismiss: Listbox_Dismiss,
|
|
1621
|
+
Listbox_ItemsOverflow: Listbox_ItemsOverflow,
|
|
1592
1622
|
Listbox_Lock: Listbox_Lock,
|
|
1593
|
-
Listbox_ResultFilterLabel: Listbox_ResultFilterLabel,
|
|
1594
1623
|
Listbox_NoMatchesForYourTerms: Listbox_NoMatchesForYourTerms,
|
|
1624
|
+
Listbox_ResultFilterLabel: Listbox_ResultFilterLabel,
|
|
1595
1625
|
Listbox_ScreenReaderInstructions: Listbox_ScreenReaderInstructions,
|
|
1596
1626
|
Listbox_Search: Listbox_Search,
|
|
1597
1627
|
Listbox_Search_ScreenReaderInstructions: Listbox_Search_ScreenReaderInstructions,
|
|
@@ -1619,9 +1649,7 @@ var all = {
|
|
|
1619
1649
|
Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
|
|
1620
1650
|
Visualization_Invalid_Measure: Visualization_Invalid_Measure,
|
|
1621
1651
|
Visualization_LayoutError: Visualization_LayoutError,
|
|
1622
|
-
Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
|
|
1623
|
-
Listbox_ItemsOverflow: Listbox_ItemsOverflow,
|
|
1624
|
-
Listbox_Dismiss: Listbox_Dismiss
|
|
1652
|
+
Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
|
|
1625
1653
|
};
|
|
1626
1654
|
|
|
1627
1655
|
function appLocaleFn(language) {
|
|
@@ -7940,7 +7968,7 @@ function create$3(definition) {
|
|
|
7940
7968
|
return cache[key];
|
|
7941
7969
|
}
|
|
7942
7970
|
|
|
7943
|
-
const NEBULA_VERSION_HASH = "
|
|
7971
|
+
const NEBULA_VERSION_HASH = "070a" ;
|
|
7944
7972
|
ClassNameGenerator$1.configure(componentName => {
|
|
7945
7973
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
7946
7974
|
});
|
|
@@ -8459,7 +8487,7 @@ function boot(_ref2) {
|
|
|
8459
8487
|
const appRef = React__default.createRef();
|
|
8460
8488
|
const element = document.createElement('div');
|
|
8461
8489
|
element.style.display = 'none';
|
|
8462
|
-
element.setAttribute('data-nebulajs-version', "3.
|
|
8490
|
+
element.setAttribute('data-nebulajs-version', "3.2.0" );
|
|
8463
8491
|
element.setAttribute('data-app-id', app.id);
|
|
8464
8492
|
document.body.appendChild(element);
|
|
8465
8493
|
ReactDOM.render( /*#__PURE__*/React__default.createElement(NebulaApp, {
|
|
@@ -9417,7 +9445,9 @@ function getFieldKeyboardNavigation(_ref) {
|
|
|
9417
9445
|
let {
|
|
9418
9446
|
select,
|
|
9419
9447
|
confirm,
|
|
9420
|
-
cancel
|
|
9448
|
+
cancel,
|
|
9449
|
+
setScrollPosition,
|
|
9450
|
+
focusListItems
|
|
9421
9451
|
} = _ref;
|
|
9422
9452
|
const getElement = function (elm) {
|
|
9423
9453
|
let next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -9432,7 +9462,8 @@ function getFieldKeyboardNavigation(_ref) {
|
|
|
9432
9462
|
let elementToFocus;
|
|
9433
9463
|
const {
|
|
9434
9464
|
keyCode,
|
|
9435
|
-
shiftKey = false
|
|
9465
|
+
shiftKey = false,
|
|
9466
|
+
ctrlKey = false
|
|
9436
9467
|
} = event.nativeEvent;
|
|
9437
9468
|
switch (keyCode) {
|
|
9438
9469
|
case KEYS.SHIFT:
|
|
@@ -9471,6 +9502,22 @@ function getFieldKeyboardNavigation(_ref) {
|
|
|
9471
9502
|
cancel();
|
|
9472
9503
|
return;
|
|
9473
9504
|
// let it propagate to top-level
|
|
9505
|
+
case KEYS.HOME:
|
|
9506
|
+
focusListItems.setFirst(true);
|
|
9507
|
+
if (ctrlKey) {
|
|
9508
|
+
setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('overflowStart');
|
|
9509
|
+
break;
|
|
9510
|
+
}
|
|
9511
|
+
setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('start');
|
|
9512
|
+
break;
|
|
9513
|
+
case KEYS.END:
|
|
9514
|
+
focusListItems.setLast(true);
|
|
9515
|
+
if (ctrlKey) {
|
|
9516
|
+
setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('overflowEnd');
|
|
9517
|
+
break;
|
|
9518
|
+
}
|
|
9519
|
+
setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('end');
|
|
9520
|
+
break;
|
|
9474
9521
|
default:
|
|
9475
9522
|
return;
|
|
9476
9523
|
// don't stop propagation since we want to outsource keydown to other handlers.
|
|
@@ -9748,15 +9795,26 @@ function RowColumn(_ref3) {
|
|
|
9748
9795
|
showGray = true,
|
|
9749
9796
|
columnCount = 1,
|
|
9750
9797
|
rowCount = 1,
|
|
9751
|
-
layoutOrder
|
|
9798
|
+
layoutOrder,
|
|
9799
|
+
dataOffset,
|
|
9800
|
+
focusListItems,
|
|
9801
|
+
listCount
|
|
9752
9802
|
} = data;
|
|
9753
9803
|
let cellIndex;
|
|
9754
9804
|
let styles;
|
|
9805
|
+
const count = {
|
|
9806
|
+
max: null,
|
|
9807
|
+
currentIndex: null
|
|
9808
|
+
};
|
|
9755
9809
|
if (typeof rowIndex === 'number' && typeof columnIndex === 'number') {
|
|
9756
9810
|
if (layoutOrder === 'row') {
|
|
9757
9811
|
cellIndex = rowIndex * columnCount + columnIndex;
|
|
9812
|
+
count.max = rowCount;
|
|
9813
|
+
count.currentIndex = rowIndex;
|
|
9758
9814
|
} else {
|
|
9759
9815
|
cellIndex = columnIndex * rowCount + rowIndex;
|
|
9816
|
+
count.max = columnCount;
|
|
9817
|
+
count.currentIndex = columnIndex;
|
|
9760
9818
|
}
|
|
9761
9819
|
const padding = 0;
|
|
9762
9820
|
styles = _objectSpread2(_objectSpread2({}, style), {}, {
|
|
@@ -9766,9 +9824,27 @@ function RowColumn(_ref3) {
|
|
|
9766
9824
|
});
|
|
9767
9825
|
} else {
|
|
9768
9826
|
cellIndex = index;
|
|
9827
|
+
count.max = listCount;
|
|
9828
|
+
count.currentIndex = index;
|
|
9769
9829
|
styles = _objectSpread2({}, style);
|
|
9770
9830
|
}
|
|
9771
|
-
|
|
9831
|
+
cellIndex += dataOffset;
|
|
9832
|
+
const rowRef = useRef(null);
|
|
9833
|
+
useEffect$1(() => {
|
|
9834
|
+
if (rowRef.current !== null) {
|
|
9835
|
+
if (count.currentIndex === 0 && focusListItems.first) {
|
|
9836
|
+
rowRef.current.focus();
|
|
9837
|
+
focusListItems.setFirst(false);
|
|
9838
|
+
}
|
|
9839
|
+
if (count.currentIndex === count.max - 1 && focusListItems.last) {
|
|
9840
|
+
rowRef.current.focus();
|
|
9841
|
+
focusListItems.setLast(false);
|
|
9842
|
+
}
|
|
9843
|
+
}
|
|
9844
|
+
}, [rowRef.current]);
|
|
9845
|
+
const handleKeyDownCallback = useCallback(getFieldKeyboardNavigation(_objectSpread2(_objectSpread2({}, actions), {}, {
|
|
9846
|
+
focusListItems
|
|
9847
|
+
})), [actions]);
|
|
9772
9848
|
const [isSelected, setSelected] = useState$1(false);
|
|
9773
9849
|
const [cell, setCell] = useState$1();
|
|
9774
9850
|
const [classArr, setClassArr] = useState$1([]);
|
|
@@ -9915,7 +9991,8 @@ function RowColumn(_ref3) {
|
|
|
9915
9991
|
};
|
|
9916
9992
|
const iconStyles = {
|
|
9917
9993
|
alignItems: 'center',
|
|
9918
|
-
display: 'flex'
|
|
9994
|
+
display: 'flex',
|
|
9995
|
+
fontSize: '8px'
|
|
9919
9996
|
};
|
|
9920
9997
|
const showLock = isSelected && isLocked;
|
|
9921
9998
|
const showTick = !checkboxes && isSelected && !isLocked;
|
|
@@ -9943,6 +10020,7 @@ function RowColumn(_ref3) {
|
|
|
9943
10020
|
flexBasisProp: flexBasisVal,
|
|
9944
10021
|
dense: dense
|
|
9945
10022
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
10023
|
+
ref: rowRef,
|
|
9946
10024
|
container: true,
|
|
9947
10025
|
gap: 0,
|
|
9948
10026
|
className: joinClassNames(['value', ...classArr]),
|
|
@@ -11522,11 +11600,18 @@ function getStyledComponents() {
|
|
|
11522
11600
|
}
|
|
11523
11601
|
|
|
11524
11602
|
const getIndex = (renderProps, isColumnLayout) => {
|
|
11525
|
-
if (renderProps
|
|
11603
|
+
if ((renderProps === null || renderProps === void 0 ? void 0 : renderProps.visibleRowStopIndex) !== undefined || renderProps.visibleColumnStopIndex !== undefined) {
|
|
11526
11604
|
return isColumnLayout ? renderProps.visibleColumnStopIndex : renderProps.visibleRowStopIndex;
|
|
11527
11605
|
}
|
|
11528
11606
|
return renderProps.visibleStopIndex;
|
|
11529
11607
|
};
|
|
11608
|
+
const getIsScrollTop = (renderProps, isColumnLayout) => {
|
|
11609
|
+
if ((renderProps === null || renderProps === void 0 ? void 0 : renderProps.visibleRowStartIndex) !== undefined || renderProps.visibleColumnStartIndex !== undefined) {
|
|
11610
|
+
return isColumnLayout ? renderProps.visibleColumnStartIndex === 0 : renderProps.visibleRowStartIndex === 0;
|
|
11611
|
+
}
|
|
11612
|
+
return renderProps.visibleStartIndex === 0;
|
|
11613
|
+
};
|
|
11614
|
+
const getIsEndOfData = (qCardinal, index, count, dataOffset) => qCardinal === index * count + dataOffset + count;
|
|
11530
11615
|
function handleSetOverflowDisclaimer(_ref) {
|
|
11531
11616
|
let {
|
|
11532
11617
|
renderProps,
|
|
@@ -11534,14 +11619,18 @@ function handleSetOverflowDisclaimer(_ref) {
|
|
|
11534
11619
|
maxCount,
|
|
11535
11620
|
columnCount,
|
|
11536
11621
|
rowCount,
|
|
11537
|
-
overflowDisclaimer
|
|
11622
|
+
overflowDisclaimer,
|
|
11623
|
+
qCardinal,
|
|
11624
|
+
dataOffset
|
|
11538
11625
|
} = _ref;
|
|
11539
11626
|
const isColumnLayout = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.layoutOrder) === 'column' && layoutOptions.dataLayout !== 'singleColumn';
|
|
11540
11627
|
const index = getIndex(renderProps, isColumnLayout);
|
|
11541
11628
|
const stopIndex = isColumnLayout ? maxCount.column : maxCount.row;
|
|
11542
11629
|
const count = isColumnLayout ? columnCount : rowCount;
|
|
11543
11630
|
const overflowPossible = count >= stopIndex;
|
|
11544
|
-
const
|
|
11631
|
+
const isEndOfData = getIsEndOfData(qCardinal, index, isColumnLayout ? rowCount : columnCount, dataOffset);
|
|
11632
|
+
const isTopOfOverflowData = !!dataOffset && getIsScrollTop(renderProps, isColumnLayout);
|
|
11633
|
+
const show = overflowPossible && !isEndOfData && index >= stopIndex - 1 || isTopOfOverflowData || overflowDisclaimer.state.show; // If its shown once, the user have to dismiss to hide it.
|
|
11545
11634
|
overflowDisclaimer.set(show);
|
|
11546
11635
|
}
|
|
11547
11636
|
|
|
@@ -11572,7 +11661,9 @@ function getListBoxComponents(_ref) {
|
|
|
11572
11661
|
listLayout,
|
|
11573
11662
|
sizes,
|
|
11574
11663
|
listCount,
|
|
11575
|
-
overflowDisclaimer
|
|
11664
|
+
overflowDisclaimer,
|
|
11665
|
+
setScrollPosition,
|
|
11666
|
+
focusListItems
|
|
11576
11667
|
} = _ref;
|
|
11577
11668
|
const {
|
|
11578
11669
|
layoutOptions = {},
|
|
@@ -11615,12 +11706,15 @@ function getListBoxComponents(_ref) {
|
|
|
11615
11706
|
actions: {
|
|
11616
11707
|
select,
|
|
11617
11708
|
confirm: () => selections === null || selections === void 0 ? void 0 : selections.confirm.call(selections),
|
|
11618
|
-
cancel: () => selections === null || selections === void 0 ? void 0 : selections.cancel.call(selections)
|
|
11709
|
+
cancel: () => selections === null || selections === void 0 ? void 0 : selections.cancel.call(selections),
|
|
11710
|
+
setScrollPosition
|
|
11619
11711
|
},
|
|
11620
11712
|
frequencyMax,
|
|
11621
11713
|
histogram,
|
|
11622
11714
|
keyboard,
|
|
11623
|
-
showGray
|
|
11715
|
+
showGray,
|
|
11716
|
+
dataOffset: local.current.dataOffset,
|
|
11717
|
+
focusListItems
|
|
11624
11718
|
});
|
|
11625
11719
|
const List = _ref2 => {
|
|
11626
11720
|
let {
|
|
@@ -11637,9 +11731,12 @@ function getListBoxComponents(_ref) {
|
|
|
11637
11731
|
width: width,
|
|
11638
11732
|
itemCount: listCount,
|
|
11639
11733
|
layout: listLayout,
|
|
11640
|
-
itemData: _objectSpread2({}, commonItemData),
|
|
11734
|
+
itemData: _objectSpread2(_objectSpread2({}, commonItemData), {}, {
|
|
11735
|
+
listCount
|
|
11736
|
+
}),
|
|
11641
11737
|
itemSize: itemSize,
|
|
11642
11738
|
onItemsRendered: renderProps => {
|
|
11739
|
+
var _layout$qListObject, _layout$qListObject$q;
|
|
11643
11740
|
if (scrollState) {
|
|
11644
11741
|
scrollState.setScrollPos(renderProps.visibleStopIndex);
|
|
11645
11742
|
}
|
|
@@ -11649,7 +11746,9 @@ function getListBoxComponents(_ref) {
|
|
|
11649
11746
|
maxCount: sizes.maxCount,
|
|
11650
11747
|
columnCount,
|
|
11651
11748
|
rowCount,
|
|
11652
|
-
overflowDisclaimer
|
|
11749
|
+
overflowDisclaimer,
|
|
11750
|
+
qCardinal: layout === null || layout === void 0 ? void 0 : (_layout$qListObject = layout.qListObject) === null || _layout$qListObject === void 0 ? void 0 : (_layout$qListObject$q = _layout$qListObject.qDimensionInfo) === null || _layout$qListObject$q === void 0 ? void 0 : _layout$qListObject$q.qCardinal,
|
|
11751
|
+
dataOffset: local.current.dataOffset
|
|
11653
11752
|
});
|
|
11654
11753
|
onItemsRendered(_objectSpread2({}, renderProps));
|
|
11655
11754
|
},
|
|
@@ -11673,6 +11772,7 @@ function getListBoxComponents(_ref) {
|
|
|
11673
11772
|
// eslint-disable-next-line no-param-reassign
|
|
11674
11773
|
local.current.listRef = ref;
|
|
11675
11774
|
const handleGridItemsRendered = renderProps => {
|
|
11775
|
+
var _layout$qListObject2, _layout$qListObject2$;
|
|
11676
11776
|
const renderOptions = deriveRenderOptions({
|
|
11677
11777
|
renderProps,
|
|
11678
11778
|
scrollState,
|
|
@@ -11686,7 +11786,9 @@ function getListBoxComponents(_ref) {
|
|
|
11686
11786
|
maxCount: sizes.maxCount,
|
|
11687
11787
|
columnCount,
|
|
11688
11788
|
rowCount,
|
|
11689
|
-
overflowDisclaimer
|
|
11789
|
+
overflowDisclaimer,
|
|
11790
|
+
qCardinal: layout === null || layout === void 0 ? void 0 : (_layout$qListObject2 = layout.qListObject) === null || _layout$qListObject2 === void 0 ? void 0 : (_layout$qListObject2$ = _layout$qListObject2.qDimensionInfo) === null || _layout$qListObject2$ === void 0 ? void 0 : _layout$qListObject2$.qCardinal,
|
|
11791
|
+
dataOffset: local.current.dataOffset
|
|
11690
11792
|
});
|
|
11691
11793
|
onItemsRendered(renderOptions);
|
|
11692
11794
|
};
|
|
@@ -11857,9 +11959,10 @@ function useItemsLoader(_ref) {
|
|
|
11857
11959
|
const [pages, setPages] = useState$1([]);
|
|
11858
11960
|
let [minimumBatchSize] = useState$1(0);
|
|
11859
11961
|
const loadMoreItems = (startIndex, stopIndex) => {
|
|
11962
|
+
const offset = local.current.dataOffset;
|
|
11860
11963
|
local.current.queue.push({
|
|
11861
|
-
start: startIndex,
|
|
11862
|
-
stop: stopIndex
|
|
11964
|
+
start: startIndex + offset,
|
|
11965
|
+
stop: stopIndex + offset
|
|
11863
11966
|
});
|
|
11864
11967
|
const isScrolling = loaderRef.current ?
|
|
11865
11968
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -12248,6 +12351,47 @@ function ListBoxFooter(_ref3) {
|
|
|
12248
12351
|
}, /*#__PURE__*/React__default.createElement(SmallCloseIcon, null))));
|
|
12249
12352
|
}
|
|
12250
12353
|
|
|
12354
|
+
const getOffset = (layout, listCount) => {
|
|
12355
|
+
const totalLength = layout.qListObject.qDimensionInfo.qCardinal;
|
|
12356
|
+
const offset = totalLength - listCount;
|
|
12357
|
+
return offset;
|
|
12358
|
+
};
|
|
12359
|
+
function getScrollIndex(_ref) {
|
|
12360
|
+
let {
|
|
12361
|
+
position,
|
|
12362
|
+
isRow,
|
|
12363
|
+
sizes,
|
|
12364
|
+
layout,
|
|
12365
|
+
offset
|
|
12366
|
+
} = _ref;
|
|
12367
|
+
let scrollIndex;
|
|
12368
|
+
let triggerRerender = false;
|
|
12369
|
+
let newOffset = offset !== null && offset !== void 0 ? offset : 0;
|
|
12370
|
+
switch (position) {
|
|
12371
|
+
case 'start':
|
|
12372
|
+
scrollIndex = 0;
|
|
12373
|
+
break;
|
|
12374
|
+
case 'end':
|
|
12375
|
+
scrollIndex = isRow ? sizes.rowCount : sizes.columnCount;
|
|
12376
|
+
break;
|
|
12377
|
+
case 'overflowStart':
|
|
12378
|
+
newOffset = 0;
|
|
12379
|
+
scrollIndex = 0;
|
|
12380
|
+
triggerRerender = true;
|
|
12381
|
+
break;
|
|
12382
|
+
case 'overflowEnd':
|
|
12383
|
+
newOffset = getOffset(layout, sizes.listCount);
|
|
12384
|
+
scrollIndex = layout.qListObject.qDimensionInfo.qCardinal;
|
|
12385
|
+
triggerRerender = true;
|
|
12386
|
+
break;
|
|
12387
|
+
}
|
|
12388
|
+
return {
|
|
12389
|
+
scrollIndex,
|
|
12390
|
+
offset: newOffset,
|
|
12391
|
+
triggerRerender
|
|
12392
|
+
};
|
|
12393
|
+
}
|
|
12394
|
+
|
|
12251
12395
|
const _excluded$4 = ["isLoadingData"];
|
|
12252
12396
|
const DEFAULT_MIN_BATCH_SIZE = 100;
|
|
12253
12397
|
function ListBox(_ref) {
|
|
@@ -12280,7 +12424,8 @@ function ListBox(_ref) {
|
|
|
12280
12424
|
const loaderRef = useRef(null);
|
|
12281
12425
|
const local = useRef({
|
|
12282
12426
|
queue: [],
|
|
12283
|
-
validPages: false
|
|
12427
|
+
validPages: false,
|
|
12428
|
+
dataOffset: 0
|
|
12284
12429
|
});
|
|
12285
12430
|
const listData = useRef({
|
|
12286
12431
|
pages: []
|
|
@@ -12338,6 +12483,23 @@ function ListBox(_ref) {
|
|
|
12338
12483
|
doc: document,
|
|
12339
12484
|
isSingleSelect
|
|
12340
12485
|
});
|
|
12486
|
+
const {
|
|
12487
|
+
layoutOptions = {}
|
|
12488
|
+
} = layout || {};
|
|
12489
|
+
let isRow = true;
|
|
12490
|
+
if (layoutOptions.dataLayout) {
|
|
12491
|
+
isRow = layoutOptions.dataLayout === 'singleColumn' ? true : (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.layoutOrder) === 'row';
|
|
12492
|
+
}
|
|
12493
|
+
const isGrid = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.dataLayout) === 'grid';
|
|
12494
|
+
const scrollToIndex = index => {
|
|
12495
|
+
const gridIndex = _objectSpread2({}, isRow ? {
|
|
12496
|
+
rowIndex: index
|
|
12497
|
+
} : {
|
|
12498
|
+
columnIndex: index
|
|
12499
|
+
});
|
|
12500
|
+
const scrollIndex = isGrid ? gridIndex : index;
|
|
12501
|
+
loaderRef.current._listRef.scrollToItem(scrollIndex);
|
|
12502
|
+
};
|
|
12341
12503
|
const fetchData = () => {
|
|
12342
12504
|
local.current.queue = [];
|
|
12343
12505
|
local.current.validPages = false;
|
|
@@ -12347,7 +12509,8 @@ function ListBox(_ref) {
|
|
|
12347
12509
|
if (layout && layout.qSelectionInfo.qInSelections) {
|
|
12348
12510
|
return;
|
|
12349
12511
|
}
|
|
12350
|
-
|
|
12512
|
+
local.current.dataOffset = 0;
|
|
12513
|
+
scrollToIndex(0);
|
|
12351
12514
|
}
|
|
12352
12515
|
};
|
|
12353
12516
|
if (update) {
|
|
@@ -12368,14 +12531,11 @@ function ListBox(_ref) {
|
|
|
12368
12531
|
}, [loaderRef.current]);
|
|
12369
12532
|
useEffect$1(() => {
|
|
12370
12533
|
fetchData();
|
|
12371
|
-
}, [layout]);
|
|
12534
|
+
}, [layout, local.current.dataOffset]);
|
|
12372
12535
|
const textWidth = useTextWidth({
|
|
12373
12536
|
text: getMeasureText(layout),
|
|
12374
12537
|
font: '14px Source sans pro'
|
|
12375
12538
|
});
|
|
12376
|
-
const {
|
|
12377
|
-
layoutOptions = {}
|
|
12378
|
-
} = layout || {};
|
|
12379
12539
|
let minimumBatchSize = DEFAULT_MIN_BATCH_SIZE;
|
|
12380
12540
|
const isVertical = layoutOptions.dataLayout ? layoutOptions.dataLayout === 'singleColumn' : listLayout !== 'horizontal';
|
|
12381
12541
|
const count = layout === null || layout === void 0 ? void 0 : (_layout$qListObject$q = layout.qListObject.qSize) === null || _layout$qListObject$q === void 0 ? void 0 : _layout$qListObject$q.qcy;
|
|
@@ -12399,9 +12559,41 @@ function ListBox(_ref) {
|
|
|
12399
12559
|
listCount
|
|
12400
12560
|
} = sizes;
|
|
12401
12561
|
setStoreValue('listCount', listCount);
|
|
12562
|
+
const setScrollPosition = position => {
|
|
12563
|
+
const {
|
|
12564
|
+
scrollIndex,
|
|
12565
|
+
offset,
|
|
12566
|
+
triggerRerender
|
|
12567
|
+
} = getScrollIndex({
|
|
12568
|
+
position,
|
|
12569
|
+
isRow,
|
|
12570
|
+
sizes,
|
|
12571
|
+
layout,
|
|
12572
|
+
offset: local.current.dataOffset
|
|
12573
|
+
});
|
|
12574
|
+
local.current.dataOffset = offset;
|
|
12575
|
+
if (triggerRerender) {
|
|
12576
|
+
setPages(currentPages => [...currentPages]);
|
|
12577
|
+
}
|
|
12578
|
+
scrollToIndex(scrollIndex);
|
|
12579
|
+
};
|
|
12402
12580
|
const {
|
|
12403
12581
|
textAlign
|
|
12404
12582
|
} = (layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo) || {};
|
|
12583
|
+
const [focusListItem, setFocusListItem] = useState$1({
|
|
12584
|
+
first: false,
|
|
12585
|
+
last: false
|
|
12586
|
+
});
|
|
12587
|
+
const getFocusState = () => ({
|
|
12588
|
+
first: focusListItem.first,
|
|
12589
|
+
setFirst: first => setFocusListItem(prevState => _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
12590
|
+
first
|
|
12591
|
+
})),
|
|
12592
|
+
last: focusListItem.last,
|
|
12593
|
+
setLast: last => setFocusListItem(prevState => _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
12594
|
+
last
|
|
12595
|
+
}))
|
|
12596
|
+
});
|
|
12405
12597
|
const {
|
|
12406
12598
|
List,
|
|
12407
12599
|
Grid
|
|
@@ -12430,7 +12622,9 @@ function ListBox(_ref) {
|
|
|
12430
12622
|
overflowDisclaimer: {
|
|
12431
12623
|
state: overflowDisclaimer,
|
|
12432
12624
|
set: showOverflowDisclaimer
|
|
12433
|
-
}
|
|
12625
|
+
},
|
|
12626
|
+
setScrollPosition,
|
|
12627
|
+
focusListItems: getFocusState()
|
|
12434
12628
|
});
|
|
12435
12629
|
const {
|
|
12436
12630
|
columnWidth,
|
|
@@ -13028,6 +13222,7 @@ const search = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
13028
13222
|
var SearchIcon = (props => SvgIcon$2(search(props)));
|
|
13029
13223
|
|
|
13030
13224
|
const TREE_PATH = '/qListObjectDef';
|
|
13225
|
+
const WILDCARD = '**';
|
|
13031
13226
|
const StyledInputAdornment = styled$1(InputAdornment)(_ref => {
|
|
13032
13227
|
var _theme$listBox, _theme$listBox$conten;
|
|
13033
13228
|
let {
|
|
@@ -13052,12 +13247,16 @@ function ListBoxSearch(_ref3) {
|
|
|
13052
13247
|
model,
|
|
13053
13248
|
keyboard,
|
|
13054
13249
|
dense = false,
|
|
13055
|
-
visible = true
|
|
13250
|
+
visible = true,
|
|
13251
|
+
wildCardSearch = true,
|
|
13252
|
+
searchEnabled
|
|
13056
13253
|
} = _ref3;
|
|
13057
13254
|
const {
|
|
13058
13255
|
translator
|
|
13059
13256
|
} = useContext(InstanceContext);
|
|
13060
13257
|
const [value, setValue] = useState$1('');
|
|
13258
|
+
const [wildcardOn, setWildcardOn] = useState$1(false);
|
|
13259
|
+
const inputRef = useRef();
|
|
13061
13260
|
const theme = useTheme$1();
|
|
13062
13261
|
const {
|
|
13063
13262
|
getStoreValue
|
|
@@ -13084,6 +13283,13 @@ function ListBoxSearch(_ref3) {
|
|
|
13084
13283
|
selections.removeListener && selections.removeListener('deactivated', abortSearch);
|
|
13085
13284
|
};
|
|
13086
13285
|
}, []);
|
|
13286
|
+
useEffect$1(() => {
|
|
13287
|
+
if (wildcardOn && inputRef.current) {
|
|
13288
|
+
const cursorPos = value.length - 1;
|
|
13289
|
+
inputRef.current.setSelectionRange(cursorPos, cursorPos); // place the cursor in the wildcard
|
|
13290
|
+
setWildcardOn(false);
|
|
13291
|
+
}
|
|
13292
|
+
}, [wildcardOn, inputRef.current]);
|
|
13087
13293
|
const onChange = async e => {
|
|
13088
13294
|
setValue(e.target.value);
|
|
13089
13295
|
if (!e.target.value.length) {
|
|
@@ -13092,6 +13298,10 @@ function ListBoxSearch(_ref3) {
|
|
|
13092
13298
|
return model.searchListObjectFor(TREE_PATH, e.target.value);
|
|
13093
13299
|
};
|
|
13094
13300
|
const handleFocus = () => {
|
|
13301
|
+
if (wildCardSearch) {
|
|
13302
|
+
setValue(WILDCARD);
|
|
13303
|
+
setWildcardOn(true);
|
|
13304
|
+
}
|
|
13095
13305
|
if (!selections.isModal()) {
|
|
13096
13306
|
selections.begin(['/qListObjectDef']);
|
|
13097
13307
|
}
|
|
@@ -13125,7 +13335,7 @@ function ListBoxSearch(_ref3) {
|
|
|
13125
13335
|
}
|
|
13126
13336
|
return response;
|
|
13127
13337
|
};
|
|
13128
|
-
if (!visible) {
|
|
13338
|
+
if (!visible || searchEnabled === false) {
|
|
13129
13339
|
return null;
|
|
13130
13340
|
}
|
|
13131
13341
|
return /*#__PURE__*/React__default.createElement(StyledOutlinedInput, {
|
|
@@ -13155,6 +13365,7 @@ function ListBoxSearch(_ref3) {
|
|
|
13155
13365
|
paddingBottom: '5px'
|
|
13156
13366
|
}
|
|
13157
13367
|
}],
|
|
13368
|
+
inputRef: inputRef,
|
|
13158
13369
|
size: "small",
|
|
13159
13370
|
fullWidth: true,
|
|
13160
13371
|
placeholder: translator.get('Listbox.Search'),
|
|
@@ -13355,7 +13566,8 @@ const createObjectSelections = _ref2 => {
|
|
|
13355
13566
|
const getClickOutFuncs = _ref3 => {
|
|
13356
13567
|
let {
|
|
13357
13568
|
elements,
|
|
13358
|
-
objectSelections
|
|
13569
|
+
objectSelections,
|
|
13570
|
+
options
|
|
13359
13571
|
} = _ref3;
|
|
13360
13572
|
const handler = createHandler({
|
|
13361
13573
|
elements,
|
|
@@ -13363,14 +13575,18 @@ const getClickOutFuncs = _ref3 => {
|
|
|
13363
13575
|
});
|
|
13364
13576
|
return {
|
|
13365
13577
|
activateClickOut() {
|
|
13578
|
+
var _options$onSelectionA;
|
|
13366
13579
|
document.addEventListener('mousedown', handler);
|
|
13580
|
+
(_options$onSelectionA = options.onSelectionActivated) === null || _options$onSelectionA === void 0 ? void 0 : _options$onSelectionA.call(options);
|
|
13367
13581
|
},
|
|
13368
13582
|
deactivateClickOut() {
|
|
13583
|
+
var _options$onSelectionD;
|
|
13369
13584
|
document.removeEventListener('mousedown', handler);
|
|
13585
|
+
(_options$onSelectionD = options.onSelectionDeactivated) === null || _options$onSelectionD === void 0 ? void 0 : _options$onSelectionD.call(options);
|
|
13370
13586
|
}
|
|
13371
13587
|
};
|
|
13372
13588
|
};
|
|
13373
|
-
function useObjectSelections(app, model, elements) {
|
|
13589
|
+
function useObjectSelections(app, model, elements, options) {
|
|
13374
13590
|
const elementsArr = Array.isArray(elements) ? elements : [elements];
|
|
13375
13591
|
const [appSelections] = useAppSelections(app);
|
|
13376
13592
|
const [layout] = useLayout$1(model);
|
|
@@ -13396,7 +13612,8 @@ function useObjectSelections(app, model, elements) {
|
|
|
13396
13612
|
deactivateClickOut
|
|
13397
13613
|
} = getClickOutFuncs({
|
|
13398
13614
|
elements: elementsArr,
|
|
13399
|
-
objectSelections
|
|
13615
|
+
objectSelections,
|
|
13616
|
+
options
|
|
13400
13617
|
});
|
|
13401
13618
|
objectSelections.addListener('activated', activateClickOut);
|
|
13402
13619
|
objectSelections.addListener('deactivated', deactivateClickOut);
|
|
@@ -14854,7 +15071,6 @@ function ListBoxInline(_ref3) {
|
|
|
14854
15071
|
checkboxes,
|
|
14855
15072
|
search = true,
|
|
14856
15073
|
focusSearch = false,
|
|
14857
|
-
toolbar = true,
|
|
14858
15074
|
rangeSelect = true,
|
|
14859
15075
|
model,
|
|
14860
15076
|
selections,
|
|
@@ -14866,6 +15082,9 @@ function ListBoxInline(_ref3) {
|
|
|
14866
15082
|
showGray = true,
|
|
14867
15083
|
scrollState = undefined
|
|
14868
15084
|
} = options;
|
|
15085
|
+
let {
|
|
15086
|
+
toolbar = true
|
|
15087
|
+
} = options;
|
|
14869
15088
|
|
|
14870
15089
|
// Hook that will trigger update when used in useEffects.
|
|
14871
15090
|
// Modified from: https://medium.com/@teh_builder/ref-objects-inside-useeffect-hooks-eb7c15198780
|
|
@@ -14879,9 +15098,6 @@ function ListBoxInline(_ref3) {
|
|
|
14879
15098
|
return [ref, setRef];
|
|
14880
15099
|
};
|
|
14881
15100
|
const theme = useTheme$1();
|
|
14882
|
-
const lock = useCallback(() => {
|
|
14883
|
-
model.lock('/qListObjectDef');
|
|
14884
|
-
}, [model]);
|
|
14885
15101
|
const unlock = useCallback(() => {
|
|
14886
15102
|
model.unlock('/qListObjectDef');
|
|
14887
15103
|
}, [model]);
|
|
@@ -14907,13 +15123,19 @@ function ListBoxInline(_ref3) {
|
|
|
14907
15123
|
// this will be static until we can access the useKeyboard hook
|
|
14908
15124
|
active: keyboardActive
|
|
14909
15125
|
};
|
|
15126
|
+
if ((layout === null || layout === void 0 ? void 0 : layout.toolbar) !== undefined) {
|
|
15127
|
+
toolbar = layout.toolbar;
|
|
15128
|
+
}
|
|
14910
15129
|
useEffect$1(() => {
|
|
14911
15130
|
const show = () => {
|
|
14912
15131
|
setShowToolbar(true);
|
|
15132
|
+
if (search === 'inSelection') {
|
|
15133
|
+
setShowSearch(true);
|
|
15134
|
+
}
|
|
14913
15135
|
};
|
|
14914
15136
|
const hide = () => {
|
|
14915
15137
|
setShowToolbar(false);
|
|
14916
|
-
if (search === 'toggle') {
|
|
15138
|
+
if (search === 'toggle' || search === 'inSelection') {
|
|
14917
15139
|
setShowSearch(false);
|
|
14918
15140
|
}
|
|
14919
15141
|
};
|
|
@@ -14950,30 +15172,19 @@ function ListBoxInline(_ref3) {
|
|
|
14950
15172
|
model,
|
|
14951
15173
|
translator
|
|
14952
15174
|
}) : [];
|
|
14953
|
-
const
|
|
14954
|
-
const searchVisible = (search === true || search === 'toggle' && showSearch) && !selectDisabled();
|
|
15175
|
+
const searchVisible = (search === true || (search === 'toggle' || search === 'inSelection') && showSearch) && !selectDisabled();
|
|
14955
15176
|
const dense = (_layout$layoutOptions = (_layout$layoutOptions2 = layout.layoutOptions) === null || _layout$layoutOptions2 === void 0 ? void 0 : _layout$layoutOptions2.dense) !== null && _layout$layoutOptions !== void 0 ? _layout$layoutOptions : false;
|
|
14956
15177
|
const searchHeight = dense ? 27 : 40;
|
|
14957
15178
|
const extraheight = dense ? 39 : 49;
|
|
14958
15179
|
const minHeight = 49 + (searchVisible ? searchHeight : 0) + extraheight;
|
|
15180
|
+
const {
|
|
15181
|
+
wildCardSearch,
|
|
15182
|
+
searchEnabled
|
|
15183
|
+
} = layout;
|
|
14959
15184
|
const onShowSearch = () => {
|
|
14960
15185
|
const newValue = !showSearch;
|
|
14961
15186
|
setShowSearch(newValue);
|
|
14962
15187
|
};
|
|
14963
|
-
const getSearchOrUnlock = () => {
|
|
14964
|
-
const showSearchIcon = search === 'toggle' && !hasSelections$1;
|
|
14965
|
-
return showSearchIcon ? /*#__PURE__*/React__default.createElement(IconButton, {
|
|
14966
|
-
onClick: onShowSearch,
|
|
14967
|
-
tabIndex: -1,
|
|
14968
|
-
title: translator.get('Listbox.Search'),
|
|
14969
|
-
size: "large"
|
|
14970
|
-
}, /*#__PURE__*/React__default.createElement(SearchIcon, null)) : /*#__PURE__*/React__default.createElement(IconButton, {
|
|
14971
|
-
onClick: lock,
|
|
14972
|
-
tabIndex: -1,
|
|
14973
|
-
disabled: !hasSelections$1,
|
|
14974
|
-
size: "large"
|
|
14975
|
-
}, /*#__PURE__*/React__default.createElement(Unlock, null));
|
|
14976
|
-
};
|
|
14977
15188
|
return /*#__PURE__*/React__default.createElement(StyledGrid$3, {
|
|
14978
15189
|
className: "listbox-container",
|
|
14979
15190
|
container: true,
|
|
@@ -14986,28 +15197,44 @@ function ListBoxInline(_ref3) {
|
|
|
14986
15197
|
flexFlow: 'column nowrap'
|
|
14987
15198
|
},
|
|
14988
15199
|
onKeyDown: handleKeyDown
|
|
14989
|
-
}, toolbar && /*#__PURE__*/React__default.createElement(Grid, {
|
|
15200
|
+
}, toolbar && layout.title && /*#__PURE__*/React__default.createElement(Grid, {
|
|
14990
15201
|
item: true,
|
|
14991
15202
|
container: true,
|
|
14992
15203
|
style: {
|
|
14993
15204
|
padding: theme.spacing(1)
|
|
14994
15205
|
}
|
|
14995
15206
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
14996
|
-
item: true
|
|
15207
|
+
item: true,
|
|
15208
|
+
sx: {
|
|
15209
|
+
display: 'flex',
|
|
15210
|
+
alignItems: 'center'
|
|
15211
|
+
}
|
|
14997
15212
|
}, isLocked ? /*#__PURE__*/React__default.createElement(IconButton, {
|
|
14998
15213
|
tabIndex: -1,
|
|
14999
15214
|
onClick: unlock,
|
|
15000
15215
|
disabled: !isLocked,
|
|
15001
15216
|
size: "large"
|
|
15002
15217
|
}, /*#__PURE__*/React__default.createElement(Lock, {
|
|
15003
|
-
title: translator.get('Listbox.Unlock')
|
|
15004
|
-
|
|
15218
|
+
title: translator.get('Listbox.Unlock'),
|
|
15219
|
+
style: {
|
|
15220
|
+
fontSize: '12px'
|
|
15221
|
+
}
|
|
15222
|
+
})) : searchEnabled !== false && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
15223
|
+
onClick: onShowSearch,
|
|
15224
|
+
tabIndex: -1,
|
|
15225
|
+
title: translator.get('Listbox.Search'),
|
|
15226
|
+
size: "large"
|
|
15227
|
+
}, /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
15228
|
+
style: {
|
|
15229
|
+
fontSize: '12px'
|
|
15230
|
+
}
|
|
15231
|
+
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
15005
15232
|
item: true,
|
|
15006
15233
|
className: classes$4.listBoxHeader
|
|
15007
15234
|
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
15008
15235
|
variant: "h6",
|
|
15009
15236
|
noWrap: true
|
|
15010
|
-
}, layout.title
|
|
15237
|
+
}, layout.title)), /*#__PURE__*/React__default.createElement(Grid, {
|
|
15011
15238
|
item: true,
|
|
15012
15239
|
xs: true
|
|
15013
15240
|
}), /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -15052,7 +15279,9 @@ function ListBoxInline(_ref3) {
|
|
|
15052
15279
|
dense: dense,
|
|
15053
15280
|
keyboard: keyboard,
|
|
15054
15281
|
visible: searchVisible,
|
|
15055
|
-
searchContainerRef: searchContainerRef
|
|
15282
|
+
searchContainerRef: searchContainerRef,
|
|
15283
|
+
wildCardSearch: wildCardSearch,
|
|
15284
|
+
searchEnabled: searchEnabled
|
|
15056
15285
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
15057
15286
|
item: true,
|
|
15058
15287
|
xs: true
|
|
@@ -15338,7 +15567,7 @@ function ListBoxWrapper(_ref) {
|
|
|
15338
15567
|
options
|
|
15339
15568
|
});
|
|
15340
15569
|
const elementRef = useRef(element);
|
|
15341
|
-
const selections = hasExternalSelectionsApi ? options.selectionsApi : useObjectSelections(app, model, elementRef)[0];
|
|
15570
|
+
const selections = hasExternalSelectionsApi ? options.selectionsApi : useObjectSelections(app, model, elementRef, options)[0];
|
|
15342
15571
|
if (!selections || !model) {
|
|
15343
15572
|
return null;
|
|
15344
15573
|
}
|
|
@@ -15397,6 +15626,9 @@ function ListBoxPopoverWrapper(_ref) {
|
|
|
15397
15626
|
const [showState, setShowstate] = useState$1(!!options.show);
|
|
15398
15627
|
const handleCloseShowState = () => {
|
|
15399
15628
|
setShowstate(false);
|
|
15629
|
+
if (options.onPopoverClose) {
|
|
15630
|
+
options.onPopoverClose();
|
|
15631
|
+
}
|
|
15400
15632
|
};
|
|
15401
15633
|
return /*#__PURE__*/React__default.createElement(ListBoxPopover, {
|
|
15402
15634
|
show: showState,
|
|
@@ -22183,9 +22415,9 @@ function create(_ref) {
|
|
|
22183
22415
|
version
|
|
22184
22416
|
} = typeInfo;
|
|
22185
22417
|
if (!tc[name]) {
|
|
22186
|
-
//
|
|
22418
|
+
// Chart not registered, so we'll do that now.
|
|
22187
22419
|
{
|
|
22188
|
-
console.warn("Visualization ".concat(name, " is not registered.")); // eslint-disable-line no-console
|
|
22420
|
+
console.warn("Visualization ".concat(name, " is not registered. Adding it now.")); // eslint-disable-line no-console
|
|
22189
22421
|
}
|
|
22190
22422
|
|
|
22191
22423
|
this.register({
|
|
@@ -22216,26 +22448,6 @@ function create(_ref) {
|
|
|
22216
22448
|
};
|
|
22217
22449
|
}
|
|
22218
22450
|
|
|
22219
|
-
/**
|
|
22220
|
-
* @interface Context
|
|
22221
|
-
* @property {boolean=} keyboardNavigation
|
|
22222
|
-
* @property {object=} constraints
|
|
22223
|
-
* @property {boolean=} constraints.active
|
|
22224
|
-
* @property {boolean=} constraints.passive
|
|
22225
|
-
* @property {boolean=} constraints.select
|
|
22226
|
-
*/
|
|
22227
|
-
const DEFAULT_CONTEXT = /** @lends Context */{
|
|
22228
|
-
/** @type {string=} */
|
|
22229
|
-
theme: 'light',
|
|
22230
|
-
/** @type {string=} */
|
|
22231
|
-
language: 'en-US',
|
|
22232
|
-
/** @type {string=} */
|
|
22233
|
-
deviceType: 'auto',
|
|
22234
|
-
constraints: {},
|
|
22235
|
-
keyboardNavigation: false,
|
|
22236
|
-
disableCellPadding: false
|
|
22237
|
-
};
|
|
22238
|
-
|
|
22239
22451
|
/**
|
|
22240
22452
|
* @interface SnapshotConfiguration
|
|
22241
22453
|
* @private
|
|
@@ -22265,30 +22477,68 @@ const DEFAULT_SNAPSHOT_CONFIG = /** @lends SnapshotConfiguration */{
|
|
|
22265
22477
|
|
|
22266
22478
|
/**
|
|
22267
22479
|
* @interface Configuration
|
|
22480
|
+
* @property {LoadType=} load Fallback load function for missing types
|
|
22481
|
+
* @property {Context=} context Settings for the rendering instance
|
|
22482
|
+
* @property {Array<TypeInfo>=} types Visualization types to register
|
|
22483
|
+
* @property {Array<ThemeInfo>=} themes Themes to register
|
|
22484
|
+
* @property {object=} anything
|
|
22485
|
+
* @example
|
|
22486
|
+
* import { embed } from '@nebula.js/stardust'
|
|
22487
|
+
* n = embed(app, {
|
|
22488
|
+
* context: {
|
|
22489
|
+
* keyboardNavigation: true,
|
|
22490
|
+
* theme: 'purple',
|
|
22491
|
+
* },
|
|
22492
|
+
* load: ({ name, version }) => {
|
|
22493
|
+
* if (name === 'linechart') {
|
|
22494
|
+
* return Promise.resolve(line);
|
|
22495
|
+
* }
|
|
22496
|
+
* },
|
|
22497
|
+
* types: [
|
|
22498
|
+
* {
|
|
22499
|
+
* name: 'bar',
|
|
22500
|
+
* load: () => Promise.resolve(bar),
|
|
22501
|
+
* },
|
|
22502
|
+
* ],
|
|
22503
|
+
* themes: [
|
|
22504
|
+
* {
|
|
22505
|
+
* id: 'purple',
|
|
22506
|
+
* load: () => Promise.resolve(purpleThemeJson),
|
|
22507
|
+
* },
|
|
22508
|
+
* ],
|
|
22509
|
+
* });
|
|
22268
22510
|
*/
|
|
22269
|
-
|
|
22270
|
-
|
|
22271
|
-
|
|
22272
|
-
*/
|
|
22273
|
-
context: DEFAULT_CONTEXT,
|
|
22511
|
+
|
|
22512
|
+
const DEFAULT_CONFIG = {
|
|
22513
|
+
context: {},
|
|
22274
22514
|
load: () => undefined,
|
|
22275
|
-
/**
|
|
22276
|
-
* @type {(TypeInfo[])=}
|
|
22277
|
-
*/
|
|
22278
22515
|
types: [],
|
|
22279
|
-
/**
|
|
22280
|
-
* @type {(ThemeInfo[])=}
|
|
22281
|
-
*/
|
|
22282
22516
|
themes: [],
|
|
22283
|
-
/** @type {object=} */
|
|
22284
22517
|
anything: {},
|
|
22285
|
-
/**
|
|
22286
|
-
* @type {SnapshotConfiguration=}
|
|
22287
|
-
* @private
|
|
22288
|
-
*/
|
|
22289
22518
|
snapshot: DEFAULT_SNAPSHOT_CONFIG
|
|
22290
22519
|
};
|
|
22291
22520
|
|
|
22521
|
+
/**
|
|
22522
|
+
* @interface Context
|
|
22523
|
+
* @property {boolean=} keyboardNavigation
|
|
22524
|
+
* @property {object=} constraints
|
|
22525
|
+
* @property {boolean=} constraints.active
|
|
22526
|
+
* @property {boolean=} constraints.passive
|
|
22527
|
+
* @property {boolean=} constraints.select
|
|
22528
|
+
*/
|
|
22529
|
+
const DEFAULT_CONTEXT = /** @lends Context */{
|
|
22530
|
+
/** @type {string=} */
|
|
22531
|
+
theme: 'light',
|
|
22532
|
+
/** @type {string=} */
|
|
22533
|
+
language: 'en-US',
|
|
22534
|
+
/** @type {string=} */
|
|
22535
|
+
deviceType: 'auto',
|
|
22536
|
+
constraints: {},
|
|
22537
|
+
keyboardNavigation: false,
|
|
22538
|
+
disableCellPadding: false
|
|
22539
|
+
};
|
|
22540
|
+
DEFAULT_CONFIG.context = DEFAULT_CONTEXT;
|
|
22541
|
+
|
|
22292
22542
|
/**
|
|
22293
22543
|
* @interface Galaxy
|
|
22294
22544
|
*/
|
|
@@ -22397,6 +22647,23 @@ function nuked() {
|
|
|
22397
22647
|
let selectionsApi = null;
|
|
22398
22648
|
let selectionsComponentReference = null;
|
|
22399
22649
|
|
|
22650
|
+
/**
|
|
22651
|
+
* @ignore
|
|
22652
|
+
* @typedef { 'fieldPopoverClose' } EmbedEventTypes
|
|
22653
|
+
*/
|
|
22654
|
+
|
|
22655
|
+
/**
|
|
22656
|
+
* Event listener function on instance
|
|
22657
|
+
*
|
|
22658
|
+
* @ignore
|
|
22659
|
+
* @method
|
|
22660
|
+
* @name Embed#on
|
|
22661
|
+
* @param {EmbedEventTypes} eventType event type that function needs to listen
|
|
22662
|
+
* @param {Function} callback a callback function to run when event emits
|
|
22663
|
+
* @example
|
|
22664
|
+
* api.on('someEvent', () => {...});
|
|
22665
|
+
*/
|
|
22666
|
+
|
|
22400
22667
|
/**
|
|
22401
22668
|
* @class
|
|
22402
22669
|
* @alias Embed
|
|
@@ -22544,7 +22811,34 @@ function nuked() {
|
|
|
22544
22811
|
*/
|
|
22545
22812
|
|
|
22546
22813
|
/**
|
|
22547
|
-
* @typedef { boolean | 'toggle' } SearchMode
|
|
22814
|
+
* @typedef { boolean | 'toggle' | 'inSelection' } SearchMode
|
|
22815
|
+
*/
|
|
22816
|
+
|
|
22817
|
+
/**
|
|
22818
|
+
* @typedef { 'selectionActivated' | 'selectionDeactivated' } FieldEventTypes
|
|
22819
|
+
*/
|
|
22820
|
+
|
|
22821
|
+
/**
|
|
22822
|
+
* Event listener function on instance
|
|
22823
|
+
*
|
|
22824
|
+
* @method
|
|
22825
|
+
* @name FieldInstance#on
|
|
22826
|
+
* @param {FieldEventTypes} eventType event type that function needs to listen
|
|
22827
|
+
* @param {Function} callback a callback function to run when event emits
|
|
22828
|
+
* @example
|
|
22829
|
+
* const handleSomeEvent () => {...};
|
|
22830
|
+
* fieldInstance.on('someEvent', handleSomeEvent);
|
|
22831
|
+
* ...
|
|
22832
|
+
* fieldInstance.removeListener('someEvent', handleSomeEvent);
|
|
22833
|
+
*/
|
|
22834
|
+
|
|
22835
|
+
/**
|
|
22836
|
+
* Remove listener on instance
|
|
22837
|
+
*
|
|
22838
|
+
* @method
|
|
22839
|
+
* @name FieldInstance#removeListener
|
|
22840
|
+
* @param {FieldEventTypes} eventType event type
|
|
22841
|
+
* @param {Function} callback handler
|
|
22548
22842
|
*/
|
|
22549
22843
|
|
|
22550
22844
|
/**
|
|
@@ -22563,7 +22857,7 @@ function nuked() {
|
|
|
22563
22857
|
* @param {ListLayout=} [options.listLayout=vertical] Layout direction vertical|horizontal (not applicable for existing objects)
|
|
22564
22858
|
* @param {FrequencyMode=} [options.frequencyMode=none] Show frequency none|value|percent|relative
|
|
22565
22859
|
* @param {boolean=} [options.histogram=false] Show histogram bar (not applicable for existing objects)
|
|
22566
|
-
* @param {SearchMode=} [options.search=true] Show the search bar permanently
|
|
22860
|
+
* @param {SearchMode=} [options.search=true] Show the search bar permanently, using the toggle button or when in selection: false|true|toggle|inSelection
|
|
22567
22861
|
* @param {boolean=} [options.toolbar=true] Show the toolbar
|
|
22568
22862
|
* @param {boolean=} [options.checkboxes=false] Show values as checkboxes instead of as fields (not applicable for existing objects)
|
|
22569
22863
|
* @param {boolean=} [options.dense=false] Reduces padding and text size (not applicable for existing objects)
|
|
@@ -22583,12 +22877,17 @@ function nuked() {
|
|
|
22583
22877
|
if (this._instance) {
|
|
22584
22878
|
throw new Error("Field or object ".concat(fieldName || qId, " already mounted"));
|
|
22585
22879
|
}
|
|
22880
|
+
const onSelectionActivated = () => fieldSels.emit('selectionActivated');
|
|
22881
|
+
const onSelectionDeactivated = () => fieldSels.emit('selectionDeactivated');
|
|
22586
22882
|
this._instance = ListBoxPortal({
|
|
22587
22883
|
element,
|
|
22588
22884
|
app,
|
|
22589
22885
|
fieldIdentifier,
|
|
22590
22886
|
qId,
|
|
22591
|
-
options: getOptions$1(
|
|
22887
|
+
options: getOptions$1(_objectSpread2({
|
|
22888
|
+
onSelectionActivated,
|
|
22889
|
+
onSelectionDeactivated
|
|
22890
|
+
}, options)),
|
|
22592
22891
|
stateName: options.stateName || '$'
|
|
22593
22892
|
});
|
|
22594
22893
|
root.add(this._instance);
|
|
@@ -22607,6 +22906,7 @@ function nuked() {
|
|
|
22607
22906
|
}
|
|
22608
22907
|
}
|
|
22609
22908
|
};
|
|
22909
|
+
eventmixin(fieldSels);
|
|
22610
22910
|
return fieldSels;
|
|
22611
22911
|
},
|
|
22612
22912
|
/**
|
|
@@ -22631,7 +22931,10 @@ function nuked() {
|
|
|
22631
22931
|
root.remove(api._popoverInstance);
|
|
22632
22932
|
api._popoverInstance = null;
|
|
22633
22933
|
}
|
|
22634
|
-
const
|
|
22934
|
+
const onPopoverClose = () => api.emit('fieldPopoverClose');
|
|
22935
|
+
const opts = getOptions(_objectSpread2({
|
|
22936
|
+
onPopoverClose
|
|
22937
|
+
}, options));
|
|
22635
22938
|
api._popoverInstance = React__default.createElement(ListBoxPopoverWrapper, {
|
|
22636
22939
|
element: anchorElement,
|
|
22637
22940
|
key: uid(),
|
|
@@ -22646,6 +22949,7 @@ function nuked() {
|
|
|
22646
22949
|
};
|
|
22647
22950
|
halo.public.nebbie = api;
|
|
22648
22951
|
halo.types = types;
|
|
22952
|
+
eventmixin(api);
|
|
22649
22953
|
return api;
|
|
22650
22954
|
}
|
|
22651
22955
|
|