@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,27 +2,84 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../../../utils/index.js');
6
- var runtime = require('../../../utils/vue/props/runtime.js');
5
+ var vue = require('vue');
6
+ require('../../../hooks/index.js');
7
+ var mask = require('./mask2.js');
8
+ var helper = require('./helper.js');
9
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
10
+ var index = require('../../../hooks/use-lockscreen/index.js');
7
11
 
8
- const maskProps = runtime.buildProps({
9
- zIndex: {
10
- type: Number,
11
- default: 1001
12
- },
13
- visible: Boolean,
14
- fill: {
15
- type: String,
16
- default: "rgba(0,0,0,0.5)"
17
- },
18
- pos: {
19
- type: runtime.definePropType(Object)
20
- },
21
- targetAreaClickable: {
22
- type: Boolean,
23
- default: true
12
+ const __default__ = vue.defineComponent({
13
+ name: "ElTourMask",
14
+ inheritAttrs: false
15
+ });
16
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
+ ...__default__,
18
+ props: mask.maskProps,
19
+ setup(__props) {
20
+ const props = __props;
21
+ const { ns } = vue.inject(helper.tourKey);
22
+ const radius = vue.computed(() => {
23
+ var _a, _b;
24
+ return (_b = (_a = props.pos) == null ? void 0 : _a.radius) != null ? _b : 2;
25
+ });
26
+ const roundInfo = vue.computed(() => {
27
+ const v = radius.value;
28
+ const baseInfo = `a${v},${v} 0 0 1`;
29
+ return {
30
+ topRight: `${baseInfo} ${v},${v}`,
31
+ bottomRight: `${baseInfo} ${-v},${v}`,
32
+ bottomLeft: `${baseInfo} ${-v},${-v}`,
33
+ topLeft: `${baseInfo} ${v},${-v}`
34
+ };
35
+ });
36
+ const path = vue.computed(() => {
37
+ const width = window.innerWidth;
38
+ const height = window.innerHeight;
39
+ const info = roundInfo.value;
40
+ const _path = `M${width},0 L0,0 L0,${height} L${width},${height} L${width},0 Z`;
41
+ const _radius = radius.value;
42
+ return props.pos ? `${_path} M${props.pos.left + _radius},${props.pos.top} h${props.pos.width - _radius * 2} ${info.topRight} v${props.pos.height - _radius * 2} ${info.bottomRight} h${-props.pos.width + _radius * 2} ${info.bottomLeft} v${-props.pos.height + _radius * 2} ${info.topLeft} z` : _path;
43
+ });
44
+ const pathStyle = vue.computed(() => {
45
+ return {
46
+ fill: props.fill,
47
+ pointerEvents: "auto",
48
+ cursor: "auto"
49
+ };
50
+ });
51
+ index.useLockscreen(vue.toRef(props, "visible"), {
52
+ ns
53
+ });
54
+ return (_ctx, _cache) => {
55
+ return _ctx.visible ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
56
+ key: 0,
57
+ class: vue.unref(ns).e("mask"),
58
+ style: {
59
+ position: "fixed",
60
+ left: 0,
61
+ right: 0,
62
+ top: 0,
63
+ bottom: 0,
64
+ zIndex: _ctx.zIndex,
65
+ pointerEvents: _ctx.pos && _ctx.targetAreaClickable ? "none" : "auto"
66
+ }
67
+ }, _ctx.$attrs), [
68
+ (vue.openBlock(), vue.createElementBlock("svg", { style: {
69
+ width: "100%",
70
+ height: "100%"
71
+ } }, [
72
+ vue.createElementVNode("path", {
73
+ class: vue.normalizeClass(vue.unref(ns).e("hollow")),
74
+ style: vue.normalizeStyle(vue.unref(pathStyle)),
75
+ d: vue.unref(path)
76
+ }, null, 14, ["d"])
77
+ ]))
78
+ ], 16)) : vue.createCommentVNode("v-if", true);
79
+ };
24
80
  }
25
81
  });
82
+ var ElTourMask = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "mask.vue"]]);
26
83
 
27
- exports.maskProps = maskProps;
84
+ exports["default"] = ElTourMask;
28
85
  //# sourceMappingURL=mask.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mask.js","sources":["../../../../../../packages/components/tour/src/mask.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { PosInfo } from './types'\n\nexport const maskProps = buildProps({\n /**\n * @description mask's zIndex\n */\n zIndex: {\n type: Number,\n default: 1001,\n },\n /**\n * @description whether to show the mask\n */\n visible: Boolean,\n /**\n * @description mask's fill\n */\n fill: {\n type: String,\n default: 'rgba(0,0,0,0.5)',\n },\n /***\n * @description mask's transparent space position\n */\n pos: {\n type: definePropType<PosInfo | null>(Object),\n },\n /**\n * @description whether the target element can be clickable, when using mask\n */\n targetAreaClickable: {\n type: Boolean,\n default: true,\n },\n})\n\nexport type MaskProps = ExtractPropTypes<typeof maskProps>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;;AACY,MAAC,SAAS,GAAGA,kBAAU,CAAC;AACpC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,iBAAiB;AAC9B,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAEC,sBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,mBAAmB,EAAE;AACvB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"mask.js","sources":["../../../../../../packages/components/tour/src/mask.vue"],"sourcesContent":["<template>\n <div\n v-if=\"visible\"\n :class=\"ns.e('mask')\"\n :style=\"({\n position: 'fixed',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n zIndex,\n pointerEvents: pos && targetAreaClickable ? 'none' : 'auto',\n } as any)\"\n v-bind=\"$attrs\"\n >\n <svg\n :style=\"{\n width: '100%',\n height: '100%',\n }\"\n >\n <path :class=\"ns.e('hollow')\" :style=\"pathStyle\" :d=\"path\" />\n </svg>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, toRef } from 'vue'\nimport { useLockscreen } from '@element-plus/hooks'\nimport { maskProps } from './mask'\nimport { tourKey } from './helper'\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElTourMask',\n inheritAttrs: false,\n})\n\nconst props = defineProps(maskProps)\n\nconst { ns } = inject(tourKey)!\nconst radius = computed(() => props.pos?.radius ?? 2)\nconst roundInfo = computed(() => {\n const v = radius.value\n const baseInfo = `a${v},${v} 0 0 1`\n return {\n topRight: `${baseInfo} ${v},${v}`,\n bottomRight: `${baseInfo} ${-v},${v}`,\n bottomLeft: `${baseInfo} ${-v},${-v}`,\n topLeft: `${baseInfo} ${v},${-v}`,\n }\n})\n\nconst path = computed(() => {\n const width = window.innerWidth\n const height = window.innerHeight\n const info = roundInfo.value\n const _path = `M${width},0 L0,0 L0,${height} L${width},${height} L${width},0 Z`\n const _radius = radius.value\n return props.pos\n ? `${_path} M${props.pos.left + _radius},${props.pos.top} h${\n props.pos.width - _radius * 2\n } ${info.topRight} v${props.pos.height - _radius * 2} ${\n info.bottomRight\n } h${-props.pos.width + _radius * 2} ${info.bottomLeft} v${\n -props.pos.height + _radius * 2\n } ${info.topLeft} z`\n : _path\n})\n\nconst pathStyle = computed<CSSProperties>(() => {\n return {\n fill: props.fill,\n pointerEvents: 'auto',\n cursor: 'auto',\n }\n})\n\nuseLockscreen(toRef(props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2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- require('../../../hooks/index.js');
7
- var mask = require('./mask.js');
8
- var helper = require('./helper.js');
9
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
10
- var index = require('../../../hooks/use-lockscreen/index.js');
5
+ require('../../../utils/index.js');
6
+ var runtime = require('../../../utils/vue/props/runtime.js');
11
7
 
12
- const __default__ = vue.defineComponent({
13
- name: "ElTourMask",
14
- inheritAttrs: false
15
- });
16
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
- ...__default__,
18
- props: mask.maskProps,
19
- setup(__props) {
20
- const props = __props;
21
- const { ns } = vue.inject(helper.tourKey);
22
- const radius = vue.computed(() => {
23
- var _a, _b;
24
- return (_b = (_a = props.pos) == null ? void 0 : _a.radius) != null ? _b : 2;
25
- });
26
- const roundInfo = vue.computed(() => {
27
- const v = radius.value;
28
- const baseInfo = `a${v},${v} 0 0 1`;
29
- return {
30
- topRight: `${baseInfo} ${v},${v}`,
31
- bottomRight: `${baseInfo} ${-v},${v}`,
32
- bottomLeft: `${baseInfo} ${-v},${-v}`,
33
- topLeft: `${baseInfo} ${v},${-v}`
34
- };
35
- });
36
- const path = vue.computed(() => {
37
- const width = window.innerWidth;
38
- const height = window.innerHeight;
39
- const info = roundInfo.value;
40
- const _path = `M${width},0 L0,0 L0,${height} L${width},${height} L${width},0 Z`;
41
- const _radius = radius.value;
42
- return props.pos ? `${_path} M${props.pos.left + _radius},${props.pos.top} h${props.pos.width - _radius * 2} ${info.topRight} v${props.pos.height - _radius * 2} ${info.bottomRight} h${-props.pos.width + _radius * 2} ${info.bottomLeft} v${-props.pos.height + _radius * 2} ${info.topLeft} z` : _path;
43
- });
44
- const pathStyle = vue.computed(() => {
45
- return {
46
- fill: props.fill,
47
- pointerEvents: "auto",
48
- cursor: "auto"
49
- };
50
- });
51
- index.useLockscreen(vue.toRef(props, "visible"), {
52
- ns
53
- });
54
- return (_ctx, _cache) => {
55
- return _ctx.visible ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
56
- key: 0,
57
- class: vue.unref(ns).e("mask"),
58
- style: {
59
- position: "fixed",
60
- left: 0,
61
- right: 0,
62
- top: 0,
63
- bottom: 0,
64
- zIndex: _ctx.zIndex,
65
- pointerEvents: _ctx.pos && _ctx.targetAreaClickable ? "none" : "auto"
66
- }
67
- }, _ctx.$attrs), [
68
- (vue.openBlock(), vue.createElementBlock("svg", { style: {
69
- width: "100%",
70
- height: "100%"
71
- } }, [
72
- vue.createElementVNode("path", {
73
- class: vue.normalizeClass(vue.unref(ns).e("hollow")),
74
- style: vue.normalizeStyle(vue.unref(pathStyle)),
75
- d: vue.unref(path)
76
- }, null, 14, ["d"])
77
- ]))
78
- ], 16)) : vue.createCommentVNode("v-if", true);
79
- };
8
+ const maskProps = runtime.buildProps({
9
+ zIndex: {
10
+ type: Number,
11
+ default: 1001
12
+ },
13
+ visible: Boolean,
14
+ fill: {
15
+ type: String,
16
+ default: "rgba(0,0,0,0.5)"
17
+ },
18
+ pos: {
19
+ type: runtime.definePropType(Object)
20
+ },
21
+ targetAreaClickable: {
22
+ type: Boolean,
23
+ default: true
80
24
  }
81
25
  });
82
- var ElTourMask = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "mask.vue"]]);
83
26
 
84
- exports["default"] = ElTourMask;
27
+ exports.maskProps = maskProps;
85
28
  //# sourceMappingURL=mask2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mask2.js","sources":["../../../../../../packages/components/tour/src/mask.vue"],"sourcesContent":["<template>\n <div\n v-if=\"visible\"\n :class=\"ns.e('mask')\"\n :style=\"({\n position: 'fixed',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n zIndex,\n pointerEvents: pos && targetAreaClickable ? 'none' : 'auto',\n } as any)\"\n v-bind=\"$attrs\"\n >\n <svg\n :style=\"{\n width: '100%',\n height: '100%',\n }\"\n >\n <path :class=\"ns.e('hollow')\" :style=\"pathStyle\" :d=\"path\" />\n </svg>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, toRef } from 'vue'\nimport { useLockscreen } from '@element-plus/hooks'\nimport { maskProps } from './mask'\nimport { tourKey } from './helper'\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElTourMask',\n inheritAttrs: false,\n})\n\nconst props = defineProps(maskProps)\n\nconst { ns } = inject(tourKey)!\nconst radius = computed(() => props.pos?.radius ?? 2)\nconst roundInfo = computed(() => {\n const v = radius.value\n const baseInfo = `a${v},${v} 0 0 1`\n return {\n topRight: `${baseInfo} ${v},${v}`,\n bottomRight: `${baseInfo} ${-v},${v}`,\n bottomLeft: `${baseInfo} ${-v},${-v}`,\n topLeft: `${baseInfo} ${v},${-v}`,\n }\n})\n\nconst path = computed(() => {\n const width = window.innerWidth\n const height = window.innerHeight\n const info = roundInfo.value\n const _path = `M${width},0 L0,0 L0,${height} L${width},${height} L${width},0 Z`\n const _radius = radius.value\n return props.pos\n ? `${_path} M${props.pos.left + _radius},${props.pos.top} h${\n props.pos.width - _radius * 2\n } ${info.topRight} v${props.pos.height - _radius * 2} ${\n info.bottomRight\n } h${-props.pos.width + _radius * 2} ${info.bottomLeft} v${\n -props.pos.height + _radius * 2\n } ${info.topLeft} z`\n : _path\n})\n\nconst pathStyle = computed<CSSProperties>(() => {\n return {\n fill: props.fill,\n pointerEvents: 'auto',\n cursor: 'auto',\n }\n})\n\nuseLockscreen(toRef(props, 'visible'), {\n ns,\n})\n</script>\n"],"names":["inject","tourKey","computed"],"mappings":";;;;;;;;;;;uCAiCc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AAAA,EACN,YAAc,EAAA,KAAA;AAChB,CAAA,CAAA,CAAA;;;;;;AAIA,IAAA,MAAM,EAAE,EAAA,EAAO,GAAAA,UAAA,CAAOC,cAAO,CAAA,CAAA;AAC7B,IAAA,MAAM,SAASC,YAAS,CAAA,MAAM;AAC9B,MAAM,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,KAAA,CAAA,GAAA,GAAA,CAAA,EAAA,KAAA,CAAA,EAAA,EAAA,KAAA,CAAA,GAAA,CAAA,IAAA,GAAA,OAAA,CAAA,CAAA,EAAA,KAAA,CAAA,GAAA,CAAA,GAAA,CAAA,EAAA,EAAA,KAAA,CAAA,GAAA,CAAA,KAAA,GAAA,OAAA,GAAA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,QAAA,CAAA,EAAA,EAAA,KAAA,CAAA,GAAA,CAAA,MAAA,GAAA,OAAA,GAAA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,WAAA,CAAA,EAAA,EAAA,CAAA,KAAA,CAAA,GAAA,CAAA,KAAA,GAAA,OAAA,GAAA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,UAAA,CAAA,EAAA,EAAA,CAAA,KAAA,CAAA,GAAA,CAAA,MAAA,GAAA,OAAA,GAAA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,OAAA,CAAA,EAAA,CAAA,GAAA,KAAA,CAAA;AAAA,KAAA,CAAA,CAAA;AACO,IAAA,MACG,SAAA,GAAAA,YAAA,CAAA,MAAA;AAAA,MAAA,OACP;AAAA,QACV,IAAA,EAAA,KAAA,CAAA,IAAA;AAAA,QACD,aAAA,EAAA,MAAA;AAED,QAAc,MAAA,EAAA,MAAA;AAAyB,OACrC,CAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"mask2.js","sources":["../../../../../../packages/components/tour/src/mask.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { PosInfo } from './types'\n\nexport const maskProps = buildProps({\n /**\n * @description mask's zIndex\n */\n zIndex: {\n type: Number,\n default: 1001,\n },\n /**\n * @description whether to show the mask\n */\n visible: Boolean,\n /**\n * @description mask's fill\n */\n fill: {\n type: String,\n default: 'rgba(0,0,0,0.5)',\n },\n /***\n * @description mask's transparent space position\n */\n pos: {\n type: definePropType<PosInfo | null>(Object),\n },\n /**\n * @description whether the target element can be clickable, when using mask\n */\n targetAreaClickable: {\n type: Boolean,\n default: true,\n },\n})\n\nexport type MaskProps = ExtractPropTypes<typeof maskProps>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;;AACY,MAAC,SAAS,GAAGA,kBAAU,CAAC;AACpC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,iBAAiB;AAC9B,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAEC,sBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,mBAAmB,EAAE;AACvB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC;;;;"}
@@ -7,7 +7,7 @@ var core = require('@vueuse/core');
7
7
  require('../../../hooks/index.js');
8
8
  require('../../../utils/index.js');
9
9
  var index$2 = require('../../teleport/index.js');
10
- var mask = require('./mask2.js');
10
+ var mask = require('./mask.js');
11
11
  var content = require('./content2.js');
12
12
  var steps = require('./steps.js');
13
13
  var tour = require('./tour.js');
@@ -1,2 +1,7 @@
1
1
  import type { Ref } from 'vue';
2
- export declare const useThrottleRender: (loading: Ref<boolean>, throttle?: number) => Ref<boolean>;
2
+ export type ThrottleType = {
3
+ leading?: number;
4
+ trailing?: number;
5
+ initVal?: boolean;
6
+ } | number;
7
+ export declare const useThrottleRender: (loading: Ref<boolean>, throttle?: ThrottleType) => Ref<boolean>;
@@ -3,27 +3,46 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
+ require('../../utils/index.js');
7
+ var shared = require('@vue/shared');
8
+ var types = require('../../utils/types.js');
6
9
 
7
10
  const useThrottleRender = (loading, throttle = 0) => {
8
11
  if (throttle === 0)
9
12
  return loading;
10
- const throttled = vue.ref(false);
13
+ const initVal = shared.isObject(throttle) && Boolean(throttle.initVal);
14
+ const throttled = vue.ref(initVal);
11
15
  let timeoutHandle = null;
12
- const dispatchThrottling = () => {
16
+ const dispatchThrottling = (timer) => {
17
+ if (types.isUndefined(timer)) {
18
+ throttled.value = loading.value;
19
+ return;
20
+ }
13
21
  if (timeoutHandle) {
14
22
  clearTimeout(timeoutHandle);
15
23
  }
16
24
  timeoutHandle = setTimeout(() => {
17
25
  throttled.value = loading.value;
18
- }, throttle);
26
+ }, timer);
19
27
  };
20
- vue.onMounted(dispatchThrottling);
21
- vue.watch(() => loading.value, (val) => {
22
- if (val) {
23
- dispatchThrottling();
28
+ const dispatcher = (type) => {
29
+ if (type === "leading") {
30
+ if (types.isNumber(throttle)) {
31
+ dispatchThrottling(throttle);
32
+ } else {
33
+ dispatchThrottling(throttle.leading);
34
+ }
24
35
  } else {
25
- throttled.value = val;
36
+ if (shared.isObject(throttle)) {
37
+ dispatchThrottling(throttle.trailing);
38
+ } else {
39
+ throttled.value = false;
40
+ }
26
41
  }
42
+ };
43
+ vue.onMounted(() => dispatcher("leading"));
44
+ vue.watch(() => loading.value, (val) => {
45
+ dispatcher(val ? "leading" : "trailing");
27
46
  });
28
47
  return throttled;
29
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-throttle-render/index.ts"],"sourcesContent":["import { onMounted, ref, watch } from 'vue'\n\nimport type { Ref } from 'vue'\n\nexport const useThrottleRender = (loading: Ref<boolean>, throttle = 0) => {\n if (throttle === 0) return loading\n const throttled = ref(false)\n let timeoutHandle: ReturnType<typeof setTimeout> | null = null\n\n const dispatchThrottling = () => {\n if (timeoutHandle) {\n clearTimeout(timeoutHandle)\n }\n timeoutHandle = setTimeout(() => {\n throttled.value = loading.value\n }, throttle)\n }\n onMounted(dispatchThrottling)\n\n watch(\n () => loading.value,\n (val) => {\n if (val) {\n dispatchThrottling()\n } else {\n throttled.value = val\n }\n }\n )\n return throttled\n}\n"],"names":["ref","onMounted","watch"],"mappings":";;;;;;AACY,MAAC,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,GAAG,CAAC,KAAK;AAC5D,EAAE,IAAI,QAAQ,KAAK,CAAC;AACpB,IAAI,OAAO,OAAO,CAAC;AACnB,EAAE,MAAM,SAAS,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AAC/B,EAAE,IAAI,aAAa,GAAG,IAAI,CAAC;AAC3B,EAAE,MAAM,kBAAkB,GAAG,MAAM;AACnC,IAAI,IAAI,aAAa,EAAE;AACvB,MAAM,YAAY,CAAC,aAAa,CAAC,CAAC;AAClC,KAAK;AACL,IAAI,aAAa,GAAG,UAAU,CAAC,MAAM;AACrC,MAAM,SAAS,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACtC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACjB,GAAG,CAAC;AACJ,EAAEC,aAAS,CAAC,kBAAkB,CAAC,CAAC;AAChC,EAAEC,SAAK,CAAC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK;AACtC,IAAI,IAAI,GAAG,EAAE;AACb,MAAM,kBAAkB,EAAE,CAAC;AAC3B,KAAK,MAAM;AACX,MAAM,SAAS,CAAC,KAAK,GAAG,GAAG,CAAC;AAC5B,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,SAAS,CAAC;AACnB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-throttle-render/index.ts"],"sourcesContent":["import { onMounted, ref, watch } from 'vue'\nimport { isNumber, isObject, isUndefined } from '@element-plus/utils'\n\nimport type { Ref } from 'vue'\n\nexport type ThrottleType =\n | { leading?: number; trailing?: number; initVal?: boolean }\n | number\n\nexport const useThrottleRender = (\n loading: Ref<boolean>,\n throttle: ThrottleType = 0\n) => {\n if (throttle === 0) return loading\n const initVal = isObject(throttle) && Boolean(throttle.initVal)\n const throttled = ref(initVal)\n let timeoutHandle: ReturnType<typeof setTimeout> | null = null\n\n const dispatchThrottling = (timer: number | undefined) => {\n if (isUndefined(timer)) {\n throttled.value = loading.value\n return\n }\n if (timeoutHandle) {\n clearTimeout(timeoutHandle)\n }\n timeoutHandle = setTimeout(() => {\n throttled.value = loading.value\n }, timer)\n }\n\n const dispatcher = (type: 'leading' | 'trailing') => {\n if (type === 'leading') {\n if (isNumber(throttle)) {\n dispatchThrottling(throttle)\n } else {\n dispatchThrottling(throttle.leading)\n }\n } else {\n if (isObject(throttle)) {\n dispatchThrottling(throttle.trailing)\n } else {\n throttled.value = false\n }\n }\n }\n\n onMounted(() => dispatcher('leading'))\n\n watch(\n () => loading.value,\n (val) => {\n dispatcher(val ? 'leading' : 'trailing')\n }\n )\n\n return throttled\n}\n"],"names":["isObject","ref","isUndefined","isNumber","onMounted","watch"],"mappings":";;;;;;;;;AAEY,MAAC,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,GAAG,CAAC,KAAK;AAC5D,EAAE,IAAI,QAAQ,KAAK,CAAC;AACpB,IAAI,OAAO,OAAO,CAAC;AACnB,EAAE,MAAM,OAAO,GAAGA,eAAQ,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAClE,EAAE,MAAM,SAAS,GAAGC,OAAG,CAAC,OAAO,CAAC,CAAC;AACjC,EAAE,IAAI,aAAa,GAAG,IAAI,CAAC;AAC3B,EAAE,MAAM,kBAAkB,GAAG,CAAC,KAAK,KAAK;AACxC,IAAI,IAAIC,iBAAW,CAAC,KAAK,CAAC,EAAE;AAC5B,MAAM,SAAS,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACtC,MAAM,OAAO;AACb,KAAK;AACL,IAAI,IAAI,aAAa,EAAE;AACvB,MAAM,YAAY,CAAC,aAAa,CAAC,CAAC;AAClC,KAAK;AACL,IAAI,aAAa,GAAG,UAAU,CAAC,MAAM;AACrC,MAAM,SAAS,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACtC,KAAK,EAAE,KAAK,CAAC,CAAC;AACd,GAAG,CAAC;AACJ,EAAE,MAAM,UAAU,GAAG,CAAC,IAAI,KAAK;AAC/B,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE;AAC5B,MAAM,IAAIC,cAAQ,CAAC,QAAQ,CAAC,EAAE;AAC9B,QAAQ,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AACrC,OAAO,MAAM;AACb,QAAQ,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC7C,OAAO;AACP,KAAK,MAAM;AACX,MAAM,IAAIH,eAAQ,CAAC,QAAQ,CAAC,EAAE;AAC9B,QAAQ,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC9C,OAAO,MAAM;AACb,QAAQ,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;AAChC,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ,EAAEI,aAAS,CAAC,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;AACzC,EAAEC,SAAK,CAAC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK;AACtC,IAAI,UAAU,CAAC,GAAG,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAC7C,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,SAAS,CAAC;AACnB;;;;"}
package/lib/index.js CHANGED
@@ -76,7 +76,7 @@ var constants$7 = require('./components/dialog/src/constants.js');
76
76
  var index$o = require('./components/dialog/index.js');
77
77
  var divider = require('./components/divider/src/divider.js');
78
78
  var index$p = require('./components/divider/index.js');
79
- var drawer = require('./components/drawer/src/drawer2.js');
79
+ var drawer = require('./components/drawer/src/drawer.js');
80
80
  var index$q = require('./components/drawer/index.js');
81
81
  var dropdown = require('./components/dropdown/src/dropdown.js');
82
82
  var tokens = require('./components/dropdown/src/tokens.js');
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.0.20241106";
1
+ export declare const version = "0.0.20241108";
package/lib/version.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const version = "0.0.20241106";
5
+ const version = "0.0.20241108";
6
6
 
7
7
  exports.version = version;
8
8
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20241106'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20241108'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@element-plus/nightly",
3
- "version": "0.0.20241106",
3
+ "version": "0.0.20241108",
4
4
  "description": "A Component Library for Vue 3",
5
5
  "keywords": [
6
6
  "element-plus",
@@ -112,5 +112,5 @@
112
112
  "not ie 11",
113
113
  "not op_mini all"
114
114
  ],
115
- "gitHead": "6b5c12b2752cb2f3e272464e46c21b303c76e24e"
115
+ "gitHead": "a7a3b590238e576371c5060da259716b8701e6d5"
116
116
  }