@element-plus/nightly 0.0.20240508 → 0.0.20240510

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 (346) hide show
  1. package/dist/index.full.js +4 -4
  2. package/dist/index.full.min.js +5 -5
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +5 -5
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +4 -4
  7. package/dist/locale/af.js +1 -1
  8. package/dist/locale/af.min.js +1 -1
  9. package/dist/locale/af.min.mjs +1 -1
  10. package/dist/locale/af.mjs +1 -1
  11. package/dist/locale/ar-eg.js +1 -1
  12. package/dist/locale/ar-eg.min.js +1 -1
  13. package/dist/locale/ar-eg.min.mjs +1 -1
  14. package/dist/locale/ar-eg.mjs +1 -1
  15. package/dist/locale/ar.js +1 -1
  16. package/dist/locale/ar.min.js +1 -1
  17. package/dist/locale/ar.min.mjs +1 -1
  18. package/dist/locale/ar.mjs +1 -1
  19. package/dist/locale/az.js +1 -1
  20. package/dist/locale/az.min.js +1 -1
  21. package/dist/locale/az.min.mjs +1 -1
  22. package/dist/locale/az.mjs +1 -1
  23. package/dist/locale/bg.js +1 -1
  24. package/dist/locale/bg.min.js +1 -1
  25. package/dist/locale/bg.min.mjs +1 -1
  26. package/dist/locale/bg.mjs +1 -1
  27. package/dist/locale/bn.js +1 -1
  28. package/dist/locale/bn.min.js +1 -1
  29. package/dist/locale/bn.min.mjs +1 -1
  30. package/dist/locale/bn.mjs +1 -1
  31. package/dist/locale/ca.js +1 -1
  32. package/dist/locale/ca.min.js +1 -1
  33. package/dist/locale/ca.min.mjs +1 -1
  34. package/dist/locale/ca.mjs +1 -1
  35. package/dist/locale/ckb.js +1 -1
  36. package/dist/locale/ckb.min.js +1 -1
  37. package/dist/locale/ckb.min.mjs +1 -1
  38. package/dist/locale/ckb.mjs +1 -1
  39. package/dist/locale/cs.js +1 -1
  40. package/dist/locale/cs.min.js +1 -1
  41. package/dist/locale/cs.min.mjs +1 -1
  42. package/dist/locale/cs.mjs +1 -1
  43. package/dist/locale/da.js +1 -1
  44. package/dist/locale/da.min.js +1 -1
  45. package/dist/locale/da.min.mjs +1 -1
  46. package/dist/locale/da.mjs +1 -1
  47. package/dist/locale/de.js +1 -1
  48. package/dist/locale/de.min.js +1 -1
  49. package/dist/locale/de.min.mjs +1 -1
  50. package/dist/locale/de.mjs +1 -1
  51. package/dist/locale/el.js +1 -1
  52. package/dist/locale/el.min.js +1 -1
  53. package/dist/locale/el.min.mjs +1 -1
  54. package/dist/locale/el.mjs +1 -1
  55. package/dist/locale/en.js +1 -1
  56. package/dist/locale/en.min.js +1 -1
  57. package/dist/locale/en.min.mjs +1 -1
  58. package/dist/locale/en.mjs +1 -1
  59. package/dist/locale/eo.js +1 -1
  60. package/dist/locale/eo.min.js +1 -1
  61. package/dist/locale/eo.min.mjs +1 -1
  62. package/dist/locale/eo.mjs +1 -1
  63. package/dist/locale/es.js +1 -1
  64. package/dist/locale/es.min.js +1 -1
  65. package/dist/locale/es.min.mjs +1 -1
  66. package/dist/locale/es.mjs +1 -1
  67. package/dist/locale/et.js +1 -1
  68. package/dist/locale/et.min.js +1 -1
  69. package/dist/locale/et.min.mjs +1 -1
  70. package/dist/locale/et.mjs +1 -1
  71. package/dist/locale/eu.js +1 -1
  72. package/dist/locale/eu.min.js +1 -1
  73. package/dist/locale/eu.min.mjs +1 -1
  74. package/dist/locale/eu.mjs +1 -1
  75. package/dist/locale/fa.js +1 -1
  76. package/dist/locale/fa.min.js +1 -1
  77. package/dist/locale/fa.min.mjs +1 -1
  78. package/dist/locale/fa.mjs +1 -1
  79. package/dist/locale/fi.js +1 -1
  80. package/dist/locale/fi.min.js +1 -1
  81. package/dist/locale/fi.min.mjs +1 -1
  82. package/dist/locale/fi.mjs +1 -1
  83. package/dist/locale/fr.js +1 -1
  84. package/dist/locale/fr.min.js +1 -1
  85. package/dist/locale/fr.min.mjs +1 -1
  86. package/dist/locale/fr.mjs +1 -1
  87. package/dist/locale/he.js +1 -1
  88. package/dist/locale/he.min.js +1 -1
  89. package/dist/locale/he.min.mjs +1 -1
  90. package/dist/locale/he.mjs +1 -1
  91. package/dist/locale/hr.js +1 -1
  92. package/dist/locale/hr.min.js +1 -1
  93. package/dist/locale/hr.min.mjs +1 -1
  94. package/dist/locale/hr.mjs +1 -1
  95. package/dist/locale/hu.js +1 -1
  96. package/dist/locale/hu.min.js +1 -1
  97. package/dist/locale/hu.min.mjs +1 -1
  98. package/dist/locale/hu.mjs +1 -1
  99. package/dist/locale/hy-am.js +1 -1
  100. package/dist/locale/hy-am.min.js +1 -1
  101. package/dist/locale/hy-am.min.mjs +1 -1
  102. package/dist/locale/hy-am.mjs +1 -1
  103. package/dist/locale/id.js +1 -1
  104. package/dist/locale/id.min.js +1 -1
  105. package/dist/locale/id.min.mjs +1 -1
  106. package/dist/locale/id.mjs +1 -1
  107. package/dist/locale/it.js +1 -1
  108. package/dist/locale/it.min.js +1 -1
  109. package/dist/locale/it.min.mjs +1 -1
  110. package/dist/locale/it.mjs +1 -1
  111. package/dist/locale/ja.js +1 -1
  112. package/dist/locale/ja.min.js +1 -1
  113. package/dist/locale/ja.min.mjs +1 -1
  114. package/dist/locale/ja.mjs +1 -1
  115. package/dist/locale/kk.js +1 -1
  116. package/dist/locale/kk.min.js +1 -1
  117. package/dist/locale/kk.min.mjs +1 -1
  118. package/dist/locale/kk.mjs +1 -1
  119. package/dist/locale/km.js +1 -1
  120. package/dist/locale/km.min.js +1 -1
  121. package/dist/locale/km.min.mjs +1 -1
  122. package/dist/locale/km.mjs +1 -1
  123. package/dist/locale/ko.js +1 -1
  124. package/dist/locale/ko.min.js +1 -1
  125. package/dist/locale/ko.min.mjs +1 -1
  126. package/dist/locale/ko.mjs +1 -1
  127. package/dist/locale/ku.js +1 -1
  128. package/dist/locale/ku.min.js +1 -1
  129. package/dist/locale/ku.min.mjs +1 -1
  130. package/dist/locale/ku.mjs +1 -1
  131. package/dist/locale/ky.js +1 -1
  132. package/dist/locale/ky.min.js +1 -1
  133. package/dist/locale/ky.min.mjs +1 -1
  134. package/dist/locale/ky.mjs +1 -1
  135. package/dist/locale/lt.js +1 -1
  136. package/dist/locale/lt.min.js +1 -1
  137. package/dist/locale/lt.min.mjs +1 -1
  138. package/dist/locale/lt.mjs +1 -1
  139. package/dist/locale/lv.js +1 -1
  140. package/dist/locale/lv.min.js +1 -1
  141. package/dist/locale/lv.min.mjs +1 -1
  142. package/dist/locale/lv.mjs +1 -1
  143. package/dist/locale/mg.js +1 -1
  144. package/dist/locale/mg.min.js +1 -1
  145. package/dist/locale/mg.min.mjs +1 -1
  146. package/dist/locale/mg.mjs +1 -1
  147. package/dist/locale/mn.js +1 -1
  148. package/dist/locale/mn.min.js +1 -1
  149. package/dist/locale/mn.min.mjs +1 -1
  150. package/dist/locale/mn.mjs +1 -1
  151. package/dist/locale/nb-no.js +1 -1
  152. package/dist/locale/nb-no.min.js +1 -1
  153. package/dist/locale/nb-no.min.mjs +1 -1
  154. package/dist/locale/nb-no.mjs +1 -1
  155. package/dist/locale/nl.js +1 -1
  156. package/dist/locale/nl.min.js +1 -1
  157. package/dist/locale/nl.min.mjs +1 -1
  158. package/dist/locale/nl.mjs +1 -1
  159. package/dist/locale/pa.js +1 -1
  160. package/dist/locale/pa.min.js +1 -1
  161. package/dist/locale/pa.min.mjs +1 -1
  162. package/dist/locale/pa.mjs +1 -1
  163. package/dist/locale/pl.js +1 -1
  164. package/dist/locale/pl.min.js +1 -1
  165. package/dist/locale/pl.min.mjs +1 -1
  166. package/dist/locale/pl.mjs +1 -1
  167. package/dist/locale/pt-br.js +1 -1
  168. package/dist/locale/pt-br.min.js +1 -1
  169. package/dist/locale/pt-br.min.mjs +1 -1
  170. package/dist/locale/pt-br.mjs +1 -1
  171. package/dist/locale/pt.js +1 -1
  172. package/dist/locale/pt.min.js +1 -1
  173. package/dist/locale/pt.min.mjs +1 -1
  174. package/dist/locale/pt.mjs +1 -1
  175. package/dist/locale/ro.js +1 -1
  176. package/dist/locale/ro.min.js +1 -1
  177. package/dist/locale/ro.min.mjs +1 -1
  178. package/dist/locale/ro.mjs +1 -1
  179. package/dist/locale/ru.js +1 -1
  180. package/dist/locale/ru.min.js +1 -1
  181. package/dist/locale/ru.min.mjs +1 -1
  182. package/dist/locale/ru.mjs +1 -1
  183. package/dist/locale/sk.js +1 -1
  184. package/dist/locale/sk.min.js +1 -1
  185. package/dist/locale/sk.min.mjs +1 -1
  186. package/dist/locale/sk.mjs +1 -1
  187. package/dist/locale/sl.js +1 -1
  188. package/dist/locale/sl.min.js +1 -1
  189. package/dist/locale/sl.min.mjs +1 -1
  190. package/dist/locale/sl.mjs +1 -1
  191. package/dist/locale/sr.js +1 -1
  192. package/dist/locale/sr.min.js +1 -1
  193. package/dist/locale/sr.min.mjs +1 -1
  194. package/dist/locale/sr.mjs +1 -1
  195. package/dist/locale/sv.js +1 -1
  196. package/dist/locale/sv.min.js +1 -1
  197. package/dist/locale/sv.min.mjs +1 -1
  198. package/dist/locale/sv.mjs +1 -1
  199. package/dist/locale/sw.js +1 -1
  200. package/dist/locale/sw.min.js +1 -1
  201. package/dist/locale/sw.min.mjs +1 -1
  202. package/dist/locale/sw.mjs +1 -1
  203. package/dist/locale/ta.js +1 -1
  204. package/dist/locale/ta.min.js +1 -1
  205. package/dist/locale/ta.min.mjs +1 -1
  206. package/dist/locale/ta.mjs +1 -1
  207. package/dist/locale/th.js +1 -1
  208. package/dist/locale/th.min.js +1 -1
  209. package/dist/locale/th.min.mjs +1 -1
  210. package/dist/locale/th.mjs +1 -1
  211. package/dist/locale/tk.js +1 -1
  212. package/dist/locale/tk.min.js +1 -1
  213. package/dist/locale/tk.min.mjs +1 -1
  214. package/dist/locale/tk.mjs +1 -1
  215. package/dist/locale/tr.js +1 -1
  216. package/dist/locale/tr.min.js +1 -1
  217. package/dist/locale/tr.min.mjs +1 -1
  218. package/dist/locale/tr.mjs +1 -1
  219. package/dist/locale/ug-cn.js +1 -1
  220. package/dist/locale/ug-cn.min.js +1 -1
  221. package/dist/locale/ug-cn.min.mjs +1 -1
  222. package/dist/locale/ug-cn.mjs +1 -1
  223. package/dist/locale/uk.js +1 -1
  224. package/dist/locale/uk.min.js +1 -1
  225. package/dist/locale/uk.min.mjs +1 -1
  226. package/dist/locale/uk.mjs +1 -1
  227. package/dist/locale/uz-uz.js +1 -1
  228. package/dist/locale/uz-uz.min.js +1 -1
  229. package/dist/locale/uz-uz.min.mjs +1 -1
  230. package/dist/locale/uz-uz.mjs +1 -1
  231. package/dist/locale/vi.js +1 -1
  232. package/dist/locale/vi.min.js +1 -1
  233. package/dist/locale/vi.min.mjs +1 -1
  234. package/dist/locale/vi.mjs +1 -1
  235. package/dist/locale/zh-cn.js +1 -1
  236. package/dist/locale/zh-cn.min.js +1 -1
  237. package/dist/locale/zh-cn.min.mjs +1 -1
  238. package/dist/locale/zh-cn.mjs +1 -1
  239. package/dist/locale/zh-tw.js +1 -1
  240. package/dist/locale/zh-tw.min.js +1 -1
  241. package/dist/locale/zh-tw.min.mjs +1 -1
  242. package/dist/locale/zh-tw.mjs +1 -1
  243. package/es/components/autocomplete/src/autocomplete.mjs +1 -1
  244. package/es/components/cascader/src/cascader.mjs +1 -1
  245. package/es/components/check-tag/index.mjs +2 -2
  246. package/es/components/check-tag/src/check-tag.mjs +35 -17
  247. package/es/components/check-tag/src/check-tag.mjs.map +1 -1
  248. package/es/components/check-tag/src/check-tag2.mjs +17 -35
  249. package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
  250. package/es/components/color-picker/index.mjs +2 -2
  251. package/es/components/color-picker/src/color-picker.mjs +46 -412
  252. package/es/components/color-picker/src/color-picker.mjs.map +1 -1
  253. package/es/components/color-picker/src/color-picker2.mjs +412 -46
  254. package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
  255. package/es/components/color-picker/src/components/predefine.mjs +1 -1
  256. package/es/components/dropdown/src/dropdown2.mjs +1 -1
  257. package/es/components/index.mjs +7 -7
  258. package/es/components/popconfirm/index.mjs +2 -2
  259. package/es/components/popconfirm/src/popconfirm.mjs +47 -110
  260. package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
  261. package/es/components/popconfirm/src/popconfirm2.mjs +110 -47
  262. package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
  263. package/es/components/popover/src/popover.mjs +1 -1
  264. package/es/components/radio/index.mjs +2 -2
  265. package/es/components/radio/src/radio-group.mjs +39 -77
  266. package/es/components/radio/src/radio-group.mjs.map +1 -1
  267. package/es/components/radio/src/radio-group2.mjs +77 -39
  268. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  269. package/es/components/result/index.mjs +2 -2
  270. package/es/components/result/src/result.mjs +63 -29
  271. package/es/components/result/src/result.mjs.map +1 -1
  272. package/es/components/result/src/result2.mjs +29 -63
  273. package/es/components/result/src/result2.mjs.map +1 -1
  274. package/es/components/select/src/select.mjs +1 -1
  275. package/es/components/select-v2/src/defaults.mjs +1 -1
  276. package/es/components/table/src/store/watcher.mjs +2 -2
  277. package/es/components/table/src/store/watcher.mjs.map +1 -1
  278. package/es/components/timeline/index.mjs +2 -2
  279. package/es/components/timeline/src/timeline-item.mjs +42 -72
  280. package/es/components/timeline/src/timeline-item.mjs.map +1 -1
  281. package/es/components/timeline/src/timeline-item2.mjs +72 -42
  282. package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
  283. package/es/components/tooltip/index.mjs +1 -1
  284. package/es/components/tooltip/src/content.mjs +32 -177
  285. package/es/components/tooltip/src/content.mjs.map +1 -1
  286. package/es/components/tooltip/src/content2.mjs +177 -32
  287. package/es/components/tooltip/src/content2.mjs.map +1 -1
  288. package/es/components/tooltip/src/tooltip.mjs +1 -1
  289. package/es/components/tooltip/src/tooltip2.mjs +1 -1
  290. package/es/index.mjs +7 -7
  291. package/es/version.d.ts +1 -1
  292. package/es/version.mjs +1 -1
  293. package/es/version.mjs.map +1 -1
  294. package/lib/components/autocomplete/src/autocomplete.js +1 -1
  295. package/lib/components/cascader/src/cascader.js +1 -1
  296. package/lib/components/check-tag/index.js +2 -2
  297. package/lib/components/check-tag/src/check-tag.js +35 -18
  298. package/lib/components/check-tag/src/check-tag.js.map +1 -1
  299. package/lib/components/check-tag/src/check-tag2.js +18 -35
  300. package/lib/components/check-tag/src/check-tag2.js.map +1 -1
  301. package/lib/components/color-picker/index.js +2 -2
  302. package/lib/components/color-picker/src/color-picker.js +46 -410
  303. package/lib/components/color-picker/src/color-picker.js.map +1 -1
  304. package/lib/components/color-picker/src/color-picker2.js +410 -46
  305. package/lib/components/color-picker/src/color-picker2.js.map +1 -1
  306. package/lib/components/color-picker/src/components/predefine.js +1 -1
  307. package/lib/components/dropdown/src/dropdown2.js +1 -1
  308. package/lib/components/index.js +7 -7
  309. package/lib/components/popconfirm/index.js +2 -2
  310. package/lib/components/popconfirm/src/popconfirm.js +48 -110
  311. package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
  312. package/lib/components/popconfirm/src/popconfirm2.js +110 -48
  313. package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
  314. package/lib/components/popover/src/popover.js +1 -1
  315. package/lib/components/radio/index.js +2 -2
  316. package/lib/components/radio/src/radio-group.js +40 -77
  317. package/lib/components/radio/src/radio-group.js.map +1 -1
  318. package/lib/components/radio/src/radio-group2.js +77 -40
  319. package/lib/components/radio/src/radio-group2.js.map +1 -1
  320. package/lib/components/result/index.js +2 -2
  321. package/lib/components/result/src/result.js +63 -31
  322. package/lib/components/result/src/result.js.map +1 -1
  323. package/lib/components/result/src/result2.js +31 -63
  324. package/lib/components/result/src/result2.js.map +1 -1
  325. package/lib/components/select/src/select.js +1 -1
  326. package/lib/components/select-v2/src/defaults.js +1 -1
  327. package/lib/components/table/src/store/watcher.js +2 -2
  328. package/lib/components/table/src/store/watcher.js.map +1 -1
  329. package/lib/components/timeline/index.js +2 -2
  330. package/lib/components/timeline/src/timeline-item.js +42 -72
  331. package/lib/components/timeline/src/timeline-item.js.map +1 -1
  332. package/lib/components/timeline/src/timeline-item2.js +72 -42
  333. package/lib/components/timeline/src/timeline-item2.js.map +1 -1
  334. package/lib/components/tooltip/index.js +1 -1
  335. package/lib/components/tooltip/src/content.js +32 -177
  336. package/lib/components/tooltip/src/content.js.map +1 -1
  337. package/lib/components/tooltip/src/content2.js +177 -32
  338. package/lib/components/tooltip/src/content2.js.map +1 -1
  339. package/lib/components/tooltip/src/tooltip.js +1 -1
  340. package/lib/components/tooltip/src/tooltip2.js +1 -1
  341. package/lib/index.js +7 -7
  342. package/lib/version.d.ts +1 -1
  343. package/lib/version.js +1 -1
  344. package/lib/version.js.map +1 -1
  345. package/package.json +2 -2
  346. package/web-types.json +1 -1
@@ -1,24 +1,42 @@
1
- import '../../../utils/index.mjs';
1
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
2
2
  import '../../../constants/index.mjs';
3
- import { buildProps } from '../../../utils/vue/props/runtime.mjs';
4
- import { isBoolean } from '../../../utils/types.mjs';
3
+ import '../../../hooks/index.mjs';
4
+ import { checkTagProps, checkTagEmits } from './check-tag2.mjs';
5
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
5
7
  import { CHANGE_EVENT } from '../../../constants/event.mjs';
6
8
 
7
- const checkTagProps = buildProps({
8
- checked: {
9
- type: Boolean,
10
- default: false
11
- },
12
- type: {
13
- type: String,
14
- values: ["primary", "success", "info", "warning", "danger"],
15
- default: "primary"
9
+ const __default__ = defineComponent({
10
+ name: "ElCheckTag"
11
+ });
12
+ const _sfc_main = /* @__PURE__ */ defineComponent({
13
+ ...__default__,
14
+ props: checkTagProps,
15
+ emits: checkTagEmits,
16
+ setup(__props, { emit }) {
17
+ const props = __props;
18
+ const ns = useNamespace("check-tag");
19
+ const containerKls = computed(() => [
20
+ ns.b(),
21
+ ns.is("checked", props.checked),
22
+ ns.m(props.type || "primary")
23
+ ]);
24
+ const handleChange = () => {
25
+ const checked = !props.checked;
26
+ emit(CHANGE_EVENT, checked);
27
+ emit("update:checked", checked);
28
+ };
29
+ return (_ctx, _cache) => {
30
+ return openBlock(), createElementBlock("span", {
31
+ class: normalizeClass(unref(containerKls)),
32
+ onClick: handleChange
33
+ }, [
34
+ renderSlot(_ctx.$slots, "default")
35
+ ], 2);
36
+ };
16
37
  }
17
38
  });
18
- const checkTagEmits = {
19
- "update:checked": (value) => isBoolean(value),
20
- [CHANGE_EVENT]: (value) => isBoolean(value)
21
- };
39
+ var CheckTag = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "check-tag.vue"]]);
22
40
 
23
- export { checkTagEmits, checkTagProps };
41
+ export { CheckTag as default };
24
42
  //# sourceMappingURL=check-tag.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-tag.mjs","sources":["../../../../../../packages/components/check-tag/src/check-tag.ts"],"sourcesContent":["import { buildProps, isBoolean } from '@element-plus/utils'\nimport { CHANGE_EVENT } from '@element-plus/constants'\n\nimport type CheckTag from './check-tag.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const checkTagProps = buildProps({\n /**\n * @description is checked\n */\n checked: {\n type: Boolean,\n default: false,\n },\n /**\n * @description type of Tag\n */\n type: {\n type: String,\n values: ['primary', 'success', 'info', 'warning', 'danger'],\n default: 'primary',\n },\n} as const)\nexport type CheckTagProps = ExtractPropTypes<typeof checkTagProps>\n\nexport const checkTagEmits = {\n 'update:checked': (value: boolean) => isBoolean(value),\n [CHANGE_EVENT]: (value: boolean) => isBoolean(value),\n}\nexport type CheckTagEmits = typeof checkTagEmits\n\nexport type CheckTagInstance = InstanceType<typeof CheckTag>\n"],"names":[],"mappings":";;;;;;AAEY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;AAC/D,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,gBAAgB,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK,CAAC;AAC/C,EAAE,CAAC,YAAY,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK,CAAC;AAC7C;;;;"}
1
+ {"version":3,"file":"check-tag.mjs","sources":["../../../../../../packages/components/check-tag/src/check-tag.vue"],"sourcesContent":["<template>\n <span :class=\"containerKls\" @click=\"handleChange\">\n <slot />\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport { useNamespace } from '@element-plus/hooks'\nimport { checkTagEmits, checkTagProps } from './check-tag'\n\ndefineOptions({\n name: 'ElCheckTag',\n})\nconst props = defineProps(checkTagProps)\nconst emit = defineEmits(checkTagEmits)\n\nconst ns = useNamespace('check-tag')\nconst containerKls = computed(() => [\n ns.b(),\n ns.is('checked', props.checked),\n ns.m(props.type || 'primary'),\n])\n\nconst handleChange = () => {\n const checked = !props.checked\n emit(CHANGE_EVENT, checked)\n emit('update:checked', checked)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;mCAYc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,WAAW,CAAA,CAAA;AACnC,IAAM,MAAA,YAAA,GAAe,SAAS,MAAM;AAAA,MAClC,GAAG,CAAE,EAAA;AAAA,MACL,EAAG,CAAA,EAAA,CAAG,SAAW,EAAA,KAAA,CAAM,OAAO,CAAA;AAAA,MAC9B,EAAG,CAAA,CAAA,CAAE,KAAM,CAAA,IAAA,IAAQ,SAAS,CAAA;AAAA,KAC7B,CAAA,CAAA;AAED,IAAA,MAAM,eAAe,MAAM;AACzB,MAAM,MAAA,OAAA,GAAU,CAAC,KAAM,CAAA,OAAA,CAAA;AACvB,MAAA,IAAA,CAAK,cAAc,OAAO,CAAA,CAAA;AAC1B,MAAA,IAAA,CAAK,kBAAkB,OAAO,CAAA,CAAA;AAAA,KAChC,CAAA;;;;;;;;;;;;;;;"}
@@ -1,42 +1,24 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
1
+ import '../../../utils/index.mjs';
2
2
  import '../../../constants/index.mjs';
3
- import '../../../hooks/index.mjs';
4
- import { checkTagProps, checkTagEmits } from './check-tag.mjs';
5
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
3
+ import { buildProps } from '../../../utils/vue/props/runtime.mjs';
4
+ import { isBoolean } from '../../../utils/types.mjs';
7
5
  import { CHANGE_EVENT } from '../../../constants/event.mjs';
8
6
 
9
- const __default__ = defineComponent({
10
- name: "ElCheckTag"
11
- });
12
- const _sfc_main = /* @__PURE__ */ defineComponent({
13
- ...__default__,
14
- props: checkTagProps,
15
- emits: checkTagEmits,
16
- setup(__props, { emit }) {
17
- const props = __props;
18
- const ns = useNamespace("check-tag");
19
- const containerKls = computed(() => [
20
- ns.b(),
21
- ns.is("checked", props.checked),
22
- ns.m(props.type || "primary")
23
- ]);
24
- const handleChange = () => {
25
- const checked = !props.checked;
26
- emit(CHANGE_EVENT, checked);
27
- emit("update:checked", checked);
28
- };
29
- return (_ctx, _cache) => {
30
- return openBlock(), createElementBlock("span", {
31
- class: normalizeClass(unref(containerKls)),
32
- onClick: handleChange
33
- }, [
34
- renderSlot(_ctx.$slots, "default")
35
- ], 2);
36
- };
7
+ const checkTagProps = buildProps({
8
+ checked: {
9
+ type: Boolean,
10
+ default: false
11
+ },
12
+ type: {
13
+ type: String,
14
+ values: ["primary", "success", "info", "warning", "danger"],
15
+ default: "primary"
37
16
  }
38
17
  });
39
- var CheckTag = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "check-tag.vue"]]);
18
+ const checkTagEmits = {
19
+ "update:checked": (value) => isBoolean(value),
20
+ [CHANGE_EVENT]: (value) => isBoolean(value)
21
+ };
40
22
 
41
- export { CheckTag as default };
23
+ export { checkTagEmits, checkTagProps };
42
24
  //# sourceMappingURL=check-tag2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-tag2.mjs","sources":["../../../../../../packages/components/check-tag/src/check-tag.vue"],"sourcesContent":["<template>\n <span :class=\"containerKls\" @click=\"handleChange\">\n <slot />\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport { useNamespace } from '@element-plus/hooks'\nimport { checkTagEmits, checkTagProps } from './check-tag'\n\ndefineOptions({\n name: 'ElCheckTag',\n})\nconst props = defineProps(checkTagProps)\nconst emit = defineEmits(checkTagEmits)\n\nconst ns = useNamespace('check-tag')\nconst containerKls = computed(() => [\n ns.b(),\n ns.is('checked', props.checked),\n ns.m(props.type || 'primary'),\n])\n\nconst handleChange = () => {\n const checked = !props.checked\n emit(CHANGE_EVENT, checked)\n emit('update:checked', checked)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;mCAYc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,WAAW,CAAA,CAAA;AACnC,IAAM,MAAA,YAAA,GAAe,SAAS,MAAM;AAAA,MAClC,GAAG,CAAE,EAAA;AAAA,MACL,EAAG,CAAA,EAAA,CAAG,SAAW,EAAA,KAAA,CAAM,OAAO,CAAA;AAAA,MAC9B,EAAG,CAAA,CAAA,CAAE,KAAM,CAAA,IAAA,IAAQ,SAAS,CAAA;AAAA,KAC7B,CAAA,CAAA;AAED,IAAA,MAAM,eAAe,MAAM;AACzB,MAAM,MAAA,OAAA,GAAU,CAAC,KAAM,CAAA,OAAA,CAAA;AACvB,MAAA,IAAA,CAAK,cAAc,OAAO,CAAA,CAAA;AAC1B,MAAA,IAAA,CAAK,kBAAkB,OAAO,CAAA,CAAA;AAAA,KAChC,CAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"check-tag2.mjs","sources":["../../../../../../packages/components/check-tag/src/check-tag.ts"],"sourcesContent":["import { buildProps, isBoolean } from '@element-plus/utils'\nimport { CHANGE_EVENT } from '@element-plus/constants'\n\nimport type CheckTag from './check-tag.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const checkTagProps = buildProps({\n /**\n * @description is checked\n */\n checked: {\n type: Boolean,\n default: false,\n },\n /**\n * @description type of Tag\n */\n type: {\n type: String,\n values: ['primary', 'success', 'info', 'warning', 'danger'],\n default: 'primary',\n },\n} as const)\nexport type CheckTagProps = ExtractPropTypes<typeof checkTagProps>\n\nexport const checkTagEmits = {\n 'update:checked': (value: boolean) => isBoolean(value),\n [CHANGE_EVENT]: (value: boolean) => isBoolean(value),\n}\nexport type CheckTagEmits = typeof checkTagEmits\n\nexport type CheckTagInstance = InstanceType<typeof CheckTag>\n"],"names":[],"mappings":";;;;;;AAEY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;AAC/D,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,gBAAgB,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK,CAAC;AAC/C,EAAE,CAAC,YAAY,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK,CAAC;AAC7C;;;;"}
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
- import ColorPicker from './src/color-picker.mjs';
3
- export { colorPickerContextKey, colorPickerEmits, colorPickerProps } from './src/color-picker2.mjs';
2
+ import ColorPicker from './src/color-picker2.mjs';
3
+ export { colorPickerContextKey, colorPickerEmits, colorPickerProps } from './src/color-picker.mjs';
4
4
  import { withInstall } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const ElColorPicker = withInstall(ColorPicker);
@@ -1,418 +1,52 @@
1
- import { defineComponent, ref, reactive, computed, nextTick, onMounted, watch, provide, openBlock, createBlock, unref, withCtx, withDirectives, createElementBlock, withKeys, createElementVNode, normalizeClass, createVNode, createCommentVNode, createTextVNode, toDisplayString, normalizeStyle, vShow } from 'vue';
2
- import { debounce } from 'lodash-unified';
3
- import { ElButton } from '../../button/index.mjs';
4
- import { ElIcon } from '../../icon/index.mjs';
5
- import '../../../directives/index.mjs';
6
- import { ElTooltip } from '../../tooltip/index.mjs';
7
- import { ElInput } from '../../input/index.mjs';
8
- import '../../form/index.mjs';
1
+ import { isNil } from 'lodash-unified';
2
+ import '../../../utils/index.mjs';
9
3
  import '../../../hooks/index.mjs';
4
+ import '../../tooltip/index.mjs';
10
5
  import '../../../constants/index.mjs';
11
- import '../../../utils/index.mjs';
12
- import { ArrowDown, Close } from '@element-plus/icons-vue';
13
- import AlphaSlider from './components/alpha-slider.mjs';
14
- import HueSlider from './components/hue-slider.mjs';
15
- import Predefine from './components/predefine.mjs';
16
- import SvPanel from './components/sv-panel.mjs';
17
- import Color from './utils/color.mjs';
18
- import { colorPickerProps, colorPickerEmits, colorPickerContextKey } from './color-picker2.mjs';
19
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
20
- import { useLocale } from '../../../hooks/use-locale/index.mjs';
21
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
22
- import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
23
- import { useFormSize, useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
24
- import { useFocusController } from '../../../hooks/use-focus-controller/index.mjs';
25
- import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
26
- import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
27
- import { debugWarn } from '../../../utils/error.mjs';
28
- import { EVENT_CODE } from '../../../constants/aria.mjs';
29
- import ClickOutside from '../../../directives/click-outside/index.mjs';
6
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
7
+ import { useSizeProp } from '../../../hooks/use-size/index.mjs';
8
+ import { useTooltipContentProps } from '../../tooltip/src/content.mjs';
9
+ import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
10
+ import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
11
+ import { isString } from '@vue/shared';
30
12
 
31
- const _hoisted_1 = ["onKeydown"];
32
- const _hoisted_2 = ["id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex"];
33
- const __default__ = defineComponent({
34
- name: "ElColorPicker"
35
- });
36
- const _sfc_main = /* @__PURE__ */ defineComponent({
37
- ...__default__,
38
- props: colorPickerProps,
39
- emits: colorPickerEmits,
40
- setup(__props, { expose, emit }) {
41
- const props = __props;
42
- const { t } = useLocale();
43
- const ns = useNamespace("color");
44
- const { formItem } = useFormItem();
45
- const colorSize = useFormSize();
46
- const colorDisabled = useFormDisabled();
47
- const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {
48
- formItemContext: formItem
49
- });
50
- const hue = ref();
51
- const sv = ref();
52
- const alpha = ref();
53
- const popper = ref();
54
- const triggerRef = ref();
55
- const inputRef = ref();
56
- const {
57
- isFocused,
58
- handleFocus: _handleFocus,
59
- handleBlur
60
- } = useFocusController(triggerRef, {
61
- beforeBlur(event) {
62
- var _a;
63
- return (_a = popper.value) == null ? void 0 : _a.isFocusInsideContent(event);
64
- },
65
- afterBlur() {
66
- setShowPicker(false);
67
- resetColor();
68
- }
69
- });
70
- const handleFocus = (event) => {
71
- if (colorDisabled.value)
72
- return blur();
73
- _handleFocus(event);
74
- };
75
- let shouldActiveChange = true;
76
- const color = reactive(new Color({
77
- enableAlpha: props.showAlpha,
78
- format: props.colorFormat || "",
79
- value: props.modelValue
80
- }));
81
- const showPicker = ref(false);
82
- const showPanelColor = ref(false);
83
- const customInput = ref("");
84
- const displayedColor = computed(() => {
85
- if (!props.modelValue && !showPanelColor.value) {
86
- return "transparent";
87
- }
88
- return displayedRgb(color, props.showAlpha);
89
- });
90
- const currentColor = computed(() => {
91
- return !props.modelValue && !showPanelColor.value ? "" : color.value;
92
- });
93
- const buttonAriaLabel = computed(() => {
94
- return !isLabeledByFormItem.value ? props.label || props.ariaLabel || t("el.colorpicker.defaultLabel") : void 0;
95
- });
96
- useDeprecated({
97
- from: "label",
98
- replacement: "aria-label",
99
- version: "2.8.0",
100
- scope: "el-color-picker",
101
- ref: "https://element-plus.org/en-US/component/color-picker.html"
102
- }, computed(() => !!props.label));
103
- const buttonAriaLabelledby = computed(() => {
104
- return isLabeledByFormItem.value ? formItem == null ? void 0 : formItem.labelId : void 0;
105
- });
106
- const btnKls = computed(() => {
107
- return [
108
- ns.b("picker"),
109
- ns.is("disabled", colorDisabled.value),
110
- ns.bm("picker", colorSize.value),
111
- ns.is("focused", isFocused.value)
112
- ];
113
- });
114
- function displayedRgb(color2, showAlpha) {
115
- if (!(color2 instanceof Color)) {
116
- throw new TypeError("color should be instance of _color Class");
117
- }
118
- const { r, g, b } = color2.toRgb();
119
- return showAlpha ? `rgba(${r}, ${g}, ${b}, ${color2.get("alpha") / 100})` : `rgb(${r}, ${g}, ${b})`;
120
- }
121
- function setShowPicker(value) {
122
- showPicker.value = value;
123
- }
124
- const debounceSetShowPicker = debounce(setShowPicker, 100, { leading: true });
125
- function show() {
126
- if (colorDisabled.value)
127
- return;
128
- setShowPicker(true);
129
- }
130
- function hide() {
131
- debounceSetShowPicker(false);
132
- resetColor();
133
- }
134
- function resetColor() {
135
- nextTick(() => {
136
- if (props.modelValue) {
137
- color.fromString(props.modelValue);
138
- } else {
139
- color.value = "";
140
- nextTick(() => {
141
- showPanelColor.value = false;
142
- });
143
- }
144
- });
145
- }
146
- function handleTrigger() {
147
- if (colorDisabled.value)
148
- return;
149
- debounceSetShowPicker(!showPicker.value);
150
- }
151
- function handleConfirm() {
152
- color.fromString(customInput.value);
153
- }
154
- function confirmValue() {
155
- const value = color.value;
156
- emit(UPDATE_MODEL_EVENT, value);
157
- emit("change", value);
158
- if (props.validateEvent) {
159
- formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
160
- }
161
- debounceSetShowPicker(false);
162
- nextTick(() => {
163
- const newColor = new Color({
164
- enableAlpha: props.showAlpha,
165
- format: props.colorFormat || "",
166
- value: props.modelValue
167
- });
168
- if (!color.compare(newColor)) {
169
- resetColor();
170
- }
171
- });
172
- }
173
- function clear() {
174
- debounceSetShowPicker(false);
175
- emit(UPDATE_MODEL_EVENT, null);
176
- emit("change", null);
177
- if (props.modelValue !== null && props.validateEvent) {
178
- formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
179
- }
180
- resetColor();
181
- }
182
- function handleClickOutside(event) {
183
- if (!showPicker.value)
184
- return;
185
- hide();
186
- if (isFocused.value) {
187
- const _event = new FocusEvent("focus", event);
188
- handleBlur(_event);
189
- }
190
- }
191
- function handleEsc(event) {
192
- event.preventDefault();
193
- event.stopPropagation();
194
- setShowPicker(false);
195
- resetColor();
196
- }
197
- function handleKeyDown(event) {
198
- switch (event.code) {
199
- case EVENT_CODE.enter:
200
- case EVENT_CODE.space:
201
- event.preventDefault();
202
- event.stopPropagation();
203
- show();
204
- inputRef.value.focus();
205
- break;
206
- case EVENT_CODE.esc:
207
- handleEsc(event);
208
- break;
209
- }
210
- }
211
- function focus() {
212
- triggerRef.value.focus();
213
- }
214
- function blur() {
215
- triggerRef.value.blur();
216
- }
217
- onMounted(() => {
218
- if (props.modelValue) {
219
- customInput.value = currentColor.value;
220
- }
221
- });
222
- watch(() => props.modelValue, (newVal) => {
223
- if (!newVal) {
224
- showPanelColor.value = false;
225
- } else if (newVal && newVal !== color.value) {
226
- shouldActiveChange = false;
227
- color.fromString(newVal);
228
- }
229
- });
230
- watch(() => currentColor.value, (val) => {
231
- customInput.value = val;
232
- shouldActiveChange && emit("activeChange", val);
233
- shouldActiveChange = true;
234
- });
235
- watch(() => color.value, () => {
236
- if (!props.modelValue && !showPanelColor.value) {
237
- showPanelColor.value = true;
238
- }
239
- });
240
- watch(() => showPicker.value, () => {
241
- nextTick(() => {
242
- var _a, _b, _c;
243
- (_a = hue.value) == null ? void 0 : _a.update();
244
- (_b = sv.value) == null ? void 0 : _b.update();
245
- (_c = alpha.value) == null ? void 0 : _c.update();
246
- });
247
- });
248
- provide(colorPickerContextKey, {
249
- currentColor
250
- });
251
- expose({
252
- color,
253
- show,
254
- hide,
255
- focus,
256
- blur
257
- });
258
- return (_ctx, _cache) => {
259
- return openBlock(), createBlock(unref(ElTooltip), {
260
- ref_key: "popper",
261
- ref: popper,
262
- visible: showPicker.value,
263
- "show-arrow": false,
264
- "fallback-placements": ["bottom", "top", "right", "left"],
265
- offset: 0,
266
- "gpu-acceleration": false,
267
- "popper-class": [unref(ns).be("picker", "panel"), unref(ns).b("dropdown"), _ctx.popperClass],
268
- "stop-popper-mouse-event": false,
269
- effect: "light",
270
- trigger: "click",
271
- teleported: _ctx.teleported,
272
- transition: `${unref(ns).namespace.value}-zoom-in-top`,
273
- persistent: "",
274
- onHide: _cache[2] || (_cache[2] = ($event) => setShowPicker(false))
275
- }, {
276
- content: withCtx(() => [
277
- withDirectives((openBlock(), createElementBlock("div", {
278
- onKeydown: withKeys(handleEsc, ["esc"])
279
- }, [
280
- createElementVNode("div", {
281
- class: normalizeClass(unref(ns).be("dropdown", "main-wrapper"))
282
- }, [
283
- createVNode(HueSlider, {
284
- ref_key: "hue",
285
- ref: hue,
286
- class: "hue-slider",
287
- color: unref(color),
288
- vertical: ""
289
- }, null, 8, ["color"]),
290
- createVNode(SvPanel, {
291
- ref_key: "sv",
292
- ref: sv,
293
- color: unref(color)
294
- }, null, 8, ["color"])
295
- ], 2),
296
- _ctx.showAlpha ? (openBlock(), createBlock(AlphaSlider, {
297
- key: 0,
298
- ref_key: "alpha",
299
- ref: alpha,
300
- color: unref(color)
301
- }, null, 8, ["color"])) : createCommentVNode("v-if", true),
302
- _ctx.predefine ? (openBlock(), createBlock(Predefine, {
303
- key: 1,
304
- ref: "predefine",
305
- color: unref(color),
306
- colors: _ctx.predefine
307
- }, null, 8, ["color", "colors"])) : createCommentVNode("v-if", true),
308
- createElementVNode("div", {
309
- class: normalizeClass(unref(ns).be("dropdown", "btns"))
310
- }, [
311
- createElementVNode("span", {
312
- class: normalizeClass(unref(ns).be("dropdown", "value"))
313
- }, [
314
- createVNode(unref(ElInput), {
315
- ref_key: "inputRef",
316
- ref: inputRef,
317
- modelValue: customInput.value,
318
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
319
- "validate-event": false,
320
- size: "small",
321
- onKeyup: withKeys(handleConfirm, ["enter"]),
322
- onBlur: handleConfirm
323
- }, null, 8, ["modelValue", "onKeyup"])
324
- ], 2),
325
- createVNode(unref(ElButton), {
326
- class: normalizeClass(unref(ns).be("dropdown", "link-btn")),
327
- text: "",
328
- size: "small",
329
- onClick: clear
330
- }, {
331
- default: withCtx(() => [
332
- createTextVNode(toDisplayString(unref(t)("el.colorpicker.clear")), 1)
333
- ]),
334
- _: 1
335
- }, 8, ["class"]),
336
- createVNode(unref(ElButton), {
337
- plain: "",
338
- size: "small",
339
- class: normalizeClass(unref(ns).be("dropdown", "btn")),
340
- onClick: confirmValue
341
- }, {
342
- default: withCtx(() => [
343
- createTextVNode(toDisplayString(unref(t)("el.colorpicker.confirm")), 1)
344
- ]),
345
- _: 1
346
- }, 8, ["class"])
347
- ], 2)
348
- ], 40, _hoisted_1)), [
349
- [unref(ClickOutside), handleClickOutside]
350
- ])
351
- ]),
352
- default: withCtx(() => [
353
- createElementVNode("div", {
354
- id: unref(buttonId),
355
- ref_key: "triggerRef",
356
- ref: triggerRef,
357
- class: normalizeClass(unref(btnKls)),
358
- role: "button",
359
- "aria-label": unref(buttonAriaLabel),
360
- "aria-labelledby": unref(buttonAriaLabelledby),
361
- "aria-description": unref(t)("el.colorpicker.description", { color: _ctx.modelValue || "" }),
362
- "aria-disabled": unref(colorDisabled),
363
- tabindex: unref(colorDisabled) ? -1 : _ctx.tabindex,
364
- onKeydown: handleKeyDown,
365
- onFocus: handleFocus,
366
- onBlur: _cache[1] || (_cache[1] = (...args) => unref(handleBlur) && unref(handleBlur)(...args))
367
- }, [
368
- unref(colorDisabled) ? (openBlock(), createElementBlock("div", {
369
- key: 0,
370
- class: normalizeClass(unref(ns).be("picker", "mask"))
371
- }, null, 2)) : createCommentVNode("v-if", true),
372
- createElementVNode("div", {
373
- class: normalizeClass(unref(ns).be("picker", "trigger")),
374
- onClick: handleTrigger
375
- }, [
376
- createElementVNode("span", {
377
- class: normalizeClass([unref(ns).be("picker", "color"), unref(ns).is("alpha", _ctx.showAlpha)])
378
- }, [
379
- createElementVNode("span", {
380
- class: normalizeClass(unref(ns).be("picker", "color-inner")),
381
- style: normalizeStyle({
382
- backgroundColor: unref(displayedColor)
383
- })
384
- }, [
385
- withDirectives(createVNode(unref(ElIcon), {
386
- class: normalizeClass([unref(ns).be("picker", "icon"), unref(ns).is("icon-arrow-down")])
387
- }, {
388
- default: withCtx(() => [
389
- createVNode(unref(ArrowDown))
390
- ]),
391
- _: 1
392
- }, 8, ["class"]), [
393
- [vShow, _ctx.modelValue || showPanelColor.value]
394
- ]),
395
- withDirectives(createVNode(unref(ElIcon), {
396
- class: normalizeClass([unref(ns).be("picker", "empty"), unref(ns).is("icon-close")])
397
- }, {
398
- default: withCtx(() => [
399
- createVNode(unref(Close))
400
- ]),
401
- _: 1
402
- }, 8, ["class"]), [
403
- [vShow, !_ctx.modelValue && !showPanelColor.value]
404
- ])
405
- ], 6)
406
- ], 2)
407
- ], 2)
408
- ], 42, _hoisted_2)
409
- ]),
410
- _: 1
411
- }, 8, ["visible", "popper-class", "teleported", "transition"]);
412
- };
413
- }
13
+ const colorPickerProps = buildProps({
14
+ modelValue: String,
15
+ id: String,
16
+ showAlpha: Boolean,
17
+ colorFormat: String,
18
+ disabled: Boolean,
19
+ size: useSizeProp,
20
+ popperClass: {
21
+ type: String,
22
+ default: ""
23
+ },
24
+ label: {
25
+ type: String,
26
+ default: void 0
27
+ },
28
+ tabindex: {
29
+ type: [String, Number],
30
+ default: 0
31
+ },
32
+ teleported: useTooltipContentProps.teleported,
33
+ predefine: {
34
+ type: definePropType(Array)
35
+ },
36
+ validateEvent: {
37
+ type: Boolean,
38
+ default: true
39
+ },
40
+ ...useAriaProps(["ariaLabel"])
414
41
  });
415
- var ColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "color-picker.vue"]]);
42
+ const colorPickerEmits = {
43
+ [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val),
44
+ [CHANGE_EVENT]: (val) => isString(val) || isNil(val),
45
+ activeChange: (val) => isString(val) || isNil(val),
46
+ focus: (event) => event instanceof FocusEvent,
47
+ blur: (event) => event instanceof FocusEvent
48
+ };
49
+ const colorPickerContextKey = Symbol("colorPickerContextKey");
416
50
 
417
- export { ColorPicker as default };
51
+ export { colorPickerContextKey, colorPickerEmits, colorPickerProps };
418
52
  //# sourceMappingURL=color-picker.mjs.map