@dragonmastery/zinia-forms-core 0.5.10 → 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 +29 -0
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -672,6 +672,11 @@ type ArrayFieldComponent<T, P extends Path<T>> = vue.FunctionalComponent<Omit<Ar
|
|
|
672
672
|
index: number;
|
|
673
673
|
fields: FieldNames<ArrayItemType<T, P>>;
|
|
674
674
|
}) => any;
|
|
675
|
+
itemPreview: (props: {
|
|
676
|
+
item: ArrayItemType<T, P>;
|
|
677
|
+
index: number;
|
|
678
|
+
fields: FieldNames<ArrayItemType<T, P>>;
|
|
679
|
+
}) => any;
|
|
675
680
|
fieldSummary: (props: {
|
|
676
681
|
items: ArrayItemType<T, P>[];
|
|
677
682
|
}) => any;
|
|
@@ -820,6 +825,11 @@ interface ArrayFieldSlots<ItemType> {
|
|
|
820
825
|
index: number;
|
|
821
826
|
fields: FieldNames<ItemType>;
|
|
822
827
|
}) => any;
|
|
828
|
+
itemPreview: (props: {
|
|
829
|
+
item: ItemType;
|
|
830
|
+
index: number;
|
|
831
|
+
fields: FieldNames<ItemType>;
|
|
832
|
+
}) => any;
|
|
823
833
|
fieldSummary: (props: {
|
|
824
834
|
items: ItemType[];
|
|
825
835
|
}) => any;
|
|
@@ -970,6 +980,13 @@ declare function generateFieldComponents<T extends z.ZodObject<any>>(schema: T,
|
|
|
970
980
|
[x: string]: string;
|
|
971
981
|
};
|
|
972
982
|
}) => any;
|
|
983
|
+
itemPreview: (props: {
|
|
984
|
+
item: any;
|
|
985
|
+
index: number;
|
|
986
|
+
fields: Record<string, string> | {
|
|
987
|
+
[x: string]: string;
|
|
988
|
+
};
|
|
989
|
+
}) => any;
|
|
973
990
|
fieldSummary: (props: {
|
|
974
991
|
items: any[];
|
|
975
992
|
}) => any;
|
|
@@ -1584,6 +1601,11 @@ interface StyleCreators {
|
|
|
1584
1601
|
index: number;
|
|
1585
1602
|
fields: FieldNames<ItemType>;
|
|
1586
1603
|
}) => any;
|
|
1604
|
+
itemPreview: (props: {
|
|
1605
|
+
item: ItemType;
|
|
1606
|
+
index: number;
|
|
1607
|
+
fields: FieldNames<ItemType>;
|
|
1608
|
+
}) => any;
|
|
1587
1609
|
fieldSummary: (props: {
|
|
1588
1610
|
items: ItemType[];
|
|
1589
1611
|
}) => any;
|
|
@@ -2822,6 +2844,13 @@ declare function useForm<T extends z.ZodObject<any>, CalcType = (values: z.infer
|
|
|
2822
2844
|
[x: string]: string;
|
|
2823
2845
|
};
|
|
2824
2846
|
}) => any;
|
|
2847
|
+
itemPreview: (props: {
|
|
2848
|
+
item: any;
|
|
2849
|
+
index: number;
|
|
2850
|
+
fields: Record<string, string> | {
|
|
2851
|
+
[x: string]: string;
|
|
2852
|
+
};
|
|
2853
|
+
}) => any;
|
|
2825
2854
|
fieldSummary: (props: {
|
|
2826
2855
|
items: any[];
|
|
2827
2856
|
}) => any;
|
package/dist/index.js
CHANGED
|
@@ -3234,13 +3234,17 @@ function createDaisyUIArrayField() {
|
|
|
3234
3234
|
}
|
|
3235
3235
|
)
|
|
3236
3236
|
] }),
|
|
3237
|
-
isItemCollapsed && /* @__PURE__ */
|
|
3237
|
+
isItemCollapsed && /* @__PURE__ */ jsx("div", { class: "px-1 sm:px-4 pb-2 sm:pb-3 border-t border-base-200/50", children: slots.itemPreview ? slots.itemPreview({
|
|
3238
|
+
item,
|
|
3239
|
+
index,
|
|
3240
|
+
fields: generateFieldsProxy(index)
|
|
3241
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3238
3242
|
showItemNumber && /* @__PURE__ */ jsxs("div", { class: "text-xs text-base-content/60 font-medium mb-1", children: [
|
|
3239
3243
|
"#",
|
|
3240
3244
|
index + 1
|
|
3241
3245
|
] }),
|
|
3242
3246
|
getItemPreview(item, index) && /* @__PURE__ */ jsx("div", { class: "font-semibold text-sm sm:text-base break-words leading-tight", children: getItemPreview(item, index) })
|
|
3243
|
-
] }),
|
|
3247
|
+
] }) }),
|
|
3244
3248
|
props.allowReordering && /* @__PURE__ */ jsxs("div", { class: "flex items-center justify-end gap-1 sm:gap-2 p-1 sm:p-3 sm:px-4 border-t border-base-200/50", children: [
|
|
3245
3249
|
/* @__PURE__ */ jsx(
|
|
3246
3250
|
"button",
|