MCPcopy Create free account
hub / github.com/formkit/formkit / form

Function form

packages/inputs/src/features/forms.ts:112–136  ·  view source on GitHub ↗
(node: FormKitNode)

Source from the content-addressed store, hash-verified

110 * @public
111 */
112export 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}

Callers

nothing calls this directly

Calls 2

hasFunction · 0.90
setIncompleteMessageFunction · 0.85

Tested by

no test coverage detected