ele-admin-plus 1.2.1-beta.1 → 1.2.1-beta.3

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 (477) hide show
  1. package/es/ele-admin-layout/index.d.ts +29 -24
  2. package/es/ele-admin-layout/props.d.ts +15 -11
  3. package/es/ele-admin-layout/props.js +4 -1
  4. package/es/ele-admin-layout/style/index.scss +7 -2
  5. package/es/ele-admin-layout/style/sidebar.scss +2 -0
  6. package/es/ele-alert/index.d.ts +15 -15
  7. package/es/ele-alert/index.js +3 -3
  8. package/es/ele-alert/props.d.ts +9 -8
  9. package/es/ele-app/components/message-body.d.ts +6 -5
  10. package/es/ele-app/components/message-body.js +2 -2
  11. package/es/ele-app/components/message-box-icon.d.ts +7 -6
  12. package/es/ele-app/plus.d.ts +3 -0
  13. package/es/ele-app/style/overwrite/input/index.scss +2 -0
  14. package/es/ele-avatar-group/index.d.ts +19 -18
  15. package/es/ele-avatar-group/index.js +15 -15
  16. package/es/ele-avatar-group/props.d.ts +10 -7
  17. package/es/ele-basic-select/index.d.ts +22 -19
  18. package/es/ele-basic-select/index.js +30 -23
  19. package/es/ele-basic-select/props.d.ts +11 -6
  20. package/es/ele-basic-select/props.js +3 -1
  21. package/es/ele-basic-select/util.d.ts +6 -0
  22. package/es/ele-basic-select/util.js +13 -0
  23. package/es/ele-bottom-bar/index.d.ts +4 -4
  24. package/es/ele-bottom-bar/props.d.ts +3 -2
  25. package/es/ele-breadcrumb/index.d.ts +3 -3
  26. package/es/ele-breadcrumb/props.d.ts +1 -1
  27. package/es/ele-card/index.d.ts +14 -14
  28. package/es/ele-card/props.d.ts +8 -6
  29. package/es/ele-check-card/components/card-item.d.ts +3 -2
  30. package/es/ele-check-card/index.d.ts +5 -5
  31. package/es/ele-check-card/index.js +12 -7
  32. package/es/ele-check-card/props.d.ts +3 -2
  33. package/es/ele-config-provider/index.d.ts +4 -4
  34. package/es/ele-config-provider/props.d.ts +3 -3
  35. package/es/ele-config-provider/types.d.ts +1 -0
  36. package/es/ele-copyable/index.d.ts +12 -12
  37. package/es/ele-copyable/index.js +6 -6
  38. package/es/ele-copyable/props.d.ts +7 -5
  39. package/es/ele-count-up/index.d.ts +1 -1
  40. package/es/ele-cropper/components/cropper-tools.d.ts +6 -5
  41. package/es/ele-cropper/components/cropper-tools.js +10 -10
  42. package/es/ele-cropper/index.d.ts +16 -16
  43. package/es/ele-cropper/index.js +39 -39
  44. package/es/ele-cropper/props.d.ts +2 -1
  45. package/es/ele-cropper-modal/index.d.ts +5 -5
  46. package/es/ele-cropper-modal/index.js +3 -3
  47. package/es/ele-cropper-modal/props.d.ts +1 -4
  48. package/es/ele-data-table/index.d.ts +22 -22
  49. package/es/ele-data-table/props.d.ts +16 -16
  50. package/es/ele-data-table/style/index.scss +1 -1
  51. package/es/ele-data-table/types.d.ts +2 -0
  52. package/es/ele-data-table/util.js +6 -2
  53. package/es/ele-drawer/index.d.ts +18 -18
  54. package/es/ele-drawer/index.js +18 -18
  55. package/es/ele-drawer/props.d.ts +11 -10
  56. package/es/ele-dropdown/index.d.ts +24 -24
  57. package/es/ele-dropdown/index.js +54 -48
  58. package/es/ele-dropdown/props.d.ts +13 -12
  59. package/es/ele-dropdown/types.d.ts +2 -0
  60. package/es/ele-edit-tag/index.d.ts +21 -19
  61. package/es/ele-edit-tag/index.js +10 -2
  62. package/es/ele-edit-tag/props.d.ts +13 -8
  63. package/es/ele-edit-tag/props.js +3 -1
  64. package/es/ele-ellipsis/index.d.ts +6 -5
  65. package/es/ele-ellipsis/index.js +3 -3
  66. package/es/ele-ellipsis/props.d.ts +1 -1
  67. package/es/ele-file-list/components/file-grid-item.d.ts +5 -5
  68. package/es/ele-file-list/components/file-grid-item.js +15 -15
  69. package/es/ele-file-list/components/file-grid.d.ts +6 -6
  70. package/es/ele-file-list/components/file-grid.js +15 -15
  71. package/es/ele-file-list/components/file-table-item.d.ts +5 -5
  72. package/es/ele-file-list/components/file-table-item.js +15 -15
  73. package/es/ele-file-list/components/file-table.d.ts +7 -7
  74. package/es/ele-file-list/components/file-table.js +19 -19
  75. package/es/ele-file-list/index.d.ts +10 -10
  76. package/es/ele-file-list/index.js +22 -22
  77. package/es/ele-file-list-tool/index.d.ts +1 -1
  78. package/es/ele-file-list-tool/index.js +2 -2
  79. package/es/ele-icon-select/components/icon-grid.d.ts +10 -8
  80. package/es/ele-icon-select/components/icon-grid.js +6 -6
  81. package/es/ele-icon-select/index.d.ts +44 -43
  82. package/es/ele-icon-select/index.js +29 -25
  83. package/es/ele-icon-select/props.d.ts +18 -14
  84. package/es/ele-icon-select/props.js +2 -0
  85. package/es/ele-loading/index.d.ts +4 -4
  86. package/es/ele-loading/props.d.ts +3 -2
  87. package/es/ele-map-picker/components/map-view.d.ts +26 -28
  88. package/es/ele-map-picker/components/map-view.js +1 -0
  89. package/es/ele-map-picker/index.d.ts +10 -10
  90. package/es/ele-map-picker/props.d.ts +6 -5
  91. package/es/ele-map-picker/style/index.scss +1 -1
  92. package/es/ele-menus/index.d.ts +2 -2
  93. package/es/ele-menus/index.js +15 -15
  94. package/es/ele-menus/props.d.ts +1 -1
  95. package/es/ele-menus/style/index.scss +5 -0
  96. package/es/ele-menus/util.d.ts +7 -0
  97. package/es/ele-menus/util.js +49 -26
  98. package/es/ele-modal/index.d.ts +30 -29
  99. package/es/ele-modal/index.js +48 -82
  100. package/es/ele-modal/props.d.ts +14 -13
  101. package/es/ele-modal/util.d.ts +31 -24
  102. package/es/ele-modal/util.js +235 -132
  103. package/es/ele-pagination/index.d.ts +20 -8
  104. package/es/ele-pagination/index.js +9 -8
  105. package/es/ele-pagination/props.d.ts +8 -2
  106. package/es/ele-pagination/style/index.scss +70 -0
  107. package/es/ele-popconfirm/index.d.ts +37 -47
  108. package/es/ele-popconfirm/index.js +15 -15
  109. package/es/ele-popconfirm/props.d.ts +18 -21
  110. package/es/ele-popover/index.d.ts +27 -37
  111. package/es/ele-popover/index.js +15 -15
  112. package/es/ele-popover/props.d.ts +11 -15
  113. package/es/ele-popover/props.js +1 -0
  114. package/es/ele-printer/index.d.ts +9 -9
  115. package/es/ele-printer/index.js +19 -22
  116. package/es/ele-printer/props.d.ts +6 -5
  117. package/es/ele-printer/style/index.scss +2 -2
  118. package/es/ele-printer/types.d.ts +0 -2
  119. package/es/ele-printer/util.d.ts +7 -28
  120. package/es/ele-printer/util.js +111 -77
  121. package/es/ele-pro-layout/index.d.ts +44 -48
  122. package/es/ele-pro-layout/index.js +2 -2
  123. package/es/ele-pro-layout/props.d.ts +17 -15
  124. package/es/ele-pro-layout/props.js +1 -1
  125. package/es/ele-pro-table/components/table-tools.d.ts +405 -35
  126. package/es/ele-pro-table/components/table-tools.js +227 -151
  127. package/es/ele-pro-table/components/tool-column-list.d.ts +21 -9
  128. package/es/ele-pro-table/components/tool-column-list.js +64 -37
  129. package/es/ele-pro-table/components/tool-column.d.ts +31 -44
  130. package/es/ele-pro-table/components/tool-column.js +87 -103
  131. package/es/ele-pro-table/components/tool-export.d.ts +37 -34
  132. package/es/ele-pro-table/components/tool-export.js +223 -215
  133. package/es/ele-pro-table/components/tool-print-body-cell.d.ts +5 -4
  134. package/es/ele-pro-table/components/tool-print-header-cell.d.ts +5 -4
  135. package/es/ele-pro-table/components/tool-print.d.ts +47 -43
  136. package/es/ele-pro-table/components/tool-print.js +380 -369
  137. package/es/ele-pro-table/index.d.ts +1020 -81
  138. package/es/ele-pro-table/index.js +103 -76
  139. package/es/ele-pro-table/props.d.ts +18 -19
  140. package/es/ele-pro-table/props.js +4 -2
  141. package/es/ele-pro-table/style/index.scss +44 -12
  142. package/es/ele-pro-table/types.d.ts +54 -0
  143. package/es/ele-pro-table/util.d.ts +84 -34
  144. package/es/ele-pro-table/util.js +186 -94
  145. package/es/ele-qr-code/components/canvas-render.d.ts +67 -0
  146. package/es/ele-qr-code/components/canvas-render.js +147 -0
  147. package/es/ele-qr-code/index.d.ts +5 -9
  148. package/es/ele-qr-code/index.js +33 -136
  149. package/es/ele-qr-code/props.d.ts +5 -2
  150. package/es/ele-qr-code/props.js +3 -1
  151. package/es/ele-qr-code/types.d.ts +5 -0
  152. package/es/ele-qr-code-svg/index.d.ts +6 -5
  153. package/es/ele-qr-code-svg/index.js +11 -14
  154. package/es/ele-segmented/index.d.ts +1 -1
  155. package/es/ele-segmented/index.js +6 -3
  156. package/es/ele-split-panel/index.d.ts +8 -8
  157. package/es/ele-split-panel/index.js +3 -3
  158. package/es/ele-split-panel/props.d.ts +4 -3
  159. package/es/ele-steps/index.d.ts +2 -2
  160. package/es/ele-steps/props.d.ts +2 -2
  161. package/es/ele-tab-wrap/components/tab-dropdown.d.ts +1 -1
  162. package/es/ele-tab-wrap/components/tab-dropdown.js +3 -3
  163. package/es/ele-table/index.d.ts +2 -2
  164. package/es/ele-table/props.d.ts +2 -1
  165. package/es/ele-table-select/index.d.ts +29 -27
  166. package/es/ele-table-select/index.js +47 -39
  167. package/es/ele-table-select/props.d.ts +11 -7
  168. package/es/ele-table-select/props.js +2 -0
  169. package/es/ele-tabs/index.d.ts +19 -34
  170. package/es/ele-tabs/index.js +133 -86
  171. package/es/ele-tabs/props.d.ts +10 -24
  172. package/es/ele-tabs/props.js +3 -1
  173. package/es/ele-tabs/style/index.scss +42 -2
  174. package/es/ele-tabs/types.d.ts +2 -11
  175. package/es/ele-text/index.d.ts +2 -2
  176. package/es/ele-text/props.d.ts +2 -1
  177. package/es/ele-tool/index.d.ts +11 -5
  178. package/es/ele-tool/index.js +32 -32
  179. package/es/ele-tool/props.d.ts +4 -1
  180. package/es/ele-tool/props.js +3 -1
  181. package/es/ele-tool/style/index.js +0 -1
  182. package/es/ele-toolbar/index.d.ts +3253 -7
  183. package/es/ele-toolbar/index.js +44 -5
  184. package/es/ele-toolbar/props.d.ts +10 -5
  185. package/es/ele-toolbar/props.js +2 -0
  186. package/es/ele-toolbar/style/index.js +1 -0
  187. package/es/ele-toolbar/types.d.ts +15 -0
  188. package/es/ele-tooltip/index.d.ts +22 -21
  189. package/es/ele-tooltip/index.js +25 -25
  190. package/es/ele-tooltip/props.d.ts +7 -6
  191. package/es/ele-tour/index.d.ts +4 -4
  192. package/es/ele-tour/index.js +10 -10
  193. package/es/ele-tree-select/index.d.ts +27 -27
  194. package/es/ele-tree-select/index.js +33 -30
  195. package/es/ele-tree-select/props.d.ts +12 -8
  196. package/es/ele-tree-select/props.js +3 -1
  197. package/es/ele-upload-list/components/list-item.d.ts +3 -3
  198. package/es/ele-upload-list/components/list-item.js +7 -7
  199. package/es/ele-upload-list/index.d.ts +11 -13
  200. package/es/ele-upload-list/index.js +13 -13
  201. package/es/ele-upload-list/props.d.ts +4 -3
  202. package/es/ele-upload-list/style/index.scss +4 -0
  203. package/es/ele-virtual-table/components/body-cell.d.ts +19 -35
  204. package/es/ele-virtual-table/components/body-cell.js +24 -24
  205. package/es/ele-virtual-table/components/body-row.d.ts +20 -36
  206. package/es/ele-virtual-table/components/body-row.js +21 -21
  207. package/es/ele-virtual-table/components/cell-checkbox.d.ts +4 -3
  208. package/es/ele-virtual-table/components/cell-checkbox.js +3 -3
  209. package/es/ele-virtual-table/components/cell-filter.d.ts +11 -11
  210. package/es/ele-virtual-table/components/cell-filter.js +18 -18
  211. package/es/ele-virtual-table/components/footer-row.d.ts +4 -4
  212. package/es/ele-virtual-table/components/footer-row.js +3 -3
  213. package/es/ele-virtual-table/components/header-cell.d.ts +12 -12
  214. package/es/ele-virtual-table/components/header-cell.js +15 -15
  215. package/es/ele-virtual-table/components/header-row.d.ts +12 -12
  216. package/es/ele-virtual-table/components/header-row.js +15 -15
  217. package/es/ele-virtual-table/index.d.ts +36 -35
  218. package/es/ele-virtual-table/index.js +50 -48
  219. package/es/ele-virtual-table/props.d.ts +11 -11
  220. package/es/ele-virtual-table/util.js +3 -3
  221. package/es/ele-watermark/index.d.ts +5 -4
  222. package/es/ele-watermark/index.js +1 -0
  223. package/es/ele-watermark/props.d.ts +2 -1
  224. package/es/ele-xg-player/index.d.ts +3 -3
  225. package/es/icons/SizeCompactOutlined.d.ts +2 -0
  226. package/es/icons/SizeCompactOutlined.js +34 -0
  227. package/es/icons/SizeSlackOutlined.d.ts +2 -0
  228. package/es/icons/SizeSlackOutlined.js +34 -0
  229. package/es/icons/index.d.ts +2 -0
  230. package/es/icons/index.js +46 -42
  231. package/es/lang/en_US.js +1 -0
  232. package/es/lang/zh_CN.js +1 -0
  233. package/es/lang/zh_TW.js +1 -0
  234. package/es/style/themes/default.scss +20 -13
  235. package/es/style/themes/rounded.scss +4 -9
  236. package/es/utils/core.d.ts +7 -1
  237. package/es/utils/hook.d.ts +75 -4
  238. package/es/utils/hook.js +155 -6
  239. package/lib/ele-admin-layout/index.d.ts +29 -24
  240. package/lib/ele-admin-layout/props.cjs +4 -1
  241. package/lib/ele-admin-layout/props.d.ts +15 -11
  242. package/lib/ele-admin-layout/style/index.scss +7 -2
  243. package/lib/ele-admin-layout/style/sidebar.scss +2 -0
  244. package/lib/ele-alert/index.cjs +3 -3
  245. package/lib/ele-alert/index.d.ts +15 -15
  246. package/lib/ele-alert/props.d.ts +9 -8
  247. package/lib/ele-app/components/message-body.cjs +2 -2
  248. package/lib/ele-app/components/message-body.d.ts +6 -5
  249. package/lib/ele-app/components/message-box-icon.d.ts +7 -6
  250. package/lib/ele-app/plus.d.ts +3 -0
  251. package/lib/ele-app/style/overwrite/input/index.scss +2 -0
  252. package/lib/ele-avatar-group/index.cjs +15 -15
  253. package/lib/ele-avatar-group/index.d.ts +19 -18
  254. package/lib/ele-avatar-group/props.d.ts +10 -7
  255. package/lib/ele-basic-select/index.cjs +30 -23
  256. package/lib/ele-basic-select/index.d.ts +22 -19
  257. package/lib/ele-basic-select/props.cjs +3 -1
  258. package/lib/ele-basic-select/props.d.ts +11 -6
  259. package/lib/ele-basic-select/util.cjs +13 -0
  260. package/lib/ele-basic-select/util.d.ts +6 -0
  261. package/lib/ele-bottom-bar/index.d.ts +4 -4
  262. package/lib/ele-bottom-bar/props.d.ts +3 -2
  263. package/lib/ele-breadcrumb/index.d.ts +3 -3
  264. package/lib/ele-breadcrumb/props.d.ts +1 -1
  265. package/lib/ele-card/index.d.ts +14 -14
  266. package/lib/ele-card/props.d.ts +8 -6
  267. package/lib/ele-check-card/components/card-item.d.ts +3 -2
  268. package/lib/ele-check-card/index.cjs +12 -7
  269. package/lib/ele-check-card/index.d.ts +5 -5
  270. package/lib/ele-check-card/props.d.ts +3 -2
  271. package/lib/ele-config-provider/index.d.ts +4 -4
  272. package/lib/ele-config-provider/props.d.ts +3 -3
  273. package/lib/ele-config-provider/types.d.ts +1 -0
  274. package/lib/ele-copyable/index.cjs +6 -6
  275. package/lib/ele-copyable/index.d.ts +12 -12
  276. package/lib/ele-copyable/props.d.ts +7 -5
  277. package/lib/ele-count-up/index.d.ts +1 -1
  278. package/lib/ele-cropper/components/cropper-tools.cjs +10 -10
  279. package/lib/ele-cropper/components/cropper-tools.d.ts +6 -5
  280. package/lib/ele-cropper/index.cjs +39 -39
  281. package/lib/ele-cropper/index.d.ts +16 -16
  282. package/lib/ele-cropper/props.d.ts +2 -1
  283. package/lib/ele-cropper-modal/index.cjs +3 -3
  284. package/lib/ele-cropper-modal/index.d.ts +5 -5
  285. package/lib/ele-cropper-modal/props.d.ts +1 -4
  286. package/lib/ele-data-table/index.d.ts +22 -22
  287. package/lib/ele-data-table/props.d.ts +16 -16
  288. package/lib/ele-data-table/style/index.scss +1 -1
  289. package/lib/ele-data-table/types.d.ts +2 -0
  290. package/lib/ele-data-table/util.cjs +6 -2
  291. package/lib/ele-drawer/index.cjs +18 -18
  292. package/lib/ele-drawer/index.d.ts +18 -18
  293. package/lib/ele-drawer/props.d.ts +11 -10
  294. package/lib/ele-dropdown/index.cjs +54 -48
  295. package/lib/ele-dropdown/index.d.ts +24 -24
  296. package/lib/ele-dropdown/props.d.ts +13 -12
  297. package/lib/ele-dropdown/types.d.ts +2 -0
  298. package/lib/ele-edit-tag/index.cjs +10 -2
  299. package/lib/ele-edit-tag/index.d.ts +21 -19
  300. package/lib/ele-edit-tag/props.cjs +3 -1
  301. package/lib/ele-edit-tag/props.d.ts +13 -8
  302. package/lib/ele-ellipsis/index.cjs +3 -3
  303. package/lib/ele-ellipsis/index.d.ts +6 -5
  304. package/lib/ele-ellipsis/props.d.ts +1 -1
  305. package/lib/ele-file-list/components/file-grid-item.cjs +15 -15
  306. package/lib/ele-file-list/components/file-grid-item.d.ts +5 -5
  307. package/lib/ele-file-list/components/file-grid.cjs +15 -15
  308. package/lib/ele-file-list/components/file-grid.d.ts +6 -6
  309. package/lib/ele-file-list/components/file-table-item.cjs +15 -15
  310. package/lib/ele-file-list/components/file-table-item.d.ts +5 -5
  311. package/lib/ele-file-list/components/file-table.cjs +19 -19
  312. package/lib/ele-file-list/components/file-table.d.ts +7 -7
  313. package/lib/ele-file-list/index.cjs +22 -22
  314. package/lib/ele-file-list/index.d.ts +10 -10
  315. package/lib/ele-file-list-tool/index.cjs +2 -2
  316. package/lib/ele-file-list-tool/index.d.ts +1 -1
  317. package/lib/ele-icon-select/components/icon-grid.cjs +6 -6
  318. package/lib/ele-icon-select/components/icon-grid.d.ts +10 -8
  319. package/lib/ele-icon-select/index.cjs +32 -28
  320. package/lib/ele-icon-select/index.d.ts +44 -43
  321. package/lib/ele-icon-select/props.cjs +2 -0
  322. package/lib/ele-icon-select/props.d.ts +18 -14
  323. package/lib/ele-loading/index.d.ts +4 -4
  324. package/lib/ele-loading/props.d.ts +3 -2
  325. package/lib/ele-map-picker/components/map-view.cjs +1 -0
  326. package/lib/ele-map-picker/components/map-view.d.ts +26 -28
  327. package/lib/ele-map-picker/index.d.ts +10 -10
  328. package/lib/ele-map-picker/props.d.ts +6 -5
  329. package/lib/ele-map-picker/style/index.scss +1 -1
  330. package/lib/ele-menus/index.cjs +15 -15
  331. package/lib/ele-menus/index.d.ts +2 -2
  332. package/lib/ele-menus/props.d.ts +1 -1
  333. package/lib/ele-menus/style/index.scss +5 -0
  334. package/lib/ele-menus/util.cjs +49 -26
  335. package/lib/ele-menus/util.d.ts +7 -0
  336. package/lib/ele-modal/index.cjs +46 -80
  337. package/lib/ele-modal/index.d.ts +30 -29
  338. package/lib/ele-modal/props.d.ts +14 -13
  339. package/lib/ele-modal/util.cjs +235 -132
  340. package/lib/ele-modal/util.d.ts +31 -24
  341. package/lib/ele-pagination/index.cjs +9 -8
  342. package/lib/ele-pagination/index.d.ts +20 -8
  343. package/lib/ele-pagination/props.d.ts +8 -2
  344. package/lib/ele-pagination/style/index.scss +70 -0
  345. package/lib/ele-popconfirm/index.cjs +15 -15
  346. package/lib/ele-popconfirm/index.d.ts +37 -47
  347. package/lib/ele-popconfirm/props.d.ts +18 -21
  348. package/lib/ele-popover/index.cjs +15 -15
  349. package/lib/ele-popover/index.d.ts +27 -37
  350. package/lib/ele-popover/props.cjs +1 -0
  351. package/lib/ele-popover/props.d.ts +11 -15
  352. package/lib/ele-printer/index.cjs +17 -20
  353. package/lib/ele-printer/index.d.ts +9 -9
  354. package/lib/ele-printer/props.d.ts +6 -5
  355. package/lib/ele-printer/style/index.scss +2 -2
  356. package/lib/ele-printer/types.d.ts +0 -2
  357. package/lib/ele-printer/util.cjs +111 -77
  358. package/lib/ele-printer/util.d.ts +7 -28
  359. package/lib/ele-pro-layout/index.cjs +2 -2
  360. package/lib/ele-pro-layout/index.d.ts +44 -48
  361. package/lib/ele-pro-layout/props.cjs +1 -1
  362. package/lib/ele-pro-layout/props.d.ts +17 -15
  363. package/lib/ele-pro-table/components/table-tools.cjs +225 -149
  364. package/lib/ele-pro-table/components/table-tools.d.ts +405 -35
  365. package/lib/ele-pro-table/components/tool-column-list.cjs +63 -36
  366. package/lib/ele-pro-table/components/tool-column-list.d.ts +21 -9
  367. package/lib/ele-pro-table/components/tool-column.cjs +86 -102
  368. package/lib/ele-pro-table/components/tool-column.d.ts +31 -44
  369. package/lib/ele-pro-table/components/tool-export.cjs +220 -212
  370. package/lib/ele-pro-table/components/tool-export.d.ts +37 -34
  371. package/lib/ele-pro-table/components/tool-print-body-cell.d.ts +5 -4
  372. package/lib/ele-pro-table/components/tool-print-header-cell.d.ts +5 -4
  373. package/lib/ele-pro-table/components/tool-print.cjs +377 -366
  374. package/lib/ele-pro-table/components/tool-print.d.ts +47 -43
  375. package/lib/ele-pro-table/index.cjs +100 -73
  376. package/lib/ele-pro-table/index.d.ts +1020 -81
  377. package/lib/ele-pro-table/props.cjs +4 -2
  378. package/lib/ele-pro-table/props.d.ts +18 -19
  379. package/lib/ele-pro-table/style/index.scss +44 -12
  380. package/lib/ele-pro-table/types.d.ts +54 -0
  381. package/lib/ele-pro-table/util.cjs +186 -94
  382. package/lib/ele-pro-table/util.d.ts +84 -34
  383. package/lib/ele-qr-code/components/canvas-render.cjs +146 -0
  384. package/lib/ele-qr-code/components/canvas-render.d.ts +67 -0
  385. package/lib/ele-qr-code/index.cjs +32 -135
  386. package/lib/ele-qr-code/index.d.ts +5 -9
  387. package/lib/ele-qr-code/props.cjs +3 -1
  388. package/lib/ele-qr-code/props.d.ts +5 -2
  389. package/lib/ele-qr-code/types.d.ts +5 -0
  390. package/lib/ele-qr-code-svg/index.cjs +10 -13
  391. package/lib/ele-qr-code-svg/index.d.ts +6 -5
  392. package/lib/ele-segmented/index.cjs +6 -3
  393. package/lib/ele-segmented/index.d.ts +1 -1
  394. package/lib/ele-split-panel/index.cjs +3 -3
  395. package/lib/ele-split-panel/index.d.ts +8 -8
  396. package/lib/ele-split-panel/props.d.ts +4 -3
  397. package/lib/ele-steps/index.d.ts +2 -2
  398. package/lib/ele-steps/props.d.ts +2 -2
  399. package/lib/ele-tab-wrap/components/tab-dropdown.cjs +3 -3
  400. package/lib/ele-tab-wrap/components/tab-dropdown.d.ts +1 -1
  401. package/lib/ele-table/index.d.ts +2 -2
  402. package/lib/ele-table/props.d.ts +2 -1
  403. package/lib/ele-table-select/index.cjs +62 -54
  404. package/lib/ele-table-select/index.d.ts +29 -27
  405. package/lib/ele-table-select/props.cjs +2 -0
  406. package/lib/ele-table-select/props.d.ts +11 -7
  407. package/lib/ele-tabs/index.cjs +132 -85
  408. package/lib/ele-tabs/index.d.ts +19 -34
  409. package/lib/ele-tabs/props.cjs +3 -1
  410. package/lib/ele-tabs/props.d.ts +10 -24
  411. package/lib/ele-tabs/style/index.scss +42 -2
  412. package/lib/ele-tabs/types.d.ts +2 -11
  413. package/lib/ele-text/index.d.ts +2 -2
  414. package/lib/ele-text/props.d.ts +2 -1
  415. package/lib/ele-tool/index.cjs +31 -31
  416. package/lib/ele-tool/index.d.ts +11 -5
  417. package/lib/ele-tool/props.cjs +3 -1
  418. package/lib/ele-tool/props.d.ts +4 -1
  419. package/lib/ele-tool/style/index.cjs +0 -1
  420. package/lib/ele-toolbar/index.cjs +42 -3
  421. package/lib/ele-toolbar/index.d.ts +3253 -7
  422. package/lib/ele-toolbar/props.cjs +2 -0
  423. package/lib/ele-toolbar/props.d.ts +10 -5
  424. package/lib/ele-toolbar/style/index.cjs +1 -0
  425. package/lib/ele-toolbar/types.d.ts +15 -0
  426. package/lib/ele-tooltip/index.cjs +25 -25
  427. package/lib/ele-tooltip/index.d.ts +22 -21
  428. package/lib/ele-tooltip/props.d.ts +7 -6
  429. package/lib/ele-tour/index.cjs +10 -10
  430. package/lib/ele-tour/index.d.ts +4 -4
  431. package/lib/ele-tree-select/index.cjs +32 -29
  432. package/lib/ele-tree-select/index.d.ts +27 -27
  433. package/lib/ele-tree-select/props.cjs +3 -1
  434. package/lib/ele-tree-select/props.d.ts +12 -8
  435. package/lib/ele-upload-list/components/list-item.cjs +7 -7
  436. package/lib/ele-upload-list/components/list-item.d.ts +3 -3
  437. package/lib/ele-upload-list/index.cjs +13 -13
  438. package/lib/ele-upload-list/index.d.ts +11 -13
  439. package/lib/ele-upload-list/props.d.ts +4 -3
  440. package/lib/ele-upload-list/style/index.scss +4 -0
  441. package/lib/ele-virtual-table/components/body-cell.cjs +24 -24
  442. package/lib/ele-virtual-table/components/body-cell.d.ts +19 -35
  443. package/lib/ele-virtual-table/components/body-row.cjs +21 -21
  444. package/lib/ele-virtual-table/components/body-row.d.ts +20 -36
  445. package/lib/ele-virtual-table/components/cell-checkbox.cjs +3 -3
  446. package/lib/ele-virtual-table/components/cell-checkbox.d.ts +4 -3
  447. package/lib/ele-virtual-table/components/cell-filter.cjs +18 -18
  448. package/lib/ele-virtual-table/components/cell-filter.d.ts +11 -11
  449. package/lib/ele-virtual-table/components/footer-row.cjs +3 -3
  450. package/lib/ele-virtual-table/components/footer-row.d.ts +4 -4
  451. package/lib/ele-virtual-table/components/header-cell.cjs +15 -15
  452. package/lib/ele-virtual-table/components/header-cell.d.ts +12 -12
  453. package/lib/ele-virtual-table/components/header-row.cjs +15 -15
  454. package/lib/ele-virtual-table/components/header-row.d.ts +12 -12
  455. package/lib/ele-virtual-table/index.cjs +50 -48
  456. package/lib/ele-virtual-table/index.d.ts +36 -35
  457. package/lib/ele-virtual-table/props.d.ts +11 -11
  458. package/lib/ele-virtual-table/util.cjs +3 -3
  459. package/lib/ele-watermark/index.cjs +1 -0
  460. package/lib/ele-watermark/index.d.ts +5 -4
  461. package/lib/ele-watermark/props.d.ts +2 -1
  462. package/lib/ele-xg-player/index.d.ts +3 -3
  463. package/lib/icons/SizeCompactOutlined.cjs +33 -0
  464. package/lib/icons/SizeCompactOutlined.d.ts +2 -0
  465. package/lib/icons/SizeSlackOutlined.cjs +33 -0
  466. package/lib/icons/SizeSlackOutlined.d.ts +2 -0
  467. package/lib/icons/index.cjs +4 -0
  468. package/lib/icons/index.d.ts +2 -0
  469. package/lib/lang/en_US.cjs +1 -0
  470. package/lib/lang/zh_CN.cjs +1 -0
  471. package/lib/lang/zh_TW.cjs +1 -0
  472. package/lib/style/themes/default.scss +20 -13
  473. package/lib/style/themes/rounded.scss +4 -9
  474. package/lib/utils/core.d.ts +7 -1
  475. package/lib/utils/hook.cjs +154 -5
  476. package/lib/utils/hook.d.ts +75 -4
  477. package/package.json +14 -13
@@ -22,30 +22,30 @@ const _sfc_main = defineComponent({
22
22
  const hide = () => {
23
23
  tooltipRef.value && tooltipRef.value.hide();
24
24
  };
25
- const onUpdateVisible = (visible) => {
25
+ const handleUpdateVisible = (visible) => {
26
26
  emit("update:visible", visible);
27
27
  };
28
- const onPopBeforeEnter = () => {
28
+ const handlePopBeforeEnter = () => {
29
29
  emit("before-enter");
30
30
  };
31
- const onPopBeforeLeave = () => {
31
+ const handlePopBeforeLeave = () => {
32
32
  emit("before-leave");
33
33
  };
34
- const onPopAfterEnter = () => {
34
+ const handlePopAfterEnter = () => {
35
35
  emit("after-enter");
36
36
  };
37
- const onPopAfterLeave = () => {
37
+ const handlePopAfterLeave = () => {
38
38
  emit("after-leave");
39
39
  };
40
40
  return {
41
41
  tooltipRef,
42
42
  tooltipProps,
43
43
  hide,
44
- onUpdateVisible,
45
- onPopBeforeEnter,
46
- onPopBeforeLeave,
47
- onPopAfterEnter,
48
- onPopAfterLeave
44
+ handleUpdateVisible,
45
+ handlePopBeforeEnter,
46
+ handlePopBeforeLeave,
47
+ handlePopAfterEnter,
48
+ handlePopAfterLeave
49
49
  };
50
50
  }
51
51
  });
@@ -61,11 +61,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
61
61
  return openBlock(), createBlock(_component_EleTooltip, mergeProps({ tabindex: _ctx.tabindex }, _ctx.tooltipProps, {
62
62
  ref: "tooltipRef",
63
63
  isPopover: true,
64
- "onUpdate:visible": _ctx.onUpdateVisible,
65
- onBeforeShow: _ctx.onPopBeforeEnter,
66
- onBeforeHide: _ctx.onPopBeforeLeave,
67
- onShow: _ctx.onPopAfterEnter,
68
- onHide: _ctx.onPopAfterLeave
64
+ "onUpdate:visible": _ctx.handleUpdateVisible,
65
+ onBeforeShow: _ctx.handlePopBeforeEnter,
66
+ onBeforeHide: _ctx.handlePopBeforeLeave,
67
+ onShow: _ctx.handlePopAfterEnter,
68
+ onHide: _ctx.handlePopAfterLeave
69
69
  }), {
70
70
  body: withCtx(() => [
71
71
  createElementVNode("div", {
@@ -1,4 +1,5 @@
1
1
  import { PropType, ExtractPropTypes } from 'vue';
2
+ import { StyleValue } from '../ele-app/types';
2
3
 
3
4
  /**
4
5
  * 属性
@@ -11,25 +12,19 @@ export declare const popoverProps: {
11
12
  /** 自定义主体类名 */
12
13
  bodyClass: StringConstructor;
13
14
  /** 自定义主体样式 */
14
- bodyStyle: PropType<Partial<import('vue').CSSProperties>>;
15
+ bodyStyle: PropType<StyleValue>;
15
16
  /** 自定义标题样式 */
16
- titleStyle: PropType<Partial<import('vue').CSSProperties>>;
17
+ titleStyle: PropType<StyleValue>;
17
18
  /** 自定义内容样式 */
18
- contentStyle: PropType<Partial<import('vue').CSSProperties>>;
19
+ contentStyle: PropType<StyleValue>;
19
20
  width: import('element-plus/es/utils/index').EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 150, boolean>;
20
21
  title: StringConstructor;
21
- popperStyle: {
22
- readonly type: PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => string | false | import('vue').CSSProperties | import('vue').StyleValue[]) | (() => import('vue').StyleValue) | ((new (...args: any[]) => string | false | import('vue').CSSProperties | import('vue').StyleValue[]) | (() => import('vue').StyleValue))[], unknown, unknown>>;
23
- readonly required: false;
24
- readonly validator: ((val: unknown) => boolean) | undefined;
25
- __epPropKey: true;
26
- };
27
22
  showArrow: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
28
23
  disabled: BooleanConstructor;
29
- trigger: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import('element-plus').TooltipTriggerType[]) | (() => import('element-plus/es/utils/typescript').Arrayable<import('element-plus').TooltipTriggerType>) | ((new (...args: any[]) => "hover" | "focus" | "click" | "contextmenu" | import('element-plus').TooltipTriggerType[]) | (() => import('element-plus/es/utils/typescript').Arrayable<import('element-plus').TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
24
+ trigger: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => import('element-plus/es/utils/typescript').Arrayable<import('element-plus').TooltipTriggerType> & {}) | (() => import('element-plus/es/utils/typescript').Arrayable<import('element-plus').TooltipTriggerType>) | ((new (...args: any[]) => import('element-plus/es/utils/typescript').Arrayable<import('element-plus').TooltipTriggerType> & {}) | (() => import('element-plus/es/utils/typescript').Arrayable<import('element-plus').TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
30
25
  content: import('element-plus/es/utils/index').EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
31
26
  persistent: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
32
- visible: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => boolean) | (() => boolean | null) | ((new (...args: any[]) => boolean) | (() => boolean | null))[], unknown, unknown, null, boolean>;
27
+ visible: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => (boolean | null) & {}) | (() => boolean | null) | ((new (...args: any[]) => (boolean | null) & {}) | (() => boolean | null))[], unknown, unknown, null, boolean>;
33
28
  teleported: import('element-plus/es/utils/index').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
34
29
  effect: {
35
30
  readonly default: "light";
@@ -46,18 +41,19 @@ export declare const popoverProps: {
46
41
  readonly __epPropKey: true;
47
42
  };
48
43
  offset: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, undefined, boolean>;
49
- placement: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => "bottom" | "left" | "right" | "top" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import('element-plus').Placement) | ((new (...args: any[]) => "bottom" | "left" | "right" | "top" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import('element-plus').Placement))[], unknown, unknown, "bottom", boolean>;
44
+ placement: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => import('element-plus').Placement & {}) | (() => import('element-plus').Placement) | ((new (...args: any[]) => import('element-plus').Placement & {}) | (() => import('element-plus').Placement))[], unknown, unknown, "bottom", boolean>;
50
45
  popperOptions: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => Partial<import('element-plus').Options>) | (() => Partial<import('element-plus').Options>) | ((new (...args: any[]) => Partial<import('element-plus').Options>) | (() => Partial<import('element-plus').Options>))[], unknown, unknown, () => {}, boolean>;
51
46
  showAfter: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
52
47
  hideAfter: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, 200, boolean>;
53
48
  autoClose: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
54
- tabindex: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, 0, boolean>;
49
+ tabindex: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown, 0, boolean>;
50
+ popperStyle: PropType<StyleValue>;
55
51
  popperClass: StringConstructor;
56
52
  className: StringConstructor;
57
53
  arrowOffset: import('element-plus/es/utils/index').EpPropFinalized<NumberConstructor, unknown, unknown, 5, boolean>;
58
54
  triggerKeys: import('element-plus/es/utils/index').EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | ((new (...args: any[]) => string[]) | (() => string[]))[], unknown, unknown, () => string[], boolean>;
59
55
  virtualRef: {
60
- readonly type: PropType<import('element-plus').Measurable>;
56
+ readonly type: import('vue').PropType<import('element-plus').Measurable>;
61
57
  readonly required: false;
62
58
  readonly validator: ((val: unknown) => boolean) | undefined;
63
59
  __epPropKey: true;
@@ -65,7 +61,7 @@ export declare const popoverProps: {
65
61
  virtualTriggering: BooleanConstructor;
66
62
  ariaLabel: StringConstructor;
67
63
  appendTo: {
68
- readonly type: PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | ((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement))[], unknown, unknown>>;
64
+ readonly type: import('vue').PropType<import('element-plus/es/utils/index').EpPropMergeType<(new (...args: any[]) => (string | HTMLElement) & {}) | (() => string | HTMLElement) | ((new (...args: any[]) => (string | HTMLElement) & {}) | (() => string | HTMLElement))[], unknown, unknown>>;
69
65
  readonly required: false;
70
66
  readonly validator: ((val: unknown) => boolean) | undefined;
71
67
  __epPropKey: true;
@@ -4,6 +4,7 @@ import { tooltipProps } from "../ele-tooltip/props";
4
4
  const normalizeProps = omit(popoverProps$1, ["onUpdate:visible"]);
5
5
  const popoverProps = {
6
6
  ...omit(tooltipProps, ["rawContent"]),
7
+ popperStyle: [String, Array, Object],
7
8
  popperClass: String,
8
9
  ...normalizeProps,
9
10
  transition: {
@@ -1,11 +1,11 @@
1
1
  declare const _default: import('vue').DefineComponent<{
2
2
  modelValue: BooleanConstructor;
3
- headerStyle: import('vue').PropType<Partial<import('vue').CSSProperties>>;
4
- bodyStyle: import('vue').PropType<Partial<import('vue').CSSProperties>>;
5
- footerStyle: import('vue').PropType<Partial<import('vue').CSSProperties>>;
3
+ headerStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
4
+ bodyStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
5
+ footerStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
6
6
  title: StringConstructor;
7
7
  margin: (NumberConstructor | StringConstructor)[];
8
- direction: import('vue').PropType<string | null>;
8
+ direction: import('vue').PropType<import('./types').PrintDirection | null>;
9
9
  orientation: import('vue').PropType<import('./types').PrintOrientation | null>;
10
10
  target: import('vue').PropType<import('./types').PrintTarget | null>;
11
11
  static: BooleanConstructor;
@@ -16,16 +16,16 @@ declare const _default: import('vue').DefineComponent<{
16
16
  isStatic: import('vue').ComputedRef<boolean>;
17
17
  print: (options?: any) => void;
18
18
  }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
19
- 'update:modelValue': (_value: boolean) => boolean; /** 打印 */
19
+ 'update:modelValue': (_value: boolean) => boolean;
20
20
  done: () => boolean;
21
21
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
22
22
  modelValue: BooleanConstructor;
23
- headerStyle: import('vue').PropType<Partial<import('vue').CSSProperties>>;
24
- bodyStyle: import('vue').PropType<Partial<import('vue').CSSProperties>>;
25
- footerStyle: import('vue').PropType<Partial<import('vue').CSSProperties>>;
23
+ headerStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
24
+ bodyStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
25
+ footerStyle: import('vue').PropType<import('../ele-app/types').StyleValue>;
26
26
  title: StringConstructor;
27
27
  margin: (NumberConstructor | StringConstructor)[];
28
- direction: import('vue').PropType<string | null>;
28
+ direction: import('vue').PropType<import('./types').PrintDirection | null>;
29
29
  orientation: import('vue').PropType<import('./types').PrintOrientation | null>;
30
30
  target: import('vue').PropType<import('./types').PrintTarget | null>;
31
31
  static: BooleanConstructor;
@@ -1,6 +1,6 @@
1
- import { defineComponent, shallowRef, ref, computed, watch, nextTick, resolveComponent, openBlock, createBlock, Teleport, createElementVNode, normalizeClass, createElementBlock, normalizeStyle, renderSlot, createCommentVNode, createVNode, withCtx } from "vue";
1
+ import { defineComponent, shallowRef, ref, computed, watch, onMounted, nextTick, resolveComponent, openBlock, createBlock, Teleport, createElementVNode, normalizeClass, createElementBlock, normalizeStyle, renderSlot, createCommentVNode, createVNode, withCtx } from "vue";
2
2
  import ReceiverView from "../ele-config-provider/components/receiver-view";
3
- import { usePrinter, getPrintContainer, mergeOptions, doPrintOnFrame, doPrint } from "./util";
3
+ import { usePrinter, getPrintContainer, mergeOptions } from "./util";
4
4
  import { printerProps, printerEmits } from "./props";
5
5
  const _sfc_main = defineComponent({
6
6
  name: "ElePrinter",
@@ -8,38 +8,31 @@ const _sfc_main = defineComponent({
8
8
  props: printerProps,
9
9
  emits: printerEmits,
10
10
  setup(props, { emit }) {
11
- const { printId } = usePrinter(() => {
11
+ const doPrint = usePrinter(() => {
12
+ visible.value = false;
12
13
  updateModelValue(false);
13
- onDone();
14
+ handleDone();
14
15
  });
15
16
  const container = shallowRef(getPrintContainer());
16
17
  const visible = ref(false);
17
- const isStatic = computed(() => {
18
- return props.static;
19
- });
18
+ const isStatic = computed(() => props.static);
20
19
  const print = (options) => {
20
+ if (visible.value) {
21
+ return;
22
+ }
21
23
  visible.value = true;
22
24
  nextTick(() => {
23
25
  const option = {
24
- printId,
25
26
  title: props.title,
26
27
  margin: props.margin,
27
28
  direction: props.direction,
28
29
  orientation: props.orientation,
29
30
  options: mergeOptions(props.options, options)
30
31
  };
31
- if (props.target === "_iframe") {
32
- doPrintOnFrame(option);
33
- visible.value = false;
34
- } else {
35
- doPrint(option);
36
- visible.value = false;
37
- updateModelValue(false);
38
- onDone();
39
- }
32
+ doPrint(option, props.target);
40
33
  });
41
34
  };
42
- const onDone = () => {
35
+ const handleDone = () => {
43
36
  emit("done");
44
37
  };
45
38
  const updateModelValue = (value) => {
@@ -47,13 +40,17 @@ const _sfc_main = defineComponent({
47
40
  };
48
41
  watch(
49
42
  () => props.modelValue,
50
- (value) => {
51
- if (value) {
43
+ (modelValue) => {
44
+ if (modelValue) {
52
45
  print();
53
46
  }
54
- },
55
- { immediate: true }
47
+ }
56
48
  );
49
+ onMounted(() => {
50
+ if (props.modelValue) {
51
+ print();
52
+ }
53
+ });
57
54
  return { container, visible, isStatic, print };
58
55
  }
59
56
  });
@@ -1,5 +1,6 @@
1
1
  import { PropType, ExtractPropTypes } from 'vue';
2
- import { PrintOrientation, PrintTarget } from './types';
2
+ import { StyleValue } from '../ele-app/types';
3
+ import { PrintDirection, PrintOrientation, PrintTarget } from './types';
3
4
 
4
5
  /**
5
6
  * 属性
@@ -8,17 +9,17 @@ export declare const printerProps: {
8
9
  /** 是否打印 */
9
10
  modelValue: BooleanConstructor;
10
11
  /** 页眉样式 */
11
- headerStyle: PropType<Partial<import('vue').CSSProperties>>;
12
+ headerStyle: PropType<StyleValue>;
12
13
  /** 内容样式 */
13
- bodyStyle: PropType<Partial<import('vue').CSSProperties>>;
14
+ bodyStyle: PropType<StyleValue>;
14
15
  /** 页脚样式 */
15
- footerStyle: PropType<Partial<import('vue').CSSProperties>>;
16
+ footerStyle: PropType<StyleValue>;
16
17
  /** 标题 */
17
18
  title: StringConstructor;
18
19
  /** 页间距 */
19
20
  margin: (StringConstructor | NumberConstructor)[];
20
21
  /** 纸张方向 */
21
- direction: PropType<string | null>;
22
+ direction: PropType<PrintDirection | null>;
22
23
  /** 纸张旋转 */
23
24
  orientation: PropType<PrintOrientation | null>;
24
25
  /** 打印位置 */
@@ -46,10 +46,10 @@ html.ele-printing > body {
46
46
  background: #fff !important;
47
47
  height: auto !important;
48
48
  min-height: auto !important;
49
- max-height: auto !important;
49
+ max-height: none !important;
50
50
  width: auto !important;
51
51
  min-width: auto !important;
52
- max-width: auto !important;
52
+ max-width: none !important;
53
53
  overflow: visible !important;
54
54
  }
55
55
 
@@ -17,8 +17,6 @@ export type PrintTarget = '_self' | '_blank' | '_iframe';
17
17
  * 打印参数
18
18
  */
19
19
  export interface PrintOption {
20
- /** id */
21
- printId: string;
22
20
  /** 页面标题 */
23
21
  title?: string;
24
22
  /** 页间距 */
@@ -1,44 +1,23 @@
1
- import { PrintOption, PrintPdfOption } from './types';
1
+ import { PrintOption, PrintTarget, PrintPdfOption } from './types';
2
2
 
3
3
  export declare const printContainerId = "ele-printer-container";
4
4
  export declare const printFrameId = "ele-printer-iframe";
5
5
  export declare const printingClass = "ele-printing";
6
- /**
7
- * 创建并获取打印容器
8
- */
9
- export declare function getPrintContainer(): Element;
10
- /**
11
- * 打印
12
- */
13
- export declare function doPrint(option: PrintOption): void;
14
- /**
15
- * 在子窗口中打印
16
- */
17
- export declare function doPrintOnFrame(opt: PrintOption): Window | undefined;
18
- /**
19
- * 创建并获取打印子窗口
20
- */
21
- export declare function getPrintFrame(): HTMLIFrameElement;
22
- /**
23
- * 移除打印子窗口
24
- */
25
- export declare function removePrintFrame(): void;
26
- /**
27
- * 生成打印设置的样式
28
- */
29
- export declare function getOptionCss(opt: PrintOption): string;
30
6
  /**
31
7
  * 合并打印方法参数
32
8
  * @param options 参数
33
9
  * @param userOptions 自定义参数
34
10
  */
35
11
  export declare function mergeOptions(options?: any, userOptions?: any): any;
12
+ /**
13
+ * 创建并获取打印容器
14
+ */
15
+ export declare function getPrintContainer(): Element;
36
16
  /**
37
17
  * usePrinter
18
+ * @param done 打印结束回调
38
19
  */
39
- export declare function usePrinter(done: () => void): {
40
- printId: string;
41
- };
20
+ export declare function usePrinter(done: () => void): (option: PrintOption, target?: PrintTarget | null) => void;
42
21
  /**
43
22
  * 打印 pdf
44
23
  * @param option 打印参数
@@ -1,8 +1,15 @@
1
1
  import { onBeforeUnmount } from "vue";
2
- import { uuid } from "../utils/core";
2
+ import { useTimer } from "../utils/hook";
3
3
  const printContainerId = "ele-printer-container";
4
4
  const printFrameId = "ele-printer-iframe";
5
5
  const printingClass = "ele-printing";
6
+ let printIdNum = 0;
7
+ function mergeOptions(options, userOptions) {
8
+ if (options == null) {
9
+ return userOptions;
10
+ }
11
+ return Object.assign({}, options, userOptions);
12
+ }
6
13
  function getPrintContainer() {
7
14
  const container = document.getElementById(printContainerId);
8
15
  if (container) {
@@ -13,28 +20,51 @@ function getPrintContainer() {
13
20
  document.body.appendChild(elem);
14
21
  return elem;
15
22
  }
16
- function doPrint(option) {
17
- const $html = document.querySelector("html");
18
- if ($html) {
19
- $html.classList.add(printingClass);
20
- const elem = document.createElement("style");
21
- elem.setAttribute("type", "text/css");
22
- elem.setAttribute("media", "print");
23
- elem.innerHTML = getOptionCss(option);
24
- document.body.appendChild(elem);
25
- const title = document.title;
26
- if (option.title != null && option.title !== "") {
27
- document.title = option.title;
23
+ function getOptionCss(opt) {
24
+ const css = ["@page {"];
25
+ if (opt.margin != null && opt.margin !== "") {
26
+ const v = typeof opt.margin === "number" ? opt.margin + "px" : opt.margin;
27
+ css.push(`margin: ${v};`);
28
+ }
29
+ if (opt.direction != null && opt.direction !== "") {
30
+ css.push(`size: ${opt.direction};`);
31
+ }
32
+ if (opt.orientation != null && opt.orientation !== "") {
33
+ css.push(`page-orientation: ${opt.orientation};`);
34
+ }
35
+ css.push("}");
36
+ return css.join(" ");
37
+ }
38
+ function removePrintFrame() {
39
+ const pFrame = document.getElementById(printFrameId);
40
+ if (pFrame) {
41
+ if (pFrame.parentNode) {
42
+ pFrame.parentNode.removeChild(pFrame);
28
43
  }
29
- window.print(option.options);
30
- $html.classList.remove(printingClass);
31
- document.body.removeChild(elem);
32
- if (option.title != null) {
33
- document.title = title;
44
+ const url = pFrame.getAttribute("src");
45
+ if (url) {
46
+ try {
47
+ window.URL.revokeObjectURL(url);
48
+ } catch (e) {
49
+ console.error(e);
50
+ }
34
51
  }
35
52
  }
36
53
  }
37
- function doPrintOnFrame(opt) {
54
+ function getPrintFrame() {
55
+ removePrintFrame();
56
+ const elem = document.createElement("iframe");
57
+ elem.id = printFrameId;
58
+ elem.style.width = "66px";
59
+ elem.style.height = "66px";
60
+ elem.style.position = "fixed";
61
+ elem.style.left = "-666px";
62
+ elem.style.top = "-666px";
63
+ document.body.appendChild(elem);
64
+ elem.focus();
65
+ return elem;
66
+ }
67
+ function doPrintOnFrame(opt, printId) {
38
68
  var _a;
39
69
  const pFrame = getPrintFrame();
40
70
  const pWin = pFrame.contentWindow;
@@ -68,7 +98,7 @@ function doPrintOnFrame(opt) {
68
98
  document.title = '${opt.title}';
69
99
  }
70
100
  window.print(${printOption});
71
- window.parent.postMessage('elePrintDone_${opt.printId}', '*');
101
+ window.parent.postMessage('elePrintDone_${printId}', '*');
72
102
  };
73
103
  <\/script>
74
104
  `;
@@ -78,80 +108,89 @@ function doPrintOnFrame(opt) {
78
108
  pDoc.close();
79
109
  return pWin;
80
110
  }
81
- function getPrintFrame() {
82
- removePrintFrame();
83
- const elem = document.createElement("iframe");
84
- elem.id = printFrameId;
85
- elem.style.width = "0px";
86
- elem.style.height = "0px";
87
- elem.style.position = "fixed";
88
- elem.style.visibility = "hidden";
89
- document.body.appendChild(elem);
90
- elem.focus();
91
- return elem;
92
- }
93
- function removePrintFrame() {
94
- const pFrame = document.getElementById(printFrameId);
95
- if (pFrame && pFrame.parentNode) {
96
- pFrame.parentNode.removeChild(pFrame);
97
- }
98
- }
99
- function getOptionCss(opt) {
100
- const css = ["@page {"];
101
- if (opt.margin != null && opt.margin !== "") {
102
- const v = typeof opt.margin === "number" ? opt.margin + "px" : opt.margin;
103
- css.push(`margin: ${v};`);
104
- }
105
- if (opt.direction != null && opt.direction !== "") {
106
- css.push(`size: ${opt.direction};`);
107
- }
108
- if (opt.orientation != null && opt.orientation !== "") {
109
- css.push(`page-orientation: ${opt.orientation};`);
110
- }
111
- css.push("}");
112
- return css.join(" ");
113
- }
114
- function mergeOptions(options, userOptions) {
115
- if (options == null) {
116
- return userOptions;
117
- }
118
- return Object.assign({}, options, userOptions);
119
- }
120
111
  function usePrinter(done) {
121
- const printId = uuid(8);
122
- const onMessage = (e) => {
123
- if (e.data === `elePrintDone_${printId}`) {
124
- removePrintFrame();
112
+ printIdNum++;
113
+ const printId = printIdNum;
114
+ const [startPrintTimer] = useTimer(400);
115
+ const doPrint = (option, target) => {
116
+ if (target === "_iframe") {
117
+ doPrintOnFrame(option, printId);
118
+ return;
119
+ }
120
+ const $html = document.querySelector("html");
121
+ if (!$html) {
125
122
  done && done();
123
+ return;
124
+ }
125
+ $html.classList.add(printingClass);
126
+ const elem = document.createElement("style");
127
+ elem.setAttribute("type", "text/css");
128
+ elem.setAttribute("media", "print");
129
+ elem.innerHTML = getOptionCss(option);
130
+ document.body.appendChild(elem);
131
+ const title = document.title;
132
+ if (option.title != null && option.title !== "") {
133
+ document.title = option.title;
134
+ }
135
+ window.print(option.options);
136
+ startPrintTimer(() => {
137
+ $html.classList.remove(printingClass);
138
+ document.body.removeChild(elem);
139
+ if (option.title != null) {
140
+ document.title = title;
141
+ }
142
+ done && done();
143
+ });
144
+ };
145
+ const handleMessage = (e) => {
146
+ if (e.data === `elePrintDone_${printId}`) {
147
+ startPrintTimer(() => {
148
+ removePrintFrame();
149
+ done && done();
150
+ });
126
151
  }
127
152
  };
128
- window.addEventListener("message", onMessage);
129
153
  onBeforeUnmount(() => {
130
- window.removeEventListener("message", onMessage);
154
+ window.removeEventListener("message", handleMessage);
131
155
  });
132
- return { printId };
156
+ window.addEventListener("message", handleMessage);
157
+ return doPrint;
133
158
  }
134
159
  function printPdf(option) {
135
160
  const pFrame = getPrintFrame();
136
161
  pFrame.onload = () => {
137
162
  const url = pFrame.getAttribute("src");
138
- if (!!url) {
139
- pFrame.focus();
163
+ if (!url) {
164
+ return;
165
+ }
166
+ pFrame.focus();
167
+ try {
140
168
  pFrame.contentWindow && pFrame.contentWindow.print(option.options);
141
169
  option.done && option.done();
142
- URL.revokeObjectURL(url);
170
+ window.URL.revokeObjectURL(url);
171
+ return;
172
+ } catch (e) {
173
+ console.error(e);
174
+ }
175
+ if (!option.arraybuffer && option.url) {
176
+ window.URL.revokeObjectURL(url);
177
+ window.open(option.url);
178
+ } else {
179
+ window.open(url);
143
180
  }
181
+ option.done && option.done();
144
182
  };
145
- const doPrint2 = (buffer) => {
183
+ const doPrint = (buffer) => {
146
184
  const blob = new window.Blob([buffer], { type: "application/pdf" });
147
185
  if (window.navigator && window.navigator["msSaveOrOpenBlob"]) {
148
186
  window.navigator["msSaveOrOpenBlob"](blob, "print.pdf");
187
+ option.done && option.done();
149
188
  return;
150
189
  }
151
190
  pFrame.setAttribute("src", window.URL.createObjectURL(blob));
152
191
  };
153
192
  if (option.arraybuffer) {
154
- doPrint2(option.arraybuffer);
193
+ doPrint(option.arraybuffer);
155
194
  return;
156
195
  }
157
196
  if (option.url) {
@@ -160,7 +199,7 @@ function printPdf(option) {
160
199
  req.responseType = "arraybuffer";
161
200
  req.onload = () => {
162
201
  if ([200, 201].indexOf(req.status) !== -1) {
163
- doPrint2(req.response);
202
+ doPrint(req.response);
164
203
  return;
165
204
  }
166
205
  option.error && option.error(req.status, req.statusText);
@@ -169,16 +208,11 @@ function printPdf(option) {
169
208
  }
170
209
  }
171
210
  export {
172
- doPrint,
173
- doPrintOnFrame,
174
- getOptionCss,
175
211
  getPrintContainer,
176
- getPrintFrame,
177
212
  mergeOptions,
178
213
  printContainerId,
179
214
  printFrameId,
180
215
  printPdf,
181
216
  printingClass,
182
- removePrintFrame,
183
217
  usePrinter
184
218
  };