@zhaoyifannan/tvue 3.9.7 → 3.9.8

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 (707) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/tvue.js +9453 -2344
  3. package/dist/tvue.js.map +1 -1
  4. package/dist/tvue.min.js +3 -3
  5. package/es/_virtual/_commonjs-dynamic-modules.mjs +1 -1
  6. package/es/_virtual/_commonjsHelpers.mjs +1 -1
  7. package/es/_virtual/axios.mjs +1 -1
  8. package/es/_virtual/axios2.mjs +1 -1
  9. package/es/_virtual/countUp.min.mjs +1 -1
  10. package/es/_virtual/countUp2.min.mjs +1 -1
  11. package/es/_virtual/dayjs.min.mjs +1 -1
  12. package/es/_virtual/dayjs2.min.mjs +1 -1
  13. package/es/index.css +1 -1
  14. package/es/locale/browser/en.mjs +7 -1
  15. package/es/locale/browser/zh-cn.mjs +7 -1
  16. package/es/locale/browser/zh.mjs +7 -1
  17. package/es/node_modules/.pnpm/async-validator@4.2.5/node_modules/async-validator/dist-web/index.mjs +1329 -0
  18. package/es/node_modules/.pnpm/countup.js@1.9.3/node_modules/countup.js/dist/countUp.min.mjs +1 -1
  19. package/es/node_modules/.pnpm/dayjs@1.11.23/node_modules/dayjs/dayjs.min.mjs +1 -1
  20. package/es/node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.mjs +1 -1
  21. package/es/node_modules/axios/dist/axios.mjs +1 -1
  22. package/es/packages/core/common/event.mjs +54 -7
  23. package/es/packages/core/common/init.mjs +203 -44
  24. package/es/packages/core/common/props.mjs +11 -4
  25. package/es/packages/core/components/dialog-form/index.mjs +1 -1
  26. package/es/packages/core/components/dialog-form/index2.mjs +1 -1
  27. package/es/packages/core/components/dialog-form/index3.mjs +1 -1
  28. package/es/packages/core/components/dialog-form/index4.mjs +1 -1
  29. package/es/packages/core/components/form/custom.mjs +1 -1
  30. package/es/packages/core/components/form/index.mjs +1 -1
  31. package/es/packages/core/components/form/index2.mjs +1 -1
  32. package/es/packages/core/components/form/index3.mjs +1 -1
  33. package/es/packages/core/components/icon/index.mjs +1 -1
  34. package/es/packages/core/components/icon/index2.mjs +1 -1
  35. package/es/packages/core/components/icon/index3.mjs +1 -1
  36. package/es/packages/core/components/image-preview/index.mjs +1 -1
  37. package/es/packages/core/components/image-preview/index2.mjs +1 -1
  38. package/es/packages/core/components/image-preview/index3.mjs +1 -2
  39. package/es/packages/core/components/image-preview/index4.mjs +1 -1
  40. package/es/packages/core/components/print-preview/index.mjs +8 -0
  41. package/es/packages/core/components/print-preview/index2.mjs +123 -0
  42. package/es/packages/core/components/print-preview/index3.mjs +309 -0
  43. package/es/packages/core/directive/contextmenu.mjs +1 -1
  44. package/es/packages/core/directive/permission.mjs +1 -1
  45. package/es/packages/data/box/index.mjs +1 -1
  46. package/es/packages/data/box/index2.mjs +1 -1
  47. package/es/packages/data/box/index3.mjs +1 -1
  48. package/es/packages/data/card/index.mjs +1 -1
  49. package/es/packages/data/card/index2.mjs +1 -1
  50. package/es/packages/data/card/index3.mjs +1 -1
  51. package/es/packages/data/cardText/index.mjs +1 -1
  52. package/es/packages/data/cardText/index2.mjs +1 -1
  53. package/es/packages/data/cardText/index3.mjs +1 -1
  54. package/es/packages/data/countdown/index.mjs +1 -1
  55. package/es/packages/data/countdown/index2.mjs +1 -1
  56. package/es/packages/data/countdown/index3.mjs +1 -1
  57. package/es/packages/data/dashboard/index.mjs +1 -1
  58. package/es/packages/data/dashboard/index2.mjs +1 -1
  59. package/es/packages/data/dashboard/index3.mjs +1 -1
  60. package/es/packages/data/display/index.mjs +1 -1
  61. package/es/packages/data/display/index2.mjs +1 -1
  62. package/es/packages/data/display/index3.mjs +1 -1
  63. package/es/packages/data/icons/index.mjs +1 -1
  64. package/es/packages/data/icons/index2.mjs +1 -1
  65. package/es/packages/data/icons/index3.mjs +1 -1
  66. package/es/packages/data/imgText/index.mjs +1 -1
  67. package/es/packages/data/imgText/index2.mjs +1 -1
  68. package/es/packages/data/imgText/index3.mjs +1 -1
  69. package/es/packages/data/list/index.mjs +1 -1
  70. package/es/packages/data/list/index2.mjs +1 -1
  71. package/es/packages/data/list/index3.mjs +1 -1
  72. package/es/packages/data/notice/index.mjs +1 -1
  73. package/es/packages/data/notice/index2.mjs +1 -1
  74. package/es/packages/data/notice/index3.mjs +1 -1
  75. package/es/packages/data/operaText/index.mjs +1 -1
  76. package/es/packages/data/operaText/index2.mjs +1 -1
  77. package/es/packages/data/operaText/index3.mjs +1 -1
  78. package/es/packages/data/panel/index.mjs +1 -1
  79. package/es/packages/data/panel/index2.mjs +1 -1
  80. package/es/packages/data/panel/index3.mjs +1 -1
  81. package/es/packages/data/pay/index.mjs +1 -1
  82. package/es/packages/data/pay/index2.mjs +1 -1
  83. package/es/packages/data/pay/index3.mjs +1 -1
  84. package/es/packages/data/price/index.mjs +1 -1
  85. package/es/packages/data/price/index2.mjs +1 -1
  86. package/es/packages/data/price/index3.mjs +1 -1
  87. package/es/packages/data/product/index.mjs +1 -1
  88. package/es/packages/data/product/index2.mjs +1 -1
  89. package/es/packages/data/product/index3.mjs +1 -1
  90. package/es/packages/data/profile/index.mjs +1 -1
  91. package/es/packages/data/profile/index2.mjs +1 -1
  92. package/es/packages/data/profile/index3.mjs +1 -1
  93. package/es/packages/data/progress/index.mjs +1 -1
  94. package/es/packages/data/progress/index2.mjs +1 -1
  95. package/es/packages/data/progress/index3.mjs +1 -1
  96. package/es/packages/data/rank/index.mjs +1 -1
  97. package/es/packages/data/rank/index2.mjs +1 -1
  98. package/es/packages/data/rank/index3.mjs +1 -1
  99. package/es/packages/data/rotate/index.mjs +1 -1
  100. package/es/packages/data/rotate/index2.mjs +1 -1
  101. package/es/packages/data/rotate/index3.mjs +1 -1
  102. package/es/packages/data/statistic/index.mjs +1 -1
  103. package/es/packages/data/statistic/index2.mjs +1 -1
  104. package/es/packages/data/statistic/index3.mjs +1 -1
  105. package/es/packages/data/tabs/index.mjs +1 -1
  106. package/es/packages/data/tabs/index2.mjs +1 -1
  107. package/es/packages/data/tabs/index3.mjs +1 -1
  108. package/es/packages/data/task/index.mjs +1 -1
  109. package/es/packages/data/task/index2.mjs +1 -1
  110. package/es/packages/data/task/index3.mjs +1 -1
  111. package/es/packages/data/weather/index.mjs +1 -1
  112. package/es/packages/data/weather/index2.mjs +1 -1
  113. package/es/packages/data/weather/index3.mjs +1 -1
  114. package/es/packages/element-plus/array/index.mjs +1 -1
  115. package/es/packages/element-plus/array/index2.mjs +1 -1
  116. package/es/packages/element-plus/array/index3.mjs +1 -1
  117. package/es/packages/element-plus/article/index.mjs +1 -1
  118. package/es/packages/element-plus/article/index2.mjs +1 -1
  119. package/es/packages/element-plus/article/index3.mjs +1 -1
  120. package/es/packages/element-plus/captcha/index.mjs +1 -1
  121. package/es/packages/element-plus/captcha/index2.mjs +1 -1
  122. package/es/packages/element-plus/captcha/index3.mjs +1 -1
  123. package/es/packages/element-plus/cascader/index.mjs +1 -1
  124. package/es/packages/element-plus/cascader/index2.mjs +38 -20
  125. package/es/packages/element-plus/cascader/index3.mjs +3 -4
  126. package/es/packages/element-plus/chat/index.mjs +1 -1
  127. package/es/packages/element-plus/chat/index2.mjs +1 -1
  128. package/es/packages/element-plus/chat/index3.mjs +1 -1
  129. package/es/packages/element-plus/checkbox/index.mjs +1 -1
  130. package/es/packages/element-plus/checkbox/index2.mjs +27 -11
  131. package/es/packages/element-plus/checkbox/index3.mjs +1 -1
  132. package/es/packages/element-plus/comment/index.mjs +1 -1
  133. package/es/packages/element-plus/comment/index2.mjs +1 -1
  134. package/es/packages/element-plus/comment/index3.mjs +1 -1
  135. package/es/packages/element-plus/count-up/index.mjs +1 -1
  136. package/es/packages/element-plus/count-up/index2.mjs +1 -1
  137. package/es/packages/element-plus/count-up/index3.mjs +1 -1
  138. package/es/packages/element-plus/crud/column/column-default.mjs +1 -1
  139. package/es/packages/element-plus/crud/column/column-default2.mjs +1 -1
  140. package/es/packages/element-plus/crud/column/column-default3.mjs +1 -1
  141. package/es/packages/element-plus/crud/column/column-dynamic.mjs +1 -1
  142. package/es/packages/element-plus/crud/column/column-dynamic2.mjs +1 -1
  143. package/es/packages/element-plus/crud/column/column-dynamic3.mjs +1 -1
  144. package/es/packages/element-plus/crud/column/column-menu.mjs +1 -1
  145. package/es/packages/element-plus/crud/column/column-menu2.mjs +1 -1
  146. package/es/packages/element-plus/crud/column/column-menu3.mjs +1 -1
  147. package/es/packages/element-plus/crud/column/column-slot.mjs +1 -1
  148. package/es/packages/element-plus/crud/column/column-slot2.mjs +1 -1
  149. package/es/packages/element-plus/crud/column/column-slot3.mjs +1 -1
  150. package/es/packages/element-plus/crud/column/column.mjs +1 -1
  151. package/es/packages/element-plus/crud/column/column2.mjs +1 -1
  152. package/es/packages/element-plus/crud/column/column3.mjs +1 -1
  153. package/es/packages/element-plus/crud/column/menu.mjs +1 -1
  154. package/es/packages/element-plus/crud/column/menu2.mjs +1 -1
  155. package/es/packages/element-plus/crud/column/menu3.mjs +1 -1
  156. package/es/packages/element-plus/crud/config.mjs +6 -1
  157. package/es/packages/element-plus/crud/dialog/dialog-column.mjs +1 -1
  158. package/es/packages/element-plus/crud/dialog/dialog-column2.mjs +1 -1
  159. package/es/packages/element-plus/crud/dialog/dialog-column3.mjs +1 -1
  160. package/es/packages/element-plus/crud/dialog/dialog-excel.mjs +1 -1
  161. package/es/packages/element-plus/crud/dialog/dialog-excel2.mjs +9 -10
  162. package/es/packages/element-plus/crud/dialog/dialog-excel3.mjs +1 -1
  163. package/es/packages/element-plus/crud/dialog/dialog-filter.mjs +1 -1
  164. package/es/packages/element-plus/crud/dialog/dialog-filter2.mjs +1 -1
  165. package/es/packages/element-plus/crud/dialog/dialog-filter3.mjs +1 -1
  166. package/es/packages/element-plus/crud/dialog/dialog-form.mjs +1 -1
  167. package/es/packages/element-plus/crud/dialog/dialog-form2.mjs +14 -10
  168. package/es/packages/element-plus/crud/dialog/dialog-form3.mjs +6 -6
  169. package/es/packages/element-plus/crud/dialog/dialog-import.mjs +8 -0
  170. package/es/packages/element-plus/crud/dialog/dialog-import2.mjs +312 -0
  171. package/es/packages/element-plus/crud/dialog/dialog-import3.mjs +316 -0
  172. package/es/packages/element-plus/crud/grid/index.mjs +1 -1
  173. package/es/packages/element-plus/crud/grid/index2.mjs +1 -1
  174. package/es/packages/element-plus/crud/grid/index3.mjs +1 -1
  175. package/es/packages/element-plus/crud/grid/item.mjs +1 -1
  176. package/es/packages/element-plus/crud/grid/item2.mjs +1 -1
  177. package/es/packages/element-plus/crud/grid/item3.mjs +1 -1
  178. package/es/packages/element-plus/crud/index.mjs +1 -1
  179. package/es/packages/element-plus/crud/index2.mjs +74 -36
  180. package/es/packages/element-plus/crud/index3.mjs +9 -2
  181. package/es/packages/element-plus/crud/menu/header-menu.mjs +1 -1
  182. package/es/packages/element-plus/crud/menu/header-menu2.mjs +18 -4
  183. package/es/packages/element-plus/crud/menu/header-menu3.mjs +35 -9
  184. package/es/packages/element-plus/crud/menu/header-search.mjs +1 -1
  185. package/es/packages/element-plus/crud/menu/header-search2.mjs +1 -1
  186. package/es/packages/element-plus/crud/menu/header-search3.mjs +1 -1
  187. package/es/packages/element-plus/crud/menu/query-views.mjs +8 -0
  188. package/es/packages/element-plus/crud/menu/query-views2.mjs +24 -0
  189. package/es/packages/element-plus/crud/menu/query-views3.mjs +156 -0
  190. package/es/packages/element-plus/crud/menu/table-page.mjs +1 -1
  191. package/es/packages/element-plus/crud/menu/table-page2.mjs +1 -1
  192. package/es/packages/element-plus/crud/menu/table-page3.mjs +1 -1
  193. package/es/packages/element-plus/crud/query-view.mjs +364 -0
  194. package/es/packages/element-plus/date/index.mjs +1 -1
  195. package/es/packages/element-plus/date/index2.mjs +1 -1
  196. package/es/packages/element-plus/date/index3.mjs +1 -1
  197. package/es/packages/element-plus/draggable/index.mjs +1 -1
  198. package/es/packages/element-plus/draggable/index2.mjs +1 -1
  199. package/es/packages/element-plus/draggable/index3.mjs +1 -1
  200. package/es/packages/element-plus/dynamic/index.mjs +1 -1
  201. package/es/packages/element-plus/dynamic/index2.mjs +50 -7
  202. package/es/packages/element-plus/dynamic/index3.mjs +6 -6
  203. package/es/packages/element-plus/file-manager/index.mjs +1 -1
  204. package/es/packages/element-plus/file-manager/index2.mjs +56 -9
  205. package/es/packages/element-plus/file-manager/index3.mjs +1 -1
  206. package/es/packages/element-plus/filter-builder/index.mjs +1 -1
  207. package/es/packages/element-plus/filter-builder/index2.mjs +1 -1
  208. package/es/packages/element-plus/filter-builder/index3.mjs +1 -1
  209. package/es/packages/element-plus/flow/index.mjs +1 -1
  210. package/es/packages/element-plus/flow/index2.mjs +1 -1
  211. package/es/packages/element-plus/flow/index3.mjs +1 -1
  212. package/es/packages/element-plus/flow/node.mjs +1 -1
  213. package/es/packages/element-plus/flow/node2.mjs +1 -1
  214. package/es/packages/element-plus/flow/node3.mjs +1 -1
  215. package/es/packages/element-plus/form/config.mjs +1 -1
  216. package/es/packages/element-plus/form/index.mjs +1 -1
  217. package/es/packages/element-plus/form/index2.mjs +308 -224
  218. package/es/packages/element-plus/form/index3.mjs +4 -4
  219. package/es/packages/element-plus/form/menu.mjs +1 -1
  220. package/es/packages/element-plus/form/menu2.mjs +1 -1
  221. package/es/packages/element-plus/form/menu3.mjs +1 -1
  222. package/es/packages/element-plus/group/index.mjs +1 -1
  223. package/es/packages/element-plus/group/index2.mjs +1 -1
  224. package/es/packages/element-plus/group/index3.mjs +1 -1
  225. package/es/packages/element-plus/iframe/index.mjs +1 -1
  226. package/es/packages/element-plus/iframe/index2.mjs +1 -1
  227. package/es/packages/element-plus/iframe/index3.mjs +1 -1
  228. package/es/packages/element-plus/input/index.mjs +1 -1
  229. package/es/packages/element-plus/input/index2.mjs +1 -1
  230. package/es/packages/element-plus/input/index3.mjs +1 -1
  231. package/es/packages/element-plus/input-color/index.mjs +1 -1
  232. package/es/packages/element-plus/input-color/index2.mjs +1 -1
  233. package/es/packages/element-plus/input-color/index3.mjs +1 -1
  234. package/es/packages/element-plus/input-cron/index.mjs +1 -1
  235. package/es/packages/element-plus/input-cron/index2.mjs +1 -1
  236. package/es/packages/element-plus/input-cron/index3.mjs +1 -1
  237. package/es/packages/element-plus/input-icon/index.mjs +1 -1
  238. package/es/packages/element-plus/input-icon/index2.mjs +1 -1
  239. package/es/packages/element-plus/input-icon/index3.mjs +1 -1
  240. package/es/packages/element-plus/input-map/index.mjs +1 -1
  241. package/es/packages/element-plus/input-map/index2.mjs +93 -28
  242. package/es/packages/element-plus/input-map/index3.mjs +11 -9
  243. package/es/packages/element-plus/input-number/index.mjs +1 -1
  244. package/es/packages/element-plus/input-number/index2.mjs +1 -1
  245. package/es/packages/element-plus/input-number/index3.mjs +1 -1
  246. package/es/packages/element-plus/input-otp/index.mjs +1 -1
  247. package/es/packages/element-plus/input-otp/index2.mjs +2 -2
  248. package/es/packages/element-plus/input-otp/index3.mjs +1 -1
  249. package/es/packages/element-plus/input-table/index.mjs +1 -1
  250. package/es/packages/element-plus/input-table/index2.mjs +100 -38
  251. package/es/packages/element-plus/input-table/index3.mjs +1 -1
  252. package/es/packages/element-plus/input-tag/index.mjs +1 -1
  253. package/es/packages/element-plus/input-tag/index2.mjs +1 -10
  254. package/es/packages/element-plus/input-tag/index3.mjs +2 -3
  255. package/es/packages/element-plus/input-tree/index.mjs +1 -1
  256. package/es/packages/element-plus/input-tree/index2.mjs +41 -39
  257. package/es/packages/element-plus/input-tree/index3.mjs +1 -1
  258. package/es/packages/element-plus/license/index.mjs +1 -1
  259. package/es/packages/element-plus/license/index2.mjs +1 -1
  260. package/es/packages/element-plus/license/index3.mjs +1 -1
  261. package/es/packages/element-plus/login/index.mjs +1 -1
  262. package/es/packages/element-plus/login/index2.mjs +31 -9
  263. package/es/packages/element-plus/login/index3.mjs +1 -1
  264. package/es/packages/element-plus/mention/index.mjs +1 -1
  265. package/es/packages/element-plus/mention/index2.mjs +1 -1
  266. package/es/packages/element-plus/mention/index3.mjs +1 -1
  267. package/es/packages/element-plus/qrcode/index.mjs +1 -1
  268. package/es/packages/element-plus/qrcode/index2.mjs +1 -1
  269. package/es/packages/element-plus/qrcode/index3.mjs +1 -1
  270. package/es/packages/element-plus/radio/index.mjs +1 -1
  271. package/es/packages/element-plus/radio/index2.mjs +1 -1
  272. package/es/packages/element-plus/radio/index3.mjs +1 -1
  273. package/es/packages/element-plus/rate/index.mjs +1 -1
  274. package/es/packages/element-plus/rate/index2.mjs +1 -1
  275. package/es/packages/element-plus/rate/index3.mjs +1 -1
  276. package/es/packages/element-plus/search/index.mjs +1 -1
  277. package/es/packages/element-plus/search/index2.mjs +1 -1
  278. package/es/packages/element-plus/search/index3.mjs +1 -1
  279. package/es/packages/element-plus/select/index.mjs +1 -1
  280. package/es/packages/element-plus/select/index2.mjs +55 -21
  281. package/es/packages/element-plus/select/index3.mjs +55 -56
  282. package/es/packages/element-plus/sign/index.mjs +1 -1
  283. package/es/packages/element-plus/sign/index2.mjs +1 -1
  284. package/es/packages/element-plus/sign/index3.mjs +1 -1
  285. package/es/packages/element-plus/slider/index.mjs +1 -1
  286. package/es/packages/element-plus/slider/index2.mjs +1 -1
  287. package/es/packages/element-plus/slider/index3.mjs +1 -1
  288. package/es/packages/element-plus/switch/index.mjs +1 -1
  289. package/es/packages/element-plus/switch/index2.mjs +1 -1
  290. package/es/packages/element-plus/switch/index3.mjs +1 -1
  291. package/es/packages/element-plus/tabs/index.mjs +1 -1
  292. package/es/packages/element-plus/tabs/index2.mjs +1 -1
  293. package/es/packages/element-plus/tabs/index3.mjs +1 -1
  294. package/es/packages/element-plus/text-ellipsis/index.mjs +1 -1
  295. package/es/packages/element-plus/text-ellipsis/index2.mjs +1 -1
  296. package/es/packages/element-plus/text-ellipsis/index3.mjs +1 -1
  297. package/es/packages/element-plus/time/index.mjs +1 -1
  298. package/es/packages/element-plus/time/index2.mjs +1 -1
  299. package/es/packages/element-plus/time/index3.mjs +1 -1
  300. package/es/packages/element-plus/title/index.mjs +1 -1
  301. package/es/packages/element-plus/title/index2.mjs +1 -1
  302. package/es/packages/element-plus/title/index3.mjs +1 -1
  303. package/es/packages/element-plus/tree/index.mjs +1 -1
  304. package/es/packages/element-plus/tree/index2.mjs +1 -1
  305. package/es/packages/element-plus/tree/index3.mjs +1 -1
  306. package/es/packages/element-plus/upload/index.mjs +1 -1
  307. package/es/packages/element-plus/upload/index2.mjs +160 -53
  308. package/es/packages/element-plus/upload/index3.mjs +1 -1
  309. package/es/packages/element-plus/video/index.mjs +1 -1
  310. package/es/packages/element-plus/video/index2.mjs +1 -1
  311. package/es/packages/element-plus/video/index3.mjs +1 -1
  312. package/es/src/core/column-state.mjs +16 -7
  313. package/es/src/core/create.mjs +1 -1
  314. package/es/src/core/crud-import.mjs +306 -0
  315. package/es/src/core/crud-validation.mjs +80 -0
  316. package/es/src/core/dataformat.mjs +6 -6
  317. package/es/src/core/detail.mjs +2 -4
  318. package/es/src/core/dic.mjs +52 -35
  319. package/es/src/core/locale.mjs +1 -1
  320. package/es/src/core/model.mjs +23 -0
  321. package/es/src/core/option.mjs +5 -5
  322. package/es/src/core/packages.mjs +1 -1
  323. package/es/src/core/query-view.mjs +304 -0
  324. package/es/src/core/slot.mjs +1 -1
  325. package/es/src/core/viewport.mjs +50 -0
  326. package/es/src/global/variable.mjs +1 -1
  327. package/es/src/icon.mjs +1 -1
  328. package/es/src/index.mjs +3 -2
  329. package/es/src/locale/index.mjs +1 -1
  330. package/es/src/locale/lang/en.mjs +8 -1
  331. package/es/src/locale/lang/zh-cn.mjs +8 -1
  332. package/es/src/locale/lang/zh.mjs +8 -1
  333. package/es/src/locale/messages/crud-import.mjs +75 -0
  334. package/es/src/locale/messages/print-preview.mjs +65 -0
  335. package/es/src/locale/messages/query-view.mjs +38 -0
  336. package/es/src/plugin/ali/index.mjs +1 -1
  337. package/es/src/plugin/clipboard/index.mjs +1 -1
  338. package/es/src/plugin/export/_blob.mjs +1 -1
  339. package/es/src/plugin/export/_export2Excel.mjs +1 -1
  340. package/es/src/plugin/export/index.mjs +1 -1
  341. package/es/src/plugin/logs/index.mjs +1 -1
  342. package/es/src/plugin/print/index.mjs +280 -173
  343. package/es/src/plugin/print/preview.mjs +74 -0
  344. package/es/src/plugin/qiniu/index.mjs +1 -1
  345. package/es/src/plugin/screenshot/index.mjs +1 -1
  346. package/es/src/plugin/video/index.mjs +1 -1
  347. package/es/src/plugin/watermark/index.mjs +1 -1
  348. package/es/src/plugin/watermark/watermark.mjs +1 -1
  349. package/es/src/ui/data/index.mjs +1 -1
  350. package/es/src/ui/element-plus/index.mjs +1 -1
  351. package/es/src/ui/index.mjs +1 -1
  352. package/es/src/utils/bem.mjs +1 -1
  353. package/es/src/utils/load-script.mjs +102 -0
  354. package/es/src/utils/mock.mjs +1 -1
  355. package/es/src/utils/print.mjs +83 -19
  356. package/es/src/utils/util.mjs +7 -37
  357. package/es/src/utils/validate.mjs +1 -1
  358. package/es/src/version.mjs +2 -2
  359. package/lib/_virtual/_commonjsHelpers.js +1 -1
  360. package/lib/_virtual/dayjs.min.js +1 -1
  361. package/lib/_virtual/dayjs2.min.js +1 -1
  362. package/lib/index.css +1 -1
  363. package/lib/locale/browser/en.js +7 -1
  364. package/lib/locale/browser/zh-cn.js +7 -1
  365. package/lib/locale/browser/zh.js +7 -1
  366. package/lib/node_modules/.pnpm/async-validator@4.2.5/node_modules/async-validator/dist-web/index.js +1333 -0
  367. package/lib/node_modules/.pnpm/dayjs@1.11.23/node_modules/dayjs/dayjs.min.js +1 -1
  368. package/lib/node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.js +1 -1
  369. package/lib/packages/core/common/event.js +54 -7
  370. package/lib/packages/core/common/init.js +206 -43
  371. package/lib/packages/core/common/props.js +11 -4
  372. package/lib/packages/core/components/dialog-form/index.js +1 -1
  373. package/lib/packages/core/components/dialog-form/index2.js +1 -1
  374. package/lib/packages/core/components/dialog-form/index3.js +1 -1
  375. package/lib/packages/core/components/dialog-form/index4.js +1 -1
  376. package/lib/packages/core/components/form/custom.js +1 -1
  377. package/lib/packages/core/components/form/index.js +1 -1
  378. package/lib/packages/core/components/form/index2.js +1 -1
  379. package/lib/packages/core/components/form/index3.js +1 -1
  380. package/lib/packages/core/components/icon/index.js +1 -1
  381. package/lib/packages/core/components/icon/index2.js +1 -1
  382. package/lib/packages/core/components/icon/index3.js +1 -1
  383. package/lib/packages/core/components/image-preview/index.js +1 -1
  384. package/lib/packages/core/components/image-preview/index2.js +1 -1
  385. package/lib/packages/core/components/image-preview/index3.js +1 -2
  386. package/lib/packages/core/components/image-preview/index4.js +1 -1
  387. package/lib/packages/core/components/print-preview/index.js +12 -0
  388. package/lib/packages/core/components/print-preview/index2.js +127 -0
  389. package/lib/packages/core/components/print-preview/index3.js +311 -0
  390. package/lib/packages/core/directive/contextmenu.js +1 -1
  391. package/lib/packages/core/directive/permission.js +1 -1
  392. package/lib/packages/data/box/index.js +1 -1
  393. package/lib/packages/data/box/index2.js +1 -1
  394. package/lib/packages/data/box/index3.js +1 -1
  395. package/lib/packages/data/card/index.js +1 -1
  396. package/lib/packages/data/card/index2.js +1 -1
  397. package/lib/packages/data/card/index3.js +1 -1
  398. package/lib/packages/data/cardText/index.js +1 -1
  399. package/lib/packages/data/cardText/index2.js +1 -1
  400. package/lib/packages/data/cardText/index3.js +1 -1
  401. package/lib/packages/data/countdown/index.js +1 -1
  402. package/lib/packages/data/countdown/index2.js +1 -1
  403. package/lib/packages/data/countdown/index3.js +1 -1
  404. package/lib/packages/data/dashboard/index.js +1 -1
  405. package/lib/packages/data/dashboard/index2.js +1 -1
  406. package/lib/packages/data/dashboard/index3.js +1 -1
  407. package/lib/packages/data/display/index.js +1 -1
  408. package/lib/packages/data/display/index2.js +1 -1
  409. package/lib/packages/data/display/index3.js +1 -1
  410. package/lib/packages/data/icons/index.js +1 -1
  411. package/lib/packages/data/icons/index2.js +1 -1
  412. package/lib/packages/data/icons/index3.js +1 -1
  413. package/lib/packages/data/imgText/index.js +1 -1
  414. package/lib/packages/data/imgText/index2.js +1 -1
  415. package/lib/packages/data/imgText/index3.js +1 -1
  416. package/lib/packages/data/list/index.js +1 -1
  417. package/lib/packages/data/list/index2.js +1 -1
  418. package/lib/packages/data/list/index3.js +1 -1
  419. package/lib/packages/data/notice/index.js +1 -1
  420. package/lib/packages/data/notice/index2.js +1 -1
  421. package/lib/packages/data/notice/index3.js +1 -1
  422. package/lib/packages/data/operaText/index.js +1 -1
  423. package/lib/packages/data/operaText/index2.js +1 -1
  424. package/lib/packages/data/operaText/index3.js +1 -1
  425. package/lib/packages/data/panel/index.js +1 -1
  426. package/lib/packages/data/panel/index2.js +1 -1
  427. package/lib/packages/data/panel/index3.js +1 -1
  428. package/lib/packages/data/pay/index.js +1 -1
  429. package/lib/packages/data/pay/index2.js +1 -1
  430. package/lib/packages/data/pay/index3.js +1 -1
  431. package/lib/packages/data/price/index.js +1 -1
  432. package/lib/packages/data/price/index2.js +1 -1
  433. package/lib/packages/data/price/index3.js +1 -1
  434. package/lib/packages/data/product/index.js +1 -1
  435. package/lib/packages/data/product/index2.js +1 -1
  436. package/lib/packages/data/product/index3.js +1 -1
  437. package/lib/packages/data/profile/index.js +1 -1
  438. package/lib/packages/data/profile/index2.js +1 -1
  439. package/lib/packages/data/profile/index3.js +1 -1
  440. package/lib/packages/data/progress/index.js +1 -1
  441. package/lib/packages/data/progress/index2.js +1 -1
  442. package/lib/packages/data/progress/index3.js +1 -1
  443. package/lib/packages/data/rank/index.js +1 -1
  444. package/lib/packages/data/rank/index2.js +1 -1
  445. package/lib/packages/data/rank/index3.js +1 -1
  446. package/lib/packages/data/rotate/index.js +1 -1
  447. package/lib/packages/data/rotate/index2.js +1 -1
  448. package/lib/packages/data/rotate/index3.js +1 -1
  449. package/lib/packages/data/statistic/index.js +1 -1
  450. package/lib/packages/data/statistic/index2.js +1 -1
  451. package/lib/packages/data/statistic/index3.js +1 -1
  452. package/lib/packages/data/tabs/index.js +1 -1
  453. package/lib/packages/data/tabs/index2.js +1 -1
  454. package/lib/packages/data/tabs/index3.js +1 -1
  455. package/lib/packages/data/task/index.js +1 -1
  456. package/lib/packages/data/task/index2.js +1 -1
  457. package/lib/packages/data/task/index3.js +1 -1
  458. package/lib/packages/data/weather/index.js +1 -1
  459. package/lib/packages/data/weather/index2.js +1 -1
  460. package/lib/packages/data/weather/index3.js +1 -1
  461. package/lib/packages/element-plus/array/index.js +1 -1
  462. package/lib/packages/element-plus/array/index2.js +1 -1
  463. package/lib/packages/element-plus/array/index3.js +1 -1
  464. package/lib/packages/element-plus/article/index.js +1 -1
  465. package/lib/packages/element-plus/article/index2.js +1 -1
  466. package/lib/packages/element-plus/article/index3.js +1 -1
  467. package/lib/packages/element-plus/captcha/index.js +1 -1
  468. package/lib/packages/element-plus/captcha/index2.js +1 -1
  469. package/lib/packages/element-plus/captcha/index3.js +1 -1
  470. package/lib/packages/element-plus/cascader/index.js +1 -1
  471. package/lib/packages/element-plus/cascader/index2.js +38 -20
  472. package/lib/packages/element-plus/cascader/index3.js +3 -4
  473. package/lib/packages/element-plus/chat/index.js +1 -1
  474. package/lib/packages/element-plus/chat/index2.js +1 -1
  475. package/lib/packages/element-plus/chat/index3.js +1 -1
  476. package/lib/packages/element-plus/checkbox/index.js +1 -1
  477. package/lib/packages/element-plus/checkbox/index2.js +27 -11
  478. package/lib/packages/element-plus/checkbox/index3.js +1 -1
  479. package/lib/packages/element-plus/comment/index.js +1 -1
  480. package/lib/packages/element-plus/comment/index2.js +1 -1
  481. package/lib/packages/element-plus/comment/index3.js +1 -1
  482. package/lib/packages/element-plus/count-up/index.js +1 -1
  483. package/lib/packages/element-plus/count-up/index2.js +1 -1
  484. package/lib/packages/element-plus/count-up/index3.js +1 -1
  485. package/lib/packages/element-plus/crud/column/column-default.js +1 -1
  486. package/lib/packages/element-plus/crud/column/column-default2.js +1 -1
  487. package/lib/packages/element-plus/crud/column/column-default3.js +1 -1
  488. package/lib/packages/element-plus/crud/column/column-dynamic.js +1 -1
  489. package/lib/packages/element-plus/crud/column/column-dynamic2.js +1 -1
  490. package/lib/packages/element-plus/crud/column/column-dynamic3.js +1 -1
  491. package/lib/packages/element-plus/crud/column/column-menu.js +1 -1
  492. package/lib/packages/element-plus/crud/column/column-menu2.js +1 -1
  493. package/lib/packages/element-plus/crud/column/column-menu3.js +1 -1
  494. package/lib/packages/element-plus/crud/column/column-slot.js +1 -1
  495. package/lib/packages/element-plus/crud/column/column-slot2.js +1 -1
  496. package/lib/packages/element-plus/crud/column/column-slot3.js +1 -1
  497. package/lib/packages/element-plus/crud/column/column.js +1 -1
  498. package/lib/packages/element-plus/crud/column/column2.js +1 -1
  499. package/lib/packages/element-plus/crud/column/column3.js +1 -1
  500. package/lib/packages/element-plus/crud/column/menu.js +1 -1
  501. package/lib/packages/element-plus/crud/column/menu2.js +1 -1
  502. package/lib/packages/element-plus/crud/column/menu3.js +1 -1
  503. package/lib/packages/element-plus/crud/config.js +6 -1
  504. package/lib/packages/element-plus/crud/dialog/dialog-column.js +1 -1
  505. package/lib/packages/element-plus/crud/dialog/dialog-column2.js +1 -1
  506. package/lib/packages/element-plus/crud/dialog/dialog-column3.js +1 -1
  507. package/lib/packages/element-plus/crud/dialog/dialog-excel.js +1 -1
  508. package/lib/packages/element-plus/crud/dialog/dialog-excel2.js +9 -10
  509. package/lib/packages/element-plus/crud/dialog/dialog-excel3.js +1 -1
  510. package/lib/packages/element-plus/crud/dialog/dialog-filter.js +1 -1
  511. package/lib/packages/element-plus/crud/dialog/dialog-filter2.js +1 -1
  512. package/lib/packages/element-plus/crud/dialog/dialog-filter3.js +1 -1
  513. package/lib/packages/element-plus/crud/dialog/dialog-form.js +1 -1
  514. package/lib/packages/element-plus/crud/dialog/dialog-form2.js +14 -10
  515. package/lib/packages/element-plus/crud/dialog/dialog-form3.js +6 -6
  516. package/lib/packages/element-plus/crud/dialog/dialog-import.js +12 -0
  517. package/lib/packages/element-plus/crud/dialog/dialog-import2.js +316 -0
  518. package/lib/packages/element-plus/crud/dialog/dialog-import3.js +318 -0
  519. package/lib/packages/element-plus/crud/grid/index.js +1 -1
  520. package/lib/packages/element-plus/crud/grid/index2.js +1 -1
  521. package/lib/packages/element-plus/crud/grid/index3.js +1 -1
  522. package/lib/packages/element-plus/crud/grid/item.js +1 -1
  523. package/lib/packages/element-plus/crud/grid/item2.js +1 -1
  524. package/lib/packages/element-plus/crud/grid/item3.js +1 -1
  525. package/lib/packages/element-plus/crud/index.js +1 -1
  526. package/lib/packages/element-plus/crud/index2.js +50 -12
  527. package/lib/packages/element-plus/crud/index3.js +9 -2
  528. package/lib/packages/element-plus/crud/menu/header-menu.js +1 -1
  529. package/lib/packages/element-plus/crud/menu/header-menu2.js +18 -4
  530. package/lib/packages/element-plus/crud/menu/header-menu3.js +35 -9
  531. package/lib/packages/element-plus/crud/menu/header-search.js +1 -1
  532. package/lib/packages/element-plus/crud/menu/header-search2.js +1 -1
  533. package/lib/packages/element-plus/crud/menu/header-search3.js +1 -1
  534. package/lib/packages/element-plus/crud/menu/query-views.js +12 -0
  535. package/lib/packages/element-plus/crud/menu/query-views2.js +28 -0
  536. package/lib/packages/element-plus/crud/menu/query-views3.js +158 -0
  537. package/lib/packages/element-plus/crud/menu/table-page.js +1 -1
  538. package/lib/packages/element-plus/crud/menu/table-page2.js +1 -1
  539. package/lib/packages/element-plus/crud/menu/table-page3.js +1 -1
  540. package/lib/packages/element-plus/crud/query-view.js +368 -0
  541. package/lib/packages/element-plus/date/index.js +1 -1
  542. package/lib/packages/element-plus/date/index2.js +1 -1
  543. package/lib/packages/element-plus/date/index3.js +1 -1
  544. package/lib/packages/element-plus/draggable/index.js +1 -1
  545. package/lib/packages/element-plus/draggable/index2.js +1 -1
  546. package/lib/packages/element-plus/draggable/index3.js +1 -1
  547. package/lib/packages/element-plus/dynamic/index.js +1 -1
  548. package/lib/packages/element-plus/dynamic/index2.js +50 -7
  549. package/lib/packages/element-plus/dynamic/index3.js +6 -6
  550. package/lib/packages/element-plus/file-manager/index.js +1 -1
  551. package/lib/packages/element-plus/file-manager/index2.js +56 -9
  552. package/lib/packages/element-plus/file-manager/index3.js +1 -1
  553. package/lib/packages/element-plus/filter-builder/index.js +1 -1
  554. package/lib/packages/element-plus/filter-builder/index2.js +1 -1
  555. package/lib/packages/element-plus/filter-builder/index3.js +1 -1
  556. package/lib/packages/element-plus/flow/index.js +1 -1
  557. package/lib/packages/element-plus/flow/index2.js +1 -1
  558. package/lib/packages/element-plus/flow/index3.js +1 -1
  559. package/lib/packages/element-plus/flow/node.js +1 -1
  560. package/lib/packages/element-plus/flow/node2.js +1 -1
  561. package/lib/packages/element-plus/flow/node3.js +1 -1
  562. package/lib/packages/element-plus/form/config.js +1 -1
  563. package/lib/packages/element-plus/form/index.js +1 -1
  564. package/lib/packages/element-plus/form/index2.js +313 -223
  565. package/lib/packages/element-plus/form/index3.js +4 -4
  566. package/lib/packages/element-plus/form/menu.js +1 -1
  567. package/lib/packages/element-plus/form/menu2.js +1 -1
  568. package/lib/packages/element-plus/form/menu3.js +1 -1
  569. package/lib/packages/element-plus/group/index.js +1 -1
  570. package/lib/packages/element-plus/group/index2.js +1 -1
  571. package/lib/packages/element-plus/group/index3.js +1 -1
  572. package/lib/packages/element-plus/iframe/index.js +1 -1
  573. package/lib/packages/element-plus/iframe/index2.js +1 -1
  574. package/lib/packages/element-plus/iframe/index3.js +1 -1
  575. package/lib/packages/element-plus/input/index.js +1 -1
  576. package/lib/packages/element-plus/input/index2.js +1 -1
  577. package/lib/packages/element-plus/input/index3.js +1 -1
  578. package/lib/packages/element-plus/input-color/index.js +1 -1
  579. package/lib/packages/element-plus/input-color/index2.js +1 -1
  580. package/lib/packages/element-plus/input-color/index3.js +1 -1
  581. package/lib/packages/element-plus/input-cron/index.js +1 -1
  582. package/lib/packages/element-plus/input-cron/index2.js +1 -1
  583. package/lib/packages/element-plus/input-cron/index3.js +1 -1
  584. package/lib/packages/element-plus/input-icon/index.js +1 -1
  585. package/lib/packages/element-plus/input-icon/index2.js +1 -1
  586. package/lib/packages/element-plus/input-icon/index3.js +1 -1
  587. package/lib/packages/element-plus/input-map/index.js +1 -1
  588. package/lib/packages/element-plus/input-map/index2.js +93 -28
  589. package/lib/packages/element-plus/input-map/index3.js +11 -9
  590. package/lib/packages/element-plus/input-number/index.js +1 -1
  591. package/lib/packages/element-plus/input-number/index2.js +1 -1
  592. package/lib/packages/element-plus/input-number/index3.js +1 -1
  593. package/lib/packages/element-plus/input-otp/index.js +1 -1
  594. package/lib/packages/element-plus/input-otp/index2.js +2 -2
  595. package/lib/packages/element-plus/input-otp/index3.js +1 -1
  596. package/lib/packages/element-plus/input-table/index.js +1 -1
  597. package/lib/packages/element-plus/input-table/index2.js +100 -38
  598. package/lib/packages/element-plus/input-table/index3.js +1 -1
  599. package/lib/packages/element-plus/input-tag/index.js +1 -1
  600. package/lib/packages/element-plus/input-tag/index2.js +1 -10
  601. package/lib/packages/element-plus/input-tag/index3.js +2 -3
  602. package/lib/packages/element-plus/input-tree/index.js +1 -1
  603. package/lib/packages/element-plus/input-tree/index2.js +41 -39
  604. package/lib/packages/element-plus/input-tree/index3.js +1 -1
  605. package/lib/packages/element-plus/license/index.js +1 -1
  606. package/lib/packages/element-plus/license/index2.js +1 -1
  607. package/lib/packages/element-plus/license/index3.js +1 -1
  608. package/lib/packages/element-plus/login/index.js +1 -1
  609. package/lib/packages/element-plus/login/index2.js +31 -9
  610. package/lib/packages/element-plus/login/index3.js +1 -1
  611. package/lib/packages/element-plus/mention/index.js +1 -1
  612. package/lib/packages/element-plus/mention/index2.js +1 -1
  613. package/lib/packages/element-plus/mention/index3.js +1 -1
  614. package/lib/packages/element-plus/qrcode/index.js +1 -1
  615. package/lib/packages/element-plus/qrcode/index2.js +1 -1
  616. package/lib/packages/element-plus/qrcode/index3.js +1 -1
  617. package/lib/packages/element-plus/radio/index.js +1 -1
  618. package/lib/packages/element-plus/radio/index2.js +1 -1
  619. package/lib/packages/element-plus/radio/index3.js +1 -1
  620. package/lib/packages/element-plus/rate/index.js +1 -1
  621. package/lib/packages/element-plus/rate/index2.js +1 -1
  622. package/lib/packages/element-plus/rate/index3.js +1 -1
  623. package/lib/packages/element-plus/search/index.js +1 -1
  624. package/lib/packages/element-plus/search/index2.js +1 -1
  625. package/lib/packages/element-plus/search/index3.js +1 -1
  626. package/lib/packages/element-plus/select/index.js +1 -1
  627. package/lib/packages/element-plus/select/index2.js +55 -21
  628. package/lib/packages/element-plus/select/index3.js +54 -55
  629. package/lib/packages/element-plus/sign/index.js +1 -1
  630. package/lib/packages/element-plus/sign/index2.js +1 -1
  631. package/lib/packages/element-plus/sign/index3.js +1 -1
  632. package/lib/packages/element-plus/slider/index.js +1 -1
  633. package/lib/packages/element-plus/slider/index2.js +1 -1
  634. package/lib/packages/element-plus/slider/index3.js +1 -1
  635. package/lib/packages/element-plus/switch/index.js +1 -1
  636. package/lib/packages/element-plus/switch/index2.js +1 -1
  637. package/lib/packages/element-plus/switch/index3.js +1 -1
  638. package/lib/packages/element-plus/tabs/index.js +1 -1
  639. package/lib/packages/element-plus/tabs/index2.js +1 -1
  640. package/lib/packages/element-plus/tabs/index3.js +1 -1
  641. package/lib/packages/element-plus/text-ellipsis/index.js +1 -1
  642. package/lib/packages/element-plus/text-ellipsis/index2.js +1 -1
  643. package/lib/packages/element-plus/text-ellipsis/index3.js +1 -1
  644. package/lib/packages/element-plus/time/index.js +1 -1
  645. package/lib/packages/element-plus/time/index2.js +1 -1
  646. package/lib/packages/element-plus/time/index3.js +1 -1
  647. package/lib/packages/element-plus/title/index.js +1 -1
  648. package/lib/packages/element-plus/title/index2.js +1 -1
  649. package/lib/packages/element-plus/title/index3.js +1 -1
  650. package/lib/packages/element-plus/tree/index.js +1 -1
  651. package/lib/packages/element-plus/tree/index2.js +1 -1
  652. package/lib/packages/element-plus/tree/index3.js +1 -1
  653. package/lib/packages/element-plus/upload/index.js +1 -1
  654. package/lib/packages/element-plus/upload/index2.js +160 -53
  655. package/lib/packages/element-plus/upload/index3.js +1 -1
  656. package/lib/packages/element-plus/video/index.js +1 -1
  657. package/lib/packages/element-plus/video/index2.js +1 -1
  658. package/lib/packages/element-plus/video/index3.js +1 -1
  659. package/lib/src/core/column-state.js +16 -7
  660. package/lib/src/core/create.js +1 -1
  661. package/lib/src/core/crud-import.js +321 -0
  662. package/lib/src/core/crud-validation.js +89 -0
  663. package/lib/src/core/dataformat.js +5 -5
  664. package/lib/src/core/detail.js +2 -4
  665. package/lib/src/core/dic.js +51 -33
  666. package/lib/src/core/locale.js +1 -1
  667. package/lib/src/core/model.js +32 -0
  668. package/lib/src/core/option.js +5 -5
  669. package/lib/src/core/packages.js +1 -1
  670. package/lib/src/core/query-view.js +320 -0
  671. package/lib/src/core/slot.js +1 -1
  672. package/lib/src/core/viewport.js +53 -0
  673. package/lib/src/global/variable.js +1 -1
  674. package/lib/src/icon.js +1 -1
  675. package/lib/src/index.js +4 -3
  676. package/lib/src/locale/index.js +1 -1
  677. package/lib/src/locale/lang/en.js +8 -1
  678. package/lib/src/locale/lang/zh-cn.js +8 -1
  679. package/lib/src/locale/lang/zh.js +8 -1
  680. package/lib/src/locale/messages/crud-import.js +79 -0
  681. package/lib/src/locale/messages/print-preview.js +69 -0
  682. package/lib/src/locale/messages/query-view.js +42 -0
  683. package/lib/src/plugin/ali/index.js +1 -1
  684. package/lib/src/plugin/clipboard/index.js +1 -1
  685. package/lib/src/plugin/export/_blob.js +1 -1
  686. package/lib/src/plugin/export/_export2Excel.js +1 -1
  687. package/lib/src/plugin/export/index.js +1 -1
  688. package/lib/src/plugin/logs/index.js +1 -1
  689. package/lib/src/plugin/print/index.js +279 -172
  690. package/lib/src/plugin/print/preview.js +76 -0
  691. package/lib/src/plugin/qiniu/index.js +1 -1
  692. package/lib/src/plugin/screenshot/index.js +1 -1
  693. package/lib/src/plugin/video/index.js +1 -1
  694. package/lib/src/plugin/watermark/index.js +1 -1
  695. package/lib/src/plugin/watermark/watermark.js +1 -1
  696. package/lib/src/ui/data/index.js +1 -1
  697. package/lib/src/ui/element-plus/index.js +1 -1
  698. package/lib/src/ui/index.js +1 -1
  699. package/lib/src/utils/bem.js +1 -1
  700. package/lib/src/utils/load-script.js +104 -0
  701. package/lib/src/utils/mock.js +1 -1
  702. package/lib/src/utils/print.js +86 -18
  703. package/lib/src/utils/util.js +8 -38
  704. package/lib/src/utils/validate.js +1 -1
  705. package/lib/src/version.js +2 -2
  706. package/package.json +2 -1
  707. package/types/index.d.ts +108 -4
@@ -0,0 +1,1329 @@
1
+ /*! Tvue.js v3.9.8 | (c) 2024-2026 MORISHIMA | Released under the MIT License. */
2
+ function _extends() {
3
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
4
+ for (var i = 1; i < arguments.length; i++) {
5
+ var source = arguments[i];
6
+
7
+ for (var key in source) {
8
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
9
+ target[key] = source[key];
10
+ }
11
+ }
12
+ }
13
+
14
+ return target;
15
+ };
16
+ return _extends.apply(this, arguments);
17
+ }
18
+
19
+ function _inheritsLoose(subClass, superClass) {
20
+ subClass.prototype = Object.create(superClass.prototype);
21
+ subClass.prototype.constructor = subClass;
22
+
23
+ _setPrototypeOf(subClass, superClass);
24
+ }
25
+
26
+ function _getPrototypeOf(o) {
27
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
28
+ return o.__proto__ || Object.getPrototypeOf(o);
29
+ };
30
+ return _getPrototypeOf(o);
31
+ }
32
+
33
+ function _setPrototypeOf(o, p) {
34
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
35
+ o.__proto__ = p;
36
+ return o;
37
+ };
38
+ return _setPrototypeOf(o, p);
39
+ }
40
+
41
+ function _isNativeReflectConstruct() {
42
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
43
+ if (Reflect.construct.sham) return false;
44
+ if (typeof Proxy === "function") return true;
45
+
46
+ try {
47
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
48
+ return true;
49
+ } catch (e) {
50
+ return false;
51
+ }
52
+ }
53
+
54
+ function _construct(Parent, args, Class) {
55
+ if (_isNativeReflectConstruct()) {
56
+ _construct = Reflect.construct.bind();
57
+ } else {
58
+ _construct = function _construct(Parent, args, Class) {
59
+ var a = [null];
60
+ a.push.apply(a, args);
61
+ var Constructor = Function.bind.apply(Parent, a);
62
+ var instance = new Constructor();
63
+ if (Class) _setPrototypeOf(instance, Class.prototype);
64
+ return instance;
65
+ };
66
+ }
67
+
68
+ return _construct.apply(null, arguments);
69
+ }
70
+
71
+ function _isNativeFunction(fn) {
72
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
73
+ }
74
+
75
+ function _wrapNativeSuper(Class) {
76
+ var _cache = typeof Map === "function" ? new Map() : undefined;
77
+
78
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
79
+ if (Class === null || !_isNativeFunction(Class)) return Class;
80
+
81
+ if (typeof Class !== "function") {
82
+ throw new TypeError("Super expression must either be null or a function");
83
+ }
84
+
85
+ if (typeof _cache !== "undefined") {
86
+ if (_cache.has(Class)) return _cache.get(Class);
87
+
88
+ _cache.set(Class, Wrapper);
89
+ }
90
+
91
+ function Wrapper() {
92
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
93
+ }
94
+
95
+ Wrapper.prototype = Object.create(Class.prototype, {
96
+ constructor: {
97
+ value: Wrapper,
98
+ enumerable: false,
99
+ writable: true,
100
+ configurable: true
101
+ }
102
+ });
103
+ return _setPrototypeOf(Wrapper, Class);
104
+ };
105
+
106
+ return _wrapNativeSuper(Class);
107
+ }
108
+
109
+ /* eslint no-console:0 */
110
+ var formatRegExp = /%[sdj%]/g;
111
+ var warning = function warning() {}; // don't print warning message when in production env or node runtime
112
+
113
+ if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
114
+ warning = function warning(type, errors) {
115
+ if (typeof console !== 'undefined' && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === 'undefined') {
116
+ if (errors.every(function (e) {
117
+ return typeof e === 'string';
118
+ })) {
119
+ console.warn(type, errors);
120
+ }
121
+ }
122
+ };
123
+ }
124
+
125
+ function convertFieldsError(errors) {
126
+ if (!errors || !errors.length) return null;
127
+ var fields = {};
128
+ errors.forEach(function (error) {
129
+ var field = error.field;
130
+ fields[field] = fields[field] || [];
131
+ fields[field].push(error);
132
+ });
133
+ return fields;
134
+ }
135
+ function format(template) {
136
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
137
+ args[_key - 1] = arguments[_key];
138
+ }
139
+
140
+ var i = 0;
141
+ var len = args.length;
142
+
143
+ if (typeof template === 'function') {
144
+ return template.apply(null, args);
145
+ }
146
+
147
+ if (typeof template === 'string') {
148
+ var str = template.replace(formatRegExp, function (x) {
149
+ if (x === '%%') {
150
+ return '%';
151
+ }
152
+
153
+ if (i >= len) {
154
+ return x;
155
+ }
156
+
157
+ switch (x) {
158
+ case '%s':
159
+ return String(args[i++]);
160
+
161
+ case '%d':
162
+ return Number(args[i++]);
163
+
164
+ case '%j':
165
+ try {
166
+ return JSON.stringify(args[i++]);
167
+ } catch (_) {
168
+ return '[Circular]';
169
+ }
170
+
171
+ break;
172
+
173
+ default:
174
+ return x;
175
+ }
176
+ });
177
+ return str;
178
+ }
179
+
180
+ return template;
181
+ }
182
+
183
+ function isNativeStringType(type) {
184
+ return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'date' || type === 'pattern';
185
+ }
186
+
187
+ function isEmptyValue(value, type) {
188
+ if (value === undefined || value === null) {
189
+ return true;
190
+ }
191
+
192
+ if (type === 'array' && Array.isArray(value) && !value.length) {
193
+ return true;
194
+ }
195
+
196
+ if (isNativeStringType(type) && typeof value === 'string' && !value) {
197
+ return true;
198
+ }
199
+
200
+ return false;
201
+ }
202
+
203
+ function asyncParallelArray(arr, func, callback) {
204
+ var results = [];
205
+ var total = 0;
206
+ var arrLength = arr.length;
207
+
208
+ function count(errors) {
209
+ results.push.apply(results, errors || []);
210
+ total++;
211
+
212
+ if (total === arrLength) {
213
+ callback(results);
214
+ }
215
+ }
216
+
217
+ arr.forEach(function (a) {
218
+ func(a, count);
219
+ });
220
+ }
221
+
222
+ function asyncSerialArray(arr, func, callback) {
223
+ var index = 0;
224
+ var arrLength = arr.length;
225
+
226
+ function next(errors) {
227
+ if (errors && errors.length) {
228
+ callback(errors);
229
+ return;
230
+ }
231
+
232
+ var original = index;
233
+ index = index + 1;
234
+
235
+ if (original < arrLength) {
236
+ func(arr[original], next);
237
+ } else {
238
+ callback([]);
239
+ }
240
+ }
241
+
242
+ next([]);
243
+ }
244
+
245
+ function flattenObjArr(objArr) {
246
+ var ret = [];
247
+ Object.keys(objArr).forEach(function (k) {
248
+ ret.push.apply(ret, objArr[k] || []);
249
+ });
250
+ return ret;
251
+ }
252
+
253
+ var AsyncValidationError = /*#__PURE__*/function (_Error) {
254
+ _inheritsLoose(AsyncValidationError, _Error);
255
+
256
+ function AsyncValidationError(errors, fields) {
257
+ var _this;
258
+
259
+ _this = _Error.call(this, 'Async Validation Error') || this;
260
+ _this.errors = errors;
261
+ _this.fields = fields;
262
+ return _this;
263
+ }
264
+
265
+ return AsyncValidationError;
266
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
267
+ function asyncMap(objArr, option, func, callback, source) {
268
+ if (option.first) {
269
+ var _pending = new Promise(function (resolve, reject) {
270
+ var next = function next(errors) {
271
+ callback(errors);
272
+ return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
273
+ };
274
+
275
+ var flattenArr = flattenObjArr(objArr);
276
+ asyncSerialArray(flattenArr, func, next);
277
+ });
278
+
279
+ _pending["catch"](function (e) {
280
+ return e;
281
+ });
282
+
283
+ return _pending;
284
+ }
285
+
286
+ var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
287
+ var objArrKeys = Object.keys(objArr);
288
+ var objArrLength = objArrKeys.length;
289
+ var total = 0;
290
+ var results = [];
291
+ var pending = new Promise(function (resolve, reject) {
292
+ var next = function next(errors) {
293
+ results.push.apply(results, errors);
294
+ total++;
295
+
296
+ if (total === objArrLength) {
297
+ callback(results);
298
+ return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
299
+ }
300
+ };
301
+
302
+ if (!objArrKeys.length) {
303
+ callback(results);
304
+ resolve(source);
305
+ }
306
+
307
+ objArrKeys.forEach(function (key) {
308
+ var arr = objArr[key];
309
+
310
+ if (firstFields.indexOf(key) !== -1) {
311
+ asyncSerialArray(arr, func, next);
312
+ } else {
313
+ asyncParallelArray(arr, func, next);
314
+ }
315
+ });
316
+ });
317
+ pending["catch"](function (e) {
318
+ return e;
319
+ });
320
+ return pending;
321
+ }
322
+
323
+ function isErrorObj(obj) {
324
+ return !!(obj && obj.message !== undefined);
325
+ }
326
+
327
+ function getValue(value, path) {
328
+ var v = value;
329
+
330
+ for (var i = 0; i < path.length; i++) {
331
+ if (v == undefined) {
332
+ return v;
333
+ }
334
+
335
+ v = v[path[i]];
336
+ }
337
+
338
+ return v;
339
+ }
340
+
341
+ function complementError(rule, source) {
342
+ return function (oe) {
343
+ var fieldValue;
344
+
345
+ if (rule.fullFields) {
346
+ fieldValue = getValue(source, rule.fullFields);
347
+ } else {
348
+ fieldValue = source[oe.field || rule.fullField];
349
+ }
350
+
351
+ if (isErrorObj(oe)) {
352
+ oe.field = oe.field || rule.fullField;
353
+ oe.fieldValue = fieldValue;
354
+ return oe;
355
+ }
356
+
357
+ return {
358
+ message: typeof oe === 'function' ? oe() : oe,
359
+ fieldValue: fieldValue,
360
+ field: oe.field || rule.fullField
361
+ };
362
+ };
363
+ }
364
+ function deepMerge(target, source) {
365
+ if (source) {
366
+ for (var s in source) {
367
+ if (source.hasOwnProperty(s)) {
368
+ var value = source[s];
369
+
370
+ if (typeof value === 'object' && typeof target[s] === 'object') {
371
+ target[s] = _extends({}, target[s], value);
372
+ } else {
373
+ target[s] = value;
374
+ }
375
+ }
376
+ }
377
+ }
378
+
379
+ return target;
380
+ }
381
+
382
+ var required$1 = function required(rule, value, source, errors, options, type) {
383
+ if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
384
+ errors.push(format(options.messages.required, rule.fullField));
385
+ }
386
+ };
387
+
388
+ /**
389
+ * Rule for validating whitespace.
390
+ *
391
+ * @param rule The validation rule.
392
+ * @param value The value of the field on the source object.
393
+ * @param source The source object being validated.
394
+ * @param errors An array of errors that this rule may add
395
+ * validation errors to.
396
+ * @param options The validation options.
397
+ * @param options.messages The validation messages.
398
+ */
399
+
400
+ var whitespace = function whitespace(rule, value, source, errors, options) {
401
+ if (/^\s+$/.test(value) || value === '') {
402
+ errors.push(format(options.messages.whitespace, rule.fullField));
403
+ }
404
+ };
405
+
406
+ // https://github.com/kevva/url-regex/blob/master/index.js
407
+ var urlReg;
408
+ var getUrlRegex = (function () {
409
+ if (urlReg) {
410
+ return urlReg;
411
+ }
412
+
413
+ var word = '[a-fA-F\\d:]';
414
+
415
+ var b = function b(options) {
416
+ return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : '';
417
+ };
418
+
419
+ var v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}';
420
+ var v6seg = '[a-fA-F\\d]{1,4}';
421
+ var v6 = ("\n(?:\n(?:" + v6seg + ":){7}(?:" + v6seg + "|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:" + v6seg + ":){6}(?:" + v4 + "|:" + v6seg + "|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:" + v6seg + ":){5}(?::" + v4 + "|(?::" + v6seg + "){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:" + v6seg + ":){4}(?:(?::" + v6seg + "){0,1}:" + v4 + "|(?::" + v6seg + "){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:" + v6seg + ":){3}(?:(?::" + v6seg + "){0,2}:" + v4 + "|(?::" + v6seg + "){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:" + v6seg + ":){2}(?:(?::" + v6seg + "){0,3}:" + v4 + "|(?::" + v6seg + "){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:" + v6seg + ":){1}(?:(?::" + v6seg + "){0,4}:" + v4 + "|(?::" + v6seg + "){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + v6seg + "){0,5}:" + v4 + "|(?::" + v6seg + "){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim(); // Pre-compile only the exact regexes because adding a global flag make regexes stateful
422
+
423
+ var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)");
424
+ var v4exact = new RegExp("^" + v4 + "$");
425
+ var v6exact = new RegExp("^" + v6 + "$");
426
+
427
+ var ip = function ip(options) {
428
+ return options && options.exact ? v46Exact : new RegExp("(?:" + b(options) + v4 + b(options) + ")|(?:" + b(options) + v6 + b(options) + ")", 'g');
429
+ };
430
+
431
+ ip.v4 = function (options) {
432
+ return options && options.exact ? v4exact : new RegExp("" + b(options) + v4 + b(options), 'g');
433
+ };
434
+
435
+ ip.v6 = function (options) {
436
+ return options && options.exact ? v6exact : new RegExp("" + b(options) + v6 + b(options), 'g');
437
+ };
438
+
439
+ var protocol = "(?:(?:[a-z]+:)?//)";
440
+ var auth = '(?:\\S+(?::\\S*)?@)?';
441
+ var ipv4 = ip.v4().source;
442
+ var ipv6 = ip.v6().source;
443
+ var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)";
444
+ var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*";
445
+ var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
446
+ var port = '(?::\\d{2,5})?';
447
+ var path = '(?:[/?#][^\\s"]*)?';
448
+ var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|" + host + domain + tld + ")" + port + path;
449
+ urlReg = new RegExp("(?:^" + regex + "$)", 'i');
450
+ return urlReg;
451
+ });
452
+
453
+ /* eslint max-len:0 */
454
+
455
+ var pattern$2 = {
456
+ // http://emailregex.com/
457
+ email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
458
+ // url: new RegExp(
459
+ // '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
460
+ // 'i',
461
+ // ),
462
+ hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
463
+ };
464
+ var types = {
465
+ integer: function integer(value) {
466
+ return types.number(value) && parseInt(value, 10) === value;
467
+ },
468
+ "float": function float(value) {
469
+ return types.number(value) && !types.integer(value);
470
+ },
471
+ array: function array(value) {
472
+ return Array.isArray(value);
473
+ },
474
+ regexp: function regexp(value) {
475
+ if (value instanceof RegExp) {
476
+ return true;
477
+ }
478
+
479
+ try {
480
+ return !!new RegExp(value);
481
+ } catch (e) {
482
+ return false;
483
+ }
484
+ },
485
+ date: function date(value) {
486
+ return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function' && !isNaN(value.getTime());
487
+ },
488
+ number: function number(value) {
489
+ if (isNaN(value)) {
490
+ return false;
491
+ }
492
+
493
+ return typeof value === 'number';
494
+ },
495
+ object: function object(value) {
496
+ return typeof value === 'object' && !types.array(value);
497
+ },
498
+ method: function method(value) {
499
+ return typeof value === 'function';
500
+ },
501
+ email: function email(value) {
502
+ return typeof value === 'string' && value.length <= 320 && !!value.match(pattern$2.email);
503
+ },
504
+ url: function url(value) {
505
+ return typeof value === 'string' && value.length <= 2048 && !!value.match(getUrlRegex());
506
+ },
507
+ hex: function hex(value) {
508
+ return typeof value === 'string' && !!value.match(pattern$2.hex);
509
+ }
510
+ };
511
+
512
+ var type$1 = function type(rule, value, source, errors, options) {
513
+ if (rule.required && value === undefined) {
514
+ required$1(rule, value, source, errors, options);
515
+ return;
516
+ }
517
+
518
+ var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
519
+ var ruleType = rule.type;
520
+
521
+ if (custom.indexOf(ruleType) > -1) {
522
+ if (!types[ruleType](value)) {
523
+ errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
524
+ } // straight typeof check
525
+
526
+ } else if (ruleType && typeof value !== rule.type) {
527
+ errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
528
+ }
529
+ };
530
+
531
+ var range = function range(rule, value, source, errors, options) {
532
+ var len = typeof rule.len === 'number';
533
+ var min = typeof rule.min === 'number';
534
+ var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
535
+
536
+ var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
537
+ var val = value;
538
+ var key = null;
539
+ var num = typeof value === 'number';
540
+ var str = typeof value === 'string';
541
+ var arr = Array.isArray(value);
542
+
543
+ if (num) {
544
+ key = 'number';
545
+ } else if (str) {
546
+ key = 'string';
547
+ } else if (arr) {
548
+ key = 'array';
549
+ } // if the value is not of a supported type for range validation
550
+ // the validation rule rule should use the
551
+ // type property to also test for a particular type
552
+
553
+
554
+ if (!key) {
555
+ return false;
556
+ }
557
+
558
+ if (arr) {
559
+ val = value.length;
560
+ }
561
+
562
+ if (str) {
563
+ // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
564
+ val = value.replace(spRegexp, '_').length;
565
+ }
566
+
567
+ if (len) {
568
+ if (val !== rule.len) {
569
+ errors.push(format(options.messages[key].len, rule.fullField, rule.len));
570
+ }
571
+ } else if (min && !max && val < rule.min) {
572
+ errors.push(format(options.messages[key].min, rule.fullField, rule.min));
573
+ } else if (max && !min && val > rule.max) {
574
+ errors.push(format(options.messages[key].max, rule.fullField, rule.max));
575
+ } else if (min && max && (val < rule.min || val > rule.max)) {
576
+ errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
577
+ }
578
+ };
579
+
580
+ var ENUM$1 = 'enum';
581
+
582
+ var enumerable$1 = function enumerable(rule, value, source, errors, options) {
583
+ rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
584
+
585
+ if (rule[ENUM$1].indexOf(value) === -1) {
586
+ errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(', ')));
587
+ }
588
+ };
589
+
590
+ var pattern$1 = function pattern(rule, value, source, errors, options) {
591
+ if (rule.pattern) {
592
+ if (rule.pattern instanceof RegExp) {
593
+ // if a RegExp instance is passed, reset `lastIndex` in case its `global`
594
+ // flag is accidentally set to `true`, which in a validation scenario
595
+ // is not necessary and the result might be misleading
596
+ rule.pattern.lastIndex = 0;
597
+
598
+ if (!rule.pattern.test(value)) {
599
+ errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
600
+ }
601
+ } else if (typeof rule.pattern === 'string') {
602
+ var _pattern = new RegExp(rule.pattern);
603
+
604
+ if (!_pattern.test(value)) {
605
+ errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
606
+ }
607
+ }
608
+ }
609
+ };
610
+
611
+ var rules = {
612
+ required: required$1,
613
+ whitespace: whitespace,
614
+ type: type$1,
615
+ range: range,
616
+ "enum": enumerable$1,
617
+ pattern: pattern$1
618
+ };
619
+
620
+ var string = function string(rule, value, callback, source, options) {
621
+ var errors = [];
622
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
623
+
624
+ if (validate) {
625
+ if (isEmptyValue(value, 'string') && !rule.required) {
626
+ return callback();
627
+ }
628
+
629
+ rules.required(rule, value, source, errors, options, 'string');
630
+
631
+ if (!isEmptyValue(value, 'string')) {
632
+ rules.type(rule, value, source, errors, options);
633
+ rules.range(rule, value, source, errors, options);
634
+ rules.pattern(rule, value, source, errors, options);
635
+
636
+ if (rule.whitespace === true) {
637
+ rules.whitespace(rule, value, source, errors, options);
638
+ }
639
+ }
640
+ }
641
+
642
+ callback(errors);
643
+ };
644
+
645
+ var method = function method(rule, value, callback, source, options) {
646
+ var errors = [];
647
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
648
+
649
+ if (validate) {
650
+ if (isEmptyValue(value) && !rule.required) {
651
+ return callback();
652
+ }
653
+
654
+ rules.required(rule, value, source, errors, options);
655
+
656
+ if (value !== undefined) {
657
+ rules.type(rule, value, source, errors, options);
658
+ }
659
+ }
660
+
661
+ callback(errors);
662
+ };
663
+
664
+ var number = function number(rule, value, callback, source, options) {
665
+ var errors = [];
666
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
667
+
668
+ if (validate) {
669
+ if (value === '') {
670
+ value = undefined;
671
+ }
672
+
673
+ if (isEmptyValue(value) && !rule.required) {
674
+ return callback();
675
+ }
676
+
677
+ rules.required(rule, value, source, errors, options);
678
+
679
+ if (value !== undefined) {
680
+ rules.type(rule, value, source, errors, options);
681
+ rules.range(rule, value, source, errors, options);
682
+ }
683
+ }
684
+
685
+ callback(errors);
686
+ };
687
+
688
+ var _boolean = function _boolean(rule, value, callback, source, options) {
689
+ var errors = [];
690
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
691
+
692
+ if (validate) {
693
+ if (isEmptyValue(value) && !rule.required) {
694
+ return callback();
695
+ }
696
+
697
+ rules.required(rule, value, source, errors, options);
698
+
699
+ if (value !== undefined) {
700
+ rules.type(rule, value, source, errors, options);
701
+ }
702
+ }
703
+
704
+ callback(errors);
705
+ };
706
+
707
+ var regexp = function regexp(rule, value, callback, source, options) {
708
+ var errors = [];
709
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
710
+
711
+ if (validate) {
712
+ if (isEmptyValue(value) && !rule.required) {
713
+ return callback();
714
+ }
715
+
716
+ rules.required(rule, value, source, errors, options);
717
+
718
+ if (!isEmptyValue(value)) {
719
+ rules.type(rule, value, source, errors, options);
720
+ }
721
+ }
722
+
723
+ callback(errors);
724
+ };
725
+
726
+ var integer = function integer(rule, value, callback, source, options) {
727
+ var errors = [];
728
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
729
+
730
+ if (validate) {
731
+ if (isEmptyValue(value) && !rule.required) {
732
+ return callback();
733
+ }
734
+
735
+ rules.required(rule, value, source, errors, options);
736
+
737
+ if (value !== undefined) {
738
+ rules.type(rule, value, source, errors, options);
739
+ rules.range(rule, value, source, errors, options);
740
+ }
741
+ }
742
+
743
+ callback(errors);
744
+ };
745
+
746
+ var floatFn = function floatFn(rule, value, callback, source, options) {
747
+ var errors = [];
748
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
749
+
750
+ if (validate) {
751
+ if (isEmptyValue(value) && !rule.required) {
752
+ return callback();
753
+ }
754
+
755
+ rules.required(rule, value, source, errors, options);
756
+
757
+ if (value !== undefined) {
758
+ rules.type(rule, value, source, errors, options);
759
+ rules.range(rule, value, source, errors, options);
760
+ }
761
+ }
762
+
763
+ callback(errors);
764
+ };
765
+
766
+ var array = function array(rule, value, callback, source, options) {
767
+ var errors = [];
768
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
769
+
770
+ if (validate) {
771
+ if ((value === undefined || value === null) && !rule.required) {
772
+ return callback();
773
+ }
774
+
775
+ rules.required(rule, value, source, errors, options, 'array');
776
+
777
+ if (value !== undefined && value !== null) {
778
+ rules.type(rule, value, source, errors, options);
779
+ rules.range(rule, value, source, errors, options);
780
+ }
781
+ }
782
+
783
+ callback(errors);
784
+ };
785
+
786
+ var object = function object(rule, value, callback, source, options) {
787
+ var errors = [];
788
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
789
+
790
+ if (validate) {
791
+ if (isEmptyValue(value) && !rule.required) {
792
+ return callback();
793
+ }
794
+
795
+ rules.required(rule, value, source, errors, options);
796
+
797
+ if (value !== undefined) {
798
+ rules.type(rule, value, source, errors, options);
799
+ }
800
+ }
801
+
802
+ callback(errors);
803
+ };
804
+
805
+ var ENUM = 'enum';
806
+
807
+ var enumerable = function enumerable(rule, value, callback, source, options) {
808
+ var errors = [];
809
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
810
+
811
+ if (validate) {
812
+ if (isEmptyValue(value) && !rule.required) {
813
+ return callback();
814
+ }
815
+
816
+ rules.required(rule, value, source, errors, options);
817
+
818
+ if (value !== undefined) {
819
+ rules[ENUM](rule, value, source, errors, options);
820
+ }
821
+ }
822
+
823
+ callback(errors);
824
+ };
825
+
826
+ var pattern = function pattern(rule, value, callback, source, options) {
827
+ var errors = [];
828
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
829
+
830
+ if (validate) {
831
+ if (isEmptyValue(value, 'string') && !rule.required) {
832
+ return callback();
833
+ }
834
+
835
+ rules.required(rule, value, source, errors, options);
836
+
837
+ if (!isEmptyValue(value, 'string')) {
838
+ rules.pattern(rule, value, source, errors, options);
839
+ }
840
+ }
841
+
842
+ callback(errors);
843
+ };
844
+
845
+ var date = function date(rule, value, callback, source, options) {
846
+ // console.log('integer rule called %j', rule);
847
+ var errors = [];
848
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); // console.log('validate on %s value', value);
849
+
850
+ if (validate) {
851
+ if (isEmptyValue(value, 'date') && !rule.required) {
852
+ return callback();
853
+ }
854
+
855
+ rules.required(rule, value, source, errors, options);
856
+
857
+ if (!isEmptyValue(value, 'date')) {
858
+ var dateObject;
859
+
860
+ if (value instanceof Date) {
861
+ dateObject = value;
862
+ } else {
863
+ dateObject = new Date(value);
864
+ }
865
+
866
+ rules.type(rule, dateObject, source, errors, options);
867
+
868
+ if (dateObject) {
869
+ rules.range(rule, dateObject.getTime(), source, errors, options);
870
+ }
871
+ }
872
+ }
873
+
874
+ callback(errors);
875
+ };
876
+
877
+ var required = function required(rule, value, callback, source, options) {
878
+ var errors = [];
879
+ var type = Array.isArray(value) ? 'array' : typeof value;
880
+ rules.required(rule, value, source, errors, options, type);
881
+ callback(errors);
882
+ };
883
+
884
+ var type = function type(rule, value, callback, source, options) {
885
+ var ruleType = rule.type;
886
+ var errors = [];
887
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
888
+
889
+ if (validate) {
890
+ if (isEmptyValue(value, ruleType) && !rule.required) {
891
+ return callback();
892
+ }
893
+
894
+ rules.required(rule, value, source, errors, options, ruleType);
895
+
896
+ if (!isEmptyValue(value, ruleType)) {
897
+ rules.type(rule, value, source, errors, options);
898
+ }
899
+ }
900
+
901
+ callback(errors);
902
+ };
903
+
904
+ var any = function any(rule, value, callback, source, options) {
905
+ var errors = [];
906
+ var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
907
+
908
+ if (validate) {
909
+ if (isEmptyValue(value) && !rule.required) {
910
+ return callback();
911
+ }
912
+
913
+ rules.required(rule, value, source, errors, options);
914
+ }
915
+
916
+ callback(errors);
917
+ };
918
+
919
+ var validators = {
920
+ string: string,
921
+ method: method,
922
+ number: number,
923
+ "boolean": _boolean,
924
+ regexp: regexp,
925
+ integer: integer,
926
+ "float": floatFn,
927
+ array: array,
928
+ object: object,
929
+ "enum": enumerable,
930
+ pattern: pattern,
931
+ date: date,
932
+ url: type,
933
+ hex: type,
934
+ email: type,
935
+ required: required,
936
+ any: any
937
+ };
938
+
939
+ function newMessages() {
940
+ return {
941
+ "default": 'Validation error on field %s',
942
+ required: '%s is required',
943
+ "enum": '%s must be one of %s',
944
+ whitespace: '%s cannot be empty',
945
+ date: {
946
+ format: '%s date %s is invalid for format %s',
947
+ parse: '%s date could not be parsed, %s is invalid ',
948
+ invalid: '%s date %s is invalid'
949
+ },
950
+ types: {
951
+ string: '%s is not a %s',
952
+ method: '%s is not a %s (function)',
953
+ array: '%s is not an %s',
954
+ object: '%s is not an %s',
955
+ number: '%s is not a %s',
956
+ date: '%s is not a %s',
957
+ "boolean": '%s is not a %s',
958
+ integer: '%s is not an %s',
959
+ "float": '%s is not a %s',
960
+ regexp: '%s is not a valid %s',
961
+ email: '%s is not a valid %s',
962
+ url: '%s is not a valid %s',
963
+ hex: '%s is not a valid %s'
964
+ },
965
+ string: {
966
+ len: '%s must be exactly %s characters',
967
+ min: '%s must be at least %s characters',
968
+ max: '%s cannot be longer than %s characters',
969
+ range: '%s must be between %s and %s characters'
970
+ },
971
+ number: {
972
+ len: '%s must equal %s',
973
+ min: '%s cannot be less than %s',
974
+ max: '%s cannot be greater than %s',
975
+ range: '%s must be between %s and %s'
976
+ },
977
+ array: {
978
+ len: '%s must be exactly %s in length',
979
+ min: '%s cannot be less than %s in length',
980
+ max: '%s cannot be greater than %s in length',
981
+ range: '%s must be between %s and %s in length'
982
+ },
983
+ pattern: {
984
+ mismatch: '%s value %s does not match pattern %s'
985
+ },
986
+ clone: function clone() {
987
+ var cloned = JSON.parse(JSON.stringify(this));
988
+ cloned.clone = this.clone;
989
+ return cloned;
990
+ }
991
+ };
992
+ }
993
+ var messages = newMessages();
994
+
995
+ /**
996
+ * Encapsulates a validation schema.
997
+ *
998
+ * @param descriptor An object declaring validation rules
999
+ * for this schema.
1000
+ */
1001
+
1002
+ var Schema = /*#__PURE__*/function () {
1003
+ // ========================= Static =========================
1004
+ // ======================== Instance ========================
1005
+ function Schema(descriptor) {
1006
+ this.rules = null;
1007
+ this._messages = messages;
1008
+ this.define(descriptor);
1009
+ }
1010
+
1011
+ var _proto = Schema.prototype;
1012
+
1013
+ _proto.define = function define(rules) {
1014
+ var _this = this;
1015
+
1016
+ if (!rules) {
1017
+ throw new Error('Cannot configure a schema with no rules');
1018
+ }
1019
+
1020
+ if (typeof rules !== 'object' || Array.isArray(rules)) {
1021
+ throw new Error('Rules must be an object');
1022
+ }
1023
+
1024
+ this.rules = {};
1025
+ Object.keys(rules).forEach(function (name) {
1026
+ var item = rules[name];
1027
+ _this.rules[name] = Array.isArray(item) ? item : [item];
1028
+ });
1029
+ };
1030
+
1031
+ _proto.messages = function messages(_messages) {
1032
+ if (_messages) {
1033
+ this._messages = deepMerge(newMessages(), _messages);
1034
+ }
1035
+
1036
+ return this._messages;
1037
+ };
1038
+
1039
+ _proto.validate = function validate(source_, o, oc) {
1040
+ var _this2 = this;
1041
+
1042
+ if (o === void 0) {
1043
+ o = {};
1044
+ }
1045
+
1046
+ if (oc === void 0) {
1047
+ oc = function oc() {};
1048
+ }
1049
+
1050
+ var source = source_;
1051
+ var options = o;
1052
+ var callback = oc;
1053
+
1054
+ if (typeof options === 'function') {
1055
+ callback = options;
1056
+ options = {};
1057
+ }
1058
+
1059
+ if (!this.rules || Object.keys(this.rules).length === 0) {
1060
+ if (callback) {
1061
+ callback(null, source);
1062
+ }
1063
+
1064
+ return Promise.resolve(source);
1065
+ }
1066
+
1067
+ function complete(results) {
1068
+ var errors = [];
1069
+ var fields = {};
1070
+
1071
+ function add(e) {
1072
+ if (Array.isArray(e)) {
1073
+ var _errors;
1074
+
1075
+ errors = (_errors = errors).concat.apply(_errors, e);
1076
+ } else {
1077
+ errors.push(e);
1078
+ }
1079
+ }
1080
+
1081
+ for (var i = 0; i < results.length; i++) {
1082
+ add(results[i]);
1083
+ }
1084
+
1085
+ if (!errors.length) {
1086
+ callback(null, source);
1087
+ } else {
1088
+ fields = convertFieldsError(errors);
1089
+ callback(errors, fields);
1090
+ }
1091
+ }
1092
+
1093
+ if (options.messages) {
1094
+ var messages$1 = this.messages();
1095
+
1096
+ if (messages$1 === messages) {
1097
+ messages$1 = newMessages();
1098
+ }
1099
+
1100
+ deepMerge(messages$1, options.messages);
1101
+ options.messages = messages$1;
1102
+ } else {
1103
+ options.messages = this.messages();
1104
+ }
1105
+
1106
+ var series = {};
1107
+ var keys = options.keys || Object.keys(this.rules);
1108
+ keys.forEach(function (z) {
1109
+ var arr = _this2.rules[z];
1110
+ var value = source[z];
1111
+ arr.forEach(function (r) {
1112
+ var rule = r;
1113
+
1114
+ if (typeof rule.transform === 'function') {
1115
+ if (source === source_) {
1116
+ source = _extends({}, source);
1117
+ }
1118
+
1119
+ value = source[z] = rule.transform(value);
1120
+ }
1121
+
1122
+ if (typeof rule === 'function') {
1123
+ rule = {
1124
+ validator: rule
1125
+ };
1126
+ } else {
1127
+ rule = _extends({}, rule);
1128
+ } // Fill validator. Skip if nothing need to validate
1129
+
1130
+
1131
+ rule.validator = _this2.getValidationMethod(rule);
1132
+
1133
+ if (!rule.validator) {
1134
+ return;
1135
+ }
1136
+
1137
+ rule.field = z;
1138
+ rule.fullField = rule.fullField || z;
1139
+ rule.type = _this2.getType(rule);
1140
+ series[z] = series[z] || [];
1141
+ series[z].push({
1142
+ rule: rule,
1143
+ value: value,
1144
+ source: source,
1145
+ field: z
1146
+ });
1147
+ });
1148
+ });
1149
+ var errorFields = {};
1150
+ return asyncMap(series, options, function (data, doIt) {
1151
+ var rule = data.rule;
1152
+ var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField === 'object');
1153
+ deep = deep && (rule.required || !rule.required && data.value);
1154
+ rule.field = data.field;
1155
+
1156
+ function addFullField(key, schema) {
1157
+ return _extends({}, schema, {
1158
+ fullField: rule.fullField + "." + key,
1159
+ fullFields: rule.fullFields ? [].concat(rule.fullFields, [key]) : [key]
1160
+ });
1161
+ }
1162
+
1163
+ function cb(e) {
1164
+ if (e === void 0) {
1165
+ e = [];
1166
+ }
1167
+
1168
+ var errorList = Array.isArray(e) ? e : [e];
1169
+
1170
+ if (!options.suppressWarning && errorList.length) {
1171
+ Schema.warning('async-validator:', errorList);
1172
+ }
1173
+
1174
+ if (errorList.length && rule.message !== undefined) {
1175
+ errorList = [].concat(rule.message);
1176
+ } // Fill error info
1177
+
1178
+
1179
+ var filledErrors = errorList.map(complementError(rule, source));
1180
+
1181
+ if (options.first && filledErrors.length) {
1182
+ errorFields[rule.field] = 1;
1183
+ return doIt(filledErrors);
1184
+ }
1185
+
1186
+ if (!deep) {
1187
+ doIt(filledErrors);
1188
+ } else {
1189
+ // if rule is required but the target object
1190
+ // does not exist fail at the rule level and don't
1191
+ // go deeper
1192
+ if (rule.required && !data.value) {
1193
+ if (rule.message !== undefined) {
1194
+ filledErrors = [].concat(rule.message).map(complementError(rule, source));
1195
+ } else if (options.error) {
1196
+ filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
1197
+ }
1198
+
1199
+ return doIt(filledErrors);
1200
+ }
1201
+
1202
+ var fieldsSchema = {};
1203
+
1204
+ if (rule.defaultField) {
1205
+ Object.keys(data.value).map(function (key) {
1206
+ fieldsSchema[key] = rule.defaultField;
1207
+ });
1208
+ }
1209
+
1210
+ fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
1211
+ var paredFieldsSchema = {};
1212
+ Object.keys(fieldsSchema).forEach(function (field) {
1213
+ var fieldSchema = fieldsSchema[field];
1214
+ var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema];
1215
+ paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field));
1216
+ });
1217
+ var schema = new Schema(paredFieldsSchema);
1218
+ schema.messages(options.messages);
1219
+
1220
+ if (data.rule.options) {
1221
+ data.rule.options.messages = options.messages;
1222
+ data.rule.options.error = options.error;
1223
+ }
1224
+
1225
+ schema.validate(data.value, data.rule.options || options, function (errs) {
1226
+ var finalErrors = [];
1227
+
1228
+ if (filledErrors && filledErrors.length) {
1229
+ finalErrors.push.apply(finalErrors, filledErrors);
1230
+ }
1231
+
1232
+ if (errs && errs.length) {
1233
+ finalErrors.push.apply(finalErrors, errs);
1234
+ }
1235
+
1236
+ doIt(finalErrors.length ? finalErrors : null);
1237
+ });
1238
+ }
1239
+ }
1240
+
1241
+ var res;
1242
+
1243
+ if (rule.asyncValidator) {
1244
+ res = rule.asyncValidator(rule, data.value, cb, data.source, options);
1245
+ } else if (rule.validator) {
1246
+ try {
1247
+ res = rule.validator(rule, data.value, cb, data.source, options);
1248
+ } catch (error) {
1249
+ console.error == null ? void 0 : console.error(error); // rethrow to report error
1250
+
1251
+ if (!options.suppressValidatorError) {
1252
+ setTimeout(function () {
1253
+ throw error;
1254
+ }, 0);
1255
+ }
1256
+
1257
+ cb(error.message);
1258
+ }
1259
+
1260
+ if (res === true) {
1261
+ cb();
1262
+ } else if (res === false) {
1263
+ cb(typeof rule.message === 'function' ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails");
1264
+ } else if (res instanceof Array) {
1265
+ cb(res);
1266
+ } else if (res instanceof Error) {
1267
+ cb(res.message);
1268
+ }
1269
+ }
1270
+
1271
+ if (res && res.then) {
1272
+ res.then(function () {
1273
+ return cb();
1274
+ }, function (e) {
1275
+ return cb(e);
1276
+ });
1277
+ }
1278
+ }, function (results) {
1279
+ complete(results);
1280
+ }, source);
1281
+ };
1282
+
1283
+ _proto.getType = function getType(rule) {
1284
+ if (rule.type === undefined && rule.pattern instanceof RegExp) {
1285
+ rule.type = 'pattern';
1286
+ }
1287
+
1288
+ if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
1289
+ throw new Error(format('Unknown rule type %s', rule.type));
1290
+ }
1291
+
1292
+ return rule.type || 'string';
1293
+ };
1294
+
1295
+ _proto.getValidationMethod = function getValidationMethod(rule) {
1296
+ if (typeof rule.validator === 'function') {
1297
+ return rule.validator;
1298
+ }
1299
+
1300
+ var keys = Object.keys(rule);
1301
+ var messageIndex = keys.indexOf('message');
1302
+
1303
+ if (messageIndex !== -1) {
1304
+ keys.splice(messageIndex, 1);
1305
+ }
1306
+
1307
+ if (keys.length === 1 && keys[0] === 'required') {
1308
+ return validators.required;
1309
+ }
1310
+
1311
+ return validators[this.getType(rule)] || undefined;
1312
+ };
1313
+
1314
+ return Schema;
1315
+ }();
1316
+
1317
+ Schema.register = function register(type, validator) {
1318
+ if (typeof validator !== 'function') {
1319
+ throw new Error('Cannot register a validator by type, validator is not a function');
1320
+ }
1321
+
1322
+ validators[type] = validator;
1323
+ };
1324
+
1325
+ Schema.warning = warning;
1326
+ Schema.messages = messages;
1327
+ Schema.validators = validators;
1328
+
1329
+ export { Schema as default };