* Given some props, map those props to individualized props internally. * @param node - A formkit node * @param props - Some props that may include a classes object
(node: FormKitNode, props: Record<string, any>)
| 81 | * @param props - Some props that may include a classes object |
| 82 | */ |
| 83 | function classesToNodeProps(node: FormKitNode, props: Record<string, any>) { |
| 84 | if (props.classes) { |
| 85 | Object.keys(props.classes).forEach( |
| 86 | (key: keyof (typeof props)['classes']) => { |
| 87 | if (typeof key === 'string') { |
| 88 | node.props[`_${key}Class`] = props.classes[key] |
| 89 | // We need to ensure Vue is aware that we want to actually observe the |
| 90 | // child values too, so we touch them here. |
| 91 | if (isObject(props.classes[key]) && key === 'inner') |
| 92 | Object.values(props.classes[key]) |
| 93 | } |
| 94 | } |
| 95 | ) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Extracts known FormKit listeners. |
no test coverage detected