UNPKG

@notiz/formly-tailwindcss

Version:
30 lines 4.78 kB
/** * * @param fieldConfig * @param groupConfig * @param gridClasses default to grid with gap-4 * @returns */ export const formlyTailwindGrid = (fieldConfig, groupConfig = {}, gridClasses = 'grid gap-4') => { return { fieldGroup: fieldConfig, fieldGroupClassName: gridClasses, ...groupConfig, }; }; export const formlyTailwindGridTwoCols = (fieldConfig, groupConfig = {}) => { return formlyTailwindGrid(fieldConfig, groupConfig, 'grid grid-cols-2 gap-4'); }; export const formlyTailwindGridThreeCols = (fieldConfig, groupConfig = {}) => { return formlyTailwindGrid(fieldConfig, groupConfig, 'grid grid-cols-3 gap-4'); }; export const formlyTailwindGridFourCols = (fieldConfig, groupConfig = {}) => { return formlyTailwindGrid(fieldConfig, groupConfig, 'grid grid-cols-4 gap-4'); }; export const formlyTailwindGridSixCols = (fieldConfig, groupConfig = {}) => { return formlyTailwindGrid(fieldConfig, groupConfig, 'grid grid-cols-6 gap-4'); }; export const formlyTailwindGridTwelveCols = (fieldConfig, groupConfig = {}) => { return formlyTailwindGrid(fieldConfig, groupConfig, 'grid grid-cols-12 gap-4'); }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2Zvcm1seS10YWlsd2luZGNzcy9sYXlvdXRzL3NyYy9ncmlkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBOzs7Ozs7R0FNRztBQUNILE1BQU0sQ0FBQyxNQUFNLGtCQUFrQixHQUFHLENBQ2hDLFdBQWdDLEVBQ2hDLGNBQWlDLEVBQUUsRUFDbkMsV0FBVyxHQUFHLFlBQVksRUFDUCxFQUFFO0lBQ3JCLE9BQU87UUFDTCxVQUFVLEVBQUUsV0FBVztRQUN2QixtQkFBbUIsRUFBRSxXQUFXO1FBQ2hDLEdBQUcsV0FBVztLQUNmLEN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