@websolutespa/payload-plugin-bowl
Version:
Bowl PayloadCms plugin of the BOM Repository
26 lines (25 loc) • 713 B
JavaScript
import { deepMerge } from '@websolutespa/payload-utils';
import { validateHexColor } from './utils';
export const ColorConfig = {
type: 'text',
name: 'color',
validate: validateHexColor,
admin: {
components: {
Field: '@websolutespa/payload-plugin-bowl/client#ColorField',
Cell: '@websolutespa/payload-plugin-bowl/client#ColorCell'
}
}
};
export const withColor = (options = {})=>{
const field = deepMerge(ColorConfig, options);
return field;
};
export const withColorRequired = (options = {})=>{
const field = deepMerge({
...ColorConfig,
required: true
}, options);
return field;
};
//# sourceMappingURL=index.js.map