qy-vue-plugins 1.0.2-beta → 1.0.2

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 (246) hide show
  1. package/dist/apply-element-plus-theme.cjs +1 -0
  2. package/dist/apply-element-plus-theme.mjs +22 -0
  3. package/dist/beijihua-map-icon/hiper-map-icon-1.png +0 -0
  4. package/dist/beijihua-map-icon/hiper-map-icon-10.png +0 -0
  5. package/dist/beijihua-map-icon/hiper-map-icon-11.png +0 -0
  6. package/dist/beijihua-map-icon/hiper-map-icon-12.png +0 -0
  7. package/dist/beijihua-map-icon/hiper-map-icon-13.png +0 -0
  8. package/dist/beijihua-map-icon/hiper-map-icon-14.png +0 -0
  9. package/dist/beijihua-map-icon/hiper-map-icon-15.png +0 -0
  10. package/dist/beijihua-map-icon/hiper-map-icon-16.png +0 -0
  11. package/dist/beijihua-map-icon/hiper-map-icon-17.png +0 -0
  12. package/dist/beijihua-map-icon/hiper-map-icon-18.png +0 -0
  13. package/dist/beijihua-map-icon/hiper-map-icon-19.png +0 -0
  14. package/dist/beijihua-map-icon/hiper-map-icon-2.png +0 -0
  15. package/dist/beijihua-map-icon/hiper-map-icon-20.png +0 -0
  16. package/dist/beijihua-map-icon/hiper-map-icon-21.png +0 -0
  17. package/dist/beijihua-map-icon/hiper-map-icon-22.png +0 -0
  18. package/dist/beijihua-map-icon/hiper-map-icon-23.png +0 -0
  19. package/dist/beijihua-map-icon/hiper-map-icon-24.png +0 -0
  20. package/dist/beijihua-map-icon/hiper-map-icon-25.png +0 -0
  21. package/dist/beijihua-map-icon/hiper-map-icon-26.png +0 -0
  22. package/dist/beijihua-map-icon/hiper-map-icon-27.png +0 -0
  23. package/dist/beijihua-map-icon/hiper-map-icon-28.png +0 -0
  24. package/dist/beijihua-map-icon/hiper-map-icon-29.png +0 -0
  25. package/dist/beijihua-map-icon/hiper-map-icon-3.png +0 -0
  26. package/dist/beijihua-map-icon/hiper-map-icon-30.png +0 -0
  27. package/dist/beijihua-map-icon/hiper-map-icon-31.png +0 -0
  28. package/dist/beijihua-map-icon/hiper-map-icon-32.png +0 -0
  29. package/dist/beijihua-map-icon/hiper-map-icon-33.png +0 -0
  30. package/dist/beijihua-map-icon/hiper-map-icon-34.png +0 -0
  31. package/dist/beijihua-map-icon/hiper-map-icon-35.png +0 -0
  32. package/dist/beijihua-map-icon/hiper-map-icon-36.png +0 -0
  33. package/dist/beijihua-map-icon/hiper-map-icon-37.png +0 -0
  34. package/dist/beijihua-map-icon/hiper-map-icon-38.png +0 -0
  35. package/dist/beijihua-map-icon/hiper-map-icon-39.png +0 -0
  36. package/dist/beijihua-map-icon/hiper-map-icon-4.png +0 -0
  37. package/dist/beijihua-map-icon/hiper-map-icon-40.png +0 -0
  38. package/dist/beijihua-map-icon/hiper-map-icon-41.png +0 -0
  39. package/dist/beijihua-map-icon/hiper-map-icon-42.png +0 -0
  40. package/dist/beijihua-map-icon/hiper-map-icon-43.png +0 -0
  41. package/dist/beijihua-map-icon/hiper-map-icon-44.png +0 -0
  42. package/dist/beijihua-map-icon/hiper-map-icon-45.png +0 -0
  43. package/dist/beijihua-map-icon/hiper-map-icon-46.png +0 -0
  44. package/dist/beijihua-map-icon/hiper-map-icon-47.png +0 -0
  45. package/dist/beijihua-map-icon/hiper-map-icon-48.png +0 -0
  46. package/dist/beijihua-map-icon/hiper-map-icon-49.png +0 -0
  47. package/dist/beijihua-map-icon/hiper-map-icon-5.png +0 -0
  48. package/dist/beijihua-map-icon/hiper-map-icon-50.png +0 -0
  49. package/dist/beijihua-map-icon/hiper-map-icon-51.png +0 -0
  50. package/dist/beijihua-map-icon/hiper-map-icon-52.png +0 -0
  51. package/dist/beijihua-map-icon/hiper-map-icon-53.png +0 -0
  52. package/dist/beijihua-map-icon/hiper-map-icon-54.png +0 -0
  53. package/dist/beijihua-map-icon/hiper-map-icon-55.png +0 -0
  54. package/dist/beijihua-map-icon/hiper-map-icon-56.png +0 -0
  55. package/dist/beijihua-map-icon/hiper-map-icon-57.png +0 -0
  56. package/dist/beijihua-map-icon/hiper-map-icon-58.png +0 -0
  57. package/dist/beijihua-map-icon/hiper-map-icon-59.png +0 -0
  58. package/dist/beijihua-map-icon/hiper-map-icon-6.png +0 -0
  59. package/dist/beijihua-map-icon/hiper-map-icon-60.png +0 -0
  60. package/dist/beijihua-map-icon/hiper-map-icon-61.png +0 -0
  61. package/dist/beijihua-map-icon/hiper-map-icon-62.png +0 -0
  62. package/dist/beijihua-map-icon/hiper-map-icon-63.png +0 -0
  63. package/dist/beijihua-map-icon/hiper-map-icon-64.png +0 -0
  64. package/dist/beijihua-map-icon/hiper-map-icon-65.png +0 -0
  65. package/dist/beijihua-map-icon/hiper-map-icon-7.png +0 -0
  66. package/dist/beijihua-map-icon/hiper-map-icon-8.png +0 -0
  67. package/dist/beijihua-map-icon/hiper-map-icon-9.png +0 -0
  68. package/dist/chunks/{EventKeys-1aL9cgT0.js → EventKeys-DZ_Hahro.js} +4 -4
  69. package/dist/chunks/{MapTools.vue_vue_type_style_index_0_lang-C3__NQXN.js → MapTools.vue_vue_type_style_index_0_lang-C0C9opKY.js} +1 -1
  70. package/dist/chunks/{MapTools.vue_vue_type_style_index_0_lang-BJi8BdV8.js → MapTools.vue_vue_type_style_index_0_lang-CZ_dEmHg.js} +2 -2
  71. package/dist/chunks/{ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-C8wD6gZS.js → ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-CjJ3e53H.js} +12 -13
  72. package/dist/chunks/ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-m9hkScAC.js +1 -0
  73. package/dist/chunks/apply-element-plus-theme-DdN9KOhk.js +1 -0
  74. package/dist/chunks/apply-element-plus-theme-UHVxP4VN.js +22 -0
  75. package/dist/chunks/aria-B5rZ0WFy.js +5 -0
  76. package/dist/chunks/aria-BEkkcjlH.js +115 -0
  77. package/dist/chunks/constant-Bq4ASE9Q.js +1 -0
  78. package/dist/chunks/{constant-BqK1UnfT.js → constant-E83OJqPQ.js} +17 -36
  79. package/dist/chunks/debounce-CHS-N31c.js +1 -0
  80. package/dist/chunks/debounce-DBq5TVsN.js +55 -0
  81. package/dist/chunks/{el-loading-CBXyo6la.js → directive-C-4KkhaM.js} +2 -2
  82. package/dist/chunks/directive-DRO4tFsQ.js +1 -0
  83. package/dist/chunks/index-03UF6hCZ.js +14 -0
  84. package/dist/chunks/index-B6SD5IcP.js +1 -0
  85. package/dist/chunks/{index-DHO_7w-5.js → index-BCQYbM-I.js} +22 -22
  86. package/dist/chunks/{el-input-DCpRXscw.js → index-BdloQTv1.js} +171 -175
  87. package/dist/chunks/{el-overlay-BJQjrf5W.js → index-BeskO4C8.js} +76 -75
  88. package/dist/chunks/index-BoFuR9-k.js +2 -0
  89. package/dist/chunks/index-Bs9zhLlD.js +1 -0
  90. package/dist/chunks/index-C-WIOEu8.js +1 -0
  91. package/dist/chunks/index-CD-vLVPt.js +1 -0
  92. package/dist/chunks/index-CD4bijv7.js +1 -0
  93. package/dist/chunks/index-CHRyd-8X.js +1 -0
  94. package/dist/chunks/{el-button-Dh7ROB0R.js → index-CgKiWbxR.js} +110 -117
  95. package/dist/chunks/{el-popper-zUql4Vp-.js → index-Cv_K9rbv.js} +47 -46
  96. package/dist/chunks/{el-select-Dil0JEvg.js → index-Cyrc4mj-.js} +467 -492
  97. package/dist/chunks/index-DLBjU25P.js +3 -0
  98. package/dist/chunks/index-DgwQEHlD.js +12 -0
  99. package/dist/chunks/index-LWCtnbZP.js +13 -0
  100. package/dist/chunks/index-OtE8c8y9.js +1 -0
  101. package/dist/chunks/index-Qzqd5jTh.js +1 -0
  102. package/dist/chunks/index-VbRYJz2E.js +1 -0
  103. package/dist/chunks/index-YiSmXvH8.js +975 -0
  104. package/dist/chunks/{index-Dq3Y5qiS.js → index-_At9ftZd.js} +35 -35
  105. package/dist/chunks/{index-Cw_w6CLf.js → index-ieQ_IULW.js} +11 -11
  106. package/dist/chunks/{el-form-item-CXLLocXw.js → index-mDs-Bipv.js} +151 -150
  107. package/dist/chunks/mapSetting-B1a88k-v.js +635 -0
  108. package/dist/chunks/mapSetting-Ba76lOJd.js +1 -0
  109. package/dist/chunks/{base-DfCoKyyG.js → style-COMeMpO8.js} +81 -80
  110. package/dist/chunks/{base-DK_JFP90.js → style-DiDWGUIe.js} +1 -1
  111. package/dist/chunks/toNumber-CCcOx5KD.js +1 -0
  112. package/dist/chunks/toNumber-CDwzVyqL.js +30 -0
  113. package/dist/chunks/use-form-common-props-BQtZKazE.js +66 -0
  114. package/dist/chunks/use-form-common-props-SdGVhyVk.js +1 -0
  115. package/dist/chunks/{use-global-config-DXAWJFeA.js → use-global-config-Ba3i7fKX.js} +18 -17
  116. package/dist/chunks/use-global-config-PaSl-b_9.js +1 -0
  117. package/dist/chunks/utils-BJ8Lu8TY.js +516 -0
  118. package/dist/chunks/utils-CrwGKkIz.js +1 -0
  119. package/dist/chunks/vnode-CvqQoLhR.js +1 -0
  120. package/dist/chunks/vnode-DpjFDm4v.js +70 -0
  121. package/dist/element-plus-style.cjs +1 -0
  122. package/dist/element-plus-style.mjs +1 -0
  123. package/dist/index.cjs +1 -1
  124. package/dist/index.mjs +13 -10
  125. package/dist/manageTable/ReplaceSpeciesNameDialog.cjs +1 -1
  126. package/dist/manageTable/ReplaceSpeciesNameDialog.mjs +1 -1
  127. package/dist/manageTable/index.cjs +1 -1
  128. package/dist/manageTable/index.mjs +10 -8
  129. package/dist/manageTable/manageTable.cjs +1 -1
  130. package/dist/manageTable/manageTable.mjs +1 -1
  131. package/dist/mapbox/components/VideoDialog.cjs +1 -1
  132. package/dist/mapbox/components/VideoDialog.mjs +16 -17
  133. package/dist/mapbox/widgets/LayerAttributeDialog.cjs +1 -1
  134. package/dist/mapbox/widgets/LayerAttributeDialog.mjs +30 -31
  135. package/dist/mapbox.cjs +1 -1
  136. package/dist/mapbox.mjs +22 -20
  137. package/dist/mapboxV2/MapView.cjs +1 -1
  138. package/dist/mapboxV2/MapView.mjs +3728 -1256
  139. package/dist/mapboxV2/components/MapLegend.cjs +1 -1
  140. package/dist/mapboxV2/components/MapLegend.mjs +51 -167
  141. package/dist/mapboxV2/components/MapTools.cjs +1 -1
  142. package/dist/mapboxV2/components/MapTools.mjs +1 -1
  143. package/dist/mapboxV2/components/VideoDialog.cjs +1 -1
  144. package/dist/mapboxV2/components/VideoDialog.mjs +12 -13
  145. package/dist/mapboxV2/components/mapSetting.cjs +1 -1
  146. package/dist/mapboxV2/components/mapSetting.mjs +1 -1
  147. package/dist/mapboxV2/components/mapTopic.cjs +1 -1
  148. package/dist/mapboxV2/components/mapTopic.mjs +349 -446
  149. package/dist/mapboxV2/constant.cjs +1 -1
  150. package/dist/mapboxV2/constant.mjs +13 -17
  151. package/dist/mapboxV2/useTif.cjs +1 -1
  152. package/dist/mapboxV2/useTif.mjs +86 -86
  153. package/dist/mapboxV2/utils.cjs +1 -1
  154. package/dist/mapboxV2/utils.mjs +362 -279
  155. package/dist/mapboxV2/widgets/CustomShapeDialog.cjs +1 -1
  156. package/dist/mapboxV2/widgets/CustomShapeDialog.mjs +87 -67
  157. package/dist/mapboxV2/widgets/IconPicker.cjs +1 -1
  158. package/dist/mapboxV2/widgets/IconPicker.mjs +59 -48
  159. package/dist/mapboxV2/widgets/LayerAttributeDialog.cjs +1 -1
  160. package/dist/mapboxV2/widgets/LayerAttributeDialog.mjs +17 -18
  161. package/dist/mapboxV2/widgets/LayerDialog.cjs +1 -1
  162. package/dist/mapboxV2/widgets/LayerDialog.mjs +94 -86
  163. package/dist/mapboxV2/widgets/LegendDialogLine.cjs +1 -1
  164. package/dist/mapboxV2/widgets/LegendDialogLine.mjs +95 -90
  165. package/dist/mapboxV2/widgets/LegendDialogPoint.cjs +1 -1
  166. package/dist/mapboxV2/widgets/LegendDialogPoint.mjs +90 -85
  167. package/dist/mapboxV2/widgets/LegendLine.cjs +1 -1
  168. package/dist/mapboxV2/widgets/LegendLine.mjs +28 -61
  169. package/dist/mapboxV2/widgets/LegendPoint.cjs +1 -1
  170. package/dist/mapboxV2/widgets/LegendPoint.mjs +52 -66
  171. package/dist/mapboxV2/widgets/LegendPopInterestPoint.cjs +1 -1
  172. package/dist/mapboxV2/widgets/LegendPopInterestPoint.mjs +16 -18
  173. package/dist/mapboxV2/widgets/LegendPopLine.cjs +1 -1
  174. package/dist/mapboxV2/widgets/LegendPopLine.mjs +72 -73
  175. package/dist/mapboxV2/widgets/LegendPopPoint.cjs +1 -1
  176. package/dist/mapboxV2/widgets/LegendPopPoint.mjs +113 -112
  177. package/dist/mapboxV2/widgets/LegendShape.cjs +1 -1
  178. package/dist/mapboxV2/widgets/LegendShape.mjs +17 -14
  179. package/dist/mapboxV2/widgets/LegendSymbol.cjs +1 -1
  180. package/dist/mapboxV2/widgets/LegendSymbol.mjs +5 -5
  181. package/dist/mapboxV2/widgets/ShapeDialog.cjs +1 -1
  182. package/dist/mapboxV2/widgets/ShapeDialog.mjs +1663 -1422
  183. package/dist/mapboxV2/widgets/TopicItemPop.cjs +1 -1
  184. package/dist/mapboxV2/widgets/TopicItemPop.mjs +2 -2
  185. package/dist/mapboxV2/widgets/TopicPop.mjs +1 -1
  186. package/dist/mapboxV2.cjs +3 -3
  187. package/dist/mapboxV2.mjs +673 -824
  188. package/dist/qy-vue-plugins.css +1 -1
  189. package/dist/types/apply-element-plus-theme.d.ts +1 -0
  190. package/dist/types/element-plus-style.d.ts +0 -0
  191. package/dist/types/manageTable/manageTable.vue.d.ts +2 -2
  192. package/dist/types/mapboxV2/MapView.vue.d.ts +130 -3
  193. package/dist/types/mapboxV2/components/mapTopic.vue.d.ts +10 -591
  194. package/dist/types/mapboxV2/types/map-layer.d.ts +185 -3
  195. package/dist/types/mapboxV2/useTif.d.ts +2 -2
  196. package/dist/types/mapboxV2/utils/geojsonRenderer.d.ts +123 -0
  197. package/dist/types/mapboxV2/utils.d.ts +5 -0
  198. package/dist/types/mapboxV2/widgets/IconPicker.vue.d.ts +8 -10
  199. package/dist/types/mapboxV2/widgets/index.d.ts +3 -0
  200. package/dist/types/mapboxV2/widgets/track/TrackImageDialog.vue.d.ts +11 -0
  201. package/dist/types/mapboxV2/widgets/track/TrackTextDialog.vue.d.ts +11 -0
  202. package/dist/types/mapboxV2/widgets/track/TrackVoiceDialog.vue.d.ts +11 -0
  203. package/dist/types/mapboxV2/widgets/track/index.d.ts +3 -0
  204. package/dist/types/store/mapStore.d.ts +122 -0
  205. package/dist/types/types/map.d.ts +111 -7
  206. package/package/apply-element-plus-theme.ts +23 -0
  207. package/package/css/common.scss +33 -0
  208. package/package/css/element-plus-theme.scss +30 -0
  209. package/package/css/map.scss +42 -0
  210. package/package/element-plus-style.ts +48 -0
  211. package/package/manageTable/index.ts +5 -0
  212. package/package/mapbox/index.ts +5 -0
  213. package/package/mapboxV2/constant.ts +4 -12
  214. package/package/mapboxV2/index.ts +5 -0
  215. package/package/mapboxV2/useTif.ts +18 -13
  216. package/package/mapboxV2/utils.ts +303 -143
  217. package/package/mapboxV2/widgets/index.ts +5 -0
  218. package/package/types/map.ts +129 -32
  219. package/package.json +27 -3
  220. package/dist/chunks/ReplaceSpeciesNameDialog.vue_vue_type_script_setup_true_lang-DnYed7Kh.js +0 -1
  221. package/dist/chunks/aria-B-Cm8P6h.js +0 -5
  222. package/dist/chunks/aria-GiGFrmP1.js +0 -175
  223. package/dist/chunks/constant-mXEWtcQf.js +0 -1
  224. package/dist/chunks/el-button-w9UOZkmd.js +0 -3
  225. package/dist/chunks/el-color-picker-panel-BWjyXHBz.js +0 -1
  226. package/dist/chunks/el-color-picker-panel-BfOVWDkH.js +0 -1024
  227. package/dist/chunks/el-form-item-ECXS8pAs.js +0 -12
  228. package/dist/chunks/el-input-tAiZBp5N.js +0 -1
  229. package/dist/chunks/el-loading-BDhLUhme.js +0 -1
  230. package/dist/chunks/el-overlay-BEd31jh6.js +0 -1
  231. package/dist/chunks/el-popper-C6hJmTeX.js +0 -1
  232. package/dist/chunks/el-select-BXP0YqqB.js +0 -1
  233. package/dist/chunks/index-BIPr63lF.js +0 -1
  234. package/dist/chunks/index-BIaoqnN4.js +0 -1
  235. package/dist/chunks/index-D9eecDRK.js +0 -2
  236. package/dist/chunks/mapSetting-BRasGCqk.js +0 -597
  237. package/dist/chunks/mapSetting-CfE-5SCc.js +0 -1
  238. package/dist/chunks/use-global-config-y6gk28OO.js +0 -1
  239. package/dist/chunks/utils-CZxmwfl_.js +0 -1
  240. package/dist/chunks/utils-n1i0zWzc.js +0 -454
  241. package/dist/chunks/vnode-CyTnPoXJ.js +0 -47
  242. package/dist/chunks/vnode-eKMqbqaC.js +0 -1
  243. package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-BRUTHTNe.js +0 -12
  244. package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-CksusXxb.js +0 -28
  245. package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-DchJeGnp.js +0 -1
  246. package/dist/chunks//346/255/243/344/270/211/350/247/222/345/275/242-yXKDlNvO.js +0 -17
@@ -0,0 +1,975 @@
1
+ import { getCurrentInstance as te, shallowRef as _e, computed as k, ref as P, onMounted as de, watch as D, defineComponent as A, createElementBlock as M, openBlock as B, normalizeClass as w, unref as a, createElementVNode as $, normalizeStyle as I, inject as Ae, watchEffect as oa, Fragment as ra, renderList as na, reactive as sa, nextTick as W, provide as Le, createBlock as ee, createCommentVNode as ke, createVNode as T, renderSlot as ia, withCtx as O, mergeProps as ye, withDirectives as re, vShow as Ce, withKeys as ca, createTextVNode as we, toDisplayString as Ee } from "vue";
2
+ import { _ as H, U as N, w as De, C as ce, E as Se } from "./aria-BEkkcjlH.js";
3
+ import { isClient as ua, reactiveComputed as da } from "@vueuse/core";
4
+ import { u as G, E as fa } from "./index-Cv_K9rbv.js";
5
+ import { T as J, E as Pe } from "./index-CgKiWbxR.js";
6
+ import { ArrowDown as va, Close as ha } from "@element-plus/icons-vue";
7
+ import { q, s as F, u as X, w as ae, c as Q, v as Z, D as Ke, d as Y, t as pa } from "./style-COMeMpO8.js";
8
+ import { u as j, b as ba, c as ma } from "./index-_At9ftZd.js";
9
+ import { u as ga, a as _a, p as ka } from "./index-BCQYbM-I.js";
10
+ import { E as ya } from "./index-BdloQTv1.js";
11
+ import { g as fe, E as K } from "./index-ieQ_IULW.js";
12
+ import { b as Be, a as Re, u as Ca, c as wa } from "./use-form-common-props-BQtZKazE.js";
13
+ import { C as Ea } from "./index-Cyrc4mj-.js";
14
+ import { d as Sa } from "./debounce-DBq5TVsN.js";
15
+ const Te = q({
16
+ color: {
17
+ type: F(Object),
18
+ required: !0
19
+ },
20
+ vertical: Boolean,
21
+ disabled: Boolean
22
+ }), Pa = Te;
23
+ let ne = !1;
24
+ function ue(e, o) {
25
+ if (!ua)
26
+ return;
27
+ const l = function(t) {
28
+ var n;
29
+ (n = o.drag) == null || n.call(o, t);
30
+ }, r = function(t) {
31
+ var n;
32
+ document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", r), document.removeEventListener("touchmove", l), document.removeEventListener("touchend", r), document.onselectstart = null, document.ondragstart = null, ne = !1, (n = o.end) == null || n.call(o, t);
33
+ }, i = function(t) {
34
+ var n;
35
+ ne || (document.onselectstart = () => !1, document.ondragstart = () => !1, document.addEventListener("mousemove", l), document.addEventListener("mouseup", r), document.addEventListener("touchmove", l), document.addEventListener("touchend", r), ne = !0, (n = o.start) == null || n.call(o, t));
36
+ };
37
+ e.addEventListener("mousedown", i), e.addEventListener("touchstart", i, { passive: !1 });
38
+ }
39
+ const Fe = (e) => {
40
+ let o, l;
41
+ return e.type === "touchend" ? (l = e.changedTouches[0].clientY, o = e.changedTouches[0].clientX) : e.type.startsWith("touch") ? (l = e.touches[0].clientY, o = e.touches[0].clientX) : (l = e.clientY, o = e.clientX), {
42
+ clientX: o,
43
+ clientY: l
44
+ };
45
+ }, Oe = (e, { key: o, minValue: l, maxValue: r }) => {
46
+ const i = te(), t = _e(), n = _e(), p = k(() => e.color.get(o));
47
+ function m(u) {
48
+ var _;
49
+ if (e.disabled)
50
+ return;
51
+ u.target !== t.value && g(u), (_ = t.value) == null || _.focus();
52
+ }
53
+ function g(u) {
54
+ if (!n.value || !t.value || e.disabled)
55
+ return;
56
+ const v = i.vnode.el.getBoundingClientRect(), { clientX: d, clientY: s } = Fe(u);
57
+ let h;
58
+ if (e.vertical) {
59
+ let f = s - v.top;
60
+ f = Math.max(t.value.offsetHeight / 2, f), f = Math.min(f, v.height - t.value.offsetHeight / 2), h = Math.round((f - t.value.offsetHeight / 2) / (v.height - t.value.offsetHeight) * r);
61
+ } else {
62
+ let f = d - v.left;
63
+ f = Math.max(t.value.offsetWidth / 2, f), f = Math.min(f, v.width - t.value.offsetWidth / 2), h = Math.round((f - t.value.offsetWidth / 2) / (v.width - t.value.offsetWidth) * r);
64
+ }
65
+ e.color.set(o, h);
66
+ }
67
+ function y(u) {
68
+ if (e.disabled)
69
+ return;
70
+ const { shiftKey: _ } = u, v = fe(u), d = _ ? 10 : 1, s = o === "hue" ? -1 : 1;
71
+ let h = !0;
72
+ switch (v) {
73
+ case K.left:
74
+ case K.down:
75
+ b(-d * s);
76
+ break;
77
+ case K.right:
78
+ case K.up:
79
+ b(d * s);
80
+ break;
81
+ case K.home:
82
+ e.color.set(o, o === "hue" ? r : l);
83
+ break;
84
+ case K.end:
85
+ e.color.set(o, o === "hue" ? l : r);
86
+ break;
87
+ case K.pageDown:
88
+ b(-4 * s);
89
+ break;
90
+ case K.pageUp:
91
+ b(4 * s);
92
+ break;
93
+ default:
94
+ h = !1;
95
+ break;
96
+ }
97
+ h && u.preventDefault();
98
+ }
99
+ function b(u) {
100
+ let _ = p.value + u;
101
+ _ = _ < l ? l : _ > r ? r : _, e.color.set(o, _);
102
+ }
103
+ return {
104
+ thumb: t,
105
+ bar: n,
106
+ currentValue: p,
107
+ handleDrag: g,
108
+ handleClick: m,
109
+ handleKeydown: y
110
+ };
111
+ }, Me = (e, {
112
+ namespace: o,
113
+ maxValue: l,
114
+ bar: r,
115
+ thumb: i,
116
+ currentValue: t,
117
+ handleDrag: n,
118
+ getBackground: p
119
+ }) => {
120
+ const m = te(), g = X(o), y = P(0), b = P(0), u = P();
121
+ function _() {
122
+ if (!i.value || e.vertical)
123
+ return 0;
124
+ const V = m.vnode.el, R = t.value;
125
+ return V ? Math.round(R * (V.offsetWidth - i.value.offsetWidth / 2) / l) : 0;
126
+ }
127
+ function v() {
128
+ if (!i.value)
129
+ return 0;
130
+ const V = m.vnode.el;
131
+ if (!e.vertical)
132
+ return 0;
133
+ const R = t.value;
134
+ return V ? Math.round(R * (V.offsetHeight - i.value.offsetHeight / 2) / l) : 0;
135
+ }
136
+ function d() {
137
+ y.value = _(), b.value = v(), u.value = p?.();
138
+ }
139
+ de(() => {
140
+ if (!r.value || !i.value)
141
+ return;
142
+ const V = {
143
+ drag: (R) => {
144
+ n(R);
145
+ },
146
+ end: (R) => {
147
+ n(R);
148
+ }
149
+ };
150
+ ue(r.value, V), ue(i.value, V), d();
151
+ }), D(t, () => d()), D(() => e.color.value, () => d());
152
+ const s = k(() => [
153
+ g.b(),
154
+ g.is("vertical", e.vertical),
155
+ g.is("disabled", e.disabled)
156
+ ]), h = k(() => g.e("bar")), f = k(() => g.e("thumb")), C = k(() => ({ background: u.value })), E = k(() => ({
157
+ left: ae(y.value),
158
+ top: ae(b.value)
159
+ }));
160
+ return {
161
+ rootKls: s,
162
+ barKls: h,
163
+ barStyle: C,
164
+ thumbKls: f,
165
+ thumbStyle: E,
166
+ thumbLeft: y,
167
+ thumbTop: b,
168
+ update: d
169
+ };
170
+ }, Ve = 0, se = 100, Ka = A({
171
+ name: "ElColorAlphaSlider"
172
+ }), Va = /* @__PURE__ */ A({
173
+ ...Ka,
174
+ props: Te,
175
+ setup(e, { expose: o }) {
176
+ const l = e, { currentValue: r, bar: i, thumb: t, handleDrag: n, handleClick: p, handleKeydown: m } = Oe(l, { key: "alpha", minValue: Ve, maxValue: se }), { rootKls: g, barKls: y, barStyle: b, thumbKls: u, thumbStyle: _, update: v } = Me(l, {
177
+ namespace: "color-alpha-slider",
178
+ maxValue: se,
179
+ currentValue: r,
180
+ bar: i,
181
+ thumb: t,
182
+ handleDrag: n,
183
+ getBackground: f
184
+ }), { t: d } = j(), s = k(() => d("el.colorpicker.alphaLabel")), h = k(() => d("el.colorpicker.alphaDescription", {
185
+ alpha: r.value,
186
+ color: l.color.value
187
+ }));
188
+ function f() {
189
+ if (l.color && l.color.value) {
190
+ const { r: C, g: E, b: V } = l.color.toRgb();
191
+ return `linear-gradient(to right, rgba(${C}, ${E}, ${V}, 0) 0%, rgba(${C}, ${E}, ${V}, 1) 100%)`;
192
+ }
193
+ return "";
194
+ }
195
+ return o({
196
+ update: v,
197
+ bar: i,
198
+ thumb: t
199
+ }), (C, E) => (B(), M("div", {
200
+ class: w(a(g))
201
+ }, [
202
+ $("div", {
203
+ ref_key: "bar",
204
+ ref: i,
205
+ class: w(a(y)),
206
+ style: I(a(b)),
207
+ onClick: a(p)
208
+ }, null, 14, ["onClick"]),
209
+ $("div", {
210
+ ref_key: "thumb",
211
+ ref: t,
212
+ class: w(a(u)),
213
+ style: I(a(_)),
214
+ "aria-label": a(s),
215
+ "aria-valuenow": a(r),
216
+ "aria-valuetext": a(h),
217
+ "aria-orientation": C.vertical ? "vertical" : "horizontal",
218
+ "aria-valuemin": Ve,
219
+ "aria-valuemax": se,
220
+ role: "slider",
221
+ tabindex: C.disabled ? void 0 : 0,
222
+ "aria-disabled": C.disabled,
223
+ onKeydown: a(m)
224
+ }, null, 46, ["aria-label", "aria-valuenow", "aria-valuetext", "aria-orientation", "tabindex", "aria-disabled", "onKeydown"])
225
+ ], 2));
226
+ }
227
+ });
228
+ var $a = /* @__PURE__ */ H(Va, [["__file", "alpha-slider.vue"]]);
229
+ const $e = 0, ie = 360, Aa = A({
230
+ name: "ElColorHueSlider"
231
+ }), La = /* @__PURE__ */ A({
232
+ ...Aa,
233
+ props: Pa,
234
+ setup(e, { expose: o }) {
235
+ const l = e, { currentValue: r, bar: i, thumb: t, handleDrag: n, handleClick: p, handleKeydown: m } = Oe(l, { key: "hue", minValue: $e, maxValue: ie }), { rootKls: g, barKls: y, thumbKls: b, thumbStyle: u, thumbTop: _, update: v } = Me(l, {
236
+ namespace: "color-hue-slider",
237
+ maxValue: ie,
238
+ currentValue: r,
239
+ bar: i,
240
+ thumb: t,
241
+ handleDrag: n
242
+ }), { t: d } = j(), s = k(() => d("el.colorpicker.hueLabel")), h = k(() => d("el.colorpicker.hueDescription", {
243
+ hue: r.value,
244
+ color: l.color.value
245
+ }));
246
+ return o({
247
+ bar: i,
248
+ thumb: t,
249
+ thumbTop: _,
250
+ update: v
251
+ }), (f, C) => (B(), M("div", {
252
+ class: w(a(g))
253
+ }, [
254
+ $("div", {
255
+ ref_key: "bar",
256
+ ref: i,
257
+ class: w(a(y)),
258
+ onClick: a(p)
259
+ }, null, 10, ["onClick"]),
260
+ $("div", {
261
+ ref_key: "thumb",
262
+ ref: t,
263
+ class: w(a(b)),
264
+ style: I(a(u)),
265
+ "aria-label": a(s),
266
+ "aria-valuenow": a(r),
267
+ "aria-valuetext": a(h),
268
+ "aria-orientation": f.vertical ? "vertical" : "horizontal",
269
+ "aria-valuemin": $e,
270
+ "aria-valuemax": ie,
271
+ role: "slider",
272
+ tabindex: f.disabled ? void 0 : 0,
273
+ "aria-disabled": f.disabled,
274
+ onKeydown: a(m)
275
+ }, null, 46, ["aria-label", "aria-valuenow", "aria-valuetext", "aria-orientation", "tabindex", "aria-disabled", "onKeydown"])
276
+ ], 2));
277
+ }
278
+ });
279
+ var Da = /* @__PURE__ */ H(La, [["__file", "hue-slider.vue"]]);
280
+ const Ba = q({
281
+ colors: {
282
+ type: F(Array),
283
+ required: !0
284
+ },
285
+ color: {
286
+ type: F(Object),
287
+ required: !0
288
+ },
289
+ enableAlpha: {
290
+ type: Boolean,
291
+ required: !0
292
+ },
293
+ disabled: Boolean
294
+ }), Ie = q({
295
+ modelValue: {
296
+ type: F(String),
297
+ default: void 0
298
+ },
299
+ border: {
300
+ type: Boolean,
301
+ default: !0
302
+ },
303
+ showAlpha: Boolean,
304
+ colorFormat: String,
305
+ disabled: Boolean,
306
+ predefine: {
307
+ type: F(Array)
308
+ },
309
+ validateEvent: {
310
+ type: Boolean,
311
+ default: !0
312
+ }
313
+ }), Ra = {
314
+ [N]: (e) => Q(e) || Z(e)
315
+ }, xe = Symbol("colorCommonPickerKey"), Ne = Symbol("colorPickerPanelContextKey");
316
+ class le {
317
+ constructor(o = {}) {
318
+ this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this._tiny = new J(), this._isValid = !1, this.enableAlpha = !1, this.format = "", this.value = "";
319
+ for (const l in o)
320
+ Ke(o, l) && (this[l] = o[l]);
321
+ o.value ? this.fromString(o.value) : this.doOnChange();
322
+ }
323
+ set(o, l) {
324
+ if (arguments.length === 1 && typeof o == "object") {
325
+ for (const r in o)
326
+ Ke(o, r) && this.set(r, o[r]);
327
+ return;
328
+ }
329
+ this[`_${o}`] = l, this._isValid = !0, this.doOnChange();
330
+ }
331
+ get(o) {
332
+ return ["hue", "saturation", "value", "alpha"].includes(o) ? Math.round(this[`_${o}`]) : this[`_${o}`];
333
+ }
334
+ toRgb() {
335
+ return this._isValid ? this._tiny.toRgb() : { r: 255, g: 255, b: 255, a: 0 };
336
+ }
337
+ fromString(o) {
338
+ const l = new J(o);
339
+ if (this._isValid = l.isValid, l.isValid) {
340
+ const { h: r, s: i, v: t, a: n } = l.toHsv();
341
+ this._hue = r, this._saturation = i * 100, this._value = t * 100, this._alpha = n * 100;
342
+ } else
343
+ this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100;
344
+ this.doOnChange();
345
+ }
346
+ clear() {
347
+ this._isValid = !1, this.value = "", this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100;
348
+ }
349
+ compare(o) {
350
+ const l = new J({
351
+ h: o._hue,
352
+ s: o._saturation / 100,
353
+ v: o._value / 100,
354
+ a: o._alpha / 100
355
+ });
356
+ return this._tiny.equals(l);
357
+ }
358
+ doOnChange() {
359
+ const { _hue: o, _saturation: l, _value: r, _alpha: i, format: t, enableAlpha: n } = this;
360
+ let p = t || (n ? "rgb" : "hex");
361
+ t === "hex" && n && (p = "hex8"), this._tiny = new J({
362
+ h: o,
363
+ s: l / 100,
364
+ v: r / 100,
365
+ a: i / 100
366
+ }), this.value = this._isValid ? this._tiny.toString(p) : "";
367
+ }
368
+ }
369
+ const Ta = (e) => {
370
+ const { currentColor: o } = Ae(Ne), l = P(i(e.colors, e.color));
371
+ D(() => o.value, (t) => {
372
+ const n = new le({
373
+ value: t,
374
+ enableAlpha: e.enableAlpha
375
+ });
376
+ l.value.forEach((p) => {
377
+ p.selected = n.compare(p);
378
+ });
379
+ }), oa(() => {
380
+ l.value = i(e.colors, e.color);
381
+ });
382
+ function r(t) {
383
+ e.color.fromString(e.colors[t]);
384
+ }
385
+ function i(t, n) {
386
+ return t.map((p) => {
387
+ const m = new le({
388
+ value: p,
389
+ enableAlpha: e.enableAlpha
390
+ });
391
+ return m.selected = m.compare(n), m;
392
+ });
393
+ }
394
+ return {
395
+ rgbaColors: l,
396
+ handleSelect: r
397
+ };
398
+ }, Fa = (e) => {
399
+ const o = X("color-predefine"), l = k(() => [o.b(), o.is("disabled", e.disabled)]), r = k(() => o.e("colors"));
400
+ function i(t) {
401
+ return [
402
+ o.e("color-selector"),
403
+ o.is("alpha", t.get("alpha") < 100),
404
+ { selected: t.selected }
405
+ ];
406
+ }
407
+ return {
408
+ rootKls: l,
409
+ colorsKls: r,
410
+ colorSelectorKls: i
411
+ };
412
+ }, Oa = A({
413
+ name: "ElColorPredefine"
414
+ }), Ma = /* @__PURE__ */ A({
415
+ ...Oa,
416
+ props: Ba,
417
+ setup(e) {
418
+ const o = e, { rgbaColors: l, handleSelect: r } = Ta(o), { rootKls: i, colorsKls: t, colorSelectorKls: n } = Fa(o), { t: p } = j(), m = (g) => p("el.colorpicker.predefineDescription", { value: g });
419
+ return (g, y) => (B(), M("div", {
420
+ class: w(a(i))
421
+ }, [
422
+ $("div", {
423
+ class: w(a(t))
424
+ }, [
425
+ (B(!0), M(ra, null, na(a(l), (b, u) => (B(), M("button", {
426
+ key: g.colors[u],
427
+ type: "button",
428
+ disabled: g.disabled,
429
+ "aria-label": m(b.value),
430
+ class: w(a(n)(b)),
431
+ onClick: (_) => a(r)(u)
432
+ }, [
433
+ $("div", {
434
+ style: I({ backgroundColor: b.value })
435
+ }, null, 4)
436
+ ], 10, ["disabled", "aria-label", "onClick"]))), 128))
437
+ ], 2)
438
+ ], 2));
439
+ }
440
+ });
441
+ var Ia = /* @__PURE__ */ H(Ma, [["__file", "predefine.vue"]]);
442
+ const xa = q({
443
+ color: {
444
+ type: F(Object),
445
+ required: !0
446
+ },
447
+ disabled: Boolean
448
+ }), Na = (e) => {
449
+ const o = te(), l = P(), r = P(0), i = P(0), t = P("hsl(0, 100%, 50%)"), n = k(() => e.color.get("saturation")), p = k(() => e.color.get("value")), m = k(() => e.color.get("hue"));
450
+ function g(v) {
451
+ var d;
452
+ if (e.disabled)
453
+ return;
454
+ v.target !== l.value && y(v), (d = l.value) == null || d.focus({ preventScroll: !0 });
455
+ }
456
+ function y(v) {
457
+ if (e.disabled)
458
+ return;
459
+ const s = o.vnode.el.getBoundingClientRect(), { clientX: h, clientY: f } = Fe(v);
460
+ let C = h - s.left, E = f - s.top;
461
+ C = Math.max(0, C), C = Math.min(C, s.width), E = Math.max(0, E), E = Math.min(E, s.height), i.value = C, r.value = E, e.color.set({
462
+ saturation: C / s.width * 100,
463
+ value: 100 - E / s.height * 100
464
+ });
465
+ }
466
+ function b(v) {
467
+ if (e.disabled)
468
+ return;
469
+ const { shiftKey: d } = v, s = fe(v), h = d ? 10 : 1;
470
+ let f = !0;
471
+ switch (s) {
472
+ case K.left:
473
+ u(-h);
474
+ break;
475
+ case K.right:
476
+ u(h);
477
+ break;
478
+ case K.up:
479
+ _(h);
480
+ break;
481
+ case K.down:
482
+ _(-h);
483
+ break;
484
+ default:
485
+ f = !1;
486
+ break;
487
+ }
488
+ f && v.preventDefault();
489
+ }
490
+ function u(v) {
491
+ let d = n.value + v;
492
+ d = d < 0 ? 0 : d > 100 ? 100 : d, e.color.set("saturation", d);
493
+ }
494
+ function _(v) {
495
+ let d = p.value + v;
496
+ d = d < 0 ? 0 : d > 100 ? 100 : d, e.color.set("value", d);
497
+ }
498
+ return {
499
+ cursorRef: l,
500
+ cursorTop: r,
501
+ cursorLeft: i,
502
+ background: t,
503
+ saturation: n,
504
+ brightness: p,
505
+ hue: m,
506
+ handleClick: g,
507
+ handleDrag: y,
508
+ handleKeydown: b
509
+ };
510
+ }, Ha = (e, {
511
+ cursorTop: o,
512
+ cursorLeft: l,
513
+ background: r,
514
+ handleDrag: i
515
+ }) => {
516
+ const t = te(), n = X("color-svpanel");
517
+ function p() {
518
+ const u = e.color.get("saturation"), _ = e.color.get("value"), v = t.vnode.el, { clientWidth: d, clientHeight: s } = v;
519
+ l.value = u * d / 100, o.value = (100 - _) * s / 100, r.value = `hsl(${e.color.get("hue")}, 100%, 50%)`;
520
+ }
521
+ de(() => {
522
+ ue(t.vnode.el, {
523
+ drag: (u) => {
524
+ i(u);
525
+ },
526
+ end: (u) => {
527
+ i(u);
528
+ }
529
+ }), p();
530
+ }), D([
531
+ () => e.color.get("hue"),
532
+ () => e.color.get("value"),
533
+ () => e.color.value
534
+ ], () => p());
535
+ const m = k(() => n.b()), g = k(() => n.e("cursor")), y = k(() => ({
536
+ backgroundColor: r.value
537
+ })), b = k(() => ({
538
+ top: ae(o.value),
539
+ left: ae(l.value)
540
+ }));
541
+ return {
542
+ rootKls: m,
543
+ cursorKls: g,
544
+ rootStyle: y,
545
+ cursorStyle: b,
546
+ update: p
547
+ };
548
+ }, za = A({
549
+ name: "ElSvPanel"
550
+ }), Wa = /* @__PURE__ */ A({
551
+ ...za,
552
+ props: xa,
553
+ setup(e, { expose: o }) {
554
+ const l = e, {
555
+ cursorRef: r,
556
+ cursorTop: i,
557
+ cursorLeft: t,
558
+ background: n,
559
+ saturation: p,
560
+ brightness: m,
561
+ handleClick: g,
562
+ handleDrag: y,
563
+ handleKeydown: b
564
+ } = Na(l), { rootKls: u, cursorKls: _, rootStyle: v, cursorStyle: d, update: s } = Ha(l, {
565
+ cursorTop: i,
566
+ cursorLeft: t,
567
+ background: n,
568
+ handleDrag: y
569
+ }), { t: h } = j(), f = k(() => h("el.colorpicker.svLabel")), C = k(() => h("el.colorpicker.svDescription", {
570
+ saturation: p.value,
571
+ brightness: m.value,
572
+ color: l.color.value
573
+ }));
574
+ return o({
575
+ update: s
576
+ }), (E, V) => (B(), M("div", {
577
+ class: w(a(u)),
578
+ style: I(a(v)),
579
+ onClick: a(g)
580
+ }, [
581
+ $("div", {
582
+ ref_key: "cursorRef",
583
+ ref: r,
584
+ class: w(a(_)),
585
+ style: I(a(d)),
586
+ tabindex: E.disabled ? void 0 : 0,
587
+ "aria-disabled": E.disabled,
588
+ role: "slider",
589
+ "aria-valuemin": "0,0",
590
+ "aria-valuemax": "100,100",
591
+ "aria-label": a(f),
592
+ "aria-valuenow": `${a(p)},${a(m)}`,
593
+ "aria-valuetext": a(C),
594
+ onKeydown: a(b)
595
+ }, null, 46, ["tabindex", "aria-disabled", "aria-label", "aria-valuenow", "aria-valuetext", "onKeydown"])
596
+ ], 14, ["onClick"]));
597
+ }
598
+ });
599
+ var Ya = /* @__PURE__ */ H(Wa, [["__file", "sv-panel.vue"]]);
600
+ const He = (e, o) => {
601
+ const l = sa(new le({
602
+ enableAlpha: e.showAlpha,
603
+ format: e.colorFormat || "",
604
+ value: e.modelValue
605
+ }));
606
+ return D(() => [e.colorFormat, e.showAlpha], () => {
607
+ l.enableAlpha = e.showAlpha, l.format = e.colorFormat || l.format, l.doOnChange(), o(N, l.value);
608
+ }), {
609
+ color: l
610
+ };
611
+ }, qa = A({
612
+ name: "ElColorPickerPanel"
613
+ }), Xa = /* @__PURE__ */ A({
614
+ ...qa,
615
+ props: Ie,
616
+ emits: Ra,
617
+ setup(e, { expose: o, emit: l }) {
618
+ const r = e, i = X("color-picker-panel"), { formItem: t } = Be(), n = Re(), p = P(), m = P(), g = P(), y = P(), b = P(""), { color: u } = Ae(xe, () => He(r, l), !0);
619
+ function _() {
620
+ u.fromString(b.value), u.value !== b.value && (b.value = u.value);
621
+ }
622
+ function v() {
623
+ var s;
624
+ r.validateEvent && ((s = t?.validate) == null || s.call(t, "blur").catch((h) => Y(h)));
625
+ }
626
+ function d() {
627
+ var s, h, f;
628
+ (s = p.value) == null || s.update(), (h = m.value) == null || h.update(), (f = g.value) == null || f.update();
629
+ }
630
+ return de(() => {
631
+ r.modelValue && (b.value = u.value), W(d);
632
+ }), D(() => r.modelValue, (s) => {
633
+ s !== u.value && (s ? u.fromString(s) : u.clear());
634
+ }), D(() => u.value, (s) => {
635
+ l(N, s), b.value = s, r.validateEvent && t?.validate("change").catch((h) => Y(h));
636
+ }), Le(Ne, {
637
+ currentColor: k(() => u.value)
638
+ }), o({
639
+ color: u,
640
+ inputRef: y,
641
+ update: d
642
+ }), (s, h) => (B(), M("div", {
643
+ class: w([a(i).b(), a(i).is("disabled", a(n)), a(i).is("border", s.border)]),
644
+ onFocusout: v
645
+ }, [
646
+ $("div", {
647
+ class: w(a(i).e("wrapper"))
648
+ }, [
649
+ T(Da, {
650
+ ref_key: "hueRef",
651
+ ref: p,
652
+ class: "hue-slider",
653
+ color: a(u),
654
+ vertical: "",
655
+ disabled: a(n)
656
+ }, null, 8, ["color", "disabled"]),
657
+ T(Ya, {
658
+ ref_key: "svRef",
659
+ ref: m,
660
+ color: a(u),
661
+ disabled: a(n)
662
+ }, null, 8, ["color", "disabled"])
663
+ ], 2),
664
+ s.showAlpha ? (B(), ee($a, {
665
+ key: 0,
666
+ ref_key: "alphaRef",
667
+ ref: g,
668
+ color: a(u),
669
+ disabled: a(n)
670
+ }, null, 8, ["color", "disabled"])) : ke("v-if", !0),
671
+ s.predefine ? (B(), ee(Ia, {
672
+ key: 1,
673
+ ref: "predefine",
674
+ "enable-alpha": s.showAlpha,
675
+ color: a(u),
676
+ colors: s.predefine,
677
+ disabled: a(n)
678
+ }, null, 8, ["enable-alpha", "color", "colors", "disabled"])) : ke("v-if", !0),
679
+ $("div", {
680
+ class: w(a(i).e("footer"))
681
+ }, [
682
+ T(a(ya), {
683
+ ref_key: "inputRef",
684
+ ref: y,
685
+ modelValue: b.value,
686
+ "onUpdate:modelValue": (f) => b.value = f,
687
+ "validate-event": !1,
688
+ size: "small",
689
+ disabled: a(n),
690
+ onChange: _
691
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"]),
692
+ ia(s.$slots, "footer")
693
+ ], 2)
694
+ ], 34));
695
+ }
696
+ });
697
+ var ja = /* @__PURE__ */ H(Xa, [["__file", "color-picker-panel.vue"]]);
698
+ const Ua = De(ja), Ga = q({
699
+ persistent: {
700
+ type: Boolean,
701
+ default: !0
702
+ },
703
+ modelValue: {
704
+ type: F(String),
705
+ default: void 0
706
+ },
707
+ id: String,
708
+ showAlpha: Boolean,
709
+ colorFormat: String,
710
+ disabled: {
711
+ type: Boolean,
712
+ default: void 0
713
+ },
714
+ size: pa,
715
+ popperClass: G.popperClass,
716
+ popperStyle: G.popperStyle,
717
+ tabindex: {
718
+ type: [String, Number],
719
+ default: 0
720
+ },
721
+ teleported: G.teleported,
722
+ appendTo: G.appendTo,
723
+ predefine: {
724
+ type: F(Array)
725
+ },
726
+ validateEvent: {
727
+ type: Boolean,
728
+ default: !0
729
+ },
730
+ ...ba,
731
+ ...ga(["ariaLabel"])
732
+ }), Ja = {
733
+ [N]: (e) => Q(e) || Z(e),
734
+ [ce]: (e) => Q(e) || Z(e),
735
+ activeChange: (e) => Q(e) || Z(e),
736
+ focus: (e) => e instanceof FocusEvent,
737
+ blur: (e) => e instanceof FocusEvent
738
+ }, Qa = A({
739
+ name: "ElColorPicker"
740
+ }), Za = /* @__PURE__ */ A({
741
+ ...Qa,
742
+ props: Ga,
743
+ emits: Ja,
744
+ setup(e, { expose: o, emit: l }) {
745
+ const r = e, { t: i } = j(), t = X("color"), { formItem: n } = Be(), p = Ca(), m = Re(), { valueOnClear: g, isEmptyValue: y } = ma(r, null), b = He(r, l), { inputId: u, isLabeledByFormItem: _ } = wa(r, {
746
+ formItemContext: n
747
+ }), v = P(), d = P(), s = P(), h = P(!1), f = P(!1);
748
+ let C = !0;
749
+ const { isFocused: E, handleFocus: V, handleBlur: R } = _a(d, {
750
+ disabled: m,
751
+ beforeBlur(c) {
752
+ var S;
753
+ return (S = v.value) == null ? void 0 : S.isFocusInsideContent(c);
754
+ },
755
+ afterBlur() {
756
+ var c;
757
+ z(!1), x(), r.validateEvent && ((c = n?.validate) == null || c.call(n, "blur").catch((S) => Y(S)));
758
+ }
759
+ }), L = da(() => {
760
+ var c, S;
761
+ return (S = (c = s.value) == null ? void 0 : c.color) != null ? S : b.color;
762
+ }), ze = k(() => ka(r, Object.keys(Ie))), We = k(() => !r.modelValue && !f.value ? "transparent" : Ue(L, r.showAlpha)), Ye = k(() => !r.modelValue && !f.value ? "" : L.value), qe = k(() => _.value ? void 0 : r.ariaLabel || i("el.colorpicker.defaultLabel")), Xe = k(() => _.value ? n?.labelId : void 0), je = k(() => [
763
+ t.b("picker"),
764
+ t.is("disabled", m.value),
765
+ t.bm("picker", p.value),
766
+ t.is("focused", E.value)
767
+ ]);
768
+ function Ue(c, S) {
769
+ const { r: oe, g: me, b: ge, a: ta } = c.toRgb();
770
+ return S ? `rgba(${oe}, ${me}, ${ge}, ${ta})` : `rgb(${oe}, ${me}, ${ge})`;
771
+ }
772
+ function z(c) {
773
+ h.value = c;
774
+ }
775
+ const U = Sa(z, 100, { leading: !0 });
776
+ function ve() {
777
+ m.value || z(!0);
778
+ }
779
+ function he() {
780
+ U(!1), x();
781
+ }
782
+ function x() {
783
+ W(() => {
784
+ r.modelValue ? L.fromString(r.modelValue) : (L.value = "", W(() => {
785
+ f.value = !1;
786
+ }));
787
+ });
788
+ }
789
+ function Ge() {
790
+ m.value || (h.value && x(), U(!h.value));
791
+ }
792
+ function Je() {
793
+ const c = y(L.value) ? g.value : L.value;
794
+ l(N, c), l(ce, c), r.validateEvent && n?.validate("change").catch((S) => Y(S)), U(!1), W(() => {
795
+ const S = new le({
796
+ enableAlpha: r.showAlpha,
797
+ format: r.colorFormat || "",
798
+ value: r.modelValue
799
+ });
800
+ L.compare(S) || x();
801
+ });
802
+ }
803
+ function Qe() {
804
+ U(!1), l(N, g.value), l(ce, g.value), r.modelValue !== g.value && r.validateEvent && n?.validate("change").catch((c) => Y(c)), x();
805
+ }
806
+ function Ze() {
807
+ var c, S;
808
+ (S = (c = s?.value) == null ? void 0 : c.inputRef) == null || S.focus();
809
+ }
810
+ function ea() {
811
+ h.value && (he(), E.value && be());
812
+ }
813
+ function pe(c) {
814
+ c.preventDefault(), c.stopPropagation(), z(!1), x();
815
+ }
816
+ function aa(c) {
817
+ switch (fe(c)) {
818
+ case K.enter:
819
+ case K.numpadEnter:
820
+ case K.space:
821
+ c.preventDefault(), c.stopPropagation(), ve();
822
+ break;
823
+ case K.esc:
824
+ pe(c);
825
+ break;
826
+ }
827
+ }
828
+ function be() {
829
+ d.value.focus();
830
+ }
831
+ function la() {
832
+ d.value.blur();
833
+ }
834
+ return D(() => Ye.value, (c) => {
835
+ C && l("activeChange", c), C = !0;
836
+ }), D(() => L.value, () => {
837
+ !r.modelValue && !f.value && (f.value = !0);
838
+ }), D(() => r.modelValue, (c) => {
839
+ c ? c && c !== L.value && (C = !1, L.fromString(c)) : f.value = !1;
840
+ }), D(() => h.value, () => {
841
+ var c;
842
+ W((c = s.value) == null ? void 0 : c.update);
843
+ }), Le(xe, b), o({
844
+ color: L,
845
+ show: ve,
846
+ hide: he,
847
+ focus: be,
848
+ blur: la
849
+ }), (c, S) => (B(), ee(a(fa), {
850
+ ref_key: "popper",
851
+ ref: v,
852
+ visible: h.value,
853
+ "show-arrow": !1,
854
+ "fallback-placements": ["bottom", "top", "right", "left"],
855
+ offset: 0,
856
+ "gpu-acceleration": !1,
857
+ "popper-class": [a(t).be("picker", "panel"), c.popperClass],
858
+ "popper-style": c.popperStyle,
859
+ "stop-popper-mouse-event": !1,
860
+ pure: "",
861
+ loop: "",
862
+ role: "dialog",
863
+ effect: "light",
864
+ trigger: "click",
865
+ teleported: c.teleported,
866
+ transition: `${a(t).namespace.value}-zoom-in-top`,
867
+ persistent: c.persistent,
868
+ "append-to": c.appendTo,
869
+ onShow: Ze,
870
+ onHide: (oe) => z(!1)
871
+ }, {
872
+ content: O(() => [
873
+ re((B(), ee(a(Ua), ye({
874
+ ref_key: "pickerPanelRef",
875
+ ref: s
876
+ }, a(ze), {
877
+ border: !1,
878
+ "validate-event": !1,
879
+ onKeydown: ca(pe, ["esc"])
880
+ }), {
881
+ footer: O(() => [
882
+ $("div", null, [
883
+ T(a(Pe), {
884
+ class: w(a(t).be("footer", "link-btn")),
885
+ text: "",
886
+ size: "small",
887
+ onClick: Qe
888
+ }, {
889
+ default: O(() => [
890
+ we(Ee(a(i)("el.colorpicker.clear")), 1)
891
+ ]),
892
+ _: 1
893
+ }, 8, ["class"]),
894
+ T(a(Pe), {
895
+ plain: "",
896
+ size: "small",
897
+ class: w(a(t).be("footer", "btn")),
898
+ onClick: Je
899
+ }, {
900
+ default: O(() => [
901
+ we(Ee(a(i)("el.colorpicker.confirm")), 1)
902
+ ]),
903
+ _: 1
904
+ }, 8, ["class"])
905
+ ])
906
+ ]),
907
+ _: 1
908
+ }, 16, ["onKeydown"])), [
909
+ [a(Ea), ea, d.value]
910
+ ])
911
+ ]),
912
+ default: O(() => [
913
+ $("div", ye({
914
+ id: a(u),
915
+ ref_key: "triggerRef",
916
+ ref: d
917
+ }, c.$attrs, {
918
+ class: a(je),
919
+ role: "button",
920
+ "aria-label": a(qe),
921
+ "aria-labelledby": a(Xe),
922
+ "aria-description": a(i)("el.colorpicker.description", { color: c.modelValue || "" }),
923
+ "aria-disabled": a(m),
924
+ tabindex: a(m) ? void 0 : c.tabindex,
925
+ onKeydown: aa,
926
+ onFocus: a(V),
927
+ onBlur: a(R)
928
+ }), [
929
+ $("div", {
930
+ class: w(a(t).be("picker", "trigger")),
931
+ onClick: Ge
932
+ }, [
933
+ $("span", {
934
+ class: w([a(t).be("picker", "color"), a(t).is("alpha", c.showAlpha)])
935
+ }, [
936
+ $("span", {
937
+ class: w(a(t).be("picker", "color-inner")),
938
+ style: I({
939
+ backgroundColor: a(We)
940
+ })
941
+ }, [
942
+ re(T(a(Se), {
943
+ class: w([a(t).be("picker", "icon"), a(t).is("icon-arrow-down")])
944
+ }, {
945
+ default: O(() => [
946
+ T(a(va))
947
+ ]),
948
+ _: 1
949
+ }, 8, ["class"]), [
950
+ [Ce, c.modelValue || f.value]
951
+ ]),
952
+ re(T(a(Se), {
953
+ class: w([a(t).be("picker", "empty"), a(t).is("icon-close")])
954
+ }, {
955
+ default: O(() => [
956
+ T(a(ha))
957
+ ]),
958
+ _: 1
959
+ }, 8, ["class"]), [
960
+ [Ce, !c.modelValue && !f.value]
961
+ ])
962
+ ], 6)
963
+ ], 2)
964
+ ], 2)
965
+ ], 16, ["id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex", "onFocus", "onBlur"])
966
+ ]),
967
+ _: 1
968
+ }, 8, ["visible", "popper-class", "popper-style", "teleported", "transition", "persistent", "append-to", "onHide"]));
969
+ }
970
+ });
971
+ var el = /* @__PURE__ */ H(Za, [["__file", "color-picker.vue"]]);
972
+ const pl = De(el);
973
+ export {
974
+ pl as E
975
+ };