(node: FormKitNode)
| 110 | * @public |
| 111 | */ |
| 112 | export default function form(node: FormKitNode): void { |
| 113 | node.props.isForm = true |
| 114 | node.ledger.count('validating', (m) => m.key === 'validating') |
| 115 | |
| 116 | node.props.submitAttrs ??= { |
| 117 | disabled: node.props.disabled, |
| 118 | } |
| 119 | |
| 120 | node.on('prop:disabled', ({ payload: disabled }) => { |
| 121 | node.props.submitAttrs = { ...node.props.submitAttrs, disabled } |
| 122 | }) |
| 123 | |
| 124 | node.on('created', () => { |
| 125 | if (node.context?.handlers) { |
| 126 | node.context.handlers.submit = handleSubmit.bind(null, node) |
| 127 | } |
| 128 | if (!has(node.props, 'actions')) { |
| 129 | node.props.actions = true |
| 130 | } |
| 131 | }) |
| 132 | node.on('prop:incompleteMessage', () => { |
| 133 | if (node.store.incomplete) setIncompleteMessage(node) |
| 134 | }) |
| 135 | node.on('settled:blocking', () => node.store.remove('incomplete')) |
| 136 | } |
nothing calls this directly
no test coverage detected