@element-plus/nightly 0.0.20241121 → 0.0.20241122

Sign up to get free protection for your applications and to get access to all the features.
Files changed (336) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.full.js +19 -16
  3. package/dist/index.full.min.js +13 -13
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +5 -5
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +19 -16
  8. package/dist/locale/af.js +1 -1
  9. package/dist/locale/af.min.js +1 -1
  10. package/dist/locale/af.min.mjs +1 -1
  11. package/dist/locale/af.mjs +1 -1
  12. package/dist/locale/ar-eg.js +1 -1
  13. package/dist/locale/ar-eg.min.js +1 -1
  14. package/dist/locale/ar-eg.min.mjs +1 -1
  15. package/dist/locale/ar-eg.mjs +1 -1
  16. package/dist/locale/ar.js +1 -1
  17. package/dist/locale/ar.min.js +1 -1
  18. package/dist/locale/ar.min.mjs +1 -1
  19. package/dist/locale/ar.mjs +1 -1
  20. package/dist/locale/az.js +1 -1
  21. package/dist/locale/az.min.js +1 -1
  22. package/dist/locale/az.min.mjs +1 -1
  23. package/dist/locale/az.mjs +1 -1
  24. package/dist/locale/bg.js +1 -1
  25. package/dist/locale/bg.min.js +1 -1
  26. package/dist/locale/bg.min.mjs +1 -1
  27. package/dist/locale/bg.mjs +1 -1
  28. package/dist/locale/bn.js +1 -1
  29. package/dist/locale/bn.min.js +1 -1
  30. package/dist/locale/bn.min.mjs +1 -1
  31. package/dist/locale/bn.mjs +1 -1
  32. package/dist/locale/ca.js +1 -1
  33. package/dist/locale/ca.min.js +1 -1
  34. package/dist/locale/ca.min.mjs +1 -1
  35. package/dist/locale/ca.mjs +1 -1
  36. package/dist/locale/ckb.js +1 -1
  37. package/dist/locale/ckb.min.js +1 -1
  38. package/dist/locale/ckb.min.mjs +1 -1
  39. package/dist/locale/ckb.mjs +1 -1
  40. package/dist/locale/cs.js +1 -1
  41. package/dist/locale/cs.min.js +1 -1
  42. package/dist/locale/cs.min.mjs +1 -1
  43. package/dist/locale/cs.mjs +1 -1
  44. package/dist/locale/da.js +1 -1
  45. package/dist/locale/da.min.js +1 -1
  46. package/dist/locale/da.min.mjs +1 -1
  47. package/dist/locale/da.mjs +1 -1
  48. package/dist/locale/de.js +1 -1
  49. package/dist/locale/de.min.js +1 -1
  50. package/dist/locale/de.min.mjs +1 -1
  51. package/dist/locale/de.mjs +1 -1
  52. package/dist/locale/el.js +1 -1
  53. package/dist/locale/el.min.js +1 -1
  54. package/dist/locale/el.min.mjs +1 -1
  55. package/dist/locale/el.mjs +1 -1
  56. package/dist/locale/en.js +1 -1
  57. package/dist/locale/en.min.js +1 -1
  58. package/dist/locale/en.min.mjs +1 -1
  59. package/dist/locale/en.mjs +1 -1
  60. package/dist/locale/eo.js +1 -1
  61. package/dist/locale/eo.min.js +1 -1
  62. package/dist/locale/eo.min.mjs +1 -1
  63. package/dist/locale/eo.mjs +1 -1
  64. package/dist/locale/es.js +1 -1
  65. package/dist/locale/es.min.js +1 -1
  66. package/dist/locale/es.min.mjs +1 -1
  67. package/dist/locale/es.mjs +1 -1
  68. package/dist/locale/et.js +1 -1
  69. package/dist/locale/et.min.js +1 -1
  70. package/dist/locale/et.min.mjs +1 -1
  71. package/dist/locale/et.mjs +1 -1
  72. package/dist/locale/eu.js +1 -1
  73. package/dist/locale/eu.min.js +1 -1
  74. package/dist/locale/eu.min.mjs +1 -1
  75. package/dist/locale/eu.mjs +1 -1
  76. package/dist/locale/fa.js +1 -1
  77. package/dist/locale/fa.min.js +1 -1
  78. package/dist/locale/fa.min.mjs +1 -1
  79. package/dist/locale/fa.mjs +1 -1
  80. package/dist/locale/fi.js +1 -1
  81. package/dist/locale/fi.min.js +1 -1
  82. package/dist/locale/fi.min.mjs +1 -1
  83. package/dist/locale/fi.mjs +1 -1
  84. package/dist/locale/fr.js +1 -1
  85. package/dist/locale/fr.min.js +1 -1
  86. package/dist/locale/fr.min.mjs +1 -1
  87. package/dist/locale/fr.mjs +1 -1
  88. package/dist/locale/he.js +1 -1
  89. package/dist/locale/he.min.js +1 -1
  90. package/dist/locale/he.min.mjs +1 -1
  91. package/dist/locale/he.mjs +1 -1
  92. package/dist/locale/hr.js +1 -1
  93. package/dist/locale/hr.min.js +1 -1
  94. package/dist/locale/hr.min.mjs +1 -1
  95. package/dist/locale/hr.mjs +1 -1
  96. package/dist/locale/hu.js +1 -1
  97. package/dist/locale/hu.min.js +1 -1
  98. package/dist/locale/hu.min.mjs +1 -1
  99. package/dist/locale/hu.mjs +1 -1
  100. package/dist/locale/hy-am.js +1 -1
  101. package/dist/locale/hy-am.min.js +1 -1
  102. package/dist/locale/hy-am.min.mjs +1 -1
  103. package/dist/locale/hy-am.mjs +1 -1
  104. package/dist/locale/id.js +1 -1
  105. package/dist/locale/id.min.js +1 -1
  106. package/dist/locale/id.min.mjs +1 -1
  107. package/dist/locale/id.mjs +1 -1
  108. package/dist/locale/it.js +1 -1
  109. package/dist/locale/it.min.js +1 -1
  110. package/dist/locale/it.min.mjs +1 -1
  111. package/dist/locale/it.mjs +1 -1
  112. package/dist/locale/ja.js +1 -1
  113. package/dist/locale/ja.min.js +1 -1
  114. package/dist/locale/ja.min.mjs +1 -1
  115. package/dist/locale/ja.mjs +1 -1
  116. package/dist/locale/kk.js +1 -1
  117. package/dist/locale/kk.min.js +1 -1
  118. package/dist/locale/kk.min.mjs +1 -1
  119. package/dist/locale/kk.mjs +1 -1
  120. package/dist/locale/km.js +1 -1
  121. package/dist/locale/km.min.js +1 -1
  122. package/dist/locale/km.min.mjs +1 -1
  123. package/dist/locale/km.mjs +1 -1
  124. package/dist/locale/ko.js +1 -1
  125. package/dist/locale/ko.min.js +1 -1
  126. package/dist/locale/ko.min.mjs +1 -1
  127. package/dist/locale/ko.mjs +1 -1
  128. package/dist/locale/ku.js +1 -1
  129. package/dist/locale/ku.min.js +1 -1
  130. package/dist/locale/ku.min.mjs +1 -1
  131. package/dist/locale/ku.mjs +1 -1
  132. package/dist/locale/ky.js +1 -1
  133. package/dist/locale/ky.min.js +1 -1
  134. package/dist/locale/ky.min.mjs +1 -1
  135. package/dist/locale/ky.mjs +1 -1
  136. package/dist/locale/lt.js +1 -1
  137. package/dist/locale/lt.min.js +1 -1
  138. package/dist/locale/lt.min.mjs +1 -1
  139. package/dist/locale/lt.mjs +1 -1
  140. package/dist/locale/lv.js +1 -1
  141. package/dist/locale/lv.min.js +1 -1
  142. package/dist/locale/lv.min.mjs +1 -1
  143. package/dist/locale/lv.mjs +1 -1
  144. package/dist/locale/mg.js +1 -1
  145. package/dist/locale/mg.min.js +1 -1
  146. package/dist/locale/mg.min.mjs +1 -1
  147. package/dist/locale/mg.mjs +1 -1
  148. package/dist/locale/mn.js +1 -1
  149. package/dist/locale/mn.min.js +1 -1
  150. package/dist/locale/mn.min.mjs +1 -1
  151. package/dist/locale/mn.mjs +1 -1
  152. package/dist/locale/ms.js +1 -1
  153. package/dist/locale/ms.min.js +1 -1
  154. package/dist/locale/ms.min.mjs +1 -1
  155. package/dist/locale/ms.mjs +1 -1
  156. package/dist/locale/my.js +1 -1
  157. package/dist/locale/my.min.js +1 -1
  158. package/dist/locale/my.min.mjs +1 -1
  159. package/dist/locale/my.mjs +1 -1
  160. package/dist/locale/nb-no.js +1 -1
  161. package/dist/locale/nb-no.min.js +1 -1
  162. package/dist/locale/nb-no.min.mjs +1 -1
  163. package/dist/locale/nb-no.mjs +1 -1
  164. package/dist/locale/nl.js +1 -1
  165. package/dist/locale/nl.min.js +1 -1
  166. package/dist/locale/nl.min.mjs +1 -1
  167. package/dist/locale/nl.mjs +1 -1
  168. package/dist/locale/pa.js +1 -1
  169. package/dist/locale/pa.min.js +1 -1
  170. package/dist/locale/pa.min.mjs +1 -1
  171. package/dist/locale/pa.mjs +1 -1
  172. package/dist/locale/pl.js +1 -1
  173. package/dist/locale/pl.min.js +1 -1
  174. package/dist/locale/pl.min.mjs +1 -1
  175. package/dist/locale/pl.mjs +1 -1
  176. package/dist/locale/pt-br.js +1 -1
  177. package/dist/locale/pt-br.min.js +1 -1
  178. package/dist/locale/pt-br.min.mjs +1 -1
  179. package/dist/locale/pt-br.mjs +1 -1
  180. package/dist/locale/pt.js +1 -1
  181. package/dist/locale/pt.min.js +1 -1
  182. package/dist/locale/pt.min.mjs +1 -1
  183. package/dist/locale/pt.mjs +1 -1
  184. package/dist/locale/ro.js +1 -1
  185. package/dist/locale/ro.min.js +1 -1
  186. package/dist/locale/ro.min.mjs +1 -1
  187. package/dist/locale/ro.mjs +1 -1
  188. package/dist/locale/ru.js +1 -1
  189. package/dist/locale/ru.min.js +1 -1
  190. package/dist/locale/ru.min.mjs +1 -1
  191. package/dist/locale/ru.mjs +1 -1
  192. package/dist/locale/sk.js +1 -1
  193. package/dist/locale/sk.min.js +1 -1
  194. package/dist/locale/sk.min.mjs +1 -1
  195. package/dist/locale/sk.mjs +1 -1
  196. package/dist/locale/sl.js +1 -1
  197. package/dist/locale/sl.min.js +1 -1
  198. package/dist/locale/sl.min.mjs +1 -1
  199. package/dist/locale/sl.mjs +1 -1
  200. package/dist/locale/sr.js +1 -1
  201. package/dist/locale/sr.min.js +1 -1
  202. package/dist/locale/sr.min.mjs +1 -1
  203. package/dist/locale/sr.mjs +1 -1
  204. package/dist/locale/sv.js +1 -1
  205. package/dist/locale/sv.min.js +1 -1
  206. package/dist/locale/sv.min.mjs +1 -1
  207. package/dist/locale/sv.mjs +1 -1
  208. package/dist/locale/sw.js +1 -1
  209. package/dist/locale/sw.min.js +1 -1
  210. package/dist/locale/sw.min.mjs +1 -1
  211. package/dist/locale/sw.mjs +1 -1
  212. package/dist/locale/ta.js +1 -1
  213. package/dist/locale/ta.min.js +1 -1
  214. package/dist/locale/ta.min.mjs +1 -1
  215. package/dist/locale/ta.mjs +1 -1
  216. package/dist/locale/th.js +1 -1
  217. package/dist/locale/th.min.js +1 -1
  218. package/dist/locale/th.min.mjs +1 -1
  219. package/dist/locale/th.mjs +1 -1
  220. package/dist/locale/tk.js +1 -1
  221. package/dist/locale/tk.min.js +1 -1
  222. package/dist/locale/tk.min.mjs +1 -1
  223. package/dist/locale/tk.mjs +1 -1
  224. package/dist/locale/tr.js +1 -1
  225. package/dist/locale/tr.min.js +1 -1
  226. package/dist/locale/tr.min.mjs +1 -1
  227. package/dist/locale/tr.mjs +1 -1
  228. package/dist/locale/ug-cn.js +1 -1
  229. package/dist/locale/ug-cn.min.js +1 -1
  230. package/dist/locale/ug-cn.min.mjs +1 -1
  231. package/dist/locale/ug-cn.mjs +1 -1
  232. package/dist/locale/uk.js +1 -1
  233. package/dist/locale/uk.min.js +1 -1
  234. package/dist/locale/uk.min.mjs +1 -1
  235. package/dist/locale/uk.mjs +1 -1
  236. package/dist/locale/uz-uz.js +1 -1
  237. package/dist/locale/uz-uz.min.js +1 -1
  238. package/dist/locale/uz-uz.min.mjs +1 -1
  239. package/dist/locale/uz-uz.mjs +1 -1
  240. package/dist/locale/vi.js +1 -1
  241. package/dist/locale/vi.min.js +1 -1
  242. package/dist/locale/vi.min.mjs +1 -1
  243. package/dist/locale/vi.mjs +1 -1
  244. package/dist/locale/zh-cn.js +1 -1
  245. package/dist/locale/zh-cn.min.js +1 -1
  246. package/dist/locale/zh-cn.min.mjs +1 -1
  247. package/dist/locale/zh-cn.mjs +1 -1
  248. package/dist/locale/zh-tw.js +1 -1
  249. package/dist/locale/zh-tw.min.js +1 -1
  250. package/dist/locale/zh-tw.min.mjs +1 -1
  251. package/dist/locale/zh-tw.mjs +1 -1
  252. package/es/components/calendar/src/date-table2.mjs +9 -4
  253. package/es/components/calendar/src/date-table2.mjs.map +1 -1
  254. package/es/components/cascader/src/cascader2.mjs +2 -2
  255. package/es/components/cascader/src/cascader2.mjs.map +1 -1
  256. package/es/components/checkbox/index.mjs +2 -2
  257. package/es/components/checkbox/src/checkbox-group.mjs +73 -30
  258. package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
  259. package/es/components/checkbox/src/checkbox-group2.mjs +30 -73
  260. package/es/components/checkbox/src/checkbox-group2.mjs.map +1 -1
  261. package/es/components/index.mjs +5 -5
  262. package/es/components/popper/index.mjs +2 -2
  263. package/es/components/popper/src/content.mjs +93 -137
  264. package/es/components/popper/src/content.mjs.map +1 -1
  265. package/es/components/popper/src/content2.mjs +137 -93
  266. package/es/components/popper/src/content2.mjs.map +1 -1
  267. package/es/components/select/src/select2.mjs +3 -4
  268. package/es/components/select/src/select2.mjs.map +1 -1
  269. package/es/components/select-v2/src/select.mjs +3 -4
  270. package/es/components/select-v2/src/select.mjs.map +1 -1
  271. package/es/components/skeleton/index.mjs +2 -2
  272. package/es/components/skeleton/src/skeleton-item.mjs +23 -18
  273. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  274. package/es/components/skeleton/src/skeleton-item2.mjs +18 -23
  275. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  276. package/es/components/skeleton/src/skeleton2.mjs +1 -1
  277. package/es/components/switch/index.mjs +2 -2
  278. package/es/components/switch/src/switch.mjs +72 -229
  279. package/es/components/switch/src/switch.mjs.map +1 -1
  280. package/es/components/switch/src/switch2.mjs +229 -72
  281. package/es/components/switch/src/switch2.mjs.map +1 -1
  282. package/es/components/time-picker/src/common/picker.mjs.map +1 -1
  283. package/es/components/tooltip/src/content.mjs +1 -1
  284. package/es/components/tooltip/src/content2.mjs +1 -1
  285. package/es/components/tree-select/src/tree-select.mjs +1 -1
  286. package/es/components/tree-select/src/tree-select.mjs.map +1 -1
  287. package/es/index.mjs +5 -5
  288. package/es/version.d.ts +1 -1
  289. package/es/version.mjs +1 -1
  290. package/es/version.mjs.map +1 -1
  291. package/lib/components/calendar/src/date-table2.js +8 -3
  292. package/lib/components/calendar/src/date-table2.js.map +1 -1
  293. package/lib/components/cascader/src/cascader2.js +2 -2
  294. package/lib/components/cascader/src/cascader2.js.map +1 -1
  295. package/lib/components/checkbox/index.js +2 -2
  296. package/lib/components/checkbox/src/checkbox-group.js +73 -31
  297. package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
  298. package/lib/components/checkbox/src/checkbox-group2.js +31 -73
  299. package/lib/components/checkbox/src/checkbox-group2.js.map +1 -1
  300. package/lib/components/index.js +5 -5
  301. package/lib/components/popper/index.js +2 -2
  302. package/lib/components/popper/src/content.js +98 -137
  303. package/lib/components/popper/src/content.js.map +1 -1
  304. package/lib/components/popper/src/content2.js +137 -98
  305. package/lib/components/popper/src/content2.js.map +1 -1
  306. package/lib/components/select/src/select2.js +3 -4
  307. package/lib/components/select/src/select2.js.map +1 -1
  308. package/lib/components/select-v2/src/select.js +3 -4
  309. package/lib/components/select-v2/src/select.js.map +1 -1
  310. package/lib/components/skeleton/index.js +2 -2
  311. package/lib/components/skeleton/src/skeleton-item.js +23 -18
  312. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  313. package/lib/components/skeleton/src/skeleton-item2.js +18 -23
  314. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  315. package/lib/components/skeleton/src/skeleton2.js +1 -1
  316. package/lib/components/switch/index.js +2 -2
  317. package/lib/components/switch/src/switch.js +72 -228
  318. package/lib/components/switch/src/switch.js.map +1 -1
  319. package/lib/components/switch/src/switch2.js +228 -72
  320. package/lib/components/switch/src/switch2.js.map +1 -1
  321. package/lib/components/time-picker/src/common/picker.js.map +1 -1
  322. package/lib/components/tooltip/src/content.js +1 -1
  323. package/lib/components/tooltip/src/content2.js +1 -1
  324. package/lib/components/tree-select/src/tree-select.js +1 -1
  325. package/lib/components/tree-select/src/tree-select.js.map +1 -1
  326. package/lib/index.js +5 -5
  327. package/lib/version.d.ts +1 -1
  328. package/lib/version.js +1 -1
  329. package/lib/version.js.map +1 -1
  330. package/package.json +2 -2
  331. package/theme-chalk/el-button.css +1 -1
  332. package/theme-chalk/el-cascader.css +1 -1
  333. package/theme-chalk/index.css +1 -1
  334. package/theme-chalk/src/cascader.scss +18 -4
  335. package/theme-chalk/src/common/var.scss +42 -1
  336. package/web-types.json +1 -1
@@ -1,37 +1,80 @@
1
+ import { defineComponent, nextTick, computed, provide, toRefs, watch, openBlock, createBlock, resolveDynamicComponent, unref, normalizeClass, withCtx, renderSlot } from 'vue';
2
+ import { pick } from 'lodash-unified';
1
3
  import '../../../constants/index.mjs';
2
- import '../../../hooks/index.mjs';
3
4
  import '../../../utils/index.mjs';
4
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
5
- import { useSizeProp } from '../../../hooks/use-size/index.mjs';
6
- import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
5
+ import '../../../hooks/index.mjs';
6
+ import '../../form/index.mjs';
7
+ import { checkboxGroupProps, checkboxGroupEmits } from './checkbox-group2.mjs';
8
+ import { checkboxGroupContextKey } from './constants.mjs';
9
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
+ import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
7
12
  import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
8
- import { isArray } from '@vue/shared';
13
+ import { debugWarn } from '../../../utils/error.mjs';
9
14
 
10
- const checkboxGroupProps = buildProps({
11
- modelValue: {
12
- type: definePropType(Array),
13
- default: () => []
14
- },
15
- disabled: Boolean,
16
- min: Number,
17
- max: Number,
18
- size: useSizeProp,
19
- fill: String,
20
- textColor: String,
21
- tag: {
22
- type: String,
23
- default: "div"
24
- },
25
- validateEvent: {
26
- type: Boolean,
27
- default: true
28
- },
29
- ...useAriaProps(["ariaLabel"])
15
+ const __default__ = defineComponent({
16
+ name: "ElCheckboxGroup"
17
+ });
18
+ const _sfc_main = /* @__PURE__ */ defineComponent({
19
+ ...__default__,
20
+ props: checkboxGroupProps,
21
+ emits: checkboxGroupEmits,
22
+ setup(__props, { emit }) {
23
+ const props = __props;
24
+ const ns = useNamespace("checkbox");
25
+ const { formItem } = useFormItem();
26
+ const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
27
+ formItemContext: formItem
28
+ });
29
+ const changeEvent = async (value) => {
30
+ emit(UPDATE_MODEL_EVENT, value);
31
+ await nextTick();
32
+ emit("change", value);
33
+ };
34
+ const modelValue = computed({
35
+ get() {
36
+ return props.modelValue;
37
+ },
38
+ set(val) {
39
+ changeEvent(val);
40
+ }
41
+ });
42
+ provide(checkboxGroupContextKey, {
43
+ ...pick(toRefs(props), [
44
+ "size",
45
+ "min",
46
+ "max",
47
+ "disabled",
48
+ "validateEvent",
49
+ "fill",
50
+ "textColor"
51
+ ]),
52
+ modelValue,
53
+ changeEvent
54
+ });
55
+ watch(() => props.modelValue, () => {
56
+ if (props.validateEvent) {
57
+ formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
58
+ }
59
+ });
60
+ return (_ctx, _cache) => {
61
+ var _a;
62
+ return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
63
+ id: unref(groupId),
64
+ class: normalizeClass(unref(ns).b("group")),
65
+ role: "group",
66
+ "aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "checkbox-group" : void 0,
67
+ "aria-labelledby": unref(isLabeledByFormItem) ? (_a = unref(formItem)) == null ? void 0 : _a.labelId : void 0
68
+ }, {
69
+ default: withCtx(() => [
70
+ renderSlot(_ctx.$slots, "default")
71
+ ]),
72
+ _: 3
73
+ }, 8, ["id", "class", "aria-label", "aria-labelledby"]);
74
+ };
75
+ }
30
76
  });
31
- const checkboxGroupEmits = {
32
- [UPDATE_MODEL_EVENT]: (val) => isArray(val),
33
- change: (val) => isArray(val)
34
- };
77
+ var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "checkbox-group.vue"]]);
35
78
 
36
- export { checkboxGroupEmits, checkboxGroupProps };
79
+ export { CheckboxGroup as default };
37
80
  //# sourceMappingURL=checkbox-group.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group.mjs","sources":["../../../../../../packages/components/checkbox/src/checkbox-group.ts"],"sourcesContent":["import { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport { buildProps, definePropType, isArray } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type checkboxGroup from './checkbox-group.vue'\nimport type { CheckboxValueType } from './checkbox'\n\nexport type CheckboxGroupValueType = Exclude<CheckboxValueType, boolean>[]\n\nexport const checkboxGroupProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<CheckboxGroupValueType>(Array),\n default: () => [],\n },\n /**\n * @description whether the nesting checkboxes are disabled\n */\n disabled: Boolean,\n /**\n * @description minimum number of checkbox checked\n */\n min: Number,\n /**\n * @description maximum number of checkbox checked\n */\n max: Number,\n /**\n * @description size of checkbox\n */\n size: useSizeProp,\n /**\n * @description border and background color when button is active\n */\n fill: String,\n /**\n * @description font color when button is active\n */\n textColor: String,\n /**\n * @description element tag of the checkbox group\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport const checkboxGroupEmits = {\n [UPDATE_MODEL_EVENT]: (val: CheckboxGroupValueType) => isArray(val),\n change: (val: CheckboxValueType[]) => isArray(val),\n}\n\nexport type CheckboxGroupProps = ExtractPropTypes<typeof checkboxGroupProps>\nexport type CheckboxGroupEmits = typeof checkboxGroupEmits\nexport type CheckboxGroupInstance = InstanceType<typeof checkboxGroup>\n"],"names":[],"mappings":";;;;;;;;;AAGY,MAAC,kBAAkB,GAAG,UAAU,CAAC;AAC7C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,GAAG,YAAY,CAAC,CAAC,WAAW,CAAC,CAAC;AAChC,CAAC,EAAE;AACS,MAAC,kBAAkB,GAAG;AAClC,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC;AAC7C,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC;AAC/B;;;;"}
1
+ {"version":3,"file":"checkbox-group.mjs","sources":["../../../../../../packages/components/checkbox/src/checkbox-group.vue"],"sourcesContent":["<template>\n <component\n :is=\"tag\"\n :id=\"groupId\"\n :class=\"ns.b('group')\"\n role=\"group\"\n :aria-label=\"\n !isLabeledByFormItem ? ariaLabel || 'checkbox-group' : undefined\n \"\n :aria-labelledby=\"isLabeledByFormItem ? formItem?.labelId : undefined\"\n >\n <slot />\n </component>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, nextTick, provide, toRefs, watch } from 'vue'\nimport { pick } from 'lodash-unified'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { debugWarn } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormItem, useFormItemInputId } from '@element-plus/components/form'\nimport { checkboxGroupEmits, checkboxGroupProps } from './checkbox-group'\nimport { checkboxGroupContextKey } from './constants'\n\nimport type { CheckboxGroupValueType } from './checkbox-group'\n\ndefineOptions({\n name: 'ElCheckboxGroup',\n})\n\nconst props = defineProps(checkboxGroupProps)\nconst emit = defineEmits(checkboxGroupEmits)\nconst ns = useNamespace('checkbox')\n\nconst { formItem } = useFormItem()\nconst { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst changeEvent = async (value: CheckboxGroupValueType) => {\n emit(UPDATE_MODEL_EVENT, value)\n await nextTick()\n emit('change', value)\n}\n\nconst modelValue = computed({\n get() {\n return props.modelValue\n },\n set(val: CheckboxGroupValueType) {\n changeEvent(val)\n },\n})\n\nprovide(checkboxGroupContextKey, {\n ...pick(toRefs(props), [\n 'size',\n 'min',\n 'max',\n 'disabled',\n 'validateEvent',\n 'fill',\n 'textColor',\n ]),\n modelValue,\n changeEvent,\n})\n\nwatch(\n () => props.modelValue,\n () => {\n if (props.validateEvent) {\n formItem?.validate('change').catch((err) => debugWarn(err))\n }\n }\n)\n</script>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent"],"mappings":";;;;;;;;;;;;;;mCA2Bc,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAElC,IAAM,MAAA,EAAE,QAAS,EAAA,GAAI,WAAY,EAAA,CAAA;AACjC,IAAA,MAAM,EAAE,OAAS,EAAA,OAAA,EAAS,mBAAoB,EAAA,GAAI,mBAAmB,KAAO,EAAA;AAAA,MAC1E,eAAiB,EAAA,QAAA;AAAA,KAClB,CAAA,CAAA;AAED,IAAM,MAAA,WAAA,GAAc,OAAO,KAAkC,KAAA;AAC3D,MAAA,IAAA,CAAK,oBAAoB,KAAK,CAAA,CAAA;AAC9B,MAAA,MAAM,QAAS,EAAA,CAAA;AACf,MAAA,IAAA,CAAK,UAAU,KAAK,CAAA,CAAA;AAAA,KACtB,CAAA;AAEA,IAAA,MAAM,aAAa,QAAS,CAAA;AAAA,MAC1B,GAAM,GAAA;AACJ,QAAA,OAAO,KAAM,CAAA,UAAA,CAAA;AAAA,OACf;AAAA,MACA,IAAI,GAA6B,EAAA;AAC/B,QAAA,WAAA,CAAY,GAAG,CAAA,CAAA;AAAA,OACjB;AAAA,KACD,CAAA,CAAA;AAED,IAAA,OAAA,CAAQ,uBAAyB,EAAA;AAAA,MAC/B,GAAG,IAAA,CAAK,MAAO,CAAA,KAAK,CAAG,EAAA;AAAA,QACrB,MAAA;AAAA,QACA,KAAA;AAAA,QACA,KAAA;AAAA,QACA,UAAA;AAAA,QACA,eAAA;AAAA,QACA,MAAA;AAAA,QACA,WAAA;AAAA,OACD,CAAA;AAAA,MACD,UAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAA,KAAA,CAAA,MAAA,KAAA,CAAA,UAAA,EAAA,MAAA;AAAA,MACE,SAAY,CAAA,aAAA,EAAA;AAAA,QACN,QAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,QAAA,CAAA,QAAA,CAAA,QAAA,CAAA,CAAA,KAAA,CAAA,CAAA,GAAA,KAAA,SAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AACJ,OAAA;AACE,KAAU,CAAA,CAAA;AAAgD,IAC5D,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACF,IAAA,EAAA,CAAA;AAAA,MACF,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAAAC,uBAAA,CAAA,IAAA,CAAA,GAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;;;"}
@@ -1,80 +1,37 @@
1
- import { defineComponent, nextTick, computed, provide, toRefs, watch, openBlock, createBlock, resolveDynamicComponent, unref, normalizeClass, withCtx, renderSlot } from 'vue';
2
- import { pick } from 'lodash-unified';
3
1
  import '../../../constants/index.mjs';
4
- import '../../../utils/index.mjs';
5
2
  import '../../../hooks/index.mjs';
6
- import '../../form/index.mjs';
7
- import { checkboxGroupProps, checkboxGroupEmits } from './checkbox-group.mjs';
8
- import { checkboxGroupContextKey } from './constants.mjs';
9
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
- import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
3
+ import '../../../utils/index.mjs';
4
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
5
+ import { useSizeProp } from '../../../hooks/use-size/index.mjs';
6
+ import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
12
7
  import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
13
- import { debugWarn } from '../../../utils/error.mjs';
8
+ import { isArray } from '@vue/shared';
14
9
 
15
- const __default__ = defineComponent({
16
- name: "ElCheckboxGroup"
17
- });
18
- const _sfc_main = /* @__PURE__ */ defineComponent({
19
- ...__default__,
20
- props: checkboxGroupProps,
21
- emits: checkboxGroupEmits,
22
- setup(__props, { emit }) {
23
- const props = __props;
24
- const ns = useNamespace("checkbox");
25
- const { formItem } = useFormItem();
26
- const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
27
- formItemContext: formItem
28
- });
29
- const changeEvent = async (value) => {
30
- emit(UPDATE_MODEL_EVENT, value);
31
- await nextTick();
32
- emit("change", value);
33
- };
34
- const modelValue = computed({
35
- get() {
36
- return props.modelValue;
37
- },
38
- set(val) {
39
- changeEvent(val);
40
- }
41
- });
42
- provide(checkboxGroupContextKey, {
43
- ...pick(toRefs(props), [
44
- "size",
45
- "min",
46
- "max",
47
- "disabled",
48
- "validateEvent",
49
- "fill",
50
- "textColor"
51
- ]),
52
- modelValue,
53
- changeEvent
54
- });
55
- watch(() => props.modelValue, () => {
56
- if (props.validateEvent) {
57
- formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
58
- }
59
- });
60
- return (_ctx, _cache) => {
61
- var _a;
62
- return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
63
- id: unref(groupId),
64
- class: normalizeClass(unref(ns).b("group")),
65
- role: "group",
66
- "aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "checkbox-group" : void 0,
67
- "aria-labelledby": unref(isLabeledByFormItem) ? (_a = unref(formItem)) == null ? void 0 : _a.labelId : void 0
68
- }, {
69
- default: withCtx(() => [
70
- renderSlot(_ctx.$slots, "default")
71
- ]),
72
- _: 3
73
- }, 8, ["id", "class", "aria-label", "aria-labelledby"]);
74
- };
75
- }
10
+ const checkboxGroupProps = buildProps({
11
+ modelValue: {
12
+ type: definePropType(Array),
13
+ default: () => []
14
+ },
15
+ disabled: Boolean,
16
+ min: Number,
17
+ max: Number,
18
+ size: useSizeProp,
19
+ fill: String,
20
+ textColor: String,
21
+ tag: {
22
+ type: String,
23
+ default: "div"
24
+ },
25
+ validateEvent: {
26
+ type: Boolean,
27
+ default: true
28
+ },
29
+ ...useAriaProps(["ariaLabel"])
76
30
  });
77
- var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "checkbox-group.vue"]]);
31
+ const checkboxGroupEmits = {
32
+ [UPDATE_MODEL_EVENT]: (val) => isArray(val),
33
+ change: (val) => isArray(val)
34
+ };
78
35
 
79
- export { CheckboxGroup as default };
36
+ export { checkboxGroupEmits, checkboxGroupProps };
80
37
  //# sourceMappingURL=checkbox-group2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group2.mjs","sources":["../../../../../../packages/components/checkbox/src/checkbox-group.vue"],"sourcesContent":["<template>\n <component\n :is=\"tag\"\n :id=\"groupId\"\n :class=\"ns.b('group')\"\n role=\"group\"\n :aria-label=\"\n !isLabeledByFormItem ? ariaLabel || 'checkbox-group' : undefined\n \"\n :aria-labelledby=\"isLabeledByFormItem ? formItem?.labelId : undefined\"\n >\n <slot />\n </component>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, nextTick, provide, toRefs, watch } from 'vue'\nimport { pick } from 'lodash-unified'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { debugWarn } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormItem, useFormItemInputId } from '@element-plus/components/form'\nimport { checkboxGroupEmits, checkboxGroupProps } from './checkbox-group'\nimport { checkboxGroupContextKey } from './constants'\n\nimport type { CheckboxGroupValueType } from './checkbox-group'\n\ndefineOptions({\n name: 'ElCheckboxGroup',\n})\n\nconst props = defineProps(checkboxGroupProps)\nconst emit = defineEmits(checkboxGroupEmits)\nconst ns = useNamespace('checkbox')\n\nconst { formItem } = useFormItem()\nconst { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst changeEvent = async (value: CheckboxGroupValueType) => {\n emit(UPDATE_MODEL_EVENT, value)\n await nextTick()\n emit('change', value)\n}\n\nconst modelValue = computed({\n get() {\n return props.modelValue\n },\n set(val: CheckboxGroupValueType) {\n changeEvent(val)\n },\n})\n\nprovide(checkboxGroupContextKey, {\n ...pick(toRefs(props), [\n 'size',\n 'min',\n 'max',\n 'disabled',\n 'validateEvent',\n 'fill',\n 'textColor',\n ]),\n modelValue,\n changeEvent,\n})\n\nwatch(\n () => props.modelValue,\n () => {\n if (props.validateEvent) {\n formItem?.validate('change').catch((err) => debugWarn(err))\n }\n }\n)\n</script>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent"],"mappings":";;;;;;;;;;;;;;mCA2Bc,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAElC,IAAM,MAAA,EAAE,QAAS,EAAA,GAAI,WAAY,EAAA,CAAA;AACjC,IAAA,MAAM,EAAE,OAAS,EAAA,OAAA,EAAS,mBAAoB,EAAA,GAAI,mBAAmB,KAAO,EAAA;AAAA,MAC1E,eAAiB,EAAA,QAAA;AAAA,KAClB,CAAA,CAAA;AAED,IAAM,MAAA,WAAA,GAAc,OAAO,KAAkC,KAAA;AAC3D,MAAA,IAAA,CAAK,oBAAoB,KAAK,CAAA,CAAA;AAC9B,MAAA,MAAM,QAAS,EAAA,CAAA;AACf,MAAA,IAAA,CAAK,UAAU,KAAK,CAAA,CAAA;AAAA,KACtB,CAAA;AAEA,IAAA,MAAM,aAAa,QAAS,CAAA;AAAA,MAC1B,GAAM,GAAA;AACJ,QAAA,OAAO,KAAM,CAAA,UAAA,CAAA;AAAA,OACf;AAAA,MACA,IAAI,GAA6B,EAAA;AAC/B,QAAA,WAAA,CAAY,GAAG,CAAA,CAAA;AAAA,OACjB;AAAA,KACD,CAAA,CAAA;AAED,IAAA,OAAA,CAAQ,uBAAyB,EAAA;AAAA,MAC/B,GAAG,IAAA,CAAK,MAAO,CAAA,KAAK,CAAG,EAAA;AAAA,QACrB,MAAA;AAAA,QACA,KAAA;AAAA,QACA,KAAA;AAAA,QACA,UAAA;AAAA,QACA,eAAA;AAAA,QACA,MAAA;AAAA,QACA,WAAA;AAAA,OACD,CAAA;AAAA,MACD,UAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAA,KAAA,CAAA,MAAA,KAAA,CAAA,UAAA,EAAA,MAAA;AAAA,MACE,SAAY,CAAA,aAAA,EAAA;AAAA,QACN,QAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,QAAA,CAAA,QAAA,CAAA,QAAA,CAAA,CAAA,KAAA,CAAA,CAAA,GAAA,KAAA,SAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AACJ,OAAA;AACE,KAAU,CAAA,CAAA;AAAgD,IAC5D,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACF,IAAA,EAAA,CAAA;AAAA,MACF,OAAAA,SAAA,EAAA,EAAAC,WAAA,CAAAC,uBAAA,CAAA,IAAA,CAAA,GAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"checkbox-group2.mjs","sources":["../../../../../../packages/components/checkbox/src/checkbox-group.ts"],"sourcesContent":["import { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport { buildProps, definePropType, isArray } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type checkboxGroup from './checkbox-group.vue'\nimport type { CheckboxValueType } from './checkbox'\n\nexport type CheckboxGroupValueType = Exclude<CheckboxValueType, boolean>[]\n\nexport const checkboxGroupProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<CheckboxGroupValueType>(Array),\n default: () => [],\n },\n /**\n * @description whether the nesting checkboxes are disabled\n */\n disabled: Boolean,\n /**\n * @description minimum number of checkbox checked\n */\n min: Number,\n /**\n * @description maximum number of checkbox checked\n */\n max: Number,\n /**\n * @description size of checkbox\n */\n size: useSizeProp,\n /**\n * @description border and background color when button is active\n */\n fill: String,\n /**\n * @description font color when button is active\n */\n textColor: String,\n /**\n * @description element tag of the checkbox group\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n ...useAriaProps(['ariaLabel']),\n} as const)\n\nexport const checkboxGroupEmits = {\n [UPDATE_MODEL_EVENT]: (val: CheckboxGroupValueType) => isArray(val),\n change: (val: CheckboxValueType[]) => isArray(val),\n}\n\nexport type CheckboxGroupProps = ExtractPropTypes<typeof checkboxGroupProps>\nexport type CheckboxGroupEmits = typeof checkboxGroupEmits\nexport type CheckboxGroupInstance = InstanceType<typeof checkboxGroup>\n"],"names":[],"mappings":";;;;;;;;;AAGY,MAAC,kBAAkB,GAAG,UAAU,CAAC;AAC7C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,GAAG,YAAY,CAAC,CAAC,WAAW,CAAC,CAAC;AAChC,CAAC,EAAE;AACS,MAAC,kBAAkB,GAAG;AAClC,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC;AAC7C,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC;AAC/B;;;;"}
@@ -100,7 +100,7 @@ export { cascaderEmits, cascaderProps } from './cascader/src/cascader.mjs';
100
100
  export { CASCADER_PANEL_INJECTION_KEY } from './cascader-panel/src/types.mjs';
101
101
  export { CommonProps, DefaultProps, useCascaderConfig } from './cascader-panel/src/config.mjs';
102
102
  export { checkTagEmits, checkTagProps } from './check-tag/src/check-tag.mjs';
103
- export { checkboxGroupEmits, checkboxGroupProps } from './checkbox/src/checkbox-group.mjs';
103
+ export { checkboxGroupEmits, checkboxGroupProps } from './checkbox/src/checkbox-group2.mjs';
104
104
  export { checkboxEmits, checkboxProps } from './checkbox/src/checkbox.mjs';
105
105
  export { checkboxGroupContextKey } from './checkbox/src/constants.mjs';
106
106
  export { colProps } from './col/src/col.mjs';
@@ -147,12 +147,12 @@ export { elPaginationKey } from './pagination/src/constants.mjs';
147
147
  export { popconfirmEmits, popconfirmProps } from './popconfirm/src/popconfirm.mjs';
148
148
  export { Effect, popperProps, roleTypes, usePopperProps } from './popper/src/popper.mjs';
149
149
  export { popperTriggerProps, usePopperTriggerProps } from './popper/src/trigger.mjs';
150
- export { popperContentEmits, popperContentProps, popperCoreConfigProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps } from './popper/src/content2.mjs';
150
+ export { popperContentEmits, popperContentProps, popperCoreConfigProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps } from './popper/src/content.mjs';
151
151
  export { popperArrowProps, usePopperArrowProps } from './popper/src/arrow.mjs';
152
152
  export { POPPER_CONTENT_INJECTION_KEY, POPPER_INJECTION_KEY } from './popper/src/constants.mjs';
153
153
  export { default as ElPopperArrow } from './popper/src/arrow2.mjs';
154
154
  export { default as ElPopperTrigger } from './popper/src/trigger2.mjs';
155
- export { default as ElPopperContent } from './popper/src/content.mjs';
155
+ export { default as ElPopperContent } from './popper/src/content2.mjs';
156
156
  export { progressProps } from './progress/src/progress.mjs';
157
157
  export { radioEmits, radioProps, radioPropsBase } from './radio/src/radio.mjs';
158
158
  export { radioGroupEmits, radioGroupProps } from './radio/src/radio-group.mjs';
@@ -169,7 +169,7 @@ export { scrollbarContextKey } from './scrollbar/src/constants.mjs';
169
169
  export { selectGroupKey, selectKey } from './select/src/token.mjs';
170
170
  export { selectV2InjectionKey } from './select-v2/src/token.mjs';
171
171
  export { skeletonProps } from './skeleton/src/skeleton.mjs';
172
- export { skeletonItemProps } from './skeleton/src/skeleton-item.mjs';
172
+ export { skeletonItemProps } from './skeleton/src/skeleton-item2.mjs';
173
173
  export { sliderEmits, sliderProps } from './slider/src/slider.mjs';
174
174
  export { sliderContextKey } from './slider/src/constants.mjs';
175
175
  export { spaceProps } from './space/src/space.mjs';
@@ -178,7 +178,7 @@ export { useSpace } from './space/src/use-space.mjs';
178
178
  export { statisticProps } from './statistic/src/statistic.mjs';
179
179
  export { stepProps } from './steps/src/item.mjs';
180
180
  export { stepsEmits, stepsProps } from './steps/src/steps.mjs';
181
- export { switchEmits, switchProps } from './switch/src/switch2.mjs';
181
+ export { switchEmits, switchProps } from './switch/src/switch.mjs';
182
182
  export { Alignment as TableV2Alignment, FixedDir as TableV2FixedDir, SortOrder as TableV2SortOrder } from './table-v2/src/constants.mjs';
183
183
  export { default as TableV2 } from './table-v2/src/table-v2.mjs';
184
184
  export { placeholderSign as TableV2Placeholder } from './table-v2/src/private.mjs';
@@ -2,10 +2,10 @@ import '../../utils/index.mjs';
2
2
  import Popper from './src/popper2.mjs';
3
3
  export { default as ElPopperArrow } from './src/arrow2.mjs';
4
4
  export { default as ElPopperTrigger } from './src/trigger2.mjs';
5
- export { default as ElPopperContent } from './src/content.mjs';
5
+ export { default as ElPopperContent } from './src/content2.mjs';
6
6
  export { Effect, popperProps, roleTypes, usePopperProps } from './src/popper.mjs';
7
7
  export { popperTriggerProps, usePopperTriggerProps } from './src/trigger.mjs';
8
- export { popperContentEmits, popperContentProps, popperCoreConfigProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps } from './src/content2.mjs';
8
+ export { popperContentEmits, popperContentProps, popperCoreConfigProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps } from './src/content.mjs';
9
9
  export { popperArrowProps, usePopperArrowProps } from './src/arrow.mjs';
10
10
  export { POPPER_CONTENT_INJECTION_KEY, POPPER_INJECTION_KEY } from './src/constants.mjs';
11
11
  import { withInstall } from '../../utils/vue/install.mjs';
@@ -1,143 +1,99 @@
1
- import { defineComponent, inject, ref, provide, onMounted, watch, unref, onBeforeUnmount, openBlock, createElementBlock, mergeProps, createVNode, withCtx, renderSlot } from 'vue';
2
- import { isNil } from 'lodash-unified';
1
+ import { placements } from '@popperjs/core';
3
2
  import '../../../utils/index.mjs';
4
- import '../../focus-trap/index.mjs';
5
- import '../../form/index.mjs';
6
- import { POPPER_CONTENT_INJECTION_KEY } from './constants.mjs';
7
- import { popperContentProps, popperContentEmits } from './content2.mjs';
8
- import './composables/index.mjs';
9
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
- import { usePopperContentFocusTrap } from './composables/use-focus-trap.mjs';
11
- import { usePopperContent } from './composables/use-content.mjs';
12
- import { usePopperContentDOM } from './composables/use-content-dom.mjs';
13
- import { formItemContextKey } from '../../form/src/constants.mjs';
14
- import { NOOP } from '@vue/shared';
15
- import { isElement } from '../../../utils/types.mjs';
16
- import ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';
3
+ import '../../../hooks/index.mjs';
4
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
5
+ import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
17
6
 
18
- const __default__ = defineComponent({
19
- name: "ElPopperContent"
20
- });
21
- const _sfc_main = /* @__PURE__ */ defineComponent({
22
- ...__default__,
23
- props: popperContentProps,
24
- emits: popperContentEmits,
25
- setup(__props, { expose, emit }) {
26
- const props = __props;
27
- const {
28
- focusStartRef,
29
- trapped,
30
- onFocusAfterReleased,
31
- onFocusAfterTrapped,
32
- onFocusInTrap,
33
- onFocusoutPrevented,
34
- onReleaseRequested
35
- } = usePopperContentFocusTrap(props, emit);
36
- const { attributes, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props);
37
- const {
38
- ariaModal,
39
- arrowStyle,
40
- contentAttrs,
41
- contentClass,
42
- contentStyle,
43
- updateZIndex
44
- } = usePopperContentDOM(props, {
45
- styles,
46
- attributes,
47
- role
48
- });
49
- const formItemContext = inject(formItemContextKey, void 0);
50
- const arrowOffset = ref();
51
- provide(POPPER_CONTENT_INJECTION_KEY, {
52
- arrowStyle,
53
- arrowRef,
54
- arrowOffset
55
- });
56
- if (formItemContext) {
57
- provide(formItemContextKey, {
58
- ...formItemContext,
59
- addInputId: NOOP,
60
- removeInputId: NOOP
61
- });
62
- }
63
- let triggerTargetAriaStopWatch = void 0;
64
- const updatePopper = (shouldUpdateZIndex = true) => {
65
- update();
66
- shouldUpdateZIndex && updateZIndex();
67
- };
68
- const togglePopperAlive = () => {
69
- updatePopper(false);
70
- if (props.visible && props.focusOnShow) {
71
- trapped.value = true;
72
- } else if (props.visible === false) {
73
- trapped.value = false;
74
- }
75
- };
76
- onMounted(() => {
77
- watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
78
- triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
79
- triggerTargetAriaStopWatch = void 0;
80
- const el = unref(triggerTargetEl || contentRef.value);
81
- const prevEl = unref(prevTriggerTargetEl || contentRef.value);
82
- if (isElement(el)) {
83
- triggerTargetAriaStopWatch = watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
84
- ;
85
- ["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
86
- isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
87
- });
88
- }, { immediate: true });
89
- }
90
- if (prevEl !== el && isElement(prevEl)) {
91
- ;
92
- ["role", "aria-label", "aria-modal", "id"].forEach((key) => {
93
- prevEl.removeAttribute(key);
94
- });
95
- }
96
- }, { immediate: true });
97
- watch(() => props.visible, togglePopperAlive, { immediate: true });
98
- });
99
- onBeforeUnmount(() => {
100
- triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
101
- triggerTargetAriaStopWatch = void 0;
102
- });
103
- expose({
104
- popperContentRef: contentRef,
105
- popperInstanceRef: instanceRef,
106
- updatePopper,
107
- contentStyle
108
- });
109
- return (_ctx, _cache) => {
110
- return openBlock(), createElementBlock("div", mergeProps({
111
- ref_key: "contentRef",
112
- ref: contentRef
113
- }, unref(contentAttrs), {
114
- style: unref(contentStyle),
115
- class: unref(contentClass),
116
- tabindex: "-1",
117
- onMouseenter: (e) => _ctx.$emit("mouseenter", e),
118
- onMouseleave: (e) => _ctx.$emit("mouseleave", e)
119
- }), [
120
- createVNode(unref(ElFocusTrap), {
121
- trapped: unref(trapped),
122
- "trap-on-focus-in": true,
123
- "focus-trap-el": unref(contentRef),
124
- "focus-start-el": unref(focusStartRef),
125
- onFocusAfterTrapped: unref(onFocusAfterTrapped),
126
- onFocusAfterReleased: unref(onFocusAfterReleased),
127
- onFocusin: unref(onFocusInTrap),
128
- onFocusoutPrevented: unref(onFocusoutPrevented),
129
- onReleaseRequested: unref(onReleaseRequested)
130
- }, {
131
- default: withCtx(() => [
132
- renderSlot(_ctx.$slots, "default")
133
- ]),
134
- _: 3
135
- }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
136
- ], 16, ["onMouseenter", "onMouseleave"]);
137
- };
7
+ const POSITIONING_STRATEGIES = ["fixed", "absolute"];
8
+ const popperCoreConfigProps = buildProps({
9
+ boundariesPadding: {
10
+ type: Number,
11
+ default: 0
12
+ },
13
+ fallbackPlacements: {
14
+ type: definePropType(Array),
15
+ default: void 0
16
+ },
17
+ gpuAcceleration: {
18
+ type: Boolean,
19
+ default: true
20
+ },
21
+ offset: {
22
+ type: Number,
23
+ default: 12
24
+ },
25
+ placement: {
26
+ type: String,
27
+ values: placements,
28
+ default: "bottom"
29
+ },
30
+ popperOptions: {
31
+ type: definePropType(Object),
32
+ default: () => ({})
33
+ },
34
+ strategy: {
35
+ type: String,
36
+ values: POSITIONING_STRATEGIES,
37
+ default: "absolute"
138
38
  }
139
39
  });
140
- var ElPopperContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "content.vue"]]);
40
+ const popperContentProps = buildProps({
41
+ ...popperCoreConfigProps,
42
+ id: String,
43
+ style: {
44
+ type: definePropType([String, Array, Object])
45
+ },
46
+ className: {
47
+ type: definePropType([String, Array, Object])
48
+ },
49
+ effect: {
50
+ type: definePropType(String),
51
+ default: "dark"
52
+ },
53
+ visible: Boolean,
54
+ enterable: {
55
+ type: Boolean,
56
+ default: true
57
+ },
58
+ pure: Boolean,
59
+ focusOnShow: {
60
+ type: Boolean,
61
+ default: false
62
+ },
63
+ trapping: {
64
+ type: Boolean,
65
+ default: false
66
+ },
67
+ popperClass: {
68
+ type: definePropType([String, Array, Object])
69
+ },
70
+ popperStyle: {
71
+ type: definePropType([String, Array, Object])
72
+ },
73
+ referenceEl: {
74
+ type: definePropType(Object)
75
+ },
76
+ triggerTargetEl: {
77
+ type: definePropType(Object)
78
+ },
79
+ stopPopperMouseEvent: {
80
+ type: Boolean,
81
+ default: true
82
+ },
83
+ virtualTriggering: Boolean,
84
+ zIndex: Number,
85
+ ...useAriaProps(["ariaLabel"])
86
+ });
87
+ const popperContentEmits = {
88
+ mouseenter: (evt) => evt instanceof MouseEvent,
89
+ mouseleave: (evt) => evt instanceof MouseEvent,
90
+ focus: () => true,
91
+ blur: () => true,
92
+ close: () => true
93
+ };
94
+ const usePopperCoreConfigProps = popperCoreConfigProps;
95
+ const usePopperContentProps = popperContentProps;
96
+ const usePopperContentEmits = popperContentEmits;
141
97
 
142
- export { ElPopperContent as default };
98
+ export { popperContentEmits, popperContentProps, popperCoreConfigProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps };
143
99
  //# sourceMappingURL=content.mjs.map