element-ps 2.0.21 → 2.0.22

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 (338) hide show
  1. package/dist/index.full.js +1 -56
  2. package/dist/index.full.min.js +5 -5
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +5 -5
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +1 -56
  7. package/es/components/alert/index.mjs +2 -2
  8. package/es/components/alert/src/alert.mjs +83 -33
  9. package/es/components/alert/src/alert.mjs.map +1 -1
  10. package/es/components/alert/src/alert2.mjs +33 -83
  11. package/es/components/alert/src/alert2.mjs.map +1 -1
  12. package/es/components/autocomplete/index.mjs +2 -2
  13. package/es/components/autocomplete/src/autocomplete.mjs +58 -94
  14. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  15. package/es/components/autocomplete/src/autocomplete2.mjs +94 -58
  16. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  17. package/es/components/avatar/index.mjs +2 -2
  18. package/es/components/avatar/src/avatar.mjs +61 -29
  19. package/es/components/avatar/src/avatar.mjs.map +1 -1
  20. package/es/components/avatar/src/avatar2.mjs +29 -61
  21. package/es/components/avatar/src/avatar2.mjs.map +1 -1
  22. package/es/components/badge/index.mjs +2 -2
  23. package/es/components/badge/src/badge.mjs +17 -54
  24. package/es/components/badge/src/badge.mjs.map +1 -1
  25. package/es/components/badge/src/badge2.mjs +54 -17
  26. package/es/components/badge/src/badge2.mjs.map +1 -1
  27. package/es/components/button/index.mjs +2 -2
  28. package/es/components/button/src/button-group.mjs +1 -1
  29. package/es/components/button/src/button.mjs +96 -48
  30. package/es/components/button/src/button.mjs.map +1 -1
  31. package/es/components/button/src/button2.mjs +48 -96
  32. package/es/components/button/src/button2.mjs.map +1 -1
  33. package/es/components/card/index.mjs +2 -2
  34. package/es/components/card/src/card.mjs +15 -35
  35. package/es/components/card/src/card.mjs.map +1 -1
  36. package/es/components/card/src/card2.mjs +35 -15
  37. package/es/components/card/src/card2.mjs.map +1 -1
  38. package/es/components/cascader/src/index.mjs +1 -1
  39. package/es/components/cascader-panel/src/config.mjs +1 -1
  40. package/es/components/cascader-panel/src/index.mjs +1 -1
  41. package/es/components/cascader-panel/src/menu.mjs +1 -1
  42. package/es/components/cascader-panel/src/node.mjs +120 -200
  43. package/es/components/cascader-panel/src/node.mjs.map +1 -1
  44. package/es/components/cascader-panel/src/node2.mjs +200 -120
  45. package/es/components/cascader-panel/src/node2.mjs.map +1 -1
  46. package/es/components/cascader-panel/src/store.mjs +1 -1
  47. package/es/components/collapse/index.mjs +2 -2
  48. package/es/components/collapse/src/collapse.mjs +61 -14
  49. package/es/components/collapse/src/collapse.mjs.map +1 -1
  50. package/es/components/collapse/src/collapse2.mjs +14 -61
  51. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  52. package/es/components/collection/index.mjs +1 -1
  53. package/es/components/collection/src/collection.mjs +10 -30
  54. package/es/components/collection/src/collection.mjs.map +1 -1
  55. package/es/components/collection/src/collection2.mjs +30 -10
  56. package/es/components/collection/src/collection2.mjs.map +1 -1
  57. package/es/components/divider/index.mjs +2 -2
  58. package/es/components/divider/src/divider.mjs +17 -34
  59. package/es/components/divider/src/divider.mjs.map +1 -1
  60. package/es/components/divider/src/divider2.mjs +34 -17
  61. package/es/components/divider/src/divider2.mjs.map +1 -1
  62. package/es/components/drawer/index.mjs +2 -2
  63. package/es/components/drawer/src/drawer.mjs +23 -117
  64. package/es/components/drawer/src/drawer.mjs.map +1 -1
  65. package/es/components/drawer/src/drawer2.mjs +117 -23
  66. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  67. package/es/components/dropdown/src/dropdown.mjs +2 -2
  68. package/es/components/empty/index.mjs +2 -2
  69. package/es/components/empty/src/empty.mjs +56 -11
  70. package/es/components/empty/src/empty.mjs.map +1 -1
  71. package/es/components/empty/src/empty2.mjs +11 -56
  72. package/es/components/empty/src/empty2.mjs.map +1 -1
  73. package/es/components/image/index.mjs +2 -2
  74. package/es/components/image/src/image.mjs +46 -170
  75. package/es/components/image/src/image.mjs.map +1 -1
  76. package/es/components/image/src/image2.mjs +170 -46
  77. package/es/components/image/src/image2.mjs.map +1 -1
  78. package/es/components/index.mjs +25 -25
  79. package/es/components/input/index.mjs +2 -2
  80. package/es/components/input/src/input.mjs +85 -296
  81. package/es/components/input/src/input.mjs.map +1 -1
  82. package/es/components/input/src/input2.mjs +296 -85
  83. package/es/components/input/src/input2.mjs.map +1 -1
  84. package/es/components/popconfirm/src/popconfirm2.mjs +2 -2
  85. package/es/components/popover/src/popover.mjs +1 -1
  86. package/es/components/popper/index.mjs +2 -2
  87. package/es/components/popper/src/content.mjs +52 -64
  88. package/es/components/popper/src/content.mjs.map +1 -1
  89. package/es/components/popper/src/content2.mjs +64 -52
  90. package/es/components/popper/src/content2.mjs.map +1 -1
  91. package/es/components/rate/index.mjs +2 -2
  92. package/es/components/rate/src/rate.mjs +169 -84
  93. package/es/components/rate/src/rate.mjs.map +1 -1
  94. package/es/components/rate/src/rate2.mjs +84 -169
  95. package/es/components/rate/src/rate2.mjs.map +1 -1
  96. package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
  97. package/es/components/scrollbar/index.mjs +2 -2
  98. package/es/components/scrollbar/src/scrollbar.mjs +42 -112
  99. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  100. package/es/components/scrollbar/src/scrollbar2.mjs +112 -42
  101. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  102. package/es/components/select/src/select.mjs +1 -1
  103. package/es/components/select-v2/src/defaults.mjs +1 -1
  104. package/es/components/select-v2/src/select.mjs +1 -12
  105. package/es/components/select-v2/src/select.mjs.map +1 -1
  106. package/es/components/select-v2/src/useSelect.mjs +1 -25
  107. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  108. package/es/components/skeleton/index.mjs +2 -2
  109. package/es/components/skeleton/src/skeleton.mjs +49 -22
  110. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  111. package/es/components/skeleton/src/skeleton2.mjs +22 -49
  112. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  113. package/es/components/tabs/index.mjs +3 -3
  114. package/es/components/tabs/src/tab-bar.mjs +7 -76
  115. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  116. package/es/components/tabs/src/tab-bar2.mjs +76 -7
  117. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  118. package/es/components/tabs/src/tab-nav.mjs +1 -1
  119. package/es/components/tabs/src/tab-pane.mjs +60 -14
  120. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  121. package/es/components/tabs/src/tab-pane2.mjs +14 -60
  122. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  123. package/es/components/timeline/index.mjs +2 -2
  124. package/es/components/timeline/src/timeline-item.mjs +73 -39
  125. package/es/components/timeline/src/timeline-item.mjs.map +1 -1
  126. package/es/components/timeline/src/timeline-item2.mjs +39 -73
  127. package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
  128. package/es/components/tooltip/index.mjs +2 -2
  129. package/es/components/tooltip/src/tooltip.mjs +64 -51
  130. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  131. package/es/components/tooltip/src/tooltip2.mjs +51 -64
  132. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  133. package/es/components/tooltip/src/trigger.mjs +1 -1
  134. package/es/components/tooltip-v2/index.mjs +5 -5
  135. package/es/components/tooltip-v2/src/arrow.mjs +38 -22
  136. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  137. package/es/components/tooltip-v2/src/arrow2.mjs +22 -38
  138. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  139. package/es/components/tooltip-v2/src/root.mjs +17 -81
  140. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  141. package/es/components/tooltip-v2/src/root2.mjs +81 -17
  142. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  143. package/es/components/tooltip-v2/src/tooltip.mjs +74 -21
  144. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  145. package/es/components/tooltip-v2/src/tooltip2.mjs +21 -74
  146. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  147. package/es/components/tooltip-v2/src/trigger.mjs +11 -89
  148. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  149. package/es/components/tooltip-v2/src/trigger2.mjs +89 -11
  150. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  151. package/es/components/upload/index.mjs +5 -5
  152. package/es/components/upload/src/upload-content.mjs +15 -46
  153. package/es/components/upload/src/upload-content.mjs.map +1 -1
  154. package/es/components/upload/src/upload-content2.mjs +46 -15
  155. package/es/components/upload/src/upload-content2.mjs.map +1 -1
  156. package/es/components/upload/src/upload-dragger.mjs +11 -32
  157. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  158. package/es/components/upload/src/upload-dragger2.mjs +32 -11
  159. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  160. package/es/components/upload/src/upload-list.mjs +26 -155
  161. package/es/components/upload/src/upload-list.mjs.map +1 -1
  162. package/es/components/upload/src/upload-list2.mjs +155 -26
  163. package/es/components/upload/src/upload-list2.mjs.map +1 -1
  164. package/es/components/upload/src/upload.mjs +106 -99
  165. package/es/components/upload/src/upload.mjs.map +1 -1
  166. package/es/components/upload/src/upload2.mjs +99 -106
  167. package/es/components/upload/src/upload2.mjs.map +1 -1
  168. package/es/index.mjs +25 -25
  169. package/lib/components/alert/index.js +2 -2
  170. package/lib/components/alert/src/alert.js +82 -33
  171. package/lib/components/alert/src/alert.js.map +1 -1
  172. package/lib/components/alert/src/alert2.js +33 -82
  173. package/lib/components/alert/src/alert2.js.map +1 -1
  174. package/lib/components/autocomplete/index.js +2 -2
  175. package/lib/components/autocomplete/src/autocomplete.js +58 -94
  176. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  177. package/lib/components/autocomplete/src/autocomplete2.js +94 -58
  178. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  179. package/lib/components/avatar/index.js +2 -2
  180. package/lib/components/avatar/src/avatar.js +61 -29
  181. package/lib/components/avatar/src/avatar.js.map +1 -1
  182. package/lib/components/avatar/src/avatar2.js +29 -61
  183. package/lib/components/avatar/src/avatar2.js.map +1 -1
  184. package/lib/components/badge/index.js +2 -2
  185. package/lib/components/badge/src/badge.js +17 -54
  186. package/lib/components/badge/src/badge.js.map +1 -1
  187. package/lib/components/badge/src/badge2.js +54 -17
  188. package/lib/components/badge/src/badge2.js.map +1 -1
  189. package/lib/components/button/index.js +2 -2
  190. package/lib/components/button/src/button-group.js +1 -1
  191. package/lib/components/button/src/button.js +96 -50
  192. package/lib/components/button/src/button.js.map +1 -1
  193. package/lib/components/button/src/button2.js +50 -96
  194. package/lib/components/button/src/button2.js.map +1 -1
  195. package/lib/components/card/index.js +2 -2
  196. package/lib/components/card/src/card.js +15 -35
  197. package/lib/components/card/src/card.js.map +1 -1
  198. package/lib/components/card/src/card2.js +35 -15
  199. package/lib/components/card/src/card2.js.map +1 -1
  200. package/lib/components/cascader/src/index.js +1 -1
  201. package/lib/components/cascader-panel/src/config.js +1 -1
  202. package/lib/components/cascader-panel/src/index.js +1 -1
  203. package/lib/components/cascader-panel/src/menu.js +1 -1
  204. package/lib/components/cascader-panel/src/node.js +121 -200
  205. package/lib/components/cascader-panel/src/node.js.map +1 -1
  206. package/lib/components/cascader-panel/src/node2.js +200 -121
  207. package/lib/components/cascader-panel/src/node2.js.map +1 -1
  208. package/lib/components/cascader-panel/src/store.js +1 -1
  209. package/lib/components/collapse/index.js +2 -2
  210. package/lib/components/collapse/src/collapse.js +61 -16
  211. package/lib/components/collapse/src/collapse.js.map +1 -1
  212. package/lib/components/collapse/src/collapse2.js +16 -61
  213. package/lib/components/collapse/src/collapse2.js.map +1 -1
  214. package/lib/components/collection/index.js +1 -1
  215. package/lib/components/collection/src/collection.js +9 -30
  216. package/lib/components/collection/src/collection.js.map +1 -1
  217. package/lib/components/collection/src/collection2.js +30 -9
  218. package/lib/components/collection/src/collection2.js.map +1 -1
  219. package/lib/components/divider/index.js +2 -2
  220. package/lib/components/divider/src/divider.js +17 -34
  221. package/lib/components/divider/src/divider.js.map +1 -1
  222. package/lib/components/divider/src/divider2.js +34 -17
  223. package/lib/components/divider/src/divider2.js.map +1 -1
  224. package/lib/components/drawer/index.js +2 -2
  225. package/lib/components/drawer/src/drawer.js +23 -117
  226. package/lib/components/drawer/src/drawer.js.map +1 -1
  227. package/lib/components/drawer/src/drawer2.js +117 -23
  228. package/lib/components/drawer/src/drawer2.js.map +1 -1
  229. package/lib/components/dropdown/src/dropdown.js +2 -2
  230. package/lib/components/empty/index.js +2 -2
  231. package/lib/components/empty/src/empty.js +56 -11
  232. package/lib/components/empty/src/empty.js.map +1 -1
  233. package/lib/components/empty/src/empty2.js +11 -56
  234. package/lib/components/empty/src/empty2.js.map +1 -1
  235. package/lib/components/image/index.js +2 -2
  236. package/lib/components/image/src/image.js +46 -170
  237. package/lib/components/image/src/image.js.map +1 -1
  238. package/lib/components/image/src/image2.js +170 -46
  239. package/lib/components/image/src/image2.js.map +1 -1
  240. package/lib/components/index.js +25 -25
  241. package/lib/components/input/index.js +2 -2
  242. package/lib/components/input/src/input.js +84 -295
  243. package/lib/components/input/src/input.js.map +1 -1
  244. package/lib/components/input/src/input2.js +295 -84
  245. package/lib/components/input/src/input2.js.map +1 -1
  246. package/lib/components/popconfirm/src/popconfirm2.js +2 -2
  247. package/lib/components/popover/src/popover.js +1 -1
  248. package/lib/components/popper/index.js +2 -2
  249. package/lib/components/popper/src/content.js +52 -65
  250. package/lib/components/popper/src/content.js.map +1 -1
  251. package/lib/components/popper/src/content2.js +65 -52
  252. package/lib/components/popper/src/content2.js.map +1 -1
  253. package/lib/components/rate/index.js +2 -2
  254. package/lib/components/rate/src/rate.js +169 -84
  255. package/lib/components/rate/src/rate.js.map +1 -1
  256. package/lib/components/rate/src/rate2.js +84 -169
  257. package/lib/components/rate/src/rate2.js.map +1 -1
  258. package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
  259. package/lib/components/scrollbar/index.js +2 -2
  260. package/lib/components/scrollbar/src/scrollbar.js +42 -112
  261. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  262. package/lib/components/scrollbar/src/scrollbar2.js +112 -42
  263. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  264. package/lib/components/select/src/select.js +1 -1
  265. package/lib/components/select-v2/src/defaults.js +1 -1
  266. package/lib/components/select-v2/src/select.js +0 -11
  267. package/lib/components/select-v2/src/select.js.map +1 -1
  268. package/lib/components/select-v2/src/useSelect.js +1 -25
  269. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  270. package/lib/components/skeleton/index.js +2 -2
  271. package/lib/components/skeleton/src/skeleton.js +49 -22
  272. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  273. package/lib/components/skeleton/src/skeleton2.js +22 -49
  274. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  275. package/lib/components/tabs/index.js +3 -3
  276. package/lib/components/tabs/src/tab-bar.js +7 -76
  277. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  278. package/lib/components/tabs/src/tab-bar2.js +76 -7
  279. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  280. package/lib/components/tabs/src/tab-nav.js +1 -1
  281. package/lib/components/tabs/src/tab-pane.js +60 -14
  282. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  283. package/lib/components/tabs/src/tab-pane2.js +14 -60
  284. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  285. package/lib/components/timeline/index.js +2 -2
  286. package/lib/components/timeline/src/timeline-item.js +73 -39
  287. package/lib/components/timeline/src/timeline-item.js.map +1 -1
  288. package/lib/components/timeline/src/timeline-item2.js +39 -73
  289. package/lib/components/timeline/src/timeline-item2.js.map +1 -1
  290. package/lib/components/tooltip/index.js +2 -2
  291. package/lib/components/tooltip/src/tooltip.js +65 -50
  292. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  293. package/lib/components/tooltip/src/tooltip2.js +50 -65
  294. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  295. package/lib/components/tooltip/src/trigger.js +1 -1
  296. package/lib/components/tooltip-v2/index.js +5 -5
  297. package/lib/components/tooltip-v2/src/arrow.js +38 -23
  298. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  299. package/lib/components/tooltip-v2/src/arrow2.js +23 -38
  300. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  301. package/lib/components/tooltip-v2/src/root.js +17 -81
  302. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  303. package/lib/components/tooltip-v2/src/root2.js +81 -17
  304. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  305. package/lib/components/tooltip-v2/src/tooltip.js +74 -21
  306. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  307. package/lib/components/tooltip-v2/src/tooltip2.js +21 -74
  308. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  309. package/lib/components/tooltip-v2/src/trigger.js +11 -89
  310. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  311. package/lib/components/tooltip-v2/src/trigger2.js +89 -11
  312. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  313. package/lib/components/upload/index.js +5 -5
  314. package/lib/components/upload/src/upload-content.js +15 -46
  315. package/lib/components/upload/src/upload-content.js.map +1 -1
  316. package/lib/components/upload/src/upload-content2.js +46 -15
  317. package/lib/components/upload/src/upload-content2.js.map +1 -1
  318. package/lib/components/upload/src/upload-dragger.js +12 -32
  319. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  320. package/lib/components/upload/src/upload-dragger2.js +32 -12
  321. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  322. package/lib/components/upload/src/upload-list.js +27 -155
  323. package/lib/components/upload/src/upload-list.js.map +1 -1
  324. package/lib/components/upload/src/upload-list2.js +155 -27
  325. package/lib/components/upload/src/upload-list2.js.map +1 -1
  326. package/lib/components/upload/src/upload.js +109 -99
  327. package/lib/components/upload/src/upload.js.map +1 -1
  328. package/lib/components/upload/src/upload2.js +99 -109
  329. package/lib/components/upload/src/upload2.js.map +1 -1
  330. package/lib/index.js +25 -25
  331. package/package.json +1 -1
  332. package/web-types.json +1 -1
  333. package/es/components/select-v2/src/util.d.ts +0 -2
  334. package/es/components/select-v2/src/util.mjs +0 -26
  335. package/es/components/select-v2/src/util.mjs.map +0 -1
  336. package/lib/components/select-v2/src/util.d.ts +0 -2
  337. package/lib/components/select-v2/src/util.js +0 -30
  338. package/lib/components/select-v2/src/util.js.map +0 -1
@@ -1,92 +1,303 @@
1
+ import { defineComponent, getCurrentInstance, useAttrs, useSlots, shallowRef, ref, computed, onMounted, nextTick, onUpdated, toRef, resolveComponent, withDirectives, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createCommentVNode, Fragment, renderSlot, createElementVNode, createBlock, withCtx, resolveDynamicComponent, mergeProps, createVNode, toDisplayString, vShow } from 'vue';
2
+ import { isClient } from '@vueuse/core';
3
+ import { isNil } from 'lodash-unified';
4
+ import { View, Hide } from '@element-plus/icons-vue';
1
5
  import '../../../utils/index.mjs';
2
6
  import '../../../hooks/index.mjs';
3
- import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
4
- import { useSizeProp } from '../../../hooks/use-common-props/index.mjs';
5
- import { iconPropType } from '../../../utils/vue/icon.mjs';
6
- import { mutable } from '../../../utils/typescript.mjs';
7
+ import { calcTextareaHeight } from './utils.mjs';
8
+ import { inputProps } from './input.mjs';
9
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
10
+ import { useAttrs as useAttrs$1 } from '../../../hooks/use-attrs/index.mjs';
11
+ import { useFormItem } from '../../../hooks/use-form-item/index.mjs';
12
+ import { useSize, useDisabled } from '../../../hooks/use-common-props/index.mjs';
13
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
14
+ import { ValidateComponentsMap } from '../../../utils/vue/icon.mjs';
15
+ import { isObject } from '@vue/shared';
16
+ import { debugWarn } from '../../../utils/error.mjs';
7
17
 
8
- const inputProps = buildProps({
9
- size: useSizeProp,
10
- disabled: Boolean,
11
- modelValue: {
12
- type: definePropType([
13
- String,
14
- Number,
15
- Object
16
- ]),
17
- default: ""
18
- },
19
- type: {
20
- type: String,
21
- default: "text"
22
- },
23
- resize: {
24
- type: String,
25
- values: ["none", "both", "horizontal", "vertical"]
26
- },
27
- autosize: {
28
- type: definePropType([Boolean, Object]),
29
- default: false
30
- },
31
- autocomplete: {
32
- type: String,
33
- default: "off"
34
- },
35
- formatter: {
36
- type: Function
37
- },
38
- parser: {
39
- type: Function
40
- },
41
- placeholder: {
42
- type: String
43
- },
44
- form: {
45
- type: String,
46
- default: ""
47
- },
48
- readonly: {
49
- type: Boolean,
50
- default: false
51
- },
52
- clearable: {
53
- type: Boolean,
54
- default: false
55
- },
56
- showPassword: {
57
- type: Boolean,
58
- default: false
59
- },
60
- showWordLimit: {
61
- type: Boolean,
62
- default: false
63
- },
64
- suffixIcon: {
65
- type: iconPropType,
66
- default: ""
67
- },
68
- prefixIcon: {
69
- type: iconPropType,
70
- default: ""
71
- },
72
- label: {
73
- type: String
74
- },
75
- tabindex: {
76
- type: [Number, String]
77
- },
78
- validateEvent: {
79
- type: Boolean,
80
- default: true
81
- },
82
- inputStyle: {
83
- type: definePropType([Object, Array, String]),
84
- default: () => mutable({})
85
- },
86
- widget: {
87
- type: String
18
+ const _hoisted_1 = ["widget"];
19
+ const _hoisted_2 = ["type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder"];
20
+ const _hoisted_3 = ["tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder"];
21
+ const __default__ = {
22
+ name: "PsInput",
23
+ inheritAttrs: false
24
+ };
25
+ const _sfc_main = /* @__PURE__ */ defineComponent({
26
+ ...__default__,
27
+ props: inputProps,
28
+ setup(__props, { expose }) {
29
+ const props = __props;
30
+ const PENDANT_MAP = {
31
+ suffix: "append",
32
+ prefix: "prepend"
33
+ };
34
+ const instance = getCurrentInstance();
35
+ const rawAttrs = useAttrs();
36
+ const slots = useSlots();
37
+ const attrs = useAttrs$1();
38
+ const { form, formItem } = useFormItem();
39
+ const inputSize = useSize();
40
+ const inputDisabled = useDisabled();
41
+ const nsInput = useNamespace("input");
42
+ const nsTextarea = useNamespace("textarea");
43
+ const input = shallowRef();
44
+ const textarea = shallowRef();
45
+ const focused = ref(false);
46
+ const hovering = ref(false);
47
+ const isComposing = ref(false);
48
+ const passwordVisible = ref(false);
49
+ const textareaCalcStyle = shallowRef(props.inputStyle);
50
+ const _ref = computed(() => input.value || textarea.value);
51
+ const needStatusIcon = computed(() => {
52
+ var _a;
53
+ return (_a = form == null ? void 0 : form.statusIcon) != null ? _a : false;
54
+ });
55
+ const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
56
+ const validateIcon = computed(() => ValidateComponentsMap[validateState.value]);
57
+ const passwordIcon = computed(() => passwordVisible.value ? View : Hide);
58
+ const containerStyle = computed(() => [
59
+ rawAttrs.style,
60
+ props.inputStyle
61
+ ]);
62
+ const textareaStyle = computed(() => [
63
+ props.inputStyle,
64
+ textareaCalcStyle.value,
65
+ { resize: props.resize }
66
+ ]);
67
+ const nativeInputValue = computed(() => isNil(props.modelValue) ? "" : String(props.modelValue));
68
+ const showClear = computed(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (focused.value || hovering.value));
69
+ const showPwdVisible = computed(() => props.showPassword && !inputDisabled.value && !props.readonly && (!!nativeInputValue.value || focused.value));
70
+ const isWordLimitVisible = computed(() => props.showWordLimit && !!attrs.value.maxlength && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
71
+ const textLength = computed(() => Array.from(nativeInputValue.value).length);
72
+ const inputExceed = computed(() => !!isWordLimitVisible.value && textLength.value > Number(attrs.value.maxlength));
73
+ const suffixVisible = computed(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
74
+ const resizeTextarea = () => {
75
+ const { type, autosize } = props;
76
+ if (!isClient || type !== "textarea")
77
+ return;
78
+ if (autosize) {
79
+ const minRows = isObject(autosize) ? autosize.minRows : void 0;
80
+ const maxRows = isObject(autosize) ? autosize.maxRows : void 0;
81
+ textareaCalcStyle.value = {
82
+ ...calcTextareaHeight(textarea.value, minRows, maxRows)
83
+ };
84
+ } else {
85
+ textareaCalcStyle.value = {
86
+ minHeight: calcTextareaHeight(textarea.value).minHeight
87
+ };
88
+ }
89
+ };
90
+ const setNativeInputValue = () => {
91
+ const input2 = _ref.value;
92
+ if (!input2 || input2.value === nativeInputValue.value)
93
+ return;
94
+ input2.value = nativeInputValue.value;
95
+ };
96
+ const calcIconOffset = (place) => {
97
+ const { el } = instance.vnode;
98
+ if (!el)
99
+ return;
100
+ const elList = Array.from(el.querySelectorAll(`.${nsInput.e(place)}`));
101
+ const target = elList.find((item) => item.parentNode === el);
102
+ if (!target)
103
+ return;
104
+ const pendant = PENDANT_MAP[place];
105
+ if (slots[pendant]) {
106
+ target.style.transform = `translateX(${place === "suffix" ? "-" : ""}${el.querySelector(`.${nsInput.be("group", pendant)}`).offsetWidth}px)`;
107
+ } else {
108
+ target.removeAttribute("style");
109
+ }
110
+ };
111
+ const updateIconOffset = () => {
112
+ calcIconOffset("prefix");
113
+ calcIconOffset("suffix");
114
+ };
115
+ onMounted(async () => {
116
+ if (!props.formatter && props.parser) {
117
+ debugWarn("PsInput", "If you set the parser, you also need to set the formatter.");
118
+ }
119
+ setNativeInputValue();
120
+ updateIconOffset();
121
+ await nextTick();
122
+ resizeTextarea();
123
+ });
124
+ onUpdated(async () => {
125
+ await nextTick();
126
+ updateIconOffset();
127
+ });
128
+ expose({
129
+ input,
130
+ textarea,
131
+ ref: _ref,
132
+ textareaStyle,
133
+ autosize: toRef(props, "autosize")
134
+ });
135
+ return (_ctx, _cache) => {
136
+ const _component_ps_icon = resolveComponent("ps-icon");
137
+ const _component_circle_close = resolveComponent("circle-close");
138
+ return withDirectives((openBlock(), createElementBlock("div", {
139
+ class: normalizeClass([
140
+ _ctx.type === "textarea" ? unref(nsTextarea).b() : unref(nsInput).b(),
141
+ unref(nsInput).m(unref(inputSize)),
142
+ unref(nsInput).is("disabled", unref(inputDisabled)),
143
+ unref(nsInput).is("exceed", unref(inputExceed)),
144
+ {
145
+ [unref(nsInput).b("group")]: _ctx.$slots.prepend || _ctx.$slots.append,
146
+ [unref(nsInput).bm("group", "append")]: _ctx.$slots.append,
147
+ [unref(nsInput).bm("group", "prepend")]: _ctx.$slots.prepend,
148
+ [unref(nsInput).m("prefix")]: _ctx.$slots.prefix || _ctx.prefixIcon,
149
+ [unref(nsInput).m("suffix")]: _ctx.$slots.suffix || _ctx.suffixIcon || _ctx.clearable || _ctx.showPassword,
150
+ [unref(nsInput).bm("suffix", "password-clear")]: unref(showClear) && unref(showPwdVisible)
151
+ },
152
+ _ctx.$attrs.class
153
+ ]),
154
+ style: normalizeStyle(unref(containerStyle)),
155
+ widget: _ctx.widget
156
+ }, [
157
+ createCommentVNode(" input "),
158
+ _ctx.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
159
+ createCommentVNode(" prepend slot "),
160
+ _ctx.$slots.prepend ? (openBlock(), createElementBlock("div", {
161
+ key: 0,
162
+ class: normalizeClass(unref(nsInput).be("group", "prepend"))
163
+ }, [
164
+ renderSlot(_ctx.$slots, "prepend")
165
+ ], 2)) : createCommentVNode("v-if", true),
166
+ createElementVNode("div", {
167
+ class: normalizeClass([unref(nsInput).e("wrapper"), unref(nsInput).is("focus", focused.value)])
168
+ }, [
169
+ createCommentVNode(" prefix slot "),
170
+ _ctx.$slots.prefix || _ctx.prefixIcon ? (openBlock(), createElementBlock("span", {
171
+ key: 0,
172
+ class: normalizeClass(unref(nsInput).e("prefix"))
173
+ }, [
174
+ createElementVNode("span", {
175
+ class: normalizeClass(unref(nsInput).e("prefix-inner"))
176
+ }, [
177
+ renderSlot(_ctx.$slots, "prefix"),
178
+ _ctx.prefixIcon ? (openBlock(), createBlock(_component_ps_icon, {
179
+ key: 0,
180
+ class: normalizeClass(unref(nsInput).e("icon"))
181
+ }, {
182
+ default: withCtx(() => [
183
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.prefixIcon)))
184
+ ]),
185
+ _: 1
186
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
187
+ ], 2)
188
+ ], 2)) : createCommentVNode("v-if", true),
189
+ createElementVNode("input", mergeProps({
190
+ ref_key: "input",
191
+ ref: input,
192
+ class: unref(nsInput).e("inner")
193
+ }, unref(attrs), {
194
+ type: _ctx.showPassword ? passwordVisible.value ? "text" : "password" : _ctx.type,
195
+ disabled: unref(inputDisabled),
196
+ formatter: _ctx.formatter,
197
+ parser: _ctx.parser,
198
+ readonly: _ctx.readonly,
199
+ autocomplete: _ctx.autocomplete,
200
+ tabindex: _ctx.tabindex,
201
+ "aria-label": _ctx.label,
202
+ placeholder: _ctx.placeholder,
203
+ style: _ctx.inputStyle
204
+ }), null, 16, _hoisted_2),
205
+ createCommentVNode(" suffix slot "),
206
+ unref(suffixVisible) ? (openBlock(), createElementBlock("span", {
207
+ key: 1,
208
+ class: normalizeClass(unref(nsInput).e("suffix"))
209
+ }, [
210
+ createElementVNode("span", {
211
+ class: normalizeClass(unref(nsInput).e("suffix-inner"))
212
+ }, [
213
+ !unref(showClear) || !unref(showPwdVisible) || !unref(isWordLimitVisible) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
214
+ renderSlot(_ctx.$slots, "suffix"),
215
+ _ctx.suffixIcon ? (openBlock(), createBlock(_component_ps_icon, {
216
+ key: 0,
217
+ class: normalizeClass(unref(nsInput).e("icon"))
218
+ }, {
219
+ default: withCtx(() => [
220
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.suffixIcon)))
221
+ ]),
222
+ _: 1
223
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
224
+ ], 64)) : createCommentVNode("v-if", true),
225
+ unref(showClear) ? (openBlock(), createBlock(_component_ps_icon, {
226
+ key: 1,
227
+ class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")])
228
+ }, {
229
+ default: withCtx(() => [
230
+ createVNode(_component_circle_close)
231
+ ]),
232
+ _: 1
233
+ }, 8, ["class"])) : createCommentVNode("v-if", true),
234
+ unref(showPwdVisible) ? (openBlock(), createBlock(_component_ps_icon, {
235
+ key: 2,
236
+ class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("password")])
237
+ }, {
238
+ default: withCtx(() => [
239
+ (openBlock(), createBlock(resolveDynamicComponent(unref(passwordIcon))))
240
+ ]),
241
+ _: 1
242
+ }, 8, ["class"])) : createCommentVNode("v-if", true),
243
+ unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
244
+ key: 3,
245
+ class: normalizeClass(unref(nsInput).e("count"))
246
+ }, [
247
+ createElementVNode("span", {
248
+ class: normalizeClass(unref(nsInput).e("count-inner"))
249
+ }, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 3)
250
+ ], 2)) : createCommentVNode("v-if", true),
251
+ unref(validateState) && unref(validateIcon) && unref(needStatusIcon) ? (openBlock(), createBlock(_component_ps_icon, {
252
+ key: 4,
253
+ class: normalizeClass([
254
+ unref(nsInput).e("icon"),
255
+ unref(nsInput).e("validateIcon"),
256
+ unref(nsInput).is("loading", unref(validateState) === "validating")
257
+ ])
258
+ }, {
259
+ default: withCtx(() => [
260
+ (openBlock(), createBlock(resolveDynamicComponent(unref(validateIcon))))
261
+ ]),
262
+ _: 1
263
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
264
+ ], 2)
265
+ ], 2)) : createCommentVNode("v-if", true)
266
+ ], 2),
267
+ createCommentVNode(" append slot "),
268
+ _ctx.$slots.append ? (openBlock(), createElementBlock("div", {
269
+ key: 1,
270
+ class: normalizeClass(unref(nsInput).be("group", "append"))
271
+ }, [
272
+ renderSlot(_ctx.$slots, "append")
273
+ ], 2)) : createCommentVNode("v-if", true)
274
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
275
+ createCommentVNode(" textarea "),
276
+ createElementVNode("textarea", mergeProps({
277
+ ref_key: "textarea",
278
+ ref: textarea,
279
+ class: unref(nsTextarea).e("inner")
280
+ }, unref(attrs), {
281
+ tabindex: _ctx.tabindex,
282
+ disabled: unref(inputDisabled),
283
+ readonly: _ctx.readonly,
284
+ autocomplete: _ctx.autocomplete,
285
+ style: unref(textareaStyle),
286
+ "aria-label": _ctx.label,
287
+ placeholder: _ctx.placeholder
288
+ }), null, 16, _hoisted_3),
289
+ unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
290
+ key: 0,
291
+ class: normalizeClass(unref(nsInput).e("count"))
292
+ }, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 3)) : createCommentVNode("v-if", true)
293
+ ], 64))
294
+ ], 14, _hoisted_1)), [
295
+ [vShow, _ctx.type !== "hidden"]
296
+ ]);
297
+ };
88
298
  }
89
299
  });
300
+ var Input = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/input/src/input.vue"]]);
90
301
 
91
- export { inputProps };
302
+ export { Input as default };
92
303
  //# sourceMappingURL=input2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"input2.mjs","sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n mutable,\n} from '@element-ps/utils'\nimport { useSizeProp } from '@element-ps/hooks'\nimport type Input from './input.vue'\nimport type { ExtractPropTypes, StyleValue } from 'vue'\n\nexport type InputAutoSize = { minRows?: number; maxRows?: number } | boolean\n\nexport const inputProps = buildProps({\n size: useSizeProp,\n disabled: Boolean,\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n Object,\n ]),\n default: '',\n },\n type: {\n type: String,\n default: 'text',\n },\n resize: {\n type: String,\n values: ['none', 'both', 'horizontal', 'vertical'],\n },\n autosize: {\n type: definePropType<InputAutoSize>([Boolean, Object]),\n default: false,\n },\n autocomplete: {\n type: String,\n default: 'off',\n },\n formatter: {\n type: Function,\n },\n parser: {\n type: Function,\n },\n placeholder: {\n type: String,\n },\n form: {\n type: String,\n default: '',\n },\n readonly: {\n type: Boolean,\n default: false,\n },\n clearable: {\n type: Boolean,\n default: false,\n },\n showPassword: {\n type: Boolean,\n default: false,\n },\n showWordLimit: {\n type: Boolean,\n default: false,\n },\n suffixIcon: {\n type: iconPropType,\n default: '',\n },\n prefixIcon: {\n type: iconPropType,\n default: '',\n },\n label: {\n type: String,\n },\n tabindex: {\n type: [Number, String],\n },\n validateEvent: {\n type: Boolean,\n default: true,\n },\n inputStyle: {\n type: definePropType<StyleValue>([Object, Array, String]),\n default: () => mutable({} as const),\n },\n widget: {\n type: String,\n },\n} as const)\nexport type InputProps = ExtractPropTypes<typeof inputProps>\n\nexport type InputInstance = InstanceType<typeof Input>\n"],"names":[],"mappings":";;;;;;;AAOY,MAAC,UAAU,GAAG,UAAU,CAAC;AACrC,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC;AACzB,MAAM,MAAM;AACZ,MAAM,MAAM;AACZ,MAAM,MAAM;AACZ,KAAK,CAAC;AACN,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC;AACtD,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,OAAO,EAA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AAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACjD,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"input2.mjs","sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div\n v-show=\"type !== 'hidden'\"\n :class=\"[\n type === 'textarea' ? nsTextarea.b() : nsInput.b(),\n nsInput.m(inputSize),\n nsInput.is('disabled', inputDisabled),\n nsInput.is('exceed', inputExceed),\n {\n [nsInput.b('group')]: $slots.prepend || $slots.append,\n [nsInput.bm('group', 'append')]: $slots.append,\n [nsInput.bm('group', 'prepend')]: $slots.prepend,\n [nsInput.m('prefix')]: $slots.prefix || prefixIcon,\n [nsInput.m('suffix')]:\n $slots.suffix || suffixIcon || clearable || showPassword,\n [nsInput.bm('suffix', 'password-clear')]: showClear && showPwdVisible,\n },\n $attrs.class,\n ]\"\n :style=\"containerStyle\"\n :widget=\"widget\"\n >\n <!-- input -->\n <template v-if=\"type !== 'textarea'\">\n <!-- prepend slot -->\n <div v-if=\"$slots.prepend\" :class=\"nsInput.be('group', 'prepend')\">\n <slot name=\"prepend\" />\n </div>\n\n <div :class=\"[nsInput.e('wrapper'), nsInput.is('focus', focused)]\">\n <!-- prefix slot -->\n <span v-if=\"$slots.prefix || prefixIcon\" :class=\"nsInput.e('prefix')\">\n <span :class=\"nsInput.e('prefix-inner')\">\n <slot name=\"prefix\" />\n <ps-icon v-if=\"prefixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"prefixIcon\" />\n </ps-icon>\n </span>\n </span>\n\n <input\n ref=\"input\"\n :class=\"nsInput.e('inner')\"\n v-bind=\"attrs\"\n :type=\"showPassword ? (passwordVisible ? 'text' : 'password') : type\"\n :disabled=\"inputDisabled\"\n :formatter=\"formatter\"\n :parser=\"parser\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :tabindex=\"tabindex\"\n :aria-label=\"label\"\n :placeholder=\"placeholder\"\n :style=\"inputStyle\"\n />\n\n <!-- suffix slot -->\n <span v-if=\"suffixVisible\" :class=\"nsInput.e('suffix')\">\n <span :class=\"nsInput.e('suffix-inner')\">\n <template\n v-if=\"!showClear || !showPwdVisible || !isWordLimitVisible\"\n >\n <slot name=\"suffix\" />\n <ps-icon v-if=\"suffixIcon\" :class=\"nsInput.e('icon')\">\n <component :is=\"suffixIcon\" />\n </ps-icon>\n </template>\n <ps-icon\n v-if=\"showClear\"\n :class=\"[nsInput.e('icon'), nsInput.e('clear')]\"\n >\n <circle-close />\n </ps-icon>\n <ps-icon\n v-if=\"showPwdVisible\"\n :class=\"[nsInput.e('icon'), nsInput.e('password')]\"\n >\n <component :is=\"passwordIcon\" />\n </ps-icon>\n <span v-if=\"isWordLimitVisible\" :class=\"nsInput.e('count')\">\n <span :class=\"nsInput.e('count-inner')\">\n {{ textLength }} / {{ attrs.maxlength }}\n </span>\n </span>\n <ps-icon\n v-if=\"validateState && validateIcon && needStatusIcon\"\n :class=\"[\n nsInput.e('icon'),\n nsInput.e('validateIcon'),\n nsInput.is('loading', validateState === 'validating'),\n ]\"\n >\n <component :is=\"validateIcon\" />\n </ps-icon>\n </span>\n </span>\n </div>\n\n <!-- append slot -->\n <div v-if=\"$slots.append\" :class=\"nsInput.be('group', 'append')\">\n <slot name=\"append\" />\n </div>\n </template>\n\n <!-- textarea -->\n <template v-else>\n <textarea\n ref=\"textarea\"\n :class=\"nsTextarea.e('inner')\"\n v-bind=\"attrs\"\n :tabindex=\"tabindex\"\n :disabled=\"inputDisabled\"\n :readonly=\"readonly\"\n :autocomplete=\"autocomplete\"\n :style=\"textareaStyle\"\n :aria-label=\"label\"\n :placeholder=\"placeholder\"\n />\n <span v-if=\"isWordLimitVisible\" :class=\"nsInput.e('count')\">\n {{ textLength }} / {{ attrs.maxlength }}\n </span>\n </template>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n getCurrentInstance,\n nextTick,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n toRef,\n useAttrs as useRawAttrs,\n useSlots,\n} from 'vue'\nimport { isClient } from '@vueuse/core'\nimport { isNil } from 'lodash-unified'\nimport {\n Hide as IconHide,\n View as IconView,\n} from '@element-plus/icons-vue'\nimport {\n ValidateComponentsMap,\n debugWarn,\n isObject,\n} from '@element-ps/utils'\nimport {\n useAttrs,\n useDisabled,\n useFormItem,\n useNamespace,\n useSize,\n} from '@element-ps/hooks'\nimport { calcTextareaHeight } from './utils'\nimport { inputProps } from './input'\nimport type { StyleValue } from 'vue'\n\ntype TargetElement = HTMLInputElement | HTMLTextAreaElement\nconst PENDANT_MAP = {\n suffix: 'append',\n prefix: 'prepend',\n} as const\n\ndefineOptions({\n name: 'PsInput',\n inheritAttrs: false,\n})\nconst props = defineProps(inputProps)\n\nconst instance = getCurrentInstance()!\nconst rawAttrs = useRawAttrs()\nconst slots = useSlots()\n\nconst attrs = useAttrs()\nconst { form, formItem } = useFormItem()\nconst inputSize = useSize()\nconst inputDisabled = useDisabled()\nconst nsInput = useNamespace('input')\nconst nsTextarea = useNamespace('textarea')\n\nconst input = shallowRef<HTMLInputElement>()\nconst textarea = shallowRef<HTMLTextAreaElement>()\n\nconst focused = ref(false)\nconst hovering = ref(false)\nconst isComposing = ref(false)\nconst passwordVisible = ref(false)\nconst textareaCalcStyle = shallowRef(props.inputStyle)\n\nconst _ref = computed(() => input.value || textarea.value)\n\nconst needStatusIcon = computed(() => form?.statusIcon ?? false)\nconst validateState = computed(() => formItem?.validateState || '')\nconst validateIcon = computed(() => ValidateComponentsMap[validateState.value])\nconst passwordIcon = computed(() =>\n passwordVisible.value ? IconView : IconHide\n)\nconst containerStyle = computed<StyleValue>(() => [\n rawAttrs.style as StyleValue,\n props.inputStyle,\n])\nconst textareaStyle = computed<StyleValue>(() => [\n props.inputStyle,\n textareaCalcStyle.value,\n { resize: props.resize },\n])\nconst nativeInputValue = computed(() =>\n isNil(props.modelValue) ? '' : String(props.modelValue)\n)\nconst showClear = computed(\n () =>\n props.clearable &&\n !inputDisabled.value &&\n !props.readonly &&\n !!nativeInputValue.value &&\n (focused.value || hovering.value)\n)\nconst showPwdVisible = computed(\n () =>\n props.showPassword &&\n !inputDisabled.value &&\n !props.readonly &&\n (!!nativeInputValue.value || focused.value)\n)\nconst isWordLimitVisible = computed(\n () =>\n props.showWordLimit &&\n !!attrs.value.maxlength &&\n (props.type === 'text' || props.type === 'textarea') &&\n !inputDisabled.value &&\n !props.readonly &&\n !props.showPassword\n)\nconst textLength = computed(() => Array.from(nativeInputValue.value).length)\nconst inputExceed = computed(\n () =>\n // show exceed style if length of initial value greater then maxlength\n !!isWordLimitVisible.value &&\n textLength.value > Number(attrs.value.maxlength)\n)\nconst suffixVisible = computed(\n () =>\n !!slots.suffix ||\n !!props.suffixIcon ||\n showClear.value ||\n props.showPassword ||\n isWordLimitVisible.value ||\n (!!validateState.value && needStatusIcon.value)\n)\n\nconst resizeTextarea = () => {\n const { type, autosize } = props\n\n if (!isClient || type !== 'textarea') return\n\n if (autosize) {\n const minRows = isObject(autosize) ? autosize.minRows : undefined\n const maxRows = isObject(autosize) ? autosize.maxRows : undefined\n textareaCalcStyle.value = {\n ...calcTextareaHeight(textarea.value!, minRows, maxRows),\n }\n } else {\n textareaCalcStyle.value = {\n minHeight: calcTextareaHeight(textarea.value!).minHeight,\n }\n }\n}\n\nconst setNativeInputValue = () => {\n const input = _ref.value\n if (!input || input.value === nativeInputValue.value) return\n input.value = nativeInputValue.value\n}\n\nconst calcIconOffset = (place: 'prefix' | 'suffix') => {\n const { el } = instance.vnode\n if (!el) return\n const elList = Array.from(\n (el as Element).querySelectorAll<HTMLSpanElement>(`.${nsInput.e(place)}`)\n )\n const target = elList.find((item) => item.parentNode === el)\n if (!target) return\n\n const pendant = PENDANT_MAP[place]\n\n if (slots[pendant]) {\n target.style.transform = `translateX(${place === 'suffix' ? '-' : ''}${\n el.querySelector(`.${nsInput.be('group', pendant)}`).offsetWidth\n }px)`\n } else {\n target.removeAttribute('style')\n }\n}\n\nconst updateIconOffset = () => {\n calcIconOffset('prefix')\n calcIconOffset('suffix')\n}\n\nonMounted(async () => {\n if (!props.formatter && props.parser) {\n debugWarn(\n 'PsInput',\n 'If you set the parser, you also need to set the formatter.'\n )\n }\n setNativeInputValue()\n updateIconOffset()\n await nextTick()\n resizeTextarea()\n})\n\nonUpdated(async () => {\n await nextTick()\n updateIconOffset()\n})\n\ndefineExpose({\n /** @description HTML input element */\n input,\n /** @description HTML textarea element */\n textarea,\n /** @description HTML element, input or textarea */\n ref: _ref,\n /** @description style of textarea. */\n textareaStyle,\n\n /** @description from props (used on unit test) */\n autosize: toRef(props, 'autosize'),\n})\n</script>\n"],"names":["useRawAttrs","useAttrs","IconView","IconHide"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiKA,IAAA,MAAA,WAAA,GAAA;AAAA,MACA,MAAA,EAAA,QAAA;AAAA,MACA,MAAA,EAAA,SAAA;AAAA,KACA,CAAA;AAQA,IAAA,MAAA,WAAA,kBAAA,EAAA,CAAA;AACA,IAAA,MAAA,WAAAA,QAAA,EAAA,CAAA;AACA,IAAA,MAAA,QAAA,QAAA,EAAA,CAAA;AAEA,IAAA,MAAA,QAAAC,UAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,IAAA,EAAA,QAAA,EAAA,GAAA,WAAA,EAAA,CAAA;AACA,IAAA,MAAA,YAAA,OAAA,EAAA,CAAA;AACA,IAAA,MAAA,gBAAA,WAAA,EAAA,CAAA;AACA,IAAA,MAAA,OAAA,GAAA,aAAA,OAAA,CAAA,CAAA;AACA,IAAA,MAAA,UAAA,GAAA,aAAA,UAAA,CAAA,CAAA;AAEA,IAAA,MAAA,QAAA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EA,MAAA,MAAA,QAAA,EAAA,CAAA;AAAA,MAEA,gBAAA,EAAA,CAAA;AAAA,KAEA,CAAA,CAAA;AAAA,IAAA,MAEA,CAAA;AAAA,MAEA,KAAA;AAAA,MAGA,QAAA;AAAA,MACA,GAAA,EAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,9 +3,9 @@ import { QuestionFilled } from '@element-plus/icons-vue';
3
3
  import '../../../utils/index.mjs';
4
4
  import '../../tooltip/index.mjs';
5
5
  import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
6
- import { buttonTypes } from '../../button/src/button.mjs';
6
+ import { buttonTypes } from '../../button/src/button2.mjs';
7
7
  import { iconPropType } from '../../../utils/vue/icon.mjs';
8
- import { useTooltipContentProps } from '../../tooltip/src/tooltip2.mjs';
8
+ import { useTooltipContentProps } from '../../tooltip/src/tooltip.mjs';
9
9
 
10
10
  const popconfirmProps = buildProps({
11
11
  title: {
@@ -2,7 +2,7 @@ import '../../../utils/index.mjs';
2
2
  import '../../tooltip/index.mjs';
3
3
  import '../../dropdown/index.mjs';
4
4
  import { buildProps } from '../../../utils/vue/props.mjs';
5
- import { useTooltipTriggerProps, useTooltipContentProps } from '../../tooltip/src/tooltip2.mjs';
5
+ import { useTooltipTriggerProps, useTooltipContentProps } from '../../tooltip/src/tooltip.mjs';
6
6
  import { dropdownProps } from '../../dropdown/src/dropdown.mjs';
7
7
 
8
8
  const usePopoverProps = buildProps({
@@ -2,10 +2,10 @@ import '../../utils/index.mjs';
2
2
  import Popper from './src/popper2.mjs';
3
3
  export { default as PsPopperArrow } from './src/arrow2.mjs';
4
4
  export { default as PsPopperTrigger } from './src/trigger.mjs';
5
- export { default as PsPopperContent } from './src/content2.mjs';
5
+ export { default as PsPopperContent } from './src/content.mjs';
6
6
  export { Effect, usePopperProps } from './src/popper.mjs';
7
7
  export { usePopperTriggerProps } from './src/trigger2.mjs';
8
- export { usePopperContentProps, usePopperCoreConfigProps } from './src/content.mjs';
8
+ export { usePopperContentProps, usePopperCoreConfigProps } from './src/content2.mjs';
9
9
  export { usePopperArrowProps } from './src/arrow.mjs';
10
10
  export { useDeprecateAppendToBody } from './src/deprecation.mjs';
11
11
  import { withInstall } from '../../utils/vue/install.mjs';
@@ -1,69 +1,57 @@
1
- import { placements } from '@popperjs/core';
2
- import '../../../utils/index.mjs';
3
- import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
1
+ import { defineComponent, inject, ref, provide, computed, unref, openBlock, createElementBlock, normalizeStyle, normalizeClass, renderSlot } from 'vue';
2
+ import '../../../hooks/index.mjs';
3
+ import '../../../tokens/index.mjs';
4
+ import { usePopperContentProps } from './content2.mjs';
5
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import { POPPER_INJECTION_KEY, POPPER_CONTENT_INJECTION_KEY } from '../../../tokens/popper.mjs';
7
+ import { useZIndex } from '../../../hooks/use-z-index/index.mjs';
8
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
4
9
 
5
- const POSITIONING_STRATEGIES = ["fixed", "absolute"];
6
- const usePopperCoreConfigProps = buildProps({
7
- boundariesPadding: {
8
- type: Number,
9
- default: 0
10
- },
11
- fallbackPlacements: {
12
- type: definePropType(Array),
13
- default: () => []
14
- },
15
- gpuAcceleration: {
16
- type: Boolean,
17
- default: true
18
- },
19
- offset: {
20
- type: Number,
21
- default: 12
22
- },
23
- placement: {
24
- type: String,
25
- values: placements,
26
- default: "bottom"
27
- },
28
- popperOptions: {
29
- type: definePropType(Object),
30
- default: () => ({})
31
- },
32
- strategy: {
33
- type: String,
34
- values: POSITIONING_STRATEGIES,
35
- default: "absolute"
10
+ const __default__ = {
11
+ name: "PsPopperContent"
12
+ };
13
+ const _sfc_main = /* @__PURE__ */ defineComponent({
14
+ ...__default__,
15
+ props: usePopperContentProps,
16
+ setup(__props, { expose }) {
17
+ const props = __props;
18
+ const { popperInstanceRef } = inject(POPPER_INJECTION_KEY, void 0);
19
+ const { nextZIndex } = useZIndex();
20
+ const ns = useNamespace("popper");
21
+ const popperContentRef = ref();
22
+ const arrowRef = ref();
23
+ const arrowOffset = ref();
24
+ provide(POPPER_CONTENT_INJECTION_KEY, {
25
+ arrowRef,
26
+ arrowOffset
27
+ });
28
+ const contentZIndex = ref(props.zIndex || nextZIndex());
29
+ const contentStyle = computed(() => [{ zIndex: unref(contentZIndex) }, props.popperStyle]);
30
+ const contentClass = computed(() => [
31
+ ns.b(),
32
+ ns.is("pure", props.pure),
33
+ ns.is(props.effect),
34
+ props.popperClass
35
+ ]);
36
+ expose({
37
+ popperContentRef,
38
+ popperInstanceRef,
39
+ contentStyle
40
+ });
41
+ return (_ctx, _cache) => {
42
+ return openBlock(), createElementBlock("div", {
43
+ ref_key: "popperContentRef",
44
+ ref: popperContentRef,
45
+ style: normalizeStyle(unref(contentStyle)),
46
+ class: normalizeClass(unref(contentClass)),
47
+ role: "tooltip"
48
+ }, [
49
+ renderSlot(_ctx.$slots, "default")
50
+ ], 6);
51
+ };
36
52
  }
37
53
  });
38
- const usePopperContentProps = buildProps({
39
- ...usePopperCoreConfigProps,
40
- style: { type: definePropType([String, Array, Object]) },
41
- className: { type: definePropType([String, Array, Object]) },
42
- effect: {
43
- type: String,
44
- default: "dark"
45
- },
46
- visible: Boolean,
47
- enterable: {
48
- type: Boolean,
49
- default: true
50
- },
51
- pure: Boolean,
52
- popperClass: {
53
- type: definePropType([String, Array, Object])
54
- },
55
- popperStyle: {
56
- type: definePropType([String, Array, Object])
57
- },
58
- referenceEl: {
59
- type: definePropType(Object)
60
- },
61
- stopPopperMouseEvent: {
62
- type: Boolean,
63
- default: true
64
- },
65
- zIndex: Number
66
- });
54
+ var content = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/popper/src/content.vue"]]);
67
55
 
68
- export { usePopperContentProps, usePopperCoreConfigProps };
56
+ export { content as default };
69
57
  //# sourceMappingURL=content.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"content.mjs","sources":["../../../../../../packages/components/popper/src/content.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport { buildProps, definePropType } from '@element-ps/utils'\n\nimport type { ExtractPropTypes, StyleValue } from 'vue'\nimport type { Options, Placement } from '@popperjs/core'\n\ntype ClassObjectType = Record<string, boolean>\ntype ClassType = string | ClassObjectType | ClassType[]\n\nconst POSITIONING_STRATEGIES = ['fixed', 'absolute'] as const\nexport const usePopperCoreConfigProps = buildProps({\n boundariesPadding: {\n type: Number,\n default: 0,\n },\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: () => [],\n },\n gpuAcceleration: {\n type: Boolean,\n default: true,\n },\n offset: {\n type: Number,\n default: 12,\n },\n placement: {\n type: String,\n values: placements,\n default: 'bottom',\n },\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}),\n },\n strategy: {\n type: String,\n values: POSITIONING_STRATEGIES,\n default: 'absolute',\n },\n} as const)\n\nexport const usePopperContentProps = buildProps({\n ...usePopperCoreConfigProps,\n style: { type: definePropType<StyleValue>([String, Array, Object]) },\n className: { type: definePropType<ClassType>([String, Array, Object]) },\n effect: {\n type: String,\n default: 'dark',\n },\n visible: Boolean,\n enterable: {\n type: Boolean,\n default: true,\n },\n pure: Boolean,\n popperClass: {\n type: definePropType<ClassType>([String, Array, Object]),\n },\n popperStyle: {\n type: definePropType<StyleValue>([String, Array, Object]),\n },\n referenceEl: {\n type: definePropType<HTMLElement>(Object),\n },\n stopPopperMouseEvent: {\n type: Boolean,\n default: true,\n },\n zIndex: Number,\n} as const)\n\nexport type UsePopperContentProps = ExtractPropTypes<\n typeof usePopperContentProps\n>\n\nexport type UsePopperCoreConfigProps = ExtractP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,EAAE;AAC9D,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,IAAI,EAAE,OAAO;AACf,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACjD,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AACjD,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,oBAAoB,EAAE;AACxB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,MAAM,EAAE,MAAM;AAChB,CAAC;;;;"}
1
+ {"version":3,"file":"content.mjs","sources":["../../../../../../packages/components/popper/src/content.vue"],"sourcesContent":["<template>\n <div\n ref=\"popperContentRef\"\n :style=\"contentStyle\"\n :class=\"contentClass\"\n role=\"tooltip\"\n >\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, provide, ref, unref } from 'vue'\nimport { useNamespace, useZIndex } from '@element-ps/hooks'\nimport {\n POPPER_CONTENT_INJECTION_KEY,\n POPPER_INJECTION_KEY,\n} from '@element-ps/tokens'\nimport { usePopperContentProps } from './content'\n\ndefineOptions({\n name: 'PsPopperContent',\n})\n\nconst props = defineProps(usePopperContentProps)\n\nconst { popperInstanceRef } = inject(\n POPPER_INJECTION_KEY,\n undefined\n)!\nconst { nextZIndex } = useZIndex()\nconst ns = useNamespace('popper')\nconst popperContentRef = ref<HTMLElement>()\nconst arrowRef = ref<HTMLElement>()\nconst arrowOffset = ref<number>()\nprovide(POPPER_CONTENT_INJECTION_KEY, {\n arrowRef,\n arrowOffset,\n})\nconst contentZIndex = ref(props.zIndex || nextZIndex())\n\nconst contentStyle = computed(\n () => [{ zIndex: unref(contentZIndex) }, props.popperStyle] as any\n)\n\nconst contentClass = computed(() => [\n ns.b(),\n ns.is('pure', props.pure),\n ns.is(props.effect),\n props.popperClass,\n])\n\ndefineExpose({\n /**\n * @description popper content element\n */\n popperContentRef,\n /**\n * @description popperjs instance\n */\n popperInstanceRef,\n /**\n * @description content style\n */\n contentStyle,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA0BA,IAAA,MAAA,EAAA,iBAAA,EAAA,GAAA,MACA,CAAA,oBAAA,EACA,KACA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,eAAA,SAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAA,aAAA,QAAA,CAAA,CAAA;AACA,IAAA,MAAA,mBAAA,GAAA,EAAA,CAAA;AACA,IAAA,MAAA,WAAA,GAAA,EAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAA,EAAA,CAAA;AACA,IAAA,OAAA,CAAA,4BAAA,EAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA;AAAA,KACA,CAAA,CAAA;AACA,IAAA,MAAA,aAAA,GAAA,GAAA,CAAA,KAAA,CAAA,MAAA,IAAA,YAAA,CAAA,CAAA;AAEA,IAAA,MAAA,YAAA,GAAA,QAAA,CACA,MAAA,CAAA,EAAA,MAAA,EAAA,KAAA,CAAA,aAAA,CAAA,EAAA,EAAA,KAAA,CAAA,WAAA,CACA,CAAA,CAAA;AAEA,IAAA,MAAA,YAAA,GAAA,SAAA,MAAA;AAAA,MACA,GAAA,CAAA,EAAA;AAAA,MACA,EAAA,CAAA,EAAA,CAAA,MAAA,EAAA,KAAA,CAAA,IAAA,CAAA;AAAA,MACA,EAAA,CAAA,EAAA,CAAA,KAAA,CAAA,MAAA,CAAA;AAAA,MACA,KAAA,CAAA,WAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,MAAA,CAAA;AAAA,MAIA,gBAAA;AAAA,MAIA,iBAAA;AAAA,MAIA,YAAA;AAAA,KACA,CAAA,CAAA;;;;;;;;;;;;;;;;;;"}