@zhaoyifannan/tvue 3.9.3 → 3.9.4

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 (676) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/tvue.js +12719 -7709
  3. package/dist/tvue.js.map +1 -1
  4. package/es/_virtual/_commonjs-dynamic-modules.mjs +1 -1
  5. package/es/_virtual/_commonjsHelpers.mjs +1 -1
  6. package/es/_virtual/axios.mjs +1 -1
  7. package/es/_virtual/axios2.mjs +1 -1
  8. package/es/_virtual/countUp.min.mjs +1 -1
  9. package/es/_virtual/countUp.min2.mjs +1 -1
  10. package/es/_virtual/dayjs.min.mjs +1 -1
  11. package/es/_virtual/dayjs.min2.mjs +1 -1
  12. package/es/index.css +1 -1
  13. package/es/node_modules/.pnpm/countup.js@1.9.3/node_modules/countup.js/dist/countUp.min.mjs +1 -1
  14. package/es/node_modules/.pnpm/dayjs@1.11.21/node_modules/dayjs/dayjs.min.mjs +1 -1
  15. package/es/node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.mjs +1 -1
  16. package/es/node_modules/axios/dist/axios.mjs +1 -1
  17. package/es/packages/core/common/event.mjs +1 -1
  18. package/es/packages/core/common/init.mjs +1 -1
  19. package/es/packages/core/common/props.mjs +1 -1
  20. package/es/packages/core/components/dialog-form/index.mjs +1 -1
  21. package/es/packages/core/components/dialog-form/index2.mjs +1 -1
  22. package/es/packages/core/components/dialog-form/index3.mjs +1 -1
  23. package/es/packages/core/components/dialog-form/index4.mjs +1 -1
  24. package/es/packages/core/components/form/custom.mjs +1 -1
  25. package/es/packages/core/components/form/index.mjs +1 -1
  26. package/es/packages/core/components/form/index2.mjs +1 -1
  27. package/es/packages/core/components/form/index3.mjs +1 -1
  28. package/es/packages/core/components/icon/index.mjs +1 -1
  29. package/es/packages/core/components/icon/index2.mjs +1 -1
  30. package/es/packages/core/components/icon/index3.mjs +1 -1
  31. package/es/packages/core/components/image-preview/index.mjs +1 -1
  32. package/es/packages/core/components/image-preview/index2.mjs +1 -1
  33. package/es/packages/core/components/image-preview/index3.mjs +1 -1
  34. package/es/packages/core/components/image-preview/index4.mjs +1 -1
  35. package/es/packages/core/directive/contextmenu.mjs +230 -89
  36. package/es/packages/core/directive/permission.mjs +1 -1
  37. package/es/packages/data/box/index.mjs +1 -1
  38. package/es/packages/data/box/index2.mjs +1 -1
  39. package/es/packages/data/box/index3.mjs +1 -1
  40. package/es/packages/data/card/index.mjs +1 -1
  41. package/es/packages/data/card/index2.mjs +1 -1
  42. package/es/packages/data/card/index3.mjs +1 -1
  43. package/es/packages/data/cardText/index.mjs +1 -1
  44. package/es/packages/data/cardText/index2.mjs +1 -1
  45. package/es/packages/data/cardText/index3.mjs +1 -1
  46. package/es/packages/data/countdown/index.mjs +1 -1
  47. package/es/packages/data/countdown/index2.mjs +1 -1
  48. package/es/packages/data/countdown/index3.mjs +1 -1
  49. package/es/packages/data/dashboard/index.mjs +1 -1
  50. package/es/packages/data/dashboard/index2.mjs +1 -1
  51. package/es/packages/data/dashboard/index3.mjs +1 -1
  52. package/es/packages/data/display/index.mjs +1 -1
  53. package/es/packages/data/display/index2.mjs +1 -1
  54. package/es/packages/data/display/index3.mjs +1 -1
  55. package/es/packages/data/icons/index.mjs +1 -1
  56. package/es/packages/data/icons/index2.mjs +1 -1
  57. package/es/packages/data/icons/index3.mjs +1 -1
  58. package/es/packages/data/imgText/index.mjs +1 -1
  59. package/es/packages/data/imgText/index2.mjs +1 -1
  60. package/es/packages/data/imgText/index3.mjs +1 -1
  61. package/es/packages/data/list/index.mjs +1 -1
  62. package/es/packages/data/list/index2.mjs +1 -1
  63. package/es/packages/data/list/index3.mjs +1 -1
  64. package/es/packages/data/notice/index.mjs +1 -1
  65. package/es/packages/data/notice/index2.mjs +1 -1
  66. package/es/packages/data/notice/index3.mjs +1 -1
  67. package/es/packages/data/operaText/index.mjs +1 -1
  68. package/es/packages/data/operaText/index2.mjs +1 -1
  69. package/es/packages/data/operaText/index3.mjs +1 -1
  70. package/es/packages/data/panel/index.mjs +1 -1
  71. package/es/packages/data/panel/index2.mjs +1 -1
  72. package/es/packages/data/panel/index3.mjs +1 -1
  73. package/es/packages/data/pay/index.mjs +1 -1
  74. package/es/packages/data/pay/index2.mjs +1 -1
  75. package/es/packages/data/pay/index3.mjs +1 -1
  76. package/es/packages/data/price/index.mjs +1 -1
  77. package/es/packages/data/price/index2.mjs +1 -1
  78. package/es/packages/data/price/index3.mjs +1 -1
  79. package/es/packages/data/product/index.mjs +1 -1
  80. package/es/packages/data/product/index2.mjs +1 -1
  81. package/es/packages/data/product/index3.mjs +1 -1
  82. package/es/packages/data/profile/index.mjs +1 -1
  83. package/es/packages/data/profile/index2.mjs +1 -1
  84. package/es/packages/data/profile/index3.mjs +1 -1
  85. package/es/packages/data/progress/index.mjs +1 -1
  86. package/es/packages/data/progress/index2.mjs +1 -1
  87. package/es/packages/data/progress/index3.mjs +1 -1
  88. package/es/packages/data/rank/index.mjs +1 -1
  89. package/es/packages/data/rank/index2.mjs +1 -1
  90. package/es/packages/data/rank/index3.mjs +1 -1
  91. package/es/packages/data/rotate/index.mjs +1 -1
  92. package/es/packages/data/rotate/index2.mjs +1 -1
  93. package/es/packages/data/rotate/index3.mjs +1 -1
  94. package/es/packages/data/statistic/index.mjs +1 -1
  95. package/es/packages/data/statistic/index2.mjs +1 -1
  96. package/es/packages/data/statistic/index3.mjs +1 -1
  97. package/es/packages/data/tabs/index.mjs +1 -1
  98. package/es/packages/data/tabs/index2.mjs +1 -1
  99. package/es/packages/data/tabs/index3.mjs +1 -1
  100. package/es/packages/data/task/index.mjs +1 -1
  101. package/es/packages/data/task/index2.mjs +1 -1
  102. package/es/packages/data/task/index3.mjs +1 -1
  103. package/es/packages/data/weather/index.mjs +1 -1
  104. package/es/packages/data/weather/index2.mjs +1 -1
  105. package/es/packages/data/weather/index3.mjs +1 -1
  106. package/es/packages/element-plus/array/index.mjs +1 -1
  107. package/es/packages/element-plus/array/index2.mjs +1 -1
  108. package/es/packages/element-plus/array/index3.mjs +1 -1
  109. package/es/packages/element-plus/article/index.mjs +1 -1
  110. package/es/packages/element-plus/article/index2.mjs +185 -20
  111. package/es/packages/element-plus/article/index3.mjs +98 -36
  112. package/es/packages/element-plus/captcha/index.mjs +8 -0
  113. package/es/packages/element-plus/captcha/index2.mjs +911 -0
  114. package/es/packages/element-plus/captcha/index3.mjs +519 -0
  115. package/es/packages/element-plus/card/index.mjs +1 -1
  116. package/es/packages/element-plus/card/index2.mjs +1 -1
  117. package/es/packages/element-plus/card/index3.mjs +1 -1
  118. package/es/packages/element-plus/cascader/index.mjs +1 -1
  119. package/es/packages/element-plus/cascader/index2.mjs +1 -1
  120. package/es/packages/element-plus/cascader/index3.mjs +1 -1
  121. package/es/packages/element-plus/chat/index.mjs +1 -1
  122. package/es/packages/element-plus/chat/index2.mjs +249 -203
  123. package/es/packages/element-plus/chat/index3.mjs +340 -264
  124. package/es/packages/element-plus/checkbox/index.mjs +1 -1
  125. package/es/packages/element-plus/checkbox/index2.mjs +1 -1
  126. package/es/packages/element-plus/checkbox/index3.mjs +1 -1
  127. package/es/packages/element-plus/comment/index.mjs +1 -1
  128. package/es/packages/element-plus/comment/index2.mjs +105 -32
  129. package/es/packages/element-plus/comment/index3.mjs +61 -22
  130. package/es/packages/element-plus/count-up/index.mjs +1 -1
  131. package/es/packages/element-plus/count-up/index2.mjs +1 -1
  132. package/es/packages/element-plus/count-up/index3.mjs +1 -1
  133. package/es/packages/element-plus/crud/column/column-default.mjs +1 -1
  134. package/es/packages/element-plus/crud/column/column-default2.mjs +1 -1
  135. package/es/packages/element-plus/crud/column/column-default3.mjs +1 -1
  136. package/es/packages/element-plus/crud/column/column-dynamic.mjs +1 -1
  137. package/es/packages/element-plus/crud/column/column-dynamic2.mjs +1 -1
  138. package/es/packages/element-plus/crud/column/column-dynamic3.mjs +1 -1
  139. package/es/packages/element-plus/crud/column/column-menu.mjs +1 -1
  140. package/es/packages/element-plus/crud/column/column-menu2.mjs +1 -1
  141. package/es/packages/element-plus/crud/column/column-menu3.mjs +1 -1
  142. package/es/packages/element-plus/crud/column/column-slot.mjs +1 -1
  143. package/es/packages/element-plus/crud/column/column-slot2.mjs +1 -1
  144. package/es/packages/element-plus/crud/column/column-slot3.mjs +1 -1
  145. package/es/packages/element-plus/crud/column/column.mjs +1 -1
  146. package/es/packages/element-plus/crud/column/column2.mjs +1 -1
  147. package/es/packages/element-plus/crud/column/column3.mjs +1 -1
  148. package/es/packages/element-plus/crud/column/menu.mjs +1 -1
  149. package/es/packages/element-plus/crud/column/menu2.mjs +1 -1
  150. package/es/packages/element-plus/crud/column/menu3.mjs +1 -1
  151. package/es/packages/element-plus/crud/config.mjs +1 -1
  152. package/es/packages/element-plus/crud/dialog/dialog-column.mjs +1 -1
  153. package/es/packages/element-plus/crud/dialog/dialog-column2.mjs +118 -40
  154. package/es/packages/element-plus/crud/dialog/dialog-column3.mjs +3 -3
  155. package/es/packages/element-plus/crud/dialog/dialog-excel.mjs +1 -1
  156. package/es/packages/element-plus/crud/dialog/dialog-excel2.mjs +1 -1
  157. package/es/packages/element-plus/crud/dialog/dialog-excel3.mjs +1 -1
  158. package/es/packages/element-plus/crud/dialog/dialog-filter.mjs +1 -1
  159. package/es/packages/element-plus/crud/dialog/dialog-filter2.mjs +1 -1
  160. package/es/packages/element-plus/crud/dialog/dialog-filter3.mjs +1 -1
  161. package/es/packages/element-plus/crud/dialog/dialog-form.mjs +1 -1
  162. package/es/packages/element-plus/crud/dialog/dialog-form2.mjs +1 -1
  163. package/es/packages/element-plus/crud/dialog/dialog-form3.mjs +1 -1
  164. package/es/packages/element-plus/crud/grid/index.mjs +1 -1
  165. package/es/packages/element-plus/crud/grid/index2.mjs +1 -1
  166. package/es/packages/element-plus/crud/grid/index3.mjs +1 -1
  167. package/es/packages/element-plus/crud/grid/item.mjs +1 -1
  168. package/es/packages/element-plus/crud/grid/item2.mjs +1 -1
  169. package/es/packages/element-plus/crud/grid/item3.mjs +1 -1
  170. package/es/packages/element-plus/crud/index.mjs +1 -1
  171. package/es/packages/element-plus/crud/index2.mjs +38 -15
  172. package/es/packages/element-plus/crud/index3.mjs +1 -1
  173. package/es/packages/element-plus/crud/menu/header-menu.mjs +1 -1
  174. package/es/packages/element-plus/crud/menu/header-menu2.mjs +1 -1
  175. package/es/packages/element-plus/crud/menu/header-menu3.mjs +1 -1
  176. package/es/packages/element-plus/crud/menu/header-search.mjs +1 -1
  177. package/es/packages/element-plus/crud/menu/header-search2.mjs +1 -1
  178. package/es/packages/element-plus/crud/menu/header-search3.mjs +1 -1
  179. package/es/packages/element-plus/crud/menu/table-page.mjs +1 -1
  180. package/es/packages/element-plus/crud/menu/table-page2.mjs +1 -1
  181. package/es/packages/element-plus/crud/menu/table-page3.mjs +1 -1
  182. package/es/packages/element-plus/date/index.mjs +1 -1
  183. package/es/packages/element-plus/date/index2.mjs +1 -1
  184. package/es/packages/element-plus/date/index3.mjs +1 -1
  185. package/es/packages/element-plus/draggable/index.mjs +1 -1
  186. package/es/packages/element-plus/draggable/index2.mjs +329 -309
  187. package/es/packages/element-plus/draggable/index3.mjs +37 -39
  188. package/es/packages/element-plus/dynamic/index.mjs +1 -1
  189. package/es/packages/element-plus/dynamic/index2.mjs +1 -1
  190. package/es/packages/element-plus/dynamic/index3.mjs +1 -1
  191. package/es/packages/element-plus/file-manager/index.mjs +8 -0
  192. package/es/packages/element-plus/file-manager/index2.mjs +574 -0
  193. package/es/packages/element-plus/file-manager/index3.mjs +814 -0
  194. package/es/packages/element-plus/filter-builder/index.mjs +8 -0
  195. package/es/packages/element-plus/filter-builder/index2.mjs +208 -0
  196. package/es/packages/element-plus/filter-builder/index3.mjs +290 -0
  197. package/es/packages/element-plus/flow/index.mjs +1 -1
  198. package/es/packages/element-plus/flow/index2.mjs +274 -232
  199. package/es/packages/element-plus/flow/index3.mjs +31 -20
  200. package/es/packages/element-plus/flow/node.mjs +1 -1
  201. package/es/packages/element-plus/flow/node2.mjs +23 -37
  202. package/es/packages/element-plus/flow/node3.mjs +20 -17
  203. package/es/packages/element-plus/form/config.mjs +1 -1
  204. package/es/packages/element-plus/form/index.mjs +1 -1
  205. package/es/packages/element-plus/form/index2.mjs +1 -1
  206. package/es/packages/element-plus/form/index3.mjs +1 -1
  207. package/es/packages/element-plus/form/menu.mjs +1 -1
  208. package/es/packages/element-plus/form/menu2.mjs +1 -1
  209. package/es/packages/element-plus/form/menu3.mjs +1 -1
  210. package/es/packages/element-plus/group/index.mjs +1 -1
  211. package/es/packages/element-plus/group/index2.mjs +1 -1
  212. package/es/packages/element-plus/group/index3.mjs +1 -1
  213. package/es/packages/element-plus/iframe/index.mjs +1 -1
  214. package/es/packages/element-plus/iframe/index2.mjs +1 -1
  215. package/es/packages/element-plus/iframe/index3.mjs +1 -1
  216. package/es/packages/element-plus/input/index.mjs +1 -1
  217. package/es/packages/element-plus/input/index2.mjs +1 -1
  218. package/es/packages/element-plus/input/index3.mjs +1 -1
  219. package/es/packages/element-plus/input-color/index.mjs +1 -1
  220. package/es/packages/element-plus/input-color/index2.mjs +1 -1
  221. package/es/packages/element-plus/input-color/index3.mjs +1 -1
  222. package/es/packages/element-plus/input-cron/index.mjs +1 -1
  223. package/es/packages/element-plus/input-cron/index2.mjs +1 -1
  224. package/es/packages/element-plus/input-cron/index3.mjs +1 -1
  225. package/es/packages/element-plus/input-icon/index.mjs +1 -1
  226. package/es/packages/element-plus/input-icon/index2.mjs +1 -1
  227. package/es/packages/element-plus/input-icon/index3.mjs +1 -1
  228. package/es/packages/element-plus/input-map/index.mjs +1 -1
  229. package/es/packages/element-plus/input-map/index2.mjs +1 -1
  230. package/es/packages/element-plus/input-map/index3.mjs +1 -1
  231. package/es/packages/element-plus/input-number/index.mjs +1 -1
  232. package/es/packages/element-plus/input-number/index2.mjs +1 -1
  233. package/es/packages/element-plus/input-number/index3.mjs +1 -1
  234. package/es/packages/element-plus/input-otp/index.mjs +1 -1
  235. package/es/packages/element-plus/input-otp/index2.mjs +1 -1
  236. package/es/packages/element-plus/input-otp/index3.mjs +1 -1
  237. package/es/packages/element-plus/input-table/index.mjs +1 -1
  238. package/es/packages/element-plus/input-table/index2.mjs +1 -1
  239. package/es/packages/element-plus/input-table/index3.mjs +1 -1
  240. package/es/packages/element-plus/input-tag/index.mjs +1 -1
  241. package/es/packages/element-plus/input-tag/index2.mjs +1 -1
  242. package/es/packages/element-plus/input-tag/index3.mjs +1 -1
  243. package/es/packages/element-plus/input-tree/index.mjs +1 -1
  244. package/es/packages/element-plus/input-tree/index2.mjs +1 -1
  245. package/es/packages/element-plus/input-tree/index3.mjs +1 -1
  246. package/es/packages/element-plus/license/index.mjs +1 -1
  247. package/es/packages/element-plus/license/index2.mjs +216 -106
  248. package/es/packages/element-plus/license/index3.mjs +45 -10
  249. package/es/packages/element-plus/login/index.mjs +1 -1
  250. package/es/packages/element-plus/login/index2.mjs +66 -49
  251. package/es/packages/element-plus/login/index3.mjs +57 -46
  252. package/es/packages/element-plus/mention/index.mjs +1 -1
  253. package/es/packages/element-plus/mention/index2.mjs +1 -1
  254. package/es/packages/element-plus/mention/index3.mjs +1 -1
  255. package/es/packages/element-plus/qrcode/index.mjs +1 -1
  256. package/es/packages/element-plus/qrcode/index2.mjs +1 -1
  257. package/es/packages/element-plus/qrcode/index3.mjs +1 -1
  258. package/es/packages/element-plus/radio/index.mjs +1 -1
  259. package/es/packages/element-plus/radio/index2.mjs +1 -1
  260. package/es/packages/element-plus/radio/index3.mjs +1 -1
  261. package/es/packages/element-plus/rate/index.mjs +1 -1
  262. package/es/packages/element-plus/rate/index2.mjs +1 -1
  263. package/es/packages/element-plus/rate/index3.mjs +1 -1
  264. package/es/packages/element-plus/search/index.mjs +1 -1
  265. package/es/packages/element-plus/search/index2.mjs +1 -1
  266. package/es/packages/element-plus/search/index3.mjs +1 -1
  267. package/es/packages/element-plus/select/index.mjs +1 -1
  268. package/es/packages/element-plus/select/index2.mjs +1 -1
  269. package/es/packages/element-plus/select/index3.mjs +1 -1
  270. package/es/packages/element-plus/sign/index.mjs +1 -1
  271. package/es/packages/element-plus/sign/index2.mjs +266 -183
  272. package/es/packages/element-plus/sign/index3.mjs +71 -11
  273. package/es/packages/element-plus/slider/index.mjs +1 -1
  274. package/es/packages/element-plus/slider/index2.mjs +1 -1
  275. package/es/packages/element-plus/slider/index3.mjs +1 -1
  276. package/es/packages/element-plus/switch/index.mjs +1 -1
  277. package/es/packages/element-plus/switch/index2.mjs +1 -1
  278. package/es/packages/element-plus/switch/index3.mjs +1 -1
  279. package/es/packages/element-plus/tabs/index.mjs +1 -1
  280. package/es/packages/element-plus/tabs/index2.mjs +1 -1
  281. package/es/packages/element-plus/tabs/index3.mjs +1 -1
  282. package/es/packages/element-plus/text-ellipsis/index.mjs +1 -1
  283. package/es/packages/element-plus/text-ellipsis/index2.mjs +1 -1
  284. package/es/packages/element-plus/text-ellipsis/index3.mjs +1 -1
  285. package/es/packages/element-plus/time/index.mjs +1 -1
  286. package/es/packages/element-plus/time/index2.mjs +1 -1
  287. package/es/packages/element-plus/time/index3.mjs +1 -1
  288. package/es/packages/element-plus/title/index.mjs +1 -1
  289. package/es/packages/element-plus/title/index2.mjs +1 -1
  290. package/es/packages/element-plus/title/index3.mjs +1 -1
  291. package/es/packages/element-plus/tree/index.mjs +1 -1
  292. package/es/packages/element-plus/tree/index2.mjs +2 -1
  293. package/es/packages/element-plus/tree/index3.mjs +1 -1
  294. package/es/packages/element-plus/upload/index.mjs +1 -1
  295. package/es/packages/element-plus/upload/index2.mjs +1 -1
  296. package/es/packages/element-plus/upload/index3.mjs +1 -1
  297. package/es/packages/element-plus/verify/index.mjs +1 -1
  298. package/es/packages/element-plus/verify/index2.mjs +1 -1
  299. package/es/packages/element-plus/verify/index3.mjs +1 -1
  300. package/es/packages/element-plus/video/index.mjs +1 -1
  301. package/es/packages/element-plus/video/index2.mjs +171 -57
  302. package/es/packages/element-plus/video/index3.mjs +65 -29
  303. package/es/src/core/column-state.mjs +1 -1
  304. package/es/src/core/create.mjs +1 -1
  305. package/es/src/core/dataformat.mjs +1 -1
  306. package/es/src/core/detail.mjs +1 -1
  307. package/es/src/core/dic.mjs +1 -1
  308. package/es/src/core/locale.mjs +1 -1
  309. package/es/src/core/option.mjs +1 -1
  310. package/es/src/core/packages.mjs +1 -1
  311. package/es/src/core/slot.mjs +1 -1
  312. package/es/src/global/variable.mjs +1 -1
  313. package/es/src/icon.mjs +1 -1
  314. package/es/src/index.mjs +7 -3
  315. package/es/src/locale/format.mjs +1 -1
  316. package/es/src/locale/index.mjs +1 -1
  317. package/es/src/locale/lang/en.mjs +1 -1
  318. package/es/src/locale/lang/zh-cn.mjs +1 -1
  319. package/es/src/locale/lang/zh.mjs +1 -1
  320. package/es/src/plugin/ali/index.mjs +1 -1
  321. package/es/src/plugin/clipboard/index.mjs +42 -57
  322. package/es/src/plugin/export/_blob.mjs +1 -1
  323. package/es/src/plugin/export/_export2Excel.mjs +1 -1
  324. package/es/src/plugin/export/index.mjs +58 -43
  325. package/es/src/plugin/logs/index.mjs +1 -1
  326. package/es/src/plugin/print/index.mjs +188 -197
  327. package/es/src/plugin/qiniu/index.mjs +1 -1
  328. package/es/src/plugin/screenshot/index.mjs +26 -4
  329. package/es/src/plugin/video/index.mjs +49 -6
  330. package/es/src/plugin/watermark/index.mjs +58 -102
  331. package/es/src/plugin/watermark/watermark.mjs +123 -80
  332. package/es/src/ui/data/index.mjs +1 -1
  333. package/es/src/ui/element-plus/index.mjs +99 -93
  334. package/es/src/ui/element-ui/index.mjs +1 -1
  335. package/es/src/ui/index.mjs +1 -1
  336. package/es/src/utils/bem.mjs +1 -1
  337. package/es/src/utils/identity.mjs +1 -1
  338. package/es/src/utils/mock.mjs +1 -1
  339. package/es/src/utils/print.mjs +1 -1
  340. package/es/src/utils/util.mjs +1 -1
  341. package/es/src/utils/validate.mjs +1 -1
  342. package/es/src/version.mjs +2 -2
  343. package/lib/_virtual/_commonjsHelpers.js +1 -1
  344. package/lib/_virtual/dayjs.min.js +1 -1
  345. package/lib/_virtual/dayjs.min2.js +1 -1
  346. package/lib/index.css +1 -1
  347. package/lib/node_modules/.pnpm/dayjs@1.11.21/node_modules/dayjs/dayjs.min.js +1 -1
  348. package/lib/node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.js +1 -1
  349. package/lib/packages/core/common/event.js +1 -1
  350. package/lib/packages/core/common/init.js +1 -1
  351. package/lib/packages/core/common/props.js +1 -1
  352. package/lib/packages/core/components/dialog-form/index.js +1 -1
  353. package/lib/packages/core/components/dialog-form/index2.js +1 -1
  354. package/lib/packages/core/components/dialog-form/index3.js +1 -1
  355. package/lib/packages/core/components/dialog-form/index4.js +1 -1
  356. package/lib/packages/core/components/form/custom.js +1 -1
  357. package/lib/packages/core/components/form/index.js +1 -1
  358. package/lib/packages/core/components/form/index2.js +1 -1
  359. package/lib/packages/core/components/form/index3.js +1 -1
  360. package/lib/packages/core/components/icon/index.js +1 -1
  361. package/lib/packages/core/components/icon/index2.js +1 -1
  362. package/lib/packages/core/components/icon/index3.js +1 -1
  363. package/lib/packages/core/components/image-preview/index.js +1 -1
  364. package/lib/packages/core/components/image-preview/index2.js +1 -1
  365. package/lib/packages/core/components/image-preview/index3.js +1 -1
  366. package/lib/packages/core/components/image-preview/index4.js +1 -1
  367. package/lib/packages/core/directive/contextmenu.js +230 -89
  368. package/lib/packages/core/directive/permission.js +1 -1
  369. package/lib/packages/data/box/index.js +1 -1
  370. package/lib/packages/data/box/index2.js +1 -1
  371. package/lib/packages/data/box/index3.js +1 -1
  372. package/lib/packages/data/card/index.js +1 -1
  373. package/lib/packages/data/card/index2.js +1 -1
  374. package/lib/packages/data/card/index3.js +1 -1
  375. package/lib/packages/data/cardText/index.js +1 -1
  376. package/lib/packages/data/cardText/index2.js +1 -1
  377. package/lib/packages/data/cardText/index3.js +1 -1
  378. package/lib/packages/data/countdown/index.js +1 -1
  379. package/lib/packages/data/countdown/index2.js +1 -1
  380. package/lib/packages/data/countdown/index3.js +1 -1
  381. package/lib/packages/data/dashboard/index.js +1 -1
  382. package/lib/packages/data/dashboard/index2.js +1 -1
  383. package/lib/packages/data/dashboard/index3.js +1 -1
  384. package/lib/packages/data/display/index.js +1 -1
  385. package/lib/packages/data/display/index2.js +1 -1
  386. package/lib/packages/data/display/index3.js +1 -1
  387. package/lib/packages/data/icons/index.js +1 -1
  388. package/lib/packages/data/icons/index2.js +1 -1
  389. package/lib/packages/data/icons/index3.js +1 -1
  390. package/lib/packages/data/imgText/index.js +1 -1
  391. package/lib/packages/data/imgText/index2.js +1 -1
  392. package/lib/packages/data/imgText/index3.js +1 -1
  393. package/lib/packages/data/list/index.js +1 -1
  394. package/lib/packages/data/list/index2.js +1 -1
  395. package/lib/packages/data/list/index3.js +1 -1
  396. package/lib/packages/data/notice/index.js +1 -1
  397. package/lib/packages/data/notice/index2.js +1 -1
  398. package/lib/packages/data/notice/index3.js +1 -1
  399. package/lib/packages/data/operaText/index.js +1 -1
  400. package/lib/packages/data/operaText/index2.js +1 -1
  401. package/lib/packages/data/operaText/index3.js +1 -1
  402. package/lib/packages/data/panel/index.js +1 -1
  403. package/lib/packages/data/panel/index2.js +1 -1
  404. package/lib/packages/data/panel/index3.js +1 -1
  405. package/lib/packages/data/pay/index.js +1 -1
  406. package/lib/packages/data/pay/index2.js +1 -1
  407. package/lib/packages/data/pay/index3.js +1 -1
  408. package/lib/packages/data/price/index.js +1 -1
  409. package/lib/packages/data/price/index2.js +1 -1
  410. package/lib/packages/data/price/index3.js +1 -1
  411. package/lib/packages/data/product/index.js +1 -1
  412. package/lib/packages/data/product/index2.js +1 -1
  413. package/lib/packages/data/product/index3.js +1 -1
  414. package/lib/packages/data/profile/index.js +1 -1
  415. package/lib/packages/data/profile/index2.js +1 -1
  416. package/lib/packages/data/profile/index3.js +1 -1
  417. package/lib/packages/data/progress/index.js +1 -1
  418. package/lib/packages/data/progress/index2.js +1 -1
  419. package/lib/packages/data/progress/index3.js +1 -1
  420. package/lib/packages/data/rank/index.js +1 -1
  421. package/lib/packages/data/rank/index2.js +1 -1
  422. package/lib/packages/data/rank/index3.js +1 -1
  423. package/lib/packages/data/rotate/index.js +1 -1
  424. package/lib/packages/data/rotate/index2.js +1 -1
  425. package/lib/packages/data/rotate/index3.js +1 -1
  426. package/lib/packages/data/statistic/index.js +1 -1
  427. package/lib/packages/data/statistic/index2.js +1 -1
  428. package/lib/packages/data/statistic/index3.js +1 -1
  429. package/lib/packages/data/tabs/index.js +1 -1
  430. package/lib/packages/data/tabs/index2.js +1 -1
  431. package/lib/packages/data/tabs/index3.js +1 -1
  432. package/lib/packages/data/task/index.js +1 -1
  433. package/lib/packages/data/task/index2.js +1 -1
  434. package/lib/packages/data/task/index3.js +1 -1
  435. package/lib/packages/data/weather/index.js +1 -1
  436. package/lib/packages/data/weather/index2.js +1 -1
  437. package/lib/packages/data/weather/index3.js +1 -1
  438. package/lib/packages/element-plus/array/index.js +1 -1
  439. package/lib/packages/element-plus/array/index2.js +1 -1
  440. package/lib/packages/element-plus/array/index3.js +1 -1
  441. package/lib/packages/element-plus/article/index.js +1 -1
  442. package/lib/packages/element-plus/article/index2.js +185 -20
  443. package/lib/packages/element-plus/article/index3.js +97 -35
  444. package/lib/packages/element-plus/captcha/index.js +12 -0
  445. package/lib/packages/element-plus/captcha/index2.js +915 -0
  446. package/lib/packages/element-plus/captcha/index3.js +521 -0
  447. package/lib/packages/element-plus/card/index.js +1 -1
  448. package/lib/packages/element-plus/card/index2.js +1 -1
  449. package/lib/packages/element-plus/card/index3.js +1 -1
  450. package/lib/packages/element-plus/cascader/index.js +1 -1
  451. package/lib/packages/element-plus/cascader/index2.js +1 -1
  452. package/lib/packages/element-plus/cascader/index3.js +1 -1
  453. package/lib/packages/element-plus/chat/index.js +1 -1
  454. package/lib/packages/element-plus/chat/index2.js +249 -203
  455. package/lib/packages/element-plus/chat/index3.js +339 -263
  456. package/lib/packages/element-plus/checkbox/index.js +1 -1
  457. package/lib/packages/element-plus/checkbox/index2.js +1 -1
  458. package/lib/packages/element-plus/checkbox/index3.js +1 -1
  459. package/lib/packages/element-plus/comment/index.js +1 -1
  460. package/lib/packages/element-plus/comment/index2.js +105 -32
  461. package/lib/packages/element-plus/comment/index3.js +60 -21
  462. package/lib/packages/element-plus/count-up/index.js +1 -1
  463. package/lib/packages/element-plus/count-up/index2.js +1 -1
  464. package/lib/packages/element-plus/count-up/index3.js +1 -1
  465. package/lib/packages/element-plus/crud/column/column-default.js +1 -1
  466. package/lib/packages/element-plus/crud/column/column-default2.js +1 -1
  467. package/lib/packages/element-plus/crud/column/column-default3.js +1 -1
  468. package/lib/packages/element-plus/crud/column/column-dynamic.js +1 -1
  469. package/lib/packages/element-plus/crud/column/column-dynamic2.js +1 -1
  470. package/lib/packages/element-plus/crud/column/column-dynamic3.js +1 -1
  471. package/lib/packages/element-plus/crud/column/column-menu.js +1 -1
  472. package/lib/packages/element-plus/crud/column/column-menu2.js +1 -1
  473. package/lib/packages/element-plus/crud/column/column-menu3.js +1 -1
  474. package/lib/packages/element-plus/crud/column/column-slot.js +1 -1
  475. package/lib/packages/element-plus/crud/column/column-slot2.js +1 -1
  476. package/lib/packages/element-plus/crud/column/column-slot3.js +1 -1
  477. package/lib/packages/element-plus/crud/column/column.js +1 -1
  478. package/lib/packages/element-plus/crud/column/column2.js +1 -1
  479. package/lib/packages/element-plus/crud/column/column3.js +1 -1
  480. package/lib/packages/element-plus/crud/column/menu.js +1 -1
  481. package/lib/packages/element-plus/crud/column/menu2.js +1 -1
  482. package/lib/packages/element-plus/crud/column/menu3.js +1 -1
  483. package/lib/packages/element-plus/crud/config.js +1 -1
  484. package/lib/packages/element-plus/crud/dialog/dialog-column.js +1 -1
  485. package/lib/packages/element-plus/crud/dialog/dialog-column2.js +118 -40
  486. package/lib/packages/element-plus/crud/dialog/dialog-column3.js +3 -3
  487. package/lib/packages/element-plus/crud/dialog/dialog-excel.js +1 -1
  488. package/lib/packages/element-plus/crud/dialog/dialog-excel2.js +1 -1
  489. package/lib/packages/element-plus/crud/dialog/dialog-excel3.js +1 -1
  490. package/lib/packages/element-plus/crud/dialog/dialog-filter.js +1 -1
  491. package/lib/packages/element-plus/crud/dialog/dialog-filter2.js +1 -1
  492. package/lib/packages/element-plus/crud/dialog/dialog-filter3.js +1 -1
  493. package/lib/packages/element-plus/crud/dialog/dialog-form.js +1 -1
  494. package/lib/packages/element-plus/crud/dialog/dialog-form2.js +1 -1
  495. package/lib/packages/element-plus/crud/dialog/dialog-form3.js +1 -1
  496. package/lib/packages/element-plus/crud/grid/index.js +1 -1
  497. package/lib/packages/element-plus/crud/grid/index2.js +1 -1
  498. package/lib/packages/element-plus/crud/grid/index3.js +1 -1
  499. package/lib/packages/element-plus/crud/grid/item.js +1 -1
  500. package/lib/packages/element-plus/crud/grid/item2.js +1 -1
  501. package/lib/packages/element-plus/crud/grid/item3.js +1 -1
  502. package/lib/packages/element-plus/crud/index.js +1 -1
  503. package/lib/packages/element-plus/crud/index2.js +38 -15
  504. package/lib/packages/element-plus/crud/index3.js +1 -1
  505. package/lib/packages/element-plus/crud/menu/header-menu.js +1 -1
  506. package/lib/packages/element-plus/crud/menu/header-menu2.js +1 -1
  507. package/lib/packages/element-plus/crud/menu/header-menu3.js +1 -1
  508. package/lib/packages/element-plus/crud/menu/header-search.js +1 -1
  509. package/lib/packages/element-plus/crud/menu/header-search2.js +1 -1
  510. package/lib/packages/element-plus/crud/menu/header-search3.js +1 -1
  511. package/lib/packages/element-plus/crud/menu/table-page.js +1 -1
  512. package/lib/packages/element-plus/crud/menu/table-page2.js +1 -1
  513. package/lib/packages/element-plus/crud/menu/table-page3.js +1 -1
  514. package/lib/packages/element-plus/date/index.js +1 -1
  515. package/lib/packages/element-plus/date/index2.js +1 -1
  516. package/lib/packages/element-plus/date/index3.js +1 -1
  517. package/lib/packages/element-plus/draggable/index.js +1 -1
  518. package/lib/packages/element-plus/draggable/index2.js +329 -309
  519. package/lib/packages/element-plus/draggable/index3.js +36 -38
  520. package/lib/packages/element-plus/dynamic/index.js +1 -1
  521. package/lib/packages/element-plus/dynamic/index2.js +1 -1
  522. package/lib/packages/element-plus/dynamic/index3.js +1 -1
  523. package/lib/packages/element-plus/file-manager/index.js +12 -0
  524. package/lib/packages/element-plus/file-manager/index2.js +578 -0
  525. package/lib/packages/element-plus/file-manager/index3.js +816 -0
  526. package/lib/packages/element-plus/filter-builder/index.js +12 -0
  527. package/lib/packages/element-plus/filter-builder/index2.js +212 -0
  528. package/lib/packages/element-plus/filter-builder/index3.js +292 -0
  529. package/lib/packages/element-plus/flow/index.js +1 -1
  530. package/lib/packages/element-plus/flow/index2.js +274 -232
  531. package/lib/packages/element-plus/flow/index3.js +30 -19
  532. package/lib/packages/element-plus/flow/node.js +1 -1
  533. package/lib/packages/element-plus/flow/node2.js +23 -37
  534. package/lib/packages/element-plus/flow/node3.js +19 -16
  535. package/lib/packages/element-plus/form/config.js +1 -1
  536. package/lib/packages/element-plus/form/index.js +1 -1
  537. package/lib/packages/element-plus/form/index2.js +1 -1
  538. package/lib/packages/element-plus/form/index3.js +1 -1
  539. package/lib/packages/element-plus/form/menu.js +1 -1
  540. package/lib/packages/element-plus/form/menu2.js +1 -1
  541. package/lib/packages/element-plus/form/menu3.js +1 -1
  542. package/lib/packages/element-plus/group/index.js +1 -1
  543. package/lib/packages/element-plus/group/index2.js +1 -1
  544. package/lib/packages/element-plus/group/index3.js +1 -1
  545. package/lib/packages/element-plus/iframe/index.js +1 -1
  546. package/lib/packages/element-plus/iframe/index2.js +1 -1
  547. package/lib/packages/element-plus/iframe/index3.js +1 -1
  548. package/lib/packages/element-plus/input/index.js +1 -1
  549. package/lib/packages/element-plus/input/index2.js +1 -1
  550. package/lib/packages/element-plus/input/index3.js +1 -1
  551. package/lib/packages/element-plus/input-color/index.js +1 -1
  552. package/lib/packages/element-plus/input-color/index2.js +1 -1
  553. package/lib/packages/element-plus/input-color/index3.js +1 -1
  554. package/lib/packages/element-plus/input-cron/index.js +1 -1
  555. package/lib/packages/element-plus/input-cron/index2.js +1 -1
  556. package/lib/packages/element-plus/input-cron/index3.js +1 -1
  557. package/lib/packages/element-plus/input-icon/index.js +1 -1
  558. package/lib/packages/element-plus/input-icon/index2.js +1 -1
  559. package/lib/packages/element-plus/input-icon/index3.js +1 -1
  560. package/lib/packages/element-plus/input-map/index.js +1 -1
  561. package/lib/packages/element-plus/input-map/index2.js +1 -1
  562. package/lib/packages/element-plus/input-map/index3.js +1 -1
  563. package/lib/packages/element-plus/input-number/index.js +1 -1
  564. package/lib/packages/element-plus/input-number/index2.js +1 -1
  565. package/lib/packages/element-plus/input-number/index3.js +1 -1
  566. package/lib/packages/element-plus/input-otp/index.js +1 -1
  567. package/lib/packages/element-plus/input-otp/index2.js +1 -1
  568. package/lib/packages/element-plus/input-otp/index3.js +1 -1
  569. package/lib/packages/element-plus/input-table/index.js +1 -1
  570. package/lib/packages/element-plus/input-table/index2.js +1 -1
  571. package/lib/packages/element-plus/input-table/index3.js +1 -1
  572. package/lib/packages/element-plus/input-tag/index.js +1 -1
  573. package/lib/packages/element-plus/input-tag/index2.js +1 -1
  574. package/lib/packages/element-plus/input-tag/index3.js +1 -1
  575. package/lib/packages/element-plus/input-tree/index.js +1 -1
  576. package/lib/packages/element-plus/input-tree/index2.js +1 -1
  577. package/lib/packages/element-plus/input-tree/index3.js +1 -1
  578. package/lib/packages/element-plus/license/index.js +1 -1
  579. package/lib/packages/element-plus/license/index2.js +216 -106
  580. package/lib/packages/element-plus/license/index3.js +44 -9
  581. package/lib/packages/element-plus/login/index.js +1 -1
  582. package/lib/packages/element-plus/login/index2.js +66 -49
  583. package/lib/packages/element-plus/login/index3.js +56 -45
  584. package/lib/packages/element-plus/mention/index.js +1 -1
  585. package/lib/packages/element-plus/mention/index2.js +1 -1
  586. package/lib/packages/element-plus/mention/index3.js +1 -1
  587. package/lib/packages/element-plus/qrcode/index.js +1 -1
  588. package/lib/packages/element-plus/qrcode/index2.js +1 -1
  589. package/lib/packages/element-plus/qrcode/index3.js +1 -1
  590. package/lib/packages/element-plus/radio/index.js +1 -1
  591. package/lib/packages/element-plus/radio/index2.js +1 -1
  592. package/lib/packages/element-plus/radio/index3.js +1 -1
  593. package/lib/packages/element-plus/rate/index.js +1 -1
  594. package/lib/packages/element-plus/rate/index2.js +1 -1
  595. package/lib/packages/element-plus/rate/index3.js +1 -1
  596. package/lib/packages/element-plus/search/index.js +1 -1
  597. package/lib/packages/element-plus/search/index2.js +1 -1
  598. package/lib/packages/element-plus/search/index3.js +1 -1
  599. package/lib/packages/element-plus/select/index.js +1 -1
  600. package/lib/packages/element-plus/select/index2.js +1 -1
  601. package/lib/packages/element-plus/select/index3.js +1 -1
  602. package/lib/packages/element-plus/sign/index.js +1 -1
  603. package/lib/packages/element-plus/sign/index2.js +266 -183
  604. package/lib/packages/element-plus/sign/index3.js +70 -10
  605. package/lib/packages/element-plus/slider/index.js +1 -1
  606. package/lib/packages/element-plus/slider/index2.js +1 -1
  607. package/lib/packages/element-plus/slider/index3.js +1 -1
  608. package/lib/packages/element-plus/switch/index.js +1 -1
  609. package/lib/packages/element-plus/switch/index2.js +1 -1
  610. package/lib/packages/element-plus/switch/index3.js +1 -1
  611. package/lib/packages/element-plus/tabs/index.js +1 -1
  612. package/lib/packages/element-plus/tabs/index2.js +1 -1
  613. package/lib/packages/element-plus/tabs/index3.js +1 -1
  614. package/lib/packages/element-plus/text-ellipsis/index.js +1 -1
  615. package/lib/packages/element-plus/text-ellipsis/index2.js +1 -1
  616. package/lib/packages/element-plus/text-ellipsis/index3.js +1 -1
  617. package/lib/packages/element-plus/time/index.js +1 -1
  618. package/lib/packages/element-plus/time/index2.js +1 -1
  619. package/lib/packages/element-plus/time/index3.js +1 -1
  620. package/lib/packages/element-plus/title/index.js +1 -1
  621. package/lib/packages/element-plus/title/index2.js +1 -1
  622. package/lib/packages/element-plus/title/index3.js +1 -1
  623. package/lib/packages/element-plus/tree/index.js +1 -1
  624. package/lib/packages/element-plus/tree/index2.js +2 -1
  625. package/lib/packages/element-plus/tree/index3.js +1 -1
  626. package/lib/packages/element-plus/upload/index.js +1 -1
  627. package/lib/packages/element-plus/upload/index2.js +1 -1
  628. package/lib/packages/element-plus/upload/index3.js +1 -1
  629. package/lib/packages/element-plus/verify/index.js +1 -1
  630. package/lib/packages/element-plus/verify/index2.js +1 -1
  631. package/lib/packages/element-plus/verify/index3.js +1 -1
  632. package/lib/packages/element-plus/video/index.js +1 -1
  633. package/lib/packages/element-plus/video/index2.js +171 -57
  634. package/lib/packages/element-plus/video/index3.js +64 -28
  635. package/lib/src/core/column-state.js +1 -1
  636. package/lib/src/core/create.js +1 -1
  637. package/lib/src/core/dataformat.js +1 -1
  638. package/lib/src/core/detail.js +1 -1
  639. package/lib/src/core/dic.js +1 -1
  640. package/lib/src/core/locale.js +1 -1
  641. package/lib/src/core/option.js +1 -1
  642. package/lib/src/core/packages.js +1 -1
  643. package/lib/src/core/slot.js +1 -1
  644. package/lib/src/global/variable.js +1 -1
  645. package/lib/src/icon.js +1 -1
  646. package/lib/src/index.js +76 -70
  647. package/lib/src/locale/format.js +1 -1
  648. package/lib/src/locale/index.js +1 -1
  649. package/lib/src/locale/lang/en.js +1 -1
  650. package/lib/src/locale/lang/zh-cn.js +1 -1
  651. package/lib/src/locale/lang/zh.js +1 -1
  652. package/lib/src/plugin/ali/index.js +1 -1
  653. package/lib/src/plugin/clipboard/index.js +42 -57
  654. package/lib/src/plugin/export/_blob.js +1 -1
  655. package/lib/src/plugin/export/_export2Excel.js +1 -1
  656. package/lib/src/plugin/export/index.js +58 -43
  657. package/lib/src/plugin/logs/index.js +1 -1
  658. package/lib/src/plugin/print/index.js +188 -197
  659. package/lib/src/plugin/qiniu/index.js +1 -1
  660. package/lib/src/plugin/screenshot/index.js +26 -4
  661. package/lib/src/plugin/video/index.js +49 -6
  662. package/lib/src/plugin/watermark/index.js +58 -102
  663. package/lib/src/plugin/watermark/watermark.js +123 -80
  664. package/lib/src/ui/data/index.js +1 -1
  665. package/lib/src/ui/element-plus/index.js +112 -104
  666. package/lib/src/ui/element-ui/index.js +1 -1
  667. package/lib/src/ui/index.js +1 -1
  668. package/lib/src/utils/bem.js +1 -1
  669. package/lib/src/utils/identity.js +1 -1
  670. package/lib/src/utils/mock.js +1 -1
  671. package/lib/src/utils/print.js +1 -1
  672. package/lib/src/utils/util.js +1 -1
  673. package/lib/src/utils/validate.js +1 -1
  674. package/lib/src/version.js +2 -2
  675. package/package.json +2 -1
  676. package/types/index.d.ts +68 -19
@@ -0,0 +1,911 @@
1
+ /*! Tvue.js v3.9.4 | (c) 2024-2026 Zhaoyifannan | Released under the MIT License. */
2
+ import create from '../../../src/core/create.mjs';
3
+
4
+ const CAPTCHA_TYPES = ['slider', 'text', 'math', 'rotate', 'icon', 'sequence', 'drag', 'code', 'path'];
5
+ const DEFAULT_TEXT_POOL = '春夏秋冬诚信安全智慧服务登录验证用户数据网络星辰山河风云花鸟';
6
+ const CHOICE_COLORS = ['#f72585', '#4361ee', '#4cc9f0', '#38b000', '#f77f00', '#8338ec'];
7
+ const PUZZLE_SHAPES = ['a', 'b'];
8
+ const DEFAULT_ICON_POOL = [
9
+ { value: '★', label: '星星' },
10
+ { value: '♥', label: '爱心' },
11
+ { value: '☀', label: '太阳' },
12
+ { value: '☁', label: '云朵' },
13
+ { value: '✦', label: '闪光' },
14
+ { value: '✿', label: '花朵' },
15
+ { value: '◆', label: '菱形' },
16
+ { value: '♣', label: '梅花' },
17
+ ];
18
+ const SEQUENCE_COLORS = [
19
+ { value: '#ef476f', label: '红色' },
20
+ { value: '#4361ee', label: '蓝色' },
21
+ { value: '#06b6a4', label: '绿色' },
22
+ { value: '#f59e0b', label: '橙色' },
23
+ ];
24
+ const SEQUENCE_SHAPES = [
25
+ { value: 'circle', label: '圆形' },
26
+ { value: 'square', label: '方形' },
27
+ { value: 'triangle', label: '三角形' },
28
+ { value: 'diamond', label: '菱形' },
29
+ ];
30
+ const DRAG_SHAPES = ['circle', 'square', 'triangle', 'diamond'];
31
+ const PUZZLE_PATHS = {
32
+ a: 'M10,10H38C38,-2,62,-2,62,10H90V38C102,38,102,62,90,62V90H62C62,78,38,78,38,90H10V62C-2,62,-2,38,10,38Z',
33
+ b: 'M10,10H38C38,22,62,22,62,10H90V38C78,38,78,62,90,62V90H62C62,102,38,102,38,90H10V62C22,62,22,38,10,38Z',
34
+ };
35
+
36
+ const randomInt = (min, max) => {
37
+ const start = Math.ceil(min);
38
+ const end = Math.floor(max);
39
+ return Math.floor(Math.random() * (end - start + 1)) + start;
40
+ };
41
+
42
+ const shuffle = (list) => {
43
+ const result = [...list];
44
+ for (let index = result.length - 1; index > 0; index -= 1) {
45
+ const randomIndex = randomInt(0, index);
46
+ [result[index], result[randomIndex]] = [result[randomIndex], result[index]];
47
+ }
48
+ return result;
49
+ };
50
+
51
+ const toCssUrl = (value) => `url(${JSON.stringify(String(value))})`;
52
+
53
+ var script = create({
54
+ name: 'captcha',
55
+ emits: ['update:modelValue', 'change', 'success', 'fail', 'refresh'],
56
+ expose: ['refresh', 'reset', 'verify'],
57
+ props: {
58
+ modelValue: {
59
+ type: Boolean,
60
+ default: false,
61
+ },
62
+ type: {
63
+ type: String,
64
+ default: 'slider',
65
+ validator: (value) => CAPTCHA_TYPES.includes(value),
66
+ },
67
+ width: {
68
+ type: [Number, String],
69
+ default: 320,
70
+ },
71
+ height: {
72
+ type: Number,
73
+ default: 160,
74
+ },
75
+ pieceSize: {
76
+ type: Number,
77
+ default: 42,
78
+ },
79
+ tolerance: {
80
+ type: Number,
81
+ default: 6,
82
+ },
83
+ sliderTargetCount: {
84
+ type: Number,
85
+ default: 2,
86
+ },
87
+ rotateStep: {
88
+ type: Number,
89
+ default: 30,
90
+ },
91
+ image: {
92
+ type: String,
93
+ default: '',
94
+ },
95
+ backgroundImage: {
96
+ type: String,
97
+ default: '',
98
+ },
99
+ backgroundSize: {
100
+ type: String,
101
+ default: 'cover',
102
+ },
103
+ backgroundPosition: {
104
+ type: String,
105
+ default: 'center',
106
+ },
107
+ disabled: {
108
+ type: Boolean,
109
+ default: false,
110
+ },
111
+ autoRefresh: {
112
+ type: Boolean,
113
+ default: true,
114
+ },
115
+ refreshDelay: {
116
+ type: Number,
117
+ default: 900,
118
+ },
119
+ targetText: {
120
+ type: [String, Array],
121
+ default: '',
122
+ },
123
+ textPool: {
124
+ type: [String, Array],
125
+ default: DEFAULT_TEXT_POOL,
126
+ },
127
+ textOptionCount: {
128
+ type: Number,
129
+ default: 8,
130
+ },
131
+ targetIcon: {
132
+ type: String,
133
+ default: '',
134
+ },
135
+ iconPool: {
136
+ type: Array,
137
+ default: () => DEFAULT_ICON_POOL,
138
+ },
139
+ iconOptionCount: {
140
+ type: Number,
141
+ default: 6,
142
+ },
143
+ sequenceLength: {
144
+ type: Number,
145
+ default: 3,
146
+ },
147
+ dragTolerance: {
148
+ type: Number,
149
+ default: 16,
150
+ },
151
+ mathQuestion: {
152
+ type: String,
153
+ default: '',
154
+ },
155
+ mathAnswer: {
156
+ type: [Number, String],
157
+ default: undefined,
158
+ },
159
+ mathOptions: {
160
+ type: Array,
161
+ default: () => [],
162
+ },
163
+ mathOptionCount: {
164
+ type: Number,
165
+ default: 4,
166
+ },
167
+ codeLength: {
168
+ type: Number,
169
+ default: 4,
170
+ },
171
+ codeCharacters: {
172
+ type: String,
173
+ default: '23456789ABCDEFGHJKLMNPQRSTUVWXYZ',
174
+ },
175
+ codeCaseSensitive: {
176
+ type: Boolean,
177
+ default: false,
178
+ },
179
+ },
180
+ data() {
181
+ return {
182
+ codeInput: '',
183
+ codeInputId: `captcha-code-${Math.random().toString(36).slice(2, 10)}`,
184
+ codeValue: '',
185
+ dragActive: false,
186
+ dragColor: '#4361ee',
187
+ dragOffset: {x: 0, y: 0},
188
+ dragShape: 'circle',
189
+ dragSource: {x: 20, y: 20},
190
+ dragStartOffset: {x: 0, y: 0},
191
+ dragStartX: 0,
192
+ dragStartY: 0,
193
+ dragTarget: {x: 180, y: 80},
194
+ dragging: false,
195
+ expectedMathAnswer: '',
196
+ iconOptions: [],
197
+ iconTarget: {},
198
+ mathExpression: '',
199
+ mathResultOptions: [],
200
+ message: '',
201
+ pathActive: false,
202
+ pathDragStartProgress: 0,
203
+ pathDragStartX: 0,
204
+ pathProgress: 0,
205
+ pieceShape: 'a',
206
+ pieceTop: 24,
207
+ puzzleId: `captcha-puzzle-${Math.random().toString(36).slice(2, 10)}`,
208
+ refreshTimer: null,
209
+ rotation: 0,
210
+ selectedSequenceIds: [],
211
+ selectedTextIds: [],
212
+ sequenceOptions: [],
213
+ sequenceTargets: [],
214
+ sliderOffset: 0,
215
+ sliderTarget: 0,
216
+ sliderTargets: [],
217
+ status: 'ready',
218
+ textOptions: [],
219
+ textTargets: [],
220
+ verified: false,
221
+ };
222
+ },
223
+ computed: {
224
+ captchaType() {
225
+ return CAPTCHA_TYPES.includes(this.type) ? this.type : 'slider';
226
+ },
227
+ rootStyle() {
228
+ return { width: this.setPx(this.width) };
229
+ },
230
+ safeHeight() {
231
+ return Math.max(96, Number(this.height) || 160);
232
+ },
233
+ safePieceSize() {
234
+ return Math.min(Math.max(30, Number(this.pieceSize) || 42), this.safeHeight - 20);
235
+ },
236
+ sliderMax() {
237
+ return Math.max(1, this.getSceneWidth() - this.safePieceSize - 8);
238
+ },
239
+ sceneStyle() {
240
+ const style = { height: `${this.safeHeight}px` };
241
+ if (this.backgroundSource) {
242
+ style.backgroundImage = toCssUrl(this.backgroundSource);
243
+ style.backgroundSize = this.backgroundSize;
244
+ style.backgroundPosition = this.backgroundPosition;
245
+ }
246
+ return style;
247
+ },
248
+ backgroundSource() {
249
+ return this.backgroundImage || this.image;
250
+ },
251
+ pieceStyle() {
252
+ return {
253
+ width: `${this.safePieceSize}px`,
254
+ height: `${this.safePieceSize}px`,
255
+ top: `${this.pieceTop}px`,
256
+ transform: `translateX(${this.sliderOffset}px)`,
257
+ };
258
+ },
259
+ piecePath() {
260
+ return this.getPuzzlePath(this.pieceShape);
261
+ },
262
+ pieceClipId() {
263
+ return `${this.puzzleId}-clip`;
264
+ },
265
+ pieceGradientId() {
266
+ return `${this.puzzleId}-gradient`;
267
+ },
268
+ progressStyle() {
269
+ return { width: `${Math.min(100, ((this.sliderOffset + 20) / this.sliderMax) * 100)}%` };
270
+ },
271
+ sliderButtonStyle() {
272
+ return { transform: `translateX(${this.sliderOffset}px)` };
273
+ },
274
+ sliderTip() {
275
+ if (this.verified) return '验证通过';
276
+ if (this.dragging) return '松开以完成验证';
277
+ return '拖动滑块匹配正确缺口';
278
+ },
279
+ targetTextLabel() {
280
+ return this.textTargets.join(' ');
281
+ },
282
+ sequenceTargetLabel() {
283
+ return this.sequenceTargets.map((item) => item.label).join(' → ');
284
+ },
285
+ choiceFontSize() {
286
+ const width = this.getSceneWidth();
287
+ return Math.max(16, Math.min(22, Math.floor(Math.min(width / 14, this.safeHeight / 6.5))));
288
+ },
289
+ mathChoiceFontSize() {
290
+ const width = this.getSceneWidth();
291
+ return Math.max(14, Math.min(18, Math.floor(Math.min(width / 16, this.safeHeight / 8))));
292
+ },
293
+ rotateDialStyle() {
294
+ return { transform: `rotate(${this.rotation}deg)` };
295
+ },
296
+ dragSize() {
297
+ return 42;
298
+ },
299
+ dragCurrentPosition() {
300
+ return {
301
+ x: this.dragSource.x + this.dragOffset.x,
302
+ y: this.dragSource.y + this.dragOffset.y,
303
+ };
304
+ },
305
+ dragPieceStyle() {
306
+ return {
307
+ width: `${this.dragSize}px`,
308
+ height: `${this.dragSize}px`,
309
+ left: `${this.dragCurrentPosition.x}px`,
310
+ top: `${this.dragCurrentPosition.y}px`,
311
+ backgroundColor: this.dragColor,
312
+ };
313
+ },
314
+ dragTargetStyle() {
315
+ return {
316
+ width: `${this.dragSize}px`,
317
+ height: `${this.dragSize}px`,
318
+ left: `${this.dragTarget.x}px`,
319
+ top: `${this.dragTarget.y}px`,
320
+ borderColor: this.dragColor,
321
+ };
322
+ },
323
+ pathStartPoint() {
324
+ return this.getPathPoint(0);
325
+ },
326
+ pathEndPoint() {
327
+ return this.getPathPoint(1);
328
+ },
329
+ pathMarkerStyle() {
330
+ const point = this.getPathPoint(this.pathProgress);
331
+ return {
332
+ left: `${point.x - 15}px`,
333
+ top: `${point.y - 15}px`,
334
+ };
335
+ },
336
+ pathLine() {
337
+ const start = this.pathStartPoint;
338
+ const end = this.pathEndPoint;
339
+ const controlY = Math.max(16, this.safeHeight * 0.14);
340
+ return `M ${start.x} ${start.y} Q ${this.getSceneWidth() / 2} ${controlY} ${end.x} ${end.y}`;
341
+ },
342
+ safeCodeLength() {
343
+ return Math.min(Math.max(Number(this.codeLength) || 4, 3), 8);
344
+ },
345
+ codeChars() {
346
+ return this.codeValue.split('');
347
+ },
348
+ },
349
+ watch: {
350
+ modelValue(value) {
351
+ if (value === false && this.verified) this.refresh();
352
+ },
353
+ type() {
354
+ this.refresh();
355
+ },
356
+ targetText: {
357
+ handler() {
358
+ if (this.captchaType === 'text') this.refresh();
359
+ },
360
+ deep: true,
361
+ },
362
+ mathQuestion() {
363
+ if (this.captchaType === 'math') this.refresh();
364
+ },
365
+ mathAnswer() {
366
+ if (this.captchaType === 'math') this.refresh();
367
+ },
368
+ mathOptions: {
369
+ handler() {
370
+ if (this.captchaType === 'math') this.refresh();
371
+ },
372
+ deep: true,
373
+ },
374
+ sliderTargetCount() {
375
+ if (this.captchaType === 'slider') this.refresh();
376
+ },
377
+ targetIcon() {
378
+ if (this.captchaType === 'icon') this.refresh();
379
+ },
380
+ iconPool: {
381
+ handler() {
382
+ if (this.captchaType === 'icon') this.refresh();
383
+ },
384
+ deep: true,
385
+ },
386
+ sequenceLength() {
387
+ if (this.captchaType === 'sequence') this.refresh();
388
+ },
389
+ codeLength() {
390
+ if (this.captchaType === 'code') this.refresh();
391
+ },
392
+ codeCharacters() {
393
+ if (this.captchaType === 'code') this.refresh();
394
+ },
395
+ },
396
+ mounted() {
397
+ this.$nextTick(() => this.refresh());
398
+ },
399
+ beforeUnmount() {
400
+ this.clearRefreshTimer();
401
+ this.stopSlide();
402
+ this.stopDrag();
403
+ this.stopPath();
404
+ },
405
+ methods: {
406
+ getSceneWidth() {
407
+ const width = this.$refs.scene?.clientWidth;
408
+ if (width) return width;
409
+ const propWidth = Number(this.width);
410
+ return Number.isFinite(propWidth) && propWidth > 0 ? propWidth : 320;
411
+ },
412
+ refresh() {
413
+ this.clearRefreshTimer();
414
+ this.stopSlide();
415
+ this.stopDrag();
416
+ this.stopPath();
417
+ this.verified = false;
418
+ this.status = 'ready';
419
+ this.message = '';
420
+ this.sliderOffset = 0;
421
+ this.selectedTextIds = [];
422
+ this.selectedSequenceIds = [];
423
+ this.dragOffset = { x: 0, y: 0 };
424
+ this.pathProgress = 0;
425
+ if (this.captchaType === 'slider') this.createSliderChallenge();
426
+ if (this.captchaType === 'text') this.createTextChallenge();
427
+ if (this.captchaType === 'math') this.createMathChallenge();
428
+ if (this.captchaType === 'rotate') this.createRotateChallenge();
429
+ if (this.captchaType === 'icon') this.createIconChallenge();
430
+ if (this.captchaType === 'sequence') this.createSequenceChallenge();
431
+ if (this.captchaType === 'drag') this.createDragChallenge();
432
+ if (this.captchaType === 'code') this.createCodeChallenge();
433
+ this.updateValue(false);
434
+ this.$emit('refresh', { type: this.captchaType });
435
+ },
436
+ reset() {
437
+ this.refresh();
438
+ },
439
+ createSliderChallenge() {
440
+ const targetCount = Math.min(4, Math.max(1, Number(this.sliderTargetCount) || 2));
441
+ const correctShapeIndex = randomInt(0, PUZZLE_SHAPES.length - 1);
442
+ const targets = [];
443
+ for (let index = 0; index < targetCount; index += 1) {
444
+ let shapeIndex = correctShapeIndex;
445
+ if (index > 0) {
446
+ const shapeCandidates = PUZZLE_SHAPES.map((_, shapeIndex) => shapeIndex)
447
+ .filter((shapeIndex) => shapeIndex !== correctShapeIndex);
448
+ shapeIndex = shapeCandidates[randomInt(0, shapeCandidates.length - 1)];
449
+ }
450
+ const position = this.createSliderTargetPosition(targets);
451
+ targets.push({
452
+ id: `target-${index}`,
453
+ correct: index === 0,
454
+ shape: PUZZLE_SHAPES[shapeIndex],
455
+ ...position,
456
+ });
457
+ }
458
+ const correctTarget = targets[0];
459
+ this.sliderTargets = shuffle(targets);
460
+ this.sliderTarget = correctTarget.x;
461
+ this.pieceTop = correctTarget.y;
462
+ this.pieceShape = correctTarget.shape;
463
+ },
464
+ createCodeChallenge() {
465
+ const characters = [...new Set(String(this.codeCharacters || '').split('').filter(Boolean))];
466
+ const pool = characters.length ? characters : '23456789ABCDEFGHJKLMNPQRSTUVWXYZ'.split('');
467
+ const values = new Uint32Array(this.safeCodeLength);
468
+ if (typeof crypto !== 'undefined' && crypto.getRandomValues) {
469
+ crypto.getRandomValues(values);
470
+ }
471
+ this.codeValue = Array.from({ length: this.safeCodeLength }, (_, index) => {
472
+ const random = values[index] || Math.floor(Math.random() * 0x100000000);
473
+ return pool[random % pool.length];
474
+ }).join('');
475
+ this.codeInput = '';
476
+ },
477
+ createSliderTargetPosition(targets) {
478
+ const maxX = this.sliderMax;
479
+ const minTarget = Math.min(Math.max(20, Math.round(maxX * 0.28)), maxX);
480
+ const minY = 10;
481
+ const maxY = Math.max(minY, this.safeHeight - this.safePieceSize - 10);
482
+ const minDistance = this.safePieceSize * 1.55;
483
+ for (let attempt = 0; attempt < 100; attempt += 1) {
484
+ const position = {
485
+ x: randomInt(minTarget, maxX),
486
+ y: randomInt(minY, maxY),
487
+ };
488
+ const available = targets.every((target) => {
489
+ const xDistance = target.x - position.x;
490
+ const yDistance = target.y - position.y;
491
+ return xDistance * xDistance + yDistance * yDistance >= minDistance * minDistance;
492
+ });
493
+ if (available) return position;
494
+ }
495
+ const index = targets.length;
496
+ return {
497
+ x: Math.max(minTarget, maxX - index * (this.safePieceSize + 8)),
498
+ y: minY + ((maxY - minY) * (index % 2)),
499
+ };
500
+ },
501
+ getSliderTargetStyle(target) {
502
+ return {
503
+ width: `${this.safePieceSize}px`,
504
+ height: `${this.safePieceSize}px`,
505
+ left: `${target.x}px`,
506
+ top: `${target.y}px`,
507
+ };
508
+ },
509
+ getPuzzlePath(shape) {
510
+ return PUZZLE_PATHS[shape] || PUZZLE_PATHS.a;
511
+ },
512
+ createTextChallenge() {
513
+ const pool = Array.isArray(this.textPool) ? this.textPool : String(this.textPool).split('');
514
+ const uniquePool = [...new Set(pool.filter(Boolean))];
515
+ const providedTargets = Array.isArray(this.targetText)
516
+ ? this.targetText
517
+ : String(this.targetText || '').split('').filter(Boolean);
518
+ const targetCount = Math.min(3, Math.max(1, providedTargets.length || 2));
519
+ this.textTargets = providedTargets.length
520
+ ? providedTargets.slice(0, targetCount)
521
+ : shuffle(uniquePool).slice(0, targetCount);
522
+ const optionCount = Math.max(this.textTargets.length, Number(this.textOptionCount) || 8);
523
+ const options = [...this.textTargets];
524
+ shuffle(uniquePool).forEach((item) => {
525
+ if (options.length < optionCount && !options.includes(item)) options.push(item);
526
+ });
527
+ this.textOptions = this.createChoiceOptions(shuffle(options), 16);
528
+ },
529
+ createMathChallenge() {
530
+ if (this.mathQuestion && this.mathAnswer !== undefined) {
531
+ this.mathExpression = this.mathQuestion;
532
+ this.expectedMathAnswer = String(this.mathAnswer).trim();
533
+ this.createMathOptions();
534
+ return;
535
+ }
536
+ const first = randomInt(5, 20);
537
+ const second = randomInt(1, 9);
538
+ const isSubtraction = Math.random() > 0.5;
539
+ this.mathExpression = isSubtraction ? `${first} − ${second} = ?` : `${first} + ${second} = ?`;
540
+ this.expectedMathAnswer = String(isSubtraction ? first - second : first + second);
541
+ this.createMathOptions();
542
+ },
543
+ createMathOptions() {
544
+ const answer = this.expectedMathAnswer;
545
+ const providedOptions = this.mathOptions.map((item) => String(item).trim()).filter(Boolean);
546
+ const optionCount = Math.max(2, Number(this.mathOptionCount) || 4);
547
+ const options = [...new Set(providedOptions)];
548
+ if (!options.includes(answer)) options.push(answer);
549
+ const answerNumber = Number(answer);
550
+ let attempts = 0;
551
+ while (options.length < optionCount && Number.isFinite(answerNumber) && attempts < 100) {
552
+ attempts += 1;
553
+ const offset = randomInt(-8, 8) || 1;
554
+ const result = String(Math.max(0, answerNumber + offset));
555
+ if (!options.includes(result)) options.push(result);
556
+ }
557
+ this.mathResultOptions = this.createChoiceOptions(shuffle(options), 20);
558
+ },
559
+ createRotateChallenge() {
560
+ const step = Math.max(1, Number(this.rotateStep) || 30);
561
+ this.rotation = randomInt(1, Math.max(1, Math.floor(360 / step) - 1)) * step;
562
+ },
563
+ createIconChallenge() {
564
+ const pool = this.iconPool
565
+ .map((item) => (typeof item === 'string' ? { value: item, label: item } : item))
566
+ .filter((item) => item && item.value && item.label);
567
+ const options = shuffle(pool).slice(0, Math.max(2, Number(this.iconOptionCount) || 6));
568
+ const target = pool.find((item) => item.value === this.targetIcon || item.label === this.targetIcon)
569
+ || options[0]
570
+ || DEFAULT_ICON_POOL[0];
571
+ if (!options.some((item) => item.value === target.value)) options[0] = target;
572
+ const positions = [];
573
+ this.iconTarget = target;
574
+ this.iconOptions = shuffle(options).map((item, index) => {
575
+ const position = this.createChoicePosition(positions, 16, options.length, index, 46);
576
+ positions.push(position);
577
+ return {
578
+ id: `icon-${item.value}-${index}`,
579
+ ...item,
580
+ ...position,
581
+ color: CHOICE_COLORS[randomInt(0, CHOICE_COLORS.length - 1)],
582
+ rotate: randomInt(-15, 15),
583
+ };
584
+ });
585
+ },
586
+ createSequenceChallenge() {
587
+ const options = [];
588
+ while (options.length < 6) {
589
+ const color = SEQUENCE_COLORS[randomInt(0, SEQUENCE_COLORS.length - 1)];
590
+ const shape = SEQUENCE_SHAPES[randomInt(0, SEQUENCE_SHAPES.length - 1)];
591
+ const id = `${color.value}-${shape.value}`;
592
+ if (!options.some((item) => item.id === id)) {
593
+ options.push({ id, color: color.value, shape: shape.value, label: `${color.label}${shape.label}` });
594
+ }
595
+ }
596
+ const targetLength = Math.min(options.length, Math.max(2, Number(this.sequenceLength) || 3));
597
+ this.sequenceTargets = shuffle(options).slice(0, targetLength);
598
+ const positions = [];
599
+ this.sequenceOptions = shuffle(options).map((item, index) => {
600
+ const position = this.createChoicePosition(positions, 16, options.length, index, 48);
601
+ positions.push(position);
602
+ return { ...item, ...position };
603
+ });
604
+ },
605
+ createDragChallenge() {
606
+ const size = this.dragSize;
607
+ const sceneWidth = this.getSceneWidth();
608
+ const maxX = Math.max(16, sceneWidth - size - 16);
609
+ const maxY = Math.max(16, this.safeHeight - size - 16);
610
+ this.dragShape = DRAG_SHAPES[randomInt(0, DRAG_SHAPES.length - 1)];
611
+ this.dragColor = CHOICE_COLORS[randomInt(0, CHOICE_COLORS.length - 1)];
612
+ this.dragSource = { x: randomInt(16, Math.max(16, Math.round(maxX * 0.35))), y: randomInt(16, maxY) };
613
+ let target = { x: maxX, y: maxY };
614
+ for (let attempt = 0; attempt < 80; attempt += 1) {
615
+ const candidate = { x: randomInt(16, maxX), y: randomInt(16, maxY) };
616
+ const xDistance = candidate.x - this.dragSource.x;
617
+ const yDistance = candidate.y - this.dragSource.y;
618
+ if (xDistance * xDistance + yDistance * yDistance >= (size * 1.7) ** 2) {
619
+ target = candidate;
620
+ break;
621
+ }
622
+ }
623
+ this.dragTarget = target;
624
+ },
625
+ createChoiceOptions(values, top, optionSize) {
626
+ const positions = [];
627
+ return values.map((value, index) => {
628
+ const position = this.createChoicePosition(positions, top, values.length, index, optionSize);
629
+ positions.push(position);
630
+ return {
631
+ id: `${value}-${index}`,
632
+ value,
633
+ ...position,
634
+ color: CHOICE_COLORS[randomInt(0, CHOICE_COLORS.length - 1)],
635
+ rotate: randomInt(-18, 18),
636
+ };
637
+ });
638
+ },
639
+ createChoicePosition(positions, top, count, index, optionSize) {
640
+ const fontSize = optionSize || (this.captchaType === 'math' ? this.mathChoiceFontSize : this.choiceFontSize);
641
+ const hitAreaSize = Math.max(fontSize, 42);
642
+ const sceneWidth = this.getSceneWidth();
643
+ const sidePadding = 18;
644
+ const minX = sidePadding;
645
+ const maxX = Math.max(minX, sceneWidth - hitAreaSize - sidePadding);
646
+ const minY = Math.min(top, this.safeHeight - hitAreaSize - 8);
647
+ const maxY = Math.max(minY, this.safeHeight - hitAreaSize - 10);
648
+ const minDistance = Math.max(hitAreaSize, 34);
649
+
650
+ for (let attempt = 0; attempt < 100; attempt += 1) {
651
+ const position = {
652
+ x: randomInt(minX, maxX),
653
+ y: randomInt(minY, maxY),
654
+ };
655
+ const available = positions.every((item) => {
656
+ const xDistance = item.x - position.x;
657
+ const yDistance = item.y - position.y;
658
+ return xDistance * xDistance + yDistance * yDistance >= minDistance * minDistance;
659
+ });
660
+ if (available) return position;
661
+ }
662
+
663
+ const columns = Math.min(4, Math.max(2, Math.ceil(Math.sqrt(count * 1.5))));
664
+ const rows = Math.ceil(count / columns);
665
+ const column = index % columns;
666
+ const row = Math.floor(index / columns);
667
+ return {
668
+ x: Math.round(minX + ((maxX - minX) * (column + 0.5)) / columns),
669
+ y: Math.round(minY + ((maxY - minY) * (row + 0.5)) / Math.max(1, rows)),
670
+ };
671
+ },
672
+ getChoiceOptionStyle(item) {
673
+ const isMath = this.captchaType === 'math';
674
+ return {
675
+ left: `${item.x}px`,
676
+ top: `${item.y}px`,
677
+ color: item.color,
678
+ fontSize: `${isMath ? this.mathChoiceFontSize : this.choiceFontSize}px`,
679
+ transform: `rotate(${item.rotate}deg)`,
680
+ };
681
+ },
682
+ getIconOptionStyle(item) {
683
+ return {
684
+ left: `${item.x}px`,
685
+ top: `${item.y}px`,
686
+ color: item.color,
687
+ transform: `rotate(${item.rotate}deg)`,
688
+ };
689
+ },
690
+ getSequenceOptionStyle(item) {
691
+ return {
692
+ left: `${item.x}px`,
693
+ top: `${item.y}px`,
694
+ backgroundColor: item.color,
695
+ };
696
+ },
697
+ getPathPoint(progress) {
698
+ const width = this.getSceneWidth();
699
+ const startX = 30;
700
+ const endX = Math.max(startX, width - 30);
701
+ const t = Math.min(1, Math.max(0, progress));
702
+ return {
703
+ x: startX + (endX - startX) * t,
704
+ y: this.safeHeight - 28 - Math.sin(Math.PI * t) * this.safeHeight * 0.42,
705
+ };
706
+ },
707
+ rotateCaptcha(direction) {
708
+ if (this.disabled || this.verified) return;
709
+ const step = Math.max(1, Number(this.rotateStep) || 30);
710
+ this.rotation = ((this.rotation + direction * step) % 360 + 360) % 360;
711
+ this.status = 'ready';
712
+ this.message = '';
713
+ if (this.rotation === 0) this.succeed();
714
+ },
715
+ selectIcon(item) {
716
+ if (this.disabled || this.verified) return;
717
+ if (item.value === this.iconTarget.value) {
718
+ this.succeed();
719
+ } else {
720
+ this.fail('图标不正确,请重试');
721
+ }
722
+ },
723
+ selectSequence(item) {
724
+ if (this.disabled || this.verified || this.selectedSequenceIds.includes(item.id)) return;
725
+ const selectedIndex = this.selectedSequenceIds.length;
726
+ if (item.id !== this.sequenceTargets[selectedIndex]?.id) {
727
+ this.fail('点击顺序不正确,请重试');
728
+ return;
729
+ }
730
+ this.selectedSequenceIds.push(item.id);
731
+ if (this.selectedSequenceIds.length === this.sequenceTargets.length) this.succeed();
732
+ },
733
+ startDrag(event) {
734
+ if (this.disabled || this.verified) return;
735
+ this.dragActive = true;
736
+ this.status = 'ready';
737
+ this.message = '';
738
+ this.dragStartX = event.clientX;
739
+ this.dragStartY = event.clientY;
740
+ this.dragStartOffset = { ...this.dragOffset };
741
+ window.addEventListener('pointermove', this.moveDrag);
742
+ window.addEventListener('pointerup', this.finishDrag);
743
+ window.addEventListener('pointercancel', this.finishDrag);
744
+ },
745
+ moveDrag(event) {
746
+ if (!this.dragActive) return;
747
+ const sceneWidth = this.getSceneWidth();
748
+ const maxX = Math.max(0, sceneWidth - this.dragSize - this.dragSource.x);
749
+ const maxY = Math.max(0, this.safeHeight - this.dragSize - this.dragSource.y);
750
+ const minX = -this.dragSource.x;
751
+ const minY = -this.dragSource.y;
752
+ this.dragOffset = {
753
+ x: Math.min(maxX, Math.max(minX, this.dragStartOffset.x + event.clientX - this.dragStartX)),
754
+ y: Math.min(maxY, Math.max(minY, this.dragStartOffset.y + event.clientY - this.dragStartY)),
755
+ };
756
+ },
757
+ finishDrag() {
758
+ if (!this.dragActive) return;
759
+ const position = this.dragCurrentPosition;
760
+ const xDistance = position.x - this.dragTarget.x;
761
+ const yDistance = position.y - this.dragTarget.y;
762
+ const tolerance = Math.max(4, Number(this.dragTolerance) || 16);
763
+ this.stopDrag();
764
+ if (xDistance * xDistance + yDistance * yDistance <= tolerance * tolerance) {
765
+ this.succeed();
766
+ } else {
767
+ this.fail('位置不正确,请重试');
768
+ }
769
+ },
770
+ stopDrag() {
771
+ this.dragActive = false;
772
+ if (typeof window === 'undefined') return;
773
+ window.removeEventListener('pointermove', this.moveDrag);
774
+ window.removeEventListener('pointerup', this.finishDrag);
775
+ window.removeEventListener('pointercancel', this.finishDrag);
776
+ },
777
+ startPath(event) {
778
+ if (this.disabled || this.verified) return;
779
+ this.pathActive = true;
780
+ this.status = 'ready';
781
+ this.message = '';
782
+ this.pathDragStartX = event.clientX;
783
+ this.pathDragStartProgress = this.pathProgress;
784
+ window.addEventListener('pointermove', this.movePath);
785
+ window.addEventListener('pointerup', this.finishPath);
786
+ window.addEventListener('pointercancel', this.finishPath);
787
+ },
788
+ movePath(event) {
789
+ if (!this.pathActive) return;
790
+ const usableWidth = Math.max(1, this.getSceneWidth() - 60);
791
+ this.pathProgress = Math.min(1, Math.max(0, this.pathDragStartProgress + (event.clientX - this.pathDragStartX) / usableWidth));
792
+ },
793
+ finishPath() {
794
+ if (!this.pathActive) return;
795
+ const passed = this.pathProgress >= 0.95;
796
+ this.stopPath();
797
+ if (passed) {
798
+ this.pathProgress = 1;
799
+ this.succeed();
800
+ } else {
801
+ this.fail('请沿轨迹滑动到终点');
802
+ }
803
+ },
804
+ stopPath() {
805
+ this.pathActive = false;
806
+ if (typeof window === 'undefined') return;
807
+ window.removeEventListener('pointermove', this.movePath);
808
+ window.removeEventListener('pointerup', this.finishPath);
809
+ window.removeEventListener('pointercancel', this.finishPath);
810
+ },
811
+ startSlide(event) {
812
+ if (this.disabled || this.verified) return;
813
+ this.dragging = true;
814
+ this.status = 'ready';
815
+ this.message = '';
816
+ this.dragStartX = event.clientX;
817
+ this.dragStartOffset = this.sliderOffset;
818
+ window.addEventListener('pointermove', this.moveSlide);
819
+ window.addEventListener('pointerup', this.finishSlide);
820
+ window.addEventListener('pointercancel', this.finishSlide);
821
+ },
822
+ moveSlide(event) {
823
+ if (!this.dragging) return;
824
+ const offset = this.dragStartOffset + event.clientX - this.dragStartX;
825
+ this.sliderOffset = Math.min(this.sliderMax, Math.max(0, offset));
826
+ },
827
+ finishSlide() {
828
+ if (!this.dragging) return;
829
+ const passed = Math.abs(this.sliderOffset - this.sliderTarget) <= Math.max(1, Number(this.tolerance) || 6);
830
+ this.stopSlide();
831
+ if (passed) {
832
+ this.succeed();
833
+ } else {
834
+ this.fail('位置不正确,请重试');
835
+ }
836
+ },
837
+ stopSlide() {
838
+ this.dragging = false;
839
+ if (typeof window === 'undefined') return;
840
+ window.removeEventListener('pointermove', this.moveSlide);
841
+ window.removeEventListener('pointerup', this.finishSlide);
842
+ window.removeEventListener('pointercancel', this.finishSlide);
843
+ },
844
+ selectText(item) {
845
+ if (this.disabled || this.verified || this.selectedTextIds.includes(item.id)) return;
846
+ const selectedIndex = this.selectedTextIds.length;
847
+ if (item.value !== this.textTargets[selectedIndex]) {
848
+ this.fail('点击顺序不正确,请重试');
849
+ return;
850
+ }
851
+ this.selectedTextIds.push(item.id);
852
+ if (this.selectedTextIds.length === this.textTargets.length) this.succeed();
853
+ },
854
+ selectMath(item) {
855
+ if (this.disabled || this.verified) return;
856
+ if (item.value === this.expectedMathAnswer) {
857
+ this.succeed();
858
+ } else {
859
+ this.fail('结果不正确,请重试');
860
+ }
861
+ },
862
+ verify(value) {
863
+ if (value === undefined) return;
864
+ if (this.captchaType === 'math') {
865
+ this.selectMath({ value: String(value).trim() });
866
+ return;
867
+ }
868
+ if (this.captchaType !== 'code' || this.disabled || this.verified) return;
869
+ const input = String(value).trim();
870
+ const expected = this.codeCaseSensitive ? this.codeValue : this.codeValue.toUpperCase();
871
+ const actual = this.codeCaseSensitive ? input : input.toUpperCase();
872
+ if (actual === expected) this.succeed();
873
+ else this.fail('验证码不正确,请重试');
874
+ },
875
+ succeed() {
876
+ this.clearRefreshTimer();
877
+ this.verified = true;
878
+ this.status = 'success';
879
+ this.message = '验证通过';
880
+ this.updateValue(true);
881
+ this.$emit('success', { type: this.captchaType });
882
+ },
883
+ fail(message) {
884
+ this.status = 'error';
885
+ this.message = message;
886
+ this.$emit('fail', { type: this.captchaType, message });
887
+ if (!this.autoRefresh) return;
888
+ this.clearRefreshTimer();
889
+ this.refreshTimer = window.setTimeout(() => this.refresh(), Math.max(0, Number(this.refreshDelay) || 0));
890
+ },
891
+ clearRefreshTimer() {
892
+ if (this.refreshTimer === null) return;
893
+ clearTimeout(this.refreshTimer);
894
+ this.refreshTimer = null;
895
+ },
896
+ updateValue(value) {
897
+ if (this.modelValue === value) return;
898
+ this.$emit('update:modelValue', value);
899
+ this.$emit('change', { value, type: this.captchaType });
900
+ },
901
+ getCodeCharacterStyle(index) {
902
+ const rotations = [-8, 5, -3, 7, -6, 3, 8, -4];
903
+ const offsets = [3, -2, 1, -3, 2, -1, 3, -2];
904
+ return {
905
+ transform: `translateY(${offsets[index % offsets.length]}px) rotate(${rotations[index % rotations.length]}deg)`
906
+ };
907
+ },
908
+ },
909
+ });
910
+
911
+ export { script as default };