@element-plus/nightly 0.0.20250319 → 0.0.20250320

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/README.md +9 -4
  2. package/attributes.json +1 -1
  3. package/dist/index.full.js +11 -3
  4. package/dist/index.full.min.js +3 -3
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +3 -3
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +11 -3
  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/hi.js +1 -1
  94. package/dist/locale/hi.min.js +1 -1
  95. package/dist/locale/hi.min.mjs +1 -1
  96. package/dist/locale/hi.mjs +1 -1
  97. package/dist/locale/hr.js +1 -1
  98. package/dist/locale/hr.min.js +1 -1
  99. package/dist/locale/hr.min.mjs +1 -1
  100. package/dist/locale/hr.mjs +1 -1
  101. package/dist/locale/hu.js +1 -1
  102. package/dist/locale/hu.min.js +1 -1
  103. package/dist/locale/hu.min.mjs +1 -1
  104. package/dist/locale/hu.mjs +1 -1
  105. package/dist/locale/hy-am.js +1 -1
  106. package/dist/locale/hy-am.min.js +1 -1
  107. package/dist/locale/hy-am.min.mjs +1 -1
  108. package/dist/locale/hy-am.mjs +1 -1
  109. package/dist/locale/id.js +1 -1
  110. package/dist/locale/id.min.js +1 -1
  111. package/dist/locale/id.min.mjs +1 -1
  112. package/dist/locale/id.mjs +1 -1
  113. package/dist/locale/it.js +1 -1
  114. package/dist/locale/it.min.js +1 -1
  115. package/dist/locale/it.min.mjs +1 -1
  116. package/dist/locale/it.mjs +1 -1
  117. package/dist/locale/ja.js +1 -1
  118. package/dist/locale/ja.min.js +1 -1
  119. package/dist/locale/ja.min.mjs +1 -1
  120. package/dist/locale/ja.mjs +1 -1
  121. package/dist/locale/kk.js +1 -1
  122. package/dist/locale/kk.min.js +1 -1
  123. package/dist/locale/kk.min.mjs +1 -1
  124. package/dist/locale/kk.mjs +1 -1
  125. package/dist/locale/km.js +1 -1
  126. package/dist/locale/km.min.js +1 -1
  127. package/dist/locale/km.min.mjs +1 -1
  128. package/dist/locale/km.mjs +1 -1
  129. package/dist/locale/ko.js +1 -1
  130. package/dist/locale/ko.min.js +1 -1
  131. package/dist/locale/ko.min.mjs +1 -1
  132. package/dist/locale/ko.mjs +1 -1
  133. package/dist/locale/ku.js +1 -1
  134. package/dist/locale/ku.min.js +1 -1
  135. package/dist/locale/ku.min.mjs +1 -1
  136. package/dist/locale/ku.mjs +1 -1
  137. package/dist/locale/ky.js +1 -1
  138. package/dist/locale/ky.min.js +1 -1
  139. package/dist/locale/ky.min.mjs +1 -1
  140. package/dist/locale/ky.mjs +1 -1
  141. package/dist/locale/lt.js +1 -1
  142. package/dist/locale/lt.min.js +1 -1
  143. package/dist/locale/lt.min.mjs +1 -1
  144. package/dist/locale/lt.mjs +1 -1
  145. package/dist/locale/lv.js +1 -1
  146. package/dist/locale/lv.min.js +1 -1
  147. package/dist/locale/lv.min.mjs +1 -1
  148. package/dist/locale/lv.mjs +1 -1
  149. package/dist/locale/mg.js +1 -1
  150. package/dist/locale/mg.min.js +1 -1
  151. package/dist/locale/mg.min.mjs +1 -1
  152. package/dist/locale/mg.mjs +1 -1
  153. package/dist/locale/mn.js +1 -1
  154. package/dist/locale/mn.min.js +1 -1
  155. package/dist/locale/mn.min.mjs +1 -1
  156. package/dist/locale/mn.mjs +1 -1
  157. package/dist/locale/ms.js +1 -1
  158. package/dist/locale/ms.min.js +1 -1
  159. package/dist/locale/ms.min.mjs +1 -1
  160. package/dist/locale/ms.mjs +1 -1
  161. package/dist/locale/my.js +1 -1
  162. package/dist/locale/my.min.js +1 -1
  163. package/dist/locale/my.min.mjs +1 -1
  164. package/dist/locale/my.mjs +1 -1
  165. package/dist/locale/nb-no.js +1 -1
  166. package/dist/locale/nb-no.min.js +1 -1
  167. package/dist/locale/nb-no.min.mjs +1 -1
  168. package/dist/locale/nb-no.mjs +1 -1
  169. package/dist/locale/nl.js +1 -1
  170. package/dist/locale/nl.min.js +1 -1
  171. package/dist/locale/nl.min.mjs +1 -1
  172. package/dist/locale/nl.mjs +1 -1
  173. package/dist/locale/no.js +1 -1
  174. package/dist/locale/no.min.js +1 -1
  175. package/dist/locale/no.min.mjs +1 -1
  176. package/dist/locale/no.mjs +1 -1
  177. package/dist/locale/pa.js +1 -1
  178. package/dist/locale/pa.min.js +1 -1
  179. package/dist/locale/pa.min.mjs +1 -1
  180. package/dist/locale/pa.mjs +1 -1
  181. package/dist/locale/pl.js +1 -1
  182. package/dist/locale/pl.min.js +1 -1
  183. package/dist/locale/pl.min.mjs +1 -1
  184. package/dist/locale/pl.mjs +1 -1
  185. package/dist/locale/pt-br.js +1 -1
  186. package/dist/locale/pt-br.min.js +1 -1
  187. package/dist/locale/pt-br.min.mjs +1 -1
  188. package/dist/locale/pt-br.mjs +1 -1
  189. package/dist/locale/pt.js +1 -1
  190. package/dist/locale/pt.min.js +1 -1
  191. package/dist/locale/pt.min.mjs +1 -1
  192. package/dist/locale/pt.mjs +1 -1
  193. package/dist/locale/ro.js +1 -1
  194. package/dist/locale/ro.min.js +1 -1
  195. package/dist/locale/ro.min.mjs +1 -1
  196. package/dist/locale/ro.mjs +1 -1
  197. package/dist/locale/ru.js +1 -1
  198. package/dist/locale/ru.min.js +1 -1
  199. package/dist/locale/ru.min.mjs +1 -1
  200. package/dist/locale/ru.mjs +1 -1
  201. package/dist/locale/sk.js +1 -1
  202. package/dist/locale/sk.min.js +1 -1
  203. package/dist/locale/sk.min.mjs +1 -1
  204. package/dist/locale/sk.mjs +1 -1
  205. package/dist/locale/sl.js +1 -1
  206. package/dist/locale/sl.min.js +1 -1
  207. package/dist/locale/sl.min.mjs +1 -1
  208. package/dist/locale/sl.mjs +1 -1
  209. package/dist/locale/sr.js +1 -1
  210. package/dist/locale/sr.min.js +1 -1
  211. package/dist/locale/sr.min.mjs +1 -1
  212. package/dist/locale/sr.mjs +1 -1
  213. package/dist/locale/sv.js +1 -1
  214. package/dist/locale/sv.min.js +1 -1
  215. package/dist/locale/sv.min.mjs +1 -1
  216. package/dist/locale/sv.mjs +1 -1
  217. package/dist/locale/sw.js +1 -1
  218. package/dist/locale/sw.min.js +1 -1
  219. package/dist/locale/sw.min.mjs +1 -1
  220. package/dist/locale/sw.mjs +1 -1
  221. package/dist/locale/ta.js +1 -1
  222. package/dist/locale/ta.min.js +1 -1
  223. package/dist/locale/ta.min.mjs +1 -1
  224. package/dist/locale/ta.mjs +1 -1
  225. package/dist/locale/te.js +1 -1
  226. package/dist/locale/te.min.js +1 -1
  227. package/dist/locale/te.min.mjs +1 -1
  228. package/dist/locale/te.mjs +1 -1
  229. package/dist/locale/th.js +1 -1
  230. package/dist/locale/th.min.js +1 -1
  231. package/dist/locale/th.min.mjs +1 -1
  232. package/dist/locale/th.mjs +1 -1
  233. package/dist/locale/tk.js +1 -1
  234. package/dist/locale/tk.min.js +1 -1
  235. package/dist/locale/tk.min.mjs +1 -1
  236. package/dist/locale/tk.mjs +1 -1
  237. package/dist/locale/tr.js +1 -1
  238. package/dist/locale/tr.min.js +1 -1
  239. package/dist/locale/tr.min.mjs +1 -1
  240. package/dist/locale/tr.mjs +1 -1
  241. package/dist/locale/ug-cn.js +1 -1
  242. package/dist/locale/ug-cn.min.js +1 -1
  243. package/dist/locale/ug-cn.min.mjs +1 -1
  244. package/dist/locale/ug-cn.mjs +1 -1
  245. package/dist/locale/uk.js +1 -1
  246. package/dist/locale/uk.min.js +1 -1
  247. package/dist/locale/uk.min.mjs +1 -1
  248. package/dist/locale/uk.mjs +1 -1
  249. package/dist/locale/uz-uz.js +1 -1
  250. package/dist/locale/uz-uz.min.js +1 -1
  251. package/dist/locale/uz-uz.min.mjs +1 -1
  252. package/dist/locale/uz-uz.mjs +1 -1
  253. package/dist/locale/vi.js +1 -1
  254. package/dist/locale/vi.min.js +1 -1
  255. package/dist/locale/vi.min.mjs +1 -1
  256. package/dist/locale/vi.mjs +1 -1
  257. package/dist/locale/zh-cn.js +1 -1
  258. package/dist/locale/zh-cn.min.js +1 -1
  259. package/dist/locale/zh-cn.min.mjs +1 -1
  260. package/dist/locale/zh-cn.mjs +1 -1
  261. package/dist/locale/zh-hk.js +1 -1
  262. package/dist/locale/zh-hk.min.js +1 -1
  263. package/dist/locale/zh-hk.min.mjs +1 -1
  264. package/dist/locale/zh-hk.mjs +1 -1
  265. package/dist/locale/zh-mo.js +1 -1
  266. package/dist/locale/zh-mo.min.js +1 -1
  267. package/dist/locale/zh-mo.min.mjs +1 -1
  268. package/dist/locale/zh-mo.mjs +1 -1
  269. package/dist/locale/zh-tw.js +1 -1
  270. package/dist/locale/zh-tw.min.js +1 -1
  271. package/dist/locale/zh-tw.min.mjs +1 -1
  272. package/dist/locale/zh-tw.mjs +1 -1
  273. package/es/components/affix/index.mjs +2 -2
  274. package/es/components/affix/src/affix.mjs +24 -119
  275. package/es/components/affix/src/affix.mjs.map +1 -1
  276. package/es/components/affix/src/affix2.mjs +119 -24
  277. package/es/components/affix/src/affix2.mjs.map +1 -1
  278. package/es/components/autocomplete/src/autocomplete.mjs +1 -1
  279. package/es/components/backtop/index.mjs +2 -2
  280. package/es/components/backtop/src/backtop.mjs +21 -53
  281. package/es/components/backtop/src/backtop.mjs.map +1 -1
  282. package/es/components/backtop/src/backtop2.mjs +53 -21
  283. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  284. package/es/components/cascader/src/cascader.mjs +1 -1
  285. package/es/components/collapse/index.mjs +2 -2
  286. package/es/components/collapse/src/collapse.mjs +28 -16
  287. package/es/components/collapse/src/collapse.mjs.map +1 -1
  288. package/es/components/collapse/src/collapse2.mjs +16 -28
  289. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  290. package/es/components/color-picker/index.mjs +2 -2
  291. package/es/components/color-picker/src/color-picker.mjs +401 -39
  292. package/es/components/color-picker/src/color-picker.mjs.map +1 -1
  293. package/es/components/color-picker/src/color-picker2.mjs +39 -401
  294. package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
  295. package/es/components/color-picker/src/components/predefine.mjs +1 -1
  296. package/es/components/dropdown/src/dropdown.mjs +1 -1
  297. package/es/components/index.mjs +13 -13
  298. package/es/components/input-tag/src/composables/use-input-tag.mjs +5 -1
  299. package/es/components/input-tag/src/composables/use-input-tag.mjs.map +1 -1
  300. package/es/components/input-tag/src/input-tag.d.ts +1 -0
  301. package/es/components/input-tag/src/input-tag.mjs +4 -0
  302. package/es/components/input-tag/src/input-tag.mjs.map +1 -1
  303. package/es/components/input-tag/src/input-tag.vue.d.ts +3 -0
  304. package/es/components/menu/index.mjs +2 -2
  305. package/es/components/menu/src/menu-item-group.mjs +33 -4
  306. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  307. package/es/components/menu/src/menu-item-group2.mjs +4 -33
  308. package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
  309. package/es/components/popconfirm/src/popconfirm.mjs +1 -1
  310. package/es/components/popover/src/popover.mjs +1 -1
  311. package/es/components/rate/index.mjs +2 -2
  312. package/es/components/rate/src/rate.mjs +83 -258
  313. package/es/components/rate/src/rate.mjs.map +1 -1
  314. package/es/components/rate/src/rate2.mjs +258 -83
  315. package/es/components/rate/src/rate2.mjs.map +1 -1
  316. package/es/components/select/index.mjs +1 -1
  317. package/es/components/select/src/select.mjs +429 -113
  318. package/es/components/select/src/select.mjs.map +1 -1
  319. package/es/components/select/src/select2.mjs +113 -429
  320. package/es/components/select/src/select2.mjs.map +1 -1
  321. package/es/components/select-v2/src/defaults.mjs +1 -1
  322. package/es/components/slider/src/button.mjs +19 -91
  323. package/es/components/slider/src/button.mjs.map +1 -1
  324. package/es/components/slider/src/button2.mjs +91 -19
  325. package/es/components/slider/src/button2.mjs.map +1 -1
  326. package/es/components/slider/src/slider2.mjs +1 -1
  327. package/es/components/steps/index.mjs +2 -2
  328. package/es/components/steps/src/item.mjs +19 -190
  329. package/es/components/steps/src/item.mjs.map +1 -1
  330. package/es/components/steps/src/item2.mjs +190 -19
  331. package/es/components/steps/src/item2.mjs.map +1 -1
  332. package/es/components/time-select/index.mjs +2 -2
  333. package/es/components/time-select/src/time-select.mjs +132 -54
  334. package/es/components/time-select/src/time-select.mjs.map +1 -1
  335. package/es/components/time-select/src/time-select2.mjs +54 -132
  336. package/es/components/time-select/src/time-select2.mjs.map +1 -1
  337. package/es/components/tooltip/index.mjs +3 -3
  338. package/es/components/tooltip/src/content.mjs +192 -28
  339. package/es/components/tooltip/src/content.mjs.map +1 -1
  340. package/es/components/tooltip/src/content2.mjs +28 -192
  341. package/es/components/tooltip/src/content2.mjs.map +1 -1
  342. package/es/components/tooltip/src/tooltip.mjs +166 -30
  343. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  344. package/es/components/tooltip/src/tooltip2.mjs +30 -166
  345. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  346. package/es/components/tooltip-v2/index.mjs +4 -4
  347. package/es/components/tooltip-v2/src/arrow.mjs +37 -21
  348. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  349. package/es/components/tooltip-v2/src/arrow2.mjs +21 -37
  350. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  351. package/es/components/tooltip-v2/src/tooltip.mjs +78 -20
  352. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  353. package/es/components/tooltip-v2/src/tooltip2.mjs +20 -78
  354. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  355. package/es/components/tooltip-v2/src/trigger.mjs +12 -89
  356. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  357. package/es/components/tooltip-v2/src/trigger2.mjs +89 -12
  358. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  359. package/es/components/transfer/index.mjs +2 -2
  360. package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
  361. package/es/components/transfer/src/transfer-panel.mjs +1 -1
  362. package/es/components/transfer/src/transfer.mjs +164 -68
  363. package/es/components/transfer/src/transfer.mjs.map +1 -1
  364. package/es/components/transfer/src/transfer2.mjs +68 -164
  365. package/es/components/transfer/src/transfer2.mjs.map +1 -1
  366. package/es/components/upload/index.mjs +2 -2
  367. package/es/components/upload/src/upload-content.mjs +1 -1
  368. package/es/components/upload/src/upload-content2.mjs +1 -1
  369. package/es/components/upload/src/upload-list.mjs +1 -1
  370. package/es/components/upload/src/upload.mjs +125 -97
  371. package/es/components/upload/src/upload.mjs.map +1 -1
  372. package/es/components/upload/src/upload2.mjs +97 -125
  373. package/es/components/upload/src/upload2.mjs.map +1 -1
  374. package/es/components/upload/src/use-handlers.mjs +1 -1
  375. package/es/components/watermark/index.mjs +2 -2
  376. package/es/components/watermark/src/watermark.mjs +27 -210
  377. package/es/components/watermark/src/watermark.mjs.map +1 -1
  378. package/es/components/watermark/src/watermark2.mjs +210 -27
  379. package/es/components/watermark/src/watermark2.mjs.map +1 -1
  380. package/es/index.mjs +13 -13
  381. package/es/version.d.ts +1 -1
  382. package/es/version.mjs +1 -1
  383. package/es/version.mjs.map +1 -1
  384. package/lib/components/affix/index.js +2 -2
  385. package/lib/components/affix/src/affix.js +25 -119
  386. package/lib/components/affix/src/affix.js.map +1 -1
  387. package/lib/components/affix/src/affix2.js +119 -25
  388. package/lib/components/affix/src/affix2.js.map +1 -1
  389. package/lib/components/autocomplete/src/autocomplete.js +1 -1
  390. package/lib/components/backtop/index.js +2 -2
  391. package/lib/components/backtop/src/backtop.js +22 -53
  392. package/lib/components/backtop/src/backtop.js.map +1 -1
  393. package/lib/components/backtop/src/backtop2.js +53 -22
  394. package/lib/components/backtop/src/backtop2.js.map +1 -1
  395. package/lib/components/cascader/src/cascader.js +1 -1
  396. package/lib/components/collapse/index.js +2 -2
  397. package/lib/components/collapse/src/collapse.js +28 -18
  398. package/lib/components/collapse/src/collapse.js.map +1 -1
  399. package/lib/components/collapse/src/collapse2.js +18 -28
  400. package/lib/components/collapse/src/collapse2.js.map +1 -1
  401. package/lib/components/color-picker/index.js +2 -2
  402. package/lib/components/color-picker/src/color-picker.js +400 -40
  403. package/lib/components/color-picker/src/color-picker.js.map +1 -1
  404. package/lib/components/color-picker/src/color-picker2.js +40 -400
  405. package/lib/components/color-picker/src/color-picker2.js.map +1 -1
  406. package/lib/components/color-picker/src/components/predefine.js +1 -1
  407. package/lib/components/dropdown/src/dropdown.js +1 -1
  408. package/lib/components/index.js +13 -13
  409. package/lib/components/input-tag/src/composables/use-input-tag.js +5 -1
  410. package/lib/components/input-tag/src/composables/use-input-tag.js.map +1 -1
  411. package/lib/components/input-tag/src/input-tag.d.ts +1 -0
  412. package/lib/components/input-tag/src/input-tag.js +4 -0
  413. package/lib/components/input-tag/src/input-tag.js.map +1 -1
  414. package/lib/components/input-tag/src/input-tag.vue.d.ts +3 -0
  415. package/lib/components/menu/index.js +2 -2
  416. package/lib/components/menu/src/menu-item-group.js +33 -4
  417. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  418. package/lib/components/menu/src/menu-item-group2.js +4 -33
  419. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  420. package/lib/components/popconfirm/src/popconfirm.js +1 -1
  421. package/lib/components/popover/src/popover.js +1 -1
  422. package/lib/components/rate/index.js +2 -2
  423. package/lib/components/rate/src/rate.js +83 -257
  424. package/lib/components/rate/src/rate.js.map +1 -1
  425. package/lib/components/rate/src/rate2.js +257 -83
  426. package/lib/components/rate/src/rate2.js.map +1 -1
  427. package/lib/components/select/index.js +1 -1
  428. package/lib/components/select/src/select.js +429 -113
  429. package/lib/components/select/src/select.js.map +1 -1
  430. package/lib/components/select/src/select2.js +113 -429
  431. package/lib/components/select/src/select2.js.map +1 -1
  432. package/lib/components/select-v2/src/defaults.js +1 -1
  433. package/lib/components/slider/src/button.js +20 -91
  434. package/lib/components/slider/src/button.js.map +1 -1
  435. package/lib/components/slider/src/button2.js +91 -20
  436. package/lib/components/slider/src/button2.js.map +1 -1
  437. package/lib/components/slider/src/slider2.js +1 -1
  438. package/lib/components/steps/index.js +2 -2
  439. package/lib/components/steps/src/item.js +19 -190
  440. package/lib/components/steps/src/item.js.map +1 -1
  441. package/lib/components/steps/src/item2.js +190 -19
  442. package/lib/components/steps/src/item2.js.map +1 -1
  443. package/lib/components/time-select/index.js +2 -2
  444. package/lib/components/time-select/src/time-select.js +137 -54
  445. package/lib/components/time-select/src/time-select.js.map +1 -1
  446. package/lib/components/time-select/src/time-select2.js +54 -137
  447. package/lib/components/time-select/src/time-select2.js.map +1 -1
  448. package/lib/components/tooltip/index.js +3 -3
  449. package/lib/components/tooltip/src/content.js +192 -28
  450. package/lib/components/tooltip/src/content.js.map +1 -1
  451. package/lib/components/tooltip/src/content2.js +28 -192
  452. package/lib/components/tooltip/src/content2.js.map +1 -1
  453. package/lib/components/tooltip/src/tooltip.js +165 -33
  454. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  455. package/lib/components/tooltip/src/tooltip2.js +33 -165
  456. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  457. package/lib/components/tooltip-v2/index.js +4 -4
  458. package/lib/components/tooltip-v2/src/arrow.js +37 -22
  459. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  460. package/lib/components/tooltip-v2/src/arrow2.js +22 -37
  461. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  462. package/lib/components/tooltip-v2/src/tooltip.js +78 -20
  463. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  464. package/lib/components/tooltip-v2/src/tooltip2.js +20 -78
  465. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  466. package/lib/components/tooltip-v2/src/trigger.js +12 -89
  467. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  468. package/lib/components/tooltip-v2/src/trigger2.js +89 -12
  469. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  470. package/lib/components/transfer/index.js +2 -2
  471. package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
  472. package/lib/components/transfer/src/transfer-panel.js +1 -1
  473. package/lib/components/transfer/src/transfer.js +164 -72
  474. package/lib/components/transfer/src/transfer.js.map +1 -1
  475. package/lib/components/transfer/src/transfer2.js +72 -164
  476. package/lib/components/transfer/src/transfer2.js.map +1 -1
  477. package/lib/components/upload/index.js +2 -2
  478. package/lib/components/upload/src/upload-content.js +1 -1
  479. package/lib/components/upload/src/upload-content2.js +1 -1
  480. package/lib/components/upload/src/upload-list.js +1 -1
  481. package/lib/components/upload/src/upload.js +125 -100
  482. package/lib/components/upload/src/upload.js.map +1 -1
  483. package/lib/components/upload/src/upload2.js +100 -125
  484. package/lib/components/upload/src/upload2.js.map +1 -1
  485. package/lib/components/upload/src/use-handlers.js +1 -1
  486. package/lib/components/watermark/index.js +2 -2
  487. package/lib/components/watermark/src/watermark.js +27 -210
  488. package/lib/components/watermark/src/watermark.js.map +1 -1
  489. package/lib/components/watermark/src/watermark2.js +210 -27
  490. package/lib/components/watermark/src/watermark2.js.map +1 -1
  491. package/lib/index.js +13 -13
  492. package/lib/version.d.ts +1 -1
  493. package/lib/version.js +1 -1
  494. package/lib/version.js.map +1 -1
  495. package/package.json +2 -2
  496. package/tags.json +1 -1
  497. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"use-input-tag.js","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 if (isComposing.value) return\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":["useFormDisabled","useFormSize","shallowRef","ref","computed","isUndefined","event","INPUT_EVENT","EVENT_CODE","UPDATE_MODEL_EVENT","CHANGE_EVENT","useFocusController","debugWarn","useComposition","watch"],"mappings":";;;;;;;;;;;;;AAaO,SAAS,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;AACvD,EAAE,MAAM,QAAQ,GAAGA,kCAAe,EAAE,CAAC;AACrC,EAAE,MAAM,IAAI,GAAGC,8BAAW,EAAE,CAAC;AAC7B,EAAE,MAAM,QAAQ,GAAGC,cAAU,EAAE,CAAC;AAChC,EAAE,MAAM,UAAU,GAAGC,OAAG,EAAE,CAAC;AAC3B,EAAE,MAAM,OAAO,GAAGC,YAAQ,CAAC,MAAM;AACjC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,SAAS,CAAC;AAChE,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,WAAW,GAAGA,YAAQ,CAAC,MAAM;AACrC,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAO,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;;"}
1
+ {"version":3,"file":"use-input-tag.js","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 if (isComposing.value) return\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 if (props.saveOnBlur) {\n handleAddTag()\n } else {\n inputValue.value = undefined\n }\n\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":["useFormDisabled","useFormSize","shallowRef","ref","computed","isUndefined","event","INPUT_EVENT","EVENT_CODE","UPDATE_MODEL_EVENT","CHANGE_EVENT","useFocusController","debugWarn","useComposition","watch"],"mappings":";;;;;;;;;;;;;AAaO,SAAS,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;AACvD,EAAE,MAAM,QAAQ,GAAGA,kCAAe,EAAE,CAAC;AACrC,EAAE,MAAM,IAAI,GAAGC,8BAAW,EAAE,CAAC;AAC7B,EAAE,MAAM,QAAQ,GAAGC,cAAU,EAAE,CAAC;AAChC,EAAE,MAAM,UAAU,GAAGC,OAAG,EAAE,CAAC;AAC3B,EAAE,MAAM,OAAO,GAAGC,YAAQ,CAAC,MAAM;AACjC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,SAAS,CAAC;AAChE,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,WAAW,GAAGA,YAAQ,CAAC,MAAM;AACrC,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAO,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC;AAC/F,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,QAAQ,GAAGA,YAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACvE,EAAE,MAAM,UAAU,GAAGA,YAAQ,CAAC,MAAM;AACpC,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AACf,IAAI,OAAOC,iBAAW,CAAC,KAAK,CAAC,GAAG,CAA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AGC,sBAAc,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC,CAAC;AACxD,EAAEC,SAAK,CAAC,MAAM,KAAK,CAAC,UAAU,EAAE,MAAM;AACtC,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,IAAI,KAAK,CAAC,aAAa,EAAE;AAC7B,MAAM,CAAC,EAAE,GAAG,QAAQ,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,QAAQ,CAAC,QAAQ,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAEJ,kBAAY,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAKE,eAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7I,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,QAAQ;AACZ,IAAI,UAAU;AACd,IAAI,SAAS;AACb,IAAI,WAAW;AACf,IAAI,UAAU;AACd,IAAI,IAAI;AACR,IAAI,OAAO;AACX,IAAI,WAAW;AACf,IAAI,QAAQ;AACZ,IAAI,QAAQ;AACZ,IAAI,UAAU;AACd,IAAI,aAAa;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;;;;"}
@@ -44,6 +44,7 @@ export declare const inputTagProps: {
44
44
  };
45
45
  readonly placeholder: StringConstructor;
46
46
  readonly autocomplete: import("@element-plus/nightly/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "off", boolean>;
47
+ readonly saveOnBlur: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
47
48
  readonly ariaLabel: StringConstructor;
48
49
  };
49
50
  export type InputTagProps = ExtractPropTypes<typeof inputTagProps>;
@@ -56,6 +56,10 @@ const inputTagProps = runtime.buildProps({
56
56
  type: String,
57
57
  default: "off"
58
58
  },
59
+ saveOnBlur: {
60
+ type: Boolean,
61
+ default: true
62
+ },
59
63
  ariaLabel: String
60
64
  });
61
65
  const inputTagEmits = {
@@ -1 +1 @@
1
- {"version":3,"file":"input-tag.js","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":["buildProps","definePropType","tagProps","EVENT_CODE","useSizeProp","UPDATE_MODEL_EVENT","isArray","isUndefined","CHANGE_EVENT","INPUT_EVENT","isString"],"mappings":";;;;;;;;;;;;AAeY,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,OAAO,EAAE,EAAE,GAAGC,YAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE;AAChD,EAAE,SAAS,EAAEA,YAAQ,CAAC,MAAM;AAC5B,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAED,sBAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAEE,eAAU,CAAC,KAAK;AAC7B,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAEC,iBAAW;AACnB,EAAE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C;AACvC,EAAE,YAAY,EAAE,CAAC,KAAK,KAAKA,eAAQ,CAAC,KAAK,CAAC;AAC1C,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C,EAAE,IAAI,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC1C,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB;;;;;"}
1
+ {"version":3,"file":"input-tag.js","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 whether to save the input value when the input loses focus\n */\n saveOnBlur: {\n type: Boolean,\n default: true,\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":["buildProps","definePropType","tagProps","EVENT_CODE","useSizeProp","UPDATE_MODEL_EVENT","isArray","isUndefined","CHANGE_EVENT","INPUT_EVENT","isString"],"mappings":";;;;;;;;;;;;AAeY,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,GAAG,EAAE,MAAM;AACb,EAAE,OAAO,EAAE,EAAE,GAAGC,YAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE;AAChD,EAAE,SAAS,EAAEA,YAAQ,CAAC,MAAM;AAC5B,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAED,sBAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAEE,eAAU,CAAC,KAAK;AAC7B,GAAG;AACH,EAA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G,CAAC,KAAK,KAAKF,cAAO,CAAC,KAAK,CAAC,IAAIC,iBAAW,CAAC,KAAK,CAAC;AACjE,EAAE,CAACE,iBAAW,GAAG,CAAC,KAAK,KAAKC,eAAQ,CAAC,KAAK,CAAC;AAC3C,EAAE,SAAS,EAAE,CAAC,KAAK,KAAKA,eAAQ,CAAC,KAAK,CAAC;AACvC,EAAE,YAAY,EAAE,CAAC,KAAK,KAAKA,eAAQ,CAAC,KAAK,CAAC;AAC1C,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C,EAAE,IAAI,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC1C,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB;;;;;"}
@@ -51,6 +51,7 @@ declare const __VLS_component: import("vue").DefineComponent<{
51
51
  };
52
52
  readonly placeholder: StringConstructor;
53
53
  readonly autocomplete: import("@element-plus/nightly/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "off", boolean>;
54
+ readonly saveOnBlur: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
54
55
  readonly ariaLabel: StringConstructor;
55
56
  }, {
56
57
  focus: () => void;
@@ -109,6 +110,7 @@ declare const __VLS_component: import("vue").DefineComponent<{
109
110
  };
110
111
  readonly placeholder: StringConstructor;
111
112
  readonly autocomplete: import("@element-plus/nightly/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "off", boolean>;
113
+ readonly saveOnBlur: import("@element-plus/nightly/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
112
114
  readonly ariaLabel: StringConstructor;
113
115
  }>> & {
114
116
  "onUpdate:modelValue"?: ((value?: string[] | undefined) => any) | undefined;
@@ -132,6 +134,7 @@ declare const __VLS_component: import("vue").DefineComponent<{
132
134
  readonly tagType: import("@element-plus/nightly/es/utils").EpPropMergeType<StringConstructor, "success" | "warning" | "info" | "primary" | "danger", unknown>;
133
135
  readonly tagEffect: import("@element-plus/nightly/es/utils").EpPropMergeType<StringConstructor, "dark" | "light" | "plain", unknown>;
134
136
  readonly draggable: import("@element-plus/nightly/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
137
+ readonly saveOnBlur: import("@element-plus/nightly/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
135
138
  }>;
136
139
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
137
140
  export default _default;
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var menu = require('./src/menu.js');
6
6
  var menuItem$1 = require('./src/menu-item2.js');
7
- var menuItemGroup$1 = require('./src/menu-item-group2.js');
7
+ var menuItemGroup$1 = require('./src/menu-item-group.js');
8
8
  var subMenu = require('./src/sub-menu.js');
9
9
  var menuItem = require('./src/menu-item.js');
10
- var menuItemGroup = require('./src/menu-item-group.js');
10
+ var menuItemGroup = require('./src/menu-item-group2.js');
11
11
  var install = require('../../utils/vue/install.js');
12
12
 
13
13
  const ElMenu = install.withInstall(menu["default"], {
@@ -2,9 +2,38 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const menuItemGroupProps = {
6
- title: String
7
- };
5
+ var vue = require('vue');
6
+ var menuItemGroup = require('./menu-item-group2.js');
7
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
8
+ var index = require('../../../hooks/use-namespace/index.js');
8
9
 
9
- exports.menuItemGroupProps = menuItemGroupProps;
10
+ const __default__ = vue.defineComponent({
11
+ name: "ElMenuItemGroup"
12
+ });
13
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
14
+ ...__default__,
15
+ props: menuItemGroup.menuItemGroupProps,
16
+ setup(__props) {
17
+ const ns = index.useNamespace("menu-item-group");
18
+ return (_ctx, _cache) => {
19
+ return vue.openBlock(), vue.createElementBlock("li", {
20
+ class: vue.normalizeClass(vue.unref(ns).b())
21
+ }, [
22
+ vue.createElementVNode("div", {
23
+ class: vue.normalizeClass(vue.unref(ns).e("title"))
24
+ }, [
25
+ !_ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
26
+ vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
27
+ ], 64)) : vue.renderSlot(_ctx.$slots, "title", { key: 1 })
28
+ ], 2),
29
+ vue.createElementVNode("ul", null, [
30
+ vue.renderSlot(_ctx.$slots, "default")
31
+ ])
32
+ ], 2);
33
+ };
34
+ }
35
+ });
36
+ var MenuItemGroup = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "menu-item-group.vue"]]);
37
+
38
+ exports["default"] = MenuItemGroup;
10
39
  //# sourceMappingURL=menu-item-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item-group.js","sources":["../../../../../../packages/components/menu/src/menu-item-group.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const menuItemGroupProps = {\n /**\n * @description group title\n */\n title: String,\n} as const\nexport type MenuItemGroupProps = ExtractPropTypes<typeof menuItemGroupProps>\n"],"names":[],"mappings":";;;;AAAY,MAAC,kBAAkB,GAAG;AAClC,EAAE,KAAK,EAAE,MAAM;AACf;;;;"}
1
+ {"version":3,"file":"menu-item-group.js","sources":["../../../../../../packages/components/menu/src/menu-item-group.vue"],"sourcesContent":["<template>\n <li :class=\"ns.b()\">\n <div :class=\"ns.e('title')\">\n <template v-if=\"!$slots.title\">{{ title }}</template>\n <slot v-else name=\"title\" />\n </div>\n <ul>\n <slot />\n </ul>\n </li>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useNamespace } from '@element-plus/hooks'\nimport { menuItemGroupProps } from './menu-item-group'\n\ndefineOptions({\n name: 'ElMenuItemGroup',\n})\ndefineProps(menuItemGroupProps)\nconst ns = useNamespace('menu-item-group')\n</script>\n"],"names":["useNamespace"],"mappings":";;;;;;;;;uCAgBc,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AACR,CAAA,CAAA,CAAA;;;;;AAEA,IAAM,MAAA,EAAA,GAAKA,mBAAa,iBAAiB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,38 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var menuItemGroup = require('./menu-item-group.js');
7
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
8
- var index = require('../../../hooks/use-namespace/index.js');
5
+ const menuItemGroupProps = {
6
+ title: String
7
+ };
9
8
 
10
- const __default__ = vue.defineComponent({
11
- name: "ElMenuItemGroup"
12
- });
13
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
14
- ...__default__,
15
- props: menuItemGroup.menuItemGroupProps,
16
- setup(__props) {
17
- const ns = index.useNamespace("menu-item-group");
18
- return (_ctx, _cache) => {
19
- return vue.openBlock(), vue.createElementBlock("li", {
20
- class: vue.normalizeClass(vue.unref(ns).b())
21
- }, [
22
- vue.createElementVNode("div", {
23
- class: vue.normalizeClass(vue.unref(ns).e("title"))
24
- }, [
25
- !_ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
26
- vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
27
- ], 64)) : vue.renderSlot(_ctx.$slots, "title", { key: 1 })
28
- ], 2),
29
- vue.createElementVNode("ul", null, [
30
- vue.renderSlot(_ctx.$slots, "default")
31
- ])
32
- ], 2);
33
- };
34
- }
35
- });
36
- var MenuItemGroup = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "menu-item-group.vue"]]);
37
-
38
- exports["default"] = MenuItemGroup;
9
+ exports.menuItemGroupProps = menuItemGroupProps;
39
10
  //# sourceMappingURL=menu-item-group2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item-group2.js","sources":["../../../../../../packages/components/menu/src/menu-item-group.vue"],"sourcesContent":["<template>\n <li :class=\"ns.b()\">\n <div :class=\"ns.e('title')\">\n <template v-if=\"!$slots.title\">{{ title }}</template>\n <slot v-else name=\"title\" />\n </div>\n <ul>\n <slot />\n </ul>\n </li>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useNamespace } from '@element-plus/hooks'\nimport { menuItemGroupProps } from './menu-item-group'\n\ndefineOptions({\n name: 'ElMenuItemGroup',\n})\ndefineProps(menuItemGroupProps)\nconst ns = useNamespace('menu-item-group')\n</script>\n"],"names":["useNamespace"],"mappings":";;;;;;;;;uCAgBc,CAAA;AAAA,EACZ,IAAM,EAAA,iBAAA;AACR,CAAA,CAAA,CAAA;;;;;AAEA,IAAM,MAAA,EAAA,GAAKA,mBAAa,iBAAiB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"menu-item-group2.js","sources":["../../../../../../packages/components/menu/src/menu-item-group.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const menuItemGroupProps = {\n /**\n * @description group title\n */\n title: String,\n} as const\nexport type MenuItemGroupProps = ExtractPropTypes<typeof menuItemGroupProps>\n"],"names":[],"mappings":";;;;AAAY,MAAC,kBAAkB,GAAG;AAClC,EAAE,KAAK,EAAE,MAAM;AACf;;;;"}
@@ -6,7 +6,7 @@ var iconsVue = require('@element-plus/icons-vue');
6
6
  var button = require('../../button/src/button.js');
7
7
  var runtime = require('../../../utils/vue/props/runtime.js');
8
8
  var icon = require('../../../utils/vue/icon.js');
9
- var content = require('../../tooltip/src/content.js');
9
+ var content = require('../../tooltip/src/content2.js');
10
10
 
11
11
  const popconfirmProps = runtime.buildProps({
12
12
  title: String,
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var dropdown = require('../../dropdown/src/dropdown.js');
6
6
  var runtime = require('../../../utils/vue/props/runtime.js');
7
7
  var trigger = require('../../tooltip/src/trigger.js');
8
- var content = require('../../tooltip/src/content.js');
8
+ var content = require('../../tooltip/src/content2.js');
9
9
  var types = require('../../../utils/types.js');
10
10
 
11
11
  const popoverProps = runtime.buildProps({
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var rate$1 = require('./src/rate.js');
6
- var rate = require('./src/rate2.js');
5
+ var rate$1 = require('./src/rate2.js');
6
+ var rate = require('./src/rate.js');
7
7
  var install = require('../../utils/vue/install.js');
8
8
 
9
9
  const ElRate = install.withInstall(rate$1["default"]);
@@ -2,265 +2,91 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var index$1 = require('../../icon/index.js');
7
- var rate = require('./rate2.js');
8
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
9
- var constants = require('../../form/src/constants.js');
10
- var useFormCommonProps = require('../../form/src/hooks/use-form-common-props.js');
11
- var index = require('../../../hooks/use-namespace/index.js');
12
- var useFormItem = require('../../form/src/hooks/use-form-item.js');
13
- var shared = require('@vue/shared');
5
+ var iconsVue = require('@element-plus/icons-vue');
6
+ var runtime = require('../../../utils/vue/props/runtime.js');
7
+ var typescript = require('../../../utils/typescript.js');
8
+ var icon = require('../../../utils/vue/icon.js');
9
+ var index = require('../../../hooks/use-size/index.js');
10
+ var index$1 = require('../../../hooks/use-aria/index.js');
14
11
  var event = require('../../../constants/event.js');
15
- var aria = require('../../../constants/aria.js');
16
- var style = require('../../../utils/dom/style.js');
12
+ var types = require('../../../utils/types.js');
17
13
 
18
- const __default__ = vue.defineComponent({
19
- name: "ElRate"
14
+ const rateProps = runtime.buildProps({
15
+ modelValue: {
16
+ type: Number,
17
+ default: 0
18
+ },
19
+ id: {
20
+ type: String,
21
+ default: void 0
22
+ },
23
+ lowThreshold: {
24
+ type: Number,
25
+ default: 2
26
+ },
27
+ highThreshold: {
28
+ type: Number,
29
+ default: 4
30
+ },
31
+ max: {
32
+ type: Number,
33
+ default: 5
34
+ },
35
+ colors: {
36
+ type: runtime.definePropType([Array, Object]),
37
+ default: () => typescript.mutable(["", "", ""])
38
+ },
39
+ voidColor: {
40
+ type: String,
41
+ default: ""
42
+ },
43
+ disabledVoidColor: {
44
+ type: String,
45
+ default: ""
46
+ },
47
+ icons: {
48
+ type: runtime.definePropType([Array, Object]),
49
+ default: () => [iconsVue.StarFilled, iconsVue.StarFilled, iconsVue.StarFilled]
50
+ },
51
+ voidIcon: {
52
+ type: icon.iconPropType,
53
+ default: () => iconsVue.Star
54
+ },
55
+ disabledVoidIcon: {
56
+ type: icon.iconPropType,
57
+ default: () => iconsVue.StarFilled
58
+ },
59
+ disabled: Boolean,
60
+ allowHalf: Boolean,
61
+ showText: Boolean,
62
+ showScore: Boolean,
63
+ textColor: {
64
+ type: String,
65
+ default: ""
66
+ },
67
+ texts: {
68
+ type: runtime.definePropType(Array),
69
+ default: () => typescript.mutable([
70
+ "Extremely bad",
71
+ "Disappointed",
72
+ "Fair",
73
+ "Satisfied",
74
+ "Surprise"
75
+ ])
76
+ },
77
+ scoreTemplate: {
78
+ type: String,
79
+ default: "{value}"
80
+ },
81
+ size: index.useSizeProp,
82
+ clearable: Boolean,
83
+ ...index$1.useAriaProps(["ariaLabel"])
20
84
  });
21
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
22
- ...__default__,
23
- props: rate.rateProps,
24
- emits: rate.rateEmits,
25
- setup(__props, { expose, emit }) {
26
- const props = __props;
27
- function getValueFromMap(value, map) {
28
- const isExcludedObject = (val) => shared.isObject(val);
29
- const matchedKeys = Object.keys(map).map((key) => +key).filter((key) => {
30
- const val = map[key];
31
- const excluded = isExcludedObject(val) ? val.excluded : false;
32
- return excluded ? value < key : value <= key;
33
- }).sort((a, b) => a - b);
34
- const matchedValue = map[matchedKeys[0]];
35
- return isExcludedObject(matchedValue) && matchedValue.value || matchedValue;
36
- }
37
- const formContext = vue.inject(constants.formContextKey, void 0);
38
- const formItemContext = vue.inject(constants.formItemContextKey, void 0);
39
- const rateSize = useFormCommonProps.useFormSize();
40
- const ns = index.useNamespace("rate");
41
- const { inputId, isLabeledByFormItem } = useFormItem.useFormItemInputId(props, {
42
- formItemContext
43
- });
44
- const currentValue = vue.ref(props.modelValue);
45
- const hoverIndex = vue.ref(-1);
46
- const pointerAtLeftHalf = vue.ref(true);
47
- const rateClasses = vue.computed(() => [ns.b(), ns.m(rateSize.value)]);
48
- const rateDisabled = vue.computed(() => props.disabled || (formContext == null ? void 0 : formContext.disabled));
49
- const rateStyles = vue.computed(() => {
50
- return ns.cssVarBlock({
51
- "void-color": props.voidColor,
52
- "disabled-void-color": props.disabledVoidColor,
53
- "fill-color": activeColor.value
54
- });
55
- });
56
- const text = vue.computed(() => {
57
- let result = "";
58
- if (props.showScore) {
59
- result = props.scoreTemplate.replace(/\{\s*value\s*\}/, rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`);
60
- } else if (props.showText) {
61
- result = props.texts[Math.ceil(currentValue.value) - 1];
62
- }
63
- return result;
64
- });
65
- const valueDecimal = vue.computed(() => props.modelValue * 100 - Math.floor(props.modelValue) * 100);
66
- const colorMap = vue.computed(() => shared.isArray(props.colors) ? {
67
- [props.lowThreshold]: props.colors[0],
68
- [props.highThreshold]: { value: props.colors[1], excluded: true },
69
- [props.max]: props.colors[2]
70
- } : props.colors);
71
- const activeColor = vue.computed(() => {
72
- const color = getValueFromMap(currentValue.value, colorMap.value);
73
- return shared.isObject(color) ? "" : color;
74
- });
75
- const decimalStyle = vue.computed(() => {
76
- let width = "";
77
- if (rateDisabled.value) {
78
- width = `${valueDecimal.value}%`;
79
- } else if (props.allowHalf) {
80
- width = "50%";
81
- }
82
- return {
83
- color: activeColor.value,
84
- width
85
- };
86
- });
87
- const componentMap = vue.computed(() => {
88
- let icons = shared.isArray(props.icons) ? [...props.icons] : { ...props.icons };
89
- icons = vue.markRaw(icons);
90
- return shared.isArray(icons) ? {
91
- [props.lowThreshold]: icons[0],
92
- [props.highThreshold]: {
93
- value: icons[1],
94
- excluded: true
95
- },
96
- [props.max]: icons[2]
97
- } : icons;
98
- });
99
- const decimalIconComponent = vue.computed(() => getValueFromMap(props.modelValue, componentMap.value));
100
- const voidComponent = vue.computed(() => rateDisabled.value ? shared.isString(props.disabledVoidIcon) ? props.disabledVoidIcon : vue.markRaw(props.disabledVoidIcon) : shared.isString(props.voidIcon) ? props.voidIcon : vue.markRaw(props.voidIcon));
101
- const activeComponent = vue.computed(() => getValueFromMap(currentValue.value, componentMap.value));
102
- function showDecimalIcon(item) {
103
- const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props.modelValue && item > props.modelValue;
104
- const showWhenAllowHalf = props.allowHalf && pointerAtLeftHalf.value && item - 0.5 <= currentValue.value && item > currentValue.value;
105
- return showWhenDisabled || showWhenAllowHalf;
106
- }
107
- function emitValue(value) {
108
- if (props.clearable && value === props.modelValue) {
109
- value = 0;
110
- }
111
- emit(event.UPDATE_MODEL_EVENT, value);
112
- if (props.modelValue !== value) {
113
- emit(event.CHANGE_EVENT, value);
114
- }
115
- }
116
- function selectValue(value) {
117
- if (rateDisabled.value) {
118
- return;
119
- }
120
- if (props.allowHalf && pointerAtLeftHalf.value) {
121
- emitValue(currentValue.value);
122
- } else {
123
- emitValue(value);
124
- }
125
- }
126
- function handleKey(e) {
127
- if (rateDisabled.value) {
128
- return;
129
- }
130
- let _currentValue = currentValue.value;
131
- const code = e.code;
132
- if (code === aria.EVENT_CODE.up || code === aria.EVENT_CODE.right) {
133
- if (props.allowHalf) {
134
- _currentValue += 0.5;
135
- } else {
136
- _currentValue += 1;
137
- }
138
- e.stopPropagation();
139
- e.preventDefault();
140
- } else if (code === aria.EVENT_CODE.left || code === aria.EVENT_CODE.down) {
141
- if (props.allowHalf) {
142
- _currentValue -= 0.5;
143
- } else {
144
- _currentValue -= 1;
145
- }
146
- e.stopPropagation();
147
- e.preventDefault();
148
- }
149
- _currentValue = _currentValue < 0 ? 0 : _currentValue;
150
- _currentValue = _currentValue > props.max ? props.max : _currentValue;
151
- emit(event.UPDATE_MODEL_EVENT, _currentValue);
152
- emit(event.CHANGE_EVENT, _currentValue);
153
- return _currentValue;
154
- }
155
- function setCurrentValue(value, event) {
156
- if (rateDisabled.value) {
157
- return;
158
- }
159
- if (props.allowHalf && event) {
160
- let target = event.target;
161
- if (style.hasClass(target, ns.e("item"))) {
162
- target = target.querySelector(`.${ns.e("icon")}`);
163
- }
164
- if (target.clientWidth === 0 || style.hasClass(target, ns.e("decimal"))) {
165
- target = target.parentNode;
166
- }
167
- pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth;
168
- currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value;
169
- } else {
170
- currentValue.value = value;
171
- }
172
- hoverIndex.value = value;
173
- }
174
- function resetCurrentValue() {
175
- if (rateDisabled.value) {
176
- return;
177
- }
178
- if (props.allowHalf) {
179
- pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue);
180
- }
181
- currentValue.value = props.modelValue;
182
- hoverIndex.value = -1;
183
- }
184
- vue.watch(() => props.modelValue, (val) => {
185
- currentValue.value = val;
186
- pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue);
187
- });
188
- if (!props.modelValue) {
189
- emit(event.UPDATE_MODEL_EVENT, 0);
190
- }
191
- expose({
192
- setCurrentValue,
193
- resetCurrentValue
194
- });
195
- return (_ctx, _cache) => {
196
- var _a;
197
- return vue.openBlock(), vue.createElementBlock("div", {
198
- id: vue.unref(inputId),
199
- class: vue.normalizeClass([vue.unref(rateClasses), vue.unref(ns).is("disabled", vue.unref(rateDisabled))]),
200
- role: "slider",
201
- "aria-label": !vue.unref(isLabeledByFormItem) ? _ctx.ariaLabel || "rating" : void 0,
202
- "aria-labelledby": vue.unref(isLabeledByFormItem) ? (_a = vue.unref(formItemContext)) == null ? void 0 : _a.labelId : void 0,
203
- "aria-valuenow": currentValue.value,
204
- "aria-valuetext": vue.unref(text) || void 0,
205
- "aria-valuemin": "0",
206
- "aria-valuemax": _ctx.max,
207
- tabindex: "0",
208
- style: vue.normalizeStyle(vue.unref(rateStyles)),
209
- onKeydown: handleKey
210
- }, [
211
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.max, (item, key) => {
212
- return vue.openBlock(), vue.createElementBlock("span", {
213
- key,
214
- class: vue.normalizeClass(vue.unref(ns).e("item")),
215
- onMousemove: ($event) => setCurrentValue(item, $event),
216
- onMouseleave: resetCurrentValue,
217
- onClick: ($event) => selectValue(item)
218
- }, [
219
- vue.createVNode(vue.unref(index$1.ElIcon), {
220
- class: vue.normalizeClass([
221
- vue.unref(ns).e("icon"),
222
- { hover: hoverIndex.value === item },
223
- vue.unref(ns).is("active", item <= currentValue.value)
224
- ])
225
- }, {
226
- default: vue.withCtx(() => [
227
- !showDecimalIcon(item) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
228
- vue.withDirectives((vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(activeComponent)), null, null, 512)), [
229
- [vue.vShow, item <= currentValue.value]
230
- ]),
231
- vue.withDirectives((vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(voidComponent)), null, null, 512)), [
232
- [vue.vShow, !(item <= currentValue.value)]
233
- ])
234
- ], 64)) : vue.createCommentVNode("v-if", true),
235
- showDecimalIcon(item) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
236
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(voidComponent)), {
237
- class: vue.normalizeClass([vue.unref(ns).em("decimal", "box")])
238
- }, null, 8, ["class"])),
239
- vue.createVNode(vue.unref(index$1.ElIcon), {
240
- style: vue.normalizeStyle(vue.unref(decimalStyle)),
241
- class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(ns).e("decimal")])
242
- }, {
243
- default: vue.withCtx(() => [
244
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(decimalIconComponent))))
245
- ]),
246
- _: 1
247
- }, 8, ["style", "class"])
248
- ], 64)) : vue.createCommentVNode("v-if", true)
249
- ]),
250
- _: 2
251
- }, 1032, ["class"])
252
- ], 42, ["onMousemove", "onClick"]);
253
- }), 128)),
254
- _ctx.showText || _ctx.showScore ? (vue.openBlock(), vue.createElementBlock("span", {
255
- key: 0,
256
- class: vue.normalizeClass(vue.unref(ns).e("text")),
257
- style: vue.normalizeStyle({ color: _ctx.textColor })
258
- }, vue.toDisplayString(vue.unref(text)), 7)) : vue.createCommentVNode("v-if", true)
259
- ], 46, ["id", "aria-label", "aria-labelledby", "aria-valuenow", "aria-valuetext", "aria-valuemax"]);
260
- };
261
- }
262
- });
263
- var Rate = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "rate.vue"]]);
85
+ const rateEmits = {
86
+ [event.CHANGE_EVENT]: (value) => types.isNumber(value),
87
+ [event.UPDATE_MODEL_EVENT]: (value) => types.isNumber(value)
88
+ };
264
89
 
265
- exports["default"] = Rate;
90
+ exports.rateEmits = rateEmits;
91
+ exports.rateProps = rateProps;
266
92
  //# sourceMappingURL=rate.js.map