pre-installations and preparations

This commit is contained in:
MuhammadKhalilzadeh committed 2024-05-05 11:21:00 +03:30
1 parent 3e5a0329cb
commit 201d621ac3
6977 files changed
+742826

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
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) {
var variant = props.variant,
other = _objectWithoutProperties(props, ["variant"]);
var classKey = variant || '';
Object.keys(other).sort().forEach(function (key) {
if (key === 'color') {
classKey += isEmpty(classKey) ? props[key] : capitalize(props[key]);
} else {
classKey += "".concat(isEmpty(classKey) ? key : capitalize(key)).concat(capitalize(props[key].toString()));
}
});
return classKey;
}