@element-plus/nightly 0.0.20241128 → 0.0.20241129

Sign up to get free protection for your applications and to get access to all the features.
Files changed (429) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +907 -317
  4. package/dist/index.full.min.js +17 -17
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +14 -14
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +904 -318
  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/ms.js +1 -1
  154. package/dist/locale/ms.min.js +1 -1
  155. package/dist/locale/ms.min.mjs +1 -1
  156. package/dist/locale/ms.mjs +1 -1
  157. package/dist/locale/my.js +1 -1
  158. package/dist/locale/my.min.js +1 -1
  159. package/dist/locale/my.min.mjs +1 -1
  160. package/dist/locale/my.mjs +1 -1
  161. package/dist/locale/nb-no.js +1 -1
  162. package/dist/locale/nb-no.min.js +1 -1
  163. package/dist/locale/nb-no.min.mjs +1 -1
  164. package/dist/locale/nb-no.mjs +1 -1
  165. package/dist/locale/nl.js +1 -1
  166. package/dist/locale/nl.min.js +1 -1
  167. package/dist/locale/nl.min.mjs +1 -1
  168. package/dist/locale/nl.mjs +1 -1
  169. package/dist/locale/pa.js +1 -1
  170. package/dist/locale/pa.min.js +1 -1
  171. package/dist/locale/pa.min.mjs +1 -1
  172. package/dist/locale/pa.mjs +1 -1
  173. package/dist/locale/pl.js +1 -1
  174. package/dist/locale/pl.min.js +1 -1
  175. package/dist/locale/pl.min.mjs +1 -1
  176. package/dist/locale/pl.mjs +1 -1
  177. package/dist/locale/pt-br.js +1 -1
  178. package/dist/locale/pt-br.min.js +1 -1
  179. package/dist/locale/pt-br.min.mjs +1 -1
  180. package/dist/locale/pt-br.mjs +1 -1
  181. package/dist/locale/pt.js +1 -1
  182. package/dist/locale/pt.min.js +1 -1
  183. package/dist/locale/pt.min.mjs +1 -1
  184. package/dist/locale/pt.mjs +1 -1
  185. package/dist/locale/ro.js +1 -1
  186. package/dist/locale/ro.min.js +1 -1
  187. package/dist/locale/ro.min.mjs +1 -1
  188. package/dist/locale/ro.mjs +1 -1
  189. package/dist/locale/ru.js +1 -1
  190. package/dist/locale/ru.min.js +1 -1
  191. package/dist/locale/ru.min.mjs +1 -1
  192. package/dist/locale/ru.mjs +1 -1
  193. package/dist/locale/sk.js +1 -1
  194. package/dist/locale/sk.min.js +1 -1
  195. package/dist/locale/sk.min.mjs +1 -1
  196. package/dist/locale/sk.mjs +1 -1
  197. package/dist/locale/sl.js +1 -1
  198. package/dist/locale/sl.min.js +1 -1
  199. package/dist/locale/sl.min.mjs +1 -1
  200. package/dist/locale/sl.mjs +1 -1
  201. package/dist/locale/sr.js +1 -1
  202. package/dist/locale/sr.min.js +1 -1
  203. package/dist/locale/sr.min.mjs +1 -1
  204. package/dist/locale/sr.mjs +1 -1
  205. package/dist/locale/sv.js +1 -1
  206. package/dist/locale/sv.min.js +1 -1
  207. package/dist/locale/sv.min.mjs +1 -1
  208. package/dist/locale/sv.mjs +1 -1
  209. package/dist/locale/sw.js +1 -1
  210. package/dist/locale/sw.min.js +1 -1
  211. package/dist/locale/sw.min.mjs +1 -1
  212. package/dist/locale/sw.mjs +1 -1
  213. package/dist/locale/ta.js +1 -1
  214. package/dist/locale/ta.min.js +1 -1
  215. package/dist/locale/ta.min.mjs +1 -1
  216. package/dist/locale/ta.mjs +1 -1
  217. package/dist/locale/th.js +1 -1
  218. package/dist/locale/th.min.js +1 -1
  219. package/dist/locale/th.min.mjs +1 -1
  220. package/dist/locale/th.mjs +1 -1
  221. package/dist/locale/tk.js +1 -1
  222. package/dist/locale/tk.min.js +1 -1
  223. package/dist/locale/tk.min.mjs +1 -1
  224. package/dist/locale/tk.mjs +1 -1
  225. package/dist/locale/tr.js +1 -1
  226. package/dist/locale/tr.min.js +1 -1
  227. package/dist/locale/tr.min.mjs +1 -1
  228. package/dist/locale/tr.mjs +1 -1
  229. package/dist/locale/ug-cn.js +1 -1
  230. package/dist/locale/ug-cn.min.js +1 -1
  231. package/dist/locale/ug-cn.min.mjs +1 -1
  232. package/dist/locale/ug-cn.mjs +1 -1
  233. package/dist/locale/uk.js +1 -1
  234. package/dist/locale/uk.min.js +1 -1
  235. package/dist/locale/uk.min.mjs +1 -1
  236. package/dist/locale/uk.mjs +1 -1
  237. package/dist/locale/uz-uz.js +1 -1
  238. package/dist/locale/uz-uz.min.js +1 -1
  239. package/dist/locale/uz-uz.min.mjs +1 -1
  240. package/dist/locale/uz-uz.mjs +1 -1
  241. package/dist/locale/vi.js +1 -1
  242. package/dist/locale/vi.min.js +1 -1
  243. package/dist/locale/vi.min.mjs +1 -1
  244. package/dist/locale/vi.mjs +1 -1
  245. package/dist/locale/zh-cn.js +1 -1
  246. package/dist/locale/zh-cn.min.js +1 -1
  247. package/dist/locale/zh-cn.min.mjs +1 -1
  248. package/dist/locale/zh-cn.mjs +1 -1
  249. package/dist/locale/zh-tw.js +1 -1
  250. package/dist/locale/zh-tw.min.js +1 -1
  251. package/dist/locale/zh-tw.min.mjs +1 -1
  252. package/dist/locale/zh-tw.mjs +1 -1
  253. package/es/component.mjs +2 -0
  254. package/es/component.mjs.map +1 -1
  255. package/es/components/affix/index.mjs +2 -2
  256. package/es/components/affix/src/affix.mjs +118 -25
  257. package/es/components/affix/src/affix.mjs.map +1 -1
  258. package/es/components/affix/src/affix2.mjs +25 -118
  259. package/es/components/affix/src/affix2.mjs.map +1 -1
  260. package/es/components/alert/index.mjs +2 -2
  261. package/es/components/alert/src/alert.mjs +36 -95
  262. package/es/components/alert/src/alert.mjs.map +1 -1
  263. package/es/components/alert/src/alert2.mjs +95 -36
  264. package/es/components/alert/src/alert2.mjs.map +1 -1
  265. package/es/components/dialog/src/dialog-content.mjs +87 -26
  266. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  267. package/es/components/dialog/src/dialog-content2.mjs +26 -87
  268. package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
  269. package/es/components/dialog/src/dialog.mjs +1 -1
  270. package/es/components/dialog/src/dialog2.mjs +1 -1
  271. package/es/components/index.d.ts +1 -0
  272. package/es/components/index.mjs +5 -3
  273. package/es/components/index.mjs.map +1 -1
  274. package/es/components/input-number/src/input-number2.mjs +2 -1
  275. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  276. package/es/components/input-tag/index.d.ts +6 -0
  277. package/es/components/input-tag/index.mjs +8 -0
  278. package/es/components/input-tag/index.mjs.map +1 -0
  279. package/es/components/input-tag/src/composables/index.d.ts +4 -0
  280. package/es/components/input-tag/src/composables/index.mjs +5 -0
  281. package/es/components/input-tag/src/composables/index.mjs.map +1 -0
  282. package/es/components/input-tag/src/composables/use-drag-tag.d.ts +15 -0
  283. package/es/components/input-tag/src/composables/use-drag-tag.mjs +92 -0
  284. package/es/components/input-tag/src/composables/use-drag-tag.mjs.map +1 -0
  285. package/es/components/input-tag/src/composables/use-hovering.d.ts +5 -0
  286. package/es/components/input-tag/src/composables/use-hovering.mjs +19 -0
  287. package/es/components/input-tag/src/composables/use-hovering.mjs.map +1 -0
  288. package/es/components/input-tag/src/composables/use-input-tag-dom.d.ts +58 -0
  289. package/es/components/input-tag/src/composables/use-input-tag-dom.mjs +57 -0
  290. package/es/components/input-tag/src/composables/use-input-tag-dom.mjs.map +1 -0
  291. package/es/components/input-tag/src/composables/use-input-tag.d.ts +33 -0
  292. package/es/components/input-tag/src/composables/use-input-tag.mjs +153 -0
  293. package/es/components/input-tag/src/composables/use-input-tag.mjs.map +1 -0
  294. package/es/components/input-tag/src/input-tag.d.ts +60 -0
  295. package/es/components/input-tag/src/input-tag.mjs +69 -0
  296. package/es/components/input-tag/src/input-tag.mjs.map +1 -0
  297. package/es/components/input-tag/src/input-tag.vue.d.ts +142 -0
  298. package/es/components/input-tag/src/input-tag2.mjs +219 -0
  299. package/es/components/input-tag/src/input-tag2.mjs.map +1 -0
  300. package/es/components/input-tag/src/instance.d.ts +2 -0
  301. package/es/components/input-tag/src/instance.mjs +2 -0
  302. package/es/components/input-tag/src/instance.mjs.map +1 -0
  303. package/es/components/input-tag/style/css.d.ts +3 -0
  304. package/es/components/input-tag/style/css.mjs +4 -0
  305. package/es/components/input-tag/style/css.mjs.map +1 -0
  306. package/es/components/input-tag/style/index.d.ts +3 -0
  307. package/es/components/input-tag/style/index.mjs +4 -0
  308. package/es/components/input-tag/style/index.mjs.map +1 -0
  309. package/es/components/menu/index.mjs +2 -2
  310. package/es/components/menu/src/menu-item.mjs +14 -96
  311. package/es/components/menu/src/menu-item.mjs.map +1 -1
  312. package/es/components/menu/src/menu-item2.mjs +96 -14
  313. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  314. package/es/components/notification/src/notification.d.ts +12 -6
  315. package/es/components/notification/src/notification.mjs.map +1 -1
  316. package/es/components/notification/src/notify.mjs +5 -8
  317. package/es/components/notification/src/notify.mjs.map +1 -1
  318. package/es/components/time-picker/src/common/picker-range-trigger.mjs +1 -1
  319. package/es/components/time-picker/src/common/picker-range-trigger.mjs.map +1 -1
  320. package/es/components/time-picker/src/time-picker-com/panel-time-range.mjs +3 -0
  321. package/es/components/time-picker/src/time-picker-com/panel-time-range.mjs.map +1 -1
  322. package/es/directives/click-outside/index.mjs +1 -1
  323. package/es/hooks/index.d.ts +1 -0
  324. package/es/hooks/index.mjs +1 -0
  325. package/es/hooks/index.mjs.map +1 -1
  326. package/es/hooks/use-calc-input-width/index.d.ts +7 -0
  327. package/es/hooks/use-calc-input-width/index.mjs +24 -0
  328. package/es/hooks/use-calc-input-width/index.mjs.map +1 -0
  329. package/es/hooks/use-focus-controller/index.mjs +1 -1
  330. package/es/hooks/use-lockscreen/index.mjs +1 -1
  331. package/es/index.mjs +6 -3
  332. package/es/index.mjs.map +1 -1
  333. package/es/version.d.ts +1 -1
  334. package/es/version.mjs +1 -1
  335. package/es/version.mjs.map +1 -1
  336. package/global.d.ts +1 -0
  337. package/lib/component.js +98 -96
  338. package/lib/component.js.map +1 -1
  339. package/lib/components/affix/index.js +2 -2
  340. package/lib/components/affix/src/affix.js +118 -26
  341. package/lib/components/affix/src/affix.js.map +1 -1
  342. package/lib/components/affix/src/affix2.js +26 -118
  343. package/lib/components/affix/src/affix2.js.map +1 -1
  344. package/lib/components/alert/index.js +2 -2
  345. package/lib/components/alert/src/alert.js +37 -94
  346. package/lib/components/alert/src/alert.js.map +1 -1
  347. package/lib/components/alert/src/alert2.js +94 -37
  348. package/lib/components/alert/src/alert2.js.map +1 -1
  349. package/lib/components/dialog/src/dialog-content.js +86 -26
  350. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  351. package/lib/components/dialog/src/dialog-content2.js +26 -86
  352. package/lib/components/dialog/src/dialog-content2.js.map +1 -1
  353. package/lib/components/dialog/src/dialog.js +1 -1
  354. package/lib/components/dialog/src/dialog2.js +1 -1
  355. package/lib/components/index.d.ts +1 -0
  356. package/lib/components/index.js +116 -111
  357. package/lib/components/index.js.map +1 -1
  358. package/lib/components/input-number/src/input-number2.js +2 -1
  359. package/lib/components/input-number/src/input-number2.js.map +1 -1
  360. package/lib/components/input-tag/index.d.ts +6 -0
  361. package/lib/components/input-tag/index.js +15 -0
  362. package/lib/components/input-tag/index.js.map +1 -0
  363. package/lib/components/input-tag/src/composables/index.d.ts +4 -0
  364. package/lib/components/input-tag/src/composables/index.js +16 -0
  365. package/lib/components/input-tag/src/composables/index.js.map +1 -0
  366. package/lib/components/input-tag/src/composables/use-drag-tag.d.ts +15 -0
  367. package/lib/components/input-tag/src/composables/use-drag-tag.js +96 -0
  368. package/lib/components/input-tag/src/composables/use-drag-tag.js.map +1 -0
  369. package/lib/components/input-tag/src/composables/use-hovering.d.ts +5 -0
  370. package/lib/components/input-tag/src/composables/use-hovering.js +23 -0
  371. package/lib/components/input-tag/src/composables/use-hovering.js.map +1 -0
  372. package/lib/components/input-tag/src/composables/use-input-tag-dom.d.ts +58 -0
  373. package/lib/components/input-tag/src/composables/use-input-tag-dom.js +61 -0
  374. package/lib/components/input-tag/src/composables/use-input-tag-dom.js.map +1 -0
  375. package/lib/components/input-tag/src/composables/use-input-tag.d.ts +33 -0
  376. package/lib/components/input-tag/src/composables/use-input-tag.js +157 -0
  377. package/lib/components/input-tag/src/composables/use-input-tag.js.map +1 -0
  378. package/lib/components/input-tag/src/input-tag.d.ts +60 -0
  379. package/lib/components/input-tag/src/input-tag.js +74 -0
  380. package/lib/components/input-tag/src/input-tag.js.map +1 -0
  381. package/lib/components/input-tag/src/input-tag.vue.d.ts +142 -0
  382. package/lib/components/input-tag/src/input-tag2.js +223 -0
  383. package/lib/components/input-tag/src/input-tag2.js.map +1 -0
  384. package/lib/components/input-tag/src/instance.d.ts +2 -0
  385. package/lib/components/input-tag/src/instance.js +3 -0
  386. package/lib/components/input-tag/src/instance.js.map +1 -0
  387. package/lib/components/input-tag/style/css.d.ts +3 -0
  388. package/lib/components/input-tag/style/css.js +7 -0
  389. package/lib/components/input-tag/style/css.js.map +1 -0
  390. package/lib/components/input-tag/style/index.d.ts +3 -0
  391. package/lib/components/input-tag/style/index.js +7 -0
  392. package/lib/components/input-tag/style/index.js.map +1 -0
  393. package/lib/components/menu/index.js +2 -2
  394. package/lib/components/menu/src/menu-item.js +15 -96
  395. package/lib/components/menu/src/menu-item.js.map +1 -1
  396. package/lib/components/menu/src/menu-item2.js +96 -15
  397. package/lib/components/menu/src/menu-item2.js.map +1 -1
  398. package/lib/components/notification/src/notification.d.ts +12 -6
  399. package/lib/components/notification/src/notification.js.map +1 -1
  400. package/lib/components/notification/src/notify.js +4 -7
  401. package/lib/components/notification/src/notify.js.map +1 -1
  402. package/lib/components/time-picker/src/common/picker-range-trigger.js +1 -1
  403. package/lib/components/time-picker/src/common/picker-range-trigger.js.map +1 -1
  404. package/lib/components/time-picker/src/time-picker-com/panel-time-range.js +3 -0
  405. package/lib/components/time-picker/src/time-picker-com/panel-time-range.js.map +1 -1
  406. package/lib/directives/click-outside/index.js +1 -1
  407. package/lib/hooks/index.d.ts +1 -0
  408. package/lib/hooks/index.js +96 -94
  409. package/lib/hooks/index.js.map +1 -1
  410. package/lib/hooks/use-calc-input-width/index.d.ts +7 -0
  411. package/lib/hooks/use-calc-input-width/index.js +28 -0
  412. package/lib/hooks/use-calc-input-width/index.js.map +1 -0
  413. package/lib/hooks/use-focus-controller/index.js +1 -1
  414. package/lib/hooks/use-lockscreen/index.js +1 -1
  415. package/lib/index.js +222 -215
  416. package/lib/index.js.map +1 -1
  417. package/lib/version.d.ts +1 -1
  418. package/lib/version.js +1 -1
  419. package/lib/version.js.map +1 -1
  420. package/package.json +2 -2
  421. package/tags.json +1 -1
  422. package/theme-chalk/el-form.css +1 -1
  423. package/theme-chalk/el-input-tag.css +1 -0
  424. package/theme-chalk/index.css +1 -1
  425. package/theme-chalk/src/common/var.scss +47 -0
  426. package/theme-chalk/src/form.scss +2 -1
  427. package/theme-chalk/src/index.scss +1 -0
  428. package/theme-chalk/src/input-tag.scss +215 -0
  429. package/web-types.json +1 -1
@@ -0,0 +1,92 @@
1
+ import { shallowRef, ref } from 'vue';
2
+ import { getStyle, setStyle } from '../../../../utils/dom/style.mjs';
3
+ import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
4
+ import { isUndefined } from '../../../../utils/types.mjs';
5
+
6
+ function useDragTag({
7
+ wrapperRef,
8
+ handleDragged,
9
+ afterDragged
10
+ }) {
11
+ const ns = useNamespace("input-tag");
12
+ const dropIndicatorRef = shallowRef();
13
+ const showDropIndicator = ref(false);
14
+ let draggingIndex;
15
+ let draggingTag;
16
+ let dropIndex;
17
+ let dropType;
18
+ function getTagClassName(index) {
19
+ return `.${ns.e("inner")} .${ns.namespace.value}-tag:nth-child(${index + 1})`;
20
+ }
21
+ function handleDragStart(event, index) {
22
+ draggingIndex = index;
23
+ draggingTag = wrapperRef.value.querySelector(getTagClassName(index));
24
+ if (draggingTag) {
25
+ draggingTag.style.opacity = "0.5";
26
+ }
27
+ event.dataTransfer.effectAllowed = "move";
28
+ }
29
+ function handleDragOver(event, index) {
30
+ dropIndex = index;
31
+ event.preventDefault();
32
+ event.dataTransfer.dropEffect = "move";
33
+ if (isUndefined(draggingIndex) || draggingIndex === index) {
34
+ showDropIndicator.value = false;
35
+ return;
36
+ }
37
+ const dropPosition = wrapperRef.value.querySelector(getTagClassName(index)).getBoundingClientRect();
38
+ const dropPrev = !(draggingIndex + 1 === index);
39
+ const dropNext = !(draggingIndex - 1 === index);
40
+ const distance = event.clientX - dropPosition.left;
41
+ const prevPercent = dropPrev ? dropNext ? 0.5 : 1 : -1;
42
+ const nextPercent = dropNext ? dropPrev ? 0.5 : 0 : 1;
43
+ if (distance <= dropPosition.width * prevPercent) {
44
+ dropType = "before";
45
+ } else if (distance > dropPosition.width * nextPercent) {
46
+ dropType = "after";
47
+ } else {
48
+ dropType = void 0;
49
+ }
50
+ const innerEl = wrapperRef.value.querySelector(`.${ns.e("inner")}`);
51
+ const innerPosition = innerEl.getBoundingClientRect();
52
+ const gap = Number.parseFloat(getStyle(innerEl, "gap")) / 2;
53
+ const indicatorTop = dropPosition.top - innerPosition.top;
54
+ let indicatorLeft = -9999;
55
+ if (dropType === "before") {
56
+ indicatorLeft = Math.max(dropPosition.left - innerPosition.left - gap, Math.floor(-gap / 2));
57
+ } else if (dropType === "after") {
58
+ const left = dropPosition.right - innerPosition.left;
59
+ indicatorLeft = left + (innerPosition.width === left ? Math.floor(gap / 2) : gap);
60
+ }
61
+ setStyle(dropIndicatorRef.value, {
62
+ top: `${indicatorTop}px`,
63
+ left: `${indicatorLeft}px`
64
+ });
65
+ showDropIndicator.value = !!dropType;
66
+ }
67
+ function handleDragEnd(event) {
68
+ event.preventDefault();
69
+ if (draggingTag) {
70
+ draggingTag.style.opacity = "";
71
+ }
72
+ if (dropType && !isUndefined(draggingIndex) && !isUndefined(dropIndex) && draggingIndex !== dropIndex) {
73
+ handleDragged(draggingIndex, dropIndex, dropType);
74
+ }
75
+ showDropIndicator.value = false;
76
+ draggingIndex = void 0;
77
+ draggingTag = null;
78
+ dropIndex = void 0;
79
+ dropType = void 0;
80
+ afterDragged == null ? void 0 : afterDragged();
81
+ }
82
+ return {
83
+ dropIndicatorRef,
84
+ showDropIndicator,
85
+ handleDragStart,
86
+ handleDragOver,
87
+ handleDragEnd
88
+ };
89
+ }
90
+
91
+ export { useDragTag };
92
+ //# sourceMappingURL=use-drag-tag.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-drag-tag.mjs","sources":["../../../../../../../packages/components/input-tag/src/composables/use-drag-tag.ts"],"sourcesContent":["import { type ShallowRef, ref, shallowRef } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { getStyle, isUndefined, setStyle } from '@element-plus/utils'\n\ntype DropType = 'before' | 'after'\n\ninterface UseDragTagOptions {\n wrapperRef: ShallowRef<HTMLElement | undefined>\n handleDragged: (\n draggingIndex: number,\n dropIndex: number,\n type: DropType\n ) => void\n afterDragged?: () => void\n}\n\nexport function useDragTag({\n wrapperRef,\n handleDragged,\n afterDragged,\n}: UseDragTagOptions) {\n const ns = useNamespace('input-tag')\n const dropIndicatorRef = shallowRef<HTMLElement>()\n const showDropIndicator = ref(false)\n\n let draggingIndex: number | undefined\n let draggingTag: HTMLElement | null\n let dropIndex: number | undefined\n let dropType: DropType | undefined\n\n function getTagClassName(index: number) {\n return `.${ns.e('inner')} .${ns.namespace.value}-tag:nth-child(${\n index + 1\n })`\n }\n\n function handleDragStart(event: DragEvent, index: number) {\n draggingIndex = index\n draggingTag = wrapperRef.value!.querySelector<HTMLElement>(\n getTagClassName(index)\n )\n\n if (draggingTag) {\n draggingTag.style.opacity = '0.5'\n }\n event.dataTransfer!.effectAllowed = 'move'\n }\n\n function handleDragOver(event: DragEvent, index: number) {\n dropIndex = index\n event.preventDefault()\n event.dataTransfer!.dropEffect = 'move'\n\n if (isUndefined(draggingIndex) || draggingIndex === index) {\n showDropIndicator.value = false\n return\n }\n\n const dropPosition = wrapperRef\n .value!.querySelector<HTMLElement>(getTagClassName(index))!\n .getBoundingClientRect()\n const dropPrev = !(draggingIndex + 1 === index)\n const dropNext = !(draggingIndex - 1 === index)\n const distance = event.clientX - dropPosition.left\n const prevPercent = dropPrev ? (dropNext ? 0.5 : 1) : -1\n const nextPercent = dropNext ? (dropPrev ? 0.5 : 0) : 1\n\n if (distance <= dropPosition.width * prevPercent) {\n dropType = 'before'\n } else if (distance > dropPosition.width * nextPercent) {\n dropType = 'after'\n } else {\n dropType = undefined\n }\n\n const innerEl = wrapperRef.value!.querySelector<HTMLElement>(\n `.${ns.e('inner')}`\n )!\n const innerPosition = innerEl.getBoundingClientRect()\n const gap = Number.parseFloat(getStyle(innerEl, 'gap')) / 2\n\n const indicatorTop = dropPosition.top - innerPosition.top\n let indicatorLeft = -9999\n\n if (dropType === 'before') {\n indicatorLeft = Math.max(\n dropPosition.left - innerPosition.left - gap,\n Math.floor(-gap / 2)\n )\n } else if (dropType === 'after') {\n const left = dropPosition.right - innerPosition.left\n indicatorLeft =\n left + (innerPosition.width === left ? Math.floor(gap / 2) : gap)\n }\n\n setStyle(dropIndicatorRef.value!, {\n top: `${indicatorTop}px`,\n left: `${indicatorLeft}px`,\n })\n showDropIndicator.value = !!dropType\n }\n\n function handleDragEnd(event: DragEvent) {\n event.preventDefault()\n\n if (draggingTag) {\n draggingTag.style.opacity = ''\n }\n\n if (\n dropType &&\n !isUndefined(draggingIndex) &&\n !isUndefined(dropIndex) &&\n draggingIndex !== dropIndex\n ) {\n handleDragged(draggingIndex, dropIndex, dropType)\n }\n\n showDropIndicator.value = false\n draggingIndex = undefined\n draggingTag = null\n dropIndex = undefined\n dropType = undefined\n afterDragged?.()\n }\n\n return {\n dropIndicatorRef,\n showDropIndicator,\n handleDragStart,\n handleDragOver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,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,aAAa,KAAK,SAAS,EAAE;AAC3G,MAAM,aAAa,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACxD,KAAK;AACL,IAAI,iBAAiB,CAAC,KAAK,GAAG,KAAK,CAAC;AACpC,IAAI,aAAa,GAAG,KAAK,CAAC,CAAC;AAC3B,IAAI,WAAW,GAAG,IAAI,CAAC;AACvB,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC;AACvB,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,IAAI,YAAY,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,YAAY,EAAE,CAAC;AACnD,GAAG;AACH,EAAE,OAAO;AACT,IAAI,gBAAgB;AACpB,IAAI,iBAAiB;AACrB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,aAAa;AACjB,GAAG,CAAC;AACJ;;;;"}
@@ -0,0 +1,5 @@
1
+ export declare function useHovering(): {
2
+ hovering: import("vue").Ref<boolean>;
3
+ handleMouseEnter: () => void;
4
+ handleMouseLeave: () => void;
5
+ };
@@ -0,0 +1,19 @@
1
+ import { ref } from 'vue';
2
+
3
+ function useHovering() {
4
+ const hovering = ref(false);
5
+ const handleMouseEnter = () => {
6
+ hovering.value = true;
7
+ };
8
+ const handleMouseLeave = () => {
9
+ hovering.value = false;
10
+ };
11
+ return {
12
+ hovering,
13
+ handleMouseEnter,
14
+ handleMouseLeave
15
+ };
16
+ }
17
+
18
+ export { useHovering };
19
+ //# sourceMappingURL=use-hovering.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-hovering.mjs","sources":["../../../../../../../packages/components/input-tag/src/composables/use-hovering.ts"],"sourcesContent":["import { ref } from 'vue'\n\nexport function useHovering() {\n const hovering = ref(false)\n\n const handleMouseEnter = () => {\n hovering.value = true\n }\n\n const handleMouseLeave = () => {\n hovering.value = false\n }\n\n return {\n hovering,\n handleMouseEnter,\n handleMouseLeave,\n }\n}\n"],"names":[],"mappings":";;AACO,SAAS,WAAW,GAAG;AAC9B,EAAE,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;AAC9B,EAAE,MAAM,gBAAgB,GAAG,MAAM;AACjC,IAAI,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;AAC1B,GAAG,CAAC;AACJ,EAAE,MAAM,gBAAgB,GAAG,MAAM;AACjC,IAAI,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;AAC3B,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,QAAQ;AACZ,IAAI,gBAAgB;AACpB,IAAI,gBAAgB;AACpB,GAAG,CAAC;AACJ;;;;"}
@@ -0,0 +1,58 @@
1
+ import type { ComputedRef, Ref, StyleValue } from 'vue';
2
+ import type { ComponentSize } from '@element-plus/nightly/es/constants';
3
+ import type { InputTagProps } from '../input-tag';
4
+ interface UseInputTagDomOptions {
5
+ props: InputTagProps;
6
+ isFocused: Ref<boolean>;
7
+ hovering: Ref<boolean>;
8
+ disabled: ComputedRef<boolean>;
9
+ inputValue: Ref<string | undefined>;
10
+ size: ComputedRef<ComponentSize>;
11
+ validateState: ComputedRef<string>;
12
+ validateIcon: ComputedRef<boolean>;
13
+ needStatusIcon: ComputedRef<boolean>;
14
+ }
15
+ export declare function useInputTagDom({ props, isFocused, hovering, disabled, inputValue, size, validateState, validateIcon, needStatusIcon, }: UseInputTagDomOptions): {
16
+ ns: {
17
+ namespace: ComputedRef<string>;
18
+ b: (blockSuffix?: string) => string;
19
+ e: (element?: string) => string;
20
+ m: (modifier?: string) => string;
21
+ be: (blockSuffix?: string, element?: string) => string;
22
+ em: (element?: string, modifier?: string) => string;
23
+ bm: (blockSuffix?: string, modifier?: string) => string;
24
+ bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
25
+ is: {
26
+ (name: string, state: boolean | undefined): string;
27
+ (name: string): string;
28
+ };
29
+ cssVar: (object: Record<string, string>) => Record<string, string>;
30
+ cssVarName: (name: string) => string;
31
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
32
+ cssVarBlockName: (name: string) => string;
33
+ };
34
+ nsInput: {
35
+ namespace: ComputedRef<string>;
36
+ b: (blockSuffix?: string) => string;
37
+ e: (element?: string) => string;
38
+ m: (modifier?: string) => string;
39
+ be: (blockSuffix?: string, element?: string) => string;
40
+ em: (element?: string, modifier?: string) => string;
41
+ bm: (blockSuffix?: string, modifier?: string) => string;
42
+ bem: (blockSuffix?: string, element?: string, modifier?: string) => string;
43
+ is: {
44
+ (name: string, state: boolean | undefined): string;
45
+ (name: string): string;
46
+ };
47
+ cssVar: (object: Record<string, string>) => Record<string, string>;
48
+ cssVarName: (name: string) => string;
49
+ cssVarBlock: (object: Record<string, string>) => Record<string, string>;
50
+ cssVarBlockName: (name: string) => string;
51
+ };
52
+ containerKls: ComputedRef<unknown[]>;
53
+ containerStyle: ComputedRef<StyleValue>;
54
+ innerKls: ComputedRef<string[]>;
55
+ showClear: ComputedRef<boolean | "" | 0 | undefined>;
56
+ showSuffix: ComputedRef<boolean | "" | import("vue").Slot>;
57
+ };
58
+ export {};
@@ -0,0 +1,57 @@
1
+ import { useAttrs, useSlots, computed } from 'vue';
2
+ import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
3
+
4
+ function useInputTagDom({
5
+ props,
6
+ isFocused,
7
+ hovering,
8
+ disabled,
9
+ inputValue,
10
+ size,
11
+ validateState,
12
+ validateIcon,
13
+ needStatusIcon
14
+ }) {
15
+ const attrs = useAttrs();
16
+ const slots = useSlots();
17
+ const ns = useNamespace("input-tag");
18
+ const nsInput = useNamespace("input");
19
+ const containerKls = computed(() => [
20
+ ns.b(),
21
+ ns.is("focused", isFocused.value),
22
+ ns.is("hovering", hovering.value),
23
+ ns.is("disabled", disabled.value),
24
+ ns.m(size.value),
25
+ ns.e("wrapper"),
26
+ attrs.class
27
+ ]);
28
+ const containerStyle = computed(() => [attrs.style]);
29
+ const innerKls = computed(() => {
30
+ var _a, _b;
31
+ return [
32
+ ns.e("inner"),
33
+ ns.is("draggable", props.draggable),
34
+ ns.is("left-space", !((_a = props.modelValue) == null ? void 0 : _a.length) && !slots.prefix),
35
+ ns.is("right-space", !((_b = props.modelValue) == null ? void 0 : _b.length) && !showSuffix.value)
36
+ ];
37
+ });
38
+ const showClear = computed(() => {
39
+ var _a;
40
+ return props.clearable && !disabled.value && !props.readonly && (((_a = props.modelValue) == null ? void 0 : _a.length) || inputValue.value) && (isFocused.value || hovering.value);
41
+ });
42
+ const showSuffix = computed(() => {
43
+ return slots.suffix || showClear.value || validateState.value && validateIcon.value && needStatusIcon.value;
44
+ });
45
+ return {
46
+ ns,
47
+ nsInput,
48
+ containerKls,
49
+ containerStyle,
50
+ innerKls,
51
+ showClear,
52
+ showSuffix
53
+ };
54
+ }
55
+
56
+ export { useInputTagDom };
57
+ //# sourceMappingURL=use-input-tag-dom.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-input-tag-dom.mjs","sources":["../../../../../../../packages/components/input-tag/src/composables/use-input-tag-dom.ts"],"sourcesContent":["import { computed, useAttrs, useSlots } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport type { ComputedRef, Ref, StyleValue } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type { InputTagProps } from '../input-tag'\n\ninterface UseInputTagDomOptions {\n props: InputTagProps\n isFocused: Ref<boolean>\n hovering: Ref<boolean>\n disabled: ComputedRef<boolean>\n inputValue: Ref<string | undefined>\n size: ComputedRef<ComponentSize>\n validateState: ComputedRef<string>\n validateIcon: ComputedRef<boolean>\n needStatusIcon: ComputedRef<boolean>\n}\n\nexport function useInputTagDom({\n props,\n isFocused,\n hovering,\n disabled,\n inputValue,\n size,\n validateState,\n validateIcon,\n needStatusIcon,\n}: UseInputTagDomOptions) {\n const attrs = useAttrs()\n const slots = useSlots()\n const ns = useNamespace('input-tag')\n const nsInput = useNamespace('input')\n\n const containerKls = computed(() => [\n ns.b(),\n ns.is('focused', isFocused.value),\n ns.is('hovering', hovering.value),\n ns.is('disabled', disabled.value),\n ns.m(size.value),\n ns.e('wrapper'),\n attrs.class,\n ])\n const containerStyle = computed<StyleValue>(() => [attrs.style as StyleValue])\n const innerKls = computed(() => [\n ns.e('inner'),\n ns.is('draggable', props.draggable),\n ns.is('left-space', !props.modelValue?.length && !slots.prefix),\n ns.is('right-space', !props.modelValue?.length && !showSuffix.value),\n ])\n const showClear = computed(() => {\n return (\n props.clearable &&\n !disabled.value &&\n !props.readonly &&\n (props.modelValue?.length || inputValue.value) &&\n (isFocused.value || hovering.value)\n )\n })\n const showSuffix = computed(() => {\n return (\n slots.suffix ||\n showClear.value ||\n (validateState.value && validateIcon.value && needStatusIcon.value)\n )\n })\n\n return {\n ns,\n nsInput,\n containerKls,\n containerStyle,\n innerKls,\n showClear,\n showSuffix,\n }\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,cAAc,CAAC;AAC/B,EAAE,KAAK;AACP,EAAE,SAAS;AACX,EAAE,QAAQ;AACV,EAAE,QAAQ;AACV,EAAE,UAAU;AACZ,EAAE,IAAI;AACN,EAAE,aAAa;AACf,EAAE,YAAY;AACd,EAAE,cAAc;AAChB,CAAC,EAAE;AACH,EAAE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;AAC3B,EAAE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;AAC3B,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;AACvC,EAAE,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AACxC,EAAE,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM;AACtC,IAAI,EAAE,CAAC,CAAC,EAAE;AACV,IAAI,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,KAAK,CAAC;AACrC,IAAI,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK,CAAC;AACrC,IAAI,EAAE,CAAC,EAAE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C,KAAK,CAAC,KAAK,SAAS,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxL,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM;AACpC,IAAI,OAAO,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC,KAAK,IAAI,aAAa,CAAC,KAAK,IAAI,YAAY,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC;AAChH,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,EAAE;AACN,IAAI,OAAO;AACX,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAAI,QAAQ;AACZ,IAAI,SAAS;AACb,IAAI,UAAU;AACd,GAAG,CAAC;AACJ;;;;"}
@@ -0,0 +1,33 @@
1
+ import { type EmitFn } from '@element-plus/nightly/es/utils';
2
+ import { type FormItemContext } from '@element-plus/nightly/es/components/form';
3
+ import type { InputTagEmits, InputTagProps } from '../input-tag';
4
+ interface UseInputTagOptions {
5
+ props: InputTagProps;
6
+ emit: EmitFn<InputTagEmits>;
7
+ formItem?: FormItemContext;
8
+ }
9
+ export declare function useInputTag({ props, emit, formItem }: UseInputTagOptions): {
10
+ inputRef: import("vue").ShallowRef<HTMLInputElement | undefined>;
11
+ wrapperRef: import("vue").ShallowRef<HTMLElement | undefined>;
12
+ isFocused: import("vue").Ref<boolean>;
13
+ isComposing: import("vue").Ref<boolean>;
14
+ inputValue: import("vue").Ref<string | undefined>;
15
+ size: import("vue").ComputedRef<"" | "small" | "default" | "large">;
16
+ tagSize: import("vue").ComputedRef<"default" | "small">;
17
+ placeholder: import("vue").ComputedRef<string | undefined>;
18
+ closable: import("vue").ComputedRef<boolean>;
19
+ disabled: import("vue").ComputedRef<boolean>;
20
+ inputLimit: import("vue").ComputedRef<boolean>;
21
+ handleDragged: (draggingIndex: number, dropIndex: number, type: "before" | "after") => void;
22
+ handleInput: (event: Event) => void;
23
+ handleKeydown: (event: KeyboardEvent) => void;
24
+ handleAddTag: () => void;
25
+ handleRemoveTag: (index: number) => void;
26
+ handleClear: () => void;
27
+ handleCompositionStart: (event: CompositionEvent) => void;
28
+ handleCompositionUpdate: (event: CompositionEvent) => void;
29
+ handleCompositionEnd: (event: CompositionEvent) => void;
30
+ focus: () => void;
31
+ blur: () => void;
32
+ };
33
+ export {};
@@ -0,0 +1,153 @@
1
+ import { shallowRef, ref, computed, watch } from 'vue';
2
+ import { useFormDisabled, useFormSize } from '../../../form/src/hooks/use-form-common-props.mjs';
3
+ import { isUndefined } from '../../../../utils/types.mjs';
4
+ import { INPUT_EVENT, UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../../constants/event.mjs';
5
+ import { EVENT_CODE } from '../../../../constants/aria.mjs';
6
+ import { useFocusController } from '../../../../hooks/use-focus-controller/index.mjs';
7
+ import { debugWarn } from '../../../../utils/error.mjs';
8
+ import { useComposition } from '../../../../hooks/use-composition/index.mjs';
9
+
10
+ function useInputTag({ props, emit, formItem }) {
11
+ const disabled = useFormDisabled();
12
+ const size = useFormSize();
13
+ const inputRef = shallowRef();
14
+ const inputValue = ref();
15
+ const tagSize = computed(() => {
16
+ return ["small"].includes(size.value) ? "small" : "default";
17
+ });
18
+ const placeholder = computed(() => {
19
+ var _a;
20
+ return ((_a = props.modelValue) == null ? void 0 : _a.length) ? void 0 : props.placeholder;
21
+ });
22
+ const closable = computed(() => !(props.readonly || disabled.value));
23
+ const inputLimit = computed(() => {
24
+ var _a, _b;
25
+ return isUndefined(props.max) ? false : ((_b = (_a = props.modelValue) == null ? void 0 : _a.length) != null ? _b : 0) >= props.max;
26
+ });
27
+ const handleInput = (event) => {
28
+ if (inputLimit.value) {
29
+ inputValue.value = void 0;
30
+ return;
31
+ }
32
+ if (isComposing.value)
33
+ return;
34
+ emit(INPUT_EVENT, event.target.value);
35
+ };
36
+ const handleKeydown = (event) => {
37
+ var _a;
38
+ switch (event.code) {
39
+ case props.trigger:
40
+ event.preventDefault();
41
+ event.stopPropagation();
42
+ handleAddTag();
43
+ break;
44
+ case EVENT_CODE.numpadEnter:
45
+ if (props.trigger === EVENT_CODE.enter) {
46
+ event.preventDefault();
47
+ event.stopPropagation();
48
+ handleAddTag();
49
+ }
50
+ break;
51
+ case EVENT_CODE.backspace:
52
+ if (!inputValue.value && ((_a = props.modelValue) == null ? void 0 : _a.length)) {
53
+ event.preventDefault();
54
+ event.stopPropagation();
55
+ handleRemoveTag(props.modelValue.length - 1);
56
+ }
57
+ break;
58
+ }
59
+ };
60
+ const handleAddTag = () => {
61
+ var _a, _b;
62
+ const value = (_a = inputValue.value) == null ? void 0 : _a.trim();
63
+ if (!value || inputLimit.value)
64
+ return;
65
+ const list = [...(_b = props.modelValue) != null ? _b : [], value];
66
+ emit(UPDATE_MODEL_EVENT, list);
67
+ emit(CHANGE_EVENT, list);
68
+ emit("add-tag", value);
69
+ inputValue.value = void 0;
70
+ };
71
+ const handleRemoveTag = (index) => {
72
+ var _a;
73
+ const value = ((_a = props.modelValue) != null ? _a : []).slice();
74
+ const [item] = value.splice(index, 1);
75
+ emit(UPDATE_MODEL_EVENT, value);
76
+ emit(CHANGE_EVENT, value);
77
+ emit("remove-tag", item);
78
+ };
79
+ const handleClear = () => {
80
+ inputValue.value = void 0;
81
+ emit(UPDATE_MODEL_EVENT, void 0);
82
+ emit(CHANGE_EVENT, void 0);
83
+ emit("clear");
84
+ };
85
+ const handleDragged = (draggingIndex, dropIndex, type) => {
86
+ var _a;
87
+ const value = ((_a = props.modelValue) != null ? _a : []).slice();
88
+ const [draggedItem] = value.splice(draggingIndex, 1);
89
+ const step = dropIndex > draggingIndex && type === "before" ? -1 : dropIndex < draggingIndex && type === "after" ? 1 : 0;
90
+ value.splice(dropIndex + step, 0, draggedItem);
91
+ emit(UPDATE_MODEL_EVENT, value);
92
+ emit(CHANGE_EVENT, value);
93
+ };
94
+ const focus = () => {
95
+ var _a;
96
+ (_a = inputRef.value) == null ? void 0 : _a.focus();
97
+ };
98
+ const blur = () => {
99
+ var _a;
100
+ (_a = inputRef.value) == null ? void 0 : _a.blur();
101
+ };
102
+ const { wrapperRef, isFocused } = useFocusController(inputRef, {
103
+ beforeFocus() {
104
+ return disabled.value;
105
+ },
106
+ afterBlur() {
107
+ var _a;
108
+ handleAddTag();
109
+ if (props.validateEvent) {
110
+ (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn(err));
111
+ }
112
+ }
113
+ });
114
+ const {
115
+ isComposing,
116
+ handleCompositionStart,
117
+ handleCompositionUpdate,
118
+ handleCompositionEnd
119
+ } = useComposition({ afterComposition: handleInput });
120
+ watch(() => props.modelValue, () => {
121
+ var _a;
122
+ if (props.validateEvent) {
123
+ (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, CHANGE_EVENT).catch((err) => debugWarn(err));
124
+ }
125
+ });
126
+ return {
127
+ inputRef,
128
+ wrapperRef,
129
+ isFocused,
130
+ isComposing,
131
+ inputValue,
132
+ size,
133
+ tagSize,
134
+ placeholder,
135
+ closable,
136
+ disabled,
137
+ inputLimit,
138
+ handleDragged,
139
+ handleInput,
140
+ handleKeydown,
141
+ handleAddTag,
142
+ handleRemoveTag,
143
+ handleClear,
144
+ handleCompositionStart,
145
+ handleCompositionUpdate,
146
+ handleCompositionEnd,
147
+ focus,
148
+ blur
149
+ };
150
+ }
151
+
152
+ export { useInputTag };
153
+ //# sourceMappingURL=use-input-tag.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-input-tag.mjs","sources":["../../../../../../../packages/components/input-tag/src/composables/use-input-tag.ts"],"sourcesContent":["import { computed, ref, shallowRef, watch } from 'vue'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { type EmitFn, debugWarn, isUndefined } from '@element-plus/utils'\nimport { useComposition, useFocusController } from '@element-plus/hooks'\nimport {\n type FormItemContext,\n useFormDisabled,\n useFormSize,\n} from '@element-plus/components/form'\nimport type { InputTagEmits, InputTagProps } from '../input-tag'\n\ninterface UseInputTagOptions {\n props: InputTagProps\n emit: EmitFn<InputTagEmits>\n formItem?: FormItemContext\n}\n\nexport function useInputTag({ props, emit, formItem }: UseInputTagOptions) {\n const disabled = useFormDisabled()\n const size = useFormSize()\n\n const inputRef = shallowRef<HTMLInputElement>()\n const inputValue = ref<string>()\n\n const tagSize = computed(() => {\n return ['small'].includes(size.value) ? 'small' : 'default'\n })\n const placeholder = computed(() => {\n return props.modelValue?.length ? undefined : props.placeholder\n })\n const closable = computed(() => !(props.readonly || disabled.value))\n const inputLimit = computed(() => {\n return isUndefined(props.max)\n ? false\n : (props.modelValue?.length ?? 0) >= props.max\n })\n\n const handleInput = (event: Event) => {\n if (inputLimit.value) {\n inputValue.value = undefined\n return\n }\n\n if (isComposing.value) return\n emit(INPUT_EVENT, (event.target as HTMLInputElement).value)\n }\n\n const handleKeydown = (event: KeyboardEvent) => {\n switch (event.code) {\n case props.trigger:\n event.preventDefault()\n event.stopPropagation()\n handleAddTag()\n break\n case EVENT_CODE.numpadEnter:\n if (props.trigger === EVENT_CODE.enter) {\n event.preventDefault()\n event.stopPropagation()\n handleAddTag()\n }\n break\n case EVENT_CODE.backspace:\n if (!inputValue.value && props.modelValue?.length) {\n event.preventDefault()\n event.stopPropagation()\n handleRemoveTag(props.modelValue.length - 1)\n }\n break\n }\n }\n\n const handleAddTag = () => {\n const value = inputValue.value?.trim()\n if (!value || inputLimit.value) return\n const list = [...(props.modelValue ?? []), value]\n\n emit(UPDATE_MODEL_EVENT, list)\n emit(CHANGE_EVENT, list)\n emit('add-tag', value)\n inputValue.value = undefined\n }\n\n const handleRemoveTag = (index: number) => {\n const value = (props.modelValue ?? []).slice()\n const [item] = value.splice(index, 1)\n\n emit(UPDATE_MODEL_EVENT, value)\n emit(CHANGE_EVENT, value)\n emit('remove-tag', item)\n }\n\n const handleClear = () => {\n inputValue.value = undefined\n emit(UPDATE_MODEL_EVENT, undefined)\n emit(CHANGE_EVENT, undefined)\n emit('clear')\n }\n\n const handleDragged = (\n draggingIndex: number,\n dropIndex: number,\n type: 'before' | 'after'\n ) => {\n const value = (props.modelValue ?? []).slice()\n const [draggedItem] = value.splice(draggingIndex, 1)\n const step =\n dropIndex > draggingIndex && type === 'before'\n ? -1\n : dropIndex < draggingIndex && type === 'after'\n ? 1\n : 0\n\n value.splice(dropIndex + step, 0, draggedItem)\n emit(UPDATE_MODEL_EVENT, value)\n emit(CHANGE_EVENT, value)\n }\n\n const focus = () => {\n inputRef.value?.focus()\n }\n\n const blur = () => {\n inputRef.value?.blur()\n }\n\n const { wrapperRef, isFocused } = useFocusController(inputRef, {\n beforeFocus() {\n return disabled.value\n },\n afterBlur() {\n handleAddTag()\n if (props.validateEvent) {\n formItem?.validate?.('blur').catch((err) => debugWarn(err))\n }\n },\n })\n\n const {\n isComposing,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n } = useComposition({ afterComposition: handleInput })\n\n watch(\n () => props.modelValue,\n () => {\n if (props.validateEvent) {\n formItem?.validate?.(CHANGE_EVENT).catch((err) => debugWarn(err))\n }\n }\n )\n\n return {\n inputRef,\n wrapperRef,\n isFocused,\n isComposing,\n inputValue,\n size,\n tagSize,\n placeholder,\n closable,\n disabled,\n inputLimit,\n handleDragged,\n handleInput,\n handleKeydown,\n handleAddTag,\n handleRemoveTag,\n handleClear,\n handleCompositionStart,\n handleCompositionUpdate,\n handleCompositionEnd,\n focus,\n blur,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAaO,SAAS,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;AACvD,EAAE,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;AACrC,EAAE,MAAM,IAAI,GAAG,WAAW,EAAE,CAAC;AAC7B,EAAE,MAAM,QAAQ,GAAG,UAAU,EAAE,CAAC;AAChC,EAAE,MAAM,UAAU,GAAG,GAAG,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a;AACjB,IAAI,WAAW;AACf,IAAI,aAAa;AACjB,IAAI,YAAY;AAChB,IAAI,eAAe;AACnB,IAAI,WAAW;AACf,IAAI,sBAAsB;AAC1B,IAAI,uBAAuB;AAC3B,IAAI,oBAAoB;AACxB,IAAI,KAAK;AACT,IAAI,IAAI;AACR,GAAG,CAAC;AACJ;;;;"}
@@ -0,0 +1,60 @@
1
+ import type { ExtractPropTypes } from 'vue';
2
+ export declare const inputTagProps: {
3
+ readonly modelValue: {
4
+ readonly type: import("vue").PropType<string[]>;
5
+ readonly required: false;
6
+ readonly validator: ((val: unknown) => boolean) | undefined;
7
+ __epPropKey: true;
8
+ };
9
+ readonly max: NumberConstructor;
10
+ readonly tagType: {
11
+ readonly default: "info";
12
+ readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown>>;
13
+ readonly required: false;
14
+ readonly validator: ((val: unknown) => boolean) | undefined;
15
+ readonly __epPropKey: true;
16
+ };
17
+ readonly tagEffect: import("@element-plus/nightly/es/utils").EpPropFinalized<StringConstructor, "dark" | "light" | "plain", unknown, "light", boolean>;
18
+ readonly trigger: import("@element-plus/nightly/es/utils").EpPropFinalized<(new (...args: any[]) => "Enter" | "Space") | (() => "Enter" | "Space") | ((new (...args: any[]) => "Enter" | "Space") | (() => "Enter" | "Space"))[], unknown, unknown, string, boolean>;
19
+ readonly draggable: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
20
+ readonly size: {
21
+ readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
22
+ readonly required: false;
23
+ readonly validator: ((val: unknown) => boolean) | undefined;
24
+ __epPropKey: true;
25
+ };
26
+ readonly clearable: BooleanConstructor;
27
+ readonly disabled: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
28
+ readonly validateEvent: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
29
+ readonly readonly: BooleanConstructor;
30
+ readonly autofocus: BooleanConstructor;
31
+ readonly id: import("@element-plus/nightly/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
32
+ readonly tabindex: import("@element-plus/nightly/es/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 0, boolean>;
33
+ readonly maxlength: {
34
+ readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
35
+ readonly required: false;
36
+ readonly validator: ((val: unknown) => boolean) | undefined;
37
+ __epPropKey: true;
38
+ };
39
+ readonly minlength: {
40
+ readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
41
+ readonly required: false;
42
+ readonly validator: ((val: unknown) => boolean) | undefined;
43
+ __epPropKey: true;
44
+ };
45
+ readonly placeholder: StringConstructor;
46
+ readonly autocomplete: import("@element-plus/nightly/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "off", boolean>;
47
+ readonly ariaLabel: StringConstructor;
48
+ };
49
+ export type InputTagProps = ExtractPropTypes<typeof inputTagProps>;
50
+ export declare const inputTagEmits: {
51
+ "update:modelValue": (value?: string[]) => boolean;
52
+ change: (value?: string[]) => boolean;
53
+ input: (value: string) => boolean;
54
+ 'add-tag': (value: string) => boolean;
55
+ 'remove-tag': (value: string) => boolean;
56
+ focus: (evt: FocusEvent) => boolean;
57
+ blur: (evt: FocusEvent) => boolean;
58
+ clear: () => boolean;
59
+ };
60
+ export type InputTagEmits = typeof inputTagEmits;
@@ -0,0 +1,69 @@
1
+ import { tagProps } from '../../tag/src/tag.mjs';
2
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
3
+ import { EVENT_CODE } from '../../../constants/aria.mjs';
4
+ import { useSizeProp } from '../../../hooks/use-size/index.mjs';
5
+ import { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
6
+ import { isArray, isString } from '@vue/shared';
7
+ import { isUndefined } from '../../../utils/types.mjs';
8
+
9
+ const inputTagProps = buildProps({
10
+ modelValue: {
11
+ type: definePropType(Array)
12
+ },
13
+ max: Number,
14
+ tagType: { ...tagProps.type, default: "info" },
15
+ tagEffect: tagProps.effect,
16
+ trigger: {
17
+ type: definePropType(String),
18
+ default: EVENT_CODE.enter
19
+ },
20
+ draggable: {
21
+ type: Boolean,
22
+ default: false
23
+ },
24
+ size: useSizeProp,
25
+ clearable: Boolean,
26
+ disabled: {
27
+ type: Boolean,
28
+ default: void 0
29
+ },
30
+ validateEvent: {
31
+ type: Boolean,
32
+ default: true
33
+ },
34
+ readonly: Boolean,
35
+ autofocus: Boolean,
36
+ id: {
37
+ type: String,
38
+ default: void 0
39
+ },
40
+ tabindex: {
41
+ type: [String, Number],
42
+ default: 0
43
+ },
44
+ maxlength: {
45
+ type: [String, Number]
46
+ },
47
+ minlength: {
48
+ type: [String, Number]
49
+ },
50
+ placeholder: String,
51
+ autocomplete: {
52
+ type: String,
53
+ default: "off"
54
+ },
55
+ ariaLabel: String
56
+ });
57
+ const inputTagEmits = {
58
+ [UPDATE_MODEL_EVENT]: (value) => isArray(value) || isUndefined(value),
59
+ [CHANGE_EVENT]: (value) => isArray(value) || isUndefined(value),
60
+ [INPUT_EVENT]: (value) => isString(value),
61
+ "add-tag": (value) => isString(value),
62
+ "remove-tag": (value) => isString(value),
63
+ focus: (evt) => evt instanceof FocusEvent,
64
+ blur: (evt) => evt instanceof FocusEvent,
65
+ clear: () => true
66
+ };
67
+
68
+ export { inputTagEmits, inputTagProps };
69
+ //# sourceMappingURL=input-tag.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-tag.mjs","sources":["../../../../../../packages/components/input-tag/src/input-tag.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isArray,\n isString,\n isUndefined,\n} from '@element-plus/utils'\nimport { useSizeProp } from '@element-plus/hooks'\nimport {\n CHANGE_EVENT,\n EVENT_CODE,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { tagProps } from '@element-plus/components/tag/src/tag'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const inputTagProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<string[]>(Array),\n },\n /**\n * @description max number tags that can be enter\n */\n max: Number,\n /**\n * @description tag type\n */\n tagType: { ...tagProps.type, default: 'info' },\n /**\n * @description tag effect\n */\n tagEffect: tagProps.effect,\n /**\n * @description the key to trigger input tag\n */\n trigger: {\n type: definePropType<'Enter' | 'Space'>(String),\n default: EVENT_CODE.enter,\n },\n /**\n * @description whether tags can be dragged\n */\n draggable: {\n type: Boolean,\n default: false,\n },\n /**\n * @description input box size\n */\n size: useSizeProp,\n /**\n * @description whether to show clear button\n */\n clearable: Boolean,\n /**\n * @description whether to disable input-tag\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description native input readonly\n */\n readonly: Boolean,\n /**\n * @description native input autofocus\n */\n autofocus: Boolean,\n /**\n * @description same as `id` in native input\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description same as `tabindex` in native input\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description same as `maxlength` in native input\n */\n maxlength: {\n type: [String, Number],\n },\n /**\n * @description same as `minlength` in native input\n */\n minlength: {\n type: [String, Number],\n },\n /**\n * @description placeholder of input\n */\n placeholder: String,\n /**\n * @description native input autocomplete\n */\n autocomplete: {\n type: String,\n default: 'off',\n },\n /**\n * @description native `aria-label` attribute\n */\n ariaLabel: String,\n} as const)\nexport type InputTagProps = ExtractPropTypes<typeof inputTagProps>\n\nexport const inputTagEmits = {\n [UPDATE_MODEL_EVENT]: (value?: string[]) =>\n isArray(value) || isUndefined(value),\n [CHANGE_EVENT]: (value?: string[]) => isArray(value) || isUndefined(value),\n [INPUT_EVENT]: (value: string) => isString(value),\n 'add-tag': (value: string) => isString(value),\n 'remove-tag': (value: string) => isString(value),\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: () => true,\n}\nexport type InputTagEmits = typeof inputTagEmits\n"],"names":[],"mappings":";;;;;;;;AAeY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,OAAO,EAAE,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE;AAChD,EAAE,SAAS,EAAE,QAAQ,CAAC,MAAM;AAC5B,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,UAAU,CAAC,KAAK;AAC7B,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,Q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