worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
25
node_modules/@mui/system/esm/propsToClassKey/propsToClassKey.js
generated
vendored
Normal file
25
node_modules/@mui/system/esm/propsToClassKey/propsToClassKey.js
generated
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import capitalize from '@mui/utils/capitalize';
|
||||
function isEmpty(string) {
|
||||
return string.length === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates string classKey based on the properties provided. It starts with the
|
||||
* variant if defined, and then it appends all other properties in alphabetical order.
|
||||
* @param {object} props - the properties for which the classKey should be created.
|
||||
*/
|
||||
export default function propsToClassKey(props) {
|
||||
const {
|
||||
variant,
|
||||
...other
|
||||
} = props;
|
||||
let classKey = variant || '';
|
||||
Object.keys(other).sort().forEach(key => {
|
||||
if (key === 'color') {
|
||||
classKey += isEmpty(classKey) ? props[key] : capitalize(props[key]);
|
||||
} else {
|
||||
classKey += `${isEmpty(classKey) ? key : capitalize(key)}${capitalize(props[key].toString())}`;
|
||||
}
|
||||
});
|
||||
return classKey;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue