@dragonmastery/zinia-forms-core 0.5.9 → 0.5.11

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 CHANGED
@@ -239,6 +239,8 @@ interface CheckboxFieldProps<FormType> {
239
239
  disabled?: boolean;
240
240
  readonly?: boolean;
241
241
  class?: string | string[];
242
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
243
+ classStrategy?: 'append' | 'replace';
242
244
  size?: string;
243
245
  variant?: string;
244
246
  }
@@ -341,6 +343,8 @@ interface SelectFieldProps<FormType, P extends Path<FormType> = Path<FormType>,
341
343
  * CSS classes to apply to the field
342
344
  */
343
345
  class?: string | string[];
346
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
347
+ classStrategy?: 'append' | 'replace';
344
348
  /**
345
349
  * Field size
346
350
  */
@@ -427,7 +431,7 @@ interface SelectFieldProps<FormType, P extends Path<FormType> = Path<FormType>,
427
431
  *
428
432
  * TypeScript ensures all entries are valid keys of SelectFieldProps.
429
433
  */
430
- declare const SELECT_FIELD_PROP_NAMES: readonly ["name", "selectOptions", "placeholder", "disabled", "readonly", "class", "label", "hideLabel", "description", "required", "size", "variant", "valueToLabel", "useSchemaOptions", "dependsOn", "optionFilterFn", "autoReset"];
434
+ declare const SELECT_FIELD_PROP_NAMES: readonly ["name", "selectOptions", "placeholder", "disabled", "readonly", "class", "classStrategy", "label", "hideLabel", "description", "required", "size", "variant", "valueToLabel", "useSchemaOptions", "dependsOn", "optionFilterFn", "autoReset"];
431
435
 
432
436
  /**
433
437
  * Props for the ComboboxField component
@@ -473,6 +477,8 @@ interface ComboboxFieldProps<FormType, P extends Path<FormType> = Path<FormType>
473
477
  * CSS classes to apply to the field
474
478
  */
475
479
  class?: string | string[];
480
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
481
+ classStrategy?: 'append' | 'replace';
476
482
  /**
477
483
  * Field size
478
484
  */
@@ -573,7 +579,7 @@ interface ComboboxFieldProps<FormType, P extends Path<FormType> = Path<FormType>
573
579
  *
574
580
  * TypeScript ensures all entries are valid keys of ComboboxFieldProps.
575
581
  */
576
- declare const COMBOBOX_FIELD_PROP_NAMES: readonly ["name", "selectOptions", "placeholder", "disabled", "readonly", "class", "label", "hideLabel", "description", "required", "size", "variant", "valueToLabel", "useSchemaOptions", "dependsOn", "optionFilterFn", "autoReset", "allowCreate", "filterFn"];
582
+ declare const COMBOBOX_FIELD_PROP_NAMES: readonly ["name", "selectOptions", "placeholder", "disabled", "readonly", "class", "classStrategy", "label", "hideLabel", "description", "required", "size", "variant", "valueToLabel", "useSchemaOptions", "dependsOn", "optionFilterFn", "autoReset", "allowCreate", "filterFn"];
577
583
 
578
584
  interface DateFieldProps<FormType> {
579
585
  name: FlexiblePath<FormType>;
@@ -585,6 +591,8 @@ interface DateFieldProps<FormType> {
585
591
  disabled?: boolean;
586
592
  readonly?: boolean;
587
593
  class?: string | string[];
594
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
595
+ classStrategy?: 'append' | 'replace';
588
596
  size?: string;
589
597
  variant?: string;
590
598
  min?: string;
@@ -602,6 +610,8 @@ interface NumberFieldProps<FormType> {
602
610
  disabled?: boolean;
603
611
  readonly?: boolean;
604
612
  class?: string | string[];
613
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
614
+ classStrategy?: 'append' | 'replace';
605
615
  size?: string;
606
616
  variant?: string;
607
617
  min?: number;
@@ -662,6 +672,11 @@ type ArrayFieldComponent<T, P extends Path<T>> = vue.FunctionalComponent<Omit<Ar
662
672
  index: number;
663
673
  fields: FieldNames<ArrayItemType<T, P>>;
664
674
  }) => any;
675
+ itemPreview: (props: {
676
+ item: ArrayItemType<T, P>;
677
+ index: number;
678
+ fields: FieldNames<ArrayItemType<T, P>>;
679
+ }) => any;
665
680
  fieldSummary: (props: {
666
681
  items: ArrayItemType<T, P>[];
667
682
  }) => any;
@@ -810,6 +825,11 @@ interface ArrayFieldSlots<ItemType> {
810
825
  index: number;
811
826
  fields: FieldNames<ItemType>;
812
827
  }) => any;
828
+ itemPreview: (props: {
829
+ item: ItemType;
830
+ index: number;
831
+ fields: FieldNames<ItemType>;
832
+ }) => any;
813
833
  fieldSummary: (props: {
814
834
  items: ItemType[];
815
835
  }) => any;
@@ -960,6 +980,13 @@ declare function generateFieldComponents<T extends z.ZodObject<any>>(schema: T,
960
980
  [x: string]: string;
961
981
  };
962
982
  }) => any;
983
+ itemPreview: (props: {
984
+ item: any;
985
+ index: number;
986
+ fields: Record<string, string> | {
987
+ [x: string]: string;
988
+ };
989
+ }) => any;
963
990
  fieldSummary: (props: {
964
991
  items: any[];
965
992
  }) => any;
@@ -1022,6 +1049,8 @@ interface CurrencyFieldProps<FormType> {
1022
1049
  disabled?: boolean;
1023
1050
  readonly?: boolean;
1024
1051
  class?: string | string[];
1052
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1053
+ classStrategy?: 'append' | 'replace';
1025
1054
  size?: string;
1026
1055
  variant?: string;
1027
1056
  min?: number;
@@ -1039,6 +1068,8 @@ interface DateTimeLocalFieldProps<FormType> {
1039
1068
  disabled?: boolean;
1040
1069
  readonly?: boolean;
1041
1070
  class?: string | string[];
1071
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1072
+ classStrategy?: 'append' | 'replace';
1042
1073
  size?: string;
1043
1074
  variant?: string;
1044
1075
  min?: string;
@@ -1057,6 +1088,8 @@ interface EmailFieldProps<FormType> {
1057
1088
  readonly?: boolean;
1058
1089
  autocomplete?: string;
1059
1090
  class?: string | string[];
1091
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1092
+ classStrategy?: 'append' | 'replace';
1060
1093
  size?: string;
1061
1094
  variant?: string;
1062
1095
  }
@@ -1070,6 +1103,8 @@ interface FileFieldProps<FormType> {
1070
1103
  disabled?: boolean;
1071
1104
  readonly?: boolean;
1072
1105
  class?: string | string[];
1106
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1107
+ classStrategy?: 'append' | 'replace';
1073
1108
  size?: string;
1074
1109
  variant?: string;
1075
1110
  accept?: string;
@@ -1128,6 +1163,8 @@ interface PasswordFieldProps<FormType> {
1128
1163
  readonly?: boolean;
1129
1164
  autocomplete?: string;
1130
1165
  class?: string | string[];
1166
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1167
+ classStrategy?: 'append' | 'replace';
1131
1168
  size?: string;
1132
1169
  variant?: string;
1133
1170
  }
@@ -1159,6 +1196,8 @@ interface RangeFieldProps<FormType> {
1159
1196
  disabled?: boolean;
1160
1197
  readonly?: boolean;
1161
1198
  class?: string | string[];
1199
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1200
+ classStrategy?: 'append' | 'replace';
1162
1201
  size?: string;
1163
1202
  variant?: string;
1164
1203
  min?: number;
@@ -1185,6 +1224,8 @@ interface SearchFieldProps<FormType> {
1185
1224
  readonly?: boolean;
1186
1225
  autocomplete?: string;
1187
1226
  class?: string | string[];
1227
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1228
+ classStrategy?: 'append' | 'replace';
1188
1229
  size?: string;
1189
1230
  variant?: string;
1190
1231
  }
@@ -1224,6 +1265,8 @@ interface TelFieldProps<FormType> {
1224
1265
  readonly?: boolean;
1225
1266
  autocomplete?: string;
1226
1267
  class?: string | string[];
1268
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1269
+ classStrategy?: 'append' | 'replace';
1227
1270
  size?: string;
1228
1271
  variant?: string;
1229
1272
  pattern?: string;
@@ -1239,6 +1282,8 @@ interface TextareaFieldProps<FormType> {
1239
1282
  disabled?: boolean;
1240
1283
  readonly?: boolean;
1241
1284
  class?: string | string[];
1285
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1286
+ classStrategy?: 'append' | 'replace';
1242
1287
  size?: string;
1243
1288
  variant?: string;
1244
1289
  rows?: number;
@@ -1257,6 +1302,8 @@ interface TextFieldProps<FormType> {
1257
1302
  readonly?: boolean;
1258
1303
  autocomplete?: string;
1259
1304
  class?: string | string[];
1305
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1306
+ classStrategy?: 'append' | 'replace';
1260
1307
  size?: string;
1261
1308
  variant?: string;
1262
1309
  }
@@ -1271,6 +1318,8 @@ interface TimeFieldProps<FormType> {
1271
1318
  disabled?: boolean;
1272
1319
  readonly?: boolean;
1273
1320
  class?: string | string[];
1321
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1322
+ classStrategy?: 'append' | 'replace';
1274
1323
  size?: string;
1275
1324
  variant?: string;
1276
1325
  min?: string;
@@ -1408,6 +1457,8 @@ interface UrlFieldProps<FormType> {
1408
1457
  readonly?: boolean;
1409
1458
  autocomplete?: string;
1410
1459
  class?: string | string[];
1460
+ /** 'append' (default): merge with defaults. 'replace': use only your class, ignore defaults */
1461
+ classStrategy?: 'append' | 'replace';
1411
1462
  size?: string;
1412
1463
  variant?: string;
1413
1464
  pattern?: string;
@@ -1550,6 +1601,11 @@ interface StyleCreators {
1550
1601
  index: number;
1551
1602
  fields: FieldNames<ItemType>;
1552
1603
  }) => any;
1604
+ itemPreview: (props: {
1605
+ item: ItemType;
1606
+ index: number;
1607
+ fields: FieldNames<ItemType>;
1608
+ }) => any;
1553
1609
  fieldSummary: (props: {
1554
1610
  items: ItemType[];
1555
1611
  }) => any;
@@ -2788,6 +2844,13 @@ declare function useForm<T extends z.ZodObject<any>, CalcType = (values: z.infer
2788
2844
  [x: string]: string;
2789
2845
  };
2790
2846
  }) => any;
2847
+ itemPreview: (props: {
2848
+ item: any;
2849
+ index: number;
2850
+ fields: Record<string, string> | {
2851
+ [x: string]: string;
2852
+ };
2853
+ }) => any;
2791
2854
  fieldSummary: (props: {
2792
2855
  items: any[];
2793
2856
  }) => any;