@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
@@ -2,50 +2,330 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var vue = require('vue');
5
6
  var lodashUnified = require('lodash-unified');
6
- require('../../../utils/index.js');
7
+ var index$6 = require('../../button/index.js');
8
+ var index$8 = require('../../icon/index.js');
9
+ require('../../../directives/index.js');
7
10
  require('../../../hooks/index.js');
11
+ var index$4 = require('../../tooltip/index.js');
12
+ var index$5 = require('../../input/index.js');
8
13
  require('../../../constants/index.js');
9
- var runtime = require('../../../utils/vue/props/runtime.js');
10
- var index = require('../../../hooks/use-common-props/index.js');
14
+ require('../../../utils/index.js');
15
+ var iconsVue = require('@element-plus/icons-vue');
16
+ var alphaSlider = require('./components/alpha-slider.js');
17
+ var hueSlider = require('./components/hue-slider.js');
18
+ var predefine = require('./components/predefine.js');
19
+ var svPanel = require('./components/sv-panel.js');
20
+ var color = require('./utils/color.js');
21
+ var colorPicker = require('./color-picker.js');
22
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
23
+ var index = require('../../../hooks/use-locale/index.js');
24
+ var index$1 = require('../../../hooks/use-namespace/index.js');
25
+ var index$2 = require('../../../hooks/use-form-item/index.js');
26
+ var index$3 = require('../../../hooks/use-common-props/index.js');
11
27
  var event = require('../../../constants/event.js');
12
- var shared = require('@vue/shared');
28
+ var error = require('../../../utils/error.js');
29
+ var index$7 = require('../../../directives/click-outside/index.js');
13
30
 
14
- const colorPickerProps = runtime.buildProps({
15
- modelValue: String,
16
- id: String,
17
- showAlpha: Boolean,
18
- colorFormat: String,
19
- disabled: Boolean,
20
- size: index.useSizeProp,
21
- popperClass: {
22
- type: String,
23
- default: ""
24
- },
25
- label: {
26
- type: String,
27
- default: void 0
28
- },
29
- tabindex: {
30
- type: [String, Number],
31
- default: 0
32
- },
33
- predefine: {
34
- type: runtime.definePropType(Array)
35
- },
36
- validateEvent: {
37
- type: Boolean,
38
- default: true
31
+ const _hoisted_1 = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex", "onKeydown"];
32
+ const __default__ = vue.defineComponent({
33
+ name: "ElColorPicker"
34
+ });
35
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
36
+ ...__default__,
37
+ props: colorPicker.colorPickerProps,
38
+ emits: colorPicker.colorPickerEmits,
39
+ setup(__props, { expose, emit }) {
40
+ const props = __props;
41
+ const { t } = index.useLocale();
42
+ const ns = index$1.useNamespace("color");
43
+ const { formItem } = index$2.useFormItem();
44
+ const colorSize = index$3.useSize();
45
+ const colorDisabled = index$3.useDisabled();
46
+ const { inputId: buttonId, isLabeledByFormItem } = index$2.useFormItemInputId(props, {
47
+ formItemContext: formItem
48
+ });
49
+ const hue = vue.ref();
50
+ const sv = vue.ref();
51
+ const alpha = vue.ref();
52
+ const popper = vue.ref();
53
+ let shouldActiveChange = true;
54
+ const color$1 = vue.reactive(new color["default"]({
55
+ enableAlpha: props.showAlpha,
56
+ format: props.colorFormat || "",
57
+ value: props.modelValue
58
+ }));
59
+ const showPicker = vue.ref(false);
60
+ const showPanelColor = vue.ref(false);
61
+ const customInput = vue.ref("");
62
+ const displayedColor = vue.computed(() => {
63
+ if (!props.modelValue && !showPanelColor.value) {
64
+ return "transparent";
65
+ }
66
+ return displayedRgb(color$1, props.showAlpha);
67
+ });
68
+ const currentColor = vue.computed(() => {
69
+ return !props.modelValue && !showPanelColor.value ? "" : color$1.value;
70
+ });
71
+ const buttonAriaLabel = vue.computed(() => {
72
+ return !isLabeledByFormItem.value ? props.label || t("el.colorpicker.defaultLabel") : void 0;
73
+ });
74
+ const buttonAriaLabelledby = vue.computed(() => {
75
+ return isLabeledByFormItem.value ? formItem == null ? void 0 : formItem.labelId : void 0;
76
+ });
77
+ const btnKls = vue.computed(() => {
78
+ return [
79
+ ns.b("picker"),
80
+ ns.is("disabled", colorDisabled.value),
81
+ ns.bm("picker", colorSize.value)
82
+ ];
83
+ });
84
+ function displayedRgb(color2, showAlpha) {
85
+ if (!(color2 instanceof color["default"])) {
86
+ throw new TypeError("color should be instance of _color Class");
87
+ }
88
+ const { r, g, b } = color2.toRgb();
89
+ return showAlpha ? `rgba(${r}, ${g}, ${b}, ${color2.get("alpha") / 100})` : `rgb(${r}, ${g}, ${b})`;
90
+ }
91
+ function setShowPicker(value) {
92
+ showPicker.value = value;
93
+ }
94
+ const debounceSetShowPicker = lodashUnified.debounce(setShowPicker, 100);
95
+ function hide() {
96
+ debounceSetShowPicker(false);
97
+ resetColor();
98
+ }
99
+ function resetColor() {
100
+ vue.nextTick(() => {
101
+ if (props.modelValue) {
102
+ color$1.fromString(props.modelValue);
103
+ } else {
104
+ color$1.value = "";
105
+ vue.nextTick(() => {
106
+ showPanelColor.value = false;
107
+ });
108
+ }
109
+ });
110
+ }
111
+ function handleTrigger() {
112
+ if (colorDisabled.value)
113
+ return;
114
+ debounceSetShowPicker(!showPicker.value);
115
+ }
116
+ function handleConfirm() {
117
+ color$1.fromString(customInput.value);
118
+ }
119
+ function confirmValue() {
120
+ const value = color$1.value;
121
+ emit(event.UPDATE_MODEL_EVENT, value);
122
+ emit("change", value);
123
+ if (props.validateEvent) {
124
+ formItem == null ? void 0 : formItem.validate("change").catch((err) => error.debugWarn(err));
125
+ }
126
+ debounceSetShowPicker(false);
127
+ vue.nextTick(() => {
128
+ const newColor = new color["default"]({
129
+ enableAlpha: props.showAlpha,
130
+ format: props.colorFormat || "",
131
+ value: props.modelValue
132
+ });
133
+ if (!color$1.compare(newColor)) {
134
+ resetColor();
135
+ }
136
+ });
137
+ }
138
+ function clear() {
139
+ debounceSetShowPicker(false);
140
+ emit(event.UPDATE_MODEL_EVENT, null);
141
+ emit("change", null);
142
+ if (props.modelValue !== null && props.validateEvent) {
143
+ formItem == null ? void 0 : formItem.validate("change").catch((err) => error.debugWarn(err));
144
+ }
145
+ resetColor();
146
+ }
147
+ vue.onMounted(() => {
148
+ if (props.modelValue) {
149
+ customInput.value = currentColor.value;
150
+ }
151
+ });
152
+ vue.watch(() => props.modelValue, (newVal) => {
153
+ if (!newVal) {
154
+ showPanelColor.value = false;
155
+ } else if (newVal && newVal !== color$1.value) {
156
+ shouldActiveChange = false;
157
+ color$1.fromString(newVal);
158
+ }
159
+ });
160
+ vue.watch(() => currentColor.value, (val) => {
161
+ customInput.value = val;
162
+ shouldActiveChange && emit("activeChange", val);
163
+ shouldActiveChange = true;
164
+ });
165
+ vue.watch(() => color$1.value, () => {
166
+ if (!props.modelValue && !showPanelColor.value) {
167
+ showPanelColor.value = true;
168
+ }
169
+ });
170
+ vue.watch(() => showPicker.value, () => {
171
+ vue.nextTick(() => {
172
+ var _a, _b, _c;
173
+ (_a = hue.value) == null ? void 0 : _a.update();
174
+ (_b = sv.value) == null ? void 0 : _b.update();
175
+ (_c = alpha.value) == null ? void 0 : _c.update();
176
+ });
177
+ });
178
+ vue.provide(colorPicker.colorPickerContextKey, {
179
+ currentColor
180
+ });
181
+ expose({
182
+ color: color$1
183
+ });
184
+ return (_ctx, _cache) => {
185
+ return vue.openBlock(), vue.createBlock(vue.unref(index$4.ElTooltip), {
186
+ ref_key: "popper",
187
+ ref: popper,
188
+ visible: showPicker.value,
189
+ "show-arrow": false,
190
+ "fallback-placements": ["bottom", "top", "right", "left"],
191
+ offset: 0,
192
+ "gpu-acceleration": false,
193
+ "popper-class": [vue.unref(ns).be("picker", "panel"), vue.unref(ns).b("dropdown"), _ctx.popperClass],
194
+ "stop-popper-mouse-event": false,
195
+ effect: "light",
196
+ trigger: "click",
197
+ transition: `${vue.unref(ns).namespace.value}-zoom-in-top`,
198
+ persistent: ""
199
+ }, {
200
+ content: vue.withCtx(() => [
201
+ vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", null, [
202
+ vue.createElementVNode("div", {
203
+ class: vue.normalizeClass(vue.unref(ns).be("dropdown", "main-wrapper"))
204
+ }, [
205
+ vue.createVNode(hueSlider["default"], {
206
+ ref_key: "hue",
207
+ ref: hue,
208
+ class: "hue-slider",
209
+ color: vue.unref(color$1),
210
+ vertical: ""
211
+ }, null, 8, ["color"]),
212
+ vue.createVNode(svPanel["default"], {
213
+ ref: "svPanel",
214
+ color: vue.unref(color$1)
215
+ }, null, 8, ["color"])
216
+ ], 2),
217
+ _ctx.showAlpha ? (vue.openBlock(), vue.createBlock(alphaSlider["default"], {
218
+ key: 0,
219
+ ref_key: "alpha",
220
+ ref: alpha,
221
+ color: vue.unref(color$1)
222
+ }, null, 8, ["color"])) : vue.createCommentVNode("v-if", true),
223
+ _ctx.predefine ? (vue.openBlock(), vue.createBlock(predefine["default"], {
224
+ key: 1,
225
+ ref: "predefine",
226
+ color: vue.unref(color$1),
227
+ colors: _ctx.predefine
228
+ }, null, 8, ["color", "colors"])) : vue.createCommentVNode("v-if", true),
229
+ vue.createElementVNode("div", {
230
+ class: vue.normalizeClass(vue.unref(ns).be("dropdown", "btns"))
231
+ }, [
232
+ vue.createElementVNode("span", {
233
+ class: vue.normalizeClass(vue.unref(ns).be("dropdown", "value"))
234
+ }, [
235
+ vue.createVNode(vue.unref(index$5.ElInput), {
236
+ modelValue: customInput.value,
237
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
238
+ "validate-event": false,
239
+ size: "small",
240
+ onKeyup: vue.withKeys(handleConfirm, ["enter"]),
241
+ onBlur: handleConfirm
242
+ }, null, 8, ["modelValue", "onKeyup"])
243
+ ], 2),
244
+ vue.createVNode(vue.unref(index$6.ElButton), {
245
+ class: vue.normalizeClass(vue.unref(ns).be("dropdown", "link-btn")),
246
+ text: "",
247
+ size: "small",
248
+ onClick: clear
249
+ }, {
250
+ default: vue.withCtx(() => [
251
+ vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.colorpicker.clear")), 1)
252
+ ]),
253
+ _: 1
254
+ }, 8, ["class"]),
255
+ vue.createVNode(vue.unref(index$6.ElButton), {
256
+ plain: "",
257
+ size: "small",
258
+ class: vue.normalizeClass(vue.unref(ns).be("dropdown", "btn")),
259
+ onClick: confirmValue
260
+ }, {
261
+ default: vue.withCtx(() => [
262
+ vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.colorpicker.confirm")), 1)
263
+ ]),
264
+ _: 1
265
+ }, 8, ["class"])
266
+ ], 2)
267
+ ])), [
268
+ [vue.unref(index$7["default"]), hide]
269
+ ])
270
+ ]),
271
+ default: vue.withCtx(() => [
272
+ vue.createElementVNode("div", {
273
+ id: vue.unref(buttonId),
274
+ class: vue.normalizeClass(vue.unref(btnKls)),
275
+ role: "button",
276
+ "aria-label": vue.unref(buttonAriaLabel),
277
+ "aria-labelledby": vue.unref(buttonAriaLabelledby),
278
+ "aria-description": vue.unref(t)("el.colorpicker.description", { color: _ctx.modelValue || "" }),
279
+ tabindex: _ctx.tabindex,
280
+ onKeydown: vue.withKeys(handleTrigger, ["enter"])
281
+ }, [
282
+ vue.unref(colorDisabled) ? (vue.openBlock(), vue.createElementBlock("div", {
283
+ key: 0,
284
+ class: vue.normalizeClass(vue.unref(ns).be("picker", "mask"))
285
+ }, null, 2)) : vue.createCommentVNode("v-if", true),
286
+ vue.createElementVNode("div", {
287
+ class: vue.normalizeClass(vue.unref(ns).be("picker", "trigger")),
288
+ onClick: handleTrigger
289
+ }, [
290
+ vue.createElementVNode("span", {
291
+ class: vue.normalizeClass([vue.unref(ns).be("picker", "color"), vue.unref(ns).is("alpha", _ctx.showAlpha)])
292
+ }, [
293
+ vue.createElementVNode("span", {
294
+ class: vue.normalizeClass(vue.unref(ns).be("picker", "color-inner")),
295
+ style: vue.normalizeStyle({
296
+ backgroundColor: vue.unref(displayedColor)
297
+ })
298
+ }, [
299
+ vue.withDirectives(vue.createVNode(vue.unref(index$8.ElIcon), {
300
+ class: vue.normalizeClass([vue.unref(ns).be("picker", "icon"), vue.unref(ns).is("icon-arrow-down")])
301
+ }, {
302
+ default: vue.withCtx(() => [
303
+ vue.createVNode(vue.unref(iconsVue.ArrowDown))
304
+ ]),
305
+ _: 1
306
+ }, 8, ["class"]), [
307
+ [vue.vShow, _ctx.modelValue || showPanelColor.value]
308
+ ]),
309
+ !_ctx.modelValue && !showPanelColor.value ? (vue.openBlock(), vue.createBlock(vue.unref(index$8.ElIcon), {
310
+ key: 0,
311
+ class: vue.normalizeClass([vue.unref(ns).be("picker", "empty"), vue.unref(ns).is("icon-close")])
312
+ }, {
313
+ default: vue.withCtx(() => [
314
+ vue.createVNode(vue.unref(iconsVue.Close))
315
+ ]),
316
+ _: 1
317
+ }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
318
+ ], 6)
319
+ ], 2)
320
+ ], 2)
321
+ ], 42, _hoisted_1)
322
+ ]),
323
+ _: 1
324
+ }, 8, ["visible", "popper-class", "transition"]);
325
+ };
39
326
  }
40
327
  });
41
- const colorPickerEmits = {
42
- [event.UPDATE_MODEL_EVENT]: (val) => shared.isString(val) || lodashUnified.isNil(val),
43
- [event.CHANGE_EVENT]: (val) => shared.isString(val) || lodashUnified.isNil(val),
44
- activeChange: (val) => shared.isString(val) || lodashUnified.isNil(val)
45
- };
46
- const colorPickerContextKey = Symbol("colorPickerContextKey");
328
+ var ColorPicker = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/color-picker.vue"]]);
47
329
 
48
- exports.colorPickerContextKey = colorPickerContextKey;
49
- exports.colorPickerEmits = colorPickerEmits;
50
- exports.colorPickerProps = colorPickerProps;
330
+ exports["default"] = ColorPicker;
51
331
  //# sourceMappingURL=color-picker2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker2.js","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":["buildProps","useSizeProp","definePropType","UPDATE_MODEL_EVENT","is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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":["useLocale","useNamespace","useFormItem","useSize","useDisabled","useFormItemInputId","ref","color","reactive","Color","computed","debounce","nextTick","UPDATE_MODEL_EVENT","debugWarn","onMounted","watch","provide","colorPickerContextKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA0Ic,CAAA;AAA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A,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,IAC7BK,WAAA,CAAAC,iCAAA,EAAA;AAAA,MACD,YAAA;AAED,KAAa,CAAA,CAAA;AAAA,IAIX,MAAA,CAAA;AAAA,aACDX,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
  require('../../../../hooks/index.js');
7
- var colorPicker = require('../color-picker2.js');
7
+ var colorPicker = require('../color-picker.js');
8
8
  var color = require('../utils/color.js');
9
9
  var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
10
10
  var index = require('../../../../hooks/use-namespace/index.js');
@@ -99,7 +99,7 @@ var checkbox = require('./checkbox/src/checkbox.js');
99
99
  var col = require('./col/src/col.js');
100
100
  var collapse = require('./collapse/src/collapse.js');
101
101
  var collapseItem = require('./collapse/src/collapse-item.js');
102
- var colorPicker = require('./color-picker/src/color-picker2.js');
102
+ var colorPicker = require('./color-picker/src/color-picker.js');
103
103
  var configProvider = require('./config-provider/src/config-provider.js');
104
104
  var countdown = require('./countdown/src/countdown.js');
105
105
  var description = require('./descriptions/src/description.js');
@@ -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';
@@ -15,23 +15,24 @@ var index$9 = require('./use-modal/index.js');
15
15
  var index$a = require('./use-model-toggle/index.js');
16
16
  var index$b = require('./use-prevent-global/index.js');
17
17
  var index$c = require('./use-prop/index.js');
18
- var index$d = require('./use-restore-active/index.js');
19
- var index$e = require('./use-same-target/index.js');
20
- var index$f = require('./use-teleport/index.js');
21
- var index$g = require('./use-throttle-render/index.js');
22
- var index$h = require('./use-timeout/index.js');
23
- var index$i = require('./use-transition-fallthrough/index.js');
24
- var index$j = require('./use-id/index.js');
25
- var index$k = require('./use-escape-keydown/index.js');
26
- var index$l = require('./use-popper-container/index.js');
27
- var index$m = require('./use-intermediate-render/index.js');
28
- var index$n = require('./use-delayed-toggle/index.js');
29
- var index$o = require('./use-forward-ref/index.js');
30
- var index$p = require('./use-namespace/index.js');
31
- var index$q = require('./use-z-index/index.js');
32
- var index$r = require('./use-floating/index.js');
33
- var index$s = require('./use-cursor/index.js');
34
- var index$t = require('./use-ordered-children/index.js');
18
+ var index$d = require('./use-popper/index.js');
19
+ var index$e = require('./use-restore-active/index.js');
20
+ var index$f = require('./use-same-target/index.js');
21
+ var index$g = require('./use-teleport/index.js');
22
+ var index$h = require('./use-throttle-render/index.js');
23
+ var index$i = require('./use-timeout/index.js');
24
+ var index$j = require('./use-transition-fallthrough/index.js');
25
+ var index$k = require('./use-id/index.js');
26
+ var index$l = require('./use-escape-keydown/index.js');
27
+ var index$m = require('./use-popper-container/index.js');
28
+ var index$n = require('./use-intermediate-render/index.js');
29
+ var index$o = require('./use-delayed-toggle/index.js');
30
+ var index$p = require('./use-forward-ref/index.js');
31
+ var index$q = require('./use-namespace/index.js');
32
+ var index$r = require('./use-z-index/index.js');
33
+ var index$s = require('./use-floating/index.js');
34
+ var index$t = require('./use-cursor/index.js');
35
+ var index$u = require('./use-ordered-children/index.js');
35
36
 
36
37
 
37
38
 
@@ -58,32 +59,33 @@ exports.useModelToggleEmits = index$a.useModelToggleEmits;
58
59
  exports.useModelToggleProps = index$a.useModelToggleProps;
59
60
  exports.usePreventGlobal = index$b.usePreventGlobal;
60
61
  exports.useProp = index$c.useProp;
61
- exports.useRestoreActive = index$d.useRestoreActive;
62
- exports.useSameTarget = index$e.useSameTarget;
63
- exports.useTeleport = index$f.useTeleport;
64
- exports.useThrottleRender = index$g.useThrottleRender;
65
- exports.useTimeout = index$h.useTimeout;
66
- exports.useTransitionFallthrough = index$i.useTransitionFallthrough;
67
- exports.useTransitionFallthroughEmits = index$i.useTransitionFallthroughEmits;
68
- exports.ID_INJECTION_KEY = index$j.ID_INJECTION_KEY;
69
- exports.useId = index$j.useId;
70
- exports.useIdInjection = index$j.useIdInjection;
71
- exports.useEscapeKeydown = index$k.useEscapeKeydown;
72
- exports.usePopperContainer = index$l.usePopperContainer;
73
- exports.usePopperContainerId = index$l.usePopperContainerId;
74
- exports.useDelayedRender = index$m.useDelayedRender;
75
- exports.useDelayedToggle = index$n.useDelayedToggle;
76
- exports.useDelayedToggleProps = index$n.useDelayedToggleProps;
77
- exports.FORWARD_REF_INJECTION_KEY = index$o.FORWARD_REF_INJECTION_KEY;
78
- exports.useForwardRef = index$o.useForwardRef;
79
- exports.useForwardRefDirective = index$o.useForwardRefDirective;
80
- exports.defaultNamespace = index$p.defaultNamespace;
81
- exports.useNamespace = index$p.useNamespace;
82
- exports.useZIndex = index$q.useZIndex;
83
- exports.arrowMiddleware = index$r.arrowMiddleware;
84
- exports.getPositionDataWithUnit = index$r.getPositionDataWithUnit;
85
- exports.useFloating = index$r.useFloating;
86
- exports.useFloatingProps = index$r.useFloatingProps;
87
- exports.useCursor = index$s.useCursor;
88
- exports.useOrderedChildren = index$t.useOrderedChildren;
62
+ exports.usePopper = index$d.usePopper;
63
+ exports.useRestoreActive = index$e.useRestoreActive;
64
+ exports.useSameTarget = index$f.useSameTarget;
65
+ exports.useTeleport = index$g.useTeleport;
66
+ exports.useThrottleRender = index$h.useThrottleRender;
67
+ exports.useTimeout = index$i.useTimeout;
68
+ exports.useTransitionFallthrough = index$j.useTransitionFallthrough;
69
+ exports.useTransitionFallthroughEmits = index$j.useTransitionFallthroughEmits;
70
+ exports.ID_INJECTION_KEY = index$k.ID_INJECTION_KEY;
71
+ exports.useId = index$k.useId;
72
+ exports.useIdInjection = index$k.useIdInjection;
73
+ exports.useEscapeKeydown = index$l.useEscapeKeydown;
74
+ exports.usePopperContainer = index$m.usePopperContainer;
75
+ exports.usePopperContainerId = index$m.usePopperContainerId;
76
+ exports.useDelayedRender = index$n.useDelayedRender;
77
+ exports.useDelayedToggle = index$o.useDelayedToggle;
78
+ exports.useDelayedToggleProps = index$o.useDelayedToggleProps;
79
+ exports.FORWARD_REF_INJECTION_KEY = index$p.FORWARD_REF_INJECTION_KEY;
80
+ exports.useForwardRef = index$p.useForwardRef;
81
+ exports.useForwardRefDirective = index$p.useForwardRefDirective;
82
+ exports.defaultNamespace = index$q.defaultNamespace;
83
+ exports.useNamespace = index$q.useNamespace;
84
+ exports.useZIndex = index$r.useZIndex;
85
+ exports.arrowMiddleware = index$s.arrowMiddleware;
86
+ exports.getPositionDataWithUnit = index$s.getPositionDataWithUnit;
87
+ exports.useFloating = index$s.useFloating;
88
+ exports.useFloatingProps = index$s.useFloatingProps;
89
+ exports.useCursor = index$t.useCursor;
90
+ exports.useOrderedChildren = index$u.useOrderedChildren;
89
91
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","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 {};