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