fast-element-plus 1.0.0-alpha.0 → 1.0.0

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 (269) hide show
  1. package/package.json +24 -121
  2. package/Fast.png +0 -0
  3. package/LICENSE +0 -201
  4. package/README.md +0 -158
  5. package/README.zh.md +0 -158
  6. package/dist/index.iife.js +0 -2
  7. package/dist/index.iife.js.map +0 -1
  8. package/dist/index.umd.js +0 -2
  9. package/dist/index.umd.js.map +0 -1
  10. package/es/components/icon/index.d.ts +0 -20
  11. package/es/components/icon/index.mjs +0 -9
  12. package/es/components/icon/index.mjs.map +0 -1
  13. package/es/components/icon/src/icon.d.ts +0 -61
  14. package/es/components/icon/src/icon.mjs +0 -81
  15. package/es/components/icon/src/icon.mjs.map +0 -1
  16. package/es/components/index.d.ts +0 -1
  17. package/es/components/index.mjs +0 -5
  18. package/es/components/index.mjs.map +0 -1
  19. package/es/constants/index.d.ts +0 -2
  20. package/es/constants/index.mjs +0 -7
  21. package/es/constants/index.mjs.map +0 -1
  22. package/es/constants/mime.d.ts +0 -61
  23. package/es/constants/mime.mjs +0 -62
  24. package/es/constants/mime.mjs.map +0 -1
  25. package/es/constants/regex.d.ts +0 -78
  26. package/es/constants/regex.mjs +0 -79
  27. package/es/constants/regex.mjs.map +0 -1
  28. package/es/directives/clickCopy/index.d.ts +0 -2
  29. package/es/directives/clickCopy/index.mjs +0 -39
  30. package/es/directives/clickCopy/index.mjs.map +0 -1
  31. package/es/directives/clickDebounce/index.d.ts +0 -2
  32. package/es/directives/clickDebounce/index.mjs +0 -21
  33. package/es/directives/clickDebounce/index.mjs.map +0 -1
  34. package/es/directives/clickDraggable/index.d.ts +0 -2
  35. package/es/directives/clickDraggable/index.mjs +0 -39
  36. package/es/directives/clickDraggable/index.mjs.map +0 -1
  37. package/es/directives/clickIconCopy/index.d.ts +0 -2
  38. package/es/directives/clickIconCopy/index.mjs +0 -57
  39. package/es/directives/clickIconCopy/index.mjs.map +0 -1
  40. package/es/directives/clickLongpress/index.d.ts +0 -2
  41. package/es/directives/clickLongpress/index.mjs +0 -43
  42. package/es/directives/clickLongpress/index.mjs.map +0 -1
  43. package/es/directives/clickThrottle/index.d.ts +0 -2
  44. package/es/directives/clickThrottle/index.mjs +0 -32
  45. package/es/directives/clickThrottle/index.mjs.map +0 -1
  46. package/es/directives/index.d.ts +0 -6
  47. package/es/directives/index.mjs +0 -15
  48. package/es/directives/index.mjs.map +0 -1
  49. package/es/fast-element-plus/component.d.ts +0 -3
  50. package/es/fast-element-plus/component.mjs +0 -6
  51. package/es/fast-element-plus/component.mjs.map +0 -1
  52. package/es/fast-element-plus/directive.d.ts +0 -2
  53. package/es/fast-element-plus/directive.mjs +0 -11
  54. package/es/fast-element-plus/directive.mjs.map +0 -1
  55. package/es/fast-element-plus/element-plus.d.ts +0 -2
  56. package/es/fast-element-plus/element-plus.mjs +0 -113
  57. package/es/fast-element-plus/element-plus.mjs.map +0 -1
  58. package/es/fast-element-plus/fast-element-plus.d.ts +0 -3
  59. package/es/fast-element-plus/fast-element-plus.mjs +0 -12
  60. package/es/fast-element-plus/fast-element-plus.mjs.map +0 -1
  61. package/es/fast-element-plus/make-installer.d.ts +0 -7
  62. package/es/fast-element-plus/make-installer.mjs +0 -30
  63. package/es/fast-element-plus/make-installer.mjs.map +0 -1
  64. package/es/fast-element-plus/version.d.ts +0 -4
  65. package/es/fast-element-plus/version.mjs +0 -5
  66. package/es/fast-element-plus/version.mjs.map +0 -1
  67. package/es/hooks/index.d.ts +0 -2
  68. package/es/hooks/index.mjs +0 -7
  69. package/es/hooks/index.mjs.map +0 -1
  70. package/es/hooks/useLoading/index.d.ts +0 -4
  71. package/es/hooks/useLoading/index.mjs +0 -35
  72. package/es/hooks/useLoading/index.mjs.map +0 -1
  73. package/es/hooks/useOverlay/index.d.ts +0 -4
  74. package/es/hooks/useOverlay/index.mjs +0 -27
  75. package/es/hooks/useOverlay/index.mjs.map +0 -1
  76. package/es/hooks/useScreenFull/index.d.ts +0 -0
  77. package/es/index.d.ts +0 -16
  78. package/es/index.es.d.ts +0 -6
  79. package/es/index.mjs +0 -82
  80. package/es/index.mjs.map +0 -1
  81. package/es/settings/index.d.ts +0 -79
  82. package/es/settings/index.mjs +0 -35
  83. package/es/settings/index.mjs.map +0 -1
  84. package/es/stores/index.d.ts +0 -4
  85. package/es/stores/index.mjs +0 -7
  86. package/es/stores/index.mjs.map +0 -1
  87. package/es/utils/base64.d.ts +0 -10
  88. package/es/utils/base64.mjs +0 -106
  89. package/es/utils/base64.mjs.map +0 -1
  90. package/es/utils/click.d.ts +0 -14
  91. package/es/utils/click.mjs +0 -35
  92. package/es/utils/click.mjs.map +0 -1
  93. package/es/utils/color.d.ts +0 -31
  94. package/es/utils/color.mjs +0 -73
  95. package/es/utils/color.mjs.map +0 -1
  96. package/es/utils/console.d.ts +0 -21
  97. package/es/utils/console.mjs +0 -19
  98. package/es/utils/console.mjs.map +0 -1
  99. package/es/utils/deviceId.d.ts +0 -9
  100. package/es/utils/deviceId.mjs +0 -27
  101. package/es/utils/deviceId.mjs.map +0 -1
  102. package/es/utils/errorHandler.d.ts +0 -4
  103. package/es/utils/errorHandler.mjs +0 -42
  104. package/es/utils/errorHandler.mjs.map +0 -1
  105. package/es/utils/form.d.ts +0 -78
  106. package/es/utils/form.mjs +0 -218
  107. package/es/utils/form.mjs.map +0 -1
  108. package/es/utils/index.d.ts +0 -10
  109. package/es/utils/index.mjs +0 -29
  110. package/es/utils/index.mjs.map +0 -1
  111. package/es/utils/storage.d.ts +0 -79
  112. package/es/utils/storage.mjs +0 -219
  113. package/es/utils/storage.mjs.map +0 -1
  114. package/es/utils/string.d.ts +0 -33
  115. package/es/utils/string.mjs +0 -119
  116. package/es/utils/string.mjs.map +0 -1
  117. package/es/utils/vue/func.d.ts +0 -7
  118. package/es/utils/vue/func.mjs +0 -17
  119. package/es/utils/vue/func.mjs.map +0 -1
  120. package/es/utils/vue/index.d.ts +0 -6
  121. package/es/utils/vue/index.mjs +0 -17
  122. package/es/utils/vue/index.mjs.map +0 -1
  123. package/es/utils/vue/install.d.ts +0 -5
  124. package/es/utils/vue/install.mjs +0 -31
  125. package/es/utils/vue/install.mjs.map +0 -1
  126. package/es/utils/vue/props.d.ts +0 -10
  127. package/es/utils/vue/props.mjs +0 -14
  128. package/es/utils/vue/props.mjs.map +0 -1
  129. package/es/utils/vue/slots.d.ts +0 -11
  130. package/es/utils/vue/slots.mjs +0 -7
  131. package/es/utils/vue/slots.mjs.map +0 -1
  132. package/es/utils/vue/useRender.d.ts +0 -7
  133. package/es/utils/vue/useRender.mjs +0 -12
  134. package/es/utils/vue/useRender.mjs.map +0 -1
  135. package/es/utils/vue/with.d.ts +0 -6
  136. package/es/utils/vue/with.mjs +0 -7
  137. package/es/utils/vue/with.mjs.map +0 -1
  138. package/global.d.ts +0 -3
  139. package/lib/components/icon/index.d.ts +0 -20
  140. package/lib/components/icon/index.js +0 -2
  141. package/lib/components/icon/index.js.map +0 -1
  142. package/lib/components/icon/src/icon.d.ts +0 -61
  143. package/lib/components/icon/src/icon.js +0 -2
  144. package/lib/components/icon/src/icon.js.map +0 -1
  145. package/lib/components/index.d.ts +0 -1
  146. package/lib/components/index.js +0 -2
  147. package/lib/components/index.js.map +0 -1
  148. package/lib/constants/index.d.ts +0 -2
  149. package/lib/constants/index.js +0 -2
  150. package/lib/constants/index.js.map +0 -1
  151. package/lib/constants/mime.d.ts +0 -61
  152. package/lib/constants/mime.js +0 -2
  153. package/lib/constants/mime.js.map +0 -1
  154. package/lib/constants/regex.d.ts +0 -78
  155. package/lib/constants/regex.js +0 -2
  156. package/lib/constants/regex.js.map +0 -1
  157. package/lib/directives/clickCopy/index.d.ts +0 -2
  158. package/lib/directives/clickCopy/index.js +0 -2
  159. package/lib/directives/clickCopy/index.js.map +0 -1
  160. package/lib/directives/clickDebounce/index.d.ts +0 -2
  161. package/lib/directives/clickDebounce/index.js +0 -2
  162. package/lib/directives/clickDebounce/index.js.map +0 -1
  163. package/lib/directives/clickDraggable/index.d.ts +0 -2
  164. package/lib/directives/clickDraggable/index.js +0 -2
  165. package/lib/directives/clickDraggable/index.js.map +0 -1
  166. package/lib/directives/clickIconCopy/index.d.ts +0 -2
  167. package/lib/directives/clickIconCopy/index.js +0 -2
  168. package/lib/directives/clickIconCopy/index.js.map +0 -1
  169. package/lib/directives/clickLongpress/index.d.ts +0 -2
  170. package/lib/directives/clickLongpress/index.js +0 -2
  171. package/lib/directives/clickLongpress/index.js.map +0 -1
  172. package/lib/directives/clickThrottle/index.d.ts +0 -2
  173. package/lib/directives/clickThrottle/index.js +0 -2
  174. package/lib/directives/clickThrottle/index.js.map +0 -1
  175. package/lib/directives/index.d.ts +0 -6
  176. package/lib/directives/index.js +0 -2
  177. package/lib/directives/index.js.map +0 -1
  178. package/lib/fast-element-plus/component.d.ts +0 -3
  179. package/lib/fast-element-plus/component.js +0 -2
  180. package/lib/fast-element-plus/component.js.map +0 -1
  181. package/lib/fast-element-plus/directive.d.ts +0 -2
  182. package/lib/fast-element-plus/directive.js +0 -2
  183. package/lib/fast-element-plus/directive.js.map +0 -1
  184. package/lib/fast-element-plus/element-plus.d.ts +0 -2
  185. package/lib/fast-element-plus/element-plus.js +0 -2
  186. package/lib/fast-element-plus/element-plus.js.map +0 -1
  187. package/lib/fast-element-plus/fast-element-plus.d.ts +0 -3
  188. package/lib/fast-element-plus/fast-element-plus.js +0 -2
  189. package/lib/fast-element-plus/fast-element-plus.js.map +0 -1
  190. package/lib/fast-element-plus/make-installer.d.ts +0 -7
  191. package/lib/fast-element-plus/make-installer.js +0 -2
  192. package/lib/fast-element-plus/make-installer.js.map +0 -1
  193. package/lib/fast-element-plus/version.d.ts +0 -4
  194. package/lib/fast-element-plus/version.js +0 -2
  195. package/lib/fast-element-plus/version.js.map +0 -1
  196. package/lib/hooks/index.d.ts +0 -2
  197. package/lib/hooks/index.js +0 -2
  198. package/lib/hooks/index.js.map +0 -1
  199. package/lib/hooks/useLoading/index.d.ts +0 -4
  200. package/lib/hooks/useLoading/index.js +0 -2
  201. package/lib/hooks/useLoading/index.js.map +0 -1
  202. package/lib/hooks/useOverlay/index.d.ts +0 -4
  203. package/lib/hooks/useOverlay/index.js +0 -2
  204. package/lib/hooks/useOverlay/index.js.map +0 -1
  205. package/lib/hooks/useScreenFull/index.d.ts +0 -0
  206. package/lib/index.d.ts +0 -16
  207. package/lib/index.es.d.ts +0 -6
  208. package/lib/index.js +0 -2
  209. package/lib/index.js.map +0 -1
  210. package/lib/settings/index.d.ts +0 -79
  211. package/lib/settings/index.js +0 -2
  212. package/lib/settings/index.js.map +0 -1
  213. package/lib/stores/index.d.ts +0 -4
  214. package/lib/stores/index.js +0 -2
  215. package/lib/stores/index.js.map +0 -1
  216. package/lib/utils/base64.d.ts +0 -10
  217. package/lib/utils/base64.js +0 -2
  218. package/lib/utils/base64.js.map +0 -1
  219. package/lib/utils/click.d.ts +0 -14
  220. package/lib/utils/click.js +0 -2
  221. package/lib/utils/click.js.map +0 -1
  222. package/lib/utils/color.d.ts +0 -31
  223. package/lib/utils/color.js +0 -2
  224. package/lib/utils/color.js.map +0 -1
  225. package/lib/utils/console.d.ts +0 -21
  226. package/lib/utils/console.js +0 -2
  227. package/lib/utils/console.js.map +0 -1
  228. package/lib/utils/deviceId.d.ts +0 -9
  229. package/lib/utils/deviceId.js +0 -2
  230. package/lib/utils/deviceId.js.map +0 -1
  231. package/lib/utils/errorHandler.d.ts +0 -4
  232. package/lib/utils/errorHandler.js +0 -2
  233. package/lib/utils/errorHandler.js.map +0 -1
  234. package/lib/utils/form.d.ts +0 -78
  235. package/lib/utils/form.js +0 -2
  236. package/lib/utils/form.js.map +0 -1
  237. package/lib/utils/index.d.ts +0 -10
  238. package/lib/utils/index.js +0 -2
  239. package/lib/utils/index.js.map +0 -1
  240. package/lib/utils/storage.d.ts +0 -79
  241. package/lib/utils/storage.js +0 -2
  242. package/lib/utils/storage.js.map +0 -1
  243. package/lib/utils/string.d.ts +0 -33
  244. package/lib/utils/string.js +0 -2
  245. package/lib/utils/string.js.map +0 -1
  246. package/lib/utils/vue/func.d.ts +0 -7
  247. package/lib/utils/vue/func.js +0 -2
  248. package/lib/utils/vue/func.js.map +0 -1
  249. package/lib/utils/vue/index.d.ts +0 -6
  250. package/lib/utils/vue/index.js +0 -2
  251. package/lib/utils/vue/index.js.map +0 -1
  252. package/lib/utils/vue/install.d.ts +0 -5
  253. package/lib/utils/vue/install.js +0 -2
  254. package/lib/utils/vue/install.js.map +0 -1
  255. package/lib/utils/vue/props.d.ts +0 -10
  256. package/lib/utils/vue/props.js +0 -2
  257. package/lib/utils/vue/props.js.map +0 -1
  258. package/lib/utils/vue/slots.d.ts +0 -11
  259. package/lib/utils/vue/slots.js +0 -2
  260. package/lib/utils/vue/slots.js.map +0 -1
  261. package/lib/utils/vue/useRender.d.ts +0 -7
  262. package/lib/utils/vue/useRender.js +0 -2
  263. package/lib/utils/vue/useRender.js.map +0 -1
  264. package/lib/utils/vue/with.d.ts +0 -6
  265. package/lib/utils/vue/with.js +0 -2
  266. package/lib/utils/vue/with.js.map +0 -1
  267. package/types/env.d.ts +0 -45
  268. package/types/runtime-core.d.ts +0 -52
  269. package/types/shims-vue.d.ts +0 -20
@@ -1,57 +0,0 @@
1
- import { h, render } from "vue";
2
- import { CopyDocument } from "@element-plus/icons-vue";
3
- import "../../utils/index.mjs";
4
- import { ElMessage, ElIcon } from "element-plus";
5
- import { stringUtil } from "../../utils/string.mjs";
6
- import { consoleError } from "../../utils/console.mjs";
7
- import { withInstallDirective } from "../../utils/vue/install.mjs";
8
- const IconCopyDirective = {
9
- mounted(el, binding) {
10
- el.copyData = binding.value;
11
- if (!el.copyData) return;
12
- const handleCopyClick = async () => {
13
- try {
14
- await stringUtil.copy(String(el.copyData));
15
- ElMessage({
16
- type: "success",
17
- message: "复制成功"
18
- });
19
- } catch (error) {
20
- ElMessage({
21
- type: "error",
22
- message: "复制失败"
23
- });
24
- consoleError("CopyDirective", "复制失败", error);
25
- }
26
- };
27
- const iconEl = h(
28
- ElIcon,
29
- {
30
- class: "fa-icon-CopyDocument",
31
- title: "复制",
32
- onClick: handleCopyClick
33
- },
34
- {
35
- default: () => h(CopyDocument)
36
- }
37
- );
38
- const tempDiv = document.createElement("div");
39
- render(iconEl, tempDiv);
40
- el.__iconElement__ = tempDiv.firstChild;
41
- el.parentElement.insertBefore(tempDiv.firstChild, el);
42
- },
43
- updated(el, binding) {
44
- el.copyData = binding.value;
45
- },
46
- beforeUnmount(el) {
47
- if (el.__iconElement__) {
48
- el.parentElement.removeChild(el.__iconElement__);
49
- }
50
- }
51
- };
52
- const vIconCopy = withInstallDirective(IconCopyDirective, "iconCopy");
53
- export {
54
- vIconCopy as default,
55
- vIconCopy
56
- };
57
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../packages/directives/clickIconCopy/index.ts"],"sourcesContent":["/**\n * v-iconCopy\n * 左侧插入复制图标,复制某个值至剪贴板\n * 接收参数:string类型/Ref<string>类型/Reactive<string>类型\n */\nimport { type Directive, type DirectiveBinding, h, render } from \"vue\";\nimport { CopyDocument } from \"@element-plus/icons-vue\";\nimport { consoleError, stringUtil, withInstallDirective } from \"@fast-element-plus/utils\";\nimport { ElIcon, ElMessage } from \"element-plus\";\n\ninterface ElType extends HTMLElement {\n\tcopyData: string | number;\n\t__iconElement__: Node;\n}\n\nconst IconCopyDirective: Directive = {\n\tmounted(el: ElType, binding: DirectiveBinding) {\n\t\tel.copyData = binding.value;\n\n\t\tif (!el.copyData) return;\n\n\t\tconst handleCopyClick = async (): Promise<void> => {\n\t\t\ttry {\n\t\t\t\tawait stringUtil.copy(String(el.copyData));\n\t\t\t\tElMessage({\n\t\t\t\t\ttype: \"success\",\n\t\t\t\t\tmessage: \"复制成功\",\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tElMessage({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\tmessage: \"复制失败\",\n\t\t\t\t});\n\t\t\t\tconsoleError(\"CopyDirective\", \"复制失败\", error);\n\t\t\t}\n\t\t};\n\n\t\t// 创建 ELIcon 组件\n\t\tconst iconEl = h(\n\t\t\tElIcon,\n\t\t\t{\n\t\t\t\tclass: \"fa-icon-CopyDocument\",\n\t\t\t\ttitle: \"复制\",\n\t\t\t\tonClick: handleCopyClick,\n\t\t\t},\n\t\t\t{\n\t\t\t\tdefault: () => h(CopyDocument),\n\t\t\t}\n\t\t);\n\n\t\tconst tempDiv = document.createElement(\"div\");\n\t\trender(iconEl, tempDiv);\n\n\t\tel.__iconElement__ = tempDiv.firstChild;\n\t\tel.parentElement.insertBefore(tempDiv.firstChild, el);\n\t},\n\tupdated(el: ElType, binding: DirectiveBinding) {\n\t\tel.copyData = binding.value;\n\t},\n\tbeforeUnmount(el: ElType) {\n\t\tif (el.__iconElement__) {\n\t\t\tel.parentElement.removeChild(el.__iconElement__);\n\t\t}\n\t},\n};\n\nexport const vIconCopy = withInstallDirective(IconCopyDirective, \"iconCopy\");\nexport default vIconCopy;\n"],"names":[],"mappings":";;;;;;;AAeA,MAAM,oBAA+B;AAAA,EACpC,QAAQ,IAAY,SAA2B;AAC9C,OAAG,WAAW,QAAQ;AAElB,QAAA,CAAC,GAAG,SAAU;AAElB,UAAM,kBAAkB,YAA2B;AAC9C,UAAA;AACH,cAAM,WAAW,KAAK,OAAO,GAAG,QAAQ,CAAC;AAC/B,kBAAA;AAAA,UACT,MAAM;AAAA,UACN,SAAS;AAAA,QAAA,CACT;AAAA,eACO,OAAO;AACL,kBAAA;AAAA,UACT,MAAM;AAAA,UACN,SAAS;AAAA,QAAA,CACT;AACY,qBAAA,iBAAiB,QAAQ,KAAK;AAAA,MAC5C;AAAA,IAAA;AAID,UAAM,SAAS;AAAA,MACd;AAAA,MACA;AAAA,QACC,OAAO;AAAA,QACP,OAAO;AAAA,QACP,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,SAAS,MAAM,EAAE,YAAY;AAAA,MAC9B;AAAA,IAAA;AAGK,UAAA,UAAU,SAAS,cAAc,KAAK;AAC5C,WAAO,QAAQ,OAAO;AAEtB,OAAG,kBAAkB,QAAQ;AAC7B,OAAG,cAAc,aAAa,QAAQ,YAAY,EAAE;AAAA,EACrD;AAAA,EACA,QAAQ,IAAY,SAA2B;AAC9C,OAAG,WAAW,QAAQ;AAAA,EACvB;AAAA,EACA,cAAc,IAAY;AACzB,QAAI,GAAG,iBAAiB;AACpB,SAAA,cAAc,YAAY,GAAG,eAAe;AAAA,IAChD;AAAA,EACD;AACD;AAEa,MAAA,YAAY,qBAAqB,mBAAmB,UAAU;"}
@@ -1,2 +0,0 @@
1
- export declare const vLongpress: import('../../utils').TSXWithInstall<import('vue').ObjectDirective<any, any, string, string>>;
2
- export default vLongpress;
@@ -1,43 +0,0 @@
1
- import "../../utils/index.mjs";
2
- import { withInstallDirective } from "../../utils/vue/install.mjs";
3
- const LongpressDirective = {
4
- mounted(el, binding) {
5
- if (typeof binding.value !== "function") {
6
- throw "callback must be a function";
7
- }
8
- const handler = (e) => {
9
- binding.value(e);
10
- };
11
- let pressTimer = null;
12
- const start = (e) => {
13
- if (e.button) {
14
- if (e.type === "click" && e.button !== 0) {
15
- return;
16
- }
17
- }
18
- if (pressTimer === null) {
19
- pressTimer = setTimeout(() => {
20
- handler(e);
21
- }, 1e3);
22
- }
23
- };
24
- const cancel = () => {
25
- if (pressTimer !== null) {
26
- clearTimeout(pressTimer);
27
- pressTimer = null;
28
- }
29
- };
30
- el.addEventListener("mousedown", start);
31
- el.addEventListener("touchstart", start);
32
- el.addEventListener("click", cancel);
33
- el.addEventListener("mouseout", cancel);
34
- el.addEventListener("touchend", cancel);
35
- el.addEventListener("touchcancel", cancel);
36
- }
37
- };
38
- const vLongpress = withInstallDirective(LongpressDirective, "longpress");
39
- export {
40
- vLongpress as default,
41
- vLongpress
42
- };
43
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../packages/directives/clickLongpress/index.ts"],"sourcesContent":["/**\n * v-longpress\n * 长按指令,长按时触发事件\n */\nimport type { Directive, DirectiveBinding } from \"vue\";\nimport { withInstallDirective } from \"@fast-element-plus/utils\";\n\nconst LongpressDirective: Directive = {\n\tmounted(el: HTMLElement, binding: DirectiveBinding) {\n\t\tif (typeof binding.value !== \"function\") {\n\t\t\tthrow \"callback must be a function\";\n\t\t}\n\n\t\t// 运行函数\n\t\tconst handler = (e: MouseEvent | TouchEvent): void => {\n\t\t\tbinding.value(e);\n\t\t};\n\n\t\t// 定义变量\n\t\tlet pressTimer: any = null;\n\t\t// 创建计时器( 2秒后执行函数 )\n\t\tconst start = (e: any): void => {\n\t\t\tif (e.button) {\n\t\t\t\tif (e.type === \"click\" && e.button !== 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pressTimer === null) {\n\t\t\t\tpressTimer = setTimeout(() => {\n\t\t\t\t\thandler(e);\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t};\n\t\t// 取消计时器\n\t\tconst cancel = (): void => {\n\t\t\tif (pressTimer !== null) {\n\t\t\t\tclearTimeout(pressTimer);\n\t\t\t\tpressTimer = null;\n\t\t\t}\n\t\t};\n\t\t// 添加事件监听器\n\t\tel.addEventListener(\"mousedown\", start);\n\t\tel.addEventListener(\"touchstart\", start);\n\t\t// 取消计时器\n\t\tel.addEventListener(\"click\", cancel);\n\t\tel.addEventListener(\"mouseout\", cancel);\n\t\tel.addEventListener(\"touchend\", cancel);\n\t\tel.addEventListener(\"touchcancel\", cancel);\n\t},\n};\n\nexport const vLongpress = withInstallDirective(LongpressDirective, \"longpress\");\nexport default vLongpress;\n"],"names":[],"mappings":";;AAOA,MAAM,qBAAgC;AAAA,EACrC,QAAQ,IAAiB,SAA2B;AAC/C,QAAA,OAAO,QAAQ,UAAU,YAAY;AAClC,YAAA;AAAA,IACP;AAGM,UAAA,UAAU,CAAC,MAAqC;AACrD,cAAQ,MAAM,CAAC;AAAA,IAAA;AAIhB,QAAI,aAAkB;AAEhB,UAAA,QAAQ,CAAC,MAAiB;AAC/B,UAAI,EAAE,QAAQ;AACb,YAAI,EAAE,SAAS,WAAW,EAAE,WAAW,GAAG;AACzC;AAAA,QACD;AAAA,MACD;AACA,UAAI,eAAe,MAAM;AACxB,qBAAa,WAAW,MAAM;AAC7B,kBAAQ,CAAC;AAAA,WACP,GAAI;AAAA,MACR;AAAA,IAAA;AAGD,UAAM,SAAS,MAAY;AAC1B,UAAI,eAAe,MAAM;AACxB,qBAAa,UAAU;AACV,qBAAA;AAAA,MACd;AAAA,IAAA;AAGE,OAAA,iBAAiB,aAAa,KAAK;AACnC,OAAA,iBAAiB,cAAc,KAAK;AAEpC,OAAA,iBAAiB,SAAS,MAAM;AAChC,OAAA,iBAAiB,YAAY,MAAM;AACnC,OAAA,iBAAiB,YAAY,MAAM;AACnC,OAAA,iBAAiB,eAAe,MAAM;AAAA,EAC1C;AACD;AAEa,MAAA,aAAa,qBAAqB,oBAAoB,WAAW;"}
@@ -1,2 +0,0 @@
1
- export declare const vThrottle: import('../../utils').TSXWithInstall<import('vue').ObjectDirective<any, any, string, string>>;
2
- export default vThrottle;
@@ -1,32 +0,0 @@
1
- import "../../utils/index.mjs";
2
- import { withInstallDirective } from "../../utils/vue/install.mjs";
3
- const ThrottleDirective = {
4
- mounted(el, binding) {
5
- if (typeof binding.value !== "function") {
6
- throw "callback must be a function";
7
- }
8
- let timer = null;
9
- el.__handleClick__ = () => {
10
- if (timer) {
11
- clearTimeout(timer);
12
- }
13
- if (!el.disabled) {
14
- el.disabled = true;
15
- binding.value();
16
- timer = setTimeout(() => {
17
- el.disabled = false;
18
- }, 1e3);
19
- }
20
- };
21
- el.addEventListener("click", el.__handleClick__);
22
- },
23
- beforeUnmount(el) {
24
- el.removeEventListener("click", el.__handleClick__);
25
- }
26
- };
27
- const vThrottle = withInstallDirective(ThrottleDirective, "throttle");
28
- export {
29
- vThrottle as default,
30
- vThrottle
31
- };
32
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../packages/directives/clickThrottle/index.ts"],"sourcesContent":["/*\n 需求:防止按钮在短时间内被多次点击,使用节流函数限制规定时间内只能点击一次。\n\n 思路:\n 1、第一次点击,立即调用方法并禁用按钮,等延迟结束再次激活按钮\n 2、将需要触发的方法绑定在指令上\n\n 使用:给 Dom 加上 v-throttle 及回调函数即可\n <button v-throttle=\"debounceClick\">节流提交</button>\n*/\nimport type { Directive, DirectiveBinding } from \"vue\";\nimport { withInstallDirective } from \"@fast-element-plus/utils\";\n\ninterface ElType extends HTMLElement {\n\t__handleClick__: () => any;\n\tdisabled: boolean;\n}\n\nconst ThrottleDirective: Directive = {\n\tmounted(el: ElType, binding: DirectiveBinding) {\n\t\tif (typeof binding.value !== \"function\") {\n\t\t\tthrow \"callback must be a function\";\n\t\t}\n\t\tlet timer: NodeJS.Timeout | null = null;\n\t\tel.__handleClick__ = (): void => {\n\t\t\tif (timer) {\n\t\t\t\tclearTimeout(timer);\n\t\t\t}\n\t\t\tif (!el.disabled) {\n\t\t\t\tel.disabled = true;\n\t\t\t\tbinding.value();\n\t\t\t\ttimer = setTimeout(() => {\n\t\t\t\t\tel.disabled = false;\n\t\t\t\t}, 1000);\n\t\t\t}\n\t\t};\n\t\tel.addEventListener(\"click\", el.__handleClick__);\n\t},\n\tbeforeUnmount(el: ElType) {\n\t\tel.removeEventListener(\"click\", el.__handleClick__);\n\t},\n};\n\nexport const vThrottle = withInstallDirective(ThrottleDirective, \"throttle\");\nexport default vThrottle;\n"],"names":[],"mappings":";;AAkBA,MAAM,oBAA+B;AAAA,EACpC,QAAQ,IAAY,SAA2B;AAC1C,QAAA,OAAO,QAAQ,UAAU,YAAY;AAClC,YAAA;AAAA,IACP;AACA,QAAI,QAA+B;AACnC,OAAG,kBAAkB,MAAY;AAChC,UAAI,OAAO;AACV,qBAAa,KAAK;AAAA,MACnB;AACI,UAAA,CAAC,GAAG,UAAU;AACjB,WAAG,WAAW;AACd,gBAAQ,MAAM;AACd,gBAAQ,WAAW,MAAM;AACxB,aAAG,WAAW;AAAA,WACZ,GAAI;AAAA,MACR;AAAA,IAAA;AAEE,OAAA,iBAAiB,SAAS,GAAG,eAAe;AAAA,EAChD;AAAA,EACA,cAAc,IAAY;AACtB,OAAA,oBAAoB,SAAS,GAAG,eAAe;AAAA,EACnD;AACD;AAEa,MAAA,YAAY,qBAAqB,mBAAmB,UAAU;"}
@@ -1,6 +0,0 @@
1
- export * from './clickCopy';
2
- export * from './clickDebounce';
3
- export * from './clickDraggable';
4
- export * from './clickIconCopy';
5
- export * from './clickLongpress';
6
- export * from './clickThrottle';
@@ -1,15 +0,0 @@
1
- import { vCopy } from "./clickCopy/index.mjs";
2
- import { vDebounce } from "./clickDebounce/index.mjs";
3
- import { vDraggable } from "./clickDraggable/index.mjs";
4
- import { vIconCopy } from "./clickIconCopy/index.mjs";
5
- import { vLongpress } from "./clickLongpress/index.mjs";
6
- import { vThrottle } from "./clickThrottle/index.mjs";
7
- export {
8
- vCopy,
9
- vDebounce,
10
- vDraggable,
11
- vIconCopy,
12
- vLongpress,
13
- vThrottle
14
- };
15
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,3 +0,0 @@
1
- import { Plugin } from 'vue';
2
- declare const _default: Plugin[];
3
- export default _default;
@@ -1,6 +0,0 @@
1
- import { FaIcon } from "../components/icon/index.mjs";
2
- const FastElementPlusComponents = [FaIcon];
3
- export {
4
- FastElementPlusComponents as default
5
- };
6
- //# sourceMappingURL=component.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.mjs","sources":["../../../packages/fast-element-plus/component.ts"],"sourcesContent":["import type { Plugin } from \"vue\";\nimport { FaIcon } from \"@fast-element-plus/components/icon\";\n\nexport default [FaIcon] as Plugin[];\n"],"names":[],"mappings":";AAGA,MAAe,4BAAA,CAAC,MAAM;"}
@@ -1,2 +0,0 @@
1
- declare const _default: import('..').TSXWithInstall<import('vue').ObjectDirective<any, any, string, string>>[];
2
- export default _default;
@@ -1,11 +0,0 @@
1
- import { vCopy } from "../directives/clickCopy/index.mjs";
2
- import { vDebounce } from "../directives/clickDebounce/index.mjs";
3
- import { vDraggable } from "../directives/clickDraggable/index.mjs";
4
- import { vIconCopy } from "../directives/clickIconCopy/index.mjs";
5
- import { vLongpress } from "../directives/clickLongpress/index.mjs";
6
- import { vThrottle } from "../directives/clickThrottle/index.mjs";
7
- const FastElementPlusDirectives = [vCopy, vDebounce, vDraggable, vIconCopy, vLongpress, vThrottle];
8
- export {
9
- FastElementPlusDirectives as default
10
- };
11
- //# sourceMappingURL=directive.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"directive.mjs","sources":["../../../packages/fast-element-plus/directive.ts"],"sourcesContent":["import { vCopy } from \"@fast-element-plus/directives/clickCopy\";\nimport { vDebounce } from \"@fast-element-plus/directives/clickDebounce\";\nimport { vDraggable } from \"@fast-element-plus/directives/clickDraggable\";\nimport { vIconCopy } from \"@fast-element-plus/directives/clickIconCopy\";\nimport { vLongpress } from \"@fast-element-plus/directives/clickLongpress\";\nimport { vThrottle } from \"@fast-element-plus/directives/clickThrottle\";\n\nexport default [vCopy, vDebounce, vDraggable, vIconCopy, vLongpress, vThrottle];\n"],"names":[],"mappings":";;;;;;AAOA,MAAA,4BAAe,CAAC,OAAO,WAAW,YAAY,WAAW,YAAY,SAAS;"}
@@ -1,2 +0,0 @@
1
- import { App } from 'vue';
2
- export declare const installElementPlus: (app: App) => void;
@@ -1,113 +0,0 @@
1
- import * as ElementPlusIconsVue from "@element-plus/icons-vue";
2
- import "../hooks/index.mjs";
3
- import "../utils/index.mjs";
4
- import ElementPlus, { ElDialog, ElInput, ElMessageBox } from "element-plus";
5
- import { useOverlay } from "../hooks/useOverlay/index.mjs";
6
- import { execAsyncFunction } from "../utils/vue/func.mjs";
7
- import { consoleError } from "../utils/console.mjs";
8
- import { errorHandler } from "../utils/errorHandler.mjs";
9
- ElDialog.props = {
10
- ...ElDialog.props,
11
- draggable: {
12
- type: Boolean,
13
- default: true
14
- }
15
- };
16
- ElInput.props = {
17
- ...ElInput.props,
18
- showWordLimit: {
19
- type: Boolean,
20
- default: true
21
- }
22
- };
23
- const elMessageBox = (message, options, type) => {
24
- options = options ?? {};
25
- if (!(options == null ? void 0 : options.title)) {
26
- options.title = "温馨提示";
27
- }
28
- if ((options == null ? void 0 : options.draggable) == void 0) {
29
- options.draggable = true;
30
- }
31
- if (!(options == null ? void 0 : options.cancelButtonText)) {
32
- options.cancelButtonText = "取消";
33
- }
34
- if (!(options == null ? void 0 : options.confirmButtonText)) {
35
- options.confirmButtonText = "确定";
36
- }
37
- if ((options == null ? void 0 : options.closeOnClickModal) == void 0) {
38
- options.closeOnClickModal = false;
39
- }
40
- if ((options == null ? void 0 : options.closeOnPressEscape) == void 0) {
41
- options.closeOnPressEscape = false;
42
- }
43
- if ((options == null ? void 0 : options.beforeClose) != void 0) {
44
- const localBeforeClose = options.beforeClose;
45
- const localConfirmButtonText = (options == null ? void 0 : options.confirmButtonText) ?? "确定";
46
- const localShowCancelButton = (options == null ? void 0 : options.showCancelButton) ?? false;
47
- options.beforeClose = (action, instance, done) => {
48
- if (action === "confirm") {
49
- useOverlay.show(0);
50
- instance.confirmButtonLoading = true;
51
- instance.showCancelButton = false;
52
- instance.confirmButtonText = "加载中...";
53
- const cancelLoading = () => {
54
- instance.confirmButtonLoading = false;
55
- instance.showCancelButton = localShowCancelButton;
56
- instance.confirmButtonText = localConfirmButtonText;
57
- useOverlay.hide();
58
- };
59
- const newDone = () => {
60
- cancelLoading();
61
- done();
62
- };
63
- execAsyncFunction(localBeforeClose, action, instance, newDone).then(() => {
64
- newDone();
65
- }).catch((error) => {
66
- consoleError("MessageBox", error);
67
- cancelLoading();
68
- errorHandler(error);
69
- });
70
- } else {
71
- done();
72
- }
73
- };
74
- }
75
- switch (type) {
76
- case "alert":
77
- break;
78
- case "confirm":
79
- if ((options == null ? void 0 : options.showCancelButton) == void 0) {
80
- options.showCancelButton = true;
81
- }
82
- break;
83
- case "prompt":
84
- if ((options == null ? void 0 : options.showCancelButton) == void 0) {
85
- options.showCancelButton = true;
86
- }
87
- break;
88
- }
89
- return ElMessageBox(
90
- Object.assign(
91
- {
92
- message
93
- },
94
- options,
95
- {
96
- boxType: type
97
- }
98
- )
99
- );
100
- };
101
- ElMessageBox.alert = (message, options) => elMessageBox(message, options, "alert");
102
- ElMessageBox.prompt = (message, options) => elMessageBox(message, options, "prompt");
103
- ElMessageBox.confirm = (message, options) => elMessageBox(message, options, "confirm");
104
- const installElementPlus = (app) => {
105
- for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
106
- app.component(`el-icon-${key}`, component);
107
- }
108
- app.use(ElementPlus);
109
- };
110
- export {
111
- installElementPlus
112
- };
113
- //# sourceMappingURL=element-plus.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"element-plus.mjs","sources":["../../../packages/fast-element-plus/element-plus.ts"],"sourcesContent":["/** Element Plus 组件全局配置 */\n\nimport type { App } from \"vue\";\nimport * as ElementPlusIconsVue from \"@element-plus/icons-vue\";\nimport { useOverlay } from \"@fast-element-plus/hooks\";\nimport { consoleError, errorHandler, execAsyncFunction } from \"@fast-element-plus/utils\";\nimport type { Action, ElMessageBoxOptions, MessageBoxData, MessageBoxState } from \"element-plus\";\nimport ElementPlus, { ElDialog, ElInput, ElMessageBox } from \"element-plus\";\n\n// ELDialog 默认拖拽\nElDialog.props = {\n\t...ElDialog.props,\n\tdraggable: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n};\n\n// ELInput 默认显示统计字数\nElInput.props = {\n\t...ElInput.props,\n\tshowWordLimit: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n};\n\n// ElMessageBox 默认配置\nconst elMessageBox = (\n\tmessage: ElMessageBoxOptions[\"message\"],\n\toptions: ElMessageBoxOptions,\n\ttype: \"alert\" | \"confirm\" | \"prompt\"\n): Promise<MessageBoxData> => {\n\toptions = options ?? {};\n\tif (!options?.title) {\n\t\t// 默认提示\n\t\toptions.title = \"温馨提示\";\n\t}\n\tif (options?.draggable == undefined) {\n\t\t// 默认拖拽\n\t\toptions.draggable = true;\n\t}\n\tif (!options?.cancelButtonText) {\n\t\t// 默认 取消按钮的文本内容\n\t\toptions.cancelButtonText = \"取消\";\n\t}\n\tif (!options?.confirmButtonText) {\n\t\t// 默认 确定按钮的文本内容\n\t\toptions.confirmButtonText = \"确定\";\n\t}\n\tif (options?.closeOnClickModal == undefined) {\n\t\t// 默认 是否可通过点击遮罩层关闭 MessageBox\n\t\toptions.closeOnClickModal = false;\n\t}\n\tif (options?.closeOnPressEscape == undefined) {\n\t\t// 默认 是否可通过按下 ESC 键关闭 MessageBox\n\t\toptions.closeOnPressEscape = false;\n\t}\n\n\t// 关闭之前的判断逻辑\n\tif (options?.beforeClose != undefined) {\n\t\tconst localBeforeClose = options.beforeClose;\n\t\tconst localConfirmButtonText = options?.confirmButtonText ?? \"确定\";\n\t\tconst localShowCancelButton = options?.showCancelButton ?? false;\n\t\toptions.beforeClose = (action: Action, instance: MessageBoxState, done: () => void): void => {\n\t\t\tif (action === \"confirm\") {\n\t\t\t\tuseOverlay.show(0);\n\t\t\t\tinstance.confirmButtonLoading = true;\n\t\t\t\tinstance.showCancelButton = false;\n\t\t\t\tinstance.confirmButtonText = \"加载中...\";\n\n\t\t\t\tconst cancelLoading = (): void => {\n\t\t\t\t\tinstance.confirmButtonLoading = false;\n\t\t\t\t\tinstance.showCancelButton = localShowCancelButton;\n\t\t\t\t\tinstance.confirmButtonText = localConfirmButtonText;\n\t\t\t\t\tuseOverlay.hide();\n\t\t\t\t};\n\n\t\t\t\tconst newDone = (): void => {\n\t\t\t\t\tcancelLoading();\n\t\t\t\t\tdone();\n\t\t\t\t};\n\n\t\t\t\texecAsyncFunction(localBeforeClose, action, instance, newDone)\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\tnewDone();\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tconsoleError(\"MessageBox\", error);\n\t\t\t\t\t\tcancelLoading();\n\t\t\t\t\t\terrorHandler(error);\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tdone();\n\t\t\t}\n\t\t};\n\t}\n\n\t// 根据类型有一些判断\n\tswitch (type) {\n\t\tcase \"alert\":\n\t\t\tbreak;\n\t\tcase \"confirm\":\n\t\t\tif (options?.showCancelButton == undefined) {\n\t\t\t\toptions.showCancelButton = true;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"prompt\":\n\t\t\tif (options?.showCancelButton == undefined) {\n\t\t\t\toptions.showCancelButton = true;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\treturn ElMessageBox(\n\t\tObject.assign(\n\t\t\t{\n\t\t\t\tmessage,\n\t\t\t},\n\t\t\toptions,\n\t\t\t{\n\t\t\t\tboxType: type,\n\t\t\t}\n\t\t)\n\t);\n};\n\nElMessageBox.alert = (message: ElMessageBoxOptions[\"message\"], options?: ElMessageBoxOptions): Promise<MessageBoxData> =>\n\telMessageBox(message, options, \"alert\");\n\nElMessageBox.prompt = (message: ElMessageBoxOptions[\"message\"], options?: ElMessageBoxOptions): Promise<MessageBoxData> =>\n\telMessageBox(message, options, \"prompt\");\n\nElMessageBox.confirm = (message: ElMessageBoxOptions[\"message\"], options?: ElMessageBoxOptions): Promise<MessageBoxData> =>\n\telMessageBox(message, options, \"confirm\");\n\nexport const installElementPlus = (app: App): void => {\n\t/** 注册所有 Element Plus Icon */\n\tfor (const [key, component] of Object.entries(ElementPlusIconsVue)) {\n\t\t// 这里是给 FaIcon 使用的\n\t\tapp.component(`el-icon-${key}`, component);\n\t}\n\n\t/** Element Plus 组件完整引入 */\n\tapp.use(ElementPlus);\n};\n"],"names":[],"mappings":";;;;;;;;AAUA,SAAS,QAAQ;AAAA,EAChB,GAAG,SAAS;AAAA,EACZ,WAAW;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA,EACV;AACD;AAGA,QAAQ,QAAQ;AAAA,EACf,GAAG,QAAQ;AAAA,EACX,eAAe;AAAA,IACd,MAAM;AAAA,IACN,SAAS;AAAA,EACV;AACD;AAGA,MAAM,eAAe,CACpB,SACA,SACA,SAC6B;AAC7B,YAAU,WAAW;AACjB,MAAA,EAAC,mCAAS,QAAO;AAEpB,YAAQ,QAAQ;AAAA,EACjB;AACI,OAAA,mCAAS,cAAa,QAAW;AAEpC,YAAQ,YAAY;AAAA,EACrB;AACI,MAAA,EAAC,mCAAS,mBAAkB;AAE/B,YAAQ,mBAAmB;AAAA,EAC5B;AACI,MAAA,EAAC,mCAAS,oBAAmB;AAEhC,YAAQ,oBAAoB;AAAA,EAC7B;AACI,OAAA,mCAAS,sBAAqB,QAAW;AAE5C,YAAQ,oBAAoB;AAAA,EAC7B;AACI,OAAA,mCAAS,uBAAsB,QAAW;AAE7C,YAAQ,qBAAqB;AAAA,EAC9B;AAGI,OAAA,mCAAS,gBAAe,QAAW;AACtC,UAAM,mBAAmB,QAAQ;AAC3B,UAAA,0BAAyB,mCAAS,sBAAqB;AACvD,UAAA,yBAAwB,mCAAS,qBAAoB;AAC3D,YAAQ,cAAc,CAAC,QAAgB,UAA2B,SAA2B;AAC5F,UAAI,WAAW,WAAW;AACzB,mBAAW,KAAK,CAAC;AACjB,iBAAS,uBAAuB;AAChC,iBAAS,mBAAmB;AAC5B,iBAAS,oBAAoB;AAE7B,cAAM,gBAAgB,MAAY;AACjC,mBAAS,uBAAuB;AAChC,mBAAS,mBAAmB;AAC5B,mBAAS,oBAAoB;AAC7B,qBAAW,KAAK;AAAA,QAAA;AAGjB,cAAM,UAAU,MAAY;AACb;AACT;QAAA;AAGN,0BAAkB,kBAAkB,QAAQ,UAAU,OAAO,EAC3D,KAAK,MAAM;AACH;QAAA,CACR,EACA,MAAM,CAAC,UAAU;AACjB,uBAAa,cAAc,KAAK;AAClB;AACd,uBAAa,KAAK;AAAA,QAAA,CAClB;AAAA,MAAA,OACI;AACD;MACN;AAAA,IAAA;AAAA,EAEF;AAGA,UAAQ,MAAM;AAAA,IACb,KAAK;AACJ;AAAA,IACD,KAAK;AACA,WAAA,mCAAS,qBAAoB,QAAW;AAC3C,gBAAQ,mBAAmB;AAAA,MAC5B;AACA;AAAA,IACD,KAAK;AACA,WAAA,mCAAS,qBAAoB,QAAW;AAC3C,gBAAQ,mBAAmB;AAAA,MAC5B;AACA;AAAA,EACF;AAEO,SAAA;AAAA,IACN,OAAO;AAAA,MACN;AAAA,QACC;AAAA,MACD;AAAA,MACA;AAAA,MACA;AAAA,QACC,SAAS;AAAA,MACV;AAAA,IACD;AAAA,EAAA;AAEF;AAEA,aAAa,QAAQ,CAAC,SAAyC,YAC9D,aAAa,SAAS,SAAS,OAAO;AAEvC,aAAa,SAAS,CAAC,SAAyC,YAC/D,aAAa,SAAS,SAAS,QAAQ;AAExC,aAAa,UAAU,CAAC,SAAyC,YAChE,aAAa,SAAS,SAAS,SAAS;AAE5B,MAAA,qBAAqB,CAAC,QAAmB;AAErD,aAAW,CAAC,KAAK,SAAS,KAAK,OAAO,QAAQ,mBAAmB,GAAG;AAEnE,QAAI,UAAU,WAAW,GAAG,IAAI,SAAS;AAAA,EAC1C;AAGA,MAAI,IAAI,WAAW;AACpB;"}
@@ -1,3 +0,0 @@
1
- import { App } from 'vue';
2
- declare const installFastElementPlus: (app: App) => void;
3
- export { installFastElementPlus };
@@ -1,12 +0,0 @@
1
- import FastElementPlusIconsVue from "@fast-element-plus/icons-vue";
2
- import FastElementPlusComponents from "./component.mjs";
3
- import FastElementPlusDirectives from "./directive.mjs";
4
- const installFastElementPlus = (app) => {
5
- app.use(FastElementPlusIconsVue);
6
- FastElementPlusComponents.forEach((c) => app.use(c));
7
- FastElementPlusDirectives.forEach((d) => app.use(d));
8
- };
9
- export {
10
- installFastElementPlus
11
- };
12
- //# sourceMappingURL=fast-element-plus.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fast-element-plus.mjs","sources":["../../../packages/fast-element-plus/fast-element-plus.ts"],"sourcesContent":["import type { App } from \"vue\";\nimport FastElementPlusIconsVue from \"@fast-element-plus/icons-vue\";\nimport FastElementPlusComponents from \"./component\";\nimport FastElementPlusDirectives from \"./directive\";\n\nconst installFastElementPlus = (app: App): void => {\n\t/** 注册 Fast Icon 组件库 */\n\tapp.use(FastElementPlusIconsVue);\n\n\tFastElementPlusComponents.forEach((c) => app.use(c));\n\n\tFastElementPlusDirectives.forEach((d) => app.use(d));\n};\n\nexport { installFastElementPlus };\n"],"names":[],"mappings":";;;AAKM,MAAA,yBAAyB,CAAC,QAAmB;AAElD,MAAI,IAAI,uBAAuB;AAE/B,4BAA0B,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;AAEnD,4BAA0B,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC;AACpD;"}
@@ -1,7 +0,0 @@
1
- import { App } from 'vue';
2
- import { FastOptions } from '../settings';
3
- export declare const INSTALLED_KEY: unique symbol;
4
- export declare const makeInstaller: () => {
5
- version: string;
6
- install: (app: App, options?: FastOptions) => void;
7
- };
@@ -1,30 +0,0 @@
1
- import { setFastOptions } from "../settings/index.mjs";
2
- import "../utils/index.mjs";
3
- import { installElementPlus } from "./element-plus.mjs";
4
- import { installFastElementPlus } from "./fast-element-plus.mjs";
5
- import { fastElementPlusVersion } from "./version.mjs";
6
- import { errorHandler } from "../utils/errorHandler.mjs";
7
- import { makeIdentity } from "../utils/deviceId.mjs";
8
- const INSTALLED_KEY = Symbol("INSTALLED_KEY");
9
- const makeInstaller = () => {
10
- const install = (app, options) => {
11
- if (app[INSTALLED_KEY]) return;
12
- app[INSTALLED_KEY] = true;
13
- app.config.errorHandler = errorHandler;
14
- makeIdentity();
15
- if (options) {
16
- setFastOptions(options);
17
- }
18
- installElementPlus(app);
19
- installFastElementPlus(app);
20
- };
21
- return {
22
- version: fastElementPlusVersion,
23
- install
24
- };
25
- };
26
- export {
27
- INSTALLED_KEY,
28
- makeInstaller
29
- };
30
- //# sourceMappingURL=make-installer.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"make-installer.mjs","sources":["../../../packages/fast-element-plus/make-installer.ts"],"sourcesContent":["import type { App } from \"vue\";\nimport { type FastOptions, setFastOptions } from \"@fast-element-plus/settings\";\nimport { errorHandler, makeIdentity } from \"@fast-element-plus/utils\";\nimport { installElementPlus } from \"./element-plus\";\nimport { installFastElementPlus } from \"./fast-element-plus\";\nimport { fastElementPlusVersion } from \"./version\";\n\nexport const INSTALLED_KEY = Symbol(\"INSTALLED_KEY\");\n\nexport const makeInstaller = (): {\n\tversion: string;\n\tinstall: (app: App, options?: FastOptions) => void;\n} => {\n\tconst install = (app: App, options?: FastOptions): void => {\n\t\tif (app[INSTALLED_KEY]) return;\n\n\t\tapp[INSTALLED_KEY] = true;\n\n\t\t// 全局异常捕获\n\t\tapp.config.errorHandler = errorHandler;\n\n\t\tmakeIdentity();\n\n\t\tif (options) {\n\t\t\tsetFastOptions(options);\n\t\t}\n\n\t\tinstallElementPlus(app);\n\t\tinstallFastElementPlus(app);\n\t};\n\n\treturn {\n\t\tversion: fastElementPlusVersion,\n\t\tinstall,\n\t};\n};\n"],"names":[],"mappings":";;;;;;;AAOa,MAAA,gBAAgB,OAAO,eAAe;AAE5C,MAAM,gBAAgB,MAGxB;AACE,QAAA,UAAU,CAAC,KAAU,YAAgC;AACtD,QAAA,IAAI,aAAa,EAAG;AAExB,QAAI,aAAa,IAAI;AAGrB,QAAI,OAAO,eAAe;AAEb;AAEb,QAAI,SAAS;AACZ,qBAAe,OAAO;AAAA,IACvB;AAEA,uBAAmB,GAAG;AACtB,2BAAuB,GAAG;AAAA,EAAA;AAGpB,SAAA;AAAA,IACN,SAAS;AAAA,IACT;AAAA,EAAA;AAEF;"}
@@ -1,4 +0,0 @@
1
- /**
2
- * 组件库版本号
3
- */
4
- export declare const fastElementPlusVersion = "1.4.18";
@@ -1,5 +0,0 @@
1
- const fastElementPlusVersion = "1.4.18";
2
- export {
3
- fastElementPlusVersion
4
- };
5
- //# sourceMappingURL=version.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.mjs","sources":["../../../packages/fast-element-plus/version.ts"],"sourcesContent":["/**\n * 组件库版本号\n */\nexport const fastElementPlusVersion = \"1.4.18\";\n"],"names":[],"mappings":"AAGO,MAAM,yBAAyB;"}
@@ -1,2 +0,0 @@
1
- export * from './useLoading';
2
- export * from './useOverlay';
@@ -1,7 +0,0 @@
1
- import { useLoading } from "./useLoading/index.mjs";
2
- import { useOverlay } from "./useOverlay/index.mjs";
3
- export {
4
- useLoading,
5
- useOverlay
6
- };
7
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,4 +0,0 @@
1
- export declare const useLoading: {
2
- show: () => void;
3
- hide: () => void;
4
- };
@@ -1,35 +0,0 @@
1
- import { nextTick } from "vue";
2
- const useLoading = {
3
- show: () => {
4
- if (!window.loading) {
5
- const bodyEl = document.body;
6
- const div = document.createElement("div");
7
- div.className = "__fa-loading";
8
- div.innerHTML = `
9
- <div class="__fa-loading__box">
10
- <div class="__fa-loading__box-warp">
11
- <div class="__fa-loading__box-warp__item"></div>
12
- </div>
13
- </div>
14
- `;
15
- bodyEl.insertBefore(div, bodyEl.childNodes[0]);
16
- window.loading = true;
17
- }
18
- },
19
- hide: () => {
20
- if (window.loading) {
21
- nextTick(() => {
22
- setTimeout(() => {
23
- var _a;
24
- const loadingEl = document.querySelector(".__fa-loading__box");
25
- loadingEl && ((_a = loadingEl.parentNode) == null ? void 0 : _a.removeChild(loadingEl));
26
- window.loading = false;
27
- }, 500);
28
- });
29
- }
30
- }
31
- };
32
- export {
33
- useLoading
34
- };
35
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../packages/hooks/useLoading/index.ts"],"sourcesContent":["import { nextTick } from \"vue\";\n\nexport const useLoading = {\n\tshow: (): void => {\n\t\t// 判断是否存在加载效果\n\t\tif (!window.loading) {\n\t\t\tconst bodyEl: Element = document.body;\n\t\t\tconst div = document.createElement(\"div\");\n\t\t\tdiv.className = \"__fa-loading\";\n\t\t\tdiv.innerHTML = `\n<div class=\"__fa-loading__box\">\n\t<div class=\"__fa-loading__box-warp\">\n\t\t\t<div class=\"__fa-loading__box-warp__item\"></div>\n\t</div>\n</div>\n`;\n\t\t\tbodyEl.insertBefore(div, bodyEl.childNodes[0]);\n\t\t\twindow.loading = true;\n\t\t}\n\t},\n\thide: (): void => {\n\t\t// 判断是否存在加载效果\n\t\tif (window.loading) {\n\t\t\tnextTick(() => {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tconst loadingEl = document.querySelector(\".__fa-loading__box\");\n\t\t\t\t\tloadingEl && loadingEl.parentNode?.removeChild(loadingEl);\n\t\t\t\t\twindow.loading = false;\n\t\t\t\t}, 500);\n\t\t\t});\n\t\t}\n\t},\n};\n"],"names":[],"mappings":";AAEO,MAAM,aAAa;AAAA,EACzB,MAAM,MAAY;AAEb,QAAA,CAAC,OAAO,SAAS;AACpB,YAAM,SAAkB,SAAS;AAC3B,YAAA,MAAM,SAAS,cAAc,KAAK;AACxC,UAAI,YAAY;AAChB,UAAI,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOhB,aAAO,aAAa,KAAK,OAAO,WAAW,CAAC,CAAC;AAC7C,aAAO,UAAU;AAAA,IAClB;AAAA,EACD;AAAA,EACA,MAAM,MAAY;AAEjB,QAAI,OAAO,SAAS;AACnB,eAAS,MAAM;AACd,mBAAW,MAAM;;AACV,gBAAA,YAAY,SAAS,cAAc,oBAAoB;AAChD,yBAAA,eAAU,eAAV,mBAAsB,YAAY;AAC/C,iBAAO,UAAU;AAAA,WACf,GAAG;AAAA,MAAA,CACN;AAAA,IACF;AAAA,EACD;AACD;"}
@@ -1,4 +0,0 @@
1
- export declare const useOverlay: {
2
- show: (transparent?: number) => void;
3
- hide: () => void;
4
- };
@@ -1,27 +0,0 @@
1
- import { nextTick } from "vue";
2
- const useOverlay = {
3
- show: (transparent = 0) => {
4
- if (!window.overlay) {
5
- const bodyEl = document.body;
6
- const div = document.createElement("div");
7
- div.className = "__fa-overlay";
8
- div.style.backgroundColor = `rgba(0, 0, 0, ${transparent})`;
9
- bodyEl.insertBefore(div, bodyEl.childNodes[0]);
10
- window.overlay = true;
11
- }
12
- },
13
- hide: () => {
14
- if (window.overlay) {
15
- nextTick(() => {
16
- var _a;
17
- const loadingEl = document.querySelector(".__fa-overlay");
18
- loadingEl && ((_a = loadingEl.parentNode) == null ? void 0 : _a.removeChild(loadingEl));
19
- window.overlay = false;
20
- });
21
- }
22
- }
23
- };
24
- export {
25
- useOverlay
26
- };
27
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../packages/hooks/useOverlay/index.ts"],"sourcesContent":["import { nextTick } from \"vue\";\n\nexport const useOverlay = {\n\tshow: (transparent = 0): void => {\n\t\t// 判断是否存在遮罩层\n\t\tif (!window.overlay) {\n\t\t\tconst bodyEl: Element = document.body;\n\t\t\tconst div = document.createElement(\"div\");\n\t\t\tdiv.className = \"__fa-overlay\";\n\t\t\tdiv.style.backgroundColor = `rgba(0, 0, 0, ${transparent})`;\n\t\t\tbodyEl.insertBefore(div, bodyEl.childNodes[0]);\n\t\t\twindow.overlay = true;\n\t\t}\n\t},\n\thide: (): void => {\n\t\t// 判断是否存在遮罩层\n\t\tif (window.overlay) {\n\t\t\tnextTick(() => {\n\t\t\t\tconst loadingEl = document.querySelector(\".__fa-overlay\");\n\t\t\t\tloadingEl && loadingEl.parentNode?.removeChild(loadingEl);\n\t\t\t\twindow.overlay = false;\n\t\t\t});\n\t\t}\n\t},\n};\n"],"names":[],"mappings":";AAEO,MAAM,aAAa;AAAA,EACzB,MAAM,CAAC,cAAc,MAAY;AAE5B,QAAA,CAAC,OAAO,SAAS;AACpB,YAAM,SAAkB,SAAS;AAC3B,YAAA,MAAM,SAAS,cAAc,KAAK;AACxC,UAAI,YAAY;AACZ,UAAA,MAAM,kBAAkB,iBAAiB,WAAW;AACxD,aAAO,aAAa,KAAK,OAAO,WAAW,CAAC,CAAC;AAC7C,aAAO,UAAU;AAAA,IAClB;AAAA,EACD;AAAA,EACA,MAAM,MAAY;AAEjB,QAAI,OAAO,SAAS;AACnB,eAAS,MAAM;;AACR,cAAA,YAAY,SAAS,cAAc,eAAe;AAC3C,uBAAA,eAAU,eAAV,mBAAsB,YAAY;AAC/C,eAAO,UAAU;AAAA,MAAA,CACjB;AAAA,IACF;AAAA,EACD;AACD;"}
File without changes
package/es/index.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import { INSTALLED_KEY } from './fast-element-plus';
2
- export * from './components';
3
- export * from './constants';
4
- export * from './directives';
5
- export * from './hooks';
6
- export * from './settings';
7
- export * from './stores';
8
- export * from './utils';
9
- export { INSTALLED_KEY };
10
- declare const installer: {
11
- version: string;
12
- install: (app: import('vue').App, options?: import('./settings').FastOptions) => void;
13
- };
14
- export declare const install: (app: import('vue').App, options?: import('./settings').FastOptions) => void;
15
- export declare const version: string;
16
- export default installer;
package/es/index.es.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from './index'
2
- export {}
3
- import FastElementPlus from './index'
4
- export default FastElementPlus
5
- export * from './index'
6
- export {}