@nebula.js/stardust 4.0.0-alpha.2 → 4.0.0-alpha.4
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 +150 -48
- 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 +150 -48
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +7 -7
- package/dist/stardust.js.map +1 -1
- package/package.json +9 -9
- package/types/index.d.ts +9 -9
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.4
|
|
3
3
|
* Copyright (c) 2023 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -1493,6 +1493,26 @@ var Selection_SelectPossible = {
|
|
|
1493
1493
|
"zh-TW": "選取可能值"
|
|
1494
1494
|
}
|
|
1495
1495
|
};
|
|
1496
|
+
var SelectionToolbar_ClickToUnlock = {
|
|
1497
|
+
id: "SelectionToolbar.ClickToUnlock",
|
|
1498
|
+
locale: {
|
|
1499
|
+
"de-DE": "Klicken zum Freigeben",
|
|
1500
|
+
"en-US": "Click to unlock",
|
|
1501
|
+
"es-ES": "Haga clic para desbloquearla",
|
|
1502
|
+
"fr-FR": "Cliquez pour déverrouiller",
|
|
1503
|
+
"it-IT": "Fare clic per sbloccare",
|
|
1504
|
+
"ja-JP": "クリックしてロック解除",
|
|
1505
|
+
"ko-KR": "잠금을 해제하려면 클릭하십시오.",
|
|
1506
|
+
"nl-NL": "Klik om te ontgrendelen",
|
|
1507
|
+
"pl-PL": "Aby odblokować, kliknij",
|
|
1508
|
+
"pt-BR": "Clique para destravar",
|
|
1509
|
+
"ru-RU": "Щелкните, чтобы разблокировать",
|
|
1510
|
+
"sv-SE": "Klicka för att låsa upp",
|
|
1511
|
+
"tr-TR": "Kilidi kaldırmak için tıklayın",
|
|
1512
|
+
"zh-CN": "单击以解锁",
|
|
1513
|
+
"zh-TW": "按一下以解除鎖定"
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1496
1516
|
var Visualization_Incomplete = {
|
|
1497
1517
|
id: "Visualization.Incomplete",
|
|
1498
1518
|
locale: {
|
|
@@ -1664,6 +1684,7 @@ var all = {
|
|
|
1664
1684
|
Selection_SelectAlternative: Selection_SelectAlternative,
|
|
1665
1685
|
Selection_SelectExcluded: Selection_SelectExcluded,
|
|
1666
1686
|
Selection_SelectPossible: Selection_SelectPossible,
|
|
1687
|
+
SelectionToolbar_ClickToUnlock: SelectionToolbar_ClickToUnlock,
|
|
1667
1688
|
Visualization_Incomplete: Visualization_Incomplete,
|
|
1668
1689
|
Visualization_Incomplete_Dimensions: Visualization_Incomplete_Dimensions,
|
|
1669
1690
|
Visualization_Incomplete_Measures: Visualization_Incomplete_Measures,
|
|
@@ -8043,7 +8064,7 @@ function create$3(definition) {
|
|
|
8043
8064
|
return cache[key];
|
|
8044
8065
|
}
|
|
8045
8066
|
|
|
8046
|
-
const NEBULA_VERSION_HASH = "
|
|
8067
|
+
const NEBULA_VERSION_HASH = "0bc0" ;
|
|
8047
8068
|
ClassNameGenerator$1.configure(componentName => {
|
|
8048
8069
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
8049
8070
|
});
|
|
@@ -8251,7 +8272,7 @@ function boot(_ref2) {
|
|
|
8251
8272
|
const appRef = React__default.createRef();
|
|
8252
8273
|
const element = document.createElement('div');
|
|
8253
8274
|
element.style.display = 'none';
|
|
8254
|
-
element.setAttribute('data-nebulajs-version', "4.0.0-alpha.
|
|
8275
|
+
element.setAttribute('data-nebulajs-version', "4.0.0-alpha.4" );
|
|
8255
8276
|
element.setAttribute('data-app-id', app.id);
|
|
8256
8277
|
document.body.appendChild(element);
|
|
8257
8278
|
const root = client.createRoot(element);
|
|
@@ -9325,6 +9346,8 @@ const KEYS = Object.freeze({
|
|
|
9325
9346
|
function getFieldKeyboardNavigation(_ref) {
|
|
9326
9347
|
let {
|
|
9327
9348
|
select,
|
|
9349
|
+
selectAll,
|
|
9350
|
+
onCtrlF,
|
|
9328
9351
|
confirm,
|
|
9329
9352
|
cancel,
|
|
9330
9353
|
setScrollPosition,
|
|
@@ -9344,7 +9367,8 @@ function getFieldKeyboardNavigation(_ref) {
|
|
|
9344
9367
|
const {
|
|
9345
9368
|
keyCode,
|
|
9346
9369
|
shiftKey = false,
|
|
9347
|
-
ctrlKey = false
|
|
9370
|
+
ctrlKey = false,
|
|
9371
|
+
metaKey = false
|
|
9348
9372
|
} = event.nativeEvent;
|
|
9349
9373
|
switch (keyCode) {
|
|
9350
9374
|
case KEYS.SHIFT:
|
|
@@ -9399,6 +9423,18 @@ function getFieldKeyboardNavigation(_ref) {
|
|
|
9399
9423
|
}
|
|
9400
9424
|
setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('end');
|
|
9401
9425
|
break;
|
|
9426
|
+
case KEYS.A:
|
|
9427
|
+
if (ctrlKey || metaKey) {
|
|
9428
|
+
selectAll();
|
|
9429
|
+
break;
|
|
9430
|
+
}
|
|
9431
|
+
return;
|
|
9432
|
+
case KEYS.F:
|
|
9433
|
+
if (ctrlKey || metaKey) {
|
|
9434
|
+
onCtrlF();
|
|
9435
|
+
break;
|
|
9436
|
+
}
|
|
9437
|
+
return;
|
|
9402
9438
|
default:
|
|
9403
9439
|
return;
|
|
9404
9440
|
// don't stop propagation since we want to outsource keydown to other handlers.
|
|
@@ -9782,7 +9818,7 @@ const RowColRoot = styled$1('div', {
|
|
|
9782
9818
|
["& .".concat(rowColClasses.frequencyCount)]: _objectSpread2(_objectSpread2({
|
|
9783
9819
|
justifyContent: 'flex-end'
|
|
9784
9820
|
}, ellipsis), {}, {
|
|
9785
|
-
flex: "0 1 ".concat(frequencyWidth, "px"),
|
|
9821
|
+
flex: "0 1 ".concat(frequencyWidth + (showIcon || checkboxes ? 0 : iconWidth), "px"),
|
|
9786
9822
|
textAlign: 'right',
|
|
9787
9823
|
paddingLeft: '2px'
|
|
9788
9824
|
}),
|
|
@@ -12085,6 +12121,8 @@ function getListBoxComponents(_ref) {
|
|
|
12085
12121
|
histogram,
|
|
12086
12122
|
isSingleSelect,
|
|
12087
12123
|
select,
|
|
12124
|
+
selectAll,
|
|
12125
|
+
onCtrlF,
|
|
12088
12126
|
textAlign,
|
|
12089
12127
|
selections,
|
|
12090
12128
|
keyboard,
|
|
@@ -12142,7 +12180,9 @@ function getListBoxComponents(_ref) {
|
|
|
12142
12180
|
select,
|
|
12143
12181
|
confirm: () => selections === null || selections === void 0 ? void 0 : selections.confirm.call(selections),
|
|
12144
12182
|
cancel: () => selections === null || selections === void 0 ? void 0 : selections.cancel.call(selections),
|
|
12145
|
-
setScrollPosition
|
|
12183
|
+
setScrollPosition,
|
|
12184
|
+
selectAll,
|
|
12185
|
+
onCtrlF
|
|
12146
12186
|
},
|
|
12147
12187
|
frequencyMax,
|
|
12148
12188
|
histogram,
|
|
@@ -12940,7 +12980,10 @@ const escapeField = field => {
|
|
|
12940
12980
|
if (!field) {
|
|
12941
12981
|
return field;
|
|
12942
12982
|
}
|
|
12943
|
-
|
|
12983
|
+
if (/^[A-Za-z][A-Za-z0-9_]*$/.test(field)) {
|
|
12984
|
+
return field;
|
|
12985
|
+
}
|
|
12986
|
+
return "[".concat(field.replace(/\]/g, ']]'), "]");
|
|
12944
12987
|
};
|
|
12945
12988
|
const needToFetchFrequencyMax = layout => (layout === null || layout === void 0 ? void 0 : layout.frequencyMax) === 'fetch';
|
|
12946
12989
|
const getFrequencyMaxExpression = field => {
|
|
@@ -12956,8 +12999,9 @@ const getFrequencyMax = async (layout, app) => {
|
|
|
12956
12999
|
};
|
|
12957
13000
|
|
|
12958
13001
|
const useFrequencyMax = (app, layout) => {
|
|
12959
|
-
const [frequencyMax, setFrequencyMax] = useState$1();
|
|
12960
13002
|
const needFetch = needToFetchFrequencyMax(layout);
|
|
13003
|
+
const [frequencyMax, setFrequencyMax] = useState$1();
|
|
13004
|
+
const [awaitingFrequencyMax, setAwaitingFrequencyMax] = useState$1(needFetch);
|
|
12961
13005
|
useEffect$1(() => {
|
|
12962
13006
|
if (!needFetch) {
|
|
12963
13007
|
return;
|
|
@@ -12965,10 +13009,14 @@ const useFrequencyMax = (app, layout) => {
|
|
|
12965
13009
|
const fetch = async () => {
|
|
12966
13010
|
const newValue = await getFrequencyMax(layout, app);
|
|
12967
13011
|
setFrequencyMax(newValue);
|
|
13012
|
+
setAwaitingFrequencyMax(false);
|
|
12968
13013
|
};
|
|
12969
13014
|
fetch();
|
|
12970
13015
|
}, [needFetch && layout]);
|
|
12971
|
-
return
|
|
13016
|
+
return {
|
|
13017
|
+
frequencyMax: needFetch ? frequencyMax : layout === null || layout === void 0 ? void 0 : layout.frequencyMax,
|
|
13018
|
+
awaitingFrequencyMax
|
|
13019
|
+
};
|
|
12972
13020
|
};
|
|
12973
13021
|
|
|
12974
13022
|
const _excluded$4 = ["isLoadingData"];
|
|
@@ -13001,7 +13049,9 @@ function ListBox(_ref) {
|
|
|
13001
13049
|
},
|
|
13002
13050
|
currentScrollIndex = {
|
|
13003
13051
|
set: () => {}
|
|
13004
|
-
}
|
|
13052
|
+
},
|
|
13053
|
+
renderedCallback,
|
|
13054
|
+
onCtrlF
|
|
13005
13055
|
} = _ref;
|
|
13006
13056
|
const [initScrollPosIsSet, setInitScrollPosIsSet] = useState$1(false);
|
|
13007
13057
|
const isSingleSelect = !!(layout && layout.qListObject.qDimensionInfo.qIsOneAndOnlyOne);
|
|
@@ -13021,6 +13071,10 @@ function ListBox(_ref) {
|
|
|
13021
13071
|
|
|
13022
13072
|
// The time from scroll end until new data is being fetched, may be exposed in API later on.
|
|
13023
13073
|
const scrollTimeout = 0;
|
|
13074
|
+
const {
|
|
13075
|
+
frequencyMax,
|
|
13076
|
+
awaitingFrequencyMax
|
|
13077
|
+
} = useFrequencyMax(app, layout);
|
|
13024
13078
|
const _useItemsLoader = useItemsLoader({
|
|
13025
13079
|
local,
|
|
13026
13080
|
loaderRef,
|
|
@@ -13046,11 +13100,15 @@ function ListBox(_ref) {
|
|
|
13046
13100
|
if (itemsLoader !== null && itemsLoader !== void 0 && itemsLoader.pages) {
|
|
13047
13101
|
selectionState.update({
|
|
13048
13102
|
setPages,
|
|
13049
|
-
pages: itemsLoader
|
|
13103
|
+
pages: itemsLoader.pages,
|
|
13050
13104
|
isSingleSelect,
|
|
13051
13105
|
selectDisabled,
|
|
13052
13106
|
layout
|
|
13053
13107
|
});
|
|
13108
|
+
if (itemsLoader.pages.length && !awaitingFrequencyMax) {
|
|
13109
|
+
// All necessary data fetching done - signal rendering done!
|
|
13110
|
+
renderedCallback();
|
|
13111
|
+
}
|
|
13054
13112
|
}
|
|
13055
13113
|
const isItemLoaded = useCallback(index => {
|
|
13056
13114
|
if (!(pages !== null && pages !== void 0 && pages.length) || !local.current.validPages) {
|
|
@@ -13209,7 +13267,10 @@ function ListBox(_ref) {
|
|
|
13209
13267
|
last
|
|
13210
13268
|
}))
|
|
13211
13269
|
});
|
|
13212
|
-
const
|
|
13270
|
+
const selectAll = () => {
|
|
13271
|
+
selectionState.clearItemStates(false);
|
|
13272
|
+
model.selectListObjectAll('/qListObjectDef');
|
|
13273
|
+
};
|
|
13213
13274
|
const {
|
|
13214
13275
|
List,
|
|
13215
13276
|
Grid
|
|
@@ -13225,6 +13286,8 @@ function ListBox(_ref) {
|
|
|
13225
13286
|
showGray,
|
|
13226
13287
|
interactionEvents,
|
|
13227
13288
|
select,
|
|
13289
|
+
selectAll,
|
|
13290
|
+
onCtrlF,
|
|
13228
13291
|
textAlign,
|
|
13229
13292
|
isVertical,
|
|
13230
13293
|
pages,
|
|
@@ -13690,15 +13753,12 @@ const ActionsGroup = React__default.forwardRef((_ref2, ref) => {
|
|
|
13690
13753
|
const popoverStyle = {
|
|
13691
13754
|
pointerEvents: 'none'
|
|
13692
13755
|
};
|
|
13693
|
-
const popoverAnchorOrigin = {
|
|
13694
|
-
vertical: 'top',
|
|
13695
|
-
horizontal: 'right'
|
|
13696
|
-
};
|
|
13697
13756
|
const popoverTransformOrigin = {
|
|
13698
13757
|
vertical: 'bottom',
|
|
13699
13758
|
horizontal: 'right'
|
|
13700
13759
|
};
|
|
13701
13760
|
function ActionsToolbar(_ref3) {
|
|
13761
|
+
var _popover$anchorEl$cli, _popover$anchorEl;
|
|
13702
13762
|
let {
|
|
13703
13763
|
show = true,
|
|
13704
13764
|
actions = [],
|
|
@@ -13737,6 +13797,10 @@ function ActionsToolbar(_ref3) {
|
|
|
13737
13797
|
const dividerStyle = useMemo$1(() => ({
|
|
13738
13798
|
margin: theme.spacing(0.5, 0)
|
|
13739
13799
|
}));
|
|
13800
|
+
const popoverAnchorOrigin = {
|
|
13801
|
+
vertical: 15,
|
|
13802
|
+
horizontal: ((_popover$anchorEl$cli = (_popover$anchorEl = popover.anchorEl) === null || _popover$anchorEl === void 0 ? void 0 : _popover$anchorEl.clientWidth) !== null && _popover$anchorEl$cli !== void 0 ? _popover$anchorEl$cli : 0) - 7
|
|
13803
|
+
};
|
|
13740
13804
|
const getEnabledButton = last => {
|
|
13741
13805
|
const actionsElement = actionsRef.current || actionsRefMock;
|
|
13742
13806
|
if (!actionsElement) return null;
|
|
@@ -13898,7 +13962,8 @@ function ListBoxSearch(_ref3) {
|
|
|
13898
13962
|
autoFocus = true,
|
|
13899
13963
|
wildCardSearch = false,
|
|
13900
13964
|
searchEnabled,
|
|
13901
|
-
direction
|
|
13965
|
+
direction,
|
|
13966
|
+
hide
|
|
13902
13967
|
} = _ref3;
|
|
13903
13968
|
const {
|
|
13904
13969
|
translator
|
|
@@ -13984,6 +14049,16 @@ function ListBoxSearch(_ref3) {
|
|
|
13984
14049
|
e.preventDefault();
|
|
13985
14050
|
e.stopPropagation();
|
|
13986
14051
|
break;
|
|
14052
|
+
case 'f':
|
|
14053
|
+
case 'F':
|
|
14054
|
+
if (e.ctrlKey || e.metaKey) {
|
|
14055
|
+
if (hide) {
|
|
14056
|
+
hide();
|
|
14057
|
+
}
|
|
14058
|
+
e.preventDefault();
|
|
14059
|
+
e.stopPropagation();
|
|
14060
|
+
}
|
|
14061
|
+
break;
|
|
13987
14062
|
}
|
|
13988
14063
|
return response;
|
|
13989
14064
|
};
|
|
@@ -14441,6 +14516,7 @@ function ListBoxPopover(_ref) {
|
|
|
14441
14516
|
const open = show && Boolean(alignTo.current);
|
|
14442
14517
|
const [listCount, setListCount] = useState$1(0);
|
|
14443
14518
|
const theme = useTheme$1();
|
|
14519
|
+
const searchContainerRef = useRef();
|
|
14444
14520
|
const [model] = useSessionModel({
|
|
14445
14521
|
qInfo: {
|
|
14446
14522
|
qType: 'njsListbox'
|
|
@@ -14502,6 +14578,10 @@ function ListBoxPopover(_ref) {
|
|
|
14502
14578
|
translator,
|
|
14503
14579
|
selectionState: selectionState$1
|
|
14504
14580
|
});
|
|
14581
|
+
const onCtrlF = () => {
|
|
14582
|
+
const input = searchContainerRef.current.querySelector('input');
|
|
14583
|
+
input === null || input === void 0 ? void 0 : input.focus();
|
|
14584
|
+
};
|
|
14505
14585
|
const hasSelections$1 = hasSelections(layout);
|
|
14506
14586
|
return /*#__PURE__*/React__default.createElement(Popover, {
|
|
14507
14587
|
open: open,
|
|
@@ -14568,7 +14648,10 @@ function ListBoxPopover(_ref) {
|
|
|
14568
14648
|
xs: true
|
|
14569
14649
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
14570
14650
|
ref: moreAlignTo
|
|
14571
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
14651
|
+
}), /*#__PURE__*/React__default.createElement(Grid, {
|
|
14652
|
+
item: true,
|
|
14653
|
+
ref: searchContainerRef
|
|
14654
|
+
}, /*#__PURE__*/React__default.createElement(ListBoxSearch, {
|
|
14572
14655
|
visible: true,
|
|
14573
14656
|
model: model,
|
|
14574
14657
|
listCount: listCount,
|
|
@@ -14578,14 +14661,15 @@ function ListBoxPopover(_ref) {
|
|
|
14578
14661
|
enabled: false
|
|
14579
14662
|
},
|
|
14580
14663
|
autoFocus: autoFocus !== null && autoFocus !== void 0 ? autoFocus : true
|
|
14581
|
-
}), /*#__PURE__*/React__default.createElement(ListBox, {
|
|
14664
|
+
})), /*#__PURE__*/React__default.createElement(ListBox, {
|
|
14582
14665
|
model: model,
|
|
14583
14666
|
app: app,
|
|
14584
14667
|
layout: layout,
|
|
14585
14668
|
selections: selections,
|
|
14586
14669
|
selectionState: selectionState$1,
|
|
14587
14670
|
direction: "ltr",
|
|
14588
|
-
onSetListCount: c => setListCount(c)
|
|
14671
|
+
onSetListCount: c => setListCount(c),
|
|
14672
|
+
onCtrlF: onCtrlF
|
|
14589
14673
|
}))));
|
|
14590
14674
|
}
|
|
14591
14675
|
|
|
@@ -15931,19 +16015,20 @@ const classes$4 = {
|
|
|
15931
16015
|
listboxWrapper: "".concat(PREFIX$4, "-listboxWrapper")
|
|
15932
16016
|
};
|
|
15933
16017
|
const StyledGrid$3 = styled$1(Grid, {
|
|
15934
|
-
shouldForwardProp: p => !['containerPadding'].includes(p)
|
|
16018
|
+
shouldForwardProp: p => !['containerPadding', 'hasIcon'].includes(p)
|
|
15935
16019
|
})(_ref => {
|
|
15936
16020
|
var _theme$listBox$backgr, _theme$listBox;
|
|
15937
16021
|
let {
|
|
15938
16022
|
theme,
|
|
15939
|
-
containerPadding
|
|
16023
|
+
containerPadding,
|
|
16024
|
+
hasIcon
|
|
15940
16025
|
} = _ref;
|
|
15941
16026
|
return {
|
|
15942
16027
|
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,
|
|
15943
16028
|
["& .".concat(classes$4.listBoxHeader)]: {
|
|
15944
16029
|
alignSelf: 'center',
|
|
15945
16030
|
display: 'flex',
|
|
15946
|
-
width: "calc(100% - ".concat(BUTTON_ICON_WIDTH, "px)")
|
|
16031
|
+
width: "calc(100% - ".concat(hasIcon ? BUTTON_ICON_WIDTH : 0, "px)")
|
|
15947
16032
|
},
|
|
15948
16033
|
["& .".concat(classes$4.screenReaderOnly)]: {
|
|
15949
16034
|
position: 'absolute',
|
|
@@ -15954,7 +16039,7 @@ const StyledGrid$3 = styled$1(Grid, {
|
|
|
15954
16039
|
["& .".concat(classes$4.listboxWrapper)]: {
|
|
15955
16040
|
padding: containerPadding
|
|
15956
16041
|
},
|
|
15957
|
-
'&:focus': {
|
|
16042
|
+
'&:focus:not(:hover)': {
|
|
15958
16043
|
boxShadow: "inset 0 0 0 2px ".concat(theme.palette.custom.focusBorder, " !important")
|
|
15959
16044
|
},
|
|
15960
16045
|
'&:focus-visible': {
|
|
@@ -15996,7 +16081,8 @@ function ListBoxInline(_ref3) {
|
|
|
15996
16081
|
postProcessPages = undefined,
|
|
15997
16082
|
calculatePagesHeight,
|
|
15998
16083
|
showGray = true,
|
|
15999
|
-
scrollState = undefined
|
|
16084
|
+
scrollState = undefined,
|
|
16085
|
+
renderedCallback
|
|
16000
16086
|
} = options;
|
|
16001
16087
|
let {
|
|
16002
16088
|
toolbar = true
|
|
@@ -16073,9 +16159,6 @@ function ListBoxInline(_ref3) {
|
|
|
16073
16159
|
useEffect$1(() => {
|
|
16074
16160
|
const show = () => {
|
|
16075
16161
|
setShowToolbar(true);
|
|
16076
|
-
if (search === 'toggle' && toolbar === false) {
|
|
16077
|
-
setShowSearch(true);
|
|
16078
|
-
}
|
|
16079
16162
|
};
|
|
16080
16163
|
const hide = () => {
|
|
16081
16164
|
setShowToolbar(false);
|
|
@@ -16136,6 +16219,14 @@ function ListBoxInline(_ref3) {
|
|
|
16136
16219
|
const newValue = !showSearch;
|
|
16137
16220
|
setShowSearch(newValue);
|
|
16138
16221
|
};
|
|
16222
|
+
const onCtrlF = () => {
|
|
16223
|
+
if (search === 'toggle') {
|
|
16224
|
+
onShowSearch();
|
|
16225
|
+
} else {
|
|
16226
|
+
const input = searchContainer.current.querySelector('input');
|
|
16227
|
+
input === null || input === void 0 ? void 0 : input.focus();
|
|
16228
|
+
}
|
|
16229
|
+
};
|
|
16139
16230
|
const getActionToolbarProps = isPopover => getListboxActionProps({
|
|
16140
16231
|
isPopover,
|
|
16141
16232
|
showToolbar,
|
|
@@ -16175,7 +16266,8 @@ function ListBoxInline(_ref3) {
|
|
|
16175
16266
|
onKeyDown: handleKeyDown,
|
|
16176
16267
|
onMouseEnter: handleOnMouseEnter,
|
|
16177
16268
|
onMouseLeave: handleOnMouseLeave,
|
|
16178
|
-
ref: containerRef
|
|
16269
|
+
ref: containerRef,
|
|
16270
|
+
hasIcon: showIcons
|
|
16179
16271
|
}, toolbar && /*#__PURE__*/React__default.createElement(Grid, {
|
|
16180
16272
|
item: true,
|
|
16181
16273
|
container: true,
|
|
@@ -16278,10 +16370,10 @@ function ListBoxInline(_ref3) {
|
|
|
16278
16370
|
visible: searchVisible,
|
|
16279
16371
|
search: search,
|
|
16280
16372
|
autoFocus: shouldAutoFocus,
|
|
16281
|
-
searchContainerRef: searchContainerRef,
|
|
16282
16373
|
wildCardSearch: wildCardSearch,
|
|
16283
16374
|
searchEnabled: searchEnabled,
|
|
16284
|
-
direction: direction
|
|
16375
|
+
direction: direction,
|
|
16376
|
+
hide: showSearchIcon && onShowSearch
|
|
16285
16377
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
16286
16378
|
item: true,
|
|
16287
16379
|
xs: true,
|
|
@@ -16325,7 +16417,9 @@ function ListBoxInline(_ref3) {
|
|
|
16325
16417
|
currentScrollIndex: {
|
|
16326
16418
|
state: currentScrollIndex,
|
|
16327
16419
|
set: setCurrentScrollIndex
|
|
16328
|
-
}
|
|
16420
|
+
},
|
|
16421
|
+
renderedCallback: renderedCallback,
|
|
16422
|
+
onCtrlF: onCtrlF
|
|
16329
16423
|
});
|
|
16330
16424
|
})))));
|
|
16331
16425
|
}
|
|
@@ -16605,7 +16699,8 @@ function ListBoxWrapper(_ref) {
|
|
|
16605
16699
|
qId,
|
|
16606
16700
|
stateName,
|
|
16607
16701
|
element,
|
|
16608
|
-
options
|
|
16702
|
+
options,
|
|
16703
|
+
renderedCallback
|
|
16609
16704
|
} = _ref;
|
|
16610
16705
|
const {
|
|
16611
16706
|
isExistingObject,
|
|
@@ -16636,7 +16731,8 @@ function ListBoxWrapper(_ref) {
|
|
|
16636
16731
|
const opts = useMemo$1(() => _objectSpread2(_objectSpread2({}, options), {}, {
|
|
16637
16732
|
selections,
|
|
16638
16733
|
model,
|
|
16639
|
-
app
|
|
16734
|
+
app,
|
|
16735
|
+
renderedCallback
|
|
16640
16736
|
}), [options, selections, model, app]);
|
|
16641
16737
|
if (!selections || !model) {
|
|
16642
16738
|
return null;
|
|
@@ -16652,7 +16748,8 @@ function ListBoxPortal(_ref2) {
|
|
|
16652
16748
|
fieldIdentifier,
|
|
16653
16749
|
qId,
|
|
16654
16750
|
stateName = '$',
|
|
16655
|
-
options = {}
|
|
16751
|
+
options = {},
|
|
16752
|
+
renderedCallback
|
|
16656
16753
|
} = _ref2;
|
|
16657
16754
|
return ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(ListBoxWrapper, {
|
|
16658
16755
|
app: app,
|
|
@@ -16660,7 +16757,8 @@ function ListBoxPortal(_ref2) {
|
|
|
16660
16757
|
fieldIdentifier: fieldIdentifier,
|
|
16661
16758
|
qId: qId,
|
|
16662
16759
|
stateName: stateName,
|
|
16663
|
-
options: options
|
|
16760
|
+
options: options,
|
|
16761
|
+
renderedCallback: renderedCallback
|
|
16664
16762
|
}), element, uid());
|
|
16665
16763
|
}
|
|
16666
16764
|
|
|
@@ -24185,13 +24283,14 @@ function nuked() {
|
|
|
24185
24283
|
* @param {boolean=} [options.dense=false] Reduces padding and text size (not applicable for existing objects)
|
|
24186
24284
|
* @param {string=} [options.stateName="$"] Sets the state to make selections in (not applicable for existing objects)
|
|
24187
24285
|
* @param {object=} [options.properties={}] Properties object to extend default properties with
|
|
24286
|
+
* @returns {Promise<void>} A promise that resolves when the data is fetched.
|
|
24188
24287
|
*
|
|
24189
24288
|
* @since 1.1.0
|
|
24190
24289
|
* @instance
|
|
24191
24290
|
* @example
|
|
24192
24291
|
* fieldInstance.mount(element);
|
|
24193
24292
|
*/
|
|
24194
|
-
mount(element) {
|
|
24293
|
+
async mount(element) {
|
|
24195
24294
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
24196
24295
|
if (!element) {
|
|
24197
24296
|
throw new Error("Element for ".concat(fieldName || qId, " not provided"));
|
|
@@ -24201,18 +24300,21 @@ function nuked() {
|
|
|
24201
24300
|
}
|
|
24202
24301
|
const onSelectionActivated = () => fieldSels.emit('selectionActivated');
|
|
24203
24302
|
const onSelectionDeactivated = () => fieldSels.emit('selectionDeactivated');
|
|
24204
|
-
|
|
24205
|
-
|
|
24206
|
-
|
|
24207
|
-
|
|
24208
|
-
|
|
24209
|
-
|
|
24210
|
-
|
|
24211
|
-
|
|
24212
|
-
|
|
24213
|
-
|
|
24303
|
+
return new Promise(resolve => {
|
|
24304
|
+
this._instance = ListBoxPortal({
|
|
24305
|
+
element,
|
|
24306
|
+
app,
|
|
24307
|
+
fieldIdentifier,
|
|
24308
|
+
qId,
|
|
24309
|
+
options: getOptions$1(_objectSpread2({
|
|
24310
|
+
onSelectionActivated,
|
|
24311
|
+
onSelectionDeactivated
|
|
24312
|
+
}, options)),
|
|
24313
|
+
stateName: options.stateName || '$',
|
|
24314
|
+
renderedCallback: resolve
|
|
24315
|
+
});
|
|
24316
|
+
root.add(this._instance);
|
|
24214
24317
|
});
|
|
24215
|
-
root.add(this._instance);
|
|
24216
24318
|
},
|
|
24217
24319
|
/**
|
|
24218
24320
|
* Unmounts the field listbox from the DOM.
|