fast-element-plus 1.0.0-alpha.9 → 1.0.1

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 (155) hide show
  1. package/dist/index.full.js +3180 -4581
  2. package/dist/index.full.js.map +1 -1
  3. package/dist/index.full.min.js +5 -5
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +5 -5
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +3180 -4581
  8. package/dist/index.full.mjs.map +1 -1
  9. package/dist/styles/index.css +2 -2
  10. package/es/components/avatar/index.d.ts +1 -1
  11. package/es/components/avatar/index.mjs.map +1 -1
  12. package/es/components/avatar/src/avatar.d.ts +18 -102
  13. package/es/components/avatar/src/avatar.mjs +1 -2
  14. package/es/components/avatar/src/avatar.mjs.map +1 -1
  15. package/es/components/button/index.d.ts +1 -1
  16. package/es/components/button/index.mjs.map +1 -1
  17. package/es/components/button/src/button.d.ts +35 -180
  18. package/es/components/button/src/button.mjs +14 -4
  19. package/es/components/button/src/button.mjs.map +1 -1
  20. package/es/components/carNumber/src/carNumber.d.ts +58 -194
  21. package/es/components/contextMenu/src/contextMenu.mjs +1 -1
  22. package/es/components/contextMenu/src/contextMenu.mjs.map +1 -1
  23. package/es/components/dialog/src/dialog.d.ts +45 -297
  24. package/es/components/drawer/src/drawer.d.ts +72 -450
  25. package/es/components/form/src/form.d.ts +28 -133
  26. package/es/components/form/src/formItem.d.ts +32 -137
  27. package/es/components/iconSelector/src/iconSelector.mjs +2 -2
  28. package/es/components/iconSelector/src/iconSelector.mjs.map +1 -1
  29. package/es/components/image/src/image.d.ts +43 -253
  30. package/es/components/select/src/select.d.ts +25 -81
  31. package/es/components/select/src/select.mjs +1 -0
  32. package/es/components/select/src/select.mjs.map +1 -1
  33. package/es/components/selectPage/src/selectPage.d.ts +19 -61
  34. package/es/components/selectV2/src/selectV2.d.ts +25 -81
  35. package/es/components/selectV2/src/selectV2.mjs +1 -0
  36. package/es/components/selectV2/src/selectV2.mjs.map +1 -1
  37. package/es/components/table/src/table.d.ts +5 -12
  38. package/es/components/table/src/table.mjs +4 -6
  39. package/es/components/table/src/table.mjs.map +1 -1
  40. package/es/components/table/src/table.state.d.ts +1 -1
  41. package/es/components/table/src/table.type.d.ts +4 -1
  42. package/es/components/table/src/table.type.mjs.map +1 -1
  43. package/es/components/table/src/tableColumn.d.ts +1 -1
  44. package/es/components/table/src/tableColumn.mjs +7 -7
  45. package/es/components/table/src/tableColumn.mjs.map +1 -1
  46. package/es/components/table/src/tableSearchForm.d.ts +6 -4
  47. package/es/components/table/src/tableSearchForm.mjs +2 -2
  48. package/es/components/table/src/tableSearchForm.mjs.map +1 -1
  49. package/es/components/table/src/useTable.mjs +3 -3
  50. package/es/components/table/src/useTable.mjs.map +1 -1
  51. package/es/components/tree/src/tree.d.ts +23 -653
  52. package/es/components/tree/src/tree.mjs +1 -1
  53. package/es/components/tree/src/tree.mjs.map +1 -1
  54. package/es/components/tree/src/tree.type.d.ts +1 -1
  55. package/es/components/treeSelect/src/treeSelect.d.ts +20 -62
  56. package/es/components/treeSelect/src/treeSelect.mjs +1 -0
  57. package/es/components/treeSelect/src/treeSelect.mjs.map +1 -1
  58. package/es/components/upload/src/upload.d.ts +298 -460
  59. package/es/components/upload/src/useUpload.mjs +2 -2
  60. package/es/components/upload/src/useUpload.mjs.map +1 -1
  61. package/es/components/uploadImage/src/uploadImage.d.ts +295 -394
  62. package/es/components/uploadImage/src/uploadImage.mjs +1 -1
  63. package/es/components/uploadImage/src/uploadImage.mjs.map +1 -1
  64. package/es/components/uploadImages/src/uploadImages.d.ts +300 -420
  65. package/es/components/uploadImages/src/uploadImages.mjs +4 -4
  66. package/es/components/uploadImages/src/uploadImages.mjs.map +1 -1
  67. package/es/constants/regex.mjs +13 -13
  68. package/es/constants/regex.mjs.map +1 -1
  69. package/es/directive.d.ts +1 -1
  70. package/es/directives/click-copy/index.d.ts +1 -1
  71. package/es/directives/click-debounce/index.d.ts +1 -1
  72. package/es/directives/click-draggable/index.d.ts +1 -1
  73. package/es/directives/click-icon-copy/index.d.ts +1 -1
  74. package/es/directives/click-longpress/index.d.ts +1 -1
  75. package/es/directives/click-throttle/index.d.ts +1 -1
  76. package/es/element-plus.mjs +1 -1
  77. package/es/element-plus.mjs.map +1 -1
  78. package/es/make-installer.mjs +4 -0
  79. package/es/make-installer.mjs.map +1 -1
  80. package/es/version.d.ts +1 -1
  81. package/es/version.mjs +1 -1
  82. package/es/version.mjs.map +1 -1
  83. package/lib/components/avatar/index.d.ts +1 -1
  84. package/lib/components/avatar/index.js.map +1 -1
  85. package/lib/components/avatar/src/avatar.d.ts +18 -102
  86. package/lib/components/avatar/src/avatar.js +1 -1
  87. package/lib/components/avatar/src/avatar.js.map +1 -1
  88. package/lib/components/button/index.d.ts +1 -1
  89. package/lib/components/button/index.js.map +1 -1
  90. package/lib/components/button/src/button.d.ts +35 -180
  91. package/lib/components/button/src/button.js +1 -1
  92. package/lib/components/button/src/button.js.map +1 -1
  93. package/lib/components/carNumber/src/carNumber.d.ts +58 -194
  94. package/lib/components/contextMenu/src/contextMenu.js +1 -1
  95. package/lib/components/contextMenu/src/contextMenu.js.map +1 -1
  96. package/lib/components/dialog/src/dialog.d.ts +45 -297
  97. package/lib/components/drawer/src/drawer.d.ts +72 -450
  98. package/lib/components/form/src/form.d.ts +28 -133
  99. package/lib/components/form/src/formItem.d.ts +32 -137
  100. package/lib/components/image/src/image.d.ts +43 -253
  101. package/lib/components/select/src/select.d.ts +25 -81
  102. package/lib/components/select/src/select.js +1 -1
  103. package/lib/components/select/src/select.js.map +1 -1
  104. package/lib/components/selectPage/src/selectPage.d.ts +19 -61
  105. package/lib/components/selectV2/src/selectV2.d.ts +25 -81
  106. package/lib/components/selectV2/src/selectV2.js +1 -1
  107. package/lib/components/selectV2/src/selectV2.js.map +1 -1
  108. package/lib/components/table/src/table.d.ts +5 -12
  109. package/lib/components/table/src/table.js +1 -1
  110. package/lib/components/table/src/table.js.map +1 -1
  111. package/lib/components/table/src/table.state.d.ts +1 -1
  112. package/lib/components/table/src/table.type.d.ts +4 -1
  113. package/lib/components/table/src/table.type.js.map +1 -1
  114. package/lib/components/table/src/tableColumn.d.ts +1 -1
  115. package/lib/components/table/src/tableColumn.js +1 -1
  116. package/lib/components/table/src/tableColumn.js.map +1 -1
  117. package/lib/components/table/src/tableSearchForm.d.ts +6 -4
  118. package/lib/components/table/src/tableSearchForm.js +1 -1
  119. package/lib/components/table/src/tableSearchForm.js.map +1 -1
  120. package/lib/components/table/src/useTable.js +1 -1
  121. package/lib/components/table/src/useTable.js.map +1 -1
  122. package/lib/components/tree/src/tree.d.ts +23 -653
  123. package/lib/components/tree/src/tree.js +1 -1
  124. package/lib/components/tree/src/tree.js.map +1 -1
  125. package/lib/components/tree/src/tree.type.d.ts +1 -1
  126. package/lib/components/treeSelect/src/treeSelect.d.ts +20 -62
  127. package/lib/components/treeSelect/src/treeSelect.js +1 -1
  128. package/lib/components/treeSelect/src/treeSelect.js.map +1 -1
  129. package/lib/components/upload/src/upload.d.ts +298 -460
  130. package/lib/components/upload/src/useUpload.js +1 -1
  131. package/lib/components/upload/src/useUpload.js.map +1 -1
  132. package/lib/components/uploadImage/src/uploadImage.d.ts +295 -394
  133. package/lib/components/uploadImage/src/uploadImage.js +1 -1
  134. package/lib/components/uploadImage/src/uploadImage.js.map +1 -1
  135. package/lib/components/uploadImages/src/uploadImages.d.ts +300 -420
  136. package/lib/components/uploadImages/src/uploadImages.js +1 -1
  137. package/lib/components/uploadImages/src/uploadImages.js.map +1 -1
  138. package/lib/constants/regex.js +1 -1
  139. package/lib/constants/regex.js.map +1 -1
  140. package/lib/directive.d.ts +1 -1
  141. package/lib/directives/click-copy/index.d.ts +1 -1
  142. package/lib/directives/click-debounce/index.d.ts +1 -1
  143. package/lib/directives/click-draggable/index.d.ts +1 -1
  144. package/lib/directives/click-icon-copy/index.d.ts +1 -1
  145. package/lib/directives/click-longpress/index.d.ts +1 -1
  146. package/lib/directives/click-throttle/index.d.ts +1 -1
  147. package/lib/element-plus.js +1 -1
  148. package/lib/element-plus.js.map +1 -1
  149. package/lib/make-installer.js +1 -1
  150. package/lib/make-installer.js.map +1 -1
  151. package/lib/version.d.ts +1 -1
  152. package/lib/version.js +1 -1
  153. package/lib/version.js.map +1 -1
  154. package/package.json +8 -8
  155. package/styles/components/contextMenu.scss +2 -2
@@ -160,7 +160,7 @@
160
160
  border: none;
161
161
  }
162
162
  .fa-context-menu .el-dropdown-menu .el-dropdown-menu__item {
163
- font-size: var(--el-font-size-extra-small);
163
+ font-size: var(--el-font-size-small);
164
164
  }
165
165
  .fa-context-menu .el-dropdown-menu .el-dropdown-menu__item .fa-icon {
166
166
  margin-right: 5px;
@@ -174,7 +174,7 @@
174
174
  }
175
175
 
176
176
  .fa-context-menu-small .el-dropdown-menu .el-dropdown-menu__item {
177
- font-size: calc(var(--el-font-size-extra-small) - 1px);
177
+ font-size: var(--el-font-size-extra-small);
178
178
  }
179
179
  .fa-context-menu-small .el-dropdown-menu .el-dropdown-menu__item .fa-icon {
180
180
  margin-right: 3px;
@@ -1,4 +1,4 @@
1
- import type { ExtractPropTypes } from "vue";
1
+ import { ExtractPropTypes } from "vue";
2
2
  import { TSXWithInstall } from "@fast-china/utils";
3
3
  import { default as Avatar, faAvatarEmits, faAvatarProps } from "./src/avatar";
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../packages/components/avatar/index.ts"],"sourcesContent":["import type { ExtractPropTypes } from \"vue\";\nimport { withInstall } from \"@fast-china/utils\";\nimport type { faAvatarEmits, faAvatarProps } from \"./src/avatar\";\nimport Avatar from \"./src/avatar\";\n\nexport const FaAvatar = withInstall(Avatar);\nexport default FaAvatar;\n\nexport { faAvatarProps as faAvatarProps, faAvatarEmits as faAvatarEmits };\n\nexport type FaAvatarInstance = InstanceType<typeof Avatar>;\n\nexport type FaAvatarProps = ExtractPropTypes<typeof faAvatarProps>;\n\nexport type FaAvatarEmits = typeof faAvatarEmits;\n"],"names":[],"mappings":";;AAKO,MAAM,WAAW,YAAY,MAAM;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../packages/components/avatar/index.ts"],"sourcesContent":["import { withInstall } from \"@fast-china/utils\";\nimport Avatar from \"./src/avatar\";\nimport type { faAvatarEmits, faAvatarProps } from \"./src/avatar\";\nimport type { ExtractPropTypes } from \"vue\";\n\nexport const FaAvatar = withInstall(Avatar);\nexport default FaAvatar;\n\nexport { faAvatarProps as faAvatarProps, faAvatarEmits as faAvatarEmits };\n\nexport type FaAvatarInstance = InstanceType<typeof Avatar>;\n\nexport type FaAvatarProps = ExtractPropTypes<typeof faAvatarProps>;\n\nexport type FaAvatarEmits = typeof faAvatarEmits;\n"],"names":[],"mappings":";;AAKO,MAAM,WAAW,YAAY,MAAM;"}
@@ -3,7 +3,7 @@ export declare const faAvatarProps: {
3
3
  /** @description representation type to icon, more info on icon component. */
4
4
  icon: {
5
5
  type: import('vue').PropType<string | Component>;
6
- default: () => import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
6
+ default: () => string | Component;
7
7
  };
8
8
  /**
9
9
  * @description 原图
@@ -15,40 +15,12 @@ export declare const faAvatarProps: {
15
15
  small: BooleanConstructor;
16
16
  /** @description 缩略图 */
17
17
  thumb: BooleanConstructor;
18
- size: {
19
- readonly type: import('vue').PropType<number | "" | "small" | "default" | "large">;
20
- readonly required: false;
21
- readonly validator: ((val: unknown) => boolean) | undefined;
22
- __epPropKey: true;
23
- } & {
24
- readonly default: "";
25
- };
26
- shape: {
27
- readonly type: import('vue').PropType<"circle" | "square">;
28
- readonly required: false;
29
- readonly validator: ((val: unknown) => boolean) | undefined;
30
- __epPropKey: true;
31
- } & {
32
- readonly default: "circle";
33
- };
34
- src: {
35
- readonly type: import('vue').PropType<string>;
36
- readonly required: false;
37
- readonly validator: ((val: unknown) => boolean) | undefined;
38
- __epPropKey: true;
39
- } & {
40
- readonly default: "";
41
- };
18
+ size: import('element-plus/es/utils/index.mjs').EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
19
+ shape: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
20
+ src: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
42
21
  alt: StringConstructor;
43
22
  srcSet: StringConstructor;
44
- fit: {
45
- readonly type: import('vue').PropType<any>;
46
- readonly required: false;
47
- readonly validator: ((val: unknown) => boolean) | undefined;
48
- __epPropKey: true;
49
- } & {
50
- readonly default: "cover";
51
- };
23
+ fit: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => ObjectFitProperty) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => ObjectFitProperty))[], unknown, unknown, "cover", boolean>;
52
24
  };
53
25
  export declare const faAvatarEmits: {
54
26
  error: (evt: Event) => boolean;
@@ -63,7 +35,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
63
35
  /** @description representation type to icon, more info on icon component. */
64
36
  icon: {
65
37
  type: import('vue').PropType<string | Component>;
66
- default: () => import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
38
+ default: () => string | Component;
67
39
  };
68
40
  /**
69
41
  * @description 原图
@@ -75,40 +47,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
75
47
  small: BooleanConstructor;
76
48
  /** @description 缩略图 */
77
49
  thumb: BooleanConstructor;
78
- size: {
79
- readonly type: import('vue').PropType<number | "" | "small" | "default" | "large">;
80
- readonly required: false;
81
- readonly validator: ((val: unknown) => boolean) | undefined;
82
- __epPropKey: true;
83
- } & {
84
- readonly default: "";
85
- };
86
- shape: {
87
- readonly type: import('vue').PropType<"circle" | "square">;
88
- readonly required: false;
89
- readonly validator: ((val: unknown) => boolean) | undefined;
90
- __epPropKey: true;
91
- } & {
92
- readonly default: "circle";
93
- };
94
- src: {
95
- readonly type: import('vue').PropType<string>;
96
- readonly required: false;
97
- readonly validator: ((val: unknown) => boolean) | undefined;
98
- __epPropKey: true;
99
- } & {
100
- readonly default: "";
101
- };
50
+ size: import('element-plus/es/utils/index.mjs').EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
51
+ shape: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
52
+ src: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
102
53
  alt: StringConstructor;
103
54
  srcSet: StringConstructor;
104
- fit: {
105
- readonly type: import('vue').PropType<any>;
106
- readonly required: false;
107
- readonly validator: ((val: unknown) => boolean) | undefined;
108
- __epPropKey: true;
109
- } & {
110
- readonly default: "cover";
111
- };
55
+ fit: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => ObjectFitProperty) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => ObjectFitProperty))[], unknown, unknown, "cover", boolean>;
112
56
  }>, {
113
57
  /** @description 图片路径 */
114
58
  src: string;
@@ -118,7 +62,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
118
62
  /** @description representation type to icon, more info on icon component. */
119
63
  icon: {
120
64
  type: import('vue').PropType<string | Component>;
121
- default: () => import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
65
+ default: () => string | Component;
122
66
  };
123
67
  /**
124
68
  * @description 原图
@@ -130,50 +74,22 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
130
74
  small: BooleanConstructor;
131
75
  /** @description 缩略图 */
132
76
  thumb: BooleanConstructor;
133
- size: {
134
- readonly type: import('vue').PropType<number | "" | "small" | "default" | "large">;
135
- readonly required: false;
136
- readonly validator: ((val: unknown) => boolean) | undefined;
137
- __epPropKey: true;
138
- } & {
139
- readonly default: "";
140
- };
141
- shape: {
142
- readonly type: import('vue').PropType<"circle" | "square">;
143
- readonly required: false;
144
- readonly validator: ((val: unknown) => boolean) | undefined;
145
- __epPropKey: true;
146
- } & {
147
- readonly default: "circle";
148
- };
149
- src: {
150
- readonly type: import('vue').PropType<string>;
151
- readonly required: false;
152
- readonly validator: ((val: unknown) => boolean) | undefined;
153
- __epPropKey: true;
154
- } & {
155
- readonly default: "";
156
- };
77
+ size: import('element-plus/es/utils/index.mjs').EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
78
+ shape: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
79
+ src: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
157
80
  alt: StringConstructor;
158
81
  srcSet: StringConstructor;
159
- fit: {
160
- readonly type: import('vue').PropType<any>;
161
- readonly required: false;
162
- readonly validator: ((val: unknown) => boolean) | undefined;
163
- __epPropKey: true;
164
- } & {
165
- readonly default: "cover";
166
- };
82
+ fit: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => ObjectFitProperty) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => ObjectFitProperty))[], unknown, unknown, "cover", boolean>;
167
83
  }>> & Readonly<{
168
84
  onError?: (evt: Event) => any;
169
85
  }>, {
170
86
  small: boolean;
171
- size: number | "" | "small" | "default" | "large";
172
- icon: import('vue').DefineComponent<{}, void, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
87
+ size: import('element-plus/es/utils/index.mjs').EpPropMergeType<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number>;
88
+ icon: string | Component;
173
89
  original: boolean;
174
90
  normal: boolean;
175
91
  thumb: boolean;
176
- shape: "circle" | "square";
92
+ shape: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "circle" | "square", unknown>;
177
93
  src: string;
178
94
  fit: any;
179
95
  }, import('vue').SlotsType<Partial<import('@fast-china/utils').MakeSlots<FaAvatarSlots>>>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -1,13 +1,12 @@
1
1
  import { defineComponent, reactive, computed, createVNode, mergeProps } from "vue";
2
+ import { avatarProps, avatarEmits, ElAvatar } from "element-plus";
2
3
  import { Picture } from "@element-plus/icons-vue";
3
4
  import { definePropType, useProps, useRender, useExpose, makeSlots } from "@fast-china/utils";
4
- import { avatarProps, avatarEmits, ElAvatar } from "element-plus";
5
5
  const faAvatarProps = {
6
6
  ...avatarProps,
7
7
  /** @description representation type to icon, more info on icon component. */
8
8
  icon: {
9
9
  type: definePropType([String, Object, Function]),
10
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
11
10
  default: () => Picture
12
11
  },
13
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.mjs","sources":["../../../../../packages/components/avatar/src/avatar.tsx"],"sourcesContent":["import type { Component } from \"vue\";\nimport { computed, defineComponent, reactive } from \"vue\";\nimport { Picture } from \"@element-plus/icons-vue\";\nimport { definePropType, makeSlots, useExpose, useProps, useRender } from \"@fast-china/utils\";\nimport { ElAvatar, avatarEmits, avatarProps } from \"element-plus\";\n\nexport const faAvatarProps = {\n\t...avatarProps,\n\t/** @description representation type to icon, more info on icon component. */\n\ticon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\t\tdefault: () => Picture,\n\t},\n\t/**\n\t * @description 原图\n\t */\n\toriginal: Boolean,\n\t/** @description 标准 */\n\tnormal: Boolean,\n\t/** @description 小图 */\n\tsmall: Boolean,\n\t/** @description 缩略图 */\n\tthumb: Boolean,\n};\n\nexport const faAvatarEmits = {\n\t...avatarEmits,\n};\n\ntype FaAvatarSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: { src: string };\n};\n\nexport default defineComponent({\n\tname: \"FaAvatar\",\n\tprops: faAvatarProps,\n\temits: faAvatarEmits,\n\tslots: makeSlots<FaAvatarSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tsrc: computed(() => {\n\t\t\t\tif (props.src) {\n\t\t\t\t\tif (props.original) {\n\t\t\t\t\t\treturn props.src;\n\t\t\t\t\t} else if (props.normal) {\n\t\t\t\t\t\treturn `${props.src}@!normal`;\n\t\t\t\t\t} else if (props.small) {\n\t\t\t\t\t\treturn `${props.src}@!small`;\n\t\t\t\t\t} else if (props.thumb) {\n\t\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// 默认使用缩略图\n\t\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t}),\n\t\t});\n\n\t\tconst elAvatarProps = useProps(props, avatarProps, [\"src\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElAvatar {...elAvatarProps.value} class=\"fa-avatar\" src={state.src} onError={(evt: Event) => emit(\"error\", evt)}>\n\t\t\t\t{slots.default && slots.default({ src: state.src })}\n\t\t\t</ElAvatar>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 图片路径 */\n\t\t\tsrc: state.src,\n\t\t});\n\t},\n});\n"],"names":["faAvatarProps","avatarProps","icon","type","definePropType","String","Object","Function","default","Picture","original","Boolean","normal","small","thumb","faAvatarEmits","avatarEmits","name","props","emits","slots","makeSlots","setup","attrs","emit","expose","state","reactive","src","computed","undefined","elAvatarProps","useProps","useRender","_createVNode","ElAvatar","_mergeProps","value","evt","useExpose"],"mappings":";;;;AAMO,MAAMA,gBAAgB;AAAA,EAC5B,GAAGC;AAAAA;AAAAA,EAEHC,MAAM;AAAA,IACLC,MAAMC,eAAmC,CAACC,QAAQC,QAAQC,QAAQ,CAAC;AAAA;AAAA,IAEnEC,SAASA,MAAMC;AAAAA;;;;EAKhBC,UAAUC;AAAAA;AAAAA,EAEVC,QAAQD;AAAAA;AAAAA,EAERE,OAAOF;AAAAA;AAAAA,EAEPG,OAAOH;AACR;AAEO,MAAMI,gBAAgB;AAAA,EAC5B,GAAGC;AACJ;AAOA,MAAA,yCAA+B;AAAA,EAC9BC,MAAM;AAAA,EACNC,OAAOlB;AAAAA,EACPmB,OAAOJ;AAAAA,EACPK,OAAOC,UAAS;AAAA,EAChBC,MAAMJ,OAAO;AAAA,IAAEK;AAAAA,IAAOH;AAAAA,IAAOI;AAAAA,IAAMC;AAAAA,EAAO,GAAG;AAC5C,UAAMC,QAAQC,SAAS;AAAA,MACtBC,KAAKC,SAAS,MAAM;AACnB,YAAIX,MAAMU,KAAK;AACd,cAAIV,MAAMR,UAAU;AACnB,mBAAOQ,MAAMU;AAAAA,UACd,WAAWV,MAAMN,QAAQ;AACxB,mBAAO,GAAGM,MAAMU,GAAG;AAAA,UACpB,WAAWV,MAAML,OAAO;AACvB,mBAAO,GAAGK,MAAMU,GAAG;AAAA,UACpB,WAAWV,MAAMJ,OAAO;AACvB,mBAAO,GAAGI,MAAMU,GAAG;AAAA,UACpB,OAAO;AAEN,mBAAO,GAAGV,MAAMU,GAAG;AAAA,UACpB;AAAA,QACD;AACA,eAAOE;AAAAA,MACR,CAAC;AAAA,IACF,CAAC;AAED,UAAMC,gBAAgBC,SAASd,OAAOjB,aAAa,CAAC,KAAK,CAAC;AAE1DgC,cAAU,MAAAC,YAAAC,UAAAC,WACKL,cAAcM,OAAK;AAAA,MAAA,SAAA;AAAA,MAAA,OAAyBX,MAAME;AAAAA,MAAG,WAAYU,SAAed,KAAK,SAASc,GAAG;AAAA,IAAC,CAAA,GAAA;AAAA,MAAA9B,SAAAA,MAAA,CAC9GY,MAAMZ,WAAWY,MAAMZ,QAAQ;AAAA,QAAEoB,KAAKF,MAAME;AAAAA,MAAI,CAAC,CAAC;AAAA,IAAA,CAAA,CAEpD;AAED,WAAOW,UAAUd,QAAQ;AAAA;AAAA,MAExBG,KAAKF,MAAME;AAAAA,IACZ,CAAC;AAAA,EACF;AACD,CAAC;"}
1
+ {"version":3,"file":"avatar.mjs","sources":["../../../../../packages/components/avatar/src/avatar.tsx"],"sourcesContent":["import { computed, defineComponent, reactive } from \"vue\";\nimport { ElAvatar, avatarEmits, avatarProps } from \"element-plus\";\nimport { Picture } from \"@element-plus/icons-vue\";\nimport { definePropType, makeSlots, useExpose, useProps, useRender } from \"@fast-china/utils\";\nimport type { Component } from \"vue\";\n\nexport const faAvatarProps = {\n\t...avatarProps,\n\t/** @description representation type to icon, more info on icon component. */\n\ticon: {\n\t\ttype: definePropType<string | Component>([String, Object, Function]),\n\t\tdefault: (): string | Component => Picture,\n\t},\n\t/**\n\t * @description 原图\n\t */\n\toriginal: Boolean,\n\t/** @description 标准 */\n\tnormal: Boolean,\n\t/** @description 小图 */\n\tsmall: Boolean,\n\t/** @description 缩略图 */\n\tthumb: Boolean,\n};\n\nexport const faAvatarEmits = {\n\t...avatarEmits,\n};\n\ntype FaAvatarSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: { src: string };\n};\n\nexport default defineComponent({\n\tname: \"FaAvatar\",\n\tprops: faAvatarProps,\n\temits: faAvatarEmits,\n\tslots: makeSlots<FaAvatarSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tsrc: computed(() => {\n\t\t\t\tif (props.src) {\n\t\t\t\t\tif (props.original) {\n\t\t\t\t\t\treturn props.src;\n\t\t\t\t\t} else if (props.normal) {\n\t\t\t\t\t\treturn `${props.src}@!normal`;\n\t\t\t\t\t} else if (props.small) {\n\t\t\t\t\t\treturn `${props.src}@!small`;\n\t\t\t\t\t} else if (props.thumb) {\n\t\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// 默认使用缩略图\n\t\t\t\t\t\treturn `${props.src}@!thumb`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t}),\n\t\t});\n\n\t\tconst elAvatarProps = useProps(props, avatarProps, [\"src\"]);\n\n\t\tuseRender(() => (\n\t\t\t<ElAvatar {...elAvatarProps.value} class=\"fa-avatar\" src={state.src} onError={(evt: Event) => emit(\"error\", evt)}>\n\t\t\t\t{slots.default && slots.default({ src: state.src })}\n\t\t\t</ElAvatar>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 图片路径 */\n\t\t\tsrc: state.src,\n\t\t});\n\t},\n});\n"],"names":["faAvatarProps","avatarProps","icon","type","definePropType","String","Object","Function","default","Picture","original","Boolean","normal","small","thumb","faAvatarEmits","avatarEmits","name","props","emits","slots","makeSlots","setup","attrs","emit","expose","state","reactive","src","computed","undefined","elAvatarProps","useProps","useRender","_createVNode","ElAvatar","_mergeProps","value","evt","useExpose"],"mappings":";;;;AAMO,MAAMA,gBAAgB;AAAA,EAC5B,GAAGC;AAAAA;AAAAA,EAEHC,MAAM;AAAA,IACLC,MAAMC,eAAmC,CAACC,QAAQC,QAAQC,QAAQ,CAAC;AAAA,IACnEC,SAASA,MAA0BC;AAAAA;;;;EAKpCC,UAAUC;AAAAA;AAAAA,EAEVC,QAAQD;AAAAA;AAAAA,EAERE,OAAOF;AAAAA;AAAAA,EAEPG,OAAOH;AACR;AAEO,MAAMI,gBAAgB;AAAA,EAC5B,GAAGC;AACJ;AAOA,MAAA,yCAA+B;AAAA,EAC9BC,MAAM;AAAA,EACNC,OAAOlB;AAAAA,EACPmB,OAAOJ;AAAAA,EACPK,OAAOC,UAAS;AAAA,EAChBC,MAAMJ,OAAO;AAAA,IAAEK;AAAAA,IAAOH;AAAAA,IAAOI;AAAAA,IAAMC;AAAAA,EAAO,GAAG;AAC5C,UAAMC,QAAQC,SAAS;AAAA,MACtBC,KAAKC,SAAS,MAAM;AACnB,YAAIX,MAAMU,KAAK;AACd,cAAIV,MAAMR,UAAU;AACnB,mBAAOQ,MAAMU;AAAAA,UACd,WAAWV,MAAMN,QAAQ;AACxB,mBAAO,GAAGM,MAAMU,GAAG;AAAA,UACpB,WAAWV,MAAML,OAAO;AACvB,mBAAO,GAAGK,MAAMU,GAAG;AAAA,UACpB,WAAWV,MAAMJ,OAAO;AACvB,mBAAO,GAAGI,MAAMU,GAAG;AAAA,UACpB,OAAO;AAEN,mBAAO,GAAGV,MAAMU,GAAG;AAAA,UACpB;AAAA,QACD;AACA,eAAOE;AAAAA,MACR,CAAC;AAAA,IACF,CAAC;AAED,UAAMC,gBAAgBC,SAASd,OAAOjB,aAAa,CAAC,KAAK,CAAC;AAE1DgC,cAAU,MAAAC,YAAAC,UAAAC,WACKL,cAAcM,OAAK;AAAA,MAAA,SAAA;AAAA,MAAA,OAAyBX,MAAME;AAAAA,MAAG,WAAYU,SAAed,KAAK,SAASc,GAAG;AAAA,IAAC,CAAA,GAAA;AAAA,MAAA9B,SAAAA,MAAA,CAC9GY,MAAMZ,WAAWY,MAAMZ,QAAQ;AAAA,QAAEoB,KAAKF,MAAME;AAAAA,MAAI,CAAC,CAAC;AAAA,IAAA,CAAA,CAEpD;AAED,WAAOW,UAAUd,QAAQ;AAAA;AAAA,MAExBG,KAAKF,MAAME;AAAAA,IACZ,CAAC;AAAA,EACF;AACD,CAAC;"}
@@ -1,7 +1,7 @@
1
- import type { ExtractPropTypes } from "vue";
2
1
  import { TSXWithInstall } from "@fast-china/utils";
3
2
  import { default as Button } from "./src/button";
4
3
  import type { faButtonEmits, faButtonProps } from "./src/button";
4
+ import type { ExtractPropTypes } from "vue";
5
5
 
6
6
  export declare const FaButton: TSXWithInstall<typeof Button>;
7
7
  export default Button;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../packages/components/button/index.ts"],"sourcesContent":["import type { ExtractPropTypes } from \"vue\";\nimport { withInstall } from \"@fast-china/utils\";\nimport Button, { faButtonEmits, faButtonProps } from \"./src/button\";\n\nexport const FaButton = withInstall(Button);\nexport default Button;\n\nexport { faButtonProps, faButtonEmits };\n\nexport type FaButtonInstance = InstanceType<typeof Button>;\n\nexport type FaButtonProps = ExtractPropTypes<typeof faButtonProps>;\n\nexport type FaButtonEmits = typeof faButtonEmits;\n"],"names":[],"mappings":";;;AAIO,MAAM,WAAW,YAAY,MAAM;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../packages/components/button/index.ts"],"sourcesContent":["import { withInstall } from \"@fast-china/utils\";\nimport Button, { faButtonEmits, faButtonProps } from \"./src/button\";\nimport type { ExtractPropTypes } from \"vue\";\n\nexport const FaButton = withInstall(Button);\nexport default Button;\n\nexport { faButtonProps, faButtonEmits };\n\nexport type FaButtonInstance = InstanceType<typeof Button>;\n\nexport type FaButtonProps = ExtractPropTypes<typeof faButtonProps>;\n\nexport type FaButtonEmits = typeof faButtonEmits;\n"],"names":[],"mappings":";;;AAIO,MAAM,WAAW,YAAY,MAAM;"}
@@ -11,81 +11,32 @@ export declare const faButtonProps: {
11
11
  /** @description 禁用加载 */
12
12
  disabledLoading: BooleanConstructor;
13
13
  size: {
14
- readonly type: import('vue').PropType<"" | "small" | "default" | "large">;
14
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
15
15
  readonly required: false;
16
16
  readonly validator: ((val: unknown) => boolean) | undefined;
17
17
  __epPropKey: true;
18
18
  };
19
19
  disabled: BooleanConstructor;
20
- type: {
21
- readonly type: import('vue').PropType<"" | "default" | "text" | "primary" | "success" | "warning" | "info" | "danger">;
22
- readonly required: false;
23
- readonly validator: ((val: unknown) => boolean) | undefined;
24
- __epPropKey: true;
25
- } & {
26
- readonly default: "";
27
- };
20
+ type: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "" | "text" | "default" | "primary" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
28
21
  icon: {
29
- readonly type: import('vue').PropType<unknown>;
22
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown>>;
30
23
  readonly required: false;
31
24
  readonly validator: ((val: unknown) => boolean) | undefined;
32
25
  __epPropKey: true;
33
26
  };
34
- nativeType: {
35
- readonly type: import('vue').PropType<"button" | "reset" | "submit">;
36
- readonly required: false;
37
- readonly validator: ((val: unknown) => boolean) | undefined;
38
- __epPropKey: true;
39
- } & {
40
- readonly default: "button";
41
- };
27
+ nativeType: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "button" | "reset" | "submit", unknown, "button", boolean>;
42
28
  loading: BooleanConstructor;
43
- plain: {
44
- readonly type: import('vue').PropType<boolean>;
45
- readonly required: false;
46
- readonly validator: ((val: unknown) => boolean) | undefined;
47
- __epPropKey: true;
48
- } & {
49
- readonly default: undefined;
50
- };
51
- text: {
52
- readonly type: import('vue').PropType<boolean>;
53
- readonly required: false;
54
- readonly validator: ((val: unknown) => boolean) | undefined;
55
- __epPropKey: true;
56
- } & {
57
- readonly default: undefined;
58
- };
29
+ plain: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
30
+ text: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
59
31
  link: BooleanConstructor;
60
32
  bg: BooleanConstructor;
61
33
  autofocus: BooleanConstructor;
62
- round: {
63
- readonly type: import('vue').PropType<boolean>;
64
- readonly required: false;
65
- readonly validator: ((val: unknown) => boolean) | undefined;
66
- __epPropKey: true;
67
- } & {
68
- readonly default: undefined;
69
- };
34
+ round: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
70
35
  circle: BooleanConstructor;
71
36
  color: StringConstructor;
72
37
  dark: BooleanConstructor;
73
- autoInsertSpace: {
74
- readonly type: import('vue').PropType<boolean>;
75
- readonly required: false;
76
- readonly validator: ((val: unknown) => boolean) | undefined;
77
- __epPropKey: true;
78
- } & {
79
- readonly default: undefined;
80
- };
81
- tag: {
82
- readonly type: import('vue').PropType<unknown>;
83
- readonly required: false;
84
- readonly validator: ((val: unknown) => boolean) | undefined;
85
- __epPropKey: true;
86
- } & {
87
- readonly default: "button";
88
- };
38
+ autoInsertSpace: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
39
+ tag: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown, "button", boolean>;
89
40
  };
90
41
  export declare const faButtonEmits: {
91
42
  /**
@@ -114,81 +65,32 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
114
65
  /** @description 禁用加载 */
115
66
  disabledLoading: BooleanConstructor;
116
67
  size: {
117
- readonly type: import('vue').PropType<"" | "small" | "default" | "large">;
68
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
118
69
  readonly required: false;
119
70
  readonly validator: ((val: unknown) => boolean) | undefined;
120
71
  __epPropKey: true;
121
72
  };
122
73
  disabled: BooleanConstructor;
123
- type: {
124
- readonly type: import('vue').PropType<"" | "default" | "text" | "primary" | "success" | "warning" | "info" | "danger">;
125
- readonly required: false;
126
- readonly validator: ((val: unknown) => boolean) | undefined;
127
- __epPropKey: true;
128
- } & {
129
- readonly default: "";
130
- };
74
+ type: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "" | "text" | "default" | "primary" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
131
75
  icon: {
132
- readonly type: import('vue').PropType<unknown>;
76
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown>>;
133
77
  readonly required: false;
134
78
  readonly validator: ((val: unknown) => boolean) | undefined;
135
79
  __epPropKey: true;
136
80
  };
137
- nativeType: {
138
- readonly type: import('vue').PropType<"button" | "reset" | "submit">;
139
- readonly required: false;
140
- readonly validator: ((val: unknown) => boolean) | undefined;
141
- __epPropKey: true;
142
- } & {
143
- readonly default: "button";
144
- };
81
+ nativeType: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "button" | "reset" | "submit", unknown, "button", boolean>;
145
82
  loading: BooleanConstructor;
146
- plain: {
147
- readonly type: import('vue').PropType<boolean>;
148
- readonly required: false;
149
- readonly validator: ((val: unknown) => boolean) | undefined;
150
- __epPropKey: true;
151
- } & {
152
- readonly default: undefined;
153
- };
154
- text: {
155
- readonly type: import('vue').PropType<boolean>;
156
- readonly required: false;
157
- readonly validator: ((val: unknown) => boolean) | undefined;
158
- __epPropKey: true;
159
- } & {
160
- readonly default: undefined;
161
- };
83
+ plain: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
84
+ text: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
162
85
  link: BooleanConstructor;
163
86
  bg: BooleanConstructor;
164
87
  autofocus: BooleanConstructor;
165
- round: {
166
- readonly type: import('vue').PropType<boolean>;
167
- readonly required: false;
168
- readonly validator: ((val: unknown) => boolean) | undefined;
169
- __epPropKey: true;
170
- } & {
171
- readonly default: undefined;
172
- };
88
+ round: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
173
89
  circle: BooleanConstructor;
174
90
  color: StringConstructor;
175
91
  dark: BooleanConstructor;
176
- autoInsertSpace: {
177
- readonly type: import('vue').PropType<boolean>;
178
- readonly required: false;
179
- readonly validator: ((val: unknown) => boolean) | undefined;
180
- __epPropKey: true;
181
- } & {
182
- readonly default: undefined;
183
- };
184
- tag: {
185
- readonly type: import('vue').PropType<unknown>;
186
- readonly required: false;
187
- readonly validator: ((val: unknown) => boolean) | undefined;
188
- __epPropKey: true;
189
- } & {
190
- readonly default: "button";
191
- };
92
+ autoInsertSpace: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
93
+ tag: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown, "button", boolean>;
192
94
  }>, {
193
95
  /** @description 按钮 html 元素 */
194
96
  ref: import('vue').ComputedRef<HTMLButtonElement>;
@@ -202,6 +104,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
202
104
  shouldAddSpace: import('vue').ComputedRef<boolean>;
203
105
  /** @description 加载状态 */
204
106
  loading: import('vue').ComputedRef<boolean>;
107
+ /** @description 按钮加载 */
108
+ doLoading: (loadingFunction: () => void | Promise<void>) => void;
205
109
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
206
110
  /**
207
111
  * @description 点击事件
@@ -220,99 +124,50 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
220
124
  /** @description 禁用加载 */
221
125
  disabledLoading: BooleanConstructor;
222
126
  size: {
223
- readonly type: import('vue').PropType<"" | "small" | "default" | "large">;
127
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
224
128
  readonly required: false;
225
129
  readonly validator: ((val: unknown) => boolean) | undefined;
226
130
  __epPropKey: true;
227
131
  };
228
132
  disabled: BooleanConstructor;
229
- type: {
230
- readonly type: import('vue').PropType<"" | "default" | "text" | "primary" | "success" | "warning" | "info" | "danger">;
231
- readonly required: false;
232
- readonly validator: ((val: unknown) => boolean) | undefined;
233
- __epPropKey: true;
234
- } & {
235
- readonly default: "";
236
- };
133
+ type: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "" | "text" | "default" | "primary" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
237
134
  icon: {
238
- readonly type: import('vue').PropType<unknown>;
239
- readonly required: false;
240
- readonly validator: ((val: unknown) => boolean) | undefined;
241
- __epPropKey: true;
242
- };
243
- nativeType: {
244
- readonly type: import('vue').PropType<"button" | "reset" | "submit">;
135
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown>>;
245
136
  readonly required: false;
246
137
  readonly validator: ((val: unknown) => boolean) | undefined;
247
138
  __epPropKey: true;
248
- } & {
249
- readonly default: "button";
250
139
  };
140
+ nativeType: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "button" | "reset" | "submit", unknown, "button", boolean>;
251
141
  loading: BooleanConstructor;
252
- plain: {
253
- readonly type: import('vue').PropType<boolean>;
254
- readonly required: false;
255
- readonly validator: ((val: unknown) => boolean) | undefined;
256
- __epPropKey: true;
257
- } & {
258
- readonly default: undefined;
259
- };
260
- text: {
261
- readonly type: import('vue').PropType<boolean>;
262
- readonly required: false;
263
- readonly validator: ((val: unknown) => boolean) | undefined;
264
- __epPropKey: true;
265
- } & {
266
- readonly default: undefined;
267
- };
142
+ plain: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
143
+ text: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
268
144
  link: BooleanConstructor;
269
145
  bg: BooleanConstructor;
270
146
  autofocus: BooleanConstructor;
271
- round: {
272
- readonly type: import('vue').PropType<boolean>;
273
- readonly required: false;
274
- readonly validator: ((val: unknown) => boolean) | undefined;
275
- __epPropKey: true;
276
- } & {
277
- readonly default: undefined;
278
- };
147
+ round: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
279
148
  circle: BooleanConstructor;
280
149
  color: StringConstructor;
281
150
  dark: BooleanConstructor;
282
- autoInsertSpace: {
283
- readonly type: import('vue').PropType<boolean>;
284
- readonly required: false;
285
- readonly validator: ((val: unknown) => boolean) | undefined;
286
- __epPropKey: true;
287
- } & {
288
- readonly default: undefined;
289
- };
290
- tag: {
291
- readonly type: import('vue').PropType<unknown>;
292
- readonly required: false;
293
- readonly validator: ((val: unknown) => boolean) | undefined;
294
- __epPropKey: true;
295
- } & {
296
- readonly default: "button";
297
- };
151
+ autoInsertSpace: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
152
+ tag: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown, "button", boolean>;
298
153
  }>> & Readonly<{
299
154
  onClick?: (event: MouseEvent, done?: () => void) => any;
300
155
  }>, {
301
- type: "" | "default" | "text" | "primary" | "success" | "warning" | "info" | "danger";
156
+ type: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "" | "default" | "text" | "primary" | "success" | "warning" | "info" | "danger", unknown>;
302
157
  circle: boolean;
303
158
  link: boolean;
304
- text: boolean;
305
- plain: boolean;
159
+ text: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
160
+ plain: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
306
161
  loading: boolean;
307
162
  loadingIcon: string | Component;
308
163
  disabledLoading: boolean;
309
164
  disabled: boolean;
310
- nativeType: "button" | "reset" | "submit";
165
+ nativeType: import('element-plus/es/utils/index.mjs').EpPropMergeType<StringConstructor, "button" | "reset" | "submit", unknown>;
311
166
  bg: boolean;
312
167
  autofocus: boolean;
313
- round: boolean;
168
+ round: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
314
169
  dark: boolean;
315
- autoInsertSpace: boolean;
170
+ autoInsertSpace: import('element-plus/es/utils/index.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
316
171
  tag: "button";
317
172
  }, import('vue').SlotsType<Partial<import('@fast-china/utils').MakeSlots<FaButtonSlots>>>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
318
173
  export default _default;
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, reactive, ref, watch, createVNode, mergeProps, withModifiers, computed } from "vue";
2
+ import { buttonProps, buttonEmits, ElButton } from "element-plus";
2
3
  import { Eleme } from "@element-plus/icons-vue";
3
4
  import "../../../hooks/index.mjs";
4
- import { definePropType, useProps, useRender, useExpose, makeSlots } from "@fast-china/utils";
5
- import { buttonProps, buttonEmits, ElButton } from "element-plus";
5
+ import { definePropType, execFunction, consoleError, useProps, useRender, useExpose, makeSlots } from "@fast-china/utils";
6
6
  import { isFunction } from "lodash-unified";
7
7
  import { useOverlay } from "../../../hooks/use-overlay/index.mjs";
8
8
  const faButtonProps = {
@@ -24,7 +24,7 @@ const faButtonEmits = {
24
24
  * @description 点击事件
25
25
  * @param done 需要手动隐藏Loading
26
26
  */
27
- // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/explicit-function-return-type
27
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
28
28
  click: (event, done = () => {
29
29
  }) => event instanceof MouseEvent && isFunction(done)
30
30
  };
@@ -51,6 +51,14 @@ const Button = /* @__PURE__ */ defineComponent({
51
51
  state.loading = false;
52
52
  useOverlay.hide();
53
53
  };
54
+ const handleLoading = (loadingFunction) => {
55
+ state.loading = true;
56
+ execFunction(loadingFunction).then().catch((error) => {
57
+ consoleError("FaButton", error);
58
+ }).finally(() => {
59
+ state.loading = false;
60
+ });
61
+ };
54
62
  const handleClick = (event) => {
55
63
  if (props.disabledLoading) {
56
64
  emit("click", event);
@@ -96,7 +104,9 @@ const Button = /* @__PURE__ */ defineComponent({
96
104
  /** @description 是否在两个字符之间插入空格 */
97
105
  shouldAddSpace: computed(() => buttonRef.value?.shouldAddSpace),
98
106
  /** @description 加载状态 */
99
- loading: computed(() => state.loading)
107
+ loading: computed(() => state.loading),
108
+ /** @description 按钮加载 */
109
+ doLoading: handleLoading
100
110
  });
101
111
  }
102
112
  });