@element-plus/nightly 0.0.20240123 → 0.0.20240125

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 (377) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +18 -33
  4. package/dist/index.full.min.js +10 -10
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +10 -10
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +18 -33
  9. package/dist/locale/af.js +1 -1
  10. package/dist/locale/af.min.js +1 -1
  11. package/dist/locale/af.min.mjs +1 -1
  12. package/dist/locale/af.mjs +1 -1
  13. package/dist/locale/ar-eg.js +1 -1
  14. package/dist/locale/ar-eg.min.js +1 -1
  15. package/dist/locale/ar-eg.min.mjs +1 -1
  16. package/dist/locale/ar-eg.mjs +1 -1
  17. package/dist/locale/ar.js +1 -1
  18. package/dist/locale/ar.min.js +1 -1
  19. package/dist/locale/ar.min.mjs +1 -1
  20. package/dist/locale/ar.mjs +1 -1
  21. package/dist/locale/az.js +1 -1
  22. package/dist/locale/az.min.js +1 -1
  23. package/dist/locale/az.min.mjs +1 -1
  24. package/dist/locale/az.mjs +1 -1
  25. package/dist/locale/bg.js +1 -1
  26. package/dist/locale/bg.min.js +1 -1
  27. package/dist/locale/bg.min.mjs +1 -1
  28. package/dist/locale/bg.mjs +1 -1
  29. package/dist/locale/bn.js +1 -1
  30. package/dist/locale/bn.min.js +1 -1
  31. package/dist/locale/bn.min.mjs +1 -1
  32. package/dist/locale/bn.mjs +1 -1
  33. package/dist/locale/ca.js +1 -1
  34. package/dist/locale/ca.min.js +1 -1
  35. package/dist/locale/ca.min.mjs +1 -1
  36. package/dist/locale/ca.mjs +1 -1
  37. package/dist/locale/ckb.js +1 -1
  38. package/dist/locale/ckb.min.js +1 -1
  39. package/dist/locale/ckb.min.mjs +1 -1
  40. package/dist/locale/ckb.mjs +1 -1
  41. package/dist/locale/cs.js +1 -1
  42. package/dist/locale/cs.min.js +1 -1
  43. package/dist/locale/cs.min.mjs +1 -1
  44. package/dist/locale/cs.mjs +1 -1
  45. package/dist/locale/da.js +1 -1
  46. package/dist/locale/da.min.js +1 -1
  47. package/dist/locale/da.min.mjs +1 -1
  48. package/dist/locale/da.mjs +1 -1
  49. package/dist/locale/de.js +1 -1
  50. package/dist/locale/de.min.js +1 -1
  51. package/dist/locale/de.min.mjs +1 -1
  52. package/dist/locale/de.mjs +1 -1
  53. package/dist/locale/el.js +1 -1
  54. package/dist/locale/el.min.js +1 -1
  55. package/dist/locale/el.min.mjs +1 -1
  56. package/dist/locale/el.mjs +1 -1
  57. package/dist/locale/en.js +1 -1
  58. package/dist/locale/en.min.js +1 -1
  59. package/dist/locale/en.min.mjs +1 -1
  60. package/dist/locale/en.mjs +1 -1
  61. package/dist/locale/eo.js +1 -1
  62. package/dist/locale/eo.min.js +1 -1
  63. package/dist/locale/eo.min.mjs +1 -1
  64. package/dist/locale/eo.mjs +1 -1
  65. package/dist/locale/es.js +1 -1
  66. package/dist/locale/es.min.js +1 -1
  67. package/dist/locale/es.min.mjs +1 -1
  68. package/dist/locale/es.mjs +1 -1
  69. package/dist/locale/et.js +1 -1
  70. package/dist/locale/et.min.js +1 -1
  71. package/dist/locale/et.min.mjs +1 -1
  72. package/dist/locale/et.mjs +1 -1
  73. package/dist/locale/eu.js +1 -1
  74. package/dist/locale/eu.min.js +1 -1
  75. package/dist/locale/eu.min.mjs +1 -1
  76. package/dist/locale/eu.mjs +1 -1
  77. package/dist/locale/fa.js +1 -1
  78. package/dist/locale/fa.min.js +1 -1
  79. package/dist/locale/fa.min.mjs +1 -1
  80. package/dist/locale/fa.mjs +1 -1
  81. package/dist/locale/fi.js +1 -1
  82. package/dist/locale/fi.min.js +1 -1
  83. package/dist/locale/fi.min.mjs +1 -1
  84. package/dist/locale/fi.mjs +1 -1
  85. package/dist/locale/fr.js +1 -1
  86. package/dist/locale/fr.min.js +1 -1
  87. package/dist/locale/fr.min.mjs +1 -1
  88. package/dist/locale/fr.mjs +1 -1
  89. package/dist/locale/he.js +1 -1
  90. package/dist/locale/he.min.js +1 -1
  91. package/dist/locale/he.min.mjs +1 -1
  92. package/dist/locale/he.mjs +1 -1
  93. package/dist/locale/hr.js +1 -1
  94. package/dist/locale/hr.min.js +1 -1
  95. package/dist/locale/hr.min.mjs +1 -1
  96. package/dist/locale/hr.mjs +1 -1
  97. package/dist/locale/hu.js +1 -1
  98. package/dist/locale/hu.min.js +1 -1
  99. package/dist/locale/hu.min.mjs +1 -1
  100. package/dist/locale/hu.mjs +1 -1
  101. package/dist/locale/hy-am.js +1 -1
  102. package/dist/locale/hy-am.min.js +1 -1
  103. package/dist/locale/hy-am.min.mjs +1 -1
  104. package/dist/locale/hy-am.mjs +1 -1
  105. package/dist/locale/id.js +1 -1
  106. package/dist/locale/id.min.js +1 -1
  107. package/dist/locale/id.min.mjs +1 -1
  108. package/dist/locale/id.mjs +1 -1
  109. package/dist/locale/it.js +1 -1
  110. package/dist/locale/it.min.js +1 -1
  111. package/dist/locale/it.min.mjs +1 -1
  112. package/dist/locale/it.mjs +1 -1
  113. package/dist/locale/ja.js +1 -1
  114. package/dist/locale/ja.min.js +1 -1
  115. package/dist/locale/ja.min.mjs +1 -1
  116. package/dist/locale/ja.mjs +1 -1
  117. package/dist/locale/kk.js +1 -1
  118. package/dist/locale/kk.min.js +1 -1
  119. package/dist/locale/kk.min.mjs +1 -1
  120. package/dist/locale/kk.mjs +1 -1
  121. package/dist/locale/km.js +1 -1
  122. package/dist/locale/km.min.js +1 -1
  123. package/dist/locale/km.min.mjs +1 -1
  124. package/dist/locale/km.mjs +1 -1
  125. package/dist/locale/ko.js +1 -1
  126. package/dist/locale/ko.min.js +1 -1
  127. package/dist/locale/ko.min.mjs +1 -1
  128. package/dist/locale/ko.mjs +1 -1
  129. package/dist/locale/ku.js +1 -1
  130. package/dist/locale/ku.min.js +1 -1
  131. package/dist/locale/ku.min.mjs +1 -1
  132. package/dist/locale/ku.mjs +1 -1
  133. package/dist/locale/ky.js +1 -1
  134. package/dist/locale/ky.min.js +1 -1
  135. package/dist/locale/ky.min.mjs +1 -1
  136. package/dist/locale/ky.mjs +1 -1
  137. package/dist/locale/lt.js +1 -1
  138. package/dist/locale/lt.min.js +1 -1
  139. package/dist/locale/lt.min.mjs +1 -1
  140. package/dist/locale/lt.mjs +1 -1
  141. package/dist/locale/lv.js +1 -1
  142. package/dist/locale/lv.min.js +1 -1
  143. package/dist/locale/lv.min.mjs +1 -1
  144. package/dist/locale/lv.mjs +1 -1
  145. package/dist/locale/mg.js +1 -1
  146. package/dist/locale/mg.min.js +1 -1
  147. package/dist/locale/mg.min.mjs +1 -1
  148. package/dist/locale/mg.mjs +1 -1
  149. package/dist/locale/mn.js +1 -1
  150. package/dist/locale/mn.min.js +1 -1
  151. package/dist/locale/mn.min.mjs +1 -1
  152. package/dist/locale/mn.mjs +1 -1
  153. package/dist/locale/nb-no.js +1 -1
  154. package/dist/locale/nb-no.min.js +1 -1
  155. package/dist/locale/nb-no.min.mjs +1 -1
  156. package/dist/locale/nb-no.mjs +1 -1
  157. package/dist/locale/nl.js +1 -1
  158. package/dist/locale/nl.min.js +1 -1
  159. package/dist/locale/nl.min.mjs +1 -1
  160. package/dist/locale/nl.mjs +1 -1
  161. package/dist/locale/pa.js +1 -1
  162. package/dist/locale/pa.min.js +1 -1
  163. package/dist/locale/pa.min.mjs +1 -1
  164. package/dist/locale/pa.mjs +1 -1
  165. package/dist/locale/pl.js +1 -1
  166. package/dist/locale/pl.min.js +1 -1
  167. package/dist/locale/pl.min.mjs +1 -1
  168. package/dist/locale/pl.mjs +1 -1
  169. package/dist/locale/pt-br.js +1 -1
  170. package/dist/locale/pt-br.min.js +1 -1
  171. package/dist/locale/pt-br.min.mjs +1 -1
  172. package/dist/locale/pt-br.mjs +1 -1
  173. package/dist/locale/pt.js +1 -1
  174. package/dist/locale/pt.min.js +1 -1
  175. package/dist/locale/pt.min.mjs +1 -1
  176. package/dist/locale/pt.mjs +1 -1
  177. package/dist/locale/ro.js +1 -1
  178. package/dist/locale/ro.min.js +1 -1
  179. package/dist/locale/ro.min.mjs +1 -1
  180. package/dist/locale/ro.mjs +1 -1
  181. package/dist/locale/ru.js +1 -1
  182. package/dist/locale/ru.min.js +1 -1
  183. package/dist/locale/ru.min.mjs +1 -1
  184. package/dist/locale/ru.mjs +1 -1
  185. package/dist/locale/sk.js +1 -1
  186. package/dist/locale/sk.min.js +1 -1
  187. package/dist/locale/sk.min.mjs +1 -1
  188. package/dist/locale/sk.mjs +1 -1
  189. package/dist/locale/sl.js +1 -1
  190. package/dist/locale/sl.min.js +1 -1
  191. package/dist/locale/sl.min.mjs +1 -1
  192. package/dist/locale/sl.mjs +1 -1
  193. package/dist/locale/sr.js +1 -1
  194. package/dist/locale/sr.min.js +1 -1
  195. package/dist/locale/sr.min.mjs +1 -1
  196. package/dist/locale/sr.mjs +1 -1
  197. package/dist/locale/sv.js +1 -1
  198. package/dist/locale/sv.min.js +1 -1
  199. package/dist/locale/sv.min.mjs +1 -1
  200. package/dist/locale/sv.mjs +1 -1
  201. package/dist/locale/sw.js +1 -1
  202. package/dist/locale/sw.min.js +1 -1
  203. package/dist/locale/sw.min.mjs +1 -1
  204. package/dist/locale/sw.mjs +1 -1
  205. package/dist/locale/ta.js +1 -1
  206. package/dist/locale/ta.min.js +1 -1
  207. package/dist/locale/ta.min.mjs +1 -1
  208. package/dist/locale/ta.mjs +1 -1
  209. package/dist/locale/th.js +1 -1
  210. package/dist/locale/th.min.js +1 -1
  211. package/dist/locale/th.min.mjs +1 -1
  212. package/dist/locale/th.mjs +1 -1
  213. package/dist/locale/tk.js +1 -1
  214. package/dist/locale/tk.min.js +1 -1
  215. package/dist/locale/tk.min.mjs +1 -1
  216. package/dist/locale/tk.mjs +1 -1
  217. package/dist/locale/tr.js +1 -1
  218. package/dist/locale/tr.min.js +1 -1
  219. package/dist/locale/tr.min.mjs +1 -1
  220. package/dist/locale/tr.mjs +1 -1
  221. package/dist/locale/ug-cn.js +1 -1
  222. package/dist/locale/ug-cn.min.js +1 -1
  223. package/dist/locale/ug-cn.min.mjs +1 -1
  224. package/dist/locale/ug-cn.mjs +1 -1
  225. package/dist/locale/uk.js +1 -1
  226. package/dist/locale/uk.min.js +1 -1
  227. package/dist/locale/uk.min.mjs +1 -1
  228. package/dist/locale/uk.mjs +1 -1
  229. package/dist/locale/uz-uz.js +1 -1
  230. package/dist/locale/uz-uz.min.js +1 -1
  231. package/dist/locale/uz-uz.min.mjs +1 -1
  232. package/dist/locale/uz-uz.mjs +1 -1
  233. package/dist/locale/vi.js +1 -1
  234. package/dist/locale/vi.min.js +1 -1
  235. package/dist/locale/vi.min.mjs +1 -1
  236. package/dist/locale/vi.mjs +1 -1
  237. package/dist/locale/zh-cn.js +1 -1
  238. package/dist/locale/zh-cn.min.js +1 -1
  239. package/dist/locale/zh-cn.min.mjs +1 -1
  240. package/dist/locale/zh-cn.mjs +1 -1
  241. package/dist/locale/zh-tw.js +1 -1
  242. package/dist/locale/zh-tw.min.js +1 -1
  243. package/dist/locale/zh-tw.min.mjs +1 -1
  244. package/dist/locale/zh-tw.mjs +1 -1
  245. package/es/components/dialog/index.d.ts +9 -8
  246. package/es/components/dialog/src/dialog-content.d.ts +1 -1
  247. package/es/components/dialog/src/dialog-content.mjs +1 -4
  248. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  249. package/es/components/dialog/src/dialog-content.vue.d.ts +5 -4
  250. package/es/components/dialog/src/dialog-content2.mjs +4 -4
  251. package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
  252. package/es/components/dialog/src/dialog.d.ts +1 -1
  253. package/es/components/dialog/src/dialog.vue.d.ts +9 -8
  254. package/es/components/dialog/src/dialog2.mjs +2 -10
  255. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  256. package/es/components/drawer/index.d.ts +4 -4
  257. package/es/components/drawer/src/drawer.d.ts +1 -1
  258. package/es/components/drawer/src/drawer.vue.d.ts +4 -4
  259. package/es/components/drawer/src/drawer2.mjs +1 -9
  260. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  261. package/es/components/form/index.mjs +2 -2
  262. package/es/components/form/src/form.mjs +54 -152
  263. package/es/components/form/src/form.mjs.map +1 -1
  264. package/es/components/form/src/form2.mjs +152 -54
  265. package/es/components/form/src/form2.mjs.map +1 -1
  266. package/es/components/index.mjs +4 -4
  267. package/es/components/input/index.mjs +2 -2
  268. package/es/components/input/src/input.mjs +454 -115
  269. package/es/components/input/src/input.mjs.map +1 -1
  270. package/es/components/input/src/input2.mjs +115 -454
  271. package/es/components/input/src/input2.mjs.map +1 -1
  272. package/es/components/message/src/message.vue.d.ts +1 -1
  273. package/es/components/notification/src/notification.vue.d.ts +1 -1
  274. package/es/components/scrollbar/index.mjs +1 -1
  275. package/es/components/scrollbar/src/bar2.mjs +1 -1
  276. package/es/components/scrollbar/src/thumb.mjs +11 -130
  277. package/es/components/scrollbar/src/thumb.mjs.map +1 -1
  278. package/es/components/scrollbar/src/thumb2.mjs +130 -11
  279. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  280. package/es/components/table/src/util.mjs +1 -1
  281. package/es/components/table/src/util.mjs.map +1 -1
  282. package/es/components/time-select/index.mjs +1 -1
  283. package/es/components/time-select/src/time-select.mjs +48 -120
  284. package/es/components/time-select/src/time-select.mjs.map +1 -1
  285. package/es/components/time-select/src/time-select2.mjs +120 -48
  286. package/es/components/time-select/src/time-select2.mjs.map +1 -1
  287. package/es/components/tour/src/content.mjs +44 -63
  288. package/es/components/tour/src/content.mjs.map +1 -1
  289. package/es/components/tour/src/content2.mjs +63 -44
  290. package/es/components/tour/src/content2.mjs.map +1 -1
  291. package/es/components/tour/src/step.mjs +1 -1
  292. package/es/components/tour/src/tour.mjs +1 -1
  293. package/es/components/tour/src/tour2.mjs +1 -1
  294. package/es/components/transfer/index.mjs +2 -2
  295. package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
  296. package/es/components/transfer/src/transfer-panel.mjs +1 -1
  297. package/es/components/transfer/src/transfer.mjs +160 -69
  298. package/es/components/transfer/src/transfer.mjs.map +1 -1
  299. package/es/components/transfer/src/transfer2.mjs +69 -160
  300. package/es/components/transfer/src/transfer2.mjs.map +1 -1
  301. package/es/hooks/use-draggable/index.d.ts +1 -1
  302. package/es/hooks/use-draggable/index.mjs +7 -3
  303. package/es/hooks/use-draggable/index.mjs.map +1 -1
  304. package/es/index.mjs +4 -4
  305. package/es/version.d.ts +1 -1
  306. package/es/version.mjs +1 -1
  307. package/es/version.mjs.map +1 -1
  308. package/lib/components/dialog/index.d.ts +9 -8
  309. package/lib/components/dialog/src/dialog-content.d.ts +1 -1
  310. package/lib/components/dialog/src/dialog-content.js +1 -4
  311. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  312. package/lib/components/dialog/src/dialog-content.vue.d.ts +5 -4
  313. package/lib/components/dialog/src/dialog-content2.js +4 -4
  314. package/lib/components/dialog/src/dialog-content2.js.map +1 -1
  315. package/lib/components/dialog/src/dialog.d.ts +1 -1
  316. package/lib/components/dialog/src/dialog.vue.d.ts +9 -8
  317. package/lib/components/dialog/src/dialog2.js +2 -10
  318. package/lib/components/dialog/src/dialog2.js.map +1 -1
  319. package/lib/components/drawer/index.d.ts +4 -4
  320. package/lib/components/drawer/src/drawer.d.ts +1 -1
  321. package/lib/components/drawer/src/drawer.vue.d.ts +4 -4
  322. package/lib/components/drawer/src/drawer2.js +1 -9
  323. package/lib/components/drawer/src/drawer2.js.map +1 -1
  324. package/lib/components/form/index.js +2 -2
  325. package/lib/components/form/src/form.js +54 -151
  326. package/lib/components/form/src/form.js.map +1 -1
  327. package/lib/components/form/src/form2.js +151 -54
  328. package/lib/components/form/src/form2.js.map +1 -1
  329. package/lib/components/index.js +4 -4
  330. package/lib/components/input/index.js +2 -2
  331. package/lib/components/input/src/input.js +453 -115
  332. package/lib/components/input/src/input.js.map +1 -1
  333. package/lib/components/input/src/input2.js +115 -453
  334. package/lib/components/input/src/input2.js.map +1 -1
  335. package/lib/components/message/src/message.vue.d.ts +1 -1
  336. package/lib/components/notification/src/notification.vue.d.ts +1 -1
  337. package/lib/components/scrollbar/index.js +1 -1
  338. package/lib/components/scrollbar/src/bar2.js +1 -1
  339. package/lib/components/scrollbar/src/thumb.js +11 -130
  340. package/lib/components/scrollbar/src/thumb.js.map +1 -1
  341. package/lib/components/scrollbar/src/thumb2.js +130 -11
  342. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  343. package/lib/components/table/src/util.js +1 -1
  344. package/lib/components/table/src/util.js.map +1 -1
  345. package/lib/components/time-select/index.js +1 -1
  346. package/lib/components/time-select/src/time-select.js +48 -125
  347. package/lib/components/time-select/src/time-select.js.map +1 -1
  348. package/lib/components/time-select/src/time-select2.js +125 -48
  349. package/lib/components/time-select/src/time-select2.js.map +1 -1
  350. package/lib/components/tour/src/content.js +45 -63
  351. package/lib/components/tour/src/content.js.map +1 -1
  352. package/lib/components/tour/src/content2.js +63 -45
  353. package/lib/components/tour/src/content2.js.map +1 -1
  354. package/lib/components/tour/src/step.js +1 -1
  355. package/lib/components/tour/src/tour.js +1 -1
  356. package/lib/components/tour/src/tour2.js +1 -1
  357. package/lib/components/transfer/index.js +2 -2
  358. package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
  359. package/lib/components/transfer/src/transfer-panel.js +1 -1
  360. package/lib/components/transfer/src/transfer.js +160 -73
  361. package/lib/components/transfer/src/transfer.js.map +1 -1
  362. package/lib/components/transfer/src/transfer2.js +73 -160
  363. package/lib/components/transfer/src/transfer2.js.map +1 -1
  364. package/lib/hooks/use-draggable/index.d.ts +1 -1
  365. package/lib/hooks/use-draggable/index.js +7 -3
  366. package/lib/hooks/use-draggable/index.js.map +1 -1
  367. package/lib/index.js +4 -4
  368. package/lib/version.d.ts +1 -1
  369. package/lib/version.js +1 -1
  370. package/lib/version.js.map +1 -1
  371. package/package.json +2 -2
  372. package/tags.json +1 -1
  373. package/theme-chalk/el-dialog.css +1 -1
  374. package/theme-chalk/index.css +1 -1
  375. package/theme-chalk/src/common/var.scss +1 -1
  376. package/theme-chalk/src/dialog.scss +13 -11
  377. package/web-types.json +1 -1
@@ -1,68 +1,49 @@
1
- import { defineComponent, ref, watch, toRef, computed, inject, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, createVNode, withCtx, renderSlot, createCommentVNode } from 'vue';
2
- import '../../focus-trap/index.mjs';
3
- import { tourContentProps, tourContentEmits } from './content2.mjs';
4
- import { useFloating, tourKey } from './helper.mjs';
5
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
- import ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';
1
+ import '../../../utils/index.mjs';
2
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
7
3
 
8
- const _hoisted_1 = ["data-side"];
9
- const __default__ = defineComponent({
10
- name: "ElTourContent"
11
- });
12
- const _sfc_main = /* @__PURE__ */ defineComponent({
13
- ...__default__,
14
- props: tourContentProps,
15
- emits: tourContentEmits,
16
- setup(__props, { emit }) {
17
- const props = __props;
18
- const placement = ref(props.placement);
19
- const strategy = ref(props.strategy);
20
- const contentRef = ref(null);
21
- const arrowRef = ref(null);
22
- watch(() => props.placement, () => {
23
- placement.value = props.placement;
24
- });
25
- const { contentStyle, arrowStyle } = useFloating(toRef(props, "reference"), contentRef, arrowRef, placement, strategy, toRef(props, "offset"), toRef(props, "zIndex"), toRef(props, "showArrow"));
26
- const side = computed(() => {
27
- return placement.value.split("-")[0];
28
- });
29
- const { ns } = inject(tourKey);
30
- const onCloseRequested = () => {
31
- emit("close");
32
- };
33
- return (_ctx, _cache) => {
34
- return openBlock(), createElementBlock("div", {
35
- ref_key: "contentRef",
36
- ref: contentRef,
37
- style: normalizeStyle(unref(contentStyle)),
38
- class: normalizeClass(unref(ns).e("content")),
39
- "data-side": unref(side),
40
- tabindex: "-1"
41
- }, [
42
- createVNode(unref(ElFocusTrap), {
43
- loop: "",
44
- trapped: "",
45
- "focus-start-el": "container",
46
- "focus-trap-el": contentRef.value || void 0,
47
- onReleaseRequested: onCloseRequested
48
- }, {
49
- default: withCtx(() => [
50
- renderSlot(_ctx.$slots, "default")
51
- ]),
52
- _: 3
53
- }, 8, ["focus-trap-el"]),
54
- _ctx.showArrow ? (openBlock(), createElementBlock("span", {
55
- key: 0,
56
- ref_key: "arrowRef",
57
- ref: arrowRef,
58
- style: normalizeStyle(unref(arrowStyle)),
59
- class: normalizeClass(unref(ns).e("arrow"))
60
- }, null, 6)) : createCommentVNode("v-if", true)
61
- ], 14, _hoisted_1);
62
- };
4
+ const tourStrategies = ["absolute", "fixed"];
5
+ const tourPlacements = [
6
+ "top-start",
7
+ "top-end",
8
+ "top",
9
+ "bottom-start",
10
+ "bottom-end",
11
+ "bottom",
12
+ "left-start",
13
+ "left-end",
14
+ "left",
15
+ "right-start",
16
+ "right-end",
17
+ "right"
18
+ ];
19
+ const tourContentProps = buildProps({
20
+ placement: {
21
+ type: definePropType(String),
22
+ values: tourPlacements,
23
+ default: "bottom"
24
+ },
25
+ reference: {
26
+ type: definePropType(Object),
27
+ default: null
28
+ },
29
+ strategy: {
30
+ type: definePropType(String),
31
+ values: tourStrategies,
32
+ default: "absolute"
33
+ },
34
+ offset: {
35
+ type: Number,
36
+ default: 10
37
+ },
38
+ showArrow: Boolean,
39
+ zIndex: {
40
+ type: Number,
41
+ default: 2001
63
42
  }
64
43
  });
65
- var ElTourContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "content.vue"]]);
44
+ const tourContentEmits = {
45
+ close: () => true
46
+ };
66
47
 
67
- export { ElTourContent as default };
48
+ export { tourContentEmits, tourContentProps };
68
49
  //# sourceMappingURL=content.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"content.mjs","sources":["../../../../../../packages/components/tour/src/content.vue"],"sourcesContent":["<template>\n <div\n ref=\"contentRef\"\n :style=\"contentStyle\"\n :class=\"ns.e('content')\"\n :data-side=\"side\"\n tabindex=\"-1\"\n >\n <el-focus-trap\n loop\n trapped\n focus-start-el=\"container\"\n :focus-trap-el=\"contentRef || undefined\"\n @release-requested=\"onCloseRequested\"\n >\n <slot />\n </el-focus-trap>\n <span\n v-if=\"showArrow\"\n ref=\"arrowRef\"\n :style=\"arrowStyle\"\n :class=\"ns.e('arrow')\"\n />\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, inject, ref, toRef, watch } from 'vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { tourContentEmits, tourContentProps } from './content'\nimport { tourKey, useFloating } from './helper'\n\ndefineOptions({\n name: 'ElTourContent',\n})\n\nconst props = defineProps(tourContentProps)\nconst emit = defineEmits(tourContentEmits)\n\nconst placement = ref(props.placement)\nconst strategy = ref(props.strategy)\nconst contentRef = ref<HTMLElement | null>(null)\nconst arrowRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.placement,\n () => {\n placement.value = props.placement\n }\n)\n\nconst { contentStyle, arrowStyle } = useFloating(\n toRef(props, 'reference'),\n contentRef,\n arrowRef,\n placement,\n strategy,\n toRef(props, 'offset'),\n toRef(props, 'zIndex'),\n toRef(props, 'showArrow')\n)\n\nconst side = computed(() => {\n return placement.value.split('-')[0]\n})\n\nconst { ns } = inject(tourKey)!\n\nconst onCloseRequested = () => {\n emit('close')\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;mCA+Bc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,SAAA,GAAY,GAAI,CAAA,KAAA,CAAM,SAAS,CAAA,CAAA;AACrC,IAAM,MAAA,QAAA,GAAW,GAAI,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AACnC,IAAM,MAAA,UAAA,GAAa,IAAwB,IAAI,CAAA,CAAA;AAC/C,IAAM,MAAA,QAAA,GAAW,IAAwB,IAAI,CAAA,CAAA;AAE7C,IACE,KAAA,CAAA,MAAM,KAAM,CAAA,SAAA,EACZ,MAAM;AACJ,MAAA,SAAA,CAAU,QAAQ,KAAM,CAAA,SAAA,CAAA;AAAA,KAE5B,CAAA,CAAA;AAEA,IAAM,MAAA,EAAE,cAAc,UAAe,EAAA,GAAA,WAAA,CACnC,MAAM,KAAO,EAAA,WAAW,CACxB,EAAA,UAAA,EACA,QACA,EAAA,SAAA,EACA,UACA,KAAM,CAAA,KAAA,EAAO,QAAQ,CAAA,EACrB,KAAM,CAAA,KAAA,EAAO,QAAQ,CACrB,EAAA,KAAA,CAAM,KAAO,EAAA,WAAW,CAC1B,CAAA,CAAA;AAEA,IAAM,MAAA,IAAA,GAAO,SAAS,MAAM;AAC1B,MAAA,OAAO,SAAU,CAAA,KAAA,CAAM,KAAM,CAAA,GAAG,CAAE,CAAA,CAAA,CAAA,CAAA;AAAA,KACnC,CAAA,CAAA;AAED,IAAM,MAAA,EAAE,EAAO,EAAA,GAAA,MAAA,CAAO,OAAO,CAAA,CAAA;AAE7B,IAAA,MAAM,mBAAmB,MAAM;AAC7B,MAAA,IAAA,CAAK,OAAO,CAAA,CAAA;AAAA,KACd,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"content.mjs","sources":["../../../../../../packages/components/tour/src/content.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { Placement, Strategy, VirtualElement } from '@floating-ui/dom'\n\nconst tourStrategies = ['absolute', 'fixed'] as const\n\nconst tourPlacements = [\n 'top-start',\n 'top-end',\n 'top',\n 'bottom-start',\n 'bottom-end',\n 'bottom',\n 'left-start',\n 'left-end',\n 'left',\n 'right-start',\n 'right-end',\n 'right',\n] as const\n\nexport const tourContentProps = buildProps({\n /**\n * @description position of the guide card relative to the target element\n */\n placement: {\n type: definePropType<Placement>(String),\n values: tourPlacements,\n default: 'bottom',\n },\n /**\n * @description the reference dom\n */\n reference: {\n type: definePropType<HTMLElement | VirtualElement | null>(Object),\n default: null,\n },\n /**\n * @description position strategy of the content\n */\n strategy: {\n type: definePropType<Strategy>(String),\n values: tourStrategies,\n default: 'absolute',\n },\n /**\n * @description offset of the arrow\n */\n offset: {\n type: Number,\n default: 10,\n },\n /**\n * @description @description whether to show the arrow\n */\n showArrow: Boolean,\n /**\n * @description content's zIndex\n */\n zIndex: {\n type: Number,\n default: 2001,\n },\n})\n\nexport type TourContentProps = ExtractPropTypes<typeof tourContentProps>\n\nexport const tourContentEmits = {\n close: () => true,\n}\nexport type TourContentEmits = typeof tourContentEmits\n"],"names":[],"mappings":";;;AACA,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC7C,MAAM,cAAc,GAAG;AACvB,EAAE,WAAW;AACb,EAAE,SAAS;AACX,EAAE,KAAK;AACP,EAAE,cAAc;AAChB,EAAE,YAAY;AACd,EAAE,QAAQ;AACV,EAAE,YAAY;AACd,EAAE,UAAU;AACZ,EAAE,MAAM;AACR,EAAE,aAAa;AACf,EAAE,WAAW;AACb,EAAE,OAAO;AACT,CAAC,CAAC;AACU,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,UAAU;AACvB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB;;;;"}
@@ -1,49 +1,68 @@
1
- import '../../../utils/index.mjs';
2
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
1
+ import { defineComponent, ref, watch, toRef, computed, inject, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, createVNode, withCtx, renderSlot, createCommentVNode } from 'vue';
2
+ import '../../focus-trap/index.mjs';
3
+ import { tourContentProps, tourContentEmits } from './content.mjs';
4
+ import { useFloating, tourKey } from './helper.mjs';
5
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';
3
7
 
4
- const tourStrategies = ["absolute", "fixed"];
5
- const tourPlacements = [
6
- "top-start",
7
- "top-end",
8
- "top",
9
- "bottom-start",
10
- "bottom-end",
11
- "bottom",
12
- "left-start",
13
- "left-end",
14
- "left",
15
- "right-start",
16
- "right-end",
17
- "right"
18
- ];
19
- const tourContentProps = buildProps({
20
- placement: {
21
- type: definePropType(String),
22
- values: tourPlacements,
23
- default: "bottom"
24
- },
25
- reference: {
26
- type: definePropType(Object),
27
- default: null
28
- },
29
- strategy: {
30
- type: definePropType(String),
31
- values: tourStrategies,
32
- default: "absolute"
33
- },
34
- offset: {
35
- type: Number,
36
- default: 10
37
- },
38
- showArrow: Boolean,
39
- zIndex: {
40
- type: Number,
41
- default: 2001
8
+ const _hoisted_1 = ["data-side"];
9
+ const __default__ = defineComponent({
10
+ name: "ElTourContent"
11
+ });
12
+ const _sfc_main = /* @__PURE__ */ defineComponent({
13
+ ...__default__,
14
+ props: tourContentProps,
15
+ emits: tourContentEmits,
16
+ setup(__props, { emit }) {
17
+ const props = __props;
18
+ const placement = ref(props.placement);
19
+ const strategy = ref(props.strategy);
20
+ const contentRef = ref(null);
21
+ const arrowRef = ref(null);
22
+ watch(() => props.placement, () => {
23
+ placement.value = props.placement;
24
+ });
25
+ const { contentStyle, arrowStyle } = useFloating(toRef(props, "reference"), contentRef, arrowRef, placement, strategy, toRef(props, "offset"), toRef(props, "zIndex"), toRef(props, "showArrow"));
26
+ const side = computed(() => {
27
+ return placement.value.split("-")[0];
28
+ });
29
+ const { ns } = inject(tourKey);
30
+ const onCloseRequested = () => {
31
+ emit("close");
32
+ };
33
+ return (_ctx, _cache) => {
34
+ return openBlock(), createElementBlock("div", {
35
+ ref_key: "contentRef",
36
+ ref: contentRef,
37
+ style: normalizeStyle(unref(contentStyle)),
38
+ class: normalizeClass(unref(ns).e("content")),
39
+ "data-side": unref(side),
40
+ tabindex: "-1"
41
+ }, [
42
+ createVNode(unref(ElFocusTrap), {
43
+ loop: "",
44
+ trapped: "",
45
+ "focus-start-el": "container",
46
+ "focus-trap-el": contentRef.value || void 0,
47
+ onReleaseRequested: onCloseRequested
48
+ }, {
49
+ default: withCtx(() => [
50
+ renderSlot(_ctx.$slots, "default")
51
+ ]),
52
+ _: 3
53
+ }, 8, ["focus-trap-el"]),
54
+ _ctx.showArrow ? (openBlock(), createElementBlock("span", {
55
+ key: 0,
56
+ ref_key: "arrowRef",
57
+ ref: arrowRef,
58
+ style: normalizeStyle(unref(arrowStyle)),
59
+ class: normalizeClass(unref(ns).e("arrow"))
60
+ }, null, 6)) : createCommentVNode("v-if", true)
61
+ ], 14, _hoisted_1);
62
+ };
42
63
  }
43
64
  });
44
- const tourContentEmits = {
45
- close: () => true
46
- };
65
+ var ElTourContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "content.vue"]]);
47
66
 
48
- export { tourContentEmits, tourContentProps };
67
+ export { ElTourContent as default };
49
68
  //# sourceMappingURL=content2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"content2.mjs","sources":["../../../../../../packages/components/tour/src/content.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { Placement, Strategy, VirtualElement } from '@floating-ui/dom'\n\nconst tourStrategies = ['absolute', 'fixed'] as const\n\nconst tourPlacements = [\n 'top-start',\n 'top-end',\n 'top',\n 'bottom-start',\n 'bottom-end',\n 'bottom',\n 'left-start',\n 'left-end',\n 'left',\n 'right-start',\n 'right-end',\n 'right',\n] as const\n\nexport const tourContentProps = buildProps({\n /**\n * @description position of the guide card relative to the target element\n */\n placement: {\n type: definePropType<Placement>(String),\n values: tourPlacements,\n default: 'bottom',\n },\n /**\n * @description the reference dom\n */\n reference: {\n type: definePropType<HTMLElement | VirtualElement | null>(Object),\n default: null,\n },\n /**\n * @description position strategy of the content\n */\n strategy: {\n type: definePropType<Strategy>(String),\n values: tourStrategies,\n default: 'absolute',\n },\n /**\n * @description offset of the arrow\n */\n offset: {\n type: Number,\n default: 10,\n },\n /**\n * @description @description whether to show the arrow\n */\n showArrow: Boolean,\n /**\n * @description content's zIndex\n */\n zIndex: {\n type: Number,\n default: 2001,\n },\n})\n\nexport type TourContentProps = ExtractPropTypes<typeof tourContentProps>\n\nexport const tourContentEmits = {\n close: () => true,\n}\nexport type TourContentEmits = typeof tourContentEmits\n"],"names":[],"mappings":";;;AACA,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC7C,MAAM,cAAc,GAAG;AACvB,EAAE,WAAW;AACb,EAAE,SAAS;AACX,EAAE,KAAK;AACP,EAAE,cAAc;AAChB,EAAE,YAAY;AACd,EAAE,QAAQ;AACV,EAAE,YAAY;AACd,EAAE,UAAU;AACZ,EAAE,MAAM;AACR,EAAE,aAAa;AACf,EAAE,WAAW;AACb,EAAE,OAAO;AACT,CAAC,CAAC;AACU,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,UAAU;AACvB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB;;;;"}
1
+ {"version":3,"file":"content2.mjs","sources":["../../../../../../packages/components/tour/src/content.vue"],"sourcesContent":["<template>\n <div\n ref=\"contentRef\"\n :style=\"contentStyle\"\n :class=\"ns.e('content')\"\n :data-side=\"side\"\n tabindex=\"-1\"\n >\n <el-focus-trap\n loop\n trapped\n focus-start-el=\"container\"\n :focus-trap-el=\"contentRef || undefined\"\n @release-requested=\"onCloseRequested\"\n >\n <slot />\n </el-focus-trap>\n <span\n v-if=\"showArrow\"\n ref=\"arrowRef\"\n :style=\"arrowStyle\"\n :class=\"ns.e('arrow')\"\n />\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { computed, inject, ref, toRef, watch } from 'vue'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { tourContentEmits, tourContentProps } from './content'\nimport { tourKey, useFloating } from './helper'\n\ndefineOptions({\n name: 'ElTourContent',\n})\n\nconst props = defineProps(tourContentProps)\nconst emit = defineEmits(tourContentEmits)\n\nconst placement = ref(props.placement)\nconst strategy = ref(props.strategy)\nconst contentRef = ref<HTMLElement | null>(null)\nconst arrowRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.placement,\n () => {\n placement.value = props.placement\n }\n)\n\nconst { contentStyle, arrowStyle } = useFloating(\n toRef(props, 'reference'),\n contentRef,\n arrowRef,\n placement,\n strategy,\n toRef(props, 'offset'),\n toRef(props, 'zIndex'),\n toRef(props, 'showArrow')\n)\n\nconst side = computed(() => {\n return placement.value.split('-')[0]\n})\n\nconst { ns } = inject(tourKey)!\n\nconst onCloseRequested = () => {\n emit('close')\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;mCA+Bc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,SAAA,GAAY,GAAI,CAAA,KAAA,CAAM,SAAS,CAAA,CAAA;AACrC,IAAM,MAAA,QAAA,GAAW,GAAI,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AACnC,IAAM,MAAA,UAAA,GAAa,IAAwB,IAAI,CAAA,CAAA;AAC/C,IAAM,MAAA,QAAA,GAAW,IAAwB,IAAI,CAAA,CAAA;AAE7C,IACE,KAAA,CAAA,MAAM,KAAM,CAAA,SAAA,EACZ,MAAM;AACJ,MAAA,SAAA,CAAU,QAAQ,KAAM,CAAA,SAAA,CAAA;AAAA,KAE5B,CAAA,CAAA;AAEA,IAAM,MAAA,EAAE,cAAc,UAAe,EAAA,GAAA,WAAA,CACnC,MAAM,KAAO,EAAA,WAAW,CACxB,EAAA,UAAA,EACA,QACA,EAAA,SAAA,EACA,UACA,KAAM,CAAA,KAAA,EAAO,QAAQ,CAAA,EACrB,KAAM,CAAA,KAAA,EAAO,QAAQ,CACrB,EAAA,KAAA,CAAM,KAAO,EAAA,WAAW,CAC1B,CAAA,CAAA;AAEA,IAAM,MAAA,IAAA,GAAO,SAAS,MAAM;AAC1B,MAAA,OAAO,SAAU,CAAA,KAAA,CAAM,KAAM,CAAA,GAAG,CAAE,CAAA,CAAA,CAAA,CAAA;AAAA,KACnC,CAAA,CAAA;AAED,IAAM,MAAA,EAAE,EAAO,EAAA,GAAA,MAAA,CAAO,OAAO,CAAA,CAAA;AAE7B,IAAA,MAAM,mBAAmB,MAAM;AAC7B,MAAA,IAAA,CAAK,OAAO,CAAA,CAAA;AAAA,KACd,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import '../../../utils/index.mjs';
2
- import { tourContentProps } from './content2.mjs';
2
+ import { tourContentProps } from './content.mjs';
3
3
  import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
4
4
  import { iconPropType } from '../../../utils/vue/icon.mjs';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import '../../../utils/index.mjs';
2
2
  import '../../../constants/index.mjs';
3
- import { tourContentProps } from './content2.mjs';
3
+ import { tourContentProps } from './content.mjs';
4
4
  import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
5
5
  import { iconPropType } from '../../../utils/vue/icon.mjs';
6
6
  import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
@@ -3,7 +3,7 @@ import { useVModel } from '@vueuse/core';
3
3
  import '../../../hooks/index.mjs';
4
4
  import '../../../utils/index.mjs';
5
5
  import ElTourMask from './mask2.mjs';
6
- import ElTourContent from './content.mjs';
6
+ import ElTourContent from './content2.mjs';
7
7
  import ElTourSteps from './steps.mjs';
8
8
  import { tourProps, tourEmits } from './tour.mjs';
9
9
  import { useTarget, tourKey } from './helper.mjs';
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
- import Transfer from './src/transfer2.mjs';
3
- export { LEFT_CHECK_CHANGE_EVENT, RIGHT_CHECK_CHANGE_EVENT, transferCheckedChangeFn, transferEmits, transferProps } from './src/transfer.mjs';
2
+ import Transfer from './src/transfer.mjs';
3
+ export { LEFT_CHECK_CHANGE_EVENT, RIGHT_CHECK_CHANGE_EVENT, transferCheckedChangeFn, transferEmits, transferProps } from './src/transfer2.mjs';
4
4
  import { withInstall } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const ElTransfer = withInstall(Transfer);
@@ -1,4 +1,4 @@
1
- import { LEFT_CHECK_CHANGE_EVENT, RIGHT_CHECK_CHANGE_EVENT } from '../transfer.mjs';
1
+ import { LEFT_CHECK_CHANGE_EVENT, RIGHT_CHECK_CHANGE_EVENT } from '../transfer2.mjs';
2
2
 
3
3
  const useCheckedChange = (checkedState, emit) => {
4
4
  const onSourceCheckedChange = (val, movedKeys) => {
@@ -1,5 +1,5 @@
1
1
  import '../../../utils/index.mjs';
2
- import { transferProps, transferCheckedChangeFn } from './transfer.mjs';
2
+ import { transferProps, transferCheckedChangeFn } from './transfer2.mjs';
3
3
  import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
4
4
 
5
5
  const CHECKED_CHANGE_EVENT = "checked-change";
@@ -1,75 +1,166 @@
1
- import { isNil } from 'lodash-unified';
1
+ import { defineComponent, useSlots, reactive, ref, computed, watch, h, openBlock, createElementBlock, normalizeClass, unref, createVNode, withCtx, renderSlot, createElementVNode, toDisplayString, createCommentVNode } from 'vue';
2
2
  import '../../../utils/index.mjs';
3
- import '../../../constants/index.mjs';
4
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
5
- import { mutable } from '../../../utils/typescript.mjs';
6
- import { isArray } from '@vue/shared';
7
- import { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
3
+ import '../../../hooks/index.mjs';
4
+ import { ElButton } from '../../button/index.mjs';
5
+ import { ElIcon } from '../../icon/index.mjs';
6
+ import '../../form/index.mjs';
7
+ import { ArrowLeft, ArrowRight } from '@element-plus/icons-vue';
8
+ import { transferProps, transferEmits } from './transfer2.mjs';
9
+ import './composables/index.mjs';
10
+ import TransferPanel from './transfer-panel2.mjs';
11
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
12
+ import { useLocale } from '../../../hooks/use-locale/index.mjs';
13
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
14
+ import { useFormItem } from '../../form/src/hooks/use-form-item.mjs';
15
+ import { usePropsAlias } from './composables/use-props-alias.mjs';
16
+ import { useComputedData } from './composables/use-computed-data.mjs';
17
+ import { useCheckedChange } from './composables/use-checked-change.mjs';
18
+ import { useMove } from './composables/use-move.mjs';
19
+ import { debugWarn } from '../../../utils/error.mjs';
20
+ import { isEmpty, isUndefined } from '../../../utils/types.mjs';
8
21
 
9
- const LEFT_CHECK_CHANGE_EVENT = "left-check-change";
10
- const RIGHT_CHECK_CHANGE_EVENT = "right-check-change";
11
- const transferProps = buildProps({
12
- data: {
13
- type: definePropType(Array),
14
- default: () => []
15
- },
16
- titles: {
17
- type: definePropType(Array),
18
- default: () => []
19
- },
20
- buttonTexts: {
21
- type: definePropType(Array),
22
- default: () => []
23
- },
24
- filterPlaceholder: String,
25
- filterMethod: {
26
- type: definePropType(Function)
27
- },
28
- leftDefaultChecked: {
29
- type: definePropType(Array),
30
- default: () => []
31
- },
32
- rightDefaultChecked: {
33
- type: definePropType(Array),
34
- default: () => []
35
- },
36
- renderContent: {
37
- type: definePropType(Function)
38
- },
39
- modelValue: {
40
- type: definePropType(Array),
41
- default: () => []
42
- },
43
- format: {
44
- type: definePropType(Object),
45
- default: () => ({})
46
- },
47
- filterable: Boolean,
48
- props: {
49
- type: definePropType(Object),
50
- default: () => mutable({
51
- label: "label",
52
- key: "key",
53
- disabled: "disabled"
54
- })
55
- },
56
- targetOrder: {
57
- type: String,
58
- values: ["original", "push", "unshift"],
59
- default: "original"
60
- },
61
- validateEvent: {
62
- type: Boolean,
63
- default: true
22
+ const _hoisted_1 = { key: 0 };
23
+ const _hoisted_2 = { key: 0 };
24
+ const __default__ = defineComponent({
25
+ name: "ElTransfer"
26
+ });
27
+ const _sfc_main = /* @__PURE__ */ defineComponent({
28
+ ...__default__,
29
+ props: transferProps,
30
+ emits: transferEmits,
31
+ setup(__props, { expose, emit }) {
32
+ const props = __props;
33
+ const slots = useSlots();
34
+ const { t } = useLocale();
35
+ const ns = useNamespace("transfer");
36
+ const { formItem } = useFormItem();
37
+ const checkedState = reactive({
38
+ leftChecked: [],
39
+ rightChecked: []
40
+ });
41
+ const propsAlias = usePropsAlias(props);
42
+ const { sourceData, targetData } = useComputedData(props);
43
+ const { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(checkedState, emit);
44
+ const { addToLeft, addToRight } = useMove(props, checkedState, emit);
45
+ const leftPanel = ref();
46
+ const rightPanel = ref();
47
+ const clearQuery = (which) => {
48
+ switch (which) {
49
+ case "left":
50
+ leftPanel.value.query = "";
51
+ break;
52
+ case "right":
53
+ rightPanel.value.query = "";
54
+ break;
55
+ }
56
+ };
57
+ const hasButtonTexts = computed(() => props.buttonTexts.length === 2);
58
+ const leftPanelTitle = computed(() => props.titles[0] || t("el.transfer.titles.0"));
59
+ const rightPanelTitle = computed(() => props.titles[1] || t("el.transfer.titles.1"));
60
+ const panelFilterPlaceholder = computed(() => props.filterPlaceholder || t("el.transfer.filterPlaceholder"));
61
+ watch(() => props.modelValue, () => {
62
+ var _a;
63
+ if (props.validateEvent) {
64
+ (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
65
+ }
66
+ });
67
+ const optionRender = computed(() => (option) => {
68
+ if (props.renderContent)
69
+ return props.renderContent(h, option);
70
+ if (slots.default)
71
+ return slots.default({ option });
72
+ return h("span", option[propsAlias.value.label] || option[propsAlias.value.key]);
73
+ });
74
+ expose({
75
+ clearQuery,
76
+ leftPanel,
77
+ rightPanel
78
+ });
79
+ return (_ctx, _cache) => {
80
+ return openBlock(), createElementBlock("div", {
81
+ class: normalizeClass(unref(ns).b())
82
+ }, [
83
+ createVNode(TransferPanel, {
84
+ ref_key: "leftPanel",
85
+ ref: leftPanel,
86
+ data: unref(sourceData),
87
+ "option-render": unref(optionRender),
88
+ placeholder: unref(panelFilterPlaceholder),
89
+ title: unref(leftPanelTitle),
90
+ filterable: _ctx.filterable,
91
+ format: _ctx.format,
92
+ "filter-method": _ctx.filterMethod,
93
+ "default-checked": _ctx.leftDefaultChecked,
94
+ props: props.props,
95
+ onCheckedChange: unref(onSourceCheckedChange)
96
+ }, {
97
+ default: withCtx(() => [
98
+ renderSlot(_ctx.$slots, "left-footer")
99
+ ]),
100
+ _: 3
101
+ }, 8, ["data", "option-render", "placeholder", "title", "filterable", "format", "filter-method", "default-checked", "props", "onCheckedChange"]),
102
+ createElementVNode("div", {
103
+ class: normalizeClass(unref(ns).e("buttons"))
104
+ }, [
105
+ createVNode(unref(ElButton), {
106
+ type: "primary",
107
+ class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", unref(hasButtonTexts))]),
108
+ disabled: unref(isEmpty)(checkedState.rightChecked),
109
+ onClick: unref(addToLeft)
110
+ }, {
111
+ default: withCtx(() => [
112
+ createVNode(unref(ElIcon), null, {
113
+ default: withCtx(() => [
114
+ createVNode(unref(ArrowLeft))
115
+ ]),
116
+ _: 1
117
+ }),
118
+ !unref(isUndefined)(_ctx.buttonTexts[0]) ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(_ctx.buttonTexts[0]), 1)) : createCommentVNode("v-if", true)
119
+ ]),
120
+ _: 1
121
+ }, 8, ["class", "disabled", "onClick"]),
122
+ createVNode(unref(ElButton), {
123
+ type: "primary",
124
+ class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", unref(hasButtonTexts))]),
125
+ disabled: unref(isEmpty)(checkedState.leftChecked),
126
+ onClick: unref(addToRight)
127
+ }, {
128
+ default: withCtx(() => [
129
+ !unref(isUndefined)(_ctx.buttonTexts[1]) ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(_ctx.buttonTexts[1]), 1)) : createCommentVNode("v-if", true),
130
+ createVNode(unref(ElIcon), null, {
131
+ default: withCtx(() => [
132
+ createVNode(unref(ArrowRight))
133
+ ]),
134
+ _: 1
135
+ })
136
+ ]),
137
+ _: 1
138
+ }, 8, ["class", "disabled", "onClick"])
139
+ ], 2),
140
+ createVNode(TransferPanel, {
141
+ ref_key: "rightPanel",
142
+ ref: rightPanel,
143
+ data: unref(targetData),
144
+ "option-render": unref(optionRender),
145
+ placeholder: unref(panelFilterPlaceholder),
146
+ filterable: _ctx.filterable,
147
+ format: _ctx.format,
148
+ "filter-method": _ctx.filterMethod,
149
+ title: unref(rightPanelTitle),
150
+ "default-checked": _ctx.rightDefaultChecked,
151
+ props: props.props,
152
+ onCheckedChange: unref(onTargetCheckedChange)
153
+ }, {
154
+ default: withCtx(() => [
155
+ renderSlot(_ctx.$slots, "right-footer")
156
+ ]),
157
+ _: 3
158
+ }, 8, ["data", "option-render", "placeholder", "filterable", "format", "filter-method", "title", "default-checked", "props", "onCheckedChange"])
159
+ ], 2);
160
+ };
64
161
  }
65
162
  });
66
- const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(isArray) || isArray(value) && isNil(movedKeys);
67
- const transferEmits = {
68
- [CHANGE_EVENT]: (value, direction, movedKeys) => [value, movedKeys].every(isArray) && ["left", "right"].includes(direction),
69
- [UPDATE_MODEL_EVENT]: (value) => isArray(value),
70
- [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
71
- [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn
72
- };
163
+ var Transfer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "transfer.vue"]]);
73
164
 
74
- export { LEFT_CHECK_CHANGE_EVENT, RIGHT_CHECK_CHANGE_EVENT, transferCheckedChangeFn, transferEmits, transferProps };
165
+ export { Transfer as default };
75
166
  //# sourceMappingURL=transfer.mjs.map