fast-element-plus 1.0.21 → 2.0.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/CHANGELOG.md +47 -0
- package/CONTRIBUTING.md +83 -0
- package/README.md +74 -115
- package/README.zh.md +74 -115
- package/SECURITY.md +34 -0
- package/dist/component.d.ts +4 -0
- package/dist/component.mjs +56 -0
- package/dist/component.mjs.map +1 -0
- package/dist/components/avatar/index.d.ts +15 -0
- package/dist/components/avatar/index.mjs +9 -0
- package/dist/components/avatar/index.mjs.map +1 -0
- package/dist/components/avatar/src/avatar.d.ts +128 -0
- package/dist/components/avatar/src/avatar.mjs +64 -0
- package/dist/components/avatar/src/avatar.mjs.map +1 -0
- package/dist/components/button/index.d.ts +14 -0
- package/dist/components/button/index.mjs +9 -0
- package/dist/components/button/index.mjs.map +1 -0
- package/dist/components/button/src/button.d.ts +180 -0
- package/dist/components/button/src/button.mjs +108 -0
- package/dist/components/button/src/button.mjs.map +1 -0
- package/dist/components/carNumber/index.d.ts +8 -0
- package/dist/components/carNumber/index.mjs +10 -0
- package/dist/components/carNumber/index.mjs.map +1 -0
- package/dist/components/carNumber/src/carNumber.d.ts +230 -0
- package/dist/components/carNumber/src/carNumber.mjs +148 -0
- package/dist/components/carNumber/src/carNumber.mjs.map +1 -0
- package/dist/components/carNumber/src/common.d.ts +15 -0
- package/dist/components/carNumber/src/common.mjs +97 -0
- package/dist/components/carNumber/src/common.mjs.map +1 -0
- package/dist/components/contextMenu/index.d.ts +8 -0
- package/dist/components/contextMenu/index.mjs +9 -0
- package/dist/components/contextMenu/index.mjs.map +1 -0
- package/dist/components/contextMenu/src/contextMenu.d.ts +32 -0
- package/dist/components/contextMenu/src/contextMenu.mjs +79 -0
- package/dist/components/contextMenu/src/contextMenu.mjs.map +1 -0
- package/dist/components/contextMenu/src/contextMenu.type.d.ts +31 -0
- package/dist/components/dialog/index.d.ts +14 -0
- package/dist/components/dialog/index.mjs +9 -0
- package/dist/components/dialog/index.mjs.map +1 -0
- package/dist/components/dialog/src/dialog.d.ts +472 -0
- package/dist/components/dialog/src/dialog.mjs +287 -0
- package/dist/components/dialog/src/dialog.mjs.map +1 -0
- package/dist/components/drawer/index.d.ts +15 -0
- package/dist/components/drawer/index.mjs +9 -0
- package/dist/components/drawer/index.mjs.map +1 -0
- package/dist/components/drawer/src/drawer.d.ts +470 -0
- package/dist/components/drawer/src/drawer.mjs +297 -0
- package/dist/components/drawer/src/drawer.mjs.map +1 -0
- package/dist/components/form/index.d.ts +23 -0
- package/dist/components/form/index.mjs +13 -0
- package/dist/components/form/index.mjs.map +1 -0
- package/dist/components/form/src/form.d.ts +208 -0
- package/dist/components/form/src/form.mjs +119 -0
- package/dist/components/form/src/form.mjs.map +1 -0
- package/dist/components/form/src/formItem.d.ts +208 -0
- package/dist/components/form/src/formItem.mjs +86 -0
- package/dist/components/form/src/formItem.mjs.map +1 -0
- package/dist/components/form/utils/form.d.ts +83 -0
- package/dist/components/form/utils/form.mjs +176 -0
- package/dist/components/form/utils/form.mjs.map +1 -0
- package/dist/components/formItemTip/index.d.ts +12 -0
- package/dist/components/formItemTip/index.mjs +9 -0
- package/dist/components/formItemTip/index.mjs.map +1 -0
- package/dist/components/formItemTip/src/formItemTip.d.ts +24 -0
- package/dist/components/formItemTip/src/formItemTip.mjs +30 -0
- package/dist/components/formItemTip/src/formItemTip.mjs.map +1 -0
- package/dist/components/icon/index.d.ts +12 -0
- package/dist/components/icon/index.mjs +9 -0
- package/dist/components/icon/index.mjs.map +1 -0
- package/dist/components/icon/src/icon.d.ts +40 -0
- package/dist/components/icon/src/icon.mjs +54 -0
- package/dist/components/icon/src/icon.mjs.map +1 -0
- package/dist/components/iconSelector/index.d.ts +7 -0
- package/dist/components/iconSelector/index.mjs +9 -0
- package/dist/components/iconSelector/index.mjs.map +1 -0
- package/dist/components/iconSelector/src/iconSelector.d.ts +35 -0
- package/dist/components/iconSelector/src/iconSelector.mjs +146 -0
- package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -0
- package/dist/components/image/index.d.ts +12 -0
- package/dist/components/image/index.mjs +9 -0
- package/dist/components/image/index.mjs.map +1 -0
- package/dist/components/image/src/image.d.ts +277 -0
- package/dist/components/image/src/image.mjs +97 -0
- package/dist/components/image/src/image.mjs.map +1 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/inputDialogPage/index.d.ts +14 -0
- package/dist/components/inputDialogPage/index.mjs +9 -0
- package/dist/components/inputDialogPage/index.mjs.map +1 -0
- package/dist/components/inputDialogPage/src/inputDialogPage.d.ts +134 -0
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs +151 -0
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -0
- package/dist/components/layoutGrid/index.d.ts +17 -0
- package/dist/components/layoutGrid/index.mjs +12 -0
- package/dist/components/layoutGrid/index.mjs.map +1 -0
- package/dist/components/layoutGrid/src/layoutGrid.d.ts +61 -0
- package/dist/components/layoutGrid/src/layoutGrid.mjs +161 -0
- package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -0
- package/dist/components/layoutGrid/src/layoutGrid.type.d.ts +7 -0
- package/dist/components/layoutGrid/src/layoutGridItem.d.ts +101 -0
- package/dist/components/layoutGrid/src/layoutGridItem.mjs +85 -0
- package/dist/components/layoutGrid/src/layoutGridItem.mjs.map +1 -0
- package/dist/components/select/index.d.ts +23 -0
- package/dist/components/select/index.mjs +12 -0
- package/dist/components/select/index.mjs.map +1 -0
- package/dist/components/select/src/select.d.ts +618 -0
- package/dist/components/select/src/select.mjs +342 -0
- package/dist/components/select/src/select.mjs.map +1 -0
- package/dist/components/select/src/select.type.d.ts +32 -0
- package/dist/components/select/src/selectOption.d.ts +59 -0
- package/dist/components/select/src/selectOption.mjs +69 -0
- package/dist/components/select/src/selectOption.mjs.map +1 -0
- package/dist/components/selectPage/index.d.ts +14 -0
- package/dist/components/selectPage/index.mjs +9 -0
- package/dist/components/selectPage/index.mjs.map +1 -0
- package/dist/components/selectPage/src/selectPage.d.ts +583 -0
- package/dist/components/selectPage/src/selectPage.mjs +381 -0
- package/dist/components/selectPage/src/selectPage.mjs.map +1 -0
- package/dist/components/selectV2/index.d.ts +15 -0
- package/dist/components/selectV2/index.mjs +9 -0
- package/dist/components/selectV2/index.mjs.map +1 -0
- package/dist/components/selectV2/src/selectV2.d.ts +1477 -0
- package/dist/components/selectV2/src/selectV2.mjs +642 -0
- package/dist/components/selectV2/src/selectV2.mjs.map +1 -0
- package/dist/components/table/images/artwork.mjs +6 -0
- package/dist/components/table/images/artwork.mjs.map +1 -0
- package/dist/components/table/images/notImage.mjs +6 -0
- package/dist/components/table/images/notImage.mjs.map +1 -0
- package/dist/components/table/index.d.ts +34 -0
- package/dist/components/table/index.mjs +25 -0
- package/dist/components/table/index.mjs.map +1 -0
- package/dist/components/table/src/page.type.d.ts +145 -0
- package/dist/components/table/src/page.type.mjs +45 -0
- package/dist/components/table/src/page.type.mjs.map +1 -0
- package/dist/components/table/src/table.d.ts +1522 -0
- package/dist/components/table/src/table.mjs +1004 -0
- package/dist/components/table/src/table.mjs.map +1 -0
- package/dist/components/table/src/table.state.d.ts +113 -0
- package/dist/components/table/src/table.type.d.ts +266 -0
- package/dist/components/table/src/table.type.mjs +20 -0
- package/dist/components/table/src/table.type.mjs.map +1 -0
- package/dist/components/table/src/tableColumn.d.ts +666 -0
- package/dist/components/table/src/tableColumn.mjs +599 -0
- package/dist/components/table/src/tableColumn.mjs.map +1 -0
- package/dist/components/table/src/tableColumnSettingDialog.d.ts +18 -0
- package/dist/components/table/src/tableColumnSettingDialog.mjs +307 -0
- package/dist/components/table/src/tableColumnSettingDialog.mjs.map +1 -0
- package/dist/components/table/src/tablePagination.d.ts +24 -0
- package/dist/components/table/src/tablePagination.mjs +57 -0
- package/dist/components/table/src/tablePagination.mjs.map +1 -0
- package/dist/components/table/src/tableSearchForm.d.ts +86 -0
- package/dist/components/table/src/tableSearchForm.mjs +229 -0
- package/dist/components/table/src/tableSearchForm.mjs.map +1 -0
- package/dist/components/table/src/tableSearchFormItem.d.ts +35 -0
- package/dist/components/table/src/tableSearchFormItem.mjs +216 -0
- package/dist/components/table/src/tableSearchFormItem.mjs.map +1 -0
- package/dist/components/table/src/useTable.d.ts +44 -0
- package/dist/components/table/src/useTable.mjs +407 -0
- package/dist/components/table/src/useTable.mjs.map +1 -0
- package/dist/components/table/utils/table.d.ts +46 -0
- package/dist/components/table/utils/table.mjs +111 -0
- package/dist/components/table/utils/table.mjs.map +1 -0
- package/dist/components/tree/index.d.ts +15 -0
- package/dist/components/tree/index.mjs +9 -0
- package/dist/components/tree/index.mjs.map +1 -0
- package/dist/components/tree/src/tree.d.ts +579 -0
- package/dist/components/tree/src/tree.mjs +334 -0
- package/dist/components/tree/src/tree.mjs.map +1 -0
- package/dist/components/tree/src/tree.props.d.ts +33 -0
- package/dist/components/tree/src/tree.type.d.ts +38 -0
- package/dist/components/treeSelect/index.d.ts +14 -0
- package/dist/components/treeSelect/index.mjs +9 -0
- package/dist/components/treeSelect/index.mjs.map +1 -0
- package/dist/components/treeSelect/src/treeSelect.d.ts +1036 -0
- package/dist/components/treeSelect/src/treeSelect.mjs +456 -0
- package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -0
- package/dist/components/upload/index.d.ts +14 -0
- package/dist/components/upload/index.mjs +9 -0
- package/dist/components/upload/index.mjs.map +1 -0
- package/dist/components/upload/src/upload.d.ts +488 -0
- package/dist/components/upload/src/upload.mjs +134 -0
- package/dist/components/upload/src/upload.mjs.map +1 -0
- package/dist/components/upload/src/useUpload.d.ts +35 -0
- package/dist/components/upload/src/useUpload.mjs +168 -0
- package/dist/components/upload/src/useUpload.mjs.map +1 -0
- package/dist/components/upload/utils/upload.d.ts +34 -0
- package/dist/components/upload/utils/upload.mjs +108 -0
- package/dist/components/upload/utils/upload.mjs.map +1 -0
- package/dist/components/uploadImage/index.d.ts +14 -0
- package/dist/components/uploadImage/index.mjs +9 -0
- package/dist/components/uploadImage/index.mjs.map +1 -0
- package/dist/components/uploadImage/src/uploadImage.d.ts +538 -0
- package/dist/components/uploadImage/src/uploadImage.mjs +201 -0
- package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -0
- package/dist/components/uploadImages/index.d.ts +15 -0
- package/dist/components/uploadImages/index.mjs +9 -0
- package/dist/components/uploadImages/index.mjs.map +1 -0
- package/dist/components/uploadImages/src/uploadImages.d.ts +507 -0
- package/dist/components/uploadImages/src/uploadImages.mjs +185 -0
- package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/mime.d.ts +59 -0
- package/dist/constants/mime.mjs +64 -0
- package/dist/constants/mime.mjs.map +1 -0
- package/dist/constants/regex.d.ts +76 -0
- package/dist/constants/regex.mjs +81 -0
- package/dist/constants/regex.mjs.map +1 -0
- package/dist/directive.d.ts +4 -0
- package/dist/directive.mjs +20 -0
- package/dist/directive.mjs.map +1 -0
- package/dist/directives/click-copy/index.d.ts +3 -0
- package/dist/directives/click-copy/index.mjs +39 -0
- package/dist/directives/click-copy/index.mjs.map +1 -0
- package/dist/directives/click-debounce/index.d.ts +7 -0
- package/dist/directives/click-debounce/index.mjs +17 -0
- package/dist/directives/click-debounce/index.mjs.map +1 -0
- package/dist/directives/click-draggable/index.d.ts +3 -0
- package/dist/directives/click-draggable/index.mjs +31 -0
- package/dist/directives/click-draggable/index.mjs.map +1 -0
- package/dist/directives/click-icon-copy/index.d.ts +3 -0
- package/dist/directives/click-icon-copy/index.mjs +47 -0
- package/dist/directives/click-icon-copy/index.mjs.map +1 -0
- package/dist/directives/click-longpress/index.d.ts +3 -0
- package/dist/directives/click-longpress/index.mjs +31 -0
- package/dist/directives/click-longpress/index.mjs.map +1 -0
- package/dist/directives/click-throttle/index.d.ts +7 -0
- package/dist/directives/click-throttle/index.mjs +26 -0
- package/dist/directives/click-throttle/index.mjs.map +1 -0
- package/dist/directives/index.d.ts +6 -0
- package/dist/element-plus.d.ts +8 -0
- package/dist/element-plus.mjs +171 -0
- package/dist/element-plus.mjs.map +1 -0
- package/dist/global.d.ts +58 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/use-loading/index.d.ts +7 -0
- package/dist/hooks/use-loading/index.mjs +43 -0
- package/dist/hooks/use-loading/index.mjs.map +1 -0
- package/dist/hooks/use-overlay/index.d.ts +11 -0
- package/dist/hooks/use-overlay/index.mjs +33 -0
- package/dist/hooks/use-overlay/index.mjs.map +1 -0
- package/dist/hooks/use-screenFull/index.d.ts +15 -0
- package/dist/hooks/use-screenFull/index.mjs +56 -0
- package/dist/hooks/use-screenFull/index.mjs.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.global.min.js +23 -0
- package/dist/index.global.min.js.map +1 -0
- package/dist/index.mjs +70 -0
- package/dist/index.mjs.map +1 -0
- package/dist/make-installer.d.ts +8 -0
- package/dist/make-installer.mjs +28 -0
- package/dist/make-installer.mjs.map +1 -0
- package/dist/utils/async/index.d.ts +35 -0
- package/dist/utils/async/index.mjs +94 -0
- package/dist/utils/async/index.mjs.map +1 -0
- package/dist/utils/date/index.d.ts +74 -0
- package/dist/utils/date/index.mjs +190 -0
- package/dist/utils/date/index.mjs.map +1 -0
- package/dist/utils/dom/index.d.ts +9 -0
- package/dist/utils/dom/index.mjs +35 -0
- package/dist/utils/dom/index.mjs.map +1 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/string/index.d.ts +20 -0
- package/dist/utils/string/index.mjs +101 -0
- package/dist/utils/string/index.mjs.map +1 -0
- package/dist/utils/vue/emits.d.ts +23 -0
- package/dist/utils/vue/emits.mjs +47 -0
- package/dist/utils/vue/emits.mjs.map +1 -0
- package/dist/utils/vue/expose.d.ts +8 -0
- package/dist/utils/vue/expose.mjs +16 -0
- package/dist/utils/vue/expose.mjs.map +1 -0
- package/dist/utils/vue/func.d.ts +10 -0
- package/dist/utils/vue/func.mjs +16 -0
- package/dist/utils/vue/func.mjs.map +1 -0
- package/dist/utils/vue/index.d.ts +13 -0
- package/dist/utils/vue/install.d.ts +47 -0
- package/dist/utils/vue/install.mjs +123 -0
- package/dist/utils/vue/install.mjs.map +1 -0
- package/dist/utils/vue/props.d.ts +19 -0
- package/dist/utils/vue/props.mjs +41 -0
- package/dist/utils/vue/props.mjs.map +1 -0
- package/dist/utils/vue/render.d.ts +8 -0
- package/dist/utils/vue/render.mjs +17 -0
- package/dist/utils/vue/render.mjs.map +1 -0
- package/dist/utils/vue/slots.d.ts +18 -0
- package/dist/utils/vue/slots.mjs +13 -0
- package/dist/utils/vue/slots.mjs.map +1 -0
- package/dist/utils/vue/with.d.ts +8 -0
- package/dist/utils/vue/with.mjs +15 -0
- package/dist/utils/vue/with.mjs.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.mjs +7 -0
- package/dist/version.mjs.map +1 -0
- package/package.json +91 -101
- package/dist/index.full.js +0 -27745
- package/dist/index.full.js.map +0 -1
- package/dist/index.full.min.js +0 -11042
- package/dist/index.full.min.js.map +0 -1
- package/dist/index.full.min.mjs +0 -11033
- package/dist/index.full.min.mjs.map +0 -1
- package/dist/index.full.mjs +0 -27737
- package/dist/index.full.mjs.map +0 -1
- package/dist/styles/index.css +0 -1003
- package/dist/styles/index.css.map +0 -1
- package/es/_virtual/_rolldown/runtime.mjs +0 -1
- package/es/component.d.ts +0 -3
- package/es/component.mjs +0 -2
- package/es/component.mjs.map +0 -1
- package/es/components/avatar/index.d.ts +0 -14
- package/es/components/avatar/index.mjs +0 -2
- package/es/components/avatar/index.mjs.map +0 -1
- package/es/components/avatar/src/avatar.d.ts +0 -125
- package/es/components/avatar/src/avatar.mjs +0 -2
- package/es/components/avatar/src/avatar.mjs.map +0 -1
- package/es/components/button/index.d.ts +0 -15
- package/es/components/button/index.mjs +0 -2
- package/es/components/button/index.mjs.map +0 -1
- package/es/components/button/src/button.d.ts +0 -177
- package/es/components/button/src/button.mjs +0 -2
- package/es/components/button/src/button.mjs.map +0 -1
- package/es/components/carNumber/index.d.ts +0 -9
- package/es/components/carNumber/index.mjs +0 -2
- package/es/components/carNumber/index.mjs.map +0 -1
- package/es/components/carNumber/src/carNumber.d.ts +0 -228
- package/es/components/carNumber/src/carNumber.mjs +0 -2
- package/es/components/carNumber/src/carNumber.mjs.map +0 -1
- package/es/components/carNumber/src/common.d.ts +0 -15
- package/es/components/carNumber/src/common.mjs +0 -2
- package/es/components/carNumber/src/common.mjs.map +0 -1
- package/es/components/contextMenu/index.d.ts +0 -9
- package/es/components/contextMenu/index.mjs +0 -2
- package/es/components/contextMenu/index.mjs.map +0 -1
- package/es/components/contextMenu/src/contextMenu.d.ts +0 -32
- package/es/components/contextMenu/src/contextMenu.mjs +0 -2
- package/es/components/contextMenu/src/contextMenu.mjs.map +0 -1
- package/es/components/contextMenu/src/contextMenu.type.d.ts +0 -33
- package/es/components/dialog/index.d.ts +0 -14
- package/es/components/dialog/index.mjs +0 -2
- package/es/components/dialog/index.mjs.map +0 -1
- package/es/components/dialog/src/dialog.d.ts +0 -454
- package/es/components/dialog/src/dialog.mjs +0 -2
- package/es/components/dialog/src/dialog.mjs.map +0 -1
- package/es/components/drawer/index.d.ts +0 -14
- package/es/components/drawer/index.mjs +0 -2
- package/es/components/drawer/index.mjs.map +0 -1
- package/es/components/drawer/src/drawer.d.ts +0 -458
- package/es/components/drawer/src/drawer.mjs +0 -2
- package/es/components/drawer/src/drawer.mjs.map +0 -1
- package/es/components/form/index.d.ts +0 -23
- package/es/components/form/index.mjs +0 -2
- package/es/components/form/index.mjs.map +0 -1
- package/es/components/form/src/form.d.ts +0 -194
- package/es/components/form/src/form.mjs +0 -2
- package/es/components/form/src/form.mjs.map +0 -1
- package/es/components/form/src/formItem.d.ts +0 -204
- package/es/components/form/src/formItem.mjs +0 -2
- package/es/components/form/src/formItem.mjs.map +0 -1
- package/es/components/form/utils/form.d.ts +0 -81
- package/es/components/form/utils/form.mjs +0 -2
- package/es/components/form/utils/form.mjs.map +0 -1
- package/es/components/formItemTip/index.d.ts +0 -12
- package/es/components/formItemTip/index.mjs +0 -2
- package/es/components/formItemTip/index.mjs.map +0 -1
- package/es/components/formItemTip/src/formItemTip.d.ts +0 -22
- package/es/components/formItemTip/src/formItemTip.mjs +0 -2
- package/es/components/formItemTip/src/formItemTip.mjs.map +0 -1
- package/es/components/icon/index.d.ts +0 -12
- package/es/components/icon/index.mjs +0 -2
- package/es/components/icon/index.mjs.map +0 -1
- package/es/components/icon/src/icon.d.ts +0 -39
- package/es/components/icon/src/icon.mjs +0 -2
- package/es/components/icon/src/icon.mjs.map +0 -1
- package/es/components/iconSelector/index.d.ts +0 -7
- package/es/components/iconSelector/index.mjs +0 -2
- package/es/components/iconSelector/index.mjs.map +0 -1
- package/es/components/iconSelector/src/iconSelector.d.ts +0 -23
- package/es/components/iconSelector/src/iconSelector.mjs +0 -2
- package/es/components/iconSelector/src/iconSelector.mjs.map +0 -1
- package/es/components/image/index.d.ts +0 -12
- package/es/components/image/index.mjs +0 -2
- package/es/components/image/index.mjs.map +0 -1
- package/es/components/image/src/image.d.ts +0 -232
- package/es/components/image/src/image.mjs +0 -2
- package/es/components/image/src/image.mjs.map +0 -1
- package/es/components/index.d.ts +0 -22
- package/es/components/index.mjs +0 -2
- package/es/components/index.mjs.map +0 -1
- package/es/components/inputDialogPage/index.d.ts +0 -14
- package/es/components/inputDialogPage/index.mjs +0 -2
- package/es/components/inputDialogPage/index.mjs.map +0 -1
- package/es/components/inputDialogPage/src/inputDialogPage.d.ts +0 -132
- package/es/components/inputDialogPage/src/inputDialogPage.mjs +0 -2
- package/es/components/inputDialogPage/src/inputDialogPage.mjs.map +0 -1
- package/es/components/layoutGrid/index.d.ts +0 -16
- package/es/components/layoutGrid/index.mjs +0 -2
- package/es/components/layoutGrid/index.mjs.map +0 -1
- package/es/components/layoutGrid/src/layoutGrid.d.ts +0 -60
- package/es/components/layoutGrid/src/layoutGrid.mjs +0 -2
- package/es/components/layoutGrid/src/layoutGrid.mjs.map +0 -1
- package/es/components/layoutGrid/src/layoutGrid.type.d.ts +0 -12
- package/es/components/layoutGrid/src/layoutGrid.type.mjs +0 -0
- package/es/components/layoutGrid/src/layoutGridItem.d.ts +0 -100
- package/es/components/layoutGrid/src/layoutGridItem.mjs +0 -2
- package/es/components/layoutGrid/src/layoutGridItem.mjs.map +0 -1
- package/es/components/select/index.d.ts +0 -22
- package/es/components/select/index.mjs +0 -2
- package/es/components/select/index.mjs.map +0 -1
- package/es/components/select/src/select.d.ts +0 -1206
- package/es/components/select/src/select.mjs +0 -2
- package/es/components/select/src/select.mjs.map +0 -1
- package/es/components/select/src/select.type.d.ts +0 -28
- package/es/components/select/src/select.type.mjs +0 -0
- package/es/components/select/src/selectOption.d.ts +0 -99
- package/es/components/select/src/selectOption.mjs +0 -2
- package/es/components/select/src/selectOption.mjs.map +0 -1
- package/es/components/selectPage/index.d.ts +0 -14
- package/es/components/selectPage/index.mjs +0 -2
- package/es/components/selectPage/index.mjs.map +0 -1
- package/es/components/selectPage/src/selectPage.d.ts +0 -609
- package/es/components/selectPage/src/selectPage.mjs +0 -2
- package/es/components/selectPage/src/selectPage.mjs.map +0 -1
- package/es/components/selectV2/index.d.ts +0 -14
- package/es/components/selectV2/index.mjs +0 -2
- package/es/components/selectV2/index.mjs.map +0 -1
- package/es/components/selectV2/src/selectV2.d.ts +0 -1399
- package/es/components/selectV2/src/selectV2.mjs +0 -2
- package/es/components/selectV2/src/selectV2.mjs.map +0 -1
- package/es/components/table/images/artwork.mjs +0 -2
- package/es/components/table/images/artwork.mjs.map +0 -1
- package/es/components/table/images/index.d.ts +0 -4
- package/es/components/table/images/notImage.mjs +0 -2
- package/es/components/table/images/notImage.mjs.map +0 -1
- package/es/components/table/index.d.ts +0 -35
- package/es/components/table/index.mjs +0 -2
- package/es/components/table/index.mjs.map +0 -1
- package/es/components/table/src/page.type.d.ts +0 -145
- package/es/components/table/src/page.type.mjs +0 -2
- package/es/components/table/src/page.type.mjs.map +0 -1
- package/es/components/table/src/table.d.ts +0 -1439
- package/es/components/table/src/table.mjs +0 -2
- package/es/components/table/src/table.mjs.map +0 -1
- package/es/components/table/src/table.state.d.ts +0 -111
- package/es/components/table/src/table.state.mjs +0 -0
- package/es/components/table/src/table.type.d.ts +0 -261
- package/es/components/table/src/table.type.mjs +0 -2
- package/es/components/table/src/table.type.mjs.map +0 -1
- package/es/components/table/src/tableColumn.d.ts +0 -658
- package/es/components/table/src/tableColumn.mjs +0 -2
- package/es/components/table/src/tableColumn.mjs.map +0 -1
- package/es/components/table/src/tableColumnSettingDialog.d.ts +0 -18
- package/es/components/table/src/tableColumnSettingDialog.mjs +0 -2
- package/es/components/table/src/tableColumnSettingDialog.mjs.map +0 -1
- package/es/components/table/src/tablePagination.d.ts +0 -24
- package/es/components/table/src/tablePagination.mjs +0 -2
- package/es/components/table/src/tablePagination.mjs.map +0 -1
- package/es/components/table/src/tableSearchForm.d.ts +0 -88
- package/es/components/table/src/tableSearchForm.mjs +0 -2
- package/es/components/table/src/tableSearchForm.mjs.map +0 -1
- package/es/components/table/src/tableSearchFormItem.d.ts +0 -37
- package/es/components/table/src/tableSearchFormItem.mjs +0 -2
- package/es/components/table/src/tableSearchFormItem.mjs.map +0 -1
- package/es/components/table/src/useTable.d.ts +0 -32
- package/es/components/table/src/useTable.mjs +0 -2
- package/es/components/table/src/useTable.mjs.map +0 -1
- package/es/components/table/utils/table.d.ts +0 -45
- package/es/components/table/utils/table.mjs +0 -2
- package/es/components/table/utils/table.mjs.map +0 -1
- package/es/components/tree/index.d.ts +0 -15
- package/es/components/tree/index.mjs +0 -2
- package/es/components/tree/index.mjs.map +0 -1
- package/es/components/tree/src/tree.d.ts +0 -562
- package/es/components/tree/src/tree.mjs +0 -2
- package/es/components/tree/src/tree.mjs.map +0 -1
- package/es/components/tree/src/tree.props.d.ts +0 -81
- package/es/components/tree/src/tree.props.mjs +0 -2
- package/es/components/tree/src/tree.props.mjs.map +0 -1
- package/es/components/tree/src/tree.type.d.ts +0 -36
- package/es/components/tree/src/tree.type.mjs +0 -0
- package/es/components/treeSelect/index.d.ts +0 -14
- package/es/components/treeSelect/index.mjs +0 -2
- package/es/components/treeSelect/index.mjs.map +0 -1
- package/es/components/treeSelect/src/treeSelect.d.ts +0 -965
- package/es/components/treeSelect/src/treeSelect.mjs +0 -2
- package/es/components/treeSelect/src/treeSelect.mjs.map +0 -1
- package/es/components/upload/index.d.ts +0 -15
- package/es/components/upload/index.mjs +0 -2
- package/es/components/upload/index.mjs.map +0 -1
- package/es/components/upload/src/upload.d.ts +0 -529
- package/es/components/upload/src/upload.mjs +0 -2
- package/es/components/upload/src/upload.mjs.map +0 -1
- package/es/components/upload/src/useUpload.d.ts +0 -65
- package/es/components/upload/src/useUpload.mjs +0 -2
- package/es/components/upload/src/useUpload.mjs.map +0 -1
- package/es/components/upload/utils/upload.d.ts +0 -30
- package/es/components/upload/utils/upload.mjs +0 -2
- package/es/components/upload/utils/upload.mjs.map +0 -1
- package/es/components/uploadImage/index.d.ts +0 -14
- package/es/components/uploadImage/index.mjs +0 -2
- package/es/components/uploadImage/index.mjs.map +0 -1
- package/es/components/uploadImage/src/uploadImage.d.ts +0 -579
- package/es/components/uploadImage/src/uploadImage.mjs +0 -2
- package/es/components/uploadImage/src/uploadImage.mjs.map +0 -1
- package/es/components/uploadImages/index.d.ts +0 -14
- package/es/components/uploadImages/index.mjs +0 -2
- package/es/components/uploadImages/index.mjs.map +0 -1
- package/es/components/uploadImages/src/uploadImages.d.ts +0 -548
- package/es/components/uploadImages/src/uploadImages.mjs +0 -2
- package/es/components/uploadImages/src/uploadImages.mjs.map +0 -1
- package/es/constants/index.d.ts +0 -2
- package/es/constants/index.mjs +0 -1
- package/es/constants/mime.d.ts +0 -61
- package/es/constants/mime.mjs +0 -2
- package/es/constants/mime.mjs.map +0 -1
- package/es/constants/regex.d.ts +0 -78
- package/es/constants/regex.mjs +0 -2
- package/es/constants/regex.mjs.map +0 -1
- package/es/directive.d.ts +0 -2
- package/es/directive.mjs +0 -2
- package/es/directive.mjs.map +0 -1
- package/es/directives/click-copy/index.d.ts +0 -2
- package/es/directives/click-copy/index.mjs +0 -2
- package/es/directives/click-copy/index.mjs.map +0 -1
- package/es/directives/click-debounce/index.d.ts +0 -2
- package/es/directives/click-debounce/index.mjs +0 -2
- package/es/directives/click-debounce/index.mjs.map +0 -1
- package/es/directives/click-draggable/index.d.ts +0 -2
- package/es/directives/click-draggable/index.mjs +0 -2
- package/es/directives/click-draggable/index.mjs.map +0 -1
- package/es/directives/click-icon-copy/index.d.ts +0 -2
- package/es/directives/click-icon-copy/index.mjs +0 -2
- package/es/directives/click-icon-copy/index.mjs.map +0 -1
- package/es/directives/click-longpress/index.d.ts +0 -2
- package/es/directives/click-longpress/index.mjs +0 -2
- package/es/directives/click-longpress/index.mjs.map +0 -1
- package/es/directives/click-throttle/index.d.ts +0 -2
- package/es/directives/click-throttle/index.mjs +0 -2
- package/es/directives/click-throttle/index.mjs.map +0 -1
- package/es/directives/index.d.ts +0 -6
- package/es/directives/index.mjs +0 -1
- package/es/element-plus.d.ts +0 -2
- package/es/element-plus.mjs +0 -2
- package/es/element-plus.mjs.map +0 -1
- package/es/hooks/index.d.ts +0 -3
- package/es/hooks/index.mjs +0 -1
- package/es/hooks/use-loading/index.d.ts +0 -4
- package/es/hooks/use-loading/index.mjs +0 -2
- package/es/hooks/use-loading/index.mjs.map +0 -1
- package/es/hooks/use-overlay/index.d.ts +0 -4
- package/es/hooks/use-overlay/index.mjs +0 -2
- package/es/hooks/use-overlay/index.mjs.map +0 -1
- package/es/hooks/use-screenFull/index.d.ts +0 -7
- package/es/hooks/use-screenFull/index.mjs +0 -2
- package/es/hooks/use-screenFull/index.mjs.map +0 -1
- package/es/index.d.ts +0 -14
- package/es/index.es.d.ts +0 -6
- package/es/index.mjs +0 -2
- package/es/index.mjs.map +0 -1
- package/es/make-installer.d.ts +0 -6
- package/es/make-installer.mjs +0 -2
- package/es/make-installer.mjs.map +0 -1
- package/es/version.d.ts +0 -1
- package/es/version.mjs +0 -2
- package/es/version.mjs.map +0 -1
- package/global.d.ts +0 -2
- package/lib/_virtual/_rolldown/runtime.js +0 -1
- package/lib/component.d.ts +0 -3
- package/lib/component.js +0 -2
- package/lib/component.js.map +0 -1
- package/lib/components/avatar/index.d.ts +0 -14
- package/lib/components/avatar/index.js +0 -2
- package/lib/components/avatar/index.js.map +0 -1
- package/lib/components/avatar/src/avatar.d.ts +0 -125
- package/lib/components/avatar/src/avatar.js +0 -2
- package/lib/components/avatar/src/avatar.js.map +0 -1
- package/lib/components/button/index.d.ts +0 -15
- package/lib/components/button/index.js +0 -2
- package/lib/components/button/index.js.map +0 -1
- package/lib/components/button/src/button.d.ts +0 -177
- package/lib/components/button/src/button.js +0 -2
- package/lib/components/button/src/button.js.map +0 -1
- package/lib/components/carNumber/index.d.ts +0 -9
- package/lib/components/carNumber/index.js +0 -2
- package/lib/components/carNumber/index.js.map +0 -1
- package/lib/components/carNumber/src/carNumber.d.ts +0 -228
- package/lib/components/carNumber/src/carNumber.js +0 -2
- package/lib/components/carNumber/src/carNumber.js.map +0 -1
- package/lib/components/carNumber/src/common.d.ts +0 -15
- package/lib/components/carNumber/src/common.js +0 -2
- package/lib/components/carNumber/src/common.js.map +0 -1
- package/lib/components/contextMenu/index.d.ts +0 -9
- package/lib/components/contextMenu/index.js +0 -2
- package/lib/components/contextMenu/index.js.map +0 -1
- package/lib/components/contextMenu/src/contextMenu.d.ts +0 -32
- package/lib/components/contextMenu/src/contextMenu.js +0 -2
- package/lib/components/contextMenu/src/contextMenu.js.map +0 -1
- package/lib/components/contextMenu/src/contextMenu.type.d.ts +0 -33
- package/lib/components/contextMenu/src/contextMenu.type.js +0 -0
- package/lib/components/dialog/index.d.ts +0 -14
- package/lib/components/dialog/index.js +0 -2
- package/lib/components/dialog/index.js.map +0 -1
- package/lib/components/dialog/src/dialog.d.ts +0 -454
- package/lib/components/dialog/src/dialog.js +0 -2
- package/lib/components/dialog/src/dialog.js.map +0 -1
- package/lib/components/drawer/index.d.ts +0 -14
- package/lib/components/drawer/index.js +0 -2
- package/lib/components/drawer/index.js.map +0 -1
- package/lib/components/drawer/src/drawer.d.ts +0 -458
- package/lib/components/drawer/src/drawer.js +0 -2
- package/lib/components/drawer/src/drawer.js.map +0 -1
- package/lib/components/form/index.d.ts +0 -23
- package/lib/components/form/index.js +0 -2
- package/lib/components/form/index.js.map +0 -1
- package/lib/components/form/src/form.d.ts +0 -194
- package/lib/components/form/src/form.js +0 -2
- package/lib/components/form/src/form.js.map +0 -1
- package/lib/components/form/src/formItem.d.ts +0 -204
- package/lib/components/form/src/formItem.js +0 -2
- package/lib/components/form/src/formItem.js.map +0 -1
- package/lib/components/form/utils/form.d.ts +0 -81
- package/lib/components/form/utils/form.js +0 -2
- package/lib/components/form/utils/form.js.map +0 -1
- package/lib/components/formItemTip/index.d.ts +0 -12
- package/lib/components/formItemTip/index.js +0 -2
- package/lib/components/formItemTip/index.js.map +0 -1
- package/lib/components/formItemTip/src/formItemTip.d.ts +0 -22
- package/lib/components/formItemTip/src/formItemTip.js +0 -2
- package/lib/components/formItemTip/src/formItemTip.js.map +0 -1
- package/lib/components/icon/index.d.ts +0 -12
- package/lib/components/icon/index.js +0 -2
- package/lib/components/icon/index.js.map +0 -1
- package/lib/components/icon/src/icon.d.ts +0 -39
- package/lib/components/icon/src/icon.js +0 -2
- package/lib/components/icon/src/icon.js.map +0 -1
- package/lib/components/iconSelector/index.d.ts +0 -7
- package/lib/components/iconSelector/index.js +0 -2
- package/lib/components/iconSelector/index.js.map +0 -1
- package/lib/components/iconSelector/src/iconSelector.d.ts +0 -23
- package/lib/components/iconSelector/src/iconSelector.js +0 -2
- package/lib/components/iconSelector/src/iconSelector.js.map +0 -1
- package/lib/components/image/index.d.ts +0 -12
- package/lib/components/image/index.js +0 -2
- package/lib/components/image/index.js.map +0 -1
- package/lib/components/image/src/image.d.ts +0 -232
- package/lib/components/image/src/image.js +0 -2
- package/lib/components/image/src/image.js.map +0 -1
- package/lib/components/index.d.ts +0 -22
- package/lib/components/index.js +0 -2
- package/lib/components/index.js.map +0 -1
- package/lib/components/inputDialogPage/index.d.ts +0 -14
- package/lib/components/inputDialogPage/index.js +0 -2
- package/lib/components/inputDialogPage/index.js.map +0 -1
- package/lib/components/inputDialogPage/src/inputDialogPage.d.ts +0 -132
- package/lib/components/inputDialogPage/src/inputDialogPage.js +0 -2
- package/lib/components/inputDialogPage/src/inputDialogPage.js.map +0 -1
- package/lib/components/layoutGrid/index.d.ts +0 -16
- package/lib/components/layoutGrid/index.js +0 -2
- package/lib/components/layoutGrid/index.js.map +0 -1
- package/lib/components/layoutGrid/src/layoutGrid.d.ts +0 -60
- package/lib/components/layoutGrid/src/layoutGrid.js +0 -2
- package/lib/components/layoutGrid/src/layoutGrid.js.map +0 -1
- package/lib/components/layoutGrid/src/layoutGrid.type.d.ts +0 -12
- package/lib/components/layoutGrid/src/layoutGrid.type.js +0 -0
- package/lib/components/layoutGrid/src/layoutGridItem.d.ts +0 -100
- package/lib/components/layoutGrid/src/layoutGridItem.js +0 -2
- package/lib/components/layoutGrid/src/layoutGridItem.js.map +0 -1
- package/lib/components/select/index.d.ts +0 -22
- package/lib/components/select/index.js +0 -2
- package/lib/components/select/index.js.map +0 -1
- package/lib/components/select/src/select.d.ts +0 -1206
- package/lib/components/select/src/select.js +0 -2
- package/lib/components/select/src/select.js.map +0 -1
- package/lib/components/select/src/select.type.d.ts +0 -28
- package/lib/components/select/src/select.type.js +0 -0
- package/lib/components/select/src/selectOption.d.ts +0 -99
- package/lib/components/select/src/selectOption.js +0 -2
- package/lib/components/select/src/selectOption.js.map +0 -1
- package/lib/components/selectPage/index.d.ts +0 -14
- package/lib/components/selectPage/index.js +0 -2
- package/lib/components/selectPage/index.js.map +0 -1
- package/lib/components/selectPage/src/selectPage.d.ts +0 -609
- package/lib/components/selectPage/src/selectPage.js +0 -2
- package/lib/components/selectPage/src/selectPage.js.map +0 -1
- package/lib/components/selectV2/index.d.ts +0 -14
- package/lib/components/selectV2/index.js +0 -2
- package/lib/components/selectV2/index.js.map +0 -1
- package/lib/components/selectV2/src/selectV2.d.ts +0 -1399
- package/lib/components/selectV2/src/selectV2.js +0 -2
- package/lib/components/selectV2/src/selectV2.js.map +0 -1
- package/lib/components/table/images/artwork.js +0 -2
- package/lib/components/table/images/artwork.js.map +0 -1
- package/lib/components/table/images/index.d.ts +0 -4
- package/lib/components/table/images/notImage.js +0 -2
- package/lib/components/table/images/notImage.js.map +0 -1
- package/lib/components/table/index.d.ts +0 -35
- package/lib/components/table/index.js +0 -2
- package/lib/components/table/index.js.map +0 -1
- package/lib/components/table/src/page.type.d.ts +0 -145
- package/lib/components/table/src/page.type.js +0 -2
- package/lib/components/table/src/page.type.js.map +0 -1
- package/lib/components/table/src/table.d.ts +0 -1439
- package/lib/components/table/src/table.js +0 -2
- package/lib/components/table/src/table.js.map +0 -1
- package/lib/components/table/src/table.state.d.ts +0 -111
- package/lib/components/table/src/table.state.js +0 -0
- package/lib/components/table/src/table.type.d.ts +0 -261
- package/lib/components/table/src/table.type.js +0 -2
- package/lib/components/table/src/table.type.js.map +0 -1
- package/lib/components/table/src/tableColumn.d.ts +0 -658
- package/lib/components/table/src/tableColumn.js +0 -2
- package/lib/components/table/src/tableColumn.js.map +0 -1
- package/lib/components/table/src/tableColumnSettingDialog.d.ts +0 -18
- package/lib/components/table/src/tableColumnSettingDialog.js +0 -2
- package/lib/components/table/src/tableColumnSettingDialog.js.map +0 -1
- package/lib/components/table/src/tablePagination.d.ts +0 -24
- package/lib/components/table/src/tablePagination.js +0 -2
- package/lib/components/table/src/tablePagination.js.map +0 -1
- package/lib/components/table/src/tableSearchForm.d.ts +0 -88
- package/lib/components/table/src/tableSearchForm.js +0 -2
- package/lib/components/table/src/tableSearchForm.js.map +0 -1
- package/lib/components/table/src/tableSearchFormItem.d.ts +0 -37
- package/lib/components/table/src/tableSearchFormItem.js +0 -2
- package/lib/components/table/src/tableSearchFormItem.js.map +0 -1
- package/lib/components/table/src/useTable.d.ts +0 -32
- package/lib/components/table/src/useTable.js +0 -2
- package/lib/components/table/src/useTable.js.map +0 -1
- package/lib/components/table/utils/table.d.ts +0 -45
- package/lib/components/table/utils/table.js +0 -2
- package/lib/components/table/utils/table.js.map +0 -1
- package/lib/components/tree/index.d.ts +0 -15
- package/lib/components/tree/index.js +0 -2
- package/lib/components/tree/index.js.map +0 -1
- package/lib/components/tree/src/tree.d.ts +0 -562
- package/lib/components/tree/src/tree.js +0 -2
- package/lib/components/tree/src/tree.js.map +0 -1
- package/lib/components/tree/src/tree.props.d.ts +0 -81
- package/lib/components/tree/src/tree.props.js +0 -2
- package/lib/components/tree/src/tree.props.js.map +0 -1
- package/lib/components/tree/src/tree.type.d.ts +0 -36
- package/lib/components/tree/src/tree.type.js +0 -0
- package/lib/components/treeSelect/index.d.ts +0 -14
- package/lib/components/treeSelect/index.js +0 -2
- package/lib/components/treeSelect/index.js.map +0 -1
- package/lib/components/treeSelect/src/treeSelect.d.ts +0 -965
- package/lib/components/treeSelect/src/treeSelect.js +0 -2
- package/lib/components/treeSelect/src/treeSelect.js.map +0 -1
- package/lib/components/upload/index.d.ts +0 -15
- package/lib/components/upload/index.js +0 -2
- package/lib/components/upload/index.js.map +0 -1
- package/lib/components/upload/src/upload.d.ts +0 -529
- package/lib/components/upload/src/upload.js +0 -2
- package/lib/components/upload/src/upload.js.map +0 -1
- package/lib/components/upload/src/useUpload.d.ts +0 -65
- package/lib/components/upload/src/useUpload.js +0 -2
- package/lib/components/upload/src/useUpload.js.map +0 -1
- package/lib/components/upload/utils/upload.d.ts +0 -30
- package/lib/components/upload/utils/upload.js +0 -2
- package/lib/components/upload/utils/upload.js.map +0 -1
- package/lib/components/uploadImage/index.d.ts +0 -14
- package/lib/components/uploadImage/index.js +0 -2
- package/lib/components/uploadImage/index.js.map +0 -1
- package/lib/components/uploadImage/src/uploadImage.d.ts +0 -579
- package/lib/components/uploadImage/src/uploadImage.js +0 -2
- package/lib/components/uploadImage/src/uploadImage.js.map +0 -1
- package/lib/components/uploadImages/index.d.ts +0 -14
- package/lib/components/uploadImages/index.js +0 -2
- package/lib/components/uploadImages/index.js.map +0 -1
- package/lib/components/uploadImages/src/uploadImages.d.ts +0 -548
- package/lib/components/uploadImages/src/uploadImages.js +0 -2
- package/lib/components/uploadImages/src/uploadImages.js.map +0 -1
- package/lib/constants/index.d.ts +0 -2
- package/lib/constants/index.js +0 -1
- package/lib/constants/mime.d.ts +0 -61
- package/lib/constants/mime.js +0 -2
- package/lib/constants/mime.js.map +0 -1
- package/lib/constants/regex.d.ts +0 -78
- package/lib/constants/regex.js +0 -2
- package/lib/constants/regex.js.map +0 -1
- package/lib/directive.d.ts +0 -2
- package/lib/directive.js +0 -2
- package/lib/directive.js.map +0 -1
- package/lib/directives/click-copy/index.d.ts +0 -2
- package/lib/directives/click-copy/index.js +0 -2
- package/lib/directives/click-copy/index.js.map +0 -1
- package/lib/directives/click-debounce/index.d.ts +0 -2
- package/lib/directives/click-debounce/index.js +0 -2
- package/lib/directives/click-debounce/index.js.map +0 -1
- package/lib/directives/click-draggable/index.d.ts +0 -2
- package/lib/directives/click-draggable/index.js +0 -2
- package/lib/directives/click-draggable/index.js.map +0 -1
- package/lib/directives/click-icon-copy/index.d.ts +0 -2
- package/lib/directives/click-icon-copy/index.js +0 -2
- package/lib/directives/click-icon-copy/index.js.map +0 -1
- package/lib/directives/click-longpress/index.d.ts +0 -2
- package/lib/directives/click-longpress/index.js +0 -2
- package/lib/directives/click-longpress/index.js.map +0 -1
- package/lib/directives/click-throttle/index.d.ts +0 -2
- package/lib/directives/click-throttle/index.js +0 -2
- package/lib/directives/click-throttle/index.js.map +0 -1
- package/lib/directives/index.d.ts +0 -6
- package/lib/directives/index.js +0 -1
- package/lib/element-plus.d.ts +0 -2
- package/lib/element-plus.js +0 -2
- package/lib/element-plus.js.map +0 -1
- package/lib/hooks/index.d.ts +0 -3
- package/lib/hooks/index.js +0 -1
- package/lib/hooks/use-loading/index.d.ts +0 -4
- package/lib/hooks/use-loading/index.js +0 -2
- package/lib/hooks/use-loading/index.js.map +0 -1
- package/lib/hooks/use-overlay/index.d.ts +0 -4
- package/lib/hooks/use-overlay/index.js +0 -2
- package/lib/hooks/use-overlay/index.js.map +0 -1
- package/lib/hooks/use-screenFull/index.d.ts +0 -7
- package/lib/hooks/use-screenFull/index.js +0 -2
- package/lib/hooks/use-screenFull/index.js.map +0 -1
- package/lib/index.d.ts +0 -14
- package/lib/index.es.d.ts +0 -6
- package/lib/index.js +0 -2
- package/lib/index.js.map +0 -1
- package/lib/make-installer.d.ts +0 -6
- package/lib/make-installer.js +0 -2
- package/lib/make-installer.js.map +0 -1
- package/lib/version.d.ts +0 -1
- package/lib/version.js +0 -2
- package/lib/version.js.map +0 -1
- package/styles/common/animation.scss +0 -46
- package/styles/common/common.scss +0 -44
- package/styles/common/loading.scss +0 -29
- package/styles/common/overlay.scss +0 -12
- package/styles/components/carNumber.scss +0 -44
- package/styles/components/contextMenu.scss +0 -34
- package/styles/components/dialog.scss +0 -88
- package/styles/components/drawer.scss +0 -87
- package/styles/components/form.scss +0 -44
- package/styles/components/formItemTip.scss +0 -7
- package/styles/components/image.scss +0 -19
- package/styles/components/select.scss +0 -35
- package/styles/components/selectPage.scss +0 -44
- package/styles/components/selectV2.scss +0 -22
- package/styles/components/table.scss +0 -440
- package/styles/components/tree.scss +0 -115
- package/styles/components/uploadImage.scss +0 -61
- package/styles/components/uploadImages.scss +0 -9
- package/styles/index.scss +0 -19
- package/types/components.d.ts +0 -145
- package/types/env.d.ts +0 -17
- /package/{es/components/contextMenu/src/contextMenu.type.mjs → dist/global.mjs} +0 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { useExpose } from "../../../utils/vue/expose.mjs";
|
|
2
|
+
import { definePropType, useProps } from "../../../utils/vue/props.mjs";
|
|
3
|
+
import { useRender } from "../../../utils/vue/render.mjs";
|
|
4
|
+
import { makeSlots } from "../../../utils/vue/slots.mjs";
|
|
5
|
+
import { useUpload } from "./useUpload.mjs";
|
|
6
|
+
import { Fragment, computed, createTextVNode, createVNode, defineComponent, mergeProps, ref, resolveDirective, withDirectives } from "vue";
|
|
7
|
+
import { UploadFilled } from "@element-plus/icons-vue";
|
|
8
|
+
import { ElIcon, ElUpload, uploadProps } from "element-plus";
|
|
9
|
+
import { isArray, isNull, isString } from "lodash-unified";
|
|
10
|
+
//#region src/components/upload/src/upload.tsx
|
|
11
|
+
/** FaUpload 的运行时 Props 定义。 */
|
|
12
|
+
const faUploadProps = {
|
|
13
|
+
...uploadProps,
|
|
14
|
+
/** @description whether to activate drag and drop mode */
|
|
15
|
+
drag: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: true
|
|
18
|
+
},
|
|
19
|
+
/** @description maximum number of uploads allowed */
|
|
20
|
+
limit: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 1
|
|
23
|
+
},
|
|
24
|
+
/** @description v-model绑定值 */
|
|
25
|
+
modelValue: definePropType([String, Array]),
|
|
26
|
+
/** @description 大小限制,单位kb */
|
|
27
|
+
maxSize: {
|
|
28
|
+
type: definePropType([String, Number]),
|
|
29
|
+
default: 5120
|
|
30
|
+
},
|
|
31
|
+
/** @description 图片上传接口,优先级最高 */
|
|
32
|
+
uploadApi: { type: definePropType(Function) },
|
|
33
|
+
/** @description 图片上传地址 */
|
|
34
|
+
uploadUrl: String
|
|
35
|
+
};
|
|
36
|
+
/** FaUpload 的运行时 Emits 定义。 */
|
|
37
|
+
const faUploadEmits = {
|
|
38
|
+
/** @description v-model 回调 */
|
|
39
|
+
"update:modelValue": (value) => isString(value) || isArray(value) || isNull(value),
|
|
40
|
+
/** @description v-model:fileList 回调 */
|
|
41
|
+
"update:fileList": (value) => isArray(value),
|
|
42
|
+
/** @description 改变 */
|
|
43
|
+
change: (value) => isString(value) || isArray(value) || isNull(value)
|
|
44
|
+
};
|
|
45
|
+
var upload_default = defineComponent({
|
|
46
|
+
name: "FaUpload",
|
|
47
|
+
props: faUploadProps,
|
|
48
|
+
emits: faUploadEmits,
|
|
49
|
+
slots: makeSlots(),
|
|
50
|
+
setup(props, { slots, emit, expose }) {
|
|
51
|
+
const { fileList, loading, formContext, maxSizeMB, handleHttpRequest, handleOnSuccess, handleOnError, handleOnRemove, handleOnExceed, handleOnUpload } = useUpload("FaUpload", "文件", props, emit, {
|
|
52
|
+
get maxSize() {
|
|
53
|
+
return props.maxSize;
|
|
54
|
+
},
|
|
55
|
+
get uploadApi() {
|
|
56
|
+
return props.uploadApi;
|
|
57
|
+
},
|
|
58
|
+
get uploadUrl() {
|
|
59
|
+
return props.uploadUrl || (props.action === uploadProps.action.default ? void 0 : props.action);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const disabled = computed(() => {
|
|
63
|
+
return props.disabled === true || formContext?.disabled === true;
|
|
64
|
+
});
|
|
65
|
+
const uploadRef = ref();
|
|
66
|
+
const httpRequest = computed(() => props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest);
|
|
67
|
+
const handleOnChange = (uploadFile, uploadFiles) => {
|
|
68
|
+
if (uploadFile.status !== "ready") return;
|
|
69
|
+
if (!handleOnUpload(uploadFile)) fileList.value = fileList.value.filter((item) => item.uid !== uploadFile.uid);
|
|
70
|
+
else props.onChange?.(uploadFile, uploadFiles);
|
|
71
|
+
};
|
|
72
|
+
const handleBeforeUpload = (rawFile) => {
|
|
73
|
+
if (!fileList.value.some((item) => item.uid === rawFile.uid) || !handleOnUpload(rawFile)) return false;
|
|
74
|
+
return props.beforeUpload?.(rawFile) ?? true;
|
|
75
|
+
};
|
|
76
|
+
const elUploadProps = useProps(props, uploadProps, [
|
|
77
|
+
"fileList",
|
|
78
|
+
"disabled",
|
|
79
|
+
"httpRequest",
|
|
80
|
+
"beforeUpload",
|
|
81
|
+
"onExceed",
|
|
82
|
+
"onSuccess",
|
|
83
|
+
"onError",
|
|
84
|
+
"onRemove",
|
|
85
|
+
"onChange"
|
|
86
|
+
]);
|
|
87
|
+
useRender(() => withDirectives(createVNode(ElUpload, mergeProps(elUploadProps.value, {
|
|
88
|
+
"ref": uploadRef,
|
|
89
|
+
"class": ["fa-upload", { "fa-upload__default": !slots.default }],
|
|
90
|
+
"fileList": fileList.value,
|
|
91
|
+
"onUpdate:fileList": ($event) => fileList.value = $event,
|
|
92
|
+
"disabled": disabled.value,
|
|
93
|
+
"httpRequest": httpRequest.value,
|
|
94
|
+
"beforeUpload": handleBeforeUpload,
|
|
95
|
+
"onExceed": handleOnExceed,
|
|
96
|
+
"onSuccess": handleOnSuccess,
|
|
97
|
+
"onError": handleOnError,
|
|
98
|
+
"onRemove": handleOnRemove,
|
|
99
|
+
"onChange": handleOnChange
|
|
100
|
+
}), {
|
|
101
|
+
default: () => slots.default ? slots.default() : createVNode(Fragment, null, [createVNode(ElIcon, { "class": "el-icon--upload" }, { default: () => [createVNode(UploadFilled, null, null)] }), createVNode("div", { "class": "el-upload__text" }, [createTextVNode("Drop file here or "), createVNode("em", null, [createTextVNode("click to upload")])])]),
|
|
102
|
+
...slots.trigger && { trigger: () => slots.trigger?.() ?? [] },
|
|
103
|
+
tip: () => slots.tip ? slots.tip() : createVNode(Fragment, null, [createVNode("div", { "class": "el-upload__tip" }, [
|
|
104
|
+
createTextVNode("files with a size less than "),
|
|
105
|
+
maxSizeMB.value.toString(),
|
|
106
|
+
createTextVNode("MB")
|
|
107
|
+
]), !props.showFileList && fileList.value.length > 0 && createVNode("div", { "class": "el-upload__tip" }, [fileList.value.map((item, index) => createVNode(Fragment, null, [item.name, fileList.value.length <= index && createVNode("br", null, null)]))])]),
|
|
108
|
+
...slots.file && { file: ({ file, index }) => slots.file?.({
|
|
109
|
+
file,
|
|
110
|
+
index
|
|
111
|
+
}) ?? [] }
|
|
112
|
+
}), [[resolveDirective("loading"), loading.value]]));
|
|
113
|
+
return useExpose(expose, {
|
|
114
|
+
/** @description 取消上传请求 */
|
|
115
|
+
abort: computed(() => uploadRef.value?.abort),
|
|
116
|
+
/** @description 手动上传文件列表 */
|
|
117
|
+
submit: computed(() => uploadRef.value?.submit),
|
|
118
|
+
/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */
|
|
119
|
+
clearFiles: computed(() => uploadRef.value?.clearFiles),
|
|
120
|
+
/** @description 手动选择文件 */
|
|
121
|
+
handleStart: computed(() => uploadRef.value?.handleStart),
|
|
122
|
+
/** @description 手动移除文件。file 和 rawFile 已被合并。 */
|
|
123
|
+
handleRemove: computed(() => uploadRef.value?.handleRemove),
|
|
124
|
+
/** @description 加载状态 */
|
|
125
|
+
loading,
|
|
126
|
+
/** @description 文件集合 */
|
|
127
|
+
fileList
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
//#endregion
|
|
132
|
+
export { upload_default as default, faUploadEmits, faUploadProps };
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=upload.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.mjs","names":["update:modelValue","update:fileList"],"sources":["../../../../src/components/upload/src/upload.tsx"],"sourcesContent":["import { Fragment, computed, defineComponent, ref } from \"vue\";\nimport { UploadFilled } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElUpload, uploadProps } from \"element-plus\";\nimport { isArray, isNull, isString } from \"lodash-unified\";\nimport { definePropType, makeSlots, useExpose, useProps, useRender } from \"../../../utils\";\nimport { useUpload } from \"./useUpload\";\nimport type { UploadFile, UploadInstance, UploadProps, UploadUserFile } from \"element-plus\";\nimport type { VNode } from \"vue\";\n\n/** FaUpload 的运行时 Props 定义。 */\nexport const faUploadProps = {\n\t...uploadProps,\n\t/** @description whether to activate drag and drop mode */\n\tdrag: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description maximum number of uploads allowed */\n\tlimit: {\n\t\ttype: Number,\n\t\tdefault: 1,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 大小限制,单位kb */\n\tmaxSize: {\n\t\ttype: definePropType<string | number>([String, Number]),\n\t\tdefault: 5120,\n\t},\n\t/** @description 图片上传接口,优先级最高 */\n\tuploadApi: {\n\t\ttype: definePropType<(formData: FormData) => Promise<string>>(Function),\n\t},\n\t/** @description 图片上传地址 */\n\tuploadUrl: String,\n};\n\n/** FaUpload 的运行时 Emits 定义。 */\nexport const faUploadEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description v-model:fileList 回调 */\n\t\"update:fileList\": (value: UploadUserFile[]): boolean => isArray(value),\n\t/** @description 改变 */\n\tchange: (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n};\n\n/** FaUpload 的插槽参数。 */\nexport interface FaUploadSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n\t/** @description 触发文件选择框的内容 */\n\ttrigger: never;\n\t/** @description 提示说明文字 */\n\ttip: never;\n\t/** @description 缩略图模板的内容 */\n\tfile: { file: UploadFile; index: number };\n}\n\nexport default defineComponent({\n\tname: \"FaUpload\",\n\tprops: faUploadProps,\n\temits: faUploadEmits,\n\tslots: makeSlots<FaUploadSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst {\n\t\t\tfileList,\n\t\t\tloading,\n\t\t\tformContext,\n\t\t\tmaxSizeMB,\n\t\t\thandleHttpRequest,\n\t\t\thandleOnSuccess,\n\t\t\thandleOnError,\n\t\t\thandleOnRemove,\n\t\t\thandleOnExceed,\n\t\t\thandleOnUpload,\n\t\t} = useUpload(\"FaUpload\", \"文件\", props, emit, {\n\t\t\tget maxSize() {\n\t\t\t\treturn props.maxSize;\n\t\t\t},\n\t\t\tget uploadApi() {\n\t\t\t\treturn props.uploadApi;\n\t\t\t},\n\t\t\tget uploadUrl() {\n\t\t\t\treturn props.uploadUrl || (props.action === uploadProps.action.default ? undefined : props.action);\n\t\t\t},\n\t\t});\n\n\t\tconst disabled = computed(() => {\n\t\t\treturn props.disabled === true || formContext?.disabled === true;\n\t\t});\n\n\t\tconst uploadRef = ref<UploadInstance>();\n\t\tconst httpRequest = computed(() => (props.httpRequest === uploadProps.httpRequest.default ? handleHttpRequest : props.httpRequest));\n\n\t\tconst handleOnChange: UploadProps[\"onChange\"] = (uploadFile, uploadFiles) => {\n\t\t\tif (uploadFile.status !== \"ready\") return;\n\n\t\t\tif (!handleOnUpload(uploadFile)) {\n\t\t\t\tfileList.value = fileList.value.filter((item) => item.uid !== uploadFile.uid);\n\t\t\t} else {\n\t\t\t\tprops.onChange?.(uploadFile, uploadFiles);\n\t\t\t}\n\t\t};\n\n\t\tconst handleBeforeUpload: UploadProps[\"beforeUpload\"] = (rawFile) => {\n\t\t\t// onChange 已完成首次校验;被移除的非法文件不能在自动上传流程中继续提交。\n\t\t\tif (!fileList.value.some((item) => item.uid === rawFile.uid) || !handleOnUpload(rawFile)) return false;\n\t\t\treturn props.beforeUpload?.(rawFile) ?? true;\n\t\t};\n\n\t\tconst elUploadProps = useProps(props, uploadProps, [\n\t\t\t\"fileList\",\n\t\t\t\"disabled\",\n\t\t\t\"httpRequest\",\n\t\t\t\"beforeUpload\",\n\t\t\t\"onExceed\",\n\t\t\t\"onSuccess\",\n\t\t\t\"onError\",\n\t\t\t\"onRemove\",\n\t\t\t\"onChange\",\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<ElUpload\n\t\t\t\t{...elUploadProps.value}\n\t\t\t\tref={uploadRef}\n\t\t\t\tclass={[\"fa-upload\", { \"fa-upload__default\": !slots.default }]}\n\t\t\t\tvLoading={loading.value}\n\t\t\t\tvModel:fileList={fileList.value}\n\t\t\t\tdisabled={disabled.value}\n\t\t\t\thttpRequest={httpRequest.value}\n\t\t\t\tbeforeUpload={handleBeforeUpload}\n\t\t\t\tonExceed={handleOnExceed}\n\t\t\t\tonSuccess={handleOnSuccess}\n\t\t\t\tonError={handleOnError}\n\t\t\t\tonRemove={handleOnRemove}\n\t\t\t\tonChange={handleOnChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: () =>\n\t\t\t\t\t\tslots.default ? (\n\t\t\t\t\t\t\tslots.default()\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<ElIcon class=\"el-icon--upload\">\n\t\t\t\t\t\t\t\t\t<UploadFilled />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t<div class=\"el-upload__text\">\n\t\t\t\t\t\t\t\t\tDrop file here or <em>click to upload</em>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t),\n\t\t\t\t\t...(slots.trigger && { trigger: (): VNode | VNode[] => slots.trigger?.() ?? [] }),\n\t\t\t\t\ttip: () =>\n\t\t\t\t\t\tslots.tip ? (\n\t\t\t\t\t\t\tslots.tip()\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<div class=\"el-upload__tip\">files with a size less than {maxSizeMB.value.toString()}MB</div>\n\t\t\t\t\t\t\t\t{!props.showFileList && fileList.value.length > 0 && (\n\t\t\t\t\t\t\t\t\t<div class=\"el-upload__tip\">\n\t\t\t\t\t\t\t\t\t\t{fileList.value.map((item, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t{item.name}\n\t\t\t\t\t\t\t\t\t\t\t\t{fileList.value.length <= index && <br />}\n\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t),\n\t\t\t\t\t...(slots.file && {\n\t\t\t\t\t\tfile: ({ file, index }: { file: UploadFile; index: number }): VNode | VNode[] => slots.file?.({ file, index }) ?? [],\n\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElUpload>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 取消上传请求 */\n\t\t\tabort: computed(() => uploadRef.value?.abort),\n\t\t\t/** @description 手动上传文件列表 */\n\t\t\tsubmit: computed(() => uploadRef.value?.submit),\n\t\t\t/** @description 清空已上传的文件列表(该方法不支持在 before-upload 中调用) */\n\t\t\tclearFiles: computed(() => uploadRef.value?.clearFiles),\n\t\t\t/** @description 手动选择文件 */\n\t\t\thandleStart: computed(() => uploadRef.value?.handleStart),\n\t\t\t/** @description 手动移除文件。file 和 rawFile 已被合并。 */\n\t\t\thandleRemove: computed(() => uploadRef.value?.handleRemove),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading,\n\t\t\t/** @description 文件集合 */\n\t\t\tfileList,\n\t\t});\n\t},\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Decimal } from "decimal.js";
|
|
2
|
+
import type { FormContext, FormItemContext, UploadFile, UploadFiles, UploadProps, UploadRawFile, UploadRequestOptions, UploadUserFile } from "element-plus";
|
|
3
|
+
import type { ComputedRef, Ref, WritableComputedRef } from "vue";
|
|
4
|
+
interface UploadComposable {
|
|
5
|
+
fileList: WritableComputedRef<UploadUserFile[]>;
|
|
6
|
+
loading: Ref<boolean>;
|
|
7
|
+
formContext: FormContext | undefined;
|
|
8
|
+
formItemContext: FormItemContext | undefined;
|
|
9
|
+
maxSizeMB: ComputedRef<Decimal>;
|
|
10
|
+
handleValue: () => void;
|
|
11
|
+
handleHttpRequest: (options: UploadRequestOptions) => Promise<void>;
|
|
12
|
+
handleOnSuccess: (fileUrl: string, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
|
|
13
|
+
handleOnError: (error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
|
|
14
|
+
handleOnRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void;
|
|
15
|
+
handleOnExceed: (files: File[], uploadFiles: UploadUserFile[]) => void;
|
|
16
|
+
handleOnUpload: (file: UploadFile | UploadRawFile) => boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 创建上传组件共享的文件状态和操作方法。
|
|
20
|
+
*
|
|
21
|
+
* @param componentName - 组件名称。
|
|
22
|
+
* @param fileTypeName - 文件类型名称。
|
|
23
|
+
* @param props - 上传组件的 Props。
|
|
24
|
+
* @param emit - 上传组件的事件触发器。
|
|
25
|
+
* @param options - 文件大小和类型校验配置。
|
|
26
|
+
* @returns 文件列表、加载状态和上传操作方法。
|
|
27
|
+
*/
|
|
28
|
+
export declare const useUpload: <T extends string | string[]>(componentName: string, fileTypeName: string, props: Partial<UploadProps> & {
|
|
29
|
+
modelValue?: T | null;
|
|
30
|
+
}, emit: ((event: "update:fileList", value: UploadUserFile[]) => void) & ((event: "update:modelValue", value: T | null) => void) & ((event: "change", value: T | null) => void), data?: {
|
|
31
|
+
maxSize?: string | number;
|
|
32
|
+
uploadApi?: (formData: FormData) => Promise<string>;
|
|
33
|
+
uploadUrl?: string;
|
|
34
|
+
}) => UploadComposable;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { uploadUtil } from "../utils/upload.mjs";
|
|
2
|
+
import { computed, inject, onMounted, ref, watch } from "vue";
|
|
3
|
+
import { ElMessage, ElNotification, formContextKey, formItemContextKey, genFileId, uploadProps } from "element-plus";
|
|
4
|
+
import { isArray, isNumber, isString } from "lodash-unified";
|
|
5
|
+
import { useVModel } from "@vueuse/core";
|
|
6
|
+
import { Decimal } from "decimal.js";
|
|
7
|
+
//#region src/components/upload/src/useUpload.ts
|
|
8
|
+
/**
|
|
9
|
+
* 创建上传组件共享的文件状态和操作方法。
|
|
10
|
+
*
|
|
11
|
+
* @param componentName - 组件名称。
|
|
12
|
+
* @param fileTypeName - 文件类型名称。
|
|
13
|
+
* @param props - 上传组件的 Props。
|
|
14
|
+
* @param emit - 上传组件的事件触发器。
|
|
15
|
+
* @param options - 文件大小和类型校验配置。
|
|
16
|
+
* @returns 文件列表、加载状态和上传操作方法。
|
|
17
|
+
*/
|
|
18
|
+
const useUpload = (componentName, fileTypeName, props, emit, data) => {
|
|
19
|
+
const fileListModel = useVModel(props, "fileList", emit, { passive: true });
|
|
20
|
+
const fileList = computed({
|
|
21
|
+
get: () => fileListModel.value ?? [],
|
|
22
|
+
set: (value) => {
|
|
23
|
+
fileListModel.value = value;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const loading = ref(false);
|
|
27
|
+
let activeUploadCount = 0;
|
|
28
|
+
const formContext = inject(formContextKey, void 0);
|
|
29
|
+
const formItemContext = inject(formItemContextKey, void 0);
|
|
30
|
+
const mbNum = new Decimal(1024);
|
|
31
|
+
const maxSizeKB = computed(() => new Decimal(isNumber(data?.maxSize) ? data.maxSize : Number(data?.maxSize)));
|
|
32
|
+
const maxSizeMB = computed(() => maxSizeKB.value.div(mbNum));
|
|
33
|
+
onMounted(() => {
|
|
34
|
+
if (!props.disabled && props.autoUpload && !data?.uploadApi && !data?.uploadUrl && props.httpRequest === uploadProps.httpRequest.default) console.warn(`[Fast:${componentName}]`, "uploadApi 和 uploadUrl 至少需要提供一个。");
|
|
35
|
+
});
|
|
36
|
+
const handleValue = (files = fileList.value) => {
|
|
37
|
+
if (files.length > 0) {
|
|
38
|
+
if (isString(props.modelValue)) {
|
|
39
|
+
const fileUrl = files[0]?.url;
|
|
40
|
+
if (!fileUrl) return;
|
|
41
|
+
emit("update:modelValue", fileUrl);
|
|
42
|
+
emit("change", fileUrl);
|
|
43
|
+
} else if (props.multiple) {
|
|
44
|
+
const value = files.flatMap((item) => item.url ? [item.url] : []);
|
|
45
|
+
emit("update:modelValue", value);
|
|
46
|
+
emit("change", value);
|
|
47
|
+
} else {
|
|
48
|
+
const fileUrl = files[0]?.url;
|
|
49
|
+
if (!fileUrl) return;
|
|
50
|
+
emit("update:modelValue", fileUrl);
|
|
51
|
+
emit("change", fileUrl);
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
emit("update:modelValue", null);
|
|
55
|
+
emit("change", null);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const handleHttpRequest = async (options) => {
|
|
59
|
+
const propsData = options.data;
|
|
60
|
+
if (!data?.uploadApi && !data?.uploadUrl) {
|
|
61
|
+
const error = /* @__PURE__ */ new Error(`上传${fileTypeName}接口 uploadApi 或地址 uploadUrl 不能为空。`);
|
|
62
|
+
ElMessage.error(`上传${fileTypeName}Api或地址不能为空`);
|
|
63
|
+
console.error(`[Fast:${componentName}]`, error.message);
|
|
64
|
+
return Promise.reject(error);
|
|
65
|
+
}
|
|
66
|
+
activeUploadCount++;
|
|
67
|
+
loading.value = true;
|
|
68
|
+
try {
|
|
69
|
+
let fileUrl;
|
|
70
|
+
if (data?.uploadApi) fileUrl = await uploadUtil.uploadFileByApi(data.uploadApi, options.file, options.filename, propsData);
|
|
71
|
+
else {
|
|
72
|
+
const headers = options.headers instanceof Headers ? options.headers : new Headers(Object.entries(options.headers).flatMap(([key, value]) => value === null || value === void 0 ? [] : [[key, String(value)]]));
|
|
73
|
+
fileUrl = await uploadUtil.uploadFile(data?.uploadUrl ?? options.action, options.file, options.filename, propsData, {
|
|
74
|
+
headers,
|
|
75
|
+
method: options.method,
|
|
76
|
+
withCredentials: options.withCredentials
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
options.onSuccess(fileUrl);
|
|
80
|
+
} finally {
|
|
81
|
+
activeUploadCount = Math.max(activeUploadCount - 1, 0);
|
|
82
|
+
loading.value = activeUploadCount > 0;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const handleOnSuccess = (fileUrl, uploadFile, uploadFiles) => {
|
|
86
|
+
if (!fileUrl) return;
|
|
87
|
+
if (!props.multiple && uploadFiles.length > 1) uploadFiles.shift();
|
|
88
|
+
uploadFile.url = fileUrl;
|
|
89
|
+
handleValue();
|
|
90
|
+
if (formItemContext?.prop) formContext?.validateField([formItemContext.prop]);
|
|
91
|
+
ElMessage.success("上传成功");
|
|
92
|
+
props.onSuccess?.(fileUrl, uploadFile, uploadFiles);
|
|
93
|
+
};
|
|
94
|
+
const handleOnError = (error, uploadFile, uploadFiles) => {
|
|
95
|
+
ElNotification({
|
|
96
|
+
message: `【${uploadFile.name}】${fileTypeName}上传失败,请您重新上传`,
|
|
97
|
+
type: "error"
|
|
98
|
+
});
|
|
99
|
+
props.onError?.(error, uploadFile, uploadFiles);
|
|
100
|
+
};
|
|
101
|
+
const handleOnRemove = (uploadFile, uploadFiles) => {
|
|
102
|
+
fileList.value = uploadFiles;
|
|
103
|
+
handleValue(uploadFiles);
|
|
104
|
+
props.onRemove?.(uploadFile, uploadFiles);
|
|
105
|
+
};
|
|
106
|
+
const handleOnExceed = (files, uploadFiles) => {
|
|
107
|
+
ElMessage.warning(`最多只能上传 ${props.limit} 个${fileTypeName},请移除后再进行上传`);
|
|
108
|
+
props.onExceed?.(files, uploadFiles);
|
|
109
|
+
};
|
|
110
|
+
const handleOnUpload = (file) => {
|
|
111
|
+
if (new Decimal(file.size ?? 0).div(mbNum).greaterThan(maxSizeKB.value)) {
|
|
112
|
+
console.warn(`[Fast:${componentName}]`, `【${file.name}】${fileTypeName}上传大小不能超过 ${maxSizeMB.value.toString()}MB。`);
|
|
113
|
+
ElMessage.warning(`【${file.name}】${fileTypeName}上传大小不能超过 ${maxSizeMB.value.toString()}MB`);
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
const rawFile = "type" in file ? file : file.raw;
|
|
117
|
+
if (!rawFile) return false;
|
|
118
|
+
if (!uploadUtil.matchesAccept(rawFile, props.accept)) {
|
|
119
|
+
const uploadFileNames = uploadUtil.detectFileType(props.accept ?? "");
|
|
120
|
+
console.warn(`[Fast:${componentName}]`, `只允许上传【${uploadFileNames}】格式的${fileTypeName}。`);
|
|
121
|
+
ElMessage.warning(`只允许上传【${uploadFileNames}】格式的${fileTypeName}`);
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* 监听 v-model 绑定数据
|
|
128
|
+
*/
|
|
129
|
+
watch(() => props.modelValue, (newValue) => {
|
|
130
|
+
if (newValue) {
|
|
131
|
+
if (isArray(newValue)) fileList.value = newValue.map((m) => {
|
|
132
|
+
return {
|
|
133
|
+
name: "",
|
|
134
|
+
status: "success",
|
|
135
|
+
uid: fileList.value.find((f) => f.url === m)?.uid ?? genFileId(),
|
|
136
|
+
url: m
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
else {
|
|
140
|
+
const find = fileList.value.find((f) => f.url === newValue);
|
|
141
|
+
fileList.value = [{
|
|
142
|
+
name: "",
|
|
143
|
+
status: "success",
|
|
144
|
+
uid: find?.uid ?? genFileId(),
|
|
145
|
+
url: newValue
|
|
146
|
+
}];
|
|
147
|
+
}
|
|
148
|
+
} else fileList.value = [];
|
|
149
|
+
}, { immediate: true });
|
|
150
|
+
return {
|
|
151
|
+
fileList,
|
|
152
|
+
loading,
|
|
153
|
+
formContext,
|
|
154
|
+
formItemContext,
|
|
155
|
+
maxSizeMB,
|
|
156
|
+
handleValue,
|
|
157
|
+
handleHttpRequest,
|
|
158
|
+
handleOnSuccess,
|
|
159
|
+
handleOnError,
|
|
160
|
+
handleOnRemove,
|
|
161
|
+
handleOnExceed,
|
|
162
|
+
handleOnUpload
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
//#endregion
|
|
166
|
+
export { useUpload };
|
|
167
|
+
|
|
168
|
+
//# sourceMappingURL=useUpload.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUpload.mjs","names":[],"sources":["../../../../src/components/upload/src/useUpload.ts"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, inject, onMounted, ref, watch } from \"vue\";\nimport { ElMessage, ElNotification, formContextKey, formItemContextKey, genFileId, uploadProps } from \"element-plus\";\nimport { isArray, isNumber, isString } from \"lodash-unified\";\nimport { Decimal } from \"decimal.js\";\nimport { uploadUtil } from \"../utils/upload\";\nimport type {\n\tFormContext,\n\tFormItemContext,\n\tUploadFile,\n\tUploadFiles,\n\tUploadProps,\n\tUploadRawFile,\n\tUploadRequestOptions,\n\tUploadUserFile,\n} from \"element-plus\";\nimport type { ComputedRef, Ref, WritableComputedRef } from \"vue\";\n\ninterface UploadComposable {\n\tfileList: WritableComputedRef<UploadUserFile[]>;\n\tloading: Ref<boolean>;\n\tformContext: FormContext | undefined;\n\tformItemContext: FormItemContext | undefined;\n\tmaxSizeMB: ComputedRef<Decimal>;\n\thandleValue: () => void;\n\thandleHttpRequest: (options: UploadRequestOptions) => Promise<void>;\n\thandleOnSuccess: (fileUrl: string, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;\n\thandleOnError: (error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles) => void;\n\thandleOnRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void;\n\thandleOnExceed: (files: File[], uploadFiles: UploadUserFile[]) => void;\n\thandleOnUpload: (file: UploadFile | UploadRawFile) => boolean;\n}\n\n/**\n * 创建上传组件共享的文件状态和操作方法。\n *\n * @param componentName - 组件名称。\n * @param fileTypeName - 文件类型名称。\n * @param props - 上传组件的 Props。\n * @param emit - 上传组件的事件触发器。\n * @param options - 文件大小和类型校验配置。\n * @returns 文件列表、加载状态和上传操作方法。\n */\nexport const useUpload = <T extends string | string[]>(\n\tcomponentName: string,\n\tfileTypeName: string,\n\tprops: Partial<UploadProps> & {\n\t\tmodelValue?: T | null;\n\t},\n\temit: ((event: \"update:fileList\", value: UploadUserFile[]) => void) &\n\t\t((event: \"update:modelValue\", value: T | null) => void) &\n\t\t((event: \"change\", value: T | null) => void),\n\tdata?: {\n\t\tmaxSize?: string | number;\n\t\tuploadApi?: (formData: FormData) => Promise<string>;\n\t\tuploadUrl?: string;\n\t}\n): UploadComposable => {\n\tconst fileListModel = useVModel(props, \"fileList\", emit, { passive: true });\n\tconst fileList = computed<UploadUserFile[]>({\n\t\tget: () => fileListModel.value ?? [],\n\t\tset: (value) => {\n\t\t\tfileListModel.value = value;\n\t\t},\n\t});\n\n\tconst loading = ref(false);\n\tlet activeUploadCount = 0;\n\n\t// 获取 el-form 组件上下文\n\tconst formContext = inject(formContextKey, undefined);\n\t// 获取 el-form-item 组件上下文\n\tconst formItemContext = inject(formItemContextKey, undefined);\n\n\tconst mbNum = new Decimal(1024);\n\tconst maxSizeKB = computed(() => new Decimal(isNumber(data?.maxSize) ? data.maxSize : Number(data?.maxSize)));\n\tconst maxSizeMB = computed(() => maxSizeKB.value.div(mbNum));\n\n\tonMounted(() => {\n\t\tif (!props.disabled && props.autoUpload && !data?.uploadApi && !data?.uploadUrl && props.httpRequest === uploadProps.httpRequest.default) {\n\t\t\tconsole.warn(`[Fast:${componentName}]`, \"uploadApi 和 uploadUrl 至少需要提供一个。\");\n\t\t}\n\t});\n\n\tconst handleValue = (files: UploadUserFile[] = fileList.value): void => {\n\t\tif (files.length > 0) {\n\t\t\tif (isString(props.modelValue)) {\n\t\t\t\tconst fileUrl = files[0]?.url;\n\t\t\t\tif (!fileUrl) return;\n\t\t\t\temit(\"update:modelValue\", fileUrl as T);\n\t\t\t\temit(\"change\", fileUrl as T);\n\t\t\t} else {\n\t\t\t\tif (props.multiple) {\n\t\t\t\t\tconst value = files.flatMap((item) => (item.url ? [item.url] : []));\n\t\t\t\t\temit(\"update:modelValue\", value as T);\n\t\t\t\t\temit(\"change\", value as T);\n\t\t\t\t} else {\n\t\t\t\t\tconst fileUrl = files[0]?.url;\n\t\t\t\t\tif (!fileUrl) return;\n\t\t\t\t\temit(\"update:modelValue\", fileUrl as T);\n\t\t\t\t\temit(\"change\", fileUrl as T);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"change\", null);\n\t\t}\n\t};\n\n\tconst handleHttpRequest = async (options: UploadRequestOptions): Promise<void> => {\n\t\tconst propsData = options.data;\n\t\tif (!data?.uploadApi && !data?.uploadUrl) {\n\t\t\tconst error = new Error(`上传${fileTypeName}接口 uploadApi 或地址 uploadUrl 不能为空。`);\n\t\t\tElMessage.error(`上传${fileTypeName}Api或地址不能为空`);\n\t\t\tconsole.error(`[Fast:${componentName}]`, error.message);\n\t\t\treturn Promise.reject(error);\n\t\t}\n\t\tactiveUploadCount++;\n\t\tloading.value = true;\n\t\ttry {\n\t\t\tlet fileUrl: string;\n\t\t\tif (data?.uploadApi) {\n\t\t\t\tfileUrl = await uploadUtil.uploadFileByApi(data.uploadApi, options.file, options.filename, propsData);\n\t\t\t} else {\n\t\t\t\tconst headers =\n\t\t\t\t\toptions.headers instanceof Headers\n\t\t\t\t\t\t? options.headers\n\t\t\t\t\t\t: new Headers(\n\t\t\t\t\t\t\t\tObject.entries(options.headers).flatMap(([key, value]) =>\n\t\t\t\t\t\t\t\t\tvalue === null || value === undefined ? [] : [[key, String(value)] as [string, string]]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\tfileUrl = await uploadUtil.uploadFile(data?.uploadUrl ?? options.action, options.file, options.filename, propsData, {\n\t\t\t\t\theaders,\n\t\t\t\t\tmethod: options.method,\n\t\t\t\t\twithCredentials: options.withCredentials,\n\t\t\t\t});\n\t\t\t}\n\t\t\toptions.onSuccess(fileUrl);\n\t\t} finally {\n\t\t\tactiveUploadCount = Math.max(activeUploadCount - 1, 0);\n\t\t\tloading.value = activeUploadCount > 0;\n\t\t}\n\t};\n\n\tconst handleOnSuccess = (fileUrl: string, uploadFile: UploadFile, uploadFiles: UploadFiles): void => {\n\t\tif (!fileUrl) return;\n\t\tif (!props.multiple && uploadFiles.length > 1) {\n\t\t\tuploadFiles.shift();\n\t\t}\n\t\tuploadFile.url = fileUrl;\n\t\thandleValue();\n\t\t// 调用 el-form 内部的校验方法(可自动校验)\n\t\tif (formItemContext?.prop) void formContext?.validateField([formItemContext.prop]);\n\t\tElMessage.success(\"上传成功\");\n\t\tprops.onSuccess?.(fileUrl, uploadFile, uploadFiles);\n\t};\n\n\tconst handleOnError = (error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles): void => {\n\t\tElNotification({\n\t\t\tmessage: `【${uploadFile.name}】${fileTypeName}上传失败,请您重新上传`,\n\t\t\ttype: \"error\",\n\t\t});\n\t\tprops.onError?.(error, uploadFile, uploadFiles);\n\t};\n\n\tconst handleOnRemove = (uploadFile: UploadFile, uploadFiles: UploadFiles): void => {\n\t\tfileList.value = uploadFiles;\n\t\thandleValue(uploadFiles);\n\t\tprops.onRemove?.(uploadFile, uploadFiles);\n\t};\n\n\tconst handleOnExceed = (files: File[], uploadFiles: UploadUserFile[]): void => {\n\t\tElMessage.warning(`最多只能上传 ${props.limit} 个${fileTypeName},请移除后再进行上传`);\n\t\tprops.onExceed?.(files, uploadFiles);\n\t};\n\n\tconst handleOnUpload = (file: UploadFile | UploadRawFile): boolean => {\n\t\tconst fileSizeKB = new Decimal(file.size ?? 0).div(mbNum);\n\n\t\tif (fileSizeKB.greaterThan(maxSizeKB.value)) {\n\t\t\tconsole.warn(`[Fast:${componentName}]`, `【${file.name}】${fileTypeName}上传大小不能超过 ${maxSizeMB.value.toString()}MB。`);\n\t\t\tElMessage.warning(`【${file.name}】${fileTypeName}上传大小不能超过 ${maxSizeMB.value.toString()}MB`);\n\t\t\treturn false;\n\t\t}\n\n\t\tconst rawFile = \"type\" in file ? file : file.raw;\n\t\tif (!rawFile) return false;\n\t\tif (!uploadUtil.matchesAccept(rawFile, props.accept)) {\n\t\t\tconst uploadFileNames = uploadUtil.detectFileType(props.accept ?? \"\");\n\t\t\tconsole.warn(`[Fast:${componentName}]`, `只允许上传【${uploadFileNames}】格式的${fileTypeName}。`);\n\t\t\tElMessage.warning(`只允许上传【${uploadFileNames}】格式的${fileTypeName}`);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t};\n\n\t/**\n\t * 监听 v-model 绑定数据\n\t */\n\twatch(\n\t\t() => props.modelValue,\n\t\t(newValue) => {\n\t\t\tif (newValue) {\n\t\t\t\tif (isArray(newValue)) {\n\t\t\t\t\tfileList.value = newValue.map((m) => {\n\t\t\t\t\t\tconst find = fileList.value.find((f) => f.url === m);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tname: \"\",\n\t\t\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\t\t\tuid: find?.uid ?? genFileId(),\n\t\t\t\t\t\t\turl: m,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst find = fileList.value.find((f) => f.url === newValue);\n\t\t\t\t\tfileList.value = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: \"\",\n\t\t\t\t\t\t\tstatus: \"success\",\n\t\t\t\t\t\t\tuid: find?.uid ?? genFileId(),\n\t\t\t\t\t\t\turl: newValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfileList.value = [];\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\timmediate: true,\n\t\t}\n\t);\n\n\treturn {\n\t\tfileList,\n\t\tloading,\n\t\tformContext,\n\t\tformItemContext,\n\t\tmaxSizeMB,\n\t\thandleValue,\n\t\thandleHttpRequest,\n\t\thandleOnSuccess,\n\t\thandleOnError,\n\t\thandleOnRemove,\n\t\thandleOnExceed,\n\t\thandleOnUpload,\n\t};\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type UploadData = Record<string, string | Blob | [string | Blob, string] | string[]>;
|
|
2
|
+
interface UploadRequestConfig {
|
|
3
|
+
method?: string;
|
|
4
|
+
headers?: HeadersInit;
|
|
5
|
+
withCredentials?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 上传工具类
|
|
9
|
+
*/
|
|
10
|
+
export declare const uploadUtil: {
|
|
11
|
+
/**
|
|
12
|
+
* 识别文件类型
|
|
13
|
+
*/
|
|
14
|
+
detectFileType(accept: string): string;
|
|
15
|
+
/** 判断文件是否符合 HTML accept 规则。 */
|
|
16
|
+
matchesAccept(file: File, accept?: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 文件上传
|
|
19
|
+
* @param url 地址
|
|
20
|
+
* @param file 文件
|
|
21
|
+
* @param fileName 文件名称
|
|
22
|
+
* @param params 参数
|
|
23
|
+
*/
|
|
24
|
+
uploadFile(url: string, file: File, fileName: string, params?: UploadData, request?: UploadRequestConfig): Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* 文件上传
|
|
27
|
+
* @param url 地址
|
|
28
|
+
* @param file 文件
|
|
29
|
+
* @param fileName 文件名称
|
|
30
|
+
* @param params 参数
|
|
31
|
+
*/
|
|
32
|
+
uploadFileByApi(api: (formData: FormData) => Promise<string>, file: File, fileName: string, params?: UploadData): Promise<string>;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { FaMimeType } from "../../../constants/mime.mjs";
|
|
2
|
+
import { ElMessage } from "element-plus";
|
|
3
|
+
//#region src/components/upload/utils/upload.ts
|
|
4
|
+
/** 将 Element Plus 上传附加数据写入 FormData。 */
|
|
5
|
+
const appendUploadData = (formData, params) => {
|
|
6
|
+
for (const [key, value] of Object.entries(params)) if (Array.isArray(value)) {
|
|
7
|
+
if (value.length === 2 && value[0] instanceof Blob && typeof value[1] === "string") formData.append(key, value[0], value[1]);
|
|
8
|
+
else value.forEach((item) => formData.append(key, item));
|
|
9
|
+
} else formData.append(key, value);
|
|
10
|
+
};
|
|
11
|
+
const FaMimeTypeNames = {};
|
|
12
|
+
for (const [kName, vAccept] of Object.entries(FaMimeType)) vAccept.split(",").forEach((tItem) => {
|
|
13
|
+
FaMimeTypeNames[tItem.trim()] = kName;
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* 上传工具类
|
|
17
|
+
*/
|
|
18
|
+
const uploadUtil = {
|
|
19
|
+
/**
|
|
20
|
+
* 识别文件类型
|
|
21
|
+
*/
|
|
22
|
+
detectFileType(accept) {
|
|
23
|
+
const detectTypes = /* @__PURE__ */ new Set();
|
|
24
|
+
accept.split(",").forEach((mimeType) => {
|
|
25
|
+
const normalizedMimeType = mimeType.trim();
|
|
26
|
+
if (normalizedMimeType) detectTypes.add(FaMimeTypeNames[normalizedMimeType] ?? normalizedMimeType);
|
|
27
|
+
});
|
|
28
|
+
return Array.from(detectTypes).join(",");
|
|
29
|
+
},
|
|
30
|
+
/** 判断文件是否符合 HTML accept 规则。 */
|
|
31
|
+
matchesAccept(file, accept) {
|
|
32
|
+
if (!accept?.trim()) return true;
|
|
33
|
+
const fileName = file.name.toLowerCase();
|
|
34
|
+
const fileType = file.type.toLowerCase();
|
|
35
|
+
return accept.split(",").some((item) => {
|
|
36
|
+
const rule = item.trim().toLowerCase();
|
|
37
|
+
if (!rule) return false;
|
|
38
|
+
if (rule.startsWith(".")) return fileName.endsWith(rule);
|
|
39
|
+
if (rule.endsWith("/*")) return fileType.startsWith(rule.slice(0, -1));
|
|
40
|
+
return fileType === rule;
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* 文件上传
|
|
45
|
+
* @param url 地址
|
|
46
|
+
* @param file 文件
|
|
47
|
+
* @param fileName 文件名称
|
|
48
|
+
* @param params 参数
|
|
49
|
+
*/
|
|
50
|
+
async uploadFile(url, file, fileName, params, request) {
|
|
51
|
+
if (!url) {
|
|
52
|
+
console.error("[Fast:uploadUtil]", "文件上传地址为空。");
|
|
53
|
+
ElMessage.error("文件上传地址为空!");
|
|
54
|
+
return Promise.reject(/* @__PURE__ */ new Error("文件上传地址为空!"));
|
|
55
|
+
}
|
|
56
|
+
const formData = new FormData();
|
|
57
|
+
formData.append("file", file);
|
|
58
|
+
formData.append("fileName", fileName);
|
|
59
|
+
if (params) appendUploadData(formData, params);
|
|
60
|
+
try {
|
|
61
|
+
const response = await fetch(url, {
|
|
62
|
+
headers: request?.headers,
|
|
63
|
+
method: request?.method ?? "POST",
|
|
64
|
+
credentials: request?.withCredentials ? "include" : "same-origin",
|
|
65
|
+
body: formData
|
|
66
|
+
});
|
|
67
|
+
if (!response.ok) {
|
|
68
|
+
console.error("[Fast:uploadUtil]", `文件上传失败,HTTP 状态码:${response.status.toString()}。`);
|
|
69
|
+
ElMessage.error("文件上传失败!");
|
|
70
|
+
throw new Error("文件上传失败!");
|
|
71
|
+
}
|
|
72
|
+
return await response.text();
|
|
73
|
+
} catch (error) {
|
|
74
|
+
console.error("[Fast:uploadUtil]", "文件上传失败。", error);
|
|
75
|
+
ElMessage.error("文件上传失败!");
|
|
76
|
+
throw error instanceof Error ? error : /* @__PURE__ */ new Error("文件上传失败!");
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* 文件上传
|
|
81
|
+
* @param url 地址
|
|
82
|
+
* @param file 文件
|
|
83
|
+
* @param fileName 文件名称
|
|
84
|
+
* @param params 参数
|
|
85
|
+
*/
|
|
86
|
+
async uploadFileByApi(api, file, fileName, params) {
|
|
87
|
+
if (!api) {
|
|
88
|
+
console.error("[Fast:uploadUtil]", "文件上传接口为空。");
|
|
89
|
+
ElMessage.error("文件上传接口为空!");
|
|
90
|
+
throw new Error("文件上传接口为空!");
|
|
91
|
+
}
|
|
92
|
+
const formData = new FormData();
|
|
93
|
+
formData.append("file", file);
|
|
94
|
+
formData.append("fileName", fileName);
|
|
95
|
+
if (params) appendUploadData(formData, params);
|
|
96
|
+
try {
|
|
97
|
+
return await api(formData);
|
|
98
|
+
} catch (error) {
|
|
99
|
+
console.error("[Fast:uploadUtil]", "文件上传失败。", error);
|
|
100
|
+
ElMessage.error("文件上传失败!");
|
|
101
|
+
throw error instanceof Error ? error : /* @__PURE__ */ new Error("文件上传失败!");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
//#endregion
|
|
106
|
+
export { uploadUtil };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=upload.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.mjs","names":[],"sources":["../../../../src/components/upload/utils/upload.ts"],"sourcesContent":["import { ElMessage } from \"element-plus\";\nimport { FaMimeType } from \"../../../constants\";\ntype UploadData = Record<string, string | Blob | [string | Blob, string] | string[]>;\n\ninterface UploadRequestConfig {\n\tmethod?: string;\n\theaders?: HeadersInit;\n\twithCredentials?: boolean;\n}\n\n/** 将 Element Plus 上传附加数据写入 FormData。 */\nconst appendUploadData = (formData: FormData, params: UploadData): void => {\n\tfor (const [key, value] of Object.entries(params)) {\n\t\tif (Array.isArray(value)) {\n\t\t\tif (value.length === 2 && value[0] instanceof Blob && typeof value[1] === \"string\") {\n\t\t\t\tformData.append(key, value[0], value[1]);\n\t\t\t} else {\n\t\t\t\tvalue.forEach((item) => formData.append(key, item));\n\t\t\t}\n\t\t} else {\n\t\t\tformData.append(key, value);\n\t\t}\n\t}\n};\n\nconst FaMimeTypeNames: Record<string, keyof typeof FaMimeType> = {};\n\nfor (const [kName, vAccept] of Object.entries(FaMimeType)) {\n\tvAccept.split(\",\").forEach((tItem) => {\n\t\tFaMimeTypeNames[tItem.trim()] = kName as keyof typeof FaMimeType;\n\t});\n}\n\n/**\n * 上传工具类\n */\nexport const uploadUtil = {\n\t/**\n\t * 识别文件类型\n\t */\n\tdetectFileType(accept: string): string {\n\t\tconst detectTypes = new Set<string>();\n\t\taccept.split(\",\").forEach((mimeType) => {\n\t\t\tconst normalizedMimeType = mimeType.trim();\n\t\t\tif (normalizedMimeType) detectTypes.add(FaMimeTypeNames[normalizedMimeType] ?? normalizedMimeType);\n\t\t});\n\t\treturn Array.from(detectTypes).join(\",\");\n\t},\n\t/** 判断文件是否符合 HTML accept 规则。 */\n\tmatchesAccept(file: File, accept?: string): boolean {\n\t\tif (!accept?.trim()) return true;\n\t\tconst fileName = file.name.toLowerCase();\n\t\tconst fileType = file.type.toLowerCase();\n\t\treturn accept.split(\",\").some((item) => {\n\t\t\tconst rule = item.trim().toLowerCase();\n\t\t\tif (!rule) return false;\n\t\t\tif (rule.startsWith(\".\")) return fileName.endsWith(rule);\n\t\t\tif (rule.endsWith(\"/*\")) return fileType.startsWith(rule.slice(0, -1));\n\t\t\treturn fileType === rule;\n\t\t});\n\t},\n\t/**\n\t * 文件上传\n\t * @param url 地址\n\t * @param file 文件\n\t * @param fileName 文件名称\n\t * @param params 参数\n\t */\n\tasync uploadFile(url: string, file: File, fileName: string, params?: UploadData, request?: UploadRequestConfig): Promise<string> {\n\t\tif (!url) {\n\t\t\tconsole.error(\"[Fast:uploadUtil]\", \"文件上传地址为空。\");\n\t\t\tElMessage.error(\"文件上传地址为空!\");\n\t\t\treturn Promise.reject(new Error(\"文件上传地址为空!\"));\n\t\t}\n\t\tconst formData = new FormData();\n\t\tformData.append(\"file\", file);\n\t\tformData.append(\"fileName\", fileName);\n\t\tif (params) appendUploadData(formData, params);\n\t\ttry {\n\t\t\tconst response = await fetch(url, {\n\t\t\t\theaders: request?.headers,\n\t\t\t\tmethod: request?.method ?? \"POST\",\n\t\t\t\tcredentials: request?.withCredentials ? \"include\" : \"same-origin\",\n\t\t\t\tbody: formData,\n\t\t\t});\n\t\t\tif (!response.ok) {\n\t\t\t\tconsole.error(\"[Fast:uploadUtil]\", `文件上传失败,HTTP 状态码:${response.status.toString()}。`);\n\t\t\t\tElMessage.error(\"文件上传失败!\");\n\t\t\t\tthrow new Error(\"文件上传失败!\");\n\t\t\t}\n\t\t\treturn await response.text();\n\t\t} catch (error) {\n\t\t\tconsole.error(\"[Fast:uploadUtil]\", \"文件上传失败。\", error);\n\t\t\tElMessage.error(\"文件上传失败!\");\n\t\t\tthrow error instanceof Error ? error : new Error(\"文件上传失败!\");\n\t\t}\n\t},\n\t/**\n\t * 文件上传\n\t * @param url 地址\n\t * @param file 文件\n\t * @param fileName 文件名称\n\t * @param params 参数\n\t */\n\tasync uploadFileByApi(api: (formData: FormData) => Promise<string>, file: File, fileName: string, params?: UploadData): Promise<string> {\n\t\tif (!api) {\n\t\t\tconsole.error(\"[Fast:uploadUtil]\", \"文件上传接口为空。\");\n\t\t\tElMessage.error(\"文件上传接口为空!\");\n\t\t\tthrow new Error(\"文件上传接口为空!\");\n\t\t}\n\t\tconst formData = new FormData();\n\t\tformData.append(\"file\", file);\n\t\tformData.append(\"fileName\", fileName);\n\t\tif (params) appendUploadData(formData, params);\n\t\ttry {\n\t\t\treturn await api(formData);\n\t\t} catch (error) {\n\t\t\tconsole.error(\"[Fast:uploadUtil]\", \"文件上传失败。\", error);\n\t\t\tElMessage.error(\"文件上传失败!\");\n\t\t\tthrow error instanceof Error ? error : new Error(\"文件上传失败!\");\n\t\t}\n\t},\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import UploadImage, { faUploadImageEmits, faUploadImageProps } from "./src/uploadImage";
|
|
2
|
+
import type { TSXWithInstall } from "../../utils";
|
|
3
|
+
import type { ExtractPropTypes } from "vue";
|
|
4
|
+
/** 支持预览、校验和状态同步的单图片上传组件。 */
|
|
5
|
+
export declare const FaUploadImage: TSXWithInstall<typeof UploadImage>;
|
|
6
|
+
export default FaUploadImage;
|
|
7
|
+
export { faUploadImageProps, faUploadImageEmits };
|
|
8
|
+
export type { FaUploadImageSlots } from "./src/uploadImage";
|
|
9
|
+
/** FaUploadImage 暴露的组件实例类型。 */
|
|
10
|
+
export type FaUploadImageInstance = InstanceType<typeof UploadImage>;
|
|
11
|
+
/** FaUploadImage 的完整 Props 类型。 */
|
|
12
|
+
export type FaUploadImageProps = ExtractPropTypes<typeof faUploadImageProps>;
|
|
13
|
+
/** FaUploadImage 的 Emits 类型。 */
|
|
14
|
+
export type FaUploadImageEmits = typeof faUploadImageEmits;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { withInstall } from "../../utils/vue/install.mjs";
|
|
2
|
+
import uploadImage_default, { faUploadImageEmits, faUploadImageProps } from "./src/uploadImage.mjs";
|
|
3
|
+
//#region src/components/uploadImage/index.ts
|
|
4
|
+
/** 支持预览、校验和状态同步的单图片上传组件。 */
|
|
5
|
+
const FaUploadImage = withInstall(uploadImage_default);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FaUploadImage, FaUploadImage as default, faUploadImageEmits, faUploadImageProps };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["UploadImage"],"sources":["../../../src/components/uploadImage/index.ts"],"sourcesContent":["import { withInstall } from \"../../utils\";\nimport UploadImage, { faUploadImageEmits, faUploadImageProps } from \"./src/uploadImage\";\nimport type { TSXWithInstall } from \"../../utils\";\nimport type { ExtractPropTypes } from \"vue\";\n\n/** 支持预览、校验和状态同步的单图片上传组件。 */\nexport const FaUploadImage: TSXWithInstall<typeof UploadImage> = withInstall(UploadImage);\nexport default FaUploadImage;\n\nexport { faUploadImageProps, faUploadImageEmits };\nexport type { FaUploadImageSlots } from \"./src/uploadImage\";\n\n/** FaUploadImage 暴露的组件实例类型。 */\nexport type FaUploadImageInstance = InstanceType<typeof UploadImage>;\n\n/** FaUploadImage 的完整 Props 类型。 */\nexport type FaUploadImageProps = ExtractPropTypes<typeof faUploadImageProps>;\n\n/** FaUploadImage 的 Emits 类型。 */\nexport type FaUploadImageEmits = typeof faUploadImageEmits;\n"],"mappings":";;;;AAMA,MAAa,gBAAoD,YAAYA,mBAAW"}
|