@notiz/formly-tailwindcss
Version:
Formly TailwindCSS theme
24 lines • 3.5 kB
JavaScript
/**
*
* @param fieldConfig
* @param groupConfig
* @param flexClasses default to flex
* @returns
*/
export const formlyTailwindFlex = (fieldConfig, groupConfig = {}, flexClasses = 'flex') => {
return {
fieldGroupClassName: flexClasses,
fieldGroup: fieldConfig,
...groupConfig,
};
};
export const formlyTailwindFlexJustifyBetween = (fieldConfig, groupConfig = {}) => {
return formlyTailwindFlex(fieldConfig, groupConfig, 'flex justify-between');
};
export const formlyTailwindFlexJustifyAround = (fieldConfig, groupConfig = {}) => {
return formlyTailwindFlex(fieldConfig, groupConfig, 'flex justify-around');
};
export const formlyTailwindFlexJustifyEvenly = (fieldConfig, groupConfig = {}) => {
return formlyTailwindFlex(fieldConfig, groupConfig, 'flex justify-evenly');
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmxleC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2Zvcm1seS10YWlsd2luZGNzcy9sYXlvdXRzL3NyYy9mbGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBOzs7Ozs7R0FNRztBQUNILE1BQU0sQ0FBQyxNQUFNLGtCQUFrQixHQUFHLENBQ2hDLFdBQWdDLEVBQ2hDLGNBQWlDLEVBQUUsRUFDbkMsV0FBVyxHQUFHLE1BQU0sRUFDRCxFQUFFO0lBQ3JCLE9BQU87UUFDTCxtQkFBbUIsRUFBRSxXQUFXO1FBQ2hDLFVBQVUsRUFBRSxXQUFXO1FBQ3ZCLEdBQUcsV0FBVztLQUNmLENBQUM7QUFDSixDQUFDLENBQUM7QUFFRixNQUFNLENBQUMsTUFBTSxnQ0FBZ0MsR0FBRyxDQUM5QyxXQUFnQyxFQUNoQyxjQUFpQyxFQUFFLEVBQ2hCLEVBQUU7SUFDckIsT0FBTyxrQkFBa0IsQ0FBQyxXQ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