@element-plus/nightly 0.0.20241106 → 0.0.20241108

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.full.js +34 -17
  3. package/dist/index.full.min.js +8 -8
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +9 -9
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +34 -17
  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/my.js +1 -1
  153. package/dist/locale/my.min.js +1 -1
  154. package/dist/locale/my.min.mjs +1 -1
  155. package/dist/locale/my.mjs +1 -1
  156. package/dist/locale/nb-no.js +1 -1
  157. package/dist/locale/nb-no.min.js +1 -1
  158. package/dist/locale/nb-no.min.mjs +1 -1
  159. package/dist/locale/nb-no.mjs +1 -1
  160. package/dist/locale/nl.js +1 -1
  161. package/dist/locale/nl.min.js +1 -1
  162. package/dist/locale/nl.min.mjs +1 -1
  163. package/dist/locale/nl.mjs +1 -1
  164. package/dist/locale/pa.js +1 -1
  165. package/dist/locale/pa.min.js +1 -1
  166. package/dist/locale/pa.min.mjs +1 -1
  167. package/dist/locale/pa.mjs +1 -1
  168. package/dist/locale/pl.js +1 -1
  169. package/dist/locale/pl.min.js +1 -1
  170. package/dist/locale/pl.min.mjs +1 -1
  171. package/dist/locale/pl.mjs +1 -1
  172. package/dist/locale/pt-br.js +1 -1
  173. package/dist/locale/pt-br.min.js +1 -1
  174. package/dist/locale/pt-br.min.mjs +1 -1
  175. package/dist/locale/pt-br.mjs +1 -1
  176. package/dist/locale/pt.js +1 -1
  177. package/dist/locale/pt.min.js +1 -1
  178. package/dist/locale/pt.min.mjs +1 -1
  179. package/dist/locale/pt.mjs +1 -1
  180. package/dist/locale/ro.js +1 -1
  181. package/dist/locale/ro.min.js +1 -1
  182. package/dist/locale/ro.min.mjs +1 -1
  183. package/dist/locale/ro.mjs +1 -1
  184. package/dist/locale/ru.js +1 -1
  185. package/dist/locale/ru.min.js +1 -1
  186. package/dist/locale/ru.min.mjs +1 -1
  187. package/dist/locale/ru.mjs +1 -1
  188. package/dist/locale/sk.js +1 -1
  189. package/dist/locale/sk.min.js +1 -1
  190. package/dist/locale/sk.min.mjs +1 -1
  191. package/dist/locale/sk.mjs +1 -1
  192. package/dist/locale/sl.js +1 -1
  193. package/dist/locale/sl.min.js +1 -1
  194. package/dist/locale/sl.min.mjs +1 -1
  195. package/dist/locale/sl.mjs +1 -1
  196. package/dist/locale/sr.js +1 -1
  197. package/dist/locale/sr.min.js +1 -1
  198. package/dist/locale/sr.min.mjs +1 -1
  199. package/dist/locale/sr.mjs +1 -1
  200. package/dist/locale/sv.js +1 -1
  201. package/dist/locale/sv.min.js +1 -1
  202. package/dist/locale/sv.min.mjs +1 -1
  203. package/dist/locale/sv.mjs +1 -1
  204. package/dist/locale/sw.js +1 -1
  205. package/dist/locale/sw.min.js +1 -1
  206. package/dist/locale/sw.min.mjs +1 -1
  207. package/dist/locale/sw.mjs +1 -1
  208. package/dist/locale/ta.js +1 -1
  209. package/dist/locale/ta.min.js +1 -1
  210. package/dist/locale/ta.min.mjs +1 -1
  211. package/dist/locale/ta.mjs +1 -1
  212. package/dist/locale/th.js +1 -1
  213. package/dist/locale/th.min.js +1 -1
  214. package/dist/locale/th.min.mjs +1 -1
  215. package/dist/locale/th.mjs +1 -1
  216. package/dist/locale/tk.js +1 -1
  217. package/dist/locale/tk.min.js +1 -1
  218. package/dist/locale/tk.min.mjs +1 -1
  219. package/dist/locale/tk.mjs +1 -1
  220. package/dist/locale/tr.js +1 -1
  221. package/dist/locale/tr.min.js +1 -1
  222. package/dist/locale/tr.min.mjs +1 -1
  223. package/dist/locale/tr.mjs +1 -1
  224. package/dist/locale/ug-cn.js +1 -1
  225. package/dist/locale/ug-cn.min.js +1 -1
  226. package/dist/locale/ug-cn.min.mjs +1 -1
  227. package/dist/locale/ug-cn.mjs +1 -1
  228. package/dist/locale/uk.js +1 -1
  229. package/dist/locale/uk.min.js +1 -1
  230. package/dist/locale/uk.min.mjs +1 -1
  231. package/dist/locale/uk.mjs +1 -1
  232. package/dist/locale/uz-uz.js +1 -1
  233. package/dist/locale/uz-uz.min.js +1 -1
  234. package/dist/locale/uz-uz.min.mjs +1 -1
  235. package/dist/locale/uz-uz.mjs +1 -1
  236. package/dist/locale/vi.js +1 -1
  237. package/dist/locale/vi.min.js +1 -1
  238. package/dist/locale/vi.min.mjs +1 -1
  239. package/dist/locale/vi.mjs +1 -1
  240. package/dist/locale/zh-cn.js +1 -1
  241. package/dist/locale/zh-cn.min.js +1 -1
  242. package/dist/locale/zh-cn.min.mjs +1 -1
  243. package/dist/locale/zh-cn.mjs +1 -1
  244. package/dist/locale/zh-tw.js +1 -1
  245. package/dist/locale/zh-tw.min.js +1 -1
  246. package/dist/locale/zh-tw.min.mjs +1 -1
  247. package/dist/locale/zh-tw.mjs +1 -1
  248. package/es/components/drawer/index.mjs +2 -2
  249. package/es/components/drawer/src/drawer.mjs +27 -181
  250. package/es/components/drawer/src/drawer.mjs.map +1 -1
  251. package/es/components/drawer/src/drawer2.mjs +181 -27
  252. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  253. package/es/components/index.mjs +1 -1
  254. package/es/components/mention/src/mention-dropdown2.mjs +1 -1
  255. package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
  256. package/es/components/segmented/src/segmented2.mjs +1 -0
  257. package/es/components/segmented/src/segmented2.mjs.map +1 -1
  258. package/es/components/select/src/option.mjs +2 -2
  259. package/es/components/select/src/option.mjs.map +1 -1
  260. package/es/components/select-v2/src/option-item.mjs +2 -2
  261. package/es/components/select-v2/src/option-item.mjs.map +1 -1
  262. package/es/components/skeleton/src/skeleton.d.ts +10 -1
  263. package/es/components/skeleton/src/skeleton.mjs +2 -2
  264. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  265. package/es/components/skeleton/src/skeleton.vue.d.ts +18 -2
  266. package/es/components/skeleton/src/skeleton2.mjs +1 -1
  267. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  268. package/es/components/tour/src/mask.mjs +76 -19
  269. package/es/components/tour/src/mask.mjs.map +1 -1
  270. package/es/components/tour/src/mask2.mjs +19 -76
  271. package/es/components/tour/src/mask2.mjs.map +1 -1
  272. package/es/components/tour/src/tour2.mjs +1 -1
  273. package/es/hooks/use-throttle-render/index.d.ts +6 -1
  274. package/es/hooks/use-throttle-render/index.mjs +27 -8
  275. package/es/hooks/use-throttle-render/index.mjs.map +1 -1
  276. package/es/index.mjs +1 -1
  277. package/es/version.d.ts +1 -1
  278. package/es/version.mjs +1 -1
  279. package/es/version.mjs.map +1 -1
  280. package/lib/components/drawer/index.js +2 -2
  281. package/lib/components/drawer/src/drawer.js +28 -181
  282. package/lib/components/drawer/src/drawer.js.map +1 -1
  283. package/lib/components/drawer/src/drawer2.js +181 -28
  284. package/lib/components/drawer/src/drawer2.js.map +1 -1
  285. package/lib/components/index.js +1 -1
  286. package/lib/components/mention/src/mention-dropdown2.js +1 -1
  287. package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
  288. package/lib/components/segmented/src/segmented2.js +1 -0
  289. package/lib/components/segmented/src/segmented2.js.map +1 -1
  290. package/lib/components/select/src/option.js +2 -2
  291. package/lib/components/select/src/option.js.map +1 -1
  292. package/lib/components/select-v2/src/option-item.js +2 -2
  293. package/lib/components/select-v2/src/option-item.js.map +1 -1
  294. package/lib/components/skeleton/src/skeleton.d.ts +10 -1
  295. package/lib/components/skeleton/src/skeleton.js +1 -1
  296. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  297. package/lib/components/skeleton/src/skeleton.vue.d.ts +18 -2
  298. package/lib/components/skeleton/src/skeleton2.js +1 -1
  299. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  300. package/lib/components/tour/src/mask.js +76 -19
  301. package/lib/components/tour/src/mask.js.map +1 -1
  302. package/lib/components/tour/src/mask2.js +19 -76
  303. package/lib/components/tour/src/mask2.js.map +1 -1
  304. package/lib/components/tour/src/tour2.js +1 -1
  305. package/lib/hooks/use-throttle-render/index.d.ts +6 -1
  306. package/lib/hooks/use-throttle-render/index.js +27 -8
  307. package/lib/hooks/use-throttle-render/index.js.map +1 -1
  308. package/lib/index.js +1 -1
  309. package/lib/version.d.ts +1 -1
  310. package/lib/version.js +1 -1
  311. package/lib/version.js.map +1 -1
  312. package/package.json +2 -2
  313. package/web-types.json +1 -1
@@ -2,37 +2,190 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../../../utils/index.js');
5
+ var vue = require('vue');
6
+ var iconsVue = require('@element-plus/icons-vue');
7
+ var index$4 = require('../../overlay/index.js');
8
+ require('../../focus-trap/index.js');
9
+ var index$3 = require('../../teleport/index.js');
6
10
  require('../../dialog/index.js');
7
- var runtime = require('../../../utils/vue/props/runtime.js');
8
- var dialog = require('../../dialog/src/dialog.js');
11
+ require('../../../utils/index.js');
12
+ var index$5 = require('../../icon/index.js');
13
+ require('../../../hooks/index.js');
14
+ var drawer = require('./drawer.js');
15
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
16
+ var index = require('../../../hooks/use-deprecated/index.js');
17
+ var index$1 = require('../../../hooks/use-namespace/index.js');
18
+ var index$2 = require('../../../hooks/use-locale/index.js');
19
+ var useDialog = require('../../dialog/src/use-dialog.js');
20
+ var style = require('../../../utils/dom/style.js');
21
+ var focusTrap = require('../../focus-trap/src/focus-trap.js');
9
22
 
10
- const drawerProps = runtime.buildProps({
11
- ...dialog.dialogProps,
12
- direction: {
13
- type: String,
14
- default: "rtl",
15
- values: ["ltr", "rtl", "ttb", "btt"]
16
- },
17
- size: {
18
- type: [String, Number],
19
- default: "30%"
20
- },
21
- withHeader: {
22
- type: Boolean,
23
- default: true
24
- },
25
- modalFade: {
26
- type: Boolean,
27
- default: true
28
- },
29
- headerAriaLevel: {
30
- type: String,
31
- default: "2"
23
+ const __default__ = vue.defineComponent({
24
+ name: "ElDrawer",
25
+ inheritAttrs: false
26
+ });
27
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
28
+ ...__default__,
29
+ props: drawer.drawerProps,
30
+ emits: drawer.drawerEmits,
31
+ setup(__props, { expose }) {
32
+ const props = __props;
33
+ const slots = vue.useSlots();
34
+ index.useDeprecated({
35
+ scope: "el-drawer",
36
+ from: "the title slot",
37
+ replacement: "the header slot",
38
+ version: "3.0.0",
39
+ ref: "https://element-plus.org/en-US/component/drawer.html#slots"
40
+ }, vue.computed(() => !!slots.title));
41
+ const drawerRef = vue.ref();
42
+ const focusStartRef = vue.ref();
43
+ const ns = index$1.useNamespace("drawer");
44
+ const { t } = index$2.useLocale();
45
+ const {
46
+ afterEnter,
47
+ afterLeave,
48
+ beforeLeave,
49
+ visible,
50
+ rendered,
51
+ titleId,
52
+ bodyId,
53
+ zIndex,
54
+ onModalClick,
55
+ onOpenAutoFocus,
56
+ onCloseAutoFocus,
57
+ onFocusoutPrevented,
58
+ onCloseRequested,
59
+ handleClose
60
+ } = useDialog.useDialog(props, drawerRef);
61
+ const isHorizontal = vue.computed(() => props.direction === "rtl" || props.direction === "ltr");
62
+ const drawerSize = vue.computed(() => style.addUnit(props.size));
63
+ expose({
64
+ handleClose,
65
+ afterEnter,
66
+ afterLeave
67
+ });
68
+ return (_ctx, _cache) => {
69
+ return vue.openBlock(), vue.createBlock(vue.unref(index$3.ElTeleport), {
70
+ to: _ctx.appendTo,
71
+ disabled: _ctx.appendTo !== "body" ? false : !_ctx.appendToBody
72
+ }, {
73
+ default: vue.withCtx(() => [
74
+ vue.createVNode(vue.Transition, {
75
+ name: vue.unref(ns).b("fade"),
76
+ onAfterEnter: vue.unref(afterEnter),
77
+ onAfterLeave: vue.unref(afterLeave),
78
+ onBeforeLeave: vue.unref(beforeLeave),
79
+ persisted: ""
80
+ }, {
81
+ default: vue.withCtx(() => [
82
+ vue.withDirectives(vue.createVNode(vue.unref(index$4.ElOverlay), {
83
+ mask: _ctx.modal,
84
+ "overlay-class": _ctx.modalClass,
85
+ "z-index": vue.unref(zIndex),
86
+ onClick: vue.unref(onModalClick)
87
+ }, {
88
+ default: vue.withCtx(() => [
89
+ vue.createVNode(vue.unref(focusTrap["default"]), {
90
+ loop: "",
91
+ trapped: vue.unref(visible),
92
+ "focus-trap-el": drawerRef.value,
93
+ "focus-start-el": focusStartRef.value,
94
+ onFocusAfterTrapped: vue.unref(onOpenAutoFocus),
95
+ onFocusAfterReleased: vue.unref(onCloseAutoFocus),
96
+ onFocusoutPrevented: vue.unref(onFocusoutPrevented),
97
+ onReleaseRequested: vue.unref(onCloseRequested)
98
+ }, {
99
+ default: vue.withCtx(() => [
100
+ vue.createElementVNode("div", vue.mergeProps({
101
+ ref_key: "drawerRef",
102
+ ref: drawerRef,
103
+ "aria-modal": "true",
104
+ "aria-label": _ctx.title || void 0,
105
+ "aria-labelledby": !_ctx.title ? vue.unref(titleId) : void 0,
106
+ "aria-describedby": vue.unref(bodyId)
107
+ }, _ctx.$attrs, {
108
+ class: [vue.unref(ns).b(), _ctx.direction, vue.unref(visible) && "open"],
109
+ style: vue.unref(isHorizontal) ? "width: " + vue.unref(drawerSize) : "height: " + vue.unref(drawerSize),
110
+ role: "dialog",
111
+ onClick: vue.withModifiers(() => {
112
+ }, ["stop"])
113
+ }), [
114
+ vue.createElementVNode("span", {
115
+ ref_key: "focusStartRef",
116
+ ref: focusStartRef,
117
+ class: vue.normalizeClass(vue.unref(ns).e("sr-focus")),
118
+ tabindex: "-1"
119
+ }, null, 2),
120
+ _ctx.withHeader ? (vue.openBlock(), vue.createElementBlock("header", {
121
+ key: 0,
122
+ class: vue.normalizeClass(vue.unref(ns).e("header"))
123
+ }, [
124
+ !_ctx.$slots.title ? vue.renderSlot(_ctx.$slots, "header", {
125
+ key: 0,
126
+ close: vue.unref(handleClose),
127
+ titleId: vue.unref(titleId),
128
+ titleClass: vue.unref(ns).e("title")
129
+ }, () => [
130
+ !_ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", {
131
+ key: 0,
132
+ id: vue.unref(titleId),
133
+ role: "heading",
134
+ "aria-level": _ctx.headerAriaLevel,
135
+ class: vue.normalizeClass(vue.unref(ns).e("title"))
136
+ }, vue.toDisplayString(_ctx.title), 11, ["id", "aria-level"])) : vue.createCommentVNode("v-if", true)
137
+ ]) : vue.renderSlot(_ctx.$slots, "title", { key: 1 }, () => [
138
+ vue.createCommentVNode(" DEPRECATED SLOT ")
139
+ ]),
140
+ _ctx.showClose ? (vue.openBlock(), vue.createElementBlock("button", {
141
+ key: 2,
142
+ "aria-label": vue.unref(t)("el.drawer.close"),
143
+ class: vue.normalizeClass(vue.unref(ns).e("close-btn")),
144
+ type: "button",
145
+ onClick: vue.unref(handleClose)
146
+ }, [
147
+ vue.createVNode(vue.unref(index$5.ElIcon), {
148
+ class: vue.normalizeClass(vue.unref(ns).e("close"))
149
+ }, {
150
+ default: vue.withCtx(() => [
151
+ vue.createVNode(vue.unref(iconsVue.Close))
152
+ ]),
153
+ _: 1
154
+ }, 8, ["class"])
155
+ ], 10, ["aria-label", "onClick"])) : vue.createCommentVNode("v-if", true)
156
+ ], 2)) : vue.createCommentVNode("v-if", true),
157
+ vue.unref(rendered) ? (vue.openBlock(), vue.createElementBlock("div", {
158
+ key: 1,
159
+ id: vue.unref(bodyId),
160
+ class: vue.normalizeClass(vue.unref(ns).e("body"))
161
+ }, [
162
+ vue.renderSlot(_ctx.$slots, "default")
163
+ ], 10, ["id"])) : vue.createCommentVNode("v-if", true),
164
+ _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", {
165
+ key: 2,
166
+ class: vue.normalizeClass(vue.unref(ns).e("footer"))
167
+ }, [
168
+ vue.renderSlot(_ctx.$slots, "footer")
169
+ ], 2)) : vue.createCommentVNode("v-if", true)
170
+ ], 16, ["aria-label", "aria-labelledby", "aria-describedby", "onClick"])
171
+ ]),
172
+ _: 3
173
+ }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
174
+ ]),
175
+ _: 3
176
+ }, 8, ["mask", "overlay-class", "z-index", "onClick"]), [
177
+ [vue.vShow, vue.unref(visible)]
178
+ ])
179
+ ]),
180
+ _: 3
181
+ }, 8, ["name", "onAfterEnter", "onAfterLeave", "onBeforeLeave"])
182
+ ]),
183
+ _: 3
184
+ }, 8, ["to", "disabled"]);
185
+ };
32
186
  }
33
187
  });
34
- const drawerEmits = dialog.dialogEmits;
188
+ var Drawer = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "drawer.vue"]]);
35
189
 
36
- exports.drawerEmits = drawerEmits;
37
- exports.drawerProps = drawerProps;
190
+ exports["default"] = Drawer;
38
191
  //# sourceMappingURL=drawer2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer2.js","sources":["../../../../../../packages/components/drawer/src/drawer.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { dialogEmits, dialogProps } from '@element-plus/components/dialog'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const drawerProps = buildProps({\n ...dialogProps,\n direction: {\n type: String,\n default: 'rtl',\n values: ['ltr', 'rtl', 'ttb', 'btt'],\n },\n size: {\n type: [String, Number],\n default: '30%',\n },\n withHeader: {\n type: Boolean,\n default: true,\n },\n modalFade: {\n type: Boolean,\n default: true,\n },\n headerAriaLevel: {\n type: String,\n default: '2',\n },\n} as const)\n\nexport type DrawerProps = ExtractPropTypes<typeof drawerProps>\n\nexport const drawerEmits = dialogEmits\n"],"names":["buildProps","dialogProps","dialogEmits"],"mappings":";;;;;;;;;AAEY,MAAC,WAAW,GAAGA,kBAAU,CAAC;AACtC,EAAE,GAAGC,kBAAW;AAChB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;AACxC,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,WAAW,GAAGC;;;;;"}
1
+ {"version":3,"file":"drawer2.js","sources":["../../../../../../packages/components/drawer/src/drawer.vue"],"sourcesContent":["<template>\n <el-teleport\n :to=\"appendTo\"\n :disabled=\"appendTo !== 'body' ? false : !appendToBody\"\n >\n <transition\n :name=\"ns.b('fade')\"\n @after-enter=\"afterEnter\"\n @after-leave=\"afterLeave\"\n @before-leave=\"beforeLeave\"\n >\n <el-overlay\n v-show=\"visible\"\n :mask=\"modal\"\n :overlay-class=\"modalClass\"\n :z-index=\"zIndex\"\n @click=\"onModalClick\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n :focus-trap-el=\"drawerRef\"\n :focus-start-el=\"focusStartRef\"\n @focus-after-trapped=\"onOpenAutoFocus\"\n @focus-after-released=\"onCloseAutoFocus\"\n @focusout-prevented=\"onFocusoutPrevented\"\n @release-requested=\"onCloseRequested\"\n >\n <div\n ref=\"drawerRef\"\n aria-modal=\"true\"\n :aria-label=\"title || undefined\"\n :aria-labelledby=\"!title ? titleId : undefined\"\n :aria-describedby=\"bodyId\"\n v-bind=\"$attrs\"\n :class=\"[ns.b(), direction, visible && 'open']\"\n :style=\"\n isHorizontal ? 'width: ' + drawerSize : 'height: ' + drawerSize\n \"\n role=\"dialog\"\n @click.stop\n >\n <span ref=\"focusStartRef\" :class=\"ns.e('sr-focus')\" tabindex=\"-1\" />\n <header v-if=\"withHeader\" :class=\"ns.e('header')\">\n <slot\n v-if=\"!$slots.title\"\n name=\"header\"\n :close=\"handleClose\"\n :title-id=\"titleId\"\n :title-class=\"ns.e('title')\"\n >\n <span\n v-if=\"!$slots.title\"\n :id=\"titleId\"\n role=\"heading\"\n :aria-level=\"headerAriaLevel\"\n :class=\"ns.e('title')\"\n >\n {{ title }}\n </span>\n </slot>\n <slot v-else name=\"title\">\n <!-- DEPRECATED SLOT -->\n </slot>\n <button\n v-if=\"showClose\"\n :aria-label=\"t('el.drawer.close')\"\n :class=\"ns.e('close-btn')\"\n type=\"button\"\n @click=\"handleClose\"\n >\n <el-icon :class=\"ns.e('close')\"><close /></el-icon>\n </button>\n </header>\n <template v-if=\"rendered\">\n <div :id=\"bodyId\" :class=\"ns.e('body')\">\n <slot />\n </div>\n </template>\n <div v-if=\"$slots.footer\" :class=\"ns.e('footer')\">\n <slot name=\"footer\" />\n </div>\n </div>\n </el-focus-trap>\n </el-overlay>\n </transition>\n </el-teleport>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, useSlots } from 'vue'\nimport { Close } from '@element-plus/icons-vue'\n\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport ElTeleport from '@element-plus/components/teleport'\nimport { useDialog } from '@element-plus/components/dialog'\nimport { addUnit } from '@element-plus/utils'\nimport ElIcon from '@element-plus/components/icon'\nimport { useDeprecated, useLocale, useNamespace } from '@element-plus/hooks'\nimport { drawerEmits, drawerProps } from './drawer'\n\ndefineOptions({\n name: 'ElDrawer',\n inheritAttrs: false,\n})\n\nconst props = defineProps(drawerProps)\ndefineEmits(drawerEmits)\nconst slots = useSlots()\n\nuseDeprecated(\n {\n scope: 'el-drawer',\n from: 'the title slot',\n replacement: 'the header slot',\n version: '3.0.0',\n ref: 'https://element-plus.org/en-US/component/drawer.html#slots',\n },\n computed(() => !!slots.title)\n)\n\nconst drawerRef = ref<HTMLElement>()\nconst focusStartRef = ref<HTMLElement>()\nconst ns = useNamespace('drawer')\nconst { t } = useLocale()\nconst {\n afterEnter,\n afterLeave,\n beforeLeave,\n visible,\n rendered,\n titleId,\n bodyId,\n zIndex,\n onModalClick,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onFocusoutPrevented,\n onCloseRequested,\n handleClose,\n} = useDialog(props, drawerRef)\n\nconst isHorizontal = computed(\n () => props.direction === 'rtl' || props.direction === 'ltr'\n)\nconst drawerSize = computed(() => addUnit(props.size))\n\ndefineExpose({\n handleClose,\n afterEnter,\n afterLeave,\n})\n</script>\n"],"names":["useSlots","useDeprecated","computed","ref","useNamespace","useDialog","addUnit","_openBlock","_createBlock","_unref","ElTeleport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;uCAsGc,CAAA;AAAA,EACZ,IAAM,EAAA,UAAA;AAAA,EACN,YAAc,EAAA,KAAA;AAChB,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,QAAQA,YAAS,EAAA,CAAA;AAEvB,IAAAC,mBAAA,CAAA;AAAA,MACE,KAAA,EAAA,WAAA;AAAA,MAAA,IACS,EAAA,gBAAA;AAAA,MAAA,WACD,EAAA,iBAAA;AAAA,MAAA,OACO,EAAA,OAAA;AAAA,MAAA,GACJ,EAAA,4DAAA;AAAA,KAAA,EAAAC,YACJ,CAAA,MAAA,CAAA,CAAA,KAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AAAA,IACP,MAAA,SAAA,GAAAC,OAAA,EAAA,CAAA;AAAA,IAAA,MACS,aAAQ,UAAM,EAAK,CAAA;AAAA,IAC9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/dialog.js');
126
126
  var constants$7 = require('./dialog/src/constants.js');
127
127
  var divider = require('./divider/src/divider.js');
128
- var drawer = require('./drawer/src/drawer2.js');
128
+ var drawer = require('./drawer/src/drawer.js');
129
129
  var dropdown = require('./dropdown/src/dropdown.js');
130
130
  var tokens = require('./dropdown/src/tokens.js');
131
131
  var empty = require('./empty/src/empty.js');
@@ -128,7 +128,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
128
128
  ref_for: true,
129
129
  ref_key: "optionRefs",
130
130
  ref: optionRefs,
131
- key: item.value,
131
+ key: index,
132
132
  class: vue.normalizeClass(optionkls(item, index)),
133
133
  role: "option",
134
134
  "aria-disabled": item.disabled || _ctx.disabled || void 0,
@@ -1 +1 @@
1
- {"version":3,"file":"mention-dropdown2.js","sources":["../../../../../../packages/components/mention/src/mention-dropdown.vue"],"sourcesContent":["<template>\n <div ref=\"dropdownRef\" :class=\"ns.b('dropdown')\">\n <div v-if=\"$slots.header\" :class=\"ns.be('dropdown', 'header')\">\n <slot name=\"header\" />\n </div>\n <el-scrollbar\n v-show=\"options.length > 0 && !loading\"\n :id=\"contentId\"\n ref=\"scrollbarRef\"\n tag=\"ul\"\n :wrap-class=\"ns.be('dropdown', 'wrap')\"\n :view-class=\"ns.be('dropdown', 'list')\"\n role=\"listbox\"\n :aria-label=\"ariaLabel\"\n aria-orientation=\"vertical\"\n >\n <li\n v-for=\"(item, index) in options\"\n :id=\"`${contentId}-${index}`\"\n ref=\"optionRefs\"\n :key=\"item.value\"\n :class=\"optionkls(item, index)\"\n role=\"option\"\n :aria-disabled=\"item.disabled || disabled || undefined\"\n :aria-selected=\"hoveringIndex === index\"\n @mousemove=\"handleMouseEnter(index)\"\n @click.stop=\"handleSelect(item)\"\n >\n <slot name=\"label\" :item=\"item\" :index=\"index\">\n <span>{{ item.label ?? item.value }}</span>\n </slot>\n </li>\n </el-scrollbar>\n <div v-if=\"loading\" :class=\"ns.be('dropdown', 'loading')\">\n <slot name=\"loading\"> {{ t('el.mention.loading') }} </slot>\n </div>\n <div v-if=\"$slots.footer\" :class=\"ns.be('dropdown', 'footer')\">\n <slot name=\"footer\" />\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { scrollIntoView } from '@element-plus/utils'\nimport ElScrollbar from '@element-plus/components/scrollbar'\nimport { mentionDropdownEmits, mentionDropdownProps } from './mention-dropdown'\n\nimport type { MentionOption } from './types'\n\ndefineOptions({\n name: 'ElMentionDropdown',\n})\n\nconst props = defineProps(mentionDropdownProps)\nconst emit = defineEmits(mentionDropdownEmits)\n\nconst ns = useNamespace('mention')\nconst { t } = useLocale()\nconst hoveringIndex = ref(-1)\n\nconst scrollbarRef = ref<InstanceType<typeof ElScrollbar>>()\nconst optionRefs = ref<HTMLElement[]>()\nconst dropdownRef = ref<HTMLElement>()\n\nconst optionkls = (item: MentionOption, index: number) => [\n ns.be('dropdown', 'item'),\n ns.is('hovering', hoveringIndex.value === index),\n ns.is('disabled', item.disabled || props.disabled),\n]\n\nconst handleSelect = (item: MentionOption) => {\n if (item.disabled || props.disabled) return\n emit('select', item)\n}\n\nconst handleMouseEnter = (index: number) => {\n hoveringIndex.value = index\n}\n\nconst filteredAllDisabled = computed(\n () => props.disabled || props.options.every((item) => item.disabled)\n)\n\nconst hoverOption = computed(() => props.options[hoveringIndex.value])\n\nconst selectHoverOption = () => {\n if (!hoverOption.value) return\n emit('select', hoverOption.value)\n}\n\nconst navigateOptions = (direction: 'next' | 'prev') => {\n const { options } = props\n if (options.length === 0 || filteredAllDisabled.value) return\n\n if (direction === 'next') {\n hoveringIndex.value++\n if (hoveringIndex.value === options.length) {\n hoveringIndex.value = 0\n }\n } else if (direction === 'prev') {\n hoveringIndex.value--\n if (hoveringIndex.value < 0) {\n hoveringIndex.value = options.length - 1\n }\n }\n const option = options[hoveringIndex.value]\n if (option.disabled) {\n navigateOptions(direction)\n return\n }\n nextTick(() => scrollToOption(option))\n}\n\nconst scrollToOption = (option: MentionOption) => {\n const { options } = props\n\n const index = options.findIndex((item) => item.value === option.value)\n const target = optionRefs.value?.[index]\n\n if (target) {\n const menu = dropdownRef.value?.querySelector?.(\n `.${ns.be('dropdown', 'wrap')}`\n )\n if (menu) {\n scrollIntoView(menu as HTMLElement, target)\n }\n }\n scrollbarRef.value?.handleScroll()\n}\n\nconst resetHoveringIndex = () => {\n if (filteredAllDisabled.value || props.options.length === 0) {\n hoveringIndex.value = -1\n } else {\n hoveringIndex.value = 0\n }\n}\n\nwatch(() => props.options, resetHoveringIndex, {\n immediate: true,\n})\n\ndefineExpose({\n hoveringIndex,\n navigateOptions,\n selectHoverOption,\n hoverOption,\n})\n</script>\n"],"names":["useNamespace","useLocale","ref","computed","nextTick","scrollIntoView","watch"],"mappings":";;;;;;;;;;;;;;uCAkDc,CAAA;AAAA,EACZ,IAAM,EAAA,mBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,SAAS,CAAA,CAAA;AACjC,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIC,iBAAU,EAAA,CAAA;AACxB,IAAM,MAAA,aAAA,GAAgBC,QAAI,CAAE,CAAA,CAAA,CAAA;AAE5B,IAAA,MAAM,eAAeA,OAAsC,EAAA,CAAA;AAC3D,IAAA,MAAM,aAAaA,OAAmB,EAAA,CAAA;AACtC,IAAA,MAAM,cAAcA,OAAiB,EAAA,CAAA;AAErC,IAAM,MAAA,SAAA,GAAY,CAAC,IAAA,EAAqB,KAAkB,KAAA;AAAA,MACxD,EAAA,CAAG,EAAG,CAAA,UAAA,EAAY,MAAM,CAAA;AAAA,MACxB,EAAG,CAAA,EAAA,CAAG,UAAY,EAAA,aAAA,CAAc,UAAU,KAAK,CAAA;AAAA,MAC/C,GAAG,EAAG,CAAA,UAAA,EAAY,IAAK,CAAA,QAAA,IAAY,MAAM,QAAQ,CAAA;AAAA,KACnD,CAAA;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KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,YAAA,EAAA,CAAA;AAAA,KACnC,CAAA;AAEA,IAAA,MAAM,qBAAqB,MAAM;AAC/B,MAAA,IAAI,mBAAoB,CAAA,KAAA,IAAS,KAAM,CAAA,OAAA,CAAQ,WAAW,CAAG,EAAA;AAC3D,QAAA,aAAA,CAAc,KAAQ,GAAA,CAAA,CAAA,CAAA;AAAA,OACjB,MAAA;AACL,QAAA,aAAA,CAAc,KAAQ,GAAA,CAAA,CAAA;AAAA,OACxB;AAAA,KACF,CAAA;AAEA,IAAMC,SAAA,CAAA,MAAM,KAAM,CAAA,OAAA,EAAS,kBAAoB,EAAA;AAAA,MAC7C,SAAW,EAAA,IAAA;AAAA,KACZ,CAAA,CAAA;AAED,IAAa,MAAA,CAAA;AAAA,MACX,aAAA;AAAA,MACA,eAAA;AAAA,MACA,iBAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"mention-dropdown2.js","sources":["../../../../../../packages/components/mention/src/mention-dropdown.vue"],"sourcesContent":["<template>\n <div ref=\"dropdownRef\" :class=\"ns.b('dropdown')\">\n <div v-if=\"$slots.header\" :class=\"ns.be('dropdown', 'header')\">\n <slot name=\"header\" />\n </div>\n <el-scrollbar\n v-show=\"options.length > 0 && !loading\"\n :id=\"contentId\"\n ref=\"scrollbarRef\"\n tag=\"ul\"\n :wrap-class=\"ns.be('dropdown', 'wrap')\"\n :view-class=\"ns.be('dropdown', 'list')\"\n role=\"listbox\"\n :aria-label=\"ariaLabel\"\n aria-orientation=\"vertical\"\n >\n <li\n v-for=\"(item, index) in options\"\n :id=\"`${contentId}-${index}`\"\n ref=\"optionRefs\"\n :key=\"index\"\n :class=\"optionkls(item, index)\"\n role=\"option\"\n :aria-disabled=\"item.disabled || disabled || undefined\"\n :aria-selected=\"hoveringIndex === index\"\n @mousemove=\"handleMouseEnter(index)\"\n @click.stop=\"handleSelect(item)\"\n >\n <slot name=\"label\" :item=\"item\" :index=\"index\">\n <span>{{ item.label ?? item.value }}</span>\n </slot>\n </li>\n </el-scrollbar>\n <div v-if=\"loading\" :class=\"ns.be('dropdown', 'loading')\">\n <slot name=\"loading\"> {{ t('el.mention.loading') }} </slot>\n </div>\n <div v-if=\"$slots.footer\" :class=\"ns.be('dropdown', 'footer')\">\n <slot name=\"footer\" />\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { scrollIntoView } from '@element-plus/utils'\nimport ElScrollbar from '@element-plus/components/scrollbar'\nimport { mentionDropdownEmits, mentionDropdownProps } from './mention-dropdown'\n\nimport type { MentionOption } from './types'\n\ndefineOptions({\n name: 'ElMentionDropdown',\n})\n\nconst props = defineProps(mentionDropdownProps)\nconst emit = defineEmits(mentionDropdownEmits)\n\nconst ns = useNamespace('mention')\nconst { t } = useLocale()\nconst hoveringIndex = ref(-1)\n\nconst scrollbarRef = ref<InstanceType<typeof ElScrollbar>>()\nconst optionRefs = ref<HTMLElement[]>()\nconst dropdownRef = ref<HTMLElement>()\n\nconst optionkls = (item: MentionOption, index: number) => [\n ns.be('dropdown', 'item'),\n ns.is('hovering', hoveringIndex.value === index),\n ns.is('disabled', item.disabled || props.disabled),\n]\n\nconst handleSelect = (item: MentionOption) => {\n if (item.disabled || props.disabled) return\n emit('select', item)\n}\n\nconst handleMouseEnter = (index: number) => {\n hoveringIndex.value = index\n}\n\nconst filteredAllDisabled = computed(\n () => props.disabled || props.options.every((item) => item.disabled)\n)\n\nconst hoverOption = computed(() => props.options[hoveringIndex.value])\n\nconst selectHoverOption = () => {\n if (!hoverOption.value) return\n emit('select', hoverOption.value)\n}\n\nconst navigateOptions = (direction: 'next' | 'prev') => {\n const { options } = props\n if (options.length === 0 || filteredAllDisabled.value) return\n\n if (direction === 'next') {\n hoveringIndex.value++\n if (hoveringIndex.value === options.length) {\n hoveringIndex.value = 0\n }\n } else if (direction === 'prev') {\n hoveringIndex.value--\n if (hoveringIndex.value < 0) {\n hoveringIndex.value = options.length - 1\n }\n }\n const option = options[hoveringIndex.value]\n if (option.disabled) {\n navigateOptions(direction)\n return\n }\n nextTick(() => scrollToOption(option))\n}\n\nconst scrollToOption = (option: MentionOption) => {\n const { options } = props\n\n const index = options.findIndex((item) => item.value === option.value)\n const target = optionRefs.value?.[index]\n\n if (target) {\n const menu = dropdownRef.value?.querySelector?.(\n `.${ns.be('dropdown', 'wrap')}`\n )\n if (menu) {\n scrollIntoView(menu as HTMLElement, target)\n }\n }\n scrollbarRef.value?.handleScroll()\n}\n\nconst resetHoveringIndex = () => {\n if (filteredAllDisabled.value || props.options.length === 0) {\n hoveringIndex.value = -1\n } else {\n hoveringIndex.value = 0\n }\n}\n\nwatch(() => props.options, resetHoveringIndex, {\n immediate: true,\n})\n\ndefineExpose({\n hoveringIndex,\n navigateOptions,\n selectHoverOption,\n hoverOption,\n})\n</script>\n"],"names":["useNamespace","useLocale","ref","computed","nextTick","scrollIntoView","watch"],"mappings":";;;;;;;;;;;;;;uCAkDc,CAAA;AAAA,EACZ,IAAM,EAAA,mBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,SAAS,CAAA,CAAA;AACjC,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIC,iBAAU,EAAA,CAAA;AACxB,IAAM,MAAA,aAAA,GAAgBC,QAAI,CAAE,CAAA,CAAA,CAAA;AAE5B,IAAA,MAAM,eAAeA,OAAsC,EAAA,CAAA;AAC3D,IAAA,MAAM,aAAaA,OAAmB,EAAA,CAAA;AACtC,IAAA,MAAM,cAAcA,OAAiB,EAAA,CAAA;AAErC,IAAM,MAAA,SAAA,GAAY,CAAC,IAAA,EAAqB,KAAkB,KAAA;AAAA,MACxD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,CAAA,CAAA,EAAA,EAAA,CAAA,EAAA,CAAA,UAAA,EAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,QAAA,IAAI,IAAM,EAAA;AACR,UAAAC,qBAAA,CAAe,MAAqB,MAAM,CAAA,CAAA;AAAA,SAC5C;AAAA,OACF;AACA,MAAA,CAAA,EAAA,GAAA,kBAAiC,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,YAAA,EAAA,CAAA;AAAA,KACnC,CAAA;AAEA,IAAA,MAAM,qBAAqB,MAAM;AAC/B,MAAA,IAAI,mBAAoB,CAAA,KAAA,IAAS,KAAM,CAAA,OAAA,CAAQ,WAAW,CAAG,EAAA;AAC3D,QAAA,aAAA,CAAc,KAAQ,GAAA,CAAA,CAAA,CAAA;AAAA,OACjB,MAAA;AACL,QAAA,aAAA,CAAc,KAAQ,GAAA,CAAA,CAAA;AAAA,OACxB;AAAA,KACF,CAAA;AAEA,IAAMC,SAAA,CAAA,MAAM,KAAM,CAAA,OAAA,EAAS,kBAAoB,EAAA;AAAA,MAC7C,SAAW,EAAA,IAAA;AAAA,KACZ,CAAA,CAAA;AAED,IAAa,MAAA,CAAA;AAAA,MACX,aAAA;AAAA,MACA,eAAA;AAAA,MACA,iBAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -79,6 +79,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
79
79
  const selectedItemInput = segmentedRef.value.querySelector(".is-selected input");
80
80
  if (!selectedItem || !selectedItemInput) {
81
81
  state.width = 0;
82
+ state.height = 0;
82
83
  state.translateX = 0;
83
84
  state.translateY = 0;
84
85
  state.focusVisible = false;
@@ -1 +1 @@
1
- {"version":3,"file":"segmented2.js","sources":["../../../../../../packages/components/segmented/src/segmented.vue"],"sourcesContent":["<template>\n <div\n v-if=\"options.length\"\n :id=\"inputId\"\n ref=\"segmentedRef\"\n :class=\"segmentedCls\"\n role=\"radiogroup\"\n :aria-label=\"!isLabeledByFormItem ? ariaLabel || 'segmented' : undefined\"\n :aria-labelledby=\"isLabeledByFormItem ? formItem!.labelId : undefined\"\n >\n <div :class=\"[ns.e('group'), ns.m(props.direction)]\">\n <div :style=\"selectedStyle\" :class=\"selectedCls\" />\n <label\n v-for=\"(item, index) in options\"\n :key=\"index\"\n :class=\"getItemCls(item)\"\n >\n <input\n :class=\"ns.e('item-input')\"\n type=\"radio\"\n :name=\"name\"\n :disabled=\"getDisabled(item)\"\n :checked=\"getSelected(item)\"\n @change=\"handleChange(item)\"\n />\n <div :class=\"ns.e('item-label')\">\n <slot :item=\"item\">{{ getLabel(item) }}</slot>\n </div>\n </label>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, reactive, ref, watch } from 'vue'\nimport { useActiveElement, useResizeObserver } from '@vueuse/core'\nimport { useId, useNamespace } from '@element-plus/hooks'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport { debugWarn, isObject } from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { segmentedEmits, segmentedProps } from './segmented'\nimport type { Option } from './types'\n\ndefineOptions({\n name: 'ElSegmented',\n})\n\nconst props = defineProps(segmentedProps)\nconst emit = defineEmits(segmentedEmits)\n\nconst ns = useNamespace('segmented')\nconst segmentedId = useId()\nconst segmentedSize = useFormSize()\nconst _disabled = useFormDisabled()\nconst { formItem } = useFormItem()\nconst { inputId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst segmentedRef = ref<HTMLElement | null>(null)\nconst activeElement = useActiveElement()\n\nconst state = reactive({\n isInit: false,\n width: 0,\n height: 0,\n translateX: 0,\n translateY: 0,\n focusVisible: false,\n})\n\nconst handleChange = (item: Option) => {\n const value = getValue(item)\n emit(UPDATE_MODEL_EVENT, value)\n emit(CHANGE_EVENT, value)\n}\n\nconst getValue = (item: Option) => {\n return isObject(item) ? item.value : item\n}\n\nconst getLabel = (item: Option) => {\n return isObject(item) ? item.label : item\n}\n\nconst getDisabled = (item: Option | undefined) => {\n return !!(_disabled.value || (isObject(item) ? item.disabled : false))\n}\n\nconst getSelected = (item: Option) => {\n return props.modelValue === getValue(item)\n}\n\nconst getOption = (value: any) => {\n return props.options.find((item) => getValue(item) === value)\n}\n\nconst getItemCls = (item: Option) => {\n return [\n ns.e('item'),\n ns.is('selected', getSelected(item)),\n ns.is('disabled', getDisabled(item)),\n ]\n}\n\nconst updateSelect = () => {\n if (!segmentedRef.value) return\n const selectedItem = segmentedRef.value.querySelector(\n '.is-selected'\n ) as HTMLElement\n const selectedItemInput = segmentedRef.value.querySelector(\n '.is-selected input'\n ) as HTMLElement\n if (!selectedItem || !selectedItemInput) {\n state.width = 0\n state.translateX = 0\n state.translateY = 0\n state.focusVisible = false\n return\n }\n const rect = selectedItem.getBoundingClientRect()\n state.isInit = true\n if (props.direction === 'vertical') {\n state.height = rect.height\n state.translateY = selectedItem.offsetTop\n } else {\n state.width = rect.width\n state.translateX = selectedItem.offsetLeft\n }\n try {\n // This will failed in test\n state.focusVisible = selectedItemInput.matches(':focus-visible')\n } catch {}\n}\n\nconst segmentedCls = computed(() => [\n ns.b(),\n ns.m(segmentedSize.value),\n ns.is('block', props.block),\n])\n\nconst selectedStyle = computed(() => ({\n width: props.direction === 'vertical' ? '100%' : `${state.width}px`,\n height: props.direction === 'vertical' ? `${state.height}px` : '100%',\n transform:\n props.direction === 'vertical'\n ? `translateY(${state.translateY}px)`\n : `translateX(${state.translateX}px)`,\n display: state.isInit ? 'block' : 'none',\n}))\n\nconst selectedCls = computed(() => [\n ns.e('item-selected'),\n ns.is('disabled', getDisabled(getOption(props.modelValue))),\n ns.is('focus-visible', state.focusVisible),\n])\n\nconst name = computed(() => {\n return props.name || segmentedId.value\n})\n\nuseResizeObserver(segmentedRef, updateSelect)\n\nwatch(activeElement, updateSelect)\n\nwatch(\n () => props.modelValue,\n () => {\n updateSelect()\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n },\n {\n flush: 'post',\n }\n)\n</script>\n"],"names":["useNamespace","useId","useFormSize","useFormDisabled","useFormItem","useFormItemInputId","ref","useActiveElement","reactive","UPDATE_MODEL_EVENT","CHANGE_EVENT","isObject","computed","useResizeObserver","watch","debugWarn","_openBlock","_createElementBlock","_unref"],"mappings":";;;;;;;;;;;;;;;;;;;;uCAgDc,CAAA;AAAA,EACZ,IAAM,EAAA,aAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,WAAW,CAAA,CAAA;AACnC,IAAA,MAAM,cAAcC,aAAM,EAAA,CAAA;AAC1B,IAAA,MAAM,gBAAgBC,8BAAY,EAAA,CAAA;AAClC,IAAA,MAAM,YAAYC,kCAAgB,EAAA,CAAA;AAClC,IAAM,MAAA,EAAE,QAAS,EAAA,GAAIC,uBAAY,EAAA,CAAA;AACjC,IAAA,MAAM,EAAE,OAAA,EAAS,mBAAoB,EAAA,GAAIC,+BAAmB,KAAO,EAAA;AAAA,MACjE,eAAiB,EAAA,QAAA;AAAA,KAClB,CAAA,CAAA;AAED,IAAM,MAAA,YAAA,GAAeC,QAAwB,IAAI,CAAA,CAAA;AACjD,IAAA,MAAM,gBAAgBC,qBAAiB,EAAA,CAAA;AAEvC,IAAA,MAAM,QAAQC,YAAS,CAAA;AAAA,MACrB,MAAQ,EAAA,KAAA;AAAA,MACR,KAAO,EAAA,CAAA;AAAA,MACP,MAAQ,EAAA,CAAA;AAAA,MACR,UAAY,EAAA,CAAA;AAAA,MACZ,UAAY,EAAA,CAAA;AAAA,MACZ,YAAc,EAAA,KAAA;AAAA,KACf,CAAA,CAAA;AAED,IAAM,MAAA,YAAA,GAAe,CAAC,IAAiB,KAAA;AACrC,M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,MAAA;AAED,MAAA,IAAA,EAAA,CAAA;AAEA,MAAA;AAEA,MAAA,IAAA,KAAA,CAAA,aAAA,EAAA;AAAA,cACc,QAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,QAAA,CAAA,QAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,QAAA,EAAA,QAAA,CAAA,CAAA,KAAA,CAAA,CAAA,GAAA,KAAAC,eAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AAAA,OACN;AACJ,KAAa,EAAA;AACb,MAAA,KAAA,QAAyB;AACvB,KAAU,CAAA,CAAA;AAAkD,IAC9D,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACF,OAAA,IAAA,CAAA,OAAA,CAAA,MAAA,IAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,KAAA,EAAA;AAAA,QACA,GAAA,EAAA,CAAA;AAAA,QACE,EAAO,EAAAC,SAAA,CAAA,OAAA,CAAA;AAAA,QACT,OAAA,EAAA,cAAA;AAAA,QACF,GAAA,EAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"segmented2.js","sources":["../../../../../../packages/components/segmented/src/segmented.vue"],"sourcesContent":["<template>\n <div\n v-if=\"options.length\"\n :id=\"inputId\"\n ref=\"segmentedRef\"\n :class=\"segmentedCls\"\n role=\"radiogroup\"\n :aria-label=\"!isLabeledByFormItem ? ariaLabel || 'segmented' : undefined\"\n :aria-labelledby=\"isLabeledByFormItem ? formItem!.labelId : undefined\"\n >\n <div :class=\"[ns.e('group'), ns.m(props.direction)]\">\n <div :style=\"selectedStyle\" :class=\"selectedCls\" />\n <label\n v-for=\"(item, index) in options\"\n :key=\"index\"\n :class=\"getItemCls(item)\"\n >\n <input\n :class=\"ns.e('item-input')\"\n type=\"radio\"\n :name=\"name\"\n :disabled=\"getDisabled(item)\"\n :checked=\"getSelected(item)\"\n @change=\"handleChange(item)\"\n />\n <div :class=\"ns.e('item-label')\">\n <slot :item=\"item\">{{ getLabel(item) }}</slot>\n </div>\n </label>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, reactive, ref, watch } from 'vue'\nimport { useActiveElement, useResizeObserver } from '@vueuse/core'\nimport { useId, useNamespace } from '@element-plus/hooks'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@element-plus/components/form'\nimport { debugWarn, isObject } from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { segmentedEmits, segmentedProps } from './segmented'\nimport type { Option } from './types'\n\ndefineOptions({\n name: 'ElSegmented',\n})\n\nconst props = defineProps(segmentedProps)\nconst emit = defineEmits(segmentedEmits)\n\nconst ns = useNamespace('segmented')\nconst segmentedId = useId()\nconst segmentedSize = useFormSize()\nconst _disabled = useFormDisabled()\nconst { formItem } = useFormItem()\nconst { inputId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst segmentedRef = ref<HTMLElement | null>(null)\nconst activeElement = useActiveElement()\n\nconst state = reactive({\n isInit: false,\n width: 0,\n height: 0,\n translateX: 0,\n translateY: 0,\n focusVisible: false,\n})\n\nconst handleChange = (item: Option) => {\n const value = getValue(item)\n emit(UPDATE_MODEL_EVENT, value)\n emit(CHANGE_EVENT, value)\n}\n\nconst getValue = (item: Option) => {\n return isObject(item) ? item.value : item\n}\n\nconst getLabel = (item: Option) => {\n return isObject(item) ? item.label : item\n}\n\nconst getDisabled = (item: Option | undefined) => {\n return !!(_disabled.value || (isObject(item) ? item.disabled : false))\n}\n\nconst getSelected = (item: Option) => {\n return props.modelValue === getValue(item)\n}\n\nconst getOption = (value: any) => {\n return props.options.find((item) => getValue(item) === value)\n}\n\nconst getItemCls = (item: Option) => {\n return [\n ns.e('item'),\n ns.is('selected', getSelected(item)),\n ns.is('disabled', getDisabled(item)),\n ]\n}\n\nconst updateSelect = () => {\n if (!segmentedRef.value) return\n const selectedItem = segmentedRef.value.querySelector(\n '.is-selected'\n ) as HTMLElement\n const selectedItemInput = segmentedRef.value.querySelector(\n '.is-selected input'\n ) as HTMLElement\n if (!selectedItem || !selectedItemInput) {\n state.width = 0\n state.height = 0\n state.translateX = 0\n state.translateY = 0\n state.focusVisible = false\n return\n }\n const rect = selectedItem.getBoundingClientRect()\n state.isInit = true\n if (props.direction === 'vertical') {\n state.height = rect.height\n state.translateY = selectedItem.offsetTop\n } else {\n state.width = rect.width\n state.translateX = selectedItem.offsetLeft\n }\n try {\n // This will failed in test\n state.focusVisible = selectedItemInput.matches(':focus-visible')\n } catch {}\n}\n\nconst segmentedCls = computed(() => [\n ns.b(),\n ns.m(segmentedSize.value),\n ns.is('block', props.block),\n])\n\nconst selectedStyle = computed(() => ({\n width: props.direction === 'vertical' ? '100%' : `${state.width}px`,\n height: props.direction === 'vertical' ? `${state.height}px` : '100%',\n transform:\n props.direction === 'vertical'\n ? `translateY(${state.translateY}px)`\n : `translateX(${state.translateX}px)`,\n display: state.isInit ? 'block' : 'none',\n}))\n\nconst selectedCls = computed(() => [\n ns.e('item-selected'),\n ns.is('disabled', getDisabled(getOption(props.modelValue))),\n ns.is('focus-visible', state.focusVisible),\n])\n\nconst name = computed(() => {\n return props.name || segmentedId.value\n})\n\nuseResizeObserver(segmentedRef, updateSelect)\n\nwatch(activeElement, updateSelect)\n\nwatch(\n () => props.modelValue,\n () => {\n updateSelect()\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n },\n {\n flush: 'post',\n }\n)\n</script>\n"],"names":["useNamespace","useId","useFormSize","useFormDisabled","useFormItem","useFormItemInputId","ref","useActiveElement","reactive","UPDATE_MODEL_EVENT","CHANGE_EVENT","isObject","computed","useResizeObserver","watch","debugWarn","_openBlock","_createElementBlock","_unref"],"mappings":";;;;;;;;;;;;;;;;;;;;uCAgDc,CAAA;AAAA,EACZ,IAAM,EAAA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KAAA,QAAyB;AACvB,KAAU,CAAA,CAAA;AAAkD,IAC9D,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MACF,OAAA,IAAA,CAAA,OAAA,CAAA,MAAA,IAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,KAAA,EAAA;AAAA,QACA,GAAA,EAAA,CAAA;AAAA,QACE,EAAO,EAAAC,SAAA,CAAA,OAAA,CAAA;AAAA,QACT,OAAA,EAAA,cAAA;AAAA,QACF,GAAA,EAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -90,13 +90,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
90
90
  role: "option",
91
91
  "aria-disabled": _ctx.isDisabled || void 0,
92
92
  "aria-selected": _ctx.itemSelected,
93
- onMouseenter: _ctx.hoverItem,
93
+ onMousemove: _ctx.hoverItem,
94
94
  onClick: vue.withModifiers(_ctx.selectOptionClick, ["stop"])
95
95
  }, [
96
96
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
97
97
  vue.createElementVNode("span", null, vue.toDisplayString(_ctx.currentLabel), 1)
98
98
  ])
99
- ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [
99
+ ], 42, ["id", "aria-disabled", "aria-selected", "onMousemove", "onClick"])), [
100
100
  [vue.vShow, _ctx.visible]
101
101
  ]);
102
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"option.js","sources":["../../../../../../packages/components/select/src/option.vue"],"sourcesContent":["<template>\n <li\n v-show=\"visible\"\n :id=\"id\"\n :class=\"containerKls\"\n role=\"option\"\n :aria-disabled=\"isDisabled || undefined\"\n :aria-selected=\"itemSelected\"\n @mouseenter=\"hoverItem\"\n @click.stop=\"selectOptionClick\"\n >\n <slot>\n <span>{{ currentLabel }}</span>\n </slot>\n </li>\n</template>\n\n<script lang=\"ts\">\n// @ts-nocheck\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n nextTick,\n onBeforeUnmount,\n reactive,\n toRefs,\n unref,\n} from 'vue'\nimport { useId, useNamespace } from '@element-plus/hooks'\nimport { useOption } from './useOption'\nimport type { SelectOptionProxy } from './token'\n\nexport default defineComponent({\n name: 'ElOption',\n componentName: 'ElOption',\n\n props: {\n /**\n * @description value of option\n */\n value: {\n required: true,\n type: [String, Number, Boolean, Object],\n },\n /**\n * @description label of option, same as `value` if omitted\n */\n label: [String, Number],\n created: Boolean,\n /**\n * @description whether option is disabled\n */\n disabled: Boolean,\n },\n\n setup(props) {\n const ns = useNamespace('select')\n const id = useId()\n\n const containerKls = computed(() => [\n ns.be('dropdown', 'item'),\n ns.is('disabled', unref(isDisabled)),\n ns.is('selected', unref(itemSelected)),\n ns.is('hovering', unref(hover)),\n ])\n\n const states = reactive({\n index: -1,\n groupDisabled: false,\n visible: true,\n hover: false,\n })\n\n const {\n currentLabel,\n itemSelected,\n isDisabled,\n select,\n hoverItem,\n updateOption,\n } = useOption(props, states)\n\n const { visible, hover } = toRefs(states)\n\n const vm = getCurrentInstance().proxy as unknown as SelectOptionProxy\n\n select.onOptionCreate(vm)\n\n onBeforeUnmount(() => {\n const key = vm.value\n const { selected } = select.states\n const selectedOptions = select.props.multiple ? selected : [selected]\n const doesSelected = selectedOptions.some((item) => {\n return item.value === vm.value\n })\n // if option is not selected, remove it from cache\n nextTick(() => {\n if (select.states.cachedOptions.get(key) === vm && !doesSelected) {\n select.states.cachedOptions.delete(key)\n }\n })\n select.onOptionDestroy(key, vm)\n })\n\n function selectOptionClick() {\n if (!isDisabled.value) {\n select.handleOptionSelect(vm)\n }\n }\n\n return {\n ns,\n id,\n containerKls,\n currentLabel,\n itemSelected,\n isDisabled,\n select,\n hoverItem,\n updateOption,\n visible,\n hover,\n selectOptionClick,\n states,\n }\n },\n})\n</script>\n"],"names":["defineComponent","useNamespace","useId","computed","unref","reactive","useOption","toRefs","getCurrentInstance","onBeforeUnmount","nextTick","_withDirectives","_openBlock","_createElementBlock","_normalizeClass","_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B,MAC/B,YAAA;AAED,MAAA,YAA6B;AAC3B,MAAI;AACF,MAAA;AAA4B,MAC9B,MAAA;AAAA,MACF,SAAA;AAEA,MAAO,YAAA;AAAA,MACL,OAAA;AAAA,MACA,KAAA;AAAA,MACA,iBAAA;AAAA,MACA,MAAA;AAAA,KACA,CAAA;AAAA,GACA;AAAA,CACA,CAAA,CAAA;AACA,SACA,WAAA,CAAA,IAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,QAAA,EAAA;AAAA,EACA,OAAAC,kBAAA,EAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,IAAA,EAAA;AAAA,IACA,EAAA,EAAA,IAAA,CAAA,EAAA;AAAA,IACA,KAAA,EAAAC,kBAAA,CAAA,IAAA,CAAA,YAAA,CAAA;AAAA,IACA,IAAA,EAAA,QAAA;AAAA,IACF,eAAA,EAAA,IAAA,CAAA,UAAA,IAAA,KAAA,CAAA;AAAA,IACF,eAAA,EAAA,IAAA,CAAA,YAAA;AACF,IAAC,YAAA,EAAA,IAAA,CAAA,SAAA;;;2CA9HC,EAaK,EAAA,MAAA;AAAA,MAXEC,sBAAA,CAAA,MAAA,EAAA,IAAA,EAAAC,mBAAA,CAAA,IAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAAA,KACJ,CAAA;AAAmB,GAAA,EACf,EAAA,EAAA,CAAA,IAAA,EAAA,eAAA,EAAA,eAAA,EAAA,cAAA,EAAA,SAAA,CAAA,CAAA,GAAA;AAAA,IACJ,wBAA6B,CAAA;AAAA,GAAA,CAC7B,CAAe;AAAA,CAAA;AAEc,aAAA,gBAAAC,iCAAA,CAAA,SAAA,EAAA,CAAA,CAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,QAAA,EAAA,YAAA,CAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"option.js","sources":["../../../../../../packages/components/select/src/option.vue"],"sourcesContent":["<template>\n <li\n v-show=\"visible\"\n :id=\"id\"\n :class=\"containerKls\"\n role=\"option\"\n :aria-disabled=\"isDisabled || undefined\"\n :aria-selected=\"itemSelected\"\n @mousemove=\"hoverItem\"\n @click.stop=\"selectOptionClick\"\n >\n <slot>\n <span>{{ currentLabel }}</span>\n </slot>\n </li>\n</template>\n\n<script lang=\"ts\">\n// @ts-nocheck\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n nextTick,\n onBeforeUnmount,\n reactive,\n toRefs,\n unref,\n} from 'vue'\nimport { useId, useNamespace } from '@element-plus/hooks'\nimport { useOption } from './useOption'\nimport type { SelectOptionProxy } from './token'\n\nexport default defineComponent({\n name: 'ElOption',\n componentName: 'ElOption',\n\n props: {\n /**\n * @description value of option\n */\n value: {\n required: true,\n type: [String, Number, Boolean, Object],\n },\n /**\n * @description label of option, same as `value` if omitted\n */\n label: [String, Number],\n created: Boolean,\n /**\n * @description whether option is disabled\n */\n disabled: Boolean,\n },\n\n setup(props) {\n const ns = useNamespace('select')\n const id = useId()\n\n const containerKls = computed(() => [\n ns.be('dropdown', 'item'),\n ns.is('disabled', unref(isDisabled)),\n ns.is('selected', unref(itemSelected)),\n ns.is('hovering', unref(hover)),\n ])\n\n const states = reactive({\n index: -1,\n groupDisabled: false,\n visible: true,\n hover: false,\n })\n\n const {\n currentLabel,\n itemSelected,\n isDisabled,\n select,\n hoverItem,\n updateOption,\n } = useOption(props, states)\n\n const { visible, hover } = toRefs(states)\n\n const vm = getCurrentInstance().proxy as unknown as SelectOptionProxy\n\n select.onOptionCreate(vm)\n\n onBeforeUnmount(() => {\n const key = vm.value\n const { selected } = select.states\n const selectedOptions = select.props.multiple ? selected : [selected]\n const doesSelected = selectedOptions.some((item) => {\n return item.value === vm.value\n })\n // if option is not selected, remove it from cache\n nextTick(() => {\n if (select.states.cachedOptions.get(key) === vm && !doesSelected) {\n select.states.cachedOptions.delete(key)\n }\n })\n select.onOptionDestroy(key, vm)\n })\n\n function selectOptionClick() {\n if (!isDisabled.value) {\n select.handleOptionSelect(vm)\n }\n }\n\n return {\n ns,\n id,\n containerKls,\n currentLabel,\n itemSelected,\n isDisabled,\n select,\n hoverItem,\n updateOption,\n visible,\n hover,\n selectOptionClick,\n states,\n }\n },\n})\n</script>\n"],"names":["defineComponent","useNamespace","useId","computed","unref","reactive","useOption","toRefs","getCurrentInstance","onBeforeUnmount","nextTick","_withDirectives","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_toDisplayString","_export_sfc"],"mappings":";;;;;;;;;;;AAiCA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,UAAA;AAAA,EACN,aAAe,EAAA,UAAA;AAAA,EAEf,KAAO,EAAA;AAAA,IAAA,KAAA,EAAA;AAAA,MAAA,QAAA,EAAA,IAAA;AAAA,MAAA,IAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAAA,KAIE;AAAA,IAAA,KACK,EAAA,CAAA,MAAA,EAAA,MAAA,CAAA;AAAA,IAAA,OACJ,EAAC,OAAQ;AAAuB,IACxC,QAAA,EAAA,OAAA;AAAA,GAAA;AAAA,EAAA,KAAA,CAAA,KAAA,EAAA;AAAA,IAAA,MAAA,EAAA,GAAAC,kBAAA,CAAA,QAAA,CAAA,CAAA;AAAA,IAIA,MAAA,EAAQ,GAAAC,aAAQ,EAAM,CAAA;AAAA,IACtB,MAAS,YAAA,GAAAC,YAAA,CAAA,MAAA;AAAA,MAAA,EAAA,CAAA,EAAA,CAAA,UAAA,EAAA,MAAA,CAAA;AAAA,MAAA,EAAA,CAAA,EAAA,CAAA,UAAA,EAAAC,SAAA,CAAA,UAAA,CAAA,CAAA;AAAA,MAAA,EAAA,CAAA,EAAA,CAAA,UAAA,EAAAA,SAAA,CAAA,YAAA,CAAA,CAAA;AAAA,MAIC,EAAA,CAAA,EAAA,CAAA,UAAA,EAAAA,SAAA,CAAA,KAAA,CAAA,CAAA;AAAA,KACZ,CAAA,CAAA;AAAA,UAEa,MAAA,GAAAC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CAAe;AAAA,CAAA;AAEc,aAAA,gBAAAC,iCAAA,CAAA,SAAA,EAAA,CAAA,CAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,QAAA,EAAA,YAAA,CAAA,CAAA,CAAA;;;;"}
@@ -38,7 +38,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
38
38
  _ctx.ns.is("created", _ctx.created),
39
39
  _ctx.ns.is("hovering", _ctx.hovering)
40
40
  ]),
41
- onMouseenter: _ctx.hoverItem,
41
+ onMousemove: _ctx.hoverItem,
42
42
  onClick: vue.withModifiers(_ctx.selectOptionClick, ["stop"])
43
43
  }, [
44
44
  vue.renderSlot(_ctx.$slots, "default", {
@@ -48,7 +48,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
48
48
  }, () => [
49
49
  vue.createElementVNode("span", null, vue.toDisplayString(_ctx.getLabel(_ctx.item)), 1)
50
50
  ])
51
- ], 46, ["aria-selected", "onMouseenter", "onClick"]);
51
+ ], 46, ["aria-selected", "onMousemove", "onClick"]);
52
52
  }
53
53
  var OptionItem = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "option-item.vue"]]);
54
54
 
@@ -1 +1 @@
1
- {"version":3,"file":"option-item.js","sources":["../../../../../../packages/components/select-v2/src/option-item.vue"],"sourcesContent":["<template>\n <li\n :aria-selected=\"selected\"\n :style=\"style\"\n :class=\"[\n ns.be('dropdown', 'item'),\n ns.is('selected', selected),\n ns.is('disabled', disabled),\n ns.is('created', created),\n ns.is('hovering', hovering),\n ]\"\n @mouseenter=\"hoverItem\"\n @click.stop=\"selectOptionClick\"\n >\n <slot :item=\"item\" :index=\"index\" :disabled=\"disabled\">\n <span>{{ getLabel(item) }}</span>\n </slot>\n </li>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, inject } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useOption } from './useOption'\nimport { useProps } from './useProps'\nimport { OptionProps, optionEmits } from './defaults'\nimport { selectV2InjectionKey } from './token'\n\nexport default defineComponent({\n props: OptionProps,\n emits: optionEmits,\n setup(props, { emit }) {\n const select = inject(selectV2InjectionKey)!\n const ns = useNamespace('select')\n const { hoverItem, selectOptionClick } = useOption(props, { emit })\n const { getLabel } = useProps(select.props)\n\n return {\n ns,\n hoverItem,\n selectOptionClick,\n getLabel,\n }\n },\n})\n</script>\n"],"names":["defineComponent","OptionProps","optionEmits","inject","selectV2InjectionKey","useNamespace","useOption","useProps","_createElementBlock","_normalizeStyle","_normalizeClass","_withModifiers","_renderSlot","_createElementVNode","_toDisplayString","_export_sfc"],"mappings":";;;;;;;;;;;;;AA4BA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,KAAO,EAAAC,oBAAA;AAAA,EACP,KAAO,EAAAC,oBAAA;AAAA,EACP,KAAM,CAAA,KAAA,EAAO,EAAE,IAAA,EAAQ,EAAA;AACrB,IAAM,MAAA,MAAA,GAASC,WAAOC,0BAAoB,CAAA,CAAA;AAC1C,IAAM,MAAA,EAAA,GAAKC,mBAAa,QAAQ,CAAA,CAAA;AAChC,IAAM,MAAA,EAAE,WAAW,iBAAkB,EAAA,GAAIC,oBAAU,KAAO,EAAA,EAAE,MAAM,CAAA,CAAA;AAClE,IAAA,MAAM,EAAE,QAAA,EAAa,GAAAC,iBAAA,CAAS,OAAO,KAAK,CAAA,CAAA;AAE1C,IAAO,OAAA;AAAA,MACL,EAAA;AAAA,MACA,SAAA;AAAA,MACA,iBAAA;AAAA,MACA,QAAA;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAC,CAAA,CAAA;;0BA3CCC,sBAgBK,CAAA,IAAA,EAAA;AAAA,IAfF,eAAe,EAAA,IAAA,CAAA,QAAA;AAAA,IACf,KAAA,EAAKC,mBAAE,IAAK,CAAA,KAAA,CAAA;AAAA,IACZ,KAAK,EAAAC,kBAAA,CAAA;AAAA,MAAU,QAAG,EAAE,CAAA,UAAA,EAAA,MAAA,CAAA;AAAA,MAA4B,IAAA,CAAA,EAAA,CAAG,EAAE,CAAA,UAAA,EAAa,IAAQ,CAAA,QAAA,CAAA;AAAA,MAAS,IAAA,CAAA,EAAA,CAAG,EAAE,CAAA,UAAA,EAAa,IAAQ,CAAA,QAAA,CAAA;AAAA,MAAS,IAAA,CAAA,EAAA,CAAG,EAAE,CAAA,SAAA,EAAY,IAAO,CAAA,OAAA,CAAA;AAAA,MAAS,IAAA,CAAA,EAAA,CAAG,EAAE,CAAA,UAAA,EAAa,IAAQ,CAAA,QAAA,CAAA;AAAA,KAAA,CAAA;IAOjL,YAAY,EAAA,IAAA,CAAA,SAAA;AAAA,IACZ,OAAA,EAAKC,kBAAO,IAAiB,CAAA,iBAAA,EAAA,CAAA,MAAA,CAAA,CAAA;AAAA,GAAA,EAAA;IAE9BC,cAEO,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA;AAAA,MAFA,IAAM,EAAA,IAAA,CAAA,IAAA;AAAA,MAAO,KAAO,EAAA,IAAA,CAAA,KAAA;AAAA,MAAQ,QAAU,EAAA,IAAA,CAAA,QAAA;AAAA,KAAA,EAA7C,MAEO;AAAA,MADLC,sBAAA,CAAA,MAAA,EAAA,IAAA,EAAAC,mBAAA,CAAA,IAAA,CAAA,QAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AAAA,KAAiC,CAAA;AAAA,GAAA,EAAA,EAAA,EAAA,CAAA,eAAA,EAAA,cAAA,EAAA,SAAA,CAAA,CAAA,CAAA;AAAA,CAAA;AAAX,iBAAA,gBAAAC,iCAAA,CAAA,SAAA,EAAA,CAAA,CAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,QAAA,EAAA,iBAAA,CAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"option-item.js","sources":["../../../../../../packages/components/select-v2/src/option-item.vue"],"sourcesContent":["<template>\n <li\n :aria-selected=\"selected\"\n :style=\"style\"\n :class=\"[\n ns.be('dropdown', 'item'),\n ns.is('selected', selected),\n ns.is('disabled', disabled),\n ns.is('created', created),\n ns.is('hovering', hovering),\n ]\"\n @mousemove=\"hoverItem\"\n @click.stop=\"selectOptionClick\"\n >\n <slot :item=\"item\" :index=\"index\" :disabled=\"disabled\">\n <span>{{ getLabel(item) }}</span>\n </slot>\n </li>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, inject } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useOption } from './useOption'\nimport { useProps } from './useProps'\nimport { OptionProps, optionEmits } from './defaults'\nimport { selectV2InjectionKey } from './token'\n\nexport default defineComponent({\n props: OptionProps,\n emits: optionEmits,\n setup(props, { emit }) {\n const select = inject(selectV2InjectionKey)!\n const ns = useNamespace('select')\n const { hoverItem, selectOptionClick } = useOption(props, { emit })\n const { getLabel } = useProps(select.props)\n\n return {\n ns,\n hoverItem,\n selectOptionClick,\n getLabel,\n }\n },\n})\n</script>\n"],"names":["defineComponent","OptionProps","optionEmits","inject","selectV2InjectionKey","useNamespace","useOption","useProps","_createElementBlock","_normalizeStyle","_normalizeClass","_withModifiers","_renderSlot","_createElementVNode","_toDisplayString","_export_sfc"],"mappings":";;;;;;;;;;;;;AA4BA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,KAAO,EAAAC,oBAAA;AAAA,EACP,KAAO,EAAAC,oBAAA;AAAA,EACP,KAAM,CAAA,KAAA,EAAO,EAAE,IAAA,EAAQ,EAAA;AACrB,IAAM,MAAA,MAAA,GAASC,WAAOC,0BAAoB,CAAA,CAAA;AAC1C,IAAM,MAAA,EAAA,GAAKC,mBAAa,QAAQ,CAAA,CAAA;AAChC,IAAM,MAAA,EAAE,WAAW,iBAAkB,EAAA,GAAIC,oBAAU,KAAO,EAAA,EAAE,MAAM,CAAA,CAAA;AAClE,IAAA,MAAM,EAAE,QAAA,EAAa,GAAAC,iBAAA,CAAS,OAAO,KAAK,CAAA,CAAA;AAE1C,IAAO,OAAA;AAAA,MACL,EAAA;AAAA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A,aAAA,EAAA,SAAA,CAAA,CAAA,CAAA;AAAA,CAAA;AAAX,iBAAA,gBAAAC,iCAAA,CAAA,SAAA,EAAA,CAAA,CAAA,QAAA,EAAA,WAAA,CAAA,EAAA,CAAA,QAAA,EAAA,iBAAA,CAAA,CAAA,CAAA;;;;"}
@@ -1,12 +1,21 @@
1
1
  import type Skeleton from './skeleton.vue';
2
2
  import type { ExtractPropTypes } from 'vue';
3
+ import type { ThrottleType } from '@element-plus/nightly/es/hooks';
3
4
  export declare const skeletonProps: {
4
5
  readonly animated: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
5
6
  readonly count: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 1, boolean>;
6
7
  readonly rows: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3, boolean>;
7
8
  readonly loading: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
8
9
  readonly throttle: {
9
- readonly type: import("vue").PropType<number>;
10
+ readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => number | {
11
+ leading?: number;
12
+ trailing?: number;
13
+ initVal?: boolean;
14
+ }) | (() => ThrottleType) | ((new (...args: any[]) => number | {
15
+ leading?: number;
16
+ trailing?: number;
17
+ initVal?: boolean;
18
+ }) | (() => ThrottleType))[], unknown, unknown>>;
10
19
  readonly required: false;
11
20
  readonly validator: ((val: unknown) => boolean) | undefined;
12
21
  __epPropKey: true;
@@ -23,7 +23,7 @@ const skeletonProps = runtime.buildProps({
23
23
  default: true
24
24
  },
25
25
  throttle: {
26
- type: Number
26
+ type: runtime.definePropType([Number, Object])
27
27
  }
28
28
  });
29
29
 
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton.js","sources":["../../../../../../packages/components/skeleton/src/skeleton.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type Skeleton from './skeleton.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const skeletonProps = buildProps({\n /**\n * @description whether showing the animation\n */\n animated: {\n type: Boolean,\n default: false,\n },\n /**\n * @description how many fake items to render to the DOM\n */\n count: {\n type: Number,\n default: 1,\n },\n /**\n * @description whether showing the real DOM\n */\n rows: {\n type: Number,\n default: 3,\n },\n /**\n * @description numbers of the row, only useful when no template slot were given\n */\n loading: {\n type: Boolean,\n default: true,\n },\n /**\n * @description rendering delay in milliseconds\n */\n throttle: {\n type: Number,\n },\n} as const)\nexport type SkeletonProps = ExtractPropTypes<typeof skeletonProps>\n\nexport type SkeletonInstance = InstanceType<typeof Skeleton>\n"],"names":["buildProps"],"mappings":";;;;;;;AACY,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"skeleton.js","sources":["../../../../../../packages/components/skeleton/src/skeleton.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type Skeleton from './skeleton.vue'\nimport type { ExtractPropTypes } from 'vue'\nimport type { ThrottleType } from '@element-plus/hooks'\n\nexport const skeletonProps = buildProps({\n /**\n * @description whether showing the animation\n */\n animated: {\n type: Boolean,\n default: false,\n },\n /**\n * @description how many fake items to render to the DOM\n */\n count: {\n type: Number,\n default: 1,\n },\n /**\n * @description whether showing the real DOM\n */\n rows: {\n type: Number,\n default: 3,\n },\n /**\n * @description numbers of the row, only useful when no template slot were given\n */\n loading: {\n type: Boolean,\n default: true,\n },\n /**\n * @description rendering delay in milliseconds\n */\n throttle: {\n type: definePropType<ThrottleType>([Number, Object]),\n },\n} as const)\nexport type SkeletonProps = ExtractPropTypes<typeof skeletonProps>\n\nexport type SkeletonInstance = InstanceType<typeof Skeleton>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;;AACY,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,CAAC;;;;"}
@@ -12,7 +12,15 @@ declare const __VLS_component: import("vue").DefineComponent<{
12
12
  readonly rows: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3, boolean>;
13
13
  readonly loading: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
14
14
  readonly throttle: {
15
- readonly type: import("vue").PropType<number>;
15
+ readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => number | {
16
+ leading?: number;
17
+ trailing?: number;
18
+ initVal?: boolean;
19
+ }) | (() => import("@element-plus/nightly/es/hooks").ThrottleType) | ((new (...args: any[]) => number | {
20
+ leading?: number;
21
+ trailing?: number;
22
+ initVal?: boolean;
23
+ }) | (() => import("@element-plus/nightly/es/hooks").ThrottleType))[], unknown, unknown>>;
16
24
  readonly required: false;
17
25
  readonly validator: ((val: unknown) => boolean) | undefined;
18
26
  __epPropKey: true;
@@ -26,7 +34,15 @@ declare const __VLS_component: import("vue").DefineComponent<{
26
34
  readonly rows: import("@element-plus/nightly/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 3, boolean>;
27
35
  readonly loading: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
28
36
  readonly throttle: {
29
- readonly type: import("vue").PropType<number>;
37
+ readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => number | {
38
+ leading?: number;
39
+ trailing?: number;
40
+ initVal?: boolean;
41
+ }) | (() => import("@element-plus/nightly/es/hooks").ThrottleType) | ((new (...args: any[]) => number | {
42
+ leading?: number;
43
+ trailing?: number;
44
+ initVal?: boolean;
45
+ }) | (() => import("@element-plus/nightly/es/hooks").ThrottleType))[], unknown, unknown>>;
30
46
  readonly required: false;
31
47
  readonly validator: ((val: unknown) => boolean) | undefined;
32
48
  __epPropKey: true;
@@ -30,7 +30,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
30
30
  }, _ctx.$attrs), [
31
31
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.count, (i) => {
32
32
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: i }, [
33
- _ctx.loading ? vue.renderSlot(_ctx.$slots, "template", { key: i }, () => [
33
+ vue.unref(uiLoading) ? vue.renderSlot(_ctx.$slots, "template", { key: i }, () => [
34
34
  vue.createVNode(skeletonItem["default"], {
35
35
  class: vue.normalizeClass(vue.unref(ns).is("first")),
36
36
  variant: "p"
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton2.js","sources":["../../../../../../packages/components/skeleton/src/skeleton.vue"],"sourcesContent":["<template>\n <template v-if=\"uiLoading\">\n <div :class=\"[ns.b(), ns.is('animated', animated)]\" v-bind=\"$attrs\">\n <template v-for=\"i in count\" :key=\"i\">\n <slot v-if=\"loading\" :key=\"i\" name=\"template\">\n <el-skeleton-item :class=\"ns.is('first')\" variant=\"p\" />\n <el-skeleton-item\n v-for=\"item in rows\"\n :key=\"item\"\n :class=\"[\n ns.e('paragraph'),\n ns.is('last', item === rows && rows > 1),\n ]\"\n variant=\"p\"\n />\n </slot>\n </template>\n </div>\n </template>\n <template v-else>\n <slot v-bind=\"$attrs\" />\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { toRef } from 'vue'\nimport { useNamespace, useThrottleRender } from '@element-plus/hooks'\nimport { skeletonProps } from './skeleton'\nimport ElSkeletonItem from './skeleton-item.vue'\n\ndefineOptions({\n name: 'ElSkeleton',\n})\nconst props = defineProps(skeletonProps)\n\nconst ns = useNamespace('skeleton')\nconst uiLoading = useThrottleRender(toRef(props, 'loading'), props.throttle)\n\ndefineExpose({\n /** @description loading state */\n uiLoading,\n})\n</script>\n"],"names":["useNamespace","useThrottleRender","toRef"],"mappings":";;;;;;;;;;;;uCA8Bc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAGA,IAAM,MAAA,EAAA,GAAKA,mBAAa,UAAU,CAAA,CAAA;AAClC,IAAA,MAAM,YAAYC,yBAAkB,CAAAC,SAAA,CAAM,OAAO,SAAS,CAAA,EAAG,MAAM,QAAQ,CAAA,CAAA;AAE3E,IAAa,MAAA,CAAA;AAAA,MAAA,SAAA;AAAA,KAEX,CAAA,CAAA;AAAA,IACF,OAAC,CAAA,IAAA,EAAA,MAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"skeleton2.js","sources":["../../../../../../packages/components/skeleton/src/skeleton.vue"],"sourcesContent":["<template>\n <template v-if=\"uiLoading\">\n <div :class=\"[ns.b(), ns.is('animated', animated)]\" v-bind=\"$attrs\">\n <template v-for=\"i in count\" :key=\"i\">\n <slot v-if=\"uiLoading\" :key=\"i\" name=\"template\">\n <el-skeleton-item :class=\"ns.is('first')\" variant=\"p\" />\n <el-skeleton-item\n v-for=\"item in rows\"\n :key=\"item\"\n :class=\"[\n ns.e('paragraph'),\n ns.is('last', item === rows && rows > 1),\n ]\"\n variant=\"p\"\n />\n </slot>\n </template>\n </div>\n </template>\n <template v-else>\n <slot v-bind=\"$attrs\" />\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { toRef } from 'vue'\nimport { useNamespace, useThrottleRender } from '@element-plus/hooks'\nimport { skeletonProps } from './skeleton'\nimport ElSkeletonItem from './skeleton-item.vue'\n\ndefineOptions({\n name: 'ElSkeleton',\n})\nconst props = defineProps(skeletonProps)\n\nconst ns = useNamespace('skeleton')\nconst uiLoading = useThrottleRender(toRef(props, 'loading'), props.throttle)\n\ndefineExpose({\n /** @description loading state */\n uiLoading,\n})\n</script>\n"],"names":["useNamespace","useThrottleRender","toRef"],"mappings":";;;;;;;;;;;;uCA8Bc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAGA,IAAM,MAAA,EAAA,GAAKA,mBAAa,UAAU,CAAA,CAAA;AAClC,IAAA,MAAM,YAAYC,yBAAkB,CAAAC,SAAA,CAAM,OAAO,SAAS,CAAA,EAAG,MAAM,QAAQ,CAAA,CAAA;AAE3E,IAAa,MAAA,CAAA;AAAA,MAAA,SAAA;AAAA,KAEX,CAAA,CAAA;AAAA,IACF,OAAC,CAAA,IAAA,EAAA,MAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}