vxe-pc-ui 0.0.2 → 0.1.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 (714) hide show
  1. package/es/anchor/src/anchor.js +1 -1
  2. package/es/anchor-link/index.js +1 -1
  3. package/es/{button-group → button}/src/button-group.js +2 -2
  4. package/es/button/src/button.js +3 -3
  5. package/es/button/style.css +17 -17
  6. package/es/button/style.min.css +1 -1
  7. package/es/button-group/index.js +1 -1
  8. package/es/checkbox/index.js +10 -0
  9. package/es/checkbox/src/checkbox.js +116 -0
  10. package/es/checkbox/src/group.js +108 -0
  11. package/es/checkbox/style.css +107 -0
  12. package/es/checkbox/style.min.css +1 -0
  13. package/es/checkbox-group/index.js +10 -0
  14. package/es/col/index.js +1 -1
  15. package/es/components.js +98 -35
  16. package/es/dynamics/index.js +27 -0
  17. package/es/form/index.js +8 -0
  18. package/es/form/src/form-config-item.js +178 -0
  19. package/es/form/src/form-gather.js +47 -0
  20. package/es/form/src/form-item.js +228 -0
  21. package/es/form/src/form.js +665 -0
  22. package/es/form/src/itemInfo.js +39 -0
  23. package/es/form/src/render.js +68 -0
  24. package/es/form/src/util.js +65 -0
  25. package/es/form/style.css +321 -0
  26. package/es/form/style.min.css +1 -0
  27. package/es/form-design/index.js +8 -0
  28. package/es/form-design/src/form-design.js +79 -0
  29. package/es/form-design/src/setting.js +12 -0
  30. package/es/form-design/src/util.js +8 -0
  31. package/es/form-design/src/view.js +113 -0
  32. package/es/form-design/src/widget.js +104 -0
  33. package/es/form-design/style.css +97 -0
  34. package/es/form-design/style.min.css +1 -0
  35. package/es/form-gather/index.js +8 -0
  36. package/es/form-item/index.js +8 -0
  37. package/es/icon/style.css +540 -1
  38. package/es/icon/style.min.css +1 -1
  39. package/es/input/index.js +10 -0
  40. package/es/input/src/date.js +41 -0
  41. package/es/input/src/input.js +2333 -0
  42. package/es/input/src/number.js +10 -0
  43. package/es/input/style.css +1000 -0
  44. package/es/input/style.min.css +1 -0
  45. package/es/layout-aside/style.css +1 -0
  46. package/es/layout-aside/style.min.css +1 -1
  47. package/es/layout-body/style.css +1 -0
  48. package/es/layout-body/style.min.css +1 -1
  49. package/es/layout-footer/style.css +1 -0
  50. package/es/layout-footer/style.min.css +1 -1
  51. package/es/layout-header/style.css +1 -0
  52. package/es/layout-header/style.min.css +1 -1
  53. package/es/list-design/index.js +8 -0
  54. package/es/{design/src/design.js → list-design/src/list-design.js} +7 -7
  55. package/es/loading/index.js +8 -0
  56. package/es/loading/src/loading.js +53 -0
  57. package/es/loading/style.css +75 -0
  58. package/es/loading/style.min.css +1 -0
  59. package/es/modal/index.js +96 -0
  60. package/es/modal/src/modal.js +876 -0
  61. package/es/modal/style.css +323 -0
  62. package/es/modal/style.min.css +1 -0
  63. package/es/optgroup/index.js +10 -0
  64. package/es/optgroup/style.css +0 -0
  65. package/es/optgroup/style.min.css +0 -0
  66. package/es/option/index.js +10 -0
  67. package/es/option/style.css +0 -0
  68. package/es/option/style.min.css +0 -0
  69. package/es/pager/index.js +10 -0
  70. package/es/pager/src/pager.js +539 -0
  71. package/es/pager/style.css +319 -0
  72. package/es/pager/style.min.css +1 -0
  73. package/es/pulldown/index.js +10 -0
  74. package/es/pulldown/src/pulldown.js +328 -0
  75. package/es/pulldown/style.css +57 -0
  76. package/es/pulldown/style.min.css +1 -0
  77. package/es/radio/index.js +10 -0
  78. package/es/radio/src/button.js +113 -0
  79. package/es/radio/src/group.js +93 -0
  80. package/es/radio/src/radio.js +118 -0
  81. package/es/radio/style.css +143 -0
  82. package/es/radio/style.min.css +1 -0
  83. package/es/radio-button/index.js +10 -0
  84. package/es/radio-button/style.css +0 -0
  85. package/es/radio-button/style.min.css +0 -0
  86. package/es/radio-group/index.js +10 -0
  87. package/es/radio-group/style.css +0 -0
  88. package/es/radio-group/style.min.css +0 -0
  89. package/es/select/index.js +10 -0
  90. package/es/select/src/optgroup.js +31 -0
  91. package/es/select/src/option.js +31 -0
  92. package/es/select/src/optionInfo.js +16 -0
  93. package/es/select/src/select.js +992 -0
  94. package/es/select/src/util.js +36 -0
  95. package/es/select/style.css +201 -0
  96. package/es/select/style.min.css +1 -0
  97. package/es/style.css +1 -1
  98. package/es/style.min.css +1 -1
  99. package/es/switch/index.js +10 -0
  100. package/es/switch/src/switch.js +151 -0
  101. package/es/switch/style.css +97 -0
  102. package/es/switch/style.min.css +1 -0
  103. package/es/textarea/index.js +10 -0
  104. package/es/textarea/src/textarea.js +245 -0
  105. package/es/textarea/style.css +102 -0
  106. package/es/textarea/style.min.css +1 -0
  107. package/es/tooltip/index.js +8 -0
  108. package/es/tooltip/src/tooltip.js +336 -0
  109. package/es/tooltip/style.css +103 -0
  110. package/es/tooltip/style.min.css +1 -0
  111. package/es/ui/src/core.js +12 -2
  112. package/es/ui/src/dom.js +20 -0
  113. package/es/ui/src/globalStore.js +119 -4
  114. package/es/ui/src/i18n.js +7 -0
  115. package/es/ui/src/log.js +2 -2
  116. package/es/ui/src/renderer.js +67 -0
  117. package/es/ui/src/store.js +41 -0
  118. package/es/ui/src/utils.js +10 -0
  119. package/es/ui/src/validators.js +5 -0
  120. package/es/ui/src/vn.js +10 -0
  121. package/es/vxe-button/style.css +17 -17
  122. package/es/vxe-button/style.min.css +1 -1
  123. package/es/vxe-checkbox/index.js +3 -0
  124. package/es/vxe-checkbox/style.css +107 -0
  125. package/es/vxe-checkbox/style.min.css +1 -0
  126. package/es/vxe-checkbox-group/index.js +3 -0
  127. package/es/vxe-checkbox-group/style.css +0 -0
  128. package/es/vxe-checkbox-group/style.min.css +0 -0
  129. package/es/vxe-form/index.js +3 -0
  130. package/es/vxe-form/style.css +321 -0
  131. package/es/vxe-form/style.min.css +1 -0
  132. package/es/vxe-form-design/index.js +3 -0
  133. package/es/vxe-form-design/style.css +97 -0
  134. package/es/vxe-form-design/style.min.css +1 -0
  135. package/es/vxe-form-gather/index.js +3 -0
  136. package/es/vxe-form-gather/style.css +0 -0
  137. package/es/vxe-form-gather/style.min.css +0 -0
  138. package/es/vxe-form-item/index.js +3 -0
  139. package/es/vxe-form-item/style.css +0 -0
  140. package/es/vxe-form-item/style.min.css +0 -0
  141. package/es/vxe-icon/style.css +540 -1
  142. package/es/vxe-icon/style.min.css +1 -1
  143. package/es/vxe-input/index.js +3 -0
  144. package/es/vxe-input/style.css +1000 -0
  145. package/es/vxe-input/style.min.css +1 -0
  146. package/es/vxe-layout-aside/style.css +1 -0
  147. package/es/vxe-layout-aside/style.min.css +1 -1
  148. package/es/vxe-layout-body/style.css +1 -0
  149. package/es/vxe-layout-body/style.min.css +1 -1
  150. package/es/vxe-layout-footer/style.css +1 -0
  151. package/es/vxe-layout-footer/style.min.css +1 -1
  152. package/es/vxe-layout-header/style.css +1 -0
  153. package/es/vxe-layout-header/style.min.css +1 -1
  154. package/es/vxe-list-design/index.js +3 -0
  155. package/es/vxe-list-design/style.css +0 -0
  156. package/es/vxe-list-design/style.min.css +0 -0
  157. package/es/vxe-loading/index.js +3 -0
  158. package/es/vxe-loading/style.css +75 -0
  159. package/es/vxe-loading/style.min.css +1 -0
  160. package/es/vxe-modal/index.js +3 -0
  161. package/es/vxe-modal/style.css +323 -0
  162. package/es/vxe-modal/style.min.css +1 -0
  163. package/es/vxe-optgroup/index.js +3 -0
  164. package/es/vxe-optgroup/style.css +0 -0
  165. package/es/vxe-optgroup/style.min.css +0 -0
  166. package/es/vxe-option/index.js +3 -0
  167. package/es/vxe-option/style.css +0 -0
  168. package/es/vxe-option/style.min.css +0 -0
  169. package/es/vxe-pager/index.js +3 -0
  170. package/es/vxe-pager/style.css +319 -0
  171. package/es/vxe-pager/style.min.css +1 -0
  172. package/es/vxe-pulldown/index.js +3 -0
  173. package/es/vxe-pulldown/style.css +57 -0
  174. package/es/vxe-pulldown/style.min.css +1 -0
  175. package/es/vxe-radio/index.js +3 -0
  176. package/es/vxe-radio/style.css +143 -0
  177. package/es/vxe-radio/style.min.css +1 -0
  178. package/es/vxe-radio-button/index.js +3 -0
  179. package/es/vxe-radio-button/style.css +0 -0
  180. package/es/vxe-radio-button/style.min.css +0 -0
  181. package/es/vxe-radio-group/index.js +3 -0
  182. package/es/vxe-radio-group/style.css +0 -0
  183. package/es/vxe-radio-group/style.min.css +0 -0
  184. package/es/vxe-select/index.js +3 -0
  185. package/es/vxe-select/style.css +201 -0
  186. package/es/vxe-select/style.min.css +1 -0
  187. package/es/vxe-switch/index.js +3 -0
  188. package/es/vxe-switch/style.css +97 -0
  189. package/es/vxe-switch/style.min.css +1 -0
  190. package/es/vxe-textarea/index.js +3 -0
  191. package/es/vxe-textarea/style.css +102 -0
  192. package/es/vxe-textarea/style.min.css +1 -0
  193. package/es/vxe-tooltip/index.js +3 -0
  194. package/es/vxe-tooltip/style.css +103 -0
  195. package/es/vxe-tooltip/style.min.css +1 -0
  196. package/lib/anchor/src/anchor.js +1 -1
  197. package/lib/anchor/src/anchor.min.js +1 -1
  198. package/lib/anchor-link/index.js +1 -1
  199. package/lib/anchor-link/index.min.js +1 -1
  200. package/lib/{button-group → button}/src/button-group.js +2 -2
  201. package/lib/button/src/button-group.min.js +1 -0
  202. package/lib/button/src/button.js +3 -3
  203. package/lib/button/src/button.min.js +1 -1
  204. package/lib/button/style/style.css +17 -17
  205. package/lib/button/style/style.min.css +1 -1
  206. package/lib/button-group/index.js +1 -1
  207. package/lib/button-group/index.min.js +1 -1
  208. package/lib/checkbox/index.js +17 -0
  209. package/lib/checkbox/index.min.js +1 -0
  210. package/lib/checkbox/src/checkbox.js +144 -0
  211. package/lib/checkbox/src/checkbox.min.js +1 -0
  212. package/lib/checkbox/src/group.js +129 -0
  213. package/lib/checkbox/src/group.min.js +1 -0
  214. package/lib/checkbox/style/style.css +107 -0
  215. package/lib/checkbox/style/style.min.css +1 -0
  216. package/lib/checkbox-group/index.js +17 -0
  217. package/lib/checkbox-group/index.min.js +1 -0
  218. package/lib/checkbox-group/style/style.css +0 -0
  219. package/lib/checkbox-group/style/style.min.css +0 -0
  220. package/lib/col/index.js +1 -1
  221. package/lib/col/index.min.js +1 -1
  222. package/lib/components.js +290 -63
  223. package/lib/components.min.js +1 -1
  224. package/lib/dynamics/index.js +36 -0
  225. package/lib/dynamics/index.min.js +1 -0
  226. package/lib/form/index.js +15 -0
  227. package/lib/form/index.min.js +1 -0
  228. package/lib/form/src/form-config-item.js +192 -0
  229. package/lib/form/src/form-config-item.min.js +1 -0
  230. package/lib/form/src/form-gather.js +57 -0
  231. package/lib/form/src/form-gather.min.js +1 -0
  232. package/lib/form/src/form-item.js +247 -0
  233. package/lib/form/src/form-item.min.js +1 -0
  234. package/lib/form/src/form.js +768 -0
  235. package/lib/form/src/form.min.js +1 -0
  236. package/lib/form/src/itemInfo.js +47 -0
  237. package/lib/form/src/itemInfo.min.js +1 -0
  238. package/lib/form/src/render.js +84 -0
  239. package/lib/form/src/render.min.js +1 -0
  240. package/lib/form/src/util.js +108 -0
  241. package/lib/form/src/util.min.js +1 -0
  242. package/lib/form/style/index.js +1 -0
  243. package/lib/form/style/style.css +321 -0
  244. package/lib/form/style/style.min.css +1 -0
  245. package/lib/form-design/index.js +15 -0
  246. package/lib/form-design/index.min.js +1 -0
  247. package/lib/form-design/src/form-design.js +87 -0
  248. package/lib/form-design/src/form-design.min.js +1 -0
  249. package/lib/form-design/src/setting.js +18 -0
  250. package/lib/form-design/src/setting.min.js +1 -0
  251. package/lib/form-design/src/util.js +17 -0
  252. package/lib/form-design/src/util.min.js +1 -0
  253. package/lib/form-design/src/view.js +147 -0
  254. package/lib/form-design/src/view.min.js +1 -0
  255. package/lib/form-design/src/widget.js +114 -0
  256. package/lib/form-design/src/widget.min.js +1 -0
  257. package/lib/form-design/style/index.js +1 -0
  258. package/lib/form-design/style/style.css +97 -0
  259. package/lib/form-design/style/style.min.css +1 -0
  260. package/lib/form-gather/index.js +15 -0
  261. package/lib/form-gather/index.min.js +1 -0
  262. package/lib/form-gather/style/index.js +1 -0
  263. package/lib/form-gather/style/style.css +0 -0
  264. package/lib/form-gather/style/style.min.css +0 -0
  265. package/lib/form-item/index.js +15 -0
  266. package/lib/form-item/index.min.js +1 -0
  267. package/lib/form-item/style/index.js +1 -0
  268. package/lib/form-item/style/style.css +0 -0
  269. package/lib/form-item/style/style.min.css +0 -0
  270. package/lib/icon/style/style.css +540 -1
  271. package/lib/icon/style/style.min.css +1 -1
  272. package/lib/index.umd.js +10741 -782
  273. package/lib/index.umd.min.js +1 -1
  274. package/lib/input/index.js +17 -0
  275. package/lib/input/index.min.js +1 -0
  276. package/lib/input/src/date.js +46 -0
  277. package/lib/input/src/date.min.js +1 -0
  278. package/lib/input/src/input.js +2546 -0
  279. package/lib/input/src/input.min.js +1 -0
  280. package/lib/input/src/number.js +18 -0
  281. package/lib/input/src/number.min.js +1 -0
  282. package/lib/input/style/index.js +1 -0
  283. package/lib/input/style/style.css +1000 -0
  284. package/lib/input/style/style.min.css +1 -0
  285. package/lib/layout-aside/style/style.css +1 -0
  286. package/lib/layout-aside/style/style.min.css +1 -1
  287. package/lib/layout-body/style/style.css +1 -0
  288. package/lib/layout-body/style/style.min.css +1 -1
  289. package/lib/layout-footer/style/style.css +1 -0
  290. package/lib/layout-footer/style/style.min.css +1 -1
  291. package/lib/layout-header/style/style.css +1 -0
  292. package/lib/layout-header/style/style.min.css +1 -1
  293. package/lib/list-design/index.js +15 -0
  294. package/lib/list-design/index.min.js +1 -0
  295. package/lib/{design/src/design.js → list-design/src/list-design.js} +7 -7
  296. package/lib/list-design/src/list-design.min.js +1 -0
  297. package/lib/list-design/style/index.js +1 -0
  298. package/lib/list-design/style/style.css +0 -0
  299. package/lib/list-design/style/style.min.css +0 -0
  300. package/lib/loading/index.js +15 -0
  301. package/lib/loading/index.min.js +1 -0
  302. package/lib/loading/src/loading.js +49 -0
  303. package/lib/loading/src/loading.min.js +1 -0
  304. package/lib/loading/style/index.js +1 -0
  305. package/lib/loading/style/style.css +75 -0
  306. package/lib/loading/style/style.min.css +1 -0
  307. package/lib/modal/index.js +110 -0
  308. package/lib/modal/index.min.js +1 -0
  309. package/lib/modal/src/modal.js +1064 -0
  310. package/lib/modal/src/modal.min.js +1 -0
  311. package/lib/modal/style/index.js +1 -0
  312. package/lib/modal/style/style.css +323 -0
  313. package/lib/modal/style/style.min.css +1 -0
  314. package/lib/optgroup/index.js +17 -0
  315. package/lib/optgroup/index.min.js +1 -0
  316. package/lib/optgroup/style/index.js +1 -0
  317. package/lib/optgroup/style/style.css +0 -0
  318. package/lib/optgroup/style/style.min.css +0 -0
  319. package/lib/option/index.js +17 -0
  320. package/lib/option/index.min.js +1 -0
  321. package/lib/option/style/index.js +1 -0
  322. package/lib/option/style/style.css +0 -0
  323. package/lib/option/style/style.min.css +0 -0
  324. package/lib/pager/index.js +17 -0
  325. package/lib/pager/index.min.js +1 -0
  326. package/lib/pager/src/pager.js +593 -0
  327. package/lib/pager/src/pager.min.js +1 -0
  328. package/lib/pager/style/index.js +1 -0
  329. package/lib/pager/style/style.css +319 -0
  330. package/lib/pager/style/style.min.css +1 -0
  331. package/lib/pulldown/index.js +17 -0
  332. package/lib/pulldown/index.min.js +1 -0
  333. package/lib/pulldown/src/pulldown.js +359 -0
  334. package/lib/pulldown/src/pulldown.min.js +1 -0
  335. package/lib/pulldown/style/index.js +1 -0
  336. package/lib/pulldown/style/style.css +57 -0
  337. package/lib/pulldown/style/style.min.css +1 -0
  338. package/lib/radio/index.js +17 -0
  339. package/lib/radio/index.min.js +1 -0
  340. package/lib/radio/src/button.js +135 -0
  341. package/lib/radio/src/button.min.js +1 -0
  342. package/lib/radio/src/group.js +108 -0
  343. package/lib/radio/src/group.min.js +1 -0
  344. package/lib/radio/src/radio.js +139 -0
  345. package/lib/radio/src/radio.min.js +1 -0
  346. package/lib/radio/style/index.js +1 -0
  347. package/lib/radio/style/style.css +143 -0
  348. package/lib/radio/style/style.min.css +1 -0
  349. package/lib/radio-button/index.js +17 -0
  350. package/lib/radio-button/index.min.js +1 -0
  351. package/lib/radio-button/style/index.js +1 -0
  352. package/lib/radio-button/style/style.css +0 -0
  353. package/lib/radio-button/style/style.min.css +0 -0
  354. package/lib/radio-group/index.js +17 -0
  355. package/lib/radio-group/index.min.js +1 -0
  356. package/lib/radio-group/style/index.js +1 -0
  357. package/lib/radio-group/style/style.css +0 -0
  358. package/lib/radio-group/style/style.min.css +0 -0
  359. package/lib/select/index.js +17 -0
  360. package/lib/select/index.min.js +1 -0
  361. package/lib/select/src/optgroup.js +47 -0
  362. package/lib/select/src/optgroup.min.js +1 -0
  363. package/lib/select/src/option.js +45 -0
  364. package/lib/select/src/option.min.js +1 -0
  365. package/lib/select/src/optionInfo.js +24 -0
  366. package/lib/select/src/optionInfo.min.js +1 -0
  367. package/lib/select/src/select.js +1104 -0
  368. package/lib/select/src/select.min.js +1 -0
  369. package/lib/select/src/util.js +57 -0
  370. package/lib/select/src/util.min.js +1 -0
  371. package/lib/select/style/index.js +1 -0
  372. package/lib/select/style/style.css +201 -0
  373. package/lib/select/style/style.min.css +1 -0
  374. package/lib/style.css +1 -1
  375. package/lib/style.min.css +1 -1
  376. package/lib/switch/index.js +17 -0
  377. package/lib/switch/index.min.js +1 -0
  378. package/lib/switch/src/switch.js +161 -0
  379. package/lib/switch/src/switch.min.js +1 -0
  380. package/lib/switch/style/index.js +1 -0
  381. package/lib/switch/style/style.css +97 -0
  382. package/lib/switch/style/style.min.css +1 -0
  383. package/lib/textarea/index.js +17 -0
  384. package/lib/textarea/index.min.js +1 -0
  385. package/lib/textarea/src/textarea.js +298 -0
  386. package/lib/textarea/src/textarea.min.js +1 -0
  387. package/lib/textarea/style/index.js +1 -0
  388. package/lib/textarea/style/style.css +102 -0
  389. package/lib/textarea/style/style.min.css +1 -0
  390. package/lib/tooltip/index.js +15 -0
  391. package/lib/tooltip/index.min.js +1 -0
  392. package/lib/tooltip/src/tooltip.js +418 -0
  393. package/lib/tooltip/src/tooltip.min.js +1 -0
  394. package/lib/tooltip/style/index.js +1 -0
  395. package/lib/tooltip/style/style.css +103 -0
  396. package/lib/tooltip/style/style.min.css +1 -0
  397. package/lib/ui/src/core.js +49 -2
  398. package/lib/ui/src/core.min.js +1 -1
  399. package/lib/ui/src/dom.js +22 -0
  400. package/lib/ui/src/dom.min.js +1 -1
  401. package/lib/ui/src/globalStore.js +119 -4
  402. package/lib/ui/src/globalStore.min.js +1 -1
  403. package/lib/ui/src/i18n.js +14 -0
  404. package/lib/ui/src/i18n.min.js +1 -0
  405. package/lib/ui/src/log.js +2 -3
  406. package/lib/ui/src/log.min.js +1 -1
  407. package/lib/ui/src/renderer.js +77 -0
  408. package/lib/ui/src/renderer.min.js +1 -0
  409. package/lib/ui/src/store.js +49 -0
  410. package/lib/ui/src/store.min.js +1 -0
  411. package/lib/ui/src/utils.js +12 -0
  412. package/lib/ui/src/utils.min.js +1 -1
  413. package/lib/ui/src/validators.js +14 -0
  414. package/lib/ui/src/validators.min.js +1 -0
  415. package/lib/ui/src/vn.js +18 -0
  416. package/lib/ui/src/vn.min.js +1 -0
  417. package/lib/vxe-button/style/style.css +17 -17
  418. package/lib/vxe-button/style/style.min.css +1 -1
  419. package/lib/vxe-checkbox/index.js +22 -0
  420. package/lib/vxe-checkbox/index.min.js +1 -0
  421. package/lib/vxe-checkbox/style/index.js +1 -0
  422. package/lib/vxe-checkbox/style/style.css +107 -0
  423. package/lib/vxe-checkbox/style/style.min.css +1 -0
  424. package/lib/vxe-checkbox-group/index.js +22 -0
  425. package/lib/vxe-checkbox-group/index.min.js +1 -0
  426. package/lib/vxe-checkbox-group/style/index.js +1 -0
  427. package/lib/vxe-checkbox-group/style/style.css +0 -0
  428. package/lib/vxe-checkbox-group/style/style.min.css +0 -0
  429. package/lib/{vxe-design → vxe-form}/index.js +5 -5
  430. package/lib/vxe-form/index.min.js +1 -0
  431. package/lib/vxe-form/style/index.js +1 -0
  432. package/lib/vxe-form/style/style.css +321 -0
  433. package/lib/vxe-form/style/style.min.css +1 -0
  434. package/lib/vxe-form-design/index.js +22 -0
  435. package/lib/vxe-form-design/index.min.js +1 -0
  436. package/lib/vxe-form-design/style/index.js +1 -0
  437. package/lib/vxe-form-design/style/style.css +97 -0
  438. package/lib/vxe-form-design/style/style.min.css +1 -0
  439. package/lib/vxe-form-gather/index.js +22 -0
  440. package/lib/vxe-form-gather/index.min.js +1 -0
  441. package/lib/vxe-form-gather/style/index.js +1 -0
  442. package/lib/vxe-form-gather/style/style.css +0 -0
  443. package/lib/vxe-form-gather/style/style.min.css +0 -0
  444. package/lib/vxe-form-item/index.js +22 -0
  445. package/lib/vxe-form-item/index.min.js +1 -0
  446. package/lib/vxe-form-item/style/index.js +1 -0
  447. package/lib/vxe-form-item/style/style.css +0 -0
  448. package/lib/vxe-form-item/style/style.min.css +0 -0
  449. package/lib/vxe-icon/style/style.css +540 -1
  450. package/lib/vxe-icon/style/style.min.css +1 -1
  451. package/lib/vxe-input/index.js +22 -0
  452. package/lib/vxe-input/index.min.js +1 -0
  453. package/lib/vxe-input/style/index.js +1 -0
  454. package/lib/vxe-input/style/style.css +1000 -0
  455. package/lib/vxe-input/style/style.min.css +1 -0
  456. package/lib/vxe-layout-aside/style/style.css +1 -0
  457. package/lib/vxe-layout-aside/style/style.min.css +1 -1
  458. package/lib/vxe-layout-body/style/style.css +1 -0
  459. package/lib/vxe-layout-body/style/style.min.css +1 -1
  460. package/lib/vxe-layout-footer/style/style.css +1 -0
  461. package/lib/vxe-layout-footer/style/style.min.css +1 -1
  462. package/lib/vxe-layout-header/style/style.css +1 -0
  463. package/lib/vxe-layout-header/style/style.min.css +1 -1
  464. package/lib/vxe-list-design/index.js +22 -0
  465. package/lib/vxe-list-design/index.min.js +1 -0
  466. package/lib/vxe-list-design/style/index.js +1 -0
  467. package/lib/vxe-list-design/style/style.css +0 -0
  468. package/lib/vxe-list-design/style/style.min.css +0 -0
  469. package/lib/vxe-loading/index.js +22 -0
  470. package/lib/vxe-loading/index.min.js +1 -0
  471. package/lib/vxe-loading/style/index.js +1 -0
  472. package/lib/vxe-loading/style/style.css +75 -0
  473. package/lib/vxe-loading/style/style.min.css +1 -0
  474. package/lib/vxe-modal/index.js +22 -0
  475. package/lib/vxe-modal/index.min.js +1 -0
  476. package/lib/vxe-modal/style/index.js +1 -0
  477. package/lib/vxe-modal/style/style.css +323 -0
  478. package/lib/vxe-modal/style/style.min.css +1 -0
  479. package/lib/vxe-optgroup/index.js +22 -0
  480. package/lib/vxe-optgroup/index.min.js +1 -0
  481. package/lib/vxe-optgroup/style/index.js +1 -0
  482. package/lib/vxe-optgroup/style/style.css +0 -0
  483. package/lib/vxe-optgroup/style/style.min.css +0 -0
  484. package/lib/vxe-option/index.js +22 -0
  485. package/lib/vxe-option/index.min.js +1 -0
  486. package/lib/vxe-option/style/index.js +1 -0
  487. package/lib/vxe-option/style/style.css +0 -0
  488. package/lib/vxe-option/style/style.min.css +0 -0
  489. package/lib/vxe-pager/index.js +22 -0
  490. package/lib/vxe-pager/index.min.js +1 -0
  491. package/lib/vxe-pager/style/index.js +1 -0
  492. package/lib/vxe-pager/style/style.css +319 -0
  493. package/lib/vxe-pager/style/style.min.css +1 -0
  494. package/lib/vxe-pulldown/index.js +22 -0
  495. package/lib/vxe-pulldown/index.min.js +1 -0
  496. package/lib/vxe-pulldown/style/index.js +1 -0
  497. package/lib/vxe-pulldown/style/style.css +57 -0
  498. package/lib/vxe-pulldown/style/style.min.css +1 -0
  499. package/lib/vxe-radio/index.js +22 -0
  500. package/lib/vxe-radio/index.min.js +1 -0
  501. package/lib/vxe-radio/style/index.js +1 -0
  502. package/lib/vxe-radio/style/style.css +143 -0
  503. package/lib/vxe-radio/style/style.min.css +1 -0
  504. package/lib/vxe-radio-button/index.js +22 -0
  505. package/lib/vxe-radio-button/index.min.js +1 -0
  506. package/lib/vxe-radio-button/style/index.js +1 -0
  507. package/lib/vxe-radio-button/style/style.css +0 -0
  508. package/lib/vxe-radio-button/style/style.min.css +0 -0
  509. package/lib/vxe-radio-group/index.js +22 -0
  510. package/lib/vxe-radio-group/index.min.js +1 -0
  511. package/lib/vxe-radio-group/style/index.js +1 -0
  512. package/lib/vxe-radio-group/style/style.css +0 -0
  513. package/lib/vxe-radio-group/style/style.min.css +0 -0
  514. package/lib/vxe-select/index.js +22 -0
  515. package/lib/vxe-select/index.min.js +1 -0
  516. package/lib/vxe-select/style/index.js +1 -0
  517. package/lib/vxe-select/style/style.css +201 -0
  518. package/lib/vxe-select/style/style.min.css +1 -0
  519. package/lib/vxe-switch/index.js +22 -0
  520. package/lib/vxe-switch/index.min.js +1 -0
  521. package/lib/vxe-switch/style/index.js +1 -0
  522. package/lib/vxe-switch/style/style.css +97 -0
  523. package/lib/vxe-switch/style/style.min.css +1 -0
  524. package/lib/vxe-textarea/index.js +22 -0
  525. package/lib/vxe-textarea/index.min.js +1 -0
  526. package/lib/vxe-textarea/style/index.js +1 -0
  527. package/lib/vxe-textarea/style/style.css +102 -0
  528. package/lib/vxe-textarea/style/style.min.css +1 -0
  529. package/lib/vxe-tooltip/index.js +22 -0
  530. package/lib/vxe-tooltip/index.min.js +1 -0
  531. package/lib/vxe-tooltip/style/index.js +1 -0
  532. package/lib/vxe-tooltip/style/style.css +103 -0
  533. package/lib/vxe-tooltip/style/style.min.css +1 -0
  534. package/package.json +1 -1
  535. package/packages/anchor/src/anchor.ts +1 -1
  536. package/packages/anchor-link/index.ts +1 -1
  537. package/packages/{button-group → button}/src/button-group.ts +2 -2
  538. package/packages/button/src/button.ts +3 -3
  539. package/packages/button-group/index.ts +1 -1
  540. package/packages/checkbox/index.ts +15 -0
  541. package/packages/checkbox/src/checkbox.ts +131 -0
  542. package/packages/checkbox/src/group.ts +127 -0
  543. package/packages/checkbox-group/index.ts +15 -0
  544. package/packages/col/index.ts +1 -1
  545. package/packages/components.ts +100 -35
  546. package/packages/dynamics/index.ts +34 -0
  547. package/packages/form/index.ts +11 -0
  548. package/packages/form/src/form-config-item.ts +193 -0
  549. package/packages/form/src/form-gather.ts +60 -0
  550. package/packages/form/src/form-item.ts +253 -0
  551. package/packages/form/src/form.ts +716 -0
  552. package/packages/form/src/itemInfo.ts +43 -0
  553. package/packages/form/src/render.ts +83 -0
  554. package/packages/form/src/util.ts +79 -0
  555. package/packages/form-design/index.ts +11 -0
  556. package/packages/form-design/src/form-design.ts +99 -0
  557. package/packages/form-design/src/setting.ts +13 -0
  558. package/packages/form-design/src/util.ts +10 -0
  559. package/packages/form-design/src/view.ts +125 -0
  560. package/packages/form-design/src/widget.ts +117 -0
  561. package/packages/form-gather/index.ts +11 -0
  562. package/packages/form-item/index.ts +11 -0
  563. package/packages/icon/src/icon.ts +1 -1
  564. package/packages/input/index.ts +15 -0
  565. package/packages/input/src/date.ts +42 -0
  566. package/packages/input/src/input.ts +2480 -0
  567. package/packages/input/src/number.ts +12 -0
  568. package/packages/list-design/index.ts +11 -0
  569. package/packages/list-design/src/list-design.ts +55 -0
  570. package/packages/loading/index.ts +11 -0
  571. package/packages/loading/src/loading.ts +56 -0
  572. package/packages/modal/index.ts +110 -0
  573. package/packages/modal/src/modal.ts +950 -0
  574. package/packages/optgroup/index.ts +15 -0
  575. package/packages/option/index.ts +15 -0
  576. package/packages/pager/index.ts +15 -0
  577. package/packages/pager/src/pager.ts +595 -0
  578. package/packages/pulldown/index.ts +15 -0
  579. package/packages/pulldown/src/pulldown.ts +349 -0
  580. package/packages/radio/index.ts +15 -0
  581. package/packages/radio/src/button.ts +132 -0
  582. package/packages/radio/src/group.ts +110 -0
  583. package/packages/radio/src/radio.ts +137 -0
  584. package/packages/radio-button/index.ts +15 -0
  585. package/packages/radio-group/index.ts +15 -0
  586. package/packages/select/index.ts +15 -0
  587. package/packages/select/src/optgroup.ts +39 -0
  588. package/packages/select/src/option.ts +38 -0
  589. package/packages/select/src/optionInfo.ts +20 -0
  590. package/packages/select/src/select.ts +1034 -0
  591. package/packages/select/src/util.ts +47 -0
  592. package/packages/switch/index.ts +15 -0
  593. package/packages/switch/src/switch.ts +171 -0
  594. package/packages/textarea/index.ts +15 -0
  595. package/packages/textarea/src/textarea.ts +273 -0
  596. package/packages/tooltip/index.ts +11 -0
  597. package/packages/tooltip/src/tooltip.ts +360 -0
  598. package/packages/ui/src/core.ts +13 -1
  599. package/packages/ui/src/dom.ts +23 -0
  600. package/packages/ui/src/globalStore.ts +122 -5
  601. package/packages/ui/src/i18n.ts +8 -0
  602. package/packages/ui/src/log.ts +2 -2
  603. package/packages/ui/src/renderer.ts +71 -0
  604. package/packages/ui/src/store.ts +49 -0
  605. package/packages/ui/src/utils.ts +12 -0
  606. package/packages/ui/src/validators.ts +9 -0
  607. package/packages/ui/src/vn.ts +14 -0
  608. package/styles/all.scss +30 -10
  609. package/styles/base/common.scss +13 -0
  610. package/styles/components/button.scss +8 -8
  611. package/styles/components/checkbox-group.scss +0 -0
  612. package/styles/components/checkbox.scss +91 -0
  613. package/styles/components/form-design.scss +93 -0
  614. package/styles/components/form-gather.scss +0 -0
  615. package/styles/components/form-item.scss +0 -0
  616. package/styles/components/form.scss +339 -0
  617. package/styles/components/icon.scss +3 -1
  618. package/styles/components/input.scss +911 -0
  619. package/styles/components/layout-aside.scss +1 -0
  620. package/styles/components/layout-body.scss +1 -0
  621. package/styles/components/layout-footer.scss +1 -0
  622. package/styles/components/layout-header.scss +1 -0
  623. package/styles/components/list-design.scss +0 -0
  624. package/styles/components/list.scss +26 -0
  625. package/styles/components/loading.scss +84 -0
  626. package/styles/components/modal.scss +383 -0
  627. package/styles/components/old-icon.scss +712 -0
  628. package/styles/components/optgroup.scss +0 -0
  629. package/styles/components/option.scss +0 -0
  630. package/styles/components/pager.scss +287 -0
  631. package/styles/components/pulldown.scss +55 -0
  632. package/styles/components/radio-button.scss +0 -0
  633. package/styles/components/radio-group.scss +0 -0
  634. package/styles/components/radio.scss +149 -0
  635. package/styles/components/select.scss +226 -0
  636. package/styles/components/switch.scss +113 -0
  637. package/styles/components/textarea.scss +102 -0
  638. package/styles/components/tooltip.scss +124 -0
  639. package/styles/helpers/mixin.scss +12 -12
  640. package/styles/theme/base.scss +143 -6
  641. package/types/all.d.ts +66 -33
  642. package/types/{component → components}/anchor-link.d.ts +17 -2
  643. package/types/{component → components}/anchor.d.ts +10 -2
  644. package/types/{component → components}/breadcrumb-item.d.ts +12 -1
  645. package/types/{component → components}/breadcrumb.d.ts +10 -2
  646. package/types/{component → components}/button-group.d.ts +11 -3
  647. package/types/{component → components}/button.d.ts +14 -3
  648. package/types/components/checkbox-group.d.ts +112 -0
  649. package/types/components/checkbox.d.ts +119 -0
  650. package/types/{component → components}/col.d.ts +9 -1
  651. package/types/components/form-design.d.ts +88 -0
  652. package/types/components/form-gather.d.ts +75 -0
  653. package/types/components/form-item.d.ts +231 -0
  654. package/types/components/form.d.ts +349 -0
  655. package/types/{component → components}/icon.d.ts +7 -2
  656. package/types/components/input.d.ts +375 -0
  657. package/types/{component → components}/layout-aside.d.ts +10 -2
  658. package/types/{component → components}/layout-body.d.ts +10 -2
  659. package/types/{component → components}/layout-container.d.ts +10 -2
  660. package/types/{component → components}/layout-footer.d.ts +10 -2
  661. package/types/{component → components}/layout-header.d.ts +7 -1
  662. package/types/components/list-design.d.ts +67 -0
  663. package/types/components/loading.d.ts +66 -0
  664. package/types/components/modal.d.ts +381 -0
  665. package/types/components/optgroup.d.ts +80 -0
  666. package/types/components/option.d.ts +99 -0
  667. package/types/components/pager.d.ts +208 -0
  668. package/types/components/pulldown.d.ts +134 -0
  669. package/types/components/radio-button.d.ts +99 -0
  670. package/types/components/radio-group.d.ts +107 -0
  671. package/types/components/radio.d.ts +119 -0
  672. package/types/{component → components}/row.d.ts +10 -2
  673. package/types/components/select.d.ts +274 -0
  674. package/types/components/switch.d.ts +118 -0
  675. package/types/components/textarea.d.ts +212 -0
  676. package/types/components/tooltip.d.ts +122 -0
  677. package/types/ui/global-config.d.ts +43 -6
  678. package/types/ui/global-icon.d.ts +80 -10
  679. package/types/ui/index.d.ts +25 -2
  680. package/types/ui/renderer.d.ts +239 -0
  681. package/types/ui/validators.d.ts +26 -0
  682. package/es/design/index.js +0 -8
  683. package/es/vxe-design/index.js +0 -3
  684. package/lib/button-group/src/button-group.min.js +0 -1
  685. package/lib/design/index.js +0 -15
  686. package/lib/design/index.min.js +0 -1
  687. package/lib/design/src/design.min.js +0 -1
  688. package/lib/vxe-design/index.min.js +0 -1
  689. package/packages/design/index.ts +0 -11
  690. package/packages/design/src/design.ts +0 -55
  691. package/styles/components/design.scss +0 -1
  692. package/types/component/design.d.ts +0 -63
  693. /package/es/{anchor-link → anchor}/src/anchor-link.js +0 -0
  694. /package/es/{anchor-link → anchor}/src/util.js +0 -0
  695. /package/es/{design → checkbox-group}/style.css +0 -0
  696. /package/es/{design → checkbox-group}/style.min.css +0 -0
  697. /package/es/{vxe-design → form-gather}/style.css +0 -0
  698. /package/es/{vxe-design → form-gather}/style.min.css +0 -0
  699. /package/{lib/design/style → es/form-item}/style.css +0 -0
  700. /package/{lib/design/style → es/form-item}/style.min.css +0 -0
  701. /package/{lib/vxe-design/style → es/list-design}/style.css +0 -0
  702. /package/{lib/vxe-design/style → es/list-design}/style.min.css +0 -0
  703. /package/es/{col → row}/src/col.js +0 -0
  704. /package/lib/{anchor-link → anchor}/src/anchor-link.js +0 -0
  705. /package/lib/{anchor-link → anchor}/src/anchor-link.min.js +0 -0
  706. /package/lib/{anchor-link → anchor}/src/util.js +0 -0
  707. /package/lib/{anchor-link → anchor}/src/util.min.js +0 -0
  708. /package/lib/{vxe-design → checkbox}/style/index.js +0 -0
  709. /package/lib/{design → checkbox-group}/style/index.js +0 -0
  710. /package/lib/{col → row}/src/col.js +0 -0
  711. /package/lib/{col → row}/src/col.min.js +0 -0
  712. /package/packages/{anchor-link → anchor}/src/anchor-link.ts +0 -0
  713. /package/packages/{anchor-link → anchor}/src/util.ts +0 -0
  714. /package/packages/{col → row}/src/col.ts +0 -0
@@ -0,0 +1,992 @@
1
+ import { defineComponent, h, Teleport, ref, inject, computed, provide, onUnmounted, reactive, nextTick, watch, onMounted, createCommentVNode } from 'vue';
2
+ import XEUtils from 'xe-utils';
3
+ import globalConfigStore from '../../ui/src/globalStore';
4
+ import iconConfigStore from '../../ui/src/iconStore';
5
+ import { useSize } from '../../hooks/size';
6
+ import { getEventTargetNode, getAbsolutePos } from '../../ui/src/dom';
7
+ import { getLastZIndex, nextZIndex, getFuncText, formatText } from '../../ui/src/utils';
8
+ import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../ui/src/event';
9
+ import { getI18n } from '../../ui/src/i18n';
10
+ import VxeInputComponent from '../../input/src/input';
11
+ import { getSlotVNs } from '../../ui/src/vn';
12
+ function isOptionVisible(option) {
13
+ return option.visible !== false;
14
+ }
15
+ function getOptUniqueId() {
16
+ return XEUtils.uniqueId('opt_');
17
+ }
18
+ export default defineComponent({
19
+ name: 'VxeSelect',
20
+ props: {
21
+ modelValue: null,
22
+ clearable: Boolean,
23
+ placeholder: {
24
+ type: String,
25
+ default: () => XEUtils.eqNull(globalConfigStore.select.placeholder) ? getI18n('vxe.base.pleaseSelect') : globalConfigStore.select.placeholder
26
+ },
27
+ loading: Boolean,
28
+ disabled: Boolean,
29
+ multiple: Boolean,
30
+ multiCharOverflow: { type: [Number, String], default: () => globalConfigStore.select.multiCharOverflow },
31
+ prefixIcon: String,
32
+ placement: String,
33
+ options: Array,
34
+ optionProps: Object,
35
+ optionGroups: Array,
36
+ optionGroupProps: Object,
37
+ optionConfig: Object,
38
+ className: [String, Function],
39
+ popupClassName: [String, Function],
40
+ max: { type: [String, Number], default: null },
41
+ size: { type: String, default: () => globalConfigStore.select.size || globalConfigStore.size },
42
+ filterable: Boolean,
43
+ filterMethod: Function,
44
+ remote: Boolean,
45
+ remoteMethod: Function,
46
+ emptyText: String,
47
+ // 已废弃,被 option-config.keyField 替换
48
+ optionId: { type: String, default: () => globalConfigStore.select.optionId },
49
+ // 已废弃,被 option-config.useKey 替换
50
+ optionKey: Boolean,
51
+ transfer: { type: Boolean, default: () => globalConfigStore.select.transfer }
52
+ },
53
+ emits: [
54
+ 'update:modelValue',
55
+ 'change',
56
+ 'clear',
57
+ 'blur',
58
+ 'focus'
59
+ ],
60
+ setup(props, context) {
61
+ const { slots, emit } = context;
62
+ const $xeform = inject('$xeForm', null);
63
+ const $xeformiteminfo = inject('$xeFormItemInfo', null);
64
+ const xID = XEUtils.uniqueId();
65
+ const computeSize = useSize(props);
66
+ const reactData = reactive({
67
+ inited: false,
68
+ staticOptions: [],
69
+ fullGroupList: [],
70
+ fullOptionList: [],
71
+ visibleGroupList: [],
72
+ visibleOptionList: [],
73
+ remoteValueList: [],
74
+ panelIndex: 0,
75
+ panelStyle: {},
76
+ panelPlacement: null,
77
+ currentOption: null,
78
+ currentValue: null,
79
+ visiblePanel: false,
80
+ animatVisible: false,
81
+ isActivated: false,
82
+ searchValue: '',
83
+ searchLoading: false
84
+ });
85
+ const refElem = ref();
86
+ const refInput = ref();
87
+ const refInpSearch = ref();
88
+ const refOptionWrapper = ref();
89
+ const refOptionPanel = ref();
90
+ const refMaps = {
91
+ refElem
92
+ };
93
+ const $xeselect = {
94
+ xID,
95
+ props,
96
+ context,
97
+ reactData,
98
+ getRefMaps: () => refMaps
99
+ };
100
+ let selectMethods = {};
101
+ const computePropsOpts = computed(() => {
102
+ return props.optionProps || {};
103
+ });
104
+ const computeGroupPropsOpts = computed(() => {
105
+ return props.optionGroupProps || {};
106
+ });
107
+ const computeLabelField = computed(() => {
108
+ const propsOpts = computePropsOpts.value;
109
+ return propsOpts.label || 'label';
110
+ });
111
+ const computeValueField = computed(() => {
112
+ const propsOpts = computePropsOpts.value;
113
+ return propsOpts.value || 'value';
114
+ });
115
+ const computeGroupLabelField = computed(() => {
116
+ const groupPropsOpts = computeGroupPropsOpts.value;
117
+ return groupPropsOpts.label || 'label';
118
+ });
119
+ const computeGroupOptionsField = computed(() => {
120
+ const groupPropsOpts = computeGroupPropsOpts.value;
121
+ return groupPropsOpts.options || 'options';
122
+ });
123
+ const computeIsMaximize = computed(() => {
124
+ const { modelValue, multiple, max } = props;
125
+ if (multiple && max) {
126
+ return (modelValue ? modelValue.length : 0) >= XEUtils.toNumber(max);
127
+ }
128
+ return false;
129
+ });
130
+ const computeOptionOpts = computed(() => {
131
+ return Object.assign({}, globalConfigStore.select.optionConfig, props.optionConfig);
132
+ });
133
+ const computeIsGroup = computed(() => {
134
+ return reactData.fullGroupList.some((item) => item.options && item.options.length);
135
+ });
136
+ const computeMultiMaxCharNum = computed(() => {
137
+ return XEUtils.toNumber(props.multiCharOverflow);
138
+ });
139
+ const callSlot = (slotFunc, params) => {
140
+ if (slotFunc) {
141
+ if (XEUtils.isString(slotFunc)) {
142
+ slotFunc = slots[slotFunc] || null;
143
+ }
144
+ if (XEUtils.isFunction(slotFunc)) {
145
+ return getSlotVNs(slotFunc(params));
146
+ }
147
+ }
148
+ return [];
149
+ };
150
+ const findOption = (optionValue) => {
151
+ const { fullOptionList, fullGroupList } = reactData;
152
+ const isGroup = computeIsGroup.value;
153
+ const valueField = computeValueField.value;
154
+ if (isGroup) {
155
+ for (let gIndex = 0; gIndex < fullGroupList.length; gIndex++) {
156
+ const group = fullGroupList[gIndex];
157
+ if (group.options) {
158
+ for (let index = 0; index < group.options.length; index++) {
159
+ const option = group.options[index];
160
+ if (optionValue === option[valueField]) {
161
+ return option;
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ return fullOptionList.find((item) => optionValue === item[valueField]);
168
+ };
169
+ const getRemoteSelectLabel = (value) => {
170
+ const { remoteValueList } = reactData;
171
+ const labelField = computeLabelField.value;
172
+ const remoteItem = remoteValueList.find(item => value === item.key);
173
+ const item = remoteItem ? remoteItem.result : null;
174
+ return XEUtils.toValueString(item ? item[labelField] : value);
175
+ };
176
+ const getSelectLabel = (value) => {
177
+ const labelField = computeLabelField.value;
178
+ const item = findOption(value);
179
+ return XEUtils.toValueString(item ? item[labelField] : value);
180
+ };
181
+ const computeSelectLabel = computed(() => {
182
+ const { modelValue, multiple, remote } = props;
183
+ const multiMaxCharNum = computeMultiMaxCharNum.value;
184
+ if (modelValue && multiple) {
185
+ const vals = XEUtils.isArray(modelValue) ? modelValue : [modelValue];
186
+ if (remote) {
187
+ return vals.map(val => getRemoteSelectLabel(val)).join(', ');
188
+ }
189
+ return vals.map((val) => {
190
+ const label = getSelectLabel(val);
191
+ if (multiMaxCharNum > 0 && label.length > multiMaxCharNum) {
192
+ return `${label.substring(0, multiMaxCharNum)}...`;
193
+ }
194
+ return label;
195
+ }).join(', ');
196
+ }
197
+ if (remote) {
198
+ return getRemoteSelectLabel(modelValue);
199
+ }
200
+ return getSelectLabel(modelValue);
201
+ });
202
+ const getOptkey = () => {
203
+ const optionOpts = computeOptionOpts.value;
204
+ return optionOpts.keyField || props.optionId || '_X_OPTION_KEY';
205
+ };
206
+ const getOptid = (option) => {
207
+ const optid = option[getOptkey()];
208
+ return optid ? encodeURIComponent(optid) : '';
209
+ };
210
+ /**
211
+ * 刷新选项,当选项被动态显示/隐藏时可能会用到
212
+ */
213
+ const refreshOption = () => {
214
+ const { filterable, filterMethod } = props;
215
+ const { fullOptionList, fullGroupList, searchValue } = reactData;
216
+ const isGroup = computeIsGroup.value;
217
+ const groupLabelField = computeGroupLabelField.value;
218
+ const labelField = computeLabelField.value;
219
+ if (isGroup) {
220
+ if (filterable && filterMethod) {
221
+ reactData.visibleGroupList = fullGroupList.filter(group => isOptionVisible(group) && filterMethod({ group, option: null, searchValue }));
222
+ }
223
+ else if (filterable) {
224
+ reactData.visibleGroupList = fullGroupList.filter(group => isOptionVisible(group) && (!searchValue || `${group[groupLabelField]}`.indexOf(searchValue) > -1));
225
+ }
226
+ else {
227
+ reactData.visibleGroupList = fullGroupList.filter(isOptionVisible);
228
+ }
229
+ }
230
+ else {
231
+ if (filterable && filterMethod) {
232
+ reactData.visibleOptionList = fullOptionList.filter(option => isOptionVisible(option) && filterMethod({ group: null, option, searchValue }));
233
+ }
234
+ else if (filterable) {
235
+ reactData.visibleOptionList = fullOptionList.filter(option => isOptionVisible(option) && (!searchValue || `${option[labelField]}`.indexOf(searchValue) > -1));
236
+ }
237
+ else {
238
+ reactData.visibleOptionList = fullOptionList.filter(isOptionVisible);
239
+ }
240
+ }
241
+ return nextTick();
242
+ };
243
+ const cacheItemMap = () => {
244
+ const { fullOptionList, fullGroupList } = reactData;
245
+ const groupOptionsField = computeGroupOptionsField.value;
246
+ const key = getOptkey();
247
+ const handleOptis = (item) => {
248
+ if (!getOptid(item)) {
249
+ item[key] = getOptUniqueId();
250
+ }
251
+ };
252
+ if (fullGroupList.length) {
253
+ fullGroupList.forEach((group) => {
254
+ handleOptis(group);
255
+ if (group[groupOptionsField]) {
256
+ group[groupOptionsField].forEach(handleOptis);
257
+ }
258
+ });
259
+ }
260
+ else if (fullOptionList.length) {
261
+ fullOptionList.forEach(handleOptis);
262
+ }
263
+ refreshOption();
264
+ };
265
+ const setCurrentOption = (option) => {
266
+ const valueField = computeValueField.value;
267
+ if (option) {
268
+ reactData.currentOption = option;
269
+ reactData.currentValue = option[valueField];
270
+ }
271
+ };
272
+ const scrollToOption = (option, isAlignBottom) => {
273
+ return nextTick().then(() => {
274
+ if (option) {
275
+ const optWrapperElem = refOptionWrapper.value;
276
+ const panelElem = refOptionPanel.value;
277
+ const optElem = panelElem.querySelector(`[optid='${getOptid(option)}']`);
278
+ if (optWrapperElem && optElem) {
279
+ const wrapperHeight = optWrapperElem.offsetHeight;
280
+ const offsetPadding = 5;
281
+ if (isAlignBottom) {
282
+ if (optElem.offsetTop + optElem.offsetHeight - optWrapperElem.scrollTop > wrapperHeight) {
283
+ optWrapperElem.scrollTop = optElem.offsetTop + optElem.offsetHeight - wrapperHeight;
284
+ }
285
+ }
286
+ else {
287
+ if (optElem.offsetTop + offsetPadding < optWrapperElem.scrollTop || optElem.offsetTop + offsetPadding > optWrapperElem.scrollTop + optWrapperElem.clientHeight) {
288
+ optWrapperElem.scrollTop = optElem.offsetTop - offsetPadding;
289
+ }
290
+ }
291
+ }
292
+ }
293
+ });
294
+ };
295
+ const updateZindex = () => {
296
+ if (reactData.panelIndex < getLastZIndex()) {
297
+ reactData.panelIndex = nextZIndex();
298
+ }
299
+ };
300
+ const updatePlacement = () => {
301
+ return nextTick().then(() => {
302
+ const { transfer, placement } = props;
303
+ const { panelIndex } = reactData;
304
+ const el = refElem.value;
305
+ const panelElem = refOptionPanel.value;
306
+ if (panelElem && el) {
307
+ const targetHeight = el.offsetHeight;
308
+ const targetWidth = el.offsetWidth;
309
+ const panelHeight = panelElem.offsetHeight;
310
+ const panelWidth = panelElem.offsetWidth;
311
+ const marginSize = 5;
312
+ const panelStyle = {
313
+ zIndex: panelIndex
314
+ };
315
+ const { boundingTop, boundingLeft, visibleHeight, visibleWidth } = getAbsolutePos(el);
316
+ let panelPlacement = 'bottom';
317
+ if (transfer) {
318
+ let left = boundingLeft;
319
+ let top = boundingTop + targetHeight;
320
+ if (placement === 'top') {
321
+ panelPlacement = 'top';
322
+ top = boundingTop - panelHeight;
323
+ }
324
+ else if (!placement) {
325
+ // 如果下面不够放,则向上
326
+ if (top + panelHeight + marginSize > visibleHeight) {
327
+ panelPlacement = 'top';
328
+ top = boundingTop - panelHeight;
329
+ }
330
+ // 如果上面不够放,则向下(优先)
331
+ if (top < marginSize) {
332
+ panelPlacement = 'bottom';
333
+ top = boundingTop + targetHeight;
334
+ }
335
+ }
336
+ // 如果溢出右边
337
+ if (left + panelWidth + marginSize > visibleWidth) {
338
+ left -= left + panelWidth + marginSize - visibleWidth;
339
+ }
340
+ // 如果溢出左边
341
+ if (left < marginSize) {
342
+ left = marginSize;
343
+ }
344
+ Object.assign(panelStyle, {
345
+ left: `${left}px`,
346
+ top: `${top}px`,
347
+ minWidth: `${targetWidth}px`
348
+ });
349
+ }
350
+ else {
351
+ if (placement === 'top') {
352
+ panelPlacement = 'top';
353
+ panelStyle.bottom = `${targetHeight}px`;
354
+ }
355
+ else if (!placement) {
356
+ // 如果下面不够放,则向上
357
+ if (boundingTop + targetHeight + panelHeight > visibleHeight) {
358
+ // 如果上面不够放,则向下(优先)
359
+ if (boundingTop - targetHeight - panelHeight > marginSize) {
360
+ panelPlacement = 'top';
361
+ panelStyle.bottom = `${targetHeight}px`;
362
+ }
363
+ }
364
+ }
365
+ }
366
+ reactData.panelStyle = panelStyle;
367
+ reactData.panelPlacement = panelPlacement;
368
+ return nextTick();
369
+ }
370
+ });
371
+ };
372
+ let hidePanelTimeout;
373
+ const showOptionPanel = () => {
374
+ const { loading, disabled, filterable } = props;
375
+ if (!loading && !disabled) {
376
+ clearTimeout(hidePanelTimeout);
377
+ if (!reactData.inited) {
378
+ reactData.inited = true;
379
+ }
380
+ reactData.isActivated = true;
381
+ reactData.animatVisible = true;
382
+ if (filterable) {
383
+ refreshOption();
384
+ }
385
+ setTimeout(() => {
386
+ const { modelValue, multiple } = props;
387
+ const currOption = findOption(multiple && modelValue ? modelValue[0] : modelValue);
388
+ reactData.visiblePanel = true;
389
+ if (currOption) {
390
+ setCurrentOption(currOption);
391
+ scrollToOption(currOption);
392
+ }
393
+ handleFocusSearch();
394
+ }, 10);
395
+ updateZindex();
396
+ updatePlacement();
397
+ }
398
+ };
399
+ const hideOptionPanel = () => {
400
+ reactData.searchValue = '';
401
+ reactData.searchLoading = false;
402
+ reactData.visiblePanel = false;
403
+ hidePanelTimeout = window.setTimeout(() => {
404
+ reactData.animatVisible = false;
405
+ }, 350);
406
+ };
407
+ const changeEvent = (evnt, selectValue) => {
408
+ if (selectValue !== props.modelValue) {
409
+ emit('update:modelValue', selectValue);
410
+ selectMethods.dispatchEvent('change', { value: selectValue }, evnt);
411
+ // 自动更新校验状态
412
+ if ($xeform && $xeformiteminfo) {
413
+ $xeform.triggerItemEvent(evnt, $xeformiteminfo.itemConfig.field, selectValue);
414
+ }
415
+ }
416
+ };
417
+ const clearValueEvent = (evnt, selectValue) => {
418
+ reactData.remoteValueList = [];
419
+ changeEvent(evnt, selectValue);
420
+ selectMethods.dispatchEvent('clear', { value: selectValue }, evnt);
421
+ };
422
+ const clearEvent = (params, evnt) => {
423
+ clearValueEvent(evnt, null);
424
+ hideOptionPanel();
425
+ };
426
+ const changeOptionEvent = (evnt, selectValue, option) => {
427
+ const { modelValue, multiple } = props;
428
+ const { remoteValueList } = reactData;
429
+ if (multiple) {
430
+ let multipleValue;
431
+ if (modelValue) {
432
+ if (modelValue.indexOf(selectValue) === -1) {
433
+ multipleValue = modelValue.concat([selectValue]);
434
+ }
435
+ else {
436
+ multipleValue = modelValue.filter((val) => val !== selectValue);
437
+ }
438
+ }
439
+ else {
440
+ multipleValue = [selectValue];
441
+ }
442
+ const remoteItem = remoteValueList.find(item => item.key === selectValue);
443
+ if (remoteItem) {
444
+ remoteItem.result = option;
445
+ }
446
+ else {
447
+ remoteValueList.push({ key: selectValue, result: option });
448
+ }
449
+ changeEvent(evnt, multipleValue);
450
+ }
451
+ else {
452
+ reactData.remoteValueList = [{ key: selectValue, result: option }];
453
+ changeEvent(evnt, selectValue);
454
+ hideOptionPanel();
455
+ }
456
+ };
457
+ const handleGlobalMousewheelEvent = (evnt) => {
458
+ const { disabled } = props;
459
+ const { visiblePanel } = reactData;
460
+ if (!disabled) {
461
+ if (visiblePanel) {
462
+ const panelElem = refOptionPanel.value;
463
+ if (getEventTargetNode(evnt, panelElem).flag) {
464
+ updatePlacement();
465
+ }
466
+ else {
467
+ hideOptionPanel();
468
+ }
469
+ }
470
+ }
471
+ };
472
+ const handleGlobalMousedownEvent = (evnt) => {
473
+ const { disabled } = props;
474
+ const { visiblePanel } = reactData;
475
+ if (!disabled) {
476
+ const el = refElem.value;
477
+ const panelElem = refOptionPanel.value;
478
+ reactData.isActivated = getEventTargetNode(evnt, el).flag || getEventTargetNode(evnt, panelElem).flag;
479
+ if (visiblePanel && !reactData.isActivated) {
480
+ hideOptionPanel();
481
+ }
482
+ }
483
+ };
484
+ const findOffsetOption = (optionValue, isUpArrow) => {
485
+ const { visibleOptionList, visibleGroupList } = reactData;
486
+ const isGroup = computeIsGroup.value;
487
+ const valueField = computeValueField.value;
488
+ const groupOptionsField = computeGroupOptionsField.value;
489
+ let firstOption;
490
+ let prevOption;
491
+ let nextOption;
492
+ let currOption;
493
+ if (isGroup) {
494
+ for (let gIndex = 0; gIndex < visibleGroupList.length; gIndex++) {
495
+ const group = visibleGroupList[gIndex];
496
+ const groupOptionList = group[groupOptionsField];
497
+ const isGroupDisabled = group.disabled;
498
+ if (groupOptionList) {
499
+ for (let index = 0; index < groupOptionList.length; index++) {
500
+ const option = groupOptionList[index];
501
+ const isVisible = isOptionVisible(option);
502
+ const isDisabled = isGroupDisabled || option.disabled;
503
+ if (!firstOption && !isDisabled) {
504
+ firstOption = option;
505
+ }
506
+ if (currOption) {
507
+ if (isVisible && !isDisabled) {
508
+ nextOption = option;
509
+ if (!isUpArrow) {
510
+ return { offsetOption: nextOption };
511
+ }
512
+ }
513
+ }
514
+ if (optionValue === option[valueField]) {
515
+ currOption = option;
516
+ if (isUpArrow) {
517
+ return { offsetOption: prevOption };
518
+ }
519
+ }
520
+ else {
521
+ if (isVisible && !isDisabled) {
522
+ prevOption = option;
523
+ }
524
+ }
525
+ }
526
+ }
527
+ }
528
+ }
529
+ else {
530
+ for (let index = 0; index < visibleOptionList.length; index++) {
531
+ const option = visibleOptionList[index];
532
+ const isDisabled = option.disabled;
533
+ if (!firstOption && !isDisabled) {
534
+ firstOption = option;
535
+ }
536
+ if (currOption) {
537
+ if (!isDisabled) {
538
+ nextOption = option;
539
+ if (!isUpArrow) {
540
+ return { offsetOption: nextOption };
541
+ }
542
+ }
543
+ }
544
+ if (optionValue === option[valueField]) {
545
+ currOption = option;
546
+ if (isUpArrow) {
547
+ return { offsetOption: prevOption };
548
+ }
549
+ }
550
+ else {
551
+ if (!isDisabled) {
552
+ prevOption = option;
553
+ }
554
+ }
555
+ }
556
+ }
557
+ return { firstOption };
558
+ };
559
+ const handleGlobalKeydownEvent = (evnt) => {
560
+ const { clearable, disabled } = props;
561
+ const { visiblePanel, currentValue, currentOption } = reactData;
562
+ if (!disabled) {
563
+ const isTab = hasEventKey(evnt, EVENT_KEYS.TAB);
564
+ const isEnter = hasEventKey(evnt, EVENT_KEYS.ENTER);
565
+ const isEsc = hasEventKey(evnt, EVENT_KEYS.ESCAPE);
566
+ const isUpArrow = hasEventKey(evnt, EVENT_KEYS.ARROW_UP);
567
+ const isDwArrow = hasEventKey(evnt, EVENT_KEYS.ARROW_DOWN);
568
+ const isDel = hasEventKey(evnt, EVENT_KEYS.DELETE);
569
+ const isSpacebar = hasEventKey(evnt, EVENT_KEYS.SPACEBAR);
570
+ if (isTab) {
571
+ reactData.isActivated = false;
572
+ }
573
+ if (visiblePanel) {
574
+ if (isEsc || isTab) {
575
+ hideOptionPanel();
576
+ }
577
+ else if (isEnter) {
578
+ evnt.preventDefault();
579
+ evnt.stopPropagation();
580
+ changeOptionEvent(evnt, currentValue, currentOption);
581
+ }
582
+ else if (isUpArrow || isDwArrow) {
583
+ evnt.preventDefault();
584
+ let { firstOption, offsetOption } = findOffsetOption(currentValue, isUpArrow);
585
+ if (!offsetOption && !findOption(currentValue)) {
586
+ offsetOption = firstOption;
587
+ }
588
+ setCurrentOption(offsetOption);
589
+ scrollToOption(offsetOption, isDwArrow);
590
+ }
591
+ else if (isSpacebar) {
592
+ evnt.preventDefault();
593
+ }
594
+ }
595
+ else if ((isUpArrow || isDwArrow || isEnter || isSpacebar) && reactData.isActivated) {
596
+ evnt.preventDefault();
597
+ showOptionPanel();
598
+ }
599
+ if (reactData.isActivated) {
600
+ if (isDel && clearable) {
601
+ clearValueEvent(evnt, null);
602
+ }
603
+ }
604
+ }
605
+ };
606
+ const handleGlobalBlurEvent = () => {
607
+ hideOptionPanel();
608
+ };
609
+ const handleFocusSearch = () => {
610
+ if (props.filterable) {
611
+ nextTick(() => {
612
+ const inpSearch = refInpSearch.value;
613
+ if (inpSearch) {
614
+ inpSearch.focus();
615
+ }
616
+ });
617
+ }
618
+ };
619
+ const focusEvent = (evnt) => {
620
+ if (!props.disabled) {
621
+ reactData.isActivated = true;
622
+ }
623
+ selectMethods.dispatchEvent('focus', {}, evnt);
624
+ };
625
+ const blurEvent = (evnt) => {
626
+ reactData.isActivated = false;
627
+ selectMethods.dispatchEvent('blur', {}, evnt);
628
+ };
629
+ const modelSearchEvent = (value) => {
630
+ reactData.searchValue = value;
631
+ };
632
+ const focusSearchEvent = () => {
633
+ reactData.isActivated = true;
634
+ };
635
+ const keydownSearchEvent = (params) => {
636
+ const { $event } = params;
637
+ const isEnter = hasEventKey($event, EVENT_KEYS.ENTER);
638
+ if (isEnter) {
639
+ $event.preventDefault();
640
+ $event.stopPropagation();
641
+ }
642
+ };
643
+ const triggerSearchEvent = XEUtils.debounce(function () {
644
+ const { remote, remoteMethod } = props;
645
+ const { searchValue } = reactData;
646
+ if (remote && remoteMethod) {
647
+ reactData.searchLoading = true;
648
+ Promise.resolve(remoteMethod({ searchValue })).then(() => nextTick()).catch(() => nextTick()).finally(() => {
649
+ reactData.searchLoading = false;
650
+ refreshOption();
651
+ });
652
+ }
653
+ else {
654
+ refreshOption();
655
+ }
656
+ }, 350, { trailing: true });
657
+ const togglePanelEvent = (params) => {
658
+ const { $event } = params;
659
+ $event.preventDefault();
660
+ if (reactData.visiblePanel) {
661
+ hideOptionPanel();
662
+ }
663
+ else {
664
+ showOptionPanel();
665
+ }
666
+ };
667
+ const checkOptionDisabled = (isSelected, option, group) => {
668
+ if (option.disabled) {
669
+ return true;
670
+ }
671
+ if (group && group.disabled) {
672
+ return true;
673
+ }
674
+ const isMaximize = computeIsMaximize.value;
675
+ if (isMaximize && !isSelected) {
676
+ return true;
677
+ }
678
+ return false;
679
+ };
680
+ const renderOption = (list, group) => {
681
+ const { optionKey, modelValue, multiple } = props;
682
+ const { currentValue } = reactData;
683
+ const optionOpts = computeOptionOpts.value;
684
+ const labelField = computeLabelField.value;
685
+ const valueField = computeValueField.value;
686
+ const isGroup = computeIsGroup.value;
687
+ const { useKey } = optionOpts;
688
+ const optionSlot = slots.option;
689
+ return list.map((option, cIndex) => {
690
+ const { slots, className } = option;
691
+ const optionValue = option[valueField];
692
+ const isSelected = multiple ? (modelValue && modelValue.indexOf(optionValue) > -1) : modelValue === optionValue;
693
+ const isVisible = !isGroup || isOptionVisible(option);
694
+ const isDisabled = checkOptionDisabled(isSelected, option, group);
695
+ const optid = getOptid(option);
696
+ const defaultSlot = slots ? slots.default : null;
697
+ const optParams = { option, group: null, $select: $xeselect };
698
+ return isVisible
699
+ ? h('div', {
700
+ key: useKey || optionKey ? optid : cIndex,
701
+ class: ['vxe-select-option', className ? (XEUtils.isFunction(className) ? className(optParams) : className) : '', {
702
+ 'is--disabled': isDisabled,
703
+ 'is--selected': isSelected,
704
+ 'is--hover': currentValue === optionValue
705
+ }],
706
+ // attrs
707
+ optid: optid,
708
+ // event
709
+ onMousedown: (evnt) => {
710
+ const isLeftBtn = evnt.button === 0;
711
+ if (isLeftBtn) {
712
+ evnt.stopPropagation();
713
+ }
714
+ },
715
+ onClick: (evnt) => {
716
+ if (!isDisabled) {
717
+ changeOptionEvent(evnt, optionValue, option);
718
+ }
719
+ },
720
+ onMouseenter: () => {
721
+ if (!isDisabled) {
722
+ setCurrentOption(option);
723
+ }
724
+ }
725
+ }, optionSlot ? callSlot(optionSlot, optParams) : (defaultSlot ? callSlot(defaultSlot, optParams) : formatText(getFuncText(option[labelField]))))
726
+ : createCommentVNode();
727
+ });
728
+ };
729
+ const renderOptgroup = () => {
730
+ const { optionKey } = props;
731
+ const { visibleGroupList } = reactData;
732
+ const optionOpts = computeOptionOpts.value;
733
+ const groupLabelField = computeGroupLabelField.value;
734
+ const groupOptionsField = computeGroupOptionsField.value;
735
+ const { useKey } = optionOpts;
736
+ const optionSlot = slots.option;
737
+ return visibleGroupList.map((group, gIndex) => {
738
+ const { slots, className } = group;
739
+ const optid = getOptid(group);
740
+ const isGroupDisabled = group.disabled;
741
+ const defaultSlot = slots ? slots.default : null;
742
+ const optParams = { option: group, group, $select: $xeselect };
743
+ return h('div', {
744
+ key: useKey || optionKey ? optid : gIndex,
745
+ class: ['vxe-optgroup', className ? (XEUtils.isFunction(className) ? className(optParams) : className) : '', {
746
+ 'is--disabled': isGroupDisabled
747
+ }],
748
+ // attrs
749
+ optid: optid
750
+ }, [
751
+ h('div', {
752
+ class: 'vxe-optgroup--title'
753
+ }, optionSlot ? callSlot(optionSlot, optParams) : (defaultSlot ? callSlot(defaultSlot, optParams) : getFuncText(group[groupLabelField]))),
754
+ h('div', {
755
+ class: 'vxe-optgroup--wrapper'
756
+ }, renderOption(group[groupOptionsField] || [], group))
757
+ ]);
758
+ });
759
+ };
760
+ const renderOpts = () => {
761
+ const { visibleGroupList, visibleOptionList, searchLoading } = reactData;
762
+ const isGroup = computeIsGroup.value;
763
+ if (searchLoading) {
764
+ return [
765
+ h('div', {
766
+ class: 'vxe-select--search-loading'
767
+ }, [
768
+ h('i', {
769
+ class: ['vxe-select--search-icon', iconConfigStore.SELECT_LOADED]
770
+ }),
771
+ h('span', {
772
+ class: 'vxe-select--search-text'
773
+ }, getI18n('vxe.select.loadingText'))
774
+ ])
775
+ ];
776
+ }
777
+ if (isGroup) {
778
+ if (visibleGroupList.length) {
779
+ return renderOptgroup();
780
+ }
781
+ }
782
+ else {
783
+ if (visibleOptionList.length) {
784
+ return renderOption(visibleOptionList);
785
+ }
786
+ }
787
+ return [
788
+ h('div', {
789
+ class: 'vxe-select--empty-placeholder'
790
+ }, props.emptyText || getI18n('vxe.select.emptyText'))
791
+ ];
792
+ };
793
+ selectMethods = {
794
+ dispatchEvent(type, params, evnt) {
795
+ emit(type, Object.assign({ $select: $xeselect, $event: evnt }, params));
796
+ },
797
+ isPanelVisible() {
798
+ return reactData.visiblePanel;
799
+ },
800
+ togglePanel() {
801
+ if (reactData.visiblePanel) {
802
+ hideOptionPanel();
803
+ }
804
+ else {
805
+ showOptionPanel();
806
+ }
807
+ return nextTick();
808
+ },
809
+ hidePanel() {
810
+ if (reactData.visiblePanel) {
811
+ hideOptionPanel();
812
+ }
813
+ return nextTick();
814
+ },
815
+ showPanel() {
816
+ if (!reactData.visiblePanel) {
817
+ showOptionPanel();
818
+ }
819
+ return nextTick();
820
+ },
821
+ refreshOption,
822
+ focus() {
823
+ const $input = refInput.value;
824
+ reactData.isActivated = true;
825
+ $input.blur();
826
+ return nextTick();
827
+ },
828
+ blur() {
829
+ const $input = refInput.value;
830
+ $input.blur();
831
+ reactData.isActivated = false;
832
+ return nextTick();
833
+ }
834
+ };
835
+ Object.assign($xeselect, selectMethods);
836
+ watch(() => reactData.staticOptions, (value) => {
837
+ if (value.some((item) => item.options && item.options.length)) {
838
+ reactData.fullOptionList = [];
839
+ reactData.fullGroupList = value;
840
+ }
841
+ else {
842
+ reactData.fullGroupList = [];
843
+ reactData.fullOptionList = value || [];
844
+ }
845
+ cacheItemMap();
846
+ });
847
+ watch(() => props.options, (value) => {
848
+ reactData.fullGroupList = [];
849
+ reactData.fullOptionList = value || [];
850
+ cacheItemMap();
851
+ });
852
+ watch(() => props.optionGroups, (value) => {
853
+ reactData.fullOptionList = [];
854
+ reactData.fullGroupList = value || [];
855
+ cacheItemMap();
856
+ });
857
+ onMounted(() => {
858
+ nextTick(() => {
859
+ const { options, optionGroups } = props;
860
+ if (optionGroups) {
861
+ reactData.fullGroupList = optionGroups;
862
+ }
863
+ else if (options) {
864
+ reactData.fullOptionList = options;
865
+ }
866
+ cacheItemMap();
867
+ });
868
+ GlobalEvent.on($xeselect, 'mousewheel', handleGlobalMousewheelEvent);
869
+ GlobalEvent.on($xeselect, 'mousedown', handleGlobalMousedownEvent);
870
+ GlobalEvent.on($xeselect, 'keydown', handleGlobalKeydownEvent);
871
+ GlobalEvent.on($xeselect, 'blur', handleGlobalBlurEvent);
872
+ });
873
+ onUnmounted(() => {
874
+ GlobalEvent.off($xeselect, 'mousewheel');
875
+ GlobalEvent.off($xeselect, 'mousedown');
876
+ GlobalEvent.off($xeselect, 'keydown');
877
+ GlobalEvent.off($xeselect, 'blur');
878
+ });
879
+ const renderVN = () => {
880
+ const { className, popupClassName, transfer, disabled, loading, filterable } = props;
881
+ const { inited, isActivated, visiblePanel } = reactData;
882
+ const vSize = computeSize.value;
883
+ const selectLabel = computeSelectLabel.value;
884
+ const defaultSlot = slots.default;
885
+ const headerSlot = slots.header;
886
+ const footerSlot = slots.footer;
887
+ const prefixSlot = slots.prefix;
888
+ return h('div', {
889
+ ref: refElem,
890
+ class: ['vxe-select', className ? (XEUtils.isFunction(className) ? className({ $select: $xeselect }) : className) : '', {
891
+ [`size--${vSize}`]: vSize,
892
+ 'is--visivle': visiblePanel,
893
+ 'is--disabled': disabled,
894
+ 'is--filter': filterable,
895
+ 'is--loading': loading,
896
+ 'is--active': isActivated
897
+ }]
898
+ }, [
899
+ h('div', {
900
+ class: 'vxe-select-slots',
901
+ ref: 'hideOption'
902
+ }, defaultSlot ? defaultSlot({}) : []),
903
+ h(VxeInputComponent, {
904
+ ref: refInput,
905
+ clearable: props.clearable,
906
+ placeholder: props.placeholder,
907
+ readonly: true,
908
+ disabled: disabled,
909
+ type: 'text',
910
+ prefixIcon: props.prefixIcon,
911
+ suffixIcon: loading ? iconConfigStore.SELECT_LOADED : (visiblePanel ? iconConfigStore.SELECT_OPEN : iconConfigStore.SELECT_CLOSE),
912
+ modelValue: selectLabel,
913
+ onClear: clearEvent,
914
+ onClick: togglePanelEvent,
915
+ onFocus: focusEvent,
916
+ onBlur: blurEvent,
917
+ onSuffixClick: togglePanelEvent
918
+ }, prefixSlot
919
+ ? {
920
+ prefix: () => prefixSlot({})
921
+ }
922
+ : {}),
923
+ h(Teleport, {
924
+ to: 'body',
925
+ disabled: transfer ? !inited : true
926
+ }, [
927
+ h('div', {
928
+ ref: refOptionPanel,
929
+ class: ['vxe-table--ignore-clear vxe-select--panel', popupClassName ? (XEUtils.isFunction(popupClassName) ? popupClassName({ $select: $xeselect }) : popupClassName) : '', {
930
+ [`size--${vSize}`]: vSize,
931
+ 'is--transfer': transfer,
932
+ 'animat--leave': !loading && reactData.animatVisible,
933
+ 'animat--enter': !loading && visiblePanel
934
+ }],
935
+ placement: reactData.panelPlacement,
936
+ style: reactData.panelStyle
937
+ }, inited
938
+ ? [
939
+ filterable
940
+ ? h('div', {
941
+ class: 'vxe-select--panel-search'
942
+ }, [
943
+ h(VxeInputComponent, {
944
+ ref: refInpSearch,
945
+ class: 'vxe-select-search--input',
946
+ modelValue: reactData.searchValue,
947
+ clearable: true,
948
+ placeholder: getI18n('vxe.select.search'),
949
+ prefixIcon: iconConfigStore.INPUT_SEARCH,
950
+ 'onUpdate:modelValue': modelSearchEvent,
951
+ onFocus: focusSearchEvent,
952
+ onKeydown: keydownSearchEvent,
953
+ onChange: triggerSearchEvent,
954
+ onSearch: triggerSearchEvent
955
+ })
956
+ ])
957
+ : createCommentVNode(),
958
+ h('div', {
959
+ class: 'vxe-select--panel-wrapper'
960
+ }, [
961
+ headerSlot
962
+ ? h('div', {
963
+ class: 'vxe-select--panel-header'
964
+ }, headerSlot({}))
965
+ : createCommentVNode(),
966
+ h('div', {
967
+ class: 'vxe-select--panel-body'
968
+ }, [
969
+ h('div', {
970
+ ref: refOptionWrapper,
971
+ class: 'vxe-select-option--wrapper'
972
+ }, renderOpts())
973
+ ]),
974
+ footerSlot
975
+ ? h('div', {
976
+ class: 'vxe-select--panel-footer'
977
+ }, footerSlot({}))
978
+ : createCommentVNode()
979
+ ])
980
+ ]
981
+ : [])
982
+ ])
983
+ ]);
984
+ };
985
+ $xeselect.renderVN = renderVN;
986
+ provide('$xeselect', $xeselect);
987
+ return $xeselect;
988
+ },
989
+ render() {
990
+ return this.renderVN();
991
+ }
992
+ });