UNPKG

hongluan-ui

Version:
1 lines 919 B
{"version":3,"file":"utils.mjs","sources":["../../../../../../packages/components/form/src/utils.ts"],"sourcesContent":["import { ensureArray } from '@hongluan-ui/utils'\n\nimport type { Arrayable } from '@hongluan-ui/utils'\nimport type { FormItemContext } from '@hongluan-ui/tokens'\nimport type { FormItemProp } from './form-item'\n\nexport const filterFields = (\n fields: FormItemContext[],\n props: Arrayable<FormItemProp>,\n) => {\n const normalized = ensureArray(props)\n return normalized.length > 0\n ? fields.filter(field => field.prop && normalized.includes(field.prop))\n : fields\n}\n"],"names":["ensureArray"],"mappings":";;;AACY,MAAC,YAAY,GAAG,CAAC,MAAM,EAAE,KAAK,KAAK;AAC/C,EAAE,MAAM,UAAU,GAAGA,SAAW,CAAC,KAAK,CAAC,CAAC;AACxC,EAAE,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC;AAClH;;;;"}