ele-admin-plus 1.0.0-beta.1
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/README.md +37 -0
- package/es/components.d.ts +43 -0
- package/es/components.js +88 -0
- package/es/ele-app/index.d.ts +4 -0
- package/es/ele-app/index.js +13 -0
- package/es/ele-app/style/common.js +1 -0
- package/es/ele-app/style/common.scss +116 -0
- package/es/ele-app/style/css-var.scss +29 -0
- package/es/ele-app/style/index.js +5 -0
- package/es/ele-app/style/index.scss +3 -0
- package/es/ele-app/style/message.js +2 -0
- package/es/ele-app/style/message.scss +101 -0
- package/es/ele-app/style/scrollbar.js +1 -0
- package/es/ele-app/style/scrollbar.scss +80 -0
- package/es/ele-avatar-group/index.d.ts +70 -0
- package/es/ele-avatar-group/index.js +178 -0
- package/es/ele-avatar-group/props.d.ts +37 -0
- package/es/ele-avatar-group/props.js +45 -0
- package/es/ele-avatar-group/style/index.js +4 -0
- package/es/ele-avatar-group/style/index.scss +36 -0
- package/es/ele-avatar-group/types/index.d.ts +16 -0
- package/es/ele-bar-code/index.d.ts +47 -0
- package/es/ele-bar-code/index.js +67 -0
- package/es/ele-bar-code/props.d.ts +15 -0
- package/es/ele-bar-code/props.js +14 -0
- package/es/ele-bar-code/style/index.js +1 -0
- package/es/ele-bar-code/types/index.d.ts +4 -0
- package/es/ele-basic-select/components/select-tag.d.ts +24 -0
- package/es/ele-basic-select/components/select-tag.js +65 -0
- package/es/ele-basic-select/index.d.ts +19250 -0
- package/es/ele-basic-select/index.js +227 -0
- package/es/ele-basic-select/props.d.ts +39 -0
- package/es/ele-basic-select/props.js +60 -0
- package/es/ele-basic-select/style/index.js +5 -0
- package/es/ele-basic-select/style/index.scss +104 -0
- package/es/ele-basic-select/types/index.d.ts +21 -0
- package/es/ele-bottom-bar/index.d.ts +8 -0
- package/es/ele-bottom-bar/index.js +34 -0
- package/es/ele-bottom-bar/props.d.ts +9 -0
- package/es/ele-bottom-bar/props.js +9 -0
- package/es/ele-bottom-bar/style/css-var.scss +7 -0
- package/es/ele-bottom-bar/style/index.js +1 -0
- package/es/ele-bottom-bar/style/index.scss +25 -0
- package/es/ele-breadcrumb/index.d.ts +194 -0
- package/es/ele-breadcrumb/index.js +64 -0
- package/es/ele-breadcrumb/props.d.ts +19 -0
- package/es/ele-breadcrumb/props.js +12 -0
- package/es/ele-breadcrumb/style/index.js +3 -0
- package/es/ele-breadcrumb/style/index.scss +30 -0
- package/es/ele-breadcrumb/types/index.d.ts +22 -0
- package/es/ele-card/index.d.ts +26 -0
- package/es/ele-card/index.js +55 -0
- package/es/ele-card/props.d.ts +16 -0
- package/es/ele-card/props.js +20 -0
- package/es/ele-card/style/css-var.scss +7 -0
- package/es/ele-card/style/index.js +2 -0
- package/es/ele-card/style/index.scss +61 -0
- package/es/ele-config-provider/index.d.ts +18 -0
- package/es/ele-config-provider/index.js +49 -0
- package/es/ele-config-provider/keys.d.ts +8 -0
- package/es/ele-config-provider/keys.js +6 -0
- package/es/ele-config-provider/props.d.ts +13 -0
- package/es/ele-config-provider/props.js +15 -0
- package/es/ele-config-provider/style/index.js +1 -0
- package/es/ele-config-provider/types/index.d.ts +90 -0
- package/es/ele-config-provider/use-receiver.d.ts +22 -0
- package/es/ele-config-provider/use-receiver.js +38 -0
- package/es/ele-count-up/index.d.ts +36 -0
- package/es/ele-count-up/index.js +107 -0
- package/es/ele-count-up/props.d.ts +23 -0
- package/es/ele-count-up/props.js +22 -0
- package/es/ele-count-up/style/index.js +1 -0
- package/es/ele-cropper/components/cropper-preview.d.ts +17 -0
- package/es/ele-cropper/components/cropper-preview.js +74 -0
- package/es/ele-cropper/components/cropper-tools.d.ts +55 -0
- package/es/ele-cropper/components/cropper-tools.js +186 -0
- package/es/ele-cropper/index.d.ts +108 -0
- package/es/ele-cropper/index.js +216 -0
- package/es/ele-cropper/props.d.ts +51 -0
- package/es/ele-cropper/props.js +59 -0
- package/es/ele-cropper/style/index.js +6 -0
- package/es/ele-cropper/style/index.scss +98 -0
- package/es/ele-cropper/types/index.d.ts +69 -0
- package/es/ele-cropper-modal/index.d.ts +99 -0
- package/es/ele-cropper-modal/index.js +93 -0
- package/es/ele-cropper-modal/props.d.ts +52 -0
- package/es/ele-cropper-modal/props.js +18 -0
- package/es/ele-cropper-modal/style/index.js +2 -0
- package/es/ele-dashboard/index.d.ts +16 -0
- package/es/ele-dashboard/index.js +70 -0
- package/es/ele-dashboard/props.d.ts +12 -0
- package/es/ele-dashboard/props.js +13 -0
- package/es/ele-dashboard/style/index.js +1 -0
- package/es/ele-dashboard/style/index.scss +78 -0
- package/es/ele-dashboard/types/index.d.ts +4 -0
- package/es/ele-dot/index.d.ts +29 -0
- package/es/ele-dot/index.js +44 -0
- package/es/ele-dot/props.d.ts +19 -0
- package/es/ele-dot/props.js +21 -0
- package/es/ele-dot/style/index.js +1 -0
- package/es/ele-dot/style/index.scss +67 -0
- package/es/ele-dot/types/index.d.ts +4 -0
- package/es/ele-drawer/index.d.ts +516 -0
- package/es/ele-drawer/index.js +139 -0
- package/es/ele-drawer/props.d.ts +63 -0
- package/es/ele-drawer/props.js +15 -0
- package/es/ele-drawer/style/css-var.scss +12 -0
- package/es/ele-drawer/style/index.js +3 -0
- package/es/ele-drawer/style/index.scss +61 -0
- package/es/ele-edit-tag/index.d.ts +856 -0
- package/es/ele-edit-tag/index.js +216 -0
- package/es/ele-edit-tag/props.d.ts +31 -0
- package/es/ele-edit-tag/props.js +39 -0
- package/es/ele-edit-tag/style/index.js +5 -0
- package/es/ele-edit-tag/style/index.scss +60 -0
- package/es/ele-edit-tag/types/index.d.ts +8 -0
- package/es/ele-ellipsis/index.d.ts +58 -0
- package/es/ele-ellipsis/index.js +103 -0
- package/es/ele-ellipsis/props.d.ts +27 -0
- package/es/ele-ellipsis/props.js +16 -0
- package/es/ele-ellipsis/style/index.js +3 -0
- package/es/ele-ellipsis/style/index.scss +23 -0
- package/es/ele-ellipsis/types/index.d.ts +8 -0
- package/es/ele-file-list/components/file-grid-item.d.ts +24409 -0
- package/es/ele-file-list/components/file-grid-item.js +171 -0
- package/es/ele-file-list/components/file-grid.d.ts +46 -0
- package/es/ele-file-list/components/file-grid.js +141 -0
- package/es/ele-file-list/components/file-sort.d.ts +16 -0
- package/es/ele-file-list/components/file-sort.js +35 -0
- package/es/ele-file-list/components/file-table-item.d.ts +24411 -0
- package/es/ele-file-list/components/file-table-item.js +201 -0
- package/es/ele-file-list/components/file-table.d.ts +60 -0
- package/es/ele-file-list/components/file-table.js +220 -0
- package/es/ele-file-list/icons.d.ts +9 -0
- package/es/ele-file-list/icons.js +222 -0
- package/es/ele-file-list/index.d.ts +1644 -0
- package/es/ele-file-list/index.js +276 -0
- package/es/ele-file-list/props.d.ts +43 -0
- package/es/ele-file-list/props.js +61 -0
- package/es/ele-file-list/style/css-var.scss +7 -0
- package/es/ele-file-list/style/index.js +3 -0
- package/es/ele-file-list/style/index.scss +415 -0
- package/es/ele-file-list/types/index.d.ts +86 -0
- package/es/ele-file-list-tool/index.d.ts +8 -0
- package/es/ele-file-list-tool/index.js +31 -0
- package/es/ele-file-list-tool/style/index.js +1 -0
- package/es/ele-icon-select/components/icon-grid.d.ts +36 -0
- package/es/ele-icon-select/components/icon-grid.js +87 -0
- package/es/ele-icon-select/components/icon-popper.d.ts +47 -0
- package/es/ele-icon-select/components/icon-popper.js +242 -0
- package/es/ele-icon-select/index.d.ts +149 -0
- package/es/ele-icon-select/index.js +142 -0
- package/es/ele-icon-select/props.d.ts +73 -0
- package/es/ele-icon-select/props.js +96 -0
- package/es/ele-icon-select/style/index.js +5 -0
- package/es/ele-icon-select/style/index.scss +197 -0
- package/es/ele-icon-select/types/index.d.ts +16 -0
- package/es/ele-loading/index.d.ts +14 -0
- package/es/ele-loading/index.js +34 -0
- package/es/ele-loading/props.d.ts +11 -0
- package/es/ele-loading/props.js +13 -0
- package/es/ele-loading/style/index.js +1 -0
- package/es/ele-map-picker/components/map-view.d.ts +190 -0
- package/es/ele-map-picker/components/map-view.js +594 -0
- package/es/ele-map-picker/index.d.ts +164 -0
- package/es/ele-map-picker/index.js +117 -0
- package/es/ele-map-picker/props.d.ts +137 -0
- package/es/ele-map-picker/props.js +108 -0
- package/es/ele-map-picker/style/index.js +8 -0
- package/es/ele-map-picker/style/index.scss +242 -0
- package/es/ele-map-picker/types/index.d.ts +88 -0
- package/es/ele-menus/index.d.ts +247 -0
- package/es/ele-menus/index.js +233 -0
- package/es/ele-menus/props.d.ts +37 -0
- package/es/ele-menus/props.js +30 -0
- package/es/ele-menus/style/css-var.scss +44 -0
- package/es/ele-menus/style/index.js +6 -0
- package/es/ele-menus/style/index.scss +541 -0
- package/es/ele-menus/style/scrollbar.scss +68 -0
- package/es/ele-menus/types/index.d.ts +57 -0
- package/es/ele-modal/index.d.ts +1122 -0
- package/es/ele-modal/index.js +326 -0
- package/es/ele-modal/props.d.ts +101 -0
- package/es/ele-modal/props.js +61 -0
- package/es/ele-modal/style/css-var.scss +14 -0
- package/es/ele-modal/style/index.js +3 -0
- package/es/ele-modal/style/index.scss +244 -0
- package/es/ele-modal/types/index.d.ts +27 -0
- package/es/ele-modal/util.d.ts +73 -0
- package/es/ele-modal/util.js +332 -0
- package/es/ele-page/index.d.ts +17 -0
- package/es/ele-page/index.js +30 -0
- package/es/ele-page/props.d.ts +11 -0
- package/es/ele-page/props.js +13 -0
- package/es/ele-page/style/css-var.scss +8 -0
- package/es/ele-page/style/index.js +1 -0
- package/es/ele-page/style/index.scss +62 -0
- package/es/ele-pagination/index.d.ts +71 -0
- package/es/ele-pagination/index.js +64 -0
- package/es/ele-pagination/props.d.ts +37 -0
- package/es/ele-pagination/props.js +19 -0
- package/es/ele-pagination/style/index.js +2 -0
- package/es/ele-pagination/style/index.scss +51 -0
- package/es/ele-pagination/types/index.d.ts +4 -0
- package/es/ele-pro-layout/components/header-tool.d.ts +2 -0
- package/es/ele-pro-layout/components/header-tool.js +21 -0
- package/es/ele-pro-layout/components/pro-header.d.ts +70 -0
- package/es/ele-pro-layout/components/pro-header.js +188 -0
- package/es/ele-pro-layout/components/pro-sidebar.d.ts +53 -0
- package/es/ele-pro-layout/components/pro-sidebar.js +98 -0
- package/es/ele-pro-layout/components/pro-sidebox.d.ts +36 -0
- package/es/ele-pro-layout/components/pro-sidebox.js +81 -0
- package/es/ele-pro-layout/components/pro-tab-bar.d.ts +59 -0
- package/es/ele-pro-layout/components/pro-tab-bar.js +203 -0
- package/es/ele-pro-layout/components/sidebar-tool.d.ts +2 -0
- package/es/ele-pro-layout/components/sidebar-tool.js +21 -0
- package/es/ele-pro-layout/components/tab-dropdown.d.ts +8 -0
- package/es/ele-pro-layout/components/tab-dropdown.js +72 -0
- package/es/ele-pro-layout/index.js +670 -0
- package/es/ele-pro-layout/props.d.ts +159 -0
- package/es/ele-pro-layout/props.js +203 -0
- package/es/ele-pro-layout/style/collapse.scss +67 -0
- package/es/ele-pro-layout/style/css-var.scss +36 -0
- package/es/ele-pro-layout/style/header.scss +87 -0
- package/es/ele-pro-layout/style/index.js +9 -0
- package/es/ele-pro-layout/style/index.scss +12 -0
- package/es/ele-pro-layout/style/layout-mobile.scss +56 -0
- package/es/ele-pro-layout/style/layout-style.scss +139 -0
- package/es/ele-pro-layout/style/layout-theme.scss +87 -0
- package/es/ele-pro-layout/style/layout.scss +56 -0
- package/es/ele-pro-layout/style/sidebar.scss +180 -0
- package/es/ele-pro-layout/style/tabs.scss +64 -0
- package/es/ele-pro-layout/types/index.d.ts +215 -0
- package/es/ele-pro-layout/util.d.ts +99 -0
- package/es/ele-pro-layout/util.js +216 -0
- package/es/ele-pro-table/components/table-tools.d.ts +43 -0
- package/es/ele-pro-table/components/table-tools.js +209 -0
- package/es/ele-pro-table/components/table-view.d.ts +838 -0
- package/es/ele-pro-table/components/table-view.js +82 -0
- package/es/ele-pro-table/components/tool-column.d.ts +57 -0
- package/es/ele-pro-table/components/tool-column.js +364 -0
- package/es/ele-pro-table/index.d.ts +2214 -0
- package/es/ele-pro-table/index.js +660 -0
- package/es/ele-pro-table/props.d.ts +215 -0
- package/es/ele-pro-table/props.js +140 -0
- package/es/ele-pro-table/style/css-var.scss +11 -0
- package/es/ele-pro-table/style/index.js +17 -0
- package/es/ele-pro-table/style/index.scss +229 -0
- package/es/ele-pro-table/types/index.d.ts +278 -0
- package/es/ele-pro-table/util.d.ts +153 -0
- package/es/ele-pro-table/util.js +415 -0
- package/es/ele-qr-code/index.d.ts +67 -0
- package/es/ele-qr-code/index.js +153 -0
- package/es/ele-qr-code/props.d.ts +37 -0
- package/es/ele-qr-code/props.js +41 -0
- package/es/ele-qr-code/qrcodegen.d.ts +95 -0
- package/es/ele-qr-code/qrcodegen.js +1094 -0
- package/es/ele-qr-code/style/index.js +1 -0
- package/es/ele-qr-code/types/index.d.ts +28 -0
- package/es/ele-qr-code/util.d.ts +26 -0
- package/es/ele-qr-code/util.js +90 -0
- package/es/ele-qr-code-svg/index.d.ts +70 -0
- package/es/ele-qr-code-svg/index.js +130 -0
- package/es/ele-qr-code-svg/style/index.js +1 -0
- package/es/ele-split-panel/index.d.ts +61 -0
- package/es/ele-split-panel/index.js +171 -0
- package/es/ele-split-panel/props.d.ts +30 -0
- package/es/ele-split-panel/props.js +41 -0
- package/es/ele-split-panel/style/index.js +2 -0
- package/es/ele-split-panel/style/index.scss +353 -0
- package/es/ele-steps/index.d.ts +54 -0
- package/es/ele-steps/index.js +50 -0
- package/es/ele-steps/props.d.ts +30 -0
- package/es/ele-steps/props.js +14 -0
- package/es/ele-steps/style/index.js +3 -0
- package/es/ele-steps/style/index.scss +120 -0
- package/es/ele-steps/types/index.d.ts +11 -0
- package/es/ele-tab-tool/index.d.ts +11 -0
- package/es/ele-tab-tool/index.js +24 -0
- package/es/ele-tab-tool/props.d.ts +9 -0
- package/es/ele-tab-tool/props.js +9 -0
- package/es/ele-tab-tool/style/index.js +1 -0
- package/es/ele-tab-wrap/index.d.ts +8 -0
- package/es/ele-tab-wrap/index.js +31 -0
- package/es/ele-tab-wrap/props.d.ts +10 -0
- package/es/ele-tab-wrap/props.js +9 -0
- package/es/ele-tab-wrap/style/index.js +1 -0
- package/es/ele-table/index.d.ts +13 -0
- package/es/ele-table/index.js +30 -0
- package/es/ele-table/props.d.ts +10 -0
- package/es/ele-table/props.js +11 -0
- package/es/ele-table/style/css-var.scss +7 -0
- package/es/ele-table/style/index.js +1 -0
- package/es/ele-table/style/index.scss +87 -0
- package/es/ele-table-select/index.d.ts +159 -0
- package/es/ele-table-select/index.js +387 -0
- package/es/ele-table-select/props.d.ts +74 -0
- package/es/ele-table-select/props.js +97 -0
- package/es/ele-table-select/style/index.js +3 -0
- package/es/ele-table-select/style/index.scss +9 -0
- package/es/ele-table-select/types/index.d.ts +12 -0
- package/es/ele-tabs/components/tab-title.d.ts +34 -0
- package/es/ele-tabs/components/tab-title.js +103 -0
- package/es/ele-tabs/index.d.ts +420 -0
- package/es/ele-tabs/index.js +277 -0
- package/es/ele-tabs/props.d.ts +75 -0
- package/es/ele-tabs/props.js +36 -0
- package/es/ele-tabs/style/css-var.scss +35 -0
- package/es/ele-tabs/style/index.js +5 -0
- package/es/ele-tabs/style/index.scss +412 -0
- package/es/ele-tabs/types/index.d.ts +36 -0
- package/es/ele-text/index.d.ts +36 -0
- package/es/ele-text/index.js +63 -0
- package/es/ele-text/props.d.ts +21 -0
- package/es/ele-text/props.js +26 -0
- package/es/ele-text/style/css-var.scss +7 -0
- package/es/ele-text/style/index.js +2 -0
- package/es/ele-text/style/index.scss +98 -0
- package/es/ele-text/types/index.d.ts +13 -0
- package/es/ele-tool/index.d.ts +27 -0
- package/es/ele-tool/index.js +68 -0
- package/es/ele-tool/props.d.ts +13 -0
- package/es/ele-tool/props.js +14 -0
- package/es/ele-tool/style/css-var.scss +11 -0
- package/es/ele-tool/style/index.js +2 -0
- package/es/ele-tool/style/index.scss +70 -0
- package/es/ele-toolbar/index.d.ts +14 -0
- package/es/ele-toolbar/index.js +62 -0
- package/es/ele-toolbar/props.d.ts +12 -0
- package/es/ele-toolbar/props.js +13 -0
- package/es/ele-toolbar/style/css-var.scss +11 -0
- package/es/ele-toolbar/style/index.js +2 -0
- package/es/ele-toolbar/style/index.scss +70 -0
- package/es/ele-toolbar/types/index.d.ts +4 -0
- package/es/ele-tour/index.d.ts +20788 -0
- package/es/ele-tour/index.js +243 -0
- package/es/ele-tour/props.d.ts +29 -0
- package/es/ele-tour/props.js +30 -0
- package/es/ele-tour/style/index.js +3 -0
- package/es/ele-tour/style/index.scss +90 -0
- package/es/ele-tour/types/index.d.ts +41 -0
- package/es/ele-tour/util.d.ts +13 -0
- package/es/ele-tour/util.js +30 -0
- package/es/ele-upload-list/components/list-item.d.ts +38 -0
- package/es/ele-upload-list/components/list-item.js +151 -0
- package/es/ele-upload-list/index.d.ts +808 -0
- package/es/ele-upload-list/index.js +195 -0
- package/es/ele-upload-list/props.d.ts +37 -0
- package/es/ele-upload-list/props.js +47 -0
- package/es/ele-upload-list/style/index.js +6 -0
- package/es/ele-upload-list/style/index.scss +161 -0
- package/es/ele-upload-list/types/index.d.ts +38 -0
- package/es/ele-watermark/index.d.ts +25 -0
- package/es/ele-watermark/index.js +169 -0
- package/es/ele-watermark/props.d.ts +14 -0
- package/es/ele-watermark/props.js +23 -0
- package/es/ele-watermark/style/index.js +1 -0
- package/es/ele-watermark/types/index.d.ts +23 -0
- package/es/ele-watermark/util.d.ts +17 -0
- package/es/ele-watermark/util.js +30 -0
- package/es/ele-xg-player/index.d.ts +22 -0
- package/es/ele-xg-player/index.js +55 -0
- package/es/ele-xg-player/style/index.js +1 -0
- package/es/icons/ArrowDown.d.ts +2 -0
- package/es/icons/ArrowDown.js +31 -0
- package/es/icons/ArrowRight.d.ts +2 -0
- package/es/icons/ArrowRight.js +30 -0
- package/es/icons/ColumnHeightOutlined.d.ts +2 -0
- package/es/icons/ColumnHeightOutlined.js +23 -0
- package/es/icons/CompressOutlined.d.ts +2 -0
- package/es/icons/CompressOutlined.js +23 -0
- package/es/icons/ExpandOutlined.d.ts +2 -0
- package/es/icons/ExpandOutlined.js +23 -0
- package/es/icons/FullscreenExitOutlined.d.ts +2 -0
- package/es/icons/FullscreenExitOutlined.js +23 -0
- package/es/icons/FullscreenOutlined.d.ts +2 -0
- package/es/icons/FullscreenOutlined.js +23 -0
- package/es/icons/HolderOutlined.d.ts +2 -0
- package/es/icons/HolderOutlined.js +23 -0
- package/es/icons/LoadingOutlined.d.ts +2 -0
- package/es/icons/LoadingOutlined.js +23 -0
- package/es/icons/VerticalLeftOutlined.d.ts +2 -0
- package/es/icons/VerticalLeftOutlined.js +23 -0
- package/es/icons/VerticalRightOutlined.d.ts +2 -0
- package/es/icons/VerticalRightOutlined.js +23 -0
- package/es/icons/index.d.ts +11 -0
- package/es/icons/index.js +24 -0
- package/es/index.d.ts +14 -0
- package/es/index.js +19 -0
- package/es/installer.d.ts +3 -0
- package/es/installer.js +11 -0
- package/es/lang/en_US.d.ts +4 -0
- package/es/lang/en_US.js +59 -0
- package/es/lang/zh_CN.d.ts +4 -0
- package/es/lang/zh_CN.js +59 -0
- package/es/lang/zh_TW.d.ts +4 -0
- package/es/lang/zh_TW.js +60 -0
- package/es/style/index.scss +31 -0
- package/es/style/nprogress.scss +84 -0
- package/es/style/themes/dark-css-var.scss +38 -0
- package/es/style/themes/dark.scss +61 -0
- package/es/style/themes/default.scss +403 -0
- package/es/utils/chart-theme-dark.d.ts +373 -0
- package/es/utils/chart-theme-dark.js +397 -0
- package/es/utils/chart-theme.d.ts +368 -0
- package/es/utils/chart-theme.js +392 -0
- package/es/utils/core.d.ts +137 -0
- package/es/utils/core.js +235 -0
- package/es/utils/iframe-component.d.ts +8 -0
- package/es/utils/iframe-component.js +70 -0
- package/es/utils/license-util.d.ts +9 -0
- package/es/utils/license-util.js +176 -0
- package/es/utils/menu-util.d.ts +13 -0
- package/es/utils/menu-util.js +60 -0
- package/es/utils/message.d.ts +41 -0
- package/es/utils/message.js +60 -0
- package/es/utils/printer.d.ts +100 -0
- package/es/utils/printer.js +612 -0
- package/es/utils/resolvers.d.ts +18 -0
- package/es/utils/resolvers.js +37 -0
- package/es/utils/theme-util.d.ts +6 -0
- package/es/utils/theme-util.js +68 -0
- package/es/utils/validate.d.ts +182 -0
- package/es/utils/validate.js +197 -0
- package/lib/components.d.ts +43 -0
- package/lib/components.js +88 -0
- package/lib/ele-app/index.d.ts +4 -0
- package/lib/ele-app/index.js +12 -0
- package/lib/ele-app/style/common.js +2 -0
- package/lib/ele-app/style/common.scss +116 -0
- package/lib/ele-app/style/css-var.scss +29 -0
- package/lib/ele-app/style/index.js +6 -0
- package/lib/ele-app/style/index.scss +3 -0
- package/lib/ele-app/style/message.js +3 -0
- package/lib/ele-app/style/message.scss +101 -0
- package/lib/ele-app/style/scrollbar.js +2 -0
- package/lib/ele-app/style/scrollbar.scss +80 -0
- package/lib/ele-avatar-group/index.d.ts +70 -0
- package/lib/ele-avatar-group/index.js +177 -0
- package/lib/ele-avatar-group/props.d.ts +37 -0
- package/lib/ele-avatar-group/props.js +45 -0
- package/lib/ele-avatar-group/style/index.js +5 -0
- package/lib/ele-avatar-group/style/index.scss +36 -0
- package/lib/ele-avatar-group/types/index.d.ts +16 -0
- package/lib/ele-bar-code/index.d.ts +47 -0
- package/lib/ele-bar-code/index.js +66 -0
- package/lib/ele-bar-code/props.d.ts +15 -0
- package/lib/ele-bar-code/props.js +14 -0
- package/lib/ele-bar-code/style/index.js +2 -0
- package/lib/ele-bar-code/types/index.d.ts +4 -0
- package/lib/ele-basic-select/components/select-tag.d.ts +24 -0
- package/lib/ele-basic-select/components/select-tag.js +64 -0
- package/lib/ele-basic-select/index.d.ts +19250 -0
- package/lib/ele-basic-select/index.js +226 -0
- package/lib/ele-basic-select/props.d.ts +39 -0
- package/lib/ele-basic-select/props.js +60 -0
- package/lib/ele-basic-select/style/index.js +6 -0
- package/lib/ele-basic-select/style/index.scss +104 -0
- package/lib/ele-basic-select/types/index.d.ts +21 -0
- package/lib/ele-bottom-bar/index.d.ts +8 -0
- package/lib/ele-bottom-bar/index.js +33 -0
- package/lib/ele-bottom-bar/props.d.ts +9 -0
- package/lib/ele-bottom-bar/props.js +9 -0
- package/lib/ele-bottom-bar/style/css-var.scss +7 -0
- package/lib/ele-bottom-bar/style/index.js +2 -0
- package/lib/ele-bottom-bar/style/index.scss +25 -0
- package/lib/ele-breadcrumb/index.d.ts +194 -0
- package/lib/ele-breadcrumb/index.js +63 -0
- package/lib/ele-breadcrumb/props.d.ts +19 -0
- package/lib/ele-breadcrumb/props.js +12 -0
- package/lib/ele-breadcrumb/style/index.js +4 -0
- package/lib/ele-breadcrumb/style/index.scss +30 -0
- package/lib/ele-breadcrumb/types/index.d.ts +22 -0
- package/lib/ele-card/index.d.ts +26 -0
- package/lib/ele-card/index.js +54 -0
- package/lib/ele-card/props.d.ts +16 -0
- package/lib/ele-card/props.js +20 -0
- package/lib/ele-card/style/css-var.scss +7 -0
- package/lib/ele-card/style/index.js +3 -0
- package/lib/ele-card/style/index.scss +61 -0
- package/lib/ele-config-provider/index.d.ts +18 -0
- package/lib/ele-config-provider/index.js +48 -0
- package/lib/ele-config-provider/keys.d.ts +8 -0
- package/lib/ele-config-provider/keys.js +6 -0
- package/lib/ele-config-provider/props.d.ts +13 -0
- package/lib/ele-config-provider/props.js +15 -0
- package/lib/ele-config-provider/style/index.js +2 -0
- package/lib/ele-config-provider/types/index.d.ts +90 -0
- package/lib/ele-config-provider/use-receiver.d.ts +22 -0
- package/lib/ele-config-provider/use-receiver.js +38 -0
- package/lib/ele-count-up/index.d.ts +36 -0
- package/lib/ele-count-up/index.js +106 -0
- package/lib/ele-count-up/props.d.ts +23 -0
- package/lib/ele-count-up/props.js +22 -0
- package/lib/ele-count-up/style/index.js +2 -0
- package/lib/ele-cropper/components/cropper-preview.d.ts +17 -0
- package/lib/ele-cropper/components/cropper-preview.js +73 -0
- package/lib/ele-cropper/components/cropper-tools.d.ts +55 -0
- package/lib/ele-cropper/components/cropper-tools.js +185 -0
- package/lib/ele-cropper/index.d.ts +108 -0
- package/lib/ele-cropper/index.js +215 -0
- package/lib/ele-cropper/props.d.ts +51 -0
- package/lib/ele-cropper/props.js +59 -0
- package/lib/ele-cropper/style/index.js +7 -0
- package/lib/ele-cropper/style/index.scss +98 -0
- package/lib/ele-cropper/types/index.d.ts +69 -0
- package/lib/ele-cropper-modal/index.d.ts +99 -0
- package/lib/ele-cropper-modal/index.js +92 -0
- package/lib/ele-cropper-modal/props.d.ts +52 -0
- package/lib/ele-cropper-modal/props.js +18 -0
- package/lib/ele-cropper-modal/style/index.js +3 -0
- package/lib/ele-dashboard/index.d.ts +16 -0
- package/lib/ele-dashboard/index.js +69 -0
- package/lib/ele-dashboard/props.d.ts +12 -0
- package/lib/ele-dashboard/props.js +13 -0
- package/lib/ele-dashboard/style/index.js +2 -0
- package/lib/ele-dashboard/style/index.scss +78 -0
- package/lib/ele-dashboard/types/index.d.ts +4 -0
- package/lib/ele-dot/index.d.ts +29 -0
- package/lib/ele-dot/index.js +43 -0
- package/lib/ele-dot/props.d.ts +19 -0
- package/lib/ele-dot/props.js +21 -0
- package/lib/ele-dot/style/index.js +2 -0
- package/lib/ele-dot/style/index.scss +67 -0
- package/lib/ele-dot/types/index.d.ts +4 -0
- package/lib/ele-drawer/index.d.ts +516 -0
- package/lib/ele-drawer/index.js +138 -0
- package/lib/ele-drawer/props.d.ts +63 -0
- package/lib/ele-drawer/props.js +15 -0
- package/lib/ele-drawer/style/css-var.scss +12 -0
- package/lib/ele-drawer/style/index.js +4 -0
- package/lib/ele-drawer/style/index.scss +61 -0
- package/lib/ele-edit-tag/index.d.ts +856 -0
- package/lib/ele-edit-tag/index.js +215 -0
- package/lib/ele-edit-tag/props.d.ts +31 -0
- package/lib/ele-edit-tag/props.js +39 -0
- package/lib/ele-edit-tag/style/index.js +6 -0
- package/lib/ele-edit-tag/style/index.scss +60 -0
- package/lib/ele-edit-tag/types/index.d.ts +8 -0
- package/lib/ele-ellipsis/index.d.ts +58 -0
- package/lib/ele-ellipsis/index.js +102 -0
- package/lib/ele-ellipsis/props.d.ts +27 -0
- package/lib/ele-ellipsis/props.js +16 -0
- package/lib/ele-ellipsis/style/index.js +4 -0
- package/lib/ele-ellipsis/style/index.scss +23 -0
- package/lib/ele-ellipsis/types/index.d.ts +8 -0
- package/lib/ele-file-list/components/file-grid-item.d.ts +24409 -0
- package/lib/ele-file-list/components/file-grid-item.js +170 -0
- package/lib/ele-file-list/components/file-grid.d.ts +46 -0
- package/lib/ele-file-list/components/file-grid.js +140 -0
- package/lib/ele-file-list/components/file-sort.d.ts +16 -0
- package/lib/ele-file-list/components/file-sort.js +34 -0
- package/lib/ele-file-list/components/file-table-item.d.ts +24411 -0
- package/lib/ele-file-list/components/file-table-item.js +200 -0
- package/lib/ele-file-list/components/file-table.d.ts +60 -0
- package/lib/ele-file-list/components/file-table.js +219 -0
- package/lib/ele-file-list/icons.d.ts +9 -0
- package/lib/ele-file-list/icons.js +222 -0
- package/lib/ele-file-list/index.d.ts +1644 -0
- package/lib/ele-file-list/index.js +275 -0
- package/lib/ele-file-list/props.d.ts +43 -0
- package/lib/ele-file-list/props.js +61 -0
- package/lib/ele-file-list/style/css-var.scss +7 -0
- package/lib/ele-file-list/style/index.js +4 -0
- package/lib/ele-file-list/style/index.scss +415 -0
- package/lib/ele-file-list/types/index.d.ts +86 -0
- package/lib/ele-file-list-tool/index.d.ts +8 -0
- package/lib/ele-file-list-tool/index.js +30 -0
- package/lib/ele-file-list-tool/style/index.js +2 -0
- package/lib/ele-icon-select/components/icon-grid.d.ts +36 -0
- package/lib/ele-icon-select/components/icon-grid.js +86 -0
- package/lib/ele-icon-select/components/icon-popper.d.ts +47 -0
- package/lib/ele-icon-select/components/icon-popper.js +241 -0
- package/lib/ele-icon-select/index.d.ts +149 -0
- package/lib/ele-icon-select/index.js +141 -0
- package/lib/ele-icon-select/props.d.ts +73 -0
- package/lib/ele-icon-select/props.js +96 -0
- package/lib/ele-icon-select/style/index.js +6 -0
- package/lib/ele-icon-select/style/index.scss +197 -0
- package/lib/ele-icon-select/types/index.d.ts +16 -0
- package/lib/ele-loading/index.d.ts +14 -0
- package/lib/ele-loading/index.js +33 -0
- package/lib/ele-loading/props.d.ts +11 -0
- package/lib/ele-loading/props.js +13 -0
- package/lib/ele-loading/style/index.js +2 -0
- package/lib/ele-map-picker/components/map-view.d.ts +190 -0
- package/lib/ele-map-picker/components/map-view.js +593 -0
- package/lib/ele-map-picker/index.d.ts +164 -0
- package/lib/ele-map-picker/index.js +116 -0
- package/lib/ele-map-picker/props.d.ts +137 -0
- package/lib/ele-map-picker/props.js +108 -0
- package/lib/ele-map-picker/style/index.js +9 -0
- package/lib/ele-map-picker/style/index.scss +242 -0
- package/lib/ele-map-picker/types/index.d.ts +88 -0
- package/lib/ele-menus/index.d.ts +247 -0
- package/lib/ele-menus/index.js +232 -0
- package/lib/ele-menus/props.d.ts +37 -0
- package/lib/ele-menus/props.js +30 -0
- package/lib/ele-menus/style/css-var.scss +44 -0
- package/lib/ele-menus/style/index.js +7 -0
- package/lib/ele-menus/style/index.scss +541 -0
- package/lib/ele-menus/style/scrollbar.scss +68 -0
- package/lib/ele-menus/types/index.d.ts +57 -0
- package/lib/ele-modal/index.d.ts +1122 -0
- package/lib/ele-modal/index.js +325 -0
- package/lib/ele-modal/props.d.ts +101 -0
- package/lib/ele-modal/props.js +61 -0
- package/lib/ele-modal/style/css-var.scss +14 -0
- package/lib/ele-modal/style/index.js +4 -0
- package/lib/ele-modal/style/index.scss +244 -0
- package/lib/ele-modal/types/index.d.ts +27 -0
- package/lib/ele-modal/util.d.ts +73 -0
- package/lib/ele-modal/util.js +332 -0
- package/lib/ele-page/index.d.ts +17 -0
- package/lib/ele-page/index.js +29 -0
- package/lib/ele-page/props.d.ts +11 -0
- package/lib/ele-page/props.js +13 -0
- package/lib/ele-page/style/css-var.scss +8 -0
- package/lib/ele-page/style/index.js +2 -0
- package/lib/ele-page/style/index.scss +62 -0
- package/lib/ele-pagination/index.d.ts +71 -0
- package/lib/ele-pagination/index.js +63 -0
- package/lib/ele-pagination/props.d.ts +37 -0
- package/lib/ele-pagination/props.js +19 -0
- package/lib/ele-pagination/style/index.js +3 -0
- package/lib/ele-pagination/style/index.scss +51 -0
- package/lib/ele-pagination/types/index.d.ts +4 -0
- package/lib/ele-pro-layout/components/header-tool.d.ts +2 -0
- package/lib/ele-pro-layout/components/header-tool.js +20 -0
- package/lib/ele-pro-layout/components/pro-header.d.ts +70 -0
- package/lib/ele-pro-layout/components/pro-header.js +187 -0
- package/lib/ele-pro-layout/components/pro-sidebar.d.ts +53 -0
- package/lib/ele-pro-layout/components/pro-sidebar.js +97 -0
- package/lib/ele-pro-layout/components/pro-sidebox.d.ts +36 -0
- package/lib/ele-pro-layout/components/pro-sidebox.js +80 -0
- package/lib/ele-pro-layout/components/pro-tab-bar.d.ts +59 -0
- package/lib/ele-pro-layout/components/pro-tab-bar.js +202 -0
- package/lib/ele-pro-layout/components/sidebar-tool.d.ts +2 -0
- package/lib/ele-pro-layout/components/sidebar-tool.js +20 -0
- package/lib/ele-pro-layout/components/tab-dropdown.d.ts +8 -0
- package/lib/ele-pro-layout/components/tab-dropdown.js +71 -0
- package/lib/ele-pro-layout/index.js +669 -0
- package/lib/ele-pro-layout/props.d.ts +159 -0
- package/lib/ele-pro-layout/props.js +203 -0
- package/lib/ele-pro-layout/style/collapse.scss +67 -0
- package/lib/ele-pro-layout/style/css-var.scss +36 -0
- package/lib/ele-pro-layout/style/header.scss +87 -0
- package/lib/ele-pro-layout/style/index.js +10 -0
- package/lib/ele-pro-layout/style/index.scss +12 -0
- package/lib/ele-pro-layout/style/layout-mobile.scss +56 -0
- package/lib/ele-pro-layout/style/layout-style.scss +139 -0
- package/lib/ele-pro-layout/style/layout-theme.scss +87 -0
- package/lib/ele-pro-layout/style/layout.scss +56 -0
- package/lib/ele-pro-layout/style/sidebar.scss +180 -0
- package/lib/ele-pro-layout/style/tabs.scss +64 -0
- package/lib/ele-pro-layout/types/index.d.ts +215 -0
- package/lib/ele-pro-layout/util.d.ts +99 -0
- package/lib/ele-pro-layout/util.js +216 -0
- package/lib/ele-pro-table/components/table-tools.d.ts +43 -0
- package/lib/ele-pro-table/components/table-tools.js +208 -0
- package/lib/ele-pro-table/components/table-view.d.ts +838 -0
- package/lib/ele-pro-table/components/table-view.js +81 -0
- package/lib/ele-pro-table/components/tool-column.d.ts +57 -0
- package/lib/ele-pro-table/components/tool-column.js +363 -0
- package/lib/ele-pro-table/index.d.ts +2214 -0
- package/lib/ele-pro-table/index.js +659 -0
- package/lib/ele-pro-table/props.d.ts +215 -0
- package/lib/ele-pro-table/props.js +140 -0
- package/lib/ele-pro-table/style/css-var.scss +11 -0
- package/lib/ele-pro-table/style/index.js +18 -0
- package/lib/ele-pro-table/style/index.scss +229 -0
- package/lib/ele-pro-table/types/index.d.ts +278 -0
- package/lib/ele-pro-table/util.d.ts +153 -0
- package/lib/ele-pro-table/util.js +415 -0
- package/lib/ele-qr-code/index.d.ts +67 -0
- package/lib/ele-qr-code/index.js +152 -0
- package/lib/ele-qr-code/props.d.ts +37 -0
- package/lib/ele-qr-code/props.js +41 -0
- package/lib/ele-qr-code/qrcodegen.d.ts +95 -0
- package/lib/ele-qr-code/qrcodegen.js +1093 -0
- package/lib/ele-qr-code/style/index.js +2 -0
- package/lib/ele-qr-code/types/index.d.ts +28 -0
- package/lib/ele-qr-code/util.d.ts +26 -0
- package/lib/ele-qr-code/util.js +90 -0
- package/lib/ele-qr-code-svg/index.d.ts +70 -0
- package/lib/ele-qr-code-svg/index.js +129 -0
- package/lib/ele-qr-code-svg/style/index.js +2 -0
- package/lib/ele-split-panel/index.d.ts +61 -0
- package/lib/ele-split-panel/index.js +170 -0
- package/lib/ele-split-panel/props.d.ts +30 -0
- package/lib/ele-split-panel/props.js +41 -0
- package/lib/ele-split-panel/style/index.js +3 -0
- package/lib/ele-split-panel/style/index.scss +353 -0
- package/lib/ele-steps/index.d.ts +54 -0
- package/lib/ele-steps/index.js +49 -0
- package/lib/ele-steps/props.d.ts +30 -0
- package/lib/ele-steps/props.js +14 -0
- package/lib/ele-steps/style/index.js +4 -0
- package/lib/ele-steps/style/index.scss +120 -0
- package/lib/ele-steps/types/index.d.ts +11 -0
- package/lib/ele-tab-tool/index.d.ts +11 -0
- package/lib/ele-tab-tool/index.js +23 -0
- package/lib/ele-tab-tool/props.d.ts +9 -0
- package/lib/ele-tab-tool/props.js +9 -0
- package/lib/ele-tab-tool/style/index.js +2 -0
- package/lib/ele-tab-wrap/index.d.ts +8 -0
- package/lib/ele-tab-wrap/index.js +30 -0
- package/lib/ele-tab-wrap/props.d.ts +10 -0
- package/lib/ele-tab-wrap/props.js +9 -0
- package/lib/ele-tab-wrap/style/index.js +2 -0
- package/lib/ele-table/index.d.ts +13 -0
- package/lib/ele-table/index.js +29 -0
- package/lib/ele-table/props.d.ts +10 -0
- package/lib/ele-table/props.js +11 -0
- package/lib/ele-table/style/css-var.scss +7 -0
- package/lib/ele-table/style/index.js +2 -0
- package/lib/ele-table/style/index.scss +87 -0
- package/lib/ele-table-select/index.d.ts +159 -0
- package/lib/ele-table-select/index.js +386 -0
- package/lib/ele-table-select/props.d.ts +74 -0
- package/lib/ele-table-select/props.js +97 -0
- package/lib/ele-table-select/style/index.js +4 -0
- package/lib/ele-table-select/style/index.scss +9 -0
- package/lib/ele-table-select/types/index.d.ts +12 -0
- package/lib/ele-tabs/components/tab-title.d.ts +34 -0
- package/lib/ele-tabs/components/tab-title.js +102 -0
- package/lib/ele-tabs/index.d.ts +420 -0
- package/lib/ele-tabs/index.js +276 -0
- package/lib/ele-tabs/props.d.ts +75 -0
- package/lib/ele-tabs/props.js +36 -0
- package/lib/ele-tabs/style/css-var.scss +35 -0
- package/lib/ele-tabs/style/index.js +6 -0
- package/lib/ele-tabs/style/index.scss +412 -0
- package/lib/ele-tabs/types/index.d.ts +36 -0
- package/lib/ele-text/index.d.ts +36 -0
- package/lib/ele-text/index.js +62 -0
- package/lib/ele-text/props.d.ts +21 -0
- package/lib/ele-text/props.js +26 -0
- package/lib/ele-text/style/css-var.scss +7 -0
- package/lib/ele-text/style/index.js +3 -0
- package/lib/ele-text/style/index.scss +98 -0
- package/lib/ele-text/types/index.d.ts +13 -0
- package/lib/ele-tool/index.d.ts +27 -0
- package/lib/ele-tool/index.js +67 -0
- package/lib/ele-tool/props.d.ts +13 -0
- package/lib/ele-tool/props.js +14 -0
- package/lib/ele-tool/style/css-var.scss +11 -0
- package/lib/ele-tool/style/index.js +3 -0
- package/lib/ele-tool/style/index.scss +70 -0
- package/lib/ele-toolbar/index.d.ts +14 -0
- package/lib/ele-toolbar/index.js +61 -0
- package/lib/ele-toolbar/props.d.ts +12 -0
- package/lib/ele-toolbar/props.js +13 -0
- package/lib/ele-toolbar/style/css-var.scss +11 -0
- package/lib/ele-toolbar/style/index.js +3 -0
- package/lib/ele-toolbar/style/index.scss +70 -0
- package/lib/ele-toolbar/types/index.d.ts +4 -0
- package/lib/ele-tour/index.d.ts +20788 -0
- package/lib/ele-tour/index.js +242 -0
- package/lib/ele-tour/props.d.ts +29 -0
- package/lib/ele-tour/props.js +30 -0
- package/lib/ele-tour/style/index.js +4 -0
- package/lib/ele-tour/style/index.scss +90 -0
- package/lib/ele-tour/types/index.d.ts +41 -0
- package/lib/ele-tour/util.d.ts +13 -0
- package/lib/ele-tour/util.js +30 -0
- package/lib/ele-upload-list/components/list-item.d.ts +38 -0
- package/lib/ele-upload-list/components/list-item.js +150 -0
- package/lib/ele-upload-list/index.d.ts +808 -0
- package/lib/ele-upload-list/index.js +194 -0
- package/lib/ele-upload-list/props.d.ts +37 -0
- package/lib/ele-upload-list/props.js +47 -0
- package/lib/ele-upload-list/style/index.js +7 -0
- package/lib/ele-upload-list/style/index.scss +161 -0
- package/lib/ele-upload-list/types/index.d.ts +38 -0
- package/lib/ele-watermark/index.d.ts +25 -0
- package/lib/ele-watermark/index.js +168 -0
- package/lib/ele-watermark/props.d.ts +14 -0
- package/lib/ele-watermark/props.js +23 -0
- package/lib/ele-watermark/style/index.js +2 -0
- package/lib/ele-watermark/types/index.d.ts +23 -0
- package/lib/ele-watermark/util.d.ts +17 -0
- package/lib/ele-watermark/util.js +30 -0
- package/lib/ele-xg-player/index.d.ts +22 -0
- package/lib/ele-xg-player/index.js +54 -0
- package/lib/ele-xg-player/style/index.js +2 -0
- package/lib/icons/ArrowDown.d.ts +2 -0
- package/lib/icons/ArrowDown.js +30 -0
- package/lib/icons/ArrowRight.d.ts +2 -0
- package/lib/icons/ArrowRight.js +29 -0
- package/lib/icons/ColumnHeightOutlined.d.ts +2 -0
- package/lib/icons/ColumnHeightOutlined.js +22 -0
- package/lib/icons/CompressOutlined.d.ts +2 -0
- package/lib/icons/CompressOutlined.js +22 -0
- package/lib/icons/ExpandOutlined.d.ts +2 -0
- package/lib/icons/ExpandOutlined.js +22 -0
- package/lib/icons/FullscreenExitOutlined.d.ts +2 -0
- package/lib/icons/FullscreenExitOutlined.js +22 -0
- package/lib/icons/FullscreenOutlined.d.ts +2 -0
- package/lib/icons/FullscreenOutlined.js +22 -0
- package/lib/icons/HolderOutlined.d.ts +2 -0
- package/lib/icons/HolderOutlined.js +22 -0
- package/lib/icons/LoadingOutlined.d.ts +2 -0
- package/lib/icons/LoadingOutlined.js +22 -0
- package/lib/icons/VerticalLeftOutlined.d.ts +2 -0
- package/lib/icons/VerticalLeftOutlined.js +22 -0
- package/lib/icons/VerticalRightOutlined.d.ts +2 -0
- package/lib/icons/VerticalRightOutlined.js +22 -0
- package/lib/icons/index.d.ts +11 -0
- package/lib/icons/index.js +24 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.js +85 -0
- package/lib/installer.d.ts +3 -0
- package/lib/installer.js +28 -0
- package/lib/lang/en_US.d.ts +4 -0
- package/lib/lang/en_US.js +58 -0
- package/lib/lang/zh_CN.d.ts +4 -0
- package/lib/lang/zh_CN.js +58 -0
- package/lib/lang/zh_TW.d.ts +4 -0
- package/lib/lang/zh_TW.js +59 -0
- package/lib/style/index.scss +31 -0
- package/lib/style/nprogress.scss +84 -0
- package/lib/style/themes/dark-css-var.scss +38 -0
- package/lib/style/themes/dark.scss +61 -0
- package/lib/style/themes/default.scss +403 -0
- package/lib/utils/chart-theme-dark.d.ts +373 -0
- package/lib/utils/chart-theme-dark.js +397 -0
- package/lib/utils/chart-theme.d.ts +368 -0
- package/lib/utils/chart-theme.js +392 -0
- package/lib/utils/core.d.ts +137 -0
- package/lib/utils/core.js +235 -0
- package/lib/utils/iframe-component.d.ts +8 -0
- package/lib/utils/iframe-component.js +70 -0
- package/lib/utils/license-util.d.ts +9 -0
- package/lib/utils/license-util.js +176 -0
- package/lib/utils/menu-util.d.ts +13 -0
- package/lib/utils/menu-util.js +60 -0
- package/lib/utils/message.d.ts +41 -0
- package/lib/utils/message.js +60 -0
- package/lib/utils/printer.d.ts +100 -0
- package/lib/utils/printer.js +612 -0
- package/lib/utils/resolvers.d.ts +18 -0
- package/lib/utils/resolvers.js +37 -0
- package/lib/utils/theme-util.d.ts +6 -0
- package/lib/utils/theme-util.js +68 -0
- package/lib/utils/validate.d.ts +182 -0
- package/lib/utils/validate.js +197 -0
- package/package.json +93 -0
- package/typings/global.d.ts +50 -0
|
@@ -0,0 +1,1093 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => {
|
|
5
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
+
return value;
|
|
7
|
+
};
|
|
8
|
+
var qrcodegen;
|
|
9
|
+
((qrcodegen2) => {
|
|
10
|
+
const _QrCode = class {
|
|
11
|
+
/*-- Constructor (low level) and fields --*/
|
|
12
|
+
// Creates a new QR Code with the given version number,
|
|
13
|
+
// error correction level, data codeword bytes, and mask number.
|
|
14
|
+
// This is a low-level API that most users should not use directly.
|
|
15
|
+
// A mid-level API is the encodeSegments() function.
|
|
16
|
+
constructor(version, errorCorrectionLevel, dataCodewords, msk) {
|
|
17
|
+
/*-- Fields --*/
|
|
18
|
+
// The width and height of this QR Code, measured in modules, between
|
|
19
|
+
// 21 and 177 (inclusive). This is equal to version * 4 + 17.
|
|
20
|
+
__publicField(this, "size");
|
|
21
|
+
// The index of the mask pattern used in this QR Code, which is between 0 and 7 (inclusive).
|
|
22
|
+
// Even if a QR Code is created with automatic masking requested (mask = -1),
|
|
23
|
+
// the resulting object still has a mask value between 0 and 7.
|
|
24
|
+
__publicField(this, "mask");
|
|
25
|
+
// The modules of this QR Code (false = light, true = dark).
|
|
26
|
+
// Immutable after constructor finishes. Accessed through getModule().
|
|
27
|
+
__publicField(this, "modules", []);
|
|
28
|
+
// Indicates function modules that are not subjected to masking. Discarded when constructor finishes.
|
|
29
|
+
__publicField(this, "isFunction", []);
|
|
30
|
+
this.version = version;
|
|
31
|
+
this.errorCorrectionLevel = errorCorrectionLevel;
|
|
32
|
+
if (version < _QrCode.MIN_VERSION || version > _QrCode.MAX_VERSION)
|
|
33
|
+
throw "Version value out of range";
|
|
34
|
+
if (msk < -1 || msk > 7)
|
|
35
|
+
throw "Mask value out of range";
|
|
36
|
+
this.size = version * 4 + 17;
|
|
37
|
+
let row = [];
|
|
38
|
+
for (let i = 0; i < this.size; i++)
|
|
39
|
+
row.push(false);
|
|
40
|
+
for (let i = 0; i < this.size; i++) {
|
|
41
|
+
this.modules.push(row.slice());
|
|
42
|
+
this.isFunction.push(row.slice());
|
|
43
|
+
}
|
|
44
|
+
this.drawFunctionPatterns();
|
|
45
|
+
const allCodewords = this.addEccAndInterleave(dataCodewords);
|
|
46
|
+
this.drawCodewords(allCodewords);
|
|
47
|
+
if (msk == -1) {
|
|
48
|
+
let minPenalty = 1e9;
|
|
49
|
+
for (let i = 0; i < 8; i++) {
|
|
50
|
+
this.applyMask(i);
|
|
51
|
+
this.drawFormatBits(i);
|
|
52
|
+
const penalty = this.getPenaltyScore();
|
|
53
|
+
if (penalty < minPenalty) {
|
|
54
|
+
msk = i;
|
|
55
|
+
minPenalty = penalty;
|
|
56
|
+
}
|
|
57
|
+
this.applyMask(i);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
assert(0 <= msk && msk <= 7);
|
|
61
|
+
this.mask = msk;
|
|
62
|
+
this.applyMask(msk);
|
|
63
|
+
this.drawFormatBits(msk);
|
|
64
|
+
this.isFunction = [];
|
|
65
|
+
}
|
|
66
|
+
/*-- Static factory functions (high level) --*/
|
|
67
|
+
// Returns a QR Code representing the given Unicode text string at the given error correction level.
|
|
68
|
+
// As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
|
|
69
|
+
// Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
|
|
70
|
+
// QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
|
|
71
|
+
// ecl argument if it can be done without increasing the version.
|
|
72
|
+
static encodeText(text, ecl) {
|
|
73
|
+
const segs = qrcodegen2.QrSegment.makeSegments(text);
|
|
74
|
+
return _QrCode.encodeSegments(segs, ecl);
|
|
75
|
+
}
|
|
76
|
+
// Returns a QR Code representing the given binary data at the given error correction level.
|
|
77
|
+
// This function always encodes using the binary segment mode, not any text mode. The maximum number of
|
|
78
|
+
// bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
|
|
79
|
+
// The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
|
|
80
|
+
static encodeBinary(data, ecl) {
|
|
81
|
+
const seg = qrcodegen2.QrSegment.makeBytes(data);
|
|
82
|
+
return _QrCode.encodeSegments([seg], ecl);
|
|
83
|
+
}
|
|
84
|
+
/*-- Static factory functions (mid level) --*/
|
|
85
|
+
// Returns a QR Code representing the given segments with the given encoding parameters.
|
|
86
|
+
// The smallest possible QR Code version within the given range is automatically
|
|
87
|
+
// chosen for the output. Iff boostEcl is true, then the ECC level of the result
|
|
88
|
+
// may be higher than the ecl argument if it can be done without increasing the
|
|
89
|
+
// version. The mask number is either between 0 to 7 (inclusive) to force that
|
|
90
|
+
// mask, or -1 to automatically choose an appropriate mask (which may be slow).
|
|
91
|
+
// This function allows the user to create a custom sequence of segments that switches
|
|
92
|
+
// between modes (such as alphanumeric and byte) to encode text in less space.
|
|
93
|
+
// This is a mid-level API; the high-level API is encodeText() and encodeBinary().
|
|
94
|
+
static encodeSegments(segs, ecl, minVersion = 1, maxVersion = 40, mask = -1, boostEcl = true) {
|
|
95
|
+
if (!(_QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= _QrCode.MAX_VERSION) || mask < -1 || mask > 7)
|
|
96
|
+
throw "Invalid value";
|
|
97
|
+
let version;
|
|
98
|
+
let dataUsedBits;
|
|
99
|
+
for (version = minVersion; ; version++) {
|
|
100
|
+
const dataCapacityBits2 = _QrCode.getNumDataCodewords(version, ecl) * 8;
|
|
101
|
+
const usedBits = QrSegment.getTotalBits(segs, version);
|
|
102
|
+
if (usedBits <= dataCapacityBits2) {
|
|
103
|
+
dataUsedBits = usedBits;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
if (version >= maxVersion)
|
|
107
|
+
throw "Data too long";
|
|
108
|
+
}
|
|
109
|
+
for (const newEcl of [
|
|
110
|
+
_QrCode.Ecc.MEDIUM,
|
|
111
|
+
_QrCode.Ecc.QUARTILE,
|
|
112
|
+
_QrCode.Ecc.HIGH
|
|
113
|
+
]) {
|
|
114
|
+
if (boostEcl && dataUsedBits <= _QrCode.getNumDataCodewords(version, newEcl) * 8)
|
|
115
|
+
ecl = newEcl;
|
|
116
|
+
}
|
|
117
|
+
let bb = [];
|
|
118
|
+
for (const seg of segs) {
|
|
119
|
+
appendBits(seg.mode.modeBits, 4, bb);
|
|
120
|
+
appendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);
|
|
121
|
+
for (const b of seg.getData())
|
|
122
|
+
bb.push(b);
|
|
123
|
+
}
|
|
124
|
+
assert(bb.length == dataUsedBits);
|
|
125
|
+
const dataCapacityBits = _QrCode.getNumDataCodewords(version, ecl) * 8;
|
|
126
|
+
assert(bb.length <= dataCapacityBits);
|
|
127
|
+
appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);
|
|
128
|
+
appendBits(0, (8 - bb.length % 8) % 8, bb);
|
|
129
|
+
assert(bb.length % 8 == 0);
|
|
130
|
+
for (let padByte = 236; bb.length < dataCapacityBits; padByte ^= 236 ^ 17)
|
|
131
|
+
appendBits(padByte, 8, bb);
|
|
132
|
+
let dataCodewords = [];
|
|
133
|
+
while (dataCodewords.length * 8 < bb.length)
|
|
134
|
+
dataCodewords.push(0);
|
|
135
|
+
bb.forEach(
|
|
136
|
+
(b, i) => dataCodewords[i >>> 3] |= b << 7 - (i & 7)
|
|
137
|
+
);
|
|
138
|
+
return new _QrCode(version, ecl, dataCodewords, mask);
|
|
139
|
+
}
|
|
140
|
+
/*-- Accessor methods --*/
|
|
141
|
+
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
142
|
+
// for light or true for dark. The top left corner has the coordinates (x=0, y=0).
|
|
143
|
+
// If the given coordinates are out of bounds, then false (light) is returned.
|
|
144
|
+
getModule(x, y) {
|
|
145
|
+
return 0 <= x && x < this.size && 0 <= y && y < this.size && this.modules[y][x];
|
|
146
|
+
}
|
|
147
|
+
// Modified to expose modules for easy access
|
|
148
|
+
getModules() {
|
|
149
|
+
return this.modules;
|
|
150
|
+
}
|
|
151
|
+
/*-- Private helper methods for constructor: Drawing function modules --*/
|
|
152
|
+
// Reads this object's version field, and draws and marks all function modules.
|
|
153
|
+
drawFunctionPatterns() {
|
|
154
|
+
for (let i = 0; i < this.size; i++) {
|
|
155
|
+
this.setFunctionModule(6, i, i % 2 == 0);
|
|
156
|
+
this.setFunctionModule(i, 6, i % 2 == 0);
|
|
157
|
+
}
|
|
158
|
+
this.drawFinderPattern(3, 3);
|
|
159
|
+
this.drawFinderPattern(this.size - 4, 3);
|
|
160
|
+
this.drawFinderPattern(3, this.size - 4);
|
|
161
|
+
const alignPatPos = this.getAlignmentPatternPositions();
|
|
162
|
+
const numAlign = alignPatPos.length;
|
|
163
|
+
for (let i = 0; i < numAlign; i++) {
|
|
164
|
+
for (let j = 0; j < numAlign; j++) {
|
|
165
|
+
if (!(i == 0 && j == 0 || i == 0 && j == numAlign - 1 || i == numAlign - 1 && j == 0))
|
|
166
|
+
this.drawAlignmentPattern(alignPatPos[i], alignPatPos[j]);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
this.drawFormatBits(0);
|
|
170
|
+
this.drawVersion();
|
|
171
|
+
}
|
|
172
|
+
// Draws two copies of the format bits (with its own error correction code)
|
|
173
|
+
// based on the given mask and this object's error correction level field.
|
|
174
|
+
drawFormatBits(mask) {
|
|
175
|
+
const data = this.errorCorrectionLevel.formatBits << 3 | mask;
|
|
176
|
+
let rem = data;
|
|
177
|
+
for (let i = 0; i < 10; i++)
|
|
178
|
+
rem = rem << 1 ^ (rem >>> 9) * 1335;
|
|
179
|
+
const bits = (data << 10 | rem) ^ 21522;
|
|
180
|
+
assert(bits >>> 15 == 0);
|
|
181
|
+
for (let i = 0; i <= 5; i++)
|
|
182
|
+
this.setFunctionModule(8, i, getBit(bits, i));
|
|
183
|
+
this.setFunctionModule(8, 7, getBit(bits, 6));
|
|
184
|
+
this.setFunctionModule(8, 8, getBit(bits, 7));
|
|
185
|
+
this.setFunctionModule(7, 8, getBit(bits, 8));
|
|
186
|
+
for (let i = 9; i < 15; i++)
|
|
187
|
+
this.setFunctionModule(14 - i, 8, getBit(bits, i));
|
|
188
|
+
for (let i = 0; i < 8; i++)
|
|
189
|
+
this.setFunctionModule(this.size - 1 - i, 8, getBit(bits, i));
|
|
190
|
+
for (let i = 8; i < 15; i++)
|
|
191
|
+
this.setFunctionModule(8, this.size - 15 + i, getBit(bits, i));
|
|
192
|
+
this.setFunctionModule(8, this.size - 8, true);
|
|
193
|
+
}
|
|
194
|
+
// Draws two copies of the version bits (with its own error correction code),
|
|
195
|
+
// based on this object's version field, iff 7 <= version <= 40.
|
|
196
|
+
drawVersion() {
|
|
197
|
+
if (this.version < 7)
|
|
198
|
+
return;
|
|
199
|
+
let rem = this.version;
|
|
200
|
+
for (let i = 0; i < 12; i++)
|
|
201
|
+
rem = rem << 1 ^ (rem >>> 11) * 7973;
|
|
202
|
+
const bits = this.version << 12 | rem;
|
|
203
|
+
assert(bits >>> 18 == 0);
|
|
204
|
+
for (let i = 0; i < 18; i++) {
|
|
205
|
+
const color = getBit(bits, i);
|
|
206
|
+
const a = this.size - 11 + i % 3;
|
|
207
|
+
const b = Math.floor(i / 3);
|
|
208
|
+
this.setFunctionModule(a, b, color);
|
|
209
|
+
this.setFunctionModule(b, a, color);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Draws a 9*9 finder pattern including the border separator,
|
|
213
|
+
// with the center module at (x, y). Modules can be out of bounds.
|
|
214
|
+
drawFinderPattern(x, y) {
|
|
215
|
+
for (let dy = -4; dy <= 4; dy++) {
|
|
216
|
+
for (let dx = -4; dx <= 4; dx++) {
|
|
217
|
+
const dist = Math.max(Math.abs(dx), Math.abs(dy));
|
|
218
|
+
const xx = x + dx;
|
|
219
|
+
const yy = y + dy;
|
|
220
|
+
if (0 <= xx && xx < this.size && 0 <= yy && yy < this.size)
|
|
221
|
+
this.setFunctionModule(xx, yy, dist != 2 && dist != 4);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// Draws a 5*5 alignment pattern, with the center module
|
|
226
|
+
// at (x, y). All modules must be in bounds.
|
|
227
|
+
drawAlignmentPattern(x, y) {
|
|
228
|
+
for (let dy = -2; dy <= 2; dy++) {
|
|
229
|
+
for (let dx = -2; dx <= 2; dx++)
|
|
230
|
+
this.setFunctionModule(
|
|
231
|
+
x + dx,
|
|
232
|
+
y + dy,
|
|
233
|
+
Math.max(Math.abs(dx), Math.abs(dy)) != 1
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// Sets the color of a module and marks it as a function module.
|
|
238
|
+
// Only used by the constructor. Coordinates must be in bounds.
|
|
239
|
+
setFunctionModule(x, y, isDark) {
|
|
240
|
+
this.modules[y][x] = isDark;
|
|
241
|
+
this.isFunction[y][x] = true;
|
|
242
|
+
}
|
|
243
|
+
/*-- Private helper methods for constructor: Codewords and masking --*/
|
|
244
|
+
// Returns a new byte string representing the given data with the appropriate error correction
|
|
245
|
+
// codewords appended to it, based on this object's version and error correction level.
|
|
246
|
+
addEccAndInterleave(data) {
|
|
247
|
+
const ver = this.version;
|
|
248
|
+
const ecl = this.errorCorrectionLevel;
|
|
249
|
+
if (data.length != _QrCode.getNumDataCodewords(ver, ecl))
|
|
250
|
+
throw "Invalid argument";
|
|
251
|
+
const numBlocks = _QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
|
|
252
|
+
const blockEccLen = _QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver];
|
|
253
|
+
const rawCodewords = Math.floor(
|
|
254
|
+
_QrCode.getNumRawDataModules(ver) / 8
|
|
255
|
+
);
|
|
256
|
+
const numShortBlocks = numBlocks - rawCodewords % numBlocks;
|
|
257
|
+
const shortBlockLen = Math.floor(rawCodewords / numBlocks);
|
|
258
|
+
let blocks = [];
|
|
259
|
+
const rsDiv = _QrCode.reedSolomonComputeDivisor(blockEccLen);
|
|
260
|
+
for (let i = 0, k = 0; i < numBlocks; i++) {
|
|
261
|
+
let dat = data.slice(
|
|
262
|
+
k,
|
|
263
|
+
k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1)
|
|
264
|
+
);
|
|
265
|
+
k += dat.length;
|
|
266
|
+
const ecc = _QrCode.reedSolomonComputeRemainder(dat, rsDiv);
|
|
267
|
+
if (i < numShortBlocks)
|
|
268
|
+
dat.push(0);
|
|
269
|
+
blocks.push(dat.concat(ecc));
|
|
270
|
+
}
|
|
271
|
+
let result = [];
|
|
272
|
+
for (let i = 0; i < blocks[0].length; i++) {
|
|
273
|
+
blocks.forEach((block, j) => {
|
|
274
|
+
if (i != shortBlockLen - blockEccLen || j >= numShortBlocks)
|
|
275
|
+
result.push(block[i]);
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
assert(result.length == rawCodewords);
|
|
279
|
+
return result;
|
|
280
|
+
}
|
|
281
|
+
// Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
|
|
282
|
+
// data area of this QR Code. Function modules need to be marked off before this is called.
|
|
283
|
+
drawCodewords(data) {
|
|
284
|
+
if (data.length != Math.floor(_QrCode.getNumRawDataModules(this.version) / 8))
|
|
285
|
+
throw "Invalid argument";
|
|
286
|
+
let i = 0;
|
|
287
|
+
for (let right = this.size - 1; right >= 1; right -= 2) {
|
|
288
|
+
if (right == 6)
|
|
289
|
+
right = 5;
|
|
290
|
+
for (let vert = 0; vert < this.size; vert++) {
|
|
291
|
+
for (let j = 0; j < 2; j++) {
|
|
292
|
+
const x = right - j;
|
|
293
|
+
const upward = (right + 1 & 2) == 0;
|
|
294
|
+
const y = upward ? this.size - 1 - vert : vert;
|
|
295
|
+
if (!this.isFunction[y][x] && i < data.length * 8) {
|
|
296
|
+
this.modules[y][x] = getBit(data[i >>> 3], 7 - (i & 7));
|
|
297
|
+
i++;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
assert(i == data.length * 8);
|
|
303
|
+
}
|
|
304
|
+
// XORs the codeword modules in this QR Code with the given mask pattern.
|
|
305
|
+
// The function modules must be marked and the codeword bits must be drawn
|
|
306
|
+
// before masking. Due to the arithmetic of XOR, calling applyMask() with
|
|
307
|
+
// the same mask value a second time will undo the mask. A final well-formed
|
|
308
|
+
// QR Code needs exactly one (not zero, two, etc.) mask applied.
|
|
309
|
+
applyMask(mask) {
|
|
310
|
+
if (mask < 0 || mask > 7)
|
|
311
|
+
throw "Mask value out of range";
|
|
312
|
+
for (let y = 0; y < this.size; y++) {
|
|
313
|
+
for (let x = 0; x < this.size; x++) {
|
|
314
|
+
let invert;
|
|
315
|
+
switch (mask) {
|
|
316
|
+
case 0:
|
|
317
|
+
invert = (x + y) % 2 == 0;
|
|
318
|
+
break;
|
|
319
|
+
case 1:
|
|
320
|
+
invert = y % 2 == 0;
|
|
321
|
+
break;
|
|
322
|
+
case 2:
|
|
323
|
+
invert = x % 3 == 0;
|
|
324
|
+
break;
|
|
325
|
+
case 3:
|
|
326
|
+
invert = (x + y) % 3 == 0;
|
|
327
|
+
break;
|
|
328
|
+
case 4:
|
|
329
|
+
invert = (Math.floor(x / 3) + Math.floor(y / 2)) % 2 == 0;
|
|
330
|
+
break;
|
|
331
|
+
case 5:
|
|
332
|
+
invert = x * y % 2 + x * y % 3 == 0;
|
|
333
|
+
break;
|
|
334
|
+
case 6:
|
|
335
|
+
invert = (x * y % 2 + x * y % 3) % 2 == 0;
|
|
336
|
+
break;
|
|
337
|
+
case 7:
|
|
338
|
+
invert = ((x + y) % 2 + x * y % 3) % 2 == 0;
|
|
339
|
+
break;
|
|
340
|
+
default:
|
|
341
|
+
throw "Unreachable";
|
|
342
|
+
}
|
|
343
|
+
if (!this.isFunction[y][x] && invert)
|
|
344
|
+
this.modules[y][x] = !this.modules[y][x];
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
// Calculates and returns the penalty score based on state of this QR Code's current modules.
|
|
349
|
+
// This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
|
|
350
|
+
getPenaltyScore() {
|
|
351
|
+
let result = 0;
|
|
352
|
+
for (let y = 0; y < this.size; y++) {
|
|
353
|
+
let runColor = false;
|
|
354
|
+
let runX = 0;
|
|
355
|
+
let runHistory = [0, 0, 0, 0, 0, 0, 0];
|
|
356
|
+
for (let x = 0; x < this.size; x++) {
|
|
357
|
+
if (this.modules[y][x] == runColor) {
|
|
358
|
+
runX++;
|
|
359
|
+
if (runX == 5)
|
|
360
|
+
result += _QrCode.PENALTY_N1;
|
|
361
|
+
else if (runX > 5)
|
|
362
|
+
result++;
|
|
363
|
+
} else {
|
|
364
|
+
this.finderPenaltyAddHistory(runX, runHistory);
|
|
365
|
+
if (!runColor)
|
|
366
|
+
result += this.finderPenaltyCountPatterns(runHistory) * _QrCode.PENALTY_N3;
|
|
367
|
+
runColor = this.modules[y][x];
|
|
368
|
+
runX = 1;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * _QrCode.PENALTY_N3;
|
|
372
|
+
}
|
|
373
|
+
for (let x = 0; x < this.size; x++) {
|
|
374
|
+
let runColor = false;
|
|
375
|
+
let runY = 0;
|
|
376
|
+
let runHistory = [0, 0, 0, 0, 0, 0, 0];
|
|
377
|
+
for (let y = 0; y < this.size; y++) {
|
|
378
|
+
if (this.modules[y][x] == runColor) {
|
|
379
|
+
runY++;
|
|
380
|
+
if (runY == 5)
|
|
381
|
+
result += _QrCode.PENALTY_N1;
|
|
382
|
+
else if (runY > 5)
|
|
383
|
+
result++;
|
|
384
|
+
} else {
|
|
385
|
+
this.finderPenaltyAddHistory(runY, runHistory);
|
|
386
|
+
if (!runColor)
|
|
387
|
+
result += this.finderPenaltyCountPatterns(runHistory) * _QrCode.PENALTY_N3;
|
|
388
|
+
runColor = this.modules[y][x];
|
|
389
|
+
runY = 1;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
result += this.finderPenaltyTerminateAndCount(runColor, runY, runHistory) * _QrCode.PENALTY_N3;
|
|
393
|
+
}
|
|
394
|
+
for (let y = 0; y < this.size - 1; y++) {
|
|
395
|
+
for (let x = 0; x < this.size - 1; x++) {
|
|
396
|
+
const color = this.modules[y][x];
|
|
397
|
+
if (color == this.modules[y][x + 1] && color == this.modules[y + 1][x] && color == this.modules[y + 1][x + 1])
|
|
398
|
+
result += _QrCode.PENALTY_N2;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
let dark = 0;
|
|
402
|
+
for (const row of this.modules)
|
|
403
|
+
dark = row.reduce((sum, color) => sum + (color ? 1 : 0), dark);
|
|
404
|
+
const total = this.size * this.size;
|
|
405
|
+
const k = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;
|
|
406
|
+
assert(0 <= k && k <= 9);
|
|
407
|
+
result += k * _QrCode.PENALTY_N4;
|
|
408
|
+
assert(0 <= result && result <= 2568888);
|
|
409
|
+
return result;
|
|
410
|
+
}
|
|
411
|
+
/*-- Private helper functions --*/
|
|
412
|
+
// Returns an ascending list of positions of alignment patterns for this version number.
|
|
413
|
+
// Each position is in the range [0,177), and are used on both the x and y axes.
|
|
414
|
+
// This could be implemented as lookup table of 40 variable-length lists of integers.
|
|
415
|
+
getAlignmentPatternPositions() {
|
|
416
|
+
if (this.version == 1)
|
|
417
|
+
return [];
|
|
418
|
+
else {
|
|
419
|
+
const numAlign = Math.floor(this.version / 7) + 2;
|
|
420
|
+
const step = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2;
|
|
421
|
+
let result = [6];
|
|
422
|
+
for (let pos = this.size - 7; result.length < numAlign; pos -= step)
|
|
423
|
+
result.splice(1, 0, pos);
|
|
424
|
+
return result;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
// Returns the number of data bits that can be stored in a QR Code of the given version number, after
|
|
428
|
+
// all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.
|
|
429
|
+
// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
|
|
430
|
+
static getNumRawDataModules(ver) {
|
|
431
|
+
if (ver < _QrCode.MIN_VERSION || ver > _QrCode.MAX_VERSION)
|
|
432
|
+
throw "Version number out of range";
|
|
433
|
+
let result = (16 * ver + 128) * ver + 64;
|
|
434
|
+
if (ver >= 2) {
|
|
435
|
+
const numAlign = Math.floor(ver / 7) + 2;
|
|
436
|
+
result -= (25 * numAlign - 10) * numAlign - 55;
|
|
437
|
+
if (ver >= 7)
|
|
438
|
+
result -= 36;
|
|
439
|
+
}
|
|
440
|
+
assert(208 <= result && result <= 29648);
|
|
441
|
+
return result;
|
|
442
|
+
}
|
|
443
|
+
// Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
|
|
444
|
+
// QR Code of the given version number and error correction level, with remainder bits discarded.
|
|
445
|
+
// This stateless pure function could be implemented as a (40*4)-cell lookup table.
|
|
446
|
+
static getNumDataCodewords(ver, ecl) {
|
|
447
|
+
return Math.floor(_QrCode.getNumRawDataModules(ver) / 8) - _QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] * _QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
|
|
448
|
+
}
|
|
449
|
+
// Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
|
|
450
|
+
// implemented as a lookup table over all possible parameter values, instead of as an algorithm.
|
|
451
|
+
static reedSolomonComputeDivisor(degree) {
|
|
452
|
+
if (degree < 1 || degree > 255)
|
|
453
|
+
throw "Degree out of range";
|
|
454
|
+
let result = [];
|
|
455
|
+
for (let i = 0; i < degree - 1; i++)
|
|
456
|
+
result.push(0);
|
|
457
|
+
result.push(1);
|
|
458
|
+
let root = 1;
|
|
459
|
+
for (let i = 0; i < degree; i++) {
|
|
460
|
+
for (let j = 0; j < result.length; j++) {
|
|
461
|
+
result[j] = _QrCode.reedSolomonMultiply(result[j], root);
|
|
462
|
+
if (j + 1 < result.length)
|
|
463
|
+
result[j] ^= result[j + 1];
|
|
464
|
+
}
|
|
465
|
+
root = _QrCode.reedSolomonMultiply(root, 2);
|
|
466
|
+
}
|
|
467
|
+
return result;
|
|
468
|
+
}
|
|
469
|
+
// Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
|
|
470
|
+
static reedSolomonComputeRemainder(data, divisor) {
|
|
471
|
+
let result = divisor.map((_) => 0);
|
|
472
|
+
for (const b of data) {
|
|
473
|
+
const factor = b ^ result.shift();
|
|
474
|
+
result.push(0);
|
|
475
|
+
divisor.forEach(
|
|
476
|
+
(coef, i) => result[i] ^= _QrCode.reedSolomonMultiply(coef, factor)
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
return result;
|
|
480
|
+
}
|
|
481
|
+
// Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
|
|
482
|
+
// are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
|
|
483
|
+
static reedSolomonMultiply(x, y) {
|
|
484
|
+
if (x >>> 8 != 0 || y >>> 8 != 0)
|
|
485
|
+
throw "Byte out of range";
|
|
486
|
+
let z = 0;
|
|
487
|
+
for (let i = 7; i >= 0; i--) {
|
|
488
|
+
z = z << 1 ^ (z >>> 7) * 285;
|
|
489
|
+
z ^= (y >>> i & 1) * x;
|
|
490
|
+
}
|
|
491
|
+
assert(z >>> 8 == 0);
|
|
492
|
+
return z;
|
|
493
|
+
}
|
|
494
|
+
// Can only be called immediately after a light run is added, and
|
|
495
|
+
// returns either 0, 1, or 2. A helper function for getPenaltyScore().
|
|
496
|
+
finderPenaltyCountPatterns(runHistory) {
|
|
497
|
+
const n = runHistory[1];
|
|
498
|
+
assert(n <= this.size * 3);
|
|
499
|
+
const core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;
|
|
500
|
+
return (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0) + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);
|
|
501
|
+
}
|
|
502
|
+
// Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
|
|
503
|
+
finderPenaltyTerminateAndCount(currentRunColor, currentRunLength, runHistory) {
|
|
504
|
+
if (currentRunColor) {
|
|
505
|
+
this.finderPenaltyAddHistory(currentRunLength, runHistory);
|
|
506
|
+
currentRunLength = 0;
|
|
507
|
+
}
|
|
508
|
+
currentRunLength += this.size;
|
|
509
|
+
this.finderPenaltyAddHistory(currentRunLength, runHistory);
|
|
510
|
+
return this.finderPenaltyCountPatterns(runHistory);
|
|
511
|
+
}
|
|
512
|
+
// Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
|
|
513
|
+
finderPenaltyAddHistory(currentRunLength, runHistory) {
|
|
514
|
+
if (runHistory[0] == 0)
|
|
515
|
+
currentRunLength += this.size;
|
|
516
|
+
runHistory.pop();
|
|
517
|
+
runHistory.unshift(currentRunLength);
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
let QrCode = _QrCode;
|
|
521
|
+
/*-- Constants and tables --*/
|
|
522
|
+
// The minimum version number supported in the QR Code Model 2 standard.
|
|
523
|
+
__publicField(QrCode, "MIN_VERSION", 1);
|
|
524
|
+
// The maximum version number supported in the QR Code Model 2 standard.
|
|
525
|
+
__publicField(QrCode, "MAX_VERSION", 40);
|
|
526
|
+
// For use in getPenaltyScore(), when evaluating which mask is best.
|
|
527
|
+
__publicField(QrCode, "PENALTY_N1", 3);
|
|
528
|
+
__publicField(QrCode, "PENALTY_N2", 3);
|
|
529
|
+
__publicField(QrCode, "PENALTY_N3", 40);
|
|
530
|
+
__publicField(QrCode, "PENALTY_N4", 10);
|
|
531
|
+
__publicField(QrCode, "ECC_CODEWORDS_PER_BLOCK", [
|
|
532
|
+
// Version: (note that index 0 is for padding, and is set to an illegal value)
|
|
533
|
+
//0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
|
|
534
|
+
[
|
|
535
|
+
-1,
|
|
536
|
+
7,
|
|
537
|
+
10,
|
|
538
|
+
15,
|
|
539
|
+
20,
|
|
540
|
+
26,
|
|
541
|
+
18,
|
|
542
|
+
20,
|
|
543
|
+
24,
|
|
544
|
+
30,
|
|
545
|
+
18,
|
|
546
|
+
20,
|
|
547
|
+
24,
|
|
548
|
+
26,
|
|
549
|
+
30,
|
|
550
|
+
22,
|
|
551
|
+
24,
|
|
552
|
+
28,
|
|
553
|
+
30,
|
|
554
|
+
28,
|
|
555
|
+
28,
|
|
556
|
+
28,
|
|
557
|
+
28,
|
|
558
|
+
30,
|
|
559
|
+
30,
|
|
560
|
+
26,
|
|
561
|
+
28,
|
|
562
|
+
30,
|
|
563
|
+
30,
|
|
564
|
+
30,
|
|
565
|
+
30,
|
|
566
|
+
30,
|
|
567
|
+
30,
|
|
568
|
+
30,
|
|
569
|
+
30,
|
|
570
|
+
30,
|
|
571
|
+
30,
|
|
572
|
+
30,
|
|
573
|
+
30,
|
|
574
|
+
30,
|
|
575
|
+
30
|
|
576
|
+
],
|
|
577
|
+
// Low
|
|
578
|
+
[
|
|
579
|
+
-1,
|
|
580
|
+
10,
|
|
581
|
+
16,
|
|
582
|
+
26,
|
|
583
|
+
18,
|
|
584
|
+
24,
|
|
585
|
+
16,
|
|
586
|
+
18,
|
|
587
|
+
22,
|
|
588
|
+
22,
|
|
589
|
+
26,
|
|
590
|
+
30,
|
|
591
|
+
22,
|
|
592
|
+
22,
|
|
593
|
+
24,
|
|
594
|
+
24,
|
|
595
|
+
28,
|
|
596
|
+
28,
|
|
597
|
+
26,
|
|
598
|
+
26,
|
|
599
|
+
26,
|
|
600
|
+
26,
|
|
601
|
+
28,
|
|
602
|
+
28,
|
|
603
|
+
28,
|
|
604
|
+
28,
|
|
605
|
+
28,
|
|
606
|
+
28,
|
|
607
|
+
28,
|
|
608
|
+
28,
|
|
609
|
+
28,
|
|
610
|
+
28,
|
|
611
|
+
28,
|
|
612
|
+
28,
|
|
613
|
+
28,
|
|
614
|
+
28,
|
|
615
|
+
28,
|
|
616
|
+
28,
|
|
617
|
+
28,
|
|
618
|
+
28,
|
|
619
|
+
28
|
|
620
|
+
],
|
|
621
|
+
// Medium
|
|
622
|
+
[
|
|
623
|
+
-1,
|
|
624
|
+
13,
|
|
625
|
+
22,
|
|
626
|
+
18,
|
|
627
|
+
26,
|
|
628
|
+
18,
|
|
629
|
+
24,
|
|
630
|
+
18,
|
|
631
|
+
22,
|
|
632
|
+
20,
|
|
633
|
+
24,
|
|
634
|
+
28,
|
|
635
|
+
26,
|
|
636
|
+
24,
|
|
637
|
+
20,
|
|
638
|
+
30,
|
|
639
|
+
24,
|
|
640
|
+
28,
|
|
641
|
+
28,
|
|
642
|
+
26,
|
|
643
|
+
30,
|
|
644
|
+
28,
|
|
645
|
+
30,
|
|
646
|
+
30,
|
|
647
|
+
30,
|
|
648
|
+
30,
|
|
649
|
+
28,
|
|
650
|
+
30,
|
|
651
|
+
30,
|
|
652
|
+
30,
|
|
653
|
+
30,
|
|
654
|
+
30,
|
|
655
|
+
30,
|
|
656
|
+
30,
|
|
657
|
+
30,
|
|
658
|
+
30,
|
|
659
|
+
30,
|
|
660
|
+
30,
|
|
661
|
+
30,
|
|
662
|
+
30,
|
|
663
|
+
30
|
|
664
|
+
],
|
|
665
|
+
// Quartile
|
|
666
|
+
[
|
|
667
|
+
-1,
|
|
668
|
+
17,
|
|
669
|
+
28,
|
|
670
|
+
22,
|
|
671
|
+
16,
|
|
672
|
+
22,
|
|
673
|
+
28,
|
|
674
|
+
26,
|
|
675
|
+
26,
|
|
676
|
+
24,
|
|
677
|
+
28,
|
|
678
|
+
24,
|
|
679
|
+
28,
|
|
680
|
+
22,
|
|
681
|
+
24,
|
|
682
|
+
24,
|
|
683
|
+
30,
|
|
684
|
+
28,
|
|
685
|
+
28,
|
|
686
|
+
26,
|
|
687
|
+
28,
|
|
688
|
+
30,
|
|
689
|
+
24,
|
|
690
|
+
30,
|
|
691
|
+
30,
|
|
692
|
+
30,
|
|
693
|
+
30,
|
|
694
|
+
30,
|
|
695
|
+
30,
|
|
696
|
+
30,
|
|
697
|
+
30,
|
|
698
|
+
30,
|
|
699
|
+
30,
|
|
700
|
+
30,
|
|
701
|
+
30,
|
|
702
|
+
30,
|
|
703
|
+
30,
|
|
704
|
+
30,
|
|
705
|
+
30,
|
|
706
|
+
30,
|
|
707
|
+
30
|
|
708
|
+
]
|
|
709
|
+
// High
|
|
710
|
+
]);
|
|
711
|
+
__publicField(QrCode, "NUM_ERROR_CORRECTION_BLOCKS", [
|
|
712
|
+
// Version: (note that index 0 is for padding, and is set to an illegal value)
|
|
713
|
+
//0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
|
|
714
|
+
[
|
|
715
|
+
-1,
|
|
716
|
+
1,
|
|
717
|
+
1,
|
|
718
|
+
1,
|
|
719
|
+
1,
|
|
720
|
+
1,
|
|
721
|
+
2,
|
|
722
|
+
2,
|
|
723
|
+
2,
|
|
724
|
+
2,
|
|
725
|
+
4,
|
|
726
|
+
4,
|
|
727
|
+
4,
|
|
728
|
+
4,
|
|
729
|
+
4,
|
|
730
|
+
6,
|
|
731
|
+
6,
|
|
732
|
+
6,
|
|
733
|
+
6,
|
|
734
|
+
7,
|
|
735
|
+
8,
|
|
736
|
+
8,
|
|
737
|
+
9,
|
|
738
|
+
9,
|
|
739
|
+
10,
|
|
740
|
+
12,
|
|
741
|
+
12,
|
|
742
|
+
12,
|
|
743
|
+
13,
|
|
744
|
+
14,
|
|
745
|
+
15,
|
|
746
|
+
16,
|
|
747
|
+
17,
|
|
748
|
+
18,
|
|
749
|
+
19,
|
|
750
|
+
19,
|
|
751
|
+
20,
|
|
752
|
+
21,
|
|
753
|
+
22,
|
|
754
|
+
24,
|
|
755
|
+
25
|
|
756
|
+
],
|
|
757
|
+
// Low
|
|
758
|
+
[
|
|
759
|
+
-1,
|
|
760
|
+
1,
|
|
761
|
+
1,
|
|
762
|
+
1,
|
|
763
|
+
2,
|
|
764
|
+
2,
|
|
765
|
+
4,
|
|
766
|
+
4,
|
|
767
|
+
4,
|
|
768
|
+
5,
|
|
769
|
+
5,
|
|
770
|
+
5,
|
|
771
|
+
8,
|
|
772
|
+
9,
|
|
773
|
+
9,
|
|
774
|
+
10,
|
|
775
|
+
10,
|
|
776
|
+
11,
|
|
777
|
+
13,
|
|
778
|
+
14,
|
|
779
|
+
16,
|
|
780
|
+
17,
|
|
781
|
+
17,
|
|
782
|
+
18,
|
|
783
|
+
20,
|
|
784
|
+
21,
|
|
785
|
+
23,
|
|
786
|
+
25,
|
|
787
|
+
26,
|
|
788
|
+
28,
|
|
789
|
+
29,
|
|
790
|
+
31,
|
|
791
|
+
33,
|
|
792
|
+
35,
|
|
793
|
+
37,
|
|
794
|
+
38,
|
|
795
|
+
40,
|
|
796
|
+
43,
|
|
797
|
+
45,
|
|
798
|
+
47,
|
|
799
|
+
49
|
|
800
|
+
],
|
|
801
|
+
// Medium
|
|
802
|
+
[
|
|
803
|
+
-1,
|
|
804
|
+
1,
|
|
805
|
+
1,
|
|
806
|
+
2,
|
|
807
|
+
2,
|
|
808
|
+
4,
|
|
809
|
+
4,
|
|
810
|
+
6,
|
|
811
|
+
6,
|
|
812
|
+
8,
|
|
813
|
+
8,
|
|
814
|
+
8,
|
|
815
|
+
10,
|
|
816
|
+
12,
|
|
817
|
+
16,
|
|
818
|
+
12,
|
|
819
|
+
17,
|
|
820
|
+
16,
|
|
821
|
+
18,
|
|
822
|
+
21,
|
|
823
|
+
20,
|
|
824
|
+
23,
|
|
825
|
+
23,
|
|
826
|
+
25,
|
|
827
|
+
27,
|
|
828
|
+
29,
|
|
829
|
+
34,
|
|
830
|
+
34,
|
|
831
|
+
35,
|
|
832
|
+
38,
|
|
833
|
+
40,
|
|
834
|
+
43,
|
|
835
|
+
45,
|
|
836
|
+
48,
|
|
837
|
+
51,
|
|
838
|
+
53,
|
|
839
|
+
56,
|
|
840
|
+
59,
|
|
841
|
+
62,
|
|
842
|
+
65,
|
|
843
|
+
68
|
|
844
|
+
],
|
|
845
|
+
// Quartile
|
|
846
|
+
[
|
|
847
|
+
-1,
|
|
848
|
+
1,
|
|
849
|
+
1,
|
|
850
|
+
2,
|
|
851
|
+
4,
|
|
852
|
+
4,
|
|
853
|
+
4,
|
|
854
|
+
5,
|
|
855
|
+
6,
|
|
856
|
+
8,
|
|
857
|
+
8,
|
|
858
|
+
11,
|
|
859
|
+
11,
|
|
860
|
+
16,
|
|
861
|
+
16,
|
|
862
|
+
18,
|
|
863
|
+
16,
|
|
864
|
+
19,
|
|
865
|
+
21,
|
|
866
|
+
25,
|
|
867
|
+
25,
|
|
868
|
+
25,
|
|
869
|
+
34,
|
|
870
|
+
30,
|
|
871
|
+
32,
|
|
872
|
+
35,
|
|
873
|
+
37,
|
|
874
|
+
40,
|
|
875
|
+
42,
|
|
876
|
+
45,
|
|
877
|
+
48,
|
|
878
|
+
51,
|
|
879
|
+
54,
|
|
880
|
+
57,
|
|
881
|
+
60,
|
|
882
|
+
63,
|
|
883
|
+
66,
|
|
884
|
+
70,
|
|
885
|
+
74,
|
|
886
|
+
77,
|
|
887
|
+
81
|
|
888
|
+
]
|
|
889
|
+
// High
|
|
890
|
+
]);
|
|
891
|
+
qrcodegen2.QrCode = QrCode;
|
|
892
|
+
function appendBits(val, len, bb) {
|
|
893
|
+
if (len < 0 || len > 31 || val >>> len != 0)
|
|
894
|
+
throw "Value out of range";
|
|
895
|
+
for (let i = len - 1; i >= 0; i--)
|
|
896
|
+
bb.push(val >>> i & 1);
|
|
897
|
+
}
|
|
898
|
+
function getBit(x, i) {
|
|
899
|
+
return (x >>> i & 1) != 0;
|
|
900
|
+
}
|
|
901
|
+
function assert(cond) {
|
|
902
|
+
if (!cond)
|
|
903
|
+
throw "Assertion error";
|
|
904
|
+
}
|
|
905
|
+
const _QrSegment = class {
|
|
906
|
+
/*-- Constructor (low level) and fields --*/
|
|
907
|
+
// Creates a new QR Code segment with the given attributes and data.
|
|
908
|
+
// The character count (numChars) must agree with the mode and the bit buffer length,
|
|
909
|
+
// but the constraint isn't checked. The given bit buffer is cloned and stored.
|
|
910
|
+
constructor(mode, numChars, bitData) {
|
|
911
|
+
this.mode = mode;
|
|
912
|
+
this.numChars = numChars;
|
|
913
|
+
this.bitData = bitData;
|
|
914
|
+
if (numChars < 0)
|
|
915
|
+
throw "Invalid argument";
|
|
916
|
+
this.bitData = bitData.slice();
|
|
917
|
+
}
|
|
918
|
+
/*-- Static factory functions (mid level) --*/
|
|
919
|
+
// Returns a segment representing the given binary data encoded in
|
|
920
|
+
// byte mode. All input byte arrays are acceptable. Any text string
|
|
921
|
+
// can be converted to UTF-8 bytes and encoded as a byte mode segment.
|
|
922
|
+
static makeBytes(data) {
|
|
923
|
+
let bb = [];
|
|
924
|
+
for (const b of data)
|
|
925
|
+
appendBits(b, 8, bb);
|
|
926
|
+
return new _QrSegment(_QrSegment.Mode.BYTE, data.length, bb);
|
|
927
|
+
}
|
|
928
|
+
// Returns a segment representing the given string of decimal digits encoded in numeric mode.
|
|
929
|
+
static makeNumeric(digits) {
|
|
930
|
+
if (!_QrSegment.isNumeric(digits))
|
|
931
|
+
throw "String contains non-numeric characters";
|
|
932
|
+
let bb = [];
|
|
933
|
+
for (let i = 0; i < digits.length; ) {
|
|
934
|
+
const n = Math.min(digits.length - i, 3);
|
|
935
|
+
appendBits(parseInt(digits.substr(i, n), 10), n * 3 + 1, bb);
|
|
936
|
+
i += n;
|
|
937
|
+
}
|
|
938
|
+
return new _QrSegment(_QrSegment.Mode.NUMERIC, digits.length, bb);
|
|
939
|
+
}
|
|
940
|
+
// Returns a segment representing the given text string encoded in alphanumeric mode.
|
|
941
|
+
// The characters allowed are: 0 to 9, A to Z (uppercase only), space,
|
|
942
|
+
// dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
943
|
+
static makeAlphanumeric(text) {
|
|
944
|
+
if (!_QrSegment.isAlphanumeric(text))
|
|
945
|
+
throw "String contains unencodable characters in alphanumeric mode";
|
|
946
|
+
let bb = [];
|
|
947
|
+
let i;
|
|
948
|
+
for (i = 0; i + 2 <= text.length; i += 2) {
|
|
949
|
+
let temp = _QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;
|
|
950
|
+
temp += _QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));
|
|
951
|
+
appendBits(temp, 11, bb);
|
|
952
|
+
}
|
|
953
|
+
if (i < text.length)
|
|
954
|
+
appendBits(
|
|
955
|
+
_QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)),
|
|
956
|
+
6,
|
|
957
|
+
bb
|
|
958
|
+
);
|
|
959
|
+
return new _QrSegment(_QrSegment.Mode.ALPHANUMERIC, text.length, bb);
|
|
960
|
+
}
|
|
961
|
+
// Returns a new mutable list of zero or more segments to represent the given Unicode text string.
|
|
962
|
+
// The result may use various segment modes and switch modes to optimize the length of the bit stream.
|
|
963
|
+
static makeSegments(text) {
|
|
964
|
+
if (text == "")
|
|
965
|
+
return [];
|
|
966
|
+
else if (_QrSegment.isNumeric(text))
|
|
967
|
+
return [_QrSegment.makeNumeric(text)];
|
|
968
|
+
else if (_QrSegment.isAlphanumeric(text))
|
|
969
|
+
return [_QrSegment.makeAlphanumeric(text)];
|
|
970
|
+
else
|
|
971
|
+
return [_QrSegment.makeBytes(_QrSegment.toUtf8ByteArray(text))];
|
|
972
|
+
}
|
|
973
|
+
// Returns a segment representing an Extended Channel Interpretation
|
|
974
|
+
// (ECI) designator with the given assignment value.
|
|
975
|
+
static makeEci(assignVal) {
|
|
976
|
+
let bb = [];
|
|
977
|
+
if (assignVal < 0)
|
|
978
|
+
throw "ECI assignment value out of range";
|
|
979
|
+
else if (assignVal < 1 << 7)
|
|
980
|
+
appendBits(assignVal, 8, bb);
|
|
981
|
+
else if (assignVal < 1 << 14) {
|
|
982
|
+
appendBits(2, 2, bb);
|
|
983
|
+
appendBits(assignVal, 14, bb);
|
|
984
|
+
} else if (assignVal < 1e6) {
|
|
985
|
+
appendBits(6, 3, bb);
|
|
986
|
+
appendBits(assignVal, 21, bb);
|
|
987
|
+
} else
|
|
988
|
+
throw "ECI assignment value out of range";
|
|
989
|
+
return new _QrSegment(_QrSegment.Mode.ECI, 0, bb);
|
|
990
|
+
}
|
|
991
|
+
// Tests whether the given string can be encoded as a segment in numeric mode.
|
|
992
|
+
// A string is encodable iff each character is in the range 0 to 9.
|
|
993
|
+
static isNumeric(text) {
|
|
994
|
+
return _QrSegment.NUMERIC_REGEX.test(text);
|
|
995
|
+
}
|
|
996
|
+
// Tests whether the given string can be encoded as a segment in alphanumeric mode.
|
|
997
|
+
// A string is encodable iff each character is in the following set: 0 to 9, A to Z
|
|
998
|
+
// (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
999
|
+
static isAlphanumeric(text) {
|
|
1000
|
+
return _QrSegment.ALPHANUMERIC_REGEX.test(text);
|
|
1001
|
+
}
|
|
1002
|
+
/*-- Methods --*/
|
|
1003
|
+
// Returns a new copy of the data bits of this segment.
|
|
1004
|
+
getData() {
|
|
1005
|
+
return this.bitData.slice();
|
|
1006
|
+
}
|
|
1007
|
+
// (Package-private) Calculates and returns the number of bits needed to encode the given segments at
|
|
1008
|
+
// the given version. The result is infinity if a segment has too many characters to fit its length field.
|
|
1009
|
+
static getTotalBits(segs, version) {
|
|
1010
|
+
let result = 0;
|
|
1011
|
+
for (const seg of segs) {
|
|
1012
|
+
const ccbits = seg.mode.numCharCountBits(version);
|
|
1013
|
+
if (seg.numChars >= 1 << ccbits)
|
|
1014
|
+
return Infinity;
|
|
1015
|
+
result += 4 + ccbits + seg.bitData.length;
|
|
1016
|
+
}
|
|
1017
|
+
return result;
|
|
1018
|
+
}
|
|
1019
|
+
// Returns a new array of bytes representing the given string encoded in UTF-8.
|
|
1020
|
+
static toUtf8ByteArray(str) {
|
|
1021
|
+
str = encodeURI(str);
|
|
1022
|
+
let result = [];
|
|
1023
|
+
for (let i = 0; i < str.length; i++) {
|
|
1024
|
+
if (str.charAt(i) != "%")
|
|
1025
|
+
result.push(str.charCodeAt(i));
|
|
1026
|
+
else {
|
|
1027
|
+
result.push(parseInt(str.substr(i + 1, 2), 16));
|
|
1028
|
+
i += 2;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
return result;
|
|
1032
|
+
}
|
|
1033
|
+
};
|
|
1034
|
+
let QrSegment = _QrSegment;
|
|
1035
|
+
/*-- Constants --*/
|
|
1036
|
+
// Describes precisely all strings that are encodable in numeric mode.
|
|
1037
|
+
__publicField(QrSegment, "NUMERIC_REGEX", /^[0-9]*$/);
|
|
1038
|
+
// Describes precisely all strings that are encodable in alphanumeric mode.
|
|
1039
|
+
__publicField(QrSegment, "ALPHANUMERIC_REGEX", /^[A-Z0-9 $%*+.\/:-]*$/);
|
|
1040
|
+
// The set of all legal characters in alphanumeric mode,
|
|
1041
|
+
// where each character value maps to the index in the string.
|
|
1042
|
+
__publicField(QrSegment, "ALPHANUMERIC_CHARSET", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:");
|
|
1043
|
+
qrcodegen2.QrSegment = QrSegment;
|
|
1044
|
+
})(qrcodegen || (qrcodegen = {}));
|
|
1045
|
+
((qrcodegen2) => {
|
|
1046
|
+
((QrCode2) => {
|
|
1047
|
+
const _Ecc = class {
|
|
1048
|
+
// The QR Code can tolerate about 30% erroneous codewords
|
|
1049
|
+
/*-- Constructor and fields --*/
|
|
1050
|
+
constructor(ordinal, formatBits) {
|
|
1051
|
+
this.ordinal = ordinal;
|
|
1052
|
+
this.formatBits = formatBits;
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1055
|
+
let Ecc = _Ecc;
|
|
1056
|
+
/*-- Constants --*/
|
|
1057
|
+
__publicField(Ecc, "LOW", new _Ecc(0, 1));
|
|
1058
|
+
// The QR Code can tolerate about 7% erroneous codewords
|
|
1059
|
+
__publicField(Ecc, "MEDIUM", new _Ecc(1, 0));
|
|
1060
|
+
// The QR Code can tolerate about 15% erroneous codewords
|
|
1061
|
+
__publicField(Ecc, "QUARTILE", new _Ecc(2, 3));
|
|
1062
|
+
// The QR Code can tolerate about 25% erroneous codewords
|
|
1063
|
+
__publicField(Ecc, "HIGH", new _Ecc(3, 2));
|
|
1064
|
+
QrCode2.Ecc = Ecc;
|
|
1065
|
+
})(qrcodegen2.QrCode || (qrcodegen2.QrCode = {}));
|
|
1066
|
+
})(qrcodegen || (qrcodegen = {}));
|
|
1067
|
+
((qrcodegen2) => {
|
|
1068
|
+
((QrSegment2) => {
|
|
1069
|
+
const _Mode = class {
|
|
1070
|
+
/*-- Constructor and fields --*/
|
|
1071
|
+
constructor(modeBits, numBitsCharCount) {
|
|
1072
|
+
this.modeBits = modeBits;
|
|
1073
|
+
this.numBitsCharCount = numBitsCharCount;
|
|
1074
|
+
}
|
|
1075
|
+
/*-- Method --*/
|
|
1076
|
+
// (Package-private) Returns the bit width of the character count field for a segment in
|
|
1077
|
+
// this mode in a QR Code at the given version number. The result is in the range [0, 16].
|
|
1078
|
+
numCharCountBits(ver) {
|
|
1079
|
+
return this.numBitsCharCount[Math.floor((ver + 7) / 17)];
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
1082
|
+
let Mode = _Mode;
|
|
1083
|
+
/*-- Constants --*/
|
|
1084
|
+
__publicField(Mode, "NUMERIC", new _Mode(1, [10, 12, 14]));
|
|
1085
|
+
__publicField(Mode, "ALPHANUMERIC", new _Mode(2, [9, 11, 13]));
|
|
1086
|
+
__publicField(Mode, "BYTE", new _Mode(4, [8, 16, 16]));
|
|
1087
|
+
__publicField(Mode, "KANJI", new _Mode(8, [8, 10, 12]));
|
|
1088
|
+
__publicField(Mode, "ECI", new _Mode(7, [0, 0, 0]));
|
|
1089
|
+
QrSegment2.Mode = Mode;
|
|
1090
|
+
})(qrcodegen2.QrSegment || (qrcodegen2.QrSegment = {}));
|
|
1091
|
+
})(qrcodegen || (qrcodegen = {}));
|
|
1092
|
+
const qrcodegen$1 = qrcodegen;
|
|
1093
|
+
module.exports = qrcodegen$1;
|