@silver-formily/element-plus 3.0.1 → 3.0.3

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 (539) hide show
  1. package/README.en-US.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/__builtins__/configs/index.mjs +6 -5
  4. package/esm/__builtins__/configs/index.mjs.map +1 -1
  5. package/esm/__builtins__/shared/load-config-provider.mjs +19 -11
  6. package/esm/__builtins__/shared/load-config-provider.mjs.map +1 -1
  7. package/esm/__builtins__/shared/loading.mjs +50 -46
  8. package/esm/__builtins__/shared/loading.mjs.map +1 -1
  9. package/esm/__builtins__/shared/simple-version-compare.mjs +16 -15
  10. package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
  11. package/esm/__builtins__/shared/transform-component.mjs +30 -31
  12. package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
  13. package/esm/__builtins__/shared/use-enter-submit.mjs +77 -24
  14. package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -1
  15. package/esm/__builtins__/shared/utils.mjs +44 -32
  16. package/esm/__builtins__/shared/utils.mjs.map +1 -1
  17. package/esm/_virtual/_/plugin-vue/export-helper.mjs +8 -0
  18. package/esm/array-base/array-base-addition.mjs +53 -0
  19. package/esm/array-base/array-base-addition.mjs.map +1 -0
  20. package/esm/array-base/array-base-index.mjs +17 -0
  21. package/esm/array-base/array-base-index.mjs.map +1 -0
  22. package/esm/array-base/array-base-inner.mjs +30 -0
  23. package/esm/array-base/array-base-inner.mjs.map +1 -0
  24. package/esm/array-base/array-base-item.mjs +21 -0
  25. package/esm/array-base/array-base-item.mjs.map +1 -0
  26. package/esm/array-base/array-base-move-down.mjs +45 -0
  27. package/esm/array-base/array-base-move-down.mjs.map +1 -0
  28. package/esm/array-base/array-base-move-up.mjs +45 -0
  29. package/esm/array-base/array-base-move-up.mjs.map +1 -0
  30. package/esm/array-base/array-base-remove.mjs +45 -0
  31. package/esm/array-base/array-base-remove.mjs.map +1 -0
  32. package/esm/array-base/array-base-sort-handle.mjs +33 -0
  33. package/esm/array-base/array-base-sort-handle.mjs.map +1 -0
  34. package/esm/array-base/index.mjs +28 -209
  35. package/esm/array-base/index.mjs.map +1 -1
  36. package/esm/array-base/style.css +36 -0
  37. package/esm/array-base/symbols.mjs +7 -6
  38. package/esm/array-base/symbols.mjs.map +1 -1
  39. package/esm/array-base/types.d.ts +23 -24
  40. package/esm/array-base/utils.d.ts +11 -17
  41. package/esm/array-base/utils.mjs +58 -61
  42. package/esm/array-base/utils.mjs.map +1 -1
  43. package/esm/array-cards/array-cards.mjs +109 -0
  44. package/esm/array-cards/array-cards.mjs.map +1 -0
  45. package/esm/array-cards/index.d.ts +120 -113
  46. package/esm/array-cards/index.mjs +19 -119
  47. package/esm/array-cards/index.mjs.map +1 -1
  48. package/esm/array-cards/style.css +20 -0
  49. package/esm/array-collapse/array-collapse-item.mjs +74 -0
  50. package/esm/array-collapse/array-collapse-item.mjs.map +1 -0
  51. package/esm/array-collapse/array-collapse.mjs +117 -0
  52. package/esm/array-collapse/array-collapse.mjs.map +1 -0
  53. package/esm/array-collapse/index.d.ts +137 -129
  54. package/esm/array-collapse/index.mjs +21 -175
  55. package/esm/array-collapse/index.mjs.map +1 -1
  56. package/esm/array-collapse/style.css +20 -0
  57. package/esm/array-collapse/utils.mjs +7 -13
  58. package/esm/array-collapse/utils.mjs.map +1 -1
  59. package/esm/array-items/array-items-item.mjs +22 -0
  60. package/esm/array-items/array-items-item.mjs.map +1 -0
  61. package/esm/array-items/array-items.mjs +88 -0
  62. package/esm/array-items/array-items.mjs.map +1 -0
  63. package/esm/array-items/index.d.ts +132 -125
  64. package/esm/array-items/index.mjs +21 -108
  65. package/esm/array-items/index.mjs.map +1 -1
  66. package/esm/array-items/style.css +22 -0
  67. package/esm/array-list-tabs/array-list-tabs.mjs +191 -0
  68. package/esm/array-list-tabs/array-list-tabs.mjs.map +1 -0
  69. package/esm/array-list-tabs/index.d.ts +80 -74
  70. package/esm/array-list-tabs/index.mjs +12 -187
  71. package/esm/array-list-tabs/index.mjs.map +1 -1
  72. package/esm/array-list-tabs/style.css +90 -0
  73. package/esm/array-list-tabs/utils.mjs +11 -16
  74. package/esm/array-list-tabs/utils.mjs.map +1 -1
  75. package/esm/array-table/array-table.mjs +236 -0
  76. package/esm/array-table/array-table.mjs.map +1 -0
  77. package/esm/array-table/index.d.ts +106 -1597
  78. package/esm/array-table/index.mjs +24 -224
  79. package/esm/array-table/index.mjs.map +1 -1
  80. package/esm/array-table/style.css +23 -0
  81. package/esm/array-table/types.d.ts +11 -6
  82. package/esm/array-table/utils.mjs +14 -23
  83. package/esm/array-table/utils.mjs.map +1 -1
  84. package/esm/array-tabs/array-tabs.mjs +92 -0
  85. package/esm/array-tabs/array-tabs.mjs.map +1 -0
  86. package/esm/array-tabs/index.d.ts +7 -2
  87. package/esm/array-tabs/index.mjs +8 -87
  88. package/esm/array-tabs/index.mjs.map +1 -1
  89. package/esm/array-tabs/style.css +7 -0
  90. package/esm/autocomplete/autocomplete.mjs +99 -0
  91. package/esm/autocomplete/autocomplete.mjs.map +1 -0
  92. package/esm/autocomplete/index.d.ts +5 -639
  93. package/esm/autocomplete/index.mjs +14 -114
  94. package/esm/autocomplete/index.mjs.map +1 -1
  95. package/esm/cascader/cascader.mjs +32 -0
  96. package/esm/cascader/cascader.mjs.map +1 -0
  97. package/esm/cascader/index.d.ts +5 -28
  98. package/esm/cascader/index.mjs +13 -51
  99. package/esm/cascader/index.mjs.map +1 -1
  100. package/esm/checkbox/checkbox-group.mjs +64 -0
  101. package/esm/checkbox/checkbox-group.mjs.map +1 -0
  102. package/esm/checkbox/index.d.ts +5 -817
  103. package/esm/checkbox/index.mjs +16 -70
  104. package/esm/checkbox/index.mjs.map +1 -1
  105. package/esm/color-picker/index.d.ts +8 -210
  106. package/esm/color-picker/index.mjs +13 -17
  107. package/esm/color-picker/index.mjs.map +1 -1
  108. package/esm/color-picker-panel/index.d.ts +8 -129
  109. package/esm/color-picker-panel/index.mjs +16 -25
  110. package/esm/color-picker-panel/index.mjs.map +1 -1
  111. package/esm/date-picker/index.d.ts +5 -443
  112. package/esm/date-picker/index.mjs +21 -29
  113. package/esm/date-picker/index.mjs.map +1 -1
  114. package/esm/date-picker/utils.mjs +21 -26
  115. package/esm/date-picker/utils.mjs.map +1 -1
  116. package/esm/date-picker-panel/index.d.ts +5 -143
  117. package/esm/date-picker-panel/index.mjs +23 -30
  118. package/esm/date-picker-panel/index.mjs.map +1 -1
  119. package/esm/editable/editable-popover.mjs +95 -0
  120. package/esm/editable/editable-popover.mjs.map +1 -0
  121. package/esm/editable/editable.mjs +113 -0
  122. package/esm/editable/editable.mjs.map +1 -0
  123. package/esm/editable/index.d.ts +10 -150
  124. package/esm/editable/index.mjs +17 -220
  125. package/esm/editable/index.mjs.map +1 -1
  126. package/esm/editable/style.css +29 -0
  127. package/esm/form/form.mjs +50 -70
  128. package/esm/form/form.mjs.map +1 -1
  129. package/esm/form/form.vue.d.ts +48 -0
  130. package/esm/form/index.d.ts +1 -1
  131. package/esm/form-button-group/form-button-group-sticky.mjs +37 -0
  132. package/esm/form-button-group/form-button-group-sticky.mjs.map +1 -0
  133. package/esm/form-button-group/form-button-group.mjs +71 -0
  134. package/esm/form-button-group/form-button-group.mjs.map +1 -0
  135. package/esm/form-button-group/index.d.ts +94 -87
  136. package/esm/form-button-group/index.mjs +10 -97
  137. package/esm/form-button-group/index.mjs.map +1 -1
  138. package/esm/form-button-group/style.css +281 -0
  139. package/esm/form-button-group/utils.mjs +7 -13
  140. package/esm/form-button-group/utils.mjs.map +1 -1
  141. package/esm/form-collapse/form-collapse.mjs +74 -0
  142. package/esm/form-collapse/form-collapse.mjs.map +1 -0
  143. package/esm/form-collapse/index.d.ts +43 -39
  144. package/esm/form-collapse/index.mjs +20 -87
  145. package/esm/form-collapse/index.mjs.map +1 -1
  146. package/esm/form-collapse/style.css +7 -0
  147. package/esm/form-collapse/utils.d.ts +21 -27
  148. package/esm/form-collapse/utils.mjs +48 -46
  149. package/esm/form-collapse/utils.mjs.map +1 -1
  150. package/esm/form-dialog/dialog-content.mjs +118 -0
  151. package/esm/form-dialog/dialog-content.mjs.map +1 -0
  152. package/esm/form-dialog/index.d.ts +8 -4
  153. package/esm/form-dialog/index.mjs +142 -211
  154. package/esm/form-dialog/index.mjs.map +1 -1
  155. package/esm/form-dialog/types.d.ts +38 -32
  156. package/esm/form-drawer/drawer-content.mjs +118 -0
  157. package/esm/form-drawer/drawer-content.mjs.map +1 -0
  158. package/esm/form-drawer/index.d.ts +8 -4
  159. package/esm/form-drawer/index.mjs +142 -204
  160. package/esm/form-drawer/index.mjs.map +1 -1
  161. package/esm/form-drawer/types.d.ts +38 -32
  162. package/esm/form-grid/form-grid-column.mjs +28 -0
  163. package/esm/form-grid/form-grid-column.mjs.map +1 -0
  164. package/esm/form-grid/form-grid.mjs +69 -0
  165. package/esm/form-grid/form-grid.mjs.map +1 -0
  166. package/esm/form-grid/hooks.mjs +7 -7
  167. package/esm/form-grid/hooks.mjs.map +1 -1
  168. package/esm/form-grid/index.d.ts +5 -2
  169. package/esm/form-grid/index.mjs +10 -110
  170. package/esm/form-grid/index.mjs.map +1 -1
  171. package/esm/form-grid/style.css +128 -0
  172. package/esm/form-item/form-item.mjs +308 -0
  173. package/esm/form-item/form-item.mjs.map +1 -0
  174. package/esm/form-item/form-item.vue.d.ts +29 -0
  175. package/esm/form-item/index.d.ts +9 -77
  176. package/esm/form-item/index.mjs +28 -333
  177. package/esm/form-item/index.mjs.map +1 -1
  178. package/esm/form-item/style.css +263 -0
  179. package/esm/form-item/types.d.ts +34 -29
  180. package/esm/form-item/utils.mjs +15 -15
  181. package/esm/form-item/utils.mjs.map +1 -1
  182. package/esm/form-layout/form-layout.mjs +103 -84
  183. package/esm/form-layout/form-layout.mjs.map +1 -1
  184. package/esm/form-layout/form-layout.vue.d.ts +28 -0
  185. package/esm/form-layout/index.d.ts +1 -1
  186. package/esm/form-layout/types.d.ts +24 -40
  187. package/esm/form-layout/utils.mjs +73 -99
  188. package/esm/form-layout/utils.mjs.map +1 -1
  189. package/esm/form-step/form-step-pane.mjs +15 -0
  190. package/esm/form-step/form-step-pane.mjs.map +1 -0
  191. package/esm/form-step/form-step.mjs +63 -0
  192. package/esm/form-step/form-step.mjs.map +1 -0
  193. package/esm/form-step/index.d.ts +29 -23
  194. package/esm/form-step/index.mjs +12 -94
  195. package/esm/form-step/index.mjs.map +1 -1
  196. package/esm/form-step/types.d.ts +19 -19
  197. package/esm/form-step/utils.d.ts +14 -10
  198. package/esm/form-step/utils.mjs +75 -59
  199. package/esm/form-step/utils.mjs.map +1 -1
  200. package/esm/form-tab/form-tab.mjs +79 -0
  201. package/esm/form-tab/form-tab.mjs.map +1 -0
  202. package/esm/form-tab/hooks.mjs +18 -16
  203. package/esm/form-tab/hooks.mjs.map +1 -1
  204. package/esm/form-tab/index.d.ts +5 -3
  205. package/esm/form-tab/index.mjs +10 -77
  206. package/esm/form-tab/index.mjs.map +1 -1
  207. package/esm/form-tab/style.css +4 -0
  208. package/esm/form-tab/utils.mjs +14 -13
  209. package/esm/form-tab/utils.mjs.map +1 -1
  210. package/esm/index.d.ts +53 -48
  211. package/esm/index.mjs +50 -103
  212. package/esm/input/index.d.ts +5 -52
  213. package/esm/input/index.mjs +16 -69
  214. package/esm/input/index.mjs.map +1 -1
  215. package/esm/input/input.mjs +41 -0
  216. package/esm/input/input.mjs.map +1 -0
  217. package/esm/input-number/index.d.ts +8 -329
  218. package/esm/input-number/index.mjs +12 -24
  219. package/esm/input-number/index.mjs.map +1 -1
  220. package/esm/input-tag/index.d.ts +5 -32
  221. package/esm/input-tag/index.mjs +13 -50
  222. package/esm/input-tag/index.mjs.map +1 -1
  223. package/esm/input-tag/input-tag.mjs +41 -0
  224. package/esm/input-tag/input-tag.mjs.map +1 -0
  225. package/esm/mention/index.d.ts +5 -50
  226. package/esm/mention/index.mjs +15 -97
  227. package/esm/mention/index.mjs.map +1 -1
  228. package/esm/mention/mention.mjs +77 -0
  229. package/esm/mention/mention.mjs.map +1 -0
  230. package/esm/pagination/components/jumper.mjs +11 -12
  231. package/esm/pagination/components/jumper.mjs.map +1 -1
  232. package/esm/pagination/components/jumper2.mjs +59 -0
  233. package/esm/pagination/components/jumper2.mjs.map +1 -0
  234. package/esm/pagination/components/next.mjs +18 -22
  235. package/esm/pagination/components/next.mjs.map +1 -1
  236. package/esm/pagination/components/next2.mjs +38 -0
  237. package/esm/pagination/components/next2.mjs.map +1 -0
  238. package/esm/pagination/components/pager.mjs +21 -22
  239. package/esm/pagination/components/pager.mjs.map +1 -1
  240. package/esm/pagination/components/pager2.mjs +229 -0
  241. package/esm/pagination/components/pager2.mjs.map +1 -0
  242. package/esm/pagination/components/prev.mjs +16 -22
  243. package/esm/pagination/components/prev.mjs.map +1 -1
  244. package/esm/pagination/components/prev2.mjs +38 -0
  245. package/esm/pagination/components/prev2.mjs.map +1 -0
  246. package/esm/pagination/components/sizes.mjs +32 -7
  247. package/esm/pagination/components/sizes.mjs.map +1 -1
  248. package/esm/pagination/components/sizes2.mjs +66 -0
  249. package/esm/pagination/components/sizes2.mjs.map +1 -0
  250. package/esm/pagination/components/total.mjs +10 -11
  251. package/esm/pagination/components/total.mjs.map +1 -1
  252. package/esm/pagination/components/total2.mjs +26 -0
  253. package/esm/pagination/components/total2.mjs.map +1 -0
  254. package/esm/pagination/pagination.mjs +271 -626
  255. package/esm/pagination/pagination.mjs.map +1 -1
  256. package/esm/password/index.d.ts +8 -54
  257. package/esm/password/index.mjs +11 -14
  258. package/esm/password/index.mjs.map +1 -1
  259. package/esm/preview-text/cascader.mjs +51 -0
  260. package/esm/preview-text/cascader.mjs.map +1 -0
  261. package/esm/preview-text/color-picker.mjs +37 -0
  262. package/esm/preview-text/color-picker.mjs.map +1 -0
  263. package/esm/preview-text/date-picker.mjs +61 -0
  264. package/esm/preview-text/date-picker.mjs.map +1 -0
  265. package/esm/preview-text/index.d.ts +107 -106
  266. package/esm/preview-text/index.mjs +25 -364
  267. package/esm/preview-text/index.mjs.map +1 -1
  268. package/esm/preview-text/input.mjs +39 -0
  269. package/esm/preview-text/input.mjs.map +1 -0
  270. package/esm/preview-text/preview.mjs +30 -0
  271. package/esm/preview-text/preview.mjs.map +1 -0
  272. package/esm/preview-text/rate.mjs +32 -0
  273. package/esm/preview-text/rate.mjs.map +1 -0
  274. package/esm/preview-text/select.mjs +42 -0
  275. package/esm/preview-text/select.mjs.map +1 -0
  276. package/esm/preview-text/style.css +16 -0
  277. package/esm/preview-text/time-picker.mjs +39 -0
  278. package/esm/preview-text/time-picker.mjs.map +1 -0
  279. package/esm/preview-text/tree.mjs +73 -0
  280. package/esm/preview-text/tree.mjs.map +1 -0
  281. package/esm/preview-text/utils.d.ts +10 -13
  282. package/esm/preview-text/utils.mjs +15 -15
  283. package/esm/preview-text/utils.mjs.map +1 -1
  284. package/esm/query-form/default-components.mjs +45 -45
  285. package/esm/query-form/default-components.mjs.map +1 -1
  286. package/esm/query-form/hooks.mjs +31 -26
  287. package/esm/query-form/hooks.mjs.map +1 -1
  288. package/esm/query-form/index.d.ts +115 -105
  289. package/esm/query-form/index.mjs +10 -334
  290. package/esm/query-form/index.mjs.map +1 -1
  291. package/esm/query-form/query-form-light.mjs +86 -0
  292. package/esm/query-form/query-form-light.mjs.map +1 -0
  293. package/esm/query-form/query-form.mjs +263 -0
  294. package/esm/query-form/query-form.mjs.map +1 -0
  295. package/esm/query-form/style.css +27 -0
  296. package/esm/query-form/types.d.ts +42 -41
  297. package/esm/query-form-item/index.d.ts +7 -151
  298. package/esm/query-form-item/index.mjs +15 -184
  299. package/esm/query-form-item/index.mjs.map +1 -1
  300. package/esm/query-form-item/query-form-item.mjs +195 -0
  301. package/esm/query-form-item/query-form-item.mjs.map +1 -0
  302. package/esm/query-form-item/style.css +12 -0
  303. package/esm/query-form-item/types.d.ts +42 -38
  304. package/esm/radio/index.d.ts +429 -473
  305. package/esm/radio/index.mjs +15 -69
  306. package/esm/radio/index.mjs.map +1 -1
  307. package/esm/radio/radio-group.mjs +70 -0
  308. package/esm/radio/radio-group.mjs.map +1 -0
  309. package/esm/{styles/radio/index.css → radio/style.css} +3 -1
  310. package/esm/rate/index.d.ts +8 -187
  311. package/esm/rate/index.mjs +13 -17
  312. package/esm/rate/index.mjs.map +1 -1
  313. package/esm/reset/index.d.ts +5 -2
  314. package/esm/reset/index.mjs +8 -44
  315. package/esm/reset/index.mjs.map +1 -1
  316. package/esm/reset/reset.mjs +42 -0
  317. package/esm/reset/reset.mjs.map +1 -0
  318. package/esm/segmented/index.d.ts +5 -26
  319. package/esm/segmented/index.mjs +13 -41
  320. package/esm/segmented/index.mjs.map +1 -1
  321. package/esm/segmented/segmented.mjs +26 -0
  322. package/esm/segmented/segmented.mjs.map +1 -0
  323. package/esm/select/index.d.ts +5 -129
  324. package/esm/select/index.mjs +14 -128
  325. package/esm/select/index.mjs.map +1 -1
  326. package/esm/select/select.mjs +95 -0
  327. package/esm/select/select.mjs.map +1 -0
  328. package/esm/select-table/index.d.ts +4 -1557
  329. package/esm/select-table/index.mjs +12 -205
  330. package/esm/select-table/index.mjs.map +1 -1
  331. package/esm/select-table/select-table.mjs +202 -0
  332. package/esm/select-table/select-table.mjs.map +1 -0
  333. package/esm/select-table/style.css +14 -0
  334. package/esm/shared/overlay-elements.mjs +15 -16
  335. package/esm/shared/overlay-elements.mjs.map +1 -1
  336. package/esm/shared/url-change-listener.mjs +50 -0
  337. package/esm/shared/url-change-listener.mjs.map +1 -0
  338. package/esm/slider/index.d.ts +8 -177
  339. package/esm/slider/index.mjs +13 -17
  340. package/esm/slider/index.mjs.map +1 -1
  341. package/esm/space/index.d.ts +2 -1
  342. package/esm/space/index.mjs +2 -6
  343. package/esm/submit/index.d.ts +5 -2
  344. package/esm/submit/index.mjs +8 -40
  345. package/esm/submit/index.mjs.map +1 -1
  346. package/esm/submit/submit.mjs +41 -0
  347. package/esm/submit/submit.mjs.map +1 -0
  348. package/esm/switch/index.d.ts +8 -299
  349. package/esm/switch/index.mjs +8 -13
  350. package/esm/switch/index.mjs.map +1 -1
  351. package/esm/time-picker/index.d.ts +8 -445
  352. package/esm/time-picker/index.mjs +10 -17
  353. package/esm/time-picker/index.mjs.map +1 -1
  354. package/esm/time-select/index.d.ts +5 -185
  355. package/esm/time-select/index.mjs +13 -17
  356. package/esm/time-select/index.mjs.map +1 -1
  357. package/esm/transfer/index.d.ts +8 -267
  358. package/esm/transfer/index.mjs +8 -11
  359. package/esm/transfer/index.mjs.map +1 -1
  360. package/esm/tree/index.d.ts +4 -41
  361. package/esm/tree/index.mjs +14 -105
  362. package/esm/tree/index.mjs.map +1 -1
  363. package/esm/tree/tree.mjs +127 -0
  364. package/esm/tree/tree.mjs.map +1 -0
  365. package/esm/tree/utils.mjs +157 -149
  366. package/esm/tree/utils.mjs.map +1 -1
  367. package/esm/tree-select/index.d.ts +5 -16
  368. package/esm/tree-select/index.mjs +13 -41
  369. package/esm/tree-select/index.mjs.map +1 -1
  370. package/esm/tree-select/tree-select.mjs +38 -0
  371. package/esm/tree-select/tree-select.mjs.map +1 -0
  372. package/esm/upload/index.d.ts +5 -712
  373. package/esm/upload/index.mjs +11 -176
  374. package/esm/upload/index.mjs.map +1 -1
  375. package/esm/upload/upload.mjs +176 -0
  376. package/esm/upload/upload.mjs.map +1 -0
  377. package/package.json +25 -26
  378. package/esm/__builtins__/configs/index.d.ts +0 -1
  379. package/esm/__builtins__/index.d.ts +0 -2
  380. package/esm/__builtins__/index.mjs +0 -23
  381. package/esm/__builtins__/index.mjs.map +0 -1
  382. package/esm/__builtins__/shared/index.d.ts +0 -6
  383. package/esm/__builtins__/shared/index.mjs +0 -21
  384. package/esm/__builtins__/shared/index.mjs.map +0 -1
  385. package/esm/__builtins__/shared/load-config-provider.d.ts +0 -2
  386. package/esm/__builtins__/shared/loading.d.ts +0 -12
  387. package/esm/__builtins__/shared/simple-version-compare.d.ts +0 -2
  388. package/esm/__builtins__/shared/transform-component.d.ts +0 -3
  389. package/esm/__builtins__/shared/types.d.ts +0 -2
  390. package/esm/__builtins__/shared/types.mjs +0 -2
  391. package/esm/__builtins__/shared/types.mjs.map +0 -1
  392. package/esm/__builtins__/shared/use-enter-submit.d.ts +0 -9
  393. package/esm/__builtins__/shared/utils.d.ts +0 -9
  394. package/esm/array-base/array-base-addition.d.ts +0 -5
  395. package/esm/array-base/array-base-index.d.ts +0 -19
  396. package/esm/array-base/array-base-inner.d.ts +0 -18
  397. package/esm/array-base/array-base-item.d.ts +0 -18
  398. package/esm/array-base/array-base-move-down.d.ts +0 -18
  399. package/esm/array-base/array-base-move-up.d.ts +0 -18
  400. package/esm/array-base/array-base-remove.d.ts +0 -18
  401. package/esm/array-base/array-base-sort-handle.d.ts +0 -2
  402. package/esm/array-base/index.d.ts +0 -114
  403. package/esm/array-base/symbols.d.ts +0 -4
  404. package/esm/array-base/types.mjs +0 -2
  405. package/esm/array-base/types.mjs.map +0 -1
  406. package/esm/array-cards/array-cards.d.ts +0 -13
  407. package/esm/array-collapse/array-collapse-item.d.ts +0 -18
  408. package/esm/array-collapse/array-collapse.d.ts +0 -16
  409. package/esm/array-collapse/utils.d.ts +0 -1
  410. package/esm/array-items/array-items-item.d.ts +0 -30
  411. package/esm/array-items/array-items.d.ts +0 -2
  412. package/esm/array-list-tabs/array-list-tabs.d.ts +0 -31
  413. package/esm/array-list-tabs/utils.d.ts +0 -3
  414. package/esm/array-table/array-table.d.ts +0 -1505
  415. package/esm/array-table/types.mjs +0 -2
  416. package/esm/array-table/types.mjs.map +0 -1
  417. package/esm/array-table/utils.d.ts +0 -5
  418. package/esm/array-tabs/array-tabs.d.ts +0 -2
  419. package/esm/autocomplete/autocomplete.d.ts +0 -1222
  420. package/esm/cascader/cascader.d.ts +0 -25
  421. package/esm/checkbox/checkbox-group.d.ts +0 -42
  422. package/esm/date-picker/utils.d.ts +0 -4
  423. package/esm/editable/editable-popover.d.ts +0 -25
  424. package/esm/editable/editable.d.ts +0 -193
  425. package/esm/env.d.d.ts +0 -1
  426. package/esm/env.d.mjs +0 -2
  427. package/esm/env.d.mjs.map +0 -1
  428. package/esm/form/form.d.ts +0 -46
  429. package/esm/form/index.mjs +0 -6
  430. package/esm/form/index.mjs.map +0 -1
  431. package/esm/form-button-group/form-button-group-sticky.d.ts +0 -17
  432. package/esm/form-button-group/form-button-group.d.ts +0 -57
  433. package/esm/form-button-group/utils.d.ts +0 -1
  434. package/esm/form-collapse/form-collapse.d.ts +0 -18
  435. package/esm/form-dialog/dialog-content.d.ts +0 -846
  436. package/esm/form-dialog/types.mjs +0 -2
  437. package/esm/form-dialog/types.mjs.map +0 -1
  438. package/esm/form-drawer/drawer-content.d.ts +0 -976
  439. package/esm/form-drawer/types.mjs +0 -2
  440. package/esm/form-drawer/types.mjs.map +0 -1
  441. package/esm/form-grid/form-grid-column.d.ts +0 -29
  442. package/esm/form-grid/form-grid.d.ts +0 -101
  443. package/esm/form-grid/hooks.d.ts +0 -4
  444. package/esm/form-item/form-item.d.ts +0 -19
  445. package/esm/form-item/types.mjs +0 -2
  446. package/esm/form-item/types.mjs.map +0 -1
  447. package/esm/form-item/utils.d.ts +0 -3
  448. package/esm/form-layout/form-layout.d.ts +0 -31
  449. package/esm/form-layout/index.mjs +0 -6
  450. package/esm/form-layout/index.mjs.map +0 -1
  451. package/esm/form-layout/types.mjs +0 -2
  452. package/esm/form-layout/types.mjs.map +0 -1
  453. package/esm/form-layout/utils.d.ts +0 -57
  454. package/esm/form-step/form-step-pane.d.ts +0 -2
  455. package/esm/form-step/form-step.d.ts +0 -5
  456. package/esm/form-step/types.mjs +0 -2
  457. package/esm/form-step/types.mjs.map +0 -1
  458. package/esm/form-tab/form-tab.d.ts +0 -7
  459. package/esm/form-tab/hooks.d.ts +0 -8
  460. package/esm/form-tab/types.d.ts +0 -12
  461. package/esm/form-tab/types.mjs +0 -2
  462. package/esm/form-tab/types.mjs.map +0 -1
  463. package/esm/form-tab/utils.d.ts +0 -4
  464. package/esm/index.mjs.map +0 -1
  465. package/esm/input/input.d.ts +0 -25
  466. package/esm/input-tag/input-tag.d.ts +0 -32
  467. package/esm/mention/mention.d.ts +0 -51
  468. package/esm/pagination/components/jumper.d.ts +0 -16
  469. package/esm/pagination/components/next.d.ts +0 -42
  470. package/esm/pagination/components/pager.d.ts +0 -42
  471. package/esm/pagination/components/prev.d.ts +0 -39
  472. package/esm/pagination/components/sizes.d.ts +0 -56
  473. package/esm/pagination/components/total.d.ts +0 -8
  474. package/esm/pagination/pagination.d.ts +0 -128
  475. package/esm/preview-text/cascader.d.ts +0 -5
  476. package/esm/preview-text/color-picker.d.ts +0 -5
  477. package/esm/preview-text/date-picker.d.ts +0 -5
  478. package/esm/preview-text/input.d.ts +0 -28
  479. package/esm/preview-text/preview.d.ts +0 -18
  480. package/esm/preview-text/rate.d.ts +0 -5
  481. package/esm/preview-text/select.d.ts +0 -5
  482. package/esm/preview-text/time-picker.d.ts +0 -5
  483. package/esm/preview-text/tree.d.ts +0 -22
  484. package/esm/query-form/default-components.d.ts +0 -5
  485. package/esm/query-form/hooks.d.ts +0 -25
  486. package/esm/query-form/query-form-light.d.ts +0 -27
  487. package/esm/query-form/query-form.d.ts +0 -52
  488. package/esm/query-form/types.mjs +0 -2
  489. package/esm/query-form/types.mjs.map +0 -1
  490. package/esm/query-form-item/query-form-item.d.ts +0 -96
  491. package/esm/query-form-item/types.mjs +0 -2
  492. package/esm/query-form-item/types.mjs.map +0 -1
  493. package/esm/radio/radio-group.d.ts +0 -33
  494. package/esm/reset/reset.d.ts +0 -45
  495. package/esm/segmented/segmented.d.ts +0 -25
  496. package/esm/select/select.d.ts +0 -45
  497. package/esm/select-table/select-table.d.ts +0 -3030
  498. package/esm/select-table/types.d.ts +0 -17
  499. package/esm/select-table/types.mjs +0 -2
  500. package/esm/select-table/types.mjs.map +0 -1
  501. package/esm/shared/overlay-elements.d.ts +0 -6
  502. package/esm/space/index.mjs.map +0 -1
  503. package/esm/styles/array-base/index.css +0 -1
  504. package/esm/styles/array-cards/index.css +0 -1
  505. package/esm/styles/array-collapse/index.css +0 -1
  506. package/esm/styles/array-items/index.css +0 -1
  507. package/esm/styles/array-list-tabs/index.css +0 -1
  508. package/esm/styles/array-table/index.css +0 -1
  509. package/esm/styles/array-tabs/index.css +0 -1
  510. package/esm/styles/editable/index.css +0 -1
  511. package/esm/styles/form-button-group/index.css +0 -1
  512. package/esm/styles/form-collapse/index.css +0 -1
  513. package/esm/styles/form-grid/index.css +0 -1
  514. package/esm/styles/form-item/index.css +0 -1
  515. package/esm/styles/form-tab/index.css +0 -1
  516. package/esm/styles/preview-text/index.css +0 -1
  517. package/esm/styles/query-form/index.css +0 -1
  518. package/esm/styles/query-form-item/index.css +0 -1
  519. package/esm/styles/select-table/index.css +0 -1
  520. package/esm/submit/submit.d.ts +0 -36
  521. package/esm/tree/tree.d.ts +0 -20
  522. package/esm/tree/types.d.ts +0 -13
  523. package/esm/tree/types.mjs +0 -2
  524. package/esm/tree/types.mjs.map +0 -1
  525. package/esm/tree/utils.d.ts +0 -45
  526. package/esm/tree-select/tree-select.d.ts +0 -10
  527. package/esm/upload/upload.d.ts +0 -1259
  528. package/esm/vendor/icon.mjs +0 -11
  529. package/esm/vendor/icon.mjs.map +0 -1
  530. package/esm/vendor/lodash.mjs +0 -1506
  531. package/esm/vendor/lodash.mjs.map +0 -1
  532. package/esm/vendor/runtime.mjs +0 -34
  533. package/esm/vendor/runtime.mjs.map +0 -1
  534. package/esm/vendor/shared.esm-bundler.mjs +0 -9
  535. package/esm/vendor/shared.esm-bundler.mjs.map +0 -1
  536. package/esm/vendor/sizes.mjs +0 -27
  537. package/esm/vendor/sizes.mjs.map +0 -1
  538. package/esm/vendor/types.mjs +0 -19
  539. package/esm/vendor/types.mjs.map +0 -1
@@ -1,176 +1,11 @@
1
- import { useField as D, connect as N, mapProps as j } from "@silver-formily/vue";
2
- import { defineComponent as O, ref as f, useAttrs as z, computed as w, onBeforeUnmount as T, openBlock as a, createElementBlock as v, Fragment as y, createVNode as p, unref as r, mergeProps as x, createSlots as q, withCtx as s, renderSlot as m, createElementVNode as P, toDisplayString as C, createBlock as h, createCommentVNode as G } from "vue";
3
- import { UploadFilled as H, Plus as J, Upload as K } from "@element-plus/icons-vue";
4
- import { reaction as M } from "@formily/reactive";
5
- import { isFn as c } from "@formily/shared";
6
- import { ElUpload as Q, ElIcon as W, ElButton as X, ElImageViewer as Y, genFileId as Z } from "element-plus";
7
- import "@vueuse/core";
8
- import "@formily/core";
9
- import "@silver-formily/reactive-vue";
10
- import { hasSlotContent as ee } from "../__builtins__/shared/utils.mjs";
11
- import { o as te } from "../vendor/lodash.mjs";
12
- const oe = { class: "el-upload__text" }, re = { style: { "margin-left": "6px" } }, ne = /* @__PURE__ */ O({
13
- name: "FUpload",
14
- inheritAttrs: !1,
15
- __name: "upload",
16
- props: {
17
- textContent: {
18
- type: String,
19
- default: ""
20
- },
21
- errorAdaptor: {
22
- type: Function,
23
- default: (u) => u?.message
24
- },
25
- formatValue: {
26
- type: Function,
27
- default: (u) => u
28
- },
29
- fileList: {
30
- type: Array,
31
- default: () => []
32
- },
33
- imageViewerProps: {
34
- type: Object,
35
- default: () => ({ teleported: !0, showProgress: !0 })
36
- }
37
- },
38
- emits: ["update:modelValue"],
39
- setup(u, { emit: S }) {
40
- const i = u, V = S, d = f(), o = z(), R = w(() => te(o, [
41
- "onChange",
42
- "onRemove",
43
- "onExceed",
44
- "onError",
45
- "onPreview",
46
- "fileList",
47
- "onUpdate:fileList"
48
- ])), l = D();
49
- l.value?.inject({
50
- getElUploadRef: () => d
51
- });
52
- const U = f(), k = f(0), g = f(!1), $ = w(() => i.fileList.map((e) => e.url));
53
- function E(e) {
54
- const t = i.errorAdaptor(e);
55
- l.value?.setFeedback({
56
- type: "error",
57
- code: "UploadError",
58
- messages: t ? [t] : []
59
- });
60
- }
61
- function F(e, t) {
62
- l.value?.setDataSource([...t]), E();
63
- }
64
- function I(e, t) {
65
- c(o.onRemove) && o.onRemove(e, t), l.value.setDataSource([...t]), E();
66
- }
67
- function L(e, t) {
68
- if (c(o.onExceed) && o.onExceed(e, t), o.limit !== 1)
69
- return;
70
- d.value.clearFiles();
71
- const n = e[0];
72
- n.uid = Z(), d.value.handleStart(n), (o.autoUpload ?? !0) && d.value.submit();
73
- }
74
- function A(e, t, n) {
75
- c(o.onError) && o.onError(e, t, n);
76
- }
77
- function B(e) {
78
- if (c(o.onPreview)) {
79
- o.onPreview(e);
80
- return;
81
- }
82
- if (!e.url && !o.accept?.includes("image"))
83
- return;
84
- const t = i.fileList.findIndex((n) => n.uid === e.uid);
85
- k.value = t, g.value = !0;
86
- }
87
- const _ = M(() => l.value?.dataSource ?? [], () => {
88
- const e = i.formatValue(l.value.dataSource);
89
- V("update:modelValue", e);
90
- });
91
- return T(() => {
92
- _();
93
- }), (e, t) => (a(), v(y, null, [
94
- p(r(Q), x({
95
- ref_key: "uploadRef",
96
- ref: d
97
- }, R.value, {
98
- "file-list": e.$props.fileList,
99
- onChange: F,
100
- onRemove: I,
101
- onExceed: L,
102
- onError: A,
103
- onPreview: B
104
- }), q({
105
- default: s(() => [
106
- r(ee)(e.$slots?.default) ? m(e.$slots, "default", { key: 0 }) : (a(), v(y, { key: 1 }, [
107
- r(o).drag ? (a(), v(y, { key: 0 }, [
108
- p(r(W), { style: { "font-size": "60px", margin: "40px 0 16px" } }, {
109
- default: s(() => [
110
- p(r(H), { color: "gray" })
111
- ]),
112
- _: 1
113
- }),
114
- P("div", oe, C(i.textContent), 1)
115
- ], 64)) : r(o).listType === "picture-card" ? (a(), h(r(J), {
116
- key: 1,
117
- style: { width: "28px", height: "28px", color: "gray" }
118
- })) : (a(), h(r(X), { key: 2 }, {
119
- default: s(() => [
120
- p(r(K), {
121
- width: "16px",
122
- height: "16px"
123
- }),
124
- P("span", re, C(i.textContent), 1)
125
- ]),
126
- _: 1
127
- }))
128
- ], 64))
129
- ]),
130
- _: 2
131
- }, [
132
- e.$slots.file ? {
133
- name: "file",
134
- fn: s(({ file: n, index: b }) => [
135
- m(e.$slots, "file", {
136
- file: n,
137
- index: b
138
- })
139
- ]),
140
- key: "0"
141
- } : void 0,
142
- e.$slots.tip ? {
143
- name: "tip",
144
- fn: s(() => [
145
- m(e.$slots, "tip")
146
- ]),
147
- key: "1"
148
- } : void 0,
149
- e.$slots.trigger ? {
150
- name: "trigger",
151
- fn: s(() => [
152
- m(e.$slots, "trigger")
153
- ]),
154
- key: "2"
155
- } : void 0
156
- ]), 1040, ["file-list"]),
157
- g.value ? (a(), h(r(Y), x({
158
- key: 0,
159
- ref_key: "imgPreviewRef",
160
- ref: U,
161
- "url-list": $.value,
162
- "initial-index": k.value
163
- }, i.imageViewerProps, {
164
- onClose: t[0] || (t[0] = (n) => g.value = !1)
165
- }), null, 16, ["url-list", "initial-index"])) : G("", !0)
166
- ], 64));
167
- }
168
- }), ve = N(
169
- ne,
170
- j({ readOnly: "readonly", dataSource: "fileList" })
171
- );
172
- export {
173
- ve as Upload,
174
- ve as default
175
- };
176
- //# sourceMappingURL=index.mjs.map
1
+ import _sfc_main from "./upload.mjs";
2
+ import { connect, mapProps } from "@silver-formily/vue";
3
+ //#region src/upload/index.ts
4
+ const Upload = connect(_sfc_main, mapProps({
5
+ readOnly: "readonly",
6
+ dataSource: "fileList"
7
+ }));
8
+ //#endregion
9
+ export { Upload as default };
10
+
11
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/upload/upload.vue","../../src/upload/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { Field } from '@formily/core'\nimport type { ImageViewerInstance, ImageViewerProps, UploadFile, UploadInstance, UploadProps, UploadRawFile } from 'element-plus'\nimport type { PropType } from 'vue'\nimport {\n Plus as PlusIcon,\n UploadFilled as UploadFilledIcon,\n Upload as UploadIcon,\n} from '@element-plus/icons-vue'\nimport { reaction } from '@formily/reactive'\nimport { isFn } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport { ElButton, ElIcon, ElImageViewer, ElUpload, genFileId } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { computed, onBeforeUnmount, ref, useAttrs } from 'vue'\nimport { hasSlotContent } from '../__builtins__'\n\ndefineOptions({\n name: 'FUpload',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n textContent: {\n type: String,\n default: '',\n },\n errorAdaptor: {\n type: Function as PropType<(error?: Error) => string>,\n default: (error?: Error) => error?.message,\n },\n formatValue: {\n type: Function as PropType<(fileList?: UploadFile[]) => any>,\n default: item => item,\n },\n fileList: {\n type: Array as PropType<UploadFile[]>,\n default: () => [],\n },\n imageViewerProps: {\n type: Object as PropType<ImageViewerProps>,\n default: () => ({ teleported: true, showProgress: true }),\n },\n})\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst uploadRef = ref<UploadInstance>()\nconst attrs = useAttrs() as UploadProps\nconst innerAttrs = computed(() => {\n return omit(attrs, [\n 'onChange',\n 'onRemove',\n 'onExceed',\n 'onError',\n 'onPreview',\n 'fileList',\n 'onUpdate:fileList',\n ])\n})\nconst fieldRef = useField<Field>()\nfieldRef.value?.inject({\n getElUploadRef: () => {\n return uploadRef\n },\n})\n\nconst imgPreviewRef = ref<ImageViewerInstance>()\nconst activeImageIndex = ref(0)\nconst isShowImgViewer = ref(false)\nconst imgPreviewList = computed(() => {\n return props.fileList.map(item => item.url)\n})\n\nfunction setFeedBack(error?: Error) {\n const message = props.errorAdaptor(error)\n fieldRef.value?.setFeedback({\n type: 'error',\n code: 'UploadError',\n messages: message ? [message] : [],\n })\n}\n\nfunction handleChange(file: UploadFile, fileList: UploadFile[]) {\n fieldRef.value?.setDataSource([...fileList])\n setFeedBack()\n}\n\nfunction handleRemove(file: UploadFile, fileList: UploadFile[]) {\n if (isFn(attrs.onRemove)) {\n attrs.onRemove(file, fileList)\n }\n fieldRef.value.setDataSource([...fileList])\n setFeedBack()\n}\n\nfunction handleExceed(files: File[], uploadFIles) {\n if (isFn(attrs.onExceed)) {\n attrs.onExceed(files, uploadFIles)\n }\n if (attrs.limit !== 1)\n return\n uploadRef.value!.clearFiles()\n const file = files[0] as UploadRawFile\n file.uid = genFileId()\n uploadRef.value!.handleStart(file)\n if (attrs.autoUpload ?? true) {\n uploadRef.value!.submit()\n }\n}\n\nfunction handleError(error: Error, file: UploadFile, fileList: UploadFile[]) {\n if (isFn(attrs.onError)) {\n (attrs.onError)(error, file, fileList)\n }\n}\n\nfunction onPreviewClick(uploadFile: UploadFile) {\n if (isFn(attrs.onPreview)) {\n (attrs.onPreview)(uploadFile)\n return\n }\n if (!uploadFile.url && !attrs.accept?.includes('image'))\n return\n const clickIndex = props.fileList.findIndex((element: UploadFile) => element.uid === uploadFile.uid)\n activeImageIndex.value = clickIndex\n isShowImgViewer.value = true\n}\n\nconst dispose = reaction(() => {\n return fieldRef.value?.dataSource ?? []\n}, () => {\n const emitValue = props.formatValue(fieldRef.value.dataSource as UploadFile[])\n emit('update:modelValue', emitValue)\n})\nonBeforeUnmount(() => {\n dispose()\n})\n</script>\n\n<template>\n <ElUpload\n ref=\"uploadRef\"\n v-bind=\"innerAttrs\"\n :file-list=\"$props.fileList\"\n @change=\"handleChange\"\n @remove=\"handleRemove\"\n @exceed=\"handleExceed\"\n @error=\"handleError\"\n @preview=\"onPreviewClick\"\n >\n <slot v-if=\"hasSlotContent($slots?.default)\" />\n <template v-else>\n <template v-if=\"attrs.drag\">\n <ElIcon style=\"font-size: 60px; margin: 40px 0 16px;\">\n <UploadFilledIcon color=\"gray\" />\n </ElIcon>\n <div class=\"el-upload__text\">\n {{ props.textContent }}\n </div>\n </template>\n <template v-else-if=\"attrs.listType === 'picture-card'\">\n <PlusIcon style=\"width: 28px; height: 28px; color: gray\" />\n </template>\n <template v-else>\n <ElButton>\n <UploadIcon width=\"16px\" height=\"16px\" />\n <span style=\"margin-left: 6px\">\n {{ props.textContent }}\n </span>\n </ElButton>\n </template>\n </template>\n <template v-if=\"$slots.file\" #file=\"{ file, index }\">\n <slot name=\"file\" :file=\"file\" :index=\"index\" />\n </template>\n <template v-if=\"$slots.tip\" #tip>\n <slot name=\"tip\" />\n </template>\n <template v-if=\"$slots.trigger\" #trigger>\n <slot name=\"trigger\" />\n </template>\n </ElUpload>\n <ElImageViewer\n v-if=\"isShowImgViewer\"\n ref=\"imgPreviewRef\"\n :url-list=\"imgPreviewList\"\n :initial-index=\"activeImageIndex\"\n v-bind=\"props.imageViewerProps\"\n @close=\"isShowImgViewer = false\"\n />\n</template>\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport FUpload from './upload.vue'\r\n\r\nexport const Upload = connect<typeof FUpload>(\n FUpload,\n mapProps({ readOnly: 'readonly', dataSource: 'fileList' }),\r\n)\r\n\r\nexport default Upload\r\n"],"names":["props","__props","emit","__emit","uploadRef","ref","attrs","useAttrs","innerAttrs","computed","omit","fieldRef","useField","imgPreviewRef","activeImageIndex","isShowImgViewer","imgPreviewList","item","setFeedBack","error","message","handleChange","file","fileList","handleRemove","isFn","handleExceed","files","uploadFIles","genFileId","handleError","onPreviewClick","uploadFile","clickIndex","element","dispose","reaction","emitValue","onBeforeUnmount","_createVNode","_unref","_mergeProps","$props","hasSlotContent","$slots","_renderSlot","_ctx","_createElementBlock","_Fragment","ElIcon","UploadFilledIcon","_createElementVNode","_hoisted_1","_toDisplayString","_createBlock","PlusIcon","ElButton","UploadIcon","_hoisted_2","index","_openBlock","Upload","connect","FUpload","mapProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,UAAMA,IAAQC,GAuBRC,IAAOC,GAEPC,IAAYC,EAAA,GACZC,IAAQC,EAAA,GACRC,IAAaC,EAAS,MACnBC,GAAKJ,GAAO;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACD,CACF,GACKK,IAAWC,EAAA;AACjB,IAAAD,EAAS,OAAO,OAAO;AAAA,MACrB,gBAAgB,MACPP;AAAA,IACT,CACD;AAED,UAAMS,IAAgBR,EAAA,GAChB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AAAe,CAAA,GAAA;AAAA;cAAjD,OAAA,EAAA,OAAA,QAAA,QAAA,QAAA,OAAA,OAAA;AAAA,YAAA,YAGVD,EAKWd,EAAAgB,CAAA,GAAA,EAAA,KAAA,KAAA;AAAA,yBAJT,MAAyC;AAAA,gBAAzCjB,EAAyCC,EAAAiB,CAAA,GAAA;AAAA,kBAA7B,OAAM;AAAA,kBAAO,QAAO;AAAA,gBAAA;gBAChCN,EAEO,QAFPO,IAEOL,EADFrD,EAAM,WAAW,GAAA,CAAA;AAAA,cAAA;;;;;;;QAKZ4C,EAAAA,OAAO;gBAAO;AAAA,gBAC5B,CAAgD,EADZ,MAAAtB,GAAM,OAAAqC,QAAK;AAAA,YAC/Cd,EAAgDC,EAAA,QAAA,QAAA;AAAA,cAA7B,MAAAxB;AAAA,cAAa,OAAAqC;AAAA,YAAA;;;;QAElBf,EAAAA,OAAO;gBAAM;AAAA,gBAC3B,MAAmB;AAAA,YAAnBC,EAAmBC,EAAA,QAAA,KAAA;AAAA,UAAA;;;QAELF,EAAAA,OAAO;gBAAU;AAAA,gBAC/B,MAAuB;AAAA,YAAvBC,EAAuBC,EAAA,QAAA,SAAA;AAAA,UAAA;;;;MAInB/B,EAAA,SADR6C,EAAA,GAAAN,EAOEd,MAPFC,EAOE;AAAA;iBALI;AAAA,QAAJ,KAAI5B;AAAA,QACH,YAAUG,EAAA;AAAA,QACV,iBAAeF,EAAA;AAAA,MAAA,GACRd,EAAM,kBAAgB;AAAA,QAC7B,gCAAOe,EAAA,QAAe;AAAA,MAAA;;;IC1Ld8C,KAASC;AAAA,EACpBC;AAAAA,EACAC,EAAS,EAAE,UAAU,YAAY,YAAY,YAAY;AAC3D;"}
1
+ {"version":3,"file":"index.mjs","names":["FUpload"],"sources":["../../src/upload/index.ts"],"sourcesContent":["import { connect, mapProps } from '@silver-formily/vue'\r\nimport FUpload from './upload.vue'\r\n\r\nexport const Upload = connect<typeof FUpload>(\n FUpload,\n mapProps({ readOnly: 'readonly', dataSource: 'fileList' }),\r\n)\r\n\r\nexport default Upload\r\n"],"mappings":";;;AAGA,MAAa,SAAS,QACpBA,WACA,SAAS;CAAE,UAAU;CAAY,YAAY;CAAY,CAAC,CAC3D"}
@@ -0,0 +1,176 @@
1
+ import { hasSlotContent } from "../__builtins__/shared/utils.mjs";
2
+ import { ElButton, ElIcon, ElImageViewer, ElUpload, genFileId } from "element-plus";
3
+ import { reactionWatch } from "@silver-formily/reactive-vue";
4
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, toDisplayString, unref, useAttrs as useAttrs$1, withCtx } from "vue";
5
+ import { useField } from "@silver-formily/vue";
6
+ import { isFn } from "@formily/shared";
7
+ import { omit } from "lodash-es";
8
+ import { Plus, Upload, UploadFilled } from "@element-plus/icons-vue";
9
+ //#region src/upload/upload.vue
10
+ const _hoisted_1 = { class: "el-upload__text" };
11
+ const _hoisted_2 = { style: { "margin-left": "6px" } };
12
+ const _sfc_main = /* @__PURE__ */ defineComponent({
13
+ name: "FUpload",
14
+ inheritAttrs: false,
15
+ __name: "upload",
16
+ props: {
17
+ textContent: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ errorAdaptor: {
22
+ type: Function,
23
+ default: (error) => error?.message
24
+ },
25
+ formatValue: {
26
+ type: Function,
27
+ default: (item) => item
28
+ },
29
+ fileList: {
30
+ type: Array,
31
+ default: () => []
32
+ },
33
+ imageViewerProps: {
34
+ type: Object,
35
+ default: () => ({
36
+ teleported: true,
37
+ showProgress: true
38
+ })
39
+ }
40
+ },
41
+ emits: ["update:modelValue"],
42
+ setup(__props, { emit: __emit }) {
43
+ const props = __props;
44
+ const emit = __emit;
45
+ const uploadRef = ref();
46
+ const attrs = useAttrs$1();
47
+ const innerAttrs = computed(() => {
48
+ return omit(attrs, [
49
+ "onChange",
50
+ "onRemove",
51
+ "onExceed",
52
+ "onError",
53
+ "onPreview",
54
+ "fileList",
55
+ "onUpdate:fileList"
56
+ ]);
57
+ });
58
+ const fieldRef = useField();
59
+ fieldRef.value?.inject({ getElUploadRef: () => {
60
+ return uploadRef;
61
+ } });
62
+ const imgPreviewRef = ref();
63
+ const activeImageIndex = ref(0);
64
+ const isShowImgViewer = ref(false);
65
+ const imgPreviewList = computed(() => {
66
+ return props.fileList.map((item) => item.url);
67
+ });
68
+ function setFeedBack(error) {
69
+ const message = props.errorAdaptor(error);
70
+ fieldRef.value?.setFeedback({
71
+ type: "error",
72
+ code: "UploadError",
73
+ messages: message ? [message] : []
74
+ });
75
+ }
76
+ function handleChange(file, fileList) {
77
+ fieldRef.value?.setDataSource([...fileList]);
78
+ setFeedBack();
79
+ }
80
+ function handleRemove(file, fileList) {
81
+ if (isFn(attrs.onRemove)) attrs.onRemove(file, fileList);
82
+ fieldRef.value.setDataSource([...fileList]);
83
+ setFeedBack();
84
+ }
85
+ function handleExceed(files, uploadFIles) {
86
+ if (isFn(attrs.onExceed)) attrs.onExceed(files, uploadFIles);
87
+ if (attrs.limit !== 1) return;
88
+ uploadRef.value.clearFiles();
89
+ const file = files[0];
90
+ file.uid = genFileId();
91
+ uploadRef.value.handleStart(file);
92
+ if (attrs.autoUpload ?? true) uploadRef.value.submit();
93
+ }
94
+ function handleError(error, file, fileList) {
95
+ if (isFn(attrs.onError)) attrs.onError(error, file, fileList);
96
+ }
97
+ function onPreviewClick(uploadFile) {
98
+ if (isFn(attrs.onPreview)) {
99
+ attrs.onPreview(uploadFile);
100
+ return;
101
+ }
102
+ if (!uploadFile.url && !attrs.accept?.includes("image")) return;
103
+ activeImageIndex.value = props.fileList.findIndex((element) => element.uid === uploadFile.uid);
104
+ isShowImgViewer.value = true;
105
+ }
106
+ reactionWatch(() => {
107
+ return fieldRef.value?.dataSource ?? [];
108
+ }, () => {
109
+ emit("update:modelValue", props.formatValue(fieldRef.value.dataSource));
110
+ });
111
+ return (_ctx, _cache) => {
112
+ return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(ElUpload), mergeProps({
113
+ ref_key: "uploadRef",
114
+ ref: uploadRef
115
+ }, innerAttrs.value, {
116
+ "file-list": _ctx.$props.fileList,
117
+ onChange: handleChange,
118
+ onRemove: handleRemove,
119
+ onExceed: handleExceed,
120
+ onError: handleError,
121
+ onPreview: onPreviewClick
122
+ }), createSlots({
123
+ default: withCtx(() => [unref(hasSlotContent)(_ctx.$slots?.default) ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [unref(attrs).drag ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(ElIcon), { style: {
124
+ "font-size": "60px",
125
+ "margin": "40px 0 16px"
126
+ } }, {
127
+ default: withCtx(() => [createVNode(unref(UploadFilled), { color: "gray" })]),
128
+ _: 1
129
+ }), createElementVNode("div", _hoisted_1, toDisplayString(props.textContent), 1)], 64)) : unref(attrs).listType === "picture-card" ? (openBlock(), createBlock(unref(Plus), {
130
+ key: 1,
131
+ style: {
132
+ "width": "28px",
133
+ "height": "28px",
134
+ "color": "gray"
135
+ }
136
+ })) : (openBlock(), createBlock(unref(ElButton), { key: 2 }, {
137
+ default: withCtx(() => [createVNode(unref(Upload), {
138
+ width: "16px",
139
+ height: "16px"
140
+ }), createElementVNode("span", _hoisted_2, toDisplayString(props.textContent), 1)]),
141
+ _: 1
142
+ }))], 64))]),
143
+ _: 2
144
+ }, [
145
+ _ctx.$slots.file ? {
146
+ name: "file",
147
+ fn: withCtx(({ file, index }) => [renderSlot(_ctx.$slots, "file", {
148
+ file,
149
+ index
150
+ })]),
151
+ key: "0"
152
+ } : void 0,
153
+ _ctx.$slots.tip ? {
154
+ name: "tip",
155
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "tip")]),
156
+ key: "1"
157
+ } : void 0,
158
+ _ctx.$slots.trigger ? {
159
+ name: "trigger",
160
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "trigger")]),
161
+ key: "2"
162
+ } : void 0
163
+ ]), 1040, ["file-list"]), isShowImgViewer.value ? (openBlock(), createBlock(unref(ElImageViewer), mergeProps({
164
+ key: 0,
165
+ ref_key: "imgPreviewRef",
166
+ ref: imgPreviewRef,
167
+ "url-list": imgPreviewList.value,
168
+ "initial-index": activeImageIndex.value
169
+ }, props.imageViewerProps, { onClose: _cache[0] || (_cache[0] = ($event) => isShowImgViewer.value = false) }), null, 16, ["url-list", "initial-index"])) : createCommentVNode("v-if", true)], 64);
170
+ };
171
+ }
172
+ });
173
+ //#endregion
174
+ export { _sfc_main as default };
175
+
176
+ //# sourceMappingURL=upload.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.mjs","names":["$props","$slots"],"sources":["../../src/upload/upload.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { Field } from '@formily/core'\nimport type { ImageViewerInstance, ImageViewerProps, UploadFile, UploadInstance, UploadProps, UploadRawFile } from 'element-plus'\nimport type { PropType } from 'vue'\nimport {\n Plus as PlusIcon,\n UploadFilled as UploadFilledIcon,\n Upload as UploadIcon,\n} from '@element-plus/icons-vue'\nimport { isFn } from '@formily/shared'\nimport { reactionWatch } from '@silver-formily/reactive-vue'\nimport { useField } from '@silver-formily/vue'\nimport { ElButton, ElIcon, ElImageViewer, ElUpload, genFileId } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { computed, ref, useAttrs } from 'vue'\nimport { hasSlotContent } from '../__builtins__'\n\ndefineOptions({\n name: 'FUpload',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n textContent: {\n type: String,\n default: '',\n },\n errorAdaptor: {\n type: Function as PropType<(error?: Error) => string>,\n default: (error?: Error) => error?.message,\n },\n formatValue: {\n type: Function as PropType<(fileList?: UploadFile[]) => any>,\n default: item => item,\n },\n fileList: {\n type: Array as PropType<UploadFile[]>,\n default: () => [],\n },\n imageViewerProps: {\n type: Object as PropType<ImageViewerProps>,\n default: () => ({ teleported: true, showProgress: true }),\n },\n})\n\nconst emit = defineEmits(['update:modelValue'])\n\nconst uploadRef = ref<UploadInstance>()\nconst attrs = useAttrs() as UploadProps\nconst innerAttrs = computed(() => {\n return omit(attrs, [\n 'onChange',\n 'onRemove',\n 'onExceed',\n 'onError',\n 'onPreview',\n 'fileList',\n 'onUpdate:fileList',\n ])\n})\nconst fieldRef = useField<Field>()\nfieldRef.value?.inject({\n getElUploadRef: () => {\n return uploadRef\n },\n})\n\nconst imgPreviewRef = ref<ImageViewerInstance>()\nconst activeImageIndex = ref(0)\nconst isShowImgViewer = ref(false)\nconst imgPreviewList = computed(() => {\n return props.fileList.map(item => item.url)\n})\n\nfunction setFeedBack(error?: Error) {\n const message = props.errorAdaptor(error)\n fieldRef.value?.setFeedback({\n type: 'error',\n code: 'UploadError',\n messages: message ? [message] : [],\n })\n}\n\nfunction handleChange(file: UploadFile, fileList: UploadFile[]) {\n fieldRef.value?.setDataSource([...fileList])\n setFeedBack()\n}\n\nfunction handleRemove(file: UploadFile, fileList: UploadFile[]) {\n if (isFn(attrs.onRemove)) {\n attrs.onRemove(file, fileList)\n }\n fieldRef.value.setDataSource([...fileList])\n setFeedBack()\n}\n\nfunction handleExceed(files: File[], uploadFIles) {\n if (isFn(attrs.onExceed)) {\n attrs.onExceed(files, uploadFIles)\n }\n if (attrs.limit !== 1)\n return\n uploadRef.value!.clearFiles()\n const file = files[0] as UploadRawFile\n file.uid = genFileId()\n uploadRef.value!.handleStart(file)\n if (attrs.autoUpload ?? true) {\n uploadRef.value!.submit()\n }\n}\n\nfunction handleError(error: Error, file: UploadFile, fileList: UploadFile[]) {\n if (isFn(attrs.onError)) {\n (attrs.onError)(error, file, fileList)\n }\n}\n\nfunction onPreviewClick(uploadFile: UploadFile) {\n if (isFn(attrs.onPreview)) {\n (attrs.onPreview)(uploadFile)\n return\n }\n if (!uploadFile.url && !attrs.accept?.includes('image'))\n return\n const clickIndex = props.fileList.findIndex((element: UploadFile) => element.uid === uploadFile.uid)\n activeImageIndex.value = clickIndex\n isShowImgViewer.value = true\n}\n\nreactionWatch(() => {\n return fieldRef.value?.dataSource ?? []\n}, () => {\n const emitValue = props.formatValue(fieldRef.value.dataSource as UploadFile[])\n emit('update:modelValue', emitValue)\n})\n</script>\n\n<template>\n <ElUpload\n ref=\"uploadRef\"\n v-bind=\"innerAttrs\"\n :file-list=\"$props.fileList\"\n @change=\"handleChange\"\n @remove=\"handleRemove\"\n @exceed=\"handleExceed\"\n @error=\"handleError\"\n @preview=\"onPreviewClick\"\n >\n <slot v-if=\"hasSlotContent($slots?.default)\" />\n <template v-else>\n <template v-if=\"attrs.drag\">\n <ElIcon style=\"font-size: 60px; margin: 40px 0 16px;\">\n <UploadFilledIcon color=\"gray\" />\n </ElIcon>\n <div class=\"el-upload__text\">\n {{ props.textContent }}\n </div>\n </template>\n <template v-else-if=\"attrs.listType === 'picture-card'\">\n <PlusIcon style=\"width: 28px; height: 28px; color: gray\" />\n </template>\n <template v-else>\n <ElButton>\n <UploadIcon width=\"16px\" height=\"16px\" />\n <span style=\"margin-left: 6px\">\n {{ props.textContent }}\n </span>\n </ElButton>\n </template>\n </template>\n <template v-if=\"$slots.file\" #file=\"{ file, index }\">\n <slot name=\"file\" :file=\"file\" :index=\"index\" />\n </template>\n <template v-if=\"$slots.tip\" #tip>\n <slot name=\"tip\" />\n </template>\n <template v-if=\"$slots.trigger\" #trigger>\n <slot name=\"trigger\" />\n </template>\n </ElUpload>\n <ElImageViewer\n v-if=\"isShowImgViewer\"\n ref=\"imgPreviewRef\"\n :url-list=\"imgPreviewList\"\n :initial-index=\"activeImageIndex\"\n v-bind=\"props.imageViewerProps\"\n @close=\"isShowImgViewer = false\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBA,MAAM,QAAQ;EAuBd,MAAM,OAAO;EAEb,MAAM,YAAY,KAAoB;EACtC,MAAM,QAAQ,YAAU;EACxB,MAAM,aAAa,eAAe;AAChC,UAAO,KAAK,OAAO;IACjB;IACA;IACA;IACA;IACA;IACA;IACA;IACD,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;WAAO;kBACoB,EADZ,MAAM,YAAK,CAC/C,WAAgD,KAAA,QAAA,QAAA;MAAvB;MAAc;;;;IAEzBA,KAAAA,OAAO,MAAA;WAAM;uBACR,CAAnB,WAAmB,KAAA,QAAA,MAAA,CAAA,CAAA;;;IAELA,KAAAA,OAAO,UAAA;WAAU;uBACR,CAAvB,WAAuB,KAAA,QAAA,UAAA,CAAA,CAAA;;;6BAInB,gBAAA,SAAA,WAAA,EADR,YAOE,MAAA,cAAA,EAPF,WAOE;;aALI;IAAJ,KAAI;IACH,YAAU,eAAA;IACV,iBAAe,iBAAA;MACR,MAAM,kBAAgB,EAC7B,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,gBAAA,QAAe,QAAA,CAAA,EAAA,MAAA,IAAA,CAAA,YAAA,gBAAA,CAAA,IAAA,mBAAA,QAAA,KAAA,CAAA,EAAA,GAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silver-formily/element-plus",
3
3
  "type": "module",
4
- "version": "3.0.1",
4
+ "version": "3.0.3",
5
5
  "description": "Formily 的 Element Plus 封装",
6
6
  "author": "hezhengxu",
7
7
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  "@formily/reactive": "^2.0.8",
42
42
  "@formily/shared": "^2.0.8",
43
43
  "@silver-formily/grid": "^1.0.1",
44
- "@silver-formily/reactive-vue": "^1",
44
+ "@silver-formily/reactive-vue": "^1.1.0",
45
45
  "@silver-formily/vue": "^2.3.1",
46
46
  "@vueuse/core": "*",
47
47
  "element-plus": "^2.1.8",
@@ -49,42 +49,41 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@element-plus/icons-vue": "^2.3.2",
52
+ "lodash-es": "^4.17.23",
52
53
  "vue-draggable-plus": "^0.5.6"
53
54
  },
54
55
  "devDependencies": {
56
+ "@tsdown/css": "^0.21.8",
55
57
  "@types/lodash-es": "^4.17.12",
56
58
  "@types/node": "^24.3.0",
57
- "@vitejs/plugin-vue": "^6.0.3",
58
- "@vitejs/plugin-vue-jsx": "^5.1.3",
59
- "@vitest/browser": "^4.0.16",
60
- "@vitest/browser-playwright": "^4.0.16",
61
- "@vitest/coverage-istanbul": "^4.0.16",
62
- "fast-glob": "^3.3.3",
63
- "lodash-es": "^4.17.23",
64
- "playwright": "^1.55.1",
59
+ "@vitejs/plugin-vue": "^6.0.6",
60
+ "@vitejs/plugin-vue-jsx": "^5.1.5",
61
+ "@vitest/browser": "^4.1.4",
62
+ "@vitest/browser-playwright": "^4.1.4",
63
+ "@vitest/coverage-istanbul": "^4.1.4",
64
+ "playwright": "^1.58.2",
65
65
  "sass-embedded": "^1.97.3",
66
- "typescript": "5.9.2",
67
- "vite": "^7.3.1",
68
- "vite-plugin-dts": "^4.5.4",
69
- "vite-plugin-lib-inject-css": "^2.2.2",
70
- "vitest": "^4.0.16",
66
+ "tsdown": "^0.21.7",
67
+ "typescript": "6.0.2",
68
+ "unplugin-vue": "^7.1.1",
69
+ "vite": "^8.0.8",
70
+ "vitest": "^4.1.4",
71
71
  "vitest-browser-vue": "^2.0.2",
72
- "@silver-formily/grid": "1.0.1",
72
+ "vue": "^3.5.27",
73
+ "vue-tsc": "^3.2.6",
74
+ "@silver-formily/grid": "1.0.2",
75
+ "@silver-formily/reactive-vue": "1.1.1",
73
76
  "@silver-formily/typescript-config": "0.0.0",
74
- "@silver-formily/vue": "2.3.1",
75
- "@silver-formily/reactive-vue": "1.0.0"
77
+ "@silver-formily/vue": "2.3.4"
76
78
  },
77
79
  "scripts": {
78
- "build": "vite build",
79
- "test": "vitest run --reporter=dot",
80
- "test:watch": "vitest",
81
- "test:run": "vitest run --browser.headless",
82
- "test:coverage": "vitest run --coverage --browser.headless",
80
+ "build": "tsdown --tsconfig tsconfig.build.json",
83
81
  "lint": "eslint .",
84
82
  "format": "eslint . --fix",
85
83
  "check-types": "vue-tsc --noEmit --project tsconfig.check.json",
86
- "docs:dev": "pnpm --filter element-plus-docs dev",
87
- "docs:build": "pnpm turbo run docs:build --filter=element-plus-docs",
88
- "docs:preview": "pnpm --filter element-plus-docs preview"
84
+ "test": "vitest run --reporter=dot",
85
+ "test:watch": "vitest",
86
+ "test:run": "vitest run --browser.headless",
87
+ "test:coverage": "vitest run --coverage --browser.headless"
89
88
  }
90
89
  }
@@ -1 +0,0 @@
1
- export declare const stylePrefix = "formily-element-plus";
@@ -1,2 +0,0 @@
1
- export * from './configs';
2
- export * from './shared';
@@ -1,23 +0,0 @@
1
- import { stylePrefix as r } from "./configs/index.mjs";
2
- import { loadElConfigProvider as i } from "./shared/load-config-provider.mjs";
3
- import { getTransitionDuration as p, loading as m, useDebonceSubmitting as s } from "./shared/loading.mjs";
4
- import { lt as l, quickVersionCompare as f } from "./shared/simple-version-compare.mjs";
5
- import { mapReadPretty as d } from "./shared/transform-component.mjs";
6
- import { compatibleUnderlineProp as c, composeExport as g, hasSlotContent as C, isVnodeEmpty as P, isVueOptions as b, useCleanAttrs as y } from "./shared/utils.mjs";
7
- export {
8
- c as compatibleUnderlineProp,
9
- g as composeExport,
10
- p as getTransitionDuration,
11
- C as hasSlotContent,
12
- P as isVnodeEmpty,
13
- b as isVueOptions,
14
- i as loadElConfigProvider,
15
- m as loading,
16
- l as lt,
17
- d as mapReadPretty,
18
- f as quickVersionCompare,
19
- r as stylePrefix,
20
- y as useCleanAttrs,
21
- s as useDebonceSubmitting
22
- };
23
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,6 +0,0 @@
1
- export * from './load-config-provider';
2
- export * from './loading';
3
- export * from './simple-version-compare';
4
- export * from './transform-component';
5
- export * from './types';
6
- export * from './utils';
@@ -1,21 +0,0 @@
1
- import { loadElConfigProvider as t } from "./load-config-provider.mjs";
2
- import { getTransitionDuration as i, loading as n, useDebonceSubmitting as p } from "./loading.mjs";
3
- import { lt as a, quickVersionCompare as s } from "./simple-version-compare.mjs";
4
- import { mapReadPretty as d } from "./transform-component.mjs";
5
- import { compatibleUnderlineProp as u, composeExport as x, hasSlotContent as c, isVnodeEmpty as g, isVueOptions as C, useCleanAttrs as b } from "./utils.mjs";
6
- export {
7
- u as compatibleUnderlineProp,
8
- x as composeExport,
9
- i as getTransitionDuration,
10
- c as hasSlotContent,
11
- g as isVnodeEmpty,
12
- C as isVueOptions,
13
- t as loadElConfigProvider,
14
- n as loading,
15
- a as lt,
16
- d as mapReadPretty,
17
- s as quickVersionCompare,
18
- b as useCleanAttrs,
19
- p as useDebonceSubmitting
20
- };
21
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1,2 +0,0 @@
1
- import { ConfigProviderProps } from 'element-plus';
2
- export declare const loadElConfigProvider: () => Partial<ConfigProviderProps>;
@@ -1,12 +0,0 @@
1
- import { Form } from '@formily/core';
2
- export declare function loading(loadingText: string, processor: () => Promise<any>): Promise<any>;
3
- /**
4
- * 获取当前element-plus的过渡时长并转换为毫秒
5
- * @param cssVarName CSS 变量名,默认为 '--el-transition-duration'
6
- * @param defaultValue 默认值(毫秒),默认为 200
7
- * @returns 过渡时长(毫秒)
8
- */
9
- export declare function getTransitionDuration(cssVarName?: string, defaultValue?: number): number;
10
- export declare function useDebonceSubmitting(form: Form): {
11
- internalSubmitting: import('vue').Ref<boolean, boolean>;
12
- };
@@ -1,2 +0,0 @@
1
- export declare function quickVersionCompare(v1: string, v2: string): number;
2
- export declare function lt(v1: string, v2: string): boolean;
@@ -1,3 +0,0 @@
1
- import { IComponentMapper } from '../../../../vue/src';
2
- import { Component } from 'vue';
3
- export declare function mapReadPretty(component: Component, readPrettyProps?: Record<string, any>): IComponentMapper;
@@ -1,2 +0,0 @@
1
- import { Component, VNode } from 'vue';
2
- export type SlotTypes = Component | string | number | ((props: Record<string, any>) => VNode[] | VNode) | VNode;
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=types.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import { Ref } from 'vue';
2
- export interface UseEnterSubmitOptions {
3
- visible: Ref<boolean>;
4
- resolve: () => void;
5
- submitting: Ref<boolean>;
6
- getContainer: () => HTMLElement | null;
7
- enabled?: Ref<boolean> | boolean;
8
- }
9
- export declare function useEnterSubmit({ visible, resolve, submitting, getContainer, enabled }: UseEnterSubmitOptions): void;
@@ -1,9 +0,0 @@
1
- import { Component, ComputedRef, Slot, VNode } from 'vue';
2
- export declare function useCleanAttrs(removeAttrsList?: string[]): {
3
- props: ComputedRef<Record<string, any>>;
4
- };
5
- export declare function isVueOptions(options: any): options is Component;
6
- export declare function composeExport<T0 extends object, T1 extends object>(s0: T0, s1: T1): T0 & T1;
7
- export declare function isVnodeEmpty(vnodes: Array<VNode>): boolean;
8
- export declare function hasSlotContent(slot: Slot<any> | undefined): boolean;
9
- export declare function compatibleUnderlineProp(): false | "never";
@@ -1,5 +0,0 @@
1
- import { IArrayBaseAdditionProps } from './types';
2
- declare const _default: import('vue').DefineComponent<IArrayBaseAdditionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IArrayBaseAdditionProps> & Readonly<{}>, {
3
- method: "push" | "unshift";
4
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
5
- export default _default;