vxe-pc-ui 4.20.34 → 4.20.35

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 (367) hide show
  1. package/dist/all.esm.js +45718 -45038
  2. package/dist/all.esm.min.js +3 -3
  3. package/dist/style.css +307 -1
  4. package/dist/style.mini.css +1 -1
  5. package/es/alert/src/alert.js +117 -114
  6. package/es/anchor/src/anchor-link.js +110 -107
  7. package/es/anchor/src/anchor.js +212 -209
  8. package/es/avatar/src/avatar.js +132 -129
  9. package/es/backtop/src/backtop.js +267 -264
  10. package/es/badge/src/badge.js +102 -99
  11. package/es/breadcrumb/src/breadcrumb-item.js +104 -101
  12. package/es/breadcrumb/src/breadcrumb.js +70 -67
  13. package/es/button/src/button-group.js +88 -85
  14. package/es/calendar/src/calendar.js +1371 -1368
  15. package/es/card/src/card.js +235 -232
  16. package/es/carousel/src/carousel-item.js +78 -75
  17. package/es/carousel/src/carousel.js +392 -389
  18. package/es/cascader/src/cascader.js +1667 -1664
  19. package/es/checkbox/src/button.js +198 -195
  20. package/es/checkbox/src/checkbox.js +181 -178
  21. package/es/checkbox/src/group.js +210 -207
  22. package/es/collapse/src/collapse-pane.js +98 -95
  23. package/es/collapse/src/collapse.js +340 -337
  24. package/es/color-picker/src/color-picker.js +1116 -1113
  25. package/es/components.d.ts +1 -0
  26. package/es/components.js +3 -0
  27. package/es/context-menu/src/context-menu.js +601 -598
  28. package/es/countdown/src/countdown.js +224 -221
  29. package/es/date-panel/src/date-panel.js +1905 -1902
  30. package/es/date-picker/src/date-picker.js +1537 -1534
  31. package/es/date-range-picker/src/date-range-picker.js +1412 -1409
  32. package/es/divider/src/divider.js +80 -77
  33. package/es/drawer/src/drawer.js +778 -775
  34. package/es/empty/src/empty.js +100 -97
  35. package/es/form/src/form-group.js +74 -71
  36. package/es/form/src/form-item.js +76 -73
  37. package/es/form/src/form.js +789 -786
  38. package/es/icon/src/icon.js +59 -56
  39. package/es/icon/style.css +1 -1
  40. package/es/icon/style.mini.css +1 -1
  41. package/es/icon-picker/src/icon-picker.js +719 -716
  42. package/es/image/src/group.js +130 -127
  43. package/es/image/src/image.js +243 -240
  44. package/es/image/src/preview.js +627 -624
  45. package/es/index.esm.js +2 -0
  46. package/es/index.js +2 -0
  47. package/es/input/src/input.js +2700 -2697
  48. package/es/layout-aside/src/layout-aside.js +138 -135
  49. package/es/layout-body/src/layout-body.js +145 -142
  50. package/es/layout-container/src/layout-container.js +71 -68
  51. package/es/layout-footer/src/layout-footer.js +60 -57
  52. package/es/layout-header/src/layout-header.js +58 -55
  53. package/es/link/src/link.js +131 -128
  54. package/es/list/src/list.js +2174 -2171
  55. package/es/loading/src/loading.js +141 -138
  56. package/es/mention/src/mention.js +49 -46
  57. package/es/menu/src/menu.js +799 -796
  58. package/es/modal/src/modal.js +1519 -1527
  59. package/es/notice-bar/src/notice-bar.js +168 -165
  60. package/es/number-input/src/number-input.js +1094 -1091
  61. package/es/pager/src/pager.js +767 -764
  62. package/es/password-input/src/password-input.js +431 -428
  63. package/es/print/src/page-break.js +63 -60
  64. package/es/print/src/print.js +303 -300
  65. package/es/pulldown/src/pulldown.js +403 -400
  66. package/es/radio/src/button.js +214 -211
  67. package/es/radio/src/group.js +195 -192
  68. package/es/radio/src/radio.js +194 -191
  69. package/es/rate/src/rate.js +164 -161
  70. package/es/result/src/result.js +116 -113
  71. package/es/row/src/col.js +133 -130
  72. package/es/row/src/row.js +111 -108
  73. package/es/scrollbar/src/scrollbar.js +518 -515
  74. package/es/segmented/src/segmented.js +240 -237
  75. package/es/select/src/optgroup.js +44 -41
  76. package/es/select/src/option.js +39 -36
  77. package/es/select/src/select.js +1914 -1896
  78. package/es/slider/src/slider.js +419 -416
  79. package/es/space/src/space.js +190 -187
  80. package/es/splitter/src/splitter-panel.js +146 -143
  81. package/es/splitter/src/splitter.js +917 -914
  82. package/es/step-item/index.d.ts +76 -0
  83. package/es/step-item/index.js +17 -0
  84. package/es/steps/index.d.ts +288 -34
  85. package/es/steps/src/step-info.d.ts +6 -0
  86. package/es/steps/src/step-info.js +20 -0
  87. package/es/steps/src/step-item.d.ts +14 -0
  88. package/es/steps/src/step-item.js +39 -0
  89. package/es/steps/src/steps.d.ts +68 -8
  90. package/es/steps/src/steps.js +299 -47
  91. package/es/steps/src/util.d.ts +7 -0
  92. package/es/steps/src/util.js +44 -0
  93. package/es/steps/style.css +297 -0
  94. package/es/steps/style.mini.css +1 -0
  95. package/es/style.css +307 -1
  96. package/es/style.mini.css +1 -1
  97. package/es/switch/src/switch.js +228 -225
  98. package/es/table-select/src/table-select.js +865 -862
  99. package/es/table-transfer/src/table-transfer.js +61 -58
  100. package/es/tabs/src/tab-pane.js +102 -99
  101. package/es/tabs/src/tabs.js +936 -933
  102. package/es/tag/src/tag.js +163 -160
  103. package/es/text/src/text.js +232 -229
  104. package/es/text-ellipsis/src/text-ellipsis.js +252 -249
  105. package/es/textarea/src/textarea.js +434 -431
  106. package/es/timeline/src/timeline.js +74 -36
  107. package/es/timeline/src/util.js +7 -4
  108. package/es/tip/src/tip.js +117 -114
  109. package/es/tooltip/src/tooltip.js +552 -549
  110. package/es/tour/src/tour.js +49 -46
  111. package/es/transfer/src/transfer.js +95 -92
  112. package/es/tree/src/tree.js +3379 -3376
  113. package/es/tree-select/src/tree-select.js +969 -966
  114. package/es/ui/index.js +8 -2
  115. package/es/ui/src/log.js +1 -1
  116. package/es/upload/src/upload.js +1791 -1788
  117. package/es/vxe-icon/style.css +1 -1
  118. package/es/vxe-icon/style.mini.css +1 -1
  119. package/es/vxe-steps/style.css +297 -0
  120. package/es/vxe-steps/style.mini.css +1 -0
  121. package/es/watermark/src/watermark.js +158 -155
  122. package/lib/alert/src/alert.js +117 -114
  123. package/lib/anchor/src/anchor-link.js +110 -107
  124. package/lib/anchor/src/anchor.js +212 -209
  125. package/lib/avatar/src/avatar.js +132 -129
  126. package/lib/backtop/src/backtop.js +267 -264
  127. package/lib/badge/src/badge.js +102 -99
  128. package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
  129. package/lib/breadcrumb/src/breadcrumb.js +70 -67
  130. package/lib/button/src/button-group.js +88 -85
  131. package/lib/calendar/src/calendar.js +1371 -1368
  132. package/lib/card/src/card.js +235 -232
  133. package/lib/carousel/src/carousel-item.js +78 -75
  134. package/lib/carousel/src/carousel.js +392 -389
  135. package/lib/cascader/src/cascader.js +1665 -1662
  136. package/lib/checkbox/src/button.js +198 -195
  137. package/lib/checkbox/src/checkbox.js +181 -178
  138. package/lib/checkbox/src/group.js +210 -207
  139. package/lib/collapse/src/collapse-pane.js +98 -95
  140. package/lib/collapse/src/collapse.js +340 -337
  141. package/lib/color-picker/src/color-picker.js +1116 -1113
  142. package/lib/components.js +3 -0
  143. package/lib/context-menu/src/context-menu.js +601 -598
  144. package/lib/countdown/src/countdown.js +224 -221
  145. package/lib/date-panel/src/date-panel.js +1905 -1902
  146. package/lib/date-picker/src/date-picker.js +1537 -1534
  147. package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
  148. package/lib/divider/src/divider.js +80 -77
  149. package/lib/drawer/src/drawer.js +778 -775
  150. package/lib/empty/src/empty.js +100 -97
  151. package/lib/form/src/form-group.js +74 -71
  152. package/lib/form/src/form-item.js +76 -73
  153. package/lib/form/src/form.js +789 -786
  154. package/lib/icon/src/icon.js +59 -56
  155. package/lib/icon/style/style.css +1 -1
  156. package/lib/icon/style/style.mini.css +1 -1
  157. package/lib/icon-picker/src/icon-picker.js +719 -716
  158. package/lib/image/src/group.js +130 -127
  159. package/lib/image/src/image.js +243 -240
  160. package/lib/image/src/preview.js +627 -624
  161. package/lib/index.common.js +2 -0
  162. package/lib/index.js +2 -0
  163. package/lib/index.umd.js +47411 -46732
  164. package/lib/index.umd.min.js +3 -3
  165. package/lib/input/src/input.js +2700 -2697
  166. package/lib/layout-aside/src/layout-aside.js +138 -135
  167. package/lib/layout-body/src/layout-body.js +145 -142
  168. package/lib/layout-container/src/layout-container.js +71 -68
  169. package/lib/layout-footer/src/layout-footer.js +60 -57
  170. package/lib/layout-header/src/layout-header.js +58 -55
  171. package/lib/link/src/link.js +131 -128
  172. package/lib/list/src/list.js +2173 -2170
  173. package/lib/loading/src/loading.js +141 -138
  174. package/lib/mention/src/mention.js +49 -46
  175. package/lib/menu/src/menu.js +799 -796
  176. package/lib/modal/src/modal.js +1519 -1527
  177. package/lib/notice-bar/src/notice-bar.js +168 -165
  178. package/lib/number-input/src/number-input.js +1094 -1091
  179. package/lib/pager/src/pager.js +767 -764
  180. package/lib/password-input/src/password-input.js +431 -428
  181. package/lib/print/src/page-break.js +63 -60
  182. package/lib/print/src/print.js +303 -300
  183. package/lib/pulldown/src/pulldown.js +403 -400
  184. package/lib/radio/src/button.js +214 -211
  185. package/lib/radio/src/group.js +195 -192
  186. package/lib/radio/src/radio.js +194 -191
  187. package/lib/rate/src/rate.js +164 -161
  188. package/lib/result/src/result.js +116 -113
  189. package/lib/row/src/col.js +133 -130
  190. package/lib/row/src/row.js +111 -108
  191. package/lib/scrollbar/src/scrollbar.js +518 -515
  192. package/lib/segmented/src/segmented.js +240 -237
  193. package/lib/select/src/optgroup.js +44 -41
  194. package/lib/select/src/option.js +39 -36
  195. package/lib/select/src/select.js +1915 -1897
  196. package/lib/slider/src/slider.js +419 -416
  197. package/lib/space/src/space.js +190 -187
  198. package/lib/splitter/src/splitter-panel.js +146 -143
  199. package/lib/splitter/src/splitter.js +917 -914
  200. package/lib/step-item/index.js +47 -0
  201. package/lib/steps/src/step-info.js +49 -0
  202. package/lib/steps/src/step-item.js +59 -0
  203. package/lib/steps/src/steps.js +298 -46
  204. package/lib/steps/src/util.js +74 -0
  205. package/lib/steps/style/style.css +297 -0
  206. package/lib/steps/style/style.mini.css +1 -0
  207. package/lib/style.css +307 -1
  208. package/lib/style.mini.css +1 -1
  209. package/lib/switch/src/switch.js +228 -225
  210. package/lib/table-select/src/table-select.js +865 -862
  211. package/lib/table-transfer/src/table-transfer.js +61 -58
  212. package/lib/tabs/src/tab-pane.js +102 -99
  213. package/lib/tabs/src/tabs.js +936 -933
  214. package/lib/tag/src/tag.js +163 -160
  215. package/lib/text/src/text.js +232 -229
  216. package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
  217. package/lib/textarea/src/textarea.js +434 -431
  218. package/lib/timeline/src/timeline.js +74 -36
  219. package/lib/timeline/src/util.js +7 -4
  220. package/lib/tip/src/tip.js +117 -114
  221. package/lib/tooltip/src/tooltip.js +552 -549
  222. package/lib/tour/src/tour.js +49 -46
  223. package/lib/transfer/src/transfer.js +95 -92
  224. package/lib/tree/src/tree.js +3379 -3376
  225. package/lib/tree-select/src/tree-select.js +969 -966
  226. package/lib/ui/index.js +8 -2
  227. package/lib/ui/src/log.js +1 -1
  228. package/lib/upload/src/upload.js +1788 -1785
  229. package/lib/vxe-icon/style/style.css +1 -1
  230. package/lib/vxe-icon/style/style.mini.css +1 -1
  231. package/lib/vxe-steps/style/style.css +297 -0
  232. package/lib/vxe-steps/style/style.mini.css +1 -0
  233. package/lib/watermark/src/watermark.js +158 -155
  234. package/package.json +1 -1
  235. package/packages/alert/src/alert.ts +2 -2
  236. package/packages/anchor/src/anchor-link.ts +2 -2
  237. package/packages/anchor/src/anchor.ts +2 -2
  238. package/packages/avatar/src/avatar.ts +2 -2
  239. package/packages/backtop/src/backtop.ts +2 -2
  240. package/packages/badge/src/badge.ts +2 -2
  241. package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
  242. package/packages/breadcrumb/src/breadcrumb.ts +2 -2
  243. package/packages/button/src/button-group.ts +2 -2
  244. package/packages/calendar/src/calendar.ts +2 -2
  245. package/packages/card/src/card.ts +2 -2
  246. package/packages/carousel/src/carousel-item.ts +2 -2
  247. package/packages/carousel/src/carousel.ts +2 -2
  248. package/packages/cascader/src/cascader.ts +2 -2
  249. package/packages/checkbox/src/button.ts +3 -15
  250. package/packages/checkbox/src/checkbox.ts +2 -2
  251. package/packages/checkbox/src/group.ts +2 -2
  252. package/packages/collapse/src/collapse-pane.ts +2 -2
  253. package/packages/collapse/src/collapse.ts +2 -2
  254. package/packages/color-picker/src/color-picker.ts +2 -2
  255. package/packages/components.ts +3 -0
  256. package/packages/context-menu/src/context-menu.ts +3 -16
  257. package/packages/countdown/src/countdown.ts +2 -2
  258. package/packages/date-panel/src/date-panel.ts +2 -2
  259. package/packages/date-picker/src/date-picker.ts +2 -2
  260. package/packages/date-range-picker/src/date-range-picker.ts +2 -2
  261. package/packages/divider/src/divider.ts +2 -2
  262. package/packages/drawer/src/drawer.ts +2 -2
  263. package/packages/empty/src/empty.ts +2 -2
  264. package/packages/form/src/form-group.ts +2 -2
  265. package/packages/form/src/form-item.ts +2 -2
  266. package/packages/form/src/form.ts +2 -2
  267. package/packages/icon/src/icon.ts +2 -2
  268. package/packages/icon-picker/src/icon-picker.ts +2 -2
  269. package/packages/image/src/group.ts +2 -2
  270. package/packages/image/src/image.ts +2 -2
  271. package/packages/image/src/preview.ts +3 -16
  272. package/packages/index.ts +2 -2
  273. package/packages/input/src/input.ts +2 -2
  274. package/packages/layout-aside/src/layout-aside.ts +2 -2
  275. package/packages/layout-body/src/layout-body.ts +2 -2
  276. package/packages/layout-container/src/layout-container.ts +3 -14
  277. package/packages/layout-footer/src/layout-footer.ts +2 -2
  278. package/packages/layout-header/src/layout-header.ts +2 -2
  279. package/packages/link/src/link.ts +2 -2
  280. package/packages/list/src/list.ts +2 -2
  281. package/packages/loading/src/loading.ts +2 -2
  282. package/packages/mention/src/mention.ts +2 -2
  283. package/packages/menu/src/menu.ts +2 -2
  284. package/packages/modal/src/modal.ts +5 -20
  285. package/packages/notice-bar/src/notice-bar.ts +2 -2
  286. package/packages/number-input/src/number-input.ts +3 -17
  287. package/packages/pager/src/pager.ts +2 -2
  288. package/packages/password-input/src/password-input.ts +2 -2
  289. package/packages/print/src/page-break.ts +2 -2
  290. package/packages/print/src/print.ts +2 -2
  291. package/packages/pulldown/src/pulldown.ts +2 -2
  292. package/packages/radio/src/button.ts +3 -16
  293. package/packages/radio/src/group.ts +3 -17
  294. package/packages/radio/src/radio.ts +2 -2
  295. package/packages/rate/src/rate.ts +2 -2
  296. package/packages/result/src/result.ts +2 -2
  297. package/packages/row/src/col.ts +2 -2
  298. package/packages/row/src/row.ts +2 -2
  299. package/packages/scrollbar/src/scrollbar.ts +3 -4
  300. package/packages/segmented/src/segmented.ts +2 -2
  301. package/packages/select/src/optgroup.ts +2 -2
  302. package/packages/select/src/option.ts +2 -2
  303. package/packages/select/src/select.ts +33 -19
  304. package/packages/slider/src/slider.ts +2 -2
  305. package/packages/space/src/space.ts +2 -2
  306. package/packages/splitter/src/splitter-panel.ts +2 -2
  307. package/packages/splitter/src/splitter.ts +2 -2
  308. package/packages/step-item/index.ts +16 -0
  309. package/packages/steps/src/step-info.ts +18 -0
  310. package/packages/steps/src/step-item.ts +41 -0
  311. package/packages/steps/src/steps.ts +273 -13
  312. package/packages/steps/src/util.ts +44 -0
  313. package/packages/switch/src/switch.ts +2 -2
  314. package/packages/table-select/src/table-select.ts +2 -2
  315. package/packages/table-transfer/src/table-transfer.ts +3 -15
  316. package/packages/tabs/src/tab-pane.ts +2 -2
  317. package/packages/tabs/src/tabs.ts +2 -2
  318. package/packages/tag/src/tag.ts +2 -2
  319. package/packages/text/src/text.ts +2 -2
  320. package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
  321. package/packages/textarea/src/textarea.ts +2 -2
  322. package/packages/timeline/src/timeline-info.ts +17 -17
  323. package/packages/timeline/src/timeline.ts +93 -49
  324. package/packages/timeline/src/util.ts +44 -41
  325. package/packages/tip/src/tip.ts +2 -2
  326. package/packages/tooltip/src/tooltip.ts +2 -2
  327. package/packages/tour/src/tour.ts +2 -2
  328. package/packages/transfer/src/transfer.ts +2 -2
  329. package/packages/tree/src/tree.ts +2 -2
  330. package/packages/tree-select/src/tree-select.ts +2 -2
  331. package/packages/ui/index.ts +8 -1
  332. package/packages/upload/src/upload.ts +2 -2
  333. package/packages/watermark/src/watermark.ts +2 -2
  334. package/styles/all.scss +1 -0
  335. package/styles/components/step-item.scss +0 -0
  336. package/styles/components/steps.scss +354 -0
  337. package/styles/theme/base.scss +9 -0
  338. package/types/all.d.ts +3 -0
  339. package/types/components/gantt.d.ts +1 -3
  340. package/types/components/select.d.ts +1 -13
  341. package/types/components/step-item.d.ts +72 -0
  342. package/types/components/steps.d.ts +67 -8
  343. package/types/components/table.d.ts +7 -66
  344. package/types/handles/form-design.d.ts +1 -4
  345. package/types/ui/global-config.d.ts +2 -0
  346. package/types/ui/global-icon.d.ts +7 -0
  347. /package/dist/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  348. /package/dist/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  349. /package/dist/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  350. /package/es/icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  351. /package/es/icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  352. /package/es/icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  353. /package/es/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  354. /package/es/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  355. /package/es/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  356. /package/es/vxe-icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  357. /package/es/vxe-icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  358. /package/es/vxe-icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  359. /package/lib/icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  360. /package/lib/icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  361. /package/lib/icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  362. /package/lib/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  363. /package/lib/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  364. /package/lib/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  365. /package/lib/vxe-icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  366. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  367. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
@@ -42,1185 +42,1188 @@ var import_button = __toESM(require("../../button"));
42
42
  var import_input = __toESM(require("../../input"));
43
43
  var import_number_input = __toESM(require("../../number-input"));
44
44
  const { getIcon, getConfig, getI18n, globalEvents, createEvent, useFns, renderEmptyElement } = import_core.VxeUI;
45
- var color_picker_default = (0, import_comp.defineVxeComponent)({
46
- name: "VxeColorPicker",
47
- props: {
48
- modelValue: String,
49
- placeholder: String,
50
- clearable: {
51
- type: Boolean,
52
- default: () => getConfig().colorPicker.clearable
45
+ var color_picker_default = (
46
+ /* define-vxe-component start */
47
+ (0, import_comp.defineVxeComponent)({
48
+ name: "VxeColorPicker",
49
+ props: {
50
+ modelValue: String,
51
+ placeholder: String,
52
+ clearable: {
53
+ type: Boolean,
54
+ default: () => getConfig().colorPicker.clearable
55
+ },
56
+ type: {
57
+ type: String,
58
+ default: () => getConfig().colorPicker.type
59
+ },
60
+ width: [Number, String],
61
+ size: {
62
+ type: String,
63
+ default: () => getConfig().colorPicker.size || getConfig().size
64
+ },
65
+ className: [String, Function],
66
+ popupClassName: [String, Function],
67
+ colors: {
68
+ type: Array,
69
+ default: () => import_xe_utils.default.clone(getConfig().colorPicker.colors, true) || []
70
+ },
71
+ showAlpha: {
72
+ type: Boolean,
73
+ default: () => getConfig().colorPicker.showAlpha
74
+ },
75
+ showEyeDropper: {
76
+ type: Boolean,
77
+ default: () => getConfig().colorPicker.showEyeDropper
78
+ },
79
+ showColorExtractor: {
80
+ type: Boolean,
81
+ default: () => getConfig().colorPicker.showColorExtractor
82
+ },
83
+ showQuick: {
84
+ type: Boolean,
85
+ default: () => getConfig().colorPicker.showQuick
86
+ },
87
+ readonly: {
88
+ type: Boolean,
89
+ default: null
90
+ },
91
+ disabled: {
92
+ type: Boolean,
93
+ default: null
94
+ },
95
+ clickToCopy: {
96
+ type: Boolean,
97
+ default: () => getConfig().colorPicker.clickToCopy
98
+ },
99
+ defaultColor: {
100
+ type: String,
101
+ default: () => getConfig().colorPicker.defaultColor
102
+ },
103
+ /**
104
+ * 已废弃,请使用 popupConfig.placement
105
+ * @deprecated
106
+ */
107
+ placement: String,
108
+ /**
109
+ * 已废弃,请使用 popupConfig.transfer
110
+ * @deprecated
111
+ */
112
+ transfer: {
113
+ type: Boolean,
114
+ default: null
115
+ },
116
+ popupConfig: Object
53
117
  },
54
- type: {
55
- type: String,
56
- default: () => getConfig().colorPicker.type
57
- },
58
- width: [Number, String],
59
- size: {
60
- type: String,
61
- default: () => getConfig().colorPicker.size || getConfig().size
62
- },
63
- className: [String, Function],
64
- popupClassName: [String, Function],
65
- colors: {
66
- type: Array,
67
- default: () => import_xe_utils.default.clone(getConfig().colorPicker.colors, true) || []
68
- },
69
- showAlpha: {
70
- type: Boolean,
71
- default: () => getConfig().colorPicker.showAlpha
72
- },
73
- showEyeDropper: {
74
- type: Boolean,
75
- default: () => getConfig().colorPicker.showEyeDropper
76
- },
77
- showColorExtractor: {
78
- type: Boolean,
79
- default: () => getConfig().colorPicker.showColorExtractor
80
- },
81
- showQuick: {
82
- type: Boolean,
83
- default: () => getConfig().colorPicker.showQuick
84
- },
85
- readonly: {
86
- type: Boolean,
87
- default: null
88
- },
89
- disabled: {
90
- type: Boolean,
91
- default: null
92
- },
93
- clickToCopy: {
94
- type: Boolean,
95
- default: () => getConfig().colorPicker.clickToCopy
96
- },
97
- defaultColor: {
98
- type: String,
99
- default: () => getConfig().colorPicker.defaultColor
100
- },
101
- /**
102
- * 已废弃,请使用 popupConfig.placement
103
- * @deprecated
104
- */
105
- placement: String,
106
- /**
107
- * 已废弃,请使用 popupConfig.transfer
108
- * @deprecated
109
- */
110
- transfer: {
111
- type: Boolean,
112
- default: null
113
- },
114
- popupConfig: Object
115
- },
116
- emits: ["update:modelValue", "change", "clear", "click"],
117
- setup(props, context) {
118
- const { emit } = context;
119
- const $xeModal = (0, import_vue.inject)("$xeModal", null);
120
- const $xeDrawer = (0, import_vue.inject)("$xeDrawer", null);
121
- const $xeTable = (0, import_vue.inject)("$xeTable", null);
122
- const $xeCard = (0, import_vue.inject)("$xeCard", null);
123
- const $xeForm = (0, import_vue.inject)("$xeForm", null);
124
- const formItemInfo = (0, import_vue.inject)("xeFormItemInfo", null);
125
- const WinEyeDropper = typeof window !== "undefined" ? window.EyeDropper : null;
126
- const xID = import_xe_utils.default.uniqueId();
127
- const { computeSize } = useFns.useSize(props);
128
- const refElem = (0, import_vue.ref)();
129
- const refInputTarget = (0, import_vue.ref)();
130
- const refOptionPanel = (0, import_vue.ref)();
131
- const refHueSliderElem = (0, import_vue.ref)();
132
- const refHueSliderBtnElem = (0, import_vue.ref)();
133
- const refAlphaSliderElem = (0, import_vue.ref)();
134
- const refAlphaSliderBtnElem = (0, import_vue.ref)();
135
- const refColorPanelElem = (0, import_vue.ref)();
136
- const refColorActiveElem = (0, import_vue.ref)();
137
- const reactData = (0, import_vue.reactive)({
138
- initialized: false,
139
- selectTyle: "hex",
140
- selectColor: `${props.modelValue || ""}`,
141
- showTypePopup: false,
142
- panelColor: "",
143
- hexValue: "",
144
- rValue: 0,
145
- gValue: 0,
146
- bValue: 0,
147
- aValue: 0,
148
- panelIndex: 0,
149
- panelStyle: {},
150
- panelPlacement: null,
151
- visiblePanel: false,
152
- isAniVisible: false,
153
- isActivated: false
154
- });
155
- const typeList = [
156
- { label: "HEX", value: "hex" },
157
- { label: "RGB", value: "rgb" }
158
- ];
159
- const internalData = {
160
- // hpTimeout: undefined
161
- };
162
- const computeFormReadonly = (0, import_vue.computed)(() => {
163
- const { readonly } = props;
164
- if (readonly === null) {
165
- if ($xeForm) {
166
- return $xeForm.props.readonly;
167
- }
168
- return false;
169
- }
170
- return readonly;
171
- });
172
- const computeIsDisabled = (0, import_vue.computed)(() => {
173
- const { disabled } = props;
174
- if (disabled === null) {
175
- if ($xeForm) {
176
- return $xeForm.props.disabled;
118
+ emits: ["update:modelValue", "change", "clear", "click"],
119
+ setup(props, context) {
120
+ const { emit } = context;
121
+ const $xeModal = (0, import_vue.inject)("$xeModal", null);
122
+ const $xeDrawer = (0, import_vue.inject)("$xeDrawer", null);
123
+ const $xeTable = (0, import_vue.inject)("$xeTable", null);
124
+ const $xeCard = (0, import_vue.inject)("$xeCard", null);
125
+ const $xeForm = (0, import_vue.inject)("$xeForm", null);
126
+ const formItemInfo = (0, import_vue.inject)("xeFormItemInfo", null);
127
+ const WinEyeDropper = typeof window !== "undefined" ? window.EyeDropper : null;
128
+ const xID = import_xe_utils.default.uniqueId();
129
+ const { computeSize } = useFns.useSize(props);
130
+ const refElem = (0, import_vue.ref)();
131
+ const refInputTarget = (0, import_vue.ref)();
132
+ const refOptionPanel = (0, import_vue.ref)();
133
+ const refHueSliderElem = (0, import_vue.ref)();
134
+ const refHueSliderBtnElem = (0, import_vue.ref)();
135
+ const refAlphaSliderElem = (0, import_vue.ref)();
136
+ const refAlphaSliderBtnElem = (0, import_vue.ref)();
137
+ const refColorPanelElem = (0, import_vue.ref)();
138
+ const refColorActiveElem = (0, import_vue.ref)();
139
+ const reactData = (0, import_vue.reactive)({
140
+ initialized: false,
141
+ selectTyle: "hex",
142
+ selectColor: `${props.modelValue || ""}`,
143
+ showTypePopup: false,
144
+ panelColor: "",
145
+ hexValue: "",
146
+ rValue: 0,
147
+ gValue: 0,
148
+ bValue: 0,
149
+ aValue: 0,
150
+ panelIndex: 0,
151
+ panelStyle: {},
152
+ panelPlacement: null,
153
+ visiblePanel: false,
154
+ isAniVisible: false,
155
+ isActivated: false
156
+ });
157
+ const typeList = [
158
+ { label: "HEX", value: "hex" },
159
+ { label: "RGB", value: "rgb" }
160
+ ];
161
+ const internalData = {
162
+ // hpTimeout: undefined
163
+ };
164
+ const computeFormReadonly = (0, import_vue.computed)(() => {
165
+ const { readonly } = props;
166
+ if (readonly === null) {
167
+ if ($xeForm) {
168
+ return $xeForm.props.readonly;
169
+ }
170
+ return false;
177
171
  }
178
- return false;
179
- }
180
- return disabled;
181
- });
182
- const computeBtnTransfer = (0, import_vue.computed)(() => {
183
- const { transfer } = props;
184
- if (transfer === null) {
185
- const globalTransfer = getConfig().colorPicker.transfer;
186
- if (import_xe_utils.default.isBoolean(globalTransfer)) {
187
- return globalTransfer;
172
+ return readonly;
173
+ });
174
+ const computeIsDisabled = (0, import_vue.computed)(() => {
175
+ const { disabled } = props;
176
+ if (disabled === null) {
177
+ if ($xeForm) {
178
+ return $xeForm.props.disabled;
179
+ }
180
+ return false;
188
181
  }
189
- if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
190
- return true;
182
+ return disabled;
183
+ });
184
+ const computeBtnTransfer = (0, import_vue.computed)(() => {
185
+ const { transfer } = props;
186
+ if (transfer === null) {
187
+ const globalTransfer = getConfig().colorPicker.transfer;
188
+ if (import_xe_utils.default.isBoolean(globalTransfer)) {
189
+ return globalTransfer;
190
+ }
191
+ if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
192
+ return true;
193
+ }
191
194
  }
192
- }
193
- return transfer;
194
- });
195
- const computeColorList = (0, import_vue.computed)(() => {
196
- const { colors } = props;
197
- if (colors) {
198
- return colors.map((item) => {
199
- if (import_xe_utils.default.isString(item)) {
195
+ return transfer;
196
+ });
197
+ const computeColorList = (0, import_vue.computed)(() => {
198
+ const { colors } = props;
199
+ if (colors) {
200
+ return colors.map((item) => {
201
+ if (import_xe_utils.default.isString(item)) {
202
+ return {
203
+ label: item,
204
+ value: item
205
+ };
206
+ }
200
207
  return {
201
- label: item,
202
- value: item
208
+ label: import_xe_utils.default.eqNull(item.label) ? item.value : item.label,
209
+ value: item.value
203
210
  };
204
- }
205
- return {
206
- label: import_xe_utils.default.eqNull(item.label) ? item.value : item.label,
207
- value: item.value
208
- };
209
- });
210
- }
211
- return [];
212
- });
213
- const computeCurrStyle = (0, import_vue.computed)(() => {
214
- const { width } = props;
215
- const stys = {};
216
- if (width) {
217
- stys.width = (0, import_dom.toCssUnit)(width);
218
- }
219
- return stys;
220
- });
221
- const computePopupOpts = (0, import_vue.computed)(() => {
222
- return Object.assign({}, getConfig().colorPicker.popupConfig, props.popupConfig);
223
- });
224
- const computeIsRgb = (0, import_vue.computed)(() => {
225
- const { selectTyle } = reactData;
226
- return selectTyle === "rgb";
227
- });
228
- const computeSelectTypeItem = (0, import_vue.computed)(() => {
229
- const { selectTyle } = reactData;
230
- return typeList.find((item) => item.value === selectTyle);
231
- });
232
- const refMaps = {
233
- refElem
234
- };
235
- const computeMaps = {};
236
- const $xeColorPicker = {
237
- xID,
238
- props,
239
- context,
240
- reactData,
241
- getRefMaps: () => refMaps,
242
- getComputeMaps: () => computeMaps
243
- };
244
- const emitModel = (value) => {
245
- emit("update:modelValue", value);
246
- };
247
- const updateMode = () => {
248
- const { modelValue } = props;
249
- reactData.selectColor = import_xe_utils.default.toValueString(modelValue);
250
- updateModelColor();
251
- };
252
- const updateType = () => {
253
- const { type } = props;
254
- let selectTyle = "hex";
255
- if (type === "rgb" || type === "rgba") {
256
- selectTyle = "rgb";
257
- }
258
- reactData.selectTyle = selectTyle;
259
- updateMode();
260
- };
261
- const updateModelColor = () => {
262
- const { defaultColor } = props;
263
- const { selectColor, isAniVisible } = reactData;
264
- const isRgb = computeIsRgb.value;
265
- const hueSliderEl = refHueSliderElem.value;
266
- const alphaSliderEl = refAlphaSliderElem.value;
267
- const colorRest = (0, import_util.parseValColor)(selectColor || defaultColor);
268
- reactData.hexValue = "";
269
- reactData.rValue = 0;
270
- reactData.gValue = 0;
271
- reactData.bValue = 0;
272
- reactData.aValue = 1;
273
- if (colorRest) {
274
- if (colorRest.type === "hex") {
275
- reactData.hexValue = colorRest.hex;
276
- } else {
277
- reactData.rValue = colorRest.r;
278
- reactData.gValue = colorRest.g;
279
- reactData.bValue = colorRest.b;
280
- reactData.aValue = colorRest.a;
211
+ });
281
212
  }
282
- if (colorRest.value) {
283
- if (isRgb) {
284
- if (colorRest.type === "hex") {
285
- const rgbRest = (0, import_util.hexToRgb)(colorRest.hex);
286
- if (rgbRest) {
287
- reactData.rValue = rgbRest.r;
288
- reactData.gValue = rgbRest.g;
289
- reactData.bValue = rgbRest.b;
290
- reactData.aValue = rgbRest.a;
291
- }
292
- }
213
+ return [];
214
+ });
215
+ const computeCurrStyle = (0, import_vue.computed)(() => {
216
+ const { width } = props;
217
+ const stys = {};
218
+ if (width) {
219
+ stys.width = (0, import_dom.toCssUnit)(width);
220
+ }
221
+ return stys;
222
+ });
223
+ const computePopupOpts = (0, import_vue.computed)(() => {
224
+ return Object.assign({}, getConfig().colorPicker.popupConfig, props.popupConfig);
225
+ });
226
+ const computeIsRgb = (0, import_vue.computed)(() => {
227
+ const { selectTyle } = reactData;
228
+ return selectTyle === "rgb";
229
+ });
230
+ const computeSelectTypeItem = (0, import_vue.computed)(() => {
231
+ const { selectTyle } = reactData;
232
+ return typeList.find((item) => item.value === selectTyle);
233
+ });
234
+ const refMaps = {
235
+ refElem
236
+ };
237
+ const computeMaps = {};
238
+ const $xeColorPicker = {
239
+ xID,
240
+ props,
241
+ context,
242
+ reactData,
243
+ getRefMaps: () => refMaps,
244
+ getComputeMaps: () => computeMaps
245
+ };
246
+ const emitModel = (value) => {
247
+ emit("update:modelValue", value);
248
+ };
249
+ const updateMode = () => {
250
+ const { modelValue } = props;
251
+ reactData.selectColor = import_xe_utils.default.toValueString(modelValue);
252
+ updateModelColor();
253
+ };
254
+ const updateType = () => {
255
+ const { type } = props;
256
+ let selectTyle = "hex";
257
+ if (type === "rgb" || type === "rgba") {
258
+ selectTyle = "rgb";
259
+ }
260
+ reactData.selectTyle = selectTyle;
261
+ updateMode();
262
+ };
263
+ const updateModelColor = () => {
264
+ const { defaultColor } = props;
265
+ const { selectColor, isAniVisible } = reactData;
266
+ const isRgb = computeIsRgb.value;
267
+ const hueSliderEl = refHueSliderElem.value;
268
+ const alphaSliderEl = refAlphaSliderElem.value;
269
+ const colorRest = (0, import_util.parseValColor)(selectColor || defaultColor);
270
+ reactData.hexValue = "";
271
+ reactData.rValue = 0;
272
+ reactData.gValue = 0;
273
+ reactData.bValue = 0;
274
+ reactData.aValue = 1;
275
+ if (colorRest) {
276
+ if (colorRest.type === "hex") {
277
+ reactData.hexValue = colorRest.hex;
293
278
  } else {
294
- if (colorRest.type !== "hex") {
295
- reactData.hexValue = (0, import_util.rgbToHexVal)(colorRest.r, colorRest.g, colorRest.b, colorRest.a);
279
+ reactData.rValue = colorRest.r;
280
+ reactData.gValue = colorRest.g;
281
+ reactData.bValue = colorRest.b;
282
+ reactData.aValue = colorRest.a;
283
+ }
284
+ if (colorRest.value) {
285
+ if (isRgb) {
286
+ if (colorRest.type === "hex") {
287
+ const rgbRest = (0, import_util.hexToRgb)(colorRest.hex);
288
+ if (rgbRest) {
289
+ reactData.rValue = rgbRest.r;
290
+ reactData.gValue = rgbRest.g;
291
+ reactData.bValue = rgbRest.b;
292
+ reactData.aValue = rgbRest.a;
293
+ }
294
+ }
295
+ } else {
296
+ if (colorRest.type !== "hex") {
297
+ reactData.hexValue = (0, import_util.rgbToHexVal)(colorRest.r, colorRest.g, colorRest.b, colorRest.a);
298
+ }
296
299
  }
297
300
  }
298
301
  }
299
- }
300
- if (isAniVisible) {
301
- const hsvRest = colorRest ? colorRest.type === "hex" ? (0, import_util.hexToHsv)(colorRest.hex) : (0, import_util.rgbToHsv)(colorRest) : null;
302
- const colorPanelEl = refColorPanelElem.value;
303
- if (hsvRest) {
304
- if (colorPanelEl) {
305
- const offsetTop = colorPanelEl.clientHeight * (1 - hsvRest.v);
306
- const offsetLeft = colorPanelEl.clientWidth * hsvRest.s;
307
- handlePanelColor(offsetLeft, offsetTop);
302
+ if (isAniVisible) {
303
+ const hsvRest = colorRest ? colorRest.type === "hex" ? (0, import_util.hexToHsv)(colorRest.hex) : (0, import_util.rgbToHsv)(colorRest) : null;
304
+ const colorPanelEl = refColorPanelElem.value;
305
+ if (hsvRest) {
306
+ if (colorPanelEl) {
307
+ const offsetTop = colorPanelEl.clientHeight * (1 - hsvRest.v);
308
+ const offsetLeft = colorPanelEl.clientWidth * hsvRest.s;
309
+ handlePanelColor(offsetLeft, offsetTop);
310
+ }
311
+ if (hueSliderEl) {
312
+ handleHueColor(import_xe_utils.default.ceil((1 - hsvRest.h / 360) * hueSliderEl.clientWidth) - 1);
313
+ }
308
314
  }
309
- if (hueSliderEl) {
310
- handleHueColor(import_xe_utils.default.ceil((1 - hsvRest.h / 360) * hueSliderEl.clientWidth) - 1);
315
+ if (alphaSliderEl) {
316
+ handleAlphaColor(alphaSliderEl.clientWidth * reactData.aValue);
311
317
  }
312
318
  }
313
- if (alphaSliderEl) {
314
- handleAlphaColor(alphaSliderEl.clientWidth * reactData.aValue);
319
+ };
320
+ const updateZindex = () => {
321
+ if (reactData.panelIndex < (0, import_utils.getLastZIndex)()) {
322
+ reactData.panelIndex = (0, import_utils.nextZIndex)();
315
323
  }
316
- }
317
- };
318
- const updateZindex = () => {
319
- if (reactData.panelIndex < (0, import_utils.getLastZIndex)()) {
320
- reactData.panelIndex = (0, import_utils.nextZIndex)();
321
- }
322
- };
323
- const updatePlacement = () => {
324
- const { placement } = props;
325
- const { panelIndex } = reactData;
326
- const targetElem = refElem.value;
327
- const panelElem = refOptionPanel.value;
328
- const btnTransfer = computeBtnTransfer.value;
329
- const popupOpts = computePopupOpts.value;
330
- const handleStyle = () => {
331
- const ppObj = (0, import_dom.updatePanelPlacement)(targetElem, panelElem, {
332
- placement: popupOpts.placement || placement,
333
- defaultPlacement: popupOpts.defaultPlacement,
334
- appendTo: popupOpts.appendTo,
335
- teleportTo: btnTransfer
336
- });
337
- const panelStyle = Object.assign(ppObj.style, {
338
- zIndex: panelIndex
339
- });
340
- reactData.panelStyle = panelStyle;
341
- reactData.panelPlacement = ppObj.placement;
342
324
  };
343
- handleStyle();
344
- return (0, import_vue.nextTick)().then(handleStyle);
345
- };
346
- const showOptionPanel = () => {
347
- const { hpTimeout } = internalData;
348
- const isDisabled = computeIsDisabled.value;
349
- if (!isDisabled) {
350
- if (hpTimeout) {
351
- clearTimeout(hpTimeout);
352
- internalData.hpTimeout = void 0;
325
+ const updatePlacement = () => {
326
+ const { placement } = props;
327
+ const { panelIndex } = reactData;
328
+ const targetElem = refElem.value;
329
+ const panelElem = refOptionPanel.value;
330
+ const btnTransfer = computeBtnTransfer.value;
331
+ const popupOpts = computePopupOpts.value;
332
+ const handleStyle = () => {
333
+ const ppObj = (0, import_dom.updatePanelPlacement)(targetElem, panelElem, {
334
+ placement: popupOpts.placement || placement,
335
+ defaultPlacement: popupOpts.defaultPlacement,
336
+ appendTo: popupOpts.appendTo,
337
+ teleportTo: btnTransfer
338
+ });
339
+ const panelStyle = Object.assign(ppObj.style, {
340
+ zIndex: panelIndex
341
+ });
342
+ reactData.panelStyle = panelStyle;
343
+ reactData.panelPlacement = ppObj.placement;
344
+ };
345
+ handleStyle();
346
+ return (0, import_vue.nextTick)().then(handleStyle);
347
+ };
348
+ const showOptionPanel = () => {
349
+ const { hpTimeout } = internalData;
350
+ const isDisabled = computeIsDisabled.value;
351
+ if (!isDisabled) {
352
+ if (hpTimeout) {
353
+ clearTimeout(hpTimeout);
354
+ internalData.hpTimeout = void 0;
355
+ }
356
+ if (!reactData.initialized) {
357
+ reactData.initialized = true;
358
+ }
359
+ reactData.isActivated = true;
360
+ reactData.isAniVisible = true;
361
+ setTimeout(() => {
362
+ updateModelColor();
363
+ reactData.visiblePanel = true;
364
+ }, 10);
365
+ updateZindex();
366
+ updatePlacement();
353
367
  }
354
- if (!reactData.initialized) {
355
- reactData.initialized = true;
368
+ };
369
+ const hideOptionPanel = () => {
370
+ reactData.visiblePanel = false;
371
+ internalData.hpTimeout = setTimeout(() => {
372
+ reactData.isAniVisible = false;
373
+ }, 350);
374
+ };
375
+ const changeEvent = (evnt, value) => {
376
+ reactData.selectColor = value;
377
+ if (value !== props.modelValue) {
378
+ emitModel(value);
379
+ dispatchEvent("change", { value }, evnt);
380
+ if ($xeForm && formItemInfo) {
381
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
382
+ }
356
383
  }
357
- reactData.isActivated = true;
358
- reactData.isAniVisible = true;
359
- setTimeout(() => {
360
- updateModelColor();
361
- reactData.visiblePanel = true;
362
- }, 10);
363
- updateZindex();
364
- updatePlacement();
365
- }
366
- };
367
- const hideOptionPanel = () => {
368
- reactData.visiblePanel = false;
369
- internalData.hpTimeout = setTimeout(() => {
370
- reactData.isAniVisible = false;
371
- }, 350);
372
- };
373
- const changeEvent = (evnt, value) => {
374
- reactData.selectColor = value;
375
- if (value !== props.modelValue) {
376
- emitModel(value);
377
- dispatchEvent("change", { value }, evnt);
378
- if ($xeForm && formItemInfo) {
379
- $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
384
+ };
385
+ const clearValueEvent = (evnt, selectValue) => {
386
+ changeEvent(evnt, selectValue);
387
+ dispatchEvent("clear", { value: selectValue }, evnt);
388
+ };
389
+ const focusEvent = () => {
390
+ const isDisabled = computeIsDisabled.value;
391
+ if (!isDisabled) {
392
+ if (!reactData.visiblePanel) {
393
+ showOptionPanel();
394
+ }
380
395
  }
381
- }
382
- };
383
- const clearValueEvent = (evnt, selectValue) => {
384
- changeEvent(evnt, selectValue);
385
- dispatchEvent("clear", { value: selectValue }, evnt);
386
- };
387
- const focusEvent = () => {
388
- const isDisabled = computeIsDisabled.value;
389
- if (!isDisabled) {
390
- if (!reactData.visiblePanel) {
396
+ };
397
+ const blurEvent = () => {
398
+ reactData.isActivated = false;
399
+ };
400
+ const clearEvent = (evnt) => {
401
+ clearValueEvent(evnt, null);
402
+ hideOptionPanel();
403
+ };
404
+ const confirmEvent = (evnt) => {
405
+ const { selectTyle, selectColor, hexValue } = reactData;
406
+ const value = selectTyle === "hex" ? hexValue : selectColor;
407
+ changeEvent(evnt, value);
408
+ hideOptionPanel();
409
+ };
410
+ const togglePanelEvent = (evnt) => {
411
+ evnt.preventDefault();
412
+ if (reactData.visiblePanel) {
413
+ hideOptionPanel();
414
+ } else {
391
415
  showOptionPanel();
392
416
  }
393
- }
394
- };
395
- const blurEvent = () => {
396
- reactData.isActivated = false;
397
- };
398
- const clearEvent = (evnt) => {
399
- clearValueEvent(evnt, null);
400
- hideOptionPanel();
401
- };
402
- const confirmEvent = (evnt) => {
403
- const { selectTyle, selectColor, hexValue } = reactData;
404
- const value = selectTyle === "hex" ? hexValue : selectColor;
405
- changeEvent(evnt, value);
406
- hideOptionPanel();
407
- };
408
- const togglePanelEvent = (evnt) => {
409
- evnt.preventDefault();
410
- if (reactData.visiblePanel) {
411
- hideOptionPanel();
412
- } else {
413
- showOptionPanel();
414
- }
415
- };
416
- const clickEvent = (evnt) => {
417
- togglePanelEvent(evnt);
418
- dispatchEvent("click", {}, evnt);
419
- };
420
- const handlePanelClickEvent = () => {
421
- reactData.showTypePopup = false;
422
- };
423
- const toggleTypeVisibleEvent = (evnt) => {
424
- evnt.stopPropagation();
425
- reactData.showTypePopup = !reactData.showTypePopup;
426
- };
427
- const handleChangeType = (type) => {
428
- const { selectTyle } = reactData;
429
- if (type !== selectTyle) {
430
- reactData.selectTyle = type;
431
- updateModelColor();
432
- }
433
- reactData.showTypePopup = false;
434
- };
435
- const handleHueColor = (offsetLeft) => {
436
- const hueSliderEl = refHueSliderElem.value;
437
- const hueSliderBtnEl = refHueSliderBtnElem.value;
438
- if (hueSliderEl && hueSliderBtnEl) {
439
- if (offsetLeft < 0) {
440
- offsetLeft = 0;
417
+ };
418
+ const clickEvent = (evnt) => {
419
+ togglePanelEvent(evnt);
420
+ dispatchEvent("click", {}, evnt);
421
+ };
422
+ const handlePanelClickEvent = () => {
423
+ reactData.showTypePopup = false;
424
+ };
425
+ const toggleTypeVisibleEvent = (evnt) => {
426
+ evnt.stopPropagation();
427
+ reactData.showTypePopup = !reactData.showTypePopup;
428
+ };
429
+ const handleChangeType = (type) => {
430
+ const { selectTyle } = reactData;
431
+ if (type !== selectTyle) {
432
+ reactData.selectTyle = type;
433
+ updateModelColor();
434
+ }
435
+ reactData.showTypePopup = false;
436
+ };
437
+ const handleHueColor = (offsetLeft) => {
438
+ const hueSliderEl = refHueSliderElem.value;
439
+ const hueSliderBtnEl = refHueSliderBtnElem.value;
440
+ if (hueSliderEl && hueSliderBtnEl) {
441
+ if (offsetLeft < 0) {
442
+ offsetLeft = 0;
443
+ }
444
+ const barWidth = import_xe_utils.default.toInteger(hueSliderEl.clientWidth);
445
+ const itemNum = 255;
446
+ const countNum = itemNum * 6;
447
+ const offsetX = import_xe_utils.default.ceil(countNum / barWidth * offsetLeft);
448
+ const offsetNum = offsetX % itemNum;
449
+ let rNum = 0;
450
+ let gNum = 0;
451
+ let bNum = 0;
452
+ switch (Math.ceil(offsetX / itemNum)) {
453
+ case 1:
454
+ rNum = itemNum;
455
+ bNum = offsetNum;
456
+ break;
457
+ case 2:
458
+ rNum = itemNum - offsetNum;
459
+ bNum = itemNum;
460
+ break;
461
+ case 3:
462
+ gNum = offsetNum;
463
+ bNum = itemNum;
464
+ break;
465
+ case 4:
466
+ gNum = itemNum;
467
+ bNum = itemNum - offsetNum;
468
+ break;
469
+ case 5:
470
+ rNum = offsetNum;
471
+ gNum = itemNum;
472
+ break;
473
+ case 6:
474
+ rNum = itemNum;
475
+ gNum = itemNum - offsetNum;
476
+ break;
477
+ }
478
+ reactData.panelColor = (0, import_util.toValRgb)(rNum, gNum, bNum);
479
+ hueSliderBtnEl.style.left = (0, import_dom.toCssUnit)(offsetLeft);
441
480
  }
442
- const barWidth = import_xe_utils.default.toInteger(hueSliderEl.clientWidth);
443
- const itemNum = 255;
444
- const countNum = itemNum * 6;
445
- const offsetX = import_xe_utils.default.ceil(countNum / barWidth * offsetLeft);
446
- const offsetNum = offsetX % itemNum;
447
- let rNum = 0;
448
- let gNum = 0;
449
- let bNum = 0;
450
- switch (Math.ceil(offsetX / itemNum)) {
451
- case 1:
452
- rNum = itemNum;
453
- bNum = offsetNum;
454
- break;
455
- case 2:
456
- rNum = itemNum - offsetNum;
457
- bNum = itemNum;
458
- break;
459
- case 3:
460
- gNum = offsetNum;
461
- bNum = itemNum;
462
- break;
463
- case 4:
464
- gNum = itemNum;
465
- bNum = itemNum - offsetNum;
466
- break;
467
- case 5:
468
- rNum = offsetNum;
469
- gNum = itemNum;
470
- break;
471
- case 6:
472
- rNum = itemNum;
473
- gNum = itemNum - offsetNum;
474
- break;
481
+ };
482
+ const handleHueBarEvent = (evnt) => {
483
+ const hueSliderEl = refHueSliderElem.value;
484
+ const hueSliderBtnEl = refHueSliderBtnElem.value;
485
+ if (hueSliderEl && hueSliderBtnEl) {
486
+ const hueSliderRect = hueSliderEl.getBoundingClientRect();
487
+ const barWidth = import_xe_utils.default.toInteger(hueSliderEl.clientWidth);
488
+ const offsetLeft = import_xe_utils.default.ceil(Math.min(barWidth - 1, Math.max(1, evnt.clientX - hueSliderRect.x)));
489
+ handleHueColor(offsetLeft);
475
490
  }
476
- reactData.panelColor = (0, import_util.toValRgb)(rNum, gNum, bNum);
477
- hueSliderBtnEl.style.left = (0, import_dom.toCssUnit)(offsetLeft);
478
- }
479
- };
480
- const handleHueBarEvent = (evnt) => {
481
- const hueSliderEl = refHueSliderElem.value;
482
- const hueSliderBtnEl = refHueSliderBtnElem.value;
483
- if (hueSliderEl && hueSliderBtnEl) {
484
- const hueSliderRect = hueSliderEl.getBoundingClientRect();
485
- const barWidth = import_xe_utils.default.toInteger(hueSliderEl.clientWidth);
486
- const offsetLeft = import_xe_utils.default.ceil(Math.min(barWidth - 1, Math.max(1, evnt.clientX - hueSliderRect.x)));
487
- handleHueColor(offsetLeft);
488
- }
489
- };
490
- const handleHueSliderMousedownEvent = (evnt) => {
491
- evnt.preventDefault();
492
- document.onmousemove = (evnt2) => {
493
- evnt2.preventDefault();
494
- handleHueBarEvent(evnt2);
495
491
  };
496
- document.onmouseup = (evnt2) => {
497
- document.onmousemove = null;
498
- document.onmouseup = null;
499
- handleHueBarEvent(evnt2);
492
+ const handleHueSliderMousedownEvent = (evnt) => {
493
+ evnt.preventDefault();
494
+ document.onmousemove = (evnt2) => {
495
+ evnt2.preventDefault();
496
+ handleHueBarEvent(evnt2);
497
+ };
498
+ document.onmouseup = (evnt2) => {
499
+ document.onmousemove = null;
500
+ document.onmouseup = null;
501
+ handleHueBarEvent(evnt2);
502
+ };
500
503
  };
501
- };
502
- const handleAlphaColor = (offsetLeft) => {
503
- const { selectColor } = reactData;
504
- const alphaSliderEl = refAlphaSliderElem.value;
505
- const alphaSliderBtnEl = refAlphaSliderBtnElem.value;
506
- if (alphaSliderEl && alphaSliderBtnEl) {
507
- const alphaSliderRect = alphaSliderEl.getBoundingClientRect();
508
- const barWidth = alphaSliderRect.width;
509
- if (offsetLeft < 0) {
510
- offsetLeft = 0;
504
+ const handleAlphaColor = (offsetLeft) => {
505
+ const { selectColor } = reactData;
506
+ const alphaSliderEl = refAlphaSliderElem.value;
507
+ const alphaSliderBtnEl = refAlphaSliderBtnElem.value;
508
+ if (alphaSliderEl && alphaSliderBtnEl) {
509
+ const alphaSliderRect = alphaSliderEl.getBoundingClientRect();
510
+ const barWidth = alphaSliderRect.width;
511
+ if (offsetLeft < 0) {
512
+ offsetLeft = 0;
513
+ }
514
+ if (offsetLeft > barWidth) {
515
+ offsetLeft = barWidth;
516
+ }
517
+ const alpha = import_xe_utils.default.ceil(100 / barWidth * offsetLeft / 100, 2);
518
+ reactData.aValue = alpha;
519
+ alphaSliderBtnEl.style.left = (0, import_dom.toCssUnit)(offsetLeft);
520
+ reactData.selectColor = selectColor ? (0, import_util.updateColorAlpha)(selectColor, alpha) : "";
511
521
  }
512
- if (offsetLeft > barWidth) {
513
- offsetLeft = barWidth;
522
+ };
523
+ const handleAlphaBarEvent = (evnt) => {
524
+ const alphaSliderEl = refAlphaSliderElem.value;
525
+ const alphaSliderBtnEl = refAlphaSliderBtnElem.value;
526
+ if (alphaSliderEl && alphaSliderBtnEl) {
527
+ const alphaSliderRect = alphaSliderEl.getBoundingClientRect();
528
+ const barWidth = alphaSliderRect.width;
529
+ const offsetLeft = Math.min(barWidth, Math.max(0, evnt.clientX - alphaSliderRect.x));
530
+ handleAlphaColor(offsetLeft);
531
+ updateModelColor();
514
532
  }
515
- const alpha = import_xe_utils.default.ceil(100 / barWidth * offsetLeft / 100, 2);
516
- reactData.aValue = alpha;
517
- alphaSliderBtnEl.style.left = (0, import_dom.toCssUnit)(offsetLeft);
518
- reactData.selectColor = selectColor ? (0, import_util.updateColorAlpha)(selectColor, alpha) : "";
519
- }
520
- };
521
- const handleAlphaBarEvent = (evnt) => {
522
- const alphaSliderEl = refAlphaSliderElem.value;
523
- const alphaSliderBtnEl = refAlphaSliderBtnElem.value;
524
- if (alphaSliderEl && alphaSliderBtnEl) {
525
- const alphaSliderRect = alphaSliderEl.getBoundingClientRect();
526
- const barWidth = alphaSliderRect.width;
527
- const offsetLeft = Math.min(barWidth, Math.max(0, evnt.clientX - alphaSliderRect.x));
528
- handleAlphaColor(offsetLeft);
533
+ };
534
+ const handleAlphaSliderMousedownEvent = (evnt) => {
535
+ evnt.preventDefault();
536
+ document.onmousemove = (evnt2) => {
537
+ evnt2.preventDefault();
538
+ handleAlphaBarEvent(evnt2);
539
+ };
540
+ document.onmouseup = (evnt2) => {
541
+ document.onmousemove = null;
542
+ document.onmouseup = null;
543
+ handleAlphaBarEvent(evnt2);
544
+ };
545
+ };
546
+ const handleInputRgbEvent = () => {
547
+ const { rValue, gValue, bValue, aValue } = reactData;
548
+ reactData.selectColor = (0, import_util.toValRgb)(rValue, gValue, bValue, aValue);
529
549
  updateModelColor();
530
- }
531
- };
532
- const handleAlphaSliderMousedownEvent = (evnt) => {
533
- evnt.preventDefault();
534
- document.onmousemove = (evnt2) => {
535
- evnt2.preventDefault();
536
- handleAlphaBarEvent(evnt2);
537
550
  };
538
- document.onmouseup = (evnt2) => {
539
- document.onmousemove = null;
540
- document.onmouseup = null;
541
- handleAlphaBarEvent(evnt2);
551
+ const handleInputAlphaEvent = () => {
552
+ const { aValue } = reactData;
553
+ const alphaSliderEl = refAlphaSliderElem.value;
554
+ const alphaSliderBtnEl = refAlphaSliderBtnElem.value;
555
+ if (alphaSliderEl && alphaSliderBtnEl) {
556
+ const alphaSliderRect = alphaSliderEl.getBoundingClientRect();
557
+ const barWidth = alphaSliderRect.width;
558
+ const offsetLeft = barWidth * aValue;
559
+ handleAlphaColor(offsetLeft);
560
+ }
561
+ };
562
+ const handleQuickEvent = (evnt, item) => {
563
+ const value = item.value;
564
+ reactData.selectColor = value;
565
+ updateModelColor();
566
+ };
567
+ const handlePanelColor = (offsetLeft, offsetTop) => {
568
+ const colorActiveEl = refColorActiveElem.value;
569
+ if (colorActiveEl) {
570
+ colorActiveEl.style.top = (0, import_dom.toCssUnit)(offsetTop);
571
+ colorActiveEl.style.left = (0, import_dom.toCssUnit)(offsetLeft);
572
+ }
573
+ };
574
+ const handleEyeDropperEvent = () => {
575
+ if (WinEyeDropper) {
576
+ try {
577
+ const eyeDropper = new WinEyeDropper();
578
+ eyeDropper.open().then((rest) => {
579
+ if (rest && rest.sRGBHex) {
580
+ reactData.selectColor = rest.sRGBHex;
581
+ updateModelColor();
582
+ }
583
+ }).catch(() => {
584
+ });
585
+ } catch (e) {
586
+ }
587
+ }
542
588
  };
543
- };
544
- const handleInputRgbEvent = () => {
545
- const { rValue, gValue, bValue, aValue } = reactData;
546
- reactData.selectColor = (0, import_util.toValRgb)(rValue, gValue, bValue, aValue);
547
- updateModelColor();
548
- };
549
- const handleInputAlphaEvent = () => {
550
- const { aValue } = reactData;
551
- const alphaSliderEl = refAlphaSliderElem.value;
552
- const alphaSliderBtnEl = refAlphaSliderBtnElem.value;
553
- if (alphaSliderEl && alphaSliderBtnEl) {
554
- const alphaSliderRect = alphaSliderEl.getBoundingClientRect();
555
- const barWidth = alphaSliderRect.width;
556
- const offsetLeft = barWidth * aValue;
557
- handleAlphaColor(offsetLeft);
558
- }
559
- };
560
- const handleQuickEvent = (evnt, item) => {
561
- const value = item.value;
562
- reactData.selectColor = value;
563
- updateModelColor();
564
- };
565
- const handlePanelColor = (offsetLeft, offsetTop) => {
566
- const colorActiveEl = refColorActiveElem.value;
567
- if (colorActiveEl) {
568
- colorActiveEl.style.top = (0, import_dom.toCssUnit)(offsetTop);
569
- colorActiveEl.style.left = (0, import_dom.toCssUnit)(offsetLeft);
570
- }
571
- };
572
- const handleEyeDropperEvent = () => {
573
- if (WinEyeDropper) {
574
- try {
575
- const eyeDropper = new WinEyeDropper();
576
- eyeDropper.open().then((rest) => {
577
- if (rest && rest.sRGBHex) {
578
- reactData.selectColor = rest.sRGBHex;
589
+ const handleSelectColorByXY = (clientX, clientY) => {
590
+ const { showAlpha } = props;
591
+ const { panelColor, aValue } = reactData;
592
+ const colorPanelEl = refColorPanelElem.value;
593
+ const colorActiveEl = refColorActiveElem.value;
594
+ if (colorPanelEl && colorActiveEl) {
595
+ const { clientWidth, clientHeight } = colorPanelEl;
596
+ const colorPanelRect = colorPanelEl.getBoundingClientRect();
597
+ const offsetTop = Math.min(clientHeight, Math.max(0, clientY - colorPanelRect.y));
598
+ const offsetLeft = Math.min(clientWidth, Math.max(0, clientX - colorPanelRect.x));
599
+ const colorRest = (0, import_util.parseValColor)(panelColor);
600
+ if (colorRest) {
601
+ const hsvRest = colorRest.type === "hex" ? (0, import_util.hexToHsv)(colorRest.hex) : (0, import_util.rgbToHsv)(colorRest);
602
+ if (hsvRest) {
603
+ const ragRest = (0, import_util.hsvToRgb)(hsvRest.h, offsetLeft / clientWidth, 1 - offsetTop / clientHeight);
604
+ reactData.selectColor = (0, import_util.toValRgb)(ragRest.r, ragRest.g, ragRest.b, showAlpha ? aValue : null);
579
605
  updateModelColor();
580
606
  }
581
- }).catch(() => {
582
- });
583
- } catch (e) {
584
- }
585
- }
586
- };
587
- const handleSelectColorByXY = (clientX, clientY) => {
588
- const { showAlpha } = props;
589
- const { panelColor, aValue } = reactData;
590
- const colorPanelEl = refColorPanelElem.value;
591
- const colorActiveEl = refColorActiveElem.value;
592
- if (colorPanelEl && colorActiveEl) {
593
- const { clientWidth, clientHeight } = colorPanelEl;
594
- const colorPanelRect = colorPanelEl.getBoundingClientRect();
595
- const offsetTop = Math.min(clientHeight, Math.max(0, clientY - colorPanelRect.y));
596
- const offsetLeft = Math.min(clientWidth, Math.max(0, clientX - colorPanelRect.x));
597
- const colorRest = (0, import_util.parseValColor)(panelColor);
598
- if (colorRest) {
599
- const hsvRest = colorRest.type === "hex" ? (0, import_util.hexToHsv)(colorRest.hex) : (0, import_util.rgbToHsv)(colorRest);
600
- if (hsvRest) {
601
- const ragRest = (0, import_util.hsvToRgb)(hsvRest.h, offsetLeft / clientWidth, 1 - offsetTop / clientHeight);
602
- reactData.selectColor = (0, import_util.toValRgb)(ragRest.r, ragRest.g, ragRest.b, showAlpha ? aValue : null);
603
- updateModelColor();
604
607
  }
608
+ handlePanelColor(offsetLeft, offsetTop);
605
609
  }
606
- handlePanelColor(offsetLeft, offsetTop);
607
- }
608
- };
609
- const handleSelectColorMousedownEvent = (evnt) => {
610
- evnt.stopPropagation();
611
- evnt.preventDefault();
612
- handleSelectColorByXY(evnt.clientX, evnt.clientY);
613
- document.onmousemove = (evnt2) => {
614
- handleSelectColorByXY(evnt2.clientX, evnt2.clientY);
615
610
  };
616
- document.onmouseup = () => {
617
- document.onmousemove = null;
618
- document.onmouseup = null;
611
+ const handleSelectColorMousedownEvent = (evnt) => {
612
+ evnt.stopPropagation();
613
+ evnt.preventDefault();
614
+ handleSelectColorByXY(evnt.clientX, evnt.clientY);
615
+ document.onmousemove = (evnt2) => {
616
+ handleSelectColorByXY(evnt2.clientX, evnt2.clientY);
617
+ };
618
+ document.onmouseup = () => {
619
+ document.onmousemove = null;
620
+ document.onmouseup = null;
621
+ };
619
622
  };
620
- };
621
- const handleCopyColorEvent = () => {
622
- const { selectColor } = reactData;
623
- if (selectColor) {
624
- if (import_core.VxeUI.clipboard.copy(selectColor)) {
625
- if (import_core.VxeUI.modal) {
626
- import_core.VxeUI.modal.message({
627
- content: getI18n("vxe.colorPicker.copySuccess", [selectColor]),
628
- status: "success"
629
- });
623
+ const handleCopyColorEvent = () => {
624
+ const { selectColor } = reactData;
625
+ if (selectColor) {
626
+ if (import_core.VxeUI.clipboard.copy(selectColor)) {
627
+ if (import_core.VxeUI.modal) {
628
+ import_core.VxeUI.modal.message({
629
+ content: getI18n("vxe.colorPicker.copySuccess", [selectColor]),
630
+ status: "success"
631
+ });
632
+ }
630
633
  }
631
634
  }
632
- }
633
- };
634
- const handleGlobalMousedownEvent = (evnt) => {
635
- const { visiblePanel } = reactData;
636
- const isDisabled = computeIsDisabled.value;
637
- if (!isDisabled) {
638
- const el = refElem.value;
639
- const panelElem = refOptionPanel.value;
640
- reactData.isActivated = (0, import_dom.getEventTargetNode)(evnt, el).flag || (0, import_dom.getEventTargetNode)(evnt, panelElem).flag;
641
- if (visiblePanel && !reactData.isActivated) {
635
+ };
636
+ const handleGlobalMousedownEvent = (evnt) => {
637
+ const { visiblePanel } = reactData;
638
+ const isDisabled = computeIsDisabled.value;
639
+ if (!isDisabled) {
640
+ const el = refElem.value;
641
+ const panelElem = refOptionPanel.value;
642
+ reactData.isActivated = (0, import_dom.getEventTargetNode)(evnt, el).flag || (0, import_dom.getEventTargetNode)(evnt, panelElem).flag;
643
+ if (visiblePanel && !reactData.isActivated) {
644
+ hideOptionPanel();
645
+ }
646
+ }
647
+ };
648
+ const handleGlobalBlurEvent = () => {
649
+ const { visiblePanel, isActivated } = reactData;
650
+ if (visiblePanel) {
642
651
  hideOptionPanel();
643
652
  }
644
- }
645
- };
646
- const handleGlobalBlurEvent = () => {
647
- const { visiblePanel, isActivated } = reactData;
648
- if (visiblePanel) {
649
- hideOptionPanel();
650
- }
651
- if (isActivated) {
652
- reactData.isActivated = false;
653
- }
654
- if (visiblePanel || isActivated) {
655
- const targetElem = refInputTarget.value;
656
- if (targetElem) {
657
- targetElem.blur();
653
+ if (isActivated) {
654
+ reactData.isActivated = false;
655
+ }
656
+ if (visiblePanel || isActivated) {
657
+ const targetElem = refInputTarget.value;
658
+ if (targetElem) {
659
+ targetElem.blur();
660
+ }
661
+ }
662
+ };
663
+ const handleGlobalResizeEvent = () => {
664
+ const { visiblePanel } = reactData;
665
+ if (visiblePanel) {
666
+ updatePlacement();
667
+ }
668
+ };
669
+ const handleGlobalScrollEvent = () => {
670
+ const { visiblePanel } = reactData;
671
+ if (visiblePanel) {
672
+ updatePlacement();
673
+ }
674
+ };
675
+ const dispatchEvent = (type, params, evnt) => {
676
+ emit(type, createEvent(evnt, { $colorPicker: $xeColorPicker }, params));
677
+ };
678
+ const colorPickerMethods = {
679
+ dispatchEvent
680
+ };
681
+ const colorPickerPrivateMethods = {};
682
+ Object.assign($xeColorPicker, colorPickerMethods, colorPickerPrivateMethods);
683
+ const renderColorWrapper = () => {
684
+ const { showColorExtractor } = props;
685
+ const { panelColor } = reactData;
686
+ if (showColorExtractor) {
687
+ return (0, import_vue.h)(
688
+ "div",
689
+ {
690
+ ref: refColorPanelElem,
691
+ class: "vxe-color-picker--color-wrapper",
692
+ onMousedown: handleSelectColorMousedownEvent
693
+ },
694
+ [
695
+ (0, import_vue.h)("div", {
696
+ class: "vxe-color-picker--color-bg",
697
+ style: {
698
+ backgroundColor: panelColor
699
+ }
700
+ }),
701
+ (0, import_vue.h)("div", {
702
+ class: "vxe-color-picker--white-bg"
703
+ }),
704
+ (0, import_vue.h)("div", {
705
+ class: "vxe-color-picker--black-bg"
706
+ }),
707
+ (0, import_vue.h)("div", {
708
+ ref: refColorActiveElem,
709
+ class: "vxe-color-picker--color-active"
710
+ })
711
+ ]
712
+ );
658
713
  }
659
- }
660
- };
661
- const handleGlobalResizeEvent = () => {
662
- const { visiblePanel } = reactData;
663
- if (visiblePanel) {
664
- updatePlacement();
665
- }
666
- };
667
- const handleGlobalScrollEvent = () => {
668
- const { visiblePanel } = reactData;
669
- if (visiblePanel) {
670
- updatePlacement();
671
- }
672
- };
673
- const dispatchEvent = (type, params, evnt) => {
674
- emit(type, createEvent(evnt, { $colorPicker: $xeColorPicker }, params));
675
- };
676
- const colorPickerMethods = {
677
- dispatchEvent
678
- };
679
- const colorPickerPrivateMethods = {};
680
- Object.assign($xeColorPicker, colorPickerMethods, colorPickerPrivateMethods);
681
- const renderColorWrapper = () => {
682
- const { showColorExtractor } = props;
683
- const { panelColor } = reactData;
684
- if (showColorExtractor) {
714
+ return renderEmptyElement($xeColorPicker);
715
+ };
716
+ const renderColorBar = () => {
717
+ const { showAlpha, clickToCopy, showEyeDropper } = props;
718
+ const { selectTyle, showTypePopup, hexValue, rValue, gValue, bValue, aValue, selectColor, panelColor } = reactData;
719
+ const isRgb = computeIsRgb.value;
720
+ const selectTypeItem = computeSelectTypeItem.value;
685
721
  return (0, import_vue.h)(
686
722
  "div",
687
723
  {
688
- ref: refColorPanelElem,
689
- class: "vxe-color-picker--color-wrapper",
690
- onMousedown: handleSelectColorMousedownEvent
724
+ class: "vxe-color-picker--bar-wrapper"
691
725
  },
692
726
  [
693
- (0, import_vue.h)("div", {
694
- class: "vxe-color-picker--color-bg",
695
- style: {
696
- backgroundColor: panelColor
697
- }
698
- }),
699
- (0, import_vue.h)("div", {
700
- class: "vxe-color-picker--white-bg"
701
- }),
702
- (0, import_vue.h)("div", {
703
- class: "vxe-color-picker--black-bg"
704
- }),
705
- (0, import_vue.h)("div", {
706
- ref: refColorActiveElem,
707
- class: "vxe-color-picker--color-active"
708
- })
727
+ (0, import_vue.h)(
728
+ "div",
729
+ {
730
+ class: "vxe-color-picker--slider-wrapper"
731
+ },
732
+ [
733
+ showEyeDropper && WinEyeDropper ? (0, import_vue.h)(
734
+ "div",
735
+ {
736
+ class: "vxe-color-picker--color-dropper"
737
+ },
738
+ [
739
+ (0, import_vue.h)(
740
+ "span",
741
+ {
742
+ class: "vxe-color-picker--color-dropper-btn",
743
+ onClick: handleEyeDropperEvent
744
+ },
745
+ [
746
+ (0, import_vue.h)("i", {
747
+ class: getIcon().COLOR_PICKER_EYE_DROPPER
748
+ })
749
+ ]
750
+ )
751
+ ]
752
+ ) : renderEmptyElement($xeColorPicker),
753
+ (0, import_vue.h)(
754
+ "div",
755
+ {
756
+ class: "vxe-color-picker--slider-preview"
757
+ },
758
+ [
759
+ (0, import_vue.h)(
760
+ "div",
761
+ {
762
+ class: "vxe-color-picker--preview-btn"
763
+ },
764
+ [
765
+ (0, import_vue.h)(
766
+ "div",
767
+ {
768
+ class: "vxe-color-picker--preview-color",
769
+ style: {
770
+ backgroundColor: selectColor
771
+ }
772
+ },
773
+ clickToCopy ? [
774
+ (0, import_vue.h)(
775
+ "span",
776
+ {
777
+ class: "vxe-color-picker--preview-copy-btn",
778
+ onClick: handleCopyColorEvent
779
+ },
780
+ [
781
+ (0, import_vue.h)("i", {
782
+ class: getIcon().COLOR_PICKER_COLOR_COPY
783
+ })
784
+ ]
785
+ )
786
+ ] : []
787
+ )
788
+ ]
789
+ )
790
+ ]
791
+ ),
792
+ (0, import_vue.h)(
793
+ "div",
794
+ {
795
+ class: "vxe-color-picker--slider-handle"
796
+ },
797
+ [
798
+ (0, import_vue.h)(
799
+ "div",
800
+ {
801
+ ref: refHueSliderElem,
802
+ class: "vxe-color-picker--bar-hue-slider",
803
+ onClick: handleHueBarEvent
804
+ },
805
+ [
806
+ (0, import_vue.h)("div", {
807
+ ref: refHueSliderBtnElem,
808
+ class: "vxe-color-picker--bar-hue-btn",
809
+ onMousedown: handleHueSliderMousedownEvent
810
+ })
811
+ ]
812
+ ),
813
+ showAlpha ? (0, import_vue.h)(
814
+ "div",
815
+ {
816
+ ref: refAlphaSliderElem,
817
+ class: "vxe-color-picker--bar-alpha-slider",
818
+ onClick: handleAlphaBarEvent
819
+ },
820
+ [
821
+ (0, import_vue.h)("div", {
822
+ class: "vxe-color-picker--bar-alpha-bg",
823
+ style: {
824
+ background: `linear-gradient(to right, rgba(0, 0, 0, 0), ${panelColor})`
825
+ }
826
+ }),
827
+ (0, import_vue.h)("div", {
828
+ ref: refAlphaSliderBtnElem,
829
+ class: "vxe-color-picker--bar-alpha-btn",
830
+ onMousedown: handleAlphaSliderMousedownEvent
831
+ })
832
+ ]
833
+ ) : renderEmptyElement($xeColorPicker)
834
+ ]
835
+ )
836
+ ]
837
+ ),
838
+ (0, import_vue.h)(
839
+ "div",
840
+ {
841
+ class: "vxe-color-picker--custom-wrapper"
842
+ },
843
+ [
844
+ (0, import_vue.h)(
845
+ "div",
846
+ {
847
+ class: "vxe-color-picker--type-switch"
848
+ },
849
+ [
850
+ (0, import_vue.h)(
851
+ "div",
852
+ {
853
+ class: "vxe-color-picker--type-label",
854
+ onClick: toggleTypeVisibleEvent
855
+ },
856
+ [
857
+ (0, import_vue.h)("span", `${selectTypeItem ? selectTypeItem.label : selectTyle}`),
858
+ (0, import_vue.h)(
859
+ "span",
860
+ {
861
+ class: "vxe-color-picker--type-icon"
862
+ },
863
+ [
864
+ (0, import_vue.h)("i", {
865
+ class: showTypePopup ? getIcon().COLOR_PICKER_TPTY_OPEN : getIcon().COLOR_PICKER_TPTY_CLOSE
866
+ })
867
+ ]
868
+ )
869
+ ]
870
+ ),
871
+ (0, import_vue.h)(
872
+ "div",
873
+ {
874
+ class: [
875
+ "vxe-color-picker--type-popup",
876
+ {
877
+ "is--visible": showTypePopup
878
+ }
879
+ ]
880
+ },
881
+ typeList.map((item) => {
882
+ return (0, import_vue.h)(
883
+ "div",
884
+ {
885
+ class: "vxe-color-picker--type-item",
886
+ onClick(evnt) {
887
+ evnt.stopPropagation();
888
+ handleChangeType(item.value);
889
+ }
890
+ },
891
+ item.label
892
+ );
893
+ })
894
+ )
895
+ ]
896
+ ),
897
+ (0, import_vue.h)(
898
+ "div",
899
+ {
900
+ class: `vxe-color-picker--${selectTyle}-wrapper`
901
+ },
902
+ isRgb ? [
903
+ (0, import_vue.h)(
904
+ "div",
905
+ {
906
+ class: "vxe-color-picker--input-wrapper"
907
+ },
908
+ [
909
+ (0, import_vue.h)(import_number_input.default, {
910
+ type: "integer",
911
+ size: "mini",
912
+ align: "center",
913
+ min: 0,
914
+ max: 255,
915
+ maxLength: 3,
916
+ placeholder: "",
917
+ modelValue: rValue,
918
+ controlConfig: {
919
+ showButton: false
920
+ },
921
+ "onUpdate:modelValue"(val) {
922
+ reactData.rValue = val;
923
+ },
924
+ onChange: handleInputRgbEvent
925
+ }),
926
+ (0, import_vue.h)(import_number_input.default, {
927
+ type: "integer",
928
+ size: "mini",
929
+ align: "center",
930
+ min: 0,
931
+ max: 255,
932
+ maxLength: 3,
933
+ placeholder: "",
934
+ modelValue: gValue,
935
+ controlConfig: {
936
+ showButton: false
937
+ },
938
+ "onUpdate:modelValue"(val) {
939
+ reactData.gValue = val;
940
+ },
941
+ onChange: handleInputRgbEvent
942
+ }),
943
+ (0, import_vue.h)(import_number_input.default, {
944
+ type: "integer",
945
+ size: "mini",
946
+ align: "center",
947
+ min: 0,
948
+ max: 255,
949
+ maxLength: 3,
950
+ placeholder: "",
951
+ modelValue: bValue,
952
+ controlConfig: {
953
+ showButton: false
954
+ },
955
+ "onUpdate:modelValue"(val) {
956
+ reactData.bValue = val;
957
+ },
958
+ onChange: handleInputRgbEvent
959
+ }),
960
+ (0, import_vue.h)(import_number_input.default, {
961
+ type: "number",
962
+ size: "mini",
963
+ align: "center",
964
+ min: 0,
965
+ max: 1,
966
+ step: 0.01,
967
+ maxLength: 4,
968
+ placeholder: "",
969
+ modelValue: aValue,
970
+ controlConfig: {
971
+ showButton: false
972
+ },
973
+ "onUpdate:modelValue"(val) {
974
+ reactData.aValue = val;
975
+ },
976
+ onChange: handleInputAlphaEvent
977
+ })
978
+ ]
979
+ ),
980
+ (0, import_vue.h)(
981
+ "div",
982
+ {
983
+ class: "vxe-color-picker--input-title"
984
+ },
985
+ [(0, import_vue.h)("span", "R"), (0, import_vue.h)("span", "G"), (0, import_vue.h)("span", "B"), (0, import_vue.h)("span", "A")]
986
+ )
987
+ ] : [
988
+ (0, import_vue.h)(
989
+ "div",
990
+ {
991
+ class: "vxe-color-picker--input-wrapper"
992
+ },
993
+ [
994
+ (0, import_vue.h)(import_input.default, {
995
+ type: "text",
996
+ size: "mini",
997
+ align: "center",
998
+ maxLength: 9,
999
+ placeholder: "",
1000
+ modelValue: hexValue,
1001
+ "onUpdate:modelValue"(val) {
1002
+ reactData.hexValue = val;
1003
+ },
1004
+ onChange() {
1005
+ const colorRest = (0, import_util.parseValColor)(reactData.hexValue);
1006
+ if (colorRest) {
1007
+ if (colorRest.value) {
1008
+ reactData.selectColor = colorRest.value;
1009
+ updateModelColor();
1010
+ }
1011
+ }
1012
+ }
1013
+ })
1014
+ ]
1015
+ ),
1016
+ (0, import_vue.h)(
1017
+ "div",
1018
+ {
1019
+ class: "vxe-color-picker--input-title"
1020
+ },
1021
+ getI18n("vxe.colorPicker.hex")
1022
+ )
1023
+ ]
1024
+ )
1025
+ ]
1026
+ )
709
1027
  ]
710
1028
  );
711
- }
712
- return renderEmptyElement($xeColorPicker);
713
- };
714
- const renderColorBar = () => {
715
- const { showAlpha, clickToCopy, showEyeDropper } = props;
716
- const { selectTyle, showTypePopup, hexValue, rValue, gValue, bValue, aValue, selectColor, panelColor } = reactData;
717
- const isRgb = computeIsRgb.value;
718
- const selectTypeItem = computeSelectTypeItem.value;
719
- return (0, import_vue.h)(
720
- "div",
721
- {
722
- class: "vxe-color-picker--bar-wrapper"
723
- },
724
- [
725
- (0, import_vue.h)(
1029
+ };
1030
+ const renderQuickWrapper = () => {
1031
+ const { showQuick } = props;
1032
+ const colorList = computeColorList.value;
1033
+ if (showQuick && colorList.length) {
1034
+ return (0, import_vue.h)(
726
1035
  "div",
727
1036
  {
728
- class: "vxe-color-picker--slider-wrapper"
1037
+ class: "vxe-color-picker--quick-wrapper"
729
1038
  },
730
- [
731
- showEyeDropper && WinEyeDropper ? (0, import_vue.h)(
732
- "div",
733
- {
734
- class: "vxe-color-picker--color-dropper"
735
- },
736
- [
737
- (0, import_vue.h)(
738
- "span",
739
- {
740
- class: "vxe-color-picker--color-dropper-btn",
741
- onClick: handleEyeDropperEvent
742
- },
743
- [
744
- (0, import_vue.h)("i", {
745
- class: getIcon().COLOR_PICKER_EYE_DROPPER
746
- })
747
- ]
748
- )
749
- ]
750
- ) : renderEmptyElement($xeColorPicker),
751
- (0, import_vue.h)(
752
- "div",
753
- {
754
- class: "vxe-color-picker--slider-preview"
755
- },
756
- [
757
- (0, import_vue.h)(
758
- "div",
759
- {
760
- class: "vxe-color-picker--preview-btn"
761
- },
762
- [
763
- (0, import_vue.h)(
764
- "div",
765
- {
766
- class: "vxe-color-picker--preview-color",
767
- style: {
768
- backgroundColor: selectColor
769
- }
770
- },
771
- clickToCopy ? [
772
- (0, import_vue.h)(
773
- "span",
774
- {
775
- class: "vxe-color-picker--preview-copy-btn",
776
- onClick: handleCopyColorEvent
777
- },
778
- [
779
- (0, import_vue.h)("i", {
780
- class: getIcon().COLOR_PICKER_COLOR_COPY
781
- })
782
- ]
783
- )
784
- ] : []
785
- )
786
- ]
787
- )
788
- ]
789
- ),
790
- (0, import_vue.h)(
791
- "div",
792
- {
793
- class: "vxe-color-picker--slider-handle"
1039
+ colorList.map((item, i) => {
1040
+ return (0, import_vue.h)("div", {
1041
+ key: i,
1042
+ class: "vxe-color-picker--quick-item",
1043
+ title: item.label || "",
1044
+ style: {
1045
+ backgroundColor: item.value
794
1046
  },
795
- [
796
- (0, import_vue.h)(
797
- "div",
798
- {
799
- ref: refHueSliderElem,
800
- class: "vxe-color-picker--bar-hue-slider",
801
- onClick: handleHueBarEvent
802
- },
803
- [
804
- (0, import_vue.h)("div", {
805
- ref: refHueSliderBtnElem,
806
- class: "vxe-color-picker--bar-hue-btn",
807
- onMousedown: handleHueSliderMousedownEvent
808
- })
809
- ]
810
- ),
811
- showAlpha ? (0, import_vue.h)(
812
- "div",
813
- {
814
- ref: refAlphaSliderElem,
815
- class: "vxe-color-picker--bar-alpha-slider",
816
- onClick: handleAlphaBarEvent
817
- },
818
- [
819
- (0, import_vue.h)("div", {
820
- class: "vxe-color-picker--bar-alpha-bg",
821
- style: {
822
- background: `linear-gradient(to right, rgba(0, 0, 0, 0), ${panelColor})`
823
- }
824
- }),
825
- (0, import_vue.h)("div", {
826
- ref: refAlphaSliderBtnElem,
827
- class: "vxe-color-picker--bar-alpha-btn",
828
- onMousedown: handleAlphaSliderMousedownEvent
829
- })
830
- ]
831
- ) : renderEmptyElement($xeColorPicker)
832
- ]
833
- )
834
- ]
835
- ),
836
- (0, import_vue.h)(
1047
+ onClick(evnt) {
1048
+ handleQuickEvent(evnt, item);
1049
+ }
1050
+ });
1051
+ })
1052
+ );
1053
+ }
1054
+ return renderEmptyElement($xeColorPicker);
1055
+ };
1056
+ const renderVN = () => {
1057
+ const { className, popupClassName, clearable, modelValue } = props;
1058
+ const { initialized, isActivated, isAniVisible, visiblePanel } = reactData;
1059
+ const vSize = computeSize.value;
1060
+ const isDisabled = computeIsDisabled.value;
1061
+ const btnTransfer = computeBtnTransfer.value;
1062
+ const formReadonly = computeFormReadonly.value;
1063
+ if (formReadonly) {
1064
+ return (0, import_vue.h)(
837
1065
  "div",
838
1066
  {
839
- class: "vxe-color-picker--custom-wrapper"
1067
+ ref: refElem,
1068
+ class: [
1069
+ "vxe-color-picker--readonly",
1070
+ className,
1071
+ {
1072
+ [`size--${vSize}`]: vSize
1073
+ }
1074
+ ]
840
1075
  },
841
1076
  [
842
- (0, import_vue.h)(
843
- "div",
844
- {
845
- class: "vxe-color-picker--type-switch"
846
- },
847
- [
848
- (0, import_vue.h)(
849
- "div",
850
- {
851
- class: "vxe-color-picker--type-label",
852
- onClick: toggleTypeVisibleEvent
853
- },
854
- [
855
- (0, import_vue.h)("span", `${selectTypeItem ? selectTypeItem.label : selectTyle}`),
856
- (0, import_vue.h)(
857
- "span",
858
- {
859
- class: "vxe-color-picker--type-icon"
860
- },
861
- [
862
- (0, import_vue.h)("i", {
863
- class: showTypePopup ? getIcon().COLOR_PICKER_TPTY_OPEN : getIcon().COLOR_PICKER_TPTY_CLOSE
864
- })
865
- ]
866
- )
867
- ]
868
- ),
869
- (0, import_vue.h)(
870
- "div",
871
- {
872
- class: [
873
- "vxe-color-picker--type-popup",
874
- {
875
- "is--visible": showTypePopup
876
- }
877
- ]
878
- },
879
- typeList.map((item) => {
880
- return (0, import_vue.h)(
881
- "div",
882
- {
883
- class: "vxe-color-picker--type-item",
884
- onClick(evnt) {
885
- evnt.stopPropagation();
886
- handleChangeType(item.value);
887
- }
888
- },
889
- item.label
890
- );
891
- })
892
- )
893
- ]
894
- ),
895
- (0, import_vue.h)(
896
- "div",
897
- {
898
- class: `vxe-color-picker--${selectTyle}-wrapper`
899
- },
900
- isRgb ? [
901
- (0, import_vue.h)(
902
- "div",
903
- {
904
- class: "vxe-color-picker--input-wrapper"
905
- },
906
- [
907
- (0, import_vue.h)(import_number_input.default, {
908
- type: "integer",
909
- size: "mini",
910
- align: "center",
911
- min: 0,
912
- max: 255,
913
- maxLength: 3,
914
- placeholder: "",
915
- modelValue: rValue,
916
- controlConfig: {
917
- showButton: false
918
- },
919
- "onUpdate:modelValue"(val) {
920
- reactData.rValue = val;
921
- },
922
- onChange: handleInputRgbEvent
923
- }),
924
- (0, import_vue.h)(import_number_input.default, {
925
- type: "integer",
926
- size: "mini",
927
- align: "center",
928
- min: 0,
929
- max: 255,
930
- maxLength: 3,
931
- placeholder: "",
932
- modelValue: gValue,
933
- controlConfig: {
934
- showButton: false
935
- },
936
- "onUpdate:modelValue"(val) {
937
- reactData.gValue = val;
938
- },
939
- onChange: handleInputRgbEvent
940
- }),
941
- (0, import_vue.h)(import_number_input.default, {
942
- type: "integer",
943
- size: "mini",
944
- align: "center",
945
- min: 0,
946
- max: 255,
947
- maxLength: 3,
948
- placeholder: "",
949
- modelValue: bValue,
950
- controlConfig: {
951
- showButton: false
952
- },
953
- "onUpdate:modelValue"(val) {
954
- reactData.bValue = val;
955
- },
956
- onChange: handleInputRgbEvent
957
- }),
958
- (0, import_vue.h)(import_number_input.default, {
959
- type: "number",
960
- size: "mini",
961
- align: "center",
962
- min: 0,
963
- max: 1,
964
- step: 0.01,
965
- maxLength: 4,
966
- placeholder: "",
967
- modelValue: aValue,
968
- controlConfig: {
969
- showButton: false
970
- },
971
- "onUpdate:modelValue"(val) {
972
- reactData.aValue = val;
973
- },
974
- onChange: handleInputAlphaEvent
975
- })
976
- ]
977
- ),
978
- (0, import_vue.h)(
979
- "div",
980
- {
981
- class: "vxe-color-picker--input-title"
982
- },
983
- [(0, import_vue.h)("span", "R"), (0, import_vue.h)("span", "G"), (0, import_vue.h)("span", "B"), (0, import_vue.h)("span", "A")]
984
- )
985
- ] : [
986
- (0, import_vue.h)(
987
- "div",
988
- {
989
- class: "vxe-color-picker--input-wrapper"
990
- },
991
- [
992
- (0, import_vue.h)(import_input.default, {
993
- type: "text",
994
- size: "mini",
995
- align: "center",
996
- maxLength: 9,
997
- placeholder: "",
998
- modelValue: hexValue,
999
- "onUpdate:modelValue"(val) {
1000
- reactData.hexValue = val;
1001
- },
1002
- onChange() {
1003
- const colorRest = (0, import_util.parseValColor)(reactData.hexValue);
1004
- if (colorRest) {
1005
- if (colorRest.value) {
1006
- reactData.selectColor = colorRest.value;
1007
- updateModelColor();
1008
- }
1009
- }
1010
- }
1011
- })
1012
- ]
1013
- ),
1014
- (0, import_vue.h)(
1015
- "div",
1016
- {
1017
- class: "vxe-color-picker--input-title"
1018
- },
1019
- getI18n("vxe.colorPicker.hex")
1020
- )
1021
- ]
1022
- )
1077
+ (0, import_vue.h)("div", {
1078
+ class: [
1079
+ "vxe-color-picker--readonly-color",
1080
+ {
1081
+ "is--empty": !modelValue
1082
+ }
1083
+ ],
1084
+ style: modelValue ? {
1085
+ backgroundColor: modelValue
1086
+ } : void 0
1087
+ })
1023
1088
  ]
1024
- )
1025
- ]
1026
- );
1027
- };
1028
- const renderQuickWrapper = () => {
1029
- const { showQuick } = props;
1030
- const colorList = computeColorList.value;
1031
- if (showQuick && colorList.length) {
1032
- return (0, import_vue.h)(
1033
- "div",
1034
- {
1035
- class: "vxe-color-picker--quick-wrapper"
1036
- },
1037
- colorList.map((item, i) => {
1038
- return (0, import_vue.h)("div", {
1039
- key: i,
1040
- class: "vxe-color-picker--quick-item",
1041
- title: item.label || "",
1042
- style: {
1043
- backgroundColor: item.value
1044
- },
1045
- onClick(evnt) {
1046
- handleQuickEvent(evnt, item);
1047
- }
1048
- });
1049
- })
1050
- );
1051
- }
1052
- return renderEmptyElement($xeColorPicker);
1053
- };
1054
- const renderVN = () => {
1055
- const { className, popupClassName, clearable, modelValue } = props;
1056
- const { initialized, isActivated, isAniVisible, visiblePanel } = reactData;
1057
- const vSize = computeSize.value;
1058
- const isDisabled = computeIsDisabled.value;
1059
- const btnTransfer = computeBtnTransfer.value;
1060
- const formReadonly = computeFormReadonly.value;
1061
- if (formReadonly) {
1089
+ );
1090
+ }
1091
+ const currStyle = computeCurrStyle.value;
1092
+ const popupOpts = computePopupOpts.value;
1093
+ const { appendTo } = popupOpts;
1062
1094
  return (0, import_vue.h)(
1063
1095
  "div",
1064
1096
  {
1065
1097
  ref: refElem,
1066
1098
  class: [
1067
- "vxe-color-picker--readonly",
1068
- className,
1099
+ "vxe-color-picker",
1100
+ className ? import_xe_utils.default.isFunction(className) ? className({ $colorPicker: $xeColorPicker }) : className : "",
1069
1101
  {
1070
- [`size--${vSize}`]: vSize
1102
+ [`size--${vSize}`]: vSize,
1103
+ "is--selected": !!modelValue,
1104
+ "is--visible": visiblePanel,
1105
+ "is--disabled": isDisabled,
1106
+ "is--active": isActivated
1071
1107
  }
1072
- ]
1108
+ ],
1109
+ style: currStyle
1073
1110
  },
1074
1111
  [
1075
- (0, import_vue.h)("div", {
1076
- class: [
1077
- "vxe-color-picker--readonly-color",
1078
- {
1079
- "is--empty": !modelValue
1080
- }
1081
- ],
1082
- style: modelValue ? {
1083
- backgroundColor: modelValue
1084
- } : void 0
1085
- })
1112
+ (0, import_vue.h)("input", {
1113
+ ref: refInputTarget,
1114
+ class: "vxe-color-picker--input",
1115
+ onFocus: focusEvent,
1116
+ onBlur: blurEvent
1117
+ }),
1118
+ (0, import_vue.h)(
1119
+ "div",
1120
+ {
1121
+ class: "vxe-color-picker--inner",
1122
+ onClick: clickEvent
1123
+ },
1124
+ [
1125
+ (0, import_vue.h)("div", {
1126
+ class: "vxe-color-picker--inner-color",
1127
+ style: {
1128
+ backgroundColor: modelValue
1129
+ }
1130
+ })
1131
+ ]
1132
+ ),
1133
+ (0, import_vue.h)(
1134
+ import_vue.Teleport,
1135
+ {
1136
+ to: (0, import_dom.getPopupContainer)(appendTo),
1137
+ disabled: btnTransfer ? !initialized : true
1138
+ },
1139
+ [
1140
+ (0, import_vue.h)(
1141
+ "div",
1142
+ {
1143
+ ref: refOptionPanel,
1144
+ class: [
1145
+ "vxe-table--ignore-clear vxe-color-picker--panel",
1146
+ popupClassName ? import_xe_utils.default.isFunction(popupClassName) ? popupClassName({ $colorPicker: $xeColorPicker }) : popupClassName : "",
1147
+ {
1148
+ [`size--${vSize}`]: vSize,
1149
+ "is--transfer": btnTransfer,
1150
+ "ani--leave": isAniVisible,
1151
+ "ani--enter": visiblePanel
1152
+ }
1153
+ ],
1154
+ placement: reactData.panelPlacement,
1155
+ style: reactData.panelStyle
1156
+ },
1157
+ [
1158
+ initialized && (visiblePanel || isAniVisible) ? (0, import_vue.h)(
1159
+ "div",
1160
+ {
1161
+ class: "vxe-color-picker--panel-wrapper",
1162
+ onClick: handlePanelClickEvent
1163
+ },
1164
+ [
1165
+ renderColorWrapper(),
1166
+ renderColorBar(),
1167
+ renderQuickWrapper(),
1168
+ (0, import_vue.h)(
1169
+ "div",
1170
+ {
1171
+ class: "vxe-color-picker--footer-wrapper"
1172
+ },
1173
+ [
1174
+ clearable ? (0, import_vue.h)(import_button.default, {
1175
+ content: getI18n("vxe.colorPicker.clear"),
1176
+ size: "mini",
1177
+ onClick: clearEvent
1178
+ }) : renderEmptyElement($xeColorPicker),
1179
+ (0, import_vue.h)(import_button.default, {
1180
+ content: getI18n("vxe.colorPicker.confirm"),
1181
+ size: "mini",
1182
+ status: "primary",
1183
+ onClick: confirmEvent
1184
+ })
1185
+ ]
1186
+ )
1187
+ ]
1188
+ ) : renderEmptyElement($xeColorPicker)
1189
+ ]
1190
+ )
1191
+ ]
1192
+ )
1086
1193
  ]
1087
1194
  );
1088
- }
1089
- const currStyle = computeCurrStyle.value;
1090
- const popupOpts = computePopupOpts.value;
1091
- const { appendTo } = popupOpts;
1092
- return (0, import_vue.h)(
1093
- "div",
1094
- {
1095
- ref: refElem,
1096
- class: [
1097
- "vxe-color-picker",
1098
- className ? import_xe_utils.default.isFunction(className) ? className({ $colorPicker: $xeColorPicker }) : className : "",
1099
- {
1100
- [`size--${vSize}`]: vSize,
1101
- "is--selected": !!modelValue,
1102
- "is--visible": visiblePanel,
1103
- "is--disabled": isDisabled,
1104
- "is--active": isActivated
1105
- }
1106
- ],
1107
- style: currStyle
1108
- },
1109
- [
1110
- (0, import_vue.h)("input", {
1111
- ref: refInputTarget,
1112
- class: "vxe-color-picker--input",
1113
- onFocus: focusEvent,
1114
- onBlur: blurEvent
1115
- }),
1116
- (0, import_vue.h)(
1117
- "div",
1118
- {
1119
- class: "vxe-color-picker--inner",
1120
- onClick: clickEvent
1121
- },
1122
- [
1123
- (0, import_vue.h)("div", {
1124
- class: "vxe-color-picker--inner-color",
1125
- style: {
1126
- backgroundColor: modelValue
1127
- }
1128
- })
1129
- ]
1130
- ),
1131
- (0, import_vue.h)(
1132
- import_vue.Teleport,
1133
- {
1134
- to: (0, import_dom.getPopupContainer)(appendTo),
1135
- disabled: btnTransfer ? !initialized : true
1136
- },
1137
- [
1138
- (0, import_vue.h)(
1139
- "div",
1140
- {
1141
- ref: refOptionPanel,
1142
- class: [
1143
- "vxe-table--ignore-clear vxe-color-picker--panel",
1144
- popupClassName ? import_xe_utils.default.isFunction(popupClassName) ? popupClassName({ $colorPicker: $xeColorPicker }) : popupClassName : "",
1145
- {
1146
- [`size--${vSize}`]: vSize,
1147
- "is--transfer": btnTransfer,
1148
- "ani--leave": isAniVisible,
1149
- "ani--enter": visiblePanel
1150
- }
1151
- ],
1152
- placement: reactData.panelPlacement,
1153
- style: reactData.panelStyle
1154
- },
1155
- [
1156
- initialized && (visiblePanel || isAniVisible) ? (0, import_vue.h)(
1157
- "div",
1158
- {
1159
- class: "vxe-color-picker--panel-wrapper",
1160
- onClick: handlePanelClickEvent
1161
- },
1162
- [
1163
- renderColorWrapper(),
1164
- renderColorBar(),
1165
- renderQuickWrapper(),
1166
- (0, import_vue.h)(
1167
- "div",
1168
- {
1169
- class: "vxe-color-picker--footer-wrapper"
1170
- },
1171
- [
1172
- clearable ? (0, import_vue.h)(import_button.default, {
1173
- content: getI18n("vxe.colorPicker.clear"),
1174
- size: "mini",
1175
- onClick: clearEvent
1176
- }) : renderEmptyElement($xeColorPicker),
1177
- (0, import_vue.h)(import_button.default, {
1178
- content: getI18n("vxe.colorPicker.confirm"),
1179
- size: "mini",
1180
- status: "primary",
1181
- onClick: confirmEvent
1182
- })
1183
- ]
1184
- )
1185
- ]
1186
- ) : renderEmptyElement($xeColorPicker)
1187
- ]
1188
- )
1189
- ]
1190
- )
1191
- ]
1195
+ };
1196
+ (0, import_vue.watch)(
1197
+ () => props.modelValue,
1198
+ () => {
1199
+ updateMode();
1200
+ }
1192
1201
  );
1193
- };
1194
- (0, import_vue.watch)(
1195
- () => props.modelValue,
1196
- () => {
1197
- updateMode();
1198
- }
1199
- );
1200
- (0, import_vue.watch)(
1201
- () => props.type,
1202
- () => {
1203
- updateType();
1204
- }
1205
- );
1206
- (0, import_vue.onMounted)(() => {
1207
- globalEvents.on($xeColorPicker, "mousedown", handleGlobalMousedownEvent);
1208
- globalEvents.on($xeColorPicker, "blur", handleGlobalBlurEvent);
1209
- globalEvents.on($xeColorPicker, "resize", handleGlobalResizeEvent);
1210
- globalEvents.on($xeColorPicker, "scroll", handleGlobalScrollEvent);
1211
- });
1212
- (0, import_vue.onUnmounted)(() => {
1213
- globalEvents.off($xeColorPicker, "mousedown");
1214
- globalEvents.off($xeColorPicker, "blur");
1215
- globalEvents.off($xeColorPicker, "resize");
1216
- globalEvents.off($xeColorPicker, "scroll");
1217
- });
1218
- updateType();
1219
- (0, import_vue.provide)("$xeColorPicker", $xeColorPicker);
1220
- $xeColorPicker.renderVN = renderVN;
1221
- return $xeColorPicker;
1222
- },
1223
- render() {
1224
- return this.renderVN();
1225
- }
1226
- });
1202
+ (0, import_vue.watch)(
1203
+ () => props.type,
1204
+ () => {
1205
+ updateType();
1206
+ }
1207
+ );
1208
+ (0, import_vue.onMounted)(() => {
1209
+ globalEvents.on($xeColorPicker, "mousedown", handleGlobalMousedownEvent);
1210
+ globalEvents.on($xeColorPicker, "blur", handleGlobalBlurEvent);
1211
+ globalEvents.on($xeColorPicker, "resize", handleGlobalResizeEvent);
1212
+ globalEvents.on($xeColorPicker, "scroll", handleGlobalScrollEvent);
1213
+ });
1214
+ (0, import_vue.onUnmounted)(() => {
1215
+ globalEvents.off($xeColorPicker, "mousedown");
1216
+ globalEvents.off($xeColorPicker, "blur");
1217
+ globalEvents.off($xeColorPicker, "resize");
1218
+ globalEvents.off($xeColorPicker, "scroll");
1219
+ });
1220
+ updateType();
1221
+ (0, import_vue.provide)("$xeColorPicker", $xeColorPicker);
1222
+ $xeColorPicker.renderVN = renderVN;
1223
+ return $xeColorPicker;
1224
+ },
1225
+ render() {
1226
+ return this.renderVN();
1227
+ }
1228
+ })
1229
+ );