@element-plus/nightly 0.0.20241208 → 0.0.20241209

Sign up to get free protection for your applications and to get access to all the features.
Files changed (346) hide show
  1. package/dist/index.full.js +4 -4
  2. package/dist/index.full.min.js +3 -3
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +3 -3
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +4 -4
  7. package/dist/locale/af.js +1 -1
  8. package/dist/locale/af.min.js +1 -1
  9. package/dist/locale/af.min.mjs +1 -1
  10. package/dist/locale/af.mjs +1 -1
  11. package/dist/locale/ar-eg.js +1 -1
  12. package/dist/locale/ar-eg.min.js +1 -1
  13. package/dist/locale/ar-eg.min.mjs +1 -1
  14. package/dist/locale/ar-eg.mjs +1 -1
  15. package/dist/locale/ar.js +1 -1
  16. package/dist/locale/ar.min.js +1 -1
  17. package/dist/locale/ar.min.mjs +1 -1
  18. package/dist/locale/ar.mjs +1 -1
  19. package/dist/locale/az.js +1 -1
  20. package/dist/locale/az.min.js +1 -1
  21. package/dist/locale/az.min.mjs +1 -1
  22. package/dist/locale/az.mjs +1 -1
  23. package/dist/locale/bg.js +1 -1
  24. package/dist/locale/bg.min.js +1 -1
  25. package/dist/locale/bg.min.mjs +1 -1
  26. package/dist/locale/bg.mjs +1 -1
  27. package/dist/locale/bn.js +1 -1
  28. package/dist/locale/bn.min.js +1 -1
  29. package/dist/locale/bn.min.mjs +1 -1
  30. package/dist/locale/bn.mjs +1 -1
  31. package/dist/locale/ca.js +1 -1
  32. package/dist/locale/ca.min.js +1 -1
  33. package/dist/locale/ca.min.mjs +1 -1
  34. package/dist/locale/ca.mjs +1 -1
  35. package/dist/locale/ckb.js +1 -1
  36. package/dist/locale/ckb.min.js +1 -1
  37. package/dist/locale/ckb.min.mjs +1 -1
  38. package/dist/locale/ckb.mjs +1 -1
  39. package/dist/locale/cs.js +1 -1
  40. package/dist/locale/cs.min.js +1 -1
  41. package/dist/locale/cs.min.mjs +1 -1
  42. package/dist/locale/cs.mjs +1 -1
  43. package/dist/locale/da.js +1 -1
  44. package/dist/locale/da.min.js +1 -1
  45. package/dist/locale/da.min.mjs +1 -1
  46. package/dist/locale/da.mjs +1 -1
  47. package/dist/locale/de.js +1 -1
  48. package/dist/locale/de.min.js +1 -1
  49. package/dist/locale/de.min.mjs +1 -1
  50. package/dist/locale/de.mjs +1 -1
  51. package/dist/locale/el.js +1 -1
  52. package/dist/locale/el.min.js +1 -1
  53. package/dist/locale/el.min.mjs +1 -1
  54. package/dist/locale/el.mjs +1 -1
  55. package/dist/locale/en.js +1 -1
  56. package/dist/locale/en.min.js +1 -1
  57. package/dist/locale/en.min.mjs +1 -1
  58. package/dist/locale/en.mjs +1 -1
  59. package/dist/locale/eo.js +1 -1
  60. package/dist/locale/eo.min.js +1 -1
  61. package/dist/locale/eo.min.mjs +1 -1
  62. package/dist/locale/eo.mjs +1 -1
  63. package/dist/locale/es.js +1 -1
  64. package/dist/locale/es.min.js +1 -1
  65. package/dist/locale/es.min.mjs +1 -1
  66. package/dist/locale/es.mjs +1 -1
  67. package/dist/locale/et.js +1 -1
  68. package/dist/locale/et.min.js +1 -1
  69. package/dist/locale/et.min.mjs +1 -1
  70. package/dist/locale/et.mjs +1 -1
  71. package/dist/locale/eu.js +1 -1
  72. package/dist/locale/eu.min.js +1 -1
  73. package/dist/locale/eu.min.mjs +1 -1
  74. package/dist/locale/eu.mjs +1 -1
  75. package/dist/locale/fa.js +1 -1
  76. package/dist/locale/fa.min.js +1 -1
  77. package/dist/locale/fa.min.mjs +1 -1
  78. package/dist/locale/fa.mjs +1 -1
  79. package/dist/locale/fi.js +1 -1
  80. package/dist/locale/fi.min.js +1 -1
  81. package/dist/locale/fi.min.mjs +1 -1
  82. package/dist/locale/fi.mjs +1 -1
  83. package/dist/locale/fr.js +1 -1
  84. package/dist/locale/fr.min.js +1 -1
  85. package/dist/locale/fr.min.mjs +1 -1
  86. package/dist/locale/fr.mjs +1 -1
  87. package/dist/locale/he.js +1 -1
  88. package/dist/locale/he.min.js +1 -1
  89. package/dist/locale/he.min.mjs +1 -1
  90. package/dist/locale/he.mjs +1 -1
  91. package/dist/locale/hr.js +1 -1
  92. package/dist/locale/hr.min.js +1 -1
  93. package/dist/locale/hr.min.mjs +1 -1
  94. package/dist/locale/hr.mjs +1 -1
  95. package/dist/locale/hu.js +1 -1
  96. package/dist/locale/hu.min.js +1 -1
  97. package/dist/locale/hu.min.mjs +1 -1
  98. package/dist/locale/hu.mjs +1 -1
  99. package/dist/locale/hy-am.js +1 -1
  100. package/dist/locale/hy-am.min.js +1 -1
  101. package/dist/locale/hy-am.min.mjs +1 -1
  102. package/dist/locale/hy-am.mjs +1 -1
  103. package/dist/locale/id.js +1 -1
  104. package/dist/locale/id.min.js +1 -1
  105. package/dist/locale/id.min.mjs +1 -1
  106. package/dist/locale/id.mjs +1 -1
  107. package/dist/locale/it.js +1 -1
  108. package/dist/locale/it.min.js +1 -1
  109. package/dist/locale/it.min.mjs +1 -1
  110. package/dist/locale/it.mjs +1 -1
  111. package/dist/locale/ja.js +1 -1
  112. package/dist/locale/ja.min.js +1 -1
  113. package/dist/locale/ja.min.mjs +1 -1
  114. package/dist/locale/ja.mjs +1 -1
  115. package/dist/locale/kk.js +1 -1
  116. package/dist/locale/kk.min.js +1 -1
  117. package/dist/locale/kk.min.mjs +1 -1
  118. package/dist/locale/kk.mjs +1 -1
  119. package/dist/locale/km.js +1 -1
  120. package/dist/locale/km.min.js +1 -1
  121. package/dist/locale/km.min.mjs +1 -1
  122. package/dist/locale/km.mjs +1 -1
  123. package/dist/locale/ko.js +1 -1
  124. package/dist/locale/ko.min.js +1 -1
  125. package/dist/locale/ko.min.mjs +1 -1
  126. package/dist/locale/ko.mjs +1 -1
  127. package/dist/locale/ku.js +1 -1
  128. package/dist/locale/ku.min.js +1 -1
  129. package/dist/locale/ku.min.mjs +1 -1
  130. package/dist/locale/ku.mjs +1 -1
  131. package/dist/locale/ky.js +1 -1
  132. package/dist/locale/ky.min.js +1 -1
  133. package/dist/locale/ky.min.mjs +1 -1
  134. package/dist/locale/ky.mjs +1 -1
  135. package/dist/locale/lt.js +1 -1
  136. package/dist/locale/lt.min.js +1 -1
  137. package/dist/locale/lt.min.mjs +1 -1
  138. package/dist/locale/lt.mjs +1 -1
  139. package/dist/locale/lv.js +1 -1
  140. package/dist/locale/lv.min.js +1 -1
  141. package/dist/locale/lv.min.mjs +1 -1
  142. package/dist/locale/lv.mjs +1 -1
  143. package/dist/locale/mg.js +1 -1
  144. package/dist/locale/mg.min.js +1 -1
  145. package/dist/locale/mg.min.mjs +1 -1
  146. package/dist/locale/mg.mjs +1 -1
  147. package/dist/locale/mn.js +1 -1
  148. package/dist/locale/mn.min.js +1 -1
  149. package/dist/locale/mn.min.mjs +1 -1
  150. package/dist/locale/mn.mjs +1 -1
  151. package/dist/locale/ms.js +1 -1
  152. package/dist/locale/ms.min.js +1 -1
  153. package/dist/locale/ms.min.mjs +1 -1
  154. package/dist/locale/ms.mjs +1 -1
  155. package/dist/locale/my.js +1 -1
  156. package/dist/locale/my.min.js +1 -1
  157. package/dist/locale/my.min.mjs +1 -1
  158. package/dist/locale/my.mjs +1 -1
  159. package/dist/locale/nb-no.js +1 -1
  160. package/dist/locale/nb-no.min.js +1 -1
  161. package/dist/locale/nb-no.min.mjs +1 -1
  162. package/dist/locale/nb-no.mjs +1 -1
  163. package/dist/locale/nl.js +1 -1
  164. package/dist/locale/nl.min.js +1 -1
  165. package/dist/locale/nl.min.mjs +1 -1
  166. package/dist/locale/nl.mjs +1 -1
  167. package/dist/locale/pa.js +1 -1
  168. package/dist/locale/pa.min.js +1 -1
  169. package/dist/locale/pa.min.mjs +1 -1
  170. package/dist/locale/pa.mjs +1 -1
  171. package/dist/locale/pl.js +1 -1
  172. package/dist/locale/pl.min.js +1 -1
  173. package/dist/locale/pl.min.mjs +1 -1
  174. package/dist/locale/pl.mjs +1 -1
  175. package/dist/locale/pt-br.js +1 -1
  176. package/dist/locale/pt-br.min.js +1 -1
  177. package/dist/locale/pt-br.min.mjs +1 -1
  178. package/dist/locale/pt-br.mjs +1 -1
  179. package/dist/locale/pt.js +1 -1
  180. package/dist/locale/pt.min.js +1 -1
  181. package/dist/locale/pt.min.mjs +1 -1
  182. package/dist/locale/pt.mjs +1 -1
  183. package/dist/locale/ro.js +1 -1
  184. package/dist/locale/ro.min.js +1 -1
  185. package/dist/locale/ro.min.mjs +1 -1
  186. package/dist/locale/ro.mjs +1 -1
  187. package/dist/locale/ru.js +1 -1
  188. package/dist/locale/ru.min.js +1 -1
  189. package/dist/locale/ru.min.mjs +1 -1
  190. package/dist/locale/ru.mjs +1 -1
  191. package/dist/locale/sk.js +1 -1
  192. package/dist/locale/sk.min.js +1 -1
  193. package/dist/locale/sk.min.mjs +1 -1
  194. package/dist/locale/sk.mjs +1 -1
  195. package/dist/locale/sl.js +1 -1
  196. package/dist/locale/sl.min.js +1 -1
  197. package/dist/locale/sl.min.mjs +1 -1
  198. package/dist/locale/sl.mjs +1 -1
  199. package/dist/locale/sr.js +1 -1
  200. package/dist/locale/sr.min.js +1 -1
  201. package/dist/locale/sr.min.mjs +1 -1
  202. package/dist/locale/sr.mjs +1 -1
  203. package/dist/locale/sv.js +1 -1
  204. package/dist/locale/sv.min.js +1 -1
  205. package/dist/locale/sv.min.mjs +1 -1
  206. package/dist/locale/sv.mjs +1 -1
  207. package/dist/locale/sw.js +1 -1
  208. package/dist/locale/sw.min.js +1 -1
  209. package/dist/locale/sw.min.mjs +1 -1
  210. package/dist/locale/sw.mjs +1 -1
  211. package/dist/locale/ta.js +1 -1
  212. package/dist/locale/ta.min.js +1 -1
  213. package/dist/locale/ta.min.mjs +1 -1
  214. package/dist/locale/ta.mjs +1 -1
  215. package/dist/locale/th.js +1 -1
  216. package/dist/locale/th.min.js +1 -1
  217. package/dist/locale/th.min.mjs +1 -1
  218. package/dist/locale/th.mjs +1 -1
  219. package/dist/locale/tk.js +1 -1
  220. package/dist/locale/tk.min.js +1 -1
  221. package/dist/locale/tk.min.mjs +1 -1
  222. package/dist/locale/tk.mjs +1 -1
  223. package/dist/locale/tr.js +1 -1
  224. package/dist/locale/tr.min.js +1 -1
  225. package/dist/locale/tr.min.mjs +1 -1
  226. package/dist/locale/tr.mjs +1 -1
  227. package/dist/locale/ug-cn.js +1 -1
  228. package/dist/locale/ug-cn.min.js +1 -1
  229. package/dist/locale/ug-cn.min.mjs +1 -1
  230. package/dist/locale/ug-cn.mjs +1 -1
  231. package/dist/locale/uk.js +1 -1
  232. package/dist/locale/uk.min.js +1 -1
  233. package/dist/locale/uk.min.mjs +1 -1
  234. package/dist/locale/uk.mjs +1 -1
  235. package/dist/locale/uz-uz.js +1 -1
  236. package/dist/locale/uz-uz.min.js +1 -1
  237. package/dist/locale/uz-uz.min.mjs +1 -1
  238. package/dist/locale/uz-uz.mjs +1 -1
  239. package/dist/locale/vi.js +1 -1
  240. package/dist/locale/vi.min.js +1 -1
  241. package/dist/locale/vi.min.mjs +1 -1
  242. package/dist/locale/vi.mjs +1 -1
  243. package/dist/locale/zh-cn.js +1 -1
  244. package/dist/locale/zh-cn.min.js +1 -1
  245. package/dist/locale/zh-cn.min.mjs +1 -1
  246. package/dist/locale/zh-cn.mjs +1 -1
  247. package/dist/locale/zh-tw.js +1 -1
  248. package/dist/locale/zh-tw.min.js +1 -1
  249. package/dist/locale/zh-tw.min.mjs +1 -1
  250. package/dist/locale/zh-tw.mjs +1 -1
  251. package/es/components/color-picker/index.mjs +2 -2
  252. package/es/components/color-picker/src/color-picker.mjs +399 -40
  253. package/es/components/color-picker/src/color-picker.mjs.map +1 -1
  254. package/es/components/color-picker/src/color-picker2.mjs +40 -399
  255. package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
  256. package/es/components/color-picker/src/components/predefine.mjs +1 -1
  257. package/es/components/index.mjs +4 -4
  258. package/es/components/link/index.mjs +2 -2
  259. package/es/components/link/src/link.mjs +49 -24
  260. package/es/components/link/src/link.mjs.map +1 -1
  261. package/es/components/link/src/link2.mjs +24 -49
  262. package/es/components/link/src/link2.mjs.map +1 -1
  263. package/es/components/select-v2/src/useSelect.mjs +1 -1
  264. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  265. package/es/components/skeleton/index.mjs +2 -2
  266. package/es/components/skeleton/src/skeleton.mjs +48 -21
  267. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  268. package/es/components/skeleton/src/skeleton2.mjs +21 -48
  269. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  270. package/es/components/tooltip-v2/index.mjs +1 -1
  271. package/es/components/tooltip-v2/src/tooltip.mjs +1 -1
  272. package/es/components/tooltip-v2/src/tooltip2.mjs +2 -2
  273. package/es/components/tooltip-v2/src/trigger.mjs +12 -89
  274. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  275. package/es/components/tooltip-v2/src/trigger2.mjs +89 -12
  276. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  277. package/es/components/tour/index.mjs +1 -1
  278. package/es/components/tour/src/content.mjs +67 -43
  279. package/es/components/tour/src/content.mjs.map +1 -1
  280. package/es/components/tour/src/content2.mjs +43 -67
  281. package/es/components/tour/src/content2.mjs.map +1 -1
  282. package/es/components/tour/src/step.mjs +1 -1
  283. package/es/components/tour/src/tour.mjs +1 -1
  284. package/es/components/tour/src/tour2.mjs +1 -1
  285. package/es/components/transfer/src/composables/use-check.mjs +1 -1
  286. package/es/components/transfer/src/transfer-panel.mjs +19 -130
  287. package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
  288. package/es/components/transfer/src/transfer-panel2.mjs +130 -19
  289. package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
  290. package/es/components/transfer/src/transfer2.mjs +1 -1
  291. package/es/components/tree-v2/src/composables/useFilter.mjs +1 -1
  292. package/es/components/tree-v2/src/composables/useFilter.mjs.map +1 -1
  293. package/es/components/tree-v2/src/types.d.ts +1 -1
  294. package/es/index.mjs +4 -4
  295. package/es/version.d.ts +1 -1
  296. package/es/version.mjs +1 -1
  297. package/es/version.mjs.map +1 -1
  298. package/lib/components/color-picker/index.js +2 -2
  299. package/lib/components/color-picker/src/color-picker.js +397 -40
  300. package/lib/components/color-picker/src/color-picker.js.map +1 -1
  301. package/lib/components/color-picker/src/color-picker2.js +40 -397
  302. package/lib/components/color-picker/src/color-picker2.js.map +1 -1
  303. package/lib/components/color-picker/src/components/predefine.js +1 -1
  304. package/lib/components/index.js +4 -4
  305. package/lib/components/link/index.js +2 -2
  306. package/lib/components/link/src/link.js +49 -25
  307. package/lib/components/link/src/link.js.map +1 -1
  308. package/lib/components/link/src/link2.js +25 -49
  309. package/lib/components/link/src/link2.js.map +1 -1
  310. package/lib/components/select-v2/src/useSelect.js +1 -1
  311. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  312. package/lib/components/skeleton/index.js +2 -2
  313. package/lib/components/skeleton/src/skeleton.js +48 -21
  314. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  315. package/lib/components/skeleton/src/skeleton2.js +21 -48
  316. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  317. package/lib/components/tooltip-v2/index.js +1 -1
  318. package/lib/components/tooltip-v2/src/tooltip.js +1 -1
  319. package/lib/components/tooltip-v2/src/tooltip2.js +2 -2
  320. package/lib/components/tooltip-v2/src/trigger.js +12 -89
  321. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  322. package/lib/components/tooltip-v2/src/trigger2.js +89 -12
  323. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  324. package/lib/components/tour/index.js +1 -1
  325. package/lib/components/tour/src/content.js +67 -46
  326. package/lib/components/tour/src/content.js.map +1 -1
  327. package/lib/components/tour/src/content2.js +46 -67
  328. package/lib/components/tour/src/content2.js.map +1 -1
  329. package/lib/components/tour/src/step.js +1 -1
  330. package/lib/components/tour/src/tour.js +1 -1
  331. package/lib/components/tour/src/tour2.js +1 -1
  332. package/lib/components/transfer/src/composables/use-check.js +1 -1
  333. package/lib/components/transfer/src/transfer-panel.js +21 -130
  334. package/lib/components/transfer/src/transfer-panel.js.map +1 -1
  335. package/lib/components/transfer/src/transfer-panel2.js +130 -21
  336. package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
  337. package/lib/components/transfer/src/transfer2.js +1 -1
  338. package/lib/components/tree-v2/src/composables/useFilter.js +1 -1
  339. package/lib/components/tree-v2/src/composables/useFilter.js.map +1 -1
  340. package/lib/components/tree-v2/src/types.d.ts +1 -1
  341. package/lib/index.js +4 -4
  342. package/lib/version.d.ts +1 -1
  343. package/lib/version.js +1 -1
  344. package/lib/version.js.map +1 -1
  345. package/package.json +2 -2
  346. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton2.js","sources":["../../../../../../packages/components/skeleton/src/skeleton.vue"],"sourcesContent":["<template>\n <template v-if=\"uiLoading\">\n <div :class=\"[ns.b(), ns.is('animated', animated)]\" v-bind=\"$attrs\">\n <template v-for=\"i in count\" :key=\"i\">\n <slot v-if=\"uiLoading\" :key=\"i\" name=\"template\">\n <el-skeleton-item :class=\"ns.is('first')\" variant=\"p\" />\n <el-skeleton-item\n v-for=\"item in rows\"\n :key=\"item\"\n :class=\"[\n ns.e('paragraph'),\n ns.is('last', item === rows && rows > 1),\n ]\"\n variant=\"p\"\n />\n </slot>\n </template>\n </div>\n </template>\n <template v-else>\n <slot v-bind=\"$attrs\" />\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { toRef } from 'vue'\nimport { useNamespace, useThrottleRender } from '@element-plus/hooks'\nimport { skeletonProps } from './skeleton'\nimport ElSkeletonItem from './skeleton-item.vue'\n\ndefineOptions({\n name: 'ElSkeleton',\n})\nconst props = defineProps(skeletonProps)\n\nconst ns = useNamespace('skeleton')\nconst uiLoading = useThrottleRender(toRef(props, 'loading'), props.throttle)\n\ndefineExpose({\n /** @description loading state */\n uiLoading,\n})\n</script>\n"],"names":["useNamespace","useThrottleRender","toRef"],"mappings":";;;;;;;;;;;uCA8Bc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAGA,IAAM,MAAA,EAAA,GAAKA,mBAAa,UAAU,CAAA,CAAA;AAClC,IAAA,MAAM,YAAYC,yBAAkB,CAAAC,SAAA,CAAM,OAAO,SAAS,CAAA,EAAG,MAAM,QAAQ,CAAA,CAAA;AAE3E,IAAa,MAAA,CAAA;AAAA,MAAA,SAAA;AAAA,KAEX,CAAA,CAAA;AAAA,IACF,OAAC,CAAA,IAAA,EAAA,MAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"skeleton2.js","sources":["../../../../../../packages/components/skeleton/src/skeleton.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type Skeleton from './skeleton.vue'\nimport type { ExtractPropTypes } from 'vue'\nimport type { ThrottleType } from '@element-plus/hooks'\n\nexport const skeletonProps = buildProps({\n /**\n * @description whether showing the animation\n */\n animated: {\n type: Boolean,\n default: false,\n },\n /**\n * @description how many fake items to render to the DOM\n */\n count: {\n type: Number,\n default: 1,\n },\n /**\n * @description whether showing the real DOM\n */\n rows: {\n type: Number,\n default: 3,\n },\n /**\n * @description numbers of the row, only useful when no template slot were given\n */\n loading: {\n type: Boolean,\n default: true,\n },\n /**\n * @description rendering delay in milliseconds\n */\n throttle: {\n type: definePropType<ThrottleType>([Number, Object]),\n },\n} as const)\nexport type SkeletonProps = ExtractPropTypes<typeof skeletonProps>\n\nexport type SkeletonInstance = InstanceType<typeof Skeleton>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;AACY,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,CAAC;;;;"}
@@ -7,7 +7,7 @@ var arrow = require('./src/arrow.js');
7
7
  var content = require('./src/content.js');
8
8
  var root = require('./src/root.js');
9
9
  var tooltip = require('./src/tooltip.js');
10
- var trigger = require('./src/trigger2.js');
10
+ var trigger = require('./src/trigger.js');
11
11
  var constants = require('./src/constants.js');
12
12
  var install = require('../../utils/vue/install.js');
13
13
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var root = require('./root.js');
6
- var trigger = require('./trigger2.js');
6
+ var trigger = require('./trigger.js');
7
7
  var arrow = require('./arrow.js');
8
8
  var content = require('./content.js');
9
9
  var runtime = require('../../../utils/vue/props/runtime.js');
@@ -9,11 +9,11 @@ var arrow = require('./arrow.js');
9
9
  var content = require('./content.js');
10
10
  var root = require('./root.js');
11
11
  var tooltip = require('./tooltip.js');
12
- var trigger = require('./trigger2.js');
12
+ var trigger = require('./trigger.js');
13
13
  var root$1 = require('./root2.js');
14
14
  var arrow$1 = require('./arrow2.js');
15
15
  var content$1 = require('./content2.js');
16
- var trigger$1 = require('./trigger.js');
16
+ var trigger$1 = require('./trigger2.js');
17
17
  var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
18
18
 
19
19
  const __default__ = vue.defineComponent({
@@ -2,96 +2,19 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var constants = require('./constants.js');
7
- var forwardRef = require('./forward-ref.js');
8
- var trigger = require('./trigger2.js');
9
- var common = require('./common.js');
10
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
11
- var event = require('../../../utils/dom/event.js');
5
+ var runtime = require('../../../utils/vue/props/runtime.js');
12
6
 
13
- const __default__ = vue.defineComponent({
14
- name: "ElTooltipV2Trigger"
7
+ const EventHandler = {
8
+ type: runtime.definePropType(Function)
9
+ };
10
+ const tooltipV2TriggerProps = runtime.buildProps({
11
+ onBlur: EventHandler,
12
+ onClick: EventHandler,
13
+ onFocus: EventHandler,
14
+ onMouseDown: EventHandler,
15
+ onMouseEnter: EventHandler,
16
+ onMouseLeave: EventHandler
15
17
  });
16
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
- ...__default__,
18
- props: {
19
- ...common.tooltipV2CommonProps,
20
- ...trigger.tooltipV2TriggerProps
21
- },
22
- setup(__props) {
23
- const props = __props;
24
- const { onClose, onOpen, onDelayOpen, triggerRef, contentId } = vue.inject(constants.tooltipV2RootKey);
25
- let isMousedown = false;
26
- const setTriggerRef = (el) => {
27
- triggerRef.value = el;
28
- };
29
- const onMouseup = () => {
30
- isMousedown = false;
31
- };
32
- const onMouseenter = event.composeEventHandlers(props.onMouseEnter, onDelayOpen);
33
- const onMouseleave = event.composeEventHandlers(props.onMouseLeave, onClose);
34
- const onMousedown = event.composeEventHandlers(props.onMouseDown, () => {
35
- onClose();
36
- isMousedown = true;
37
- document.addEventListener("mouseup", onMouseup, { once: true });
38
- });
39
- const onFocus = event.composeEventHandlers(props.onFocus, () => {
40
- if (!isMousedown)
41
- onOpen();
42
- });
43
- const onBlur = event.composeEventHandlers(props.onBlur, onClose);
44
- const onClick = event.composeEventHandlers(props.onClick, (e) => {
45
- if (e.detail === 0)
46
- onClose();
47
- });
48
- const events = {
49
- blur: onBlur,
50
- click: onClick,
51
- focus: onFocus,
52
- mousedown: onMousedown,
53
- mouseenter: onMouseenter,
54
- mouseleave: onMouseleave
55
- };
56
- const setEvents = (el, events2, type) => {
57
- if (el) {
58
- Object.entries(events2).forEach(([name, handler]) => {
59
- el[type](name, handler);
60
- });
61
- }
62
- };
63
- vue.watch(triggerRef, (triggerEl, previousTriggerEl) => {
64
- setEvents(triggerEl, events, "addEventListener");
65
- setEvents(previousTriggerEl, events, "removeEventListener");
66
- if (triggerEl) {
67
- triggerEl.setAttribute("aria-describedby", contentId.value);
68
- }
69
- });
70
- vue.onBeforeUnmount(() => {
71
- setEvents(triggerRef.value, events, "removeEventListener");
72
- document.removeEventListener("mouseup", onMouseup);
73
- });
74
- return (_ctx, _cache) => {
75
- return _ctx.nowrap ? (vue.openBlock(), vue.createBlock(vue.unref(forwardRef["default"]), {
76
- key: 0,
77
- "set-ref": setTriggerRef,
78
- "only-child": ""
79
- }, {
80
- default: vue.withCtx(() => [
81
- vue.renderSlot(_ctx.$slots, "default")
82
- ]),
83
- _: 3
84
- })) : (vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
85
- key: 1,
86
- ref_key: "triggerRef",
87
- ref: triggerRef
88
- }, _ctx.$attrs), [
89
- vue.renderSlot(_ctx.$slots, "default")
90
- ], 16));
91
- };
92
- }
93
- });
94
- var TooltipV2Trigger = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "trigger.vue"]]);
95
18
 
96
- exports["default"] = TooltipV2Trigger;
19
+ exports.tooltipV2TriggerProps = tooltipV2TriggerProps;
97
20
  //# sourceMappingURL=trigger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trigger.js","sources":["../../../../../../packages/components/tooltip-v2/src/trigger.vue"],"sourcesContent":["<template>\n <forward-ref v-if=\"nowrap\" :set-ref=\"setTriggerRef\" only-child>\n <slot />\n </forward-ref>\n <button v-else ref=\"triggerRef\" v-bind=\"$attrs\">\n <slot />\n </button>\n</template>\n\n<script setup lang=\"ts\">\nimport { inject, onBeforeUnmount, watch } from 'vue'\nimport { composeEventHandlers } from '@element-plus/utils'\nimport { tooltipV2RootKey } from './constants'\nimport ForwardRef from './forward-ref'\nimport { tooltipV2TriggerProps } from './trigger'\nimport { tooltipV2CommonProps } from './common'\n\ndefineOptions({\n name: 'ElTooltipV2Trigger',\n})\n\nconst props = defineProps({\n ...tooltipV2CommonProps,\n ...tooltipV2TriggerProps,\n})\n\n/**\n * onOpen opens the tooltip instantly, onTrigger acts a lil bit differently,\n * it will check if delayDuration is set to greater than 0 and based on that result,\n * if true, it opens the tooltip after delayDuration, otherwise it opens it instantly.\n */\nconst { onClose, onOpen, onDelayOpen, triggerRef, contentId } =\n inject(tooltipV2RootKey)!\n\nlet isMousedown = false\n\nconst setTriggerRef = (el: HTMLElement | null) => {\n triggerRef.value = el\n}\n\nconst onMouseup = () => {\n isMousedown = false\n}\n\nconst onMouseenter = composeEventHandlers(props.onMouseEnter, onDelayOpen)\n\nconst onMouseleave = composeEventHandlers(props.onMouseLeave, onClose)\n\nconst onMousedown = composeEventHandlers(props.onMouseDown, () => {\n onClose()\n isMousedown = true\n document.addEventListener('mouseup', onMouseup, { once: true })\n})\n\nconst onFocus = composeEventHandlers(props.onFocus, () => {\n if (!isMousedown) onOpen()\n})\n\nconst onBlur = composeEventHandlers(props.onBlur, onClose)\n\nconst onClick = composeEventHandlers(props.onClick, (e) => {\n if ((e as MouseEvent).detail === 0) onClose()\n})\n\nconst events = {\n blur: onBlur,\n click: onClick,\n focus: onFocus,\n mousedown: onMousedown,\n mouseenter: onMouseenter,\n mouseleave: onMouseleave,\n}\n\nconst setEvents = <T extends (e: Event) => void>(\n el: HTMLElement | null | undefined,\n events: Record<string, T>,\n type: 'addEventListener' | 'removeEventListener'\n) => {\n if (el) {\n Object.entries(events).forEach(([name, handler]) => {\n el[type](name, handler)\n })\n }\n}\n\nwatch(triggerRef, (triggerEl, previousTriggerEl) => {\n setEvents(triggerEl, events, 'addEventListener')\n setEvents(previousTriggerEl, events, 'removeEventListener')\n\n if (triggerEl) {\n triggerEl.setAttribute('aria-describedby', contentId.value)\n }\n})\n\nonBeforeUnmount(() => {\n setEvents(triggerRef.value, events, 'removeEventListener')\n document.removeEventListener('mouseup', onMouseup)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../../../../../../packages/components/tooltip-v2/src/trigger.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\n\nconst EventHandler = {\n type: definePropType<(e: Event) => boolean | void>(Function),\n} as const\n\nexport const tooltipV2TriggerProps = buildProps({\n onBlur: EventHandler,\n onClick: EventHandler,\n onFocus: EventHandler,\n onMouseDown: EventHandler,\n onMouseEnter: EventHandler,\n onMouseLeave: EventHandler,\n} as const)\n\nexport type TooltipV2TriggerProps = ExtractPropTypes<\n typeof tooltipV2TriggerProps\n>\n"],"names":["definePropType","buildProps"],"mappings":";;;;;;AACA,MAAM,YAAY,GAAG;AACrB,EAAE,IAAI,EAAEA,sBAAc,CAAC,QAAQ,CAAC;AAChC,CAAC,CAAC;AACU,MAAC,qBAAqB,GAAGC,kBAAU,CAAC;AAChD,EAAE,MAAM,EAAE,YAAY;AACtB,EAAE,OAAO,EAAE,YAAY;AACvB,EAAE,OAAO,EAAE,YAAY;AACvB,EAAE,WAAW,EAAE,YAAY;AAC3B,EAAE,YAAY,EAAE,YAAY;AAC5B,EAAE,YAAY,EAAE,YAAY;AAC5B,CAAC;;;;"}
@@ -2,19 +2,96 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var runtime = require('../../../utils/vue/props/runtime.js');
5
+ var vue = require('vue');
6
+ var constants = require('./constants.js');
7
+ var forwardRef = require('./forward-ref.js');
8
+ var trigger = require('./trigger.js');
9
+ var common = require('./common.js');
10
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
11
+ var event = require('../../../utils/dom/event.js');
6
12
 
7
- const EventHandler = {
8
- type: runtime.definePropType(Function)
9
- };
10
- const tooltipV2TriggerProps = runtime.buildProps({
11
- onBlur: EventHandler,
12
- onClick: EventHandler,
13
- onFocus: EventHandler,
14
- onMouseDown: EventHandler,
15
- onMouseEnter: EventHandler,
16
- onMouseLeave: EventHandler
13
+ const __default__ = vue.defineComponent({
14
+ name: "ElTooltipV2Trigger"
17
15
  });
16
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
+ ...__default__,
18
+ props: {
19
+ ...common.tooltipV2CommonProps,
20
+ ...trigger.tooltipV2TriggerProps
21
+ },
22
+ setup(__props) {
23
+ const props = __props;
24
+ const { onClose, onOpen, onDelayOpen, triggerRef, contentId } = vue.inject(constants.tooltipV2RootKey);
25
+ let isMousedown = false;
26
+ const setTriggerRef = (el) => {
27
+ triggerRef.value = el;
28
+ };
29
+ const onMouseup = () => {
30
+ isMousedown = false;
31
+ };
32
+ const onMouseenter = event.composeEventHandlers(props.onMouseEnter, onDelayOpen);
33
+ const onMouseleave = event.composeEventHandlers(props.onMouseLeave, onClose);
34
+ const onMousedown = event.composeEventHandlers(props.onMouseDown, () => {
35
+ onClose();
36
+ isMousedown = true;
37
+ document.addEventListener("mouseup", onMouseup, { once: true });
38
+ });
39
+ const onFocus = event.composeEventHandlers(props.onFocus, () => {
40
+ if (!isMousedown)
41
+ onOpen();
42
+ });
43
+ const onBlur = event.composeEventHandlers(props.onBlur, onClose);
44
+ const onClick = event.composeEventHandlers(props.onClick, (e) => {
45
+ if (e.detail === 0)
46
+ onClose();
47
+ });
48
+ const events = {
49
+ blur: onBlur,
50
+ click: onClick,
51
+ focus: onFocus,
52
+ mousedown: onMousedown,
53
+ mouseenter: onMouseenter,
54
+ mouseleave: onMouseleave
55
+ };
56
+ const setEvents = (el, events2, type) => {
57
+ if (el) {
58
+ Object.entries(events2).forEach(([name, handler]) => {
59
+ el[type](name, handler);
60
+ });
61
+ }
62
+ };
63
+ vue.watch(triggerRef, (triggerEl, previousTriggerEl) => {
64
+ setEvents(triggerEl, events, "addEventListener");
65
+ setEvents(previousTriggerEl, events, "removeEventListener");
66
+ if (triggerEl) {
67
+ triggerEl.setAttribute("aria-describedby", contentId.value);
68
+ }
69
+ });
70
+ vue.onBeforeUnmount(() => {
71
+ setEvents(triggerRef.value, events, "removeEventListener");
72
+ document.removeEventListener("mouseup", onMouseup);
73
+ });
74
+ return (_ctx, _cache) => {
75
+ return _ctx.nowrap ? (vue.openBlock(), vue.createBlock(vue.unref(forwardRef["default"]), {
76
+ key: 0,
77
+ "set-ref": setTriggerRef,
78
+ "only-child": ""
79
+ }, {
80
+ default: vue.withCtx(() => [
81
+ vue.renderSlot(_ctx.$slots, "default")
82
+ ]),
83
+ _: 3
84
+ })) : (vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
85
+ key: 1,
86
+ ref_key: "triggerRef",
87
+ ref: triggerRef
88
+ }, _ctx.$attrs), [
89
+ vue.renderSlot(_ctx.$slots, "default")
90
+ ], 16));
91
+ };
92
+ }
93
+ });
94
+ var TooltipV2Trigger = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "trigger.vue"]]);
18
95
 
19
- exports.tooltipV2TriggerProps = tooltipV2TriggerProps;
96
+ exports["default"] = TooltipV2Trigger;
20
97
  //# sourceMappingURL=trigger2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trigger2.js","sources":["../../../../../../packages/components/tooltip-v2/src/trigger.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\n\nconst EventHandler = {\n type: definePropType<(e: Event) => boolean | void>(Function),\n} as const\n\nexport const tooltipV2TriggerProps = buildProps({\n onBlur: EventHandler,\n onClick: EventHandler,\n onFocus: EventHandler,\n onMouseDown: EventHandler,\n onMouseEnter: EventHandler,\n onMouseLeave: EventHandler,\n} as const)\n\nexport type TooltipV2TriggerProps = ExtractPropTypes<\n typeof tooltipV2TriggerProps\n>\n"],"names":["definePropType","buildProps"],"mappings":";;;;;;AACA,MAAM,YAAY,GAAG;AACrB,EAAE,IAAI,EAAEA,sBAAc,CAAC,QAAQ,CAAC;AAChC,CAAC,CAAC;AACU,MAAC,qBAAqB,GAAGC,kBAAU,CAAC;AAChD,EAAE,MAAM,EAAE,YAAY;AACtB,EAAE,OAAO,EAAE,YAAY;AACvB,EAAE,OAAO,EAAE,YAAY;AACvB,EAAE,WAAW,EAAE,YAAY;AAC3B,EAAE,YAAY,EAAE,YAAY;AAC5B,EAAE,YAAY,EAAE,YAAY;AAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"trigger2.js","sources":["../../../../../../packages/components/tooltip-v2/src/trigger.vue"],"sourcesContent":["<template>\n <forward-ref v-if=\"nowrap\" :set-ref=\"setTriggerRef\" only-child>\n <slot />\n </forward-ref>\n <button v-else ref=\"triggerRef\" v-bind=\"$attrs\">\n <slot />\n </button>\n</template>\n\n<script setup lang=\"ts\">\nimport { inject, onBeforeUnmount, watch } from 'vue'\nimport { composeEventHandlers } from '@element-plus/utils'\nimport { tooltipV2RootKey } from './constants'\nimport ForwardRef from './forward-ref'\nimport { tooltipV2TriggerProps } from './trigger'\nimport { tooltipV2CommonProps } from './common'\n\ndefineOptions({\n name: 'ElTooltipV2Trigger',\n})\n\nconst props = defineProps({\n ...tooltipV2CommonProps,\n ...tooltipV2TriggerProps,\n})\n\n/**\n * onOpen opens the tooltip instantly, onTrigger acts a lil bit differently,\n * it will check if delayDuration is set to greater than 0 and based on that result,\n * if true, it opens the tooltip after delayDuration, otherwise it opens it instantly.\n */\nconst { onClose, onOpen, onDelayOpen, triggerRef, contentId } =\n inject(tooltipV2RootKey)!\n\nlet isMousedown = false\n\nconst setTriggerRef = (el: HTMLElement | null) => {\n triggerRef.value = el\n}\n\nconst onMouseup = () => {\n isMousedown = false\n}\n\nconst onMouseenter = composeEventHandlers(props.onMouseEnter, onDelayOpen)\n\nconst onMouseleave = composeEventHandlers(props.onMouseLeave, onClose)\n\nconst onMousedown = composeEventHandlers(props.onMouseDown, () => {\n onClose()\n isMousedown = true\n document.addEventListener('mouseup', onMouseup, { once: true })\n})\n\nconst onFocus = composeEventHandlers(props.onFocus, () => {\n if (!isMousedown) onOpen()\n})\n\nconst onBlur = composeEventHandlers(props.onBlur, onClose)\n\nconst onClick = composeEventHandlers(props.onClick, (e) => {\n if ((e as MouseEvent).detail === 0) onClose()\n})\n\nconst events = {\n blur: onBlur,\n click: onClick,\n focus: onFocus,\n mousedown: onMousedown,\n mouseenter: onMouseenter,\n mouseleave: onMouseleave,\n}\n\nconst setEvents = <T extends (e: Event) => void>(\n el: HTMLElement | null | undefined,\n events: Record<string, T>,\n type: 'addEventListener' | 'removeEventListener'\n) => {\n if (el) {\n Object.entries(events).forEach(([name, handler]) => {\n el[type](name, handler)\n })\n }\n}\n\nwatch(triggerRef, (triggerEl, previousTriggerEl) => {\n setEvents(triggerEl, events, 'addEventListener')\n setEvents(previousTriggerEl, events, 'removeEventListener')\n\n if (triggerEl) {\n triggerEl.setAttribute('aria-describedby', contentId.value)\n }\n})\n\nonBeforeUnmount(() => {\n setEvents(triggerRef.value, events, 'removeEventListener')\n document.removeEventListener('mouseup', onMouseup)\n})\n</script>\n"],"names":["inject","tooltipV2RootKey","composeEventHandlers","events","watch","onBeforeUnmount"],"mappings":";;;;;;;;;;;;uCAiBc,CAAA;AAAA,EACZ,IAAM,EAAA,oBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;;;AAYA,IAAM,MAAA,EAAE,SAAS,MAAQ,EAAA,WAAA,EAAa,YAAY,SAAU,EAAA,GAC1DA,WAAOC,0BAAgB,CAAA,CAAA;AAEzB,IAAA,IAAI,WAAc,GAAA,KAAA,CAAA;AAElB,IAAM,MAAA,aAAA,GAAgB,CAAC,EAA2B,KAAA;AAChD,MAAA,UAAA,CAAW,KAAQ,GAAA,EAAA,CAAA;AAAA,KACrB,CAAA;AAEA,IAAA,MAAM,YAAY,MAAM;AACtB,MAAc,WAAA,GAAA,KAAA,CAAA;AAAA,KAChB,CAAA;AAEA,IAAA,MAAM,YAAe,GAAAC,0BAAA,CAAqB,KAAM,CAAA,YAAA,EAAc,WAAW,CAAA,CAAA;AAEzE,IAAA,MAAM,YAAe,GAAAA,0BAAA,CAAqB,KAAM,CAAA,YAAA,EAAc,OAAO,CAAA,CAAA;AAErE,IAAA,MA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V,IAAUC,SAAA,CAAA,UAAA,EAAA,CAAA,SAAA,EAAA,iBAAgD,KAAA;AAE1D,MAAA,SAAe,CAAA,SAAA,EAAA,MAAA,EAAA,kBAAA,CAAA,CAAA;AACb,MAAU,SAAA,CAAA,iBAAiC,EAAA,MAAA,EAAA,qBAAe,CAAA,CAAA;AAAA,MAC5D,IAAA,SAAA,EAAA;AAAA,QACD,SAAA,CAAA,YAAA,CAAA,kBAAA,EAAA,SAAA,CAAA,KAAA,CAAA,CAAA;AAED,OAAA;AACE,KAAU,CAAA,CAAA;AACV,IAASC,mBAAA,CAAA,MAAA;AAAwC,MAClD,SAAA,CAAA,UAAA,CAAA,KAAA,EAAA,MAAA,EAAA,qBAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,7 +6,7 @@ var tour$1 = require('./src/tour2.js');
6
6
  var step$1 = require('./src/step2.js');
7
7
  var tour = require('./src/tour.js');
8
8
  var step = require('./src/step.js');
9
- var content = require('./src/content.js');
9
+ var content = require('./src/content2.js');
10
10
  var install = require('../../utils/vue/install.js');
11
11
 
12
12
  const ElTour = install.withInstall(tour$1["default"], {
@@ -2,54 +2,75 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var runtime = require('../../../utils/vue/props/runtime.js');
5
+ var vue = require('vue');
6
+ var focusTrap = require('../../focus-trap/src/focus-trap.js');
7
+ var content = require('./content2.js');
8
+ var helper = require('./helper.js');
9
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
6
10
 
7
- const tourStrategies = ["absolute", "fixed"];
8
- const tourPlacements = [
9
- "top-start",
10
- "top-end",
11
- "top",
12
- "bottom-start",
13
- "bottom-end",
14
- "bottom",
15
- "left-start",
16
- "left-end",
17
- "left",
18
- "right-start",
19
- "right-end",
20
- "right"
21
- ];
22
- const tourContentProps = runtime.buildProps({
23
- placement: {
24
- type: runtime.definePropType(String),
25
- values: tourPlacements,
26
- default: "bottom"
27
- },
28
- reference: {
29
- type: runtime.definePropType(Object),
30
- default: null
31
- },
32
- strategy: {
33
- type: runtime.definePropType(String),
34
- values: tourStrategies,
35
- default: "absolute"
36
- },
37
- offset: {
38
- type: Number,
39
- default: 10
40
- },
41
- showArrow: Boolean,
42
- zIndex: {
43
- type: Number,
44
- default: 2001
11
+ const __default__ = vue.defineComponent({
12
+ name: "ElTourContent"
13
+ });
14
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
15
+ ...__default__,
16
+ props: content.tourContentProps,
17
+ emits: content.tourContentEmits,
18
+ setup(__props, { emit }) {
19
+ const props = __props;
20
+ const placement = vue.ref(props.placement);
21
+ const strategy = vue.ref(props.strategy);
22
+ const contentRef = vue.ref(null);
23
+ const arrowRef = vue.ref(null);
24
+ vue.watch(() => props.placement, () => {
25
+ placement.value = props.placement;
26
+ });
27
+ const { contentStyle, arrowStyle } = helper.useFloating(vue.toRef(props, "reference"), contentRef, arrowRef, placement, strategy, vue.toRef(props, "offset"), vue.toRef(props, "zIndex"), vue.toRef(props, "showArrow"));
28
+ const side = vue.computed(() => {
29
+ return placement.value.split("-")[0];
30
+ });
31
+ const { ns } = vue.inject(helper.tourKey);
32
+ const onCloseRequested = () => {
33
+ emit("close");
34
+ };
35
+ const onFocusoutPrevented = (event) => {
36
+ if (event.detail.focusReason === "pointer") {
37
+ event.preventDefault();
38
+ }
39
+ };
40
+ return (_ctx, _cache) => {
41
+ return vue.openBlock(), vue.createElementBlock("div", {
42
+ ref_key: "contentRef",
43
+ ref: contentRef,
44
+ style: vue.normalizeStyle(vue.unref(contentStyle)),
45
+ class: vue.normalizeClass(vue.unref(ns).e("content")),
46
+ "data-side": vue.unref(side),
47
+ tabindex: "-1"
48
+ }, [
49
+ vue.createVNode(vue.unref(focusTrap["default"]), {
50
+ loop: "",
51
+ trapped: "",
52
+ "focus-start-el": "container",
53
+ "focus-trap-el": contentRef.value || void 0,
54
+ onReleaseRequested: onCloseRequested,
55
+ onFocusoutPrevented
56
+ }, {
57
+ default: vue.withCtx(() => [
58
+ vue.renderSlot(_ctx.$slots, "default")
59
+ ]),
60
+ _: 3
61
+ }, 8, ["focus-trap-el"]),
62
+ _ctx.showArrow ? (vue.openBlock(), vue.createElementBlock("span", {
63
+ key: 0,
64
+ ref_key: "arrowRef",
65
+ ref: arrowRef,
66
+ style: vue.normalizeStyle(vue.unref(arrowStyle)),
67
+ class: vue.normalizeClass(vue.unref(ns).e("arrow"))
68
+ }, null, 6)) : vue.createCommentVNode("v-if", true)
69
+ ], 14, ["data-side"]);
70
+ };
45
71
  }
46
72
  });
47
- const tourContentEmits = {
48
- close: () => true
49
- };
73
+ var ElTourContent = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "content.vue"]]);
50
74
 
51
- exports.tourContentEmits = tourContentEmits;
52
- exports.tourContentProps = tourContentProps;
53
- exports.tourPlacements = tourPlacements;
54
- exports.tourStrategies = tourStrategies;
75
+ exports["default"] = ElTourContent;
55
76
  //# sourceMappingURL=content.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","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\nexport const tourStrategies = ['absolute', 'fixed'] as const\n\nexport const 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":["buildProps","definePropType"],"mappings":";;;;;;AACY,MAAC,cAAc,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE;AACxC,MAAC,cAAc,GAAG;AAC9B,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,EAAE;AACU,MAAC,gBAAgB,GAAGA,kBAAU,CAAC;AAC3C,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEC,sBAAc,CAAC,MAAM,CAAC;AAChC,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEA,sBAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEA,sBAAc,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":"content.js","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 @focusout-prevented=\"onFocusoutPrevented\"\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\nconst onFocusoutPrevented = (event: CustomEvent) => {\n if (event.detail.focusReason === 'pointer') {\n event.preventDefault()\n }\n}\n</script>\n"],"names":["ref","watch","useFloating","toRef","computed","inject","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AA,YAAqB,CAAA,WAAA,KAAA,SAAA,EAAA;AAAA,QACrB,oBAAqB,EAAA,CAAA;AAAA,OACrB;AAAwB,KAC1B,CAAA;AAEA,IAAM,OAAA,CAAA,IAAA,aAAsB;AAC1B,MAAA,OAAOC,aAAU,EAAA,EAAAC,sBAAkB,CAAA,KAAA,EAAA;AAAA,QACpC,OAAA,EAAA,YAAA;AAED,QAAA,GAAQ,EAAA,UAAO;AAEf,QAAA,yBAA+B,CAAAC,SAAA,CAAA,YAAA,CAAA,CAAA;AAC7B,QAAA,KAAY,EAAAC,kBAAA,CAAAD,SAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA,CAAA;AAAA,QACd,WAAA,EAAAA,SAAA,CAAA,IAAA,CAAA;AAEA,QAAM,QAAA,EAAA,IAAA;AACJ,OAAI,EAAA;AACF,QAAAE,eAAqB,CAAAF,SAAA,CAAAG,oBAAA,CAAA,EAAA;AAAA,UACvB,IAAA,EAAA,EAAA;AAAA,UACF,OAAA,EAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,75 +2,54 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var focusTrap = require('../../focus-trap/src/focus-trap.js');
7
- var content = require('./content.js');
8
- var helper = require('./helper.js');
9
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
5
+ var runtime = require('../../../utils/vue/props/runtime.js');
10
6
 
11
- const __default__ = vue.defineComponent({
12
- name: "ElTourContent"
13
- });
14
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
15
- ...__default__,
16
- props: content.tourContentProps,
17
- emits: content.tourContentEmits,
18
- setup(__props, { emit }) {
19
- const props = __props;
20
- const placement = vue.ref(props.placement);
21
- const strategy = vue.ref(props.strategy);
22
- const contentRef = vue.ref(null);
23
- const arrowRef = vue.ref(null);
24
- vue.watch(() => props.placement, () => {
25
- placement.value = props.placement;
26
- });
27
- const { contentStyle, arrowStyle } = helper.useFloating(vue.toRef(props, "reference"), contentRef, arrowRef, placement, strategy, vue.toRef(props, "offset"), vue.toRef(props, "zIndex"), vue.toRef(props, "showArrow"));
28
- const side = vue.computed(() => {
29
- return placement.value.split("-")[0];
30
- });
31
- const { ns } = vue.inject(helper.tourKey);
32
- const onCloseRequested = () => {
33
- emit("close");
34
- };
35
- const onFocusoutPrevented = (event) => {
36
- if (event.detail.focusReason === "pointer") {
37
- event.preventDefault();
38
- }
39
- };
40
- return (_ctx, _cache) => {
41
- return vue.openBlock(), vue.createElementBlock("div", {
42
- ref_key: "contentRef",
43
- ref: contentRef,
44
- style: vue.normalizeStyle(vue.unref(contentStyle)),
45
- class: vue.normalizeClass(vue.unref(ns).e("content")),
46
- "data-side": vue.unref(side),
47
- tabindex: "-1"
48
- }, [
49
- vue.createVNode(vue.unref(focusTrap["default"]), {
50
- loop: "",
51
- trapped: "",
52
- "focus-start-el": "container",
53
- "focus-trap-el": contentRef.value || void 0,
54
- onReleaseRequested: onCloseRequested,
55
- onFocusoutPrevented
56
- }, {
57
- default: vue.withCtx(() => [
58
- vue.renderSlot(_ctx.$slots, "default")
59
- ]),
60
- _: 3
61
- }, 8, ["focus-trap-el"]),
62
- _ctx.showArrow ? (vue.openBlock(), vue.createElementBlock("span", {
63
- key: 0,
64
- ref_key: "arrowRef",
65
- ref: arrowRef,
66
- style: vue.normalizeStyle(vue.unref(arrowStyle)),
67
- class: vue.normalizeClass(vue.unref(ns).e("arrow"))
68
- }, null, 6)) : vue.createCommentVNode("v-if", true)
69
- ], 14, ["data-side"]);
70
- };
7
+ const tourStrategies = ["absolute", "fixed"];
8
+ const tourPlacements = [
9
+ "top-start",
10
+ "top-end",
11
+ "top",
12
+ "bottom-start",
13
+ "bottom-end",
14
+ "bottom",
15
+ "left-start",
16
+ "left-end",
17
+ "left",
18
+ "right-start",
19
+ "right-end",
20
+ "right"
21
+ ];
22
+ const tourContentProps = runtime.buildProps({
23
+ placement: {
24
+ type: runtime.definePropType(String),
25
+ values: tourPlacements,
26
+ default: "bottom"
27
+ },
28
+ reference: {
29
+ type: runtime.definePropType(Object),
30
+ default: null
31
+ },
32
+ strategy: {
33
+ type: runtime.definePropType(String),
34
+ values: tourStrategies,
35
+ default: "absolute"
36
+ },
37
+ offset: {
38
+ type: Number,
39
+ default: 10
40
+ },
41
+ showArrow: Boolean,
42
+ zIndex: {
43
+ type: Number,
44
+ default: 2001
71
45
  }
72
46
  });
73
- var ElTourContent = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "content.vue"]]);
47
+ const tourContentEmits = {
48
+ close: () => true
49
+ };
74
50
 
75
- exports["default"] = ElTourContent;
51
+ exports.tourContentEmits = tourContentEmits;
52
+ exports.tourContentProps = tourContentProps;
53
+ exports.tourPlacements = tourPlacements;
54
+ exports.tourStrategies = tourStrategies;
76
55
  //# sourceMappingURL=content2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"content2.js","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 @focusout-prevented=\"onFocusoutPrevented\"\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\nconst onFocusoutPrevented = (event: CustomEvent) => {\n if (event.detail.focusReason === 'pointer') {\n event.preventDefault()\n }\n}\n</script>\n"],"names":["ref","watch","useFloating","toRef","computed","inject","tourKey","_openBlock","_createElementBlock","_unref","_normalizeClass","_createVNode","ElFocusTrap"],"mappings":";;;;;;;;;;uCAgCc,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,SAAA,GAAYA,OAAI,CAAA,KAAA,CAAM,SAAS,CAAA,CAAA;AACrC,IAAM,MAAA,QAAA,GAAWA,OAAI,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AACnC,IAAM,MAAA,UAAA,GAAaA,QAAwB,IAAI,CAAA,CAAA;AAC/C,IAAM,MAAA,QAAA,GAAWA,QAAwB,IAAI,CAAA,CAAA;AAE7C,IAAAC,SAAA,CAAA,MAAA,KAAA,CAAA,SAAA,EAAA,MAAA;AAAA,MACE,SAAY,CAAA,KAAA,GAAA,KAAA,CAAA,SAAA,CAAA;AAAA,KAAA,CACZ,CAAM;AACJ,IAAA,MAAA,EAAA,cAAkB,UAAM,EAAA,GAAAC,kBAAA,CAAAC,SAAA,CAAA,KAAA,EAAA,WAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,SAAA,EAAA,QAAA,EAAAA,SAAA,CAAA,KAAA,EAAA,QAAA,CAAA,EAAAA,SAAA,CAAA,KAAA,EAAA,QAAA,CAAA,EAAAA,SAAA,CAAA,KAAA,EAAA,WAAA,CAAA,CAAA,CAAA;AAAA,IAC1B,MAAA,IAAA,GAAAC,YAAA,CAAA,MAAA;AAAA,MACF,OAAA,SAAA,CAAA,KAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEA,KAAM,CAAA,CAAA;AAA+B,IACnC,MAAA,EAAM,OAAOC,UAAW,CAAAC,cAAA,CAAA,CAAA;AAAA,IACxB,MAAA,gBAAA,GAAA,MAAA;AAAA,MACA,IAAA,CAAA,OAAA,CAAA,CAAA;AAAA,KACA,CAAA;AAAA,IACA,MAAA,mBAAA,GAAA,CAAA,KAAA,KAAA;AAAA,MACA,IAAA,YAAqB,CAAA,WAAA,KAAA,SAAA,EAAA;AAAA,QACrB,oBAAqB,EAAA,CAAA;AAAA,OACrB;AAAwB,KAC1B,CAAA;AAEA,IAAM,OAAA,CAAA,IAAA,aAAsB;AAC1B,MAAA,OAAOC,aAAU,EAAA,EAAAC,sBAAkB,CAAA,KAAA,EAAA;AAAA,QACpC,OAAA,EAAA,YAAA;AAED,QAAA,GAAQ,EAAA,UAAO;AAEf,QAAA,yBAA+B,CAAAC,SAAA,CAAA,YAAA,CAAA,CAAA;AAC7B,QAAA,KAAY,EAAAC,kBAAA,CAAAD,SAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA,CAAA;AAAA,QACd,WAAA,EAAAA,SAAA,CAAA,IAAA,CAAA;AAEA,QAAM,QAAA,EAAA,IAAA;AACJ,OAAI,EAAA;AACF,QAAAE,eAAqB,CAAAF,SAAA,CAAAG,oBAAA,CAAA,EAAA;AAAA,UACvB,IAAA,EAAA,EAAA;AAAA,UACF,OAAA,EAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"content2.js","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\nexport const tourStrategies = ['absolute', 'fixed'] as const\n\nexport const 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":["buildProps","definePropType"],"mappings":";;;;;;AACY,MAAC,cAAc,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE;AACxC,MAAC,cAAc,GAAG;AAC9B,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,EAAE;AACU,MAAC,gBAAgB,GAAGA,kBAAU,CAAC;AAC3C,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEC,sBAAc,CAAC,MAAM,CAAC;AAChC,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEA,sBAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEA,sBAAc,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;;;;;;;"}