@opentiny/vue-renderless 3.20.2 → 3.21.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/anchor/index.js +1 -1
- package/badge/vue.js +1 -1
- package/base-select/index.js +3 -0
- package/bulletin-board/index.js +1 -1
- package/button/index.js +1 -1
- package/cascader/index.js +10 -8
- package/cascader-panel/vue.js +1 -1
- package/cascader-select/column-index.js +3 -0
- package/chart-core/deps/utils.js +1 -1
- package/chart-core/index.js +1 -1
- package/common/browser.js +2 -0
- package/common/deps/eSpaceCtrl.js +3 -2
- package/common/deps/fastdom/singleton.js +9 -1
- package/common/deps/fullscreen/screenfull.js +54 -25
- package/common/deps/popper.js +18 -18
- package/common/deps/touch-emulator.js +15 -10
- package/common/deps/upload-ajax.js +1 -1
- package/common/index.js +2 -2
- package/common/runtime.js +1 -1
- package/common/string.js +5 -2
- package/common/validate/util.js +1 -1
- package/dialog-box/index.js +6 -3
- package/divider/index.js +47 -0
- package/divider/vue.js +24 -3
- package/dropdown/index.js +7 -6
- package/dropdown/vue.js +7 -3
- package/espace/index.js +1 -1
- package/fall-menu/index.js +1 -1
- package/file-upload/index.js +71 -67
- package/file-upload/vue.js +6 -6
- package/floatbar/index.js +1 -1
- package/fluent-editor/index.js +25 -9
- package/form/vue.js +1 -1
- package/grid/plugins/export.js +1 -1
- package/guide/index.js +1 -1
- package/image/index.js +1 -1
- package/image-viewer/index.js +3 -2
- package/input/vue.js +3 -0
- package/link/vue.js +1 -1
- package/locales/index.js +1 -1
- package/logout/index.js +1 -1
- package/menu/index.js +1 -1
- package/milestone/index.js +2 -1
- package/modal/index.js +0 -1
- package/nav-menu/index.js +80 -11
- package/nav-menu/vue.js +13 -1
- package/package.json +2 -2
- package/picker/index.js +10 -0
- package/rich-text/index.js +1 -1
- package/rich-text/module/file-upload.js +1 -1
- package/rich-text/module/image-upload.js +1 -1
- package/rich-text-editor/vue.js +11 -10
- package/roles/index.js +1 -1
- package/select/index.js +27 -17
- package/select/vue.js +33 -5
- package/select-dropdown/vue.js +2 -1
- package/split/index.js +2 -1
- package/statistic/index.js +5 -2
- package/tabbar-item/vue.js +1 -1
- package/tabs-mf/wheel.js +14 -9
- package/time-panel/index.js +8 -1
- package/time-panel/vue.js +2 -0
- package/time-spinner/index.js +2 -1
- package/toggle-menu/index.js +1 -1
- package/transfer/index.js +1 -5
- package/tree-menu/index.js +5 -1
- package/tree-menu/vue.js +5 -2
- package/types/alert.type.d.ts +4 -0
- package/types/date-picker.type.d.ts +1 -1
- package/types/dialog-box.type.d.ts +10 -0
- package/types/divider.type.d.ts +94 -0
- package/types/dropdown.type.d.ts +2 -0
- package/types/file-upload.type.d.ts +1 -1
- package/types/float-button.type.d.ts +2 -2
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-f6fb4c38.d.ts → form.type-4e0ec0a1.d.ts} +2 -1
- package/types/form.type.d.ts +1 -1
- package/types/image.type.d.ts +1 -1
- package/types/nav-menu.type.d.ts +1 -0
- package/types/statistic.type.d.ts +2 -5
- package/types/tree-menu.type.d.ts +19 -0
- package/types/upload-dragger.type.d.ts +2 -2
- package/types/{upload-list.type-6189e4c9.d.ts → upload-list.type-eaf82b7a.d.ts} +4 -8
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-contact.type.d.ts +1 -1
- package/upload-dragger/index.js +49 -24
- package/upload-dragger/vue.js +1 -0
- package/upload-list/index.js +1 -1
- package/upload-list/vue.js +2 -1
- package/user/index.js +1 -1
- package/user-contact/index.js +1 -1
- package/year-table/index.js +2 -2
- package/common/xss.js +0 -191
package/tree-menu/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../chunk-G2ADBYYC.js";
|
|
4
|
-
import { xss } from "
|
|
4
|
+
import { xss } from "@opentiny/utils";
|
|
5
5
|
const initData = ({ state, props, service, api }) => async () => {
|
|
6
6
|
if (props.data) {
|
|
7
7
|
state.data = props.data;
|
|
@@ -12,6 +12,9 @@ const initData = ({ state, props, service, api }) => async () => {
|
|
|
12
12
|
state.data = api.setMenuKey({ newData: [], menuData });
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
+
const getTree = ({ vm }) => () => {
|
|
16
|
+
return vm.$refs.tree;
|
|
17
|
+
};
|
|
15
18
|
const setMenuKey = (api) => ({ newData, menuData }) => {
|
|
16
19
|
Array.isArray(menuData) && menuData.forEach((data) => {
|
|
17
20
|
const item = {};
|
|
@@ -149,6 +152,7 @@ export {
|
|
|
149
152
|
getCurrentKey,
|
|
150
153
|
getCurrentNode,
|
|
151
154
|
getTitle,
|
|
155
|
+
getTree,
|
|
152
156
|
handleToggleMenu,
|
|
153
157
|
initData,
|
|
154
158
|
nodeClick,
|
package/tree-menu/vue.js
CHANGED
|
@@ -24,7 +24,8 @@ import {
|
|
|
24
24
|
setCurrentNode,
|
|
25
25
|
getCurrentNode,
|
|
26
26
|
handleToggleMenu,
|
|
27
|
-
computedTreeStyle
|
|
27
|
+
computedTreeStyle,
|
|
28
|
+
getTree
|
|
28
29
|
} from "./index";
|
|
29
30
|
const api = [
|
|
30
31
|
"state",
|
|
@@ -51,7 +52,8 @@ const api = [
|
|
|
51
52
|
"getCurrentKey",
|
|
52
53
|
"setCurrentNode",
|
|
53
54
|
"getCurrentNode",
|
|
54
|
-
"handleToggleMenu"
|
|
55
|
+
"handleToggleMenu",
|
|
56
|
+
"getTree"
|
|
55
57
|
];
|
|
56
58
|
const renderless = (props, { computed, watch, reactive, onMounted }, { t, service, emit, vm }) => {
|
|
57
59
|
service = service || { base: {} };
|
|
@@ -96,6 +98,7 @@ const renderless = (props, { computed, watch, reactive, onMounted }, { t, servic
|
|
|
96
98
|
getCurrentKey: getCurrentKey({ vm }),
|
|
97
99
|
setCurrentNode: setCurrentNode({ vm }),
|
|
98
100
|
getCurrentNode: getCurrentNode({ vm }),
|
|
101
|
+
getTree: getTree({ vm }),
|
|
99
102
|
handleToggleMenu: handleToggleMenu({ state, vm }),
|
|
100
103
|
computedTreeStyle: computedTreeStyle({ props })
|
|
101
104
|
});
|
package/types/alert.type.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ declare const datePickerProps: {
|
|
|
61
61
|
default: boolean;
|
|
62
62
|
};
|
|
63
63
|
type: {
|
|
64
|
-
type: PropType<"date" | "dates" | "
|
|
64
|
+
type: PropType<"date" | "dates" | "daterange" | "week" | "month" | "monthrange" | "year" | "years" | "yearrange" | "datetime" | "datetimerange">;
|
|
65
65
|
default: string;
|
|
66
66
|
};
|
|
67
67
|
_constants: {
|
|
@@ -20,6 +20,7 @@ declare const $constants: {
|
|
|
20
20
|
DIALOG_BOX_CLASS: string;
|
|
21
21
|
PC_SCROLL_LOCK_CLASS: string;
|
|
22
22
|
MOBILE_SCROLL_LOCK_CLASS: string;
|
|
23
|
+
DIALOG_BOX_DATA_TAG: string;
|
|
23
24
|
Mode: string;
|
|
24
25
|
SCROLL_LOCK_CLASS(mode: any): any;
|
|
25
26
|
};
|
|
@@ -34,6 +35,7 @@ declare const dialogBoxProps: {
|
|
|
34
35
|
DIALOG_BOX_CLASS: string;
|
|
35
36
|
PC_SCROLL_LOCK_CLASS: string;
|
|
36
37
|
MOBILE_SCROLL_LOCK_CLASS: string;
|
|
38
|
+
DIALOG_BOX_DATA_TAG: string;
|
|
37
39
|
Mode: string;
|
|
38
40
|
SCROLL_LOCK_CLASS(mode: any): any;
|
|
39
41
|
};
|
|
@@ -128,6 +130,14 @@ declare const dialogBoxProps: {
|
|
|
128
130
|
type: StringConstructor;
|
|
129
131
|
default: string;
|
|
130
132
|
};
|
|
133
|
+
noAnimation: {
|
|
134
|
+
type: BooleanConstructor;
|
|
135
|
+
default: boolean;
|
|
136
|
+
};
|
|
137
|
+
customStyle: {
|
|
138
|
+
type: ObjectConstructor;
|
|
139
|
+
default: () => {};
|
|
140
|
+
};
|
|
131
141
|
tiny_mode: StringConstructor;
|
|
132
142
|
tiny_mode_root: BooleanConstructor;
|
|
133
143
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { PropType } from '@opentiny/vue-common';
|
|
3
|
+
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
4
|
+
|
|
5
|
+
type DirectionType = 'horizontal' | 'vertical';
|
|
6
|
+
type BorderStyleType = 'dashed' | 'solid' | 'dotted';
|
|
7
|
+
type ContentPositionType = 'left' | 'right' | 'center';
|
|
8
|
+
declare const dividerProps: {
|
|
9
|
+
_constants: {
|
|
10
|
+
type: ObjectConstructor;
|
|
11
|
+
default: () => {};
|
|
12
|
+
};
|
|
13
|
+
direction: {
|
|
14
|
+
type: PropType<DirectionType>;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
color: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
borderStyle: {
|
|
22
|
+
type: PropType<BorderStyleType>;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
contentPosition: {
|
|
26
|
+
type: PropType<ContentPositionType>;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
contentColor: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: string;
|
|
32
|
+
};
|
|
33
|
+
contentBackgroundColor: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
fontSize: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
default: () => string;
|
|
40
|
+
};
|
|
41
|
+
margin: StringConstructor;
|
|
42
|
+
offset: StringConstructor;
|
|
43
|
+
height: StringConstructor;
|
|
44
|
+
status: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
values: string[];
|
|
47
|
+
default: () => string;
|
|
48
|
+
};
|
|
49
|
+
tiny_mode: StringConstructor;
|
|
50
|
+
tiny_mode_root: BooleanConstructor;
|
|
51
|
+
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
52
|
+
tiny_renderless: FunctionConstructor;
|
|
53
|
+
tiny_theme: StringConstructor;
|
|
54
|
+
tiny_chart_theme: ObjectConstructor;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
declare const computedRootStyle: ({ state, props }: Pick<IDividerRenderlessParams, 'state' | 'props'>) => () => IDividerStyle;
|
|
58
|
+
declare const computedLineStyle: ({ props }: Pick<IDividerRenderlessParams, 'props'>) => () => IDividerStyle;
|
|
59
|
+
declare const computedTextStyle: ({ props }: Pick<IDividerRenderlessParams, 'props'>) => () => IDividerStyle;
|
|
60
|
+
declare const setDividerHeight: ({ state, props, vm, nextTick }: Pick<IDividerRenderlessParams, 'state' | 'props' | 'vm' | 'nextTick'>) => () => void;
|
|
61
|
+
|
|
62
|
+
interface IDividerState {
|
|
63
|
+
height: string;
|
|
64
|
+
margin: string;
|
|
65
|
+
lineStyle: IDividerStyle;
|
|
66
|
+
textStyle: IDividerStyle;
|
|
67
|
+
rootStyle: IDividerStyle;
|
|
68
|
+
}
|
|
69
|
+
type IDividerProps = ExtractPropTypes<typeof dividerProps>;
|
|
70
|
+
interface IDividerApi {
|
|
71
|
+
state: IDividerState;
|
|
72
|
+
computedLineStyle: ReturnType<typeof computedLineStyle>;
|
|
73
|
+
computedTextStyle: ReturnType<typeof computedTextStyle>;
|
|
74
|
+
computedRootStyle: ReturnType<typeof computedRootStyle>;
|
|
75
|
+
setDividerHeight: ReturnType<typeof setDividerHeight>;
|
|
76
|
+
}
|
|
77
|
+
type IDividerRenderlessParams = ISharedRenderlessFunctionParams<never> & {
|
|
78
|
+
api: IDividerApi;
|
|
79
|
+
state: IDividerState;
|
|
80
|
+
props: IDividerProps;
|
|
81
|
+
};
|
|
82
|
+
type IDividerRenderlessParamUtils = ISharedRenderlessParamUtils<never>;
|
|
83
|
+
interface IDividerStyle {
|
|
84
|
+
margin?: string | number;
|
|
85
|
+
height?: string | number;
|
|
86
|
+
fontSize?: string | number;
|
|
87
|
+
right?: string | number;
|
|
88
|
+
left?: string | number;
|
|
89
|
+
borderLeftStyle?: string | number;
|
|
90
|
+
borderTopStyle?: string | number;
|
|
91
|
+
borderTopColor?: string | number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { IDividerApi, IDividerProps, IDividerRenderlessParamUtils, IDividerRenderlessParams, IDividerState, IDividerStyle };
|
package/types/dropdown.type.d.ts
CHANGED
|
@@ -126,6 +126,8 @@ interface IDropdownApi {
|
|
|
126
126
|
initDomOperation: () => void;
|
|
127
127
|
beforeDistory: () => void;
|
|
128
128
|
clickOutside: () => void;
|
|
129
|
+
toggleFocusOnTrue: () => void;
|
|
130
|
+
toggleFocusOnFalse: () => void;
|
|
129
131
|
}
|
|
130
132
|
type IDropdownRenderlessParams = ISharedRenderlessFunctionParams<null> & {
|
|
131
133
|
state: IDropdownState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { C as IFileUploadAfterDownload, m as IFileUploadApi, D as IFileUploadBatchSegmentDownload, y as IFileUploadBatchSegmentUpload, a as IFileUploadConstants, w as IFileUploadDownloadFileInner, x as IFileUploadDownloadFileSingle, u as IFileUploadDownloadFileSingleInner, t as IFileUploadEdmDownload, s as IFileUploadFile, A as IFileUploadGetFormData, v as IFileUploadLargeDocumentDownload, r as IFileUploadModalVm, o as IFileUploadProps, p as IFileUploadRenderlessParamUtils, q as IFileUploadRenderlessParams, z as IFileUploadSegmentUploadInner, n as IFileUploadService, B as IFileUploadSetWriterFile, E as IFileUploadSliceDownloadChunk, l as IFileUploadState, F as IFileUploadStreamsaver, I as IFileUploadVm } from './upload-list.type-
|
|
2
|
+
export { C as IFileUploadAfterDownload, m as IFileUploadApi, D as IFileUploadBatchSegmentDownload, y as IFileUploadBatchSegmentUpload, a as IFileUploadConstants, w as IFileUploadDownloadFileInner, x as IFileUploadDownloadFileSingle, u as IFileUploadDownloadFileSingleInner, t as IFileUploadEdmDownload, s as IFileUploadFile, A as IFileUploadGetFormData, v as IFileUploadLargeDocumentDownload, r as IFileUploadModalVm, o as IFileUploadProps, p as IFileUploadRenderlessParamUtils, q as IFileUploadRenderlessParams, z as IFileUploadSegmentUploadInner, n as IFileUploadService, B as IFileUploadSetWriterFile, E as IFileUploadSliceDownloadChunk, l as IFileUploadState, F as IFileUploadStreamsaver, I as IFileUploadVm } from './upload-list.type-eaf82b7a.js';
|
|
3
3
|
import './shared.type.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-
|
|
2
|
+
export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-4e0ec0a1.js';
|
|
3
3
|
import './shared.type.js';
|
|
@@ -21,7 +21,8 @@ declare const formProps: {
|
|
|
21
21
|
size: StringConstructor;
|
|
22
22
|
disabled: BooleanConstructor;
|
|
23
23
|
validateOnRuleChange: {
|
|
24
|
-
type: BooleanConstructor;
|
|
24
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
25
|
+
validator: (value: string | boolean) => boolean;
|
|
25
26
|
default: boolean;
|
|
26
27
|
};
|
|
27
28
|
hideRequiredAsterisk: {
|
package/types/form.type.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { p as IFormApi, r as IFormInstance, n as IFormProps, q as IFormRenderlessParamUtils, o as IFormRenderlessParams, l as IFormRules, m as IFormState } from './form.type-
|
|
2
|
+
export { p as IFormApi, r as IFormInstance, n as IFormProps, q as IFormRenderlessParamUtils, o as IFormRenderlessParams, l as IFormRules, m as IFormState } from './form.type-4e0ec0a1.js';
|
|
3
3
|
import './shared.type.js';
|
package/types/image.type.d.ts
CHANGED
package/types/nav-menu.type.d.ts
CHANGED
|
@@ -11,13 +11,10 @@ declare const statisticProps: {
|
|
|
11
11
|
PREFIX: string;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
precision:
|
|
15
|
-
type: NumberConstructor;
|
|
16
|
-
default: number;
|
|
17
|
-
};
|
|
14
|
+
precision: NumberConstructor;
|
|
18
15
|
formatter: FunctionConstructor;
|
|
19
16
|
value: {
|
|
20
|
-
type: NumberConstructor;
|
|
17
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
21
18
|
default: number;
|
|
22
19
|
};
|
|
23
20
|
prefix: StringConstructor;
|
|
@@ -66,6 +66,10 @@ declare const treeMenuProps: {
|
|
|
66
66
|
type: BooleanConstructor;
|
|
67
67
|
default: boolean;
|
|
68
68
|
};
|
|
69
|
+
showExpand: {
|
|
70
|
+
type: BooleanConstructor;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
69
73
|
collapsible: {
|
|
70
74
|
type: BooleanConstructor;
|
|
71
75
|
default: boolean;
|
|
@@ -121,6 +125,9 @@ declare const initData: ({ state, props, service, api }: {
|
|
|
121
125
|
service: any;
|
|
122
126
|
api: ITreeMenuApi;
|
|
123
127
|
}) => () => Promise<void>;
|
|
128
|
+
declare const getTree: ({ vm }: {
|
|
129
|
+
vm: any;
|
|
130
|
+
}) => () => any;
|
|
124
131
|
declare const setMenuKey: (api: ITreeMenuApi) => ({ newData, menuData }: {
|
|
125
132
|
newData: ITreeMenuNewData[];
|
|
126
133
|
menuData: ITreeMenuData[];
|
|
@@ -172,6 +179,15 @@ declare const setCurrentNode: ({ vm }: {
|
|
|
172
179
|
declare const getCurrentNode: ({ vm }: {
|
|
173
180
|
vm: any;
|
|
174
181
|
}) => () => any;
|
|
182
|
+
declare const handleToggleMenu: ({ state, vm }: {
|
|
183
|
+
state: any;
|
|
184
|
+
vm: any;
|
|
185
|
+
}) => (type: any) => void;
|
|
186
|
+
declare const computedTreeStyle: ({ props }: {
|
|
187
|
+
props: any;
|
|
188
|
+
}) => () => {
|
|
189
|
+
height: string;
|
|
190
|
+
};
|
|
175
191
|
|
|
176
192
|
interface ITreeMenuState {
|
|
177
193
|
data?: unknown[];
|
|
@@ -197,6 +213,7 @@ interface ITreeMenuApi {
|
|
|
197
213
|
currentChange: ReturnType<typeof currentChange>;
|
|
198
214
|
watchFilterText: ReturnType<typeof watchFilterText>;
|
|
199
215
|
getTitle: ReturnType<typeof getTitle>;
|
|
216
|
+
getTree: ReturnType<typeof getTree>;
|
|
200
217
|
setMenuKey: ReturnType<typeof setMenuKey>;
|
|
201
218
|
initData: ReturnType<typeof initData>;
|
|
202
219
|
collapseChange: ReturnType<typeof collapseChange>;
|
|
@@ -206,6 +223,8 @@ interface ITreeMenuApi {
|
|
|
206
223
|
getCurrentKey: ReturnType<typeof getCurrentKey>;
|
|
207
224
|
setCurrentNode: ReturnType<typeof setCurrentNode>;
|
|
208
225
|
getCurrentNode: ReturnType<typeof getCurrentNode>;
|
|
226
|
+
handleToggleMenu: ReturnType<typeof handleToggleMenu>;
|
|
227
|
+
computedTreeStyle: ReturnType<typeof computedTreeStyle>;
|
|
209
228
|
}
|
|
210
229
|
interface ITreeMenuData {
|
|
211
230
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
2
|
import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams } from './shared.type.js';
|
|
3
|
-
import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-
|
|
3
|
+
import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-eaf82b7a.js';
|
|
4
4
|
|
|
5
5
|
declare const UploadDraggerProps: {
|
|
6
6
|
disabled: BooleanConstructor;
|
|
@@ -26,7 +26,7 @@ declare const UploadDraggerProps: {
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
declare const onDragOver: ({ props, state }: Pick<IUploadDraggerRenderlessParams, 'props' | 'state'>) => () => boolean;
|
|
29
|
-
declare const onDrop: ({ emit, props, state }: Pick<IUploadDraggerRenderlessParams, 'emit' | 'props' | 'state'>) => (event:
|
|
29
|
+
declare const onDrop: ({ emit, props, state }: Pick<IUploadDraggerRenderlessParams, 'emit' | 'props' | 'state'>) => (event: any) => Promise<void>;
|
|
30
30
|
declare const watchDragover: ({ state, constants }: Pick<IUploadDraggerRenderlessParams, 'state' | 'constants'>) => () => void;
|
|
31
31
|
|
|
32
32
|
interface IUploadDraggerState {
|
|
@@ -410,11 +410,8 @@ declare const beforeUpload: ({ props, api, Modal, constants, t, state }: Pick<IF
|
|
|
410
410
|
declare const startUpload: ({ state, constants, vm, Modal, api, t }: Pick<IFileUploadRenderlessParams, 'state' | 'constants' | 'vm' | 'api' | 't'> & IFileUploadModalVm) => (file: IFileUploadFile, isList: boolean) => void;
|
|
411
411
|
declare const properFileSize: ({ props, state, api, constants, Modal, t }: Pick<IFileUploadRenderlessParams, 'props' | 'state' | 'constants' | 'api' | 't'> & IFileUploadModalVm) => (file: IFileUploadFile) => boolean;
|
|
412
412
|
declare const addFileToList: ({ api, constants, emit, props, state, mode }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'emit' | 'props' | 'state' | 'mode'>) => (rawFile: IFileUploadFile, updateId: string, reUpload: boolean) => void;
|
|
413
|
-
declare const getFileHash: ({ emit, Modal, constants, t,
|
|
414
|
-
CryptoJS: object;
|
|
415
|
-
}) => ({ file, chunkSize, showTips }: {
|
|
413
|
+
declare const getFileHash: ({ emit, Modal, constants, t, state }: Pick<IFileUploadRenderlessParams, 'emit' | 'constants' | 't' | 'state'> & IFileUploadModalVm) => ({ file, showTips }: {
|
|
416
414
|
file: IFileUploadFile;
|
|
417
|
-
chunkSize: number;
|
|
418
415
|
showTips: boolean;
|
|
419
416
|
}) => Promise<unknown>;
|
|
420
417
|
declare const handleStart: ({ api, constants, props, state, vm }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'props' | 'state' | 'vm'>) => (rawFiles: IFileUploadFile[], updateId: string, reUpload?: boolean) => void;
|
|
@@ -482,8 +479,9 @@ declare const downloadFileSingleInner: ({ props, state, api, constants }: {
|
|
|
482
479
|
file: any;
|
|
483
480
|
isBatch: any;
|
|
484
481
|
}) => void;
|
|
485
|
-
declare const getDownloadFileInfo: ({ api, state, props, service }: Pick<IFileUploadRenderlessParams, 'api' | 'state' | 'props' | 'service'>) => ({ docId }: {
|
|
482
|
+
declare const getDownloadFileInfo: ({ api, state, props, service }: Pick<IFileUploadRenderlessParams, 'api' | 'state' | 'props' | 'service'>) => ({ docId, docVersion }: {
|
|
486
483
|
docId: string;
|
|
484
|
+
docVersion: string;
|
|
487
485
|
}) => any;
|
|
488
486
|
declare const largeDocumentDownload: ({ api, state }: Pick<IFileUploadRenderlessParams, 'api' | 'state'>) => ({ file, isBatch, isLessThan17G }: IFileUploadLargeDocumentDownload) => void;
|
|
489
487
|
declare const sliceDownloadChunk: ({ state }: Pick<IFileUploadRenderlessParams, 'state'>) => (file: IFileUploadFile) => IFileUploadSliceDownloadChunk[][];
|
|
@@ -496,9 +494,7 @@ declare const setWriterFile: ({ state, emit, Streamsaver }: Pick<IFileUploadRend
|
|
|
496
494
|
declare const getFormData$1: ({ constants, props, state }: Pick<IFileUploadRenderlessParams, 'constants' | 'props' | 'state'>) => ({ formData, file, type }: IFileUploadGetFormData) => IUploadFormData;
|
|
497
495
|
declare const largeDocumentUpload: ({ api, Modal, state, t, emit, constants }: Pick<IFileUploadRenderlessParams, 'api' | 'state' | 't' | 'emit' | 'constants'> & IFileUploadModalVm) => (file: IFileUploadFile) => void;
|
|
498
496
|
declare const segmentUploadInit: ({ api, props, service, state, constants }: Pick<IFileUploadRenderlessParams, 'api' | 'props' | 'service' | 'state' | 'constants'>) => (file: IFileUploadFile) => Promise<unknown>;
|
|
499
|
-
declare const segmentUpload: ({ api, props, service, state, emit, constants
|
|
500
|
-
CryptoJS: object;
|
|
501
|
-
}) => (batchIndex: number, file: IFileUploadFile, progress: {
|
|
497
|
+
declare const segmentUpload: ({ api, props, service, state, emit, constants }: Pick<IFileUploadRenderlessParams, 'api' | 'props' | 'service' | 'state' | 'emit' | 'constants'>) => (batchIndex: number, file: IFileUploadFile, progress: {
|
|
502
498
|
file: IFileUploadFile;
|
|
503
499
|
}) => void;
|
|
504
500
|
declare const batchSegmentUpload: ({ api, constants, props, vm, state }: Pick<IFileUploadRenderlessParams, 'api' | 'constants' | 'props' | 'vm' | 'state'>) => ({ docId, batchIndex, batches, progress }: IFileUploadBatchSegmentUpload) => void;
|
|
@@ -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-eaf82b7a.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-eaf82b7a.js';
|
|
3
3
|
import './shared.type.js';
|
package/upload-dragger/index.js
CHANGED
|
@@ -1,45 +1,70 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
const onDragOver = ({ props, state }) => () => !props.disabled && (state.dragover = true);
|
|
3
|
-
const onDrop = ({ emit, props, state }) => (event) => {
|
|
4
|
-
var _a;
|
|
3
|
+
const onDrop = ({ emit, props, state }) => async (event) => {
|
|
5
4
|
if (props.disabled || !state.uploader) {
|
|
6
5
|
return;
|
|
7
6
|
}
|
|
8
7
|
const accept = state.uploader.accept;
|
|
8
|
+
let files = event.dataTransfer.files;
|
|
9
|
+
const isDirectory = event.dataTransfer.items && event.dataTransfer.items[0].webkitGetAsEntry().isDirectory;
|
|
10
|
+
state.uploadFiles = [];
|
|
9
11
|
state.dragover = false;
|
|
10
|
-
|
|
12
|
+
if (isDirectory) {
|
|
13
|
+
const fileItems = event.dataTransfer.items[0].webkitGetAsEntry();
|
|
14
|
+
await readFiles(fileItems, state);
|
|
15
|
+
files = state.uploadFiles;
|
|
16
|
+
}
|
|
11
17
|
if (!accept) {
|
|
12
18
|
emit("file", files);
|
|
13
19
|
return;
|
|
14
20
|
}
|
|
15
21
|
const notAcceptedFiles = [];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return false;
|
|
32
|
-
});
|
|
33
|
-
!isValid && notAcceptedFiles.push(file);
|
|
34
|
-
return isValid;
|
|
22
|
+
[].slice.call(files).filter((file) => {
|
|
23
|
+
const { type, name } = file;
|
|
24
|
+
const extension = name.includes(".") ? `.${name.split(".").pop()}` : "";
|
|
25
|
+
const baseType = type.replace(/\/.*$/, "");
|
|
26
|
+
let isValid = accept.split(",").map((type2) => type2.trim()).filter((type2) => type2).some((type2) => {
|
|
27
|
+
if (/\..+$/.test(type2)) {
|
|
28
|
+
return extension === type2;
|
|
29
|
+
}
|
|
30
|
+
if (/\/\*$/.test(type2)) {
|
|
31
|
+
return baseType === type2.replace(/\/\*$/, "");
|
|
32
|
+
}
|
|
33
|
+
if (/^[^/]+\/[^/]+$/.test(type2)) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
35
37
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
!isValid && notAcceptedFiles.push(file);
|
|
39
|
+
return isValid;
|
|
40
|
+
});
|
|
41
|
+
notAcceptedFiles.length && state.uploader.$emit("drop-error", notAcceptedFiles);
|
|
38
42
|
emit("file", files);
|
|
39
43
|
};
|
|
40
44
|
const watchDragover = ({ state, constants }) => () => {
|
|
41
45
|
state.uploader.$refs[constants.FILE_UPLOAD_INNER_TEMPLATE].$emit("drag-over", state.dragover);
|
|
42
46
|
};
|
|
47
|
+
async function readFiles(directory, state) {
|
|
48
|
+
const reader = directory.createReader();
|
|
49
|
+
const entries = await new Promise((resolve) => {
|
|
50
|
+
reader.readEntries((entries2) => {
|
|
51
|
+
resolve(entries2);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
for (let i = 0; i < entries.length; i++) {
|
|
55
|
+
const entry = entries[i];
|
|
56
|
+
if (entry.isFile) {
|
|
57
|
+
await new Promise((resolve) => {
|
|
58
|
+
entry.file((file) => {
|
|
59
|
+
state.uploadFiles.push(file);
|
|
60
|
+
resolve(void 0);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
} else if (entry.isDirectory) {
|
|
64
|
+
await readFiles(entry, state);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
43
68
|
export {
|
|
44
69
|
onDragOver,
|
|
45
70
|
onDrop,
|
package/upload-dragger/vue.js
CHANGED
|
@@ -4,6 +4,7 @@ const api = ["state", "onDragOver", "onDrop"];
|
|
|
4
4
|
const renderless = (props, { inject, reactive, ref, watch }, { emit }) => {
|
|
5
5
|
const state = reactive({
|
|
6
6
|
dragover: false,
|
|
7
|
+
uploadFiles: [],
|
|
7
8
|
uploader: inject("uploader") || ref({ default: "" })
|
|
8
9
|
});
|
|
9
10
|
const constants = state.uploader.$constants || {};
|
package/upload-list/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "
|
|
2
|
+
import { xss } from "@opentiny/utils";
|
|
3
3
|
import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
|
|
4
4
|
const parsePercentage = () => (val) => parseInt(val, 10);
|
|
5
5
|
const handleClick = ({ props, api, parent }) => (e, file) => {
|
package/upload-list/vue.js
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
import { getToken, initService } from "../file-upload";
|
|
26
26
|
import { formatFileSize } from "../common/string";
|
|
27
27
|
import { getApi } from "../file-upload/vue";
|
|
28
|
+
import { isBrowser } from "../common/browser";
|
|
28
29
|
const api = [
|
|
29
30
|
"t",
|
|
30
31
|
"state",
|
|
@@ -51,7 +52,7 @@ const renderless = (props, { reactive, onMounted, onUnmounted, watch, inject, co
|
|
|
51
52
|
var _a, _b, _c, _d, _e;
|
|
52
53
|
const api2 = { getApi };
|
|
53
54
|
parent = inject("uploader").$children[0];
|
|
54
|
-
const constants = parent.$constants;
|
|
55
|
+
const constants = isBrowser ? parent.$constants : null;
|
|
55
56
|
const $service = initService({ props, service });
|
|
56
57
|
const { current } = useBreakpoint();
|
|
57
58
|
const state = reactive({
|
package/user/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import debounce from "../common/deps/debounce";
|
|
|
6
6
|
import { toDateStr } from "../common/date";
|
|
7
7
|
import { toJsonStr } from "../common/object";
|
|
8
8
|
import { toJson } from "../common/string";
|
|
9
|
-
import { log } from "
|
|
9
|
+
import { log } from "@opentiny/utils";
|
|
10
10
|
const toLowerCase = (val) => {
|
|
11
11
|
return typeof val === "string" ? val.toLowerCase() : val;
|
|
12
12
|
};
|
package/user-contact/index.js
CHANGED
package/year-table/index.js
CHANGED
|
@@ -7,7 +7,7 @@ const getIsDefault = ({ props }) => (year) => {
|
|
|
7
7
|
return Array.isArray(defaultValue) ? defaultValue.some((v) => v && v.getFullYear() === year) : defaultValue && defaultValue.getFullYear() === year;
|
|
8
8
|
};
|
|
9
9
|
const getIsDisabled = ({ props }) => (year) => {
|
|
10
|
-
return props.selectionMode.startsWith("year") && typeof props.disabledDate === "function" ? props.disabledDate(year) : false;
|
|
10
|
+
return props.selectionMode.startsWith("year") && typeof props.disabledDate === "function" ? props.disabledDate(new Date(year, 0, 1, 0)) : false;
|
|
11
11
|
};
|
|
12
12
|
const getIsCurrent = ({ props }) => (year) => {
|
|
13
13
|
const execDate = typeof props.value === "object" ? props.value : toDate(props.value);
|
|
@@ -49,7 +49,7 @@ const getRows = ({ props, state, vm }) => () => {
|
|
|
49
49
|
cell.text = year;
|
|
50
50
|
cell.type = isToday ? DATEPICKER.Today : DATEPICKER.Normal;
|
|
51
51
|
if (props.selectionMode.startsWith("year")) {
|
|
52
|
-
cell.disabled = typeof disabledDate === "function" && disabledDate(year);
|
|
52
|
+
cell.disabled = typeof disabledDate === "function" && disabledDate(new Date(year, 0, 1, 0));
|
|
53
53
|
}
|
|
54
54
|
if (selectionMode === DATEPICKER.YearRange) {
|
|
55
55
|
const minYear = typeof minDate === "object" && minDate ? minDate.getFullYear() : minDate;
|