ele-admin-plus 1.0.0-beta.2 → 1.0.0-beta.4
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/components.d.ts +3 -0
- package/es/components.js +92 -86
- package/es/ele-alert/index.d.ts +62 -0
- package/es/ele-alert/index.js +129 -0
- package/es/ele-alert/props.d.ts +36 -0
- package/es/ele-alert/props.js +48 -0
- package/es/ele-alert/style/css-var.scss +11 -0
- package/es/ele-alert/style/index.js +1 -0
- package/es/ele-alert/style/index.scss +148 -0
- package/es/ele-app/index.d.ts +1 -0
- package/es/ele-app/style/common.scss +134 -32
- package/es/ele-app/style/css-var.scss +2 -2
- package/es/ele-app/types/index.d.ts +27 -0
- package/es/ele-avatar-group/index.d.ts +3 -0
- package/es/ele-avatar-group/index.js +10 -9
- package/es/ele-avatar-group/props.d.ts +1 -0
- package/es/ele-avatar-group/props.js +3 -1
- package/es/ele-avatar-group/style/index.scss +32 -0
- package/es/ele-basic-select/index.d.ts +2 -19171
- package/es/ele-basic-select/index.js +2 -2
- package/es/ele-bottom-bar/style/index.scss +1 -1
- package/es/ele-breadcrumb/index.d.ts +2 -165
- package/es/ele-card/style/index.scss +28 -26
- package/es/ele-config-provider/index.d.ts +3 -7
- package/es/ele-config-provider/index.js +1 -8
- package/es/ele-config-provider/props.d.ts +9 -2
- package/es/ele-config-provider/props.js +5 -3
- package/{lib/ele-config-provider/use-receiver.d.ts → es/ele-config-provider/receiver.d.ts} +8 -2
- package/es/ele-config-provider/receiver.js +198 -0
- package/es/ele-config-provider/types/index.d.ts +24 -13
- package/es/ele-cropper/components/cropper-tools.js +1 -1
- package/es/ele-cropper/index.d.ts +12 -9
- package/es/ele-cropper/index.js +29 -30
- package/es/ele-cropper/props.d.ts +3 -4
- package/es/ele-cropper/style/index.js +1 -1
- package/es/ele-cropper/types/index.d.ts +10 -2
- package/es/ele-cropper-modal/index.d.ts +6 -6
- package/es/ele-cropper-modal/index.js +1 -1
- package/es/ele-cropper-modal/props.d.ts +2 -2
- package/es/ele-dashboard/index.js +1 -1
- package/es/ele-drawer/index.d.ts +2 -355
- package/es/ele-drawer/index.js +1 -1
- package/es/ele-edit-tag/index.d.ts +2 -804
- package/es/ele-edit-tag/index.js +1 -2
- package/es/ele-ellipsis/index.d.ts +6 -3
- package/es/ele-ellipsis/index.js +16 -23
- package/es/ele-ellipsis/props.d.ts +1 -0
- package/es/ele-file-list/components/file-grid-item.d.ts +5 -24370
- package/es/ele-file-list/components/file-grid-item.js +8 -1
- package/es/ele-file-list/components/file-grid.d.ts +4 -2
- package/es/ele-file-list/components/file-table-item.d.ts +5 -24370
- package/es/ele-file-list/components/file-table-item.js +8 -1
- package/es/ele-file-list/components/file-table.d.ts +4 -2
- package/es/ele-file-list/index.d.ts +2 -1561
- package/es/ele-file-list/index.js +25 -15
- package/es/ele-file-list/style/index.scss +0 -1
- package/es/ele-icon-select/components/icon-grid.d.ts +5 -1
- package/es/ele-icon-select/components/icon-grid.js +24 -14
- package/es/ele-icon-select/components/icon-popper.d.ts +15 -1
- package/es/ele-icon-select/components/icon-popper.js +52 -41
- package/es/ele-icon-select/index.d.ts +14 -0
- package/es/ele-icon-select/index.js +9 -2
- package/es/ele-icon-select/props.d.ts +8 -1
- package/es/ele-icon-select/props.js +14 -0
- package/es/ele-icon-select/style/index.scss +142 -140
- package/es/ele-map-picker/components/map-view.js +4 -5
- package/es/ele-map-picker/index.d.ts +6 -1
- package/es/ele-map-picker/index.js +11 -23
- package/es/ele-map-picker/props.d.ts +10 -4
- package/es/ele-map-picker/props.js +9 -7
- package/es/ele-map-picker/style/index.scss +1 -0
- package/es/ele-menus/index.d.ts +2 -156
- package/es/ele-menus/index.js +3 -12
- package/es/ele-menus/props.d.ts +6 -0
- package/es/ele-menus/props.js +2 -0
- package/es/ele-menus/style/index.scss +12 -5
- package/es/ele-modal/index.d.ts +7 -903
- package/es/ele-modal/index.js +38 -49
- package/es/ele-modal/props.d.ts +10 -0
- package/es/ele-modal/props.js +4 -0
- package/es/ele-modal/style/index.scss +1 -1
- package/es/ele-modal/util.d.ts +3 -3
- package/es/ele-modal/util.js +8 -7
- package/es/ele-page/index.d.ts +8 -2
- package/es/ele-page/props.d.ts +4 -1
- package/es/ele-page/props.js +4 -1
- package/es/ele-pagination/index.d.ts +6 -6
- package/es/ele-pagination/props.d.ts +3 -3
- package/es/ele-printer/index.d.ts +37 -0
- package/es/ele-printer/index.js +119 -0
- package/es/ele-printer/props.d.ts +25 -0
- package/es/ele-printer/props.js +32 -0
- package/es/ele-printer/style/index.js +1 -0
- package/es/ele-printer/style/index.scss +58 -0
- package/es/ele-printer/types/index.d.ts +40 -0
- package/es/ele-printer/util.d.ts +39 -0
- package/es/ele-printer/util.js +174 -0
- package/es/ele-pro-layout/components/pro-iframe.d.ts +29 -0
- package/es/ele-pro-layout/components/pro-iframe.js +116 -0
- package/es/ele-pro-layout/components/pro-sidebar.d.ts +3 -9
- package/es/ele-pro-layout/components/pro-sidebar.js +19 -9
- package/es/ele-pro-layout/components/pro-sidebox.d.ts +2 -1
- package/es/ele-pro-layout/components/pro-sidebox.js +19 -5
- package/es/ele-pro-layout/components/{pro-tab-bar.d.ts → pro-tabs.d.ts} +3 -2
- package/es/ele-pro-layout/components/{pro-tab-bar.js → pro-tabs.js} +4 -3
- package/es/ele-pro-layout/index.js +66 -103
- package/es/ele-pro-layout/props.d.ts +6 -4
- package/es/ele-pro-layout/props.js +9 -8
- package/es/ele-pro-layout/style/collapse.scss +60 -42
- package/es/ele-pro-layout/style/css-var.scss +3 -1
- package/es/ele-pro-layout/style/header.scss +8 -3
- package/es/ele-pro-layout/style/layout-mobile.scss +1 -1
- package/es/ele-pro-layout/style/layout-style.scss +9 -4
- package/es/ele-pro-layout/style/layout.scss +14 -1
- package/es/ele-pro-layout/style/sidebar.scss +21 -6
- package/es/ele-pro-layout/style/tabs.scss +3 -26
- package/es/ele-pro-layout/types/index.d.ts +23 -18
- package/es/ele-pro-layout/util.d.ts +8 -12
- package/es/ele-pro-layout/util.js +74 -22
- package/es/ele-pro-table/components/table-tools.d.ts +2 -2
- package/es/ele-pro-table/components/table-tools.js +1 -1
- package/es/ele-pro-table/components/table-view.d.ts +51 -618
- package/es/ele-pro-table/components/table-view.js +11 -24
- package/es/ele-pro-table/index.d.ts +81 -1674
- package/es/ele-pro-table/index.js +90 -129
- package/es/ele-pro-table/props.d.ts +133 -25
- package/es/ele-pro-table/props.js +36 -30
- package/es/ele-pro-table/style/index.scss +96 -57
- package/es/ele-pro-table/types/index.d.ts +24 -4
- package/es/ele-pro-table/util.d.ts +27 -10
- package/es/ele-pro-table/util.js +49 -13
- package/es/ele-segmented/index.d.ts +33 -0
- package/es/ele-segmented/index.js +77 -0
- package/es/ele-segmented/props.d.ts +23 -0
- package/es/ele-segmented/props.js +25 -0
- package/es/ele-segmented/style/css-var.scss +15 -0
- package/es/ele-segmented/style/index.js +4 -0
- package/es/ele-segmented/style/index.scss +102 -0
- package/es/ele-segmented/types/index.d.ts +25 -0
- package/es/ele-split-panel/index.d.ts +7 -8
- package/es/ele-split-panel/index.js +8 -13
- package/es/ele-split-panel/style/index.scss +26 -25
- package/es/ele-steps/index.d.ts +13 -1
- package/es/ele-steps/index.js +14 -14
- package/es/ele-steps/style/index.scss +24 -9
- package/es/ele-table/style/index.scss +1 -0
- package/es/ele-table-select/index.js +1 -1
- package/es/ele-table-select/types/index.d.ts +7 -0
- package/es/ele-tabs/components/tab-title.d.ts +5 -4
- package/es/ele-tabs/index.d.ts +17 -269
- package/es/ele-tabs/index.js +19 -26
- package/es/ele-tabs/props.d.ts +10 -2
- package/es/ele-tabs/props.js +4 -0
- package/es/ele-tabs/style/css-var.scss +7 -7
- package/es/ele-tabs/style/index.scss +4 -3
- package/es/ele-tabs/types/index.d.ts +1 -5
- package/es/ele-text/index.d.ts +2 -0
- package/es/ele-text/index.js +7 -5
- package/es/ele-text/props.d.ts +7 -1
- package/es/ele-text/props.js +5 -1
- package/es/ele-toolbar/index.d.ts +15 -2
- package/es/ele-toolbar/index.js +18 -18
- package/es/ele-toolbar/props.d.ts +8 -2
- package/es/ele-toolbar/props.js +10 -1
- package/es/ele-toolbar/style/index.scss +2 -17
- package/es/ele-tour/index.d.ts +10 -20739
- package/es/ele-tour/index.js +8 -9
- package/es/ele-tour/style/index.scss +5 -4
- package/es/ele-tour/util.js +1 -0
- package/es/ele-upload-list/components/list-item.d.ts +9 -6
- package/es/ele-upload-list/components/list-item.js +21 -24
- package/es/ele-upload-list/index.d.ts +14 -733
- package/es/ele-upload-list/index.js +15 -15
- package/es/ele-upload-list/props.d.ts +5 -0
- package/es/ele-upload-list/props.js +8 -1
- package/es/ele-upload-list/style/index.scss +15 -5
- package/es/ele-upload-list/types/index.d.ts +1 -1
- package/es/ele-watermark/index.js +1 -1
- package/es/ele-watermark/util.js +8 -10
- package/es/ele-xg-player/index.d.ts +1 -1
- package/es/ele-xg-player/index.js +22 -16
- package/es/icons/ArrowDown.js +1 -1
- package/es/icons/ArrowLeft.d.ts +2 -0
- package/es/icons/ArrowLeft.js +30 -0
- package/es/icons/ArrowUp.d.ts +2 -0
- package/es/icons/ArrowUp.js +31 -0
- package/es/icons/index.d.ts +2 -0
- package/es/icons/index.js +24 -20
- package/es/index.d.ts +0 -2
- package/es/index.js +0 -2
- package/es/lang/en_US.js +2 -2
- package/es/lang/zh_CN.js +1 -1
- package/es/lang/zh_TW.js +1 -1
- package/es/style/index.scss +3 -0
- package/es/style/themes/dark-css-var.scss +7 -3
- package/es/style/themes/dark.scss +1 -1
- package/es/style/themes/default.scss +75 -12
- package/es/utils/core.d.ts +13 -33
- package/es/utils/core.js +19 -39
- package/es/utils/menu-util.js +24 -2
- package/es/utils/message.js +1 -1
- package/es/utils/theme-util.d.ts +1 -1
- package/es/utils/theme-util.js +10 -10
- package/lib/components.d.ts +3 -0
- package/lib/components.js +92 -86
- package/lib/ele-alert/index.d.ts +62 -0
- package/lib/ele-alert/index.js +128 -0
- package/lib/ele-alert/props.d.ts +36 -0
- package/lib/ele-alert/props.js +48 -0
- package/lib/ele-alert/style/css-var.scss +11 -0
- package/lib/ele-alert/style/index.js +2 -0
- package/lib/ele-alert/style/index.scss +148 -0
- package/lib/ele-app/index.d.ts +1 -0
- package/lib/ele-app/style/common.scss +134 -32
- package/lib/ele-app/style/css-var.scss +2 -2
- package/lib/ele-app/types/index.d.ts +27 -0
- package/lib/ele-avatar-group/index.d.ts +3 -0
- package/lib/ele-avatar-group/index.js +10 -9
- package/lib/ele-avatar-group/props.d.ts +1 -0
- package/lib/ele-avatar-group/props.js +3 -1
- package/lib/ele-avatar-group/style/index.scss +32 -0
- package/lib/ele-basic-select/index.d.ts +2 -19171
- package/lib/ele-basic-select/index.js +3 -3
- package/lib/ele-bottom-bar/style/index.scss +1 -1
- package/lib/ele-breadcrumb/index.d.ts +2 -165
- package/lib/ele-card/style/index.scss +28 -26
- package/lib/ele-config-provider/index.d.ts +3 -7
- package/lib/ele-config-provider/index.js +11 -18
- package/lib/ele-config-provider/props.d.ts +9 -2
- package/lib/ele-config-provider/props.js +5 -3
- package/{es/ele-config-provider/use-receiver.d.ts → lib/ele-config-provider/receiver.d.ts} +8 -2
- package/lib/ele-config-provider/receiver.js +200 -0
- package/lib/ele-config-provider/types/index.d.ts +24 -13
- package/lib/ele-cropper/components/cropper-tools.js +2 -2
- package/lib/ele-cropper/index.d.ts +12 -9
- package/lib/ele-cropper/index.js +31 -32
- package/lib/ele-cropper/props.d.ts +3 -4
- package/lib/ele-cropper/style/index.js +1 -1
- package/lib/ele-cropper/types/index.d.ts +10 -2
- package/lib/ele-cropper-modal/index.d.ts +6 -6
- package/lib/ele-cropper-modal/index.js +2 -2
- package/lib/ele-cropper-modal/props.d.ts +2 -2
- package/lib/ele-dashboard/index.js +2 -2
- package/lib/ele-drawer/index.d.ts +2 -355
- package/lib/ele-drawer/index.js +1 -1
- package/lib/ele-edit-tag/index.d.ts +2 -804
- package/lib/ele-edit-tag/index.js +2 -3
- package/lib/ele-ellipsis/index.d.ts +6 -3
- package/lib/ele-ellipsis/index.js +15 -22
- package/lib/ele-ellipsis/props.d.ts +1 -0
- package/lib/ele-file-list/components/file-grid-item.d.ts +5 -24370
- package/lib/ele-file-list/components/file-grid-item.js +8 -1
- package/lib/ele-file-list/components/file-grid.d.ts +4 -2
- package/lib/ele-file-list/components/file-table-item.d.ts +5 -24370
- package/lib/ele-file-list/components/file-table-item.js +8 -1
- package/lib/ele-file-list/components/file-table.d.ts +4 -2
- package/lib/ele-file-list/index.d.ts +2 -1561
- package/lib/ele-file-list/index.js +27 -17
- package/lib/ele-file-list/style/index.scss +0 -1
- package/lib/ele-icon-select/components/icon-grid.d.ts +5 -1
- package/lib/ele-icon-select/components/icon-grid.js +23 -13
- package/lib/ele-icon-select/components/icon-popper.d.ts +15 -1
- package/lib/ele-icon-select/components/icon-popper.js +51 -40
- package/lib/ele-icon-select/index.d.ts +14 -0
- package/lib/ele-icon-select/index.js +10 -3
- package/lib/ele-icon-select/props.d.ts +8 -1
- package/lib/ele-icon-select/props.js +14 -0
- package/lib/ele-icon-select/style/index.scss +142 -140
- package/lib/ele-map-picker/components/map-view.js +4 -5
- package/lib/ele-map-picker/index.d.ts +6 -1
- package/lib/ele-map-picker/index.js +14 -26
- package/lib/ele-map-picker/props.d.ts +10 -4
- package/lib/ele-map-picker/props.js +9 -7
- package/lib/ele-map-picker/style/index.scss +1 -0
- package/lib/ele-menus/index.d.ts +2 -156
- package/lib/ele-menus/index.js +11 -20
- package/lib/ele-menus/props.d.ts +6 -0
- package/lib/ele-menus/props.js +2 -0
- package/lib/ele-menus/style/index.scss +12 -5
- package/lib/ele-modal/index.d.ts +7 -903
- package/lib/ele-modal/index.js +63 -74
- package/lib/ele-modal/props.d.ts +10 -0
- package/lib/ele-modal/props.js +4 -0
- package/lib/ele-modal/style/index.scss +1 -1
- package/lib/ele-modal/util.d.ts +3 -3
- package/lib/ele-modal/util.js +8 -7
- package/lib/ele-page/index.d.ts +8 -2
- package/lib/ele-page/props.d.ts +4 -1
- package/lib/ele-page/props.js +4 -1
- package/lib/ele-pagination/index.d.ts +6 -6
- package/lib/ele-pagination/props.d.ts +3 -3
- package/lib/ele-printer/index.d.ts +37 -0
- package/lib/ele-printer/index.js +118 -0
- package/lib/ele-printer/props.d.ts +25 -0
- package/lib/ele-printer/props.js +32 -0
- package/lib/ele-printer/style/index.js +2 -0
- package/lib/ele-printer/style/index.scss +58 -0
- package/lib/ele-printer/types/index.d.ts +40 -0
- package/lib/ele-printer/util.d.ts +39 -0
- package/lib/ele-printer/util.js +174 -0
- package/lib/ele-pro-layout/components/pro-iframe.d.ts +29 -0
- package/lib/ele-pro-layout/components/pro-iframe.js +115 -0
- package/lib/ele-pro-layout/components/pro-sidebar.d.ts +3 -9
- package/lib/ele-pro-layout/components/pro-sidebar.js +17 -7
- package/lib/ele-pro-layout/components/pro-sidebox.d.ts +2 -1
- package/lib/ele-pro-layout/components/pro-sidebox.js +17 -3
- package/lib/ele-pro-layout/components/{pro-tab-bar.d.ts → pro-tabs.d.ts} +3 -2
- package/lib/ele-pro-layout/components/{pro-tab-bar.js → pro-tabs.js} +4 -3
- package/lib/ele-pro-layout/index.js +65 -102
- package/lib/ele-pro-layout/props.d.ts +6 -4
- package/lib/ele-pro-layout/props.js +9 -8
- package/lib/ele-pro-layout/style/collapse.scss +60 -42
- package/lib/ele-pro-layout/style/css-var.scss +3 -1
- package/lib/ele-pro-layout/style/header.scss +8 -3
- package/lib/ele-pro-layout/style/layout-mobile.scss +1 -1
- package/lib/ele-pro-layout/style/layout-style.scss +9 -4
- package/lib/ele-pro-layout/style/layout.scss +14 -1
- package/lib/ele-pro-layout/style/sidebar.scss +21 -6
- package/lib/ele-pro-layout/style/tabs.scss +3 -26
- package/lib/ele-pro-layout/types/index.d.ts +23 -18
- package/lib/ele-pro-layout/util.d.ts +8 -12
- package/lib/ele-pro-layout/util.js +72 -20
- package/lib/ele-pro-table/components/table-tools.d.ts +2 -2
- package/lib/ele-pro-table/components/table-tools.js +2 -2
- package/lib/ele-pro-table/components/table-view.d.ts +51 -618
- package/lib/ele-pro-table/components/table-view.js +11 -24
- package/lib/ele-pro-table/index.d.ts +81 -1674
- package/lib/ele-pro-table/index.js +125 -164
- package/lib/ele-pro-table/props.d.ts +133 -25
- package/lib/ele-pro-table/props.js +35 -29
- package/lib/ele-pro-table/style/index.scss +96 -57
- package/lib/ele-pro-table/types/index.d.ts +24 -4
- package/lib/ele-pro-table/util.d.ts +27 -10
- package/lib/ele-pro-table/util.js +48 -12
- package/lib/ele-segmented/index.d.ts +33 -0
- package/lib/ele-segmented/index.js +76 -0
- package/lib/ele-segmented/props.d.ts +23 -0
- package/lib/ele-segmented/props.js +25 -0
- package/lib/ele-segmented/style/css-var.scss +15 -0
- package/lib/ele-segmented/style/index.js +5 -0
- package/lib/ele-segmented/style/index.scss +102 -0
- package/lib/ele-segmented/types/index.d.ts +25 -0
- package/lib/ele-split-panel/index.d.ts +7 -8
- package/lib/ele-split-panel/index.js +10 -15
- package/lib/ele-split-panel/style/index.scss +26 -25
- package/lib/ele-steps/index.d.ts +13 -1
- package/lib/ele-steps/index.js +13 -13
- package/lib/ele-steps/style/index.scss +24 -9
- package/lib/ele-table/style/index.scss +1 -0
- package/lib/ele-table-select/index.js +2 -2
- package/lib/ele-table-select/types/index.d.ts +7 -0
- package/lib/ele-tabs/components/tab-title.d.ts +5 -4
- package/lib/ele-tabs/index.d.ts +17 -269
- package/lib/ele-tabs/index.js +21 -28
- package/lib/ele-tabs/props.d.ts +10 -2
- package/lib/ele-tabs/props.js +4 -0
- package/lib/ele-tabs/style/css-var.scss +7 -7
- package/lib/ele-tabs/style/index.scss +4 -3
- package/lib/ele-tabs/types/index.d.ts +1 -5
- package/lib/ele-text/index.d.ts +2 -0
- package/lib/ele-text/index.js +7 -5
- package/lib/ele-text/props.d.ts +7 -1
- package/lib/ele-text/props.js +5 -1
- package/lib/ele-toolbar/index.d.ts +15 -2
- package/lib/ele-toolbar/index.js +17 -17
- package/lib/ele-toolbar/props.d.ts +8 -2
- package/lib/ele-toolbar/props.js +10 -1
- package/lib/ele-toolbar/style/index.scss +2 -17
- package/lib/ele-tour/index.d.ts +10 -20739
- package/lib/ele-tour/index.js +9 -10
- package/lib/ele-tour/style/index.scss +5 -4
- package/lib/ele-tour/util.js +1 -0
- package/lib/ele-upload-list/components/list-item.d.ts +9 -6
- package/lib/ele-upload-list/components/list-item.js +20 -23
- package/lib/ele-upload-list/index.d.ts +14 -733
- package/lib/ele-upload-list/index.js +16 -16
- package/lib/ele-upload-list/props.d.ts +5 -0
- package/lib/ele-upload-list/props.js +8 -1
- package/lib/ele-upload-list/style/index.scss +15 -5
- package/lib/ele-upload-list/types/index.d.ts +1 -1
- package/lib/ele-watermark/index.js +2 -2
- package/lib/ele-watermark/util.js +8 -10
- package/lib/ele-xg-player/index.d.ts +1 -1
- package/lib/ele-xg-player/index.js +21 -15
- package/lib/icons/ArrowDown.js +1 -1
- package/lib/icons/ArrowLeft.d.ts +2 -0
- package/lib/icons/ArrowLeft.js +29 -0
- package/lib/icons/ArrowUp.d.ts +2 -0
- package/lib/icons/ArrowUp.js +30 -0
- package/lib/icons/index.d.ts +2 -0
- package/lib/icons/index.js +4 -0
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -16
- package/lib/lang/en_US.js +2 -2
- package/lib/lang/zh_CN.js +1 -1
- package/lib/lang/zh_TW.js +1 -1
- package/lib/style/index.scss +3 -0
- package/lib/style/themes/dark-css-var.scss +7 -3
- package/lib/style/themes/dark.scss +1 -1
- package/lib/style/themes/default.scss +75 -12
- package/lib/utils/core.d.ts +13 -33
- package/lib/utils/core.js +19 -39
- package/lib/utils/menu-util.js +24 -2
- package/lib/utils/message.js +1 -1
- package/lib/utils/theme-util.d.ts +1 -1
- package/lib/utils/theme-util.js +10 -10
- package/package.json +19 -18
- package/typings/global.d.ts +3 -1
- package/es/ele-config-provider/keys.d.ts +0 -8
- package/es/ele-config-provider/keys.js +0 -6
- package/es/ele-config-provider/use-receiver.js +0 -38
- package/es/utils/iframe-component.d.ts +0 -8
- package/es/utils/iframe-component.js +0 -70
- package/es/utils/license-util.d.ts +0 -9
- package/es/utils/license-util.js +0 -176
- package/es/utils/printer.d.ts +0 -100
- package/es/utils/printer.js +0 -612
- package/lib/ele-config-provider/keys.d.ts +0 -8
- package/lib/ele-config-provider/keys.js +0 -6
- package/lib/ele-config-provider/use-receiver.js +0 -38
- package/lib/utils/iframe-component.d.ts +0 -8
- package/lib/utils/iframe-component.js +0 -70
- package/lib/utils/license-util.d.ts +0 -9
- package/lib/utils/license-util.js +0 -176
- package/lib/utils/printer.d.ts +0 -100
- package/lib/utils/printer.js +0 -612
package/es/utils/printer.js
DELETED
|
@@ -1,612 +0,0 @@
|
|
|
1
|
-
import { uuid } from "./core";
|
|
2
|
-
const printFrameId = "ele-printer-iframe";
|
|
3
|
-
const printStyleId = "ele-printer-style";
|
|
4
|
-
const printOptionId = "ele-printer-option";
|
|
5
|
-
const loadingId = "ele-printer-loading";
|
|
6
|
-
const printingClass = "ele-printer-printing";
|
|
7
|
-
const hideClass = "ele-printer-hide";
|
|
8
|
-
const hideNoneClass = "ele-printer-none";
|
|
9
|
-
function getPrintFrame() {
|
|
10
|
-
const pFrame = document.getElementById(printFrameId);
|
|
11
|
-
if (pFrame && pFrame.parentNode) {
|
|
12
|
-
pFrame.parentNode.removeChild(pFrame);
|
|
13
|
-
}
|
|
14
|
-
const elem = document.createElement("iframe");
|
|
15
|
-
elem.id = printFrameId;
|
|
16
|
-
elem.style.width = "0px";
|
|
17
|
-
elem.style.height = "0px";
|
|
18
|
-
elem.style.position = "fixed";
|
|
19
|
-
elem.style.visibility = "hidden";
|
|
20
|
-
document.body.appendChild(elem);
|
|
21
|
-
elem.focus();
|
|
22
|
-
return elem;
|
|
23
|
-
}
|
|
24
|
-
function getCommonCss(isPrinting = false) {
|
|
25
|
-
return `
|
|
26
|
-
@media print {
|
|
27
|
-
html, body {
|
|
28
|
-
padding: 0;
|
|
29
|
-
margin: 0;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* 打印时不显示的元素 */
|
|
34
|
-
.${hideClass}.${printingClass}${isPrinting ? ",." + hideClass : ""} {
|
|
35
|
-
visibility: hidden !important;
|
|
36
|
-
}
|
|
37
|
-
.${hideClass}.${printingClass}.${hideNoneClass} {
|
|
38
|
-
display: none !important;
|
|
39
|
-
}
|
|
40
|
-
.${hideClass}.${hideNoneClass} {
|
|
41
|
-
${isPrinting ? "display: none !important;" : ""}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* 表格样式 */
|
|
45
|
-
.ele-printer-table {
|
|
46
|
-
width: 100%;
|
|
47
|
-
border-collapse: collapse;
|
|
48
|
-
border: none;
|
|
49
|
-
}
|
|
50
|
-
.ele-printer-table td, .ele-printer-table th {
|
|
51
|
-
color: #333;
|
|
52
|
-
padding: 9px 15px;
|
|
53
|
-
border: 1px solid #333;
|
|
54
|
-
word-break: break-all;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/* loading 样式 */
|
|
58
|
-
#${loadingId} {
|
|
59
|
-
position: fixed;
|
|
60
|
-
top: 0;
|
|
61
|
-
left: 0;
|
|
62
|
-
right: 0;
|
|
63
|
-
bottom: 0;
|
|
64
|
-
background-color: hsla(0, 0%, 100%, .9);
|
|
65
|
-
z-index: 19000000;
|
|
66
|
-
}
|
|
67
|
-
#${loadingId}::after {
|
|
68
|
-
content: "";
|
|
69
|
-
width: 40px;
|
|
70
|
-
height: 40px;
|
|
71
|
-
position: absolute;
|
|
72
|
-
top: 50%;
|
|
73
|
-
left: 50%;
|
|
74
|
-
margin: -20px auto auto -20px;
|
|
75
|
-
border: 2px solid #3296FA;
|
|
76
|
-
border-right-color: transparent;
|
|
77
|
-
border-bottom-color: transparent;
|
|
78
|
-
border-radius: 50%;
|
|
79
|
-
animation: ele-printer-loading-anim .8s linear infinite;
|
|
80
|
-
}
|
|
81
|
-
@keyframes ele-printer-loading-anim {
|
|
82
|
-
from {
|
|
83
|
-
transform: rotate(0deg);
|
|
84
|
-
}
|
|
85
|
-
to {
|
|
86
|
-
transform: rotate(360deg);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/* 带页眉页脚页面样式 */
|
|
91
|
-
.ele-printer-table-page {
|
|
92
|
-
width: 100%;
|
|
93
|
-
border-collapse: collapse;
|
|
94
|
-
border: none;
|
|
95
|
-
}
|
|
96
|
-
.ele-printer-table-page > thead > tr > td,
|
|
97
|
-
.ele-printer-table-page > tbody > tr > td,
|
|
98
|
-
.ele-printer-table-page > tfoot > tr > td {
|
|
99
|
-
padding: 0;
|
|
100
|
-
border: none;
|
|
101
|
-
}
|
|
102
|
-
`;
|
|
103
|
-
}
|
|
104
|
-
function getPageStyleHtml(padding, width, height) {
|
|
105
|
-
return `
|
|
106
|
-
<style>
|
|
107
|
-
body {
|
|
108
|
-
margin: 0 !important;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/* 自定义边距及宽高样式 */
|
|
112
|
-
.ele-printer-page .ele-printer-page-item {
|
|
113
|
-
width: ${width ?? "auto"};
|
|
114
|
-
height: ${height ?? "auto"};
|
|
115
|
-
padding: ${padding ?? "0"};
|
|
116
|
-
page-break-after: always !important;
|
|
117
|
-
box-sizing: border-box !important;
|
|
118
|
-
border: none !important;
|
|
119
|
-
position: relative;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* 调试模式样式 */
|
|
123
|
-
.ele-printer-page.ele-printer-debug .ele-printer-page-item {
|
|
124
|
-
border: 1px solid red !important;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/* 全局样式 */
|
|
128
|
-
${getCommonCss(true)}
|
|
129
|
-
</style>
|
|
130
|
-
`;
|
|
131
|
-
}
|
|
132
|
-
function getOptionHtml(option) {
|
|
133
|
-
const { beforeJs, doneJs } = addCallback(option.before, option.done);
|
|
134
|
-
const blank = option.blank;
|
|
135
|
-
const closeJs = blank && option.close !== false ? "window.close();" : "";
|
|
136
|
-
const hideLoadJs = "parent.hideElePrinterLoading&&parent.hideElePrinterLoading();";
|
|
137
|
-
const optHtml = [];
|
|
138
|
-
optHtml.push(`<style type="text/css" media="print" id="${printOptionId}">`);
|
|
139
|
-
optHtml.push("@page {");
|
|
140
|
-
if (typeof option.horizontal !== "undefined") {
|
|
141
|
-
optHtml.push(`size: ${option.horizontal ? "landscape" : "portrait"};`);
|
|
142
|
-
}
|
|
143
|
-
if (option.margin != null) {
|
|
144
|
-
optHtml.push(`margin: ${option.margin};`);
|
|
145
|
-
}
|
|
146
|
-
optHtml.push(`}`);
|
|
147
|
-
optHtml.push(`</style>`);
|
|
148
|
-
if (option.print !== false) {
|
|
149
|
-
optHtml.push(`
|
|
150
|
-
<script>
|
|
151
|
-
window.onload = function() {
|
|
152
|
-
${beforeJs}
|
|
153
|
-
window.print();
|
|
154
|
-
${hideLoadJs}
|
|
155
|
-
${doneJs}
|
|
156
|
-
${closeJs}
|
|
157
|
-
}
|
|
158
|
-
<\/script>
|
|
159
|
-
`);
|
|
160
|
-
}
|
|
161
|
-
return optHtml.join("");
|
|
162
|
-
}
|
|
163
|
-
function addCommonCss() {
|
|
164
|
-
if (!document.getElementById(printStyleId)) {
|
|
165
|
-
const elem = document.createElement("style");
|
|
166
|
-
elem.id = printStyleId;
|
|
167
|
-
elem.setAttribute("type", "text/css");
|
|
168
|
-
elem.innerHTML = getCommonCss();
|
|
169
|
-
document.body.appendChild(elem);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
function addHeaderFooter(html, header, footer) {
|
|
173
|
-
if (!header && !footer) {
|
|
174
|
-
return html ?? "";
|
|
175
|
-
}
|
|
176
|
-
let result = '<table class="ele-printer-table-page">';
|
|
177
|
-
if (header) {
|
|
178
|
-
result += `<thead><tr><td>${header}</td></tr></thead>`;
|
|
179
|
-
}
|
|
180
|
-
result += `<tbody><tr><td>${html ?? ""}</td></tr></tbody>`;
|
|
181
|
-
if (footer) {
|
|
182
|
-
result += `<tfoot><tr><td>${footer}</td></tr></tfoot>`;
|
|
183
|
-
}
|
|
184
|
-
return result + "</table>";
|
|
185
|
-
}
|
|
186
|
-
function addCallback(before, done) {
|
|
187
|
-
const taskId = "p" + uuid(8);
|
|
188
|
-
if (!window["elePrinterBefore"]) {
|
|
189
|
-
window["elePrinterBefore"] = {};
|
|
190
|
-
}
|
|
191
|
-
if (!window["elePrinterDone"]) {
|
|
192
|
-
window["elePrinterDone"] = {};
|
|
193
|
-
}
|
|
194
|
-
if (before) {
|
|
195
|
-
window["elePrinterBefore"][taskId] = before;
|
|
196
|
-
}
|
|
197
|
-
if (done) {
|
|
198
|
-
window["elePrinterDone"][taskId] = done;
|
|
199
|
-
}
|
|
200
|
-
const beforeJs = `;parent.elePrinterBefore&&parent.elePrinterBefore.${taskId}&&parent.elePrinterBefore.${taskId}();`;
|
|
201
|
-
const doneJs = `;parent.elePrinterDone&&parent.elePrinterDone.${taskId}&&parent.elePrinterDone.${taskId}();`;
|
|
202
|
-
return { taskId, beforeJs, doneJs };
|
|
203
|
-
}
|
|
204
|
-
function hideElem(elems, isNone) {
|
|
205
|
-
var _a, _b;
|
|
206
|
-
Array.from(document.getElementsByClassName(hideClass)).forEach((elem) => {
|
|
207
|
-
if (elem == null ? void 0 : elem.classList) {
|
|
208
|
-
elem.classList.add(printingClass);
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
if (!elems) {
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
const isArray = (Array == null ? void 0 : Array.isArray(elems)) || ((_a = NodeList == null ? void 0 : NodeList.prototype) == null ? void 0 : _a.isPrototypeOf(elems)) || ((_b = HTMLCollection == null ? void 0 : HTMLCollection.prototype) == null ? void 0 : _b.isPrototypeOf(elems));
|
|
215
|
-
(isArray ? Array.from(elems) : [elems]).forEach(
|
|
216
|
-
(elem) => {
|
|
217
|
-
if (typeof elem === "string") {
|
|
218
|
-
Array.from(document.querySelectorAll(elem)).forEach((el) => {
|
|
219
|
-
if (el == null ? void 0 : el.classList) {
|
|
220
|
-
el.classList.add(hideClass);
|
|
221
|
-
el.classList.add(printingClass);
|
|
222
|
-
if (isNone) {
|
|
223
|
-
el.classList.add(hideNoneClass);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
} else if (elem == null ? void 0 : elem.classList) {
|
|
228
|
-
elem.classList.add(hideClass);
|
|
229
|
-
elem.classList.add(printingClass);
|
|
230
|
-
if (isNone) {
|
|
231
|
-
elem.classList.add(hideNoneClass);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
function showElem(elems) {
|
|
238
|
-
var _a, _b;
|
|
239
|
-
Array.from(document.getElementsByClassName(hideClass)).forEach((elem) => {
|
|
240
|
-
if (elem == null ? void 0 : elem.classList) {
|
|
241
|
-
elem.classList.remove(printingClass);
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
if (!elems) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
const isArray = (Array == null ? void 0 : Array.isArray(elems)) || ((_a = NodeList == null ? void 0 : NodeList.prototype) == null ? void 0 : _a.isPrototypeOf(elems)) || ((_b = HTMLCollection == null ? void 0 : HTMLCollection.prototype) == null ? void 0 : _b.isPrototypeOf(elems));
|
|
248
|
-
(isArray ? Array.from(elems) : [elems]).forEach(
|
|
249
|
-
(elem) => {
|
|
250
|
-
if (typeof elem === "string") {
|
|
251
|
-
Array.prototype.forEach.call(document.querySelectorAll(elem), (el) => {
|
|
252
|
-
if (el == null ? void 0 : el.classList) {
|
|
253
|
-
el.classList.remove(hideClass);
|
|
254
|
-
el.classList.remove(printingClass);
|
|
255
|
-
el.classList.remove(hideNoneClass);
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
} else if (elem == null ? void 0 : elem.classList) {
|
|
259
|
-
elem.classList.remove(hideClass);
|
|
260
|
-
elem.classList.remove(printingClass);
|
|
261
|
-
elem.classList.remove(hideNoneClass);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
|
-
function showLoading() {
|
|
267
|
-
addCommonCss();
|
|
268
|
-
let elem = document.getElementById(loadingId);
|
|
269
|
-
if (!elem) {
|
|
270
|
-
elem = document.createElement("div");
|
|
271
|
-
elem.id = loadingId;
|
|
272
|
-
document.body.appendChild(elem);
|
|
273
|
-
}
|
|
274
|
-
elem.style.display = "block";
|
|
275
|
-
window["hideElePrinterLoading"] = () => {
|
|
276
|
-
hideLoading();
|
|
277
|
-
};
|
|
278
|
-
return elem;
|
|
279
|
-
}
|
|
280
|
-
function hideLoading() {
|
|
281
|
-
const elem = document.getElementById(loadingId);
|
|
282
|
-
if (elem) {
|
|
283
|
-
elem.style.display = "none";
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
function printThis(option = {}) {
|
|
287
|
-
var _a;
|
|
288
|
-
window.focus();
|
|
289
|
-
addCommonCss();
|
|
290
|
-
const optElem = document.getElementById(printOptionId);
|
|
291
|
-
if (optElem && optElem.parentNode) {
|
|
292
|
-
optElem.parentNode.removeChild(optElem);
|
|
293
|
-
}
|
|
294
|
-
const optStr = [];
|
|
295
|
-
if (typeof option.horizontal === "boolean") {
|
|
296
|
-
optStr.push(`size: ${option.horizontal ? "landscape" : "portrait"};`);
|
|
297
|
-
}
|
|
298
|
-
if (option.margin != null) {
|
|
299
|
-
optStr.push(`margin: ${option.margin};`);
|
|
300
|
-
}
|
|
301
|
-
if (optStr) {
|
|
302
|
-
const elem = document.createElement("style");
|
|
303
|
-
elem.id = printOptionId;
|
|
304
|
-
elem.setAttribute("type", "text/css");
|
|
305
|
-
elem.setAttribute("media", "print");
|
|
306
|
-
elem.innerHTML = `@page { ${optStr.join("")} }`;
|
|
307
|
-
document.body.appendChild(elem);
|
|
308
|
-
}
|
|
309
|
-
hideElem(option.hide, option.isHideNone);
|
|
310
|
-
const oldTitle = document.title;
|
|
311
|
-
if (option.title) {
|
|
312
|
-
document.title = option.title;
|
|
313
|
-
}
|
|
314
|
-
let pWin;
|
|
315
|
-
if (!option.blank) {
|
|
316
|
-
pWin = window;
|
|
317
|
-
pWin.print();
|
|
318
|
-
} else {
|
|
319
|
-
pWin = window.open("", "_blank");
|
|
320
|
-
if (pWin) {
|
|
321
|
-
pWin.focus();
|
|
322
|
-
const pDoc = pWin.document;
|
|
323
|
-
if (pDoc) {
|
|
324
|
-
pDoc.open();
|
|
325
|
-
let html = "<!DOCTYPE html>" + ((_a = document.getElementsByTagName("html")[0]) == null ? void 0 : _a.outerHTML);
|
|
326
|
-
html = html.replace(/<script/g, '<div style="display:none;" ').replace(/<\/script>/g, "</div>");
|
|
327
|
-
const addHtml = function(str) {
|
|
328
|
-
html = html.replace(/<\/html>/, `${str}</html>`);
|
|
329
|
-
};
|
|
330
|
-
addHtml(`
|
|
331
|
-
<script>
|
|
332
|
-
window.onload = function() {
|
|
333
|
-
window.print();
|
|
334
|
-
${option.close !== false ? "window.close();" : ""}
|
|
335
|
-
}
|
|
336
|
-
<\/script>
|
|
337
|
-
`);
|
|
338
|
-
pDoc.write(html);
|
|
339
|
-
pDoc.close();
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
if (option.title) {
|
|
344
|
-
document.title = oldTitle;
|
|
345
|
-
}
|
|
346
|
-
showElem(option.hide);
|
|
347
|
-
return pWin;
|
|
348
|
-
}
|
|
349
|
-
function printHtml(option) {
|
|
350
|
-
if (option.loading !== false && option.blank !== true) {
|
|
351
|
-
showLoading();
|
|
352
|
-
}
|
|
353
|
-
let pWin, pDoc;
|
|
354
|
-
if (option.blank) {
|
|
355
|
-
pWin = window.open("", "_blank");
|
|
356
|
-
pDoc = pWin == null ? void 0 : pWin.document;
|
|
357
|
-
} else {
|
|
358
|
-
const pFrame = getPrintFrame();
|
|
359
|
-
pWin = pFrame.contentWindow;
|
|
360
|
-
pDoc = pFrame.contentDocument || (pWin == null ? void 0 : pWin.document);
|
|
361
|
-
}
|
|
362
|
-
if (pWin) {
|
|
363
|
-
pWin.focus();
|
|
364
|
-
if (pDoc && option.html) {
|
|
365
|
-
pDoc.open();
|
|
366
|
-
pDoc.write(`
|
|
367
|
-
<!DOCTYPE html>
|
|
368
|
-
<head>
|
|
369
|
-
<meta charset="UTF-8"/>
|
|
370
|
-
<title>${option.title ?? ""}</title>
|
|
371
|
-
<style>
|
|
372
|
-
${getCommonCss(true)}
|
|
373
|
-
</style>
|
|
374
|
-
${option.style ?? ""}
|
|
375
|
-
</head>
|
|
376
|
-
<html>
|
|
377
|
-
<body>
|
|
378
|
-
${addHeaderFooter(option.html, option.header, option.footer)}
|
|
379
|
-
${getOptionHtml(option)}
|
|
380
|
-
</body>
|
|
381
|
-
</html>
|
|
382
|
-
`);
|
|
383
|
-
pDoc.close();
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
return pWin;
|
|
387
|
-
}
|
|
388
|
-
function printPage(option) {
|
|
389
|
-
var _a;
|
|
390
|
-
if (option.loading !== false && option.blank !== true) {
|
|
391
|
-
showLoading();
|
|
392
|
-
}
|
|
393
|
-
let pWin, pDoc;
|
|
394
|
-
if (option.blank) {
|
|
395
|
-
pWin = window.open("", "_blank");
|
|
396
|
-
pDoc = pWin == null ? void 0 : pWin.document;
|
|
397
|
-
} else {
|
|
398
|
-
const pFrame = getPrintFrame();
|
|
399
|
-
pWin = pFrame.contentWindow;
|
|
400
|
-
pDoc = pFrame.contentDocument || (pWin == null ? void 0 : pWin.document);
|
|
401
|
-
}
|
|
402
|
-
if (pWin && pDoc) {
|
|
403
|
-
pWin.focus();
|
|
404
|
-
const content = ((_a = option.pages) == null ? void 0 : _a.map((h) => `<div class="ele-printer-page-item">${h}</div>`).join("")) ?? "";
|
|
405
|
-
const pageClass = "ele-printer-page" + (option.isDebug ? " ele-printer-debug" : "");
|
|
406
|
-
const contentHtml = `<div class="${pageClass}">${content}</div>`;
|
|
407
|
-
pDoc.open();
|
|
408
|
-
pDoc.write(`
|
|
409
|
-
<!DOCTYPE html>
|
|
410
|
-
<html>
|
|
411
|
-
<head>
|
|
412
|
-
<meta charset="UTF-8"/>
|
|
413
|
-
<title>${option.title ?? ""}</title>
|
|
414
|
-
${getPageStyleHtml(option.padding, option.width, option.height)}
|
|
415
|
-
${option.style ?? ""}
|
|
416
|
-
</head>
|
|
417
|
-
<body>
|
|
418
|
-
${addHeaderFooter(contentHtml, option.header, option.footer)}
|
|
419
|
-
${getOptionHtml(option)}
|
|
420
|
-
</body>
|
|
421
|
-
</html>
|
|
422
|
-
`);
|
|
423
|
-
pDoc.close();
|
|
424
|
-
}
|
|
425
|
-
return pWin;
|
|
426
|
-
}
|
|
427
|
-
function printPdf(option) {
|
|
428
|
-
if (option.loading !== false) {
|
|
429
|
-
showLoading();
|
|
430
|
-
}
|
|
431
|
-
const pFrame = getPrintFrame();
|
|
432
|
-
const pWin = pFrame.contentWindow;
|
|
433
|
-
pFrame.onload = () => {
|
|
434
|
-
if (!pFrame.getAttribute("src")) {
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
437
|
-
pFrame.focus();
|
|
438
|
-
option.before && option.before();
|
|
439
|
-
pWin == null ? void 0 : pWin.print();
|
|
440
|
-
hideLoading();
|
|
441
|
-
option.done && option.done();
|
|
442
|
-
};
|
|
443
|
-
function doPrint(arraybuffer) {
|
|
444
|
-
const localPdf = new window.Blob([arraybuffer], {
|
|
445
|
-
type: "application/pdf"
|
|
446
|
-
});
|
|
447
|
-
pFrame.setAttribute("src", window.URL.createObjectURL(localPdf));
|
|
448
|
-
}
|
|
449
|
-
if (option.arraybuffer) {
|
|
450
|
-
doPrint(option.arraybuffer);
|
|
451
|
-
} else if (option.url) {
|
|
452
|
-
const req = new window.XMLHttpRequest();
|
|
453
|
-
req.open("GET", option.url, true);
|
|
454
|
-
req.responseType = "arraybuffer";
|
|
455
|
-
req.onload = () => {
|
|
456
|
-
if ([200, 201].indexOf(req.status) === -1) {
|
|
457
|
-
return option.error && option.error(req.status, req.statusText);
|
|
458
|
-
}
|
|
459
|
-
doPrint(req.response);
|
|
460
|
-
};
|
|
461
|
-
req.send();
|
|
462
|
-
}
|
|
463
|
-
return pWin;
|
|
464
|
-
}
|
|
465
|
-
function makeTable(data, cols) {
|
|
466
|
-
cols.forEach((col) => {
|
|
467
|
-
col.forEach((c) => {
|
|
468
|
-
c.INIT_OK = void 0;
|
|
469
|
-
c.key = void 0;
|
|
470
|
-
c.colGroup = void 0;
|
|
471
|
-
c.HAS_PARENT = void 0;
|
|
472
|
-
c.parentKey = void 0;
|
|
473
|
-
c.PARENT_COL_INDEX = void 0;
|
|
474
|
-
});
|
|
475
|
-
});
|
|
476
|
-
const colArrays = [];
|
|
477
|
-
let colIndex = 0;
|
|
478
|
-
for (let i1 = 0; i1 < cols.length; i1++) {
|
|
479
|
-
const item1 = cols[i1];
|
|
480
|
-
for (let i2 = 0; i2 < item1.length; i2++) {
|
|
481
|
-
const item2 = item1[i2];
|
|
482
|
-
if (!item2) {
|
|
483
|
-
item1.splice(i2, 1);
|
|
484
|
-
continue;
|
|
485
|
-
}
|
|
486
|
-
item2.key = i1 + "-" + i2;
|
|
487
|
-
let CHILD_COLS = void 0;
|
|
488
|
-
if (item2.colGroup || item2.colspan && item2.colspan > 1) {
|
|
489
|
-
item2.colGroup = true;
|
|
490
|
-
CHILD_COLS = [];
|
|
491
|
-
colIndex++;
|
|
492
|
-
let childIndex = 0;
|
|
493
|
-
for (let i22 = 0; i22 < cols[i1 + 1].length; i22++) {
|
|
494
|
-
const item22 = { ...cols[i1 + 1][i22] };
|
|
495
|
-
if (item22.HAS_PARENT || childIndex > 1 && childIndex == item2.colspan) {
|
|
496
|
-
cols[i1 + 1][i22] = item22;
|
|
497
|
-
continue;
|
|
498
|
-
}
|
|
499
|
-
item22.HAS_PARENT = true;
|
|
500
|
-
item22.parentKey = i1 + "-" + i2;
|
|
501
|
-
item22.key = i1 + 1 + "-" + i22;
|
|
502
|
-
item22.PARENT_COL_INDEX = colIndex;
|
|
503
|
-
CHILD_COLS.push(item22);
|
|
504
|
-
childIndex = childIndex + Number(item22.colspan && item22.colspan > 1 ? item22.colspan : 1);
|
|
505
|
-
cols[i1 + 1][i22] = item22;
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
item2.CHILD_COLS = CHILD_COLS;
|
|
509
|
-
if (!item2.PARENT_COL_INDEX) {
|
|
510
|
-
colArrays.push(item2);
|
|
511
|
-
}
|
|
512
|
-
cols[i1][i2] = item2;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
const eachCols = function(callback, arr) {
|
|
516
|
-
if (!arr) {
|
|
517
|
-
arr = colArrays;
|
|
518
|
-
}
|
|
519
|
-
for (let i = 0; i < arr.length; i++) {
|
|
520
|
-
const item = arr[i];
|
|
521
|
-
callback && callback(i, item);
|
|
522
|
-
if (item.CHILD_COLS) {
|
|
523
|
-
eachCols(callback, item.CHILD_COLS);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
};
|
|
527
|
-
let maxWidth = 1;
|
|
528
|
-
let needSetWidth = true;
|
|
529
|
-
const colgroupHtml = [];
|
|
530
|
-
eachCols((_i, c) => {
|
|
531
|
-
if (!c.colGroup) {
|
|
532
|
-
colgroupHtml.push("<col");
|
|
533
|
-
if (c.width) {
|
|
534
|
-
colgroupHtml.push(` width="${c.width}"`);
|
|
535
|
-
}
|
|
536
|
-
colgroupHtml.push("/>");
|
|
537
|
-
if (c.width && !/\d+%$/.test(String(c.width))) {
|
|
538
|
-
maxWidth += c.width + 1;
|
|
539
|
-
} else {
|
|
540
|
-
needSetWidth = false;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
});
|
|
544
|
-
const thHtml = cols.map((cs) => {
|
|
545
|
-
const th = cs.map((c) => {
|
|
546
|
-
return `<th
|
|
547
|
-
colspan="${c.colspan || 1}"
|
|
548
|
-
rowspan="${c.rowspan || 1}"
|
|
549
|
-
align="${c.thAlign || c.align || "left"}"
|
|
550
|
-
style="${c.thStyle}">${c.title || ""}
|
|
551
|
-
</th>`;
|
|
552
|
-
}).join("");
|
|
553
|
-
return "<tr>" + th + "</tr>";
|
|
554
|
-
}).join("");
|
|
555
|
-
const headHtml = "<thead>" + thHtml + "</thead>";
|
|
556
|
-
const trHtml = data.map((d, index) => {
|
|
557
|
-
const tr = ["<tr>"];
|
|
558
|
-
let colIndex2 = 0;
|
|
559
|
-
eachCols((_i, c) => {
|
|
560
|
-
if (!c.colGroup) {
|
|
561
|
-
const value = c.field ? d[c.field] : "";
|
|
562
|
-
const content = c.templet ? c.templet(d, index, colIndex2) : value;
|
|
563
|
-
const align = c.align || "left";
|
|
564
|
-
tr.push(`<td align="${align}" style="${c.style}">${content}</td>`);
|
|
565
|
-
colIndex2++;
|
|
566
|
-
}
|
|
567
|
-
});
|
|
568
|
-
tr.push("</tr>");
|
|
569
|
-
return tr.join("");
|
|
570
|
-
}).join("");
|
|
571
|
-
const bodyHtml = "<tbody>" + trHtml + "</tbody>";
|
|
572
|
-
return `<table
|
|
573
|
-
style="width: ${needSetWidth ? maxWidth + "px" : "100%"};"
|
|
574
|
-
class="ele-printer-table">
|
|
575
|
-
<colgroup>${colgroupHtml.join("")}</colgroup>
|
|
576
|
-
${headHtml} ${bodyHtml}
|
|
577
|
-
</table>`;
|
|
578
|
-
}
|
|
579
|
-
function printElement(elem, option) {
|
|
580
|
-
if (!elem) {
|
|
581
|
-
return null;
|
|
582
|
-
}
|
|
583
|
-
const bodyChilds = Array.prototype.filter.call(
|
|
584
|
-
document.body.children,
|
|
585
|
-
(el) => {
|
|
586
|
-
if (typeof (el == null ? void 0 : el.tagName) === "string" && ["style", "script", "link"].includes(el.tagName.toLowerCase())) {
|
|
587
|
-
return false;
|
|
588
|
-
}
|
|
589
|
-
return true;
|
|
590
|
-
}
|
|
591
|
-
);
|
|
592
|
-
hideElem(bodyChilds, true);
|
|
593
|
-
const parntEl = elem.parentNode;
|
|
594
|
-
const nextEl = elem.nextElementSibling;
|
|
595
|
-
document.body.append(elem);
|
|
596
|
-
const pWin = printThis(option);
|
|
597
|
-
if (nextEl) {
|
|
598
|
-
parntEl == null ? void 0 : parntEl.insertBefore(elem, nextEl);
|
|
599
|
-
} else {
|
|
600
|
-
parntEl == null ? void 0 : parntEl.append(elem);
|
|
601
|
-
}
|
|
602
|
-
showElem(bodyChilds);
|
|
603
|
-
return pWin;
|
|
604
|
-
}
|
|
605
|
-
export {
|
|
606
|
-
makeTable,
|
|
607
|
-
printElement,
|
|
608
|
-
printHtml,
|
|
609
|
-
printPage,
|
|
610
|
-
printPdf,
|
|
611
|
-
printThis
|
|
612
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const vue = require("vue");
|
|
4
|
-
const keys = require("./keys");
|
|
5
|
-
const defaultLocale = require("../lang/zh_CN");
|
|
6
|
-
function useReceiver() {
|
|
7
|
-
return vue.inject(keys.PROVIDE_KEY, {});
|
|
8
|
-
}
|
|
9
|
-
function useGlobalProps(name) {
|
|
10
|
-
const globalConfig = useReceiver();
|
|
11
|
-
return vue.computed(() => globalConfig[name] ?? {});
|
|
12
|
-
}
|
|
13
|
-
function useLocale(name, props) {
|
|
14
|
-
const globalConfig = useReceiver();
|
|
15
|
-
const lang = vue.computed(() => {
|
|
16
|
-
const temp = globalConfig.locale ?? defaultLocale;
|
|
17
|
-
if (name) {
|
|
18
|
-
return Object.assign(temp[name] ?? {}, props.locale);
|
|
19
|
-
}
|
|
20
|
-
return temp;
|
|
21
|
-
});
|
|
22
|
-
return { lang, globalConfig };
|
|
23
|
-
}
|
|
24
|
-
function useLayoutState(defaultValue) {
|
|
25
|
-
return vue.inject(keys.LAYOUT_KEY, defaultValue);
|
|
26
|
-
}
|
|
27
|
-
function useResponsive(props) {
|
|
28
|
-
const state = useLayoutState();
|
|
29
|
-
return vue.computed(() => {
|
|
30
|
-
var _a;
|
|
31
|
-
return props.responsive ?? ((_a = vue.unref(state)) == null ? void 0 : _a.responsive) ?? true;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
exports.useGlobalProps = useGlobalProps;
|
|
35
|
-
exports.useLayoutState = useLayoutState;
|
|
36
|
-
exports.useLocale = useLocale;
|
|
37
|
-
exports.useReceiver = useReceiver;
|
|
38
|
-
exports.useResponsive = useResponsive;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 创建 iframe 组件
|
|
3
|
-
* @param name 组件名称
|
|
4
|
-
* @param url 链接地址
|
|
5
|
-
*/
|
|
6
|
-
export declare function createIframe(name: string | undefined, url: string): import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|