@wfrog/vc-ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/README.md +95 -0
  2. package/dist/es/chunk/-EkpfdcW.mjs +1100 -0
  3. package/dist/es/chunk/8rLUmOVR.mjs +29 -0
  4. package/dist/es/chunk/B-rxnVJv.mjs +3 -0
  5. package/dist/es/chunk/BAGoDD49.mjs +36 -0
  6. package/dist/es/chunk/BAtns-Mc.mjs +96 -0
  7. package/dist/es/chunk/BJS5Pdfp.mjs +55 -0
  8. package/dist/es/chunk/BMzd-IS6.mjs +900 -0
  9. package/dist/es/chunk/BWcCXRRK.mjs +229 -0
  10. package/dist/es/chunk/BX-Ogf7p.mjs +3743 -0
  11. package/dist/es/chunk/B_tU9Nax.mjs +49 -0
  12. package/dist/es/chunk/BdDihk0t.mjs +3420 -0
  13. package/dist/es/chunk/C2LgraHx.mjs +489 -0
  14. package/dist/es/chunk/C5hWsUfD.mjs +64 -0
  15. package/dist/es/chunk/C7iSSBUr.mjs +303 -0
  16. package/dist/es/chunk/CD98REcR.mjs +666 -0
  17. package/dist/es/chunk/CEClY-_T.mjs +445 -0
  18. package/dist/es/chunk/CEm0brzD.mjs +35 -0
  19. package/dist/es/chunk/CMABHk8B.mjs +1942 -0
  20. package/dist/es/chunk/CS4VKsqy.mjs +19 -0
  21. package/dist/es/chunk/CVlj9F0I.mjs +291 -0
  22. package/dist/es/chunk/CZ4ggqDE.mjs +140 -0
  23. package/dist/es/chunk/CaTfZePA.mjs +533 -0
  24. package/dist/es/chunk/Ce9ApjrT.mjs +201 -0
  25. package/dist/es/chunk/ClZGuAIb.mjs +10 -0
  26. package/dist/es/chunk/Coex0GxM.mjs +450 -0
  27. package/dist/es/chunk/Ct6q2FXg.mjs +5 -0
  28. package/dist/es/chunk/CyxEcbcy.mjs +29 -0
  29. package/dist/es/chunk/D389hx_T.mjs +35 -0
  30. package/dist/es/chunk/D3DXeVfC.mjs +1171 -0
  31. package/dist/es/chunk/D3uV7vm-.mjs +45 -0
  32. package/dist/es/chunk/D5259bwd.mjs +50 -0
  33. package/dist/es/chunk/DMHNh_tw.mjs +49 -0
  34. package/dist/es/chunk/DVNTpOBR.mjs +4 -0
  35. package/dist/es/chunk/DZACQ9LT.mjs +95 -0
  36. package/dist/es/chunk/De_EXLIy.mjs +22 -0
  37. package/dist/es/chunk/Dh4jaUSg.mjs +89 -0
  38. package/dist/es/chunk/DhhdKtyu.mjs +439 -0
  39. package/dist/es/chunk/DqUIKX7f.mjs +2039 -0
  40. package/dist/es/chunk/Dqz1zvKN.mjs +59 -0
  41. package/dist/es/chunk/Dvi7RsXg.mjs +727 -0
  42. package/dist/es/chunk/DyDMGLoF.mjs +123 -0
  43. package/dist/es/chunk/E_WRn0OP.mjs +449 -0
  44. package/dist/es/chunk/Fo0dZYnz.mjs +128 -0
  45. package/dist/es/chunk/HSv8BL8o.mjs +72 -0
  46. package/dist/es/chunk/JCIyOUEY.mjs +105 -0
  47. package/dist/es/chunk/O-uhUKF4.mjs +43 -0
  48. package/dist/es/chunk/Spa-JKB4.mjs +1046 -0
  49. package/dist/es/chunk/VAdRxe-1.mjs +16 -0
  50. package/dist/es/chunk/VCrtRnxt.mjs +1477 -0
  51. package/dist/es/chunk/ViP2SEY4.mjs +211 -0
  52. package/dist/es/chunk/aibQ9WSZ.mjs +249 -0
  53. package/dist/es/chunk/nWBcrYxV.mjs +690 -0
  54. package/dist/es/chunk/pcqpp-6-.mjs +9 -0
  55. package/dist/es/chunk/qY9OvNHY.mjs +283 -0
  56. package/dist/es/chunk/su2Zrql0.mjs +53 -0
  57. package/dist/es/chunk/zfg5SOj1.mjs +138 -0
  58. package/dist/es/components/awesome-icon/awesome-icon.d.ts +6 -0
  59. package/dist/es/components/awesome-icon/awesome-icon.mjs +41 -0
  60. package/dist/es/components/awesome-icon/awesome-icon.vue.d.ts +5 -0
  61. package/dist/es/components/awesome-icon/index.d.ts +4 -0
  62. package/dist/es/components/awesome-icon/index.mjs +6 -0
  63. package/dist/es/components/backbottom/backbottom.d.ts +7 -0
  64. package/dist/es/components/backbottom/backbottom.mjs +172 -0
  65. package/dist/es/components/backbottom/backbottom.vue.d.ts +7 -0
  66. package/dist/es/components/backbottom/components/child.vue.d.ts +30 -0
  67. package/dist/es/components/backbottom/index.d.ts +4 -0
  68. package/dist/es/components/backbottom/index.mjs +6 -0
  69. package/dist/es/components/button/button.d.ts +18 -0
  70. package/dist/es/components/button/button.mjs +313 -0
  71. package/dist/es/components/button/button.vue.d.ts +33 -0
  72. package/dist/es/components/button/index.css +9 -0
  73. package/dist/es/components/button/index.d.ts +4 -0
  74. package/dist/es/components/button/index.mjs +6 -0
  75. package/dist/es/components/cdn-tag.vue.d.ts +5 -0
  76. package/dist/es/components/chat-container/chat-container.d.ts +9 -0
  77. package/dist/es/components/chat-container/chat-container.mjs +77 -0
  78. package/dist/es/components/chat-container/chat-container.vue.d.ts +29 -0
  79. package/dist/es/components/chat-container/index.css +9 -0
  80. package/dist/es/components/chat-container/index.d.ts +4 -0
  81. package/dist/es/components/chat-container/index.mjs +6 -0
  82. package/dist/es/components/choice/choice.d.ts +6 -0
  83. package/dist/es/components/choice/choice.mjs +53 -0
  84. package/dist/es/components/choice/choice.vue.d.ts +5 -0
  85. package/dist/es/components/choice/index.css +7 -0
  86. package/dist/es/components/choice/index.d.ts +4 -0
  87. package/dist/es/components/choice/index.mjs +6 -0
  88. package/dist/es/components/choice-boolean/choice-boolean.d.ts +5 -0
  89. package/dist/es/components/choice-boolean/choice-boolean.mjs +32 -0
  90. package/dist/es/components/choice-boolean/choice-boolean.vue.d.ts +10 -0
  91. package/dist/es/components/choice-boolean/index.d.ts +4 -0
  92. package/dist/es/components/choice-boolean/index.mjs +6 -0
  93. package/dist/es/components/config-provider/config-provider.d.ts +16 -0
  94. package/dist/es/components/config-provider/config-provider.mjs +29 -0
  95. package/dist/es/components/config-provider/config-provider.vue.d.ts +18 -0
  96. package/dist/es/components/config-provider/config-provider2.mjs +6 -0
  97. package/dist/es/components/config-provider/index.d.ts +4 -0
  98. package/dist/es/components/config-provider/index.mjs +6 -0
  99. package/dist/es/components/cropper/cropper.d.ts +12 -0
  100. package/dist/es/components/cropper/cropper.mjs +333 -0
  101. package/dist/es/components/cropper/cropper.vue.d.ts +32 -0
  102. package/dist/es/components/cropper/index.css +4 -0
  103. package/dist/es/components/cropper/index.d.ts +4 -0
  104. package/dist/es/components/cropper/index.mjs +6 -0
  105. package/dist/es/components/currency/currency.d.ts +21 -0
  106. package/dist/es/components/currency/currency.mjs +185 -0
  107. package/dist/es/components/currency/currency.vue.d.ts +14 -0
  108. package/dist/es/components/currency/index.css +8 -0
  109. package/dist/es/components/currency/index.d.ts +4 -0
  110. package/dist/es/components/currency/index.mjs +6 -0
  111. package/dist/es/components/daterange-picker/daterange-picker.d.ts +6 -0
  112. package/dist/es/components/daterange-picker/daterange-picker.mjs +5550 -0
  113. package/dist/es/components/daterange-picker/daterange-picker.vue.d.ts +13 -0
  114. package/dist/es/components/daterange-picker/index.d.ts +4 -0
  115. package/dist/es/components/daterange-picker/index.mjs +6 -0
  116. package/dist/es/components/dialog/dialog.d.ts +13 -0
  117. package/dist/es/components/dialog/dialog.mjs +537 -0
  118. package/dist/es/components/dialog/dialog.vue.d.ts +38 -0
  119. package/dist/es/components/dialog/index.css +87 -0
  120. package/dist/es/components/dialog/index.d.ts +4 -0
  121. package/dist/es/components/dialog/index.mjs +6 -0
  122. package/dist/es/components/dialog-camera-upload/dialog-camera-upload.d.ts +33 -0
  123. package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +412 -0
  124. package/dist/es/components/dialog-camera-upload/dialog-camera-upload.vue.d.ts +23 -0
  125. package/dist/es/components/dialog-camera-upload/index.css +66 -0
  126. package/dist/es/components/dialog-camera-upload/index.d.ts +4 -0
  127. package/dist/es/components/dialog-camera-upload/index.mjs +6 -0
  128. package/dist/es/components/dialog-map-point/dialog-map-point.d.ts +9 -0
  129. package/dist/es/components/dialog-map-point/dialog-map-point.mjs +183 -0
  130. package/dist/es/components/dialog-map-point/dialog-map-point.vue.d.ts +22 -0
  131. package/dist/es/components/dialog-map-point/index.css +11 -0
  132. package/dist/es/components/dialog-map-point/index.d.ts +4 -0
  133. package/dist/es/components/dialog-map-point/index.mjs +6 -0
  134. package/dist/es/components/dialog-upload-images/dialog-upload-images.d.ts +16 -0
  135. package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +1391 -0
  136. package/dist/es/components/dialog-upload-images/dialog-upload-images.vue.d.ts +19 -0
  137. package/dist/es/components/dialog-upload-images/index.css +62 -0
  138. package/dist/es/components/dialog-upload-images/index.d.ts +4 -0
  139. package/dist/es/components/dialog-upload-images/index.mjs +6 -0
  140. package/dist/es/components/document.vue.d.ts +14 -0
  141. package/dist/es/components/drawer/drawer.d.ts +7 -0
  142. package/dist/es/components/drawer/drawer.mjs +412 -0
  143. package/dist/es/components/drawer/drawer.vue.d.ts +31 -0
  144. package/dist/es/components/drawer/index.css +56 -0
  145. package/dist/es/components/drawer/index.d.ts +4 -0
  146. package/dist/es/components/drawer/index.mjs +6 -0
  147. package/dist/es/components/easy-pagination/easy-pagination.d.ts +8 -0
  148. package/dist/es/components/easy-pagination/easy-pagination.mjs +74 -0
  149. package/dist/es/components/easy-pagination/easy-pagination.vue.d.ts +19 -0
  150. package/dist/es/components/easy-pagination/index.css +10 -0
  151. package/dist/es/components/easy-pagination/index.d.ts +4 -0
  152. package/dist/es/components/easy-pagination/index.mjs +6 -0
  153. package/dist/es/components/el-icon/el-icon.d.ts +6 -0
  154. package/dist/es/components/el-icon/el-icon.mjs +46 -0
  155. package/dist/es/components/el-icon/el-icon.vue.d.ts +6 -0
  156. package/dist/es/components/el-icon/index.css +7 -0
  157. package/dist/es/components/el-icon/index.d.ts +4 -0
  158. package/dist/es/components/el-icon/index.mjs +6 -0
  159. package/dist/es/components/example-wrapper.vue.d.ts +19 -0
  160. package/dist/es/components/flag/flag.mjs +44 -0
  161. package/dist/es/components/flag/flag.vue.d.ts +5 -0
  162. package/dist/es/components/flag/flags.d.ts +8 -0
  163. package/dist/es/components/flag/index.d.ts +4 -0
  164. package/dist/es/components/flag/index.mjs +6 -0
  165. package/dist/es/components/icon/icon.d.ts +6 -0
  166. package/dist/es/components/icon/icon.mjs +54 -0
  167. package/dist/es/components/icon/icon.vue.d.ts +3 -0
  168. package/dist/es/components/icon/icon2.mjs +27 -0
  169. package/dist/es/components/icon/index.css +9 -0
  170. package/dist/es/components/icon/index.d.ts +4 -0
  171. package/dist/es/components/icon/index.mjs +6 -0
  172. package/dist/es/components/image/image.d.ts +16 -0
  173. package/dist/es/components/image/image.mjs +167 -0
  174. package/dist/es/components/image/image.vue.d.ts +206 -0
  175. package/dist/es/components/image/index.css +20 -0
  176. package/dist/es/components/image/index.d.ts +4 -0
  177. package/dist/es/components/image/index.mjs +6 -0
  178. package/dist/es/components/input/index.css +9 -0
  179. package/dist/es/components/input/index.d.ts +4 -0
  180. package/dist/es/components/input/index.mjs +6 -0
  181. package/dist/es/components/input/input.d.ts +4 -0
  182. package/dist/es/components/input/input.mjs +85 -0
  183. package/dist/es/components/input/input.vue.d.ts +1232 -0
  184. package/dist/es/components/input-number/index.css +24 -0
  185. package/dist/es/components/input-number/index.d.ts +4 -0
  186. package/dist/es/components/input-number/index.mjs +6 -0
  187. package/dist/es/components/input-number/input-number.d.ts +8 -0
  188. package/dist/es/components/input-number/input-number.mjs +137 -0
  189. package/dist/es/components/input-number/input-number.vue.d.ts +35 -0
  190. package/dist/es/components/pca-picker/components/c.vue.d.ts +123 -0
  191. package/dist/es/components/pca-picker/components/elevator-item.vue.d.ts +7 -0
  192. package/dist/es/components/pca-picker/components/filter.vue.d.ts +2 -0
  193. package/dist/es/components/pca-picker/components/history.vue.d.ts +2 -0
  194. package/dist/es/components/pca-picker/components/hot.vue.d.ts +2 -0
  195. package/dist/es/components/pca-picker/components/p.vue.d.ts +2 -0
  196. package/dist/es/components/pca-picker/components/pca.vue.d.ts +9 -0
  197. package/dist/es/components/pca-picker/index.css +107 -0
  198. package/dist/es/components/pca-picker/index.d.ts +4 -0
  199. package/dist/es/components/pca-picker/index.mjs +6 -0
  200. package/dist/es/components/pca-picker/pca-picker.d.ts +78 -0
  201. package/dist/es/components/pca-picker/pca-picker.mjs +1667 -0
  202. package/dist/es/components/pca-picker/pca-picker.vue.d.ts +583 -0
  203. package/dist/es/components/qr-code/index.d.ts +4 -0
  204. package/dist/es/components/qr-code/index.mjs +6 -0
  205. package/dist/es/components/qr-code/qr-code.d.ts +9 -0
  206. package/dist/es/components/qr-code/qr-code.mjs +69 -0
  207. package/dist/es/components/qr-code/qr-code.vue.d.ts +13 -0
  208. package/dist/es/components/screenfull/index.css +14 -0
  209. package/dist/es/components/screenfull/index.d.ts +4 -0
  210. package/dist/es/components/screenfull/index.mjs +6 -0
  211. package/dist/es/components/screenfull/screenfull.d.ts +4 -0
  212. package/dist/es/components/screenfull/screenfull.mjs +91 -0
  213. package/dist/es/components/screenfull/screenfull.vue.d.ts +20 -0
  214. package/dist/es/components/select/index.css +9 -0
  215. package/dist/es/components/select/index.d.ts +4 -0
  216. package/dist/es/components/select/index.mjs +6 -0
  217. package/dist/es/components/select/select.d.ts +6 -0
  218. package/dist/es/components/select/select.mjs +63 -0
  219. package/dist/es/components/select/select.vue.d.ts +6 -0
  220. package/dist/es/components/single-player/index.css +45 -0
  221. package/dist/es/components/single-player/index.d.ts +4 -0
  222. package/dist/es/components/single-player/index.mjs +6 -0
  223. package/dist/es/components/single-player/single-player.d.ts +4 -0
  224. package/dist/es/components/single-player/single-player.mjs +1172 -0
  225. package/dist/es/components/single-player/single-player.vue.d.ts +13 -0
  226. package/dist/es/components/svg-icon/index.css +9 -0
  227. package/dist/es/components/svg-icon/index.d.ts +4 -0
  228. package/dist/es/components/svg-icon/index.mjs +6 -0
  229. package/dist/es/components/svg-icon/svg-icon.d.ts +5 -0
  230. package/dist/es/components/svg-icon/svg-icon.mjs +46 -0
  231. package/dist/es/components/svg-icon/svg-icon.vue.d.ts +18 -0
  232. package/dist/es/components/switch/index.css +15 -0
  233. package/dist/es/components/switch/index.d.ts +4 -0
  234. package/dist/es/components/switch/index.mjs +6 -0
  235. package/dist/es/components/switch/switch.d.ts +9 -0
  236. package/dist/es/components/switch/switch.mjs +82 -0
  237. package/dist/es/components/switch/switch.vue.d.ts +14 -0
  238. package/dist/es/components/sync-scroll-container/index.css +82 -0
  239. package/dist/es/components/sync-scroll-container/index.d.ts +4 -0
  240. package/dist/es/components/sync-scroll-container/index.mjs +6 -0
  241. package/dist/es/components/sync-scroll-container/sync-scroll-container.d.ts +6 -0
  242. package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +157 -0
  243. package/dist/es/components/sync-scroll-container/sync-scroll-container.vue.d.ts +36 -0
  244. package/dist/es/components/tags/index.css +17 -0
  245. package/dist/es/components/tags/index.d.ts +4 -0
  246. package/dist/es/components/tags/index.mjs +6 -0
  247. package/dist/es/components/tags/tags.d.ts +9 -0
  248. package/dist/es/components/tags/tags.mjs +296 -0
  249. package/dist/es/components/tags/tags.vue.d.ts +20 -0
  250. package/dist/es/components/text-ellipsis/index.css +15 -0
  251. package/dist/es/components/text-ellipsis/index.d.ts +4 -0
  252. package/dist/es/components/text-ellipsis/index.mjs +6 -0
  253. package/dist/es/components/text-ellipsis/text-ellipsis.d.ts +12 -0
  254. package/dist/es/components/text-ellipsis/text-ellipsis.mjs +137 -0
  255. package/dist/es/components/text-ellipsis/text-ellipsis.vue.d.ts +41 -0
  256. package/dist/es/components/thousand-input/index.css +4 -0
  257. package/dist/es/components/thousand-input/index.d.ts +4 -0
  258. package/dist/es/components/thousand-input/index.mjs +6 -0
  259. package/dist/es/components/thousand-input/thousand-input.d.ts +11 -0
  260. package/dist/es/components/thousand-input/thousand-input.mjs +159 -0
  261. package/dist/es/components/thousand-input/thousand-input.vue.d.ts +2558 -0
  262. package/dist/es/components/tinymce/config.d.ts +25 -0
  263. package/dist/es/components/tinymce/index.css +9 -0
  264. package/dist/es/components/tinymce/index.d.ts +4 -0
  265. package/dist/es/components/tinymce/index.mjs +6 -0
  266. package/dist/es/components/tinymce/tinymce.d.ts +9 -0
  267. package/dist/es/components/tinymce/tinymce.mjs +176 -0
  268. package/dist/es/components/tinymce/tinymce.vue.d.ts +20 -0
  269. package/dist/es/components/tree-picker/components/popover-cascader.d.ts +8 -0
  270. package/dist/es/components/tree-picker/components/popover-cascader.vue.d.ts +1361 -0
  271. package/dist/es/components/tree-picker/docs/data.d.ts +2 -0
  272. package/dist/es/components/tree-picker/index.css +41 -0
  273. package/dist/es/components/tree-picker/index.d.ts +4 -0
  274. package/dist/es/components/tree-picker/index.mjs +6 -0
  275. package/dist/es/components/tree-picker/popover-cascader.css +23 -0
  276. package/dist/es/components/tree-picker/tree-picker.d.ts +14 -0
  277. package/dist/es/components/tree-picker/tree-picker.mjs +173 -0
  278. package/dist/es/components/tree-picker/tree-picker.vue.d.ts +575 -0
  279. package/dist/es/components/upload-file/index.css +30 -0
  280. package/dist/es/components/upload-file/index.d.ts +4 -0
  281. package/dist/es/components/upload-file/index.mjs +6 -0
  282. package/dist/es/components/upload-file/upload-file.d.ts +39 -0
  283. package/dist/es/components/upload-file/upload-file.mjs +202 -0
  284. package/dist/es/components/upload-file/upload-file.vue.d.ts +30 -0
  285. package/dist/es/directives/cleave/index.d.ts +3 -0
  286. package/dist/es/directives/focus/index.d.ts +4 -0
  287. package/dist/es/directives/index.d.ts +3 -0
  288. package/dist/es/directives/thousand/index.d.ts +3 -0
  289. package/dist/es/index.d.ts +42 -0
  290. package/dist/es/index.mjs +122 -0
  291. package/dist/es/use/useSmallScreen/index.d.ts +4 -0
  292. package/dist/es/use/useSmallScreen/index.mjs +10 -0
  293. package/dist/es/use/useStore/index.d.ts +3 -0
  294. package/dist/es/use/useStore/index.mjs +22 -0
  295. package/dist/es/utils/index.d.ts +6 -0
  296. package/dist/es/utils/resolver.d.ts +3 -0
  297. package/dist/es/utils/resolver.mjs +24 -0
  298. package/dist/es/utils/typescript.d.ts +6 -0
  299. package/dist/global.d.ts +42 -0
  300. package/dist/index.css +869 -0
  301. package/package.json +58 -0
@@ -0,0 +1,1667 @@
1
+ import './index.css'
2
+ import { c as buildProps, d as definePropType, u as useNamespace, f as isNumber, s as isObject, h as isString, g as isUndefined, o as isClient, q as isWindow } from '../../chunk/E_WRn0OP.mjs';
3
+ import '../../chunk/DqUIKX7f.mjs';
4
+ /* empty css */
5
+ import { E as ElText, P as PopoverCascader, a as ElCascader } from '../../chunk/BX-Ogf7p.mjs';
6
+ import '../../chunk/Dvi7RsXg.mjs';
7
+ import '../../chunk/CZ4ggqDE.mjs';
8
+ import '../../chunk/D3DXeVfC.mjs';
9
+ import '../../chunk/CaTfZePA.mjs';
10
+ import { defineComponent, inject, computed, createBlock, openBlock, resolveDynamicComponent, normalizeStyle, normalizeClass, unref, withCtx, renderSlot, createElementBlock, createCommentVNode, provide, useSlots, ref, watch, onMounted, createElementVNode, nextTick, onBeforeUnmount, createTextVNode, toDisplayString, shallowRef, toRefs, Fragment, createVNode, renderList, useTemplateRef, mergeProps, isRef, useCssModule } from 'vue';
11
+ import { useInject, useProvide } from '../../use/useStore/index.mjs';
12
+ import { i as injectConfig } from '../config-provider/config-provider2.mjs';
13
+ import { b as useStorage, u as useVModel, o as onClickOutside } from '../../chunk/CD98REcR.mjs';
14
+ import { s as storage } from '../../chunk/BdDihk0t.mjs';
15
+ import { b as baseFlatten } from '../../chunk/C2LgraHx.mjs';
16
+ import { a as arrayMap, b as isArray } from '../../chunk/Spa-JKB4.mjs';
17
+ import { b as baseIteratee } from '../../chunk/BWcCXRRK.mjs';
18
+ import { k as keys, a as isArrayLike } from '../../chunk/-EkpfdcW.mjs';
19
+ import { _ as _export_sfc, w as withInstall, a as withNoopInstall } from '../../chunk/D389hx_T.mjs';
20
+ import { m as mutable } from '../../chunk/B-rxnVJv.mjs';
21
+ import { _ as _export_sfc$1 } from '../../chunk/pcqpp-6-.mjs';
22
+ import { c as useEventListener } from '../../chunk/CEClY-_T.mjs';
23
+ import { c as cAF, r as rAF, a as getScrollElement, b as animateScrollTo, d as getScrollTop } from '../../chunk/DyDMGLoF.mjs';
24
+ import { C as CHANGE_EVENT } from '../../chunk/Ct6q2FXg.mjs';
25
+ import { E as ElPopover } from '../../chunk/C7iSSBUr.mjs';
26
+ import { u as useToggle, a as useThrottleFn } from '../../chunk/qY9OvNHY.mjs';
27
+
28
+ /**
29
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
30
+ *
31
+ * @private
32
+ * @param {boolean} [fromRight] Specify iterating from right to left.
33
+ * @returns {Function} Returns the new base function.
34
+ */
35
+ function createBaseFor(fromRight) {
36
+ return function(object, iteratee, keysFunc) {
37
+ var index = -1,
38
+ iterable = Object(object),
39
+ props = keysFunc(object),
40
+ length = props.length;
41
+
42
+ while (length--) {
43
+ var key = props[++index];
44
+ if (iteratee(iterable[key], key, iterable) === false) {
45
+ break;
46
+ }
47
+ }
48
+ return object;
49
+ };
50
+ }
51
+
52
+ /**
53
+ * The base implementation of `baseForOwn` which iterates over `object`
54
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
55
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
56
+ *
57
+ * @private
58
+ * @param {Object} object The object to iterate over.
59
+ * @param {Function} iteratee The function invoked per iteration.
60
+ * @param {Function} keysFunc The function to get the keys of `object`.
61
+ * @returns {Object} Returns `object`.
62
+ */
63
+ var baseFor = createBaseFor();
64
+
65
+ /**
66
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
67
+ *
68
+ * @private
69
+ * @param {Object} object The object to iterate over.
70
+ * @param {Function} iteratee The function invoked per iteration.
71
+ * @returns {Object} Returns `object`.
72
+ */
73
+ function baseForOwn(object, iteratee) {
74
+ return object && baseFor(object, iteratee, keys);
75
+ }
76
+
77
+ /**
78
+ * Creates a `baseEach` or `baseEachRight` function.
79
+ *
80
+ * @private
81
+ * @param {Function} eachFunc The function to iterate over a collection.
82
+ * @param {boolean} [fromRight] Specify iterating from right to left.
83
+ * @returns {Function} Returns the new base function.
84
+ */
85
+ function createBaseEach(eachFunc, fromRight) {
86
+ return function(collection, iteratee) {
87
+ if (collection == null) {
88
+ return collection;
89
+ }
90
+ if (!isArrayLike(collection)) {
91
+ return eachFunc(collection, iteratee);
92
+ }
93
+ var length = collection.length,
94
+ index = -1,
95
+ iterable = Object(collection);
96
+
97
+ while ((++index < length)) {
98
+ if (iteratee(iterable[index], index, iterable) === false) {
99
+ break;
100
+ }
101
+ }
102
+ return collection;
103
+ };
104
+ }
105
+
106
+ /**
107
+ * The base implementation of `_.forEach` without support for iteratee shorthands.
108
+ *
109
+ * @private
110
+ * @param {Array|Object} collection The collection to iterate over.
111
+ * @param {Function} iteratee The function invoked per iteration.
112
+ * @returns {Array|Object} Returns `collection`.
113
+ */
114
+ var baseEach = createBaseEach(baseForOwn);
115
+
116
+ /**
117
+ * The base implementation of `_.map` without support for iteratee shorthands.
118
+ *
119
+ * @private
120
+ * @param {Array|Object} collection The collection to iterate over.
121
+ * @param {Function} iteratee The function invoked per iteration.
122
+ * @returns {Array} Returns the new mapped array.
123
+ */
124
+ function baseMap(collection, iteratee) {
125
+ var index = -1,
126
+ result = isArrayLike(collection) ? Array(collection.length) : [];
127
+
128
+ baseEach(collection, function(value, key, collection) {
129
+ result[++index] = iteratee(value, key, collection);
130
+ });
131
+ return result;
132
+ }
133
+
134
+ /**
135
+ * Creates an array of values by running each element in `collection` thru
136
+ * `iteratee`. The iteratee is invoked with three arguments:
137
+ * (value, index|key, collection).
138
+ *
139
+ * Many lodash methods are guarded to work as iteratees for methods like
140
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
141
+ *
142
+ * The guarded methods are:
143
+ * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
144
+ * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
145
+ * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
146
+ * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
147
+ *
148
+ * @static
149
+ * @memberOf _
150
+ * @since 0.1.0
151
+ * @category Collection
152
+ * @param {Array|Object} collection The collection to iterate over.
153
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
154
+ * @returns {Array} Returns the new mapped array.
155
+ * @example
156
+ *
157
+ * function square(n) {
158
+ * return n * n;
159
+ * }
160
+ *
161
+ * _.map([4, 8], square);
162
+ * // => [16, 64]
163
+ *
164
+ * _.map({ 'a': 4, 'b': 8 }, square);
165
+ * // => [16, 64] (iteration order is not guaranteed)
166
+ *
167
+ * var users = [
168
+ * { 'user': 'barney' },
169
+ * { 'user': 'fred' }
170
+ * ];
171
+ *
172
+ * // The `_.property` iteratee shorthand.
173
+ * _.map(users, 'user');
174
+ * // => ['barney', 'fred']
175
+ */
176
+ function map(collection, iteratee) {
177
+ var func = isArray(collection) ? arrayMap : baseMap;
178
+ return func(collection, baseIteratee(iteratee));
179
+ }
180
+
181
+ /**
182
+ * Creates a flattened array of values by running each element in `collection`
183
+ * thru `iteratee` and flattening the mapped results. The iteratee is invoked
184
+ * with three arguments: (value, index|key, collection).
185
+ *
186
+ * @static
187
+ * @memberOf _
188
+ * @since 4.0.0
189
+ * @category Collection
190
+ * @param {Array|Object} collection The collection to iterate over.
191
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
192
+ * @returns {Array} Returns the new flattened array.
193
+ * @example
194
+ *
195
+ * function duplicate(n) {
196
+ * return [n, n];
197
+ * }
198
+ *
199
+ * _.flatMap([1, 2], duplicate);
200
+ * // => [1, 1, 2, 2]
201
+ */
202
+ function flatMap(collection, iteratee) {
203
+ return baseFlatten(map(collection, iteratee), 1);
204
+ }
205
+
206
+ /** Used as references for various `Number` constants. */
207
+ var INFINITY = 1 / 0;
208
+
209
+ /**
210
+ * This method is like `_.flatMap` except that it recursively flattens the
211
+ * mapped results.
212
+ *
213
+ * @static
214
+ * @memberOf _
215
+ * @since 4.7.0
216
+ * @category Collection
217
+ * @param {Array|Object} collection The collection to iterate over.
218
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
219
+ * @returns {Array} Returns the new flattened array.
220
+ * @example
221
+ *
222
+ * function duplicate(n) {
223
+ * return [[[n, n]]];
224
+ * }
225
+ *
226
+ * _.flatMapDeep([1, 2], duplicate);
227
+ * // => [1, 1, 2, 2]
228
+ */
229
+ function flatMapDeep(collection, iteratee) {
230
+ return baseFlatten(map(collection, iteratee), INFINITY);
231
+ }
232
+
233
+ const colProps = buildProps({
234
+ tag: {
235
+ type: String,
236
+ default: "div"
237
+ },
238
+ span: {
239
+ type: Number,
240
+ default: 24
241
+ },
242
+ offset: {
243
+ type: Number,
244
+ default: 0
245
+ },
246
+ pull: {
247
+ type: Number,
248
+ default: 0
249
+ },
250
+ push: {
251
+ type: Number,
252
+ default: 0
253
+ },
254
+ xs: {
255
+ type: definePropType([Number, Object]),
256
+ default: () => mutable({})
257
+ },
258
+ sm: {
259
+ type: definePropType([Number, Object]),
260
+ default: () => mutable({})
261
+ },
262
+ md: {
263
+ type: definePropType([Number, Object]),
264
+ default: () => mutable({})
265
+ },
266
+ lg: {
267
+ type: definePropType([Number, Object]),
268
+ default: () => mutable({})
269
+ },
270
+ xl: {
271
+ type: definePropType([Number, Object]),
272
+ default: () => mutable({})
273
+ }
274
+ });
275
+
276
+ const rowContextKey = Symbol("rowContextKey");
277
+
278
+ const __default__$4 = defineComponent({
279
+ name: "ElCol"
280
+ });
281
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
282
+ ...__default__$4,
283
+ props: colProps,
284
+ setup(__props) {
285
+ const props = __props;
286
+ const { gutter } = inject(rowContextKey, { gutter: computed(() => 0) });
287
+ const ns = useNamespace("col");
288
+ const style = computed(() => {
289
+ const styles = {};
290
+ if (gutter.value) {
291
+ styles.paddingLeft = styles.paddingRight = `${gutter.value / 2}px`;
292
+ }
293
+ return styles;
294
+ });
295
+ const colKls = computed(() => {
296
+ const classes = [];
297
+ const pos = ["span", "offset", "pull", "push"];
298
+ pos.forEach((prop) => {
299
+ const size = props[prop];
300
+ if (isNumber(size)) {
301
+ if (prop === "span")
302
+ classes.push(ns.b(`${props[prop]}`));
303
+ else if (size > 0)
304
+ classes.push(ns.b(`${prop}-${props[prop]}`));
305
+ }
306
+ });
307
+ const sizes = ["xs", "sm", "md", "lg", "xl"];
308
+ sizes.forEach((size) => {
309
+ if (isNumber(props[size])) {
310
+ classes.push(ns.b(`${size}-${props[size]}`));
311
+ } else if (isObject(props[size])) {
312
+ Object.entries(props[size]).forEach(([prop, sizeProp]) => {
313
+ classes.push(prop !== "span" ? ns.b(`${size}-${prop}-${sizeProp}`) : ns.b(`${size}-${sizeProp}`));
314
+ });
315
+ }
316
+ });
317
+ if (gutter.value) {
318
+ classes.push(ns.is("guttered"));
319
+ }
320
+ return [ns.b(), classes];
321
+ });
322
+ return (_ctx, _cache) => {
323
+ return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
324
+ class: normalizeClass(unref(colKls)),
325
+ style: normalizeStyle(unref(style))
326
+ }, {
327
+ default: withCtx(() => [
328
+ renderSlot(_ctx.$slots, "default")
329
+ ]),
330
+ _: 3
331
+ }, 8, ["class", "style"]);
332
+ };
333
+ }
334
+ });
335
+ var Col = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "col.vue"]]);
336
+
337
+ const ElCol = withInstall(Col);
338
+
339
+ const getOffsetTop = (el) => {
340
+ let offset = 0;
341
+ let parent = el;
342
+ while (parent) {
343
+ offset += parent.offsetTop;
344
+ parent = parent.offsetParent;
345
+ }
346
+ return offset;
347
+ };
348
+ const getOffsetTopDistance = (el, containerEl) => {
349
+ return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl));
350
+ };
351
+
352
+ const dividerProps = buildProps({
353
+ direction: {
354
+ type: String,
355
+ values: ["horizontal", "vertical"],
356
+ default: "horizontal"
357
+ },
358
+ contentPosition: {
359
+ type: String,
360
+ values: ["left", "center", "right"],
361
+ default: "center"
362
+ },
363
+ borderStyle: {
364
+ type: definePropType(String),
365
+ default: "solid"
366
+ }
367
+ });
368
+
369
+ const __default__$3 = defineComponent({
370
+ name: "ElDivider"
371
+ });
372
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
373
+ ...__default__$3,
374
+ props: dividerProps,
375
+ setup(__props) {
376
+ const props = __props;
377
+ const ns = useNamespace("divider");
378
+ const dividerStyle = computed(() => {
379
+ return ns.cssVar({
380
+ "border-style": props.borderStyle
381
+ });
382
+ });
383
+ return (_ctx, _cache) => {
384
+ return openBlock(), createElementBlock("div", {
385
+ class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.direction)]),
386
+ style: normalizeStyle(unref(dividerStyle)),
387
+ role: "separator"
388
+ }, [
389
+ _ctx.$slots.default && _ctx.direction !== "vertical" ? (openBlock(), createElementBlock("div", {
390
+ key: 0,
391
+ class: normalizeClass([unref(ns).e("text"), unref(ns).is(_ctx.contentPosition)])
392
+ }, [
393
+ renderSlot(_ctx.$slots, "default")
394
+ ], 2)) : createCommentVNode("v-if", true)
395
+ ], 6);
396
+ };
397
+ }
398
+ });
399
+ var Divider = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "divider.vue"]]);
400
+
401
+ const ElDivider = withInstall(Divider);
402
+
403
+ const RowJustify = [
404
+ "start",
405
+ "center",
406
+ "end",
407
+ "space-around",
408
+ "space-between",
409
+ "space-evenly"
410
+ ];
411
+ const RowAlign = ["top", "middle", "bottom"];
412
+ const rowProps = buildProps({
413
+ tag: {
414
+ type: String,
415
+ default: "div"
416
+ },
417
+ gutter: {
418
+ type: Number,
419
+ default: 0
420
+ },
421
+ justify: {
422
+ type: String,
423
+ values: RowJustify,
424
+ default: "start"
425
+ },
426
+ align: {
427
+ type: String,
428
+ values: RowAlign
429
+ }
430
+ });
431
+
432
+ const __default__$2 = defineComponent({
433
+ name: "ElRow"
434
+ });
435
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
436
+ ...__default__$2,
437
+ props: rowProps,
438
+ setup(__props) {
439
+ const props = __props;
440
+ const ns = useNamespace("row");
441
+ const gutter = computed(() => props.gutter);
442
+ provide(rowContextKey, {
443
+ gutter
444
+ });
445
+ const style = computed(() => {
446
+ const styles = {};
447
+ if (!props.gutter) {
448
+ return styles;
449
+ }
450
+ styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
451
+ return styles;
452
+ });
453
+ const rowKls = computed(() => [
454
+ ns.b(),
455
+ ns.is(`justify-${props.justify}`, props.justify !== "start"),
456
+ ns.is(`align-${props.align}`, !!props.align)
457
+ ]);
458
+ return (_ctx, _cache) => {
459
+ return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
460
+ class: normalizeClass(unref(rowKls)),
461
+ style: normalizeStyle(unref(style))
462
+ }, {
463
+ default: withCtx(() => [
464
+ renderSlot(_ctx.$slots, "default")
465
+ ]),
466
+ _: 3
467
+ }, 8, ["class", "style"]);
468
+ };
469
+ }
470
+ });
471
+ var Row = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "row.vue"]]);
472
+
473
+ const ElRow = withInstall(Row);
474
+
475
+ const anchorProps = buildProps({
476
+ container: {
477
+ type: definePropType([
478
+ String,
479
+ Object
480
+ ])
481
+ },
482
+ offset: {
483
+ type: Number,
484
+ default: 0
485
+ },
486
+ bound: {
487
+ type: Number,
488
+ default: 15
489
+ },
490
+ duration: {
491
+ type: Number,
492
+ default: 300
493
+ },
494
+ marker: {
495
+ type: Boolean,
496
+ default: true
497
+ },
498
+ type: {
499
+ type: definePropType(String),
500
+ default: "default"
501
+ },
502
+ direction: {
503
+ type: definePropType(String),
504
+ default: "vertical"
505
+ },
506
+ selectScrollTop: Boolean
507
+ });
508
+ const anchorEmits = {
509
+ change: (href) => isString(href),
510
+ click: (e, href) => e instanceof MouseEvent && (isString(href) || isUndefined(href))
511
+ };
512
+
513
+ const anchorKey = Symbol("anchor");
514
+
515
+ const getElement = (target) => {
516
+ if (!isClient || target === "")
517
+ return null;
518
+ if (isString(target)) {
519
+ try {
520
+ return document.querySelector(target);
521
+ } catch (e) {
522
+ return null;
523
+ }
524
+ }
525
+ return target;
526
+ };
527
+
528
+ function throttleByRaf(cb) {
529
+ let timer = 0;
530
+ const throttle = (...args) => {
531
+ if (timer) {
532
+ cAF(timer);
533
+ }
534
+ timer = rAF(() => {
535
+ cb(...args);
536
+ timer = 0;
537
+ });
538
+ };
539
+ throttle.cancel = () => {
540
+ cAF(timer);
541
+ timer = 0;
542
+ };
543
+ return throttle;
544
+ }
545
+
546
+ const __default__$1 = defineComponent({
547
+ name: "ElAnchor"
548
+ });
549
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
550
+ ...__default__$1,
551
+ props: anchorProps,
552
+ emits: anchorEmits,
553
+ setup(__props, { expose, emit }) {
554
+ const props = __props;
555
+ const slots = useSlots();
556
+ const currentAnchor = ref("");
557
+ const markerStyle = ref({});
558
+ const anchorRef = ref(null);
559
+ const markerRef = ref(null);
560
+ const containerEl = ref();
561
+ const links = {};
562
+ let isScrolling = false;
563
+ let currentScrollTop = 0;
564
+ const ns = useNamespace("anchor");
565
+ const cls = computed(() => [
566
+ ns.b(),
567
+ props.type === "underline" ? ns.m("underline") : "",
568
+ ns.m(props.direction)
569
+ ]);
570
+ const addLink = (state) => {
571
+ links[state.href] = state.el;
572
+ };
573
+ const removeLink = (href) => {
574
+ delete links[href];
575
+ };
576
+ const setCurrentAnchor = (href) => {
577
+ const activeHref = currentAnchor.value;
578
+ if (activeHref !== href) {
579
+ currentAnchor.value = href;
580
+ emit(CHANGE_EVENT, href);
581
+ }
582
+ };
583
+ let clearAnimate = null;
584
+ let currentTargetHref = "";
585
+ const scrollToAnchor = (href) => {
586
+ if (!containerEl.value)
587
+ return;
588
+ const target = getElement(href);
589
+ if (!target)
590
+ return;
591
+ if (clearAnimate) {
592
+ if (currentTargetHref === href)
593
+ return;
594
+ clearAnimate();
595
+ }
596
+ currentTargetHref = href;
597
+ isScrolling = true;
598
+ const scrollEle = getScrollElement(target, containerEl.value);
599
+ const distance = getOffsetTopDistance(target, scrollEle);
600
+ const max = scrollEle.scrollHeight - scrollEle.clientHeight;
601
+ const to = Math.min(distance - props.offset, max);
602
+ clearAnimate = animateScrollTo(containerEl.value, currentScrollTop, to, props.duration, () => {
603
+ setTimeout(() => {
604
+ isScrolling = false;
605
+ currentTargetHref = "";
606
+ }, 20);
607
+ });
608
+ };
609
+ const scrollTo = (href) => {
610
+ if (href) {
611
+ setCurrentAnchor(href);
612
+ scrollToAnchor(href);
613
+ }
614
+ };
615
+ const handleClick = (e, href) => {
616
+ emit("click", e, href);
617
+ scrollTo(href);
618
+ };
619
+ const handleScroll = throttleByRaf(() => {
620
+ if (containerEl.value) {
621
+ currentScrollTop = getScrollTop(containerEl.value);
622
+ }
623
+ const currentHref = getCurrentHref();
624
+ if (isScrolling || isUndefined(currentHref))
625
+ return;
626
+ setCurrentAnchor(currentHref);
627
+ });
628
+ const getCurrentHref = () => {
629
+ if (!containerEl.value)
630
+ return;
631
+ const scrollTop = getScrollTop(containerEl.value);
632
+ const anchorTopList = [];
633
+ for (const href of Object.keys(links)) {
634
+ const target = getElement(href);
635
+ if (!target)
636
+ continue;
637
+ const scrollEle = getScrollElement(target, containerEl.value);
638
+ const distance = getOffsetTopDistance(target, scrollEle);
639
+ anchorTopList.push({
640
+ top: distance - props.offset - props.bound,
641
+ href
642
+ });
643
+ }
644
+ anchorTopList.sort((prev, next) => prev.top - next.top);
645
+ for (let i = 0; i < anchorTopList.length; i++) {
646
+ const item = anchorTopList[i];
647
+ const next = anchorTopList[i + 1];
648
+ if (i === 0 && scrollTop === 0) {
649
+ return props.selectScrollTop ? item.href : "";
650
+ }
651
+ if (item.top <= scrollTop && (!next || next.top > scrollTop)) {
652
+ return item.href;
653
+ }
654
+ }
655
+ };
656
+ const getContainer = () => {
657
+ const el = getElement(props.container);
658
+ if (!el || isWindow(el)) {
659
+ containerEl.value = window;
660
+ } else {
661
+ containerEl.value = el;
662
+ }
663
+ };
664
+ useEventListener(containerEl, "scroll", handleScroll);
665
+ const updateMarkerStyle = () => {
666
+ nextTick(() => {
667
+ if (!anchorRef.value || !markerRef.value || !currentAnchor.value) {
668
+ markerStyle.value = {};
669
+ return;
670
+ }
671
+ const currentLinkEl = links[currentAnchor.value];
672
+ if (!currentLinkEl) {
673
+ markerStyle.value = {};
674
+ return;
675
+ }
676
+ const anchorRect = anchorRef.value.getBoundingClientRect();
677
+ const markerRect = markerRef.value.getBoundingClientRect();
678
+ const linkRect = currentLinkEl.getBoundingClientRect();
679
+ if (props.direction === "horizontal") {
680
+ const left = linkRect.left - anchorRect.left;
681
+ markerStyle.value = {
682
+ left: `${left}px`,
683
+ width: `${linkRect.width}px`,
684
+ opacity: 1
685
+ };
686
+ } else {
687
+ const top = linkRect.top - anchorRect.top + (linkRect.height - markerRect.height) / 2;
688
+ markerStyle.value = {
689
+ top: `${top}px`,
690
+ opacity: 1
691
+ };
692
+ }
693
+ });
694
+ };
695
+ watch(currentAnchor, updateMarkerStyle);
696
+ watch(() => {
697
+ var _a;
698
+ return (_a = slots.default) == null ? void 0 : _a.call(slots);
699
+ }, updateMarkerStyle);
700
+ onMounted(() => {
701
+ getContainer();
702
+ const hash = decodeURIComponent(window.location.hash);
703
+ const target = getElement(hash);
704
+ if (target) {
705
+ scrollTo(hash);
706
+ } else {
707
+ handleScroll();
708
+ }
709
+ });
710
+ watch(() => props.container, () => {
711
+ getContainer();
712
+ });
713
+ provide(anchorKey, {
714
+ ns,
715
+ direction: props.direction,
716
+ currentAnchor,
717
+ addLink,
718
+ removeLink,
719
+ handleClick
720
+ });
721
+ expose({
722
+ scrollTo
723
+ });
724
+ return (_ctx, _cache) => {
725
+ return openBlock(), createElementBlock("div", {
726
+ ref_key: "anchorRef",
727
+ ref: anchorRef,
728
+ class: normalizeClass(unref(cls))
729
+ }, [
730
+ _ctx.marker ? (openBlock(), createElementBlock("div", {
731
+ key: 0,
732
+ ref_key: "markerRef",
733
+ ref: markerRef,
734
+ class: normalizeClass(unref(ns).e("marker")),
735
+ style: normalizeStyle(markerStyle.value)
736
+ }, null, 6)) : createCommentVNode("v-if", true),
737
+ createElementVNode("div", {
738
+ class: normalizeClass(unref(ns).e("list"))
739
+ }, [
740
+ renderSlot(_ctx.$slots, "default")
741
+ ], 2)
742
+ ], 2);
743
+ };
744
+ }
745
+ });
746
+ var Anchor = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "anchor.vue"]]);
747
+
748
+ const anchorLinkProps = buildProps({
749
+ title: String,
750
+ href: String
751
+ });
752
+
753
+ const __default__ = defineComponent({
754
+ name: "ElAnchorLink"
755
+ });
756
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
757
+ ...__default__,
758
+ props: anchorLinkProps,
759
+ setup(__props) {
760
+ const props = __props;
761
+ const linkRef = ref(null);
762
+ const {
763
+ ns,
764
+ direction,
765
+ currentAnchor,
766
+ addLink,
767
+ removeLink,
768
+ handleClick: contextHandleClick
769
+ } = inject(anchorKey);
770
+ const cls = computed(() => [
771
+ ns.e("link"),
772
+ ns.is("active", currentAnchor.value === props.href)
773
+ ]);
774
+ const handleClick = (e) => {
775
+ contextHandleClick(e, props.href);
776
+ };
777
+ watch(() => props.href, (val, oldVal) => {
778
+ nextTick(() => {
779
+ if (oldVal)
780
+ removeLink(oldVal);
781
+ if (val) {
782
+ addLink({
783
+ href: val,
784
+ el: linkRef.value
785
+ });
786
+ }
787
+ });
788
+ });
789
+ onMounted(() => {
790
+ const { href } = props;
791
+ if (href) {
792
+ addLink({
793
+ href,
794
+ el: linkRef.value
795
+ });
796
+ }
797
+ });
798
+ onBeforeUnmount(() => {
799
+ const { href } = props;
800
+ if (href) {
801
+ removeLink(href);
802
+ }
803
+ });
804
+ return (_ctx, _cache) => {
805
+ return openBlock(), createElementBlock("div", {
806
+ class: normalizeClass(unref(ns).e("item"))
807
+ }, [
808
+ createElementVNode("a", {
809
+ ref_key: "linkRef",
810
+ ref: linkRef,
811
+ class: normalizeClass(unref(cls)),
812
+ href: _ctx.href,
813
+ onClick: handleClick
814
+ }, [
815
+ renderSlot(_ctx.$slots, "default", {}, () => [
816
+ createTextVNode(toDisplayString(_ctx.title), 1)
817
+ ])
818
+ ], 10, ["href"]),
819
+ _ctx.$slots["sub-link"] && unref(direction) === "vertical" ? (openBlock(), createElementBlock("div", {
820
+ key: 0,
821
+ class: normalizeClass(unref(ns).e("list"))
822
+ }, [
823
+ renderSlot(_ctx.$slots, "sub-link")
824
+ ], 2)) : createCommentVNode("v-if", true)
825
+ ], 2);
826
+ };
827
+ }
828
+ });
829
+ var AnchorLink = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "anchor-link.vue"]]);
830
+
831
+ const ElAnchor = withInstall(Anchor, {
832
+ AnchorLink
833
+ });
834
+ const ElAnchorLink = withNoopInstall(AnchorLink);
835
+
836
+ function usePCAData(params) {
837
+ const loading = ref(false);
838
+ const myProps = ref(params);
839
+ const storageKey = computed(() => `vc-pca-picker-${myProps.value?.source}`);
840
+ const pcaData = shallowRef([]);
841
+ const keyword = ref("");
842
+ const lastKeyword = ref("");
843
+ const loadFailed = ref(false);
844
+ const setProps = (data) => {
845
+ myProps.value = data;
846
+ };
847
+ const fetchData = async (pcaBaseUrl, crosProxy) => {
848
+ const storageData = storage.get(storageKey.value);
849
+ if (storageData && storageData.length) {
850
+ pcaData.value = storageData;
851
+ return pcaData.value;
852
+ }
853
+ loading.value = true;
854
+ loadFailed.value = false;
855
+ try {
856
+ const sourceUrl = crosProxy ? `${crosProxy}${encodeURIComponent(`${pcaBaseUrl}/${myProps.value.source}.json`)}` : `${pcaBaseUrl}/${myProps.value.source}.json`;
857
+ const res = await fetch(sourceUrl);
858
+ const data = await res.json();
859
+ storage.set(storageKey.value, data);
860
+ pcaData.value = data;
861
+ return data;
862
+ } catch (error) {
863
+ console.error(error);
864
+ loadFailed.value = true;
865
+ return [];
866
+ } finally {
867
+ loading.value = false;
868
+ }
869
+ };
870
+ const availableData = computed(() => {
871
+ if (!myProps.value) {
872
+ return [];
873
+ }
874
+ if (!myProps.value.excludeIds || myProps.value.excludeIds.length === 0) {
875
+ return pcaData.value || [];
876
+ }
877
+ if (myProps.value.type === "P") {
878
+ return pcaData.value?.filter((i) => !myProps.value.excludeIds?.includes(i.id)) || [];
879
+ }
880
+ if (myProps.value.type === "C") {
881
+ const tempData = pcaData.value?.filter((i) => !myProps.value.excludeIds?.includes(i.id)) || [];
882
+ tempData.forEach((i) => {
883
+ i.childs = i.childs?.filter((j) => !myProps.value.excludeIds?.includes(j.id)) || [];
884
+ });
885
+ return tempData;
886
+ }
887
+ if (myProps.value.type === "PC") {
888
+ const tempData = pcaData.value?.filter((i) => !myProps.value.excludeIds?.includes(i.id)) || [];
889
+ tempData.forEach((i) => {
890
+ i.childs = i.childs?.filter((j) => !myProps.value.excludeIds?.includes(j.id)) || [];
891
+ i.childs.forEach((k) => {
892
+ delete k.childs;
893
+ });
894
+ });
895
+ return tempData;
896
+ }
897
+ if (myProps.value.type === "PCA") {
898
+ const tempData = pcaData.value?.filter((i) => !myProps.value.excludeIds?.includes(i.id)) || [];
899
+ tempData.forEach((i) => {
900
+ i.childs = i.childs?.filter((j) => !myProps.value.excludeIds?.includes(j.id)) || [];
901
+ i.childs.forEach((k) => {
902
+ k.childs = k.childs?.filter((l) => !myProps.value.excludeIds?.includes(l.id)) || [];
903
+ });
904
+ });
905
+ return tempData;
906
+ }
907
+ return [];
908
+ });
909
+ const flatData = computed(() => {
910
+ if (!myProps.value) {
911
+ return [];
912
+ }
913
+ let tempData = [];
914
+ if (myProps.value.type === "P") {
915
+ tempData = availableData.value;
916
+ }
917
+ if (myProps.value.type === "C") {
918
+ tempData = flatMap(availableData.value, (i) => i.childs || []);
919
+ }
920
+ if (myProps.value.type === "PCA" || myProps.value.type === "PC") {
921
+ tempData = flatMapDeep(availableData.value, function traverse(node) {
922
+ if (!node.childs || node.childs.length === 0) {
923
+ return [node];
924
+ }
925
+ return node.childs.map(traverse);
926
+ });
927
+ }
928
+ return tempData;
929
+ });
930
+ const fpyGroup = ["A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "W", "X", "Y", "Z"];
931
+ const fpyGroupData = computed(() => {
932
+ if (myProps.value.type === "C") {
933
+ return fpyGroup.map((i) => ({
934
+ label: i,
935
+ childs: flatData.value.filter((j) => j.fpy && i.includes(j.fpy)) || []
936
+ }));
937
+ }
938
+ return [];
939
+ });
940
+ const getValueData = (values) => flatData.value.filter((i) => (Array.isArray(values) ? values : []).includes(i.id)) || [];
941
+ const optionData = computed(() => {
942
+ if (!myProps.value || !flatData.value || flatData.value.length === 0) {
943
+ return [];
944
+ }
945
+ if (myProps.value.type === "PCA" || myProps.value.type === "PC") {
946
+ return availableData.value;
947
+ }
948
+ return flatData.value;
949
+ });
950
+ const filterData = computed(() => {
951
+ if (keyword.value) {
952
+ const result = flatData.value.filter((i) => i.n.includes(keyword.value) || i.fn?.includes(keyword.value) || i.py?.includes(keyword.value));
953
+ return result.slice(0, 48);
954
+ }
955
+ if (lastKeyword.value) {
956
+ const result = flatData.value.filter((i) => i.n.includes(lastKeyword.value) || i.fn?.includes(lastKeyword.value) || i.py?.includes(lastKeyword.value));
957
+ return result.slice(0, 48);
958
+ }
959
+ return [];
960
+ });
961
+ const hasHot = computed(() => Array.isArray(myProps.value?.hotIds) && myProps.value?.hotIds.length > 0);
962
+ const hotData = computed(() => {
963
+ if (!myProps.value?.hotIds || myProps.value?.hotIds.length === 0) {
964
+ return [];
965
+ }
966
+ return flatData.value?.filter((i) => myProps.value?.hotIds?.includes(i.id)) || [];
967
+ });
968
+ const historyStorageKey = `vc-pca-history-${myProps.value?.type.toLowerCase()}`;
969
+ const historyIds = useStorage(myProps.value?.historyStorageKey || historyStorageKey, []);
970
+ const historyData = computed(() => {
971
+ if (!myProps.value.history || !historyIds.value || historyIds.value.length === 0) {
972
+ return [];
973
+ }
974
+ const data = [];
975
+ historyIds.value.forEach((id) => {
976
+ const item = flatData.value?.find((i) => i.id === id);
977
+ item && data.push(item);
978
+ });
979
+ return data;
980
+ });
981
+ const appendToHistory = (id) => {
982
+ if (!myProps.value.history) {
983
+ return;
984
+ }
985
+ if (!myProps.value.historyMax) {
986
+ return;
987
+ }
988
+ const ids = historyIds.value || [];
989
+ const index = ids.indexOf(id);
990
+ if (index > -1) {
991
+ ids.splice(index, 1);
992
+ }
993
+ ids.unshift(id);
994
+ if (ids.length > myProps.value.historyMax) {
995
+ ids.splice(myProps.value.historyMax);
996
+ }
997
+ historyIds.value = ids;
998
+ };
999
+ return {
1000
+ fetchData,
1001
+ loading,
1002
+ loadFailed,
1003
+ filterData,
1004
+ flatData,
1005
+ keyword,
1006
+ lastKeyword,
1007
+ availableData,
1008
+ optionData,
1009
+ setProps,
1010
+ hasHot,
1011
+ hotData,
1012
+ historyData,
1013
+ appendToHistory,
1014
+ getValueData,
1015
+ fpyGroupData
1016
+ };
1017
+ }
1018
+ const KEY_NAME = Symbol("VcPCA");
1019
+ const injectCommonState = () => useInject(KEY_NAME);
1020
+
1021
+ const _hoisted_1$5 = ["id"];
1022
+ const _hoisted_2$3 = ["onClick"];
1023
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1024
+ __name: "elevator-item",
1025
+ props: {
1026
+ label: {},
1027
+ data: {}
1028
+ },
1029
+ setup(__props) {
1030
+ const { props: commonProps, itemClass, clickItem } = injectCommonState();
1031
+ const { nameKey } = toRefs(commonProps);
1032
+ return (_ctx, _cache) => {
1033
+ const _component_ElCol = ElCol;
1034
+ const _component_ElRow = ElRow;
1035
+ return openBlock(), createElementBlock(Fragment, null, [
1036
+ createElementVNode("div", {
1037
+ id: __props.label,
1038
+ class: normalizeClass(_ctx.$style.label)
1039
+ }, toDisplayString(__props.label), 11, _hoisted_1$5),
1040
+ createVNode(_component_ElRow, {
1041
+ gutter: 8,
1042
+ class: normalizeClass(["vc-pca-container", _ctx.$style["pca-container"]])
1043
+ }, {
1044
+ default: withCtx(() => [
1045
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.data, (item) => {
1046
+ return openBlock(), createBlock(_component_ElCol, {
1047
+ key: item.id,
1048
+ span: 4
1049
+ }, {
1050
+ default: withCtx(() => [
1051
+ createElementVNode("div", {
1052
+ class: normalizeClass(unref(itemClass)(item)),
1053
+ onClick: ($event) => unref(clickItem)(item)
1054
+ }, toDisplayString(item[unref(nameKey)]), 11, _hoisted_2$3)
1055
+ ]),
1056
+ _: 2
1057
+ }, 1024);
1058
+ }), 128))
1059
+ ]),
1060
+ _: 1
1061
+ }, 8, ["class"])
1062
+ ], 64);
1063
+ };
1064
+ }
1065
+ });
1066
+
1067
+ /* unplugin-vue-components disabled */const label = "_label_1xb4h_1";
1068
+ const style0$2 = {
1069
+ label: label,
1070
+ "pca-container": "_pca-container_1xb4h_5"
1071
+ };
1072
+
1073
+ const cssModules$2 = {
1074
+ "$style": style0$2
1075
+ };
1076
+ const ElevatorItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["__cssModules", cssModules$2]]);
1077
+
1078
+ const _hoisted_1$4 = { key: 0 };
1079
+ const _hoisted_2$2 = { key: 1 };
1080
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1081
+ __name: "c",
1082
+ setup(__props) {
1083
+ const { props: commonProps, fpyGroupData, flatData, popoverVisible, hasHot, hotData, historyData } = injectCommonState();
1084
+ const { history, historyText, hotText } = toRefs(commonProps);
1085
+ const wrapperRef = useTemplateRef("wrapperRef");
1086
+ const anchorRef = useTemplateRef("anchorRef");
1087
+ watch(fpyGroupData, () => {
1088
+ const tagsA = wrapperRef.value?.getElementsByTagName("a");
1089
+ if (!tagsA) {
1090
+ return;
1091
+ }
1092
+ const firstHref = tagsA[0].hash;
1093
+ for (let i = 0; i < tagsA.length; i++) {
1094
+ tagsA[i].setAttribute("href", "javascript:void(0)");
1095
+ }
1096
+ anchorRef.value?.scrollTo(firstHref);
1097
+ });
1098
+ watch(popoverVisible, () => {
1099
+ if (!popoverVisible.value) {
1100
+ return;
1101
+ }
1102
+ if (!commonProps.modelValue || Array.isArray(commonProps.modelValue) && commonProps.modelValue.length === 0) {
1103
+ return;
1104
+ }
1105
+ let firstItem;
1106
+ if (commonProps.multiple && Array.isArray(commonProps.modelValue)) {
1107
+ firstItem = flatData.value.find((item) => commonProps.modelValue.includes(item.id));
1108
+ } else {
1109
+ firstItem = flatData.value.find((item) => item.id === commonProps.modelValue);
1110
+ }
1111
+ if (firstItem) {
1112
+ setTimeout(() => anchorRef.value?.scrollTo(`#${firstItem?.fpy}`), 0);
1113
+ }
1114
+ });
1115
+ return (_ctx, _cache) => {
1116
+ const _component_ElAnchorLink = ElAnchorLink;
1117
+ const _component_ElAnchor = ElAnchor;
1118
+ return openBlock(), createElementBlock("div", {
1119
+ ref_key: "wrapperRef",
1120
+ ref: wrapperRef,
1121
+ class: "vc-pca-wrapper"
1122
+ }, [
1123
+ createElementVNode("div", {
1124
+ class: normalizeClass(_ctx.$style.elevator)
1125
+ }, [
1126
+ createVNode(_component_ElAnchor, {
1127
+ ref_key: "anchorRef",
1128
+ ref: anchorRef,
1129
+ "select-scroll-top": "",
1130
+ container: unref(wrapperRef),
1131
+ bound: 40
1132
+ }, {
1133
+ default: withCtx(() => [
1134
+ unref(history) && unref(historyData).length ? (openBlock(), createBlock(_component_ElAnchorLink, {
1135
+ key: 0,
1136
+ href: `#${unref(historyText)}`
1137
+ }, {
1138
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
1139
+ createTextVNode("历史", -1)
1140
+ ])]),
1141
+ _: 1
1142
+ }, 8, ["href"])) : createCommentVNode("", true),
1143
+ unref(hasHot) ? (openBlock(), createBlock(_component_ElAnchorLink, {
1144
+ key: 1,
1145
+ href: `#${unref(hotText)}`
1146
+ }, {
1147
+ default: withCtx(() => [
1148
+ createTextVNode(toDisplayString(unref(hotText)), 1)
1149
+ ]),
1150
+ _: 1
1151
+ }, 8, ["href"])) : createCommentVNode("", true),
1152
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(fpyGroupData), (group) => {
1153
+ return openBlock(), createBlock(_component_ElAnchorLink, {
1154
+ key: group.label,
1155
+ href: `#${group.label}`
1156
+ }, {
1157
+ default: withCtx(() => [
1158
+ createTextVNode(toDisplayString(group.label), 1)
1159
+ ]),
1160
+ _: 2
1161
+ }, 1032, ["href"]);
1162
+ }), 128))
1163
+ ]),
1164
+ _: 1
1165
+ }, 8, ["container"])
1166
+ ], 2),
1167
+ unref(history) && unref(historyData).length ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
1168
+ createVNode(ElevatorItem, {
1169
+ label: unref(historyText),
1170
+ data: unref(historyData)
1171
+ }, null, 8, ["label", "data"])
1172
+ ])) : createCommentVNode("", true),
1173
+ unref(hasHot) ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
1174
+ createVNode(ElevatorItem, {
1175
+ label: unref(hotText),
1176
+ data: unref(hotData)
1177
+ }, null, 8, ["label", "data"])
1178
+ ])) : createCommentVNode("", true),
1179
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(fpyGroupData), (group) => {
1180
+ return openBlock(), createElementBlock("div", {
1181
+ key: group.label
1182
+ }, [
1183
+ createVNode(ElevatorItem, {
1184
+ label: group.label,
1185
+ data: group.childs
1186
+ }, null, 8, ["label", "data"])
1187
+ ]);
1188
+ }), 128))
1189
+ ], 512);
1190
+ };
1191
+ }
1192
+ });
1193
+
1194
+ /* unplugin-vue-components disabled */const elevator = "_elevator_1cwqs_1";
1195
+ const style0$1 = {
1196
+ elevator: elevator
1197
+ };
1198
+
1199
+ const cssModules$1 = {
1200
+ "$style": style0$1
1201
+ };
1202
+ const CPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["__cssModules", cssModules$1]]);
1203
+
1204
+ const _hoisted_1$3 = { class: "vc-pca-wrapper" };
1205
+ const _hoisted_2$1 = ["onClick"];
1206
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1207
+ __name: "filter",
1208
+ setup(__props) {
1209
+ const { props: commonProps, filterData, itemClass, clickItem, keyword, lastKeyword, updatePopper } = injectCommonState();
1210
+ const { nameKey } = toRefs(commonProps);
1211
+ onMounted(() => updatePopper());
1212
+ return (_ctx, _cache) => {
1213
+ const _component_ElText = ElText;
1214
+ const _component_ElDivider = ElDivider;
1215
+ const _component_ElCol = ElCol;
1216
+ const _component_ElRow = ElRow;
1217
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
1218
+ createVNode(_component_ElDivider, { "content-position": "center" }, {
1219
+ default: withCtx(() => [
1220
+ createVNode(_component_ElText, null, {
1221
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
1222
+ createTextVNode("搜索 ", -1)
1223
+ ])]),
1224
+ _: 1
1225
+ }),
1226
+ createVNode(_component_ElText, { type: "primary" }, {
1227
+ default: withCtx(() => [
1228
+ createTextVNode(toDisplayString(unref(keyword) || unref(lastKeyword)), 1)
1229
+ ]),
1230
+ _: 1
1231
+ })
1232
+ ]),
1233
+ _: 1
1234
+ }),
1235
+ createVNode(_component_ElRow, {
1236
+ gutter: 8,
1237
+ class: "vc-pca-container"
1238
+ }, {
1239
+ default: withCtx(() => [
1240
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filterData), (item) => {
1241
+ return openBlock(), createBlock(_component_ElCol, {
1242
+ key: item.id,
1243
+ span: 4
1244
+ }, {
1245
+ default: withCtx(() => [
1246
+ createElementVNode("div", {
1247
+ class: normalizeClass(unref(itemClass)(item)),
1248
+ onClick: ($event) => unref(clickItem)(item)
1249
+ }, toDisplayString(item[unref(nameKey)]), 11, _hoisted_2$1)
1250
+ ]),
1251
+ _: 2
1252
+ }, 1024);
1253
+ }), 128))
1254
+ ]),
1255
+ _: 1
1256
+ })
1257
+ ]);
1258
+ };
1259
+ }
1260
+ });
1261
+
1262
+ const _hoisted_1$2 = ["onClick"];
1263
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1264
+ __name: "history",
1265
+ setup(__props) {
1266
+ const { props: commonProps, historyData, itemClass, clickItem } = injectCommonState();
1267
+ const { nameKey, history, historyText } = toRefs(commonProps);
1268
+ return (_ctx, _cache) => {
1269
+ const _component_ElDivider = ElDivider;
1270
+ const _component_ElCol = ElCol;
1271
+ const _component_ElRow = ElRow;
1272
+ return openBlock(), createElementBlock(Fragment, null, [
1273
+ unref(history) && unref(historyData).length ? (openBlock(), createBlock(_component_ElDivider, {
1274
+ key: 0,
1275
+ "content-position": "left"
1276
+ }, {
1277
+ default: withCtx(() => [
1278
+ createTextVNode(toDisplayString(unref(historyText)), 1)
1279
+ ]),
1280
+ _: 1
1281
+ })) : createCommentVNode("", true),
1282
+ unref(history) && unref(historyData).length ? (openBlock(), createBlock(_component_ElRow, {
1283
+ key: 1,
1284
+ gutter: 8,
1285
+ class: "vc-pca-container"
1286
+ }, {
1287
+ default: withCtx(() => [
1288
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(historyData), (item) => {
1289
+ return openBlock(), createBlock(_component_ElCol, {
1290
+ key: item.id,
1291
+ span: 4
1292
+ }, {
1293
+ default: withCtx(() => [
1294
+ createElementVNode("div", {
1295
+ class: normalizeClass(unref(itemClass)(item, true)),
1296
+ onClick: ($event) => unref(clickItem)(item)
1297
+ }, toDisplayString(item[unref(nameKey)]), 11, _hoisted_1$2)
1298
+ ]),
1299
+ _: 2
1300
+ }, 1024);
1301
+ }), 128))
1302
+ ]),
1303
+ _: 1
1304
+ })) : createCommentVNode("", true)
1305
+ ], 64);
1306
+ };
1307
+ }
1308
+ });
1309
+
1310
+ const _hoisted_1$1 = ["onClick"];
1311
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1312
+ __name: "hot",
1313
+ setup(__props) {
1314
+ const { props: commonProps, itemClass, hasHot, hotData, clickItem } = injectCommonState();
1315
+ return (_ctx, _cache) => {
1316
+ const _component_ElDivider = ElDivider;
1317
+ const _component_ElCol = ElCol;
1318
+ const _component_ElRow = ElRow;
1319
+ return openBlock(), createElementBlock(Fragment, null, [
1320
+ unref(hasHot) ? (openBlock(), createBlock(_component_ElDivider, {
1321
+ key: 0,
1322
+ "content-position": "left"
1323
+ }, {
1324
+ default: withCtx(() => [
1325
+ createTextVNode(toDisplayString(unref(commonProps).hotText), 1)
1326
+ ]),
1327
+ _: 1
1328
+ })) : createCommentVNode("", true),
1329
+ unref(hasHot) ? (openBlock(), createBlock(_component_ElRow, {
1330
+ key: 1,
1331
+ gutter: 8,
1332
+ class: "vc-pca-container"
1333
+ }, {
1334
+ default: withCtx(() => [
1335
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(hotData), (item) => {
1336
+ return openBlock(), createBlock(_component_ElCol, {
1337
+ key: item.id,
1338
+ span: 4
1339
+ }, {
1340
+ default: withCtx(() => [
1341
+ createElementVNode("div", {
1342
+ class: normalizeClass(unref(itemClass)(item, true)),
1343
+ onClick: ($event) => unref(clickItem)(item)
1344
+ }, toDisplayString(item[unref(commonProps).nameKey]), 11, _hoisted_1$1)
1345
+ ]),
1346
+ _: 2
1347
+ }, 1024);
1348
+ }), 128))
1349
+ ]),
1350
+ _: 1
1351
+ })) : createCommentVNode("", true)
1352
+ ], 64);
1353
+ };
1354
+ }
1355
+ });
1356
+
1357
+ const _hoisted_1 = { class: "vc-pca-wrapper" };
1358
+ const _hoisted_2 = ["onClick"];
1359
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1360
+ __name: "p",
1361
+ setup(__props) {
1362
+ const { props: commonProps, availableData, itemClass, clickItem } = injectCommonState();
1363
+ const { nameKey } = commonProps;
1364
+ return (_ctx, _cache) => {
1365
+ const _component_ElDivider = ElDivider;
1366
+ const _component_ElCol = ElCol;
1367
+ const _component_ElRow = ElRow;
1368
+ return openBlock(), createElementBlock("div", _hoisted_1, [
1369
+ createVNode(_sfc_main$4),
1370
+ createVNode(_sfc_main$3),
1371
+ createVNode(_component_ElDivider, { "content-position": "left" }, {
1372
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
1373
+ createTextVNode("全部", -1)
1374
+ ])]),
1375
+ _: 1
1376
+ }),
1377
+ createVNode(_component_ElRow, {
1378
+ gutter: 8,
1379
+ class: "vc-pca-container"
1380
+ }, {
1381
+ default: withCtx(() => [
1382
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(availableData), (item) => {
1383
+ return openBlock(), createBlock(_component_ElCol, {
1384
+ key: item.id,
1385
+ span: 4
1386
+ }, {
1387
+ default: withCtx(() => [
1388
+ createElementVNode("div", {
1389
+ class: normalizeClass(unref(itemClass)(item)),
1390
+ onClick: ($event) => unref(clickItem)(item)
1391
+ }, toDisplayString(item[unref(nameKey)]), 11, _hoisted_2)
1392
+ ]),
1393
+ _: 2
1394
+ }, 1024);
1395
+ }), 128))
1396
+ ]),
1397
+ _: 1
1398
+ })
1399
+ ]);
1400
+ };
1401
+ }
1402
+ });
1403
+
1404
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1405
+ __name: "pca",
1406
+ props: {
1407
+ modelValue: {}
1408
+ },
1409
+ emits: ["update:modelValue"],
1410
+ setup(__props, { emit: __emit }) {
1411
+ const props = __props;
1412
+ const emits = __emit;
1413
+ const { props: commonProps, optionData, updatePopper, togglePopoverVisible, clickItems } = injectCommonState();
1414
+ const { nameKey, multiple, props: cascaderPropsFromCommon } = toRefs(commonProps);
1415
+ const cascaderProps = computed(() => ({
1416
+ ...cascaderPropsFromCommon.value,
1417
+ label: nameKey.value,
1418
+ value: "id",
1419
+ children: "childs",
1420
+ multiple: multiple.value
1421
+ }));
1422
+ const myValue = useVModel(props, "modelValue", emits);
1423
+ function handleChange(value, node) {
1424
+ if (node && node.length) {
1425
+ const item = node.map((n) => n.data);
1426
+ clickItems(item);
1427
+ }
1428
+ }
1429
+ onMounted(() => updatePopper());
1430
+ return (_ctx, _cache) => {
1431
+ return openBlock(), createBlock(PopoverCascader, mergeProps({
1432
+ modelValue: unref(myValue),
1433
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(myValue) ? myValue.value = $event : null),
1434
+ options: unref(optionData),
1435
+ props: unref(cascaderProps)
1436
+ }, _ctx.$attrs, {
1437
+ multiple: unref(multiple),
1438
+ onExpandChange: unref(updatePopper),
1439
+ onChoiced: _cache[1] || (_cache[1] = ($event) => unref(togglePopoverVisible)(false)),
1440
+ onChange: handleChange
1441
+ }), null, 16, ["modelValue", "options", "props", "multiple", "onExpandChange"]);
1442
+ };
1443
+ }
1444
+ });
1445
+
1446
+ const _sfc_main = /* @__PURE__ */ defineComponent({
1447
+ __name: "pca-picker",
1448
+ props: {
1449
+ source: {},
1450
+ type: {},
1451
+ hotIds: {},
1452
+ hotText: { default: "热门" },
1453
+ history: { type: Boolean },
1454
+ historyText: { default: "历史选择" },
1455
+ historyMax: { default: 6 },
1456
+ historyStorageKey: {},
1457
+ excludeIds: { default: () => [71, 81, 82] },
1458
+ nameKey: { default: "n" },
1459
+ modelValue: {},
1460
+ disabled: { type: Boolean, default: false },
1461
+ multiple: { type: Boolean },
1462
+ placeholder: { default: "请选择" },
1463
+ loadingText: { default: "加载数据源中..." },
1464
+ loadFailedText: { default: "数据源加载失败" },
1465
+ activeMark: { type: Boolean, default: true },
1466
+ syncActive: { type: Boolean, default: false },
1467
+ limit: {},
1468
+ props: {}
1469
+ },
1470
+ emits: ["update:modelValue", "change", "limit"],
1471
+ setup(__props, { expose: __expose, emit: __emit }) {
1472
+ const props = __props;
1473
+ const emits = __emit;
1474
+ const myValue = useVModel(props, "modelValue", emits);
1475
+ const { pcaBaseUrl, crosProxy } = injectConfig();
1476
+ const [popoverVisible, togglePopoverVisible] = useToggle();
1477
+ const $style = useCssModule();
1478
+ const pcaFetchData = usePCAData(props);
1479
+ const { loading, loadFailed, fetchData, setProps, keyword, lastKeyword, optionData, appendToHistory, getValueData } = pcaFetchData;
1480
+ const filterManualVisible = ref(false);
1481
+ const isTreeType = computed(() => ["PCA", "PC"].includes(props.type));
1482
+ const myPlaceholder = computed(() => loadFailed.value ? props.loadFailedText : loading.value ? props.loadingText : props.placeholder);
1483
+ const popoverRef = useTemplateRef("popoverRef");
1484
+ function updatePopper() {
1485
+ return nextTick(() => {
1486
+ popoverRef.value.popperRef.popperInstanceRef?.update();
1487
+ });
1488
+ }
1489
+ const cascaderProps = computed(() => ({
1490
+ value: "id",
1491
+ label: props.nameKey,
1492
+ children: isTreeType.value ? "childs" : "undefined",
1493
+ multiple: props.multiple,
1494
+ emitPath: false
1495
+ }));
1496
+ const containerRef = useTemplateRef("containerRef");
1497
+ onClickOutside(containerRef, (event) => {
1498
+ let target = event.target;
1499
+ let result = false;
1500
+ do {
1501
+ result = target.classList ? target.classList.contains($style.cascader) : false;
1502
+ target = target.parentNode;
1503
+ } while (result === false && target !== null && target.nodeName !== "BODY");
1504
+ if (!result) {
1505
+ if (keyword.value) {
1506
+ filterManualVisible.value = true;
1507
+ lastKeyword.value = keyword.value;
1508
+ setTimeout(() => {
1509
+ filterManualVisible.value = false;
1510
+ lastKeyword.value = "";
1511
+ }, 500);
1512
+ }
1513
+ togglePopoverVisible(false);
1514
+ }
1515
+ });
1516
+ const selectClassName = computed(() => ({ [$style["is-active"]]: popoverVisible.value }));
1517
+ const handleSelectClick = useThrottleFn(() => !loading.value && !props.disabled && togglePopoverVisible(), 300);
1518
+ function handleKeyup(event) {
1519
+ keyword.value = event.target.value;
1520
+ }
1521
+ function handleChange(item) {
1522
+ const changeData = Array.isArray(item) ? item : item[0];
1523
+ emits("change", changeData);
1524
+ if (!props.multiple) {
1525
+ togglePopoverVisible(false);
1526
+ }
1527
+ setTimeout(() => keyword.value = "", 300);
1528
+ }
1529
+ function clear() {
1530
+ togglePopoverVisible(false);
1531
+ emits("change", void 0);
1532
+ }
1533
+ useProvide(KEY_NAME, {
1534
+ props,
1535
+ ...pcaFetchData,
1536
+ popoverVisible,
1537
+ togglePopoverVisible,
1538
+ itemClass: (item, isHistoryOrHot) => {
1539
+ const isActive = myValue.value === item.id || Array.isArray(myValue.value) && myValue.value.includes(item.id);
1540
+ return {
1541
+ "vc-pca-item": true,
1542
+ "active": isActive && (!isHistoryOrHot || props.syncActive),
1543
+ "active-mark": isActive && props.activeMark
1544
+ };
1545
+ },
1546
+ clickItem: (item) => {
1547
+ if (props.multiple) {
1548
+ const val = Array.isArray(myValue.value) ? [...myValue.value] : [];
1549
+ const index = val.indexOf(item.id);
1550
+ if (index > -1) {
1551
+ val.splice(index, 1);
1552
+ } else {
1553
+ if (props.limit && !isTreeType.value && val.length >= props.limit) {
1554
+ emits("limit", props.limit, item);
1555
+ return;
1556
+ }
1557
+ appendToHistory(item.id);
1558
+ val.push(item.id);
1559
+ }
1560
+ myValue.value = val;
1561
+ handleChange(getValueData(val));
1562
+ } else {
1563
+ appendToHistory(item.id);
1564
+ myValue.value = item.id;
1565
+ handleChange(item);
1566
+ }
1567
+ },
1568
+ // 级联选择时的多选使用这个函数,myValue更新由于使用了v-model,所以不需要手动更新
1569
+ // 这里仅执行@change事件
1570
+ clickItems: (items) => {
1571
+ handleChange(items);
1572
+ },
1573
+ updatePopper
1574
+ });
1575
+ const propsWatch = watch(() => props, (newProps) => {
1576
+ setProps(newProps);
1577
+ }, { deep: true });
1578
+ const popoverWatch = watch(popoverVisible, () => keyword.value = "");
1579
+ __expose({ getValueData });
1580
+ onMounted(async () => {
1581
+ setProps(props);
1582
+ await fetchData(pcaBaseUrl || "", crosProxy);
1583
+ });
1584
+ onBeforeUnmount(() => {
1585
+ propsWatch.stop();
1586
+ popoverWatch.stop();
1587
+ });
1588
+ return (_ctx, _cache) => {
1589
+ const _component_ElCascader = ElCascader;
1590
+ const _component_ElPopover = ElPopover;
1591
+ return openBlock(), createBlock(_component_ElPopover, {
1592
+ ref_key: "popoverRef",
1593
+ ref: popoverRef,
1594
+ visible: unref(popoverVisible),
1595
+ placement: "bottom",
1596
+ "popper-class": unref($style).popover
1597
+ }, {
1598
+ reference: withCtx(() => [
1599
+ createElementVNode("div", {
1600
+ class: normalizeClass(unref($style).wrapper),
1601
+ onClickCapture: _cache[2] || (_cache[2] = //@ts-ignore
1602
+ (...args) => unref(handleSelectClick) && unref(handleSelectClick)(...args)),
1603
+ onKeyup: handleKeyup
1604
+ }, [
1605
+ createVNode(_component_ElCascader, mergeProps({
1606
+ modelValue: unref(myValue),
1607
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(myValue) ? myValue.value = $event : null),
1608
+ placeholder: unref(myPlaceholder),
1609
+ "collapse-tags": "",
1610
+ "collapse-tags-tooltip": "",
1611
+ clearable: "",
1612
+ disabled: unref(loading) || __props.disabled || unref(loadFailed),
1613
+ loading: unref(loading),
1614
+ options: unref(optionData),
1615
+ props: unref(cascaderProps),
1616
+ class: [unref(selectClassName), unref($style).cascader],
1617
+ "popper-class": unref($style)["popover-select"],
1618
+ "before-filter": () => false
1619
+ }, _ctx.$attrs, { onClear: clear }), null, 16, ["modelValue", "placeholder", "disabled", "loading", "options", "props", "class", "popper-class"])
1620
+ ], 34)
1621
+ ]),
1622
+ default: withCtx(() => [
1623
+ createElementVNode("div", {
1624
+ ref_key: "containerRef",
1625
+ ref: containerRef,
1626
+ class: normalizeClass(unref($style).container)
1627
+ }, [
1628
+ unref(filterManualVisible) || unref(keyword) ? (openBlock(), createBlock(_sfc_main$5, { key: 0 })) : createCommentVNode("", true),
1629
+ !unref(filterManualVisible) && !unref(keyword) && __props.type === "P" ? (openBlock(), createBlock(_sfc_main$2, { key: 1 })) : createCommentVNode("", true),
1630
+ !unref(filterManualVisible) && !unref(keyword) && __props.type === "C" ? (openBlock(), createBlock(CPicker, { key: 2 })) : createCommentVNode("", true),
1631
+ !unref(filterManualVisible) && !unref(keyword) && ["PCA", "PC"].includes(__props.type) ? (openBlock(), createBlock(_sfc_main$1, {
1632
+ key: 3,
1633
+ modelValue: unref(myValue),
1634
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(myValue) ? myValue.value = $event : null)
1635
+ }, null, 8, ["modelValue"])) : createCommentVNode("", true)
1636
+ ], 2)
1637
+ ]),
1638
+ _: 1
1639
+ }, 8, ["visible", "popper-class"]);
1640
+ };
1641
+ }
1642
+ });
1643
+
1644
+ /* unplugin-vue-components disabled */const popover = "_popover_gvtb9_1";
1645
+ const container = "_container_gvtb9_6";
1646
+ const wrapper = "_wrapper_gvtb9_13";
1647
+ const cascader = "_cascader_gvtb9_22";
1648
+ const style0 = {
1649
+ popover: popover,
1650
+ container: container,
1651
+ wrapper: wrapper,
1652
+ cascader: cascader,
1653
+ "is-active": "_is-active_gvtb9_29",
1654
+ "popover-select": "_popover-select_gvtb9_36"
1655
+ };
1656
+
1657
+ const cssModules = {
1658
+ "$style": style0
1659
+ };
1660
+ const Component = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__cssModules", cssModules]]);
1661
+
1662
+ const __vite_glob_0_22 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1663
+ __proto__: null,
1664
+ default: Component
1665
+ }, Symbol.toStringTag, { value: 'Module' }));
1666
+
1667
+ export { Component as C, __vite_glob_0_22 as _ };