@opentiny/vue-renderless 3.13.1 → 3.14.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/action-sheet/index.js +20 -13
- package/action-sheet/vue.js +8 -7
- package/amount/index.js +100 -25
- package/amount/vue.js +102 -26
- package/anchor/index.js +1 -0
- package/area/index.js +8 -8
- package/area/vue.js +5 -5
- package/async-flowchart/index.js +16 -3
- package/autocomplete/index.js +58 -14
- package/autocomplete/vue.js +40 -12
- package/badge/index.js +12 -0
- package/badge/vue.js +6 -4
- package/breadcrumb/vue.js +3 -1
- package/breadcrumb-item/vue.js +6 -2
- package/button/index.js +5 -1
- package/calendar/index.js +2 -86
- package/calendar-bar/index.js +18 -4
- package/calendar-view/index.js +5 -1
- package/calendar-view/vue.js +16 -3
- package/card-group/vue.js +4 -2
- package/cascader/index.js +86 -34
- package/cascader/vue.js +61 -20
- package/cascader-menu/index.js +7 -7
- package/cascader-menu/vue.js +2 -3
- package/cascader-mobile/index.js +36 -23
- package/cascader-mobile/vue.js +6 -0
- package/cascader-node/index.js +13 -1
- package/cascader-node/vue.js +15 -4
- package/cascader-panel/index.js +1 -1
- package/cascader-select/column-index.js +150 -0
- package/cascader-select/column.js +120 -0
- package/cascader-select/index.js +29 -165
- package/cascader-select/usePicker.js +251 -0
- package/cascader-select/useTouch.js +65 -0
- package/cascader-select/vue.js +35 -47
- package/cell/vue.js +2 -1
- package/chart-bar/index.js +2 -3
- package/chart-core/deps/constants.js +43 -43
- package/chart-core/index.js +1 -1
- package/chart-gauge/index.js +2 -2
- package/chart-heatmap/index.js +17 -10
- package/chart-line/index.js +8 -9
- package/chart-tree/index.js +2 -2
- package/chart-waterfall/index.js +4 -6
- package/checkbox/index.js +18 -1
- package/checkbox/vue.js +15 -7
- package/checkbox-group/vue.js +1 -0
- package/col/vue.js +1 -1
- package/collapse/index.js +3 -3
- package/color-select-panel/vue.js +0 -7
- package/column-list-item/index.js +17 -1
- package/column-list-item/vue.js +8 -3
- package/common/date.js +7 -5
- package/common/deps/clickoutside.js +6 -2
- package/common/deps/dom.js +19 -4
- package/common/deps/popper.js +44 -11
- package/common/deps/resize-event.js +1 -0
- package/common/deps/touch-emulator.js +4 -1
- package/common/deps/tree-model/node.js +2 -2
- package/common/deps/tree-model/tree-store.js +2 -13
- package/common/deps/useRect.js +25 -0
- package/common/deps/vue-popper.js +38 -20
- package/common/index.js +2 -2
- package/common/runtime.js +1 -1
- package/common/string.js +2 -2
- package/common/type.js +2 -1
- package/common/validate/rules/enum.js +1 -1
- package/common/validate/rules/pattern.js +2 -2
- package/common/validate/rules/range.js +8 -5
- package/common/validate/rules/required.js +1 -1
- package/common/validate/rules/type.js +5 -5
- package/common/validate/rules/whitespace.js +1 -1
- package/common/validate/util.js +15 -16
- package/common/validate/validations/integer.js +1 -1
- package/common/validate/validations/method.js +1 -1
- package/currency/index.js +74 -7
- package/currency/vue.js +21 -5
- package/date-panel/index.js +16 -0
- package/date-panel/vue.js +8 -2
- package/date-picker-mobile/index.js +12 -0
- package/date-picker-mobile/vue.js +7 -1
- package/date-range/vue.js +14 -6
- package/date-table/index.js +5 -0
- package/date-table/vue.js +3 -1
- package/dialog-box/index.js +46 -14
- package/dialog-box/vue.js +30 -7
- package/dialog-select/index.js +6 -3
- package/dialog-select/vue.js +8 -4
- package/drawer/index.js +27 -5
- package/drawer/vue.js +14 -7
- package/dropdown/index.js +7 -7
- package/dropdown/vue.js +6 -2
- package/dropdown-item/index.js +9 -1
- package/dropdown-item/mf.js +6 -10
- package/dropdown-item/vue.js +20 -7
- package/dropdown-menu/index.js +20 -7
- package/dropdown-menu/vue.js +4 -3
- package/exception/index.js +2 -7
- package/exception/vue.js +7 -10
- package/fall-menu/index.js +5 -1
- package/fall-menu/vue.js +13 -2
- package/file-upload/index.js +68 -18
- package/file-upload/vue.js +38 -8
- package/filter-box/index.js +1 -0
- package/float-button/index.js +42 -0
- package/float-button/vue.js +101 -0
- package/floating-button/index.js +62 -16
- package/floating-button/vue.js +27 -9
- package/flowchart/index.js +134 -25
- package/flowchart/node.js +13 -4
- package/flowchart/vue.js +16 -4
- package/form/vue.js +8 -0
- package/form-item/index.js +5 -5
- package/form-item/vue.js +3 -1
- package/fullscreen/index.js +5 -5
- package/fullscreen/vue.js +3 -3
- package/grid/plugins/export.js +5 -2
- package/grid/utils/column.js +1 -0
- package/grid/utils/dom.js +7 -1
- package/image/index.js +6 -1
- package/image/vue.js +6 -3
- package/image-viewer/index.js +62 -51
- package/image-viewer/vue.js +17 -5
- package/input/index.js +81 -20
- package/input/vue.js +44 -18
- package/ip-address/index.js +61 -19
- package/ip-address/vue.js +22 -4
- package/link/vue.js +3 -1
- package/loading/index.js +2 -2
- package/loading/vue.js +8 -2
- package/logout/index.js +1 -1
- package/menu/index.js +15 -2
- package/menu/vue.js +22 -17
- package/mind-map/index.js +47 -0
- package/mind-map/vue.js +53 -0
- package/modal/index.js +44 -4
- package/modal/vue.js +18 -4
- package/multi-select/index.js +186 -11
- package/multi-select/vue.js +60 -15
- package/multi-select-item/index.js +23 -0
- package/multi-select-item/vue.js +31 -0
- package/numeric/index.js +46 -12
- package/numeric/vue.js +44 -19
- package/option/index.js +27 -9
- package/option/vue.js +37 -21
- package/option-group/index.js +3 -3
- package/package.json +1 -1
- package/pager/index.js +18 -4
- package/pager/vue.js +16 -5
- package/picker/index.js +258 -49
- package/picker/mb.js +42 -0
- package/picker/vue.js +70 -17
- package/picker-column/index.js +1 -1
- package/pop-upload/vue.js +3 -0
- package/popconfirm/index.js +3 -6
- package/popconfirm/vue.js +1 -1
- package/popeditor/index.js +71 -32
- package/popeditor/vue.js +15 -11
- package/popover/index.js +4 -4
- package/popover/vue.js +6 -6
- package/popup/index.js +3 -3
- package/popup/vue.js +5 -5
- package/pull-refresh/index.js +13 -13
- package/pull-refresh/vue.js +5 -4
- package/radio/index.js +0 -17
- package/radio/vue.js +4 -10
- package/rate/index.js +1 -1
- package/rate/vue.js +0 -2
- package/record/index.js +4 -1
- package/rich-text/clipboard.js +54 -0
- package/rich-text/index.js +192 -0
- package/rich-text/module/file-upload.js +107 -0
- package/rich-text/module/image-drop.js +63 -0
- package/rich-text/module/image-upload.js +89 -0
- package/rich-text/options.js +141 -0
- package/rich-text/table-module.js +382 -0
- package/rich-text/vue.js +102 -0
- package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
- package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
- package/scrollbar/index.js +11 -11
- package/scrollbar/vue-bar.js +3 -3
- package/scrollbar/vue.js +5 -5
- package/search/index.js +9 -9
- package/search/vue.js +8 -6
- package/select/index.js +457 -389
- package/select/vue.js +257 -161
- package/select-dropdown/index.js +61 -3
- package/select-dropdown/vue.js +85 -8
- package/select-view/index.js +3 -1
- package/selected-box/index.js +2 -0
- package/selected-box/vue.js +6 -3
- package/signature/index.js +241 -0
- package/signature/vue.js +88 -0
- package/skeleton/index.js +14 -0
- package/skeleton/vue.js +15 -0
- package/skeleton-item/vue.js +15 -0
- package/slider/index.js +70 -17
- package/slider/vue.js +16 -7
- package/split/index.js +5 -3
- package/split/vue.js +4 -6
- package/standard-list-item/index.js +15 -1
- package/standard-list-item/vue.js +6 -5
- package/steps/index.js +25 -2
- package/steps/slide-bar.js +8 -1
- package/steps/vue.js +15 -3
- package/tab-item-mf/vue.js +14 -8
- package/tab-nav/index.js +30 -5
- package/tab-nav/vue.js +16 -4
- package/tabbar/vue.js +9 -3
- package/tabbar-item/vue.js +3 -2
- package/tabs/index.js +16 -4
- package/tabs/vue.js +2 -1
- package/tabs-mf/index.js +20 -6
- package/tabs-mf/vue-nav.js +26 -11
- package/tabs-mf/vue.js +7 -7
- package/tabs-mf/wheel.js +1 -0
- package/tag/index.js +1 -1
- package/tag-group/index.js +2 -1
- package/time/index.js +5 -2
- package/time/vue.js +1 -1
- package/time-line/index.js +3 -3
- package/time-line/vue.js +2 -2
- package/time-picker-mobile/index.js +24 -5
- package/time-picker-mobile/vue.js +17 -7
- package/time-range/index.js +2 -0
- package/timeline-item/vue.js +1 -1
- package/tooltip/index.js +6 -3
- package/tooltip/vue.js +4 -4
- package/transfer/index.js +20 -22
- package/transfer/vue.js +1 -6
- package/transfer-panel/vue.js +3 -5
- package/tree/index.js +21 -4
- package/tree/vue.js +10 -8
- package/tree-menu/index.js +31 -5
- package/tree-menu/vue.js +28 -15
- package/tree-node/index.js +18 -18
- package/tree-node/vue.js +6 -5
- package/types/action-sheet.type.d.ts +118 -1
- package/types/alert.type.d.ts +1 -1
- package/types/amount.type.d.ts +168 -1
- package/types/area.type.d.ts +134 -1
- package/types/async-flowchart.type.d.ts +72 -0
- package/types/autocomplete.type.d.ts +199 -1
- package/types/badge.type.d.ts +3 -1
- package/types/breadcrumb-item.type.d.ts +2 -0
- package/types/breadcrumb.type.d.ts +2 -0
- package/types/button-group.type.d.ts +3 -3
- package/types/button.type.d.ts +4 -0
- package/types/cascader-menu.type.d.ts +3 -4
- package/types/cascader-node.type.d.ts +5 -2
- package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
- package/types/cascader-panel.type.d.ts +3 -241
- package/types/cascader.type.d.ts +329 -1
- package/types/checkbox.type.d.ts +9 -3
- package/types/collapse.type.d.ts +20 -3
- package/types/date-picker.type.d.ts +37 -0
- package/types/dialog-box.type.d.ts +13 -3
- package/types/drawer.type.d.ts +133 -1
- package/types/{dropdown-item.type-8ea6c633.d.ts → dropdown-item.type-8475a549.d.ts} +7 -13
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/dropdown.type.d.ts +1 -5
- package/types/fall-menu.type.d.ts +94 -1
- package/types/file-upload.type.d.ts +1 -1
- package/types/float-button.type.d.ts +123 -0
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-d0fd42f3.d.ts → form.type-222799ae.d.ts} +5 -2
- package/types/form.type.d.ts +1 -1
- package/types/{index-e0250f63.d.ts → index-b012f687.d.ts} +9 -0
- package/types/input.type.d.ts +1 -5
- package/types/ip-address.type.d.ts +160 -1
- package/types/link.type.d.ts +6 -3
- package/types/loading.type.d.ts +7 -0
- package/types/milestone.type.d.ts +1 -1
- package/types/mind-map.type.d.ts +20 -0
- package/types/modal.type.d.ts +29 -2
- package/types/numeric.type.d.ts +41 -10
- package/types/pager.type.d.ts +13 -1
- package/types/picker.type.d.ts +18 -0
- package/types/popconfirm.type.d.ts +86 -1
- package/types/popeditor.type.d.ts +5 -1
- package/types/popover.type.d.ts +3 -3
- package/types/progress.type.d.ts +3 -1
- package/types/radio.type.d.ts +0 -4
- package/types/rate.type.d.ts +236 -1
- package/types/search.type.d.ts +88 -1
- package/types/shared.type.d.ts +1 -1
- package/types/skeleton-item.type.d.ts +38 -0
- package/types/skeleton.type.d.ts +45 -0
- package/types/slider.type.d.ts +49 -10
- package/types/steps.type.d.ts +15 -4
- package/types/switch.type.d.ts +3 -3
- package/types/tab-bar.type.d.ts +1 -1
- package/types/tab-nav.type.d.ts +7 -2
- package/types/tabs.type.d.ts +9 -1
- package/types/tag-group.type.d.ts +64 -1
- package/types/{time-line.type-d7daa669.d.ts → time-line.type-b155cb4f.d.ts} +12 -0
- package/types/time-line.type.d.ts +1 -1
- package/types/timeline-item.type.d.ts +1 -1
- package/types/tooltip.type.d.ts +2 -2
- package/types/transfer.type.d.ts +185 -1
- package/types/tree-menu.type.d.ts +210 -1
- package/types/upload-dragger.type.d.ts +2 -2
- package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-a29aea50.d.ts} +31 -8
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-head.type.d.ts +146 -1
- package/types/wizard.type.d.ts +1 -0
- package/upload/index.js +64 -34
- package/upload/vue.js +9 -5
- package/upload-dragger/index.js +22 -20
- package/upload-list/index.js +24 -18
- package/upload-list/vue.js +9 -4
- package/user/index.js +34 -25
- package/user/vue.js +1 -1
- package/user-head/index.js +3 -3
- package/watermark/index.js +11 -0
- package/wheel/index.js +3 -0
- package/wizard/vue.js +4 -2
- package/common/deps/modal-queue.js +0 -6
- package/common/deps/requestAnimationFrame.js +0 -25
|
@@ -7,6 +7,11 @@ declare const $constants: {
|
|
|
7
7
|
UPLOAD_INNER_TEMPLATE: string;
|
|
8
8
|
UPLOAD_LIST_INNER: string;
|
|
9
9
|
UPLOAD_LIST_INNER_TEMPLATE: string;
|
|
10
|
+
ONLY_SUPPORT: string;
|
|
11
|
+
COMMA: string;
|
|
12
|
+
FILE_NOT_LESS_THAN: string;
|
|
13
|
+
FILE_NOT_MORE_THAN: string;
|
|
14
|
+
NUMBER_LIMIT: string;
|
|
10
15
|
FILE_STATUS: {
|
|
11
16
|
READY: string;
|
|
12
17
|
SUCESS: string;
|
|
@@ -21,6 +26,7 @@ declare const $constants: {
|
|
|
21
26
|
THUMB: string;
|
|
22
27
|
PICTURE_SINGLE: string;
|
|
23
28
|
DRAG_SINGLE: string;
|
|
29
|
+
SAAS: string;
|
|
24
30
|
};
|
|
25
31
|
EDM: {
|
|
26
32
|
CHUNKINIT: string;
|
|
@@ -68,6 +74,7 @@ declare const $constants: {
|
|
|
68
74
|
NOT_SUPPORT_NO_SUFFIX: string;
|
|
69
75
|
STATUS_SPECIAL_CHARACTERS: number;
|
|
70
76
|
NOT_SUPPORT_SPECIAL_CHARACTERS: string;
|
|
77
|
+
DOC_PREVIEW: string;
|
|
71
78
|
};
|
|
72
79
|
IMAGE_TYPE: string;
|
|
73
80
|
FILE_TYPE: {
|
|
@@ -100,6 +107,11 @@ declare const fileUploadProps: {
|
|
|
100
107
|
UPLOAD_INNER_TEMPLATE: string;
|
|
101
108
|
UPLOAD_LIST_INNER: string;
|
|
102
109
|
UPLOAD_LIST_INNER_TEMPLATE: string;
|
|
110
|
+
ONLY_SUPPORT: string;
|
|
111
|
+
COMMA: string;
|
|
112
|
+
FILE_NOT_LESS_THAN: string;
|
|
113
|
+
FILE_NOT_MORE_THAN: string;
|
|
114
|
+
NUMBER_LIMIT: string;
|
|
103
115
|
FILE_STATUS: {
|
|
104
116
|
READY: string;
|
|
105
117
|
SUCESS: string;
|
|
@@ -114,6 +126,7 @@ declare const fileUploadProps: {
|
|
|
114
126
|
THUMB: string;
|
|
115
127
|
PICTURE_SINGLE: string;
|
|
116
128
|
DRAG_SINGLE: string;
|
|
129
|
+
SAAS: string;
|
|
117
130
|
};
|
|
118
131
|
EDM: {
|
|
119
132
|
CHUNKINIT: string;
|
|
@@ -161,6 +174,7 @@ declare const fileUploadProps: {
|
|
|
161
174
|
NOT_SUPPORT_NO_SUFFIX: string;
|
|
162
175
|
STATUS_SPECIAL_CHARACTERS: number;
|
|
163
176
|
NOT_SUPPORT_SPECIAL_CHARACTERS: string;
|
|
177
|
+
DOC_PREVIEW: string;
|
|
164
178
|
};
|
|
165
179
|
IMAGE_TYPE: string;
|
|
166
180
|
FILE_TYPE: {
|
|
@@ -322,7 +336,7 @@ declare const fileUploadProps: {
|
|
|
322
336
|
type: BooleanConstructor;
|
|
323
337
|
default: boolean;
|
|
324
338
|
};
|
|
325
|
-
customClass: (
|
|
339
|
+
customClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
|
|
326
340
|
hwh5: ObjectConstructor;
|
|
327
341
|
mode: {
|
|
328
342
|
type: StringConstructor;
|
|
@@ -337,6 +351,10 @@ declare const fileUploadProps: {
|
|
|
337
351
|
type: BooleanConstructor;
|
|
338
352
|
default: boolean;
|
|
339
353
|
};
|
|
354
|
+
compact: {
|
|
355
|
+
type: BooleanConstructor;
|
|
356
|
+
default: boolean;
|
|
357
|
+
};
|
|
340
358
|
beforeAddFile: FunctionConstructor;
|
|
341
359
|
encryptConfig: {
|
|
342
360
|
type: ObjectConstructor;
|
|
@@ -506,7 +524,7 @@ declare const previewImageBatch: ({ service, api }: Pick<IFileUploadRenderlessPa
|
|
|
506
524
|
url: string;
|
|
507
525
|
file: IFileUploadFile;
|
|
508
526
|
}) => any;
|
|
509
|
-
declare const getDialogConfigObj: ({ props, state }: Pick<IFileUploadRenderlessParams, 'props' | 'state'>) => () => object;
|
|
527
|
+
declare const getDialogConfigObj: ({ props, state, t, constants }: Pick<IFileUploadRenderlessParams, 'props' | 'state' | 't' | 'constants'>) => () => object;
|
|
510
528
|
declare const computeDocChunkSize: ({ props, state, constants }: Pick<IFileUploadRenderlessParams, 'props' | 'state' | 'constants'>) => () => void;
|
|
511
529
|
declare const computedSourcetype: ({ props, constants }: Pick<IFileUploadRenderlessParams, 'props' | 'constants'>) => () => string[];
|
|
512
530
|
declare const getFileSourceType: ({ state, props, constants }: Pick<IFileUploadRenderlessParams, 'state' | 'props' | 'constants'>) => ({ file }: {
|
|
@@ -536,7 +554,9 @@ declare const handleClick$1: ({ props, api, parent }: Pick<IUploadListRenderless
|
|
|
536
554
|
declare const downloadFile: (service: IUploadListRenderlessParams['service']) => (file: IFileUploadFile) => void;
|
|
537
555
|
declare const picturefilePreview: (state: IUploadListRenderlessParams['state']) => (index: number) => void;
|
|
538
556
|
declare const getDeleteData: (emit: IUploadListRenderlessParams['emit']) => (data: string[]) => void;
|
|
539
|
-
declare const showOperatePanel: ({ state }: Pick<IUploadListRenderlessParams, 'state'>) => (file:
|
|
557
|
+
declare const showOperatePanel: ({ state }: Pick<IUploadListRenderlessParams, 'state'>) => ({ file }: {
|
|
558
|
+
file: IFileUploadFile;
|
|
559
|
+
}) => void;
|
|
540
560
|
declare const reUpload: ({ emit, props, parent }: Pick<IUploadListRenderlessParams, 'emit' | 'props' | 'parent'>) => (file: IFileUploadFile) => void;
|
|
541
561
|
declare const play: ({ vm, api, props }: Pick<IUploadListRenderlessParams, 'vm' | 'api' | 'props'>) => ({ file, index, type }: {
|
|
542
562
|
file: IFileUploadFile;
|
|
@@ -574,7 +594,7 @@ declare const getNotSuccessFiles: ({ props, constants }: Pick<IUploadListRenderl
|
|
|
574
594
|
declare const chooseFile: ({ state, constants }: Pick<IUploadListRenderlessParams, 'state' | 'constants'>) => (type: string) => void;
|
|
575
595
|
declare const handleTriggerClick: ({ state, props }: Pick<IUploadListRenderlessParams, 'state' | 'props'>) => ($event: Event, type: string) => Promise<unknown>;
|
|
576
596
|
declare const mounted$1: ({ api, vm }: Pick<IUploadListRenderlessParams, 'api' | 'vm'>) => () => void;
|
|
577
|
-
declare const destroyed: ({
|
|
597
|
+
declare const destroyed: ({ props, vm }: Pick<IUploadListRenderlessParams, 'props' | 'vm'>) => () => void;
|
|
578
598
|
|
|
579
599
|
declare const uploadProps: {
|
|
580
600
|
accept: StringConstructor;
|
|
@@ -644,12 +664,17 @@ declare const uploadProps: {
|
|
|
644
664
|
type: BooleanConstructor;
|
|
645
665
|
default: boolean;
|
|
646
666
|
};
|
|
647
|
-
customClass: (
|
|
667
|
+
customClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
|
|
648
668
|
handleTriggerClick: {
|
|
649
669
|
type: FunctionConstructor;
|
|
650
670
|
default: () => void;
|
|
651
671
|
};
|
|
652
672
|
mode: StringConstructor;
|
|
673
|
+
showTitle: BooleanConstructor;
|
|
674
|
+
isHwh5: {
|
|
675
|
+
type: BooleanConstructor;
|
|
676
|
+
default: boolean;
|
|
677
|
+
};
|
|
653
678
|
tiny_mode: StringConstructor;
|
|
654
679
|
tiny_mode_root: BooleanConstructor;
|
|
655
680
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -682,7 +707,7 @@ declare const uploadFiles: ({ state, constants, Modal, props, t }: Pick<IUploadR
|
|
|
682
707
|
declare const upload: ({ api, props, refs }: Pick<IUploadRenderlessParams, 'api' | 'props' | 'refs'>) => (rawFile: File) => void;
|
|
683
708
|
declare const abort: ({ state, props, constants }: Pick<IUploadRenderlessParams, 'state' | 'props' | 'constants'>) => (file: IFileUploadFile) => void;
|
|
684
709
|
declare const post: ({ api, constants, props, state, service }: Pick<IUploadRenderlessParams, 'api' | 'constants' | 'props' | 'state' | 'service'>) => (rawFile: IFileUploadFile) => void;
|
|
685
|
-
declare const handleClick: ({ props, refs }: Pick<IUploadRenderlessParams, 'props' | 'refs'>) => ($event: Event, type: string) => void;
|
|
710
|
+
declare const handleClick: ({ props, refs, state }: Pick<IUploadRenderlessParams, 'props' | 'refs' | 'state'>) => ($event: Event, type: string) => void;
|
|
686
711
|
declare const handleKeydown: (api: IUploadRenderlessParams['api']) => (event: KeyboardEvent) => void;
|
|
687
712
|
declare const handleUpdate: ({ props, state }: Pick<IUploadRenderlessParams, 'props' | 'state'>) => (file: IFileUploadFile) => void;
|
|
688
713
|
declare const mounted: ({ state, props, api }: Pick<IUploadRenderlessParams, 'state' | 'props' | 'api'>) => () => void;
|
|
@@ -1079,8 +1104,6 @@ declare const uploadListProps: {
|
|
|
1079
1104
|
type: BooleanConstructor;
|
|
1080
1105
|
default: boolean;
|
|
1081
1106
|
};
|
|
1082
|
-
reUploadable: BooleanConstructor;
|
|
1083
|
-
reUploadTip: FunctionConstructor;
|
|
1084
1107
|
tiny_mode: StringConstructor;
|
|
1085
1108
|
tiny_mode_root: BooleanConstructor;
|
|
1086
1109
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { H as IUploadListApi, J as IUploadListProps, K as IUploadListRenderlessParamUtils, L as IUploadListRenderlessParams, G as IUploadListState, M as IUploadListVideoParam } from './upload-list.type-
|
|
2
|
+
export { H as IUploadListApi, J as IUploadListProps, K as IUploadListRenderlessParamUtils, L as IUploadListRenderlessParams, G as IUploadListState, M as IUploadListVideoParam } from './upload-list.type-a29aea50.js';
|
|
3
3
|
import './shared.type.js';
|
package/types/upload.type.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { d as IUploadApi, i as IUploadFormData, k as IUploadOptionsOfHwh5, j as IUploadOptionsOfPost, e as IUploadProps, h as IUploadRenderlessOtherParams, f as IUploadRenderlessParamUtils, g as IUploadRenderlessParams, c as IUploadState, b as IUploadStateHeader } from './upload-list.type-
|
|
2
|
+
export { d as IUploadApi, i as IUploadFormData, k as IUploadOptionsOfHwh5, j as IUploadOptionsOfPost, e as IUploadProps, h as IUploadRenderlessOtherParams, f as IUploadRenderlessParamUtils, g as IUploadRenderlessParams, c as IUploadState, b as IUploadStateHeader } from './upload-list.type-a29aea50.js';
|
|
3
3
|
import './shared.type.js';
|
|
@@ -1,2 +1,147 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
1
3
|
|
|
2
|
-
|
|
4
|
+
declare const $constants: {
|
|
5
|
+
ITEM_NAME: string;
|
|
6
|
+
};
|
|
7
|
+
declare const userHeadProps: {
|
|
8
|
+
_constants: {
|
|
9
|
+
type: ObjectConstructor;
|
|
10
|
+
default: () => {
|
|
11
|
+
ITEM_NAME: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @property {Boolean} [min=false] - 小尺寸模式
|
|
16
|
+
*/
|
|
17
|
+
min: BooleanConstructor;
|
|
18
|
+
/**
|
|
19
|
+
* @property {Boolean} [round=true] - 圆形模式
|
|
20
|
+
*/
|
|
21
|
+
round: BooleanConstructor;
|
|
22
|
+
/**
|
|
23
|
+
* @property {String} [color=#ffffff] - 文字颜色
|
|
24
|
+
*/
|
|
25
|
+
color: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @property {String} [backgroundColor=#BBBBBB] - 背景色
|
|
31
|
+
*/
|
|
32
|
+
backgroundColor: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* @property {String} [type=label] - 头像类型,icon|image|label 可选
|
|
38
|
+
*/
|
|
39
|
+
type: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
validator: (value: string) => boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @property {String} - 头像资源
|
|
46
|
+
* type=icon 时为图标类名,type=label时为字体串,type=image时为资源路径
|
|
47
|
+
*/
|
|
48
|
+
value: {
|
|
49
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
50
|
+
default: null;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* @property {String} - 头像资源
|
|
54
|
+
* type=icon 时为图标类名,type=label时为字体串,type=image时为资源路径
|
|
55
|
+
*/
|
|
56
|
+
modelValue: {
|
|
57
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
58
|
+
default: null;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @property {Number} - 消息计数
|
|
62
|
+
*/
|
|
63
|
+
messageTotal: NumberConstructor;
|
|
64
|
+
/**
|
|
65
|
+
* @property {String} [messageType=details] - 消息类型 details|basic 可选
|
|
66
|
+
*/
|
|
67
|
+
messageType: {
|
|
68
|
+
type: StringConstructor;
|
|
69
|
+
default: string;
|
|
70
|
+
validator: (value: string) => boolean;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* @property {Number} [messageUpperLimit=0] - 消息显示上限
|
|
74
|
+
*/
|
|
75
|
+
messageUpperLimit: {
|
|
76
|
+
type: NumberConstructor;
|
|
77
|
+
default: number;
|
|
78
|
+
};
|
|
79
|
+
size: {
|
|
80
|
+
type: NumberConstructor;
|
|
81
|
+
default: number;
|
|
82
|
+
};
|
|
83
|
+
tiny_mode: StringConstructor;
|
|
84
|
+
tiny_mode_root: BooleanConstructor;
|
|
85
|
+
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
86
|
+
tiny_renderless: FunctionConstructor;
|
|
87
|
+
tiny_theme: StringConstructor;
|
|
88
|
+
tiny_chart_theme: ObjectConstructor;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Copyright (c) 2022 - present TinyVue Authors.
|
|
93
|
+
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
|
|
94
|
+
*
|
|
95
|
+
* Use of this source code is governed by an MIT-style license.
|
|
96
|
+
*
|
|
97
|
+
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
|
98
|
+
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
|
99
|
+
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
|
100
|
+
*
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
declare const computedStyle: ({ state, props }: Pick<IUserHeadRenderlessParams, 'state' | 'props'>) => () => {
|
|
104
|
+
fill: string;
|
|
105
|
+
color: string;
|
|
106
|
+
backgroundColor: string;
|
|
107
|
+
backgroundImage: string;
|
|
108
|
+
};
|
|
109
|
+
declare const computedMessage: ({ props }: Pick<IUserHeadRenderlessParams, 'props'>) => () => string;
|
|
110
|
+
declare const computedFontSize: ({ props, state, mode }: Pick<IUserHeadRenderlessParams, 'props' | 'state' | 'mode'>) => () => {
|
|
111
|
+
fontSize: string;
|
|
112
|
+
};
|
|
113
|
+
declare const computedLabel: ({ state, props }: Pick<IUserHeadRenderlessParams, 'state' | 'props'>) => () => any;
|
|
114
|
+
declare const getInternalValue: ({ props }: Pick<IUserHeadRenderlessParams, 'props'>) => () => string | Record<string, any>;
|
|
115
|
+
|
|
116
|
+
interface IUserHeadState {
|
|
117
|
+
internalValue: string | Record<string, any>;
|
|
118
|
+
label: string;
|
|
119
|
+
style: ReturnType<ReturnType<typeof computedStyle>>;
|
|
120
|
+
message: string;
|
|
121
|
+
fontSize: {
|
|
122
|
+
fontSize: string;
|
|
123
|
+
};
|
|
124
|
+
size: number;
|
|
125
|
+
color: string;
|
|
126
|
+
backgroundColor: string;
|
|
127
|
+
}
|
|
128
|
+
type IUserHeadProps = ExtractPropTypes<typeof userHeadProps>;
|
|
129
|
+
type IUserHeadConstants = typeof $constants;
|
|
130
|
+
type IUserHeadRenderlessParams = ISharedRenderlessFunctionParams<IUserHeadConstants> & {
|
|
131
|
+
api: IUserHeadApi;
|
|
132
|
+
state: IUserHeadState;
|
|
133
|
+
props: IUserHeadProps;
|
|
134
|
+
};
|
|
135
|
+
interface IUserHeadApi {
|
|
136
|
+
state: IUserHeadState;
|
|
137
|
+
computedLabel: ReturnType<typeof computedLabel>;
|
|
138
|
+
computedStyle: ReturnType<typeof computedStyle>;
|
|
139
|
+
computedMessage: ReturnType<typeof computedMessage>;
|
|
140
|
+
computedFontSize: ReturnType<typeof computedFontSize>;
|
|
141
|
+
getInternalValue: ReturnType<typeof getInternalValue>;
|
|
142
|
+
handleClick: (event: Event) => void;
|
|
143
|
+
mouseEnter: (event: Event) => void;
|
|
144
|
+
}
|
|
145
|
+
type IUserHeadRenderlessParamUtils = ISharedRenderlessParamUtils<IUserHeadConstants>;
|
|
146
|
+
|
|
147
|
+
export { IUserHeadApi, IUserHeadConstants, IUserHeadProps, IUserHeadRenderlessParamUtils, IUserHeadRenderlessParams, IUserHeadState };
|
package/types/wizard.type.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ interface IWizardState {
|
|
|
62
62
|
doing: string;
|
|
63
63
|
ready: string;
|
|
64
64
|
wait: string;
|
|
65
|
+
iconYes: 'tiny-icon-yes' | 'tiny-icon-successful';
|
|
65
66
|
}
|
|
66
67
|
type IWizardConstants = typeof $constants;
|
|
67
68
|
type IWizardRenderlessParams = ISharedRenderlessFunctionParams<IWizardConstants> & {
|
package/upload/index.js
CHANGED
|
@@ -95,11 +95,8 @@ const uploadFiles = ({
|
|
|
95
95
|
}
|
|
96
96
|
return folderAry.length < 7;
|
|
97
97
|
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (!props.multiple) {
|
|
101
|
-
postFiles = postFiles.slice(0, 1);
|
|
102
|
-
}
|
|
98
|
+
} else if (!props.multiple) {
|
|
99
|
+
postFiles = postFiles.slice(0, 1);
|
|
103
100
|
}
|
|
104
101
|
if (postFiles.length === 0) {
|
|
105
102
|
return;
|
|
@@ -147,16 +144,17 @@ const upload = ({ api, props, refs }) => (rawFile) => {
|
|
|
147
144
|
const abort = ({ state, props, constants }) => (file) => {
|
|
148
145
|
const { reqs } = state;
|
|
149
146
|
const cancel = function(uid) {
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
var _a;
|
|
148
|
+
if ((_a = reqs[uid]) == null ? void 0 : _a.abort) {
|
|
149
|
+
reqs[uid].abort("");
|
|
152
150
|
} else if (state.cancelToken[uid]) {
|
|
153
|
-
state.cancelToken[uid]();
|
|
151
|
+
state.cancelToken[uid]("");
|
|
154
152
|
}
|
|
155
153
|
delete reqs[uid];
|
|
156
154
|
delete state.cancelToken[uid];
|
|
157
155
|
};
|
|
158
156
|
if (file && file.isLargeFile && file.cancelToken) {
|
|
159
|
-
file.cancelToken && file.cancelToken.forEach((cancel2) => cancel2());
|
|
157
|
+
file.cancelToken && file.cancelToken.forEach((cancel2) => cancel2(""));
|
|
160
158
|
delete file.cancelToken;
|
|
161
159
|
} else if (file) {
|
|
162
160
|
let uid = file;
|
|
@@ -166,9 +164,9 @@ const abort = ({ state, props, constants }) => (file) => {
|
|
|
166
164
|
cancel(uid);
|
|
167
165
|
} else {
|
|
168
166
|
const { READY, UPLOADING, FAIL } = constants.FILE_STATUS;
|
|
169
|
-
Object.keys(reqs).forEach((uid) => cancel(uid));
|
|
167
|
+
Object.keys(reqs).forEach((uid) => cancel(uid || ""));
|
|
170
168
|
props.fileList.forEach((file2) => {
|
|
171
|
-
file2.cancelToken && file2.cancelToken.forEach((cancel2) => cancel2());
|
|
169
|
+
file2.cancelToken && file2.cancelToken.forEach((cancel2) => cancel2(""));
|
|
172
170
|
if ([READY, UPLOADING].includes(file2.status)) {
|
|
173
171
|
file2.status = FAIL;
|
|
174
172
|
}
|
|
@@ -265,31 +263,32 @@ const getOptionsOfHwh5 = ({
|
|
|
265
263
|
uploaderInner,
|
|
266
264
|
uid
|
|
267
265
|
}) => {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
266
|
+
const edm = uploaderInner.edm;
|
|
267
|
+
const params = edm && edm.upload && edm.upload.params || {};
|
|
268
|
+
return Object.assign(
|
|
269
|
+
{
|
|
270
|
+
edmAuth: {
|
|
271
|
+
edmToken: props.edmToken.edmToken,
|
|
272
|
+
appId: uploaderInner.hwh5.appId
|
|
273
|
+
},
|
|
274
|
+
filePath: rawFile.filePath,
|
|
275
|
+
progress: 1
|
|
272
276
|
},
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
if (props.onProgress) {
|
|
277
|
+
params,
|
|
278
|
+
{
|
|
279
|
+
onProgress: (data) => {
|
|
277
280
|
props.onProgress(data, rawFile);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
onSuccess: (res) => {
|
|
281
|
-
if (props.onSuccess) {
|
|
281
|
+
},
|
|
282
|
+
onSuccess: (res) => {
|
|
282
283
|
props.onSuccess(res, rawFile);
|
|
284
|
+
delete state.reqs[uid];
|
|
285
|
+
},
|
|
286
|
+
onError: (error) => {
|
|
287
|
+
props.onError(error, rawFile);
|
|
288
|
+
delete state.reqs[uid];
|
|
283
289
|
}
|
|
284
|
-
delete state.reqs[uid];
|
|
285
|
-
},
|
|
286
|
-
onError: (error) => {
|
|
287
|
-
if (props.onProgress) {
|
|
288
|
-
props.onProgress(error, rawFile);
|
|
289
|
-
}
|
|
290
|
-
delete state.reqs[uid];
|
|
291
290
|
}
|
|
292
|
-
|
|
291
|
+
);
|
|
293
292
|
};
|
|
294
293
|
const post = ({
|
|
295
294
|
api,
|
|
@@ -325,11 +324,42 @@ const post = ({
|
|
|
325
324
|
excuteReq(options);
|
|
326
325
|
}
|
|
327
326
|
};
|
|
328
|
-
const handleClick = ({ props, refs }) => ($event, type) => {
|
|
329
|
-
if (
|
|
330
|
-
|
|
327
|
+
const handleClick = ({ props, refs, state }) => ($event, type) => {
|
|
328
|
+
if (props.disabled || props.displayOnly || state.isStopPropagation) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const { uploader, uploadInner } = state;
|
|
332
|
+
const { encryptConfig = {} } = uploader;
|
|
333
|
+
const fileUploadVm = uploadInner.$parent;
|
|
334
|
+
const inputHandler = () => {
|
|
335
|
+
typeof props.handleTriggerClick === "function" && props.handleTriggerClick($event, type);
|
|
336
|
+
if (props.isHwh5) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
331
339
|
refs.input.value = null;
|
|
340
|
+
state.isStopPropagation = true;
|
|
332
341
|
refs.input.click();
|
|
342
|
+
state.isStopPropagation = false;
|
|
343
|
+
};
|
|
344
|
+
if (typeof uploader.beforeAddFile === "function") {
|
|
345
|
+
$event.preventDefault();
|
|
346
|
+
let isPromise;
|
|
347
|
+
const promise = uploader.beforeAddFile(() => {
|
|
348
|
+
!isPromise && inputHandler();
|
|
349
|
+
});
|
|
350
|
+
isPromise = promise && typeof promise.then === "function";
|
|
351
|
+
if (isPromise) {
|
|
352
|
+
promise.then(() => inputHandler()).catch(() => null);
|
|
353
|
+
} else if (promise) {
|
|
354
|
+
inputHandler();
|
|
355
|
+
}
|
|
356
|
+
} else if (encryptConfig && encryptConfig.enabled && fileUploadVm) {
|
|
357
|
+
fileUploadVm.state.encryptDialogConfig.show = true;
|
|
358
|
+
fileUploadVm.state.encryptDialogConfig.selectFileMethod = () => {
|
|
359
|
+
inputHandler();
|
|
360
|
+
};
|
|
361
|
+
} else {
|
|
362
|
+
inputHandler();
|
|
333
363
|
}
|
|
334
364
|
};
|
|
335
365
|
const handleKeydown = (api) => (event) => {
|
package/upload/vue.js
CHANGED
|
@@ -27,17 +27,20 @@ const api = [
|
|
|
27
27
|
"handleKeydown",
|
|
28
28
|
"handleUpdate"
|
|
29
29
|
];
|
|
30
|
-
const renderless = (props, { computed, inject, reactive, onMounted, onBeforeUnmount }, { refs, service, t }, { Modal }) => {
|
|
30
|
+
const renderless = (props, { computed, inject, reactive, onMounted, onBeforeUnmount }, { refs, service, t, useBreakpoint }, { Modal }) => {
|
|
31
31
|
const api2 = {};
|
|
32
32
|
const uploader = inject("uploader");
|
|
33
33
|
const constants = uploader.$constants;
|
|
34
|
+
const { current } = useBreakpoint();
|
|
34
35
|
const state = reactive({
|
|
36
|
+
currentBreakpoint: current,
|
|
35
37
|
mouseover: false,
|
|
36
38
|
reqs: {},
|
|
37
39
|
uploader,
|
|
38
40
|
accecpt: "",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
uploadInner: computed(() => state.uploader.$refs[constants.FILE_UPLOAD_INNER_TEMPLATE]),
|
|
42
|
+
isEdm: computed(() => state.uploadInner.state.isEdm),
|
|
43
|
+
openEdmDownload: computed(() => state.uploadInner.edm.download),
|
|
41
44
|
headers: computed(() => {
|
|
42
45
|
if (state.isEdm) {
|
|
43
46
|
return {
|
|
@@ -49,14 +52,15 @@ const renderless = (props, { computed, inject, reactive, onMounted, onBeforeUnmo
|
|
|
49
52
|
formData: {},
|
|
50
53
|
cancelToken: {},
|
|
51
54
|
updateId: "",
|
|
52
|
-
updateInput: null
|
|
55
|
+
updateInput: null,
|
|
56
|
+
isStopPropagation: false
|
|
53
57
|
});
|
|
54
58
|
Object.assign(api2, {
|
|
55
59
|
state,
|
|
56
60
|
isImage,
|
|
57
61
|
abort: abort({ state, props, constants }),
|
|
58
62
|
getFormData: getFormData({ state, constants, props }),
|
|
59
|
-
handleClick: handleClick({ props, refs }),
|
|
63
|
+
handleClick: handleClick({ props, refs, state }),
|
|
60
64
|
onBeforeDestroy: onBeforeDestroy(state),
|
|
61
65
|
handleUpdate: handleUpdate({ state, props }),
|
|
62
66
|
uploadFiles: uploadFiles({ constants, Modal, props, state, t }),
|
package/upload-dragger/index.js
CHANGED
|
@@ -13,27 +13,29 @@ const onDrop = ({ emit, props, state }) => (event) => {
|
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
const notAcceptedFiles = [];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
if (files) {
|
|
17
|
+
Array.from(files).filter((file) => {
|
|
18
|
+
const { type, name } = file;
|
|
19
|
+
const extension = name.includes(".") ? `.${name.split(".").pop()}` : "";
|
|
20
|
+
const baseType = type.replace(/\/.*$/, "");
|
|
21
|
+
let isValid = accept.split(",").map((type2) => type2.trim()).filter((type2) => type2).some((type2) => {
|
|
22
|
+
if (/\..+$/.test(type2)) {
|
|
23
|
+
return extension === type2;
|
|
24
|
+
}
|
|
25
|
+
if (/\/\*$/.test(type2)) {
|
|
26
|
+
return baseType === type2.replace(/\/\*$/, "");
|
|
27
|
+
}
|
|
28
|
+
if (/^[^/]+\/[^/]+$/.test(type2)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
});
|
|
33
|
+
!isValid && notAcceptedFiles.push(file);
|
|
34
|
+
return isValid;
|
|
31
35
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
notAcceptedFiles.length && state.uploader.$emit("drop-error", notAcceptedFiles);
|
|
36
|
-
emit("file", filteredFile);
|
|
36
|
+
notAcceptedFiles.length && state.uploader.$emit("drop-error", notAcceptedFiles);
|
|
37
|
+
}
|
|
38
|
+
emit("file", files);
|
|
37
39
|
};
|
|
38
40
|
const watchDragover = ({ state, constants }) => () => {
|
|
39
41
|
state.uploader.$refs[constants.FILE_UPLOAD_INNER_TEMPLATE].$emit("drag-over", state.dragover);
|
package/upload-list/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const picturefilePreview = (state) => (index) => {
|
|
|
40
40
|
const getDeleteData = (emit) => (data) => {
|
|
41
41
|
emit("remove", data);
|
|
42
42
|
};
|
|
43
|
-
const showOperatePanel = ({ state }) => (file) => {
|
|
43
|
+
const showOperatePanel = ({ state }) => ({ file }) => {
|
|
44
44
|
state.currentFile = file;
|
|
45
45
|
state.showPanel = true;
|
|
46
46
|
};
|
|
@@ -96,43 +96,43 @@ const getFileIcon = ({ constants }) => ({ type }) => {
|
|
|
96
96
|
let iconTypes = {
|
|
97
97
|
[EXCEL]: {
|
|
98
98
|
name: "icon-excel-type",
|
|
99
|
-
color: "#
|
|
99
|
+
color: "#09AA71"
|
|
100
100
|
},
|
|
101
101
|
[FILE]: {
|
|
102
102
|
name: "icon-file-type",
|
|
103
|
-
color: "#
|
|
103
|
+
color: "#09AA71"
|
|
104
104
|
},
|
|
105
105
|
[PDF]: {
|
|
106
106
|
name: "icon-pdf-type",
|
|
107
|
-
color: "#
|
|
107
|
+
color: "#E02128"
|
|
108
108
|
},
|
|
109
109
|
[PICTURE]: {
|
|
110
110
|
name: "icon-picture-type",
|
|
111
|
-
color: "#
|
|
111
|
+
color: "#5531EB"
|
|
112
112
|
},
|
|
113
113
|
[PPT]: {
|
|
114
114
|
name: "icon-ppt-type",
|
|
115
|
-
color: "#
|
|
115
|
+
color: "#E02128"
|
|
116
116
|
},
|
|
117
117
|
[TEXT]: {
|
|
118
118
|
name: "icon-text-type",
|
|
119
|
-
color: "#
|
|
119
|
+
color: "#2CB8C9"
|
|
120
120
|
},
|
|
121
121
|
[WORD]: {
|
|
122
122
|
name: "icon-word-type",
|
|
123
|
-
color: "#
|
|
123
|
+
color: "#0067D1"
|
|
124
124
|
},
|
|
125
125
|
[ZIP]: {
|
|
126
126
|
name: "icon-zip-type",
|
|
127
|
-
color: "#
|
|
127
|
+
color: "#2CB8C9"
|
|
128
128
|
},
|
|
129
129
|
[VIDEO]: {
|
|
130
130
|
name: "icon-video-type",
|
|
131
|
-
color: "#
|
|
131
|
+
color: "#0067D1"
|
|
132
132
|
},
|
|
133
133
|
[AUDIO]: {
|
|
134
134
|
name: "icon-audio",
|
|
135
|
-
color: "#
|
|
135
|
+
color: "#5531EB"
|
|
136
136
|
},
|
|
137
137
|
default: {
|
|
138
138
|
name: "icon-other-type",
|
|
@@ -153,11 +153,11 @@ const calcUploadListLiWidth = ({ vm, nextTick, props, constants }) => () => {
|
|
|
153
153
|
const { listType } = props;
|
|
154
154
|
const { LIST_TYPE } = constants;
|
|
155
155
|
nextTick(() => {
|
|
156
|
-
const uploadListEle = vm.$refs
|
|
157
|
-
const uploadListLiEle =
|
|
156
|
+
const uploadListEle = vm.$refs.uploadList;
|
|
157
|
+
const uploadListLiEle = uploadListEle && uploadListEle.querySelectorAll('[data-tag="tiny-upload-list-item"]');
|
|
158
158
|
if (!uploadListEle || !(uploadListLiEle && uploadListLiEle[0]))
|
|
159
159
|
return;
|
|
160
|
-
if (listType === LIST_TYPE.TEXT) {
|
|
160
|
+
if (listType === LIST_TYPE.TEXT || listType === LIST_TYPE.SAAS) {
|
|
161
161
|
const { minWidth } = window.getComputedStyle(uploadListLiEle && uploadListLiEle[0]);
|
|
162
162
|
const marginRight = 8;
|
|
163
163
|
const num = Math.floor(uploadListEle.offsetWidth / (parseFloat(minWidth) + marginRight));
|
|
@@ -213,11 +213,17 @@ const handleTriggerClick = ({ state, props }) => ($event, type) => {
|
|
|
213
213
|
});
|
|
214
214
|
};
|
|
215
215
|
const mounted = ({ api, vm }) => () => {
|
|
216
|
-
const el = vm.$refs
|
|
217
|
-
|
|
216
|
+
const el = vm.$refs.uploadList;
|
|
217
|
+
if (el) {
|
|
218
|
+
addResizeListener(el, api.calcUploadListLiWidth);
|
|
219
|
+
vm._removeResizeListener = () => removeResizeListener(el, api.calcUploadListLiWidth);
|
|
220
|
+
}
|
|
218
221
|
};
|
|
219
|
-
const destroyed = ({
|
|
220
|
-
|
|
222
|
+
const destroyed = ({ props, vm }) => () => {
|
|
223
|
+
if (vm._removeResizeListener) {
|
|
224
|
+
vm._removeResizeListener();
|
|
225
|
+
vm._removeResizeListener = null;
|
|
226
|
+
}
|
|
221
227
|
props.files.forEach((file) => {
|
|
222
228
|
removePlayEventListener({ type: "ended", el: file.el }, file.playEvent);
|
|
223
229
|
delete file.playEvent;
|