@dragonmastery/zinia-forms-core 0.3.7 → 0.3.8
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 +90 -13
- package/dist/index.js +655 -131
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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;
|
|
@@ -1351,6 +1388,13 @@ declare function useForm<T extends z.ZodObject<any>, CalcType = (values: z.infer
|
|
|
1351
1388
|
item: any;
|
|
1352
1389
|
index: number;
|
|
1353
1390
|
}) => any;
|
|
1391
|
+
itemActions: (props: {
|
|
1392
|
+
item: any;
|
|
1393
|
+
index: number;
|
|
1394
|
+
fields: Record<string, string> | {
|
|
1395
|
+
[x: string]: string;
|
|
1396
|
+
};
|
|
1397
|
+
}) => any;
|
|
1354
1398
|
default: () => any;
|
|
1355
1399
|
}, {}>;
|
|
1356
1400
|
TransferListField: vue.FunctionalComponent<TransferListFieldProps<z.TypeOf<T>, any>, {}, {
|
|
@@ -1447,6 +1491,24 @@ interface TypedSelectFieldComponent<T> {
|
|
|
1447
1491
|
}): ReturnType<FunctionalComponent>;
|
|
1448
1492
|
}
|
|
1449
1493
|
|
|
1494
|
+
interface ArrayFieldSlots<ItemType> {
|
|
1495
|
+
itemRenderer: (props: {
|
|
1496
|
+
item: ItemType;
|
|
1497
|
+
index: number;
|
|
1498
|
+
fields: FieldNames<ItemType>;
|
|
1499
|
+
}) => any;
|
|
1500
|
+
availableItemRenderer: (props: {
|
|
1501
|
+
item: ItemType;
|
|
1502
|
+
index: number;
|
|
1503
|
+
}) => any;
|
|
1504
|
+
itemActions: (props: {
|
|
1505
|
+
item: ItemType;
|
|
1506
|
+
index: number;
|
|
1507
|
+
fields: FieldNames<ItemType>;
|
|
1508
|
+
}) => any;
|
|
1509
|
+
default: () => any;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1450
1512
|
/**
|
|
1451
1513
|
* Functions for creating type-safe array fields
|
|
1452
1514
|
*/
|
|
@@ -1460,18 +1522,7 @@ interface TypedSelectFieldComponent<T> {
|
|
|
1460
1522
|
* @param metadata Optional metadata to apply to the field
|
|
1461
1523
|
* @returns A properly typed array field component with slot types preserved
|
|
1462
1524
|
*/
|
|
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
|
-
}, {}>;
|
|
1525
|
+
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
1526
|
|
|
1476
1527
|
/**
|
|
1477
1528
|
* Generate field components for a schema based on metadata
|
|
@@ -1511,6 +1562,13 @@ declare function generateFieldComponents<T extends z.ZodObject<any>>(schema: T,
|
|
|
1511
1562
|
item: any;
|
|
1512
1563
|
index: number;
|
|
1513
1564
|
}) => any;
|
|
1565
|
+
itemActions: (props: {
|
|
1566
|
+
item: any;
|
|
1567
|
+
index: number;
|
|
1568
|
+
fields: Record<string, string> | {
|
|
1569
|
+
[x: string]: string;
|
|
1570
|
+
};
|
|
1571
|
+
}) => any;
|
|
1514
1572
|
default: () => any;
|
|
1515
1573
|
}, {}>;
|
|
1516
1574
|
TransferListField: vue.FunctionalComponent<TransferListFieldProps<z.TypeOf<T>, any>, {}, {
|
|
@@ -2377,4 +2435,23 @@ declare const ActionIcons: {
|
|
|
2377
2435
|
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
2436
|
};
|
|
2379
2437
|
|
|
2380
|
-
|
|
2438
|
+
/**
|
|
2439
|
+
* Debug configuration for Zinia Forms
|
|
2440
|
+
* Set these flags to true to enable debug logging for specific areas
|
|
2441
|
+
*/
|
|
2442
|
+
declare const DEBUG_CONFIG: {
|
|
2443
|
+
/** Enable debug logging for schema cache operations */
|
|
2444
|
+
schemaCache: boolean;
|
|
2445
|
+
/** Enable debug logging for field validation */
|
|
2446
|
+
fieldValidation: boolean;
|
|
2447
|
+
/** Enable debug logging for array field operations */
|
|
2448
|
+
arrayField: boolean;
|
|
2449
|
+
/** Enable all debug logging */
|
|
2450
|
+
all: boolean;
|
|
2451
|
+
};
|
|
2452
|
+
/**
|
|
2453
|
+
* Helper function to check if debug logging is enabled for a specific area
|
|
2454
|
+
*/
|
|
2455
|
+
declare function isDebugEnabled(area: keyof Omit<typeof DEBUG_CONFIG, 'all'>): boolean;
|
|
2456
|
+
|
|
2457
|
+
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 };
|