vxe-pc-ui 0.0.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (775) hide show
  1. package/README.md +7 -0
  2. package/es/{anchor-link → anchor}/src/anchor-link.js +2 -2
  3. package/es/anchor/src/anchor.js +1 -1
  4. package/es/{anchor-link → anchor}/src/util.js +1 -1
  5. package/es/anchor-link/index.js +1 -1
  6. package/es/{button-group → button}/src/button-group.js +2 -2
  7. package/es/button/src/button.js +3 -3
  8. package/es/button/style.css +17 -17
  9. package/es/button/style.min.css +1 -1
  10. package/es/button-group/index.js +1 -1
  11. package/es/checkbox/index.js +10 -0
  12. package/es/checkbox/src/checkbox.js +116 -0
  13. package/es/checkbox/src/group.js +108 -0
  14. package/es/checkbox/style.css +107 -0
  15. package/es/checkbox/style.min.css +1 -0
  16. package/es/checkbox-group/index.js +10 -0
  17. package/es/col/index.js +1 -1
  18. package/es/components.js +104 -35
  19. package/es/dynamics/index.js +27 -0
  20. package/es/form/index.js +8 -0
  21. package/es/form/src/form-config-item.js +178 -0
  22. package/es/form/src/form-gather.js +47 -0
  23. package/es/form/src/form-item.js +228 -0
  24. package/es/form/src/form.js +665 -0
  25. package/es/form/src/itemInfo.js +39 -0
  26. package/es/form/src/render.js +68 -0
  27. package/es/form/src/util.js +65 -0
  28. package/es/form/style.css +321 -0
  29. package/es/form/style.min.css +1 -0
  30. package/es/form-design/index.js +8 -0
  31. package/es/form-design/src/form-design.js +79 -0
  32. package/es/form-design/src/setting.js +12 -0
  33. package/es/form-design/src/util.js +8 -0
  34. package/es/form-design/src/view.js +113 -0
  35. package/es/form-design/src/widget.js +104 -0
  36. package/es/form-design/style.css +97 -0
  37. package/es/form-design/style.min.css +1 -0
  38. package/es/form-gather/index.js +8 -0
  39. package/es/form-item/index.js +8 -0
  40. package/es/icon/style.css +540 -1
  41. package/es/icon/style.min.css +1 -1
  42. package/es/input/index.js +10 -0
  43. package/es/input/src/date.js +41 -0
  44. package/es/input/src/input.js +2333 -0
  45. package/es/input/src/number.js +10 -0
  46. package/es/input/style.css +1000 -0
  47. package/es/input/style.min.css +1 -0
  48. package/es/layout-aside/src/layout-aside.js +4 -2
  49. package/es/layout-aside/style.css +3 -0
  50. package/es/layout-aside/style.min.css +1 -1
  51. package/es/layout-body/src/layout-body.js +7 -2
  52. package/es/layout-body/style.css +3 -0
  53. package/es/layout-body/style.min.css +1 -1
  54. package/es/layout-container/src/layout-container.js +2 -1
  55. package/es/layout-footer/src/layout-footer.js +5 -3
  56. package/es/layout-footer/style.css +3 -0
  57. package/es/layout-footer/style.min.css +1 -1
  58. package/es/list-design/index.js +8 -0
  59. package/es/{design/src/design.js → list-design/src/list-design.js} +7 -7
  60. package/es/loading/index.js +8 -0
  61. package/es/loading/src/loading.js +53 -0
  62. package/es/loading/style.css +75 -0
  63. package/es/loading/style.min.css +1 -0
  64. package/es/modal/index.js +96 -0
  65. package/es/modal/src/modal.js +876 -0
  66. package/es/modal/style.css +323 -0
  67. package/es/modal/style.min.css +1 -0
  68. package/es/optgroup/index.js +10 -0
  69. package/es/optgroup/style.css +0 -0
  70. package/es/optgroup/style.min.css +0 -0
  71. package/es/option/index.js +10 -0
  72. package/es/option/style.css +0 -0
  73. package/es/option/style.min.css +0 -0
  74. package/es/pager/index.js +10 -0
  75. package/es/pager/src/pager.js +539 -0
  76. package/es/pager/style.css +319 -0
  77. package/es/pager/style.min.css +1 -0
  78. package/es/pulldown/index.js +10 -0
  79. package/es/pulldown/src/pulldown.js +328 -0
  80. package/es/pulldown/style.css +57 -0
  81. package/es/pulldown/style.min.css +1 -0
  82. package/es/radio/index.js +10 -0
  83. package/es/radio/src/button.js +113 -0
  84. package/es/radio/src/group.js +93 -0
  85. package/es/radio/src/radio.js +118 -0
  86. package/es/radio/style.css +143 -0
  87. package/es/radio/style.min.css +1 -0
  88. package/es/radio-button/index.js +10 -0
  89. package/es/radio-button/style.css +0 -0
  90. package/es/radio-button/style.min.css +0 -0
  91. package/es/radio-group/index.js +10 -0
  92. package/es/radio-group/style.css +0 -0
  93. package/es/radio-group/style.min.css +0 -0
  94. package/es/select/index.js +10 -0
  95. package/es/select/src/optgroup.js +31 -0
  96. package/es/select/src/option.js +31 -0
  97. package/es/select/src/optionInfo.js +16 -0
  98. package/es/select/src/select.js +992 -0
  99. package/es/select/src/util.js +36 -0
  100. package/es/select/style.css +201 -0
  101. package/es/select/style.min.css +1 -0
  102. package/es/style.css +1 -1
  103. package/es/style.min.css +1 -1
  104. package/es/switch/index.js +10 -0
  105. package/es/switch/src/switch.js +151 -0
  106. package/es/switch/style.css +97 -0
  107. package/es/switch/style.min.css +1 -0
  108. package/es/tab-pane/index.js +8 -0
  109. package/es/tab-pane/style.css +0 -0
  110. package/es/tab-pane/style.min.css +0 -0
  111. package/es/tabs/index.js +8 -0
  112. package/es/tabs/src/tab-pane.js +64 -0
  113. package/es/tabs/src/tabs.js +195 -0
  114. package/es/tabs/src/util.js +17 -0
  115. package/es/tabs/style.css +113 -0
  116. package/es/tabs/style.min.css +1 -0
  117. package/es/textarea/index.js +10 -0
  118. package/es/textarea/src/textarea.js +245 -0
  119. package/es/textarea/style.css +102 -0
  120. package/es/textarea/style.min.css +1 -0
  121. package/es/tooltip/index.js +8 -0
  122. package/es/tooltip/src/tooltip.js +336 -0
  123. package/es/tooltip/style.css +103 -0
  124. package/es/tooltip/style.min.css +1 -0
  125. package/es/ui/src/core.js +12 -2
  126. package/es/ui/src/dom.js +20 -0
  127. package/es/ui/src/globalStore.js +119 -4
  128. package/es/ui/src/i18n.js +7 -0
  129. package/es/ui/src/log.js +2 -2
  130. package/es/ui/src/renderer.js +67 -0
  131. package/es/ui/src/store.js +41 -0
  132. package/es/ui/src/utils.js +10 -0
  133. package/es/ui/src/validators.js +5 -0
  134. package/es/ui/src/vn.js +10 -0
  135. package/es/vxe-button/style.css +17 -17
  136. package/es/vxe-button/style.min.css +1 -1
  137. package/es/vxe-checkbox/index.js +3 -0
  138. package/es/vxe-checkbox/style.css +107 -0
  139. package/es/vxe-checkbox/style.min.css +1 -0
  140. package/es/vxe-checkbox-group/index.js +3 -0
  141. package/es/vxe-checkbox-group/style.css +0 -0
  142. package/es/vxe-checkbox-group/style.min.css +0 -0
  143. package/es/vxe-form/index.js +3 -0
  144. package/es/vxe-form/style.css +321 -0
  145. package/es/vxe-form/style.min.css +1 -0
  146. package/es/vxe-form-design/index.js +3 -0
  147. package/es/vxe-form-design/style.css +97 -0
  148. package/es/vxe-form-design/style.min.css +1 -0
  149. package/es/vxe-form-gather/index.js +3 -0
  150. package/es/vxe-form-gather/style.css +0 -0
  151. package/es/vxe-form-gather/style.min.css +0 -0
  152. package/es/vxe-form-item/index.js +3 -0
  153. package/es/vxe-form-item/style.css +0 -0
  154. package/es/vxe-form-item/style.min.css +0 -0
  155. package/es/vxe-icon/style.css +540 -1
  156. package/es/vxe-icon/style.min.css +1 -1
  157. package/es/vxe-input/index.js +3 -0
  158. package/es/vxe-input/style.css +1000 -0
  159. package/es/vxe-input/style.min.css +1 -0
  160. package/es/vxe-layout-aside/style.css +3 -0
  161. package/es/vxe-layout-aside/style.min.css +1 -1
  162. package/es/vxe-layout-body/style.css +3 -0
  163. package/es/vxe-layout-body/style.min.css +1 -1
  164. package/es/vxe-layout-footer/style.css +3 -0
  165. package/es/vxe-layout-footer/style.min.css +1 -1
  166. package/es/vxe-list-design/index.js +3 -0
  167. package/es/vxe-list-design/style.css +0 -0
  168. package/es/vxe-list-design/style.min.css +0 -0
  169. package/es/vxe-loading/index.js +3 -0
  170. package/es/vxe-loading/style.css +75 -0
  171. package/es/vxe-loading/style.min.css +1 -0
  172. package/es/vxe-modal/index.js +3 -0
  173. package/es/vxe-modal/style.css +323 -0
  174. package/es/vxe-modal/style.min.css +1 -0
  175. package/es/vxe-optgroup/index.js +3 -0
  176. package/es/vxe-optgroup/style.css +0 -0
  177. package/es/vxe-optgroup/style.min.css +0 -0
  178. package/es/vxe-option/index.js +3 -0
  179. package/es/vxe-option/style.css +0 -0
  180. package/es/vxe-option/style.min.css +0 -0
  181. package/es/vxe-pager/index.js +3 -0
  182. package/es/vxe-pager/style.css +319 -0
  183. package/es/vxe-pager/style.min.css +1 -0
  184. package/es/vxe-pulldown/index.js +3 -0
  185. package/es/vxe-pulldown/style.css +57 -0
  186. package/es/vxe-pulldown/style.min.css +1 -0
  187. package/es/vxe-radio/index.js +3 -0
  188. package/es/vxe-radio/style.css +143 -0
  189. package/es/vxe-radio/style.min.css +1 -0
  190. package/es/vxe-radio-button/index.js +3 -0
  191. package/es/vxe-radio-button/style.css +0 -0
  192. package/es/vxe-radio-button/style.min.css +0 -0
  193. package/es/vxe-radio-group/index.js +3 -0
  194. package/es/vxe-radio-group/style.css +0 -0
  195. package/es/vxe-radio-group/style.min.css +0 -0
  196. package/es/vxe-select/index.js +3 -0
  197. package/es/vxe-select/style.css +201 -0
  198. package/es/vxe-select/style.min.css +1 -0
  199. package/es/vxe-switch/index.js +3 -0
  200. package/es/vxe-switch/style.css +97 -0
  201. package/es/vxe-switch/style.min.css +1 -0
  202. package/es/vxe-tab-pane/index.js +3 -0
  203. package/es/vxe-tab-pane/style.css +0 -0
  204. package/es/vxe-tab-pane/style.min.css +0 -0
  205. package/es/vxe-tabs/index.js +3 -0
  206. package/es/vxe-tabs/style.css +113 -0
  207. package/es/vxe-tabs/style.min.css +1 -0
  208. package/es/vxe-textarea/index.js +3 -0
  209. package/es/vxe-textarea/style.css +102 -0
  210. package/es/vxe-textarea/style.min.css +1 -0
  211. package/es/vxe-tooltip/index.js +3 -0
  212. package/es/vxe-tooltip/style.css +103 -0
  213. package/es/vxe-tooltip/style.min.css +1 -0
  214. package/lib/{anchor-link → anchor}/src/anchor-link.js +1 -1
  215. package/lib/{anchor-link → anchor}/src/anchor-link.min.js +1 -1
  216. package/lib/anchor/src/anchor.js +1 -1
  217. package/lib/anchor/src/anchor.min.js +1 -1
  218. package/lib/{anchor-link → anchor}/src/util.js +2 -2
  219. package/lib/anchor/src/util.min.js +1 -0
  220. package/lib/anchor-link/index.js +1 -1
  221. package/lib/anchor-link/index.min.js +1 -1
  222. package/lib/{button-group → button}/src/button-group.js +2 -2
  223. package/lib/button/src/button-group.min.js +1 -0
  224. package/lib/button/src/button.js +3 -3
  225. package/lib/button/src/button.min.js +1 -1
  226. package/lib/button/style/style.css +17 -17
  227. package/lib/button/style/style.min.css +1 -1
  228. package/lib/button-group/index.js +1 -1
  229. package/lib/button-group/index.min.js +1 -1
  230. package/lib/checkbox/index.js +17 -0
  231. package/lib/checkbox/index.min.js +1 -0
  232. package/lib/checkbox/src/checkbox.js +144 -0
  233. package/lib/checkbox/src/checkbox.min.js +1 -0
  234. package/lib/checkbox/src/group.js +129 -0
  235. package/lib/checkbox/src/group.min.js +1 -0
  236. package/lib/checkbox/style/style.css +107 -0
  237. package/lib/checkbox/style/style.min.css +1 -0
  238. package/lib/checkbox-group/index.js +17 -0
  239. package/lib/checkbox-group/index.min.js +1 -0
  240. package/lib/checkbox-group/style/style.css +0 -0
  241. package/lib/checkbox-group/style/style.min.css +0 -0
  242. package/lib/col/index.js +1 -1
  243. package/lib/col/index.min.js +1 -1
  244. package/lib/components.js +314 -63
  245. package/lib/components.min.js +1 -1
  246. package/lib/dynamics/index.js +36 -0
  247. package/lib/dynamics/index.min.js +1 -0
  248. package/lib/form/index.js +15 -0
  249. package/lib/form/index.min.js +1 -0
  250. package/lib/form/src/form-config-item.js +192 -0
  251. package/lib/form/src/form-config-item.min.js +1 -0
  252. package/lib/form/src/form-gather.js +57 -0
  253. package/lib/form/src/form-gather.min.js +1 -0
  254. package/lib/form/src/form-item.js +247 -0
  255. package/lib/form/src/form-item.min.js +1 -0
  256. package/lib/form/src/form.js +768 -0
  257. package/lib/form/src/form.min.js +1 -0
  258. package/lib/form/src/itemInfo.js +47 -0
  259. package/lib/form/src/itemInfo.min.js +1 -0
  260. package/lib/form/src/render.js +84 -0
  261. package/lib/form/src/render.min.js +1 -0
  262. package/lib/form/src/util.js +108 -0
  263. package/lib/form/src/util.min.js +1 -0
  264. package/lib/form/style/index.js +1 -0
  265. package/lib/form/style/style.css +321 -0
  266. package/lib/form/style/style.min.css +1 -0
  267. package/lib/form-design/index.js +15 -0
  268. package/lib/form-design/index.min.js +1 -0
  269. package/lib/form-design/src/form-design.js +87 -0
  270. package/lib/form-design/src/form-design.min.js +1 -0
  271. package/lib/form-design/src/setting.js +18 -0
  272. package/lib/form-design/src/setting.min.js +1 -0
  273. package/lib/form-design/src/util.js +17 -0
  274. package/lib/form-design/src/util.min.js +1 -0
  275. package/lib/form-design/src/view.js +147 -0
  276. package/lib/form-design/src/view.min.js +1 -0
  277. package/lib/form-design/src/widget.js +114 -0
  278. package/lib/form-design/src/widget.min.js +1 -0
  279. package/lib/form-design/style/index.js +1 -0
  280. package/lib/form-design/style/style.css +97 -0
  281. package/lib/form-design/style/style.min.css +1 -0
  282. package/lib/form-gather/index.js +15 -0
  283. package/lib/form-gather/index.min.js +1 -0
  284. package/lib/form-gather/style/index.js +1 -0
  285. package/lib/form-gather/style/style.css +0 -0
  286. package/lib/form-gather/style/style.min.css +0 -0
  287. package/lib/form-item/index.js +15 -0
  288. package/lib/form-item/index.min.js +1 -0
  289. package/lib/form-item/style/index.js +1 -0
  290. package/lib/form-item/style/style.css +0 -0
  291. package/lib/form-item/style/style.min.css +0 -0
  292. package/lib/icon/style/style.css +540 -1
  293. package/lib/icon/style/style.min.css +1 -1
  294. package/lib/index.umd.js +11125 -800
  295. package/lib/index.umd.min.js +1 -1
  296. package/lib/input/index.js +17 -0
  297. package/lib/input/index.min.js +1 -0
  298. package/lib/input/src/date.js +46 -0
  299. package/lib/input/src/date.min.js +1 -0
  300. package/lib/input/src/input.js +2546 -0
  301. package/lib/input/src/input.min.js +1 -0
  302. package/lib/input/src/number.js +18 -0
  303. package/lib/input/src/number.min.js +1 -0
  304. package/lib/input/style/index.js +1 -0
  305. package/lib/input/style/style.css +1000 -0
  306. package/lib/input/style/style.min.css +1 -0
  307. package/lib/layout-aside/src/layout-aside.js +5 -2
  308. package/lib/layout-aside/src/layout-aside.min.js +1 -1
  309. package/lib/layout-aside/style/style.css +3 -0
  310. package/lib/layout-aside/style/style.min.css +1 -1
  311. package/lib/layout-body/src/layout-body.js +9 -2
  312. package/lib/layout-body/src/layout-body.min.js +1 -1
  313. package/lib/layout-body/style/style.css +3 -0
  314. package/lib/layout-body/style/style.min.css +1 -1
  315. package/lib/layout-container/src/layout-container.js +4 -1
  316. package/lib/layout-container/src/layout-container.min.js +1 -1
  317. package/lib/layout-footer/src/layout-footer.js +8 -3
  318. package/lib/layout-footer/src/layout-footer.min.js +1 -1
  319. package/lib/layout-footer/style/style.css +3 -0
  320. package/lib/layout-footer/style/style.min.css +1 -1
  321. package/lib/list-design/index.js +15 -0
  322. package/lib/list-design/index.min.js +1 -0
  323. package/lib/{design/src/design.js → list-design/src/list-design.js} +7 -7
  324. package/lib/list-design/src/list-design.min.js +1 -0
  325. package/lib/list-design/style/index.js +1 -0
  326. package/lib/list-design/style/style.css +0 -0
  327. package/lib/list-design/style/style.min.css +0 -0
  328. package/lib/loading/index.js +15 -0
  329. package/lib/loading/index.min.js +1 -0
  330. package/lib/loading/src/loading.js +49 -0
  331. package/lib/loading/src/loading.min.js +1 -0
  332. package/lib/loading/style/index.js +1 -0
  333. package/lib/loading/style/style.css +75 -0
  334. package/lib/loading/style/style.min.css +1 -0
  335. package/lib/modal/index.js +110 -0
  336. package/lib/modal/index.min.js +1 -0
  337. package/lib/modal/src/modal.js +1064 -0
  338. package/lib/modal/src/modal.min.js +1 -0
  339. package/lib/modal/style/index.js +1 -0
  340. package/lib/modal/style/style.css +323 -0
  341. package/lib/modal/style/style.min.css +1 -0
  342. package/lib/optgroup/index.js +17 -0
  343. package/lib/optgroup/index.min.js +1 -0
  344. package/lib/optgroup/style/index.js +1 -0
  345. package/lib/optgroup/style/style.css +0 -0
  346. package/lib/optgroup/style/style.min.css +0 -0
  347. package/lib/option/index.js +17 -0
  348. package/lib/option/index.min.js +1 -0
  349. package/lib/option/style/index.js +1 -0
  350. package/lib/option/style/style.css +0 -0
  351. package/lib/option/style/style.min.css +0 -0
  352. package/lib/pager/index.js +17 -0
  353. package/lib/pager/index.min.js +1 -0
  354. package/lib/pager/src/pager.js +593 -0
  355. package/lib/pager/src/pager.min.js +1 -0
  356. package/lib/pager/style/index.js +1 -0
  357. package/lib/pager/style/style.css +319 -0
  358. package/lib/pager/style/style.min.css +1 -0
  359. package/lib/pulldown/index.js +17 -0
  360. package/lib/pulldown/index.min.js +1 -0
  361. package/lib/pulldown/src/pulldown.js +359 -0
  362. package/lib/pulldown/src/pulldown.min.js +1 -0
  363. package/lib/pulldown/style/index.js +1 -0
  364. package/lib/pulldown/style/style.css +57 -0
  365. package/lib/pulldown/style/style.min.css +1 -0
  366. package/lib/radio/index.js +17 -0
  367. package/lib/radio/index.min.js +1 -0
  368. package/lib/radio/src/button.js +135 -0
  369. package/lib/radio/src/button.min.js +1 -0
  370. package/lib/radio/src/group.js +108 -0
  371. package/lib/radio/src/group.min.js +1 -0
  372. package/lib/radio/src/radio.js +139 -0
  373. package/lib/radio/src/radio.min.js +1 -0
  374. package/lib/radio/style/index.js +1 -0
  375. package/lib/radio/style/style.css +143 -0
  376. package/lib/radio/style/style.min.css +1 -0
  377. package/lib/radio-button/index.js +17 -0
  378. package/lib/radio-button/index.min.js +1 -0
  379. package/lib/radio-button/style/index.js +1 -0
  380. package/lib/radio-button/style/style.css +0 -0
  381. package/lib/radio-button/style/style.min.css +0 -0
  382. package/lib/radio-group/index.js +17 -0
  383. package/lib/radio-group/index.min.js +1 -0
  384. package/lib/radio-group/style/index.js +1 -0
  385. package/lib/radio-group/style/style.css +0 -0
  386. package/lib/radio-group/style/style.min.css +0 -0
  387. package/lib/select/index.js +17 -0
  388. package/lib/select/index.min.js +1 -0
  389. package/lib/select/src/optgroup.js +47 -0
  390. package/lib/select/src/optgroup.min.js +1 -0
  391. package/lib/select/src/option.js +45 -0
  392. package/lib/select/src/option.min.js +1 -0
  393. package/lib/select/src/optionInfo.js +24 -0
  394. package/lib/select/src/optionInfo.min.js +1 -0
  395. package/lib/select/src/select.js +1104 -0
  396. package/lib/select/src/select.min.js +1 -0
  397. package/lib/select/src/util.js +57 -0
  398. package/lib/select/src/util.min.js +1 -0
  399. package/lib/select/style/index.js +1 -0
  400. package/lib/select/style/style.css +201 -0
  401. package/lib/select/style/style.min.css +1 -0
  402. package/lib/style.css +1 -1
  403. package/lib/style.min.css +1 -1
  404. package/lib/switch/index.js +17 -0
  405. package/lib/switch/index.min.js +1 -0
  406. package/lib/switch/src/switch.js +161 -0
  407. package/lib/switch/src/switch.min.js +1 -0
  408. package/lib/switch/style/index.js +1 -0
  409. package/lib/switch/style/style.css +97 -0
  410. package/lib/switch/style/style.min.css +1 -0
  411. package/lib/tab-pane/index.js +15 -0
  412. package/lib/tab-pane/index.min.js +1 -0
  413. package/lib/tab-pane/style/index.js +1 -0
  414. package/lib/tab-pane/style/style.css +0 -0
  415. package/lib/tab-pane/style/style.min.css +0 -0
  416. package/lib/tabs/index.js +15 -0
  417. package/lib/tabs/index.min.js +1 -0
  418. package/lib/tabs/src/tab-pane.js +73 -0
  419. package/lib/tabs/src/tab-pane.min.js +1 -0
  420. package/lib/tabs/src/tabs.js +240 -0
  421. package/lib/tabs/src/tabs.min.js +1 -0
  422. package/lib/tabs/src/util.js +27 -0
  423. package/lib/tabs/src/util.min.js +1 -0
  424. package/lib/tabs/style/index.js +1 -0
  425. package/lib/tabs/style/style.css +113 -0
  426. package/lib/tabs/style/style.min.css +1 -0
  427. package/lib/textarea/index.js +17 -0
  428. package/lib/textarea/index.min.js +1 -0
  429. package/lib/textarea/src/textarea.js +298 -0
  430. package/lib/textarea/src/textarea.min.js +1 -0
  431. package/lib/textarea/style/index.js +1 -0
  432. package/lib/textarea/style/style.css +102 -0
  433. package/lib/textarea/style/style.min.css +1 -0
  434. package/lib/tooltip/index.js +15 -0
  435. package/lib/tooltip/index.min.js +1 -0
  436. package/lib/tooltip/src/tooltip.js +418 -0
  437. package/lib/tooltip/src/tooltip.min.js +1 -0
  438. package/lib/tooltip/style/index.js +1 -0
  439. package/lib/tooltip/style/style.css +103 -0
  440. package/lib/tooltip/style/style.min.css +1 -0
  441. package/lib/ui/src/core.js +49 -2
  442. package/lib/ui/src/core.min.js +1 -1
  443. package/lib/ui/src/dom.js +22 -0
  444. package/lib/ui/src/dom.min.js +1 -1
  445. package/lib/ui/src/globalStore.js +119 -4
  446. package/lib/ui/src/globalStore.min.js +1 -1
  447. package/lib/ui/src/i18n.js +14 -0
  448. package/lib/ui/src/i18n.min.js +1 -0
  449. package/lib/ui/src/log.js +2 -3
  450. package/lib/ui/src/log.min.js +1 -1
  451. package/lib/ui/src/renderer.js +77 -0
  452. package/lib/ui/src/renderer.min.js +1 -0
  453. package/lib/ui/src/store.js +49 -0
  454. package/lib/ui/src/store.min.js +1 -0
  455. package/lib/ui/src/utils.js +12 -0
  456. package/lib/ui/src/utils.min.js +1 -1
  457. package/lib/ui/src/validators.js +14 -0
  458. package/lib/ui/src/validators.min.js +1 -0
  459. package/lib/ui/src/vn.js +18 -0
  460. package/lib/ui/src/vn.min.js +1 -0
  461. package/lib/vxe-button/style/style.css +17 -17
  462. package/lib/vxe-button/style/style.min.css +1 -1
  463. package/lib/vxe-checkbox/index.js +22 -0
  464. package/lib/vxe-checkbox/index.min.js +1 -0
  465. package/lib/vxe-checkbox/style/index.js +1 -0
  466. package/lib/vxe-checkbox/style/style.css +107 -0
  467. package/lib/vxe-checkbox/style/style.min.css +1 -0
  468. package/lib/vxe-checkbox-group/index.js +22 -0
  469. package/lib/vxe-checkbox-group/index.min.js +1 -0
  470. package/lib/vxe-checkbox-group/style/index.js +1 -0
  471. package/lib/vxe-checkbox-group/style/style.css +0 -0
  472. package/lib/vxe-checkbox-group/style/style.min.css +0 -0
  473. package/lib/{vxe-design → vxe-form}/index.js +5 -5
  474. package/lib/vxe-form/index.min.js +1 -0
  475. package/lib/vxe-form/style/index.js +1 -0
  476. package/lib/vxe-form/style/style.css +321 -0
  477. package/lib/vxe-form/style/style.min.css +1 -0
  478. package/lib/vxe-form-design/index.js +22 -0
  479. package/lib/vxe-form-design/index.min.js +1 -0
  480. package/lib/vxe-form-design/style/index.js +1 -0
  481. package/lib/vxe-form-design/style/style.css +97 -0
  482. package/lib/vxe-form-design/style/style.min.css +1 -0
  483. package/lib/vxe-form-gather/index.js +22 -0
  484. package/lib/vxe-form-gather/index.min.js +1 -0
  485. package/lib/vxe-form-gather/style/index.js +1 -0
  486. package/lib/vxe-form-gather/style/style.css +0 -0
  487. package/lib/vxe-form-gather/style/style.min.css +0 -0
  488. package/lib/vxe-form-item/index.js +22 -0
  489. package/lib/vxe-form-item/index.min.js +1 -0
  490. package/lib/vxe-form-item/style/index.js +1 -0
  491. package/lib/vxe-form-item/style/style.css +0 -0
  492. package/lib/vxe-form-item/style/style.min.css +0 -0
  493. package/lib/vxe-icon/style/style.css +540 -1
  494. package/lib/vxe-icon/style/style.min.css +1 -1
  495. package/lib/vxe-input/index.js +22 -0
  496. package/lib/vxe-input/index.min.js +1 -0
  497. package/lib/vxe-input/style/index.js +1 -0
  498. package/lib/vxe-input/style/style.css +1000 -0
  499. package/lib/vxe-input/style/style.min.css +1 -0
  500. package/lib/vxe-layout-aside/style/style.css +3 -0
  501. package/lib/vxe-layout-aside/style/style.min.css +1 -1
  502. package/lib/vxe-layout-body/style/style.css +3 -0
  503. package/lib/vxe-layout-body/style/style.min.css +1 -1
  504. package/lib/vxe-layout-footer/style/style.css +3 -0
  505. package/lib/vxe-layout-footer/style/style.min.css +1 -1
  506. package/lib/vxe-list-design/index.js +22 -0
  507. package/lib/vxe-list-design/index.min.js +1 -0
  508. package/lib/vxe-list-design/style/index.js +1 -0
  509. package/lib/vxe-list-design/style/style.css +0 -0
  510. package/lib/vxe-list-design/style/style.min.css +0 -0
  511. package/lib/vxe-loading/index.js +22 -0
  512. package/lib/vxe-loading/index.min.js +1 -0
  513. package/lib/vxe-loading/style/index.js +1 -0
  514. package/lib/vxe-loading/style/style.css +75 -0
  515. package/lib/vxe-loading/style/style.min.css +1 -0
  516. package/lib/vxe-modal/index.js +22 -0
  517. package/lib/vxe-modal/index.min.js +1 -0
  518. package/lib/vxe-modal/style/index.js +1 -0
  519. package/lib/vxe-modal/style/style.css +323 -0
  520. package/lib/vxe-modal/style/style.min.css +1 -0
  521. package/lib/vxe-optgroup/index.js +22 -0
  522. package/lib/vxe-optgroup/index.min.js +1 -0
  523. package/lib/vxe-optgroup/style/index.js +1 -0
  524. package/lib/vxe-optgroup/style/style.css +0 -0
  525. package/lib/vxe-optgroup/style/style.min.css +0 -0
  526. package/lib/vxe-option/index.js +22 -0
  527. package/lib/vxe-option/index.min.js +1 -0
  528. package/lib/vxe-option/style/index.js +1 -0
  529. package/lib/vxe-option/style/style.css +0 -0
  530. package/lib/vxe-option/style/style.min.css +0 -0
  531. package/lib/vxe-pager/index.js +22 -0
  532. package/lib/vxe-pager/index.min.js +1 -0
  533. package/lib/vxe-pager/style/index.js +1 -0
  534. package/lib/vxe-pager/style/style.css +319 -0
  535. package/lib/vxe-pager/style/style.min.css +1 -0
  536. package/lib/vxe-pulldown/index.js +22 -0
  537. package/lib/vxe-pulldown/index.min.js +1 -0
  538. package/lib/vxe-pulldown/style/index.js +1 -0
  539. package/lib/vxe-pulldown/style/style.css +57 -0
  540. package/lib/vxe-pulldown/style/style.min.css +1 -0
  541. package/lib/vxe-radio/index.js +22 -0
  542. package/lib/vxe-radio/index.min.js +1 -0
  543. package/lib/vxe-radio/style/index.js +1 -0
  544. package/lib/vxe-radio/style/style.css +143 -0
  545. package/lib/vxe-radio/style/style.min.css +1 -0
  546. package/lib/vxe-radio-button/index.js +22 -0
  547. package/lib/vxe-radio-button/index.min.js +1 -0
  548. package/lib/vxe-radio-button/style/index.js +1 -0
  549. package/lib/vxe-radio-button/style/style.css +0 -0
  550. package/lib/vxe-radio-button/style/style.min.css +0 -0
  551. package/lib/vxe-radio-group/index.js +22 -0
  552. package/lib/vxe-radio-group/index.min.js +1 -0
  553. package/lib/vxe-radio-group/style/index.js +1 -0
  554. package/lib/vxe-radio-group/style/style.css +0 -0
  555. package/lib/vxe-radio-group/style/style.min.css +0 -0
  556. package/lib/vxe-select/index.js +22 -0
  557. package/lib/vxe-select/index.min.js +1 -0
  558. package/lib/vxe-select/style/index.js +1 -0
  559. package/lib/vxe-select/style/style.css +201 -0
  560. package/lib/vxe-select/style/style.min.css +1 -0
  561. package/lib/vxe-switch/index.js +22 -0
  562. package/lib/vxe-switch/index.min.js +1 -0
  563. package/lib/vxe-switch/style/index.js +1 -0
  564. package/lib/vxe-switch/style/style.css +97 -0
  565. package/lib/vxe-switch/style/style.min.css +1 -0
  566. package/lib/vxe-tab-pane/index.js +22 -0
  567. package/lib/vxe-tab-pane/index.min.js +1 -0
  568. package/lib/vxe-tab-pane/style/index.js +1 -0
  569. package/lib/vxe-tab-pane/style/style.css +0 -0
  570. package/lib/vxe-tab-pane/style/style.min.css +0 -0
  571. package/lib/vxe-tabs/index.js +22 -0
  572. package/lib/vxe-tabs/index.min.js +1 -0
  573. package/lib/vxe-tabs/style/index.js +1 -0
  574. package/lib/vxe-tabs/style/style.css +113 -0
  575. package/lib/vxe-tabs/style/style.min.css +1 -0
  576. package/lib/vxe-textarea/index.js +22 -0
  577. package/lib/vxe-textarea/index.min.js +1 -0
  578. package/lib/vxe-textarea/style/index.js +1 -0
  579. package/lib/vxe-textarea/style/style.css +102 -0
  580. package/lib/vxe-textarea/style/style.min.css +1 -0
  581. package/lib/vxe-tooltip/index.js +22 -0
  582. package/lib/vxe-tooltip/index.min.js +1 -0
  583. package/lib/vxe-tooltip/style/index.js +1 -0
  584. package/lib/vxe-tooltip/style/style.css +103 -0
  585. package/lib/vxe-tooltip/style/style.min.css +1 -0
  586. package/package.json +1 -1
  587. package/packages/{anchor-link → anchor}/src/anchor-link.ts +2 -2
  588. package/packages/anchor/src/anchor.ts +1 -1
  589. package/packages/{anchor-link → anchor}/src/util.ts +1 -1
  590. package/packages/anchor-link/index.ts +1 -1
  591. package/packages/{button-group → button}/src/button-group.ts +2 -2
  592. package/packages/button/src/button.ts +3 -3
  593. package/packages/button-group/index.ts +1 -1
  594. package/packages/checkbox/index.ts +15 -0
  595. package/packages/checkbox/src/checkbox.ts +131 -0
  596. package/packages/checkbox/src/group.ts +127 -0
  597. package/packages/checkbox-group/index.ts +15 -0
  598. package/packages/col/index.ts +1 -1
  599. package/packages/components.ts +106 -35
  600. package/packages/dynamics/index.ts +34 -0
  601. package/packages/form/index.ts +11 -0
  602. package/packages/form/src/form-config-item.ts +193 -0
  603. package/packages/form/src/form-gather.ts +60 -0
  604. package/packages/form/src/form-item.ts +253 -0
  605. package/packages/form/src/form.ts +717 -0
  606. package/packages/form/src/itemInfo.ts +43 -0
  607. package/packages/form/src/render.ts +83 -0
  608. package/packages/form/src/util.ts +79 -0
  609. package/packages/form-design/index.ts +11 -0
  610. package/packages/form-design/src/form-design.ts +99 -0
  611. package/packages/form-design/src/setting.ts +13 -0
  612. package/packages/form-design/src/util.ts +10 -0
  613. package/packages/form-design/src/view.ts +125 -0
  614. package/packages/form-design/src/widget.ts +117 -0
  615. package/packages/form-gather/index.ts +11 -0
  616. package/packages/form-item/index.ts +11 -0
  617. package/packages/icon/src/icon.ts +1 -1
  618. package/packages/input/index.ts +15 -0
  619. package/packages/input/src/date.ts +42 -0
  620. package/packages/input/src/input.ts +2480 -0
  621. package/packages/input/src/number.ts +12 -0
  622. package/packages/layout-aside/src/layout-aside.ts +8 -6
  623. package/packages/layout-body/src/layout-body.ts +9 -4
  624. package/packages/layout-container/src/layout-container.ts +5 -4
  625. package/packages/layout-footer/src/layout-footer.ts +7 -5
  626. package/packages/layout-header/src/layout-header.ts +3 -3
  627. package/packages/list-design/index.ts +11 -0
  628. package/packages/list-design/src/list-design.ts +55 -0
  629. package/packages/loading/index.ts +11 -0
  630. package/packages/loading/src/loading.ts +56 -0
  631. package/packages/modal/index.ts +110 -0
  632. package/packages/modal/src/modal.ts +950 -0
  633. package/packages/optgroup/index.ts +15 -0
  634. package/packages/option/index.ts +15 -0
  635. package/packages/pager/index.ts +15 -0
  636. package/packages/pager/src/pager.ts +595 -0
  637. package/packages/pulldown/index.ts +15 -0
  638. package/packages/pulldown/src/pulldown.ts +349 -0
  639. package/packages/radio/index.ts +15 -0
  640. package/packages/radio/src/button.ts +132 -0
  641. package/packages/radio/src/group.ts +110 -0
  642. package/packages/radio/src/radio.ts +137 -0
  643. package/packages/radio-button/index.ts +15 -0
  644. package/packages/radio-group/index.ts +15 -0
  645. package/packages/select/index.ts +15 -0
  646. package/packages/select/src/optgroup.ts +39 -0
  647. package/packages/select/src/option.ts +38 -0
  648. package/packages/select/src/optionInfo.ts +20 -0
  649. package/packages/select/src/select.ts +1034 -0
  650. package/packages/select/src/util.ts +47 -0
  651. package/packages/switch/index.ts +15 -0
  652. package/packages/switch/src/switch.ts +171 -0
  653. package/packages/tab-pane/index.ts +11 -0
  654. package/packages/tabs/index.ts +11 -0
  655. package/packages/tabs/src/tab-pane.ts +85 -0
  656. package/packages/tabs/src/tabs.ts +223 -0
  657. package/packages/tabs/src/util.ts +21 -0
  658. package/packages/textarea/index.ts +15 -0
  659. package/packages/textarea/src/textarea.ts +273 -0
  660. package/packages/tooltip/index.ts +11 -0
  661. package/packages/tooltip/src/tooltip.ts +360 -0
  662. package/packages/ui/src/core.ts +13 -1
  663. package/packages/ui/src/dom.ts +23 -0
  664. package/packages/ui/src/globalStore.ts +122 -5
  665. package/packages/ui/src/i18n.ts +8 -0
  666. package/packages/ui/src/log.ts +2 -2
  667. package/packages/ui/src/renderer.ts +71 -0
  668. package/packages/ui/src/store.ts +49 -0
  669. package/packages/ui/src/utils.ts +12 -0
  670. package/packages/ui/src/validators.ts +9 -0
  671. package/packages/ui/src/vn.ts +14 -0
  672. package/styles/all.scss +32 -10
  673. package/styles/base/common.scss +13 -0
  674. package/styles/components/button.scss +8 -8
  675. package/styles/components/checkbox-group.scss +0 -0
  676. package/styles/components/checkbox.scss +91 -0
  677. package/styles/components/form-design.scss +93 -0
  678. package/styles/components/form-gather.scss +0 -0
  679. package/styles/components/form-item.scss +0 -0
  680. package/styles/components/form.scss +339 -0
  681. package/styles/components/icon.scss +3 -1
  682. package/styles/components/input.scss +911 -0
  683. package/styles/components/layout-aside.scss +3 -0
  684. package/styles/components/layout-body.scss +3 -0
  685. package/styles/components/layout-footer.scss +3 -0
  686. package/styles/components/list-design.scss +0 -0
  687. package/styles/components/list.scss +26 -0
  688. package/styles/components/loading.scss +84 -0
  689. package/styles/components/modal.scss +383 -0
  690. package/styles/components/old-icon.scss +712 -0
  691. package/styles/components/optgroup.scss +0 -0
  692. package/styles/components/option.scss +0 -0
  693. package/styles/components/pager.scss +287 -0
  694. package/styles/components/pulldown.scss +55 -0
  695. package/styles/components/radio-button.scss +0 -0
  696. package/styles/components/radio-group.scss +0 -0
  697. package/styles/components/radio.scss +149 -0
  698. package/styles/components/select.scss +226 -0
  699. package/styles/components/switch.scss +113 -0
  700. package/styles/components/tab-pane.scss +0 -0
  701. package/styles/components/tabs.scss +116 -0
  702. package/styles/components/textarea.scss +102 -0
  703. package/styles/components/tooltip.scss +124 -0
  704. package/styles/helpers/mixin.scss +12 -12
  705. package/styles/theme/base.scss +143 -6
  706. package/types/all.d.ts +68 -33
  707. package/types/{component → components}/anchor-link.d.ts +17 -2
  708. package/types/{component → components}/anchor.d.ts +10 -2
  709. package/types/{component → components}/breadcrumb-item.d.ts +12 -1
  710. package/types/{component → components}/breadcrumb.d.ts +10 -2
  711. package/types/{component → components}/button-group.d.ts +11 -3
  712. package/types/{component → components}/button.d.ts +14 -3
  713. package/types/components/checkbox-group.d.ts +112 -0
  714. package/types/components/checkbox.d.ts +119 -0
  715. package/types/{component → components}/col.d.ts +9 -1
  716. package/types/components/form-design.d.ts +88 -0
  717. package/types/components/form-gather.d.ts +75 -0
  718. package/types/components/form-item.d.ts +231 -0
  719. package/types/components/form.d.ts +349 -0
  720. package/types/{component → components}/icon.d.ts +7 -2
  721. package/types/components/input.d.ts +375 -0
  722. package/types/{component → components}/layout-aside.d.ts +20 -3
  723. package/types/{component → components}/layout-body.d.ts +14 -3
  724. package/types/{component → components}/layout-container.d.ts +14 -3
  725. package/types/{component → components}/layout-footer.d.ts +17 -4
  726. package/types/{component → components}/layout-header.d.ts +11 -2
  727. package/types/components/list-design.d.ts +67 -0
  728. package/types/components/loading.d.ts +66 -0
  729. package/types/components/modal.d.ts +381 -0
  730. package/types/components/optgroup.d.ts +80 -0
  731. package/types/components/option.d.ts +99 -0
  732. package/types/components/pager.d.ts +208 -0
  733. package/types/components/pulldown.d.ts +134 -0
  734. package/types/components/radio-button.d.ts +99 -0
  735. package/types/components/radio-group.d.ts +107 -0
  736. package/types/components/radio.d.ts +119 -0
  737. package/types/{component → components}/row.d.ts +10 -2
  738. package/types/components/select.d.ts +274 -0
  739. package/types/components/switch.d.ts +118 -0
  740. package/types/components/tab-pane.d.ts +84 -0
  741. package/types/components/tabs.d.ts +80 -0
  742. package/types/components/textarea.d.ts +212 -0
  743. package/types/components/tooltip.d.ts +122 -0
  744. package/types/tool/common.d.ts +5 -0
  745. package/types/ui/global-config.d.ts +43 -6
  746. package/types/ui/global-icon.d.ts +80 -10
  747. package/types/ui/index.d.ts +25 -2
  748. package/types/ui/renderer.d.ts +239 -0
  749. package/types/ui/validators.d.ts +26 -0
  750. package/es/design/index.js +0 -8
  751. package/es/vxe-design/index.js +0 -3
  752. package/lib/anchor-link/src/util.min.js +0 -1
  753. package/lib/button-group/src/button-group.min.js +0 -1
  754. package/lib/design/index.js +0 -15
  755. package/lib/design/index.min.js +0 -1
  756. package/lib/design/src/design.min.js +0 -1
  757. package/lib/vxe-design/index.min.js +0 -1
  758. package/packages/design/index.ts +0 -11
  759. package/packages/design/src/design.ts +0 -55
  760. package/styles/components/design.scss +0 -1
  761. package/types/component/design.d.ts +0 -63
  762. /package/es/{design → checkbox-group}/style.css +0 -0
  763. /package/es/{design → checkbox-group}/style.min.css +0 -0
  764. /package/es/{vxe-design → form-gather}/style.css +0 -0
  765. /package/es/{vxe-design → form-gather}/style.min.css +0 -0
  766. /package/{lib/design/style → es/form-item}/style.css +0 -0
  767. /package/{lib/design/style → es/form-item}/style.min.css +0 -0
  768. /package/{lib/vxe-design/style → es/list-design}/style.css +0 -0
  769. /package/{lib/vxe-design/style → es/list-design}/style.min.css +0 -0
  770. /package/es/{col → row}/src/col.js +0 -0
  771. /package/lib/{vxe-design → checkbox}/style/index.js +0 -0
  772. /package/lib/{design → checkbox-group}/style/index.js +0 -0
  773. /package/lib/{col → row}/src/col.js +0 -0
  774. /package/lib/{col → row}/src/col.min.js +0 -0
  775. /package/packages/{col → row}/src/col.ts +0 -0
@@ -0,0 +1,768 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _vue = require("vue");
8
+ var _xeUtils = _interopRequireDefault(require("xe-utils"));
9
+ var _globalStore = _interopRequireDefault(require("../../ui/src/globalStore"));
10
+ var _renderer = require("../../ui/src/renderer");
11
+ var _validators = require("../../ui/src/validators");
12
+ var _utils = require("../../ui/src/utils");
13
+ var _log = require("../../ui/src/log");
14
+ var _dom = require("../../ui/src/dom");
15
+ var _util = require("./util");
16
+ var _size = require("../../hooks/size");
17
+ var _tooltip = _interopRequireDefault(require("../../tooltip"));
18
+ var _formConfigItem = _interopRequireDefault(require("./form-config-item"));
19
+ var _index = _interopRequireDefault(require("../../loading/index"));
20
+ var _vn = require("../../ui/src/vn");
21
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
+ class Rule {
23
+ constructor(rule) {
24
+ Object.assign(this, {
25
+ $options: rule,
26
+ required: rule.required,
27
+ min: rule.min,
28
+ max: rule.min,
29
+ type: rule.type,
30
+ pattern: rule.pattern,
31
+ validator: rule.validator,
32
+ trigger: rule.trigger,
33
+ maxWidth: rule.maxWidth
34
+ });
35
+ }
36
+ get content() {
37
+ return (0, _utils.getFuncText)(this.$options.content || this.$options.message);
38
+ }
39
+ get message() {
40
+ return this.content;
41
+ }
42
+ }
43
+ const validErrorRuleValue = (rule, val) => {
44
+ const {
45
+ type,
46
+ min,
47
+ max,
48
+ pattern
49
+ } = rule;
50
+ const isNumType = type === 'number';
51
+ const numVal = isNumType ? _xeUtils.default.toNumber(val) : _xeUtils.default.getSize(val);
52
+ // 判断数值
53
+ if (isNumType && isNaN(val)) {
54
+ return true;
55
+ }
56
+ // 如果存在 min,判断最小值
57
+ if (!_xeUtils.default.eqNull(min) && numVal < _xeUtils.default.toNumber(min)) {
58
+ return true;
59
+ }
60
+ // 如果存在 max,判断最大值
61
+ if (!_xeUtils.default.eqNull(max) && numVal > _xeUtils.default.toNumber(max)) {
62
+ return true;
63
+ }
64
+ // 如果存在 pattern,正则校验
65
+ if (pattern && !(_xeUtils.default.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
66
+ return true;
67
+ }
68
+ return false;
69
+ };
70
+ function getResetValue(value, resetValue) {
71
+ if (_xeUtils.default.isArray(value)) {
72
+ resetValue = [];
73
+ }
74
+ return resetValue;
75
+ }
76
+ var _default = exports.default = (0, _vue.defineComponent)({
77
+ name: 'VxeForm',
78
+ props: {
79
+ collapseStatus: {
80
+ type: Boolean,
81
+ default: true
82
+ },
83
+ loading: Boolean,
84
+ data: Object,
85
+ size: {
86
+ type: String,
87
+ default: () => _globalStore.default.form.size || _globalStore.default.size
88
+ },
89
+ span: {
90
+ type: [String, Number],
91
+ default: () => _globalStore.default.form.span
92
+ },
93
+ align: {
94
+ type: String,
95
+ default: () => _globalStore.default.form.align
96
+ },
97
+ titleAlign: {
98
+ type: String,
99
+ default: () => _globalStore.default.form.titleAlign
100
+ },
101
+ titleWidth: {
102
+ type: [String, Number],
103
+ default: () => _globalStore.default.form.titleWidth
104
+ },
105
+ titleColon: {
106
+ type: Boolean,
107
+ default: () => _globalStore.default.form.titleColon
108
+ },
109
+ titleAsterisk: {
110
+ type: Boolean,
111
+ default: () => _globalStore.default.form.titleAsterisk
112
+ },
113
+ titleOverflow: {
114
+ type: [Boolean, String],
115
+ default: null
116
+ },
117
+ vertical: {
118
+ type: Boolean,
119
+ default: null
120
+ },
121
+ className: [String, Function],
122
+ readonly: Boolean,
123
+ items: Array,
124
+ rules: Object,
125
+ preventSubmit: {
126
+ type: Boolean,
127
+ default: () => _globalStore.default.form.preventSubmit
128
+ },
129
+ validConfig: Object,
130
+ tooltipConfig: Object,
131
+ customLayout: {
132
+ type: Boolean,
133
+ default: () => _globalStore.default.form.customLayout
134
+ }
135
+ },
136
+ emits: ['update:collapseStatus', 'collapse', 'toggle-collapse', 'submit', 'submit-invalid', 'reset'],
137
+ setup(props, context) {
138
+ const {
139
+ slots,
140
+ emit
141
+ } = context;
142
+ const xID = _xeUtils.default.uniqueId();
143
+ const computeSize = (0, _size.useSize)(props);
144
+ const reactData = (0, _vue.reactive)({
145
+ collapseAll: props.collapseStatus,
146
+ staticItems: [],
147
+ formItems: []
148
+ });
149
+ const internalData = (0, _vue.reactive)({
150
+ tooltipTimeout: null,
151
+ tooltipStore: {
152
+ item: null,
153
+ visible: false
154
+ }
155
+ });
156
+ (0, _vue.provide)('xeFormItemInfo', null);
157
+ const $xegrid = (0, _vue.inject)('$xegrid', null);
158
+ const refElem = (0, _vue.ref)();
159
+ const refTooltip = (0, _vue.ref)();
160
+ let formMethods = {};
161
+ const computeValidOpts = (0, _vue.computed)(() => {
162
+ return Object.assign({}, _globalStore.default.form.validConfig, props.validConfig);
163
+ });
164
+ const computeTooltipOpts = (0, _vue.computed)(() => {
165
+ return Object.assign({}, _globalStore.default.tooltip, _globalStore.default.form.tooltipConfig, props.tooltipConfig);
166
+ });
167
+ const refMaps = {
168
+ refElem
169
+ };
170
+ const computeMaps = {
171
+ computeSize,
172
+ computeValidOpts,
173
+ computeTooltipOpts
174
+ };
175
+ const $xeform = {
176
+ xID,
177
+ props,
178
+ context,
179
+ reactData,
180
+ xegrid: $xegrid,
181
+ getRefMaps: () => refMaps,
182
+ getComputeMaps: () => computeMaps
183
+ };
184
+ const callSlot = (slotFunc, params) => {
185
+ if (slotFunc) {
186
+ if (_xeUtils.default.isString(slotFunc)) {
187
+ slotFunc = slots[slotFunc] || null;
188
+ }
189
+ if (_xeUtils.default.isFunction(slotFunc)) {
190
+ return (0, _vn.getSlotVNs)(slotFunc(params));
191
+ }
192
+ }
193
+ return [];
194
+ };
195
+ const loadItem = list => {
196
+ if (list.length) {
197
+ if (process.env.NODE_ENV === 'development') {
198
+ list.forEach(item => {
199
+ if (item.slots) {
200
+ _xeUtils.default.each(item.slots, func => {
201
+ if (!_xeUtils.default.isFunction(func)) {
202
+ if (!slots[func]) {
203
+ (0, _log.errLog)('vxe.error.notSlot', [func]);
204
+ }
205
+ }
206
+ });
207
+ }
208
+ });
209
+ }
210
+ reactData.staticItems = _xeUtils.default.mapTree(list, item => (0, _util.createItem)($xeform, item), {
211
+ children: 'children'
212
+ });
213
+ }
214
+ return (0, _vue.nextTick)();
215
+ };
216
+ const getItems = () => {
217
+ const itemList = [];
218
+ _xeUtils.default.eachTree(reactData.formItems, item => {
219
+ itemList.push(item);
220
+ }, {
221
+ children: 'children'
222
+ });
223
+ return itemList;
224
+ };
225
+ const getItemByField = field => {
226
+ const rest = _xeUtils.default.findTree(reactData.formItems, item => item.field === field, {
227
+ children: 'children'
228
+ });
229
+ return rest ? rest.item : null;
230
+ };
231
+ const getCollapseStatus = () => {
232
+ return reactData.collapseAll;
233
+ };
234
+ const toggleCollapse = () => {
235
+ const status = !getCollapseStatus();
236
+ reactData.collapseAll = status;
237
+ emit('update:collapseStatus', status);
238
+ return (0, _vue.nextTick)();
239
+ };
240
+ const toggleCollapseEvent = evnt => {
241
+ toggleCollapse();
242
+ const status = getCollapseStatus();
243
+ formMethods.dispatchEvent('toggle-collapse', {
244
+ status,
245
+ collapse: status,
246
+ data: props.data
247
+ }, evnt);
248
+ formMethods.dispatchEvent('collapse', {
249
+ status,
250
+ collapse: status,
251
+ data: props.data
252
+ }, evnt);
253
+ };
254
+ const clearValidate = fieldOrItem => {
255
+ if (fieldOrItem) {
256
+ let fields = fieldOrItem;
257
+ if (!_xeUtils.default.isArray(fieldOrItem)) {
258
+ fields = [fieldOrItem];
259
+ }
260
+ fields.forEach(field => {
261
+ if (field) {
262
+ const item = (0, _util.handleFieldOrItem)($xeform, field);
263
+ if (item) {
264
+ item.showError = false;
265
+ }
266
+ }
267
+ });
268
+ } else {
269
+ getItems().forEach(item => {
270
+ item.showError = false;
271
+ });
272
+ }
273
+ return (0, _vue.nextTick)();
274
+ };
275
+ const reset = () => {
276
+ const {
277
+ data
278
+ } = props;
279
+ const itemList = getItems();
280
+ if (data) {
281
+ itemList.forEach(item => {
282
+ const {
283
+ field,
284
+ resetValue,
285
+ itemRender
286
+ } = item;
287
+ if ((0, _utils.isEnableConf)(itemRender)) {
288
+ const compConf = _renderer.renderer.get(itemRender.name);
289
+ if (compConf && compConf.itemResetMethod) {
290
+ compConf.itemResetMethod({
291
+ data,
292
+ field,
293
+ property: field,
294
+ item,
295
+ $form: $xeform,
296
+ $grid: $xeform.xegrid
297
+ });
298
+ } else if (field) {
299
+ _xeUtils.default.set(data, field, resetValue === null ? getResetValue(_xeUtils.default.get(data, field), undefined) : _xeUtils.default.clone(resetValue, true));
300
+ }
301
+ }
302
+ });
303
+ }
304
+ return clearValidate();
305
+ };
306
+ const resetEvent = evnt => {
307
+ evnt.preventDefault();
308
+ reset();
309
+ formMethods.dispatchEvent('reset', {
310
+ data: props.data
311
+ }, evnt);
312
+ };
313
+ const handleFocus = fields => {
314
+ const el = refElem.value;
315
+ if (el) {
316
+ for (let i = 0; i < fields.length; i++) {
317
+ const property = fields[i];
318
+ const item = getItemByField(property);
319
+ if (item && (0, _utils.isEnableConf)(item.itemRender)) {
320
+ const {
321
+ itemRender
322
+ } = item;
323
+ const compConf = _renderer.renderer.get(itemRender.name);
324
+ let inputElem = null;
325
+ // 定位到第一个
326
+ if (!i) {
327
+ (0, _dom.scrollToView)(el.querySelector(`.${item.id}`));
328
+ }
329
+ // 如果指定了聚焦 class
330
+ if (itemRender.autofocus) {
331
+ inputElem = el.querySelector(`.${item.id} ${itemRender.autofocus}`);
332
+ }
333
+ // 渲染器的聚焦处理
334
+ if (!inputElem && compConf && compConf.autofocus) {
335
+ inputElem = el.querySelector(`.${item.id} ${compConf.autofocus}`);
336
+ }
337
+ if (inputElem) {
338
+ inputElem.focus();
339
+ break;
340
+ }
341
+ }
342
+ }
343
+ }
344
+ };
345
+ /**
346
+ * 校验数据
347
+ * 按表格行、列顺序依次校验(同步或异步)
348
+ * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列
349
+ * 如果校验失败则,触发回调或者 Promise<(ErrMap 校验不通过列的信息)>
350
+ * 如果是传回调方式这返回一个 (ErrMap 校验不通过列的信息)
351
+ *
352
+ * rule 配置:
353
+ * required=Boolean 是否必填
354
+ * min=Number 最小长度
355
+ * max=Number 最大长度
356
+ * validator=Function({ itemValue, rule, rules, data, property }) 自定义校验,接收一个 Promise
357
+ * trigger=change 触发方式
358
+ */
359
+ const validItemRules = (validType, fields, val) => {
360
+ const {
361
+ data,
362
+ rules: formRules
363
+ } = props;
364
+ const errorMaps = {};
365
+ if (!_xeUtils.default.isArray(fields)) {
366
+ fields = [fields];
367
+ }
368
+ return Promise.all(fields.map(property => {
369
+ const errorRules = [];
370
+ const syncVailds = [];
371
+ if (property && formRules) {
372
+ const rules = _xeUtils.default.get(formRules, property);
373
+ if (rules) {
374
+ const itemValue = _xeUtils.default.isUndefined(val) ? _xeUtils.default.get(data, property) : val;
375
+ rules.forEach(rule => {
376
+ const {
377
+ type,
378
+ trigger,
379
+ required,
380
+ validator
381
+ } = rule;
382
+ if (validType === 'all' || !trigger || validType === trigger) {
383
+ if (validator) {
384
+ const validParams = {
385
+ itemValue,
386
+ rule,
387
+ rules,
388
+ data,
389
+ field: property,
390
+ property,
391
+ $form: $xeform
392
+ };
393
+ let customValid;
394
+ if (_xeUtils.default.isString(validator)) {
395
+ const gvItem = _validators.validators.get(validator);
396
+ if (gvItem) {
397
+ if (gvItem.itemValidatorMethod) {
398
+ customValid = gvItem.itemValidatorMethod(validParams);
399
+ } else {
400
+ if (process.env.NODE_ENV === 'development') {
401
+ (0, _log.warnLog)('vxe.error.notValidators', [validator]);
402
+ }
403
+ }
404
+ } else {
405
+ if (process.env.NODE_ENV === 'development') {
406
+ (0, _log.errLog)('vxe.error.notValidators', [validator]);
407
+ }
408
+ }
409
+ } else {
410
+ customValid = validator(validParams);
411
+ }
412
+ if (customValid) {
413
+ if (_xeUtils.default.isError(customValid)) {
414
+ errorRules.push(new Rule({
415
+ type: 'custom',
416
+ trigger,
417
+ content: customValid.message,
418
+ rule: new Rule(rule)
419
+ }));
420
+ } else if (customValid.catch) {
421
+ // 如果为异步校验(注:异步校验是并发无序的)
422
+ syncVailds.push(customValid.catch(e => {
423
+ errorRules.push(new Rule({
424
+ type: 'custom',
425
+ trigger,
426
+ content: e ? e.message : rule.content || rule.message,
427
+ rule: new Rule(rule)
428
+ }));
429
+ }));
430
+ }
431
+ }
432
+ } else {
433
+ const isArrType = type === 'array';
434
+ const isArrVal = _xeUtils.default.isArray(itemValue);
435
+ let hasEmpty = true;
436
+ if (isArrType || isArrVal) {
437
+ hasEmpty = !isArrVal || !itemValue.length;
438
+ } else if (_xeUtils.default.isString(itemValue)) {
439
+ hasEmpty = (0, _utils.eqEmptyValue)(itemValue.trim());
440
+ } else {
441
+ hasEmpty = (0, _utils.eqEmptyValue)(itemValue);
442
+ }
443
+ if (required ? hasEmpty || validErrorRuleValue(rule, itemValue) : !hasEmpty && validErrorRuleValue(rule, itemValue)) {
444
+ errorRules.push(new Rule(rule));
445
+ }
446
+ }
447
+ }
448
+ });
449
+ }
450
+ }
451
+ return Promise.all(syncVailds).then(() => {
452
+ if (errorRules.length) {
453
+ errorMaps[property] = errorRules.map(rule => {
454
+ return {
455
+ $form: $xeform,
456
+ rule,
457
+ data,
458
+ field: property,
459
+ property
460
+ };
461
+ });
462
+ }
463
+ });
464
+ })).then(() => {
465
+ if (!_xeUtils.default.isEmpty(errorMaps)) {
466
+ return Promise.reject(errorMaps);
467
+ }
468
+ });
469
+ };
470
+ let showErrTime;
471
+ const beginValidate = (itemList, type, callback) => {
472
+ const {
473
+ data,
474
+ rules: formRules
475
+ } = props;
476
+ const validOpts = computeValidOpts.value;
477
+ const validRest = {};
478
+ const validFields = [];
479
+ const itemValids = [];
480
+ clearTimeout(showErrTime);
481
+ if (data && formRules) {
482
+ itemList.forEach(item => {
483
+ const {
484
+ field
485
+ } = item;
486
+ if (field && !(0, _util.isHiddenItem)($xeform, item) && (0, _util.isActivetem)($xeform, item)) {
487
+ itemValids.push(validItemRules(type || 'all', field).then(() => {
488
+ item.errRule = null;
489
+ }).catch(errorMaps => {
490
+ const rest = errorMaps[field];
491
+ if (!validRest[field]) {
492
+ validRest[field] = [];
493
+ }
494
+ validRest[field].push(rest);
495
+ validFields.push(field);
496
+ item.errRule = rest[0].rule;
497
+ return Promise.reject(rest);
498
+ }));
499
+ }
500
+ });
501
+ return Promise.all(itemValids).then(() => {
502
+ if (callback) {
503
+ callback();
504
+ }
505
+ }).catch(() => {
506
+ return new Promise(resolve => {
507
+ showErrTime = window.setTimeout(() => {
508
+ itemList.forEach(item => {
509
+ if (item.errRule) {
510
+ item.showError = true;
511
+ }
512
+ });
513
+ }, 20);
514
+ if (validOpts.autoPos !== false) {
515
+ (0, _vue.nextTick)(() => {
516
+ handleFocus(validFields);
517
+ });
518
+ }
519
+ if (callback) {
520
+ callback(validRest);
521
+ resolve();
522
+ } else {
523
+ resolve(validRest);
524
+ }
525
+ });
526
+ });
527
+ }
528
+ if (callback) {
529
+ callback();
530
+ }
531
+ return Promise.resolve();
532
+ };
533
+ const validate = callback => {
534
+ clearValidate();
535
+ return beginValidate(getItems(), '', callback);
536
+ };
537
+ const validateField = (fieldOrItem, callback) => {
538
+ let fields = [];
539
+ if (_xeUtils.default.isArray(fieldOrItem)) {
540
+ fields = fieldOrItem;
541
+ } else {
542
+ fields = [fieldOrItem];
543
+ }
544
+ return beginValidate(fields.map(field => (0, _util.handleFieldOrItem)($xeform, field)), '', callback);
545
+ };
546
+ const submitEvent = evnt => {
547
+ evnt.preventDefault();
548
+ if (!props.preventSubmit) {
549
+ clearValidate();
550
+ beginValidate(getItems()).then(errMap => {
551
+ if (errMap) {
552
+ formMethods.dispatchEvent('submit-invalid', {
553
+ data: props.data,
554
+ errMap
555
+ }, evnt);
556
+ } else {
557
+ formMethods.dispatchEvent('submit', {
558
+ data: props.data
559
+ }, evnt);
560
+ }
561
+ });
562
+ }
563
+ };
564
+ const closeTooltip = () => {
565
+ const {
566
+ tooltipStore
567
+ } = internalData;
568
+ const $tooltip = refTooltip.value;
569
+ if (tooltipStore.visible) {
570
+ Object.assign(tooltipStore, {
571
+ item: null,
572
+ visible: false
573
+ });
574
+ if ($tooltip) {
575
+ $tooltip.close();
576
+ }
577
+ }
578
+ return (0, _vue.nextTick)();
579
+ };
580
+ const triggerTitleTipEvent = (evnt, params) => {
581
+ const {
582
+ item
583
+ } = params;
584
+ const {
585
+ tooltipStore
586
+ } = internalData;
587
+ const $tooltip = refTooltip.value;
588
+ const overflowElem = evnt.currentTarget.children[0];
589
+ const content = (overflowElem.textContent || '').trim();
590
+ const isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
591
+ clearTimeout(internalData.tooltipTimeout);
592
+ if (tooltipStore.item !== item) {
593
+ closeTooltip();
594
+ }
595
+ if (content && isCellOverflow) {
596
+ Object.assign(tooltipStore, {
597
+ item,
598
+ visible: true
599
+ });
600
+ if ($tooltip) {
601
+ $tooltip.open(overflowElem, content);
602
+ }
603
+ }
604
+ };
605
+ const handleTitleTipLeaveEvent = () => {
606
+ const tooltipOpts = computeTooltipOpts.value;
607
+ let $tooltip = refTooltip.value;
608
+ if ($tooltip) {
609
+ $tooltip.setActived(false);
610
+ }
611
+ if (tooltipOpts.enterable) {
612
+ internalData.tooltipTimeout = setTimeout(() => {
613
+ $tooltip = refTooltip.value;
614
+ if ($tooltip && !$tooltip.isActived()) {
615
+ closeTooltip();
616
+ }
617
+ }, tooltipOpts.leaveDelay);
618
+ } else {
619
+ closeTooltip();
620
+ }
621
+ };
622
+ const triggerItemEvent = (evnt, field, itemValue) => {
623
+ if (field) {
624
+ return validItemRules(evnt ? ['blur'].includes(evnt.type) ? 'blur' : 'change' : 'all', field, itemValue).then(() => {
625
+ clearValidate(field);
626
+ }).catch(errorMaps => {
627
+ const rest = errorMaps[field];
628
+ const item = getItemByField(field);
629
+ if (rest && item) {
630
+ item.showError = true;
631
+ item.errRule = rest[0].rule;
632
+ }
633
+ });
634
+ }
635
+ return (0, _vue.nextTick)();
636
+ };
637
+ /**
638
+ * 更新项状态
639
+ * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一项编辑状态
640
+ * 如果单元格配置了校验规则,则会进行校验
641
+ */
642
+ const updateStatus = (scope, itemValue) => {
643
+ const {
644
+ field
645
+ } = scope;
646
+ return triggerItemEvent(new Event('change'), field, itemValue);
647
+ };
648
+ formMethods = {
649
+ dispatchEvent(type, params, evnt) {
650
+ emit(type, Object.assign({
651
+ $form: $xeform,
652
+ $grid: $xegrid,
653
+ $event: evnt
654
+ }, params));
655
+ },
656
+ reset,
657
+ validate,
658
+ validateField,
659
+ clearValidate,
660
+ updateStatus,
661
+ toggleCollapse,
662
+ getItems,
663
+ getItemByField,
664
+ closeTooltip
665
+ };
666
+ const formPrivateMethods = {
667
+ callSlot,
668
+ triggerItemEvent,
669
+ toggleCollapseEvent,
670
+ triggerTitleTipEvent,
671
+ handleTitleTipLeaveEvent
672
+ };
673
+ Object.assign($xeform, formMethods, formPrivateMethods);
674
+ const staticItemFlag = (0, _vue.ref)(0);
675
+ (0, _vue.watch)(() => reactData.staticItems.length, () => {
676
+ staticItemFlag.value++;
677
+ });
678
+ (0, _vue.watch)(() => reactData.staticItems, () => {
679
+ staticItemFlag.value++;
680
+ });
681
+ (0, _vue.watch)(staticItemFlag, () => {
682
+ reactData.formItems = reactData.staticItems;
683
+ });
684
+ const itemFlag = (0, _vue.ref)(0);
685
+ (0, _vue.watch)(() => props.items ? props.items.length : -1, () => {
686
+ itemFlag.value++;
687
+ });
688
+ (0, _vue.watch)(() => props.items, () => {
689
+ itemFlag.value++;
690
+ });
691
+ (0, _vue.watch)(itemFlag, () => {
692
+ loadItem(props.items || []);
693
+ });
694
+ (0, _vue.watch)(() => props.collapseStatus, value => {
695
+ reactData.collapseAll = !!value;
696
+ });
697
+ (0, _vue.onMounted)(() => {
698
+ (0, _vue.nextTick)(() => {
699
+ if (process.env.NODE_ENV === 'development') {
700
+ if (props.customLayout && props.items) {
701
+ (0, _log.errLog)('vxe.error.errConflicts', ['custom-layout', 'items']);
702
+ }
703
+ }
704
+ loadItem(props.items || []);
705
+ });
706
+ });
707
+ const renderVN = () => {
708
+ const {
709
+ loading,
710
+ className,
711
+ data,
712
+ customLayout
713
+ } = props;
714
+ const {
715
+ formItems
716
+ } = reactData;
717
+ // const formItems: any[] = []
718
+ const vSize = computeSize.value;
719
+ const tooltipOpts = computeTooltipOpts.value;
720
+ const defaultSlot = slots.default;
721
+ return (0, _vue.h)('form', {
722
+ ref: refElem,
723
+ class: ['vxe-form', className ? _xeUtils.default.isFunction(className) ? className({
724
+ items: formItems,
725
+ data,
726
+ $form: $xeform
727
+ }) : className : '', {
728
+ [`size--${vSize}`]: vSize,
729
+ 'is--loading': loading
730
+ }],
731
+ onSubmit: submitEvent,
732
+ onReset: resetEvent
733
+ }, [(0, _vue.h)('div', {
734
+ class: 'vxe-form--wrapper vxe-row'
735
+ }, customLayout ? defaultSlot ? defaultSlot({}) : [] : formItems.map((item, index) => {
736
+ return (0, _vue.h)(_formConfigItem.default, {
737
+ key: index,
738
+ itemConfig: item
739
+ });
740
+ })), (0, _vue.h)('div', {
741
+ class: 'vxe-form-slots',
742
+ ref: 'hideItem'
743
+ }, customLayout ? [] : defaultSlot ? defaultSlot({}) : []),
744
+ /**
745
+ * 加载中
746
+ */
747
+ (0, _vue.h)(_index.default, {
748
+ class: 'vxe-form--loading',
749
+ modelValue: loading
750
+ }),
751
+ /**
752
+ * 工具提示
753
+ */
754
+ (0, _vue.h)(_tooltip.default, {
755
+ ref: refTooltip,
756
+ ...tooltipOpts
757
+ })]);
758
+ };
759
+ $xeform.renderVN = renderVN;
760
+ (0, _vue.provide)('$xeForm', $xeform);
761
+ (0, _vue.provide)('$xeFormGather', null);
762
+ (0, _vue.provide)('$xeFormItem', null);
763
+ return $xeform;
764
+ },
765
+ render() {
766
+ return this.renderVN();
767
+ }
768
+ });