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

Function checkboxes

packages/inputs/src/features/checkboxes.ts:76–90  ·  view source on GitHub ↗
(node: FormKitNode)

Source from the content-addressed store, hash-verified

74 * @public
75 */
76export default function checkboxes(node: FormKitNode): void {
77 node.on('created', () => {
78 if (node.context?.handlers) {
79 node.context.handlers.toggleChecked = toggleChecked.bind(null, node)
80 }
81 if (node.context?.fns) {
82 node.context.fns.isChecked = isChecked.bind(null, node)
83 }
84 // Configure our default onValue and offValue
85 if (!has(node.props, 'onValue')) node.props.onValue = true
86 if (!has(node.props, 'offValue')) node.props.offValue = false
87 })
88
89 node.hook.prop(normalizeBoxes(node))
90}

Callers

nothing calls this directly

Calls 2

hasFunction · 0.90
normalizeBoxesFunction · 0.85

Tested by

no test coverage detected