@nebula.js/stardust 3.0.0-alpha4 → 3.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/esm/dev.js +874 -305
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +8 -8
- package/core/esm/index.js.map +1 -1
- package/core/package.json +4 -4
- package/dist/stardust.dev.js +3061 -1758
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +30 -25
- package/dist/stardust.js.map +1 -1
- package/package.json +16 -16
- package/types/index.d.ts +11 -11
package/core/esm/dev.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/stardust v3.0.0-
|
|
2
|
+
* @nebula.js/stardust v3.0.0-rc.1
|
|
3
3
|
* Copyright (c) 2022 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -9,7 +9,7 @@ import React__default, { Children, isValidElement, cloneElement, useState as use
|
|
|
9
9
|
import ReactDOM from 'react-dom';
|
|
10
10
|
import emStyled from '@emotion/styled';
|
|
11
11
|
import { CacheProvider, Global, ThemeContext as ThemeContext$1, keyframes } from '@emotion/react';
|
|
12
|
-
import { Checkbox, Radio, Grid,
|
|
12
|
+
import { Checkbox, Radio, Grid, Typography, FormControlLabel, IconButton, Popover, MenuList, MenuItem, ListItemIcon, Divider, OutlinedInput, InputAdornment, Badge, List, ListItem, Button, Box, Icon, CircularProgress, Paper } from '@mui/material';
|
|
13
13
|
|
|
14
14
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
15
15
|
|
|
@@ -4939,7 +4939,7 @@ function GlobalStyles(props) {
|
|
|
4939
4939
|
});
|
|
4940
4940
|
}
|
|
4941
4941
|
|
|
4942
|
-
/** @license MUI v5.8.
|
|
4942
|
+
/** @license MUI v5.8.7
|
|
4943
4943
|
*
|
|
4944
4944
|
* This source code is licensed under the MIT license found in the
|
|
4945
4945
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -5308,11 +5308,11 @@ function composeClasses(slots, getUtilityClass, classes) {
|
|
|
5308
5308
|
slot => {
|
|
5309
5309
|
output[slot] = slots[slot].reduce((acc, key) => {
|
|
5310
5310
|
if (key) {
|
|
5311
|
+
acc.push(getUtilityClass(key));
|
|
5312
|
+
|
|
5311
5313
|
if (classes && classes[key]) {
|
|
5312
5314
|
acc.push(classes[key]);
|
|
5313
5315
|
}
|
|
5314
|
-
|
|
5315
|
-
acc.push(getUtilityClass(key));
|
|
5316
5316
|
}
|
|
5317
5317
|
|
|
5318
5318
|
return acc;
|
|
@@ -5344,26 +5344,26 @@ const createClassNameGenerator = () => {
|
|
|
5344
5344
|
const ClassNameGenerator = createClassNameGenerator();
|
|
5345
5345
|
|
|
5346
5346
|
const globalStateClassesMapping = {
|
|
5347
|
-
active: '
|
|
5348
|
-
checked: '
|
|
5349
|
-
completed: '
|
|
5350
|
-
disabled: '
|
|
5351
|
-
error: '
|
|
5352
|
-
expanded: '
|
|
5353
|
-
focused: '
|
|
5354
|
-
focusVisible: '
|
|
5355
|
-
required: '
|
|
5356
|
-
selected: '
|
|
5347
|
+
active: 'active',
|
|
5348
|
+
checked: 'checked',
|
|
5349
|
+
completed: 'completed',
|
|
5350
|
+
disabled: 'disabled',
|
|
5351
|
+
error: 'error',
|
|
5352
|
+
expanded: 'expanded',
|
|
5353
|
+
focused: 'focused',
|
|
5354
|
+
focusVisible: 'focusVisible',
|
|
5355
|
+
required: 'required',
|
|
5356
|
+
selected: 'selected'
|
|
5357
5357
|
};
|
|
5358
|
-
function generateUtilityClass(componentName, slot) {
|
|
5358
|
+
function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
|
|
5359
5359
|
const globalStateClass = globalStateClassesMapping[slot];
|
|
5360
|
-
return globalStateClass
|
|
5360
|
+
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
|
5361
5361
|
}
|
|
5362
5362
|
|
|
5363
|
-
function generateUtilityClasses(componentName, slots) {
|
|
5363
|
+
function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {
|
|
5364
5364
|
const result = {};
|
|
5365
5365
|
slots.forEach(slot => {
|
|
5366
|
-
result[slot] = generateUtilityClass(componentName, slot);
|
|
5366
|
+
result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
|
|
5367
5367
|
});
|
|
5368
5368
|
return result;
|
|
5369
5369
|
}
|
|
@@ -5433,7 +5433,7 @@ function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
|
5433
5433
|
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
5434
5434
|
var _breakpointsInput$key;
|
|
5435
5435
|
|
|
5436
|
-
const breakpointsInOrder =
|
|
5436
|
+
const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
|
|
5437
5437
|
const breakpointStyleKey = breakpointsInput.up(key);
|
|
5438
5438
|
acc[breakpointStyleKey] = {};
|
|
5439
5439
|
return acc;
|
|
@@ -6104,7 +6104,7 @@ function unstable_createStyleFunctionSx(styleFunctionMapping$1 = styleFunctionMa
|
|
|
6104
6104
|
} = props || {};
|
|
6105
6105
|
|
|
6106
6106
|
if (!sx) {
|
|
6107
|
-
return null; //
|
|
6107
|
+
return null; // Emotion & styled-components will neglect null
|
|
6108
6108
|
}
|
|
6109
6109
|
/*
|
|
6110
6110
|
* Receive `sxInput` as object or callback
|
|
@@ -6169,7 +6169,7 @@ function unstable_createStyleFunctionSx(styleFunctionMapping$1 = styleFunctionMa
|
|
|
6169
6169
|
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
6170
6170
|
styleFunctionSx.filterProps = ['sx'];
|
|
6171
6171
|
|
|
6172
|
-
const _excluded$
|
|
6172
|
+
const _excluded$j = ["sx"];
|
|
6173
6173
|
|
|
6174
6174
|
const splitProps = props => {
|
|
6175
6175
|
const result = {
|
|
@@ -6190,7 +6190,7 @@ function extendSxProp(props) {
|
|
|
6190
6190
|
const {
|
|
6191
6191
|
sx: inSx
|
|
6192
6192
|
} = props,
|
|
6193
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
6193
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$j);
|
|
6194
6194
|
|
|
6195
6195
|
const {
|
|
6196
6196
|
systemProps,
|
|
@@ -6219,48 +6219,9 @@ function extendSxProp(props) {
|
|
|
6219
6219
|
});
|
|
6220
6220
|
}
|
|
6221
6221
|
|
|
6222
|
-
function
|
|
6223
|
-
var k, y, str='';
|
|
6222
|
+
function r$1(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$1(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx$1(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$1(e))&&(n&&(n+=" "),n+=t);return n}
|
|
6224
6223
|
|
|
6225
|
-
|
|
6226
|
-
str += mix;
|
|
6227
|
-
} else if (typeof mix === 'object') {
|
|
6228
|
-
if (Array.isArray(mix)) {
|
|
6229
|
-
for (k=0; k < mix.length; k++) {
|
|
6230
|
-
if (mix[k]) {
|
|
6231
|
-
if (y = toVal(mix[k])) {
|
|
6232
|
-
str && (str += ' ');
|
|
6233
|
-
str += y;
|
|
6234
|
-
}
|
|
6235
|
-
}
|
|
6236
|
-
}
|
|
6237
|
-
} else {
|
|
6238
|
-
for (k in mix) {
|
|
6239
|
-
if (mix[k]) {
|
|
6240
|
-
str && (str += ' ');
|
|
6241
|
-
str += k;
|
|
6242
|
-
}
|
|
6243
|
-
}
|
|
6244
|
-
}
|
|
6245
|
-
}
|
|
6246
|
-
|
|
6247
|
-
return str;
|
|
6248
|
-
}
|
|
6249
|
-
|
|
6250
|
-
function clsx () {
|
|
6251
|
-
var i=0, tmp, x, str='';
|
|
6252
|
-
while (i < arguments.length) {
|
|
6253
|
-
if (tmp = arguments[i++]) {
|
|
6254
|
-
if (x = toVal(tmp)) {
|
|
6255
|
-
str && (str += ' ');
|
|
6256
|
-
str += x;
|
|
6257
|
-
}
|
|
6258
|
-
}
|
|
6259
|
-
}
|
|
6260
|
-
return str;
|
|
6261
|
-
}
|
|
6262
|
-
|
|
6263
|
-
const _excluded$h = ["values", "unit", "step"];
|
|
6224
|
+
const _excluded$i = ["values", "unit", "step"];
|
|
6264
6225
|
|
|
6265
6226
|
const sortBreakpointsValues = values => {
|
|
6266
6227
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
@@ -6296,7 +6257,7 @@ function createBreakpoints(breakpoints) {
|
|
|
6296
6257
|
unit = 'px',
|
|
6297
6258
|
step = 5
|
|
6298
6259
|
} = breakpoints,
|
|
6299
|
-
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$
|
|
6260
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$i);
|
|
6300
6261
|
|
|
6301
6262
|
const sortedValues = sortBreakpointsValues(values);
|
|
6302
6263
|
const keys = Object.keys(sortedValues);
|
|
@@ -6382,7 +6343,7 @@ function createSpacing(spacingInput = 8) {
|
|
|
6382
6343
|
return spacing;
|
|
6383
6344
|
}
|
|
6384
6345
|
|
|
6385
|
-
const _excluded$
|
|
6346
|
+
const _excluded$h = ["breakpoints", "palette", "spacing", "shape"];
|
|
6386
6347
|
|
|
6387
6348
|
function createTheme$1(options = {}, ...args) {
|
|
6388
6349
|
const {
|
|
@@ -6391,7 +6352,7 @@ function createTheme$1(options = {}, ...args) {
|
|
|
6391
6352
|
spacing: spacingInput,
|
|
6392
6353
|
shape: shapeInput = {}
|
|
6393
6354
|
} = options,
|
|
6394
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
6355
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$h);
|
|
6395
6356
|
|
|
6396
6357
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
6397
6358
|
const spacing = createSpacing(spacingInput);
|
|
@@ -6474,7 +6435,7 @@ function useTheme$2(defaultTheme = systemDefaultTheme$1) {
|
|
|
6474
6435
|
return useTheme$3(defaultTheme);
|
|
6475
6436
|
}
|
|
6476
6437
|
|
|
6477
|
-
const _excluded$
|
|
6438
|
+
const _excluded$g = ["className", "component"];
|
|
6478
6439
|
function createBox(options = {}) {
|
|
6479
6440
|
const {
|
|
6480
6441
|
defaultTheme,
|
|
@@ -6491,12 +6452,12 @@ function createBox(options = {}) {
|
|
|
6491
6452
|
className,
|
|
6492
6453
|
component = 'div'
|
|
6493
6454
|
} = _extendSxProp,
|
|
6494
|
-
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$
|
|
6455
|
+
other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded$g);
|
|
6495
6456
|
|
|
6496
6457
|
return /*#__PURE__*/jsxRuntime.exports.jsx(BoxRoot, _extends$1({
|
|
6497
6458
|
as: component,
|
|
6498
6459
|
ref: ref,
|
|
6499
|
-
className: clsx(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),
|
|
6460
|
+
className: clsx$1(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),
|
|
6500
6461
|
theme: theme
|
|
6501
6462
|
}, other));
|
|
6502
6463
|
});
|
|
@@ -6505,7 +6466,7 @@ function createBox(options = {}) {
|
|
|
6505
6466
|
|
|
6506
6467
|
createBox();
|
|
6507
6468
|
|
|
6508
|
-
const _excluded$
|
|
6469
|
+
const _excluded$f = ["variant"];
|
|
6509
6470
|
|
|
6510
6471
|
function isEmpty$2(string) {
|
|
6511
6472
|
return string.length === 0;
|
|
@@ -6521,7 +6482,7 @@ function propsToClassKey(props) {
|
|
|
6521
6482
|
const {
|
|
6522
6483
|
variant
|
|
6523
6484
|
} = props,
|
|
6524
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
6485
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$f);
|
|
6525
6486
|
|
|
6526
6487
|
let classKey = variant || '';
|
|
6527
6488
|
Object.keys(other).sort().forEach(key => {
|
|
@@ -6534,7 +6495,7 @@ function propsToClassKey(props) {
|
|
|
6534
6495
|
return classKey;
|
|
6535
6496
|
}
|
|
6536
6497
|
|
|
6537
|
-
const _excluded$
|
|
6498
|
+
const _excluded$e = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"],
|
|
6538
6499
|
_excluded2$3 = ["theme"],
|
|
6539
6500
|
_excluded3 = ["theme"];
|
|
6540
6501
|
|
|
@@ -6613,7 +6574,7 @@ function createStyled(input = {}) {
|
|
|
6613
6574
|
skipSx: inputSkipSx,
|
|
6614
6575
|
overridesResolver
|
|
6615
6576
|
} = inputOptions,
|
|
6616
|
-
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$
|
|
6577
|
+
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$e); // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
6617
6578
|
|
|
6618
6579
|
|
|
6619
6580
|
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
|
|
@@ -6636,7 +6597,7 @@ function createStyled(input = {}) {
|
|
|
6636
6597
|
|
|
6637
6598
|
const muiStyledResolver = (styleArg, ...expressions) => {
|
|
6638
6599
|
const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => {
|
|
6639
|
-
// On the server
|
|
6600
|
+
// On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
6640
6601
|
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
6641
6602
|
// which are basically components used as a selectors.
|
|
6642
6603
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -6695,7 +6656,7 @@ function createStyled(input = {}) {
|
|
|
6695
6656
|
|
|
6696
6657
|
transformedStyleArg = [...styleArg, ...placeholders];
|
|
6697
6658
|
transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
|
|
6698
|
-
} else if (typeof styleArg === 'function' && // On the server
|
|
6659
|
+
} else if (typeof styleArg === 'function' && // On the server Emotion doesn't use React.forwardRef for creating components, so the created
|
|
6699
6660
|
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
6700
6661
|
// which are basically components used as a selectors.
|
|
6701
6662
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -6791,7 +6752,7 @@ function hexToRgb(color) {
|
|
|
6791
6752
|
* Returns an object with the type and values of a color.
|
|
6792
6753
|
*
|
|
6793
6754
|
* Note: Does not support rgb % values.
|
|
6794
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
|
6755
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
6795
6756
|
* @returns {object} - A MUI color object: {type: string, values: number[]}
|
|
6796
6757
|
*/
|
|
6797
6758
|
|
|
@@ -6841,7 +6802,7 @@ function decomposeColor(color) {
|
|
|
6841
6802
|
/**
|
|
6842
6803
|
* Returns a channel created from the input color.
|
|
6843
6804
|
*
|
|
6844
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
|
6805
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
6845
6806
|
* @returns {string} - The channel for the color, that can be used in rgba or hsla colors
|
|
6846
6807
|
*/
|
|
6847
6808
|
|
|
@@ -6852,7 +6813,7 @@ const colorChannel = color => {
|
|
|
6852
6813
|
/**
|
|
6853
6814
|
* Converts a color object with type and values to a string.
|
|
6854
6815
|
* @param {object} color - Decomposed color
|
|
6855
|
-
* @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'
|
|
6816
|
+
* @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'
|
|
6856
6817
|
* @param {array} color.values - [n,n,n] or [n,n,n,n]
|
|
6857
6818
|
* @returns {string} A CSS color string
|
|
6858
6819
|
*/
|
|
@@ -7019,6 +6980,17 @@ function lighten(color, coefficient) {
|
|
|
7019
6980
|
|
|
7020
6981
|
return recomposeColor(color);
|
|
7021
6982
|
}
|
|
6983
|
+
/**
|
|
6984
|
+
* Darken or lighten a color, depending on its luminance.
|
|
6985
|
+
* Light colors are darkened, dark colors are lightened.
|
|
6986
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
6987
|
+
* @param {number} coefficient=0.15 - multiplier in the range 0 - 1
|
|
6988
|
+
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
6989
|
+
*/
|
|
6990
|
+
|
|
6991
|
+
function emphasize(color, coefficient = 0.15) {
|
|
6992
|
+
return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);
|
|
6993
|
+
}
|
|
7022
6994
|
|
|
7023
6995
|
function InnerThemeProvider(props) {
|
|
7024
6996
|
const theme = useTheme$2();
|
|
@@ -7135,13 +7107,9 @@ const getCssValue = (keys, value) => {
|
|
|
7135
7107
|
* @param {Object} theme
|
|
7136
7108
|
* @param {{
|
|
7137
7109
|
* prefix?: string,
|
|
7138
|
-
* basePrefix?: string,
|
|
7139
7110
|
* shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean
|
|
7140
7111
|
* }} options.
|
|
7141
|
-
* `
|
|
7142
|
-
* `prefix`: defined by application
|
|
7143
|
-
*
|
|
7144
|
-
* the CSS variable value will be adjusted based on the provided `basePrefix` & `prefix` which can be found in `parsedTheme`.
|
|
7112
|
+
* `prefix`: The prefix of the generated CSS variables. This function does not change the value.
|
|
7145
7113
|
*
|
|
7146
7114
|
* @returns {{ css: Object, vars: Object, parsedTheme: typeof theme }} `css` is the stylesheet, `vars` is an object to get css variable (same structure as theme), and `parsedTheme` is the cloned version of theme.
|
|
7147
7115
|
*
|
|
@@ -7152,16 +7120,15 @@ const getCssValue = (keys, value) => {
|
|
|
7152
7120
|
* palette: { primary: { 500: 'var(--color)' } }
|
|
7153
7121
|
* }, { prefix: 'foo' })
|
|
7154
7122
|
*
|
|
7155
|
-
* console.log(css) // { '--foo-fontSize': '12px', '--foo-lineHeight': 1.2, '--foo-palette-primary-500': 'var(--
|
|
7156
|
-
* console.log(vars) // { fontSize: '--foo-fontSize', lineHeight: '--foo-lineHeight', palette: { primary: { 500: 'var(--foo-palette-primary-500)' } } }
|
|
7157
|
-
* console.log(parsedTheme) // { fontSize: 12, lineHeight: 1.2, palette: { primary: { 500: 'var(--
|
|
7123
|
+
* console.log(css) // { '--foo-fontSize': '12px', '--foo-lineHeight': 1.2, '--foo-palette-primary-500': 'var(--color)' }
|
|
7124
|
+
* console.log(vars) // { fontSize: 'var(--foo-fontSize)', lineHeight: 'var(--foo-lineHeight)', palette: { primary: { 500: 'var(--foo-palette-primary-500)' } } }
|
|
7125
|
+
* console.log(parsedTheme) // { fontSize: 12, lineHeight: 1.2, palette: { primary: { 500: 'var(--color)' } } }
|
|
7158
7126
|
*/
|
|
7159
7127
|
|
|
7160
7128
|
|
|
7161
7129
|
function cssVarsParser(theme, options) {
|
|
7162
7130
|
const {
|
|
7163
7131
|
prefix,
|
|
7164
|
-
basePrefix = '',
|
|
7165
7132
|
shouldSkipGeneratingVar
|
|
7166
7133
|
} = options || {};
|
|
7167
7134
|
const css = {};
|
|
@@ -7169,16 +7136,6 @@ function cssVarsParser(theme, options) {
|
|
|
7169
7136
|
const parsedTheme = {};
|
|
7170
7137
|
walkObjectDeep(theme, (keys, value, arrayKeys) => {
|
|
7171
7138
|
if (typeof value === 'string' || typeof value === 'number') {
|
|
7172
|
-
if (typeof value === 'string' && value.match(/var\(\s*--/)) {
|
|
7173
|
-
// for CSS variable, apply prefix or remove basePrefix from the variable
|
|
7174
|
-
if (!basePrefix && prefix) {
|
|
7175
|
-
value = value.replace(/var\(\s*--/g, `var(--${prefix}-`);
|
|
7176
|
-
} else {
|
|
7177
|
-
value = prefix ? value.replace(new RegExp(`var\\(\\s*--${basePrefix}`, 'g'), `var(--${prefix}`) // removing spaces
|
|
7178
|
-
: value.replace(new RegExp(`var\\(\\s*--${basePrefix}-`, 'g'), 'var(--');
|
|
7179
|
-
}
|
|
7180
|
-
}
|
|
7181
|
-
|
|
7182
7139
|
if (!shouldSkipGeneratingVar || shouldSkipGeneratingVar && !shouldSkipGeneratingVar(keys, value)) {
|
|
7183
7140
|
// only create css & var if `shouldSkipGeneratingVar` return false
|
|
7184
7141
|
const cssVar = `--${prefix ? `${prefix}-` : ''}${keys.join('-')}`;
|
|
@@ -7204,6 +7161,7 @@ const DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme';
|
|
|
7204
7161
|
const DEFAULT_ATTRIBUTE = 'data-color-scheme';
|
|
7205
7162
|
function getInitColorSchemeScript(options) {
|
|
7206
7163
|
const {
|
|
7164
|
+
enableColorScheme = true,
|
|
7207
7165
|
enableSystem = false,
|
|
7208
7166
|
defaultLightColorScheme = 'light',
|
|
7209
7167
|
defaultDarkColorScheme = 'dark',
|
|
@@ -7217,13 +7175,16 @@ function getInitColorSchemeScript(options) {
|
|
|
7217
7175
|
dangerouslySetInnerHTML: {
|
|
7218
7176
|
__html: `(function() { try {
|
|
7219
7177
|
var mode = localStorage.getItem('${modeStorageKey}');
|
|
7178
|
+
var cssColorScheme = mode;
|
|
7220
7179
|
var colorScheme = '';
|
|
7221
7180
|
if (mode === 'system' || (!mode && !!${enableSystem})) {
|
|
7222
7181
|
// handle system mode
|
|
7223
7182
|
var mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
7224
7183
|
if (mql.matches) {
|
|
7184
|
+
cssColorScheme = 'dark';
|
|
7225
7185
|
colorScheme = localStorage.getItem('${colorSchemeStorageKey}-dark') || '${defaultDarkColorScheme}';
|
|
7226
7186
|
} else {
|
|
7187
|
+
cssColorScheme = 'light';
|
|
7227
7188
|
colorScheme = localStorage.getItem('${colorSchemeStorageKey}-light') || '${defaultLightColorScheme}';
|
|
7228
7189
|
}
|
|
7229
7190
|
}
|
|
@@ -7236,6 +7197,9 @@ function getInitColorSchemeScript(options) {
|
|
|
7236
7197
|
if (colorScheme) {
|
|
7237
7198
|
${colorSchemeNode}.setAttribute('${attribute}', colorScheme);
|
|
7238
7199
|
}
|
|
7200
|
+
if (${enableColorScheme} && !!cssColorScheme) {
|
|
7201
|
+
${colorSchemeNode}.style.setProperty('color-scheme', cssColorScheme);
|
|
7202
|
+
}
|
|
7239
7203
|
} catch (e) {} })();`
|
|
7240
7204
|
}
|
|
7241
7205
|
});
|
|
@@ -7393,7 +7357,7 @@ function useCurrentColorScheme(options) {
|
|
|
7393
7357
|
const handleMediaQuery = React.useCallback(e => {
|
|
7394
7358
|
if (state.mode === 'system') {
|
|
7395
7359
|
setState(currentState => _extends$1({}, currentState, {
|
|
7396
|
-
systemMode: e.matches ? 'dark' : 'light'
|
|
7360
|
+
systemMode: e != null && e.matches ? 'dark' : 'light'
|
|
7397
7361
|
}));
|
|
7398
7362
|
}
|
|
7399
7363
|
}, [state.mode]); // Ref hack to avoid adding handleMediaQuery as a dep
|
|
@@ -7466,34 +7430,7 @@ function useCurrentColorScheme(options) {
|
|
|
7466
7430
|
});
|
|
7467
7431
|
}
|
|
7468
7432
|
|
|
7469
|
-
|
|
7470
|
-
* The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
|
|
7471
|
-
* and they does not need to remember the prefix (defined once).
|
|
7472
|
-
*/
|
|
7473
|
-
function createGetCssVar(prefix = '') {
|
|
7474
|
-
function appendVar(...vars) {
|
|
7475
|
-
if (!vars.length) {
|
|
7476
|
-
return '';
|
|
7477
|
-
}
|
|
7478
|
-
|
|
7479
|
-
const value = vars[0];
|
|
7480
|
-
|
|
7481
|
-
if (typeof value === 'string' && !value.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))/)) {
|
|
7482
|
-
return `, var(--${prefix ? `${prefix}-` : ''}${value}${appendVar(...vars.slice(1))})`;
|
|
7483
|
-
}
|
|
7484
|
-
|
|
7485
|
-
return `, ${value}`;
|
|
7486
|
-
} // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
const getCssVar = (field, ...vars) => {
|
|
7490
|
-
return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...vars)})`;
|
|
7491
|
-
};
|
|
7492
|
-
|
|
7493
|
-
return getCssVar;
|
|
7494
|
-
}
|
|
7495
|
-
|
|
7496
|
-
const _excluded$c = ["colorSchemes", "components"];
|
|
7433
|
+
const _excluded$d = ["colorSchemes", "components", "cssVarPrefix"];
|
|
7497
7434
|
const DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';
|
|
7498
7435
|
function createCssVarsProvider(options) {
|
|
7499
7436
|
const {
|
|
@@ -7505,8 +7442,7 @@ function createCssVarsProvider(options) {
|
|
|
7505
7442
|
defaultColorScheme: designSystemColorScheme,
|
|
7506
7443
|
disableTransitionOnChange: designSystemTransitionOnChange = false,
|
|
7507
7444
|
enableColorScheme: designSystemEnableColorScheme = true,
|
|
7508
|
-
|
|
7509
|
-
shouldSkipGeneratingVar,
|
|
7445
|
+
shouldSkipGeneratingVar: designSystemShouldSkipGeneratingVar,
|
|
7510
7446
|
resolveTheme
|
|
7511
7447
|
} = options;
|
|
7512
7448
|
|
|
@@ -7529,7 +7465,6 @@ function createCssVarsProvider(options) {
|
|
|
7529
7465
|
function CssVarsProvider({
|
|
7530
7466
|
children,
|
|
7531
7467
|
theme: themeProp = defaultTheme,
|
|
7532
|
-
prefix = designSystemPrefix,
|
|
7533
7468
|
modeStorageKey = defaultModeStorageKey,
|
|
7534
7469
|
colorSchemeStorageKey = defaultColorSchemeStorageKey,
|
|
7535
7470
|
attribute = defaultAttribute,
|
|
@@ -7540,15 +7475,17 @@ function createCssVarsProvider(options) {
|
|
|
7540
7475
|
storageWindow = typeof window === 'undefined' ? undefined : window,
|
|
7541
7476
|
documentNode = typeof document === 'undefined' ? undefined : document,
|
|
7542
7477
|
colorSchemeNode = typeof document === 'undefined' ? undefined : document.documentElement,
|
|
7543
|
-
colorSchemeSelector = ':root'
|
|
7478
|
+
colorSchemeSelector = ':root',
|
|
7479
|
+
shouldSkipGeneratingVar = designSystemShouldSkipGeneratingVar
|
|
7544
7480
|
}) {
|
|
7545
7481
|
const hasMounted = React.useRef(false);
|
|
7546
7482
|
|
|
7547
7483
|
const {
|
|
7548
7484
|
colorSchemes = {},
|
|
7549
|
-
components = {}
|
|
7485
|
+
components = {},
|
|
7486
|
+
cssVarPrefix
|
|
7550
7487
|
} = themeProp,
|
|
7551
|
-
restThemeProp = _objectWithoutPropertiesLoose(themeProp, _excluded$
|
|
7488
|
+
restThemeProp = _objectWithoutPropertiesLoose(themeProp, _excluded$d);
|
|
7552
7489
|
|
|
7553
7490
|
const allColorSchemes = Object.keys(colorSchemes);
|
|
7554
7491
|
const defaultLightColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.light;
|
|
@@ -7591,16 +7528,14 @@ function createCssVarsProvider(options) {
|
|
|
7591
7528
|
vars: rootVars,
|
|
7592
7529
|
parsedTheme
|
|
7593
7530
|
} = cssVarsParser(theme, {
|
|
7594
|
-
prefix,
|
|
7595
|
-
basePrefix: designSystemPrefix,
|
|
7531
|
+
prefix: cssVarPrefix,
|
|
7596
7532
|
shouldSkipGeneratingVar
|
|
7597
7533
|
});
|
|
7598
7534
|
theme = _extends$1({}, parsedTheme, {
|
|
7599
7535
|
components,
|
|
7600
7536
|
colorSchemes,
|
|
7601
|
-
|
|
7537
|
+
cssVarPrefix,
|
|
7602
7538
|
vars: rootVars,
|
|
7603
|
-
getCssVar: createGetCssVar(prefix),
|
|
7604
7539
|
getColorSchemeSelector: targetColorScheme => `[${attribute}="${targetColorScheme}"] &`
|
|
7605
7540
|
});
|
|
7606
7541
|
const defaultColorSchemeStyleSheet = {};
|
|
@@ -7611,8 +7546,7 @@ function createCssVarsProvider(options) {
|
|
|
7611
7546
|
vars,
|
|
7612
7547
|
parsedTheme: parsedScheme
|
|
7613
7548
|
} = cssVarsParser(scheme, {
|
|
7614
|
-
prefix,
|
|
7615
|
-
basePrefix: designSystemPrefix,
|
|
7549
|
+
prefix: cssVarPrefix,
|
|
7616
7550
|
shouldSkipGeneratingVar
|
|
7617
7551
|
});
|
|
7618
7552
|
theme.vars = deepmerge(theme.vars, vars);
|
|
@@ -7640,7 +7574,7 @@ function createCssVarsProvider(options) {
|
|
|
7640
7574
|
})();
|
|
7641
7575
|
|
|
7642
7576
|
if (key === resolvedDefaultColorScheme) {
|
|
7643
|
-
defaultColorSchemeStyleSheet[colorSchemeSelector] = css;
|
|
7577
|
+
defaultColorSchemeStyleSheet[`${colorSchemeSelector}, [${attribute}="${key}"]`] = css;
|
|
7644
7578
|
} else {
|
|
7645
7579
|
otherColorSchemesStyleSheet[`${colorSchemeSelector === ':root' ? '' : colorSchemeSelector}[${attribute}="${key}"]`] = css;
|
|
7646
7580
|
}
|
|
@@ -7722,7 +7656,8 @@ function createCssVarsProvider(options) {
|
|
|
7722
7656
|
const getInitColorSchemeScript$1 = params => getInitColorSchemeScript(_extends$1({
|
|
7723
7657
|
attribute: defaultAttribute,
|
|
7724
7658
|
colorSchemeStorageKey: defaultColorSchemeStorageKey,
|
|
7725
|
-
modeStorageKey: defaultModeStorageKey
|
|
7659
|
+
modeStorageKey: defaultModeStorageKey,
|
|
7660
|
+
enableColorScheme: designSystemEnableColorScheme
|
|
7726
7661
|
}, params));
|
|
7727
7662
|
|
|
7728
7663
|
return {
|
|
@@ -7732,9 +7667,36 @@ function createCssVarsProvider(options) {
|
|
|
7732
7667
|
};
|
|
7733
7668
|
}
|
|
7734
7669
|
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7670
|
+
/**
|
|
7671
|
+
* The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
|
|
7672
|
+
* and they does not need to remember the prefix (defined once).
|
|
7673
|
+
*/
|
|
7674
|
+
function createGetCssVar$1(prefix = '') {
|
|
7675
|
+
function appendVar(...vars) {
|
|
7676
|
+
if (!vars.length) {
|
|
7677
|
+
return '';
|
|
7678
|
+
}
|
|
7679
|
+
|
|
7680
|
+
const value = vars[0];
|
|
7681
|
+
|
|
7682
|
+
if (typeof value === 'string' && !value.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))/)) {
|
|
7683
|
+
return `, var(--${prefix ? `${prefix}-` : ''}${value}${appendVar(...vars.slice(1))})`;
|
|
7684
|
+
}
|
|
7685
|
+
|
|
7686
|
+
return `, ${value}`;
|
|
7687
|
+
} // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error.
|
|
7688
|
+
|
|
7689
|
+
|
|
7690
|
+
const getCssVar = (field, ...fallbacks) => {
|
|
7691
|
+
return `var(--${prefix ? `${prefix}-` : ''}${field}${appendVar(...fallbacks)})`;
|
|
7692
|
+
};
|
|
7693
|
+
|
|
7694
|
+
return getCssVar;
|
|
7695
|
+
}
|
|
7696
|
+
|
|
7697
|
+
const _excluded$c = ["className", "component", "disableGutters", "fixed", "maxWidth", "classes"];
|
|
7698
|
+
const defaultTheme$3 = createTheme$1();
|
|
7699
|
+
const defaultCreateStyledComponent$1 = styled$1('div', {
|
|
7738
7700
|
name: 'MuiContainer',
|
|
7739
7701
|
slot: 'Root',
|
|
7740
7702
|
overridesResolver: (props, styles) => {
|
|
@@ -7745,10 +7707,10 @@ const defaultCreateStyledComponent = styled$1('div', {
|
|
|
7745
7707
|
}
|
|
7746
7708
|
});
|
|
7747
7709
|
|
|
7748
|
-
const useThemePropsDefault = inProps => useThemeProps$1({
|
|
7710
|
+
const useThemePropsDefault$1 = inProps => useThemeProps$1({
|
|
7749
7711
|
props: inProps,
|
|
7750
7712
|
name: 'MuiContainer',
|
|
7751
|
-
defaultTheme: defaultTheme$
|
|
7713
|
+
defaultTheme: defaultTheme$3
|
|
7752
7714
|
});
|
|
7753
7715
|
|
|
7754
7716
|
const useUtilityClasses$1 = (ownerState, componentName) => {
|
|
@@ -7771,8 +7733,8 @@ const useUtilityClasses$1 = (ownerState, componentName) => {
|
|
|
7771
7733
|
function createContainer(options = {}) {
|
|
7772
7734
|
const {
|
|
7773
7735
|
// This will allow adding custom styled fn (for example for custom sx style function)
|
|
7774
|
-
createStyledComponent = defaultCreateStyledComponent,
|
|
7775
|
-
useThemeProps = useThemePropsDefault,
|
|
7736
|
+
createStyledComponent = defaultCreateStyledComponent$1,
|
|
7737
|
+
useThemeProps = useThemePropsDefault$1,
|
|
7776
7738
|
componentName = 'MuiContainer'
|
|
7777
7739
|
} = options;
|
|
7778
7740
|
const ContainerRoot = createStyledComponent(({
|
|
@@ -7834,7 +7796,7 @@ function createContainer(options = {}) {
|
|
|
7834
7796
|
fixed = false,
|
|
7835
7797
|
maxWidth = 'lg'
|
|
7836
7798
|
} = props,
|
|
7837
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
7799
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$c);
|
|
7838
7800
|
|
|
7839
7801
|
const ownerState = _extends$1({}, props, {
|
|
7840
7802
|
component,
|
|
@@ -7852,7 +7814,7 @@ function createContainer(options = {}) {
|
|
|
7852
7814
|
as: component // @ts-ignore module augmentation fails if custom breakpoints are used
|
|
7853
7815
|
,
|
|
7854
7816
|
ownerState: ownerState,
|
|
7855
|
-
className: clsx(classes.root, className),
|
|
7817
|
+
className: clsx$1(classes.root, className),
|
|
7856
7818
|
ref: ref
|
|
7857
7819
|
}, other))
|
|
7858
7820
|
);
|
|
@@ -7876,6 +7838,404 @@ createContainer();
|
|
|
7876
7838
|
|
|
7877
7839
|
generateUtilityClasses('MuiContainer', ['root', 'disableGutters', 'fixed', 'maxWidthXs', 'maxWidthSm', 'maxWidthMd', 'maxWidthLg', 'maxWidthXl']);
|
|
7878
7840
|
|
|
7841
|
+
const traverseBreakpoints = (breakpoints, responsize, iterator) => {
|
|
7842
|
+
const smallestBreakpoint = breakpoints.keys[0]; // the keys is sorted from smallest to largest by `createBreakpoints`.
|
|
7843
|
+
|
|
7844
|
+
if (Array.isArray(responsize)) {
|
|
7845
|
+
responsize.forEach((breakpointValue, index) => {
|
|
7846
|
+
iterator((responsizeStyles, style) => {
|
|
7847
|
+
if (index <= breakpoints.keys.length - 1) {
|
|
7848
|
+
if (index === 0) {
|
|
7849
|
+
Object.assign(responsizeStyles, style);
|
|
7850
|
+
} else {
|
|
7851
|
+
responsizeStyles[breakpoints.up(breakpoints.keys[index])] = style;
|
|
7852
|
+
}
|
|
7853
|
+
}
|
|
7854
|
+
}, breakpointValue);
|
|
7855
|
+
});
|
|
7856
|
+
} else if (responsize && typeof responsize === 'object') {
|
|
7857
|
+
// prevent null
|
|
7858
|
+
// responsize could be a very big object, pick the smallest responsive values
|
|
7859
|
+
const keys = Object.keys(responsize).length > breakpoints.keys.length ? breakpoints.keys : Object.keys(responsize);
|
|
7860
|
+
keys.forEach(key => {
|
|
7861
|
+
if (breakpoints.keys.indexOf(key) !== -1) {
|
|
7862
|
+
// @ts-ignore already checked that responsize is an object
|
|
7863
|
+
const breakpointValue = responsize[key];
|
|
7864
|
+
|
|
7865
|
+
if (breakpointValue !== undefined) {
|
|
7866
|
+
iterator((responsizeStyles, style) => {
|
|
7867
|
+
if (smallestBreakpoint === key) {
|
|
7868
|
+
Object.assign(responsizeStyles, style);
|
|
7869
|
+
} else {
|
|
7870
|
+
responsizeStyles[breakpoints.up(key)] = style;
|
|
7871
|
+
}
|
|
7872
|
+
}, breakpointValue);
|
|
7873
|
+
}
|
|
7874
|
+
}
|
|
7875
|
+
});
|
|
7876
|
+
} else if (typeof responsize === 'number' || typeof responsize === 'string') {
|
|
7877
|
+
iterator((responsizeStyles, style) => {
|
|
7878
|
+
Object.assign(responsizeStyles, style);
|
|
7879
|
+
}, responsize);
|
|
7880
|
+
}
|
|
7881
|
+
};
|
|
7882
|
+
const generateGridSizeStyles = ({
|
|
7883
|
+
theme,
|
|
7884
|
+
ownerState
|
|
7885
|
+
}) => {
|
|
7886
|
+
const styles = {};
|
|
7887
|
+
traverseBreakpoints(theme.breakpoints, ownerState.gridSize, (appendStyle, value) => {
|
|
7888
|
+
let style = {};
|
|
7889
|
+
|
|
7890
|
+
if (value === true) {
|
|
7891
|
+
style = {
|
|
7892
|
+
flexBasis: 0,
|
|
7893
|
+
flexGrow: 1,
|
|
7894
|
+
maxWidth: '100%'
|
|
7895
|
+
};
|
|
7896
|
+
}
|
|
7897
|
+
|
|
7898
|
+
if (value === 'auto') {
|
|
7899
|
+
style = {
|
|
7900
|
+
flexBasis: 'auto',
|
|
7901
|
+
flexGrow: 0,
|
|
7902
|
+
flexShrink: 0,
|
|
7903
|
+
maxWidth: 'none',
|
|
7904
|
+
width: 'auto'
|
|
7905
|
+
};
|
|
7906
|
+
}
|
|
7907
|
+
|
|
7908
|
+
if (typeof value === 'number') {
|
|
7909
|
+
style = {
|
|
7910
|
+
flexGrow: 0,
|
|
7911
|
+
flexBasis: 'auto',
|
|
7912
|
+
width: `calc(100% * ${value} / var(--Grid-columns)${ownerState.nested && ownerState.container ? ` + var(--Grid-columnSpacing)` : ''})`
|
|
7913
|
+
};
|
|
7914
|
+
}
|
|
7915
|
+
|
|
7916
|
+
appendStyle(styles, style);
|
|
7917
|
+
});
|
|
7918
|
+
return styles;
|
|
7919
|
+
};
|
|
7920
|
+
const generateGridOffsetStyles = ({
|
|
7921
|
+
theme,
|
|
7922
|
+
ownerState
|
|
7923
|
+
}) => {
|
|
7924
|
+
const styles = {};
|
|
7925
|
+
traverseBreakpoints(theme.breakpoints, ownerState.gridOffset, (appendStyle, value) => {
|
|
7926
|
+
let style = {};
|
|
7927
|
+
|
|
7928
|
+
if (value === 'auto') {
|
|
7929
|
+
style = {
|
|
7930
|
+
marginLeft: 'auto'
|
|
7931
|
+
};
|
|
7932
|
+
}
|
|
7933
|
+
|
|
7934
|
+
if (typeof value === 'number') {
|
|
7935
|
+
style = {
|
|
7936
|
+
marginLeft: value === 0 ? '0px' : `calc(100% * ${value} / var(--Grid-columns))`
|
|
7937
|
+
};
|
|
7938
|
+
}
|
|
7939
|
+
|
|
7940
|
+
appendStyle(styles, style);
|
|
7941
|
+
});
|
|
7942
|
+
return styles;
|
|
7943
|
+
};
|
|
7944
|
+
const generateGridColumnsStyles = ({
|
|
7945
|
+
theme,
|
|
7946
|
+
ownerState
|
|
7947
|
+
}) => {
|
|
7948
|
+
if (!ownerState.container) {
|
|
7949
|
+
return {};
|
|
7950
|
+
}
|
|
7951
|
+
|
|
7952
|
+
const styles = {
|
|
7953
|
+
'--Grid-columns': 12
|
|
7954
|
+
};
|
|
7955
|
+
traverseBreakpoints(theme.breakpoints, ownerState.columns, (appendStyle, value) => {
|
|
7956
|
+
appendStyle(styles, {
|
|
7957
|
+
'--Grid-columns': value
|
|
7958
|
+
});
|
|
7959
|
+
});
|
|
7960
|
+
return styles;
|
|
7961
|
+
};
|
|
7962
|
+
const generateGridRowSpacingStyles = ({
|
|
7963
|
+
theme,
|
|
7964
|
+
ownerState
|
|
7965
|
+
}) => {
|
|
7966
|
+
if (!ownerState.container) {
|
|
7967
|
+
return {};
|
|
7968
|
+
}
|
|
7969
|
+
|
|
7970
|
+
const styles = {};
|
|
7971
|
+
traverseBreakpoints(theme.breakpoints, ownerState.rowSpacing, (appendStyle, value) => {
|
|
7972
|
+
var _theme$spacing;
|
|
7973
|
+
|
|
7974
|
+
appendStyle(styles, {
|
|
7975
|
+
'--Grid-rowSpacing': typeof value === 'string' ? value : (_theme$spacing = theme.spacing) == null ? void 0 : _theme$spacing.call(theme, value)
|
|
7976
|
+
});
|
|
7977
|
+
});
|
|
7978
|
+
return styles;
|
|
7979
|
+
};
|
|
7980
|
+
const generateGridColumnSpacingStyles = ({
|
|
7981
|
+
theme,
|
|
7982
|
+
ownerState
|
|
7983
|
+
}) => {
|
|
7984
|
+
if (!ownerState.container) {
|
|
7985
|
+
return {};
|
|
7986
|
+
}
|
|
7987
|
+
|
|
7988
|
+
const styles = {};
|
|
7989
|
+
traverseBreakpoints(theme.breakpoints, ownerState.columnSpacing, (appendStyle, value) => {
|
|
7990
|
+
var _theme$spacing2;
|
|
7991
|
+
|
|
7992
|
+
appendStyle(styles, {
|
|
7993
|
+
'--Grid-columnSpacing': typeof value === 'string' ? value : (_theme$spacing2 = theme.spacing) == null ? void 0 : _theme$spacing2.call(theme, value)
|
|
7994
|
+
});
|
|
7995
|
+
});
|
|
7996
|
+
return styles;
|
|
7997
|
+
};
|
|
7998
|
+
const generateGridDirectionStyles = ({
|
|
7999
|
+
theme,
|
|
8000
|
+
ownerState
|
|
8001
|
+
}) => {
|
|
8002
|
+
if (!ownerState.container) {
|
|
8003
|
+
return {};
|
|
8004
|
+
}
|
|
8005
|
+
|
|
8006
|
+
const styles = {};
|
|
8007
|
+
traverseBreakpoints(theme.breakpoints, ownerState.direction, (appendStyle, value) => {
|
|
8008
|
+
appendStyle(styles, {
|
|
8009
|
+
flexDirection: value
|
|
8010
|
+
});
|
|
8011
|
+
});
|
|
8012
|
+
return styles;
|
|
8013
|
+
};
|
|
8014
|
+
const generateGridStyles = ({
|
|
8015
|
+
ownerState
|
|
8016
|
+
}) => {
|
|
8017
|
+
return _extends$1({
|
|
8018
|
+
minWidth: 0,
|
|
8019
|
+
boxSizing: 'border-box'
|
|
8020
|
+
}, ownerState.container ? _extends$1({
|
|
8021
|
+
display: 'flex',
|
|
8022
|
+
flexWrap: 'wrap'
|
|
8023
|
+
}, ownerState.wrap && ownerState.wrap !== 'wrap' && {
|
|
8024
|
+
flexWrap: ownerState.wrap
|
|
8025
|
+
}, {
|
|
8026
|
+
margin: `calc(var(--Grid-rowSpacing) / -2) calc(var(--Grid-columnSpacing) / -2)`
|
|
8027
|
+
}, ownerState.disableEqualOverflow && {
|
|
8028
|
+
margin: `calc(var(--Grid-rowSpacing) * -1) 0px 0px calc(var(--Grid-columnSpacing) * -1)`
|
|
8029
|
+
}, ownerState.nested ? _extends$1({
|
|
8030
|
+
padding: `calc(var(--Grid-nested-rowSpacing) / 2) calc(var(--Grid-nested-columnSpacing) / 2)`
|
|
8031
|
+
}, (ownerState.disableEqualOverflow || ownerState.parentDisableEqualOverflow) && {
|
|
8032
|
+
padding: `calc(var(--Grid-nested-rowSpacing)) 0px 0px calc(var(--Grid-nested-columnSpacing))`
|
|
8033
|
+
}) : {
|
|
8034
|
+
'--Grid-nested-rowSpacing': 'var(--Grid-rowSpacing)',
|
|
8035
|
+
'--Grid-nested-columnSpacing': 'var(--Grid-columnSpacing)'
|
|
8036
|
+
}) : _extends$1({
|
|
8037
|
+
padding: `calc(var(--Grid-rowSpacing) / 2) calc(var(--Grid-columnSpacing) / 2)`
|
|
8038
|
+
}, ownerState.disableEqualOverflow && {
|
|
8039
|
+
padding: `calc(var(--Grid-rowSpacing)) 0px 0px calc(var(--Grid-columnSpacing))`
|
|
8040
|
+
}));
|
|
8041
|
+
};
|
|
8042
|
+
const generateSizeClassNames = gridSize => {
|
|
8043
|
+
const classNames = [];
|
|
8044
|
+
Object.entries(gridSize).forEach(([key, value]) => {
|
|
8045
|
+
if (value !== false && value !== undefined) {
|
|
8046
|
+
classNames.push(`grid-${key}-${String(value)}`);
|
|
8047
|
+
}
|
|
8048
|
+
});
|
|
8049
|
+
return classNames;
|
|
8050
|
+
};
|
|
8051
|
+
const generateSpacingClassNames = (spacing, smallestBreakpoint = 'xs') => {
|
|
8052
|
+
function isValidSpacing(val) {
|
|
8053
|
+
if (val === undefined) {
|
|
8054
|
+
return false;
|
|
8055
|
+
}
|
|
8056
|
+
|
|
8057
|
+
return typeof val === 'string' && !Number.isNaN(Number(val)) || typeof val === 'number' && val > 0;
|
|
8058
|
+
}
|
|
8059
|
+
|
|
8060
|
+
if (isValidSpacing(spacing)) {
|
|
8061
|
+
return [`spacing-${smallestBreakpoint}-${String(spacing)}`];
|
|
8062
|
+
}
|
|
8063
|
+
|
|
8064
|
+
if (typeof spacing === 'object' && !Array.isArray(spacing)) {
|
|
8065
|
+
const classNames = [];
|
|
8066
|
+
Object.entries(spacing).forEach(([key, value]) => {
|
|
8067
|
+
if (isValidSpacing(value)) {
|
|
8068
|
+
classNames.push(`spacing-${key}-${String(value)}`);
|
|
8069
|
+
}
|
|
8070
|
+
});
|
|
8071
|
+
return classNames;
|
|
8072
|
+
}
|
|
8073
|
+
|
|
8074
|
+
return [];
|
|
8075
|
+
};
|
|
8076
|
+
|
|
8077
|
+
const _excluded$b = ["className", "columns", "container", "component", "direction", "wrap", "spacing", "rowSpacing", "columnSpacing", "disableEqualOverflow"];
|
|
8078
|
+
const defaultTheme$2 = createTheme$1(); // widening Theme to any so that the consumer can own the theme structure.
|
|
8079
|
+
|
|
8080
|
+
const defaultCreateStyledComponent = styled$1('div', {
|
|
8081
|
+
name: 'MuiGrid',
|
|
8082
|
+
slot: 'Root',
|
|
8083
|
+
overridesResolver: (props, styles) => styles.root
|
|
8084
|
+
});
|
|
8085
|
+
|
|
8086
|
+
function useThemePropsDefault(props) {
|
|
8087
|
+
return useThemeProps$1({
|
|
8088
|
+
props,
|
|
8089
|
+
name: 'MuiGrid',
|
|
8090
|
+
defaultTheme: defaultTheme$2
|
|
8091
|
+
});
|
|
8092
|
+
}
|
|
8093
|
+
|
|
8094
|
+
function createGrid(options = {}) {
|
|
8095
|
+
const {
|
|
8096
|
+
// This will allow adding custom styled fn (for example for custom sx style function)
|
|
8097
|
+
createStyledComponent = defaultCreateStyledComponent,
|
|
8098
|
+
useThemeProps = useThemePropsDefault,
|
|
8099
|
+
componentName = 'MuiGrid'
|
|
8100
|
+
} = options;
|
|
8101
|
+
const NestedContext = /*#__PURE__*/React.createContext(false);
|
|
8102
|
+
const OverflowContext = /*#__PURE__*/React.createContext(undefined);
|
|
8103
|
+
|
|
8104
|
+
const useUtilityClasses = (ownerState, theme) => {
|
|
8105
|
+
const {
|
|
8106
|
+
container,
|
|
8107
|
+
direction,
|
|
8108
|
+
spacing,
|
|
8109
|
+
wrap,
|
|
8110
|
+
gridSize
|
|
8111
|
+
} = ownerState;
|
|
8112
|
+
const slots = {
|
|
8113
|
+
root: ['root', container && 'container', direction !== 'row' && `direction-xs-${String(direction)}`, wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, ...generateSizeClassNames(gridSize), ...(container ? generateSpacingClassNames(spacing, theme.breakpoints.keys[0]) : [])]
|
|
8114
|
+
};
|
|
8115
|
+
return composeClasses(slots, slot => generateUtilityClass(componentName, slot), {});
|
|
8116
|
+
};
|
|
8117
|
+
|
|
8118
|
+
const GridRoot = createStyledComponent(generateGridColumnsStyles, generateGridColumnSpacingStyles, generateGridRowSpacingStyles, generateGridSizeStyles, generateGridDirectionStyles, generateGridStyles, generateGridOffsetStyles);
|
|
8119
|
+
const Grid = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
8120
|
+
var _inProps$columns, _inProps$spacing, _ref, _inProps$rowSpacing, _ref2, _inProps$columnSpacin, _ref3, _disableEqualOverflow;
|
|
8121
|
+
|
|
8122
|
+
const theme = useTheme$2();
|
|
8123
|
+
const themeProps = useThemeProps(inProps);
|
|
8124
|
+
const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.
|
|
8125
|
+
|
|
8126
|
+
const nested = React.useContext(NestedContext);
|
|
8127
|
+
const overflow = React.useContext(OverflowContext);
|
|
8128
|
+
|
|
8129
|
+
const {
|
|
8130
|
+
className,
|
|
8131
|
+
columns: columnsProp = 12,
|
|
8132
|
+
container = false,
|
|
8133
|
+
component = 'div',
|
|
8134
|
+
direction = 'row',
|
|
8135
|
+
wrap = 'wrap',
|
|
8136
|
+
spacing: spacingProp = 0,
|
|
8137
|
+
rowSpacing: rowSpacingProp = spacingProp,
|
|
8138
|
+
columnSpacing: columnSpacingProp = spacingProp,
|
|
8139
|
+
disableEqualOverflow: themeDisableEqualOverflow
|
|
8140
|
+
} = props,
|
|
8141
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded$b); // Because `disableEqualOverflow` can be set from the theme's defaultProps, the **nested** grid should look at the instance props instead.
|
|
8142
|
+
|
|
8143
|
+
|
|
8144
|
+
let disableEqualOverflow = themeDisableEqualOverflow;
|
|
8145
|
+
|
|
8146
|
+
if (nested && themeDisableEqualOverflow !== undefined) {
|
|
8147
|
+
disableEqualOverflow = inProps.disableEqualOverflow;
|
|
8148
|
+
} // collect breakpoints related props because they can be customized from the theme.
|
|
8149
|
+
|
|
8150
|
+
|
|
8151
|
+
const gridSize = {};
|
|
8152
|
+
const gridOffset = {};
|
|
8153
|
+
const other = {};
|
|
8154
|
+
Object.entries(rest).forEach(([key, val]) => {
|
|
8155
|
+
if (theme.breakpoints.values[key] !== undefined) {
|
|
8156
|
+
gridSize[key] = val;
|
|
8157
|
+
} else if (theme.breakpoints.values[key.replace('Offset', '')] !== undefined) {
|
|
8158
|
+
gridOffset[key.replace('Offset', '')] = val;
|
|
8159
|
+
} else {
|
|
8160
|
+
other[key] = val;
|
|
8161
|
+
}
|
|
8162
|
+
});
|
|
8163
|
+
const columns = (_inProps$columns = inProps.columns) != null ? _inProps$columns : nested ? undefined : columnsProp;
|
|
8164
|
+
const spacing = (_inProps$spacing = inProps.spacing) != null ? _inProps$spacing : nested ? undefined : spacingProp;
|
|
8165
|
+
const rowSpacing = (_ref = (_inProps$rowSpacing = inProps.rowSpacing) != null ? _inProps$rowSpacing : inProps.spacing) != null ? _ref : nested ? undefined : rowSpacingProp;
|
|
8166
|
+
const columnSpacing = (_ref2 = (_inProps$columnSpacin = inProps.columnSpacing) != null ? _inProps$columnSpacin : inProps.spacing) != null ? _ref2 : nested ? undefined : columnSpacingProp;
|
|
8167
|
+
|
|
8168
|
+
const ownerState = _extends$1({}, props, {
|
|
8169
|
+
nested,
|
|
8170
|
+
columns,
|
|
8171
|
+
container,
|
|
8172
|
+
direction,
|
|
8173
|
+
wrap,
|
|
8174
|
+
spacing,
|
|
8175
|
+
rowSpacing,
|
|
8176
|
+
columnSpacing,
|
|
8177
|
+
gridSize,
|
|
8178
|
+
gridOffset,
|
|
8179
|
+
disableEqualOverflow: (_ref3 = (_disableEqualOverflow = disableEqualOverflow) != null ? _disableEqualOverflow : overflow) != null ? _ref3 : false,
|
|
8180
|
+
// use context value if exists.
|
|
8181
|
+
parentDisableEqualOverflow: overflow // for nested grid
|
|
8182
|
+
|
|
8183
|
+
});
|
|
8184
|
+
|
|
8185
|
+
const classes = useUtilityClasses(ownerState, theme);
|
|
8186
|
+
|
|
8187
|
+
let result = /*#__PURE__*/jsxRuntime.exports.jsx(GridRoot, _extends$1({
|
|
8188
|
+
ref: ref,
|
|
8189
|
+
as: component,
|
|
8190
|
+
ownerState: ownerState,
|
|
8191
|
+
className: clsx$1(classes.root, className)
|
|
8192
|
+
}, other));
|
|
8193
|
+
|
|
8194
|
+
if (!nested) {
|
|
8195
|
+
result = /*#__PURE__*/jsxRuntime.exports.jsx(NestedContext.Provider, {
|
|
8196
|
+
value: true,
|
|
8197
|
+
children: result
|
|
8198
|
+
});
|
|
8199
|
+
}
|
|
8200
|
+
|
|
8201
|
+
if (disableEqualOverflow !== undefined && disableEqualOverflow !== (overflow != null ? overflow : false)) {
|
|
8202
|
+
// There are 2 possibilities that should wrap with the OverflowContext to communicate with the nested grids:
|
|
8203
|
+
// 1. It is the root grid with `disableEqualOverflow`.
|
|
8204
|
+
// 2. It is a nested grid with different `disableEqualOverflow` from the context.
|
|
8205
|
+
result = /*#__PURE__*/jsxRuntime.exports.jsx(OverflowContext.Provider, {
|
|
8206
|
+
value: disableEqualOverflow,
|
|
8207
|
+
children: result
|
|
8208
|
+
});
|
|
8209
|
+
}
|
|
8210
|
+
|
|
8211
|
+
return result;
|
|
8212
|
+
});
|
|
8213
|
+
return Grid;
|
|
8214
|
+
}
|
|
8215
|
+
|
|
8216
|
+
/**
|
|
8217
|
+
*
|
|
8218
|
+
* Demos:
|
|
8219
|
+
*
|
|
8220
|
+
* - [Grid (Material UI)](https://mui.com/material-ui/react-grid/)
|
|
8221
|
+
*
|
|
8222
|
+
* API:
|
|
8223
|
+
*
|
|
8224
|
+
* - [Grid API](https://mui.com/system/api/grid/)
|
|
8225
|
+
*/
|
|
8226
|
+
|
|
8227
|
+
createGrid();
|
|
8228
|
+
|
|
8229
|
+
const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
8230
|
+
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
|
|
8231
|
+
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
|
|
8232
|
+
const GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
8233
|
+
generateUtilityClasses('MuiGrid', ['root', 'container', 'item', // spacings
|
|
8234
|
+
...SPACINGS.map(spacing => `spacing-xs-${spacing}`), // direction values
|
|
8235
|
+
...DIRECTIONS.map(direction => `direction-xs-${direction}`), // wrap values
|
|
8236
|
+
...WRAPS.map(wrap => `wrap-xs-${wrap}`), // grid sizes for all breakpoints
|
|
8237
|
+
...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
|
|
8238
|
+
|
|
7879
8239
|
const _excluded$a = ["defaultProps", "mixins", "overrides", "palette", "props", "styleOverrides"],
|
|
7880
8240
|
_excluded2$2 = ["type", "mode"];
|
|
7881
8241
|
function adaptV4Theme(inputTheme) {
|
|
@@ -7980,6 +8340,8 @@ MenuUnstyledContext.displayName = 'MenuUnstyledContext';
|
|
|
7980
8340
|
|
|
7981
8341
|
generateUtilityClasses('MuiMenuUnstyled', ['root', 'listbox', 'expanded']);
|
|
7982
8342
|
|
|
8343
|
+
generateUtilityClasses('MuiPopperUnstyled', ['root']);
|
|
8344
|
+
|
|
7983
8345
|
generateUtilityClasses('MuiMenuItemUnstyled', ['root', 'disabled', 'focusVisible']);
|
|
7984
8346
|
|
|
7985
8347
|
generateUtilityClasses('MuiModal', ['root', 'hidden']);
|
|
@@ -8618,6 +8980,10 @@ function createTheme(options = {}, ...args) {
|
|
|
8618
8980
|
} = options,
|
|
8619
8981
|
other = _objectWithoutPropertiesLoose(options, _excluded$6);
|
|
8620
8982
|
|
|
8983
|
+
if (options.vars) {
|
|
8984
|
+
throw new Error(formatMuiErrorMessage(18));
|
|
8985
|
+
}
|
|
8986
|
+
|
|
8621
8987
|
const palette = createPalette(paletteInput);
|
|
8622
8988
|
const systemTheme = createTheme$1(options);
|
|
8623
8989
|
let muiTheme = deepmerge(systemTheme, {
|
|
@@ -8660,6 +9026,8 @@ const styled = createStyled({
|
|
|
8660
9026
|
rootShouldForwardProp
|
|
8661
9027
|
});
|
|
8662
9028
|
|
|
9029
|
+
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}
|
|
9030
|
+
|
|
8663
9031
|
generateUtilityClasses('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);
|
|
8664
9032
|
|
|
8665
9033
|
const getOverlayAlpha = elevation => {
|
|
@@ -8706,7 +9074,7 @@ styled('div', {
|
|
|
8706
9074
|
}));
|
|
8707
9075
|
});
|
|
8708
9076
|
|
|
8709
|
-
const _excluded$5 = ["colorSchemes"],
|
|
9077
|
+
const _excluded$5 = ["colorSchemes", "cssVarPrefix"],
|
|
8710
9078
|
_excluded2$1 = ["palette"];
|
|
8711
9079
|
const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
8712
9080
|
if (index === 0) {
|
|
@@ -8716,14 +9084,31 @@ const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
|
|
8716
9084
|
const overlay = getOverlayAlpha(index);
|
|
8717
9085
|
return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
|
|
8718
9086
|
});
|
|
9087
|
+
|
|
9088
|
+
function assignNode(obj, keys) {
|
|
9089
|
+
keys.forEach(k => {
|
|
9090
|
+
if (!obj[k]) {
|
|
9091
|
+
obj[k] = {};
|
|
9092
|
+
}
|
|
9093
|
+
});
|
|
9094
|
+
}
|
|
9095
|
+
|
|
9096
|
+
function setColor(obj, key, defaultValue) {
|
|
9097
|
+
obj[key] = obj[key] || defaultValue;
|
|
9098
|
+
}
|
|
9099
|
+
|
|
9100
|
+
const createGetCssVar = (cssVarPrefix = 'mui') => createGetCssVar$1(cssVarPrefix);
|
|
8719
9101
|
function extendTheme(options = {}, ...args) {
|
|
8720
9102
|
var _colorSchemesInput$li, _colorSchemesInput$da, _colorSchemesInput$li2, _colorSchemesInput$li3, _colorSchemesInput$da2, _colorSchemesInput$da3;
|
|
8721
9103
|
|
|
8722
9104
|
const {
|
|
8723
|
-
colorSchemes: colorSchemesInput = {}
|
|
9105
|
+
colorSchemes: colorSchemesInput = {},
|
|
9106
|
+
cssVarPrefix = 'mui'
|
|
8724
9107
|
} = options,
|
|
8725
9108
|
input = _objectWithoutPropertiesLoose(options, _excluded$5);
|
|
8726
9109
|
|
|
9110
|
+
const getCssVar = createGetCssVar(cssVarPrefix);
|
|
9111
|
+
|
|
8727
9112
|
const _createThemeWithoutVa = createTheme(_extends$1({}, input, colorSchemesInput.light && {
|
|
8728
9113
|
palette: (_colorSchemesInput$li = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li.palette
|
|
8729
9114
|
})),
|
|
@@ -8741,20 +9126,26 @@ function extendTheme(options = {}, ...args) {
|
|
|
8741
9126
|
});
|
|
8742
9127
|
|
|
8743
9128
|
let theme = _extends$1({}, muiTheme, {
|
|
9129
|
+
cssVarPrefix,
|
|
9130
|
+
getCssVar,
|
|
8744
9131
|
colorSchemes: _extends$1({}, colorSchemesInput, {
|
|
8745
9132
|
light: _extends$1({}, colorSchemesInput.light, {
|
|
8746
9133
|
palette: lightPalette,
|
|
8747
9134
|
opacity: _extends$1({
|
|
8748
|
-
|
|
8749
|
-
|
|
9135
|
+
inputPlaceholder: 0.42,
|
|
9136
|
+
inputUnderline: 0.42,
|
|
9137
|
+
switchTrackDisabled: 0.12,
|
|
9138
|
+
switchTrack: 0.38
|
|
8750
9139
|
}, (_colorSchemesInput$li2 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li2.opacity),
|
|
8751
9140
|
overlays: ((_colorSchemesInput$li3 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li3.overlays) || []
|
|
8752
9141
|
}),
|
|
8753
9142
|
dark: _extends$1({}, colorSchemesInput.dark, {
|
|
8754
9143
|
palette: darkPalette,
|
|
8755
9144
|
opacity: _extends$1({
|
|
8756
|
-
|
|
8757
|
-
|
|
9145
|
+
inputPlaceholder: 0.5,
|
|
9146
|
+
inputUnderline: 0.7,
|
|
9147
|
+
switchTrackDisabled: 0.2,
|
|
9148
|
+
switchTrack: 0.3
|
|
8758
9149
|
}, (_colorSchemesInput$da2 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da2.opacity),
|
|
8759
9150
|
overlays: ((_colorSchemesInput$da3 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da3.overlays) || defaultDarkOverlays
|
|
8760
9151
|
})
|
|
@@ -8764,23 +9155,142 @@ function extendTheme(options = {}, ...args) {
|
|
|
8764
9155
|
Object.keys(theme.colorSchemes).forEach(key => {
|
|
8765
9156
|
const palette = theme.colorSchemes[key].palette; // attach black & white channels to common node
|
|
8766
9157
|
|
|
8767
|
-
if (key === '
|
|
8768
|
-
palette.common
|
|
8769
|
-
palette.common
|
|
9158
|
+
if (key === 'light') {
|
|
9159
|
+
setColor(palette.common, 'background', '#fff');
|
|
9160
|
+
setColor(palette.common, 'onBackground', '#000');
|
|
9161
|
+
} else {
|
|
9162
|
+
setColor(palette.common, 'background', '#000');
|
|
9163
|
+
setColor(palette.common, 'onBackground', '#fff');
|
|
9164
|
+
} // assign component variables
|
|
9165
|
+
|
|
9166
|
+
|
|
9167
|
+
assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
|
9168
|
+
|
|
9169
|
+
if (key === 'light') {
|
|
9170
|
+
setColor(palette.Alert, 'errorColor', darken(palette.error.light, 0.6));
|
|
9171
|
+
setColor(palette.Alert, 'infoColor', darken(palette.info.light, 0.6));
|
|
9172
|
+
setColor(palette.Alert, 'successColor', darken(palette.success.light, 0.6));
|
|
9173
|
+
setColor(palette.Alert, 'warningColor', darken(palette.warning.light, 0.6));
|
|
9174
|
+
setColor(palette.Alert, 'errorFilledBg', getCssVar('palette-error-main'));
|
|
9175
|
+
setColor(palette.Alert, 'infoFilledBg', getCssVar('palette-info-main'));
|
|
9176
|
+
setColor(palette.Alert, 'successFilledBg', getCssVar('palette-success-main'));
|
|
9177
|
+
setColor(palette.Alert, 'warningFilledBg', getCssVar('palette-warning-main'));
|
|
9178
|
+
setColor(palette.Alert, 'errorFilledColor', lightPalette.getContrastText(palette.error.main));
|
|
9179
|
+
setColor(palette.Alert, 'infoFilledColor', lightPalette.getContrastText(palette.info.main));
|
|
9180
|
+
setColor(palette.Alert, 'successFilledColor', lightPalette.getContrastText(palette.success.main));
|
|
9181
|
+
setColor(palette.Alert, 'warningFilledColor', lightPalette.getContrastText(palette.warning.main));
|
|
9182
|
+
setColor(palette.Alert, 'errorStandardBg', lighten(palette.error.light, 0.9));
|
|
9183
|
+
setColor(palette.Alert, 'infoStandardBg', lighten(palette.info.light, 0.9));
|
|
9184
|
+
setColor(palette.Alert, 'successStandardBg', lighten(palette.success.light, 0.9));
|
|
9185
|
+
setColor(palette.Alert, 'warningStandardBg', lighten(palette.warning.light, 0.9));
|
|
9186
|
+
setColor(palette.Alert, 'errorIconColor', getCssVar('palette-error-light'));
|
|
9187
|
+
setColor(palette.Alert, 'infoIconColor', getCssVar('palette-info-light'));
|
|
9188
|
+
setColor(palette.Alert, 'successIconColor', getCssVar('palette-success-light'));
|
|
9189
|
+
setColor(palette.Alert, 'warningIconColor', getCssVar('palette-warning-light'));
|
|
9190
|
+
setColor(palette.AppBar, 'defaultBg', getCssVar('palette-grey-100'));
|
|
9191
|
+
setColor(palette.Avatar, 'defaultBg', getCssVar('palette-grey-400'));
|
|
9192
|
+
setColor(palette.Chip, 'defaultBorder', getCssVar('palette-grey-400'));
|
|
9193
|
+
setColor(palette.Chip, 'defaultAvatarColor', getCssVar('palette-grey-700'));
|
|
9194
|
+
setColor(palette.Chip, 'defaultIconColor', getCssVar('palette-grey-700'));
|
|
9195
|
+
setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
|
|
9196
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
|
|
9197
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
|
|
9198
|
+
setColor(palette.LinearProgress, 'primaryBg', lighten(palette.primary.main, 0.62));
|
|
9199
|
+
setColor(palette.LinearProgress, 'secondaryBg', lighten(palette.secondary.main, 0.62));
|
|
9200
|
+
setColor(palette.LinearProgress, 'errorBg', lighten(palette.error.main, 0.62));
|
|
9201
|
+
setColor(palette.LinearProgress, 'infoBg', lighten(palette.info.main, 0.62));
|
|
9202
|
+
setColor(palette.LinearProgress, 'successBg', lighten(palette.success.main, 0.62));
|
|
9203
|
+
setColor(palette.LinearProgress, 'warningBg', lighten(palette.warning.main, 0.62));
|
|
9204
|
+
setColor(palette.Skeleton, 'bg', `rgba(${getCssVar('palette-text-primaryChannel')} / 0.11)`);
|
|
9205
|
+
setColor(palette.Slider, 'primaryTrack', lighten(palette.primary.main, 0.62));
|
|
9206
|
+
setColor(palette.Slider, 'secondaryTrack', lighten(palette.secondary.main, 0.62));
|
|
9207
|
+
setColor(palette.Slider, 'errorTrack', lighten(palette.error.main, 0.62));
|
|
9208
|
+
setColor(palette.Slider, 'infoTrack', lighten(palette.info.main, 0.62));
|
|
9209
|
+
setColor(palette.Slider, 'successTrack', lighten(palette.success.main, 0.62));
|
|
9210
|
+
setColor(palette.Slider, 'warningTrack', lighten(palette.warning.main, 0.62));
|
|
9211
|
+
const snackbarContentBackground = emphasize(palette.background.default, 0.8);
|
|
9212
|
+
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
9213
|
+
setColor(palette.SnackbarContent, 'color', lightPalette.getContrastText(snackbarContentBackground));
|
|
9214
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
|
|
9215
|
+
setColor(palette.StepConnector, 'border', getCssVar('palette-grey-400'));
|
|
9216
|
+
setColor(palette.StepContent, 'border', getCssVar('palette-grey-400'));
|
|
9217
|
+
setColor(palette.Switch, 'defaultColor', getCssVar('palette-common-white'));
|
|
9218
|
+
setColor(palette.Switch, 'defaultDisabledColor', getCssVar('palette-grey-100'));
|
|
9219
|
+
setColor(palette.Switch, 'primaryDisabledColor', lighten(palette.primary.main, 0.62));
|
|
9220
|
+
setColor(palette.Switch, 'secondaryDisabledColor', lighten(palette.secondary.main, 0.62));
|
|
9221
|
+
setColor(palette.Switch, 'errorDisabledColor', lighten(palette.error.main, 0.62));
|
|
9222
|
+
setColor(palette.Switch, 'infoDisabledColor', lighten(palette.info.main, 0.62));
|
|
9223
|
+
setColor(palette.Switch, 'successDisabledColor', lighten(palette.success.main, 0.62));
|
|
9224
|
+
setColor(palette.Switch, 'warningDisabledColor', lighten(palette.warning.main, 0.62));
|
|
9225
|
+
setColor(palette.TableCell, 'border', lighten(alpha(palette.divider, 1), 0.88));
|
|
9226
|
+
setColor(palette.Tooltip, 'bg', alpha(palette.grey[700], 0.92));
|
|
8770
9227
|
} else {
|
|
8771
|
-
palette.
|
|
8772
|
-
palette.
|
|
9228
|
+
setColor(palette.Alert, 'errorColor', lighten(palette.error.light, 0.6));
|
|
9229
|
+
setColor(palette.Alert, 'infoColor', lighten(palette.info.light, 0.6));
|
|
9230
|
+
setColor(palette.Alert, 'successColor', lighten(palette.success.light, 0.6));
|
|
9231
|
+
setColor(palette.Alert, 'warningColor', lighten(palette.warning.light, 0.6));
|
|
9232
|
+
setColor(palette.Alert, 'errorFilledBg', getCssVar('palette-error-dark'));
|
|
9233
|
+
setColor(palette.Alert, 'infoFilledBg', getCssVar('palette-info-dark'));
|
|
9234
|
+
setColor(palette.Alert, 'successFilledBg', getCssVar('palette-success-dark'));
|
|
9235
|
+
setColor(palette.Alert, 'warningFilledBg', getCssVar('palette-warning-dark'));
|
|
9236
|
+
setColor(palette.Alert, 'errorFilledColor', darkPalette.getContrastText(palette.error.dark));
|
|
9237
|
+
setColor(palette.Alert, 'infoFilledColor', darkPalette.getContrastText(palette.info.dark));
|
|
9238
|
+
setColor(palette.Alert, 'successFilledColor', darkPalette.getContrastText(palette.success.dark));
|
|
9239
|
+
setColor(palette.Alert, 'warningFilledColor', darkPalette.getContrastText(palette.warning.dark));
|
|
9240
|
+
setColor(palette.Alert, 'errorStandardBg', darken(palette.error.light, 0.9));
|
|
9241
|
+
setColor(palette.Alert, 'infoStandardBg', darken(palette.info.light, 0.9));
|
|
9242
|
+
setColor(palette.Alert, 'successStandardBg', darken(palette.success.light, 0.9));
|
|
9243
|
+
setColor(palette.Alert, 'warningStandardBg', darken(palette.warning.light, 0.9));
|
|
9244
|
+
setColor(palette.Alert, 'errorIconColor', getCssVar('palette-error-main'));
|
|
9245
|
+
setColor(palette.Alert, 'infoIconColor', getCssVar('palette-info-main'));
|
|
9246
|
+
setColor(palette.Alert, 'successIconColor', getCssVar('palette-success-main'));
|
|
9247
|
+
setColor(palette.Alert, 'warningIconColor', getCssVar('palette-warning-main'));
|
|
9248
|
+
setColor(palette.AppBar, 'defaultBg', getCssVar('palette-grey-900'));
|
|
9249
|
+
setColor(palette.AppBar, 'darkBg', getCssVar('palette-background-paper')); // specific for dark mode
|
|
9250
|
+
|
|
9251
|
+
setColor(palette.AppBar, 'darkColor', getCssVar('palette-text-primary')); // specific for dark mode
|
|
9252
|
+
|
|
9253
|
+
setColor(palette.Avatar, 'defaultBg', getCssVar('palette-grey-600'));
|
|
9254
|
+
setColor(palette.Chip, 'defaultBorder', getCssVar('palette-grey-700'));
|
|
9255
|
+
setColor(palette.Chip, 'defaultAvatarColor', getCssVar('palette-grey-300'));
|
|
9256
|
+
setColor(palette.Chip, 'defaultIconColor', getCssVar('palette-grey-300'));
|
|
9257
|
+
setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');
|
|
9258
|
+
setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');
|
|
9259
|
+
setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');
|
|
9260
|
+
setColor(palette.LinearProgress, 'primaryBg', darken(palette.primary.main, 0.5));
|
|
9261
|
+
setColor(palette.LinearProgress, 'secondaryBg', darken(palette.secondary.main, 0.5));
|
|
9262
|
+
setColor(palette.LinearProgress, 'errorBg', darken(palette.error.main, 0.5));
|
|
9263
|
+
setColor(palette.LinearProgress, 'infoBg', darken(palette.info.main, 0.5));
|
|
9264
|
+
setColor(palette.LinearProgress, 'successBg', darken(palette.success.main, 0.5));
|
|
9265
|
+
setColor(palette.LinearProgress, 'warningBg', darken(palette.warning.main, 0.5));
|
|
9266
|
+
setColor(palette.Skeleton, 'bg', `rgba(${getCssVar('palette-text-primaryChannel')} / 0.13)`);
|
|
9267
|
+
setColor(palette.Slider, 'primaryTrack', darken(palette.primary.main, 0.5));
|
|
9268
|
+
setColor(palette.Slider, 'secondaryTrack', darken(palette.secondary.main, 0.5));
|
|
9269
|
+
setColor(palette.Slider, 'errorTrack', darken(palette.error.main, 0.5));
|
|
9270
|
+
setColor(palette.Slider, 'infoTrack', darken(palette.info.main, 0.5));
|
|
9271
|
+
setColor(palette.Slider, 'successTrack', darken(palette.success.main, 0.5));
|
|
9272
|
+
setColor(palette.Slider, 'warningTrack', darken(palette.warning.main, 0.5));
|
|
9273
|
+
const snackbarContentBackground = emphasize(palette.background.default, 0.98);
|
|
9274
|
+
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
|
9275
|
+
setColor(palette.SnackbarContent, 'color', darkPalette.getContrastText(snackbarContentBackground));
|
|
9276
|
+
setColor(palette.SpeedDialAction, 'fabHoverBg', emphasize(palette.background.paper, 0.15));
|
|
9277
|
+
setColor(palette.StepConnector, 'border', getCssVar('palette-grey-600'));
|
|
9278
|
+
setColor(palette.StepContent, 'border', getCssVar('palette-grey-600'));
|
|
9279
|
+
setColor(palette.Switch, 'defaultColor', getCssVar('palette-grey-300'));
|
|
9280
|
+
setColor(palette.Switch, 'defaultDisabledColor', getCssVar('palette-grey-600'));
|
|
9281
|
+
setColor(palette.Switch, 'primaryDisabledColor', darken(palette.primary.main, 0.55));
|
|
9282
|
+
setColor(palette.Switch, 'secondaryDisabledColor', darken(palette.secondary.main, 0.55));
|
|
9283
|
+
setColor(palette.Switch, 'errorDisabledColor', darken(palette.error.main, 0.55));
|
|
9284
|
+
setColor(palette.Switch, 'infoDisabledColor', darken(palette.info.main, 0.55));
|
|
9285
|
+
setColor(palette.Switch, 'successDisabledColor', darken(palette.success.main, 0.55));
|
|
9286
|
+
setColor(palette.Switch, 'warningDisabledColor', darken(palette.warning.main, 0.55));
|
|
9287
|
+
setColor(palette.TableCell, 'border', darken(alpha(palette.divider, 1), 0.68));
|
|
9288
|
+
setColor(palette.Tooltip, 'bg', alpha(palette.grey[700], 0.92));
|
|
8773
9289
|
}
|
|
8774
9290
|
|
|
8775
9291
|
palette.common.backgroundChannel = colorChannel(palette.common.background);
|
|
8776
9292
|
palette.common.onBackgroundChannel = colorChannel(palette.common.onBackground);
|
|
8777
|
-
palette.dividerChannel = colorChannel(palette.divider);
|
|
8778
|
-
// TODO: consider adding `main`, and `light` to palette.grey to make it consistent.
|
|
8779
|
-
|
|
8780
|
-
if (!palette.grey.dark) {
|
|
8781
|
-
palette.grey.dark = palette.grey[700];
|
|
8782
|
-
}
|
|
8783
|
-
|
|
9293
|
+
palette.dividerChannel = colorChannel(palette.divider);
|
|
8784
9294
|
Object.keys(palette).forEach(color => {
|
|
8785
9295
|
const colors = palette[color]; // Color palettes: primary, secondary, error, info, success, and warning
|
|
8786
9296
|
|
|
@@ -8807,18 +9317,28 @@ function extendTheme(options = {}, ...args) {
|
|
|
8807
9317
|
|
|
8808
9318
|
if (colors.secondary) {
|
|
8809
9319
|
palette[color].secondaryChannel = colorChannel(colors.secondary);
|
|
8810
|
-
} // Action colors: action.
|
|
9320
|
+
} // Action colors: action.active, action.selected
|
|
8811
9321
|
|
|
8812
9322
|
|
|
8813
9323
|
if (colors.active) {
|
|
8814
9324
|
palette[color].activeChannel = colorChannel(colors.active);
|
|
8815
9325
|
}
|
|
9326
|
+
|
|
9327
|
+
if (colors.selected) {
|
|
9328
|
+
palette[color].selectedChannel = colorChannel(colors.selected);
|
|
9329
|
+
}
|
|
8816
9330
|
});
|
|
8817
9331
|
});
|
|
8818
9332
|
theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
|
|
8819
9333
|
return theme;
|
|
8820
9334
|
}
|
|
8821
9335
|
|
|
9336
|
+
const shouldSkipGeneratingVar = keys => {
|
|
9337
|
+
var _keys$;
|
|
9338
|
+
|
|
9339
|
+
return !!keys[0].match(/(typography|mixins|breakpoints|direction|transitions)/) || keys[0] === 'palette' && !!((_keys$ = keys[1]) != null && _keys$.match(/(mode|contrastThreshold|tonalOffset)/));
|
|
9340
|
+
};
|
|
9341
|
+
|
|
8822
9342
|
const defaultTheme = extendTheme();
|
|
8823
9343
|
createCssVarsProvider({
|
|
8824
9344
|
theme: defaultTheme,
|
|
@@ -8829,7 +9349,6 @@ createCssVarsProvider({
|
|
|
8829
9349
|
light: 'light',
|
|
8830
9350
|
dark: 'dark'
|
|
8831
9351
|
},
|
|
8832
|
-
prefix: 'md',
|
|
8833
9352
|
resolveTheme: theme => {
|
|
8834
9353
|
const newTheme = _extends$1({}, theme, {
|
|
8835
9354
|
typography: createTypography(theme.palette, theme.typography)
|
|
@@ -8837,7 +9356,7 @@ createCssVarsProvider({
|
|
|
8837
9356
|
|
|
8838
9357
|
return newTheme;
|
|
8839
9358
|
},
|
|
8840
|
-
shouldSkipGeneratingVar
|
|
9359
|
+
shouldSkipGeneratingVar
|
|
8841
9360
|
});
|
|
8842
9361
|
|
|
8843
9362
|
function _setPrototypeOf(o, p) {
|
|
@@ -8903,6 +9422,10 @@ var config = {
|
|
|
8903
9422
|
|
|
8904
9423
|
var TransitionGroupContext = React__default.createContext(null);
|
|
8905
9424
|
|
|
9425
|
+
var forceReflow = function forceReflow(node) {
|
|
9426
|
+
return node.scrollTop;
|
|
9427
|
+
};
|
|
9428
|
+
|
|
8906
9429
|
var UNMOUNTED = 'unmounted';
|
|
8907
9430
|
var EXITED = 'exited';
|
|
8908
9431
|
var ENTERING = 'entering';
|
|
@@ -9122,6 +9645,14 @@ var Transition = /*#__PURE__*/function (_React$Component) {
|
|
|
9122
9645
|
this.cancelNextCallback();
|
|
9123
9646
|
|
|
9124
9647
|
if (nextStatus === ENTERING) {
|
|
9648
|
+
if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
|
9649
|
+
var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749
|
|
9650
|
+
// With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
|
|
9651
|
+
// To make the animation happen, we have to separate each rendering and avoid being processed as batched.
|
|
9652
|
+
|
|
9653
|
+
if (node) forceReflow(node);
|
|
9654
|
+
}
|
|
9655
|
+
|
|
9125
9656
|
this.performEnter(mounting);
|
|
9126
9657
|
} else {
|
|
9127
9658
|
this.performExit();
|
|
@@ -9544,8 +10075,7 @@ var CSSTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
9544
10075
|
|
|
9545
10076
|
|
|
9546
10077
|
if (phase === 'active') {
|
|
9547
|
-
|
|
9548
|
-
node && node.scrollTop;
|
|
10078
|
+
if (node) forceReflow(node);
|
|
9549
10079
|
}
|
|
9550
10080
|
|
|
9551
10081
|
if (className) {
|
|
@@ -10493,7 +11023,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
|
|
|
10493
11023
|
const {
|
|
10494
11024
|
clientX,
|
|
10495
11025
|
clientY
|
|
10496
|
-
} = event.touches ? event.touches[0] : event;
|
|
11026
|
+
} = event.touches && event.touches.length > 0 ? event.touches[0] : event;
|
|
10497
11027
|
rippleX = Math.round(clientX - rect.left);
|
|
10498
11028
|
rippleY = Math.round(clientY - rect.top);
|
|
10499
11029
|
}
|
|
@@ -10579,7 +11109,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
|
|
|
10579
11109
|
stop
|
|
10580
11110
|
}), [pulsate, start, stop]);
|
|
10581
11111
|
return /*#__PURE__*/jsxRuntime.exports.jsx(TouchRippleRoot, _extends$1({
|
|
10582
|
-
className: clsx(
|
|
11112
|
+
className: clsx(touchRippleClasses.root, classes.root, className),
|
|
10583
11113
|
ref: container
|
|
10584
11114
|
}, other, {
|
|
10585
11115
|
children: /*#__PURE__*/jsxRuntime.exports.jsx(TransitionGroup, {
|
|
@@ -10923,7 +11453,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
10923
11453
|
}));
|
|
10924
11454
|
});
|
|
10925
11455
|
|
|
10926
|
-
const buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
|
|
11456
|
+
const buttonClasses = generateUtilityClasses('MuiButton', ['root', 'text', 'textInherit', 'textPrimary', 'textSecondary', 'textSuccess', 'textError', 'textInfo', 'textWarning', 'outlined', 'outlinedInherit', 'outlinedPrimary', 'outlinedSecondary', 'outlinedSuccess', 'outlinedError', 'outlinedInfo', 'outlinedWarning', 'contained', 'containedInherit', 'containedPrimary', 'containedSecondary', 'containedSuccess', 'containedError', 'containedInfo', 'containedWarning', 'disableElevation', 'focusVisible', 'disabled', 'colorInherit', 'textSizeSmall', 'textSizeMedium', 'textSizeLarge', 'outlinedSizeSmall', 'outlinedSizeMedium', 'outlinedSizeLarge', 'containedSizeSmall', 'containedSizeMedium', 'containedSizeLarge', 'sizeMedium', 'sizeSmall', 'sizeLarge', 'fullWidth', 'startIcon', 'endIcon', 'iconSizeSmall', 'iconSizeMedium', 'iconSizeLarge']);
|
|
10927
11457
|
|
|
10928
11458
|
const commonIconStyles = ownerState => _extends$1({}, ownerState.size === 'small' && {
|
|
10929
11459
|
'& > *:nth-of-type(1)': {
|
|
@@ -11424,7 +11954,7 @@ function create$3(definition) {
|
|
|
11424
11954
|
return cache[key];
|
|
11425
11955
|
}
|
|
11426
11956
|
|
|
11427
|
-
const NEBULA_VERSION_HASH = "
|
|
11957
|
+
const NEBULA_VERSION_HASH = "f2d4" ;
|
|
11428
11958
|
ClassNameGenerator.configure(componentName => {
|
|
11429
11959
|
|
|
11430
11960
|
return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
|
|
@@ -11997,7 +12527,7 @@ function boot(_ref2) {
|
|
|
11997
12527
|
const appRef = React__default.createRef();
|
|
11998
12528
|
const element = document.createElement('div');
|
|
11999
12529
|
element.style.display = 'none';
|
|
12000
|
-
element.setAttribute('data-nebulajs-version', "3.0.0-
|
|
12530
|
+
element.setAttribute('data-nebulajs-version', "3.0.0-rc.1" );
|
|
12001
12531
|
element.setAttribute('data-app-id', app.id);
|
|
12002
12532
|
document.body.appendChild(element);
|
|
12003
12533
|
ReactDOM.render( /*#__PURE__*/React__default.createElement(NebulaApp, {
|
|
@@ -14249,8 +14779,8 @@ const MINIMUM_BATCH_SIZE = 100;
|
|
|
14249
14779
|
const classes$9 = {
|
|
14250
14780
|
styledScrollbars: "".concat(PREFIX$9, "-styledScrollbars")
|
|
14251
14781
|
};
|
|
14252
|
-
const
|
|
14253
|
-
["
|
|
14782
|
+
const StyledFixedSizeList = styled(FixedSizeList)(() => ({
|
|
14783
|
+
["&.".concat(classes$9.styledScrollbars)]: {
|
|
14254
14784
|
scrollbarColor: "".concat(scrollBarThumb, " ").concat(scrollBarBackground),
|
|
14255
14785
|
'&::-webkit-scrollbar': {
|
|
14256
14786
|
width: 10,
|
|
@@ -14276,13 +14806,14 @@ function getSizeInfo(_ref) {
|
|
|
14276
14806
|
dense,
|
|
14277
14807
|
height
|
|
14278
14808
|
} = _ref;
|
|
14809
|
+
const sizeHorizontal = 200;
|
|
14279
14810
|
let sizeVertical = checkboxes ? 40 : 33;
|
|
14280
14811
|
|
|
14281
14812
|
if (dense) {
|
|
14282
14813
|
sizeVertical = 20;
|
|
14283
14814
|
}
|
|
14284
14815
|
|
|
14285
|
-
const itemSize = isVertical ? sizeVertical :
|
|
14816
|
+
const itemSize = isVertical ? sizeVertical : sizeHorizontal;
|
|
14286
14817
|
const listHeight = height || 8 * itemSize;
|
|
14287
14818
|
return {
|
|
14288
14819
|
itemSize,
|
|
@@ -14367,13 +14898,22 @@ function ListBox(_ref2) {
|
|
|
14367
14898
|
setIsLoadingData(true);
|
|
14368
14899
|
return new Promise(resolve => {
|
|
14369
14900
|
local.current.timeout = setTimeout(() => {
|
|
14370
|
-
const
|
|
14371
|
-
const reqPromise = model.getListObjectData('/qListObjectDef',
|
|
14372
|
-
|
|
14373
|
-
|
|
14901
|
+
const lastItemInQueue = local.current.queue.slice(-1)[0];
|
|
14902
|
+
const reqPromise = model.getListObjectData('/qListObjectDef', // we need to ask for two payloads
|
|
14903
|
+
// 2nd one is our starting index + MINIMUM_BATCH_SIZE items
|
|
14904
|
+
// 1st one is 2nd ones starting index - MINIMUM_BATCH_SIZE items
|
|
14905
|
+
// we do this because we don't want to miss any items between fast scrolls
|
|
14906
|
+
[{
|
|
14907
|
+
qTop: lastItemInQueue.start > MINIMUM_BATCH_SIZE ? lastItemInQueue.start - MINIMUM_BATCH_SIZE : 0,
|
|
14908
|
+
qHeight: MINIMUM_BATCH_SIZE,
|
|
14909
|
+
qLeft: 0,
|
|
14910
|
+
qWidth: 1
|
|
14911
|
+
}, {
|
|
14912
|
+
qTop: lastItemInQueue.start,
|
|
14913
|
+
qHeight: MINIMUM_BATCH_SIZE,
|
|
14374
14914
|
qLeft: 0,
|
|
14375
14915
|
qWidth: 1
|
|
14376
|
-
})
|
|
14916
|
+
}]).then(p => {
|
|
14377
14917
|
const processedPages = postProcessPages ? postProcessPages(p) : p;
|
|
14378
14918
|
local.current.validPages = true;
|
|
14379
14919
|
listData.current.pages = processedPages;
|
|
@@ -14459,9 +14999,10 @@ function ListBox(_ref2) {
|
|
|
14459
14999
|
const {
|
|
14460
15000
|
frequencyMax
|
|
14461
15001
|
} = layout;
|
|
14462
|
-
return /*#__PURE__*/React__default.createElement(
|
|
15002
|
+
return /*#__PURE__*/React__default.createElement(InfiniteLoader, {
|
|
14463
15003
|
isItemLoaded: isItemLoaded,
|
|
14464
|
-
itemCount:
|
|
15004
|
+
itemCount: listCount || 1 // must be more than 0 or loadMoreItems will never be called again
|
|
15005
|
+
,
|
|
14465
15006
|
loadMoreItems: loadMoreItems,
|
|
14466
15007
|
threshold: 0,
|
|
14467
15008
|
minimumBatchSize: MINIMUM_BATCH_SIZE,
|
|
@@ -14472,11 +15013,10 @@ function ListBox(_ref2) {
|
|
|
14472
15013
|
ref
|
|
14473
15014
|
} = _ref3;
|
|
14474
15015
|
local.current.listRef = ref;
|
|
14475
|
-
return /*#__PURE__*/React__default.createElement(
|
|
15016
|
+
return /*#__PURE__*/React__default.createElement(StyledFixedSizeList, {
|
|
14476
15017
|
direction: direction,
|
|
14477
15018
|
"data-testid": "fixed-size-list",
|
|
14478
15019
|
useIsScrolling: true,
|
|
14479
|
-
style: {},
|
|
14480
15020
|
height: listHeight,
|
|
14481
15021
|
width: width,
|
|
14482
15022
|
itemCount: listCount,
|
|
@@ -15098,38 +15638,57 @@ function ListBoxSearch(_ref) {
|
|
|
15098
15638
|
let {
|
|
15099
15639
|
model,
|
|
15100
15640
|
keyboard,
|
|
15101
|
-
dense = false
|
|
15641
|
+
dense = false,
|
|
15642
|
+
visible = true
|
|
15102
15643
|
} = _ref;
|
|
15103
15644
|
const {
|
|
15104
15645
|
translator
|
|
15105
15646
|
} = useContext(InstanceContext);
|
|
15106
15647
|
const [value, setValue] = useState$1('');
|
|
15648
|
+
const [isSearching, setIsSearching] = useState$1(false);
|
|
15107
15649
|
const theme = useTheme$1();
|
|
15108
15650
|
|
|
15651
|
+
const abortSearch = async () => {
|
|
15652
|
+
await model.abortListObjectSearch(TREE_PATH);
|
|
15653
|
+
setIsSearching(false);
|
|
15654
|
+
};
|
|
15655
|
+
|
|
15656
|
+
useEffect$1(() => {
|
|
15657
|
+
if (!visible && isSearching) {
|
|
15658
|
+
abortSearch();
|
|
15659
|
+
}
|
|
15660
|
+
}, [visible]);
|
|
15661
|
+
|
|
15109
15662
|
const onChange = e => {
|
|
15110
15663
|
setValue(e.target.value);
|
|
15111
15664
|
|
|
15112
15665
|
if (e.target.value.length === 0) {
|
|
15113
|
-
|
|
15666
|
+
abortSearch();
|
|
15114
15667
|
} else {
|
|
15115
15668
|
model.searchListObjectFor(TREE_PATH, e.target.value);
|
|
15669
|
+
setIsSearching(true);
|
|
15116
15670
|
}
|
|
15117
15671
|
};
|
|
15118
15672
|
|
|
15119
15673
|
const onKeyDown = e => {
|
|
15120
15674
|
switch (e.key) {
|
|
15121
15675
|
case 'Enter':
|
|
15122
|
-
//
|
|
15123
|
-
|
|
15124
|
-
|
|
15676
|
+
// Maybe we only want to accept if isSearching is true
|
|
15677
|
+
model.acceptListObjectSearch(TREE_PATH, true);
|
|
15678
|
+
setValue('');
|
|
15125
15679
|
break;
|
|
15126
15680
|
|
|
15127
15681
|
case 'Escape':
|
|
15128
|
-
|
|
15682
|
+
abortSearch();
|
|
15683
|
+
setValue('');
|
|
15129
15684
|
break;
|
|
15130
15685
|
}
|
|
15131
15686
|
};
|
|
15132
15687
|
|
|
15688
|
+
if (!visible) {
|
|
15689
|
+
return null;
|
|
15690
|
+
}
|
|
15691
|
+
|
|
15133
15692
|
return /*#__PURE__*/React__default.createElement(OutlinedInput, {
|
|
15134
15693
|
startAdornment: /*#__PURE__*/React__default.createElement(InputAdornment, {
|
|
15135
15694
|
position: "start"
|
|
@@ -15525,7 +16084,8 @@ function ListBoxPopover(_ref) {
|
|
|
15525
16084
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
15526
16085
|
ref: moreAlignTo
|
|
15527
16086
|
}), /*#__PURE__*/React__default.createElement(ListBoxSearch, {
|
|
15528
|
-
model: model
|
|
16087
|
+
model: model,
|
|
16088
|
+
visible: true
|
|
15529
16089
|
}), /*#__PURE__*/React__default.createElement(ListBox, {
|
|
15530
16090
|
model: model,
|
|
15531
16091
|
selections: selections,
|
|
@@ -16852,7 +17412,6 @@ function ListBoxInline(_ref) {
|
|
|
16852
17412
|
postProcessPages = undefined,
|
|
16853
17413
|
calculatePagesHeight,
|
|
16854
17414
|
showGray = true,
|
|
16855
|
-
sortByState = 1,
|
|
16856
17415
|
scrollState = undefined,
|
|
16857
17416
|
setCount = undefined,
|
|
16858
17417
|
shouldConfirmOnBlur = undefined
|
|
@@ -16903,7 +17462,7 @@ function ListBoxInline(_ref) {
|
|
|
16903
17462
|
return [ref, setRef];
|
|
16904
17463
|
};
|
|
16905
17464
|
|
|
16906
|
-
const listdef =
|
|
17465
|
+
const listdef = {
|
|
16907
17466
|
qInfo: {
|
|
16908
17467
|
qType: 'njsListbox'
|
|
16909
17468
|
},
|
|
@@ -16919,7 +17478,7 @@ function ListBoxInline(_ref) {
|
|
|
16919
17478
|
}],
|
|
16920
17479
|
qDef: {
|
|
16921
17480
|
qSortCriterias: [{
|
|
16922
|
-
qSortByState:
|
|
17481
|
+
qSortByState: 1,
|
|
16923
17482
|
qSortByAscii: 1,
|
|
16924
17483
|
qSortByNumeric: 1,
|
|
16925
17484
|
qSortByLoadOrder: 1
|
|
@@ -16927,8 +17486,8 @@ function ListBoxInline(_ref) {
|
|
|
16927
17486
|
}
|
|
16928
17487
|
},
|
|
16929
17488
|
title
|
|
16930
|
-
}
|
|
16931
|
-
|
|
17489
|
+
};
|
|
17490
|
+
extend$2(true, listdef, properties); // Something something lib dimension
|
|
16932
17491
|
|
|
16933
17492
|
let fieldName;
|
|
16934
17493
|
|
|
@@ -17113,13 +17672,14 @@ function ListBoxInline(_ref) {
|
|
|
17113
17672
|
onConfirm: () => {},
|
|
17114
17673
|
onCancel: () => {}
|
|
17115
17674
|
}
|
|
17116
|
-
}))),
|
|
17675
|
+
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
17117
17676
|
item: true,
|
|
17118
17677
|
ref: searchContainerRef
|
|
17119
17678
|
}, /*#__PURE__*/React__default.createElement(ListBoxSearch, {
|
|
17120
17679
|
model: model,
|
|
17121
17680
|
dense: dense,
|
|
17122
|
-
keyboard: keyboard
|
|
17681
|
+
keyboard: keyboard,
|
|
17682
|
+
visible: searchVisible
|
|
17123
17683
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
17124
17684
|
item: true,
|
|
17125
17685
|
xs: true
|
|
@@ -17150,7 +17710,7 @@ function ListBoxInline(_ref) {
|
|
|
17150
17710
|
keyboard: keyboard,
|
|
17151
17711
|
showGray: showGray,
|
|
17152
17712
|
scrollState: scrollState,
|
|
17153
|
-
sortByState:
|
|
17713
|
+
sortByState: listdef.qListObjectDef.qDef.qSortCriterias[0].qSortByState,
|
|
17154
17714
|
setCount: setCount
|
|
17155
17715
|
});
|
|
17156
17716
|
})));
|
|
@@ -24316,7 +24876,6 @@ const mergeConfigs = (base, c) => ({
|
|
|
24316
24876
|
* @property {PromiseFunction} [options.fetchStart] A function called when the Listbox starts fetching data. Receives the fetch request promise as an argument.
|
|
24317
24877
|
* @property {ReceiverFunction} [options.update] A function which receives an update function which upon call will trigger a data fetch.
|
|
24318
24878
|
* @property {{setScrollPos:function(number):void, initScrollPos:number}} [options.scrollState=] Object including a setScrollPos function that sets current scroll position index. A initial scroll position index.
|
|
24319
|
-
* @property {number=} [options.sortByState=1] Sort by state, detault 1 = sort descending, 0 = no sorting, -1 sort ascending.
|
|
24320
24879
|
* @property {function(number):void} [options.setCount=] A function that gets called with the length of the data in the Listbox.
|
|
24321
24880
|
* @property {boolean} [options.shouldConfirmOnBlur=] A boolean that determines if the listbox should actively confirm selections on blur events.
|
|
24322
24881
|
*/
|
|
@@ -24619,7 +25178,7 @@ function nuked() {
|
|
|
24619
25178
|
* @param {boolean=} [options.toolbar=true] Show the toolbar
|
|
24620
25179
|
* @param {boolean=} [options.checkboxes=false] Show values as checkboxes instead of as fields
|
|
24621
25180
|
* @param {boolean=} [options.dense=false] Reduces padding and text size
|
|
24622
|
-
* @param {
|
|
25181
|
+
* @param {string=} [options.stateName="$"] Sets the state to make selections in
|
|
24623
25182
|
* @param {object=} [options.properties={}] Properties object to extend default properties with
|
|
24624
25183
|
*
|
|
24625
25184
|
* @since 1.1.0
|
|
@@ -24744,7 +25303,7 @@ var enigmaMocker = {exports: {}};
|
|
|
24744
25303
|
var enigmaMocker_dev = {exports: {}};
|
|
24745
25304
|
|
|
24746
25305
|
/*
|
|
24747
|
-
* @nebula.js/enigma-mocker v3.0.0-
|
|
25306
|
+
* @nebula.js/enigma-mocker v3.0.0-alpha13
|
|
24748
25307
|
* Copyright (c) 2022 QlikTech International AB
|
|
24749
25308
|
* Released under the MIT license.
|
|
24750
25309
|
*/
|
|
@@ -24842,128 +25401,138 @@ var enigmaMocker_dev = {exports: {}};
|
|
|
24842
25401
|
return target;
|
|
24843
25402
|
}
|
|
24844
25403
|
|
|
24845
|
-
var
|
|
24846
|
-
var
|
|
24847
|
-
var defineProperty = Object.defineProperty;
|
|
24848
|
-
var gOPD = Object.getOwnPropertyDescriptor;
|
|
25404
|
+
var extend;
|
|
25405
|
+
var hasRequiredExtend;
|
|
24849
25406
|
|
|
24850
|
-
|
|
24851
|
-
if (
|
|
24852
|
-
|
|
24853
|
-
|
|
25407
|
+
function requireExtend() {
|
|
25408
|
+
if (hasRequiredExtend) return extend;
|
|
25409
|
+
hasRequiredExtend = 1;
|
|
25410
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
25411
|
+
var toStr = Object.prototype.toString;
|
|
25412
|
+
var defineProperty = Object.defineProperty;
|
|
25413
|
+
var gOPD = Object.getOwnPropertyDescriptor;
|
|
24854
25414
|
|
|
24855
|
-
|
|
24856
|
-
|
|
24857
|
-
|
|
24858
|
-
|
|
24859
|
-
if (!obj || toStr.call(obj) !== '[object Object]') {
|
|
24860
|
-
return false;
|
|
24861
|
-
}
|
|
25415
|
+
var isArray = function isArray(arr) {
|
|
25416
|
+
if (typeof Array.isArray === 'function') {
|
|
25417
|
+
return Array.isArray(arr);
|
|
25418
|
+
}
|
|
24862
25419
|
|
|
24863
|
-
|
|
24864
|
-
|
|
25420
|
+
return toStr.call(arr) === '[object Array]';
|
|
25421
|
+
};
|
|
24865
25422
|
|
|
24866
|
-
|
|
24867
|
-
|
|
24868
|
-
|
|
24869
|
-
|
|
25423
|
+
var isPlainObject = function isPlainObject(obj) {
|
|
25424
|
+
if (!obj || toStr.call(obj) !== '[object Object]') {
|
|
25425
|
+
return false;
|
|
25426
|
+
}
|
|
24870
25427
|
|
|
25428
|
+
var hasOwnConstructor = hasOwn.call(obj, 'constructor');
|
|
25429
|
+
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); // Not own constructor property must be Object
|
|
24871
25430
|
|
|
24872
|
-
|
|
25431
|
+
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
|
|
25432
|
+
return false;
|
|
25433
|
+
} // Own properties are enumerated firstly, so to speed up,
|
|
25434
|
+
// if last one is own, then all properties are own.
|
|
24873
25435
|
|
|
24874
|
-
for (key in obj) {
|
|
24875
|
-
/**/
|
|
24876
|
-
}
|
|
24877
25436
|
|
|
24878
|
-
|
|
24879
|
-
}; // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
|
|
25437
|
+
var key;
|
|
24880
25438
|
|
|
25439
|
+
for (key in obj) {
|
|
25440
|
+
/**/
|
|
25441
|
+
}
|
|
24881
25442
|
|
|
24882
|
-
|
|
24883
|
-
|
|
24884
|
-
defineProperty(target, options.name, {
|
|
24885
|
-
enumerable: true,
|
|
24886
|
-
configurable: true,
|
|
24887
|
-
value: options.newValue,
|
|
24888
|
-
writable: true
|
|
24889
|
-
});
|
|
24890
|
-
} else {
|
|
24891
|
-
target[options.name] = options.newValue;
|
|
24892
|
-
}
|
|
24893
|
-
}; // Return undefined instead of __proto__ if '__proto__' is not an own property
|
|
25443
|
+
return typeof key === 'undefined' || hasOwn.call(obj, key);
|
|
25444
|
+
}; // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
|
|
24894
25445
|
|
|
24895
25446
|
|
|
24896
|
-
|
|
24897
|
-
|
|
24898
|
-
|
|
24899
|
-
|
|
24900
|
-
|
|
24901
|
-
|
|
24902
|
-
|
|
24903
|
-
|
|
25447
|
+
var setProperty = function setProperty(target, options) {
|
|
25448
|
+
if (defineProperty && options.name === '__proto__') {
|
|
25449
|
+
defineProperty(target, options.name, {
|
|
25450
|
+
enumerable: true,
|
|
25451
|
+
configurable: true,
|
|
25452
|
+
value: options.newValue,
|
|
25453
|
+
writable: true
|
|
25454
|
+
});
|
|
25455
|
+
} else {
|
|
25456
|
+
target[options.name] = options.newValue;
|
|
24904
25457
|
}
|
|
24905
|
-
}
|
|
24906
|
-
|
|
24907
|
-
return obj[name];
|
|
24908
|
-
};
|
|
25458
|
+
}; // Return undefined instead of __proto__ if '__proto__' is not an own property
|
|
24909
25459
|
|
|
24910
|
-
var extend = function extend() {
|
|
24911
|
-
var options, name, src, copy, copyIsArray, clone;
|
|
24912
|
-
var target = arguments[0];
|
|
24913
|
-
var i = 1;
|
|
24914
|
-
var length = arguments.length;
|
|
24915
|
-
var deep = false; // Handle a deep copy situation
|
|
24916
25460
|
|
|
24917
|
-
|
|
24918
|
-
|
|
24919
|
-
|
|
24920
|
-
|
|
24921
|
-
|
|
24922
|
-
|
|
25461
|
+
var getProperty = function getProperty(obj, name) {
|
|
25462
|
+
if (name === '__proto__') {
|
|
25463
|
+
if (!hasOwn.call(obj, name)) {
|
|
25464
|
+
return void 0;
|
|
25465
|
+
} else if (gOPD) {
|
|
25466
|
+
// In early versions of node, obj['__proto__'] is buggy when obj has
|
|
25467
|
+
// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
|
|
25468
|
+
return gOPD(obj, name).value;
|
|
25469
|
+
}
|
|
25470
|
+
}
|
|
24923
25471
|
|
|
24924
|
-
|
|
24925
|
-
|
|
24926
|
-
}
|
|
25472
|
+
return obj[name];
|
|
25473
|
+
};
|
|
24927
25474
|
|
|
24928
|
-
|
|
24929
|
-
options
|
|
25475
|
+
extend = function extend() {
|
|
25476
|
+
var options, name, src, copy, copyIsArray, clone;
|
|
25477
|
+
var target = arguments[0];
|
|
25478
|
+
var i = 1;
|
|
25479
|
+
var length = arguments.length;
|
|
25480
|
+
var deep = false; // Handle a deep copy situation
|
|
24930
25481
|
|
|
24931
|
-
if (
|
|
24932
|
-
|
|
24933
|
-
|
|
24934
|
-
src = getProperty(target, name);
|
|
24935
|
-
copy = getProperty(options, name); // Prevent never-ending loop
|
|
25482
|
+
if (typeof target === 'boolean') {
|
|
25483
|
+
deep = target;
|
|
25484
|
+
target = arguments[1] || {}; // skip the boolean and the target
|
|
24936
25485
|
|
|
24937
|
-
|
|
24938
|
-
|
|
24939
|
-
if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
|
|
24940
|
-
if (copyIsArray) {
|
|
24941
|
-
copyIsArray = false;
|
|
24942
|
-
clone = src && isArray(src) ? src : [];
|
|
24943
|
-
} else {
|
|
24944
|
-
clone = src && isPlainObject(src) ? src : {};
|
|
24945
|
-
} // Never move original objects, clone them
|
|
25486
|
+
i = 2;
|
|
25487
|
+
}
|
|
24946
25488
|
|
|
25489
|
+
if (target == null || typeof target !== 'object' && typeof target !== 'function') {
|
|
25490
|
+
target = {};
|
|
25491
|
+
}
|
|
24947
25492
|
|
|
24948
|
-
|
|
24949
|
-
|
|
24950
|
-
|
|
24951
|
-
|
|
24952
|
-
|
|
24953
|
-
|
|
24954
|
-
|
|
24955
|
-
|
|
24956
|
-
|
|
25493
|
+
for (; i < length; ++i) {
|
|
25494
|
+
options = arguments[i]; // Only deal with non-null/undefined values
|
|
25495
|
+
|
|
25496
|
+
if (options != null) {
|
|
25497
|
+
// Extend the base object
|
|
25498
|
+
for (name in options) {
|
|
25499
|
+
src = getProperty(target, name);
|
|
25500
|
+
copy = getProperty(options, name); // Prevent never-ending loop
|
|
25501
|
+
|
|
25502
|
+
if (target !== copy) {
|
|
25503
|
+
// Recurse if we're merging plain objects or arrays
|
|
25504
|
+
if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
|
|
25505
|
+
if (copyIsArray) {
|
|
25506
|
+
copyIsArray = false;
|
|
25507
|
+
clone = src && isArray(src) ? src : [];
|
|
25508
|
+
} else {
|
|
25509
|
+
clone = src && isPlainObject(src) ? src : {};
|
|
25510
|
+
} // Never move original objects, clone them
|
|
25511
|
+
|
|
25512
|
+
|
|
25513
|
+
setProperty(target, {
|
|
25514
|
+
name: name,
|
|
25515
|
+
newValue: extend(deep, clone, copy)
|
|
25516
|
+
}); // Don't bring in undefined values
|
|
25517
|
+
} else if (typeof copy !== 'undefined') {
|
|
25518
|
+
setProperty(target, {
|
|
25519
|
+
name: name,
|
|
25520
|
+
newValue: copy
|
|
25521
|
+
});
|
|
25522
|
+
}
|
|
24957
25523
|
}
|
|
24958
25524
|
}
|
|
24959
25525
|
}
|
|
24960
|
-
}
|
|
24961
|
-
} // Return the modified object
|
|
25526
|
+
} // Return the modified object
|
|
24962
25527
|
|
|
24963
25528
|
|
|
24964
|
-
|
|
24965
|
-
|
|
25529
|
+
return target;
|
|
25530
|
+
};
|
|
25531
|
+
|
|
25532
|
+
return extend;
|
|
25533
|
+
}
|
|
24966
25534
|
|
|
25535
|
+
var extendExports = requireExtend(); // eslint-disable-next-line no-undef
|
|
24967
25536
|
|
|
24968
25537
|
const crt = globalThis.crypto || {
|
|
24969
25538
|
getRandomValues: () => 123456
|
|
@@ -24976,7 +25545,7 @@ var enigmaMocker_dev = {exports: {}};
|
|
|
24976
25545
|
|
|
24977
25546
|
function CreateSessionObjectMock() {
|
|
24978
25547
|
return props => {
|
|
24979
|
-
const properties =
|
|
25548
|
+
const properties = extendExports({}, props);
|
|
24980
25549
|
properties.qInfo = properties.qInfo || {};
|
|
24981
25550
|
properties.qInfo.qId = properties.qInfo.qId || "mock-".concat(uuidv4());
|
|
24982
25551
|
const mockedInclusions = properties._mock;
|
|
@@ -24984,7 +25553,7 @@ var enigmaMocker_dev = {exports: {}};
|
|
|
24984
25553
|
|
|
24985
25554
|
if (mockedInclusions) {
|
|
24986
25555
|
delete properties._mock;
|
|
24987
|
-
layout =
|
|
25556
|
+
layout = extendExports({}, properties, mockedInclusions);
|
|
24988
25557
|
}
|
|
24989
25558
|
|
|
24990
25559
|
return Promise.resolve(_objectSpread2({
|