( conf: Partial<FormKitMessage>, node?: FormKitNode )
| 144 | * @public |
| 145 | */ |
| 146 | export function createMessage( |
| 147 | conf: Partial<FormKitMessage>, |
| 148 | node?: FormKitNode |
| 149 | ): FormKitMessageProps { |
| 150 | const m = { |
| 151 | blocking: false, |
| 152 | key: token(), |
| 153 | meta: {} as FormKitMessageMeta, |
| 154 | type: 'state', |
| 155 | visible: true, |
| 156 | ...conf, |
| 157 | } |
| 158 | if (node && m.value && m.meta.localize !== false) { |
| 159 | m.value = node.t(m as FormKitTextFragment) |
| 160 | m.meta.locale = node.config.locale |
| 161 | } |
| 162 | return m |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * The available traps on the node's store. |