@nebula.js/stardust 4.10.0 → 4.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/esm/dev.js +2279 -1784
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +4 -4
- package/core/esm/index.js.map +1 -1
- package/core/package.json +2 -2
- package/dist/stardust.dev.js +3121 -2504
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +14 -14
- package/dist/stardust.js.map +1 -1
- package/package.json +13 -13
package/core/esm/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v4.
|
|
2
|
+
* @nebula.js/stardust v4.12.0
|
|
3
3
|
* Copyright (c) 2024 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
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, useReducer, useCallback, useLayoutEffect as useLayoutEffect$1, PureComponent, useRef, useContext, createElement, Component } from 'react';
|
|
9
9
|
import ReactDOM from 'react-dom';
|
|
10
|
-
import { CacheProvider, ThemeContext as ThemeContext$2 } from '@emotion/react';
|
|
10
|
+
import { CacheProvider, Global, ThemeContext as ThemeContext$2, css, keyframes } from '@emotion/react';
|
|
11
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
12
|
import styled$2 from '@emotion/styled';
|
|
13
13
|
|
|
@@ -758,8 +758,8 @@ function _defineProperty(obj, key, value) {
|
|
|
758
758
|
}
|
|
759
759
|
return obj;
|
|
760
760
|
}
|
|
761
|
-
function _extends$
|
|
762
|
-
_extends$
|
|
761
|
+
function _extends$6() {
|
|
762
|
+
_extends$6 = Object.assign ? Object.assign.bind() : function (target) {
|
|
763
763
|
for (var i = 1; i < arguments.length; i++) {
|
|
764
764
|
var source = arguments[i];
|
|
765
765
|
for (var key in source) {
|
|
@@ -770,7 +770,7 @@ function _extends$5() {
|
|
|
770
770
|
}
|
|
771
771
|
return target;
|
|
772
772
|
};
|
|
773
|
-
return _extends$
|
|
773
|
+
return _extends$6.apply(this, arguments);
|
|
774
774
|
}
|
|
775
775
|
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
776
776
|
if (source == null) return {};
|
|
@@ -1772,6 +1772,26 @@ var Selection_SelectPossible = {
|
|
|
1772
1772
|
"zh-TW": "選取可能值"
|
|
1773
1773
|
}
|
|
1774
1774
|
};
|
|
1775
|
+
var SelectionToolbar_ClickToLock = {
|
|
1776
|
+
id: "SelectionToolbar.ClickToLock",
|
|
1777
|
+
locale: {
|
|
1778
|
+
"de-DE": "Klicken zum Sperren",
|
|
1779
|
+
"en-US": "Click to lock",
|
|
1780
|
+
"es-ES": "Haga clic para bloquearla",
|
|
1781
|
+
"fr-FR": "Cliquez pour verrouiller",
|
|
1782
|
+
"it-IT": "Fare clic per bloccare",
|
|
1783
|
+
"ja-JP": "クリックしてロック",
|
|
1784
|
+
"ko-KR": "클릭하여 잠금",
|
|
1785
|
+
"nl-NL": "Klik om te vergrendelen",
|
|
1786
|
+
"pl-PL": "Kliknij, aby zablokować",
|
|
1787
|
+
"pt-BR": "Clique para bloquear",
|
|
1788
|
+
"ru-RU": "Щелкните, чтобы заблокировать",
|
|
1789
|
+
"sv-SE": "Klicka för att låsa",
|
|
1790
|
+
"tr-TR": "Kilitlemek için tıklayın",
|
|
1791
|
+
"zh-CN": "单击以锁定",
|
|
1792
|
+
"zh-TW": "按一下以鎖定"
|
|
1793
|
+
}
|
|
1794
|
+
};
|
|
1775
1795
|
var SelectionToolbar_ClickToUnlock = {
|
|
1776
1796
|
id: "SelectionToolbar.ClickToUnlock",
|
|
1777
1797
|
locale: {
|
|
@@ -1977,6 +1997,7 @@ var all = {
|
|
|
1977
1997
|
Selection_SelectAlternative: Selection_SelectAlternative,
|
|
1978
1998
|
Selection_SelectExcluded: Selection_SelectExcluded,
|
|
1979
1999
|
Selection_SelectPossible: Selection_SelectPossible,
|
|
2000
|
+
SelectionToolbar_ClickToLock: SelectionToolbar_ClickToLock,
|
|
1980
2001
|
SelectionToolbar_ClickToUnlock: SelectionToolbar_ClickToUnlock,
|
|
1981
2002
|
Visualization_Incomplete: Visualization_Incomplete,
|
|
1982
2003
|
Visualization_Incomplete_Dimensions: Visualization_Incomplete_Dimensions,
|
|
@@ -3253,7 +3274,7 @@ function limitFunction(scaledValue, numParts) {
|
|
|
3253
3274
|
function getLevel(scale, level) {
|
|
3254
3275
|
return Math.min(level || scale.startLevel, scale.colorParts.length - 1);
|
|
3255
3276
|
}
|
|
3256
|
-
function blend(c1, c2, t) {
|
|
3277
|
+
function blend$1(c1, c2, t) {
|
|
3257
3278
|
const r = Math.floor(c1.r + (c2.r - c1.r) * t);
|
|
3258
3279
|
const g = Math.floor(c1.g + (c2.g - c1.g) * t);
|
|
3259
3280
|
const b = Math.floor(c1.b + (c2.b - c1.b) * t);
|
|
@@ -3313,7 +3334,7 @@ class ColorScale {
|
|
|
3313
3334
|
return c1;
|
|
3314
3335
|
}
|
|
3315
3336
|
const t = k - f;
|
|
3316
|
-
const uc = blend(c1, c2, t);
|
|
3337
|
+
const uc = blend$1(c1, c2, t);
|
|
3317
3338
|
return uc;
|
|
3318
3339
|
}
|
|
3319
3340
|
}
|
|
@@ -3835,18 +3856,18 @@ function deviceTypeFn(deviceType) {
|
|
|
3835
3856
|
|
|
3836
3857
|
var client = {};
|
|
3837
3858
|
|
|
3838
|
-
var m$
|
|
3859
|
+
var m$2 = ReactDOM;
|
|
3839
3860
|
{
|
|
3840
|
-
client.createRoot = m$
|
|
3841
|
-
client.hydrateRoot = m$
|
|
3861
|
+
client.createRoot = m$2.createRoot;
|
|
3862
|
+
client.hydrateRoot = m$2.hydrateRoot;
|
|
3842
3863
|
}
|
|
3843
3864
|
|
|
3844
3865
|
/**
|
|
3845
3866
|
* WARNING: Don't import this directly.
|
|
3846
|
-
* Use `MuiError` from `@mui-
|
|
3867
|
+
* Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.
|
|
3847
3868
|
* @param {number} code
|
|
3848
3869
|
*/
|
|
3849
|
-
function formatMuiErrorMessage(code) {
|
|
3870
|
+
function formatMuiErrorMessage$1(code) {
|
|
3850
3871
|
// Apply babel-plugin-transform-template-literals in loose mode
|
|
3851
3872
|
// loose mode is safe if we're concatenating primitives
|
|
3852
3873
|
// see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose
|
|
@@ -3861,10 +3882,15 @@ function formatMuiErrorMessage(code) {
|
|
|
3861
3882
|
/* eslint-enable prefer-template */
|
|
3862
3883
|
}
|
|
3863
3884
|
|
|
3885
|
+
var formatMuiErrorMessage = /*#__PURE__*/Object.freeze({
|
|
3886
|
+
__proto__: null,
|
|
3887
|
+
default: formatMuiErrorMessage$1
|
|
3888
|
+
});
|
|
3889
|
+
|
|
3864
3890
|
var THEME_ID = '$$material';
|
|
3865
3891
|
|
|
3866
|
-
function _extends$
|
|
3867
|
-
_extends$
|
|
3892
|
+
function _extends$5() {
|
|
3893
|
+
_extends$5 = Object.assign ? Object.assign.bind() : function (target) {
|
|
3868
3894
|
for (var i = 1; i < arguments.length; i++) {
|
|
3869
3895
|
var source = arguments[i];
|
|
3870
3896
|
for (var key in source) {
|
|
@@ -3875,7 +3901,7 @@ function _extends$4() {
|
|
|
3875
3901
|
}
|
|
3876
3902
|
return target;
|
|
3877
3903
|
};
|
|
3878
|
-
return _extends$
|
|
3904
|
+
return _extends$5.apply(this, arguments);
|
|
3879
3905
|
}
|
|
3880
3906
|
|
|
3881
3907
|
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
@@ -5149,8 +5175,8 @@ var reactJsxRuntime_production_min = {};
|
|
|
5149
5175
|
* This source code is licensed under the MIT license found in the
|
|
5150
5176
|
* LICENSE file in the root directory of this source tree.
|
|
5151
5177
|
*/
|
|
5152
|
-
var f=React__default,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
|
|
5153
|
-
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
|
5178
|
+
var f$1=React__default,k$1=Symbol.for("react.element"),l$1=Symbol.for("react.fragment"),m$1=Object.prototype.hasOwnProperty,n$1=f$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p$1={key:!0,ref:!0,__self:!0,__source:!0};
|
|
5179
|
+
function q$1(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m$1.call(a,b)&&!p$1.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k$1,type:c,key:e,ref:h,props:d,_owner:n$1.current}}reactJsxRuntime_production_min.Fragment=l$1;reactJsxRuntime_production_min.jsx=q$1;reactJsxRuntime_production_min.jsxs=q$1;
|
|
5154
5180
|
|
|
5155
5181
|
{
|
|
5156
5182
|
jsxRuntime.exports = reactJsxRuntime_production_min;
|
|
@@ -5176,8 +5202,22 @@ function StyledEngineProvider(props) {
|
|
|
5176
5202
|
}) : children;
|
|
5177
5203
|
}
|
|
5178
5204
|
|
|
5205
|
+
function isEmpty$2(obj) {
|
|
5206
|
+
return obj === undefined || obj === null || Object.keys(obj).length === 0;
|
|
5207
|
+
}
|
|
5208
|
+
function GlobalStyles(props) {
|
|
5209
|
+
const {
|
|
5210
|
+
styles,
|
|
5211
|
+
defaultTheme = {}
|
|
5212
|
+
} = props;
|
|
5213
|
+
const globalStyles = typeof styles === 'function' ? themeInput => styles(isEmpty$2(themeInput) ? defaultTheme : themeInput) : styles;
|
|
5214
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(Global, {
|
|
5215
|
+
styles: globalStyles
|
|
5216
|
+
});
|
|
5217
|
+
}
|
|
5218
|
+
|
|
5179
5219
|
/**
|
|
5180
|
-
* @mui/styled-engine v5.15.
|
|
5220
|
+
* @mui/styled-engine v5.15.11
|
|
5181
5221
|
*
|
|
5182
5222
|
* @license MIT
|
|
5183
5223
|
* This source code is licensed under the MIT license found in the
|
|
@@ -5197,8 +5237,19 @@ const internal_processStyles = (tag, processor) => {
|
|
|
5197
5237
|
}
|
|
5198
5238
|
};
|
|
5199
5239
|
|
|
5200
|
-
|
|
5201
|
-
|
|
5240
|
+
var styledEngine = /*#__PURE__*/Object.freeze({
|
|
5241
|
+
__proto__: null,
|
|
5242
|
+
GlobalStyles: GlobalStyles,
|
|
5243
|
+
StyledEngineProvider: StyledEngineProvider,
|
|
5244
|
+
ThemeContext: ThemeContext$2,
|
|
5245
|
+
css: css,
|
|
5246
|
+
default: styled$1,
|
|
5247
|
+
internal_processStyles: internal_processStyles,
|
|
5248
|
+
keyframes: keyframes
|
|
5249
|
+
});
|
|
5250
|
+
|
|
5251
|
+
function _extends$4() {
|
|
5252
|
+
_extends$4 = Object.assign ? Object.assign.bind() : function (target) {
|
|
5202
5253
|
for (var i = 1; i < arguments.length; i++) {
|
|
5203
5254
|
var source = arguments[i];
|
|
5204
5255
|
for (var key in source) {
|
|
@@ -5209,7 +5260,7 @@ function _extends$3() {
|
|
|
5209
5260
|
}
|
|
5210
5261
|
return target;
|
|
5211
5262
|
};
|
|
5212
|
-
return _extends$
|
|
5263
|
+
return _extends$4.apply(this, arguments);
|
|
5213
5264
|
}
|
|
5214
5265
|
|
|
5215
5266
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -5225,8 +5276,8 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
5225
5276
|
return target;
|
|
5226
5277
|
}
|
|
5227
5278
|
|
|
5228
|
-
function _extends$
|
|
5229
|
-
_extends$
|
|
5279
|
+
function _extends$3() {
|
|
5280
|
+
_extends$3 = Object.assign ? Object.assign.bind() : function (target) {
|
|
5230
5281
|
for (var i = 1; i < arguments.length; i++) {
|
|
5231
5282
|
var source = arguments[i];
|
|
5232
5283
|
for (var key in source) {
|
|
@@ -5237,7 +5288,7 @@ function _extends$2() {
|
|
|
5237
5288
|
}
|
|
5238
5289
|
return target;
|
|
5239
5290
|
};
|
|
5240
|
-
return _extends$
|
|
5291
|
+
return _extends$3.apply(this, arguments);
|
|
5241
5292
|
}
|
|
5242
5293
|
|
|
5243
5294
|
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
@@ -5258,10 +5309,10 @@ function deepClone(source) {
|
|
|
5258
5309
|
});
|
|
5259
5310
|
return output;
|
|
5260
5311
|
}
|
|
5261
|
-
function deepmerge(target, source, options = {
|
|
5312
|
+
function deepmerge$1(target, source, options = {
|
|
5262
5313
|
clone: true
|
|
5263
5314
|
}) {
|
|
5264
|
-
const output = options.clone ? _extends$
|
|
5315
|
+
const output = options.clone ? _extends$3({}, target) : target;
|
|
5265
5316
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
5266
5317
|
Object.keys(source).forEach(key => {
|
|
5267
5318
|
// Avoid prototype pollution
|
|
@@ -5270,7 +5321,7 @@ function deepmerge(target, source, options = {
|
|
|
5270
5321
|
}
|
|
5271
5322
|
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
|
5272
5323
|
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
|
5273
|
-
output[key] = deepmerge(target[key], source[key], options);
|
|
5324
|
+
output[key] = deepmerge$1(target[key], source[key], options);
|
|
5274
5325
|
} else if (options.clone) {
|
|
5275
5326
|
output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];
|
|
5276
5327
|
} else {
|
|
@@ -5281,1034 +5332,599 @@ function deepmerge(target, source, options = {
|
|
|
5281
5332
|
return output;
|
|
5282
5333
|
}
|
|
5283
5334
|
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
if (typeof string !== 'string') {
|
|
5290
|
-
throw new Error(formatMuiErrorMessage(7));
|
|
5291
|
-
}
|
|
5292
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
5293
|
-
}
|
|
5335
|
+
var deepmerge = /*#__PURE__*/Object.freeze({
|
|
5336
|
+
__proto__: null,
|
|
5337
|
+
default: deepmerge$1,
|
|
5338
|
+
isPlainObject: isPlainObject
|
|
5339
|
+
});
|
|
5294
5340
|
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5341
|
+
const _excluded$g = ["values", "unit", "step"];
|
|
5342
|
+
const sortBreakpointsValues = values => {
|
|
5343
|
+
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
5344
|
+
key,
|
|
5345
|
+
val: values[key]
|
|
5346
|
+
})) || [];
|
|
5347
|
+
// Sort in ascending order
|
|
5348
|
+
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
5349
|
+
return breakpointsAsArray.reduce((acc, obj) => {
|
|
5350
|
+
return _extends$4({}, acc, {
|
|
5351
|
+
[obj.key]: obj.val
|
|
5352
|
+
});
|
|
5353
|
+
}, {});
|
|
5354
|
+
};
|
|
5355
|
+
|
|
5356
|
+
// Keep in mind that @media is inclusive by the CSS specification.
|
|
5357
|
+
function createBreakpoints(breakpoints) {
|
|
5358
|
+
const {
|
|
5359
|
+
// The breakpoint **start** at this value.
|
|
5360
|
+
// For instance with the first breakpoint xs: [xs, sm).
|
|
5361
|
+
values = {
|
|
5362
|
+
xs: 0,
|
|
5363
|
+
// phone
|
|
5364
|
+
sm: 600,
|
|
5365
|
+
// tablet
|
|
5366
|
+
md: 900,
|
|
5367
|
+
// small laptop
|
|
5368
|
+
lg: 1200,
|
|
5369
|
+
// desktop
|
|
5370
|
+
xl: 1536 // large screen
|
|
5371
|
+
},
|
|
5372
|
+
unit = 'px',
|
|
5373
|
+
step = 5
|
|
5374
|
+
} = breakpoints,
|
|
5375
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$g);
|
|
5376
|
+
const sortedValues = sortBreakpointsValues(values);
|
|
5377
|
+
const keys = Object.keys(sortedValues);
|
|
5378
|
+
function up(key) {
|
|
5379
|
+
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
5380
|
+
return `@media (min-width:${value}${unit})`;
|
|
5381
|
+
}
|
|
5382
|
+
function down(key) {
|
|
5383
|
+
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
5384
|
+
return `@media (max-width:${value - step / 100}${unit})`;
|
|
5385
|
+
}
|
|
5386
|
+
function between(start, end) {
|
|
5387
|
+
const endIndex = keys.indexOf(end);
|
|
5388
|
+
return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;
|
|
5389
|
+
}
|
|
5390
|
+
function only(key) {
|
|
5391
|
+
if (keys.indexOf(key) + 1 < keys.length) {
|
|
5392
|
+
return between(key, keys[keys.indexOf(key) + 1]);
|
|
5305
5393
|
}
|
|
5306
|
-
return
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5394
|
+
return up(key);
|
|
5395
|
+
}
|
|
5396
|
+
function not(key) {
|
|
5397
|
+
// handle first and last key separately, for better readability
|
|
5398
|
+
const keyIndex = keys.indexOf(key);
|
|
5399
|
+
if (keyIndex === 0) {
|
|
5400
|
+
return up(keys[1]);
|
|
5401
|
+
}
|
|
5402
|
+
if (keyIndex === keys.length - 1) {
|
|
5403
|
+
return down(keys[keyIndex]);
|
|
5404
|
+
}
|
|
5405
|
+
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
|
|
5406
|
+
}
|
|
5407
|
+
return _extends$4({
|
|
5408
|
+
keys,
|
|
5409
|
+
values: sortedValues,
|
|
5410
|
+
up,
|
|
5411
|
+
down,
|
|
5412
|
+
between,
|
|
5413
|
+
only,
|
|
5414
|
+
not,
|
|
5415
|
+
unit
|
|
5416
|
+
}, other);
|
|
5311
5417
|
}
|
|
5312
5418
|
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
};
|
|
5322
|
-
clearTimeout(timeout);
|
|
5323
|
-
timeout = setTimeout(later, wait);
|
|
5419
|
+
const shape = {
|
|
5420
|
+
borderRadius: 4
|
|
5421
|
+
};
|
|
5422
|
+
var shape$1 = shape;
|
|
5423
|
+
|
|
5424
|
+
function merge(acc, item) {
|
|
5425
|
+
if (!item) {
|
|
5426
|
+
return acc;
|
|
5324
5427
|
}
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
};
|
|
5328
|
-
return debounced;
|
|
5428
|
+
return deepmerge$1(acc, item, {
|
|
5429
|
+
clone: false // No need to clone deep, it's way faster.
|
|
5430
|
+
});
|
|
5329
5431
|
}
|
|
5330
5432
|
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5433
|
+
// The breakpoint **start** at this value.
|
|
5434
|
+
// For instance with the first breakpoint xs: [xs, sm[.
|
|
5435
|
+
const values = {
|
|
5436
|
+
xs: 0,
|
|
5437
|
+
// phone
|
|
5438
|
+
sm: 600,
|
|
5439
|
+
// tablet
|
|
5440
|
+
md: 900,
|
|
5441
|
+
// small laptop
|
|
5442
|
+
lg: 1200,
|
|
5443
|
+
// desktop
|
|
5444
|
+
xl: 1536 // large screen
|
|
5445
|
+
};
|
|
5446
|
+
const defaultBreakpoints = {
|
|
5447
|
+
// Sorted ASC by size. That's important.
|
|
5448
|
+
// It can't be configured as it's used statically for propTypes.
|
|
5449
|
+
keys: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
5450
|
+
up: key => `@media (min-width:${values[key]}px)`
|
|
5451
|
+
};
|
|
5452
|
+
function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
5453
|
+
const theme = props.theme || {};
|
|
5454
|
+
if (Array.isArray(propValue)) {
|
|
5455
|
+
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
5456
|
+
return propValue.reduce((acc, item, index) => {
|
|
5457
|
+
acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
|
|
5458
|
+
return acc;
|
|
5459
|
+
}, {});
|
|
5460
|
+
}
|
|
5461
|
+
if (typeof propValue === 'object') {
|
|
5462
|
+
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
5463
|
+
return Object.keys(propValue).reduce((acc, breakpoint) => {
|
|
5464
|
+
// key is breakpoint
|
|
5465
|
+
if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {
|
|
5466
|
+
const mediaKey = themeBreakpoints.up(breakpoint);
|
|
5467
|
+
acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
|
|
5468
|
+
} else {
|
|
5469
|
+
const cssKey = breakpoint;
|
|
5470
|
+
acc[cssKey] = propValue[cssKey];
|
|
5471
|
+
}
|
|
5472
|
+
return acc;
|
|
5473
|
+
}, {});
|
|
5334
5474
|
}
|
|
5475
|
+
const output = styleFromPropValue(propValue);
|
|
5476
|
+
return output;
|
|
5335
5477
|
}
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5478
|
+
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
5479
|
+
var _breakpointsInput$key;
|
|
5480
|
+
const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
|
|
5481
|
+
const breakpointStyleKey = breakpointsInput.up(key);
|
|
5482
|
+
acc[breakpointStyleKey] = {};
|
|
5483
|
+
return acc;
|
|
5484
|
+
}, {});
|
|
5485
|
+
return breakpointsInOrder || {};
|
|
5343
5486
|
}
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5487
|
+
function removeUnusedBreakpoints(breakpointKeys, style) {
|
|
5488
|
+
return breakpointKeys.reduce((acc, key) => {
|
|
5489
|
+
const breakpointOutput = acc[key];
|
|
5490
|
+
const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
|
|
5491
|
+
if (isBreakpointUnused) {
|
|
5492
|
+
delete acc[key];
|
|
5493
|
+
}
|
|
5494
|
+
return acc;
|
|
5495
|
+
}, style);
|
|
5347
5496
|
}
|
|
5348
5497
|
|
|
5349
|
-
function
|
|
5350
|
-
|
|
5351
|
-
|
|
5498
|
+
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
|
|
5499
|
+
//
|
|
5500
|
+
// A strict capitalization should uppercase the first letter of each word in the sentence.
|
|
5501
|
+
// We only handle the first word.
|
|
5502
|
+
function capitalize$1(string) {
|
|
5503
|
+
if (typeof string !== 'string') {
|
|
5504
|
+
throw new Error(formatMuiErrorMessage$1(7));
|
|
5505
|
+
}
|
|
5506
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
5352
5507
|
}
|
|
5353
5508
|
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5509
|
+
var capitalize = /*#__PURE__*/Object.freeze({
|
|
5510
|
+
__proto__: null,
|
|
5511
|
+
default: capitalize$1
|
|
5512
|
+
});
|
|
5513
|
+
|
|
5514
|
+
function getPath$1(obj, path, checkVars = true) {
|
|
5515
|
+
if (!path || typeof path !== 'string') {
|
|
5516
|
+
return null;
|
|
5357
5517
|
}
|
|
5358
|
-
}
|
|
5359
5518
|
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
5367
|
-
* https://github.com/mui/material-ui/issues/13539
|
|
5368
|
-
*
|
|
5369
|
-
* Useful if you want to expose the ref of an inner component to the public API
|
|
5370
|
-
* while still using it inside the component.
|
|
5371
|
-
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
5372
|
-
*/
|
|
5373
|
-
function setRef(ref, value) {
|
|
5374
|
-
if (typeof ref === 'function') {
|
|
5375
|
-
ref(value);
|
|
5376
|
-
} else if (ref) {
|
|
5377
|
-
ref.current = value;
|
|
5519
|
+
// Check if CSS variables are used
|
|
5520
|
+
if (obj && obj.vars && checkVars) {
|
|
5521
|
+
const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
5522
|
+
if (val != null) {
|
|
5523
|
+
return val;
|
|
5524
|
+
}
|
|
5378
5525
|
}
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
|
|
5383
|
-
* This is useful for effects that are only needed for client-side rendering but not for SSR.
|
|
5384
|
-
*
|
|
5385
|
-
* Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
5386
|
-
* and confirm it doesn't apply to your use-case.
|
|
5387
|
-
*/
|
|
5388
|
-
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
5389
|
-
var useEnhancedEffect$1 = useEnhancedEffect;
|
|
5390
|
-
|
|
5391
|
-
let globalId = 0;
|
|
5392
|
-
function useGlobalId(idOverride) {
|
|
5393
|
-
const [defaultId, setDefaultId] = React.useState(idOverride);
|
|
5394
|
-
const id = idOverride || defaultId;
|
|
5395
|
-
React.useEffect(() => {
|
|
5396
|
-
if (defaultId == null) {
|
|
5397
|
-
// Fallback to this default id when possible.
|
|
5398
|
-
// Use the incrementing value for client-side rendering only.
|
|
5399
|
-
// We can't use it server-side.
|
|
5400
|
-
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
5401
|
-
globalId += 1;
|
|
5402
|
-
setDefaultId(`mui-${globalId}`);
|
|
5526
|
+
return path.split('.').reduce((acc, item) => {
|
|
5527
|
+
if (acc && acc[item] != null) {
|
|
5528
|
+
return acc[item];
|
|
5403
5529
|
}
|
|
5404
|
-
|
|
5405
|
-
|
|
5530
|
+
return null;
|
|
5531
|
+
}, obj);
|
|
5406
5532
|
}
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
*/
|
|
5416
|
-
function useId(idOverride) {
|
|
5417
|
-
if (maybeReactUseId !== undefined) {
|
|
5418
|
-
const reactId = maybeReactUseId();
|
|
5419
|
-
return idOverride != null ? idOverride : reactId;
|
|
5533
|
+
function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
5534
|
+
let value;
|
|
5535
|
+
if (typeof themeMapping === 'function') {
|
|
5536
|
+
value = themeMapping(propValueFinal);
|
|
5537
|
+
} else if (Array.isArray(themeMapping)) {
|
|
5538
|
+
value = themeMapping[propValueFinal] || userValue;
|
|
5539
|
+
} else {
|
|
5540
|
+
value = getPath$1(themeMapping, propValueFinal) || userValue;
|
|
5420
5541
|
}
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
}
|
|
5424
|
-
|
|
5425
|
-
function unsupportedProp(props, propName, componentName, location, propFullName) {
|
|
5426
|
-
{
|
|
5427
|
-
return null;
|
|
5542
|
+
if (transform) {
|
|
5543
|
+
value = transform(value, userValue, themeMapping);
|
|
5428
5544
|
}
|
|
5545
|
+
return value;
|
|
5429
5546
|
}
|
|
5430
|
-
|
|
5431
|
-
function useControlled({
|
|
5432
|
-
controlled,
|
|
5433
|
-
default: defaultProp,
|
|
5434
|
-
name,
|
|
5435
|
-
state = 'value'
|
|
5436
|
-
}) {
|
|
5437
|
-
// isControlled is ignored in the hook dependency lists as it should never change.
|
|
5547
|
+
function style$1(options) {
|
|
5438
5548
|
const {
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
if (!isControlled) {
|
|
5445
|
-
setValue(newValue);
|
|
5446
|
-
}
|
|
5447
|
-
}, []);
|
|
5448
|
-
return [value, setValueIfUncontrolled];
|
|
5449
|
-
}
|
|
5450
|
-
|
|
5451
|
-
/**
|
|
5452
|
-
* Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
5453
|
-
* See RFC in https://github.com/reactjs/rfcs/pull/220
|
|
5454
|
-
*/
|
|
5455
|
-
|
|
5456
|
-
function useEventCallback(fn) {
|
|
5457
|
-
const ref = React.useRef(fn);
|
|
5458
|
-
useEnhancedEffect$1(() => {
|
|
5459
|
-
ref.current = fn;
|
|
5460
|
-
});
|
|
5461
|
-
return React.useRef((...args) =>
|
|
5462
|
-
// @ts-expect-error hide `this`
|
|
5463
|
-
(0, ref.current)(...args)).current;
|
|
5464
|
-
}
|
|
5549
|
+
prop,
|
|
5550
|
+
cssProperty = options.prop,
|
|
5551
|
+
themeKey,
|
|
5552
|
+
transform
|
|
5553
|
+
} = options;
|
|
5465
5554
|
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
* with the ref. Cleanup naturally emerges from this behavior.
|
|
5471
|
-
*/
|
|
5472
|
-
return React.useMemo(() => {
|
|
5473
|
-
if (refs.every(ref => ref == null)) {
|
|
5555
|
+
// false positive
|
|
5556
|
+
// eslint-disable-next-line react/function-component-definition
|
|
5557
|
+
const fn = props => {
|
|
5558
|
+
if (props[prop] == null) {
|
|
5474
5559
|
return null;
|
|
5475
5560
|
}
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5561
|
+
const propValue = props[prop];
|
|
5562
|
+
const theme = props.theme;
|
|
5563
|
+
const themeMapping = getPath$1(theme, themeKey) || {};
|
|
5564
|
+
const styleFromPropValue = propValueFinal => {
|
|
5565
|
+
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
5566
|
+
if (propValueFinal === value && typeof propValueFinal === 'string') {
|
|
5567
|
+
// Haven't found value
|
|
5568
|
+
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize$1(propValueFinal)}`, propValueFinal);
|
|
5569
|
+
}
|
|
5570
|
+
if (cssProperty === false) {
|
|
5571
|
+
return value;
|
|
5572
|
+
}
|
|
5573
|
+
return {
|
|
5574
|
+
[cssProperty]: value
|
|
5575
|
+
};
|
|
5480
5576
|
};
|
|
5481
|
-
|
|
5482
|
-
}
|
|
5577
|
+
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
5578
|
+
};
|
|
5579
|
+
fn.propTypes = {};
|
|
5580
|
+
fn.filterProps = [prop];
|
|
5581
|
+
return fn;
|
|
5483
5582
|
}
|
|
5484
5583
|
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
'
|
|
5584
|
+
function memoize(fn) {
|
|
5585
|
+
const cache = {};
|
|
5586
|
+
return arg => {
|
|
5587
|
+
if (cache[arg] === undefined) {
|
|
5588
|
+
cache[arg] = fn(arg);
|
|
5589
|
+
}
|
|
5590
|
+
return cache[arg];
|
|
5591
|
+
};
|
|
5592
|
+
}
|
|
5593
|
+
|
|
5594
|
+
const properties = {
|
|
5595
|
+
m: 'margin',
|
|
5596
|
+
p: 'padding'
|
|
5597
|
+
};
|
|
5598
|
+
const directions = {
|
|
5599
|
+
t: 'Top',
|
|
5600
|
+
r: 'Right',
|
|
5601
|
+
b: 'Bottom',
|
|
5602
|
+
l: 'Left',
|
|
5603
|
+
x: ['Left', 'Right'],
|
|
5604
|
+
y: ['Top', 'Bottom']
|
|
5605
|
+
};
|
|
5606
|
+
const aliases = {
|
|
5607
|
+
marginX: 'mx',
|
|
5608
|
+
marginY: 'my',
|
|
5609
|
+
paddingX: 'px',
|
|
5610
|
+
paddingY: 'py'
|
|
5502
5611
|
};
|
|
5503
5612
|
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
} = node;
|
|
5516
|
-
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
|
|
5517
|
-
return true;
|
|
5518
|
-
}
|
|
5519
|
-
if (tagName === 'TEXTAREA' && !node.readOnly) {
|
|
5520
|
-
return true;
|
|
5613
|
+
// memoize() impact:
|
|
5614
|
+
// From 300,000 ops/sec
|
|
5615
|
+
// To 350,000 ops/sec
|
|
5616
|
+
const getCssProperties = memoize(prop => {
|
|
5617
|
+
// It's not a shorthand notation.
|
|
5618
|
+
if (prop.length > 2) {
|
|
5619
|
+
if (aliases[prop]) {
|
|
5620
|
+
prop = aliases[prop];
|
|
5621
|
+
} else {
|
|
5622
|
+
return [prop];
|
|
5623
|
+
}
|
|
5521
5624
|
}
|
|
5522
|
-
|
|
5523
|
-
|
|
5625
|
+
const [a, b] = prop.split('');
|
|
5626
|
+
const property = properties[a];
|
|
5627
|
+
const direction = directions[b] || '';
|
|
5628
|
+
return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];
|
|
5629
|
+
});
|
|
5630
|
+
const marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];
|
|
5631
|
+
const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];
|
|
5632
|
+
[...marginKeys, ...paddingKeys];
|
|
5633
|
+
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
5634
|
+
var _getPath;
|
|
5635
|
+
const themeSpacing = (_getPath = getPath$1(theme, themeKey, false)) != null ? _getPath : defaultValue;
|
|
5636
|
+
if (typeof themeSpacing === 'number') {
|
|
5637
|
+
return abs => {
|
|
5638
|
+
if (typeof abs === 'string') {
|
|
5639
|
+
return abs;
|
|
5640
|
+
}
|
|
5641
|
+
return themeSpacing * abs;
|
|
5642
|
+
};
|
|
5524
5643
|
}
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
* then the modality is keyboard. Otherwise, the modality is not keyboard.
|
|
5533
|
-
* @param {KeyboardEvent} event
|
|
5534
|
-
*/
|
|
5535
|
-
function handleKeyDown(event) {
|
|
5536
|
-
if (event.metaKey || event.altKey || event.ctrlKey) {
|
|
5537
|
-
return;
|
|
5644
|
+
if (Array.isArray(themeSpacing)) {
|
|
5645
|
+
return abs => {
|
|
5646
|
+
if (typeof abs === 'string') {
|
|
5647
|
+
return abs;
|
|
5648
|
+
}
|
|
5649
|
+
return themeSpacing[abs];
|
|
5650
|
+
};
|
|
5538
5651
|
}
|
|
5539
|
-
|
|
5652
|
+
if (typeof themeSpacing === 'function') {
|
|
5653
|
+
return themeSpacing;
|
|
5654
|
+
}
|
|
5655
|
+
return () => undefined;
|
|
5540
5656
|
}
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
* If at any point a user clicks with a pointing device, ensure that we change
|
|
5544
|
-
* the modality away from keyboard.
|
|
5545
|
-
* This avoids the situation where a user presses a key on an already focused
|
|
5546
|
-
* element, and then clicks on a different element, focusing it with a
|
|
5547
|
-
* pointing device, while we still think we're in keyboard modality.
|
|
5548
|
-
*/
|
|
5549
|
-
function handlePointerDown() {
|
|
5550
|
-
hadKeyboardEvent = false;
|
|
5657
|
+
function createUnarySpacing(theme) {
|
|
5658
|
+
return createUnaryUnit(theme, 'spacing', 8);
|
|
5551
5659
|
}
|
|
5552
|
-
function
|
|
5553
|
-
if (
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5660
|
+
function getValue$2(transformer, propValue) {
|
|
5661
|
+
if (typeof propValue === 'string' || propValue == null) {
|
|
5662
|
+
return propValue;
|
|
5663
|
+
}
|
|
5664
|
+
const abs = Math.abs(propValue);
|
|
5665
|
+
const transformed = transformer(abs);
|
|
5666
|
+
if (propValue >= 0) {
|
|
5667
|
+
return transformed;
|
|
5668
|
+
}
|
|
5669
|
+
if (typeof transformed === 'number') {
|
|
5670
|
+
return -transformed;
|
|
5561
5671
|
}
|
|
5672
|
+
return `-${transformed}`;
|
|
5562
5673
|
}
|
|
5563
|
-
function
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
doc.addEventListener('visibilitychange', handleVisibilityChange, true);
|
|
5674
|
+
function getStyleFromPropValue(cssProperties, transformer) {
|
|
5675
|
+
return propValue => cssProperties.reduce((acc, cssProperty) => {
|
|
5676
|
+
acc[cssProperty] = getValue$2(transformer, propValue);
|
|
5677
|
+
return acc;
|
|
5678
|
+
}, {});
|
|
5569
5679
|
}
|
|
5570
|
-
function
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
return target.matches(':focus-visible');
|
|
5576
|
-
} catch (error) {
|
|
5577
|
-
// Browsers not implementing :focus-visible will throw a SyntaxError.
|
|
5578
|
-
// We use our own heuristic for those browsers.
|
|
5579
|
-
// Rethrow might be better if it's not the expected error but do we really
|
|
5580
|
-
// want to crash if focus-visible malfunctioned?
|
|
5680
|
+
function resolveCssProperty(props, keys, prop, transformer) {
|
|
5681
|
+
// Using a hash computation over an array iteration could be faster, but with only 28 items,
|
|
5682
|
+
// it's doesn't worth the bundle size.
|
|
5683
|
+
if (keys.indexOf(prop) === -1) {
|
|
5684
|
+
return null;
|
|
5581
5685
|
}
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
return
|
|
5686
|
+
const cssProperties = getCssProperties(prop);
|
|
5687
|
+
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
|
5688
|
+
const propValue = props[prop];
|
|
5689
|
+
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
5586
5690
|
}
|
|
5587
|
-
function
|
|
5588
|
-
const
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5691
|
+
function style(props, keys) {
|
|
5692
|
+
const transformer = createUnarySpacing(props.theme);
|
|
5693
|
+
return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});
|
|
5694
|
+
}
|
|
5695
|
+
function margin(props) {
|
|
5696
|
+
return style(props, marginKeys);
|
|
5697
|
+
}
|
|
5698
|
+
margin.propTypes = {};
|
|
5699
|
+
margin.filterProps = marginKeys;
|
|
5700
|
+
function padding(props) {
|
|
5701
|
+
return style(props, paddingKeys);
|
|
5702
|
+
}
|
|
5703
|
+
padding.propTypes = {};
|
|
5704
|
+
padding.filterProps = paddingKeys;
|
|
5594
5705
|
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
*/
|
|
5598
|
-
function handleBlurVisible() {
|
|
5599
|
-
// checking against potential state variable does not suffice if we focus and blur synchronously.
|
|
5600
|
-
// React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
|
|
5601
|
-
// Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
|
|
5602
|
-
// This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
|
|
5603
|
-
// TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
|
|
5604
|
-
if (isFocusVisibleRef.current) {
|
|
5605
|
-
// To detect a tab/window switch, we look for a blur event followed
|
|
5606
|
-
// rapidly by a visibility change.
|
|
5607
|
-
// If we don't see a visibility change within 100ms, it's probably a
|
|
5608
|
-
// regular focus change.
|
|
5609
|
-
hadFocusVisibleRecently = true;
|
|
5610
|
-
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
|
|
5611
|
-
hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {
|
|
5612
|
-
hadFocusVisibleRecently = false;
|
|
5613
|
-
}, 100);
|
|
5614
|
-
isFocusVisibleRef.current = false;
|
|
5615
|
-
return true;
|
|
5616
|
-
}
|
|
5617
|
-
return false;
|
|
5618
|
-
}
|
|
5706
|
+
// The different signatures imply different meaning for their arguments that can't be expressed structurally.
|
|
5707
|
+
// We express the difference with variable names.
|
|
5619
5708
|
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
if (isFocusVisible(event)) {
|
|
5625
|
-
isFocusVisibleRef.current = true;
|
|
5626
|
-
return true;
|
|
5627
|
-
}
|
|
5628
|
-
return false;
|
|
5709
|
+
function createSpacing(spacingInput = 8) {
|
|
5710
|
+
// Already transformed.
|
|
5711
|
+
if (spacingInput.mui) {
|
|
5712
|
+
return spacingInput;
|
|
5629
5713
|
}
|
|
5630
|
-
return {
|
|
5631
|
-
isFocusVisibleRef,
|
|
5632
|
-
onFocus: handleFocusVisible,
|
|
5633
|
-
onBlur: handleBlurVisible,
|
|
5634
|
-
ref
|
|
5635
|
-
};
|
|
5636
|
-
}
|
|
5637
5714
|
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
*/
|
|
5644
|
-
function resolveProps(defaultProps, props) {
|
|
5645
|
-
const output = _extends$2({}, props);
|
|
5646
|
-
Object.keys(defaultProps).forEach(propName => {
|
|
5647
|
-
if (propName.toString().match(/^(components|slots)$/)) {
|
|
5648
|
-
output[propName] = _extends$2({}, defaultProps[propName], output[propName]);
|
|
5649
|
-
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
5650
|
-
const defaultSlotProps = defaultProps[propName] || {};
|
|
5651
|
-
const slotProps = props[propName];
|
|
5652
|
-
output[propName] = {};
|
|
5653
|
-
if (!slotProps || !Object.keys(slotProps)) {
|
|
5654
|
-
// Reduce the iteration if the slot props is empty
|
|
5655
|
-
output[propName] = defaultSlotProps;
|
|
5656
|
-
} else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
|
|
5657
|
-
// Reduce the iteration if the default slot props is empty
|
|
5658
|
-
output[propName] = slotProps;
|
|
5659
|
-
} else {
|
|
5660
|
-
output[propName] = _extends$2({}, slotProps);
|
|
5661
|
-
Object.keys(defaultSlotProps).forEach(slotPropName => {
|
|
5662
|
-
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
5663
|
-
});
|
|
5664
|
-
}
|
|
5665
|
-
} else if (output[propName] === undefined) {
|
|
5666
|
-
output[propName] = defaultProps[propName];
|
|
5667
|
-
}
|
|
5715
|
+
// Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.
|
|
5716
|
+
// Smaller components, such as icons, can align to a 4dp grid.
|
|
5717
|
+
// https://m2.material.io/design/layout/understanding-layout.html
|
|
5718
|
+
const transform = createUnarySpacing({
|
|
5719
|
+
spacing: spacingInput
|
|
5668
5720
|
});
|
|
5669
|
-
|
|
5721
|
+
const spacing = (...argsInput) => {
|
|
5722
|
+
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
5723
|
+
return args.map(argument => {
|
|
5724
|
+
const output = transform(argument);
|
|
5725
|
+
return typeof output === 'number' ? `${output}px` : output;
|
|
5726
|
+
}).join(' ');
|
|
5727
|
+
};
|
|
5728
|
+
spacing.mui = true;
|
|
5729
|
+
return spacing;
|
|
5670
5730
|
}
|
|
5671
5731
|
|
|
5672
|
-
function
|
|
5673
|
-
const
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
}
|
|
5732
|
+
function compose(...styles) {
|
|
5733
|
+
const handlers = styles.reduce((acc, style) => {
|
|
5734
|
+
style.filterProps.forEach(prop => {
|
|
5735
|
+
acc[prop] = style;
|
|
5736
|
+
});
|
|
5737
|
+
return acc;
|
|
5738
|
+
}, {});
|
|
5739
|
+
|
|
5740
|
+
// false positive
|
|
5741
|
+
// eslint-disable-next-line react/function-component-definition
|
|
5742
|
+
const fn = props => {
|
|
5743
|
+
return Object.keys(props).reduce((acc, prop) => {
|
|
5744
|
+
if (handlers[prop]) {
|
|
5745
|
+
return merge(acc, handlers[prop](props));
|
|
5687
5746
|
}
|
|
5688
5747
|
return acc;
|
|
5689
|
-
},
|
|
5748
|
+
}, {});
|
|
5749
|
+
};
|
|
5750
|
+
fn.propTypes = {};
|
|
5751
|
+
fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);
|
|
5752
|
+
return fn;
|
|
5753
|
+
}
|
|
5754
|
+
|
|
5755
|
+
function borderTransform(value) {
|
|
5756
|
+
if (typeof value !== 'number') {
|
|
5757
|
+
return value;
|
|
5758
|
+
}
|
|
5759
|
+
return `${value}px solid`;
|
|
5760
|
+
}
|
|
5761
|
+
function createBorderStyle(prop, transform) {
|
|
5762
|
+
return style$1({
|
|
5763
|
+
prop,
|
|
5764
|
+
themeKey: 'borders',
|
|
5765
|
+
transform
|
|
5690
5766
|
});
|
|
5691
|
-
return output;
|
|
5692
5767
|
}
|
|
5768
|
+
const border = createBorderStyle('border', borderTransform);
|
|
5769
|
+
const borderTop = createBorderStyle('borderTop', borderTransform);
|
|
5770
|
+
const borderRight = createBorderStyle('borderRight', borderTransform);
|
|
5771
|
+
const borderBottom = createBorderStyle('borderBottom', borderTransform);
|
|
5772
|
+
const borderLeft = createBorderStyle('borderLeft', borderTransform);
|
|
5773
|
+
const borderColor = createBorderStyle('borderColor');
|
|
5774
|
+
const borderTopColor = createBorderStyle('borderTopColor');
|
|
5775
|
+
const borderRightColor = createBorderStyle('borderRightColor');
|
|
5776
|
+
const borderBottomColor = createBorderStyle('borderBottomColor');
|
|
5777
|
+
const borderLeftColor = createBorderStyle('borderLeftColor');
|
|
5778
|
+
const outline = createBorderStyle('outline', borderTransform);
|
|
5779
|
+
const outlineColor = createBorderStyle('outlineColor');
|
|
5693
5780
|
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
generate = defaultGenerator;
|
|
5706
|
-
}
|
|
5707
|
-
};
|
|
5781
|
+
// false positive
|
|
5782
|
+
// eslint-disable-next-line react/function-component-definition
|
|
5783
|
+
const borderRadius$1 = props => {
|
|
5784
|
+
if (props.borderRadius !== undefined && props.borderRadius !== null) {
|
|
5785
|
+
const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4);
|
|
5786
|
+
const styleFromPropValue = propValue => ({
|
|
5787
|
+
borderRadius: getValue$2(transformer, propValue)
|
|
5788
|
+
});
|
|
5789
|
+
return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
|
|
5790
|
+
}
|
|
5791
|
+
return null;
|
|
5708
5792
|
};
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
// \packages\api-docs-builder\utils\parseSlotsAndClasses.ts must be updated accordingly.
|
|
5793
|
+
borderRadius$1.propTypes = {};
|
|
5794
|
+
borderRadius$1.filterProps = ['borderRadius'];
|
|
5795
|
+
compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius$1, outline, outlineColor);
|
|
5713
5796
|
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
required: 'required',
|
|
5726
|
-
selected: 'selected'
|
|
5797
|
+
// false positive
|
|
5798
|
+
// eslint-disable-next-line react/function-component-definition
|
|
5799
|
+
const gap = props => {
|
|
5800
|
+
if (props.gap !== undefined && props.gap !== null) {
|
|
5801
|
+
const transformer = createUnaryUnit(props.theme, 'spacing', 8);
|
|
5802
|
+
const styleFromPropValue = propValue => ({
|
|
5803
|
+
gap: getValue$2(transformer, propValue)
|
|
5804
|
+
});
|
|
5805
|
+
return handleBreakpoints(props, props.gap, styleFromPropValue);
|
|
5806
|
+
}
|
|
5807
|
+
return null;
|
|
5727
5808
|
};
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
|
5731
|
-
}
|
|
5732
|
-
|
|
5733
|
-
function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {
|
|
5734
|
-
const result = {};
|
|
5735
|
-
slots.forEach(slot => {
|
|
5736
|
-
result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
|
|
5737
|
-
});
|
|
5738
|
-
return result;
|
|
5739
|
-
}
|
|
5809
|
+
gap.propTypes = {};
|
|
5810
|
+
gap.filterProps = ['gap'];
|
|
5740
5811
|
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
5749
|
-
return breakpointsAsArray.reduce((acc, obj) => {
|
|
5750
|
-
return _extends$3({}, acc, {
|
|
5751
|
-
[obj.key]: obj.val
|
|
5812
|
+
// false positive
|
|
5813
|
+
// eslint-disable-next-line react/function-component-definition
|
|
5814
|
+
const columnGap = props => {
|
|
5815
|
+
if (props.columnGap !== undefined && props.columnGap !== null) {
|
|
5816
|
+
const transformer = createUnaryUnit(props.theme, 'spacing', 8);
|
|
5817
|
+
const styleFromPropValue = propValue => ({
|
|
5818
|
+
columnGap: getValue$2(transformer, propValue)
|
|
5752
5819
|
});
|
|
5753
|
-
|
|
5820
|
+
return handleBreakpoints(props, props.columnGap, styleFromPropValue);
|
|
5821
|
+
}
|
|
5822
|
+
return null;
|
|
5754
5823
|
};
|
|
5824
|
+
columnGap.propTypes = {};
|
|
5825
|
+
columnGap.filterProps = ['columnGap'];
|
|
5755
5826
|
|
|
5756
|
-
//
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
// tablet
|
|
5766
|
-
md: 900,
|
|
5767
|
-
// small laptop
|
|
5768
|
-
lg: 1200,
|
|
5769
|
-
// desktop
|
|
5770
|
-
xl: 1536 // large screen
|
|
5771
|
-
},
|
|
5772
|
-
unit = 'px',
|
|
5773
|
-
step = 5
|
|
5774
|
-
} = breakpoints,
|
|
5775
|
-
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$g);
|
|
5776
|
-
const sortedValues = sortBreakpointsValues(values);
|
|
5777
|
-
const keys = Object.keys(sortedValues);
|
|
5778
|
-
function up(key) {
|
|
5779
|
-
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
5780
|
-
return `@media (min-width:${value}${unit})`;
|
|
5781
|
-
}
|
|
5782
|
-
function down(key) {
|
|
5783
|
-
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
5784
|
-
return `@media (max-width:${value - step / 100}${unit})`;
|
|
5785
|
-
}
|
|
5786
|
-
function between(start, end) {
|
|
5787
|
-
const endIndex = keys.indexOf(end);
|
|
5788
|
-
return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;
|
|
5789
|
-
}
|
|
5790
|
-
function only(key) {
|
|
5791
|
-
if (keys.indexOf(key) + 1 < keys.length) {
|
|
5792
|
-
return between(key, keys[keys.indexOf(key) + 1]);
|
|
5793
|
-
}
|
|
5794
|
-
return up(key);
|
|
5795
|
-
}
|
|
5796
|
-
function not(key) {
|
|
5797
|
-
// handle first and last key separately, for better readability
|
|
5798
|
-
const keyIndex = keys.indexOf(key);
|
|
5799
|
-
if (keyIndex === 0) {
|
|
5800
|
-
return up(keys[1]);
|
|
5801
|
-
}
|
|
5802
|
-
if (keyIndex === keys.length - 1) {
|
|
5803
|
-
return down(keys[keyIndex]);
|
|
5804
|
-
}
|
|
5805
|
-
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
|
|
5827
|
+
// false positive
|
|
5828
|
+
// eslint-disable-next-line react/function-component-definition
|
|
5829
|
+
const rowGap = props => {
|
|
5830
|
+
if (props.rowGap !== undefined && props.rowGap !== null) {
|
|
5831
|
+
const transformer = createUnaryUnit(props.theme, 'spacing', 8);
|
|
5832
|
+
const styleFromPropValue = propValue => ({
|
|
5833
|
+
rowGap: getValue$2(transformer, propValue)
|
|
5834
|
+
});
|
|
5835
|
+
return handleBreakpoints(props, props.rowGap, styleFromPropValue);
|
|
5806
5836
|
}
|
|
5807
|
-
return
|
|
5808
|
-
keys,
|
|
5809
|
-
values: sortedValues,
|
|
5810
|
-
up,
|
|
5811
|
-
down,
|
|
5812
|
-
between,
|
|
5813
|
-
only,
|
|
5814
|
-
not,
|
|
5815
|
-
unit
|
|
5816
|
-
}, other);
|
|
5817
|
-
}
|
|
5818
|
-
|
|
5819
|
-
const shape = {
|
|
5820
|
-
borderRadius: 4
|
|
5837
|
+
return null;
|
|
5821
5838
|
};
|
|
5822
|
-
|
|
5839
|
+
rowGap.propTypes = {};
|
|
5840
|
+
rowGap.filterProps = ['rowGap'];
|
|
5841
|
+
const gridColumn = style$1({
|
|
5842
|
+
prop: 'gridColumn'
|
|
5843
|
+
});
|
|
5844
|
+
const gridRow = style$1({
|
|
5845
|
+
prop: 'gridRow'
|
|
5846
|
+
});
|
|
5847
|
+
const gridAutoFlow = style$1({
|
|
5848
|
+
prop: 'gridAutoFlow'
|
|
5849
|
+
});
|
|
5850
|
+
const gridAutoColumns = style$1({
|
|
5851
|
+
prop: 'gridAutoColumns'
|
|
5852
|
+
});
|
|
5853
|
+
const gridAutoRows = style$1({
|
|
5854
|
+
prop: 'gridAutoRows'
|
|
5855
|
+
});
|
|
5856
|
+
const gridTemplateColumns = style$1({
|
|
5857
|
+
prop: 'gridTemplateColumns'
|
|
5858
|
+
});
|
|
5859
|
+
const gridTemplateRows = style$1({
|
|
5860
|
+
prop: 'gridTemplateRows'
|
|
5861
|
+
});
|
|
5862
|
+
const gridTemplateAreas = style$1({
|
|
5863
|
+
prop: 'gridTemplateAreas'
|
|
5864
|
+
});
|
|
5865
|
+
const gridArea = style$1({
|
|
5866
|
+
prop: 'gridArea'
|
|
5867
|
+
});
|
|
5868
|
+
compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
|
5823
5869
|
|
|
5824
|
-
function
|
|
5825
|
-
if (
|
|
5826
|
-
return
|
|
5870
|
+
function paletteTransform(value, userValue) {
|
|
5871
|
+
if (userValue === 'grey') {
|
|
5872
|
+
return userValue;
|
|
5827
5873
|
}
|
|
5828
|
-
return
|
|
5829
|
-
clone: false // No need to clone deep, it's way faster.
|
|
5830
|
-
});
|
|
5874
|
+
return value;
|
|
5831
5875
|
}
|
|
5876
|
+
const color = style$1({
|
|
5877
|
+
prop: 'color',
|
|
5878
|
+
themeKey: 'palette',
|
|
5879
|
+
transform: paletteTransform
|
|
5880
|
+
});
|
|
5881
|
+
const bgcolor = style$1({
|
|
5882
|
+
prop: 'bgcolor',
|
|
5883
|
+
cssProperty: 'backgroundColor',
|
|
5884
|
+
themeKey: 'palette',
|
|
5885
|
+
transform: paletteTransform
|
|
5886
|
+
});
|
|
5887
|
+
const backgroundColor = style$1({
|
|
5888
|
+
prop: 'backgroundColor',
|
|
5889
|
+
themeKey: 'palette',
|
|
5890
|
+
transform: paletteTransform
|
|
5891
|
+
});
|
|
5892
|
+
compose(color, bgcolor, backgroundColor);
|
|
5832
5893
|
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
const values = {
|
|
5836
|
-
xs: 0,
|
|
5837
|
-
// phone
|
|
5838
|
-
sm: 600,
|
|
5839
|
-
// tablet
|
|
5840
|
-
md: 900,
|
|
5841
|
-
// small laptop
|
|
5842
|
-
lg: 1200,
|
|
5843
|
-
// desktop
|
|
5844
|
-
xl: 1536 // large screen
|
|
5845
|
-
};
|
|
5846
|
-
const defaultBreakpoints = {
|
|
5847
|
-
// Sorted ASC by size. That's important.
|
|
5848
|
-
// It can't be configured as it's used statically for propTypes.
|
|
5849
|
-
keys: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
5850
|
-
up: key => `@media (min-width:${values[key]}px)`
|
|
5851
|
-
};
|
|
5852
|
-
function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
5853
|
-
const theme = props.theme || {};
|
|
5854
|
-
if (Array.isArray(propValue)) {
|
|
5855
|
-
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
5856
|
-
return propValue.reduce((acc, item, index) => {
|
|
5857
|
-
acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
|
|
5858
|
-
return acc;
|
|
5859
|
-
}, {});
|
|
5860
|
-
}
|
|
5861
|
-
if (typeof propValue === 'object') {
|
|
5862
|
-
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
5863
|
-
return Object.keys(propValue).reduce((acc, breakpoint) => {
|
|
5864
|
-
// key is breakpoint
|
|
5865
|
-
if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {
|
|
5866
|
-
const mediaKey = themeBreakpoints.up(breakpoint);
|
|
5867
|
-
acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
|
|
5868
|
-
} else {
|
|
5869
|
-
const cssKey = breakpoint;
|
|
5870
|
-
acc[cssKey] = propValue[cssKey];
|
|
5871
|
-
}
|
|
5872
|
-
return acc;
|
|
5873
|
-
}, {});
|
|
5874
|
-
}
|
|
5875
|
-
const output = styleFromPropValue(propValue);
|
|
5876
|
-
return output;
|
|
5877
|
-
}
|
|
5878
|
-
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
5879
|
-
var _breakpointsInput$key;
|
|
5880
|
-
const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
|
|
5881
|
-
const breakpointStyleKey = breakpointsInput.up(key);
|
|
5882
|
-
acc[breakpointStyleKey] = {};
|
|
5883
|
-
return acc;
|
|
5884
|
-
}, {});
|
|
5885
|
-
return breakpointsInOrder || {};
|
|
5886
|
-
}
|
|
5887
|
-
function removeUnusedBreakpoints(breakpointKeys, style) {
|
|
5888
|
-
return breakpointKeys.reduce((acc, key) => {
|
|
5889
|
-
const breakpointOutput = acc[key];
|
|
5890
|
-
const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
|
|
5891
|
-
if (isBreakpointUnused) {
|
|
5892
|
-
delete acc[key];
|
|
5893
|
-
}
|
|
5894
|
-
return acc;
|
|
5895
|
-
}, style);
|
|
5896
|
-
}
|
|
5897
|
-
|
|
5898
|
-
function getPath$1(obj, path, checkVars = true) {
|
|
5899
|
-
if (!path || typeof path !== 'string') {
|
|
5900
|
-
return null;
|
|
5901
|
-
}
|
|
5902
|
-
|
|
5903
|
-
// Check if CSS variables are used
|
|
5904
|
-
if (obj && obj.vars && checkVars) {
|
|
5905
|
-
const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
5906
|
-
if (val != null) {
|
|
5907
|
-
return val;
|
|
5908
|
-
}
|
|
5909
|
-
}
|
|
5910
|
-
return path.split('.').reduce((acc, item) => {
|
|
5911
|
-
if (acc && acc[item] != null) {
|
|
5912
|
-
return acc[item];
|
|
5913
|
-
}
|
|
5914
|
-
return null;
|
|
5915
|
-
}, obj);
|
|
5916
|
-
}
|
|
5917
|
-
function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
5918
|
-
let value;
|
|
5919
|
-
if (typeof themeMapping === 'function') {
|
|
5920
|
-
value = themeMapping(propValueFinal);
|
|
5921
|
-
} else if (Array.isArray(themeMapping)) {
|
|
5922
|
-
value = themeMapping[propValueFinal] || userValue;
|
|
5923
|
-
} else {
|
|
5924
|
-
value = getPath$1(themeMapping, propValueFinal) || userValue;
|
|
5925
|
-
}
|
|
5926
|
-
if (transform) {
|
|
5927
|
-
value = transform(value, userValue, themeMapping);
|
|
5928
|
-
}
|
|
5929
|
-
return value;
|
|
5894
|
+
function sizingTransform(value) {
|
|
5895
|
+
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
5930
5896
|
}
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
}
|
|
5945
|
-
const propValue = props[prop];
|
|
5946
|
-
const theme = props.theme;
|
|
5947
|
-
const themeMapping = getPath$1(theme, themeKey) || {};
|
|
5948
|
-
const styleFromPropValue = propValueFinal => {
|
|
5949
|
-
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
5950
|
-
if (propValueFinal === value && typeof propValueFinal === 'string') {
|
|
5951
|
-
// Haven't found value
|
|
5952
|
-
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);
|
|
5897
|
+
const width = style$1({
|
|
5898
|
+
prop: 'width',
|
|
5899
|
+
transform: sizingTransform
|
|
5900
|
+
});
|
|
5901
|
+
const maxWidth = props => {
|
|
5902
|
+
if (props.maxWidth !== undefined && props.maxWidth !== null) {
|
|
5903
|
+
const styleFromPropValue = propValue => {
|
|
5904
|
+
var _props$theme, _props$theme2;
|
|
5905
|
+
const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || values[propValue];
|
|
5906
|
+
if (!breakpoint) {
|
|
5907
|
+
return {
|
|
5908
|
+
maxWidth: sizingTransform(propValue)
|
|
5909
|
+
};
|
|
5953
5910
|
}
|
|
5954
|
-
if (
|
|
5955
|
-
return
|
|
5911
|
+
if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {
|
|
5912
|
+
return {
|
|
5913
|
+
maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
|
|
5914
|
+
};
|
|
5956
5915
|
}
|
|
5957
5916
|
return {
|
|
5958
|
-
|
|
5917
|
+
maxWidth: breakpoint
|
|
5959
5918
|
};
|
|
5960
5919
|
};
|
|
5961
|
-
return handleBreakpoints(props,
|
|
5962
|
-
};
|
|
5963
|
-
fn.propTypes = {};
|
|
5964
|
-
fn.filterProps = [prop];
|
|
5965
|
-
return fn;
|
|
5966
|
-
}
|
|
5967
|
-
|
|
5968
|
-
function memoize(fn) {
|
|
5969
|
-
const cache = {};
|
|
5970
|
-
return arg => {
|
|
5971
|
-
if (cache[arg] === undefined) {
|
|
5972
|
-
cache[arg] = fn(arg);
|
|
5973
|
-
}
|
|
5974
|
-
return cache[arg];
|
|
5975
|
-
};
|
|
5976
|
-
}
|
|
5977
|
-
|
|
5978
|
-
const properties = {
|
|
5979
|
-
m: 'margin',
|
|
5980
|
-
p: 'padding'
|
|
5981
|
-
};
|
|
5982
|
-
const directions = {
|
|
5983
|
-
t: 'Top',
|
|
5984
|
-
r: 'Right',
|
|
5985
|
-
b: 'Bottom',
|
|
5986
|
-
l: 'Left',
|
|
5987
|
-
x: ['Left', 'Right'],
|
|
5988
|
-
y: ['Top', 'Bottom']
|
|
5989
|
-
};
|
|
5990
|
-
const aliases = {
|
|
5991
|
-
marginX: 'mx',
|
|
5992
|
-
marginY: 'my',
|
|
5993
|
-
paddingX: 'px',
|
|
5994
|
-
paddingY: 'py'
|
|
5995
|
-
};
|
|
5996
|
-
|
|
5997
|
-
// memoize() impact:
|
|
5998
|
-
// From 300,000 ops/sec
|
|
5999
|
-
// To 350,000 ops/sec
|
|
6000
|
-
const getCssProperties = memoize(prop => {
|
|
6001
|
-
// It's not a shorthand notation.
|
|
6002
|
-
if (prop.length > 2) {
|
|
6003
|
-
if (aliases[prop]) {
|
|
6004
|
-
prop = aliases[prop];
|
|
6005
|
-
} else {
|
|
6006
|
-
return [prop];
|
|
6007
|
-
}
|
|
5920
|
+
return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
|
|
6008
5921
|
}
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];
|
|
6016
|
-
[...marginKeys, ...paddingKeys];
|
|
6017
|
-
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
6018
|
-
var _getPath;
|
|
6019
|
-
const themeSpacing = (_getPath = getPath$1(theme, themeKey, false)) != null ? _getPath : defaultValue;
|
|
6020
|
-
if (typeof themeSpacing === 'number') {
|
|
6021
|
-
return abs => {
|
|
6022
|
-
if (typeof abs === 'string') {
|
|
6023
|
-
return abs;
|
|
6024
|
-
}
|
|
6025
|
-
return themeSpacing * abs;
|
|
6026
|
-
};
|
|
6027
|
-
}
|
|
6028
|
-
if (Array.isArray(themeSpacing)) {
|
|
6029
|
-
return abs => {
|
|
6030
|
-
if (typeof abs === 'string') {
|
|
6031
|
-
return abs;
|
|
6032
|
-
}
|
|
6033
|
-
return themeSpacing[abs];
|
|
6034
|
-
};
|
|
6035
|
-
}
|
|
6036
|
-
if (typeof themeSpacing === 'function') {
|
|
6037
|
-
return themeSpacing;
|
|
6038
|
-
}
|
|
6039
|
-
return () => undefined;
|
|
6040
|
-
}
|
|
6041
|
-
function createUnarySpacing(theme) {
|
|
6042
|
-
return createUnaryUnit(theme, 'spacing', 8);
|
|
6043
|
-
}
|
|
6044
|
-
function getValue$2(transformer, propValue) {
|
|
6045
|
-
if (typeof propValue === 'string' || propValue == null) {
|
|
6046
|
-
return propValue;
|
|
6047
|
-
}
|
|
6048
|
-
const abs = Math.abs(propValue);
|
|
6049
|
-
const transformed = transformer(abs);
|
|
6050
|
-
if (propValue >= 0) {
|
|
6051
|
-
return transformed;
|
|
6052
|
-
}
|
|
6053
|
-
if (typeof transformed === 'number') {
|
|
6054
|
-
return -transformed;
|
|
6055
|
-
}
|
|
6056
|
-
return `-${transformed}`;
|
|
6057
|
-
}
|
|
6058
|
-
function getStyleFromPropValue(cssProperties, transformer) {
|
|
6059
|
-
return propValue => cssProperties.reduce((acc, cssProperty) => {
|
|
6060
|
-
acc[cssProperty] = getValue$2(transformer, propValue);
|
|
6061
|
-
return acc;
|
|
6062
|
-
}, {});
|
|
6063
|
-
}
|
|
6064
|
-
function resolveCssProperty(props, keys, prop, transformer) {
|
|
6065
|
-
// Using a hash computation over an array iteration could be faster, but with only 28 items,
|
|
6066
|
-
// it's doesn't worth the bundle size.
|
|
6067
|
-
if (keys.indexOf(prop) === -1) {
|
|
6068
|
-
return null;
|
|
6069
|
-
}
|
|
6070
|
-
const cssProperties = getCssProperties(prop);
|
|
6071
|
-
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
|
6072
|
-
const propValue = props[prop];
|
|
6073
|
-
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
6074
|
-
}
|
|
6075
|
-
function style(props, keys) {
|
|
6076
|
-
const transformer = createUnarySpacing(props.theme);
|
|
6077
|
-
return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});
|
|
6078
|
-
}
|
|
6079
|
-
function margin(props) {
|
|
6080
|
-
return style(props, marginKeys);
|
|
6081
|
-
}
|
|
6082
|
-
margin.propTypes = {};
|
|
6083
|
-
margin.filterProps = marginKeys;
|
|
6084
|
-
function padding(props) {
|
|
6085
|
-
return style(props, paddingKeys);
|
|
6086
|
-
}
|
|
6087
|
-
padding.propTypes = {};
|
|
6088
|
-
padding.filterProps = paddingKeys;
|
|
6089
|
-
|
|
6090
|
-
// The different signatures imply different meaning for their arguments that can't be expressed structurally.
|
|
6091
|
-
// We express the difference with variable names.
|
|
6092
|
-
|
|
6093
|
-
function createSpacing(spacingInput = 8) {
|
|
6094
|
-
// Already transformed.
|
|
6095
|
-
if (spacingInput.mui) {
|
|
6096
|
-
return spacingInput;
|
|
6097
|
-
}
|
|
6098
|
-
|
|
6099
|
-
// Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.
|
|
6100
|
-
// Smaller components, such as icons, can align to a 4dp grid.
|
|
6101
|
-
// https://m2.material.io/design/layout/understanding-layout.html
|
|
6102
|
-
const transform = createUnarySpacing({
|
|
6103
|
-
spacing: spacingInput
|
|
6104
|
-
});
|
|
6105
|
-
const spacing = (...argsInput) => {
|
|
6106
|
-
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
6107
|
-
return args.map(argument => {
|
|
6108
|
-
const output = transform(argument);
|
|
6109
|
-
return typeof output === 'number' ? `${output}px` : output;
|
|
6110
|
-
}).join(' ');
|
|
6111
|
-
};
|
|
6112
|
-
spacing.mui = true;
|
|
6113
|
-
return spacing;
|
|
6114
|
-
}
|
|
6115
|
-
|
|
6116
|
-
function compose(...styles) {
|
|
6117
|
-
const handlers = styles.reduce((acc, style) => {
|
|
6118
|
-
style.filterProps.forEach(prop => {
|
|
6119
|
-
acc[prop] = style;
|
|
6120
|
-
});
|
|
6121
|
-
return acc;
|
|
6122
|
-
}, {});
|
|
6123
|
-
|
|
6124
|
-
// false positive
|
|
6125
|
-
// eslint-disable-next-line react/function-component-definition
|
|
6126
|
-
const fn = props => {
|
|
6127
|
-
return Object.keys(props).reduce((acc, prop) => {
|
|
6128
|
-
if (handlers[prop]) {
|
|
6129
|
-
return merge(acc, handlers[prop](props));
|
|
6130
|
-
}
|
|
6131
|
-
return acc;
|
|
6132
|
-
}, {});
|
|
6133
|
-
};
|
|
6134
|
-
fn.propTypes = {};
|
|
6135
|
-
fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);
|
|
6136
|
-
return fn;
|
|
6137
|
-
}
|
|
6138
|
-
|
|
6139
|
-
function borderTransform(value) {
|
|
6140
|
-
if (typeof value !== 'number') {
|
|
6141
|
-
return value;
|
|
6142
|
-
}
|
|
6143
|
-
return `${value}px solid`;
|
|
6144
|
-
}
|
|
6145
|
-
function createBorderStyle(prop, transform) {
|
|
6146
|
-
return style$1({
|
|
6147
|
-
prop,
|
|
6148
|
-
themeKey: 'borders',
|
|
6149
|
-
transform
|
|
6150
|
-
});
|
|
6151
|
-
}
|
|
6152
|
-
const border = createBorderStyle('border', borderTransform);
|
|
6153
|
-
const borderTop = createBorderStyle('borderTop', borderTransform);
|
|
6154
|
-
const borderRight = createBorderStyle('borderRight', borderTransform);
|
|
6155
|
-
const borderBottom = createBorderStyle('borderBottom', borderTransform);
|
|
6156
|
-
const borderLeft = createBorderStyle('borderLeft', borderTransform);
|
|
6157
|
-
const borderColor = createBorderStyle('borderColor');
|
|
6158
|
-
const borderTopColor = createBorderStyle('borderTopColor');
|
|
6159
|
-
const borderRightColor = createBorderStyle('borderRightColor');
|
|
6160
|
-
const borderBottomColor = createBorderStyle('borderBottomColor');
|
|
6161
|
-
const borderLeftColor = createBorderStyle('borderLeftColor');
|
|
6162
|
-
const outline = createBorderStyle('outline', borderTransform);
|
|
6163
|
-
const outlineColor = createBorderStyle('outlineColor');
|
|
6164
|
-
|
|
6165
|
-
// false positive
|
|
6166
|
-
// eslint-disable-next-line react/function-component-definition
|
|
6167
|
-
const borderRadius$1 = props => {
|
|
6168
|
-
if (props.borderRadius !== undefined && props.borderRadius !== null) {
|
|
6169
|
-
const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4);
|
|
6170
|
-
const styleFromPropValue = propValue => ({
|
|
6171
|
-
borderRadius: getValue$2(transformer, propValue)
|
|
6172
|
-
});
|
|
6173
|
-
return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
|
|
6174
|
-
}
|
|
6175
|
-
return null;
|
|
6176
|
-
};
|
|
6177
|
-
borderRadius$1.propTypes = {};
|
|
6178
|
-
borderRadius$1.filterProps = ['borderRadius'];
|
|
6179
|
-
compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius$1, outline, outlineColor);
|
|
6180
|
-
|
|
6181
|
-
// false positive
|
|
6182
|
-
// eslint-disable-next-line react/function-component-definition
|
|
6183
|
-
const gap = props => {
|
|
6184
|
-
if (props.gap !== undefined && props.gap !== null) {
|
|
6185
|
-
const transformer = createUnaryUnit(props.theme, 'spacing', 8);
|
|
6186
|
-
const styleFromPropValue = propValue => ({
|
|
6187
|
-
gap: getValue$2(transformer, propValue)
|
|
6188
|
-
});
|
|
6189
|
-
return handleBreakpoints(props, props.gap, styleFromPropValue);
|
|
6190
|
-
}
|
|
6191
|
-
return null;
|
|
6192
|
-
};
|
|
6193
|
-
gap.propTypes = {};
|
|
6194
|
-
gap.filterProps = ['gap'];
|
|
6195
|
-
|
|
6196
|
-
// false positive
|
|
6197
|
-
// eslint-disable-next-line react/function-component-definition
|
|
6198
|
-
const columnGap = props => {
|
|
6199
|
-
if (props.columnGap !== undefined && props.columnGap !== null) {
|
|
6200
|
-
const transformer = createUnaryUnit(props.theme, 'spacing', 8);
|
|
6201
|
-
const styleFromPropValue = propValue => ({
|
|
6202
|
-
columnGap: getValue$2(transformer, propValue)
|
|
6203
|
-
});
|
|
6204
|
-
return handleBreakpoints(props, props.columnGap, styleFromPropValue);
|
|
6205
|
-
}
|
|
6206
|
-
return null;
|
|
6207
|
-
};
|
|
6208
|
-
columnGap.propTypes = {};
|
|
6209
|
-
columnGap.filterProps = ['columnGap'];
|
|
6210
|
-
|
|
6211
|
-
// false positive
|
|
6212
|
-
// eslint-disable-next-line react/function-component-definition
|
|
6213
|
-
const rowGap = props => {
|
|
6214
|
-
if (props.rowGap !== undefined && props.rowGap !== null) {
|
|
6215
|
-
const transformer = createUnaryUnit(props.theme, 'spacing', 8);
|
|
6216
|
-
const styleFromPropValue = propValue => ({
|
|
6217
|
-
rowGap: getValue$2(transformer, propValue)
|
|
6218
|
-
});
|
|
6219
|
-
return handleBreakpoints(props, props.rowGap, styleFromPropValue);
|
|
6220
|
-
}
|
|
6221
|
-
return null;
|
|
6222
|
-
};
|
|
6223
|
-
rowGap.propTypes = {};
|
|
6224
|
-
rowGap.filterProps = ['rowGap'];
|
|
6225
|
-
const gridColumn = style$1({
|
|
6226
|
-
prop: 'gridColumn'
|
|
6227
|
-
});
|
|
6228
|
-
const gridRow = style$1({
|
|
6229
|
-
prop: 'gridRow'
|
|
6230
|
-
});
|
|
6231
|
-
const gridAutoFlow = style$1({
|
|
6232
|
-
prop: 'gridAutoFlow'
|
|
6233
|
-
});
|
|
6234
|
-
const gridAutoColumns = style$1({
|
|
6235
|
-
prop: 'gridAutoColumns'
|
|
6236
|
-
});
|
|
6237
|
-
const gridAutoRows = style$1({
|
|
6238
|
-
prop: 'gridAutoRows'
|
|
6239
|
-
});
|
|
6240
|
-
const gridTemplateColumns = style$1({
|
|
6241
|
-
prop: 'gridTemplateColumns'
|
|
6242
|
-
});
|
|
6243
|
-
const gridTemplateRows = style$1({
|
|
6244
|
-
prop: 'gridTemplateRows'
|
|
6245
|
-
});
|
|
6246
|
-
const gridTemplateAreas = style$1({
|
|
6247
|
-
prop: 'gridTemplateAreas'
|
|
6248
|
-
});
|
|
6249
|
-
const gridArea = style$1({
|
|
6250
|
-
prop: 'gridArea'
|
|
6251
|
-
});
|
|
6252
|
-
compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
|
6253
|
-
|
|
6254
|
-
function paletteTransform(value, userValue) {
|
|
6255
|
-
if (userValue === 'grey') {
|
|
6256
|
-
return userValue;
|
|
6257
|
-
}
|
|
6258
|
-
return value;
|
|
6259
|
-
}
|
|
6260
|
-
const color = style$1({
|
|
6261
|
-
prop: 'color',
|
|
6262
|
-
themeKey: 'palette',
|
|
6263
|
-
transform: paletteTransform
|
|
6264
|
-
});
|
|
6265
|
-
const bgcolor = style$1({
|
|
6266
|
-
prop: 'bgcolor',
|
|
6267
|
-
cssProperty: 'backgroundColor',
|
|
6268
|
-
themeKey: 'palette',
|
|
6269
|
-
transform: paletteTransform
|
|
6270
|
-
});
|
|
6271
|
-
const backgroundColor = style$1({
|
|
6272
|
-
prop: 'backgroundColor',
|
|
6273
|
-
themeKey: 'palette',
|
|
6274
|
-
transform: paletteTransform
|
|
6275
|
-
});
|
|
6276
|
-
compose(color, bgcolor, backgroundColor);
|
|
6277
|
-
|
|
6278
|
-
function sizingTransform(value) {
|
|
6279
|
-
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
6280
|
-
}
|
|
6281
|
-
const width = style$1({
|
|
6282
|
-
prop: 'width',
|
|
6283
|
-
transform: sizingTransform
|
|
6284
|
-
});
|
|
6285
|
-
const maxWidth = props => {
|
|
6286
|
-
if (props.maxWidth !== undefined && props.maxWidth !== null) {
|
|
6287
|
-
const styleFromPropValue = propValue => {
|
|
6288
|
-
var _props$theme, _props$theme2;
|
|
6289
|
-
const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || values[propValue];
|
|
6290
|
-
if (!breakpoint) {
|
|
6291
|
-
return {
|
|
6292
|
-
maxWidth: sizingTransform(propValue)
|
|
6293
|
-
};
|
|
6294
|
-
}
|
|
6295
|
-
if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {
|
|
6296
|
-
return {
|
|
6297
|
-
maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
|
|
6298
|
-
};
|
|
6299
|
-
}
|
|
6300
|
-
return {
|
|
6301
|
-
maxWidth: breakpoint
|
|
6302
|
-
};
|
|
6303
|
-
};
|
|
6304
|
-
return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
|
|
6305
|
-
}
|
|
6306
|
-
return null;
|
|
6307
|
-
};
|
|
6308
|
-
maxWidth.filterProps = ['maxWidth'];
|
|
6309
|
-
const minWidth = style$1({
|
|
6310
|
-
prop: 'minWidth',
|
|
6311
|
-
transform: sizingTransform
|
|
5922
|
+
return null;
|
|
5923
|
+
};
|
|
5924
|
+
maxWidth.filterProps = ['maxWidth'];
|
|
5925
|
+
const minWidth = style$1({
|
|
5926
|
+
prop: 'minWidth',
|
|
5927
|
+
transform: sizingTransform
|
|
6312
5928
|
});
|
|
6313
5929
|
const height = style$1({
|
|
6314
5930
|
prop: 'height',
|
|
@@ -6621,530 +6237,1144 @@ const defaultSxConfig = {
|
|
|
6621
6237
|
cssProperty: false,
|
|
6622
6238
|
themeKey: 'typography'
|
|
6623
6239
|
}
|
|
6624
|
-
};
|
|
6625
|
-
var defaultSxConfig$1 = defaultSxConfig;
|
|
6240
|
+
};
|
|
6241
|
+
var defaultSxConfig$1 = defaultSxConfig;
|
|
6242
|
+
|
|
6243
|
+
function objectsHaveSameKeys(...objects) {
|
|
6244
|
+
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
6245
|
+
const union = new Set(allKeys);
|
|
6246
|
+
return objects.every(object => union.size === Object.keys(object).length);
|
|
6247
|
+
}
|
|
6248
|
+
function callIfFn(maybeFn, arg) {
|
|
6249
|
+
return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;
|
|
6250
|
+
}
|
|
6251
|
+
|
|
6252
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
6253
|
+
function unstable_createStyleFunctionSx() {
|
|
6254
|
+
function getThemeValue(prop, val, theme, config) {
|
|
6255
|
+
const props = {
|
|
6256
|
+
[prop]: val,
|
|
6257
|
+
theme
|
|
6258
|
+
};
|
|
6259
|
+
const options = config[prop];
|
|
6260
|
+
if (!options) {
|
|
6261
|
+
return {
|
|
6262
|
+
[prop]: val
|
|
6263
|
+
};
|
|
6264
|
+
}
|
|
6265
|
+
const {
|
|
6266
|
+
cssProperty = prop,
|
|
6267
|
+
themeKey,
|
|
6268
|
+
transform,
|
|
6269
|
+
style
|
|
6270
|
+
} = options;
|
|
6271
|
+
if (val == null) {
|
|
6272
|
+
return null;
|
|
6273
|
+
}
|
|
6274
|
+
|
|
6275
|
+
// TODO v6: remove, see https://github.com/mui/material-ui/pull/38123
|
|
6276
|
+
if (themeKey === 'typography' && val === 'inherit') {
|
|
6277
|
+
return {
|
|
6278
|
+
[prop]: val
|
|
6279
|
+
};
|
|
6280
|
+
}
|
|
6281
|
+
const themeMapping = getPath$1(theme, themeKey) || {};
|
|
6282
|
+
if (style) {
|
|
6283
|
+
return style(props);
|
|
6284
|
+
}
|
|
6285
|
+
const styleFromPropValue = propValueFinal => {
|
|
6286
|
+
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
6287
|
+
if (propValueFinal === value && typeof propValueFinal === 'string') {
|
|
6288
|
+
// Haven't found value
|
|
6289
|
+
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize$1(propValueFinal)}`, propValueFinal);
|
|
6290
|
+
}
|
|
6291
|
+
if (cssProperty === false) {
|
|
6292
|
+
return value;
|
|
6293
|
+
}
|
|
6294
|
+
return {
|
|
6295
|
+
[cssProperty]: value
|
|
6296
|
+
};
|
|
6297
|
+
};
|
|
6298
|
+
return handleBreakpoints(props, val, styleFromPropValue);
|
|
6299
|
+
}
|
|
6300
|
+
function styleFunctionSx(props) {
|
|
6301
|
+
var _theme$unstable_sxCon;
|
|
6302
|
+
const {
|
|
6303
|
+
sx,
|
|
6304
|
+
theme = {}
|
|
6305
|
+
} = props || {};
|
|
6306
|
+
if (!sx) {
|
|
6307
|
+
return null; // Emotion & styled-components will neglect null
|
|
6308
|
+
}
|
|
6309
|
+
const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig$1;
|
|
6310
|
+
|
|
6311
|
+
/*
|
|
6312
|
+
* Receive `sxInput` as object or callback
|
|
6313
|
+
* and then recursively check keys & values to create media query object styles.
|
|
6314
|
+
* (the result will be used in `styled`)
|
|
6315
|
+
*/
|
|
6316
|
+
function traverse(sxInput) {
|
|
6317
|
+
let sxObject = sxInput;
|
|
6318
|
+
if (typeof sxInput === 'function') {
|
|
6319
|
+
sxObject = sxInput(theme);
|
|
6320
|
+
} else if (typeof sxInput !== 'object') {
|
|
6321
|
+
// value
|
|
6322
|
+
return sxInput;
|
|
6323
|
+
}
|
|
6324
|
+
if (!sxObject) {
|
|
6325
|
+
return null;
|
|
6326
|
+
}
|
|
6327
|
+
const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
|
|
6328
|
+
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
6329
|
+
let css = emptyBreakpoints;
|
|
6330
|
+
Object.keys(sxObject).forEach(styleKey => {
|
|
6331
|
+
const value = callIfFn(sxObject[styleKey], theme);
|
|
6332
|
+
if (value !== null && value !== undefined) {
|
|
6333
|
+
if (typeof value === 'object') {
|
|
6334
|
+
if (config[styleKey]) {
|
|
6335
|
+
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
6336
|
+
} else {
|
|
6337
|
+
const breakpointsValues = handleBreakpoints({
|
|
6338
|
+
theme
|
|
6339
|
+
}, value, x => ({
|
|
6340
|
+
[styleKey]: x
|
|
6341
|
+
}));
|
|
6342
|
+
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
6343
|
+
css[styleKey] = styleFunctionSx({
|
|
6344
|
+
sx: value,
|
|
6345
|
+
theme
|
|
6346
|
+
});
|
|
6347
|
+
} else {
|
|
6348
|
+
css = merge(css, breakpointsValues);
|
|
6349
|
+
}
|
|
6350
|
+
}
|
|
6351
|
+
} else {
|
|
6352
|
+
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
6353
|
+
}
|
|
6354
|
+
}
|
|
6355
|
+
});
|
|
6356
|
+
return removeUnusedBreakpoints(breakpointsKeys, css);
|
|
6357
|
+
}
|
|
6358
|
+
return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
|
|
6359
|
+
}
|
|
6360
|
+
return styleFunctionSx;
|
|
6361
|
+
}
|
|
6362
|
+
const styleFunctionSx$1 = unstable_createStyleFunctionSx();
|
|
6363
|
+
styleFunctionSx$1.filterProps = ['sx'];
|
|
6364
|
+
|
|
6365
|
+
/**
|
|
6366
|
+
* A universal utility to style components with multiple color modes. Always use it from the theme object.
|
|
6367
|
+
* It works with:
|
|
6368
|
+
* - [Basic theme](https://mui.com/material-ui/customization/dark-mode/)
|
|
6369
|
+
* - [CSS theme variables](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/)
|
|
6370
|
+
* - Zero-runtime engine
|
|
6371
|
+
*
|
|
6372
|
+
* Tips: Use an array over object spread and place `theme.applyStyles()` last.
|
|
6373
|
+
*
|
|
6374
|
+
* ✅ [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })]
|
|
6375
|
+
*
|
|
6376
|
+
* 🚫 { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })}
|
|
6377
|
+
*
|
|
6378
|
+
* @example
|
|
6379
|
+
* 1. using with `styled`:
|
|
6380
|
+
* ```jsx
|
|
6381
|
+
* const Component = styled('div')(({ theme }) => [
|
|
6382
|
+
* { background: '#e5e5e5' },
|
|
6383
|
+
* theme.applyStyles('dark', {
|
|
6384
|
+
* background: '#1c1c1c',
|
|
6385
|
+
* color: '#fff',
|
|
6386
|
+
* }),
|
|
6387
|
+
* ]);
|
|
6388
|
+
* ```
|
|
6389
|
+
*
|
|
6390
|
+
* @example
|
|
6391
|
+
* 2. using with `sx` prop:
|
|
6392
|
+
* ```jsx
|
|
6393
|
+
* <Box sx={theme => [
|
|
6394
|
+
* { background: '#e5e5e5' },
|
|
6395
|
+
* theme.applyStyles('dark', {
|
|
6396
|
+
* background: '#1c1c1c',
|
|
6397
|
+
* color: '#fff',
|
|
6398
|
+
* }),
|
|
6399
|
+
* ]}
|
|
6400
|
+
* />
|
|
6401
|
+
* ```
|
|
6402
|
+
*
|
|
6403
|
+
* @example
|
|
6404
|
+
* 3. theming a component:
|
|
6405
|
+
* ```jsx
|
|
6406
|
+
* extendTheme({
|
|
6407
|
+
* components: {
|
|
6408
|
+
* MuiButton: {
|
|
6409
|
+
* styleOverrides: {
|
|
6410
|
+
* root: ({ theme }) => [
|
|
6411
|
+
* { background: '#e5e5e5' },
|
|
6412
|
+
* theme.applyStyles('dark', {
|
|
6413
|
+
* background: '#1c1c1c',
|
|
6414
|
+
* color: '#fff',
|
|
6415
|
+
* }),
|
|
6416
|
+
* ],
|
|
6417
|
+
* },
|
|
6418
|
+
* }
|
|
6419
|
+
* }
|
|
6420
|
+
* })
|
|
6421
|
+
*```
|
|
6422
|
+
*/
|
|
6423
|
+
function applyStyles(key, styles) {
|
|
6424
|
+
// @ts-expect-error this is 'any' type
|
|
6425
|
+
const theme = this;
|
|
6426
|
+
if (theme.vars && typeof theme.getColorSchemeSelector === 'function') {
|
|
6427
|
+
// If CssVarsProvider is used as a provider,
|
|
6428
|
+
// returns '* :where([data-mui-color-scheme="light|dark"]) &'
|
|
6429
|
+
const selector = theme.getColorSchemeSelector(key).replace(/(\[[^\]]+\])/, '*:where($1)');
|
|
6430
|
+
return {
|
|
6431
|
+
[selector]: styles
|
|
6432
|
+
};
|
|
6433
|
+
}
|
|
6434
|
+
if (theme.palette.mode === key) {
|
|
6435
|
+
return styles;
|
|
6436
|
+
}
|
|
6437
|
+
return {};
|
|
6438
|
+
}
|
|
6439
|
+
|
|
6440
|
+
const _excluded$f = ["breakpoints", "palette", "spacing", "shape"];
|
|
6441
|
+
function createTheme$2(options = {}, ...args) {
|
|
6442
|
+
const {
|
|
6443
|
+
breakpoints: breakpointsInput = {},
|
|
6444
|
+
palette: paletteInput = {},
|
|
6445
|
+
spacing: spacingInput,
|
|
6446
|
+
shape: shapeInput = {}
|
|
6447
|
+
} = options,
|
|
6448
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$f);
|
|
6449
|
+
const breakpoints = createBreakpoints(breakpointsInput);
|
|
6450
|
+
const spacing = createSpacing(spacingInput);
|
|
6451
|
+
let muiTheme = deepmerge$1({
|
|
6452
|
+
breakpoints,
|
|
6453
|
+
direction: 'ltr',
|
|
6454
|
+
components: {},
|
|
6455
|
+
// Inject component definitions.
|
|
6456
|
+
palette: _extends$4({
|
|
6457
|
+
mode: 'light'
|
|
6458
|
+
}, paletteInput),
|
|
6459
|
+
spacing,
|
|
6460
|
+
shape: _extends$4({}, shape$1, shapeInput)
|
|
6461
|
+
}, other);
|
|
6462
|
+
muiTheme.applyStyles = applyStyles;
|
|
6463
|
+
muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
|
|
6464
|
+
muiTheme.unstable_sxConfig = _extends$4({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
|
|
6465
|
+
muiTheme.unstable_sx = function sx(props) {
|
|
6466
|
+
return styleFunctionSx$1({
|
|
6467
|
+
sx: props,
|
|
6468
|
+
theme: this
|
|
6469
|
+
});
|
|
6470
|
+
};
|
|
6471
|
+
return muiTheme;
|
|
6472
|
+
}
|
|
6473
|
+
|
|
6474
|
+
var createTheme$1 = /*#__PURE__*/Object.freeze({
|
|
6475
|
+
__proto__: null,
|
|
6476
|
+
default: createTheme$2,
|
|
6477
|
+
private_createBreakpoints: createBreakpoints,
|
|
6478
|
+
unstable_applyStyles: applyStyles
|
|
6479
|
+
});
|
|
6480
|
+
|
|
6481
|
+
function isObjectEmpty(obj) {
|
|
6482
|
+
return Object.keys(obj).length === 0;
|
|
6483
|
+
}
|
|
6484
|
+
function useTheme$4(defaultTheme = null) {
|
|
6485
|
+
const contextTheme = React.useContext(ThemeContext$2);
|
|
6486
|
+
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
6487
|
+
}
|
|
6488
|
+
|
|
6489
|
+
const systemDefaultTheme$1 = createTheme$2();
|
|
6490
|
+
function useTheme$3(defaultTheme = systemDefaultTheme$1) {
|
|
6491
|
+
return useTheme$4(defaultTheme);
|
|
6492
|
+
}
|
|
6493
|
+
|
|
6494
|
+
const _excluded$e = ["sx"];
|
|
6495
|
+
const splitProps = props => {
|
|
6496
|
+
var _props$theme$unstable, _props$theme;
|
|
6497
|
+
const result = {
|
|
6498
|
+
systemProps: {},
|
|
6499
|
+
otherProps: {}
|
|
6500
|
+
};
|
|
6501
|
+
const config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig$1;
|
|
6502
|
+
Object.keys(props).forEach(prop => {
|
|
6503
|
+
if (config[prop]) {
|
|
6504
|
+
result.systemProps[prop] = props[prop];
|
|
6505
|
+
} else {
|
|
6506
|
+
result.otherProps[prop] = props[prop];
|
|
6507
|
+
}
|
|
6508
|
+
});
|
|
6509
|
+
return result;
|
|
6510
|
+
};
|
|
6511
|
+
function extendSxProp(props) {
|
|
6512
|
+
const {
|
|
6513
|
+
sx: inSx
|
|
6514
|
+
} = props,
|
|
6515
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$e);
|
|
6516
|
+
const {
|
|
6517
|
+
systemProps,
|
|
6518
|
+
otherProps
|
|
6519
|
+
} = splitProps(other);
|
|
6520
|
+
let finalSx;
|
|
6521
|
+
if (Array.isArray(inSx)) {
|
|
6522
|
+
finalSx = [systemProps, ...inSx];
|
|
6523
|
+
} else if (typeof inSx === 'function') {
|
|
6524
|
+
finalSx = (...args) => {
|
|
6525
|
+
const result = inSx(...args);
|
|
6526
|
+
if (!isPlainObject(result)) {
|
|
6527
|
+
return systemProps;
|
|
6528
|
+
}
|
|
6529
|
+
return _extends$4({}, systemProps, result);
|
|
6530
|
+
};
|
|
6531
|
+
} else {
|
|
6532
|
+
finalSx = _extends$4({}, systemProps, inSx);
|
|
6533
|
+
}
|
|
6534
|
+
return _extends$4({}, otherProps, {
|
|
6535
|
+
sx: finalSx
|
|
6536
|
+
});
|
|
6537
|
+
}
|
|
6538
|
+
|
|
6539
|
+
var styleFunctionSx = /*#__PURE__*/Object.freeze({
|
|
6540
|
+
__proto__: null,
|
|
6541
|
+
default: styleFunctionSx$1,
|
|
6542
|
+
extendSxProp: extendSxProp,
|
|
6543
|
+
unstable_createStyleFunctionSx: unstable_createStyleFunctionSx,
|
|
6544
|
+
unstable_defaultSxConfig: defaultSxConfig$1
|
|
6545
|
+
});
|
|
6546
|
+
|
|
6547
|
+
const defaultGenerator = componentName => componentName;
|
|
6548
|
+
const createClassNameGenerator = () => {
|
|
6549
|
+
let generate = defaultGenerator;
|
|
6550
|
+
return {
|
|
6551
|
+
configure(generator) {
|
|
6552
|
+
generate = generator;
|
|
6553
|
+
},
|
|
6554
|
+
generate(componentName) {
|
|
6555
|
+
return generate(componentName);
|
|
6556
|
+
},
|
|
6557
|
+
reset() {
|
|
6558
|
+
generate = defaultGenerator;
|
|
6559
|
+
}
|
|
6560
|
+
};
|
|
6561
|
+
};
|
|
6562
|
+
const ClassNameGenerator = createClassNameGenerator();
|
|
6563
|
+
|
|
6564
|
+
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}
|
|
6565
|
+
|
|
6566
|
+
const globalStateClasses = {
|
|
6567
|
+
active: 'active',
|
|
6568
|
+
checked: 'checked',
|
|
6569
|
+
completed: 'completed',
|
|
6570
|
+
disabled: 'disabled',
|
|
6571
|
+
error: 'error',
|
|
6572
|
+
expanded: 'expanded',
|
|
6573
|
+
focused: 'focused',
|
|
6574
|
+
focusVisible: 'focusVisible',
|
|
6575
|
+
open: 'open',
|
|
6576
|
+
readOnly: 'readOnly',
|
|
6577
|
+
required: 'required',
|
|
6578
|
+
selected: 'selected'
|
|
6579
|
+
};
|
|
6580
|
+
function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
|
|
6581
|
+
const globalStateClass = globalStateClasses[slot];
|
|
6582
|
+
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
|
6583
|
+
}
|
|
6584
|
+
|
|
6585
|
+
function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {
|
|
6586
|
+
const result = {};
|
|
6587
|
+
slots.forEach(slot => {
|
|
6588
|
+
result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
|
|
6589
|
+
});
|
|
6590
|
+
return result;
|
|
6591
|
+
}
|
|
6592
|
+
|
|
6593
|
+
var reactIs = {exports: {}};
|
|
6594
|
+
|
|
6595
|
+
var reactIs_production_min = {};
|
|
6596
|
+
|
|
6597
|
+
/**
|
|
6598
|
+
* @license React
|
|
6599
|
+
* react-is.production.min.js
|
|
6600
|
+
*
|
|
6601
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6602
|
+
*
|
|
6603
|
+
* This source code is licensed under the MIT license found in the
|
|
6604
|
+
* LICENSE file in the root directory of this source tree.
|
|
6605
|
+
*/
|
|
6606
|
+
var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t$1=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
|
|
6607
|
+
function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}reactIs_production_min.ContextConsumer=h;reactIs_production_min.ContextProvider=g;reactIs_production_min.Element=b;reactIs_production_min.ForwardRef=l;reactIs_production_min.Fragment=d;reactIs_production_min.Lazy=q;reactIs_production_min.Memo=p;reactIs_production_min.Portal=c;reactIs_production_min.Profiler=f;reactIs_production_min.StrictMode=e;reactIs_production_min.Suspense=m;
|
|
6608
|
+
reactIs_production_min.SuspenseList=n;reactIs_production_min.isAsyncMode=function(){return !1};reactIs_production_min.isConcurrentMode=function(){return !1};reactIs_production_min.isContextConsumer=function(a){return v(a)===h};reactIs_production_min.isContextProvider=function(a){return v(a)===g};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===b};reactIs_production_min.isForwardRef=function(a){return v(a)===l};reactIs_production_min.isFragment=function(a){return v(a)===d};reactIs_production_min.isLazy=function(a){return v(a)===q};reactIs_production_min.isMemo=function(a){return v(a)===p};
|
|
6609
|
+
reactIs_production_min.isPortal=function(a){return v(a)===c};reactIs_production_min.isProfiler=function(a){return v(a)===f};reactIs_production_min.isStrictMode=function(a){return v(a)===e};reactIs_production_min.isSuspense=function(a){return v(a)===m};reactIs_production_min.isSuspenseList=function(a){return v(a)===n};
|
|
6610
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t$1||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};reactIs_production_min.typeOf=v;
|
|
6611
|
+
|
|
6612
|
+
{
|
|
6613
|
+
reactIs.exports = reactIs_production_min;
|
|
6614
|
+
}
|
|
6615
|
+
|
|
6616
|
+
var reactIsExports = reactIs.exports;
|
|
6617
|
+
|
|
6618
|
+
// Simplified polyfill for IE11 support
|
|
6619
|
+
// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3
|
|
6620
|
+
const fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
|
|
6621
|
+
function getFunctionName(fn) {
|
|
6622
|
+
const match = `${fn}`.match(fnNameMatchRegex);
|
|
6623
|
+
const name = match && match[1];
|
|
6624
|
+
return name || '';
|
|
6625
|
+
}
|
|
6626
|
+
function getFunctionComponentName(Component, fallback = '') {
|
|
6627
|
+
return Component.displayName || Component.name || getFunctionName(Component) || fallback;
|
|
6628
|
+
}
|
|
6629
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
6630
|
+
const functionName = getFunctionComponentName(innerType);
|
|
6631
|
+
return outerType.displayName || (functionName !== '' ? `${wrapperName}(${functionName})` : wrapperName);
|
|
6632
|
+
}
|
|
6633
|
+
|
|
6634
|
+
/**
|
|
6635
|
+
* cherry-pick from
|
|
6636
|
+
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
|
6637
|
+
* originally forked from recompose/getDisplayName with added IE11 support
|
|
6638
|
+
*/
|
|
6639
|
+
function getDisplayName$1(Component) {
|
|
6640
|
+
if (Component == null) {
|
|
6641
|
+
return undefined;
|
|
6642
|
+
}
|
|
6643
|
+
if (typeof Component === 'string') {
|
|
6644
|
+
return Component;
|
|
6645
|
+
}
|
|
6646
|
+
if (typeof Component === 'function') {
|
|
6647
|
+
return getFunctionComponentName(Component, 'Component');
|
|
6648
|
+
}
|
|
6649
|
+
|
|
6650
|
+
// TypeScript can't have components as objects but they exist in the form of `memo` or `Suspense`
|
|
6651
|
+
if (typeof Component === 'object') {
|
|
6652
|
+
switch (Component.$$typeof) {
|
|
6653
|
+
case reactIsExports.ForwardRef:
|
|
6654
|
+
return getWrappedName(Component, Component.render, 'ForwardRef');
|
|
6655
|
+
case reactIsExports.Memo:
|
|
6656
|
+
return getWrappedName(Component, Component.type, 'memo');
|
|
6657
|
+
default:
|
|
6658
|
+
return undefined;
|
|
6659
|
+
}
|
|
6660
|
+
}
|
|
6661
|
+
return undefined;
|
|
6662
|
+
}
|
|
6663
|
+
|
|
6664
|
+
var getDisplayName = /*#__PURE__*/Object.freeze({
|
|
6665
|
+
__proto__: null,
|
|
6666
|
+
default: getDisplayName$1,
|
|
6667
|
+
getFunctionName: getFunctionName
|
|
6668
|
+
});
|
|
6669
|
+
|
|
6670
|
+
/**
|
|
6671
|
+
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
6672
|
+
* @param {object} defaultProps
|
|
6673
|
+
* @param {object} props
|
|
6674
|
+
* @returns {object} resolved props
|
|
6675
|
+
*/
|
|
6676
|
+
function resolveProps(defaultProps, props) {
|
|
6677
|
+
const output = _extends$3({}, props);
|
|
6678
|
+
Object.keys(defaultProps).forEach(propName => {
|
|
6679
|
+
if (propName.toString().match(/^(components|slots)$/)) {
|
|
6680
|
+
output[propName] = _extends$3({}, defaultProps[propName], output[propName]);
|
|
6681
|
+
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
6682
|
+
const defaultSlotProps = defaultProps[propName] || {};
|
|
6683
|
+
const slotProps = props[propName];
|
|
6684
|
+
output[propName] = {};
|
|
6685
|
+
if (!slotProps || !Object.keys(slotProps)) {
|
|
6686
|
+
// Reduce the iteration if the slot props is empty
|
|
6687
|
+
output[propName] = defaultSlotProps;
|
|
6688
|
+
} else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
|
|
6689
|
+
// Reduce the iteration if the default slot props is empty
|
|
6690
|
+
output[propName] = slotProps;
|
|
6691
|
+
} else {
|
|
6692
|
+
output[propName] = _extends$3({}, slotProps);
|
|
6693
|
+
Object.keys(defaultSlotProps).forEach(slotPropName => {
|
|
6694
|
+
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
6695
|
+
});
|
|
6696
|
+
}
|
|
6697
|
+
} else if (output[propName] === undefined) {
|
|
6698
|
+
output[propName] = defaultProps[propName];
|
|
6699
|
+
}
|
|
6700
|
+
});
|
|
6701
|
+
return output;
|
|
6702
|
+
}
|
|
6703
|
+
|
|
6704
|
+
function getThemeProps(params) {
|
|
6705
|
+
const {
|
|
6706
|
+
theme,
|
|
6707
|
+
name,
|
|
6708
|
+
props
|
|
6709
|
+
} = params;
|
|
6710
|
+
if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
|
|
6711
|
+
return props;
|
|
6712
|
+
}
|
|
6713
|
+
return resolveProps(theme.components[name].defaultProps, props);
|
|
6714
|
+
}
|
|
6715
|
+
|
|
6716
|
+
function useThemeProps$1({
|
|
6717
|
+
props,
|
|
6718
|
+
name,
|
|
6719
|
+
defaultTheme,
|
|
6720
|
+
themeId
|
|
6721
|
+
}) {
|
|
6722
|
+
let theme = useTheme$3(defaultTheme);
|
|
6723
|
+
if (themeId) {
|
|
6724
|
+
theme = theme[themeId] || theme;
|
|
6725
|
+
}
|
|
6726
|
+
const mergedProps = getThemeProps({
|
|
6727
|
+
theme,
|
|
6728
|
+
name,
|
|
6729
|
+
props
|
|
6730
|
+
});
|
|
6731
|
+
return mergedProps;
|
|
6732
|
+
}
|
|
6733
|
+
|
|
6734
|
+
/**
|
|
6735
|
+
* A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
|
|
6736
|
+
* This is useful for effects that are only needed for client-side rendering but not for SSR.
|
|
6737
|
+
*
|
|
6738
|
+
* Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
6739
|
+
* and confirm it doesn't apply to your use-case.
|
|
6740
|
+
*/
|
|
6741
|
+
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
6742
|
+
var useEnhancedEffect$1 = useEnhancedEffect;
|
|
6743
|
+
|
|
6744
|
+
function clamp$1(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
6745
|
+
return Math.max(min, Math.min(val, max));
|
|
6746
|
+
}
|
|
6747
|
+
|
|
6748
|
+
var clamp = /*#__PURE__*/Object.freeze({
|
|
6749
|
+
__proto__: null,
|
|
6750
|
+
default: clamp$1
|
|
6751
|
+
});
|
|
6752
|
+
|
|
6753
|
+
function _extends$2() {
|
|
6754
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
6755
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
6756
|
+
var source = arguments[i];
|
|
6757
|
+
for (var key in source) {
|
|
6758
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
6759
|
+
target[key] = source[key];
|
|
6760
|
+
}
|
|
6761
|
+
}
|
|
6762
|
+
}
|
|
6763
|
+
return target;
|
|
6764
|
+
};
|
|
6765
|
+
return _extends$2.apply(this, arguments);
|
|
6766
|
+
}
|
|
6767
|
+
|
|
6768
|
+
/**
|
|
6769
|
+
* Safe chained function.
|
|
6770
|
+
*
|
|
6771
|
+
* Will only create a new function if needed,
|
|
6772
|
+
* otherwise will pass back existing functions or null.
|
|
6773
|
+
*/
|
|
6774
|
+
function createChainedFunction(...funcs) {
|
|
6775
|
+
return funcs.reduce((acc, func) => {
|
|
6776
|
+
if (func == null) {
|
|
6777
|
+
return acc;
|
|
6778
|
+
}
|
|
6779
|
+
return function chainedFunction(...args) {
|
|
6780
|
+
acc.apply(this, args);
|
|
6781
|
+
func.apply(this, args);
|
|
6782
|
+
};
|
|
6783
|
+
}, () => {});
|
|
6784
|
+
}
|
|
6785
|
+
|
|
6786
|
+
// Corresponds to 10 frames at 60 Hz.
|
|
6787
|
+
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
|
|
6788
|
+
function debounce(func, wait = 166) {
|
|
6789
|
+
let timeout;
|
|
6790
|
+
function debounced(...args) {
|
|
6791
|
+
const later = () => {
|
|
6792
|
+
// @ts-ignore
|
|
6793
|
+
func.apply(this, args);
|
|
6794
|
+
};
|
|
6795
|
+
clearTimeout(timeout);
|
|
6796
|
+
timeout = setTimeout(later, wait);
|
|
6797
|
+
}
|
|
6798
|
+
debounced.clear = () => {
|
|
6799
|
+
clearTimeout(timeout);
|
|
6800
|
+
};
|
|
6801
|
+
return debounced;
|
|
6802
|
+
}
|
|
6803
|
+
|
|
6804
|
+
function deprecatedPropType(validator, reason) {
|
|
6805
|
+
{
|
|
6806
|
+
return () => null;
|
|
6807
|
+
}
|
|
6808
|
+
}
|
|
6809
|
+
|
|
6810
|
+
function isMuiElement(element, muiNames) {
|
|
6811
|
+
var _muiName, _element$type;
|
|
6812
|
+
return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName
|
|
6813
|
+
// relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
|
|
6814
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
6815
|
+
(_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;
|
|
6816
|
+
}
|
|
6817
|
+
|
|
6818
|
+
function ownerDocument(node) {
|
|
6819
|
+
return node && node.ownerDocument || document;
|
|
6820
|
+
}
|
|
6821
|
+
|
|
6822
|
+
function ownerWindow(node) {
|
|
6823
|
+
const doc = ownerDocument(node);
|
|
6824
|
+
return doc.defaultView || window;
|
|
6825
|
+
}
|
|
6826
|
+
|
|
6827
|
+
function requirePropFactory(componentNameInError, Component) {
|
|
6828
|
+
{
|
|
6829
|
+
return () => null;
|
|
6830
|
+
}
|
|
6831
|
+
}
|
|
6626
6832
|
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6833
|
+
/**
|
|
6834
|
+
* TODO v5: consider making it private
|
|
6835
|
+
*
|
|
6836
|
+
* passes {value} to {ref}
|
|
6837
|
+
*
|
|
6838
|
+
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
6839
|
+
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
6840
|
+
* https://github.com/mui/material-ui/issues/13539
|
|
6841
|
+
*
|
|
6842
|
+
* Useful if you want to expose the ref of an inner component to the public API
|
|
6843
|
+
* while still using it inside the component.
|
|
6844
|
+
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
6845
|
+
*/
|
|
6846
|
+
function setRef(ref, value) {
|
|
6847
|
+
if (typeof ref === 'function') {
|
|
6848
|
+
ref(value);
|
|
6849
|
+
} else if (ref) {
|
|
6850
|
+
ref.current = value;
|
|
6851
|
+
}
|
|
6631
6852
|
}
|
|
6632
|
-
|
|
6633
|
-
|
|
6853
|
+
|
|
6854
|
+
let globalId = 0;
|
|
6855
|
+
function useGlobalId(idOverride) {
|
|
6856
|
+
const [defaultId, setDefaultId] = React.useState(idOverride);
|
|
6857
|
+
const id = idOverride || defaultId;
|
|
6858
|
+
React.useEffect(() => {
|
|
6859
|
+
if (defaultId == null) {
|
|
6860
|
+
// Fallback to this default id when possible.
|
|
6861
|
+
// Use the incrementing value for client-side rendering only.
|
|
6862
|
+
// We can't use it server-side.
|
|
6863
|
+
// If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
|
|
6864
|
+
globalId += 1;
|
|
6865
|
+
setDefaultId(`mui-${globalId}`);
|
|
6866
|
+
}
|
|
6867
|
+
}, [defaultId]);
|
|
6868
|
+
return id;
|
|
6634
6869
|
}
|
|
6635
6870
|
|
|
6636
|
-
//
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6871
|
+
// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
6872
|
+
const maybeReactUseId = React['useId'.toString()];
|
|
6873
|
+
/**
|
|
6874
|
+
*
|
|
6875
|
+
* @example <div id={useId()} />
|
|
6876
|
+
* @param idOverride
|
|
6877
|
+
* @returns {string}
|
|
6878
|
+
*/
|
|
6879
|
+
function useId(idOverride) {
|
|
6880
|
+
if (maybeReactUseId !== undefined) {
|
|
6881
|
+
const reactId = maybeReactUseId();
|
|
6882
|
+
return idOverride != null ? idOverride : reactId;
|
|
6883
|
+
}
|
|
6884
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
|
|
6885
|
+
return useGlobalId(idOverride);
|
|
6886
|
+
}
|
|
6887
|
+
|
|
6888
|
+
function unsupportedProp(props, propName, componentName, location, propFullName) {
|
|
6889
|
+
{
|
|
6890
|
+
return null;
|
|
6891
|
+
}
|
|
6892
|
+
}
|
|
6893
|
+
|
|
6894
|
+
function useControlled({
|
|
6895
|
+
controlled,
|
|
6896
|
+
default: defaultProp,
|
|
6897
|
+
name,
|
|
6898
|
+
state = 'value'
|
|
6899
|
+
}) {
|
|
6900
|
+
// isControlled is ignored in the hook dependency lists as it should never change.
|
|
6901
|
+
const {
|
|
6902
|
+
current: isControlled
|
|
6903
|
+
} = React.useRef(controlled !== undefined);
|
|
6904
|
+
const [valueState, setValue] = React.useState(defaultProp);
|
|
6905
|
+
const value = isControlled ? controlled : valueState;
|
|
6906
|
+
const setValueIfUncontrolled = React.useCallback(newValue => {
|
|
6907
|
+
if (!isControlled) {
|
|
6908
|
+
setValue(newValue);
|
|
6648
6909
|
}
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6910
|
+
}, []);
|
|
6911
|
+
return [value, setValueIfUncontrolled];
|
|
6912
|
+
}
|
|
6913
|
+
|
|
6914
|
+
/**
|
|
6915
|
+
* Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
6916
|
+
* See RFC in https://github.com/reactjs/rfcs/pull/220
|
|
6917
|
+
*/
|
|
6918
|
+
|
|
6919
|
+
function useEventCallback(fn) {
|
|
6920
|
+
const ref = React.useRef(fn);
|
|
6921
|
+
useEnhancedEffect$1(() => {
|
|
6922
|
+
ref.current = fn;
|
|
6923
|
+
});
|
|
6924
|
+
return React.useRef((...args) =>
|
|
6925
|
+
// @ts-expect-error hide `this`
|
|
6926
|
+
(0, ref.current)(...args)).current;
|
|
6927
|
+
}
|
|
6928
|
+
|
|
6929
|
+
function useForkRef(...refs) {
|
|
6930
|
+
/**
|
|
6931
|
+
* This will create a new function if the refs passed to this hook change and are all defined.
|
|
6932
|
+
* This means react will call the old forkRef with `null` and the new forkRef
|
|
6933
|
+
* with the ref. Cleanup naturally emerges from this behavior.
|
|
6934
|
+
*/
|
|
6935
|
+
return React.useMemo(() => {
|
|
6936
|
+
if (refs.every(ref => ref == null)) {
|
|
6656
6937
|
return null;
|
|
6657
6938
|
}
|
|
6939
|
+
return instance => {
|
|
6940
|
+
refs.forEach(ref => {
|
|
6941
|
+
setRef(ref, instance);
|
|
6942
|
+
});
|
|
6943
|
+
};
|
|
6944
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6945
|
+
}, refs);
|
|
6946
|
+
}
|
|
6947
|
+
|
|
6948
|
+
class Timeout {
|
|
6949
|
+
constructor() {
|
|
6950
|
+
this.currentId = 0;
|
|
6951
|
+
this.clear = () => {
|
|
6952
|
+
if (this.currentId !== 0) {
|
|
6953
|
+
clearTimeout(this.currentId);
|
|
6954
|
+
this.currentId = 0;
|
|
6955
|
+
}
|
|
6956
|
+
};
|
|
6957
|
+
this.disposeEffect = () => {
|
|
6958
|
+
return this.clear;
|
|
6959
|
+
};
|
|
6960
|
+
}
|
|
6961
|
+
static create() {
|
|
6962
|
+
return new Timeout();
|
|
6963
|
+
}
|
|
6964
|
+
/**
|
|
6965
|
+
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
6966
|
+
*/
|
|
6967
|
+
start(delay, fn) {
|
|
6968
|
+
this.clear();
|
|
6969
|
+
this.currentId = setTimeout(() => {
|
|
6970
|
+
this.currentId = 0;
|
|
6971
|
+
fn();
|
|
6972
|
+
}, delay);
|
|
6973
|
+
}
|
|
6974
|
+
}
|
|
6975
|
+
|
|
6976
|
+
let hadKeyboardEvent = true;
|
|
6977
|
+
let hadFocusVisibleRecently = false;
|
|
6978
|
+
const hadFocusVisibleRecentlyTimeout = new Timeout();
|
|
6979
|
+
const inputTypesWhitelist = {
|
|
6980
|
+
text: true,
|
|
6981
|
+
search: true,
|
|
6982
|
+
url: true,
|
|
6983
|
+
tel: true,
|
|
6984
|
+
email: true,
|
|
6985
|
+
password: true,
|
|
6986
|
+
number: true,
|
|
6987
|
+
date: true,
|
|
6988
|
+
month: true,
|
|
6989
|
+
week: true,
|
|
6990
|
+
time: true,
|
|
6991
|
+
datetime: true,
|
|
6992
|
+
'datetime-local': true
|
|
6993
|
+
};
|
|
6994
|
+
|
|
6995
|
+
/**
|
|
6996
|
+
* Computes whether the given element should automatically trigger the
|
|
6997
|
+
* `focus-visible` class being added, i.e. whether it should always match
|
|
6998
|
+
* `:focus-visible` when focused.
|
|
6999
|
+
* @param {Element} node
|
|
7000
|
+
* @returns {boolean}
|
|
7001
|
+
*/
|
|
7002
|
+
function focusTriggersKeyboardModality(node) {
|
|
7003
|
+
const {
|
|
7004
|
+
type,
|
|
7005
|
+
tagName
|
|
7006
|
+
} = node;
|
|
7007
|
+
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
|
|
7008
|
+
return true;
|
|
7009
|
+
}
|
|
7010
|
+
if (tagName === 'TEXTAREA' && !node.readOnly) {
|
|
7011
|
+
return true;
|
|
7012
|
+
}
|
|
7013
|
+
if (node.isContentEditable) {
|
|
7014
|
+
return true;
|
|
7015
|
+
}
|
|
7016
|
+
return false;
|
|
7017
|
+
}
|
|
7018
|
+
|
|
7019
|
+
/**
|
|
7020
|
+
* Keep track of our keyboard modality state with `hadKeyboardEvent`.
|
|
7021
|
+
* If the most recent user interaction was via the keyboard;
|
|
7022
|
+
* and the key press did not include a meta, alt/option, or control key;
|
|
7023
|
+
* then the modality is keyboard. Otherwise, the modality is not keyboard.
|
|
7024
|
+
* @param {KeyboardEvent} event
|
|
7025
|
+
*/
|
|
7026
|
+
function handleKeyDown(event) {
|
|
7027
|
+
if (event.metaKey || event.altKey || event.ctrlKey) {
|
|
7028
|
+
return;
|
|
7029
|
+
}
|
|
7030
|
+
hadKeyboardEvent = true;
|
|
7031
|
+
}
|
|
7032
|
+
|
|
7033
|
+
/**
|
|
7034
|
+
* If at any point a user clicks with a pointing device, ensure that we change
|
|
7035
|
+
* the modality away from keyboard.
|
|
7036
|
+
* This avoids the situation where a user presses a key on an already focused
|
|
7037
|
+
* element, and then clicks on a different element, focusing it with a
|
|
7038
|
+
* pointing device, while we still think we're in keyboard modality.
|
|
7039
|
+
*/
|
|
7040
|
+
function handlePointerDown() {
|
|
7041
|
+
hadKeyboardEvent = false;
|
|
7042
|
+
}
|
|
7043
|
+
function handleVisibilityChange() {
|
|
7044
|
+
if (this.visibilityState === 'hidden') {
|
|
7045
|
+
// If the tab becomes active again, the browser will handle calling focus
|
|
7046
|
+
// on the element (Safari actually calls it twice).
|
|
7047
|
+
// If this tab change caused a blur on an element with focus-visible,
|
|
7048
|
+
// re-apply the class when the user switches back to the tab.
|
|
7049
|
+
if (hadFocusVisibleRecently) {
|
|
7050
|
+
hadKeyboardEvent = true;
|
|
7051
|
+
}
|
|
7052
|
+
}
|
|
7053
|
+
}
|
|
7054
|
+
function prepare(doc) {
|
|
7055
|
+
doc.addEventListener('keydown', handleKeyDown, true);
|
|
7056
|
+
doc.addEventListener('mousedown', handlePointerDown, true);
|
|
7057
|
+
doc.addEventListener('pointerdown', handlePointerDown, true);
|
|
7058
|
+
doc.addEventListener('touchstart', handlePointerDown, true);
|
|
7059
|
+
doc.addEventListener('visibilitychange', handleVisibilityChange, true);
|
|
7060
|
+
}
|
|
7061
|
+
function isFocusVisible(event) {
|
|
7062
|
+
const {
|
|
7063
|
+
target
|
|
7064
|
+
} = event;
|
|
7065
|
+
try {
|
|
7066
|
+
return target.matches(':focus-visible');
|
|
7067
|
+
} catch (error) {
|
|
7068
|
+
// Browsers not implementing :focus-visible will throw a SyntaxError.
|
|
7069
|
+
// We use our own heuristic for those browsers.
|
|
7070
|
+
// Rethrow might be better if it's not the expected error but do we really
|
|
7071
|
+
// want to crash if focus-visible malfunctioned?
|
|
7072
|
+
}
|
|
6658
7073
|
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
7074
|
+
// No need for validFocusTarget check. The user does that by attaching it to
|
|
7075
|
+
// focusable events only.
|
|
7076
|
+
return hadKeyboardEvent || focusTriggersKeyboardModality(target);
|
|
7077
|
+
}
|
|
7078
|
+
function useIsFocusVisible() {
|
|
7079
|
+
const ref = React.useCallback(node => {
|
|
7080
|
+
if (node != null) {
|
|
7081
|
+
prepare(node.ownerDocument);
|
|
6664
7082
|
}
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
7083
|
+
}, []);
|
|
7084
|
+
const isFocusVisibleRef = React.useRef(false);
|
|
7085
|
+
|
|
7086
|
+
/**
|
|
7087
|
+
* Should be called if a blur event is fired
|
|
7088
|
+
*/
|
|
7089
|
+
function handleBlurVisible() {
|
|
7090
|
+
// checking against potential state variable does not suffice if we focus and blur synchronously.
|
|
7091
|
+
// React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
|
|
7092
|
+
// Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
|
|
7093
|
+
// This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
|
|
7094
|
+
// TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
|
|
7095
|
+
if (isFocusVisibleRef.current) {
|
|
7096
|
+
// To detect a tab/window switch, we look for a blur event followed
|
|
7097
|
+
// rapidly by a visibility change.
|
|
7098
|
+
// If we don't see a visibility change within 100ms, it's probably a
|
|
7099
|
+
// regular focus change.
|
|
7100
|
+
hadFocusVisibleRecently = true;
|
|
7101
|
+
hadFocusVisibleRecentlyTimeout.start(100, () => {
|
|
7102
|
+
hadFocusVisibleRecently = false;
|
|
7103
|
+
});
|
|
7104
|
+
isFocusVisibleRef.current = false;
|
|
7105
|
+
return true;
|
|
6668
7106
|
}
|
|
6669
|
-
|
|
6670
|
-
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
6671
|
-
if (propValueFinal === value && typeof propValueFinal === 'string') {
|
|
6672
|
-
// Haven't found value
|
|
6673
|
-
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);
|
|
6674
|
-
}
|
|
6675
|
-
if (cssProperty === false) {
|
|
6676
|
-
return value;
|
|
6677
|
-
}
|
|
6678
|
-
return {
|
|
6679
|
-
[cssProperty]: value
|
|
6680
|
-
};
|
|
6681
|
-
};
|
|
6682
|
-
return handleBreakpoints(props, val, styleFromPropValue);
|
|
7107
|
+
return false;
|
|
6683
7108
|
}
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
return
|
|
7109
|
+
|
|
7110
|
+
/**
|
|
7111
|
+
* Should be called if a blur event is fired
|
|
7112
|
+
*/
|
|
7113
|
+
function handleFocusVisible(event) {
|
|
7114
|
+
if (isFocusVisible(event)) {
|
|
7115
|
+
isFocusVisibleRef.current = true;
|
|
7116
|
+
return true;
|
|
6692
7117
|
}
|
|
6693
|
-
|
|
7118
|
+
return false;
|
|
7119
|
+
}
|
|
7120
|
+
return {
|
|
7121
|
+
isFocusVisibleRef,
|
|
7122
|
+
onFocus: handleFocusVisible,
|
|
7123
|
+
onBlur: handleBlurVisible,
|
|
7124
|
+
ref
|
|
7125
|
+
};
|
|
7126
|
+
}
|
|
6694
7127
|
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
if (
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
return sxInput;
|
|
6707
|
-
}
|
|
6708
|
-
if (!sxObject) {
|
|
6709
|
-
return null;
|
|
6710
|
-
}
|
|
6711
|
-
const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
|
|
6712
|
-
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
6713
|
-
let css = emptyBreakpoints;
|
|
6714
|
-
Object.keys(sxObject).forEach(styleKey => {
|
|
6715
|
-
const value = callIfFn(sxObject[styleKey], theme);
|
|
6716
|
-
if (value !== null && value !== undefined) {
|
|
6717
|
-
if (typeof value === 'object') {
|
|
6718
|
-
if (config[styleKey]) {
|
|
6719
|
-
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
6720
|
-
} else {
|
|
6721
|
-
const breakpointsValues = handleBreakpoints({
|
|
6722
|
-
theme
|
|
6723
|
-
}, value, x => ({
|
|
6724
|
-
[styleKey]: x
|
|
6725
|
-
}));
|
|
6726
|
-
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
6727
|
-
css[styleKey] = styleFunctionSx({
|
|
6728
|
-
sx: value,
|
|
6729
|
-
theme
|
|
6730
|
-
});
|
|
6731
|
-
} else {
|
|
6732
|
-
css = merge(css, breakpointsValues);
|
|
6733
|
-
}
|
|
6734
|
-
}
|
|
6735
|
-
} else {
|
|
6736
|
-
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
6737
|
-
}
|
|
7128
|
+
function composeClasses(slots, getUtilityClass, classes = undefined) {
|
|
7129
|
+
const output = {};
|
|
7130
|
+
Object.keys(slots).forEach(
|
|
7131
|
+
// `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
|
7132
|
+
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
7133
|
+
slot => {
|
|
7134
|
+
output[slot] = slots[slot].reduce((acc, key) => {
|
|
7135
|
+
if (key) {
|
|
7136
|
+
const utilityClass = getUtilityClass(key);
|
|
7137
|
+
if (utilityClass !== '') {
|
|
7138
|
+
acc.push(utilityClass);
|
|
6738
7139
|
}
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
7140
|
+
if (classes && classes[key]) {
|
|
7141
|
+
acc.push(classes[key]);
|
|
7142
|
+
}
|
|
7143
|
+
}
|
|
7144
|
+
return acc;
|
|
7145
|
+
}, []).join(' ');
|
|
7146
|
+
});
|
|
7147
|
+
return output;
|
|
7148
|
+
}
|
|
7149
|
+
|
|
7150
|
+
const ThemeContext = /*#__PURE__*/React.createContext(null);
|
|
7151
|
+
var ThemeContext$1 = ThemeContext;
|
|
7152
|
+
|
|
7153
|
+
function useTheme$2() {
|
|
7154
|
+
const theme = React.useContext(ThemeContext$1);
|
|
7155
|
+
return theme;
|
|
7156
|
+
}
|
|
7157
|
+
|
|
7158
|
+
const hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
7159
|
+
var nested = hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';
|
|
7160
|
+
|
|
7161
|
+
function mergeOuterLocalTheme(outerTheme, localTheme) {
|
|
7162
|
+
if (typeof localTheme === 'function') {
|
|
7163
|
+
const mergedTheme = localTheme(outerTheme);
|
|
7164
|
+
return mergedTheme;
|
|
6743
7165
|
}
|
|
6744
|
-
return
|
|
7166
|
+
return _extends$2({}, outerTheme, localTheme);
|
|
6745
7167
|
}
|
|
6746
|
-
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
6747
|
-
styleFunctionSx.filterProps = ['sx'];
|
|
6748
7168
|
|
|
6749
|
-
|
|
6750
|
-
|
|
7169
|
+
/**
|
|
7170
|
+
* This component takes a `theme` prop.
|
|
7171
|
+
* It makes the `theme` available down the React tree thanks to React context.
|
|
7172
|
+
* This component should preferably be used at **the root of your component tree**.
|
|
7173
|
+
*/
|
|
7174
|
+
function ThemeProvider$2(props) {
|
|
6751
7175
|
const {
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
}, paletteInput),
|
|
6768
|
-
spacing,
|
|
6769
|
-
shape: _extends$3({}, shape$1, shapeInput)
|
|
6770
|
-
}, other);
|
|
6771
|
-
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
6772
|
-
muiTheme.unstable_sxConfig = _extends$3({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
|
|
6773
|
-
muiTheme.unstable_sx = function sx(props) {
|
|
6774
|
-
return styleFunctionSx({
|
|
6775
|
-
sx: props,
|
|
6776
|
-
theme: this
|
|
6777
|
-
});
|
|
6778
|
-
};
|
|
6779
|
-
return muiTheme;
|
|
7176
|
+
children,
|
|
7177
|
+
theme: localTheme
|
|
7178
|
+
} = props;
|
|
7179
|
+
const outerTheme = useTheme$2();
|
|
7180
|
+
const theme = React.useMemo(() => {
|
|
7181
|
+
const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);
|
|
7182
|
+
if (output != null) {
|
|
7183
|
+
output[nested] = outerTheme !== null;
|
|
7184
|
+
}
|
|
7185
|
+
return output;
|
|
7186
|
+
}, [localTheme, outerTheme]);
|
|
7187
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$1.Provider, {
|
|
7188
|
+
value: theme,
|
|
7189
|
+
children: children
|
|
7190
|
+
});
|
|
6780
7191
|
}
|
|
6781
7192
|
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
7193
|
+
const EMPTY_THEME = {};
|
|
7194
|
+
function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
|
|
7195
|
+
return React.useMemo(() => {
|
|
7196
|
+
const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
|
|
7197
|
+
if (typeof localTheme === 'function') {
|
|
7198
|
+
const mergedTheme = localTheme(resolvedTheme);
|
|
7199
|
+
const result = themeId ? _extends$4({}, upperTheme, {
|
|
7200
|
+
[themeId]: mergedTheme
|
|
7201
|
+
}) : mergedTheme;
|
|
7202
|
+
// must return a function for the private theme to NOT merge with the upper theme.
|
|
7203
|
+
// see the test case "use provided theme from a callback" in ThemeProvider.test.js
|
|
7204
|
+
if (isPrivate) {
|
|
7205
|
+
return () => result;
|
|
7206
|
+
}
|
|
7207
|
+
return result;
|
|
7208
|
+
}
|
|
7209
|
+
return themeId ? _extends$4({}, upperTheme, {
|
|
7210
|
+
[themeId]: localTheme
|
|
7211
|
+
}) : _extends$4({}, upperTheme, localTheme);
|
|
7212
|
+
}, [themeId, upperTheme, localTheme, isPrivate]);
|
|
6788
7213
|
}
|
|
6789
7214
|
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
7215
|
+
/**
|
|
7216
|
+
* This component makes the `theme` available down the React tree.
|
|
7217
|
+
* It should preferably be used at **the root of your component tree**.
|
|
7218
|
+
*
|
|
7219
|
+
* <ThemeProvider theme={theme}> // existing use case
|
|
7220
|
+
* <ThemeProvider theme={{ id: theme }}> // theme scoping
|
|
7221
|
+
*/
|
|
7222
|
+
function ThemeProvider$1(props) {
|
|
7223
|
+
const {
|
|
7224
|
+
children,
|
|
7225
|
+
theme: localTheme,
|
|
7226
|
+
themeId
|
|
7227
|
+
} = props;
|
|
7228
|
+
const upperTheme = useTheme$4(EMPTY_THEME);
|
|
7229
|
+
const upperPrivateTheme = useTheme$2() || EMPTY_THEME;
|
|
7230
|
+
const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);
|
|
7231
|
+
const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);
|
|
7232
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$2, {
|
|
7233
|
+
theme: privateTheme,
|
|
7234
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$2.Provider, {
|
|
7235
|
+
value: engineTheme,
|
|
7236
|
+
children: children
|
|
7237
|
+
})
|
|
7238
|
+
});
|
|
6793
7239
|
}
|
|
6794
7240
|
|
|
6795
|
-
|
|
7241
|
+
const _excluded$d = ["defaultProps", "mixins", "overrides", "palette", "props", "styleOverrides"],
|
|
7242
|
+
_excluded2$2 = ["type", "mode"];
|
|
7243
|
+
function adaptV4Theme(inputTheme) {
|
|
7244
|
+
const {
|
|
7245
|
+
defaultProps = {},
|
|
7246
|
+
mixins = {},
|
|
7247
|
+
overrides = {},
|
|
7248
|
+
palette = {},
|
|
7249
|
+
props = {},
|
|
7250
|
+
styleOverrides = {}
|
|
7251
|
+
} = inputTheme,
|
|
7252
|
+
other = _objectWithoutPropertiesLoose$1(inputTheme, _excluded$d);
|
|
7253
|
+
const theme = _extends$5({}, other, {
|
|
7254
|
+
components: {}
|
|
7255
|
+
});
|
|
6796
7256
|
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
7257
|
+
// default props
|
|
7258
|
+
Object.keys(defaultProps).forEach(component => {
|
|
7259
|
+
const componentValue = theme.components[component] || {};
|
|
7260
|
+
componentValue.defaultProps = defaultProps[component];
|
|
7261
|
+
theme.components[component] = componentValue;
|
|
7262
|
+
});
|
|
7263
|
+
Object.keys(props).forEach(component => {
|
|
7264
|
+
const componentValue = theme.components[component] || {};
|
|
7265
|
+
componentValue.defaultProps = props[component];
|
|
7266
|
+
theme.components[component] = componentValue;
|
|
7267
|
+
});
|
|
6801
7268
|
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
let classKey = variant || '';
|
|
6813
|
-
Object.keys(other).sort().forEach(key => {
|
|
6814
|
-
if (key === 'color') {
|
|
6815
|
-
classKey += isEmpty$2(classKey) ? props[key] : capitalize(props[key]);
|
|
6816
|
-
} else {
|
|
6817
|
-
classKey += `${isEmpty$2(classKey) ? key : capitalize(key)}${capitalize(props[key].toString())}`;
|
|
6818
|
-
}
|
|
7269
|
+
// CSS overrides
|
|
7270
|
+
Object.keys(styleOverrides).forEach(component => {
|
|
7271
|
+
const componentValue = theme.components[component] || {};
|
|
7272
|
+
componentValue.styleOverrides = styleOverrides[component];
|
|
7273
|
+
theme.components[component] = componentValue;
|
|
7274
|
+
});
|
|
7275
|
+
Object.keys(overrides).forEach(component => {
|
|
7276
|
+
const componentValue = theme.components[component] || {};
|
|
7277
|
+
componentValue.styleOverrides = overrides[component];
|
|
7278
|
+
theme.components[component] = componentValue;
|
|
6819
7279
|
});
|
|
6820
|
-
return classKey;
|
|
6821
|
-
}
|
|
6822
7280
|
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
return Object.keys(obj).length === 0;
|
|
6826
|
-
}
|
|
7281
|
+
// theme.spacing
|
|
7282
|
+
theme.spacing = createSpacing(inputTheme.spacing);
|
|
6827
7283
|
|
|
6828
|
-
//
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
};
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
const variantsStyles = {};
|
|
6845
|
-
if (variants) {
|
|
6846
|
-
variants.forEach(definition => {
|
|
6847
|
-
let key = '';
|
|
6848
|
-
if (typeof definition.props === 'function') {
|
|
6849
|
-
key = `callback${numOfCallbacks}`;
|
|
6850
|
-
numOfCallbacks += 1;
|
|
6851
|
-
} else {
|
|
6852
|
-
key = propsToClassKey(definition.props);
|
|
6853
|
-
}
|
|
6854
|
-
variantsStyles[key] = definition.style;
|
|
6855
|
-
});
|
|
6856
|
-
}
|
|
6857
|
-
return variantsStyles;
|
|
6858
|
-
};
|
|
6859
|
-
const getVariantStyles = (name, theme) => {
|
|
6860
|
-
let variants = [];
|
|
6861
|
-
if (theme && theme.components && theme.components[name] && theme.components[name].variants) {
|
|
6862
|
-
variants = theme.components[name].variants;
|
|
6863
|
-
}
|
|
6864
|
-
return transformVariants(variants);
|
|
6865
|
-
};
|
|
6866
|
-
const variantsResolver = (props, styles, variants) => {
|
|
7284
|
+
// theme.mixins.gutters
|
|
7285
|
+
const breakpoints = createBreakpoints(inputTheme.breakpoints || {});
|
|
7286
|
+
const spacing = theme.spacing;
|
|
7287
|
+
theme.mixins = _extends$5({
|
|
7288
|
+
gutters: (styles = {}) => {
|
|
7289
|
+
return _extends$5({
|
|
7290
|
+
paddingLeft: spacing(2),
|
|
7291
|
+
paddingRight: spacing(2)
|
|
7292
|
+
}, styles, {
|
|
7293
|
+
[breakpoints.up('sm')]: _extends$5({
|
|
7294
|
+
paddingLeft: spacing(3),
|
|
7295
|
+
paddingRight: spacing(3)
|
|
7296
|
+
}, styles[breakpoints.up('sm')])
|
|
7297
|
+
});
|
|
7298
|
+
}
|
|
7299
|
+
}, mixins);
|
|
6867
7300
|
const {
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
}
|
|
6883
|
-
});
|
|
6884
|
-
}
|
|
6885
|
-
if (isMatch) {
|
|
6886
|
-
if (typeof variant.props === 'function') {
|
|
6887
|
-
variantsStyles.push(styles[`callback${numOfCallbacks}`]);
|
|
6888
|
-
} else {
|
|
6889
|
-
variantsStyles.push(styles[propsToClassKey(variant.props)]);
|
|
6890
|
-
}
|
|
6891
|
-
}
|
|
6892
|
-
if (typeof variant.props === 'function') {
|
|
6893
|
-
numOfCallbacks += 1;
|
|
6894
|
-
}
|
|
6895
|
-
});
|
|
6896
|
-
}
|
|
6897
|
-
return variantsStyles;
|
|
6898
|
-
};
|
|
6899
|
-
const themeVariantsResolver = (props, styles, theme, name) => {
|
|
6900
|
-
var _theme$components;
|
|
6901
|
-
const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[name]) == null ? void 0 : _theme$components.variants;
|
|
6902
|
-
return variantsResolver(props, styles, themeVariants);
|
|
6903
|
-
};
|
|
6904
|
-
|
|
6905
|
-
// Update /system/styled/#api in case if this changes
|
|
6906
|
-
function shouldForwardProp(prop) {
|
|
6907
|
-
return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
|
|
6908
|
-
}
|
|
6909
|
-
const systemDefaultTheme = createTheme$1();
|
|
6910
|
-
const lowercaseFirstLetter = string => {
|
|
6911
|
-
if (!string) {
|
|
6912
|
-
return string;
|
|
6913
|
-
}
|
|
6914
|
-
return string.charAt(0).toLowerCase() + string.slice(1);
|
|
6915
|
-
};
|
|
6916
|
-
function resolveTheme({
|
|
6917
|
-
defaultTheme,
|
|
6918
|
-
theme,
|
|
6919
|
-
themeId
|
|
6920
|
-
}) {
|
|
6921
|
-
return isEmpty$1(theme) ? defaultTheme : theme[themeId] || theme;
|
|
6922
|
-
}
|
|
6923
|
-
function defaultOverridesResolver(slot) {
|
|
6924
|
-
if (!slot) {
|
|
6925
|
-
return null;
|
|
6926
|
-
}
|
|
6927
|
-
return (props, styles) => styles[slot];
|
|
7301
|
+
type: typeInput,
|
|
7302
|
+
mode: modeInput
|
|
7303
|
+
} = palette,
|
|
7304
|
+
paletteRest = _objectWithoutPropertiesLoose$1(palette, _excluded2$2);
|
|
7305
|
+
const finalMode = modeInput || typeInput || 'light';
|
|
7306
|
+
theme.palette = _extends$5({
|
|
7307
|
+
// theme.palette.text.hint
|
|
7308
|
+
text: {
|
|
7309
|
+
hint: finalMode === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.38)'
|
|
7310
|
+
},
|
|
7311
|
+
mode: finalMode,
|
|
7312
|
+
type: finalMode
|
|
7313
|
+
}, paletteRest);
|
|
7314
|
+
return theme;
|
|
6928
7315
|
}
|
|
6929
|
-
const muiStyledFunctionResolver = ({
|
|
6930
|
-
styledArg,
|
|
6931
|
-
props,
|
|
6932
|
-
defaultTheme,
|
|
6933
|
-
themeId
|
|
6934
|
-
}) => {
|
|
6935
|
-
const resolvedStyles = styledArg(_extends$3({}, props, {
|
|
6936
|
-
theme: resolveTheme(_extends$3({}, props, {
|
|
6937
|
-
defaultTheme,
|
|
6938
|
-
themeId
|
|
6939
|
-
}))
|
|
6940
|
-
}));
|
|
6941
|
-
let optionalVariants;
|
|
6942
|
-
if (resolvedStyles && resolvedStyles.variants) {
|
|
6943
|
-
optionalVariants = resolvedStyles.variants;
|
|
6944
|
-
delete resolvedStyles.variants;
|
|
6945
|
-
}
|
|
6946
|
-
if (optionalVariants) {
|
|
6947
|
-
const variantsStyles = variantsResolver(props, transformVariants(optionalVariants), optionalVariants);
|
|
6948
|
-
return [resolvedStyles, ...variantsStyles];
|
|
6949
|
-
}
|
|
6950
|
-
return resolvedStyles;
|
|
6951
|
-
};
|
|
6952
|
-
function createStyled(input = {}) {
|
|
6953
|
-
const {
|
|
6954
|
-
themeId,
|
|
6955
|
-
defaultTheme = systemDefaultTheme,
|
|
6956
|
-
rootShouldForwardProp = shouldForwardProp,
|
|
6957
|
-
slotShouldForwardProp = shouldForwardProp
|
|
6958
|
-
} = input;
|
|
6959
|
-
const systemSx = props => {
|
|
6960
|
-
return styleFunctionSx(_extends$3({}, props, {
|
|
6961
|
-
theme: resolveTheme(_extends$3({}, props, {
|
|
6962
|
-
defaultTheme,
|
|
6963
|
-
themeId
|
|
6964
|
-
}))
|
|
6965
|
-
}));
|
|
6966
|
-
};
|
|
6967
|
-
systemSx.__mui_systemSx = true;
|
|
6968
|
-
return (tag, inputOptions = {}) => {
|
|
6969
|
-
// Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.
|
|
6970
|
-
internal_processStyles(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));
|
|
6971
|
-
const {
|
|
6972
|
-
name: componentName,
|
|
6973
|
-
slot: componentSlot,
|
|
6974
|
-
skipVariantsResolver: inputSkipVariantsResolver,
|
|
6975
|
-
skipSx: inputSkipSx,
|
|
6976
|
-
// TODO v6: remove `lowercaseFirstLetter()` in the next major release
|
|
6977
|
-
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
6978
|
-
overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
|
|
6979
|
-
} = inputOptions,
|
|
6980
|
-
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$d);
|
|
6981
|
-
|
|
6982
|
-
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
6983
|
-
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
|
|
6984
|
-
// TODO v6: remove `Root` in the next major release
|
|
6985
|
-
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
6986
|
-
componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
|
|
6987
|
-
const skipSx = inputSkipSx || false;
|
|
6988
|
-
let label;
|
|
6989
|
-
let shouldForwardPropOption = shouldForwardProp;
|
|
6990
7316
|
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
} else if (isStringTag(tag)) {
|
|
6999
|
-
// for string (html) tag, preserve the behavior in emotion & styled-components.
|
|
7000
|
-
shouldForwardPropOption = undefined;
|
|
7001
|
-
}
|
|
7002
|
-
const defaultStyledResolver = styled$1(tag, _extends$3({
|
|
7003
|
-
shouldForwardProp: shouldForwardPropOption,
|
|
7004
|
-
label
|
|
7005
|
-
}, options));
|
|
7006
|
-
const muiStyledResolver = (styleArg, ...expressions) => {
|
|
7007
|
-
const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => {
|
|
7008
|
-
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
7009
|
-
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
7010
|
-
// which are basically components used as a selectors.
|
|
7011
|
-
if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg) {
|
|
7012
|
-
return props => muiStyledFunctionResolver({
|
|
7013
|
-
styledArg: stylesArg,
|
|
7014
|
-
props,
|
|
7015
|
-
defaultTheme,
|
|
7016
|
-
themeId
|
|
7017
|
-
});
|
|
7018
|
-
}
|
|
7019
|
-
if (isPlainObject(stylesArg)) {
|
|
7020
|
-
let transformedStylesArg = stylesArg;
|
|
7021
|
-
let styledArgVariants;
|
|
7022
|
-
if (stylesArg && stylesArg.variants) {
|
|
7023
|
-
styledArgVariants = stylesArg.variants;
|
|
7024
|
-
delete transformedStylesArg.variants;
|
|
7025
|
-
transformedStylesArg = props => {
|
|
7026
|
-
let result = stylesArg;
|
|
7027
|
-
const variantStyles = variantsResolver(props, transformVariants(styledArgVariants), styledArgVariants);
|
|
7028
|
-
variantStyles.forEach(variantStyle => {
|
|
7029
|
-
result = deepmerge(result, variantStyle);
|
|
7030
|
-
});
|
|
7031
|
-
return result;
|
|
7032
|
-
};
|
|
7033
|
-
}
|
|
7034
|
-
return transformedStylesArg;
|
|
7035
|
-
}
|
|
7036
|
-
return stylesArg;
|
|
7037
|
-
}) : [];
|
|
7038
|
-
let transformedStyleArg = styleArg;
|
|
7039
|
-
if (isPlainObject(styleArg)) {
|
|
7040
|
-
let styledArgVariants;
|
|
7041
|
-
if (styleArg && styleArg.variants) {
|
|
7042
|
-
styledArgVariants = styleArg.variants;
|
|
7043
|
-
delete transformedStyleArg.variants;
|
|
7044
|
-
transformedStyleArg = props => {
|
|
7045
|
-
let result = styleArg;
|
|
7046
|
-
const variantStyles = variantsResolver(props, transformVariants(styledArgVariants), styledArgVariants);
|
|
7047
|
-
variantStyles.forEach(variantStyle => {
|
|
7048
|
-
result = deepmerge(result, variantStyle);
|
|
7049
|
-
});
|
|
7050
|
-
return result;
|
|
7051
|
-
};
|
|
7317
|
+
function createMixins(breakpoints, mixins) {
|
|
7318
|
+
return _extends$5({
|
|
7319
|
+
toolbar: {
|
|
7320
|
+
minHeight: 56,
|
|
7321
|
+
[breakpoints.up('xs')]: {
|
|
7322
|
+
'@media (orientation: landscape)': {
|
|
7323
|
+
minHeight: 48
|
|
7052
7324
|
}
|
|
7053
|
-
}
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
// which are basically components used as a selectors.
|
|
7057
|
-
styleArg.__emotion_real !== styleArg) {
|
|
7058
|
-
// If the type is function, we need to define the default theme.
|
|
7059
|
-
transformedStyleArg = props => muiStyledFunctionResolver({
|
|
7060
|
-
styledArg: styleArg,
|
|
7061
|
-
props,
|
|
7062
|
-
defaultTheme,
|
|
7063
|
-
themeId
|
|
7064
|
-
});
|
|
7065
|
-
}
|
|
7066
|
-
if (componentName && overridesResolver) {
|
|
7067
|
-
expressionsWithDefaultTheme.push(props => {
|
|
7068
|
-
const theme = resolveTheme(_extends$3({}, props, {
|
|
7069
|
-
defaultTheme,
|
|
7070
|
-
themeId
|
|
7071
|
-
}));
|
|
7072
|
-
const styleOverrides = getStyleOverrides(componentName, theme);
|
|
7073
|
-
if (styleOverrides) {
|
|
7074
|
-
const resolvedStyleOverrides = {};
|
|
7075
|
-
Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
|
|
7076
|
-
resolvedStyleOverrides[slotKey] = typeof slotStyle === 'function' ? slotStyle(_extends$3({}, props, {
|
|
7077
|
-
theme
|
|
7078
|
-
})) : slotStyle;
|
|
7079
|
-
});
|
|
7080
|
-
return overridesResolver(props, resolvedStyleOverrides);
|
|
7081
|
-
}
|
|
7082
|
-
return null;
|
|
7083
|
-
});
|
|
7084
|
-
}
|
|
7085
|
-
if (componentName && !skipVariantsResolver) {
|
|
7086
|
-
expressionsWithDefaultTheme.push(props => {
|
|
7087
|
-
const theme = resolveTheme(_extends$3({}, props, {
|
|
7088
|
-
defaultTheme,
|
|
7089
|
-
themeId
|
|
7090
|
-
}));
|
|
7091
|
-
return themeVariantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
|
|
7092
|
-
});
|
|
7093
|
-
}
|
|
7094
|
-
if (!skipSx) {
|
|
7095
|
-
expressionsWithDefaultTheme.push(systemSx);
|
|
7096
|
-
}
|
|
7097
|
-
const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
|
|
7098
|
-
if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
|
|
7099
|
-
const placeholders = new Array(numOfCustomFnsApplied).fill('');
|
|
7100
|
-
// If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.
|
|
7101
|
-
transformedStyleArg = [...styleArg, ...placeholders];
|
|
7102
|
-
transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
|
|
7103
|
-
}
|
|
7104
|
-
const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
|
|
7105
|
-
if (tag.muiName) {
|
|
7106
|
-
Component.muiName = tag.muiName;
|
|
7325
|
+
},
|
|
7326
|
+
[breakpoints.up('sm')]: {
|
|
7327
|
+
minHeight: 64
|
|
7107
7328
|
}
|
|
7108
|
-
return Component;
|
|
7109
|
-
};
|
|
7110
|
-
if (defaultStyledResolver.withConfig) {
|
|
7111
|
-
muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
|
|
7112
7329
|
}
|
|
7113
|
-
|
|
7114
|
-
};
|
|
7330
|
+
}, mixins);
|
|
7115
7331
|
}
|
|
7116
7332
|
|
|
7117
|
-
|
|
7118
|
-
const {
|
|
7119
|
-
theme,
|
|
7120
|
-
name,
|
|
7121
|
-
props
|
|
7122
|
-
} = params;
|
|
7123
|
-
if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
|
|
7124
|
-
return props;
|
|
7125
|
-
}
|
|
7126
|
-
return resolveProps(theme.components[name].defaultProps, props);
|
|
7127
|
-
}
|
|
7333
|
+
var colorManipulator = {};
|
|
7128
7334
|
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
const mergedProps = getThemeProps({
|
|
7140
|
-
theme,
|
|
7141
|
-
name,
|
|
7142
|
-
props
|
|
7143
|
-
});
|
|
7144
|
-
return mergedProps;
|
|
7145
|
-
}
|
|
7335
|
+
var interopRequireDefault$1 = {exports: {}};
|
|
7336
|
+
|
|
7337
|
+
(function (module) {
|
|
7338
|
+
function _interopRequireDefault(obj) {
|
|
7339
|
+
return obj && obj.__esModule ? obj : {
|
|
7340
|
+
"default": obj
|
|
7341
|
+
};
|
|
7342
|
+
}
|
|
7343
|
+
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
7344
|
+
} (interopRequireDefault$1));
|
|
7146
7345
|
|
|
7346
|
+
var interopRequireDefaultExports$1 = interopRequireDefault$1.exports;
|
|
7347
|
+
|
|
7348
|
+
var require$$1 = /*@__PURE__*/getAugmentedNamespace(formatMuiErrorMessage);
|
|
7349
|
+
|
|
7350
|
+
var require$$2 = /*@__PURE__*/getAugmentedNamespace(clamp);
|
|
7351
|
+
|
|
7352
|
+
var _interopRequireDefault$2 = interopRequireDefaultExports$1;
|
|
7353
|
+
Object.defineProperty(colorManipulator, "__esModule", {
|
|
7354
|
+
value: true
|
|
7355
|
+
});
|
|
7356
|
+
colorManipulator.alpha = alpha;
|
|
7357
|
+
colorManipulator.blend = blend;
|
|
7358
|
+
colorManipulator.colorChannel = void 0;
|
|
7359
|
+
var darken_1 = colorManipulator.darken = darken;
|
|
7360
|
+
colorManipulator.decomposeColor = decomposeColor;
|
|
7361
|
+
colorManipulator.emphasize = emphasize;
|
|
7362
|
+
var getContrastRatio_1 = colorManipulator.getContrastRatio = getContrastRatio;
|
|
7363
|
+
colorManipulator.getLuminance = getLuminance;
|
|
7364
|
+
colorManipulator.hexToRgb = hexToRgb;
|
|
7365
|
+
colorManipulator.hslToRgb = hslToRgb;
|
|
7366
|
+
var lighten_1 = colorManipulator.lighten = lighten;
|
|
7367
|
+
colorManipulator.private_safeAlpha = private_safeAlpha;
|
|
7368
|
+
colorManipulator.private_safeColorChannel = void 0;
|
|
7369
|
+
colorManipulator.private_safeDarken = private_safeDarken;
|
|
7370
|
+
colorManipulator.private_safeEmphasize = private_safeEmphasize;
|
|
7371
|
+
colorManipulator.private_safeLighten = private_safeLighten;
|
|
7372
|
+
colorManipulator.recomposeColor = recomposeColor;
|
|
7373
|
+
colorManipulator.rgbToHex = rgbToHex;
|
|
7374
|
+
var _formatMuiErrorMessage2 = _interopRequireDefault$2(require$$1);
|
|
7375
|
+
var _clamp = _interopRequireDefault$2(require$$2);
|
|
7147
7376
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
7377
|
+
|
|
7148
7378
|
/**
|
|
7149
7379
|
* Returns a number whose value is limited to the given range.
|
|
7150
7380
|
* @param {number} value The value to be clamped
|
|
@@ -7152,8 +7382,8 @@ function useThemeProps$1({
|
|
|
7152
7382
|
* @param {number} max The upper boundary of the output range
|
|
7153
7383
|
* @returns {number} A number in the range [min, max]
|
|
7154
7384
|
*/
|
|
7155
|
-
function
|
|
7156
|
-
return
|
|
7385
|
+
function clampWrapper(value, min = 0, max = 1) {
|
|
7386
|
+
return (0, _clamp.default)(value, min, max);
|
|
7157
7387
|
}
|
|
7158
7388
|
|
|
7159
7389
|
/**
|
|
@@ -7172,6 +7402,10 @@ function hexToRgb(color) {
|
|
|
7172
7402
|
return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;
|
|
7173
7403
|
}).join(', ')})` : '';
|
|
7174
7404
|
}
|
|
7405
|
+
function intToHex(int) {
|
|
7406
|
+
const hex = int.toString(16);
|
|
7407
|
+
return hex.length === 1 ? `0${hex}` : hex;
|
|
7408
|
+
}
|
|
7175
7409
|
|
|
7176
7410
|
/**
|
|
7177
7411
|
* Returns an object with the type and values of a color.
|
|
@@ -7191,7 +7425,7 @@ function decomposeColor(color) {
|
|
|
7191
7425
|
const marker = color.indexOf('(');
|
|
7192
7426
|
const type = color.substring(0, marker);
|
|
7193
7427
|
if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {
|
|
7194
|
-
throw new Error(
|
|
7428
|
+
throw new Error((0, _formatMuiErrorMessage2.default)(9, color));
|
|
7195
7429
|
}
|
|
7196
7430
|
let values = color.substring(marker + 1, color.length - 1);
|
|
7197
7431
|
let colorSpace;
|
|
@@ -7202,7 +7436,7 @@ function decomposeColor(color) {
|
|
|
7202
7436
|
values[3] = values[3].slice(1);
|
|
7203
7437
|
}
|
|
7204
7438
|
if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {
|
|
7205
|
-
throw new Error(
|
|
7439
|
+
throw new Error((0, _formatMuiErrorMessage2.default)(10, colorSpace));
|
|
7206
7440
|
}
|
|
7207
7441
|
} else {
|
|
7208
7442
|
values = values.split(',');
|
|
@@ -7215,6 +7449,28 @@ function decomposeColor(color) {
|
|
|
7215
7449
|
};
|
|
7216
7450
|
}
|
|
7217
7451
|
|
|
7452
|
+
/**
|
|
7453
|
+
* Returns a channel created from the input color.
|
|
7454
|
+
*
|
|
7455
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
7456
|
+
* @returns {string} - The channel for the color, that can be used in rgba or hsla colors
|
|
7457
|
+
*/
|
|
7458
|
+
const colorChannel = color => {
|
|
7459
|
+
const decomposedColor = decomposeColor(color);
|
|
7460
|
+
return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');
|
|
7461
|
+
};
|
|
7462
|
+
colorManipulator.colorChannel = colorChannel;
|
|
7463
|
+
const private_safeColorChannel = (color, warning) => {
|
|
7464
|
+
try {
|
|
7465
|
+
return colorChannel(color);
|
|
7466
|
+
} catch (error) {
|
|
7467
|
+
if (warning && "production" !== 'production') {
|
|
7468
|
+
console.warn(warning);
|
|
7469
|
+
}
|
|
7470
|
+
return color;
|
|
7471
|
+
}
|
|
7472
|
+
};
|
|
7473
|
+
|
|
7218
7474
|
/**
|
|
7219
7475
|
* Converts a color object with type and values to a string.
|
|
7220
7476
|
* @param {object} color - Decomposed color
|
|
@@ -7222,6 +7478,7 @@ function decomposeColor(color) {
|
|
|
7222
7478
|
* @param {array} color.values - [n,n,n] or [n,n,n,n]
|
|
7223
7479
|
* @returns {string} A CSS color string
|
|
7224
7480
|
*/
|
|
7481
|
+
colorManipulator.private_safeColorChannel = private_safeColorChannel;
|
|
7225
7482
|
function recomposeColor(color) {
|
|
7226
7483
|
const {
|
|
7227
7484
|
type,
|
|
@@ -7245,6 +7502,22 @@ function recomposeColor(color) {
|
|
|
7245
7502
|
return `${type}(${values})`;
|
|
7246
7503
|
}
|
|
7247
7504
|
|
|
7505
|
+
/**
|
|
7506
|
+
* Converts a color from CSS rgb format to CSS hex format.
|
|
7507
|
+
* @param {string} color - RGB color, i.e. rgb(n, n, n)
|
|
7508
|
+
* @returns {string} A CSS rgb color string, i.e. #nnnnnn
|
|
7509
|
+
*/
|
|
7510
|
+
function rgbToHex(color) {
|
|
7511
|
+
// Idempotent
|
|
7512
|
+
if (color.indexOf('#') === 0) {
|
|
7513
|
+
return color;
|
|
7514
|
+
}
|
|
7515
|
+
const {
|
|
7516
|
+
values
|
|
7517
|
+
} = decomposeColor(color);
|
|
7518
|
+
return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;
|
|
7519
|
+
}
|
|
7520
|
+
|
|
7248
7521
|
/**
|
|
7249
7522
|
* Converts a color from hsl format to rgb format.
|
|
7250
7523
|
* @param {string} color - HSL color values
|
|
@@ -7307,6 +7580,37 @@ function getContrastRatio(foreground, background) {
|
|
|
7307
7580
|
return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
|
|
7308
7581
|
}
|
|
7309
7582
|
|
|
7583
|
+
/**
|
|
7584
|
+
* Sets the absolute transparency of a color.
|
|
7585
|
+
* Any existing alpha values are overwritten.
|
|
7586
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
7587
|
+
* @param {number} value - value to set the alpha channel to in the range 0 - 1
|
|
7588
|
+
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
7589
|
+
*/
|
|
7590
|
+
function alpha(color, value) {
|
|
7591
|
+
color = decomposeColor(color);
|
|
7592
|
+
value = clampWrapper(value);
|
|
7593
|
+
if (color.type === 'rgb' || color.type === 'hsl') {
|
|
7594
|
+
color.type += 'a';
|
|
7595
|
+
}
|
|
7596
|
+
if (color.type === 'color') {
|
|
7597
|
+
color.values[3] = `/${value}`;
|
|
7598
|
+
} else {
|
|
7599
|
+
color.values[3] = value;
|
|
7600
|
+
}
|
|
7601
|
+
return recomposeColor(color);
|
|
7602
|
+
}
|
|
7603
|
+
function private_safeAlpha(color, value, warning) {
|
|
7604
|
+
try {
|
|
7605
|
+
return alpha(color, value);
|
|
7606
|
+
} catch (error) {
|
|
7607
|
+
if (warning && "production" !== 'production') {
|
|
7608
|
+
console.warn(warning);
|
|
7609
|
+
}
|
|
7610
|
+
return color;
|
|
7611
|
+
}
|
|
7612
|
+
}
|
|
7613
|
+
|
|
7310
7614
|
/**
|
|
7311
7615
|
* Darkens a color.
|
|
7312
7616
|
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
@@ -7315,7 +7619,7 @@ function getContrastRatio(foreground, background) {
|
|
|
7315
7619
|
*/
|
|
7316
7620
|
function darken(color, coefficient) {
|
|
7317
7621
|
color = decomposeColor(color);
|
|
7318
|
-
coefficient =
|
|
7622
|
+
coefficient = clampWrapper(coefficient);
|
|
7319
7623
|
if (color.type.indexOf('hsl') !== -1) {
|
|
7320
7624
|
color.values[2] *= 1 - coefficient;
|
|
7321
7625
|
} else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {
|
|
@@ -7325,6 +7629,16 @@ function darken(color, coefficient) {
|
|
|
7325
7629
|
}
|
|
7326
7630
|
return recomposeColor(color);
|
|
7327
7631
|
}
|
|
7632
|
+
function private_safeDarken(color, coefficient, warning) {
|
|
7633
|
+
try {
|
|
7634
|
+
return darken(color, coefficient);
|
|
7635
|
+
} catch (error) {
|
|
7636
|
+
if (warning && "production" !== 'production') {
|
|
7637
|
+
console.warn(warning);
|
|
7638
|
+
}
|
|
7639
|
+
return color;
|
|
7640
|
+
}
|
|
7641
|
+
}
|
|
7328
7642
|
|
|
7329
7643
|
/**
|
|
7330
7644
|
* Lightens a color.
|
|
@@ -7334,7 +7648,7 @@ function darken(color, coefficient) {
|
|
|
7334
7648
|
*/
|
|
7335
7649
|
function lighten(color, coefficient) {
|
|
7336
7650
|
color = decomposeColor(color);
|
|
7337
|
-
coefficient =
|
|
7651
|
+
coefficient = clampWrapper(coefficient);
|
|
7338
7652
|
if (color.type.indexOf('hsl') !== -1) {
|
|
7339
7653
|
color.values[2] += (100 - color.values[2]) * coefficient;
|
|
7340
7654
|
} else if (color.type.indexOf('rgb') !== -1) {
|
|
@@ -7344,207 +7658,59 @@ function lighten(color, coefficient) {
|
|
|
7344
7658
|
} else if (color.type.indexOf('color') !== -1) {
|
|
7345
7659
|
for (let i = 0; i < 3; i += 1) {
|
|
7346
7660
|
color.values[i] += (1 - color.values[i]) * coefficient;
|
|
7347
|
-
}
|
|
7348
|
-
}
|
|
7349
|
-
return recomposeColor(color);
|
|
7350
|
-
}
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
}
|
|
7361
|
-
}
|
|
7362
|
-
return target;
|
|
7363
|
-
};
|
|
7364
|
-
return _extends$1.apply(this, arguments);
|
|
7365
|
-
}
|
|
7366
|
-
|
|
7367
|
-
const ThemeContext = /*#__PURE__*/React.createContext(null);
|
|
7368
|
-
var ThemeContext$1 = ThemeContext;
|
|
7369
|
-
|
|
7370
|
-
function useTheme$2() {
|
|
7371
|
-
const theme = React.useContext(ThemeContext$1);
|
|
7372
|
-
return theme;
|
|
7373
|
-
}
|
|
7374
|
-
|
|
7375
|
-
const hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
7376
|
-
var nested = hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';
|
|
7377
|
-
|
|
7378
|
-
function mergeOuterLocalTheme(outerTheme, localTheme) {
|
|
7379
|
-
if (typeof localTheme === 'function') {
|
|
7380
|
-
const mergedTheme = localTheme(outerTheme);
|
|
7381
|
-
return mergedTheme;
|
|
7382
|
-
}
|
|
7383
|
-
return _extends$1({}, outerTheme, localTheme);
|
|
7384
|
-
}
|
|
7385
|
-
|
|
7386
|
-
/**
|
|
7387
|
-
* This component takes a `theme` prop.
|
|
7388
|
-
* It makes the `theme` available down the React tree thanks to React context.
|
|
7389
|
-
* This component should preferably be used at **the root of your component tree**.
|
|
7390
|
-
*/
|
|
7391
|
-
function ThemeProvider$2(props) {
|
|
7392
|
-
const {
|
|
7393
|
-
children,
|
|
7394
|
-
theme: localTheme
|
|
7395
|
-
} = props;
|
|
7396
|
-
const outerTheme = useTheme$2();
|
|
7397
|
-
const theme = React.useMemo(() => {
|
|
7398
|
-
const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);
|
|
7399
|
-
if (output != null) {
|
|
7400
|
-
output[nested] = outerTheme !== null;
|
|
7401
|
-
}
|
|
7402
|
-
return output;
|
|
7403
|
-
}, [localTheme, outerTheme]);
|
|
7404
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$1.Provider, {
|
|
7405
|
-
value: theme,
|
|
7406
|
-
children: children
|
|
7407
|
-
});
|
|
7408
|
-
}
|
|
7409
|
-
|
|
7410
|
-
const EMPTY_THEME = {};
|
|
7411
|
-
function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
|
|
7412
|
-
return React.useMemo(() => {
|
|
7413
|
-
const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
|
|
7414
|
-
if (typeof localTheme === 'function') {
|
|
7415
|
-
const mergedTheme = localTheme(resolvedTheme);
|
|
7416
|
-
const result = themeId ? _extends$3({}, upperTheme, {
|
|
7417
|
-
[themeId]: mergedTheme
|
|
7418
|
-
}) : mergedTheme;
|
|
7419
|
-
// must return a function for the private theme to NOT merge with the upper theme.
|
|
7420
|
-
// see the test case "use provided theme from a callback" in ThemeProvider.test.js
|
|
7421
|
-
if (isPrivate) {
|
|
7422
|
-
return () => result;
|
|
7423
|
-
}
|
|
7424
|
-
return result;
|
|
7425
|
-
}
|
|
7426
|
-
return themeId ? _extends$3({}, upperTheme, {
|
|
7427
|
-
[themeId]: localTheme
|
|
7428
|
-
}) : _extends$3({}, upperTheme, localTheme);
|
|
7429
|
-
}, [themeId, upperTheme, localTheme, isPrivate]);
|
|
7430
|
-
}
|
|
7431
|
-
|
|
7432
|
-
/**
|
|
7433
|
-
* This component makes the `theme` available down the React tree.
|
|
7434
|
-
* It should preferably be used at **the root of your component tree**.
|
|
7435
|
-
*
|
|
7436
|
-
* <ThemeProvider theme={theme}> // existing use case
|
|
7437
|
-
* <ThemeProvider theme={{ id: theme }}> // theme scoping
|
|
7438
|
-
*/
|
|
7439
|
-
function ThemeProvider$1(props) {
|
|
7440
|
-
const {
|
|
7441
|
-
children,
|
|
7442
|
-
theme: localTheme,
|
|
7443
|
-
themeId
|
|
7444
|
-
} = props;
|
|
7445
|
-
const upperTheme = useTheme$4(EMPTY_THEME);
|
|
7446
|
-
const upperPrivateTheme = useTheme$2() || EMPTY_THEME;
|
|
7447
|
-
const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);
|
|
7448
|
-
const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);
|
|
7449
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$2, {
|
|
7450
|
-
theme: privateTheme,
|
|
7451
|
-
children: /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$2.Provider, {
|
|
7452
|
-
value: engineTheme,
|
|
7453
|
-
children: children
|
|
7454
|
-
})
|
|
7455
|
-
});
|
|
7456
|
-
}
|
|
7457
|
-
|
|
7458
|
-
const _excluded$c = ["defaultProps", "mixins", "overrides", "palette", "props", "styleOverrides"],
|
|
7459
|
-
_excluded2$1 = ["type", "mode"];
|
|
7460
|
-
function adaptV4Theme(inputTheme) {
|
|
7461
|
-
const {
|
|
7462
|
-
defaultProps = {},
|
|
7463
|
-
mixins = {},
|
|
7464
|
-
overrides = {},
|
|
7465
|
-
palette = {},
|
|
7466
|
-
props = {},
|
|
7467
|
-
styleOverrides = {}
|
|
7468
|
-
} = inputTheme,
|
|
7469
|
-
other = _objectWithoutPropertiesLoose$1(inputTheme, _excluded$c);
|
|
7470
|
-
const theme = _extends$4({}, other, {
|
|
7471
|
-
components: {}
|
|
7472
|
-
});
|
|
7473
|
-
|
|
7474
|
-
// default props
|
|
7475
|
-
Object.keys(defaultProps).forEach(component => {
|
|
7476
|
-
const componentValue = theme.components[component] || {};
|
|
7477
|
-
componentValue.defaultProps = defaultProps[component];
|
|
7478
|
-
theme.components[component] = componentValue;
|
|
7479
|
-
});
|
|
7480
|
-
Object.keys(props).forEach(component => {
|
|
7481
|
-
const componentValue = theme.components[component] || {};
|
|
7482
|
-
componentValue.defaultProps = props[component];
|
|
7483
|
-
theme.components[component] = componentValue;
|
|
7484
|
-
});
|
|
7485
|
-
|
|
7486
|
-
// CSS overrides
|
|
7487
|
-
Object.keys(styleOverrides).forEach(component => {
|
|
7488
|
-
const componentValue = theme.components[component] || {};
|
|
7489
|
-
componentValue.styleOverrides = styleOverrides[component];
|
|
7490
|
-
theme.components[component] = componentValue;
|
|
7491
|
-
});
|
|
7492
|
-
Object.keys(overrides).forEach(component => {
|
|
7493
|
-
const componentValue = theme.components[component] || {};
|
|
7494
|
-
componentValue.styleOverrides = overrides[component];
|
|
7495
|
-
theme.components[component] = componentValue;
|
|
7496
|
-
});
|
|
7497
|
-
|
|
7498
|
-
// theme.spacing
|
|
7499
|
-
theme.spacing = createSpacing(inputTheme.spacing);
|
|
7500
|
-
|
|
7501
|
-
// theme.mixins.gutters
|
|
7502
|
-
const breakpoints = createBreakpoints(inputTheme.breakpoints || {});
|
|
7503
|
-
const spacing = theme.spacing;
|
|
7504
|
-
theme.mixins = _extends$4({
|
|
7505
|
-
gutters: (styles = {}) => {
|
|
7506
|
-
return _extends$4({
|
|
7507
|
-
paddingLeft: spacing(2),
|
|
7508
|
-
paddingRight: spacing(2)
|
|
7509
|
-
}, styles, {
|
|
7510
|
-
[breakpoints.up('sm')]: _extends$4({
|
|
7511
|
-
paddingLeft: spacing(3),
|
|
7512
|
-
paddingRight: spacing(3)
|
|
7513
|
-
}, styles[breakpoints.up('sm')])
|
|
7514
|
-
});
|
|
7515
|
-
}
|
|
7516
|
-
}, mixins);
|
|
7517
|
-
const {
|
|
7518
|
-
type: typeInput,
|
|
7519
|
-
mode: modeInput
|
|
7520
|
-
} = palette,
|
|
7521
|
-
paletteRest = _objectWithoutPropertiesLoose$1(palette, _excluded2$1);
|
|
7522
|
-
const finalMode = modeInput || typeInput || 'light';
|
|
7523
|
-
theme.palette = _extends$4({
|
|
7524
|
-
// theme.palette.text.hint
|
|
7525
|
-
text: {
|
|
7526
|
-
hint: finalMode === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.38)'
|
|
7527
|
-
},
|
|
7528
|
-
mode: finalMode,
|
|
7529
|
-
type: finalMode
|
|
7530
|
-
}, paletteRest);
|
|
7531
|
-
return theme;
|
|
7661
|
+
}
|
|
7662
|
+
}
|
|
7663
|
+
return recomposeColor(color);
|
|
7664
|
+
}
|
|
7665
|
+
function private_safeLighten(color, coefficient, warning) {
|
|
7666
|
+
try {
|
|
7667
|
+
return lighten(color, coefficient);
|
|
7668
|
+
} catch (error) {
|
|
7669
|
+
if (warning && "production" !== 'production') {
|
|
7670
|
+
console.warn(warning);
|
|
7671
|
+
}
|
|
7672
|
+
return color;
|
|
7673
|
+
}
|
|
7532
7674
|
}
|
|
7533
7675
|
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7676
|
+
/**
|
|
7677
|
+
* Darken or lighten a color, depending on its luminance.
|
|
7678
|
+
* Light colors are darkened, dark colors are lightened.
|
|
7679
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
7680
|
+
* @param {number} coefficient=0.15 - multiplier in the range 0 - 1
|
|
7681
|
+
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
7682
|
+
*/
|
|
7683
|
+
function emphasize(color, coefficient = 0.15) {
|
|
7684
|
+
return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);
|
|
7685
|
+
}
|
|
7686
|
+
function private_safeEmphasize(color, coefficient, warning) {
|
|
7687
|
+
try {
|
|
7688
|
+
return private_safeEmphasize(color, coefficient);
|
|
7689
|
+
} catch (error) {
|
|
7690
|
+
if (warning && "production" !== 'production') {
|
|
7691
|
+
console.warn(warning);
|
|
7546
7692
|
}
|
|
7547
|
-
|
|
7693
|
+
return color;
|
|
7694
|
+
}
|
|
7695
|
+
}
|
|
7696
|
+
|
|
7697
|
+
/**
|
|
7698
|
+
* Blend a transparent overlay color with a background color, resulting in a single
|
|
7699
|
+
* RGB color.
|
|
7700
|
+
* @param {string} background - CSS color
|
|
7701
|
+
* @param {string} overlay - CSS color
|
|
7702
|
+
* @param {number} opacity - Opacity multiplier in the range 0 - 1
|
|
7703
|
+
* @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.
|
|
7704
|
+
*/
|
|
7705
|
+
function blend(background, overlay, opacity, gamma = 1.0) {
|
|
7706
|
+
const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);
|
|
7707
|
+
const backgroundColor = decomposeColor(background);
|
|
7708
|
+
const overlayColor = decomposeColor(overlay);
|
|
7709
|
+
const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];
|
|
7710
|
+
return recomposeColor({
|
|
7711
|
+
type: 'rgb',
|
|
7712
|
+
values: rgb
|
|
7713
|
+
});
|
|
7548
7714
|
}
|
|
7549
7715
|
|
|
7550
7716
|
const common = {
|
|
@@ -7679,7 +7845,7 @@ const green = {
|
|
|
7679
7845
|
};
|
|
7680
7846
|
var green$1 = green;
|
|
7681
7847
|
|
|
7682
|
-
const _excluded$
|
|
7848
|
+
const _excluded$c = ["mode", "contrastThreshold", "tonalOffset"];
|
|
7683
7849
|
const light$1 = {
|
|
7684
7850
|
// The colors used to style the text.
|
|
7685
7851
|
text: {
|
|
@@ -7751,9 +7917,9 @@ function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
|
7751
7917
|
if (intent.hasOwnProperty(shade)) {
|
|
7752
7918
|
intent[direction] = intent[shade];
|
|
7753
7919
|
} else if (direction === 'light') {
|
|
7754
|
-
intent.light =
|
|
7920
|
+
intent.light = lighten_1(intent.main, tonalOffsetLight);
|
|
7755
7921
|
} else if (direction === 'dark') {
|
|
7756
|
-
intent.dark =
|
|
7922
|
+
intent.dark = darken_1(intent.main, tonalOffsetDark);
|
|
7757
7923
|
}
|
|
7758
7924
|
}
|
|
7759
7925
|
}
|
|
@@ -7848,7 +8014,7 @@ function createPalette(palette) {
|
|
|
7848
8014
|
contrastThreshold = 3,
|
|
7849
8015
|
tonalOffset = 0.2
|
|
7850
8016
|
} = palette,
|
|
7851
|
-
other = _objectWithoutPropertiesLoose$1(palette, _excluded$
|
|
8017
|
+
other = _objectWithoutPropertiesLoose$1(palette, _excluded$c);
|
|
7852
8018
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
7853
8019
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
7854
8020
|
const error = palette.error || getDefaultError(mode);
|
|
@@ -7860,7 +8026,7 @@ function createPalette(palette) {
|
|
|
7860
8026
|
// Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59
|
|
7861
8027
|
// and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54
|
|
7862
8028
|
function getContrastText(background) {
|
|
7863
|
-
const contrastText =
|
|
8029
|
+
const contrastText = getContrastRatio_1(background, dark$1.text.primary) >= contrastThreshold ? dark$1.text.primary : light$1.text.primary;
|
|
7864
8030
|
return contrastText;
|
|
7865
8031
|
}
|
|
7866
8032
|
const augmentColor = ({
|
|
@@ -7870,15 +8036,15 @@ function createPalette(palette) {
|
|
|
7870
8036
|
lightShade = 300,
|
|
7871
8037
|
darkShade = 700
|
|
7872
8038
|
}) => {
|
|
7873
|
-
color = _extends$
|
|
8039
|
+
color = _extends$5({}, color);
|
|
7874
8040
|
if (!color.main && color[mainShade]) {
|
|
7875
8041
|
color.main = color[mainShade];
|
|
7876
8042
|
}
|
|
7877
8043
|
if (!color.hasOwnProperty('main')) {
|
|
7878
|
-
throw new Error(formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
|
|
8044
|
+
throw new Error(formatMuiErrorMessage$1(11, name ? ` (${name})` : '', mainShade));
|
|
7879
8045
|
}
|
|
7880
8046
|
if (typeof color.main !== 'string') {
|
|
7881
|
-
throw new Error(formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
|
|
8047
|
+
throw new Error(formatMuiErrorMessage$1(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
|
|
7882
8048
|
}
|
|
7883
8049
|
addLightOrDark(color, 'light', lightShade, tonalOffset);
|
|
7884
8050
|
addLightOrDark(color, 'dark', darkShade, tonalOffset);
|
|
@@ -7891,9 +8057,9 @@ function createPalette(palette) {
|
|
|
7891
8057
|
dark: dark$1,
|
|
7892
8058
|
light: light$1
|
|
7893
8059
|
};
|
|
7894
|
-
const paletteOutput = deepmerge(_extends$
|
|
8060
|
+
const paletteOutput = deepmerge$1(_extends$5({
|
|
7895
8061
|
// A collection of common colors.
|
|
7896
|
-
common: _extends$
|
|
8062
|
+
common: _extends$5({}, common$1),
|
|
7897
8063
|
// prevent mutable object.
|
|
7898
8064
|
// The palette mode, can be light or dark.
|
|
7899
8065
|
mode,
|
|
@@ -7947,7 +8113,7 @@ function createPalette(palette) {
|
|
|
7947
8113
|
return paletteOutput;
|
|
7948
8114
|
}
|
|
7949
8115
|
|
|
7950
|
-
const _excluded$
|
|
8116
|
+
const _excluded$b = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
7951
8117
|
function round$1(value) {
|
|
7952
8118
|
return Math.round(value * 1e5) / 1e5;
|
|
7953
8119
|
}
|
|
@@ -7978,10 +8144,10 @@ function createTypography(palette, typography) {
|
|
|
7978
8144
|
allVariants,
|
|
7979
8145
|
pxToRem: pxToRem2
|
|
7980
8146
|
} = _ref,
|
|
7981
|
-
other = _objectWithoutPropertiesLoose$1(_ref, _excluded$
|
|
8147
|
+
other = _objectWithoutPropertiesLoose$1(_ref, _excluded$b);
|
|
7982
8148
|
const coef = fontSize / 14;
|
|
7983
8149
|
const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);
|
|
7984
|
-
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$
|
|
8150
|
+
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends$5({
|
|
7985
8151
|
fontFamily,
|
|
7986
8152
|
fontWeight,
|
|
7987
8153
|
fontSize: pxToRem(size),
|
|
@@ -8013,7 +8179,7 @@ function createTypography(palette, typography) {
|
|
|
8013
8179
|
letterSpacing: 'inherit'
|
|
8014
8180
|
}
|
|
8015
8181
|
};
|
|
8016
|
-
return deepmerge(_extends$
|
|
8182
|
+
return deepmerge$1(_extends$5({
|
|
8017
8183
|
htmlFontSize,
|
|
8018
8184
|
pxToRem,
|
|
8019
8185
|
fontFamily,
|
|
@@ -8037,7 +8203,7 @@ function createShadow(...px) {
|
|
|
8037
8203
|
// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss
|
|
8038
8204
|
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)];
|
|
8039
8205
|
|
|
8040
|
-
const _excluded$
|
|
8206
|
+
const _excluded$a = ["duration", "easing", "delay"];
|
|
8041
8207
|
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
8042
8208
|
// to learn the context in which each easing should be used.
|
|
8043
8209
|
const easing = {
|
|
@@ -8080,18 +8246,18 @@ function getAutoHeightDuration(height) {
|
|
|
8080
8246
|
return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
|
|
8081
8247
|
}
|
|
8082
8248
|
function createTransitions(inputTransitions) {
|
|
8083
|
-
const mergedEasing = _extends$
|
|
8084
|
-
const mergedDuration = _extends$
|
|
8249
|
+
const mergedEasing = _extends$5({}, easing, inputTransitions.easing);
|
|
8250
|
+
const mergedDuration = _extends$5({}, duration, inputTransitions.duration);
|
|
8085
8251
|
const create = (props = ['all'], options = {}) => {
|
|
8086
8252
|
const {
|
|
8087
8253
|
duration: durationOption = mergedDuration.standard,
|
|
8088
8254
|
easing: easingOption = mergedEasing.easeInOut,
|
|
8089
8255
|
delay = 0
|
|
8090
8256
|
} = options;
|
|
8091
|
-
_objectWithoutPropertiesLoose$1(options, _excluded$
|
|
8257
|
+
_objectWithoutPropertiesLoose$1(options, _excluded$a);
|
|
8092
8258
|
return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
|
|
8093
8259
|
};
|
|
8094
|
-
return _extends$
|
|
8260
|
+
return _extends$5({
|
|
8095
8261
|
getAutoHeightDuration,
|
|
8096
8262
|
create
|
|
8097
8263
|
}, inputTransitions, {
|
|
@@ -8114,7 +8280,7 @@ const zIndex = {
|
|
|
8114
8280
|
};
|
|
8115
8281
|
var zIndex$1 = zIndex;
|
|
8116
8282
|
|
|
8117
|
-
const _excluded$
|
|
8283
|
+
const _excluded$9 = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
8118
8284
|
function createTheme(options = {}, ...args) {
|
|
8119
8285
|
const {
|
|
8120
8286
|
mixins: mixinsInput = {},
|
|
@@ -8122,26 +8288,26 @@ function createTheme(options = {}, ...args) {
|
|
|
8122
8288
|
transitions: transitionsInput = {},
|
|
8123
8289
|
typography: typographyInput = {}
|
|
8124
8290
|
} = options,
|
|
8125
|
-
other = _objectWithoutPropertiesLoose$1(options, _excluded$
|
|
8291
|
+
other = _objectWithoutPropertiesLoose$1(options, _excluded$9);
|
|
8126
8292
|
if (options.vars) {
|
|
8127
|
-
throw new Error(formatMuiErrorMessage(18));
|
|
8293
|
+
throw new Error(formatMuiErrorMessage$1(18));
|
|
8128
8294
|
}
|
|
8129
8295
|
const palette = createPalette(paletteInput);
|
|
8130
|
-
const systemTheme = createTheme$
|
|
8131
|
-
let muiTheme = deepmerge(systemTheme, {
|
|
8296
|
+
const systemTheme = createTheme$2(options);
|
|
8297
|
+
let muiTheme = deepmerge$1(systemTheme, {
|
|
8132
8298
|
mixins: createMixins(systemTheme.breakpoints, mixinsInput),
|
|
8133
8299
|
palette,
|
|
8134
8300
|
// Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
|
|
8135
8301
|
shadows: shadows.slice(),
|
|
8136
8302
|
typography: createTypography(palette, typographyInput),
|
|
8137
8303
|
transitions: createTransitions(transitionsInput),
|
|
8138
|
-
zIndex: _extends$
|
|
8304
|
+
zIndex: _extends$5({}, zIndex$1)
|
|
8139
8305
|
});
|
|
8140
|
-
muiTheme = deepmerge(muiTheme, other);
|
|
8141
|
-
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
8142
|
-
muiTheme.unstable_sxConfig = _extends$
|
|
8306
|
+
muiTheme = deepmerge$1(muiTheme, other);
|
|
8307
|
+
muiTheme = args.reduce((acc, argument) => deepmerge$1(acc, argument), muiTheme);
|
|
8308
|
+
muiTheme.unstable_sxConfig = _extends$5({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
|
|
8143
8309
|
muiTheme.unstable_sx = function sx(props) {
|
|
8144
|
-
return styleFunctionSx({
|
|
8310
|
+
return styleFunctionSx$1({
|
|
8145
8311
|
sx: props,
|
|
8146
8312
|
theme: this
|
|
8147
8313
|
});
|
|
@@ -8169,8 +8335,307 @@ function useThemeProps({
|
|
|
8169
8335
|
});
|
|
8170
8336
|
}
|
|
8171
8337
|
|
|
8172
|
-
|
|
8173
|
-
|
|
8338
|
+
var createStyled$1 = {};
|
|
8339
|
+
|
|
8340
|
+
var _extends$1 = {exports: {}};
|
|
8341
|
+
|
|
8342
|
+
var hasRequired_extends;
|
|
8343
|
+
|
|
8344
|
+
function require_extends () {
|
|
8345
|
+
if (hasRequired_extends) return _extends$1.exports;
|
|
8346
|
+
hasRequired_extends = 1;
|
|
8347
|
+
(function (module) {
|
|
8348
|
+
function _extends() {
|
|
8349
|
+
module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
8350
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8351
|
+
var source = arguments[i];
|
|
8352
|
+
for (var key in source) {
|
|
8353
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8354
|
+
target[key] = source[key];
|
|
8355
|
+
}
|
|
8356
|
+
}
|
|
8357
|
+
}
|
|
8358
|
+
return target;
|
|
8359
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
8360
|
+
return _extends.apply(this, arguments);
|
|
8361
|
+
}
|
|
8362
|
+
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
8363
|
+
} (_extends$1));
|
|
8364
|
+
return _extends$1.exports;
|
|
8365
|
+
}
|
|
8366
|
+
|
|
8367
|
+
var objectWithoutPropertiesLoose = {exports: {}};
|
|
8368
|
+
|
|
8369
|
+
var hasRequiredObjectWithoutPropertiesLoose;
|
|
8370
|
+
|
|
8371
|
+
function requireObjectWithoutPropertiesLoose () {
|
|
8372
|
+
if (hasRequiredObjectWithoutPropertiesLoose) return objectWithoutPropertiesLoose.exports;
|
|
8373
|
+
hasRequiredObjectWithoutPropertiesLoose = 1;
|
|
8374
|
+
(function (module) {
|
|
8375
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
8376
|
+
if (source == null) return {};
|
|
8377
|
+
var target = {};
|
|
8378
|
+
var sourceKeys = Object.keys(source);
|
|
8379
|
+
var key, i;
|
|
8380
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
8381
|
+
key = sourceKeys[i];
|
|
8382
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
8383
|
+
target[key] = source[key];
|
|
8384
|
+
}
|
|
8385
|
+
return target;
|
|
8386
|
+
}
|
|
8387
|
+
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
8388
|
+
} (objectWithoutPropertiesLoose));
|
|
8389
|
+
return objectWithoutPropertiesLoose.exports;
|
|
8390
|
+
}
|
|
8391
|
+
|
|
8392
|
+
var require$$3 = /*@__PURE__*/getAugmentedNamespace(styledEngine);
|
|
8393
|
+
|
|
8394
|
+
var require$$4 = /*@__PURE__*/getAugmentedNamespace(deepmerge);
|
|
8395
|
+
|
|
8396
|
+
var require$$5 = /*@__PURE__*/getAugmentedNamespace(capitalize);
|
|
8397
|
+
|
|
8398
|
+
var require$$6 = /*@__PURE__*/getAugmentedNamespace(getDisplayName);
|
|
8399
|
+
|
|
8400
|
+
var require$$7 = /*@__PURE__*/getAugmentedNamespace(createTheme$1);
|
|
8401
|
+
|
|
8402
|
+
var require$$8 = /*@__PURE__*/getAugmentedNamespace(styleFunctionSx);
|
|
8403
|
+
|
|
8404
|
+
var _interopRequireDefault$1 = interopRequireDefaultExports$1;
|
|
8405
|
+
Object.defineProperty(createStyled$1, "__esModule", {
|
|
8406
|
+
value: true
|
|
8407
|
+
});
|
|
8408
|
+
var _default = createStyled$1.default = createStyled;
|
|
8409
|
+
var shouldForwardProp_1 = createStyled$1.shouldForwardProp = shouldForwardProp;
|
|
8410
|
+
createStyled$1.systemDefaultTheme = void 0;
|
|
8411
|
+
var _extends2 = _interopRequireDefault$1(require_extends());
|
|
8412
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault$1(requireObjectWithoutPropertiesLoose());
|
|
8413
|
+
var _styledEngine = _interopRequireWildcard(require$$3);
|
|
8414
|
+
var _deepmerge = require$$4;
|
|
8415
|
+
_interopRequireDefault$1(require$$5);
|
|
8416
|
+
_interopRequireDefault$1(require$$6);
|
|
8417
|
+
var _createTheme = _interopRequireDefault$1(require$$7);
|
|
8418
|
+
var _styleFunctionSx = _interopRequireDefault$1(require$$8);
|
|
8419
|
+
const _excluded$8 = ["ownerState"],
|
|
8420
|
+
_excluded2$1 = ["variants"],
|
|
8421
|
+
_excluded3 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
8422
|
+
/* eslint-disable no-underscore-dangle */
|
|
8423
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
8424
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
8425
|
+
function isEmpty$1(obj) {
|
|
8426
|
+
return Object.keys(obj).length === 0;
|
|
8427
|
+
}
|
|
8428
|
+
|
|
8429
|
+
// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40
|
|
8430
|
+
function isStringTag(tag) {
|
|
8431
|
+
return typeof tag === 'string' &&
|
|
8432
|
+
// 96 is one less than the char code
|
|
8433
|
+
// for "a" so this is checking that
|
|
8434
|
+
// it's a lowercase character
|
|
8435
|
+
tag.charCodeAt(0) > 96;
|
|
8436
|
+
}
|
|
8437
|
+
|
|
8438
|
+
// Update /system/styled/#api in case if this changes
|
|
8439
|
+
function shouldForwardProp(prop) {
|
|
8440
|
+
return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
|
|
8441
|
+
}
|
|
8442
|
+
const systemDefaultTheme = createStyled$1.systemDefaultTheme = (0, _createTheme.default)();
|
|
8443
|
+
const lowercaseFirstLetter = string => {
|
|
8444
|
+
if (!string) {
|
|
8445
|
+
return string;
|
|
8446
|
+
}
|
|
8447
|
+
return string.charAt(0).toLowerCase() + string.slice(1);
|
|
8448
|
+
};
|
|
8449
|
+
function resolveTheme({
|
|
8450
|
+
defaultTheme,
|
|
8451
|
+
theme,
|
|
8452
|
+
themeId
|
|
8453
|
+
}) {
|
|
8454
|
+
return isEmpty$1(theme) ? defaultTheme : theme[themeId] || theme;
|
|
8455
|
+
}
|
|
8456
|
+
function defaultOverridesResolver(slot) {
|
|
8457
|
+
if (!slot) {
|
|
8458
|
+
return null;
|
|
8459
|
+
}
|
|
8460
|
+
return (props, styles) => styles[slot];
|
|
8461
|
+
}
|
|
8462
|
+
function processStyleArg(callableStyle, _ref) {
|
|
8463
|
+
let {
|
|
8464
|
+
ownerState
|
|
8465
|
+
} = _ref,
|
|
8466
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded$8);
|
|
8467
|
+
const resolvedStylesArg = typeof callableStyle === 'function' ? callableStyle((0, _extends2.default)({
|
|
8468
|
+
ownerState
|
|
8469
|
+
}, props)) : callableStyle;
|
|
8470
|
+
if (Array.isArray(resolvedStylesArg)) {
|
|
8471
|
+
return resolvedStylesArg.flatMap(resolvedStyle => processStyleArg(resolvedStyle, (0, _extends2.default)({
|
|
8472
|
+
ownerState
|
|
8473
|
+
}, props)));
|
|
8474
|
+
}
|
|
8475
|
+
if (!!resolvedStylesArg && typeof resolvedStylesArg === 'object' && Array.isArray(resolvedStylesArg.variants)) {
|
|
8476
|
+
const {
|
|
8477
|
+
variants = []
|
|
8478
|
+
} = resolvedStylesArg,
|
|
8479
|
+
otherStyles = (0, _objectWithoutPropertiesLoose2.default)(resolvedStylesArg, _excluded2$1);
|
|
8480
|
+
let result = otherStyles;
|
|
8481
|
+
variants.forEach(variant => {
|
|
8482
|
+
let isMatch = true;
|
|
8483
|
+
if (typeof variant.props === 'function') {
|
|
8484
|
+
isMatch = variant.props((0, _extends2.default)({
|
|
8485
|
+
ownerState
|
|
8486
|
+
}, props, ownerState));
|
|
8487
|
+
} else {
|
|
8488
|
+
Object.keys(variant.props).forEach(key => {
|
|
8489
|
+
if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {
|
|
8490
|
+
isMatch = false;
|
|
8491
|
+
}
|
|
8492
|
+
});
|
|
8493
|
+
}
|
|
8494
|
+
if (isMatch) {
|
|
8495
|
+
if (!Array.isArray(result)) {
|
|
8496
|
+
result = [result];
|
|
8497
|
+
}
|
|
8498
|
+
result.push(typeof variant.style === 'function' ? variant.style((0, _extends2.default)({
|
|
8499
|
+
ownerState
|
|
8500
|
+
}, props, ownerState)) : variant.style);
|
|
8501
|
+
}
|
|
8502
|
+
});
|
|
8503
|
+
return result;
|
|
8504
|
+
}
|
|
8505
|
+
return resolvedStylesArg;
|
|
8506
|
+
}
|
|
8507
|
+
function createStyled(input = {}) {
|
|
8508
|
+
const {
|
|
8509
|
+
themeId,
|
|
8510
|
+
defaultTheme = systemDefaultTheme,
|
|
8511
|
+
rootShouldForwardProp = shouldForwardProp,
|
|
8512
|
+
slotShouldForwardProp = shouldForwardProp
|
|
8513
|
+
} = input;
|
|
8514
|
+
const systemSx = props => {
|
|
8515
|
+
return (0, _styleFunctionSx.default)((0, _extends2.default)({}, props, {
|
|
8516
|
+
theme: resolveTheme((0, _extends2.default)({}, props, {
|
|
8517
|
+
defaultTheme,
|
|
8518
|
+
themeId
|
|
8519
|
+
}))
|
|
8520
|
+
}));
|
|
8521
|
+
};
|
|
8522
|
+
systemSx.__mui_systemSx = true;
|
|
8523
|
+
return (tag, inputOptions = {}) => {
|
|
8524
|
+
// Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.
|
|
8525
|
+
(0, _styledEngine.internal_processStyles)(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));
|
|
8526
|
+
const {
|
|
8527
|
+
name: componentName,
|
|
8528
|
+
slot: componentSlot,
|
|
8529
|
+
skipVariantsResolver: inputSkipVariantsResolver,
|
|
8530
|
+
skipSx: inputSkipSx,
|
|
8531
|
+
// TODO v6: remove `lowercaseFirstLetter()` in the next major release
|
|
8532
|
+
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
8533
|
+
overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
|
|
8534
|
+
} = inputOptions,
|
|
8535
|
+
options = (0, _objectWithoutPropertiesLoose2.default)(inputOptions, _excluded3);
|
|
8536
|
+
|
|
8537
|
+
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
8538
|
+
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
|
|
8539
|
+
// TODO v6: remove `Root` in the next major release
|
|
8540
|
+
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
8541
|
+
componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
|
|
8542
|
+
const skipSx = inputSkipSx || false;
|
|
8543
|
+
let label;
|
|
8544
|
+
let shouldForwardPropOption = shouldForwardProp;
|
|
8545
|
+
|
|
8546
|
+
// TODO v6: remove `Root` in the next major release
|
|
8547
|
+
// For more details: https://github.com/mui/material-ui/pull/37908
|
|
8548
|
+
if (componentSlot === 'Root' || componentSlot === 'root') {
|
|
8549
|
+
shouldForwardPropOption = rootShouldForwardProp;
|
|
8550
|
+
} else if (componentSlot) {
|
|
8551
|
+
// any other slot specified
|
|
8552
|
+
shouldForwardPropOption = slotShouldForwardProp;
|
|
8553
|
+
} else if (isStringTag(tag)) {
|
|
8554
|
+
// for string (html) tag, preserve the behavior in emotion & styled-components.
|
|
8555
|
+
shouldForwardPropOption = undefined;
|
|
8556
|
+
}
|
|
8557
|
+
const defaultStyledResolver = (0, _styledEngine.default)(tag, (0, _extends2.default)({
|
|
8558
|
+
shouldForwardProp: shouldForwardPropOption,
|
|
8559
|
+
label
|
|
8560
|
+
}, options));
|
|
8561
|
+
const transformStyleArg = stylesArg => {
|
|
8562
|
+
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
8563
|
+
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
8564
|
+
// which are basically components used as a selectors.
|
|
8565
|
+
if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg || (0, _deepmerge.isPlainObject)(stylesArg)) {
|
|
8566
|
+
return props => processStyleArg(stylesArg, (0, _extends2.default)({}, props, {
|
|
8567
|
+
theme: resolveTheme({
|
|
8568
|
+
theme: props.theme,
|
|
8569
|
+
defaultTheme,
|
|
8570
|
+
themeId
|
|
8571
|
+
})
|
|
8572
|
+
}));
|
|
8573
|
+
}
|
|
8574
|
+
return stylesArg;
|
|
8575
|
+
};
|
|
8576
|
+
const muiStyledResolver = (styleArg, ...expressions) => {
|
|
8577
|
+
let transformedStyleArg = transformStyleArg(styleArg);
|
|
8578
|
+
const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];
|
|
8579
|
+
if (componentName && overridesResolver) {
|
|
8580
|
+
expressionsWithDefaultTheme.push(props => {
|
|
8581
|
+
const theme = resolveTheme((0, _extends2.default)({}, props, {
|
|
8582
|
+
defaultTheme,
|
|
8583
|
+
themeId
|
|
8584
|
+
}));
|
|
8585
|
+
if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {
|
|
8586
|
+
return null;
|
|
8587
|
+
}
|
|
8588
|
+
const styleOverrides = theme.components[componentName].styleOverrides;
|
|
8589
|
+
const resolvedStyleOverrides = {};
|
|
8590
|
+
// TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly
|
|
8591
|
+
Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
|
|
8592
|
+
resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, (0, _extends2.default)({}, props, {
|
|
8593
|
+
theme
|
|
8594
|
+
}));
|
|
8595
|
+
});
|
|
8596
|
+
return overridesResolver(props, resolvedStyleOverrides);
|
|
8597
|
+
});
|
|
8598
|
+
}
|
|
8599
|
+
if (componentName && !skipVariantsResolver) {
|
|
8600
|
+
expressionsWithDefaultTheme.push(props => {
|
|
8601
|
+
var _theme$components;
|
|
8602
|
+
const theme = resolveTheme((0, _extends2.default)({}, props, {
|
|
8603
|
+
defaultTheme,
|
|
8604
|
+
themeId
|
|
8605
|
+
}));
|
|
8606
|
+
const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;
|
|
8607
|
+
return processStyleArg({
|
|
8608
|
+
variants: themeVariants
|
|
8609
|
+
}, (0, _extends2.default)({}, props, {
|
|
8610
|
+
theme
|
|
8611
|
+
}));
|
|
8612
|
+
});
|
|
8613
|
+
}
|
|
8614
|
+
if (!skipSx) {
|
|
8615
|
+
expressionsWithDefaultTheme.push(systemSx);
|
|
8616
|
+
}
|
|
8617
|
+
const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
|
|
8618
|
+
if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
|
|
8619
|
+
const placeholders = new Array(numOfCustomFnsApplied).fill('');
|
|
8620
|
+
// If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.
|
|
8621
|
+
transformedStyleArg = [...styleArg, ...placeholders];
|
|
8622
|
+
transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
|
|
8623
|
+
}
|
|
8624
|
+
const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
|
|
8625
|
+
if (tag.muiName) {
|
|
8626
|
+
Component.muiName = tag.muiName;
|
|
8627
|
+
}
|
|
8628
|
+
return Component;
|
|
8629
|
+
};
|
|
8630
|
+
if (defaultStyledResolver.withConfig) {
|
|
8631
|
+
muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
|
|
8632
|
+
}
|
|
8633
|
+
return muiStyledResolver;
|
|
8634
|
+
};
|
|
8635
|
+
}
|
|
8636
|
+
|
|
8637
|
+
const rootShouldForwardProp = prop => shouldForwardProp_1(prop) && prop !== 'classes';
|
|
8638
|
+
const styled = _default({
|
|
8174
8639
|
themeId: THEME_ID,
|
|
8175
8640
|
defaultTheme: defaultTheme$1,
|
|
8176
8641
|
rootShouldForwardProp
|
|
@@ -8183,7 +8648,7 @@ function ThemeProvider(_ref) {
|
|
|
8183
8648
|
} = _ref,
|
|
8184
8649
|
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$7);
|
|
8185
8650
|
const scopedTheme = themeInput[THEME_ID];
|
|
8186
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$
|
|
8651
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$5({}, props, {
|
|
8187
8652
|
themeId: scopedTheme ? THEME_ID : undefined,
|
|
8188
8653
|
theme: scopedTheme || themeInput
|
|
8189
8654
|
}));
|
|
@@ -8568,7 +9033,7 @@ function create$3(definition) {
|
|
|
8568
9033
|
return cache[key];
|
|
8569
9034
|
}
|
|
8570
9035
|
|
|
8571
|
-
const NEBULA_VERSION_HASH = "
|
|
9036
|
+
const NEBULA_VERSION_HASH = "03a3" ;
|
|
8572
9037
|
ClassNameGenerator.configure(componentName => {
|
|
8573
9038
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
8574
9039
|
});
|
|
@@ -8828,7 +9293,7 @@ function boot(_ref2) {
|
|
|
8828
9293
|
const appRef = React__default.createRef();
|
|
8829
9294
|
const element = document.createElement('div');
|
|
8830
9295
|
element.style.display = 'none';
|
|
8831
|
-
element.setAttribute('data-nebulajs-version', "4.
|
|
9296
|
+
element.setAttribute('data-nebulajs-version', "4.12.0" );
|
|
8832
9297
|
element.setAttribute('data-app-id', app.id);
|
|
8833
9298
|
document.body.appendChild(element);
|
|
8834
9299
|
if (context) {
|
|
@@ -9233,7 +9698,7 @@ function SvgIcon$1(_ref) {
|
|
|
9233
9698
|
return (
|
|
9234
9699
|
/*#__PURE__*/
|
|
9235
9700
|
// eslint-disable-next-line react/no-array-index-key
|
|
9236
|
-
React__default.createElement(Type, _extends$
|
|
9701
|
+
React__default.createElement(Type, _extends$6({
|
|
9237
9702
|
key: ix
|
|
9238
9703
|
}, attrs))
|
|
9239
9704
|
);
|
|
@@ -9701,7 +10166,11 @@ function useSelectionsInteractions(_ref) {
|
|
|
9701
10166
|
}, [(_loaderRef$current2 = loaderRef.current) === null || _loaderRef$current2 === void 0 || (_loaderRef$current2 = _loaderRef$current2._listRef) === null || _loaderRef$current2 === void 0 ? void 0 : _loaderRef$current2._outerRef]);
|
|
9702
10167
|
|
|
9703
10168
|
// eslint-disable-next-line arrow-body-style
|
|
9704
|
-
const doSelect = () => {
|
|
10169
|
+
const doSelect = async () => {
|
|
10170
|
+
var _selectionState$selec;
|
|
10171
|
+
if ((_selectionState$selec = selectionState.selectDisabled) !== null && _selectionState$selec !== void 0 && _selectionState$selec.call(selectionState)) {
|
|
10172
|
+
return false;
|
|
10173
|
+
}
|
|
9705
10174
|
selectionState.setSelectableValuesUpdating();
|
|
9706
10175
|
return selectValues({
|
|
9707
10176
|
selections,
|
|
@@ -9724,10 +10193,14 @@ function useSelectionsInteractions(_ref) {
|
|
|
9724
10193
|
const toMaybeAdd = getRange(currentSelect.current.startElemNumber, elemNumber);
|
|
9725
10194
|
selectionState.updateItems(toMaybeAdd, true, currentSelect.current.elemNumbers);
|
|
9726
10195
|
};
|
|
9727
|
-
const selectManually = function () {
|
|
10196
|
+
const selectManually = async function () {
|
|
10197
|
+
var _selectionState$selec2;
|
|
9728
10198
|
let elementIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9729
10199
|
let additive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
9730
10200
|
let event = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
10201
|
+
if ((_selectionState$selec2 = selectionState.selectDisabled) !== null && _selectionState$selec2 !== void 0 && _selectionState$selec2.call(selectionState)) {
|
|
10202
|
+
return false;
|
|
10203
|
+
}
|
|
9731
10204
|
const toggle = !selectionState.isSingleSelect && getKeyAsToggleSelected(event === null || event === void 0 ? void 0 : event.nativeEvent);
|
|
9732
10205
|
if (!toggle) {
|
|
9733
10206
|
selectionState.clearItemStates(true);
|
|
@@ -10415,18 +10888,22 @@ function ListboxCheckbox(_ref2) {
|
|
|
10415
10888
|
|
|
10416
10889
|
const PREFIX$a = 'ListBoxRadioButton';
|
|
10417
10890
|
const classes$a = {
|
|
10418
|
-
denseRadioButton: "".concat(PREFIX$a, "-denseRadioButton"),
|
|
10419
10891
|
radioButton: "".concat(PREFIX$a, "-radioButton")
|
|
10420
10892
|
};
|
|
10421
|
-
const StyledRadio = styled(Radio
|
|
10893
|
+
const StyledRadio = styled(Radio, {
|
|
10894
|
+
shouldForwardProp: p => !['dense', 'styles'].includes(p)
|
|
10895
|
+
})(_ref => {
|
|
10422
10896
|
let {
|
|
10423
|
-
|
|
10424
|
-
|
|
10897
|
+
checked,
|
|
10898
|
+
styles,
|
|
10899
|
+
dense
|
|
10425
10900
|
} = _ref;
|
|
10426
10901
|
return {
|
|
10427
10902
|
["&.".concat(classes$a.radioButton)]: {
|
|
10428
10903
|
right: '5px',
|
|
10429
|
-
color: checked ?
|
|
10904
|
+
color: checked ? styles.selections.selected : styles.content.color,
|
|
10905
|
+
padding: dense ? '0px 0px 0px 12px' : undefined,
|
|
10906
|
+
backgroundColor: 'transparent'
|
|
10430
10907
|
}
|
|
10431
10908
|
};
|
|
10432
10909
|
});
|
|
@@ -10436,7 +10913,8 @@ function ListBoxRadioButton(_ref2) {
|
|
|
10436
10913
|
checked,
|
|
10437
10914
|
label,
|
|
10438
10915
|
dense,
|
|
10439
|
-
dataN
|
|
10916
|
+
dataN,
|
|
10917
|
+
styles
|
|
10440
10918
|
} = _ref2;
|
|
10441
10919
|
return /*#__PURE__*/React__default.createElement(StyledRadio, {
|
|
10442
10920
|
checked: checked,
|
|
@@ -10447,14 +10925,10 @@ function ListBoxRadioButton(_ref2) {
|
|
|
10447
10925
|
inputProps: {
|
|
10448
10926
|
'data-n': dataN
|
|
10449
10927
|
},
|
|
10450
|
-
style: {
|
|
10451
|
-
backgroundColor: 'transparent'
|
|
10452
|
-
},
|
|
10453
10928
|
disableRipple: true,
|
|
10454
10929
|
size: dense ? 'small' : 'medium',
|
|
10455
|
-
|
|
10456
|
-
|
|
10457
|
-
}
|
|
10930
|
+
dense: dense,
|
|
10931
|
+
styles: styles
|
|
10458
10932
|
});
|
|
10459
10933
|
}
|
|
10460
10934
|
|
|
@@ -10534,7 +11008,8 @@ function CheckboxField(_ref) {
|
|
|
10534
11008
|
label: label,
|
|
10535
11009
|
checked: isSelected,
|
|
10536
11010
|
dense: dense,
|
|
10537
|
-
dataN: qElemNumber
|
|
11011
|
+
dataN: qElemNumber,
|
|
11012
|
+
styles: styles
|
|
10538
11013
|
});
|
|
10539
11014
|
return /*#__PURE__*/React__default.createElement(FormControlLabel, {
|
|
10540
11015
|
control: isSingleSelect ? rb : cb,
|
|
@@ -12950,7 +13425,7 @@ function getListBoxComponents(_ref) {
|
|
|
12950
13425
|
local,
|
|
12951
13426
|
isVertical,
|
|
12952
13427
|
pages,
|
|
12953
|
-
|
|
13428
|
+
selectionState,
|
|
12954
13429
|
interactionEvents,
|
|
12955
13430
|
deducedFrequencyMode,
|
|
12956
13431
|
histogram,
|
|
@@ -13005,7 +13480,7 @@ function getListBoxComponents(_ref) {
|
|
|
13005
13480
|
isLocked,
|
|
13006
13481
|
column: !isVertical,
|
|
13007
13482
|
pages
|
|
13008
|
-
}, isLocked || selectDisabled() ? {} : interactionEvents), {}, {
|
|
13483
|
+
}, isLocked || selectionState.selectDisabled() ? {} : interactionEvents), {}, {
|
|
13009
13484
|
checkboxes,
|
|
13010
13485
|
layoutOptions,
|
|
13011
13486
|
deducedFrequencyMode,
|
|
@@ -13044,7 +13519,7 @@ function getListBoxComponents(_ref) {
|
|
|
13044
13519
|
local.current.listRef = ref;
|
|
13045
13520
|
return /*#__PURE__*/React__default.createElement(StyledFixedSizeList
|
|
13046
13521
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
13047
|
-
, _extends$
|
|
13522
|
+
, _extends$6({}, commonComponentOptions, {
|
|
13048
13523
|
dataTestid: "fixed-size-list",
|
|
13049
13524
|
scrollDisabled: constraints === null || constraints === void 0 ? void 0 : constraints.active,
|
|
13050
13525
|
height: listHeight,
|
|
@@ -13121,7 +13596,7 @@ function getListBoxComponents(_ref) {
|
|
|
13121
13596
|
};
|
|
13122
13597
|
return /*#__PURE__*/React__default.createElement(StyledFixedSizeGrid
|
|
13123
13598
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
13124
|
-
, _extends$
|
|
13599
|
+
, _extends$6({}, commonComponentOptions, {
|
|
13125
13600
|
dataTestid: "fixed-size-grid",
|
|
13126
13601
|
scrollDisabled: constraints === null || constraints === void 0 ? void 0 : constraints.active,
|
|
13127
13602
|
height: gridHeight,
|
|
@@ -13573,7 +14048,7 @@ const useUtilityClasses = ownerState => {
|
|
|
13573
14048
|
classes
|
|
13574
14049
|
} = ownerState;
|
|
13575
14050
|
const slots = {
|
|
13576
|
-
root: ['root', color !== 'inherit' && `color${capitalize(color)}`, `fontSize${capitalize(fontSize)}`]
|
|
14051
|
+
root: ['root', color !== 'inherit' && `color${capitalize$1(color)}`, `fontSize${capitalize$1(fontSize)}`]
|
|
13577
14052
|
};
|
|
13578
14053
|
return composeClasses(slots, getSvgIconUtilityClass, classes);
|
|
13579
14054
|
};
|
|
@@ -13584,7 +14059,7 @@ const SvgIconRoot = styled('svg', {
|
|
|
13584
14059
|
const {
|
|
13585
14060
|
ownerState
|
|
13586
14061
|
} = props;
|
|
13587
|
-
return [styles.root, ownerState.color !== 'inherit' && styles[`color${capitalize(ownerState.color)}`], styles[`fontSize${capitalize(ownerState.fontSize)}`]];
|
|
14062
|
+
return [styles.root, ownerState.color !== 'inherit' && styles[`color${capitalize$1(ownerState.color)}`], styles[`fontSize${capitalize$1(ownerState.fontSize)}`]];
|
|
13588
14063
|
}
|
|
13589
14064
|
})(({
|
|
13590
14065
|
theme,
|
|
@@ -13635,7 +14110,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
13635
14110
|
} = props,
|
|
13636
14111
|
other = _objectWithoutPropertiesLoose$1(props, _excluded$5);
|
|
13637
14112
|
const hasSvgAsChild = /*#__PURE__*/React.isValidElement(children) && children.type === 'svg';
|
|
13638
|
-
const ownerState = _extends$
|
|
14113
|
+
const ownerState = _extends$5({}, props, {
|
|
13639
14114
|
color,
|
|
13640
14115
|
component,
|
|
13641
14116
|
fontSize,
|
|
@@ -13649,7 +14124,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
13649
14124
|
more.viewBox = viewBox;
|
|
13650
14125
|
}
|
|
13651
14126
|
const classes = useUtilityClasses(ownerState);
|
|
13652
|
-
return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, _extends$
|
|
14127
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs(SvgIconRoot, _extends$5({
|
|
13653
14128
|
as: component,
|
|
13654
14129
|
className: clsx(classes.root, className),
|
|
13655
14130
|
focusable: "false",
|
|
@@ -13668,7 +14143,7 @@ SvgIcon.muiName = 'SvgIcon';
|
|
|
13668
14143
|
|
|
13669
14144
|
function createSvgIcon(path, displayName) {
|
|
13670
14145
|
function Component(props, ref) {
|
|
13671
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon, _extends$
|
|
14146
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(SvgIcon, _extends$5({
|
|
13672
14147
|
"data-testid": `${displayName}Icon`,
|
|
13673
14148
|
ref: ref
|
|
13674
14149
|
}, props, {
|
|
@@ -13689,7 +14164,7 @@ const unstable_ClassNameGenerator = {
|
|
|
13689
14164
|
|
|
13690
14165
|
var utils$1 = /*#__PURE__*/Object.freeze({
|
|
13691
14166
|
__proto__: null,
|
|
13692
|
-
capitalize: capitalize,
|
|
14167
|
+
capitalize: capitalize$1,
|
|
13693
14168
|
createChainedFunction: createChainedFunction,
|
|
13694
14169
|
createSvgIcon: createSvgIcon,
|
|
13695
14170
|
debounce: debounce,
|
|
@@ -13949,7 +14424,6 @@ function ListBox(_ref) {
|
|
|
13949
14424
|
keyboard = {},
|
|
13950
14425
|
showGray = true,
|
|
13951
14426
|
scrollState,
|
|
13952
|
-
selectDisabled = () => false,
|
|
13953
14427
|
keyScroll = {
|
|
13954
14428
|
state: {},
|
|
13955
14429
|
reset: () => {}
|
|
@@ -14017,7 +14491,6 @@ function ListBox(_ref) {
|
|
|
14017
14491
|
setPages,
|
|
14018
14492
|
pages: itemsLoader.pages,
|
|
14019
14493
|
isSingleSelect,
|
|
14020
|
-
selectDisabled,
|
|
14021
14494
|
layout
|
|
14022
14495
|
});
|
|
14023
14496
|
}
|
|
@@ -14212,7 +14685,7 @@ function ListBox(_ref) {
|
|
|
14212
14685
|
textAlign,
|
|
14213
14686
|
isVertical,
|
|
14214
14687
|
pages,
|
|
14215
|
-
|
|
14688
|
+
selectionState,
|
|
14216
14689
|
isSingleSelect,
|
|
14217
14690
|
selections,
|
|
14218
14691
|
scrollState,
|
|
@@ -14577,7 +15050,7 @@ const More$1 = React__default.forwardRef((_ref3, ref) => {
|
|
|
14577
15050
|
const autoFocusIndex = actions.findIndex(action => !action.disabled);
|
|
14578
15051
|
return showActions && /*#__PURE__*/React__default.createElement(StyledPopover$1
|
|
14579
15052
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
14580
|
-
, _extends$
|
|
15053
|
+
, _extends$6({}, popoverProps, {
|
|
14581
15054
|
onClose: onCloseOrActionClick,
|
|
14582
15055
|
ref: ref,
|
|
14583
15056
|
open: show,
|
|
@@ -15013,7 +15486,9 @@ function ListBoxSearch(_ref2) {
|
|
|
15013
15486
|
const isRtl = direction === 'rtl';
|
|
15014
15487
|
const cancel = () => selections.isActive() && selections.cancel();
|
|
15015
15488
|
const abortSearch = async () => {
|
|
15016
|
-
|
|
15489
|
+
// When select is disabled we always want to allow abort (but not permitting selections).
|
|
15490
|
+
const preventAbort = selectionState.selectDisabled() ? false : !selections.isModal();
|
|
15491
|
+
if (preventAbort) {
|
|
15017
15492
|
return;
|
|
15018
15493
|
}
|
|
15019
15494
|
try {
|
|
@@ -15055,7 +15530,7 @@ function ListBoxSearch(_ref2) {
|
|
|
15055
15530
|
setValue(WILDCARD);
|
|
15056
15531
|
setWildcardOn(true);
|
|
15057
15532
|
}
|
|
15058
|
-
if (!selections.isModal()) {
|
|
15533
|
+
if (!selectionState.selectDisabled() && !selections.isModal()) {
|
|
15059
15534
|
selections.begin(['/qListObjectDef']);
|
|
15060
15535
|
}
|
|
15061
15536
|
};
|
|
@@ -15066,6 +15541,9 @@ function ListBoxSearch(_ref2) {
|
|
|
15066
15541
|
const performSearch = async () => {
|
|
15067
15542
|
let response;
|
|
15068
15543
|
const success = await model.searchListObjectFor(TREE_PATH, value);
|
|
15544
|
+
if (selectionState.selectDisabled()) {
|
|
15545
|
+
return success;
|
|
15546
|
+
}
|
|
15069
15547
|
if (success && value.length && hasHits()) {
|
|
15070
15548
|
response = model.acceptListObjectSearch(TREE_PATH, true);
|
|
15071
15549
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -15444,7 +15922,8 @@ function useObjectSelections(app, model, elements, options) {
|
|
|
15444
15922
|
}
|
|
15445
15923
|
|
|
15446
15924
|
function selectionState() {
|
|
15447
|
-
|
|
15925
|
+
let initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15926
|
+
const state = _objectSpread2(_objectSpread2({
|
|
15448
15927
|
itemStates: {},
|
|
15449
15928
|
ignoreSelectionState: false,
|
|
15450
15929
|
selectedInEngine: [],
|
|
@@ -15452,6 +15931,8 @@ function selectionState() {
|
|
|
15452
15931
|
setPages: undefined,
|
|
15453
15932
|
lastRowCount: undefined,
|
|
15454
15933
|
lastApprMaxGlyphCount: undefined,
|
|
15934
|
+
selectDisabled: undefined
|
|
15935
|
+
}, initialState), {}, {
|
|
15455
15936
|
update(_ref) {
|
|
15456
15937
|
var _layout$qListObject$q, _layout$qListObject;
|
|
15457
15938
|
let {
|
|
@@ -15479,7 +15960,7 @@ function selectionState() {
|
|
|
15479
15960
|
state.triggerStateChanged();
|
|
15480
15961
|
}
|
|
15481
15962
|
state.isSingleSelect = isSingleSelect;
|
|
15482
|
-
state.selectDisabled = selectDisabled;
|
|
15963
|
+
state.selectDisabled = selectDisabled || state.selectDisabled;
|
|
15483
15964
|
state.isDimCalculated = (_layout$qListObject$q = 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.qIsCalculated) !== null && _layout$qListObject$q !== void 0 ? _layout$qListObject$q : false;
|
|
15484
15965
|
},
|
|
15485
15966
|
allowedToSelect() {
|
|
@@ -15558,7 +16039,7 @@ function selectionState() {
|
|
|
15558
16039
|
state.itemStates = {};
|
|
15559
16040
|
state.ignoreSelectionState = ignoreSelectionState;
|
|
15560
16041
|
}
|
|
15561
|
-
};
|
|
16042
|
+
});
|
|
15562
16043
|
return state;
|
|
15563
16044
|
}
|
|
15564
16045
|
|
|
@@ -17568,7 +18049,8 @@ function ListBoxPopover(_ref) {
|
|
|
17568
18049
|
stateName = '$',
|
|
17569
18050
|
autoFocus,
|
|
17570
18051
|
components,
|
|
17571
|
-
checkboxes: checkboxesOption
|
|
18052
|
+
checkboxes: checkboxesOption,
|
|
18053
|
+
selectDisabled = () => false
|
|
17572
18054
|
} = _ref;
|
|
17573
18055
|
const isMasterDim = Boolean(fieldName === null || fieldName === void 0 ? void 0 : fieldName.qLibraryId);
|
|
17574
18056
|
const open = show && Boolean(alignTo.current);
|
|
@@ -17614,7 +18096,9 @@ function ListBoxPopover(_ref) {
|
|
|
17614
18096
|
const containerRef = useRef();
|
|
17615
18097
|
const [selections] = useObjectSelections(app, model, containerRef);
|
|
17616
18098
|
const [layout] = useLayout$1(model);
|
|
17617
|
-
const [selectionState$1] = useState$1(() => selectionState(
|
|
18099
|
+
const [selectionState$1] = useState$1(() => selectionState({
|
|
18100
|
+
selectDisabled
|
|
18101
|
+
}));
|
|
17618
18102
|
const {
|
|
17619
18103
|
checkboxes = checkboxesOption
|
|
17620
18104
|
} = layout || {};
|
|
@@ -18755,16 +19239,15 @@ class AutoSizer extends Component {
|
|
|
18755
19239
|
onResize
|
|
18756
19240
|
} = this.props;
|
|
18757
19241
|
if (this._parentNode) {
|
|
18758
|
-
var _style$paddingLeft, _style$paddingRight, _style$paddingTop, _style$paddingBottom;
|
|
18759
19242
|
// Guard against AutoSizer component being removed from the DOM immediately after being added.
|
|
18760
19243
|
// This can result in invalid style values which can result in NaN values if we don't handle them.
|
|
18761
19244
|
// See issue #150 for more context.
|
|
18762
19245
|
|
|
18763
19246
|
const style = window.getComputedStyle(this._parentNode) || {};
|
|
18764
|
-
const paddingLeft = parseFloat(
|
|
18765
|
-
const paddingRight = parseFloat(
|
|
18766
|
-
const paddingTop = parseFloat(
|
|
18767
|
-
const paddingBottom = parseFloat(
|
|
19247
|
+
const paddingLeft = parseFloat(style.paddingLeft || "0");
|
|
19248
|
+
const paddingRight = parseFloat(style.paddingRight || "0");
|
|
19249
|
+
const paddingTop = parseFloat(style.paddingTop || "0");
|
|
19250
|
+
const paddingBottom = parseFloat(style.paddingBottom || "0");
|
|
18768
19251
|
const rect = this._parentNode.getBoundingClientRect();
|
|
18769
19252
|
const scaledHeight = rect.height - paddingTop - paddingBottom;
|
|
18770
19253
|
const scaledWidth = rect.width - paddingLeft - paddingRight;
|
|
@@ -18796,29 +19279,31 @@ class AutoSizer extends Component {
|
|
|
18796
19279
|
const {
|
|
18797
19280
|
nonce
|
|
18798
19281
|
} = this.props;
|
|
18799
|
-
|
|
19282
|
+
const parentNode = this._autoSizer ? this._autoSizer.parentNode : null;
|
|
19283
|
+
if (parentNode != null && parentNode.ownerDocument && parentNode.ownerDocument.defaultView && parentNode instanceof parentNode.ownerDocument.defaultView.HTMLElement) {
|
|
18800
19284
|
// Delay access of parentNode until mount.
|
|
18801
19285
|
// This handles edge-cases where the component has already been unmounted before its ref has been set,
|
|
18802
19286
|
// As well as libraries like react-lite which have a slightly different lifecycle.
|
|
18803
|
-
this._parentNode =
|
|
18804
|
-
|
|
18805
|
-
//
|
|
18806
|
-
//
|
|
18807
|
-
|
|
18808
|
-
|
|
18809
|
-
|
|
18810
|
-
|
|
18811
|
-
|
|
18812
|
-
|
|
18813
|
-
|
|
18814
|
-
|
|
18815
|
-
|
|
18816
|
-
|
|
18817
|
-
|
|
18818
|
-
|
|
18819
|
-
|
|
18820
|
-
this._onResize
|
|
19287
|
+
this._parentNode = parentNode;
|
|
19288
|
+
|
|
19289
|
+
// Use ResizeObserver from the same context where parentNode (which we will observe) was defined
|
|
19290
|
+
// Using just global can result into onResize events not being emitted in cases with multiple realms
|
|
19291
|
+
const ResizeObserverInstance = parentNode.ownerDocument.defaultView.ResizeObserver;
|
|
19292
|
+
if (ResizeObserverInstance != null) {
|
|
19293
|
+
this._resizeObserver = new ResizeObserverInstance(() => {
|
|
19294
|
+
// Guard against "ResizeObserver loop limit exceeded" error;
|
|
19295
|
+
// could be triggered if the state update causes the ResizeObserver handler to run long.
|
|
19296
|
+
// See https://github.com/bvaughn/react-virtualized-auto-sizer/issues/55
|
|
19297
|
+
this._timeoutId = setTimeout(this._onResize, 0);
|
|
19298
|
+
});
|
|
19299
|
+
this._resizeObserver.observe(parentNode);
|
|
19300
|
+
} else {
|
|
19301
|
+
// Defer requiring resize handler in order to support server-side rendering.
|
|
19302
|
+
// See issue #41
|
|
19303
|
+
this._detectElementResize = createDetectElementResize(nonce);
|
|
19304
|
+
this._detectElementResize.addResizeListener(parentNode, this._onResize);
|
|
18821
19305
|
}
|
|
19306
|
+
this._onResize();
|
|
18822
19307
|
}
|
|
18823
19308
|
}
|
|
18824
19309
|
componentWillUnmount() {
|
|
@@ -18830,7 +19315,6 @@ class AutoSizer extends Component {
|
|
|
18830
19315
|
clearTimeout(this._timeoutId);
|
|
18831
19316
|
}
|
|
18832
19317
|
if (this._resizeObserver) {
|
|
18833
|
-
this._resizeObserver.observe(this._parentNode);
|
|
18834
19318
|
this._resizeObserver.disconnect();
|
|
18835
19319
|
}
|
|
18836
19320
|
}
|
|
@@ -19202,9 +19686,11 @@ function getListboxActionProps(_ref) {
|
|
|
19202
19686
|
listboxSelectionToolbarItems,
|
|
19203
19687
|
extraItems,
|
|
19204
19688
|
selections,
|
|
19205
|
-
keyboard
|
|
19689
|
+
keyboard,
|
|
19690
|
+
autoConfirm
|
|
19206
19691
|
} = _ref;
|
|
19207
19692
|
return {
|
|
19693
|
+
autoConfirm,
|
|
19208
19694
|
isDetached,
|
|
19209
19695
|
show: showToolbar && !isDetached,
|
|
19210
19696
|
popover: {
|
|
@@ -19367,7 +19853,6 @@ function ListBoxHeader(_ref2) {
|
|
|
19367
19853
|
styles,
|
|
19368
19854
|
isRtl,
|
|
19369
19855
|
showLock,
|
|
19370
|
-
selectDisabled,
|
|
19371
19856
|
showSearchIcon,
|
|
19372
19857
|
isDrillDown,
|
|
19373
19858
|
constraints,
|
|
@@ -19421,7 +19906,7 @@ function ListBoxHeader(_ref2) {
|
|
|
19421
19906
|
type: undefined,
|
|
19422
19907
|
label: translator.get('SelectionToolbar.ClickToLock'),
|
|
19423
19908
|
getSvgIconShape: unlock,
|
|
19424
|
-
enabled: () => !settingLockedState && !selectDisabled() && hasSelections(layout),
|
|
19909
|
+
enabled: () => !settingLockedState && !selectionState.selectDisabled() && hasSelections(layout),
|
|
19425
19910
|
action: toggleLock
|
|
19426
19911
|
}];
|
|
19427
19912
|
const searchIconComp = constraints !== null && constraints !== void 0 && constraints.active ? /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
@@ -19465,7 +19950,7 @@ function ListBoxHeader(_ref2) {
|
|
|
19465
19950
|
keyboard,
|
|
19466
19951
|
autoConfirm
|
|
19467
19952
|
});
|
|
19468
|
-
const actionsToolbar = /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$
|
|
19953
|
+
const actionsToolbar = /*#__PURE__*/React__default.createElement(ActionsToolbar, _extends$6({
|
|
19469
19954
|
isRtl: isRtl,
|
|
19470
19955
|
layout: layout
|
|
19471
19956
|
}, toolbarProps));
|
|
@@ -19592,7 +20077,6 @@ function ListBoxInline(_ref3) {
|
|
|
19592
20077
|
selections,
|
|
19593
20078
|
update = undefined,
|
|
19594
20079
|
fetchStart = undefined,
|
|
19595
|
-
selectDisabled = () => false,
|
|
19596
20080
|
postProcessPages = undefined,
|
|
19597
20081
|
calculatePagesHeight,
|
|
19598
20082
|
showGray = true,
|
|
@@ -19601,7 +20085,8 @@ function ListBoxInline(_ref3) {
|
|
|
19601
20085
|
toolbar = true,
|
|
19602
20086
|
isPopover = false,
|
|
19603
20087
|
showLock = false,
|
|
19604
|
-
components
|
|
20088
|
+
components,
|
|
20089
|
+
selectDisabled = () => false
|
|
19605
20090
|
} = options;
|
|
19606
20091
|
|
|
19607
20092
|
// Hook that will trigger update when used in useEffects.
|
|
@@ -19652,7 +20137,9 @@ function ListBoxInline(_ref3) {
|
|
|
19652
20137
|
stop: 0
|
|
19653
20138
|
});
|
|
19654
20139
|
const [appSelections] = useAppSelections(app);
|
|
19655
|
-
const [selectionState$1] = useState$1(() => selectionState(
|
|
20140
|
+
const [selectionState$1] = useState$1(() => selectionState({
|
|
20141
|
+
selectDisabled
|
|
20142
|
+
}));
|
|
19656
20143
|
const keyboard = useTempKeyboard({
|
|
19657
20144
|
containerRef,
|
|
19658
20145
|
enabled: keyboardNavigation
|
|
@@ -19748,7 +20235,7 @@ function ListBoxInline(_ref3) {
|
|
|
19748
20235
|
return null;
|
|
19749
20236
|
}
|
|
19750
20237
|
const showSearchToggle = search === 'toggle' && showSearch;
|
|
19751
|
-
const searchVisible = search === true || showSearchToggle &&
|
|
20238
|
+
const searchVisible = search === true || showSearchToggle && searchEnabled !== false;
|
|
19752
20239
|
const dense = (_layoutOptions$dense = layoutOptions.dense) !== null && _layoutOptions$dense !== void 0 ? _layoutOptions$dense : false;
|
|
19753
20240
|
const handleShowSearch = () => {
|
|
19754
20241
|
const newValue = !showSearch;
|
|
@@ -19777,7 +20264,6 @@ function ListBoxInline(_ref3) {
|
|
|
19777
20264
|
}
|
|
19778
20265
|
const listBoxMinHeight = showAttachedToolbar ? DENSE_ROW_HEIGHT + SCROLL_BAR_WIDTH : 0;
|
|
19779
20266
|
const listBoxHeader = /*#__PURE__*/React__default.createElement(ListBoxHeader, {
|
|
19780
|
-
selectDisabled: selectDisabled,
|
|
19781
20267
|
showSearchIcon: showSearchIcon,
|
|
19782
20268
|
isDrillDown: isDrillDown,
|
|
19783
20269
|
onShowSearch: handleShowSearch,
|
|
@@ -19874,7 +20360,6 @@ function ListBoxInline(_ref3) {
|
|
|
19874
20360
|
fetchStart: fetchStart,
|
|
19875
20361
|
postProcessPages: postProcessPages,
|
|
19876
20362
|
calculatePagesHeight: calculatePagesHeight,
|
|
19877
|
-
selectDisabled: selectDisabled,
|
|
19878
20363
|
keyboard: keyboard,
|
|
19879
20364
|
showGray: showGray,
|
|
19880
20365
|
scrollState: scrollState,
|
|
@@ -21834,13 +22319,13 @@ function Progress(_ref2) {
|
|
|
21834
22319
|
const s = SIZES[size];
|
|
21835
22320
|
return /*#__PURE__*/React__default.createElement(Root, {
|
|
21836
22321
|
className: classes$3.root
|
|
21837
|
-
}, /*#__PURE__*/React__default.createElement(CircularProgress, _extends$
|
|
22322
|
+
}, /*#__PURE__*/React__default.createElement(CircularProgress, _extends$6({
|
|
21838
22323
|
variant: "determinate",
|
|
21839
22324
|
value: 100,
|
|
21840
22325
|
className: classes$3.back,
|
|
21841
22326
|
size: s,
|
|
21842
22327
|
thickness: 3
|
|
21843
|
-
}, props)), /*#__PURE__*/React__default.createElement(CircularProgress, _extends$
|
|
22328
|
+
}, props)), /*#__PURE__*/React__default.createElement(CircularProgress, _extends$6({
|
|
21844
22329
|
variant: "indeterminate",
|
|
21845
22330
|
disableShrink: true,
|
|
21846
22331
|
className: classes$3.front,
|
|
@@ -21890,7 +22375,7 @@ function Cancel(_ref) {
|
|
|
21890
22375
|
variant: "h6",
|
|
21891
22376
|
align: "center",
|
|
21892
22377
|
"data-tid": "update-active"
|
|
21893
|
-
}, translator.get('Object.Update.Active')))), /*#__PURE__*/React__default.createElement(Grid, _extends$
|
|
22378
|
+
}, translator.get('Object.Update.Active')))), /*#__PURE__*/React__default.createElement(Grid, _extends$6({
|
|
21894
22379
|
item: true
|
|
21895
22380
|
}, props), /*#__PURE__*/React__default.createElement(Button, {
|
|
21896
22381
|
variant: "contained",
|
|
@@ -21917,7 +22402,7 @@ function Retry(_ref2) {
|
|
|
21917
22402
|
"data-tid": "update-cancelled"
|
|
21918
22403
|
}, translator.get('Object.Update.Cancelled'))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
21919
22404
|
item: true
|
|
21920
|
-
}, /*#__PURE__*/React__default.createElement(Button, _extends$
|
|
22405
|
+
}, /*#__PURE__*/React__default.createElement(Button, _extends$6({
|
|
21921
22406
|
variant: "contained",
|
|
21922
22407
|
onClick: retry
|
|
21923
22408
|
}, props), translator.get('Retry'))));
|
|
@@ -23525,7 +24010,8 @@ function initiate(component) {
|
|
|
23525
24010
|
},
|
|
23526
24011
|
accessibility: {
|
|
23527
24012
|
setter: null
|
|
23528
|
-
}
|
|
24013
|
+
},
|
|
24014
|
+
contraintsWarning: true
|
|
23529
24015
|
};
|
|
23530
24016
|
}
|
|
23531
24017
|
function teardown(component) {
|
|
@@ -24345,8 +24831,11 @@ function useAction(fn, deps) {
|
|
|
24345
24831
|
*/
|
|
24346
24832
|
function useConstraints() {
|
|
24347
24833
|
{
|
|
24348
|
-
|
|
24349
|
-
|
|
24834
|
+
if (currentComponent.__hooks.contraintsWarning) {
|
|
24835
|
+
// eslint-disable-next-line no-console
|
|
24836
|
+
console.warn('useContraints has been deprecated, please change to useInteractions instead. Note that interactions uses inverted values compared to contraints.');
|
|
24837
|
+
currentComponent.__hooks.contraintsWarning = false;
|
|
24838
|
+
}
|
|
24350
24839
|
}
|
|
24351
24840
|
return useInternalContext('constraints');
|
|
24352
24841
|
}
|
|
@@ -27174,8 +27663,11 @@ var debug_1 = debug$1;
|
|
|
27174
27663
|
|
|
27175
27664
|
// Coercion.
|
|
27176
27665
|
// Extract anything that could conceivably be a part of a valid semver
|
|
27177
|
-
createToken('
|
|
27666
|
+
createToken('COERCEPLAIN', "".concat('(^|[^\\d])' + '(\\d{1,').concat(MAX_SAFE_COMPONENT_LENGTH, "})") + "(?:\\.(\\d{1,".concat(MAX_SAFE_COMPONENT_LENGTH, "}))?") + "(?:\\.(\\d{1,".concat(MAX_SAFE_COMPONENT_LENGTH, "}))?"));
|
|
27667
|
+
createToken('COERCE', "".concat(src[t.COERCEPLAIN], "(?:$|[^\\d])"));
|
|
27668
|
+
createToken('COERCEFULL', src[t.COERCEPLAIN] + "(?:".concat(src[t.PRERELEASE], ")?") + "(?:".concat(src[t.BUILD], ")?") + "(?:$|[^\\d])");
|
|
27178
27669
|
createToken('COERCERTL', src[t.COERCE], true);
|
|
27670
|
+
createToken('COERCERTLFULL', src[t.COERCEFULL], true);
|
|
27179
27671
|
|
|
27180
27672
|
// Tilde ranges.
|
|
27181
27673
|
// Meaning is "reasonably at or greater than"
|
|
@@ -28469,6 +28961,9 @@ const DEFAULT_CONFIG = {
|
|
|
28469
28961
|
types: [],
|
|
28470
28962
|
themes: [],
|
|
28471
28963
|
anything: {},
|
|
28964
|
+
flags: {
|
|
28965
|
+
KPI_REACTCOLORPICKER: true
|
|
28966
|
+
},
|
|
28472
28967
|
snapshot: DEFAULT_SNAPSHOT_CONFIG
|
|
28473
28968
|
};
|
|
28474
28969
|
|