@polyv/vue-components 1.6.0 → 1.7.0
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/package.json +2 -2
- package/styles/root/basic.scss +14 -7
- package/styles/root/border.scss +6 -0
- package/styles/skin-color.scss +37 -11
- package/styles/variables.scss +15 -1
- package/vue2/index.es.js +16155 -21494
- package/vue2/src/components/alert/index.d.ts +2 -0
- package/vue2/src/components/alert/src/alert.vue.d.ts +2 -0
- package/vue2/src/components/alert/src/props-define.d.ts +8 -0
- package/vue2/src/components/business/channel-cover/index.d.ts +38 -0
- package/vue2/src/components/business/channel-cover/src/channel-cover.vue.d.ts +38 -0
- package/vue2/src/components/business/channel-cover/src/cover-list.d.ts +7 -0
- package/vue2/src/components/business/channel-cover/src/props-define.d.ts +47 -0
- package/vue2/src/components/business/data-export/data-export-record/use-data-export-record.d.ts +8 -4
- package/vue2/src/components/business/external-links/external-links.vue.d.ts +1 -2
- package/vue2/src/components/business/external-links/use-external-links.d.ts +111 -3
- package/vue2/src/components/business/reward-receive/hooks/use-reward-receive.d.ts +22 -0
- package/vue2/src/components/collapse-transition/index.d.ts +36 -0
- package/vue2/src/components/collapse-transition/src/collapse-transition.vue.d.ts +27 -0
- package/vue2/src/components/collapse-transition/src/props-define.d.ts +9 -0
- package/vue2/src/components/example/example.vue.d.ts +16 -1
- package/vue2/src/components/example/index.d.ts +75 -4
- package/vue2/src/components/exports.d.ts +22 -1
- package/vue2/src/components/form/file-upload/index.d.ts +467 -0
- package/vue2/src/components/form/file-upload/src/file-upload.vue.d.ts +185 -0
- package/vue2/src/components/form/file-upload/src/hooks/props-define.d.ts +296 -0
- package/vue2/src/components/form/file-upload/src/hooks/types.d.ts +52 -0
- package/vue2/src/components/form/file-upload/src/hooks/use-file-input.d.ts +7 -0
- package/vue2/src/components/form/file-upload/src/hooks/use-file-upload-slots.d.ts +10 -0
- package/vue2/src/components/form/file-upload/src/hooks/use-file-upload.d.ts +113 -0
- package/vue2/src/components/form/file-upload/src/hooks/use-upload-controller.d.ts +7 -0
- package/vue2/src/components/form/file-upload/src/upload-add/button-add.vue.d.ts +4 -0
- package/vue2/src/components/form/file-upload/src/upload-add/drag-add.vue.d.ts +5 -0
- package/vue2/src/components/form/file-upload/src/upload-add/picture-card-add.vue.d.ts +4 -0
- package/vue2/src/components/form/file-upload/src/upload-item/file-upload-item.vue.d.ts +23 -0
- package/vue2/src/components/form/file-upload/src/upload-item/picture-card-item.vue.d.ts +14 -0
- package/vue2/src/components/form/file-upload/src/upload-item/text-item.vue.d.ts +16 -0
- package/vue2/src/components/form/file-upload/src/upload-item/use-upload-item.d.ts +10 -0
- package/vue2/src/components/form/form-item/index.d.ts +2 -2
- package/vue2/src/components/form/form-item/src/form-item.vue.d.ts +1 -1
- package/vue2/src/components/form/form-submit-button/index.d.ts +1 -1
- package/vue2/src/components/form/form-submit-button/src/form-submit-button.vue.d.ts +1 -1
- package/vue2/src/components/form/form-wrap/index.d.ts +8 -2
- package/vue2/src/components/form/form-wrap/src/form-wrap.vue.d.ts +3 -1
- package/vue2/src/components/form/form-wrap/src/use-form-wrap.d.ts +4 -0
- package/vue2/src/components/form/hooks/use-form-entrance.d.ts +3 -3
- package/vue2/src/components/form/input-number/index.d.ts +2 -2
- package/vue2/src/components/form/input-number/src/input-number.vue.d.ts +1 -1
- package/vue2/src/components/form/select/index.d.ts +40 -40
- package/vue2/src/components/form/timezone-picker/index.d.ts +70 -70
- package/vue2/src/components/form/timezone-picker/src/hooks/props-define.d.ts +18 -18
- package/vue2/src/components/form/timezone-picker/src/timezone-picker.vue.d.ts +42 -42
- package/vue2/src/components/form/transfer/hooks/props-define.d.ts +0 -1
- package/vue2/src/components/form/transfer/transfer.vue.d.ts +0 -1
- package/vue2/src/components/icons/icons/effect/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/file/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/id-card/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/id-card-filled/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/lang/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/link/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/menu-expand/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/menu-fold-up/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/platform/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/platform-filled/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/statistics-filled/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/upload-three/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/user/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/user-filled/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/video/index.d.ts +6 -0
- package/vue2/src/components/icons/icons/video-filled/index.d.ts +6 -0
- package/vue2/src/components/icons/map.d.ts +16 -0
- package/vue2/src/components/info-card/index.d.ts +181 -2
- package/{vue3/src/components/info-card → vue2/src/components/info-card/src}/info-card.vue.d.ts +11 -1
- package/vue2/src/components/info-card/{props-define.d.ts → src/props-define.d.ts} +18 -1
- package/vue2/src/components/menu/index.d.ts +156 -0
- package/vue2/src/components/menu/src/hooks/use-menu-item.d.ts +29 -0
- package/vue2/src/components/menu/src/hooks/use-menu.d.ts +14 -0
- package/vue2/src/components/menu/src/hooks/use-sub-menu.d.ts +23 -0
- package/vue2/src/components/menu/src/menu-divider.vue.d.ts +2 -0
- package/vue2/src/components/menu/src/menu-item-content.vue.d.ts +2 -0
- package/vue2/src/components/menu/src/menu-item.vue.d.ts +14 -0
- package/vue2/src/components/menu/src/menu.vue.d.ts +52 -0
- package/vue2/src/components/menu/src/props-define.d.ts +114 -0
- package/vue2/src/components/menu/src/sub-menu-popper.vue.d.ts +19 -0
- package/vue2/src/components/menu/src/sub-menu.vue.d.ts +32 -0
- package/vue2/src/components/message-box/_component/message-box-element.vue.d.ts +1 -1
- package/vue2/src/components/message-box/_component/use-message-box-element.d.ts +13 -9
- package/vue2/src/components/pagination/use-pagination.d.ts +3 -3
- package/vue2/src/components/popconfirm/index.d.ts +20 -0
- package/vue2/src/components/popconfirm/src/popconfirm.vue.d.ts +20 -0
- package/vue2/src/components/popconfirm/src/props-define.d.ts +3 -0
- package/vue2/src/components/popover/index.d.ts +20 -0
- package/vue2/src/components/popover/src/popover.vue.d.ts +7 -0
- package/vue2/src/components/popover/src/props-define.d.ts +3 -0
- package/vue2/src/components/popup/index.d.ts +13 -6
- package/vue2/src/components/popup/src/hooks/popup-props.d.ts +6 -4
- package/vue2/src/components/popup/src/hooks/use-popup-provide.d.ts +9 -0
- package/vue2/src/components/popup/src/popup.vue.d.ts +4 -2
- package/vue2/src/components/popup/src/types.d.ts +3 -0
- package/vue2/src/components/slider/index.d.ts +8 -1
- package/vue2/src/components/slider/src/props-define.d.ts +7 -0
- package/vue2/src/components/slider/src/slider.vue.d.ts +8 -1
- package/vue2/src/components/table/index.d.ts +84 -12
- package/vue2/src/components/table/src/components/table-body-cell/body-cell-expand.vue.d.ts +2 -0
- package/vue2/src/components/table/src/components/table-body-row/table-body-row-expand.vue.d.ts +33 -0
- package/vue2/src/components/table/src/components/table-body-row/table-body-row.vue.d.ts +11 -0
- package/vue2/src/components/table/src/components/table-body-row/use-table-body-row.d.ts +8 -0
- package/vue2/src/components/table/src/hooks/props-define.d.ts +58 -2
- package/vue2/src/components/table/src/hooks/use-table/use-column-computed.d.ts +14 -2
- package/vue2/src/components/table/src/hooks/use-table/use-column-list.d.ts +28 -4
- package/vue2/src/components/table/src/hooks/use-table/use-table-footer.d.ts +7 -0
- package/vue2/src/components/table/src/hooks/use-table/use-table-render-data.d.ts +2 -0
- package/vue2/src/components/table/src/hooks/use-table/use-table.d.ts +44 -7
- package/vue2/src/components/table/src/hooks/use-table-column/use-column-children.d.ts +14 -2
- package/vue2/src/components/table/src/hooks/use-table-column/use-column-expand.d.ts +19 -0
- package/vue2/src/components/table/src/hooks/use-table-column/use-table-column.d.ts +2 -1
- package/vue2/src/components/table/src/table-column.vue.d.ts +13 -4
- package/vue2/src/components/table/src/table.vue.d.ts +16 -0
- package/vue2/src/components/table/src/types/index.d.ts +1 -1
- package/vue2/src/components/tooltip/index.d.ts +20 -0
- package/vue2/src/components/tooltip/src/props-define.d.ts +7 -0
- package/vue2/src/components/tooltip/src/tooltip.vue.d.ts +7 -0
- package/vue2/src/hooks/business/use-skin-color/utils.d.ts +1 -1
- package/vue2/src/hooks/exports.d.ts +1 -0
- package/vue2/src/hooks/vue/use-render-slots/index.d.ts +5 -3
- package/vue2/src/lang/internal/en.json.d.ts +28 -6
- package/vue2/src/lang/internal/index.d.ts +22 -0
- package/vue2/src/lang/internal/ja.json.d.ts +29 -7
- package/vue2/src/lang/internal/ko.json.d.ts +29 -7
- package/vue2/src/lang/internal/ru.json.d.ts +29 -7
- package/vue2/src/lang/internal/zh-CN.json.d.ts +27 -5
- package/vue2/src/lang/internal/zh-TW.json.d.ts +28 -6
- package/vue2/src/vue-utils/index.d.ts +1 -0
- package/vue3/index.es.js +16162 -21506
- package/vue3/src/components/alert/index.d.ts +2 -0
- package/vue3/src/components/alert/src/alert.vue.d.ts +2 -0
- package/vue3/src/components/alert/src/props-define.d.ts +8 -0
- package/vue3/src/components/business/channel-cover/index.d.ts +38 -0
- package/vue3/src/components/business/channel-cover/src/channel-cover.vue.d.ts +38 -0
- package/vue3/src/components/business/channel-cover/src/cover-list.d.ts +7 -0
- package/vue3/src/components/business/channel-cover/src/props-define.d.ts +47 -0
- package/vue3/src/components/business/data-export/data-export-record/use-data-export-record.d.ts +8 -4
- package/vue3/src/components/business/external-links/external-links.vue.d.ts +1 -2
- package/vue3/src/components/business/external-links/use-external-links.d.ts +111 -3
- package/vue3/src/components/business/reward-receive/hooks/use-reward-receive.d.ts +22 -0
- package/vue3/src/components/collapse-transition/index.d.ts +36 -0
- package/vue3/src/components/collapse-transition/src/collapse-transition.vue.d.ts +27 -0
- package/vue3/src/components/collapse-transition/src/props-define.d.ts +9 -0
- package/vue3/src/components/example/example.vue.d.ts +16 -1
- package/vue3/src/components/example/index.d.ts +75 -4
- package/vue3/src/components/exports.d.ts +22 -1
- package/vue3/src/components/form/file-upload/index.d.ts +467 -0
- package/vue3/src/components/form/file-upload/src/file-upload.vue.d.ts +185 -0
- package/vue3/src/components/form/file-upload/src/hooks/props-define.d.ts +296 -0
- package/vue3/src/components/form/file-upload/src/hooks/types.d.ts +52 -0
- package/vue3/src/components/form/file-upload/src/hooks/use-file-input.d.ts +7 -0
- package/vue3/src/components/form/file-upload/src/hooks/use-file-upload-slots.d.ts +10 -0
- package/vue3/src/components/form/file-upload/src/hooks/use-file-upload.d.ts +113 -0
- package/vue3/src/components/form/file-upload/src/hooks/use-upload-controller.d.ts +7 -0
- package/vue3/src/components/form/file-upload/src/upload-add/button-add.vue.d.ts +4 -0
- package/vue3/src/components/form/file-upload/src/upload-add/drag-add.vue.d.ts +5 -0
- package/vue3/src/components/form/file-upload/src/upload-add/picture-card-add.vue.d.ts +4 -0
- package/vue3/src/components/form/file-upload/src/upload-item/file-upload-item.vue.d.ts +23 -0
- package/vue3/src/components/form/file-upload/src/upload-item/picture-card-item.vue.d.ts +14 -0
- package/vue3/src/components/form/file-upload/src/upload-item/text-item.vue.d.ts +16 -0
- package/vue3/src/components/form/file-upload/src/upload-item/use-upload-item.d.ts +10 -0
- package/vue3/src/components/form/form-item/index.d.ts +2 -2
- package/vue3/src/components/form/form-item/src/form-item.vue.d.ts +1 -1
- package/vue3/src/components/form/form-submit-button/index.d.ts +1 -1
- package/vue3/src/components/form/form-submit-button/src/form-submit-button.vue.d.ts +1 -1
- package/vue3/src/components/form/form-wrap/index.d.ts +8 -2
- package/vue3/src/components/form/form-wrap/src/form-wrap.vue.d.ts +3 -1
- package/vue3/src/components/form/form-wrap/src/use-form-wrap.d.ts +4 -0
- package/vue3/src/components/form/hooks/use-form-entrance.d.ts +3 -3
- package/vue3/src/components/form/input-number/index.d.ts +2 -2
- package/vue3/src/components/form/input-number/src/input-number.vue.d.ts +1 -1
- package/vue3/src/components/form/select/index.d.ts +40 -40
- package/vue3/src/components/form/timezone-picker/index.d.ts +70 -70
- package/vue3/src/components/form/timezone-picker/src/hooks/props-define.d.ts +18 -18
- package/vue3/src/components/form/timezone-picker/src/timezone-picker.vue.d.ts +42 -42
- package/vue3/src/components/form/transfer/hooks/props-define.d.ts +0 -1
- package/vue3/src/components/form/transfer/transfer.vue.d.ts +0 -1
- package/vue3/src/components/icons/icons/effect/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/file/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/id-card/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/id-card-filled/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/lang/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/link/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/menu-expand/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/menu-fold-up/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/platform/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/platform-filled/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/statistics-filled/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/upload-three/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/user/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/user-filled/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/video/index.d.ts +6 -0
- package/vue3/src/components/icons/icons/video-filled/index.d.ts +6 -0
- package/vue3/src/components/icons/map.d.ts +16 -0
- package/vue3/src/components/info-card/index.d.ts +181 -2
- package/{vue2/src/components/info-card → vue3/src/components/info-card/src}/info-card.vue.d.ts +11 -1
- package/vue3/src/components/info-card/{props-define.d.ts → src/props-define.d.ts} +18 -1
- package/vue3/src/components/menu/index.d.ts +156 -0
- package/vue3/src/components/menu/src/hooks/use-menu-item.d.ts +29 -0
- package/vue3/src/components/menu/src/hooks/use-menu.d.ts +14 -0
- package/vue3/src/components/menu/src/hooks/use-sub-menu.d.ts +23 -0
- package/vue3/src/components/menu/src/menu-divider.vue.d.ts +2 -0
- package/vue3/src/components/menu/src/menu-item-content.vue.d.ts +2 -0
- package/vue3/src/components/menu/src/menu-item.vue.d.ts +14 -0
- package/vue3/src/components/menu/src/menu.vue.d.ts +52 -0
- package/vue3/src/components/menu/src/props-define.d.ts +114 -0
- package/vue3/src/components/menu/src/sub-menu-popper.vue.d.ts +19 -0
- package/vue3/src/components/menu/src/sub-menu.vue.d.ts +32 -0
- package/vue3/src/components/message-box/_component/message-box-element.vue.d.ts +1 -1
- package/vue3/src/components/message-box/_component/use-message-box-element.d.ts +13 -9
- package/vue3/src/components/pagination/use-pagination.d.ts +3 -3
- package/vue3/src/components/popconfirm/index.d.ts +20 -0
- package/vue3/src/components/popconfirm/src/popconfirm.vue.d.ts +20 -0
- package/vue3/src/components/popconfirm/src/props-define.d.ts +3 -0
- package/vue3/src/components/popover/index.d.ts +20 -0
- package/vue3/src/components/popover/src/popover.vue.d.ts +7 -0
- package/vue3/src/components/popover/src/props-define.d.ts +3 -0
- package/vue3/src/components/popup/index.d.ts +13 -6
- package/vue3/src/components/popup/src/hooks/popup-props.d.ts +6 -4
- package/vue3/src/components/popup/src/hooks/use-popup-provide.d.ts +9 -0
- package/vue3/src/components/popup/src/popup.vue.d.ts +4 -2
- package/vue3/src/components/popup/src/types.d.ts +3 -0
- package/vue3/src/components/slider/index.d.ts +8 -1
- package/vue3/src/components/slider/src/props-define.d.ts +7 -0
- package/vue3/src/components/slider/src/slider.vue.d.ts +8 -1
- package/vue3/src/components/table/index.d.ts +84 -12
- package/vue3/src/components/table/src/components/table-body-cell/body-cell-expand.vue.d.ts +2 -0
- package/vue3/src/components/table/src/components/table-body-row/table-body-row-expand.vue.d.ts +33 -0
- package/vue3/src/components/table/src/components/table-body-row/table-body-row.vue.d.ts +11 -0
- package/vue3/src/components/table/src/components/table-body-row/use-table-body-row.d.ts +8 -0
- package/vue3/src/components/table/src/hooks/props-define.d.ts +58 -2
- package/vue3/src/components/table/src/hooks/use-table/use-column-computed.d.ts +14 -2
- package/vue3/src/components/table/src/hooks/use-table/use-column-list.d.ts +28 -4
- package/vue3/src/components/table/src/hooks/use-table/use-table-footer.d.ts +7 -0
- package/vue3/src/components/table/src/hooks/use-table/use-table-render-data.d.ts +2 -0
- package/vue3/src/components/table/src/hooks/use-table/use-table.d.ts +44 -7
- package/vue3/src/components/table/src/hooks/use-table-column/use-column-children.d.ts +14 -2
- package/vue3/src/components/table/src/hooks/use-table-column/use-column-expand.d.ts +19 -0
- package/vue3/src/components/table/src/hooks/use-table-column/use-table-column.d.ts +2 -1
- package/vue3/src/components/table/src/table-column.vue.d.ts +13 -4
- package/vue3/src/components/table/src/table.vue.d.ts +16 -0
- package/vue3/src/components/table/src/types/index.d.ts +1 -1
- package/vue3/src/components/tooltip/index.d.ts +20 -0
- package/vue3/src/components/tooltip/src/props-define.d.ts +7 -0
- package/vue3/src/components/tooltip/src/tooltip.vue.d.ts +7 -0
- package/vue3/src/hooks/business/use-skin-color/utils.d.ts +1 -1
- package/vue3/src/hooks/exports.d.ts +1 -0
- package/vue3/src/hooks/vue/use-render-slots/index.d.ts +5 -3
- package/vue3/src/lang/internal/en.json.d.ts +28 -6
- package/vue3/src/lang/internal/index.d.ts +22 -0
- package/vue3/src/lang/internal/ja.json.d.ts +29 -7
- package/vue3/src/lang/internal/ko.json.d.ts +29 -7
- package/vue3/src/lang/internal/ru.json.d.ts +29 -7
- package/vue3/src/lang/internal/zh-CN.json.d.ts +27 -5
- package/vue3/src/lang/internal/zh-TW.json.d.ts +28 -6
- package/vue3/src/vue-utils/index.d.ts +1 -0
- package/vue2/src/components/form/index.d.ts +0 -18
- package/vue3/src/components/form/index.d.ts +0 -18
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
'placeholder-suffix'?(_: {}): any;
|
|
5
|
+
'file-item'?(_: {
|
|
6
|
+
url: string | undefined;
|
|
7
|
+
fileName: string | undefined;
|
|
8
|
+
width: string | undefined;
|
|
9
|
+
height: string | undefined;
|
|
10
|
+
status: import('./hooks/types').FileUploadStatus;
|
|
11
|
+
uploadProgress: number | undefined;
|
|
12
|
+
deleteItem: () => void;
|
|
13
|
+
replaceItem: () => void;
|
|
14
|
+
}): any;
|
|
15
|
+
};
|
|
16
|
+
refs: {
|
|
17
|
+
inputRef: HTMLInputElement;
|
|
18
|
+
listRef: HTMLDivElement;
|
|
19
|
+
};
|
|
20
|
+
rootEl: HTMLDivElement;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
|
+
declare const __VLS_component: import('vue').DefineComponent<{
|
|
24
|
+
"v-model-key": import('vue-types').VueTypeDef<string | string[]> & {
|
|
25
|
+
default: string | (() => string[]);
|
|
26
|
+
};
|
|
27
|
+
method: import('vue-types').VueTypeDef<"button" | "drag" | "card">;
|
|
28
|
+
listType: import('vue-types').VueTypeDef<"text" | "picture-card"> & {
|
|
29
|
+
default: "text" | "picture-card";
|
|
30
|
+
};
|
|
31
|
+
disabled: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
data: import('vue-types').VueTypeValidableDef<{
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}, import('vue-types/dist/types').ValidatorFunction<{
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}>> & {
|
|
39
|
+
default: () => {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
fileExtension: import('vue-types').VueTypeValidableDef<string[], import('vue-types/dist/types').ValidatorFunction<string[]>> & {
|
|
44
|
+
default: () => string[];
|
|
45
|
+
};
|
|
46
|
+
acceptType: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
47
|
+
multiple: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
draggable: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
sizeLimit: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
54
|
+
countLimit: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
55
|
+
controller: import('vue-types').VueTypeValidableDef<import('./hooks/props-define').FileUploadController, import('vue-types/dist/types').ValidatorFunction<import('./hooks/props-define').FileUploadController>>;
|
|
56
|
+
width: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
|
|
57
|
+
default: number;
|
|
58
|
+
};
|
|
59
|
+
height: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
|
|
60
|
+
default: number;
|
|
61
|
+
};
|
|
62
|
+
uploadTitle: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
63
|
+
uploadPlaceholder: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
64
|
+
defaultUploadPlaceholder: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
67
|
+
showDelete: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
68
|
+
default: boolean;
|
|
69
|
+
};
|
|
70
|
+
cropper: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
cropperTitle: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
74
|
+
cropperProps: import('vue-types').VueTypeValidableDef<Partial<import('vue').ExtractPropTypes<{
|
|
75
|
+
target: import('vue-types').VueTypeDef<string | Object | File>;
|
|
76
|
+
within: import('vue-types').VueTypeDef<"canvas" | "image" | "none"> & {
|
|
77
|
+
default: "canvas" | "image" | "none";
|
|
78
|
+
};
|
|
79
|
+
aspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
80
|
+
initialAspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
81
|
+
}>>, import('vue-types/dist/types').ValidatorFunction<Partial<import('vue').ExtractPropTypes<{
|
|
82
|
+
target: import('vue-types').VueTypeDef<string | Object | File>;
|
|
83
|
+
within: import('vue-types').VueTypeDef<"canvas" | "image" | "none"> & {
|
|
84
|
+
default: "canvas" | "image" | "none";
|
|
85
|
+
};
|
|
86
|
+
aspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
87
|
+
initialAspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
88
|
+
}>>>>;
|
|
89
|
+
}, {
|
|
90
|
+
triggerUpload: () => Promise<void>;
|
|
91
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
92
|
+
replace: (arg: {
|
|
93
|
+
url: string;
|
|
94
|
+
index: number;
|
|
95
|
+
}) => void;
|
|
96
|
+
change: (arg: string | string[]) => void;
|
|
97
|
+
}, string, Readonly<import('vue').ExtractPropTypes<{
|
|
98
|
+
"v-model-key": import('vue-types').VueTypeDef<string | string[]> & {
|
|
99
|
+
default: string | (() => string[]);
|
|
100
|
+
};
|
|
101
|
+
method: import('vue-types').VueTypeDef<"button" | "drag" | "card">;
|
|
102
|
+
listType: import('vue-types').VueTypeDef<"text" | "picture-card"> & {
|
|
103
|
+
default: "text" | "picture-card";
|
|
104
|
+
};
|
|
105
|
+
disabled: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
106
|
+
default: boolean;
|
|
107
|
+
};
|
|
108
|
+
data: import('vue-types').VueTypeValidableDef<{
|
|
109
|
+
[key: string]: any;
|
|
110
|
+
}, import('vue-types/dist/types').ValidatorFunction<{
|
|
111
|
+
[key: string]: any;
|
|
112
|
+
}>> & {
|
|
113
|
+
default: () => {
|
|
114
|
+
[key: string]: any;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
fileExtension: import('vue-types').VueTypeValidableDef<string[], import('vue-types/dist/types').ValidatorFunction<string[]>> & {
|
|
118
|
+
default: () => string[];
|
|
119
|
+
};
|
|
120
|
+
acceptType: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
121
|
+
multiple: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
122
|
+
default: boolean;
|
|
123
|
+
};
|
|
124
|
+
draggable: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
125
|
+
default: boolean;
|
|
126
|
+
};
|
|
127
|
+
sizeLimit: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
128
|
+
countLimit: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
129
|
+
controller: import('vue-types').VueTypeValidableDef<import('./hooks/props-define').FileUploadController, import('vue-types/dist/types').ValidatorFunction<import('./hooks/props-define').FileUploadController>>;
|
|
130
|
+
width: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
|
|
131
|
+
default: number;
|
|
132
|
+
};
|
|
133
|
+
height: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
|
|
134
|
+
default: number;
|
|
135
|
+
};
|
|
136
|
+
uploadTitle: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
137
|
+
uploadPlaceholder: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
138
|
+
defaultUploadPlaceholder: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
139
|
+
default: boolean;
|
|
140
|
+
};
|
|
141
|
+
showDelete: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
142
|
+
default: boolean;
|
|
143
|
+
};
|
|
144
|
+
cropper: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
145
|
+
default: boolean;
|
|
146
|
+
};
|
|
147
|
+
cropperTitle: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
148
|
+
cropperProps: import('vue-types').VueTypeValidableDef<Partial<import('vue').ExtractPropTypes<{
|
|
149
|
+
target: import('vue-types').VueTypeDef<string | Object | File>;
|
|
150
|
+
within: import('vue-types').VueTypeDef<"canvas" | "image" | "none"> & {
|
|
151
|
+
default: "canvas" | "image" | "none";
|
|
152
|
+
};
|
|
153
|
+
aspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
154
|
+
initialAspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
155
|
+
}>>, import('vue-types/dist/types').ValidatorFunction<Partial<import('vue').ExtractPropTypes<{
|
|
156
|
+
target: import('vue-types').VueTypeDef<string | Object | File>;
|
|
157
|
+
within: import('vue-types').VueTypeDef<"canvas" | "image" | "none"> & {
|
|
158
|
+
default: "canvas" | "image" | "none";
|
|
159
|
+
};
|
|
160
|
+
aspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
161
|
+
initialAspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
162
|
+
}>>>>;
|
|
163
|
+
}>>, {
|
|
164
|
+
data: {
|
|
165
|
+
[key: string]: any;
|
|
166
|
+
};
|
|
167
|
+
"v-model-key": string | string[];
|
|
168
|
+
disabled: boolean;
|
|
169
|
+
width: number;
|
|
170
|
+
height: number;
|
|
171
|
+
draggable: boolean;
|
|
172
|
+
multiple: boolean;
|
|
173
|
+
listType: "text" | "picture-card";
|
|
174
|
+
fileExtension: string[];
|
|
175
|
+
defaultUploadPlaceholder: boolean;
|
|
176
|
+
showDelete: boolean;
|
|
177
|
+
cropper: boolean;
|
|
178
|
+
}>;
|
|
179
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
180
|
+
export default _default;
|
|
181
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
182
|
+
new (): {
|
|
183
|
+
$scopedSlots: S;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { ImageCropperData } from '../../../../image-cropper';
|
|
2
|
+
import { FileUploadStatus } from './types';
|
|
3
|
+
export interface FileUploadController {
|
|
4
|
+
/**
|
|
5
|
+
* 执行上传
|
|
6
|
+
*/
|
|
7
|
+
uploadAction?: (data: FileUploadActionData) => Promise<FileUploadActionResult>;
|
|
8
|
+
/**
|
|
9
|
+
* 取消上传
|
|
10
|
+
*/
|
|
11
|
+
cancelUpload?: (taskId: string | number) => Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* 执行裁剪
|
|
14
|
+
*/
|
|
15
|
+
cropperAction?: (data: ImageFileCropperActionData) => Promise<FileUploadActionResult>;
|
|
16
|
+
/**
|
|
17
|
+
* 自定义上传,如果返回 undefined,则继续执行默认程序。
|
|
18
|
+
*/
|
|
19
|
+
customUpload?: (data: FileUploadCustomData) => Promise<FileUploadCustomResult>;
|
|
20
|
+
}
|
|
21
|
+
export interface FileUploadActionData {
|
|
22
|
+
/**
|
|
23
|
+
* 文件
|
|
24
|
+
*/
|
|
25
|
+
file: File;
|
|
26
|
+
/**
|
|
27
|
+
* 附带数据
|
|
28
|
+
*/
|
|
29
|
+
data: Record<string, unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* 更新上传进度,范围:0~100
|
|
32
|
+
*/
|
|
33
|
+
updateUploadProgress: (progress: number) => void;
|
|
34
|
+
/**
|
|
35
|
+
* 更新任务 id
|
|
36
|
+
*/
|
|
37
|
+
updateTaskId: (taskId: string | number) => void;
|
|
38
|
+
}
|
|
39
|
+
export interface ImageFileCropperActionData extends ImageCropperData {
|
|
40
|
+
/**
|
|
41
|
+
* 图片地址
|
|
42
|
+
*/
|
|
43
|
+
url: string;
|
|
44
|
+
/**
|
|
45
|
+
* 文件
|
|
46
|
+
*/
|
|
47
|
+
file?: File;
|
|
48
|
+
/**
|
|
49
|
+
* 附带数据
|
|
50
|
+
*/
|
|
51
|
+
data: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
export interface FileUploadActionResult {
|
|
54
|
+
/**
|
|
55
|
+
* 在线地址
|
|
56
|
+
*/
|
|
57
|
+
url: string;
|
|
58
|
+
}
|
|
59
|
+
export interface FileUploadCustomData {
|
|
60
|
+
/**
|
|
61
|
+
* 附带数据
|
|
62
|
+
*/
|
|
63
|
+
data: Record<string, unknown>;
|
|
64
|
+
/**
|
|
65
|
+
* 可选数量
|
|
66
|
+
*/
|
|
67
|
+
remainCount: number;
|
|
68
|
+
/**
|
|
69
|
+
* 文件类型
|
|
70
|
+
*/
|
|
71
|
+
acceptType: string | undefined;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 自定义上传回调结果
|
|
75
|
+
*/
|
|
76
|
+
export interface FileUploadCustomResultItem {
|
|
77
|
+
/**
|
|
78
|
+
* 在线地址
|
|
79
|
+
*/
|
|
80
|
+
url?: string;
|
|
81
|
+
/**
|
|
82
|
+
* 文件对象
|
|
83
|
+
*/
|
|
84
|
+
file?: File;
|
|
85
|
+
}
|
|
86
|
+
export type FileUploadCustomResult = FileUploadCustomResultItem[] | undefined;
|
|
87
|
+
declare module '../../../../../hooks/business/use-config-provider' {
|
|
88
|
+
interface ConfigProviderInjectData {
|
|
89
|
+
/**
|
|
90
|
+
* 文件上传控制器
|
|
91
|
+
*/
|
|
92
|
+
fileUploadController?: FileUploadController;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export declare const fileUploadListTypes: readonly ["text", "picture-card"];
|
|
96
|
+
export type FileUploadListType = (typeof fileUploadListTypes)[number];
|
|
97
|
+
export declare const fileUploadMethods: readonly ["button", "drag", "card"];
|
|
98
|
+
export type FileUploadMethod = (typeof fileUploadMethods)[number];
|
|
99
|
+
export declare const fileUploadProps: () => {
|
|
100
|
+
/**
|
|
101
|
+
* 绑定值,支持 v-model
|
|
102
|
+
*/
|
|
103
|
+
"v-model-key": import('vue-types').VueTypeDef<string | string[]> & {
|
|
104
|
+
default: string | (() => string[]);
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* 上传方式
|
|
108
|
+
*/
|
|
109
|
+
method: import('vue-types').VueTypeDef<"button" | "drag" | "card">;
|
|
110
|
+
/**
|
|
111
|
+
* 列表类型
|
|
112
|
+
* @default 'text'
|
|
113
|
+
*/
|
|
114
|
+
listType: import('vue-types').VueTypeDef<"text" | "picture-card"> & {
|
|
115
|
+
default: "text" | "picture-card";
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* 是否禁用
|
|
119
|
+
*/
|
|
120
|
+
disabled: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
121
|
+
default: boolean;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* 附带数据
|
|
125
|
+
*/
|
|
126
|
+
data: import('vue-types').VueTypeValidableDef<{
|
|
127
|
+
[key: string]: any;
|
|
128
|
+
}, import('vue-types/dist/types').ValidatorFunction<{
|
|
129
|
+
[key: string]: any;
|
|
130
|
+
}>> & {
|
|
131
|
+
default: () => {
|
|
132
|
+
[key: string]: any;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* 文件扩展名
|
|
137
|
+
*/
|
|
138
|
+
fileExtension: import('vue-types').VueTypeValidableDef<string[], import('vue-types/dist/types').ValidatorFunction<string[]>> & {
|
|
139
|
+
default: () => string[];
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* 文件类型
|
|
143
|
+
*/
|
|
144
|
+
acceptType: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
145
|
+
/**
|
|
146
|
+
* 是否支持多选文件
|
|
147
|
+
* @default false
|
|
148
|
+
*/
|
|
149
|
+
multiple: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
150
|
+
default: boolean;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* 是否支持拖拽,仅多选时生效
|
|
154
|
+
* @default true
|
|
155
|
+
*/
|
|
156
|
+
draggable: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
157
|
+
default: boolean;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* 文件大小限制,单位:kb
|
|
161
|
+
*/
|
|
162
|
+
sizeLimit: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
163
|
+
/**
|
|
164
|
+
* 数量限制
|
|
165
|
+
*/
|
|
166
|
+
countLimit: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
167
|
+
/**
|
|
168
|
+
* 控制器
|
|
169
|
+
*/
|
|
170
|
+
controller: import('vue-types').VueTypeValidableDef<FileUploadController, import('vue-types/dist/types').ValidatorFunction<FileUploadController>>;
|
|
171
|
+
/**
|
|
172
|
+
* 宽度
|
|
173
|
+
* @default 80
|
|
174
|
+
*/
|
|
175
|
+
width: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
|
|
176
|
+
default: number;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* 高度
|
|
180
|
+
* @default 80
|
|
181
|
+
*/
|
|
182
|
+
height: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>> & {
|
|
183
|
+
default: number;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* 上传标题
|
|
187
|
+
* @default '点击上传图片'
|
|
188
|
+
*/
|
|
189
|
+
uploadTitle: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
190
|
+
/**
|
|
191
|
+
* 上传描述
|
|
192
|
+
*/
|
|
193
|
+
uploadPlaceholder: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
194
|
+
/**
|
|
195
|
+
* 使用默认的上传描述
|
|
196
|
+
* @default false
|
|
197
|
+
*/
|
|
198
|
+
defaultUploadPlaceholder: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
199
|
+
default: boolean;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* 是否显示删除
|
|
203
|
+
* @default true
|
|
204
|
+
*/
|
|
205
|
+
showDelete: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
206
|
+
default: boolean;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* 是否裁剪图片
|
|
210
|
+
* @default false
|
|
211
|
+
*/
|
|
212
|
+
cropper: import('vue-types').VueTypeValidableDef<boolean, import('vue-types/dist/types').ValidatorFunction<boolean>> & {
|
|
213
|
+
default: boolean;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* 裁剪图片弹层标题
|
|
217
|
+
* @default '裁剪图片'
|
|
218
|
+
*/
|
|
219
|
+
cropperTitle: import('vue-types').VueTypeValidableDef<string, import('vue-types/dist/types').ValidatorFunction<string>>;
|
|
220
|
+
/**
|
|
221
|
+
* 裁剪图片组件参数
|
|
222
|
+
* @propType ImageCropperProps
|
|
223
|
+
*/
|
|
224
|
+
cropperProps: import('vue-types').VueTypeValidableDef<Partial<import('vue').ExtractPropTypes<{
|
|
225
|
+
target: import('vue-types').VueTypeDef<string | Object | File>;
|
|
226
|
+
within: import('vue-types').VueTypeDef<"canvas" | "image" | "none"> & {
|
|
227
|
+
default: "canvas" | "image" | "none";
|
|
228
|
+
};
|
|
229
|
+
aspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
230
|
+
initialAspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
231
|
+
}>>, import('vue-types/dist/types').ValidatorFunction<Partial<import('vue').ExtractPropTypes<{
|
|
232
|
+
target: import('vue-types').VueTypeDef<string | Object | File>;
|
|
233
|
+
within: import('vue-types').VueTypeDef<"canvas" | "image" | "none"> & {
|
|
234
|
+
default: "canvas" | "image" | "none";
|
|
235
|
+
};
|
|
236
|
+
aspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
237
|
+
initialAspectRatio: import('vue-types').VueTypeValidableDef<number, import('vue-types/dist/types').ValidatorFunction<number>>;
|
|
238
|
+
}>>>>;
|
|
239
|
+
};
|
|
240
|
+
export declare const fileUploadEmits: () => {
|
|
241
|
+
/**
|
|
242
|
+
* 图片上传变化
|
|
243
|
+
*/
|
|
244
|
+
change: import('../../../../../vue-utils').EmitFuncType<string | string[]>;
|
|
245
|
+
/**
|
|
246
|
+
* 替换
|
|
247
|
+
*/
|
|
248
|
+
replace: import('../../../../../vue-utils').EmitFuncType<{
|
|
249
|
+
url: string;
|
|
250
|
+
index: number;
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
253
|
+
export interface FileUploadItemSlotData {
|
|
254
|
+
/**
|
|
255
|
+
* 地址
|
|
256
|
+
*/
|
|
257
|
+
url: string | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* 文件名
|
|
260
|
+
*/
|
|
261
|
+
fileName: string | undefined;
|
|
262
|
+
/**
|
|
263
|
+
* 宽度
|
|
264
|
+
*/
|
|
265
|
+
width: string | undefined;
|
|
266
|
+
/**
|
|
267
|
+
* 高度
|
|
268
|
+
*/
|
|
269
|
+
height: string | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* 上传状态
|
|
272
|
+
*/
|
|
273
|
+
status: FileUploadStatus;
|
|
274
|
+
/**
|
|
275
|
+
* 上传进度
|
|
276
|
+
*/
|
|
277
|
+
uploadProgress: number | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* 删除节点
|
|
280
|
+
*/
|
|
281
|
+
deleteItem: () => void;
|
|
282
|
+
/**
|
|
283
|
+
* 替换节点
|
|
284
|
+
*/
|
|
285
|
+
replaceItem: () => void;
|
|
286
|
+
}
|
|
287
|
+
export interface FileUploadSlots {
|
|
288
|
+
/**
|
|
289
|
+
* 文件节点
|
|
290
|
+
*/
|
|
291
|
+
'file-item': FileUploadItemSlotData;
|
|
292
|
+
/**
|
|
293
|
+
* 占位文本后缀
|
|
294
|
+
*/
|
|
295
|
+
'placeholder-suffix': void;
|
|
296
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare enum FileUploadStatus {
|
|
2
|
+
/**
|
|
3
|
+
* 待上传
|
|
4
|
+
*/
|
|
5
|
+
Pending = "pending",
|
|
6
|
+
/**
|
|
7
|
+
* 上传中
|
|
8
|
+
*/
|
|
9
|
+
Uploading = "uploading",
|
|
10
|
+
/**
|
|
11
|
+
* 上传成功
|
|
12
|
+
*/
|
|
13
|
+
Success = "success",
|
|
14
|
+
/**
|
|
15
|
+
* 上传失败
|
|
16
|
+
*/
|
|
17
|
+
Failed = "failed",
|
|
18
|
+
/**
|
|
19
|
+
* 已取消
|
|
20
|
+
*/
|
|
21
|
+
Canceled = "canceled"
|
|
22
|
+
}
|
|
23
|
+
export interface FileUploadItem {
|
|
24
|
+
/**
|
|
25
|
+
* 唯一标识
|
|
26
|
+
*/
|
|
27
|
+
id: string;
|
|
28
|
+
/**
|
|
29
|
+
* 任务 id,用于取消任务
|
|
30
|
+
*/
|
|
31
|
+
taskId?: string | number;
|
|
32
|
+
/**
|
|
33
|
+
* 文件对象
|
|
34
|
+
*/
|
|
35
|
+
file?: File;
|
|
36
|
+
/**
|
|
37
|
+
* 在线地址
|
|
38
|
+
*/
|
|
39
|
+
url?: string;
|
|
40
|
+
/**
|
|
41
|
+
* 状态
|
|
42
|
+
*/
|
|
43
|
+
status: FileUploadStatus;
|
|
44
|
+
/**
|
|
45
|
+
* 上传进度,范围:0~100
|
|
46
|
+
*/
|
|
47
|
+
uploadProgress?: number;
|
|
48
|
+
/**
|
|
49
|
+
* 自动触发裁剪
|
|
50
|
+
*/
|
|
51
|
+
autoTriggerCropper?: true;
|
|
52
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileUploadItemSlotData, FileUploadSlots } from './props-define';
|
|
2
|
+
import { VNode } from 'vue';
|
|
3
|
+
export interface FileUploadSlotInject {
|
|
4
|
+
hasSlot: (name: keyof FileUploadSlots) => boolean;
|
|
5
|
+
getFileUploadItemRenderSlot: (params: FileUploadItemSlotData) => VNode[] | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare const useFileUploadSlots: () => {
|
|
8
|
+
getFileUploadItemSlotData: (params?: FileUploadItemSlotData) => FileUploadItemSlotData;
|
|
9
|
+
};
|
|
10
|
+
export declare function useFileUploadSlotsInject(): FileUploadSlotInject;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { UseTaskQueueReturn } from '../../../../../hooks/tools/use-task-queue';
|
|
2
|
+
import { VueEmit, VueProps } from '../../../../../vue-utils';
|
|
3
|
+
import { ComputedRef, InjectionKey, Ref } from 'vue';
|
|
4
|
+
import { FileUploadController, fileUploadEmits, FileUploadMethod, fileUploadProps } from './props-define';
|
|
5
|
+
import { FileUploadStatus, FileUploadItem } from './types';
|
|
6
|
+
interface FileUploadInjectData {
|
|
7
|
+
fileUploadProps: VueProps<typeof fileUploadProps>;
|
|
8
|
+
fileUploadEmit: VueEmit<typeof fileUploadEmits>;
|
|
9
|
+
itemList: Ref<FileUploadItem[]>;
|
|
10
|
+
/**
|
|
11
|
+
* 实际的限制数量
|
|
12
|
+
*/
|
|
13
|
+
realCountLimit: ComputedRef<number>;
|
|
14
|
+
/**
|
|
15
|
+
* 文件输入框 accept 类型
|
|
16
|
+
*/
|
|
17
|
+
inputAcceptType: ComputedRef<string | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* 上传方式
|
|
20
|
+
*/
|
|
21
|
+
uploadMethod: ComputedRef<FileUploadMethod>;
|
|
22
|
+
/**
|
|
23
|
+
* 是否小尺寸样式
|
|
24
|
+
*/
|
|
25
|
+
isSmallStyle: ComputedRef<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* 是否迷你尺寸样式
|
|
28
|
+
*/
|
|
29
|
+
isMiniStyle: ComputedRef<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* 更新绑定值
|
|
32
|
+
*/
|
|
33
|
+
updateValue: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* 获取上传控制器
|
|
36
|
+
*/
|
|
37
|
+
getController: () => FileUploadController;
|
|
38
|
+
/**
|
|
39
|
+
* 上传任务队列
|
|
40
|
+
*/
|
|
41
|
+
uploadTaskQueue: UseTaskQueueReturn;
|
|
42
|
+
/**
|
|
43
|
+
* 检查文件是否符合要求
|
|
44
|
+
* @param file 文件对象
|
|
45
|
+
* @returns 是否符合要求
|
|
46
|
+
*/
|
|
47
|
+
checkFile: (file: File) => Promise<{
|
|
48
|
+
success: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* 更新 item
|
|
52
|
+
*/
|
|
53
|
+
updateItem: (item: FileUploadItem) => void;
|
|
54
|
+
/**
|
|
55
|
+
* 删除 item
|
|
56
|
+
*/
|
|
57
|
+
deleteItem: (id: string) => void;
|
|
58
|
+
/**
|
|
59
|
+
* 是否正在拖拽
|
|
60
|
+
*/
|
|
61
|
+
isDragging: Ref<boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* 是否禁用
|
|
64
|
+
*/
|
|
65
|
+
disabled: ComputedRef<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* 上传占位文本
|
|
68
|
+
*/
|
|
69
|
+
uploadPlaceholderText: ComputedRef<string | undefined>;
|
|
70
|
+
/**
|
|
71
|
+
* 图片渲染额外参数
|
|
72
|
+
*/
|
|
73
|
+
imageRenderExtraParams: Ref<Record<string, any>>;
|
|
74
|
+
}
|
|
75
|
+
export declare const FILE_UPLOAD_INJECT_KEY: InjectionKey<FileUploadInjectData>;
|
|
76
|
+
export declare const useFileUpload: (options: {
|
|
77
|
+
props: VueProps<typeof fileUploadProps>;
|
|
78
|
+
emit: VueEmit<typeof fileUploadEmits>;
|
|
79
|
+
}) => {
|
|
80
|
+
inputRef: Ref<HTMLInputElement | undefined>;
|
|
81
|
+
itemList: Ref<{
|
|
82
|
+
id: string;
|
|
83
|
+
taskId?: string | number | undefined;
|
|
84
|
+
file?: {
|
|
85
|
+
readonly lastModified: number;
|
|
86
|
+
readonly name: string;
|
|
87
|
+
readonly webkitRelativePath: string;
|
|
88
|
+
readonly size: number;
|
|
89
|
+
readonly type: string;
|
|
90
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
91
|
+
bytes: () => Promise<Uint8Array>;
|
|
92
|
+
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
93
|
+
stream: () => ReadableStream<Uint8Array>;
|
|
94
|
+
text: () => Promise<string>;
|
|
95
|
+
} | undefined;
|
|
96
|
+
url?: string | undefined;
|
|
97
|
+
status: FileUploadStatus;
|
|
98
|
+
uploadProgress?: number | undefined;
|
|
99
|
+
autoTriggerCropper?: true | undefined;
|
|
100
|
+
}[]>;
|
|
101
|
+
inputAcceptType: ComputedRef<string>;
|
|
102
|
+
realCountLimit: ComputedRef<number>;
|
|
103
|
+
uploadPlaceholderText: ComputedRef<string | undefined>;
|
|
104
|
+
uploadMethod: ComputedRef<"button" | "drag" | "card">;
|
|
105
|
+
triggerUpload: () => Promise<void>;
|
|
106
|
+
updateValue: () => void;
|
|
107
|
+
isSmallStyle: ComputedRef<boolean>;
|
|
108
|
+
isMiniStyle: ComputedRef<boolean>;
|
|
109
|
+
isDragging: Ref<boolean>;
|
|
110
|
+
addFiles: (files: File[]) => void;
|
|
111
|
+
disabled: ComputedRef<boolean>;
|
|
112
|
+
};
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { VueProps } from '../../../../../vue-utils';
|
|
2
|
+
import { FileUploadController, fileUploadProps } from './props-define';
|
|
3
|
+
export declare const useUploadController: (options: {
|
|
4
|
+
props: VueProps<typeof fileUploadProps>;
|
|
5
|
+
}) => {
|
|
6
|
+
getController: () => FileUploadController;
|
|
7
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
2
|
+
click: (arg?: void | undefined) => void;
|
|
3
|
+
}, string, Readonly<import('vue').ExtractPropTypes<{}>>, {}>;
|
|
4
|
+
export default _default;
|