@bluemarble/bm-components 0.0.65 → 0.0.70
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/dist/esm/index.js +522 -593
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/hooks/useGrid.d.ts +9 -10
- package/dist/esm/types/components/index.d.ts +1 -3
- package/dist/index.d.ts +11 -39
- package/package.json +1 -2
- package/dist/esm/types/components/utils/DateFormat.d.ts +0 -14
- package/dist/esm/types/components/utils/RouteHelper.d.ts +0 -13
package/dist/esm/index.js
CHANGED
|
@@ -36,6 +36,45 @@ const GridHeader = ({ setOrder, setOrderBy, order, orderBy, titles = [] }) => {
|
|
|
36
36
|
}))));
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
function _extends() {
|
|
40
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
41
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
42
|
+
var source = arguments[i];
|
|
43
|
+
for (var key in source) {
|
|
44
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
45
|
+
target[key] = source[key];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return target;
|
|
50
|
+
};
|
|
51
|
+
return _extends.apply(this, arguments);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function isPlainObject(item) {
|
|
55
|
+
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
56
|
+
}
|
|
57
|
+
function deepmerge(target, source, options = {
|
|
58
|
+
clone: true
|
|
59
|
+
}) {
|
|
60
|
+
const output = options.clone ? _extends({}, target) : target;
|
|
61
|
+
if (isPlainObject(target) && isPlainObject(source)) {
|
|
62
|
+
Object.keys(source).forEach(key => {
|
|
63
|
+
// Avoid prototype pollution
|
|
64
|
+
if (key === '__proto__') {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
|
68
|
+
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
|
69
|
+
output[key] = deepmerge(target[key], source[key], options);
|
|
70
|
+
} else {
|
|
71
|
+
output[key] = source[key];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return output;
|
|
76
|
+
}
|
|
77
|
+
|
|
39
78
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
40
79
|
|
|
41
80
|
function commonjsRequire (path) {
|
|
@@ -1147,6 +1186,37 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
1147
1186
|
|
|
1148
1187
|
var PropTypes = propTypes.exports;
|
|
1149
1188
|
|
|
1189
|
+
/**
|
|
1190
|
+
* WARNING: Don't import this directly.
|
|
1191
|
+
* Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
|
|
1192
|
+
* @param {number} code
|
|
1193
|
+
*/
|
|
1194
|
+
function formatMuiErrorMessage(code) {
|
|
1195
|
+
// Apply babel-plugin-transform-template-literals in loose mode
|
|
1196
|
+
// loose mode is safe iff we're concatenating primitives
|
|
1197
|
+
// see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose
|
|
1198
|
+
/* eslint-disable prefer-template */
|
|
1199
|
+
let url = 'https://mui.com/production-error/?code=' + code;
|
|
1200
|
+
for (let i = 1; i < arguments.length; i += 1) {
|
|
1201
|
+
// rest params over-transpile for this case
|
|
1202
|
+
// eslint-disable-next-line prefer-rest-params
|
|
1203
|
+
url += '&args[]=' + encodeURIComponent(arguments[i]);
|
|
1204
|
+
}
|
|
1205
|
+
return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';
|
|
1206
|
+
/* eslint-enable prefer-template */
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
|
|
1210
|
+
//
|
|
1211
|
+
// A strict capitalization should uppercase the first letter of each word in the sentence.
|
|
1212
|
+
// We only handle the first word.
|
|
1213
|
+
function capitalize(string) {
|
|
1214
|
+
if (typeof string !== 'string') {
|
|
1215
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`capitalize(string)\` expects a string argument.` : formatMuiErrorMessage(7));
|
|
1216
|
+
}
|
|
1217
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1150
1220
|
var jsxRuntime = {exports: {}};
|
|
1151
1221
|
|
|
1152
1222
|
var reactJsxRuntime_production_min = {};
|
|
@@ -2389,124 +2459,41 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
2389
2459
|
jsxRuntime.exports = reactJsxRuntime_development;
|
|
2390
2460
|
}
|
|
2391
2461
|
|
|
2392
|
-
/** @license MUI v5.
|
|
2462
|
+
/** @license MUI v5.11.0
|
|
2393
2463
|
*
|
|
2394
2464
|
* This source code is licensed under the MIT license found in the
|
|
2395
2465
|
* LICENSE file in the root directory of this source tree.
|
|
2396
2466
|
*/
|
|
2397
2467
|
function styled(tag, options) {
|
|
2398
2468
|
const stylesFactory = emStyled(tag, options);
|
|
2399
|
-
|
|
2400
2469
|
if (process.env.NODE_ENV !== 'production') {
|
|
2401
2470
|
return (...styles) => {
|
|
2402
2471
|
const component = typeof tag === 'string' ? `"${tag}"` : 'component';
|
|
2403
|
-
|
|
2404
2472
|
if (styles.length === 0) {
|
|
2405
2473
|
console.error([`MUI: Seems like you called \`styled(${component})()\` without a \`style\` argument.`, 'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join('\n'));
|
|
2406
2474
|
} else if (styles.some(style => style === undefined)) {
|
|
2407
2475
|
console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);
|
|
2408
2476
|
}
|
|
2409
|
-
|
|
2410
2477
|
return stylesFactory(...styles);
|
|
2411
2478
|
};
|
|
2412
2479
|
}
|
|
2413
|
-
|
|
2414
2480
|
return stylesFactory;
|
|
2415
|
-
}
|
|
2481
|
+
}
|
|
2416
2482
|
|
|
2417
2483
|
const responsivePropType = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]) : {};
|
|
2418
2484
|
var responsivePropType$1 = responsivePropType;
|
|
2419
2485
|
|
|
2420
|
-
function _extends() {
|
|
2421
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
2422
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2423
|
-
var source = arguments[i];
|
|
2424
|
-
for (var key in source) {
|
|
2425
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2426
|
-
target[key] = source[key];
|
|
2427
|
-
}
|
|
2428
|
-
}
|
|
2429
|
-
}
|
|
2430
|
-
return target;
|
|
2431
|
-
};
|
|
2432
|
-
return _extends.apply(this, arguments);
|
|
2433
|
-
}
|
|
2434
|
-
|
|
2435
|
-
function isPlainObject(item) {
|
|
2436
|
-
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
2437
|
-
}
|
|
2438
|
-
function deepmerge(target, source, options = {
|
|
2439
|
-
clone: true
|
|
2440
|
-
}) {
|
|
2441
|
-
const output = options.clone ? _extends({}, target) : target;
|
|
2442
|
-
|
|
2443
|
-
if (isPlainObject(target) && isPlainObject(source)) {
|
|
2444
|
-
Object.keys(source).forEach(key => {
|
|
2445
|
-
// Avoid prototype pollution
|
|
2446
|
-
if (key === '__proto__') {
|
|
2447
|
-
return;
|
|
2448
|
-
}
|
|
2449
|
-
|
|
2450
|
-
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
|
2451
|
-
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
|
2452
|
-
output[key] = deepmerge(target[key], source[key], options);
|
|
2453
|
-
} else {
|
|
2454
|
-
output[key] = source[key];
|
|
2455
|
-
}
|
|
2456
|
-
});
|
|
2457
|
-
}
|
|
2458
|
-
|
|
2459
|
-
return output;
|
|
2460
|
-
}
|
|
2461
|
-
|
|
2462
|
-
/**
|
|
2463
|
-
* WARNING: Don't import this directly.
|
|
2464
|
-
* Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
|
|
2465
|
-
* @param {number} code
|
|
2466
|
-
*/
|
|
2467
|
-
function formatMuiErrorMessage(code) {
|
|
2468
|
-
// Apply babel-plugin-transform-template-literals in loose mode
|
|
2469
|
-
// loose mode is safe iff we're concatenating primitives
|
|
2470
|
-
// see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose
|
|
2471
|
-
|
|
2472
|
-
/* eslint-disable prefer-template */
|
|
2473
|
-
let url = 'https://mui.com/production-error/?code=' + code;
|
|
2474
|
-
|
|
2475
|
-
for (let i = 1; i < arguments.length; i += 1) {
|
|
2476
|
-
// rest params over-transpile for this case
|
|
2477
|
-
// eslint-disable-next-line prefer-rest-params
|
|
2478
|
-
url += '&args[]=' + encodeURIComponent(arguments[i]);
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';
|
|
2482
|
-
/* eslint-enable prefer-template */
|
|
2483
|
-
}
|
|
2484
|
-
|
|
2485
|
-
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
|
|
2486
|
-
//
|
|
2487
|
-
// A strict capitalization should uppercase the first letter of each word in the sentence.
|
|
2488
|
-
// We only handle the first word.
|
|
2489
|
-
function capitalize(string) {
|
|
2490
|
-
if (typeof string !== 'string') {
|
|
2491
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`capitalize(string)\` expects a string argument.` : formatMuiErrorMessage(7));
|
|
2492
|
-
}
|
|
2493
|
-
|
|
2494
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
2495
|
-
}
|
|
2496
|
-
|
|
2497
2486
|
function merge(acc, item) {
|
|
2498
2487
|
if (!item) {
|
|
2499
2488
|
return acc;
|
|
2500
2489
|
}
|
|
2501
|
-
|
|
2502
2490
|
return deepmerge(acc, item, {
|
|
2503
2491
|
clone: false // No need to clone deep, it's way faster.
|
|
2504
|
-
|
|
2505
2492
|
});
|
|
2506
2493
|
}
|
|
2507
2494
|
|
|
2495
|
+
// The breakpoint **start** at this value.
|
|
2508
2496
|
// For instance with the first breakpoint xs: [xs, sm[.
|
|
2509
|
-
|
|
2510
2497
|
const values = {
|
|
2511
2498
|
xs: 0,
|
|
2512
2499
|
// phone
|
|
@@ -2517,8 +2504,8 @@ const values = {
|
|
|
2517
2504
|
lg: 1200,
|
|
2518
2505
|
// desktop
|
|
2519
2506
|
xl: 1536 // large screen
|
|
2520
|
-
|
|
2521
2507
|
};
|
|
2508
|
+
|
|
2522
2509
|
const defaultBreakpoints = {
|
|
2523
2510
|
// Sorted ASC by size. That's important.
|
|
2524
2511
|
// It can't be configured as it's used statically for propTypes.
|
|
@@ -2527,7 +2514,6 @@ const defaultBreakpoints = {
|
|
|
2527
2514
|
};
|
|
2528
2515
|
function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
2529
2516
|
const theme = props.theme || {};
|
|
2530
|
-
|
|
2531
2517
|
if (Array.isArray(propValue)) {
|
|
2532
2518
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
2533
2519
|
return propValue.reduce((acc, item, index) => {
|
|
@@ -2535,7 +2521,6 @@ function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
|
2535
2521
|
return acc;
|
|
2536
2522
|
}, {});
|
|
2537
2523
|
}
|
|
2538
|
-
|
|
2539
2524
|
if (typeof propValue === 'object') {
|
|
2540
2525
|
const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
|
|
2541
2526
|
return Object.keys(propValue).reduce((acc, breakpoint) => {
|
|
@@ -2547,18 +2532,14 @@ function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
|
2547
2532
|
const cssKey = breakpoint;
|
|
2548
2533
|
acc[cssKey] = propValue[cssKey];
|
|
2549
2534
|
}
|
|
2550
|
-
|
|
2551
2535
|
return acc;
|
|
2552
2536
|
}, {});
|
|
2553
2537
|
}
|
|
2554
|
-
|
|
2555
2538
|
const output = styleFromPropValue(propValue);
|
|
2556
2539
|
return output;
|
|
2557
2540
|
}
|
|
2558
|
-
|
|
2559
2541
|
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
2560
2542
|
var _breakpointsInput$key;
|
|
2561
|
-
|
|
2562
2543
|
const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
|
|
2563
2544
|
const breakpointStyleKey = breakpointsInput.up(key);
|
|
2564
2545
|
acc[breakpointStyleKey] = {};
|
|
@@ -2570,11 +2551,9 @@ function removeUnusedBreakpoints(breakpointKeys, style) {
|
|
|
2570
2551
|
return breakpointKeys.reduce((acc, key) => {
|
|
2571
2552
|
const breakpointOutput = acc[key];
|
|
2572
2553
|
const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
|
|
2573
|
-
|
|
2574
2554
|
if (isBreakpointUnused) {
|
|
2575
2555
|
delete acc[key];
|
|
2576
2556
|
}
|
|
2577
|
-
|
|
2578
2557
|
return acc;
|
|
2579
2558
|
}, style);
|
|
2580
2559
|
}
|
|
@@ -2582,29 +2561,24 @@ function removeUnusedBreakpoints(breakpointKeys, style) {
|
|
|
2582
2561
|
function getPath(obj, path, checkVars = true) {
|
|
2583
2562
|
if (!path || typeof path !== 'string') {
|
|
2584
2563
|
return null;
|
|
2585
|
-
}
|
|
2586
|
-
|
|
2564
|
+
}
|
|
2587
2565
|
|
|
2566
|
+
// Check if CSS variables are used
|
|
2588
2567
|
if (obj && obj.vars && checkVars) {
|
|
2589
2568
|
const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
|
|
2590
|
-
|
|
2591
2569
|
if (val != null) {
|
|
2592
2570
|
return val;
|
|
2593
2571
|
}
|
|
2594
2572
|
}
|
|
2595
|
-
|
|
2596
2573
|
return path.split('.').reduce((acc, item) => {
|
|
2597
2574
|
if (acc && acc[item] != null) {
|
|
2598
2575
|
return acc[item];
|
|
2599
2576
|
}
|
|
2600
|
-
|
|
2601
2577
|
return null;
|
|
2602
2578
|
}, obj);
|
|
2603
2579
|
}
|
|
2604
|
-
|
|
2605
|
-
function getValue$1(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
2580
|
+
function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
|
|
2606
2581
|
let value;
|
|
2607
|
-
|
|
2608
2582
|
if (typeof themeMapping === 'function') {
|
|
2609
2583
|
value = themeMapping(propValueFinal);
|
|
2610
2584
|
} else if (Array.isArray(themeMapping)) {
|
|
@@ -2612,14 +2586,11 @@ function getValue$1(themeMapping, transform, propValueFinal, userValue = propVal
|
|
|
2612
2586
|
} else {
|
|
2613
2587
|
value = getPath(themeMapping, propValueFinal) || userValue;
|
|
2614
2588
|
}
|
|
2615
|
-
|
|
2616
2589
|
if (transform) {
|
|
2617
|
-
value = transform(value, userValue);
|
|
2590
|
+
value = transform(value, userValue, themeMapping);
|
|
2618
2591
|
}
|
|
2619
|
-
|
|
2620
2592
|
return value;
|
|
2621
2593
|
}
|
|
2622
|
-
|
|
2623
2594
|
function style$1(options) {
|
|
2624
2595
|
const {
|
|
2625
2596
|
prop,
|
|
@@ -2628,35 +2599,30 @@ function style$1(options) {
|
|
|
2628
2599
|
transform
|
|
2629
2600
|
} = options;
|
|
2630
2601
|
|
|
2602
|
+
// false positive
|
|
2603
|
+
// eslint-disable-next-line react/function-component-definition
|
|
2631
2604
|
const fn = props => {
|
|
2632
2605
|
if (props[prop] == null) {
|
|
2633
2606
|
return null;
|
|
2634
2607
|
}
|
|
2635
|
-
|
|
2636
2608
|
const propValue = props[prop];
|
|
2637
2609
|
const theme = props.theme;
|
|
2638
2610
|
const themeMapping = getPath(theme, themeKey) || {};
|
|
2639
|
-
|
|
2640
2611
|
const styleFromPropValue = propValueFinal => {
|
|
2641
|
-
let value =
|
|
2642
|
-
|
|
2612
|
+
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
2643
2613
|
if (propValueFinal === value && typeof propValueFinal === 'string') {
|
|
2644
2614
|
// Haven't found value
|
|
2645
|
-
value =
|
|
2615
|
+
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);
|
|
2646
2616
|
}
|
|
2647
|
-
|
|
2648
2617
|
if (cssProperty === false) {
|
|
2649
2618
|
return value;
|
|
2650
2619
|
}
|
|
2651
|
-
|
|
2652
2620
|
return {
|
|
2653
2621
|
[cssProperty]: value
|
|
2654
2622
|
};
|
|
2655
2623
|
};
|
|
2656
|
-
|
|
2657
2624
|
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
2658
2625
|
};
|
|
2659
|
-
|
|
2660
2626
|
fn.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
2661
2627
|
[prop]: responsivePropType$1
|
|
2662
2628
|
} : {};
|
|
@@ -2672,16 +2638,16 @@ function compose(...styles) {
|
|
|
2672
2638
|
return acc;
|
|
2673
2639
|
}, {});
|
|
2674
2640
|
|
|
2641
|
+
// false positive
|
|
2642
|
+
// eslint-disable-next-line react/function-component-definition
|
|
2675
2643
|
const fn = props => {
|
|
2676
2644
|
return Object.keys(props).reduce((acc, prop) => {
|
|
2677
2645
|
if (handlers[prop]) {
|
|
2678
2646
|
return merge(acc, handlers[prop](props));
|
|
2679
2647
|
}
|
|
2680
|
-
|
|
2681
2648
|
return acc;
|
|
2682
2649
|
}, {});
|
|
2683
2650
|
};
|
|
2684
|
-
|
|
2685
2651
|
fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};
|
|
2686
2652
|
fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);
|
|
2687
2653
|
return fn;
|
|
@@ -2693,7 +2659,6 @@ function memoize(fn) {
|
|
|
2693
2659
|
if (cache[arg] === undefined) {
|
|
2694
2660
|
cache[arg] = fn(arg);
|
|
2695
2661
|
}
|
|
2696
|
-
|
|
2697
2662
|
return cache[arg];
|
|
2698
2663
|
};
|
|
2699
2664
|
}
|
|
@@ -2715,10 +2680,11 @@ const aliases = {
|
|
|
2715
2680
|
marginY: 'my',
|
|
2716
2681
|
paddingX: 'px',
|
|
2717
2682
|
paddingY: 'py'
|
|
2718
|
-
};
|
|
2683
|
+
};
|
|
2684
|
+
|
|
2685
|
+
// memoize() impact:
|
|
2719
2686
|
// From 300,000 ops/sec
|
|
2720
2687
|
// To 350,000 ops/sec
|
|
2721
|
-
|
|
2722
2688
|
const getCssProperties = memoize(prop => {
|
|
2723
2689
|
// It's not a shorthand notation.
|
|
2724
2690
|
if (prop.length > 2) {
|
|
@@ -2728,7 +2694,6 @@ const getCssProperties = memoize(prop => {
|
|
|
2728
2694
|
return [prop];
|
|
2729
2695
|
}
|
|
2730
2696
|
}
|
|
2731
|
-
|
|
2732
2697
|
const [a, b] = prop.split('');
|
|
2733
2698
|
const property = properties[a];
|
|
2734
2699
|
const direction = directions[b] || '';
|
|
@@ -2739,31 +2704,25 @@ const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddin
|
|
|
2739
2704
|
const spacingKeys = [...marginKeys, ...paddingKeys];
|
|
2740
2705
|
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
2741
2706
|
var _getPath;
|
|
2742
|
-
|
|
2743
2707
|
const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;
|
|
2744
|
-
|
|
2745
2708
|
if (typeof themeSpacing === 'number') {
|
|
2746
2709
|
return abs => {
|
|
2747
2710
|
if (typeof abs === 'string') {
|
|
2748
2711
|
return abs;
|
|
2749
2712
|
}
|
|
2750
|
-
|
|
2751
2713
|
if (process.env.NODE_ENV !== 'production') {
|
|
2752
2714
|
if (typeof abs !== 'number') {
|
|
2753
2715
|
console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);
|
|
2754
2716
|
}
|
|
2755
2717
|
}
|
|
2756
|
-
|
|
2757
2718
|
return themeSpacing * abs;
|
|
2758
2719
|
};
|
|
2759
2720
|
}
|
|
2760
|
-
|
|
2761
2721
|
if (Array.isArray(themeSpacing)) {
|
|
2762
2722
|
return abs => {
|
|
2763
2723
|
if (typeof abs === 'string') {
|
|
2764
2724
|
return abs;
|
|
2765
2725
|
}
|
|
2766
|
-
|
|
2767
2726
|
if (process.env.NODE_ENV !== 'production') {
|
|
2768
2727
|
if (!Number.isInteger(abs)) {
|
|
2769
2728
|
console.error([`MUI: The \`theme.${themeKey}\` array type cannot be combined with non integer values.` + `You should either use an integer value that can be used as index, or define the \`theme.${themeKey}\` as a number.`].join('\n'));
|
|
@@ -2771,19 +2730,15 @@ function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
|
2771
2730
|
console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\n'));
|
|
2772
2731
|
}
|
|
2773
2732
|
}
|
|
2774
|
-
|
|
2775
2733
|
return themeSpacing[abs];
|
|
2776
2734
|
};
|
|
2777
2735
|
}
|
|
2778
|
-
|
|
2779
2736
|
if (typeof themeSpacing === 'function') {
|
|
2780
2737
|
return themeSpacing;
|
|
2781
2738
|
}
|
|
2782
|
-
|
|
2783
2739
|
if (process.env.NODE_ENV !== 'production') {
|
|
2784
2740
|
console.error([`MUI: The \`theme.${themeKey}\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\n'));
|
|
2785
2741
|
}
|
|
2786
|
-
|
|
2787
2742
|
return () => undefined;
|
|
2788
2743
|
}
|
|
2789
2744
|
function createUnarySpacing(theme) {
|
|
@@ -2793,18 +2748,14 @@ function getValue(transformer, propValue) {
|
|
|
2793
2748
|
if (typeof propValue === 'string' || propValue == null) {
|
|
2794
2749
|
return propValue;
|
|
2795
2750
|
}
|
|
2796
|
-
|
|
2797
2751
|
const abs = Math.abs(propValue);
|
|
2798
2752
|
const transformed = transformer(abs);
|
|
2799
|
-
|
|
2800
2753
|
if (propValue >= 0) {
|
|
2801
2754
|
return transformed;
|
|
2802
2755
|
}
|
|
2803
|
-
|
|
2804
2756
|
if (typeof transformed === 'number') {
|
|
2805
2757
|
return -transformed;
|
|
2806
2758
|
}
|
|
2807
|
-
|
|
2808
2759
|
return `-${transformed}`;
|
|
2809
2760
|
}
|
|
2810
2761
|
function getStyleFromPropValue(cssProperties, transformer) {
|
|
@@ -2813,75 +2764,72 @@ function getStyleFromPropValue(cssProperties, transformer) {
|
|
|
2813
2764
|
return acc;
|
|
2814
2765
|
}, {});
|
|
2815
2766
|
}
|
|
2816
|
-
|
|
2817
2767
|
function resolveCssProperty(props, keys, prop, transformer) {
|
|
2818
2768
|
// Using a hash computation over an array iteration could be faster, but with only 28 items,
|
|
2819
2769
|
// it's doesn't worth the bundle size.
|
|
2820
2770
|
if (keys.indexOf(prop) === -1) {
|
|
2821
2771
|
return null;
|
|
2822
2772
|
}
|
|
2823
|
-
|
|
2824
2773
|
const cssProperties = getCssProperties(prop);
|
|
2825
2774
|
const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
|
|
2826
2775
|
const propValue = props[prop];
|
|
2827
2776
|
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
2828
2777
|
}
|
|
2829
|
-
|
|
2830
2778
|
function style(props, keys) {
|
|
2831
2779
|
const transformer = createUnarySpacing(props.theme);
|
|
2832
2780
|
return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});
|
|
2833
2781
|
}
|
|
2834
|
-
|
|
2782
|
+
function margin(props) {
|
|
2783
|
+
return style(props, marginKeys);
|
|
2784
|
+
}
|
|
2785
|
+
margin.propTypes = process.env.NODE_ENV !== 'production' ? marginKeys.reduce((obj, key) => {
|
|
2835
2786
|
obj[key] = responsivePropType$1;
|
|
2836
2787
|
return obj;
|
|
2837
2788
|
}, {}) : {};
|
|
2838
|
-
|
|
2789
|
+
margin.filterProps = marginKeys;
|
|
2790
|
+
function padding(props) {
|
|
2791
|
+
return style(props, paddingKeys);
|
|
2792
|
+
}
|
|
2793
|
+
padding.propTypes = process.env.NODE_ENV !== 'production' ? paddingKeys.reduce((obj, key) => {
|
|
2839
2794
|
obj[key] = responsivePropType$1;
|
|
2840
2795
|
return obj;
|
|
2841
2796
|
}, {}) : {};
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
return style(props, spacingKeys);
|
|
2845
|
-
}
|
|
2846
|
-
|
|
2847
|
-
spacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {
|
|
2797
|
+
padding.filterProps = paddingKeys;
|
|
2798
|
+
process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {
|
|
2848
2799
|
obj[key] = responsivePropType$1;
|
|
2849
2800
|
return obj;
|
|
2850
2801
|
}, {}) : {};
|
|
2851
|
-
spacing.filterProps = spacingKeys;
|
|
2852
2802
|
|
|
2853
|
-
function
|
|
2803
|
+
function borderTransform(value) {
|
|
2854
2804
|
if (typeof value !== 'number') {
|
|
2855
2805
|
return value;
|
|
2856
2806
|
}
|
|
2857
|
-
|
|
2858
2807
|
return `${value}px solid`;
|
|
2859
2808
|
}
|
|
2860
|
-
|
|
2861
2809
|
const border = style$1({
|
|
2862
2810
|
prop: 'border',
|
|
2863
2811
|
themeKey: 'borders',
|
|
2864
|
-
transform:
|
|
2812
|
+
transform: borderTransform
|
|
2865
2813
|
});
|
|
2866
2814
|
const borderTop = style$1({
|
|
2867
2815
|
prop: 'borderTop',
|
|
2868
2816
|
themeKey: 'borders',
|
|
2869
|
-
transform:
|
|
2817
|
+
transform: borderTransform
|
|
2870
2818
|
});
|
|
2871
2819
|
const borderRight = style$1({
|
|
2872
2820
|
prop: 'borderRight',
|
|
2873
2821
|
themeKey: 'borders',
|
|
2874
|
-
transform:
|
|
2822
|
+
transform: borderTransform
|
|
2875
2823
|
});
|
|
2876
2824
|
const borderBottom = style$1({
|
|
2877
2825
|
prop: 'borderBottom',
|
|
2878
2826
|
themeKey: 'borders',
|
|
2879
|
-
transform:
|
|
2827
|
+
transform: borderTransform
|
|
2880
2828
|
});
|
|
2881
2829
|
const borderLeft = style$1({
|
|
2882
2830
|
prop: 'borderLeft',
|
|
2883
2831
|
themeKey: 'borders',
|
|
2884
|
-
transform:
|
|
2832
|
+
transform: borderTransform
|
|
2885
2833
|
});
|
|
2886
2834
|
const borderColor = style$1({
|
|
2887
2835
|
prop: 'borderColor',
|
|
@@ -2903,139 +2851,69 @@ const borderLeftColor = style$1({
|
|
|
2903
2851
|
prop: 'borderLeftColor',
|
|
2904
2852
|
themeKey: 'palette'
|
|
2905
2853
|
});
|
|
2854
|
+
|
|
2855
|
+
// false positive
|
|
2856
|
+
// eslint-disable-next-line react/function-component-definition
|
|
2906
2857
|
const borderRadius = props => {
|
|
2907
2858
|
if (props.borderRadius !== undefined && props.borderRadius !== null) {
|
|
2908
2859
|
const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius');
|
|
2909
|
-
|
|
2910
2860
|
const styleFromPropValue = propValue => ({
|
|
2911
2861
|
borderRadius: getValue(transformer, propValue)
|
|
2912
2862
|
});
|
|
2913
|
-
|
|
2914
2863
|
return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
|
|
2915
2864
|
}
|
|
2916
|
-
|
|
2917
2865
|
return null;
|
|
2918
2866
|
};
|
|
2919
2867
|
borderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
2920
2868
|
borderRadius: responsivePropType$1
|
|
2921
2869
|
} : {};
|
|
2922
2870
|
borderRadius.filterProps = ['borderRadius'];
|
|
2923
|
-
|
|
2924
|
-
var borders$1 = borders;
|
|
2925
|
-
|
|
2926
|
-
const displayPrint = style$1({
|
|
2927
|
-
prop: 'displayPrint',
|
|
2928
|
-
cssProperty: false,
|
|
2929
|
-
transform: value => ({
|
|
2930
|
-
'@media print': {
|
|
2931
|
-
display: value
|
|
2932
|
-
}
|
|
2933
|
-
})
|
|
2934
|
-
});
|
|
2935
|
-
const displayRaw = style$1({
|
|
2936
|
-
prop: 'display'
|
|
2937
|
-
});
|
|
2938
|
-
const overflow = style$1({
|
|
2939
|
-
prop: 'overflow'
|
|
2940
|
-
});
|
|
2941
|
-
const textOverflow = style$1({
|
|
2942
|
-
prop: 'textOverflow'
|
|
2943
|
-
});
|
|
2944
|
-
const visibility = style$1({
|
|
2945
|
-
prop: 'visibility'
|
|
2946
|
-
});
|
|
2947
|
-
const whiteSpace = style$1({
|
|
2948
|
-
prop: 'whiteSpace'
|
|
2949
|
-
});
|
|
2950
|
-
var display = compose(displayPrint, displayRaw, overflow, textOverflow, visibility, whiteSpace);
|
|
2951
|
-
|
|
2952
|
-
const flexBasis = style$1({
|
|
2953
|
-
prop: 'flexBasis'
|
|
2954
|
-
});
|
|
2955
|
-
const flexDirection = style$1({
|
|
2956
|
-
prop: 'flexDirection'
|
|
2957
|
-
});
|
|
2958
|
-
const flexWrap = style$1({
|
|
2959
|
-
prop: 'flexWrap'
|
|
2960
|
-
});
|
|
2961
|
-
const justifyContent = style$1({
|
|
2962
|
-
prop: 'justifyContent'
|
|
2963
|
-
});
|
|
2964
|
-
const alignItems = style$1({
|
|
2965
|
-
prop: 'alignItems'
|
|
2966
|
-
});
|
|
2967
|
-
const alignContent = style$1({
|
|
2968
|
-
prop: 'alignContent'
|
|
2969
|
-
});
|
|
2970
|
-
const order = style$1({
|
|
2971
|
-
prop: 'order'
|
|
2972
|
-
});
|
|
2973
|
-
const flex = style$1({
|
|
2974
|
-
prop: 'flex'
|
|
2975
|
-
});
|
|
2976
|
-
const flexGrow = style$1({
|
|
2977
|
-
prop: 'flexGrow'
|
|
2978
|
-
});
|
|
2979
|
-
const flexShrink = style$1({
|
|
2980
|
-
prop: 'flexShrink'
|
|
2981
|
-
});
|
|
2982
|
-
const alignSelf = style$1({
|
|
2983
|
-
prop: 'alignSelf'
|
|
2984
|
-
});
|
|
2985
|
-
const justifyItems = style$1({
|
|
2986
|
-
prop: 'justifyItems'
|
|
2987
|
-
});
|
|
2988
|
-
const justifySelf = style$1({
|
|
2989
|
-
prop: 'justifySelf'
|
|
2990
|
-
});
|
|
2991
|
-
const flexbox = compose(flexBasis, flexDirection, flexWrap, justifyContent, alignItems, alignContent, order, flex, flexGrow, flexShrink, alignSelf, justifyItems, justifySelf);
|
|
2992
|
-
var flexbox$1 = flexbox;
|
|
2871
|
+
compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius);
|
|
2993
2872
|
|
|
2873
|
+
// false positive
|
|
2874
|
+
// eslint-disable-next-line react/function-component-definition
|
|
2994
2875
|
const gap = props => {
|
|
2995
2876
|
if (props.gap !== undefined && props.gap !== null) {
|
|
2996
2877
|
const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap');
|
|
2997
|
-
|
|
2998
2878
|
const styleFromPropValue = propValue => ({
|
|
2999
2879
|
gap: getValue(transformer, propValue)
|
|
3000
2880
|
});
|
|
3001
|
-
|
|
3002
2881
|
return handleBreakpoints(props, props.gap, styleFromPropValue);
|
|
3003
2882
|
}
|
|
3004
|
-
|
|
3005
2883
|
return null;
|
|
3006
2884
|
};
|
|
3007
2885
|
gap.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
3008
2886
|
gap: responsivePropType$1
|
|
3009
2887
|
} : {};
|
|
3010
2888
|
gap.filterProps = ['gap'];
|
|
2889
|
+
|
|
2890
|
+
// false positive
|
|
2891
|
+
// eslint-disable-next-line react/function-component-definition
|
|
3011
2892
|
const columnGap = props => {
|
|
3012
2893
|
if (props.columnGap !== undefined && props.columnGap !== null) {
|
|
3013
2894
|
const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap');
|
|
3014
|
-
|
|
3015
2895
|
const styleFromPropValue = propValue => ({
|
|
3016
2896
|
columnGap: getValue(transformer, propValue)
|
|
3017
2897
|
});
|
|
3018
|
-
|
|
3019
2898
|
return handleBreakpoints(props, props.columnGap, styleFromPropValue);
|
|
3020
2899
|
}
|
|
3021
|
-
|
|
3022
2900
|
return null;
|
|
3023
2901
|
};
|
|
3024
2902
|
columnGap.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
3025
2903
|
columnGap: responsivePropType$1
|
|
3026
2904
|
} : {};
|
|
3027
2905
|
columnGap.filterProps = ['columnGap'];
|
|
2906
|
+
|
|
2907
|
+
// false positive
|
|
2908
|
+
// eslint-disable-next-line react/function-component-definition
|
|
3028
2909
|
const rowGap = props => {
|
|
3029
2910
|
if (props.rowGap !== undefined && props.rowGap !== null) {
|
|
3030
2911
|
const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap');
|
|
3031
|
-
|
|
3032
2912
|
const styleFromPropValue = propValue => ({
|
|
3033
2913
|
rowGap: getValue(transformer, propValue)
|
|
3034
2914
|
});
|
|
3035
|
-
|
|
3036
2915
|
return handleBreakpoints(props, props.rowGap, styleFromPropValue);
|
|
3037
2916
|
}
|
|
3038
|
-
|
|
3039
2917
|
return null;
|
|
3040
2918
|
};
|
|
3041
2919
|
rowGap.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
@@ -3069,264 +2947,457 @@ const gridTemplateAreas = style$1({
|
|
|
3069
2947
|
const gridArea = style$1({
|
|
3070
2948
|
prop: 'gridArea'
|
|
3071
2949
|
});
|
|
3072
|
-
|
|
3073
|
-
var grid$1 = grid;
|
|
2950
|
+
compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
|
3074
2951
|
|
|
3075
|
-
function
|
|
2952
|
+
function paletteTransform(value, userValue) {
|
|
3076
2953
|
if (userValue === 'grey') {
|
|
3077
2954
|
return userValue;
|
|
3078
2955
|
}
|
|
3079
|
-
|
|
3080
2956
|
return value;
|
|
3081
2957
|
}
|
|
3082
|
-
|
|
3083
2958
|
const color = style$1({
|
|
3084
2959
|
prop: 'color',
|
|
3085
2960
|
themeKey: 'palette',
|
|
3086
|
-
transform:
|
|
2961
|
+
transform: paletteTransform
|
|
3087
2962
|
});
|
|
3088
2963
|
const bgcolor = style$1({
|
|
3089
2964
|
prop: 'bgcolor',
|
|
3090
2965
|
cssProperty: 'backgroundColor',
|
|
3091
2966
|
themeKey: 'palette',
|
|
3092
|
-
transform:
|
|
2967
|
+
transform: paletteTransform
|
|
3093
2968
|
});
|
|
3094
2969
|
const backgroundColor = style$1({
|
|
3095
2970
|
prop: 'backgroundColor',
|
|
3096
2971
|
themeKey: 'palette',
|
|
3097
|
-
transform:
|
|
3098
|
-
});
|
|
3099
|
-
const palette = compose(color, bgcolor, backgroundColor);
|
|
3100
|
-
var palette$1 = palette;
|
|
3101
|
-
|
|
3102
|
-
const position = style$1({
|
|
3103
|
-
prop: 'position'
|
|
3104
|
-
});
|
|
3105
|
-
const zIndex = style$1({
|
|
3106
|
-
prop: 'zIndex',
|
|
3107
|
-
themeKey: 'zIndex'
|
|
3108
|
-
});
|
|
3109
|
-
const top = style$1({
|
|
3110
|
-
prop: 'top'
|
|
3111
|
-
});
|
|
3112
|
-
const right = style$1({
|
|
3113
|
-
prop: 'right'
|
|
3114
|
-
});
|
|
3115
|
-
const bottom = style$1({
|
|
3116
|
-
prop: 'bottom'
|
|
3117
|
-
});
|
|
3118
|
-
const left = style$1({
|
|
3119
|
-
prop: 'left'
|
|
3120
|
-
});
|
|
3121
|
-
var positions = compose(position, zIndex, top, right, bottom, left);
|
|
3122
|
-
|
|
3123
|
-
const boxShadow = style$1({
|
|
3124
|
-
prop: 'boxShadow',
|
|
3125
|
-
themeKey: 'shadows'
|
|
2972
|
+
transform: paletteTransform
|
|
3126
2973
|
});
|
|
3127
|
-
|
|
2974
|
+
compose(color, bgcolor, backgroundColor);
|
|
3128
2975
|
|
|
3129
|
-
function
|
|
2976
|
+
function sizingTransform(value) {
|
|
3130
2977
|
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
3131
2978
|
}
|
|
3132
|
-
|
|
3133
2979
|
const width = style$1({
|
|
3134
2980
|
prop: 'width',
|
|
3135
|
-
transform
|
|
2981
|
+
transform: sizingTransform
|
|
3136
2982
|
});
|
|
3137
2983
|
const maxWidth = props => {
|
|
3138
2984
|
if (props.maxWidth !== undefined && props.maxWidth !== null) {
|
|
3139
2985
|
const styleFromPropValue = propValue => {
|
|
3140
2986
|
var _props$theme, _props$theme$breakpoi, _props$theme$breakpoi2;
|
|
3141
|
-
|
|
3142
2987
|
const breakpoint = ((_props$theme = props.theme) == null ? void 0 : (_props$theme$breakpoi = _props$theme.breakpoints) == null ? void 0 : (_props$theme$breakpoi2 = _props$theme$breakpoi.values) == null ? void 0 : _props$theme$breakpoi2[propValue]) || values[propValue];
|
|
3143
2988
|
return {
|
|
3144
|
-
maxWidth: breakpoint ||
|
|
2989
|
+
maxWidth: breakpoint || sizingTransform(propValue)
|
|
3145
2990
|
};
|
|
3146
2991
|
};
|
|
3147
|
-
|
|
3148
2992
|
return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
|
|
3149
2993
|
}
|
|
3150
|
-
|
|
3151
2994
|
return null;
|
|
3152
2995
|
};
|
|
3153
2996
|
maxWidth.filterProps = ['maxWidth'];
|
|
3154
2997
|
const minWidth = style$1({
|
|
3155
2998
|
prop: 'minWidth',
|
|
3156
|
-
transform
|
|
2999
|
+
transform: sizingTransform
|
|
3157
3000
|
});
|
|
3158
3001
|
const height = style$1({
|
|
3159
3002
|
prop: 'height',
|
|
3160
|
-
transform
|
|
3003
|
+
transform: sizingTransform
|
|
3161
3004
|
});
|
|
3162
3005
|
const maxHeight = style$1({
|
|
3163
3006
|
prop: 'maxHeight',
|
|
3164
|
-
transform
|
|
3007
|
+
transform: sizingTransform
|
|
3165
3008
|
});
|
|
3166
3009
|
const minHeight = style$1({
|
|
3167
3010
|
prop: 'minHeight',
|
|
3168
|
-
transform
|
|
3011
|
+
transform: sizingTransform
|
|
3169
3012
|
});
|
|
3170
3013
|
style$1({
|
|
3171
3014
|
prop: 'size',
|
|
3172
3015
|
cssProperty: 'width',
|
|
3173
|
-
transform
|
|
3016
|
+
transform: sizingTransform
|
|
3174
3017
|
});
|
|
3175
3018
|
style$1({
|
|
3176
3019
|
prop: 'size',
|
|
3177
3020
|
cssProperty: 'height',
|
|
3178
|
-
transform
|
|
3021
|
+
transform: sizingTransform
|
|
3179
3022
|
});
|
|
3180
3023
|
const boxSizing = style$1({
|
|
3181
3024
|
prop: 'boxSizing'
|
|
3182
3025
|
});
|
|
3183
|
-
|
|
3184
|
-
var sizing$1 = sizing;
|
|
3026
|
+
compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
|
|
3185
3027
|
|
|
3186
|
-
const
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
}
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
}
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
}
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3028
|
+
const defaultSxConfig = {
|
|
3029
|
+
// borders
|
|
3030
|
+
border: {
|
|
3031
|
+
themeKey: 'borders',
|
|
3032
|
+
transform: borderTransform
|
|
3033
|
+
},
|
|
3034
|
+
borderTop: {
|
|
3035
|
+
themeKey: 'borders',
|
|
3036
|
+
transform: borderTransform
|
|
3037
|
+
},
|
|
3038
|
+
borderRight: {
|
|
3039
|
+
themeKey: 'borders',
|
|
3040
|
+
transform: borderTransform
|
|
3041
|
+
},
|
|
3042
|
+
borderBottom: {
|
|
3043
|
+
themeKey: 'borders',
|
|
3044
|
+
transform: borderTransform
|
|
3045
|
+
},
|
|
3046
|
+
borderLeft: {
|
|
3047
|
+
themeKey: 'borders',
|
|
3048
|
+
transform: borderTransform
|
|
3049
|
+
},
|
|
3050
|
+
borderColor: {
|
|
3051
|
+
themeKey: 'palette'
|
|
3052
|
+
},
|
|
3053
|
+
borderTopColor: {
|
|
3054
|
+
themeKey: 'palette'
|
|
3055
|
+
},
|
|
3056
|
+
borderRightColor: {
|
|
3057
|
+
themeKey: 'palette'
|
|
3058
|
+
},
|
|
3059
|
+
borderBottomColor: {
|
|
3060
|
+
themeKey: 'palette'
|
|
3061
|
+
},
|
|
3062
|
+
borderLeftColor: {
|
|
3063
|
+
themeKey: 'palette'
|
|
3064
|
+
},
|
|
3065
|
+
borderRadius: {
|
|
3066
|
+
themeKey: 'shape.borderRadius',
|
|
3067
|
+
style: borderRadius
|
|
3068
|
+
},
|
|
3069
|
+
// palette
|
|
3070
|
+
color: {
|
|
3071
|
+
themeKey: 'palette',
|
|
3072
|
+
transform: paletteTransform
|
|
3073
|
+
},
|
|
3074
|
+
bgcolor: {
|
|
3075
|
+
themeKey: 'palette',
|
|
3076
|
+
cssProperty: 'backgroundColor',
|
|
3077
|
+
transform: paletteTransform
|
|
3078
|
+
},
|
|
3079
|
+
backgroundColor: {
|
|
3080
|
+
themeKey: 'palette',
|
|
3081
|
+
transform: paletteTransform
|
|
3082
|
+
},
|
|
3083
|
+
// spacing
|
|
3084
|
+
p: {
|
|
3085
|
+
style: padding
|
|
3086
|
+
},
|
|
3087
|
+
pt: {
|
|
3088
|
+
style: padding
|
|
3089
|
+
},
|
|
3090
|
+
pr: {
|
|
3091
|
+
style: padding
|
|
3092
|
+
},
|
|
3093
|
+
pb: {
|
|
3094
|
+
style: padding
|
|
3095
|
+
},
|
|
3096
|
+
pl: {
|
|
3097
|
+
style: padding
|
|
3098
|
+
},
|
|
3099
|
+
px: {
|
|
3100
|
+
style: padding
|
|
3101
|
+
},
|
|
3102
|
+
py: {
|
|
3103
|
+
style: padding
|
|
3104
|
+
},
|
|
3105
|
+
padding: {
|
|
3106
|
+
style: padding
|
|
3107
|
+
},
|
|
3108
|
+
paddingTop: {
|
|
3109
|
+
style: padding
|
|
3110
|
+
},
|
|
3111
|
+
paddingRight: {
|
|
3112
|
+
style: padding
|
|
3113
|
+
},
|
|
3114
|
+
paddingBottom: {
|
|
3115
|
+
style: padding
|
|
3116
|
+
},
|
|
3117
|
+
paddingLeft: {
|
|
3118
|
+
style: padding
|
|
3119
|
+
},
|
|
3120
|
+
paddingX: {
|
|
3121
|
+
style: padding
|
|
3122
|
+
},
|
|
3123
|
+
paddingY: {
|
|
3124
|
+
style: padding
|
|
3125
|
+
},
|
|
3126
|
+
paddingInline: {
|
|
3127
|
+
style: padding
|
|
3128
|
+
},
|
|
3129
|
+
paddingInlineStart: {
|
|
3130
|
+
style: padding
|
|
3131
|
+
},
|
|
3132
|
+
paddingInlineEnd: {
|
|
3133
|
+
style: padding
|
|
3134
|
+
},
|
|
3135
|
+
paddingBlock: {
|
|
3136
|
+
style: padding
|
|
3137
|
+
},
|
|
3138
|
+
paddingBlockStart: {
|
|
3139
|
+
style: padding
|
|
3140
|
+
},
|
|
3141
|
+
paddingBlockEnd: {
|
|
3142
|
+
style: padding
|
|
3143
|
+
},
|
|
3144
|
+
m: {
|
|
3145
|
+
style: margin
|
|
3146
|
+
},
|
|
3147
|
+
mt: {
|
|
3148
|
+
style: margin
|
|
3149
|
+
},
|
|
3150
|
+
mr: {
|
|
3151
|
+
style: margin
|
|
3152
|
+
},
|
|
3153
|
+
mb: {
|
|
3154
|
+
style: margin
|
|
3155
|
+
},
|
|
3156
|
+
ml: {
|
|
3157
|
+
style: margin
|
|
3158
|
+
},
|
|
3159
|
+
mx: {
|
|
3160
|
+
style: margin
|
|
3161
|
+
},
|
|
3162
|
+
my: {
|
|
3163
|
+
style: margin
|
|
3164
|
+
},
|
|
3165
|
+
margin: {
|
|
3166
|
+
style: margin
|
|
3167
|
+
},
|
|
3168
|
+
marginTop: {
|
|
3169
|
+
style: margin
|
|
3170
|
+
},
|
|
3171
|
+
marginRight: {
|
|
3172
|
+
style: margin
|
|
3173
|
+
},
|
|
3174
|
+
marginBottom: {
|
|
3175
|
+
style: margin
|
|
3176
|
+
},
|
|
3177
|
+
marginLeft: {
|
|
3178
|
+
style: margin
|
|
3179
|
+
},
|
|
3180
|
+
marginX: {
|
|
3181
|
+
style: margin
|
|
3182
|
+
},
|
|
3183
|
+
marginY: {
|
|
3184
|
+
style: margin
|
|
3185
|
+
},
|
|
3186
|
+
marginInline: {
|
|
3187
|
+
style: margin
|
|
3188
|
+
},
|
|
3189
|
+
marginInlineStart: {
|
|
3190
|
+
style: margin
|
|
3191
|
+
},
|
|
3192
|
+
marginInlineEnd: {
|
|
3193
|
+
style: margin
|
|
3194
|
+
},
|
|
3195
|
+
marginBlock: {
|
|
3196
|
+
style: margin
|
|
3197
|
+
},
|
|
3198
|
+
marginBlockStart: {
|
|
3199
|
+
style: margin
|
|
3200
|
+
},
|
|
3201
|
+
marginBlockEnd: {
|
|
3202
|
+
style: margin
|
|
3203
|
+
},
|
|
3204
|
+
// display
|
|
3205
|
+
displayPrint: {
|
|
3206
|
+
cssProperty: false,
|
|
3207
|
+
transform: value => ({
|
|
3208
|
+
'@media print': {
|
|
3209
|
+
display: value
|
|
3210
|
+
}
|
|
3211
|
+
})
|
|
3212
|
+
},
|
|
3213
|
+
display: {},
|
|
3214
|
+
overflow: {},
|
|
3215
|
+
textOverflow: {},
|
|
3216
|
+
visibility: {},
|
|
3217
|
+
whiteSpace: {},
|
|
3218
|
+
// flexbox
|
|
3219
|
+
flexBasis: {},
|
|
3220
|
+
flexDirection: {},
|
|
3221
|
+
flexWrap: {},
|
|
3222
|
+
justifyContent: {},
|
|
3223
|
+
alignItems: {},
|
|
3224
|
+
alignContent: {},
|
|
3225
|
+
order: {},
|
|
3226
|
+
flex: {},
|
|
3227
|
+
flexGrow: {},
|
|
3228
|
+
flexShrink: {},
|
|
3229
|
+
alignSelf: {},
|
|
3230
|
+
justifyItems: {},
|
|
3231
|
+
justifySelf: {},
|
|
3232
|
+
// grid
|
|
3233
|
+
gap: {
|
|
3234
|
+
style: gap
|
|
3235
|
+
},
|
|
3236
|
+
rowGap: {
|
|
3237
|
+
style: rowGap
|
|
3238
|
+
},
|
|
3239
|
+
columnGap: {
|
|
3240
|
+
style: columnGap
|
|
3241
|
+
},
|
|
3242
|
+
gridColumn: {},
|
|
3243
|
+
gridRow: {},
|
|
3244
|
+
gridAutoFlow: {},
|
|
3245
|
+
gridAutoColumns: {},
|
|
3246
|
+
gridAutoRows: {},
|
|
3247
|
+
gridTemplateColumns: {},
|
|
3248
|
+
gridTemplateRows: {},
|
|
3249
|
+
gridTemplateAreas: {},
|
|
3250
|
+
gridArea: {},
|
|
3251
|
+
// positions
|
|
3252
|
+
position: {},
|
|
3253
|
+
zIndex: {
|
|
3254
|
+
themeKey: 'zIndex'
|
|
3255
|
+
},
|
|
3256
|
+
top: {},
|
|
3257
|
+
right: {},
|
|
3258
|
+
bottom: {},
|
|
3259
|
+
left: {},
|
|
3260
|
+
// shadows
|
|
3261
|
+
boxShadow: {
|
|
3262
|
+
themeKey: 'shadows'
|
|
3263
|
+
},
|
|
3264
|
+
// sizing
|
|
3265
|
+
width: {
|
|
3266
|
+
transform: sizingTransform
|
|
3267
|
+
},
|
|
3268
|
+
maxWidth: {
|
|
3269
|
+
style: maxWidth
|
|
3270
|
+
},
|
|
3271
|
+
minWidth: {
|
|
3272
|
+
transform: sizingTransform
|
|
3273
|
+
},
|
|
3274
|
+
height: {
|
|
3275
|
+
transform: sizingTransform
|
|
3276
|
+
},
|
|
3277
|
+
maxHeight: {
|
|
3278
|
+
transform: sizingTransform
|
|
3279
|
+
},
|
|
3280
|
+
minHeight: {
|
|
3281
|
+
transform: sizingTransform
|
|
3282
|
+
},
|
|
3283
|
+
boxSizing: {},
|
|
3284
|
+
// typography
|
|
3285
|
+
fontFamily: {
|
|
3286
|
+
themeKey: 'typography'
|
|
3287
|
+
},
|
|
3288
|
+
fontSize: {
|
|
3289
|
+
themeKey: 'typography'
|
|
3290
|
+
},
|
|
3291
|
+
fontStyle: {
|
|
3292
|
+
themeKey: 'typography'
|
|
3293
|
+
},
|
|
3294
|
+
fontWeight: {
|
|
3295
|
+
themeKey: 'typography'
|
|
3296
|
+
},
|
|
3297
|
+
letterSpacing: {},
|
|
3298
|
+
textTransform: {},
|
|
3299
|
+
lineHeight: {},
|
|
3300
|
+
textAlign: {},
|
|
3301
|
+
typography: {
|
|
3302
|
+
cssProperty: false,
|
|
3303
|
+
themeKey: 'typography'
|
|
3304
|
+
}
|
|
3245
3305
|
};
|
|
3246
|
-
|
|
3247
|
-
filterPropsMapping[styleFnName].forEach(propName => {
|
|
3248
|
-
acc[propName] = styleFunctionMapping[styleFnName];
|
|
3249
|
-
});
|
|
3250
|
-
return acc;
|
|
3251
|
-
}, {});
|
|
3306
|
+
var defaultSxConfig$1 = defaultSxConfig;
|
|
3252
3307
|
|
|
3253
3308
|
function objectsHaveSameKeys(...objects) {
|
|
3254
3309
|
const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
|
|
3255
3310
|
const union = new Set(allKeys);
|
|
3256
3311
|
return objects.every(object => union.size === Object.keys(object).length);
|
|
3257
3312
|
}
|
|
3258
|
-
|
|
3259
3313
|
function callIfFn(maybeFn, arg) {
|
|
3260
3314
|
return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;
|
|
3261
|
-
}
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
function unstable_createStyleFunctionSx(styleFunctionMapping$1 = styleFunctionMapping) {
|
|
3265
|
-
const propToStyleFunction = Object.keys(styleFunctionMapping$1).reduce((acc, styleFnName) => {
|
|
3266
|
-
styleFunctionMapping$1[styleFnName].filterProps.forEach(propName => {
|
|
3267
|
-
acc[propName] = styleFunctionMapping$1[styleFnName];
|
|
3268
|
-
});
|
|
3269
|
-
return acc;
|
|
3270
|
-
}, {});
|
|
3315
|
+
}
|
|
3271
3316
|
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3317
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
3318
|
+
function unstable_createStyleFunctionSx() {
|
|
3319
|
+
function getThemeValue(prop, val, theme, config) {
|
|
3320
|
+
const props = {
|
|
3321
|
+
[prop]: val,
|
|
3275
3322
|
theme
|
|
3276
3323
|
};
|
|
3277
|
-
const
|
|
3278
|
-
|
|
3279
|
-
|
|
3324
|
+
const options = config[prop];
|
|
3325
|
+
if (!options) {
|
|
3326
|
+
return {
|
|
3327
|
+
[prop]: val
|
|
3328
|
+
};
|
|
3329
|
+
}
|
|
3330
|
+
const {
|
|
3331
|
+
cssProperty = prop,
|
|
3332
|
+
themeKey,
|
|
3333
|
+
transform,
|
|
3334
|
+
style
|
|
3335
|
+
} = options;
|
|
3336
|
+
if (val == null) {
|
|
3337
|
+
return null;
|
|
3338
|
+
}
|
|
3339
|
+
const themeMapping = getPath(theme, themeKey) || {};
|
|
3340
|
+
if (style) {
|
|
3341
|
+
return style(props);
|
|
3342
|
+
}
|
|
3343
|
+
const styleFromPropValue = propValueFinal => {
|
|
3344
|
+
let value = getStyleValue(themeMapping, transform, propValueFinal);
|
|
3345
|
+
if (propValueFinal === value && typeof propValueFinal === 'string') {
|
|
3346
|
+
// Haven't found value
|
|
3347
|
+
value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);
|
|
3348
|
+
}
|
|
3349
|
+
if (cssProperty === false) {
|
|
3350
|
+
return value;
|
|
3351
|
+
}
|
|
3352
|
+
return {
|
|
3353
|
+
[cssProperty]: value
|
|
3354
|
+
};
|
|
3280
3355
|
};
|
|
3356
|
+
return handleBreakpoints(props, val, styleFromPropValue);
|
|
3281
3357
|
}
|
|
3282
|
-
|
|
3283
3358
|
function styleFunctionSx(props) {
|
|
3359
|
+
var _theme$unstable_sxCon;
|
|
3284
3360
|
const {
|
|
3285
3361
|
sx,
|
|
3286
3362
|
theme = {}
|
|
3287
3363
|
} = props || {};
|
|
3288
|
-
|
|
3289
3364
|
if (!sx) {
|
|
3290
3365
|
return null; // Emotion & styled-components will neglect null
|
|
3291
3366
|
}
|
|
3367
|
+
|
|
3368
|
+
const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig$1;
|
|
3369
|
+
|
|
3292
3370
|
/*
|
|
3293
3371
|
* Receive `sxInput` as object or callback
|
|
3294
3372
|
* and then recursively check keys & values to create media query object styles.
|
|
3295
3373
|
* (the result will be used in `styled`)
|
|
3296
3374
|
*/
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
3375
|
function traverse(sxInput) {
|
|
3300
3376
|
let sxObject = sxInput;
|
|
3301
|
-
|
|
3302
3377
|
if (typeof sxInput === 'function') {
|
|
3303
3378
|
sxObject = sxInput(theme);
|
|
3304
3379
|
} else if (typeof sxInput !== 'object') {
|
|
3305
3380
|
// value
|
|
3306
3381
|
return sxInput;
|
|
3307
3382
|
}
|
|
3308
|
-
|
|
3309
3383
|
if (!sxObject) {
|
|
3310
3384
|
return null;
|
|
3311
3385
|
}
|
|
3312
|
-
|
|
3313
3386
|
const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
|
|
3314
3387
|
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
3315
3388
|
let css = emptyBreakpoints;
|
|
3316
3389
|
Object.keys(sxObject).forEach(styleKey => {
|
|
3317
3390
|
const value = callIfFn(sxObject[styleKey], theme);
|
|
3318
|
-
|
|
3319
3391
|
if (value !== null && value !== undefined) {
|
|
3320
3392
|
if (typeof value === 'object') {
|
|
3321
|
-
if (
|
|
3322
|
-
css = merge(css, getThemeValue(styleKey, value, theme));
|
|
3393
|
+
if (config[styleKey]) {
|
|
3394
|
+
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
3323
3395
|
} else {
|
|
3324
3396
|
const breakpointsValues = handleBreakpoints({
|
|
3325
3397
|
theme
|
|
3326
3398
|
}, value, x => ({
|
|
3327
3399
|
[styleKey]: x
|
|
3328
3400
|
}));
|
|
3329
|
-
|
|
3330
3401
|
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
3331
3402
|
css[styleKey] = styleFunctionSx({
|
|
3332
3403
|
sx: value,
|
|
@@ -3337,21 +3408,19 @@ function unstable_createStyleFunctionSx(styleFunctionMapping$1 = styleFunctionMa
|
|
|
3337
3408
|
}
|
|
3338
3409
|
}
|
|
3339
3410
|
} else {
|
|
3340
|
-
css = merge(css, getThemeValue(styleKey, value, theme));
|
|
3411
|
+
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
3341
3412
|
}
|
|
3342
3413
|
}
|
|
3343
3414
|
});
|
|
3344
3415
|
return removeUnusedBreakpoints(breakpointsKeys, css);
|
|
3345
3416
|
}
|
|
3346
|
-
|
|
3347
3417
|
return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
|
|
3348
3418
|
}
|
|
3349
|
-
|
|
3350
3419
|
return styleFunctionSx;
|
|
3351
3420
|
}
|
|
3352
3421
|
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
3353
3422
|
styleFunctionSx.filterProps = ['sx'];
|
|
3354
|
-
var
|
|
3423
|
+
var styleFunctionSx$1 = styleFunctionSx;
|
|
3355
3424
|
|
|
3356
3425
|
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
3357
3426
|
if (source == null) return {};
|
|
@@ -3367,14 +3436,15 @@ function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
|
3367
3436
|
}
|
|
3368
3437
|
|
|
3369
3438
|
const _excluded$9 = ["sx"];
|
|
3370
|
-
|
|
3371
3439
|
const splitProps = props => {
|
|
3440
|
+
var _props$theme$unstable, _props$theme;
|
|
3372
3441
|
const result = {
|
|
3373
3442
|
systemProps: {},
|
|
3374
3443
|
otherProps: {}
|
|
3375
3444
|
};
|
|
3445
|
+
const config = (_props$theme$unstable = props == null ? void 0 : (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig$1;
|
|
3376
3446
|
Object.keys(props).forEach(prop => {
|
|
3377
|
-
if (
|
|
3447
|
+
if (config[prop]) {
|
|
3378
3448
|
result.systemProps[prop] = props[prop];
|
|
3379
3449
|
} else {
|
|
3380
3450
|
result.otherProps[prop] = props[prop];
|
|
@@ -3382,35 +3452,29 @@ const splitProps = props => {
|
|
|
3382
3452
|
});
|
|
3383
3453
|
return result;
|
|
3384
3454
|
};
|
|
3385
|
-
|
|
3386
3455
|
function extendSxProp(props) {
|
|
3387
3456
|
const {
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3457
|
+
sx: inSx
|
|
3458
|
+
} = props,
|
|
3459
|
+
other = _objectWithoutPropertiesLoose$2(props, _excluded$9);
|
|
3392
3460
|
const {
|
|
3393
3461
|
systemProps,
|
|
3394
3462
|
otherProps
|
|
3395
3463
|
} = splitProps(other);
|
|
3396
3464
|
let finalSx;
|
|
3397
|
-
|
|
3398
3465
|
if (Array.isArray(inSx)) {
|
|
3399
3466
|
finalSx = [systemProps, ...inSx];
|
|
3400
3467
|
} else if (typeof inSx === 'function') {
|
|
3401
3468
|
finalSx = (...args) => {
|
|
3402
3469
|
const result = inSx(...args);
|
|
3403
|
-
|
|
3404
3470
|
if (!isPlainObject(result)) {
|
|
3405
3471
|
return systemProps;
|
|
3406
3472
|
}
|
|
3407
|
-
|
|
3408
3473
|
return _extends({}, systemProps, result);
|
|
3409
3474
|
};
|
|
3410
3475
|
} else {
|
|
3411
3476
|
finalSx = _extends({}, systemProps, inSx);
|
|
3412
3477
|
}
|
|
3413
|
-
|
|
3414
3478
|
return _extends({}, otherProps, {
|
|
3415
3479
|
sx: finalSx
|
|
3416
3480
|
});
|
|
@@ -3419,84 +3483,72 @@ function extendSxProp(props) {
|
|
|
3419
3483
|
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}
|
|
3420
3484
|
|
|
3421
3485
|
const _excluded$8 = ["values", "unit", "step"];
|
|
3422
|
-
|
|
3423
3486
|
const sortBreakpointsValues = values => {
|
|
3424
3487
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
3425
3488
|
key,
|
|
3426
3489
|
val: values[key]
|
|
3427
|
-
})) || [];
|
|
3428
|
-
|
|
3490
|
+
})) || [];
|
|
3491
|
+
// Sort in ascending order
|
|
3429
3492
|
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
3430
3493
|
return breakpointsAsArray.reduce((acc, obj) => {
|
|
3431
3494
|
return _extends({}, acc, {
|
|
3432
3495
|
[obj.key]: obj.val
|
|
3433
3496
|
});
|
|
3434
3497
|
}, {});
|
|
3435
|
-
};
|
|
3436
|
-
|
|
3498
|
+
};
|
|
3437
3499
|
|
|
3500
|
+
// Keep in mind that @media is inclusive by the CSS specification.
|
|
3438
3501
|
function createBreakpoints(breakpoints) {
|
|
3439
3502
|
const {
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
},
|
|
3454
|
-
unit = 'px',
|
|
3455
|
-
step = 5
|
|
3456
|
-
} = breakpoints,
|
|
3457
|
-
other = _objectWithoutPropertiesLoose$2(breakpoints, _excluded$8);
|
|
3503
|
+
// The breakpoint **start** at this value.
|
|
3504
|
+
// For instance with the first breakpoint xs: [xs, sm).
|
|
3505
|
+
values = {
|
|
3506
|
+
xs: 0,
|
|
3507
|
+
// phone
|
|
3508
|
+
sm: 600,
|
|
3509
|
+
// tablet
|
|
3510
|
+
md: 900,
|
|
3511
|
+
// small laptop
|
|
3512
|
+
lg: 1200,
|
|
3513
|
+
// desktop
|
|
3514
|
+
xl: 1536 // large screen
|
|
3515
|
+
},
|
|
3458
3516
|
|
|
3517
|
+
unit = 'px',
|
|
3518
|
+
step = 5
|
|
3519
|
+
} = breakpoints,
|
|
3520
|
+
other = _objectWithoutPropertiesLoose$2(breakpoints, _excluded$8);
|
|
3459
3521
|
const sortedValues = sortBreakpointsValues(values);
|
|
3460
3522
|
const keys = Object.keys(sortedValues);
|
|
3461
|
-
|
|
3462
3523
|
function up(key) {
|
|
3463
3524
|
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
3464
3525
|
return `@media (min-width:${value}${unit})`;
|
|
3465
3526
|
}
|
|
3466
|
-
|
|
3467
3527
|
function down(key) {
|
|
3468
3528
|
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
3469
3529
|
return `@media (max-width:${value - step / 100}${unit})`;
|
|
3470
3530
|
}
|
|
3471
|
-
|
|
3472
3531
|
function between(start, end) {
|
|
3473
3532
|
const endIndex = keys.indexOf(end);
|
|
3474
3533
|
return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;
|
|
3475
3534
|
}
|
|
3476
|
-
|
|
3477
3535
|
function only(key) {
|
|
3478
3536
|
if (keys.indexOf(key) + 1 < keys.length) {
|
|
3479
3537
|
return between(key, keys[keys.indexOf(key) + 1]);
|
|
3480
3538
|
}
|
|
3481
|
-
|
|
3482
3539
|
return up(key);
|
|
3483
3540
|
}
|
|
3484
|
-
|
|
3485
3541
|
function not(key) {
|
|
3486
3542
|
// handle first and last key separately, for better readability
|
|
3487
3543
|
const keyIndex = keys.indexOf(key);
|
|
3488
|
-
|
|
3489
3544
|
if (keyIndex === 0) {
|
|
3490
3545
|
return up(keys[1]);
|
|
3491
3546
|
}
|
|
3492
|
-
|
|
3493
3547
|
if (keyIndex === keys.length - 1) {
|
|
3494
3548
|
return down(keys[keyIndex]);
|
|
3495
3549
|
}
|
|
3496
|
-
|
|
3497
3550
|
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
|
|
3498
3551
|
}
|
|
3499
|
-
|
|
3500
3552
|
return _extends({
|
|
3501
3553
|
keys,
|
|
3502
3554
|
values: sortedValues,
|
|
@@ -3515,48 +3567,44 @@ const shape = {
|
|
|
3515
3567
|
var shape$1 = shape;
|
|
3516
3568
|
|
|
3517
3569
|
/* tslint:enable:unified-signatures */
|
|
3570
|
+
|
|
3518
3571
|
function createSpacing(spacingInput = 8) {
|
|
3519
3572
|
// Already transformed.
|
|
3520
3573
|
if (spacingInput.mui) {
|
|
3521
3574
|
return spacingInput;
|
|
3522
|
-
}
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3577
|
+
// Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.
|
|
3523
3578
|
// Smaller components, such as icons, can align to a 4dp grid.
|
|
3524
3579
|
// https://m2.material.io/design/layout/understanding-layout.html
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
3580
|
const transform = createUnarySpacing({
|
|
3528
3581
|
spacing: spacingInput
|
|
3529
3582
|
});
|
|
3530
|
-
|
|
3531
3583
|
const spacing = (...argsInput) => {
|
|
3532
3584
|
if (process.env.NODE_ENV !== 'production') {
|
|
3533
3585
|
if (!(argsInput.length <= 4)) {
|
|
3534
3586
|
console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
|
|
3535
3587
|
}
|
|
3536
3588
|
}
|
|
3537
|
-
|
|
3538
3589
|
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
3539
3590
|
return args.map(argument => {
|
|
3540
3591
|
const output = transform(argument);
|
|
3541
3592
|
return typeof output === 'number' ? `${output}px` : output;
|
|
3542
3593
|
}).join(' ');
|
|
3543
3594
|
};
|
|
3544
|
-
|
|
3545
3595
|
spacing.mui = true;
|
|
3546
3596
|
return spacing;
|
|
3547
3597
|
}
|
|
3548
3598
|
|
|
3549
3599
|
const _excluded$7 = ["breakpoints", "palette", "spacing", "shape"];
|
|
3550
|
-
|
|
3551
3600
|
function createTheme(options = {}, ...args) {
|
|
3552
3601
|
const {
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3602
|
+
breakpoints: breakpointsInput = {},
|
|
3603
|
+
palette: paletteInput = {},
|
|
3604
|
+
spacing: spacingInput,
|
|
3605
|
+
shape: shapeInput = {}
|
|
3606
|
+
} = options,
|
|
3607
|
+
other = _objectWithoutPropertiesLoose$2(options, _excluded$7);
|
|
3560
3608
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
3561
3609
|
const spacing = createSpacing(spacingInput);
|
|
3562
3610
|
let muiTheme = deepmerge({
|
|
@@ -3571,39 +3619,40 @@ function createTheme(options = {}, ...args) {
|
|
|
3571
3619
|
shape: _extends({}, shape$1, shapeInput)
|
|
3572
3620
|
}, other);
|
|
3573
3621
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
3622
|
+
muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig);
|
|
3623
|
+
muiTheme.unstable_sx = function sx(props) {
|
|
3624
|
+
return styleFunctionSx$1({
|
|
3625
|
+
sx: props,
|
|
3626
|
+
theme: this
|
|
3627
|
+
});
|
|
3628
|
+
};
|
|
3574
3629
|
return muiTheme;
|
|
3575
3630
|
}
|
|
3576
3631
|
|
|
3577
3632
|
const ThemeContext = /*#__PURE__*/React.createContext(null);
|
|
3578
|
-
|
|
3579
3633
|
if (process.env.NODE_ENV !== 'production') {
|
|
3580
3634
|
ThemeContext.displayName = 'ThemeContext';
|
|
3581
3635
|
}
|
|
3582
|
-
|
|
3583
3636
|
var ThemeContext$1 = ThemeContext;
|
|
3584
3637
|
|
|
3585
3638
|
function useTheme$2() {
|
|
3586
3639
|
const theme = React.useContext(ThemeContext$1);
|
|
3587
|
-
|
|
3588
3640
|
if (process.env.NODE_ENV !== 'production') {
|
|
3589
3641
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
3590
3642
|
React.useDebugValue(theme);
|
|
3591
3643
|
}
|
|
3592
|
-
|
|
3593
3644
|
return theme;
|
|
3594
3645
|
}
|
|
3595
3646
|
|
|
3596
3647
|
function isObjectEmpty(obj) {
|
|
3597
3648
|
return Object.keys(obj).length === 0;
|
|
3598
3649
|
}
|
|
3599
|
-
|
|
3600
3650
|
function useTheme$1(defaultTheme = null) {
|
|
3601
3651
|
const contextTheme = useTheme$2();
|
|
3602
3652
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
3603
3653
|
}
|
|
3604
3654
|
|
|
3605
3655
|
const systemDefaultTheme = createTheme();
|
|
3606
|
-
|
|
3607
3656
|
function useTheme(defaultTheme = systemDefaultTheme) {
|
|
3608
3657
|
return useTheme$1(defaultTheme);
|
|
3609
3658
|
}
|
|
@@ -3613,22 +3662,19 @@ function createBox(options = {}) {
|
|
|
3613
3662
|
const {
|
|
3614
3663
|
defaultTheme,
|
|
3615
3664
|
defaultClassName = 'MuiBox-root',
|
|
3616
|
-
generateClassName
|
|
3617
|
-
styleFunctionSx = defaultStyleFunctionSx
|
|
3665
|
+
generateClassName
|
|
3618
3666
|
} = options;
|
|
3619
3667
|
const BoxRoot = styled('div', {
|
|
3620
3668
|
shouldForwardProp: prop => prop !== 'theme' && prop !== 'sx' && prop !== 'as'
|
|
3621
|
-
})(styleFunctionSx);
|
|
3669
|
+
})(styleFunctionSx$1);
|
|
3622
3670
|
const Box = /*#__PURE__*/React.forwardRef(function Box(inProps, ref) {
|
|
3623
3671
|
const theme = useTheme(defaultTheme);
|
|
3624
|
-
|
|
3625
3672
|
const _extendSxProp = extendSxProp(inProps),
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3673
|
+
{
|
|
3674
|
+
className,
|
|
3675
|
+
component = 'div'
|
|
3676
|
+
} = _extendSxProp,
|
|
3677
|
+
other = _objectWithoutPropertiesLoose$2(_extendSxProp, _excluded$6);
|
|
3632
3678
|
return /*#__PURE__*/jsxRuntime.exports.jsx(BoxRoot, _extends({
|
|
3633
3679
|
as: component,
|
|
3634
3680
|
ref: ref,
|
|
@@ -3640,25 +3686,20 @@ function createBox(options = {}) {
|
|
|
3640
3686
|
}
|
|
3641
3687
|
|
|
3642
3688
|
const Box = createBox();
|
|
3643
|
-
process.env.NODE_ENV !== "production" ? Box.propTypes
|
|
3644
|
-
/* remove-proptypes */
|
|
3645
|
-
= {
|
|
3689
|
+
process.env.NODE_ENV !== "production" ? Box.propTypes /* remove-proptypes */ = {
|
|
3646
3690
|
// ----------------------------- Warning --------------------------------
|
|
3647
3691
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
3648
3692
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
3649
3693
|
// ----------------------------------------------------------------------
|
|
3650
|
-
|
|
3651
3694
|
/**
|
|
3652
3695
|
* @ignore
|
|
3653
3696
|
*/
|
|
3654
3697
|
children: PropTypes.node,
|
|
3655
|
-
|
|
3656
3698
|
/**
|
|
3657
3699
|
* The component used for the root node.
|
|
3658
3700
|
* Either a string to use a HTML element or a component.
|
|
3659
3701
|
*/
|
|
3660
3702
|
component: PropTypes.elementType,
|
|
3661
|
-
|
|
3662
3703
|
/**
|
|
3663
3704
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
3664
3705
|
*/
|
|
@@ -3802,7 +3843,7 @@ function getPropertyValue(obj, property) {
|
|
|
3802
3843
|
return String(property.split('.').reduce((o, k) => o && o[k], obj));
|
|
3803
3844
|
}
|
|
3804
3845
|
|
|
3805
|
-
|
|
3846
|
+
/*! *****************************************************************************
|
|
3806
3847
|
Copyright (c) Microsoft Corporation.
|
|
3807
3848
|
|
|
3808
3849
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -3837,7 +3878,9 @@ const Td = memo(CustomTableCell);
|
|
|
3837
3878
|
|
|
3838
3879
|
const CustomTableRow = (props) => {
|
|
3839
3880
|
const { children, sx, striped = true, bordered = undefined } = props, rest = __rest(props, ["children", "sx", "striped", "bordered"]);
|
|
3840
|
-
return (React__default.createElement(TableRow, Object.assign({ sx: Object.assign({ '&:nth-of-type(even)': { bgcolor: striped ? 'action.selected' : '' } }, sx) }, rest), children)
|
|
3881
|
+
return (React__default.createElement(TableRow, Object.assign({ sx: Object.assign({ '&:nth-of-type(even)': { bgcolor: striped ? 'action.selected' : '' } }, sx) }, rest), React__default.Children.map(children, (child) => React__default.cloneElement(child, {
|
|
3882
|
+
bordered
|
|
3883
|
+
}))));
|
|
3841
3884
|
};
|
|
3842
3885
|
const Tr = memo(CustomTableRow);
|
|
3843
3886
|
|
|
@@ -14790,6 +14833,7 @@ function FormikInputMask(_a) {
|
|
|
14790
14833
|
var { mask, defaultValue, name } = _a, rest = __rest(_a, ["mask", "defaultValue", "name"]);
|
|
14791
14834
|
const { ref, value, unmaskedValue, setValue } = useIMask(mask);
|
|
14792
14835
|
const initialValue = useRef();
|
|
14836
|
+
const formikSaveFunction = useRef();
|
|
14793
14837
|
useEffect(() => {
|
|
14794
14838
|
if (!value && defaultValue)
|
|
14795
14839
|
setValue(String(defaultValue));
|
|
@@ -14797,10 +14841,15 @@ function FormikInputMask(_a) {
|
|
|
14797
14841
|
setValue(String(initialValue.current));
|
|
14798
14842
|
}
|
|
14799
14843
|
}, [defaultValue]);
|
|
14844
|
+
useEffect(() => {
|
|
14845
|
+
if (formikSaveFunction.current)
|
|
14846
|
+
formikSaveFunction.current(name, value);
|
|
14847
|
+
}, [value]);
|
|
14800
14848
|
return (React__default.createElement(Field, { name: name }, (_a) => {
|
|
14801
14849
|
var _b = _a.field, { value } = _b, field = __rest(_b, ["value"]), { form: { setFieldValue } } = _a;
|
|
14802
14850
|
initialValue.current = value;
|
|
14803
|
-
|
|
14851
|
+
formikSaveFunction.current = setFieldValue;
|
|
14852
|
+
return React__default.createElement(BaseInput$1, Object.assign({}, rest, field, { inputRef: ref }));
|
|
14804
14853
|
}));
|
|
14805
14854
|
}
|
|
14806
14855
|
|
|
@@ -14988,13 +15037,13 @@ function BaseGrid({ columns, children, fixedColumns, paperProps, tableBodyProps,
|
|
|
14988
15037
|
py: dense ? 0.23 : 0.7,
|
|
14989
15038
|
border: bordered ? '1px solid' : '',
|
|
14990
15039
|
borderColor: 'divider'
|
|
14991
|
-
}, '
|
|
15040
|
+
}, 'tr:nth-of-type(even)': {
|
|
14992
15041
|
transition: 'background-color ease 200ms',
|
|
14993
15042
|
bgcolor: striped ? 'divider' : 'initial'
|
|
14994
15043
|
}, width: fixedColumns ? 'fit-content' : '100' }, paperProps === null || paperProps === void 0 ? void 0 : paperProps.sx) }),
|
|
14995
15044
|
React__default.createElement(Table, Object.assign({ size: "small", stickyHeader: true }, tableProps, { sx: Object.assign({}, tableProps === null || tableProps === void 0 ? void 0 : tableProps.sx) }),
|
|
14996
15045
|
React__default.createElement(TableHead, Object.assign({}, tableHeadProps),
|
|
14997
|
-
React__default.createElement(TableRow, null, columns.map((column) => (React__default.createElement(TableCell, { key: column.name, padding: dense ? 'none' : 'normal', sx: Object.assign({ pl: 2
|
|
15046
|
+
React__default.createElement(TableRow, null, columns.map((column) => (React__default.createElement(TableCell, { key: column.name, padding: dense ? 'none' : 'normal', sx: Object.assign({ pl: 2 }, column === null || column === void 0 ? void 0 : column.sx) },
|
|
14998
15047
|
React__default.createElement(TableSortLabel, { active: sortedBy === column.name, direction: sortedDirection, onClick: () => onSortBy(column.name), disabled: column.canSort === false, sx: { position: 'relative', right: '-9px' } }, column.label)))))),
|
|
14999
15048
|
React__default.createElement(TableBody, Object.assign({}, tableBodyProps), children)),
|
|
15000
15049
|
React__default.createElement(GridPagination, { rowsPerPageOptions: rowsPerPageOptions, currentPage: currentPage, totalNumberOfPages: totalNumberOfPages, onPageChange: onPageChange, setRowsPerPage: setRowsPerPage, rowsPerPage: rowsPerPage, dense: dense })));
|
|
@@ -15218,125 +15267,5 @@ const Dialog = (_a) => {
|
|
|
15218
15267
|
})))));
|
|
15219
15268
|
};
|
|
15220
15269
|
|
|
15221
|
-
|
|
15222
|
-
(function (global, factory) {
|
|
15223
|
-
typeof commonjsRequire === 'function' ? factory(moment$1.exports) :
|
|
15224
|
-
factory(global.moment);
|
|
15225
|
-
}(commonjsGlobal, (function (moment) {
|
|
15226
|
-
//! moment.js locale configuration
|
|
15227
|
-
|
|
15228
|
-
var ptBr = moment.defineLocale('pt-br', {
|
|
15229
|
-
months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
|
|
15230
|
-
'_'
|
|
15231
|
-
),
|
|
15232
|
-
monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
|
|
15233
|
-
weekdays:
|
|
15234
|
-
'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split(
|
|
15235
|
-
'_'
|
|
15236
|
-
),
|
|
15237
|
-
weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),
|
|
15238
|
-
weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'),
|
|
15239
|
-
weekdaysParseExact: true,
|
|
15240
|
-
longDateFormat: {
|
|
15241
|
-
LT: 'HH:mm',
|
|
15242
|
-
LTS: 'HH:mm:ss',
|
|
15243
|
-
L: 'DD/MM/YYYY',
|
|
15244
|
-
LL: 'D [de] MMMM [de] YYYY',
|
|
15245
|
-
LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
|
|
15246
|
-
LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm',
|
|
15247
|
-
},
|
|
15248
|
-
calendar: {
|
|
15249
|
-
sameDay: '[Hoje às] LT',
|
|
15250
|
-
nextDay: '[Amanhã às] LT',
|
|
15251
|
-
nextWeek: 'dddd [às] LT',
|
|
15252
|
-
lastDay: '[Ontem às] LT',
|
|
15253
|
-
lastWeek: function () {
|
|
15254
|
-
return this.day() === 0 || this.day() === 6
|
|
15255
|
-
? '[Último] dddd [às] LT' // Saturday + Sunday
|
|
15256
|
-
: '[Última] dddd [às] LT'; // Monday - Friday
|
|
15257
|
-
},
|
|
15258
|
-
sameElse: 'L',
|
|
15259
|
-
},
|
|
15260
|
-
relativeTime: {
|
|
15261
|
-
future: 'em %s',
|
|
15262
|
-
past: 'há %s',
|
|
15263
|
-
s: 'poucos segundos',
|
|
15264
|
-
ss: '%d segundos',
|
|
15265
|
-
m: 'um minuto',
|
|
15266
|
-
mm: '%d minutos',
|
|
15267
|
-
h: 'uma hora',
|
|
15268
|
-
hh: '%d horas',
|
|
15269
|
-
d: 'um dia',
|
|
15270
|
-
dd: '%d dias',
|
|
15271
|
-
M: 'um mês',
|
|
15272
|
-
MM: '%d meses',
|
|
15273
|
-
y: 'um ano',
|
|
15274
|
-
yy: '%d anos',
|
|
15275
|
-
},
|
|
15276
|
-
dayOfMonthOrdinalParse: /\d{1,2}º/,
|
|
15277
|
-
ordinal: '%dº',
|
|
15278
|
-
invalidDate: 'Data inválida',
|
|
15279
|
-
});
|
|
15280
|
-
|
|
15281
|
-
return ptBr;
|
|
15282
|
-
|
|
15283
|
-
})));
|
|
15284
|
-
}());
|
|
15285
|
-
|
|
15286
|
-
moment.locale('pt-br');
|
|
15287
|
-
function DateFormat(date) {
|
|
15288
|
-
const data = {
|
|
15289
|
-
utc: -3
|
|
15290
|
-
};
|
|
15291
|
-
if (date) {
|
|
15292
|
-
date = moment(date)
|
|
15293
|
-
.add(data.utc + 3, 'hours')
|
|
15294
|
-
.toDate();
|
|
15295
|
-
}
|
|
15296
|
-
function momentWithDate(utc = false) {
|
|
15297
|
-
const current = moment(date).utc(utc);
|
|
15298
|
-
current.toDateOrUndefined = () => !date ? undefined : moment(date).utc(utc).toDate();
|
|
15299
|
-
return current;
|
|
15300
|
-
}
|
|
15301
|
-
function convertDateFromClient(forceUTC = undefined) {
|
|
15302
|
-
let utc = forceUTC || true;
|
|
15303
|
-
if (String(date).endsWith('Z'))
|
|
15304
|
-
utc = false;
|
|
15305
|
-
return momentWithDate(utc);
|
|
15306
|
-
}
|
|
15307
|
-
function now() {
|
|
15308
|
-
if (process.env.NODE_ENV === 'development') {
|
|
15309
|
-
return moment()
|
|
15310
|
-
.add(data.utc + 3, 'hours')
|
|
15311
|
-
.utc(true);
|
|
15312
|
-
}
|
|
15313
|
-
return moment().add(data.utc, 'hours');
|
|
15314
|
-
}
|
|
15315
|
-
const methods = {
|
|
15316
|
-
from: {
|
|
15317
|
-
db: momentWithDate(),
|
|
15318
|
-
client: convertDateFromClient()
|
|
15319
|
-
},
|
|
15320
|
-
now,
|
|
15321
|
-
utc: (newUTC) => {
|
|
15322
|
-
data.utc = newUTC;
|
|
15323
|
-
return (newDate) => {
|
|
15324
|
-
date = newDate;
|
|
15325
|
-
return methods;
|
|
15326
|
-
};
|
|
15327
|
-
}
|
|
15328
|
-
};
|
|
15329
|
-
return methods;
|
|
15330
|
-
}
|
|
15331
|
-
|
|
15332
|
-
function RouteHelper(methods, middlewares = []) {
|
|
15333
|
-
return (req, res) => {
|
|
15334
|
-
const handler = methods[req.method];
|
|
15335
|
-
if (!handler)
|
|
15336
|
-
return res.status(405).json({ error: 'Método inválido' });
|
|
15337
|
-
return middlewares.reduce((func, middleware) => middleware(func), handler)(req, res);
|
|
15338
|
-
};
|
|
15339
|
-
}
|
|
15340
|
-
|
|
15341
|
-
export { Autocomplete, BaseGrid, Checkbox, DateFormat, Dialog, EditableTableCell, GetInputLabel, Grid, Input, InputMask, LargeButton, Modal, Radio, RouteHelper, Select, Switch, TabPanel, Td, Tr, createFilter, filterData, getTabProps, useEvent, useFilter, useGrid, useLoading };
|
|
15270
|
+
export { Autocomplete, BaseGrid, Checkbox, Dialog, EditableTableCell, GetInputLabel, Grid, Input, InputMask, LargeButton, Modal, Radio, Select, Switch, TabPanel, Td, Tr, createFilter, filterData, getTabProps, useEvent, useFilter, useGrid, useLoading };
|
|
15342
15271
|
//# sourceMappingURL=index.js.map
|