@mui/utils
Advanced tools
Comparing version 5.15.4 to 5.15.5
import ClassNameGenerator from '../ClassNameGenerator'; | ||
// If GlobalStateSlot is changed, GLOBAL_STATE_CLASSES in | ||
// \packages\api-docs-builder\utils\parseSlotsAndClasses.ts must be updated accordingly. | ||
const globalStateClassesMapping = { | ||
export const globalStateClasses = { | ||
active: 'active', | ||
@@ -21,4 +17,7 @@ checked: 'checked', | ||
export default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') { | ||
const globalStateClass = globalStateClassesMapping[slot]; | ||
const globalStateClass = globalStateClasses[slot]; | ||
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`; | ||
} | ||
export function isGlobalState(slot) { | ||
return globalStateClasses[slot] !== undefined; | ||
} |
@@ -39,4 +39,6 @@ 'use client'; | ||
export { default as unstable_generateUtilityClass } from './generateUtilityClass'; | ||
export { isGlobalState as unstable_isGlobalState } from './generateUtilityClass'; | ||
export * from './generateUtilityClass'; | ||
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses'; | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { default as clamp } from './clamp'; |
@@ -1,2 +0,17 @@ | ||
export type GlobalStateSlot = 'active' | 'checked' | 'completed' | 'disabled' | 'error' | 'expanded' | 'focused' | 'focusVisible' | 'open' | 'readOnly' | 'required' | 'selected'; | ||
export type GlobalStateSlot = keyof typeof globalStateClasses; | ||
export declare const globalStateClasses: { | ||
active: string; | ||
checked: string; | ||
completed: string; | ||
disabled: string; | ||
error: string; | ||
expanded: string; | ||
focused: string; | ||
focusVisible: string; | ||
open: string; | ||
readOnly: string; | ||
required: string; | ||
selected: string; | ||
}; | ||
export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string; | ||
export declare function isGlobalState(slot: string): boolean; |
@@ -8,7 +8,6 @@ "use strict"; | ||
exports.default = generateUtilityClass; | ||
exports.globalStateClasses = void 0; | ||
exports.isGlobalState = isGlobalState; | ||
var _ClassNameGenerator = _interopRequireDefault(require("../ClassNameGenerator")); | ||
// If GlobalStateSlot is changed, GLOBAL_STATE_CLASSES in | ||
// \packages\api-docs-builder\utils\parseSlotsAndClasses.ts must be updated accordingly. | ||
const globalStateClassesMapping = { | ||
const globalStateClasses = exports.globalStateClasses = { | ||
active: 'active', | ||
@@ -28,4 +27,7 @@ checked: 'checked', | ||
function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') { | ||
const globalStateClass = globalStateClassesMapping[slot]; | ||
const globalStateClass = globalStateClasses[slot]; | ||
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${_ClassNameGenerator.default.generate(componentName)}-${slot}`; | ||
} | ||
function isGlobalState(slot) { | ||
return globalStateClasses[slot] !== undefined; | ||
} |
@@ -37,4 +37,6 @@ export { default as chainPropTypes } from './chainPropTypes'; | ||
export { default as unstable_generateUtilityClass } from './generateUtilityClass'; | ||
export { isGlobalState as unstable_isGlobalState } from './generateUtilityClass'; | ||
export * from './generateUtilityClass'; | ||
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses'; | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { default as clamp } from './clamp'; |
19
index.js
/** | ||
* @mui/utils v5.15.4 | ||
* @mui/utils v5.15.5 | ||
* | ||
@@ -53,4 +53,6 @@ * @license MIT | ||
unstable_generateUtilityClass: true, | ||
unstable_isGlobalState: true, | ||
unstable_generateUtilityClasses: true, | ||
unstable_ClassNameGenerator: true | ||
unstable_ClassNameGenerator: true, | ||
clamp: true | ||
}; | ||
@@ -69,2 +71,8 @@ Object.defineProperty(exports, "HTMLElementType", { | ||
}); | ||
Object.defineProperty(exports, "clamp", { | ||
enumerable: true, | ||
get: function () { | ||
return _clamp.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "deepmerge", { | ||
@@ -208,2 +216,8 @@ enumerable: true, | ||
}); | ||
Object.defineProperty(exports, "unstable_isGlobalState", { | ||
enumerable: true, | ||
get: function () { | ||
return _generateUtilityClass.isGlobalState; | ||
} | ||
}); | ||
Object.defineProperty(exports, "unstable_isMuiElement", { | ||
@@ -341,3 +355,4 @@ enumerable: true, | ||
var _ClassNameGenerator = _interopRequireDefault(require("./ClassNameGenerator")); | ||
var _clamp = _interopRequireDefault(require("./clamp")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } |
import ClassNameGenerator from '../ClassNameGenerator'; | ||
// If GlobalStateSlot is changed, GLOBAL_STATE_CLASSES in | ||
// \packages\api-docs-builder\utils\parseSlotsAndClasses.ts must be updated accordingly. | ||
var globalStateClassesMapping = { | ||
export var globalStateClasses = { | ||
active: 'active', | ||
@@ -22,4 +18,7 @@ checked: 'checked', | ||
var globalStatePrefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Mui'; | ||
var globalStateClass = globalStateClassesMapping[slot]; | ||
var globalStateClass = globalStateClasses[slot]; | ||
return globalStateClass ? "".concat(globalStatePrefix, "-").concat(globalStateClass) : "".concat(ClassNameGenerator.generate(componentName), "-").concat(slot); | ||
} | ||
export function isGlobalState(slot) { | ||
return globalStateClasses[slot] !== undefined; | ||
} |
/** | ||
* @mui/utils v5.15.4 | ||
* @mui/utils v5.15.5 | ||
* | ||
@@ -46,4 +46,6 @@ * @license MIT | ||
export { default as unstable_generateUtilityClass } from './generateUtilityClass'; | ||
export { isGlobalState as unstable_isGlobalState } from './generateUtilityClass'; | ||
export * from './generateUtilityClass'; | ||
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses'; | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { default as clamp } from './clamp'; |
import ClassNameGenerator from '../ClassNameGenerator'; | ||
// If GlobalStateSlot is changed, GLOBAL_STATE_CLASSES in | ||
// \packages\api-docs-builder\utils\parseSlotsAndClasses.ts must be updated accordingly. | ||
const globalStateClassesMapping = { | ||
export const globalStateClasses = { | ||
active: 'active', | ||
@@ -21,4 +17,7 @@ checked: 'checked', | ||
export default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') { | ||
const globalStateClass = globalStateClassesMapping[slot]; | ||
const globalStateClass = globalStateClasses[slot]; | ||
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`; | ||
} | ||
export function isGlobalState(slot) { | ||
return globalStateClasses[slot] !== undefined; | ||
} |
/** | ||
* @mui/utils v5.15.4 | ||
* @mui/utils v5.15.5 | ||
* | ||
@@ -46,4 +46,6 @@ * @license MIT | ||
export { default as unstable_generateUtilityClass } from './generateUtilityClass'; | ||
export { isGlobalState as unstable_isGlobalState } from './generateUtilityClass'; | ||
export * from './generateUtilityClass'; | ||
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses'; | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; | ||
export { default as clamp } from './clamp'; |
{ | ||
"name": "@mui/utils", | ||
"version": "5.15.4", | ||
"version": "5.15.5", | ||
"private": false, | ||
@@ -29,3 +29,3 @@ "author": "MUI Team", | ||
"dependencies": { | ||
"@babel/runtime": "^7.23.7", | ||
"@babel/runtime": "^7.23.8", | ||
"@types/prop-types": "^15.7.11", | ||
@@ -32,0 +32,0 @@ "prop-types": "^15.8.1", |
Sorry, the diff of this file is too big to display
931589
313
4731
1
Updated@babel/runtime@^7.23.8