@redsift/table 11.6.0-muiv5-alpha.10 → 11.6.0-muiv5-alpha.11
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/_virtual/_internal/_commonjsHelpers.js +6 -0
- package/_virtual/_internal/_commonjsHelpers.js.map +1 -0
- package/{_internal → _virtual/_internal}/_rollupPluginBabelHelpers.js +1 -1
- package/_virtual/_internal/jsx-runtime.js +4 -0
- package/_virtual/_internal/jsx-runtime.js.map +1 -0
- package/_virtual/_internal/react-is.development.js +4 -0
- package/_virtual/_internal/react-is.development.js.map +1 -0
- package/_virtual/_internal/react-is.development2.js +4 -0
- package/_virtual/_internal/react-is.development2.js.map +1 -0
- package/_virtual/_internal/react-is.production.min.js +4 -0
- package/_virtual/_internal/react-is.production.min.js.map +1 -0
- package/_virtual/_internal/react-is.production.min2.js +4 -0
- package/_virtual/_internal/react-is.production.min2.js.map +1 -0
- package/_virtual/_internal/react-jsx-runtime.development.js +4 -0
- package/_virtual/_internal/react-jsx-runtime.development.js.map +1 -0
- package/_virtual/_internal/react-jsx-runtime.production.min.js +4 -0
- package/_virtual/_internal/react-jsx-runtime.production.min.js.map +1 -0
- package/_virtual/index.js +4 -0
- package/_virtual/index.js.map +1 -0
- package/_virtual/index2.js +4 -0
- package/_virtual/index2.js.map +1 -0
- package/_virtual/index3.js +4 -0
- package/_virtual/index3.js.map +1 -0
- package/package.json +2 -2
- package/packages/design-system/src/components/theme/_internal/context.js +7 -0
- package/packages/design-system/src/components/theme/_internal/context.js.map +1 -0
- package/packages/popovers/src/components/tooltip/_internal/Tooltip.js +60 -0
- package/packages/popovers/src/components/tooltip/_internal/Tooltip.js.map +1 -0
- package/packages/popovers/src/components/tooltip/_internal/context.js +6 -0
- package/packages/popovers/src/components/tooltip/_internal/context.js.map +1 -0
- package/packages/popovers/src/components/tooltip/_internal/types.js +28 -0
- package/packages/popovers/src/components/tooltip/_internal/types.js.map +1 -0
- package/packages/popovers/src/components/tooltip/_internal/useTooltip.js +78 -0
- package/packages/popovers/src/components/tooltip/_internal/useTooltip.js.map +1 -0
- package/packages/popovers/src/components/tooltip/_internal/useTooltipContext.js +13 -0
- package/packages/popovers/src/components/tooltip/_internal/useTooltipContext.js.map +1 -0
- package/packages/popovers/src/components/tooltip-content/_internal/TooltipContent.js +79 -0
- package/packages/popovers/src/components/tooltip-content/_internal/TooltipContent.js.map +1 -0
- package/packages/popovers/src/components/tooltip-content/_internal/styles.js +127 -0
- package/packages/popovers/src/components/tooltip-content/_internal/styles.js.map +1 -0
- package/packages/popovers/src/components/tooltip-trigger/_internal/TooltipTrigger.js +47 -0
- package/packages/popovers/src/components/tooltip-trigger/_internal/TooltipTrigger.js.map +1 -0
- package/packages/table/src/components/BaseComponents/_internal/BaseButton.js +41 -0
- package/packages/table/src/components/BaseComponents/_internal/BaseButton.js.map +1 -0
- package/packages/table/src/components/BaseComponents/_internal/BaseCheckbox.js +24 -0
- package/packages/table/src/components/BaseComponents/_internal/BaseCheckbox.js.map +1 -0
- package/packages/table/src/components/BaseComponents/_internal/BaseComponents.js +6 -0
- package/{_internal → packages/table/src/components/BaseComponents/_internal}/BaseComponents.js.map +1 -1
- package/packages/table/src/components/BaseComponents/_internal/BaseIcon.js +33 -0
- package/packages/table/src/components/BaseComponents/_internal/BaseIcon.js.map +1 -0
- package/packages/table/src/components/BaseComponents/_internal/BasePopper.js +13 -0
- package/packages/table/src/components/BaseComponents/_internal/BasePopper.js.map +1 -0
- package/{_internal → packages/table/src/components/BaseComponents/_internal}/BaseTextField.js +1 -1
- package/packages/table/src/components/BaseComponents/_internal/BaseTextField.js.map +1 -0
- package/packages/table/src/components/DataGrid/_internal/DataGrid.js +2 -0
- package/{_internal → packages/table/src/components/DataGrid/_internal}/DataGrid2.js +16 -8
- package/packages/table/src/components/DataGrid/_internal/DataGrid2.js.map +1 -0
- package/packages/table/src/components/DataGrid/_internal/styles.js +74 -0
- package/packages/table/src/components/DataGrid/_internal/styles.js.map +1 -0
- package/packages/table/src/components/GridToolbarFilterSemanticField/_internal/GridToolbarFilterSemanticField.js +2 -0
- package/packages/table/src/components/GridToolbarFilterSemanticField/_internal/GridToolbarFilterSemanticField2.js +183 -0
- package/packages/table/src/components/GridToolbarFilterSemanticField/_internal/GridToolbarFilterSemanticField2.js.map +1 -0
- package/packages/table/src/components/GridToolbarFilterSemanticField/_internal/styles.js +20 -0
- package/packages/table/src/components/GridToolbarFilterSemanticField/_internal/styles.js.map +1 -0
- package/packages/table/src/components/Pagination/_internal/ControlledPagination.js +74 -0
- package/packages/table/src/components/Pagination/_internal/ControlledPagination.js.map +1 -0
- package/packages/table/src/components/Pagination/_internal/Pagination.js +3 -0
- package/{_internal → packages/table/src/components/Pagination/_internal}/Pagination.js.map +1 -1
- package/packages/table/src/components/Pagination/_internal/ServerSideControlledPagination.js +102 -0
- package/packages/table/src/components/Pagination/_internal/ServerSideControlledPagination.js.map +1 -0
- package/packages/table/src/components/StatefulDataGrid/_internal/StatefulDataGrid.js +2 -0
- package/packages/table/src/components/StatefulDataGrid/_internal/StatefulDataGrid2.js +373 -0
- package/packages/table/src/components/StatefulDataGrid/_internal/StatefulDataGrid2.js.map +1 -0
- package/packages/table/src/components/TextCell/_internal/TextCell.js +2 -0
- package/{_internal → packages/table/src/components/TextCell/_internal}/TextCell2.js +3 -21
- package/packages/table/src/components/TextCell/_internal/TextCell2.js.map +1 -0
- package/packages/table/src/components/TextCell/_internal/styles.js +22 -0
- package/packages/table/src/components/TextCell/_internal/styles.js.map +1 -0
- package/packages/table/src/components/Toolbar/_internal/Toolbar.js +2 -0
- package/{_internal → packages/table/src/components/Toolbar/_internal}/Toolbar2.js +4 -17
- package/packages/table/src/components/Toolbar/_internal/Toolbar2.js.map +1 -0
- package/packages/table/src/components/Toolbar/_internal/styles.js +17 -0
- package/packages/table/src/components/Toolbar/_internal/styles.js.map +1 -0
- package/packages/table/src/components/ToolbarWrapper/_internal/ToolbarWrapper.js +2 -0
- package/{_internal → packages/table/src/components/ToolbarWrapper/_internal}/ToolbarWrapper2.js +4 -3
- package/packages/table/src/components/ToolbarWrapper/_internal/ToolbarWrapper2.js.map +1 -0
- package/packages/table/src/hooks/_internal/useControlledDatagridState.js +109 -0
- package/packages/table/src/hooks/_internal/useControlledDatagridState.js.map +1 -0
- package/packages/table/src/hooks/_internal/useFetchState.js +34 -0
- package/packages/table/src/hooks/_internal/useFetchState.js.map +1 -0
- package/packages/table/src/hooks/_internal/useStatefulTable.js +182 -0
- package/packages/table/src/hooks/_internal/useStatefulTable.js.map +1 -0
- package/packages/table/src/hooks/_internal/useTableStates.js +52 -0
- package/packages/table/src/hooks/_internal/useTableStates.js.map +1 -0
- package/packages/table/src/index.js +38 -0
- package/packages/table/src/index.js.map +1 -0
- package/packages/table/src/utils/_internal/gpt.js +33 -0
- package/packages/table/src/utils/_internal/gpt.js.map +1 -0
- package/packages/table/src/utils/_internal/localStorage.js +59 -0
- package/packages/table/src/utils/_internal/localStorage.js.map +1 -0
- package/{_internal/StatefulDataGrid2.js → packages/table/src/utils/_internal/urlLocalStorageSync.js} +5 -671
- package/packages/table/src/utils/_internal/urlLocalStorageSync.js.map +1 -0
- package/packages/table/src/utils/columnTypes/index.js +49 -0
- package/packages/table/src/utils/columnTypes/index.js.map +1 -0
- package/packages/table/src/utils/columns/_internal/detailPanelToggleColDef.js +8 -0
- package/packages/table/src/utils/columns/_internal/detailPanelToggleColDef.js.map +1 -0
- package/packages/table/src/utils/fields/_internal/InputNumberInterval.js +85 -0
- package/packages/table/src/utils/fields/_internal/InputNumberInterval.js.map +1 -0
- package/packages/table/src/utils/operators/index.js +52 -0
- package/packages/table/src/utils/operators/index.js.map +1 -0
- package/packages/table/src/utils/operators/numeric/_internal/getGridNumericOperators.js +7 -0
- package/packages/table/src/utils/operators/numeric/_internal/getGridNumericOperators.js.map +1 -0
- package/packages/table/src/utils/operators/numeric/_internal/isBetween.js +28 -0
- package/packages/table/src/utils/operators/numeric/_internal/isBetween.js.map +1 -0
- package/packages/table/src/utils/operators/string/_internal/doesNotContain.js +25 -0
- package/packages/table/src/utils/operators/string/_internal/doesNotContain.js.map +1 -0
- package/packages/table/src/utils/operators/string/_internal/doesNotEqual.js +25 -0
- package/packages/table/src/utils/operators/string/_internal/doesNotEqual.js.map +1 -0
- package/packages/table/src/utils/operators/string/_internal/doesNotHave.js +24 -0
- package/packages/table/src/utils/operators/string/_internal/doesNotHave.js.map +1 -0
- package/packages/table/src/utils/operators/string/_internal/getGridStringOperators.js +9 -0
- package/packages/table/src/utils/operators/string/_internal/getGridStringOperators.js.map +1 -0
- package/packages/table/src/utils/operators/string/_internal/has.js +24 -0
- package/packages/table/src/utils/operators/string/_internal/has.js.map +1 -0
- package/packages/table/src/utils/operators/string/_internal/hasOnly.js +24 -0
- package/packages/table/src/utils/operators/string/_internal/hasOnly.js.map +1 -0
- package/packages/table/src/utils/operators/string/_internal/is.js +26 -0
- package/packages/table/src/utils/operators/string/_internal/is.js.map +1 -0
- package/packages/table/src/utils/operators/string/_internal/isNot.js +26 -0
- package/packages/table/src/utils/operators/string/_internal/isNot.js.map +1 -0
- package/packages/table/src/utils/operators/string-array/_internal/containsAnyOf.js +56 -0
- package/packages/table/src/utils/operators/string-array/_internal/containsAnyOf.js.map +1 -0
- package/packages/table/src/utils/operators/string-array/_internal/doesNotHaveAnyOf.js +26 -0
- package/packages/table/src/utils/operators/string-array/_internal/doesNotHaveAnyOf.js.map +1 -0
- package/packages/table/src/utils/operators/string-array/_internal/endsWithAnyOf.js +31 -0
- package/packages/table/src/utils/operators/string-array/_internal/endsWithAnyOf.js.map +1 -0
- package/packages/table/src/utils/operators/string-array/_internal/getGridStringArrayOperators.js +19 -0
- package/packages/table/src/utils/operators/string-array/_internal/getGridStringArrayOperators.js.map +1 -0
- package/packages/table/src/utils/operators/string-array/_internal/hasAnyOf.js +28 -0
- package/packages/table/src/utils/operators/string-array/_internal/hasAnyOf.js.map +1 -0
- package/packages/table/src/utils/operators/string-array/_internal/isAnyOf.js +32 -0
- package/packages/table/src/utils/operators/string-array/_internal/isAnyOf.js.map +1 -0
- package/packages/table/src/utils/operators/string-array/_internal/isNotAnyOf.js +28 -0
- package/packages/table/src/utils/operators/string-array/_internal/isNotAnyOf.js.map +1 -0
- package/packages/table/src/utils/operators/string-array/_internal/startsWithAnyOf.js +31 -0
- package/packages/table/src/utils/operators/string-array/_internal/startsWithAnyOf.js.map +1 -0
- package/_internal/BaseComponents.js +0 -3
- package/_internal/BasePopper.js +0 -2448
- package/_internal/BasePopper.js.map +0 -1
- package/_internal/BaseTextField.js.map +0 -1
- package/_internal/ControlledPagination.js +0 -10484
- package/_internal/ControlledPagination.js.map +0 -1
- package/_internal/DataGrid.js +0 -2
- package/_internal/DataGrid2.js.map +0 -1
- package/_internal/GridToolbarFilterSemanticField.js +0 -2
- package/_internal/GridToolbarFilterSemanticField2.js +0 -5581
- package/_internal/GridToolbarFilterSemanticField2.js.map +0 -1
- package/_internal/Pagination.js +0 -2
- package/_internal/Portal.js +0 -4363
- package/_internal/Portal.js.map +0 -1
- package/_internal/StatefulDataGrid.js +0 -2
- package/_internal/StatefulDataGrid2.js.map +0 -1
- package/_internal/TextCell.js +0 -2
- package/_internal/TextCell2.js.map +0 -1
- package/_internal/Toolbar.js +0 -2
- package/_internal/Toolbar2.js.map +0 -1
- package/_internal/ToolbarWrapper.js +0 -2
- package/_internal/ToolbarWrapper2.js.map +0 -1
- package/_internal/jsx-runtime.js +0 -1342
- package/_internal/jsx-runtime.js.map +0 -1
- package/_internal/useControlledDatagridState.js +0 -2175
- package/_internal/useControlledDatagridState.js.map +0 -1
- package/index.js +0 -19
- package/index.js.map +0 -1
- /package/{_internal → _virtual/_internal}/_rollupPluginBabelHelpers.js.map +0 -0
- /package/{_internal → packages/table/src/components/DataGrid/_internal}/DataGrid.js.map +0 -0
- /package/{_internal → packages/table/src/components/GridToolbarFilterSemanticField/_internal}/GridToolbarFilterSemanticField.js.map +0 -0
- /package/{_internal → packages/table/src/components/StatefulDataGrid/_internal}/StatefulDataGrid.js.map +0 -0
- /package/{_internal → packages/table/src/components/TextCell/_internal}/TextCell.js.map +0 -0
- /package/{_internal → packages/table/src/components/Toolbar/_internal}/Toolbar.js.map +0 -0
- /package/{_internal → packages/table/src/components/ToolbarWrapper/_internal}/ToolbarWrapper.js.map +0 -0
package/_internal/Portal.js
DELETED
|
@@ -1,4363 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ThemeContext } from '@emotion/react';
|
|
3
|
-
import emStyled from '@emotion/styled';
|
|
4
|
-
import { j as jsxRuntimeExports } from './jsx-runtime.js';
|
|
5
|
-
import * as ReactDOM from 'react-dom';
|
|
6
|
-
|
|
7
|
-
function chainPropTypes(propType1, propType2) {
|
|
8
|
-
if (process.env.NODE_ENV === 'production') {
|
|
9
|
-
return () => null;
|
|
10
|
-
}
|
|
11
|
-
return function validate(...args) {
|
|
12
|
-
return propType1(...args) || propType2(...args);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function isPlainObject(item) {
|
|
17
|
-
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
18
|
-
}
|
|
19
|
-
function deepClone(source) {
|
|
20
|
-
if (!isPlainObject(source)) {
|
|
21
|
-
return source;
|
|
22
|
-
}
|
|
23
|
-
const output = {};
|
|
24
|
-
Object.keys(source).forEach(key => {
|
|
25
|
-
output[key] = deepClone(source[key]);
|
|
26
|
-
});
|
|
27
|
-
return output;
|
|
28
|
-
}
|
|
29
|
-
function deepmerge(target, source, options = {
|
|
30
|
-
clone: true
|
|
31
|
-
}) {
|
|
32
|
-
const output = options.clone ? {
|
|
33
|
-
...target
|
|
34
|
-
} : target;
|
|
35
|
-
if (isPlainObject(target) && isPlainObject(source)) {
|
|
36
|
-
Object.keys(source).forEach(key => {
|
|
37
|
-
// Avoid prototype pollution
|
|
38
|
-
if (key === '__proto__') {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
|
42
|
-
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
|
43
|
-
output[key] = deepmerge(target[key], source[key], options);
|
|
44
|
-
} else if (options.clone) {
|
|
45
|
-
output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];
|
|
46
|
-
} else {
|
|
47
|
-
output[key] = source[key];
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return output;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function getDefaultExportFromCjs (x) {
|
|
55
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
var propTypes = {exports: {}};
|
|
59
|
-
|
|
60
|
-
var reactIs$1 = {exports: {}};
|
|
61
|
-
|
|
62
|
-
var reactIs_production_min$1 = {};
|
|
63
|
-
|
|
64
|
-
/** @license React v16.13.1
|
|
65
|
-
* react-is.production.min.js
|
|
66
|
-
*
|
|
67
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the MIT license found in the
|
|
70
|
-
* LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/
|
|
72
|
-
var b$1="function"===typeof Symbol&&Symbol.for,c$1=b$1?Symbol.for("react.element"):60103,d$1=b$1?Symbol.for("react.portal"):60106,e$1=b$1?Symbol.for("react.fragment"):60107,f$1=b$1?Symbol.for("react.strict_mode"):60108,g$1=b$1?Symbol.for("react.profiler"):60114,h$1=b$1?Symbol.for("react.provider"):60109,k$1=b$1?Symbol.for("react.context"):60110,l$1=b$1?Symbol.for("react.async_mode"):60111,m$1=b$1?Symbol.for("react.concurrent_mode"):60111,n$1=b$1?Symbol.for("react.forward_ref"):60112,p$1=b$1?Symbol.for("react.suspense"):60113,q$1=b$1?
|
|
73
|
-
Symbol.for("react.suspense_list"):60120,r$1=b$1?Symbol.for("react.memo"):60115,t$1=b$1?Symbol.for("react.lazy"):60116,v$1=b$1?Symbol.for("react.block"):60121,w=b$1?Symbol.for("react.fundamental"):60117,x=b$1?Symbol.for("react.responder"):60118,y=b$1?Symbol.for("react.scope"):60119;
|
|
74
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$1:switch(a=a.type,a){case l$1:case m$1:case e$1:case g$1:case f$1:case p$1:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n$1:case t$1:case r$1:case h$1:return a;default:return u}}case d$1:return u}}}function A(a){return z(a)===m$1}reactIs_production_min$1.AsyncMode=l$1;reactIs_production_min$1.ConcurrentMode=m$1;reactIs_production_min$1.ContextConsumer=k$1;reactIs_production_min$1.ContextProvider=h$1;reactIs_production_min$1.Element=c$1;reactIs_production_min$1.ForwardRef=n$1;reactIs_production_min$1.Fragment=e$1;reactIs_production_min$1.Lazy=t$1;reactIs_production_min$1.Memo=r$1;reactIs_production_min$1.Portal=d$1;
|
|
75
|
-
reactIs_production_min$1.Profiler=g$1;reactIs_production_min$1.StrictMode=f$1;reactIs_production_min$1.Suspense=p$1;reactIs_production_min$1.isAsyncMode=function(a){return A(a)||z(a)===l$1};reactIs_production_min$1.isConcurrentMode=A;reactIs_production_min$1.isContextConsumer=function(a){return z(a)===k$1};reactIs_production_min$1.isContextProvider=function(a){return z(a)===h$1};reactIs_production_min$1.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$1};reactIs_production_min$1.isForwardRef=function(a){return z(a)===n$1};reactIs_production_min$1.isFragment=function(a){return z(a)===e$1};reactIs_production_min$1.isLazy=function(a){return z(a)===t$1};
|
|
76
|
-
reactIs_production_min$1.isMemo=function(a){return z(a)===r$1};reactIs_production_min$1.isPortal=function(a){return z(a)===d$1};reactIs_production_min$1.isProfiler=function(a){return z(a)===g$1};reactIs_production_min$1.isStrictMode=function(a){return z(a)===f$1};reactIs_production_min$1.isSuspense=function(a){return z(a)===p$1};
|
|
77
|
-
reactIs_production_min$1.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$1||a===m$1||a===g$1||a===f$1||a===p$1||a===q$1||"object"===typeof a&&null!==a&&(a.$$typeof===t$1||a.$$typeof===r$1||a.$$typeof===h$1||a.$$typeof===k$1||a.$$typeof===n$1||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v$1)};reactIs_production_min$1.typeOf=z;
|
|
78
|
-
|
|
79
|
-
var reactIs_development$1 = {};
|
|
80
|
-
|
|
81
|
-
/** @license React v16.13.1
|
|
82
|
-
* react-is.development.js
|
|
83
|
-
*
|
|
84
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
85
|
-
*
|
|
86
|
-
* This source code is licensed under the MIT license found in the
|
|
87
|
-
* LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (process.env.NODE_ENV !== "production") {
|
|
93
|
-
(function() {
|
|
94
|
-
|
|
95
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
96
|
-
// nor polyfill, then a plain number is used for performance.
|
|
97
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
98
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
99
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
100
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
101
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
102
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
103
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
104
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
105
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
106
|
-
|
|
107
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
108
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
109
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
110
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
111
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
112
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
113
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
114
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
115
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
116
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
117
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
118
|
-
|
|
119
|
-
function isValidElementType(type) {
|
|
120
|
-
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
121
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function typeOf(object) {
|
|
125
|
-
if (typeof object === 'object' && object !== null) {
|
|
126
|
-
var $$typeof = object.$$typeof;
|
|
127
|
-
|
|
128
|
-
switch ($$typeof) {
|
|
129
|
-
case REACT_ELEMENT_TYPE:
|
|
130
|
-
var type = object.type;
|
|
131
|
-
|
|
132
|
-
switch (type) {
|
|
133
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
134
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
135
|
-
case REACT_FRAGMENT_TYPE:
|
|
136
|
-
case REACT_PROFILER_TYPE:
|
|
137
|
-
case REACT_STRICT_MODE_TYPE:
|
|
138
|
-
case REACT_SUSPENSE_TYPE:
|
|
139
|
-
return type;
|
|
140
|
-
|
|
141
|
-
default:
|
|
142
|
-
var $$typeofType = type && type.$$typeof;
|
|
143
|
-
|
|
144
|
-
switch ($$typeofType) {
|
|
145
|
-
case REACT_CONTEXT_TYPE:
|
|
146
|
-
case REACT_FORWARD_REF_TYPE:
|
|
147
|
-
case REACT_LAZY_TYPE:
|
|
148
|
-
case REACT_MEMO_TYPE:
|
|
149
|
-
case REACT_PROVIDER_TYPE:
|
|
150
|
-
return $$typeofType;
|
|
151
|
-
|
|
152
|
-
default:
|
|
153
|
-
return $$typeof;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
case REACT_PORTAL_TYPE:
|
|
159
|
-
return $$typeof;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return undefined;
|
|
164
|
-
} // AsyncMode is deprecated along with isAsyncMode
|
|
165
|
-
|
|
166
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
167
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
168
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
169
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
170
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
171
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
172
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
173
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
174
|
-
var Memo = REACT_MEMO_TYPE;
|
|
175
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
176
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
177
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
178
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
179
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
180
|
-
|
|
181
|
-
function isAsyncMode(object) {
|
|
182
|
-
{
|
|
183
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
184
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
185
|
-
|
|
186
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
191
|
-
}
|
|
192
|
-
function isConcurrentMode(object) {
|
|
193
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
194
|
-
}
|
|
195
|
-
function isContextConsumer(object) {
|
|
196
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
197
|
-
}
|
|
198
|
-
function isContextProvider(object) {
|
|
199
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
200
|
-
}
|
|
201
|
-
function isElement(object) {
|
|
202
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
203
|
-
}
|
|
204
|
-
function isForwardRef(object) {
|
|
205
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
206
|
-
}
|
|
207
|
-
function isFragment(object) {
|
|
208
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
209
|
-
}
|
|
210
|
-
function isLazy(object) {
|
|
211
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
212
|
-
}
|
|
213
|
-
function isMemo(object) {
|
|
214
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
215
|
-
}
|
|
216
|
-
function isPortal(object) {
|
|
217
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
218
|
-
}
|
|
219
|
-
function isProfiler(object) {
|
|
220
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
221
|
-
}
|
|
222
|
-
function isStrictMode(object) {
|
|
223
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
224
|
-
}
|
|
225
|
-
function isSuspense(object) {
|
|
226
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
reactIs_development$1.AsyncMode = AsyncMode;
|
|
230
|
-
reactIs_development$1.ConcurrentMode = ConcurrentMode;
|
|
231
|
-
reactIs_development$1.ContextConsumer = ContextConsumer;
|
|
232
|
-
reactIs_development$1.ContextProvider = ContextProvider;
|
|
233
|
-
reactIs_development$1.Element = Element;
|
|
234
|
-
reactIs_development$1.ForwardRef = ForwardRef;
|
|
235
|
-
reactIs_development$1.Fragment = Fragment;
|
|
236
|
-
reactIs_development$1.Lazy = Lazy;
|
|
237
|
-
reactIs_development$1.Memo = Memo;
|
|
238
|
-
reactIs_development$1.Portal = Portal;
|
|
239
|
-
reactIs_development$1.Profiler = Profiler;
|
|
240
|
-
reactIs_development$1.StrictMode = StrictMode;
|
|
241
|
-
reactIs_development$1.Suspense = Suspense;
|
|
242
|
-
reactIs_development$1.isAsyncMode = isAsyncMode;
|
|
243
|
-
reactIs_development$1.isConcurrentMode = isConcurrentMode;
|
|
244
|
-
reactIs_development$1.isContextConsumer = isContextConsumer;
|
|
245
|
-
reactIs_development$1.isContextProvider = isContextProvider;
|
|
246
|
-
reactIs_development$1.isElement = isElement;
|
|
247
|
-
reactIs_development$1.isForwardRef = isForwardRef;
|
|
248
|
-
reactIs_development$1.isFragment = isFragment;
|
|
249
|
-
reactIs_development$1.isLazy = isLazy;
|
|
250
|
-
reactIs_development$1.isMemo = isMemo;
|
|
251
|
-
reactIs_development$1.isPortal = isPortal;
|
|
252
|
-
reactIs_development$1.isProfiler = isProfiler;
|
|
253
|
-
reactIs_development$1.isStrictMode = isStrictMode;
|
|
254
|
-
reactIs_development$1.isSuspense = isSuspense;
|
|
255
|
-
reactIs_development$1.isValidElementType = isValidElementType;
|
|
256
|
-
reactIs_development$1.typeOf = typeOf;
|
|
257
|
-
})();
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (process.env.NODE_ENV === 'production') {
|
|
261
|
-
reactIs$1.exports = reactIs_production_min$1;
|
|
262
|
-
} else {
|
|
263
|
-
reactIs$1.exports = reactIs_development$1;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
var reactIsExports$1 = reactIs$1.exports;
|
|
267
|
-
|
|
268
|
-
/*
|
|
269
|
-
object-assign
|
|
270
|
-
(c) Sindre Sorhus
|
|
271
|
-
@license MIT
|
|
272
|
-
*/
|
|
273
|
-
/* eslint-disable no-unused-vars */
|
|
274
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
275
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
276
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
277
|
-
|
|
278
|
-
function toObject(val) {
|
|
279
|
-
if (val === null || val === undefined) {
|
|
280
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
return Object(val);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
function shouldUseNative() {
|
|
287
|
-
try {
|
|
288
|
-
if (!Object.assign) {
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// Detect buggy property enumeration order in older V8 versions.
|
|
293
|
-
|
|
294
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
295
|
-
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
296
|
-
test1[5] = 'de';
|
|
297
|
-
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
298
|
-
return false;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
302
|
-
var test2 = {};
|
|
303
|
-
for (var i = 0; i < 10; i++) {
|
|
304
|
-
test2['_' + String.fromCharCode(i)] = i;
|
|
305
|
-
}
|
|
306
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
307
|
-
return test2[n];
|
|
308
|
-
});
|
|
309
|
-
if (order2.join('') !== '0123456789') {
|
|
310
|
-
return false;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
314
|
-
var test3 = {};
|
|
315
|
-
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
316
|
-
test3[letter] = letter;
|
|
317
|
-
});
|
|
318
|
-
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
319
|
-
'abcdefghijklmnopqrst') {
|
|
320
|
-
return false;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
return true;
|
|
324
|
-
} catch (err) {
|
|
325
|
-
// We don't expect any of the above to throw, but better to be safe.
|
|
326
|
-
return false;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
331
|
-
var from;
|
|
332
|
-
var to = toObject(target);
|
|
333
|
-
var symbols;
|
|
334
|
-
|
|
335
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
336
|
-
from = Object(arguments[s]);
|
|
337
|
-
|
|
338
|
-
for (var key in from) {
|
|
339
|
-
if (hasOwnProperty.call(from, key)) {
|
|
340
|
-
to[key] = from[key];
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
if (getOwnPropertySymbols) {
|
|
345
|
-
symbols = getOwnPropertySymbols(from);
|
|
346
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
347
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
348
|
-
to[symbols[i]] = from[symbols[i]];
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return to;
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
359
|
-
*
|
|
360
|
-
* This source code is licensed under the MIT license found in the
|
|
361
|
-
* LICENSE file in the root directory of this source tree.
|
|
362
|
-
*/
|
|
363
|
-
|
|
364
|
-
var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
365
|
-
|
|
366
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
367
|
-
|
|
368
|
-
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the MIT license found in the
|
|
374
|
-
* LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/
|
|
376
|
-
|
|
377
|
-
var printWarning$1 = function() {};
|
|
378
|
-
|
|
379
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
380
|
-
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
|
|
381
|
-
var loggedTypeFailures = {};
|
|
382
|
-
var has$1 = has$2;
|
|
383
|
-
|
|
384
|
-
printWarning$1 = function(text) {
|
|
385
|
-
var message = 'Warning: ' + text;
|
|
386
|
-
if (typeof console !== 'undefined') {
|
|
387
|
-
console.error(message);
|
|
388
|
-
}
|
|
389
|
-
try {
|
|
390
|
-
// --- Welcome to debugging React ---
|
|
391
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
392
|
-
// to find the callsite that caused this warning to fire.
|
|
393
|
-
throw new Error(message);
|
|
394
|
-
} catch (x) { /**/ }
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Assert that the values match with the type specs.
|
|
400
|
-
* Error messages are memorized and will only be shown once.
|
|
401
|
-
*
|
|
402
|
-
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
403
|
-
* @param {object} values Runtime values that need to be type-checked
|
|
404
|
-
* @param {string} location e.g. "prop", "context", "child context"
|
|
405
|
-
* @param {string} componentName Name of the component for error messages.
|
|
406
|
-
* @param {?Function} getStack Returns the component stack.
|
|
407
|
-
* @private
|
|
408
|
-
*/
|
|
409
|
-
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
|
|
410
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
411
|
-
for (var typeSpecName in typeSpecs) {
|
|
412
|
-
if (has$1(typeSpecs, typeSpecName)) {
|
|
413
|
-
var error;
|
|
414
|
-
// Prop type validation may throw. In case they do, we don't want to
|
|
415
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
416
|
-
// After these have been cleaned up, we'll let them throw.
|
|
417
|
-
try {
|
|
418
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
419
|
-
// behavior as without this statement except with a better message.
|
|
420
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
421
|
-
var err = Error(
|
|
422
|
-
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
423
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
424
|
-
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
425
|
-
);
|
|
426
|
-
err.name = 'Invariant Violation';
|
|
427
|
-
throw err;
|
|
428
|
-
}
|
|
429
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
|
|
430
|
-
} catch (ex) {
|
|
431
|
-
error = ex;
|
|
432
|
-
}
|
|
433
|
-
if (error && !(error instanceof Error)) {
|
|
434
|
-
printWarning$1(
|
|
435
|
-
(componentName || 'React class') + ': type specification of ' +
|
|
436
|
-
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
437
|
-
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
438
|
-
'You may have forgotten to pass an argument to the type checker ' +
|
|
439
|
-
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
440
|
-
'shape all require an argument).'
|
|
441
|
-
);
|
|
442
|
-
}
|
|
443
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
444
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
445
|
-
// same error.
|
|
446
|
-
loggedTypeFailures[error.message] = true;
|
|
447
|
-
|
|
448
|
-
var stack = getStack ? getStack() : '';
|
|
449
|
-
|
|
450
|
-
printWarning$1(
|
|
451
|
-
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
/**
|
|
460
|
-
* Resets warning cache when testing.
|
|
461
|
-
*
|
|
462
|
-
* @private
|
|
463
|
-
*/
|
|
464
|
-
checkPropTypes$1.resetWarningCache = function() {
|
|
465
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
466
|
-
loggedTypeFailures = {};
|
|
467
|
-
}
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
var checkPropTypes_1 = checkPropTypes$1;
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
474
|
-
*
|
|
475
|
-
* This source code is licensed under the MIT license found in the
|
|
476
|
-
* LICENSE file in the root directory of this source tree.
|
|
477
|
-
*/
|
|
478
|
-
|
|
479
|
-
var ReactIs$1 = reactIsExports$1;
|
|
480
|
-
var assign = objectAssign;
|
|
481
|
-
|
|
482
|
-
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
483
|
-
var has = has$2;
|
|
484
|
-
var checkPropTypes = checkPropTypes_1;
|
|
485
|
-
|
|
486
|
-
var printWarning = function() {};
|
|
487
|
-
|
|
488
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
489
|
-
printWarning = function(text) {
|
|
490
|
-
var message = 'Warning: ' + text;
|
|
491
|
-
if (typeof console !== 'undefined') {
|
|
492
|
-
console.error(message);
|
|
493
|
-
}
|
|
494
|
-
try {
|
|
495
|
-
// --- Welcome to debugging React ---
|
|
496
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
497
|
-
// to find the callsite that caused this warning to fire.
|
|
498
|
-
throw new Error(message);
|
|
499
|
-
} catch (x) {}
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
function emptyFunctionThatReturnsNull() {
|
|
504
|
-
return null;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
508
|
-
/* global Symbol */
|
|
509
|
-
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
510
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* Returns the iterator method function contained on the iterable object.
|
|
514
|
-
*
|
|
515
|
-
* Be sure to invoke the function with the iterable as context:
|
|
516
|
-
*
|
|
517
|
-
* var iteratorFn = getIteratorFn(myIterable);
|
|
518
|
-
* if (iteratorFn) {
|
|
519
|
-
* var iterator = iteratorFn.call(myIterable);
|
|
520
|
-
* ...
|
|
521
|
-
* }
|
|
522
|
-
*
|
|
523
|
-
* @param {?object} maybeIterable
|
|
524
|
-
* @return {?function}
|
|
525
|
-
*/
|
|
526
|
-
function getIteratorFn(maybeIterable) {
|
|
527
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
528
|
-
if (typeof iteratorFn === 'function') {
|
|
529
|
-
return iteratorFn;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
/**
|
|
534
|
-
* Collection of methods that allow declaration and validation of props that are
|
|
535
|
-
* supplied to React components. Example usage:
|
|
536
|
-
*
|
|
537
|
-
* var Props = require('ReactPropTypes');
|
|
538
|
-
* var MyArticle = React.createClass({
|
|
539
|
-
* propTypes: {
|
|
540
|
-
* // An optional string prop named "description".
|
|
541
|
-
* description: Props.string,
|
|
542
|
-
*
|
|
543
|
-
* // A required enum prop named "category".
|
|
544
|
-
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
545
|
-
*
|
|
546
|
-
* // A prop named "dialog" that requires an instance of Dialog.
|
|
547
|
-
* dialog: Props.instanceOf(Dialog).isRequired
|
|
548
|
-
* },
|
|
549
|
-
* render: function() { ... }
|
|
550
|
-
* });
|
|
551
|
-
*
|
|
552
|
-
* A more formal specification of how these methods are used:
|
|
553
|
-
*
|
|
554
|
-
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
555
|
-
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
556
|
-
*
|
|
557
|
-
* Each and every declaration produces a function with the same signature. This
|
|
558
|
-
* allows the creation of custom validation functions. For example:
|
|
559
|
-
*
|
|
560
|
-
* var MyLink = React.createClass({
|
|
561
|
-
* propTypes: {
|
|
562
|
-
* // An optional string or URI prop named "href".
|
|
563
|
-
* href: function(props, propName, componentName) {
|
|
564
|
-
* var propValue = props[propName];
|
|
565
|
-
* if (propValue != null && typeof propValue !== 'string' &&
|
|
566
|
-
* !(propValue instanceof URI)) {
|
|
567
|
-
* return new Error(
|
|
568
|
-
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
569
|
-
* componentName
|
|
570
|
-
* );
|
|
571
|
-
* }
|
|
572
|
-
* }
|
|
573
|
-
* },
|
|
574
|
-
* render: function() {...}
|
|
575
|
-
* });
|
|
576
|
-
*
|
|
577
|
-
* @internal
|
|
578
|
-
*/
|
|
579
|
-
|
|
580
|
-
var ANONYMOUS = '<<anonymous>>';
|
|
581
|
-
|
|
582
|
-
// Important!
|
|
583
|
-
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
584
|
-
var ReactPropTypes = {
|
|
585
|
-
array: createPrimitiveTypeChecker('array'),
|
|
586
|
-
bigint: createPrimitiveTypeChecker('bigint'),
|
|
587
|
-
bool: createPrimitiveTypeChecker('boolean'),
|
|
588
|
-
func: createPrimitiveTypeChecker('function'),
|
|
589
|
-
number: createPrimitiveTypeChecker('number'),
|
|
590
|
-
object: createPrimitiveTypeChecker('object'),
|
|
591
|
-
string: createPrimitiveTypeChecker('string'),
|
|
592
|
-
symbol: createPrimitiveTypeChecker('symbol'),
|
|
593
|
-
|
|
594
|
-
any: createAnyTypeChecker(),
|
|
595
|
-
arrayOf: createArrayOfTypeChecker,
|
|
596
|
-
element: createElementTypeChecker(),
|
|
597
|
-
elementType: createElementTypeTypeChecker(),
|
|
598
|
-
instanceOf: createInstanceTypeChecker,
|
|
599
|
-
node: createNodeChecker(),
|
|
600
|
-
objectOf: createObjectOfTypeChecker,
|
|
601
|
-
oneOf: createEnumTypeChecker,
|
|
602
|
-
oneOfType: createUnionTypeChecker,
|
|
603
|
-
shape: createShapeTypeChecker,
|
|
604
|
-
exact: createStrictShapeTypeChecker,
|
|
605
|
-
};
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
609
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
610
|
-
*/
|
|
611
|
-
/*eslint-disable no-self-compare*/
|
|
612
|
-
function is(x, y) {
|
|
613
|
-
// SameValue algorithm
|
|
614
|
-
if (x === y) {
|
|
615
|
-
// Steps 1-5, 7-10
|
|
616
|
-
// Steps 6.b-6.e: +0 != -0
|
|
617
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
618
|
-
} else {
|
|
619
|
-
// Step 6.a: NaN == NaN
|
|
620
|
-
return x !== x && y !== y;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
/*eslint-enable no-self-compare*/
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* We use an Error-like object for backward compatibility as people may call
|
|
627
|
-
* PropTypes directly and inspect their output. However, we don't use real
|
|
628
|
-
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
629
|
-
* is prohibitively expensive if they are created too often, such as what
|
|
630
|
-
* happens in oneOfType() for any type before the one that matched.
|
|
631
|
-
*/
|
|
632
|
-
function PropTypeError(message, data) {
|
|
633
|
-
this.message = message;
|
|
634
|
-
this.data = data && typeof data === 'object' ? data: {};
|
|
635
|
-
this.stack = '';
|
|
636
|
-
}
|
|
637
|
-
// Make `instanceof Error` still work for returned errors.
|
|
638
|
-
PropTypeError.prototype = Error.prototype;
|
|
639
|
-
|
|
640
|
-
function createChainableTypeChecker(validate) {
|
|
641
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
642
|
-
var manualPropTypeCallCache = {};
|
|
643
|
-
var manualPropTypeWarningCount = 0;
|
|
644
|
-
}
|
|
645
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
646
|
-
componentName = componentName || ANONYMOUS;
|
|
647
|
-
propFullName = propFullName || propName;
|
|
648
|
-
|
|
649
|
-
if (secret !== ReactPropTypesSecret$1) {
|
|
650
|
-
if (throwOnDirectAccess) {
|
|
651
|
-
// New behavior only for users of `prop-types` package
|
|
652
|
-
var err = new Error(
|
|
653
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
654
|
-
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
655
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
656
|
-
);
|
|
657
|
-
err.name = 'Invariant Violation';
|
|
658
|
-
throw err;
|
|
659
|
-
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
660
|
-
// Old behavior for people using React.PropTypes
|
|
661
|
-
var cacheKey = componentName + ':' + propName;
|
|
662
|
-
if (
|
|
663
|
-
!manualPropTypeCallCache[cacheKey] &&
|
|
664
|
-
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
665
|
-
manualPropTypeWarningCount < 3
|
|
666
|
-
) {
|
|
667
|
-
printWarning(
|
|
668
|
-
'You are manually calling a React.PropTypes validation ' +
|
|
669
|
-
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
670
|
-
'and will throw in the standalone `prop-types` package. ' +
|
|
671
|
-
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
672
|
-
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
673
|
-
);
|
|
674
|
-
manualPropTypeCallCache[cacheKey] = true;
|
|
675
|
-
manualPropTypeWarningCount++;
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
if (props[propName] == null) {
|
|
680
|
-
if (isRequired) {
|
|
681
|
-
if (props[propName] === null) {
|
|
682
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
683
|
-
}
|
|
684
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
685
|
-
}
|
|
686
|
-
return null;
|
|
687
|
-
} else {
|
|
688
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
var chainedCheckType = checkType.bind(null, false);
|
|
693
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
694
|
-
|
|
695
|
-
return chainedCheckType;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
function createPrimitiveTypeChecker(expectedType) {
|
|
699
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
700
|
-
var propValue = props[propName];
|
|
701
|
-
var propType = getPropType(propValue);
|
|
702
|
-
if (propType !== expectedType) {
|
|
703
|
-
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
704
|
-
// check, but we can offer a more precise error message here rather than
|
|
705
|
-
// 'of type `object`'.
|
|
706
|
-
var preciseType = getPreciseType(propValue);
|
|
707
|
-
|
|
708
|
-
return new PropTypeError(
|
|
709
|
-
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
710
|
-
{expectedType: expectedType}
|
|
711
|
-
);
|
|
712
|
-
}
|
|
713
|
-
return null;
|
|
714
|
-
}
|
|
715
|
-
return createChainableTypeChecker(validate);
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
function createAnyTypeChecker() {
|
|
719
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
function createArrayOfTypeChecker(typeChecker) {
|
|
723
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
724
|
-
if (typeof typeChecker !== 'function') {
|
|
725
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
726
|
-
}
|
|
727
|
-
var propValue = props[propName];
|
|
728
|
-
if (!Array.isArray(propValue)) {
|
|
729
|
-
var propType = getPropType(propValue);
|
|
730
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
731
|
-
}
|
|
732
|
-
for (var i = 0; i < propValue.length; i++) {
|
|
733
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
|
|
734
|
-
if (error instanceof Error) {
|
|
735
|
-
return error;
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
return null;
|
|
739
|
-
}
|
|
740
|
-
return createChainableTypeChecker(validate);
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
function createElementTypeChecker() {
|
|
744
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
745
|
-
var propValue = props[propName];
|
|
746
|
-
if (!isValidElement(propValue)) {
|
|
747
|
-
var propType = getPropType(propValue);
|
|
748
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
749
|
-
}
|
|
750
|
-
return null;
|
|
751
|
-
}
|
|
752
|
-
return createChainableTypeChecker(validate);
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
function createElementTypeTypeChecker() {
|
|
756
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
757
|
-
var propValue = props[propName];
|
|
758
|
-
if (!ReactIs$1.isValidElementType(propValue)) {
|
|
759
|
-
var propType = getPropType(propValue);
|
|
760
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
761
|
-
}
|
|
762
|
-
return null;
|
|
763
|
-
}
|
|
764
|
-
return createChainableTypeChecker(validate);
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
function createInstanceTypeChecker(expectedClass) {
|
|
768
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
769
|
-
if (!(props[propName] instanceof expectedClass)) {
|
|
770
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
771
|
-
var actualClassName = getClassName(props[propName]);
|
|
772
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
773
|
-
}
|
|
774
|
-
return null;
|
|
775
|
-
}
|
|
776
|
-
return createChainableTypeChecker(validate);
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
function createEnumTypeChecker(expectedValues) {
|
|
780
|
-
if (!Array.isArray(expectedValues)) {
|
|
781
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
782
|
-
if (arguments.length > 1) {
|
|
783
|
-
printWarning(
|
|
784
|
-
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
785
|
-
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
786
|
-
);
|
|
787
|
-
} else {
|
|
788
|
-
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
return emptyFunctionThatReturnsNull;
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
795
|
-
var propValue = props[propName];
|
|
796
|
-
for (var i = 0; i < expectedValues.length; i++) {
|
|
797
|
-
if (is(propValue, expectedValues[i])) {
|
|
798
|
-
return null;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
803
|
-
var type = getPreciseType(value);
|
|
804
|
-
if (type === 'symbol') {
|
|
805
|
-
return String(value);
|
|
806
|
-
}
|
|
807
|
-
return value;
|
|
808
|
-
});
|
|
809
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
810
|
-
}
|
|
811
|
-
return createChainableTypeChecker(validate);
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
function createObjectOfTypeChecker(typeChecker) {
|
|
815
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
816
|
-
if (typeof typeChecker !== 'function') {
|
|
817
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
818
|
-
}
|
|
819
|
-
var propValue = props[propName];
|
|
820
|
-
var propType = getPropType(propValue);
|
|
821
|
-
if (propType !== 'object') {
|
|
822
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
823
|
-
}
|
|
824
|
-
for (var key in propValue) {
|
|
825
|
-
if (has(propValue, key)) {
|
|
826
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
827
|
-
if (error instanceof Error) {
|
|
828
|
-
return error;
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
return null;
|
|
833
|
-
}
|
|
834
|
-
return createChainableTypeChecker(validate);
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
838
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
839
|
-
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
840
|
-
return emptyFunctionThatReturnsNull;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
844
|
-
var checker = arrayOfTypeCheckers[i];
|
|
845
|
-
if (typeof checker !== 'function') {
|
|
846
|
-
printWarning(
|
|
847
|
-
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
848
|
-
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
849
|
-
);
|
|
850
|
-
return emptyFunctionThatReturnsNull;
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
855
|
-
var expectedTypes = [];
|
|
856
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
857
|
-
var checker = arrayOfTypeCheckers[i];
|
|
858
|
-
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
|
|
859
|
-
if (checkerResult == null) {
|
|
860
|
-
return null;
|
|
861
|
-
}
|
|
862
|
-
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
863
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
867
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
868
|
-
}
|
|
869
|
-
return createChainableTypeChecker(validate);
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
function createNodeChecker() {
|
|
873
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
874
|
-
if (!isNode(props[propName])) {
|
|
875
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
876
|
-
}
|
|
877
|
-
return null;
|
|
878
|
-
}
|
|
879
|
-
return createChainableTypeChecker(validate);
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
883
|
-
return new PropTypeError(
|
|
884
|
-
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
885
|
-
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
886
|
-
);
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
function createShapeTypeChecker(shapeTypes) {
|
|
890
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
891
|
-
var propValue = props[propName];
|
|
892
|
-
var propType = getPropType(propValue);
|
|
893
|
-
if (propType !== 'object') {
|
|
894
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
895
|
-
}
|
|
896
|
-
for (var key in shapeTypes) {
|
|
897
|
-
var checker = shapeTypes[key];
|
|
898
|
-
if (typeof checker !== 'function') {
|
|
899
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
900
|
-
}
|
|
901
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
902
|
-
if (error) {
|
|
903
|
-
return error;
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
return null;
|
|
907
|
-
}
|
|
908
|
-
return createChainableTypeChecker(validate);
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
function createStrictShapeTypeChecker(shapeTypes) {
|
|
912
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
913
|
-
var propValue = props[propName];
|
|
914
|
-
var propType = getPropType(propValue);
|
|
915
|
-
if (propType !== 'object') {
|
|
916
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
917
|
-
}
|
|
918
|
-
// We need to check all keys in case some are required but missing from props.
|
|
919
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
920
|
-
for (var key in allKeys) {
|
|
921
|
-
var checker = shapeTypes[key];
|
|
922
|
-
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
923
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
924
|
-
}
|
|
925
|
-
if (!checker) {
|
|
926
|
-
return new PropTypeError(
|
|
927
|
-
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
928
|
-
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
929
|
-
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
930
|
-
);
|
|
931
|
-
}
|
|
932
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
933
|
-
if (error) {
|
|
934
|
-
return error;
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
return null;
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
return createChainableTypeChecker(validate);
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
function isNode(propValue) {
|
|
944
|
-
switch (typeof propValue) {
|
|
945
|
-
case 'number':
|
|
946
|
-
case 'string':
|
|
947
|
-
case 'undefined':
|
|
948
|
-
return true;
|
|
949
|
-
case 'boolean':
|
|
950
|
-
return !propValue;
|
|
951
|
-
case 'object':
|
|
952
|
-
if (Array.isArray(propValue)) {
|
|
953
|
-
return propValue.every(isNode);
|
|
954
|
-
}
|
|
955
|
-
if (propValue === null || isValidElement(propValue)) {
|
|
956
|
-
return true;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
var iteratorFn = getIteratorFn(propValue);
|
|
960
|
-
if (iteratorFn) {
|
|
961
|
-
var iterator = iteratorFn.call(propValue);
|
|
962
|
-
var step;
|
|
963
|
-
if (iteratorFn !== propValue.entries) {
|
|
964
|
-
while (!(step = iterator.next()).done) {
|
|
965
|
-
if (!isNode(step.value)) {
|
|
966
|
-
return false;
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
} else {
|
|
970
|
-
// Iterator will provide entry [k,v] tuples rather than values.
|
|
971
|
-
while (!(step = iterator.next()).done) {
|
|
972
|
-
var entry = step.value;
|
|
973
|
-
if (entry) {
|
|
974
|
-
if (!isNode(entry[1])) {
|
|
975
|
-
return false;
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
} else {
|
|
981
|
-
return false;
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
return true;
|
|
985
|
-
default:
|
|
986
|
-
return false;
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
function isSymbol(propType, propValue) {
|
|
991
|
-
// Native Symbol.
|
|
992
|
-
if (propType === 'symbol') {
|
|
993
|
-
return true;
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
// falsy value can't be a Symbol
|
|
997
|
-
if (!propValue) {
|
|
998
|
-
return false;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
1002
|
-
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
1003
|
-
return true;
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1007
|
-
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1008
|
-
return true;
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
return false;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1015
|
-
function getPropType(propValue) {
|
|
1016
|
-
var propType = typeof propValue;
|
|
1017
|
-
if (Array.isArray(propValue)) {
|
|
1018
|
-
return 'array';
|
|
1019
|
-
}
|
|
1020
|
-
if (propValue instanceof RegExp) {
|
|
1021
|
-
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1022
|
-
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1023
|
-
// passes PropTypes.object.
|
|
1024
|
-
return 'object';
|
|
1025
|
-
}
|
|
1026
|
-
if (isSymbol(propType, propValue)) {
|
|
1027
|
-
return 'symbol';
|
|
1028
|
-
}
|
|
1029
|
-
return propType;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
// This handles more types than `getPropType`. Only used for error messages.
|
|
1033
|
-
// See `createPrimitiveTypeChecker`.
|
|
1034
|
-
function getPreciseType(propValue) {
|
|
1035
|
-
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1036
|
-
return '' + propValue;
|
|
1037
|
-
}
|
|
1038
|
-
var propType = getPropType(propValue);
|
|
1039
|
-
if (propType === 'object') {
|
|
1040
|
-
if (propValue instanceof Date) {
|
|
1041
|
-
return 'date';
|
|
1042
|
-
} else if (propValue instanceof RegExp) {
|
|
1043
|
-
return 'regexp';
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
return propType;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1050
|
-
// For example, "undefined" or "of type array"
|
|
1051
|
-
function getPostfixForTypeWarning(value) {
|
|
1052
|
-
var type = getPreciseType(value);
|
|
1053
|
-
switch (type) {
|
|
1054
|
-
case 'array':
|
|
1055
|
-
case 'object':
|
|
1056
|
-
return 'an ' + type;
|
|
1057
|
-
case 'boolean':
|
|
1058
|
-
case 'date':
|
|
1059
|
-
case 'regexp':
|
|
1060
|
-
return 'a ' + type;
|
|
1061
|
-
default:
|
|
1062
|
-
return type;
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
// Returns class name of the object, if any.
|
|
1067
|
-
function getClassName(propValue) {
|
|
1068
|
-
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1069
|
-
return ANONYMOUS;
|
|
1070
|
-
}
|
|
1071
|
-
return propValue.constructor.name;
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1075
|
-
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
1076
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1077
|
-
|
|
1078
|
-
return ReactPropTypes;
|
|
1079
|
-
};
|
|
1080
|
-
|
|
1081
|
-
/**
|
|
1082
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1083
|
-
*
|
|
1084
|
-
* This source code is licensed under the MIT license found in the
|
|
1085
|
-
* LICENSE file in the root directory of this source tree.
|
|
1086
|
-
*/
|
|
1087
|
-
|
|
1088
|
-
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
1089
|
-
|
|
1090
|
-
function emptyFunction() {}
|
|
1091
|
-
function emptyFunctionWithReset() {}
|
|
1092
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1093
|
-
|
|
1094
|
-
var factoryWithThrowingShims = function() {
|
|
1095
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1096
|
-
if (secret === ReactPropTypesSecret) {
|
|
1097
|
-
// It is still safe when called from React.
|
|
1098
|
-
return;
|
|
1099
|
-
}
|
|
1100
|
-
var err = new Error(
|
|
1101
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1102
|
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
1103
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
1104
|
-
);
|
|
1105
|
-
err.name = 'Invariant Violation';
|
|
1106
|
-
throw err;
|
|
1107
|
-
} shim.isRequired = shim;
|
|
1108
|
-
function getShim() {
|
|
1109
|
-
return shim;
|
|
1110
|
-
} // Important!
|
|
1111
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1112
|
-
var ReactPropTypes = {
|
|
1113
|
-
array: shim,
|
|
1114
|
-
bigint: shim,
|
|
1115
|
-
bool: shim,
|
|
1116
|
-
func: shim,
|
|
1117
|
-
number: shim,
|
|
1118
|
-
object: shim,
|
|
1119
|
-
string: shim,
|
|
1120
|
-
symbol: shim,
|
|
1121
|
-
|
|
1122
|
-
any: shim,
|
|
1123
|
-
arrayOf: getShim,
|
|
1124
|
-
element: shim,
|
|
1125
|
-
elementType: shim,
|
|
1126
|
-
instanceOf: getShim,
|
|
1127
|
-
node: shim,
|
|
1128
|
-
objectOf: getShim,
|
|
1129
|
-
oneOf: getShim,
|
|
1130
|
-
oneOfType: getShim,
|
|
1131
|
-
shape: getShim,
|
|
1132
|
-
exact: getShim,
|
|
1133
|
-
|
|
1134
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
1135
|
-
resetWarningCache: emptyFunction
|
|
1136
|
-
};
|
|
1137
|
-
|
|
1138
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1139
|
-
|
|
1140
|
-
return ReactPropTypes;
|
|
1141
|
-
};
|
|
1142
|
-
|
|
1143
|
-
/**
|
|
1144
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1145
|
-
*
|
|
1146
|
-
* This source code is licensed under the MIT license found in the
|
|
1147
|
-
* LICENSE file in the root directory of this source tree.
|
|
1148
|
-
*/
|
|
1149
|
-
|
|
1150
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1151
|
-
var ReactIs = reactIsExports$1;
|
|
1152
|
-
|
|
1153
|
-
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1154
|
-
// http://fb.me/prop-types-in-prod
|
|
1155
|
-
var throwOnDirectAccess = true;
|
|
1156
|
-
propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
|
1157
|
-
} else {
|
|
1158
|
-
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1159
|
-
// http://fb.me/prop-types-in-prod
|
|
1160
|
-
propTypes.exports = factoryWithThrowingShims();
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
var propTypesExports = propTypes.exports;
|
|
1164
|
-
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
1165
|
-
|
|
1166
|
-
// This module is based on https://github.com/airbnb/prop-types-exact repository.
|
|
1167
|
-
// However, in order to reduce the number of dependencies and to remove some extra safe checks
|
|
1168
|
-
// the module was forked.
|
|
1169
|
-
const specialProperty = 'exact-prop: \u200b';
|
|
1170
|
-
function exactProp(propTypes) {
|
|
1171
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1172
|
-
return propTypes;
|
|
1173
|
-
}
|
|
1174
|
-
return {
|
|
1175
|
-
...propTypes,
|
|
1176
|
-
[specialProperty]: props => {
|
|
1177
|
-
const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
|
|
1178
|
-
if (unsupportedProps.length > 0) {
|
|
1179
|
-
return new Error(`The following props are not supported: ${unsupportedProps.map(prop => `\`${prop}\``).join(', ')}. Please remove them.`);
|
|
1180
|
-
}
|
|
1181
|
-
return null;
|
|
1182
|
-
}
|
|
1183
|
-
};
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
/**
|
|
1187
|
-
* WARNING: Don't import this directly.
|
|
1188
|
-
* Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
|
|
1189
|
-
* @param {number} code
|
|
1190
|
-
*/
|
|
1191
|
-
function formatMuiErrorMessage(code) {
|
|
1192
|
-
// Apply babel-plugin-transform-template-literals in loose mode
|
|
1193
|
-
// loose mode is safe iff we're concatenating primitives
|
|
1194
|
-
// see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose
|
|
1195
|
-
/* eslint-disable prefer-template */
|
|
1196
|
-
let url = 'https://mui.com/production-error/?code=' + code;
|
|
1197
|
-
for (let i = 1; i < arguments.length; i += 1) {
|
|
1198
|
-
// rest params over-transpile for this case
|
|
1199
|
-
// eslint-disable-next-line prefer-rest-params
|
|
1200
|
-
url += '&args[]=' + encodeURIComponent(arguments[i]);
|
|
1201
|
-
}
|
|
1202
|
-
return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';
|
|
1203
|
-
/* eslint-enable prefer-template */
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
var reactIs = {exports: {}};
|
|
1207
|
-
|
|
1208
|
-
var reactIs_production_min = {};
|
|
1209
|
-
|
|
1210
|
-
/**
|
|
1211
|
-
* @license React
|
|
1212
|
-
* react-is.production.min.js
|
|
1213
|
-
*
|
|
1214
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1215
|
-
*
|
|
1216
|
-
* This source code is licensed under the MIT license found in the
|
|
1217
|
-
* LICENSE file in the root directory of this source tree.
|
|
1218
|
-
*/
|
|
1219
|
-
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=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
|
|
1220
|
-
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;
|
|
1221
|
-
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};
|
|
1222
|
-
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};
|
|
1223
|
-
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||"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;
|
|
1224
|
-
|
|
1225
|
-
var reactIs_development = {};
|
|
1226
|
-
|
|
1227
|
-
/**
|
|
1228
|
-
* @license React
|
|
1229
|
-
* react-is.development.js
|
|
1230
|
-
*
|
|
1231
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1232
|
-
*
|
|
1233
|
-
* This source code is licensed under the MIT license found in the
|
|
1234
|
-
* LICENSE file in the root directory of this source tree.
|
|
1235
|
-
*/
|
|
1236
|
-
|
|
1237
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1238
|
-
(function() {
|
|
1239
|
-
|
|
1240
|
-
// ATTENTION
|
|
1241
|
-
// When adding new symbols to this file,
|
|
1242
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
1243
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
1244
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
1245
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
1246
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
1247
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
1248
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
1249
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
1250
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
1251
|
-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
|
1252
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
1253
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
1254
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
1255
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
1256
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
1257
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
1258
|
-
|
|
1259
|
-
// -----------------------------------------------------------------------------
|
|
1260
|
-
|
|
1261
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
1262
|
-
var enableCacheElement = false;
|
|
1263
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
1264
|
-
|
|
1265
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
1266
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
1267
|
-
// issues in DEV builds.
|
|
1268
|
-
|
|
1269
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
1270
|
-
|
|
1271
|
-
var REACT_MODULE_REFERENCE;
|
|
1272
|
-
|
|
1273
|
-
{
|
|
1274
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
function isValidElementType(type) {
|
|
1278
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
1279
|
-
return true;
|
|
1280
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
|
1284
|
-
return true;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
if (typeof type === 'object' && type !== null) {
|
|
1288
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
1289
|
-
// types supported by any Flight configuration anywhere since
|
|
1290
|
-
// we don't know which Flight build this will end up being used
|
|
1291
|
-
// with.
|
|
1292
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
1293
|
-
return true;
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
return false;
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
function typeOf(object) {
|
|
1301
|
-
if (typeof object === 'object' && object !== null) {
|
|
1302
|
-
var $$typeof = object.$$typeof;
|
|
1303
|
-
|
|
1304
|
-
switch ($$typeof) {
|
|
1305
|
-
case REACT_ELEMENT_TYPE:
|
|
1306
|
-
var type = object.type;
|
|
1307
|
-
|
|
1308
|
-
switch (type) {
|
|
1309
|
-
case REACT_FRAGMENT_TYPE:
|
|
1310
|
-
case REACT_PROFILER_TYPE:
|
|
1311
|
-
case REACT_STRICT_MODE_TYPE:
|
|
1312
|
-
case REACT_SUSPENSE_TYPE:
|
|
1313
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
1314
|
-
return type;
|
|
1315
|
-
|
|
1316
|
-
default:
|
|
1317
|
-
var $$typeofType = type && type.$$typeof;
|
|
1318
|
-
|
|
1319
|
-
switch ($$typeofType) {
|
|
1320
|
-
case REACT_SERVER_CONTEXT_TYPE:
|
|
1321
|
-
case REACT_CONTEXT_TYPE:
|
|
1322
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1323
|
-
case REACT_LAZY_TYPE:
|
|
1324
|
-
case REACT_MEMO_TYPE:
|
|
1325
|
-
case REACT_PROVIDER_TYPE:
|
|
1326
|
-
return $$typeofType;
|
|
1327
|
-
|
|
1328
|
-
default:
|
|
1329
|
-
return $$typeof;
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
case REACT_PORTAL_TYPE:
|
|
1335
|
-
return $$typeof;
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
return undefined;
|
|
1340
|
-
}
|
|
1341
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
1342
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
1343
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
1344
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
1345
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
1346
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
1347
|
-
var Memo = REACT_MEMO_TYPE;
|
|
1348
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
1349
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
1350
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1351
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
1352
|
-
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
1353
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
1354
|
-
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
1355
|
-
|
|
1356
|
-
function isAsyncMode(object) {
|
|
1357
|
-
{
|
|
1358
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
1359
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
1360
|
-
|
|
1361
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
return false;
|
|
1366
|
-
}
|
|
1367
|
-
function isConcurrentMode(object) {
|
|
1368
|
-
{
|
|
1369
|
-
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
1370
|
-
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
1371
|
-
|
|
1372
|
-
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1376
|
-
return false;
|
|
1377
|
-
}
|
|
1378
|
-
function isContextConsumer(object) {
|
|
1379
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
1380
|
-
}
|
|
1381
|
-
function isContextProvider(object) {
|
|
1382
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
1383
|
-
}
|
|
1384
|
-
function isElement(object) {
|
|
1385
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1386
|
-
}
|
|
1387
|
-
function isForwardRef(object) {
|
|
1388
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
1389
|
-
}
|
|
1390
|
-
function isFragment(object) {
|
|
1391
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
1392
|
-
}
|
|
1393
|
-
function isLazy(object) {
|
|
1394
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
1395
|
-
}
|
|
1396
|
-
function isMemo(object) {
|
|
1397
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
1398
|
-
}
|
|
1399
|
-
function isPortal(object) {
|
|
1400
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
1401
|
-
}
|
|
1402
|
-
function isProfiler(object) {
|
|
1403
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
1404
|
-
}
|
|
1405
|
-
function isStrictMode(object) {
|
|
1406
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
1407
|
-
}
|
|
1408
|
-
function isSuspense(object) {
|
|
1409
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
1410
|
-
}
|
|
1411
|
-
function isSuspenseList(object) {
|
|
1412
|
-
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
1416
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
1417
|
-
reactIs_development.Element = Element;
|
|
1418
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
1419
|
-
reactIs_development.Fragment = Fragment;
|
|
1420
|
-
reactIs_development.Lazy = Lazy;
|
|
1421
|
-
reactIs_development.Memo = Memo;
|
|
1422
|
-
reactIs_development.Portal = Portal;
|
|
1423
|
-
reactIs_development.Profiler = Profiler;
|
|
1424
|
-
reactIs_development.StrictMode = StrictMode;
|
|
1425
|
-
reactIs_development.Suspense = Suspense;
|
|
1426
|
-
reactIs_development.SuspenseList = SuspenseList;
|
|
1427
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
1428
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
1429
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
1430
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
1431
|
-
reactIs_development.isElement = isElement;
|
|
1432
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
1433
|
-
reactIs_development.isFragment = isFragment;
|
|
1434
|
-
reactIs_development.isLazy = isLazy;
|
|
1435
|
-
reactIs_development.isMemo = isMemo;
|
|
1436
|
-
reactIs_development.isPortal = isPortal;
|
|
1437
|
-
reactIs_development.isProfiler = isProfiler;
|
|
1438
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
1439
|
-
reactIs_development.isSuspense = isSuspense;
|
|
1440
|
-
reactIs_development.isSuspenseList = isSuspenseList;
|
|
1441
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
1442
|
-
reactIs_development.typeOf = typeOf;
|
|
1443
|
-
})();
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1447
|
-
reactIs.exports = reactIs_production_min;
|
|
1448
|
-
} else {
|
|
1449
|
-
reactIs.exports = reactIs_development;
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
var reactIsExports = reactIs.exports;
|
|
1453
|
-
|
|
1454
|
-
// Simplified polyfill for IE11 support
|
|
1455
|
-
// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3
|
|
1456
|
-
const fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
|
|
1457
|
-
function getFunctionName(fn) {
|
|
1458
|
-
const match = `${fn}`.match(fnNameMatchRegex);
|
|
1459
|
-
const name = match && match[1];
|
|
1460
|
-
return name || '';
|
|
1461
|
-
}
|
|
1462
|
-
function getFunctionComponentName(Component, fallback = '') {
|
|
1463
|
-
return Component.displayName || Component.name || getFunctionName(Component) || fallback;
|
|
1464
|
-
}
|
|
1465
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
1466
|
-
const functionName = getFunctionComponentName(innerType);
|
|
1467
|
-
return outerType.displayName || (functionName !== '' ? `${wrapperName}(${functionName})` : wrapperName);
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
|
-
/**
|
|
1471
|
-
* cherry-pick from
|
|
1472
|
-
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
|
1473
|
-
* originally forked from recompose/getDisplayName with added IE11 support
|
|
1474
|
-
*/
|
|
1475
|
-
function getDisplayName(Component) {
|
|
1476
|
-
if (Component == null) {
|
|
1477
|
-
return undefined;
|
|
1478
|
-
}
|
|
1479
|
-
if (typeof Component === 'string') {
|
|
1480
|
-
return Component;
|
|
1481
|
-
}
|
|
1482
|
-
if (typeof Component === 'function') {
|
|
1483
|
-
return getFunctionComponentName(Component, 'Component');
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
// TypeScript can't have components as objects but they exist in the form of `memo` or `Suspense`
|
|
1487
|
-
if (typeof Component === 'object') {
|
|
1488
|
-
switch (Component.$$typeof) {
|
|
1489
|
-
case reactIsExports.ForwardRef:
|
|
1490
|
-
return getWrappedName(Component, Component.render, 'ForwardRef');
|
|
1491
|
-
case reactIsExports.Memo:
|
|
1492
|
-
return getWrappedName(Component, Component.type, 'memo');
|
|
1493
|
-
default:
|
|
1494
|
-
return undefined;
|
|
1495
|
-
}
|
|
1496
|
-
}
|
|
1497
|
-
return undefined;
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
function HTMLElementType(props, propName, componentName, location, propFullName) {
|
|
1501
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1502
|
-
return null;
|
|
1503
|
-
}
|
|
1504
|
-
const propValue = props[propName];
|
|
1505
|
-
const safePropName = propFullName || propName;
|
|
1506
|
-
if (propValue == null) {
|
|
1507
|
-
return null;
|
|
1508
|
-
}
|
|
1509
|
-
if (propValue && propValue.nodeType !== 1) {
|
|
1510
|
-
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an HTMLElement.`);
|
|
1511
|
-
}
|
|
1512
|
-
return null;
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1515
|
-
const refType = PropTypes.oneOfType([PropTypes.func, PropTypes.object]);
|
|
1516
|
-
var refType$1 = refType;
|
|
1517
|
-
|
|
1518
|
-
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
|
|
1519
|
-
//
|
|
1520
|
-
// A strict capitalization should uppercase the first letter of each word in the sentence.
|
|
1521
|
-
// We only handle the first word.
|
|
1522
|
-
function capitalize(string) {
|
|
1523
|
-
if (typeof string !== 'string') {
|
|
1524
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`capitalize(string)\` expects a string argument.` : formatMuiErrorMessage(7));
|
|
1525
|
-
}
|
|
1526
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
function ownerDocument(node) {
|
|
1530
|
-
return node && node.ownerDocument || document;
|
|
1531
|
-
}
|
|
1532
|
-
|
|
1533
|
-
/**
|
|
1534
|
-
* TODO v5: consider making it private
|
|
1535
|
-
*
|
|
1536
|
-
* passes {value} to {ref}
|
|
1537
|
-
*
|
|
1538
|
-
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
1539
|
-
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
1540
|
-
* https://github.com/mui/material-ui/issues/13539
|
|
1541
|
-
*
|
|
1542
|
-
* Useful if you want to expose the ref of an inner component to the public API
|
|
1543
|
-
* while still using it inside the component.
|
|
1544
|
-
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
1545
|
-
*/
|
|
1546
|
-
function setRef(ref, value) {
|
|
1547
|
-
if (typeof ref === 'function') {
|
|
1548
|
-
ref(value);
|
|
1549
|
-
} else if (ref) {
|
|
1550
|
-
ref.current = value;
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
const useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
1555
|
-
var useEnhancedEffect$1 = useEnhancedEffect;
|
|
1556
|
-
|
|
1557
|
-
function useForkRef(...refs) {
|
|
1558
|
-
/**
|
|
1559
|
-
* This will create a new function if the refs passed to this hook change and are all defined.
|
|
1560
|
-
* This means react will call the old forkRef with `null` and the new forkRef
|
|
1561
|
-
* with the ref. Cleanup naturally emerges from this behavior.
|
|
1562
|
-
*/
|
|
1563
|
-
return React.useMemo(() => {
|
|
1564
|
-
if (refs.every(ref => ref == null)) {
|
|
1565
|
-
return null;
|
|
1566
|
-
}
|
|
1567
|
-
return instance => {
|
|
1568
|
-
refs.forEach(ref => {
|
|
1569
|
-
setRef(ref, instance);
|
|
1570
|
-
});
|
|
1571
|
-
};
|
|
1572
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1573
|
-
}, refs);
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
|
-
/**
|
|
1577
|
-
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
1578
|
-
* @param {object} defaultProps
|
|
1579
|
-
* @param {object} props
|
|
1580
|
-
* @returns {object} resolved props
|
|
1581
|
-
*/
|
|
1582
|
-
function resolveProps(defaultProps, props) {
|
|
1583
|
-
const output = {
|
|
1584
|
-
...props
|
|
1585
|
-
};
|
|
1586
|
-
Object.keys(defaultProps).forEach(propName => {
|
|
1587
|
-
if (propName.toString().match(/^(components|slots)$/)) {
|
|
1588
|
-
output[propName] = {
|
|
1589
|
-
...defaultProps[propName],
|
|
1590
|
-
...output[propName]
|
|
1591
|
-
};
|
|
1592
|
-
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
1593
|
-
const defaultSlotProps = defaultProps[propName] || {};
|
|
1594
|
-
const slotProps = props[propName];
|
|
1595
|
-
output[propName] = {};
|
|
1596
|
-
if (!slotProps || !Object.keys(slotProps)) {
|
|
1597
|
-
// Reduce the iteration if the slot props is empty
|
|
1598
|
-
output[propName] = defaultSlotProps;
|
|
1599
|
-
} else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
|
|
1600
|
-
// Reduce the iteration if the default slot props is empty
|
|
1601
|
-
output[propName] = slotProps;
|
|
1602
|
-
} else {
|
|
1603
|
-
output[propName] = {
|
|
1604
|
-
...slotProps
|
|
1605
|
-
};
|
|
1606
|
-
Object.keys(defaultSlotProps).forEach(slotPropName => {
|
|
1607
|
-
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
1608
|
-
});
|
|
1609
|
-
}
|
|
1610
|
-
} else if (output[propName] === undefined) {
|
|
1611
|
-
output[propName] = defaultProps[propName];
|
|
1612
|
-
}
|
|
1613
|
-
});
|
|
1614
|
-
return output;
|
|
1615
|
-
}
|
|
1616
|
-
|
|
1617
|
-
function composeClasses(slots, getUtilityClass, classes = undefined) {
|
|
1618
|
-
const output = {};
|
|
1619
|
-
Object.keys(slots).forEach(
|
|
1620
|
-
// `Objet.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
|
1621
|
-
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
1622
|
-
slot => {
|
|
1623
|
-
output[slot] = slots[slot].reduce((acc, key) => {
|
|
1624
|
-
if (key) {
|
|
1625
|
-
const utilityClass = getUtilityClass(key);
|
|
1626
|
-
if (utilityClass !== '') {
|
|
1627
|
-
acc.push(utilityClass);
|
|
1628
|
-
}
|
|
1629
|
-
if (classes && classes[key]) {
|
|
1630
|
-
acc.push(classes[key]);
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
return acc;
|
|
1634
|
-
}, []).join(' ');
|
|
1635
|
-
});
|
|
1636
|
-
return output;
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
const defaultGenerator = componentName => componentName;
|
|
1640
|
-
const createClassNameGenerator = () => {
|
|
1641
|
-
let generate = defaultGenerator;
|
|
1642
|
-
return {
|
|
1643
|
-
configure(generator) {
|
|
1644
|
-
generate = generator;
|
|
1645
|
-
},
|
|
1646
|
-
generate(componentName) {
|
|
1647
|
-
return generate(componentName);
|
|
1648
|
-
},
|
|
1649
|
-
reset() {
|
|
1650
|
-
generate = defaultGenerator;
|
|
1651
|
-
}
|
|
1652
|
-
};
|
|
1653
|
-
};
|
|
1654
|
-
const ClassNameGenerator = createClassNameGenerator();
|
|
1655
|
-
var ClassNameGenerator$1 = ClassNameGenerator;
|
|
1656
|
-
|
|
1657
|
-
const globalStateClassesMapping = {
|
|
1658
|
-
active: 'active',
|
|
1659
|
-
checked: 'checked',
|
|
1660
|
-
completed: 'completed',
|
|
1661
|
-
disabled: 'disabled',
|
|
1662
|
-
readOnly: 'readOnly',
|
|
1663
|
-
error: 'error',
|
|
1664
|
-
expanded: 'expanded',
|
|
1665
|
-
focused: 'focused',
|
|
1666
|
-
focusVisible: 'focusVisible',
|
|
1667
|
-
required: 'required',
|
|
1668
|
-
selected: 'selected'
|
|
1669
|
-
};
|
|
1670
|
-
function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
|
|
1671
|
-
const globalStateClass = globalStateClassesMapping[slot];
|
|
1672
|
-
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator$1.generate(componentName)}-${slot}`;
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
|
-
function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {
|
|
1676
|
-
const result = {};
|
|
1677
|
-
slots.forEach(slot => {
|
|
1678
|
-
result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
|
|
1679
|
-
});
|
|
1680
|
-
return result;
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
|
-
/**
|
|
1684
|
-
* @mui/styled-engine v5.13.2
|
|
1685
|
-
*
|
|
1686
|
-
* @license MIT
|
|
1687
|
-
* This source code is licensed under the MIT license found in the
|
|
1688
|
-
* LICENSE file in the root directory of this source tree.
|
|
1689
|
-
*/
|
|
1690
|
-
function styled$2(tag, options) {
|
|
1691
|
-
const stylesFactory = emStyled(tag, options);
|
|
1692
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1693
|
-
return (...styles) => {
|
|
1694
|
-
const component = typeof tag === 'string' ? `"${tag}"` : 'component';
|
|
1695
|
-
if (styles.length === 0) {
|
|
1696
|
-
console.error([`MUI: Seems like you called \`styled(${component})()\` without a \`style\` argument.`, 'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join('\n'));
|
|
1697
|
-
} else if (styles.some(style => style === undefined)) {
|
|
1698
|
-
console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);
|
|
1699
|
-
}
|
|
1700
|
-
return stylesFactory(...styles);
|
|
1701
|
-
};
|
|
1702
|
-
}
|
|
1703
|
-
return stylesFactory;
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1707
|
-
const internal_processStyles = (tag, processor) => {
|
|
1708
|
-
// Emotion attaches all the styles as `__emotion_styles`.
|
|
1709
|
-
// Ref: https://github.com/emotion-js/emotion/blob/16d971d0da229596d6bcc39d282ba9753c9ee7cf/packages/styled/src/base.js#L186
|
|
1710
|
-
if (Array.isArray(tag.__emotion_styles)) {
|
|
1711
|
-
tag.__emotion_styles = processor(tag.__emotion_styles);
|
|
1712
|
-
}
|
|
1713
|
-
};
|
|
1714
|
-
|
|
1715
|
-
function _extends() {
|
|
1716
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
1717
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
1718
|
-
var source = arguments[i];
|
|
1719
|
-
for (var key in source) {
|
|
1720
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1721
|
-
target[key] = source[key];
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
}
|
|
1725
|
-
return target;
|
|
1726
|
-
};
|
|
1727
|
-
return _extends.apply(this, arguments);
|
|
1728
|
-
}
|
|
1729
|
-
|
|
1730
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1731
|
-
if (source == null) return {};
|
|
1732
|
-
var target = {};
|
|
1733
|
-
var sourceKeys = Object.keys(source);
|
|
1734
|
-
var key, i;
|
|
1735
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
1736
|
-
key = sourceKeys[i];
|
|
1737
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1738
|
-
target[key] = source[key];
|
|
1739
|
-
}
|
|
1740
|
-
return target;
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
const _excluded$8 = ["values", "unit", "step"];
|
|
1744
|
-
const sortBreakpointsValues = values => {
|
|
1745
|
-
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
1746
|
-
key,
|
|
1747
|
-
val: values[key]
|
|
1748
|
-
})) || [];
|
|
1749
|
-
// Sort in ascending order
|
|
1750
|
-
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
1751
|
-
return breakpointsAsArray.reduce((acc, obj) => {
|
|
1752
|
-
return _extends({}, acc, {
|
|
1753
|
-
[obj.key]: obj.val
|
|
1754
|
-
});
|
|
1755
|
-
}, {});
|
|
1756
|
-
};
|
|
1757
|
-
|
|
1758
|
-
// Keep in mind that @media is inclusive by the CSS specification.
|
|
1759
|
-
function createBreakpoints(breakpoints) {
|
|
1760
|
-
const {
|
|
1761
|
-
// The breakpoint **start** at this value.
|
|
1762
|
-
// For instance with the first breakpoint xs: [xs, sm).
|
|
1763
|
-
values = {
|
|
1764
|
-
xs: 0,
|
|
1765
|
-
// phone
|
|
1766
|
-
sm: 600,
|
|
1767
|
-
// tablet
|
|
1768
|
-
md: 900,
|
|
1769
|
-
// small laptop
|
|
1770
|
-
lg: 1200,
|
|
1771
|
-
// desktop
|
|
1772
|
-
xl: 1536 // large screen
|
|
1773
|
-
},
|
|
1774
|
-
|
|
1775
|
-
unit = 'px',
|
|
1776
|
-
step = 5
|
|
1777
|
-
} = breakpoints,
|
|
1778
|
-
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$8);
|
|
1779
|
-
const sortedValues = sortBreakpointsValues(values);
|
|
1780
|
-
const keys = Object.keys(sortedValues);
|
|
1781
|
-
function up(key) {
|
|
1782
|
-
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
1783
|
-
return `@media (min-width:${value}${unit})`;
|
|
1784
|
-
}
|
|
1785
|
-
function down(key) {
|
|
1786
|
-
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
1787
|
-
return `@media (max-width:${value - step / 100}${unit})`;
|
|
1788
|
-
}
|
|
1789
|
-
function between(start, end) {
|
|
1790
|
-
const endIndex = keys.indexOf(end);
|
|
1791
|
-
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})`;
|
|
1792
|
-
}
|
|
1793
|
-
function only(key) {
|
|
1794
|
-
if (keys.indexOf(key) + 1 < keys.length) {
|
|
1795
|
-
return between(key, keys[keys.indexOf(key) + 1]);
|
|
1796
|
-
}
|
|
1797
|
-
return up(key);
|
|
1798
|
-
}
|
|
1799
|
-
function not(key) {
|
|
1800
|
-
// handle first and last key separately, for better readability
|
|
1801
|
-
const keyIndex = keys.indexOf(key);
|
|
1802
|
-
if (keyIndex === 0) {
|
|
1803
|
-
return up(keys[1]);
|
|
1804
|
-
}
|
|
1805
|
-
if (keyIndex === keys.length - 1) {
|
|
1806
|
-
return down(keys[keyIndex]);
|
|
1807
|
-
}
|
|
1808
|
-
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
|
|
1809
|
-
}
|
|
1810
|
-
return _extends({
|
|
1811
|
-
keys,
|
|
1812
|
-
values: sortedValues,
|
|
1813
|
-
up,
|
|
1814
|
-
down,
|
|
1815
|
-
between,
|
|
1816
|
-
only,
|
|
1817
|
-
not,
|
|
1818
|
-
unit
|
|
1819
|
-
}, other);
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
const shape = {
|
|
1823
|
-
borderRadius: 4
|
|
1824
|
-
};
|
|
1825
|
-
var shape$1 = shape;
|
|
1826
|
-
|
|
1827
|
-
const responsivePropType = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]) : {};
|
|
1828
|
-
var responsivePropType$1 = responsivePropType;
|
|
1829
|
-
|
|
1830
|
-
function merge(acc, item) {
|
|
1831
|
-
if (!item) {
|
|
1832
|
-
return acc;
|
|
1833
|
-
}
|
|
1834
|
-
return deepmerge(acc, item, {
|
|
1835
|
-
clone: false // No need to clone deep, it's way faster.
|
|
1836
|
-
});
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
// The breakpoint **start** at this value.
|
|
1840
|
-
// For instance with the first breakpoint xs: [xs, sm[.
|
|
1841
|
-
const values = {
|
|
1842
|
-
xs: 0,
|
|
1843
|
-
// phone
|
|
1844
|
-
sm: 600,
|
|
1845
|
-
// tablet
|
|
1846
|
-
md: 900,
|
|
1847
|
-
// small laptop
|
|
1848
|
-
lg: 1200,
|
|
1849
|
-
// desktop
|
|
1850
|
-
xl: 1536 // large screen
|
|
1851
|
-
};
|
|
1852
|
-
|
|
1853
|
-
const defaultBreakpoints = {
|
|
1854
|
-
// Sorted ASC by size. That's important.
|
|
1855
|
-
// It can't be configured as it's used statically for propTypes.
|
|
1856
|
-
keys: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
1857
|
-
up: key => `@media (min-width:${values[key]}px)`
|
|
1858
|
-
};
|
|
1859
|
-
function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
1860
|
-
const theme = props.theme || {};
|
|
1861
|
-
if (Array.isArray(propValue)) {
|
|
1862
|
-
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
1863
|
-
return propValue.reduce((acc, item, index) => {
|
|
1864
|
-
acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
|
|
1865
|
-
return acc;
|
|
1866
|
-
}, {});
|
|
1867
|
-
}
|
|
1868
|
-
if (typeof propValue === 'object') {
|
|
1869
|
-
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
1870
|
-
return Object.keys(propValue).reduce((acc, breakpoint) => {
|
|
1871
|
-
// key is breakpoint
|
|
1872
|
-
if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {
|
|
1873
|
-
const mediaKey = themeBreakpoints.up(breakpoint);
|
|
1874
|
-
acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
|
|
1875
|
-
} else {
|
|
1876
|
-
const cssKey = breakpoint;
|
|
1877
|
-
acc[cssKey] = propValue[cssKey];
|
|
1878
|
-
}
|
|
1879
|
-
return acc;
|
|
1880
|
-
}, {});
|
|
1881
|
-
}
|
|
1882
|
-
const output = styleFromPropValue(propValue);
|
|
1883
|
-
return output;
|
|
1884
|
-
}
|
|
1885
|
-
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
1886
|
-
var _breakpointsInput$key;
|
|
1887
|
-
const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
|
|
1888
|
-
const breakpointStyleKey = breakpointsInput.up(key);
|
|
1889
|
-
acc[breakpointStyleKey] = {};
|
|
1890
|
-
return acc;
|
|
1891
|
-
}, {});
|
|
1892
|
-
return breakpointsInOrder || {};
|
|
1893
|
-
}
|
|
1894
|
-
function removeUnusedBreakpoints(breakpointKeys, style) {
|
|
1895
|
-
return breakpointKeys.reduce((acc, key) => {
|
|
1896
|
-
const breakpointOutput = acc[key];
|
|
1897
|
-
const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
|
|
1898
|
-
if (isBreakpointUnused) {
|
|
1899
|
-
delete acc[key];
|
|
1900
|
-
}
|
|
1901
|
-
return acc;
|
|
1902
|
-
}, style);
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1905
|
-
function getPath(obj, path, checkVars = true) {
|
|
1906
|
-
if (!path || typeof path !== 'string') {
|
|
1907
|
-
return null;
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
// Check if CSS variables are used
|
|
1911
|
-
if (obj && obj.vars && checkVars) {
|
|
1912
|
-
const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
1913
|
-
if (val != null) {
|
|
1914
|
-
return val;
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
return path.split('.').reduce((acc, item) => {
|
|
1918
|
-
if (acc && acc[item] != null) {
|
|
1919
|
-
return acc[item];
|
|
1920
|
-
}
|
|
1921
|
-
return null;
|
|
1922
|
-
}, obj);
|
|
1923
|
-
}
|
|
1924
|
-
function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
1925
|
-
let value;
|
|
1926
|
-
if (typeof themeMapping === 'function') {
|
|
1927
|
-
value = themeMapping(propValueFinal);
|
|
1928
|
-
} else if (Array.isArray(themeMapping)) {
|
|
1929
|
-
value = themeMapping[propValueFinal] || userValue;
|
|
1930
|
-
} else {
|
|
1931
|
-
value = getPath(themeMapping, propValueFinal) || userValue;
|
|
1932
|
-
}
|
|
1933
|
-
if (transform) {
|
|
1934
|
-
value = transform(value, userValue, themeMapping);
|
|
1935
|
-
}
|
|
1936
|
-
return value;
|
|
1937
|
-
}
|
|
1938
|
-
function style$1(options) {
|
|
1939
|
-
const {
|
|
1940
|
-
prop,
|
|
1941
|
-
cssProperty = options.prop,
|
|
1942
|
-
themeKey,
|
|
1943
|
-
transform
|
|
1944
|
-
} = options;
|
|
1945
|
-
|
|
1946
|
-
// false positive
|
|
1947
|
-
// eslint-disable-next-line react/function-component-definition
|
|
1948
|
-
const fn = props => {
|
|
1949
|
-
if (props[prop] == null) {
|
|
1950
|
-
return null;
|
|
1951
|
-
}
|
|
1952
|
-
const propValue = props[prop];
|
|
1953
|
-
const theme = props.theme;
|
|
1954
|
-
const themeMapping = getPath(theme, themeKey) || {};
|
|
1955
|
-
const styleFromPropValue = propValueFinal => {
|
|
1956
|
-
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
1957
|
-
if (propValueFinal === value && typeof propValueFinal === 'string') {
|
|
1958
|
-
// Haven't found value
|
|
1959
|
-
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);
|
|
1960
|
-
}
|
|
1961
|
-
if (cssProperty === false) {
|
|
1962
|
-
return value;
|
|
1963
|
-
}
|
|
1964
|
-
return {
|
|
1965
|
-
[cssProperty]: value
|
|
1966
|
-
};
|
|
1967
|
-
};
|
|
1968
|
-
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
1969
|
-
};
|
|
1970
|
-
fn.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
1971
|
-
[prop]: responsivePropType$1
|
|
1972
|
-
} : {};
|
|
1973
|
-
fn.filterProps = [prop];
|
|
1974
|
-
return fn;
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
function memoize(fn) {
|
|
1978
|
-
const cache = {};
|
|
1979
|
-
return arg => {
|
|
1980
|
-
if (cache[arg] === undefined) {
|
|
1981
|
-
cache[arg] = fn(arg);
|
|
1982
|
-
}
|
|
1983
|
-
return cache[arg];
|
|
1984
|
-
};
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
const properties = {
|
|
1988
|
-
m: 'margin',
|
|
1989
|
-
p: 'padding'
|
|
1990
|
-
};
|
|
1991
|
-
const directions = {
|
|
1992
|
-
t: 'Top',
|
|
1993
|
-
r: 'Right',
|
|
1994
|
-
b: 'Bottom',
|
|
1995
|
-
l: 'Left',
|
|
1996
|
-
x: ['Left', 'Right'],
|
|
1997
|
-
y: ['Top', 'Bottom']
|
|
1998
|
-
};
|
|
1999
|
-
const aliases = {
|
|
2000
|
-
marginX: 'mx',
|
|
2001
|
-
marginY: 'my',
|
|
2002
|
-
paddingX: 'px',
|
|
2003
|
-
paddingY: 'py'
|
|
2004
|
-
};
|
|
2005
|
-
|
|
2006
|
-
// memoize() impact:
|
|
2007
|
-
// From 300,000 ops/sec
|
|
2008
|
-
// To 350,000 ops/sec
|
|
2009
|
-
const getCssProperties = memoize(prop => {
|
|
2010
|
-
// It's not a shorthand notation.
|
|
2011
|
-
if (prop.length > 2) {
|
|
2012
|
-
if (aliases[prop]) {
|
|
2013
|
-
prop = aliases[prop];
|
|
2014
|
-
} else {
|
|
2015
|
-
return [prop];
|
|
2016
|
-
}
|
|
2017
|
-
}
|
|
2018
|
-
const [a, b] = prop.split('');
|
|
2019
|
-
const property = properties[a];
|
|
2020
|
-
const direction = directions[b] || '';
|
|
2021
|
-
return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];
|
|
2022
|
-
});
|
|
2023
|
-
const marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];
|
|
2024
|
-
const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];
|
|
2025
|
-
const spacingKeys = [...marginKeys, ...paddingKeys];
|
|
2026
|
-
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
2027
|
-
var _getPath;
|
|
2028
|
-
const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;
|
|
2029
|
-
if (typeof themeSpacing === 'number') {
|
|
2030
|
-
return abs => {
|
|
2031
|
-
if (typeof abs === 'string') {
|
|
2032
|
-
return abs;
|
|
2033
|
-
}
|
|
2034
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2035
|
-
if (typeof abs !== 'number') {
|
|
2036
|
-
console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);
|
|
2037
|
-
}
|
|
2038
|
-
}
|
|
2039
|
-
return themeSpacing * abs;
|
|
2040
|
-
};
|
|
2041
|
-
}
|
|
2042
|
-
if (Array.isArray(themeSpacing)) {
|
|
2043
|
-
return abs => {
|
|
2044
|
-
if (typeof abs === 'string') {
|
|
2045
|
-
return abs;
|
|
2046
|
-
}
|
|
2047
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2048
|
-
if (!Number.isInteger(abs)) {
|
|
2049
|
-
console.error([`MUI: The \`theme.${themeKey}\` array type cannot be combined with non integer values.` + `You should either use an integer value that can be used as index, or define the \`theme.${themeKey}\` as a number.`].join('\n'));
|
|
2050
|
-
} else if (abs > themeSpacing.length - 1) {
|
|
2051
|
-
console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\n'));
|
|
2052
|
-
}
|
|
2053
|
-
}
|
|
2054
|
-
return themeSpacing[abs];
|
|
2055
|
-
};
|
|
2056
|
-
}
|
|
2057
|
-
if (typeof themeSpacing === 'function') {
|
|
2058
|
-
return themeSpacing;
|
|
2059
|
-
}
|
|
2060
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2061
|
-
console.error([`MUI: The \`theme.${themeKey}\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\n'));
|
|
2062
|
-
}
|
|
2063
|
-
return () => undefined;
|
|
2064
|
-
}
|
|
2065
|
-
function createUnarySpacing(theme) {
|
|
2066
|
-
return createUnaryUnit(theme, 'spacing', 8, 'spacing');
|
|
2067
|
-
}
|
|
2068
|
-
function getValue(transformer, propValue) {
|
|
2069
|
-
if (typeof propValue === 'string' || propValue == null) {
|
|
2070
|
-
return propValue;
|
|
2071
|
-
}
|
|
2072
|
-
const abs = Math.abs(propValue);
|
|
2073
|
-
const transformed = transformer(abs);
|
|
2074
|
-
if (propValue >= 0) {
|
|
2075
|
-
return transformed;
|
|
2076
|
-
}
|
|
2077
|
-
if (typeof transformed === 'number') {
|
|
2078
|
-
return -transformed;
|
|
2079
|
-
}
|
|
2080
|
-
return `-${transformed}`;
|
|
2081
|
-
}
|
|
2082
|
-
function getStyleFromPropValue(cssProperties, transformer) {
|
|
2083
|
-
return propValue => cssProperties.reduce((acc, cssProperty) => {
|
|
2084
|
-
acc[cssProperty] = getValue(transformer, propValue);
|
|
2085
|
-
return acc;
|
|
2086
|
-
}, {});
|
|
2087
|
-
}
|
|
2088
|
-
function resolveCssProperty(props, keys, prop, transformer) {
|
|
2089
|
-
// Using a hash computation over an array iteration could be faster, but with only 28 items,
|
|
2090
|
-
// it's doesn't worth the bundle size.
|
|
2091
|
-
if (keys.indexOf(prop) === -1) {
|
|
2092
|
-
return null;
|
|
2093
|
-
}
|
|
2094
|
-
const cssProperties = getCssProperties(prop);
|
|
2095
|
-
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
|
2096
|
-
const propValue = props[prop];
|
|
2097
|
-
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
2098
|
-
}
|
|
2099
|
-
function style(props, keys) {
|
|
2100
|
-
const transformer = createUnarySpacing(props.theme);
|
|
2101
|
-
return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});
|
|
2102
|
-
}
|
|
2103
|
-
function margin(props) {
|
|
2104
|
-
return style(props, marginKeys);
|
|
2105
|
-
}
|
|
2106
|
-
margin.propTypes = process.env.NODE_ENV !== 'production' ? marginKeys.reduce((obj, key) => {
|
|
2107
|
-
obj[key] = responsivePropType$1;
|
|
2108
|
-
return obj;
|
|
2109
|
-
}, {}) : {};
|
|
2110
|
-
margin.filterProps = marginKeys;
|
|
2111
|
-
function padding(props) {
|
|
2112
|
-
return style(props, paddingKeys);
|
|
2113
|
-
}
|
|
2114
|
-
padding.propTypes = process.env.NODE_ENV !== 'production' ? paddingKeys.reduce((obj, key) => {
|
|
2115
|
-
obj[key] = responsivePropType$1;
|
|
2116
|
-
return obj;
|
|
2117
|
-
}, {}) : {};
|
|
2118
|
-
padding.filterProps = paddingKeys;
|
|
2119
|
-
process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {
|
|
2120
|
-
obj[key] = responsivePropType$1;
|
|
2121
|
-
return obj;
|
|
2122
|
-
}, {}) : {};
|
|
2123
|
-
|
|
2124
|
-
// The different signatures imply different meaning for their arguments that can't be expressed structurally.
|
|
2125
|
-
// We express the difference with variable names.
|
|
2126
|
-
/* tslint:disable:unified-signatures */
|
|
2127
|
-
/* tslint:enable:unified-signatures */
|
|
2128
|
-
|
|
2129
|
-
function createSpacing(spacingInput = 8) {
|
|
2130
|
-
// Already transformed.
|
|
2131
|
-
if (spacingInput.mui) {
|
|
2132
|
-
return spacingInput;
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
// Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.
|
|
2136
|
-
// Smaller components, such as icons, can align to a 4dp grid.
|
|
2137
|
-
// https://m2.material.io/design/layout/understanding-layout.html
|
|
2138
|
-
const transform = createUnarySpacing({
|
|
2139
|
-
spacing: spacingInput
|
|
2140
|
-
});
|
|
2141
|
-
const spacing = (...argsInput) => {
|
|
2142
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2143
|
-
if (!(argsInput.length <= 4)) {
|
|
2144
|
-
console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
2147
|
-
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
2148
|
-
return args.map(argument => {
|
|
2149
|
-
const output = transform(argument);
|
|
2150
|
-
return typeof output === 'number' ? `${output}px` : output;
|
|
2151
|
-
}).join(' ');
|
|
2152
|
-
};
|
|
2153
|
-
spacing.mui = true;
|
|
2154
|
-
return spacing;
|
|
2155
|
-
}
|
|
2156
|
-
|
|
2157
|
-
function compose(...styles) {
|
|
2158
|
-
const handlers = styles.reduce((acc, style) => {
|
|
2159
|
-
style.filterProps.forEach(prop => {
|
|
2160
|
-
acc[prop] = style;
|
|
2161
|
-
});
|
|
2162
|
-
return acc;
|
|
2163
|
-
}, {});
|
|
2164
|
-
|
|
2165
|
-
// false positive
|
|
2166
|
-
// eslint-disable-next-line react/function-component-definition
|
|
2167
|
-
const fn = props => {
|
|
2168
|
-
return Object.keys(props).reduce((acc, prop) => {
|
|
2169
|
-
if (handlers[prop]) {
|
|
2170
|
-
return merge(acc, handlers[prop](props));
|
|
2171
|
-
}
|
|
2172
|
-
return acc;
|
|
2173
|
-
}, {});
|
|
2174
|
-
};
|
|
2175
|
-
fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};
|
|
2176
|
-
fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);
|
|
2177
|
-
return fn;
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
function borderTransform(value) {
|
|
2181
|
-
if (typeof value !== 'number') {
|
|
2182
|
-
return value;
|
|
2183
|
-
}
|
|
2184
|
-
return `${value}px solid`;
|
|
2185
|
-
}
|
|
2186
|
-
const border = style$1({
|
|
2187
|
-
prop: 'border',
|
|
2188
|
-
themeKey: 'borders',
|
|
2189
|
-
transform: borderTransform
|
|
2190
|
-
});
|
|
2191
|
-
const borderTop = style$1({
|
|
2192
|
-
prop: 'borderTop',
|
|
2193
|
-
themeKey: 'borders',
|
|
2194
|
-
transform: borderTransform
|
|
2195
|
-
});
|
|
2196
|
-
const borderRight = style$1({
|
|
2197
|
-
prop: 'borderRight',
|
|
2198
|
-
themeKey: 'borders',
|
|
2199
|
-
transform: borderTransform
|
|
2200
|
-
});
|
|
2201
|
-
const borderBottom = style$1({
|
|
2202
|
-
prop: 'borderBottom',
|
|
2203
|
-
themeKey: 'borders',
|
|
2204
|
-
transform: borderTransform
|
|
2205
|
-
});
|
|
2206
|
-
const borderLeft = style$1({
|
|
2207
|
-
prop: 'borderLeft',
|
|
2208
|
-
themeKey: 'borders',
|
|
2209
|
-
transform: borderTransform
|
|
2210
|
-
});
|
|
2211
|
-
const borderColor = style$1({
|
|
2212
|
-
prop: 'borderColor',
|
|
2213
|
-
themeKey: 'palette'
|
|
2214
|
-
});
|
|
2215
|
-
const borderTopColor = style$1({
|
|
2216
|
-
prop: 'borderTopColor',
|
|
2217
|
-
themeKey: 'palette'
|
|
2218
|
-
});
|
|
2219
|
-
const borderRightColor = style$1({
|
|
2220
|
-
prop: 'borderRightColor',
|
|
2221
|
-
themeKey: 'palette'
|
|
2222
|
-
});
|
|
2223
|
-
const borderBottomColor = style$1({
|
|
2224
|
-
prop: 'borderBottomColor',
|
|
2225
|
-
themeKey: 'palette'
|
|
2226
|
-
});
|
|
2227
|
-
const borderLeftColor = style$1({
|
|
2228
|
-
prop: 'borderLeftColor',
|
|
2229
|
-
themeKey: 'palette'
|
|
2230
|
-
});
|
|
2231
|
-
|
|
2232
|
-
// false positive
|
|
2233
|
-
// eslint-disable-next-line react/function-component-definition
|
|
2234
|
-
const borderRadius = props => {
|
|
2235
|
-
if (props.borderRadius !== undefined && props.borderRadius !== null) {
|
|
2236
|
-
const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius');
|
|
2237
|
-
const styleFromPropValue = propValue => ({
|
|
2238
|
-
borderRadius: getValue(transformer, propValue)
|
|
2239
|
-
});
|
|
2240
|
-
return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
|
|
2241
|
-
}
|
|
2242
|
-
return null;
|
|
2243
|
-
};
|
|
2244
|
-
borderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
2245
|
-
borderRadius: responsivePropType$1
|
|
2246
|
-
} : {};
|
|
2247
|
-
borderRadius.filterProps = ['borderRadius'];
|
|
2248
|
-
compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius);
|
|
2249
|
-
|
|
2250
|
-
// false positive
|
|
2251
|
-
// eslint-disable-next-line react/function-component-definition
|
|
2252
|
-
const gap = props => {
|
|
2253
|
-
if (props.gap !== undefined && props.gap !== null) {
|
|
2254
|
-
const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap');
|
|
2255
|
-
const styleFromPropValue = propValue => ({
|
|
2256
|
-
gap: getValue(transformer, propValue)
|
|
2257
|
-
});
|
|
2258
|
-
return handleBreakpoints(props, props.gap, styleFromPropValue);
|
|
2259
|
-
}
|
|
2260
|
-
return null;
|
|
2261
|
-
};
|
|
2262
|
-
gap.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
2263
|
-
gap: responsivePropType$1
|
|
2264
|
-
} : {};
|
|
2265
|
-
gap.filterProps = ['gap'];
|
|
2266
|
-
|
|
2267
|
-
// false positive
|
|
2268
|
-
// eslint-disable-next-line react/function-component-definition
|
|
2269
|
-
const columnGap = props => {
|
|
2270
|
-
if (props.columnGap !== undefined && props.columnGap !== null) {
|
|
2271
|
-
const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap');
|
|
2272
|
-
const styleFromPropValue = propValue => ({
|
|
2273
|
-
columnGap: getValue(transformer, propValue)
|
|
2274
|
-
});
|
|
2275
|
-
return handleBreakpoints(props, props.columnGap, styleFromPropValue);
|
|
2276
|
-
}
|
|
2277
|
-
return null;
|
|
2278
|
-
};
|
|
2279
|
-
columnGap.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
2280
|
-
columnGap: responsivePropType$1
|
|
2281
|
-
} : {};
|
|
2282
|
-
columnGap.filterProps = ['columnGap'];
|
|
2283
|
-
|
|
2284
|
-
// false positive
|
|
2285
|
-
// eslint-disable-next-line react/function-component-definition
|
|
2286
|
-
const rowGap = props => {
|
|
2287
|
-
if (props.rowGap !== undefined && props.rowGap !== null) {
|
|
2288
|
-
const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap');
|
|
2289
|
-
const styleFromPropValue = propValue => ({
|
|
2290
|
-
rowGap: getValue(transformer, propValue)
|
|
2291
|
-
});
|
|
2292
|
-
return handleBreakpoints(props, props.rowGap, styleFromPropValue);
|
|
2293
|
-
}
|
|
2294
|
-
return null;
|
|
2295
|
-
};
|
|
2296
|
-
rowGap.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
2297
|
-
rowGap: responsivePropType$1
|
|
2298
|
-
} : {};
|
|
2299
|
-
rowGap.filterProps = ['rowGap'];
|
|
2300
|
-
const gridColumn = style$1({
|
|
2301
|
-
prop: 'gridColumn'
|
|
2302
|
-
});
|
|
2303
|
-
const gridRow = style$1({
|
|
2304
|
-
prop: 'gridRow'
|
|
2305
|
-
});
|
|
2306
|
-
const gridAutoFlow = style$1({
|
|
2307
|
-
prop: 'gridAutoFlow'
|
|
2308
|
-
});
|
|
2309
|
-
const gridAutoColumns = style$1({
|
|
2310
|
-
prop: 'gridAutoColumns'
|
|
2311
|
-
});
|
|
2312
|
-
const gridAutoRows = style$1({
|
|
2313
|
-
prop: 'gridAutoRows'
|
|
2314
|
-
});
|
|
2315
|
-
const gridTemplateColumns = style$1({
|
|
2316
|
-
prop: 'gridTemplateColumns'
|
|
2317
|
-
});
|
|
2318
|
-
const gridTemplateRows = style$1({
|
|
2319
|
-
prop: 'gridTemplateRows'
|
|
2320
|
-
});
|
|
2321
|
-
const gridTemplateAreas = style$1({
|
|
2322
|
-
prop: 'gridTemplateAreas'
|
|
2323
|
-
});
|
|
2324
|
-
const gridArea = style$1({
|
|
2325
|
-
prop: 'gridArea'
|
|
2326
|
-
});
|
|
2327
|
-
compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
|
2328
|
-
|
|
2329
|
-
function paletteTransform(value, userValue) {
|
|
2330
|
-
if (userValue === 'grey') {
|
|
2331
|
-
return userValue;
|
|
2332
|
-
}
|
|
2333
|
-
return value;
|
|
2334
|
-
}
|
|
2335
|
-
const color = style$1({
|
|
2336
|
-
prop: 'color',
|
|
2337
|
-
themeKey: 'palette',
|
|
2338
|
-
transform: paletteTransform
|
|
2339
|
-
});
|
|
2340
|
-
const bgcolor = style$1({
|
|
2341
|
-
prop: 'bgcolor',
|
|
2342
|
-
cssProperty: 'backgroundColor',
|
|
2343
|
-
themeKey: 'palette',
|
|
2344
|
-
transform: paletteTransform
|
|
2345
|
-
});
|
|
2346
|
-
const backgroundColor = style$1({
|
|
2347
|
-
prop: 'backgroundColor',
|
|
2348
|
-
themeKey: 'palette',
|
|
2349
|
-
transform: paletteTransform
|
|
2350
|
-
});
|
|
2351
|
-
compose(color, bgcolor, backgroundColor);
|
|
2352
|
-
|
|
2353
|
-
function sizingTransform(value) {
|
|
2354
|
-
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
2355
|
-
}
|
|
2356
|
-
const width = style$1({
|
|
2357
|
-
prop: 'width',
|
|
2358
|
-
transform: sizingTransform
|
|
2359
|
-
});
|
|
2360
|
-
const maxWidth = props => {
|
|
2361
|
-
if (props.maxWidth !== undefined && props.maxWidth !== null) {
|
|
2362
|
-
const styleFromPropValue = propValue => {
|
|
2363
|
-
var _props$theme, _props$theme$breakpoi, _props$theme$breakpoi2;
|
|
2364
|
-
const breakpoint = ((_props$theme = props.theme) == null ? void 0 : (_props$theme$breakpoi = _props$theme.breakpoints) == null ? void 0 : (_props$theme$breakpoi2 = _props$theme$breakpoi.values) == null ? void 0 : _props$theme$breakpoi2[propValue]) || values[propValue];
|
|
2365
|
-
return {
|
|
2366
|
-
maxWidth: breakpoint || sizingTransform(propValue)
|
|
2367
|
-
};
|
|
2368
|
-
};
|
|
2369
|
-
return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
|
|
2370
|
-
}
|
|
2371
|
-
return null;
|
|
2372
|
-
};
|
|
2373
|
-
maxWidth.filterProps = ['maxWidth'];
|
|
2374
|
-
const minWidth = style$1({
|
|
2375
|
-
prop: 'minWidth',
|
|
2376
|
-
transform: sizingTransform
|
|
2377
|
-
});
|
|
2378
|
-
const height = style$1({
|
|
2379
|
-
prop: 'height',
|
|
2380
|
-
transform: sizingTransform
|
|
2381
|
-
});
|
|
2382
|
-
const maxHeight = style$1({
|
|
2383
|
-
prop: 'maxHeight',
|
|
2384
|
-
transform: sizingTransform
|
|
2385
|
-
});
|
|
2386
|
-
const minHeight = style$1({
|
|
2387
|
-
prop: 'minHeight',
|
|
2388
|
-
transform: sizingTransform
|
|
2389
|
-
});
|
|
2390
|
-
style$1({
|
|
2391
|
-
prop: 'size',
|
|
2392
|
-
cssProperty: 'width',
|
|
2393
|
-
transform: sizingTransform
|
|
2394
|
-
});
|
|
2395
|
-
style$1({
|
|
2396
|
-
prop: 'size',
|
|
2397
|
-
cssProperty: 'height',
|
|
2398
|
-
transform: sizingTransform
|
|
2399
|
-
});
|
|
2400
|
-
const boxSizing = style$1({
|
|
2401
|
-
prop: 'boxSizing'
|
|
2402
|
-
});
|
|
2403
|
-
compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
|
|
2404
|
-
|
|
2405
|
-
const defaultSxConfig = {
|
|
2406
|
-
// borders
|
|
2407
|
-
border: {
|
|
2408
|
-
themeKey: 'borders',
|
|
2409
|
-
transform: borderTransform
|
|
2410
|
-
},
|
|
2411
|
-
borderTop: {
|
|
2412
|
-
themeKey: 'borders',
|
|
2413
|
-
transform: borderTransform
|
|
2414
|
-
},
|
|
2415
|
-
borderRight: {
|
|
2416
|
-
themeKey: 'borders',
|
|
2417
|
-
transform: borderTransform
|
|
2418
|
-
},
|
|
2419
|
-
borderBottom: {
|
|
2420
|
-
themeKey: 'borders',
|
|
2421
|
-
transform: borderTransform
|
|
2422
|
-
},
|
|
2423
|
-
borderLeft: {
|
|
2424
|
-
themeKey: 'borders',
|
|
2425
|
-
transform: borderTransform
|
|
2426
|
-
},
|
|
2427
|
-
borderColor: {
|
|
2428
|
-
themeKey: 'palette'
|
|
2429
|
-
},
|
|
2430
|
-
borderTopColor: {
|
|
2431
|
-
themeKey: 'palette'
|
|
2432
|
-
},
|
|
2433
|
-
borderRightColor: {
|
|
2434
|
-
themeKey: 'palette'
|
|
2435
|
-
},
|
|
2436
|
-
borderBottomColor: {
|
|
2437
|
-
themeKey: 'palette'
|
|
2438
|
-
},
|
|
2439
|
-
borderLeftColor: {
|
|
2440
|
-
themeKey: 'palette'
|
|
2441
|
-
},
|
|
2442
|
-
borderRadius: {
|
|
2443
|
-
themeKey: 'shape.borderRadius',
|
|
2444
|
-
style: borderRadius
|
|
2445
|
-
},
|
|
2446
|
-
// palette
|
|
2447
|
-
color: {
|
|
2448
|
-
themeKey: 'palette',
|
|
2449
|
-
transform: paletteTransform
|
|
2450
|
-
},
|
|
2451
|
-
bgcolor: {
|
|
2452
|
-
themeKey: 'palette',
|
|
2453
|
-
cssProperty: 'backgroundColor',
|
|
2454
|
-
transform: paletteTransform
|
|
2455
|
-
},
|
|
2456
|
-
backgroundColor: {
|
|
2457
|
-
themeKey: 'palette',
|
|
2458
|
-
transform: paletteTransform
|
|
2459
|
-
},
|
|
2460
|
-
// spacing
|
|
2461
|
-
p: {
|
|
2462
|
-
style: padding
|
|
2463
|
-
},
|
|
2464
|
-
pt: {
|
|
2465
|
-
style: padding
|
|
2466
|
-
},
|
|
2467
|
-
pr: {
|
|
2468
|
-
style: padding
|
|
2469
|
-
},
|
|
2470
|
-
pb: {
|
|
2471
|
-
style: padding
|
|
2472
|
-
},
|
|
2473
|
-
pl: {
|
|
2474
|
-
style: padding
|
|
2475
|
-
},
|
|
2476
|
-
px: {
|
|
2477
|
-
style: padding
|
|
2478
|
-
},
|
|
2479
|
-
py: {
|
|
2480
|
-
style: padding
|
|
2481
|
-
},
|
|
2482
|
-
padding: {
|
|
2483
|
-
style: padding
|
|
2484
|
-
},
|
|
2485
|
-
paddingTop: {
|
|
2486
|
-
style: padding
|
|
2487
|
-
},
|
|
2488
|
-
paddingRight: {
|
|
2489
|
-
style: padding
|
|
2490
|
-
},
|
|
2491
|
-
paddingBottom: {
|
|
2492
|
-
style: padding
|
|
2493
|
-
},
|
|
2494
|
-
paddingLeft: {
|
|
2495
|
-
style: padding
|
|
2496
|
-
},
|
|
2497
|
-
paddingX: {
|
|
2498
|
-
style: padding
|
|
2499
|
-
},
|
|
2500
|
-
paddingY: {
|
|
2501
|
-
style: padding
|
|
2502
|
-
},
|
|
2503
|
-
paddingInline: {
|
|
2504
|
-
style: padding
|
|
2505
|
-
},
|
|
2506
|
-
paddingInlineStart: {
|
|
2507
|
-
style: padding
|
|
2508
|
-
},
|
|
2509
|
-
paddingInlineEnd: {
|
|
2510
|
-
style: padding
|
|
2511
|
-
},
|
|
2512
|
-
paddingBlock: {
|
|
2513
|
-
style: padding
|
|
2514
|
-
},
|
|
2515
|
-
paddingBlockStart: {
|
|
2516
|
-
style: padding
|
|
2517
|
-
},
|
|
2518
|
-
paddingBlockEnd: {
|
|
2519
|
-
style: padding
|
|
2520
|
-
},
|
|
2521
|
-
m: {
|
|
2522
|
-
style: margin
|
|
2523
|
-
},
|
|
2524
|
-
mt: {
|
|
2525
|
-
style: margin
|
|
2526
|
-
},
|
|
2527
|
-
mr: {
|
|
2528
|
-
style: margin
|
|
2529
|
-
},
|
|
2530
|
-
mb: {
|
|
2531
|
-
style: margin
|
|
2532
|
-
},
|
|
2533
|
-
ml: {
|
|
2534
|
-
style: margin
|
|
2535
|
-
},
|
|
2536
|
-
mx: {
|
|
2537
|
-
style: margin
|
|
2538
|
-
},
|
|
2539
|
-
my: {
|
|
2540
|
-
style: margin
|
|
2541
|
-
},
|
|
2542
|
-
margin: {
|
|
2543
|
-
style: margin
|
|
2544
|
-
},
|
|
2545
|
-
marginTop: {
|
|
2546
|
-
style: margin
|
|
2547
|
-
},
|
|
2548
|
-
marginRight: {
|
|
2549
|
-
style: margin
|
|
2550
|
-
},
|
|
2551
|
-
marginBottom: {
|
|
2552
|
-
style: margin
|
|
2553
|
-
},
|
|
2554
|
-
marginLeft: {
|
|
2555
|
-
style: margin
|
|
2556
|
-
},
|
|
2557
|
-
marginX: {
|
|
2558
|
-
style: margin
|
|
2559
|
-
},
|
|
2560
|
-
marginY: {
|
|
2561
|
-
style: margin
|
|
2562
|
-
},
|
|
2563
|
-
marginInline: {
|
|
2564
|
-
style: margin
|
|
2565
|
-
},
|
|
2566
|
-
marginInlineStart: {
|
|
2567
|
-
style: margin
|
|
2568
|
-
},
|
|
2569
|
-
marginInlineEnd: {
|
|
2570
|
-
style: margin
|
|
2571
|
-
},
|
|
2572
|
-
marginBlock: {
|
|
2573
|
-
style: margin
|
|
2574
|
-
},
|
|
2575
|
-
marginBlockStart: {
|
|
2576
|
-
style: margin
|
|
2577
|
-
},
|
|
2578
|
-
marginBlockEnd: {
|
|
2579
|
-
style: margin
|
|
2580
|
-
},
|
|
2581
|
-
// display
|
|
2582
|
-
displayPrint: {
|
|
2583
|
-
cssProperty: false,
|
|
2584
|
-
transform: value => ({
|
|
2585
|
-
'@media print': {
|
|
2586
|
-
display: value
|
|
2587
|
-
}
|
|
2588
|
-
})
|
|
2589
|
-
},
|
|
2590
|
-
display: {},
|
|
2591
|
-
overflow: {},
|
|
2592
|
-
textOverflow: {},
|
|
2593
|
-
visibility: {},
|
|
2594
|
-
whiteSpace: {},
|
|
2595
|
-
// flexbox
|
|
2596
|
-
flexBasis: {},
|
|
2597
|
-
flexDirection: {},
|
|
2598
|
-
flexWrap: {},
|
|
2599
|
-
justifyContent: {},
|
|
2600
|
-
alignItems: {},
|
|
2601
|
-
alignContent: {},
|
|
2602
|
-
order: {},
|
|
2603
|
-
flex: {},
|
|
2604
|
-
flexGrow: {},
|
|
2605
|
-
flexShrink: {},
|
|
2606
|
-
alignSelf: {},
|
|
2607
|
-
justifyItems: {},
|
|
2608
|
-
justifySelf: {},
|
|
2609
|
-
// grid
|
|
2610
|
-
gap: {
|
|
2611
|
-
style: gap
|
|
2612
|
-
},
|
|
2613
|
-
rowGap: {
|
|
2614
|
-
style: rowGap
|
|
2615
|
-
},
|
|
2616
|
-
columnGap: {
|
|
2617
|
-
style: columnGap
|
|
2618
|
-
},
|
|
2619
|
-
gridColumn: {},
|
|
2620
|
-
gridRow: {},
|
|
2621
|
-
gridAutoFlow: {},
|
|
2622
|
-
gridAutoColumns: {},
|
|
2623
|
-
gridAutoRows: {},
|
|
2624
|
-
gridTemplateColumns: {},
|
|
2625
|
-
gridTemplateRows: {},
|
|
2626
|
-
gridTemplateAreas: {},
|
|
2627
|
-
gridArea: {},
|
|
2628
|
-
// positions
|
|
2629
|
-
position: {},
|
|
2630
|
-
zIndex: {
|
|
2631
|
-
themeKey: 'zIndex'
|
|
2632
|
-
},
|
|
2633
|
-
top: {},
|
|
2634
|
-
right: {},
|
|
2635
|
-
bottom: {},
|
|
2636
|
-
left: {},
|
|
2637
|
-
// shadows
|
|
2638
|
-
boxShadow: {
|
|
2639
|
-
themeKey: 'shadows'
|
|
2640
|
-
},
|
|
2641
|
-
// sizing
|
|
2642
|
-
width: {
|
|
2643
|
-
transform: sizingTransform
|
|
2644
|
-
},
|
|
2645
|
-
maxWidth: {
|
|
2646
|
-
style: maxWidth
|
|
2647
|
-
},
|
|
2648
|
-
minWidth: {
|
|
2649
|
-
transform: sizingTransform
|
|
2650
|
-
},
|
|
2651
|
-
height: {
|
|
2652
|
-
transform: sizingTransform
|
|
2653
|
-
},
|
|
2654
|
-
maxHeight: {
|
|
2655
|
-
transform: sizingTransform
|
|
2656
|
-
},
|
|
2657
|
-
minHeight: {
|
|
2658
|
-
transform: sizingTransform
|
|
2659
|
-
},
|
|
2660
|
-
boxSizing: {},
|
|
2661
|
-
// typography
|
|
2662
|
-
fontFamily: {
|
|
2663
|
-
themeKey: 'typography'
|
|
2664
|
-
},
|
|
2665
|
-
fontSize: {
|
|
2666
|
-
themeKey: 'typography'
|
|
2667
|
-
},
|
|
2668
|
-
fontStyle: {
|
|
2669
|
-
themeKey: 'typography'
|
|
2670
|
-
},
|
|
2671
|
-
fontWeight: {
|
|
2672
|
-
themeKey: 'typography'
|
|
2673
|
-
},
|
|
2674
|
-
letterSpacing: {},
|
|
2675
|
-
textTransform: {},
|
|
2676
|
-
lineHeight: {},
|
|
2677
|
-
textAlign: {},
|
|
2678
|
-
typography: {
|
|
2679
|
-
cssProperty: false,
|
|
2680
|
-
themeKey: 'typography'
|
|
2681
|
-
}
|
|
2682
|
-
};
|
|
2683
|
-
var defaultSxConfig$1 = defaultSxConfig;
|
|
2684
|
-
|
|
2685
|
-
function objectsHaveSameKeys(...objects) {
|
|
2686
|
-
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
2687
|
-
const union = new Set(allKeys);
|
|
2688
|
-
return objects.every(object => union.size === Object.keys(object).length);
|
|
2689
|
-
}
|
|
2690
|
-
function callIfFn(maybeFn, arg) {
|
|
2691
|
-
return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;
|
|
2692
|
-
}
|
|
2693
|
-
|
|
2694
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2695
|
-
function unstable_createStyleFunctionSx() {
|
|
2696
|
-
function getThemeValue(prop, val, theme, config) {
|
|
2697
|
-
const props = {
|
|
2698
|
-
[prop]: val,
|
|
2699
|
-
theme
|
|
2700
|
-
};
|
|
2701
|
-
const options = config[prop];
|
|
2702
|
-
if (!options) {
|
|
2703
|
-
return {
|
|
2704
|
-
[prop]: val
|
|
2705
|
-
};
|
|
2706
|
-
}
|
|
2707
|
-
const {
|
|
2708
|
-
cssProperty = prop,
|
|
2709
|
-
themeKey,
|
|
2710
|
-
transform,
|
|
2711
|
-
style
|
|
2712
|
-
} = options;
|
|
2713
|
-
if (val == null) {
|
|
2714
|
-
return null;
|
|
2715
|
-
}
|
|
2716
|
-
if (themeKey === 'typography' && val === 'inherit') {
|
|
2717
|
-
return {
|
|
2718
|
-
[prop]: val
|
|
2719
|
-
};
|
|
2720
|
-
}
|
|
2721
|
-
const themeMapping = getPath(theme, themeKey) || {};
|
|
2722
|
-
if (style) {
|
|
2723
|
-
return style(props);
|
|
2724
|
-
}
|
|
2725
|
-
const styleFromPropValue = propValueFinal => {
|
|
2726
|
-
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
2727
|
-
if (propValueFinal === value && typeof propValueFinal === 'string') {
|
|
2728
|
-
// Haven't found value
|
|
2729
|
-
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);
|
|
2730
|
-
}
|
|
2731
|
-
if (cssProperty === false) {
|
|
2732
|
-
return value;
|
|
2733
|
-
}
|
|
2734
|
-
return {
|
|
2735
|
-
[cssProperty]: value
|
|
2736
|
-
};
|
|
2737
|
-
};
|
|
2738
|
-
return handleBreakpoints(props, val, styleFromPropValue);
|
|
2739
|
-
}
|
|
2740
|
-
function styleFunctionSx(props) {
|
|
2741
|
-
var _theme$unstable_sxCon;
|
|
2742
|
-
const {
|
|
2743
|
-
sx,
|
|
2744
|
-
theme = {}
|
|
2745
|
-
} = props || {};
|
|
2746
|
-
if (!sx) {
|
|
2747
|
-
return null; // Emotion & styled-components will neglect null
|
|
2748
|
-
}
|
|
2749
|
-
|
|
2750
|
-
const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig$1;
|
|
2751
|
-
|
|
2752
|
-
/*
|
|
2753
|
-
* Receive `sxInput` as object or callback
|
|
2754
|
-
* and then recursively check keys & values to create media query object styles.
|
|
2755
|
-
* (the result will be used in `styled`)
|
|
2756
|
-
*/
|
|
2757
|
-
function traverse(sxInput) {
|
|
2758
|
-
let sxObject = sxInput;
|
|
2759
|
-
if (typeof sxInput === 'function') {
|
|
2760
|
-
sxObject = sxInput(theme);
|
|
2761
|
-
} else if (typeof sxInput !== 'object') {
|
|
2762
|
-
// value
|
|
2763
|
-
return sxInput;
|
|
2764
|
-
}
|
|
2765
|
-
if (!sxObject) {
|
|
2766
|
-
return null;
|
|
2767
|
-
}
|
|
2768
|
-
const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
|
|
2769
|
-
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
2770
|
-
let css = emptyBreakpoints;
|
|
2771
|
-
Object.keys(sxObject).forEach(styleKey => {
|
|
2772
|
-
const value = callIfFn(sxObject[styleKey], theme);
|
|
2773
|
-
if (value !== null && value !== undefined) {
|
|
2774
|
-
if (typeof value === 'object') {
|
|
2775
|
-
if (config[styleKey]) {
|
|
2776
|
-
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
2777
|
-
} else {
|
|
2778
|
-
const breakpointsValues = handleBreakpoints({
|
|
2779
|
-
theme
|
|
2780
|
-
}, value, x => ({
|
|
2781
|
-
[styleKey]: x
|
|
2782
|
-
}));
|
|
2783
|
-
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
2784
|
-
css[styleKey] = styleFunctionSx({
|
|
2785
|
-
sx: value,
|
|
2786
|
-
theme
|
|
2787
|
-
});
|
|
2788
|
-
} else {
|
|
2789
|
-
css = merge(css, breakpointsValues);
|
|
2790
|
-
}
|
|
2791
|
-
}
|
|
2792
|
-
} else {
|
|
2793
|
-
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
2794
|
-
}
|
|
2795
|
-
}
|
|
2796
|
-
});
|
|
2797
|
-
return removeUnusedBreakpoints(breakpointsKeys, css);
|
|
2798
|
-
}
|
|
2799
|
-
return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
|
|
2800
|
-
}
|
|
2801
|
-
return styleFunctionSx;
|
|
2802
|
-
}
|
|
2803
|
-
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
2804
|
-
styleFunctionSx.filterProps = ['sx'];
|
|
2805
|
-
var styleFunctionSx$1 = styleFunctionSx;
|
|
2806
|
-
|
|
2807
|
-
const _excluded$7 = ["breakpoints", "palette", "spacing", "shape"];
|
|
2808
|
-
function createTheme$1(options = {}, ...args) {
|
|
2809
|
-
const {
|
|
2810
|
-
breakpoints: breakpointsInput = {},
|
|
2811
|
-
palette: paletteInput = {},
|
|
2812
|
-
spacing: spacingInput,
|
|
2813
|
-
shape: shapeInput = {}
|
|
2814
|
-
} = options,
|
|
2815
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$7);
|
|
2816
|
-
const breakpoints = createBreakpoints(breakpointsInput);
|
|
2817
|
-
const spacing = createSpacing(spacingInput);
|
|
2818
|
-
let muiTheme = deepmerge({
|
|
2819
|
-
breakpoints,
|
|
2820
|
-
direction: 'ltr',
|
|
2821
|
-
components: {},
|
|
2822
|
-
// Inject component definitions.
|
|
2823
|
-
palette: _extends({
|
|
2824
|
-
mode: 'light'
|
|
2825
|
-
}, paletteInput),
|
|
2826
|
-
spacing,
|
|
2827
|
-
shape: _extends({}, shape$1, shapeInput)
|
|
2828
|
-
}, other);
|
|
2829
|
-
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
2830
|
-
muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
|
|
2831
|
-
muiTheme.unstable_sx = function sx(props) {
|
|
2832
|
-
return styleFunctionSx$1({
|
|
2833
|
-
sx: props,
|
|
2834
|
-
theme: this
|
|
2835
|
-
});
|
|
2836
|
-
};
|
|
2837
|
-
return muiTheme;
|
|
2838
|
-
}
|
|
2839
|
-
|
|
2840
|
-
function isObjectEmpty(obj) {
|
|
2841
|
-
return Object.keys(obj).length === 0;
|
|
2842
|
-
}
|
|
2843
|
-
function useTheme$1(defaultTheme = null) {
|
|
2844
|
-
const contextTheme = React.useContext(ThemeContext);
|
|
2845
|
-
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
2846
|
-
}
|
|
2847
|
-
|
|
2848
|
-
const systemDefaultTheme$1 = createTheme$1();
|
|
2849
|
-
function useTheme(defaultTheme = systemDefaultTheme$1) {
|
|
2850
|
-
return useTheme$1(defaultTheme);
|
|
2851
|
-
}
|
|
2852
|
-
|
|
2853
|
-
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
2854
|
-
|
|
2855
|
-
const _excluded$6 = ["variant"];
|
|
2856
|
-
function isEmpty$1(string) {
|
|
2857
|
-
return string.length === 0;
|
|
2858
|
-
}
|
|
2859
|
-
|
|
2860
|
-
/**
|
|
2861
|
-
* Generates string classKey based on the properties provided. It starts with the
|
|
2862
|
-
* variant if defined, and then it appends all other properties in alphabetical order.
|
|
2863
|
-
* @param {object} props - the properties for which the classKey should be created.
|
|
2864
|
-
*/
|
|
2865
|
-
function propsToClassKey(props) {
|
|
2866
|
-
const {
|
|
2867
|
-
variant
|
|
2868
|
-
} = props,
|
|
2869
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$6);
|
|
2870
|
-
let classKey = variant || '';
|
|
2871
|
-
Object.keys(other).sort().forEach(key => {
|
|
2872
|
-
if (key === 'color') {
|
|
2873
|
-
classKey += isEmpty$1(classKey) ? props[key] : capitalize(props[key]);
|
|
2874
|
-
} else {
|
|
2875
|
-
classKey += `${isEmpty$1(classKey) ? key : capitalize(key)}${capitalize(props[key].toString())}`;
|
|
2876
|
-
}
|
|
2877
|
-
});
|
|
2878
|
-
return classKey;
|
|
2879
|
-
}
|
|
2880
|
-
|
|
2881
|
-
const _excluded$5 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
2882
|
-
function isEmpty(obj) {
|
|
2883
|
-
return Object.keys(obj).length === 0;
|
|
2884
|
-
}
|
|
2885
|
-
|
|
2886
|
-
// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40
|
|
2887
|
-
function isStringTag(tag) {
|
|
2888
|
-
return typeof tag === 'string' &&
|
|
2889
|
-
// 96 is one less than the char code
|
|
2890
|
-
// for "a" so this is checking that
|
|
2891
|
-
// it's a lowercase character
|
|
2892
|
-
tag.charCodeAt(0) > 96;
|
|
2893
|
-
}
|
|
2894
|
-
const getStyleOverrides = (name, theme) => {
|
|
2895
|
-
if (theme.components && theme.components[name] && theme.components[name].styleOverrides) {
|
|
2896
|
-
return theme.components[name].styleOverrides;
|
|
2897
|
-
}
|
|
2898
|
-
return null;
|
|
2899
|
-
};
|
|
2900
|
-
const getVariantStyles = (name, theme) => {
|
|
2901
|
-
let variants = [];
|
|
2902
|
-
if (theme && theme.components && theme.components[name] && theme.components[name].variants) {
|
|
2903
|
-
variants = theme.components[name].variants;
|
|
2904
|
-
}
|
|
2905
|
-
const variantsStyles = {};
|
|
2906
|
-
variants.forEach(definition => {
|
|
2907
|
-
const key = propsToClassKey(definition.props);
|
|
2908
|
-
variantsStyles[key] = definition.style;
|
|
2909
|
-
});
|
|
2910
|
-
return variantsStyles;
|
|
2911
|
-
};
|
|
2912
|
-
const variantsResolver = (props, styles, theme, name) => {
|
|
2913
|
-
var _theme$components, _theme$components$nam;
|
|
2914
|
-
const {
|
|
2915
|
-
ownerState = {}
|
|
2916
|
-
} = props;
|
|
2917
|
-
const variantsStyles = [];
|
|
2918
|
-
const themeVariants = theme == null ? void 0 : (_theme$components = theme.components) == null ? void 0 : (_theme$components$nam = _theme$components[name]) == null ? void 0 : _theme$components$nam.variants;
|
|
2919
|
-
if (themeVariants) {
|
|
2920
|
-
themeVariants.forEach(themeVariant => {
|
|
2921
|
-
let isMatch = true;
|
|
2922
|
-
Object.keys(themeVariant.props).forEach(key => {
|
|
2923
|
-
if (ownerState[key] !== themeVariant.props[key] && props[key] !== themeVariant.props[key]) {
|
|
2924
|
-
isMatch = false;
|
|
2925
|
-
}
|
|
2926
|
-
});
|
|
2927
|
-
if (isMatch) {
|
|
2928
|
-
variantsStyles.push(styles[propsToClassKey(themeVariant.props)]);
|
|
2929
|
-
}
|
|
2930
|
-
});
|
|
2931
|
-
}
|
|
2932
|
-
return variantsStyles;
|
|
2933
|
-
};
|
|
2934
|
-
|
|
2935
|
-
// Update /system/styled/#api in case if this changes
|
|
2936
|
-
function shouldForwardProp(prop) {
|
|
2937
|
-
return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
|
|
2938
|
-
}
|
|
2939
|
-
const systemDefaultTheme = createTheme$1();
|
|
2940
|
-
const lowercaseFirstLetter = string => {
|
|
2941
|
-
return string.charAt(0).toLowerCase() + string.slice(1);
|
|
2942
|
-
};
|
|
2943
|
-
function resolveTheme({
|
|
2944
|
-
defaultTheme,
|
|
2945
|
-
theme,
|
|
2946
|
-
themeId
|
|
2947
|
-
}) {
|
|
2948
|
-
return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;
|
|
2949
|
-
}
|
|
2950
|
-
function createStyled(input = {}) {
|
|
2951
|
-
const {
|
|
2952
|
-
themeId,
|
|
2953
|
-
defaultTheme = systemDefaultTheme,
|
|
2954
|
-
rootShouldForwardProp = shouldForwardProp,
|
|
2955
|
-
slotShouldForwardProp = shouldForwardProp
|
|
2956
|
-
} = input;
|
|
2957
|
-
const systemSx = props => {
|
|
2958
|
-
return styleFunctionSx$1(_extends({}, props, {
|
|
2959
|
-
theme: resolveTheme(_extends({}, props, {
|
|
2960
|
-
defaultTheme,
|
|
2961
|
-
themeId
|
|
2962
|
-
}))
|
|
2963
|
-
}));
|
|
2964
|
-
};
|
|
2965
|
-
systemSx.__mui_systemSx = true;
|
|
2966
|
-
return (tag, inputOptions = {}) => {
|
|
2967
|
-
// Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.
|
|
2968
|
-
internal_processStyles(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));
|
|
2969
|
-
const {
|
|
2970
|
-
name: componentName,
|
|
2971
|
-
slot: componentSlot,
|
|
2972
|
-
skipVariantsResolver: inputSkipVariantsResolver,
|
|
2973
|
-
skipSx: inputSkipSx,
|
|
2974
|
-
overridesResolver
|
|
2975
|
-
} = inputOptions,
|
|
2976
|
-
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$5);
|
|
2977
|
-
|
|
2978
|
-
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
2979
|
-
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
|
|
2980
|
-
const skipSx = inputSkipSx || false;
|
|
2981
|
-
let label;
|
|
2982
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2983
|
-
if (componentName) {
|
|
2984
|
-
label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;
|
|
2985
|
-
}
|
|
2986
|
-
}
|
|
2987
|
-
let shouldForwardPropOption = shouldForwardProp;
|
|
2988
|
-
if (componentSlot === 'Root') {
|
|
2989
|
-
shouldForwardPropOption = rootShouldForwardProp;
|
|
2990
|
-
} else if (componentSlot) {
|
|
2991
|
-
// any other slot specified
|
|
2992
|
-
shouldForwardPropOption = slotShouldForwardProp;
|
|
2993
|
-
} else if (isStringTag(tag)) {
|
|
2994
|
-
// for string (html) tag, preserve the behavior in emotion & styled-components.
|
|
2995
|
-
shouldForwardPropOption = undefined;
|
|
2996
|
-
}
|
|
2997
|
-
const defaultStyledResolver = styled$2(tag, _extends({
|
|
2998
|
-
shouldForwardProp: shouldForwardPropOption,
|
|
2999
|
-
label
|
|
3000
|
-
}, options));
|
|
3001
|
-
const muiStyledResolver = (styleArg, ...expressions) => {
|
|
3002
|
-
const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => {
|
|
3003
|
-
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
3004
|
-
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
3005
|
-
// which are basically components used as a selectors.
|
|
3006
|
-
return typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg ? props => {
|
|
3007
|
-
return stylesArg(_extends({}, props, {
|
|
3008
|
-
theme: resolveTheme(_extends({}, props, {
|
|
3009
|
-
defaultTheme,
|
|
3010
|
-
themeId
|
|
3011
|
-
}))
|
|
3012
|
-
}));
|
|
3013
|
-
} : stylesArg;
|
|
3014
|
-
}) : [];
|
|
3015
|
-
let transformedStyleArg = styleArg;
|
|
3016
|
-
if (componentName && overridesResolver) {
|
|
3017
|
-
expressionsWithDefaultTheme.push(props => {
|
|
3018
|
-
const theme = resolveTheme(_extends({}, props, {
|
|
3019
|
-
defaultTheme,
|
|
3020
|
-
themeId
|
|
3021
|
-
}));
|
|
3022
|
-
const styleOverrides = getStyleOverrides(componentName, theme);
|
|
3023
|
-
if (styleOverrides) {
|
|
3024
|
-
const resolvedStyleOverrides = {};
|
|
3025
|
-
Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
|
|
3026
|
-
resolvedStyleOverrides[slotKey] = typeof slotStyle === 'function' ? slotStyle(_extends({}, props, {
|
|
3027
|
-
theme
|
|
3028
|
-
})) : slotStyle;
|
|
3029
|
-
});
|
|
3030
|
-
return overridesResolver(props, resolvedStyleOverrides);
|
|
3031
|
-
}
|
|
3032
|
-
return null;
|
|
3033
|
-
});
|
|
3034
|
-
}
|
|
3035
|
-
if (componentName && !skipVariantsResolver) {
|
|
3036
|
-
expressionsWithDefaultTheme.push(props => {
|
|
3037
|
-
const theme = resolveTheme(_extends({}, props, {
|
|
3038
|
-
defaultTheme,
|
|
3039
|
-
themeId
|
|
3040
|
-
}));
|
|
3041
|
-
return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);
|
|
3042
|
-
});
|
|
3043
|
-
}
|
|
3044
|
-
if (!skipSx) {
|
|
3045
|
-
expressionsWithDefaultTheme.push(systemSx);
|
|
3046
|
-
}
|
|
3047
|
-
const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
|
|
3048
|
-
if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
|
|
3049
|
-
const placeholders = new Array(numOfCustomFnsApplied).fill('');
|
|
3050
|
-
// If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.
|
|
3051
|
-
transformedStyleArg = [...styleArg, ...placeholders];
|
|
3052
|
-
transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
|
|
3053
|
-
} else if (typeof styleArg === 'function' &&
|
|
3054
|
-
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
3055
|
-
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
3056
|
-
// which are basically components used as a selectors.
|
|
3057
|
-
styleArg.__emotion_real !== styleArg) {
|
|
3058
|
-
// If the type is function, we need to define the default theme.
|
|
3059
|
-
transformedStyleArg = props => styleArg(_extends({}, props, {
|
|
3060
|
-
theme: resolveTheme(_extends({}, props, {
|
|
3061
|
-
defaultTheme,
|
|
3062
|
-
themeId
|
|
3063
|
-
}))
|
|
3064
|
-
}));
|
|
3065
|
-
}
|
|
3066
|
-
const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
|
|
3067
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3068
|
-
let displayName;
|
|
3069
|
-
if (componentName) {
|
|
3070
|
-
displayName = `${componentName}${componentSlot || ''}`;
|
|
3071
|
-
}
|
|
3072
|
-
if (displayName === undefined) {
|
|
3073
|
-
displayName = `Styled(${getDisplayName(tag)})`;
|
|
3074
|
-
}
|
|
3075
|
-
Component.displayName = displayName;
|
|
3076
|
-
}
|
|
3077
|
-
if (tag.muiName) {
|
|
3078
|
-
Component.muiName = tag.muiName;
|
|
3079
|
-
}
|
|
3080
|
-
return Component;
|
|
3081
|
-
};
|
|
3082
|
-
if (defaultStyledResolver.withConfig) {
|
|
3083
|
-
muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
|
|
3084
|
-
}
|
|
3085
|
-
return muiStyledResolver;
|
|
3086
|
-
};
|
|
3087
|
-
}
|
|
3088
|
-
|
|
3089
|
-
function getThemeProps(params) {
|
|
3090
|
-
const {
|
|
3091
|
-
theme,
|
|
3092
|
-
name,
|
|
3093
|
-
props
|
|
3094
|
-
} = params;
|
|
3095
|
-
if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
|
|
3096
|
-
return props;
|
|
3097
|
-
}
|
|
3098
|
-
return resolveProps(theme.components[name].defaultProps, props);
|
|
3099
|
-
}
|
|
3100
|
-
|
|
3101
|
-
function useThemeProps$1({
|
|
3102
|
-
props,
|
|
3103
|
-
name,
|
|
3104
|
-
defaultTheme,
|
|
3105
|
-
themeId
|
|
3106
|
-
}) {
|
|
3107
|
-
let theme = useTheme(defaultTheme);
|
|
3108
|
-
if (themeId) {
|
|
3109
|
-
theme = theme[themeId] || theme;
|
|
3110
|
-
}
|
|
3111
|
-
const mergedProps = getThemeProps({
|
|
3112
|
-
theme,
|
|
3113
|
-
name,
|
|
3114
|
-
props
|
|
3115
|
-
});
|
|
3116
|
-
return mergedProps;
|
|
3117
|
-
}
|
|
3118
|
-
|
|
3119
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3120
|
-
/**
|
|
3121
|
-
* Returns a number whose value is limited to the given range.
|
|
3122
|
-
* @param {number} value The value to be clamped
|
|
3123
|
-
* @param {number} min The lower boundary of the output range
|
|
3124
|
-
* @param {number} max The upper boundary of the output range
|
|
3125
|
-
* @returns {number} A number in the range [min, max]
|
|
3126
|
-
*/
|
|
3127
|
-
function clamp(value, min = 0, max = 1) {
|
|
3128
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3129
|
-
if (value < min || value > max) {
|
|
3130
|
-
console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);
|
|
3131
|
-
}
|
|
3132
|
-
}
|
|
3133
|
-
return Math.min(Math.max(min, value), max);
|
|
3134
|
-
}
|
|
3135
|
-
|
|
3136
|
-
/**
|
|
3137
|
-
* Converts a color from CSS hex format to CSS rgb format.
|
|
3138
|
-
* @param {string} color - Hex color, i.e. #nnn or #nnnnnn
|
|
3139
|
-
* @returns {string} A CSS rgb color string
|
|
3140
|
-
*/
|
|
3141
|
-
function hexToRgb(color) {
|
|
3142
|
-
color = color.slice(1);
|
|
3143
|
-
const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');
|
|
3144
|
-
let colors = color.match(re);
|
|
3145
|
-
if (colors && colors[0].length === 1) {
|
|
3146
|
-
colors = colors.map(n => n + n);
|
|
3147
|
-
}
|
|
3148
|
-
return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {
|
|
3149
|
-
return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;
|
|
3150
|
-
}).join(', ')})` : '';
|
|
3151
|
-
}
|
|
3152
|
-
|
|
3153
|
-
/**
|
|
3154
|
-
* Returns an object with the type and values of a color.
|
|
3155
|
-
*
|
|
3156
|
-
* Note: Does not support rgb % values.
|
|
3157
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
3158
|
-
* @returns {object} - A MUI color object: {type: string, values: number[]}
|
|
3159
|
-
*/
|
|
3160
|
-
function decomposeColor(color) {
|
|
3161
|
-
// Idempotent
|
|
3162
|
-
if (color.type) {
|
|
3163
|
-
return color;
|
|
3164
|
-
}
|
|
3165
|
-
if (color.charAt(0) === '#') {
|
|
3166
|
-
return decomposeColor(hexToRgb(color));
|
|
3167
|
-
}
|
|
3168
|
-
const marker = color.indexOf('(');
|
|
3169
|
-
const type = color.substring(0, marker);
|
|
3170
|
-
if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {
|
|
3171
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported \`${color}\` color.
|
|
3172
|
-
The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : formatMuiErrorMessage(9, color));
|
|
3173
|
-
}
|
|
3174
|
-
let values = color.substring(marker + 1, color.length - 1);
|
|
3175
|
-
let colorSpace;
|
|
3176
|
-
if (type === 'color') {
|
|
3177
|
-
values = values.split(' ');
|
|
3178
|
-
colorSpace = values.shift();
|
|
3179
|
-
if (values.length === 4 && values[3].charAt(0) === '/') {
|
|
3180
|
-
values[3] = values[3].slice(1);
|
|
3181
|
-
}
|
|
3182
|
-
if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {
|
|
3183
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: unsupported \`${colorSpace}\` color space.
|
|
3184
|
-
The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : formatMuiErrorMessage(10, colorSpace));
|
|
3185
|
-
}
|
|
3186
|
-
} else {
|
|
3187
|
-
values = values.split(',');
|
|
3188
|
-
}
|
|
3189
|
-
values = values.map(value => parseFloat(value));
|
|
3190
|
-
return {
|
|
3191
|
-
type,
|
|
3192
|
-
values,
|
|
3193
|
-
colorSpace
|
|
3194
|
-
};
|
|
3195
|
-
}
|
|
3196
|
-
|
|
3197
|
-
/**
|
|
3198
|
-
* Converts a color object with type and values to a string.
|
|
3199
|
-
* @param {object} color - Decomposed color
|
|
3200
|
-
* @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'
|
|
3201
|
-
* @param {array} color.values - [n,n,n] or [n,n,n,n]
|
|
3202
|
-
* @returns {string} A CSS color string
|
|
3203
|
-
*/
|
|
3204
|
-
function recomposeColor(color) {
|
|
3205
|
-
const {
|
|
3206
|
-
type,
|
|
3207
|
-
colorSpace
|
|
3208
|
-
} = color;
|
|
3209
|
-
let {
|
|
3210
|
-
values
|
|
3211
|
-
} = color;
|
|
3212
|
-
if (type.indexOf('rgb') !== -1) {
|
|
3213
|
-
// Only convert the first 3 values to int (i.e. not alpha)
|
|
3214
|
-
values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);
|
|
3215
|
-
} else if (type.indexOf('hsl') !== -1) {
|
|
3216
|
-
values[1] = `${values[1]}%`;
|
|
3217
|
-
values[2] = `${values[2]}%`;
|
|
3218
|
-
}
|
|
3219
|
-
if (type.indexOf('color') !== -1) {
|
|
3220
|
-
values = `${colorSpace} ${values.join(' ')}`;
|
|
3221
|
-
} else {
|
|
3222
|
-
values = `${values.join(', ')}`;
|
|
3223
|
-
}
|
|
3224
|
-
return `${type}(${values})`;
|
|
3225
|
-
}
|
|
3226
|
-
|
|
3227
|
-
/**
|
|
3228
|
-
* Converts a color from hsl format to rgb format.
|
|
3229
|
-
* @param {string} color - HSL color values
|
|
3230
|
-
* @returns {string} rgb color values
|
|
3231
|
-
*/
|
|
3232
|
-
function hslToRgb(color) {
|
|
3233
|
-
color = decomposeColor(color);
|
|
3234
|
-
const {
|
|
3235
|
-
values
|
|
3236
|
-
} = color;
|
|
3237
|
-
const h = values[0];
|
|
3238
|
-
const s = values[1] / 100;
|
|
3239
|
-
const l = values[2] / 100;
|
|
3240
|
-
const a = s * Math.min(l, 1 - l);
|
|
3241
|
-
const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
3242
|
-
let type = 'rgb';
|
|
3243
|
-
const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
|
|
3244
|
-
if (color.type === 'hsla') {
|
|
3245
|
-
type += 'a';
|
|
3246
|
-
rgb.push(values[3]);
|
|
3247
|
-
}
|
|
3248
|
-
return recomposeColor({
|
|
3249
|
-
type,
|
|
3250
|
-
values: rgb
|
|
3251
|
-
});
|
|
3252
|
-
}
|
|
3253
|
-
/**
|
|
3254
|
-
* The relative brightness of any point in a color space,
|
|
3255
|
-
* normalized to 0 for darkest black and 1 for lightest white.
|
|
3256
|
-
*
|
|
3257
|
-
* Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
3258
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
3259
|
-
* @returns {number} The relative brightness of the color in the range 0 - 1
|
|
3260
|
-
*/
|
|
3261
|
-
function getLuminance(color) {
|
|
3262
|
-
color = decomposeColor(color);
|
|
3263
|
-
let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;
|
|
3264
|
-
rgb = rgb.map(val => {
|
|
3265
|
-
if (color.type !== 'color') {
|
|
3266
|
-
val /= 255; // normalized
|
|
3267
|
-
}
|
|
3268
|
-
|
|
3269
|
-
return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;
|
|
3270
|
-
});
|
|
3271
|
-
|
|
3272
|
-
// Truncate at 3 digits
|
|
3273
|
-
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
|
|
3274
|
-
}
|
|
3275
|
-
|
|
3276
|
-
/**
|
|
3277
|
-
* Calculates the contrast ratio between two colors.
|
|
3278
|
-
*
|
|
3279
|
-
* Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
3280
|
-
* @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
|
3281
|
-
* @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
|
3282
|
-
* @returns {number} A contrast ratio value in the range 0 - 21.
|
|
3283
|
-
*/
|
|
3284
|
-
function getContrastRatio(foreground, background) {
|
|
3285
|
-
const lumA = getLuminance(foreground);
|
|
3286
|
-
const lumB = getLuminance(background);
|
|
3287
|
-
return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
|
|
3288
|
-
}
|
|
3289
|
-
|
|
3290
|
-
/**
|
|
3291
|
-
* Sets the absolute transparency of a color.
|
|
3292
|
-
* Any existing alpha values are overwritten.
|
|
3293
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
3294
|
-
* @param {number} value - value to set the alpha channel to in the range 0 - 1
|
|
3295
|
-
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
3296
|
-
*/
|
|
3297
|
-
function alpha(color, value) {
|
|
3298
|
-
color = decomposeColor(color);
|
|
3299
|
-
value = clamp(value);
|
|
3300
|
-
if (color.type === 'rgb' || color.type === 'hsl') {
|
|
3301
|
-
color.type += 'a';
|
|
3302
|
-
}
|
|
3303
|
-
if (color.type === 'color') {
|
|
3304
|
-
color.values[3] = `/${value}`;
|
|
3305
|
-
} else {
|
|
3306
|
-
color.values[3] = value;
|
|
3307
|
-
}
|
|
3308
|
-
return recomposeColor(color);
|
|
3309
|
-
}
|
|
3310
|
-
|
|
3311
|
-
/**
|
|
3312
|
-
* Darkens a color.
|
|
3313
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
3314
|
-
* @param {number} coefficient - multiplier in the range 0 - 1
|
|
3315
|
-
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
3316
|
-
*/
|
|
3317
|
-
function darken(color, coefficient) {
|
|
3318
|
-
color = decomposeColor(color);
|
|
3319
|
-
coefficient = clamp(coefficient);
|
|
3320
|
-
if (color.type.indexOf('hsl') !== -1) {
|
|
3321
|
-
color.values[2] *= 1 - coefficient;
|
|
3322
|
-
} else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {
|
|
3323
|
-
for (let i = 0; i < 3; i += 1) {
|
|
3324
|
-
color.values[i] *= 1 - coefficient;
|
|
3325
|
-
}
|
|
3326
|
-
}
|
|
3327
|
-
return recomposeColor(color);
|
|
3328
|
-
}
|
|
3329
|
-
|
|
3330
|
-
/**
|
|
3331
|
-
* Lightens a color.
|
|
3332
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
3333
|
-
* @param {number} coefficient - multiplier in the range 0 - 1
|
|
3334
|
-
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
3335
|
-
*/
|
|
3336
|
-
function lighten(color, coefficient) {
|
|
3337
|
-
color = decomposeColor(color);
|
|
3338
|
-
coefficient = clamp(coefficient);
|
|
3339
|
-
if (color.type.indexOf('hsl') !== -1) {
|
|
3340
|
-
color.values[2] += (100 - color.values[2]) * coefficient;
|
|
3341
|
-
} else if (color.type.indexOf('rgb') !== -1) {
|
|
3342
|
-
for (let i = 0; i < 3; i += 1) {
|
|
3343
|
-
color.values[i] += (255 - color.values[i]) * coefficient;
|
|
3344
|
-
}
|
|
3345
|
-
} else if (color.type.indexOf('color') !== -1) {
|
|
3346
|
-
for (let i = 0; i < 3; i += 1) {
|
|
3347
|
-
color.values[i] += (1 - color.values[i]) * coefficient;
|
|
3348
|
-
}
|
|
3349
|
-
}
|
|
3350
|
-
return recomposeColor(color);
|
|
3351
|
-
}
|
|
3352
|
-
|
|
3353
|
-
var THEME_ID = '$$material';
|
|
3354
|
-
|
|
3355
|
-
function createMixins(breakpoints, mixins) {
|
|
3356
|
-
return _extends({
|
|
3357
|
-
toolbar: {
|
|
3358
|
-
minHeight: 56,
|
|
3359
|
-
[breakpoints.up('xs')]: {
|
|
3360
|
-
'@media (orientation: landscape)': {
|
|
3361
|
-
minHeight: 48
|
|
3362
|
-
}
|
|
3363
|
-
},
|
|
3364
|
-
[breakpoints.up('sm')]: {
|
|
3365
|
-
minHeight: 64
|
|
3366
|
-
}
|
|
3367
|
-
}
|
|
3368
|
-
}, mixins);
|
|
3369
|
-
}
|
|
3370
|
-
|
|
3371
|
-
const common = {
|
|
3372
|
-
black: '#000',
|
|
3373
|
-
white: '#fff'
|
|
3374
|
-
};
|
|
3375
|
-
var common$1 = common;
|
|
3376
|
-
|
|
3377
|
-
const grey = {
|
|
3378
|
-
50: '#fafafa',
|
|
3379
|
-
100: '#f5f5f5',
|
|
3380
|
-
200: '#eeeeee',
|
|
3381
|
-
300: '#e0e0e0',
|
|
3382
|
-
400: '#bdbdbd',
|
|
3383
|
-
500: '#9e9e9e',
|
|
3384
|
-
600: '#757575',
|
|
3385
|
-
700: '#616161',
|
|
3386
|
-
800: '#424242',
|
|
3387
|
-
900: '#212121',
|
|
3388
|
-
A100: '#f5f5f5',
|
|
3389
|
-
A200: '#eeeeee',
|
|
3390
|
-
A400: '#bdbdbd',
|
|
3391
|
-
A700: '#616161'
|
|
3392
|
-
};
|
|
3393
|
-
var grey$1 = grey;
|
|
3394
|
-
|
|
3395
|
-
const purple = {
|
|
3396
|
-
50: '#f3e5f5',
|
|
3397
|
-
100: '#e1bee7',
|
|
3398
|
-
200: '#ce93d8',
|
|
3399
|
-
300: '#ba68c8',
|
|
3400
|
-
400: '#ab47bc',
|
|
3401
|
-
500: '#9c27b0',
|
|
3402
|
-
600: '#8e24aa',
|
|
3403
|
-
700: '#7b1fa2',
|
|
3404
|
-
800: '#6a1b9a',
|
|
3405
|
-
900: '#4a148c',
|
|
3406
|
-
A100: '#ea80fc',
|
|
3407
|
-
A200: '#e040fb',
|
|
3408
|
-
A400: '#d500f9',
|
|
3409
|
-
A700: '#aa00ff'
|
|
3410
|
-
};
|
|
3411
|
-
var purple$1 = purple;
|
|
3412
|
-
|
|
3413
|
-
const red = {
|
|
3414
|
-
50: '#ffebee',
|
|
3415
|
-
100: '#ffcdd2',
|
|
3416
|
-
200: '#ef9a9a',
|
|
3417
|
-
300: '#e57373',
|
|
3418
|
-
400: '#ef5350',
|
|
3419
|
-
500: '#f44336',
|
|
3420
|
-
600: '#e53935',
|
|
3421
|
-
700: '#d32f2f',
|
|
3422
|
-
800: '#c62828',
|
|
3423
|
-
900: '#b71c1c',
|
|
3424
|
-
A100: '#ff8a80',
|
|
3425
|
-
A200: '#ff5252',
|
|
3426
|
-
A400: '#ff1744',
|
|
3427
|
-
A700: '#d50000'
|
|
3428
|
-
};
|
|
3429
|
-
var red$1 = red;
|
|
3430
|
-
|
|
3431
|
-
const orange = {
|
|
3432
|
-
50: '#fff3e0',
|
|
3433
|
-
100: '#ffe0b2',
|
|
3434
|
-
200: '#ffcc80',
|
|
3435
|
-
300: '#ffb74d',
|
|
3436
|
-
400: '#ffa726',
|
|
3437
|
-
500: '#ff9800',
|
|
3438
|
-
600: '#fb8c00',
|
|
3439
|
-
700: '#f57c00',
|
|
3440
|
-
800: '#ef6c00',
|
|
3441
|
-
900: '#e65100',
|
|
3442
|
-
A100: '#ffd180',
|
|
3443
|
-
A200: '#ffab40',
|
|
3444
|
-
A400: '#ff9100',
|
|
3445
|
-
A700: '#ff6d00'
|
|
3446
|
-
};
|
|
3447
|
-
var orange$1 = orange;
|
|
3448
|
-
|
|
3449
|
-
const blue = {
|
|
3450
|
-
50: '#e3f2fd',
|
|
3451
|
-
100: '#bbdefb',
|
|
3452
|
-
200: '#90caf9',
|
|
3453
|
-
300: '#64b5f6',
|
|
3454
|
-
400: '#42a5f5',
|
|
3455
|
-
500: '#2196f3',
|
|
3456
|
-
600: '#1e88e5',
|
|
3457
|
-
700: '#1976d2',
|
|
3458
|
-
800: '#1565c0',
|
|
3459
|
-
900: '#0d47a1',
|
|
3460
|
-
A100: '#82b1ff',
|
|
3461
|
-
A200: '#448aff',
|
|
3462
|
-
A400: '#2979ff',
|
|
3463
|
-
A700: '#2962ff'
|
|
3464
|
-
};
|
|
3465
|
-
var blue$1 = blue;
|
|
3466
|
-
|
|
3467
|
-
const lightBlue = {
|
|
3468
|
-
50: '#e1f5fe',
|
|
3469
|
-
100: '#b3e5fc',
|
|
3470
|
-
200: '#81d4fa',
|
|
3471
|
-
300: '#4fc3f7',
|
|
3472
|
-
400: '#29b6f6',
|
|
3473
|
-
500: '#03a9f4',
|
|
3474
|
-
600: '#039be5',
|
|
3475
|
-
700: '#0288d1',
|
|
3476
|
-
800: '#0277bd',
|
|
3477
|
-
900: '#01579b',
|
|
3478
|
-
A100: '#80d8ff',
|
|
3479
|
-
A200: '#40c4ff',
|
|
3480
|
-
A400: '#00b0ff',
|
|
3481
|
-
A700: '#0091ea'
|
|
3482
|
-
};
|
|
3483
|
-
var lightBlue$1 = lightBlue;
|
|
3484
|
-
|
|
3485
|
-
const green = {
|
|
3486
|
-
50: '#e8f5e9',
|
|
3487
|
-
100: '#c8e6c9',
|
|
3488
|
-
200: '#a5d6a7',
|
|
3489
|
-
300: '#81c784',
|
|
3490
|
-
400: '#66bb6a',
|
|
3491
|
-
500: '#4caf50',
|
|
3492
|
-
600: '#43a047',
|
|
3493
|
-
700: '#388e3c',
|
|
3494
|
-
800: '#2e7d32',
|
|
3495
|
-
900: '#1b5e20',
|
|
3496
|
-
A100: '#b9f6ca',
|
|
3497
|
-
A200: '#69f0ae',
|
|
3498
|
-
A400: '#00e676',
|
|
3499
|
-
A700: '#00c853'
|
|
3500
|
-
};
|
|
3501
|
-
var green$1 = green;
|
|
3502
|
-
|
|
3503
|
-
const _excluded$4 = ["mode", "contrastThreshold", "tonalOffset"];
|
|
3504
|
-
const light = {
|
|
3505
|
-
// The colors used to style the text.
|
|
3506
|
-
text: {
|
|
3507
|
-
// The most important text.
|
|
3508
|
-
primary: 'rgba(0, 0, 0, 0.87)',
|
|
3509
|
-
// Secondary text.
|
|
3510
|
-
secondary: 'rgba(0, 0, 0, 0.6)',
|
|
3511
|
-
// Disabled text have even lower visual prominence.
|
|
3512
|
-
disabled: 'rgba(0, 0, 0, 0.38)'
|
|
3513
|
-
},
|
|
3514
|
-
// The color used to divide different elements.
|
|
3515
|
-
divider: 'rgba(0, 0, 0, 0.12)',
|
|
3516
|
-
// The background colors used to style the surfaces.
|
|
3517
|
-
// Consistency between these values is important.
|
|
3518
|
-
background: {
|
|
3519
|
-
paper: common$1.white,
|
|
3520
|
-
default: common$1.white
|
|
3521
|
-
},
|
|
3522
|
-
// The colors used to style the action elements.
|
|
3523
|
-
action: {
|
|
3524
|
-
// The color of an active action like an icon button.
|
|
3525
|
-
active: 'rgba(0, 0, 0, 0.54)',
|
|
3526
|
-
// The color of an hovered action.
|
|
3527
|
-
hover: 'rgba(0, 0, 0, 0.04)',
|
|
3528
|
-
hoverOpacity: 0.04,
|
|
3529
|
-
// The color of a selected action.
|
|
3530
|
-
selected: 'rgba(0, 0, 0, 0.08)',
|
|
3531
|
-
selectedOpacity: 0.08,
|
|
3532
|
-
// The color of a disabled action.
|
|
3533
|
-
disabled: 'rgba(0, 0, 0, 0.26)',
|
|
3534
|
-
// The background color of a disabled action.
|
|
3535
|
-
disabledBackground: 'rgba(0, 0, 0, 0.12)',
|
|
3536
|
-
disabledOpacity: 0.38,
|
|
3537
|
-
focus: 'rgba(0, 0, 0, 0.12)',
|
|
3538
|
-
focusOpacity: 0.12,
|
|
3539
|
-
activatedOpacity: 0.12
|
|
3540
|
-
}
|
|
3541
|
-
};
|
|
3542
|
-
const dark = {
|
|
3543
|
-
text: {
|
|
3544
|
-
primary: common$1.white,
|
|
3545
|
-
secondary: 'rgba(255, 255, 255, 0.7)',
|
|
3546
|
-
disabled: 'rgba(255, 255, 255, 0.5)',
|
|
3547
|
-
icon: 'rgba(255, 255, 255, 0.5)'
|
|
3548
|
-
},
|
|
3549
|
-
divider: 'rgba(255, 255, 255, 0.12)',
|
|
3550
|
-
background: {
|
|
3551
|
-
paper: '#121212',
|
|
3552
|
-
default: '#121212'
|
|
3553
|
-
},
|
|
3554
|
-
action: {
|
|
3555
|
-
active: common$1.white,
|
|
3556
|
-
hover: 'rgba(255, 255, 255, 0.08)',
|
|
3557
|
-
hoverOpacity: 0.08,
|
|
3558
|
-
selected: 'rgba(255, 255, 255, 0.16)',
|
|
3559
|
-
selectedOpacity: 0.16,
|
|
3560
|
-
disabled: 'rgba(255, 255, 255, 0.3)',
|
|
3561
|
-
disabledBackground: 'rgba(255, 255, 255, 0.12)',
|
|
3562
|
-
disabledOpacity: 0.38,
|
|
3563
|
-
focus: 'rgba(255, 255, 255, 0.12)',
|
|
3564
|
-
focusOpacity: 0.12,
|
|
3565
|
-
activatedOpacity: 0.24
|
|
3566
|
-
}
|
|
3567
|
-
};
|
|
3568
|
-
function addLightOrDark(intent, direction, shade, tonalOffset) {
|
|
3569
|
-
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
|
3570
|
-
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
|
3571
|
-
if (!intent[direction]) {
|
|
3572
|
-
if (intent.hasOwnProperty(shade)) {
|
|
3573
|
-
intent[direction] = intent[shade];
|
|
3574
|
-
} else if (direction === 'light') {
|
|
3575
|
-
intent.light = lighten(intent.main, tonalOffsetLight);
|
|
3576
|
-
} else if (direction === 'dark') {
|
|
3577
|
-
intent.dark = darken(intent.main, tonalOffsetDark);
|
|
3578
|
-
}
|
|
3579
|
-
}
|
|
3580
|
-
}
|
|
3581
|
-
function getDefaultPrimary(mode = 'light') {
|
|
3582
|
-
if (mode === 'dark') {
|
|
3583
|
-
return {
|
|
3584
|
-
main: blue$1[200],
|
|
3585
|
-
light: blue$1[50],
|
|
3586
|
-
dark: blue$1[400]
|
|
3587
|
-
};
|
|
3588
|
-
}
|
|
3589
|
-
return {
|
|
3590
|
-
main: blue$1[700],
|
|
3591
|
-
light: blue$1[400],
|
|
3592
|
-
dark: blue$1[800]
|
|
3593
|
-
};
|
|
3594
|
-
}
|
|
3595
|
-
function getDefaultSecondary(mode = 'light') {
|
|
3596
|
-
if (mode === 'dark') {
|
|
3597
|
-
return {
|
|
3598
|
-
main: purple$1[200],
|
|
3599
|
-
light: purple$1[50],
|
|
3600
|
-
dark: purple$1[400]
|
|
3601
|
-
};
|
|
3602
|
-
}
|
|
3603
|
-
return {
|
|
3604
|
-
main: purple$1[500],
|
|
3605
|
-
light: purple$1[300],
|
|
3606
|
-
dark: purple$1[700]
|
|
3607
|
-
};
|
|
3608
|
-
}
|
|
3609
|
-
function getDefaultError(mode = 'light') {
|
|
3610
|
-
if (mode === 'dark') {
|
|
3611
|
-
return {
|
|
3612
|
-
main: red$1[500],
|
|
3613
|
-
light: red$1[300],
|
|
3614
|
-
dark: red$1[700]
|
|
3615
|
-
};
|
|
3616
|
-
}
|
|
3617
|
-
return {
|
|
3618
|
-
main: red$1[700],
|
|
3619
|
-
light: red$1[400],
|
|
3620
|
-
dark: red$1[800]
|
|
3621
|
-
};
|
|
3622
|
-
}
|
|
3623
|
-
function getDefaultInfo(mode = 'light') {
|
|
3624
|
-
if (mode === 'dark') {
|
|
3625
|
-
return {
|
|
3626
|
-
main: lightBlue$1[400],
|
|
3627
|
-
light: lightBlue$1[300],
|
|
3628
|
-
dark: lightBlue$1[700]
|
|
3629
|
-
};
|
|
3630
|
-
}
|
|
3631
|
-
return {
|
|
3632
|
-
main: lightBlue$1[700],
|
|
3633
|
-
light: lightBlue$1[500],
|
|
3634
|
-
dark: lightBlue$1[900]
|
|
3635
|
-
};
|
|
3636
|
-
}
|
|
3637
|
-
function getDefaultSuccess(mode = 'light') {
|
|
3638
|
-
if (mode === 'dark') {
|
|
3639
|
-
return {
|
|
3640
|
-
main: green$1[400],
|
|
3641
|
-
light: green$1[300],
|
|
3642
|
-
dark: green$1[700]
|
|
3643
|
-
};
|
|
3644
|
-
}
|
|
3645
|
-
return {
|
|
3646
|
-
main: green$1[800],
|
|
3647
|
-
light: green$1[500],
|
|
3648
|
-
dark: green$1[900]
|
|
3649
|
-
};
|
|
3650
|
-
}
|
|
3651
|
-
function getDefaultWarning(mode = 'light') {
|
|
3652
|
-
if (mode === 'dark') {
|
|
3653
|
-
return {
|
|
3654
|
-
main: orange$1[400],
|
|
3655
|
-
light: orange$1[300],
|
|
3656
|
-
dark: orange$1[700]
|
|
3657
|
-
};
|
|
3658
|
-
}
|
|
3659
|
-
return {
|
|
3660
|
-
main: '#ed6c02',
|
|
3661
|
-
// closest to orange[800] that pass 3:1.
|
|
3662
|
-
light: orange$1[500],
|
|
3663
|
-
dark: orange$1[900]
|
|
3664
|
-
};
|
|
3665
|
-
}
|
|
3666
|
-
function createPalette(palette) {
|
|
3667
|
-
const {
|
|
3668
|
-
mode = 'light',
|
|
3669
|
-
contrastThreshold = 3,
|
|
3670
|
-
tonalOffset = 0.2
|
|
3671
|
-
} = palette,
|
|
3672
|
-
other = _objectWithoutPropertiesLoose(palette, _excluded$4);
|
|
3673
|
-
const primary = palette.primary || getDefaultPrimary(mode);
|
|
3674
|
-
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
3675
|
-
const error = palette.error || getDefaultError(mode);
|
|
3676
|
-
const info = palette.info || getDefaultInfo(mode);
|
|
3677
|
-
const success = palette.success || getDefaultSuccess(mode);
|
|
3678
|
-
const warning = palette.warning || getDefaultWarning(mode);
|
|
3679
|
-
|
|
3680
|
-
// Use the same logic as
|
|
3681
|
-
// Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59
|
|
3682
|
-
// and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54
|
|
3683
|
-
function getContrastText(background) {
|
|
3684
|
-
const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
|
|
3685
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3686
|
-
const contrast = getContrastRatio(background, contrastText);
|
|
3687
|
-
if (contrast < 3) {
|
|
3688
|
-
console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n'));
|
|
3689
|
-
}
|
|
3690
|
-
}
|
|
3691
|
-
return contrastText;
|
|
3692
|
-
}
|
|
3693
|
-
const augmentColor = ({
|
|
3694
|
-
color,
|
|
3695
|
-
name,
|
|
3696
|
-
mainShade = 500,
|
|
3697
|
-
lightShade = 300,
|
|
3698
|
-
darkShade = 700
|
|
3699
|
-
}) => {
|
|
3700
|
-
color = _extends({}, color);
|
|
3701
|
-
if (!color.main && color[mainShade]) {
|
|
3702
|
-
color.main = color[mainShade];
|
|
3703
|
-
}
|
|
3704
|
-
if (!color.hasOwnProperty('main')) {
|
|
3705
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
|
|
3706
|
-
The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
|
|
3707
|
-
}
|
|
3708
|
-
if (typeof color.main !== 'string') {
|
|
3709
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
|
|
3710
|
-
\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.
|
|
3711
|
-
|
|
3712
|
-
Did you intend to use one of the following approaches?
|
|
3713
|
-
|
|
3714
|
-
import { green } from "@mui/material/colors";
|
|
3715
|
-
|
|
3716
|
-
const theme1 = createTheme({ palette: {
|
|
3717
|
-
primary: green,
|
|
3718
|
-
} });
|
|
3719
|
-
|
|
3720
|
-
const theme2 = createTheme({ palette: {
|
|
3721
|
-
primary: { main: green[500] },
|
|
3722
|
-
} });` : formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
|
|
3723
|
-
}
|
|
3724
|
-
addLightOrDark(color, 'light', lightShade, tonalOffset);
|
|
3725
|
-
addLightOrDark(color, 'dark', darkShade, tonalOffset);
|
|
3726
|
-
if (!color.contrastText) {
|
|
3727
|
-
color.contrastText = getContrastText(color.main);
|
|
3728
|
-
}
|
|
3729
|
-
return color;
|
|
3730
|
-
};
|
|
3731
|
-
const modes = {
|
|
3732
|
-
dark,
|
|
3733
|
-
light
|
|
3734
|
-
};
|
|
3735
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3736
|
-
if (!modes[mode]) {
|
|
3737
|
-
console.error(`MUI: The palette mode \`${mode}\` is not supported.`);
|
|
3738
|
-
}
|
|
3739
|
-
}
|
|
3740
|
-
const paletteOutput = deepmerge(_extends({
|
|
3741
|
-
// A collection of common colors.
|
|
3742
|
-
common: _extends({}, common$1),
|
|
3743
|
-
// prevent mutable object.
|
|
3744
|
-
// The palette mode, can be light or dark.
|
|
3745
|
-
mode,
|
|
3746
|
-
// The colors used to represent primary interface elements for a user.
|
|
3747
|
-
primary: augmentColor({
|
|
3748
|
-
color: primary,
|
|
3749
|
-
name: 'primary'
|
|
3750
|
-
}),
|
|
3751
|
-
// The colors used to represent secondary interface elements for a user.
|
|
3752
|
-
secondary: augmentColor({
|
|
3753
|
-
color: secondary,
|
|
3754
|
-
name: 'secondary',
|
|
3755
|
-
mainShade: 'A400',
|
|
3756
|
-
lightShade: 'A200',
|
|
3757
|
-
darkShade: 'A700'
|
|
3758
|
-
}),
|
|
3759
|
-
// The colors used to represent interface elements that the user should be made aware of.
|
|
3760
|
-
error: augmentColor({
|
|
3761
|
-
color: error,
|
|
3762
|
-
name: 'error'
|
|
3763
|
-
}),
|
|
3764
|
-
// The colors used to represent potentially dangerous actions or important messages.
|
|
3765
|
-
warning: augmentColor({
|
|
3766
|
-
color: warning,
|
|
3767
|
-
name: 'warning'
|
|
3768
|
-
}),
|
|
3769
|
-
// The colors used to present information to the user that is neutral and not necessarily important.
|
|
3770
|
-
info: augmentColor({
|
|
3771
|
-
color: info,
|
|
3772
|
-
name: 'info'
|
|
3773
|
-
}),
|
|
3774
|
-
// The colors used to indicate the successful completion of an action that user triggered.
|
|
3775
|
-
success: augmentColor({
|
|
3776
|
-
color: success,
|
|
3777
|
-
name: 'success'
|
|
3778
|
-
}),
|
|
3779
|
-
// The grey colors.
|
|
3780
|
-
grey: grey$1,
|
|
3781
|
-
// Used by `getContrastText()` to maximize the contrast between
|
|
3782
|
-
// the background and the text.
|
|
3783
|
-
contrastThreshold,
|
|
3784
|
-
// Takes a background color and returns the text color that maximizes the contrast.
|
|
3785
|
-
getContrastText,
|
|
3786
|
-
// Generate a rich color object.
|
|
3787
|
-
augmentColor,
|
|
3788
|
-
// Used by the functions below to shift a color's luminance by approximately
|
|
3789
|
-
// two indexes within its tonal palette.
|
|
3790
|
-
// E.g., shift from Red 500 to Red 300 or Red 700.
|
|
3791
|
-
tonalOffset
|
|
3792
|
-
}, modes[mode]), other);
|
|
3793
|
-
return paletteOutput;
|
|
3794
|
-
}
|
|
3795
|
-
|
|
3796
|
-
const _excluded$3 = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
3797
|
-
function round(value) {
|
|
3798
|
-
return Math.round(value * 1e5) / 1e5;
|
|
3799
|
-
}
|
|
3800
|
-
const caseAllCaps = {
|
|
3801
|
-
textTransform: 'uppercase'
|
|
3802
|
-
};
|
|
3803
|
-
const defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif';
|
|
3804
|
-
|
|
3805
|
-
/**
|
|
3806
|
-
* @see @link{https://m2.material.io/design/typography/the-type-system.html}
|
|
3807
|
-
* @see @link{https://m2.material.io/design/typography/understanding-typography.html}
|
|
3808
|
-
*/
|
|
3809
|
-
function createTypography(palette, typography) {
|
|
3810
|
-
const _ref = typeof typography === 'function' ? typography(palette) : typography,
|
|
3811
|
-
{
|
|
3812
|
-
fontFamily = defaultFontFamily,
|
|
3813
|
-
// The default font size of the Material Specification.
|
|
3814
|
-
fontSize = 14,
|
|
3815
|
-
// px
|
|
3816
|
-
fontWeightLight = 300,
|
|
3817
|
-
fontWeightRegular = 400,
|
|
3818
|
-
fontWeightMedium = 500,
|
|
3819
|
-
fontWeightBold = 700,
|
|
3820
|
-
// Tell MUI what's the font-size on the html element.
|
|
3821
|
-
// 16px is the default font-size used by browsers.
|
|
3822
|
-
htmlFontSize = 16,
|
|
3823
|
-
// Apply the CSS properties to all the variants.
|
|
3824
|
-
allVariants,
|
|
3825
|
-
pxToRem: pxToRem2
|
|
3826
|
-
} = _ref,
|
|
3827
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
3828
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3829
|
-
if (typeof fontSize !== 'number') {
|
|
3830
|
-
console.error('MUI: `fontSize` is required to be a number.');
|
|
3831
|
-
}
|
|
3832
|
-
if (typeof htmlFontSize !== 'number') {
|
|
3833
|
-
console.error('MUI: `htmlFontSize` is required to be a number.');
|
|
3834
|
-
}
|
|
3835
|
-
}
|
|
3836
|
-
const coef = fontSize / 14;
|
|
3837
|
-
const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);
|
|
3838
|
-
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends({
|
|
3839
|
-
fontFamily,
|
|
3840
|
-
fontWeight,
|
|
3841
|
-
fontSize: pxToRem(size),
|
|
3842
|
-
// Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
|
|
3843
|
-
lineHeight
|
|
3844
|
-
}, fontFamily === defaultFontFamily ? {
|
|
3845
|
-
letterSpacing: `${round(letterSpacing / size)}em`
|
|
3846
|
-
} : {}, casing, allVariants);
|
|
3847
|
-
const variants = {
|
|
3848
|
-
h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
|
|
3849
|
-
h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),
|
|
3850
|
-
h3: buildVariant(fontWeightRegular, 48, 1.167, 0),
|
|
3851
|
-
h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),
|
|
3852
|
-
h5: buildVariant(fontWeightRegular, 24, 1.334, 0),
|
|
3853
|
-
h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),
|
|
3854
|
-
subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),
|
|
3855
|
-
subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
|
|
3856
|
-
body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
|
|
3857
|
-
body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),
|
|
3858
|
-
button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
|
|
3859
|
-
caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
|
|
3860
|
-
overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),
|
|
3861
|
-
inherit: {
|
|
3862
|
-
fontFamily: 'inherit',
|
|
3863
|
-
fontWeight: 'inherit',
|
|
3864
|
-
fontSize: 'inherit',
|
|
3865
|
-
lineHeight: 'inherit',
|
|
3866
|
-
letterSpacing: 'inherit'
|
|
3867
|
-
}
|
|
3868
|
-
};
|
|
3869
|
-
return deepmerge(_extends({
|
|
3870
|
-
htmlFontSize,
|
|
3871
|
-
pxToRem,
|
|
3872
|
-
fontFamily,
|
|
3873
|
-
fontSize,
|
|
3874
|
-
fontWeightLight,
|
|
3875
|
-
fontWeightRegular,
|
|
3876
|
-
fontWeightMedium,
|
|
3877
|
-
fontWeightBold
|
|
3878
|
-
}, variants), other, {
|
|
3879
|
-
clone: false // No need to clone deep
|
|
3880
|
-
});
|
|
3881
|
-
}
|
|
3882
|
-
|
|
3883
|
-
const shadowKeyUmbraOpacity = 0.2;
|
|
3884
|
-
const shadowKeyPenumbraOpacity = 0.14;
|
|
3885
|
-
const shadowAmbientShadowOpacity = 0.12;
|
|
3886
|
-
function createShadow(...px) {
|
|
3887
|
-
return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(',');
|
|
3888
|
-
}
|
|
3889
|
-
|
|
3890
|
-
// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss
|
|
3891
|
-
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)];
|
|
3892
|
-
var shadows$1 = shadows;
|
|
3893
|
-
|
|
3894
|
-
const _excluded$2 = ["duration", "easing", "delay"];
|
|
3895
|
-
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
3896
|
-
// to learn the context in which each easing should be used.
|
|
3897
|
-
const easing = {
|
|
3898
|
-
// This is the most common easing curve.
|
|
3899
|
-
easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
|
|
3900
|
-
// Objects enter the screen at full velocity from off-screen and
|
|
3901
|
-
// slowly decelerate to a resting point.
|
|
3902
|
-
easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
|
|
3903
|
-
// Objects leave the screen at full velocity. They do not decelerate when off-screen.
|
|
3904
|
-
easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
|
|
3905
|
-
// The sharp curve is used by objects that may return to the screen at any time.
|
|
3906
|
-
sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'
|
|
3907
|
-
};
|
|
3908
|
-
|
|
3909
|
-
// Follow https://m2.material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations
|
|
3910
|
-
// to learn when use what timing
|
|
3911
|
-
const duration = {
|
|
3912
|
-
shortest: 150,
|
|
3913
|
-
shorter: 200,
|
|
3914
|
-
short: 250,
|
|
3915
|
-
// most basic recommended timing
|
|
3916
|
-
standard: 300,
|
|
3917
|
-
// this is to be used in complex animations
|
|
3918
|
-
complex: 375,
|
|
3919
|
-
// recommended when something is entering screen
|
|
3920
|
-
enteringScreen: 225,
|
|
3921
|
-
// recommended when something is leaving screen
|
|
3922
|
-
leavingScreen: 195
|
|
3923
|
-
};
|
|
3924
|
-
function formatMs(milliseconds) {
|
|
3925
|
-
return `${Math.round(milliseconds)}ms`;
|
|
3926
|
-
}
|
|
3927
|
-
function getAutoHeightDuration(height) {
|
|
3928
|
-
if (!height) {
|
|
3929
|
-
return 0;
|
|
3930
|
-
}
|
|
3931
|
-
const constant = height / 36;
|
|
3932
|
-
|
|
3933
|
-
// https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10
|
|
3934
|
-
return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
|
|
3935
|
-
}
|
|
3936
|
-
function createTransitions(inputTransitions) {
|
|
3937
|
-
const mergedEasing = _extends({}, easing, inputTransitions.easing);
|
|
3938
|
-
const mergedDuration = _extends({}, duration, inputTransitions.duration);
|
|
3939
|
-
const create = (props = ['all'], options = {}) => {
|
|
3940
|
-
const {
|
|
3941
|
-
duration: durationOption = mergedDuration.standard,
|
|
3942
|
-
easing: easingOption = mergedEasing.easeInOut,
|
|
3943
|
-
delay = 0
|
|
3944
|
-
} = options,
|
|
3945
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$2);
|
|
3946
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3947
|
-
const isString = value => typeof value === 'string';
|
|
3948
|
-
// IE11 support, replace with Number.isNaN
|
|
3949
|
-
// eslint-disable-next-line no-restricted-globals
|
|
3950
|
-
const isNumber = value => !isNaN(parseFloat(value));
|
|
3951
|
-
if (!isString(props) && !Array.isArray(props)) {
|
|
3952
|
-
console.error('MUI: Argument "props" must be a string or Array.');
|
|
3953
|
-
}
|
|
3954
|
-
if (!isNumber(durationOption) && !isString(durationOption)) {
|
|
3955
|
-
console.error(`MUI: Argument "duration" must be a number or a string but found ${durationOption}.`);
|
|
3956
|
-
}
|
|
3957
|
-
if (!isString(easingOption)) {
|
|
3958
|
-
console.error('MUI: Argument "easing" must be a string.');
|
|
3959
|
-
}
|
|
3960
|
-
if (!isNumber(delay) && !isString(delay)) {
|
|
3961
|
-
console.error('MUI: Argument "delay" must be a number or a string.');
|
|
3962
|
-
}
|
|
3963
|
-
if (Object.keys(other).length !== 0) {
|
|
3964
|
-
console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(',')}].`);
|
|
3965
|
-
}
|
|
3966
|
-
}
|
|
3967
|
-
return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
|
|
3968
|
-
};
|
|
3969
|
-
return _extends({
|
|
3970
|
-
getAutoHeightDuration,
|
|
3971
|
-
create
|
|
3972
|
-
}, inputTransitions, {
|
|
3973
|
-
easing: mergedEasing,
|
|
3974
|
-
duration: mergedDuration
|
|
3975
|
-
});
|
|
3976
|
-
}
|
|
3977
|
-
|
|
3978
|
-
// We need to centralize the zIndex definitions as they work
|
|
3979
|
-
// like global values in the browser.
|
|
3980
|
-
const zIndex = {
|
|
3981
|
-
mobileStepper: 1000,
|
|
3982
|
-
fab: 1050,
|
|
3983
|
-
speedDial: 1050,
|
|
3984
|
-
appBar: 1100,
|
|
3985
|
-
drawer: 1200,
|
|
3986
|
-
modal: 1300,
|
|
3987
|
-
snackbar: 1400,
|
|
3988
|
-
tooltip: 1500
|
|
3989
|
-
};
|
|
3990
|
-
var zIndex$1 = zIndex;
|
|
3991
|
-
|
|
3992
|
-
const _excluded$1 = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
3993
|
-
function createTheme(options = {}, ...args) {
|
|
3994
|
-
const {
|
|
3995
|
-
mixins: mixinsInput = {},
|
|
3996
|
-
palette: paletteInput = {},
|
|
3997
|
-
transitions: transitionsInput = {},
|
|
3998
|
-
typography: typographyInput = {}
|
|
3999
|
-
} = options,
|
|
4000
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$1);
|
|
4001
|
-
if (options.vars) {
|
|
4002
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
|
|
4003
|
-
Please use another name.` : formatMuiErrorMessage(18));
|
|
4004
|
-
}
|
|
4005
|
-
const palette = createPalette(paletteInput);
|
|
4006
|
-
const systemTheme = createTheme$1(options);
|
|
4007
|
-
let muiTheme = deepmerge(systemTheme, {
|
|
4008
|
-
mixins: createMixins(systemTheme.breakpoints, mixinsInput),
|
|
4009
|
-
palette,
|
|
4010
|
-
// Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
|
|
4011
|
-
shadows: shadows$1.slice(),
|
|
4012
|
-
typography: createTypography(palette, typographyInput),
|
|
4013
|
-
transitions: createTransitions(transitionsInput),
|
|
4014
|
-
zIndex: _extends({}, zIndex$1)
|
|
4015
|
-
});
|
|
4016
|
-
muiTheme = deepmerge(muiTheme, other);
|
|
4017
|
-
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
4018
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
4019
|
-
// TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.
|
|
4020
|
-
const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];
|
|
4021
|
-
const traverse = (node, component) => {
|
|
4022
|
-
let key;
|
|
4023
|
-
|
|
4024
|
-
// eslint-disable-next-line guard-for-in, no-restricted-syntax
|
|
4025
|
-
for (key in node) {
|
|
4026
|
-
const child = node[key];
|
|
4027
|
-
if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {
|
|
4028
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
4029
|
-
const stateClass = generateUtilityClass('', key);
|
|
4030
|
-
console.error([`MUI: The \`${component}\` component increases ` + `the CSS specificity of the \`${key}\` internal state.`, 'You can not override it like this: ', JSON.stringify(node, null, 2), '', `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({
|
|
4031
|
-
root: {
|
|
4032
|
-
[`&.${stateClass}`]: child
|
|
4033
|
-
}
|
|
4034
|
-
}, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\n'));
|
|
4035
|
-
}
|
|
4036
|
-
// Remove the style to prevent global conflicts.
|
|
4037
|
-
node[key] = {};
|
|
4038
|
-
}
|
|
4039
|
-
}
|
|
4040
|
-
};
|
|
4041
|
-
Object.keys(muiTheme.components).forEach(component => {
|
|
4042
|
-
const styleOverrides = muiTheme.components[component].styleOverrides;
|
|
4043
|
-
if (styleOverrides && component.indexOf('Mui') === 0) {
|
|
4044
|
-
traverse(styleOverrides, component);
|
|
4045
|
-
}
|
|
4046
|
-
});
|
|
4047
|
-
}
|
|
4048
|
-
muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
|
|
4049
|
-
muiTheme.unstable_sx = function sx(props) {
|
|
4050
|
-
return styleFunctionSx$1({
|
|
4051
|
-
sx: props,
|
|
4052
|
-
theme: this
|
|
4053
|
-
});
|
|
4054
|
-
};
|
|
4055
|
-
return muiTheme;
|
|
4056
|
-
}
|
|
4057
|
-
|
|
4058
|
-
const defaultTheme = createTheme();
|
|
4059
|
-
var defaultTheme$1 = defaultTheme;
|
|
4060
|
-
|
|
4061
|
-
function useThemeProps({
|
|
4062
|
-
props,
|
|
4063
|
-
name
|
|
4064
|
-
}) {
|
|
4065
|
-
return useThemeProps$1({
|
|
4066
|
-
props,
|
|
4067
|
-
name,
|
|
4068
|
-
defaultTheme: defaultTheme$1,
|
|
4069
|
-
themeId: THEME_ID
|
|
4070
|
-
});
|
|
4071
|
-
}
|
|
4072
|
-
|
|
4073
|
-
const rootShouldForwardProp = prop => shouldForwardProp(prop) && prop !== 'classes';
|
|
4074
|
-
const slotShouldForwardProp = shouldForwardProp;
|
|
4075
|
-
const styled = createStyled({
|
|
4076
|
-
themeId: THEME_ID,
|
|
4077
|
-
defaultTheme: defaultTheme$1,
|
|
4078
|
-
rootShouldForwardProp
|
|
4079
|
-
});
|
|
4080
|
-
var styled$1 = styled;
|
|
4081
|
-
|
|
4082
|
-
/**
|
|
4083
|
-
* Determines if a given element is a DOM element name (i.e. not a React component).
|
|
4084
|
-
*/
|
|
4085
|
-
function isHostComponent(element) {
|
|
4086
|
-
return typeof element === 'string';
|
|
4087
|
-
}
|
|
4088
|
-
|
|
4089
|
-
/**
|
|
4090
|
-
* Type of the ownerState based on the type of an element it applies to.
|
|
4091
|
-
* This resolves to the provided OwnerState for React components and `undefined` for host components.
|
|
4092
|
-
* Falls back to `OwnerState | undefined` when the exact type can't be determined in development time.
|
|
4093
|
-
*/
|
|
4094
|
-
|
|
4095
|
-
/**
|
|
4096
|
-
* Appends the ownerState object to the props, merging with the existing one if necessary.
|
|
4097
|
-
*
|
|
4098
|
-
* @param elementType Type of the element that owns the `existingProps`. If the element is a DOM node or undefined, `ownerState` is not applied.
|
|
4099
|
-
* @param otherProps Props of the element.
|
|
4100
|
-
* @param ownerState
|
|
4101
|
-
*/
|
|
4102
|
-
function appendOwnerState(elementType, otherProps, ownerState) {
|
|
4103
|
-
if (elementType === undefined || isHostComponent(elementType)) {
|
|
4104
|
-
return otherProps;
|
|
4105
|
-
}
|
|
4106
|
-
return _extends({}, otherProps, {
|
|
4107
|
-
ownerState: _extends({}, otherProps.ownerState, ownerState)
|
|
4108
|
-
});
|
|
4109
|
-
}
|
|
4110
|
-
|
|
4111
|
-
const defaultContextValue = {
|
|
4112
|
-
disableDefaultClasses: false
|
|
4113
|
-
};
|
|
4114
|
-
const ClassNameConfiguratorContext = /*#__PURE__*/React.createContext(defaultContextValue);
|
|
4115
|
-
/**
|
|
4116
|
-
* @ignore - internal hook.
|
|
4117
|
-
*
|
|
4118
|
-
* Wraps the `generateUtilityClass` function and controls how the classes are generated.
|
|
4119
|
-
* Currently it only affects whether the classes are applied or not.
|
|
4120
|
-
*
|
|
4121
|
-
* @returns Function to be called with the `generateUtilityClass` function specific to a component to generate the classes.
|
|
4122
|
-
*/
|
|
4123
|
-
function useClassNamesOverride(generateUtilityClass) {
|
|
4124
|
-
const {
|
|
4125
|
-
disableDefaultClasses
|
|
4126
|
-
} = React.useContext(ClassNameConfiguratorContext);
|
|
4127
|
-
return slot => {
|
|
4128
|
-
if (disableDefaultClasses) {
|
|
4129
|
-
return '';
|
|
4130
|
-
}
|
|
4131
|
-
return generateUtilityClass(slot);
|
|
4132
|
-
};
|
|
4133
|
-
}
|
|
4134
|
-
|
|
4135
|
-
/**
|
|
4136
|
-
* Extracts event handlers from a given object.
|
|
4137
|
-
* A prop is considered an event handler if it is a function and its name starts with `on`.
|
|
4138
|
-
*
|
|
4139
|
-
* @param object An object to extract event handlers from.
|
|
4140
|
-
* @param excludeKeys An array of keys to exclude from the returned object.
|
|
4141
|
-
*/
|
|
4142
|
-
function extractEventHandlers(object, excludeKeys = []) {
|
|
4143
|
-
if (object === undefined) {
|
|
4144
|
-
return {};
|
|
4145
|
-
}
|
|
4146
|
-
const result = {};
|
|
4147
|
-
Object.keys(object).filter(prop => prop.match(/^on[A-Z]/) && typeof object[prop] === 'function' && !excludeKeys.includes(prop)).forEach(prop => {
|
|
4148
|
-
result[prop] = object[prop];
|
|
4149
|
-
});
|
|
4150
|
-
return result;
|
|
4151
|
-
}
|
|
4152
|
-
|
|
4153
|
-
/**
|
|
4154
|
-
* If `componentProps` is a function, calls it with the provided `ownerState`.
|
|
4155
|
-
* Otherwise, just returns `componentProps`.
|
|
4156
|
-
*/
|
|
4157
|
-
function resolveComponentProps(componentProps, ownerState) {
|
|
4158
|
-
if (typeof componentProps === 'function') {
|
|
4159
|
-
return componentProps(ownerState);
|
|
4160
|
-
}
|
|
4161
|
-
return componentProps;
|
|
4162
|
-
}
|
|
4163
|
-
|
|
4164
|
-
/**
|
|
4165
|
-
* Removes event handlers from the given object.
|
|
4166
|
-
* A field is considered an event handler if it is a function with a name beginning with `on`.
|
|
4167
|
-
*
|
|
4168
|
-
* @param object Object to remove event handlers from.
|
|
4169
|
-
* @returns Object with event handlers removed.
|
|
4170
|
-
*/
|
|
4171
|
-
function omitEventHandlers(object) {
|
|
4172
|
-
if (object === undefined) {
|
|
4173
|
-
return {};
|
|
4174
|
-
}
|
|
4175
|
-
const result = {};
|
|
4176
|
-
Object.keys(object).filter(prop => !(prop.match(/^on[A-Z]/) && typeof object[prop] === 'function')).forEach(prop => {
|
|
4177
|
-
result[prop] = object[prop];
|
|
4178
|
-
});
|
|
4179
|
-
return result;
|
|
4180
|
-
}
|
|
4181
|
-
|
|
4182
|
-
/**
|
|
4183
|
-
* Merges the slot component internal props (usually coming from a hook)
|
|
4184
|
-
* with the externally provided ones.
|
|
4185
|
-
*
|
|
4186
|
-
* The merge order is (the latter overrides the former):
|
|
4187
|
-
* 1. The internal props (specified as a getter function to work with get*Props hook result)
|
|
4188
|
-
* 2. Additional props (specified internally on a Base UI component)
|
|
4189
|
-
* 3. External props specified on the owner component. These should only be used on a root slot.
|
|
4190
|
-
* 4. External props specified in the `slotProps.*` prop.
|
|
4191
|
-
* 5. The `className` prop - combined from all the above.
|
|
4192
|
-
* @param parameters
|
|
4193
|
-
* @returns
|
|
4194
|
-
*/
|
|
4195
|
-
function mergeSlotProps(parameters) {
|
|
4196
|
-
const {
|
|
4197
|
-
getSlotProps,
|
|
4198
|
-
additionalProps,
|
|
4199
|
-
externalSlotProps,
|
|
4200
|
-
externalForwardedProps,
|
|
4201
|
-
className
|
|
4202
|
-
} = parameters;
|
|
4203
|
-
if (!getSlotProps) {
|
|
4204
|
-
// The simpler case - getSlotProps is not defined, so no internal event handlers are defined,
|
|
4205
|
-
// so we can simply merge all the props without having to worry about extracting event handlers.
|
|
4206
|
-
const joinedClasses = clsx(externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className, className, additionalProps == null ? void 0 : additionalProps.className);
|
|
4207
|
-
const mergedStyle = _extends({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
|
|
4208
|
-
const props = _extends({}, additionalProps, externalForwardedProps, externalSlotProps);
|
|
4209
|
-
if (joinedClasses.length > 0) {
|
|
4210
|
-
props.className = joinedClasses;
|
|
4211
|
-
}
|
|
4212
|
-
if (Object.keys(mergedStyle).length > 0) {
|
|
4213
|
-
props.style = mergedStyle;
|
|
4214
|
-
}
|
|
4215
|
-
return {
|
|
4216
|
-
props,
|
|
4217
|
-
internalRef: undefined
|
|
4218
|
-
};
|
|
4219
|
-
}
|
|
4220
|
-
|
|
4221
|
-
// In this case, getSlotProps is responsible for calling the external event handlers.
|
|
4222
|
-
// We don't need to include them in the merged props because of this.
|
|
4223
|
-
|
|
4224
|
-
const eventHandlers = extractEventHandlers(_extends({}, externalForwardedProps, externalSlotProps));
|
|
4225
|
-
const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);
|
|
4226
|
-
const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);
|
|
4227
|
-
const internalSlotProps = getSlotProps(eventHandlers);
|
|
4228
|
-
|
|
4229
|
-
// The order of classes is important here.
|
|
4230
|
-
// Emotion (that we use in libraries consuming Base UI) depends on this order
|
|
4231
|
-
// to properly override style. It requires the most important classes to be last
|
|
4232
|
-
// (see https://github.com/mui/material-ui/pull/33205) for the related discussion.
|
|
4233
|
-
const joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
|
|
4234
|
-
const mergedStyle = _extends({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
|
|
4235
|
-
const props = _extends({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);
|
|
4236
|
-
if (joinedClasses.length > 0) {
|
|
4237
|
-
props.className = joinedClasses;
|
|
4238
|
-
}
|
|
4239
|
-
if (Object.keys(mergedStyle).length > 0) {
|
|
4240
|
-
props.style = mergedStyle;
|
|
4241
|
-
}
|
|
4242
|
-
return {
|
|
4243
|
-
props,
|
|
4244
|
-
internalRef: internalSlotProps.ref
|
|
4245
|
-
};
|
|
4246
|
-
}
|
|
4247
|
-
|
|
4248
|
-
const _excluded = ["elementType", "externalSlotProps", "ownerState"];
|
|
4249
|
-
/**
|
|
4250
|
-
* @ignore - do not document.
|
|
4251
|
-
* Builds the props to be passed into the slot of an unstyled component.
|
|
4252
|
-
* It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior.
|
|
4253
|
-
* If the slot component is not a host component, it also merges in the `ownerState`.
|
|
4254
|
-
*
|
|
4255
|
-
* @param parameters.getSlotProps - A function that returns the props to be passed to the slot component.
|
|
4256
|
-
*/
|
|
4257
|
-
function useSlotProps(parameters) {
|
|
4258
|
-
var _parameters$additiona;
|
|
4259
|
-
const {
|
|
4260
|
-
elementType,
|
|
4261
|
-
externalSlotProps,
|
|
4262
|
-
ownerState
|
|
4263
|
-
} = parameters,
|
|
4264
|
-
rest = _objectWithoutPropertiesLoose(parameters, _excluded);
|
|
4265
|
-
const resolvedComponentsProps = resolveComponentProps(externalSlotProps, ownerState);
|
|
4266
|
-
const {
|
|
4267
|
-
props: mergedProps,
|
|
4268
|
-
internalRef
|
|
4269
|
-
} = mergeSlotProps(_extends({}, rest, {
|
|
4270
|
-
externalSlotProps: resolvedComponentsProps
|
|
4271
|
-
}));
|
|
4272
|
-
const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);
|
|
4273
|
-
const props = appendOwnerState(elementType, _extends({}, mergedProps, {
|
|
4274
|
-
ref
|
|
4275
|
-
}), ownerState);
|
|
4276
|
-
return props;
|
|
4277
|
-
}
|
|
4278
|
-
|
|
4279
|
-
function getContainer(container) {
|
|
4280
|
-
return typeof container === 'function' ? container() : container;
|
|
4281
|
-
}
|
|
4282
|
-
|
|
4283
|
-
/**
|
|
4284
|
-
* Portals provide a first-class way to render children into a DOM node
|
|
4285
|
-
* that exists outside the DOM hierarchy of the parent component.
|
|
4286
|
-
*
|
|
4287
|
-
* Demos:
|
|
4288
|
-
*
|
|
4289
|
-
* - [Portal](https://mui.com/base/react-portal/)
|
|
4290
|
-
*
|
|
4291
|
-
* API:
|
|
4292
|
-
*
|
|
4293
|
-
* - [Portal API](https://mui.com/base/react-portal/components-api/#portal)
|
|
4294
|
-
*/
|
|
4295
|
-
const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, forwardedRef) {
|
|
4296
|
-
const {
|
|
4297
|
-
children,
|
|
4298
|
-
container,
|
|
4299
|
-
disablePortal = false
|
|
4300
|
-
} = props;
|
|
4301
|
-
const [mountNode, setMountNode] = React.useState(null);
|
|
4302
|
-
// @ts-expect-error TODO upstream fix
|
|
4303
|
-
const handleRef = useForkRef( /*#__PURE__*/React.isValidElement(children) ? children.ref : null, forwardedRef);
|
|
4304
|
-
useEnhancedEffect$1(() => {
|
|
4305
|
-
if (!disablePortal) {
|
|
4306
|
-
setMountNode(getContainer(container) || document.body);
|
|
4307
|
-
}
|
|
4308
|
-
}, [container, disablePortal]);
|
|
4309
|
-
useEnhancedEffect$1(() => {
|
|
4310
|
-
if (mountNode && !disablePortal) {
|
|
4311
|
-
setRef(forwardedRef, mountNode);
|
|
4312
|
-
return () => {
|
|
4313
|
-
setRef(forwardedRef, null);
|
|
4314
|
-
};
|
|
4315
|
-
}
|
|
4316
|
-
return undefined;
|
|
4317
|
-
}, [forwardedRef, mountNode, disablePortal]);
|
|
4318
|
-
if (disablePortal) {
|
|
4319
|
-
if ( /*#__PURE__*/React.isValidElement(children)) {
|
|
4320
|
-
const newProps = {
|
|
4321
|
-
ref: handleRef
|
|
4322
|
-
};
|
|
4323
|
-
return /*#__PURE__*/React.cloneElement(children, newProps);
|
|
4324
|
-
}
|
|
4325
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(React.Fragment, {
|
|
4326
|
-
children: children
|
|
4327
|
-
});
|
|
4328
|
-
}
|
|
4329
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(React.Fragment, {
|
|
4330
|
-
children: mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode
|
|
4331
|
-
});
|
|
4332
|
-
});
|
|
4333
|
-
process.env.NODE_ENV !== "production" ? Portal.propTypes /* remove-proptypes */ = {
|
|
4334
|
-
// ----------------------------- Warning --------------------------------
|
|
4335
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
4336
|
-
// | To update them edit TypeScript types and run "yarn proptypes" |
|
|
4337
|
-
// ----------------------------------------------------------------------
|
|
4338
|
-
/**
|
|
4339
|
-
* The children to render into the `container`.
|
|
4340
|
-
*/
|
|
4341
|
-
children: PropTypes.node,
|
|
4342
|
-
/**
|
|
4343
|
-
* An HTML element or function that returns one.
|
|
4344
|
-
* The `container` will have the portal children appended to it.
|
|
4345
|
-
*
|
|
4346
|
-
* By default, it uses the body of the top-level document object,
|
|
4347
|
-
* so it's simply `document.body` most of the time.
|
|
4348
|
-
*/
|
|
4349
|
-
container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
|
|
4350
|
-
/**
|
|
4351
|
-
* The `children` will be under the DOM hierarchy of the parent component.
|
|
4352
|
-
* @default false
|
|
4353
|
-
*/
|
|
4354
|
-
disablePortal: PropTypes.bool
|
|
4355
|
-
} : void 0;
|
|
4356
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
4357
|
-
// eslint-disable-next-line
|
|
4358
|
-
Portal['propTypes' + ''] = exactProp(Portal.propTypes);
|
|
4359
|
-
}
|
|
4360
|
-
var Portal$1 = Portal;
|
|
4361
|
-
|
|
4362
|
-
export { isHostComponent as A, formatMuiErrorMessage as B, ClassNameGenerator$1 as C, deepmerge as D, reactIsExports as E, resolveComponentProps as F, alpha as G, HTMLElementType as H, slotShouldForwardProp as I, lighten as J, darken as K, PropTypes as P, THEME_ID as T, _objectWithoutPropertiesLoose as _, _extends as a, styleFunctionSx$1 as b, clsx as c, defaultSxConfig$1 as d, exactProp as e, useTheme$1 as f, createTheme as g, generateUtilityClasses as h, isPlainObject as i, generateUtilityClass as j, styled$1 as k, useThemeProps as l, capitalize as m, composeClasses as n, refType$1 as o, ownerDocument as p, Portal$1 as q, rootShouldForwardProp as r, styled$2 as s, chainPropTypes as t, useTheme as u, useForkRef as v, useEnhancedEffect$1 as w, useSlotProps as x, useClassNamesOverride as y, defaultTheme$1 as z };
|
|
4363
|
-
//# sourceMappingURL=Portal.js.map
|