vft 0.0.388 → 0.0.390

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 (134) hide show
  1. package/es/components/alert/alert.vue.d.ts +11 -1
  2. package/es/components/alert/alert.vue2.js +65 -13
  3. package/es/components/alert/index.d.ts +76 -28
  4. package/es/components/autocomplete/autocomplete.vue.d.ts +5 -5
  5. package/es/components/autocomplete/index.d.ts +13 -13
  6. package/es/components/button/button.vue.d.ts +1 -1
  7. package/es/components/button/index.d.ts +12 -12
  8. package/es/components/button/use-button.d.ts +1 -1
  9. package/es/components/carousel/index.d.ts +3 -3
  10. package/es/components/carousel/types.d.ts +1 -1
  11. package/es/components/carousel/use-carousel.d.ts +2 -2
  12. package/es/components/carousel/use-carousel.js +37 -37
  13. package/es/components/cascader/cascader.vue.d.ts +2 -2
  14. package/es/components/checkbox/index.d.ts +27 -27
  15. package/es/components/color-picker/index.d.ts +6 -6
  16. package/es/components/date-picker/date-picker-com/panel-date-pick.vue.d.ts +2 -2
  17. package/es/components/date-picker/date-picker-com/panel-date-range.vue.d.ts +2 -2
  18. package/es/components/date-picker/date-picker.d.ts +3 -3
  19. package/es/components/date-picker/index.d.ts +6 -6
  20. package/es/components/date-picker/panel-utils.d.ts +6 -6
  21. package/es/components/date-picker/props/date-picker.d.ts +1 -1
  22. package/es/components/date-picker/props/panel-date-pick.d.ts +1 -1
  23. package/es/components/date-picker/props/panel-date-range.d.ts +1 -1
  24. package/es/components/date-picker/props/shared.d.ts +1 -1
  25. package/es/components/dropdown/index.d.ts +9 -9
  26. package/es/components/form/index.d.ts +18 -18
  27. package/es/components/index.js +155 -163
  28. package/es/components/input/index.d.ts +5 -5
  29. package/es/components/input/input.vue.d.ts +2 -2
  30. package/es/components/input/input.vue2.js +4 -4
  31. package/es/components/input-number/index.d.ts +1 -1
  32. package/es/components/input-number/input-number.vue.d.ts +1 -1
  33. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  34. package/es/components/input-tag/input-tag.vue.d.ts +4 -4
  35. package/es/components/radio/index.d.ts +18 -18
  36. package/es/components/search/index.d.ts +3 -3
  37. package/es/components/search/search.vue.d.ts +1 -1
  38. package/es/components/select/index.d.ts +6 -6
  39. package/es/components/select/select.vue.d.ts +6 -6
  40. package/es/components/select/useSelect.d.ts +4 -4
  41. package/es/components/slider/index.d.ts +1 -1
  42. package/es/components/slider/slider.vue.d.ts +1 -1
  43. package/es/components/super-form/component-map.d.ts +1 -42
  44. package/es/components/super-form/component-map.js +30 -60
  45. package/es/components/super-form/index.js +12 -20
  46. package/es/components/super-form/super-form-item.vue2.js +5 -4
  47. package/es/components/super-form/types.d.ts +2 -2
  48. package/es/components/super-form/types.js +5 -1
  49. package/es/components/super-form/use/helper.d.ts +1 -1
  50. package/es/components/super-form/use/helper.js +37 -32
  51. package/es/components/super-form/use/use-auto-focus.js +19 -15
  52. package/es/components/super-form/use/use-form-events.js +70 -67
  53. package/es/components/switch/index.d.ts +6 -6
  54. package/es/components/table/index.d.ts +9 -9
  55. package/es/components/table/table.vue2.js +22 -22
  56. package/es/components/tabs/index.d.ts +2 -2
  57. package/es/components/tabs/tabs.vue.d.ts +2 -2
  58. package/es/components/time-picker/common/picker.vue.d.ts +2 -2
  59. package/es/components/tree/tree-node.vue.d.ts +18 -18
  60. package/es/index.js +2 -1
  61. package/es/package.json.d.ts +1 -1
  62. package/es/package.json.js +1 -1
  63. package/es/utils/form-register.d.ts +42 -0
  64. package/es/utils/form-register.js +35 -0
  65. package/es/utils/index.d.ts +1 -0
  66. package/es/utils/index.js +80 -71
  67. package/es/utils/vue/vnode.js +1 -1
  68. package/lib/components/alert/alert.vue.d.ts +11 -1
  69. package/lib/components/alert/alert.vue2.cjs +1 -1
  70. package/lib/components/alert/index.d.ts +76 -28
  71. package/lib/components/autocomplete/autocomplete.vue.d.ts +5 -5
  72. package/lib/components/autocomplete/index.d.ts +13 -13
  73. package/lib/components/button/button.vue.d.ts +1 -1
  74. package/lib/components/button/index.d.ts +12 -12
  75. package/lib/components/button/use-button.d.ts +1 -1
  76. package/lib/components/carousel/index.d.ts +3 -3
  77. package/lib/components/carousel/types.d.ts +1 -1
  78. package/lib/components/carousel/use-carousel.cjs +1 -1
  79. package/lib/components/carousel/use-carousel.d.ts +2 -2
  80. package/lib/components/cascader/cascader.vue.d.ts +2 -2
  81. package/lib/components/checkbox/index.d.ts +27 -27
  82. package/lib/components/color-picker/index.d.ts +6 -6
  83. package/lib/components/date-picker/date-picker-com/panel-date-pick.vue.d.ts +2 -2
  84. package/lib/components/date-picker/date-picker-com/panel-date-range.vue.d.ts +2 -2
  85. package/lib/components/date-picker/date-picker.d.ts +3 -3
  86. package/lib/components/date-picker/index.d.ts +6 -6
  87. package/lib/components/date-picker/panel-utils.d.ts +6 -6
  88. package/lib/components/date-picker/props/date-picker.d.ts +1 -1
  89. package/lib/components/date-picker/props/panel-date-pick.d.ts +1 -1
  90. package/lib/components/date-picker/props/panel-date-range.d.ts +1 -1
  91. package/lib/components/date-picker/props/shared.d.ts +1 -1
  92. package/lib/components/dropdown/index.d.ts +9 -9
  93. package/lib/components/form/index.d.ts +18 -18
  94. package/lib/components/index.cjs +1 -1
  95. package/lib/components/input/index.d.ts +5 -5
  96. package/lib/components/input/input.vue.d.ts +2 -2
  97. package/lib/components/input/input.vue2.cjs +1 -1
  98. package/lib/components/input-number/index.d.ts +1 -1
  99. package/lib/components/input-number/input-number.vue.d.ts +1 -1
  100. package/lib/components/input-tag/input-tag.vue.d.ts +4 -4
  101. package/lib/components/radio/index.d.ts +18 -18
  102. package/lib/components/search/index.d.ts +3 -3
  103. package/lib/components/search/search.vue.d.ts +1 -1
  104. package/lib/components/select/index.d.ts +6 -6
  105. package/lib/components/select/select.vue.d.ts +6 -6
  106. package/lib/components/select/useSelect.d.ts +4 -4
  107. package/lib/components/slider/index.d.ts +1 -1
  108. package/lib/components/slider/slider.vue.d.ts +1 -1
  109. package/lib/components/super-form/component-map.cjs +1 -1
  110. package/lib/components/super-form/component-map.d.ts +1 -42
  111. package/lib/components/super-form/index.cjs +1 -1
  112. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  113. package/lib/components/super-form/types.cjs +1 -1
  114. package/lib/components/super-form/types.d.ts +2 -2
  115. package/lib/components/super-form/use/helper.cjs +1 -1
  116. package/lib/components/super-form/use/helper.d.ts +1 -1
  117. package/lib/components/super-form/use/use-auto-focus.cjs +1 -1
  118. package/lib/components/super-form/use/use-form-events.cjs +1 -1
  119. package/lib/components/switch/index.d.ts +6 -6
  120. package/lib/components/table/index.d.ts +9 -9
  121. package/lib/components/table/table.vue2.cjs +1 -1
  122. package/lib/components/tabs/index.d.ts +2 -2
  123. package/lib/components/tabs/tabs.vue.d.ts +2 -2
  124. package/lib/components/time-picker/common/picker.vue.d.ts +2 -2
  125. package/lib/components/tree/tree-node.vue.d.ts +18 -18
  126. package/lib/index.cjs +1 -1
  127. package/lib/package.json.cjs +1 -1
  128. package/lib/package.json.d.ts +1 -1
  129. package/lib/utils/form-register.cjs +1 -0
  130. package/lib/utils/form-register.d.ts +42 -0
  131. package/lib/utils/index.cjs +1 -1
  132. package/lib/utils/index.d.ts +1 -0
  133. package/package.json +4 -4
  134. package/web-types.json +1 -1
@@ -70,7 +70,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
70
70
  tabChange: (name: string | number) => void;
71
71
  tabRemove: (name: string | number) => void;
72
72
  tabAdd: () => void;
73
- edit: (paneName: string | number | undefined, action: "remove" | "add") => void;
73
+ edit: (paneName: string | number | undefined, action: "add" | "remove") => void;
74
74
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<TabsProps>>> & Readonly<{
75
75
  "onUpdate:modelValue"?: ((name: string | number) => any) | undefined;
76
76
  onTabClick?: ((pane: {
@@ -110,7 +110,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
110
110
  isFocusInsidePane: () => boolean | undefined;
111
111
  }, index: number, ev: Event) => any) | undefined;
112
112
  onTabChange?: ((name: string | number) => any) | undefined;
113
- onEdit?: ((paneName: string | number | undefined, action: "remove" | "add") => any) | undefined;
113
+ onEdit?: ((paneName: string | number | undefined, action: "add" | "remove") => any) | undefined;
114
114
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
115
115
  export default _default;
116
116
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -136,9 +136,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
136
136
  */
137
137
  onPick: (date?: any, visible?: boolean) => void;
138
138
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
139
+ clear: (...args: any[]) => void;
139
140
  "update:modelValue": (...args: any[]) => void;
140
141
  change: (...args: any[]) => void;
141
- clear: (...args: any[]) => void;
142
142
  blur: (...args: any[]) => void;
143
143
  focus: (...args: any[]) => void;
144
144
  keydown: (...args: any[]) => void;
@@ -238,9 +238,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
238
238
  };
239
239
  readonly isRange: BooleanConstructor;
240
240
  }>> & Readonly<{
241
+ onClear?: ((...args: any[]) => any) | undefined;
241
242
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
242
243
  onChange?: ((...args: any[]) => any) | undefined;
243
- onClear?: ((...args: any[]) => any) | undefined;
244
244
  onBlur?: ((...args: any[]) => any) | undefined;
245
245
  onFocus?: ((...args: any[]) => any) | undefined;
246
246
  onKeydown?: ((...args: any[]) => any) | undefined;
@@ -99,6 +99,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
99
99
  })>;
100
100
  TreeCheckbox: import("vft/es/utils").SFCWithInstall<{
101
101
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
102
+ size: {
103
+ type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
104
+ };
102
105
  label: {
103
106
  type: import("vue").PropType<string | number>;
104
107
  };
@@ -117,9 +120,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
117
120
  id: {
118
121
  type: import("vue").PropType<string>;
119
122
  };
120
- size: {
121
- type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
122
- };
123
123
  modelValue: {
124
124
  type: import("vue").PropType<string | number | boolean>;
125
125
  };
@@ -161,6 +161,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
161
161
  M: {};
162
162
  Defaults: {};
163
163
  }, Readonly<import("vue").ExtractPropTypes<{
164
+ size: {
165
+ type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
166
+ };
164
167
  label: {
165
168
  type: import("vue").PropType<string | number>;
166
169
  };
@@ -179,9 +182,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
179
182
  id: {
180
183
  type: import("vue").PropType<string>;
181
184
  };
182
- size: {
183
- type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
184
- };
185
185
  modelValue: {
186
186
  type: import("vue").PropType<string | number | boolean>;
187
187
  };
@@ -217,6 +217,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
217
217
  __isTeleport?: never;
218
218
  __isSuspense?: never;
219
219
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
220
+ size: {
221
+ type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
222
+ };
220
223
  label: {
221
224
  type: import("vue").PropType<string | number>;
222
225
  };
@@ -235,9 +238,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
235
238
  id: {
236
239
  type: import("vue").PropType<string>;
237
240
  };
238
- size: {
239
- type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
240
- };
241
241
  modelValue: {
242
242
  type: import("vue").PropType<string | number | boolean>;
243
243
  };
@@ -448,6 +448,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
448
448
  });
449
449
  CheckboxGroup: {
450
450
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
451
+ size: {
452
+ type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
453
+ };
451
454
  label: {
452
455
  type: import("vue").PropType<string>;
453
456
  };
@@ -457,9 +460,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
457
460
  fill: {
458
461
  type: import("vue").PropType<string>;
459
462
  };
460
- size: {
461
- type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
462
- };
463
463
  modelValue: {
464
464
  type: import("vue").PropType<import("vft/es/components/checkbox").CheckboxGroupValueType>;
465
465
  default: () => never[];
@@ -505,6 +505,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
505
505
  M: {};
506
506
  Defaults: {};
507
507
  }, Readonly<import("vue").ExtractPropTypes<{
508
+ size: {
509
+ type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
510
+ };
508
511
  label: {
509
512
  type: import("vue").PropType<string>;
510
513
  };
@@ -514,9 +517,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
514
517
  fill: {
515
518
  type: import("vue").PropType<string>;
516
519
  };
517
- size: {
518
- type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
519
- };
520
520
  modelValue: {
521
521
  type: import("vue").PropType<import("vft/es/components/checkbox").CheckboxGroupValueType>;
522
522
  default: () => never[];
@@ -556,6 +556,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
556
556
  __isTeleport?: never;
557
557
  __isSuspense?: never;
558
558
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
559
+ size: {
560
+ type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
561
+ };
559
562
  label: {
560
563
  type: import("vue").PropType<string>;
561
564
  };
@@ -565,9 +568,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
565
568
  fill: {
566
569
  type: import("vue").PropType<string>;
567
570
  };
568
- size: {
569
- type: import("vue").PropType<import("vft/es/constants").ComponentSize>;
570
- };
571
571
  modelValue: {
572
572
  type: import("vue").PropType<import("vft/es/components/checkbox").CheckboxGroupValueType>;
573
573
  default: () => never[];
package/es/index.js CHANGED
@@ -126,6 +126,7 @@ export { ZINDEX_INJECTION_KEY, defaultInitialZIndex, useZIndex, zIndexContextKey
126
126
  export { useCalcInputWidth } from "./hooks/use-calc-input-width/index.js";
127
127
  export { useComposition } from "./hooks/use-composition/index.js";
128
128
  export { useFocusController } from "./hooks/use-focus-controller/index.js";
129
+ export { FormCompEnum, clearComponents, getComponent, getRegisteredComponents, hasComponent, registerComponent, registerComponents, removeComponent } from "./utils/form-register.js";
129
130
  export { attemptFocus, focusNode, getSibling, isFocusable, isLeaf, isVisible, obtainAllFocusableElements, triggerEvent } from "./utils/dom/aria.js";
130
131
  export { getClientXY, getOffsetTop, getOffsetTopDistance, isInContainer } from "./utils/dom/position.js";
131
132
  export { getScrollBarWidth, getScrollContainer, isScroll, scrollIntoView } from "./utils/dom/scroll.js";
@@ -202,7 +203,7 @@ export { watermarkProps } from "./components/watermark/watermark.js";
202
203
  export { vLoading, createLoadingDirective } from "./components/loading/directive.js";
203
204
  export { Loading } from "./components/loading/service.js";
204
205
  export { messageDefaults, messageTypes } from "./components/message/types.js";
205
- export { FormCompEnum, clearComponents, getComponent, getRegisteredComponents, hasComponent, isDatePicker, isInput, isRangePicker, registerComponent, registerComponents, removeComponent } from "./components/super-form/component-map.js";
206
+ export { isDatePicker, isInput, isRangePicker } from "./components/super-form/component-map.js";
206
207
  export { getDynamicProps, useForm } from "./components/super-form/use/use-form.js";
207
208
 
208
209
 
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.388",
3
+ "version": "0.0.390",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- const o = "0.0.388";
1
+ const o = "0.0.390";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -0,0 +1,42 @@
1
+ import type { Component } from 'vue';
2
+ export declare enum FormCompEnum {
3
+ AUTOCOMPLETE = "autocomplete",
4
+ Cascader = "cascader",
5
+ ColorPicker = "colorPicker",
6
+ INPUT = "input",
7
+ INPUT_NUMBER = "input-number",
8
+ INPUT_NUMBER_STEP = "input-number-step",
9
+ INPUT_TAG = "input-tag",
10
+ PASSWORD = "password",
11
+ TEXTAREA = "textarea",
12
+ Slider = "slider",
13
+ DIVIDER = "divider",
14
+ SELECT = "select",
15
+ SEARCH = "search",
16
+ RADIO = "radio",
17
+ RADIO_SINGLE = "radio_single",
18
+ RADIO_BUTTON = "radio-button",
19
+ CHECKBOX = "checkbox",
20
+ CHECKBOX_SINGLE = "checkbox_single",
21
+ CHECKBOX_BUTTON = "checkbox-button",
22
+ SWITCH = "switch",
23
+ Upload = "upload",
24
+ TIME_PICKER = "time-picker",
25
+ TIMERANGE_PICKER = "time-picker",
26
+ YEAR_PICKER = "year",
27
+ MONTH_PICKER = "month",
28
+ DATE_PICKER = "date",
29
+ DATES_PICKER = "dates",
30
+ DATETIME_PICKER = "datetime",
31
+ WEEK_PICKER = "week",
32
+ DATETIMERANGE_PICKER = "datetimerange",
33
+ DATERANGE_PICKER = "daterange",
34
+ MONTHRANGE_PICKER = "monthrange"
35
+ }
36
+ export declare function registerComponent(compName: FormCompEnum | string, component: Component): void;
37
+ export declare function registerComponents(components: Record<string, Component>): void;
38
+ export declare function getComponent(compName: FormCompEnum): Component | undefined;
39
+ export declare function removeComponent(compName: FormCompEnum): void;
40
+ export declare function hasComponent(compName: FormCompEnum): boolean;
41
+ export declare function getRegisteredComponents(): FormCompEnum[];
42
+ export declare function clearComponents(): void;
@@ -0,0 +1,35 @@
1
+ var c = /* @__PURE__ */ ((e) => (e.AUTOCOMPLETE = "autocomplete", e.Cascader = "cascader", e.ColorPicker = "colorPicker", e.INPUT = "input", e.INPUT_NUMBER = "input-number", e.INPUT_NUMBER_STEP = "input-number-step", e.INPUT_TAG = "input-tag", e.PASSWORD = "password", e.TEXTAREA = "textarea", e.Slider = "slider", e.DIVIDER = "divider", e.SELECT = "select", e.SEARCH = "search", e.RADIO = "radio", e.RADIO_SINGLE = "radio_single", e.RADIO_BUTTON = "radio-button", e.CHECKBOX = "checkbox", e.CHECKBOX_SINGLE = "checkbox_single", e.CHECKBOX_BUTTON = "checkbox-button", e.SWITCH = "switch", e.Upload = "upload", e.TIME_PICKER = "time-picker", e.TIMERANGE_PICKER = "time-picker", e.YEAR_PICKER = "year", e.MONTH_PICKER = "month", e.DATE_PICKER = "date", e.DATES_PICKER = "dates", e.DATETIME_PICKER = "datetime", e.WEEK_PICKER = "week", e.DATETIMERANGE_PICKER = "datetimerange", e.DATERANGE_PICKER = "daterange", e.MONTHRANGE_PICKER = "monthrange", e))(c || {});
2
+ const t = /* @__PURE__ */ new Map();
3
+ function I(e, a) {
4
+ t.set(e, a);
5
+ }
6
+ function T(e) {
7
+ Object.entries(e).forEach(([a, i]) => {
8
+ t.set(a, i);
9
+ });
10
+ }
11
+ function R(e) {
12
+ return t.get(e);
13
+ }
14
+ function s(e) {
15
+ t.delete(e);
16
+ }
17
+ function n(e) {
18
+ return t.has(e);
19
+ }
20
+ function _() {
21
+ return Array.from(t.keys());
22
+ }
23
+ function A() {
24
+ t.clear();
25
+ }
26
+ export {
27
+ c as FormCompEnum,
28
+ A as clearComponents,
29
+ R as getComponent,
30
+ _ as getRegisteredComponents,
31
+ n as hasComponent,
32
+ I as registerComponent,
33
+ T as registerComponents,
34
+ s as removeComponent
35
+ };
@@ -1,3 +1,4 @@
1
+ export * from './form-register';
1
2
  export * from './dom';
2
3
  export * from './error';
3
4
  export * from './event';
package/es/utils/index.js CHANGED
@@ -1,73 +1,82 @@
1
- import { attemptFocus as o, focusNode as t, getSibling as s, isFocusable as i, isLeaf as l, isVisible as n, obtainAllFocusableElements as a, triggerEvent as p } from "./dom/aria.js";
2
- import { getClientXY as f, getOffsetTop as d, getOffsetTopDistance as c, isInContainer as g } from "./dom/position.js";
3
- import { getScrollBarWidth as u, getScrollContainer as C, isScroll as h, scrollIntoView as b } from "./dom/scroll.js";
4
- import { debugWarn as V, throwError as P } from "./error.js";
5
- import { composeEventHandlers as w, whenMouse as y } from "./event.js";
6
- import { addUnit as E, castArray as T, getComponentSize as N, getSizeType as v, isValidComponentSize as z, unique as A } from "./helper.js";
7
- import { cssVarValue as B, generateCssVars as D, primaryColor as R, setCssVar as W, setPrimaryColorCssvars as k } from "./ns-cover.js";
8
- import { mutable as H } from "./typescript.js";
9
- import { escapeStringRegexp as L } from "./vue/data-helper.js";
10
- import { withInstall as U, withInstallDirective as X, withInstallFunction as Y, withNoopInstall as j } from "./vue/install.js";
11
- import { buildProp as J, buildProps as Q, definePropType as Z, epPropKey as _, isEpProp as $ } from "./vue/props/runtime.js";
12
- import { cAF as re, rAF as oe } from "./vue/raf.js";
13
- import { composeRefs as se } from "./vue/refs.js";
14
- import { PatchFlags as le, ensureOnlyChild as ne, flattedChildren as ae, getFirstValidNode as pe, getNormalizedProps as me, isComment as fe, isFragment as de, isTemplate as ce, isText as ge, isValidElementNode as xe, renderBlock as ue, renderIf as Ce } from "./vue/vnode.js";
1
+ import { FormCompEnum as r, clearComponents as t, getComponent as s, getRegisteredComponents as n, hasComponent as i, registerComponent as p, registerComponents as l, removeComponent as m } from "./form-register.js";
2
+ import { attemptFocus as f, focusNode as g, getSibling as d, isFocusable as C, isLeaf as c, isVisible as x, obtainAllFocusableElements as u, triggerEvent as h } from "./dom/aria.js";
3
+ import { getClientXY as b, getOffsetTop as V, getOffsetTopDistance as P, isInContainer as S } from "./dom/position.js";
4
+ import { getScrollBarWidth as y, getScrollContainer as E, isScroll as I, scrollIntoView as T } from "./dom/scroll.js";
5
+ import { debugWarn as N, throwError as z } from "./error.js";
6
+ import { composeEventHandlers as O, whenMouse as R } from "./event.js";
7
+ import { addUnit as D, castArray as W, getComponentSize as k, getSizeType as q, isValidComponentSize as H, unique as K } from "./helper.js";
8
+ import { cssVarValue as M, generateCssVars as U, primaryColor as X, setCssVar as Y, setPrimaryColorCssvars as j } from "./ns-cover.js";
9
+ import { mutable as J } from "./typescript.js";
10
+ import { escapeStringRegexp as Z } from "./vue/data-helper.js";
11
+ import { withInstall as $, withInstallDirective as ee, withInstallFunction as oe, withNoopInstall as re } from "./vue/install.js";
12
+ import { buildProp as se, buildProps as ne, definePropType as ie, epPropKey as pe, isEpProp as le } from "./vue/props/runtime.js";
13
+ import { cAF as ae, rAF as fe } from "./vue/raf.js";
14
+ import { composeRefs as de } from "./vue/refs.js";
15
+ import { PatchFlags as ce, ensureOnlyChild as xe, flattedChildren as ue, getFirstValidNode as he, getNormalizedProps as Fe, isComment as be, isFragment as Ve, isTemplate as Pe, isText as Se, isValidElementNode as we, renderBlock as ye, renderIf as Ee } from "./vue/vnode.js";
15
16
  export {
16
- le as PatchFlags,
17
- E as addUnit,
18
- o as attemptFocus,
19
- J as buildProp,
20
- Q as buildProps,
21
- re as cAF,
22
- T as castArray,
23
- w as composeEventHandlers,
24
- se as composeRefs,
25
- B as cssVarValue,
26
- V as debugWarn,
27
- Z as definePropType,
28
- ne as ensureOnlyChild,
29
- _ as epPropKey,
30
- L as escapeStringRegexp,
31
- ae as flattedChildren,
32
- t as focusNode,
33
- D as generateCssVars,
34
- f as getClientXY,
35
- N as getComponentSize,
36
- pe as getFirstValidNode,
37
- me as getNormalizedProps,
38
- d as getOffsetTop,
39
- c as getOffsetTopDistance,
40
- u as getScrollBarWidth,
41
- C as getScrollContainer,
42
- s as getSibling,
43
- v as getSizeType,
44
- fe as isComment,
45
- $ as isEpProp,
46
- i as isFocusable,
47
- de as isFragment,
48
- g as isInContainer,
49
- l as isLeaf,
50
- h as isScroll,
51
- ce as isTemplate,
52
- ge as isText,
53
- z as isValidComponentSize,
54
- xe as isValidElementNode,
55
- n as isVisible,
56
- H as mutable,
57
- a as obtainAllFocusableElements,
58
- R as primaryColor,
59
- oe as rAF,
60
- ue as renderBlock,
61
- Ce as renderIf,
62
- b as scrollIntoView,
63
- W as setCssVar,
64
- k as setPrimaryColorCssvars,
65
- P as throwError,
66
- p as triggerEvent,
67
- A as unique,
68
- y as whenMouse,
69
- U as withInstall,
70
- X as withInstallDirective,
71
- Y as withInstallFunction,
72
- j as withNoopInstall
17
+ r as FormCompEnum,
18
+ ce as PatchFlags,
19
+ D as addUnit,
20
+ f as attemptFocus,
21
+ se as buildProp,
22
+ ne as buildProps,
23
+ ae as cAF,
24
+ W as castArray,
25
+ t as clearComponents,
26
+ O as composeEventHandlers,
27
+ de as composeRefs,
28
+ M as cssVarValue,
29
+ N as debugWarn,
30
+ ie as definePropType,
31
+ xe as ensureOnlyChild,
32
+ pe as epPropKey,
33
+ Z as escapeStringRegexp,
34
+ ue as flattedChildren,
35
+ g as focusNode,
36
+ U as generateCssVars,
37
+ b as getClientXY,
38
+ s as getComponent,
39
+ k as getComponentSize,
40
+ he as getFirstValidNode,
41
+ Fe as getNormalizedProps,
42
+ V as getOffsetTop,
43
+ P as getOffsetTopDistance,
44
+ n as getRegisteredComponents,
45
+ y as getScrollBarWidth,
46
+ E as getScrollContainer,
47
+ d as getSibling,
48
+ q as getSizeType,
49
+ i as hasComponent,
50
+ be as isComment,
51
+ le as isEpProp,
52
+ C as isFocusable,
53
+ Ve as isFragment,
54
+ S as isInContainer,
55
+ c as isLeaf,
56
+ I as isScroll,
57
+ Pe as isTemplate,
58
+ Se as isText,
59
+ H as isValidComponentSize,
60
+ we as isValidElementNode,
61
+ x as isVisible,
62
+ J as mutable,
63
+ u as obtainAllFocusableElements,
64
+ X as primaryColor,
65
+ fe as rAF,
66
+ p as registerComponent,
67
+ l as registerComponents,
68
+ m as removeComponent,
69
+ ye as renderBlock,
70
+ Ee as renderIf,
71
+ T as scrollIntoView,
72
+ Y as setCssVar,
73
+ j as setPrimaryColorCssvars,
74
+ z as throwError,
75
+ h as triggerEvent,
76
+ K as unique,
77
+ R as whenMouse,
78
+ $ as withInstall,
79
+ ee as withInstallDirective,
80
+ oe as withInstallFunction,
81
+ re as withNoopInstall
73
82
  };
@@ -1,4 +1,4 @@
1
- import { isArray as E, hasOwn as m, camelize as N } from "@vft/utils";
1
+ import { hasOwn as m, camelize as N, isArray as E } from "@vft/utils";
2
2
  import { isVNode as o, Fragment as S, Comment as A, Text as s, createCommentVNode as L, createBlock as _, openBlock as C } from "vue";
3
3
  import { debugWarn as O } from "../error.js";
4
4
  const R = "utils/vue/vnode";
@@ -27,11 +27,16 @@ export interface AlertProps {
27
27
  center?: boolean;
28
28
  effect?: alertEffects;
29
29
  }
30
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<AlertProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
+ declare function __VLS_template(): {
31
+ title?(_: {}): any;
32
+ default?(_: {}): any;
33
+ };
34
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<AlertProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
35
  close: (evt: MouseEvent) => void;
32
36
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<AlertProps>>> & Readonly<{
33
37
  onClose?: ((evt: MouseEvent) => any) | undefined;
34
38
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
39
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
35
40
  export default _default;
36
41
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
37
42
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -42,3 +47,8 @@ type __VLS_TypePropsToRuntimeProps<T> = {
42
47
  required: true;
43
48
  };
44
49
  };
50
+ type __VLS_WithTemplateSlots<T, S> = T & {
51
+ new (): {
52
+ $slots: S;
53
+ };
54
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../icon/index.cjs");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");const n=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const i=e.defineComponent({name:"vft-alert"}),c=e.defineComponent({...i,props:{title:{default:""},description:{default:""},type:{default:"info"},closable:{type:Boolean,default:!0},closeText:{default:""},showIcon:{type:Boolean},center:{type:Boolean},effect:{default:"light"}},emits:{close:t=>t instanceof MouseEvent},setup(t,{emit:l}){const o=n.useNamespace("alert"),r=e.useSlots();return e.ref(!0),e.computed(()=>t.type),e.computed(()=>[o.e("icon"),{[o.is("big")]:!!t.description||!!r.default}]),e.computed(()=>({[o.is("bold")]:t.description||r.default})),(s,a)=>(e.openBlock(),e.createBlock(e.unref(u.VftIcon)))}});exports.default=c;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../icon/index.cjs");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");const m=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const p=e.defineComponent({name:"vft-alert"}),k=e.defineComponent({...p,props:{title:{default:""},description:{default:""},type:{default:"info"},closable:{type:Boolean,default:!0},closeText:{default:""},showIcon:{type:Boolean},center:{type:Boolean},effect:{default:"light"}},emits:{close:l=>l instanceof MouseEvent},setup(l,{emit:i}){const o=m.useNamespace("alert"),u=i,n=e.useSlots(),s=e.ref(!0),r=e.computed(()=>l.type),d=e.computed(()=>[o.e("icon"),{[o.is("big")]:!!l.description||!!n.default}]),f=e.computed(()=>({[o.is("bold")]:l.description||n.default})),a=t=>{s.value=!1,u("close",t)};return(t,B)=>(e.openBlock(),e.createBlock(e.Transition,{name:e.unref(o).b("fade")},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(o).b(),e.unref(o).m(t.type),e.unref(o).is("center",t.center),e.unref(o).is(t.effect)]),role:"alert"},[t.showIcon&&r.value?(e.openBlock(),e.createBlock(e.unref(c.VftIcon),{key:0,class:e.normalizeClass(d.value),icon:r.value},null,8,["class","icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o).e("content"))},[t.title||t.$slots.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(o).e("title"),f.value])},[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],2)):e.createCommentVNode("",!0),t.$slots.default||t.description?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(o).e("description"))},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.description),1)])],2)):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[t.closeText?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(o).e("close-btn"),e.unref(o).is("customed")]),onClick:a},e.toDisplayString(t.closeText),3)):(e.openBlock(),e.createBlock(e.unref(c.VftIcon),{key:1,class:e.normalizeClass(e.unref(o).e("close-btn")),onClick:a,icon:"icon-close"},null,8,["class"]))],64)):e.createCommentVNode("",!0)],2)],2),[[e.vShow,s.value]])]),_:3},8,["name"]))}});exports.default=k;
@@ -1,5 +1,73 @@
1
1
  export * from './types';
2
- export declare const VftAlert: import("vft/es/utils").SFCWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ export declare const VftAlert: import("vft/es/utils").SFCWithInstall<{
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
4
+ title: {
5
+ type: import("vue").PropType<string>;
6
+ };
7
+ description: {
8
+ type: import("vue").PropType<string>;
9
+ };
10
+ type: {
11
+ type: import("vue").PropType<import("./types").TypeComponents>;
12
+ };
13
+ closable: {
14
+ type: import("vue").PropType<boolean>;
15
+ };
16
+ closeText: {
17
+ type: import("vue").PropType<string>;
18
+ };
19
+ showIcon: {
20
+ type: import("vue").PropType<boolean>;
21
+ };
22
+ center: {
23
+ type: import("vue").PropType<boolean>;
24
+ };
25
+ effect: {
26
+ type: import("vue").PropType<import("./types").alertEffects>;
27
+ };
28
+ }>> & Readonly<{
29
+ onClose?: ((evt: MouseEvent) => any) | undefined;
30
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
+ close: (evt: MouseEvent) => void;
32
+ }, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
33
+ P: {};
34
+ B: {};
35
+ D: {};
36
+ C: {};
37
+ M: {};
38
+ Defaults: {};
39
+ }, Readonly<import("vue").ExtractPropTypes<{
40
+ title: {
41
+ type: import("vue").PropType<string>;
42
+ };
43
+ description: {
44
+ type: import("vue").PropType<string>;
45
+ };
46
+ type: {
47
+ type: import("vue").PropType<import("./types").TypeComponents>;
48
+ };
49
+ closable: {
50
+ type: import("vue").PropType<boolean>;
51
+ };
52
+ closeText: {
53
+ type: import("vue").PropType<string>;
54
+ };
55
+ showIcon: {
56
+ type: import("vue").PropType<boolean>;
57
+ };
58
+ center: {
59
+ type: import("vue").PropType<boolean>;
60
+ };
61
+ effect: {
62
+ type: import("vue").PropType<import("./types").alertEffects>;
63
+ };
64
+ }>> & Readonly<{
65
+ onClose?: ((evt: MouseEvent) => any) | undefined;
66
+ }>, {}, {}, {}, {}, {}>;
67
+ __isFragment?: never;
68
+ __isTeleport?: never;
69
+ __isSuspense?: never;
70
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
3
71
  title: {
4
72
  type: import("vue").PropType<string>;
5
73
  };
@@ -24,34 +92,14 @@ export declare const VftAlert: import("vft/es/utils").SFCWithInstall<import("vue
24
92
  effect: {
25
93
  type: import("vue").PropType<import("./types").alertEffects>;
26
94
  };
95
+ }>> & Readonly<{
96
+ onClose?: ((evt: MouseEvent) => any) | undefined;
27
97
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
98
  close: (evt: MouseEvent) => void;
29
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
- title: {
31
- type: import("vue").PropType<string>;
32
- };
33
- description: {
34
- type: import("vue").PropType<string>;
99
+ }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
100
+ $slots: {
101
+ title?(_: {}): any;
102
+ default?(_: {}): any;
35
103
  };
36
- type: {
37
- type: import("vue").PropType<import("./types").TypeComponents>;
38
- };
39
- closable: {
40
- type: import("vue").PropType<boolean>;
41
- };
42
- closeText: {
43
- type: import("vue").PropType<string>;
44
- };
45
- showIcon: {
46
- type: import("vue").PropType<boolean>;
47
- };
48
- center: {
49
- type: import("vue").PropType<boolean>;
50
- };
51
- effect: {
52
- type: import("vue").PropType<import("./types").alertEffects>;
53
- };
54
- }>> & Readonly<{
55
- onClose?: ((evt: MouseEvent) => any) | undefined;
56
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>> & Record<string, any>;
104
+ })> & Record<string, any>;
57
105
  export default VftAlert;