@element-plus/nightly 0.0.20221217 → 0.0.20221219

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 (272) hide show
  1. package/dist/index.full.js +94 -4
  2. package/dist/index.full.min.js +12 -12
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +12 -12
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +94 -5
  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.js +1 -1
  12. package/dist/locale/ar.min.js +1 -1
  13. package/dist/locale/ar.min.mjs +1 -1
  14. package/dist/locale/ar.mjs +1 -1
  15. package/dist/locale/az.js +1 -1
  16. package/dist/locale/az.min.js +1 -1
  17. package/dist/locale/az.min.mjs +1 -1
  18. package/dist/locale/az.mjs +1 -1
  19. package/dist/locale/bg.js +1 -1
  20. package/dist/locale/bg.min.js +1 -1
  21. package/dist/locale/bg.min.mjs +1 -1
  22. package/dist/locale/bg.mjs +1 -1
  23. package/dist/locale/bn.js +1 -1
  24. package/dist/locale/bn.min.js +1 -1
  25. package/dist/locale/bn.min.mjs +1 -1
  26. package/dist/locale/bn.mjs +1 -1
  27. package/dist/locale/ca.js +1 -1
  28. package/dist/locale/ca.min.js +1 -1
  29. package/dist/locale/ca.min.mjs +1 -1
  30. package/dist/locale/ca.mjs +1 -1
  31. package/dist/locale/ckb.js +1 -1
  32. package/dist/locale/ckb.min.js +1 -1
  33. package/dist/locale/ckb.min.mjs +1 -1
  34. package/dist/locale/ckb.mjs +1 -1
  35. package/dist/locale/cs.js +1 -1
  36. package/dist/locale/cs.min.js +1 -1
  37. package/dist/locale/cs.min.mjs +1 -1
  38. package/dist/locale/cs.mjs +1 -1
  39. package/dist/locale/da.js +1 -1
  40. package/dist/locale/da.min.js +1 -1
  41. package/dist/locale/da.min.mjs +1 -1
  42. package/dist/locale/da.mjs +1 -1
  43. package/dist/locale/de.js +1 -1
  44. package/dist/locale/de.min.js +1 -1
  45. package/dist/locale/de.min.mjs +1 -1
  46. package/dist/locale/de.mjs +1 -1
  47. package/dist/locale/el.js +1 -1
  48. package/dist/locale/el.min.js +1 -1
  49. package/dist/locale/el.min.mjs +1 -1
  50. package/dist/locale/el.mjs +1 -1
  51. package/dist/locale/en.js +1 -1
  52. package/dist/locale/en.min.js +1 -1
  53. package/dist/locale/en.min.mjs +1 -1
  54. package/dist/locale/en.mjs +1 -1
  55. package/dist/locale/eo.js +1 -1
  56. package/dist/locale/eo.min.js +1 -1
  57. package/dist/locale/eo.min.mjs +1 -1
  58. package/dist/locale/eo.mjs +1 -1
  59. package/dist/locale/es.js +1 -1
  60. package/dist/locale/es.min.js +1 -1
  61. package/dist/locale/es.min.mjs +1 -1
  62. package/dist/locale/es.mjs +1 -1
  63. package/dist/locale/et.js +1 -1
  64. package/dist/locale/et.min.js +1 -1
  65. package/dist/locale/et.min.mjs +1 -1
  66. package/dist/locale/et.mjs +1 -1
  67. package/dist/locale/eu.js +1 -1
  68. package/dist/locale/eu.min.js +1 -1
  69. package/dist/locale/eu.min.mjs +1 -1
  70. package/dist/locale/eu.mjs +1 -1
  71. package/dist/locale/fa.js +1 -1
  72. package/dist/locale/fa.min.js +1 -1
  73. package/dist/locale/fa.min.mjs +1 -1
  74. package/dist/locale/fa.mjs +1 -1
  75. package/dist/locale/fi.js +1 -1
  76. package/dist/locale/fi.min.js +1 -1
  77. package/dist/locale/fi.min.mjs +1 -1
  78. package/dist/locale/fi.mjs +1 -1
  79. package/dist/locale/fr.js +1 -1
  80. package/dist/locale/fr.min.js +1 -1
  81. package/dist/locale/fr.min.mjs +1 -1
  82. package/dist/locale/fr.mjs +1 -1
  83. package/dist/locale/he.js +1 -1
  84. package/dist/locale/he.min.js +1 -1
  85. package/dist/locale/he.min.mjs +1 -1
  86. package/dist/locale/he.mjs +1 -1
  87. package/dist/locale/hr.js +1 -1
  88. package/dist/locale/hr.min.js +1 -1
  89. package/dist/locale/hr.min.mjs +1 -1
  90. package/dist/locale/hr.mjs +1 -1
  91. package/dist/locale/hu.js +1 -1
  92. package/dist/locale/hu.min.js +1 -1
  93. package/dist/locale/hu.min.mjs +1 -1
  94. package/dist/locale/hu.mjs +1 -1
  95. package/dist/locale/hy-am.js +1 -1
  96. package/dist/locale/hy-am.min.js +1 -1
  97. package/dist/locale/hy-am.min.mjs +1 -1
  98. package/dist/locale/hy-am.mjs +1 -1
  99. package/dist/locale/id.js +1 -1
  100. package/dist/locale/id.min.js +1 -1
  101. package/dist/locale/id.min.mjs +1 -1
  102. package/dist/locale/id.mjs +1 -1
  103. package/dist/locale/it.js +1 -1
  104. package/dist/locale/it.min.js +1 -1
  105. package/dist/locale/it.min.mjs +1 -1
  106. package/dist/locale/it.mjs +1 -1
  107. package/dist/locale/ja.js +1 -1
  108. package/dist/locale/ja.min.js +1 -1
  109. package/dist/locale/ja.min.mjs +1 -1
  110. package/dist/locale/ja.mjs +1 -1
  111. package/dist/locale/kk.js +1 -1
  112. package/dist/locale/kk.min.js +1 -1
  113. package/dist/locale/kk.min.mjs +1 -1
  114. package/dist/locale/kk.mjs +1 -1
  115. package/dist/locale/km.js +1 -1
  116. package/dist/locale/km.min.js +1 -1
  117. package/dist/locale/km.min.mjs +1 -1
  118. package/dist/locale/km.mjs +1 -1
  119. package/dist/locale/ko.js +1 -1
  120. package/dist/locale/ko.min.js +1 -1
  121. package/dist/locale/ko.min.mjs +1 -1
  122. package/dist/locale/ko.mjs +1 -1
  123. package/dist/locale/ku.js +1 -1
  124. package/dist/locale/ku.min.js +1 -1
  125. package/dist/locale/ku.min.mjs +1 -1
  126. package/dist/locale/ku.mjs +1 -1
  127. package/dist/locale/ky.js +1 -1
  128. package/dist/locale/ky.min.js +1 -1
  129. package/dist/locale/ky.min.mjs +1 -1
  130. package/dist/locale/ky.mjs +1 -1
  131. package/dist/locale/lt.js +1 -1
  132. package/dist/locale/lt.min.js +1 -1
  133. package/dist/locale/lt.min.mjs +1 -1
  134. package/dist/locale/lt.mjs +1 -1
  135. package/dist/locale/lv.js +1 -1
  136. package/dist/locale/lv.min.js +1 -1
  137. package/dist/locale/lv.min.mjs +1 -1
  138. package/dist/locale/lv.mjs +1 -1
  139. package/dist/locale/mg.js +1 -1
  140. package/dist/locale/mg.min.js +1 -1
  141. package/dist/locale/mg.min.mjs +1 -1
  142. package/dist/locale/mg.mjs +1 -1
  143. package/dist/locale/mn.js +1 -1
  144. package/dist/locale/mn.min.js +1 -1
  145. package/dist/locale/mn.min.mjs +1 -1
  146. package/dist/locale/mn.mjs +1 -1
  147. package/dist/locale/nb-no.js +1 -1
  148. package/dist/locale/nb-no.min.js +1 -1
  149. package/dist/locale/nb-no.min.mjs +1 -1
  150. package/dist/locale/nb-no.mjs +1 -1
  151. package/dist/locale/nl.js +1 -1
  152. package/dist/locale/nl.min.js +1 -1
  153. package/dist/locale/nl.min.mjs +1 -1
  154. package/dist/locale/nl.mjs +1 -1
  155. package/dist/locale/pa.js +1 -1
  156. package/dist/locale/pa.min.js +1 -1
  157. package/dist/locale/pa.min.mjs +1 -1
  158. package/dist/locale/pa.mjs +1 -1
  159. package/dist/locale/pl.js +1 -1
  160. package/dist/locale/pl.min.js +1 -1
  161. package/dist/locale/pl.min.mjs +1 -1
  162. package/dist/locale/pl.mjs +1 -1
  163. package/dist/locale/pt-br.js +1 -1
  164. package/dist/locale/pt-br.min.js +1 -1
  165. package/dist/locale/pt-br.min.mjs +1 -1
  166. package/dist/locale/pt-br.mjs +1 -1
  167. package/dist/locale/pt.js +1 -1
  168. package/dist/locale/pt.min.js +1 -1
  169. package/dist/locale/pt.min.mjs +1 -1
  170. package/dist/locale/pt.mjs +1 -1
  171. package/dist/locale/ro.js +1 -1
  172. package/dist/locale/ro.min.js +1 -1
  173. package/dist/locale/ro.min.mjs +1 -1
  174. package/dist/locale/ro.mjs +1 -1
  175. package/dist/locale/ru.js +1 -1
  176. package/dist/locale/ru.min.js +1 -1
  177. package/dist/locale/ru.min.mjs +1 -1
  178. package/dist/locale/ru.mjs +1 -1
  179. package/dist/locale/sk.js +1 -1
  180. package/dist/locale/sk.min.js +1 -1
  181. package/dist/locale/sk.min.mjs +1 -1
  182. package/dist/locale/sk.mjs +1 -1
  183. package/dist/locale/sl.js +1 -1
  184. package/dist/locale/sl.min.js +1 -1
  185. package/dist/locale/sl.min.mjs +1 -1
  186. package/dist/locale/sl.mjs +1 -1
  187. package/dist/locale/sr.js +1 -1
  188. package/dist/locale/sr.min.js +1 -1
  189. package/dist/locale/sr.min.mjs +1 -1
  190. package/dist/locale/sr.mjs +1 -1
  191. package/dist/locale/sv.js +1 -1
  192. package/dist/locale/sv.min.js +1 -1
  193. package/dist/locale/sv.min.mjs +1 -1
  194. package/dist/locale/sv.mjs +1 -1
  195. package/dist/locale/ta.js +1 -1
  196. package/dist/locale/ta.min.js +1 -1
  197. package/dist/locale/ta.min.mjs +1 -1
  198. package/dist/locale/ta.mjs +1 -1
  199. package/dist/locale/th.js +1 -1
  200. package/dist/locale/th.min.js +1 -1
  201. package/dist/locale/th.min.mjs +1 -1
  202. package/dist/locale/th.mjs +1 -1
  203. package/dist/locale/tk.js +1 -1
  204. package/dist/locale/tk.min.js +1 -1
  205. package/dist/locale/tk.min.mjs +1 -1
  206. package/dist/locale/tk.mjs +1 -1
  207. package/dist/locale/tr.js +1 -1
  208. package/dist/locale/tr.min.js +1 -1
  209. package/dist/locale/tr.min.mjs +1 -1
  210. package/dist/locale/tr.mjs +1 -1
  211. package/dist/locale/ug-cn.js +1 -1
  212. package/dist/locale/ug-cn.min.js +1 -1
  213. package/dist/locale/ug-cn.min.mjs +1 -1
  214. package/dist/locale/ug-cn.mjs +1 -1
  215. package/dist/locale/uk.js +1 -1
  216. package/dist/locale/uk.min.js +1 -1
  217. package/dist/locale/uk.min.mjs +1 -1
  218. package/dist/locale/uk.mjs +1 -1
  219. package/dist/locale/uz-uz.js +1 -1
  220. package/dist/locale/uz-uz.min.js +1 -1
  221. package/dist/locale/uz-uz.min.mjs +1 -1
  222. package/dist/locale/uz-uz.mjs +1 -1
  223. package/dist/locale/vi.js +1 -1
  224. package/dist/locale/vi.min.js +1 -1
  225. package/dist/locale/vi.min.mjs +1 -1
  226. package/dist/locale/vi.mjs +1 -1
  227. package/dist/locale/zh-cn.js +1 -1
  228. package/dist/locale/zh-cn.min.js +1 -1
  229. package/dist/locale/zh-cn.min.mjs +1 -1
  230. package/dist/locale/zh-cn.mjs +1 -1
  231. package/dist/locale/zh-tw.js +1 -1
  232. package/dist/locale/zh-tw.min.js +1 -1
  233. package/dist/locale/zh-tw.min.mjs +1 -1
  234. package/dist/locale/zh-tw.mjs +1 -1
  235. package/es/components/color-picker/index.mjs +2 -2
  236. package/es/components/color-picker/src/color-picker.mjs +38 -320
  237. package/es/components/color-picker/src/color-picker.mjs.map +1 -1
  238. package/es/components/color-picker/src/color-picker2.mjs +320 -38
  239. package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
  240. package/es/components/color-picker/src/components/predefine.mjs +1 -1
  241. package/es/components/index.mjs +1 -1
  242. package/es/hooks/index.d.ts +1 -0
  243. package/es/hooks/index.mjs +1 -0
  244. package/es/hooks/index.mjs.map +1 -1
  245. package/es/hooks/use-popper/index.d.ts +20 -0
  246. package/es/hooks/use-popper/index.mjs +95 -0
  247. package/es/hooks/use-popper/index.mjs.map +1 -0
  248. package/es/index.mjs +2 -1
  249. package/es/index.mjs.map +1 -1
  250. package/es/version.d.ts +1 -1
  251. package/es/version.mjs +1 -1
  252. package/es/version.mjs.map +1 -1
  253. package/lib/components/color-picker/index.js +2 -2
  254. package/lib/components/color-picker/src/color-picker.js +38 -318
  255. package/lib/components/color-picker/src/color-picker.js.map +1 -1
  256. package/lib/components/color-picker/src/color-picker2.js +318 -38
  257. package/lib/components/color-picker/src/color-picker2.js.map +1 -1
  258. package/lib/components/color-picker/src/components/predefine.js +1 -1
  259. package/lib/components/index.js +1 -1
  260. package/lib/hooks/index.d.ts +1 -0
  261. package/lib/hooks/index.js +47 -45
  262. package/lib/hooks/index.js.map +1 -1
  263. package/lib/hooks/use-popper/index.d.ts +20 -0
  264. package/lib/hooks/use-popper/index.js +99 -0
  265. package/lib/hooks/use-popper/index.js.map +1 -0
  266. package/lib/index.js +48 -46
  267. package/lib/index.js.map +1 -1
  268. package/lib/version.d.ts +1 -1
  269. package/lib/version.js +1 -1
  270. package/lib/version.js.map +1 -1
  271. package/package.json +2 -2
  272. package/web-types.json +1 -1
@@ -1,45 +1,327 @@
1
- import { isNil } from 'lodash-unified';
2
- import '../../../utils/index.mjs';
1
+ import { defineComponent, ref, reactive, computed, nextTick, onMounted, watch, provide, openBlock, createBlock, unref, withCtx, withDirectives, createElementBlock, createElementVNode, normalizeClass, createVNode, createCommentVNode, withKeys, 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';
3
6
  import '../../../hooks/index.mjs';
7
+ import { ElTooltip } from '../../tooltip/index.mjs';
8
+ import { ElInput } from '../../input/index.mjs';
4
9
  import '../../../constants/index.mjs';
5
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
6
- import { useSizeProp } from '../../../hooks/use-common-props/index.mjs';
7
- import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
8
- import { isString } from '@vue/shared';
10
+ import '../../../utils/index.mjs';
11
+ import { ArrowDown, Close } from '@element-plus/icons-vue';
12
+ import AlphaSlider from './components/alpha-slider.mjs';
13
+ import HueSlider from './components/hue-slider.mjs';
14
+ import Predefine from './components/predefine.mjs';
15
+ import SvPanel from './components/sv-panel.mjs';
16
+ import Color from './utils/color.mjs';
17
+ import { colorPickerProps, colorPickerEmits, colorPickerContextKey } from './color-picker.mjs';
18
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
19
+ import { useLocale } from '../../../hooks/use-locale/index.mjs';
20
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
21
+ import { useFormItem, useFormItemInputId } from '../../../hooks/use-form-item/index.mjs';
22
+ import { useSize, useDisabled } from '../../../hooks/use-common-props/index.mjs';
23
+ import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
24
+ import { debugWarn } from '../../../utils/error.mjs';
25
+ import ClickOutside from '../../../directives/click-outside/index.mjs';
9
26
 
10
- const colorPickerProps = buildProps({
11
- modelValue: String,
12
- id: String,
13
- showAlpha: Boolean,
14
- colorFormat: String,
15
- disabled: Boolean,
16
- size: useSizeProp,
17
- popperClass: {
18
- type: String,
19
- default: ""
20
- },
21
- label: {
22
- type: String,
23
- default: void 0
24
- },
25
- tabindex: {
26
- type: [String, Number],
27
- default: 0
28
- },
29
- predefine: {
30
- type: definePropType(Array)
31
- },
32
- validateEvent: {
33
- type: Boolean,
34
- default: true
27
+ const _hoisted_1 = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex", "onKeydown"];
28
+ const __default__ = defineComponent({
29
+ name: "ElColorPicker"
30
+ });
31
+ const _sfc_main = /* @__PURE__ */ defineComponent({
32
+ ...__default__,
33
+ props: colorPickerProps,
34
+ emits: colorPickerEmits,
35
+ setup(__props, { expose, emit }) {
36
+ const props = __props;
37
+ const { t } = useLocale();
38
+ const ns = useNamespace("color");
39
+ const { formItem } = useFormItem();
40
+ const colorSize = useSize();
41
+ const colorDisabled = useDisabled();
42
+ const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {
43
+ formItemContext: formItem
44
+ });
45
+ const hue = ref();
46
+ const sv = ref();
47
+ const alpha = ref();
48
+ const popper = ref();
49
+ let shouldActiveChange = true;
50
+ const color = reactive(new Color({
51
+ enableAlpha: props.showAlpha,
52
+ format: props.colorFormat || "",
53
+ value: props.modelValue
54
+ }));
55
+ const showPicker = ref(false);
56
+ const showPanelColor = ref(false);
57
+ const customInput = ref("");
58
+ const displayedColor = computed(() => {
59
+ if (!props.modelValue && !showPanelColor.value) {
60
+ return "transparent";
61
+ }
62
+ return displayedRgb(color, props.showAlpha);
63
+ });
64
+ const currentColor = computed(() => {
65
+ return !props.modelValue && !showPanelColor.value ? "" : color.value;
66
+ });
67
+ const buttonAriaLabel = computed(() => {
68
+ return !isLabeledByFormItem.value ? props.label || t("el.colorpicker.defaultLabel") : void 0;
69
+ });
70
+ const buttonAriaLabelledby = computed(() => {
71
+ return isLabeledByFormItem.value ? formItem == null ? void 0 : formItem.labelId : void 0;
72
+ });
73
+ const btnKls = computed(() => {
74
+ return [
75
+ ns.b("picker"),
76
+ ns.is("disabled", colorDisabled.value),
77
+ ns.bm("picker", colorSize.value)
78
+ ];
79
+ });
80
+ function displayedRgb(color2, showAlpha) {
81
+ if (!(color2 instanceof Color)) {
82
+ throw new TypeError("color should be instance of _color Class");
83
+ }
84
+ const { r, g, b } = color2.toRgb();
85
+ return showAlpha ? `rgba(${r}, ${g}, ${b}, ${color2.get("alpha") / 100})` : `rgb(${r}, ${g}, ${b})`;
86
+ }
87
+ function setShowPicker(value) {
88
+ showPicker.value = value;
89
+ }
90
+ const debounceSetShowPicker = debounce(setShowPicker, 100);
91
+ function hide() {
92
+ debounceSetShowPicker(false);
93
+ resetColor();
94
+ }
95
+ function resetColor() {
96
+ nextTick(() => {
97
+ if (props.modelValue) {
98
+ color.fromString(props.modelValue);
99
+ } else {
100
+ color.value = "";
101
+ nextTick(() => {
102
+ showPanelColor.value = false;
103
+ });
104
+ }
105
+ });
106
+ }
107
+ function handleTrigger() {
108
+ if (colorDisabled.value)
109
+ return;
110
+ debounceSetShowPicker(!showPicker.value);
111
+ }
112
+ function handleConfirm() {
113
+ color.fromString(customInput.value);
114
+ }
115
+ function confirmValue() {
116
+ const value = color.value;
117
+ emit(UPDATE_MODEL_EVENT, value);
118
+ emit("change", value);
119
+ if (props.validateEvent) {
120
+ formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
121
+ }
122
+ debounceSetShowPicker(false);
123
+ nextTick(() => {
124
+ const newColor = new Color({
125
+ enableAlpha: props.showAlpha,
126
+ format: props.colorFormat || "",
127
+ value: props.modelValue
128
+ });
129
+ if (!color.compare(newColor)) {
130
+ resetColor();
131
+ }
132
+ });
133
+ }
134
+ function clear() {
135
+ debounceSetShowPicker(false);
136
+ emit(UPDATE_MODEL_EVENT, null);
137
+ emit("change", null);
138
+ if (props.modelValue !== null && props.validateEvent) {
139
+ formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
140
+ }
141
+ resetColor();
142
+ }
143
+ onMounted(() => {
144
+ if (props.modelValue) {
145
+ customInput.value = currentColor.value;
146
+ }
147
+ });
148
+ watch(() => props.modelValue, (newVal) => {
149
+ if (!newVal) {
150
+ showPanelColor.value = false;
151
+ } else if (newVal && newVal !== color.value) {
152
+ shouldActiveChange = false;
153
+ color.fromString(newVal);
154
+ }
155
+ });
156
+ watch(() => currentColor.value, (val) => {
157
+ customInput.value = val;
158
+ shouldActiveChange && emit("activeChange", val);
159
+ shouldActiveChange = true;
160
+ });
161
+ watch(() => color.value, () => {
162
+ if (!props.modelValue && !showPanelColor.value) {
163
+ showPanelColor.value = true;
164
+ }
165
+ });
166
+ watch(() => showPicker.value, () => {
167
+ nextTick(() => {
168
+ var _a, _b, _c;
169
+ (_a = hue.value) == null ? void 0 : _a.update();
170
+ (_b = sv.value) == null ? void 0 : _b.update();
171
+ (_c = alpha.value) == null ? void 0 : _c.update();
172
+ });
173
+ });
174
+ provide(colorPickerContextKey, {
175
+ currentColor
176
+ });
177
+ expose({
178
+ color
179
+ });
180
+ return (_ctx, _cache) => {
181
+ return openBlock(), createBlock(unref(ElTooltip), {
182
+ ref_key: "popper",
183
+ ref: popper,
184
+ visible: showPicker.value,
185
+ "show-arrow": false,
186
+ "fallback-placements": ["bottom", "top", "right", "left"],
187
+ offset: 0,
188
+ "gpu-acceleration": false,
189
+ "popper-class": [unref(ns).be("picker", "panel"), unref(ns).b("dropdown"), _ctx.popperClass],
190
+ "stop-popper-mouse-event": false,
191
+ effect: "light",
192
+ trigger: "click",
193
+ transition: `${unref(ns).namespace.value}-zoom-in-top`,
194
+ persistent: ""
195
+ }, {
196
+ content: withCtx(() => [
197
+ withDirectives((openBlock(), createElementBlock("div", null, [
198
+ createElementVNode("div", {
199
+ class: normalizeClass(unref(ns).be("dropdown", "main-wrapper"))
200
+ }, [
201
+ createVNode(HueSlider, {
202
+ ref_key: "hue",
203
+ ref: hue,
204
+ class: "hue-slider",
205
+ color: unref(color),
206
+ vertical: ""
207
+ }, null, 8, ["color"]),
208
+ createVNode(SvPanel, {
209
+ ref: "svPanel",
210
+ color: unref(color)
211
+ }, null, 8, ["color"])
212
+ ], 2),
213
+ _ctx.showAlpha ? (openBlock(), createBlock(AlphaSlider, {
214
+ key: 0,
215
+ ref_key: "alpha",
216
+ ref: alpha,
217
+ color: unref(color)
218
+ }, null, 8, ["color"])) : createCommentVNode("v-if", true),
219
+ _ctx.predefine ? (openBlock(), createBlock(Predefine, {
220
+ key: 1,
221
+ ref: "predefine",
222
+ color: unref(color),
223
+ colors: _ctx.predefine
224
+ }, null, 8, ["color", "colors"])) : createCommentVNode("v-if", true),
225
+ createElementVNode("div", {
226
+ class: normalizeClass(unref(ns).be("dropdown", "btns"))
227
+ }, [
228
+ createElementVNode("span", {
229
+ class: normalizeClass(unref(ns).be("dropdown", "value"))
230
+ }, [
231
+ createVNode(unref(ElInput), {
232
+ modelValue: customInput.value,
233
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
234
+ "validate-event": false,
235
+ size: "small",
236
+ onKeyup: withKeys(handleConfirm, ["enter"]),
237
+ onBlur: handleConfirm
238
+ }, null, 8, ["modelValue", "onKeyup"])
239
+ ], 2),
240
+ createVNode(unref(ElButton), {
241
+ class: normalizeClass(unref(ns).be("dropdown", "link-btn")),
242
+ text: "",
243
+ size: "small",
244
+ onClick: clear
245
+ }, {
246
+ default: withCtx(() => [
247
+ createTextVNode(toDisplayString(unref(t)("el.colorpicker.clear")), 1)
248
+ ]),
249
+ _: 1
250
+ }, 8, ["class"]),
251
+ createVNode(unref(ElButton), {
252
+ plain: "",
253
+ size: "small",
254
+ class: normalizeClass(unref(ns).be("dropdown", "btn")),
255
+ onClick: confirmValue
256
+ }, {
257
+ default: withCtx(() => [
258
+ createTextVNode(toDisplayString(unref(t)("el.colorpicker.confirm")), 1)
259
+ ]),
260
+ _: 1
261
+ }, 8, ["class"])
262
+ ], 2)
263
+ ])), [
264
+ [unref(ClickOutside), hide]
265
+ ])
266
+ ]),
267
+ default: withCtx(() => [
268
+ createElementVNode("div", {
269
+ id: unref(buttonId),
270
+ class: normalizeClass(unref(btnKls)),
271
+ role: "button",
272
+ "aria-label": unref(buttonAriaLabel),
273
+ "aria-labelledby": unref(buttonAriaLabelledby),
274
+ "aria-description": unref(t)("el.colorpicker.description", { color: _ctx.modelValue || "" }),
275
+ tabindex: _ctx.tabindex,
276
+ onKeydown: withKeys(handleTrigger, ["enter"])
277
+ }, [
278
+ unref(colorDisabled) ? (openBlock(), createElementBlock("div", {
279
+ key: 0,
280
+ class: normalizeClass(unref(ns).be("picker", "mask"))
281
+ }, null, 2)) : createCommentVNode("v-if", true),
282
+ createElementVNode("div", {
283
+ class: normalizeClass(unref(ns).be("picker", "trigger")),
284
+ onClick: handleTrigger
285
+ }, [
286
+ createElementVNode("span", {
287
+ class: normalizeClass([unref(ns).be("picker", "color"), unref(ns).is("alpha", _ctx.showAlpha)])
288
+ }, [
289
+ createElementVNode("span", {
290
+ class: normalizeClass(unref(ns).be("picker", "color-inner")),
291
+ style: normalizeStyle({
292
+ backgroundColor: unref(displayedColor)
293
+ })
294
+ }, [
295
+ withDirectives(createVNode(unref(ElIcon), {
296
+ class: normalizeClass([unref(ns).be("picker", "icon"), unref(ns).is("icon-arrow-down")])
297
+ }, {
298
+ default: withCtx(() => [
299
+ createVNode(unref(ArrowDown))
300
+ ]),
301
+ _: 1
302
+ }, 8, ["class"]), [
303
+ [vShow, _ctx.modelValue || showPanelColor.value]
304
+ ]),
305
+ !_ctx.modelValue && !showPanelColor.value ? (openBlock(), createBlock(unref(ElIcon), {
306
+ key: 0,
307
+ class: normalizeClass([unref(ns).be("picker", "empty"), unref(ns).is("icon-close")])
308
+ }, {
309
+ default: withCtx(() => [
310
+ createVNode(unref(Close))
311
+ ]),
312
+ _: 1
313
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
314
+ ], 6)
315
+ ], 2)
316
+ ], 2)
317
+ ], 42, _hoisted_1)
318
+ ]),
319
+ _: 1
320
+ }, 8, ["visible", "popper-class", "transition"]);
321
+ };
35
322
  }
36
323
  });
37
- const colorPickerEmits = {
38
- [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val),
39
- [CHANGE_EVENT]: (val) => isString(val) || isNil(val),
40
- activeChange: (val) => isString(val) || isNil(val)
41
- };
42
- const colorPickerContextKey = Symbol("colorPickerContextKey");
324
+ var ColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/color-picker.vue"]]);
43
325
 
44
- export { colorPickerContextKey, colorPickerEmits, colorPickerProps };
326
+ export { ColorPicker as default };
45
327
  //# sourceMappingURL=color-picker2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker2.mjs","sources":["../../../../../../packages/components/color-picker/src/color-picker.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport { buildProps, definePropType, isString } from '@element-plus/utils'\nimport { useSizeProp } from '@element-plus/hooks'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { ComputedRef, ExtractPropTypes, InjectionKey } from 'vue'\nimport type ColorPicker from './color-picker.vue'\n\nexport const colorPickerProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: String,\n /**\n * @description ColorPicker id\n */\n id: String,\n /**\n * @description whether to display the alpha slider\n */\n showAlpha: Boolean,\n /**\n * @description color format of v-model\n */\n colorFormat: String,\n /**\n * @description whether to disable the ColorPicker\n */\n disabled: Boolean,\n /**\n * @description size of ColorPicker\n */\n size: useSizeProp,\n /**\n * @description custom class name for ColorPicker's dropdown\n */\n popperClass: {\n type: String,\n default: '',\n },\n /**\n * @description ColorPicker aria-label\n */\n label: {\n type: String,\n default: undefined,\n },\n /**\n * @description ColorPicker tabindex\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description predefined color options\n */\n predefine: {\n type: definePropType<string[]>(Array),\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport const colorPickerEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | null) => isString(val) || isNil(val),\n [CHANGE_EVENT]: (val: string | null) => isString(val) || isNil(val),\n activeChange: (val: string | null) => isString(val) || isNil(val),\n}\n\nexport type ColorPickerProps = ExtractPropTypes<typeof colorPickerProps>\nexport type ColorPickerEmits = typeof colorPickerEmits\nexport type ColorPickerInstance = InstanceType<typeof ColorPicker>\n\nexport interface ColorPickerContext {\n currentColor: ComputedRef<string>\n}\n\nexport const colorPickerContextKey: InjectionKey<ColorPickerContext> = Symbol(\n 'colorPickerContextKey'\n)\n"],"names":[],"mappings":";;;;;;;;;AAIY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,EAAE,EAAE,MAAM;AACZ,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;AAC5D,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;AACtD,EAAE,YAAY,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;AACpD,EAAE;AACU,MAAC,qBAAqB,GAAG,MAAM,CAAC,uBAAuB;;;;"}
1
+ {"version":3,"file":"color-picker2.mjs","sources":["../../../../../../packages/components/color-picker/src/color-picker.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"popper\"\n :visible=\"showPicker\"\n :show-arrow=\"false\"\n :fallback-placements=\"['bottom', 'top', 'right', 'left']\"\n :offset=\"0\"\n :gpu-acceleration=\"false\"\n :popper-class=\"[ns.be('picker', 'panel'), ns.b('dropdown'), popperClass]\"\n :stop-popper-mouse-event=\"false\"\n effect=\"light\"\n trigger=\"click\"\n :transition=\"`${ns.namespace.value}-zoom-in-top`\"\n persistent\n >\n <template #content>\n <div v-click-outside=\"hide\">\n <div :class=\"ns.be('dropdown', 'main-wrapper')\">\n <hue-slider ref=\"hue\" class=\"hue-slider\" :color=\"color\" vertical />\n <sv-panel ref=\"svPanel\" :color=\"color\" />\n </div>\n <alpha-slider v-if=\"showAlpha\" ref=\"alpha\" :color=\"color\" />\n <predefine\n v-if=\"predefine\"\n ref=\"predefine\"\n :color=\"color\"\n :colors=\"predefine\"\n />\n <div :class=\"ns.be('dropdown', 'btns')\">\n <span :class=\"ns.be('dropdown', 'value')\">\n <el-input\n v-model=\"customInput\"\n :validate-event=\"false\"\n size=\"small\"\n @keyup.enter=\"handleConfirm\"\n @blur=\"handleConfirm\"\n />\n </span>\n <el-button\n :class=\"ns.be('dropdown', 'link-btn')\"\n text\n size=\"small\"\n @click=\"clear\"\n >\n {{ t('el.colorpicker.clear') }}\n </el-button>\n <el-button\n plain\n size=\"small\"\n :class=\"ns.be('dropdown', 'btn')\"\n @click=\"confirmValue\"\n >\n {{ t('el.colorpicker.confirm') }}\n </el-button>\n </div>\n </div>\n </template>\n <template #default>\n <div\n :id=\"buttonId\"\n :class=\"btnKls\"\n role=\"button\"\n :aria-label=\"buttonAriaLabel\"\n :aria-labelledby=\"buttonAriaLabelledby\"\n :aria-description=\"\n t('el.colorpicker.description', { color: modelValue || '' })\n \"\n :tabindex=\"tabindex\"\n @keydown.enter=\"handleTrigger\"\n >\n <div v-if=\"colorDisabled\" :class=\"ns.be('picker', 'mask')\" />\n <div :class=\"ns.be('picker', 'trigger')\" @click=\"handleTrigger\">\n <span :class=\"[ns.be('picker', 'color'), ns.is('alpha', showAlpha)]\">\n <span\n :class=\"ns.be('picker', 'color-inner')\"\n :style=\"{\n backgroundColor: displayedColor,\n }\"\n >\n <el-icon\n v-show=\"modelValue || showPanelColor\"\n :class=\"[ns.be('picker', 'icon'), ns.is('icon-arrow-down')]\"\n >\n <arrow-down />\n </el-icon>\n <el-icon\n v-if=\"!modelValue && !showPanelColor\"\n :class=\"[ns.be('picker', 'empty'), ns.is('icon-close')]\"\n >\n <close />\n </el-icon>\n </span>\n </span>\n </div>\n </div>\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue'\nimport { debounce } from 'lodash-unified'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ClickOutside as vClickOutside } from '@element-plus/directives'\nimport {\n useDisabled,\n useFormItem,\n useFormItemInputId,\n useLocale,\n useNamespace,\n useSize,\n} from '@element-plus/hooks'\nimport { ElTooltip } from '@element-plus/components/tooltip'\nimport { ElInput } from '@element-plus/components/input'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { debugWarn } from '@element-plus/utils'\nimport { ArrowDown, Close } from '@element-plus/icons-vue'\nimport AlphaSlider from './components/alpha-slider.vue'\nimport HueSlider from './components/hue-slider.vue'\nimport Predefine from './components/predefine.vue'\nimport SvPanel from './components/sv-panel.vue'\nimport Color from './utils/color'\nimport {\n colorPickerContextKey,\n colorPickerEmits,\n colorPickerProps,\n} from './color-picker'\nimport type { TooltipInstance } from '@element-plus/components/tooltip'\n\ndefineOptions({\n name: 'ElColorPicker',\n})\nconst props = defineProps(colorPickerProps)\nconst emit = defineEmits(colorPickerEmits)\n\nconst { t } = useLocale()\nconst ns = useNamespace('color')\nconst { formItem } = useFormItem()\nconst colorSize = useSize()\nconst colorDisabled = useDisabled()\n\nconst { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst hue = ref<InstanceType<typeof HueSlider>>()\nconst sv = ref<InstanceType<typeof SvPanel>>()\nconst alpha = ref<InstanceType<typeof AlphaSlider>>()\nconst popper = ref<TooltipInstance>()\n\n// active-change is used to prevent modelValue changes from triggering.\nlet shouldActiveChange = true\n\nconst color = reactive(\n new Color({\n enableAlpha: props.showAlpha,\n format: props.colorFormat || '',\n value: props.modelValue,\n })\n) as Color\n\nconst showPicker = ref(false)\nconst showPanelColor = ref(false)\nconst customInput = ref('')\n\nconst displayedColor = computed(() => {\n if (!props.modelValue && !showPanelColor.value) {\n return 'transparent'\n }\n return displayedRgb(color, props.showAlpha)\n})\n\nconst currentColor = computed(() => {\n return !props.modelValue && !showPanelColor.value ? '' : color.value\n})\n\nconst buttonAriaLabel = computed<string | undefined>(() => {\n return !isLabeledByFormItem.value\n ? props.label || t('el.colorpicker.defaultLabel')\n : undefined\n})\n\nconst buttonAriaLabelledby = computed<string | undefined>(() => {\n return isLabeledByFormItem.value ? formItem?.labelId : undefined\n})\n\nconst btnKls = computed(() => {\n return [\n ns.b('picker'),\n ns.is('disabled', colorDisabled.value),\n ns.bm('picker', colorSize.value),\n ]\n})\n\nfunction displayedRgb(color: Color, showAlpha: boolean) {\n if (!(color instanceof Color)) {\n throw new TypeError('color should be instance of _color Class')\n }\n\n const { r, g, b } = color.toRgb()\n return showAlpha\n ? `rgba(${r}, ${g}, ${b}, ${color.get('alpha') / 100})`\n : `rgb(${r}, ${g}, ${b})`\n}\n\nfunction setShowPicker(value: boolean) {\n showPicker.value = value\n}\n\nconst debounceSetShowPicker = debounce(setShowPicker, 100)\n\nfunction hide() {\n debounceSetShowPicker(false)\n resetColor()\n}\n\nfunction resetColor() {\n nextTick(() => {\n if (props.modelValue) {\n color.fromString(props.modelValue)\n } else {\n color.value = ''\n nextTick(() => {\n showPanelColor.value = false\n })\n }\n })\n}\n\nfunction handleTrigger() {\n if (colorDisabled.value) return\n debounceSetShowPicker(!showPicker.value)\n}\n\nfunction handleConfirm() {\n color.fromString(customInput.value)\n}\n\nfunction confirmValue() {\n const value = color.value\n emit(UPDATE_MODEL_EVENT, value)\n emit('change', value)\n if (props.validateEvent) {\n formItem?.validate('change').catch((err) => debugWarn(err))\n }\n debounceSetShowPicker(false)\n // check if modelValue change, if not change, then reset color.\n nextTick(() => {\n const newColor = new Color({\n enableAlpha: props.showAlpha,\n format: props.colorFormat || '',\n value: props.modelValue,\n })\n if (!color.compare(newColor)) {\n resetColor()\n }\n })\n}\n\nfunction clear() {\n debounceSetShowPicker(false)\n emit(UPDATE_MODEL_EVENT, null)\n emit('change', null)\n if (props.modelValue !== null && props.validateEvent) {\n formItem?.validate('change').catch((err) => debugWarn(err))\n }\n resetColor()\n}\n\nonMounted(() => {\n if (props.modelValue) {\n customInput.value = currentColor.value\n }\n})\n\nwatch(\n () => props.modelValue,\n (newVal) => {\n if (!newVal) {\n showPanelColor.value = false\n } else if (newVal && newVal !== color.value) {\n shouldActiveChange = false\n color.fromString(newVal)\n }\n }\n)\n\nwatch(\n () => currentColor.value,\n (val) => {\n customInput.value = val\n shouldActiveChange && emit('activeChange', val)\n shouldActiveChange = true\n }\n)\n\nwatch(\n () => color.value,\n () => {\n if (!props.modelValue && !showPanelColor.value) {\n showPanelColor.value = true\n }\n }\n)\n\nwatch(\n () => showPicker.value,\n () => {\n nextTick(() => {\n hue.value?.update()\n sv.value?.update()\n alpha.value?.update()\n })\n }\n)\n\nprovide(colorPickerContextKey, {\n currentColor,\n})\n\ndefineExpose({\n /**\n * @description current color object\n */\n color,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;mCA0Ic,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAM,MAAA,EAAE,MAAM,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAK,aAAa,OAAO,CAAA,CAAA;AAC/B,IAAM,MAAA,EAAE,aAAa,WAAY,EAAA,CAAA;AACjC,IAAA,MAAM,YAAY,OAAQ,EAAA,CAAA;AAC1B,IAAA,MAAM,gBAAgB,WAAY,EAAA,CAAA;AAElC,IAAA,MAAM,EAAE,OAAA,EAAS,QAAU,EAAA,mBAAA,EAAA,GAAwB,mBAAmB,KAAO,EAAA;AAAA,MAC3E,eAAiB,EAAA,QAAA;AAAA,KAClB,CAAA,CAAA;AAED,IAAA,MAAM,MAAM,GAAoC,EAAA,CAAA;AAChD,IAAA,MAAM,KAAK,GAAkC,EAAA,CAAA;AAC7C,IAAA,MAAM,QAAQ,GAAsC,EAAA,CAAA;AACpD,IAAA,MAAM,SAAS,GAAqB,EAAA,CAAA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MAAqB,kBAAA,GAAA,IAAA,CAAA;AAAA,KAEzB,CAAA,CAAA;AAEA,IACE,KAAA,CAAA,MAAM,KAAM,CAAA,KAAA,EACZ,MAAM;AACJ,MAAA,IAAI,CAAC,KAAA,CAAM,UAAc,IAAA,CAAC,eAAe,KAAO,EAAA;AAC9C,QAAA,cAAA,CAAe,KAAQ,GAAA,IAAA,CAAA;AAAA,OACzB;AAAA,KAEJ,CAAA,CAAA;AAEA,IACE,KAAA,CAAA,MAAM,UAAW,CAAA,KAAA,EACjB,MAAM;AACJ,MAAA,QAAA,CAAS,MAAM;AACb,QAAA,IAAI,QAAc,EAAA,CAAA;AAClB,QAAA,CAAA,EAAG,OAAO,KAAO,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA,EAAA,CAAA;AACjB,QAAA,CAAA,EAAA,GAAM,QAAc,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA,EAAA,CAAA;AAAA,QACrB,CAAA,EAAA,GAAA,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,MAAA,EAAA,CAAA;AAAA,OAEL,CAAA,CAAA;AAEA,KAAA,CAAA,CAAA;AAA+B,IAC7B,OAAA,CAAA,qBAAA,EAAA;AAAA,MACD,YAAA;AAED,KAAa,CAAA,CAAA;AAAA,IAIX,MAAA,CAAA;AAAA,MACD,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, inject, ref, watch, watchEffect, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle } from 'vue';
2
2
  import '../../../../hooks/index.mjs';
3
- import { colorPickerContextKey } from '../color-picker2.mjs';
3
+ import { colorPickerContextKey } from '../color-picker.mjs';
4
4
  import Color from '../utils/color.mjs';
5
5
  import _export_sfc from '../../../../_virtual/plugin-vue_export-helper.mjs';
6
6
  import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
@@ -95,7 +95,7 @@ export { checkboxEmits, checkboxProps } from './checkbox/src/checkbox.mjs';
95
95
  export { colProps } from './col/src/col.mjs';
96
96
  export { collapseEmits, collapseProps, emitChangeFn } from './collapse/src/collapse.mjs';
97
97
  export { collapseItemProps } from './collapse/src/collapse-item.mjs';
98
- export { colorPickerContextKey, colorPickerEmits, colorPickerProps } from './color-picker/src/color-picker2.mjs';
98
+ export { colorPickerContextKey, colorPickerEmits, colorPickerProps } from './color-picker/src/color-picker.mjs';
99
99
  export { configProviderProps, messageConfig } from './config-provider/src/config-provider.mjs';
100
100
  export { countdownEmits, countdownProps } from './countdown/src/countdown.mjs';
101
101
  export { descriptionProps } from './descriptions/src/description.mjs';
@@ -11,6 +11,7 @@ export * from './use-modal';
11
11
  export * from './use-model-toggle';
12
12
  export * from './use-prevent-global';
13
13
  export * from './use-prop';
14
+ export * from './use-popper';
14
15
  export * from './use-restore-active';
15
16
  export * from './use-same-target';
16
17
  export * from './use-teleport';
@@ -11,6 +11,7 @@ export { useModal } from './use-modal/index.mjs';
11
11
  export { createModelToggleComposable, useModelToggle, useModelToggleEmits, useModelToggleProps } from './use-model-toggle/index.mjs';
12
12
  export { usePreventGlobal } from './use-prevent-global/index.mjs';
13
13
  export { useProp } from './use-prop/index.mjs';
14
+ export { usePopper } from './use-popper/index.mjs';
14
15
  export { useRestoreActive } from './use-restore-active/index.mjs';
15
16
  export { useSameTarget } from './use-same-target/index.mjs';
16
17
  export { useTeleport } from './use-teleport/index.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,20 @@
1
+ import type { Ref } from 'vue';
2
+ import type { Instance, Options, State, VirtualElement } from '@popperjs/core';
3
+ declare type ElementType = HTMLElement | undefined;
4
+ declare type ReferenceElement = ElementType | VirtualElement;
5
+ export declare type PartialOptions = Partial<Options>;
6
+ export declare const usePopper: (referenceElementRef: Ref<ReferenceElement>, popperElementRef: Ref<ElementType>, opts?: Ref<PartialOptions> | PartialOptions) => {
7
+ state: import("vue").ComputedRef<State | undefined>;
8
+ styles: import("vue").ComputedRef<{
9
+ [key: string]: Partial<CSSStyleDeclaration>;
10
+ }>;
11
+ attributes: import("vue").ComputedRef<{
12
+ [key: string]: {
13
+ [key: string]: string | boolean;
14
+ };
15
+ }>;
16
+ update: () => Promise<Partial<State>> | undefined;
17
+ forceUpdate: () => void | undefined;
18
+ instanceRef: import("vue").ComputedRef<Instance | undefined>;
19
+ };
20
+ export {};
@@ -0,0 +1,95 @@
1
+ import { computed, unref, shallowRef, ref, watch, onBeforeUnmount } from 'vue';
2
+ import { createPopper } from '@popperjs/core';
3
+ import { fromPairs } from 'lodash-unified';
4
+
5
+ const usePopper = (referenceElementRef, popperElementRef, opts = {}) => {
6
+ const stateUpdater = {
7
+ name: "updateState",
8
+ enabled: true,
9
+ phase: "write",
10
+ fn: ({ state }) => {
11
+ const derivedState = deriveState(state);
12
+ Object.assign(states.value, derivedState);
13
+ },
14
+ requires: ["computeStyles"]
15
+ };
16
+ const options = computed(() => {
17
+ const { onFirstUpdate, placement, strategy, modifiers } = unref(opts);
18
+ return {
19
+ onFirstUpdate,
20
+ placement: placement || "bottom",
21
+ strategy: strategy || "absolute",
22
+ modifiers: [
23
+ ...modifiers || [],
24
+ stateUpdater,
25
+ { name: "applyStyles", enabled: false }
26
+ ]
27
+ };
28
+ });
29
+ const instanceRef = shallowRef();
30
+ const states = ref({
31
+ styles: {
32
+ popper: {
33
+ position: unref(options).strategy,
34
+ left: "0",
35
+ right: "0"
36
+ },
37
+ arrow: {
38
+ position: "absolute"
39
+ }
40
+ },
41
+ attributes: {}
42
+ });
43
+ const destroy = () => {
44
+ if (!instanceRef.value)
45
+ return;
46
+ instanceRef.value.destroy();
47
+ instanceRef.value = void 0;
48
+ };
49
+ watch(options, (newOptions) => {
50
+ const instance = unref(instanceRef);
51
+ if (instance) {
52
+ instance.setOptions(newOptions);
53
+ }
54
+ }, {
55
+ deep: true
56
+ });
57
+ watch([referenceElementRef, popperElementRef], ([referenceElement, popperElement]) => {
58
+ destroy();
59
+ if (!referenceElement || !popperElement)
60
+ return;
61
+ instanceRef.value = createPopper(referenceElement, popperElement, unref(options));
62
+ });
63
+ onBeforeUnmount(() => {
64
+ destroy();
65
+ });
66
+ return {
67
+ state: computed(() => {
68
+ var _a;
69
+ return (_a = unref(instanceRef)) == null ? void 0 : _a.state;
70
+ }),
71
+ styles: computed(() => unref(states).styles),
72
+ attributes: computed(() => unref(states).attributes),
73
+ update: () => {
74
+ var _a;
75
+ return (_a = unref(instanceRef)) == null ? void 0 : _a.update();
76
+ },
77
+ forceUpdate: () => {
78
+ var _a;
79
+ return (_a = unref(instanceRef)) == null ? void 0 : _a.forceUpdate();
80
+ },
81
+ instanceRef: computed(() => unref(instanceRef))
82
+ };
83
+ };
84
+ function deriveState(state) {
85
+ const elements = Object.keys(state.elements);
86
+ const styles = fromPairs(elements.map((element) => [element, state.elements[element] || {}]));
87
+ const attributes = fromPairs(elements.map((element) => [element, state.attributes[element]]));
88
+ return {
89
+ styles,
90
+ attributes
91
+ };
92
+ }
93
+
94
+ export { usePopper };
95
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-popper/index.ts"],"sourcesContent":["import { computed, onBeforeUnmount, ref, shallowRef, unref, watch } from 'vue'\nimport { createPopper } from '@popperjs/core'\nimport { fromPairs } from 'lodash-unified'\n\nimport type { Ref } from 'vue'\nimport type {\n Instance,\n Modifier,\n Options,\n State,\n VirtualElement,\n} from '@popperjs/core'\n\ntype ElementType = HTMLElement | undefined\ntype ReferenceElement = ElementType | VirtualElement\nexport type PartialOptions = Partial<Options>\n\nexport const usePopper = (\n referenceElementRef: Ref<ReferenceElement>,\n popperElementRef: Ref<ElementType>,\n opts: Ref<PartialOptions> | PartialOptions = {} as PartialOptions\n) => {\n const stateUpdater = {\n name: 'updateState',\n enabled: true,\n phase: 'write',\n fn: ({ state }) => {\n const derivedState = deriveState(state)\n\n Object.assign(states.value, derivedState)\n },\n requires: ['computeStyles'],\n } as Modifier<'updateState', any>\n\n const options = computed<Options>(() => {\n const { onFirstUpdate, placement, strategy, modifiers } = unref(opts)\n\n return {\n onFirstUpdate,\n placement: placement || 'bottom',\n strategy: strategy || 'absolute',\n modifiers: [\n ...(modifiers || []),\n stateUpdater,\n { name: 'applyStyles', enabled: false },\n ],\n }\n })\n\n const instanceRef = shallowRef<Instance | undefined>()\n const states = ref<Pick<State, 'styles' | 'attributes'>>({\n styles: {\n popper: {\n position: unref(options).strategy,\n left: '0',\n right: '0',\n },\n arrow: {\n position: 'absolute',\n },\n },\n attributes: {},\n })\n\n const destroy = () => {\n if (!instanceRef.value) return\n\n instanceRef.value.destroy()\n instanceRef.value = undefined\n }\n\n watch(\n options,\n (newOptions) => {\n const instance = unref(instanceRef)\n if (instance) {\n instance.setOptions(newOptions)\n }\n },\n {\n deep: true,\n }\n )\n\n watch(\n [referenceElementRef, popperElementRef],\n ([referenceElement, popperElement]) => {\n destroy()\n if (!referenceElement || !popperElement) return\n\n instanceRef.value = createPopper(\n referenceElement,\n popperElement,\n unref(options)\n )\n }\n )\n\n onBeforeUnmount(() => {\n destroy()\n })\n\n return {\n state: computed(() => unref(instanceRef)?.state),\n styles: computed(() => unref(states).styles),\n attributes: computed(() => unref(states).attributes),\n update: () => unref(instanceRef)?.update(),\n forceUpdate: () => unref(instanceRef)?.forceUpdate(),\n // Preventing end users from modifying the instance.\n instanceRef: computed(() => unref(instanceRef)),\n }\n}\n\nfunction deriveState(state: State) {\n const elements = Object.keys(state.elements) as unknown as Array<\n keyof State['elements']\n >\n\n const styles = fromPairs(\n elements.map(\n (element) =>\n [element, state.elements[element] || {}] as [\n string,\n State['styles'][keyof State['styles']]\n ]\n )\n )\n\n const attributes = fromPairs(\n elements.map(\n (element) =>\n [element, state.attributes[element]] as [\n string,\n State['attributes'][keyof State['attributes']]\n ]\n )\n )\n\n return {\n styles,\n attributes,\n }\n}\n"],"names":[],"mappings":";;;;AAGY,MAAC,SAAS,GAAG,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,IAAI,GAAG,EAAE,KAAK;AAC/E,EAAE,MAAM,YAAY,GAAG;AACvB,IAAI,IAAI,EAAE,aAAa;AACvB,IAAI,OAAO,EAAE,IAAI;AACjB,IAAI,KAAK,EAAE,OAAO;AAClB,IAAI,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK;AACvB,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9C,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAChD,KAAK;AACL,IAAI,QAAQ,EAAE,CAAC,eAAe,CAAC;AAC/B,GAAG,CAAC;AACJ,EAAE,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM;AACjC,IAAI,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;AAC1E,IAAI,OAAO;AACX,MAAM,aAAa;AACnB,MAAM,SAAS,EAAE,SAAS,IAAI,QAAQ;AACtC,MAAM,QAAQ,EAAE,QAAQ,IAAI,UAAU;AACtC,MAAM,SAAS,EAAE;AACjB,QAAQ,GAAG,SAAS,IAAI,EAAE;AAC1B,QAAQ,YAAY;AACpB,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,KAA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AC,GAAG,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAChG,EAAE,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAChG,EAAE,OAAO;AACT,IAAI,MAAM;AACV,IAAI,UAAU;AACd,GAAG,CAAC;AACJ;;;;"}
package/es/index.mjs CHANGED
@@ -46,7 +46,7 @@ export { collapseEmits, collapseProps, emitChangeFn } from './components/collaps
46
46
  export { collapseItemProps } from './components/collapse/src/collapse-item.mjs';
47
47
  export { ElCollapse, ElCollapseItem } from './components/collapse/index.mjs';
48
48
  export { ElCollapseTransition } from './components/collapse-transition/index.mjs';
49
- export { colorPickerContextKey, colorPickerEmits, colorPickerProps } from './components/color-picker/src/color-picker2.mjs';
49
+ export { colorPickerContextKey, colorPickerEmits, colorPickerProps } from './components/color-picker/src/color-picker.mjs';
50
50
  export { ElColorPicker } from './components/color-picker/index.mjs';
51
51
  export { configProviderProps, messageConfig } from './components/config-provider/src/config-provider.mjs';
52
52
  export { ElConfigProvider } from './components/config-provider/index.mjs';
@@ -215,6 +215,7 @@ export { useModal } from './hooks/use-modal/index.mjs';
215
215
  export { createModelToggleComposable, useModelToggle, useModelToggleEmits, useModelToggleProps } from './hooks/use-model-toggle/index.mjs';
216
216
  export { usePreventGlobal } from './hooks/use-prevent-global/index.mjs';
217
217
  export { useProp } from './hooks/use-prop/index.mjs';
218
+ export { usePopper } from './hooks/use-popper/index.mjs';
218
219
  export { useRestoreActive } from './hooks/use-restore-active/index.mjs';
219
220
  export { useSameTarget } from './hooks/use-same-target/index.mjs';
220
221
  export { useTeleport } from './hooks/use-teleport/index.mjs';
package/es/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/constants'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n\nexport { default as dayjs } from 'dayjs'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/constants'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n\nexport { default as dayjs } from 'dayjs'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
package/es/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.0.20221217";
1
+ export declare const version = "0.0.20221219";
package/es/version.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const version = "0.0.20221217";
1
+ const version = "0.0.20221219";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=version.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20221217'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20221219'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('../../utils/index.js');
6
- var colorPicker$1 = require('./src/color-picker.js');
7
- var colorPicker = require('./src/color-picker2.js');
6
+ var colorPicker$1 = require('./src/color-picker2.js');
7
+ var colorPicker = require('./src/color-picker.js');
8
8
  var install = require('../../utils/vue/install.js');
9
9
 
10
10
  const ElColorPicker = install.withInstall(colorPicker$1["default"]);