@dragonmastery/zinia-forms-core 0.4.7 → 0.5.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/dist/index.d.ts +1258 -936
- package/dist/index.js +7179 -5188
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,64 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { FunctionalComponent, Ref,
|
|
2
|
+
import { FunctionalComponent, App, Ref, ComputedRef } from 'vue';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Types for registered styles
|
|
7
|
+
* This allows for autocomplete of registered style names
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Union type of all registered style names
|
|
11
|
+
* Update this when adding new built-in styles
|
|
12
|
+
*/
|
|
13
|
+
type BuiltInStyleName = 'daisy_ui';
|
|
14
|
+
/**
|
|
15
|
+
* Type for custom registered style names
|
|
16
|
+
* This is a string literal type that can be extended by users
|
|
17
|
+
*/
|
|
18
|
+
type CustomStyleName = string;
|
|
19
|
+
/**
|
|
20
|
+
* Union type of all possible style names
|
|
21
|
+
* This includes both built-in styles and custom styles
|
|
22
|
+
*/
|
|
23
|
+
type RegisteredStyleName = BuiltInStyleName | CustomStyleName;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Create base form components for a schema
|
|
27
|
+
*
|
|
28
|
+
* @param schema The Zod schema for the form
|
|
29
|
+
* @param renderStyle The style to use for rendering
|
|
30
|
+
* @returns Base form components (Form, SubmitButton, ResetButton)
|
|
31
|
+
*/
|
|
32
|
+
declare function createBaseComponents<T extends z.ZodObject<any>>(schema: T, styleName?: RegisteredStyleName): {
|
|
33
|
+
Form: vue.FunctionalComponent<FormProps<z.TypeOf<T>>, {}, any, {}>;
|
|
34
|
+
SubmitButton: vue.FunctionalComponent<SubmitButtonProps<z.TypeOf<T>>, {}, any, {}>;
|
|
35
|
+
ResetButton: vue.FunctionalComponent<ResetButtonProps<z.TypeOf<T>>, {}, any, {}>;
|
|
36
|
+
FormErrorsSummary: vue.FunctionalComponent<FormErrorsSummaryProps, {}, any, {}>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Create base display components using registered styles
|
|
41
|
+
*
|
|
42
|
+
* @param schema The Zod schema for the data
|
|
43
|
+
* @param styleName The style to use for rendering
|
|
44
|
+
* @returns Base display components
|
|
45
|
+
*/
|
|
46
|
+
declare function createBaseDisplayComponents<T extends z.ZodObject<any>>(schema: T, styleName?: RegisteredStyleName): {
|
|
47
|
+
ZiniaDisplay: vue.FunctionalComponent<DisplayProps<z.TypeOf<T>>, {}, any, {}>;
|
|
48
|
+
};
|
|
49
|
+
|
|
5
50
|
type BrowserNativeObject = Date | FileList | File;
|
|
6
51
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
52
|
+
/**
|
|
53
|
+
* Checks whether the type is any
|
|
54
|
+
* See {@link https://stackoverflow.com/a/49928360/3406963}
|
|
55
|
+
* @typeParam T - type which may be any
|
|
56
|
+
* ```
|
|
57
|
+
* IsAny<any> = true
|
|
58
|
+
* IsAny<string> = false
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
7
62
|
/**
|
|
8
63
|
* Checks whether T1 can be exactly (mutually) assigned to T2
|
|
9
64
|
* @typeParam T1 - type to check
|
|
@@ -67,6 +122,46 @@ type PathInternal<T, TraversedTypes = T> = T extends ReadonlyArray<infer V> ? Is
|
|
|
67
122
|
}[TupleKeys<T>] : PathImpl<ArrayKey, V, TraversedTypes> : {
|
|
68
123
|
[K in keyof T]-?: PathImpl<K & string, T[K], TraversedTypes>;
|
|
69
124
|
}[keyof T];
|
|
125
|
+
/**
|
|
126
|
+
* Helper type for recursively constructing paths through a type.
|
|
127
|
+
* This actually constructs the strings and recurses into nested
|
|
128
|
+
* object types.
|
|
129
|
+
*
|
|
130
|
+
* See {@link ArrayPath}
|
|
131
|
+
*/
|
|
132
|
+
type ArrayPathImpl<K extends string | number, V, TraversedTypes> = V extends Primitive | BrowserNativeObject ? IsAny<V> extends true ? string : never : V extends ReadonlyArray<infer U> ? U extends Primitive | BrowserNativeObject ? IsAny<V> extends true ? string : never : true extends AnyIsEqual<TraversedTypes, V> ? never : `${K}` | `${K}.${ArrayPathInternal<V, TraversedTypes | V>}` : true extends AnyIsEqual<TraversedTypes, V> ? never : `${K}.${ArrayPathInternal<V, TraversedTypes | V>}`;
|
|
133
|
+
/**
|
|
134
|
+
* Helper type for recursively constructing paths through a type.
|
|
135
|
+
* This obscures the internal type param TraversedTypes from ed contract.
|
|
136
|
+
*
|
|
137
|
+
* See {@link ArrayPath}
|
|
138
|
+
*/
|
|
139
|
+
type ArrayPathInternal<T, TraversedTypes = T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? {
|
|
140
|
+
[K in TupleKeys<T>]-?: ArrayPathImpl<K & string, T[K], TraversedTypes>;
|
|
141
|
+
}[TupleKeys<T>] : ArrayPathImpl<ArrayKey, V, TraversedTypes> : {
|
|
142
|
+
[K in keyof T]-?: ArrayPathImpl<K & string, T[K], TraversedTypes>;
|
|
143
|
+
}[keyof T];
|
|
144
|
+
/**
|
|
145
|
+
* Type which eagerly collects all paths through a type which point to an array
|
|
146
|
+
* type.
|
|
147
|
+
* @typeParam T - type which should be introspected.
|
|
148
|
+
* @example
|
|
149
|
+
* ```
|
|
150
|
+
* Path<{foo: {bar: string[], baz: number[]}}> = 'foo.bar' | 'foo.baz'
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
type ArrayPath<T> = T extends any ? ArrayPathInternal<T> : never;
|
|
154
|
+
/**
|
|
155
|
+
* Type to evaluate the type which the given path points to.
|
|
156
|
+
* @typeParam T - deeply nested type which is indexed by the path
|
|
157
|
+
* @typeParam P - path into the deeply nested type
|
|
158
|
+
* @example
|
|
159
|
+
* ```
|
|
160
|
+
* PathValue<{foo: {bar: string}}, 'foo.bar'> = string
|
|
161
|
+
* PathValue<[number, string], '1'> = string
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
type PathValue<T, P extends Path<T> | ArrayPath<T>> = T extends any ? P extends `${infer K}.${infer R}` ? K extends keyof T ? R extends Path<T[K]> ? PathValue<T[K], R> : never : K extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? PathValue<V, R & Path<V>> : never : never : P extends keyof T ? T[P] : P extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? V : never : never : never;
|
|
70
165
|
/**
|
|
71
166
|
* Type which eagerly collects all paths through a type
|
|
72
167
|
* @typeParam T - type which should be introspected
|
|
@@ -525,6 +620,10 @@ type SegmentToPascalCase<S extends string> = S extends `${infer First}_${infer R
|
|
|
525
620
|
* Also handles underscores by removing them and capitalizing each segment
|
|
526
621
|
*/
|
|
527
622
|
type PathToPascalCase<P extends string> = P extends `${infer A}.${infer B}` ? `${SegmentToPascalCase<A>}${PathToPascalCase<B>}` : `${SegmentToPascalCase<P>}Field`;
|
|
623
|
+
/**
|
|
624
|
+
* Helper type to extract enum type from a schema path
|
|
625
|
+
*/
|
|
626
|
+
type ExtractEnumType<T, P extends Path<T>> = P extends keyof T ? T[P] extends string ? T[P] : string : string;
|
|
528
627
|
/**
|
|
529
628
|
* Type that maps field paths to their corresponding enum types
|
|
530
629
|
*/
|
|
@@ -635,7 +734,7 @@ type ComponentsType<T> = {
|
|
|
635
734
|
* Metadata about a form field
|
|
636
735
|
* This interface defines all the properties that describe a field's behavior and appearance
|
|
637
736
|
*/
|
|
638
|
-
interface FieldMetadata {
|
|
737
|
+
interface FieldMetadata$1 {
|
|
639
738
|
/** The full path to the field (e.g., 'user.firstName') */
|
|
640
739
|
path: string;
|
|
641
740
|
/** Whether the field is required (false if optional) */
|
|
@@ -664,9 +763,9 @@ interface FieldMetadata {
|
|
|
664
763
|
/** Whether the field is an array */
|
|
665
764
|
isArray?: boolean;
|
|
666
765
|
/** Metadata for array element type */
|
|
667
|
-
arrayOf?: FieldMetadata;
|
|
766
|
+
arrayOf?: FieldMetadata$1;
|
|
668
767
|
/** Child field metadata for object types */
|
|
669
|
-
children?: Record<string, FieldMetadata>;
|
|
768
|
+
children?: Record<string, FieldMetadata$1>;
|
|
670
769
|
/** Available items for array fields */
|
|
671
770
|
availableItems?: any[];
|
|
672
771
|
/** Help text to display with the field */
|
|
@@ -691,132 +790,309 @@ interface FieldMetadata {
|
|
|
691
790
|
autocomplete?: string;
|
|
692
791
|
}
|
|
693
792
|
|
|
793
|
+
interface ArrayFieldSlots<ItemType> {
|
|
794
|
+
itemRenderer: (props: {
|
|
795
|
+
item: ItemType;
|
|
796
|
+
index: number;
|
|
797
|
+
fields: FieldNames<ItemType>;
|
|
798
|
+
}) => any;
|
|
799
|
+
availableItemRenderer: (props: {
|
|
800
|
+
item: ItemType;
|
|
801
|
+
index: number;
|
|
802
|
+
}) => any;
|
|
803
|
+
itemActions: (props: {
|
|
804
|
+
item: ItemType;
|
|
805
|
+
index: number;
|
|
806
|
+
fields: FieldNames<ItemType>;
|
|
807
|
+
}) => any;
|
|
808
|
+
fieldSummary: (props: {
|
|
809
|
+
items: ItemType[];
|
|
810
|
+
}) => any;
|
|
811
|
+
default: () => any;
|
|
812
|
+
}
|
|
813
|
+
|
|
694
814
|
/**
|
|
695
|
-
*
|
|
815
|
+
* Functions for creating type-safe array fields
|
|
696
816
|
*/
|
|
697
817
|
|
|
698
818
|
/**
|
|
699
|
-
*
|
|
700
|
-
* This
|
|
701
|
-
*
|
|
819
|
+
* Create a factory function that returns a properly typed ArrayField based on the field path
|
|
820
|
+
* This preserves the ItemType so that Vue's template slots are properly typed
|
|
821
|
+
*
|
|
822
|
+
* @param baseArrayField The base array field component
|
|
823
|
+
* @param fieldPath The field path to create an array field for
|
|
824
|
+
* @param metadata Optional metadata to apply to the field
|
|
825
|
+
* @returns A properly typed array field component with slot types preserved
|
|
702
826
|
*/
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
inputType?: 'text' | 'email' | 'tel' | 'number' | 'select' | 'checkbox' | 'radio' | 'textarea' | 'password' | 'currency' | 'date' | 'time' | 'datetime-local' | 'combobox' | 'array';
|
|
706
|
-
/** Placeholder text for the field */
|
|
707
|
-
placeholder?: string;
|
|
708
|
-
/** The display label for the field */
|
|
709
|
-
label?: string;
|
|
710
|
-
/** Help text to display with the field */
|
|
711
|
-
helpText?: string;
|
|
712
|
-
/** For textarea fields, number of rows to display */
|
|
713
|
-
rows?: number;
|
|
714
|
-
/** For textarea fields, number of columns to display */
|
|
715
|
-
cols?: number;
|
|
716
|
-
/** For enum fields, map values to display labels */
|
|
717
|
-
valueToLabel?: Record<string, string>;
|
|
718
|
-
/** Whether to hide validation errors */
|
|
719
|
-
hideError?: boolean;
|
|
720
|
-
/** Step value for numeric fields */
|
|
721
|
-
step?: number;
|
|
722
|
-
/** Any other custom properties */
|
|
723
|
-
[key: string]: any;
|
|
724
|
-
}
|
|
827
|
+
declare function createTypedArrayField<T, P extends Path<T>>(baseArrayField: FunctionalComponent<ArrayFieldProps<T, any>, {}, any, {}>, fieldPath: P, metadata?: FieldMetadata$1): FunctionalComponent<Omit<ArrayFieldProps<T, ArrayItemType<T, P>>, "name">, {}, ArrayFieldSlots<ArrayItemType<T, P>>, {}>;
|
|
828
|
+
|
|
725
829
|
/**
|
|
726
|
-
*
|
|
830
|
+
* Functions for creating type-safe combobox fields
|
|
727
831
|
*/
|
|
728
|
-
|
|
832
|
+
|
|
729
833
|
/**
|
|
730
|
-
*
|
|
834
|
+
* Create a factory function that returns a properly typed ComboboxField based on the field path
|
|
835
|
+
*
|
|
836
|
+
* @param baseComboboxField The base combobox field component
|
|
837
|
+
* @param fieldPath The field path to create a combobox field for
|
|
838
|
+
* @returns A factory function that creates a type-safe combobox field
|
|
839
|
+
*
|
|
840
|
+
* This preserves path-specific typing for features like dependsOn (cascading dropdowns)
|
|
841
|
+
* and ensures type safety between selectOptions and optionFilterFn
|
|
731
842
|
*/
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
interface CurrencyFieldProps<FormType> {
|
|
735
|
-
name: FlexiblePath<FormType>;
|
|
736
|
-
label?: string;
|
|
737
|
-
hideLabel?: boolean;
|
|
738
|
-
description?: string;
|
|
739
|
-
required?: boolean;
|
|
740
|
-
placeholder?: string;
|
|
741
|
-
disabled?: boolean;
|
|
742
|
-
readonly?: boolean;
|
|
743
|
-
class?: string | string[];
|
|
744
|
-
size?: string;
|
|
745
|
-
variant?: string;
|
|
746
|
-
min?: number;
|
|
747
|
-
max?: number;
|
|
748
|
-
step?: number;
|
|
749
|
-
}
|
|
843
|
+
declare function createTypedComboboxField<T, P extends Path<T>>(baseComboboxField: FunctionalComponent<ComboboxFieldProps<T>>, fieldPath: P): <TData = any>(props: Omit<ComboboxFieldProps<T, P, TData>, "name">, context?: any) => any;
|
|
750
844
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
hideLabel?: boolean;
|
|
755
|
-
description?: string;
|
|
756
|
-
required?: boolean;
|
|
757
|
-
placeholder?: string;
|
|
758
|
-
disabled?: boolean;
|
|
759
|
-
readonly?: boolean;
|
|
760
|
-
class?: string | string[];
|
|
761
|
-
size?: string;
|
|
762
|
-
variant?: string;
|
|
763
|
-
min?: string;
|
|
764
|
-
max?: string;
|
|
765
|
-
step?: number;
|
|
766
|
-
}
|
|
845
|
+
/**
|
|
846
|
+
* Functions for creating type-safe select fields
|
|
847
|
+
*/
|
|
767
848
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
849
|
+
/**
|
|
850
|
+
* Create a factory function that returns a properly typed SelectField based on the field path
|
|
851
|
+
*
|
|
852
|
+
* @param baseSelectField The base select field component
|
|
853
|
+
* @param fieldPath The field path to create a select field for
|
|
854
|
+
* @returns A factory function that creates a type-safe select field
|
|
855
|
+
*/
|
|
856
|
+
declare function createTypedSelectField<T, P extends Path<T>>(baseSelectField: FunctionalComponent<SelectFieldProps<T>>, fieldPath: P): <E extends FieldPathToEnum<T, P> = FieldPathToEnum<T, P>>(props: Omit<SelectFieldProps<T>, "name" | "valueToLabel"> & {
|
|
857
|
+
valueToLabel: Record<E, string>;
|
|
858
|
+
}, context?: any) => any;
|
|
859
|
+
/**
|
|
860
|
+
* Type-safe select field component with valueToLabel based on field path
|
|
861
|
+
*/
|
|
862
|
+
interface TypedSelectFieldComponent<T> {
|
|
863
|
+
<P extends Path<T>>(props: Omit<SelectFieldProps<T>, 'valueToLabel'> & {
|
|
864
|
+
name: P;
|
|
865
|
+
valueToLabel?: Record<string, string>;
|
|
866
|
+
}): ReturnType<FunctionalComponent>;
|
|
781
867
|
}
|
|
782
868
|
|
|
783
|
-
|
|
784
|
-
|
|
869
|
+
/**
|
|
870
|
+
* Type for display field components
|
|
871
|
+
*/
|
|
872
|
+
type DisplayFieldComponent<T, P extends Path<T>, _FieldType extends string = 'string'> = (props: {
|
|
873
|
+
name?: P;
|
|
785
874
|
label?: string;
|
|
786
875
|
hideLabel?: boolean;
|
|
787
876
|
description?: string;
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
readonly?: boolean;
|
|
877
|
+
format?: 'default' | 'currency' | 'date' | 'datetime' | 'boolean' | 'email' | 'url' | 'phone' | 'number';
|
|
878
|
+
emptyText?: string;
|
|
791
879
|
class?: string | string[];
|
|
792
880
|
size?: string;
|
|
793
881
|
variant?: string;
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
882
|
+
copyable?: boolean;
|
|
883
|
+
valueToLabel?: Record<string, string>;
|
|
884
|
+
separator?: string;
|
|
885
|
+
itemRenderer?: (item: any, index: number) => string;
|
|
886
|
+
maxItems?: number;
|
|
887
|
+
}, context?: any) => any;
|
|
798
888
|
/**
|
|
799
|
-
*
|
|
889
|
+
* Type for the display components object with PascalCase keys derived from field paths
|
|
890
|
+
* This mirrors the ComponentsType from the form system but with Display suffix
|
|
800
891
|
*/
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
892
|
+
type DisplayComponentsType<T> = {
|
|
893
|
+
[K in Path<T> as `${PathToPascalCase<K & string>}` extends `${infer Base}Field` ? `${Base}Display` : `${PathToPascalCase<K & string>}Display`]: DisplayFieldComponent<T, K>;
|
|
894
|
+
};
|
|
895
|
+
/**
|
|
896
|
+
* Generate display field components for a schema based on metadata
|
|
897
|
+
*
|
|
898
|
+
* @param schema The Zod schema for the data
|
|
899
|
+
* @param fieldsMetadata Metadata for fields
|
|
900
|
+
* @param renderStyle The style to use for rendering
|
|
901
|
+
* @returns Generated display field components
|
|
902
|
+
*/
|
|
903
|
+
declare function generateDisplayComponents<T extends z.ZodObject<any>>(schema: T, fieldsMetadata: Record<string, FieldMetadata$1>, styleName?: RegisteredStyleName): {
|
|
904
|
+
generic: {
|
|
905
|
+
DisplayField: vue.FunctionalComponent<DisplayFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
906
|
+
fields: { [K in Path<z.TypeOf<T>>]: DisplayFieldComponent<z.TypeOf<T>, K, string>; };
|
|
907
|
+
field: <P extends Path<z.TypeOf<T>>>(path: P) => any;
|
|
908
|
+
};
|
|
909
|
+
typed: DisplayComponentsType<z.TypeOf<T>>;
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* Generate field components for a schema based on metadata
|
|
914
|
+
*
|
|
915
|
+
* @param schema The Zod schema for the form
|
|
916
|
+
* @param fieldsMetadata Metadata for form fields
|
|
917
|
+
* @param renderStyle The style to use for rendering
|
|
918
|
+
* @returns Generated field components
|
|
919
|
+
*/
|
|
920
|
+
declare function generateFieldComponents<T extends z.ZodObject<any>>(schema: T, fieldsMetadata: Record<string, FieldMetadata$1>, styleName?: RegisteredStyleName): {
|
|
921
|
+
generic: {
|
|
922
|
+
TextField: vue.FunctionalComponent<TextFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
923
|
+
NumberField: vue.FunctionalComponent<NumberFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
924
|
+
SelectField: vue.FunctionalComponent<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, {}, any, {}>;
|
|
925
|
+
CheckboxField: vue.FunctionalComponent<CheckboxFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
926
|
+
TextareaField: vue.FunctionalComponent<TextareaFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
927
|
+
RadioField: vue.FunctionalComponent<RadioFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
928
|
+
FileField: vue.FunctionalComponent<FileFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
929
|
+
DateField: vue.FunctionalComponent<DateFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
930
|
+
TimeField: vue.FunctionalComponent<TimeFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
931
|
+
DateTimeLocalField: vue.FunctionalComponent<DateTimeLocalFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
932
|
+
RangeField: vue.FunctionalComponent<RangeFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
933
|
+
PasswordField: vue.FunctionalComponent<PasswordFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
934
|
+
EmailField: vue.FunctionalComponent<EmailFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
935
|
+
UrlField: vue.FunctionalComponent<UrlFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
936
|
+
TelField: vue.FunctionalComponent<TelFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
937
|
+
SearchField: vue.FunctionalComponent<SearchFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
938
|
+
ComboboxField: vue.FunctionalComponent<ComboboxFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, {}, any, {}>;
|
|
939
|
+
ArrayField: vue.FunctionalComponent<ArrayFieldProps<z.TypeOf<T>, any>, {}, {
|
|
940
|
+
itemRenderer: (props: {
|
|
941
|
+
item: any;
|
|
942
|
+
index: number;
|
|
943
|
+
fields: Record<string, string> | {
|
|
944
|
+
[x: string]: string;
|
|
945
|
+
};
|
|
946
|
+
}) => any;
|
|
947
|
+
availableItemRenderer: (props: {
|
|
948
|
+
item: any;
|
|
949
|
+
index: number;
|
|
950
|
+
}) => any;
|
|
951
|
+
itemActions: (props: {
|
|
952
|
+
item: any;
|
|
953
|
+
index: number;
|
|
954
|
+
fields: Record<string, string> | {
|
|
955
|
+
[x: string]: string;
|
|
956
|
+
};
|
|
957
|
+
}) => any;
|
|
958
|
+
fieldSummary: (props: {
|
|
959
|
+
items: any[];
|
|
960
|
+
}) => any;
|
|
961
|
+
default: () => any;
|
|
962
|
+
}, {}>;
|
|
963
|
+
TransferListField: vue.FunctionalComponent<TransferListFieldProps<z.TypeOf<T>, any>, {}, {
|
|
964
|
+
itemRenderer: (props: {
|
|
965
|
+
item: any;
|
|
966
|
+
index: number;
|
|
967
|
+
getFieldName: (fieldPath: string) => string;
|
|
968
|
+
}) => any;
|
|
969
|
+
availableItemRenderer: (props: {
|
|
970
|
+
item: any;
|
|
971
|
+
index: number;
|
|
972
|
+
}) => any;
|
|
973
|
+
selectedItemRenderer: (props: {
|
|
974
|
+
item: any;
|
|
975
|
+
index: number;
|
|
976
|
+
getFieldName: (fieldPath: string) => string;
|
|
977
|
+
}) => any;
|
|
978
|
+
default: () => any;
|
|
979
|
+
}, {}>;
|
|
980
|
+
ToppingsField: vue.FunctionalComponent<ToppingsFieldProps<z.TypeOf<T>, any>, {}, {
|
|
981
|
+
itemRenderer: (props: {
|
|
982
|
+
item: any;
|
|
983
|
+
index: number;
|
|
984
|
+
getFieldName: (fieldPath: string) => string;
|
|
985
|
+
}) => any;
|
|
986
|
+
availableItemRenderer: (props: {
|
|
987
|
+
item: any;
|
|
988
|
+
index: number;
|
|
989
|
+
}) => any;
|
|
990
|
+
toppingRenderer: (props: {
|
|
991
|
+
topping: any;
|
|
992
|
+
isSelected: boolean;
|
|
993
|
+
placement: string;
|
|
994
|
+
isExtra: boolean;
|
|
995
|
+
}) => any;
|
|
996
|
+
default: () => any;
|
|
997
|
+
}, {}>;
|
|
998
|
+
createTypedSelectField: <P extends Path<z.TypeOf<T>>>(fieldPath: P) => <E extends FieldPathToEnum<z.TypeOf<T>, P> = FieldPathToEnum<z.TypeOf<T>, P>>(props: Omit<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, "name" | "valueToLabel"> & {
|
|
999
|
+
valueToLabel: Record<E, string>;
|
|
1000
|
+
}, context?: any) => any;
|
|
1001
|
+
typedSelectFields: { [K in Path<z.TypeOf<T>>]?: (<E extends FieldPathToEnum<z.TypeOf<T>, K> = FieldPathToEnum<z.TypeOf<T>, K>>(props: Omit<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, "name" | "valueToLabel"> & {
|
|
1002
|
+
valueToLabel: Record<E, string>;
|
|
1003
|
+
}, context?: any) => any) | undefined; };
|
|
1004
|
+
fields: Record<Path<z.TypeOf<T>>, any>;
|
|
1005
|
+
field: <P extends Path<z.TypeOf<T>>>(path: P) => any;
|
|
1006
|
+
};
|
|
1007
|
+
typed: ComponentsType<z.TypeOf<T>>;
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
interface CurrencyFieldProps<FormType> {
|
|
1011
|
+
name: FlexiblePath<FormType>;
|
|
1012
|
+
label?: string;
|
|
1013
|
+
hideLabel?: boolean;
|
|
1014
|
+
description?: string;
|
|
1015
|
+
required?: boolean;
|
|
1016
|
+
placeholder?: string;
|
|
1017
|
+
disabled?: boolean;
|
|
1018
|
+
readonly?: boolean;
|
|
1019
|
+
class?: string | string[];
|
|
1020
|
+
size?: string;
|
|
1021
|
+
variant?: string;
|
|
1022
|
+
min?: number;
|
|
1023
|
+
max?: number;
|
|
1024
|
+
step?: number;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
interface DateTimeLocalFieldProps<FormType> {
|
|
1028
|
+
name: FlexiblePath<FormType>;
|
|
1029
|
+
label?: string;
|
|
1030
|
+
hideLabel?: boolean;
|
|
1031
|
+
description?: string;
|
|
1032
|
+
required?: boolean;
|
|
1033
|
+
placeholder?: string;
|
|
1034
|
+
disabled?: boolean;
|
|
1035
|
+
readonly?: boolean;
|
|
1036
|
+
class?: string | string[];
|
|
1037
|
+
size?: string;
|
|
1038
|
+
variant?: string;
|
|
1039
|
+
min?: string;
|
|
1040
|
+
max?: string;
|
|
1041
|
+
step?: number;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
interface EmailFieldProps<FormType> {
|
|
1045
|
+
name: FlexiblePath<FormType>;
|
|
1046
|
+
label?: string;
|
|
1047
|
+
hideLabel?: boolean;
|
|
1048
|
+
description?: string;
|
|
1049
|
+
required?: boolean;
|
|
1050
|
+
placeholder?: string;
|
|
1051
|
+
disabled?: boolean;
|
|
1052
|
+
readonly?: boolean;
|
|
1053
|
+
autocomplete?: string;
|
|
1054
|
+
class?: string | string[];
|
|
1055
|
+
size?: string;
|
|
1056
|
+
variant?: string;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
interface FileFieldProps<FormType> {
|
|
1060
|
+
name: FlexiblePath<FormType>;
|
|
1061
|
+
label?: string;
|
|
1062
|
+
hideLabel?: boolean;
|
|
1063
|
+
description?: string;
|
|
1064
|
+
required?: boolean;
|
|
1065
|
+
disabled?: boolean;
|
|
1066
|
+
readonly?: boolean;
|
|
1067
|
+
class?: string | string[];
|
|
1068
|
+
size?: string;
|
|
1069
|
+
variant?: string;
|
|
1070
|
+
accept?: string;
|
|
1071
|
+
multiple?: boolean;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Props for the FormErrorsSummary component
|
|
1076
|
+
*/
|
|
1077
|
+
interface FormErrorsSummaryProps {
|
|
1078
|
+
/**
|
|
1079
|
+
* Custom title for the errors section
|
|
1080
|
+
*/
|
|
1081
|
+
title?: string;
|
|
1082
|
+
/**
|
|
1083
|
+
* Whether to show the component only after form submission has been attempted
|
|
1084
|
+
* @default true
|
|
1085
|
+
*/
|
|
1086
|
+
showOnlyAfterSubmitAttempt?: boolean;
|
|
1087
|
+
/**
|
|
1088
|
+
* Custom CSS class for the container
|
|
1089
|
+
*/
|
|
1090
|
+
className?: string;
|
|
1091
|
+
/**
|
|
1092
|
+
* Icon to display next to the title
|
|
1093
|
+
* @default 'exclamation-circle'
|
|
1094
|
+
*/
|
|
1095
|
+
icon?: string;
|
|
820
1096
|
}
|
|
821
1097
|
|
|
822
1098
|
interface FormProps<FormType> {
|
|
@@ -1197,6 +1473,33 @@ interface DataTableProps<FormType> {
|
|
|
1197
1473
|
height?: 'auto' | 'fixed' | number | string;
|
|
1198
1474
|
}
|
|
1199
1475
|
|
|
1476
|
+
/**
|
|
1477
|
+
* Common action icons as SVG strings
|
|
1478
|
+
* These are Heroicons (heroicons.com) in SVG format for easy use in actions
|
|
1479
|
+
*/
|
|
1480
|
+
declare const ActionIcons: {
|
|
1481
|
+
readonly edit: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z\" /></svg>";
|
|
1482
|
+
readonly pencil: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z\" /></svg>";
|
|
1483
|
+
readonly delete: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" /></svg>";
|
|
1484
|
+
readonly trash: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" /></svg>";
|
|
1485
|
+
readonly view: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\" /><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z\" /></svg>";
|
|
1486
|
+
readonly eye: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\" /><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z\" /></svg>";
|
|
1487
|
+
readonly copy: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\" /></svg>";
|
|
1488
|
+
readonly duplicate: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\" /></svg>";
|
|
1489
|
+
readonly download: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\" /></svg>";
|
|
1490
|
+
readonly share: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.367 2.684 3 3 0 00-5.367-2.684z\" /></svg>";
|
|
1491
|
+
readonly settings: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z\" /><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\" /></svg>";
|
|
1492
|
+
readonly plus: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 6v6m0 0v6m0-6h6m-6 0H6\" /></svg>";
|
|
1493
|
+
readonly external: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\" /></svg>";
|
|
1494
|
+
readonly arrowRight: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M13 7l5 5m0 0l-5 5m5-5H6\" /></svg>";
|
|
1495
|
+
readonly check: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 13l4 4L19 7\" /></svg>";
|
|
1496
|
+
readonly checkCircle: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\" /></svg>";
|
|
1497
|
+
readonly save: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" fill=\"none\" class=\"size-6\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 20.25h12A2.25 2.25 0 0 0 20.25 18V7.5L16.5 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25zm9.75-16.5v5h-9.5v-5zM13 5.5V7m-6.75 4.25h11.5v6.5H6.25Z\"></path>\n</svg>";
|
|
1498
|
+
readonly spinner: "<svg class=\"animate-spin\" fill=\"none\" viewBox=\"0 0 24 24\"><circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle><path class=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"></path></svg>";
|
|
1499
|
+
readonly dots: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z\" /></svg>";
|
|
1500
|
+
readonly dotsHorizontal: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z\" /></svg>";
|
|
1501
|
+
};
|
|
1502
|
+
|
|
1200
1503
|
/**
|
|
1201
1504
|
* Types for style creators in the form system
|
|
1202
1505
|
*/
|
|
@@ -1305,705 +1608,384 @@ interface StyleCreators {
|
|
|
1305
1608
|
}
|
|
1306
1609
|
|
|
1307
1610
|
/**
|
|
1308
|
-
*
|
|
1309
|
-
*
|
|
1611
|
+
* Zinia Forms Plugin
|
|
1612
|
+
* Allows registering custom render styles at the application level
|
|
1310
1613
|
*/
|
|
1311
1614
|
|
|
1312
1615
|
/**
|
|
1313
|
-
*
|
|
1616
|
+
* Plugin options for Zinia
|
|
1314
1617
|
*/
|
|
1315
|
-
interface
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
collapsedFields: Record<string, {
|
|
1325
|
-
isFieldCollapsed: boolean;
|
|
1326
|
-
collapsedItems: number[];
|
|
1327
|
-
defaultCollapsedInitialized: boolean;
|
|
1328
|
-
}>;
|
|
1329
|
-
undoHistory: Record<string, {
|
|
1330
|
-
type: 'add' | 'remove' | 'swap';
|
|
1331
|
-
previousState: any;
|
|
1332
|
-
currentState: any;
|
|
1333
|
-
timestamp: number;
|
|
1334
|
-
}[]>;
|
|
1335
|
-
redoHistory: Record<string, {
|
|
1336
|
-
type: 'add' | 'remove' | 'swap';
|
|
1337
|
-
previousState: any;
|
|
1338
|
-
currentState: any;
|
|
1339
|
-
timestamp: number;
|
|
1340
|
-
}[]>;
|
|
1341
|
-
pendingOperations: Record<string, {
|
|
1342
|
-
type: 'add' | 'remove' | 'swap';
|
|
1343
|
-
index?: number;
|
|
1344
|
-
indexA?: number;
|
|
1345
|
-
indexB?: number;
|
|
1346
|
-
item?: any;
|
|
1347
|
-
previousState: any;
|
|
1348
|
-
currentState: any;
|
|
1349
|
-
timestamp: number;
|
|
1350
|
-
timeoutId?: number;
|
|
1351
|
-
}[]>;
|
|
1352
|
-
arrayItemIds: Record<string, string[]>;
|
|
1353
|
-
isSubmitting: boolean;
|
|
1354
|
-
hasAttemptedSubmit: boolean;
|
|
1355
|
-
submitAttemptsCount: number;
|
|
1356
|
-
submitError: string | null;
|
|
1357
|
-
isReady: boolean;
|
|
1358
|
-
isLoading: boolean;
|
|
1359
|
-
loadError: string | null;
|
|
1360
|
-
extraData: ExtraDataType;
|
|
1361
|
-
fetchedOptions: Record<string, any[]>;
|
|
1362
|
-
loadingOptions: Record<string, boolean>;
|
|
1363
|
-
asyncCascadingParents: Record<string, string>;
|
|
1364
|
-
loadingAutoPopulate: Record<string, boolean>;
|
|
1365
|
-
populatingFields: Record<string, boolean>;
|
|
1618
|
+
interface ZiniaPluginOptions {
|
|
1619
|
+
/**
|
|
1620
|
+
* Map of style names to style creators
|
|
1621
|
+
*/
|
|
1622
|
+
styles?: Record<string, StyleCreators>;
|
|
1623
|
+
/**
|
|
1624
|
+
* Default style to use if none specified in useForm
|
|
1625
|
+
*/
|
|
1626
|
+
defaultStyle?: string;
|
|
1366
1627
|
}
|
|
1367
|
-
|
|
1368
1628
|
/**
|
|
1369
|
-
*
|
|
1629
|
+
* Vue plugin for Zinia Forms
|
|
1630
|
+
*/
|
|
1631
|
+
declare const ZiniaPlugin: {
|
|
1632
|
+
install(app: App, options?: ZiniaPluginOptions): void;
|
|
1633
|
+
};
|
|
1634
|
+
/**
|
|
1635
|
+
* Get a registered style by name
|
|
1636
|
+
*
|
|
1637
|
+
* @param styleName Name of the style to get
|
|
1638
|
+
* @returns Style creators for the requested style or undefined if not found
|
|
1639
|
+
*/
|
|
1640
|
+
declare function getRegisteredStyle(styleName?: string): StyleCreators | undefined;
|
|
1641
|
+
/**
|
|
1642
|
+
* Check if a style is registered
|
|
1643
|
+
*
|
|
1644
|
+
* @param styleName Name of the style to check
|
|
1645
|
+
* @returns True if the style is registered
|
|
1646
|
+
*/
|
|
1647
|
+
declare function hasRegisteredStyle(styleName: string): boolean;
|
|
1648
|
+
/**
|
|
1649
|
+
* Get the default style name
|
|
1650
|
+
*
|
|
1651
|
+
* @returns Name of the default style
|
|
1370
1652
|
*/
|
|
1653
|
+
declare function getDefaultStyle(): string;
|
|
1654
|
+
/**
|
|
1655
|
+
* Get all registered style names
|
|
1656
|
+
*
|
|
1657
|
+
* @returns Array of registered style names
|
|
1658
|
+
*/
|
|
1659
|
+
declare function getRegisteredStyleNames(): string[];
|
|
1660
|
+
/**
|
|
1661
|
+
* Register a style at runtime
|
|
1662
|
+
* Useful for dynamically loading styles
|
|
1663
|
+
*
|
|
1664
|
+
* @param styleName Name of the style to register
|
|
1665
|
+
* @param creators Style creators for the style
|
|
1666
|
+
*/
|
|
1667
|
+
declare function registerStyle(styleName: string, creators: StyleCreators): void;
|
|
1371
1668
|
|
|
1372
1669
|
/**
|
|
1373
|
-
*
|
|
1670
|
+
* Types for schema metadata in the form system
|
|
1374
1671
|
*/
|
|
1375
|
-
|
|
1672
|
+
|
|
1376
1673
|
/**
|
|
1377
|
-
*
|
|
1674
|
+
* Additional metadata that can be associated with schema fields
|
|
1675
|
+
* This interface defines properties that can be attached to schema fields
|
|
1676
|
+
* to customize their behavior and appearance
|
|
1378
1677
|
*/
|
|
1379
|
-
interface
|
|
1380
|
-
/**
|
|
1381
|
-
|
|
1382
|
-
/**
|
|
1383
|
-
|
|
1384
|
-
/**
|
|
1385
|
-
|
|
1386
|
-
/**
|
|
1387
|
-
|
|
1678
|
+
interface SchemaFieldMetadata {
|
|
1679
|
+
/** The input type for rendering the field */
|
|
1680
|
+
inputType?: 'text' | 'email' | 'tel' | 'number' | 'select' | 'checkbox' | 'radio' | 'textarea' | 'password' | 'currency' | 'date' | 'time' | 'datetime-local' | 'combobox' | 'array';
|
|
1681
|
+
/** Placeholder text for the field */
|
|
1682
|
+
placeholder?: string;
|
|
1683
|
+
/** The display label for the field */
|
|
1684
|
+
label?: string;
|
|
1685
|
+
/** Help text to display with the field */
|
|
1686
|
+
helpText?: string;
|
|
1687
|
+
/** For textarea fields, number of rows to display */
|
|
1688
|
+
rows?: number;
|
|
1689
|
+
/** For textarea fields, number of columns to display */
|
|
1690
|
+
cols?: number;
|
|
1691
|
+
/** For enum fields, map values to display labels */
|
|
1692
|
+
valueToLabel?: Record<string, string>;
|
|
1693
|
+
/** Whether to hide validation errors */
|
|
1694
|
+
hideError?: boolean;
|
|
1695
|
+
/** Step value for numeric fields */
|
|
1696
|
+
step?: number;
|
|
1697
|
+
/** Any other custom properties */
|
|
1698
|
+
[key: string]: any;
|
|
1388
1699
|
}
|
|
1389
1700
|
/**
|
|
1390
|
-
* Type for the
|
|
1391
|
-
* Uses a mapped type to preserve field path type safety
|
|
1701
|
+
* Type for the registry mapping field paths to their metadata
|
|
1392
1702
|
*/
|
|
1393
|
-
type
|
|
1394
|
-
[K in string]: AsyncCascadingSelectConfig<FormType, Path<FormType>, Path<FormType>>;
|
|
1395
|
-
};
|
|
1703
|
+
type MetadataRegistry = Record<string, SchemaFieldMetadata>;
|
|
1396
1704
|
/**
|
|
1397
|
-
*
|
|
1705
|
+
* Type helper to extract all possible paths from a Zod schema
|
|
1398
1706
|
*/
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
* Optional async function to fetch data when option is selected.
|
|
1402
|
-
* If provided, this will be called instead of using option.data.
|
|
1403
|
-
* Receives the selected option value and returns the data object.
|
|
1404
|
-
*/
|
|
1405
|
-
fetchDataFn?: (selectedValue: FieldValue<FormType, SourceField>) => Promise<TData>;
|
|
1406
|
-
/** Mapping of form fields to data properties for auto-population */
|
|
1407
|
-
fields: {
|
|
1408
|
-
[TargetField in Path<FormType>]?: string | ((data: TData) => FieldValue<FormType, TargetField>);
|
|
1409
|
-
};
|
|
1410
|
-
}
|
|
1707
|
+
type PathsOf<T extends z.ZodTypeAny> = Path<z.infer<T>>;
|
|
1708
|
+
|
|
1411
1709
|
/**
|
|
1412
|
-
*
|
|
1413
|
-
* Key is the select/combobox field name, value is the auto-populate config
|
|
1710
|
+
* Registry for storing schema metadata
|
|
1414
1711
|
*/
|
|
1415
|
-
type AutoPopulateConfigs<FormType> = Partial<{
|
|
1416
|
-
[SourceField in Path<FormType>]: AutoPopulateConfig<FormType, any>;
|
|
1417
|
-
}>;
|
|
1418
1712
|
|
|
1419
1713
|
/**
|
|
1420
|
-
*
|
|
1714
|
+
* Get metadata for a specific field in a schema
|
|
1715
|
+
*
|
|
1716
|
+
* @param schemaId Unique identifier for the schema
|
|
1717
|
+
* @param path Path to the field
|
|
1718
|
+
* @returns Metadata for the field or undefined if not found
|
|
1421
1719
|
*/
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1720
|
+
declare function getFieldMetadata(schemaId: string, path: string): SchemaFieldMetadata | undefined;
|
|
1721
|
+
/**
|
|
1722
|
+
* Get all metadata for a schema
|
|
1723
|
+
*
|
|
1724
|
+
* @param schemaId Unique identifier for the schema
|
|
1725
|
+
* @returns All metadata for the schema or an empty object if not found
|
|
1726
|
+
*/
|
|
1727
|
+
declare function getAllSchemaMetadata(schemaId: string): MetadataRegistry;
|
|
1728
|
+
/**
|
|
1729
|
+
* Set metadata for a schema
|
|
1730
|
+
*
|
|
1731
|
+
* @param schemaId Unique identifier for the schema
|
|
1732
|
+
* @param metadata Object mapping field paths to their metadata
|
|
1733
|
+
*/
|
|
1734
|
+
declare function setSchemaMetadata(schemaId: string, metadata: MetadataRegistry): void;
|
|
1735
|
+
/**
|
|
1736
|
+
* Check if a schema has metadata
|
|
1737
|
+
*
|
|
1738
|
+
* @param schemaId Unique identifier for the schema
|
|
1739
|
+
* @returns True if the schema has metadata, false otherwise
|
|
1740
|
+
*/
|
|
1741
|
+
declare function hasSchemaMetadata(schemaId: string): boolean;
|
|
1742
|
+
/**
|
|
1743
|
+
* Clear metadata for a schema
|
|
1744
|
+
*
|
|
1745
|
+
* @param schemaId Unique identifier for the schema
|
|
1746
|
+
*/
|
|
1747
|
+
declare function clearSchemaMetadata(schemaId: string): void;
|
|
1748
|
+
/**
|
|
1749
|
+
* Clear all metadata from the registry
|
|
1750
|
+
*/
|
|
1751
|
+
declare function clearAllMetadata(): void;
|
|
1434
1752
|
|
|
1435
1753
|
/**
|
|
1436
|
-
*
|
|
1437
|
-
* This allows for autocomplete of registered style names
|
|
1754
|
+
* Functions for registering schema metadata
|
|
1438
1755
|
*/
|
|
1756
|
+
|
|
1439
1757
|
/**
|
|
1440
|
-
*
|
|
1441
|
-
*
|
|
1758
|
+
* Register metadata for a schema
|
|
1759
|
+
*
|
|
1760
|
+
* @param schemaId Unique identifier for the schema
|
|
1761
|
+
* @param metadata Object mapping field paths to their metadata
|
|
1442
1762
|
*/
|
|
1443
|
-
|
|
1763
|
+
declare function registerSchemaMetadata(schemaId: string, metadata: MetadataRegistry): void;
|
|
1444
1764
|
/**
|
|
1445
|
-
*
|
|
1446
|
-
*
|
|
1765
|
+
* Register metadata for a schema with type checking for field paths
|
|
1766
|
+
*
|
|
1767
|
+
* @param schema The Zod schema
|
|
1768
|
+
* @param schemaId Unique identifier for the schema
|
|
1769
|
+
* @param metadata Object mapping field paths to their metadata
|
|
1447
1770
|
*/
|
|
1448
|
-
|
|
1771
|
+
declare function registerSchemaMetadata<T extends z.ZodObject<any>>(schema: T, schemaId: string, metadata: {
|
|
1772
|
+
[K in PathsOf<T>]?: SchemaFieldMetadata;
|
|
1773
|
+
}): void;
|
|
1774
|
+
|
|
1449
1775
|
/**
|
|
1450
|
-
*
|
|
1451
|
-
* This includes both built-in styles and custom styles
|
|
1776
|
+
* Functions for attaching metadata to schemas
|
|
1452
1777
|
*/
|
|
1453
|
-
type RegisteredStyleName = BuiltInStyleName | CustomStyleName;
|
|
1454
1778
|
|
|
1455
|
-
declare const
|
|
1456
|
-
declare const ZINIA_FIELDS_KEY = "ziniaFields";
|
|
1457
|
-
declare const ZINIA_FIELDS_GENERIC_KEY = "ziniaFieldsGeneric";
|
|
1458
|
-
declare const ZINIA_FORM_SCHEMA_KEY = "ziniaFormSchema";
|
|
1459
|
-
type DataLoaderReturnTypes<T> = {
|
|
1460
|
-
[K in keyof T]: T[K] extends () => Promise<infer R> ? R : never;
|
|
1461
|
-
};
|
|
1779
|
+
declare const SCHEMA_ID_SYMBOL: unique symbol;
|
|
1462
1780
|
/**
|
|
1463
|
-
*
|
|
1781
|
+
* Helper function to get the schema ID from a schema object
|
|
1464
1782
|
*
|
|
1465
|
-
* @param schema
|
|
1466
|
-
* @
|
|
1467
|
-
* @returns Form API and components
|
|
1783
|
+
* @param schema Zod schema that might have a schema ID attached
|
|
1784
|
+
* @returns The schema ID or undefined if not found
|
|
1468
1785
|
*/
|
|
1469
|
-
declare function
|
|
1470
|
-
storeName: string;
|
|
1471
|
-
schemaId?: string;
|
|
1472
|
-
persistToLocalStorage?: boolean;
|
|
1473
|
-
initialValues?: Partial<z.infer<typeof schema>>;
|
|
1474
|
-
renderStyle?: RegisteredStyleName;
|
|
1475
|
-
autoProvide?: boolean;
|
|
1476
|
-
validateOnMount?: boolean;
|
|
1477
|
-
mergeOptions?: MergeOptions<z.infer<typeof schema>>;
|
|
1478
|
-
dataLoaders?: {
|
|
1479
|
-
[K in keyof ExtraDataType]?: () => Promise<ExtraDataType[K]>;
|
|
1480
|
-
};
|
|
1481
|
-
fetchData?: () => Promise<z.infer<typeof schema>>;
|
|
1482
|
-
asyncCascadingSelects?: AsyncCascadingSelectsConfig<z.infer<T>>;
|
|
1483
|
-
autoPopulate?: AutoPopulateConfigs<z.infer<T>>;
|
|
1484
|
-
calculationFn?: (values: z.infer<T>, extraData?: ExtraDataType) => CalcType;
|
|
1485
|
-
debug?: {
|
|
1486
|
-
all?: boolean;
|
|
1487
|
-
formState?: boolean;
|
|
1488
|
-
validation?: boolean;
|
|
1489
|
-
calculations?: boolean;
|
|
1490
|
-
persistence?: boolean;
|
|
1491
|
-
reactivity?: boolean;
|
|
1492
|
-
};
|
|
1493
|
-
}): {
|
|
1494
|
-
form: {
|
|
1495
|
-
storeName: string;
|
|
1496
|
-
values: z.TypeOf<T>;
|
|
1497
|
-
state: FormState<z.TypeOf<T>, CalcType, ExtraDataType>;
|
|
1498
|
-
readonly calculatedValues: CalcType;
|
|
1499
|
-
readonly extraData: ExtraDataType;
|
|
1500
|
-
readonly isValid: boolean;
|
|
1501
|
-
readonly isDirty: boolean;
|
|
1502
|
-
isSubmitting: boolean;
|
|
1503
|
-
readonly hasAttemptedSubmit: boolean;
|
|
1504
|
-
readonly submitAttemptsCount: number;
|
|
1505
|
-
readonly errors: Record<string, string>;
|
|
1506
|
-
readonly touched: Record<string, boolean>;
|
|
1507
|
-
readonly dirty: Record<string, boolean>;
|
|
1508
|
-
readonly collapsedFields: Record<string, {
|
|
1509
|
-
isFieldCollapsed: boolean;
|
|
1510
|
-
collapsedItems: number[];
|
|
1511
|
-
defaultCollapsedInitialized: boolean;
|
|
1512
|
-
}>;
|
|
1513
|
-
readonly undoHistory: Record<string, {
|
|
1514
|
-
type: "add" | "remove" | "swap";
|
|
1515
|
-
previousState: any;
|
|
1516
|
-
currentState: any;
|
|
1517
|
-
timestamp: number;
|
|
1518
|
-
}[]>;
|
|
1519
|
-
readonly redoHistory: Record<string, {
|
|
1520
|
-
type: "add" | "remove" | "swap";
|
|
1521
|
-
previousState: any;
|
|
1522
|
-
currentState: any;
|
|
1523
|
-
timestamp: number;
|
|
1524
|
-
}[]>;
|
|
1525
|
-
readonly pendingOperations: Record<string, {
|
|
1526
|
-
type: "add" | "remove" | "swap";
|
|
1527
|
-
index?: number;
|
|
1528
|
-
indexA?: number;
|
|
1529
|
-
indexB?: number;
|
|
1530
|
-
item?: any;
|
|
1531
|
-
previousState: any;
|
|
1532
|
-
currentState: any;
|
|
1533
|
-
timestamp: number;
|
|
1534
|
-
timeoutId?: number;
|
|
1535
|
-
}[]>;
|
|
1536
|
-
readonly fieldsMetadata: Record<string, FieldMetadata>;
|
|
1537
|
-
validate: (options?: {
|
|
1538
|
-
markErrorsAsTouched: boolean;
|
|
1539
|
-
}) => boolean;
|
|
1540
|
-
validateField: (path: string) => boolean;
|
|
1541
|
-
reset: (newInitialData?: z.TypeOf<T> | undefined) => void;
|
|
1542
|
-
setSubmitting: (value: boolean) => void;
|
|
1543
|
-
incrementSubmitAttempts: () => void;
|
|
1544
|
-
setSubmitError: (error: string | null) => void;
|
|
1545
|
-
readonly isReady: boolean;
|
|
1546
|
-
readonly isLoading: boolean;
|
|
1547
|
-
readonly loadError: string | null;
|
|
1548
|
-
readonly submitError: string | null;
|
|
1549
|
-
setLoading: (value: boolean) => void;
|
|
1550
|
-
setReady: (value: boolean) => void;
|
|
1551
|
-
setLoadError: (error: string | null) => void;
|
|
1552
|
-
getValue: (path: string) => any;
|
|
1553
|
-
setValue: (path: string, value: any) => void;
|
|
1554
|
-
touchField: (path: string) => void;
|
|
1555
|
-
isTouched: (path: string) => boolean;
|
|
1556
|
-
isDirtyField: (path: string) => boolean;
|
|
1557
|
-
resetField: (path: string) => void;
|
|
1558
|
-
hasError: (path: string) => boolean;
|
|
1559
|
-
getError: (path: string) => string;
|
|
1560
|
-
setFocus: (path: string, value: boolean) => void;
|
|
1561
|
-
isFocused: (path: string) => boolean;
|
|
1562
|
-
setDisplayText: (path: string, text: string) => void;
|
|
1563
|
-
getDisplayText: (path: string) => string;
|
|
1564
|
-
setSelectedIndex: (path: string, index: number) => void;
|
|
1565
|
-
getSelectedIndex: (path: string) => number;
|
|
1566
|
-
getArrayItemId: (path: string, index: number) => string;
|
|
1567
|
-
addArrayItemId: (path: string, index?: number) => string;
|
|
1568
|
-
removeArrayItemId: (path: string, index: number) => void;
|
|
1569
|
-
swapArrayItemIds: (path: string, indexA: number, indexB: number) => void;
|
|
1570
|
-
syncArrayItemIds: (path: string) => void;
|
|
1571
|
-
};
|
|
1572
|
-
ZiniaForm: vue.FunctionalComponent<FormProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1573
|
-
ZiniaSubmitButton: vue.FunctionalComponent<SubmitButtonProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1574
|
-
ZiniaResetButton: vue.FunctionalComponent<ResetButtonProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1575
|
-
ZiniaFormErrorsSummary: vue.FunctionalComponent<FormErrorsSummaryProps, {}, any, {}>;
|
|
1576
|
-
zinia: ComponentsType<z.TypeOf<T>>;
|
|
1577
|
-
ziniaGeneric: {
|
|
1578
|
-
TextField: vue.FunctionalComponent<TextFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1579
|
-
NumberField: vue.FunctionalComponent<NumberFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1580
|
-
SelectField: vue.FunctionalComponent<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, {}, any, {}>;
|
|
1581
|
-
CheckboxField: vue.FunctionalComponent<CheckboxFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1582
|
-
TextareaField: vue.FunctionalComponent<TextareaFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1583
|
-
RadioField: vue.FunctionalComponent<RadioFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1584
|
-
FileField: vue.FunctionalComponent<FileFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1585
|
-
DateField: vue.FunctionalComponent<DateFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1586
|
-
TimeField: vue.FunctionalComponent<TimeFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1587
|
-
DateTimeLocalField: vue.FunctionalComponent<DateTimeLocalFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1588
|
-
RangeField: vue.FunctionalComponent<RangeFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1589
|
-
PasswordField: vue.FunctionalComponent<PasswordFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1590
|
-
EmailField: vue.FunctionalComponent<EmailFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1591
|
-
UrlField: vue.FunctionalComponent<UrlFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1592
|
-
TelField: vue.FunctionalComponent<TelFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1593
|
-
SearchField: vue.FunctionalComponent<SearchFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1594
|
-
ComboboxField: vue.FunctionalComponent<ComboboxFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, {}, any, {}>;
|
|
1595
|
-
ArrayField: vue.FunctionalComponent<ArrayFieldProps<z.TypeOf<T>, any>, {}, {
|
|
1596
|
-
itemRenderer: (props: {
|
|
1597
|
-
item: any;
|
|
1598
|
-
index: number;
|
|
1599
|
-
fields: Record<string, string> | {
|
|
1600
|
-
[x: string]: string;
|
|
1601
|
-
};
|
|
1602
|
-
}) => any;
|
|
1603
|
-
availableItemRenderer: (props: {
|
|
1604
|
-
item: any;
|
|
1605
|
-
index: number;
|
|
1606
|
-
}) => any;
|
|
1607
|
-
itemActions: (props: {
|
|
1608
|
-
item: any;
|
|
1609
|
-
index: number;
|
|
1610
|
-
fields: Record<string, string> | {
|
|
1611
|
-
[x: string]: string;
|
|
1612
|
-
};
|
|
1613
|
-
}) => any;
|
|
1614
|
-
fieldSummary: (props: {
|
|
1615
|
-
items: any[];
|
|
1616
|
-
}) => any;
|
|
1617
|
-
default: () => any;
|
|
1618
|
-
}, {}>;
|
|
1619
|
-
TransferListField: vue.FunctionalComponent<TransferListFieldProps<z.TypeOf<T>, any>, {}, {
|
|
1620
|
-
itemRenderer: (props: {
|
|
1621
|
-
item: any;
|
|
1622
|
-
index: number;
|
|
1623
|
-
getFieldName: (fieldPath: string) => string;
|
|
1624
|
-
}) => any;
|
|
1625
|
-
availableItemRenderer: (props: {
|
|
1626
|
-
item: any;
|
|
1627
|
-
index: number;
|
|
1628
|
-
}) => any;
|
|
1629
|
-
selectedItemRenderer: (props: {
|
|
1630
|
-
item: any;
|
|
1631
|
-
index: number;
|
|
1632
|
-
getFieldName: (fieldPath: string) => string;
|
|
1633
|
-
}) => any;
|
|
1634
|
-
default: () => any;
|
|
1635
|
-
}, {}>;
|
|
1636
|
-
ToppingsField: vue.FunctionalComponent<ToppingsFieldProps<z.TypeOf<T>, any>, {}, {
|
|
1637
|
-
itemRenderer: (props: {
|
|
1638
|
-
item: any;
|
|
1639
|
-
index: number;
|
|
1640
|
-
getFieldName: (fieldPath: string) => string;
|
|
1641
|
-
}) => any;
|
|
1642
|
-
availableItemRenderer: (props: {
|
|
1643
|
-
item: any;
|
|
1644
|
-
index: number;
|
|
1645
|
-
}) => any;
|
|
1646
|
-
toppingRenderer: (props: {
|
|
1647
|
-
topping: any;
|
|
1648
|
-
isSelected: boolean;
|
|
1649
|
-
placement: string;
|
|
1650
|
-
isExtra: boolean;
|
|
1651
|
-
}) => any;
|
|
1652
|
-
default: () => any;
|
|
1653
|
-
}, {}>;
|
|
1654
|
-
createTypedSelectField: <P extends Path<z.TypeOf<T>>>(fieldPath: P) => <E extends FieldPathToEnum<z.TypeOf<T>, P> = FieldPathToEnum<z.TypeOf<T>, P>>(props: Omit<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, "name" | "valueToLabel"> & {
|
|
1655
|
-
valueToLabel: Record<E, string>;
|
|
1656
|
-
}, context?: any) => any;
|
|
1657
|
-
typedSelectFields: { [K in Path<z.TypeOf<T>>]?: (<E extends FieldPathToEnum<z.TypeOf<T>, K> = FieldPathToEnum<z.TypeOf<T>, K>>(props: Omit<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, "name" | "valueToLabel"> & {
|
|
1658
|
-
valueToLabel: Record<E, string>;
|
|
1659
|
-
}, context?: any) => any) | undefined; };
|
|
1660
|
-
fields: Record<Path<z.TypeOf<T>>, any>;
|
|
1661
|
-
field: <P extends Path<z.TypeOf<T>>>(path: P) => any;
|
|
1662
|
-
};
|
|
1663
|
-
load: () => Promise<void>;
|
|
1664
|
-
loadAllData: () => Promise<void>;
|
|
1665
|
-
refreshFormData: () => Promise<void>;
|
|
1666
|
-
clearSavedFormState: () => void;
|
|
1667
|
-
refreshData: (keys?: Array<keyof ExtraDataType>) => Promise<void>;
|
|
1668
|
-
};
|
|
1669
|
-
type UseFormType = ReturnType<typeof useForm>;
|
|
1670
|
-
type ZiniaForm = UseFormType['form'];
|
|
1671
|
-
type ZiniaFormFields = UseFormType['zinia'];
|
|
1672
|
-
type ZiniaFormGenericFields = UseFormType['ziniaGeneric'];
|
|
1673
|
-
type UseFormTyped<T extends z.ZodObject<any>, CalcType = any, ExtraDataType extends Record<string, any> = Record<string, any>> = ReturnType<typeof useForm<T, CalcType, ExtraDataType>>;
|
|
1674
|
-
|
|
1675
|
-
/**
|
|
1676
|
-
* Create base form components for a schema
|
|
1677
|
-
*
|
|
1678
|
-
* @param schema The Zod schema for the form
|
|
1679
|
-
* @param renderStyle The style to use for rendering
|
|
1680
|
-
* @returns Base form components (Form, SubmitButton, ResetButton)
|
|
1681
|
-
*/
|
|
1682
|
-
declare function createBaseComponents<T extends z.ZodObject<any>>(schema: T, styleName?: RegisteredStyleName): {
|
|
1683
|
-
Form: vue.FunctionalComponent<FormProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1684
|
-
SubmitButton: vue.FunctionalComponent<SubmitButtonProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1685
|
-
ResetButton: vue.FunctionalComponent<ResetButtonProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1686
|
-
FormErrorsSummary: vue.FunctionalComponent<FormErrorsSummaryProps, {}, any, {}>;
|
|
1687
|
-
};
|
|
1688
|
-
|
|
1689
|
-
/**
|
|
1690
|
-
* Create base display components using registered styles
|
|
1691
|
-
*
|
|
1692
|
-
* @param schema The Zod schema for the data
|
|
1693
|
-
* @param styleName The style to use for rendering
|
|
1694
|
-
* @returns Base display components
|
|
1695
|
-
*/
|
|
1696
|
-
declare function createBaseDisplayComponents<T extends z.ZodObject<any>>(schema: T, styleName?: RegisteredStyleName): {
|
|
1697
|
-
ZiniaDisplay: vue.FunctionalComponent<DisplayProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1698
|
-
};
|
|
1699
|
-
|
|
1700
|
-
interface ArrayFieldSlots<ItemType> {
|
|
1701
|
-
itemRenderer: (props: {
|
|
1702
|
-
item: ItemType;
|
|
1703
|
-
index: number;
|
|
1704
|
-
fields: FieldNames<ItemType>;
|
|
1705
|
-
}) => any;
|
|
1706
|
-
availableItemRenderer: (props: {
|
|
1707
|
-
item: ItemType;
|
|
1708
|
-
index: number;
|
|
1709
|
-
}) => any;
|
|
1710
|
-
itemActions: (props: {
|
|
1711
|
-
item: ItemType;
|
|
1712
|
-
index: number;
|
|
1713
|
-
fields: FieldNames<ItemType>;
|
|
1714
|
-
}) => any;
|
|
1715
|
-
fieldSummary: (props: {
|
|
1716
|
-
items: ItemType[];
|
|
1717
|
-
}) => any;
|
|
1718
|
-
default: () => any;
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
/**
|
|
1722
|
-
* Functions for creating type-safe array fields
|
|
1723
|
-
*/
|
|
1724
|
-
|
|
1786
|
+
declare function getSchemaId(schema: z.ZodTypeAny): string | undefined;
|
|
1725
1787
|
/**
|
|
1726
|
-
*
|
|
1727
|
-
* This preserves the ItemType so that Vue's template slots are properly typed
|
|
1788
|
+
* Helper function to create a schema with associated metadata
|
|
1728
1789
|
*
|
|
1729
|
-
* @param
|
|
1730
|
-
* @param
|
|
1731
|
-
* @param metadata
|
|
1732
|
-
* @returns
|
|
1733
|
-
*/
|
|
1734
|
-
declare function createTypedArrayField<T, P extends Path<T>>(baseArrayField: FunctionalComponent<ArrayFieldProps<T, any>, {}, any, {}>, fieldPath: P, metadata?: FieldMetadata): FunctionalComponent<Omit<ArrayFieldProps<T, ArrayItemType<T, P>>, "name">, {}, ArrayFieldSlots<ArrayItemType<T, P>>, {}>;
|
|
1735
|
-
|
|
1736
|
-
/**
|
|
1737
|
-
* Functions for creating type-safe combobox fields
|
|
1790
|
+
* @param schema Zod schema
|
|
1791
|
+
* @param schemaId Unique identifier for the schema
|
|
1792
|
+
* @param metadata Metadata for the schema fields
|
|
1793
|
+
* @returns The original schema with the schema ID attached
|
|
1738
1794
|
*/
|
|
1795
|
+
declare function withMetadata<T extends z.ZodObject<any>>(schema: T, schemaId: string, metadata: {
|
|
1796
|
+
[K in PathsOf<T>]?: SchemaFieldMetadata;
|
|
1797
|
+
}): T;
|
|
1739
1798
|
|
|
1740
1799
|
/**
|
|
1741
|
-
*
|
|
1742
|
-
*
|
|
1743
|
-
* @param baseComboboxField The base combobox field component
|
|
1744
|
-
* @param fieldPath The field path to create a combobox field for
|
|
1745
|
-
* @returns A factory function that creates a type-safe combobox field
|
|
1746
|
-
*
|
|
1747
|
-
* This preserves path-specific typing for features like dependsOn (cascading dropdowns)
|
|
1748
|
-
* and ensures type safety between selectOptions and optionFilterFn
|
|
1800
|
+
* DaisyUI style package
|
|
1801
|
+
* Provides all component creators for the DaisyUI style
|
|
1749
1802
|
*/
|
|
1750
|
-
declare function createTypedComboboxField<T, P extends Path<T>>(baseComboboxField: FunctionalComponent<ComboboxFieldProps<T>>, fieldPath: P): <TData = any>(props: Omit<ComboboxFieldProps<T, P, TData>, "name">, context?: any) => any;
|
|
1751
1803
|
|
|
1752
1804
|
/**
|
|
1753
|
-
*
|
|
1805
|
+
* Complete set of DaisyUI style creators
|
|
1806
|
+
* Can be registered with the Zinia plugin
|
|
1754
1807
|
*/
|
|
1808
|
+
declare const daisyUIStyle: StyleCreators;
|
|
1755
1809
|
|
|
1756
1810
|
/**
|
|
1757
|
-
*
|
|
1758
|
-
*
|
|
1759
|
-
* @param baseSelectField The base select field component
|
|
1760
|
-
* @param fieldPath The field path to create a select field for
|
|
1761
|
-
* @returns A factory function that creates a type-safe select field
|
|
1762
|
-
*/
|
|
1763
|
-
declare function createTypedSelectField<T, P extends Path<T>>(baseSelectField: FunctionalComponent<SelectFieldProps<T>>, fieldPath: P): <E extends FieldPathToEnum<T, P> = FieldPathToEnum<T, P>>(props: Omit<SelectFieldProps<T>, "name" | "valueToLabel"> & {
|
|
1764
|
-
valueToLabel: Record<E, string>;
|
|
1765
|
-
}, context?: any) => any;
|
|
1766
|
-
/**
|
|
1767
|
-
* Type-safe select field component with valueToLabel based on field path
|
|
1811
|
+
* Helper functions for creating and extending render styles
|
|
1768
1812
|
*/
|
|
1769
|
-
interface TypedSelectFieldComponent<T> {
|
|
1770
|
-
<P extends Path<T>>(props: Omit<SelectFieldProps<T>, 'valueToLabel'> & {
|
|
1771
|
-
name: P;
|
|
1772
|
-
valueToLabel?: Record<string, string>;
|
|
1773
|
-
}): ReturnType<FunctionalComponent>;
|
|
1774
|
-
}
|
|
1775
1813
|
|
|
1776
1814
|
/**
|
|
1777
|
-
*
|
|
1778
|
-
*/
|
|
1779
|
-
type DisplayFieldComponent<T, P extends Path<T>, _FieldType extends string = 'string'> = (props: {
|
|
1780
|
-
name?: P;
|
|
1781
|
-
label?: string;
|
|
1782
|
-
hideLabel?: boolean;
|
|
1783
|
-
description?: string;
|
|
1784
|
-
format?: 'default' | 'currency' | 'date' | 'datetime' | 'boolean' | 'email' | 'url' | 'phone' | 'number';
|
|
1785
|
-
emptyText?: string;
|
|
1786
|
-
class?: string | string[];
|
|
1787
|
-
size?: string;
|
|
1788
|
-
variant?: string;
|
|
1789
|
-
copyable?: boolean;
|
|
1790
|
-
valueToLabel?: Record<string, string>;
|
|
1791
|
-
separator?: string;
|
|
1792
|
-
itemRenderer?: (item: any, index: number) => string;
|
|
1793
|
-
maxItems?: number;
|
|
1794
|
-
}, context?: any) => any;
|
|
1795
|
-
/**
|
|
1796
|
-
* Type for the display components object with PascalCase keys derived from field paths
|
|
1797
|
-
* This mirrors the ComponentsType from the form system but with Display suffix
|
|
1798
|
-
*/
|
|
1799
|
-
type DisplayComponentsType<T> = {
|
|
1800
|
-
[K in Path<T> as `${PathToPascalCase<K & string>}` extends `${infer Base}Field` ? `${Base}Display` : `${PathToPascalCase<K & string>}Display`]: DisplayFieldComponent<T, K>;
|
|
1801
|
-
};
|
|
1802
|
-
/**
|
|
1803
|
-
* Generate display field components for a schema based on metadata
|
|
1815
|
+
* Extend an existing style with custom overrides
|
|
1804
1816
|
*
|
|
1805
|
-
* @param
|
|
1806
|
-
* @param
|
|
1807
|
-
* @
|
|
1808
|
-
* @returns Generated display field components
|
|
1817
|
+
* @param baseStyle The base style to extend
|
|
1818
|
+
* @param overrides Custom overrides for specific components
|
|
1819
|
+
* @returns A new style that combines the base style with the overrides
|
|
1809
1820
|
*/
|
|
1810
|
-
declare function
|
|
1811
|
-
generic: {
|
|
1812
|
-
DisplayField: vue.FunctionalComponent<DisplayFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
1813
|
-
fields: { [K in Path<z.TypeOf<T>>]: DisplayFieldComponent<z.TypeOf<T>, K, string>; };
|
|
1814
|
-
field: <P extends Path<z.TypeOf<T>>>(path: P) => any;
|
|
1815
|
-
};
|
|
1816
|
-
typed: DisplayComponentsType<z.TypeOf<T>>;
|
|
1817
|
-
};
|
|
1818
|
-
|
|
1821
|
+
declare function extendStyle(baseStyle: StyleCreators, overrides: Partial<StyleCreators>): StyleCreators;
|
|
1819
1822
|
/**
|
|
1820
|
-
*
|
|
1823
|
+
* Merge multiple styles together
|
|
1824
|
+
* Later styles will override earlier ones for any overlapping components
|
|
1821
1825
|
*
|
|
1822
|
-
* @param
|
|
1823
|
-
* @
|
|
1824
|
-
* @param renderStyle The style to use for rendering
|
|
1825
|
-
* @returns Generated field components
|
|
1826
|
+
* @param styles Array of styles to merge
|
|
1827
|
+
* @returns A new style that combines all the provided styles
|
|
1826
1828
|
*/
|
|
1827
|
-
declare function
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
};
|
|
1864
|
-
}) => any;
|
|
1865
|
-
fieldSummary: (props: {
|
|
1866
|
-
items: any[];
|
|
1867
|
-
}) => any;
|
|
1868
|
-
default: () => any;
|
|
1869
|
-
}, {}>;
|
|
1870
|
-
TransferListField: vue.FunctionalComponent<TransferListFieldProps<z.TypeOf<T>, any>, {}, {
|
|
1871
|
-
itemRenderer: (props: {
|
|
1872
|
-
item: any;
|
|
1873
|
-
index: number;
|
|
1874
|
-
getFieldName: (fieldPath: string) => string;
|
|
1875
|
-
}) => any;
|
|
1876
|
-
availableItemRenderer: (props: {
|
|
1877
|
-
item: any;
|
|
1878
|
-
index: number;
|
|
1879
|
-
}) => any;
|
|
1880
|
-
selectedItemRenderer: (props: {
|
|
1881
|
-
item: any;
|
|
1882
|
-
index: number;
|
|
1883
|
-
getFieldName: (fieldPath: string) => string;
|
|
1884
|
-
}) => any;
|
|
1885
|
-
default: () => any;
|
|
1886
|
-
}, {}>;
|
|
1887
|
-
ToppingsField: vue.FunctionalComponent<ToppingsFieldProps<z.TypeOf<T>, any>, {}, {
|
|
1888
|
-
itemRenderer: (props: {
|
|
1889
|
-
item: any;
|
|
1890
|
-
index: number;
|
|
1891
|
-
getFieldName: (fieldPath: string) => string;
|
|
1892
|
-
}) => any;
|
|
1893
|
-
availableItemRenderer: (props: {
|
|
1894
|
-
item: any;
|
|
1895
|
-
index: number;
|
|
1896
|
-
}) => any;
|
|
1897
|
-
toppingRenderer: (props: {
|
|
1898
|
-
topping: any;
|
|
1899
|
-
isSelected: boolean;
|
|
1900
|
-
placement: string;
|
|
1901
|
-
isExtra: boolean;
|
|
1902
|
-
}) => any;
|
|
1903
|
-
default: () => any;
|
|
1904
|
-
}, {}>;
|
|
1905
|
-
createTypedSelectField: <P extends Path<z.TypeOf<T>>>(fieldPath: P) => <E extends FieldPathToEnum<z.TypeOf<T>, P> = FieldPathToEnum<z.TypeOf<T>, P>>(props: Omit<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, "name" | "valueToLabel"> & {
|
|
1906
|
-
valueToLabel: Record<E, string>;
|
|
1907
|
-
}, context?: any) => any;
|
|
1908
|
-
typedSelectFields: { [K in Path<z.TypeOf<T>>]?: (<E extends FieldPathToEnum<z.TypeOf<T>, K> = FieldPathToEnum<z.TypeOf<T>, K>>(props: Omit<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, "name" | "valueToLabel"> & {
|
|
1909
|
-
valueToLabel: Record<E, string>;
|
|
1910
|
-
}, context?: any) => any) | undefined; };
|
|
1911
|
-
fields: Record<Path<z.TypeOf<T>>, any>;
|
|
1912
|
-
field: <P extends Path<z.TypeOf<T>>>(path: P) => any;
|
|
1913
|
-
};
|
|
1914
|
-
typed: ComponentsType<z.TypeOf<T>>;
|
|
1829
|
+
declare function mergeStyles(...styles: Array<Partial<StyleCreators>>): StyleCreators;
|
|
1830
|
+
/**
|
|
1831
|
+
* Create a partial style with only the components you need
|
|
1832
|
+
* Useful when you want to override just a few components in a base style
|
|
1833
|
+
*
|
|
1834
|
+
* @param creators Object containing only the component creators you want to override
|
|
1835
|
+
* @returns A partial style object that can be used with extendStyle
|
|
1836
|
+
*/
|
|
1837
|
+
declare function createPartialStyle<T extends Partial<StyleCreators>>(creators: T): T;
|
|
1838
|
+
/**
|
|
1839
|
+
* Create a style template with placeholder implementations
|
|
1840
|
+
* Useful as a starting point for creating a completely new style
|
|
1841
|
+
*
|
|
1842
|
+
* @returns A style object with placeholder implementations that throw errors
|
|
1843
|
+
*/
|
|
1844
|
+
declare function createStyleTemplate(): StyleCreators;
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* Types for render styles in the form system
|
|
1848
|
+
*/
|
|
1849
|
+
/**
|
|
1850
|
+
* Available rendering styles for form components
|
|
1851
|
+
*/
|
|
1852
|
+
type RenderStyle = 'daisy_ui';
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* Valid operators for each data type
|
|
1856
|
+
*/
|
|
1857
|
+
declare const OPERATORS_BY_TYPE: {
|
|
1858
|
+
string: readonly ["eq", "ne", "contains", "sw", "ew", "in", "notIn"];
|
|
1859
|
+
number: readonly ["eq", "ne", "gt", "gte", "lt", "lte", "between"];
|
|
1860
|
+
date: readonly ["eq", "ne", "gt", "gte", "lt", "lte", "between", "isEmpty", "isNotEmpty"];
|
|
1861
|
+
boolean: readonly ["eq", "ne"];
|
|
1862
|
+
enum: readonly ["eq", "ne", "in", "notIn"];
|
|
1863
|
+
money: readonly ["eq", "ne", "gt", "gte", "lt", "lte", "between"];
|
|
1864
|
+
percentage: readonly ["eq", "ne", "gt", "gte", "lt", "lte", "between"];
|
|
1915
1865
|
};
|
|
1866
|
+
/**
|
|
1867
|
+
* Infer DataType from OPERATORS_BY_TYPE keys
|
|
1868
|
+
*/
|
|
1869
|
+
type DataType = keyof typeof OPERATORS_BY_TYPE;
|
|
1870
|
+
/**
|
|
1871
|
+
* Infer operator types from OPERATORS_BY_TYPE
|
|
1872
|
+
*/
|
|
1873
|
+
type ExtractOperatorType<T> = T extends readonly (infer U)[] ? U : never;
|
|
1874
|
+
type StringOperator = ExtractOperatorType<typeof OPERATORS_BY_TYPE.string>;
|
|
1875
|
+
type NumberOperator = ExtractOperatorType<typeof OPERATORS_BY_TYPE.number>;
|
|
1876
|
+
type DateOperator = ExtractOperatorType<typeof OPERATORS_BY_TYPE.date>;
|
|
1877
|
+
type BooleanOperator = ExtractOperatorType<typeof OPERATORS_BY_TYPE.boolean>;
|
|
1878
|
+
type EnumOperator = ExtractOperatorType<typeof OPERATORS_BY_TYPE.enum>;
|
|
1879
|
+
/**
|
|
1880
|
+
* Union type of all operators
|
|
1881
|
+
*/
|
|
1882
|
+
type Operator = StringOperator | NumberOperator | DateOperator | BooleanOperator | EnumOperator;
|
|
1883
|
+
/**
|
|
1884
|
+
* Check if an operator is valid for a given data type
|
|
1885
|
+
*/
|
|
1886
|
+
declare function isValidOperatorForType(operator: string, type: DataType): boolean;
|
|
1916
1887
|
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1888
|
+
/**
|
|
1889
|
+
* Filtering Types - Matching Client-Side Data Table Filtering Specification v1.0.0
|
|
1890
|
+
*/
|
|
1891
|
+
/**
|
|
1892
|
+
* Data types supported by the filtering system - inferred from OPERATORS_BY_TYPE keys
|
|
1893
|
+
*/
|
|
1923
1894
|
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1895
|
+
/**
|
|
1896
|
+
* Field metadata entry in the registry
|
|
1897
|
+
*/
|
|
1898
|
+
interface FieldMetadata {
|
|
1899
|
+
type: DataType;
|
|
1900
|
+
filterable?: boolean;
|
|
1901
|
+
searchable?: boolean;
|
|
1902
|
+
sortable?: boolean;
|
|
1928
1903
|
}
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1904
|
+
/**
|
|
1905
|
+
* Field registry - single source of truth for field metadata
|
|
1906
|
+
* Maps field names to their metadata
|
|
1907
|
+
*/
|
|
1908
|
+
interface FieldRegistry {
|
|
1909
|
+
[fieldName: string]: FieldMetadata;
|
|
1935
1910
|
}
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
storeName?: string;
|
|
1946
|
-
renderStyle?: RegisteredStyleName;
|
|
1947
|
-
autoProvide?: boolean;
|
|
1948
|
-
loading?: boolean | Ref<boolean>;
|
|
1949
|
-
error?: string | null | Ref<string | null>;
|
|
1950
|
-
fetchData?: () => Promise<TData>;
|
|
1951
|
-
dataLoaders?: {
|
|
1952
|
-
[K in keyof TExtra]?: () => Promise<TExtra[K]>;
|
|
1953
|
-
};
|
|
1954
|
-
autoLoad?: boolean;
|
|
1955
|
-
onLoad?: (data: TData) => void;
|
|
1956
|
-
onError?: (error: Error) => void;
|
|
1957
|
-
debug?: boolean;
|
|
1911
|
+
/**
|
|
1912
|
+
* Filter value object - represents a filtering condition for a specific field
|
|
1913
|
+
* Field name is the key in FilterConfiguration, type comes from registry
|
|
1914
|
+
*/
|
|
1915
|
+
interface FilterValueObject {
|
|
1916
|
+
operator: string;
|
|
1917
|
+
value?: any;
|
|
1918
|
+
values?: any[];
|
|
1919
|
+
caseSensitive?: boolean;
|
|
1958
1920
|
}
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
1921
|
+
/**
|
|
1922
|
+
* Filter configuration - flat object mapping field names to filter conditions
|
|
1923
|
+
* All filters are combined with implicit AND logic
|
|
1924
|
+
*/
|
|
1925
|
+
interface FilterConfiguration {
|
|
1926
|
+
[fieldName: string]: FilterValueObject;
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* Validation result
|
|
1930
|
+
*/
|
|
1931
|
+
interface ValidationResult {
|
|
1932
|
+
valid: boolean;
|
|
1933
|
+
errors: ValidationError[];
|
|
1934
|
+
}
|
|
1935
|
+
/**
|
|
1936
|
+
* Validation error
|
|
1937
|
+
*/
|
|
1938
|
+
interface ValidationError {
|
|
1939
|
+
field?: string;
|
|
1940
|
+
message: string;
|
|
1941
|
+
code: string;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* Filter Validation - Registry-based validation per spec
|
|
1946
|
+
*/
|
|
1947
|
+
|
|
1948
|
+
/**
|
|
1949
|
+
* Validate field registry structure
|
|
1950
|
+
*/
|
|
1951
|
+
declare function validateFieldRegistry(registry: FieldRegistry): ValidationResult;
|
|
1952
|
+
/**
|
|
1953
|
+
* Validate filter configuration against field registry
|
|
1954
|
+
*/
|
|
1955
|
+
declare function validateFilterConfiguration(config: FilterConfiguration, registry: FieldRegistry): ValidationResult;
|
|
1956
|
+
|
|
1957
|
+
/**
|
|
1958
|
+
* Field Registry Building - Convert Zod schemas and metadata to filter registry format
|
|
1959
|
+
*/
|
|
1960
|
+
|
|
1961
|
+
/**
|
|
1962
|
+
* Build field registry from Zod schema and form metadata
|
|
1963
|
+
*
|
|
1964
|
+
* @param schema Zod schema object
|
|
1965
|
+
* @param fieldsMetadata Form field metadata (from useFormMetadata)
|
|
1966
|
+
* @returns FieldRegistry for filtering
|
|
1967
|
+
*/
|
|
1968
|
+
declare function buildFieldRegistryFromSchema(schema: z.ZodObject<any>, fieldsMetadata: Record<string, FieldMetadata$1>): FieldRegistry;
|
|
1969
|
+
|
|
1970
|
+
/**
|
|
1971
|
+
* Filter Serialization - Query string and JSON serialization/deserialization
|
|
1972
|
+
* Uses compact DrizzleORM-style format: flt[field]=value or flt[field][op]=value
|
|
1973
|
+
*/
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Serialize filter configuration to URL-safe query string
|
|
1977
|
+
* Returns a plain query string (NOT URL-encoded) that can be used directly in URLSearchParams or Vue Router
|
|
1978
|
+
* Format: filters[name][operator]=contains&filters[name][value]=john
|
|
1979
|
+
*
|
|
1980
|
+
* Note: This returns the raw query string. If you need it URL-encoded, use encodeURIComponent().
|
|
1981
|
+
*/
|
|
1982
|
+
declare function serializeFiltersToQueryString(config: FilterConfiguration): string;
|
|
1983
|
+
/**
|
|
1984
|
+
* Deserialize filter configuration from query string
|
|
1985
|
+
* Supports both URLSearchParams format and legacy base64 format for backward compatibility
|
|
1986
|
+
* Validates against registry before returning
|
|
1987
|
+
*/
|
|
1988
|
+
declare function deserializeFiltersFromQueryString(queryString: string, registry: FieldRegistry): FilterConfiguration;
|
|
2007
1989
|
|
|
2008
1990
|
declare const ZINIA_DATA_TABLE_KEY = "ziniaDataTable";
|
|
2009
1991
|
declare const ZINIA_DATA_TABLE_COLUMNS_KEY = "ziniaDataTableColumns";
|
|
@@ -2012,6 +1994,7 @@ declare const ZINIA_DATA_TABLE_ACTIONS_KEY = "ziniaDataTableActions";
|
|
|
2012
1994
|
declare const ZINIA_DATA_TABLE_SEARCH_INPUT_KEY = "ziniaDataTableSearchInput";
|
|
2013
1995
|
declare const ZINIA_DATA_TABLE_FILTER_INPUTS_KEY = "ziniaDataTableFilterInputs";
|
|
2014
1996
|
declare const ZINIA_DATA_TABLE_FILTER_OPERATORS_KEY = "ziniaDataTableFilterOperators";
|
|
1997
|
+
declare const ZINIA_DATA_TABLE_FILTER_CASE_SENSITIVE_KEY = "ziniaDataTableFilterCaseSensitive";
|
|
2015
1998
|
declare const ZINIA_DATA_TABLE_FILTER_OPTIONS_STATE_KEY = "ziniaDataTableFilterOptionsState";
|
|
2016
1999
|
declare const ZINIA_DATA_TABLE_FILTER_OPTIONS_LOADING_KEY = "ziniaDataTableFilterOptionsLoading";
|
|
2017
2000
|
declare const ZINIA_DATA_TABLE_NAME_KEY = "ziniaDataTableName";
|
|
@@ -2075,7 +2058,7 @@ interface ColumnDefinition<TData, TField extends keyof TData> {
|
|
|
2075
2058
|
textWrap?: 'truncate' | 'wrap';
|
|
2076
2059
|
format?: (value: TData[TField], row: TData) => string;
|
|
2077
2060
|
render?: (value: TData[TField], row: TData) => any;
|
|
2078
|
-
filterType?: 'text' | 'select' | 'number' | 'boolean' | 'combobox';
|
|
2061
|
+
filterType?: 'text' | 'select' | 'number' | 'boolean' | 'combobox' | 'date';
|
|
2079
2062
|
filterOptions?: FilterOptionItem[];
|
|
2080
2063
|
filterOptionsLoader?: () => Promise<FilterOptionItem[]>;
|
|
2081
2064
|
filterAllowCreate?: boolean;
|
|
@@ -2093,7 +2076,7 @@ interface FetchDataParams<TData> {
|
|
|
2093
2076
|
field: keyof TData;
|
|
2094
2077
|
direction: 'asc' | 'desc';
|
|
2095
2078
|
} | null;
|
|
2096
|
-
filters:
|
|
2079
|
+
filters: FilterConfiguration;
|
|
2097
2080
|
search: {
|
|
2098
2081
|
query: string;
|
|
2099
2082
|
searchableFields: Array<keyof TData>;
|
|
@@ -2133,6 +2116,7 @@ interface DataTableOptions<TData> {
|
|
|
2133
2116
|
schemaId?: string;
|
|
2134
2117
|
name?: string;
|
|
2135
2118
|
autoProvide?: boolean;
|
|
2119
|
+
autoLoad?: boolean;
|
|
2136
2120
|
debug?: boolean;
|
|
2137
2121
|
onLoad?: (data: TData[]) => void;
|
|
2138
2122
|
onError?: (error: Error) => void;
|
|
@@ -2167,9 +2151,12 @@ declare function useDataTable<TSchema extends z.ZodObject<any>>(schema: TSchema,
|
|
|
2167
2151
|
readonly direction: "asc" | "desc";
|
|
2168
2152
|
};
|
|
2169
2153
|
filters: {
|
|
2170
|
-
readonly active:
|
|
2154
|
+
readonly active: FilterConfiguration;
|
|
2171
2155
|
readonly count: number;
|
|
2156
|
+
readonly queryParams: Record<string, string>;
|
|
2157
|
+
readonly queryString: string;
|
|
2172
2158
|
};
|
|
2159
|
+
readonly fieldRegistry: FieldRegistry;
|
|
2173
2160
|
search: {
|
|
2174
2161
|
readonly query: string;
|
|
2175
2162
|
readonly searchableFields: Array<keyof z.TypeOf<TSchema>>;
|
|
@@ -2184,9 +2171,11 @@ declare function useDataTable<TSchema extends z.ZodObject<any>>(schema: TSchema,
|
|
|
2184
2171
|
refresh: () => Promise<void>;
|
|
2185
2172
|
sort: (field: keyof z.TypeOf<TSchema>, direction?: "asc" | "desc") => Promise<void>;
|
|
2186
2173
|
clearSort: () => Promise<void>;
|
|
2187
|
-
setFilter: (field: keyof z.TypeOf<TSchema>,
|
|
2174
|
+
setFilter: (field: keyof z.TypeOf<TSchema>, filter: FilterValueObject) => Promise<void>;
|
|
2188
2175
|
clearFilter: (field: keyof z.TypeOf<TSchema>) => Promise<void>;
|
|
2189
2176
|
clearAllFilters: () => Promise<void>;
|
|
2177
|
+
setFiltersFromQueryParams: (params: Record<string, string | string[]>) => Promise<void>;
|
|
2178
|
+
setFiltersFromQueryString: (queryString: string) => Promise<void>;
|
|
2190
2179
|
setSearch: (query: string) => Promise<void>;
|
|
2191
2180
|
clearSearch: () => Promise<void>;
|
|
2192
2181
|
goToPage: (page: number) => Promise<void>;
|
|
@@ -2206,7 +2195,7 @@ declare function useDataTable<TSchema extends z.ZodObject<any>>(schema: TSchema,
|
|
|
2206
2195
|
openFilterDrawer: () => boolean;
|
|
2207
2196
|
closeFilterDrawer: () => boolean;
|
|
2208
2197
|
};
|
|
2209
|
-
fieldsMetadata: Record<string, FieldMetadata>;
|
|
2198
|
+
fieldsMetadata: Record<string, FieldMetadata$1>;
|
|
2210
2199
|
columns: (z.TypeOf<TSchema> extends infer T ? { [K in keyof T]?: ColumnDefinition<z.TypeOf<TSchema>, K> | undefined; } : never) & {
|
|
2211
2200
|
[key: string]: ColumnDefinition<z.TypeOf<TSchema>, any>;
|
|
2212
2201
|
};
|
|
@@ -2231,9 +2220,10 @@ declare function useDataTable<TSchema extends z.ZodObject<any>>(schema: TSchema,
|
|
|
2231
2220
|
refresh: () => Promise<void>;
|
|
2232
2221
|
sort: (field: keyof z.TypeOf<TSchema>, direction?: "asc" | "desc") => Promise<void>;
|
|
2233
2222
|
clearSort: () => Promise<void>;
|
|
2234
|
-
setFilter: (field: keyof z.TypeOf<TSchema>,
|
|
2223
|
+
setFilter: (field: keyof z.TypeOf<TSchema>, filter: FilterValueObject) => Promise<void>;
|
|
2235
2224
|
clearFilter: (field: keyof z.TypeOf<TSchema>) => Promise<void>;
|
|
2236
2225
|
clearAllFilters: () => Promise<void>;
|
|
2226
|
+
setFiltersFromQueryString: (queryString: string) => Promise<void>;
|
|
2237
2227
|
setSearch: (query: string) => Promise<void>;
|
|
2238
2228
|
clearSearch: () => Promise<void>;
|
|
2239
2229
|
goToPage: (page: number) => Promise<void>;
|
|
@@ -2258,7 +2248,7 @@ interface CursorFetchParams<TData> {
|
|
|
2258
2248
|
field: keyof TData;
|
|
2259
2249
|
direction: 'asc' | 'desc';
|
|
2260
2250
|
} | null;
|
|
2261
|
-
filters:
|
|
2251
|
+
filters: FilterConfiguration;
|
|
2262
2252
|
search: {
|
|
2263
2253
|
query: string;
|
|
2264
2254
|
searchableFields: Array<keyof TData>;
|
|
@@ -2302,6 +2292,7 @@ interface CursorDataTableOptions<TData> {
|
|
|
2302
2292
|
schemaId?: string;
|
|
2303
2293
|
name?: string;
|
|
2304
2294
|
autoProvide?: boolean;
|
|
2295
|
+
autoLoad?: boolean;
|
|
2305
2296
|
debug?: boolean;
|
|
2306
2297
|
onLoad?: (data: TData[]) => void;
|
|
2307
2298
|
onError?: (error: Error) => void;
|
|
@@ -2336,9 +2327,12 @@ declare function useCursorDataTable<TSchema extends z.ZodObject<any>>(schema: TS
|
|
|
2336
2327
|
readonly direction: "asc" | "desc";
|
|
2337
2328
|
};
|
|
2338
2329
|
filters: {
|
|
2339
|
-
readonly active:
|
|
2330
|
+
readonly active: FilterConfiguration;
|
|
2340
2331
|
readonly count: number;
|
|
2332
|
+
readonly queryParams: Record<string, string>;
|
|
2333
|
+
readonly queryString: string;
|
|
2341
2334
|
};
|
|
2335
|
+
readonly fieldRegistry: FieldRegistry;
|
|
2342
2336
|
search: {
|
|
2343
2337
|
readonly query: string;
|
|
2344
2338
|
readonly searchableFields: Array<keyof z.TypeOf<TSchema>>;
|
|
@@ -2353,9 +2347,11 @@ declare function useCursorDataTable<TSchema extends z.ZodObject<any>>(schema: TS
|
|
|
2353
2347
|
refresh: () => Promise<void>;
|
|
2354
2348
|
sort: (field: keyof z.TypeOf<TSchema>, direction?: "asc" | "desc") => Promise<void>;
|
|
2355
2349
|
clearSort: () => Promise<void>;
|
|
2356
|
-
setFilter: (field: keyof z.TypeOf<TSchema>,
|
|
2350
|
+
setFilter: (field: keyof z.TypeOf<TSchema>, filter: FilterValueObject) => Promise<void>;
|
|
2357
2351
|
clearFilter: (field: keyof z.TypeOf<TSchema>) => Promise<void>;
|
|
2358
2352
|
clearAllFilters: () => Promise<void>;
|
|
2353
|
+
setFiltersFromQueryParams: (params: Record<string, string | string[]>) => Promise<void>;
|
|
2354
|
+
setFiltersFromQueryString: (queryString: string) => Promise<void>;
|
|
2359
2355
|
setSearch: (query: string) => Promise<void>;
|
|
2360
2356
|
clearSearch: () => Promise<void>;
|
|
2361
2357
|
nextPage: () => Promise<void>;
|
|
@@ -2375,7 +2371,7 @@ declare function useCursorDataTable<TSchema extends z.ZodObject<any>>(schema: TS
|
|
|
2375
2371
|
openFilterDrawer: () => boolean;
|
|
2376
2372
|
closeFilterDrawer: () => boolean;
|
|
2377
2373
|
};
|
|
2378
|
-
fieldsMetadata: Record<string, FieldMetadata>;
|
|
2374
|
+
fieldsMetadata: Record<string, FieldMetadata$1>;
|
|
2379
2375
|
columns: (z.TypeOf<TSchema> extends infer T ? { [K in keyof T]?: ColumnDefinition<z.TypeOf<TSchema>, K> | undefined; } : never) & {
|
|
2380
2376
|
[key: string]: ColumnDefinition<z.TypeOf<TSchema>, any>;
|
|
2381
2377
|
};
|
|
@@ -2400,9 +2396,10 @@ declare function useCursorDataTable<TSchema extends z.ZodObject<any>>(schema: TS
|
|
|
2400
2396
|
refresh: () => Promise<void>;
|
|
2401
2397
|
sort: (field: keyof z.TypeOf<TSchema>, direction?: "asc" | "desc") => Promise<void>;
|
|
2402
2398
|
clearSort: () => Promise<void>;
|
|
2403
|
-
setFilter: (field: keyof z.TypeOf<TSchema>,
|
|
2399
|
+
setFilter: (field: keyof z.TypeOf<TSchema>, filter: FilterValueObject) => Promise<void>;
|
|
2404
2400
|
clearFilter: (field: keyof z.TypeOf<TSchema>) => Promise<void>;
|
|
2405
2401
|
clearAllFilters: () => Promise<void>;
|
|
2402
|
+
setFiltersFromQueryString: (queryString: string) => Promise<void>;
|
|
2406
2403
|
setSearch: (query: string) => Promise<void>;
|
|
2407
2404
|
clearSearch: () => Promise<void>;
|
|
2408
2405
|
nextPage: () => Promise<void>;
|
|
@@ -2416,6 +2413,27 @@ declare function useCursorDataTable<TSchema extends z.ZodObject<any>>(schema: TS
|
|
|
2416
2413
|
};
|
|
2417
2414
|
type UseCursorDataTableType<TSchema extends z.ZodObject<any>> = ReturnType<typeof useCursorDataTable<TSchema>>;
|
|
2418
2415
|
|
|
2416
|
+
interface NoDataDisplayProps {
|
|
2417
|
+
message?: string;
|
|
2418
|
+
class?: string;
|
|
2419
|
+
variant?: 'info' | 'warning';
|
|
2420
|
+
}
|
|
2421
|
+
declare const NoDataDisplay: FunctionalComponent<NoDataDisplayProps>;
|
|
2422
|
+
|
|
2423
|
+
interface ErrorDisplayProps {
|
|
2424
|
+
error: string | Error | unknown;
|
|
2425
|
+
class?: string;
|
|
2426
|
+
variant?: 'error' | 'warning' | 'info';
|
|
2427
|
+
}
|
|
2428
|
+
declare const ErrorDisplay: FunctionalComponent<ErrorDisplayProps>;
|
|
2429
|
+
|
|
2430
|
+
interface LoadingDisplayProps {
|
|
2431
|
+
message?: string;
|
|
2432
|
+
size?: 'sm' | 'md' | 'lg';
|
|
2433
|
+
class?: string;
|
|
2434
|
+
}
|
|
2435
|
+
declare const LoadingDisplay: FunctionalComponent<LoadingDisplayProps>;
|
|
2436
|
+
|
|
2419
2437
|
declare const ZINIA_DELETE_MODAL_KEY = "ziniaDeleteModal";
|
|
2420
2438
|
declare const ZINIA_DELETE_MODAL_FIELDS_KEY = "ziniaDeleteModalFields";
|
|
2421
2439
|
declare const ZINIA_DELETE_MODAL_FIELDS_GENERIC_KEY = "ziniaDeleteModalFieldsGeneric";
|
|
@@ -2437,7 +2455,7 @@ declare function useDeleteModal<TSchema extends z.ZodObject<any>>(schema: TSchem
|
|
|
2437
2455
|
readonly data: z.TypeOf<TSchema>;
|
|
2438
2456
|
readonly isLoading: boolean;
|
|
2439
2457
|
readonly error: string | null;
|
|
2440
|
-
fieldsMetadata: Record<string, FieldMetadata>;
|
|
2458
|
+
fieldsMetadata: Record<string, FieldMetadata$1>;
|
|
2441
2459
|
confirmDelete: () => Promise<void>;
|
|
2442
2460
|
clearError: () => void;
|
|
2443
2461
|
getValue: (path: string) => any;
|
|
@@ -2460,228 +2478,532 @@ type ZiniaDeleteModal<TSchema extends z.ZodObject<any>> = UseDeleteModalType<TSc
|
|
|
2460
2478
|
type ZiniaDeleteModalFields<TSchema extends z.ZodObject<any>> = UseDeleteModalType<TSchema>['zinia'];
|
|
2461
2479
|
type ZiniaDeleteModalGenericFields<TSchema extends z.ZodObject<any>> = UseDeleteModalType<TSchema>['ziniaGeneric'];
|
|
2462
2480
|
|
|
2481
|
+
declare const ZINIA_DISPLAY_KEY = "ziniaDisplay";
|
|
2482
|
+
declare const ZINIA_DISPLAY_FIELDS_KEY = "ziniaDisplayFields";
|
|
2483
|
+
declare const ZINIA_DISPLAY_FIELDS_GENERIC_KEY = "ziniaDisplayFieldsGeneric";
|
|
2484
|
+
declare const ZINIA_DISPLAY_SCHEMA_KEY = "ziniaDisplaySchema";
|
|
2485
|
+
interface DisplayOptions<TData, TExtra extends Record<string, any>> {
|
|
2486
|
+
data?: TData | Ref<TData>;
|
|
2487
|
+
schemaId?: string;
|
|
2488
|
+
storeName?: string;
|
|
2489
|
+
renderStyle?: RegisteredStyleName;
|
|
2490
|
+
autoProvide?: boolean;
|
|
2491
|
+
loading?: boolean | Ref<boolean>;
|
|
2492
|
+
error?: string | null | Ref<string | null>;
|
|
2493
|
+
fetchData?: () => Promise<TData>;
|
|
2494
|
+
dataLoaders?: {
|
|
2495
|
+
[K in keyof TExtra]?: () => Promise<TExtra[K]>;
|
|
2496
|
+
};
|
|
2497
|
+
autoLoad?: boolean;
|
|
2498
|
+
onLoad?: (data: TData) => void;
|
|
2499
|
+
onError?: (error: Error) => void;
|
|
2500
|
+
debug?: boolean;
|
|
2501
|
+
}
|
|
2502
|
+
declare function useDisplay<TSchema extends z.ZodObject<any>, TExtra extends Record<string, any> = Record<string, any>>(schema: TSchema, options?: DisplayOptions<z.infer<TSchema>, TExtra>): {
|
|
2503
|
+
display: {
|
|
2504
|
+
storeName: string;
|
|
2505
|
+
readonly data: z.TypeOf<TSchema> | null;
|
|
2506
|
+
readonly extraData: TExtra;
|
|
2507
|
+
readonly isLoading: boolean;
|
|
2508
|
+
readonly isReady: boolean;
|
|
2509
|
+
readonly error: string | null;
|
|
2510
|
+
readonly lastLoadTime: number | null;
|
|
2511
|
+
fieldsMetadata: Record<string, FieldMetadata$1>;
|
|
2512
|
+
readonly isAsyncMode: boolean;
|
|
2513
|
+
load: (options_?: {
|
|
2514
|
+
data?: boolean;
|
|
2515
|
+
extra?: boolean;
|
|
2516
|
+
specificLoaders?: Array<keyof TExtra>;
|
|
2517
|
+
}) => Promise<void>;
|
|
2518
|
+
loadData: () => Promise<void>;
|
|
2519
|
+
loadExtraData: (keys?: Array<keyof TExtra>) => Promise<void>;
|
|
2520
|
+
loadAllData: () => Promise<void>;
|
|
2521
|
+
refreshData: () => Promise<void>;
|
|
2522
|
+
clear: () => void;
|
|
2523
|
+
getValue: (path: string) => any;
|
|
2524
|
+
};
|
|
2525
|
+
ZiniaDisplay: vue.FunctionalComponent<DisplayProps<z.TypeOf<TSchema>>, {}, any, {}>;
|
|
2526
|
+
LoadingDisplay: vue.FunctionalComponent<LoadingDisplayProps, {}, any, {}>;
|
|
2527
|
+
ErrorDisplay: vue.FunctionalComponent<ErrorDisplayProps, {}, any, {}>;
|
|
2528
|
+
NoDataDisplay: vue.FunctionalComponent<NoDataDisplayProps, {}, any, {}>;
|
|
2529
|
+
zinia: DisplayComponentsType<z.TypeOf<TSchema>>;
|
|
2530
|
+
ziniaGeneric: {
|
|
2531
|
+
DisplayField: vue.FunctionalComponent<DisplayFieldProps<z.TypeOf<TSchema>>, {}, any, {}>;
|
|
2532
|
+
fields: { [K in Path<z.TypeOf<TSchema>>]: DisplayFieldComponent<z.TypeOf<TSchema>, K, string>; };
|
|
2533
|
+
field: <P extends Path<z.TypeOf<TSchema>>>(path: P) => any;
|
|
2534
|
+
};
|
|
2535
|
+
load: (options_?: {
|
|
2536
|
+
data?: boolean;
|
|
2537
|
+
extra?: boolean;
|
|
2538
|
+
specificLoaders?: Array<keyof TExtra>;
|
|
2539
|
+
}) => Promise<void>;
|
|
2540
|
+
loadData: () => Promise<void>;
|
|
2541
|
+
loadExtraData: (keys?: Array<keyof TExtra>) => Promise<void>;
|
|
2542
|
+
loadAllData: () => Promise<void>;
|
|
2543
|
+
refreshData: () => Promise<void>;
|
|
2544
|
+
clear: () => void;
|
|
2545
|
+
};
|
|
2546
|
+
type UseDisplayType<TSchema extends z.ZodObject<any>, TExtra extends Record<string, any> = Record<string, any>> = ReturnType<typeof useDisplay<TSchema, TExtra>>;
|
|
2547
|
+
type ZiniaDisplay<TSchema extends z.ZodObject<any> = z.ZodObject<any>, TExtra extends Record<string, any> = Record<string, any>> = UseDisplayType<TSchema, TExtra>['display'];
|
|
2548
|
+
type ZiniaDisplayFields<TSchema extends z.ZodObject<any>, TExtra extends Record<string, any> = Record<string, any>> = UseDisplayType<TSchema, TExtra>['zinia'];
|
|
2549
|
+
type ZiniaDisplayGenericFields<TSchema extends z.ZodObject<any>, TExtra extends Record<string, any> = Record<string, any>> = UseDisplayType<TSchema, TExtra>['ziniaGeneric'];
|
|
2550
|
+
|
|
2463
2551
|
/**
|
|
2464
|
-
*
|
|
2552
|
+
* Type definitions for async cascading selection and auto-population
|
|
2465
2553
|
*/
|
|
2466
2554
|
|
|
2467
2555
|
/**
|
|
2468
|
-
*
|
|
2469
|
-
*
|
|
2470
|
-
* @param schemaId Unique identifier for the schema
|
|
2471
|
-
* @param path Path to the field
|
|
2472
|
-
* @returns Metadata for the field or undefined if not found
|
|
2556
|
+
* Helper type to get the value type of a field path
|
|
2473
2557
|
*/
|
|
2474
|
-
|
|
2558
|
+
type FieldValue<FormType, P extends Path<FormType>> = P extends keyof FormType ? FormType[P] : P extends `${infer K}.${infer Rest}` ? K extends keyof FormType ? FormType[K] extends Record<string, any> ? FieldValue<FormType[K], Rest & Path<FormType[K]>> : never : never : never;
|
|
2475
2559
|
/**
|
|
2476
|
-
*
|
|
2477
|
-
*
|
|
2478
|
-
* @param schemaId Unique identifier for the schema
|
|
2479
|
-
* @returns All metadata for the schema or an empty object if not found
|
|
2560
|
+
* Configuration for async cascading selection (parent → child options fetching via API)
|
|
2480
2561
|
*/
|
|
2481
|
-
|
|
2562
|
+
interface AsyncCascadingSelectConfig<FormType, ParentField extends Path<FormType> = Path<FormType>, ChildField extends Path<FormType> = Path<FormType>> {
|
|
2563
|
+
/** Parent field that triggers child options fetch */
|
|
2564
|
+
parentField: ParentField;
|
|
2565
|
+
/** Child field that will be populated with fetched options */
|
|
2566
|
+
childField: ChildField;
|
|
2567
|
+
/** Async function to fetch child options based on parent value */
|
|
2568
|
+
fetchOptionsFn: (parentValue: FieldValue<FormType, ParentField>) => Promise<Array<SelectOption>>;
|
|
2569
|
+
/** Whether to clear child field when parent changes (default: true) */
|
|
2570
|
+
clearOnParentChange?: boolean;
|
|
2571
|
+
}
|
|
2482
2572
|
/**
|
|
2483
|
-
*
|
|
2484
|
-
*
|
|
2485
|
-
* @param schemaId Unique identifier for the schema
|
|
2486
|
-
* @param metadata Object mapping field paths to their metadata
|
|
2573
|
+
* Type for the async cascading selects configuration object
|
|
2574
|
+
* Uses a mapped type to preserve field path type safety
|
|
2487
2575
|
*/
|
|
2488
|
-
|
|
2576
|
+
type AsyncCascadingSelectsConfig<FormType> = {
|
|
2577
|
+
[K in string]: AsyncCascadingSelectConfig<FormType, Path<FormType>, Path<FormType>>;
|
|
2578
|
+
};
|
|
2489
2579
|
/**
|
|
2490
|
-
*
|
|
2491
|
-
*
|
|
2492
|
-
* @param schemaId Unique identifier for the schema
|
|
2493
|
-
* @returns True if the schema has metadata, false otherwise
|
|
2580
|
+
* Configuration for auto-population (select/combobox → other fields)
|
|
2494
2581
|
*/
|
|
2495
|
-
|
|
2582
|
+
interface AutoPopulateConfig<FormType, TData = any, SourceField extends Path<FormType> = Path<FormType>> {
|
|
2583
|
+
/**
|
|
2584
|
+
* Optional async function to fetch data when option is selected.
|
|
2585
|
+
* If provided, this will be called instead of using option.data.
|
|
2586
|
+
* Receives the selected option value and returns the data object.
|
|
2587
|
+
*/
|
|
2588
|
+
fetchDataFn?: (selectedValue: FieldValue<FormType, SourceField>) => Promise<TData>;
|
|
2589
|
+
/** Mapping of form fields to data properties for auto-population */
|
|
2590
|
+
fields: {
|
|
2591
|
+
[TargetField in Path<FormType>]?: string | ((data: TData) => FieldValue<FormType, TargetField>);
|
|
2592
|
+
};
|
|
2593
|
+
}
|
|
2496
2594
|
/**
|
|
2497
|
-
*
|
|
2498
|
-
*
|
|
2499
|
-
* @param schemaId Unique identifier for the schema
|
|
2595
|
+
* Type for the auto-populate configuration object
|
|
2596
|
+
* Key is the select/combobox field name, value is the auto-populate config
|
|
2500
2597
|
*/
|
|
2501
|
-
|
|
2598
|
+
type AutoPopulateConfigs<FormType> = Partial<{
|
|
2599
|
+
[SourceField in Path<FormType>]: AutoPopulateConfig<FormType, any>;
|
|
2600
|
+
}>;
|
|
2601
|
+
|
|
2502
2602
|
/**
|
|
2503
|
-
*
|
|
2603
|
+
* Options for merging server data with local changes
|
|
2504
2604
|
*/
|
|
2505
|
-
|
|
2605
|
+
interface MergeOptions<T> {
|
|
2606
|
+
/**
|
|
2607
|
+
* Fields to preserve from local storage when merging with server data
|
|
2608
|
+
* If not provided, all fields will be merged with local data taking precedence
|
|
2609
|
+
*/
|
|
2610
|
+
preserveLocalFields?: (keyof T)[];
|
|
2611
|
+
/**
|
|
2612
|
+
* Custom merge function to handle complex merging logic
|
|
2613
|
+
* If provided, this will be used instead of the default merge strategy
|
|
2614
|
+
*/
|
|
2615
|
+
customMergeFunction?: (serverData: T, localData: T) => T;
|
|
2616
|
+
}
|
|
2506
2617
|
|
|
2618
|
+
declare const ZINIA_FORM_KEY = "ziniaForm";
|
|
2619
|
+
declare const ZINIA_FIELDS_KEY = "ziniaFields";
|
|
2620
|
+
declare const ZINIA_FIELDS_GENERIC_KEY = "ziniaFieldsGeneric";
|
|
2621
|
+
declare const ZINIA_FORM_SCHEMA_KEY = "ziniaFormSchema";
|
|
2622
|
+
type DataLoaderReturnTypes<T> = {
|
|
2623
|
+
[K in keyof T]: T[K] extends () => Promise<infer R> ? R : never;
|
|
2624
|
+
};
|
|
2507
2625
|
/**
|
|
2508
|
-
*
|
|
2626
|
+
* Create a type-safe form system using functional components
|
|
2627
|
+
*
|
|
2628
|
+
* @param schema The Zod schema for the form
|
|
2629
|
+
* @param options Form options
|
|
2630
|
+
* @returns Form API and components
|
|
2509
2631
|
*/
|
|
2632
|
+
declare function useForm<T extends z.ZodObject<any>, CalcType = (values: z.infer<T>, extraData?: DataLoaderReturnTypes<Record<string, () => Promise<any>>>) => any, ExtraDataType = DataLoaderReturnTypes<Record<string, () => Promise<any>>>>(schema: T, options: {
|
|
2633
|
+
storeName: string;
|
|
2634
|
+
schemaId?: string;
|
|
2635
|
+
persistToLocalStorage?: boolean;
|
|
2636
|
+
initialValues?: Partial<z.infer<typeof schema>>;
|
|
2637
|
+
renderStyle?: RegisteredStyleName;
|
|
2638
|
+
autoProvide?: boolean;
|
|
2639
|
+
validateOnMount?: boolean;
|
|
2640
|
+
mergeOptions?: MergeOptions<z.infer<typeof schema>>;
|
|
2641
|
+
dataLoaders?: {
|
|
2642
|
+
[K in keyof ExtraDataType]?: () => Promise<ExtraDataType[K]>;
|
|
2643
|
+
};
|
|
2644
|
+
fetchData?: () => Promise<z.infer<typeof schema>>;
|
|
2645
|
+
asyncCascadingSelects?: AsyncCascadingSelectsConfig<z.infer<T>>;
|
|
2646
|
+
autoPopulate?: AutoPopulateConfigs<z.infer<T>>;
|
|
2647
|
+
calculationFn?: (values: z.infer<T>, extraData?: ExtraDataType) => CalcType;
|
|
2648
|
+
debug?: {
|
|
2649
|
+
all?: boolean;
|
|
2650
|
+
formState?: boolean;
|
|
2651
|
+
validation?: boolean;
|
|
2652
|
+
calculations?: boolean;
|
|
2653
|
+
persistence?: boolean;
|
|
2654
|
+
reactivity?: boolean;
|
|
2655
|
+
};
|
|
2656
|
+
}): {
|
|
2657
|
+
form: {
|
|
2658
|
+
storeName: string;
|
|
2659
|
+
values: z.TypeOf<T>;
|
|
2660
|
+
state: FormState<z.TypeOf<T>, CalcType, ExtraDataType>;
|
|
2661
|
+
readonly calculatedValues: CalcType;
|
|
2662
|
+
readonly extraData: ExtraDataType;
|
|
2663
|
+
readonly isValid: boolean;
|
|
2664
|
+
readonly isDirty: boolean;
|
|
2665
|
+
isSubmitting: boolean;
|
|
2666
|
+
readonly hasAttemptedSubmit: boolean;
|
|
2667
|
+
readonly submitAttemptsCount: number;
|
|
2668
|
+
readonly errors: Record<string, string>;
|
|
2669
|
+
readonly touched: Record<string, boolean>;
|
|
2670
|
+
readonly dirty: Record<string, boolean>;
|
|
2671
|
+
readonly collapsedFields: Record<string, {
|
|
2672
|
+
isFieldCollapsed: boolean;
|
|
2673
|
+
collapsedItems: number[];
|
|
2674
|
+
defaultCollapsedInitialized: boolean;
|
|
2675
|
+
}>;
|
|
2676
|
+
readonly undoHistory: Record<string, {
|
|
2677
|
+
type: "add" | "remove" | "swap";
|
|
2678
|
+
previousState: any;
|
|
2679
|
+
currentState: any;
|
|
2680
|
+
timestamp: number;
|
|
2681
|
+
}[]>;
|
|
2682
|
+
readonly redoHistory: Record<string, {
|
|
2683
|
+
type: "add" | "remove" | "swap";
|
|
2684
|
+
previousState: any;
|
|
2685
|
+
currentState: any;
|
|
2686
|
+
timestamp: number;
|
|
2687
|
+
}[]>;
|
|
2688
|
+
readonly pendingOperations: Record<string, {
|
|
2689
|
+
type: "add" | "remove" | "swap";
|
|
2690
|
+
index?: number;
|
|
2691
|
+
indexA?: number;
|
|
2692
|
+
indexB?: number;
|
|
2693
|
+
item?: any;
|
|
2694
|
+
previousState: any;
|
|
2695
|
+
currentState: any;
|
|
2696
|
+
timestamp: number;
|
|
2697
|
+
timeoutId?: number;
|
|
2698
|
+
}[]>;
|
|
2699
|
+
readonly fieldsMetadata: Record<string, FieldMetadata$1>;
|
|
2700
|
+
validate: (options?: {
|
|
2701
|
+
markErrorsAsTouched: boolean;
|
|
2702
|
+
}) => boolean;
|
|
2703
|
+
validateField: (path: string) => boolean;
|
|
2704
|
+
reset: (newInitialData?: z.TypeOf<T> | undefined) => void;
|
|
2705
|
+
setSubmitting: (value: boolean) => void;
|
|
2706
|
+
incrementSubmitAttempts: () => void;
|
|
2707
|
+
setSubmitError: (error: string | null) => void;
|
|
2708
|
+
readonly isReady: boolean;
|
|
2709
|
+
readonly isLoading: boolean;
|
|
2710
|
+
readonly loadError: string | null;
|
|
2711
|
+
readonly submitError: string | null;
|
|
2712
|
+
setLoading: (value: boolean) => void;
|
|
2713
|
+
setReady: (value: boolean) => void;
|
|
2714
|
+
setLoadError: (error: string | null) => void;
|
|
2715
|
+
getValue: (path: string) => any;
|
|
2716
|
+
setValue: (path: string, value: any) => void;
|
|
2717
|
+
touchField: (path: string) => void;
|
|
2718
|
+
isTouched: (path: string) => boolean;
|
|
2719
|
+
isDirtyField: (path: string) => boolean;
|
|
2720
|
+
resetField: (path: string) => void;
|
|
2721
|
+
hasError: (path: string) => boolean;
|
|
2722
|
+
getError: (path: string) => string;
|
|
2723
|
+
setFocus: (path: string, value: boolean) => void;
|
|
2724
|
+
isFocused: (path: string) => boolean;
|
|
2725
|
+
setDisplayText: (path: string, text: string) => void;
|
|
2726
|
+
getDisplayText: (path: string) => string;
|
|
2727
|
+
setSelectedIndex: (path: string, index: number) => void;
|
|
2728
|
+
getSelectedIndex: (path: string) => number;
|
|
2729
|
+
getArrayItemId: (path: string, index: number) => string;
|
|
2730
|
+
addArrayItemId: (path: string, index?: number) => string;
|
|
2731
|
+
removeArrayItemId: (path: string, index: number) => void;
|
|
2732
|
+
swapArrayItemIds: (path: string, indexA: number, indexB: number) => void;
|
|
2733
|
+
syncArrayItemIds: (path: string) => void;
|
|
2734
|
+
};
|
|
2735
|
+
ZiniaForm: vue.FunctionalComponent<FormProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2736
|
+
ZiniaSubmitButton: vue.FunctionalComponent<SubmitButtonProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2737
|
+
ZiniaResetButton: vue.FunctionalComponent<ResetButtonProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2738
|
+
ZiniaFormErrorsSummary: vue.FunctionalComponent<FormErrorsSummaryProps, {}, any, {}>;
|
|
2739
|
+
zinia: ComponentsType<z.TypeOf<T>>;
|
|
2740
|
+
ziniaGeneric: {
|
|
2741
|
+
TextField: vue.FunctionalComponent<TextFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2742
|
+
NumberField: vue.FunctionalComponent<NumberFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2743
|
+
SelectField: vue.FunctionalComponent<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, {}, any, {}>;
|
|
2744
|
+
CheckboxField: vue.FunctionalComponent<CheckboxFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2745
|
+
TextareaField: vue.FunctionalComponent<TextareaFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2746
|
+
RadioField: vue.FunctionalComponent<RadioFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2747
|
+
FileField: vue.FunctionalComponent<FileFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2748
|
+
DateField: vue.FunctionalComponent<DateFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2749
|
+
TimeField: vue.FunctionalComponent<TimeFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2750
|
+
DateTimeLocalField: vue.FunctionalComponent<DateTimeLocalFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2751
|
+
RangeField: vue.FunctionalComponent<RangeFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2752
|
+
PasswordField: vue.FunctionalComponent<PasswordFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2753
|
+
EmailField: vue.FunctionalComponent<EmailFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2754
|
+
UrlField: vue.FunctionalComponent<UrlFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2755
|
+
TelField: vue.FunctionalComponent<TelFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2756
|
+
SearchField: vue.FunctionalComponent<SearchFieldProps<z.TypeOf<T>>, {}, any, {}>;
|
|
2757
|
+
ComboboxField: vue.FunctionalComponent<ComboboxFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, {}, any, {}>;
|
|
2758
|
+
ArrayField: vue.FunctionalComponent<ArrayFieldProps<z.TypeOf<T>, any>, {}, {
|
|
2759
|
+
itemRenderer: (props: {
|
|
2760
|
+
item: any;
|
|
2761
|
+
index: number;
|
|
2762
|
+
fields: Record<string, string> | {
|
|
2763
|
+
[x: string]: string;
|
|
2764
|
+
};
|
|
2765
|
+
}) => any;
|
|
2766
|
+
availableItemRenderer: (props: {
|
|
2767
|
+
item: any;
|
|
2768
|
+
index: number;
|
|
2769
|
+
}) => any;
|
|
2770
|
+
itemActions: (props: {
|
|
2771
|
+
item: any;
|
|
2772
|
+
index: number;
|
|
2773
|
+
fields: Record<string, string> | {
|
|
2774
|
+
[x: string]: string;
|
|
2775
|
+
};
|
|
2776
|
+
}) => any;
|
|
2777
|
+
fieldSummary: (props: {
|
|
2778
|
+
items: any[];
|
|
2779
|
+
}) => any;
|
|
2780
|
+
default: () => any;
|
|
2781
|
+
}, {}>;
|
|
2782
|
+
TransferListField: vue.FunctionalComponent<TransferListFieldProps<z.TypeOf<T>, any>, {}, {
|
|
2783
|
+
itemRenderer: (props: {
|
|
2784
|
+
item: any;
|
|
2785
|
+
index: number;
|
|
2786
|
+
getFieldName: (fieldPath: string) => string;
|
|
2787
|
+
}) => any;
|
|
2788
|
+
availableItemRenderer: (props: {
|
|
2789
|
+
item: any;
|
|
2790
|
+
index: number;
|
|
2791
|
+
}) => any;
|
|
2792
|
+
selectedItemRenderer: (props: {
|
|
2793
|
+
item: any;
|
|
2794
|
+
index: number;
|
|
2795
|
+
getFieldName: (fieldPath: string) => string;
|
|
2796
|
+
}) => any;
|
|
2797
|
+
default: () => any;
|
|
2798
|
+
}, {}>;
|
|
2799
|
+
ToppingsField: vue.FunctionalComponent<ToppingsFieldProps<z.TypeOf<T>, any>, {}, {
|
|
2800
|
+
itemRenderer: (props: {
|
|
2801
|
+
item: any;
|
|
2802
|
+
index: number;
|
|
2803
|
+
getFieldName: (fieldPath: string) => string;
|
|
2804
|
+
}) => any;
|
|
2805
|
+
availableItemRenderer: (props: {
|
|
2806
|
+
item: any;
|
|
2807
|
+
index: number;
|
|
2808
|
+
}) => any;
|
|
2809
|
+
toppingRenderer: (props: {
|
|
2810
|
+
topping: any;
|
|
2811
|
+
isSelected: boolean;
|
|
2812
|
+
placement: string;
|
|
2813
|
+
isExtra: boolean;
|
|
2814
|
+
}) => any;
|
|
2815
|
+
default: () => any;
|
|
2816
|
+
}, {}>;
|
|
2817
|
+
createTypedSelectField: <P extends Path<z.TypeOf<T>>>(fieldPath: P) => <E extends FieldPathToEnum<z.TypeOf<T>, P> = FieldPathToEnum<z.TypeOf<T>, P>>(props: Omit<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, "name" | "valueToLabel"> & {
|
|
2818
|
+
valueToLabel: Record<E, string>;
|
|
2819
|
+
}, context?: any) => any;
|
|
2820
|
+
typedSelectFields: { [K in Path<z.TypeOf<T>>]?: (<E extends FieldPathToEnum<z.TypeOf<T>, K> = FieldPathToEnum<z.TypeOf<T>, K>>(props: Omit<SelectFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>, any>, "name" | "valueToLabel"> & {
|
|
2821
|
+
valueToLabel: Record<E, string>;
|
|
2822
|
+
}, context?: any) => any) | undefined; };
|
|
2823
|
+
fields: Record<Path<z.TypeOf<T>>, any>;
|
|
2824
|
+
field: <P extends Path<z.TypeOf<T>>>(path: P) => any;
|
|
2825
|
+
};
|
|
2826
|
+
load: () => Promise<void>;
|
|
2827
|
+
loadAllData: () => Promise<void>;
|
|
2828
|
+
refreshFormData: () => Promise<void>;
|
|
2829
|
+
clearSavedFormState: () => void;
|
|
2830
|
+
refreshData: (keys?: Array<keyof ExtraDataType>) => Promise<void>;
|
|
2831
|
+
};
|
|
2832
|
+
type UseFormType = ReturnType<typeof useForm>;
|
|
2833
|
+
type ZiniaForm = UseFormType['form'];
|
|
2834
|
+
type ZiniaFormFields = UseFormType['zinia'];
|
|
2835
|
+
type ZiniaFormGenericFields = UseFormType['ziniaGeneric'];
|
|
2836
|
+
type UseFormTyped<T extends z.ZodObject<any>, CalcType = any, ExtraDataType extends Record<string, any> = Record<string, any>> = ReturnType<typeof useForm<T, CalcType, ExtraDataType>>;
|
|
2510
2837
|
|
|
2511
2838
|
/**
|
|
2512
|
-
*
|
|
2513
|
-
*
|
|
2514
|
-
* @param schemaId Unique identifier for the schema
|
|
2515
|
-
* @param metadata Object mapping field paths to their metadata
|
|
2516
|
-
*/
|
|
2517
|
-
declare function registerSchemaMetadata(schemaId: string, metadata: MetadataRegistry): void;
|
|
2518
|
-
/**
|
|
2519
|
-
* Register metadata for a schema with type checking for field paths
|
|
2839
|
+
* useDataTableUrlSync - Syncs data table filters with URL query parameters
|
|
2520
2840
|
*
|
|
2521
|
-
*
|
|
2522
|
-
*
|
|
2523
|
-
*
|
|
2524
|
-
*/
|
|
2525
|
-
declare function registerSchemaMetadata<T extends z.ZodObject<any>>(schema: T, schemaId: string, metadata: {
|
|
2526
|
-
[K in PathsOf<T>]?: SchemaFieldMetadata;
|
|
2527
|
-
}): void;
|
|
2528
|
-
|
|
2529
|
-
/**
|
|
2530
|
-
* Functions for attaching metadata to schemas
|
|
2531
|
-
*/
|
|
2532
|
-
|
|
2533
|
-
declare const SCHEMA_ID_SYMBOL: unique symbol;
|
|
2534
|
-
/**
|
|
2535
|
-
* Helper function to get the schema ID from a schema object
|
|
2841
|
+
* Usage:
|
|
2842
|
+
* ```ts
|
|
2843
|
+
* import { useRouter } from 'vue-router';
|
|
2536
2844
|
*
|
|
2537
|
-
*
|
|
2538
|
-
*
|
|
2845
|
+
* const router = useRouter();
|
|
2846
|
+
* const table = useCursorDataTable({ ... });
|
|
2847
|
+
* useDataTableUrlSync(table.table, router);
|
|
2848
|
+
* ```
|
|
2539
2849
|
*/
|
|
2540
|
-
|
|
2850
|
+
/** Minimal router interface (compatible with Vue Router's useRouter()) */
|
|
2851
|
+
interface Router {
|
|
2852
|
+
currentRoute: {
|
|
2853
|
+
value: {
|
|
2854
|
+
query: Record<string, any>;
|
|
2855
|
+
};
|
|
2856
|
+
};
|
|
2857
|
+
push: (options: {
|
|
2858
|
+
query: Record<string, any>;
|
|
2859
|
+
}) => void;
|
|
2860
|
+
}
|
|
2861
|
+
interface UrlSyncOptions {
|
|
2862
|
+
/** Whether to load filters from URL on mount (default: true) */
|
|
2863
|
+
loadOnMount?: boolean;
|
|
2864
|
+
}
|
|
2865
|
+
interface DataTable {
|
|
2866
|
+
setFilter: (field: any, filter: any) => Promise<void>;
|
|
2867
|
+
clearAllFilters: () => Promise<void>;
|
|
2868
|
+
setFiltersFromQueryParams: (params: Record<string, string | string[]>) => Promise<void>;
|
|
2869
|
+
load: () => Promise<void>;
|
|
2870
|
+
filters: {
|
|
2871
|
+
queryParams: Record<string, string>;
|
|
2872
|
+
};
|
|
2873
|
+
}
|
|
2541
2874
|
/**
|
|
2542
|
-
*
|
|
2875
|
+
* Syncs a data table's filters with URL query parameters.
|
|
2876
|
+
* Handles back/forward navigation and updates URL when filters change.
|
|
2543
2877
|
*
|
|
2544
|
-
* @param
|
|
2545
|
-
* @param
|
|
2546
|
-
* @param
|
|
2547
|
-
* @returns The original schema with the schema ID attached
|
|
2878
|
+
* @param table - The data table instance (from useCursorDataTable or useDataTable)
|
|
2879
|
+
* @param router - Vue Router instance (from useRouter())
|
|
2880
|
+
* @param options - Optional configuration
|
|
2548
2881
|
*/
|
|
2549
|
-
declare function
|
|
2550
|
-
[K in PathsOf<T>]?: SchemaFieldMetadata;
|
|
2551
|
-
}): T;
|
|
2882
|
+
declare function useDataTableUrlSync(table: DataTable, router: Router, options?: UrlSyncOptions): void;
|
|
2552
2883
|
|
|
2553
2884
|
/**
|
|
2554
|
-
*
|
|
2555
|
-
*
|
|
2885
|
+
* Form state management hook
|
|
2886
|
+
* Provides reactive form state with proper reactivity handling
|
|
2556
2887
|
*/
|
|
2557
2888
|
|
|
2558
2889
|
/**
|
|
2559
|
-
*
|
|
2890
|
+
* Form state interface
|
|
2560
2891
|
*/
|
|
2561
|
-
interface
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2892
|
+
interface FormState<T, CalcType = any, ExtraDataType = any> {
|
|
2893
|
+
data: T;
|
|
2894
|
+
calculatedValues: CalcType;
|
|
2895
|
+
touched: Record<string, boolean>;
|
|
2896
|
+
dirty: Record<string, boolean>;
|
|
2897
|
+
errors: Record<string, string>;
|
|
2898
|
+
focused: Record<string, boolean>;
|
|
2899
|
+
displayText: Record<string, string>;
|
|
2900
|
+
selectedIndex: Record<string, number>;
|
|
2901
|
+
collapsedFields: Record<string, {
|
|
2902
|
+
isFieldCollapsed: boolean;
|
|
2903
|
+
collapsedItems: number[];
|
|
2904
|
+
defaultCollapsedInitialized: boolean;
|
|
2905
|
+
}>;
|
|
2906
|
+
undoHistory: Record<string, {
|
|
2907
|
+
type: 'add' | 'remove' | 'swap';
|
|
2908
|
+
previousState: any;
|
|
2909
|
+
currentState: any;
|
|
2910
|
+
timestamp: number;
|
|
2911
|
+
}[]>;
|
|
2912
|
+
redoHistory: Record<string, {
|
|
2913
|
+
type: 'add' | 'remove' | 'swap';
|
|
2914
|
+
previousState: any;
|
|
2915
|
+
currentState: any;
|
|
2916
|
+
timestamp: number;
|
|
2917
|
+
}[]>;
|
|
2918
|
+
pendingOperations: Record<string, {
|
|
2919
|
+
type: 'add' | 'remove' | 'swap';
|
|
2920
|
+
index?: number;
|
|
2921
|
+
indexA?: number;
|
|
2922
|
+
indexB?: number;
|
|
2923
|
+
item?: any;
|
|
2924
|
+
previousState: any;
|
|
2925
|
+
currentState: any;
|
|
2926
|
+
timestamp: number;
|
|
2927
|
+
timeoutId?: number;
|
|
2928
|
+
}[]>;
|
|
2929
|
+
arrayItemIds: Record<string, string[]>;
|
|
2930
|
+
isSubmitting: boolean;
|
|
2931
|
+
hasAttemptedSubmit: boolean;
|
|
2932
|
+
submitAttemptsCount: number;
|
|
2933
|
+
submitError: string | null;
|
|
2934
|
+
isReady: boolean;
|
|
2935
|
+
isLoading: boolean;
|
|
2936
|
+
loadError: string | null;
|
|
2937
|
+
extraData: ExtraDataType;
|
|
2938
|
+
fetchedOptions: Record<string, any[]>;
|
|
2939
|
+
loadingOptions: Record<string, boolean>;
|
|
2940
|
+
asyncCascadingParents: Record<string, string>;
|
|
2941
|
+
loadingAutoPopulate: Record<string, boolean>;
|
|
2942
|
+
populatingFields: Record<string, boolean>;
|
|
2570
2943
|
}
|
|
2571
2944
|
/**
|
|
2572
|
-
*
|
|
2573
|
-
*/
|
|
2574
|
-
declare const ZiniaPlugin: {
|
|
2575
|
-
install(app: App, options?: ZiniaPluginOptions): void;
|
|
2576
|
-
};
|
|
2577
|
-
/**
|
|
2578
|
-
* Get a registered style by name
|
|
2579
|
-
*
|
|
2580
|
-
* @param styleName Name of the style to get
|
|
2581
|
-
* @returns Style creators for the requested style or undefined if not found
|
|
2582
|
-
*/
|
|
2583
|
-
declare function getRegisteredStyle(styleName?: string): StyleCreators | undefined;
|
|
2584
|
-
/**
|
|
2585
|
-
* Check if a style is registered
|
|
2586
|
-
*
|
|
2587
|
-
* @param styleName Name of the style to check
|
|
2588
|
-
* @returns True if the style is registered
|
|
2589
|
-
*/
|
|
2590
|
-
declare function hasRegisteredStyle(styleName: string): boolean;
|
|
2591
|
-
/**
|
|
2592
|
-
* Get the default style name
|
|
2593
|
-
*
|
|
2594
|
-
* @returns Name of the default style
|
|
2595
|
-
*/
|
|
2596
|
-
declare function getDefaultStyle(): string;
|
|
2597
|
-
/**
|
|
2598
|
-
* Get all registered style names
|
|
2599
|
-
*
|
|
2600
|
-
* @returns Array of registered style names
|
|
2601
|
-
*/
|
|
2602
|
-
declare function getRegisteredStyleNames(): string[];
|
|
2603
|
-
/**
|
|
2604
|
-
* Register a style at runtime
|
|
2605
|
-
* Useful for dynamically loading styles
|
|
2945
|
+
* Create and manage form state with proper reactivity
|
|
2606
2946
|
*
|
|
2607
|
-
* @param
|
|
2608
|
-
* @param
|
|
2609
|
-
|
|
2610
|
-
declare function registerStyle(styleName: string, creators: StyleCreators): void;
|
|
2611
|
-
|
|
2612
|
-
/**
|
|
2613
|
-
* DaisyUI style package
|
|
2614
|
-
* Provides all component creators for the DaisyUI style
|
|
2947
|
+
* @param initialData Initial form data
|
|
2948
|
+
* @param options Options for form state
|
|
2949
|
+
* @returns Form state and methods
|
|
2615
2950
|
*/
|
|
2616
|
-
|
|
2951
|
+
declare function useFormState<T, CalcType = any, ExtraDataType = any>(initialData: T, options?: {
|
|
2952
|
+
hasFetchData?: boolean;
|
|
2953
|
+
calculationFn?: (data: T, extraData?: ExtraDataType) => CalcType;
|
|
2954
|
+
storeName: string;
|
|
2955
|
+
debug?: boolean;
|
|
2956
|
+
extraData?: ExtraDataType;
|
|
2957
|
+
}): {
|
|
2958
|
+
state: FormState<T, CalcType, ExtraDataType>;
|
|
2959
|
+
calculatedValues: ComputedRef<CalcType>;
|
|
2960
|
+
isValid: ComputedRef<boolean>;
|
|
2961
|
+
isDirty: ComputedRef<boolean>;
|
|
2962
|
+
isSubmitting: ComputedRef<boolean>;
|
|
2963
|
+
hasAttemptedSubmit: ComputedRef<boolean>;
|
|
2964
|
+
submitAttemptsCount: ComputedRef<number>;
|
|
2965
|
+
submitError: ComputedRef<string | null>;
|
|
2966
|
+
isReady: ComputedRef<boolean>;
|
|
2967
|
+
isLoading: ComputedRef<boolean>;
|
|
2968
|
+
loadError: ComputedRef<string | null>;
|
|
2969
|
+
reset: (newInitialData?: T) => void;
|
|
2970
|
+
setSubmitting: (value: boolean) => void;
|
|
2971
|
+
incrementSubmitAttempts: () => void;
|
|
2972
|
+
setSubmitError: (error: string | null) => void;
|
|
2973
|
+
setLoading: (value: boolean) => void;
|
|
2974
|
+
setReady: (value: boolean) => void;
|
|
2975
|
+
setLoadError: (error: string | null) => void;
|
|
2976
|
+
updateExtraData: <E = ExtraDataType>(updates: Partial<E>) => void;
|
|
2977
|
+
};
|
|
2617
2978
|
/**
|
|
2618
|
-
*
|
|
2619
|
-
* Can be registered with the Zinia plugin
|
|
2979
|
+
* Result of the useFormState hook
|
|
2620
2980
|
*/
|
|
2621
|
-
|
|
2981
|
+
type FormStateResult<T, CalcType = any, ExtraDataType = any> = ReturnType<typeof useFormState<T, CalcType, ExtraDataType>>;
|
|
2622
2982
|
|
|
2623
2983
|
/**
|
|
2624
|
-
*
|
|
2984
|
+
* Form validation hook
|
|
2985
|
+
* Provides validation functions for form data
|
|
2625
2986
|
*/
|
|
2626
2987
|
|
|
2627
2988
|
/**
|
|
2628
|
-
*
|
|
2629
|
-
*
|
|
2630
|
-
* @param baseStyle The base style to extend
|
|
2631
|
-
* @param overrides Custom overrides for specific components
|
|
2632
|
-
* @returns A new style that combines the base style with the overrides
|
|
2633
|
-
*/
|
|
2634
|
-
declare function extendStyle(baseStyle: StyleCreators, overrides: Partial<StyleCreators>): StyleCreators;
|
|
2635
|
-
/**
|
|
2636
|
-
* Merge multiple styles together
|
|
2637
|
-
* Later styles will override earlier ones for any overlapping components
|
|
2638
|
-
*
|
|
2639
|
-
* @param styles Array of styles to merge
|
|
2640
|
-
* @returns A new style that combines all the provided styles
|
|
2641
|
-
*/
|
|
2642
|
-
declare function mergeStyles(...styles: Array<Partial<StyleCreators>>): StyleCreators;
|
|
2643
|
-
/**
|
|
2644
|
-
* Create a partial style with only the components you need
|
|
2645
|
-
* Useful when you want to override just a few components in a base style
|
|
2646
|
-
*
|
|
2647
|
-
* @param creators Object containing only the component creators you want to override
|
|
2648
|
-
* @returns A partial style object that can be used with extendStyle
|
|
2649
|
-
*/
|
|
2650
|
-
declare function createPartialStyle<T extends Partial<StyleCreators>>(creators: T): T;
|
|
2651
|
-
/**
|
|
2652
|
-
* Create a style template with placeholder implementations
|
|
2653
|
-
* Useful as a starting point for creating a completely new style
|
|
2989
|
+
* Create form validation functions
|
|
2654
2990
|
*
|
|
2655
|
-
* @
|
|
2991
|
+
* @param schema The Zod schema for validation
|
|
2992
|
+
* @param formState The form state to validate
|
|
2993
|
+
* @returns Validation functions
|
|
2656
2994
|
*/
|
|
2657
|
-
declare function
|
|
2658
|
-
|
|
2995
|
+
declare function useFormValidation<T>(schema: z.ZodObject<any>, formState: FormState<T>, options?: {
|
|
2996
|
+
debug?: boolean;
|
|
2997
|
+
}): {
|
|
2998
|
+
validate: (options?: {
|
|
2999
|
+
markErrorsAsTouched: boolean;
|
|
3000
|
+
}) => boolean;
|
|
3001
|
+
validateField: (path: string) => boolean;
|
|
3002
|
+
};
|
|
2659
3003
|
/**
|
|
2660
|
-
*
|
|
2661
|
-
* These are Heroicons (heroicons.com) in SVG format for easy use in actions
|
|
3004
|
+
* Result of the useFormValidation hook
|
|
2662
3005
|
*/
|
|
2663
|
-
|
|
2664
|
-
readonly edit: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z\" /></svg>";
|
|
2665
|
-
readonly pencil: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z\" /></svg>";
|
|
2666
|
-
readonly delete: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" /></svg>";
|
|
2667
|
-
readonly trash: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\" /></svg>";
|
|
2668
|
-
readonly view: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\" /><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z\" /></svg>";
|
|
2669
|
-
readonly eye: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\" /><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z\" /></svg>";
|
|
2670
|
-
readonly copy: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\" /></svg>";
|
|
2671
|
-
readonly duplicate: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\" /></svg>";
|
|
2672
|
-
readonly download: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\" /></svg>";
|
|
2673
|
-
readonly share: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.367 2.684 3 3 0 00-5.367-2.684z\" /></svg>";
|
|
2674
|
-
readonly settings: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z\" /><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\" /></svg>";
|
|
2675
|
-
readonly plus: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 6v6m0 0v6m0-6h6m-6 0H6\" /></svg>";
|
|
2676
|
-
readonly external: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\" /></svg>";
|
|
2677
|
-
readonly arrowRight: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M13 7l5 5m0 0l-5 5m5-5H6\" /></svg>";
|
|
2678
|
-
readonly check: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 13l4 4L19 7\" /></svg>";
|
|
2679
|
-
readonly checkCircle: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\" /></svg>";
|
|
2680
|
-
readonly save: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\" fill=\"none\" class=\"size-6\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 20.25h12A2.25 2.25 0 0 0 20.25 18V7.5L16.5 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25zm9.75-16.5v5h-9.5v-5zM13 5.5V7m-6.75 4.25h11.5v6.5H6.25Z\"></path>\n</svg>";
|
|
2681
|
-
readonly spinner: "<svg class=\"animate-spin\" fill=\"none\" viewBox=\"0 0 24 24\"><circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle><path class=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"></path></svg>";
|
|
2682
|
-
readonly dots: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z\" /></svg>";
|
|
2683
|
-
readonly dotsHorizontal: "<svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z\" /></svg>";
|
|
2684
|
-
};
|
|
3006
|
+
type FormValidationResult<T> = ReturnType<typeof useFormValidation<T>>;
|
|
2685
3007
|
|
|
2686
3008
|
/**
|
|
2687
3009
|
* Debug configuration for Zinia Forms
|
|
@@ -2702,4 +3024,4 @@ declare const DEBUG_CONFIG: {
|
|
|
2702
3024
|
*/
|
|
2703
3025
|
declare function isDebugEnabled(area: keyof Omit<typeof DEBUG_CONFIG, 'all'>): boolean;
|
|
2704
3026
|
|
|
2705
|
-
export { ActionIcons, type ActionItem, type ActionsConfig, type ArrayFieldProps, type ArrayFieldSlots, type ButtonActionItem, COMBOBOX_FIELD_PROP_NAMES, type CheckboxFieldProps, type ColumnDefinition, type ComboboxFieldProps, type CurrencyFieldProps, type CursorDataTableOptions, type CursorFetchParams, type CursorFetchResult, DEBUG_CONFIG, type DataTableColumns, type DataTableOptions, type DataTableProps, type DateFieldProps, type DateTimeLocalFieldProps, type DeleteModalProps, type DisplayComponentsType, type DisplayFieldComponent, type DisplayFieldProps, type DisplayProps, type EmailFieldProps, type EnumValueToLabelMap, type EnumValuesFromField, ErrorDisplay, type FetchDataParams, type FetchDataResult, type
|
|
3027
|
+
export { ActionIcons, type ActionItem, type ActionsConfig, type ArrayFieldProps, type ArrayFieldSlots, type ArrayItemType, type AsyncCascadingSelectsConfig, type AutoPopulateConfigs, type ButtonActionItem, COMBOBOX_FIELD_PROP_NAMES, type CheckboxFieldProps, type ColumnDefinition, type ComboboxFieldProps, type ComponentsType, type CurrencyFieldProps, type CursorDataTableOptions, type CursorFetchParams, type CursorFetchResult, DEBUG_CONFIG, type DataTableColumns, type DataTableOptions, type DataTableProps, type DataType, type DateFieldProps, type DateTimeLocalFieldProps, type DeleteModalProps, type DisplayComponentsType, type DisplayFieldComponent, type DisplayFieldProps, type DisplayProps, type EmailFieldProps, type EnumValueToLabelMap, type EnumValuesFromField, ErrorDisplay, type ExtractEnumType, type FetchDataParams, type FetchDataResult, type FieldMetadata$1 as FieldMetadata, type FieldNames, type FieldPathToEnum, type FieldRegistry, type FieldType, type FileFieldProps, type FilterConfiguration, type FilterOptionItem, type FilterValue, type FilterValueObject, type FormErrorsSummaryProps, type FormProps, type FormState, type FormStateResult, type FormValidationResult, type LinkActionItem, LoadingDisplay, type MergeOptions, type MetadataRegistry, NoDataDisplay, type NumberFieldProps, type Operator, type PasswordFieldProps, type Path, type PathToPascalCase, type PathValue, type PathsOf, type RadioFieldProps, type RangeFieldProps, type RenderStyle, type ResetButtonProps, SCHEMA_ID_SYMBOL, SELECT_FIELD_PROP_NAMES, type SchemaFieldMetadata, type SearchFieldProps, type SelectFieldProps, type SelectOption, type StyleCreators, type SubmitButtonProps, type TelFieldProps, type TextFieldProps, type TextareaFieldProps, type TimeFieldProps, type ToppingsFieldProps, type TransferListFieldProps, type TypedSelectFieldComponent, type UrlFieldProps, type UseCursorDataTableType, type UseDataTableType, type UseDeleteModalType, type UseDisplayType, type UseFormType, type UseFormTyped, type ValidationError, type ValidationResult, type ValueToLabelMapping, ZINIA_DATA_TABLE_ACTIONS_KEY, ZINIA_DATA_TABLE_COLUMNS_KEY, ZINIA_DATA_TABLE_FILTER_CASE_SENSITIVE_KEY, ZINIA_DATA_TABLE_FILTER_INPUTS_KEY, ZINIA_DATA_TABLE_FILTER_OPERATORS_KEY, ZINIA_DATA_TABLE_FILTER_OPTIONS_LOADING_KEY, ZINIA_DATA_TABLE_FILTER_OPTIONS_STATE_KEY, ZINIA_DATA_TABLE_KEY, ZINIA_DATA_TABLE_NAME_KEY, ZINIA_DATA_TABLE_OPTIONS_KEY, ZINIA_DATA_TABLE_SEARCH_INPUT_KEY, ZINIA_DELETE_MODAL_FIELDS_GENERIC_KEY, ZINIA_DELETE_MODAL_FIELDS_KEY, ZINIA_DELETE_MODAL_KEY, ZINIA_DELETE_MODAL_SCHEMA_KEY, ZINIA_DISPLAY_FIELDS_GENERIC_KEY, ZINIA_DISPLAY_FIELDS_KEY, ZINIA_DISPLAY_KEY, ZINIA_DISPLAY_SCHEMA_KEY, ZINIA_FIELDS_GENERIC_KEY, ZINIA_FIELDS_KEY, ZINIA_FORM_KEY, ZINIA_FORM_SCHEMA_KEY, type ZiniaDataTable, type ZiniaDeleteModal, type ZiniaDeleteModalFields, type ZiniaDeleteModalGenericFields, type ZiniaDisplay, type ZiniaDisplayFields, type ZiniaDisplayGenericFields, type ZiniaForm, type ZiniaFormFields, type ZiniaFormGenericFields, ZiniaPlugin, type ZiniaPluginOptions, type ZodEnumValues, buildFieldRegistryFromSchema, clearAllMetadata, clearSchemaMetadata, createBaseComponents, createBaseDisplayComponents, createPartialStyle, createStyleTemplate, createTypedArrayField, createTypedComboboxField, createTypedSelectField, daisyUIStyle, deserializeFiltersFromQueryString, extendStyle, generateDisplayComponents, generateFieldComponents, getAllSchemaMetadata, getDefaultStyle, getFieldMetadata, getRegisteredStyle, getRegisteredStyleNames, getSchemaId, hasRegisteredStyle, hasSchemaMetadata, isDebugEnabled, isValidOperatorForType, mergeStyles, registerSchemaMetadata, registerStyle, serializeFiltersToQueryString, setSchemaMetadata, useCursorDataTable, useDataTable, useDataTableUrlSync, useDeleteModal, useDisplay, useForm, validateFieldRegistry, validateFilterConfiguration, withMetadata };
|