element-ps 1.0.8 → 1.0.12

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 (320) hide show
  1. package/dist/index.full.js +109 -102
  2. package/dist/index.full.min.js +2 -2
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +2 -2
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +109 -102
  7. package/es/components/alert/index.d.ts +3 -3
  8. package/es/components/alert/src/alert.d.ts +1 -1
  9. package/es/components/alert/src/alert.vue.d.ts +3 -3
  10. package/es/components/autocomplete/index.d.ts +2 -2
  11. package/es/components/autocomplete/src/index.vue.d.ts +1 -1
  12. package/es/components/avatar/index.d.ts +3 -3
  13. package/es/components/avatar/src/avatar.d.ts +1 -1
  14. package/es/components/avatar/src/avatar.vue.d.ts +3 -3
  15. package/es/components/badge/index.d.ts +3 -3
  16. package/es/components/badge/src/badge.d.ts +1 -1
  17. package/es/components/badge/src/badge.vue.d.ts +3 -3
  18. package/es/components/button/index.d.ts +30 -30
  19. package/es/components/button/src/button-group.d.ts +2 -2
  20. package/es/components/button/src/button-group.vue.d.ts +6 -6
  21. package/es/components/button/src/button.d.ts +3 -3
  22. package/es/components/button/src/button.vue.d.ts +18 -18
  23. package/es/components/cascader/index.d.ts +14 -14
  24. package/es/components/cascader/src/index.vue.d.ts +7 -7
  25. package/es/components/checkbox/index.d.ts +27 -27
  26. package/es/components/checkbox/src/checkbox-button.vue.d.ts +6 -6
  27. package/es/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
  28. package/es/components/checkbox/src/checkbox.vue.d.ts +7 -7
  29. package/es/components/checkbox/src/useCheckbox.d.ts +4 -4
  30. package/es/components/collapse/index.d.ts +4 -4
  31. package/es/components/collapse/src/collapse-item.vue.d.ts +2 -2
  32. package/es/components/date-picker/index.d.ts +4 -4
  33. package/es/components/date-picker/src/date-picker.d.ts +2 -2
  34. package/es/components/descriptions/index.d.ts +4 -4
  35. package/es/components/descriptions/src/description-item.d.ts +2 -2
  36. package/es/components/drawer/index.d.ts +4 -4
  37. package/es/components/drawer/src/index.vue.d.ts +2 -2
  38. package/es/components/dropdown/index.d.ts +6 -6
  39. package/es/components/dropdown/src/dropdown-item.vue.d.ts +1 -1
  40. package/es/components/dropdown/src/dropdown.vue.d.ts +4 -4
  41. package/es/components/form/index.d.ts +5 -5
  42. package/es/components/form/src/form-item.vue.d.ts +1 -1
  43. package/es/components/form/src/form.vue.d.ts +3 -3
  44. package/es/components/input/index.d.ts +3 -3
  45. package/es/components/input/src/input.d.ts +1 -1
  46. package/es/components/input/src/input.vue.d.ts +3 -3
  47. package/es/components/input-number/index.d.ts +3 -3
  48. package/es/components/input-number/src/input-number.d.ts +1 -1
  49. package/es/components/input-number/src/input-number.vue.d.ts +3 -3
  50. package/es/components/link/index.d.ts +7 -7
  51. package/es/components/link/src/link.d.ts +1 -1
  52. package/es/components/link/src/link.vue.d.ts +7 -7
  53. package/es/components/page-header/index.d.ts +2 -2
  54. package/es/components/page-header/src/page-header.vue.d.ts +2 -2
  55. package/es/components/pagination/index.d.ts +2 -2
  56. package/es/components/pagination/src/pagination.d.ts +2 -2
  57. package/es/components/popconfirm/index.d.ts +6 -6
  58. package/es/components/popconfirm/src/index.vue.d.ts +6 -6
  59. package/es/components/popconfirm/src/popconfirm.d.ts +2 -2
  60. package/es/components/popover/index.d.ts +8 -8
  61. package/es/components/popover/src/index.vue.d.ts +4 -4
  62. package/es/components/popper/index.d.ts +4 -4
  63. package/es/components/popper/src/index.vue.d.ts +2 -2
  64. package/es/components/radio/index.d.ts +16 -16
  65. package/es/components/radio/src/radio-button.vue.d.ts +3 -3
  66. package/es/components/radio/src/radio-group.vue.d.ts +3 -3
  67. package/es/components/radio/src/radio.vue.d.ts +4 -4
  68. package/es/components/rate/index.d.ts +10 -10
  69. package/es/components/rate/src/index.vue.d.ts +5 -5
  70. package/es/components/scrollbar/index.d.ts +4 -4
  71. package/es/components/scrollbar/src/index.vue.d.ts +2 -2
  72. package/es/components/select/index.d.ts +12 -12
  73. package/es/components/select/src/option.vue.d.ts +2 -2
  74. package/es/components/select/src/select.vue.d.ts +8 -8
  75. package/es/components/select-v2/index.d.ts +10 -10
  76. package/es/components/select-v2/src/select.vue.d.ts +5 -5
  77. package/es/components/slider/index.d.ts +4 -4
  78. package/es/components/slider/src/index.vue.d.ts +2 -2
  79. package/es/components/space/index.d.ts +3 -3
  80. package/es/components/space/src/space.d.ts +4 -4
  81. package/es/components/steps/index.d.ts +1 -1
  82. package/es/components/steps/src/index.vue.d.ts +1 -1
  83. package/es/components/table/index.d.ts +9 -9
  84. package/es/components/table/src/table/defaults.d.ts +4 -4
  85. package/es/components/table/src/table-column/defaults.d.ts +2 -2
  86. package/es/components/table/src/table-column/index.d.ts +2 -2
  87. package/es/components/table/src/table.vue.d.ts +5 -5
  88. package/es/components/tabs/index.d.ts +4 -4
  89. package/es/components/tabs/src/tab-pane.vue.d.ts +2 -2
  90. package/es/components/tag/index.d.ts +6 -6
  91. package/es/components/tag/src/tag.d.ts +2 -2
  92. package/es/components/tag/src/tag.vue.d.ts +6 -6
  93. package/es/components/time-picker/index.d.ts +4 -4
  94. package/es/components/time-picker/src/common/picker.vue.d.ts +2 -2
  95. package/es/components/time-picker/src/time-picker.d.ts +2 -2
  96. package/es/components/time-select/index.d.ts +8 -8
  97. package/es/components/time-select/src/time-select.vue.d.ts +4 -4
  98. package/es/components/timeline/index.d.ts +4 -4
  99. package/es/components/timeline/src/item.vue.d.ts +2 -2
  100. package/es/components/tooltip/index.d.ts +6 -6
  101. package/es/components/tooltip/src/index.vue.d.ts +3 -3
  102. package/es/components/tree-v2/index.d.ts +1 -1
  103. package/es/components/tree-v2/src/tree-node.vue.d.ts +2 -2
  104. package/es/components/tree-v2/src/tree.vue.d.ts +1 -1
  105. package/es/components/upload/index.d.ts +4 -4
  106. package/es/components/upload/src/index.vue.d.ts +2 -2
  107. package/es/components/upload/src/upload.vue.d.ts +2 -2
  108. package/es/hooks/use-form-item/index.d.ts +1 -1
  109. package/es/index.mjs +6 -6
  110. package/es/packages/components/avatar/index.mjs +2 -2
  111. package/es/packages/components/avatar/src/avatar.mjs +29 -5
  112. package/es/packages/components/avatar/src/avatar.mjs.map +1 -1
  113. package/es/packages/components/avatar/src/avatar.vue_vue&type=script&lang.mjs +1 -1
  114. package/es/packages/components/avatar/src/avatar2.mjs +5 -29
  115. package/es/packages/components/avatar/src/avatar2.mjs.map +1 -1
  116. package/es/packages/components/badge/index.mjs +2 -2
  117. package/es/packages/components/badge/src/badge.mjs +5 -20
  118. package/es/packages/components/badge/src/badge.mjs.map +1 -1
  119. package/es/packages/components/badge/src/badge.vue_vue&type=script&lang.mjs +1 -1
  120. package/es/packages/components/badge/src/badge2.mjs +20 -5
  121. package/es/packages/components/badge/src/badge2.mjs.map +1 -1
  122. package/es/packages/components/breadcrumb/index.mjs +2 -2
  123. package/es/packages/components/breadcrumb/src/breadcrumb-item.mjs +5 -13
  124. package/es/packages/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  125. package/es/packages/components/breadcrumb/src/breadcrumb-item.vue_vue&type=script&lang.mjs +1 -1
  126. package/es/packages/components/breadcrumb/src/breadcrumb-item2.mjs +13 -5
  127. package/es/packages/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  128. package/es/packages/components/card/index.mjs +2 -2
  129. package/es/packages/components/card/src/card.mjs +17 -5
  130. package/es/packages/components/card/src/card.mjs.map +1 -1
  131. package/es/packages/components/card/src/card.vue_vue&type=script&lang.mjs +1 -1
  132. package/es/packages/components/card/src/card2.mjs +5 -17
  133. package/es/packages/components/card/src/card2.mjs.map +1 -1
  134. package/es/packages/components/dialog/src/dialog.vue_vue&type=script&lang.mjs.map +1 -1
  135. package/es/packages/components/dialog/src/dialog.vue_vue&type=template&id=02672805&lang.mjs +6 -5
  136. package/es/packages/components/dialog/src/dialog.vue_vue&type=template&id=02672805&lang.mjs.map +1 -1
  137. package/es/packages/components/dialog/src/use-dialog.mjs +1 -1
  138. package/es/packages/components/dialog/src/use-dialog.mjs.map +1 -1
  139. package/es/packages/components/drawer/src/index.vue_vue&type=script&lang.mjs.map +1 -1
  140. package/es/packages/components/drawer/src/index.vue_vue&type=template&id=052d0d8e&lang.mjs +50 -46
  141. package/es/packages/components/drawer/src/index.vue_vue&type=template&id=052d0d8e&lang.mjs.map +1 -1
  142. package/es/packages/components/empty/index.mjs +2 -2
  143. package/es/packages/components/empty/src/empty.mjs +12 -5
  144. package/es/packages/components/empty/src/empty.mjs.map +1 -1
  145. package/es/packages/components/empty/src/empty.vue_vue&type=script&lang.mjs +1 -1
  146. package/es/packages/components/empty/src/empty2.mjs +5 -12
  147. package/es/packages/components/empty/src/empty2.mjs.map +1 -1
  148. package/es/packages/components/form/src/form-item.vue_vue&type=script&lang.mjs.map +1 -1
  149. package/es/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.mjs +10 -8
  150. package/es/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.mjs.map +1 -1
  151. package/es/packages/components/image/index.mjs +2 -2
  152. package/es/packages/components/image/src/image.mjs +5 -44
  153. package/es/packages/components/image/src/image.mjs.map +1 -1
  154. package/es/packages/components/image/src/image.vue_vue&type=script&lang.mjs +1 -1
  155. package/es/packages/components/image/src/image2.mjs +44 -5
  156. package/es/packages/components/image/src/image2.mjs.map +1 -1
  157. package/es/packages/components/index.mjs +6 -6
  158. package/es/packages/components/table/src/table-body/render-helper.mjs +1 -1
  159. package/es/packages/components/table/src/table-body/render-helper.mjs.map +1 -1
  160. package/es/packages/components/table/src/table-header/index.mjs +1 -1
  161. package/es/packages/components/table/src/table-header/index.mjs.map +1 -1
  162. package/es/utils/util.d.ts +1 -1
  163. package/lib/components/alert/index.d.ts +3 -3
  164. package/lib/components/alert/src/alert.d.ts +1 -1
  165. package/lib/components/alert/src/alert.vue.d.ts +3 -3
  166. package/lib/components/autocomplete/index.d.ts +2 -2
  167. package/lib/components/autocomplete/src/index.vue.d.ts +1 -1
  168. package/lib/components/avatar/index.d.ts +3 -3
  169. package/lib/components/avatar/src/avatar.d.ts +1 -1
  170. package/lib/components/avatar/src/avatar.vue.d.ts +3 -3
  171. package/lib/components/badge/index.d.ts +3 -3
  172. package/lib/components/badge/src/badge.d.ts +1 -1
  173. package/lib/components/badge/src/badge.vue.d.ts +3 -3
  174. package/lib/components/button/index.d.ts +30 -30
  175. package/lib/components/button/src/button-group.d.ts +2 -2
  176. package/lib/components/button/src/button-group.vue.d.ts +6 -6
  177. package/lib/components/button/src/button.d.ts +3 -3
  178. package/lib/components/button/src/button.vue.d.ts +18 -18
  179. package/lib/components/cascader/index.d.ts +14 -14
  180. package/lib/components/cascader/src/index.vue.d.ts +7 -7
  181. package/lib/components/checkbox/index.d.ts +27 -27
  182. package/lib/components/checkbox/src/checkbox-button.vue.d.ts +6 -6
  183. package/lib/components/checkbox/src/checkbox-group.vue.d.ts +4 -4
  184. package/lib/components/checkbox/src/checkbox.vue.d.ts +7 -7
  185. package/lib/components/checkbox/src/useCheckbox.d.ts +4 -4
  186. package/lib/components/collapse/index.d.ts +4 -4
  187. package/lib/components/collapse/src/collapse-item.vue.d.ts +2 -2
  188. package/lib/components/date-picker/index.d.ts +4 -4
  189. package/lib/components/date-picker/src/date-picker.d.ts +2 -2
  190. package/lib/components/descriptions/index.d.ts +4 -4
  191. package/lib/components/descriptions/src/description-item.d.ts +2 -2
  192. package/lib/components/drawer/index.d.ts +4 -4
  193. package/lib/components/drawer/src/index.vue.d.ts +2 -2
  194. package/lib/components/dropdown/index.d.ts +6 -6
  195. package/lib/components/dropdown/src/dropdown-item.vue.d.ts +1 -1
  196. package/lib/components/dropdown/src/dropdown.vue.d.ts +4 -4
  197. package/lib/components/form/index.d.ts +5 -5
  198. package/lib/components/form/src/form-item.vue.d.ts +1 -1
  199. package/lib/components/form/src/form.vue.d.ts +3 -3
  200. package/lib/components/input/index.d.ts +3 -3
  201. package/lib/components/input/src/input.d.ts +1 -1
  202. package/lib/components/input/src/input.vue.d.ts +3 -3
  203. package/lib/components/input-number/index.d.ts +3 -3
  204. package/lib/components/input-number/src/input-number.d.ts +1 -1
  205. package/lib/components/input-number/src/input-number.vue.d.ts +3 -3
  206. package/lib/components/link/index.d.ts +7 -7
  207. package/lib/components/link/src/link.d.ts +1 -1
  208. package/lib/components/link/src/link.vue.d.ts +7 -7
  209. package/lib/components/page-header/index.d.ts +2 -2
  210. package/lib/components/page-header/src/page-header.vue.d.ts +2 -2
  211. package/lib/components/pagination/index.d.ts +2 -2
  212. package/lib/components/pagination/src/pagination.d.ts +2 -2
  213. package/lib/components/popconfirm/index.d.ts +6 -6
  214. package/lib/components/popconfirm/src/index.vue.d.ts +6 -6
  215. package/lib/components/popconfirm/src/popconfirm.d.ts +2 -2
  216. package/lib/components/popover/index.d.ts +8 -8
  217. package/lib/components/popover/src/index.vue.d.ts +4 -4
  218. package/lib/components/popper/index.d.ts +4 -4
  219. package/lib/components/popper/src/index.vue.d.ts +2 -2
  220. package/lib/components/radio/index.d.ts +16 -16
  221. package/lib/components/radio/src/radio-button.vue.d.ts +3 -3
  222. package/lib/components/radio/src/radio-group.vue.d.ts +3 -3
  223. package/lib/components/radio/src/radio.vue.d.ts +4 -4
  224. package/lib/components/rate/index.d.ts +10 -10
  225. package/lib/components/rate/src/index.vue.d.ts +5 -5
  226. package/lib/components/scrollbar/index.d.ts +4 -4
  227. package/lib/components/scrollbar/src/index.vue.d.ts +2 -2
  228. package/lib/components/select/index.d.ts +12 -12
  229. package/lib/components/select/src/option.vue.d.ts +2 -2
  230. package/lib/components/select/src/select.vue.d.ts +8 -8
  231. package/lib/components/select-v2/index.d.ts +10 -10
  232. package/lib/components/select-v2/src/select.vue.d.ts +5 -5
  233. package/lib/components/slider/index.d.ts +4 -4
  234. package/lib/components/slider/src/index.vue.d.ts +2 -2
  235. package/lib/components/space/index.d.ts +3 -3
  236. package/lib/components/space/src/space.d.ts +4 -4
  237. package/lib/components/steps/index.d.ts +1 -1
  238. package/lib/components/steps/src/index.vue.d.ts +1 -1
  239. package/lib/components/table/index.d.ts +9 -9
  240. package/lib/components/table/src/table/defaults.d.ts +4 -4
  241. package/lib/components/table/src/table-column/defaults.d.ts +2 -2
  242. package/lib/components/table/src/table-column/index.d.ts +2 -2
  243. package/lib/components/table/src/table.vue.d.ts +5 -5
  244. package/lib/components/tabs/index.d.ts +4 -4
  245. package/lib/components/tabs/src/tab-pane.vue.d.ts +2 -2
  246. package/lib/components/tag/index.d.ts +6 -6
  247. package/lib/components/tag/src/tag.d.ts +2 -2
  248. package/lib/components/tag/src/tag.vue.d.ts +6 -6
  249. package/lib/components/time-picker/index.d.ts +4 -4
  250. package/lib/components/time-picker/src/common/picker.vue.d.ts +2 -2
  251. package/lib/components/time-picker/src/time-picker.d.ts +2 -2
  252. package/lib/components/time-select/index.d.ts +8 -8
  253. package/lib/components/time-select/src/time-select.vue.d.ts +4 -4
  254. package/lib/components/timeline/index.d.ts +4 -4
  255. package/lib/components/timeline/src/item.vue.d.ts +2 -2
  256. package/lib/components/tooltip/index.d.ts +6 -6
  257. package/lib/components/tooltip/src/index.vue.d.ts +3 -3
  258. package/lib/components/tree-v2/index.d.ts +1 -1
  259. package/lib/components/tree-v2/src/tree-node.vue.d.ts +2 -2
  260. package/lib/components/tree-v2/src/tree.vue.d.ts +1 -1
  261. package/lib/components/upload/index.d.ts +4 -4
  262. package/lib/components/upload/src/index.vue.d.ts +2 -2
  263. package/lib/components/upload/src/upload.vue.d.ts +2 -2
  264. package/lib/hooks/use-form-item/index.d.ts +1 -1
  265. package/lib/index.js +6 -6
  266. package/lib/packages/components/avatar/index.js +2 -2
  267. package/lib/packages/components/avatar/src/avatar.js +28 -5
  268. package/lib/packages/components/avatar/src/avatar.js.map +1 -1
  269. package/lib/packages/components/avatar/src/avatar.vue_vue&type=script&lang.js +1 -1
  270. package/lib/packages/components/avatar/src/avatar2.js +5 -28
  271. package/lib/packages/components/avatar/src/avatar2.js.map +1 -1
  272. package/lib/packages/components/badge/index.js +2 -2
  273. package/lib/packages/components/badge/src/badge.js +5 -19
  274. package/lib/packages/components/badge/src/badge.js.map +1 -1
  275. package/lib/packages/components/badge/src/badge.vue_vue&type=script&lang.js +1 -1
  276. package/lib/packages/components/badge/src/badge2.js +19 -5
  277. package/lib/packages/components/badge/src/badge2.js.map +1 -1
  278. package/lib/packages/components/breadcrumb/index.js +2 -2
  279. package/lib/packages/components/breadcrumb/src/breadcrumb-item.js +5 -12
  280. package/lib/packages/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  281. package/lib/packages/components/breadcrumb/src/breadcrumb-item.vue_vue&type=script&lang.js +1 -1
  282. package/lib/packages/components/breadcrumb/src/breadcrumb-item2.js +12 -5
  283. package/lib/packages/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  284. package/lib/packages/components/card/index.js +2 -2
  285. package/lib/packages/components/card/src/card.js +16 -5
  286. package/lib/packages/components/card/src/card.js.map +1 -1
  287. package/lib/packages/components/card/src/card.vue_vue&type=script&lang.js +1 -1
  288. package/lib/packages/components/card/src/card2.js +5 -16
  289. package/lib/packages/components/card/src/card2.js.map +1 -1
  290. package/lib/packages/components/dialog/src/dialog.vue_vue&type=script&lang.js.map +1 -1
  291. package/lib/packages/components/dialog/src/dialog.vue_vue&type=template&id=02672805&lang.js +6 -5
  292. package/lib/packages/components/dialog/src/dialog.vue_vue&type=template&id=02672805&lang.js.map +1 -1
  293. package/lib/packages/components/dialog/src/use-dialog.js +1 -1
  294. package/lib/packages/components/dialog/src/use-dialog.js.map +1 -1
  295. package/lib/packages/components/drawer/src/index.vue_vue&type=script&lang.js.map +1 -1
  296. package/lib/packages/components/drawer/src/index.vue_vue&type=template&id=052d0d8e&lang.js +50 -46
  297. package/lib/packages/components/drawer/src/index.vue_vue&type=template&id=052d0d8e&lang.js.map +1 -1
  298. package/lib/packages/components/empty/index.js +2 -2
  299. package/lib/packages/components/empty/src/empty.js +12 -6
  300. package/lib/packages/components/empty/src/empty.js.map +1 -1
  301. package/lib/packages/components/empty/src/empty.vue_vue&type=script&lang.js +1 -1
  302. package/lib/packages/components/empty/src/empty2.js +6 -12
  303. package/lib/packages/components/empty/src/empty2.js.map +1 -1
  304. package/lib/packages/components/form/src/form-item.vue_vue&type=script&lang.js.map +1 -1
  305. package/lib/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.js +10 -8
  306. package/lib/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.js.map +1 -1
  307. package/lib/packages/components/image/index.js +2 -2
  308. package/lib/packages/components/image/src/image.js +5 -44
  309. package/lib/packages/components/image/src/image.js.map +1 -1
  310. package/lib/packages/components/image/src/image.vue_vue&type=script&lang.js +1 -1
  311. package/lib/packages/components/image/src/image2.js +44 -5
  312. package/lib/packages/components/image/src/image2.js.map +1 -1
  313. package/lib/packages/components/index.js +6 -6
  314. package/lib/packages/components/table/src/table-body/render-helper.js +1 -1
  315. package/lib/packages/components/table/src/table-body/render-helper.js.map +1 -1
  316. package/lib/packages/components/table/src/table-header/index.js +1 -1
  317. package/lib/packages/components/table/src/table-header/index.js.map +1 -1
  318. package/lib/utils/util.d.ts +1 -1
  319. package/package.json +1 -1
  320. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"form-item.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\">\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"widget\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\" :widget=\"widget\">\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":["defineComponent","LabelWrap","isValidComponentSize","useGlobalConfig","inject","elFormKey","ref","getCurrentInstance","computed","addUnit","getPropByPath","reactive","toRefs","elFormItemKey"],"mappings":";;;;;;;;;;;AA8DA,aAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,eAAe;AAAA,EACf,YAAY;AAAA,eACVC;AAAA;AAAA,EAEF,OAAO;AAAA,IACL,OAAO;AAAA,IACP,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,MAAM;AAAA,IACN,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,OAAO,CAAC,QAAQ;AAAA,IAChB,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,KAAK;AAAA,IACL,eAAe;AAAA,MACb,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,WAAWC;AAAA;AAAA,IAEb,QAAQ;AAAA,MACN,MAAM;AAAA;AAAA;AAAA,EAGV,MAAM,OAAO,EAAE,SAAS;AACtB,UAAM,WAAWC;AAEjB,UAAM,SAASC,WAAOC,gBAAW;AACjC,UAAM,gBAAgBC,QAAI;AAC1B,UAAM,kB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AAc,UAAU,WACxB,MAAM,eACN,OAAO;AAAA;AAIX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"form-item.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\"\n :widget=\"widget\"\n >\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"`form-item:label:${widget.split(':')[1]}`\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\"\n :widget=\"`form-item:default:${widget.split(':')[1]}`\"\n >\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":["defineComponent","LabelWrap","isValidComponentSize","useGlobalConfig","inject","elFormKey","ref","getCurrentInstance","computed","addUnit","getPropByPath","reactive","toRefs","elFormItemKey"],"mappings":";;;;;;;;;;;AAkEA,aAAeA,oBAAgB;AAAA,EAC7B,M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BAAkB,IAAI,OAAO;AAAA;AAG7D,UAAM,2BAA2B,CAAC,UAA2B;AAC3D,yBAAmB,QAAQ,QAAQ,GAAG,YAAY;AAAA;AAGpD,UAAM,aAAaC,aAAS;AAAA,SACvBC,WAAO;AAAA,MACV,MAAM;AAAA,MACN,KAAK;AAAA,MACL;AAAA;AAGF,kBAAU,MAAM;AACd,UAAI,MAAM,MAAM;AACd,cAAM,QAAQ,WAAW;AACzB,uBAAgB,MAAM,QAAQ,SAAS,CAAC,GAAG,SAAS;AAAA;AAAA;AAIxD,gBAAQC,oBAAe;AAEvB,UAAM,gBAAgBL,aAAS,MAAM;AAAA,MACnC;AAAA,QACE,0BAA0B,OAAO;AAAA,QACjC,YAAY,cAAc,UAAU;AAAA,QACpC,iBAAiB,cAAc,UAAU;AAAA,QACzC,cAAc,cAAc,UAAU;AAAA,QACtC,eAAe,WAAW,SAAS,MAAM;AAAA,QACzC,kBAAkB,OAAO;AAAA;AAAA,MAE3B,UAAU,QAAQ,iBAAiB,UAAU,UAAU;AAAA;AAGzD,UAAM,kBAAkBA,aAAS,MAAM;AACrC,aACE,cAAc,UAAU,WACxB,MAAM,eACN,OAAO;AAAA;AAIX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;"}
@@ -4,13 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
 
7
- const _hoisted_1 = ["for", "widget"];
8
- const _hoisted_2 = ["widget"];
7
+ const _hoisted_1 = ["widget"];
8
+ const _hoisted_2 = ["for", "widget"];
9
+ const _hoisted_3 = ["widget"];
9
10
  function render(_ctx, _cache, $props, $setup, $data, $options) {
10
11
  const _component_LabelWrap = vue.resolveComponent("LabelWrap");
11
12
  return vue.openBlock(), vue.createElementBlock("div", {
12
13
  ref: "formItemRef",
13
- class: vue.normalizeClass(["el-form-item", _ctx.formItemClass])
14
+ class: vue.normalizeClass(["el-form-item", _ctx.formItemClass]),
15
+ widget: _ctx.widget
14
16
  }, [
15
17
  vue.createVNode(_component_LabelWrap, {
16
18
  "is-auto-width": _ctx.labelStyle.width === "auto",
@@ -22,21 +24,21 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
22
24
  for: _ctx.labelFor,
23
25
  class: "el-form-item__label",
24
26
  style: vue.normalizeStyle(_ctx.labelStyle),
25
- widget: _ctx.widget
27
+ widget: `form-item:label:${_ctx.widget.split(":")[1]}`
26
28
  }, [
27
29
  vue.renderSlot(_ctx.$slots, "label", {
28
30
  label: _ctx.label + _ctx.elForm.labelSuffix
29
31
  }, () => [
30
32
  vue.createTextVNode(vue.toDisplayString(_ctx.label + _ctx.elForm.labelSuffix), 1)
31
33
  ])
32
- ], 12, _hoisted_1)) : vue.createCommentVNode("v-if", true)
34
+ ], 12, _hoisted_2)) : vue.createCommentVNode("v-if", true)
33
35
  ]),
34
36
  _: 3
35
37
  }, 8, ["is-auto-width", "update-all"]),
36
38
  vue.createElementVNode("div", {
37
39
  class: "el-form-item__content",
38
40
  style: vue.normalizeStyle(_ctx.contentStyle),
39
- widget: _ctx.widget
41
+ widget: `form-item:default:${_ctx.widget.split(":")[1]}`
40
42
  }, [
41
43
  vue.renderSlot(_ctx.$slots, "default"),
42
44
  vue.createVNode(vue.Transition, { name: "el-zoom-in-top" }, {
@@ -54,8 +56,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
54
56
  ]),
55
57
  _: 3
56
58
  })
57
- ], 12, _hoisted_2)
58
- ], 2);
59
+ ], 12, _hoisted_3)
60
+ ], 10, _hoisted_1);
59
61
  }
60
62
 
61
63
  exports.render = render;
@@ -1 +1 @@
1
- {"version":3,"file":"form-item.vue_vue&type=template&id=24eda48b&lang.js","sources":["../../../../../../../packages/components/form/src/form-item.vue?vue&type=template&id=24eda48b&lang.js"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\">\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"widget\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\" :widget=\"widget\">\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createVNode","_renderSlot","_createElementVNode"],"mappings":";;;;;;;;;;0BACEA;IAAK,KAAI;AAAA,IAAc,2BAAM,gBAAuB;;IAClDC;MACG,iBAAe,gBAAW;MAC1B,cAAY,YAAO;;2BAEpB;QACQ,cAAS,YAAO,0BADxBD;;UAEG,KAAK;UACN,OAAM;AAAA,UACL,0BAAO;UACP,QAAQ;;UAETE;YAAoB,OAAO,aAAQ,YAAO;AAAA,aAA1C;oDACK,aAAQ,YAAO;;;;;;IAIxBC;MAAK,OAAM;AAAA,MAAyB,0BAAO;MAAe,QAAQ;;MAChED;MACAD,kCAAY,MAAK;6BACf;UAAY,uBAAZC;;YAA2C,OAAO;aAAlD;YACEC;cACE,2BAAM;;;mCAQH;;;;;;;;;;;"}
1
+ {"version":3,"file":"form-item.vue_vue&type=template&id=24eda48b&lang.js","sources":["../../../../../../../packages/components/form/src/form-item.vue?vue&type=template&id=24eda48b&lang.js"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\"\n :widget=\"widget\"\n >\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"`form-item:label:${widget.split(':')[1]}`\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\"\n :widget=\"`form-item:default:${widget.split(':')[1]}`\"\n >\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createVNode","_renderSlot","_createElementVNode"],"mappings":";;;;;;;;;;;0BACEA;IAAK,KAAI;AAAA,IAAc,2BAAM,gBAAuB;IAC9C,QAAQ;;IAEZC;MACG,iBAAe,gBAAW;MAC1B,cAAY,YAAO;;2BAEpB;QACQ,cAAS,YAAO,0BADxBD;;UAEG,KAAK;UACN,OAAM;AAAA,UACL,0BAAO;UACP,2BAA2B,YAAO;;UAEnCE;YAAoB,OAAO,aAAQ,YAAO;AAAA,aAA1C;oDACK,aAAQ,YAAO;;;;;;IAIxBC;MAAK,OAAM;AAAA,MAAyB,0BAAO;MACrC,6BAA6B,YAAO;;MAExCD;MACAD,kCAAY,MAAK;6BACf;UAAY,uBAAZC;;YAA2C,OAAO;aAAlD;YACEC;cACE,2BAAM;;;mCAQH;;;;;;;;;;;"}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var withInstall = require('../../utils/with-install.js');
6
- require('./src/image2.js');
7
- var image = require('./src/image.js');
6
+ require('./src/image.js');
7
+ var image = require('./src/image2.js');
8
8
  var image_vue_vue_type_script_lang = require('./src/image.vue_vue&type=script&lang.js');
9
9
 
10
10
  const PsImage = withInstall.withInstall(image_vue_vue_type_script_lang["default"]);
@@ -2,50 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var props = require('../../../utils/props.js');
6
- var util = require('../../../utils/util.js');
5
+ var image_vue_vue_type_script_lang = require('./image.vue_vue&type=script&lang.js');
6
+ var image_vue_vue_type_template_id_34467287_lang = require('./image.vue_vue&type=template&id=34467287&lang.js');
7
7
 
8
- const imageProps = props.buildProps({
9
- appendToBody: {
10
- type: Boolean,
11
- default: false
12
- },
13
- hideOnClickModal: {
14
- type: Boolean,
15
- default: false
16
- },
17
- src: {
18
- type: String,
19
- default: ""
20
- },
21
- fit: {
22
- type: String,
23
- values: ["", "contain", "cover", "fill", "none", "scale-down"],
24
- default: ""
25
- },
26
- lazy: {
27
- type: Boolean,
28
- default: false
29
- },
30
- scrollContainer: {
31
- type: props.definePropType([String, Object])
32
- },
33
- previewSrcList: {
34
- type: props.definePropType(Array),
35
- default: () => props.mutable([])
36
- },
37
- zIndex: {
38
- type: Number,
39
- default: 2e3
40
- },
41
- widget: String
42
- });
43
- const imageEmits = {
44
- error: (evt) => evt instanceof Event,
45
- switch: (val) => util.isNumber(val),
46
- close: () => true
47
- };
8
+ image_vue_vue_type_script_lang["default"].render = image_vue_vue_type_template_id_34467287_lang.render;
9
+ image_vue_vue_type_script_lang["default"].__file = "packages/components/image/src/image.vue";
48
10
 
49
- exports.imageEmits = imageEmits;
50
- exports.imageProps = imageProps;
11
+ exports["default"] = image_vue_vue_type_script_lang["default"];
51
12
  //# sourceMappingURL=image.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"image.js","sources":["../../../../../../../packages/components/image/src/image.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '@element-ps/utils/props'\nimport { isNumber } from '@element-ps/utils/util'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const imageProps = buildProps({\n appendToBody: {\n type: Boolean,\n default: false,\n },\n hideOnClickModal: {\n type: Boolean,\n default: false,\n },\n src: {\n type: String,\n default: '',\n },\n fit: {\n type: String,\n values: ['', 'contain', 'cover', 'fill', 'none', 'scale-down'],\n default: '',\n },\n lazy: {\n type: Boolean,\n default: false,\n },\n scrollContainer: {\n type: definePropType<string | HTMLElement | undefined>([String, Object]),\n },\n previewSrcList: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n zIndex: {\n type: Number,\n default: 2000,\n },\n widget: String,\n} as const)\nexport type ImageProps = ExtractPropTypes<typeof imageProps>\n\nexport const imageEmits = {\n error: (evt: Event) => evt instanceof Event,\n switch: (val: number) => isNumber(val),\n close: () => true,\n}\nexport type ImageEmits = typeof imageEmits\n"],"names":["buildProps","definePropType","mutable","isNumber"],"mappings":";;;;;;;MAKa,aAAaA,iBAAW;AAAA,EACnC,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,IACH,MAAM;AAAA,IACN,QAAQ,CAAC,IAAI,WAAW,SAAS,QAAQ,QAAQ;AAAA,IACjD,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,iBAAiB;AAAA,IACf,MAAMC,qBAAiD,CAAC,QAAQ;AAAA;AAAA,EAElE,gBAAgB;AAAA,IACd,MAAMA,qBAAyB;AAAA,IAC/B,SAAS,MAAMC,cAAQ;AAAA;AAAA,EAEzB,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA;MAIG,aAAa;AAAA,EACxB,OAAO,CAAC,QAAe,eAAe;AAAA,EACtC,QAAQ,CAAC,QAAgBC,cAAS;AAAA,EAClC,OAAO,MAAM;AAAA;;;;;"}
1
+ {"version":3,"file":"image.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -9,7 +9,7 @@ require('../../../hooks/index.js');
9
9
  var index = require('../../image-viewer/index.js');
10
10
  var isServer = require('../../../utils/isServer.js');
11
11
  var dom = require('../../../utils/dom.js');
12
- var image = require('./image.js');
12
+ var image = require('./image2.js');
13
13
  var index$1 = require('../../../hooks/use-locale/index.js');
14
14
  var index$2 = require('../../../hooks/use-attrs/index.js');
15
15
 
@@ -2,11 +2,50 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var image_vue_vue_type_script_lang = require('./image.vue_vue&type=script&lang.js');
6
- var image_vue_vue_type_template_id_34467287_lang = require('./image.vue_vue&type=template&id=34467287&lang.js');
5
+ var props = require('../../../utils/props.js');
6
+ var util = require('../../../utils/util.js');
7
7
 
8
- image_vue_vue_type_script_lang["default"].render = image_vue_vue_type_template_id_34467287_lang.render;
9
- image_vue_vue_type_script_lang["default"].__file = "packages/components/image/src/image.vue";
8
+ const imageProps = props.buildProps({
9
+ appendToBody: {
10
+ type: Boolean,
11
+ default: false
12
+ },
13
+ hideOnClickModal: {
14
+ type: Boolean,
15
+ default: false
16
+ },
17
+ src: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ fit: {
22
+ type: String,
23
+ values: ["", "contain", "cover", "fill", "none", "scale-down"],
24
+ default: ""
25
+ },
26
+ lazy: {
27
+ type: Boolean,
28
+ default: false
29
+ },
30
+ scrollContainer: {
31
+ type: props.definePropType([String, Object])
32
+ },
33
+ previewSrcList: {
34
+ type: props.definePropType(Array),
35
+ default: () => props.mutable([])
36
+ },
37
+ zIndex: {
38
+ type: Number,
39
+ default: 2e3
40
+ },
41
+ widget: String
42
+ });
43
+ const imageEmits = {
44
+ error: (evt) => evt instanceof Event,
45
+ switch: (val) => util.isNumber(val),
46
+ close: () => true
47
+ };
10
48
 
11
- exports["default"] = image_vue_vue_type_script_lang["default"];
49
+ exports.imageEmits = imageEmits;
50
+ exports.imageProps = imageProps;
12
51
  //# sourceMappingURL=image2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"image2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
1
+ {"version":3,"file":"image2.js","sources":["../../../../../../../packages/components/image/src/image.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '@element-ps/utils/props'\nimport { isNumber } from '@element-ps/utils/util'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const imageProps = buildProps({\n appendToBody: {\n type: Boolean,\n default: false,\n },\n hideOnClickModal: {\n type: Boolean,\n default: false,\n },\n src: {\n type: String,\n default: '',\n },\n fit: {\n type: String,\n values: ['', 'contain', 'cover', 'fill', 'none', 'scale-down'],\n default: '',\n },\n lazy: {\n type: Boolean,\n default: false,\n },\n scrollContainer: {\n type: definePropType<string | HTMLElement | undefined>([String, Object]),\n },\n previewSrcList: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n zIndex: {\n type: Number,\n default: 2000,\n },\n widget: String,\n} as const)\nexport type ImageProps = ExtractPropTypes<typeof imageProps>\n\nexport const imageEmits = {\n error: (evt: Event) => evt instanceof Event,\n switch: (val: number) => isNumber(val),\n close: () => true,\n}\nexport type ImageEmits = typeof imageEmits\n"],"names":["buildProps","definePropType","mutable","isNumber"],"mappings":";;;;;;;MAKa,aAAaA,iBAAW;AAAA,EACnC,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,IACH,MAAM;AAAA,IACN,QAAQ,CAAC,IAAI,WAAW,SAAS,QAAQ,QAAQ;AAAA,IACjD,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,iBAAiB;AAAA,IACf,MAAMC,qBAAiD,CAAC,QAAQ;AAAA;AAAA,EAElE,gBAAgB;AAAA,IACd,MAAMA,qBAAyB;AAAA,IAC/B,SAAS,MAAMC,cAAQ;AAAA;AAAA,EAEzB,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA;MAIG,aAAa;AAAA,EACxB,OAAO,CAAC,QAAe,eAAe;AAAA,EACtC,QAAQ,CAAC,QAAgBC,cAAS;AAAA,EAClC,OAAO,MAAM;AAAA;;;;;"}
@@ -72,13 +72,13 @@ var index$12 = require('./loading/index.js');
72
72
  var index$13 = require('./popover/index.js');
73
73
  var affix = require('./affix/src/affix.js');
74
74
  var alert = require('./alert/src/alert.js');
75
- var avatar = require('./avatar/src/avatar2.js');
75
+ var avatar = require('./avatar/src/avatar.js');
76
76
  var backtop = require('./backtop/src/backtop.js');
77
- var badge = require('./badge/src/badge.js');
77
+ var badge = require('./badge/src/badge2.js');
78
78
  var breadcrumb = require('./breadcrumb/src/breadcrumb.js');
79
- var breadcrumbItem = require('./breadcrumb/src/breadcrumb-item.js');
79
+ var breadcrumbItem = require('./breadcrumb/src/breadcrumb-item2.js');
80
80
  var button = require('./button/src/button.js');
81
- var card = require('./card/src/card2.js');
81
+ var card = require('./card/src/card.js');
82
82
  var types = require('./cascader-panel/src/types.js');
83
83
  var config = require('./cascader-panel/src/config.js');
84
84
  var col = require('./col/src/col.js');
@@ -86,9 +86,9 @@ var configProvider = require('./config-provider/src/config-provider.js');
86
86
  var useDialog = require('./dialog/src/use-dialog.js');
87
87
  var dialog = require('./dialog/src/dialog.js');
88
88
  var divider = require('./divider/src/divider.js');
89
- var empty = require('./empty/src/empty2.js');
89
+ var empty = require('./empty/src/empty.js');
90
90
  var icon = require('./icon/src/icon.js');
91
- var image = require('./image/src/image.js');
91
+ var image = require('./image/src/image2.js');
92
92
  var imageViewer = require('./image-viewer/src/image-viewer.js');
93
93
  var input = require('./input/src/input.js');
94
94
  var inputNumber = require('./input-number/src/input-number.js');
@@ -99,7 +99,7 @@ function useRender(props) {
99
99
  colspan,
100
100
  onMouseenter: ($event) => handleCellMouseEnter($event, { ...row, tooltipEffect }),
101
101
  onMouseleave: handleCellMouseLeave,
102
- widget: column.widget
102
+ widget: `table-column:default:${column.widget.split(":")[1]}`
103
103
  }, [column.renderCell(data)]);
104
104
  }));
105
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"render-helper.js","sources":["../../../../../../../../packages/components/table/src/table-body/render-helper.ts"],"sourcesContent":["import { h, getCurrentInstance, computed } from 'vue'\nimport { getRowIdentity } from '../util'\nimport useEvents from './events-helper'\nimport useStyles from './styles-helper'\n\nimport type { TableBodyProps } from './defaults'\nimport type {\n RenderRowData,\n Table,\n TreeNode,\n TableProps,\n} from '../table/defaults'\n\nfunction useRender<T>(props: Partial<TableBodyProps<T>>) {\n const instance = getCurrentInstance()\n const parent = instance.parent as Table<T>\n const {\n handleDoubleClick,\n handleClick,\n handleContextMenu,\n handleMouseEnter,\n handleMouseLeave,\n handleCellMouseEnter,\n handleCellMouseLeave,\n tooltipContent,\n tooltipTrigger,\n } = useEvents(props)\n const {\n getRowStyle,\n getRowClass,\n getCellStyle,\n getCellClass,\n getSpan,\n getColspanRealWidth,\n } = useStyles(props)\n const firstDefaultColumnIndex = computed(() => {\n return props.store.states.columns.value.findIndex(\n ({ type }) => type === 'default'\n )\n })\n const getKeyOfRow = (row: T, index: number) => {\n const rowKey = (parent.props as Partial<TableProps<T>>).rowKey\n if (rowKey) {\n return getRowIdentity(row, rowKey)\n }\n return index\n }\n const rowRender = (row: T, $index: number, treeRowData?: TreeNode) => {\n const { tooltipEffect, store } = props\n const { indent, columns } = store.states\n const rowClasses = getRowClass(row, $index)\n let display = true\n if (treeRowData) {\n rowClasses.push(`el-table__row--level-${treeRowData.level}`)\n display = treeRowData.display\n }\n const displayStyle = display\n ? null\n : {\n display: 'none',\n }\n return h(\n 'tr',\n {\n style: [displayStyle, getRowStyle(row, $index)],\n class: rowClasses,\n key: getKeyOfRow(row, $index),\n onDblclick: ($event) => handleDoubleClick($event, row),\n onClick: ($event) => handleClick($event, row),\n onContextmenu: ($event) => handleContextMenu($event, row),\n onMouseenter: () => handleMouseEnter($index),\n onMouseleave: handleMouseLeave,\n },\n columns.value.map((column, cellIndex) => {\n const { rowspan, colspan } = getSpan(row, column, $index, cellIndex)\n if (!rowspan || !colspan) {\n return null\n }\n const columnData = { ...column }\n columnData.realWidth = getColspanRealWidth(\n columns.value,\n colspan,\n cellIndex\n )\n const data: RenderRowData<T> = {\n store: props.store,\n _self: props.context || parent,\n column: columnData,\n row,\n $index,\n }\n if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {\n data.treeNode = {\n indent: treeRowData.level * indent.value,\n level: treeRowData.level,\n }\n if (typeof treeRowData.expanded === 'boolean') {\n data.treeNode.expanded = treeRowData.expanded\n // 表明是懒加载\n if ('loading' in treeRowData) {\n data.treeNode.loading = treeRowData.loading\n }\n if ('noLazyChildren' in treeRowData) {\n data.treeNode.noLazyChildren = treeRowData.noLazyChildren\n }\n }\n }\n const baseKey = `${$index},${cellIndex}`\n const patchKey = columnData.columnKey || columnData.rawColumnKey || ''\n return h(\n 'td',\n {\n style: getCellStyle($index, cellIndex, row, column),\n class: getCellClass($index, cellIndex, row, column),\n key: `${patchKey}${baseKey}`,\n rowspan,\n colspan,\n onMouseenter: ($event) =>\n handleCellMouseEnter($event, { ...row, tooltipEffect }),\n onMouseleave: handleCellMouseLeave,\n widget: column.widget,\n },\n [column.renderCell(data)]\n )\n })\n )\n }\n const wrappedRowRender = (row: T, $index: number) => {\n const store = props.store\n const { isRowExpanded, assertRowKey } = store\n const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } =\n store.states\n const hasExpandColumn = store.states.columns.value.some(\n ({ type }) => type === 'expand'\n )\n if (hasExpandColumn && isRowExpanded(row)) {\n const renderExpanded = parent.renderExpanded\n const tr = rowRender(row, $index, undefined)\n if (!renderExpanded) {\n console.error('[Element Error]renderExpanded is required.')\n return tr\n }\n // 使用二维数组,避免修改 $index\n // Use a two dimensional array avoid modifying $index\n return [\n [\n tr,\n h(\n 'tr',\n {\n key: `expanded-row__${tr.key as string}`,\n },\n [\n h(\n 'td',\n {\n colspan: store.states.columns.value.length,\n class: 'el-table__cell el-table__expanded-cell',\n },\n [renderExpanded({ row, $index, store })]\n ),\n ]\n ),\n ],\n ]\n } else if (Object.keys(treeData.value).length) {\n assertRowKey()\n // TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算\n // 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作\n const key = getRowIdentity(row, rowKey.value)\n let cur = treeData.value[key]\n let treeRowData = null\n if (cur) {\n treeRowData = {\n expanded: cur.expanded,\n level: cur.level,\n display: true,\n }\n if (typeof cur.lazy === 'boolean') {\n if (typeof cur.loaded === 'boolean' && cur.loaded) {\n treeRowData.noLazyChildren = !(cur.children && cur.children.length)\n }\n treeRowData.loading = cur.loading\n }\n }\n const tmp = [rowRender(row, $index, treeRowData)]\n // 渲染嵌套数据\n if (cur) {\n // currentRow 记录的是 index,所以还需主动增加 TreeTable 的 index\n let i = 0\n const traverse = (children, parent) => {\n if (!(children && children.length && parent)) return\n children.forEach((node) => {\n // 父节点的 display 状态影响子节点的显示状态\n const innerTreeRowData = {\n display: parent.display && parent.expanded,\n level: parent.level + 1,\n expanded: false,\n noLazyChildren: false,\n loading: false,\n }\n const childKey = getRowIdentity(node, rowKey.value)\n if (childKey === undefined || childKey === null) {\n throw new Error('For nested data item, row-key is required.')\n }\n cur = { ...treeData.value[childKey] }\n // 对于当前节点,分成有无子节点两种情况。\n // 如果包含子节点的,设置 expanded 属性。\n // 对于它子节点的 display 属性由它本身的 expanded 与 display 共同决定。\n if (cur) {\n innerTreeRowData.expanded = cur.expanded\n // 懒加载的某些节点,level 未知\n cur.level = cur.level || innerTreeRowData.level\n cur.display = !!(cur.expanded && innerTreeRowData.display)\n if (typeof cur.lazy === 'boolean') {\n if (typeof cur.loaded === 'boolean' && cur.loaded) {\n innerTreeRowData.noLazyChildren = !(\n cur.children && cur.children.length\n )\n }\n innerTreeRowData.loading = cur.loading\n }\n }\n i++\n tmp.push(rowRender(node, $index + i, innerTreeRowData))\n if (cur) {\n const nodes =\n lazyTreeNodeMap.value[childKey] ||\n node[childrenColumnName.value]\n traverse(nodes, cur)\n }\n })\n }\n // 对于 root 节点,display 一定为 true\n cur.display = true\n const nodes =\n lazyTreeNodeMap.value[key] || row[childrenColumnName.value]\n traverse(nodes, cur)\n }\n return tmp\n } else {\n return rowRender(row, $index, undefined)\n }\n }\n\n return {\n wrappedRowRender,\n tooltipContent,\n tooltipTrigger,\n }\n}\n\nexport default useRender\n"],"names":["getCurrentInstance","useEvents","useStyles","computed","getRowIdentity","h"],"mappings":";;;;;;;;;AAaA,mBAAsB,OAAmC;AACvD,QAAM,WAAWA;AACjB,QAAM,SAAS,SAAS;AACxB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACEC,wBAAU;AACd,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACEC,wBAAU;AACd,QAAM,0BAA0BC,aAAS,MAAM;A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IAAI;AAAA;AAAA;AAGnC;AACA,gBAAI,KAAK,UAAU,MAAM,SAAS,GAAG;AACrC,gBAAI,KAAK;AACP,oBAAM,SACJ,gBAAgB,MAAM,aACtB,KAAK,mBAAmB;AAC1B,uBAAS,QAAO;AAAA;AAAA;AAAA;AAKtB,YAAI,UAAU;AACd,cAAM,QACJ,gBAAgB,MAAM,QAAQ,IAAI,mBAAmB;AACvD,iBAAS,OAAO;AAAA;AAElB,aAAO;AAAA,WACF;AACL,aAAO,UAAU,KAAK,QAAQ;AAAA;AAAA;AAIlC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"render-helper.js","sources":["../../../../../../../../packages/components/table/src/table-body/render-helper.ts"],"sourcesContent":["import { h, getCurrentInstance, computed } from 'vue'\nimport { getRowIdentity } from '../util'\nimport useEvents from './events-helper'\nimport useStyles from './styles-helper'\n\nimport type { TableBodyProps } from './defaults'\nimport type {\n RenderRowData,\n Table,\n TreeNode,\n TableProps,\n} from '../table/defaults'\n\nfunction useRender<T>(props: Partial<TableBodyProps<T>>) {\n const instance = getCurrentInstance()\n const parent = instance.parent as Table<T>\n const {\n handleDoubleClick,\n handleClick,\n handleContextMenu,\n handleMouseEnter,\n handleMouseLeave,\n handleCellMouseEnter,\n handleCellMouseLeave,\n tooltipContent,\n tooltipTrigger,\n } = useEvents(props)\n const {\n getRowStyle,\n getRowClass,\n getCellStyle,\n getCellClass,\n getSpan,\n getColspanRealWidth,\n } = useStyles(props)\n const firstDefaultColumnIndex = computed(() => {\n return props.store.states.columns.value.findIndex(\n ({ type }) => type === 'default'\n )\n })\n const getKeyOfRow = (row: T, index: number) => {\n const rowKey = (parent.props as Partial<TableProps<T>>).rowKey\n if (rowKey) {\n return getRowIdentity(row, rowKey)\n }\n return index\n }\n const rowRender = (row: T, $index: number, treeRowData?: TreeNode) => {\n const { tooltipEffect, store } = props\n const { indent, columns } = store.states\n const rowClasses = getRowClass(row, $index)\n let display = true\n if (treeRowData) {\n rowClasses.push(`el-table__row--level-${treeRowData.level}`)\n display = treeRowData.display\n }\n const displayStyle = display\n ? null\n : {\n display: 'none',\n }\n return h(\n 'tr',\n {\n style: [displayStyle, getRowStyle(row, $index)],\n class: rowClasses,\n key: getKeyOfRow(row, $index),\n onDblclick: ($event) => handleDoubleClick($event, row),\n onClick: ($event) => handleClick($event, row),\n onContextmenu: ($event) => handleContextMenu($event, row),\n onMouseenter: () => handleMouseEnter($index),\n onMouseleave: handleMouseLeave,\n },\n columns.value.map((column, cellIndex) => {\n const { rowspan, colspan } = getSpan(row, column, $index, cellIndex)\n if (!rowspan || !colspan) {\n return null\n }\n const columnData = { ...column }\n columnData.realWidth = getColspanRealWidth(\n columns.value,\n colspan,\n cellIndex\n )\n const data: RenderRowData<T> = {\n store: props.store,\n _self: props.context || parent,\n column: columnData,\n row,\n $index,\n }\n if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {\n data.treeNode = {\n indent: treeRowData.level * indent.value,\n level: treeRowData.level,\n }\n if (typeof treeRowData.expanded === 'boolean') {\n data.treeNode.expanded = treeRowData.expanded\n // 表明是懒加载\n if ('loading' in treeRowData) {\n data.treeNode.loading = treeRowData.loading\n }\n if ('noLazyChildren' in treeRowData) {\n data.treeNode.noLazyChildren = treeRowData.noLazyChildren\n }\n }\n }\n const baseKey = `${$index},${cellIndex}`\n const patchKey = columnData.columnKey || columnData.rawColumnKey || ''\n return h(\n 'td',\n {\n style: getCellStyle($index, cellIndex, row, column),\n class: getCellClass($index, cellIndex, row, column),\n key: `${patchKey}${baseKey}`,\n rowspan,\n colspan,\n onMouseenter: ($event) =>\n handleCellMouseEnter($event, { ...row, tooltipEffect }),\n onMouseleave: handleCellMouseLeave,\n widget: `table-column:default:${column.widget.split(':')[1]}`,\n },\n [column.renderCell(data)]\n )\n })\n )\n }\n const wrappedRowRender = (row: T, $index: number) => {\n const store = props.store\n const { isRowExpanded, assertRowKey } = store\n const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } =\n store.states\n const hasExpandColumn = store.states.columns.value.some(\n ({ type }) => type === 'expand'\n )\n if (hasExpandColumn && isRowExpanded(row)) {\n const renderExpanded = parent.renderExpanded\n const tr = rowRender(row, $index, undefined)\n if (!renderExpanded) {\n console.error('[Element Error]renderExpanded is required.')\n return tr\n }\n // 使用二维数组,避免修改 $index\n // Use a two dimensional array avoid modifying $index\n return [\n [\n tr,\n h(\n 'tr',\n {\n key: `expanded-row__${tr.key as string}`,\n },\n [\n h(\n 'td',\n {\n colspan: store.states.columns.value.length,\n class: 'el-table__cell el-table__expanded-cell',\n },\n [renderExpanded({ row, $index, store })]\n ),\n ]\n ),\n ],\n ]\n } else if (Object.keys(treeData.value).length) {\n assertRowKey()\n // TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算\n // 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作\n const key = getRowIdentity(row, rowKey.value)\n let cur = treeData.value[key]\n let treeRowData = null\n if (cur) {\n treeRowData = {\n expanded: cur.expanded,\n level: cur.level,\n display: true,\n }\n if (typeof cur.lazy === 'boolean') {\n if (typeof cur.loaded === 'boolean' && cur.loaded) {\n treeRowData.noLazyChildren = !(cur.children && cur.children.length)\n }\n treeRowData.loading = cur.loading\n }\n }\n const tmp = [rowRender(row, $index, treeRowData)]\n // 渲染嵌套数据\n if (cur) {\n // currentRow 记录的是 index,所以还需主动增加 TreeTable 的 index\n let i = 0\n const traverse = (children, parent) => {\n if (!(children && children.length && parent)) return\n children.forEach((node) => {\n // 父节点的 display 状态影响子节点的显示状态\n const innerTreeRowData = {\n display: parent.display && parent.expanded,\n level: parent.level + 1,\n expanded: false,\n noLazyChildren: false,\n loading: false,\n }\n const childKey = getRowIdentity(node, rowKey.value)\n if (childKey === undefined || childKey === null) {\n throw new Error('For nested data item, row-key is required.')\n }\n cur = { ...treeData.value[childKey] }\n // 对于当前节点,分成有无子节点两种情况。\n // 如果包含子节点的,设置 expanded 属性。\n // 对于它子节点的 display 属性由它本身的 expanded 与 display 共同决定。\n if (cur) {\n innerTreeRowData.expanded = cur.expanded\n // 懒加载的某些节点,level 未知\n cur.level = cur.level || innerTreeRowData.level\n cur.display = !!(cur.expanded && innerTreeRowData.display)\n if (typeof cur.lazy === 'boolean') {\n if (typeof cur.loaded === 'boolean' && cur.loaded) {\n innerTreeRowData.noLazyChildren = !(\n cur.children && cur.children.length\n )\n }\n innerTreeRowData.loading = cur.loading\n }\n }\n i++\n tmp.push(rowRender(node, $index + i, innerTreeRowData))\n if (cur) {\n const nodes =\n lazyTreeNodeMap.value[childKey] ||\n node[childrenColumnName.value]\n traverse(nodes, cur)\n }\n })\n }\n // 对于 root 节点,display 一定为 true\n cur.display = true\n const nodes =\n lazyTreeNodeMap.value[key] || row[childrenColumnName.value]\n traverse(nodes, cur)\n }\n return tmp\n } else {\n return rowRender(row, $index, undefined)\n }\n }\n\n return {\n wrappedRowRender,\n tooltipContent,\n tooltipTrigger,\n }\n}\n\nexport default useRender\n"],"names":["getCurrentInstance","useEvents","useStyles","computed","getRowIdentity","h"],"mappings":";;;;;;;;;AAaA,mBAAsB,OAAmC;AACvD,QAAM,WAAWA;AACjB,QAAM,SAAS,SAAS;AACxB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACEC,wBAAU;AACd,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACEC,wBAAU;AACd,QAAM,0BAA0BC,aAAS,MAAM;AAC7C,WAAO,MAAM,MAAM,OAAO,QAAQ,MAAM,UACtC,CAAC,EAAE,WAAW,SAAS;AAAA;AAG3B,QAAM,cAAc,CAAC,KAAQ,UAAkB;AAC7C,UAAM,SAAU,OAAO,MAAiC;AACxD,QAAI,QAAQ;AACV,aAAOC,oBAAe,KAAK;AAAA;AAE7B,WAAO;AAAA;AAET,Q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,cAAM,QACJ,gBAAgB,MAAM,QAAQ,IAAI,mBAAmB;AACvD,iBAAS,OAAO;AAAA;AAElB,aAAO;AAAA,WACF;AACL,aAAO,UAAU,KAAK,QAAQ;AAAA;AAAA;AAIlC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA;AAAA;;;;"}
@@ -99,7 +99,7 @@ var TableHeader = vue.defineComponent({
99
99
  key: `${column.id}-thead`,
100
100
  rowSpan: column.rowSpan,
101
101
  style: this.getHeaderCellStyle(rowIndex, cellIndex, subColumns, column),
102
- widget: column.widget
102
+ widget: `table-column:header:${column.widget.split(":")[1]}`
103
103
  }, [
104
104
  vue.h("div", {
105
105
  class: [
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../packages/components/table/src/table-header/index.ts"],"sourcesContent":["import {\n defineComponent,\n getCurrentInstance,\n computed,\n onMounted,\n nextTick,\n ref,\n h,\n} from 'vue'\nimport PsCheckbox from '@element-ps/components/checkbox'\nimport FilterPanel from '../filter-panel.vue'\nimport useLayoutObserver from '../layout-observer'\nimport { hColgroup } from '../h-helper'\nimport useStyle from './style.helper'\nimport useUtils from './utils-helper'\n\nimport type { ComponentInternalInstance, Ref, PropType } from 'vue'\nimport type { DefaultRow, Sort, Table } from '../table/defaults'\nimport type { Store } from '../store'\nexport interface TableHeader extends ComponentInternalInstance {\n state: {\n onColumnsChange\n onScrollableChange\n }\n filterPanels: Ref<unknown>\n}\nexport interface TableHeaderProps<T> {\n fixed: string\n store: Store<T>\n border: boolean\n defaultSort: Sort\n}\n\nexport default defineComponent({\n name: 'PsTableHeader',\n components: {\n PsCheckbox,\n },\n props: {\n fixed: {\n type: String,\n default: '',\n },\n store: {\n required: true,\n type: Object as PropType<TableHeaderProps<DefaultRow>['store']>,\n },\n border: Boolean,\n defaultSort: {\n type: Object as PropType<TableHeaderProps<DefaultRow>['defaultSort']>,\n default: () => {\n return {\n prop: '',\n order: '',\n }\n },\n },\n },\n setup(props) {\n const instance = getCurrentInstance() as TableHeader\n const parent = instance.parent as Table<unknown>\n const storeData = parent.store.states\n const filterPanels = ref({})\n const { tableLayout, onColumnsChange, onScrollableChange } =\n useLayoutObserver(parent)\n const hasGutter = computed(() => {\n return !props.fixed && tableLayout.gutterWidth\n })\n onMounted(() => {\n nextTick(() => {\n const { prop, order } = props.defaultSort\n const init = true\n parent.store.commit('sort', { prop, order, init })\n })\n })\n const {\n getHeaderRowStyle,\n getHeaderRowClass,\n getHeaderCellStyle,\n getHeaderCellClass,\n } = useStyle(props as TableHeaderProps<unknown>)\n const { isGroup, toggleAllSelection, columnRows } = useUtils(\n props as TableHeaderProps<unknown>\n )\n\n instance.state = {\n onColumnsChange,\n onScrollableChange,\n }\n // eslint-disable-next-line\n instance.filterPanels = filterPanels\n\n return {\n columns: storeData.columns,\n filterPanels,\n hasGutter,\n onColumnsChange,\n onScrollableChange,\n columnRows,\n getHeaderRowClass,\n getHeaderRowStyle,\n getHeaderCellClass,\n getHeaderCellStyle,\n isGroup,\n toggleAllSelection,\n }\n },\n render() {\n return h(\n 'table',\n {\n border: '0',\n cellpadding: '0',\n cellspacing: '0',\n class: 'el-table__header',\n },\n [\n hColgroup(this.columns, this.hasGutter),\n h(\n 'thead',\n {\n class: { 'is-group': this.isGroup, 'has-gutter': this.hasGutter },\n },\n this.columnRows.map((subColumns, rowIndex) =>\n h(\n 'tr',\n {\n class: this.getHeaderRowClass(rowIndex),\n key: rowIndex,\n style: this.getHeaderRowStyle(rowIndex),\n },\n subColumns.map((column, cellIndex) =>\n h(\n 'th',\n {\n class: this.getHeaderCellClass(\n rowIndex,\n cellIndex,\n subColumns,\n column\n ),\n colspan: column.colSpan,\n key: `${column.id}-thead`,\n rowSpan: column.rowSpan,\n style: this.getHeaderCellStyle(\n rowIndex,\n cellIndex,\n subColumns,\n column\n ),\n widget: column.widget,\n },\n [\n h(\n 'div',\n {\n class: [\n 'cell',\n column.filteredValue &&\n column.filteredValue.length > 0\n ? 'highlight'\n : '',\n column.labelClassName,\n ],\n },\n [\n column.renderHeader\n ? column.renderHeader({\n column,\n $index: cellIndex,\n store: this.store,\n _self: this.$parent,\n })\n : column.label,\n column.sortable &&\n h(\n 'span',\n {\n class: 'caret-wrapper',\n },\n [\n h('i', {\n class: 'sort-caret ascending',\n }),\n h('i', {\n class: 'sort-caret descending',\n }),\n ]\n ),\n column.filterable &&\n h(FilterPanel, {\n store: this.$parent.store,\n placement: column.filterPlacement || 'bottom-start',\n column,\n upDataColumn: (key, value) => {\n column[key] = value\n },\n }),\n ]\n ),\n ]\n )\n )\n )\n )\n ),\n ]\n )\n },\n})\n"],"names":["defineComponent","PsCheckbox","getCurrentInstance","ref","useLayoutObserver","computed","useStyle","useUtils","h","hColgroup","FilterPanel"],"mappings":";;;;;;;;;;;;;AAiCA,kBAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,gBACVC;AAAA;AAAA,EAEF,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,OAAO;AAAA,MACL,UAAU;AAAA,MACV,MAAM;AAAA;AAAA,IAER,QAAQ;AAAA,IACR,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS,MAAM;AACb,eAAO;AAAA,UACL,MAAM;AAAA,UACN,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKf,MAAM,OAAO;AACX,UAAM,WAAWC;AACjB,UAAM,SAAS,SAAS;AACxB,UAAM,YAAY,OAAO,MAAM;AAC/B,UAAM,eAAeC,QAAI;AACzB,UAAM,EAAE,aAAa,iBAAiB,uBACpCC,0BAAkB;AACpB,UAAM,YAAYC,aAAS,MAAM;AAC/B,aAAO,CAAC,MAAM,SAAS,YAAY;AAAA;AAErC,kBAAU,MAAM;AACd,mBAAS,MAAM;AACb,cAAM,EAAE,MAAM,UAAU,MAAM;AAC9B,cAAM,OAAO;AACb,eAAO,MAAM,OAAO,QAAQ,EAAE,MAAM,OAAO;AAAA;A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OAAO,KAAK;AAAA,eAEd,OAAO;AAAA,UACX,OAAO,YACLA,MACE,QACA;AAAA,YACE,OAAO;AAAA,aAET;AAAA,YACEA,MAAE,KAAK;AAAA,cACL,OAAO;AAAA;AAAA,YAETA,MAAE,KAAK;AAAA,cACL,OAAO;AAAA;AAAA;AAAA,UAIf,OAAO,cACLA,MAAEE,iDAAa;AAAA,YACb,OAAO,KAAK,QAAQ;AAAA,YACpB,WAAW,OAAO,mBAAmB;AAAA,YACrC;AAAA,YACA,cAAc,CAAC,KAAK,UAAU;AAC5B,qBAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../packages/components/table/src/table-header/index.ts"],"sourcesContent":["import {\n defineComponent,\n getCurrentInstance,\n computed,\n onMounted,\n nextTick,\n ref,\n h,\n} from 'vue'\nimport PsCheckbox from '@element-ps/components/checkbox'\nimport FilterPanel from '../filter-panel.vue'\nimport useLayoutObserver from '../layout-observer'\nimport { hColgroup } from '../h-helper'\nimport useStyle from './style.helper'\nimport useUtils from './utils-helper'\n\nimport type { ComponentInternalInstance, Ref, PropType } from 'vue'\nimport type { DefaultRow, Sort, Table } from '../table/defaults'\nimport type { Store } from '../store'\nexport interface TableHeader extends ComponentInternalInstance {\n state: {\n onColumnsChange\n onScrollableChange\n }\n filterPanels: Ref<unknown>\n}\nexport interface TableHeaderProps<T> {\n fixed: string\n store: Store<T>\n border: boolean\n defaultSort: Sort\n}\n\nexport default defineComponent({\n name: 'PsTableHeader',\n components: {\n PsCheckbox,\n },\n props: {\n fixed: {\n type: String,\n default: '',\n },\n store: {\n required: true,\n type: Object as PropType<TableHeaderProps<DefaultRow>['store']>,\n },\n border: Boolean,\n defaultSort: {\n type: Object as PropType<TableHeaderProps<DefaultRow>['defaultSort']>,\n default: () => {\n return {\n prop: '',\n order: '',\n }\n },\n },\n },\n setup(props) {\n const instance = getCurrentInstance() as TableHeader\n const parent = instance.parent as Table<unknown>\n const storeData = parent.store.states\n const filterPanels = ref({})\n const { tableLayout, onColumnsChange, onScrollableChange } =\n useLayoutObserver(parent)\n const hasGutter = computed(() => {\n return !props.fixed && tableLayout.gutterWidth\n })\n onMounted(() => {\n nextTick(() => {\n const { prop, order } = props.defaultSort\n const init = true\n parent.store.commit('sort', { prop, order, init })\n })\n })\n const {\n getHeaderRowStyle,\n getHeaderRowClass,\n getHeaderCellStyle,\n getHeaderCellClass,\n } = useStyle(props as TableHeaderProps<unknown>)\n const { isGroup, toggleAllSelection, columnRows } = useUtils(\n props as TableHeaderProps<unknown>\n )\n\n instance.state = {\n onColumnsChange,\n onScrollableChange,\n }\n // eslint-disable-next-line\n instance.filterPanels = filterPanels\n\n return {\n columns: storeData.columns,\n filterPanels,\n hasGutter,\n onColumnsChange,\n onScrollableChange,\n columnRows,\n getHeaderRowClass,\n getHeaderRowStyle,\n getHeaderCellClass,\n getHeaderCellStyle,\n isGroup,\n toggleAllSelection,\n }\n },\n render() {\n return h(\n 'table',\n {\n border: '0',\n cellpadding: '0',\n cellspacing: '0',\n class: 'el-table__header',\n },\n [\n hColgroup(this.columns, this.hasGutter),\n h(\n 'thead',\n {\n class: { 'is-group': this.isGroup, 'has-gutter': this.hasGutter },\n },\n this.columnRows.map((subColumns, rowIndex) =>\n h(\n 'tr',\n {\n class: this.getHeaderRowClass(rowIndex),\n key: rowIndex,\n style: this.getHeaderRowStyle(rowIndex),\n },\n subColumns.map((column, cellIndex) =>\n h(\n 'th',\n {\n class: this.getHeaderCellClass(\n rowIndex,\n cellIndex,\n subColumns,\n column\n ),\n colspan: column.colSpan,\n key: `${column.id}-thead`,\n rowSpan: column.rowSpan,\n style: this.getHeaderCellStyle(\n rowIndex,\n cellIndex,\n subColumns,\n column\n ),\n widget: `table-column:header:${column.widget.split(':')[1]}`,\n },\n [\n h(\n 'div',\n {\n class: [\n 'cell',\n column.filteredValue &&\n column.filteredValue.length > 0\n ? 'highlight'\n : '',\n column.labelClassName,\n ],\n },\n [\n column.renderHeader\n ? column.renderHeader({\n column,\n $index: cellIndex,\n store: this.store,\n _self: this.$parent,\n })\n : column.label,\n column.sortable &&\n h(\n 'span',\n {\n class: 'caret-wrapper',\n },\n [\n h('i', {\n class: 'sort-caret ascending',\n }),\n h('i', {\n class: 'sort-caret descending',\n }),\n ]\n ),\n column.filterable &&\n h(FilterPanel, {\n store: this.$parent.store,\n placement: column.filterPlacement || 'bottom-start',\n column,\n upDataColumn: (key, value) => {\n column[key] = value\n },\n }),\n ]\n ),\n ]\n )\n )\n )\n )\n ),\n ]\n )\n },\n})\n"],"names":["defineComponent","PsCheckbox","getCurrentInstance","ref","useLayoutObserver","computed","useStyle","useUtils","h","hColgroup","FilterPanel"],"mappings":";;;;;;;;;;;;;AAiCA,kBAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,gBACVC;AAAA;AAAA,EAEF,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,OAAO;AAAA,MACL,UAAU;AAAA,MACV,MAAM;AAAA;AAAA,IAER,QAAQ;AAAA,IACR,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS,MAAM;AACb,eAAO;AAAA,UACL,MAAM;AAAA,UACN,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKf,MAAM,OAAO;AACX,UAAM,WAAWC;AACjB,UAAM,SAAS,SAAS;AACxB,UAAM,YAAY,OAAO,MAAM;AAC/B,UAAM,eAAeC,QAAI;AACzB,UAAM,EAAE,aAAa,iBAAiB,uBACpCC,0BAAkB;AACpB,UAAM,YAAYC,aAAS,MAAM;AAC/B,aAAO,CAAC,MAAM,SAAS,YAAY;AAAA;AAErC,kBAAU,MAAM;AACd,mBAAS,MAAM;AACb,cAAM,EAAE,MAAM,UAAU,MAAM;AAC9B,cAAM,OAAO;AACb,eAAO,MAAM,OAAO,QAAQ,EAAE,MAAM,OAAO;AAAA;AAAA;AAG/C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AK;AAAA,YACZ,OAAO,KAAK;AAAA,eAEd,OAAO;AAAA,UACX,OAAO,YACLA,MACE,QACA;AAAA,YACE,OAAO;AAAA,aAET;AAAA,YACEA,MAAE,KAAK;AAAA,cACL,OAAO;AAAA;AAAA,YAETA,MAAE,KAAK;AAAA,cACL,OAAO;AAAA;AAAA;AAAA,UAIf,OAAO,cACLA,MAAEE,iDAAa;AAAA,YACb,OAAO,KAAK,QAAQ;AAAA,YACpB,WAAW,OAAO,mBAAmB;AAAA,YACrC;AAAA,YACA,cAAc,CAAC,KAAK,UAAU;AAC5B,qBAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;"}
@@ -31,4 +31,4 @@ export declare function deduplicate<T>(arr: T[]): T[];
31
31
  export declare function $<T>(ref: Ref<T>): T;
32
32
  export declare function addUnit(value: string | number): string;
33
33
  export declare function isEqualWithFunction(obj: any, other: any): boolean;
34
- export declare const refAttacher: <T extends HTMLElement | ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>>(ref: Ref<T>) => (val: T) => void;
34
+ export declare const refAttacher: <T extends ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | HTMLElement>(ref: Ref<T>) => (val: T) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "element-ps",
3
- "version": "1.0.8",
3
+ "version": "1.0.12",
4
4
  "description": "A Component Library for Vue 3",
5
5
  "homepage": "https://element-plus.org/",
6
6
  "keywords": [
package/web-types.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json","framework":"vue","name":"element-ps","version":"1.0.8","contributions":{"html":{"types-syntax":"typescript","description-markup":"markdown"}}}
1
+ {"$schema":"https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json","framework":"vue","name":"element-ps","version":"1.0.12","contributions":{"html":{"types-syntax":"typescript","description-markup":"markdown"}}}