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.
- package/es/ele-admin-layout/index.d.ts +29 -24
- package/es/ele-admin-layout/props.d.ts +15 -11
- package/es/ele-admin-layout/props.js +4 -1
- package/es/ele-admin-layout/style/index.scss +7 -2
- package/es/ele-admin-layout/style/sidebar.scss +2 -0
- package/es/ele-alert/index.d.ts +15 -15
- package/es/ele-alert/index.js +3 -3
- package/es/ele-alert/props.d.ts +9 -8
- package/es/ele-app/components/message-body.d.ts +6 -5
- package/es/ele-app/components/message-body.js +2 -2
- package/es/ele-app/components/message-box-icon.d.ts +7 -6
- package/es/ele-app/plus.d.ts +3 -0
- package/es/ele-app/style/overwrite/input/index.scss +2 -0
- package/es/ele-avatar-group/index.d.ts +19 -18
- package/es/ele-avatar-group/index.js +15 -15
- package/es/ele-avatar-group/props.d.ts +10 -7
- package/es/ele-basic-select/index.d.ts +22 -19
- package/es/ele-basic-select/index.js +30 -23
- package/es/ele-basic-select/props.d.ts +11 -6
- package/es/ele-basic-select/props.js +3 -1
- package/es/ele-basic-select/util.d.ts +6 -0
- package/es/ele-basic-select/util.js +13 -0
- package/es/ele-bottom-bar/index.d.ts +4 -4
- package/es/ele-bottom-bar/props.d.ts +3 -2
- package/es/ele-breadcrumb/index.d.ts +3 -3
- package/es/ele-breadcrumb/props.d.ts +1 -1
- package/es/ele-card/index.d.ts +14 -14
- package/es/ele-card/props.d.ts +8 -6
- package/es/ele-check-card/components/card-item.d.ts +3 -2
- package/es/ele-check-card/index.d.ts +5 -5
- package/es/ele-check-card/index.js +12 -7
- package/es/ele-check-card/props.d.ts +3 -2
- package/es/ele-config-provider/index.d.ts +4 -4
- package/es/ele-config-provider/props.d.ts +3 -3
- package/es/ele-config-provider/types.d.ts +1 -0
- package/es/ele-copyable/index.d.ts +12 -12
- package/es/ele-copyable/index.js +6 -6
- package/es/ele-copyable/props.d.ts +7 -5
- package/es/ele-count-up/index.d.ts +1 -1
- package/es/ele-cropper/components/cropper-tools.d.ts +6 -5
- package/es/ele-cropper/components/cropper-tools.js +10 -10
- package/es/ele-cropper/index.d.ts +16 -16
- package/es/ele-cropper/index.js +39 -39
- package/es/ele-cropper/props.d.ts +2 -1
- package/es/ele-cropper-modal/index.d.ts +5 -5
- package/es/ele-cropper-modal/index.js +3 -3
- package/es/ele-cropper-modal/props.d.ts +1 -4
- package/es/ele-data-table/index.d.ts +22 -22
- package/es/ele-data-table/props.d.ts +16 -16
- package/es/ele-data-table/style/index.scss +1 -1
- package/es/ele-data-table/types.d.ts +2 -0
- package/es/ele-data-table/util.js +6 -2
- package/es/ele-drawer/index.d.ts +18 -18
- package/es/ele-drawer/index.js +18 -18
- package/es/ele-drawer/props.d.ts +11 -10
- package/es/ele-dropdown/index.d.ts +24 -24
- package/es/ele-dropdown/index.js +54 -48
- package/es/ele-dropdown/props.d.ts +13 -12
- package/es/ele-dropdown/types.d.ts +2 -0
- package/es/ele-edit-tag/index.d.ts +21 -19
- package/es/ele-edit-tag/index.js +10 -2
- package/es/ele-edit-tag/props.d.ts +13 -8
- package/es/ele-edit-tag/props.js +3 -1
- package/es/ele-ellipsis/index.d.ts +6 -5
- package/es/ele-ellipsis/index.js +3 -3
- package/es/ele-ellipsis/props.d.ts +1 -1
- package/es/ele-file-list/components/file-grid-item.d.ts +5 -5
- package/es/ele-file-list/components/file-grid-item.js +15 -15
- package/es/ele-file-list/components/file-grid.d.ts +6 -6
- package/es/ele-file-list/components/file-grid.js +15 -15
- package/es/ele-file-list/components/file-table-item.d.ts +5 -5
- package/es/ele-file-list/components/file-table-item.js +15 -15
- package/es/ele-file-list/components/file-table.d.ts +7 -7
- package/es/ele-file-list/components/file-table.js +19 -19
- package/es/ele-file-list/index.d.ts +10 -10
- package/es/ele-file-list/index.js +22 -22
- package/es/ele-file-list-tool/index.d.ts +1 -1
- package/es/ele-file-list-tool/index.js +2 -2
- package/es/ele-icon-select/components/icon-grid.d.ts +10 -8
- package/es/ele-icon-select/components/icon-grid.js +6 -6
- package/es/ele-icon-select/index.d.ts +44 -43
- package/es/ele-icon-select/index.js +29 -25
- package/es/ele-icon-select/props.d.ts +18 -14
- package/es/ele-icon-select/props.js +2 -0
- package/es/ele-loading/index.d.ts +4 -4
- package/es/ele-loading/props.d.ts +3 -2
- package/es/ele-map-picker/components/map-view.d.ts +26 -28
- package/es/ele-map-picker/components/map-view.js +1 -0
- package/es/ele-map-picker/index.d.ts +10 -10
- package/es/ele-map-picker/props.d.ts +6 -5
- package/es/ele-map-picker/style/index.scss +1 -1
- package/es/ele-menus/index.d.ts +2 -2
- package/es/ele-menus/index.js +15 -15
- package/es/ele-menus/props.d.ts +1 -1
- package/es/ele-menus/style/index.scss +5 -0
- package/es/ele-menus/util.d.ts +7 -0
- package/es/ele-menus/util.js +49 -26
- package/es/ele-modal/index.d.ts +30 -29
- package/es/ele-modal/index.js +48 -82
- package/es/ele-modal/props.d.ts +14 -13
- package/es/ele-modal/util.d.ts +31 -24
- package/es/ele-modal/util.js +235 -132
- package/es/ele-pagination/index.d.ts +20 -8
- package/es/ele-pagination/index.js +9 -8
- package/es/ele-pagination/props.d.ts +8 -2
- package/es/ele-pagination/style/index.scss +70 -0
- package/es/ele-popconfirm/index.d.ts +37 -47
- package/es/ele-popconfirm/index.js +15 -15
- package/es/ele-popconfirm/props.d.ts +18 -21
- package/es/ele-popover/index.d.ts +27 -37
- package/es/ele-popover/index.js +15 -15
- package/es/ele-popover/props.d.ts +11 -15
- package/es/ele-popover/props.js +1 -0
- package/es/ele-printer/index.d.ts +9 -9
- package/es/ele-printer/index.js +19 -22
- package/es/ele-printer/props.d.ts +6 -5
- package/es/ele-printer/style/index.scss +2 -2
- package/es/ele-printer/types.d.ts +0 -2
- package/es/ele-printer/util.d.ts +7 -28
- package/es/ele-printer/util.js +111 -77
- package/es/ele-pro-layout/index.d.ts +44 -48
- package/es/ele-pro-layout/index.js +2 -2
- package/es/ele-pro-layout/props.d.ts +17 -15
- package/es/ele-pro-layout/props.js +1 -1
- package/es/ele-pro-table/components/table-tools.d.ts +405 -35
- package/es/ele-pro-table/components/table-tools.js +227 -151
- package/es/ele-pro-table/components/tool-column-list.d.ts +21 -9
- package/es/ele-pro-table/components/tool-column-list.js +64 -37
- package/es/ele-pro-table/components/tool-column.d.ts +31 -44
- package/es/ele-pro-table/components/tool-column.js +87 -103
- package/es/ele-pro-table/components/tool-export.d.ts +37 -34
- package/es/ele-pro-table/components/tool-export.js +223 -215
- package/es/ele-pro-table/components/tool-print-body-cell.d.ts +5 -4
- package/es/ele-pro-table/components/tool-print-header-cell.d.ts +5 -4
- package/es/ele-pro-table/components/tool-print.d.ts +47 -43
- package/es/ele-pro-table/components/tool-print.js +380 -369
- package/es/ele-pro-table/index.d.ts +1020 -81
- package/es/ele-pro-table/index.js +103 -76
- package/es/ele-pro-table/props.d.ts +18 -19
- package/es/ele-pro-table/props.js +4 -2
- package/es/ele-pro-table/style/index.scss +44 -12
- package/es/ele-pro-table/types.d.ts +54 -0
- package/es/ele-pro-table/util.d.ts +84 -34
- package/es/ele-pro-table/util.js +186 -94
- package/es/ele-qr-code/components/canvas-render.d.ts +67 -0
- package/es/ele-qr-code/components/canvas-render.js +147 -0
- package/es/ele-qr-code/index.d.ts +5 -9
- package/es/ele-qr-code/index.js +33 -136
- package/es/ele-qr-code/props.d.ts +5 -2
- package/es/ele-qr-code/props.js +3 -1
- package/es/ele-qr-code/types.d.ts +5 -0
- package/es/ele-qr-code-svg/index.d.ts +6 -5
- package/es/ele-qr-code-svg/index.js +11 -14
- package/es/ele-segmented/index.d.ts +1 -1
- package/es/ele-segmented/index.js +6 -3
- package/es/ele-split-panel/index.d.ts +8 -8
- package/es/ele-split-panel/index.js +3 -3
- package/es/ele-split-panel/props.d.ts +4 -3
- package/es/ele-steps/index.d.ts +2 -2
- package/es/ele-steps/props.d.ts +2 -2
- package/es/ele-tab-wrap/components/tab-dropdown.d.ts +1 -1
- package/es/ele-tab-wrap/components/tab-dropdown.js +3 -3
- package/es/ele-table/index.d.ts +2 -2
- package/es/ele-table/props.d.ts +2 -1
- package/es/ele-table-select/index.d.ts +29 -27
- package/es/ele-table-select/index.js +47 -39
- package/es/ele-table-select/props.d.ts +11 -7
- package/es/ele-table-select/props.js +2 -0
- package/es/ele-tabs/index.d.ts +19 -34
- package/es/ele-tabs/index.js +133 -86
- package/es/ele-tabs/props.d.ts +10 -24
- package/es/ele-tabs/props.js +3 -1
- package/es/ele-tabs/style/index.scss +42 -2
- package/es/ele-tabs/types.d.ts +2 -11
- package/es/ele-text/index.d.ts +2 -2
- package/es/ele-text/props.d.ts +2 -1
- package/es/ele-tool/index.d.ts +11 -5
- package/es/ele-tool/index.js +32 -32
- package/es/ele-tool/props.d.ts +4 -1
- package/es/ele-tool/props.js +3 -1
- package/es/ele-tool/style/index.js +0 -1
- package/es/ele-toolbar/index.d.ts +3253 -7
- package/es/ele-toolbar/index.js +44 -5
- package/es/ele-toolbar/props.d.ts +10 -5
- package/es/ele-toolbar/props.js +2 -0
- package/es/ele-toolbar/style/index.js +1 -0
- package/es/ele-toolbar/types.d.ts +15 -0
- package/es/ele-tooltip/index.d.ts +22 -21
- package/es/ele-tooltip/index.js +25 -25
- package/es/ele-tooltip/props.d.ts +7 -6
- package/es/ele-tour/index.d.ts +4 -4
- package/es/ele-tour/index.js +10 -10
- package/es/ele-tree-select/index.d.ts +27 -27
- package/es/ele-tree-select/index.js +33 -30
- package/es/ele-tree-select/props.d.ts +12 -8
- package/es/ele-tree-select/props.js +3 -1
- package/es/ele-upload-list/components/list-item.d.ts +3 -3
- package/es/ele-upload-list/components/list-item.js +7 -7
- package/es/ele-upload-list/index.d.ts +11 -13
- package/es/ele-upload-list/index.js +13 -13
- package/es/ele-upload-list/props.d.ts +4 -3
- package/es/ele-upload-list/style/index.scss +4 -0
- package/es/ele-virtual-table/components/body-cell.d.ts +19 -35
- package/es/ele-virtual-table/components/body-cell.js +24 -24
- package/es/ele-virtual-table/components/body-row.d.ts +20 -36
- package/es/ele-virtual-table/components/body-row.js +21 -21
- package/es/ele-virtual-table/components/cell-checkbox.d.ts +4 -3
- package/es/ele-virtual-table/components/cell-checkbox.js +3 -3
- package/es/ele-virtual-table/components/cell-filter.d.ts +11 -11
- package/es/ele-virtual-table/components/cell-filter.js +18 -18
- package/es/ele-virtual-table/components/footer-row.d.ts +4 -4
- package/es/ele-virtual-table/components/footer-row.js +3 -3
- package/es/ele-virtual-table/components/header-cell.d.ts +12 -12
- package/es/ele-virtual-table/components/header-cell.js +15 -15
- package/es/ele-virtual-table/components/header-row.d.ts +12 -12
- package/es/ele-virtual-table/components/header-row.js +15 -15
- package/es/ele-virtual-table/index.d.ts +36 -35
- package/es/ele-virtual-table/index.js +50 -48
- package/es/ele-virtual-table/props.d.ts +11 -11
- package/es/ele-virtual-table/util.js +3 -3
- package/es/ele-watermark/index.d.ts +5 -4
- package/es/ele-watermark/index.js +1 -0
- package/es/ele-watermark/props.d.ts +2 -1
- package/es/ele-xg-player/index.d.ts +3 -3
- package/es/icons/SizeCompactOutlined.d.ts +2 -0
- package/es/icons/SizeCompactOutlined.js +34 -0
- package/es/icons/SizeSlackOutlined.d.ts +2 -0
- package/es/icons/SizeSlackOutlined.js +34 -0
- package/es/icons/index.d.ts +2 -0
- package/es/icons/index.js +46 -42
- package/es/lang/en_US.js +1 -0
- package/es/lang/zh_CN.js +1 -0
- package/es/lang/zh_TW.js +1 -0
- package/es/style/themes/default.scss +20 -13
- package/es/style/themes/rounded.scss +4 -9
- package/es/utils/core.d.ts +7 -1
- package/es/utils/hook.d.ts +75 -4
- package/es/utils/hook.js +155 -6
- package/lib/ele-admin-layout/index.d.ts +29 -24
- package/lib/ele-admin-layout/props.cjs +4 -1
- package/lib/ele-admin-layout/props.d.ts +15 -11
- package/lib/ele-admin-layout/style/index.scss +7 -2
- package/lib/ele-admin-layout/style/sidebar.scss +2 -0
- package/lib/ele-alert/index.cjs +3 -3
- package/lib/ele-alert/index.d.ts +15 -15
- package/lib/ele-alert/props.d.ts +9 -8
- package/lib/ele-app/components/message-body.cjs +2 -2
- package/lib/ele-app/components/message-body.d.ts +6 -5
- package/lib/ele-app/components/message-box-icon.d.ts +7 -6
- package/lib/ele-app/plus.d.ts +3 -0
- package/lib/ele-app/style/overwrite/input/index.scss +2 -0
- package/lib/ele-avatar-group/index.cjs +15 -15
- package/lib/ele-avatar-group/index.d.ts +19 -18
- package/lib/ele-avatar-group/props.d.ts +10 -7
- package/lib/ele-basic-select/index.cjs +30 -23
- package/lib/ele-basic-select/index.d.ts +22 -19
- package/lib/ele-basic-select/props.cjs +3 -1
- package/lib/ele-basic-select/props.d.ts +11 -6
- package/lib/ele-basic-select/util.cjs +13 -0
- package/lib/ele-basic-select/util.d.ts +6 -0
- package/lib/ele-bottom-bar/index.d.ts +4 -4
- package/lib/ele-bottom-bar/props.d.ts +3 -2
- package/lib/ele-breadcrumb/index.d.ts +3 -3
- package/lib/ele-breadcrumb/props.d.ts +1 -1
- package/lib/ele-card/index.d.ts +14 -14
- package/lib/ele-card/props.d.ts +8 -6
- package/lib/ele-check-card/components/card-item.d.ts +3 -2
- package/lib/ele-check-card/index.cjs +12 -7
- package/lib/ele-check-card/index.d.ts +5 -5
- package/lib/ele-check-card/props.d.ts +3 -2
- package/lib/ele-config-provider/index.d.ts +4 -4
- package/lib/ele-config-provider/props.d.ts +3 -3
- package/lib/ele-config-provider/types.d.ts +1 -0
- package/lib/ele-copyable/index.cjs +6 -6
- package/lib/ele-copyable/index.d.ts +12 -12
- package/lib/ele-copyable/props.d.ts +7 -5
- package/lib/ele-count-up/index.d.ts +1 -1
- package/lib/ele-cropper/components/cropper-tools.cjs +10 -10
- package/lib/ele-cropper/components/cropper-tools.d.ts +6 -5
- package/lib/ele-cropper/index.cjs +39 -39
- package/lib/ele-cropper/index.d.ts +16 -16
- package/lib/ele-cropper/props.d.ts +2 -1
- package/lib/ele-cropper-modal/index.cjs +3 -3
- package/lib/ele-cropper-modal/index.d.ts +5 -5
- package/lib/ele-cropper-modal/props.d.ts +1 -4
- package/lib/ele-data-table/index.d.ts +22 -22
- package/lib/ele-data-table/props.d.ts +16 -16
- package/lib/ele-data-table/style/index.scss +1 -1
- package/lib/ele-data-table/types.d.ts +2 -0
- package/lib/ele-data-table/util.cjs +6 -2
- package/lib/ele-drawer/index.cjs +18 -18
- package/lib/ele-drawer/index.d.ts +18 -18
- package/lib/ele-drawer/props.d.ts +11 -10
- package/lib/ele-dropdown/index.cjs +54 -48
- package/lib/ele-dropdown/index.d.ts +24 -24
- package/lib/ele-dropdown/props.d.ts +13 -12
- package/lib/ele-dropdown/types.d.ts +2 -0
- package/lib/ele-edit-tag/index.cjs +10 -2
- package/lib/ele-edit-tag/index.d.ts +21 -19
- package/lib/ele-edit-tag/props.cjs +3 -1
- package/lib/ele-edit-tag/props.d.ts +13 -8
- package/lib/ele-ellipsis/index.cjs +3 -3
- package/lib/ele-ellipsis/index.d.ts +6 -5
- package/lib/ele-ellipsis/props.d.ts +1 -1
- package/lib/ele-file-list/components/file-grid-item.cjs +15 -15
- package/lib/ele-file-list/components/file-grid-item.d.ts +5 -5
- package/lib/ele-file-list/components/file-grid.cjs +15 -15
- package/lib/ele-file-list/components/file-grid.d.ts +6 -6
- package/lib/ele-file-list/components/file-table-item.cjs +15 -15
- package/lib/ele-file-list/components/file-table-item.d.ts +5 -5
- package/lib/ele-file-list/components/file-table.cjs +19 -19
- package/lib/ele-file-list/components/file-table.d.ts +7 -7
- package/lib/ele-file-list/index.cjs +22 -22
- package/lib/ele-file-list/index.d.ts +10 -10
- package/lib/ele-file-list-tool/index.cjs +2 -2
- package/lib/ele-file-list-tool/index.d.ts +1 -1
- package/lib/ele-icon-select/components/icon-grid.cjs +6 -6
- package/lib/ele-icon-select/components/icon-grid.d.ts +10 -8
- package/lib/ele-icon-select/index.cjs +32 -28
- package/lib/ele-icon-select/index.d.ts +44 -43
- package/lib/ele-icon-select/props.cjs +2 -0
- package/lib/ele-icon-select/props.d.ts +18 -14
- package/lib/ele-loading/index.d.ts +4 -4
- package/lib/ele-loading/props.d.ts +3 -2
- package/lib/ele-map-picker/components/map-view.cjs +1 -0
- package/lib/ele-map-picker/components/map-view.d.ts +26 -28
- package/lib/ele-map-picker/index.d.ts +10 -10
- package/lib/ele-map-picker/props.d.ts +6 -5
- package/lib/ele-map-picker/style/index.scss +1 -1
- package/lib/ele-menus/index.cjs +15 -15
- package/lib/ele-menus/index.d.ts +2 -2
- package/lib/ele-menus/props.d.ts +1 -1
- package/lib/ele-menus/style/index.scss +5 -0
- package/lib/ele-menus/util.cjs +49 -26
- package/lib/ele-menus/util.d.ts +7 -0
- package/lib/ele-modal/index.cjs +46 -80
- package/lib/ele-modal/index.d.ts +30 -29
- package/lib/ele-modal/props.d.ts +14 -13
- package/lib/ele-modal/util.cjs +235 -132
- package/lib/ele-modal/util.d.ts +31 -24
- package/lib/ele-pagination/index.cjs +9 -8
- package/lib/ele-pagination/index.d.ts +20 -8
- package/lib/ele-pagination/props.d.ts +8 -2
- package/lib/ele-pagination/style/index.scss +70 -0
- package/lib/ele-popconfirm/index.cjs +15 -15
- package/lib/ele-popconfirm/index.d.ts +37 -47
- package/lib/ele-popconfirm/props.d.ts +18 -21
- package/lib/ele-popover/index.cjs +15 -15
- package/lib/ele-popover/index.d.ts +27 -37
- package/lib/ele-popover/props.cjs +1 -0
- package/lib/ele-popover/props.d.ts +11 -15
- package/lib/ele-printer/index.cjs +17 -20
- package/lib/ele-printer/index.d.ts +9 -9
- package/lib/ele-printer/props.d.ts +6 -5
- package/lib/ele-printer/style/index.scss +2 -2
- package/lib/ele-printer/types.d.ts +0 -2
- package/lib/ele-printer/util.cjs +111 -77
- package/lib/ele-printer/util.d.ts +7 -28
- package/lib/ele-pro-layout/index.cjs +2 -2
- package/lib/ele-pro-layout/index.d.ts +44 -48
- package/lib/ele-pro-layout/props.cjs +1 -1
- package/lib/ele-pro-layout/props.d.ts +17 -15
- package/lib/ele-pro-table/components/table-tools.cjs +225 -149
- package/lib/ele-pro-table/components/table-tools.d.ts +405 -35
- package/lib/ele-pro-table/components/tool-column-list.cjs +63 -36
- package/lib/ele-pro-table/components/tool-column-list.d.ts +21 -9
- package/lib/ele-pro-table/components/tool-column.cjs +86 -102
- package/lib/ele-pro-table/components/tool-column.d.ts +31 -44
- package/lib/ele-pro-table/components/tool-export.cjs +220 -212
- package/lib/ele-pro-table/components/tool-export.d.ts +37 -34
- package/lib/ele-pro-table/components/tool-print-body-cell.d.ts +5 -4
- package/lib/ele-pro-table/components/tool-print-header-cell.d.ts +5 -4
- package/lib/ele-pro-table/components/tool-print.cjs +377 -366
- package/lib/ele-pro-table/components/tool-print.d.ts +47 -43
- package/lib/ele-pro-table/index.cjs +100 -73
- package/lib/ele-pro-table/index.d.ts +1020 -81
- package/lib/ele-pro-table/props.cjs +4 -2
- package/lib/ele-pro-table/props.d.ts +18 -19
- package/lib/ele-pro-table/style/index.scss +44 -12
- package/lib/ele-pro-table/types.d.ts +54 -0
- package/lib/ele-pro-table/util.cjs +186 -94
- package/lib/ele-pro-table/util.d.ts +84 -34
- package/lib/ele-qr-code/components/canvas-render.cjs +146 -0
- package/lib/ele-qr-code/components/canvas-render.d.ts +67 -0
- package/lib/ele-qr-code/index.cjs +32 -135
- package/lib/ele-qr-code/index.d.ts +5 -9
- package/lib/ele-qr-code/props.cjs +3 -1
- package/lib/ele-qr-code/props.d.ts +5 -2
- package/lib/ele-qr-code/types.d.ts +5 -0
- package/lib/ele-qr-code-svg/index.cjs +10 -13
- package/lib/ele-qr-code-svg/index.d.ts +6 -5
- package/lib/ele-segmented/index.cjs +6 -3
- package/lib/ele-segmented/index.d.ts +1 -1
- package/lib/ele-split-panel/index.cjs +3 -3
- package/lib/ele-split-panel/index.d.ts +8 -8
- package/lib/ele-split-panel/props.d.ts +4 -3
- package/lib/ele-steps/index.d.ts +2 -2
- package/lib/ele-steps/props.d.ts +2 -2
- package/lib/ele-tab-wrap/components/tab-dropdown.cjs +3 -3
- package/lib/ele-tab-wrap/components/tab-dropdown.d.ts +1 -1
- package/lib/ele-table/index.d.ts +2 -2
- package/lib/ele-table/props.d.ts +2 -1
- package/lib/ele-table-select/index.cjs +62 -54
- package/lib/ele-table-select/index.d.ts +29 -27
- package/lib/ele-table-select/props.cjs +2 -0
- package/lib/ele-table-select/props.d.ts +11 -7
- package/lib/ele-tabs/index.cjs +132 -85
- package/lib/ele-tabs/index.d.ts +19 -34
- package/lib/ele-tabs/props.cjs +3 -1
- package/lib/ele-tabs/props.d.ts +10 -24
- package/lib/ele-tabs/style/index.scss +42 -2
- package/lib/ele-tabs/types.d.ts +2 -11
- package/lib/ele-text/index.d.ts +2 -2
- package/lib/ele-text/props.d.ts +2 -1
- package/lib/ele-tool/index.cjs +31 -31
- package/lib/ele-tool/index.d.ts +11 -5
- package/lib/ele-tool/props.cjs +3 -1
- package/lib/ele-tool/props.d.ts +4 -1
- package/lib/ele-tool/style/index.cjs +0 -1
- package/lib/ele-toolbar/index.cjs +42 -3
- package/lib/ele-toolbar/index.d.ts +3253 -7
- package/lib/ele-toolbar/props.cjs +2 -0
- package/lib/ele-toolbar/props.d.ts +10 -5
- package/lib/ele-toolbar/style/index.cjs +1 -0
- package/lib/ele-toolbar/types.d.ts +15 -0
- package/lib/ele-tooltip/index.cjs +25 -25
- package/lib/ele-tooltip/index.d.ts +22 -21
- package/lib/ele-tooltip/props.d.ts +7 -6
- package/lib/ele-tour/index.cjs +10 -10
- package/lib/ele-tour/index.d.ts +4 -4
- package/lib/ele-tree-select/index.cjs +32 -29
- package/lib/ele-tree-select/index.d.ts +27 -27
- package/lib/ele-tree-select/props.cjs +3 -1
- package/lib/ele-tree-select/props.d.ts +12 -8
- package/lib/ele-upload-list/components/list-item.cjs +7 -7
- package/lib/ele-upload-list/components/list-item.d.ts +3 -3
- package/lib/ele-upload-list/index.cjs +13 -13
- package/lib/ele-upload-list/index.d.ts +11 -13
- package/lib/ele-upload-list/props.d.ts +4 -3
- package/lib/ele-upload-list/style/index.scss +4 -0
- package/lib/ele-virtual-table/components/body-cell.cjs +24 -24
- package/lib/ele-virtual-table/components/body-cell.d.ts +19 -35
- package/lib/ele-virtual-table/components/body-row.cjs +21 -21
- package/lib/ele-virtual-table/components/body-row.d.ts +20 -36
- package/lib/ele-virtual-table/components/cell-checkbox.cjs +3 -3
- package/lib/ele-virtual-table/components/cell-checkbox.d.ts +4 -3
- package/lib/ele-virtual-table/components/cell-filter.cjs +18 -18
- package/lib/ele-virtual-table/components/cell-filter.d.ts +11 -11
- package/lib/ele-virtual-table/components/footer-row.cjs +3 -3
- package/lib/ele-virtual-table/components/footer-row.d.ts +4 -4
- package/lib/ele-virtual-table/components/header-cell.cjs +15 -15
- package/lib/ele-virtual-table/components/header-cell.d.ts +12 -12
- package/lib/ele-virtual-table/components/header-row.cjs +15 -15
- package/lib/ele-virtual-table/components/header-row.d.ts +12 -12
- package/lib/ele-virtual-table/index.cjs +50 -48
- package/lib/ele-virtual-table/index.d.ts +36 -35
- package/lib/ele-virtual-table/props.d.ts +11 -11
- package/lib/ele-virtual-table/util.cjs +3 -3
- package/lib/ele-watermark/index.cjs +1 -0
- package/lib/ele-watermark/index.d.ts +5 -4
- package/lib/ele-watermark/props.d.ts +2 -1
- package/lib/ele-xg-player/index.d.ts +3 -3
- package/lib/icons/SizeCompactOutlined.cjs +33 -0
- package/lib/icons/SizeCompactOutlined.d.ts +2 -0
- package/lib/icons/SizeSlackOutlined.cjs +33 -0
- package/lib/icons/SizeSlackOutlined.d.ts +2 -0
- package/lib/icons/index.cjs +4 -0
- package/lib/icons/index.d.ts +2 -0
- package/lib/lang/en_US.cjs +1 -0
- package/lib/lang/zh_CN.cjs +1 -0
- package/lib/lang/zh_TW.cjs +1 -0
- package/lib/style/themes/default.scss +20 -13
- package/lib/style/themes/rounded.scss +4 -9
- package/lib/utils/core.d.ts +7 -1
- package/lib/utils/hook.cjs +154 -5
- package/lib/utils/hook.d.ts +75 -4
- package/package.json +14 -13
package/es/ele-popover/index.js
CHANGED
|
@@ -22,30 +22,30 @@ const _sfc_main = defineComponent({
|
|
|
22
22
|
const hide = () => {
|
|
23
23
|
tooltipRef.value && tooltipRef.value.hide();
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const handleUpdateVisible = (visible) => {
|
|
26
26
|
emit("update:visible", visible);
|
|
27
27
|
};
|
|
28
|
-
const
|
|
28
|
+
const handlePopBeforeEnter = () => {
|
|
29
29
|
emit("before-enter");
|
|
30
30
|
};
|
|
31
|
-
const
|
|
31
|
+
const handlePopBeforeLeave = () => {
|
|
32
32
|
emit("before-leave");
|
|
33
33
|
};
|
|
34
|
-
const
|
|
34
|
+
const handlePopAfterEnter = () => {
|
|
35
35
|
emit("after-enter");
|
|
36
36
|
};
|
|
37
|
-
const
|
|
37
|
+
const handlePopAfterLeave = () => {
|
|
38
38
|
emit("after-leave");
|
|
39
39
|
};
|
|
40
40
|
return {
|
|
41
41
|
tooltipRef,
|
|
42
42
|
tooltipProps,
|
|
43
43
|
hide,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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.
|
|
65
|
-
onBeforeShow: _ctx.
|
|
66
|
-
onBeforeHide: _ctx.
|
|
67
|
-
onShow: _ctx.
|
|
68
|
-
onHide: _ctx.
|
|
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<
|
|
15
|
+
bodyStyle: PropType<StyleValue>;
|
|
15
16
|
/** 自定义标题样式 */
|
|
16
|
-
titleStyle: PropType<
|
|
17
|
+
titleStyle: PropType<StyleValue>;
|
|
17
18
|
/** 自定义内容样式 */
|
|
18
|
-
contentStyle: PropType<
|
|
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[]) =>
|
|
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[]) =>
|
|
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;
|
package/es/ele-popover/props.js
CHANGED
|
@@ -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<
|
|
4
|
-
bodyStyle: import('vue').PropType<
|
|
5
|
-
footerStyle: import('vue').PropType<
|
|
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<
|
|
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<
|
|
24
|
-
bodyStyle: import('vue').PropType<
|
|
25
|
-
footerStyle: import('vue').PropType<
|
|
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<
|
|
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;
|
package/es/ele-printer/index.js
CHANGED
|
@@ -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
|
|
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
|
|
11
|
+
const doPrint = usePrinter(() => {
|
|
12
|
+
visible.value = false;
|
|
12
13
|
updateModelValue(false);
|
|
13
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
(
|
|
51
|
-
if (
|
|
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 {
|
|
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<
|
|
12
|
+
headerStyle: PropType<StyleValue>;
|
|
12
13
|
/** 内容样式 */
|
|
13
|
-
bodyStyle: PropType<
|
|
14
|
+
bodyStyle: PropType<StyleValue>;
|
|
14
15
|
/** 页脚样式 */
|
|
15
|
-
footerStyle: PropType<
|
|
16
|
+
footerStyle: PropType<StyleValue>;
|
|
16
17
|
/** 标题 */
|
|
17
18
|
title: StringConstructor;
|
|
18
19
|
/** 页间距 */
|
|
19
20
|
margin: (StringConstructor | NumberConstructor)[];
|
|
20
21
|
/** 纸张方向 */
|
|
21
|
-
direction: PropType<
|
|
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:
|
|
49
|
+
max-height: none !important;
|
|
50
50
|
width: auto !important;
|
|
51
51
|
min-width: auto !important;
|
|
52
|
-
max-width:
|
|
52
|
+
max-width: none !important;
|
|
53
53
|
overflow: visible !important;
|
|
54
54
|
}
|
|
55
55
|
|
package/es/ele-printer/util.d.ts
CHANGED
|
@@ -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 打印参数
|
package/es/ele-printer/util.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { onBeforeUnmount } from "vue";
|
|
2
|
-
import {
|
|
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
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
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_${
|
|
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
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
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",
|
|
154
|
+
window.removeEventListener("message", handleMessage);
|
|
131
155
|
});
|
|
132
|
-
|
|
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 (
|
|
139
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
};
|