Uname : Linux premium36.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Soft : LiteSpeed
Ip : 198.54.115.237
Port : 443
~
/
home
/
emranchoice
/
lyxeetravel.net
/
wp-content
/
plugins
/
elementor
/
packages
/
elementor-ui
/
components
[ HOME ]
Exec
Submit
File Name : utils.js
/** * @param {Object|string} styles { base: { shared: '', variant: { shared: '', h1: '', h2: '' } }, dark: { shared: '', variant: { shared: '', h1: '', h2: '' } } } * @param {Object} props { variant: 'h1', size: 'xl' } * @param {string} type shared/unique (in case that only the shared/unique styles are needed) * @return {string} - style */ export const getStyle = ( styles, props, type ) => { if ( ! styles ) { return ''; } if ( 'string' === typeof styles ) { return styles; } const config = props?.theme?.config || { variants: {} }, style = { shared: '', unique: '', }; // Creating an array that holds only the active theme variants values. const themeVariants = Object.keys( config.variants ).filter( ( key ) => config.variants[ key ] ), addStyle = ( data, keys = [] ) => { if ( 'string' === typeof data && 'unique' !== type ) { style.shared += data; return; } Object.values( keys ).forEach( ( key ) => { const styleObjKey = 'shared' !== key ? 'unique' : 'shared'; if ( ! type || styleObjKey === type ) { style[ styleObjKey ] += data[ key ] || ''; } } ); }; // Adding the 'base' key, to be included as the first variant. themeVariants.unshift( 'base' ); themeVariants.forEach( ( key ) => { const themeVariant = styles[ key ]; // If key exist in the styles obj (dark, light etc.) if ( themeVariant ) { addStyle( themeVariant, [ 'shared' ] ); const styledProps = getStyledProps( props ); // Getting the styled props css from the styles object. Object.entries( styledProps ).forEach( ( [ propName, propValue ] ) => { const styleData = themeVariant[ propName ]; if ( styleData && propValue ) { addStyle( styleData, [ 'shared', propValue ] ); } } ); } } ); // Both properties are returned but their values are depended on the third argument of this function, if empty: both will be calculated. return style.shared + style.unique; }; const getStyledProps = ( props ) => { const styledProps = { ...props }; // Removing props names that are not related to the styles objects. [ 'className', 'children', 'tag', 'as', 'theme' ].forEach( ( prop ) => delete styledProps[ prop ] ); return styledProps; };
Back
Folder Name
Submit
File Name
File Content
Submit
Name
Type
Size
Permission
Last Modified
Actions
.
dir
-
0755
2022-09-13 03:53:16
..
dir
-
0755
2022-09-13 03:53:16
ui
dir
-
0755
2022-09-13 03:53:16
index.js
text/plain
96 B
0644
2022-09-12 03:22:28
utils.js
text/plain
2.19 KB
0644
2022-09-12 03:22:28