@mui/material 5.11.4 → 5.11.6
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/Autocomplete/Autocomplete.d.ts +3 -3
- package/Box/Box.d.ts +6 -22
- package/Button/Button.js +0 -2
- package/CHANGELOG.md +132 -0
- package/Slider/Slider.d.ts +215 -36
- package/Slider/Slider.js +225 -66
- package/Slider/SliderValueLabel.d.ts +15 -0
- package/Slider/SliderValueLabel.js +52 -0
- package/Slider/SliderValueLabel.types.d.ts +24 -0
- package/Slider/SliderValueLabel.types.js +1 -0
- package/Slider/index.d.ts +3 -0
- package/Slider/index.js +3 -1
- package/Slider/sliderClasses.d.ts +58 -0
- package/Slider/sliderClasses.js +7 -0
- package/SwipeableDrawer/SwipeableDrawer.d.ts +15 -0
- package/SwipeableDrawer/SwipeableDrawer.js +48 -17
- package/index.js +1 -1
- package/legacy/Button/Button.js +0 -2
- package/legacy/Slider/Slider.js +253 -74
- package/legacy/Slider/SliderValueLabel.js +48 -0
- package/legacy/Slider/SliderValueLabel.types.js +1 -0
- package/legacy/Slider/index.js +3 -1
- package/legacy/Slider/sliderClasses.js +7 -0
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +50 -17
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +230 -144
- package/legacy/styles/experimental_extendTheme.js +16 -8
- package/locale/index.d.ts +1 -0
- package/locale/index.js +85 -0
- package/modern/Button/Button.js +0 -2
- package/modern/Slider/Slider.js +224 -65
- package/modern/Slider/SliderValueLabel.js +52 -0
- package/modern/Slider/SliderValueLabel.types.js +1 -0
- package/modern/Slider/index.js +3 -1
- package/modern/Slider/sliderClasses.js +7 -0
- package/modern/SwipeableDrawer/SwipeableDrawer.js +47 -17
- package/modern/index.js +1 -1
- package/modern/locale/index.js +85 -0
- package/modern/styles/experimental_extendTheme.js +16 -8
- package/node/Button/Button.js +0 -2
- package/node/Slider/Slider.js +231 -74
- package/node/Slider/SliderValueLabel.js +60 -0
- package/node/Slider/SliderValueLabel.types.js +5 -0
- package/node/Slider/index.js +21 -1
- package/node/Slider/sliderClasses.js +16 -0
- package/node/SwipeableDrawer/SwipeableDrawer.js +48 -17
- package/node/index.js +1 -1
- package/node/locale/index.js +87 -1
- package/node/styles/experimental_extendTheme.js +16 -8
- package/package.json +4 -4
- package/styles/experimental_extendTheme.js +16 -8
- package/umd/material-ui.development.js +556 -799
- package/umd/material-ui.production.min.js +21 -21
|
@@ -25,7 +25,7 @@ var _utils2 = require("../transitions/utils");
|
|
|
25
25
|
var _SwipeArea = _interopRequireDefault(require("./SwipeArea"));
|
|
26
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
27
|
const _excluded = ["BackdropProps"],
|
|
28
|
-
_excluded2 = ["anchor", "disableBackdropTransition", "disableDiscovery", "disableSwipeToOpen", "hideBackdrop", "hysteresis", "minFlingVelocity", "ModalProps", "onClose", "onOpen", "open", "PaperProps", "SwipeAreaProps", "swipeAreaWidth", "transitionDuration", "variant"];
|
|
28
|
+
_excluded2 = ["anchor", "disableBackdropTransition", "disableDiscovery", "disableSwipeToOpen", "hideBackdrop", "hysteresis", "allowSwipeInChildren", "minFlingVelocity", "ModalProps", "onClose", "onOpen", "open", "PaperProps", "SwipeAreaProps", "swipeAreaWidth", "transitionDuration", "variant"];
|
|
29
29
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
31
|
// This value is closed to what browsers are using internally to
|
|
@@ -141,6 +141,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
141
141
|
disableSwipeToOpen = iOS,
|
|
142
142
|
hideBackdrop,
|
|
143
143
|
hysteresis = 0.52,
|
|
144
|
+
allowSwipeInChildren = false,
|
|
144
145
|
minFlingVelocity = 450,
|
|
145
146
|
ModalProps: {
|
|
146
147
|
BackdropProps
|
|
@@ -260,6 +261,30 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
260
261
|
});
|
|
261
262
|
}
|
|
262
263
|
});
|
|
264
|
+
const startMaybeSwiping = (force = false) => {
|
|
265
|
+
if (!maybeSwiping) {
|
|
266
|
+
// on Safari Mobile, if you want to be able to have the 'click' event fired on child elements, nothing in the DOM can be changed.
|
|
267
|
+
// this is because Safari Mobile will not fire any mouse events (still fires touch though) if the DOM changes during mousemove.
|
|
268
|
+
// so do this change on first touchmove instead of touchstart
|
|
269
|
+
if (force || !(disableDiscovery && allowSwipeInChildren)) {
|
|
270
|
+
(0, _reactDom.flushSync)(() => {
|
|
271
|
+
setMaybeSwiping(true);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
const horizontalSwipe = (0, _Drawer.isHorizontal)(anchor);
|
|
275
|
+
if (!open && paperRef.current) {
|
|
276
|
+
// The ref may be null when a parent component updates while swiping.
|
|
277
|
+
setPosition(getMaxTranslate(horizontalSwipe, paperRef.current) + (disableDiscovery ? 15 : -DRAG_STARTED_SIGNAL), {
|
|
278
|
+
changeTransition: false
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
swipeInstance.current.velocity = 0;
|
|
282
|
+
swipeInstance.current.lastTime = null;
|
|
283
|
+
swipeInstance.current.lastTranslate = null;
|
|
284
|
+
swipeInstance.current.paperHit = false;
|
|
285
|
+
touchDetected.current = true;
|
|
286
|
+
}
|
|
287
|
+
};
|
|
263
288
|
const handleBodyTouchMove = (0, _useEventCallback.default)(nativeEvent => {
|
|
264
289
|
// the ref may be null when a parent component updates while swiping
|
|
265
290
|
if (!paperRef.current || !touchDetected.current) {
|
|
@@ -270,6 +295,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
270
295
|
if (claimedSwipeInstance !== null && claimedSwipeInstance !== swipeInstance.current) {
|
|
271
296
|
return;
|
|
272
297
|
}
|
|
298
|
+
startMaybeSwiping(true);
|
|
273
299
|
const anchorRtl = (0, _Drawer.getAnchor)(theme, anchor);
|
|
274
300
|
const horizontalSwipe = (0, _Drawer.isHorizontal)(anchor);
|
|
275
301
|
const currentX = calculateCurrentX(anchorRtl, nativeEvent.touches, (0, _ownerDocument.default)(nativeEvent.currentTarget));
|
|
@@ -380,7 +406,12 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
380
406
|
const currentX = calculateCurrentX(anchorRtl, nativeEvent.touches, (0, _ownerDocument.default)(nativeEvent.currentTarget));
|
|
381
407
|
const currentY = calculateCurrentY(anchorRtl, nativeEvent.touches, (0, _ownerWindow.default)(nativeEvent.currentTarget));
|
|
382
408
|
if (!open) {
|
|
383
|
-
|
|
409
|
+
var _paperRef$current;
|
|
410
|
+
// logic for if swipe should be ignored:
|
|
411
|
+
// if disableSwipeToOpen
|
|
412
|
+
// if target != swipeArea, and target is not a child of paper ref
|
|
413
|
+
// if is a child of paper ref, and `allowSwipeInChildren` does not allow it
|
|
414
|
+
if (disableSwipeToOpen || !(nativeEvent.target === swipeAreaRef.current || (_paperRef$current = paperRef.current) != null && _paperRef$current.contains(nativeEvent.target) && (typeof allowSwipeInChildren === 'function' ? allowSwipeInChildren(nativeEvent, swipeAreaRef.current, paperRef.current) : allowSwipeInChildren))) {
|
|
384
415
|
return;
|
|
385
416
|
}
|
|
386
417
|
if (horizontalSwipe) {
|
|
@@ -395,20 +426,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
395
426
|
claimedSwipeInstance = null;
|
|
396
427
|
swipeInstance.current.startX = currentX;
|
|
397
428
|
swipeInstance.current.startY = currentY;
|
|
398
|
-
(
|
|
399
|
-
setMaybeSwiping(true);
|
|
400
|
-
});
|
|
401
|
-
if (!open && paperRef.current) {
|
|
402
|
-
// The ref may be null when a parent component updates while swiping.
|
|
403
|
-
setPosition(getMaxTranslate(horizontalSwipe, paperRef.current) + (disableDiscovery ? 15 : -DRAG_STARTED_SIGNAL), {
|
|
404
|
-
changeTransition: false
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
swipeInstance.current.velocity = 0;
|
|
408
|
-
swipeInstance.current.lastTime = null;
|
|
409
|
-
swipeInstance.current.lastTranslate = null;
|
|
410
|
-
swipeInstance.current.paperHit = false;
|
|
411
|
-
touchDetected.current = true;
|
|
429
|
+
startMaybeSwiping();
|
|
412
430
|
});
|
|
413
431
|
React.useEffect(() => {
|
|
414
432
|
if (variant === 'temporary') {
|
|
@@ -456,7 +474,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
456
474
|
hideBackdrop: hideBackdrop,
|
|
457
475
|
PaperProps: (0, _extends2.default)({}, PaperProps, {
|
|
458
476
|
style: (0, _extends2.default)({
|
|
459
|
-
pointerEvents: variant === 'temporary' && !open ? 'none' : ''
|
|
477
|
+
pointerEvents: variant === 'temporary' && !open && !allowSwipeInChildren ? 'none' : ''
|
|
460
478
|
}, PaperProps.style),
|
|
461
479
|
ref: handleRef
|
|
462
480
|
}),
|
|
@@ -478,6 +496,19 @@ process.env.NODE_ENV !== "production" ? SwipeableDrawer.propTypes /* remove-prop
|
|
|
478
496
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
479
497
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
480
498
|
// ----------------------------------------------------------------------
|
|
499
|
+
/**
|
|
500
|
+
* If set to true, the swipe event will open the drawer even if the user begins the swipe on one of the drawer's children.
|
|
501
|
+
* This can be useful in scenarios where the drawer is partially visible.
|
|
502
|
+
* You can customize it further with a callback that determines which children the user can drag over to open the drawer
|
|
503
|
+
* (for example, to ignore other elements that handle touch move events, like sliders).
|
|
504
|
+
*
|
|
505
|
+
* @param {TouchEvent} event The 'touchstart' event
|
|
506
|
+
* @param {HTMLDivElement} swipeArea The swipe area element
|
|
507
|
+
* @param {HTMLDivElement} paper The drawer's paper element
|
|
508
|
+
*
|
|
509
|
+
* @default false
|
|
510
|
+
*/
|
|
511
|
+
allowSwipeInChildren: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.func]),
|
|
481
512
|
/**
|
|
482
513
|
* @ignore
|
|
483
514
|
*/
|
package/node/index.js
CHANGED
package/node/locale/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.zhTW = exports.zhHK = exports.zhCN = exports.viVN = exports.urPK = exports.ukUA = exports.trTR = exports.thTH = exports.svSE = exports.srRS = exports.skSK = exports.siLK = exports.ruRU = exports.roRO = exports.ptPT = exports.ptBR = exports.plPL = exports.nlNL = exports.nbNO = exports.mkMK = exports.kuLatn = exports.koKR = exports.kkKZ = exports.khKH = exports.jaJP = exports.itIT = exports.isIS = exports.idID = exports.hyAM = exports.huHU = exports.hrHR = exports.hiIN = exports.heIL = exports.frFR = exports.fiFI = exports.faIR = exports.etEE = exports.esES = exports.enUS = exports.elGR = exports.deDE = exports.daDK = exports.csCZ = exports.caES = exports.bnBD = exports.bgBG = exports.azAZ = exports.arSD = exports.arSA = exports.arEG = exports.amET = void 0;
|
|
6
|
+
exports.zhTW = exports.zhHK = exports.zhCN = exports.viVN = exports.urPK = exports.ukUA = exports.trTR = exports.thTH = exports.svSE = exports.srRS = exports.skSK = exports.siLK = exports.ruRU = exports.roRO = exports.ptPT = exports.ptBR = exports.plPL = exports.nlNL = exports.nbNO = exports.mkMK = exports.kuLatn = exports.koKR = exports.kkKZ = exports.khKH = exports.jaJP = exports.itIT = exports.isIS = exports.idID = exports.hyAM = exports.huHU = exports.hrHR = exports.hiIN = exports.heIL = exports.frFR = exports.fiFI = exports.faIR = exports.etEE = exports.esES = exports.enUS = exports.elGR = exports.deDE = exports.daDK = exports.csCZ = exports.caES = exports.bnBD = exports.bgBG = exports.beBY = exports.azAZ = exports.arSD = exports.arSA = exports.arEG = exports.amET = void 0;
|
|
7
7
|
const amET = {
|
|
8
8
|
components: {
|
|
9
9
|
MuiBreadcrumbs: {
|
|
@@ -453,6 +453,92 @@ const bnBD = {
|
|
|
453
453
|
}
|
|
454
454
|
};
|
|
455
455
|
exports.bnBD = bnBD;
|
|
456
|
+
const beBY = {
|
|
457
|
+
components: {
|
|
458
|
+
MuiBreadcrumbs: {
|
|
459
|
+
defaultProps: {
|
|
460
|
+
expandText: 'Паказаць шлях'
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
MuiTablePagination: {
|
|
464
|
+
defaultProps: {
|
|
465
|
+
getItemAriaLabel: type => {
|
|
466
|
+
if (type === 'first') {
|
|
467
|
+
return 'Перайсці на першую старонку';
|
|
468
|
+
}
|
|
469
|
+
if (type === 'last') {
|
|
470
|
+
return 'Перайсці на апошнюю старонку';
|
|
471
|
+
}
|
|
472
|
+
if (type === 'next') {
|
|
473
|
+
return 'Перайсці на наступную старонку';
|
|
474
|
+
}
|
|
475
|
+
// if (type === 'previous') {
|
|
476
|
+
return 'Перайсці на папярэднюю старонку';
|
|
477
|
+
},
|
|
478
|
+
labelRowsPerPage: 'Радкоў на старонцы:',
|
|
479
|
+
labelDisplayedRows: ({
|
|
480
|
+
from,
|
|
481
|
+
to,
|
|
482
|
+
count
|
|
483
|
+
}) => `${from}–${to} з ${count !== -1 ? count : `больш чым ${to}`}`
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
MuiRating: {
|
|
487
|
+
defaultProps: {
|
|
488
|
+
getLabelText: value => {
|
|
489
|
+
let pluralForm = 'Зорак';
|
|
490
|
+
const lastDigit = value % 10;
|
|
491
|
+
if (lastDigit > 1 && lastDigit < 5 && (value < 10 || value > 20)) {
|
|
492
|
+
pluralForm = 'Зоркі';
|
|
493
|
+
} else if (lastDigit === 1 && value % 100 !== 11) {
|
|
494
|
+
pluralForm = 'Зорка';
|
|
495
|
+
}
|
|
496
|
+
return `${value} ${pluralForm}`;
|
|
497
|
+
},
|
|
498
|
+
emptyLabelText: 'Рэйтынг адсутнічае'
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
MuiAutocomplete: {
|
|
502
|
+
defaultProps: {
|
|
503
|
+
clearText: 'Ачысціць',
|
|
504
|
+
closeText: 'Закрыць',
|
|
505
|
+
loadingText: 'Загрузка…',
|
|
506
|
+
noOptionsText: 'Няма варыянтаў',
|
|
507
|
+
openText: 'Адкрыць'
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
MuiAlert: {
|
|
511
|
+
defaultProps: {
|
|
512
|
+
closeText: 'Закрыць'
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
MuiPagination: {
|
|
516
|
+
defaultProps: {
|
|
517
|
+
'aria-label': 'Навігацыя па старонкам',
|
|
518
|
+
getItemAriaLabel: (type, page, selected) => {
|
|
519
|
+
if (type === 'page') {
|
|
520
|
+
if (selected) {
|
|
521
|
+
return `${page} старонка`;
|
|
522
|
+
}
|
|
523
|
+
return `Перайсці на ${page} старонку`;
|
|
524
|
+
}
|
|
525
|
+
if (type === 'first') {
|
|
526
|
+
return 'Перайсці на першую старонку';
|
|
527
|
+
}
|
|
528
|
+
if (type === 'last') {
|
|
529
|
+
return 'Перайсці на апошнюю старонку';
|
|
530
|
+
}
|
|
531
|
+
if (type === 'next') {
|
|
532
|
+
return 'Перайсці на наступную старонку';
|
|
533
|
+
}
|
|
534
|
+
// if (type === 'previous') {
|
|
535
|
+
return 'Перайсці на папярэднюю старонку';
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
exports.beBY = beBY;
|
|
456
542
|
const bgBG = {
|
|
457
543
|
components: {
|
|
458
544
|
MuiBreadcrumbs: {
|
|
@@ -33,6 +33,13 @@ function setColor(obj, key, defaultValue) {
|
|
|
33
33
|
obj[key] = defaultValue;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
function setColorChannel(obj, key) {
|
|
37
|
+
if (!(`${key}Channel` in obj)) {
|
|
38
|
+
// custom channel token is not provided, generate one.
|
|
39
|
+
// if channel token can't be generated, show a warning.
|
|
40
|
+
obj[`${key}Channel`] = (0, _system.private_safeColorChannel)(obj[key], `MUI: Can't create \`palette.${key}Channel\` because \`palette.${key}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` + '\n' + `To suppress this warning, you need to explicitly provide the \`palette.${key}Channel\` as a string (in rgb format, e.g. "12 12 12") or undefined if you want to remove the channel token.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
36
43
|
const silent = fn => {
|
|
37
44
|
try {
|
|
38
45
|
return fn();
|
|
@@ -224,11 +231,12 @@ function extendTheme(options = {}, ...args) {
|
|
|
224
231
|
setColor(palette.TableCell, 'border', (0, _system.private_safeDarken)((0, _system.private_safeAlpha)(palette.divider, 1), 0.68));
|
|
225
232
|
setColor(palette.Tooltip, 'bg', (0, _system.private_safeAlpha)(palette.grey[700], 0.92));
|
|
226
233
|
}
|
|
227
|
-
setColor(palette.background, 'defaultChannel', (0, _system.private_safeColorChannel)(palette.background.default, 'MUI: The value of `palette.background.default` should be one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().')); // MUI X - DataGrid needs this token.
|
|
228
234
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
235
|
+
// MUI X - DataGrid needs this token.
|
|
236
|
+
setColorChannel(palette.background, 'default');
|
|
237
|
+
setColorChannel(palette.common, 'background');
|
|
238
|
+
setColorChannel(palette.common, 'onBackground');
|
|
239
|
+
setColorChannel(palette, 'divider');
|
|
232
240
|
Object.keys(palette).forEach(color => {
|
|
233
241
|
const colors = palette[color];
|
|
234
242
|
|
|
@@ -250,16 +258,16 @@ function extendTheme(options = {}, ...args) {
|
|
|
250
258
|
}
|
|
251
259
|
if (color === 'text') {
|
|
252
260
|
// Text colors: text.primary, text.secondary
|
|
253
|
-
|
|
254
|
-
|
|
261
|
+
setColorChannel(palette[color], 'primary');
|
|
262
|
+
setColorChannel(palette[color], 'secondary');
|
|
255
263
|
}
|
|
256
264
|
if (color === 'action') {
|
|
257
265
|
// Action colors: action.active, action.selected
|
|
258
266
|
if (colors.active) {
|
|
259
|
-
|
|
267
|
+
setColorChannel(palette[color], 'active');
|
|
260
268
|
}
|
|
261
269
|
if (colors.selected) {
|
|
262
|
-
|
|
270
|
+
setColorChannel(palette[color], 'selected');
|
|
263
271
|
}
|
|
264
272
|
}
|
|
265
273
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "5.11.
|
|
3
|
+
"version": "5.11.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "React components that implement Google's Material Design.",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/runtime": "^7.20.7",
|
|
49
|
-
"@mui/base": "5.0.0-alpha.
|
|
50
|
-
"@mui/core-downloads-tracker": "^5.11.
|
|
51
|
-
"@mui/system": "^5.11.
|
|
49
|
+
"@mui/base": "5.0.0-alpha.115",
|
|
50
|
+
"@mui/core-downloads-tracker": "^5.11.6",
|
|
51
|
+
"@mui/system": "^5.11.5",
|
|
52
52
|
"@mui/types": "^7.2.3",
|
|
53
53
|
"@mui/utils": "^5.11.2",
|
|
54
54
|
"@types/react-transition-group": "^4.4.5",
|
|
@@ -25,6 +25,13 @@ function setColor(obj, key, defaultValue) {
|
|
|
25
25
|
obj[key] = defaultValue;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
function setColorChannel(obj, key) {
|
|
29
|
+
if (!(`${key}Channel` in obj)) {
|
|
30
|
+
// custom channel token is not provided, generate one.
|
|
31
|
+
// if channel token can't be generated, show a warning.
|
|
32
|
+
obj[`${key}Channel`] = safeColorChannel(obj[key], `MUI: Can't create \`palette.${key}Channel\` because \`palette.${key}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` + '\n' + `To suppress this warning, you need to explicitly provide the \`palette.${key}Channel\` as a string (in rgb format, e.g. "12 12 12") or undefined if you want to remove the channel token.`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
28
35
|
const silent = fn => {
|
|
29
36
|
try {
|
|
30
37
|
return fn();
|
|
@@ -215,11 +222,12 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
215
222
|
setColor(palette.TableCell, 'border', safeDarken(safeAlpha(palette.divider, 1), 0.68));
|
|
216
223
|
setColor(palette.Tooltip, 'bg', safeAlpha(palette.grey[700], 0.92));
|
|
217
224
|
}
|
|
218
|
-
setColor(palette.background, 'defaultChannel', safeColorChannel(palette.background.default, 'MUI: The value of `palette.background.default` should be one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().')); // MUI X - DataGrid needs this token.
|
|
219
225
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
226
|
+
// MUI X - DataGrid needs this token.
|
|
227
|
+
setColorChannel(palette.background, 'default');
|
|
228
|
+
setColorChannel(palette.common, 'background');
|
|
229
|
+
setColorChannel(palette.common, 'onBackground');
|
|
230
|
+
setColorChannel(palette, 'divider');
|
|
223
231
|
Object.keys(palette).forEach(color => {
|
|
224
232
|
const colors = palette[color];
|
|
225
233
|
|
|
@@ -241,16 +249,16 @@ export default function extendTheme(options = {}, ...args) {
|
|
|
241
249
|
}
|
|
242
250
|
if (color === 'text') {
|
|
243
251
|
// Text colors: text.primary, text.secondary
|
|
244
|
-
|
|
245
|
-
|
|
252
|
+
setColorChannel(palette[color], 'primary');
|
|
253
|
+
setColorChannel(palette[color], 'secondary');
|
|
246
254
|
}
|
|
247
255
|
if (color === 'action') {
|
|
248
256
|
// Action colors: action.active, action.selected
|
|
249
257
|
if (colors.active) {
|
|
250
|
-
|
|
258
|
+
setColorChannel(palette[color], 'active');
|
|
251
259
|
}
|
|
252
260
|
if (colors.selected) {
|
|
253
|
-
|
|
261
|
+
setColorChannel(palette[color], 'selected');
|
|
254
262
|
}
|
|
255
263
|
}
|
|
256
264
|
}
|