@sectile/vue 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/README.md +4 -2
  2. package/dist/accordion.d.ts +0 -1
  3. package/dist/alert-dialog.d.ts +0 -2
  4. package/dist/alert-dialog.js.map +1 -1
  5. package/dist/calendar.d.ts +2 -3
  6. package/dist/calendar.js +14 -14
  7. package/dist/calendar.js.map +1 -1
  8. package/dist/carousel.d.ts +22 -1
  9. package/dist/carousel.js +7 -1
  10. package/dist/carousel.js.map +1 -1
  11. package/dist/cascade-list.d.ts +339 -0
  12. package/dist/cascade-list.js +240 -0
  13. package/dist/cascade-list.js.map +1 -0
  14. package/dist/cascade-select.d.ts +11 -42
  15. package/dist/cascade-select.js +19 -27
  16. package/dist/cascade-select.js.map +1 -1
  17. package/dist/checkbox-group.d.ts +9 -1
  18. package/dist/checkbox-group.js +57 -13
  19. package/dist/checkbox-group.js.map +1 -1
  20. package/dist/checkbox.d.ts +0 -1
  21. package/dist/checkbox.js +15 -8
  22. package/dist/checkbox.js.map +1 -1
  23. package/dist/color-picker.d.ts +0 -1
  24. package/dist/combobox.d.ts +0 -1
  25. package/dist/combobox.js +46 -6
  26. package/dist/combobox.js.map +1 -1
  27. package/dist/data-grid.d.ts +207 -0
  28. package/dist/data-grid.js +107 -0
  29. package/dist/data-grid.js.map +1 -0
  30. package/dist/data-table.d.ts +239 -0
  31. package/dist/data-table.js +120 -0
  32. package/dist/data-table.js.map +1 -0
  33. package/dist/data-tree-grid.d.ts +218 -0
  34. package/dist/data-tree-grid.js +95 -0
  35. package/dist/data-tree-grid.js.map +1 -0
  36. package/dist/date-field.d.ts +1 -2
  37. package/dist/date-field.js +1 -1
  38. package/dist/date-field.js.map +1 -1
  39. package/dist/date-picker.d.ts +37 -6
  40. package/dist/date-picker.js +3 -1
  41. package/dist/date-picker.js.map +1 -1
  42. package/dist/date-range-field.d.ts +2 -3
  43. package/dist/date-range-field.js +24 -6
  44. package/dist/date-range-field.js.map +1 -1
  45. package/dist/date-range-picker.d.ts +37 -6
  46. package/dist/date-range-picker.js +3 -1
  47. package/dist/date-range-picker.js.map +1 -1
  48. package/dist/date-time-field.d.ts +1 -2
  49. package/dist/date-time-field.js +1 -1
  50. package/dist/date-time-field.js.map +1 -1
  51. package/dist/date-time-picker.d.ts +38 -7
  52. package/dist/date-time-picker.js +3 -1
  53. package/dist/date-time-picker.js.map +1 -1
  54. package/dist/date-time-range-picker.d.ts +38 -7
  55. package/dist/date-time-range-picker.js +3 -1
  56. package/dist/date-time-range-picker.js.map +1 -1
  57. package/dist/dialog.d.ts +0 -2
  58. package/dist/dialog.js.map +1 -1
  59. package/dist/disclosure.d.ts +0 -1
  60. package/dist/drawer.d.ts +1 -2
  61. package/dist/editable.d.ts +0 -1
  62. package/dist/editable.js +25 -6
  63. package/dist/editable.js.map +1 -1
  64. package/dist/feed.d.ts +0 -1
  65. package/dist/form.d.ts +88 -115
  66. package/dist/form.js +461 -233
  67. package/dist/form.js.map +1 -1
  68. package/dist/grid.d.ts +0 -1
  69. package/dist/grid.js +51 -6
  70. package/dist/grid.js.map +1 -1
  71. package/dist/host-provider.d.ts +0 -13
  72. package/dist/host-provider.js +0 -16
  73. package/dist/host-provider.js.map +1 -1
  74. package/dist/index.d.ts +14 -39
  75. package/dist/index.js +6 -19
  76. package/dist/index.js.map +1 -1
  77. package/dist/internal/cascade-choice.d.ts +204 -0
  78. package/dist/internal/cascade-choice.js +161 -0
  79. package/dist/internal/cascade-choice.js.map +1 -0
  80. package/dist/internal/collection.d.ts +3 -8
  81. package/dist/internal/collection.js +14 -20
  82. package/dist/internal/collection.js.map +1 -1
  83. package/dist/internal/controlled-state.d.ts +0 -1
  84. package/dist/internal/date-picker.d.ts +78 -9
  85. package/dist/internal/date-picker.js +116 -27
  86. package/dist/internal/date-picker.js.map +1 -1
  87. package/dist/internal/decimal-input.d.ts +1 -0
  88. package/dist/internal/decimal-input.js +24 -0
  89. package/dist/internal/decimal-input.js.map +1 -0
  90. package/dist/internal/form-control-inventory.d.ts +4 -1
  91. package/dist/internal/form-control-inventory.js +1 -0
  92. package/dist/internal/form-control-inventory.js.map +1 -1
  93. package/dist/internal/form-control.d.ts +100 -2
  94. package/dist/internal/form-control.js +103 -1
  95. package/dist/internal/form-control.js.map +1 -1
  96. package/dist/internal/native-field.d.ts +0 -1
  97. package/dist/internal/native-field.js +11 -2
  98. package/dist/internal/native-field.js.map +1 -1
  99. package/dist/internal/native-input.d.ts +0 -1
  100. package/dist/internal/part-contract.d.ts +0 -1
  101. package/dist/internal/popup.d.ts +5 -27
  102. package/dist/internal/popup.js +15 -21
  103. package/dist/internal/popup.js.map +1 -1
  104. package/dist/internal/presence.d.ts +0 -1
  105. package/dist/internal/scheduled-task.d.ts +5 -0
  106. package/dist/internal/scheduled-task.js +28 -0
  107. package/dist/internal/scheduled-task.js.map +1 -0
  108. package/dist/internal/tabs-context.d.ts +2 -3
  109. package/dist/internal/tabular-components.d.ts +27 -0
  110. package/dist/internal/tabular-components.js +26 -0
  111. package/dist/internal/tabular-components.js.map +1 -0
  112. package/dist/internal/tabular-parts.d.ts +57 -0
  113. package/dist/internal/tabular-parts.js +239 -0
  114. package/dist/internal/tabular-parts.js.map +1 -0
  115. package/dist/internal/tabular-profile.d.ts +75 -0
  116. package/dist/internal/tabular-profile.js +211 -0
  117. package/dist/internal/tabular-profile.js.map +1 -0
  118. package/dist/internal/virtual-collection-model.d.ts +42 -0
  119. package/dist/internal/virtual-collection-model.js +241 -0
  120. package/dist/internal/virtual-collection-model.js.map +1 -0
  121. package/dist/internal/virtual-collection.d.ts +38 -0
  122. package/dist/internal/virtual-collection.js +87 -0
  123. package/dist/internal/virtual-collection.js.map +1 -0
  124. package/dist/{virtual.d.ts → internal/virtual-core.d.ts} +9 -4
  125. package/dist/{virtual.js → internal/virtual-core.js} +7 -7
  126. package/dist/internal/virtual-core.js.map +1 -0
  127. package/dist/internal/virtual-list.d.ts +214 -0
  128. package/dist/internal/virtual-list.js +401 -0
  129. package/dist/internal/virtual-list.js.map +1 -0
  130. package/dist/listbox.d.ts +0 -1
  131. package/dist/listbox.js +52 -6
  132. package/dist/listbox.js.map +1 -1
  133. package/dist/menu-button.d.ts +0 -1
  134. package/dist/menu.d.ts +0 -1
  135. package/dist/menubar.d.ts +0 -1
  136. package/dist/meter-group.d.ts +369 -0
  137. package/dist/meter-group.js +271 -0
  138. package/dist/meter-group.js.map +1 -0
  139. package/dist/meter.d.ts +191 -0
  140. package/dist/meter.js +133 -0
  141. package/dist/meter.js.map +1 -0
  142. package/dist/month-picker.d.ts +37 -6
  143. package/dist/month-picker.js +3 -1
  144. package/dist/month-picker.js.map +1 -1
  145. package/dist/month-range-picker.d.ts +37 -6
  146. package/dist/month-range-picker.js +3 -1
  147. package/dist/month-range-picker.js.map +1 -1
  148. package/dist/multi-thumb-slider.d.ts +0 -1
  149. package/dist/navigation-menu.d.ts +0 -1
  150. package/dist/number-field.d.ts +0 -1
  151. package/dist/pagination.d.ts +23 -2
  152. package/dist/pagination.js +6 -1
  153. package/dist/pagination.js.map +1 -1
  154. package/dist/pin-input.d.ts +0 -1
  155. package/dist/pin-input.js +1 -1
  156. package/dist/pin-input.js.map +1 -1
  157. package/dist/popover.d.ts +0 -2
  158. package/dist/popover.js.map +1 -1
  159. package/dist/primitive.d.ts +0 -1
  160. package/dist/primitive.js +8 -4
  161. package/dist/primitive.js.map +1 -1
  162. package/dist/progress.d.ts +148 -0
  163. package/dist/progress.js +110 -0
  164. package/dist/progress.js.map +1 -0
  165. package/dist/quantity-field.d.ts +0 -1
  166. package/dist/radio-group.d.ts +0 -1
  167. package/dist/radio-group.js +1 -1
  168. package/dist/radio-group.js.map +1 -1
  169. package/dist/range-calendar.d.ts +2 -3
  170. package/dist/rating.d.ts +0 -1
  171. package/dist/rating.js +10 -1
  172. package/dist/rating.js.map +1 -1
  173. package/dist/reorder.d.ts +1 -2
  174. package/dist/select.d.ts +18 -44
  175. package/dist/select.js +11 -13
  176. package/dist/select.js.map +1 -1
  177. package/dist/slider.d.ts +0 -1
  178. package/dist/spin-button.d.ts +0 -1
  179. package/dist/spin-button.js +17 -4
  180. package/dist/spin-button.js.map +1 -1
  181. package/dist/stepper.d.ts +0 -1
  182. package/dist/stepper.js +19 -2
  183. package/dist/stepper.js.map +1 -1
  184. package/dist/switch.d.ts +0 -1
  185. package/dist/tabs.d.ts +0 -1
  186. package/dist/tabs.js +4 -22
  187. package/dist/tabs.js.map +1 -1
  188. package/dist/tags-input.d.ts +0 -1
  189. package/dist/tags-input.js +18 -5
  190. package/dist/tags-input.js.map +1 -1
  191. package/dist/temporal-provider.d.ts +21 -0
  192. package/dist/temporal-provider.js +30 -0
  193. package/dist/temporal-provider.js.map +1 -0
  194. package/dist/text.d.ts +0 -1
  195. package/dist/text.js +18 -4
  196. package/dist/text.js.map +1 -1
  197. package/dist/time-field.d.ts +1 -2
  198. package/dist/time-field.js +1 -1
  199. package/dist/time-field.js.map +1 -1
  200. package/dist/time-range-field.d.ts +2 -2
  201. package/dist/time-range-field.js +6 -4
  202. package/dist/time-range-field.js.map +1 -1
  203. package/dist/timer.d.ts +0 -1
  204. package/dist/toast.d.ts +11 -2
  205. package/dist/toast.js +22 -9
  206. package/dist/toast.js.map +1 -1
  207. package/dist/toggle-button.d.ts +0 -1
  208. package/dist/toggle-group.d.ts +0 -1
  209. package/dist/toggle-group.js +1 -1
  210. package/dist/toggle-group.js.map +1 -1
  211. package/dist/toolbar.d.ts +0 -1
  212. package/dist/tooltip.d.ts +1 -3
  213. package/dist/tooltip.js.map +1 -1
  214. package/dist/tree-grid.d.ts +0 -1
  215. package/dist/tree-grid.js +62 -8
  216. package/dist/tree-grid.js.map +1 -1
  217. package/dist/tree-view.d.ts +0 -1
  218. package/dist/tree-view.js +51 -10
  219. package/dist/tree-view.js.map +1 -1
  220. package/dist/virtual-core.d.ts +1 -0
  221. package/dist/virtual-core.js +2 -0
  222. package/dist/virtual-core.js.map +1 -0
  223. package/dist/virtual-grid.d.ts +188 -0
  224. package/dist/virtual-grid.js +306 -0
  225. package/dist/virtual-grid.js.map +1 -0
  226. package/dist/virtual-list.d.ts +1 -0
  227. package/dist/virtual-list.js +2 -0
  228. package/dist/virtual-list.js.map +1 -0
  229. package/dist/virtual-masonry.d.ts +198 -0
  230. package/dist/virtual-masonry.js +221 -0
  231. package/dist/virtual-masonry.js.map +1 -0
  232. package/dist/virtual-spatial.d.ts +157 -0
  233. package/dist/virtual-spatial.js +159 -0
  234. package/dist/virtual-spatial.js.map +1 -0
  235. package/dist/window-splitter.d.ts +0 -1
  236. package/dist/year-picker.d.ts +37 -6
  237. package/dist/year-picker.js +3 -1
  238. package/dist/year-picker.js.map +1 -1
  239. package/dist/year-range-picker.d.ts +37 -6
  240. package/dist/year-range-picker.js +3 -1
  241. package/dist/year-range-picker.js.map +1 -1
  242. package/package.json +173 -89
  243. package/dist/accordion.d.ts.map +0 -1
  244. package/dist/alert-dialog.d.ts.map +0 -1
  245. package/dist/calendar.d.ts.map +0 -1
  246. package/dist/carousel.d.ts.map +0 -1
  247. package/dist/cascade-select.d.ts.map +0 -1
  248. package/dist/checkbox-group.d.ts.map +0 -1
  249. package/dist/checkbox.d.ts.map +0 -1
  250. package/dist/color-picker.d.ts.map +0 -1
  251. package/dist/combobox.d.ts.map +0 -1
  252. package/dist/date-field.d.ts.map +0 -1
  253. package/dist/date-picker.d.ts.map +0 -1
  254. package/dist/date-range-field.d.ts.map +0 -1
  255. package/dist/date-range-picker.d.ts.map +0 -1
  256. package/dist/date-time-field.d.ts.map +0 -1
  257. package/dist/date-time-picker.d.ts.map +0 -1
  258. package/dist/date-time-range-picker.d.ts.map +0 -1
  259. package/dist/dialog.d.ts.map +0 -1
  260. package/dist/disclosure.d.ts.map +0 -1
  261. package/dist/drawer.d.ts.map +0 -1
  262. package/dist/editable.d.ts.map +0 -1
  263. package/dist/feed.d.ts.map +0 -1
  264. package/dist/form.d.ts.map +0 -1
  265. package/dist/grid.d.ts.map +0 -1
  266. package/dist/host-provider.d.ts.map +0 -1
  267. package/dist/index.d.ts.map +0 -1
  268. package/dist/internal/collection.d.ts.map +0 -1
  269. package/dist/internal/controlled-state.d.ts.map +0 -1
  270. package/dist/internal/date-picker.d.ts.map +0 -1
  271. package/dist/internal/form-control-inventory.d.ts.map +0 -1
  272. package/dist/internal/form-control.d.ts.map +0 -1
  273. package/dist/internal/native-field.d.ts.map +0 -1
  274. package/dist/internal/native-input.d.ts.map +0 -1
  275. package/dist/internal/part-contract.d.ts.map +0 -1
  276. package/dist/internal/popup.d.ts.map +0 -1
  277. package/dist/internal/presence.d.ts.map +0 -1
  278. package/dist/internal/tabs-context.d.ts.map +0 -1
  279. package/dist/listbox.d.ts.map +0 -1
  280. package/dist/menu-button.d.ts.map +0 -1
  281. package/dist/menu.d.ts.map +0 -1
  282. package/dist/menubar.d.ts.map +0 -1
  283. package/dist/month-picker.d.ts.map +0 -1
  284. package/dist/month-range-picker.d.ts.map +0 -1
  285. package/dist/multi-thumb-slider.d.ts.map +0 -1
  286. package/dist/navigation-menu.d.ts.map +0 -1
  287. package/dist/number-field.d.ts.map +0 -1
  288. package/dist/pagination.d.ts.map +0 -1
  289. package/dist/pin-input.d.ts.map +0 -1
  290. package/dist/popover.d.ts.map +0 -1
  291. package/dist/primitive.d.ts.map +0 -1
  292. package/dist/quantity-field.d.ts.map +0 -1
  293. package/dist/radio-group.d.ts.map +0 -1
  294. package/dist/range-calendar.d.ts.map +0 -1
  295. package/dist/rating.d.ts.map +0 -1
  296. package/dist/reorder.d.ts.map +0 -1
  297. package/dist/select.d.ts.map +0 -1
  298. package/dist/slider.d.ts.map +0 -1
  299. package/dist/spin-button.d.ts.map +0 -1
  300. package/dist/stepper.d.ts.map +0 -1
  301. package/dist/switch.d.ts.map +0 -1
  302. package/dist/tabs.d.ts.map +0 -1
  303. package/dist/tags-input.d.ts.map +0 -1
  304. package/dist/text.d.ts.map +0 -1
  305. package/dist/time-field.d.ts.map +0 -1
  306. package/dist/time-range-field.d.ts.map +0 -1
  307. package/dist/timer.d.ts.map +0 -1
  308. package/dist/toast.d.ts.map +0 -1
  309. package/dist/toggle-button.d.ts.map +0 -1
  310. package/dist/toggle-group.d.ts.map +0 -1
  311. package/dist/toolbar.d.ts.map +0 -1
  312. package/dist/tooltip.d.ts.map +0 -1
  313. package/dist/tree-grid.d.ts.map +0 -1
  314. package/dist/tree-view.d.ts.map +0 -1
  315. package/dist/virtual.d.ts.map +0 -1
  316. package/dist/virtual.js.map +0 -1
  317. package/dist/window-splitter.d.ts.map +0 -1
  318. package/dist/year-picker.d.ts.map +0 -1
  319. package/dist/year-range-picker.d.ts.map +0 -1
package/dist/form.d.ts CHANGED
@@ -1,10 +1,18 @@
1
- import { type AllowedComponentProps, type ComponentCustomProps, type ComputedRef, type PropType, type Ref, type SlotsType, type VNodeChild, type VNodeProps } from 'vue';
2
- import { type FormConnection, type FormFieldPath, type FormInteractionValidationTrigger, type FormOptions, type FormRelativePath, type FormSchema as DOMFormSchema, type FormSubmissionElement, type FormSubmitPayload as DOMFormSubmitPayload, type FormValidateContext as DOMFormValidateContext, type FormValidateHandler as DOMFormValidateHandler, type FormValidationIssue as DOMFormValidationIssue, type FormValidationResult as DOMFormValidationResult, type FormValues as DOMFormValues } from '@sectile/dom/form';
1
+ import { type AllowedComponentProps, type ComponentCustomProps, type PropType, type ShallowRef, type SlotsType, type VNodeChild, type VNodeProps } from 'vue';
2
+ import { type FormConnection, type FormFieldPath, type FormInteractionValidationTrigger, type FormOptions, type FormReinitializeOptions as DOMFormReinitializeOptions, type FormSchema as DOMFormSchema, type FormSubscribeOptions as DOMFormSubscribeOptions, type FormSubmitPayload as DOMFormSubmitPayload, type FormValidateContext as DOMFormValidateContext, type FormValidateHandler as DOMFormValidateHandler, type FormValidationIssue as DOMFormValidationIssue, type FormValidationResult as DOMFormValidationResult, type FormValues as DOMFormValues } from '@sectile/dom/form';
3
+ import type { FormSchemaOutput as DOMFormSchemaOutput } from '@sectile/form/schema';
4
+ import { compositeControlCapabilities, hiddenInputSubmissionCapabilities, hiddenSelectSubmissionCapabilities, hiddenValueSubmissionCapabilities, nativeInputControlCapabilities, provideFormControlOwner, useCompositeFormControl, useFormControl, useNativeInputFormControl, type FormControlCapabilities, type FormControlParticipation, type FormControlRegistration, type FormElementSource, type FormLabelMode, type FormMetadataAttribute, type FormSubmissionCapabilities, type FormSubmissionRegistration, type FormSubmissionSource } from './internal/form-control.js';
3
5
  import { type PrimitiveAs } from './primitive.js';
4
6
  export type FormState = FormConnection<string>['state'];
7
+ export type FormFieldState = NonNullable<ReturnType<FormConnection<string>['getField']>>;
8
+ export type FormFieldMetaInput = Parameters<FormConnection<string>['setFieldMeta']>[1];
9
+ export type FormSubscribeOptions<Selected> = DOMFormSubscribeOptions<Selected>;
10
+ export type FormSelectorFunction<Selected> = (state: FormState) => Selected;
11
+ export type FormFieldSelectorFunction<Selected> = (field: FormFieldState | null) => Selected;
5
12
  export type FormIssue = NonNullable<FormOptions<string>['issues']>[number];
6
13
  export type FormIssueSource = Parameters<FormConnection<string>['replaceIssues']>[0];
7
14
  export type FormValues<Shape extends object = Record<string, unknown>> = DOMFormValues<Shape>;
15
+ export type FormReinitializeOptions = DOMFormReinitializeOptions;
8
16
  export type FormSchema<Input extends object = Record<string, unknown>, Output extends object = Input> = DOMFormSchema<FormValues<Input>, FormValues<Output>>;
9
17
  export type FormSchemaInput<Schema extends FormSchema> = Schema extends DOMFormSchema<infer Input extends object, object> ? Input : never;
10
18
  export type FormSchemaOutput<Schema extends FormSchema> = Schema extends DOMFormSchema<object, infer Output extends object> ? Output : never;
@@ -28,6 +36,16 @@ export type FormSubmitResult = void | {
28
36
  readonly issues?: readonly FormSubmitIssue[];
29
37
  };
30
38
  export type FormSubmitHandler<Values extends object = Record<string, unknown>> = (event: FormSubmitEvent<Values>) => FormSubmitResult | PromiseLike<FormSubmitResult>;
39
+ export interface FormSubmissionDefinition {
40
+ readonly schema?: never;
41
+ readonly onSubmit: FormSubmitHandler<Record<string, unknown>>;
42
+ }
43
+ export interface FormSchemaSubmissionDefinition<Schema extends FormSchema<object, object>> {
44
+ readonly schema: Schema;
45
+ readonly onSubmit: FormSubmitHandler<DOMFormSchemaOutput<Schema>>;
46
+ }
47
+ export declare function defineFormSubmission<const Schema extends FormSchema<object, object>>(definition: FormSchemaSubmissionDefinition<Schema>): FormSchemaSubmissionDefinition<Schema>;
48
+ export declare function defineFormSubmission(definition: FormSubmissionDefinition): FormSubmissionDefinition;
31
49
  export type FormSubmitErrorMapper = (reason: unknown) => FormSubmitIssue | readonly FormSubmitIssue[] | undefined;
32
50
  export type FormResetHandler = () => void;
33
51
  export type FormStateChangeHandler = (state: FormState) => void;
@@ -40,6 +58,7 @@ export type FormSubmitSucceededAction = (generation: number) => boolean;
40
58
  export type FormSubmitFailedAction = (generation: number, issues?: readonly FormIssue[]) => boolean;
41
59
  export type FormReplaceIssuesAction = (source: FormIssueSource, issues: readonly FormIssue[]) => boolean;
42
60
  export type FormResetAction = () => void;
61
+ export type FormReinitializeAction = (options?: FormReinitializeOptions) => void;
43
62
  export interface FormRootProps<Input extends object = Record<string, unknown>, Output extends object = Input> {
44
63
  readonly issues?: readonly FormIssueInput[];
45
64
  readonly schema?: FormSchema<Input, Output>;
@@ -64,6 +83,7 @@ export interface FormRootSlotProps {
64
83
  readonly submitSucceeded: FormSubmitSucceededAction;
65
84
  readonly submitFailed: FormSubmitFailedAction;
66
85
  readonly replaceIssues: FormReplaceIssuesAction;
86
+ readonly reinitialize: FormReinitializeAction;
67
87
  readonly reset: FormResetAction;
68
88
  }
69
89
  export type FormRootPublicProps<Input extends object = Record<string, unknown>, Output extends object = Input> = FormRootProps<Input, Output> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
@@ -76,16 +96,17 @@ export interface FormRootComponent {
76
96
  $slots: {
77
97
  default?: (props: FormRootSlotProps) => VNodeChild;
78
98
  };
99
+ submitStarted: FormSubmitStartedAction;
100
+ submitSucceeded: FormSubmitSucceededAction;
101
+ submitFailed: FormSubmitFailedAction;
102
+ replaceIssues: FormReplaceIssuesAction;
103
+ reinitialize: FormReinitializeAction;
104
+ reset: FormResetAction;
79
105
  };
80
106
  }
81
- type FormFieldLeaf = string | number | boolean | bigint | symbol | null | undefined | Date | Blob | File;
82
- type FormFieldPathSegments<Value, Depth extends readonly unknown[] = []> = Depth['length'] extends 8 ? never : NonNullable<Value> extends FormFieldLeaf ? never : NonNullable<Value> extends readonly (infer Item)[] ? readonly [number] | readonly [number, ...FormFieldPathSegments<Item, readonly [...Depth, unknown]>] : NonNullable<Value> extends object ? {
83
- [Key in keyof NonNullable<Value> & string]: readonly [Key] | readonly [Key, ...FormFieldPathSegments<NonNullable<Value>[Key], readonly [...Depth, unknown]>];
84
- }[keyof NonNullable<Value> & string] : never;
85
- export type FormFieldPathOf<Values extends object> = string extends keyof Values ? FormFieldPath : (keyof Values & string) | FormFieldPathSegments<Values>;
86
- export interface FormFieldProps<Values extends object = Record<string, unknown>> {
107
+ export interface FormFieldProps {
87
108
  readonly id?: string;
88
- readonly name?: FormFieldPathOf<Values>;
109
+ readonly name?: FormFieldPath;
89
110
  readonly form?: string;
90
111
  readonly required?: boolean;
91
112
  readonly disabled?: boolean;
@@ -93,23 +114,7 @@ export interface FormFieldProps<Values extends object = Record<string, unknown>>
93
114
  readonly as?: PrimitiveAs;
94
115
  readonly asChild?: boolean;
95
116
  }
96
- export type FormFieldPublicProps<Values extends object = Record<string, unknown>> = FormFieldProps<Values> & VNodeProps & AllowedComponentProps & ComponentCustomProps;
97
- export interface TypedFormRootComponent<Input extends object, Output extends object = Input> {
98
- new (props: FormRootPublicProps<Input, Output>): {
99
- $props: FormRootPublicProps<Input, Output>;
100
- $slots: {
101
- default?: (props: FormRootSlotProps) => VNodeChild;
102
- };
103
- };
104
- }
105
- export interface TypedFormFieldComponent<Values extends object> {
106
- new (props: FormFieldPublicProps<Values>): {
107
- $props: FormFieldPublicProps<Values>;
108
- $slots: {
109
- default?: (props: FormFieldSlotProps) => VNodeChild;
110
- };
111
- };
112
- }
117
+ export type FormFieldPublicProps = FormFieldProps & VNodeProps & AllowedComponentProps & ComponentCustomProps;
113
118
  export interface FormFieldSlotProps {
114
119
  readonly id: string;
115
120
  readonly controlId: string;
@@ -121,51 +126,70 @@ export interface FormFieldSlotProps {
121
126
  readonly touched: boolean;
122
127
  readonly dirty: boolean;
123
128
  readonly issues: readonly FormIssue[];
129
+ readonly setMeta: (meta: FormFieldMetaInput) => boolean;
130
+ readonly replaceIssues: (source: FormIssueSource, issues: readonly FormIssue[]) => boolean;
131
+ readonly upsertIssue: (issue: FormIssue) => boolean;
132
+ readonly removeIssue: (issueId: Parameters<FormConnection<string>['removeFieldIssue']>[1]) => boolean;
133
+ readonly clearIssues: (source?: FormIssueSource) => boolean;
124
134
  }
125
- export type FormLabelMode = 'for' | 'labelledby' | 'legend';
126
- export type FormMetadataAttribute = 'id' | 'name' | 'form' | 'required' | 'disabled' | 'readonly' | 'aria-describedby' | 'aria-errormessage' | 'aria-invalid' | 'aria-labelledby' | 'aria-disabled' | 'aria-required' | 'aria-readonly';
127
- export interface FormControlCapabilities {
128
- readonly id?: boolean;
129
- readonly describedBy?: boolean;
130
- readonly invalid?: boolean;
131
- readonly labelledBy?: boolean;
132
- readonly required?: boolean;
133
- readonly disabled?: boolean;
134
- readonly readonly?: boolean;
135
+ export interface FormFieldController {
136
+ readonly state: Readonly<ShallowRef<FormFieldState | null>>;
137
+ setMeta(meta: FormFieldMetaInput): boolean;
138
+ replaceIssues(source: FormIssueSource, issues: readonly FormIssue[]): boolean;
139
+ upsertIssue(issue: FormIssue): boolean;
140
+ removeIssue(issueId: Parameters<FormConnection<string>['removeFieldIssue']>[1]): boolean;
141
+ clearIssues(source?: FormIssueSource): boolean;
135
142
  }
136
- export interface FormSubmissionCapabilities {
137
- readonly name?: boolean;
138
- readonly form?: boolean;
139
- readonly required?: boolean;
140
- readonly disabled?: boolean;
141
- readonly readonly?: boolean;
143
+ export interface FormSelectorProps<Selected> {
144
+ readonly select: FormSelectorFunction<Selected>;
145
+ readonly equals?: NonNullable<FormSubscribeOptions<Selected>['equals']>;
142
146
  }
143
- export type FormElementSource<ElementType extends HTMLElement = HTMLElement> = Ref<ElementType | null> | (() => ElementType | null);
144
- export interface FormSubmissionRegistration {
145
- readonly element: FormElementSource<FormSubmissionElement>;
146
- readonly relativeName?: FormRelativePath;
147
- readonly capabilities?: FormSubmissionCapabilities;
148
- readonly explicit?: readonly FormMetadataAttribute[];
147
+ export interface FormSelectorComponent {
148
+ new <Selected>(props: FormSelectorProps<Selected>): {
149
+ $props: FormSelectorProps<Selected>;
150
+ $slots: {
151
+ default?: (props: {
152
+ readonly selected: Selected;
153
+ }) => VNodeChild;
154
+ };
155
+ };
149
156
  }
150
- export type FormSubmissionSource = readonly FormSubmissionRegistration[] | (() => readonly FormSubmissionRegistration[]);
151
- export interface FormControlRegistration {
152
- readonly element: FormElementSource;
153
- readonly semanticControl?: FormElementSource;
154
- readonly focusTarget?: FormElementSource;
155
- readonly submissions?: FormSubmissionSource;
156
- readonly labelMode?: FormLabelMode;
157
- readonly capabilities?: FormControlCapabilities;
158
- readonly explicit?: readonly FormMetadataAttribute[];
157
+ export interface FormFieldSelectorProps<Selected> {
158
+ readonly id: string;
159
+ readonly select: FormFieldSelectorFunction<Selected>;
160
+ readonly equals?: NonNullable<FormSubscribeOptions<Selected>['equals']>;
159
161
  }
160
- export interface FormControlParticipation {
161
- readonly participating: boolean;
162
- readonly controlProps: ComputedRef<Readonly<Record<string, unknown>>>;
162
+ export interface FormFieldSelectorComponent {
163
+ new <Selected>(props: FormFieldSelectorProps<Selected>): {
164
+ $props: FormFieldSelectorProps<Selected>;
165
+ $slots: {
166
+ default?: (props: {
167
+ readonly selected: Selected;
168
+ }) => VNodeChild;
169
+ };
170
+ };
163
171
  }
172
+ export interface FormSummarySlotProps {
173
+ readonly valid: boolean;
174
+ }
175
+ export interface FormSubmitSlotProps {
176
+ readonly valid: boolean;
177
+ readonly submitting: boolean;
178
+ readonly canSubmit: boolean;
179
+ readonly submissionStatus: FormState['submissionStatus'];
180
+ }
181
+ export { compositeControlCapabilities, hiddenInputSubmissionCapabilities, hiddenSelectSubmissionCapabilities, hiddenValueSubmissionCapabilities, nativeInputControlCapabilities, provideFormControlOwner, useCompositeFormControl, useFormControl, useNativeInputFormControl, };
182
+ export type { FormControlCapabilities, FormControlParticipation, FormControlRegistration, FormElementSource, FormLabelMode, FormMetadataAttribute, FormSubmissionCapabilities, FormSubmissionRegistration, FormSubmissionSource, };
164
183
  export interface FormPartProps {
165
184
  readonly as?: PrimitiveAs;
166
185
  readonly asChild?: boolean;
167
186
  }
168
187
  export declare const FormRoot: FormRootComponent;
188
+ export declare function useFormSelector<Selected>(selector: FormSelectorFunction<Selected>, options?: FormSubscribeOptions<Selected>): Readonly<ShallowRef<Selected>>;
189
+ export declare function useFormFieldSelector<Selected>(id: string, selector: FormFieldSelectorFunction<Selected>, options?: FormSubscribeOptions<Selected>): Readonly<ShallowRef<Selected>>;
190
+ export declare function useFormFieldController(id: string): FormFieldController;
191
+ export declare const FormSelector: FormSelectorComponent;
192
+ export declare const FormFieldSelector: FormFieldSelectorComponent;
169
193
  export declare const FormField: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
170
194
  as: {
171
195
  type: PropType<PrimitiveAs>;
@@ -334,7 +358,7 @@ export declare const FormSummary: import("vue").DefineComponent<import("vue").Ex
334
358
  as: PrimitiveAs;
335
359
  asChild: boolean;
336
360
  }, SlotsType<{
337
- default: (props: FormRootSlotProps) => VNodeChild;
361
+ default: (props: FormSummarySlotProps) => VNodeChild;
338
362
  }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
339
363
  export declare const FormReset: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
340
364
  asChild: {
@@ -379,57 +403,6 @@ export declare const FormSubmit: import("vue").DefineComponent<import("vue").Ext
379
403
  }>> & Readonly<{}>, {
380
404
  asChild: boolean;
381
405
  as: PrimitiveAs;
382
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
383
- export declare function useFormControl(registration: FormControlRegistration): FormControlParticipation;
384
- export declare const nativeInputControlCapabilities: Readonly<{
385
- id: true;
386
- describedBy: true;
387
- invalid: true;
388
- required: true;
389
- disabled: true;
390
- readonly: true;
391
- }>;
392
- export declare const compositeControlCapabilities: Readonly<{
393
- id: true;
394
- describedBy: true;
395
- invalid: true;
396
- labelledBy: true;
397
- }>;
398
- export declare const hiddenInputSubmissionCapabilities: Readonly<{
399
- name: true;
400
- form: true;
401
- required: true;
402
- disabled: true;
403
- }>;
404
- export declare const hiddenSelectSubmissionCapabilities: Readonly<{
405
- name: true;
406
- form: true;
407
- required: true;
408
- disabled: true;
409
- }>;
410
- export declare const hiddenValueSubmissionCapabilities: Readonly<{
411
- name: true;
412
- form: true;
413
- disabled: true;
414
- }>;
415
- export declare function useNativeInputFormControl(element: Ref<HTMLInputElement | HTMLTextAreaElement | null | undefined>): FormControlParticipation;
416
- export declare function useCompositeFormControl(options: {
417
- readonly root: FormElementSource;
418
- readonly focusTarget?: FormElementSource;
419
- readonly submissions?: FormSubmissionSource;
420
- readonly labelMode?: FormLabelMode;
421
- }): FormControlParticipation;
422
- export declare function provideFormControlOwner(): void;
423
- export interface TypedFormComponents<Input extends object, Output extends object = Input> {
424
- readonly Root: TypedFormRootComponent<Input, Output>;
425
- readonly Field: TypedFormFieldComponent<Input>;
426
- readonly Label: typeof FormLabel;
427
- readonly Description: typeof FormDescription;
428
- readonly Message: typeof FormMessage;
429
- readonly Summary: typeof FormSummary;
430
- readonly Reset: typeof FormReset;
431
- readonly Submit: typeof FormSubmit;
432
- }
433
- export declare function createTypedForm<Input extends object, Output extends object = Input>(): TypedFormComponents<Input, Output>;
434
- export {};
435
- //# sourceMappingURL=form.d.ts.map
406
+ }, SlotsType<{
407
+ default: (props: FormSubmitSlotProps) => VNodeChild;
408
+ }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;