@element-plus/nightly 0.0.20260608 → 0.0.20260610

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (507) hide show
  1. package/README.md +10 -0
  2. package/dist/index.full.js +24 -16
  3. package/dist/index.full.min.js +3 -3
  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 +24 -16
  8. package/dist/locale/af.js +1 -1
  9. package/dist/locale/af.min.js +1 -1
  10. package/dist/locale/af.min.mjs +1 -1
  11. package/dist/locale/af.mjs +1 -1
  12. package/dist/locale/ar-eg.js +1 -1
  13. package/dist/locale/ar-eg.min.js +1 -1
  14. package/dist/locale/ar-eg.min.mjs +1 -1
  15. package/dist/locale/ar-eg.mjs +1 -1
  16. package/dist/locale/ar.js +1 -1
  17. package/dist/locale/ar.min.js +1 -1
  18. package/dist/locale/ar.min.mjs +1 -1
  19. package/dist/locale/ar.mjs +1 -1
  20. package/dist/locale/az.js +1 -1
  21. package/dist/locale/az.min.js +1 -1
  22. package/dist/locale/az.min.mjs +1 -1
  23. package/dist/locale/az.mjs +1 -1
  24. package/dist/locale/bg.js +1 -1
  25. package/dist/locale/bg.min.js +1 -1
  26. package/dist/locale/bg.min.mjs +1 -1
  27. package/dist/locale/bg.mjs +1 -1
  28. package/dist/locale/bn.js +1 -1
  29. package/dist/locale/bn.min.js +1 -1
  30. package/dist/locale/bn.min.mjs +1 -1
  31. package/dist/locale/bn.mjs +1 -1
  32. package/dist/locale/ca.js +1 -1
  33. package/dist/locale/ca.min.js +1 -1
  34. package/dist/locale/ca.min.mjs +1 -1
  35. package/dist/locale/ca.mjs +1 -1
  36. package/dist/locale/ckb.js +1 -1
  37. package/dist/locale/ckb.min.js +1 -1
  38. package/dist/locale/ckb.min.mjs +1 -1
  39. package/dist/locale/ckb.mjs +1 -1
  40. package/dist/locale/cs.js +1 -1
  41. package/dist/locale/cs.min.js +1 -1
  42. package/dist/locale/cs.min.mjs +1 -1
  43. package/dist/locale/cs.mjs +1 -1
  44. package/dist/locale/da.js +1 -1
  45. package/dist/locale/da.min.js +1 -1
  46. package/dist/locale/da.min.mjs +1 -1
  47. package/dist/locale/da.mjs +1 -1
  48. package/dist/locale/de.js +1 -1
  49. package/dist/locale/de.min.js +1 -1
  50. package/dist/locale/de.min.mjs +1 -1
  51. package/dist/locale/de.mjs +1 -1
  52. package/dist/locale/el.js +1 -1
  53. package/dist/locale/el.min.js +1 -1
  54. package/dist/locale/el.min.mjs +1 -1
  55. package/dist/locale/el.mjs +1 -1
  56. package/dist/locale/en.js +1 -1
  57. package/dist/locale/en.min.js +1 -1
  58. package/dist/locale/en.min.mjs +1 -1
  59. package/dist/locale/en.mjs +1 -1
  60. package/dist/locale/eo.js +1 -1
  61. package/dist/locale/eo.min.js +1 -1
  62. package/dist/locale/eo.min.mjs +1 -1
  63. package/dist/locale/eo.mjs +1 -1
  64. package/dist/locale/es.js +1 -1
  65. package/dist/locale/es.min.js +1 -1
  66. package/dist/locale/es.min.mjs +1 -1
  67. package/dist/locale/es.mjs +1 -1
  68. package/dist/locale/et.js +1 -1
  69. package/dist/locale/et.min.js +1 -1
  70. package/dist/locale/et.min.mjs +1 -1
  71. package/dist/locale/et.mjs +1 -1
  72. package/dist/locale/eu.js +1 -1
  73. package/dist/locale/eu.min.js +1 -1
  74. package/dist/locale/eu.min.mjs +1 -1
  75. package/dist/locale/eu.mjs +1 -1
  76. package/dist/locale/fa.js +1 -1
  77. package/dist/locale/fa.min.js +1 -1
  78. package/dist/locale/fa.min.mjs +1 -1
  79. package/dist/locale/fa.mjs +1 -1
  80. package/dist/locale/fi.js +1 -1
  81. package/dist/locale/fi.min.js +1 -1
  82. package/dist/locale/fi.min.mjs +1 -1
  83. package/dist/locale/fi.mjs +1 -1
  84. package/dist/locale/fr.js +1 -1
  85. package/dist/locale/fr.min.js +1 -1
  86. package/dist/locale/fr.min.mjs +1 -1
  87. package/dist/locale/fr.mjs +1 -1
  88. package/dist/locale/he.js +1 -1
  89. package/dist/locale/he.min.js +1 -1
  90. package/dist/locale/he.min.mjs +1 -1
  91. package/dist/locale/he.mjs +1 -1
  92. package/dist/locale/hi.js +1 -1
  93. package/dist/locale/hi.min.js +1 -1
  94. package/dist/locale/hi.min.mjs +1 -1
  95. package/dist/locale/hi.mjs +1 -1
  96. package/dist/locale/hr.js +1 -1
  97. package/dist/locale/hr.min.js +1 -1
  98. package/dist/locale/hr.min.mjs +1 -1
  99. package/dist/locale/hr.mjs +1 -1
  100. package/dist/locale/hu.js +1 -1
  101. package/dist/locale/hu.min.js +1 -1
  102. package/dist/locale/hu.min.mjs +1 -1
  103. package/dist/locale/hu.mjs +1 -1
  104. package/dist/locale/hy-am.js +1 -1
  105. package/dist/locale/hy-am.min.js +1 -1
  106. package/dist/locale/hy-am.min.mjs +1 -1
  107. package/dist/locale/hy-am.mjs +1 -1
  108. package/dist/locale/id.js +1 -1
  109. package/dist/locale/id.min.js +1 -1
  110. package/dist/locale/id.min.mjs +1 -1
  111. package/dist/locale/id.mjs +1 -1
  112. package/dist/locale/it.js +1 -1
  113. package/dist/locale/it.min.js +1 -1
  114. package/dist/locale/it.min.mjs +1 -1
  115. package/dist/locale/it.mjs +1 -1
  116. package/dist/locale/ja.js +1 -1
  117. package/dist/locale/ja.min.js +1 -1
  118. package/dist/locale/ja.min.mjs +1 -1
  119. package/dist/locale/ja.mjs +1 -1
  120. package/dist/locale/kk.js +1 -1
  121. package/dist/locale/kk.min.js +1 -1
  122. package/dist/locale/kk.min.mjs +1 -1
  123. package/dist/locale/kk.mjs +1 -1
  124. package/dist/locale/km.js +1 -1
  125. package/dist/locale/km.min.js +1 -1
  126. package/dist/locale/km.min.mjs +1 -1
  127. package/dist/locale/km.mjs +1 -1
  128. package/dist/locale/ko.js +1 -1
  129. package/dist/locale/ko.min.js +1 -1
  130. package/dist/locale/ko.min.mjs +1 -1
  131. package/dist/locale/ko.mjs +1 -1
  132. package/dist/locale/ku.js +1 -1
  133. package/dist/locale/ku.min.js +1 -1
  134. package/dist/locale/ku.min.mjs +1 -1
  135. package/dist/locale/ku.mjs +1 -1
  136. package/dist/locale/ky.js +1 -1
  137. package/dist/locale/ky.min.js +1 -1
  138. package/dist/locale/ky.min.mjs +1 -1
  139. package/dist/locale/ky.mjs +1 -1
  140. package/dist/locale/lo.js +1 -1
  141. package/dist/locale/lo.min.js +1 -1
  142. package/dist/locale/lo.min.mjs +1 -1
  143. package/dist/locale/lo.mjs +1 -1
  144. package/dist/locale/lt.js +1 -1
  145. package/dist/locale/lt.min.js +1 -1
  146. package/dist/locale/lt.min.mjs +1 -1
  147. package/dist/locale/lt.mjs +1 -1
  148. package/dist/locale/lv.js +1 -1
  149. package/dist/locale/lv.min.js +1 -1
  150. package/dist/locale/lv.min.mjs +1 -1
  151. package/dist/locale/lv.mjs +1 -1
  152. package/dist/locale/mg.js +1 -1
  153. package/dist/locale/mg.min.js +1 -1
  154. package/dist/locale/mg.min.mjs +1 -1
  155. package/dist/locale/mg.mjs +1 -1
  156. package/dist/locale/mn.js +1 -1
  157. package/dist/locale/mn.min.js +1 -1
  158. package/dist/locale/mn.min.mjs +1 -1
  159. package/dist/locale/mn.mjs +1 -1
  160. package/dist/locale/ms.js +1 -1
  161. package/dist/locale/ms.min.js +1 -1
  162. package/dist/locale/ms.min.mjs +1 -1
  163. package/dist/locale/ms.mjs +1 -1
  164. package/dist/locale/my.js +1 -1
  165. package/dist/locale/my.min.js +1 -1
  166. package/dist/locale/my.min.mjs +1 -1
  167. package/dist/locale/my.mjs +1 -1
  168. package/dist/locale/nb-no.js +1 -1
  169. package/dist/locale/nb-no.min.js +1 -1
  170. package/dist/locale/nb-no.min.mjs +1 -1
  171. package/dist/locale/nb-no.mjs +1 -1
  172. package/dist/locale/nl.js +1 -1
  173. package/dist/locale/nl.min.js +1 -1
  174. package/dist/locale/nl.min.mjs +1 -1
  175. package/dist/locale/nl.mjs +1 -1
  176. package/dist/locale/no.js +1 -1
  177. package/dist/locale/no.min.js +1 -1
  178. package/dist/locale/no.min.mjs +1 -1
  179. package/dist/locale/no.mjs +1 -1
  180. package/dist/locale/pa.js +1 -1
  181. package/dist/locale/pa.min.js +1 -1
  182. package/dist/locale/pa.min.mjs +1 -1
  183. package/dist/locale/pa.mjs +1 -1
  184. package/dist/locale/pl.js +1 -1
  185. package/dist/locale/pl.min.js +1 -1
  186. package/dist/locale/pl.min.mjs +1 -1
  187. package/dist/locale/pl.mjs +1 -1
  188. package/dist/locale/pt-br.js +1 -1
  189. package/dist/locale/pt-br.min.js +1 -1
  190. package/dist/locale/pt-br.min.mjs +1 -1
  191. package/dist/locale/pt-br.mjs +1 -1
  192. package/dist/locale/pt.js +1 -1
  193. package/dist/locale/pt.min.js +1 -1
  194. package/dist/locale/pt.min.mjs +1 -1
  195. package/dist/locale/pt.mjs +1 -1
  196. package/dist/locale/ro.js +1 -1
  197. package/dist/locale/ro.min.js +1 -1
  198. package/dist/locale/ro.min.mjs +1 -1
  199. package/dist/locale/ro.mjs +1 -1
  200. package/dist/locale/ru.js +1 -1
  201. package/dist/locale/ru.min.js +1 -1
  202. package/dist/locale/ru.min.mjs +1 -1
  203. package/dist/locale/ru.mjs +1 -1
  204. package/dist/locale/sk.js +1 -1
  205. package/dist/locale/sk.min.js +1 -1
  206. package/dist/locale/sk.min.mjs +1 -1
  207. package/dist/locale/sk.mjs +1 -1
  208. package/dist/locale/sl.js +1 -1
  209. package/dist/locale/sl.min.js +1 -1
  210. package/dist/locale/sl.min.mjs +1 -1
  211. package/dist/locale/sl.mjs +1 -1
  212. package/dist/locale/sr.js +1 -1
  213. package/dist/locale/sr.min.js +1 -1
  214. package/dist/locale/sr.min.mjs +1 -1
  215. package/dist/locale/sr.mjs +1 -1
  216. package/dist/locale/sv.js +1 -1
  217. package/dist/locale/sv.min.js +1 -1
  218. package/dist/locale/sv.min.mjs +1 -1
  219. package/dist/locale/sv.mjs +1 -1
  220. package/dist/locale/sw.js +1 -1
  221. package/dist/locale/sw.min.js +1 -1
  222. package/dist/locale/sw.min.mjs +1 -1
  223. package/dist/locale/sw.mjs +1 -1
  224. package/dist/locale/ta.js +1 -1
  225. package/dist/locale/ta.min.js +1 -1
  226. package/dist/locale/ta.min.mjs +1 -1
  227. package/dist/locale/ta.mjs +1 -1
  228. package/dist/locale/te.js +1 -1
  229. package/dist/locale/te.min.js +1 -1
  230. package/dist/locale/te.min.mjs +1 -1
  231. package/dist/locale/te.mjs +1 -1
  232. package/dist/locale/th.js +1 -1
  233. package/dist/locale/th.min.js +1 -1
  234. package/dist/locale/th.min.mjs +1 -1
  235. package/dist/locale/th.mjs +1 -1
  236. package/dist/locale/tk.js +1 -1
  237. package/dist/locale/tk.min.js +1 -1
  238. package/dist/locale/tk.min.mjs +1 -1
  239. package/dist/locale/tk.mjs +1 -1
  240. package/dist/locale/tr.js +1 -1
  241. package/dist/locale/tr.min.js +1 -1
  242. package/dist/locale/tr.min.mjs +1 -1
  243. package/dist/locale/tr.mjs +1 -1
  244. package/dist/locale/ug-cn.js +1 -1
  245. package/dist/locale/ug-cn.min.js +1 -1
  246. package/dist/locale/ug-cn.min.mjs +1 -1
  247. package/dist/locale/ug-cn.mjs +1 -1
  248. package/dist/locale/uk.js +1 -1
  249. package/dist/locale/uk.min.js +1 -1
  250. package/dist/locale/uk.min.mjs +1 -1
  251. package/dist/locale/uk.mjs +1 -1
  252. package/dist/locale/uz-uz.js +1 -1
  253. package/dist/locale/uz-uz.min.js +1 -1
  254. package/dist/locale/uz-uz.min.mjs +1 -1
  255. package/dist/locale/uz-uz.mjs +1 -1
  256. package/dist/locale/vi.js +1 -1
  257. package/dist/locale/vi.min.js +1 -1
  258. package/dist/locale/vi.min.mjs +1 -1
  259. package/dist/locale/vi.mjs +1 -1
  260. package/dist/locale/zh-cn.js +1 -1
  261. package/dist/locale/zh-cn.min.js +1 -1
  262. package/dist/locale/zh-cn.min.mjs +1 -1
  263. package/dist/locale/zh-cn.mjs +1 -1
  264. package/dist/locale/zh-hk.js +1 -1
  265. package/dist/locale/zh-hk.min.js +1 -1
  266. package/dist/locale/zh-hk.min.mjs +1 -1
  267. package/dist/locale/zh-hk.mjs +1 -1
  268. package/dist/locale/zh-mo.js +1 -1
  269. package/dist/locale/zh-mo.min.js +1 -1
  270. package/dist/locale/zh-mo.min.mjs +1 -1
  271. package/dist/locale/zh-mo.mjs +1 -1
  272. package/dist/locale/zh-tw.js +1 -1
  273. package/dist/locale/zh-tw.min.js +1 -1
  274. package/dist/locale/zh-tw.min.mjs +1 -1
  275. package/dist/locale/zh-tw.mjs +1 -1
  276. package/es/components/affix/src/affix.vue.d.ts +1 -1
  277. package/es/components/alert/src/alert.d.ts +1 -1
  278. package/es/components/alert/src/alert.vue.d.ts +1 -1
  279. package/es/components/avatar/src/avatar.d.ts +1 -1
  280. package/es/components/badge/src/badge.d.ts +1 -1
  281. package/es/components/button/src/button-group.d.ts +1 -1
  282. package/es/components/button/src/button-group.vue.d.ts +1 -1
  283. package/es/components/button/src/button.d.ts +1 -1
  284. package/es/components/button/src/button.vue.d.ts +3 -3
  285. package/es/components/button/src/use-button.d.ts +1 -1
  286. package/es/components/carousel/src/carousel-item.vue.d.ts +1 -1
  287. package/es/components/cascader/src/cascader.d.ts +1 -1
  288. package/es/components/cascader/src/cascader.vue.d.ts +9 -9
  289. package/es/components/cascader-panel/src/index.vue.d.ts +1 -1
  290. package/es/components/check-tag/src/check-tag.d.ts +1 -1
  291. package/es/components/checkbox/src/checkbox-button.vue.d.ts +3 -3
  292. package/es/components/checkbox/src/checkbox-group.vue.d.ts +3 -3
  293. package/es/components/checkbox/src/checkbox.vue.d.ts +3 -3
  294. package/es/components/col/src/col.vue.d.ts +1 -1
  295. package/es/components/color-picker/src/color-picker.vue.d.ts +3 -3
  296. package/es/components/countdown/src/countdown.vue.d.ts +2 -2
  297. package/es/components/date-picker/src/date-picker.d.ts +16 -16
  298. package/es/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
  299. package/es/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue.d.ts +2 -2
  300. package/es/components/date-picker-panel/src/date-picker-com/panel-date-range.vue.d.ts +3 -3
  301. package/es/components/date-picker-panel/src/date-picker-com/panel-month-range.vue.d.ts +2 -2
  302. package/es/components/date-picker-panel/src/date-picker-com/panel-year-range.vue.d.ts +2 -2
  303. package/es/components/date-picker-panel/src/date-picker-panel.d.ts +5 -5
  304. package/es/components/date-picker-panel/src/panel-utils.d.ts +21 -21
  305. package/es/components/descriptions/src/description-item.d.ts +2 -2
  306. package/es/components/divider/src/divider.vue.d.ts +1 -1
  307. package/es/components/drawer/src/drawer.vue.d.ts +1 -1
  308. package/es/components/dropdown/src/dropdown.d.ts +1 -1
  309. package/es/components/dropdown/src/dropdown.vue.d.ts +34 -34
  310. package/es/components/image/src/image.d.ts +1 -1
  311. package/es/components/image/src/image.vue.d.ts +4 -4
  312. package/es/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
  313. package/es/components/input/src/input.vue.d.ts +2 -2
  314. package/es/components/input-number/src/input-number.vue.d.ts +5 -5
  315. package/es/components/input-otp/src/input-otp.vue.d.ts +4 -4
  316. package/es/components/input-tag/src/input-tag.d.ts +1 -1
  317. package/es/components/input-tag/src/input-tag.vue.d.ts +6 -6
  318. package/es/components/link/src/link.d.ts +1 -1
  319. package/es/components/message/src/message.d.ts +1 -1
  320. package/es/components/message/src/message.vue.d.ts +5 -5
  321. package/es/components/message-box/src/index.vue.d.ts +20 -20
  322. package/es/components/notification/src/notification.d.ts +1 -1
  323. package/es/components/notification/src/notification.vue.d.ts +4 -4
  324. package/es/components/pagination/src/pagination.d.ts +3 -3
  325. package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
  326. package/es/components/popconfirm/src/popconfirm.vue.d.ts +1 -1
  327. package/es/components/popover/src/popover.vue.d.ts +4 -4
  328. package/es/components/popper/src/content.vue.d.ts +2 -2
  329. package/es/components/progress/src/progress.vue.d.ts +3 -3
  330. package/es/components/radio/src/radio-button.vue.d.ts +2 -2
  331. package/es/components/radio/src/radio-group.vue.d.ts +4 -4
  332. package/es/components/radio/src/radio.vue.d.ts +2 -2
  333. package/es/components/result/src/result.d.ts +1 -1
  334. package/es/components/scrollbar/src/scrollbar.vue.d.ts +2 -2
  335. package/es/components/select/src/select.d.ts +1 -1
  336. package/es/components/select/src/select.vue.d.ts +35 -35
  337. package/es/components/select-v2/src/defaults.d.ts +1 -1
  338. package/es/components/select-v2/src/select.vue.d.ts +30 -30
  339. package/es/components/skeleton/src/skeleton-item.d.ts +1 -1
  340. package/es/components/skeleton/src/skeleton.vue.d.ts +1 -1
  341. package/es/components/slider/src/slider.vue.d.ts +3 -3
  342. package/es/components/space/src/space.d.ts +2 -2
  343. package/es/components/switch/src/switch.vue.d.ts +1 -1
  344. package/es/components/table/src/filter-panel.vue.d.ts +33 -33
  345. package/es/components/table/src/store/helper.d.ts +1 -1
  346. package/es/components/table/src/store/index.d.ts +2 -2
  347. package/es/components/table/src/table-header/index.d.ts +9 -9
  348. package/es/components/table/src/table.vue.d.ts +3 -3
  349. package/es/components/tabs/src/tab-nav.d.ts +1 -1
  350. package/es/components/tabs/src/tabs.d.ts +3 -3
  351. package/es/components/tag/src/tag.d.ts +1 -1
  352. package/es/components/text/src/text.d.ts +1 -1
  353. package/es/components/text/src/text.vue.d.ts +1 -1
  354. package/es/components/time-picker/src/common/picker.vue.d.ts +16 -16
  355. package/es/components/time-picker/src/time-picker.d.ts +16 -16
  356. package/es/components/time-select/src/time-select.vue.d.ts +6 -6
  357. package/es/components/timeline/src/timeline-item.d.ts +1 -1
  358. package/es/components/timeline/src/timeline-item.vue.d.ts +1 -1
  359. package/es/components/tooltip/src/content.vue.d.ts +3 -3
  360. package/es/components/tooltip/src/tooltip.vue.d.ts +3 -3
  361. package/es/components/tour/src/helper.d.ts +0 -1
  362. package/es/components/tour/src/helper.mjs.map +1 -1
  363. package/es/components/tour/src/step.vue.d.ts +1 -1
  364. package/es/components/tour/src/step.vue_vue_type_script_setup_true_lang.mjs +1 -3
  365. package/es/components/tour/src/step.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  366. package/es/components/tour/src/step2.mjs.map +1 -1
  367. package/es/components/tour/src/tour.d.ts +6 -1
  368. package/es/components/tour/src/tour.mjs +1 -4
  369. package/es/components/tour/src/tour.mjs.map +1 -1
  370. package/es/components/tour/src/tour.vue.d.ts +2 -3
  371. package/es/components/tour/src/tour.vue_vue_type_script_setup_true_lang.mjs +21 -9
  372. package/es/components/tour/src/tour.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  373. package/es/components/tour/src/tour2.mjs.map +1 -1
  374. package/es/components/tree/src/tree-node.vue.d.ts +10 -10
  375. package/es/components/tree/src/tree.vue.d.ts +21 -21
  376. package/es/components/tree-select/src/tree-select.vue.d.ts +28 -28
  377. package/es/components/tree-v2/src/composables/useTree.d.ts +2 -2
  378. package/es/components/tree-v2/src/tree-node.vue.d.ts +3 -3
  379. package/es/components/tree-v2/src/tree.vue.d.ts +8 -8
  380. package/es/components/upload/src/upload-content.vue.d.ts +1 -1
  381. package/es/components/upload/src/upload.vue.d.ts +1 -1
  382. package/es/components/virtual-list/src/builders/build-grid.d.ts +1 -1
  383. package/es/components/virtual-list/src/builders/build-list.d.ts +1 -1
  384. package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +1 -1
  385. package/es/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -1
  386. package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +1 -1
  387. package/es/components/virtual-list/src/components/fixed-size-list.d.ts +1 -1
  388. package/es/version.d.ts +1 -1
  389. package/es/version.mjs +1 -1
  390. package/es/version.mjs.map +1 -1
  391. package/lib/components/affix/src/affix.vue.d.ts +1 -1
  392. package/lib/components/alert/src/alert.d.ts +1 -1
  393. package/lib/components/alert/src/alert.vue.d.ts +1 -1
  394. package/lib/components/avatar/src/avatar.d.ts +1 -1
  395. package/lib/components/badge/src/badge.d.ts +1 -1
  396. package/lib/components/button/src/button-group.d.ts +1 -1
  397. package/lib/components/button/src/button-group.vue.d.ts +1 -1
  398. package/lib/components/button/src/button.d.ts +1 -1
  399. package/lib/components/button/src/button.vue.d.ts +3 -3
  400. package/lib/components/button/src/use-button.d.ts +1 -1
  401. package/lib/components/carousel/src/carousel-item.vue.d.ts +1 -1
  402. package/lib/components/cascader/src/cascader.d.ts +1 -1
  403. package/lib/components/cascader/src/cascader.vue.d.ts +9 -9
  404. package/lib/components/cascader-panel/src/index.vue.d.ts +1 -1
  405. package/lib/components/check-tag/src/check-tag.d.ts +1 -1
  406. package/lib/components/checkbox/src/checkbox-button.vue.d.ts +3 -3
  407. package/lib/components/checkbox/src/checkbox-group.vue.d.ts +3 -3
  408. package/lib/components/checkbox/src/checkbox.vue.d.ts +3 -3
  409. package/lib/components/col/src/col.vue.d.ts +1 -1
  410. package/lib/components/color-picker/src/color-picker.vue.d.ts +3 -3
  411. package/lib/components/countdown/src/countdown.vue.d.ts +2 -2
  412. package/lib/components/date-picker/src/date-picker.d.ts +16 -16
  413. package/lib/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
  414. package/lib/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue.d.ts +2 -2
  415. package/lib/components/date-picker-panel/src/date-picker-com/panel-date-range.vue.d.ts +3 -3
  416. package/lib/components/date-picker-panel/src/date-picker-com/panel-month-range.vue.d.ts +2 -2
  417. package/lib/components/date-picker-panel/src/date-picker-com/panel-year-range.vue.d.ts +2 -2
  418. package/lib/components/date-picker-panel/src/date-picker-panel.d.ts +5 -5
  419. package/lib/components/date-picker-panel/src/panel-utils.d.ts +21 -21
  420. package/lib/components/descriptions/src/description-item.d.ts +2 -2
  421. package/lib/components/divider/src/divider.vue.d.ts +1 -1
  422. package/lib/components/drawer/src/drawer.vue.d.ts +1 -1
  423. package/lib/components/dropdown/src/dropdown.d.ts +1 -1
  424. package/lib/components/dropdown/src/dropdown.vue.d.ts +34 -34
  425. package/lib/components/image/src/image.d.ts +1 -1
  426. package/lib/components/image/src/image.vue.d.ts +4 -4
  427. package/lib/components/image-viewer/src/image-viewer.vue.d.ts +1 -1
  428. package/lib/components/input/src/input.vue.d.ts +2 -2
  429. package/lib/components/input-number/src/input-number.vue.d.ts +5 -5
  430. package/lib/components/input-otp/src/input-otp.vue.d.ts +4 -4
  431. package/lib/components/input-tag/src/input-tag.d.ts +1 -1
  432. package/lib/components/input-tag/src/input-tag.vue.d.ts +6 -6
  433. package/lib/components/link/src/link.d.ts +1 -1
  434. package/lib/components/message/src/message.d.ts +1 -1
  435. package/lib/components/message/src/message.vue.d.ts +5 -5
  436. package/lib/components/message-box/src/index.vue.d.ts +20 -20
  437. package/lib/components/notification/src/notification.d.ts +1 -1
  438. package/lib/components/notification/src/notification.vue.d.ts +4 -4
  439. package/lib/components/pagination/src/pagination.d.ts +3 -3
  440. package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
  441. package/lib/components/popconfirm/src/popconfirm.vue.d.ts +1 -1
  442. package/lib/components/popover/src/popover.vue.d.ts +4 -4
  443. package/lib/components/popper/src/content.vue.d.ts +2 -2
  444. package/lib/components/progress/src/progress.vue.d.ts +3 -3
  445. package/lib/components/radio/src/radio-button.vue.d.ts +2 -2
  446. package/lib/components/radio/src/radio-group.vue.d.ts +4 -4
  447. package/lib/components/radio/src/radio.vue.d.ts +2 -2
  448. package/lib/components/result/src/result.d.ts +1 -1
  449. package/lib/components/scrollbar/src/scrollbar.vue.d.ts +2 -2
  450. package/lib/components/select/src/select.d.ts +1 -1
  451. package/lib/components/select/src/select.vue.d.ts +35 -35
  452. package/lib/components/select-v2/src/defaults.d.ts +1 -1
  453. package/lib/components/select-v2/src/select.vue.d.ts +30 -30
  454. package/lib/components/skeleton/src/skeleton-item.d.ts +1 -1
  455. package/lib/components/skeleton/src/skeleton.vue.d.ts +1 -1
  456. package/lib/components/slider/src/slider.vue.d.ts +3 -3
  457. package/lib/components/space/src/space.d.ts +2 -2
  458. package/lib/components/switch/src/switch.vue.d.ts +1 -1
  459. package/lib/components/table/src/filter-panel.vue.d.ts +33 -33
  460. package/lib/components/table/src/store/helper.d.ts +1 -1
  461. package/lib/components/table/src/store/index.d.ts +2 -2
  462. package/lib/components/table/src/table-header/index.d.ts +9 -9
  463. package/lib/components/table/src/table.vue.d.ts +3 -3
  464. package/lib/components/tabs/src/tab-nav.d.ts +1 -1
  465. package/lib/components/tabs/src/tabs.d.ts +3 -3
  466. package/lib/components/tag/src/tag.d.ts +1 -1
  467. package/lib/components/text/src/text.d.ts +1 -1
  468. package/lib/components/text/src/text.vue.d.ts +1 -1
  469. package/lib/components/time-picker/src/common/picker.vue.d.ts +16 -16
  470. package/lib/components/time-picker/src/time-picker.d.ts +16 -16
  471. package/lib/components/time-select/src/time-select.vue.d.ts +6 -6
  472. package/lib/components/timeline/src/timeline-item.d.ts +1 -1
  473. package/lib/components/timeline/src/timeline-item.vue.d.ts +1 -1
  474. package/lib/components/tooltip/src/content.vue.d.ts +3 -3
  475. package/lib/components/tooltip/src/tooltip.vue.d.ts +3 -3
  476. package/lib/components/tour/src/helper.d.ts +0 -1
  477. package/lib/components/tour/src/helper.js.map +1 -1
  478. package/lib/components/tour/src/step.vue.d.ts +1 -1
  479. package/lib/components/tour/src/step.vue_vue_type_script_setup_true_lang.js +1 -3
  480. package/lib/components/tour/src/step.vue_vue_type_script_setup_true_lang.js.map +1 -1
  481. package/lib/components/tour/src/step2.js.map +1 -1
  482. package/lib/components/tour/src/tour.d.ts +6 -1
  483. package/lib/components/tour/src/tour.js +1 -4
  484. package/lib/components/tour/src/tour.js.map +1 -1
  485. package/lib/components/tour/src/tour.vue.d.ts +2 -3
  486. package/lib/components/tour/src/tour.vue_vue_type_script_setup_true_lang.js +20 -8
  487. package/lib/components/tour/src/tour.vue_vue_type_script_setup_true_lang.js.map +1 -1
  488. package/lib/components/tour/src/tour2.js.map +1 -1
  489. package/lib/components/tree/src/tree-node.vue.d.ts +10 -10
  490. package/lib/components/tree/src/tree.vue.d.ts +21 -21
  491. package/lib/components/tree-select/src/tree-select.vue.d.ts +28 -28
  492. package/lib/components/tree-v2/src/composables/useTree.d.ts +2 -2
  493. package/lib/components/tree-v2/src/tree-node.vue.d.ts +3 -3
  494. package/lib/components/tree-v2/src/tree.vue.d.ts +8 -8
  495. package/lib/components/upload/src/upload-content.vue.d.ts +1 -1
  496. package/lib/components/upload/src/upload.vue.d.ts +1 -1
  497. package/lib/components/virtual-list/src/builders/build-grid.d.ts +1 -1
  498. package/lib/components/virtual-list/src/builders/build-list.d.ts +1 -1
  499. package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +1 -1
  500. package/lib/components/virtual-list/src/components/dynamic-size-list.d.ts +1 -1
  501. package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +1 -1
  502. package/lib/components/virtual-list/src/components/fixed-size-list.d.ts +1 -1
  503. package/lib/version.d.ts +1 -1
  504. package/lib/version.js +1 -1
  505. package/lib/version.js.map +1 -1
  506. package/package.json +2 -2
  507. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"helper.mjs","names":["offsetMiddleware","offset"],"sources":["../../../../../../packages/components/tour/src/helper.ts"],"sourcesContent":["import {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n unref,\n watch,\n watchEffect,\n} from 'vue'\nimport {\n arrow,\n autoUpdate,\n computePosition,\n detectOverflow,\n flip,\n offset as offsetMiddleware,\n shift,\n} from '@floating-ui/dom'\nimport {\n isArray,\n isClient,\n isFunction,\n isString,\n keysOf,\n} from '@element-plus/utils'\n\nimport type {\n CSSProperties,\n Component,\n InjectionKey,\n Ref,\n SetupContext,\n} from 'vue'\nimport type { UseNamespaceReturn } from '@element-plus/hooks'\nimport type { PosInfo, TourGap, TourMask } from './types'\nimport type {\n ComputePositionReturn,\n Middleware,\n Placement,\n Strategy,\n VirtualElement,\n} from '@floating-ui/dom'\nimport type { TourStepProps } from './step'\n\nexport const useTarget = (\n target: Ref<\n string | HTMLElement | (() => HTMLElement | null) | null | undefined\n >,\n open: Ref<boolean>,\n gap: Ref<TourGap>,\n mergedMask: Ref<TourMask>,\n scrollIntoViewOptions: Ref<boolean | ScrollIntoViewOptions>\n) => {\n const posInfo: Ref<PosInfo | null> = ref(null)\n\n const getTargetEl = () => {\n let targetEl: HTMLElement | null | undefined\n if (isString(target.value)) {\n targetEl = document.querySelector<HTMLElement>(target.value)\n } else if (isFunction(target.value)) {\n targetEl = target.value()\n } else {\n targetEl = target.value\n }\n return targetEl\n }\n\n const updatePosInfo = () => {\n const targetEl = getTargetEl()\n if (!targetEl || !open.value) {\n posInfo.value = null\n return\n }\n if (!isInViewPort(targetEl)) {\n targetEl.scrollIntoView(scrollIntoViewOptions.value)\n }\n const { left, top, width, height } = targetEl.getBoundingClientRect()\n posInfo.value = {\n left,\n top,\n width,\n height,\n radius: 0,\n }\n }\n\n onMounted(() => {\n watch(\n [open, target],\n () => {\n updatePosInfo()\n },\n {\n immediate: true,\n }\n )\n window.addEventListener('resize', updatePosInfo)\n })\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', updatePosInfo)\n })\n\n const getGapOffset = (index: number) =>\n (isArray(gap.value.offset) ? gap.value.offset[index] : gap.value.offset) ??\n 6\n\n const mergedPosInfo = computed(() => {\n if (!posInfo.value) return posInfo.value\n\n const gapOffsetX = getGapOffset(0)\n const gapOffsetY = getGapOffset(1)\n const gapRadius = gap.value?.radius || 2\n\n return {\n left: posInfo.value.left - gapOffsetX,\n top: posInfo.value.top - gapOffsetY,\n width: posInfo.value.width + gapOffsetX * 2,\n height: posInfo.value.height + gapOffsetY * 2,\n radius: gapRadius,\n }\n })\n\n const triggerTarget = computed(() => {\n const targetEl = getTargetEl()\n if (!mergedMask.value || !targetEl || !window.DOMRect) {\n return targetEl || undefined\n }\n\n return {\n getBoundingClientRect() {\n return window.DOMRect.fromRect({\n width: mergedPosInfo.value?.width || 0,\n height: mergedPosInfo.value?.height || 0,\n x: mergedPosInfo.value?.left || 0,\n y: mergedPosInfo.value?.top || 0,\n })\n },\n }\n })\n\n return {\n mergedPosInfo,\n triggerTarget,\n }\n}\n\nexport interface TourContext {\n currentStep: Ref<TourStepProps | undefined>\n current: Ref<number>\n total: Ref<number>\n showClose: Ref<boolean>\n closeIcon: Ref<string | Component | undefined>\n mergedType: Ref<'default' | 'primary' | undefined>\n ns: UseNamespaceReturn\n slots: SetupContext['slots']\n updateModelValue(modelValue: boolean): void\n onClose(): void\n onFinish(): void\n onChange(): void\n}\n\nexport const tourKey: InjectionKey<TourContext> = Symbol('ElTour')\n\nfunction isInViewPort(element: HTMLElement) {\n const viewWidth = window.innerWidth || document.documentElement.clientWidth\n const viewHeight = window.innerHeight || document.documentElement.clientHeight\n const { top, right, bottom, left } = element.getBoundingClientRect()\n\n return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight\n}\n\nexport const useFloating = (\n referenceRef: Ref<HTMLElement | VirtualElement | null>,\n contentRef: Ref<HTMLElement | null>,\n arrowRef: Ref<HTMLElement | null>,\n placement: Ref<Placement | undefined>,\n strategy: Ref<Strategy>,\n offset: Ref<number>,\n zIndex: Ref<number>,\n showArrow: Ref<boolean>\n) => {\n const x = ref<number>()\n const y = ref<number>()\n const middlewareData = ref<ComputePositionReturn['middlewareData']>({})\n\n const states = {\n x,\n y,\n placement,\n strategy,\n middlewareData,\n } as const\n\n const middleware = computed(() => {\n const _middleware: Middleware[] = [\n offsetMiddleware(unref(offset)),\n flip(),\n shift(),\n overflowMiddleware(),\n ]\n\n if (unref(showArrow) && unref(arrowRef)) {\n _middleware.push(\n arrow({\n element: unref(arrowRef)!,\n })\n )\n }\n return _middleware\n })\n\n const update = async () => {\n if (!isClient) return\n\n const referenceEl = unref(referenceRef)\n const contentEl = unref(contentRef)\n if (!referenceEl || !contentEl) return\n\n const data = await computePosition(referenceEl, contentEl, {\n placement: unref(placement),\n strategy: unref(strategy),\n middleware: unref(middleware),\n })\n\n keysOf(states).forEach((key) => {\n states[key].value = data[key]\n })\n }\n\n const contentStyle = computed<CSSProperties>(() => {\n if (!unref(referenceRef)) {\n return {\n position: 'fixed',\n top: '50%',\n left: '50%',\n transform: 'translate3d(-50%, -50%, 0)',\n maxWidth: '100vw',\n zIndex: unref(zIndex),\n }\n }\n\n const { overflow } = unref(middlewareData)\n\n return {\n position: unref(strategy),\n zIndex: unref(zIndex),\n top: unref(y) != null ? `${unref(y)}px` : '',\n left: unref(x) != null ? `${unref(x)}px` : '',\n maxWidth: overflow?.maxWidth ? `${overflow?.maxWidth}px` : '',\n }\n })\n\n const arrowStyle = computed<CSSProperties>(() => {\n if (!unref(showArrow)) return {}\n\n const { arrow } = unref(middlewareData)\n return {\n left: arrow?.x != null ? `${arrow?.x}px` : '',\n top: arrow?.y != null ? `${arrow?.y}px` : '',\n }\n })\n\n let cleanup: any\n onMounted(() => {\n const referenceEl = unref(referenceRef)\n const contentEl = unref(contentRef)\n if (referenceEl && contentEl) {\n cleanup = autoUpdate(referenceEl, contentEl, update)\n }\n\n watchEffect(() => {\n update()\n })\n })\n\n onBeforeUnmount(() => {\n cleanup && cleanup()\n })\n\n return {\n update,\n contentStyle,\n arrowStyle,\n }\n}\n\nconst overflowMiddleware = (): Middleware => {\n return {\n name: 'overflow',\n async fn(state) {\n const overflow = await detectOverflow(state)\n let overWidth = 0\n if (overflow.left > 0) overWidth = overflow.left\n if (overflow.right > 0) overWidth = overflow.right\n const floatingWidth = state.rects.floating.width\n return {\n data: {\n maxWidth: floatingWidth - overWidth,\n },\n }\n },\n }\n}\n"],"mappings":";;;;;;AA4CA,MAAa,aACX,QAGA,MACA,KACA,YACA,0BACG;CACH,MAAM,UAA+B,IAAI,KAAK;CAE9C,MAAM,oBAAoB;EACxB,IAAI;EACJ,IAAI,SAAS,OAAO,MAAM,EACxB,WAAW,SAAS,cAA2B,OAAO,MAAM;OACvD,IAAI,WAAW,OAAO,MAAM,EACjC,WAAW,OAAO,OAAO;OAEzB,WAAW,OAAO;EAEpB,OAAO;;CAGT,MAAM,sBAAsB;EAC1B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AE,aAAa,MAAM,eAAe;EAE1C,OAAO;GACL,UAAU,MAAM,SAAS;GACzB,QAAQ,MAAM,OAAO;GACrB,KAAK,MAAM,EAAE,IAAI,OAAO,GAAG,MAAM,EAAE,CAAC,MAAM;GAC1C,MAAM,MAAM,EAAE,IAAI,OAAO,GAAG,MAAM,EAAE,CAAC,MAAM;GAC3C,UAAU,UAAU,WAAW,GAAG,UAAU,SAAS,MAAM;GAC5D;GACD;CAEF,MAAM,aAAa,eAA8B;EAC/C,IAAI,CAAC,MAAM,UAAU,EAAE,OAAO,EAAE;EAEhC,MAAM,EAAE,UAAU,MAAM,eAAe;EACvC,OAAO;GACL,MAAM,OAAO,KAAK,OAAO,GAAG,OAAO,EAAE,MAAM;GAC3C,KAAK,OAAO,KAAK,OAAO,GAAG,OAAO,EAAE,MAAM;GAC3C;GACD;CAEF,IAAI;CACJ,gBAAgB;EACd,MAAM,cAAc,MAAM,aAAa;EACvC,MAAM,YAAY,MAAM,WAAW;EACnC,IAAI,eAAe,WACjB,UAAU,WAAW,aAAa,WAAW,OAAO;EAGtD,kBAAkB;GAChB,QAAQ;IACR;GACF;CAEF,sBAAsB;EACpB,WAAW,SAAS;GACpB;CAEF,OAAO;EACL;EACA;EACA;EACD;;AAGH,MAAM,2BAAuC;CAC3C,OAAO;EACL,MAAM;EACN,MAAM,GAAG,OAAO;GACd,MAAM,WAAW,MAAM,eAAe,MAAM;GAC5C,IAAI,YAAY;GAChB,IAAI,SAAS,OAAO,GAAG,YAAY,SAAS;GAC5C,IAAI,SAAS,QAAQ,GAAG,YAAY,SAAS;GAE7C,OAAO,EACL,MAAM,EACJ,UAHkB,MAAM,MAAM,SAAS,QAGb,WAC3B,EACF;;EAEJ"}
1
+ {"version":3,"file":"helper.mjs","names":["offsetMiddleware","offset"],"sources":["../../../../../../packages/components/tour/src/helper.ts"],"sourcesContent":["import {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n unref,\n watch,\n watchEffect,\n} from 'vue'\nimport {\n arrow,\n autoUpdate,\n computePosition,\n detectOverflow,\n flip,\n offset as offsetMiddleware,\n shift,\n} from '@floating-ui/dom'\nimport {\n isArray,\n isClient,\n isFunction,\n isString,\n keysOf,\n} from '@element-plus/utils'\n\nimport type {\n CSSProperties,\n Component,\n InjectionKey,\n Ref,\n SetupContext,\n} from 'vue'\nimport type { UseNamespaceReturn } from '@element-plus/hooks'\nimport type { PosInfo, TourGap, TourMask } from './types'\nimport type {\n ComputePositionReturn,\n Middleware,\n Placement,\n Strategy,\n VirtualElement,\n} from '@floating-ui/dom'\nimport type { TourStepProps } from './step'\n\nexport const useTarget = (\n target: Ref<\n string | HTMLElement | (() => HTMLElement | null) | null | undefined\n >,\n open: Ref<boolean>,\n gap: Ref<TourGap>,\n mergedMask: Ref<TourMask>,\n scrollIntoViewOptions: Ref<boolean | ScrollIntoViewOptions>\n) => {\n const posInfo: Ref<PosInfo | null> = ref(null)\n\n const getTargetEl = () => {\n let targetEl: HTMLElement | null | undefined\n if (isString(target.value)) {\n targetEl = document.querySelector<HTMLElement>(target.value)\n } else if (isFunction(target.value)) {\n targetEl = target.value()\n } else {\n targetEl = target.value\n }\n return targetEl\n }\n\n const updatePosInfo = () => {\n const targetEl = getTargetEl()\n if (!targetEl || !open.value) {\n posInfo.value = null\n return\n }\n if (!isInViewPort(targetEl)) {\n targetEl.scrollIntoView(scrollIntoViewOptions.value)\n }\n const { left, top, width, height } = targetEl.getBoundingClientRect()\n posInfo.value = {\n left,\n top,\n width,\n height,\n radius: 0,\n }\n }\n\n onMounted(() => {\n watch(\n [open, target],\n () => {\n updatePosInfo()\n },\n {\n immediate: true,\n }\n )\n window.addEventListener('resize', updatePosInfo)\n })\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', updatePosInfo)\n })\n\n const getGapOffset = (index: number) =>\n (isArray(gap.value.offset) ? gap.value.offset[index] : gap.value.offset) ??\n 6\n\n const mergedPosInfo = computed(() => {\n if (!posInfo.value) return posInfo.value\n\n const gapOffsetX = getGapOffset(0)\n const gapOffsetY = getGapOffset(1)\n const gapRadius = gap.value?.radius || 2\n\n return {\n left: posInfo.value.left - gapOffsetX,\n top: posInfo.value.top - gapOffsetY,\n width: posInfo.value.width + gapOffsetX * 2,\n height: posInfo.value.height + gapOffsetY * 2,\n radius: gapRadius,\n }\n })\n\n const triggerTarget = computed(() => {\n const targetEl = getTargetEl()\n if (!mergedMask.value || !targetEl || !window.DOMRect) {\n return targetEl || undefined\n }\n\n return {\n getBoundingClientRect() {\n return window.DOMRect.fromRect({\n width: mergedPosInfo.value?.width || 0,\n height: mergedPosInfo.value?.height || 0,\n x: mergedPosInfo.value?.left || 0,\n y: mergedPosInfo.value?.top || 0,\n })\n },\n }\n })\n\n return {\n mergedPosInfo,\n triggerTarget,\n }\n}\n\nexport interface TourContext {\n currentStep: Ref<TourStepProps | undefined>\n current: Ref<number>\n total: Ref<number>\n showClose: Ref<boolean>\n closeIcon: Ref<string | Component | undefined>\n mergedType: Ref<'default' | 'primary' | undefined>\n ns: UseNamespaceReturn\n slots: SetupContext['slots']\n updateModelValue(modelValue: boolean): void\n onClose(): void\n onFinish(): void\n}\n\nexport const tourKey: InjectionKey<TourContext> = Symbol('ElTour')\n\nfunction isInViewPort(element: HTMLElement) {\n const viewWidth = window.innerWidth || document.documentElement.clientWidth\n const viewHeight = window.innerHeight || document.documentElement.clientHeight\n const { top, right, bottom, left } = element.getBoundingClientRect()\n\n return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight\n}\n\nexport const useFloating = (\n referenceRef: Ref<HTMLElement | VirtualElement | null>,\n contentRef: Ref<HTMLElement | null>,\n arrowRef: Ref<HTMLElement | null>,\n placement: Ref<Placement | undefined>,\n strategy: Ref<Strategy>,\n offset: Ref<number>,\n zIndex: Ref<number>,\n showArrow: Ref<boolean>\n) => {\n const x = ref<number>()\n const y = ref<number>()\n const middlewareData = ref<ComputePositionReturn['middlewareData']>({})\n\n const states = {\n x,\n y,\n placement,\n strategy,\n middlewareData,\n } as const\n\n const middleware = computed(() => {\n const _middleware: Middleware[] = [\n offsetMiddleware(unref(offset)),\n flip(),\n shift(),\n overflowMiddleware(),\n ]\n\n if (unref(showArrow) && unref(arrowRef)) {\n _middleware.push(\n arrow({\n element: unref(arrowRef)!,\n })\n )\n }\n return _middleware\n })\n\n const update = async () => {\n if (!isClient) return\n\n const referenceEl = unref(referenceRef)\n const contentEl = unref(contentRef)\n if (!referenceEl || !contentEl) return\n\n const data = await computePosition(referenceEl, contentEl, {\n placement: unref(placement),\n strategy: unref(strategy),\n middleware: unref(middleware),\n })\n\n keysOf(states).forEach((key) => {\n states[key].value = data[key]\n })\n }\n\n const contentStyle = computed<CSSProperties>(() => {\n if (!unref(referenceRef)) {\n return {\n position: 'fixed',\n top: '50%',\n left: '50%',\n transform: 'translate3d(-50%, -50%, 0)',\n maxWidth: '100vw',\n zIndex: unref(zIndex),\n }\n }\n\n const { overflow } = unref(middlewareData)\n\n return {\n position: unref(strategy),\n zIndex: unref(zIndex),\n top: unref(y) != null ? `${unref(y)}px` : '',\n left: unref(x) != null ? `${unref(x)}px` : '',\n maxWidth: overflow?.maxWidth ? `${overflow?.maxWidth}px` : '',\n }\n })\n\n const arrowStyle = computed<CSSProperties>(() => {\n if (!unref(showArrow)) return {}\n\n const { arrow } = unref(middlewareData)\n return {\n left: arrow?.x != null ? `${arrow?.x}px` : '',\n top: arrow?.y != null ? `${arrow?.y}px` : '',\n }\n })\n\n let cleanup: any\n onMounted(() => {\n const referenceEl = unref(referenceRef)\n const contentEl = unref(contentRef)\n if (referenceEl && contentEl) {\n cleanup = autoUpdate(referenceEl, contentEl, update)\n }\n\n watchEffect(() => {\n update()\n })\n })\n\n onBeforeUnmount(() => {\n cleanup && cleanup()\n })\n\n return {\n update,\n contentStyle,\n arrowStyle,\n }\n}\n\nconst overflowMiddleware = (): Middleware => {\n return {\n name: 'overflow',\n async fn(state) {\n const overflow = await detectOverflow(state)\n let overWidth = 0\n if (overflow.left > 0) overWidth = overflow.left\n if (overflow.right > 0) overWidth = overflow.right\n const floatingWidth = state.rects.floating.width\n return {\n data: {\n maxWidth: floatingWidth - overWidth,\n },\n }\n },\n }\n}\n"],"mappings":";;;;;;AA4CA,MAAa,aACX,QAGA,MACA,KACA,YACA,0BACG;CACH,MAAM,UAA+B,IAAI,KAAK;CAE9C,MAAM,oBAAoB;EACxB,IAAI;EACJ,IAAI,SAAS,OAAO,MAAM,EACxB,WAAW,SAAS,cAA2B,OAAO,MAAM;OACvD,IAAI,WAAW,OAAO,MAAM,EACjC,WAAW,OAAO,OAAO;OAEzB,WAAW,OAAO;EAEpB,OAAO;;CAGT,MAAM,sBAAsB;EAC1B,MAAM,WAAW,aAAa;EAC9B,IAAI,CAAC,YAAY,CAAC,KAAK,OAAO;GAC5B,QAAQ,QAAQ;GAChB;;EAEF,IAAI,CAAC,aAAa,SAAS,EACzB,SAAS,eAAe,sBAAsB,MAAM;EAEtD,MAAM,EAAE,MAAM,KAAK,OAAO,WAAW,SAAS,uBAAuB;EACrE,QAAQ,QAAQ;GACd;GACA;GACA;GACA;GACA,QAAQ;GACT;;CAGH,gBAAgB;EACd,MACE,CAAC,MAAM,OAAO,QACR;GACJ,eAAe;KAEjB,EACE,WAAW,MACZ,CACF;EACD,OAAO,iBAAiB,UAAU,cAAc;GAChD;CAEF,sBAAsB;EACpB,OAAO,oBAAoB,UAAU,cAAc;GACnD;CAEF,MAAM,gBAAgB,WACnB,QAAQ,IAAI,MAAM,OAAO,GAAG,IAAI,MAAM,OAAO,SAAS,IAAI,MAAM,WACjE;CAEF,MAAM,gBAAgB,eAAe;EACnC,IAAI,CAAC,QAAQ,OAAO,OAAO,QAAQ;EAEnC,MAAM,aAAa,aAAa,EAAE;EAClC,MAAM,aAAa,aAAa,EAAE;EAClC,MAAM,YAAY,IAAI,OAAO,UAAU;EAEvC,OAAO;GACL,MAAM,QAAQ,MAAM,OAAO;GAC3B,KAAK,QAAQ,MAAM,MAAM;GACzB,OAAO,QAAQ,MAAM,QAAQ,a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,GAAG,OAAO;GACd,MAAM,WAAW,MAAM,eAAe,MAAM;GAC5C,IAAI,YAAY;GAChB,IAAI,SAAS,OAAO,GAAG,YAAY,SAAS;GAC5C,IAAI,SAAS,QAAQ,GAAG,YAAY,SAAS;GAE7C,OAAO,EACL,MAAM,EACJ,UAHkB,MAAM,MAAM,SAAS,QAGb,WAC3B,EACF;;EAEJ"}
@@ -15,10 +15,10 @@ declare const __VLS_base: _$vue.DefineComponent<TourStepProps, {}, {}, {}, {}, _
15
15
  }, string, _$vue.PublicProps, Readonly<TourStepProps> & Readonly<{
16
16
  onClose?: (() => any) | undefined;
17
17
  }>, {
18
- showClose: boolean;
19
18
  placement: _$_floating_ui_dom0.Placement;
20
19
  showArrow: boolean;
21
20
  mask: TourMask;
21
+ showClose: boolean;
22
22
  scrollIntoViewOptions: boolean | ScrollIntoViewOptions;
23
23
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
24
24
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -20,7 +20,7 @@ var step_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
20
20
  const emit = __emit;
21
21
  const { Close } = CloseComponents;
22
22
  const { t } = useLocale();
23
- const { currentStep, current, total, showClose, closeIcon, mergedType, ns, slots: tourSlots, updateModelValue, onClose: tourOnClose, onFinish: tourOnFinish, onChange } = inject(tourKey);
23
+ const { currentStep, current, total, showClose, closeIcon, mergedType, ns, slots: tourSlots, updateModelValue, onClose: tourOnClose, onFinish: tourOnFinish } = inject(tourKey);
24
24
  watch(props, (val) => {
25
25
  currentStep.value = val;
26
26
  }, { immediate: true });
@@ -33,13 +33,11 @@ var step_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
33
33
  const onPrev = () => {
34
34
  current.value -= 1;
35
35
  if (props.prevButtonProps?.onClick) props.prevButtonProps?.onClick();
36
- onChange();
37
36
  };
38
37
  const onNext = () => {
39
38
  if (current.value >= total.value - 1) onFinish();
40
39
  else current.value += 1;
41
40
  if (props.nextButtonProps?.onClick) props.nextButtonProps.onClick();
42
- onChange();
43
41
  };
44
42
  const onFinish = () => {
45
43
  onClose();
@@ -1 +1 @@
1
- {"version":3,"file":"step.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../../../packages/components/tour/src/step.vue"],"sourcesContent":["<template>\n <button\n v-if=\"mergedShowClose\"\n :aria-label=\"t('el.tour.close')\"\n :class=\"ns.e('closebtn')\"\n type=\"button\"\n @click=\"onClose\"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"mergedCloseIcon\" />\n </el-icon>\n </button>\n <header :class=\"[ns.e('header'), { 'show-close': showClose }]\">\n <slot name=\"header\">\n <span role=\"heading\" :class=\"ns.e('title')\">\n {{ title }}\n </span>\n </slot>\n </header>\n <div :class=\"ns.e('body')\">\n <slot>\n <span>{{ description }}</span>\n </slot>\n </div>\n <footer :class=\"ns.e('footer')\">\n <div :class=\"ns.b('indicators')\">\n <component\n :is=\"tourSlots.indicators\"\n v-if=\"tourSlots.indicators\"\n :current=\"current\"\n :total=\"total\"\n />\n <template v-else>\n <span\n v-for=\"(item, index) in total\"\n :key=\"item\"\n :class=\"[ns.b('indicator'), ns.is('active', index === current)]\"\n />\n </template>\n </div>\n <div :class=\"ns.b('buttons')\">\n <el-button\n v-if=\"current > 0\"\n size=\"small\"\n :type=\"mergedType\"\n v-bind=\"filterButtonProps(prevButtonProps)\"\n @click=\"onPrev\"\n >\n {{ prevButtonProps?.children ?? t('el.tour.previous') }}\n </el-button>\n <el-button\n v-if=\"current <= total - 1\"\n size=\"small\"\n :type=\"mergedType === 'primary' ? 'default' : 'primary'\"\n v-bind=\"filterButtonProps(nextButtonProps)\"\n @click=\"onNext\"\n >\n {{\n nextButtonProps?.children ??\n (current === total - 1 ? t('el.tour.finish') : t('el.tour.next'))\n }}\n </el-button>\n </div>\n </footer>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, onMounted, watch } from 'vue'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { omit } from 'lodash-unified'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { CloseComponents, getEventCode } from '@element-plus/utils'\nimport { useLocale } from '@element-plus/hooks'\nimport { tourStepEmits } from './step'\nimport { tourKey } from './helper'\n\nimport type { TourBtnProps } from './types'\nimport type { TourStepProps } from './step'\n\ndefineOptions({\n name: 'ElTourStep',\n})\n\nconst props = withDefaults(defineProps<TourStepProps>(), {\n showClose: undefined,\n showArrow: undefined,\n placement: 'bottom',\n mask: undefined,\n scrollIntoViewOptions: undefined,\n})\nconst emit = defineEmits(tourStepEmits)\n\nconst { Close } = CloseComponents\n\nconst { t } = useLocale()\n\nconst {\n currentStep,\n current,\n total,\n showClose,\n closeIcon,\n mergedType,\n ns,\n slots: tourSlots,\n updateModelValue,\n onClose: tourOnClose,\n onFinish: tourOnFinish,\n onChange,\n} = inject(tourKey)!\n\nwatch(\n props,\n (val) => {\n currentStep.value = val\n },\n {\n immediate: true,\n }\n)\n\nconst mergedShowClose = computed(() => props.showClose ?? showClose.value)\nconst mergedCloseIcon = computed(\n () => props.closeIcon ?? closeIcon.value ?? Close\n)\n\nconst filterButtonProps = (btnProps?: TourBtnProps) => {\n if (!btnProps) return\n return omit(btnProps, ['children', 'onClick'])\n}\n\nconst onPrev = () => {\n current.value -= 1\n if (props.prevButtonProps?.onClick) {\n props.prevButtonProps?.onClick()\n }\n onChange()\n}\n\nconst onNext = () => {\n if (current.value >= total.value - 1) {\n onFinish()\n } else {\n current.value += 1\n }\n if (props.nextButtonProps?.onClick) {\n props.nextButtonProps.onClick()\n }\n onChange()\n}\n\nconst onFinish = () => {\n onClose()\n tourOnFinish()\n}\n\nconst onClose = () => {\n updateModelValue(false)\n tourOnClose()\n emit('close')\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement | null\n if (target?.isContentEditable) return\n const code = getEventCode(e)\n\n switch (code) {\n case EVENT_CODE.left:\n e.preventDefault()\n current.value > 0 && onPrev()\n break\n case EVENT_CODE.right:\n e.preventDefault()\n onNext()\n break\n }\n}\n\nonMounted(() => {\n window.addEventListener('keydown', handleKeydown)\n})\n\nonBeforeUnmount(() => {\n window.removeEventListener('keydown', handleKeydown)\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAoFA,MAAM,QAAQ;EAOd,MAAM,OAAO;EAEb,MAAM,EAAE,UAAU;EAElB,MAAM,EAAE,MAAM,WAAU;EAExB,MAAM,EACJ,aACA,SACA,OACA,WACA,WACA,YACA,IACA,OAAO,WACP,kBACA,SAAS,aACT,UAAU,cACV,aACE,OAAO,QAAQ;EAEnB,MACE,QACC,QAAQ;GACP,YAAY,QAAQ;KAEtB,EACE,WAAW,MACb,CACF;EAEA,MAAM,kBAAkB,eAAe,MAAM,aAAa,UAAU,MAAK;EACzE,MAAM,kBAAkB,eAChB,MAAM,aAAa,UAAU,SAAS,MAC9C;EAEA,MAAM,qBAAqB,aAA4B;GACrD,IAAI,CAAC,UAAU;GACf,OAAO,KAAK,UAAU,CAAC,YAAY,UAAU,CAAA;;EAG/C,MAAM,eAAe;GACnB,QAAQ,SAAS;GACjB,IAAI,MAAM,iBAAiB,SACzB,MAAM,iBAAiB,SAAQ;GAEjC,UAAS;;EAGX,MAAM,eAAe;GACnB,IAAI,QAAQ,SAAS,MAAM,QAAQ,GACjC,UAAS;QAET,QAAQ,SAAS;GAEnB,IAAI,MAAM,iBAAiB,SACzB,MAAM,gBAAgB,SAAQ;GAEhC,UAAS;;EAGX,MAAM,iBAAiB;GACrB,SAAQ;GACR,cAAa;;EAGf,MAAM,gBAAgB;GACpB,iBAAiB,MAAK;GACtB,aAAY;GACZ,KAAK,QAAO;;EAGd,MAAM,iBAAiB,MAAqB;GAE1C,IADe,EAAE,QACL,mBAAmB;GAG/B,QAFa,aAAa,EAEd,EAAZ;IACE,KAAK,WAAW;KACd,EAAE,gBAAe;KACjB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AA,CAGP,MAAA,UAAS,CAAC,cAAA,WAAA,EAFlB,YAKE,wBAJK,MAAA,UAAS,CAAC,WAAU,EAAA;;KAExB,SAAS,MAAA,QAAO;KAChB,OAAO,MAAA,MAAA;2DAGR,mBAIE,UAAA,EAAA,KAAA,GAAA,EAAA,WAHwB,MAAA,MAAK,GAArB,MAAM,UAAK;yBADrB,mBAIE,QAAA;MAFC,KAAK;MACL,OAAK,eAAA,CAAG,MAAA,GAAE,CAAC,EAAC,YAAA,EAAe,MAAA,GAAE,CAAC,GAAE,UAAW,UAAU,MAAA,QAAO,CAAA,CAAA,CAAA;;oBAInE,mBAsBM,OAAA,EAtBA,OAAK,eAAE,MAAA,GAAE,CAAC,EAAC,UAAA,CAAA,EAAA,EAAA,CAEP,MAAA,QAAO,GAAA,KAAA,WAAA,EADf,YAQY,MAAA,SAAA,EARZ,WAQY;;KANV,MAAK;KACJ,MAAM,MAAA,WAAA;OACC,kBAAkB,QAAA,gBAAe,EAAA,EACxC,SAAO,QAAM,CAAA,EAAA;4BAE0C,CAAA,gBAAA,gBAArD,QAAA,iBAAiB,YAAY,MAAA,EAAC,CAAA,mBAAA,CAAA,EAAA,EAAA,CAAA,CAAA;;0DAG3B,MAAA,QAAO,IAAI,MAAA,MAAK,GAAA,KAAA,WAAA,EADxB,YAWY,MAAA,SAAA,EAXZ,WAWY;;KATV,MAAK;KACJ,MAAM,MAAA,WAAU,KAAA,YAAA,YAAA;OACT,kBAAkB,QAAA,gBAAe,EAAA,EACxC,SAAO,QAAM,CAAA,EAAA;4BAKZ,CAAA,gBAAA,gBAFA,QAAA,iBAAiB,aAAuB,MAAA,QAAO,KAAK,MAAA,MAAK,GAAA,IAAO,MAAA,EAAC,CAAA,iBAAA,GAAqB,MAAA,EAAC,CAAA,eAAA,EAAA,EAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"step.vue_vue_type_script_setup_true_lang.mjs","names":[],"sources":["../../../../../../packages/components/tour/src/step.vue"],"sourcesContent":["<template>\n <button\n v-if=\"mergedShowClose\"\n :aria-label=\"t('el.tour.close')\"\n :class=\"ns.e('closebtn')\"\n type=\"button\"\n @click=\"onClose\"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"mergedCloseIcon\" />\n </el-icon>\n </button>\n <header :class=\"[ns.e('header'), { 'show-close': showClose }]\">\n <slot name=\"header\">\n <span role=\"heading\" :class=\"ns.e('title')\">\n {{ title }}\n </span>\n </slot>\n </header>\n <div :class=\"ns.e('body')\">\n <slot>\n <span>{{ description }}</span>\n </slot>\n </div>\n <footer :class=\"ns.e('footer')\">\n <div :class=\"ns.b('indicators')\">\n <component\n :is=\"tourSlots.indicators\"\n v-if=\"tourSlots.indicators\"\n :current=\"current\"\n :total=\"total\"\n />\n <template v-else>\n <span\n v-for=\"(item, index) in total\"\n :key=\"item\"\n :class=\"[ns.b('indicator'), ns.is('active', index === current)]\"\n />\n </template>\n </div>\n <div :class=\"ns.b('buttons')\">\n <el-button\n v-if=\"current > 0\"\n size=\"small\"\n :type=\"mergedType\"\n v-bind=\"filterButtonProps(prevButtonProps)\"\n @click=\"onPrev\"\n >\n {{ prevButtonProps?.children ?? t('el.tour.previous') }}\n </el-button>\n <el-button\n v-if=\"current <= total - 1\"\n size=\"small\"\n :type=\"mergedType === 'primary' ? 'default' : 'primary'\"\n v-bind=\"filterButtonProps(nextButtonProps)\"\n @click=\"onNext\"\n >\n {{\n nextButtonProps?.children ??\n (current === total - 1 ? t('el.tour.finish') : t('el.tour.next'))\n }}\n </el-button>\n </div>\n </footer>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, onMounted, watch } from 'vue'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { omit } from 'lodash-unified'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { CloseComponents, getEventCode } from '@element-plus/utils'\nimport { useLocale } from '@element-plus/hooks'\nimport { tourStepEmits } from './step'\nimport { tourKey } from './helper'\n\nimport type { TourBtnProps } from './types'\nimport type { TourStepProps } from './step'\n\ndefineOptions({\n name: 'ElTourStep',\n})\n\nconst props = withDefaults(defineProps<TourStepProps>(), {\n showClose: undefined,\n showArrow: undefined,\n placement: 'bottom',\n mask: undefined,\n scrollIntoViewOptions: undefined,\n})\nconst emit = defineEmits(tourStepEmits)\n\nconst { Close } = CloseComponents\n\nconst { t } = useLocale()\n\nconst {\n currentStep,\n current,\n total,\n showClose,\n closeIcon,\n mergedType,\n ns,\n slots: tourSlots,\n updateModelValue,\n onClose: tourOnClose,\n onFinish: tourOnFinish,\n} = inject(tourKey)!\n\nwatch(\n props,\n (val) => {\n currentStep.value = val\n },\n {\n immediate: true,\n }\n)\n\nconst mergedShowClose = computed(() => props.showClose ?? showClose.value)\nconst mergedCloseIcon = computed(\n () => props.closeIcon ?? closeIcon.value ?? Close\n)\n\nconst filterButtonProps = (btnProps?: TourBtnProps) => {\n if (!btnProps) return\n return omit(btnProps, ['children', 'onClick'])\n}\n\nconst onPrev = () => {\n current.value -= 1\n if (props.prevButtonProps?.onClick) {\n props.prevButtonProps?.onClick()\n }\n}\n\nconst onNext = () => {\n if (current.value >= total.value - 1) {\n onFinish()\n } else {\n current.value += 1\n }\n if (props.nextButtonProps?.onClick) {\n props.nextButtonProps.onClick()\n }\n}\n\nconst onFinish = () => {\n onClose()\n tourOnFinish()\n}\n\nconst onClose = () => {\n updateModelValue(false)\n tourOnClose()\n emit('close')\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement | null\n if (target?.isContentEditable) return\n const code = getEventCode(e)\n\n switch (code) {\n case EVENT_CODE.left:\n e.preventDefault()\n current.value > 0 && onPrev()\n break\n case EVENT_CODE.right:\n e.preventDefault()\n onNext()\n break\n }\n}\n\nonMounted(() => {\n window.addEventListener('keydown', handleKeydown)\n})\n\nonBeforeUnmount(() => {\n window.removeEventListener('keydown', handleKeydown)\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAo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G,MAAA,GAAE,CAAC,EAAC,YAAA,EAAe,MAAA,GAAE,CAAC,GAAE,UAAW,UAAU,MAAA,QAAO,CAAA,CAAA,CAAA;;oBAInE,mBAsBM,OAAA,EAtBA,OAAK,eAAE,MAAA,GAAE,CAAC,EAAC,UAAA,CAAA,EAAA,EAAA,CAEP,MAAA,QAAO,GAAA,KAAA,WAAA,EADf,YAQY,MAAA,SAAA,EARZ,WAQY;;KANV,MAAK;KACJ,MAAM,MAAA,WAAA;OACC,kBAAkB,QAAA,gBAAe,EAAA,EACxC,SAAO,QAAM,CAAA,EAAA;4BAE0C,CAAA,gBAAA,gBAArD,QAAA,iBAAiB,YAAY,MAAA,EAAC,CAAA,mBAAA,CAAA,EAAA,EAAA,CAAA,CAAA;;0DAG3B,MAAA,QAAO,IAAI,MAAA,MAAK,GAAA,KAAA,WAAA,EADxB,YAWY,MAAA,SAAA,EAXZ,WAWY;;KATV,MAAK;KACJ,MAAM,MAAA,WAAU,KAAA,YAAA,YAAA;OACT,kBAAkB,QAAA,gBAAe,EAAA,EACxC,SAAO,QAAM,CAAA,EAAA;4BAKZ,CAAA,gBAAA,gBAFA,QAAA,iBAAiB,aAAuB,MAAA,QAAO,KAAK,MAAA,MAAK,GAAA,IAAO,MAAA,EAAC,CAAA,iBAAA,GAAqB,MAAA,EAAC,CAAA,eAAA,EAAA,EAAA,EAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"step2.mjs","names":[],"sources":["../../../../../../packages/components/tour/src/step.vue"],"sourcesContent":["<template>\n <button\n v-if=\"mergedShowClose\"\n :aria-label=\"t('el.tour.close')\"\n :class=\"ns.e('closebtn')\"\n type=\"button\"\n @click=\"onClose\"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"mergedCloseIcon\" />\n </el-icon>\n </button>\n <header :class=\"[ns.e('header'), { 'show-close': showClose }]\">\n <slot name=\"header\">\n <span role=\"heading\" :class=\"ns.e('title')\">\n {{ title }}\n </span>\n </slot>\n </header>\n <div :class=\"ns.e('body')\">\n <slot>\n <span>{{ description }}</span>\n </slot>\n </div>\n <footer :class=\"ns.e('footer')\">\n <div :class=\"ns.b('indicators')\">\n <component\n :is=\"tourSlots.indicators\"\n v-if=\"tourSlots.indicators\"\n :current=\"current\"\n :total=\"total\"\n />\n <template v-else>\n <span\n v-for=\"(item, index) in total\"\n :key=\"item\"\n :class=\"[ns.b('indicator'), ns.is('active', index === current)]\"\n />\n </template>\n </div>\n <div :class=\"ns.b('buttons')\">\n <el-button\n v-if=\"current > 0\"\n size=\"small\"\n :type=\"mergedType\"\n v-bind=\"filterButtonProps(prevButtonProps)\"\n @click=\"onPrev\"\n >\n {{ prevButtonProps?.children ?? t('el.tour.previous') }}\n </el-button>\n <el-button\n v-if=\"current <= total - 1\"\n size=\"small\"\n :type=\"mergedType === 'primary' ? 'default' : 'primary'\"\n v-bind=\"filterButtonProps(nextButtonProps)\"\n @click=\"onNext\"\n >\n {{\n nextButtonProps?.children ??\n (current === total - 1 ? t('el.tour.finish') : t('el.tour.next'))\n }}\n </el-button>\n </div>\n </footer>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, onMounted, watch } from 'vue'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { omit } from 'lodash-unified'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { CloseComponents, getEventCode } from '@element-plus/utils'\nimport { useLocale } from '@element-plus/hooks'\nimport { tourStepEmits } from './step'\nimport { tourKey } from './helper'\n\nimport type { TourBtnProps } from './types'\nimport type { TourStepProps } from './step'\n\ndefineOptions({\n name: 'ElTourStep',\n})\n\nconst props = withDefaults(defineProps<TourStepProps>(), {\n showClose: undefined,\n showArrow: undefined,\n placement: 'bottom',\n mask: undefined,\n scrollIntoViewOptions: undefined,\n})\nconst emit = defineEmits(tourStepEmits)\n\nconst { Close } = CloseComponents\n\nconst { t } = useLocale()\n\nconst {\n currentStep,\n current,\n total,\n showClose,\n closeIcon,\n mergedType,\n ns,\n slots: tourSlots,\n updateModelValue,\n onClose: tourOnClose,\n onFinish: tourOnFinish,\n onChange,\n} = inject(tourKey)!\n\nwatch(\n props,\n (val) => {\n currentStep.value = val\n },\n {\n immediate: true,\n }\n)\n\nconst mergedShowClose = computed(() => props.showClose ?? showClose.value)\nconst mergedCloseIcon = computed(\n () => props.closeIcon ?? closeIcon.value ?? Close\n)\n\nconst filterButtonProps = (btnProps?: TourBtnProps) => {\n if (!btnProps) return\n return omit(btnProps, ['children', 'onClick'])\n}\n\nconst onPrev = () => {\n current.value -= 1\n if (props.prevButtonProps?.onClick) {\n props.prevButtonProps?.onClick()\n }\n onChange()\n}\n\nconst onNext = () => {\n if (current.value >= total.value - 1) {\n onFinish()\n } else {\n current.value += 1\n }\n if (props.nextButtonProps?.onClick) {\n props.nextButtonProps.onClick()\n }\n onChange()\n}\n\nconst onFinish = () => {\n onClose()\n tourOnFinish()\n}\n\nconst onClose = () => {\n updateModelValue(false)\n tourOnClose()\n emit('close')\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement | null\n if (target?.isContentEditable) return\n const code = getEventCode(e)\n\n switch (code) {\n case EVENT_CODE.left:\n e.preventDefault()\n current.value > 0 && onPrev()\n break\n case EVENT_CODE.right:\n e.preventDefault()\n onNext()\n break\n }\n}\n\nonMounted(() => {\n window.addEventListener('keydown', handleKeydown)\n})\n\nonBeforeUnmount(() => {\n window.removeEventListener('keydown', handleKeydown)\n})\n</script>\n"],"mappings":""}
1
+ {"version":3,"file":"step2.mjs","names":[],"sources":["../../../../../../packages/components/tour/src/step.vue"],"sourcesContent":["<template>\n <button\n v-if=\"mergedShowClose\"\n :aria-label=\"t('el.tour.close')\"\n :class=\"ns.e('closebtn')\"\n type=\"button\"\n @click=\"onClose\"\n >\n <el-icon :class=\"ns.e('close')\">\n <component :is=\"mergedCloseIcon\" />\n </el-icon>\n </button>\n <header :class=\"[ns.e('header'), { 'show-close': showClose }]\">\n <slot name=\"header\">\n <span role=\"heading\" :class=\"ns.e('title')\">\n {{ title }}\n </span>\n </slot>\n </header>\n <div :class=\"ns.e('body')\">\n <slot>\n <span>{{ description }}</span>\n </slot>\n </div>\n <footer :class=\"ns.e('footer')\">\n <div :class=\"ns.b('indicators')\">\n <component\n :is=\"tourSlots.indicators\"\n v-if=\"tourSlots.indicators\"\n :current=\"current\"\n :total=\"total\"\n />\n <template v-else>\n <span\n v-for=\"(item, index) in total\"\n :key=\"item\"\n :class=\"[ns.b('indicator'), ns.is('active', index === current)]\"\n />\n </template>\n </div>\n <div :class=\"ns.b('buttons')\">\n <el-button\n v-if=\"current > 0\"\n size=\"small\"\n :type=\"mergedType\"\n v-bind=\"filterButtonProps(prevButtonProps)\"\n @click=\"onPrev\"\n >\n {{ prevButtonProps?.children ?? t('el.tour.previous') }}\n </el-button>\n <el-button\n v-if=\"current <= total - 1\"\n size=\"small\"\n :type=\"mergedType === 'primary' ? 'default' : 'primary'\"\n v-bind=\"filterButtonProps(nextButtonProps)\"\n @click=\"onNext\"\n >\n {{\n nextButtonProps?.children ??\n (current === total - 1 ? t('el.tour.finish') : t('el.tour.next'))\n }}\n </el-button>\n </div>\n </footer>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, onBeforeUnmount, onMounted, watch } from 'vue'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { omit } from 'lodash-unified'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { CloseComponents, getEventCode } from '@element-plus/utils'\nimport { useLocale } from '@element-plus/hooks'\nimport { tourStepEmits } from './step'\nimport { tourKey } from './helper'\n\nimport type { TourBtnProps } from './types'\nimport type { TourStepProps } from './step'\n\ndefineOptions({\n name: 'ElTourStep',\n})\n\nconst props = withDefaults(defineProps<TourStepProps>(), {\n showClose: undefined,\n showArrow: undefined,\n placement: 'bottom',\n mask: undefined,\n scrollIntoViewOptions: undefined,\n})\nconst emit = defineEmits(tourStepEmits)\n\nconst { Close } = CloseComponents\n\nconst { t } = useLocale()\n\nconst {\n currentStep,\n current,\n total,\n showClose,\n closeIcon,\n mergedType,\n ns,\n slots: tourSlots,\n updateModelValue,\n onClose: tourOnClose,\n onFinish: tourOnFinish,\n} = inject(tourKey)!\n\nwatch(\n props,\n (val) => {\n currentStep.value = val\n },\n {\n immediate: true,\n }\n)\n\nconst mergedShowClose = computed(() => props.showClose ?? showClose.value)\nconst mergedCloseIcon = computed(\n () => props.closeIcon ?? closeIcon.value ?? Close\n)\n\nconst filterButtonProps = (btnProps?: TourBtnProps) => {\n if (!btnProps) return\n return omit(btnProps, ['children', 'onClick'])\n}\n\nconst onPrev = () => {\n current.value -= 1\n if (props.prevButtonProps?.onClick) {\n props.prevButtonProps?.onClick()\n }\n}\n\nconst onNext = () => {\n if (current.value >= total.value - 1) {\n onFinish()\n } else {\n current.value += 1\n }\n if (props.nextButtonProps?.onClick) {\n props.nextButtonProps.onClick()\n }\n}\n\nconst onFinish = () => {\n onClose()\n tourOnFinish()\n}\n\nconst onClose = () => {\n updateModelValue(false)\n tourOnClose()\n emit('close')\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n const target = e.target as HTMLElement | null\n if (target?.isContentEditable) return\n const code = getEventCode(e)\n\n switch (code) {\n case EVENT_CODE.left:\n e.preventDefault()\n current.value > 0 && onPrev()\n break\n case EVENT_CODE.right:\n e.preventDefault()\n onNext()\n break\n }\n}\n\nonMounted(() => {\n window.addEventListener('keydown', handleKeydown)\n})\n\nonBeforeUnmount(() => {\n window.removeEventListener('keydown', handleKeydown)\n})\n</script>\n"],"mappings":""}
@@ -75,7 +75,12 @@ interface TourProps {
75
75
  */
76
76
  declare const tourProps: {
77
77
  modelValue: BooleanConstructor;
78
- current: EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
78
+ current: {
79
+ readonly type: _$vue.PropType<number>;
80
+ readonly required: false;
81
+ readonly validator: ((val: unknown) => boolean) | undefined;
82
+ __epPropKey: true;
83
+ };
79
84
  showArrow: EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
80
85
  showClose: EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
81
86
  closeIcon: {
@@ -15,10 +15,7 @@ const tourProps = buildProps({
15
15
  /**
16
16
  * @description what is the current step
17
17
  */
18
- current: {
19
- type: Number,
20
- default: 0
21
- },
18
+ current: { type: Number },
22
19
  /**
23
20
  * @description whether to show the arrow
24
21
  */
@@ -1 +1 @@
1
- {"version":3,"file":"tour.mjs","names":[],"sources":["../../../../../../packages/components/tour/src/tour.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { tourContentProps } from './content'\n\nimport type { TourContentProps } from './content'\nimport type { CSSProperties, ExtractPublicPropTypes } from 'vue'\nimport type { IconPropType } from '@element-plus/utils'\nimport type Tour from './tour.vue'\nimport type { TourGap, TourMask } from './types'\n\nexport interface TourProps {\n /**\n * @description open tour\n */\n modelValue?: boolean\n /**\n * @description what is the current step\n */\n current?: number\n /**\n * @description whether to show the arrow\n */\n showArrow?: boolean\n /**\n * @description whether to show a close button\n */\n showClose?: boolean\n /**\n * @description custom close icon\n */\n closeIcon?: IconPropType\n /**\n * @description position of the guide card relative to the target element\n */\n placement?: TourContentProps['placement']\n /**\n * @description custom style for content\n */\n contentStyle?: CSSProperties\n /**\n * @description whether to enable masking, change mask style and fill color by pass custom props\n */\n mask?: TourMask\n /**\n * @description transparent gap between mask and target\n */\n gap?: TourGap\n /**\n * @description tour's zIndex\n */\n zIndex?: number\n /**\n * @description support pass custom scrollIntoView options\n */\n scrollIntoViewOptions?: boolean | ScrollIntoViewOptions\n /**\n * @description type, affects the background color and text color\n */\n type?: 'default' | 'primary'\n /**\n * @description which element the TourContent appends to\n */\n appendTo?: string | HTMLElement\n /**\n * @description whether the Tour can be closed by pressing ESC\n */\n closeOnPressEscape?: boolean\n /**\n * @description whether the target element can be clickable, when using mask\n */\n targetAreaClickable?: boolean\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `TourProps` instead.\n */\nexport const tourProps = buildProps({\n /**\n * @description open tour\n */\n modelValue: Boolean,\n /**\n * @description what is the current step\n */\n current: {\n type: Number,\n default: 0,\n },\n /**\n * @description whether to show the arrow\n */\n showArrow: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to show a close button\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n /**\n * @description custom close icon\n */\n closeIcon: {\n type: iconPropType,\n },\n /**\n * @description position of the guide card relative to the target element\n */\n placement: tourContentProps.placement,\n /**\n * @description custom style for content\n */\n contentStyle: {\n type: definePropType<CSSProperties>([Object]),\n },\n /**\n * @description whether to enable masking, change mask style and fill color by pass custom props\n */\n mask: {\n type: definePropType<TourMask>([Boolean, Object]),\n default: true,\n },\n /**\n * @description transparent gap between mask and target\n */\n gap: {\n type: definePropType<TourGap>(Object),\n default: () => ({\n offset: 6,\n radius: 2,\n }),\n },\n /**\n * @description tour's zIndex\n */\n zIndex: {\n type: Number,\n },\n /**\n * @description support pass custom scrollIntoView options\n */\n scrollIntoViewOptions: {\n type: definePropType<boolean | ScrollIntoViewOptions>([Boolean, Object]),\n default: () => ({\n block: 'center',\n }),\n },\n /**\n * @description type, affects the background color and text color\n */\n type: {\n type: definePropType<'default' | 'primary'>(String),\n },\n /**\n * @description which element the TourContent appends to\n */\n appendTo: {\n type: definePropType<string | HTMLElement>([String, Object]),\n default: 'body',\n },\n /**\n * @description whether the Tour can be closed by pressing ESC\n */\n closeOnPressEscape: {\n type: Boolean,\n default: true,\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\n/**\n * @deprecated Removed after 3.0.0, Use `TourProps` instead.\n */\nexport type TourPropsPublic = ExtractPublicPropTypes<typeof tourProps>\nexport type TourInstance = InstanceType<typeof Tour> & unknown\n\nexport const tourEmits = {\n [UPDATE_MODEL_EVENT]: (value: boolean) => isBoolean(value),\n ['update:current']: (current: number) => isNumber(current),\n close: (current: number) => isNumber(current),\n finish: () => true,\n change: (current: number) => isNumber(current),\n}\nexport type TourEmits = typeof tourEmits\n"],"mappings":";;;;;;;;;AAkFA,MAAa,YAAY,WAAW;;;;CAIlC,YAAY;;;;CAIZ,SAAS;EACP,MAAM;EACN,SAAS;EACV;;;;CAID,WAAW;EACT,MAAM;EACN,SAAS;EACV;;;;CAID,WAAW;EACT,MAAM;EACN,SAAS;EACV;;;;CAID,WAAW,EACT,MAAM,cACP;;;;CAID,WAAW,iBAAiB;;;;CAI5B,cAAc,EACZ,MAAM,eAA8B,CAAC,OAAO,CAAC,EAC9C;;;;CAID,MAAM;EACJ,MAAM,eAAyB,CAAC,SAAS,OAAO,CAAC;EACjD,SAAS;EACV;;;;CAID,KAAK;EACH,MAAM,eAAwB,OAAO;EACrC,gBAAgB;GACd,QAAQ;GACR,QAAQ;GACT;EACF;;;;CAID,QAAQ,EACN,MAAM,QACP;;;;CAID,uBAAuB;EACrB,MAAM,eAAgD,CAAC,SAAS,OAAO,CAAC;EACxE,gBAAgB,EACd,OAAO,UACR;EACF;;;;CAID,MAAM,EACJ,MAAM,eAAsC,OAAO,EACpD;;;;CAID,UAAU;EACR,MAAM,eAAqC,CAAC,QAAQ,OAAO,CAAC;EAC5D,SAAS;EACV;;;;CAID,oBAAoB;EAClB,MAAM;EACN,SAAS;EACV;;;;CAID,qBAAqB;EACnB,MAAM;EACN,SAAS;EACV;CACF,CAAC;AAQF,MAAa,YAAY;EACtB,sBAAsB,UAAmB,UAAU,MAAM;EACzD,oBAAoB,YAAoB,SAAS,QAAQ;CAC1D,QAAQ,YAAoB,SAAS,QAAQ;CAC7C,cAAc;CACd,SAAS,YAAoB,SAAS,QAAQ;CAC/C"}
1
+ {"version":3,"file":"tour.mjs","names":[],"sources":["../../../../../../packages/components/tour/src/tour.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { tourContentProps } from './content'\n\nimport type { TourContentProps } from './content'\nimport type { CSSProperties, ExtractPublicPropTypes } from 'vue'\nimport type { IconPropType } from '@element-plus/utils'\nimport type Tour from './tour.vue'\nimport type { TourGap, TourMask } from './types'\n\nexport interface TourProps {\n /**\n * @description open tour\n */\n modelValue?: boolean\n /**\n * @description what is the current step\n */\n current?: number\n /**\n * @description whether to show the arrow\n */\n showArrow?: boolean\n /**\n * @description whether to show a close button\n */\n showClose?: boolean\n /**\n * @description custom close icon\n */\n closeIcon?: IconPropType\n /**\n * @description position of the guide card relative to the target element\n */\n placement?: TourContentProps['placement']\n /**\n * @description custom style for content\n */\n contentStyle?: CSSProperties\n /**\n * @description whether to enable masking, change mask style and fill color by pass custom props\n */\n mask?: TourMask\n /**\n * @description transparent gap between mask and target\n */\n gap?: TourGap\n /**\n * @description tour's zIndex\n */\n zIndex?: number\n /**\n * @description support pass custom scrollIntoView options\n */\n scrollIntoViewOptions?: boolean | ScrollIntoViewOptions\n /**\n * @description type, affects the background color and text color\n */\n type?: 'default' | 'primary'\n /**\n * @description which element the TourContent appends to\n */\n appendTo?: string | HTMLElement\n /**\n * @description whether the Tour can be closed by pressing ESC\n */\n closeOnPressEscape?: boolean\n /**\n * @description whether the target element can be clickable, when using mask\n */\n targetAreaClickable?: boolean\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `TourProps` instead.\n */\nexport const tourProps = buildProps({\n /**\n * @description open tour\n */\n modelValue: Boolean,\n /**\n * @description what is the current step\n */\n current: {\n type: Number,\n },\n /**\n * @description whether to show the arrow\n */\n showArrow: {\n type: Boolean,\n default: true,\n },\n /**\n * @description whether to show a close button\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n /**\n * @description custom close icon\n */\n closeIcon: {\n type: iconPropType,\n },\n /**\n * @description position of the guide card relative to the target element\n */\n placement: tourContentProps.placement,\n /**\n * @description custom style for content\n */\n contentStyle: {\n type: definePropType<CSSProperties>([Object]),\n },\n /**\n * @description whether to enable masking, change mask style and fill color by pass custom props\n */\n mask: {\n type: definePropType<TourMask>([Boolean, Object]),\n default: true,\n },\n /**\n * @description transparent gap between mask and target\n */\n gap: {\n type: definePropType<TourGap>(Object),\n default: () => ({\n offset: 6,\n radius: 2,\n }),\n },\n /**\n * @description tour's zIndex\n */\n zIndex: {\n type: Number,\n },\n /**\n * @description support pass custom scrollIntoView options\n */\n scrollIntoViewOptions: {\n type: definePropType<boolean | ScrollIntoViewOptions>([Boolean, Object]),\n default: () => ({\n block: 'center',\n }),\n },\n /**\n * @description type, affects the background color and text color\n */\n type: {\n type: definePropType<'default' | 'primary'>(String),\n },\n /**\n * @description which element the TourContent appends to\n */\n appendTo: {\n type: definePropType<string | HTMLElement>([String, Object]),\n default: 'body',\n },\n /**\n * @description whether the Tour can be closed by pressing ESC\n */\n closeOnPressEscape: {\n type: Boolean,\n default: true,\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\n/**\n * @deprecated Removed after 3.0.0, Use `TourProps` instead.\n */\nexport type TourPropsPublic = ExtractPublicPropTypes<typeof tourProps>\nexport type TourInstance = InstanceType<typeof Tour> & unknown\n\nexport const tourEmits = {\n [UPDATE_MODEL_EVENT]: (value: boolean) => isBoolean(value),\n ['update:current']: (current: number) => isNumber(current),\n close: (current: number) => isNumber(current),\n finish: () => true,\n change: (current: number) => isNumber(current),\n}\nexport type TourEmits = typeof tourEmits\n"],"mappings":";;;;;;;;;AAkFA,MAAa,YAAY,WAAW;;;;CAIlC,YAAY;;;;CAIZ,SAAS,EACP,MAAM,QACP;;;;CAID,WAAW;EACT,MAAM;EACN,SAAS;EACV;;;;CAID,WAAW;EACT,MAAM;EACN,SAAS;EACV;;;;CAID,WAAW,EACT,MAAM,cACP;;;;CAID,WAAW,iBAAiB;;;;CAI5B,cAAc,EACZ,MAAM,eAA8B,CAAC,OAAO,CAAC,EAC9C;;;;CAID,MAAM;EACJ,MAAM,eAAyB,CAAC,SAAS,OAAO,CAAC;EACjD,SAAS;EACV;;;;CAID,KAAK;EACH,MAAM,eAAwB,OAAO;EACrC,gBAAgB;GACd,QAAQ;GACR,QAAQ;GACT;EACF;;;;CAID,QAAQ,EACN,MAAM,QACP;;;;CAID,uBAAuB;EACrB,MAAM,eAAgD,CAAC,SAAS,OAAO,CAAC;EACxE,gBAAgB,EACd,OAAO,UACR;EACF;;;;CAID,MAAM,EACJ,MAAM,eAAsC,OAAO,EACpD;;;;CAID,UAAU;EACR,MAAM,eAAqC,CAAC,QAAQ,OAAO,CAAC;EAC5D,SAAS;EACV;;;;CAID,oBAAoB;EAClB,MAAM;EACN,SAAS;EACV;;;;CAID,qBAAqB;EACnB,MAAM;EACN,SAAS;EACV;CACF,CAAC;AAQF,MAAa,YAAY;EACtB,sBAAsB,UAAmB,UAAU,MAAM;EACzD,oBAAoB,YAAoB,SAAS,QAAQ;CAC1D,QAAQ,YAAoB,SAAS,QAAQ;CAC7C,cAAc;CACd,SAAS,YAAoB,SAAS,QAAQ;CAC/C"}
@@ -27,14 +27,13 @@ declare const __VLS_base: _$vue.DefineComponent<TourProps, {}, {}, {}, {}, _$vue
27
27
  "onUpdate:current"?: ((current: number) => any) | undefined;
28
28
  }>, {
29
29
  appendTo: string | HTMLElement;
30
- closeOnPressEscape: boolean;
31
- showClose: boolean;
32
30
  placement: _$_floating_ui_dom0.Placement;
33
31
  showArrow: boolean;
34
32
  gap: TourGap;
35
33
  mask: TourMask;
34
+ closeOnPressEscape: boolean;
35
+ showClose: boolean;
36
36
  scrollIntoViewOptions: boolean | ScrollIntoViewOptions;
37
- current: number;
38
37
  targetAreaClickable: boolean;
39
38
  }, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
40
39
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,5 +1,5 @@
1
1
  import { CHANGE_EVENT, UPDATE_MODEL_EVENT } from "../../../constants/event.mjs";
2
- import { isBoolean } from "../../../utils/types.mjs";
2
+ import { isBoolean, isUndefined } from "../../../utils/types.mjs";
3
3
  import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
4
4
  import { useZIndex } from "../../../hooks/use-z-index/index.mjs";
5
5
  import { tourEmits, tourProps } from "./tour.mjs";
@@ -7,7 +7,6 @@ import { tourKey, useTarget } from "./helper.mjs";
7
7
  import mask_default from "./mask2.mjs";
8
8
  import content_default from "./content2.mjs";
9
9
  import steps_default from "./steps.mjs";
10
- import { useVModel } from "@vueuse/core";
11
10
  import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeStyle, openBlock, provide, ref, renderSlot, toRef, unref, useSlots, watch, withCtx } from "vue";
12
11
  //#region ../../packages/components/tour/src/tour.vue?vue&type=script&setup=true&lang.ts
13
12
  var tour_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -22,7 +21,18 @@ var tour_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
22
21
  const ns = useNamespace("tour");
23
22
  const total = ref(0);
24
23
  const currentStep = ref();
25
- const current = useVModel(props, "current", emit, { passive: true });
24
+ const isControlled = computed(() => !isUndefined(props.current));
25
+ const innerCurrent = ref(props.current ?? 0);
26
+ const current = computed({
27
+ get() {
28
+ return isUndefined(props.current) ? innerCurrent.value : props.current;
29
+ },
30
+ set(newValue) {
31
+ if ((isControlled.value ? props.current : innerCurrent.value) === newValue) return;
32
+ if (!isControlled.value) innerCurrent.value = newValue;
33
+ emit("update:current", newValue);
34
+ }
35
+ });
26
36
  const currentTarget = computed(() => currentStep.value?.target);
27
37
  const kls = computed(() => [ns.b(), mergedType.value === "primary" ? ns.m("primary") : ""]);
28
38
  const mergedPlacement = computed(() => currentStep.value?.placement || props.placement);
@@ -37,8 +47,13 @@ var tour_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
37
47
  const nowZIndex = nextZIndex();
38
48
  const mergedZIndex = computed(() => props.zIndex ?? nowZIndex);
39
49
  const { mergedPosInfo: pos, triggerTarget } = useTarget(currentTarget, toRef(props, "modelValue"), toRef(props, "gap"), mergedMask, mergedScrollIntoViewOptions);
50
+ watch(() => props.current, (val) => !isUndefined(val) && (innerCurrent.value = val));
51
+ watch(current, (newCurrent, oldCurrent) => {
52
+ if (!props.modelValue || newCurrent === oldCurrent) return;
53
+ emit(CHANGE_EVENT, newCurrent);
54
+ }, { flush: "post" });
40
55
  watch(() => props.modelValue, (val) => {
41
- if (!val) current.value = 0;
56
+ if (!val && current.value !== 0) current.value = 0;
42
57
  });
43
58
  const onEscClose = () => {
44
59
  if (props.closeOnPressEscape) {
@@ -67,9 +82,6 @@ var tour_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
67
82
  },
68
83
  onFinish() {
69
84
  emit("finish");
70
- },
71
- onChange() {
72
- emit(CHANGE_EVENT, current.value);
73
85
  }
74
86
  });
75
87
  return (_ctx, _cache) => {
@@ -89,7 +101,7 @@ var tour_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
89
101
  "z-index",
90
102
  "target-area-clickable"
91
103
  ]), __props.modelValue ? (openBlock(), createBlock(content_default, {
92
- key: unref(current),
104
+ key: current.value,
93
105
  reference: unref(triggerTarget),
94
106
  placement: mergedPlacement.value,
95
107
  "show-arrow": mergedShowArrow.value,
@@ -98,7 +110,7 @@ var tour_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
98
110
  onClose: onEscClose
99
111
  }, {
100
112
  default: withCtx(() => [createVNode(unref(steps_default), {
101
- current: unref(current),
113
+ current: current.value,
102
114
  onUpdateTotal
103
115
  }, {
104
116
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
@@ -1 +1 @@
1
- {"version":3,"file":"tour.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs"],"sources":["../../../../../../packages/components/tour/src/tour.vue"],"sourcesContent":["<template>\n <teleport :to=\"appendTo\">\n <div :class=\"kls\" v-bind=\"$attrs\">\n <el-tour-mask\n :visible=\"mergedShowMask\"\n :fill=\"mergedMaskStyle?.color\"\n :style=\"mergedMaskStyle?.style\"\n :pos=\"pos\"\n :z-index=\"mergedZIndex\"\n :target-area-clickable=\"targetAreaClickable\"\n />\n <el-tour-content\n v-if=\"modelValue\"\n :key=\"current\"\n :reference=\"triggerTarget\"\n :placement=\"mergedPlacement\"\n :show-arrow=\"mergedShowArrow\"\n :z-index=\"mergedZIndex\"\n :style=\"mergedContentStyle\"\n @close=\"onEscClose\"\n >\n <el-tour-steps :current=\"current\" @update-total=\"onUpdateTotal\">\n <slot />\n </el-tour-steps>\n </el-tour-content>\n </div>\n </teleport>\n <!-- just for IDE -->\n <slot v-if=\"false\" name=\"indicators\" :current=\"current + 1\" :total=\"total\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref, toRef, useSlots, watch } from 'vue'\nimport { useVModel } from '@vueuse/core'\nimport { useNamespace, useZIndex } from '@element-plus/hooks'\nimport { isBoolean } from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport ElTourMask from './mask.vue'\nimport ElTourContent from './content.vue'\nimport ElTourSteps from './steps'\nimport { tourEmits } from './tour'\nimport { tourKey, useTarget } from './helper'\n\nimport type { TourStepProps } from './step'\nimport type { TourProps } from './tour'\n\ndefineOptions({\n name: 'ElTour',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<TourProps>(), {\n current: 0,\n showArrow: true,\n showClose: true,\n placement: 'bottom',\n mask: true,\n gap: () => ({ offset: 6, radius: 2 }),\n scrollIntoViewOptions: () => ({ block: 'center' }),\n appendTo: 'body',\n closeOnPressEscape: true,\n targetAreaClickable: true,\n})\nconst emit = defineEmits(tourEmits)\n\nconst ns = useNamespace('tour')\nconst total = ref(0)\nconst currentStep = ref<TourStepProps>()\n\nconst current = useVModel(props, 'current', emit, {\n passive: true,\n})\n\nconst currentTarget = computed(() => currentStep.value?.target)\n\nconst kls = computed(() => [\n ns.b(),\n mergedType.value === 'primary' ? ns.m('primary') : '',\n])\n\nconst mergedPlacement = computed(\n () => currentStep.value?.placement || props.placement\n)\n\nconst mergedContentStyle = computed(\n () => currentStep.value?.contentStyle ?? props.contentStyle\n)\n\nconst mergedMask = computed(() => currentStep.value?.mask ?? props.mask)\nconst mergedShowMask = computed(() => !!mergedMask.value && props.modelValue)\nconst mergedMaskStyle = computed(() =>\n isBoolean(mergedMask.value) ? undefined : mergedMask.value\n)\n\nconst mergedShowArrow = computed(\n () =>\n !!currentTarget.value && (currentStep.value?.showArrow ?? props.showArrow)\n)\n\nconst mergedScrollIntoViewOptions = computed(\n () => currentStep.value?.scrollIntoViewOptions ?? props.scrollIntoViewOptions\n)\nconst mergedType = computed(() => currentStep.value?.type ?? props.type)\n\nconst { nextZIndex } = useZIndex()\nconst nowZIndex = nextZIndex()\nconst mergedZIndex = computed(() => props.zIndex ?? nowZIndex)\n\nconst { mergedPosInfo: pos, triggerTarget } = useTarget(\n currentTarget,\n toRef(props, 'modelValue'),\n toRef(props, 'gap'),\n mergedMask,\n mergedScrollIntoViewOptions\n)\n\nwatch(\n () => props.modelValue,\n (val) => {\n if (!val) {\n current.value = 0\n }\n }\n)\n\nconst onEscClose = () => {\n if (props.closeOnPressEscape) {\n emit(UPDATE_MODEL_EVENT, false)\n emit('close', current.value)\n }\n}\n\nconst onUpdateTotal = (val: number) => {\n total.value = val\n}\n\nconst slots = useSlots()\n\nprovide(tourKey, {\n currentStep,\n current,\n total,\n showClose: toRef(props, 'showClose'),\n closeIcon: toRef(props, 'closeIcon'),\n mergedType,\n ns,\n slots,\n updateModelValue(modelValue) {\n emit(UPDATE_MODEL_EVENT, modelValue)\n },\n onClose() {\n emit('close', current.value)\n },\n onFinish() {\n emit('finish')\n },\n onChange() {\n emit(CHANGE_EVENT, current.value)\n },\n})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AAoB,MAAK;IAC9B,KAAK,SAAS,QAAQ,MAAK;;;EAI/B,MAAM,iBAAiB,QAAgB;GACrC,MAAM,QAAQ;;EAGhB,MAAM,QAAQ,UAAS;EAEvB,QAAQ,SAAS;GACf;GACA;GACA;GACA,WAAW,MAAM,OAAO,YAAY;GACpC,WAAW,MAAM,OAAO,YAAY;GACpC;GACA;GACA;GACA,iBAAiB,YAAY;IAC3B,KAAK,oBAAoB,WAAU;;GAErC,UAAU;IACR,KAAK,SAAS,QAAQ,MAAK;;GAE7B,WAAW;IACT,KAAK,SAAQ;;GAEf,WAAW;IACT,KAAK,cAAc,QAAQ,MAAK;;GAEnC,CAAA;;;kBA9JC,YAyBW,UAAA,EAzBA,IAAI,QAAA,UAAQ,EAAA,CACrB,mBAuBM,OAvBN,WAuBM,EAvBA,OAAO,IAAA,OAAG,EAAUA,KAAAA,OAAM,EAAA,CAC9B,YAOE,cAAA;KANC,SAAS,eAAA;KACT,MAAM,gBAAA,OAAiB;KACvB,OAAK,eAAE,gBAAA,OAAiB,MAAK;KAC7B,KAAK,MAAA,IAAG;KACR,WAAS,aAAA;KACT,yBAAuB,QAAA;;;;;;;;QAGlB,QAAA,cAAA,WAAA,EADR,YAakB,iBAAA;KAXf,KAAK,MAAA,QAAO;KACZ,WAAW,MAAA,cAAa;KACxB,WAAW,gBAAA;KACX,cAAY,gBAAA;KACZ,WAAS,aAAA;KACT,OAAK,eAAE,mBAAA,MAAkB;KACzB,SAAO;;4BAIQ,CAFhB,YAEgB,MAAA,cAAA,EAAA;MAFA,SAAS,MAAA,QAAO;MAAiB;;6BACvC,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA;;;;;;;;;;;IAKhB,mBAAA,iBAAqB"}
1
+ {"version":3,"file":"tour.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs"],"sources":["../../../../../../packages/components/tour/src/tour.vue"],"sourcesContent":["<template>\n <teleport :to=\"appendTo\">\n <div :class=\"kls\" v-bind=\"$attrs\">\n <el-tour-mask\n :visible=\"mergedShowMask\"\n :fill=\"mergedMaskStyle?.color\"\n :style=\"mergedMaskStyle?.style\"\n :pos=\"pos\"\n :z-index=\"mergedZIndex\"\n :target-area-clickable=\"targetAreaClickable\"\n />\n <el-tour-content\n v-if=\"modelValue\"\n :key=\"current\"\n :reference=\"triggerTarget\"\n :placement=\"mergedPlacement\"\n :show-arrow=\"mergedShowArrow\"\n :z-index=\"mergedZIndex\"\n :style=\"mergedContentStyle\"\n @close=\"onEscClose\"\n >\n <el-tour-steps :current=\"current\" @update-total=\"onUpdateTotal\">\n <slot />\n </el-tour-steps>\n </el-tour-content>\n </div>\n </teleport>\n <!-- just for IDE -->\n <slot v-if=\"false\" name=\"indicators\" :current=\"current + 1\" :total=\"total\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref, toRef, useSlots, watch } from 'vue'\nimport { useNamespace, useZIndex } from '@element-plus/hooks'\nimport { isBoolean, isUndefined } from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport ElTourMask from './mask.vue'\nimport ElTourContent from './content.vue'\nimport ElTourSteps from './steps'\nimport { tourEmits } from './tour'\nimport { tourKey, useTarget } from './helper'\n\nimport type { TourStepProps } from './step'\nimport type { TourProps } from './tour'\n\ndefineOptions({\n name: 'ElTour',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<TourProps>(), {\n showArrow: true,\n showClose: true,\n placement: 'bottom',\n mask: true,\n gap: () => ({ offset: 6, radius: 2 }),\n scrollIntoViewOptions: () => ({ block: 'center' }),\n appendTo: 'body',\n closeOnPressEscape: true,\n targetAreaClickable: true,\n})\nconst emit = defineEmits(tourEmits)\n\nconst ns = useNamespace('tour')\nconst total = ref(0)\nconst currentStep = ref<TourStepProps>()\nconst isControlled = computed(() => !isUndefined(props.current))\nconst innerCurrent = ref(props.current ?? 0)\n\nconst current = computed<number>({\n get() {\n return isUndefined(props.current) ? innerCurrent.value : props.current\n },\n set(newValue) {\n const oldValue = isControlled.value ? props.current : innerCurrent.value\n if (oldValue === newValue) return\n\n if (!isControlled.value) {\n innerCurrent.value = newValue\n }\n\n emit('update:current', newValue)\n },\n})\n\nconst currentTarget = computed(() => currentStep.value?.target)\n\nconst kls = computed(() => [\n ns.b(),\n mergedType.value === 'primary' ? ns.m('primary') : '',\n])\n\nconst mergedPlacement = computed(\n () => currentStep.value?.placement || props.placement\n)\n\nconst mergedContentStyle = computed(\n () => currentStep.value?.contentStyle ?? props.contentStyle\n)\n\nconst mergedMask = computed(() => currentStep.value?.mask ?? props.mask)\nconst mergedShowMask = computed(() => !!mergedMask.value && props.modelValue)\nconst mergedMaskStyle = computed(() =>\n isBoolean(mergedMask.value) ? undefined : mergedMask.value\n)\n\nconst mergedShowArrow = computed(\n () =>\n !!currentTarget.value && (currentStep.value?.showArrow ?? props.showArrow)\n)\n\nconst mergedScrollIntoViewOptions = computed(\n () => currentStep.value?.scrollIntoViewOptions ?? props.scrollIntoViewOptions\n)\nconst mergedType = computed(() => currentStep.value?.type ?? props.type)\n\nconst { nextZIndex } = useZIndex()\nconst nowZIndex = nextZIndex()\nconst mergedZIndex = computed(() => props.zIndex ?? nowZIndex)\n\nconst { mergedPosInfo: pos, triggerTarget } = useTarget(\n currentTarget,\n toRef(props, 'modelValue'),\n toRef(props, 'gap'),\n mergedMask,\n mergedScrollIntoViewOptions\n)\n\nwatch(\n () => props.current,\n (val) => !isUndefined(val) && (innerCurrent.value = val)\n)\n\nwatch(\n current,\n (newCurrent, oldCurrent) => {\n if (!props.modelValue || newCurrent === oldCurrent) return\n emit(CHANGE_EVENT, newCurrent)\n },\n { flush: 'post' }\n)\n\nwatch(\n () => props.modelValue,\n (val) => {\n if (!val && current.value !== 0) {\n current.value = 0\n }\n }\n)\n\nconst onEscClose = () => {\n if (props.closeOnPressEscape) {\n emit(UPDATE_MODEL_EVENT, false)\n emit('close', current.value)\n }\n}\n\nconst onUpdateTotal = (val: number) => {\n total.value = val\n}\n\nconst slots = useSlots()\n\nprovide(tourKey, {\n currentStep,\n current,\n total,\n showClose: toRef(props, 'showClose'),\n closeIcon: toRef(props, 'closeIcon'),\n mergedType,\n ns,\n slots,\n updateModelValue(modelValue) {\n emit(UPDATE_MODEL_EVENT, modelValue)\n },\n onClose() {\n emit('close', current.value)\n },\n onFinish() {\n emit('finish')\n },\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAkDA,MAAM,QAAQ;EAWd,MAAM,OAAO;EAEb,MAAM,KAAK,aAAa,OAAM;EAC9B,MAAM,QAAQ,IAAI,EAAC;EACnB,MAAM,cAAc,KAAmB;EACvC,MAAM,eAAe,eAAe,CAAC,YAAY,MAAM,QAAQ,CAAA;EAC/D,MAAM,eAAe,IAAI,MAAM,WAAW,EAAC;EAE3C,MAAM,UAAU,SAAiB;GAC/B,MAAM;IACJ,OAAO,YAAY,MAAM,QAAQ,GAAG,aAAa,QAAQ,MAAM;;GAEjE,IAAI,UAAU;IAEZ,KADiB,aAAa,QAAQ,MAAM,UAAU,aAAa,WAClD,UAAU;IAE3B,IAAI,CAAC,aAAa,OAChB,aAAa,QAAQ;IAGvB,KAAK,kBAAkB,SAAQ;;GAElC,CAAA;EAED,MAAM,gBAAgB,eAAe,YAAY,OAAO,OAAM;EAE9D,MAAM,MAAM,eAAe,CACzB,GAAG,GAAG,EACN,WAAW,UAAU,YAAY,GAAG,EAAE,UAAU,GAAG,GACpD,CAAA;EAED,MAAM,kBAAkB,eAChB,YAAY,OAAO,aAAa,MAAM,UAC9C;EAEA,MAAM,qBAAqB,eACnB,YAAY,OAAO,gBAAgB,MAAM,aACjD;EAEA,MAAM,aAAa,eAAe,YAAY,OAAO,QAAQ,MAAM,KAAI;EACvE,MAAM,iBAAiB,eAAe,CAAC,CAAC,WAAW,SAAS,MAAM,WAAU;EAC5E,MAAM,kBAAkB,eACtB,UAAU,WAAW,MAAM,GAAG,KAAA,IAAY,WAAW,MACvD;EAEA,MAAM,kBAAkB,eAEp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A,OAAM,EAAA,CAC9B,YAOE,cAAA;KANC,SAAS,eAAA;KACT,MAAM,gBAAA,OAAiB;KACvB,OAAK,eAAE,gBAAA,OAAiB,MAAK;KAC7B,KAAK,MAAA,IAAG;KACR,WAAS,aAAA;KACT,yBAAuB,QAAA;;;;;;;;QAGlB,QAAA,cAAA,WAAA,EADR,YAakB,iBAAA;KAXf,KAAK,QAAA;KACL,WAAW,MAAA,cAAa;KACxB,WAAW,gBAAA;KACX,cAAY,gBAAA;KACZ,WAAS,aAAA;KACT,OAAK,eAAE,mBAAA,MAAkB;KACzB,SAAO;;4BAIQ,CAFhB,YAEgB,MAAA,cAAA,EAAA;MAFA,SAAS,QAAA;MAAwB;;6BACvC,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA;;;;;;;;;;;IAKhB,mBAAA,iBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"tour2.mjs","names":[],"sources":["../../../../../../packages/components/tour/src/tour.vue"],"sourcesContent":["<template>\n <teleport :to=\"appendTo\">\n <div :class=\"kls\" v-bind=\"$attrs\">\n <el-tour-mask\n :visible=\"mergedShowMask\"\n :fill=\"mergedMaskStyle?.color\"\n :style=\"mergedMaskStyle?.style\"\n :pos=\"pos\"\n :z-index=\"mergedZIndex\"\n :target-area-clickable=\"targetAreaClickable\"\n />\n <el-tour-content\n v-if=\"modelValue\"\n :key=\"current\"\n :reference=\"triggerTarget\"\n :placement=\"mergedPlacement\"\n :show-arrow=\"mergedShowArrow\"\n :z-index=\"mergedZIndex\"\n :style=\"mergedContentStyle\"\n @close=\"onEscClose\"\n >\n <el-tour-steps :current=\"current\" @update-total=\"onUpdateTotal\">\n <slot />\n </el-tour-steps>\n </el-tour-content>\n </div>\n </teleport>\n <!-- just for IDE -->\n <slot v-if=\"false\" name=\"indicators\" :current=\"current + 1\" :total=\"total\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref, toRef, useSlots, watch } from 'vue'\nimport { useVModel } from '@vueuse/core'\nimport { useNamespace, useZIndex } from '@element-plus/hooks'\nimport { isBoolean } from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport ElTourMask from './mask.vue'\nimport ElTourContent from './content.vue'\nimport ElTourSteps from './steps'\nimport { tourEmits } from './tour'\nimport { tourKey, useTarget } from './helper'\n\nimport type { TourStepProps } from './step'\nimport type { TourProps } from './tour'\n\ndefineOptions({\n name: 'ElTour',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<TourProps>(), {\n current: 0,\n showArrow: true,\n showClose: true,\n placement: 'bottom',\n mask: true,\n gap: () => ({ offset: 6, radius: 2 }),\n scrollIntoViewOptions: () => ({ block: 'center' }),\n appendTo: 'body',\n closeOnPressEscape: true,\n targetAreaClickable: true,\n})\nconst emit = defineEmits(tourEmits)\n\nconst ns = useNamespace('tour')\nconst total = ref(0)\nconst currentStep = ref<TourStepProps>()\n\nconst current = useVModel(props, 'current', emit, {\n passive: true,\n})\n\nconst currentTarget = computed(() => currentStep.value?.target)\n\nconst kls = computed(() => [\n ns.b(),\n mergedType.value === 'primary' ? ns.m('primary') : '',\n])\n\nconst mergedPlacement = computed(\n () => currentStep.value?.placement || props.placement\n)\n\nconst mergedContentStyle = computed(\n () => currentStep.value?.contentStyle ?? props.contentStyle\n)\n\nconst mergedMask = computed(() => currentStep.value?.mask ?? props.mask)\nconst mergedShowMask = computed(() => !!mergedMask.value && props.modelValue)\nconst mergedMaskStyle = computed(() =>\n isBoolean(mergedMask.value) ? undefined : mergedMask.value\n)\n\nconst mergedShowArrow = computed(\n () =>\n !!currentTarget.value && (currentStep.value?.showArrow ?? props.showArrow)\n)\n\nconst mergedScrollIntoViewOptions = computed(\n () => currentStep.value?.scrollIntoViewOptions ?? props.scrollIntoViewOptions\n)\nconst mergedType = computed(() => currentStep.value?.type ?? props.type)\n\nconst { nextZIndex } = useZIndex()\nconst nowZIndex = nextZIndex()\nconst mergedZIndex = computed(() => props.zIndex ?? nowZIndex)\n\nconst { mergedPosInfo: pos, triggerTarget } = useTarget(\n currentTarget,\n toRef(props, 'modelValue'),\n toRef(props, 'gap'),\n mergedMask,\n mergedScrollIntoViewOptions\n)\n\nwatch(\n () => props.modelValue,\n (val) => {\n if (!val) {\n current.value = 0\n }\n }\n)\n\nconst onEscClose = () => {\n if (props.closeOnPressEscape) {\n emit(UPDATE_MODEL_EVENT, false)\n emit('close', current.value)\n }\n}\n\nconst onUpdateTotal = (val: number) => {\n total.value = val\n}\n\nconst slots = useSlots()\n\nprovide(tourKey, {\n currentStep,\n current,\n total,\n showClose: toRef(props, 'showClose'),\n closeIcon: toRef(props, 'closeIcon'),\n mergedType,\n ns,\n slots,\n updateModelValue(modelValue) {\n emit(UPDATE_MODEL_EVENT, modelValue)\n },\n onClose() {\n emit('close', current.value)\n },\n onFinish() {\n emit('finish')\n },\n onChange() {\n emit(CHANGE_EVENT, current.value)\n },\n})\n</script>\n"],"mappings":""}
1
+ {"version":3,"file":"tour2.mjs","names":[],"sources":["../../../../../../packages/components/tour/src/tour.vue"],"sourcesContent":["<template>\n <teleport :to=\"appendTo\">\n <div :class=\"kls\" v-bind=\"$attrs\">\n <el-tour-mask\n :visible=\"mergedShowMask\"\n :fill=\"mergedMaskStyle?.color\"\n :style=\"mergedMaskStyle?.style\"\n :pos=\"pos\"\n :z-index=\"mergedZIndex\"\n :target-area-clickable=\"targetAreaClickable\"\n />\n <el-tour-content\n v-if=\"modelValue\"\n :key=\"current\"\n :reference=\"triggerTarget\"\n :placement=\"mergedPlacement\"\n :show-arrow=\"mergedShowArrow\"\n :z-index=\"mergedZIndex\"\n :style=\"mergedContentStyle\"\n @close=\"onEscClose\"\n >\n <el-tour-steps :current=\"current\" @update-total=\"onUpdateTotal\">\n <slot />\n </el-tour-steps>\n </el-tour-content>\n </div>\n </teleport>\n <!-- just for IDE -->\n <slot v-if=\"false\" name=\"indicators\" :current=\"current + 1\" :total=\"total\" />\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref, toRef, useSlots, watch } from 'vue'\nimport { useNamespace, useZIndex } from '@element-plus/hooks'\nimport { isBoolean, isUndefined } from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport ElTourMask from './mask.vue'\nimport ElTourContent from './content.vue'\nimport ElTourSteps from './steps'\nimport { tourEmits } from './tour'\nimport { tourKey, useTarget } from './helper'\n\nimport type { TourStepProps } from './step'\nimport type { TourProps } from './tour'\n\ndefineOptions({\n name: 'ElTour',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<TourProps>(), {\n showArrow: true,\n showClose: true,\n placement: 'bottom',\n mask: true,\n gap: () => ({ offset: 6, radius: 2 }),\n scrollIntoViewOptions: () => ({ block: 'center' }),\n appendTo: 'body',\n closeOnPressEscape: true,\n targetAreaClickable: true,\n})\nconst emit = defineEmits(tourEmits)\n\nconst ns = useNamespace('tour')\nconst total = ref(0)\nconst currentStep = ref<TourStepProps>()\nconst isControlled = computed(() => !isUndefined(props.current))\nconst innerCurrent = ref(props.current ?? 0)\n\nconst current = computed<number>({\n get() {\n return isUndefined(props.current) ? innerCurrent.value : props.current\n },\n set(newValue) {\n const oldValue = isControlled.value ? props.current : innerCurrent.value\n if (oldValue === newValue) return\n\n if (!isControlled.value) {\n innerCurrent.value = newValue\n }\n\n emit('update:current', newValue)\n },\n})\n\nconst currentTarget = computed(() => currentStep.value?.target)\n\nconst kls = computed(() => [\n ns.b(),\n mergedType.value === 'primary' ? ns.m('primary') : '',\n])\n\nconst mergedPlacement = computed(\n () => currentStep.value?.placement || props.placement\n)\n\nconst mergedContentStyle = computed(\n () => currentStep.value?.contentStyle ?? props.contentStyle\n)\n\nconst mergedMask = computed(() => currentStep.value?.mask ?? props.mask)\nconst mergedShowMask = computed(() => !!mergedMask.value && props.modelValue)\nconst mergedMaskStyle = computed(() =>\n isBoolean(mergedMask.value) ? undefined : mergedMask.value\n)\n\nconst mergedShowArrow = computed(\n () =>\n !!currentTarget.value && (currentStep.value?.showArrow ?? props.showArrow)\n)\n\nconst mergedScrollIntoViewOptions = computed(\n () => currentStep.value?.scrollIntoViewOptions ?? props.scrollIntoViewOptions\n)\nconst mergedType = computed(() => currentStep.value?.type ?? props.type)\n\nconst { nextZIndex } = useZIndex()\nconst nowZIndex = nextZIndex()\nconst mergedZIndex = computed(() => props.zIndex ?? nowZIndex)\n\nconst { mergedPosInfo: pos, triggerTarget } = useTarget(\n currentTarget,\n toRef(props, 'modelValue'),\n toRef(props, 'gap'),\n mergedMask,\n mergedScrollIntoViewOptions\n)\n\nwatch(\n () => props.current,\n (val) => !isUndefined(val) && (innerCurrent.value = val)\n)\n\nwatch(\n current,\n (newCurrent, oldCurrent) => {\n if (!props.modelValue || newCurrent === oldCurrent) return\n emit(CHANGE_EVENT, newCurrent)\n },\n { flush: 'post' }\n)\n\nwatch(\n () => props.modelValue,\n (val) => {\n if (!val && current.value !== 0) {\n current.value = 0\n }\n }\n)\n\nconst onEscClose = () => {\n if (props.closeOnPressEscape) {\n emit(UPDATE_MODEL_EVENT, false)\n emit('close', current.value)\n }\n}\n\nconst onUpdateTotal = (val: number) => {\n total.value = val\n}\n\nconst slots = useSlots()\n\nprovide(tourKey, {\n currentStep,\n current,\n total,\n showClose: toRef(props, 'showClose'),\n closeIcon: toRef(props, 'closeIcon'),\n mergedType,\n ns,\n slots,\n updateModelValue(modelValue) {\n emit(UPDATE_MODEL_EVENT, modelValue)\n },\n onClose() {\n emit('close', current.value)\n },\n onFinish() {\n emit('finish')\n },\n})\n</script>\n"],"mappings":""}
@@ -79,9 +79,9 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
79
79
  }>> & Readonly<{
80
80
  "onNode-expand"?: ((...args: any[]) => any) | undefined;
81
81
  }>, {
82
- node: Node;
83
82
  props: TreeOptionProps;
84
83
  accordion: boolean;
84
+ node: Node;
85
85
  renderAfterExpand: boolean;
86
86
  showCheckbox: boolean;
87
87
  }, {}, {
@@ -110,11 +110,11 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
110
110
  change: (val: CheckboxValueType) => void;
111
111
  "update:modelValue": (val: CheckboxValueType) => void;
112
112
  }, _$vue.PublicProps, {
113
- label: string | boolean | number | object;
114
- disabled: boolean;
115
- id: string;
116
113
  name: string;
114
+ disabled: boolean;
115
+ label: string | boolean | number | object;
117
116
  value: string | boolean | number | object;
117
+ id: string;
118
118
  modelValue: number | string | boolean;
119
119
  validateEvent: boolean;
120
120
  trueValue: string | number;
@@ -132,11 +132,11 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
132
132
  onChange?: ((val: CheckboxValueType) => any) | undefined;
133
133
  "onUpdate:modelValue"?: ((val: CheckboxValueType) => any) | undefined;
134
134
  }>, {}, {}, {}, {}, {
135
- label: string | boolean | number | object;
136
- disabled: boolean;
137
- id: string;
138
135
  name: string;
136
+ disabled: boolean;
137
+ label: string | boolean | number | object;
139
138
  value: string | boolean | number | object;
139
+ id: string;
140
140
  modelValue: number | string | boolean;
141
141
  validateEvent: boolean;
142
142
  trueValue: string | number;
@@ -154,11 +154,11 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
154
154
  change: (val: CheckboxValueType) => void;
155
155
  "update:modelValue": (val: CheckboxValueType) => void;
156
156
  }, string, {
157
- label: string | boolean | number | object;
158
- disabled: boolean;
159
- id: string;
160
157
  name: string;
158
+ disabled: boolean;
159
+ label: string | boolean | number | object;
161
160
  value: string | boolean | number | object;
161
+ id: string;
162
162
  modelValue: number | string | boolean;
163
163
  validateEvent: boolean;
164
164
  trueValue: string | number;
@@ -1350,35 +1350,35 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
1350
1350
  __epPropKey: true;
1351
1351
  };
1352
1352
  }>> & Readonly<{
1353
- "onCheck-change"?: ((data: any, checked: boolean, indeterminate: boolean) => any) | undefined;
1354
1353
  "onCurrent-change"?: ((data: any, node: Node | null) => any) | undefined;
1354
+ "onNode-expand"?: ((data: any, node: Node, nodeInstance: ComponentInternalInstance | null) => any) | undefined;
1355
+ "onCheck-change"?: ((data: any, checked: boolean, indeterminate: boolean) => any) | undefined;
1355
1356
  "onNode-click"?: ((data: any, node: Node, nodeInstance: ComponentInternalInstance | null, evt: MouseEvent) => any) | undefined;
1356
1357
  "onNode-contextmenu"?: ((evt: Event, data: any, node: Node, nodeInstance: ComponentInternalInstance | null) => any) | undefined;
1357
1358
  "onNode-collapse"?: ((data: any, node: Node, nodeInstance: ComponentInternalInstance | null) => any) | undefined;
1358
- "onNode-expand"?: ((data: any, node: Node, nodeInstance: ComponentInternalInstance | null) => any) | undefined;
1359
1359
  onCheck?: ((data: any, checkedInfo: CheckedInfo) => any) | undefined;
1360
1360
  "onNode-drag-start"?: ((node: Node, evt: DragEvent) => any) | undefined;
1361
1361
  "onNode-drag-end"?: ((draggingNode: Node, dropNode: Node | null, dropType: NodeDropType, evt: DragEvent) => any) | undefined;
1362
- "onNode-drop"?: ((draggingNode: Node, dropNode: Node, dropType: "before" | "after" | "inner", evt: DragEvent) => any) | undefined;
1362
+ "onNode-drop"?: ((draggingNode: Node, dropNode: Node, dropType: "after" | "before" | "inner", evt: DragEvent) => any) | undefined;
1363
1363
  "onNode-drag-leave"?: ((draggingNode: Node, oldDropNode: Node, evt: DragEvent) => any) | undefined;
1364
1364
  "onNode-drag-enter"?: ((draggingNode: Node, dropNode: Node, evt: DragEvent) => any) | undefined;
1365
1365
  "onNode-drag-over"?: ((draggingNode: Node, dropNode: Node, evt: DragEvent) => any) | undefined;
1366
1366
  }>, {
1367
1367
  readonly data: TreeData;
1368
- readonly lazy: boolean;
1369
- readonly checkStrictly: boolean;
1370
- readonly autoExpandParent: EpPropMergeType<BooleanConstructor, unknown, unknown>;
1371
- readonly defaultExpandAll: boolean;
1372
- readonly checkDescendants: boolean;
1373
1368
  readonly props: TreeOptionProps;
1369
+ readonly checkStrictly: boolean;
1370
+ readonly lazy: boolean;
1371
+ readonly checkOnClickNode: boolean;
1372
+ readonly checkOnClickLeaf: EpPropMergeType<BooleanConstructor, unknown, unknown>;
1373
+ readonly accordion: boolean;
1374
1374
  readonly draggable: boolean;
1375
+ readonly defaultExpandAll: boolean;
1375
1376
  readonly indent: number;
1376
- readonly accordion: boolean;
1377
1377
  readonly renderAfterExpand: EpPropMergeType<BooleanConstructor, unknown, unknown>;
1378
1378
  readonly showCheckbox: boolean;
1379
1379
  readonly expandOnClickNode: EpPropMergeType<BooleanConstructor, unknown, unknown>;
1380
- readonly checkOnClickLeaf: EpPropMergeType<BooleanConstructor, unknown, unknown>;
1381
- readonly checkOnClickNode: boolean;
1380
+ readonly autoExpandParent: EpPropMergeType<BooleanConstructor, unknown, unknown>;
1381
+ readonly checkDescendants: boolean;
1382
1382
  readonly highlightCurrent: boolean;
1383
1383
  }, {}, {
1384
1384
  ElTreeNode: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
@@ -1450,9 +1450,9 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
1450
1450
  }>> & Readonly<{
1451
1451
  "onNode-expand"?: ((...args: any[]) => any) | undefined;
1452
1452
  }>, {
1453
- node: Node;
1454
1453
  props: TreeOptionProps;
1455
1454
  accordion: boolean;
1455
+ node: Node;
1456
1456
  renderAfterExpand: boolean;
1457
1457
  showCheckbox: boolean;
1458
1458
  }, {}, {
@@ -1481,11 +1481,11 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
1481
1481
  change: (val: CheckboxValueType) => void;
1482
1482
  "update:modelValue": (val: CheckboxValueType) => void;
1483
1483
  }, _$vue.PublicProps, {
1484
- label: string | boolean | number | object;
1485
- disabled: boolean;
1486
- id: string;
1487
1484
  name: string;
1485
+ disabled: boolean;
1486
+ label: string | boolean | number | object;
1488
1487
  value: string | boolean | number | object;
1488
+ id: string;
1489
1489
  modelValue: number | string | boolean;
1490
1490
  validateEvent: boolean;
1491
1491
  trueValue: string | number;
@@ -1503,11 +1503,11 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
1503
1503
  onChange?: ((val: CheckboxValueType) => any) | undefined;
1504
1504
  "onUpdate:modelValue"?: ((val: CheckboxValueType) => any) | undefined;
1505
1505
  }>, {}, {}, {}, {}, {
1506
- label: string | boolean | number | object;
1507
- disabled: boolean;
1508
- id: string;
1509
1506
  name: string;
1507
+ disabled: boolean;
1508
+ label: string | boolean | number | object;
1510
1509
  value: string | boolean | number | object;
1510
+ id: string;
1511
1511
  modelValue: number | string | boolean;
1512
1512
  validateEvent: boolean;
1513
1513
  trueValue: string | number;
@@ -1525,11 +1525,11 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
1525
1525
  change: (val: CheckboxValueType) => void;
1526
1526
  "update:modelValue": (val: CheckboxValueType) => void;
1527
1527
  }, string, {
1528
- label: string | boolean | number | object;
1529
- disabled: boolean;
1530
- id: string;
1531
1528
  name: string;
1529
+ disabled: boolean;
1530
+ label: string | boolean | number | object;
1532
1531
  value: string | boolean | number | object;
1532
+ id: string;
1533
1533
  modelValue: number | string | boolean;
1534
1534
  validateEvent: boolean;
1535
1535
  trueValue: string | number;