vft 0.0.188 → 0.0.189

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.
Files changed (78) hide show
  1. package/es/components/affix/affix.d.ts +1 -1
  2. package/es/components/affix/affix.vue.d.ts +3 -3
  3. package/es/components/affix/index.d.ts +7 -7
  4. package/es/components/button/index.d.ts +12 -12
  5. package/es/components/carousel/carousel.vue.d.ts +1 -1
  6. package/es/components/carousel/index.d.ts +19 -19
  7. package/es/components/date-picker/composables/use-range-picker.d.ts +1 -1
  8. package/es/components/focus-trap/utils.d.ts +1 -1
  9. package/es/components/form/form-item.vue.d.ts +5 -37
  10. package/es/components/form/form-item.vue2.js +11 -29
  11. package/es/components/form/form.vue.d.ts +1 -19
  12. package/es/components/form/form.vue2.js +4 -9
  13. package/es/components/form/index.d.ts +56 -56
  14. package/es/components/form/index.js +16 -18
  15. package/es/components/form/types.d.ts +31 -4
  16. package/es/components/form/types.js +1 -9
  17. package/es/components/index.js +145 -147
  18. package/es/components/modal/index.d.ts +24 -24
  19. package/es/components/popconfirm/index.d.ts +12 -12
  20. package/es/components/popper/composables/use-content.d.ts +3 -3
  21. package/es/components/super-form/index.d.ts +19 -635
  22. package/es/components/super-form/super-form-item.vue.d.ts +1 -10
  23. package/es/components/super-form/super-form-item.vue2.js +6 -6
  24. package/es/components/super-form/super-form.vue.d.ts +1 -21
  25. package/es/components/super-form/super-form.vue2.js +59 -59
  26. package/es/components/super-form/types.d.ts +9 -0
  27. package/es/components/switch/index.d.ts +6 -6
  28. package/es/components/table/index.d.ts +12 -12
  29. package/es/components/table/use/use-columns.d.ts +12 -12
  30. package/es/components/tabs/index.d.ts +2 -2
  31. package/es/components/tabs/tab-bar.vue.d.ts +1 -0
  32. package/es/components/time-picker/composables/use-time-picker.d.ts +2 -2
  33. package/es/components/timeline/index.d.ts +8 -8
  34. package/es/components/tree/index.d.ts +24 -24
  35. package/es/hooks/use-popper/index.d.ts +3 -3
  36. package/es/index.js +107 -109
  37. package/es/package.json.d.ts +1 -1
  38. package/es/package.json.js +1 -1
  39. package/lib/components/affix/affix.d.ts +1 -1
  40. package/lib/components/affix/affix.vue.d.ts +3 -3
  41. package/lib/components/affix/index.d.ts +7 -7
  42. package/lib/components/button/index.d.ts +12 -12
  43. package/lib/components/carousel/carousel.vue.d.ts +1 -1
  44. package/lib/components/carousel/index.d.ts +19 -19
  45. package/lib/components/date-picker/composables/use-range-picker.d.ts +1 -1
  46. package/lib/components/focus-trap/utils.d.ts +1 -1
  47. package/lib/components/form/form-item.vue.d.ts +5 -37
  48. package/lib/components/form/form-item.vue2.cjs +1 -1
  49. package/lib/components/form/form.vue.d.ts +1 -19
  50. package/lib/components/form/form.vue2.cjs +1 -1
  51. package/lib/components/form/index.cjs +1 -1
  52. package/lib/components/form/index.d.ts +56 -56
  53. package/lib/components/form/types.cjs +1 -1
  54. package/lib/components/form/types.d.ts +31 -4
  55. package/lib/components/index.cjs +1 -1
  56. package/lib/components/modal/index.d.ts +24 -24
  57. package/lib/components/popconfirm/index.d.ts +12 -12
  58. package/lib/components/popper/composables/use-content.d.ts +3 -3
  59. package/lib/components/super-form/index.d.ts +19 -635
  60. package/lib/components/super-form/super-form-item.vue.d.ts +1 -10
  61. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  62. package/lib/components/super-form/super-form.vue.d.ts +1 -21
  63. package/lib/components/super-form/super-form.vue2.cjs +1 -1
  64. package/lib/components/super-form/types.d.ts +9 -0
  65. package/lib/components/switch/index.d.ts +6 -6
  66. package/lib/components/table/index.d.ts +12 -12
  67. package/lib/components/table/use/use-columns.d.ts +12 -12
  68. package/lib/components/tabs/index.d.ts +2 -2
  69. package/lib/components/tabs/tab-bar.vue.d.ts +1 -0
  70. package/lib/components/time-picker/composables/use-time-picker.d.ts +2 -2
  71. package/lib/components/timeline/index.d.ts +8 -8
  72. package/lib/components/tree/index.d.ts +24 -24
  73. package/lib/hooks/use-popper/index.d.ts +3 -3
  74. package/lib/index.cjs +1 -1
  75. package/lib/package.json.cjs +1 -1
  76. package/lib/package.json.d.ts +1 -1
  77. package/package.json +4 -4
  78. package/web-types.json +1 -1
@@ -4,7 +4,7 @@ export declare const affixProps: {
4
4
  readonly zIndex: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 100, boolean>;
5
5
  readonly target: import("vft/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
6
6
  readonly offset: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
7
- readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "bottom" | "top", unknown, "top", boolean>;
7
+ readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "top", boolean>;
8
8
  };
9
9
  export type AffixProps = ExtractPropTypes<typeof affixProps>;
10
10
  export declare const affixEmits: {
@@ -2,7 +2,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
2
  readonly zIndex: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 100, boolean>;
3
3
  readonly target: import("vft/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
4
4
  readonly offset: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
5
- readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "bottom" | "top", unknown, "top", boolean>;
5
+ readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "top", boolean>;
6
6
  }, {
7
7
  /** @description update affix status */
8
8
  update: () => void;
@@ -18,7 +18,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
18
18
  readonly zIndex: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 100, boolean>;
19
19
  readonly target: import("vft/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
20
20
  readonly offset: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
21
- readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "bottom" | "top", unknown, "top", boolean>;
21
+ readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "top", boolean>;
22
22
  }>> & {
23
23
  onChange?: ((fixed: boolean) => any) | undefined;
24
24
  onScroll?: ((args_0: {
@@ -27,7 +27,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
27
27
  }) => any) | undefined;
28
28
  }, {
29
29
  readonly target: string;
30
- readonly position: import("vft/es/utils").EpPropMergeType<StringConstructor, "bottom" | "top", unknown>;
30
+ readonly position: import("vft/es/utils").EpPropMergeType<StringConstructor, "top" | "bottom", unknown>;
31
31
  readonly zIndex: number;
32
32
  readonly offset: number;
33
33
  }, {}>, {
@@ -3,7 +3,7 @@ export declare const VftAffix: import("vft/es/utils").SFCWithInstall<{
3
3
  readonly zIndex: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 100, boolean>;
4
4
  readonly target: import("vft/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
5
5
  readonly offset: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
6
- readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "bottom" | "top", unknown, "top", boolean>;
6
+ readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "top", boolean>;
7
7
  }>> & {
8
8
  onChange?: ((fixed: boolean) => any) | undefined;
9
9
  onScroll?: ((args_0: {
@@ -23,7 +23,7 @@ export declare const VftAffix: import("vft/es/utils").SFCWithInstall<{
23
23
  readonly zIndex: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 100, boolean>;
24
24
  readonly target: import("vft/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
25
25
  readonly offset: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
26
- readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "bottom" | "top", unknown, "top", boolean>;
26
+ readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "top", boolean>;
27
27
  }>> & {
28
28
  onChange?: ((fixed: boolean) => any) | undefined;
29
29
  onScroll?: ((args_0: {
@@ -32,7 +32,7 @@ export declare const VftAffix: import("vft/es/utils").SFCWithInstall<{
32
32
  }) => any) | undefined;
33
33
  }, {
34
34
  readonly target: string;
35
- readonly position: import("vft/es/utils").EpPropMergeType<StringConstructor, "bottom" | "top", unknown>;
35
+ readonly position: import("vft/es/utils").EpPropMergeType<StringConstructor, "top" | "bottom", unknown>;
36
36
  readonly zIndex: number;
37
37
  readonly offset: number;
38
38
  }, true, {}, {}, {
@@ -46,7 +46,7 @@ export declare const VftAffix: import("vft/es/utils").SFCWithInstall<{
46
46
  readonly zIndex: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 100, boolean>;
47
47
  readonly target: import("vft/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
48
48
  readonly offset: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
49
- readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "bottom" | "top", unknown, "top", boolean>;
49
+ readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "top", boolean>;
50
50
  }>> & {
51
51
  onChange?: ((fixed: boolean) => any) | undefined;
52
52
  onScroll?: ((args_0: {
@@ -58,7 +58,7 @@ export declare const VftAffix: import("vft/es/utils").SFCWithInstall<{
58
58
  updateRoot: () => void;
59
59
  }, {}, {}, {}, {
60
60
  readonly target: string;
61
- readonly position: import("vft/es/utils").EpPropMergeType<StringConstructor, "bottom" | "top", unknown>;
61
+ readonly position: import("vft/es/utils").EpPropMergeType<StringConstructor, "top" | "bottom", unknown>;
62
62
  readonly zIndex: number;
63
63
  readonly offset: number;
64
64
  }>;
@@ -69,7 +69,7 @@ export declare const VftAffix: import("vft/es/utils").SFCWithInstall<{
69
69
  readonly zIndex: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 100, boolean>;
70
70
  readonly target: import("vft/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
71
71
  readonly offset: import("vft/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
72
- readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "bottom" | "top", unknown, "top", boolean>;
72
+ readonly position: import("vft/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "top", boolean>;
73
73
  }>> & {
74
74
  onChange?: ((fixed: boolean) => any) | undefined;
75
75
  onScroll?: ((args_0: {
@@ -87,7 +87,7 @@ export declare const VftAffix: import("vft/es/utils").SFCWithInstall<{
87
87
  }) => void;
88
88
  }, string, {
89
89
  readonly target: string;
90
- readonly position: import("vft/es/utils").EpPropMergeType<StringConstructor, "bottom" | "top", unknown>;
90
+ readonly position: import("vft/es/utils").EpPropMergeType<StringConstructor, "top" | "bottom", unknown>;
91
91
  readonly zIndex: number;
92
92
  readonly offset: number;
93
93
  }, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
@@ -22,9 +22,6 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
22
22
  size: {
23
23
  type: import("vue").PropType<import("vft/es/components/types").ComponentSize>;
24
24
  };
25
- icon: {
26
- type: import("vue").PropType<string | import("vft/es/components").IconProps>;
27
- };
28
25
  autofocus: {
29
26
  type: import("vue").PropType<boolean>;
30
27
  };
@@ -44,6 +41,9 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
44
41
  type: import("vue").PropType<string | import("vue").Component>;
45
42
  default: string;
46
43
  };
44
+ icon: {
45
+ type: import("vue").PropType<string | import("vft/es/components").IconProps>;
46
+ };
47
47
  nativeType: {
48
48
  type: import("vue").PropType<"button" | "reset" | "submit">;
49
49
  default: string;
@@ -100,9 +100,6 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
100
100
  size: {
101
101
  type: import("vue").PropType<import("vft/es/components/types").ComponentSize>;
102
102
  };
103
- icon: {
104
- type: import("vue").PropType<string | import("vft/es/components").IconProps>;
105
- };
106
103
  autofocus: {
107
104
  type: import("vue").PropType<boolean>;
108
105
  };
@@ -122,6 +119,9 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
122
119
  type: import("vue").PropType<string | import("vue").Component>;
123
120
  default: string;
124
121
  };
122
+ icon: {
123
+ type: import("vue").PropType<string | import("vft/es/components").IconProps>;
124
+ };
125
125
  nativeType: {
126
126
  type: import("vue").PropType<"button" | "reset" | "submit">;
127
127
  default: string;
@@ -182,9 +182,6 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
182
182
  size: {
183
183
  type: import("vue").PropType<import("vft/es/components/types").ComponentSize>;
184
184
  };
185
- icon: {
186
- type: import("vue").PropType<string | import("vft/es/components").IconProps>;
187
- };
188
185
  autofocus: {
189
186
  type: import("vue").PropType<boolean>;
190
187
  };
@@ -204,6 +201,9 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
204
201
  type: import("vue").PropType<string | import("vue").Component>;
205
202
  default: string;
206
203
  };
204
+ icon: {
205
+ type: import("vue").PropType<string | import("vft/es/components").IconProps>;
206
+ };
207
207
  nativeType: {
208
208
  type: import("vue").PropType<"button" | "reset" | "submit">;
209
209
  default: string;
@@ -267,9 +267,6 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
267
267
  size: {
268
268
  type: import("vue").PropType<import("vft/es/components/types").ComponentSize>;
269
269
  };
270
- icon: {
271
- type: import("vue").PropType<string | import("vft/es/components").IconProps>;
272
- };
273
270
  autofocus: {
274
271
  type: import("vue").PropType<boolean>;
275
272
  };
@@ -289,6 +286,9 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
289
286
  type: import("vue").PropType<string | import("vue").Component>;
290
287
  default: string;
291
288
  };
289
+ icon: {
290
+ type: import("vue").PropType<string | import("vft/es/components").IconProps>;
291
+ };
292
292
  nativeType: {
293
293
  type: import("vue").PropType<"button" | "reset" | "submit">;
294
294
  default: string;
@@ -47,8 +47,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
47
47
  }>>> & {
48
48
  onChange?: ((current: number, prev: number) => any) | undefined;
49
49
  }, {
50
- direction: "vertical" | "horizontal";
51
50
  height: string;
51
+ direction: "vertical" | "horizontal";
52
52
  type: "" | "card";
53
53
  arrow: "always" | "never" | "hover";
54
54
  loop: boolean;
@@ -1,13 +1,13 @@
1
1
  export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
2
2
  new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
3
- direction: {
4
- type: import("vue").PropType<"vertical" | "horizontal">;
5
- default: string;
6
- };
7
3
  height: {
8
4
  type: import("vue").PropType<string>;
9
5
  default: string;
10
6
  };
7
+ direction: {
8
+ type: import("vue").PropType<"vertical" | "horizontal">;
9
+ default: string;
10
+ };
11
11
  type: {
12
12
  type: import("vue").PropType<"" | "card">;
13
13
  default: string;
@@ -53,14 +53,14 @@ export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
53
53
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
54
54
  change: (current: number, prev: number) => void;
55
55
  }, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
56
- direction: {
57
- type: import("vue").PropType<"vertical" | "horizontal">;
58
- default: string;
59
- };
60
56
  height: {
61
57
  type: import("vue").PropType<string>;
62
58
  default: string;
63
59
  };
60
+ direction: {
61
+ type: import("vue").PropType<"vertical" | "horizontal">;
62
+ default: string;
63
+ };
64
64
  type: {
65
65
  type: import("vue").PropType<"" | "card">;
66
66
  default: string;
@@ -100,8 +100,8 @@ export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
100
100
  }>> & {
101
101
  onChange?: ((current: number, prev: number) => any) | undefined;
102
102
  }, {
103
- direction: "vertical" | "horizontal";
104
103
  height: string;
104
+ direction: "vertical" | "horizontal";
105
105
  type: "" | "card";
106
106
  arrow: "always" | "never" | "hover";
107
107
  loop: boolean;
@@ -119,14 +119,14 @@ export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
119
119
  M: {};
120
120
  Defaults: {};
121
121
  }, Readonly<import("vue").ExtractPropTypes<{
122
- direction: {
123
- type: import("vue").PropType<"vertical" | "horizontal">;
124
- default: string;
125
- };
126
122
  height: {
127
123
  type: import("vue").PropType<string>;
128
124
  default: string;
129
125
  };
126
+ direction: {
127
+ type: import("vue").PropType<"vertical" | "horizontal">;
128
+ default: string;
129
+ };
130
130
  type: {
131
131
  type: import("vue").PropType<"" | "card">;
132
132
  default: string;
@@ -170,8 +170,8 @@ export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
170
170
  prev: () => void;
171
171
  next: () => void;
172
172
  }, {}, {}, {}, {
173
- direction: "vertical" | "horizontal";
174
173
  height: string;
174
+ direction: "vertical" | "horizontal";
175
175
  type: "" | "card";
176
176
  arrow: "always" | "never" | "hover";
177
177
  loop: boolean;
@@ -186,14 +186,14 @@ export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
186
186
  __isTeleport?: undefined;
187
187
  __isSuspense?: undefined;
188
188
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
189
- direction: {
190
- type: import("vue").PropType<"vertical" | "horizontal">;
191
- default: string;
192
- };
193
189
  height: {
194
190
  type: import("vue").PropType<string>;
195
191
  default: string;
196
192
  };
193
+ direction: {
194
+ type: import("vue").PropType<"vertical" | "horizontal">;
195
+ default: string;
196
+ };
197
197
  type: {
198
198
  type: import("vue").PropType<"" | "card">;
199
199
  default: string;
@@ -239,8 +239,8 @@ export declare const VftCarousel: import("vft/es/utils").SFCWithInstall<{
239
239
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
240
240
  change: (current: number, prev: number) => void;
241
241
  }, string, {
242
- direction: "vertical" | "horizontal";
243
242
  height: string;
243
+ direction: "vertical" | "horizontal";
244
244
  type: "" | "card";
245
245
  arrow: "always" | "never" | "hover";
246
246
  loop: boolean;
@@ -55,7 +55,7 @@ export declare const useRangePicker: (props: PanelRangeSharedProps, { defaultVal
55
55
  startOf: (unit: import("dayjs").OpUnitType) => Dayjs;
56
56
  endOf: (unit: import("dayjs").OpUnitType) => Dayjs;
57
57
  format: (template?: string | undefined) => string;
58
- diff: (date?: string | number | Date | Dayjs | null | undefined, unit?: "s" | "ms" | "y" | "D" | "M" | "year" | "month" | "date" | "dates" | "week" | "d" | "h" | "hours" | "minutes" | "seconds" | "hour" | "minute" | "second" | "day" | "millisecond" | "milliseconds" | "days" | "months" | "years" | "m" | "weeks" | "w" | "quarter" | "quarters" | "Q" | undefined, float?: boolean | undefined) => number;
58
+ diff: (date?: string | number | Date | Dayjs | null | undefined, unit?: "y" | "s" | "ms" | "D" | "M" | "year" | "month" | "date" | "dates" | "week" | "d" | "h" | "hours" | "minutes" | "seconds" | "hour" | "minute" | "second" | "day" | "millisecond" | "milliseconds" | "days" | "months" | "years" | "m" | "weeks" | "w" | "quarter" | "quarters" | "Q" | undefined, float?: boolean | undefined) => number;
59
59
  valueOf: () => number;
60
60
  unix: () => number;
61
61
  daysInMonth: () => number;
@@ -1,4 +1,4 @@
1
- declare const focusReason: import("vue").Ref<"pointer" | "keyboard" | undefined>;
1
+ declare const focusReason: import("vue").Ref<"keyboard" | "pointer" | undefined>;
2
2
  declare const lastUserFocusTimestamp: import("vue").Ref<number>;
3
3
  declare const lastAutomatedFocusTimestamp: import("vue").Ref<number>;
4
4
  export type FocusLayer = {
@@ -1,48 +1,16 @@
1
- import type { ComponentSize } from 'vft/es/constants';
2
- import type { Arrayable } from '../types';
3
- import type { FormItemRule } from './types';
4
- export interface FormItemProps {
5
- label?: string;
6
- labelWidth?: string | number;
7
- prop?: string | string[];
8
- required?: boolean;
9
- rules?: Arrayable<FormItemRule>;
10
- error?: string;
11
- for?: string;
12
- validateStatus?: '' | 'error' | 'validating' | 'success';
13
- inlineMessage?: string | boolean;
14
- showMessage?: boolean;
15
- size?: ComponentSize;
16
- }
1
+ import type { Ref } from 'vue';
2
+ import type { FormItemProps, FormItemValidateState } from './types';
17
3
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FormItemProps>, {
18
4
  required: undefined;
19
5
  inlineMessage: string;
20
6
  labelWidth: string;
21
7
  showMessage: boolean;
22
8
  }>, {
23
- /**
24
- * @description Form item size.
25
- */
26
9
  size: import("vue").ComputedRef<"" | "default" | "small" | "large">;
27
- /**
28
- * @description Validation message.
29
- */
30
- validateMessage: import("vue").Ref<string>;
31
- /**
32
- * @description Validation state.
33
- */
34
- validateState: import("vue").Ref<"" | "error" | "validating" | "success">;
35
- /**
36
- * @description Validate form item.
37
- */
10
+ validateMessage: Ref<string>;
11
+ validateState: Ref<FormItemValidateState>;
38
12
  validate: (trigger: string, callback?: import("./types").FormValidateCallback | undefined) => import("./types").FormValidationResult;
39
- /**
40
- * @description Remove validation status of the field.
41
- */
42
13
  clearValidate: () => void;
43
- /**
44
- * @description Reset current field and remove validation result.
45
- */
46
14
  resetField: () => void;
47
15
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
16
  "update:error": (val: string) => void;
@@ -54,8 +22,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
54
22
  }>>> & {
55
23
  "onUpdate:error"?: ((val: string) => any) | undefined;
56
24
  }, {
57
- required: boolean;
58
25
  labelWidth: string | number;
26
+ required: boolean;
59
27
  inlineMessage: string | boolean;
60
28
  showMessage: boolean;
61
29
  }, {}>, {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as Y, useSlots as he, inject as E, ref as g, computed as a, watch as L, reactive as ye, toRefs as be, provide as Se, onMounted as _e, onBeforeUnmount as Ie, openBlock as F, createElementBlock as Ve, normalizeClass as h, unref as c, createBlock as T, withCtx as M, resolveDynamicComponent as qe, normalizeStyle as G, renderSlot as R, createTextVNode as we, toDisplayString as K, createCommentVNode as U, createElementVNode as O, createVNode as Fe, TransitionGroup as Me, nextTick as Re } from "vue";
2
- import { addUnit as H, isBoolean as We, isString as ze, getProp as W, isFunction as Be } from "@vft/utils";
3
- import { refDebounced as $e } from "@vueuse/core";
2
+ import { refDebounced as We } from "@vueuse/core";
3
+ import { addUnit as H, isBoolean as ze, isString as Be, getProp as W, isFunction as $e } from "@vft/utils";
4
4
  import "../../utils/ns-cover.js";
5
5
  import { castArray as J, clone as Q } from "lodash";
6
6
  import { useId as Ne } from "../../hooks/use-id/index.js";
@@ -11,11 +11,8 @@ import Pe from "async-validator";
11
11
  import { formContextKey as je, formItemContextKey as X } from "./constants.js";
12
12
  import De from "./form-label-wrap.js";
13
13
  import { useFormSize as Ee } from "./hooks/use-form-common-props.js";
14
- const Le = ["role", "aria-labelledby"], o = (
15
- /* hoist-static*/
16
- Ae("form-item")
17
- ), Te = Y({
18
- name: o.b()
14
+ const Le = ["role", "aria-labelledby"], Te = Y({
15
+ name: "vft-form-item"
19
16
  }), er = /* @__PURE__ */ Y({
20
17
  ...Te,
21
18
  props: {
@@ -33,7 +30,10 @@ const Le = ["role", "aria-labelledby"], o = (
33
30
  },
34
31
  emits: ["update:error"],
35
32
  setup(Z, { expose: k, emit: C }) {
36
- const s = Z, x = C, z = he(), e = E(je, void 0), ee = E(X, void 0), y = Ee(void 0, { formItem: !1 }), b = Ne().value, n = g([]), d = g(""), re = $e(d, 100), p = g(""), B = g();
33
+ const s = Z, o = Ae("form-item"), x = C, z = he(), e = E(je, void 0), ee = E(X, void 0), y = Ee(void 0, { formItem: !1 }), b = Ne().value, n = g([]), d = g(""), re = We(
34
+ d,
35
+ 100
36
+ ), p = g(""), B = g();
37
37
  let $, m = !1;
38
38
  const N = a(() => {
39
39
  if ((e == null ? void 0 : e.labelPosition) === "top")
@@ -60,11 +60,11 @@ const Le = ["role", "aria-labelledby"], o = (
60
60
  (e == null ? void 0 : e.requireAsteriskPosition) === "right" ? "asterisk-right" : "asterisk-left",
61
61
  { [o.m("feedback")]: e == null ? void 0 : e.statusIcon }
62
62
  ]), ie = a(
63
- () => We(s.inlineMessage) ? s.inlineMessage : (e == null ? void 0 : e.inlineMessage) || !1
63
+ () => ze(s.inlineMessage) ? s.inlineMessage : (e == null ? void 0 : e.inlineMessage) || !1
64
64
  ), le = a(() => [
65
65
  o.e("error"),
66
66
  { [o.em("error", "inline")]: ie.value }
67
- ]), ae = a(() => s.prop ? ze(s.prop) ? s.prop : s.prop.join(".") : ""), S = a(() => !!(s.label || z.label)), _ = a(() => s.for || n.value.length === 1 ? n.value[0] : void 0), I = a(() => !_.value && S.value), oe = !!ee, A = a(() => {
67
+ ]), ae = a(() => s.prop ? Be(s.prop) ? s.prop : s.prop.join(".") : ""), S = a(() => !!(s.label || z.label)), _ = a(() => s.for || n.value.length === 1 ? n.value[0] : void 0), I = a(() => !_.value && S.value), oe = !!ee, A = a(() => {
68
68
  const r = e == null ? void 0 : e.model;
69
69
  if (!(!r || !s.prop))
70
70
  return W(r, s.prop).value;
@@ -112,7 +112,7 @@ const Le = ["role", "aria-labelledby"], o = (
112
112
  }, j = async (r, t) => {
113
113
  if (m || !s.prop)
114
114
  return !1;
115
- const l = Be(t);
115
+ const l = $e(t);
116
116
  if (!ue.value)
117
117
  return t == null || t(!1), !1;
118
118
  const i = ne(r);
@@ -163,29 +163,11 @@ const Le = ["role", "aria-labelledby"], o = (
163
163
  }), Ie(() => {
164
164
  e == null || e.removeField(w);
165
165
  }), k({
166
- /**
167
- * @description Form item size.
168
- */
169
166
  size: y,
170
- /**
171
- * @description Validation message.
172
- */
173
167
  validateMessage: p,
174
- /**
175
- * @description Validation state.
176
- */
177
168
  validateState: d,
178
- /**
179
- * @description Validate form item.
180
- */
181
169
  validate: j,
182
- /**
183
- * @description Remove validation status of the field.
184
- */
185
170
  clearValidate: q,
186
- /**
187
- * @description Reset current field and remove validation result.
188
- */
189
171
  resetField: D
190
172
  }), (r, t) => {
191
173
  var l;
@@ -1,23 +1,5 @@
1
- import type { ComponentSize } from 'vft/es/constants';
2
1
  import type { Arrayable } from 'vft/es/utils';
3
- import type { FormItemProp, FormRules, FormValidateCallback, FormValidationResult } from './types';
4
- export interface FormProps {
5
- size?: ComponentSize;
6
- disabled?: boolean;
7
- model?: Record<string, any>;
8
- rules?: FormRules;
9
- labelPosition?: 'left' | 'right' | 'top';
10
- requireAsteriskPosition?: 'left' | 'right';
11
- labelWidth?: string | number;
12
- labelSuffix?: string;
13
- inline?: boolean;
14
- inlineMessage?: boolean;
15
- statusIcon?: boolean;
16
- showMessage?: boolean;
17
- validateOnRuleChange?: boolean;
18
- hideRequiredAsterisk?: boolean;
19
- scrollToError?: boolean;
20
- }
2
+ import type { FormItemProp, FormProps, FormValidateCallback, FormValidationResult } from './types';
21
3
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<FormProps>, {
22
4
  /**
23
5
  * @description Validate the whole form. Receives a callback or returns `Promise`.
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as v, computed as h, watch as O, getCurrentInstance as j, provide as q, reactive as z, openBlock as S, createElementBlock as T, normalizeClass as I, renderSlot as M } from "vue";
2
- import { isFunction as R } from "@vft/utils";
3
2
  import "@vueuse/core";
3
+ import { isFunction as R } from "@vft/utils";
4
4
  import { debugWarn as a } from "../../utils/error.js";
5
5
  import "../../utils/ns-cover.js";
6
6
  import "lodash";
@@ -10,11 +10,8 @@ import "../../hooks/use-z-index/index.js";
10
10
  import { formContextKey as $ } from "./constants.js";
11
11
  import { useFormSize as A } from "./hooks/use-form-common-props.js";
12
12
  import { useFormLabelWidth as K, filterFields as d } from "./utils.js";
13
- const n = (
14
- /* hoist-static*/
15
- W("form")
16
- ), L = v({
17
- name: n.b()
13
+ const L = v({
14
+ name: "vft-form"
18
15
  }), ee = /* @__PURE__ */ v({
19
16
  ...L,
20
17
  props: {
@@ -36,10 +33,8 @@ const n = (
36
33
  },
37
34
  emits: ["validate"],
38
35
  setup(o, { expose: y, emit: F }) {
39
- const g = F, i = [], B = A(), w = h(() => [
36
+ const g = F, n = W("form"), i = [], B = A(), w = h(() => [
40
37
  n.b(),
41
- // todo: in v2.2.0, we can remove default
42
- // in fact, remove it doesn't affect the final style
43
38
  n.m(B.value || "default"),
44
39
  {
45
40
  [n.m(`label-${o.labelPosition}`)]: o.labelPosition,