@nebula.js/stardust 3.1.1 → 3.1.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 +1280 -156
- 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 +3693 -460
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +13 -13
- package/dist/stardust.js.map +1 -1
- package/package.json +10 -10
- package/types/index.d.ts +1 -0
package/core/esm/dev.js
CHANGED
|
@@ -1,16 +1,44 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v3.1.
|
|
2
|
+
* @nebula.js/stardust v3.1.3
|
|
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
|
-
import { Checkbox, Radio, Grid, Typography, FormControlLabel, IconButton, Popover, MenuList, MenuItem, ListItemIcon, Divider, InputAdornment, OutlinedInput, Badge, List, ListItem, Button, Box, Icon, CircularProgress
|
|
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';
|
|
12
12
|
import styled$3 from '@emotion/styled';
|
|
13
13
|
|
|
14
|
+
function getAugmentedNamespace(n) {
|
|
15
|
+
if (n.__esModule) return n;
|
|
16
|
+
var f = n.default;
|
|
17
|
+
if (typeof f == "function") {
|
|
18
|
+
var a = function a () {
|
|
19
|
+
if (this instanceof a) {
|
|
20
|
+
var args = [null];
|
|
21
|
+
args.push.apply(args, arguments);
|
|
22
|
+
var Ctor = Function.bind.apply(f, args);
|
|
23
|
+
return new Ctor();
|
|
24
|
+
}
|
|
25
|
+
return f.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
a.prototype = f.prototype;
|
|
28
|
+
} else a = {};
|
|
29
|
+
Object.defineProperty(a, '__esModule', {value: true});
|
|
30
|
+
Object.keys(n).forEach(function (k) {
|
|
31
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
32
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return n[k];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
return a;
|
|
40
|
+
}
|
|
41
|
+
|
|
14
42
|
var runtimeExports = {};
|
|
15
43
|
var runtime = {
|
|
16
44
|
get exports(){ return runtimeExports; },
|
|
@@ -1545,6 +1573,18 @@ var Visualization_UnfulfilledCalculationCondition = {
|
|
|
1545
1573
|
"zh-TW": "不符計算條件"
|
|
1546
1574
|
}
|
|
1547
1575
|
};
|
|
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
|
+
};
|
|
1548
1588
|
var all = {
|
|
1549
1589
|
Cancel: Cancel$1,
|
|
1550
1590
|
CurrentSelections_All: CurrentSelections_All,
|
|
@@ -1579,7 +1619,9 @@ var all = {
|
|
|
1579
1619
|
Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
|
|
1580
1620
|
Visualization_Invalid_Measure: Visualization_Invalid_Measure,
|
|
1581
1621
|
Visualization_LayoutError: Visualization_LayoutError,
|
|
1582
|
-
Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
|
|
1622
|
+
Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition,
|
|
1623
|
+
Listbox_ItemsOverflow: Listbox_ItemsOverflow,
|
|
1624
|
+
Listbox_Dismiss: Listbox_Dismiss
|
|
1583
1625
|
};
|
|
1584
1626
|
|
|
1585
1627
|
function appLocaleFn(language) {
|
|
@@ -3450,6 +3492,391 @@ function capitalize(string) {
|
|
|
3450
3492
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
3451
3493
|
}
|
|
3452
3494
|
|
|
3495
|
+
/**
|
|
3496
|
+
* Safe chained function.
|
|
3497
|
+
*
|
|
3498
|
+
* Will only create a new function if needed,
|
|
3499
|
+
* otherwise will pass back existing functions or null.
|
|
3500
|
+
*/
|
|
3501
|
+
function createChainedFunction(...funcs) {
|
|
3502
|
+
return funcs.reduce((acc, func) => {
|
|
3503
|
+
if (func == null) {
|
|
3504
|
+
return acc;
|
|
3505
|
+
}
|
|
3506
|
+
return function chainedFunction(...args) {
|
|
3507
|
+
acc.apply(this, args);
|
|
3508
|
+
func.apply(this, args);
|
|
3509
|
+
};
|
|
3510
|
+
}, () => {});
|
|
3511
|
+
}
|
|
3512
|
+
|
|
3513
|
+
// Corresponds to 10 frames at 60 Hz.
|
|
3514
|
+
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
|
|
3515
|
+
function debounce(func, wait = 166) {
|
|
3516
|
+
let timeout;
|
|
3517
|
+
function debounced(...args) {
|
|
3518
|
+
const later = () => {
|
|
3519
|
+
func.apply(this, args);
|
|
3520
|
+
};
|
|
3521
|
+
clearTimeout(timeout);
|
|
3522
|
+
timeout = setTimeout(later, wait);
|
|
3523
|
+
}
|
|
3524
|
+
debounced.clear = () => {
|
|
3525
|
+
clearTimeout(timeout);
|
|
3526
|
+
};
|
|
3527
|
+
return debounced;
|
|
3528
|
+
}
|
|
3529
|
+
|
|
3530
|
+
function deprecatedPropType(validator, reason) {
|
|
3531
|
+
{
|
|
3532
|
+
return () => null;
|
|
3533
|
+
}
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
function isMuiElement(element, muiNames) {
|
|
3537
|
+
return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3540
|
+
function ownerDocument(node) {
|
|
3541
|
+
return node && node.ownerDocument || document;
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3544
|
+
function ownerWindow(node) {
|
|
3545
|
+
const doc = ownerDocument(node);
|
|
3546
|
+
return doc.defaultView || window;
|
|
3547
|
+
}
|
|
3548
|
+
|
|
3549
|
+
function requirePropFactory(componentNameInError, Component) {
|
|
3550
|
+
{
|
|
3551
|
+
return () => null;
|
|
3552
|
+
}
|
|
3553
|
+
}
|
|
3554
|
+
|
|
3555
|
+
/**
|
|
3556
|
+
* TODO v5: consider making it private
|
|
3557
|
+
*
|
|
3558
|
+
* passes {value} to {ref}
|
|
3559
|
+
*
|
|
3560
|
+
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
3561
|
+
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
3562
|
+
* https://github.com/mui/material-ui/issues/13539
|
|
3563
|
+
*
|
|
3564
|
+
* Useful if you want to expose the ref of an inner component to the public API
|
|
3565
|
+
* while still using it inside the component.
|
|
3566
|
+
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
3567
|
+
*/
|
|
3568
|
+
function setRef(ref, value) {
|
|
3569
|
+
if (typeof ref === 'function') {
|
|
3570
|
+
ref(value);
|
|
3571
|
+
} else if (ref) {
|
|
3572
|
+
ref.current = value;
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3576
|
+
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
3577
|
+
var useEnhancedEffect$1 = useEnhancedEffect;
|
|
3578
|
+
|
|
3579
|
+
let globalId = 0;
|
|
3580
|
+
function useGlobalId(idOverride) {
|
|
3581
|
+
const [defaultId, setDefaultId] = React.useState(idOverride);
|
|
3582
|
+
const id = idOverride || defaultId;
|
|
3583
|
+
React.useEffect(() => {
|
|
3584
|
+
if (defaultId == null) {
|
|
3585
|
+
// Fallback to this default id when possible.
|
|
3586
|
+
// Use the incrementing value for client-side rendering only.
|
|
3587
|
+
// We can't use it server-side.
|
|
3588
|
+
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
3589
|
+
globalId += 1;
|
|
3590
|
+
setDefaultId(`mui-${globalId}`);
|
|
3591
|
+
}
|
|
3592
|
+
}, [defaultId]);
|
|
3593
|
+
return id;
|
|
3594
|
+
}
|
|
3595
|
+
|
|
3596
|
+
// eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
3597
|
+
const maybeReactUseId = React['useId' + ''];
|
|
3598
|
+
/**
|
|
3599
|
+
*
|
|
3600
|
+
* @example <div id={useId()} />
|
|
3601
|
+
* @param idOverride
|
|
3602
|
+
* @returns {string}
|
|
3603
|
+
*/
|
|
3604
|
+
function useId(idOverride) {
|
|
3605
|
+
if (maybeReactUseId !== undefined) {
|
|
3606
|
+
const reactId = maybeReactUseId();
|
|
3607
|
+
return idOverride != null ? idOverride : reactId;
|
|
3608
|
+
}
|
|
3609
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
|
|
3610
|
+
return useGlobalId(idOverride);
|
|
3611
|
+
}
|
|
3612
|
+
|
|
3613
|
+
function unsupportedProp(props, propName, componentName, location, propFullName) {
|
|
3614
|
+
{
|
|
3615
|
+
return null;
|
|
3616
|
+
}
|
|
3617
|
+
}
|
|
3618
|
+
|
|
3619
|
+
/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
|
|
3620
|
+
function useControlled({
|
|
3621
|
+
controlled,
|
|
3622
|
+
default: defaultProp,
|
|
3623
|
+
name,
|
|
3624
|
+
state = 'value'
|
|
3625
|
+
}) {
|
|
3626
|
+
// isControlled is ignored in the hook dependency lists as it should never change.
|
|
3627
|
+
const {
|
|
3628
|
+
current: isControlled
|
|
3629
|
+
} = React.useRef(controlled !== undefined);
|
|
3630
|
+
const [valueState, setValue] = React.useState(defaultProp);
|
|
3631
|
+
const value = isControlled ? controlled : valueState;
|
|
3632
|
+
const setValueIfUncontrolled = React.useCallback(newValue => {
|
|
3633
|
+
if (!isControlled) {
|
|
3634
|
+
setValue(newValue);
|
|
3635
|
+
}
|
|
3636
|
+
}, []);
|
|
3637
|
+
return [value, setValueIfUncontrolled];
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
3642
|
+
*/
|
|
3643
|
+
function useEventCallback(fn) {
|
|
3644
|
+
const ref = React.useRef(fn);
|
|
3645
|
+
useEnhancedEffect$1(() => {
|
|
3646
|
+
ref.current = fn;
|
|
3647
|
+
});
|
|
3648
|
+
return React.useCallback((...args) =>
|
|
3649
|
+
// @ts-expect-error hide `this`
|
|
3650
|
+
// tslint:disable-next-line:ban-comma-operator
|
|
3651
|
+
(0, ref.current)(...args), []);
|
|
3652
|
+
}
|
|
3653
|
+
|
|
3654
|
+
function useForkRef(...refs) {
|
|
3655
|
+
/**
|
|
3656
|
+
* This will create a new function if the refs passed to this hook change and are all defined.
|
|
3657
|
+
* This means react will call the old forkRef with `null` and the new forkRef
|
|
3658
|
+
* with the ref. Cleanup naturally emerges from this behavior.
|
|
3659
|
+
*/
|
|
3660
|
+
return React.useMemo(() => {
|
|
3661
|
+
if (refs.every(ref => ref == null)) {
|
|
3662
|
+
return null;
|
|
3663
|
+
}
|
|
3664
|
+
return instance => {
|
|
3665
|
+
refs.forEach(ref => {
|
|
3666
|
+
setRef(ref, instance);
|
|
3667
|
+
});
|
|
3668
|
+
};
|
|
3669
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3670
|
+
}, refs);
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3673
|
+
// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
|
|
3674
|
+
let hadKeyboardEvent = true;
|
|
3675
|
+
let hadFocusVisibleRecently = false;
|
|
3676
|
+
let hadFocusVisibleRecentlyTimeout;
|
|
3677
|
+
const inputTypesWhitelist = {
|
|
3678
|
+
text: true,
|
|
3679
|
+
search: true,
|
|
3680
|
+
url: true,
|
|
3681
|
+
tel: true,
|
|
3682
|
+
email: true,
|
|
3683
|
+
password: true,
|
|
3684
|
+
number: true,
|
|
3685
|
+
date: true,
|
|
3686
|
+
month: true,
|
|
3687
|
+
week: true,
|
|
3688
|
+
time: true,
|
|
3689
|
+
datetime: true,
|
|
3690
|
+
'datetime-local': true
|
|
3691
|
+
};
|
|
3692
|
+
|
|
3693
|
+
/**
|
|
3694
|
+
* Computes whether the given element should automatically trigger the
|
|
3695
|
+
* `focus-visible` class being added, i.e. whether it should always match
|
|
3696
|
+
* `:focus-visible` when focused.
|
|
3697
|
+
* @param {Element} node
|
|
3698
|
+
* @returns {boolean}
|
|
3699
|
+
*/
|
|
3700
|
+
function focusTriggersKeyboardModality(node) {
|
|
3701
|
+
const {
|
|
3702
|
+
type,
|
|
3703
|
+
tagName
|
|
3704
|
+
} = node;
|
|
3705
|
+
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
|
|
3706
|
+
return true;
|
|
3707
|
+
}
|
|
3708
|
+
if (tagName === 'TEXTAREA' && !node.readOnly) {
|
|
3709
|
+
return true;
|
|
3710
|
+
}
|
|
3711
|
+
if (node.isContentEditable) {
|
|
3712
|
+
return true;
|
|
3713
|
+
}
|
|
3714
|
+
return false;
|
|
3715
|
+
}
|
|
3716
|
+
|
|
3717
|
+
/**
|
|
3718
|
+
* Keep track of our keyboard modality state with `hadKeyboardEvent`.
|
|
3719
|
+
* If the most recent user interaction was via the keyboard;
|
|
3720
|
+
* and the key press did not include a meta, alt/option, or control key;
|
|
3721
|
+
* then the modality is keyboard. Otherwise, the modality is not keyboard.
|
|
3722
|
+
* @param {KeyboardEvent} event
|
|
3723
|
+
*/
|
|
3724
|
+
function handleKeyDown(event) {
|
|
3725
|
+
if (event.metaKey || event.altKey || event.ctrlKey) {
|
|
3726
|
+
return;
|
|
3727
|
+
}
|
|
3728
|
+
hadKeyboardEvent = true;
|
|
3729
|
+
}
|
|
3730
|
+
|
|
3731
|
+
/**
|
|
3732
|
+
* If at any point a user clicks with a pointing device, ensure that we change
|
|
3733
|
+
* the modality away from keyboard.
|
|
3734
|
+
* This avoids the situation where a user presses a key on an already focused
|
|
3735
|
+
* element, and then clicks on a different element, focusing it with a
|
|
3736
|
+
* pointing device, while we still think we're in keyboard modality.
|
|
3737
|
+
*/
|
|
3738
|
+
function handlePointerDown() {
|
|
3739
|
+
hadKeyboardEvent = false;
|
|
3740
|
+
}
|
|
3741
|
+
function handleVisibilityChange() {
|
|
3742
|
+
if (this.visibilityState === 'hidden') {
|
|
3743
|
+
// If the tab becomes active again, the browser will handle calling focus
|
|
3744
|
+
// on the element (Safari actually calls it twice).
|
|
3745
|
+
// If this tab change caused a blur on an element with focus-visible,
|
|
3746
|
+
// re-apply the class when the user switches back to the tab.
|
|
3747
|
+
if (hadFocusVisibleRecently) {
|
|
3748
|
+
hadKeyboardEvent = true;
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3751
|
+
}
|
|
3752
|
+
function prepare(doc) {
|
|
3753
|
+
doc.addEventListener('keydown', handleKeyDown, true);
|
|
3754
|
+
doc.addEventListener('mousedown', handlePointerDown, true);
|
|
3755
|
+
doc.addEventListener('pointerdown', handlePointerDown, true);
|
|
3756
|
+
doc.addEventListener('touchstart', handlePointerDown, true);
|
|
3757
|
+
doc.addEventListener('visibilitychange', handleVisibilityChange, true);
|
|
3758
|
+
}
|
|
3759
|
+
function isFocusVisible(event) {
|
|
3760
|
+
const {
|
|
3761
|
+
target
|
|
3762
|
+
} = event;
|
|
3763
|
+
try {
|
|
3764
|
+
return target.matches(':focus-visible');
|
|
3765
|
+
} catch (error) {
|
|
3766
|
+
// Browsers not implementing :focus-visible will throw a SyntaxError.
|
|
3767
|
+
// We use our own heuristic for those browsers.
|
|
3768
|
+
// Rethrow might be better if it's not the expected error but do we really
|
|
3769
|
+
// want to crash if focus-visible malfunctioned?
|
|
3770
|
+
}
|
|
3771
|
+
|
|
3772
|
+
// No need for validFocusTarget check. The user does that by attaching it to
|
|
3773
|
+
// focusable events only.
|
|
3774
|
+
return hadKeyboardEvent || focusTriggersKeyboardModality(target);
|
|
3775
|
+
}
|
|
3776
|
+
function useIsFocusVisible() {
|
|
3777
|
+
const ref = React.useCallback(node => {
|
|
3778
|
+
if (node != null) {
|
|
3779
|
+
prepare(node.ownerDocument);
|
|
3780
|
+
}
|
|
3781
|
+
}, []);
|
|
3782
|
+
const isFocusVisibleRef = React.useRef(false);
|
|
3783
|
+
|
|
3784
|
+
/**
|
|
3785
|
+
* Should be called if a blur event is fired
|
|
3786
|
+
*/
|
|
3787
|
+
function handleBlurVisible() {
|
|
3788
|
+
// checking against potential state variable does not suffice if we focus and blur synchronously.
|
|
3789
|
+
// React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
|
|
3790
|
+
// Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
|
|
3791
|
+
// This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
|
|
3792
|
+
// TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
|
|
3793
|
+
if (isFocusVisibleRef.current) {
|
|
3794
|
+
// To detect a tab/window switch, we look for a blur event followed
|
|
3795
|
+
// rapidly by a visibility change.
|
|
3796
|
+
// If we don't see a visibility change within 100ms, it's probably a
|
|
3797
|
+
// regular focus change.
|
|
3798
|
+
hadFocusVisibleRecently = true;
|
|
3799
|
+
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
|
|
3800
|
+
hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {
|
|
3801
|
+
hadFocusVisibleRecently = false;
|
|
3802
|
+
}, 100);
|
|
3803
|
+
isFocusVisibleRef.current = false;
|
|
3804
|
+
return true;
|
|
3805
|
+
}
|
|
3806
|
+
return false;
|
|
3807
|
+
}
|
|
3808
|
+
|
|
3809
|
+
/**
|
|
3810
|
+
* Should be called if a blur event is fired
|
|
3811
|
+
*/
|
|
3812
|
+
function handleFocusVisible(event) {
|
|
3813
|
+
if (isFocusVisible(event)) {
|
|
3814
|
+
isFocusVisibleRef.current = true;
|
|
3815
|
+
return true;
|
|
3816
|
+
}
|
|
3817
|
+
return false;
|
|
3818
|
+
}
|
|
3819
|
+
return {
|
|
3820
|
+
isFocusVisibleRef,
|
|
3821
|
+
onFocus: handleFocusVisible,
|
|
3822
|
+
onBlur: handleBlurVisible,
|
|
3823
|
+
ref
|
|
3824
|
+
};
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
/**
|
|
3828
|
+
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
3829
|
+
* @param {object} defaultProps
|
|
3830
|
+
* @param {object} props
|
|
3831
|
+
* @returns {object} resolved props
|
|
3832
|
+
*/
|
|
3833
|
+
function resolveProps(defaultProps, props) {
|
|
3834
|
+
const output = _extends$5({}, props);
|
|
3835
|
+
Object.keys(defaultProps).forEach(propName => {
|
|
3836
|
+
if (propName.toString().match(/^(components|slots)$/)) {
|
|
3837
|
+
output[propName] = _extends$5({}, defaultProps[propName], output[propName]);
|
|
3838
|
+
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
3839
|
+
const defaultSlotProps = defaultProps[propName] || {};
|
|
3840
|
+
const slotProps = props[propName];
|
|
3841
|
+
output[propName] = {};
|
|
3842
|
+
if (!slotProps || !Object.keys(slotProps)) {
|
|
3843
|
+
// Reduce the iteration if the slot props is empty
|
|
3844
|
+
output[propName] = defaultSlotProps;
|
|
3845
|
+
} else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
|
|
3846
|
+
// Reduce the iteration if the default slot props is empty
|
|
3847
|
+
output[propName] = slotProps;
|
|
3848
|
+
} else {
|
|
3849
|
+
output[propName] = _extends$5({}, slotProps);
|
|
3850
|
+
Object.keys(defaultSlotProps).forEach(slotPropName => {
|
|
3851
|
+
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
3852
|
+
});
|
|
3853
|
+
}
|
|
3854
|
+
} else if (output[propName] === undefined) {
|
|
3855
|
+
output[propName] = defaultProps[propName];
|
|
3856
|
+
}
|
|
3857
|
+
});
|
|
3858
|
+
return output;
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
function composeClasses(slots, getUtilityClass, classes) {
|
|
3862
|
+
const output = {};
|
|
3863
|
+
Object.keys(slots).forEach(
|
|
3864
|
+
// `Objet.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
|
3865
|
+
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
3866
|
+
slot => {
|
|
3867
|
+
output[slot] = slots[slot].reduce((acc, key) => {
|
|
3868
|
+
if (key) {
|
|
3869
|
+
acc.push(getUtilityClass(key));
|
|
3870
|
+
if (classes && classes[key]) {
|
|
3871
|
+
acc.push(classes[key]);
|
|
3872
|
+
}
|
|
3873
|
+
}
|
|
3874
|
+
return acc;
|
|
3875
|
+
}, []).join(' ');
|
|
3876
|
+
});
|
|
3877
|
+
return output;
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3453
3880
|
const defaultGenerator = componentName => componentName;
|
|
3454
3881
|
const createClassNameGenerator = () => {
|
|
3455
3882
|
let generate = defaultGenerator;
|
|
@@ -4766,10 +5193,10 @@ var createCache = function createCache(options) {
|
|
|
4766
5193
|
|
|
4767
5194
|
var createCache$1 = createCache;
|
|
4768
5195
|
|
|
4769
|
-
var jsxRuntimeExports = {};
|
|
5196
|
+
var jsxRuntimeExports$1 = {};
|
|
4770
5197
|
var jsxRuntime = {
|
|
4771
|
-
get exports(){ return jsxRuntimeExports; },
|
|
4772
|
-
set exports(v){ jsxRuntimeExports = v; },
|
|
5198
|
+
get exports(){ return jsxRuntimeExports$1; },
|
|
5199
|
+
set exports(v){ jsxRuntimeExports$1 = v; },
|
|
4773
5200
|
};
|
|
4774
5201
|
|
|
4775
5202
|
var reactJsxRuntime_production_min = {};
|
|
@@ -4783,15 +5210,32 @@ var reactJsxRuntime_production_min = {};
|
|
|
4783
5210
|
* This source code is licensed under the MIT license found in the
|
|
4784
5211
|
* LICENSE file in the root directory of this source tree.
|
|
4785
5212
|
*/
|
|
5213
|
+
|
|
5214
|
+
var hasRequiredReactJsxRuntime_production_min;
|
|
5215
|
+
|
|
5216
|
+
function requireReactJsxRuntime_production_min () {
|
|
5217
|
+
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
5218
|
+
hasRequiredReactJsxRuntime_production_min = 1;
|
|
4786
5219
|
var f=React__default,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
4787
|
-
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
5220
|
+
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
5221
|
+
return reactJsxRuntime_production_min;
|
|
5222
|
+
}
|
|
4788
5223
|
|
|
4789
|
-
|
|
5224
|
+
var hasRequiredJsxRuntime;
|
|
4790
5225
|
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
5226
|
+
function requireJsxRuntime () {
|
|
5227
|
+
if (hasRequiredJsxRuntime) return jsxRuntimeExports$1;
|
|
5228
|
+
hasRequiredJsxRuntime = 1;
|
|
5229
|
+
(function (module) {
|
|
5230
|
+
|
|
5231
|
+
{
|
|
5232
|
+
module.exports = requireReactJsxRuntime_production_min();
|
|
5233
|
+
}
|
|
4794
5234
|
} (jsxRuntime));
|
|
5235
|
+
return jsxRuntimeExports$1;
|
|
5236
|
+
}
|
|
5237
|
+
|
|
5238
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
4795
5239
|
|
|
4796
5240
|
const cache$1 = createCache$1({
|
|
4797
5241
|
key: 'css',
|
|
@@ -5759,7 +6203,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
5759
6203
|
return target;
|
|
5760
6204
|
}
|
|
5761
6205
|
|
|
5762
|
-
const _excluded$
|
|
6206
|
+
const _excluded$e = ["values", "unit", "step"];
|
|
5763
6207
|
const sortBreakpointsValues = values => {
|
|
5764
6208
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
5765
6209
|
key,
|
|
@@ -5794,7 +6238,7 @@ function createBreakpoints(breakpoints) {
|
|
|
5794
6238
|
unit = 'px',
|
|
5795
6239
|
step = 5
|
|
5796
6240
|
} = breakpoints,
|
|
5797
|
-
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$
|
|
6241
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$e);
|
|
5798
6242
|
const sortedValues = sortBreakpointsValues(values);
|
|
5799
6243
|
const keys = Object.keys(sortedValues);
|
|
5800
6244
|
function up(key) {
|
|
@@ -5868,7 +6312,7 @@ function createSpacing(spacingInput = 8) {
|
|
|
5868
6312
|
return spacing;
|
|
5869
6313
|
}
|
|
5870
6314
|
|
|
5871
|
-
const _excluded$
|
|
6315
|
+
const _excluded$d = ["breakpoints", "palette", "spacing", "shape"];
|
|
5872
6316
|
function createTheme$1(options = {}, ...args) {
|
|
5873
6317
|
const {
|
|
5874
6318
|
breakpoints: breakpointsInput = {},
|
|
@@ -5876,7 +6320,7 @@ function createTheme$1(options = {}, ...args) {
|
|
|
5876
6320
|
spacing: spacingInput,
|
|
5877
6321
|
shape: shapeInput = {}
|
|
5878
6322
|
} = options,
|
|
5879
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
6323
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$d);
|
|
5880
6324
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
5881
6325
|
const spacing = createSpacing(spacingInput);
|
|
5882
6326
|
let muiTheme = deepmerge({
|
|
@@ -5972,7 +6416,7 @@ function useTheme$2(defaultTheme = systemDefaultTheme$1) {
|
|
|
5972
6416
|
return useTheme$3(defaultTheme);
|
|
5973
6417
|
}
|
|
5974
6418
|
|
|
5975
|
-
const _excluded$
|
|
6419
|
+
const _excluded$c = ["variant"];
|
|
5976
6420
|
function isEmpty$2(string) {
|
|
5977
6421
|
return string.length === 0;
|
|
5978
6422
|
}
|
|
@@ -5986,7 +6430,7 @@ function propsToClassKey(props) {
|
|
|
5986
6430
|
const {
|
|
5987
6431
|
variant
|
|
5988
6432
|
} = props,
|
|
5989
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
6433
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$c);
|
|
5990
6434
|
let classKey = variant || '';
|
|
5991
6435
|
Object.keys(other).sort().forEach(key => {
|
|
5992
6436
|
if (key === 'color') {
|
|
@@ -5998,7 +6442,7 @@ function propsToClassKey(props) {
|
|
|
5998
6442
|
return classKey;
|
|
5999
6443
|
}
|
|
6000
6444
|
|
|
6001
|
-
const _excluded$
|
|
6445
|
+
const _excluded$b = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"],
|
|
6002
6446
|
_excluded2$2 = ["theme"],
|
|
6003
6447
|
_excluded3 = ["theme"];
|
|
6004
6448
|
function isEmpty$1(obj) {
|
|
@@ -6082,7 +6526,7 @@ function createStyled(input = {}) {
|
|
|
6082
6526
|
skipSx: inputSkipSx,
|
|
6083
6527
|
overridesResolver
|
|
6084
6528
|
} = inputOptions,
|
|
6085
|
-
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$
|
|
6529
|
+
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$b);
|
|
6086
6530
|
|
|
6087
6531
|
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
6088
6532
|
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
|
|
@@ -6175,6 +6619,32 @@ function createStyled(input = {}) {
|
|
|
6175
6619
|
};
|
|
6176
6620
|
}
|
|
6177
6621
|
|
|
6622
|
+
function getThemeProps(params) {
|
|
6623
|
+
const {
|
|
6624
|
+
theme,
|
|
6625
|
+
name,
|
|
6626
|
+
props
|
|
6627
|
+
} = params;
|
|
6628
|
+
if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
|
|
6629
|
+
return props;
|
|
6630
|
+
}
|
|
6631
|
+
return resolveProps(theme.components[name].defaultProps, props);
|
|
6632
|
+
}
|
|
6633
|
+
|
|
6634
|
+
function useThemeProps$1({
|
|
6635
|
+
props,
|
|
6636
|
+
name,
|
|
6637
|
+
defaultTheme
|
|
6638
|
+
}) {
|
|
6639
|
+
const theme = useTheme$2(defaultTheme);
|
|
6640
|
+
const mergedProps = getThemeProps({
|
|
6641
|
+
theme,
|
|
6642
|
+
name,
|
|
6643
|
+
props
|
|
6644
|
+
});
|
|
6645
|
+
return mergedProps;
|
|
6646
|
+
}
|
|
6647
|
+
|
|
6178
6648
|
/**
|
|
6179
6649
|
* Returns a number whose value is limited to the given range.
|
|
6180
6650
|
* @param {number} value The value to be clamped
|
|
@@ -6406,7 +6876,7 @@ function ThemeProvider(props) {
|
|
|
6406
6876
|
});
|
|
6407
6877
|
}
|
|
6408
6878
|
|
|
6409
|
-
const _excluded$
|
|
6879
|
+
const _excluded$a = ["defaultProps", "mixins", "overrides", "palette", "props", "styleOverrides"],
|
|
6410
6880
|
_excluded2$1 = ["type", "mode"];
|
|
6411
6881
|
function adaptV4Theme(inputTheme) {
|
|
6412
6882
|
const {
|
|
@@ -6417,7 +6887,7 @@ function adaptV4Theme(inputTheme) {
|
|
|
6417
6887
|
props = {},
|
|
6418
6888
|
styleOverrides = {}
|
|
6419
6889
|
} = inputTheme,
|
|
6420
|
-
other = _objectWithoutPropertiesLoose$1(inputTheme, _excluded$
|
|
6890
|
+
other = _objectWithoutPropertiesLoose$1(inputTheme, _excluded$a);
|
|
6421
6891
|
const theme = _extends$4({}, other, {
|
|
6422
6892
|
components: {}
|
|
6423
6893
|
});
|
|
@@ -6630,7 +7100,7 @@ const green = {
|
|
|
6630
7100
|
};
|
|
6631
7101
|
var green$1 = green;
|
|
6632
7102
|
|
|
6633
|
-
const _excluded$
|
|
7103
|
+
const _excluded$9 = ["mode", "contrastThreshold", "tonalOffset"];
|
|
6634
7104
|
const light$1 = {
|
|
6635
7105
|
// The colors used to style the text.
|
|
6636
7106
|
text: {
|
|
@@ -6799,7 +7269,7 @@ function createPalette(palette) {
|
|
|
6799
7269
|
contrastThreshold = 3,
|
|
6800
7270
|
tonalOffset = 0.2
|
|
6801
7271
|
} = palette,
|
|
6802
|
-
other = _objectWithoutPropertiesLoose$1(palette, _excluded$
|
|
7272
|
+
other = _objectWithoutPropertiesLoose$1(palette, _excluded$9);
|
|
6803
7273
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
6804
7274
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
6805
7275
|
const error = palette.error || getDefaultError(mode);
|
|
@@ -6898,7 +7368,7 @@ function createPalette(palette) {
|
|
|
6898
7368
|
return paletteOutput;
|
|
6899
7369
|
}
|
|
6900
7370
|
|
|
6901
|
-
const _excluded$
|
|
7371
|
+
const _excluded$8 = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
6902
7372
|
function round(value) {
|
|
6903
7373
|
return Math.round(value * 1e5) / 1e5;
|
|
6904
7374
|
}
|
|
@@ -6929,7 +7399,7 @@ function createTypography(palette, typography) {
|
|
|
6929
7399
|
allVariants,
|
|
6930
7400
|
pxToRem: pxToRem2
|
|
6931
7401
|
} = _ref,
|
|
6932
|
-
other = _objectWithoutPropertiesLoose$1(_ref, _excluded$
|
|
7402
|
+
other = _objectWithoutPropertiesLoose$1(_ref, _excluded$8);
|
|
6933
7403
|
const coef = fontSize / 14;
|
|
6934
7404
|
const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);
|
|
6935
7405
|
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$4({
|
|
@@ -6981,7 +7451,7 @@ function createShadow(...px) {
|
|
|
6981
7451
|
const shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
|
|
6982
7452
|
var shadows$1 = shadows;
|
|
6983
7453
|
|
|
6984
|
-
const _excluded$
|
|
7454
|
+
const _excluded$7 = ["duration", "easing", "delay"];
|
|
6985
7455
|
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
6986
7456
|
// to learn the context in which each easing should be used.
|
|
6987
7457
|
const easing = {
|
|
@@ -7032,7 +7502,7 @@ function createTransitions(inputTransitions) {
|
|
|
7032
7502
|
easing: easingOption = mergedEasing.easeInOut,
|
|
7033
7503
|
delay = 0
|
|
7034
7504
|
} = options;
|
|
7035
|
-
_objectWithoutPropertiesLoose$1(options, _excluded$
|
|
7505
|
+
_objectWithoutPropertiesLoose$1(options, _excluded$7);
|
|
7036
7506
|
return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
|
|
7037
7507
|
};
|
|
7038
7508
|
return _extends$4({
|
|
@@ -7058,7 +7528,7 @@ const zIndex = {
|
|
|
7058
7528
|
};
|
|
7059
7529
|
var zIndex$1 = zIndex;
|
|
7060
7530
|
|
|
7061
|
-
const _excluded$
|
|
7531
|
+
const _excluded$6 = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
7062
7532
|
function createTheme(options = {}, ...args) {
|
|
7063
7533
|
const {
|
|
7064
7534
|
mixins: mixinsInput = {},
|
|
@@ -7066,7 +7536,7 @@ function createTheme(options = {}, ...args) {
|
|
|
7066
7536
|
transitions: transitionsInput = {},
|
|
7067
7537
|
typography: typographyInput = {}
|
|
7068
7538
|
} = options,
|
|
7069
|
-
other = _objectWithoutPropertiesLoose$1(options, _excluded$
|
|
7539
|
+
other = _objectWithoutPropertiesLoose$1(options, _excluded$6);
|
|
7070
7540
|
if (options.vars) {
|
|
7071
7541
|
throw new Error(formatMuiErrorMessage(18));
|
|
7072
7542
|
}
|
|
@@ -7101,6 +7571,17 @@ function useTheme$1() {
|
|
|
7101
7571
|
return theme;
|
|
7102
7572
|
}
|
|
7103
7573
|
|
|
7574
|
+
function useThemeProps({
|
|
7575
|
+
props,
|
|
7576
|
+
name
|
|
7577
|
+
}) {
|
|
7578
|
+
return useThemeProps$1({
|
|
7579
|
+
props,
|
|
7580
|
+
name,
|
|
7581
|
+
defaultTheme: defaultTheme$1
|
|
7582
|
+
});
|
|
7583
|
+
}
|
|
7584
|
+
|
|
7104
7585
|
const rootShouldForwardProp = prop => shouldForwardProp(prop) && prop !== 'classes';
|
|
7105
7586
|
const styled = createStyled({
|
|
7106
7587
|
defaultTheme: defaultTheme$1,
|
|
@@ -7108,6 +7589,8 @@ const styled = createStyled({
|
|
|
7108
7589
|
});
|
|
7109
7590
|
var styled$1 = styled;
|
|
7110
7591
|
|
|
7592
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
7593
|
+
|
|
7111
7594
|
function _extends$1() {
|
|
7112
7595
|
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
7113
7596
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -7457,7 +7940,7 @@ function create$3(definition) {
|
|
|
7457
7940
|
return cache[key];
|
|
7458
7941
|
}
|
|
7459
7942
|
|
|
7460
|
-
const NEBULA_VERSION_HASH = "
|
|
7943
|
+
const NEBULA_VERSION_HASH = "b117" ;
|
|
7461
7944
|
ClassNameGenerator$1.configure(componentName => {
|
|
7462
7945
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
7463
7946
|
});
|
|
@@ -7976,7 +8459,7 @@ function boot(_ref2) {
|
|
|
7976
8459
|
const appRef = React__default.createRef();
|
|
7977
8460
|
const element = document.createElement('div');
|
|
7978
8461
|
element.style.display = 'none';
|
|
7979
|
-
element.setAttribute('data-nebulajs-version', "3.1.
|
|
8462
|
+
element.setAttribute('data-nebulajs-version', "3.1.3" );
|
|
7980
8463
|
element.setAttribute('data-app-id', app.id);
|
|
7981
8464
|
document.body.appendChild(element);
|
|
7982
8465
|
ReactDOM.render( /*#__PURE__*/React__default.createElement(NebulaApp, {
|
|
@@ -8083,7 +8566,7 @@ function getFontSize(size) {
|
|
|
8083
8566
|
}
|
|
8084
8567
|
return '16px';
|
|
8085
8568
|
}
|
|
8086
|
-
function SvgIcon(_ref) {
|
|
8569
|
+
function SvgIcon$2(_ref) {
|
|
8087
8570
|
let {
|
|
8088
8571
|
size,
|
|
8089
8572
|
style = {},
|
|
@@ -8133,7 +8616,7 @@ const remove = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
8133
8616
|
}
|
|
8134
8617
|
}]
|
|
8135
8618
|
});
|
|
8136
|
-
var Remove = (props => SvgIcon(remove(props)));
|
|
8619
|
+
var Remove = (props => SvgIcon$2(remove(props)));
|
|
8137
8620
|
|
|
8138
8621
|
const lock = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
8139
8622
|
shapes: [{
|
|
@@ -8143,7 +8626,7 @@ const lock = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
8143
8626
|
}
|
|
8144
8627
|
}]
|
|
8145
8628
|
});
|
|
8146
|
-
var Lock = (props => SvgIcon(lock(props)));
|
|
8629
|
+
var Lock = (props => SvgIcon$2(lock(props)));
|
|
8147
8630
|
|
|
8148
8631
|
const unlock = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
8149
8632
|
shapes: [{
|
|
@@ -8153,7 +8636,7 @@ const unlock = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
8153
8636
|
}
|
|
8154
8637
|
}]
|
|
8155
8638
|
});
|
|
8156
|
-
var Unlock = (props => SvgIcon(unlock(props)));
|
|
8639
|
+
var Unlock = (props => SvgIcon$2(unlock(props)));
|
|
8157
8640
|
|
|
8158
8641
|
function isRangeVisible(_ref) {
|
|
8159
8642
|
var lastRenderedStartIndex = _ref.lastRenderedStartIndex,
|
|
@@ -8698,7 +9181,7 @@ const tick = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
8698
9181
|
}
|
|
8699
9182
|
}]
|
|
8700
9183
|
});
|
|
8701
|
-
var Tick = (props => SvgIcon(tick(props)));
|
|
9184
|
+
var Tick = (props => SvgIcon$2(tick(props)));
|
|
8702
9185
|
|
|
8703
9186
|
const CheckboxChecked = "url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath" + " fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 " + "1.003 0 00-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0012 5z' fill='%23fff'/%3E%3C/svg%3E\")";
|
|
8704
9187
|
|
|
@@ -8934,7 +9417,9 @@ function getFieldKeyboardNavigation(_ref) {
|
|
|
8934
9417
|
let {
|
|
8935
9418
|
select,
|
|
8936
9419
|
confirm,
|
|
8937
|
-
cancel
|
|
9420
|
+
cancel,
|
|
9421
|
+
setScrollPosition,
|
|
9422
|
+
focusListItems
|
|
8938
9423
|
} = _ref;
|
|
8939
9424
|
const getElement = function (elm) {
|
|
8940
9425
|
let next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -8949,7 +9434,8 @@ function getFieldKeyboardNavigation(_ref) {
|
|
|
8949
9434
|
let elementToFocus;
|
|
8950
9435
|
const {
|
|
8951
9436
|
keyCode,
|
|
8952
|
-
shiftKey = false
|
|
9437
|
+
shiftKey = false,
|
|
9438
|
+
ctrlKey = false
|
|
8953
9439
|
} = event.nativeEvent;
|
|
8954
9440
|
switch (keyCode) {
|
|
8955
9441
|
case KEYS.SHIFT:
|
|
@@ -8988,6 +9474,22 @@ function getFieldKeyboardNavigation(_ref) {
|
|
|
8988
9474
|
cancel();
|
|
8989
9475
|
return;
|
|
8990
9476
|
// let it propagate to top-level
|
|
9477
|
+
case KEYS.HOME:
|
|
9478
|
+
focusListItems.setFirst(true);
|
|
9479
|
+
if (ctrlKey) {
|
|
9480
|
+
setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('overflowStart');
|
|
9481
|
+
break;
|
|
9482
|
+
}
|
|
9483
|
+
setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('start');
|
|
9484
|
+
break;
|
|
9485
|
+
case KEYS.END:
|
|
9486
|
+
focusListItems.setLast(true);
|
|
9487
|
+
if (ctrlKey) {
|
|
9488
|
+
setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('overflowEnd');
|
|
9489
|
+
break;
|
|
9490
|
+
}
|
|
9491
|
+
setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('end');
|
|
9492
|
+
break;
|
|
8991
9493
|
default:
|
|
8992
9494
|
return;
|
|
8993
9495
|
// don't stop propagation since we want to outsource keydown to other handlers.
|
|
@@ -9265,15 +9767,26 @@ function RowColumn(_ref3) {
|
|
|
9265
9767
|
showGray = true,
|
|
9266
9768
|
columnCount = 1,
|
|
9267
9769
|
rowCount = 1,
|
|
9268
|
-
layoutOrder
|
|
9770
|
+
layoutOrder,
|
|
9771
|
+
dataOffset,
|
|
9772
|
+
focusListItems,
|
|
9773
|
+
listCount
|
|
9269
9774
|
} = data;
|
|
9270
9775
|
let cellIndex;
|
|
9271
9776
|
let styles;
|
|
9777
|
+
const count = {
|
|
9778
|
+
max: null,
|
|
9779
|
+
currentIndex: null
|
|
9780
|
+
};
|
|
9272
9781
|
if (typeof rowIndex === 'number' && typeof columnIndex === 'number') {
|
|
9273
9782
|
if (layoutOrder === 'row') {
|
|
9274
9783
|
cellIndex = rowIndex * columnCount + columnIndex;
|
|
9784
|
+
count.max = rowCount;
|
|
9785
|
+
count.currentIndex = rowIndex;
|
|
9275
9786
|
} else {
|
|
9276
9787
|
cellIndex = columnIndex * rowCount + rowIndex;
|
|
9788
|
+
count.max = columnCount;
|
|
9789
|
+
count.currentIndex = columnIndex;
|
|
9277
9790
|
}
|
|
9278
9791
|
const padding = 0;
|
|
9279
9792
|
styles = _objectSpread2(_objectSpread2({}, style), {}, {
|
|
@@ -9283,9 +9796,27 @@ function RowColumn(_ref3) {
|
|
|
9283
9796
|
});
|
|
9284
9797
|
} else {
|
|
9285
9798
|
cellIndex = index;
|
|
9799
|
+
count.max = listCount;
|
|
9800
|
+
count.currentIndex = index;
|
|
9286
9801
|
styles = _objectSpread2({}, style);
|
|
9287
9802
|
}
|
|
9288
|
-
|
|
9803
|
+
cellIndex += dataOffset;
|
|
9804
|
+
const rowRef = useRef(null);
|
|
9805
|
+
useEffect$1(() => {
|
|
9806
|
+
if (rowRef.current !== null) {
|
|
9807
|
+
if (count.currentIndex === 0 && focusListItems.first) {
|
|
9808
|
+
rowRef.current.focus();
|
|
9809
|
+
focusListItems.setFirst(false);
|
|
9810
|
+
}
|
|
9811
|
+
if (count.currentIndex === count.max - 1 && focusListItems.last) {
|
|
9812
|
+
rowRef.current.focus();
|
|
9813
|
+
focusListItems.setLast(false);
|
|
9814
|
+
}
|
|
9815
|
+
}
|
|
9816
|
+
}, [rowRef.current]);
|
|
9817
|
+
const handleKeyDownCallback = useCallback(getFieldKeyboardNavigation(_objectSpread2(_objectSpread2({}, actions), {}, {
|
|
9818
|
+
focusListItems
|
|
9819
|
+
})), [actions]);
|
|
9289
9820
|
const [isSelected, setSelected] = useState$1(false);
|
|
9290
9821
|
const [cell, setCell] = useState$1();
|
|
9291
9822
|
const [classArr, setClassArr] = useState$1([]);
|
|
@@ -9460,6 +9991,7 @@ function RowColumn(_ref3) {
|
|
|
9460
9991
|
flexBasisProp: flexBasisVal,
|
|
9461
9992
|
dense: dense
|
|
9462
9993
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
9994
|
+
ref: rowRef,
|
|
9463
9995
|
container: true,
|
|
9464
9996
|
gap: 0,
|
|
9465
9997
|
className: joinClassNames(['value', ...classArr]),
|
|
@@ -11038,6 +11570,41 @@ function getStyledComponents() {
|
|
|
11038
11570
|
};
|
|
11039
11571
|
}
|
|
11040
11572
|
|
|
11573
|
+
const getIndex = (renderProps, isColumnLayout) => {
|
|
11574
|
+
if ((renderProps === null || renderProps === void 0 ? void 0 : renderProps.visibleRowStopIndex) !== undefined || renderProps.visibleColumnStopIndex !== undefined) {
|
|
11575
|
+
return isColumnLayout ? renderProps.visibleColumnStopIndex : renderProps.visibleRowStopIndex;
|
|
11576
|
+
}
|
|
11577
|
+
return renderProps.visibleStopIndex;
|
|
11578
|
+
};
|
|
11579
|
+
const getIsScrollTop = (renderProps, isColumnLayout) => {
|
|
11580
|
+
if ((renderProps === null || renderProps === void 0 ? void 0 : renderProps.visibleRowStartIndex) !== undefined || renderProps.visibleColumnStartIndex !== undefined) {
|
|
11581
|
+
return isColumnLayout ? renderProps.visibleColumnStartIndex === 0 : renderProps.visibleRowStartIndex === 0;
|
|
11582
|
+
}
|
|
11583
|
+
return renderProps.visibleStartIndex === 0;
|
|
11584
|
+
};
|
|
11585
|
+
const getIsEndOfData = (qCardinal, index, count, dataOffset) => qCardinal === index * count + dataOffset + count;
|
|
11586
|
+
function handleSetOverflowDisclaimer(_ref) {
|
|
11587
|
+
let {
|
|
11588
|
+
renderProps,
|
|
11589
|
+
layoutOptions,
|
|
11590
|
+
maxCount,
|
|
11591
|
+
columnCount,
|
|
11592
|
+
rowCount,
|
|
11593
|
+
overflowDisclaimer,
|
|
11594
|
+
qCardinal,
|
|
11595
|
+
dataOffset
|
|
11596
|
+
} = _ref;
|
|
11597
|
+
const isColumnLayout = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.layoutOrder) === 'column' && layoutOptions.dataLayout !== 'singleColumn';
|
|
11598
|
+
const index = getIndex(renderProps, isColumnLayout);
|
|
11599
|
+
const stopIndex = isColumnLayout ? maxCount.column : maxCount.row;
|
|
11600
|
+
const count = isColumnLayout ? columnCount : rowCount;
|
|
11601
|
+
const overflowPossible = count >= stopIndex;
|
|
11602
|
+
const isEndOfData = getIsEndOfData(qCardinal, index, isColumnLayout ? rowCount : columnCount, dataOffset);
|
|
11603
|
+
const isTopOfOverflowData = !!dataOffset && getIsScrollTop(renderProps, isColumnLayout);
|
|
11604
|
+
const show = overflowPossible && !isEndOfData && index >= stopIndex - 1 || isTopOfOverflowData || overflowDisclaimer.state.show; // If its shown once, the user have to dismiss to hide it.
|
|
11605
|
+
overflowDisclaimer.set(show);
|
|
11606
|
+
}
|
|
11607
|
+
|
|
11041
11608
|
const {
|
|
11042
11609
|
StyledFixedSizeList,
|
|
11043
11610
|
StyledFixedSizeGrid
|
|
@@ -11064,7 +11631,10 @@ function getListBoxComponents(_ref) {
|
|
|
11064
11631
|
direction,
|
|
11065
11632
|
listLayout,
|
|
11066
11633
|
sizes,
|
|
11067
|
-
listCount
|
|
11634
|
+
listCount,
|
|
11635
|
+
overflowDisclaimer,
|
|
11636
|
+
setScrollPosition,
|
|
11637
|
+
focusListItems
|
|
11068
11638
|
} = _ref;
|
|
11069
11639
|
const {
|
|
11070
11640
|
layoutOptions = {},
|
|
@@ -11107,12 +11677,15 @@ function getListBoxComponents(_ref) {
|
|
|
11107
11677
|
actions: {
|
|
11108
11678
|
select,
|
|
11109
11679
|
confirm: () => selections === null || selections === void 0 ? void 0 : selections.confirm.call(selections),
|
|
11110
|
-
cancel: () => selections === null || selections === void 0 ? void 0 : selections.cancel.call(selections)
|
|
11680
|
+
cancel: () => selections === null || selections === void 0 ? void 0 : selections.cancel.call(selections),
|
|
11681
|
+
setScrollPosition
|
|
11111
11682
|
},
|
|
11112
11683
|
frequencyMax,
|
|
11113
11684
|
histogram,
|
|
11114
11685
|
keyboard,
|
|
11115
|
-
showGray
|
|
11686
|
+
showGray,
|
|
11687
|
+
dataOffset: local.current.dataOffset,
|
|
11688
|
+
focusListItems
|
|
11116
11689
|
});
|
|
11117
11690
|
const List = _ref2 => {
|
|
11118
11691
|
let {
|
|
@@ -11129,12 +11702,25 @@ function getListBoxComponents(_ref) {
|
|
|
11129
11702
|
width: width,
|
|
11130
11703
|
itemCount: listCount,
|
|
11131
11704
|
layout: listLayout,
|
|
11132
|
-
itemData: _objectSpread2({}, commonItemData),
|
|
11705
|
+
itemData: _objectSpread2(_objectSpread2({}, commonItemData), {}, {
|
|
11706
|
+
listCount
|
|
11707
|
+
}),
|
|
11133
11708
|
itemSize: itemSize,
|
|
11134
11709
|
onItemsRendered: renderProps => {
|
|
11710
|
+
var _layout$qListObject, _layout$qListObject$q;
|
|
11135
11711
|
if (scrollState) {
|
|
11136
11712
|
scrollState.setScrollPos(renderProps.visibleStopIndex);
|
|
11137
11713
|
}
|
|
11714
|
+
handleSetOverflowDisclaimer({
|
|
11715
|
+
renderProps,
|
|
11716
|
+
layoutOptions,
|
|
11717
|
+
maxCount: sizes.maxCount,
|
|
11718
|
+
columnCount,
|
|
11719
|
+
rowCount,
|
|
11720
|
+
overflowDisclaimer,
|
|
11721
|
+
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,
|
|
11722
|
+
dataOffset: local.current.dataOffset
|
|
11723
|
+
});
|
|
11138
11724
|
onItemsRendered(_objectSpread2({}, renderProps));
|
|
11139
11725
|
},
|
|
11140
11726
|
ref: ref
|
|
@@ -11157,6 +11743,7 @@ function getListBoxComponents(_ref) {
|
|
|
11157
11743
|
// eslint-disable-next-line no-param-reassign
|
|
11158
11744
|
local.current.listRef = ref;
|
|
11159
11745
|
const handleGridItemsRendered = renderProps => {
|
|
11746
|
+
var _layout$qListObject2, _layout$qListObject2$;
|
|
11160
11747
|
const renderOptions = deriveRenderOptions({
|
|
11161
11748
|
renderProps,
|
|
11162
11749
|
scrollState,
|
|
@@ -11164,6 +11751,16 @@ function getListBoxComponents(_ref) {
|
|
|
11164
11751
|
rowCount,
|
|
11165
11752
|
columnCount
|
|
11166
11753
|
});
|
|
11754
|
+
handleSetOverflowDisclaimer({
|
|
11755
|
+
renderProps,
|
|
11756
|
+
layoutOptions,
|
|
11757
|
+
maxCount: sizes.maxCount,
|
|
11758
|
+
columnCount,
|
|
11759
|
+
rowCount,
|
|
11760
|
+
overflowDisclaimer,
|
|
11761
|
+
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,
|
|
11762
|
+
dataOffset: local.current.dataOffset
|
|
11763
|
+
});
|
|
11167
11764
|
onItemsRendered(renderOptions);
|
|
11168
11765
|
};
|
|
11169
11766
|
return /*#__PURE__*/React__default.createElement(StyledFixedSizeGrid
|
|
@@ -11211,7 +11808,8 @@ function getListSizes(_ref) {
|
|
|
11211
11808
|
layoutOrder,
|
|
11212
11809
|
maxVisibleRows = {},
|
|
11213
11810
|
maxVisibleColumns,
|
|
11214
|
-
dense
|
|
11811
|
+
dense,
|
|
11812
|
+
dataLayout
|
|
11215
11813
|
} = layoutOptions;
|
|
11216
11814
|
const columnAutoWidth = Math.min(150, textWidth + 18);
|
|
11217
11815
|
let overflowStyling;
|
|
@@ -11225,8 +11823,8 @@ function getListSizes(_ref) {
|
|
|
11225
11823
|
overflowStyling = {
|
|
11226
11824
|
overflowX: 'hidden'
|
|
11227
11825
|
};
|
|
11228
|
-
const maxColumns = maxVisibleColumns.maxColumns || 3;
|
|
11229
|
-
if (maxVisibleColumns.auto !== false) {
|
|
11826
|
+
const maxColumns = (maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.maxColumns) || 3;
|
|
11827
|
+
if ((maxVisibleColumns === null || maxVisibleColumns === void 0 ? void 0 : maxVisibleColumns.auto) !== false) {
|
|
11230
11828
|
columnCount = Math.min(listCount, Math.ceil((width - scrollBarWidth) / columnAutoWidth)); // TODO: smarter sizing... based on glyph count + font size etc...??
|
|
11231
11829
|
} else {
|
|
11232
11830
|
columnCount = Math.min(listCount, maxColumns);
|
|
@@ -11237,7 +11835,7 @@ function getListSizes(_ref) {
|
|
|
11237
11835
|
overflowStyling = {
|
|
11238
11836
|
overflowY: 'hidden'
|
|
11239
11837
|
};
|
|
11240
|
-
const maxRows = maxVisibleRows.maxRows || 3;
|
|
11838
|
+
const maxRows = (maxVisibleRows === null || maxVisibleRows === void 0 ? void 0 : maxVisibleRows.maxRows) || 3;
|
|
11241
11839
|
if (maxVisibleRows.auto !== false) {
|
|
11242
11840
|
rowCount = Math.floor(listHeight / itemSize);
|
|
11243
11841
|
} else {
|
|
@@ -11247,6 +11845,15 @@ function getListSizes(_ref) {
|
|
|
11247
11845
|
columnWidth = Math.max(columnAutoWidth, width / columnCount);
|
|
11248
11846
|
}
|
|
11249
11847
|
}
|
|
11848
|
+
columnCount = (dataLayout === 'singleColumn' ? 1 : columnCount) || 1;
|
|
11849
|
+
rowCount = (dataLayout === 'singleColumn' ? count : rowCount) || listCount;
|
|
11850
|
+
const maxRowCount = layoutOptions.dense ? 838000 : 577000; // Styling breaks on items above this number: https://github.com/bvaughn/react-window/issues/659
|
|
11851
|
+
rowCount = Math.min(rowCount, maxRowCount);
|
|
11852
|
+
const maxScrollWidth = 33550000; // Styling breaks on items above this width: https://github.com/bvaughn/react-window/issues/659
|
|
11853
|
+
const maxColumnCount = Math.floor(maxScrollWidth / columnWidth);
|
|
11854
|
+
columnCount = Math.min(columnCount, maxColumnCount) || 1;
|
|
11855
|
+
const maxListCount = rowCount * columnCount;
|
|
11856
|
+
const limitedListCount = Math.min(listCount, maxListCount);
|
|
11250
11857
|
return {
|
|
11251
11858
|
columnCount,
|
|
11252
11859
|
columnWidth,
|
|
@@ -11256,7 +11863,11 @@ function getListSizes(_ref) {
|
|
|
11256
11863
|
listHeight,
|
|
11257
11864
|
scrollBarWidth,
|
|
11258
11865
|
count,
|
|
11259
|
-
listCount
|
|
11866
|
+
listCount: limitedListCount,
|
|
11867
|
+
maxCount: {
|
|
11868
|
+
row: maxRowCount,
|
|
11869
|
+
column: maxColumnCount
|
|
11870
|
+
}
|
|
11260
11871
|
};
|
|
11261
11872
|
}
|
|
11262
11873
|
|
|
@@ -11319,9 +11930,10 @@ function useItemsLoader(_ref) {
|
|
|
11319
11930
|
const [pages, setPages] = useState$1([]);
|
|
11320
11931
|
let [minimumBatchSize] = useState$1(0);
|
|
11321
11932
|
const loadMoreItems = (startIndex, stopIndex) => {
|
|
11933
|
+
const offset = local.current.dataOffset;
|
|
11322
11934
|
local.current.queue.push({
|
|
11323
|
-
start: startIndex,
|
|
11324
|
-
stop: stopIndex
|
|
11935
|
+
start: startIndex + offset,
|
|
11936
|
+
stop: stopIndex + offset
|
|
11325
11937
|
});
|
|
11326
11938
|
const isScrolling = loaderRef.current ?
|
|
11327
11939
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -11423,24 +12035,338 @@ function useDataStore(model) {
|
|
|
11423
12035
|
|
|
11424
12036
|
function ListBoxDisclaimer(_ref) {
|
|
11425
12037
|
let {
|
|
11426
|
-
width
|
|
12038
|
+
width,
|
|
12039
|
+
text,
|
|
12040
|
+
dense,
|
|
12041
|
+
tooltip
|
|
11427
12042
|
} = _ref;
|
|
11428
12043
|
const {
|
|
11429
12044
|
translator
|
|
11430
12045
|
} = useContext(InstanceContext);
|
|
11431
|
-
|
|
12046
|
+
const StyledText = styled$1(Typography)(() => _objectSpread2({
|
|
12047
|
+
minWidth: "".concat(width, "px"),
|
|
12048
|
+
textAlign: 'center',
|
|
12049
|
+
fontSize: "".concat(dense ? '12px' : '14px')
|
|
12050
|
+
}, dense && {
|
|
12051
|
+
textOverflow: 'ellipsis',
|
|
12052
|
+
overflow: 'hidden',
|
|
12053
|
+
whiteSpace: 'nowrap',
|
|
12054
|
+
width
|
|
12055
|
+
}));
|
|
12056
|
+
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
12057
|
+
title: tooltip ? translator.get(text) : ''
|
|
12058
|
+
}, /*#__PURE__*/React__default.createElement(StyledText, {
|
|
11432
12059
|
component: "div",
|
|
11433
12060
|
variant: "body1",
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
12061
|
+
py: "12px"
|
|
12062
|
+
}, translator.get(text)));
|
|
12063
|
+
}
|
|
12064
|
+
|
|
12065
|
+
var Close = {};
|
|
12066
|
+
|
|
12067
|
+
var interopRequireDefaultExports = {};
|
|
12068
|
+
var interopRequireDefault = {
|
|
12069
|
+
get exports(){ return interopRequireDefaultExports; },
|
|
12070
|
+
set exports(v){ interopRequireDefaultExports = v; },
|
|
12071
|
+
};
|
|
12072
|
+
|
|
12073
|
+
(function (module) {
|
|
12074
|
+
function _interopRequireDefault(obj) {
|
|
12075
|
+
return obj && obj.__esModule ? obj : {
|
|
12076
|
+
"default": obj
|
|
12077
|
+
};
|
|
12078
|
+
}
|
|
12079
|
+
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
12080
|
+
} (interopRequireDefault));
|
|
12081
|
+
|
|
12082
|
+
var createSvgIcon$1 = {};
|
|
12083
|
+
|
|
12084
|
+
function getSvgIconUtilityClass(slot) {
|
|
12085
|
+
return generateUtilityClass('MuiSvgIcon', slot);
|
|
12086
|
+
}
|
|
12087
|
+
generateUtilityClasses('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);
|
|
12088
|
+
|
|
12089
|
+
const _excluded$5 = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
|
|
12090
|
+
const useUtilityClasses = ownerState => {
|
|
12091
|
+
const {
|
|
12092
|
+
color,
|
|
12093
|
+
fontSize,
|
|
12094
|
+
classes
|
|
12095
|
+
} = ownerState;
|
|
12096
|
+
const slots = {
|
|
12097
|
+
root: ['root', color !== 'inherit' && `color${capitalize(color)}`, `fontSize${capitalize(fontSize)}`]
|
|
12098
|
+
};
|
|
12099
|
+
return composeClasses(slots, getSvgIconUtilityClass, classes);
|
|
12100
|
+
};
|
|
12101
|
+
const SvgIconRoot = styled$1('svg', {
|
|
12102
|
+
name: 'MuiSvgIcon',
|
|
12103
|
+
slot: 'Root',
|
|
12104
|
+
overridesResolver: (props, styles) => {
|
|
12105
|
+
const {
|
|
12106
|
+
ownerState
|
|
12107
|
+
} = props;
|
|
12108
|
+
return [styles.root, ownerState.color !== 'inherit' && styles[`color${capitalize(ownerState.color)}`], styles[`fontSize${capitalize(ownerState.fontSize)}`]];
|
|
12109
|
+
}
|
|
12110
|
+
})(({
|
|
12111
|
+
theme,
|
|
12112
|
+
ownerState
|
|
12113
|
+
}) => {
|
|
12114
|
+
var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$transitions2$d, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette$ownerState$c2, _palette2, _palette2$action, _palette3, _palette3$action;
|
|
12115
|
+
return {
|
|
12116
|
+
userSelect: 'none',
|
|
12117
|
+
width: '1em',
|
|
12118
|
+
height: '1em',
|
|
12119
|
+
display: 'inline-block',
|
|
12120
|
+
fill: 'currentColor',
|
|
12121
|
+
flexShrink: 0,
|
|
12122
|
+
transition: (_theme$transitions = theme.transitions) == null ? void 0 : (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
|
|
12123
|
+
duration: (_theme$transitions2 = theme.transitions) == null ? void 0 : (_theme$transitions2$d = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2$d.shorter
|
|
12124
|
+
}),
|
|
12125
|
+
fontSize: {
|
|
12126
|
+
inherit: 'inherit',
|
|
12127
|
+
small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',
|
|
12128
|
+
medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',
|
|
12129
|
+
large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'
|
|
12130
|
+
}[ownerState.fontSize],
|
|
12131
|
+
// TODO v5 deprecate, v6 remove for sx
|
|
12132
|
+
color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null ? void 0 : (_palette$ownerState$c2 = _palette[ownerState.color]) == null ? void 0 : _palette$ownerState$c2.main) != null ? _palette$ownerState$c : {
|
|
12133
|
+
action: (_palette2 = (theme.vars || theme).palette) == null ? void 0 : (_palette2$action = _palette2.action) == null ? void 0 : _palette2$action.active,
|
|
12134
|
+
disabled: (_palette3 = (theme.vars || theme).palette) == null ? void 0 : (_palette3$action = _palette3.action) == null ? void 0 : _palette3$action.disabled,
|
|
12135
|
+
inherit: undefined
|
|
12136
|
+
}[ownerState.color]
|
|
12137
|
+
};
|
|
12138
|
+
});
|
|
12139
|
+
const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
12140
|
+
const props = useThemeProps({
|
|
12141
|
+
props: inProps,
|
|
12142
|
+
name: 'MuiSvgIcon'
|
|
12143
|
+
});
|
|
12144
|
+
const {
|
|
12145
|
+
children,
|
|
12146
|
+
className,
|
|
12147
|
+
color = 'inherit',
|
|
12148
|
+
component = 'svg',
|
|
12149
|
+
fontSize = 'medium',
|
|
12150
|
+
htmlColor,
|
|
12151
|
+
inheritViewBox = false,
|
|
12152
|
+
titleAccess,
|
|
12153
|
+
viewBox = '0 0 24 24'
|
|
12154
|
+
} = props,
|
|
12155
|
+
other = _objectWithoutPropertiesLoose$1(props, _excluded$5);
|
|
12156
|
+
const ownerState = _extends$4({}, props, {
|
|
12157
|
+
color,
|
|
12158
|
+
component,
|
|
12159
|
+
fontSize,
|
|
12160
|
+
instanceFontSize: inProps.fontSize,
|
|
12161
|
+
inheritViewBox,
|
|
12162
|
+
viewBox
|
|
12163
|
+
});
|
|
12164
|
+
const more = {};
|
|
12165
|
+
if (!inheritViewBox) {
|
|
12166
|
+
more.viewBox = viewBox;
|
|
12167
|
+
}
|
|
12168
|
+
const classes = useUtilityClasses(ownerState);
|
|
12169
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, _extends$4({
|
|
12170
|
+
as: component,
|
|
12171
|
+
className: clsx(classes.root, className),
|
|
12172
|
+
focusable: "false",
|
|
12173
|
+
color: htmlColor,
|
|
12174
|
+
"aria-hidden": titleAccess ? undefined : true,
|
|
12175
|
+
role: titleAccess ? 'img' : undefined,
|
|
12176
|
+
ref: ref
|
|
12177
|
+
}, more, other, {
|
|
12178
|
+
ownerState: ownerState,
|
|
12179
|
+
children: [children, titleAccess ? /*#__PURE__*/jsxRuntimeExports.jsx("title", {
|
|
12180
|
+
children: titleAccess
|
|
12181
|
+
}) : null]
|
|
12182
|
+
}));
|
|
12183
|
+
});
|
|
12184
|
+
SvgIcon.muiName = 'SvgIcon';
|
|
12185
|
+
var SvgIcon$1 = SvgIcon;
|
|
12186
|
+
|
|
12187
|
+
function createSvgIcon(path, displayName) {
|
|
12188
|
+
function Component(props, ref) {
|
|
12189
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon$1, _extends$4({
|
|
12190
|
+
"data-testid": `${displayName}Icon`,
|
|
12191
|
+
ref: ref
|
|
12192
|
+
}, props, {
|
|
12193
|
+
children: path
|
|
12194
|
+
}));
|
|
12195
|
+
}
|
|
12196
|
+
Component.muiName = SvgIcon$1.muiName;
|
|
12197
|
+
return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));
|
|
12198
|
+
}
|
|
12199
|
+
|
|
12200
|
+
// TODO: remove this export once ClassNameGenerator is stable
|
|
12201
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12202
|
+
const unstable_ClassNameGenerator = {
|
|
12203
|
+
configure: generator => {
|
|
12204
|
+
ClassNameGenerator$1.configure(generator);
|
|
12205
|
+
}
|
|
12206
|
+
};
|
|
12207
|
+
|
|
12208
|
+
var utils$1 = /*#__PURE__*/Object.freeze({
|
|
12209
|
+
__proto__: null,
|
|
12210
|
+
capitalize: capitalize,
|
|
12211
|
+
createChainedFunction: createChainedFunction,
|
|
12212
|
+
createSvgIcon: createSvgIcon,
|
|
12213
|
+
debounce: debounce,
|
|
12214
|
+
deprecatedPropType: deprecatedPropType,
|
|
12215
|
+
isMuiElement: isMuiElement,
|
|
12216
|
+
ownerDocument: ownerDocument,
|
|
12217
|
+
ownerWindow: ownerWindow,
|
|
12218
|
+
requirePropFactory: requirePropFactory,
|
|
12219
|
+
setRef: setRef,
|
|
12220
|
+
unstable_ClassNameGenerator: unstable_ClassNameGenerator,
|
|
12221
|
+
unstable_useEnhancedEffect: useEnhancedEffect$1,
|
|
12222
|
+
unstable_useId: useId,
|
|
12223
|
+
unsupportedProp: unsupportedProp,
|
|
12224
|
+
useControlled: useControlled,
|
|
12225
|
+
useEventCallback: useEventCallback,
|
|
12226
|
+
useForkRef: useForkRef,
|
|
12227
|
+
useIsFocusVisible: useIsFocusVisible
|
|
12228
|
+
});
|
|
12229
|
+
|
|
12230
|
+
var require$$0 = /*@__PURE__*/getAugmentedNamespace(utils$1);
|
|
12231
|
+
|
|
12232
|
+
var hasRequiredCreateSvgIcon;
|
|
12233
|
+
|
|
12234
|
+
function requireCreateSvgIcon () {
|
|
12235
|
+
if (hasRequiredCreateSvgIcon) return createSvgIcon$1;
|
|
12236
|
+
hasRequiredCreateSvgIcon = 1;
|
|
12237
|
+
(function (exports) {
|
|
12238
|
+
|
|
12239
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12240
|
+
value: true
|
|
12241
|
+
});
|
|
12242
|
+
Object.defineProperty(exports, "default", {
|
|
12243
|
+
enumerable: true,
|
|
12244
|
+
get: function () {
|
|
12245
|
+
return _utils.createSvgIcon;
|
|
12246
|
+
}
|
|
12247
|
+
});
|
|
12248
|
+
var _utils = require$$0;
|
|
12249
|
+
} (createSvgIcon$1));
|
|
12250
|
+
return createSvgIcon$1;
|
|
12251
|
+
}
|
|
12252
|
+
|
|
12253
|
+
var _interopRequireDefault = interopRequireDefaultExports;
|
|
12254
|
+
Object.defineProperty(Close, "__esModule", {
|
|
12255
|
+
value: true
|
|
12256
|
+
});
|
|
12257
|
+
var default_1 = Close.default = void 0;
|
|
12258
|
+
var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
|
|
12259
|
+
var _jsxRuntime = requireJsxRuntime();
|
|
12260
|
+
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
12261
|
+
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
12262
|
+
}), 'Close');
|
|
12263
|
+
default_1 = Close.default = _default;
|
|
12264
|
+
|
|
12265
|
+
const RootContainer = styled$1(Paper)(_ref => {
|
|
12266
|
+
let {
|
|
12267
|
+
theme,
|
|
12268
|
+
left
|
|
12269
|
+
} = _ref;
|
|
12270
|
+
return {
|
|
12271
|
+
position: 'absolute',
|
|
12272
|
+
bottom: '12px',
|
|
12273
|
+
display: 'flex',
|
|
12274
|
+
border: "1px solid ".concat(theme.palette.divider),
|
|
12275
|
+
width: 'calc(100% - 11px)',
|
|
12276
|
+
left
|
|
12277
|
+
};
|
|
12278
|
+
});
|
|
12279
|
+
const LeftItem = styled$1('div')(() => ({
|
|
12280
|
+
paddingLeft: '6px',
|
|
12281
|
+
flexGrow: 1
|
|
12282
|
+
}));
|
|
12283
|
+
const RightItem = styled$1('div')(_ref2 => {
|
|
12284
|
+
let {
|
|
12285
|
+
dense
|
|
12286
|
+
} = _ref2;
|
|
12287
|
+
return {
|
|
12288
|
+
display: 'flex',
|
|
12289
|
+
alignItems: "".concat(dense ? 'center' : 'flex-start')
|
|
12290
|
+
};
|
|
12291
|
+
});
|
|
12292
|
+
const SmallCloseIcon = styled$1(default_1)(() => ({
|
|
12293
|
+
fontSize: '14px'
|
|
12294
|
+
}));
|
|
12295
|
+
function ListBoxFooter(_ref3) {
|
|
12296
|
+
let {
|
|
12297
|
+
text,
|
|
12298
|
+
dismiss,
|
|
12299
|
+
dense,
|
|
12300
|
+
parentWidth = 0
|
|
12301
|
+
} = _ref3;
|
|
12302
|
+
const hasDismissButton = typeof dismiss === 'function';
|
|
12303
|
+
const maxWidth = dense ? 370 : 282;
|
|
12304
|
+
const left = Math.max(parentWidth / 2 - maxWidth / 2, 0);
|
|
12305
|
+
const textWidth = Math.min(maxWidth, parentWidth) - 42;
|
|
12306
|
+
const enableTooltip = dense && parentWidth < maxWidth;
|
|
12307
|
+
return /*#__PURE__*/React__default.createElement(RootContainer, {
|
|
12308
|
+
left: left,
|
|
12309
|
+
style: {
|
|
12310
|
+
maxWidth
|
|
12311
|
+
}
|
|
12312
|
+
}, /*#__PURE__*/React__default.createElement(LeftItem, null, /*#__PURE__*/React__default.createElement(ListBoxDisclaimer, {
|
|
12313
|
+
text: text,
|
|
12314
|
+
dense: dense,
|
|
12315
|
+
width: textWidth,
|
|
12316
|
+
tooltip: enableTooltip
|
|
12317
|
+
})), /*#__PURE__*/React__default.createElement(RightItem, {
|
|
12318
|
+
dense: dense
|
|
12319
|
+
}, hasDismissButton && /*#__PURE__*/React__default.createElement(IconButton, {
|
|
12320
|
+
"aria-label": "close",
|
|
12321
|
+
onClick: () => dismiss()
|
|
12322
|
+
}, /*#__PURE__*/React__default.createElement(SmallCloseIcon, null))));
|
|
12323
|
+
}
|
|
12324
|
+
|
|
12325
|
+
const getOffset = (layout, listCount) => {
|
|
12326
|
+
const totalLength = layout.qListObject.qDimensionInfo.qCardinal;
|
|
12327
|
+
const offset = totalLength - listCount;
|
|
12328
|
+
return offset;
|
|
12329
|
+
};
|
|
12330
|
+
function getScrollIndex(_ref) {
|
|
12331
|
+
let {
|
|
12332
|
+
position,
|
|
12333
|
+
isRow,
|
|
12334
|
+
sizes,
|
|
12335
|
+
layout,
|
|
12336
|
+
offset
|
|
12337
|
+
} = _ref;
|
|
12338
|
+
let scrollIndex;
|
|
12339
|
+
let triggerRerender = false;
|
|
12340
|
+
let newOffset = offset !== null && offset !== void 0 ? offset : 0;
|
|
12341
|
+
switch (position) {
|
|
12342
|
+
case 'start':
|
|
12343
|
+
scrollIndex = 0;
|
|
12344
|
+
break;
|
|
12345
|
+
case 'end':
|
|
12346
|
+
scrollIndex = isRow ? sizes.rowCount : sizes.columnCount;
|
|
12347
|
+
break;
|
|
12348
|
+
case 'overflowStart':
|
|
12349
|
+
newOffset = 0;
|
|
12350
|
+
scrollIndex = 0;
|
|
12351
|
+
triggerRerender = true;
|
|
12352
|
+
break;
|
|
12353
|
+
case 'overflowEnd':
|
|
12354
|
+
newOffset = getOffset(layout, sizes.listCount);
|
|
12355
|
+
scrollIndex = layout.qListObject.qDimensionInfo.qCardinal;
|
|
12356
|
+
triggerRerender = true;
|
|
12357
|
+
break;
|
|
12358
|
+
}
|
|
12359
|
+
return {
|
|
12360
|
+
scrollIndex,
|
|
12361
|
+
offset: newOffset,
|
|
12362
|
+
triggerRerender
|
|
12363
|
+
};
|
|
11438
12364
|
}
|
|
11439
12365
|
|
|
11440
12366
|
const _excluded$4 = ["isLoadingData"];
|
|
11441
12367
|
const DEFAULT_MIN_BATCH_SIZE = 100;
|
|
11442
12368
|
function ListBox(_ref) {
|
|
11443
|
-
var _layout$qListObject$q;
|
|
12369
|
+
var _layout$qListObject$q, _loaderRef$current, _loaderRef$current$_l, _loaderRef$current$_l2;
|
|
11444
12370
|
let {
|
|
11445
12371
|
model,
|
|
11446
12372
|
selections,
|
|
@@ -11469,7 +12395,8 @@ function ListBox(_ref) {
|
|
|
11469
12395
|
const loaderRef = useRef(null);
|
|
11470
12396
|
const local = useRef({
|
|
11471
12397
|
queue: [],
|
|
11472
|
-
validPages: false
|
|
12398
|
+
validPages: false,
|
|
12399
|
+
dataOffset: 0
|
|
11473
12400
|
});
|
|
11474
12401
|
const listData = useRef({
|
|
11475
12402
|
pages: []
|
|
@@ -11495,6 +12422,13 @@ function ListBox(_ref) {
|
|
|
11495
12422
|
setStoreValue
|
|
11496
12423
|
} = useDataStore(model);
|
|
11497
12424
|
const loadMoreItems = useCallback(itemsLoader.loadMoreItems, [layout]);
|
|
12425
|
+
const [overflowDisclaimer, setOverflowDisclaimer] = useState$1({
|
|
12426
|
+
show: false,
|
|
12427
|
+
dismissed: false
|
|
12428
|
+
});
|
|
12429
|
+
const showOverflowDisclaimer = show => setOverflowDisclaimer(state => _objectSpread2(_objectSpread2({}, state), {}, {
|
|
12430
|
+
show
|
|
12431
|
+
}));
|
|
11498
12432
|
useEffect$1(() => {
|
|
11499
12433
|
setPages((itemsLoader === null || itemsLoader === void 0 ? void 0 : itemsLoader.pages) || []);
|
|
11500
12434
|
}, [itemsLoader === null || itemsLoader === void 0 ? void 0 : itemsLoader.pages]);
|
|
@@ -11520,6 +12454,23 @@ function ListBox(_ref) {
|
|
|
11520
12454
|
doc: document,
|
|
11521
12455
|
isSingleSelect
|
|
11522
12456
|
});
|
|
12457
|
+
const {
|
|
12458
|
+
layoutOptions = {}
|
|
12459
|
+
} = layout || {};
|
|
12460
|
+
let isRow = true;
|
|
12461
|
+
if (layoutOptions.dataLayout) {
|
|
12462
|
+
isRow = layoutOptions.dataLayout === 'singleColumn' ? true : (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.layoutOrder) === 'row';
|
|
12463
|
+
}
|
|
12464
|
+
const isGrid = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.dataLayout) === 'grid';
|
|
12465
|
+
const scrollToIndex = index => {
|
|
12466
|
+
const gridIndex = _objectSpread2({}, isRow ? {
|
|
12467
|
+
rowIndex: index
|
|
12468
|
+
} : {
|
|
12469
|
+
columnIndex: index
|
|
12470
|
+
});
|
|
12471
|
+
const scrollIndex = isGrid ? gridIndex : index;
|
|
12472
|
+
loaderRef.current._listRef.scrollToItem(scrollIndex);
|
|
12473
|
+
};
|
|
11523
12474
|
const fetchData = () => {
|
|
11524
12475
|
local.current.queue = [];
|
|
11525
12476
|
local.current.validPages = false;
|
|
@@ -11529,7 +12480,8 @@ function ListBox(_ref) {
|
|
|
11529
12480
|
if (layout && layout.qSelectionInfo.qInSelections) {
|
|
11530
12481
|
return;
|
|
11531
12482
|
}
|
|
11532
|
-
|
|
12483
|
+
local.current.dataOffset = 0;
|
|
12484
|
+
scrollToIndex(0);
|
|
11533
12485
|
}
|
|
11534
12486
|
};
|
|
11535
12487
|
if (update) {
|
|
@@ -11550,35 +12502,69 @@ function ListBox(_ref) {
|
|
|
11550
12502
|
}, [loaderRef.current]);
|
|
11551
12503
|
useEffect$1(() => {
|
|
11552
12504
|
fetchData();
|
|
11553
|
-
}, [layout]);
|
|
12505
|
+
}, [layout, local.current.dataOffset]);
|
|
11554
12506
|
const textWidth = useTextWidth({
|
|
11555
12507
|
text: getMeasureText(layout),
|
|
11556
12508
|
font: '14px Source sans pro'
|
|
11557
12509
|
});
|
|
11558
|
-
const {
|
|
11559
|
-
layoutOptions = {}
|
|
11560
|
-
} = layout || {};
|
|
11561
12510
|
let minimumBatchSize = DEFAULT_MIN_BATCH_SIZE;
|
|
11562
12511
|
const isVertical = layoutOptions.dataLayout ? layoutOptions.dataLayout === 'singleColumn' : listLayout !== 'horizontal';
|
|
11563
12512
|
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;
|
|
11564
|
-
const
|
|
12513
|
+
const unlimitedListCount = getListCount({
|
|
11565
12514
|
pages,
|
|
11566
12515
|
minimumBatchSize,
|
|
11567
12516
|
count,
|
|
11568
|
-
calculatePagesHeight
|
|
12517
|
+
calculatePagesHeight,
|
|
12518
|
+
layoutOptions,
|
|
12519
|
+
model
|
|
11569
12520
|
});
|
|
11570
|
-
setStoreValue('listCount', listCount);
|
|
11571
12521
|
const sizes = getListSizes({
|
|
11572
12522
|
layout,
|
|
11573
12523
|
width,
|
|
11574
12524
|
height,
|
|
11575
|
-
listCount,
|
|
12525
|
+
listCount: unlimitedListCount,
|
|
11576
12526
|
count,
|
|
11577
12527
|
textWidth
|
|
11578
12528
|
});
|
|
12529
|
+
const {
|
|
12530
|
+
listCount
|
|
12531
|
+
} = sizes;
|
|
12532
|
+
setStoreValue('listCount', listCount);
|
|
12533
|
+
const setScrollPosition = position => {
|
|
12534
|
+
const {
|
|
12535
|
+
scrollIndex,
|
|
12536
|
+
offset,
|
|
12537
|
+
triggerRerender
|
|
12538
|
+
} = getScrollIndex({
|
|
12539
|
+
position,
|
|
12540
|
+
isRow,
|
|
12541
|
+
sizes,
|
|
12542
|
+
layout,
|
|
12543
|
+
offset: local.current.dataOffset
|
|
12544
|
+
});
|
|
12545
|
+
local.current.dataOffset = offset;
|
|
12546
|
+
if (triggerRerender) {
|
|
12547
|
+
setPages(currentPages => [...currentPages]);
|
|
12548
|
+
}
|
|
12549
|
+
scrollToIndex(scrollIndex);
|
|
12550
|
+
};
|
|
11579
12551
|
const {
|
|
11580
12552
|
textAlign
|
|
11581
12553
|
} = (layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo) || {};
|
|
12554
|
+
const [focusListItem, setFocusListItem] = useState$1({
|
|
12555
|
+
first: false,
|
|
12556
|
+
last: false
|
|
12557
|
+
});
|
|
12558
|
+
const getFocusState = () => ({
|
|
12559
|
+
first: focusListItem.first,
|
|
12560
|
+
setFirst: first => setFocusListItem(prevState => _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
12561
|
+
first
|
|
12562
|
+
})),
|
|
12563
|
+
last: focusListItem.last,
|
|
12564
|
+
setLast: last => setFocusListItem(prevState => _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
12565
|
+
last
|
|
12566
|
+
}))
|
|
12567
|
+
});
|
|
11582
12568
|
const {
|
|
11583
12569
|
List,
|
|
11584
12570
|
Grid
|
|
@@ -11603,7 +12589,13 @@ function ListBox(_ref) {
|
|
|
11603
12589
|
scrollState,
|
|
11604
12590
|
local,
|
|
11605
12591
|
sizes,
|
|
11606
|
-
listCount
|
|
12592
|
+
listCount,
|
|
12593
|
+
overflowDisclaimer: {
|
|
12594
|
+
state: overflowDisclaimer,
|
|
12595
|
+
set: showOverflowDisclaimer
|
|
12596
|
+
},
|
|
12597
|
+
setScrollPosition,
|
|
12598
|
+
focusListItems: getFocusState()
|
|
11607
12599
|
});
|
|
11608
12600
|
const {
|
|
11609
12601
|
columnWidth,
|
|
@@ -11619,7 +12611,8 @@ function ListBox(_ref) {
|
|
|
11619
12611
|
});
|
|
11620
12612
|
}
|
|
11621
12613
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !listCount && /*#__PURE__*/React__default.createElement(ListBoxDisclaimer, {
|
|
11622
|
-
width: width
|
|
12614
|
+
width: width,
|
|
12615
|
+
text: "Listbox.NoMatchesForYourTerms"
|
|
11623
12616
|
}), /*#__PURE__*/React__default.createElement(InfiniteLoader, {
|
|
11624
12617
|
isItemLoaded: isItemLoaded,
|
|
11625
12618
|
itemCount: listCount || 1 // must be more than 0 or loadMoreItems will never be called again
|
|
@@ -11630,7 +12623,14 @@ function ListBox(_ref) {
|
|
|
11630
12623
|
threshold: 0,
|
|
11631
12624
|
minimumBatchSize: minimumBatchSize,
|
|
11632
12625
|
ref: loaderRef
|
|
11633
|
-
}, isVertical ? List : Grid)
|
|
12626
|
+
}, isVertical ? List : Grid), overflowDisclaimer.show && !overflowDisclaimer.dismissed && /*#__PURE__*/React__default.createElement(ListBoxFooter, {
|
|
12627
|
+
text: "Listbox.ItemsOverflow",
|
|
12628
|
+
dismiss: () => setOverflowDisclaimer(state => _objectSpread2(_objectSpread2({}, state), {}, {
|
|
12629
|
+
dismissed: true
|
|
12630
|
+
})),
|
|
12631
|
+
parentWidth: loaderRef === null || loaderRef === void 0 ? void 0 : (_loaderRef$current = loaderRef.current) === null || _loaderRef$current === void 0 ? void 0 : (_loaderRef$current$_l = _loaderRef$current._listRef) === null || _loaderRef$current$_l === void 0 ? void 0 : (_loaderRef$current$_l2 = _loaderRef$current$_l.props) === null || _loaderRef$current$_l2 === void 0 ? void 0 : _loaderRef$current$_l2.width,
|
|
12632
|
+
dense: layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.dense
|
|
12633
|
+
}));
|
|
11634
12634
|
}
|
|
11635
12635
|
|
|
11636
12636
|
const selectAll = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -11780,7 +12780,7 @@ const Item = React__default.forwardRef((_ref, ref) => {
|
|
|
11780
12780
|
size: "large",
|
|
11781
12781
|
"aria-expanded": ariaExpanded,
|
|
11782
12782
|
"aria-controls": "moreMenuList"
|
|
11783
|
-
}, hasSvgIconShape && SvgIcon(item.getSvgIconShape()), addAnchor && /*#__PURE__*/React__default.createElement("div", {
|
|
12783
|
+
}, hasSvgIconShape && SvgIcon$2(item.getSvgIconShape()), addAnchor && /*#__PURE__*/React__default.createElement("div", {
|
|
11784
12784
|
ref: ref,
|
|
11785
12785
|
style: {
|
|
11786
12786
|
bottom: -spacing,
|
|
@@ -11809,7 +12809,7 @@ const clearSelections = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
11809
12809
|
}
|
|
11810
12810
|
}]
|
|
11811
12811
|
});
|
|
11812
|
-
var ClearSelections = (props => SvgIcon(clearSelections(props)));
|
|
12812
|
+
var ClearSelections = (props => SvgIcon$2(clearSelections(props)));
|
|
11813
12813
|
|
|
11814
12814
|
function useDefaultSelectionActions(_ref) {
|
|
11815
12815
|
let {
|
|
@@ -11896,7 +12896,7 @@ function MoreItem(_ref2) {
|
|
|
11896
12896
|
tabindex: "0"
|
|
11897
12897
|
}, hasSvgIconShape && /*#__PURE__*/React__default.createElement(ListItemIcon, {
|
|
11898
12898
|
className: classes$8.icon
|
|
11899
|
-
}, SvgIcon(item.getSvgIconShape())), /*#__PURE__*/React__default.createElement(Typography, {
|
|
12899
|
+
}, SvgIcon$2(item.getSvgIconShape())), /*#__PURE__*/React__default.createElement(Typography, {
|
|
11900
12900
|
noWrap: true
|
|
11901
12901
|
}, item.label)) : null;
|
|
11902
12902
|
}
|
|
@@ -12190,9 +13190,10 @@ const search = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
12190
13190
|
}
|
|
12191
13191
|
}]
|
|
12192
13192
|
});
|
|
12193
|
-
var SearchIcon = (props => SvgIcon(search(props)));
|
|
13193
|
+
var SearchIcon = (props => SvgIcon$2(search(props)));
|
|
12194
13194
|
|
|
12195
13195
|
const TREE_PATH = '/qListObjectDef';
|
|
13196
|
+
const WILDCARD = '**';
|
|
12196
13197
|
const StyledInputAdornment = styled$1(InputAdornment)(_ref => {
|
|
12197
13198
|
var _theme$listBox, _theme$listBox$conten;
|
|
12198
13199
|
let {
|
|
@@ -12217,12 +13218,15 @@ function ListBoxSearch(_ref3) {
|
|
|
12217
13218
|
model,
|
|
12218
13219
|
keyboard,
|
|
12219
13220
|
dense = false,
|
|
12220
|
-
visible = true
|
|
13221
|
+
visible = true,
|
|
13222
|
+
wildCardSearch = true
|
|
12221
13223
|
} = _ref3;
|
|
12222
13224
|
const {
|
|
12223
13225
|
translator
|
|
12224
13226
|
} = useContext(InstanceContext);
|
|
12225
13227
|
const [value, setValue] = useState$1('');
|
|
13228
|
+
const [wildcardOn, setWildcardOn] = useState$1(false);
|
|
13229
|
+
const inputRef = useRef();
|
|
12226
13230
|
const theme = useTheme$1();
|
|
12227
13231
|
const {
|
|
12228
13232
|
getStoreValue
|
|
@@ -12249,6 +13253,13 @@ function ListBoxSearch(_ref3) {
|
|
|
12249
13253
|
selections.removeListener && selections.removeListener('deactivated', abortSearch);
|
|
12250
13254
|
};
|
|
12251
13255
|
}, []);
|
|
13256
|
+
useEffect$1(() => {
|
|
13257
|
+
if (wildcardOn && inputRef.current) {
|
|
13258
|
+
const cursorPos = value.length - 1;
|
|
13259
|
+
inputRef.current.setSelectionRange(cursorPos, cursorPos); // place the cursor in the wildcard
|
|
13260
|
+
setWildcardOn(false);
|
|
13261
|
+
}
|
|
13262
|
+
}, [wildcardOn, inputRef.current]);
|
|
12252
13263
|
const onChange = async e => {
|
|
12253
13264
|
setValue(e.target.value);
|
|
12254
13265
|
if (!e.target.value.length) {
|
|
@@ -12257,6 +13268,10 @@ function ListBoxSearch(_ref3) {
|
|
|
12257
13268
|
return model.searchListObjectFor(TREE_PATH, e.target.value);
|
|
12258
13269
|
};
|
|
12259
13270
|
const handleFocus = () => {
|
|
13271
|
+
if (wildCardSearch) {
|
|
13272
|
+
setValue(WILDCARD);
|
|
13273
|
+
setWildcardOn(true);
|
|
13274
|
+
}
|
|
12260
13275
|
if (!selections.isModal()) {
|
|
12261
13276
|
selections.begin(['/qListObjectDef']);
|
|
12262
13277
|
}
|
|
@@ -12320,6 +13335,7 @@ function ListBoxSearch(_ref3) {
|
|
|
12320
13335
|
paddingBottom: '5px'
|
|
12321
13336
|
}
|
|
12322
13337
|
}],
|
|
13338
|
+
inputRef: inputRef,
|
|
12323
13339
|
size: "small",
|
|
12324
13340
|
fullWidth: true,
|
|
12325
13341
|
placeholder: translator.get('Listbox.Search'),
|
|
@@ -12591,6 +13607,14 @@ function hasSelections(layout) {
|
|
|
12591
13607
|
function ListBoxPopover(_ref) {
|
|
12592
13608
|
let {
|
|
12593
13609
|
alignTo,
|
|
13610
|
+
anchorOrigin = {
|
|
13611
|
+
vertical: 'bottom',
|
|
13612
|
+
horizontal: 'center'
|
|
13613
|
+
},
|
|
13614
|
+
transformOrigin = {
|
|
13615
|
+
vertical: 'top',
|
|
13616
|
+
horizontal: 'center'
|
|
13617
|
+
},
|
|
12594
13618
|
show,
|
|
12595
13619
|
close,
|
|
12596
13620
|
app,
|
|
@@ -12663,14 +13687,8 @@ function ListBoxPopover(_ref) {
|
|
|
12663
13687
|
open: open,
|
|
12664
13688
|
onClose: popoverClose,
|
|
12665
13689
|
anchorEl: alignTo.current,
|
|
12666
|
-
anchorOrigin:
|
|
12667
|
-
|
|
12668
|
-
horizontal: 'center'
|
|
12669
|
-
},
|
|
12670
|
-
transformOrigin: {
|
|
12671
|
-
vertical: 'top',
|
|
12672
|
-
horizontal: 'center'
|
|
12673
|
-
},
|
|
13690
|
+
anchorOrigin: anchorOrigin,
|
|
13691
|
+
transformOrigin: transformOrigin,
|
|
12674
13692
|
PaperProps: {
|
|
12675
13693
|
style: {
|
|
12676
13694
|
minWidth: '250px'
|
|
@@ -12917,7 +13935,7 @@ const downArrow = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
12917
13935
|
}
|
|
12918
13936
|
}]
|
|
12919
13937
|
});
|
|
12920
|
-
var DownArrow = (props => SvgIcon(downArrow(props)));
|
|
13938
|
+
var DownArrow = (props => SvgIcon$2(downArrow(props)));
|
|
12921
13939
|
|
|
12922
13940
|
const PREFIX$6 = 'MultiState';
|
|
12923
13941
|
const classes$6 = {
|
|
@@ -13355,7 +14373,7 @@ const selectionsBack = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
13355
14373
|
}
|
|
13356
14374
|
}]
|
|
13357
14375
|
});
|
|
13358
|
-
var SelectionsBack = (props => SvgIcon(selectionsBack(props)));
|
|
14376
|
+
var SelectionsBack = (props => SvgIcon$2(selectionsBack(props)));
|
|
13359
14377
|
|
|
13360
14378
|
const selectionsForward = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
13361
14379
|
shapes: [{
|
|
@@ -13365,7 +14383,7 @@ const selectionsForward = props => _objectSpread2(_objectSpread2({}, props), {},
|
|
|
13365
14383
|
}
|
|
13366
14384
|
}]
|
|
13367
14385
|
});
|
|
13368
|
-
var SelectionsForward = (props => SvgIcon(selectionsForward(props)));
|
|
14386
|
+
var SelectionsForward = (props => SvgIcon$2(selectionsForward(props)));
|
|
13369
14387
|
|
|
13370
14388
|
function Nav(_ref) {
|
|
13371
14389
|
let {
|
|
@@ -13414,6 +14432,15 @@ function Nav(_ref) {
|
|
|
13414
14432
|
}, /*#__PURE__*/React__default.createElement(ClearSelections, null))));
|
|
13415
14433
|
}
|
|
13416
14434
|
|
|
14435
|
+
const idGen = [[10, 31], [0, 31], [0, 31], [0, 31], [0, 31], [0, 31]];
|
|
14436
|
+
function toChar(_ref) {
|
|
14437
|
+
let [min, max] = _ref;
|
|
14438
|
+
return (min + (Math.random() * (max - min) | 0)).toString(32);
|
|
14439
|
+
}
|
|
14440
|
+
function uid() {
|
|
14441
|
+
return idGen.map(toChar).join('');
|
|
14442
|
+
}
|
|
14443
|
+
|
|
13417
14444
|
function AppSelections(_ref) {
|
|
13418
14445
|
let {
|
|
13419
14446
|
app
|
|
@@ -13456,7 +14483,7 @@ function mount(_ref2) {
|
|
|
13456
14483
|
} = _ref2;
|
|
13457
14484
|
return ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(AppSelections, {
|
|
13458
14485
|
app: app
|
|
13459
|
-
}), element);
|
|
14486
|
+
}), element, uid());
|
|
13460
14487
|
}
|
|
13461
14488
|
|
|
13462
14489
|
var classCallCheck = function (instance, Constructor) {
|
|
@@ -14110,6 +15137,7 @@ function ListBoxInline(_ref3) {
|
|
|
14110
15137
|
const searchHeight = dense ? 27 : 40;
|
|
14111
15138
|
const extraheight = dense ? 39 : 49;
|
|
14112
15139
|
const minHeight = 49 + (searchVisible ? searchHeight : 0) + extraheight;
|
|
15140
|
+
const wildCardSearch = layout === null || layout === void 0 ? void 0 : layout.wildCardSearch;
|
|
14113
15141
|
const onShowSearch = () => {
|
|
14114
15142
|
const newValue = !showSearch;
|
|
14115
15143
|
setShowSearch(newValue);
|
|
@@ -14206,7 +15234,8 @@ function ListBoxInline(_ref3) {
|
|
|
14206
15234
|
dense: dense,
|
|
14207
15235
|
keyboard: keyboard,
|
|
14208
15236
|
visible: searchVisible,
|
|
14209
|
-
searchContainerRef: searchContainerRef
|
|
15237
|
+
searchContainerRef: searchContainerRef,
|
|
15238
|
+
wildCardSearch: wildCardSearch
|
|
14210
15239
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
14211
15240
|
item: true,
|
|
14212
15241
|
xs: true
|
|
@@ -14413,6 +15442,51 @@ function identify(_ref) {
|
|
|
14413
15442
|
};
|
|
14414
15443
|
}
|
|
14415
15444
|
|
|
15445
|
+
const _excluded$3 = ["__DO_NOT_USE__"];
|
|
15446
|
+
|
|
15447
|
+
/**
|
|
15448
|
+
* @ignore
|
|
15449
|
+
* @typedef {object} DoNotUseOptions Options strictly recommended not to use as they might change anytime. Documenting them to keep track of them, but not exposing them to API docs.
|
|
15450
|
+
* @property {boolean=} [focusSearch=false] Initialize the Listbox with the search input focused. Only applicable when
|
|
15451
|
+
* search is true, since toggling will always focus the search input on show.
|
|
15452
|
+
* @property {boolean=} [options.showGray=true] Render fields or checkboxes in shades of gray instead of white when their state is excluded or alternative.
|
|
15453
|
+
* @property {boolean=} [options.calculatePagesHeight=false] Override each page's qHeight with its actual row count.
|
|
15454
|
+
* @property {object} [options.sessionModel] Use a custom sessionModel.
|
|
15455
|
+
* @property {object} [options.selectionsApi] Use a custom selectionsApi to customize how values are selected.
|
|
15456
|
+
* @property {function():boolean} [options.selectDisabled=] Define a function which tells when selections are disabled (true) or enabled (false). By default, always returns false.
|
|
15457
|
+
* @property {function():object[]} [options.postProcessPages] A function for client-side post-processing of returned pages.
|
|
15458
|
+
* @property {PromiseFunction} [options.fetchStart] A function called when the Listbox starts fetching data. Receives the fetch request promise as an argument.
|
|
15459
|
+
* @property {ReceiverFunction} [options.update] A function which receives an update function which upon call will trigger a data fetch.
|
|
15460
|
+
* @property {{setScrollPos:function(number):void, initScrollPos:number}} [options.scrollState=] Object including a setScrollPos function that sets current scroll position index. A initial scroll position index.
|
|
15461
|
+
* @property {function(number):void} [options.setCount=] A function that gets called with the length of the data in the Listbox.
|
|
15462
|
+
*/
|
|
15463
|
+
|
|
15464
|
+
/**
|
|
15465
|
+
* @ignore
|
|
15466
|
+
* @param {object} usersOptions Options sent in to fieldInstance.mount.
|
|
15467
|
+
* @param {DoNotUseOptions} __DO_NOT_USE__
|
|
15468
|
+
* @returns {object} Squashed options with defaults given for non-exposed options.
|
|
15469
|
+
*/
|
|
15470
|
+
const getOptions$1 = function () {
|
|
15471
|
+
let usersOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15472
|
+
const {
|
|
15473
|
+
__DO_NOT_USE__ = {}
|
|
15474
|
+
} = usersOptions,
|
|
15475
|
+
exposedOptions = _objectWithoutProperties(usersOptions, _excluded$3);
|
|
15476
|
+
const DO_NOT_USE_DEFAULTS = {
|
|
15477
|
+
update: undefined,
|
|
15478
|
+
fetchStart: undefined,
|
|
15479
|
+
showGray: true,
|
|
15480
|
+
focusSearch: false,
|
|
15481
|
+
sessionModel: undefined,
|
|
15482
|
+
selectionsApi: undefined,
|
|
15483
|
+
selectDisabled: undefined,
|
|
15484
|
+
postProcessPages: undefined,
|
|
15485
|
+
calculatePagesHeight: false
|
|
15486
|
+
};
|
|
15487
|
+
const squashedOptions = _objectSpread2(_objectSpread2(_objectSpread2({}, exposedOptions), DO_NOT_USE_DEFAULTS), __DO_NOT_USE__);
|
|
15488
|
+
return squashedOptions;
|
|
15489
|
+
};
|
|
14416
15490
|
function ListBoxWrapper(_ref) {
|
|
14417
15491
|
let {
|
|
14418
15492
|
app,
|
|
@@ -14475,16 +15549,53 @@ function ListBoxPortal(_ref2) {
|
|
|
14475
15549
|
qId: qId,
|
|
14476
15550
|
stateName: stateName,
|
|
14477
15551
|
options: options
|
|
14478
|
-
}), element);
|
|
15552
|
+
}), element, uid());
|
|
14479
15553
|
}
|
|
14480
15554
|
|
|
14481
|
-
const
|
|
14482
|
-
|
|
14483
|
-
|
|
14484
|
-
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
|
|
15555
|
+
const DEFAULTS = {
|
|
15556
|
+
show: true,
|
|
15557
|
+
anchorOrigin: {
|
|
15558
|
+
vertical: 'bottom',
|
|
15559
|
+
horizontal: 'center'
|
|
15560
|
+
},
|
|
15561
|
+
transformOrigin: {
|
|
15562
|
+
vertical: 'top',
|
|
15563
|
+
horizontal: 'center'
|
|
15564
|
+
}
|
|
15565
|
+
};
|
|
15566
|
+
const getOptions = function () {
|
|
15567
|
+
let usersOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15568
|
+
const squashedOptions = _objectSpread2({}, DEFAULTS);
|
|
15569
|
+
extend$1(true, squashedOptions, usersOptions);
|
|
15570
|
+
return squashedOptions;
|
|
15571
|
+
};
|
|
15572
|
+
function ListBoxPopoverWrapper(_ref) {
|
|
15573
|
+
let {
|
|
15574
|
+
app,
|
|
15575
|
+
fieldIdentifier,
|
|
15576
|
+
stateName,
|
|
15577
|
+
element,
|
|
15578
|
+
options = {}
|
|
15579
|
+
} = _ref;
|
|
15580
|
+
const [showState, setShowstate] = useState$1(!!options.show);
|
|
15581
|
+
const handleCloseShowState = () => {
|
|
15582
|
+
setShowstate(false);
|
|
15583
|
+
if (options.onPopoverClose) {
|
|
15584
|
+
options.onPopoverClose();
|
|
15585
|
+
}
|
|
15586
|
+
};
|
|
15587
|
+
return /*#__PURE__*/React__default.createElement(ListBoxPopover, {
|
|
15588
|
+
show: showState,
|
|
15589
|
+
app: app,
|
|
15590
|
+
alignTo: {
|
|
15591
|
+
current: element
|
|
15592
|
+
},
|
|
15593
|
+
anchorOrigin: options.anchorOrigin,
|
|
15594
|
+
transformOrigin: options.transformOrigin,
|
|
15595
|
+
close: handleCloseShowState,
|
|
15596
|
+
fieldName: fieldIdentifier,
|
|
15597
|
+
stateName: stateName
|
|
15598
|
+
});
|
|
14488
15599
|
}
|
|
14489
15600
|
|
|
14490
15601
|
function addIndex(array, index) {
|
|
@@ -15542,7 +16653,7 @@ const warning = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
15542
16653
|
}
|
|
15543
16654
|
}]
|
|
15544
16655
|
});
|
|
15545
|
-
var WarningTriangle = (props => SvgIcon(warning(props)));
|
|
16656
|
+
var WarningTriangle = (props => SvgIcon$2(warning(props)));
|
|
15546
16657
|
|
|
15547
16658
|
/* eslint-disable react/no-array-index-key */
|
|
15548
16659
|
function DescriptionRow(_ref) {
|
|
@@ -15674,7 +16785,7 @@ function Error$1(_ref3) {
|
|
|
15674
16785
|
}));
|
|
15675
16786
|
}
|
|
15676
16787
|
|
|
15677
|
-
const _excluded$
|
|
16788
|
+
const _excluded$2 = ["size"];
|
|
15678
16789
|
const PREFIX$3 = 'Progress';
|
|
15679
16790
|
const classes$3 = {
|
|
15680
16791
|
root: "".concat(PREFIX$3, "-root"),
|
|
@@ -15711,7 +16822,7 @@ function Progress(_ref2) {
|
|
|
15711
16822
|
let {
|
|
15712
16823
|
size = 'medium'
|
|
15713
16824
|
} = _ref2,
|
|
15714
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
16825
|
+
props = _objectWithoutProperties(_ref2, _excluded$2);
|
|
15715
16826
|
const s = SIZES[size];
|
|
15716
16827
|
return /*#__PURE__*/React__default.createElement(Root, {
|
|
15717
16828
|
className: classes$3.root
|
|
@@ -15730,7 +16841,7 @@ function Progress(_ref2) {
|
|
|
15730
16841
|
}, props)));
|
|
15731
16842
|
}
|
|
15732
16843
|
|
|
15733
|
-
const _excluded$
|
|
16844
|
+
const _excluded$1 = ["cancel", "translator"],
|
|
15734
16845
|
_excluded2 = ["retry", "translator"];
|
|
15735
16846
|
const PREFIX$2 = 'LongRunningQuery';
|
|
15736
16847
|
const classes$2 = {
|
|
@@ -15756,7 +16867,7 @@ function Cancel(_ref) {
|
|
|
15756
16867
|
cancel,
|
|
15757
16868
|
translator
|
|
15758
16869
|
} = _ref,
|
|
15759
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
16870
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
15760
16871
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledGrid$2, {
|
|
15761
16872
|
container: true,
|
|
15762
16873
|
item: true,
|
|
@@ -16866,7 +17977,7 @@ function glue$1(_ref) {
|
|
|
16866
17977
|
initialSnPlugins: initialSnPlugins,
|
|
16867
17978
|
initialError: initialError,
|
|
16868
17979
|
onMount: onMount
|
|
16869
|
-
}), element,
|
|
17980
|
+
}), element, currentId);
|
|
16870
17981
|
const unmount = () => {
|
|
16871
17982
|
root.remove(portal);
|
|
16872
17983
|
model.removeListener('closed', unmount);
|
|
@@ -17144,7 +18255,22 @@ async function init(model, optional, halo, initialError) {
|
|
|
17144
18255
|
* @property {string} type
|
|
17145
18256
|
* @property {string=} version
|
|
17146
18257
|
* @property {(Field[])=} fields
|
|
18258
|
+
* @property {boolean} [extendProperties=false] Whether to deeply extend properties or not. If false then subtrees will be overwritten.
|
|
17147
18259
|
* @property {EngineAPI.IGenericObjectProperties=} properties
|
|
18260
|
+
* @example
|
|
18261
|
+
* // A config for Creating objects:
|
|
18262
|
+
* const createConfig = {
|
|
18263
|
+
* type: 'bar',
|
|
18264
|
+
* element: document.querySelector('.bar'),
|
|
18265
|
+
* extendProperties: true,
|
|
18266
|
+
* fields: ['[Country names]', '=Sum(Sales)'],
|
|
18267
|
+
* properties: {
|
|
18268
|
+
* legend: {
|
|
18269
|
+
* show: false,
|
|
18270
|
+
* },
|
|
18271
|
+
* }
|
|
18272
|
+
* };
|
|
18273
|
+
* nebbie.render(createConfig);
|
|
17148
18274
|
*/
|
|
17149
18275
|
async function createSessionObject(_ref, halo) {
|
|
17150
18276
|
let {
|
|
@@ -17154,7 +18280,8 @@ async function createSessionObject(_ref, halo) {
|
|
|
17154
18280
|
properties,
|
|
17155
18281
|
options,
|
|
17156
18282
|
plugins,
|
|
17157
|
-
element
|
|
18283
|
+
element,
|
|
18284
|
+
extendProperties
|
|
17158
18285
|
} = _ref;
|
|
17159
18286
|
let mergedProps = {};
|
|
17160
18287
|
let error;
|
|
@@ -17163,7 +18290,7 @@ async function createSessionObject(_ref, halo) {
|
|
|
17163
18290
|
name: type,
|
|
17164
18291
|
version
|
|
17165
18292
|
});
|
|
17166
|
-
mergedProps = await t.initialProperties(properties);
|
|
18293
|
+
mergedProps = await t.initialProperties(properties, extendProperties);
|
|
17167
18294
|
const sn = await t.supernova();
|
|
17168
18295
|
if (fields) {
|
|
17169
18296
|
populateData({
|
|
@@ -21157,16 +22284,21 @@ function create$1(info, halo) {
|
|
|
21157
22284
|
return sn;
|
|
21158
22285
|
}),
|
|
21159
22286
|
initialProperties(initial) {
|
|
22287
|
+
let extendProperties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
21160
22288
|
return this.supernova().then(() => {
|
|
21161
|
-
const props = _objectSpread2(
|
|
22289
|
+
const props = _objectSpread2({
|
|
21162
22290
|
qInfo: {
|
|
21163
22291
|
qType: type.name
|
|
21164
22292
|
},
|
|
21165
22293
|
visualization: type.name,
|
|
21166
22294
|
version: type.version,
|
|
21167
22295
|
showTitles: true
|
|
21168
|
-
}, JSON.parse(stringified))
|
|
21169
|
-
|
|
22296
|
+
}, JSON.parse(stringified));
|
|
22297
|
+
if (extendProperties) {
|
|
22298
|
+
extend$1(true, props, initial);
|
|
22299
|
+
return props;
|
|
22300
|
+
}
|
|
22301
|
+
return _objectSpread2(_objectSpread2({}, props), initial);
|
|
21170
22302
|
});
|
|
21171
22303
|
}
|
|
21172
22304
|
};
|
|
@@ -21270,8 +22402,6 @@ function create(_ref) {
|
|
|
21270
22402
|
};
|
|
21271
22403
|
}
|
|
21272
22404
|
|
|
21273
|
-
const _excluded$1 = ["__DO_NOT_USE__"];
|
|
21274
|
-
|
|
21275
22405
|
/**
|
|
21276
22406
|
* @interface Context
|
|
21277
22407
|
* @property {boolean=} keyboardNavigation
|
|
@@ -21382,49 +22512,6 @@ const mergeConfigs = (base, c) => ({
|
|
|
21382
22512
|
* @typedef {function(function)} ReceiverFunction A callback function which receives another function as input.
|
|
21383
22513
|
*/
|
|
21384
22514
|
|
|
21385
|
-
/**
|
|
21386
|
-
* @ignore
|
|
21387
|
-
* @typedef {object} DoNotUseOptions Options strictly recommended not to use as they might change anytime. Documenting them to keep track of them, but not exposing them to API docs.
|
|
21388
|
-
* @property {boolean=} [focusSearch=false] Initialize the Listbox with the search input focused. Only applicable when
|
|
21389
|
-
* search is true, since toggling will always focus the search input on show.
|
|
21390
|
-
* @property {boolean=} [options.showGray=true] Render fields or checkboxes in shades of gray instead of white when their state is excluded or alternative.
|
|
21391
|
-
* @property {boolean=} [options.calculatePagesHeight=false] Override each page's qHeight with its actual row count.
|
|
21392
|
-
* @property {object} [options.sessionModel] Use a custom sessionModel.
|
|
21393
|
-
* @property {object} [options.selectionsApi] Use a custom selectionsApi to customize how values are selected.
|
|
21394
|
-
* @property {function():boolean} [options.selectDisabled=] Define a function which tells when selections are disabled (true) or enabled (false). By default, always returns false.
|
|
21395
|
-
* @property {function():object[]} [options.postProcessPages] A function for client-side post-processing of returned pages.
|
|
21396
|
-
* @property {PromiseFunction} [options.fetchStart] A function called when the Listbox starts fetching data. Receives the fetch request promise as an argument.
|
|
21397
|
-
* @property {ReceiverFunction} [options.update] A function which receives an update function which upon call will trigger a data fetch.
|
|
21398
|
-
* @property {{setScrollPos:function(number):void, initScrollPos:number}} [options.scrollState=] Object including a setScrollPos function that sets current scroll position index. A initial scroll position index.
|
|
21399
|
-
* @property {function(number):void} [options.setCount=] A function that gets called with the length of the data in the Listbox.
|
|
21400
|
-
*/
|
|
21401
|
-
|
|
21402
|
-
/**
|
|
21403
|
-
* @ignore
|
|
21404
|
-
* @param {object} usersOptions Options sent in to fieldInstance.mount.
|
|
21405
|
-
* @param {DoNotUseOptions} __DO_NOT_USE__
|
|
21406
|
-
* @returns {object} Squashed options with defaults given for non-exposed options.
|
|
21407
|
-
*/
|
|
21408
|
-
const getOptions = function () {
|
|
21409
|
-
let usersOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
21410
|
-
const {
|
|
21411
|
-
__DO_NOT_USE__ = {}
|
|
21412
|
-
} = usersOptions,
|
|
21413
|
-
exposedOptions = _objectWithoutProperties(usersOptions, _excluded$1);
|
|
21414
|
-
const DO_NOT_USE_DEFAULTS = {
|
|
21415
|
-
update: undefined,
|
|
21416
|
-
fetchStart: undefined,
|
|
21417
|
-
showGray: true,
|
|
21418
|
-
focusSearch: false,
|
|
21419
|
-
sessionModel: undefined,
|
|
21420
|
-
selectionsApi: undefined,
|
|
21421
|
-
selectDisabled: undefined,
|
|
21422
|
-
postProcessPages: undefined,
|
|
21423
|
-
calculatePagesHeight: false
|
|
21424
|
-
};
|
|
21425
|
-
const squashedOptions = _objectSpread2(_objectSpread2(_objectSpread2({}, exposedOptions), DO_NOT_USE_DEFAULTS), __DO_NOT_USE__);
|
|
21426
|
-
return squashedOptions;
|
|
21427
|
-
};
|
|
21428
22515
|
function nuked() {
|
|
21429
22516
|
let configuration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
21430
22517
|
const locale = appLocaleFn(configuration.context.language);
|
|
@@ -21496,6 +22583,23 @@ function nuked() {
|
|
|
21496
22583
|
let selectionsApi = null;
|
|
21497
22584
|
let selectionsComponentReference = null;
|
|
21498
22585
|
|
|
22586
|
+
/**
|
|
22587
|
+
* @ignore
|
|
22588
|
+
* @typedef { 'fieldPopoverClose' } EmbedEventTypes
|
|
22589
|
+
*/
|
|
22590
|
+
|
|
22591
|
+
/**
|
|
22592
|
+
* Event listener function on instance
|
|
22593
|
+
*
|
|
22594
|
+
* @ignore
|
|
22595
|
+
* @method
|
|
22596
|
+
* @name Embed#on
|
|
22597
|
+
* @param {EmbedEventTypes} eventType event type that function needs to listen
|
|
22598
|
+
* @param {Function} callback a callback function to run when event emits
|
|
22599
|
+
* @example
|
|
22600
|
+
* api.on('someEvent', () => {...});
|
|
22601
|
+
*/
|
|
22602
|
+
|
|
21499
22603
|
/**
|
|
21500
22604
|
* @class
|
|
21501
22605
|
* @alias Embed
|
|
@@ -21687,7 +22791,7 @@ function nuked() {
|
|
|
21687
22791
|
app,
|
|
21688
22792
|
fieldIdentifier,
|
|
21689
22793
|
qId,
|
|
21690
|
-
options: getOptions(options),
|
|
22794
|
+
options: getOptions$1(options),
|
|
21691
22795
|
stateName: options.stateName || '$'
|
|
21692
22796
|
});
|
|
21693
22797
|
root.add(this._instance);
|
|
@@ -21724,11 +22828,31 @@ function nuked() {
|
|
|
21724
22828
|
*/
|
|
21725
22829
|
getRegisteredTypes: types.getList,
|
|
21726
22830
|
__DO_NOT_USE__: {
|
|
21727
|
-
types
|
|
22831
|
+
types,
|
|
22832
|
+
popover(anchorElement, fieldIdentifier, options) {
|
|
22833
|
+
if (api._popoverInstance) {
|
|
22834
|
+
root.remove(api._popoverInstance);
|
|
22835
|
+
api._popoverInstance = null;
|
|
22836
|
+
}
|
|
22837
|
+
const onPopoverClose = () => api.emit('fieldPopoverClose');
|
|
22838
|
+
const opts = getOptions(_objectSpread2({
|
|
22839
|
+
onPopoverClose
|
|
22840
|
+
}, options));
|
|
22841
|
+
api._popoverInstance = React__default.createElement(ListBoxPopoverWrapper, {
|
|
22842
|
+
element: anchorElement,
|
|
22843
|
+
key: uid(),
|
|
22844
|
+
app,
|
|
22845
|
+
fieldIdentifier,
|
|
22846
|
+
options: opts,
|
|
22847
|
+
stateName: options.stateName || '$'
|
|
22848
|
+
});
|
|
22849
|
+
root.add(api._popoverInstance);
|
|
22850
|
+
}
|
|
21728
22851
|
}
|
|
21729
22852
|
};
|
|
21730
22853
|
halo.public.nebbie = api;
|
|
21731
22854
|
halo.types = types;
|
|
22855
|
+
eventmixin(api);
|
|
21732
22856
|
return api;
|
|
21733
22857
|
}
|
|
21734
22858
|
|