@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.
- package/README.md +4 -2
- package/dist/accordion.d.ts +0 -1
- package/dist/alert-dialog.d.ts +0 -2
- package/dist/alert-dialog.js.map +1 -1
- package/dist/calendar.d.ts +2 -3
- package/dist/calendar.js +14 -14
- package/dist/calendar.js.map +1 -1
- package/dist/carousel.d.ts +22 -1
- package/dist/carousel.js +7 -1
- package/dist/carousel.js.map +1 -1
- package/dist/cascade-list.d.ts +339 -0
- package/dist/cascade-list.js +240 -0
- package/dist/cascade-list.js.map +1 -0
- package/dist/cascade-select.d.ts +11 -42
- package/dist/cascade-select.js +19 -27
- package/dist/cascade-select.js.map +1 -1
- package/dist/checkbox-group.d.ts +9 -1
- package/dist/checkbox-group.js +57 -13
- package/dist/checkbox-group.js.map +1 -1
- package/dist/checkbox.d.ts +0 -1
- package/dist/checkbox.js +15 -8
- package/dist/checkbox.js.map +1 -1
- package/dist/color-picker.d.ts +0 -1
- package/dist/combobox.d.ts +0 -1
- package/dist/combobox.js +46 -6
- package/dist/combobox.js.map +1 -1
- package/dist/data-grid.d.ts +207 -0
- package/dist/data-grid.js +107 -0
- package/dist/data-grid.js.map +1 -0
- package/dist/data-table.d.ts +239 -0
- package/dist/data-table.js +120 -0
- package/dist/data-table.js.map +1 -0
- package/dist/data-tree-grid.d.ts +218 -0
- package/dist/data-tree-grid.js +95 -0
- package/dist/data-tree-grid.js.map +1 -0
- package/dist/date-field.d.ts +1 -2
- package/dist/date-field.js +1 -1
- package/dist/date-field.js.map +1 -1
- package/dist/date-picker.d.ts +37 -6
- package/dist/date-picker.js +3 -1
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-field.d.ts +2 -3
- package/dist/date-range-field.js +24 -6
- package/dist/date-range-field.js.map +1 -1
- package/dist/date-range-picker.d.ts +37 -6
- package/dist/date-range-picker.js +3 -1
- package/dist/date-range-picker.js.map +1 -1
- package/dist/date-time-field.d.ts +1 -2
- package/dist/date-time-field.js +1 -1
- package/dist/date-time-field.js.map +1 -1
- package/dist/date-time-picker.d.ts +38 -7
- package/dist/date-time-picker.js +3 -1
- package/dist/date-time-picker.js.map +1 -1
- package/dist/date-time-range-picker.d.ts +38 -7
- package/dist/date-time-range-picker.js +3 -1
- package/dist/date-time-range-picker.js.map +1 -1
- package/dist/dialog.d.ts +0 -2
- package/dist/dialog.js.map +1 -1
- package/dist/disclosure.d.ts +0 -1
- package/dist/drawer.d.ts +1 -2
- package/dist/editable.d.ts +0 -1
- package/dist/editable.js +25 -6
- package/dist/editable.js.map +1 -1
- package/dist/feed.d.ts +0 -1
- package/dist/form.d.ts +88 -115
- package/dist/form.js +461 -233
- package/dist/form.js.map +1 -1
- package/dist/grid.d.ts +0 -1
- package/dist/grid.js +51 -6
- package/dist/grid.js.map +1 -1
- package/dist/host-provider.d.ts +0 -13
- package/dist/host-provider.js +0 -16
- package/dist/host-provider.js.map +1 -1
- package/dist/index.d.ts +14 -39
- package/dist/index.js +6 -19
- package/dist/index.js.map +1 -1
- package/dist/internal/cascade-choice.d.ts +204 -0
- package/dist/internal/cascade-choice.js +161 -0
- package/dist/internal/cascade-choice.js.map +1 -0
- package/dist/internal/collection.d.ts +3 -8
- package/dist/internal/collection.js +14 -20
- package/dist/internal/collection.js.map +1 -1
- package/dist/internal/controlled-state.d.ts +0 -1
- package/dist/internal/date-picker.d.ts +78 -9
- package/dist/internal/date-picker.js +116 -27
- package/dist/internal/date-picker.js.map +1 -1
- package/dist/internal/decimal-input.d.ts +1 -0
- package/dist/internal/decimal-input.js +24 -0
- package/dist/internal/decimal-input.js.map +1 -0
- package/dist/internal/form-control-inventory.d.ts +4 -1
- package/dist/internal/form-control-inventory.js +1 -0
- package/dist/internal/form-control-inventory.js.map +1 -1
- package/dist/internal/form-control.d.ts +100 -2
- package/dist/internal/form-control.js +103 -1
- package/dist/internal/form-control.js.map +1 -1
- package/dist/internal/native-field.d.ts +0 -1
- package/dist/internal/native-field.js +11 -2
- package/dist/internal/native-field.js.map +1 -1
- package/dist/internal/native-input.d.ts +0 -1
- package/dist/internal/part-contract.d.ts +0 -1
- package/dist/internal/popup.d.ts +5 -27
- package/dist/internal/popup.js +15 -21
- package/dist/internal/popup.js.map +1 -1
- package/dist/internal/presence.d.ts +0 -1
- package/dist/internal/scheduled-task.d.ts +5 -0
- package/dist/internal/scheduled-task.js +28 -0
- package/dist/internal/scheduled-task.js.map +1 -0
- package/dist/internal/tabs-context.d.ts +2 -3
- package/dist/internal/tabular-components.d.ts +27 -0
- package/dist/internal/tabular-components.js +26 -0
- package/dist/internal/tabular-components.js.map +1 -0
- package/dist/internal/tabular-parts.d.ts +57 -0
- package/dist/internal/tabular-parts.js +239 -0
- package/dist/internal/tabular-parts.js.map +1 -0
- package/dist/internal/tabular-profile.d.ts +75 -0
- package/dist/internal/tabular-profile.js +211 -0
- package/dist/internal/tabular-profile.js.map +1 -0
- package/dist/internal/virtual-collection-model.d.ts +42 -0
- package/dist/internal/virtual-collection-model.js +241 -0
- package/dist/internal/virtual-collection-model.js.map +1 -0
- package/dist/internal/virtual-collection.d.ts +38 -0
- package/dist/internal/virtual-collection.js +87 -0
- package/dist/internal/virtual-collection.js.map +1 -0
- package/dist/{virtual.d.ts → internal/virtual-core.d.ts} +9 -4
- package/dist/{virtual.js → internal/virtual-core.js} +7 -7
- package/dist/internal/virtual-core.js.map +1 -0
- package/dist/internal/virtual-list.d.ts +214 -0
- package/dist/internal/virtual-list.js +401 -0
- package/dist/internal/virtual-list.js.map +1 -0
- package/dist/listbox.d.ts +0 -1
- package/dist/listbox.js +52 -6
- package/dist/listbox.js.map +1 -1
- package/dist/menu-button.d.ts +0 -1
- package/dist/menu.d.ts +0 -1
- package/dist/menubar.d.ts +0 -1
- package/dist/meter-group.d.ts +369 -0
- package/dist/meter-group.js +271 -0
- package/dist/meter-group.js.map +1 -0
- package/dist/meter.d.ts +191 -0
- package/dist/meter.js +133 -0
- package/dist/meter.js.map +1 -0
- package/dist/month-picker.d.ts +37 -6
- package/dist/month-picker.js +3 -1
- package/dist/month-picker.js.map +1 -1
- package/dist/month-range-picker.d.ts +37 -6
- package/dist/month-range-picker.js +3 -1
- package/dist/month-range-picker.js.map +1 -1
- package/dist/multi-thumb-slider.d.ts +0 -1
- package/dist/navigation-menu.d.ts +0 -1
- package/dist/number-field.d.ts +0 -1
- package/dist/pagination.d.ts +23 -2
- package/dist/pagination.js +6 -1
- package/dist/pagination.js.map +1 -1
- package/dist/pin-input.d.ts +0 -1
- package/dist/pin-input.js +1 -1
- package/dist/pin-input.js.map +1 -1
- package/dist/popover.d.ts +0 -2
- package/dist/popover.js.map +1 -1
- package/dist/primitive.d.ts +0 -1
- package/dist/primitive.js +8 -4
- package/dist/primitive.js.map +1 -1
- package/dist/progress.d.ts +148 -0
- package/dist/progress.js +110 -0
- package/dist/progress.js.map +1 -0
- package/dist/quantity-field.d.ts +0 -1
- package/dist/radio-group.d.ts +0 -1
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/range-calendar.d.ts +2 -3
- package/dist/rating.d.ts +0 -1
- package/dist/rating.js +10 -1
- package/dist/rating.js.map +1 -1
- package/dist/reorder.d.ts +1 -2
- package/dist/select.d.ts +18 -44
- package/dist/select.js +11 -13
- package/dist/select.js.map +1 -1
- package/dist/slider.d.ts +0 -1
- package/dist/spin-button.d.ts +0 -1
- package/dist/spin-button.js +17 -4
- package/dist/spin-button.js.map +1 -1
- package/dist/stepper.d.ts +0 -1
- package/dist/stepper.js +19 -2
- package/dist/stepper.js.map +1 -1
- package/dist/switch.d.ts +0 -1
- package/dist/tabs.d.ts +0 -1
- package/dist/tabs.js +4 -22
- package/dist/tabs.js.map +1 -1
- package/dist/tags-input.d.ts +0 -1
- package/dist/tags-input.js +18 -5
- package/dist/tags-input.js.map +1 -1
- package/dist/temporal-provider.d.ts +21 -0
- package/dist/temporal-provider.js +30 -0
- package/dist/temporal-provider.js.map +1 -0
- package/dist/text.d.ts +0 -1
- package/dist/text.js +18 -4
- package/dist/text.js.map +1 -1
- package/dist/time-field.d.ts +1 -2
- package/dist/time-field.js +1 -1
- package/dist/time-field.js.map +1 -1
- package/dist/time-range-field.d.ts +2 -2
- package/dist/time-range-field.js +6 -4
- package/dist/time-range-field.js.map +1 -1
- package/dist/timer.d.ts +0 -1
- package/dist/toast.d.ts +11 -2
- package/dist/toast.js +22 -9
- package/dist/toast.js.map +1 -1
- package/dist/toggle-button.d.ts +0 -1
- package/dist/toggle-group.d.ts +0 -1
- package/dist/toggle-group.js +1 -1
- package/dist/toggle-group.js.map +1 -1
- package/dist/toolbar.d.ts +0 -1
- package/dist/tooltip.d.ts +1 -3
- package/dist/tooltip.js.map +1 -1
- package/dist/tree-grid.d.ts +0 -1
- package/dist/tree-grid.js +62 -8
- package/dist/tree-grid.js.map +1 -1
- package/dist/tree-view.d.ts +0 -1
- package/dist/tree-view.js +51 -10
- package/dist/tree-view.js.map +1 -1
- package/dist/virtual-core.d.ts +1 -0
- package/dist/virtual-core.js +2 -0
- package/dist/virtual-core.js.map +1 -0
- package/dist/virtual-grid.d.ts +188 -0
- package/dist/virtual-grid.js +306 -0
- package/dist/virtual-grid.js.map +1 -0
- package/dist/virtual-list.d.ts +1 -0
- package/dist/virtual-list.js +2 -0
- package/dist/virtual-list.js.map +1 -0
- package/dist/virtual-masonry.d.ts +198 -0
- package/dist/virtual-masonry.js +221 -0
- package/dist/virtual-masonry.js.map +1 -0
- package/dist/virtual-spatial.d.ts +157 -0
- package/dist/virtual-spatial.js +159 -0
- package/dist/virtual-spatial.js.map +1 -0
- package/dist/window-splitter.d.ts +0 -1
- package/dist/year-picker.d.ts +37 -6
- package/dist/year-picker.js +3 -1
- package/dist/year-picker.js.map +1 -1
- package/dist/year-range-picker.d.ts +37 -6
- package/dist/year-range-picker.js +3 -1
- package/dist/year-range-picker.js.map +1 -1
- package/package.json +173 -89
- package/dist/accordion.d.ts.map +0 -1
- package/dist/alert-dialog.d.ts.map +0 -1
- package/dist/calendar.d.ts.map +0 -1
- package/dist/carousel.d.ts.map +0 -1
- package/dist/cascade-select.d.ts.map +0 -1
- package/dist/checkbox-group.d.ts.map +0 -1
- package/dist/checkbox.d.ts.map +0 -1
- package/dist/color-picker.d.ts.map +0 -1
- package/dist/combobox.d.ts.map +0 -1
- package/dist/date-field.d.ts.map +0 -1
- package/dist/date-picker.d.ts.map +0 -1
- package/dist/date-range-field.d.ts.map +0 -1
- package/dist/date-range-picker.d.ts.map +0 -1
- package/dist/date-time-field.d.ts.map +0 -1
- package/dist/date-time-picker.d.ts.map +0 -1
- package/dist/date-time-range-picker.d.ts.map +0 -1
- package/dist/dialog.d.ts.map +0 -1
- package/dist/disclosure.d.ts.map +0 -1
- package/dist/drawer.d.ts.map +0 -1
- package/dist/editable.d.ts.map +0 -1
- package/dist/feed.d.ts.map +0 -1
- package/dist/form.d.ts.map +0 -1
- package/dist/grid.d.ts.map +0 -1
- package/dist/host-provider.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/internal/collection.d.ts.map +0 -1
- package/dist/internal/controlled-state.d.ts.map +0 -1
- package/dist/internal/date-picker.d.ts.map +0 -1
- package/dist/internal/form-control-inventory.d.ts.map +0 -1
- package/dist/internal/form-control.d.ts.map +0 -1
- package/dist/internal/native-field.d.ts.map +0 -1
- package/dist/internal/native-input.d.ts.map +0 -1
- package/dist/internal/part-contract.d.ts.map +0 -1
- package/dist/internal/popup.d.ts.map +0 -1
- package/dist/internal/presence.d.ts.map +0 -1
- package/dist/internal/tabs-context.d.ts.map +0 -1
- package/dist/listbox.d.ts.map +0 -1
- package/dist/menu-button.d.ts.map +0 -1
- package/dist/menu.d.ts.map +0 -1
- package/dist/menubar.d.ts.map +0 -1
- package/dist/month-picker.d.ts.map +0 -1
- package/dist/month-range-picker.d.ts.map +0 -1
- package/dist/multi-thumb-slider.d.ts.map +0 -1
- package/dist/navigation-menu.d.ts.map +0 -1
- package/dist/number-field.d.ts.map +0 -1
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pin-input.d.ts.map +0 -1
- package/dist/popover.d.ts.map +0 -1
- package/dist/primitive.d.ts.map +0 -1
- package/dist/quantity-field.d.ts.map +0 -1
- package/dist/radio-group.d.ts.map +0 -1
- package/dist/range-calendar.d.ts.map +0 -1
- package/dist/rating.d.ts.map +0 -1
- package/dist/reorder.d.ts.map +0 -1
- package/dist/select.d.ts.map +0 -1
- package/dist/slider.d.ts.map +0 -1
- package/dist/spin-button.d.ts.map +0 -1
- package/dist/stepper.d.ts.map +0 -1
- package/dist/switch.d.ts.map +0 -1
- package/dist/tabs.d.ts.map +0 -1
- package/dist/tags-input.d.ts.map +0 -1
- package/dist/text.d.ts.map +0 -1
- package/dist/time-field.d.ts.map +0 -1
- package/dist/time-range-field.d.ts.map +0 -1
- package/dist/timer.d.ts.map +0 -1
- package/dist/toast.d.ts.map +0 -1
- package/dist/toggle-button.d.ts.map +0 -1
- package/dist/toggle-group.d.ts.map +0 -1
- package/dist/toolbar.d.ts.map +0 -1
- package/dist/tooltip.d.ts.map +0 -1
- package/dist/tree-grid.d.ts.map +0 -1
- package/dist/tree-view.d.ts.map +0 -1
- package/dist/virtual.d.ts.map +0 -1
- package/dist/virtual.js.map +0 -1
- package/dist/window-splitter.d.ts.map +0 -1
- package/dist/year-picker.d.ts.map +0 -1
- 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
|
|
2
|
-
import { type FormConnection, type FormFieldPath, type FormInteractionValidationTrigger, type FormOptions, type
|
|
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
|
-
|
|
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?:
|
|
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
|
|
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
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
readonly
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
|
137
|
-
readonly
|
|
138
|
-
readonly
|
|
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
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
|
151
|
-
|
|
152
|
-
readonly
|
|
153
|
-
readonly
|
|
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
|
|
161
|
-
|
|
162
|
-
|
|
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:
|
|
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
|
-
}, {
|
|
383
|
-
|
|
384
|
-
|
|
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>;
|