@dragonmastery/zinia-forms-core 0.3.7 → 0.3.9

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
@@ -129,6 +129,10 @@ interface ArrayFieldProps<FormType, ItemType> {
129
129
  };
130
130
  collapseAllButton?: boolean;
131
131
  defaultCollapsed?: boolean;
132
+ enableUndo?: boolean;
133
+ maxUndoHistory?: number;
134
+ inlineUndo?: boolean;
135
+ inlineUndoTimeout?: number;
132
136
  }
133
137
 
134
138
  interface CheckboxFieldProps<FormType> {
@@ -408,6 +412,11 @@ type ArrayFieldComponent<T, P extends Path<T>> = vue.FunctionalComponent<Omit<Ar
408
412
  item: ArrayItemType<T, P>;
409
413
  index: number;
410
414
  }) => any;
415
+ itemActions: (props: {
416
+ item: ArrayItemType<T, P>;
417
+ index: number;
418
+ fields: FieldNames<ArrayItemType<T, P>>;
419
+ }) => any;
411
420
  default: () => any;
412
421
  }, {}>;
413
422
  /**
@@ -1136,6 +1145,11 @@ interface StyleCreators {
1136
1145
  item: ItemType;
1137
1146
  index: number;
1138
1147
  }) => any;
1148
+ itemActions: (props: {
1149
+ item: ItemType;
1150
+ index: number;
1151
+ fields: FieldNames<ItemType>;
1152
+ }) => any;
1139
1153
  default: () => any;
1140
1154
  }, {}>;
1141
1155
  createTransferListField: <FormType, ItemType = any>() => FunctionalComponent<TransferListFieldProps<FormType, ItemType>, {}, {
@@ -1286,6 +1300,29 @@ declare function useForm<T extends z.ZodObject<any>, CalcType = (values: z.infer
1286
1300
  collapsedItems: number[];
1287
1301
  defaultCollapsedInitialized: boolean;
1288
1302
  }>;
1303
+ readonly undoHistory: Record<string, {
1304
+ type: "add" | "remove" | "swap";
1305
+ previousState: any;
1306
+ currentState: any;
1307
+ timestamp: number;
1308
+ }[]>;
1309
+ readonly redoHistory: Record<string, {
1310
+ type: "add" | "remove" | "swap";
1311
+ previousState: any;
1312
+ currentState: any;
1313
+ timestamp: number;
1314
+ }[]>;
1315
+ readonly pendingOperations: Record<string, {
1316
+ type: "add" | "remove" | "swap";
1317
+ index?: number;
1318
+ indexA?: number;
1319
+ indexB?: number;
1320
+ item?: any;
1321
+ previousState: any;
1322
+ currentState: any;
1323
+ timestamp: number;
1324
+ timeoutId?: number;
1325
+ }[]>;
1289
1326
  fieldsMetadata: Record<string, FieldMetadata>;
1290
1327
  validate: (options?: {
1291
1328
  markErrorsAsTouched: boolean;
@@ -1339,6 +1376,7 @@ declare function useForm<T extends z.ZodObject<any>, CalcType = (values: z.infer
1339
1376
  UrlField: vue.FunctionalComponent<UrlFieldProps<z.TypeOf<T>>, {}, any, {}>;
1340
1377
  TelField: vue.FunctionalComponent<TelFieldProps<z.TypeOf<T>>, {}, any, {}>;
1341
1378
  SearchField: vue.FunctionalComponent<SearchFieldProps<z.TypeOf<T>>, {}, any, {}>;
1379
+ ComboboxField: vue.FunctionalComponent<ComboboxFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>>, {}, any, {}>;
1342
1380
  ArrayField: vue.FunctionalComponent<ArrayFieldProps<z.TypeOf<T>, any>, {}, {
1343
1381
  itemRenderer: (props: {
1344
1382
  item: any;
@@ -1351,6 +1389,13 @@ declare function useForm<T extends z.ZodObject<any>, CalcType = (values: z.infer
1351
1389
  item: any;
1352
1390
  index: number;
1353
1391
  }) => any;
1392
+ itemActions: (props: {
1393
+ item: any;
1394
+ index: number;
1395
+ fields: Record<string, string> | {
1396
+ [x: string]: string;
1397
+ };
1398
+ }) => any;
1354
1399
  default: () => any;
1355
1400
  }, {}>;
1356
1401
  TransferListField: vue.FunctionalComponent<TransferListFieldProps<z.TypeOf<T>, any>, {}, {
@@ -1447,6 +1492,24 @@ interface TypedSelectFieldComponent<T> {
1447
1492
  }): ReturnType<FunctionalComponent>;
1448
1493
  }
1449
1494
 
1495
+ interface ArrayFieldSlots<ItemType> {
1496
+ itemRenderer: (props: {
1497
+ item: ItemType;
1498
+ index: number;
1499
+ fields: FieldNames<ItemType>;
1500
+ }) => any;
1501
+ availableItemRenderer: (props: {
1502
+ item: ItemType;
1503
+ index: number;
1504
+ }) => any;
1505
+ itemActions: (props: {
1506
+ item: ItemType;
1507
+ index: number;
1508
+ fields: FieldNames<ItemType>;
1509
+ }) => any;
1510
+ default: () => any;
1511
+ }
1512
+
1450
1513
  /**
1451
1514
  * Functions for creating type-safe array fields
1452
1515
  */
@@ -1460,18 +1523,7 @@ interface TypedSelectFieldComponent<T> {
1460
1523
  * @param metadata Optional metadata to apply to the field
1461
1524
  * @returns A properly typed array field component with slot types preserved
1462
1525
  */
1463
- 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">, {}, {
1464
- itemRenderer: (props: {
1465
- item: ArrayItemType<T, P>;
1466
- index: number;
1467
- fields: FieldNames<ArrayItemType<T, P>>;
1468
- }) => any;
1469
- availableItemRenderer: (props: {
1470
- item: ArrayItemType<T, P>;
1471
- index: number;
1472
- }) => any;
1473
- default: () => any;
1474
- }, {}>;
1526
+ 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>>, {}>;
1475
1527
 
1476
1528
  /**
1477
1529
  * Generate field components for a schema based on metadata
@@ -1499,6 +1551,7 @@ declare function generateFieldComponents<T extends z.ZodObject<any>>(schema: T,
1499
1551
  UrlField: vue.FunctionalComponent<UrlFieldProps<z.TypeOf<T>>, {}, any, {}>;
1500
1552
  TelField: vue.FunctionalComponent<TelFieldProps<z.TypeOf<T>>, {}, any, {}>;
1501
1553
  SearchField: vue.FunctionalComponent<SearchFieldProps<z.TypeOf<T>>, {}, any, {}>;
1554
+ ComboboxField: vue.FunctionalComponent<ComboboxFieldProps<z.TypeOf<T>, Path<z.TypeOf<T>>>, {}, any, {}>;
1502
1555
  ArrayField: vue.FunctionalComponent<ArrayFieldProps<z.TypeOf<T>, any>, {}, {
1503
1556
  itemRenderer: (props: {
1504
1557
  item: any;
@@ -1511,6 +1564,13 @@ declare function generateFieldComponents<T extends z.ZodObject<any>>(schema: T,
1511
1564
  item: any;
1512
1565
  index: number;
1513
1566
  }) => any;
1567
+ itemActions: (props: {
1568
+ item: any;
1569
+ index: number;
1570
+ fields: Record<string, string> | {
1571
+ [x: string]: string;
1572
+ };
1573
+ }) => any;
1514
1574
  default: () => any;
1515
1575
  }, {}>;
1516
1576
  TransferListField: vue.FunctionalComponent<TransferListFieldProps<z.TypeOf<T>, any>, {}, {
@@ -2377,4 +2437,23 @@ declare const ActionIcons: {
2377
2437
  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>";
2378
2438
  };
2379
2439
 
2380
- export { ActionIcons, type ActionItem, type ActionsConfig, type ArrayFieldProps, type ButtonActionItem, COMBOBOX_FIELD_PROP_NAMES, type CheckboxFieldProps, type ColumnDefinition, type ComboboxFieldProps, type ComboboxOption, type CurrencyFieldProps, type CursorDataTableOptions, type CursorFetchParams, type CursorFetchResult, 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 FieldPathToEnum$1 as FieldPathToEnum, type FieldType, type FileFieldProps, type FilterOptionItem, type FilterValue, type FormErrorsSummaryProps, type FormProps, type LinkActionItem, LoadingDisplay, NoDataDisplay, type NumberFieldProps, type PasswordFieldProps, type RadioFieldProps, type RangeFieldProps, type ResetButtonProps, SCHEMA_ID_SYMBOL, SELECT_FIELD_PROP_NAMES, type SearchFieldProps, type SelectFieldProps, type SelectOption, 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 ValueToLabelMapping, ZINIA_DATA_TABLE_ACTIONS_KEY, ZINIA_DATA_TABLE_COLUMNS_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, clearAllMetadata, clearSchemaMetadata, createBaseComponents, createBaseDisplayComponents, createPartialStyle, createStyleTemplate, createTypedArrayField, createTypedSelectField, daisyUIStyle, extendStyle, generateDisplayComponents, generateFieldComponents, getAllSchemaMetadata, getDefaultStyle, getFieldMetadata, getRegisteredStyle, getRegisteredStyleNames, getSchemaId, hasRegisteredStyle, hasSchemaMetadata, mergeStyles, plainStyle, registerSchemaMetadata, registerStyle, setSchemaMetadata, useCursorDataTable, useDataTable, useDeleteModal, useDisplay, useForm, withMetadata };
2440
+ /**
2441
+ * Debug configuration for Zinia Forms
2442
+ * Set these flags to true to enable debug logging for specific areas
2443
+ */
2444
+ declare const DEBUG_CONFIG: {
2445
+ /** Enable debug logging for schema cache operations */
2446
+ schemaCache: boolean;
2447
+ /** Enable debug logging for field validation */
2448
+ fieldValidation: boolean;
2449
+ /** Enable debug logging for array field operations */
2450
+ arrayField: boolean;
2451
+ /** Enable all debug logging */
2452
+ all: boolean;
2453
+ };
2454
+ /**
2455
+ * Helper function to check if debug logging is enabled for a specific area
2456
+ */
2457
+ declare function isDebugEnabled(area: keyof Omit<typeof DEBUG_CONFIG, 'all'>): boolean;
2458
+
2459
+ export { ActionIcons, type ActionItem, type ActionsConfig, type ArrayFieldProps, type ArrayFieldSlots, type ButtonActionItem, COMBOBOX_FIELD_PROP_NAMES, type CheckboxFieldProps, type ColumnDefinition, type ComboboxFieldProps, type ComboboxOption, 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 FieldPathToEnum$1 as FieldPathToEnum, type FieldType, type FileFieldProps, type FilterOptionItem, type FilterValue, type FormErrorsSummaryProps, type FormProps, type LinkActionItem, LoadingDisplay, NoDataDisplay, type NumberFieldProps, type PasswordFieldProps, type RadioFieldProps, type RangeFieldProps, type ResetButtonProps, SCHEMA_ID_SYMBOL, SELECT_FIELD_PROP_NAMES, type SearchFieldProps, type SelectFieldProps, type SelectOption, 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 ValueToLabelMapping, ZINIA_DATA_TABLE_ACTIONS_KEY, ZINIA_DATA_TABLE_COLUMNS_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, clearAllMetadata, clearSchemaMetadata, createBaseComponents, createBaseDisplayComponents, createPartialStyle, createStyleTemplate, createTypedArrayField, createTypedSelectField, daisyUIStyle, extendStyle, generateDisplayComponents, generateFieldComponents, getAllSchemaMetadata, getDefaultStyle, getFieldMetadata, getRegisteredStyle, getRegisteredStyleNames, getSchemaId, hasRegisteredStyle, hasSchemaMetadata, isDebugEnabled, mergeStyles, plainStyle, registerSchemaMetadata, registerStyle, setSchemaMetadata, useCursorDataTable, useDataTable, useDeleteModal, useDisplay, useForm, withMetadata };