@nebula.js/stardust 3.0.2-alpha.0 → 3.0.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 +101 -28
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +6 -6
- package/core/esm/index.js.map +1 -1
- package/dist/stardust.dev.js +101 -27
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +3 -3
- package/dist/stardust.js.map +1 -1
- package/package.json +9 -9
package/dist/stardust.dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v3.0.
|
|
2
|
+
* @nebula.js/stardust v3.0.3
|
|
3
3
|
* Copyright (c) 2022 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -17568,7 +17568,7 @@
|
|
|
17568
17568
|
return cache[key];
|
|
17569
17569
|
}
|
|
17570
17570
|
|
|
17571
|
-
const NEBULA_VERSION_HASH = "
|
|
17571
|
+
const NEBULA_VERSION_HASH = "8956" ;
|
|
17572
17572
|
ClassNameGenerator.configure(componentName => {
|
|
17573
17573
|
|
|
17574
17574
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
@@ -18141,7 +18141,7 @@
|
|
|
18141
18141
|
const appRef = React.createRef();
|
|
18142
18142
|
const element = document.createElement('div');
|
|
18143
18143
|
element.style.display = 'none';
|
|
18144
|
-
element.setAttribute('data-nebulajs-version', "3.0.
|
|
18144
|
+
element.setAttribute('data-nebulajs-version', "3.0.3" );
|
|
18145
18145
|
element.setAttribute('data-app-id', app.id);
|
|
18146
18146
|
document.body.appendChild(element);
|
|
18147
18147
|
ReactDOM.render( /*#__PURE__*/React.createElement(NebulaApp, {
|
|
@@ -34268,6 +34268,7 @@
|
|
|
34268
34268
|
const TREE_PATH = '/qListObjectDef';
|
|
34269
34269
|
function ListBoxSearch(_ref) {
|
|
34270
34270
|
let {
|
|
34271
|
+
selections,
|
|
34271
34272
|
model,
|
|
34272
34273
|
keyboard,
|
|
34273
34274
|
dense = false,
|
|
@@ -34277,44 +34278,68 @@
|
|
|
34277
34278
|
translator
|
|
34278
34279
|
} = react.exports.useContext(InstanceContext);
|
|
34279
34280
|
const [value, setValue] = react.exports.useState('');
|
|
34280
|
-
const [isSearching, setIsSearching] = react.exports.useState(false);
|
|
34281
34281
|
const theme = useTheme$1();
|
|
34282
34282
|
|
|
34283
|
+
const cancel = () => selections.isActive() && selections.cancel();
|
|
34284
|
+
|
|
34283
34285
|
const abortSearch = async () => {
|
|
34284
|
-
|
|
34285
|
-
|
|
34286
|
+
if (!selections.isModal()) {
|
|
34287
|
+
return;
|
|
34288
|
+
}
|
|
34289
|
+
|
|
34290
|
+
try {
|
|
34291
|
+
await model.abortListObjectSearch(TREE_PATH);
|
|
34292
|
+
} finally {
|
|
34293
|
+
setValue('');
|
|
34294
|
+
}
|
|
34286
34295
|
};
|
|
34287
34296
|
|
|
34288
34297
|
react.exports.useEffect(() => {
|
|
34289
|
-
if (!visible
|
|
34290
|
-
abortSearch();
|
|
34298
|
+
if (!visible) {
|
|
34299
|
+
abortSearch(); // abort when toggling off search
|
|
34291
34300
|
}
|
|
34292
34301
|
}, [visible]);
|
|
34302
|
+
react.exports.useEffect(() => {
|
|
34303
|
+
selections.on('deactivated', abortSearch);
|
|
34304
|
+
return () => {
|
|
34305
|
+
selections.removeListener && selections.removeListener('deactivated', abortSearch);
|
|
34306
|
+
};
|
|
34307
|
+
}, []);
|
|
34293
34308
|
|
|
34294
|
-
const onChange = e => {
|
|
34309
|
+
const onChange = async e => {
|
|
34295
34310
|
setValue(e.target.value);
|
|
34296
34311
|
|
|
34297
|
-
if (e.target.value.length
|
|
34298
|
-
abortSearch();
|
|
34299
|
-
}
|
|
34300
|
-
|
|
34301
|
-
|
|
34312
|
+
if (!e.target.value.length) {
|
|
34313
|
+
return abortSearch();
|
|
34314
|
+
}
|
|
34315
|
+
|
|
34316
|
+
return model.searchListObjectFor(TREE_PATH, e.target.value);
|
|
34317
|
+
};
|
|
34318
|
+
|
|
34319
|
+
const handleFocus = () => {
|
|
34320
|
+
if (!selections.isModal()) {
|
|
34321
|
+
selections.begin(['/qListObjectDef']);
|
|
34302
34322
|
}
|
|
34303
34323
|
};
|
|
34304
34324
|
|
|
34305
34325
|
const onKeyDown = e => {
|
|
34326
|
+
let response;
|
|
34327
|
+
|
|
34306
34328
|
switch (e.key) {
|
|
34307
34329
|
case 'Enter':
|
|
34308
34330
|
// Maybe we only want to accept if isSearching is true
|
|
34309
|
-
model.acceptListObjectSearch(TREE_PATH, true);
|
|
34331
|
+
response = model.acceptListObjectSearch(TREE_PATH, true);
|
|
34310
34332
|
setValue('');
|
|
34311
34333
|
break;
|
|
34312
34334
|
|
|
34313
34335
|
case 'Escape':
|
|
34314
|
-
|
|
34315
|
-
|
|
34336
|
+
response = cancel();
|
|
34337
|
+
e.preventDefault();
|
|
34338
|
+
e.stopPropagation();
|
|
34316
34339
|
break;
|
|
34317
34340
|
}
|
|
34341
|
+
|
|
34342
|
+
return response;
|
|
34318
34343
|
};
|
|
34319
34344
|
|
|
34320
34345
|
if (!visible) {
|
|
@@ -34351,6 +34376,7 @@
|
|
|
34351
34376
|
fullWidth: true,
|
|
34352
34377
|
placeholder: translator.get('Listbox.Search'),
|
|
34353
34378
|
value: value,
|
|
34379
|
+
onFocus: handleFocus,
|
|
34354
34380
|
onChange: onChange,
|
|
34355
34381
|
onKeyDown: onKeyDown,
|
|
34356
34382
|
inputProps: {
|
|
@@ -34716,6 +34742,7 @@
|
|
|
34716
34742
|
}, /*#__PURE__*/React.createElement("div", {
|
|
34717
34743
|
ref: moreAlignTo
|
|
34718
34744
|
}), /*#__PURE__*/React.createElement(ListBoxSearch, {
|
|
34745
|
+
selections: selections,
|
|
34719
34746
|
model: model,
|
|
34720
34747
|
visible: true
|
|
34721
34748
|
}), /*#__PURE__*/React.createElement(ListBox, {
|
|
@@ -36178,15 +36205,25 @@
|
|
|
36178
36205
|
active: keyboardActive
|
|
36179
36206
|
};
|
|
36180
36207
|
react.exports.useEffect(() => {
|
|
36181
|
-
const show = () =>
|
|
36208
|
+
const show = () => {
|
|
36209
|
+
setShowToolbar(true);
|
|
36210
|
+
};
|
|
36182
36211
|
|
|
36183
|
-
const hide = () =>
|
|
36212
|
+
const hide = () => {
|
|
36213
|
+
setShowToolbar(false);
|
|
36214
|
+
|
|
36215
|
+
if (search === 'toggle') {
|
|
36216
|
+
setShowSearch(false);
|
|
36217
|
+
}
|
|
36218
|
+
};
|
|
36184
36219
|
|
|
36185
36220
|
if (selections) {
|
|
36186
|
-
if (!selections.isModal(
|
|
36221
|
+
if (!selections.isModal()) {
|
|
36187
36222
|
selections.on('deactivated', hide);
|
|
36188
36223
|
selections.on('activated', show);
|
|
36189
36224
|
}
|
|
36225
|
+
|
|
36226
|
+
setShowToolbar(selections.isActive());
|
|
36190
36227
|
}
|
|
36191
36228
|
|
|
36192
36229
|
return () => {
|
|
@@ -36196,11 +36233,6 @@
|
|
|
36196
36233
|
}
|
|
36197
36234
|
};
|
|
36198
36235
|
}, [selections]);
|
|
36199
|
-
react.exports.useEffect(() => {
|
|
36200
|
-
if (selections) {
|
|
36201
|
-
setShowToolbar(selections.isActive());
|
|
36202
|
-
}
|
|
36203
|
-
}, [selections]);
|
|
36204
36236
|
const listBoxRef = react.exports.useRef(null);
|
|
36205
36237
|
useConfirmUnfocus(listBoxRef, selections, shouldConfirmOnBlur);
|
|
36206
36238
|
react.exports.useEffect(() => {
|
|
@@ -36309,10 +36341,12 @@
|
|
|
36309
36341
|
item: true,
|
|
36310
36342
|
ref: searchContainerRef
|
|
36311
36343
|
}, /*#__PURE__*/React.createElement(ListBoxSearch, {
|
|
36344
|
+
selections: selections,
|
|
36312
36345
|
model: model,
|
|
36313
36346
|
dense: dense,
|
|
36314
36347
|
keyboard: keyboard,
|
|
36315
|
-
visible: searchVisible
|
|
36348
|
+
visible: searchVisible,
|
|
36349
|
+
searchContainerRef: searchContainerRef
|
|
36316
36350
|
})), /*#__PURE__*/React.createElement(Grid, {
|
|
36317
36351
|
item: true,
|
|
36318
36352
|
xs: true
|
|
@@ -39829,6 +39863,7 @@
|
|
|
39829
39863
|
},
|
|
39830
39864
|
list: [],
|
|
39831
39865
|
snaps: [],
|
|
39866
|
+
menus: [],
|
|
39832
39867
|
actions: {
|
|
39833
39868
|
list: []
|
|
39834
39869
|
},
|
|
@@ -39946,6 +39981,15 @@
|
|
|
39946
39981
|
|
|
39947
39982
|
return Promise.resolve();
|
|
39948
39983
|
}
|
|
39984
|
+
function runMenu(component, menu, event) {
|
|
39985
|
+
try {
|
|
39986
|
+
return Promise.all(component.__hooks.menus.map(h => Promise.resolve(h.fn(menu, event)))).then(menus => menus[menus.length - 1]);
|
|
39987
|
+
} catch (e) {
|
|
39988
|
+
console.error(e);
|
|
39989
|
+
}
|
|
39990
|
+
|
|
39991
|
+
return Promise.resolve();
|
|
39992
|
+
}
|
|
39949
39993
|
function getImperativeHandle(component) {
|
|
39950
39994
|
return component.__hooks.imperativeHandle;
|
|
39951
39995
|
}
|
|
@@ -40022,6 +40066,7 @@
|
|
|
40022
40066
|
run,
|
|
40023
40067
|
teardown,
|
|
40024
40068
|
runSnaps,
|
|
40069
|
+
runMenu,
|
|
40025
40070
|
focus,
|
|
40026
40071
|
blur,
|
|
40027
40072
|
observeActions,
|
|
@@ -40815,6 +40860,30 @@
|
|
|
40815
40860
|
|
|
40816
40861
|
h.fn = cb;
|
|
40817
40862
|
}
|
|
40863
|
+
/**
|
|
40864
|
+
* Registers a callback that is called when the context menu opens
|
|
40865
|
+
* @entry
|
|
40866
|
+
* @param {function(menu, event): void} addItemCallback
|
|
40867
|
+
* @ignore
|
|
40868
|
+
* @example
|
|
40869
|
+
* import { onContextMenu } from '@nebula.js/stardust';
|
|
40870
|
+
|
|
40871
|
+
* onContextMenu((menu, event) => {
|
|
40872
|
+
* menu.addItem(item, index);
|
|
40873
|
+
* });
|
|
40874
|
+
*/
|
|
40875
|
+
|
|
40876
|
+
function onContextMenu(cb) {
|
|
40877
|
+
const h = getHook(++currentIndex);
|
|
40878
|
+
|
|
40879
|
+
if (!h.value) {
|
|
40880
|
+
h.value = 1;
|
|
40881
|
+
|
|
40882
|
+
currentComponent.__hooks.menus.push(h);
|
|
40883
|
+
}
|
|
40884
|
+
|
|
40885
|
+
h.fn = cb;
|
|
40886
|
+
}
|
|
40818
40887
|
/**
|
|
40819
40888
|
* @interface RenderState
|
|
40820
40889
|
* @property {any} pending
|
|
@@ -41205,6 +41274,10 @@
|
|
|
41205
41274
|
return generator.component.runSnaps(this, layout);
|
|
41206
41275
|
},
|
|
41207
41276
|
|
|
41277
|
+
onContextMenu(menu, event) {
|
|
41278
|
+
return generator.component.runMenu(this, menu, event);
|
|
41279
|
+
},
|
|
41280
|
+
|
|
41208
41281
|
focus() {
|
|
41209
41282
|
generator.component.focus(this);
|
|
41210
41283
|
},
|
|
@@ -43936,7 +44009,7 @@
|
|
|
43936
44009
|
var enigmaMocker_dev = {exports: {}};
|
|
43937
44010
|
|
|
43938
44011
|
/*
|
|
43939
|
-
* @nebula.js/enigma-mocker v3.0.
|
|
44012
|
+
* @nebula.js/enigma-mocker v3.0.2
|
|
43940
44013
|
* Copyright (c) 2022 QlikTech International AB
|
|
43941
44014
|
* Released under the MIT license.
|
|
43942
44015
|
*/
|
|
@@ -44509,6 +44582,7 @@
|
|
|
44509
44582
|
exports.__DO_NOT_USE__ = __DO_NOT_USE__;
|
|
44510
44583
|
exports.conversion = conversion;
|
|
44511
44584
|
exports.embed = index$1;
|
|
44585
|
+
exports.onContextMenu = onContextMenu;
|
|
44512
44586
|
exports.onTakeSnapshot = onTakeSnapshot;
|
|
44513
44587
|
exports.useAction = useAction;
|
|
44514
44588
|
exports.useApp = useApp;
|