@nebula.js/stardust 5.0.0-alpha.1 → 5.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/esm/dev.js +1692 -1299
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +5 -5
- package/core/esm/index.js.map +1 -1
- package/core/package.json +3 -3
- package/dist/stardust.dev.js +2970 -2265
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +15 -15
- package/dist/stardust.js.map +1 -1
- package/package.json +13 -13
- package/types/index.d.ts +17 -1
package/core/esm/dev.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v5.0.0-alpha.
|
|
3
|
-
* Copyright (c)
|
|
2
|
+
* @nebula.js/stardust v5.0.0-alpha.3
|
|
3
|
+
* Copyright (c) 2024 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -8,8 +8,8 @@ import * as React from 'react';
|
|
|
8
8
|
import React__default, { useState as useState$1, useEffect as useEffect$1, forwardRef, useMemo as useMemo$1, useImperativeHandle as useImperativeHandle$1, useContext, useReducer, useCallback, useLayoutEffect as useLayoutEffect$1, PureComponent, useRef, createElement, Component } from 'react';
|
|
9
9
|
import ReactDOM from 'react-dom';
|
|
10
10
|
import { CacheProvider, ThemeContext as ThemeContext$2 } from '@emotion/react';
|
|
11
|
-
import { Checkbox, Radio, Typography, FormControlLabel, Box, Grid, Tooltip, Paper, IconButton, styled as styled$
|
|
12
|
-
import styled$
|
|
11
|
+
import { Checkbox, Radio, Typography, FormControlLabel, Box, Grid, Tooltip, Paper, IconButton, styled as styled$3, Popover, MenuList, MenuItem, ListItemIcon, Divider, OutlinedInput, InputAdornment, Badge, List, ListItem, Button, ButtonBase, CircularProgress, Icon } from '@mui/material';
|
|
12
|
+
import styled$2 from '@emotion/styled';
|
|
13
13
|
|
|
14
14
|
function getDefaultExportFromCjs (x) {
|
|
15
15
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -709,26 +709,40 @@ var runtime = {exports: {}};
|
|
|
709
709
|
}
|
|
710
710
|
})(runtime);
|
|
711
711
|
|
|
712
|
-
function ownKeys(
|
|
713
|
-
var
|
|
712
|
+
function ownKeys(e, r) {
|
|
713
|
+
var t = Object.keys(e);
|
|
714
714
|
if (Object.getOwnPropertySymbols) {
|
|
715
|
-
var
|
|
716
|
-
|
|
717
|
-
return Object.getOwnPropertyDescriptor(
|
|
718
|
-
})),
|
|
719
|
-
}
|
|
720
|
-
return
|
|
721
|
-
}
|
|
722
|
-
function _objectSpread2(
|
|
723
|
-
for (var
|
|
724
|
-
var
|
|
725
|
-
|
|
726
|
-
_defineProperty(
|
|
727
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
728
|
-
Object.defineProperty(
|
|
715
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
716
|
+
r && (o = o.filter(function (r) {
|
|
717
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
718
|
+
})), t.push.apply(t, o);
|
|
719
|
+
}
|
|
720
|
+
return t;
|
|
721
|
+
}
|
|
722
|
+
function _objectSpread2(e) {
|
|
723
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
724
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
725
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
726
|
+
_defineProperty(e, r, t[r]);
|
|
727
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
728
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
729
729
|
});
|
|
730
730
|
}
|
|
731
|
-
return
|
|
731
|
+
return e;
|
|
732
|
+
}
|
|
733
|
+
function _toPrimitive(t, r) {
|
|
734
|
+
if ("object" != typeof t || !t) return t;
|
|
735
|
+
var e = t[Symbol.toPrimitive];
|
|
736
|
+
if (void 0 !== e) {
|
|
737
|
+
var i = e.call(t, r || "default");
|
|
738
|
+
if ("object" != typeof i) return i;
|
|
739
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
740
|
+
}
|
|
741
|
+
return ("string" === r ? String : Number)(t);
|
|
742
|
+
}
|
|
743
|
+
function _toPropertyKey(t) {
|
|
744
|
+
var i = _toPrimitive(t, "string");
|
|
745
|
+
return "symbol" == typeof i ? i : String(i);
|
|
732
746
|
}
|
|
733
747
|
function _defineProperty(obj, key, value) {
|
|
734
748
|
key = _toPropertyKey(key);
|
|
@@ -785,20 +799,6 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
785
799
|
}
|
|
786
800
|
return target;
|
|
787
801
|
}
|
|
788
|
-
function _toPrimitive(input, hint) {
|
|
789
|
-
if (typeof input !== "object" || input === null) return input;
|
|
790
|
-
var prim = input[Symbol.toPrimitive];
|
|
791
|
-
if (prim !== undefined) {
|
|
792
|
-
var res = prim.call(input, hint || "default");
|
|
793
|
-
if (typeof res !== "object") return res;
|
|
794
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
795
|
-
}
|
|
796
|
-
return (hint === "string" ? String : Number)(input);
|
|
797
|
-
}
|
|
798
|
-
function _toPropertyKey(arg) {
|
|
799
|
-
var key = _toPrimitive(arg, "string");
|
|
800
|
-
return typeof key === "symbol" ? key : String(key);
|
|
801
|
-
}
|
|
802
802
|
|
|
803
803
|
const format = function () {
|
|
804
804
|
let message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
@@ -1932,6 +1932,26 @@ var Visualization_UnfulfilledCalculationCondition = {
|
|
|
1932
1932
|
"zh-TW": "不符計算條件"
|
|
1933
1933
|
}
|
|
1934
1934
|
};
|
|
1935
|
+
var SelectionToolbar_ClickToLock = {
|
|
1936
|
+
id: "SelectionToolbar.ClickToLock",
|
|
1937
|
+
locale: {
|
|
1938
|
+
"de-DE": "Klicken zum Sperren",
|
|
1939
|
+
"en-US": "Click to lock",
|
|
1940
|
+
"es-ES": "Haga clic para bloquearla",
|
|
1941
|
+
"fr-FR": "Cliquez pour verrouiller",
|
|
1942
|
+
"it-IT": "Fare clic per bloccare",
|
|
1943
|
+
"ja-JP": "クリックしてロック",
|
|
1944
|
+
"ko-KR": "잠그려면 클릭하십시오.",
|
|
1945
|
+
"nl-NL": "Klik om te vergrendelen",
|
|
1946
|
+
"pl-PL": "Aby zablokować, kliknij",
|
|
1947
|
+
"pt-BR": "Clique para travar",
|
|
1948
|
+
"ru-RU": "Щелкните, чтобы заблокировать",
|
|
1949
|
+
"sv-SE": "Klicka för att låsa",
|
|
1950
|
+
"tr-TR": "Kilitlemek için tıklayın",
|
|
1951
|
+
"zh-CN": "单击以锁定",
|
|
1952
|
+
"zh-TW": "按一下鎖定"
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1935
1955
|
var all = {
|
|
1936
1956
|
Cancel: Cancel$1,
|
|
1937
1957
|
CurrentSelections_All: CurrentSelections_All,
|
|
@@ -1984,7 +2004,8 @@ var all = {
|
|
|
1984
2004
|
Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
|
|
1985
2005
|
Visualization_Invalid_Measure: Visualization_Invalid_Measure,
|
|
1986
2006
|
Visualization_LayoutError: Visualization_LayoutError,
|
|
1987
|
-
Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
|
|
2007
|
+
Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition,
|
|
2008
|
+
SelectionToolbar_ClickToLock: SelectionToolbar_ClickToLock
|
|
1988
2009
|
};
|
|
1989
2010
|
|
|
1990
2011
|
function appLocaleFn(language) {
|
|
@@ -3063,10 +3084,27 @@ var _variables = {
|
|
|
3063
3084
|
};
|
|
3064
3085
|
var type = "dark";
|
|
3065
3086
|
var color$1 = "@B98";
|
|
3087
|
+
var object$1 = {
|
|
3088
|
+
listBox: {
|
|
3089
|
+
backgroundColor: "@B20",
|
|
3090
|
+
title: {
|
|
3091
|
+
main: {
|
|
3092
|
+
color: "@B98",
|
|
3093
|
+
fontSize: "14px",
|
|
3094
|
+
fontWeight: "bold"
|
|
3095
|
+
}
|
|
3096
|
+
},
|
|
3097
|
+
content: {
|
|
3098
|
+
color: "#@B98",
|
|
3099
|
+
fontSize: "12px"
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
};
|
|
3066
3103
|
var darkRawJSON = {
|
|
3067
3104
|
_variables: _variables,
|
|
3068
3105
|
type: type,
|
|
3069
|
-
color: color$1
|
|
3106
|
+
color: color$1,
|
|
3107
|
+
object: object$1
|
|
3070
3108
|
};
|
|
3071
3109
|
|
|
3072
3110
|
var object = {
|
|
@@ -3096,7 +3134,7 @@ function setTheme(t, resolve) {
|
|
|
3096
3134
|
if (t._inherit === false || t._inherit === 'false') {
|
|
3097
3135
|
baseInherit = {};
|
|
3098
3136
|
}
|
|
3099
|
-
const root = extend$2(true, {}, baseRawJSON,
|
|
3137
|
+
const root = extend$2(true, {}, baseRawJSON, baseInherit, colorRawJSON);
|
|
3100
3138
|
// avoid merging known array objects as it could cause issues if they are of different types (pyramid vs class) or length
|
|
3101
3139
|
const rawThemeJSON = extend$2(true, {}, root, {
|
|
3102
3140
|
scales: null,
|
|
@@ -3824,65 +3862,14 @@ var m$1 = ReactDOM;
|
|
|
3824
3862
|
client.hydrateRoot = m$1.hydrateRoot;
|
|
3825
3863
|
}
|
|
3826
3864
|
|
|
3827
|
-
function _extends$4() {
|
|
3828
|
-
_extends$4 = Object.assign ? Object.assign.bind() : function (target) {
|
|
3829
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
3830
|
-
var source = arguments[i];
|
|
3831
|
-
for (var key in source) {
|
|
3832
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3833
|
-
target[key] = source[key];
|
|
3834
|
-
}
|
|
3835
|
-
}
|
|
3836
|
-
}
|
|
3837
|
-
return target;
|
|
3838
|
-
};
|
|
3839
|
-
return _extends$4.apply(this, arguments);
|
|
3840
|
-
}
|
|
3841
|
-
|
|
3842
|
-
function isPlainObject(item) {
|
|
3843
|
-
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
3844
|
-
}
|
|
3845
|
-
function deepClone(source) {
|
|
3846
|
-
if (!isPlainObject(source)) {
|
|
3847
|
-
return source;
|
|
3848
|
-
}
|
|
3849
|
-
const output = {};
|
|
3850
|
-
Object.keys(source).forEach(key => {
|
|
3851
|
-
output[key] = deepClone(source[key]);
|
|
3852
|
-
});
|
|
3853
|
-
return output;
|
|
3854
|
-
}
|
|
3855
|
-
function deepmerge(target, source, options = {
|
|
3856
|
-
clone: true
|
|
3857
|
-
}) {
|
|
3858
|
-
const output = options.clone ? _extends$4({}, target) : target;
|
|
3859
|
-
if (isPlainObject(target) && isPlainObject(source)) {
|
|
3860
|
-
Object.keys(source).forEach(key => {
|
|
3861
|
-
// Avoid prototype pollution
|
|
3862
|
-
if (key === '__proto__') {
|
|
3863
|
-
return;
|
|
3864
|
-
}
|
|
3865
|
-
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
|
3866
|
-
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
|
3867
|
-
output[key] = deepmerge(target[key], source[key], options);
|
|
3868
|
-
} else if (options.clone) {
|
|
3869
|
-
output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];
|
|
3870
|
-
} else {
|
|
3871
|
-
output[key] = source[key];
|
|
3872
|
-
}
|
|
3873
|
-
});
|
|
3874
|
-
}
|
|
3875
|
-
return output;
|
|
3876
|
-
}
|
|
3877
|
-
|
|
3878
3865
|
/**
|
|
3879
3866
|
* WARNING: Don't import this directly.
|
|
3880
|
-
* Use `MuiError` from `@mui/
|
|
3867
|
+
* Use `MuiError` from `@mui-internal/babel-macros/MuiError.macro` instead.
|
|
3881
3868
|
* @param {number} code
|
|
3882
3869
|
*/
|
|
3883
3870
|
function formatMuiErrorMessage(code) {
|
|
3884
3871
|
// Apply babel-plugin-transform-template-literals in loose mode
|
|
3885
|
-
// loose mode is safe
|
|
3872
|
+
// loose mode is safe if we're concatenating primitives
|
|
3886
3873
|
// see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose
|
|
3887
3874
|
/* eslint-disable prefer-template */
|
|
3888
3875
|
let url = 'https://mui.com/production-error/?code=' + code;
|
|
@@ -3895,916 +3882,458 @@ function formatMuiErrorMessage(code) {
|
|
|
3895
3882
|
/* eslint-enable prefer-template */
|
|
3896
3883
|
}
|
|
3897
3884
|
|
|
3898
|
-
|
|
3899
|
-
//
|
|
3900
|
-
// A strict capitalization should uppercase the first letter of each word in the sentence.
|
|
3901
|
-
// We only handle the first word.
|
|
3902
|
-
function capitalize(string) {
|
|
3903
|
-
if (typeof string !== 'string') {
|
|
3904
|
-
throw new Error(formatMuiErrorMessage(7));
|
|
3905
|
-
}
|
|
3906
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
3907
|
-
}
|
|
3885
|
+
var THEME_ID = '$$material';
|
|
3908
3886
|
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
return acc;
|
|
3887
|
+
function _extends$4() {
|
|
3888
|
+
_extends$4 = Object.assign ? Object.assign.bind() : function (target) {
|
|
3889
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
3890
|
+
var source = arguments[i];
|
|
3891
|
+
for (var key in source) {
|
|
3892
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
3893
|
+
target[key] = source[key];
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3919
3896
|
}
|
|
3920
|
-
return
|
|
3921
|
-
acc.apply(this, args);
|
|
3922
|
-
func.apply(this, args);
|
|
3923
|
-
};
|
|
3924
|
-
}, () => {});
|
|
3925
|
-
}
|
|
3926
|
-
|
|
3927
|
-
// Corresponds to 10 frames at 60 Hz.
|
|
3928
|
-
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
|
|
3929
|
-
function debounce(func, wait = 166) {
|
|
3930
|
-
let timeout;
|
|
3931
|
-
function debounced(...args) {
|
|
3932
|
-
const later = () => {
|
|
3933
|
-
// @ts-ignore
|
|
3934
|
-
func.apply(this, args);
|
|
3935
|
-
};
|
|
3936
|
-
clearTimeout(timeout);
|
|
3937
|
-
timeout = setTimeout(later, wait);
|
|
3938
|
-
}
|
|
3939
|
-
debounced.clear = () => {
|
|
3940
|
-
clearTimeout(timeout);
|
|
3897
|
+
return target;
|
|
3941
3898
|
};
|
|
3942
|
-
return
|
|
3899
|
+
return _extends$4.apply(this, arguments);
|
|
3943
3900
|
}
|
|
3944
3901
|
|
|
3945
|
-
function
|
|
3946
|
-
{
|
|
3947
|
-
|
|
3902
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
3903
|
+
if (source == null) return {};
|
|
3904
|
+
var target = {};
|
|
3905
|
+
var sourceKeys = Object.keys(source);
|
|
3906
|
+
var key, i;
|
|
3907
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
3908
|
+
key = sourceKeys[i];
|
|
3909
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
3910
|
+
target[key] = source[key];
|
|
3948
3911
|
}
|
|
3912
|
+
return target;
|
|
3949
3913
|
}
|
|
3950
3914
|
|
|
3951
|
-
|
|
3952
|
-
var _muiName, _element$type;
|
|
3953
|
-
return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName
|
|
3954
|
-
// relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
|
|
3955
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
3956
|
-
(_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;
|
|
3957
|
-
}
|
|
3915
|
+
/*
|
|
3958
3916
|
|
|
3959
|
-
|
|
3960
|
-
return node && node.ownerDocument || document;
|
|
3961
|
-
}
|
|
3917
|
+
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
3962
3918
|
|
|
3963
|
-
|
|
3964
|
-
const doc = ownerDocument(node);
|
|
3965
|
-
return doc.defaultView || window;
|
|
3966
|
-
}
|
|
3919
|
+
high performance StyleSheet for css-in-js systems
|
|
3967
3920
|
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
return () => null;
|
|
3971
|
-
}
|
|
3972
|
-
}
|
|
3921
|
+
- uses multiple style tags behind the scenes for millions of rules
|
|
3922
|
+
- uses `insertRule` for appending in production for *much* faster performance
|
|
3973
3923
|
|
|
3974
|
-
|
|
3975
|
-
* TODO v5: consider making it private
|
|
3976
|
-
*
|
|
3977
|
-
* passes {value} to {ref}
|
|
3978
|
-
*
|
|
3979
|
-
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
3980
|
-
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
3981
|
-
* https://github.com/mui/material-ui/issues/13539
|
|
3982
|
-
*
|
|
3983
|
-
* Useful if you want to expose the ref of an inner component to the public API
|
|
3984
|
-
* while still using it inside the component.
|
|
3985
|
-
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
3986
|
-
*/
|
|
3987
|
-
function setRef(ref, value) {
|
|
3988
|
-
if (typeof ref === 'function') {
|
|
3989
|
-
ref(value);
|
|
3990
|
-
} else if (ref) {
|
|
3991
|
-
ref.current = value;
|
|
3992
|
-
}
|
|
3993
|
-
}
|
|
3924
|
+
// usage
|
|
3994
3925
|
|
|
3995
|
-
|
|
3996
|
-
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
|
|
3997
|
-
* This is useful for effects that are only needed for client-side rendering but not for SSR.
|
|
3998
|
-
*
|
|
3999
|
-
* Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
4000
|
-
* and confirm it doesn't apply to your use-case.
|
|
4001
|
-
*/
|
|
4002
|
-
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
4003
|
-
var useEnhancedEffect$1 = useEnhancedEffect;
|
|
3926
|
+
import { StyleSheet } from '@emotion/sheet'
|
|
4004
3927
|
|
|
4005
|
-
let
|
|
4006
|
-
function useGlobalId(idOverride) {
|
|
4007
|
-
const [defaultId, setDefaultId] = React.useState(idOverride);
|
|
4008
|
-
const id = idOverride || defaultId;
|
|
4009
|
-
React.useEffect(() => {
|
|
4010
|
-
if (defaultId == null) {
|
|
4011
|
-
// Fallback to this default id when possible.
|
|
4012
|
-
// Use the incrementing value for client-side rendering only.
|
|
4013
|
-
// We can't use it server-side.
|
|
4014
|
-
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
4015
|
-
globalId += 1;
|
|
4016
|
-
setDefaultId(`mui-${globalId}`);
|
|
4017
|
-
}
|
|
4018
|
-
}, [defaultId]);
|
|
4019
|
-
return id;
|
|
4020
|
-
}
|
|
3928
|
+
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
|
4021
3929
|
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
/**
|
|
4025
|
-
*
|
|
4026
|
-
* @example <div id={useId()} />
|
|
4027
|
-
* @param idOverride
|
|
4028
|
-
* @returns {string}
|
|
4029
|
-
*/
|
|
4030
|
-
function useId(idOverride) {
|
|
4031
|
-
if (maybeReactUseId !== undefined) {
|
|
4032
|
-
const reactId = maybeReactUseId();
|
|
4033
|
-
return idOverride != null ? idOverride : reactId;
|
|
4034
|
-
}
|
|
4035
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
|
|
4036
|
-
return useGlobalId(idOverride);
|
|
4037
|
-
}
|
|
3930
|
+
styleSheet.insert('#box { border: 1px solid red; }')
|
|
3931
|
+
- appends a css rule into the stylesheet
|
|
4038
3932
|
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
3933
|
+
styleSheet.flush()
|
|
3934
|
+
- empties the stylesheet of all its contents
|
|
3935
|
+
|
|
3936
|
+
*/
|
|
3937
|
+
// $FlowFixMe
|
|
3938
|
+
function sheetForTag(tag) {
|
|
3939
|
+
if (tag.sheet) {
|
|
3940
|
+
// $FlowFixMe
|
|
3941
|
+
return tag.sheet;
|
|
3942
|
+
} // this weirdness brought to you by firefox
|
|
3943
|
+
|
|
3944
|
+
/* istanbul ignore next */
|
|
3945
|
+
|
|
3946
|
+
|
|
3947
|
+
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
3948
|
+
if (document.styleSheets[i].ownerNode === tag) {
|
|
3949
|
+
// $FlowFixMe
|
|
3950
|
+
return document.styleSheets[i];
|
|
3951
|
+
}
|
|
4042
3952
|
}
|
|
4043
3953
|
}
|
|
4044
3954
|
|
|
4045
|
-
function
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
const value = isControlled ? controlled : valueState;
|
|
4057
|
-
const setValueIfUncontrolled = React.useCallback(newValue => {
|
|
4058
|
-
if (!isControlled) {
|
|
4059
|
-
setValue(newValue);
|
|
4060
|
-
}
|
|
4061
|
-
}, []);
|
|
4062
|
-
return [value, setValueIfUncontrolled];
|
|
3955
|
+
function createStyleElement(options) {
|
|
3956
|
+
var tag = document.createElement('style');
|
|
3957
|
+
tag.setAttribute('data-emotion', options.key);
|
|
3958
|
+
|
|
3959
|
+
if (options.nonce !== undefined) {
|
|
3960
|
+
tag.setAttribute('nonce', options.nonce);
|
|
3961
|
+
}
|
|
3962
|
+
|
|
3963
|
+
tag.appendChild(document.createTextNode(''));
|
|
3964
|
+
tag.setAttribute('data-s', '');
|
|
3965
|
+
return tag;
|
|
4063
3966
|
}
|
|
4064
3967
|
|
|
3968
|
+
var StyleSheet = /*#__PURE__*/function () {
|
|
3969
|
+
// Using Node instead of HTMLElement since container may be a ShadowRoot
|
|
3970
|
+
function StyleSheet(options) {
|
|
3971
|
+
var _this = this;
|
|
3972
|
+
|
|
3973
|
+
this._insertTag = function (tag) {
|
|
3974
|
+
var before;
|
|
3975
|
+
|
|
3976
|
+
if (_this.tags.length === 0) {
|
|
3977
|
+
if (_this.insertionPoint) {
|
|
3978
|
+
before = _this.insertionPoint.nextSibling;
|
|
3979
|
+
} else if (_this.prepend) {
|
|
3980
|
+
before = _this.container.firstChild;
|
|
3981
|
+
} else {
|
|
3982
|
+
before = _this.before;
|
|
3983
|
+
}
|
|
3984
|
+
} else {
|
|
3985
|
+
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
3986
|
+
}
|
|
3987
|
+
|
|
3988
|
+
_this.container.insertBefore(tag, before);
|
|
3989
|
+
|
|
3990
|
+
_this.tags.push(tag);
|
|
3991
|
+
};
|
|
3992
|
+
|
|
3993
|
+
this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
|
|
3994
|
+
this.tags = [];
|
|
3995
|
+
this.ctr = 0;
|
|
3996
|
+
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
3997
|
+
|
|
3998
|
+
this.key = options.key;
|
|
3999
|
+
this.container = options.container;
|
|
4000
|
+
this.prepend = options.prepend;
|
|
4001
|
+
this.insertionPoint = options.insertionPoint;
|
|
4002
|
+
this.before = null;
|
|
4003
|
+
}
|
|
4004
|
+
|
|
4005
|
+
var _proto = StyleSheet.prototype;
|
|
4006
|
+
|
|
4007
|
+
_proto.hydrate = function hydrate(nodes) {
|
|
4008
|
+
nodes.forEach(this._insertTag);
|
|
4009
|
+
};
|
|
4010
|
+
|
|
4011
|
+
_proto.insert = function insert(rule) {
|
|
4012
|
+
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
|
|
4013
|
+
// it's 1 in dev because we insert source maps that map a single rule to a location
|
|
4014
|
+
// and you can only have one source map per style tag
|
|
4015
|
+
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
4016
|
+
this._insertTag(createStyleElement(this));
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
var tag = this.tags[this.tags.length - 1];
|
|
4020
|
+
|
|
4021
|
+
if (this.isSpeedy) {
|
|
4022
|
+
var sheet = sheetForTag(tag);
|
|
4023
|
+
|
|
4024
|
+
try {
|
|
4025
|
+
// this is the ultrafast version, works across browsers
|
|
4026
|
+
// the big drawback is that the css won't be editable in devtools
|
|
4027
|
+
sheet.insertRule(rule, sheet.cssRules.length);
|
|
4028
|
+
} catch (e) {
|
|
4029
|
+
}
|
|
4030
|
+
} else {
|
|
4031
|
+
tag.appendChild(document.createTextNode(rule));
|
|
4032
|
+
}
|
|
4033
|
+
|
|
4034
|
+
this.ctr++;
|
|
4035
|
+
};
|
|
4036
|
+
|
|
4037
|
+
_proto.flush = function flush() {
|
|
4038
|
+
// $FlowFixMe
|
|
4039
|
+
this.tags.forEach(function (tag) {
|
|
4040
|
+
return tag.parentNode && tag.parentNode.removeChild(tag);
|
|
4041
|
+
});
|
|
4042
|
+
this.tags = [];
|
|
4043
|
+
this.ctr = 0;
|
|
4044
|
+
};
|
|
4045
|
+
|
|
4046
|
+
return StyleSheet;
|
|
4047
|
+
}();
|
|
4048
|
+
|
|
4049
|
+
var MS = '-ms-';
|
|
4050
|
+
var MOZ = '-moz-';
|
|
4051
|
+
var WEBKIT = '-webkit-';
|
|
4052
|
+
|
|
4053
|
+
var COMMENT = 'comm';
|
|
4054
|
+
var RULESET = 'rule';
|
|
4055
|
+
var DECLARATION = 'decl';
|
|
4056
|
+
var IMPORT = '@import';
|
|
4057
|
+
var KEYFRAMES = '@keyframes';
|
|
4058
|
+
var LAYER = '@layer';
|
|
4059
|
+
|
|
4065
4060
|
/**
|
|
4066
|
-
*
|
|
4067
|
-
*
|
|
4061
|
+
* @param {number}
|
|
4062
|
+
* @return {number}
|
|
4068
4063
|
*/
|
|
4064
|
+
var abs = Math.abs;
|
|
4069
4065
|
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4066
|
+
/**
|
|
4067
|
+
* @param {number}
|
|
4068
|
+
* @return {string}
|
|
4069
|
+
*/
|
|
4070
|
+
var from = String.fromCharCode;
|
|
4071
|
+
|
|
4072
|
+
/**
|
|
4073
|
+
* @param {object}
|
|
4074
|
+
* @return {object}
|
|
4075
|
+
*/
|
|
4076
|
+
var assign = Object.assign;
|
|
4077
|
+
|
|
4078
|
+
/**
|
|
4079
|
+
* @param {string} value
|
|
4080
|
+
* @param {number} length
|
|
4081
|
+
* @return {number}
|
|
4082
|
+
*/
|
|
4083
|
+
function hash (value, length) {
|
|
4084
|
+
return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0
|
|
4078
4085
|
}
|
|
4079
4086
|
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
return React.useMemo(() => {
|
|
4087
|
-
if (refs.every(ref => ref == null)) {
|
|
4088
|
-
return null;
|
|
4089
|
-
}
|
|
4090
|
-
return instance => {
|
|
4091
|
-
refs.forEach(ref => {
|
|
4092
|
-
setRef(ref, instance);
|
|
4093
|
-
});
|
|
4094
|
-
};
|
|
4095
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4096
|
-
}, refs);
|
|
4087
|
+
/**
|
|
4088
|
+
* @param {string} value
|
|
4089
|
+
* @return {string}
|
|
4090
|
+
*/
|
|
4091
|
+
function trim$1 (value) {
|
|
4092
|
+
return value.trim()
|
|
4097
4093
|
}
|
|
4098
4094
|
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
email: true,
|
|
4108
|
-
password: true,
|
|
4109
|
-
number: true,
|
|
4110
|
-
date: true,
|
|
4111
|
-
month: true,
|
|
4112
|
-
week: true,
|
|
4113
|
-
time: true,
|
|
4114
|
-
datetime: true,
|
|
4115
|
-
'datetime-local': true
|
|
4116
|
-
};
|
|
4095
|
+
/**
|
|
4096
|
+
* @param {string} value
|
|
4097
|
+
* @param {RegExp} pattern
|
|
4098
|
+
* @return {string?}
|
|
4099
|
+
*/
|
|
4100
|
+
function match (value, pattern) {
|
|
4101
|
+
return (value = pattern.exec(value)) ? value[0] : value
|
|
4102
|
+
}
|
|
4117
4103
|
|
|
4118
4104
|
/**
|
|
4119
|
-
*
|
|
4120
|
-
*
|
|
4121
|
-
*
|
|
4122
|
-
* @
|
|
4123
|
-
* @returns {boolean}
|
|
4105
|
+
* @param {string} value
|
|
4106
|
+
* @param {(string|RegExp)} pattern
|
|
4107
|
+
* @param {string} replacement
|
|
4108
|
+
* @return {string}
|
|
4124
4109
|
*/
|
|
4125
|
-
function
|
|
4126
|
-
|
|
4127
|
-
type,
|
|
4128
|
-
tagName
|
|
4129
|
-
} = node;
|
|
4130
|
-
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
|
|
4131
|
-
return true;
|
|
4132
|
-
}
|
|
4133
|
-
if (tagName === 'TEXTAREA' && !node.readOnly) {
|
|
4134
|
-
return true;
|
|
4135
|
-
}
|
|
4136
|
-
if (node.isContentEditable) {
|
|
4137
|
-
return true;
|
|
4138
|
-
}
|
|
4139
|
-
return false;
|
|
4110
|
+
function replace (value, pattern, replacement) {
|
|
4111
|
+
return value.replace(pattern, replacement)
|
|
4140
4112
|
}
|
|
4141
4113
|
|
|
4142
4114
|
/**
|
|
4143
|
-
*
|
|
4144
|
-
*
|
|
4145
|
-
*
|
|
4146
|
-
* then the modality is keyboard. Otherwise, the modality is not keyboard.
|
|
4147
|
-
* @param {KeyboardEvent} event
|
|
4115
|
+
* @param {string} value
|
|
4116
|
+
* @param {string} search
|
|
4117
|
+
* @return {number}
|
|
4148
4118
|
*/
|
|
4149
|
-
function
|
|
4150
|
-
|
|
4151
|
-
return;
|
|
4152
|
-
}
|
|
4153
|
-
hadKeyboardEvent = true;
|
|
4119
|
+
function indexof (value, search) {
|
|
4120
|
+
return value.indexOf(search)
|
|
4154
4121
|
}
|
|
4155
4122
|
|
|
4156
4123
|
/**
|
|
4157
|
-
*
|
|
4158
|
-
*
|
|
4159
|
-
*
|
|
4160
|
-
* element, and then clicks on a different element, focusing it with a
|
|
4161
|
-
* pointing device, while we still think we're in keyboard modality.
|
|
4124
|
+
* @param {string} value
|
|
4125
|
+
* @param {number} index
|
|
4126
|
+
* @return {number}
|
|
4162
4127
|
*/
|
|
4163
|
-
function
|
|
4164
|
-
|
|
4128
|
+
function charat (value, index) {
|
|
4129
|
+
return value.charCodeAt(index) | 0
|
|
4165
4130
|
}
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
}
|
|
4131
|
+
|
|
4132
|
+
/**
|
|
4133
|
+
* @param {string} value
|
|
4134
|
+
* @param {number} begin
|
|
4135
|
+
* @param {number} end
|
|
4136
|
+
* @return {string}
|
|
4137
|
+
*/
|
|
4138
|
+
function substr (value, begin, end) {
|
|
4139
|
+
return value.slice(begin, end)
|
|
4176
4140
|
}
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4141
|
+
|
|
4142
|
+
/**
|
|
4143
|
+
* @param {string} value
|
|
4144
|
+
* @return {number}
|
|
4145
|
+
*/
|
|
4146
|
+
function strlen (value) {
|
|
4147
|
+
return value.length
|
|
4183
4148
|
}
|
|
4184
|
-
function isFocusVisible(event) {
|
|
4185
|
-
const {
|
|
4186
|
-
target
|
|
4187
|
-
} = event;
|
|
4188
|
-
try {
|
|
4189
|
-
return target.matches(':focus-visible');
|
|
4190
|
-
} catch (error) {
|
|
4191
|
-
// Browsers not implementing :focus-visible will throw a SyntaxError.
|
|
4192
|
-
// We use our own heuristic for those browsers.
|
|
4193
|
-
// Rethrow might be better if it's not the expected error but do we really
|
|
4194
|
-
// want to crash if focus-visible malfunctioned?
|
|
4195
|
-
}
|
|
4196
4149
|
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4150
|
+
/**
|
|
4151
|
+
* @param {any[]} value
|
|
4152
|
+
* @return {number}
|
|
4153
|
+
*/
|
|
4154
|
+
function sizeof (value) {
|
|
4155
|
+
return value.length
|
|
4200
4156
|
}
|
|
4201
|
-
function useIsFocusVisible() {
|
|
4202
|
-
const ref = React.useCallback(node => {
|
|
4203
|
-
if (node != null) {
|
|
4204
|
-
prepare(node.ownerDocument);
|
|
4205
|
-
}
|
|
4206
|
-
}, []);
|
|
4207
|
-
const isFocusVisibleRef = React.useRef(false);
|
|
4208
4157
|
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
// TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
|
|
4218
|
-
if (isFocusVisibleRef.current) {
|
|
4219
|
-
// To detect a tab/window switch, we look for a blur event followed
|
|
4220
|
-
// rapidly by a visibility change.
|
|
4221
|
-
// If we don't see a visibility change within 100ms, it's probably a
|
|
4222
|
-
// regular focus change.
|
|
4223
|
-
hadFocusVisibleRecently = true;
|
|
4224
|
-
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
|
|
4225
|
-
hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {
|
|
4226
|
-
hadFocusVisibleRecently = false;
|
|
4227
|
-
}, 100);
|
|
4228
|
-
isFocusVisibleRef.current = false;
|
|
4229
|
-
return true;
|
|
4230
|
-
}
|
|
4231
|
-
return false;
|
|
4232
|
-
}
|
|
4158
|
+
/**
|
|
4159
|
+
* @param {any} value
|
|
4160
|
+
* @param {any[]} array
|
|
4161
|
+
* @return {any}
|
|
4162
|
+
*/
|
|
4163
|
+
function append (value, array) {
|
|
4164
|
+
return array.push(value), value
|
|
4165
|
+
}
|
|
4233
4166
|
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
}
|
|
4242
|
-
return false;
|
|
4243
|
-
}
|
|
4244
|
-
return {
|
|
4245
|
-
isFocusVisibleRef,
|
|
4246
|
-
onFocus: handleFocusVisible,
|
|
4247
|
-
onBlur: handleBlurVisible,
|
|
4248
|
-
ref
|
|
4249
|
-
};
|
|
4167
|
+
/**
|
|
4168
|
+
* @param {string[]} array
|
|
4169
|
+
* @param {function} callback
|
|
4170
|
+
* @return {string}
|
|
4171
|
+
*/
|
|
4172
|
+
function combine (array, callback) {
|
|
4173
|
+
return array.map(callback).join('')
|
|
4250
4174
|
}
|
|
4251
4175
|
|
|
4176
|
+
var line = 1;
|
|
4177
|
+
var column = 1;
|
|
4178
|
+
var length = 0;
|
|
4179
|
+
var position = 0;
|
|
4180
|
+
var character = 0;
|
|
4181
|
+
var characters = '';
|
|
4182
|
+
|
|
4252
4183
|
/**
|
|
4253
|
-
*
|
|
4254
|
-
* @param {object}
|
|
4184
|
+
* @param {string} value
|
|
4185
|
+
* @param {object | null} root
|
|
4186
|
+
* @param {object | null} parent
|
|
4187
|
+
* @param {string} type
|
|
4188
|
+
* @param {string[] | string} props
|
|
4189
|
+
* @param {object[] | string} children
|
|
4190
|
+
* @param {number} length
|
|
4191
|
+
*/
|
|
4192
|
+
function node (value, root, parent, type, props, children, length) {
|
|
4193
|
+
return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
|
|
4194
|
+
}
|
|
4195
|
+
|
|
4196
|
+
/**
|
|
4197
|
+
* @param {object} root
|
|
4255
4198
|
* @param {object} props
|
|
4256
|
-
* @
|
|
4199
|
+
* @return {object}
|
|
4257
4200
|
*/
|
|
4258
|
-
function
|
|
4259
|
-
|
|
4260
|
-
Object.keys(defaultProps).forEach(propName => {
|
|
4261
|
-
if (propName.toString().match(/^(components|slots)$/)) {
|
|
4262
|
-
output[propName] = _extends$4({}, defaultProps[propName], output[propName]);
|
|
4263
|
-
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
4264
|
-
const defaultSlotProps = defaultProps[propName] || {};
|
|
4265
|
-
const slotProps = props[propName];
|
|
4266
|
-
output[propName] = {};
|
|
4267
|
-
if (!slotProps || !Object.keys(slotProps)) {
|
|
4268
|
-
// Reduce the iteration if the slot props is empty
|
|
4269
|
-
output[propName] = defaultSlotProps;
|
|
4270
|
-
} else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
|
|
4271
|
-
// Reduce the iteration if the default slot props is empty
|
|
4272
|
-
output[propName] = slotProps;
|
|
4273
|
-
} else {
|
|
4274
|
-
output[propName] = _extends$4({}, slotProps);
|
|
4275
|
-
Object.keys(defaultSlotProps).forEach(slotPropName => {
|
|
4276
|
-
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
4277
|
-
});
|
|
4278
|
-
}
|
|
4279
|
-
} else if (output[propName] === undefined) {
|
|
4280
|
-
output[propName] = defaultProps[propName];
|
|
4281
|
-
}
|
|
4282
|
-
});
|
|
4283
|
-
return output;
|
|
4201
|
+
function copy (root, props) {
|
|
4202
|
+
return assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
|
|
4284
4203
|
}
|
|
4285
4204
|
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
slot => {
|
|
4292
|
-
output[slot] = slots[slot].reduce((acc, key) => {
|
|
4293
|
-
if (key) {
|
|
4294
|
-
const utilityClass = getUtilityClass(key);
|
|
4295
|
-
if (utilityClass !== '') {
|
|
4296
|
-
acc.push(utilityClass);
|
|
4297
|
-
}
|
|
4298
|
-
if (classes && classes[key]) {
|
|
4299
|
-
acc.push(classes[key]);
|
|
4300
|
-
}
|
|
4301
|
-
}
|
|
4302
|
-
return acc;
|
|
4303
|
-
}, []).join(' ');
|
|
4304
|
-
});
|
|
4305
|
-
return output;
|
|
4205
|
+
/**
|
|
4206
|
+
* @return {number}
|
|
4207
|
+
*/
|
|
4208
|
+
function char () {
|
|
4209
|
+
return character
|
|
4306
4210
|
}
|
|
4307
4211
|
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
generate = generator;
|
|
4314
|
-
},
|
|
4315
|
-
generate(componentName) {
|
|
4316
|
-
return generate(componentName);
|
|
4317
|
-
},
|
|
4318
|
-
reset() {
|
|
4319
|
-
generate = defaultGenerator;
|
|
4320
|
-
}
|
|
4321
|
-
};
|
|
4322
|
-
};
|
|
4323
|
-
const ClassNameGenerator = createClassNameGenerator();
|
|
4324
|
-
var ClassNameGenerator$1 = ClassNameGenerator;
|
|
4212
|
+
/**
|
|
4213
|
+
* @return {number}
|
|
4214
|
+
*/
|
|
4215
|
+
function prev () {
|
|
4216
|
+
character = position > 0 ? charat(characters, --position) : 0;
|
|
4325
4217
|
|
|
4326
|
-
|
|
4327
|
-
|
|
4218
|
+
if (column--, character === 10)
|
|
4219
|
+
column = 1, line--;
|
|
4328
4220
|
|
|
4329
|
-
|
|
4330
|
-
active: 'active',
|
|
4331
|
-
checked: 'checked',
|
|
4332
|
-
completed: 'completed',
|
|
4333
|
-
disabled: 'disabled',
|
|
4334
|
-
error: 'error',
|
|
4335
|
-
expanded: 'expanded',
|
|
4336
|
-
focused: 'focused',
|
|
4337
|
-
focusVisible: 'focusVisible',
|
|
4338
|
-
open: 'open',
|
|
4339
|
-
readOnly: 'readOnly',
|
|
4340
|
-
required: 'required',
|
|
4341
|
-
selected: 'selected'
|
|
4342
|
-
};
|
|
4343
|
-
function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
|
|
4344
|
-
const globalStateClass = globalStateClassesMapping[slot];
|
|
4345
|
-
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator$1.generate(componentName)}-${slot}`;
|
|
4221
|
+
return character
|
|
4346
4222
|
}
|
|
4347
4223
|
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
return result;
|
|
4354
|
-
}
|
|
4224
|
+
/**
|
|
4225
|
+
* @return {number}
|
|
4226
|
+
*/
|
|
4227
|
+
function next () {
|
|
4228
|
+
character = position < length ? charat(characters, position++) : 0;
|
|
4355
4229
|
|
|
4356
|
-
|
|
4230
|
+
if (column++, character === 10)
|
|
4231
|
+
column = 1, line++;
|
|
4357
4232
|
|
|
4358
|
-
|
|
4359
|
-
_extends$3 = Object.assign ? Object.assign.bind() : function (target) {
|
|
4360
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
4361
|
-
var source = arguments[i];
|
|
4362
|
-
for (var key in source) {
|
|
4363
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
4364
|
-
target[key] = source[key];
|
|
4365
|
-
}
|
|
4366
|
-
}
|
|
4367
|
-
}
|
|
4368
|
-
return target;
|
|
4369
|
-
};
|
|
4370
|
-
return _extends$3.apply(this, arguments);
|
|
4233
|
+
return character
|
|
4371
4234
|
}
|
|
4372
4235
|
|
|
4373
|
-
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
4374
|
-
if (source == null) return {};
|
|
4375
|
-
var target = {};
|
|
4376
|
-
var sourceKeys = Object.keys(source);
|
|
4377
|
-
var key, i;
|
|
4378
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
4379
|
-
key = sourceKeys[i];
|
|
4380
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
4381
|
-
target[key] = source[key];
|
|
4382
|
-
}
|
|
4383
|
-
return target;
|
|
4384
|
-
}
|
|
4385
|
-
|
|
4386
|
-
/*
|
|
4387
|
-
|
|
4388
|
-
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
4389
|
-
|
|
4390
|
-
high performance StyleSheet for css-in-js systems
|
|
4391
|
-
|
|
4392
|
-
- uses multiple style tags behind the scenes for millions of rules
|
|
4393
|
-
- uses `insertRule` for appending in production for *much* faster performance
|
|
4394
|
-
|
|
4395
|
-
// usage
|
|
4396
|
-
|
|
4397
|
-
import { StyleSheet } from '@emotion/sheet'
|
|
4398
|
-
|
|
4399
|
-
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
|
4400
|
-
|
|
4401
|
-
styleSheet.insert('#box { border: 1px solid red; }')
|
|
4402
|
-
- appends a css rule into the stylesheet
|
|
4403
|
-
|
|
4404
|
-
styleSheet.flush()
|
|
4405
|
-
- empties the stylesheet of all its contents
|
|
4406
|
-
|
|
4407
|
-
*/
|
|
4408
|
-
// $FlowFixMe
|
|
4409
|
-
function sheetForTag(tag) {
|
|
4410
|
-
if (tag.sheet) {
|
|
4411
|
-
// $FlowFixMe
|
|
4412
|
-
return tag.sheet;
|
|
4413
|
-
} // this weirdness brought to you by firefox
|
|
4414
|
-
|
|
4415
|
-
/* istanbul ignore next */
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
4419
|
-
if (document.styleSheets[i].ownerNode === tag) {
|
|
4420
|
-
// $FlowFixMe
|
|
4421
|
-
return document.styleSheets[i];
|
|
4422
|
-
}
|
|
4423
|
-
}
|
|
4424
|
-
}
|
|
4425
|
-
|
|
4426
|
-
function createStyleElement(options) {
|
|
4427
|
-
var tag = document.createElement('style');
|
|
4428
|
-
tag.setAttribute('data-emotion', options.key);
|
|
4429
|
-
|
|
4430
|
-
if (options.nonce !== undefined) {
|
|
4431
|
-
tag.setAttribute('nonce', options.nonce);
|
|
4432
|
-
}
|
|
4433
|
-
|
|
4434
|
-
tag.appendChild(document.createTextNode(''));
|
|
4435
|
-
tag.setAttribute('data-s', '');
|
|
4436
|
-
return tag;
|
|
4437
|
-
}
|
|
4438
|
-
|
|
4439
|
-
var StyleSheet = /*#__PURE__*/function () {
|
|
4440
|
-
// Using Node instead of HTMLElement since container may be a ShadowRoot
|
|
4441
|
-
function StyleSheet(options) {
|
|
4442
|
-
var _this = this;
|
|
4443
|
-
|
|
4444
|
-
this._insertTag = function (tag) {
|
|
4445
|
-
var before;
|
|
4446
|
-
|
|
4447
|
-
if (_this.tags.length === 0) {
|
|
4448
|
-
if (_this.insertionPoint) {
|
|
4449
|
-
before = _this.insertionPoint.nextSibling;
|
|
4450
|
-
} else if (_this.prepend) {
|
|
4451
|
-
before = _this.container.firstChild;
|
|
4452
|
-
} else {
|
|
4453
|
-
before = _this.before;
|
|
4454
|
-
}
|
|
4455
|
-
} else {
|
|
4456
|
-
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
4457
|
-
}
|
|
4458
|
-
|
|
4459
|
-
_this.container.insertBefore(tag, before);
|
|
4460
|
-
|
|
4461
|
-
_this.tags.push(tag);
|
|
4462
|
-
};
|
|
4463
|
-
|
|
4464
|
-
this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
|
|
4465
|
-
this.tags = [];
|
|
4466
|
-
this.ctr = 0;
|
|
4467
|
-
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
4468
|
-
|
|
4469
|
-
this.key = options.key;
|
|
4470
|
-
this.container = options.container;
|
|
4471
|
-
this.prepend = options.prepend;
|
|
4472
|
-
this.insertionPoint = options.insertionPoint;
|
|
4473
|
-
this.before = null;
|
|
4474
|
-
}
|
|
4475
|
-
|
|
4476
|
-
var _proto = StyleSheet.prototype;
|
|
4477
|
-
|
|
4478
|
-
_proto.hydrate = function hydrate(nodes) {
|
|
4479
|
-
nodes.forEach(this._insertTag);
|
|
4480
|
-
};
|
|
4481
|
-
|
|
4482
|
-
_proto.insert = function insert(rule) {
|
|
4483
|
-
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
|
|
4484
|
-
// it's 1 in dev because we insert source maps that map a single rule to a location
|
|
4485
|
-
// and you can only have one source map per style tag
|
|
4486
|
-
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
4487
|
-
this._insertTag(createStyleElement(this));
|
|
4488
|
-
}
|
|
4489
|
-
|
|
4490
|
-
var tag = this.tags[this.tags.length - 1];
|
|
4491
|
-
|
|
4492
|
-
if (this.isSpeedy) {
|
|
4493
|
-
var sheet = sheetForTag(tag);
|
|
4494
|
-
|
|
4495
|
-
try {
|
|
4496
|
-
// this is the ultrafast version, works across browsers
|
|
4497
|
-
// the big drawback is that the css won't be editable in devtools
|
|
4498
|
-
sheet.insertRule(rule, sheet.cssRules.length);
|
|
4499
|
-
} catch (e) {
|
|
4500
|
-
}
|
|
4501
|
-
} else {
|
|
4502
|
-
tag.appendChild(document.createTextNode(rule));
|
|
4503
|
-
}
|
|
4504
|
-
|
|
4505
|
-
this.ctr++;
|
|
4506
|
-
};
|
|
4507
|
-
|
|
4508
|
-
_proto.flush = function flush() {
|
|
4509
|
-
// $FlowFixMe
|
|
4510
|
-
this.tags.forEach(function (tag) {
|
|
4511
|
-
return tag.parentNode && tag.parentNode.removeChild(tag);
|
|
4512
|
-
});
|
|
4513
|
-
this.tags = [];
|
|
4514
|
-
this.ctr = 0;
|
|
4515
|
-
};
|
|
4516
|
-
|
|
4517
|
-
return StyleSheet;
|
|
4518
|
-
}();
|
|
4519
|
-
|
|
4520
|
-
var MS = '-ms-';
|
|
4521
|
-
var MOZ = '-moz-';
|
|
4522
|
-
var WEBKIT = '-webkit-';
|
|
4523
|
-
|
|
4524
|
-
var COMMENT = 'comm';
|
|
4525
|
-
var RULESET = 'rule';
|
|
4526
|
-
var DECLARATION = 'decl';
|
|
4527
|
-
var IMPORT = '@import';
|
|
4528
|
-
var KEYFRAMES = '@keyframes';
|
|
4529
|
-
var LAYER = '@layer';
|
|
4530
|
-
|
|
4531
4236
|
/**
|
|
4532
|
-
* @param {number}
|
|
4533
4237
|
* @return {number}
|
|
4534
4238
|
*/
|
|
4535
|
-
|
|
4239
|
+
function peek () {
|
|
4240
|
+
return charat(characters, position)
|
|
4241
|
+
}
|
|
4536
4242
|
|
|
4537
4243
|
/**
|
|
4538
|
-
* @
|
|
4539
|
-
* @return {string}
|
|
4244
|
+
* @return {number}
|
|
4540
4245
|
*/
|
|
4541
|
-
|
|
4246
|
+
function caret () {
|
|
4247
|
+
return position
|
|
4248
|
+
}
|
|
4542
4249
|
|
|
4543
4250
|
/**
|
|
4544
|
-
* @param {
|
|
4545
|
-
* @
|
|
4251
|
+
* @param {number} begin
|
|
4252
|
+
* @param {number} end
|
|
4253
|
+
* @return {string}
|
|
4546
4254
|
*/
|
|
4547
|
-
|
|
4255
|
+
function slice (begin, end) {
|
|
4256
|
+
return substr(characters, begin, end)
|
|
4257
|
+
}
|
|
4548
4258
|
|
|
4549
4259
|
/**
|
|
4550
|
-
* @param {
|
|
4551
|
-
* @param {number} length
|
|
4260
|
+
* @param {number} type
|
|
4552
4261
|
* @return {number}
|
|
4553
4262
|
*/
|
|
4554
|
-
function
|
|
4555
|
-
|
|
4263
|
+
function token (type) {
|
|
4264
|
+
switch (type) {
|
|
4265
|
+
// \0 \t \n \r \s whitespace token
|
|
4266
|
+
case 0: case 9: case 10: case 13: case 32:
|
|
4267
|
+
return 5
|
|
4268
|
+
// ! + , / > @ ~ isolate token
|
|
4269
|
+
case 33: case 43: case 44: case 47: case 62: case 64: case 126:
|
|
4270
|
+
// ; { } breakpoint token
|
|
4271
|
+
case 59: case 123: case 125:
|
|
4272
|
+
return 4
|
|
4273
|
+
// : accompanied token
|
|
4274
|
+
case 58:
|
|
4275
|
+
return 3
|
|
4276
|
+
// " ' ( [ opening delimit token
|
|
4277
|
+
case 34: case 39: case 40: case 91:
|
|
4278
|
+
return 2
|
|
4279
|
+
// ) ] closing delimit token
|
|
4280
|
+
case 41: case 93:
|
|
4281
|
+
return 1
|
|
4282
|
+
}
|
|
4283
|
+
|
|
4284
|
+
return 0
|
|
4556
4285
|
}
|
|
4557
4286
|
|
|
4558
4287
|
/**
|
|
4559
4288
|
* @param {string} value
|
|
4560
|
-
* @return {
|
|
4289
|
+
* @return {any[]}
|
|
4561
4290
|
*/
|
|
4562
|
-
function
|
|
4563
|
-
return value
|
|
4291
|
+
function alloc (value) {
|
|
4292
|
+
return line = column = 1, length = strlen(characters = value), position = 0, []
|
|
4564
4293
|
}
|
|
4565
4294
|
|
|
4566
4295
|
/**
|
|
4567
|
-
* @param {
|
|
4568
|
-
* @
|
|
4569
|
-
* @return {string?}
|
|
4296
|
+
* @param {any} value
|
|
4297
|
+
* @return {any}
|
|
4570
4298
|
*/
|
|
4571
|
-
function
|
|
4572
|
-
return
|
|
4299
|
+
function dealloc (value) {
|
|
4300
|
+
return characters = '', value
|
|
4573
4301
|
}
|
|
4574
4302
|
|
|
4575
4303
|
/**
|
|
4576
|
-
* @param {
|
|
4577
|
-
* @param {(string|RegExp)} pattern
|
|
4578
|
-
* @param {string} replacement
|
|
4304
|
+
* @param {number} type
|
|
4579
4305
|
* @return {string}
|
|
4580
4306
|
*/
|
|
4581
|
-
function
|
|
4582
|
-
return
|
|
4307
|
+
function delimit (type) {
|
|
4308
|
+
return trim$1(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
|
|
4583
4309
|
}
|
|
4584
4310
|
|
|
4585
4311
|
/**
|
|
4586
|
-
* @param {
|
|
4587
|
-
* @
|
|
4588
|
-
* @return {number}
|
|
4312
|
+
* @param {number} type
|
|
4313
|
+
* @return {string}
|
|
4589
4314
|
*/
|
|
4590
|
-
function
|
|
4591
|
-
|
|
4315
|
+
function whitespace (type) {
|
|
4316
|
+
while (character = peek())
|
|
4317
|
+
if (character < 33)
|
|
4318
|
+
next();
|
|
4319
|
+
else
|
|
4320
|
+
break
|
|
4321
|
+
|
|
4322
|
+
return token(type) > 2 || token(character) > 3 ? '' : ' '
|
|
4592
4323
|
}
|
|
4593
4324
|
|
|
4594
4325
|
/**
|
|
4595
|
-
* @param {string} value
|
|
4596
4326
|
* @param {number} index
|
|
4597
|
-
* @
|
|
4327
|
+
* @param {number} count
|
|
4328
|
+
* @return {string}
|
|
4598
4329
|
*/
|
|
4599
|
-
function
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
* @param {number} end
|
|
4607
|
-
* @return {string}
|
|
4608
|
-
*/
|
|
4609
|
-
function substr (value, begin, end) {
|
|
4610
|
-
return value.slice(begin, end)
|
|
4611
|
-
}
|
|
4612
|
-
|
|
4613
|
-
/**
|
|
4614
|
-
* @param {string} value
|
|
4615
|
-
* @return {number}
|
|
4616
|
-
*/
|
|
4617
|
-
function strlen (value) {
|
|
4618
|
-
return value.length
|
|
4619
|
-
}
|
|
4620
|
-
|
|
4621
|
-
/**
|
|
4622
|
-
* @param {any[]} value
|
|
4623
|
-
* @return {number}
|
|
4624
|
-
*/
|
|
4625
|
-
function sizeof (value) {
|
|
4626
|
-
return value.length
|
|
4627
|
-
}
|
|
4628
|
-
|
|
4629
|
-
/**
|
|
4630
|
-
* @param {any} value
|
|
4631
|
-
* @param {any[]} array
|
|
4632
|
-
* @return {any}
|
|
4633
|
-
*/
|
|
4634
|
-
function append (value, array) {
|
|
4635
|
-
return array.push(value), value
|
|
4636
|
-
}
|
|
4637
|
-
|
|
4638
|
-
/**
|
|
4639
|
-
* @param {string[]} array
|
|
4640
|
-
* @param {function} callback
|
|
4641
|
-
* @return {string}
|
|
4642
|
-
*/
|
|
4643
|
-
function combine (array, callback) {
|
|
4644
|
-
return array.map(callback).join('')
|
|
4645
|
-
}
|
|
4646
|
-
|
|
4647
|
-
var line = 1;
|
|
4648
|
-
var column = 1;
|
|
4649
|
-
var length = 0;
|
|
4650
|
-
var position = 0;
|
|
4651
|
-
var character = 0;
|
|
4652
|
-
var characters = '';
|
|
4653
|
-
|
|
4654
|
-
/**
|
|
4655
|
-
* @param {string} value
|
|
4656
|
-
* @param {object | null} root
|
|
4657
|
-
* @param {object | null} parent
|
|
4658
|
-
* @param {string} type
|
|
4659
|
-
* @param {string[] | string} props
|
|
4660
|
-
* @param {object[] | string} children
|
|
4661
|
-
* @param {number} length
|
|
4662
|
-
*/
|
|
4663
|
-
function node (value, root, parent, type, props, children, length) {
|
|
4664
|
-
return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
|
|
4665
|
-
}
|
|
4666
|
-
|
|
4667
|
-
/**
|
|
4668
|
-
* @param {object} root
|
|
4669
|
-
* @param {object} props
|
|
4670
|
-
* @return {object}
|
|
4671
|
-
*/
|
|
4672
|
-
function copy (root, props) {
|
|
4673
|
-
return assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
|
|
4674
|
-
}
|
|
4675
|
-
|
|
4676
|
-
/**
|
|
4677
|
-
* @return {number}
|
|
4678
|
-
*/
|
|
4679
|
-
function char () {
|
|
4680
|
-
return character
|
|
4681
|
-
}
|
|
4682
|
-
|
|
4683
|
-
/**
|
|
4684
|
-
* @return {number}
|
|
4685
|
-
*/
|
|
4686
|
-
function prev () {
|
|
4687
|
-
character = position > 0 ? charat(characters, --position) : 0;
|
|
4688
|
-
|
|
4689
|
-
if (column--, character === 10)
|
|
4690
|
-
column = 1, line--;
|
|
4691
|
-
|
|
4692
|
-
return character
|
|
4693
|
-
}
|
|
4694
|
-
|
|
4695
|
-
/**
|
|
4696
|
-
* @return {number}
|
|
4697
|
-
*/
|
|
4698
|
-
function next () {
|
|
4699
|
-
character = position < length ? charat(characters, position++) : 0;
|
|
4700
|
-
|
|
4701
|
-
if (column++, character === 10)
|
|
4702
|
-
column = 1, line++;
|
|
4703
|
-
|
|
4704
|
-
return character
|
|
4705
|
-
}
|
|
4706
|
-
|
|
4707
|
-
/**
|
|
4708
|
-
* @return {number}
|
|
4709
|
-
*/
|
|
4710
|
-
function peek () {
|
|
4711
|
-
return charat(characters, position)
|
|
4712
|
-
}
|
|
4713
|
-
|
|
4714
|
-
/**
|
|
4715
|
-
* @return {number}
|
|
4716
|
-
*/
|
|
4717
|
-
function caret () {
|
|
4718
|
-
return position
|
|
4719
|
-
}
|
|
4720
|
-
|
|
4721
|
-
/**
|
|
4722
|
-
* @param {number} begin
|
|
4723
|
-
* @param {number} end
|
|
4724
|
-
* @return {string}
|
|
4725
|
-
*/
|
|
4726
|
-
function slice (begin, end) {
|
|
4727
|
-
return substr(characters, begin, end)
|
|
4728
|
-
}
|
|
4729
|
-
|
|
4730
|
-
/**
|
|
4731
|
-
* @param {number} type
|
|
4732
|
-
* @return {number}
|
|
4733
|
-
*/
|
|
4734
|
-
function token (type) {
|
|
4735
|
-
switch (type) {
|
|
4736
|
-
// \0 \t \n \r \s whitespace token
|
|
4737
|
-
case 0: case 9: case 10: case 13: case 32:
|
|
4738
|
-
return 5
|
|
4739
|
-
// ! + , / > @ ~ isolate token
|
|
4740
|
-
case 33: case 43: case 44: case 47: case 62: case 64: case 126:
|
|
4741
|
-
// ; { } breakpoint token
|
|
4742
|
-
case 59: case 123: case 125:
|
|
4743
|
-
return 4
|
|
4744
|
-
// : accompanied token
|
|
4745
|
-
case 58:
|
|
4746
|
-
return 3
|
|
4747
|
-
// " ' ( [ opening delimit token
|
|
4748
|
-
case 34: case 39: case 40: case 91:
|
|
4749
|
-
return 2
|
|
4750
|
-
// ) ] closing delimit token
|
|
4751
|
-
case 41: case 93:
|
|
4752
|
-
return 1
|
|
4753
|
-
}
|
|
4754
|
-
|
|
4755
|
-
return 0
|
|
4756
|
-
}
|
|
4757
|
-
|
|
4758
|
-
/**
|
|
4759
|
-
* @param {string} value
|
|
4760
|
-
* @return {any[]}
|
|
4761
|
-
*/
|
|
4762
|
-
function alloc (value) {
|
|
4763
|
-
return line = column = 1, length = strlen(characters = value), position = 0, []
|
|
4764
|
-
}
|
|
4765
|
-
|
|
4766
|
-
/**
|
|
4767
|
-
* @param {any} value
|
|
4768
|
-
* @return {any}
|
|
4769
|
-
*/
|
|
4770
|
-
function dealloc (value) {
|
|
4771
|
-
return characters = '', value
|
|
4772
|
-
}
|
|
4773
|
-
|
|
4774
|
-
/**
|
|
4775
|
-
* @param {number} type
|
|
4776
|
-
* @return {string}
|
|
4777
|
-
*/
|
|
4778
|
-
function delimit (type) {
|
|
4779
|
-
return trim$1(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
|
|
4780
|
-
}
|
|
4781
|
-
|
|
4782
|
-
/**
|
|
4783
|
-
* @param {number} type
|
|
4784
|
-
* @return {string}
|
|
4785
|
-
*/
|
|
4786
|
-
function whitespace (type) {
|
|
4787
|
-
while (character = peek())
|
|
4788
|
-
if (character < 33)
|
|
4789
|
-
next();
|
|
4790
|
-
else
|
|
4791
|
-
break
|
|
4792
|
-
|
|
4793
|
-
return token(type) > 2 || token(character) > 3 ? '' : ' '
|
|
4794
|
-
}
|
|
4795
|
-
|
|
4796
|
-
/**
|
|
4797
|
-
* @param {number} index
|
|
4798
|
-
* @param {number} count
|
|
4799
|
-
* @return {string}
|
|
4800
|
-
*/
|
|
4801
|
-
function escaping (index, count) {
|
|
4802
|
-
while (--count && next())
|
|
4803
|
-
// not 0-9 A-F a-f
|
|
4804
|
-
if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
|
|
4805
|
-
break
|
|
4806
|
-
|
|
4807
|
-
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
|
|
4330
|
+
function escaping (index, count) {
|
|
4331
|
+
while (--count && next())
|
|
4332
|
+
// not 0-9 A-F a-f
|
|
4333
|
+
if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
|
|
4334
|
+
break
|
|
4335
|
+
|
|
4336
|
+
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
|
|
4808
4337
|
}
|
|
4809
4338
|
|
|
4810
4339
|
/**
|
|
@@ -5669,14 +5198,14 @@ function StyledEngineProvider(props) {
|
|
|
5669
5198
|
}
|
|
5670
5199
|
|
|
5671
5200
|
/**
|
|
5672
|
-
* @mui/styled-engine v5.15.
|
|
5201
|
+
* @mui/styled-engine v5.15.7
|
|
5673
5202
|
*
|
|
5674
5203
|
* @license MIT
|
|
5675
5204
|
* This source code is licensed under the MIT license found in the
|
|
5676
5205
|
* LICENSE file in the root directory of this source tree.
|
|
5677
5206
|
*/
|
|
5678
|
-
function styled$
|
|
5679
|
-
const stylesFactory = styled$
|
|
5207
|
+
function styled$1(tag, options) {
|
|
5208
|
+
const stylesFactory = styled$2(tag, options);
|
|
5680
5209
|
return stylesFactory;
|
|
5681
5210
|
}
|
|
5682
5211
|
|
|
@@ -5689,6 +5218,34 @@ const internal_processStyles = (tag, processor) => {
|
|
|
5689
5218
|
}
|
|
5690
5219
|
};
|
|
5691
5220
|
|
|
5221
|
+
function _extends$3() {
|
|
5222
|
+
_extends$3 = Object.assign ? Object.assign.bind() : function (target) {
|
|
5223
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
5224
|
+
var source = arguments[i];
|
|
5225
|
+
for (var key in source) {
|
|
5226
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
5227
|
+
target[key] = source[key];
|
|
5228
|
+
}
|
|
5229
|
+
}
|
|
5230
|
+
}
|
|
5231
|
+
return target;
|
|
5232
|
+
};
|
|
5233
|
+
return _extends$3.apply(this, arguments);
|
|
5234
|
+
}
|
|
5235
|
+
|
|
5236
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
5237
|
+
if (source == null) return {};
|
|
5238
|
+
var target = {};
|
|
5239
|
+
var sourceKeys = Object.keys(source);
|
|
5240
|
+
var key, i;
|
|
5241
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
5242
|
+
key = sourceKeys[i];
|
|
5243
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
5244
|
+
target[key] = source[key];
|
|
5245
|
+
}
|
|
5246
|
+
return target;
|
|
5247
|
+
}
|
|
5248
|
+
|
|
5692
5249
|
function _extends$2() {
|
|
5693
5250
|
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
5694
5251
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -5699,22 +5256,535 @@ function _extends$2() {
|
|
|
5699
5256
|
}
|
|
5700
5257
|
}
|
|
5701
5258
|
}
|
|
5702
|
-
return target;
|
|
5259
|
+
return target;
|
|
5260
|
+
};
|
|
5261
|
+
return _extends$2.apply(this, arguments);
|
|
5262
|
+
}
|
|
5263
|
+
|
|
5264
|
+
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
5265
|
+
function isPlainObject(item) {
|
|
5266
|
+
if (typeof item !== 'object' || item === null) {
|
|
5267
|
+
return false;
|
|
5268
|
+
}
|
|
5269
|
+
const prototype = Object.getPrototypeOf(item);
|
|
5270
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
|
|
5271
|
+
}
|
|
5272
|
+
function deepClone(source) {
|
|
5273
|
+
if (!isPlainObject(source)) {
|
|
5274
|
+
return source;
|
|
5275
|
+
}
|
|
5276
|
+
const output = {};
|
|
5277
|
+
Object.keys(source).forEach(key => {
|
|
5278
|
+
output[key] = deepClone(source[key]);
|
|
5279
|
+
});
|
|
5280
|
+
return output;
|
|
5281
|
+
}
|
|
5282
|
+
function deepmerge(target, source, options = {
|
|
5283
|
+
clone: true
|
|
5284
|
+
}) {
|
|
5285
|
+
const output = options.clone ? _extends$2({}, target) : target;
|
|
5286
|
+
if (isPlainObject(target) && isPlainObject(source)) {
|
|
5287
|
+
Object.keys(source).forEach(key => {
|
|
5288
|
+
// Avoid prototype pollution
|
|
5289
|
+
if (key === '__proto__') {
|
|
5290
|
+
return;
|
|
5291
|
+
}
|
|
5292
|
+
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
|
5293
|
+
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
|
5294
|
+
output[key] = deepmerge(target[key], source[key], options);
|
|
5295
|
+
} else if (options.clone) {
|
|
5296
|
+
output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];
|
|
5297
|
+
} else {
|
|
5298
|
+
output[key] = source[key];
|
|
5299
|
+
}
|
|
5300
|
+
});
|
|
5301
|
+
}
|
|
5302
|
+
return output;
|
|
5303
|
+
}
|
|
5304
|
+
|
|
5305
|
+
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
|
|
5306
|
+
//
|
|
5307
|
+
// A strict capitalization should uppercase the first letter of each word in the sentence.
|
|
5308
|
+
// We only handle the first word.
|
|
5309
|
+
function capitalize(string) {
|
|
5310
|
+
if (typeof string !== 'string') {
|
|
5311
|
+
throw new Error(formatMuiErrorMessage(7));
|
|
5312
|
+
}
|
|
5313
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
5314
|
+
}
|
|
5315
|
+
|
|
5316
|
+
/**
|
|
5317
|
+
* Safe chained function.
|
|
5318
|
+
*
|
|
5319
|
+
* Will only create a new function if needed,
|
|
5320
|
+
* otherwise will pass back existing functions or null.
|
|
5321
|
+
*/
|
|
5322
|
+
function createChainedFunction(...funcs) {
|
|
5323
|
+
return funcs.reduce((acc, func) => {
|
|
5324
|
+
if (func == null) {
|
|
5325
|
+
return acc;
|
|
5326
|
+
}
|
|
5327
|
+
return function chainedFunction(...args) {
|
|
5328
|
+
acc.apply(this, args);
|
|
5329
|
+
func.apply(this, args);
|
|
5330
|
+
};
|
|
5331
|
+
}, () => {});
|
|
5332
|
+
}
|
|
5333
|
+
|
|
5334
|
+
// Corresponds to 10 frames at 60 Hz.
|
|
5335
|
+
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
|
|
5336
|
+
function debounce(func, wait = 166) {
|
|
5337
|
+
let timeout;
|
|
5338
|
+
function debounced(...args) {
|
|
5339
|
+
const later = () => {
|
|
5340
|
+
// @ts-ignore
|
|
5341
|
+
func.apply(this, args);
|
|
5342
|
+
};
|
|
5343
|
+
clearTimeout(timeout);
|
|
5344
|
+
timeout = setTimeout(later, wait);
|
|
5345
|
+
}
|
|
5346
|
+
debounced.clear = () => {
|
|
5347
|
+
clearTimeout(timeout);
|
|
5348
|
+
};
|
|
5349
|
+
return debounced;
|
|
5350
|
+
}
|
|
5351
|
+
|
|
5352
|
+
function deprecatedPropType(validator, reason) {
|
|
5353
|
+
{
|
|
5354
|
+
return () => null;
|
|
5355
|
+
}
|
|
5356
|
+
}
|
|
5357
|
+
|
|
5358
|
+
function isMuiElement(element, muiNames) {
|
|
5359
|
+
var _muiName, _element$type;
|
|
5360
|
+
return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName
|
|
5361
|
+
// relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
|
|
5362
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
5363
|
+
(_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;
|
|
5364
|
+
}
|
|
5365
|
+
|
|
5366
|
+
function ownerDocument(node) {
|
|
5367
|
+
return node && node.ownerDocument || document;
|
|
5368
|
+
}
|
|
5369
|
+
|
|
5370
|
+
function ownerWindow(node) {
|
|
5371
|
+
const doc = ownerDocument(node);
|
|
5372
|
+
return doc.defaultView || window;
|
|
5373
|
+
}
|
|
5374
|
+
|
|
5375
|
+
function requirePropFactory(componentNameInError, Component) {
|
|
5376
|
+
{
|
|
5377
|
+
return () => null;
|
|
5378
|
+
}
|
|
5379
|
+
}
|
|
5380
|
+
|
|
5381
|
+
/**
|
|
5382
|
+
* TODO v5: consider making it private
|
|
5383
|
+
*
|
|
5384
|
+
* passes {value} to {ref}
|
|
5385
|
+
*
|
|
5386
|
+
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
5387
|
+
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
5388
|
+
* https://github.com/mui/material-ui/issues/13539
|
|
5389
|
+
*
|
|
5390
|
+
* Useful if you want to expose the ref of an inner component to the public API
|
|
5391
|
+
* while still using it inside the component.
|
|
5392
|
+
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
5393
|
+
*/
|
|
5394
|
+
function setRef(ref, value) {
|
|
5395
|
+
if (typeof ref === 'function') {
|
|
5396
|
+
ref(value);
|
|
5397
|
+
} else if (ref) {
|
|
5398
|
+
ref.current = value;
|
|
5399
|
+
}
|
|
5400
|
+
}
|
|
5401
|
+
|
|
5402
|
+
/**
|
|
5403
|
+
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
|
|
5404
|
+
* This is useful for effects that are only needed for client-side rendering but not for SSR.
|
|
5405
|
+
*
|
|
5406
|
+
* Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
5407
|
+
* and confirm it doesn't apply to your use-case.
|
|
5408
|
+
*/
|
|
5409
|
+
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
5410
|
+
var useEnhancedEffect$1 = useEnhancedEffect;
|
|
5411
|
+
|
|
5412
|
+
let globalId = 0;
|
|
5413
|
+
function useGlobalId(idOverride) {
|
|
5414
|
+
const [defaultId, setDefaultId] = React.useState(idOverride);
|
|
5415
|
+
const id = idOverride || defaultId;
|
|
5416
|
+
React.useEffect(() => {
|
|
5417
|
+
if (defaultId == null) {
|
|
5418
|
+
// Fallback to this default id when possible.
|
|
5419
|
+
// Use the incrementing value for client-side rendering only.
|
|
5420
|
+
// We can't use it server-side.
|
|
5421
|
+
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
5422
|
+
globalId += 1;
|
|
5423
|
+
setDefaultId(`mui-${globalId}`);
|
|
5424
|
+
}
|
|
5425
|
+
}, [defaultId]);
|
|
5426
|
+
return id;
|
|
5427
|
+
}
|
|
5428
|
+
|
|
5429
|
+
// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
5430
|
+
const maybeReactUseId = React['useId'.toString()];
|
|
5431
|
+
/**
|
|
5432
|
+
*
|
|
5433
|
+
* @example <div id={useId()} />
|
|
5434
|
+
* @param idOverride
|
|
5435
|
+
* @returns {string}
|
|
5436
|
+
*/
|
|
5437
|
+
function useId(idOverride) {
|
|
5438
|
+
if (maybeReactUseId !== undefined) {
|
|
5439
|
+
const reactId = maybeReactUseId();
|
|
5440
|
+
return idOverride != null ? idOverride : reactId;
|
|
5441
|
+
}
|
|
5442
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
|
|
5443
|
+
return useGlobalId(idOverride);
|
|
5444
|
+
}
|
|
5445
|
+
|
|
5446
|
+
function unsupportedProp(props, propName, componentName, location, propFullName) {
|
|
5447
|
+
{
|
|
5448
|
+
return null;
|
|
5449
|
+
}
|
|
5450
|
+
}
|
|
5451
|
+
|
|
5452
|
+
function useControlled({
|
|
5453
|
+
controlled,
|
|
5454
|
+
default: defaultProp,
|
|
5455
|
+
name,
|
|
5456
|
+
state = 'value'
|
|
5457
|
+
}) {
|
|
5458
|
+
// isControlled is ignored in the hook dependency lists as it should never change.
|
|
5459
|
+
const {
|
|
5460
|
+
current: isControlled
|
|
5461
|
+
} = React.useRef(controlled !== undefined);
|
|
5462
|
+
const [valueState, setValue] = React.useState(defaultProp);
|
|
5463
|
+
const value = isControlled ? controlled : valueState;
|
|
5464
|
+
const setValueIfUncontrolled = React.useCallback(newValue => {
|
|
5465
|
+
if (!isControlled) {
|
|
5466
|
+
setValue(newValue);
|
|
5467
|
+
}
|
|
5468
|
+
}, []);
|
|
5469
|
+
return [value, setValueIfUncontrolled];
|
|
5470
|
+
}
|
|
5471
|
+
|
|
5472
|
+
/**
|
|
5473
|
+
* Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
5474
|
+
* See RFC in https://github.com/reactjs/rfcs/pull/220
|
|
5475
|
+
*/
|
|
5476
|
+
|
|
5477
|
+
function useEventCallback(fn) {
|
|
5478
|
+
const ref = React.useRef(fn);
|
|
5479
|
+
useEnhancedEffect$1(() => {
|
|
5480
|
+
ref.current = fn;
|
|
5481
|
+
});
|
|
5482
|
+
return React.useRef((...args) =>
|
|
5483
|
+
// @ts-expect-error hide `this`
|
|
5484
|
+
(0, ref.current)(...args)).current;
|
|
5485
|
+
}
|
|
5486
|
+
|
|
5487
|
+
function useForkRef(...refs) {
|
|
5488
|
+
/**
|
|
5489
|
+
* This will create a new function if the refs passed to this hook change and are all defined.
|
|
5490
|
+
* This means react will call the old forkRef with `null` and the new forkRef
|
|
5491
|
+
* with the ref. Cleanup naturally emerges from this behavior.
|
|
5492
|
+
*/
|
|
5493
|
+
return React.useMemo(() => {
|
|
5494
|
+
if (refs.every(ref => ref == null)) {
|
|
5495
|
+
return null;
|
|
5496
|
+
}
|
|
5497
|
+
return instance => {
|
|
5498
|
+
refs.forEach(ref => {
|
|
5499
|
+
setRef(ref, instance);
|
|
5500
|
+
});
|
|
5501
|
+
};
|
|
5502
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5503
|
+
}, refs);
|
|
5504
|
+
}
|
|
5505
|
+
|
|
5506
|
+
class Timeout {
|
|
5507
|
+
constructor() {
|
|
5508
|
+
this.currentId = 0;
|
|
5509
|
+
this.clear = () => {
|
|
5510
|
+
if (this.currentId !== 0) {
|
|
5511
|
+
clearTimeout(this.currentId);
|
|
5512
|
+
this.currentId = 0;
|
|
5513
|
+
}
|
|
5514
|
+
};
|
|
5515
|
+
this.disposeEffect = () => {
|
|
5516
|
+
return this.clear;
|
|
5517
|
+
};
|
|
5518
|
+
}
|
|
5519
|
+
static create() {
|
|
5520
|
+
return new Timeout();
|
|
5521
|
+
}
|
|
5522
|
+
/**
|
|
5523
|
+
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
5524
|
+
*/
|
|
5525
|
+
start(delay, fn) {
|
|
5526
|
+
this.clear();
|
|
5527
|
+
this.currentId = setTimeout(() => {
|
|
5528
|
+
this.currentId = 0;
|
|
5529
|
+
fn();
|
|
5530
|
+
}, delay);
|
|
5531
|
+
}
|
|
5532
|
+
}
|
|
5533
|
+
|
|
5534
|
+
let hadKeyboardEvent = true;
|
|
5535
|
+
let hadFocusVisibleRecently = false;
|
|
5536
|
+
const hadFocusVisibleRecentlyTimeout = new Timeout();
|
|
5537
|
+
const inputTypesWhitelist = {
|
|
5538
|
+
text: true,
|
|
5539
|
+
search: true,
|
|
5540
|
+
url: true,
|
|
5541
|
+
tel: true,
|
|
5542
|
+
email: true,
|
|
5543
|
+
password: true,
|
|
5544
|
+
number: true,
|
|
5545
|
+
date: true,
|
|
5546
|
+
month: true,
|
|
5547
|
+
week: true,
|
|
5548
|
+
time: true,
|
|
5549
|
+
datetime: true,
|
|
5550
|
+
'datetime-local': true
|
|
5551
|
+
};
|
|
5552
|
+
|
|
5553
|
+
/**
|
|
5554
|
+
* Computes whether the given element should automatically trigger the
|
|
5555
|
+
* `focus-visible` class being added, i.e. whether it should always match
|
|
5556
|
+
* `:focus-visible` when focused.
|
|
5557
|
+
* @param {Element} node
|
|
5558
|
+
* @returns {boolean}
|
|
5559
|
+
*/
|
|
5560
|
+
function focusTriggersKeyboardModality(node) {
|
|
5561
|
+
const {
|
|
5562
|
+
type,
|
|
5563
|
+
tagName
|
|
5564
|
+
} = node;
|
|
5565
|
+
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
|
|
5566
|
+
return true;
|
|
5567
|
+
}
|
|
5568
|
+
if (tagName === 'TEXTAREA' && !node.readOnly) {
|
|
5569
|
+
return true;
|
|
5570
|
+
}
|
|
5571
|
+
if (node.isContentEditable) {
|
|
5572
|
+
return true;
|
|
5573
|
+
}
|
|
5574
|
+
return false;
|
|
5575
|
+
}
|
|
5576
|
+
|
|
5577
|
+
/**
|
|
5578
|
+
* Keep track of our keyboard modality state with `hadKeyboardEvent`.
|
|
5579
|
+
* If the most recent user interaction was via the keyboard;
|
|
5580
|
+
* and the key press did not include a meta, alt/option, or control key;
|
|
5581
|
+
* then the modality is keyboard. Otherwise, the modality is not keyboard.
|
|
5582
|
+
* @param {KeyboardEvent} event
|
|
5583
|
+
*/
|
|
5584
|
+
function handleKeyDown(event) {
|
|
5585
|
+
if (event.metaKey || event.altKey || event.ctrlKey) {
|
|
5586
|
+
return;
|
|
5587
|
+
}
|
|
5588
|
+
hadKeyboardEvent = true;
|
|
5589
|
+
}
|
|
5590
|
+
|
|
5591
|
+
/**
|
|
5592
|
+
* If at any point a user clicks with a pointing device, ensure that we change
|
|
5593
|
+
* the modality away from keyboard.
|
|
5594
|
+
* This avoids the situation where a user presses a key on an already focused
|
|
5595
|
+
* element, and then clicks on a different element, focusing it with a
|
|
5596
|
+
* pointing device, while we still think we're in keyboard modality.
|
|
5597
|
+
*/
|
|
5598
|
+
function handlePointerDown() {
|
|
5599
|
+
hadKeyboardEvent = false;
|
|
5600
|
+
}
|
|
5601
|
+
function handleVisibilityChange() {
|
|
5602
|
+
if (this.visibilityState === 'hidden') {
|
|
5603
|
+
// If the tab becomes active again, the browser will handle calling focus
|
|
5604
|
+
// on the element (Safari actually calls it twice).
|
|
5605
|
+
// If this tab change caused a blur on an element with focus-visible,
|
|
5606
|
+
// re-apply the class when the user switches back to the tab.
|
|
5607
|
+
if (hadFocusVisibleRecently) {
|
|
5608
|
+
hadKeyboardEvent = true;
|
|
5609
|
+
}
|
|
5610
|
+
}
|
|
5611
|
+
}
|
|
5612
|
+
function prepare(doc) {
|
|
5613
|
+
doc.addEventListener('keydown', handleKeyDown, true);
|
|
5614
|
+
doc.addEventListener('mousedown', handlePointerDown, true);
|
|
5615
|
+
doc.addEventListener('pointerdown', handlePointerDown, true);
|
|
5616
|
+
doc.addEventListener('touchstart', handlePointerDown, true);
|
|
5617
|
+
doc.addEventListener('visibilitychange', handleVisibilityChange, true);
|
|
5618
|
+
}
|
|
5619
|
+
function isFocusVisible(event) {
|
|
5620
|
+
const {
|
|
5621
|
+
target
|
|
5622
|
+
} = event;
|
|
5623
|
+
try {
|
|
5624
|
+
return target.matches(':focus-visible');
|
|
5625
|
+
} catch (error) {
|
|
5626
|
+
// Browsers not implementing :focus-visible will throw a SyntaxError.
|
|
5627
|
+
// We use our own heuristic for those browsers.
|
|
5628
|
+
// Rethrow might be better if it's not the expected error but do we really
|
|
5629
|
+
// want to crash if focus-visible malfunctioned?
|
|
5630
|
+
}
|
|
5631
|
+
|
|
5632
|
+
// No need for validFocusTarget check. The user does that by attaching it to
|
|
5633
|
+
// focusable events only.
|
|
5634
|
+
return hadKeyboardEvent || focusTriggersKeyboardModality(target);
|
|
5635
|
+
}
|
|
5636
|
+
function useIsFocusVisible() {
|
|
5637
|
+
const ref = React.useCallback(node => {
|
|
5638
|
+
if (node != null) {
|
|
5639
|
+
prepare(node.ownerDocument);
|
|
5640
|
+
}
|
|
5641
|
+
}, []);
|
|
5642
|
+
const isFocusVisibleRef = React.useRef(false);
|
|
5643
|
+
|
|
5644
|
+
/**
|
|
5645
|
+
* Should be called if a blur event is fired
|
|
5646
|
+
*/
|
|
5647
|
+
function handleBlurVisible() {
|
|
5648
|
+
// checking against potential state variable does not suffice if we focus and blur synchronously.
|
|
5649
|
+
// React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
|
|
5650
|
+
// Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
|
|
5651
|
+
// This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
|
|
5652
|
+
// TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
|
|
5653
|
+
if (isFocusVisibleRef.current) {
|
|
5654
|
+
// To detect a tab/window switch, we look for a blur event followed
|
|
5655
|
+
// rapidly by a visibility change.
|
|
5656
|
+
// If we don't see a visibility change within 100ms, it's probably a
|
|
5657
|
+
// regular focus change.
|
|
5658
|
+
hadFocusVisibleRecently = true;
|
|
5659
|
+
hadFocusVisibleRecentlyTimeout.start(100, () => {
|
|
5660
|
+
hadFocusVisibleRecently = false;
|
|
5661
|
+
});
|
|
5662
|
+
isFocusVisibleRef.current = false;
|
|
5663
|
+
return true;
|
|
5664
|
+
}
|
|
5665
|
+
return false;
|
|
5666
|
+
}
|
|
5667
|
+
|
|
5668
|
+
/**
|
|
5669
|
+
* Should be called if a blur event is fired
|
|
5670
|
+
*/
|
|
5671
|
+
function handleFocusVisible(event) {
|
|
5672
|
+
if (isFocusVisible(event)) {
|
|
5673
|
+
isFocusVisibleRef.current = true;
|
|
5674
|
+
return true;
|
|
5675
|
+
}
|
|
5676
|
+
return false;
|
|
5677
|
+
}
|
|
5678
|
+
return {
|
|
5679
|
+
isFocusVisibleRef,
|
|
5680
|
+
onFocus: handleFocusVisible,
|
|
5681
|
+
onBlur: handleBlurVisible,
|
|
5682
|
+
ref
|
|
5683
|
+
};
|
|
5684
|
+
}
|
|
5685
|
+
|
|
5686
|
+
/**
|
|
5687
|
+
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
5688
|
+
* @param {object} defaultProps
|
|
5689
|
+
* @param {object} props
|
|
5690
|
+
* @returns {object} resolved props
|
|
5691
|
+
*/
|
|
5692
|
+
function resolveProps(defaultProps, props) {
|
|
5693
|
+
const output = _extends$2({}, props);
|
|
5694
|
+
Object.keys(defaultProps).forEach(propName => {
|
|
5695
|
+
if (propName.toString().match(/^(components|slots)$/)) {
|
|
5696
|
+
output[propName] = _extends$2({}, defaultProps[propName], output[propName]);
|
|
5697
|
+
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
5698
|
+
const defaultSlotProps = defaultProps[propName] || {};
|
|
5699
|
+
const slotProps = props[propName];
|
|
5700
|
+
output[propName] = {};
|
|
5701
|
+
if (!slotProps || !Object.keys(slotProps)) {
|
|
5702
|
+
// Reduce the iteration if the slot props is empty
|
|
5703
|
+
output[propName] = defaultSlotProps;
|
|
5704
|
+
} else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
|
|
5705
|
+
// Reduce the iteration if the default slot props is empty
|
|
5706
|
+
output[propName] = slotProps;
|
|
5707
|
+
} else {
|
|
5708
|
+
output[propName] = _extends$2({}, slotProps);
|
|
5709
|
+
Object.keys(defaultSlotProps).forEach(slotPropName => {
|
|
5710
|
+
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
5711
|
+
});
|
|
5712
|
+
}
|
|
5713
|
+
} else if (output[propName] === undefined) {
|
|
5714
|
+
output[propName] = defaultProps[propName];
|
|
5715
|
+
}
|
|
5716
|
+
});
|
|
5717
|
+
return output;
|
|
5718
|
+
}
|
|
5719
|
+
|
|
5720
|
+
function composeClasses(slots, getUtilityClass, classes = undefined) {
|
|
5721
|
+
const output = {};
|
|
5722
|
+
Object.keys(slots).forEach(
|
|
5723
|
+
// `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
|
5724
|
+
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
5725
|
+
slot => {
|
|
5726
|
+
output[slot] = slots[slot].reduce((acc, key) => {
|
|
5727
|
+
if (key) {
|
|
5728
|
+
const utilityClass = getUtilityClass(key);
|
|
5729
|
+
if (utilityClass !== '') {
|
|
5730
|
+
acc.push(utilityClass);
|
|
5731
|
+
}
|
|
5732
|
+
if (classes && classes[key]) {
|
|
5733
|
+
acc.push(classes[key]);
|
|
5734
|
+
}
|
|
5735
|
+
}
|
|
5736
|
+
return acc;
|
|
5737
|
+
}, []).join(' ');
|
|
5738
|
+
});
|
|
5739
|
+
return output;
|
|
5740
|
+
}
|
|
5741
|
+
|
|
5742
|
+
const defaultGenerator = componentName => componentName;
|
|
5743
|
+
const createClassNameGenerator = () => {
|
|
5744
|
+
let generate = defaultGenerator;
|
|
5745
|
+
return {
|
|
5746
|
+
configure(generator) {
|
|
5747
|
+
generate = generator;
|
|
5748
|
+
},
|
|
5749
|
+
generate(componentName) {
|
|
5750
|
+
return generate(componentName);
|
|
5751
|
+
},
|
|
5752
|
+
reset() {
|
|
5753
|
+
generate = defaultGenerator;
|
|
5754
|
+
}
|
|
5703
5755
|
};
|
|
5704
|
-
|
|
5756
|
+
};
|
|
5757
|
+
const ClassNameGenerator = createClassNameGenerator();
|
|
5758
|
+
|
|
5759
|
+
const globalStateClasses = {
|
|
5760
|
+
active: 'active',
|
|
5761
|
+
checked: 'checked',
|
|
5762
|
+
completed: 'completed',
|
|
5763
|
+
disabled: 'disabled',
|
|
5764
|
+
error: 'error',
|
|
5765
|
+
expanded: 'expanded',
|
|
5766
|
+
focused: 'focused',
|
|
5767
|
+
focusVisible: 'focusVisible',
|
|
5768
|
+
open: 'open',
|
|
5769
|
+
readOnly: 'readOnly',
|
|
5770
|
+
required: 'required',
|
|
5771
|
+
selected: 'selected'
|
|
5772
|
+
};
|
|
5773
|
+
function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
|
|
5774
|
+
const globalStateClass = globalStateClasses[slot];
|
|
5775
|
+
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
|
5705
5776
|
}
|
|
5706
5777
|
|
|
5707
|
-
function
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
return target;
|
|
5778
|
+
function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {
|
|
5779
|
+
const result = {};
|
|
5780
|
+
slots.forEach(slot => {
|
|
5781
|
+
result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
|
|
5782
|
+
});
|
|
5783
|
+
return result;
|
|
5784
|
+
}
|
|
5785
|
+
|
|
5786
|
+
function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
5787
|
+
return Math.max(min, Math.min(val, max));
|
|
5718
5788
|
}
|
|
5719
5789
|
|
|
5720
5790
|
const _excluded$g = ["values", "unit", "step"];
|
|
@@ -5726,7 +5796,7 @@ const sortBreakpointsValues = values => {
|
|
|
5726
5796
|
// Sort in ascending order
|
|
5727
5797
|
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
5728
5798
|
return breakpointsAsArray.reduce((acc, obj) => {
|
|
5729
|
-
return _extends$
|
|
5799
|
+
return _extends$3({}, acc, {
|
|
5730
5800
|
[obj.key]: obj.val
|
|
5731
5801
|
});
|
|
5732
5802
|
}, {});
|
|
@@ -5783,7 +5853,7 @@ function createBreakpoints(breakpoints) {
|
|
|
5783
5853
|
}
|
|
5784
5854
|
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
|
|
5785
5855
|
}
|
|
5786
|
-
return _extends$
|
|
5856
|
+
return _extends$3({
|
|
5787
5857
|
keys,
|
|
5788
5858
|
values: sortedValues,
|
|
5789
5859
|
up,
|
|
@@ -6724,7 +6794,81 @@ function unstable_createStyleFunctionSx() {
|
|
|
6724
6794
|
}
|
|
6725
6795
|
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
6726
6796
|
styleFunctionSx.filterProps = ['sx'];
|
|
6727
|
-
|
|
6797
|
+
|
|
6798
|
+
/**
|
|
6799
|
+
* A universal utility to style components with multiple color modes. Always use it from the theme object.
|
|
6800
|
+
* It works with:
|
|
6801
|
+
* - [Basic theme](https://mui.com/material-ui/customization/dark-mode/)
|
|
6802
|
+
* - [CSS theme variables](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/)
|
|
6803
|
+
* - Zero-runtime engine
|
|
6804
|
+
*
|
|
6805
|
+
* Tips: Use an array over object spread and place `theme.applyStyles()` last.
|
|
6806
|
+
*
|
|
6807
|
+
* ✅ [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })]
|
|
6808
|
+
*
|
|
6809
|
+
* 🚫 { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })}
|
|
6810
|
+
*
|
|
6811
|
+
* @example
|
|
6812
|
+
* 1. using with `styled`:
|
|
6813
|
+
* ```jsx
|
|
6814
|
+
* const Component = styled('div')(({ theme }) => [
|
|
6815
|
+
* { background: '#e5e5e5' },
|
|
6816
|
+
* theme.applyStyles('dark', {
|
|
6817
|
+
* background: '#1c1c1c',
|
|
6818
|
+
* color: '#fff',
|
|
6819
|
+
* }),
|
|
6820
|
+
* ]);
|
|
6821
|
+
* ```
|
|
6822
|
+
*
|
|
6823
|
+
* @example
|
|
6824
|
+
* 2. using with `sx` prop:
|
|
6825
|
+
* ```jsx
|
|
6826
|
+
* <Box sx={theme => [
|
|
6827
|
+
* { background: '#e5e5e5' },
|
|
6828
|
+
* theme.applyStyles('dark', {
|
|
6829
|
+
* background: '#1c1c1c',
|
|
6830
|
+
* color: '#fff',
|
|
6831
|
+
* }),
|
|
6832
|
+
* ]}
|
|
6833
|
+
* />
|
|
6834
|
+
* ```
|
|
6835
|
+
*
|
|
6836
|
+
* @example
|
|
6837
|
+
* 3. theming a component:
|
|
6838
|
+
* ```jsx
|
|
6839
|
+
* extendTheme({
|
|
6840
|
+
* components: {
|
|
6841
|
+
* MuiButton: {
|
|
6842
|
+
* styleOverrides: {
|
|
6843
|
+
* root: ({ theme }) => [
|
|
6844
|
+
* { background: '#e5e5e5' },
|
|
6845
|
+
* theme.applyStyles('dark', {
|
|
6846
|
+
* background: '#1c1c1c',
|
|
6847
|
+
* color: '#fff',
|
|
6848
|
+
* }),
|
|
6849
|
+
* ],
|
|
6850
|
+
* },
|
|
6851
|
+
* }
|
|
6852
|
+
* }
|
|
6853
|
+
* })
|
|
6854
|
+
*```
|
|
6855
|
+
*/
|
|
6856
|
+
function applyStyles(key, styles) {
|
|
6857
|
+
// @ts-expect-error this is 'any' type
|
|
6858
|
+
const theme = this;
|
|
6859
|
+
if (theme.vars && typeof theme.getColorSchemeSelector === 'function') {
|
|
6860
|
+
// If CssVarsProvider is used as a provider,
|
|
6861
|
+
// returns '* :where([data-mui-color-scheme="light|dark"]) &'
|
|
6862
|
+
const selector = theme.getColorSchemeSelector(key).replace(/(\[[^\]]+\])/, '*:where($1)');
|
|
6863
|
+
return {
|
|
6864
|
+
[selector]: styles
|
|
6865
|
+
};
|
|
6866
|
+
}
|
|
6867
|
+
if (theme.palette.mode === key) {
|
|
6868
|
+
return styles;
|
|
6869
|
+
}
|
|
6870
|
+
return {};
|
|
6871
|
+
}
|
|
6728
6872
|
|
|
6729
6873
|
const _excluded$f = ["breakpoints", "palette", "spacing", "shape"];
|
|
6730
6874
|
function createTheme$1(options = {}, ...args) {
|
|
@@ -6742,16 +6886,17 @@ function createTheme$1(options = {}, ...args) {
|
|
|
6742
6886
|
direction: 'ltr',
|
|
6743
6887
|
components: {},
|
|
6744
6888
|
// Inject component definitions.
|
|
6745
|
-
palette: _extends$
|
|
6889
|
+
palette: _extends$3({
|
|
6746
6890
|
mode: 'light'
|
|
6747
6891
|
}, paletteInput),
|
|
6748
6892
|
spacing,
|
|
6749
|
-
shape: _extends$
|
|
6893
|
+
shape: _extends$3({}, shape$1, shapeInput)
|
|
6750
6894
|
}, other);
|
|
6895
|
+
muiTheme.applyStyles = applyStyles;
|
|
6751
6896
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
6752
|
-
muiTheme.unstable_sxConfig = _extends$
|
|
6897
|
+
muiTheme.unstable_sxConfig = _extends$3({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
|
|
6753
6898
|
muiTheme.unstable_sx = function sx(props) {
|
|
6754
|
-
return styleFunctionSx
|
|
6899
|
+
return styleFunctionSx({
|
|
6755
6900
|
sx: props,
|
|
6756
6901
|
theme: this
|
|
6757
6902
|
});
|
|
@@ -6772,7 +6917,7 @@ function useTheme$3(defaultTheme = systemDefaultTheme$1) {
|
|
|
6772
6917
|
return useTheme$4(defaultTheme);
|
|
6773
6918
|
}
|
|
6774
6919
|
|
|
6775
|
-
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<
|
|
6920
|
+
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)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
6776
6921
|
|
|
6777
6922
|
const _excluded$e = ["variant"];
|
|
6778
6923
|
function isEmpty$2(string) {
|
|
@@ -6820,10 +6965,17 @@ const getStyleOverrides = (name, theme) => {
|
|
|
6820
6965
|
return null;
|
|
6821
6966
|
};
|
|
6822
6967
|
const transformVariants = variants => {
|
|
6968
|
+
let numOfCallbacks = 0;
|
|
6823
6969
|
const variantsStyles = {};
|
|
6824
6970
|
if (variants) {
|
|
6825
6971
|
variants.forEach(definition => {
|
|
6826
|
-
|
|
6972
|
+
let key = '';
|
|
6973
|
+
if (typeof definition.props === 'function') {
|
|
6974
|
+
key = `callback${numOfCallbacks}`;
|
|
6975
|
+
numOfCallbacks += 1;
|
|
6976
|
+
} else {
|
|
6977
|
+
key = propsToClassKey(definition.props);
|
|
6978
|
+
}
|
|
6827
6979
|
variantsStyles[key] = definition.style;
|
|
6828
6980
|
});
|
|
6829
6981
|
}
|
|
@@ -6841,16 +6993,29 @@ const variantsResolver = (props, styles, variants) => {
|
|
|
6841
6993
|
ownerState = {}
|
|
6842
6994
|
} = props;
|
|
6843
6995
|
const variantsStyles = [];
|
|
6996
|
+
let numOfCallbacks = 0;
|
|
6844
6997
|
if (variants) {
|
|
6845
6998
|
variants.forEach(variant => {
|
|
6846
6999
|
let isMatch = true;
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
7000
|
+
if (typeof variant.props === 'function') {
|
|
7001
|
+
const propsToCheck = _extends$3({}, props, ownerState);
|
|
7002
|
+
isMatch = variant.props(propsToCheck);
|
|
7003
|
+
} else {
|
|
7004
|
+
Object.keys(variant.props).forEach(key => {
|
|
7005
|
+
if (ownerState[key] !== variant.props[key] && props[key] !== variant.props[key]) {
|
|
7006
|
+
isMatch = false;
|
|
7007
|
+
}
|
|
7008
|
+
});
|
|
7009
|
+
}
|
|
6852
7010
|
if (isMatch) {
|
|
6853
|
-
|
|
7011
|
+
if (typeof variant.props === 'function') {
|
|
7012
|
+
variantsStyles.push(styles[`callback${numOfCallbacks}`]);
|
|
7013
|
+
} else {
|
|
7014
|
+
variantsStyles.push(styles[propsToClassKey(variant.props)]);
|
|
7015
|
+
}
|
|
7016
|
+
}
|
|
7017
|
+
if (typeof variant.props === 'function') {
|
|
7018
|
+
numOfCallbacks += 1;
|
|
6854
7019
|
}
|
|
6855
7020
|
});
|
|
6856
7021
|
}
|
|
@@ -6892,8 +7057,8 @@ const muiStyledFunctionResolver = ({
|
|
|
6892
7057
|
defaultTheme,
|
|
6893
7058
|
themeId
|
|
6894
7059
|
}) => {
|
|
6895
|
-
const resolvedStyles = styledArg(_extends$
|
|
6896
|
-
theme: resolveTheme(_extends$
|
|
7060
|
+
const resolvedStyles = styledArg(_extends$3({}, props, {
|
|
7061
|
+
theme: resolveTheme(_extends$3({}, props, {
|
|
6897
7062
|
defaultTheme,
|
|
6898
7063
|
themeId
|
|
6899
7064
|
}))
|
|
@@ -6917,8 +7082,8 @@ function createStyled(input = {}) {
|
|
|
6917
7082
|
slotShouldForwardProp = shouldForwardProp
|
|
6918
7083
|
} = input;
|
|
6919
7084
|
const systemSx = props => {
|
|
6920
|
-
return styleFunctionSx
|
|
6921
|
-
theme: resolveTheme(_extends$
|
|
7085
|
+
return styleFunctionSx(_extends$3({}, props, {
|
|
7086
|
+
theme: resolveTheme(_extends$3({}, props, {
|
|
6922
7087
|
defaultTheme,
|
|
6923
7088
|
themeId
|
|
6924
7089
|
}))
|
|
@@ -6959,7 +7124,7 @@ function createStyled(input = {}) {
|
|
|
6959
7124
|
// for string (html) tag, preserve the behavior in emotion & styled-components.
|
|
6960
7125
|
shouldForwardPropOption = undefined;
|
|
6961
7126
|
}
|
|
6962
|
-
const defaultStyledResolver = styled$
|
|
7127
|
+
const defaultStyledResolver = styled$1(tag, _extends$3({
|
|
6963
7128
|
shouldForwardProp: shouldForwardPropOption,
|
|
6964
7129
|
label
|
|
6965
7130
|
}, options));
|
|
@@ -7025,7 +7190,7 @@ function createStyled(input = {}) {
|
|
|
7025
7190
|
}
|
|
7026
7191
|
if (componentName && overridesResolver) {
|
|
7027
7192
|
expressionsWithDefaultTheme.push(props => {
|
|
7028
|
-
const theme = resolveTheme(_extends$
|
|
7193
|
+
const theme = resolveTheme(_extends$3({}, props, {
|
|
7029
7194
|
defaultTheme,
|
|
7030
7195
|
themeId
|
|
7031
7196
|
}));
|
|
@@ -7033,7 +7198,7 @@ function createStyled(input = {}) {
|
|
|
7033
7198
|
if (styleOverrides) {
|
|
7034
7199
|
const resolvedStyleOverrides = {};
|
|
7035
7200
|
Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
|
|
7036
|
-
resolvedStyleOverrides[slotKey] = typeof slotStyle === 'function' ? slotStyle(_extends$
|
|
7201
|
+
resolvedStyleOverrides[slotKey] = typeof slotStyle === 'function' ? slotStyle(_extends$3({}, props, {
|
|
7037
7202
|
theme
|
|
7038
7203
|
})) : slotStyle;
|
|
7039
7204
|
});
|
|
@@ -7044,7 +7209,7 @@ function createStyled(input = {}) {
|
|
|
7044
7209
|
}
|
|
7045
7210
|
if (componentName && !skipVariantsResolver) {
|
|
7046
7211
|
expressionsWithDefaultTheme.push(props => {
|
|
7047
|
-
const theme = resolveTheme(_extends$
|
|
7212
|
+
const theme = resolveTheme(_extends$3({}, props, {
|
|
7048
7213
|
defaultTheme,
|
|
7049
7214
|
themeId
|
|
7050
7215
|
}));
|
|
@@ -7104,7 +7269,6 @@ function useThemeProps$1({
|
|
|
7104
7269
|
return mergedProps;
|
|
7105
7270
|
}
|
|
7106
7271
|
|
|
7107
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
7108
7272
|
/**
|
|
7109
7273
|
* Returns a number whose value is limited to the given range.
|
|
7110
7274
|
* @param {number} value The value to be clamped
|
|
@@ -7112,8 +7276,8 @@ function useThemeProps$1({
|
|
|
7112
7276
|
* @param {number} max The upper boundary of the output range
|
|
7113
7277
|
* @returns {number} A number in the range [min, max]
|
|
7114
7278
|
*/
|
|
7115
|
-
function
|
|
7116
|
-
return
|
|
7279
|
+
function clampWrapper(value, min = 0, max = 1) {
|
|
7280
|
+
return clamp(value, min, max);
|
|
7117
7281
|
}
|
|
7118
7282
|
|
|
7119
7283
|
/**
|
|
@@ -7275,7 +7439,7 @@ function getContrastRatio(foreground, background) {
|
|
|
7275
7439
|
*/
|
|
7276
7440
|
function darken(color, coefficient) {
|
|
7277
7441
|
color = decomposeColor(color);
|
|
7278
|
-
coefficient =
|
|
7442
|
+
coefficient = clampWrapper(coefficient);
|
|
7279
7443
|
if (color.type.indexOf('hsl') !== -1) {
|
|
7280
7444
|
color.values[2] *= 1 - coefficient;
|
|
7281
7445
|
} else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {
|
|
@@ -7294,7 +7458,7 @@ function darken(color, coefficient) {
|
|
|
7294
7458
|
*/
|
|
7295
7459
|
function lighten(color, coefficient) {
|
|
7296
7460
|
color = decomposeColor(color);
|
|
7297
|
-
coefficient =
|
|
7461
|
+
coefficient = clampWrapper(coefficient);
|
|
7298
7462
|
if (color.type.indexOf('hsl') !== -1) {
|
|
7299
7463
|
color.values[2] += (100 - color.values[2]) * coefficient;
|
|
7300
7464
|
} else if (color.type.indexOf('rgb') !== -1) {
|
|
@@ -7373,7 +7537,7 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
|
|
|
7373
7537
|
const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
|
|
7374
7538
|
if (typeof localTheme === 'function') {
|
|
7375
7539
|
const mergedTheme = localTheme(resolvedTheme);
|
|
7376
|
-
const result = themeId ? _extends$
|
|
7540
|
+
const result = themeId ? _extends$3({}, upperTheme, {
|
|
7377
7541
|
[themeId]: mergedTheme
|
|
7378
7542
|
}) : mergedTheme;
|
|
7379
7543
|
// must return a function for the private theme to NOT merge with the upper theme.
|
|
@@ -7383,9 +7547,9 @@ function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
|
|
|
7383
7547
|
}
|
|
7384
7548
|
return result;
|
|
7385
7549
|
}
|
|
7386
|
-
return themeId ? _extends$
|
|
7550
|
+
return themeId ? _extends$3({}, upperTheme, {
|
|
7387
7551
|
[themeId]: localTheme
|
|
7388
|
-
}) : _extends$
|
|
7552
|
+
}) : _extends$3({}, upperTheme, localTheme);
|
|
7389
7553
|
}, [themeId, upperTheme, localTheme, isPrivate]);
|
|
7390
7554
|
}
|
|
7391
7555
|
|
|
@@ -7427,7 +7591,7 @@ function adaptV4Theme(inputTheme) {
|
|
|
7427
7591
|
styleOverrides = {}
|
|
7428
7592
|
} = inputTheme,
|
|
7429
7593
|
other = _objectWithoutPropertiesLoose$1(inputTheme, _excluded$c);
|
|
7430
|
-
const theme = _extends$
|
|
7594
|
+
const theme = _extends$4({}, other, {
|
|
7431
7595
|
components: {}
|
|
7432
7596
|
});
|
|
7433
7597
|
|
|
@@ -7461,13 +7625,13 @@ function adaptV4Theme(inputTheme) {
|
|
|
7461
7625
|
// theme.mixins.gutters
|
|
7462
7626
|
const breakpoints = createBreakpoints(inputTheme.breakpoints || {});
|
|
7463
7627
|
const spacing = theme.spacing;
|
|
7464
|
-
theme.mixins = _extends$
|
|
7628
|
+
theme.mixins = _extends$4({
|
|
7465
7629
|
gutters: (styles = {}) => {
|
|
7466
|
-
return _extends$
|
|
7630
|
+
return _extends$4({
|
|
7467
7631
|
paddingLeft: spacing(2),
|
|
7468
7632
|
paddingRight: spacing(2)
|
|
7469
7633
|
}, styles, {
|
|
7470
|
-
[breakpoints.up('sm')]: _extends$
|
|
7634
|
+
[breakpoints.up('sm')]: _extends$4({
|
|
7471
7635
|
paddingLeft: spacing(3),
|
|
7472
7636
|
paddingRight: spacing(3)
|
|
7473
7637
|
}, styles[breakpoints.up('sm')])
|
|
@@ -7480,7 +7644,7 @@ function adaptV4Theme(inputTheme) {
|
|
|
7480
7644
|
} = palette,
|
|
7481
7645
|
paletteRest = _objectWithoutPropertiesLoose$1(palette, _excluded2$1);
|
|
7482
7646
|
const finalMode = modeInput || typeInput || 'light';
|
|
7483
|
-
theme.palette = _extends$
|
|
7647
|
+
theme.palette = _extends$4({
|
|
7484
7648
|
// theme.palette.text.hint
|
|
7485
7649
|
text: {
|
|
7486
7650
|
hint: finalMode === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.38)'
|
|
@@ -7492,7 +7656,7 @@ function adaptV4Theme(inputTheme) {
|
|
|
7492
7656
|
}
|
|
7493
7657
|
|
|
7494
7658
|
function createMixins(breakpoints, mixins) {
|
|
7495
|
-
return _extends$
|
|
7659
|
+
return _extends$4({
|
|
7496
7660
|
toolbar: {
|
|
7497
7661
|
minHeight: 56,
|
|
7498
7662
|
[breakpoints.up('xs')]: {
|
|
@@ -7830,7 +7994,7 @@ function createPalette(palette) {
|
|
|
7830
7994
|
lightShade = 300,
|
|
7831
7995
|
darkShade = 700
|
|
7832
7996
|
}) => {
|
|
7833
|
-
color = _extends$
|
|
7997
|
+
color = _extends$4({}, color);
|
|
7834
7998
|
if (!color.main && color[mainShade]) {
|
|
7835
7999
|
color.main = color[mainShade];
|
|
7836
8000
|
}
|
|
@@ -7851,9 +8015,9 @@ function createPalette(palette) {
|
|
|
7851
8015
|
dark: dark$1,
|
|
7852
8016
|
light: light$1
|
|
7853
8017
|
};
|
|
7854
|
-
const paletteOutput = deepmerge(_extends$
|
|
8018
|
+
const paletteOutput = deepmerge(_extends$4({
|
|
7855
8019
|
// A collection of common colors.
|
|
7856
|
-
common: _extends$
|
|
8020
|
+
common: _extends$4({}, common$1),
|
|
7857
8021
|
// prevent mutable object.
|
|
7858
8022
|
// The palette mode, can be light or dark.
|
|
7859
8023
|
mode,
|
|
@@ -7941,7 +8105,7 @@ function createTypography(palette, typography) {
|
|
|
7941
8105
|
other = _objectWithoutPropertiesLoose$1(_ref, _excluded$a);
|
|
7942
8106
|
const coef = fontSize / 14;
|
|
7943
8107
|
const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);
|
|
7944
|
-
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$
|
|
8108
|
+
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$4({
|
|
7945
8109
|
fontFamily,
|
|
7946
8110
|
fontWeight,
|
|
7947
8111
|
fontSize: pxToRem(size),
|
|
@@ -7973,7 +8137,7 @@ function createTypography(palette, typography) {
|
|
|
7973
8137
|
letterSpacing: 'inherit'
|
|
7974
8138
|
}
|
|
7975
8139
|
};
|
|
7976
|
-
return deepmerge(_extends$
|
|
8140
|
+
return deepmerge(_extends$4({
|
|
7977
8141
|
htmlFontSize,
|
|
7978
8142
|
pxToRem,
|
|
7979
8143
|
fontFamily,
|
|
@@ -7996,7 +8160,6 @@ function createShadow(...px) {
|
|
|
7996
8160
|
|
|
7997
8161
|
// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss
|
|
7998
8162
|
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)];
|
|
7999
|
-
var shadows$1 = shadows;
|
|
8000
8163
|
|
|
8001
8164
|
const _excluded$9 = ["duration", "easing", "delay"];
|
|
8002
8165
|
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
@@ -8041,8 +8204,8 @@ function getAutoHeightDuration(height) {
|
|
|
8041
8204
|
return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
|
|
8042
8205
|
}
|
|
8043
8206
|
function createTransitions(inputTransitions) {
|
|
8044
|
-
const mergedEasing = _extends$
|
|
8045
|
-
const mergedDuration = _extends$
|
|
8207
|
+
const mergedEasing = _extends$4({}, easing, inputTransitions.easing);
|
|
8208
|
+
const mergedDuration = _extends$4({}, duration, inputTransitions.duration);
|
|
8046
8209
|
const create = (props = ['all'], options = {}) => {
|
|
8047
8210
|
const {
|
|
8048
8211
|
duration: durationOption = mergedDuration.standard,
|
|
@@ -8052,7 +8215,7 @@ function createTransitions(inputTransitions) {
|
|
|
8052
8215
|
_objectWithoutPropertiesLoose$1(options, _excluded$9);
|
|
8053
8216
|
return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
|
|
8054
8217
|
};
|
|
8055
|
-
return _extends$
|
|
8218
|
+
return _extends$4({
|
|
8056
8219
|
getAutoHeightDuration,
|
|
8057
8220
|
create
|
|
8058
8221
|
}, inputTransitions, {
|
|
@@ -8093,16 +8256,16 @@ function createTheme(options = {}, ...args) {
|
|
|
8093
8256
|
mixins: createMixins(systemTheme.breakpoints, mixinsInput),
|
|
8094
8257
|
palette,
|
|
8095
8258
|
// Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
|
|
8096
|
-
shadows: shadows
|
|
8259
|
+
shadows: shadows.slice(),
|
|
8097
8260
|
typography: createTypography(palette, typographyInput),
|
|
8098
8261
|
transitions: createTransitions(transitionsInput),
|
|
8099
|
-
zIndex: _extends$
|
|
8262
|
+
zIndex: _extends$4({}, zIndex$1)
|
|
8100
8263
|
});
|
|
8101
8264
|
muiTheme = deepmerge(muiTheme, other);
|
|
8102
8265
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
8103
|
-
muiTheme.unstable_sxConfig = _extends$
|
|
8266
|
+
muiTheme.unstable_sxConfig = _extends$4({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
|
|
8104
8267
|
muiTheme.unstable_sx = function sx(props) {
|
|
8105
|
-
return styleFunctionSx
|
|
8268
|
+
return styleFunctionSx({
|
|
8106
8269
|
sx: props,
|
|
8107
8270
|
theme: this
|
|
8108
8271
|
});
|
|
@@ -8136,7 +8299,6 @@ const styled = createStyled({
|
|
|
8136
8299
|
defaultTheme: defaultTheme$1,
|
|
8137
8300
|
rootShouldForwardProp
|
|
8138
8301
|
});
|
|
8139
|
-
var styled$1 = styled;
|
|
8140
8302
|
|
|
8141
8303
|
const _excluded$7 = ["theme"];
|
|
8142
8304
|
function ThemeProvider(_ref) {
|
|
@@ -8145,7 +8307,7 @@ function ThemeProvider(_ref) {
|
|
|
8145
8307
|
} = _ref,
|
|
8146
8308
|
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$7);
|
|
8147
8309
|
const scopedTheme = themeInput[THEME_ID];
|
|
8148
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$
|
|
8310
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$4({}, props, {
|
|
8149
8311
|
themeId: scopedTheme ? THEME_ID : undefined,
|
|
8150
8312
|
theme: scopedTheme || themeInput
|
|
8151
8313
|
}));
|
|
@@ -8242,6 +8404,7 @@ const colors = {
|
|
|
8242
8404
|
grey90: '#E6E6E6',
|
|
8243
8405
|
grey85: '#D9D9D9',
|
|
8244
8406
|
grey55: '#8C8C8C',
|
|
8407
|
+
grey45: '#737373',
|
|
8245
8408
|
grey30: '#4D4D4D',
|
|
8246
8409
|
grey25: '#404040',
|
|
8247
8410
|
grey20: '#333333',
|
|
@@ -8296,7 +8459,9 @@ const light = {
|
|
|
8296
8459
|
custom: {
|
|
8297
8460
|
focusBorder: colors.blue,
|
|
8298
8461
|
focusOutline: 'rgba(70, 157, 205, 0.3)',
|
|
8299
|
-
inputBackground: 'rgba(255, 255, 255, 1)'
|
|
8462
|
+
inputBackground: 'rgba(255, 255, 255, 1)',
|
|
8463
|
+
disabledBackground: colors.grey45,
|
|
8464
|
+
disabledContrastText: colors.grey100
|
|
8300
8465
|
},
|
|
8301
8466
|
selected: {
|
|
8302
8467
|
main: colors.green,
|
|
@@ -8364,7 +8529,9 @@ const dark = {
|
|
|
8364
8529
|
custom: {
|
|
8365
8530
|
focusBorder: colors.blue,
|
|
8366
8531
|
focusOutline: 'rgba(70, 157, 205, 0.3)',
|
|
8367
|
-
inputBackground: 'rgba(0, 0, 0, 0.2)'
|
|
8532
|
+
inputBackground: 'rgba(0, 0, 0, 0.2)',
|
|
8533
|
+
disabledBackground: colors.grey45,
|
|
8534
|
+
disabledContrastText: colors.grey100
|
|
8368
8535
|
},
|
|
8369
8536
|
selected: {
|
|
8370
8537
|
main: colors.green,
|
|
@@ -8525,8 +8692,8 @@ function create$3(definition) {
|
|
|
8525
8692
|
return cache[key];
|
|
8526
8693
|
}
|
|
8527
8694
|
|
|
8528
|
-
const NEBULA_VERSION_HASH = "
|
|
8529
|
-
ClassNameGenerator
|
|
8695
|
+
const NEBULA_VERSION_HASH = "fc09" ;
|
|
8696
|
+
ClassNameGenerator.configure(componentName => {
|
|
8530
8697
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
8531
8698
|
});
|
|
8532
8699
|
|
|
@@ -8757,7 +8924,7 @@ function boot(_ref2) {
|
|
|
8757
8924
|
const appRef = React__default.createRef();
|
|
8758
8925
|
const element = document.createElement('div');
|
|
8759
8926
|
element.style.display = 'none';
|
|
8760
|
-
element.setAttribute('data-nebulajs-version', "5.0.0-alpha.
|
|
8927
|
+
element.setAttribute('data-nebulajs-version', "5.0.0-alpha.3" );
|
|
8761
8928
|
element.setAttribute('data-app-id', app.id);
|
|
8762
8929
|
document.body.appendChild(element);
|
|
8763
8930
|
if (context) {
|
|
@@ -9106,7 +9273,7 @@ function getFontSize(size) {
|
|
|
9106
9273
|
}
|
|
9107
9274
|
return '16px';
|
|
9108
9275
|
}
|
|
9109
|
-
function SvgIcon$
|
|
9276
|
+
function SvgIcon$1(_ref) {
|
|
9110
9277
|
let {
|
|
9111
9278
|
size,
|
|
9112
9279
|
style = {},
|
|
@@ -9156,7 +9323,7 @@ const remove = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
9156
9323
|
}
|
|
9157
9324
|
}]
|
|
9158
9325
|
});
|
|
9159
|
-
var Remove = (props => SvgIcon$
|
|
9326
|
+
var Remove = (props => SvgIcon$1(remove(props)));
|
|
9160
9327
|
|
|
9161
9328
|
const lock = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
9162
9329
|
shapes: [{
|
|
@@ -9166,9 +9333,10 @@ const lock = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
9166
9333
|
}
|
|
9167
9334
|
}]
|
|
9168
9335
|
});
|
|
9169
|
-
var Lock = (props => SvgIcon$
|
|
9336
|
+
var Lock = (props => SvgIcon$1(lock(props)));
|
|
9170
9337
|
|
|
9171
9338
|
const unlock = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
9339
|
+
viewBox: '0 0 12 16',
|
|
9172
9340
|
shapes: [{
|
|
9173
9341
|
type: 'path',
|
|
9174
9342
|
attrs: {
|
|
@@ -9176,7 +9344,7 @@ const unlock = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
9176
9344
|
}
|
|
9177
9345
|
}]
|
|
9178
9346
|
});
|
|
9179
|
-
var Unlock = (props => SvgIcon$
|
|
9347
|
+
var Unlock = (props => SvgIcon$1(unlock(props)));
|
|
9180
9348
|
|
|
9181
9349
|
function isRangeVisible(_ref) {
|
|
9182
9350
|
var lastRenderedStartIndex = _ref.lastRenderedStartIndex,
|
|
@@ -9817,7 +9985,7 @@ const tick = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
9817
9985
|
}
|
|
9818
9986
|
}]
|
|
9819
9987
|
});
|
|
9820
|
-
var Tick = (props => SvgIcon$
|
|
9988
|
+
var Tick = (props => SvgIcon$1(tick(props)));
|
|
9821
9989
|
|
|
9822
9990
|
/**
|
|
9823
9991
|
* @ignore
|
|
@@ -10020,7 +10188,7 @@ const ellipsis = {
|
|
|
10020
10188
|
};
|
|
10021
10189
|
const iconWidth = 24; // tick and lock icon width in px
|
|
10022
10190
|
|
|
10023
|
-
const RowColRoot = styled
|
|
10191
|
+
const RowColRoot = styled('div', {
|
|
10024
10192
|
shouldForwardProp: prop => !['checkboxes', 'isGridMode', 'isGridCol', 'dense', 'direction', 'sizes', 'frequencyMode', 'freqHitsValue', 'layout', 'styles'].includes(prop)
|
|
10025
10193
|
})(_ref4 => {
|
|
10026
10194
|
let {
|
|
@@ -10228,7 +10396,7 @@ const classes$b = {
|
|
|
10228
10396
|
checkbox: "".concat(PREFIX$b, "-checkbox"),
|
|
10229
10397
|
dense: "".concat(PREFIX$b, "-dense")
|
|
10230
10398
|
};
|
|
10231
|
-
const StyledCheckbox = styled
|
|
10399
|
+
const StyledCheckbox = styled(Checkbox, {
|
|
10232
10400
|
shouldForwardProp: p => p !== 'styles'
|
|
10233
10401
|
})(_ref => {
|
|
10234
10402
|
let {
|
|
@@ -10325,7 +10493,7 @@ const classes$a = {
|
|
|
10325
10493
|
denseRadioButton: "".concat(PREFIX$a, "-denseRadioButton"),
|
|
10326
10494
|
radioButton: "".concat(PREFIX$a, "-radioButton")
|
|
10327
10495
|
};
|
|
10328
|
-
const StyledRadio = styled
|
|
10496
|
+
const StyledRadio = styled(Radio)(_ref => {
|
|
10329
10497
|
let {
|
|
10330
10498
|
theme,
|
|
10331
10499
|
checked
|
|
@@ -10642,7 +10810,7 @@ function getGridItemSizes(_ref) {
|
|
|
10642
10810
|
}
|
|
10643
10811
|
}
|
|
10644
10812
|
|
|
10645
|
-
const ItemGrid = styled
|
|
10813
|
+
const ItemGrid = styled(Grid, {
|
|
10646
10814
|
shouldForwardProp: prop => !['dataLayout', 'layoutOrder', 'itemPadding', 'cellPaddingRight', 'direction', 'fillHeight'].includes(prop)
|
|
10647
10815
|
})(_ref => {
|
|
10648
10816
|
let {
|
|
@@ -11206,12 +11374,13 @@ function RowColumn(_ref) {
|
|
|
11206
11374
|
flexGrow: 1,
|
|
11207
11375
|
paddingLeft: isRtl ? 8 : checkboxes ? 0 : undefined,
|
|
11208
11376
|
paddingRight: checkboxes ? 0 : isRtl ? 8 : 0,
|
|
11209
|
-
justifyContent: valueTextAlign
|
|
11377
|
+
justifyContent: valueTextAlign,
|
|
11378
|
+
textAlign: valueTextAlign
|
|
11210
11379
|
};
|
|
11211
11380
|
const isFirstElement = index === 0;
|
|
11212
|
-
const
|
|
11213
|
-
const
|
|
11214
|
-
const
|
|
11381
|
+
const showLockIcon = isSelected && isLocked;
|
|
11382
|
+
const showTickIcon = !checkboxes && isSelected && !isLocked;
|
|
11383
|
+
const showAnyIcon = !checkboxes && sizePermitsTickOrLock;
|
|
11215
11384
|
const cellPaddingRight = checkboxes || !sizePermitsTickOrLock;
|
|
11216
11385
|
const ariaLabel = getValueLabel({
|
|
11217
11386
|
translator,
|
|
@@ -11307,13 +11476,13 @@ function RowColumn(_ref) {
|
|
|
11307
11476
|
checkboxes: checkboxes,
|
|
11308
11477
|
dense: dense,
|
|
11309
11478
|
showGray: showGray
|
|
11310
|
-
}),
|
|
11479
|
+
}), showAnyIcon && /*#__PURE__*/React__default.createElement(Grid, {
|
|
11311
11480
|
item: true,
|
|
11312
11481
|
className: rowColClasses.icon
|
|
11313
|
-
},
|
|
11482
|
+
}, showLockIcon && /*#__PURE__*/React__default.createElement(Lock, {
|
|
11314
11483
|
style: iconStyles,
|
|
11315
11484
|
size: "small"
|
|
11316
|
-
}),
|
|
11485
|
+
}), showTickIcon && /*#__PURE__*/React__default.createElement(Tick, {
|
|
11317
11486
|
style: iconStyles,
|
|
11318
11487
|
size: "small"
|
|
11319
11488
|
}))));
|
|
@@ -12783,7 +12952,7 @@ function getStyledComponents() {
|
|
|
12783
12952
|
backgroundColor: scrollBarThumbHover
|
|
12784
12953
|
}
|
|
12785
12954
|
});
|
|
12786
|
-
const StyledFixedSizeList = styled$
|
|
12955
|
+
const StyledFixedSizeList = styled$2(FixedSizeList, {
|
|
12787
12956
|
shouldForwardProp: prop => prop !== 'scrollDisabled'
|
|
12788
12957
|
})(_ref => {
|
|
12789
12958
|
let {
|
|
@@ -12793,7 +12962,7 @@ function getStyledComponents() {
|
|
|
12793
12962
|
["&.".concat(classes$9.styledScrollbars)]: getScrollbarStyling(scrollDisabled)
|
|
12794
12963
|
};
|
|
12795
12964
|
});
|
|
12796
|
-
const StyledFixedSizeGrid = styled$
|
|
12965
|
+
const StyledFixedSizeGrid = styled$2(FixedSizeGrid, {
|
|
12797
12966
|
shouldForwardProp: prop => prop !== 'scrollDisabled'
|
|
12798
12967
|
})(_ref2 => {
|
|
12799
12968
|
let {
|
|
@@ -13410,7 +13579,7 @@ function useDataStore(model) {
|
|
|
13410
13579
|
};
|
|
13411
13580
|
}
|
|
13412
13581
|
|
|
13413
|
-
const StyledText = styled
|
|
13582
|
+
const StyledText = styled(Typography, {
|
|
13414
13583
|
shouldForwardProp: p => !['width', 'dense'].includes(p)
|
|
13415
13584
|
})(_ref => {
|
|
13416
13585
|
let {
|
|
@@ -13483,7 +13652,7 @@ const useUtilityClasses = ownerState => {
|
|
|
13483
13652
|
};
|
|
13484
13653
|
return composeClasses(slots, getSvgIconUtilityClass, classes);
|
|
13485
13654
|
};
|
|
13486
|
-
const SvgIconRoot = styled
|
|
13655
|
+
const SvgIconRoot = styled('svg', {
|
|
13487
13656
|
name: 'MuiSvgIcon',
|
|
13488
13657
|
slot: 'Root',
|
|
13489
13658
|
overridesResolver: (props, styles) => {
|
|
@@ -13541,7 +13710,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
13541
13710
|
} = props,
|
|
13542
13711
|
other = _objectWithoutPropertiesLoose$1(props, _excluded$5);
|
|
13543
13712
|
const hasSvgAsChild = /*#__PURE__*/React.isValidElement(children) && children.type === 'svg';
|
|
13544
|
-
const ownerState = _extends$
|
|
13713
|
+
const ownerState = _extends$4({}, props, {
|
|
13545
13714
|
color,
|
|
13546
13715
|
component,
|
|
13547
13716
|
fontSize,
|
|
@@ -13555,7 +13724,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
13555
13724
|
more.viewBox = viewBox;
|
|
13556
13725
|
}
|
|
13557
13726
|
const classes = useUtilityClasses(ownerState);
|
|
13558
|
-
return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, _extends$
|
|
13727
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, _extends$4({
|
|
13559
13728
|
as: component,
|
|
13560
13729
|
className: clsx(classes.root, className),
|
|
13561
13730
|
focusable: "false",
|
|
@@ -13571,18 +13740,17 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
13571
13740
|
}));
|
|
13572
13741
|
});
|
|
13573
13742
|
SvgIcon.muiName = 'SvgIcon';
|
|
13574
|
-
var SvgIcon$1 = SvgIcon;
|
|
13575
13743
|
|
|
13576
13744
|
function createSvgIcon(path, displayName) {
|
|
13577
13745
|
function Component(props, ref) {
|
|
13578
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon
|
|
13746
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon, _extends$4({
|
|
13579
13747
|
"data-testid": `${displayName}Icon`,
|
|
13580
13748
|
ref: ref
|
|
13581
13749
|
}, props, {
|
|
13582
13750
|
children: path
|
|
13583
13751
|
}));
|
|
13584
13752
|
}
|
|
13585
|
-
Component.muiName = SvgIcon
|
|
13753
|
+
Component.muiName = SvgIcon.muiName;
|
|
13586
13754
|
return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));
|
|
13587
13755
|
}
|
|
13588
13756
|
|
|
@@ -13590,7 +13758,7 @@ function createSvgIcon(path, displayName) {
|
|
|
13590
13758
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13591
13759
|
const unstable_ClassNameGenerator = {
|
|
13592
13760
|
configure: generator => {
|
|
13593
|
-
ClassNameGenerator
|
|
13761
|
+
ClassNameGenerator.configure(generator);
|
|
13594
13762
|
}
|
|
13595
13763
|
};
|
|
13596
13764
|
|
|
@@ -13647,12 +13815,11 @@ Object.defineProperty(Close, "__esModule", {
|
|
|
13647
13815
|
var default_1 = Close.default = void 0;
|
|
13648
13816
|
var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
|
|
13649
13817
|
var _jsxRuntime = jsxRuntimeExports;
|
|
13650
|
-
|
|
13818
|
+
default_1 = Close.default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
13651
13819
|
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"
|
|
13652
13820
|
}), 'Close');
|
|
13653
|
-
default_1 = Close.default = _default;
|
|
13654
13821
|
|
|
13655
|
-
const RootContainer = styled
|
|
13822
|
+
const RootContainer = styled(Paper)(_ref => {
|
|
13656
13823
|
let {
|
|
13657
13824
|
theme,
|
|
13658
13825
|
left
|
|
@@ -13666,11 +13833,11 @@ const RootContainer = styled$1(Paper)(_ref => {
|
|
|
13666
13833
|
left
|
|
13667
13834
|
};
|
|
13668
13835
|
});
|
|
13669
|
-
const LeftItem = styled
|
|
13836
|
+
const LeftItem = styled('div')(() => ({
|
|
13670
13837
|
paddingLeft: '6px',
|
|
13671
13838
|
flexGrow: 1
|
|
13672
13839
|
}));
|
|
13673
|
-
const RightItem = styled
|
|
13840
|
+
const RightItem = styled('div')(_ref2 => {
|
|
13674
13841
|
let {
|
|
13675
13842
|
dense
|
|
13676
13843
|
} = _ref2;
|
|
@@ -13679,7 +13846,7 @@ const RightItem = styled$1('div')(_ref2 => {
|
|
|
13679
13846
|
alignItems: "".concat(dense ? 'center' : 'flex-start')
|
|
13680
13847
|
};
|
|
13681
13848
|
});
|
|
13682
|
-
const SmallCloseIcon = styled
|
|
13849
|
+
const SmallCloseIcon = styled(default_1)(() => ({
|
|
13683
13850
|
fontSize: '14px'
|
|
13684
13851
|
}));
|
|
13685
13852
|
function ListBoxFooter(_ref3) {
|
|
@@ -13828,7 +13995,7 @@ function deduceFrequencyMode(pages) {
|
|
|
13828
13995
|
|
|
13829
13996
|
const _excluded$4 = ["isLoadingData"];
|
|
13830
13997
|
const DEFAULT_MIN_BATCH_SIZE = 100;
|
|
13831
|
-
const StyledWrapper = styled$
|
|
13998
|
+
const StyledWrapper = styled$3('div')(() => ({
|
|
13832
13999
|
["& .screenReaderOnly"]: {
|
|
13833
14000
|
position: 'absolute',
|
|
13834
14001
|
height: 0,
|
|
@@ -14344,7 +14511,7 @@ const Item = React__default.forwardRef((_ref, ref) => {
|
|
|
14344
14511
|
"aria-expanded": ariaExpanded,
|
|
14345
14512
|
"aria-controls": "moreMenuList",
|
|
14346
14513
|
"data-testid": btnId
|
|
14347
|
-
}, hasSvgIconShape && SvgIcon$
|
|
14514
|
+
}, hasSvgIconShape && SvgIcon$1(item.getSvgIconShape()), addAnchor && /*#__PURE__*/React__default.createElement("div", {
|
|
14348
14515
|
ref: ref,
|
|
14349
14516
|
style: {
|
|
14350
14517
|
bottom: -spacing,
|
|
@@ -14373,11 +14540,12 @@ const clearSelections = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
14373
14540
|
}
|
|
14374
14541
|
}]
|
|
14375
14542
|
});
|
|
14376
|
-
var ClearSelections = (props => SvgIcon$
|
|
14543
|
+
var ClearSelections = (props => SvgIcon$1(clearSelections(props)));
|
|
14377
14544
|
|
|
14378
14545
|
function useDefaultSelectionActions(_ref) {
|
|
14379
14546
|
let {
|
|
14380
14547
|
api,
|
|
14548
|
+
layout,
|
|
14381
14549
|
onConfirm = () => {},
|
|
14382
14550
|
onCancel = () => {},
|
|
14383
14551
|
onKeyDeactivate = () => {}
|
|
@@ -14389,14 +14557,14 @@ function useDefaultSelectionActions(_ref) {
|
|
|
14389
14557
|
key: 'clear',
|
|
14390
14558
|
type: 'icon-button',
|
|
14391
14559
|
label: translator.get('Selection.Clear'),
|
|
14392
|
-
enabled: () => api.canClear(),
|
|
14560
|
+
enabled: () => api.canClear(layout),
|
|
14393
14561
|
action: () => api.clear(),
|
|
14394
14562
|
getSvgIconShape: clearSelections
|
|
14395
14563
|
}, {
|
|
14396
14564
|
key: 'cancel',
|
|
14397
14565
|
type: 'icon-button',
|
|
14398
14566
|
label: translator.get('Selection.Cancel'),
|
|
14399
|
-
enabled: () => api.canCancel(),
|
|
14567
|
+
enabled: () => api.canCancel(layout),
|
|
14400
14568
|
action: () => {
|
|
14401
14569
|
onCancel();
|
|
14402
14570
|
api.cancel();
|
|
@@ -14411,7 +14579,7 @@ function useDefaultSelectionActions(_ref) {
|
|
|
14411
14579
|
key: 'confirm',
|
|
14412
14580
|
type: 'icon-button',
|
|
14413
14581
|
label: translator.get('Selection.Confirm'),
|
|
14414
|
-
enabled: () => api.canConfirm(),
|
|
14582
|
+
enabled: () => api.canConfirm(layout),
|
|
14415
14583
|
action: () => {
|
|
14416
14584
|
onConfirm();
|
|
14417
14585
|
api.confirm();
|
|
@@ -14432,7 +14600,7 @@ const ActionsToolbarMoreElement = {
|
|
|
14432
14600
|
const classes$8 = {
|
|
14433
14601
|
icon: "".concat(PREFIX$8, "-icon")
|
|
14434
14602
|
};
|
|
14435
|
-
const StyledPopover$1 = styled
|
|
14603
|
+
const StyledPopover$1 = styled(Popover)(_ref => {
|
|
14436
14604
|
let {
|
|
14437
14605
|
theme
|
|
14438
14606
|
} = _ref;
|
|
@@ -14467,7 +14635,7 @@ function MoreItem(_ref2) {
|
|
|
14467
14635
|
tabindex: "0"
|
|
14468
14636
|
}, hasSvgIconShape && /*#__PURE__*/React__default.createElement(ListItemIcon, {
|
|
14469
14637
|
className: classes$8.icon
|
|
14470
|
-
}, SvgIcon$
|
|
14638
|
+
}, SvgIcon$1(item.getSvgIconShape())), /*#__PURE__*/React__default.createElement(Typography, {
|
|
14471
14639
|
noWrap: true
|
|
14472
14640
|
}, item.label)) : null;
|
|
14473
14641
|
}
|
|
@@ -14516,7 +14684,7 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
|
|
|
14516
14684
|
}), /*#__PURE__*/React__default.createElement(MenuList, {
|
|
14517
14685
|
id: "moreMenuList"
|
|
14518
14686
|
}, actions.map((item, ix) =>
|
|
14519
|
-
|
|
14687
|
+
/*#__PURE__*/
|
|
14520
14688
|
// eslint-disable-next-line react/no-array-index-key
|
|
14521
14689
|
React__default.createElement(MoreItem, {
|
|
14522
14690
|
key: ix,
|
|
@@ -14546,7 +14714,8 @@ function getActionsKeyDownHandler(_ref) {
|
|
|
14546
14714
|
keyboardNavigation,
|
|
14547
14715
|
focusHandler,
|
|
14548
14716
|
getEnabledButton,
|
|
14549
|
-
selections
|
|
14717
|
+
selections,
|
|
14718
|
+
isRtl
|
|
14550
14719
|
} = _ref;
|
|
14551
14720
|
const handleActionsKeyDown = evt => {
|
|
14552
14721
|
const {
|
|
@@ -14565,7 +14734,8 @@ function getActionsKeyDownHandler(_ref) {
|
|
|
14565
14734
|
const isActionButton = target.classList.contains('njs-cell-action');
|
|
14566
14735
|
if (isActionButton) {
|
|
14567
14736
|
const index = getActionButtonIndex(target);
|
|
14568
|
-
|
|
14737
|
+
let pressedLeft = [KEYS.ARROW_LEFT, KEYS.ARROW_DOWN].includes(keyCode);
|
|
14738
|
+
pressedLeft = isRtl ? !pressedLeft : pressedLeft; // invert direction when using RTL
|
|
14569
14739
|
focusButton(pressedLeft ? index - 1 : index + 1);
|
|
14570
14740
|
}
|
|
14571
14741
|
evt.stopPropagation();
|
|
@@ -14604,7 +14774,7 @@ const classes$7 = {
|
|
|
14604
14774
|
item: "".concat(PREFIX$7, "-item"),
|
|
14605
14775
|
itemSpacing: "".concat(PREFIX$7, "-itemSpacing")
|
|
14606
14776
|
};
|
|
14607
|
-
const StyledPopover = styled
|
|
14777
|
+
const StyledPopover = styled(Popover)(_ref => {
|
|
14608
14778
|
let {
|
|
14609
14779
|
theme
|
|
14610
14780
|
} = _ref;
|
|
@@ -14670,6 +14840,7 @@ function ActionsToolbar(_ref3) {
|
|
|
14670
14840
|
onConfirm: () => {},
|
|
14671
14841
|
onCancel: () => {}
|
|
14672
14842
|
},
|
|
14843
|
+
extraItems,
|
|
14673
14844
|
more: more$1 = {
|
|
14674
14845
|
enabled: false,
|
|
14675
14846
|
actions: [],
|
|
@@ -14684,10 +14855,13 @@ function ActionsToolbar(_ref3) {
|
|
|
14684
14855
|
focusHandler = null,
|
|
14685
14856
|
actionsRefMock = null,
|
|
14686
14857
|
// for testing
|
|
14687
|
-
|
|
14688
|
-
autoConfirm = false
|
|
14858
|
+
isRtl,
|
|
14859
|
+
autoConfirm = false,
|
|
14860
|
+
layout
|
|
14689
14861
|
} = _ref3;
|
|
14690
|
-
const defaultSelectionActions = useDefaultSelectionActions(selections)
|
|
14862
|
+
const defaultSelectionActions = useDefaultSelectionActions(_objectSpread2(_objectSpread2({}, selections), {}, {
|
|
14863
|
+
layout
|
|
14864
|
+
}));
|
|
14691
14865
|
const {
|
|
14692
14866
|
translator,
|
|
14693
14867
|
keyboardNavigation
|
|
@@ -14713,8 +14887,9 @@ function ActionsToolbar(_ref3) {
|
|
|
14713
14887
|
keyboardNavigation,
|
|
14714
14888
|
focusHandler,
|
|
14715
14889
|
getEnabledButton,
|
|
14716
|
-
selections
|
|
14717
|
-
|
|
14890
|
+
selections,
|
|
14891
|
+
isRtl
|
|
14892
|
+
}), [keyboardNavigation, focusHandler, getEnabledButton, selections, isRtl]);
|
|
14718
14893
|
useEffect$1(() => () => {
|
|
14719
14894
|
setShowMoreItems(false);
|
|
14720
14895
|
}, [popover.show, show, selections.show]);
|
|
@@ -14722,11 +14897,11 @@ function ActionsToolbar(_ref3) {
|
|
|
14722
14897
|
if (!focusHandler) return;
|
|
14723
14898
|
const focusFirst = () => {
|
|
14724
14899
|
const enabledButton = getEnabledButton(false);
|
|
14725
|
-
enabledButton
|
|
14900
|
+
enabledButton === null || enabledButton === void 0 || enabledButton.focus();
|
|
14726
14901
|
};
|
|
14727
14902
|
const focusLast = () => {
|
|
14728
14903
|
const enabledButton = getEnabledButton(true);
|
|
14729
|
-
enabledButton
|
|
14904
|
+
enabledButton === null || enabledButton === void 0 || enabledButton.focus();
|
|
14730
14905
|
};
|
|
14731
14906
|
focusHandler.on('focus_toolbar_first', focusFirst);
|
|
14732
14907
|
focusHandler.on('focus_toolbar_last', focusLast);
|
|
@@ -14760,7 +14935,6 @@ function ActionsToolbar(_ref3) {
|
|
|
14760
14935
|
const showActions = newActions.length > 0;
|
|
14761
14936
|
const showMore = moreActions.length > 0;
|
|
14762
14937
|
const showDivider = showActions && selections.show || showMore && selections.show;
|
|
14763
|
-
const isRtl = direction === 'rtl';
|
|
14764
14938
|
const Actions = /*#__PURE__*/React__default.createElement(Grid, {
|
|
14765
14939
|
ref: actionsRef,
|
|
14766
14940
|
onKeyDown: handleActionsKeyDown,
|
|
@@ -14772,7 +14946,11 @@ function ActionsToolbar(_ref3) {
|
|
|
14772
14946
|
sx: {
|
|
14773
14947
|
flexDirection: isRtl ? 'row-reverse' : 'row'
|
|
14774
14948
|
}
|
|
14775
|
-
},
|
|
14949
|
+
}, (extraItems === null || extraItems === void 0 ? void 0 : extraItems.length) && /*#__PURE__*/React__default.createElement(ActionsGroup, {
|
|
14950
|
+
className: "actions-toolbar-extra-actions",
|
|
14951
|
+
actions: extraItems,
|
|
14952
|
+
isRtl: isRtl
|
|
14953
|
+
}), showActions && /*#__PURE__*/React__default.createElement(ActionsGroup, {
|
|
14776
14954
|
actions: newActions
|
|
14777
14955
|
}), showMore && /*#__PURE__*/React__default.createElement(ActionsGroup, {
|
|
14778
14956
|
id: "actions-toolbar-show-more",
|
|
@@ -14831,11 +15009,11 @@ const search = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
14831
15009
|
}
|
|
14832
15010
|
}]
|
|
14833
15011
|
});
|
|
14834
|
-
var SearchIcon = (props => SvgIcon$
|
|
15012
|
+
var SearchIcon = (props => SvgIcon$1(search(props)));
|
|
14835
15013
|
|
|
14836
15014
|
const TREE_PATH = '/qListObjectDef';
|
|
14837
15015
|
const WILDCARD = '**';
|
|
14838
|
-
const StyledOutlinedInput = styled
|
|
15016
|
+
const StyledOutlinedInput = styled(OutlinedInput, {
|
|
14839
15017
|
shouldForwardProp: p => !['styles', 'dense', 'isRtl'].includes(p)
|
|
14840
15018
|
})(_ref => {
|
|
14841
15019
|
let {
|
|
@@ -14974,7 +15152,7 @@ function ListBoxSearch(_ref2) {
|
|
|
14974
15152
|
};
|
|
14975
15153
|
function focusRow(container) {
|
|
14976
15154
|
const row = (container === null || container === void 0 ? void 0 : container.querySelector('.last-focused')) || (container === null || container === void 0 ? void 0 : container.querySelector('[role="row"]:first-child'));
|
|
14977
|
-
row.setAttribute('tabIndex', 0);
|
|
15155
|
+
row === null || row === void 0 || row.setAttribute('tabIndex', 0);
|
|
14978
15156
|
row === null || row === void 0 || row.focus();
|
|
14979
15157
|
}
|
|
14980
15158
|
const onKeyDown = async e => {
|
|
@@ -17494,6 +17672,11 @@ function getSearchColor(getListboxStyle) {
|
|
|
17494
17672
|
const color = getContrastingColor('#fff', desiredTextColor);
|
|
17495
17673
|
return color;
|
|
17496
17674
|
}
|
|
17675
|
+
function getSearchBGColor(bgCol, getListboxStyle) {
|
|
17676
|
+
const searchBgColorObj = new Color(getListboxStyle('', 'backgroundColor'));
|
|
17677
|
+
searchBgColorObj.setAlpha(0.7);
|
|
17678
|
+
return searchBgColorObj.isInvalid() ? bgCol : searchBgColorObj.toRGBA();
|
|
17679
|
+
}
|
|
17497
17680
|
function getStyles(_ref3) {
|
|
17498
17681
|
var _themeOverrides$heade, _themeOverrides$backg, _themeOverrides$heade2, _themeOverrides$conte, _themeOverrides$heade3, _themeOverrides$heade4, _themeOverrides$conte2, _themeOverrides$conte3;
|
|
17499
17682
|
let {
|
|
@@ -17522,7 +17705,8 @@ function getStyles(_ref3) {
|
|
|
17522
17705
|
const bgImage = (_themeOverrides$backg = themeOverrides.background) !== null && _themeOverrides$backg !== void 0 && _themeOverrides$backg.image ? resolveBgImage({
|
|
17523
17706
|
bgImage: themeOverrides.background.image
|
|
17524
17707
|
}, app) : undefined;
|
|
17525
|
-
const
|
|
17708
|
+
const bgColor = bgComponentColor || getListboxStyle('', 'backgroundColor') || theme.palette.background.default;
|
|
17709
|
+
const searchBgColor = getSearchBGColor(bgColor, getListboxStyle);
|
|
17526
17710
|
const searchColor = getSearchColor(getListboxStyle);
|
|
17527
17711
|
const headerFontStyle = ((_themeOverrides$heade2 = themeOverrides.header) === null || _themeOverrides$heade2 === void 0 ? void 0 : _themeOverrides$heade2.fontStyle) || {};
|
|
17528
17712
|
const contentFontStyle = ((_themeOverrides$conte = themeOverrides.content) === null || _themeOverrides$conte === void 0 ? void 0 : _themeOverrides$conte.fontStyle) || {};
|
|
@@ -17531,7 +17715,7 @@ function getStyles(_ref3) {
|
|
|
17531
17715
|
const getWithFallback = (value, trueValue, falseValue) => value === true && trueValue || value === false && falseValue || undefined;
|
|
17532
17716
|
return {
|
|
17533
17717
|
background: {
|
|
17534
|
-
backgroundColor:
|
|
17718
|
+
backgroundColor: bgColor,
|
|
17535
17719
|
backgroundImage: bgImage !== null && bgImage !== void 0 && bgImage.url && !(bgImage !== null && bgImage !== void 0 && bgImage.url.startsWith('url(')) ? "url('".concat(bgImage.url, "')") : undefined,
|
|
17536
17720
|
backgroundRepeat: 'no-repeat',
|
|
17537
17721
|
backgroundSize: bgImage === null || bgImage === void 0 ? void 0 : bgImage.size,
|
|
@@ -17672,9 +17856,11 @@ function ListBoxPopover(_ref) {
|
|
|
17672
17856
|
anchorEl: alignTo.current,
|
|
17673
17857
|
anchorOrigin: anchorOrigin,
|
|
17674
17858
|
transformOrigin: transformOrigin,
|
|
17675
|
-
|
|
17676
|
-
|
|
17677
|
-
|
|
17859
|
+
slotProps: {
|
|
17860
|
+
paper: {
|
|
17861
|
+
style: {
|
|
17862
|
+
minWidth: '250px'
|
|
17863
|
+
}
|
|
17678
17864
|
}
|
|
17679
17865
|
}
|
|
17680
17866
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -17708,6 +17894,7 @@ function ListBoxPopover(_ref) {
|
|
|
17708
17894
|
}), /*#__PURE__*/React__default.createElement(Grid, {
|
|
17709
17895
|
item: true
|
|
17710
17896
|
}, /*#__PURE__*/React__default.createElement(ActionsToolbar, {
|
|
17897
|
+
layout: layout,
|
|
17711
17898
|
more: {
|
|
17712
17899
|
enabled: !isLocked,
|
|
17713
17900
|
actions: listboxSelectionToolbarItems,
|
|
@@ -17931,13 +18118,13 @@ const downArrow = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
17931
18118
|
}
|
|
17932
18119
|
}]
|
|
17933
18120
|
});
|
|
17934
|
-
var DownArrow = (props => SvgIcon$
|
|
18121
|
+
var DownArrow = (props => SvgIcon$1(downArrow(props)));
|
|
17935
18122
|
|
|
17936
18123
|
const PREFIX$6 = 'MultiState';
|
|
17937
18124
|
const classes$6 = {
|
|
17938
18125
|
item: "".concat(PREFIX$6, "-item")
|
|
17939
18126
|
};
|
|
17940
|
-
const StyledGrid$5 = styled
|
|
18127
|
+
const StyledGrid$5 = styled(Grid)(_ref => {
|
|
17941
18128
|
let {
|
|
17942
18129
|
theme
|
|
17943
18130
|
} = _ref;
|
|
@@ -18037,7 +18224,7 @@ function MultiState(_ref2) {
|
|
|
18037
18224
|
variant: "contained",
|
|
18038
18225
|
fullWidth: true
|
|
18039
18226
|
}, clearAllStates)), field.states.map((s, ix) =>
|
|
18040
|
-
|
|
18227
|
+
/*#__PURE__*/
|
|
18041
18228
|
// eslint-disable-next-line react/no-array-index-key
|
|
18042
18229
|
React__default.createElement(ListItem, {
|
|
18043
18230
|
key: ix,
|
|
@@ -18102,7 +18289,7 @@ const classes$5 = {
|
|
|
18102
18289
|
item: "".concat(PREFIX$5, "-item"),
|
|
18103
18290
|
badge: "".concat(PREFIX$5, "-badge")
|
|
18104
18291
|
};
|
|
18105
|
-
const StyledGrid$4 = styled
|
|
18292
|
+
const StyledGrid$4 = styled(Grid)(_ref => {
|
|
18106
18293
|
let {
|
|
18107
18294
|
theme
|
|
18108
18295
|
} = _ref;
|
|
@@ -18215,7 +18402,7 @@ function More(_ref2) {
|
|
|
18215
18402
|
}, /*#__PURE__*/React__default.createElement(List, {
|
|
18216
18403
|
dense: true
|
|
18217
18404
|
}, items.map((s, ix) =>
|
|
18218
|
-
|
|
18405
|
+
/*#__PURE__*/
|
|
18219
18406
|
// eslint-disable-next-line react/no-array-index-key
|
|
18220
18407
|
React__default.createElement(ListItem, {
|
|
18221
18408
|
key: ix,
|
|
@@ -18373,7 +18560,7 @@ const selectionsBack = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
18373
18560
|
}
|
|
18374
18561
|
}]
|
|
18375
18562
|
});
|
|
18376
|
-
var SelectionsBack = (props => SvgIcon$
|
|
18563
|
+
var SelectionsBack = (props => SvgIcon$1(selectionsBack(props)));
|
|
18377
18564
|
|
|
18378
18565
|
const selectionsForward = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
18379
18566
|
shapes: [{
|
|
@@ -18383,7 +18570,7 @@ const selectionsForward = props => _objectSpread2(_objectSpread2({}, props), {},
|
|
|
18383
18570
|
}
|
|
18384
18571
|
}]
|
|
18385
18572
|
});
|
|
18386
|
-
var SelectionsForward = (props => SvgIcon$
|
|
18573
|
+
var SelectionsForward = (props => SvgIcon$1(selectionsForward(props)));
|
|
18387
18574
|
|
|
18388
18575
|
const patchAlternateState = (currentSelectionsModel, currentSelectionsLayout, appLayout) => {
|
|
18389
18576
|
const states = [...(appLayout.qStateNames || [])].map(s => ({
|
|
@@ -18769,16 +18956,15 @@ class AutoSizer extends Component {
|
|
|
18769
18956
|
onResize
|
|
18770
18957
|
} = this.props;
|
|
18771
18958
|
if (this._parentNode) {
|
|
18772
|
-
var _style$paddingLeft, _style$paddingRight, _style$paddingTop, _style$paddingBottom;
|
|
18773
18959
|
// Guard against AutoSizer component being removed from the DOM immediately after being added.
|
|
18774
18960
|
// This can result in invalid style values which can result in NaN values if we don't handle them.
|
|
18775
18961
|
// See issue #150 for more context.
|
|
18776
18962
|
|
|
18777
18963
|
const style = window.getComputedStyle(this._parentNode) || {};
|
|
18778
|
-
const paddingLeft = parseFloat(
|
|
18779
|
-
const paddingRight = parseFloat(
|
|
18780
|
-
const paddingTop = parseFloat(
|
|
18781
|
-
const paddingBottom = parseFloat(
|
|
18964
|
+
const paddingLeft = parseFloat(style.paddingLeft || "0");
|
|
18965
|
+
const paddingRight = parseFloat(style.paddingRight || "0");
|
|
18966
|
+
const paddingTop = parseFloat(style.paddingTop || "0");
|
|
18967
|
+
const paddingBottom = parseFloat(style.paddingBottom || "0");
|
|
18782
18968
|
const rect = this._parentNode.getBoundingClientRect();
|
|
18783
18969
|
const scaledHeight = rect.height - paddingTop - paddingBottom;
|
|
18784
18970
|
const scaledWidth = rect.width - paddingLeft - paddingRight;
|
|
@@ -18907,16 +19093,6 @@ class AutoSizer extends Component {
|
|
|
18907
19093
|
}
|
|
18908
19094
|
}
|
|
18909
19095
|
|
|
18910
|
-
const drillDown = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
18911
|
-
shapes: [{
|
|
18912
|
-
type: 'path',
|
|
18913
|
-
attrs: {
|
|
18914
|
-
d: 'M15.9993744,3 L15.9993744,5 L4.99937445,5 L4.99937445,3 L15.9993744,3 Z M8.99937445,7 L15.9993744,7 L15.9993744,9 L8.99937445,9 L8.99937445,7 Z M11.9993744,11 L15.9993744,11 L15.9993744,13 L11.9993744,13 L11.9993744,11 Z M2.2,11 L7,11 L7,9.00369263 C7,8.89323568 7.08954305,8.80369263 7.2,8.80369263 C7.2549016,8.80369263 7.30738916,8.82626165 7.34515712,8.86610844 L10.1852182,11.8624926 C10.2583124,11.93961 10.258346,12.0604218 10.1852948,12.13758 L7.34523376,15.1373102 C7.2692928,15.2175206 7.14270711,15.2209817 7.06249671,15.1450407 C7.02260076,15.1072683 7,15.0547472 7,14.9998069 L7,12.9043747 C4.79351111,12.9043747 2.8018683,12.9266213 1.02507156,12.9711145 L1.02507252,12.9711526 C0.472939773,12.9849787 0.014139487,12.5485949 0.000313396522,11.9964622 C0.000104473692,11.988119 -1.32268838e-12,11.9797736 -1.3231638e-12,11.9714278 L-1.83320026e-12,3 L2,3 L2,10.8 C2,10.9104569 2.08954305,11 2.2,11 Z'
|
|
18915
|
-
}
|
|
18916
|
-
}]
|
|
18917
|
-
});
|
|
18918
|
-
var DrillDownIcon = (props => SvgIcon$2(drillDown(props)));
|
|
18919
|
-
|
|
18920
19096
|
function removeInnnerTabStops(container) {
|
|
18921
19097
|
container === null || container === void 0 || container.querySelectorAll('[tabIndex="0"]').forEach(elm => {
|
|
18922
19098
|
elm.setAttribute('tabIndex', -1);
|
|
@@ -18970,14 +19146,17 @@ function useTempKeyboard(_ref) {
|
|
|
18970
19146
|
const lastSelectedRow = c === null || c === void 0 ? void 0 : c.querySelector('.value.last-focused');
|
|
18971
19147
|
const firstRowElement = c === null || c === void 0 ? void 0 : c.querySelector('.value.selector, .value');
|
|
18972
19148
|
const confirmButton = c === null || c === void 0 ? void 0 : c.querySelector('.actions-toolbar-default-actions .actions-toolbar-confirm');
|
|
18973
|
-
const
|
|
19149
|
+
const unlockCoverButton = c === null || c === void 0 ? void 0 : c.querySelector('#listbox-unlock-button');
|
|
19150
|
+
const elementToFocus = searchField || lastSelectedRow || firstRowElement || unlockCoverButton || confirmButton;
|
|
18974
19151
|
elementToFocus === null || elementToFocus === void 0 || elementToFocus.setAttribute('tabIndex', 0);
|
|
18975
19152
|
elementToFocus === null || elementToFocus === void 0 || elementToFocus.focus();
|
|
18976
19153
|
},
|
|
18977
19154
|
focusSelection() {
|
|
19155
|
+
const unlockCoverButton = document.querySelector('#listbox-unlock-button');
|
|
18978
19156
|
const confirmButton = document.querySelector('.actions-toolbar-default-actions .actions-toolbar-confirm');
|
|
18979
|
-
|
|
18980
|
-
|
|
19157
|
+
const btnToFocus = unlockCoverButton || confirmButton;
|
|
19158
|
+
btnToFocus === null || btnToFocus === void 0 || btnToFocus.setAttribute('tabIndex', 0);
|
|
19159
|
+
btnToFocus === null || btnToFocus === void 0 || btnToFocus.focus();
|
|
18981
19160
|
}
|
|
18982
19161
|
};
|
|
18983
19162
|
return keyboard;
|
|
@@ -19133,18 +19312,79 @@ function getListboxContainerKeyboardNavigation(_ref) {
|
|
|
19133
19312
|
};
|
|
19134
19313
|
}
|
|
19135
19314
|
|
|
19315
|
+
const StyledDiv = styled('div')(() => ({
|
|
19316
|
+
display: 'flex',
|
|
19317
|
+
width: '100%',
|
|
19318
|
+
height: '100%',
|
|
19319
|
+
alignItems: 'center',
|
|
19320
|
+
justifyContent: 'center'
|
|
19321
|
+
}));
|
|
19322
|
+
function ListBoxError(_ref) {
|
|
19323
|
+
let {
|
|
19324
|
+
text
|
|
19325
|
+
} = _ref;
|
|
19326
|
+
const {
|
|
19327
|
+
translator: translatorDynamic
|
|
19328
|
+
} = useContext(InstanceContext);
|
|
19329
|
+
return /*#__PURE__*/React__default.createElement(StyledDiv, null, translatorDynamic.get(text));
|
|
19330
|
+
}
|
|
19331
|
+
|
|
19332
|
+
function isDirectQueryEnabled(_ref) {
|
|
19333
|
+
let {
|
|
19334
|
+
appLayout
|
|
19335
|
+
} = _ref;
|
|
19336
|
+
const isDQ = !!(appLayout !== null && appLayout !== void 0 && appLayout.qIsDirectQueryMode);
|
|
19337
|
+
return isDQ;
|
|
19338
|
+
}
|
|
19339
|
+
|
|
19340
|
+
function getContainerPadding(_ref) {
|
|
19341
|
+
let {
|
|
19342
|
+
isGridMode,
|
|
19343
|
+
dense,
|
|
19344
|
+
height,
|
|
19345
|
+
layoutOrder
|
|
19346
|
+
} = _ref;
|
|
19347
|
+
let containerPadding;
|
|
19348
|
+
if (isGridMode) {
|
|
19349
|
+
const itemHeight = getItemHeight({
|
|
19350
|
+
isGridMode,
|
|
19351
|
+
dense
|
|
19352
|
+
});
|
|
19353
|
+
let paddingY;
|
|
19354
|
+
if (itemHeight > height) {
|
|
19355
|
+
paddingY = '0px';
|
|
19356
|
+
} else {
|
|
19357
|
+
paddingY = '2px';
|
|
19358
|
+
}
|
|
19359
|
+
containerPadding = layoutOrder === 'row' ? "".concat(paddingY, " 4px") : "".concat(paddingY, " 6px ").concat(paddingY, " 4px");
|
|
19360
|
+
} else {
|
|
19361
|
+
containerPadding = undefined;
|
|
19362
|
+
}
|
|
19363
|
+
return containerPadding;
|
|
19364
|
+
}
|
|
19365
|
+
|
|
19366
|
+
const drillDown = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
19367
|
+
shapes: [{
|
|
19368
|
+
type: 'path',
|
|
19369
|
+
attrs: {
|
|
19370
|
+
d: 'M15.9993744,3 L15.9993744,5 L4.99937445,5 L4.99937445,3 L15.9993744,3 Z M8.99937445,7 L15.9993744,7 L15.9993744,9 L8.99937445,9 L8.99937445,7 Z M11.9993744,11 L15.9993744,11 L15.9993744,13 L11.9993744,13 L11.9993744,11 Z M2.2,11 L7,11 L7,9.00369263 C7,8.89323568 7.08954305,8.80369263 7.2,8.80369263 C7.2549016,8.80369263 7.30738916,8.82626165 7.34515712,8.86610844 L10.1852182,11.8624926 C10.2583124,11.93961 10.258346,12.0604218 10.1852948,12.13758 L7.34523376,15.1373102 C7.2692928,15.2175206 7.14270711,15.2209817 7.06249671,15.1450407 C7.02260076,15.1072683 7,15.0547472 7,14.9998069 L7,12.9043747 C4.79351111,12.9043747 2.8018683,12.9266213 1.02507156,12.9711145 L1.02507252,12.9711526 C0.472939773,12.9849787 0.014139487,12.5485949 0.000313396522,11.9964622 C0.000104473692,11.988119 -1.32268838e-12,11.9797736 -1.3231638e-12,11.9714278 L-1.83320026e-12,3 L2,3 L2,10.8 C2,10.9104569 2.08954305,11 2.2,11 Z'
|
|
19371
|
+
}
|
|
19372
|
+
}]
|
|
19373
|
+
});
|
|
19374
|
+
var DrillDownIcon = (props => SvgIcon$1(drillDown(props)));
|
|
19375
|
+
|
|
19136
19376
|
function showToolbarDetached(_ref) {
|
|
19137
19377
|
var _titleRef$current$cli, _titleRef$current, _titleRef$current2, _titleRef$current3;
|
|
19138
19378
|
let {
|
|
19139
19379
|
containerRect,
|
|
19140
19380
|
titleRef,
|
|
19141
19381
|
iconsWidth,
|
|
19142
|
-
|
|
19143
|
-
|
|
19382
|
+
paddingLeft,
|
|
19383
|
+
paddingRight
|
|
19144
19384
|
} = _ref;
|
|
19145
19385
|
const containerWidth = containerRect.width;
|
|
19146
19386
|
const preventTruncation = 2;
|
|
19147
|
-
const padding =
|
|
19387
|
+
const padding = paddingLeft + paddingRight;
|
|
19148
19388
|
const contentWidth = ((_titleRef$current$cli = titleRef === null || titleRef === void 0 || (_titleRef$current = titleRef.current) === null || _titleRef$current === void 0 ? void 0 : _titleRef$current.clientWidth) !== null && _titleRef$current$cli !== void 0 ? _titleRef$current$cli : 0) + iconsWidth + padding + preventTruncation;
|
|
19149
19389
|
const actionToolbarWidth = 128;
|
|
19150
19390
|
const notSufficientSpace = containerWidth < contentWidth + actionToolbarWidth;
|
|
@@ -19160,15 +19400,18 @@ function getListboxActionProps(_ref) {
|
|
|
19160
19400
|
containerRef,
|
|
19161
19401
|
isLocked,
|
|
19162
19402
|
listboxSelectionToolbarItems,
|
|
19403
|
+
extraItems,
|
|
19163
19404
|
selections,
|
|
19164
19405
|
keyboard
|
|
19165
19406
|
} = _ref;
|
|
19166
19407
|
return {
|
|
19408
|
+
isDetached,
|
|
19167
19409
|
show: showToolbar && !isDetached,
|
|
19168
19410
|
popover: {
|
|
19169
19411
|
show: showToolbar && isDetached,
|
|
19170
19412
|
anchorEl: containerRef.current
|
|
19171
19413
|
},
|
|
19414
|
+
extraItems,
|
|
19172
19415
|
more: {
|
|
19173
19416
|
enabled: !isLocked,
|
|
19174
19417
|
actions: listboxSelectionToolbarItems,
|
|
@@ -19193,55 +19436,293 @@ function getListboxActionProps(_ref) {
|
|
|
19193
19436
|
};
|
|
19194
19437
|
}
|
|
19195
19438
|
|
|
19196
|
-
const
|
|
19197
|
-
|
|
19198
|
-
|
|
19199
|
-
|
|
19200
|
-
alignItems: 'center',
|
|
19201
|
-
justifyContent: 'center'
|
|
19202
|
-
}));
|
|
19203
|
-
function ListBoxError(_ref) {
|
|
19439
|
+
const iconStyle = {
|
|
19440
|
+
fontSize: '12px'
|
|
19441
|
+
};
|
|
19442
|
+
const UnlockButton = styled(ButtonBase)(_ref => {
|
|
19204
19443
|
let {
|
|
19205
|
-
|
|
19444
|
+
theme,
|
|
19445
|
+
isLoading
|
|
19206
19446
|
} = _ref;
|
|
19207
|
-
|
|
19208
|
-
|
|
19209
|
-
|
|
19210
|
-
|
|
19211
|
-
|
|
19212
|
-
|
|
19213
|
-
|
|
19447
|
+
return {
|
|
19448
|
+
position: 'absolute',
|
|
19449
|
+
top: 0,
|
|
19450
|
+
left: 0,
|
|
19451
|
+
height: 48,
|
|
19452
|
+
zIndex: 2,
|
|
19453
|
+
// so it goes on top of action buttons
|
|
19454
|
+
background: theme.palette.custom.disabledBackground,
|
|
19455
|
+
opacity: 1,
|
|
19456
|
+
color: theme.palette.custom.disabledContrastText,
|
|
19457
|
+
width: '100%',
|
|
19458
|
+
display: 'flex',
|
|
19459
|
+
justifyContent: isLoading ? 'center' : 'flex-start',
|
|
19460
|
+
paddingLeft: 16,
|
|
19461
|
+
paddingRight: 16,
|
|
19462
|
+
borderRadius: 0,
|
|
19463
|
+
'& *, & p': {
|
|
19464
|
+
color: theme.palette.custom.disabledContrastText
|
|
19465
|
+
},
|
|
19466
|
+
'& i': {
|
|
19467
|
+
padding: "".concat(ICON_PADDING, "px")
|
|
19468
|
+
}
|
|
19469
|
+
};
|
|
19470
|
+
});
|
|
19471
|
+
const StyledGridHeader = styled(Grid, {
|
|
19472
|
+
shouldForwardProp: p => !['styles', 'isRtl'].includes(p)
|
|
19473
|
+
})(_ref2 => {
|
|
19214
19474
|
let {
|
|
19215
|
-
|
|
19216
|
-
|
|
19217
|
-
|
|
19218
|
-
return
|
|
19475
|
+
styles,
|
|
19476
|
+
isRtl
|
|
19477
|
+
} = _ref2;
|
|
19478
|
+
return _objectSpread2(_objectSpread2({
|
|
19479
|
+
flexDirection: isRtl ? 'row-reverse' : 'row',
|
|
19480
|
+
wrap: 'nowrap',
|
|
19481
|
+
minHeight: 32,
|
|
19482
|
+
alignContent: 'center'
|
|
19483
|
+
}, styles.header), {}, {
|
|
19484
|
+
'& *': {
|
|
19485
|
+
color: styles.header.color
|
|
19486
|
+
}
|
|
19487
|
+
});
|
|
19488
|
+
});
|
|
19489
|
+
const HeaderTitle = styled(Typography)(_ref3 => {
|
|
19490
|
+
let {
|
|
19491
|
+
styles
|
|
19492
|
+
} = _ref3;
|
|
19493
|
+
return _objectSpread2(_objectSpread2({}, styles.header), {}, {
|
|
19494
|
+
display: 'block',
|
|
19495
|
+
// needed for text-overflow to work
|
|
19496
|
+
alignItems: 'center',
|
|
19497
|
+
paddingRight: '1px' // make place for italic font style
|
|
19498
|
+
});
|
|
19499
|
+
});
|
|
19500
|
+
function UnlockCoverButton(_ref4) {
|
|
19501
|
+
let {
|
|
19502
|
+
translator,
|
|
19503
|
+
toggleLock,
|
|
19504
|
+
keyboard,
|
|
19505
|
+
isLoading
|
|
19506
|
+
} = _ref4;
|
|
19507
|
+
const fontSize = '14px';
|
|
19508
|
+
const unLockText = translator.get('SelectionToolbar.ClickToUnlock');
|
|
19509
|
+
const component = /*#__PURE__*/React__default.createElement(UnlockButton, {
|
|
19510
|
+
title: unLockText,
|
|
19511
|
+
tabIndex: keyboard.enabled ? 0 : -1,
|
|
19512
|
+
onClick: toggleLock,
|
|
19513
|
+
"data-testid": "listbox-unlock-button",
|
|
19514
|
+
id: "listbox-unlock-button",
|
|
19515
|
+
isLoading: isLoading
|
|
19516
|
+
}, isLoading ? /*#__PURE__*/React__default.createElement(CircularProgress, {
|
|
19517
|
+
size: 16,
|
|
19518
|
+
variant: "indeterminate",
|
|
19519
|
+
color: "primary"
|
|
19520
|
+
}) : /*#__PURE__*/React__default.createElement(Lock, {
|
|
19521
|
+
disableRipple: true,
|
|
19522
|
+
style: iconStyle
|
|
19523
|
+
}), !isLoading && /*#__PURE__*/React__default.createElement(Typography, {
|
|
19524
|
+
fontSize: fontSize
|
|
19525
|
+
}, unLockText));
|
|
19526
|
+
return component;
|
|
19219
19527
|
}
|
|
19220
19528
|
|
|
19221
|
-
|
|
19529
|
+
// ms that needs to pass before the lock button can be toggled again
|
|
19530
|
+
const lockTimeFrameMs = 500;
|
|
19531
|
+
let lastTime = 0;
|
|
19532
|
+
function getToggleLock(_ref) {
|
|
19222
19533
|
let {
|
|
19223
|
-
|
|
19224
|
-
|
|
19225
|
-
|
|
19226
|
-
|
|
19534
|
+
isLocked,
|
|
19535
|
+
setLocked,
|
|
19536
|
+
settingLockedState,
|
|
19537
|
+
model,
|
|
19538
|
+
setSettingLockedState
|
|
19227
19539
|
} = _ref;
|
|
19228
|
-
|
|
19229
|
-
|
|
19230
|
-
const
|
|
19231
|
-
|
|
19232
|
-
|
|
19540
|
+
return () => {
|
|
19541
|
+
const now = new Date();
|
|
19542
|
+
const curTime = now - lastTime;
|
|
19543
|
+
if (curTime < lockTimeFrameMs) {
|
|
19544
|
+
return Promise.resolve();
|
|
19545
|
+
}
|
|
19546
|
+
if (settingLockedState) {
|
|
19547
|
+
return () => {};
|
|
19548
|
+
}
|
|
19549
|
+
setSettingLockedState(true);
|
|
19550
|
+
lastTime = now;
|
|
19551
|
+
const func = isLocked ? model.unlock : model.lock;
|
|
19552
|
+
setLocked(!isLocked);
|
|
19553
|
+
return func.call(model, '/qListObjectDef').catch(() => {
|
|
19554
|
+
setLocked(isLocked); // revert to the layout value
|
|
19555
|
+
}).finally(() => {
|
|
19556
|
+
setTimeout(() => {
|
|
19557
|
+
setSettingLockedState(false);
|
|
19558
|
+
}, 0);
|
|
19233
19559
|
});
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
|
|
19560
|
+
};
|
|
19561
|
+
}
|
|
19562
|
+
function ListBoxHeader(_ref2) {
|
|
19563
|
+
var _layout$qListObject, _layout$qListObject3;
|
|
19564
|
+
let {
|
|
19565
|
+
layout,
|
|
19566
|
+
translator,
|
|
19567
|
+
styles,
|
|
19568
|
+
isRtl,
|
|
19569
|
+
showLock,
|
|
19570
|
+
selectDisabled,
|
|
19571
|
+
showSearchIcon,
|
|
19572
|
+
isDrillDown,
|
|
19573
|
+
constraints,
|
|
19574
|
+
onShowSearch,
|
|
19575
|
+
classes,
|
|
19576
|
+
containerRect,
|
|
19577
|
+
isPopover,
|
|
19578
|
+
showToolbar,
|
|
19579
|
+
showDetachedToolbarOnly,
|
|
19580
|
+
containerRef,
|
|
19581
|
+
model,
|
|
19582
|
+
selectionState,
|
|
19583
|
+
isDirectQuery,
|
|
19584
|
+
selections,
|
|
19585
|
+
keyboard,
|
|
19586
|
+
autoConfirm
|
|
19587
|
+
} = _ref2;
|
|
19588
|
+
const [isToolbarDetached, setIsToolbarDetached] = useState$1(showDetachedToolbarOnly);
|
|
19589
|
+
const [isLocked, setLocked] = useState$1(layout === null || layout === void 0 || (_layout$qListObject = layout.qListObject) === null || _layout$qListObject === void 0 || (_layout$qListObject = _layout$qListObject.qDimensionInfo) === null || _layout$qListObject === void 0 ? void 0 : _layout$qListObject.qLocked);
|
|
19590
|
+
const [settingLockedState, setSettingLockedState] = useState$1(false);
|
|
19591
|
+
useEffect$1(() => {
|
|
19592
|
+
var _layout$qListObject2;
|
|
19593
|
+
setLocked(layout === null || layout === void 0 || (_layout$qListObject2 = layout.qListObject) === null || _layout$qListObject2 === void 0 || (_layout$qListObject2 = _layout$qListObject2.qDimensionInfo) === null || _layout$qListObject2 === void 0 ? void 0 : _layout$qListObject2.qLocked);
|
|
19594
|
+
}, [layout === null || layout === void 0 || (_layout$qListObject3 = layout.qListObject) === null || _layout$qListObject3 === void 0 || (_layout$qListObject3 = _layout$qListObject3.qDimensionInfo) === null || _layout$qListObject3 === void 0 ? void 0 : _layout$qListObject3.qLocked]);
|
|
19595
|
+
const titleRef = useRef(null);
|
|
19596
|
+
const showUnlock = showLock && isLocked;
|
|
19597
|
+
const showLockIcon = !showLock && isLocked; // shows instead of the cover button when field/dim is locked.
|
|
19598
|
+
const showLeftIcon = showSearchIcon || showLockIcon || isDrillDown; // the left-most icon outside of the actions/selections toolbar.
|
|
19599
|
+
|
|
19600
|
+
const paddingLeft = CELL_PADDING_LEFT - (showLeftIcon ? ICON_PADDING : 0);
|
|
19601
|
+
const paddingRight = isRtl ? CELL_PADDING_LEFT - (showLeftIcon ? ICON_PADDING : 0) : HEADER_PADDING_RIGHT;
|
|
19602
|
+
|
|
19603
|
+
// Calculate explicit width for icons container. Search and lock cannot exist combined.
|
|
19604
|
+
const iconsWidth = (showSearchIcon ? BUTTON_ICON_WIDTH : 0) + (showLockIcon ? BUTTON_ICON_WIDTH : 0) + (isDrillDown ? BUTTON_ICON_WIDTH : 0);
|
|
19605
|
+
const toggleLock = getToggleLock({
|
|
19606
|
+
isLocked,
|
|
19607
|
+
setLocked,
|
|
19608
|
+
settingLockedState,
|
|
19609
|
+
setSettingLockedState,
|
|
19610
|
+
model
|
|
19611
|
+
});
|
|
19612
|
+
const listboxSelectionToolbarItems = createListboxSelectionToolbar({
|
|
19613
|
+
layout,
|
|
19614
|
+
model,
|
|
19615
|
+
translator,
|
|
19616
|
+
selectionState,
|
|
19617
|
+
isDirectQuery
|
|
19618
|
+
});
|
|
19619
|
+
const extraItems = isLocked || !showLock ? undefined : [{
|
|
19620
|
+
key: 'lock',
|
|
19621
|
+
type: undefined,
|
|
19622
|
+
label: translator.get('SelectionToolbar.ClickToLock'),
|
|
19623
|
+
getSvgIconShape: unlock,
|
|
19624
|
+
enabled: () => !settingLockedState && !selectDisabled() && hasSelections(layout),
|
|
19625
|
+
action: toggleLock
|
|
19626
|
+
}];
|
|
19627
|
+
const searchIconComp = constraints !== null && constraints !== void 0 && constraints.active ? /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
19628
|
+
title: translator.get('Listbox.Search'),
|
|
19629
|
+
size: "large",
|
|
19630
|
+
style: _objectSpread2(_objectSpread2({}, iconStyle), {}, {
|
|
19631
|
+
padding: "".concat(ICON_PADDING, "px")
|
|
19632
|
+
})
|
|
19633
|
+
}) : /*#__PURE__*/React__default.createElement(IconButton, {
|
|
19634
|
+
onClick: onShowSearch,
|
|
19635
|
+
tabIndex: -1,
|
|
19636
|
+
title: translator.get('Listbox.Search'),
|
|
19637
|
+
size: "large",
|
|
19638
|
+
disableRipple: true,
|
|
19639
|
+
"data-testid": "search-toggle-btn"
|
|
19640
|
+
}, /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
19641
|
+
style: iconStyle
|
|
19642
|
+
}));
|
|
19643
|
+
useEffect$1(() => {
|
|
19644
|
+
if (!titleRef.current || !containerRect) {
|
|
19645
|
+
return;
|
|
19239
19646
|
}
|
|
19240
|
-
|
|
19241
|
-
|
|
19242
|
-
|
|
19647
|
+
const mustShowDetached = showToolbarDetached({
|
|
19648
|
+
containerRect,
|
|
19649
|
+
titleRef,
|
|
19650
|
+
iconsWidth,
|
|
19651
|
+
paddingLeft,
|
|
19652
|
+
paddingRight
|
|
19653
|
+
});
|
|
19654
|
+
const isDetached = showDetachedToolbarOnly || mustShowDetached;
|
|
19655
|
+
setIsToolbarDetached(isDetached);
|
|
19656
|
+
}, [iconsWidth, paddingLeft, paddingRight, titleRef.current, showDetachedToolbarOnly, Object.entries(containerRect || {}).sort().join(',')]);
|
|
19657
|
+
const toolbarProps = getListboxActionProps({
|
|
19658
|
+
isDetached: isPopover ? false : isToolbarDetached,
|
|
19659
|
+
showToolbar,
|
|
19660
|
+
containerRef,
|
|
19661
|
+
isLocked,
|
|
19662
|
+
extraItems,
|
|
19663
|
+
listboxSelectionToolbarItems,
|
|
19664
|
+
selections,
|
|
19665
|
+
keyboard,
|
|
19666
|
+
autoConfirm
|
|
19667
|
+
});
|
|
19668
|
+
const actionsToolbar = /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$5({
|
|
19669
|
+
isRtl: isRtl,
|
|
19670
|
+
layout: layout
|
|
19671
|
+
}, toolbarProps));
|
|
19672
|
+
if (showDetachedToolbarOnly) {
|
|
19673
|
+
return actionsToolbar;
|
|
19243
19674
|
}
|
|
19244
|
-
|
|
19675
|
+
|
|
19676
|
+
// Always show a lock symbol when locked and showLock is false
|
|
19677
|
+
const lockedIconComp = showLockIcon ? /*#__PURE__*/React__default.createElement(Lock, {
|
|
19678
|
+
size: "large",
|
|
19679
|
+
style: _objectSpread2(_objectSpread2({}, iconStyle), {}, {
|
|
19680
|
+
padding: "".concat(ICON_PADDING, "px")
|
|
19681
|
+
})
|
|
19682
|
+
}) : undefined;
|
|
19683
|
+
return /*#__PURE__*/React__default.createElement(StyledGridHeader, {
|
|
19684
|
+
item: true,
|
|
19685
|
+
container: true,
|
|
19686
|
+
styles: styles,
|
|
19687
|
+
isRtl: isRtl,
|
|
19688
|
+
marginY: 1,
|
|
19689
|
+
paddingLeft: "".concat(paddingLeft, "px"),
|
|
19690
|
+
paddingRight: "".concat(paddingRight, "px"),
|
|
19691
|
+
className: "header-container"
|
|
19692
|
+
}, showUnlock && /*#__PURE__*/React__default.createElement(UnlockCoverButton, {
|
|
19693
|
+
isLoading: settingLockedState,
|
|
19694
|
+
translator: translator,
|
|
19695
|
+
toggleLock: toggleLock,
|
|
19696
|
+
keyboard: keyboard
|
|
19697
|
+
}), showLeftIcon && /*#__PURE__*/React__default.createElement(Grid, {
|
|
19698
|
+
item: true,
|
|
19699
|
+
container: true,
|
|
19700
|
+
alignItems: "center",
|
|
19701
|
+
width: iconsWidth,
|
|
19702
|
+
className: "header-action-container"
|
|
19703
|
+
}, lockedIconComp || showSearchIcon && searchIconComp, isDrillDown && /*#__PURE__*/React__default.createElement(DrillDownIcon, {
|
|
19704
|
+
tabIndex: -1,
|
|
19705
|
+
title: translator.get('Listbox.DrillDown'),
|
|
19706
|
+
style: _objectSpread2(_objectSpread2({}, iconStyle), {}, {
|
|
19707
|
+
padding: "".concat(ICON_PADDING, "px")
|
|
19708
|
+
})
|
|
19709
|
+
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
19710
|
+
item: true,
|
|
19711
|
+
xs: true,
|
|
19712
|
+
minWidth: 0 // needed to text-overflow see: https://css-tricks.com/flexbox-truncated-text/
|
|
19713
|
+
,
|
|
19714
|
+
justifyContent: isRtl ? 'flex-end' : 'flex-start',
|
|
19715
|
+
className: classes.listBoxHeader
|
|
19716
|
+
}, /*#__PURE__*/React__default.createElement(HeaderTitle, {
|
|
19717
|
+
variant: "h6",
|
|
19718
|
+
noWrap: true,
|
|
19719
|
+
ref: titleRef,
|
|
19720
|
+
title: layout.title,
|
|
19721
|
+
styles: styles
|
|
19722
|
+
}, layout.title)), /*#__PURE__*/React__default.createElement(Grid, {
|
|
19723
|
+
item: true,
|
|
19724
|
+
display: "flex"
|
|
19725
|
+
}, actionsToolbar));
|
|
19245
19726
|
}
|
|
19246
19727
|
|
|
19247
19728
|
const PREFIX$4 = 'ListBoxInline';
|
|
@@ -19250,7 +19731,7 @@ const classes$4 = {
|
|
|
19250
19731
|
screenReaderOnly: "".concat(PREFIX$4, "-screenReaderOnly"),
|
|
19251
19732
|
listboxWrapper: "".concat(PREFIX$4, "-listboxWrapper")
|
|
19252
19733
|
};
|
|
19253
|
-
const StyledGrid$3 = styled
|
|
19734
|
+
const StyledGrid$3 = styled(Grid, {
|
|
19254
19735
|
shouldForwardProp: p => !['containerPadding', 'isGridMode', 'styles'].includes(p)
|
|
19255
19736
|
})(_ref => {
|
|
19256
19737
|
let {
|
|
@@ -19285,47 +19766,20 @@ const StyledGrid$3 = styled$1(Grid, {
|
|
|
19285
19766
|
}
|
|
19286
19767
|
});
|
|
19287
19768
|
});
|
|
19288
|
-
const
|
|
19289
|
-
shouldForwardProp: p => !['styles', 'isRtl'].includes(p)
|
|
19290
|
-
})(_ref2 => {
|
|
19291
|
-
let {
|
|
19292
|
-
styles,
|
|
19293
|
-
isRtl
|
|
19294
|
-
} = _ref2;
|
|
19295
|
-
return _objectSpread2(_objectSpread2({
|
|
19296
|
-
flexDirection: isRtl ? 'row-reverse' : 'row',
|
|
19297
|
-
wrap: 'nowrap',
|
|
19298
|
-
minHeight: 32,
|
|
19299
|
-
alignContent: 'center'
|
|
19300
|
-
}, styles.header), {}, {
|
|
19301
|
-
'& *': {
|
|
19302
|
-
// Assign the styles color as defaul color for all elements in the header
|
|
19303
|
-
color: styles.header.color
|
|
19304
|
-
}
|
|
19305
|
-
});
|
|
19306
|
-
});
|
|
19307
|
-
const Title = styled$1(Typography)(_ref3 => {
|
|
19308
|
-
let {
|
|
19309
|
-
styles
|
|
19310
|
-
} = _ref3;
|
|
19311
|
-
return _objectSpread2(_objectSpread2({}, styles.header), {}, {
|
|
19312
|
-
paddingRight: '1px' // make place for italic font style
|
|
19313
|
-
});
|
|
19314
|
-
});
|
|
19315
|
-
const isModal = _ref4 => {
|
|
19769
|
+
const isModal = _ref2 => {
|
|
19316
19770
|
var _app$isInModalSelecti, _app$isInModalSelecti2;
|
|
19317
19771
|
let {
|
|
19318
19772
|
app,
|
|
19319
19773
|
appSelections
|
|
19320
|
-
} =
|
|
19774
|
+
} = _ref2;
|
|
19321
19775
|
return (_app$isInModalSelecti = (_app$isInModalSelecti2 = app.isInModalSelection) === null || _app$isInModalSelecti2 === void 0 ? void 0 : _app$isInModalSelecti2.call(app)) !== null && _app$isInModalSelecti !== void 0 ? _app$isInModalSelecti : appSelections.isInModal();
|
|
19322
19776
|
};
|
|
19323
|
-
function ListBoxInline(
|
|
19324
|
-
var _layout$qListObject, _layout$qListObject2, _layoutOptions$dense, _containerRef$current;
|
|
19777
|
+
function ListBoxInline(_ref3) {
|
|
19778
|
+
var _layout$qListObject, _layout$qListObject2, _layout$title, _layoutOptions$dense, _containerRef$current;
|
|
19325
19779
|
let {
|
|
19326
19780
|
options,
|
|
19327
19781
|
layout
|
|
19328
|
-
} =
|
|
19782
|
+
} = _ref3;
|
|
19329
19783
|
const {
|
|
19330
19784
|
app,
|
|
19331
19785
|
direction,
|
|
@@ -19346,6 +19800,7 @@ function ListBoxInline(_ref5) {
|
|
|
19346
19800
|
renderedCallback,
|
|
19347
19801
|
toolbar = true,
|
|
19348
19802
|
isPopover = false,
|
|
19803
|
+
showLock = false,
|
|
19349
19804
|
components
|
|
19350
19805
|
} = options;
|
|
19351
19806
|
|
|
@@ -19361,9 +19816,6 @@ function ListBoxInline(_ref5) {
|
|
|
19361
19816
|
return [ref, setRef];
|
|
19362
19817
|
};
|
|
19363
19818
|
const theme = useTheme$1();
|
|
19364
|
-
const unlock = useCallback(() => {
|
|
19365
|
-
model.unlock('/qListObjectDef');
|
|
19366
|
-
}, [model]);
|
|
19367
19819
|
const {
|
|
19368
19820
|
translator,
|
|
19369
19821
|
keyboardNavigation,
|
|
@@ -19400,7 +19852,6 @@ function ListBoxInline(_ref5) {
|
|
|
19400
19852
|
stop: 0
|
|
19401
19853
|
});
|
|
19402
19854
|
const [appSelections] = useAppSelections(app);
|
|
19403
|
-
const titleRef = useRef(null);
|
|
19404
19855
|
const [selectionState$1] = useState$1(() => selectionState());
|
|
19405
19856
|
const keyboard = useTempKeyboard({
|
|
19406
19857
|
containerRef,
|
|
@@ -19412,7 +19863,6 @@ function ListBoxInline(_ref5) {
|
|
|
19412
19863
|
}), [app, appSelections]);
|
|
19413
19864
|
const isInvalid = layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo.qError;
|
|
19414
19865
|
const errorText = isInvalid && constraints.active ? 'Visualization.Invalid.Dimension' : 'Visualization.Incomplete';
|
|
19415
|
-
const [isToolbarDetached, setIsToolbarDetached] = useState$1(false);
|
|
19416
19866
|
const {
|
|
19417
19867
|
handleKeyDown,
|
|
19418
19868
|
handleOnMouseEnter,
|
|
@@ -19429,8 +19879,6 @@ function ListBoxInline(_ref5) {
|
|
|
19429
19879
|
constraints,
|
|
19430
19880
|
isModal: isModalMode
|
|
19431
19881
|
}), [keyboard, hovering, updateKeyScroll, containerRef, currentScrollIndex, app, appSelections, constraints, isModalMode]);
|
|
19432
|
-
const showDetachedToolbarOnly = toolbar && ((layout === null || layout === void 0 ? void 0 : layout.title) === '' || (layout === null || layout === void 0 ? void 0 : layout.showTitle) === false) && !isPopover;
|
|
19433
|
-
const showToolbarWithTitle = toolbar && (layout === null || layout === void 0 ? void 0 : layout.title) !== '' && (layout === null || layout === void 0 ? void 0 : layout.showTitle) !== false || isPopover;
|
|
19434
19882
|
useEffect$1(() => {
|
|
19435
19883
|
document.addEventListener('keydown', globalKeyDown);
|
|
19436
19884
|
return () => {
|
|
@@ -19438,6 +19886,9 @@ function ListBoxInline(_ref5) {
|
|
|
19438
19886
|
};
|
|
19439
19887
|
}, [globalKeyDown]);
|
|
19440
19888
|
useEffect$1(() => {
|
|
19889
|
+
if (search === true) {
|
|
19890
|
+
setShowSearch(true);
|
|
19891
|
+
}
|
|
19441
19892
|
const show = () => {
|
|
19442
19893
|
setShowToolbar(true);
|
|
19443
19894
|
};
|
|
@@ -19448,6 +19899,7 @@ function ListBoxInline(_ref5) {
|
|
|
19448
19899
|
}
|
|
19449
19900
|
};
|
|
19450
19901
|
if (isPopover) {
|
|
19902
|
+
// When isPopover, toolbar == false will be ignored.
|
|
19451
19903
|
if (!selections.isActive()) {
|
|
19452
19904
|
selections.begin('/qListObjectDef');
|
|
19453
19905
|
selections.on('activated', show);
|
|
@@ -19455,7 +19907,7 @@ function ListBoxInline(_ref5) {
|
|
|
19455
19907
|
}
|
|
19456
19908
|
setShowToolbar(isPopover);
|
|
19457
19909
|
}
|
|
19458
|
-
if (selections) {
|
|
19910
|
+
if (toolbar && selections) {
|
|
19459
19911
|
if (!selections.isModal()) {
|
|
19460
19912
|
selections.on('activated', show);
|
|
19461
19913
|
selections.on('deactivated', hide);
|
|
@@ -19468,7 +19920,7 @@ function ListBoxInline(_ref5) {
|
|
|
19468
19920
|
selections.removeListener('deactivated', hide);
|
|
19469
19921
|
}
|
|
19470
19922
|
};
|
|
19471
|
-
}, [selections, isPopover]);
|
|
19923
|
+
}, [toolbar, selections, isPopover]);
|
|
19472
19924
|
useEffect$1(() => {
|
|
19473
19925
|
if (!searchContainer || !searchContainer.current) {
|
|
19474
19926
|
return;
|
|
@@ -19485,64 +19937,31 @@ function ListBoxInline(_ref5) {
|
|
|
19485
19937
|
autoConfirm = false,
|
|
19486
19938
|
layoutOptions = {}
|
|
19487
19939
|
} = layout !== null && layout !== void 0 ? layout : {};
|
|
19488
|
-
const
|
|
19489
|
-
const
|
|
19490
|
-
const showSearchOrLockIcon = isLocked || showSearchIcon;
|
|
19940
|
+
const isLocked = layout === null || layout === void 0 || (_layout$qListObject = layout.qListObject) === null || _layout$qListObject === void 0 || (_layout$qListObject = _layout$qListObject.qDimensionInfo) === null || _layout$qListObject === void 0 ? void 0 : _layout$qListObject.qLocked;
|
|
19941
|
+
const showSearchIcon = searchEnabled !== false && search === 'toggle' && !isLocked;
|
|
19491
19942
|
const isDrillDown = (layout === null || layout === void 0 || (_layout$qListObject2 = layout.qListObject) === null || _layout$qListObject2 === void 0 || (_layout$qListObject2 = _layout$qListObject2.qDimensionInfo) === null || _layout$qListObject2 === void 0 ? void 0 : _layout$qListObject2.qGrouping) === 'H';
|
|
19492
|
-
const
|
|
19493
|
-
const
|
|
19943
|
+
const canShowTitle = (layout === null || layout === void 0 || (_layout$title = layout.title) === null || _layout$title === void 0 ? void 0 : _layout$title.length) && (layout === null || layout === void 0 ? void 0 : layout.showTitle) !== false;
|
|
19944
|
+
const showDetachedToolbarOnly = toolbar && !canShowTitle && !isPopover;
|
|
19945
|
+
const showAttachedToolbar = toolbar && canShowTitle || isPopover;
|
|
19494
19946
|
const isRtl = direction === 'rtl';
|
|
19495
|
-
const headerPaddingLeft = CELL_PADDING_LEFT - (showSearchOrLockIcon ? ICON_PADDING : 0);
|
|
19496
|
-
const headerPaddingRight = isRtl ? CELL_PADDING_LEFT - (showIcons ? ICON_PADDING : 0) : HEADER_PADDING_RIGHT;
|
|
19497
|
-
useEffect$1(() => {
|
|
19498
|
-
if (!titleRef.current || !containerRect) {
|
|
19499
|
-
return;
|
|
19500
|
-
}
|
|
19501
|
-
const isDetached = showToolbarDetached({
|
|
19502
|
-
containerRect,
|
|
19503
|
-
titleRef,
|
|
19504
|
-
iconsWidth,
|
|
19505
|
-
headerPaddingLeft,
|
|
19506
|
-
headerPaddingRight
|
|
19507
|
-
});
|
|
19508
|
-
setIsToolbarDetached(isDetached);
|
|
19509
|
-
}, [titleRef.current, containerRect]);
|
|
19510
19947
|
if (!model || !layout || !translator) {
|
|
19511
19948
|
return null;
|
|
19512
19949
|
}
|
|
19513
|
-
const listboxSelectionToolbarItems = createListboxSelectionToolbar({
|
|
19514
|
-
layout,
|
|
19515
|
-
model,
|
|
19516
|
-
translator,
|
|
19517
|
-
selectionState: selectionState$1,
|
|
19518
|
-
isDirectQuery
|
|
19519
|
-
});
|
|
19520
19950
|
const showSearchToggle = search === 'toggle' && showSearch;
|
|
19521
|
-
const searchVisible =
|
|
19951
|
+
const searchVisible = search === true || showSearchToggle && !selectDisabled() && searchEnabled !== false;
|
|
19522
19952
|
const dense = (_layoutOptions$dense = layoutOptions.dense) !== null && _layoutOptions$dense !== void 0 ? _layoutOptions$dense : false;
|
|
19523
|
-
const
|
|
19953
|
+
const handleShowSearch = () => {
|
|
19524
19954
|
const newValue = !showSearch;
|
|
19525
19955
|
setShowSearch(newValue);
|
|
19526
19956
|
};
|
|
19527
19957
|
const onCtrlF = () => {
|
|
19528
19958
|
if (search === 'toggle') {
|
|
19529
|
-
|
|
19959
|
+
handleShowSearch();
|
|
19530
19960
|
} else {
|
|
19531
19961
|
const input = searchContainer.current.querySelector('input');
|
|
19532
19962
|
input === null || input === void 0 || input.focus();
|
|
19533
19963
|
}
|
|
19534
19964
|
};
|
|
19535
|
-
const getActionToolbarProps = isDetached => _objectSpread2(_objectSpread2({}, getListboxActionProps({
|
|
19536
|
-
isDetached: isPopover ? false : isDetached,
|
|
19537
|
-
showToolbar,
|
|
19538
|
-
containerRef,
|
|
19539
|
-
isLocked,
|
|
19540
|
-
listboxSelectionToolbarItems,
|
|
19541
|
-
selections,
|
|
19542
|
-
keyboard
|
|
19543
|
-
})), {}, {
|
|
19544
|
-
autoConfirm
|
|
19545
|
-
});
|
|
19546
19965
|
const shouldAutoFocus = searchVisible && search === 'toggle';
|
|
19547
19966
|
|
|
19548
19967
|
// Add a container padding for grid mode to harmonize with the grid item margins (should sum to 8px).
|
|
@@ -19553,49 +19972,35 @@ function ListBoxInline(_ref5) {
|
|
|
19553
19972
|
height: (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight,
|
|
19554
19973
|
layoutOrder: layoutOptions.layoutOrder
|
|
19555
19974
|
});
|
|
19556
|
-
const searchIconComp = constraints !== null && constraints !== void 0 && constraints.active ? /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
19557
|
-
title: translator.get('Listbox.Search'),
|
|
19558
|
-
size: "large",
|
|
19559
|
-
style: {
|
|
19560
|
-
fontSize: '12px',
|
|
19561
|
-
padding: '7px'
|
|
19562
|
-
}
|
|
19563
|
-
}) : /*#__PURE__*/React__default.createElement(IconButton, {
|
|
19564
|
-
onClick: onShowSearch,
|
|
19565
|
-
tabIndex: -1,
|
|
19566
|
-
title: translator.get('Listbox.Search'),
|
|
19567
|
-
size: "large",
|
|
19568
|
-
disableRipple: true,
|
|
19569
|
-
"data-testid": "search-toggle-btn"
|
|
19570
|
-
}, /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
19571
|
-
style: {
|
|
19572
|
-
fontSize: '12px'
|
|
19573
|
-
}
|
|
19574
|
-
}));
|
|
19575
|
-
const lockIconComp = selectDisabled() ? /*#__PURE__*/React__default.createElement(Lock, {
|
|
19576
|
-
size: "large",
|
|
19577
|
-
style: {
|
|
19578
|
-
fontSize: '12px',
|
|
19579
|
-
padding: '7px'
|
|
19580
|
-
}
|
|
19581
|
-
}) : /*#__PURE__*/React__default.createElement(IconButton, {
|
|
19582
|
-
title: translator.get('SelectionToolbar.ClickToUnlock'),
|
|
19583
|
-
tabIndex: -1,
|
|
19584
|
-
onClick: unlock,
|
|
19585
|
-
size: "large"
|
|
19586
|
-
}, /*#__PURE__*/React__default.createElement(Lock, {
|
|
19587
|
-
disableRipple: true,
|
|
19588
|
-
style: {
|
|
19589
|
-
fontSize: '12px'
|
|
19590
|
-
}
|
|
19591
|
-
}));
|
|
19592
19975
|
if (isInvalid) {
|
|
19593
19976
|
renderedCallback === null || renderedCallback === void 0 || renderedCallback();
|
|
19594
19977
|
}
|
|
19595
|
-
const listBoxMinHeight =
|
|
19596
|
-
|
|
19597
|
-
|
|
19598
|
-
|
|
19978
|
+
const listBoxMinHeight = showAttachedToolbar ? DENSE_ROW_HEIGHT + SCROLL_BAR_WIDTH : 0;
|
|
19979
|
+
const listBoxHeader = /*#__PURE__*/React__default.createElement(ListBoxHeader, {
|
|
19980
|
+
selectDisabled: selectDisabled,
|
|
19981
|
+
showSearchIcon: showSearchIcon,
|
|
19982
|
+
isDrillDown: isDrillDown,
|
|
19983
|
+
onShowSearch: handleShowSearch,
|
|
19984
|
+
isPopover: isPopover,
|
|
19985
|
+
showToolbar: showToolbar,
|
|
19986
|
+
isDirectQuery: isDirectQuery,
|
|
19987
|
+
autoConfirm: autoConfirm,
|
|
19988
|
+
showDetachedToolbarOnly: showDetachedToolbarOnly,
|
|
19989
|
+
layout: layout,
|
|
19990
|
+
translator: translator,
|
|
19991
|
+
styles: styles,
|
|
19992
|
+
isRtl: isRtl,
|
|
19993
|
+
showLock: showLock,
|
|
19994
|
+
constraints: constraints,
|
|
19995
|
+
classes: classes$4,
|
|
19996
|
+
containerRect: containerRect,
|
|
19997
|
+
containerRef: containerRef,
|
|
19998
|
+
model: model,
|
|
19999
|
+
selectionState: selectionState$1,
|
|
20000
|
+
selections: selections,
|
|
20001
|
+
keyboard: keyboard
|
|
20002
|
+
});
|
|
20003
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showDetachedToolbarOnly && listBoxHeader, /*#__PURE__*/React__default.createElement(StyledGrid$3, {
|
|
19599
20004
|
className: "listbox-container",
|
|
19600
20005
|
container: true,
|
|
19601
20006
|
tabIndex: keyboard.enabled ? -1 : undefined,
|
|
@@ -19616,45 +20021,7 @@ function ListBoxInline(_ref5) {
|
|
|
19616
20021
|
},
|
|
19617
20022
|
isGridMode: isGridMode,
|
|
19618
20023
|
"aria-label": keyboard.active ? translator.get('Listbox.ScreenReaderInstructions') : ''
|
|
19619
|
-
},
|
|
19620
|
-
item: true,
|
|
19621
|
-
container: true,
|
|
19622
|
-
styles: styles,
|
|
19623
|
-
isRtl: isRtl,
|
|
19624
|
-
marginY: 1,
|
|
19625
|
-
paddingLeft: "".concat(headerPaddingLeft, "px"),
|
|
19626
|
-
paddingRight: "".concat(headerPaddingRight, "px")
|
|
19627
|
-
}, showIcons && /*#__PURE__*/React__default.createElement(Grid, {
|
|
19628
|
-
item: true,
|
|
19629
|
-
container: true,
|
|
19630
|
-
alignItems: "center",
|
|
19631
|
-
width: iconsWidth
|
|
19632
|
-
}, isLocked ? lockIconComp : showSearchIcon && searchIconComp, isDrillDown && /*#__PURE__*/React__default.createElement(DrillDownIcon, {
|
|
19633
|
-
tabIndex: -1,
|
|
19634
|
-
title: translator.get('Listbox.DrillDown'),
|
|
19635
|
-
size: "large",
|
|
19636
|
-
style: {
|
|
19637
|
-
fontSize: '12px'
|
|
19638
|
-
}
|
|
19639
|
-
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
19640
|
-
item: true,
|
|
19641
|
-
xs: true,
|
|
19642
|
-
minWidth: 0 // needed to text-overflow see: https://css-tricks.com/flexbox-truncated-text/
|
|
19643
|
-
,
|
|
19644
|
-
justifyContent: isRtl ? 'flex-end' : 'flex-start',
|
|
19645
|
-
className: classes$4.listBoxHeader
|
|
19646
|
-
}, /*#__PURE__*/React__default.createElement(Title, {
|
|
19647
|
-
variant: "h6",
|
|
19648
|
-
noWrap: true,
|
|
19649
|
-
ref: titleRef,
|
|
19650
|
-
title: layout.title,
|
|
19651
|
-
styles: styles
|
|
19652
|
-
}, layout.title)), /*#__PURE__*/React__default.createElement(Grid, {
|
|
19653
|
-
item: true,
|
|
19654
|
-
display: "flex"
|
|
19655
|
-
}, /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$5({
|
|
19656
|
-
direction: direction
|
|
19657
|
-
}, getActionToolbarProps(isToolbarDetached))))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
20024
|
+
}, showAttachedToolbar && listBoxHeader, /*#__PURE__*/React__default.createElement(Grid, {
|
|
19658
20025
|
item: true,
|
|
19659
20026
|
container: true,
|
|
19660
20027
|
direction: "column",
|
|
@@ -19677,7 +20044,7 @@ function ListBoxInline(_ref5) {
|
|
|
19677
20044
|
wildCardSearch: wildCardSearch,
|
|
19678
20045
|
searchEnabled: searchEnabled,
|
|
19679
20046
|
direction: direction,
|
|
19680
|
-
hide: showSearchIcon &&
|
|
20047
|
+
hide: showSearchIcon && handleShowSearch,
|
|
19681
20048
|
styles: styles
|
|
19682
20049
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
19683
20050
|
item: true,
|
|
@@ -19685,11 +20052,11 @@ function ListBoxInline(_ref5) {
|
|
|
19685
20052
|
className: classes$4.listboxWrapper
|
|
19686
20053
|
}, isInvalid ? /*#__PURE__*/React__default.createElement(ListBoxError, {
|
|
19687
20054
|
text: errorText
|
|
19688
|
-
}) : /*#__PURE__*/React__default.createElement(AutoSizer, null,
|
|
20055
|
+
}) : /*#__PURE__*/React__default.createElement(AutoSizer, null, _ref4 => {
|
|
19689
20056
|
let {
|
|
19690
20057
|
height,
|
|
19691
20058
|
width
|
|
19692
|
-
} =
|
|
20059
|
+
} = _ref4;
|
|
19693
20060
|
return /*#__PURE__*/React__default.createElement(ListBox, {
|
|
19694
20061
|
model: model,
|
|
19695
20062
|
app: app,
|
|
@@ -19731,10 +20098,10 @@ function ListBoxInline(_ref5) {
|
|
|
19731
20098
|
})))));
|
|
19732
20099
|
}
|
|
19733
20100
|
const ListBoxInlineMemoed = React__default.memo(ListBoxInline);
|
|
19734
|
-
function IsolateUseLayoutWrapper(
|
|
20101
|
+
function IsolateUseLayoutWrapper(_ref5) {
|
|
19735
20102
|
let {
|
|
19736
20103
|
options = {}
|
|
19737
|
-
} =
|
|
20104
|
+
} = _ref5;
|
|
19738
20105
|
const {
|
|
19739
20106
|
model
|
|
19740
20107
|
} = options;
|
|
@@ -19763,24 +20130,26 @@ function useExistingModel(_ref) {
|
|
|
19763
20130
|
throw new Error("Option \"".concat(usedForbiddenOptions.join(', '), "\" is not applicable for existing objects."));
|
|
19764
20131
|
}
|
|
19765
20132
|
useEffect$1(() => {
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19769
|
-
setModel(modelFromStore);
|
|
19770
|
-
} else {
|
|
19771
|
-
const m = await app.getObject(qId);
|
|
19772
|
-
modelStore.set(m.id, m);
|
|
19773
|
-
m.once('closed', () => {
|
|
19774
|
-
modelStore.clear(m.id);
|
|
19775
|
-
});
|
|
19776
|
-
setModel(m);
|
|
20133
|
+
function storeModel(m) {
|
|
20134
|
+
if (modelStore.get(m.id)) {
|
|
20135
|
+
return;
|
|
19777
20136
|
}
|
|
20137
|
+
// Nebula gets the model from this store in some of its
|
|
20138
|
+
// core functions, so it must always be stored here.
|
|
20139
|
+
modelStore.set(m.id, m);
|
|
20140
|
+
m.once('closed', () => {
|
|
20141
|
+
modelStore.clear(m.id);
|
|
20142
|
+
});
|
|
19778
20143
|
}
|
|
19779
|
-
|
|
19780
|
-
|
|
19781
|
-
|
|
19782
|
-
fetchObject();
|
|
20144
|
+
async function fetchObject(modelId) {
|
|
20145
|
+
const m = modelStore.get(modelId) || (await app.getObject(modelId));
|
|
20146
|
+
return m;
|
|
19783
20147
|
}
|
|
20148
|
+
const p = Promise.resolve(sessionModel || fetchObject(qId));
|
|
20149
|
+
p.then(m => {
|
|
20150
|
+
storeModel(m);
|
|
20151
|
+
setModel(m);
|
|
20152
|
+
});
|
|
19784
20153
|
}, []);
|
|
19785
20154
|
return model;
|
|
19786
20155
|
}
|
|
@@ -21492,7 +21861,7 @@ const warning = props => _objectSpread2(_objectSpread2({}, props), {}, {
|
|
|
21492
21861
|
}
|
|
21493
21862
|
}]
|
|
21494
21863
|
});
|
|
21495
|
-
var WarningTriangle = (props => SvgIcon$
|
|
21864
|
+
var WarningTriangle = (props => SvgIcon$1(warning(props)));
|
|
21496
21865
|
|
|
21497
21866
|
/* eslint-disable react/no-array-index-key */
|
|
21498
21867
|
function DescriptionRow(_ref) {
|
|
@@ -21631,7 +22000,7 @@ const classes$3 = {
|
|
|
21631
22000
|
front: "".concat(PREFIX$3, "-front"),
|
|
21632
22001
|
back: "".concat(PREFIX$3, "-back")
|
|
21633
22002
|
};
|
|
21634
|
-
const Root = styled
|
|
22003
|
+
const Root = styled('div')(_ref => {
|
|
21635
22004
|
let {
|
|
21636
22005
|
theme
|
|
21637
22006
|
} = _ref;
|
|
@@ -21686,7 +22055,7 @@ const PREFIX$2 = 'LongRunningQuery';
|
|
|
21686
22055
|
const classes$2 = {
|
|
21687
22056
|
stripes: "".concat(PREFIX$2, "-stripes")
|
|
21688
22057
|
};
|
|
21689
|
-
const StyledGrid$2 = styled
|
|
22058
|
+
const StyledGrid$2 = styled(Grid)(() => ({
|
|
21690
22059
|
["& .".concat(classes$2.stripes)]: {
|
|
21691
22060
|
'&::before': {
|
|
21692
22061
|
position: 'absolute',
|
|
@@ -21812,7 +22181,7 @@ const classes$1 = {
|
|
|
21812
22181
|
containerStyle: "".concat(PREFIX$1, "-containerStyle"),
|
|
21813
22182
|
containerTitleStyle: "".concat(PREFIX$1, "-containerTitleStyle")
|
|
21814
22183
|
};
|
|
21815
|
-
const StyledGrid$1 = styled
|
|
22184
|
+
const StyledGrid$1 = styled(Grid)(_ref => {
|
|
21816
22185
|
let {
|
|
21817
22186
|
theme
|
|
21818
22187
|
} = _ref;
|
|
@@ -21896,7 +22265,8 @@ function Header(_ref2) {
|
|
|
21896
22265
|
show: showPopoverToolbar,
|
|
21897
22266
|
anchorEl
|
|
21898
22267
|
},
|
|
21899
|
-
focusHandler: focusHandler
|
|
22268
|
+
focusHandler: focusHandler,
|
|
22269
|
+
layout: layout
|
|
21900
22270
|
});
|
|
21901
22271
|
return /*#__PURE__*/React__default.createElement(StyledGrid$1, {
|
|
21902
22272
|
ref: containerRef,
|
|
@@ -21931,7 +22301,7 @@ const PREFIX = 'Footer';
|
|
|
21931
22301
|
const classes = {
|
|
21932
22302
|
itemStyle: "".concat(PREFIX, "-itemStyle")
|
|
21933
22303
|
};
|
|
21934
|
-
const StyledGrid = styled
|
|
22304
|
+
const StyledGrid = styled(Grid)(_ref => {
|
|
21935
22305
|
let {
|
|
21936
22306
|
theme
|
|
21937
22307
|
} = _ref;
|
|
@@ -23574,11 +23944,17 @@ function useState(initial) {
|
|
|
23574
23944
|
}
|
|
23575
23945
|
|
|
23576
23946
|
/**
|
|
23947
|
+
* Callback function that should return a function that in turns gets
|
|
23948
|
+
* called before the hook runs again or when the component is destroyed.
|
|
23949
|
+
* For example to remove any listeners added in the callback itself.
|
|
23577
23950
|
* @typedef {function():(void | function():void)} EffectCallback
|
|
23578
23951
|
*/
|
|
23579
23952
|
|
|
23580
23953
|
/**
|
|
23581
23954
|
* Triggers a callback function when a dependent value changes.
|
|
23955
|
+
*
|
|
23956
|
+
* Omitting the dependency array will have the hook run on each update
|
|
23957
|
+
* and an empty dependency array runs only once.
|
|
23582
23958
|
* @entry
|
|
23583
23959
|
* @param {EffectCallback} effect - The callback.
|
|
23584
23960
|
* @param {Array<any>=} deps - The dependencies that should trigger the callback.
|
|
@@ -23591,6 +23967,15 @@ function useState(initial) {
|
|
|
23591
23967
|
* console.log('unmounted');
|
|
23592
23968
|
* };
|
|
23593
23969
|
* }, []);
|
|
23970
|
+
*
|
|
23971
|
+
* useEffect(() => {
|
|
23972
|
+
* const clickHandler = () => { console.log('click') };
|
|
23973
|
+
* const button = element.querySelector('.button');
|
|
23974
|
+
* button.addEventListener('click', clickHandler);
|
|
23975
|
+
* return () => {
|
|
23976
|
+
* button.removeEventListener('click', clickHandler);
|
|
23977
|
+
* };
|
|
23978
|
+
* }, []);
|
|
23594
23979
|
*/
|
|
23595
23980
|
function useEffect(cb, deps) {
|
|
23596
23981
|
{
|
|
@@ -23650,17 +24035,20 @@ function useMemo(fn, deps) {
|
|
|
23650
24035
|
|
|
23651
24036
|
/**
|
|
23652
24037
|
* Runs a callback function when a dependent changes.
|
|
24038
|
+
*
|
|
24039
|
+
* Useful for async operations that otherwise cause no side effects.
|
|
24040
|
+
* Do not add for example listeners withing the callback as there is no teardown function.
|
|
23653
24041
|
* @entry
|
|
23654
24042
|
* @template P
|
|
23655
24043
|
* @param {function():Promise<P>} factory - The factory function that calls the promise.
|
|
23656
24044
|
* @param {Array<any>=} deps - The dependencies.
|
|
23657
|
-
* @returns {Array<P,Error>} The resolved value
|
|
24045
|
+
* @returns {Array<P,Error>} The resolved value or rejected error
|
|
23658
24046
|
* @example
|
|
23659
24047
|
* import { usePromise } from '@nebula.js/stardust';
|
|
23660
24048
|
* import { useModel } from '@nebula.js/stardust';
|
|
23661
24049
|
* // ...
|
|
23662
24050
|
* const model = useModel();
|
|
23663
|
-
* const [resolved, rejected] = usePromise(() => model.getLayout(), []);
|
|
24051
|
+
* const [resolved, rejected] = usePromise(() => model.getLayout(), [model]);
|
|
23664
24052
|
*/
|
|
23665
24053
|
function usePromise(p, deps) {
|
|
23666
24054
|
const [obj, setObj] = useState(() => ({
|
|
@@ -28259,7 +28647,7 @@ const DEFAULT_SNAPSHOT_CONFIG = /** @lends SnapshotConfiguration */{
|
|
|
28259
28647
|
|
|
28260
28648
|
/**
|
|
28261
28649
|
* @interface Configuration
|
|
28262
|
-
* @property {LoadType
|
|
28650
|
+
* @property {Function(LoadType):Promise<Visualization>=} load Fallback load function for missing types
|
|
28263
28651
|
* @property {Context=} context Settings for the rendering instance
|
|
28264
28652
|
* @property {Array<TypeInfo>=} types Visualization types to register
|
|
28265
28653
|
* @property {Array<ThemeInfo>=} themes Themes to register
|
|
@@ -28678,6 +29066,7 @@ function nuked() {
|
|
|
28678
29066
|
* @param {FrequencyMode=} [options.frequencyMode=none] Show frequency none|value|percent|relative
|
|
28679
29067
|
* @param {boolean=} [options.histogram=false] Show histogram bar (not applicable for existing objects)
|
|
28680
29068
|
* @param {SearchMode=} [options.search=true] Show the search bar permanently, using the toggle button or when in selection: false|true|toggle
|
|
29069
|
+
* @param {boolean=} [options.showLock=false] Show the button for toggling locked state.
|
|
28681
29070
|
* @param {boolean=} [options.toolbar=true] Show the toolbar
|
|
28682
29071
|
* @param {boolean=} [options.checkboxes=false] Show values as checkboxes instead of as fields (not applicable for existing objects)
|
|
28683
29072
|
* @param {boolean=} [options.dense=false] Reduces padding and text size (not applicable for existing objects)
|
|
@@ -28840,6 +29229,8 @@ function SessionMock() {
|
|
|
28840
29229
|
};
|
|
28841
29230
|
}
|
|
28842
29231
|
|
|
29232
|
+
/* eslint-disable no-underscore-dangle */
|
|
29233
|
+
|
|
28843
29234
|
// To cover test
|
|
28844
29235
|
// eslint-disable-next-line no-undef
|
|
28845
29236
|
const crt = globalThis.crypto || {
|
|
@@ -28851,7 +29242,7 @@ const crt = globalThis.crypto || {
|
|
|
28851
29242
|
function uuidv4() {
|
|
28852
29243
|
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => (c ^ crt.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16));
|
|
28853
29244
|
}
|
|
28854
|
-
function CreateSessionObjectMock() {
|
|
29245
|
+
function CreateSessionObjectMock(session) {
|
|
28855
29246
|
return props => {
|
|
28856
29247
|
const properties = extend$2({}, props);
|
|
28857
29248
|
properties.qInfo = properties.qInfo || {};
|
|
@@ -28862,15 +29253,17 @@ function CreateSessionObjectMock() {
|
|
|
28862
29253
|
delete properties._mock;
|
|
28863
29254
|
layout = extend$2({}, properties, mockedInclusions);
|
|
28864
29255
|
}
|
|
28865
|
-
return Promise.resolve(
|
|
29256
|
+
return Promise.resolve({
|
|
28866
29257
|
on: () => {},
|
|
28867
29258
|
once: () => {},
|
|
28868
29259
|
getLayout: () => Promise.resolve(layout),
|
|
28869
29260
|
getProperties: () => Promise.resolve(properties),
|
|
28870
29261
|
getEffectiveProperties: () => Promise.resolve(properties),
|
|
28871
29262
|
removeListener: () => {},
|
|
28872
|
-
id: properties.qInfo.qId
|
|
28873
|
-
|
|
29263
|
+
id: properties.qInfo.qId,
|
|
29264
|
+
properties,
|
|
29265
|
+
session
|
|
29266
|
+
});
|
|
28874
29267
|
};
|
|
28875
29268
|
}
|
|
28876
29269
|
|
|
@@ -29091,7 +29484,7 @@ function GetAppLayoutMock() {
|
|
|
29091
29484
|
function fromGenericObjects(genericObjects) {
|
|
29092
29485
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
29093
29486
|
const session = new SessionMock();
|
|
29094
|
-
const createSessionObject = new CreateSessionObjectMock();
|
|
29487
|
+
const createSessionObject = new CreateSessionObjectMock(session);
|
|
29095
29488
|
const getObject = new GetObjectMock(genericObjects, options);
|
|
29096
29489
|
const getAppLayout = new GetAppLayoutMock();
|
|
29097
29490
|
const app = {
|