fast-element-plus 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (386) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +2 -2
  3. package/README.zh.md +2 -2
  4. package/dist/components/button/src/button.mjs +1 -1
  5. package/dist/components/carNumber/src/carNumber.mjs +2 -3
  6. package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
  7. package/dist/components/contextMenu/src/contextMenu.mjs +2 -2
  8. package/dist/components/dialog/src/dialog.mjs +1 -1
  9. package/dist/components/drawer/src/drawer.mjs +1 -1
  10. package/dist/components/form/src/form.mjs +1 -2
  11. package/dist/components/form/src/form.mjs.map +1 -1
  12. package/dist/components/form/src/formItem.mjs +1 -1
  13. package/dist/components/iconSelector/src/iconSelector.mjs +1 -2
  14. package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -1
  15. package/dist/components/inputDialogPage/src/inputDialogPage.mjs +2 -5
  16. package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
  17. package/dist/components/layoutGrid/src/layoutGrid.mjs +1 -3
  18. package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
  19. package/dist/components/layoutGrid/src/layoutGridItem.mjs +1 -1
  20. package/dist/components/select/src/select.mjs +2 -9
  21. package/dist/components/select/src/select.mjs.map +1 -1
  22. package/dist/components/select/src/selectOption.mjs +1 -1
  23. package/dist/components/selectPage/src/selectPage.mjs +2 -9
  24. package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
  25. package/dist/components/selectV2/src/selectV2.mjs +2 -9
  26. package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
  27. package/dist/components/table/src/table.mjs +1 -9
  28. package/dist/components/table/src/table.mjs.map +1 -1
  29. package/dist/components/table/src/tableColumn.mjs +1 -6
  30. package/dist/components/table/src/tableColumn.mjs.map +1 -1
  31. package/dist/components/table/src/tableColumnSettingDialog.mjs +1 -1
  32. package/dist/components/table/src/tablePagination.mjs +1 -2
  33. package/dist/components/table/src/tablePagination.mjs.map +1 -1
  34. package/dist/components/table/src/tableSearchFormItem.mjs +1 -1
  35. package/dist/components/table/src/useTable.mjs +1 -2
  36. package/dist/components/table/src/useTable.mjs.map +1 -1
  37. package/dist/components/table/utils/table.mjs +1 -3
  38. package/dist/components/table/utils/table.mjs.map +1 -1
  39. package/dist/components/tree/src/tree.mjs +2 -7
  40. package/dist/components/tree/src/tree.mjs.map +1 -1
  41. package/dist/components/treeSelect/src/treeSelect.mjs +2 -9
  42. package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
  43. package/dist/components/upload/src/upload.mjs +1 -3
  44. package/dist/components/upload/src/upload.mjs.map +1 -1
  45. package/dist/components/upload/src/useUpload.mjs +3 -5
  46. package/dist/components/upload/src/useUpload.mjs.map +1 -1
  47. package/dist/components/uploadImage/src/uploadImage.mjs +1 -3
  48. package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
  49. package/dist/components/uploadImages/src/uploadImages.mjs +1 -2
  50. package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
  51. package/dist/element-plus.mjs +1 -2
  52. package/dist/element-plus.mjs.map +1 -1
  53. package/dist/hooks/use-screenFull/index.mjs +13 -13
  54. package/dist/hooks/use-screenFull/index.mjs.map +1 -1
  55. package/dist/index.d.ts +0 -2
  56. package/dist/index.global.min.js +4 -4
  57. package/dist/index.global.min.js.map +1 -1
  58. package/dist/index.mjs +2 -3
  59. package/dist/index.mjs.map +1 -1
  60. package/dist/version.d.ts +1 -1
  61. package/dist/version.mjs +1 -1
  62. package/dist/version.mjs.map +1 -1
  63. package/package.json +1 -1
  64. package/dist/_virtual/_rolldown/runtime.mjs +0 -13
  65. package/dist/components/index.mjs +0 -124
  66. package/dist/components/index.mjs.map +0 -1
  67. package/dist/node_modules/.pnpm/@vueuse_core@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.mjs +0 -100
  68. package/dist/node_modules/.pnpm/@vueuse_core@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.mjs.map +0 -1
  69. package/dist/node_modules/.pnpm/@vueuse_shared@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.mjs +0 -25
  70. package/dist/node_modules/.pnpm/@vueuse_shared@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.mjs.map +0 -1
  71. package/dist/node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.mjs +0 -1997
  72. package/dist/node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.mjs.map +0 -1
  73. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_DataView.mjs +0 -8
  74. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_DataView.mjs.map +0 -1
  75. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Hash.mjs +0 -30
  76. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Hash.mjs.map +0 -1
  77. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.mjs +0 -30
  78. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.mjs.map +0 -1
  79. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Map.mjs +0 -8
  80. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Map.mjs.map +0 -1
  81. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.mjs +0 -30
  82. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.mjs.map +0 -1
  83. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Promise.mjs +0 -8
  84. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Promise.mjs.map +0 -1
  85. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Set.mjs +0 -8
  86. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Set.mjs.map +0 -1
  87. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.mjs +0 -23
  88. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.mjs.map +0 -1
  89. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Stack.mjs +0 -27
  90. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Stack.mjs.map +0 -1
  91. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.mjs +0 -8
  92. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.mjs.map +0 -1
  93. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.mjs +0 -8
  94. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.mjs.map +0 -1
  95. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.mjs +0 -8
  96. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.mjs.map +0 -1
  97. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_apply.mjs +0 -24
  98. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_apply.mjs.map +0 -1
  99. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.mjs +0 -19
  100. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.mjs.map +0 -1
  101. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.mjs +0 -22
  102. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.mjs.map +0 -1
  103. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.mjs +0 -26
  104. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.mjs.map +0 -1
  105. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.mjs +0 -19
  106. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.mjs.map +0 -1
  107. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.mjs +0 -18
  108. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.mjs.map +0 -1
  109. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.mjs +0 -20
  110. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.mjs.map +0 -1
  111. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.mjs +0 -23
  112. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.mjs.map +0 -1
  113. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.mjs +0 -19
  114. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.mjs.map +0 -1
  115. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.mjs +0 -19
  116. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.mjs.map +0 -1
  117. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.mjs +0 -19
  118. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.mjs.map +0 -1
  119. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.mjs +0 -24
  120. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.mjs.map +0 -1
  121. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.mjs +0 -118
  122. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.mjs.map +0 -1
  123. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.mjs +0 -27
  124. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.mjs.map +0 -1
  125. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.mjs +0 -31
  126. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseFlatten.mjs.map +0 -1
  127. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.mjs +0 -21
  128. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.mjs.map +0 -1
  129. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.mjs +0 -22
  130. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.mjs.map +0 -1
  131. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.mjs +0 -24
  132. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.mjs.map +0 -1
  133. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.mjs +0 -19
  134. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.mjs.map +0 -1
  135. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.mjs +0 -26
  136. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.mjs.map +0 -1
  137. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.mjs +0 -61
  138. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.mjs.map +0 -1
  139. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.mjs +0 -19
  140. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.mjs.map +0 -1
  141. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.mjs +0 -37
  142. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.mjs.map +0 -1
  143. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.mjs +0 -19
  144. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.mjs.map +0 -1
  145. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.mjs +0 -47
  146. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.mjs.map +0 -1
  147. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.mjs +0 -22
  148. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.mjs.map +0 -1
  149. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.mjs +0 -23
  150. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.mjs.map +0 -1
  151. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.mjs +0 -24
  152. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.mjs.map +0 -1
  153. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSlice.mjs +0 -25
  154. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseSlice.mjs.map +0 -1
  155. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.mjs +0 -19
  156. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.mjs.map +0 -1
  157. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.mjs +0 -29
  158. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.mjs.map +0 -1
  159. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.mjs +0 -17
  160. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.mjs.map +0 -1
  161. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnset.mjs +0 -31
  162. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseUnset.mjs.map +0 -1
  163. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.mjs +0 -16
  164. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.mjs.map +0 -1
  165. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castPath.mjs +0 -21
  166. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_castPath.mjs.map +0 -1
  167. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.mjs +0 -18
  168. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.mjs.map +0 -1
  169. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.mjs +0 -27
  170. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.mjs.map +0 -1
  171. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.mjs +0 -18
  172. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.mjs.map +0 -1
  173. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.mjs +0 -19
  174. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.mjs.map +0 -1
  175. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.mjs +0 -19
  176. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.mjs.map +0 -1
  177. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.mjs +0 -18
  178. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.mjs.map +0 -1
  179. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.mjs +0 -19
  180. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.mjs.map +0 -1
  181. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.mjs +0 -30
  182. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.mjs.map +0 -1
  183. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.mjs +0 -18
  184. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.mjs.map +0 -1
  185. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.mjs +0 -18
  186. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.mjs.map +0 -1
  187. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.mjs +0 -8
  188. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.mjs.map +0 -1
  189. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_customOmitClone.mjs +0 -18
  190. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_customOmitClone.mjs.map +0 -1
  191. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.mjs +0 -13
  192. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.mjs.map +0 -1
  193. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.mjs +0 -57
  194. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.mjs.map +0 -1
  195. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.mjs +0 -77
  196. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.mjs.map +0 -1
  197. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.mjs +0 -56
  198. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.mjs.map +0 -1
  199. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_flatRest.mjs +0 -18
  200. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_flatRest.mjs.map +0 -1
  201. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.mjs +0 -7
  202. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.mjs.map +0 -1
  203. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.mjs +0 -18
  204. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.mjs.map +0 -1
  205. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.mjs +0 -19
  206. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.mjs.map +0 -1
  207. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.mjs +0 -18
  208. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.mjs.map +0 -1
  209. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getNative.mjs +0 -19
  210. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getNative.mjs.map +0 -1
  211. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.mjs +0 -8
  212. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.mjs.map +0 -1
  213. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.mjs +0 -38
  214. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.mjs.map +0 -1
  215. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.mjs +0 -24
  216. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.mjs.map +0 -1
  217. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.mjs +0 -24
  218. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.mjs.map +0 -1
  219. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getTag.mjs +0 -45
  220. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getTag.mjs.map +0 -1
  221. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getValue.mjs +0 -16
  222. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getValue.mjs.map +0 -1
  223. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.mjs +0 -17
  224. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.mjs.map +0 -1
  225. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.mjs +0 -20
  226. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.mjs.map +0 -1
  227. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.mjs +0 -27
  228. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.mjs.map +0 -1
  229. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.mjs +0 -21
  230. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.mjs.map +0 -1
  231. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.mjs +0 -24
  232. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.mjs.map +0 -1
  233. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.mjs +0 -22
  234. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.mjs.map +0 -1
  235. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.mjs +0 -66
  236. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.mjs.map +0 -1
  237. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.mjs +0 -18
  238. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.mjs.map +0 -1
  239. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.mjs +0 -20
  240. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isFlattenable.mjs.map +0 -1
  241. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.mjs +0 -22
  242. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.mjs.map +0 -1
  243. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKey.mjs +0 -24
  244. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKey.mjs.map +0 -1
  245. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.mjs +0 -16
  246. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.mjs.map +0 -1
  247. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.mjs +0 -21
  248. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.mjs.map +0 -1
  249. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.mjs +0 -18
  250. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.mjs.map +0 -1
  251. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.mjs +0 -16
  252. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.mjs.map +0 -1
  253. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.mjs +0 -25
  254. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.mjs.map +0 -1
  255. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.mjs +0 -19
  256. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.mjs.map +0 -1
  257. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.mjs +0 -18
  258. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.mjs.map +0 -1
  259. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.mjs +0 -24
  260. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.mjs.map +0 -1
  261. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.mjs +0 -23
  262. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.mjs.map +0 -1
  263. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.mjs +0 -20
  264. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.mjs.map +0 -1
  265. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.mjs +0 -18
  266. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.mjs.map +0 -1
  267. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.mjs +0 -18
  268. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.mjs.map +0 -1
  269. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.mjs +0 -22
  270. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.mjs.map +0 -1
  271. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.mjs +0 -19
  272. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.mjs.map +0 -1
  273. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.mjs +0 -24
  274. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.mjs.map +0 -1
  275. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.mjs +0 -7
  276. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.mjs.map +0 -1
  277. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.mjs +0 -7
  278. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.mjs.map +0 -1
  279. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.mjs +0 -19
  280. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.mjs.map +0 -1
  281. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.mjs +0 -20
  282. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.mjs.map +0 -1
  283. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.mjs +0 -21
  284. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.mjs.map +0 -1
  285. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overArg.mjs +0 -18
  286. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overArg.mjs.map +0 -1
  287. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overRest.mjs +0 -28
  288. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_overRest.mjs.map +0 -1
  289. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_parent.mjs +0 -18
  290. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_parent.mjs.map +0 -1
  291. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_root.mjs +0 -10
  292. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_root.mjs.map +0 -1
  293. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.mjs +0 -21
  294. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.mjs.map +0 -1
  295. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.mjs +0 -17
  296. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.mjs.map +0 -1
  297. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.mjs +0 -19
  298. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.mjs.map +0 -1
  299. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToString.mjs +0 -16
  300. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_setToString.mjs.map +0 -1
  301. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.mjs +0 -29
  302. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.mjs.map +0 -1
  303. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.mjs +0 -17
  304. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.mjs.map +0 -1
  305. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.mjs +0 -19
  306. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.mjs.map +0 -1
  307. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.mjs +0 -17
  308. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.mjs.map +0 -1
  309. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.mjs +0 -17
  310. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.mjs.map +0 -1
  311. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.mjs +0 -35
  312. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.mjs.map +0 -1
  313. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.mjs +0 -25
  314. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.mjs.map +0 -1
  315. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toKey.mjs +0 -20
  316. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toKey.mjs.map +0 -1
  317. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toSource.mjs +0 -25
  318. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_toSource.mjs.map +0 -1
  319. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/constant.mjs +0 -29
  320. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/constant.mjs.map +0 -1
  321. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/eq.mjs +0 -40
  322. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/eq.mjs.map +0 -1
  323. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.mjs +0 -23
  324. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/flatten.mjs.map +0 -1
  325. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/identity.mjs +0 -24
  326. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/identity.mjs.map +0 -1
  327. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArguments.mjs +0 -36
  328. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArguments.mjs.map +0 -1
  329. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs +0 -29
  330. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs.map +0 -1
  331. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.mjs +0 -35
  332. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.mjs.map +0 -1
  333. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBoolean.mjs +0 -29
  334. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBoolean.mjs.map +0 -1
  335. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.mjs +0 -31
  336. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.mjs.map +0 -1
  337. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.mjs +0 -37
  338. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isEqual.mjs.map +0 -1
  339. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isFunction.mjs +0 -34
  340. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isFunction.mjs.map +0 -1
  341. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isLength.mjs +0 -36
  342. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isLength.mjs.map +0 -1
  343. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isMap.mjs +0 -27
  344. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isMap.mjs.map +0 -1
  345. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.mjs +0 -28
  346. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.mjs.map +0 -1
  347. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNull.mjs +0 -25
  348. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNull.mjs.map +0 -1
  349. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.mjs +0 -38
  350. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.mjs.map +0 -1
  351. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.mjs +0 -34
  352. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObject.mjs.map +0 -1
  353. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.mjs +0 -32
  354. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.mjs.map +0 -1
  355. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.mjs +0 -54
  356. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isPlainObject.mjs.map +0 -1
  357. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSet.mjs +0 -27
  358. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSet.mjs.map +0 -1
  359. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs +0 -30
  360. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs.map +0 -1
  361. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.mjs +0 -29
  362. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.mjs.map +0 -1
  363. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.mjs +0 -27
  364. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.mjs.map +0 -1
  365. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.mjs +0 -25
  366. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.mjs.map +0 -1
  367. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keys.mjs +0 -39
  368. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keys.mjs.map +0 -1
  369. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keysIn.mjs +0 -34
  370. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keysIn.mjs.map +0 -1
  371. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/last.mjs +0 -23
  372. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/last.mjs.map +0 -1
  373. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/memoize.mjs +0 -65
  374. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/memoize.mjs.map +0 -1
  375. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/omit.mjs +0 -52
  376. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/omit.mjs.map +0 -1
  377. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubArray.mjs +0 -26
  378. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubArray.mjs.map +0 -1
  379. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.mjs +0 -21
  380. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.mjs.map +0 -1
  381. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toString.mjs +0 -30
  382. package/dist/node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toString.mjs.map +0 -1
  383. package/dist/node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs +0 -120
  384. package/dist/node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs.map +0 -1
  385. package/dist/node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.mjs +0 -1925
  386. package/dist/node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.mjs.map +0 -1
@@ -2,13 +2,11 @@ import { useExpose } from "../../../utils/vue/expose.mjs";
2
2
  import { definePropType, useProps } from "../../../utils/vue/props.mjs";
3
3
  import { useRender } from "../../../utils/vue/render.mjs";
4
4
  import { makeSlots } from "../../../utils/vue/slots.mjs";
5
- import isArray from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs";
6
- import isString from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs";
7
- import isNull from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNull.mjs";
8
5
  import { useUpload } from "./useUpload.mjs";
9
6
  import { Fragment, computed, createTextVNode, createVNode, defineComponent, mergeProps, ref, resolveDirective, withDirectives } from "vue";
10
7
  import { UploadFilled } from "@element-plus/icons-vue";
11
8
  import { ElIcon, ElUpload, uploadProps } from "element-plus";
9
+ import { isArray, isNull, isString } from "lodash-unified";
12
10
  //#region src/components/upload/src/upload.tsx
13
11
  /** FaUpload 的运行时 Props 定义。 */
14
12
  const faUploadProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"upload.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/upload/src/upload.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, ref } from \"vue\";\nimport { UploadFilled } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull, isString } from \"lodash-unified\";\nimport { definePropType, makeSlots, useExpose, useProps, useRender } from \"../../../utils\";\nimport { useUpload } from \"./useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile } from \"element-plus\";\nimport type { VNode } from \"vue\";\n\n/** FaUpload 的运行时 Props 定义。 */\nexport const faUploadProps = {\n\t...uploadProps,\n\t/** @description whether to activate drag and drop mode */\n\tdrag: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description maximum number of uploads allowed */\n\tlimit: {\n\t\ttype: Number,\n\t\tdefault: 1,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: definePropType<string | number>([String, Number]),\n\t\tdefault: 5120,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n};\n\n/** FaUpload 的运行时 Emits 定义。 */\nexport const faUploadEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n\t/** @description 改变 */\n\tchange: (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n};\n\n/** FaUpload 的插槽参数。 */\nexport interface FaUploadSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n\t/** @description 触发文件选择框的内容 */\n\ttrigger: never;\n\t/** @description 提示说明文字 */\n\ttip: never;\n\t/** @description 缩略图模板的内容 */\n\tfile: { file: UploadFile; index: number };\n}\n\nexport default defineComponent({\n\tname: \"FaUpload\",\n\tprops: faUploadProps,\n\temits: faUploadEmits,\n\tslots: makeSlots<FaUploadSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload(\"FaUpload\", \"文件\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleOnChange: UploadProps[\"onChange\"] = (uploadFile, uploadFiles) => {\n\t\t\tif (uploadFile.status !== \"ready\") return;\n\n\t\t\tif (!handleOnUpload(uploadFile)) {\n\t\t\t\tfileList.value = fileList.value.filter((item) => item.uid !== uploadFile.uid);\n\t\t\t} else {\n\t\t\t\tprops.onChange?.(uploadFile, uploadFiles);\n\t\t\t}\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\t// onChange 已完成首次校验;被移除的非法文件不能在自动上传流程中继续提交。\n\t\t\tif (!fileList.value.some((item) => item.uid === rawFile.uid) || !handleOnUpload(rawFile)) return false;\n\t\t\treturn props.beforeUpload?.(rawFile) ?? true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t\t\"onChange\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<ElUpload\n\t\t\t\t{...elUploadProps.value}\n\t\t\t\tref={uploadRef}\n\t\t\t\tclass={[\"fa-upload\", { \"fa-upload__default\": !slots.default }]}\n\t\t\t\tvLoading={loading.value}\n\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\tdisabled={disabled.value}\n\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\tonError={handleOnError}\n\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\tonChange={handleOnChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\tslots.default ? (\n\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<ElIcon class=\"el-icon--upload\">\n\t\t\t\t\t\t\t\t\t<UploadFilled />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t<div class=\"el-upload__text\">\n\t\t\t\t\t\t\t\t\tDrop file here or <em>click to upload</em>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t),\n\t\t\t\t\t...(slots.trigger && { trigger: (): VNode | VNode[] => slots.trigger?.() ?? [] }),\n\t\t\t\t\ttip: () =>\n\t\t\t\t\t\tslots.tip ? (\n\t\t\t\t\t\t\tslots.tip()\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<div class=\"el-upload__tip\">files with a size less than {maxSizeMB.value.toString()}MB</div>\n\t\t\t\t\t\t\t\t{!props.showFileList && fileList.value.length > 0 && (\n\t\t\t\t\t\t\t\t\t<div class=\"el-upload__tip\">\n\t\t\t\t\t\t\t\t\t\t{fileList.value.map((item, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t{item.name}\n\t\t\t\t\t\t\t\t\t\t\t\t{fileList.value.length <= index && <br />}\n\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t),\n\t\t\t\t\t...(slots.file && {\n\t\t\t\t\t\tfile: ({ file, index }: { file: UploadFile; index: number }): VNode | VNode[] => slots.file?.({ file, index }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElUpload>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;AAUA,MAAa,gBAAgB;CAC5B,GAAG;;CAEH,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,OAAO;EACN,MAAM;EACN,SAAS;CACV;;CAEA,YAAY,eAAyC,CAAC,QAAQ,KAAK,CAAC;;CAEpE,SAAS;EACR,MAAM,eAAgC,CAAC,QAAQ,M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CAEH,CAAA;GAGJ,GAAI,MAAM,QAAQ,EACjB,OAAO,EAAE,MAAM,YAAkE,MAAM,OAAO;IAAE;IAAM;GAAM,CAAC,KAAK,CAAA,EACnH;EAAE,CAAA,GAAA,CAAA,CAAA,iBAAA,SAAA,GA9CO,QAAQ,KAAK,CAAA,CAAA,CAiDxB;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,QAAQ,eAAe,UAAU,OAAO,MAAM;;GAE9C,YAAY,eAAe,UAAU,OAAO,UAAU;;GAEtD,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,cAAc,eAAe,UAAU,OAAO,YAAY;;GAE1D;;GAEA;EACD,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"upload.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/upload/src/upload.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, ref } from \"vue\";\nimport { UploadFilled } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull, isString } from \"lodash-unified\";\nimport { definePropType, makeSlots, useExpose, useProps, useRender } from \"../../../utils\";\nimport { useUpload } from \"./useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile } from \"element-plus\";\nimport type { VNode } from \"vue\";\n\n/** FaUpload 的运行时 Props 定义。 */\nexport const faUploadProps = {\n\t...uploadProps,\n\t/** @description whether to activate drag and drop mode */\n\tdrag: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description maximum number of uploads allowed */\n\tlimit: {\n\t\ttype: Number,\n\t\tdefault: 1,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: definePropType<string | number>([String, Number]),\n\t\tdefault: 5120,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n};\n\n/** FaUpload 的运行时 Emits 定义。 */\nexport const faUploadEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n\t/** @description 改变 */\n\tchange: (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n};\n\n/** FaUpload 的插槽参数。 */\nexport interface FaUploadSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n\t/** @description 触发文件选择框的内容 */\n\ttrigger: never;\n\t/** @description 提示说明文字 */\n\ttip: never;\n\t/** @description 缩略图模板的内容 */\n\tfile: { file: UploadFile; index: number };\n}\n\nexport default defineComponent({\n\tname: \"FaUpload\",\n\tprops: faUploadProps,\n\temits: faUploadEmits,\n\tslots: makeSlots<FaUploadSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload(\"FaUpload\", \"文件\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleOnChange: UploadProps[\"onChange\"] = (uploadFile, uploadFiles) => {\n\t\t\tif (uploadFile.status !== \"ready\") return;\n\n\t\t\tif (!handleOnUpload(uploadFile)) {\n\t\t\t\tfileList.value = fileList.value.filter((item) => item.uid !== uploadFile.uid);\n\t\t\t} else {\n\t\t\t\tprops.onChange?.(uploadFile, uploadFiles);\n\t\t\t}\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\t// onChange 已完成首次校验;被移除的非法文件不能在自动上传流程中继续提交。\n\t\t\tif (!fileList.value.some((item) => item.uid === rawFile.uid) || !handleOnUpload(rawFile)) return false;\n\t\t\treturn props.beforeUpload?.(rawFile) ?? true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t\t\"onChange\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<ElUpload\n\t\t\t\t{...elUploadProps.value}\n\t\t\t\tref={uploadRef}\n\t\t\t\tclass={[\"fa-upload\", { \"fa-upload__default\": !slots.default }]}\n\t\t\t\tvLoading={loading.value}\n\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\tdisabled={disabled.value}\n\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\tonError={handleOnError}\n\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\tonChange={handleOnChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\tslots.default ? (\n\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<ElIcon class=\"el-icon--upload\">\n\t\t\t\t\t\t\t\t\t<UploadFilled />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t<div class=\"el-upload__text\">\n\t\t\t\t\t\t\t\t\tDrop file here or <em>click to upload</em>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t),\n\t\t\t\t\t...(slots.trigger && { trigger: (): VNode | VNode[] => slots.trigger?.() ?? [] }),\n\t\t\t\t\ttip: () =>\n\t\t\t\t\t\tslots.tip ? (\n\t\t\t\t\t\t\tslots.tip()\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<div class=\"el-upload__tip\">files with a size less than {maxSizeMB.value.toString()}MB</div>\n\t\t\t\t\t\t\t\t{!props.showFileList && fileList.value.length > 0 && (\n\t\t\t\t\t\t\t\t\t<div class=\"el-upload__tip\">\n\t\t\t\t\t\t\t\t\t\t{fileList.value.map((item, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t{item.name}\n\t\t\t\t\t\t\t\t\t\t\t\t{fileList.value.length <= index && <br />}\n\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t),\n\t\t\t\t\t...(slots.file && {\n\t\t\t\t\t\tfile: ({ file, index }: { file: UploadFile; index: number }): VNode | VNode[] => slots.file?.({ file, index }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElUpload>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,gBAAgB;CAC5B,GAAG;;CAEH,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,OAAO;EACN,MAAM;EACN,SAAS;CACV;;CAEA,YAAY,eAAyC,CAAC,QAAQ,KAAK,CAAC;;CAEpE,SAAS;EACR,MAAM,eAAgC,CAAC,QAAQ,MAAM,CAAC;EACtD,SAAS;CACV;;CAEA,WAAW,EACV,MAAM,eAAwD,QAAQ,EACvE;;CAEA,WAAW;AACZ;;AAGA,MAAa,gBAAgB;;CAE5B,sBAAsB,UAA6C,SAAS,KAAK,KAAK,QAAQ,KAAK,KAAK,OAAO,KAAK;;CAEpH,oBAAoB,UAAqC,QAAQ,KAAK;;CAEtE,SAAS,UAA6C,SAAS,KAAK,KAAK,QAAQ,KAAK,KAAK,OAAO,KAAK;AACxG;AAcA,IAAA,iBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAAyB;CAChC,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACrC,MAAM,EACL,UACA,SACA,aACA,WACA,mBACA,iBACA,eACA,gBACA,gBACA,mBACG,UAAU,YAAY,MAAM,OAAO,MAAM;GAC5C,IAAI,UAAU;IACb,OAAO,MAAM;GACd;GACA,IAAI,YAAY;IACf,OAAO,MAAM;GACd;GACA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AA,OAAA,EAAA,SAAA,kBAAA,GAAA,CAAA,gBAAA,oBAAA,GAAA,YAAA,MAAA,MAAA,CAAA,gBAAA,iBAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GAWjB,GAAI,MAAM,WAAW,EAAE,eAAgC,MAAM,UAAU,KAAK,CAAA,EAAG;GAC/E,WACC,MAAM,MACL,MAAM,IAAI,IAAC,YAAA,UAAA,MAAA,CAAA,YAAA,OAAA,EAAA,SAAA,iBAAA,GAAA;IAAA,gBAAA,8BAAA;IAG+C,UAAU,MAAM,SAAS;IAAC,gBAAA,IAAA;GAAA,CAAA,GAClF,CAAC,MAAM,gBAAgB,SAAS,MAAM,SAAS,KAAC,YAAA,OAAA,EAAA,SAAA,iBAAA,GAAA,CAE9C,SAAS,MAAM,KAAK,MAAM,UAAK,YAAA,UAAA,MAAA,CAE7B,KAAK,MACL,SAAS,MAAM,UAAU,SAAK,YAAA,MAAA,MAAA,IAAA,CAAU,CAAA,CAE1C,CAAC,CAAA,CAEH,CAAA;GAGJ,GAAI,MAAM,QAAQ,EACjB,OAAO,EAAE,MAAM,YAAkE,MAAM,OAAO;IAAE;IAAM;GAAM,CAAC,KAAK,CAAA,EACnH;EAAE,CAAA,GAAA,CAAA,CAAA,iBAAA,SAAA,GA9CO,QAAQ,KAAK,CAAA,CAAA,CAiDxB;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,QAAQ,eAAe,UAAU,OAAO,MAAM;;GAE9C,YAAY,eAAe,UAAU,OAAO,UAAU;;GAEtD,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,cAAc,eAAe,UAAU,OAAO,YAAY;;GAE1D;;GAEA;EACD,CAAC;CACF;AACD,CAAC"}
@@ -1,11 +1,9 @@
1
- import isArray from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs";
2
- import isString from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs";
3
- import isNumber from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNumber.mjs";
4
- import { useVModel } from "../../../node_modules/.pnpm/@vueuse_core@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.mjs";
5
- import { Decimal } from "../../../node_modules/.pnpm/decimal.js@10.6.0/node_modules/decimal.js/decimal.mjs";
6
1
  import { uploadUtil } from "../utils/upload.mjs";
7
2
  import { computed, inject, onMounted, ref, watch } from "vue";
8
3
  import { ElMessage, ElNotification, formContextKey, formItemContextKey, genFileId, uploadProps } from "element-plus";
4
+ import { isArray, isNumber, isString } from "lodash-unified";
5
+ import { useVModel } from "@vueuse/core";
6
+ import { Decimal } from "decimal.js";
9
7
  //#region src/components/upload/src/useUpload.ts
10
8
  /**
11
9
  * 创建上传组件共享的文件状态和操作方法。
@@ -1 +1 @@
1
- {"version":3,"file":"useUpload.mjs","names":[],"sources":["../../../../src/components/upload/src/useUpload.ts"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, inject, onMounted, ref, watch } from \"vue\";\nimport { ElMessage, ElNotification, formContextKey, formItemContextKey, genFileId, uploadProps } from \"element-plus\";\nimport { isArray, isNumber, isString } from \"lodash-unified\";\nimport { Decimal } from \"decimal.js\";\nimport { uploadUtil } from \"../utils/upload\";\nimport type {\n\tFormContext,\n\tFormItemContext,\n\tUploadFile,\n\tUploadFiles,\n\tUploadProps,\n\tUploadRawFile,\n\tUploadRequestOptions,\n\tUploadUserFile,\n} from \"element-plus\";\nimport type { ComputedRef, Ref, WritableComputedRef } from \"vue\";\n\ninterface UploadComposable {\n\tfileList: WritableComputedRef<UploadUserFile[]>;\n\tloading: Ref<boolean>;\n\tformContext: FormContext | undefined;\n\tformItemContext: FormItemContext | undefined;\n\tmaxSizeMB: ComputedRef<Decimal>;\n\thandleValue: () => void;\n\thandleHttpRequest: (options: UploadRequestOptions) => Promise<void>;\n\thandleOnSuccess: (fileUrl: string, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;\n\thandleOnError: (error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;\n\thandleOnRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void;\n\thandleOnExceed: (files: File[], uploadFiles: UploadUserFile[]) => void;\n\thandleOnUpload: (file: UploadFile | UploadRawFile) => boolean;\n}\n\n/**\n * 创建上传组件共享的文件状态和操作方法。\n *\n * @param componentName - 组件名称。\n * @param fileTypeName - 文件类型名称。\n * @param props - 上传组件的 Props。\n * @param emit - 上传组件的事件触发器。\n * @param options - 文件大小和类型校验配置。\n * @returns 文件列表、加载状态和上传操作方法。\n */\nexport const useUpload = <T extends string | string[]>(\n\tcomponentName: string,\n\tfileTypeName: string,\n\tprops: Partial<UploadProps> & {\n\t\tmodelValue?: T | null;\n\t},\n\temit: ((event: \"update:fileList\", value: UploadUserFile[]) => void) &\n\t\t((event: \"update:modelValue\", value: T | null) => void) &\n\t\t((event: \"change\", value: T | null) => void),\n\tdata?: {\n\t\tmaxSize?: string | number;\n\t\tuploadApi?: (formData: FormData) => Promise<string>;\n\t\tuploadUrl?: string;\n\t}\n): UploadComposable => {\n\tconst fileListModel = useVModel(props, \"fileList\", emit, { passive: true });\n\tconst fileList = computed<UploadUserFile[]>({\n\t\tget: () => fileListModel.value ?? [],\n\t\tset: (value) => {\n\t\t\tfileListModel.value = value;\n\t\t},\n\t});\n\n\tconst loading = ref(false);\n\tlet activeUploadCount = 0;\n\n\t// 获取 el-form 组件上下文\n\tconst formContext = inject(formContextKey, undefined);\n\t// 获取 el-form-item 组件上下文\n\tconst formItemContext = inject(formItemContextKey, undefined);\n\n\tconst mbNum = new Decimal(1024);\n\tconst maxSizeKB = computed(() => new Decimal(isNumber(data?.maxSize) ? data.maxSize : Number(data?.maxSize)));\n\tconst maxSizeMB = computed(() => maxSizeKB.value.div(mbNum));\n\n\tonMounted(() => {\n\t\tif (!props.disabled && props.autoUpload && !data?.uploadApi && !data?.uploadUrl && props.httpRequest === uploadProps.httpRequest.default) {\n\t\t\tconsole.warn(`[Fast:${componentName}]`, \"uploadApi 和 uploadUrl 至少需要提供一个。\");\n\t\t}\n\t});\n\n\tconst handleValue = (files: UploadUserFile[] = fileList.value): void => {\n\t\tif (files.length > 0) {\n\t\t\tif (isString(props.modelValue)) {\n\t\t\t\tconst fileUrl = files[0]?.url;\n\t\t\t\tif (!fileUrl) return;\n\t\t\t\temit(\"update:modelValue\", fileUrl as T);\n\t\t\t\temit(\"change\", fileUrl as T);\n\t\t\t} else {\n\t\t\t\tif (props.multiple) {\n\t\t\t\t\tconst value = files.flatMap((item) => (item.url ? [item.url] : []));\n\t\t\t\t\temit(\"update:modelValue\", value as T);\n\t\t\t\t\temit(\"change\", value as T);\n\t\t\t\t} else {\n\t\t\t\t\tconst fileUrl = files[0]?.url;\n\t\t\t\t\tif (!fileUrl) return;\n\t\t\t\t\temit(\"update:modelValue\", fileUrl as T);\n\t\t\t\t\temit(\"change\", fileUrl as T);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"change\", null);\n\t\t}\n\t};\n\n\tconst handleHttpRequest = async (options: UploadRequestOptions): Promise<void> => {\n\t\tconst propsData = options.data;\n\t\tif (!data?.uploadApi && !data?.uploadUrl) {\n\t\t\tconst error = new Error(`上传${fileTypeName}接口 uploadApi 或地址 uploadUrl 不能为空。`);\n\t\t\tElMessage.error(`上传${fileTypeName}Api或地址不能为空`);\n\t\t\tconsole.error(`[Fast:${componentName}]`, error.message);\n\t\t\treturn Promise.reject(error);\n\t\t}\n\t\tactiveUploadCount++;\n\t\tloading.value = true;\n\t\ttry {\n\t\t\tlet fileUrl: string;\n\t\t\tif (data?.uploadApi) {\n\t\t\t\tfileUrl = await uploadUtil.uploadFileByApi(data.uploadApi, options.file, options.filename, propsData);\n\t\t\t} else {\n\t\t\t\tconst headers =\n\t\t\t\t\toptions.headers instanceof Headers\n\t\t\t\t\t\t? options.headers\n\t\t\t\t\t\t: new Headers(\n\t\t\t\t\t\t\t\tObject.entries(options.headers).flatMap(([key, value]) =>\n\t\t\t\t\t\t\t\t\tvalue === null || value === undefined ? [] : [[key, String(value)] as [string, string]]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\tfileUrl = await uploadUtil.uploadFile(data?.uploadUrl ?? options.action, options.file, options.filename, propsData, {\n\t\t\t\t\theaders,\n\t\t\t\t\tmethod: options.method,\n\t\t\t\t\twithCredentials: options.withCredentials,\n\t\t\t\t});\n\t\t\t}\n\t\t\toptions.onSuccess(fileUrl);\n\t\t} finally {\n\t\t\tactiveUploadCount = Math.max(activeUploadCount - 1, 0);\n\t\t\tloading.value = activeUploadCount > 0;\n\t\t}\n\t};\n\n\tconst handleOnSuccess = (fileUrl: string, uploadFile: UploadFile, uploadFiles: UploadFiles): void => {\n\t\tif (!fileUrl) return;\n\t\tif (!props.multiple && uploadFiles.length > 1) {\n\t\t\tuploadFiles.shift();\n\t\t}\n\t\tuploadFile.url = fileUrl;\n\t\thandleValue();\n\t\t// 调用 el-form 内部的校验方法(可自动校验)\n\t\tif (formItemContext?.prop) void formContext?.validateField([formItemContext.prop]);\n\t\tElMessage.success(\"上传成功\");\n\t\tprops.onSuccess?.(fileUrl, uploadFile, uploadFiles);\n\t};\n\n\tconst handleOnError = (error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles): void => {\n\t\tElNotification({\n\t\t\tmessage: `【${uploadFile.name}】${fileTypeName}上传失败,请您重新上传`,\n\t\t\ttype: \"error\",\n\t\t});\n\t\tprops.onError?.(error, uploadFile, uploadFiles);\n\t};\n\n\tconst handleOnRemove = (uploadFile: UploadFile, uploadFiles: UploadFiles): void => {\n\t\tfileList.value = uploadFiles;\n\t\thandleValue(uploadFiles);\n\t\tprops.onRemove?.(uploadFile, uploadFiles);\n\t};\n\n\tconst handleOnExceed = (files: File[], uploadFiles: UploadUserFile[]): void => {\n\t\tElMessage.warning(`最多只能上传 ${props.limit} 个${fileTypeName},请移除后再进行上传`);\n\t\tprops.onExceed?.(files, uploadFiles);\n\t};\n\n\tconst handleOnUpload = (file: UploadFile | UploadRawFile): boolean => {\n\t\tconst fileSizeKB = new Decimal(file.size ?? 0).div(mbNum);\n\n\t\tif (fileSizeKB.greaterThan(maxSizeKB.value)) {\n\t\t\tconsole.warn(`[Fast:${componentName}]`, `【${file.name}】${fileTypeName}上传大小不能超过 ${maxSizeMB.value.toString()}MB。`);\n\t\t\tElMessage.warning(`【${file.name}】${fileTypeName}上传大小不能超过 ${maxSizeMB.value.toString()}MB`);\n\t\t\treturn false;\n\t\t}\n\n\t\tconst rawFile = \"type\" in file ? file : file.raw;\n\t\tif (!rawFile) return false;\n\t\tif (!uploadUtil.matchesAccept(rawFile, props.accept)) {\n\t\t\tconst uploadFileNames = uploadUtil.detectFileType(props.accept ?? \"\");\n\t\t\tconsole.warn(`[Fast:${componentName}]`, `只允许上传【${uploadFileNames}】格式的${fileTypeName}。`);\n\t\t\tElMessage.warning(`只允许上传【${uploadFileNames}】格式的${fileTypeName}`);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t};\n\n\t/**\n\t * 监听 v-model 绑定数据\n\t */\n\twatch(\n\t\t() => props.modelValue,\n\t\t(newValue) => {\n\t\t\tif (newValue) {\n\t\t\t\tif (isArray(newValue)) {\n\t\t\t\t\tfileList.value = newValue.map((m) => {\n\t\t\t\t\t\tconst find = fileList.value.find((f) => f.url === m);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tname: \"\",\n\t\t\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\t\t\tuid: find?.uid ?? genFileId(),\n\t\t\t\t\t\t\turl: m,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst find = fileList.value.find((f) => f.url === newValue);\n\t\t\t\t\tfileList.value = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"\",\n\t\t\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\t\t\tuid: find?.uid ?? genFileId(),\n\t\t\t\t\t\t\turl: newValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfileList.value = [];\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\timmediate: true,\n\t\t}\n\t);\n\n\treturn {\n\t\tfileList,\n\t\tloading,\n\t\tformContext,\n\t\tformItemContext,\n\t\tmaxSizeMB,\n\t\thandleValue,\n\t\thandleHttpRequest,\n\t\thandleOnSuccess,\n\t\thandleOnError,\n\t\thandleOnRemove,\n\t\thandleOnExceed,\n\t\thandleOnUpload,\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2CA,MAAa,aACZ,eACA,cACA,OAGA,MAGA,SAKsB;CACtB,MAAM,gBAAgB,UAAU,OAAO,YAAY,MAAM,EAAE,SAAS,KAAK,CAAC;CAC1E,MAAM,WAAW,SAA2B;EAC3C,WAAW,cAAc,SAAS,CAAC;EACnC,MAAM,UAAU;GACf,cAAc,QAAQ;EACvB;CACD,CAAC;CAED,MAAM,UAAU,IAAI,KAAK;CACzB,IAAI,oBAAoB;CAGxB,MAAM,cAAc,OAAO,gBAAgB,KAAA,CAAS;CAEpD,MAAM,kBAAkB,OAAO,oBAAoB,KAAA,CAAS;CAE5D,MAAM,QAAQ,IAAI,QAAQ,IAAI;CAC9B,MAAM,YAAY,eAAe,IAAI,QAAQ,SAAS,MAAM,OAAO,IAAI,KAAK,UAAU,OAAO,MAAM,OAAO,CAAC,CAAC;CAC5G,MAAM,YAAY,eAAe,UAAU,MAAM,IAAI,KAAK,CAAC;CAE3D,gBAAgB;EACf,IAAI,CAAC,MAAM,YAAY,MAAM,cAAc,CAAC,MAAM,aAAa,CAAC,MAAM,aAAa,MAAM,gBAAgB,YAAY,YAAY,SAChI,QAAQ,KAAK,SAAS,cAAc,IAAI,iCAAiC;CAE3E,CAAC;CAED,MAAM,eAAe,QAA0B,SAAS,UAA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Aa,WAAW,UAAU,MAAM,SAAS,EAAE,GAAG;GACzF,OAAO;EACR;EAEA,MAAM,UAAU,UAAU,OAAO,OAAO,KAAK;EAC7C,IAAI,CAAC,SAAS,OAAO;EACrB,IAAI,CAAC,WAAW,cAAc,SAAS,MAAM,MAAM,GAAG;GACrD,MAAM,kBAAkB,WAAW,eAAe,MAAM,UAAU,EAAE;GACpE,QAAQ,KAAK,SAAS,cAAc,IAAI,SAAS,gBAAgB,MAAM,aAAa,EAAE;GACtF,UAAU,QAAQ,SAAS,gBAAgB,MAAM,cAAc;GAC/D,OAAO;EACR;EAEA,OAAO;CACR;;;;CAKA,YACO,MAAM,aACX,aAAa;EACb,IAAI,UAAU;GACb,IAAI,QAAQ,QAAQ,GACnB,SAAS,QAAQ,SAAS,KAAK,MAAM;IAEpC,OAAO;KACN,MAAM;KACN,QAAQ;KACR,KAJY,SAAS,MAAM,MAAM,MAAM,EAAE,QAAQ,CAIzC,CAAC,EAAE,OAAO,UAAU;KAC5B,KAAK;IACN;GACD,CAAC;QACK;IACN,MAAM,OAAO,SAAS,MAAM,MAAM,MAAM,EAAE,QAAQ,QAAQ;IAC1D,SAAS,QAAQ,CAChB;KACC,MAAM;KACN,QAAQ;KACR,KAAK,MAAM,OAAO,UAAU;KAC5B,KAAK;IACN,CACD;GACD;EACD,OACC,SAAS,QAAQ,CAAC;CAEpB,GACA,EACC,WAAW,KACZ,CACD;CAEA,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD"}
1
+ {"version":3,"file":"useUpload.mjs","names":[],"sources":["../../../../src/components/upload/src/useUpload.ts"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, inject, onMounted, ref, watch } from \"vue\";\nimport { ElMessage, ElNotification, formContextKey, formItemContextKey, genFileId, uploadProps } from \"element-plus\";\nimport { isArray, isNumber, isString } from \"lodash-unified\";\nimport { Decimal } from \"decimal.js\";\nimport { uploadUtil } from \"../utils/upload\";\nimport type {\n\tFormContext,\n\tFormItemContext,\n\tUploadFile,\n\tUploadFiles,\n\tUploadProps,\n\tUploadRawFile,\n\tUploadRequestOptions,\n\tUploadUserFile,\n} from \"element-plus\";\nimport type { ComputedRef, Ref, WritableComputedRef } from \"vue\";\n\ninterface UploadComposable {\n\tfileList: WritableComputedRef<UploadUserFile[]>;\n\tloading: Ref<boolean>;\n\tformContext: FormContext | undefined;\n\tformItemContext: FormItemContext | undefined;\n\tmaxSizeMB: ComputedRef<Decimal>;\n\thandleValue: () => void;\n\thandleHttpRequest: (options: UploadRequestOptions) => Promise<void>;\n\thandleOnSuccess: (fileUrl: string, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;\n\thandleOnError: (error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;\n\thandleOnRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void;\n\thandleOnExceed: (files: File[], uploadFiles: UploadUserFile[]) => void;\n\thandleOnUpload: (file: UploadFile | UploadRawFile) => boolean;\n}\n\n/**\n * 创建上传组件共享的文件状态和操作方法。\n *\n * @param componentName - 组件名称。\n * @param fileTypeName - 文件类型名称。\n * @param props - 上传组件的 Props。\n * @param emit - 上传组件的事件触发器。\n * @param options - 文件大小和类型校验配置。\n * @returns 文件列表、加载状态和上传操作方法。\n */\nexport const useUpload = <T extends string | string[]>(\n\tcomponentName: string,\n\tfileTypeName: string,\n\tprops: Partial<UploadProps> & {\n\t\tmodelValue?: T | null;\n\t},\n\temit: ((event: \"update:fileList\", value: UploadUserFile[]) => void) &\n\t\t((event: \"update:modelValue\", value: T | null) => void) &\n\t\t((event: \"change\", value: T | null) => void),\n\tdata?: {\n\t\tmaxSize?: string | number;\n\t\tuploadApi?: (formData: FormData) => Promise<string>;\n\t\tuploadUrl?: string;\n\t}\n): UploadComposable => {\n\tconst fileListModel = useVModel(props, \"fileList\", emit, { passive: true });\n\tconst fileList = computed<UploadUserFile[]>({\n\t\tget: () => fileListModel.value ?? [],\n\t\tset: (value) => {\n\t\t\tfileListModel.value = value;\n\t\t},\n\t});\n\n\tconst loading = ref(false);\n\tlet activeUploadCount = 0;\n\n\t// 获取 el-form 组件上下文\n\tconst formContext = inject(formContextKey, undefined);\n\t// 获取 el-form-item 组件上下文\n\tconst formItemContext = inject(formItemContextKey, undefined);\n\n\tconst mbNum = new Decimal(1024);\n\tconst maxSizeKB = computed(() => new Decimal(isNumber(data?.maxSize) ? data.maxSize : Number(data?.maxSize)));\n\tconst maxSizeMB = computed(() => maxSizeKB.value.div(mbNum));\n\n\tonMounted(() => {\n\t\tif (!props.disabled && props.autoUpload && !data?.uploadApi && !data?.uploadUrl && props.httpRequest === uploadProps.httpRequest.default) {\n\t\t\tconsole.warn(`[Fast:${componentName}]`, \"uploadApi 和 uploadUrl 至少需要提供一个。\");\n\t\t}\n\t});\n\n\tconst handleValue = (files: UploadUserFile[] = fileList.value): void => {\n\t\tif (files.length > 0) {\n\t\t\tif (isString(props.modelValue)) {\n\t\t\t\tconst fileUrl = files[0]?.url;\n\t\t\t\tif (!fileUrl) return;\n\t\t\t\temit(\"update:modelValue\", fileUrl as T);\n\t\t\t\temit(\"change\", fileUrl as T);\n\t\t\t} else {\n\t\t\t\tif (props.multiple) {\n\t\t\t\t\tconst value = files.flatMap((item) => (item.url ? [item.url] : []));\n\t\t\t\t\temit(\"update:modelValue\", value as T);\n\t\t\t\t\temit(\"change\", value as T);\n\t\t\t\t} else {\n\t\t\t\t\tconst fileUrl = files[0]?.url;\n\t\t\t\t\tif (!fileUrl) return;\n\t\t\t\t\temit(\"update:modelValue\", fileUrl as T);\n\t\t\t\t\temit(\"change\", fileUrl as T);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"change\", null);\n\t\t}\n\t};\n\n\tconst handleHttpRequest = async (options: UploadRequestOptions): Promise<void> => {\n\t\tconst propsData = options.data;\n\t\tif (!data?.uploadApi && !data?.uploadUrl) {\n\t\t\tconst error = new Error(`上传${fileTypeName}接口 uploadApi 或地址 uploadUrl 不能为空。`);\n\t\t\tElMessage.error(`上传${fileTypeName}Api或地址不能为空`);\n\t\t\tconsole.error(`[Fast:${componentName}]`, error.message);\n\t\t\treturn Promise.reject(error);\n\t\t}\n\t\tactiveUploadCount++;\n\t\tloading.value = true;\n\t\ttry {\n\t\t\tlet fileUrl: string;\n\t\t\tif (data?.uploadApi) {\n\t\t\t\tfileUrl = await uploadUtil.uploadFileByApi(data.uploadApi, options.file, options.filename, propsData);\n\t\t\t} else {\n\t\t\t\tconst headers =\n\t\t\t\t\toptions.headers instanceof Headers\n\t\t\t\t\t\t? options.headers\n\t\t\t\t\t\t: new Headers(\n\t\t\t\t\t\t\t\tObject.entries(options.headers).flatMap(([key, value]) =>\n\t\t\t\t\t\t\t\t\tvalue === null || value === undefined ? [] : [[key, String(value)] as [string, string]]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\tfileUrl = await uploadUtil.uploadFile(data?.uploadUrl ?? options.action, options.file, options.filename, propsData, {\n\t\t\t\t\theaders,\n\t\t\t\t\tmethod: options.method,\n\t\t\t\t\twithCredentials: options.withCredentials,\n\t\t\t\t});\n\t\t\t}\n\t\t\toptions.onSuccess(fileUrl);\n\t\t} finally {\n\t\t\tactiveUploadCount = Math.max(activeUploadCount - 1, 0);\n\t\t\tloading.value = activeUploadCount > 0;\n\t\t}\n\t};\n\n\tconst handleOnSuccess = (fileUrl: string, uploadFile: UploadFile, uploadFiles: UploadFiles): void => {\n\t\tif (!fileUrl) return;\n\t\tif (!props.multiple && uploadFiles.length > 1) {\n\t\t\tuploadFiles.shift();\n\t\t}\n\t\tuploadFile.url = fileUrl;\n\t\thandleValue();\n\t\t// 调用 el-form 内部的校验方法(可自动校验)\n\t\tif (formItemContext?.prop) void formContext?.validateField([formItemContext.prop]);\n\t\tElMessage.success(\"上传成功\");\n\t\tprops.onSuccess?.(fileUrl, uploadFile, uploadFiles);\n\t};\n\n\tconst handleOnError = (error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles): void => {\n\t\tElNotification({\n\t\t\tmessage: `【${uploadFile.name}】${fileTypeName}上传失败,请您重新上传`,\n\t\t\ttype: \"error\",\n\t\t});\n\t\tprops.onError?.(error, uploadFile, uploadFiles);\n\t};\n\n\tconst handleOnRemove = (uploadFile: UploadFile, uploadFiles: UploadFiles): void => {\n\t\tfileList.value = uploadFiles;\n\t\thandleValue(uploadFiles);\n\t\tprops.onRemove?.(uploadFile, uploadFiles);\n\t};\n\n\tconst handleOnExceed = (files: File[], uploadFiles: UploadUserFile[]): void => {\n\t\tElMessage.warning(`最多只能上传 ${props.limit} 个${fileTypeName},请移除后再进行上传`);\n\t\tprops.onExceed?.(files, uploadFiles);\n\t};\n\n\tconst handleOnUpload = (file: UploadFile | UploadRawFile): boolean => {\n\t\tconst fileSizeKB = new Decimal(file.size ?? 0).div(mbNum);\n\n\t\tif (fileSizeKB.greaterThan(maxSizeKB.value)) {\n\t\t\tconsole.warn(`[Fast:${componentName}]`, `【${file.name}】${fileTypeName}上传大小不能超过 ${maxSizeMB.value.toString()}MB。`);\n\t\t\tElMessage.warning(`【${file.name}】${fileTypeName}上传大小不能超过 ${maxSizeMB.value.toString()}MB`);\n\t\t\treturn false;\n\t\t}\n\n\t\tconst rawFile = \"type\" in file ? file : file.raw;\n\t\tif (!rawFile) return false;\n\t\tif (!uploadUtil.matchesAccept(rawFile, props.accept)) {\n\t\t\tconst uploadFileNames = uploadUtil.detectFileType(props.accept ?? \"\");\n\t\t\tconsole.warn(`[Fast:${componentName}]`, `只允许上传【${uploadFileNames}】格式的${fileTypeName}。`);\n\t\t\tElMessage.warning(`只允许上传【${uploadFileNames}】格式的${fileTypeName}`);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t};\n\n\t/**\n\t * 监听 v-model 绑定数据\n\t */\n\twatch(\n\t\t() => props.modelValue,\n\t\t(newValue) => {\n\t\t\tif (newValue) {\n\t\t\t\tif (isArray(newValue)) {\n\t\t\t\t\tfileList.value = newValue.map((m) => {\n\t\t\t\t\t\tconst find = fileList.value.find((f) => f.url === m);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tname: \"\",\n\t\t\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\t\t\tuid: find?.uid ?? genFileId(),\n\t\t\t\t\t\t\turl: m,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst find = fileList.value.find((f) => f.url === newValue);\n\t\t\t\t\tfileList.value = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"\",\n\t\t\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\t\t\tuid: find?.uid ?? genFileId(),\n\t\t\t\t\t\t\turl: newValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfileList.value = [];\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\timmediate: true,\n\t\t}\n\t);\n\n\treturn {\n\t\tfileList,\n\t\tloading,\n\t\tformContext,\n\t\tformItemContext,\n\t\tmaxSizeMB,\n\t\thandleValue,\n\t\thandleHttpRequest,\n\t\thandleOnSuccess,\n\t\thandleOnError,\n\t\thandleOnRemove,\n\t\thandleOnExceed,\n\t\thandleOnUpload,\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,MAAa,aACZ,eACA,cACA,OAGA,MAGA,SAKsB;CACtB,MAAM,gBAAgB,UAAU,OAAO,YAAY,MAAM,EAAE,SAAS,KAAK,CAAC;CAC1E,MAAM,WAAW,SAA2B;EAC3C,WAAW,cAAc,SAAS,CAAC;EACnC,MAAM,UAAU;GACf,cAAc,QAAQ;EACvB;CACD,CAAC;CAED,MAAM,UAAU,IAAI,KAAK;CACzB,IAAI,oBAAoB;CAGxB,MAAM,cAAc,OAAO,gBAAgB,KAAA,CAAS;CAEpD,MAAM,kBAAkB,OAAO,oBAAoB,KAAA,CAAS;CAE5D,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QAAQ,CAAC;CAEpB,GACA,EACC,WAAW,KACZ,CACD;CAEA,OAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;AACD"}
@@ -5,14 +5,12 @@ import { definePropType, useProps } from "../../../utils/vue/props.mjs";
5
5
  import { useRender } from "../../../utils/vue/render.mjs";
6
6
  import { makeSlots } from "../../../utils/vue/slots.mjs";
7
7
  import { withDefineType } from "../../../utils/vue/with.mjs";
8
- import isArray from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs";
9
- import isString from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs";
10
- import isNull from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNull.mjs";
11
8
  import { FaMimeType } from "../../../constants/mime.mjs";
12
9
  import { useUpload } from "../../upload/src/useUpload.mjs";
13
10
  import { Fragment, computed, createTextVNode, createVNode, defineComponent, mergeProps, reactive, ref, resolveDirective, withDirectives, withModifiers } from "vue";
14
11
  import { Delete, Edit, UploadFilled, ZoomIn } from "@element-plus/icons-vue";
15
12
  import { ElIcon, ElImageViewer, ElUpload, uploadProps } from "element-plus";
13
+ import { isArray, isNull, isString } from "lodash-unified";
16
14
  //#region src/components/uploadImage/src/uploadImage.tsx
17
15
  /** FaUploadImage 的运行时 Props 定义。 */
18
16
  const faUploadImageProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"uploadImage.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/uploadImage/src/uploadImage.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, reactive, ref, withModifiers } from \"vue\";\nimport { Delete, Edit, UploadFilled, ZoomIn } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImageViewer, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull, isString } from \"lodash-unified\";\nimport { FaMimeType } from \"../../../constants\";\nimport { addCssUnit, definePropType, makeSlots, randomString, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { useUpload } from \"../../upload/src/useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile, uploadListTypes } from \"element-plus\";\n\n/** FaUploadImage 的运行时 Props 定义。 */\nexport const faUploadImageProps = {\n\t...uploadProps,\n\t/** @description whether to activate drag and drop mode */\n\tdrag: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true` */\n\taccept: {\n\t\ttype: String,\n\t\tdefault: (): string => FaMimeType.Image,\n\t},\n\t/** @description type of file list */\n\tlistType: {\n\t\ttype: definePropType<(typeof uploadListTypes)[number]>(String),\n\t\tdefault: \"picture\",\n\t},\n\t/** @description whether to show the uploaded file list */\n\tshowFileList: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: [String, Number],\n\t\tdefault: 2048,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 150,\n\t},\n\t/** @description 高度 */\n\theight: {\n\t\ttype: [String, Number],\n\t\tdefault: 150,\n\t},\n};\n\n/** FaUploadImage 的运行时 Emits 定义。 */\nexport const faUploadImageEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n\t/** @description 改变 */\n\tchange: (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n};\n\n/** FaUploadImage 的插槽参数。 */\nexport interface FaUploadImageSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaUploadImage\",\n\tprops: faUploadImageProps,\n\temits: faUploadImageEmits,\n\tslots: makeSlots<FaUploadImageSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload<string | string[]>(\"FaUploadImage\", \"图片\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst state = reactive({\n\t\t\tuploadKey: `fa-upload-image__${randomString(8)}`,\n\t\t\tpreview: false,\n\t\t\tpreviewList: withDefineType<string[]>([]),\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleEdit = (): void => {\n\t\t\tconst uploadInputEl = document.querySelector(`.${state.uploadKey} .el-upload__input`);\n\t\t\tuploadInputEl?.dispatchEvent(new MouseEvent(\"click\"));\n\t\t};\n\n\t\tconst handlePreview = (): void => {\n\t\t\tconst fileUrl = fileList.value[0]?.url;\n\t\t\tif (!fileUrl) return;\n\t\t\tstate.previewList = [fileUrl];\n\t\t\tstate.preview = true;\n\t\t};\n\n\t\tconst handleRemove = (): void => {\n\t\t\tconst file = fileList.value[0];\n\t\t\tif (file) uploadRef.value?.handleRemove(file as UploadFile);\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\tif (!handleOnUpload(rawFile)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (props.beforeUpload) {\n\t\t\t\treturn props.beforeUpload(rawFile);\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<Fragment>\n\t\t\t\t<ElUpload\n\t\t\t\t\t{...elUploadProps.value}\n\t\t\t\t\tref={uploadRef}\n\t\t\t\t\tclass={[\"fa-upload-image\", state.uploadKey]}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\"--width\": addCssUnit(props.width),\n\t\t\t\t\t\t\"--height\": addCssUnit(props.height),\n\t\t\t\t\t}}\n\t\t\t\t\tvLoading={loading.value}\n\t\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\t\tdisabled={disabled.value}\n\t\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\t\tonError={handleOnError}\n\t\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\t>\n\t\t\t\t\t{{\n\t\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\t\tfileList.value.length > 0 ? (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<img class=\"el-upload-list__item-thumbnail\" src={fileList.value[0]?.url} />\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"el-upload-list__item-actions\"\n\t\t\t\t\t\t\t\t\t\tonClick={withModifiers(() => {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}, [\"stop\"])}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handlePreview()} title=\"查看\">\n\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t<ZoomIn />\n\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t{!disabled.value && (\n\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={handleEdit} title=\"编辑\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Edit />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handleRemove()} title=\"删除\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Delete />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t) : slots.default ? (\n\t\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<ElIcon class=\"el-icon--upload\">\n\t\t\t\t\t\t\t\t\t\t<UploadFilled />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t<div class=\"el-upload__text\">\n\t\t\t\t\t\t\t\t\t\tDrop file here <br />\n\t\t\t\t\t\t\t\t\t\t<em>click to upload</em>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\ttip: () => <div class=\"el-upload__tip\">file with a size less than {maxSizeMB.value.toString()}MB</div>,\n\t\t\t\t\t}}\n\t\t\t\t</ElUpload>\n\t\t\t\t{state.preview && (\n\t\t\t\t\t<ElImageViewer\n\t\t\t\t\t\tcloseOnPressEscape\n\t\t\t\t\t\thideOnClickModal\n\t\t\t\t\t\tteleported\n\t\t\t\t\t\tonClose={() => (state.preview = false)}\n\t\t\t\t\t\turlList={state.previewList}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Fragment>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t\t/** @description 预览 */\n\t\t\tpreview: computed(() => state.preview),\n\t\t\t/** @description 预览集合 */\n\t\t\tpreviewList: computed(() => state.previewList),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAUA,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,KAAK,CAAA,CAAA,GA0DvB,MAAM,WAAO,YAAA,eAAA;GAAA,sBAAA;GAAA,oBAAA;GAAA,cAAA;GAAA,iBAKI,MAAM,UAAU;GAAM,WAC7B,MAAM;EAAW,GAAA,IAAA,CAE3B,CAAA,CAEF;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,QAAQ,eAAe,UAAU,OAAO,MAAM;;GAE9C,YAAY,eAAe,UAAU,OAAO,UAAU;;GAEtD,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,cAAc,eAAe,UAAU,OAAO,YAAY;;GAE1D;;GAEA;;GAEA,SAAS,eAAe,MAAM,OAAO;;GAErC,aAAa,eAAe,MAAM,WAAW;EAC9C,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"uploadImage.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/uploadImage/src/uploadImage.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, reactive, ref, withModifiers } from \"vue\";\nimport { Delete, Edit, UploadFilled, ZoomIn } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImageViewer, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull, isString } from \"lodash-unified\";\nimport { FaMimeType } from \"../../../constants\";\nimport { addCssUnit, definePropType, makeSlots, randomString, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { useUpload } from \"../../upload/src/useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile, uploadListTypes } from \"element-plus\";\n\n/** FaUploadImage 的运行时 Props 定义。 */\nexport const faUploadImageProps = {\n\t...uploadProps,\n\t/** @description whether to activate drag and drop mode */\n\tdrag: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true` */\n\taccept: {\n\t\ttype: String,\n\t\tdefault: (): string => FaMimeType.Image,\n\t},\n\t/** @description type of file list */\n\tlistType: {\n\t\ttype: definePropType<(typeof uploadListTypes)[number]>(String),\n\t\tdefault: \"picture\",\n\t},\n\t/** @description whether to show the uploaded file list */\n\tshowFileList: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: [String, Number],\n\t\tdefault: 2048,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 150,\n\t},\n\t/** @description 高度 */\n\theight: {\n\t\ttype: [String, Number],\n\t\tdefault: 150,\n\t},\n};\n\n/** FaUploadImage 的运行时 Emits 定义。 */\nexport const faUploadImageEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n\t/** @description 改变 */\n\tchange: (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n};\n\n/** FaUploadImage 的插槽参数。 */\nexport interface FaUploadImageSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaUploadImage\",\n\tprops: faUploadImageProps,\n\temits: faUploadImageEmits,\n\tslots: makeSlots<FaUploadImageSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload<string | string[]>(\"FaUploadImage\", \"图片\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst state = reactive({\n\t\t\tuploadKey: `fa-upload-image__${randomString(8)}`,\n\t\t\tpreview: false,\n\t\t\tpreviewList: withDefineType<string[]>([]),\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleEdit = (): void => {\n\t\t\tconst uploadInputEl = document.querySelector(`.${state.uploadKey} .el-upload__input`);\n\t\t\tuploadInputEl?.dispatchEvent(new MouseEvent(\"click\"));\n\t\t};\n\n\t\tconst handlePreview = (): void => {\n\t\t\tconst fileUrl = fileList.value[0]?.url;\n\t\t\tif (!fileUrl) return;\n\t\t\tstate.previewList = [fileUrl];\n\t\t\tstate.preview = true;\n\t\t};\n\n\t\tconst handleRemove = (): void => {\n\t\t\tconst file = fileList.value[0];\n\t\t\tif (file) uploadRef.value?.handleRemove(file as UploadFile);\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\tif (!handleOnUpload(rawFile)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (props.beforeUpload) {\n\t\t\t\treturn props.beforeUpload(rawFile);\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<Fragment>\n\t\t\t\t<ElUpload\n\t\t\t\t\t{...elUploadProps.value}\n\t\t\t\t\tref={uploadRef}\n\t\t\t\t\tclass={[\"fa-upload-image\", state.uploadKey]}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\"--width\": addCssUnit(props.width),\n\t\t\t\t\t\t\"--height\": addCssUnit(props.height),\n\t\t\t\t\t}}\n\t\t\t\t\tvLoading={loading.value}\n\t\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\t\tdisabled={disabled.value}\n\t\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\t\tonError={handleOnError}\n\t\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\t>\n\t\t\t\t\t{{\n\t\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\t\tfileList.value.length > 0 ? (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<img class=\"el-upload-list__item-thumbnail\" src={fileList.value[0]?.url} />\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"el-upload-list__item-actions\"\n\t\t\t\t\t\t\t\t\t\tonClick={withModifiers(() => {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}, [\"stop\"])}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handlePreview()} title=\"查看\">\n\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t<ZoomIn />\n\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t{!disabled.value && (\n\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={handleEdit} title=\"编辑\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Edit />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handleRemove()} title=\"删除\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Delete />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t) : slots.default ? (\n\t\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<ElIcon class=\"el-icon--upload\">\n\t\t\t\t\t\t\t\t\t\t<UploadFilled />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t<div class=\"el-upload__text\">\n\t\t\t\t\t\t\t\t\t\tDrop file here <br />\n\t\t\t\t\t\t\t\t\t\t<em>click to upload</em>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\ttip: () => <div class=\"el-upload__tip\">file with a size less than {maxSizeMB.value.toString()}MB</div>,\n\t\t\t\t\t}}\n\t\t\t\t</ElUpload>\n\t\t\t\t{state.preview && (\n\t\t\t\t\t<ElImageViewer\n\t\t\t\t\t\tcloseOnPressEscape\n\t\t\t\t\t\thideOnClickModal\n\t\t\t\t\t\tteleported\n\t\t\t\t\t\tonClose={() => (state.preview = false)}\n\t\t\t\t\t\turlList={state.previewList}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Fragment>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t\t/** @description 预览 */\n\t\t\tpreview: computed(() => state.preview),\n\t\t\t/** @description 预览集合 */\n\t\t\tpreviewList: computed(() => state.previewList),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAa,qBAAqB;CACjC,GAAG;;CAEH,MAAM;EACL,MAAM;EACN,SAAS;CACV;;CAEA,QAAQ;EACP,MAAM;EACN,eAAuB,WAAW;CACnC;;CAEA,UAAU;EACT,MAAM,eAAiD,MAAM;EAC7D,SAAS;CACV;;CAEA,cAAc;EACb,MAAM;EACN,SAAS;CACV;;CAEA,YAAY,eAAyC,CAAC,QAAQ,KAAK,CAAC;;CAEpE,SAAS;EACR,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,WAAW,EACV,MAAM,eAAwD,QAAQ,EACvE;;CAEA,WAAW;;CAEX,OAAO;EACN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E1D;;GAEA;;GAEA,SAAS,eAAe,MAAM,OAAO;;GAErC,aAAa,eAAe,MAAM,WAAW;EAC9C,CAAC;CACF;AACD,CAAC"}
@@ -4,13 +4,12 @@ import { definePropType, useProps } from "../../../utils/vue/props.mjs";
4
4
  import { useRender } from "../../../utils/vue/render.mjs";
5
5
  import { makeSlots } from "../../../utils/vue/slots.mjs";
6
6
  import { withDefineType } from "../../../utils/vue/with.mjs";
7
- import isArray from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isArray.mjs";
8
- import isNull from "../../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNull.mjs";
9
7
  import { FaMimeType } from "../../../constants/mime.mjs";
10
8
  import { useUpload } from "../../upload/src/useUpload.mjs";
11
9
  import { Fragment, computed, createTextVNode, createVNode, defineComponent, mergeProps, reactive, ref, resolveDirective, withDirectives } from "vue";
12
10
  import { Delete, Edit, Plus, ZoomIn } from "@element-plus/icons-vue";
13
11
  import { ElIcon, ElImageViewer, ElUpload, uploadProps } from "element-plus";
12
+ import { isArray, isNull } from "lodash-unified";
14
13
  //#region src/components/uploadImages/src/uploadImages.tsx
15
14
  /** FaUploadImages 的运行时 Props 定义。 */
16
15
  const faUploadImagesProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"uploadImages.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/uploadImages/src/uploadImages.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, reactive, ref } from \"vue\";\nimport { Delete, Edit, Plus, ZoomIn } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImageViewer, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull } from \"lodash-unified\";\nimport { FaMimeType } from \"../../../constants\";\nimport { definePropType, makeSlots, randomString, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { useUpload } from \"../../upload/src/useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile, uploadListTypes } from \"element-plus\";\n\n/** FaUploadImages 的运行时 Props 定义。 */\nexport const faUploadImagesProps = {\n\t...uploadProps,\n\t/** @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true` */\n\taccept: {\n\t\ttype: String,\n\t\tdefault: (): string => FaMimeType.Image,\n\t},\n\t/** @description type of file list */\n\tlistType: {\n\t\ttype: definePropType<(typeof uploadListTypes)[number]>(String),\n\t\tdefault: \"picture-card\",\n\t},\n\t/** @description whether uploading multiple files is permitted */\n\tmultiple: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description maximum number of uploads allowed */\n\tlimit: {\n\t\ttype: Number,\n\t\tdefault: 9,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string[] | null>([Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: [String, Number],\n\t\tdefault: 2048,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n};\n\n/** FaUploadImages 的运行时 Emits 定义。 */\nexport const faUploadImagesEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string[] | null): boolean => isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n\t/** @description 改变 */\n\tchange: (value: string[] | null): boolean => isArray(value) || isNull(value),\n};\n\n/** FaUploadImages 的插槽参数。 */\nexport interface FaUploadImagesSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaUploadImages\",\n\tprops: faUploadImagesProps,\n\temits: faUploadImagesEmits,\n\tslots: makeSlots<FaUploadImagesSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload<string[]>(\"FaUploadImages\", \"图片\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst state = reactive({\n\t\t\tuploadKey: `fa-upload-images__${randomString(8)}`,\n\t\t\tpreview: false,\n\t\t\tpreviewIndex: -1,\n\t\t\tpreviewList: withDefineType<string[]>([]),\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleEdit = (): void => {\n\t\t\tconst uploadInputEl = document.querySelector(`.${state.uploadKey} .el-upload__input`);\n\t\t\tuploadInputEl?.dispatchEvent(new MouseEvent(\"click\"));\n\t\t};\n\n\t\tconst handlePreview = (uploadFile: UploadFile): void => {\n\t\t\tstate.previewIndex = fileList.value.findIndex((f) => f.url === uploadFile.url);\n\t\t\tstate.previewList = fileList.value.flatMap((item) => (item.url ? [item.url] : []));\n\t\t\tstate.preview = true;\n\t\t};\n\n\t\tconst handleRemove = (index: number): void => {\n\t\t\tconst file = fileList.value[index];\n\t\t\tif (file) uploadRef.value?.handleRemove(file as UploadFile);\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\tif (!handleOnUpload(rawFile)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (props.beforeUpload) {\n\t\t\t\treturn props.beforeUpload(rawFile);\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<Fragment>\n\t\t\t\t<ElUpload\n\t\t\t\t\t{...elUploadProps.value}\n\t\t\t\t\tref={uploadRef}\n\t\t\t\t\tclass={[\"fa-upload-images\", state.uploadKey, { \"fa-upload-images__hidden-upload\": fileList.value.length >= props.limit }]}\n\t\t\t\t\tvLoading={loading.value}\n\t\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\t\tdisabled={disabled.value}\n\t\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\t\tonError={handleOnError}\n\t\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\t>\n\t\t\t\t\t{{\n\t\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\t\tfileList.value.length < props.limit && slots.default ? (\n\t\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t<Plus />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\ttip: () => <div class=\"el-upload__tip\">files with a size less than {maxSizeMB.value.toString()}MB</div>,\n\t\t\t\t\t\tfile: ({ file, index }: { file: UploadFile; index: number }) => (\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<img class=\"el-upload-list__item-thumbnail\" src={file.url} />\n\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-actions\">\n\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-preview\" onClick={() => handlePreview(file)} title=\"查看\">\n\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t<ZoomIn />\n\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{!disabled.value && (\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={handleEdit} title=\"编辑\">\n\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Edit />\n\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handleRemove(index)} title=\"删除\">\n\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Delete />\n\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t</ElUpload>\n\t\t\t\t{state.preview && (\n\t\t\t\t\t<ElImageViewer\n\t\t\t\t\t\tcloseOnPressEscape\n\t\t\t\t\t\thideOnClickModal\n\t\t\t\t\t\tteleported\n\t\t\t\t\t\tinitialIndex={Math.max(state.previewIndex, 0)}\n\t\t\t\t\t\tonClose={() => (state.preview = false)}\n\t\t\t\t\t\turlList={state.previewList}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Fragment>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t\t/** @description 预览 */\n\t\t\tpreview: computed(() => state.preview),\n\t\t\t/** @description 预览集合 */\n\t\t\tpreviewList: computed(() => state.previewList),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAa,sBAAsB;CAClC,GAAG;;CAEH,QAAQ;EACP,MAAM;EACN,eAAuB,WAAW;CACnC;;CAEA,UAAU;EACT,MAAM,eAAiD,MAAM;EAC7D,SAAS;CACV;;CAEA,UAAU;EACT,MAAM;EACN,SAAS;CACV;;CAEA,OAAO;EACN,MAAM;EACN,SAAS;CACV;;CAEA,YAAY,eAAgC,CAAC,KAAK,CAAC;;CAEnD,SAAS;EACR,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,WAAW,EACV,MAAM,eAAwD,QAAQ,EACvE;;CAEA,WAAW;AACZ;;AAGA,MAAa,sBAAsB;;CAElC,sBAAsB,UAAoC,QAAQ,KAAK,KAAK,OAAO,KAAK;;CAExF,oBAAoB,UAAqC,QAAQ,KAAK;;CAEtE,SAAS,UAAoC,QAAQ,KAAK,KAAK,OAAO,KAAK;AAC5E;AAQA,IAAA,uBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAA+B;CACtC,MAAM,OAAO,EAAE,OAAO,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,aAAa,KAAK;IAAC,SAAA;GAAA,GAAA,CAAA,YAAA,QAAA,MAAA,EAAA,eAAA,CAAA,YAAA,QAAA,MAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAM3E,CAAA,CAAA,CAAA;EAGH,CAAA,GAAA,CAAA,CAAA,iBAAA,SAAA,GA7CQ,QAAQ,KAAK,CAAA,CAAA,GAgDvB,MAAM,WAAO,YAAA,eAAA;GAAA,sBAAA;GAAA,oBAAA;GAAA,cAAA;GAAA,gBAKE,KAAK,IAAI,MAAM,cAAc,CAAC;GAAC,iBAC7B,MAAM,UAAU;GAAM,WAC7B,MAAM;EAAW,GAAA,IAAA,CAE3B,CAAA,CAEF;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,QAAQ,eAAe,UAAU,OAAO,MAAM;;GAE9C,YAAY,eAAe,UAAU,OAAO,UAAU;;GAEtD,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,cAAc,eAAe,UAAU,OAAO,YAAY;;GAE1D;;GAEA;;GAEA,SAAS,eAAe,MAAM,OAAO;;GAErC,aAAa,eAAe,MAAM,WAAW;EAC9C,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"uploadImages.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/uploadImages/src/uploadImages.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, reactive, ref } from \"vue\";\nimport { Delete, Edit, Plus, ZoomIn } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElImageViewer, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull } from \"lodash-unified\";\nimport { FaMimeType } from \"../../../constants\";\nimport { definePropType, makeSlots, randomString, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { useUpload } from \"../../upload/src/useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile, uploadListTypes } from \"element-plus\";\n\n/** FaUploadImages 的运行时 Props 定义。 */\nexport const faUploadImagesProps = {\n\t...uploadProps,\n\t/** @description accepted [file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept), will not work when `thumbnail-mode === true` */\n\taccept: {\n\t\ttype: String,\n\t\tdefault: (): string => FaMimeType.Image,\n\t},\n\t/** @description type of file list */\n\tlistType: {\n\t\ttype: definePropType<(typeof uploadListTypes)[number]>(String),\n\t\tdefault: \"picture-card\",\n\t},\n\t/** @description whether uploading multiple files is permitted */\n\tmultiple: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description maximum number of uploads allowed */\n\tlimit: {\n\t\ttype: Number,\n\t\tdefault: 9,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string[] | null>([Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: [String, Number],\n\t\tdefault: 2048,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n};\n\n/** FaUploadImages 的运行时 Emits 定义。 */\nexport const faUploadImagesEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string[] | null): boolean => isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n\t/** @description 改变 */\n\tchange: (value: string[] | null): boolean => isArray(value) || isNull(value),\n};\n\n/** FaUploadImages 的插槽参数。 */\nexport interface FaUploadImagesSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaUploadImages\",\n\tprops: faUploadImagesProps,\n\temits: faUploadImagesEmits,\n\tslots: makeSlots<FaUploadImagesSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload<string[]>(\"FaUploadImages\", \"图片\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst state = reactive({\n\t\t\tuploadKey: `fa-upload-images__${randomString(8)}`,\n\t\t\tpreview: false,\n\t\t\tpreviewIndex: -1,\n\t\t\tpreviewList: withDefineType<string[]>([]),\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleEdit = (): void => {\n\t\t\tconst uploadInputEl = document.querySelector(`.${state.uploadKey} .el-upload__input`);\n\t\t\tuploadInputEl?.dispatchEvent(new MouseEvent(\"click\"));\n\t\t};\n\n\t\tconst handlePreview = (uploadFile: UploadFile): void => {\n\t\t\tstate.previewIndex = fileList.value.findIndex((f) => f.url === uploadFile.url);\n\t\t\tstate.previewList = fileList.value.flatMap((item) => (item.url ? [item.url] : []));\n\t\t\tstate.preview = true;\n\t\t};\n\n\t\tconst handleRemove = (index: number): void => {\n\t\t\tconst file = fileList.value[index];\n\t\t\tif (file) uploadRef.value?.handleRemove(file as UploadFile);\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\tif (!handleOnUpload(rawFile)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (props.beforeUpload) {\n\t\t\t\treturn props.beforeUpload(rawFile);\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<Fragment>\n\t\t\t\t<ElUpload\n\t\t\t\t\t{...elUploadProps.value}\n\t\t\t\t\tref={uploadRef}\n\t\t\t\t\tclass={[\"fa-upload-images\", state.uploadKey, { \"fa-upload-images__hidden-upload\": fileList.value.length >= props.limit }]}\n\t\t\t\t\tvLoading={loading.value}\n\t\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\t\tdisabled={disabled.value}\n\t\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\t\tonError={handleOnError}\n\t\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\t>\n\t\t\t\t\t{{\n\t\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\t\tfileList.value.length < props.limit && slots.default ? (\n\t\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t<Plus />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\ttip: () => <div class=\"el-upload__tip\">files with a size less than {maxSizeMB.value.toString()}MB</div>,\n\t\t\t\t\t\tfile: ({ file, index }: { file: UploadFile; index: number }) => (\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<img class=\"el-upload-list__item-thumbnail\" src={file.url} />\n\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-actions\">\n\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-preview\" onClick={() => handlePreview(file)} title=\"查看\">\n\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t<ZoomIn />\n\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{!disabled.value && (\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={handleEdit} title=\"编辑\">\n\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Edit />\n\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"el-upload-list__item-icon\" onClick={() => handleRemove(index)} title=\"删除\">\n\t\t\t\t\t\t\t\t\t\t\t\t<ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Delete />\n\t\t\t\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t}}\n\t\t\t\t</ElUpload>\n\t\t\t\t{state.preview && (\n\t\t\t\t\t<ElImageViewer\n\t\t\t\t\t\tcloseOnPressEscape\n\t\t\t\t\t\thideOnClickModal\n\t\t\t\t\t\tteleported\n\t\t\t\t\t\tinitialIndex={Math.max(state.previewIndex, 0)}\n\t\t\t\t\t\tonClose={() => (state.preview = false)}\n\t\t\t\t\t\turlList={state.previewList}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Fragment>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t\t/** @description 预览 */\n\t\t\tpreview: computed(() => state.preview),\n\t\t\t/** @description 预览集合 */\n\t\t\tpreviewList: computed(() => state.previewList),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAUA,MAAa,sBAAsB;CAClC,GAAG;;CAEH,QAAQ;EACP,MAAM;EACN,eAAuB,WAAW;CACnC;;CAEA,UAAU;EACT,MAAM,eAAiD,MAAM;EAC7D,SAAS;CACV;;CAEA,UAAU;EACT,MAAM;EACN,SAAS;CACV;;CAEA,OAAO;EACN,MAAM;EACN,SAAS;CACV;;CAEA,YAAY,eAAgC,CAAC,KAAK,CAAC;;CAEnD,SAAS;EACR,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,WAAW,EACV,MAAM,eAAwD,QAAQ,EACvE;;CAEA,WAAW;AACZ;;AAGA,MAAa,sBAAsB;;CAElC,sBAAsB,UAAoC,QAAQ,KAAK,KAAK,OAAO,KAAK;;CAExF,oBAAoB,UAAqC,QAAQ,KAAK;;CAEtE,SAAS,UAAoC,QAAQ,KAAK,KAAK,OAAO,KAAK;AAC5E;AAQA,IAAA,uBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;CACP,OAAO;CACP,OAAO,UAA+B;CACtC,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACrC,M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SAAA;GAAA,GAAA,CAAA,YAAA,QAAA,MAAA,EAAA,eAAA,CAAA,YAAA,QAAA,MAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAM3E,CAAA,CAAA,CAAA;EAGH,CAAA,GAAA,CAAA,CAAA,iBAAA,SAAA,GA7CQ,QAAQ,KAAK,CAAA,CAAA,GAgDvB,MAAM,WAAO,YAAA,eAAA;GAAA,sBAAA;GAAA,oBAAA;GAAA,cAAA;GAAA,gBAKE,KAAK,IAAI,MAAM,cAAc,CAAC;GAAC,iBAC7B,MAAM,UAAU;GAAM,WAC7B,MAAM;EAAW,GAAA,IAAA,CAE3B,CAAA,CAEF;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,QAAQ,eAAe,UAAU,OAAO,MAAM;;GAE9C,YAAY,eAAe,UAAU,OAAO,UAAU;;GAEtD,aAAa,eAAe,UAAU,OAAO,WAAW;;GAExD,cAAc,eAAe,UAAU,OAAO,YAAY;;GAE1D;;GAEA;;GAEA,SAAS,eAAe,MAAM,OAAO;;GAErC,aAAa,eAAe,MAAM,WAAW;EAC9C,CAAC;CACF;AACD,CAAC"}
@@ -1,9 +1,8 @@
1
1
  import { callOptionalFunction } from "./utils/vue/func.mjs";
2
- import isString from "./node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isString.mjs";
3
- import isNil from "./node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/isNil.mjs";
4
2
  import { useOverlay } from "./hooks/use-overlay/index.mjs";
5
3
  import * as ElementPlusIconsVue from "@element-plus/icons-vue";
6
4
  import ElementPlus, { ElDialog, ElForm, ElInput, ElInputNumber, ElMessageBox, ElSelect, ElTable, ElTree, ElTreeSelect } from "element-plus";
5
+ import { isNil, isString } from "lodash-unified";
7
6
  //#region src/element-plus.ts
8
7
  /** Element Plus 组件全局配置 */
9
8
  ElDialog.setPropsDefaults({
@@ -1 +1 @@
1
- {"version":3,"file":"element-plus.mjs","names":[],"sources":["../src/element-plus.ts"],"sourcesContent":["/** Element Plus 组件全局配置 */\n\nimport * as ElementPlusIconsVue from \"@element-plus/icons-vue\";\nimport ElementPlus, { ElDialog, ElForm, ElInput, ElInputNumber, ElMessageBox, ElSelect, ElTable, ElTree, ElTreeSelect } from \"element-plus\";\nimport { isNil, isString } from \"lodash-unified\";\nimport { useOverlay } from \"./hooks\";\nimport { callOptionalFunction } from \"./utils\";\nimport type { Action, ElMessageBoxOptions, ElMessageBoxShortcutMethod, MessageBoxData, MessageBoxState } from \"element-plus\";\nimport type { App, AppContext } from \"vue\";\n\n/* Element Plus 默认值设置。 */\nElDialog.setPropsDefaults({\n\t/** 默认拖拽。 */\n\tdraggable: true,\n});\n\nElForm.setPropsDefaults({\n\t/** 默认标签宽度。 */\n\tlabelWidth: \"auto\",\n\t/** 默认标签后缀。 */\n\tlabelSuffix: \":\",\n\t/** 校验失败时默认滚动到第一个错误表单项。 */\n\tscrollToError: true,\n});\n\nElInput.setPropsDefaults({\n\t/** 默认显示字数统计。 */\n\tshowWordLimit: true,\n});\n\nElInputNumber.setPropsDefaults({\n\t/** 默认不显示控制按钮。 */\n\tcontrols: false,\n});\n\nElSelect.setPropsDefaults({\n\t/** 默认加载提示。 */\n\tloadingText: \"加载中...\",\n\t/** 默认无匹配数据提示。 */\n\tnoMatchText: \"暂无匹配的数据\",\n\t/** 默认无数据提示。 */\n\tnoDataText: \"暂无数据\",\n\t/** 多选时默认折叠标签。 */\n\tcollapseTags: true,\n\t/** 默认在悬停折叠标签时显示完整内容。 */\n\tcollapseTagsTooltip: true,\n});\n\nElTable.setPropsDefaults({\n\t/** 默认显示边框。 */\n\tborder: true,\n\t/** 默认高亮当前行。 */\n\thighlightCurrentRow: true,\n\t/** 默认行 Key。 */\n\trowKey: \"id\",\n});\n\nElTree.setPropsDefaults({\n\t/** 默认展开所有节点。 */\n\tdefaultExpandAll: true,\n\t/** 默认点击时选中节点。 */\n\tcheckOnClickNode: true,\n\t/** 默认高亮当前节点。 */\n\thighlightCurrent: true,\n});\n\nElTreeSelect.setPropsDefaults({\n\t/** 默认加载提示。 */\n\tloadingText: \"加载中...\",\n\t/** 默认无匹配数据提示。 */\n\tnoMatchText: \"暂无匹配的数据\",\n\t/** 默认无数据提示。 */\n\tnoDataText: \"暂无数据\",\n\t/** 多选时默认折叠标签。 */\n\tcollapseTags: true,\n\t/** 默认在悬停折叠标签时显示完整内容。 */\n\tcollapseTagsTooltip: true,\n\t/** 默认展开所有节点。 */\n\tdefaultExpandAll: true,\n\t/** 默认点击时选中节点。 */\n\tcheckOnClickNode: true,\n\t/** 默认高亮当前节点。 */\n\thighlightCurrent: true,\n\t/** 默认仅通过箭头展开或收起节点。 */\n\texpandOnClickNode: false,\n});\n\n// ElMessageBox 默认配置\nconst elMessageBox = (\n\ttype: \"alert\" | \"confirm\" | \"prompt\",\n\tmessage: ElMessageBoxOptions[\"message\"],\n\toptions?: ElMessageBoxOptions,\n\tappContext?: AppContext | null\n): Promise<MessageBoxData> => {\n\t// 不直接修改调用方传入的配置,避免复用同一个 Options 对象时残留本次默认值和 beforeClose 包装。\n\tconst resolvedOptions: ElMessageBoxOptions = { ...(options ?? {}) };\n\t// 默认提示\n\tresolvedOptions.title ??= \"温馨提示\";\n\tif (isNil(resolvedOptions.draggable)) {\n\t\t// 默认拖拽\n\t\tresolvedOptions.draggable = true;\n\t}\n\t// 默认 取消按钮的文本内容\n\tresolvedOptions.cancelButtonText ??= \"取消\";\n\t// 默认 确定按钮的文本内容\n\tresolvedOptions.confirmButtonText ??= \"确定\";\n\tif (isNil(resolvedOptions.closeOnClickModal)) {\n\t\t// 默认 是否可通过点击遮罩层关闭 MessageBox\n\t\tresolvedOptions.closeOnClickModal = false;\n\t}\n\tif (isNil(resolvedOptions.closeOnPressEscape)) {\n\t\t// 默认 是否可通过按下 ESC 键关闭 MessageBox\n\t\tresolvedOptions.closeOnPressEscape = false;\n\t}\n\n\t// 关闭之前的判断逻辑\n\tif (!isNil(resolvedOptions.beforeClose)) {\n\t\tconst localBeforeClose = resolvedOptions.beforeClose;\n\t\tconst localConfirmButtonText = resolvedOptions.confirmButtonText;\n\t\tconst localShowCancelButton = resolvedOptions.showCancelButton;\n\t\tresolvedOptions.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\t\t\t\tlet completed = false;\n\n\t\t\t\tconst cancelLoading = (): void => {\n\t\t\t\t\tinstance.confirmButtonLoading = false;\n\t\t\t\t\tinstance.showCancelButton = localShowCancelButton ?? false;\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\tif (completed) return;\n\t\t\t\t\tcompleted = true;\n\t\t\t\t\tcancelLoading();\n\t\t\t\t\tdone();\n\t\t\t\t};\n\n\t\t\t\tcallOptionalFunction(localBeforeClose, action, instance, newDone)\n\t\t\t\t\t.then(() => newDone())\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tif (!completed) cancelLoading();\n\t\t\t\t\t\tthrow 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\tresolvedOptions.showCancelButton ??= true;\n\t\t\tbreak;\n\t\tcase \"prompt\":\n\t\t\tresolvedOptions.showCancelButton ??= true;\n\t\t\tbreak;\n\t}\n\n\treturn ElMessageBox({ message, ...resolvedOptions, boxType: type }, appContext);\n};\n\ntype MESSAGE_BOX_TYPE = \"alert\" | \"confirm\" | \"prompt\";\nconst MESSAGE_BOX_DEFAULT_OPTS: Record<MESSAGE_BOX_TYPE, Partial<ElMessageBoxOptions>> = {\n\talert: { closeOnPressEscape: false, closeOnClickModal: false },\n\tconfirm: { showCancelButton: true },\n\tprompt: { showCancelButton: true, showInput: true },\n};\n\nconst isAppContext = (value: ElMessageBoxOptions | AppContext | null | undefined): value is AppContext =>\n\ttypeof value === \"object\" && value !== null && \"app\" in value && \"config\" in value;\n\nconst createMessageBoxShortcut = (type: MESSAGE_BOX_TYPE): ElMessageBoxShortcutMethod => {\n\tfunction shortcut(\n\t\tmessage: ElMessageBoxOptions[\"message\"],\n\t\toptions?: ElMessageBoxOptions,\n\t\tappContext?: AppContext | null\n\t): Promise<MessageBoxData>;\n\tfunction shortcut(\n\t\tmessage: ElMessageBoxOptions[\"message\"],\n\t\ttitle: ElMessageBoxOptions[\"title\"],\n\t\toptions?: ElMessageBoxOptions,\n\t\tappContext?: AppContext | null\n\t): Promise<MessageBoxData>;\n\tfunction shortcut(\n\t\tmessage: ElMessageBoxOptions[\"message\"],\n\t\ttitleOrOptions?: string | ElMessageBoxOptions,\n\t\toptionsOrContext?: ElMessageBoxOptions | AppContext | null,\n\t\tappContext?: AppContext | null\n\t): Promise<MessageBoxData> {\n\t\tif (isString(titleOrOptions)) {\n\t\t\tconst options = isAppContext(optionsOrContext) ? undefined : optionsOrContext;\n\t\t\treturn elMessageBox(type, message, { ...MESSAGE_BOX_DEFAULT_OPTS[type], title: titleOrOptions, ...(options ?? {}) }, appContext);\n\t\t}\n\n\t\tconst context = optionsOrContext === null || isAppContext(optionsOrContext) ? optionsOrContext : undefined;\n\t\treturn elMessageBox(type, message, { ...MESSAGE_BOX_DEFAULT_OPTS[type], ...(titleOrOptions ?? {}) }, context);\n\t}\n\n\treturn shortcut;\n};\n\nElMessageBox.alert = createMessageBoxShortcut(\"alert\");\nElMessageBox.prompt = createMessageBoxShortcut(\"prompt\");\nElMessageBox.confirm = createMessageBoxShortcut(\"confirm\");\n\n/**\n * 注册 Element Plus 及其全部图标。\n *\n * @param app - Vue 应用实例。\n */\nexport const installElementPlus = (app: App): void => {\n\t/** 注册 Element Plus 全部图标,供 FaIcon 按名称解析。 */\n\tfor (const [key, component] of Object.entries(ElementPlusIconsVue)) app.component(`el-icon-${key}`, component);\n\n\t/** Element Plus 组件完整引入 */\n\tapp.use(ElementPlus);\n};\n"],"mappings":";;;;;;;;AAWA,SAAS,iBAAiB;;AAEzB,WAAW,KACZ,CAAC;AAED,OAAO,iBAAiB;;CAEvB,YAAY;;CAEZ,aAAa;;CAEb,eAAe;AAChB,CAAC;AAED,QAAQ,iBAAiB;;AAExB,eAAe,KAChB,CAAC;AAED,cAAc,iBAAiB;;AAE9B,UAAU,MACX,CAAC;AAED,SAAS,iBAAiB;;CAEzB,aAAa;;CAEb,aAAa;;CAEb,YAAY;;CAEZ,cAAc;;CAEd,qBAAqB;AACtB,CAAC;AAED,QAAQ,iBAAiB;;CAExB,QAAQ;;CAER,qBAAqB;;CAErB,QAAQ;AACT,CAAC;AAED,OAAO,iBAAiB;;CAEvB,kBAAkB;;CAElB,kBAAkB;;CAElB,kBAAkB;AACnB,CAAC;AAED,aAAa,iBAAiB;;CAE7B,aAAa;;CAEb,aAAa;;CAEb,YAAY;;CAEZ,cAAc;;CAEd,qBAAqB;;CAErB,kBAAkB;;CAElB,kBAAkB;;CAElB,kBAAkB;;CAElB,mBAAmB;AACpB,CAAC;AAGD,MAAM,gBACL,MACA,SACA,SACA,eAC6B;CAE7B,MAAM,kBAAuC,EAAE,GAAI,WAAW,CAAC,EAAG;CAElE,gBAAgB,UAAU;CAC1B,IAAI,MAAM,gBAAgB,SAAS,GAElC,gBAAgB,YAAY;CAG7B,gBAAgB,qBAAqB;CAErC,gBAAgB,sBAAsB;CACtC,IAAI,MAAM,gBAAgB,iBAAiB,GAE1C,gBAAgB,oBAAoB;CAErC,IAAI,MAAM,gBAAgB,kBAAkB,GAE3C,gBAAgB,qBAAqB;CAItC,IAAI,CAAC,MAAM,gBAAgB,WAAW,GAAG;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M,SAAS;IAAE,GAAG,yBAAyB;IAAO,OAAO;IAAgB,GAAI,WAAW,CAAC;GAAG,GAAG,UAAU;EAChI;EAEA,MAAM,UAAU,qBAAqB,QAAQ,aAAa,gBAAgB,IAAI,mBAAmB,KAAA;EACjG,OAAO,aAAa,MAAM,SAAS;GAAE,GAAG,yBAAyB;GAAO,GAAI,kBAAkB,CAAC;EAAG,GAAG,OAAO;CAC7G;CAEA,OAAO;AACR;AAEA,aAAa,QAAQ,yBAAyB,OAAO;AACrD,aAAa,SAAS,yBAAyB,QAAQ;AACvD,aAAa,UAAU,yBAAyB,SAAS;;;;;;AAOzD,MAAa,sBAAsB,QAAmB;;CAErD,KAAK,MAAM,CAAC,KAAK,cAAc,OAAO,QAAQ,mBAAmB,GAAG,IAAI,UAAU,WAAW,OAAO,SAAS;;CAG7G,IAAI,IAAI,WAAW;AACpB"}
1
+ {"version":3,"file":"element-plus.mjs","names":[],"sources":["../src/element-plus.ts"],"sourcesContent":["/** Element Plus 组件全局配置 */\n\nimport * as ElementPlusIconsVue from \"@element-plus/icons-vue\";\nimport ElementPlus, { ElDialog, ElForm, ElInput, ElInputNumber, ElMessageBox, ElSelect, ElTable, ElTree, ElTreeSelect } from \"element-plus\";\nimport { isNil, isString } from \"lodash-unified\";\nimport { useOverlay } from \"./hooks\";\nimport { callOptionalFunction } from \"./utils\";\nimport type { Action, ElMessageBoxOptions, ElMessageBoxShortcutMethod, MessageBoxData, MessageBoxState } from \"element-plus\";\nimport type { App, AppContext } from \"vue\";\n\n/* Element Plus 默认值设置。 */\nElDialog.setPropsDefaults({\n\t/** 默认拖拽。 */\n\tdraggable: true,\n});\n\nElForm.setPropsDefaults({\n\t/** 默认标签宽度。 */\n\tlabelWidth: \"auto\",\n\t/** 默认标签后缀。 */\n\tlabelSuffix: \":\",\n\t/** 校验失败时默认滚动到第一个错误表单项。 */\n\tscrollToError: true,\n});\n\nElInput.setPropsDefaults({\n\t/** 默认显示字数统计。 */\n\tshowWordLimit: true,\n});\n\nElInputNumber.setPropsDefaults({\n\t/** 默认不显示控制按钮。 */\n\tcontrols: false,\n});\n\nElSelect.setPropsDefaults({\n\t/** 默认加载提示。 */\n\tloadingText: \"加载中...\",\n\t/** 默认无匹配数据提示。 */\n\tnoMatchText: \"暂无匹配的数据\",\n\t/** 默认无数据提示。 */\n\tnoDataText: \"暂无数据\",\n\t/** 多选时默认折叠标签。 */\n\tcollapseTags: true,\n\t/** 默认在悬停折叠标签时显示完整内容。 */\n\tcollapseTagsTooltip: true,\n});\n\nElTable.setPropsDefaults({\n\t/** 默认显示边框。 */\n\tborder: true,\n\t/** 默认高亮当前行。 */\n\thighlightCurrentRow: true,\n\t/** 默认行 Key。 */\n\trowKey: \"id\",\n});\n\nElTree.setPropsDefaults({\n\t/** 默认展开所有节点。 */\n\tdefaultExpandAll: true,\n\t/** 默认点击时选中节点。 */\n\tcheckOnClickNode: true,\n\t/** 默认高亮当前节点。 */\n\thighlightCurrent: true,\n});\n\nElTreeSelect.setPropsDefaults({\n\t/** 默认加载提示。 */\n\tloadingText: \"加载中...\",\n\t/** 默认无匹配数据提示。 */\n\tnoMatchText: \"暂无匹配的数据\",\n\t/** 默认无数据提示。 */\n\tnoDataText: \"暂无数据\",\n\t/** 多选时默认折叠标签。 */\n\tcollapseTags: true,\n\t/** 默认在悬停折叠标签时显示完整内容。 */\n\tcollapseTagsTooltip: true,\n\t/** 默认展开所有节点。 */\n\tdefaultExpandAll: true,\n\t/** 默认点击时选中节点。 */\n\tcheckOnClickNode: true,\n\t/** 默认高亮当前节点。 */\n\thighlightCurrent: true,\n\t/** 默认仅通过箭头展开或收起节点。 */\n\texpandOnClickNode: false,\n});\n\n// ElMessageBox 默认配置\nconst elMessageBox = (\n\ttype: \"alert\" | \"confirm\" | \"prompt\",\n\tmessage: ElMessageBoxOptions[\"message\"],\n\toptions?: ElMessageBoxOptions,\n\tappContext?: AppContext | null\n): Promise<MessageBoxData> => {\n\t// 不直接修改调用方传入的配置,避免复用同一个 Options 对象时残留本次默认值和 beforeClose 包装。\n\tconst resolvedOptions: ElMessageBoxOptions = { ...(options ?? {}) };\n\t// 默认提示\n\tresolvedOptions.title ??= \"温馨提示\";\n\tif (isNil(resolvedOptions.draggable)) {\n\t\t// 默认拖拽\n\t\tresolvedOptions.draggable = true;\n\t}\n\t// 默认 取消按钮的文本内容\n\tresolvedOptions.cancelButtonText ??= \"取消\";\n\t// 默认 确定按钮的文本内容\n\tresolvedOptions.confirmButtonText ??= \"确定\";\n\tif (isNil(resolvedOptions.closeOnClickModal)) {\n\t\t// 默认 是否可通过点击遮罩层关闭 MessageBox\n\t\tresolvedOptions.closeOnClickModal = false;\n\t}\n\tif (isNil(resolvedOptions.closeOnPressEscape)) {\n\t\t// 默认 是否可通过按下 ESC 键关闭 MessageBox\n\t\tresolvedOptions.closeOnPressEscape = false;\n\t}\n\n\t// 关闭之前的判断逻辑\n\tif (!isNil(resolvedOptions.beforeClose)) {\n\t\tconst localBeforeClose = resolvedOptions.beforeClose;\n\t\tconst localConfirmButtonText = resolvedOptions.confirmButtonText;\n\t\tconst localShowCancelButton = resolvedOptions.showCancelButton;\n\t\tresolvedOptions.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\t\t\t\tlet completed = false;\n\n\t\t\t\tconst cancelLoading = (): void => {\n\t\t\t\t\tinstance.confirmButtonLoading = false;\n\t\t\t\t\tinstance.showCancelButton = localShowCancelButton ?? false;\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\tif (completed) return;\n\t\t\t\t\tcompleted = true;\n\t\t\t\t\tcancelLoading();\n\t\t\t\t\tdone();\n\t\t\t\t};\n\n\t\t\t\tcallOptionalFunction(localBeforeClose, action, instance, newDone)\n\t\t\t\t\t.then(() => newDone())\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tif (!completed) cancelLoading();\n\t\t\t\t\t\tthrow 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\tresolvedOptions.showCancelButton ??= true;\n\t\t\tbreak;\n\t\tcase \"prompt\":\n\t\t\tresolvedOptions.showCancelButton ??= true;\n\t\t\tbreak;\n\t}\n\n\treturn ElMessageBox({ message, ...resolvedOptions, boxType: type }, appContext);\n};\n\ntype MESSAGE_BOX_TYPE = \"alert\" | \"confirm\" | \"prompt\";\nconst MESSAGE_BOX_DEFAULT_OPTS: Record<MESSAGE_BOX_TYPE, Partial<ElMessageBoxOptions>> = {\n\talert: { closeOnPressEscape: false, closeOnClickModal: false },\n\tconfirm: { showCancelButton: true },\n\tprompt: { showCancelButton: true, showInput: true },\n};\n\nconst isAppContext = (value: ElMessageBoxOptions | AppContext | null | undefined): value is AppContext =>\n\ttypeof value === \"object\" && value !== null && \"app\" in value && \"config\" in value;\n\nconst createMessageBoxShortcut = (type: MESSAGE_BOX_TYPE): ElMessageBoxShortcutMethod => {\n\tfunction shortcut(\n\t\tmessage: ElMessageBoxOptions[\"message\"],\n\t\toptions?: ElMessageBoxOptions,\n\t\tappContext?: AppContext | null\n\t): Promise<MessageBoxData>;\n\tfunction shortcut(\n\t\tmessage: ElMessageBoxOptions[\"message\"],\n\t\ttitle: ElMessageBoxOptions[\"title\"],\n\t\toptions?: ElMessageBoxOptions,\n\t\tappContext?: AppContext | null\n\t): Promise<MessageBoxData>;\n\tfunction shortcut(\n\t\tmessage: ElMessageBoxOptions[\"message\"],\n\t\ttitleOrOptions?: string | ElMessageBoxOptions,\n\t\toptionsOrContext?: ElMessageBoxOptions | AppContext | null,\n\t\tappContext?: AppContext | null\n\t): Promise<MessageBoxData> {\n\t\tif (isString(titleOrOptions)) {\n\t\t\tconst options = isAppContext(optionsOrContext) ? undefined : optionsOrContext;\n\t\t\treturn elMessageBox(type, message, { ...MESSAGE_BOX_DEFAULT_OPTS[type], title: titleOrOptions, ...(options ?? {}) }, appContext);\n\t\t}\n\n\t\tconst context = optionsOrContext === null || isAppContext(optionsOrContext) ? optionsOrContext : undefined;\n\t\treturn elMessageBox(type, message, { ...MESSAGE_BOX_DEFAULT_OPTS[type], ...(titleOrOptions ?? {}) }, context);\n\t}\n\n\treturn shortcut;\n};\n\nElMessageBox.alert = createMessageBoxShortcut(\"alert\");\nElMessageBox.prompt = createMessageBoxShortcut(\"prompt\");\nElMessageBox.confirm = createMessageBoxShortcut(\"confirm\");\n\n/**\n * 注册 Element Plus 及其全部图标。\n *\n * @param app - Vue 应用实例。\n */\nexport const installElementPlus = (app: App): void => {\n\t/** 注册 Element Plus 全部图标,供 FaIcon 按名称解析。 */\n\tfor (const [key, component] of Object.entries(ElementPlusIconsVue)) app.component(`el-icon-${key}`, component);\n\n\t/** Element Plus 组件完整引入 */\n\tapp.use(ElementPlus);\n};\n"],"mappings":";;;;;;;AAWA,SAAS,iBAAiB;;AAEzB,WAAW,KACZ,CAAC;AAED,OAAO,iBAAiB;;CAEvB,YAAY;;CAEZ,aAAa;;CAEb,eAAe;AAChB,CAAC;AAED,QAAQ,iBAAiB;;AAExB,eAAe,KAChB,CAAC;AAED,cAAc,iBAAiB;;AAE9B,UAAU,MACX,CAAC;AAED,SAAS,iBAAiB;;CAEzB,aAAa;;CAEb,aAAa;;CAEb,YAAY;;CAEZ,cAAc;;CAEd,qBAAqB;AACtB,CAAC;AAED,QAAQ,iBAAiB;;CAExB,QAAQ;;CAER,qBAAqB;;CAErB,QAAQ;AACT,CAAC;AAED,OAAO,iBAAiB;;CAEvB,kBAAkB;;CAElB,kBAAkB;;CAElB,kBAAkB;AAC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GACJ,gBAAgB,qBAAqB;GACrC;EACD,KAAK,UACJ,gBAAgB,qBAAqB;CAEvC;CAEA,OAAO,aAAa;EAAE;EAAS,GAAG;EAAiB,SAAS;CAAK,GAAG,UAAU;AAC/E;AAGA,MAAM,2BAAmF;CACxF,OAAO;EAAE,oBAAoB;EAAO,mBAAmB;CAAM;CAC7D,SAAS,EAAE,kBAAkB,KAAK;CAClC,QAAQ;EAAE,kBAAkB;EAAM,WAAW;CAAK;AACnD;AAEA,MAAM,gBAAgB,UACrB,OAAO,UAAU,YAAY,UAAU,QAAQ,SAAS,SAAS,YAAY;AAE9E,MAAM,4BAA4B,SAAuD;CAYxF,SAAS,SACR,SACA,gBACA,kBACA,YAC0B;EAC1B,IAAI,SAAS,cAAc,GAAG;GAC7B,MAAM,UAAU,aAAa,gBAAgB,IAAI,KAAA,IAAY;GAC7D,OAAO,aAAa,MAAM,SAAS;IAAE,GAAG,yBAAyB;IAAO,OAAO;IAAgB,GAAI,WAAW,CAAC;GAAG,GAAG,UAAU;EAChI;EAEA,MAAM,UAAU,qBAAqB,QAAQ,aAAa,gBAAgB,IAAI,mBAAmB,KAAA;EACjG,OAAO,aAAa,MAAM,SAAS;GAAE,GAAG,yBAAyB;GAAO,GAAI,kBAAkB,CAAC;EAAG,GAAG,OAAO;CAC7G;CAEA,OAAO;AACR;AAEA,aAAa,QAAQ,yBAAyB,OAAO;AACrD,aAAa,SAAS,yBAAyB,QAAQ;AACvD,aAAa,UAAU,yBAAyB,SAAS;;;;;;AAOzD,MAAa,sBAAsB,QAAmB;;CAErD,KAAK,MAAM,CAAC,KAAK,cAAc,OAAO,QAAQ,mBAAmB,GAAG,IAAI,UAAU,WAAW,OAAO,SAAS;;CAG7G,IAAI,IAAI,WAAW;AACpB"}
@@ -1,11 +1,11 @@
1
- import screenfull_default from "../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs";
2
1
  import { ref } from "vue";
3
2
  import { ElMessage } from "element-plus";
3
+ import screenfull from "screenfull";
4
4
  //#region src/hooks/use-screenFull/index.ts
5
5
  const isFullscreen = ref(false);
6
6
  let initialized = false;
7
7
  const handleFullscreenChange = () => {
8
- isFullscreen.value = screenfull_default.isEnabled && screenfull_default.isFullscreen;
8
+ isFullscreen.value = screenfull.isEnabled && screenfull.isFullscreen;
9
9
  };
10
10
  /** 浏览器全屏状态控制器。 */
11
11
  const useScreenFull = {
@@ -13,41 +13,41 @@ const useScreenFull = {
13
13
  isFullscreen: () => isFullscreen.value,
14
14
  /** 初始化全屏状态监听。 */
15
15
  init: () => {
16
- if (!screenfull_default.isEnabled || initialized) return;
16
+ if (!screenfull.isEnabled || initialized) return;
17
17
  initialized = true;
18
18
  handleFullscreenChange();
19
- screenfull_default.on("change", handleFullscreenChange);
19
+ screenfull.on("change", handleFullscreenChange);
20
20
  },
21
21
  /** 释放全屏状态监听。 */
22
22
  dispose: () => {
23
- if (!screenfull_default.isEnabled || !initialized) return;
24
- screenfull_default.off("change", handleFullscreenChange);
23
+ if (!screenfull.isEnabled || !initialized) return;
24
+ screenfull.off("change", handleFullscreenChange);
25
25
  initialized = false;
26
26
  },
27
27
  /** 切换全屏状态。 */
28
28
  toggle: () => {
29
- if (!screenfull_default.isEnabled) {
29
+ if (!screenfull.isEnabled) {
30
30
  ElMessage.warning("当前您的浏览器不支持全屏 ❌");
31
31
  return;
32
32
  }
33
- screenfull_default.toggle();
33
+ screenfull.toggle();
34
34
  },
35
35
  /** 进入全屏状态。 */
36
36
  full: () => {
37
- if (!screenfull_default.isEnabled) {
37
+ if (!screenfull.isEnabled) {
38
38
  ElMessage.warning("当前您的浏览器不支持全屏 ❌");
39
39
  return;
40
40
  }
41
- if (screenfull_default.isFullscreen) return;
42
- screenfull_default.request();
41
+ if (screenfull.isFullscreen) return;
42
+ screenfull.request();
43
43
  },
44
44
  /** 退出全屏状态。 */
45
45
  exit: () => {
46
- if (!screenfull_default.isEnabled) {
46
+ if (!screenfull.isEnabled) {
47
47
  ElMessage.warning("当前您的浏览器不支持全屏 ❌");
48
48
  return;
49
49
  }
50
- if (screenfull_default.isFullscreen) screenfull_default.exit();
50
+ if (screenfull.isFullscreen) screenfull.exit();
51
51
  }
52
52
  };
53
53
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["screenfull"],"sources":["../../../src/hooks/use-screenFull/index.ts"],"sourcesContent":["import { ref } from \"vue\";\nimport { ElMessage } from \"element-plus\";\nimport screenfull from \"screenfull\";\n\nconst isFullscreen = ref(false);\nlet initialized = false;\n\nconst handleFullscreenChange = (): void => {\n\tisFullscreen.value = screenfull.isEnabled && screenfull.isFullscreen;\n};\n\n/** 浏览器全屏状态控制器。 */\nexport const useScreenFull = {\n\t/** 获取当前全屏状态。 */\n\tisFullscreen: (): boolean => isFullscreen.value,\n\t/** 初始化全屏状态监听。 */\n\tinit: (): void => {\n\t\tif (!screenfull.isEnabled || initialized) return;\n\t\tinitialized = true;\n\t\thandleFullscreenChange();\n\t\tscreenfull.on(\"change\", handleFullscreenChange);\n\t},\n\t/** 释放全屏状态监听。 */\n\tdispose: (): void => {\n\t\tif (!screenfull.isEnabled || !initialized) return;\n\t\tscreenfull.off(\"change\", handleFullscreenChange);\n\t\tinitialized = false;\n\t},\n\t/** 切换全屏状态。 */\n\ttoggle: (): void => {\n\t\tif (!screenfull.isEnabled) {\n\t\t\tElMessage.warning(\"当前您的浏览器不支持全屏 ❌\");\n\t\t\treturn;\n\t\t}\n\t\tvoid screenfull.toggle();\n\t},\n\t/** 进入全屏状态。 */\n\tfull: (): void => {\n\t\tif (!screenfull.isEnabled) {\n\t\t\tElMessage.warning(\"当前您的浏览器不支持全屏 ❌\");\n\t\t\treturn;\n\t\t}\n\t\tif (screenfull.isFullscreen) {\n\t\t\treturn;\n\t\t}\n\t\t// const htmlEl = document.querySelector(\"html\");\n\t\t// screenfull.request(htmlEl);\n\t\tvoid screenfull.request();\n\t},\n\t/** 退出全屏状态。 */\n\texit: (): void => {\n\t\tif (!screenfull.isEnabled) {\n\t\t\tElMessage.warning(\"当前您的浏览器不支持全屏 ❌\");\n\t\t\treturn;\n\t\t}\n\t\tif (screenfull.isFullscreen) {\n\t\t\tvoid screenfull.exit();\n\t\t}\n\t},\n};\n"],"mappings":";;;;AAIA,MAAM,eAAe,IAAI,KAAK;AAC9B,IAAI,cAAc;AAElB,MAAM,+BAAqC;CAC1C,aAAa,QAAQA,mBAAW,aAAaA,mBAAW;AACzD;;AAGA,MAAa,gBAAgB;;CAE5B,oBAA6B,aAAa;;CAE1C,YAAkB;EACjB,IAAI,CAACA,mBAAW,aAAa,aAAa;EAC1C,cAAc;EACd,uBAAuB;EACvB,mBAAW,GAAG,UAAU,sBAAsB;CAC/C;;CAEA,eAAqB;EACpB,IAAI,CAACA,mBAAW,aAAa,CAAC,aAAa;EAC3C,mBAAW,IAAI,UAAU,sBAAsB;EAC/C,cAAc;CACf;;CAEA,cAAoB;EACnB,IAAI,CAACA,mBAAW,WAAW;GAC1B,UAAU,QAAQ,gBAAgB;GAClC;EACD;EACA,mBAAgB,OAAO;CACxB;;CAEA,YAAkB;EACjB,IAAI,CAACA,mBAAW,WAAW;GAC1B,UAAU,QAAQ,gBAAgB;GAClC;EACD;EACA,IAAIA,mBAAW,cACd;EAID,mBAAgB,QAAQ;CACzB;;CAEA,YAAkB;EACjB,IAAI,CAACA,mBAAW,WAAW;GAC1B,UAAU,QAAQ,gBAAgB;GAClC;EACD;EACA,IAAIA,mBAAW,cACd,mBAAgB,KAAK;CAEvB;AACD"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/hooks/use-screenFull/index.ts"],"sourcesContent":["import { ref } from \"vue\";\nimport { ElMessage } from \"element-plus\";\nimport screenfull from \"screenfull\";\n\nconst isFullscreen = ref(false);\nlet initialized = false;\n\nconst handleFullscreenChange = (): void => {\n\tisFullscreen.value = screenfull.isEnabled && screenfull.isFullscreen;\n};\n\n/** 浏览器全屏状态控制器。 */\nexport const useScreenFull = {\n\t/** 获取当前全屏状态。 */\n\tisFullscreen: (): boolean => isFullscreen.value,\n\t/** 初始化全屏状态监听。 */\n\tinit: (): void => {\n\t\tif (!screenfull.isEnabled || initialized) return;\n\t\tinitialized = true;\n\t\thandleFullscreenChange();\n\t\tscreenfull.on(\"change\", handleFullscreenChange);\n\t},\n\t/** 释放全屏状态监听。 */\n\tdispose: (): void => {\n\t\tif (!screenfull.isEnabled || !initialized) return;\n\t\tscreenfull.off(\"change\", handleFullscreenChange);\n\t\tinitialized = false;\n\t},\n\t/** 切换全屏状态。 */\n\ttoggle: (): void => {\n\t\tif (!screenfull.isEnabled) {\n\t\t\tElMessage.warning(\"当前您的浏览器不支持全屏 ❌\");\n\t\t\treturn;\n\t\t}\n\t\tvoid screenfull.toggle();\n\t},\n\t/** 进入全屏状态。 */\n\tfull: (): void => {\n\t\tif (!screenfull.isEnabled) {\n\t\t\tElMessage.warning(\"当前您的浏览器不支持全屏 ❌\");\n\t\t\treturn;\n\t\t}\n\t\tif (screenfull.isFullscreen) {\n\t\t\treturn;\n\t\t}\n\t\t// const htmlEl = document.querySelector(\"html\");\n\t\t// screenfull.request(htmlEl);\n\t\tvoid screenfull.request();\n\t},\n\t/** 退出全屏状态。 */\n\texit: (): void => {\n\t\tif (!screenfull.isEnabled) {\n\t\t\tElMessage.warning(\"当前您的浏览器不支持全屏 ❌\");\n\t\t\treturn;\n\t\t}\n\t\tif (screenfull.isFullscreen) {\n\t\t\tvoid screenfull.exit();\n\t\t}\n\t},\n};\n"],"mappings":";;;;AAIA,MAAM,eAAe,IAAI,KAAK;AAC9B,IAAI,cAAc;AAElB,MAAM,+BAAqC;CAC1C,aAAa,QAAQ,WAAW,aAAa,WAAW;AACzD;;AAGA,MAAa,gBAAgB;;CAE5B,oBAA6B,aAAa;;CAE1C,YAAkB;EACjB,IAAI,CAAC,WAAW,aAAa,aAAa;EAC1C,cAAc;EACd,uBAAuB;EACvB,WAAW,GAAG,UAAU,sBAAsB;CAC/C;;CAEA,eAAqB;EACpB,IAAI,CAAC,WAAW,aAAa,CAAC,aAAa;EAC3C,WAAW,IAAI,UAAU,sBAAsB;EAC/C,cAAc;CACf;;CAEA,cAAoB;EACnB,IAAI,CAAC,WAAW,WAAW;GAC1B,UAAU,QAAQ,gBAAgB;GAClC;EACD;EACA,WAAgB,OAAO;CACxB;;CAEA,YAAkB;EACjB,IAAI,CAAC,WAAW,WAAW;GAC1B,UAAU,QAAQ,gBAAgB;GAClC;EACD;EACA,IAAI,WAAW,cACd;EAID,WAAgB,QAAQ;CACzB;;CAEA,YAAkB;EACjB,IAAI,CAAC,WAAW,WAAW;GAC1B,UAAU,QAAQ,gBAAgB;GAClC;EACD;EACA,IAAI,WAAW,cACd,WAAgB,KAAK;CAEvB;AACD"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  /** 用于标记已经安装 Fast.Element.Plus 的 Vue 应用。 */
2
2
  export { INSTALLED_KEY } from "./make-installer";
3
- /** Fast.Element.Plus 的全部公开组件。 */
4
- export * as FastElementPlus from "./components";
5
3
  export * from "./components";
6
4
  export * from "./constants";
7
5
  export * from "./directives";