UNPKG

@nouance/payload-better-fields-plugin

Version:

A Payload plugin that aims to provide improved fields for the admin panel

38 lines (37 loc) 1.08 kB
import { deepMerge } from 'payload'; import { beforeValidate } from './beforeValidate.js'; export const ComboField = (overrides, fieldToUse, options = { initial: '', separator: ' ' })=>{ const comboField = deepMerge({ name: 'combo', type: 'text', admin: { components: { Field: { clientProps: { config: { options: { initial: options.initial, separator: options.separator }, watchFields: fieldToUse } }, path: '@nouance/payload-better-fields-plugin/Combo/client#ComboComponent' } } }, hooks: { beforeValidate: [ beforeValidate(fieldToUse, options) ] } }, overrides); const fields = [ comboField ]; return fields; }; //# sourceMappingURL=index.js.map