@opentiny/vue-renderless 3.13.2 → 3.14.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/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/bigInt.js +2 -2
- package/common/date.js +7 -5
- package/common/deps/clickoutside.js +6 -2
- package/common/deps/date-util.js +4 -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 +15 -6
- package/date-table/index.js +35 -53
- package/date-table/vue.js +4 -2
- 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 +48 -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 +290 -77
- package/picker/mb.js +42 -0
- package/picker/vue.js +76 -20
- 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 +73 -34
- 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 +442 -393
- package/select/vue.js +278 -164
- 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 +29 -3
- 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/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 +6 -0
- package/types/collapse.type.d.ts +19 -2
- package/types/date-picker.type.d.ts +38 -1
- 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-a2dc0099.d.ts} +4 -1
- 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 +2 -6
- 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/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 +12 -0
- package/types/picker.type.d.ts +18 -0
- package/types/popconfirm.type.d.ts +86 -1
- package/types/popeditor.type.d.ts +4 -0
- package/types/popover.type.d.ts +3 -3
- package/types/progress.type.d.ts +2 -0
- 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 +14 -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 +1 -1
- package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-6d6e3d0e.d.ts} +35 -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 +35 -26
- 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
package/drawer/vue.js
CHANGED
|
@@ -11,22 +11,27 @@ import {
|
|
|
11
11
|
removeDragEvent,
|
|
12
12
|
showScrollbar,
|
|
13
13
|
hideScrollbar,
|
|
14
|
-
watchVisibleNotImmediate
|
|
14
|
+
watchVisibleNotImmediate,
|
|
15
|
+
handleClose,
|
|
16
|
+
computedWidth
|
|
15
17
|
} from "./index";
|
|
16
|
-
const api = ["state", "close", "confirm"];
|
|
17
|
-
const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, computed }, { emit, vm, mode, constants }) => {
|
|
18
|
+
const api = ["state", "close", "confirm", "handleClose"];
|
|
19
|
+
const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, computed }, { emit, vm, mode, constants, designConfig }) => {
|
|
20
|
+
var _a;
|
|
18
21
|
const lockScrollClass = constants.SCROLL_LOCK_CLASS(mode);
|
|
19
22
|
const api2 = {};
|
|
20
23
|
const state = reactive({
|
|
21
24
|
toggle: false,
|
|
22
25
|
width: 0,
|
|
23
26
|
dragEvent: { x: 0, isDrag: false, offsetWidth: 0 },
|
|
24
|
-
computedWidth: computed(() =>
|
|
27
|
+
computedWidth: computed(() => api2.computedWidth()),
|
|
28
|
+
btnOrderReversed: vm.theme === "saas" || ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.btnOrderReversed)
|
|
25
29
|
});
|
|
26
30
|
Object.assign(api2, {
|
|
27
31
|
state,
|
|
28
|
-
confirm: confirm({
|
|
29
|
-
close: close({
|
|
32
|
+
confirm: confirm({ api: api2 }),
|
|
33
|
+
close: close({ api: api2 }),
|
|
34
|
+
handleClose: handleClose({ emit, props, state }),
|
|
30
35
|
mousedown: mousedown({ state, vm }),
|
|
31
36
|
mousemove: mousemove({ state, props }),
|
|
32
37
|
mouseup: mouseup({ state }),
|
|
@@ -36,11 +41,13 @@ const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, comput
|
|
|
36
41
|
watchToggle: watchToggle({ emit }),
|
|
37
42
|
showScrollbar: showScrollbar(lockScrollClass),
|
|
38
43
|
hideScrollbar: hideScrollbar(lockScrollClass),
|
|
39
|
-
watchVisibleNotImmediate: watchVisibleNotImmediate({ api: api2, props })
|
|
44
|
+
watchVisibleNotImmediate: watchVisibleNotImmediate({ api: api2, props }),
|
|
45
|
+
computedWidth: computedWidth({ state, designConfig, props, constants })
|
|
40
46
|
});
|
|
41
47
|
onMounted(() => {
|
|
42
48
|
props.dragable && api2.addDragEvent();
|
|
43
49
|
if (props.lockScroll && props.visible) {
|
|
50
|
+
;
|
|
44
51
|
api2.showScrollbar();
|
|
45
52
|
}
|
|
46
53
|
});
|
package/dropdown/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const show = ({ props, state }) => () => {
|
|
|
20
20
|
() => {
|
|
21
21
|
state.visible = true;
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
state.trigger === "click" ? 0 : props.showTimeout
|
|
24
24
|
);
|
|
25
25
|
};
|
|
26
26
|
const hide = ({ api, props, state }) => () => {
|
|
@@ -36,7 +36,7 @@ const hide = ({ api, props, state }) => () => {
|
|
|
36
36
|
() => {
|
|
37
37
|
state.visible = false;
|
|
38
38
|
},
|
|
39
|
-
|
|
39
|
+
state.trigger === "click" ? 0 : props.hideTimeout
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
42
|
const handleClick = ({ api, props, state, emit }) => () => {
|
|
@@ -128,12 +128,12 @@ const initEvent = ({ api, props, state, vm, mode }) => () => {
|
|
|
128
128
|
on(state.triggerElm, "blur", toggleFocus({ state, value: false }));
|
|
129
129
|
on(state.triggerElm, "click", toggleFocus({ state, value: false }));
|
|
130
130
|
}
|
|
131
|
-
if (
|
|
131
|
+
if (state.trigger === "hover") {
|
|
132
132
|
on(state.triggerElm, "mouseenter", api.show);
|
|
133
133
|
on(state.triggerElm, "mouseleave", api.hide);
|
|
134
134
|
on(state.dropdownElm, "mouseenter", api.show);
|
|
135
135
|
on(state.dropdownElm, "mouseleave", api.hide);
|
|
136
|
-
} else if (
|
|
136
|
+
} else if (state.trigger === "click") {
|
|
137
137
|
on(state.triggerElm, "click", api.handleClick);
|
|
138
138
|
}
|
|
139
139
|
if (mode === "mobile-first") {
|
|
@@ -173,8 +173,8 @@ const mounted = ({ api, vm, state, broadcast }) => () => {
|
|
|
173
173
|
}
|
|
174
174
|
vm.$on("menu-item-click", api.handleMenuItemClick);
|
|
175
175
|
vm.$on("current-item-click", api.handleMenuItemClick);
|
|
176
|
-
vm.$on("
|
|
177
|
-
broadcast("TinyDropdownMenu", "
|
|
176
|
+
vm.$on("selected-index", (selectedIndex) => {
|
|
177
|
+
broadcast("TinyDropdownMenu", "menu-selected-index", selectedIndex);
|
|
178
178
|
});
|
|
179
179
|
vm.$on("is-disabled", api.clickOutside);
|
|
180
180
|
};
|
|
@@ -196,7 +196,7 @@ const beforeDistory = ({ api, state }) => () => {
|
|
|
196
196
|
state.dropdownElm = null;
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
|
-
const clickOutside = ({ props, api
|
|
199
|
+
const clickOutside = ({ props, api }) => (disabled) => {
|
|
200
200
|
if (props.hideOnClick) {
|
|
201
201
|
disabled ? api.show() : api.hide();
|
|
202
202
|
}
|
package/dropdown/vue.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
clickOutside
|
|
22
22
|
} from "./index";
|
|
23
23
|
const api = ["state", "handleMainButtonClick", "hide", "show", "initDomOperation", "handleClick", "clickOutside"];
|
|
24
|
-
const renderless = (props, { reactive, watch, provide, onMounted }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
|
|
24
|
+
const renderless = (props, { reactive, watch, provide, onMounted, computed }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
|
|
25
25
|
const api2 = {};
|
|
26
26
|
const state = reactive({
|
|
27
27
|
visible: false,
|
|
@@ -34,7 +34,11 @@ const renderless = (props, { reactive, watch, provide, onMounted }, { emit, pare
|
|
|
34
34
|
listId: `dropdown-menu-${guid()}`,
|
|
35
35
|
showIcon: props.showIcon,
|
|
36
36
|
showSelfIcon: props.showSelfIcon,
|
|
37
|
-
designConfig
|
|
37
|
+
designConfig,
|
|
38
|
+
trigger: computed(() => {
|
|
39
|
+
var _a;
|
|
40
|
+
return props.trigger || ((_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.trigger) || "hover";
|
|
41
|
+
})
|
|
38
42
|
});
|
|
39
43
|
provide("dropdownVm", vm);
|
|
40
44
|
Object.assign(api2, {
|
package/dropdown-item/index.js
CHANGED
|
@@ -89,14 +89,22 @@ const clickOutside = (parent) => () => {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
const handleClick = ({
|
|
92
|
+
const handleClick = ({
|
|
93
|
+
state,
|
|
94
|
+
props,
|
|
95
|
+
dispatch,
|
|
96
|
+
vm,
|
|
97
|
+
emit
|
|
98
|
+
}) => (event) => {
|
|
93
99
|
event.stopPropagation();
|
|
100
|
+
state.currentIndex = `${props.currentIndex}`;
|
|
94
101
|
const data = { itemData: props.itemData, vm, disabled: props.disabled };
|
|
95
102
|
if (!props.disabled) {
|
|
96
103
|
emit("item-click", data);
|
|
97
104
|
}
|
|
98
105
|
dispatch("TinyDropdown", "menu-item-click", data);
|
|
99
106
|
dispatch("TinyDropdown", "is-disabled", [props.disabled]);
|
|
107
|
+
dispatch("TinyDropdown", "selected-index", [state.currentIndex]);
|
|
100
108
|
};
|
|
101
109
|
const computedGetIcon = ({ constants, designConfig }) => (name = "leftWardArrow") => {
|
|
102
110
|
return (designConfig == null ? void 0 : designConfig.icons[name]) || (constants == null ? void 0 : constants.ICON_MAP[name]);
|
package/dropdown-item/mf.js
CHANGED
|
@@ -3,12 +3,11 @@ import { omitText } from "../common/string";
|
|
|
3
3
|
const api = ["dataStore", "handleClick", "dataStore", "mouseEnter", "mouseLeave"];
|
|
4
4
|
const renderless = (props, { reactive, inject }, { dispatch, vm }) => {
|
|
5
5
|
const api2 = {};
|
|
6
|
-
const dropdownMenuVm = inject("dropdownMenuVm");
|
|
7
|
-
const multiStage = inject("multiStage");
|
|
6
|
+
const dropdownMenuVm = inject("dropdownMenuVm", null);
|
|
8
7
|
let dataStore = reactive({
|
|
9
|
-
checkedStatus: dropdownMenuVm.checkedStatus,
|
|
8
|
+
checkedStatus: dropdownMenuVm == null ? void 0 : dropdownMenuVm.checkedStatus,
|
|
10
9
|
multiStageMenu: "",
|
|
11
|
-
multiStage: "",
|
|
10
|
+
multiStage: inject("multiStage", null),
|
|
12
11
|
itemData: "",
|
|
13
12
|
itemLabel: "",
|
|
14
13
|
showContent: false,
|
|
@@ -16,9 +15,6 @@ const renderless = (props, { reactive, inject }, { dispatch, vm }) => {
|
|
|
16
15
|
currentIndex: props.currentIndex,
|
|
17
16
|
level: props.level
|
|
18
17
|
});
|
|
19
|
-
if (multiStage) {
|
|
20
|
-
dataStore.multiStageMenu = true;
|
|
21
|
-
}
|
|
22
18
|
const handleClick = ({ dataStore: dataStore2, props: props2, vm: vm2 }) => () => {
|
|
23
19
|
if (props2.disabled) {
|
|
24
20
|
dataStore2.checkedStatus = false;
|
|
@@ -31,7 +27,7 @@ const renderless = (props, { reactive, inject }, { dispatch, vm }) => {
|
|
|
31
27
|
} else {
|
|
32
28
|
dataStore2.currentIndex = `${props2.currentIndex}`;
|
|
33
29
|
}
|
|
34
|
-
dispatch("TinyDropdown", "
|
|
30
|
+
dispatch("TinyDropdown", "selected-index", [dataStore2.currentIndex]);
|
|
35
31
|
const data = {
|
|
36
32
|
itemData: dataStore2.itemData,
|
|
37
33
|
vm: vm2,
|
|
@@ -69,8 +65,8 @@ const renderless = (props, { reactive, inject }, { dispatch, vm }) => {
|
|
|
69
65
|
Object.assign(api2, {
|
|
70
66
|
dataStore,
|
|
71
67
|
handleClick: handleClick({ dataStore, props, vm }),
|
|
72
|
-
mouseEnter: mouseEnter({ dataStore, vm
|
|
73
|
-
mouseLeave: mouseLeave({ dataStore
|
|
68
|
+
mouseEnter: mouseEnter({ dataStore, vm }),
|
|
69
|
+
mouseLeave: mouseLeave({ dataStore })
|
|
74
70
|
});
|
|
75
71
|
return api2;
|
|
76
72
|
};
|
package/dropdown-item/vue.js
CHANGED
|
@@ -39,6 +39,7 @@ const api = [
|
|
|
39
39
|
];
|
|
40
40
|
const initState = ({ reactive, computed, api: api2, props, parent, dropdownMenuVm }) => {
|
|
41
41
|
const state = reactive({
|
|
42
|
+
checkedStatus: dropdownMenuVm == null ? void 0 : dropdownMenuVm.checkedStatus,
|
|
42
43
|
sort: props.modelValue,
|
|
43
44
|
transition: true,
|
|
44
45
|
getTitle: false,
|
|
@@ -52,9 +53,12 @@ const initState = ({ reactive, computed, api: api2, props, parent, dropdownMenuV
|
|
|
52
53
|
itemStyle: computed(() => api2.getItemStyle()),
|
|
53
54
|
activeColor: computed(() => parent.activeColor),
|
|
54
55
|
closeOnClickOverlay: computed(() => parent.closeOnClickOverlay),
|
|
56
|
+
dropdownMenuVm,
|
|
57
|
+
currentIndex: props.currentIndex,
|
|
55
58
|
textField: (dropdownMenuVm == null ? void 0 : dropdownMenuVm.textField) || props.textField,
|
|
56
59
|
popperClass: (dropdownMenuVm == null ? void 0 : dropdownMenuVm.popperClass) || "",
|
|
57
|
-
getIcon: computed(() => api2.computedGetIcon())
|
|
60
|
+
getIcon: computed(() => api2.computedGetIcon()),
|
|
61
|
+
children: []
|
|
58
62
|
});
|
|
59
63
|
return state;
|
|
60
64
|
};
|
|
@@ -77,21 +81,30 @@ const initApi = ({ api: api2, state, emit, props, parent, dispatch, vm, constant
|
|
|
77
81
|
getItemStyle: getItemStyle({ parent, state }),
|
|
78
82
|
bindScroll: bindScroll({ api: api2, parent }),
|
|
79
83
|
confirm: confirm({ emit, props, state }),
|
|
80
|
-
handleClick: handleClick({ props, dispatch, vm, emit }),
|
|
84
|
+
handleClick: handleClick({ state, props, dispatch, vm, emit }),
|
|
81
85
|
computedGetIcon: computedGetIcon({ constants, designConfig }),
|
|
82
86
|
getTip: getTip({ props, vm })
|
|
83
87
|
});
|
|
84
88
|
};
|
|
85
|
-
const renderless = (props, { computed, reactive, watch, inject }, { parent, emit, vm, dispatch,
|
|
89
|
+
const renderless = (props, { computed, onMounted, reactive, watch, inject }, { parent, emit, vm, dispatch, constants, designConfig }) => {
|
|
86
90
|
const api2 = {};
|
|
87
91
|
const dropdownMenuVm = inject("dropdownMenuVm", null);
|
|
88
|
-
if (mode === "mobile" && dropdownMenuVm) {
|
|
89
|
-
dropdownMenuVm.state.children = [...dropdownMenuVm.state.children, vm];
|
|
90
|
-
}
|
|
91
|
-
parent = parent.$parent;
|
|
92
92
|
const state = initState({ reactive, computed, api: api2, props, parent, dropdownMenuVm });
|
|
93
93
|
initApi({ api: api2, state, emit, props, parent, dispatch, vm, constants, designConfig });
|
|
94
94
|
watch(() => state.showPopup, api2.bindScroll);
|
|
95
|
+
onMounted(() => {
|
|
96
|
+
const realParent = parent.$parent.$parent || {};
|
|
97
|
+
if (realParent.state && realParent.state.children) {
|
|
98
|
+
realParent.state.children.push(vm);
|
|
99
|
+
} else {
|
|
100
|
+
if (dropdownMenuVm) {
|
|
101
|
+
dropdownMenuVm.state.children = [...dropdownMenuVm.state.children, vm];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (props.disabled) {
|
|
105
|
+
state.checkedStatus = false;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
95
108
|
return api2;
|
|
96
109
|
};
|
|
97
110
|
export {
|
package/dropdown-menu/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const toggleItem = (state) => (active, item) => {
|
|
|
6
6
|
if (item.disabled) {
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
|
-
if (item.type
|
|
9
|
+
if (item.type === "sort") {
|
|
10
10
|
if (!item.modelValue || item.modelValue === "desc") {
|
|
11
11
|
item.state.sort = "asc";
|
|
12
12
|
item.$emit("update:modelValue", "asc");
|
|
@@ -64,21 +64,34 @@ const getScroller = (el, root) => {
|
|
|
64
64
|
}
|
|
65
65
|
return root || null;
|
|
66
66
|
};
|
|
67
|
-
const useVuePopper = ({
|
|
67
|
+
const useVuePopper = ({
|
|
68
|
+
api,
|
|
69
|
+
props,
|
|
70
|
+
hooks,
|
|
71
|
+
instance,
|
|
72
|
+
state,
|
|
73
|
+
dropdownVm,
|
|
74
|
+
designConfig
|
|
75
|
+
}) => {
|
|
76
|
+
var _a, _b;
|
|
68
77
|
const { nextTick, onBeforeUnmount, onDeactivated, onMounted, reactive, toRefs, watch } = hooks;
|
|
69
|
-
const { emit,
|
|
78
|
+
const { emit, slots, vm, parent } = instance;
|
|
79
|
+
const designProps = {
|
|
80
|
+
placement: props.placement || ((_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.placement) || "bottom-end",
|
|
81
|
+
visibleArrow: props.visibleArrow || ((_b = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _b.visibleArrow) || false
|
|
82
|
+
};
|
|
70
83
|
const popper = userPopper({
|
|
71
84
|
emit,
|
|
72
85
|
nextTick,
|
|
73
86
|
onBeforeUnmount,
|
|
74
87
|
onDeactivated,
|
|
75
|
-
props: __spreadValues({
|
|
88
|
+
props: __spreadValues(__spreadValues({
|
|
76
89
|
popperOptions: { boundariesPadding: 0, gpuAcceleration: false },
|
|
77
90
|
offset: 0,
|
|
78
91
|
boundariesPadding: 5
|
|
79
|
-
}, props),
|
|
92
|
+
}, props), designProps),
|
|
80
93
|
reactive,
|
|
81
|
-
|
|
94
|
+
vm,
|
|
82
95
|
slots,
|
|
83
96
|
toRefs,
|
|
84
97
|
watch
|
|
@@ -118,7 +131,7 @@ const useVuePopper = ({ api, props, hooks, instance, state, dropdownVm }) => {
|
|
|
118
131
|
);
|
|
119
132
|
};
|
|
120
133
|
const mounted = ({ api, parent, state }) => () => {
|
|
121
|
-
parent.$on("
|
|
134
|
+
parent.$on("menu-selected-index", (selectedIndex) => {
|
|
122
135
|
state.selectedIndex = selectedIndex;
|
|
123
136
|
});
|
|
124
137
|
parent.$on("menu-item-click", api.handleMenuItemClick);
|
package/dropdown-menu/vue.js
CHANGED
|
@@ -22,7 +22,7 @@ const api = [
|
|
|
22
22
|
const renderless = (props, hooks, instance) => {
|
|
23
23
|
const api2 = {};
|
|
24
24
|
const { reactive, provide, onMounted, inject } = hooks;
|
|
25
|
-
const { nextTick, mode, vm, parent, dispatch, emit } = instance;
|
|
25
|
+
const { nextTick, mode, vm, parent, dispatch, emit, designConfig } = instance;
|
|
26
26
|
const state = reactive({
|
|
27
27
|
offset: 0,
|
|
28
28
|
scroller: null,
|
|
@@ -32,7 +32,8 @@ const renderless = (props, hooks, instance) => {
|
|
|
32
32
|
label: "",
|
|
33
33
|
showContent: false,
|
|
34
34
|
selected: false,
|
|
35
|
-
selectedIndex: -1
|
|
35
|
+
selectedIndex: -1,
|
|
36
|
+
canvasHeight: inject("change-size", null)
|
|
36
37
|
});
|
|
37
38
|
provide("dropdownMenuVm", vm);
|
|
38
39
|
provide("multiStage", props.multiStage);
|
|
@@ -42,7 +43,7 @@ const renderless = (props, hooks, instance) => {
|
|
|
42
43
|
state.scroller = getScroller(vm.$refs.menu);
|
|
43
44
|
});
|
|
44
45
|
} else {
|
|
45
|
-
useVuePopper({ api: api2, hooks, props, instance, state, dropdownVm });
|
|
46
|
+
useVuePopper({ api: api2, hooks, props, instance, state, dropdownVm, designConfig });
|
|
46
47
|
}
|
|
47
48
|
Object.assign(api2, {
|
|
48
49
|
state,
|
package/exception/index.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
const
|
|
3
|
-
const getMessage = ({ props, t }) => () => {
|
|
4
|
-
const types = ["build", "weaknet", "pcview", "busy", "noperm"];
|
|
5
|
-
return props.message || t(`ui.exception.${~types.indexOf(props.type) ? props.type : "nodata"}`);
|
|
6
|
-
};
|
|
2
|
+
const emitClick = (emit) => () => emit("click");
|
|
7
3
|
export {
|
|
8
|
-
|
|
9
|
-
getMessage
|
|
4
|
+
emitClick
|
|
10
5
|
};
|
package/exception/vue.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import {
|
|
2
|
+
import { emitClick } from "./index";
|
|
3
3
|
const api = ["state", "create"];
|
|
4
|
-
const renderless = (props, {
|
|
5
|
-
const api2 = {
|
|
6
|
-
create: create(emit),
|
|
7
|
-
getMessage: getMessage({ props, t })
|
|
8
|
-
};
|
|
4
|
+
const renderless = (props, { reactive }, { emit }) => {
|
|
9
5
|
const state = reactive({
|
|
10
|
-
urlType: props.type
|
|
11
|
-
images,
|
|
12
|
-
message: computed(() => api2.getMessage({ props, t }))
|
|
6
|
+
urlType: props.type
|
|
13
7
|
});
|
|
14
|
-
api2
|
|
8
|
+
const api2 = {
|
|
9
|
+
state,
|
|
10
|
+
create: emitClick(emit)
|
|
11
|
+
};
|
|
15
12
|
return api2;
|
|
16
13
|
};
|
|
17
14
|
export {
|
package/fall-menu/index.js
CHANGED
|
@@ -33,7 +33,11 @@ const computePx = ({ props, refs, state }) => () => {
|
|
|
33
33
|
const list = refs.list;
|
|
34
34
|
const width = list.parentElement.clientWidth;
|
|
35
35
|
const arr = list.querySelectorAll("li");
|
|
36
|
-
const set = {
|
|
36
|
+
const set = {
|
|
37
|
+
data: [],
|
|
38
|
+
offset: [],
|
|
39
|
+
index: []
|
|
40
|
+
};
|
|
37
41
|
const liWidth = [];
|
|
38
42
|
let innerwidth = 0;
|
|
39
43
|
let start = 0;
|
package/fall-menu/vue.js
CHANGED
|
@@ -12,7 +12,12 @@ import {
|
|
|
12
12
|
computeData
|
|
13
13
|
} from "./index";
|
|
14
14
|
const api = ["state", "fall", "arrowClick", "mouseover", "mouseout", "overContent", "reRender", "left"];
|
|
15
|
-
const initState = ({
|
|
15
|
+
const initState = ({
|
|
16
|
+
reactive,
|
|
17
|
+
computed,
|
|
18
|
+
api: api2,
|
|
19
|
+
props
|
|
20
|
+
}) => {
|
|
16
21
|
const state = reactive({
|
|
17
22
|
pager: 1,
|
|
18
23
|
level2data: [],
|
|
@@ -24,7 +29,13 @@ const initState = ({ reactive, computed, api: api2, props }) => {
|
|
|
24
29
|
});
|
|
25
30
|
return state;
|
|
26
31
|
};
|
|
27
|
-
const initApi = ({
|
|
32
|
+
const initApi = ({
|
|
33
|
+
api: api2,
|
|
34
|
+
state,
|
|
35
|
+
fall,
|
|
36
|
+
props,
|
|
37
|
+
refs
|
|
38
|
+
}) => {
|
|
28
39
|
Object.assign(api2, {
|
|
29
40
|
fall,
|
|
30
41
|
state,
|
package/file-upload/index.js
CHANGED
|
@@ -77,7 +77,7 @@ const watchListType = ({ constants, state, api }) => (type) => {
|
|
|
77
77
|
try {
|
|
78
78
|
file.url = URL.createObjectURL(file.raw);
|
|
79
79
|
} catch (err) {
|
|
80
|
-
return;
|
|
80
|
+
return null;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
return file;
|
|
@@ -412,7 +412,8 @@ const getFileHash = ({
|
|
|
412
412
|
};
|
|
413
413
|
});
|
|
414
414
|
};
|
|
415
|
-
const handleHwh5Files = (files) => {
|
|
415
|
+
const handleHwh5Files = (files, hwh5) => {
|
|
416
|
+
const fileMap = hwh5 && hwh5.fileMap;
|
|
416
417
|
return files.map((file) => {
|
|
417
418
|
if (file instanceof File)
|
|
418
419
|
return file;
|
|
@@ -427,7 +428,8 @@ const handleHwh5Files = (files) => {
|
|
|
427
428
|
const [name, index] = url.match(/[^/]*$/);
|
|
428
429
|
const [type] = url.match(/\.[^.]*$/);
|
|
429
430
|
const filePath = url.substring(0, index);
|
|
430
|
-
|
|
431
|
+
const updateFile2 = __spreadProps(__spreadValues({}, f), { type, name, filePath, webkitRelativePath: filePath });
|
|
432
|
+
return typeof fileMap === "function" ? fileMap(updateFile2) : updateFile2;
|
|
431
433
|
});
|
|
432
434
|
};
|
|
433
435
|
const handleStart = ({
|
|
@@ -438,7 +440,7 @@ const handleStart = ({
|
|
|
438
440
|
vm
|
|
439
441
|
}) => (rawFiles, updateId, reUpload = false) => {
|
|
440
442
|
if (state.isHwh5) {
|
|
441
|
-
rawFiles = handleHwh5Files(rawFiles);
|
|
443
|
+
rawFiles = handleHwh5Files(rawFiles, props.hwh5);
|
|
442
444
|
}
|
|
443
445
|
state.currentUploadingFileUids = [];
|
|
444
446
|
rawFiles.forEach((rawFile) => api.addFileToList(rawFile, updateId, reUpload));
|
|
@@ -481,14 +483,14 @@ const handleStart = ({
|
|
|
481
483
|
}
|
|
482
484
|
if (!state.isEdm && props.autoUpload) {
|
|
483
485
|
if (props.multiple && props.mergeService) {
|
|
484
|
-
const handler = (file) =>
|
|
486
|
+
const handler = (file) => vm.$refs[constants.UPLOAD_INNER].$refs[constants.UPLOAD_INNER_TEMPLATE].upload(file.raw);
|
|
485
487
|
rawFiles.length && api.beforeUpload({ raw: rawFiles }, true, handler);
|
|
486
488
|
} else {
|
|
487
489
|
rawFiles.forEach((rawFile) => {
|
|
488
490
|
const file = api.getFile(rawFile);
|
|
489
491
|
if (!file)
|
|
490
492
|
return;
|
|
491
|
-
const handler = (file2) =>
|
|
493
|
+
const handler = (file2) => vm.$refs[constants.UPLOAD_INNER].$refs[constants.UPLOAD_INNER_TEMPLATE].upload(file2.raw);
|
|
492
494
|
api.beforeUpload(file, true, handler);
|
|
493
495
|
});
|
|
494
496
|
}
|
|
@@ -560,6 +562,7 @@ const handleSuccess = ({
|
|
|
560
562
|
Modal,
|
|
561
563
|
t
|
|
562
564
|
}) => (res, rawFile) => {
|
|
565
|
+
var _a;
|
|
563
566
|
const currentUploadFiles = state.uploadFiles.filter((file) => state.currentUploadingFileUids.includes(file.uid));
|
|
564
567
|
if (Array.isArray(rawFile)) {
|
|
565
568
|
state.uploadFiles.forEach((file) => {
|
|
@@ -574,7 +577,7 @@ const handleSuccess = ({
|
|
|
574
577
|
});
|
|
575
578
|
} else {
|
|
576
579
|
const file = api.getFile(rawFile);
|
|
577
|
-
const status = res
|
|
580
|
+
const status = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.status;
|
|
578
581
|
const { STATUS_SPECIAL_CHARACTERS, NOT_SUPPORT_SPECIAL_CHARACTERS } = constants.EDM;
|
|
579
582
|
delete file.cancelToken;
|
|
580
583
|
if (props.edm.upload && file && res.data && status !== 200) {
|
|
@@ -801,7 +804,12 @@ const getTranslateFile = ({
|
|
|
801
804
|
} else {
|
|
802
805
|
const content = data.headers["content-disposition"];
|
|
803
806
|
const name = content ? content.match(/fileName.?=(.*)/)[1] || content.match(/fileName=(.*)/)[1] : "";
|
|
804
|
-
|
|
807
|
+
let type2 = "application/zip";
|
|
808
|
+
if (!name.includes(".")) {
|
|
809
|
+
type2 = data.headers["content-type"];
|
|
810
|
+
} else if (type2 !== "zip") {
|
|
811
|
+
type2 = "application / x - xls";
|
|
812
|
+
}
|
|
805
813
|
const blob = new Blob([data.data], { type: type2 });
|
|
806
814
|
aLinkDownload({ blob, name });
|
|
807
815
|
}
|
|
@@ -953,11 +961,16 @@ const downloadFileSingle = ({
|
|
|
953
961
|
isLessThan17G,
|
|
954
962
|
url: fileUrl
|
|
955
963
|
} = args;
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
964
|
+
let promise;
|
|
965
|
+
if (fileUrl) {
|
|
966
|
+
promise = Promise.resolve(fileUrl);
|
|
967
|
+
} else {
|
|
968
|
+
promise = service.getSingleDownloadUrl().then((url) => {
|
|
969
|
+
let serviceUrl = url.replace(/{docId}/, file.docId || file) + `${~url.indexOf("?") ? "&" : "?"}x-download-sign=true&docVersion=${file.docVersion || ""}${file.decryptKey ? "&decryptKey=" + file.decryptKey : ""}`;
|
|
970
|
+
serviceUrl = api.modifyServiceUrlSingle({ file, serviceUrl, range });
|
|
971
|
+
return serviceUrl;
|
|
972
|
+
});
|
|
973
|
+
}
|
|
961
974
|
promise.then((url) => {
|
|
962
975
|
url = xss.filterUrl(url);
|
|
963
976
|
let params = {
|
|
@@ -1179,9 +1192,9 @@ const getDownloadFileInfo = ({ api, state, props, service }) => ({ docId }) => {
|
|
|
1179
1192
|
cancelToken: api.createDownloadCancelToken({ docId }),
|
|
1180
1193
|
data: { docInfoVO: { ids: [docId], docType: "", docVersion: "" } }
|
|
1181
1194
|
}).then((res) => {
|
|
1182
|
-
const { data
|
|
1195
|
+
const { data } = res || {};
|
|
1183
1196
|
if (data && data.status === 200) {
|
|
1184
|
-
const fileInfo = outDocQueryList && outDocQueryList[0].verInfo[0].docInfo[0];
|
|
1197
|
+
const fileInfo = data.result.outDocQueryList && data.result.outDocQueryList[0].verInfo[0].docInfo[0];
|
|
1185
1198
|
resolve(fileInfo);
|
|
1186
1199
|
} else {
|
|
1187
1200
|
reject(res);
|
|
@@ -1867,7 +1880,7 @@ const getPreviewUrlSync = ({ constants, props, state }) => (file, batch) => {
|
|
|
1867
1880
|
authToken: edmToken,
|
|
1868
1881
|
jslibhtml: html,
|
|
1869
1882
|
docId: file.docId,
|
|
1870
|
-
docVersion: file.docVersion || file.version || "
|
|
1883
|
+
docVersion: file.docVersion || file.version || "",
|
|
1871
1884
|
type: "doc",
|
|
1872
1885
|
pageNum: "1"
|
|
1873
1886
|
});
|
|
@@ -1937,7 +1950,7 @@ const previewImageBatch = ({ service, api }) => ({ url, file }) => {
|
|
|
1937
1950
|
});
|
|
1938
1951
|
return service.all(promises);
|
|
1939
1952
|
};
|
|
1940
|
-
const getDialogConfigObj = ({ props, state }) => () => {
|
|
1953
|
+
const getDialogConfigObj = ({ props, state, t, constants }) => () => {
|
|
1941
1954
|
const dialogConfigDefault = {
|
|
1942
1955
|
class: "single-download-modal single-download-modal1",
|
|
1943
1956
|
style: "",
|
|
@@ -1945,7 +1958,7 @@ const getDialogConfigObj = ({ props, state }) => () => {
|
|
|
1945
1958
|
lockScroll: true,
|
|
1946
1959
|
visible: state.showPreview,
|
|
1947
1960
|
dragable: true,
|
|
1948
|
-
title:
|
|
1961
|
+
title: t(constants.EDM.DOC_PREVIEW),
|
|
1949
1962
|
width: "60%"
|
|
1950
1963
|
},
|
|
1951
1964
|
on: {
|
|
@@ -1985,6 +1998,7 @@ const computeDocChunkSize = ({ props, state, constants }) => () => {
|
|
|
1985
1998
|
chunkSize = Math.max(size, SIZE_2M);
|
|
1986
1999
|
return true;
|
|
1987
2000
|
}
|
|
2001
|
+
return false;
|
|
1988
2002
|
});
|
|
1989
2003
|
}
|
|
1990
2004
|
state.docSize = docSize * 1024;
|
|
@@ -2049,6 +2063,8 @@ const handleTriggerClick = ({
|
|
|
2049
2063
|
emit("trigger-click", $event, type);
|
|
2050
2064
|
};
|
|
2051
2065
|
const onBeforeDestroy = (state) => () => {
|
|
2066
|
+
if (!Array.isArray(state.uploadFiles))
|
|
2067
|
+
return;
|
|
2052
2068
|
state.uploadFiles.forEach((file) => {
|
|
2053
2069
|
if (file.url && file.url.indexOf("blob:") === 0) {
|
|
2054
2070
|
URL.revokeObjectURL(file.url);
|
|
@@ -2067,6 +2083,38 @@ const encryptDialogConfirm = ({ state }) => () => {
|
|
|
2067
2083
|
state.encryptDialogConfig.show = false;
|
|
2068
2084
|
typeof selectFileMethod === "function" && selectFileMethod();
|
|
2069
2085
|
};
|
|
2086
|
+
const closeRecordPanel = ({ vm, constants, state, props }) => () => {
|
|
2087
|
+
const { PICTURE_CARD } = constants.LIST_TYPE;
|
|
2088
|
+
const { isHwh5 } = state;
|
|
2089
|
+
const { listType } = props;
|
|
2090
|
+
if (listType === PICTURE_CARD && isHwh5) {
|
|
2091
|
+
vm.$refs[constants.UPLOAD_LIST_INNER].$refs[constants.UPLOAD_LIST_INNER_TEMPLATE].state.showAudioPanel = false;
|
|
2092
|
+
}
|
|
2093
|
+
};
|
|
2094
|
+
const getTipMessage = ({ t, api, constants }) => ({ accept, fileSize, limit }) => {
|
|
2095
|
+
let acceptTip = "";
|
|
2096
|
+
if (accept) {
|
|
2097
|
+
acceptTip = t(constants.ONLY_SUPPORT, {
|
|
2098
|
+
type: accept.split(",").map((item) => item.trim().replace(/^\./, "")).join(t(constants.COMMA))
|
|
2099
|
+
});
|
|
2100
|
+
}
|
|
2101
|
+
if (fileSize && acceptTip.length !== 0) {
|
|
2102
|
+
acceptTip += `${t(constants.COMMA)} `;
|
|
2103
|
+
}
|
|
2104
|
+
let fileSizeTip = "";
|
|
2105
|
+
let kibibyte = 1024;
|
|
2106
|
+
if (typeof fileSize === "number") {
|
|
2107
|
+
fileSizeTip = `${t(constants.FILE_NOT_LESS_THAN)}${api.formatFileSize(fileSize * kibibyte)}`;
|
|
2108
|
+
} else if (Array.isArray(fileSize)) {
|
|
2109
|
+
fileSizeTip += !isNaN(fileSize[0]) ? `${t(constants.FILE_NOT_LESS_THAN)}${api.formatFileSize(Number(fileSize[0]) * kibibyte)}${t(constants.COMMA)}` : "";
|
|
2110
|
+
fileSizeTip += !isNaN(fileSize[1]) ? `${t(constants.FILE_NOT_MORE_THAN)}${api.formatFileSize(Number(fileSize[1]) * kibibyte)}` : "";
|
|
2111
|
+
}
|
|
2112
|
+
let limitTip = limit ? t(constants.NUMBER_LIMIT, { number: limit }) : "";
|
|
2113
|
+
if ((fileSize || acceptTip.length !== 0) && limit) {
|
|
2114
|
+
limitTip = `${t(constants.COMMA)} ` + limitTip;
|
|
2115
|
+
}
|
|
2116
|
+
return acceptTip + fileSizeTip + limitTip;
|
|
2117
|
+
};
|
|
2070
2118
|
export {
|
|
2071
2119
|
abort,
|
|
2072
2120
|
abortDownload,
|
|
@@ -2078,6 +2126,7 @@ export {
|
|
|
2078
2126
|
calcUploadingFilesInfo,
|
|
2079
2127
|
clearFiles,
|
|
2080
2128
|
clearUploadingFiles,
|
|
2129
|
+
closeRecordPanel,
|
|
2081
2130
|
computeDocChunkSize,
|
|
2082
2131
|
computedSourcetype,
|
|
2083
2132
|
computedUploadDisabled,
|
|
@@ -2103,6 +2152,7 @@ export {
|
|
|
2103
2152
|
getKiaScanTip,
|
|
2104
2153
|
getNewTabPreviewUrl,
|
|
2105
2154
|
getPreviewUrlSync,
|
|
2155
|
+
getTipMessage,
|
|
2106
2156
|
getToken,
|
|
2107
2157
|
handleChange,
|
|
2108
2158
|
handleClick,
|