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