@opentiny/vue-renderless 3.9.2 → 3.10.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/vue.js +25 -2
- package/anchor/index.js +3 -3
- package/anchor/vue.js +7 -1
- package/area/index.js +4 -4
- package/button/vue.js +4 -2
- package/button-group/index.js +8 -1
- package/button-group/vue.js +5 -10
- package/calendar/index.js +14 -14
- package/calendar-bar/index.js +3 -3
- package/carousel-item/index.js +1 -1
- package/cascader/vue.js +1 -1
- package/cascader-mobile/index.js +299 -0
- package/cascader-mobile/vue.js +102 -0
- package/cascader-panel/store.js +3 -1
- package/chart-boxplot/index.js +0 -1
- package/chart-core/deps/constants.js +20 -2
- package/chart-core/index.js +9 -1
- package/chart-core/modules/extend.js +14 -1
- package/chart-gauge/index.js +3 -1
- package/chart-graph/index.js +3 -1
- package/chart-map/index.js +11 -1
- package/chart-scatter/index.js +10 -2
- package/chart-waterfall/index.js +4 -1
- package/checkbox/index.js +16 -14
- package/checkbox/vue.js +14 -10
- package/checkbox-button/vue.js +7 -3
- package/column-list-item/vue.js +10 -1
- package/common/bigInt.js +4 -11
- package/common/date.js +2 -2
- package/common/deps/ResizeObserver.js +3 -1
- package/common/deps/date-util.js +9 -1
- package/common/deps/date.js +18 -5
- package/common/deps/fastdom/async.js +41 -0
- package/common/deps/fastdom/index.js +9 -0
- package/common/deps/fastdom/sandbox.js +53 -0
- package/common/deps/fastdom/singleton.js +80 -0
- package/common/deps/fullscreen/screenfull.js +16 -2
- package/common/deps/memorize.js +3 -3
- package/common/deps/popup-manager.js +0 -1
- package/common/deps/requestAnimationFrame.js +1 -1
- package/common/deps/throttle.js +2 -2
- package/common/deps/tree-model/node.js +23 -11
- package/common/deps/tree-model/tree-store.js +28 -7
- package/common/deps/vue-popper.js +14 -2
- package/common/deps/vue-popup.js +16 -23
- package/common/index.js +7 -35
- package/common/runtime.js +1 -1
- package/common/validate/rules/type.js +3 -1
- package/credit-card-form/vue.js +2 -2
- package/date-panel/index.js +35 -31
- package/date-panel/vue.js +12 -12
- package/date-picker/index.js +9 -5
- package/date-picker/vue.js +20 -8
- package/date-picker-mobile/index.js +3 -3
- package/date-range/index.js +91 -19
- package/date-range/vue.js +19 -11
- package/date-table/index.js +39 -6
- package/date-table/vue.js +2 -2
- package/dept/index.js +1 -1
- package/detail-page/vue.js +9 -1
- package/dialog-box/index.js +11 -2
- package/dialog-box/vue.js +30 -6
- package/dialog-select/index.js +27 -5
- package/dialog-select/vue.js +11 -4
- package/drop-roles/index.js +3 -1
- package/dropdown/index.js +28 -7
- package/dropdown/vue.js +12 -7
- package/dropdown-item/index.js +9 -1
- package/dropdown-item/mf.js +3 -3
- package/dropdown-item/vue.js +12 -10
- package/dropdown-menu/index.js +13 -14
- package/dropdown-menu/vue.js +8 -7
- package/espace/vue.js +9 -1
- package/fall-menu/vue.js +12 -1
- package/file-upload/index.js +137 -89
- package/file-upload/vue.js +24 -14
- package/filter/index.js +1 -1
- package/filter/vue.js +1 -3
- package/floating-button/index.js +73 -0
- package/floating-button/vue.js +35 -0
- package/form/index.js +13 -4
- package/form/vue.js +7 -2
- package/form-item/index.js +4 -1
- package/form-item/vue.js +6 -3
- package/fullscreen/vue.js +24 -3
- package/grid/plugins/exportExcel.js +54 -8
- package/grid/static/base/helperGetHGSKeys.js +1 -4
- package/grid/utils/common.js +15 -11
- package/grid/utils/dom.js +5 -1
- package/guide/index.js +2 -3
- package/hrapprover/index.js +3 -1
- package/index-bar/vue.js +8 -1
- package/input/index.js +1 -11
- package/input/vue.js +6 -12
- package/ip-address/index.js +66 -33
- package/ip-address/vue.js +8 -1
- package/link-menu/vue.js +22 -2
- package/locales/index.js +4 -2
- package/logon-user/index.js +3 -1
- package/logout/index.js +6 -2
- package/milestone/vue.js +1 -1
- package/mini-picker/index.js +12 -10
- package/mini-picker/vue.js +10 -10
- package/modal/index.js +5 -3
- package/modal/vue.js +4 -2
- package/month-range/index.js +18 -18
- package/month-range/vue.js +16 -4
- package/month-table/index.js +7 -3
- package/multi-select/vue.js +1 -9
- package/nav-menu/index.js +33 -4
- package/nav-menu/vue.js +9 -1
- package/notify/vue.js +12 -1
- package/numeric/vue.js +6 -2
- package/option/index.js +10 -2
- package/option/vue.js +20 -9
- package/option-group/index.js +3 -1
- package/package.json +2 -1
- package/picker/index.js +88 -17
- package/picker/vue.js +42 -17
- package/picker-column/index.js +6 -6
- package/picker-column/vue.js +5 -5
- package/popconfirm/vue.js +3 -1
- package/popeditor/index.js +55 -13
- package/popeditor/vue.js +23 -7
- package/popover/vue.js +1 -2
- package/popup/vue.js +15 -2
- package/progress/index.js +9 -7
- package/progress/vue.js +12 -4
- package/pull-refresh/vue.js +10 -1
- package/query-builder/index.js +9 -0
- package/query-builder/vue.js +18 -0
- package/radio/vue.js +3 -1
- package/radio-button/vue.js +1 -1
- package/rate/index.js +8 -2
- package/rate/vue.js +27 -4
- package/recycle-scroller/index.js +0 -1
- package/scrollbar/vue-bar.js +18 -2
- package/search/index.js +12 -5
- package/search/vue.js +7 -5
- package/select/index.js +596 -304
- package/select/vue.js +167 -101
- package/select-dropdown/vue.js +8 -6
- package/select-mobile/index.js +26 -13
- package/select-mobile/vue.js +14 -5
- package/select-view/index.js +5 -21
- package/select-view/vue.js +0 -3
- package/selected-box/index.js +3 -1
- package/slider/index.js +5 -5
- package/slider/vue.js +16 -0
- package/slider-button/index.js +41 -0
- package/slider-button/vue.js +36 -0
- package/slider-button-group/slide-button.js +142 -0
- package/slider-button-group/vue.js +52 -0
- package/steps/slide-bar.js +0 -1
- package/switch/index.js +1 -1
- package/switch/vue.js +1 -1
- package/tab-bar/index.js +8 -6
- package/tab-nav/index.js +19 -13
- package/tab-nav/vue.js +10 -9
- package/tabs/index.js +21 -17
- package/tabs/vue.js +1 -4
- package/tag/vue.js +2 -1
- package/tag-group/index.js +23 -10
- package/tag-group/vue.js +5 -4
- package/time/index.js +8 -8
- package/time/vue.js +9 -9
- package/time-line/index.js +24 -2
- package/time-line/vue.js +30 -4
- package/time-panel/index.js +2 -2
- package/time-panel/vue.js +2 -2
- package/time-range/index.js +24 -21
- package/time-range/vue.js +26 -16
- package/time-spinner/index.js +32 -21
- package/time-spinner/vue.js +37 -12
- package/timeline-item/index.js +77 -0
- package/timeline-item/vue.js +44 -0
- package/toggle-menu/vue.js +0 -1
- package/tooltip/index.js +11 -12
- package/tooltip/vue.js +11 -1
- package/top-box/vue.js +13 -1
- package/tree/index.js +228 -15
- package/tree/vue.js +119 -15
- package/tree-menu/index.js +35 -0
- package/tree-menu/vue.js +27 -5
- package/tree-node/index.js +75 -10
- package/tree-node/vue.js +45 -23
- package/upload/index.js +90 -49
- package/upload/vue.js +22 -10
- package/upload-dragger/index.js +4 -3
- package/upload-list/index.js +67 -16
- package/upload-list/vue.js +26 -9
- package/user/index.js +7 -4
- package/user-link/index.js +2 -1
- package/wizard/index.js +4 -1
- package/wizard/vue.js +19 -2
- package/year-range/index.js +1 -1
- package/year-range/vue.js +3 -3
- package/year-table/index.js +2 -2
package/file-upload/vue.js
CHANGED
|
@@ -63,7 +63,10 @@ import {
|
|
|
63
63
|
previewImageBatch,
|
|
64
64
|
abortDownload,
|
|
65
65
|
createDownloadCancelToken,
|
|
66
|
-
handleClickFileList
|
|
66
|
+
handleClickFileList,
|
|
67
|
+
computedSourcetype,
|
|
68
|
+
getFileSourceType,
|
|
69
|
+
handleTriggerClick
|
|
67
70
|
} from "./index";
|
|
68
71
|
import { isEmptyObject } from "../common/type";
|
|
69
72
|
const api = [
|
|
@@ -87,7 +90,8 @@ const api = [
|
|
|
87
90
|
"updateFile",
|
|
88
91
|
"handleChange",
|
|
89
92
|
"abortDownload",
|
|
90
|
-
"handleClickFileList"
|
|
93
|
+
"handleClickFileList",
|
|
94
|
+
"handleTriggerClick"
|
|
91
95
|
];
|
|
92
96
|
const initState = ({ api: api2, reactive, computed, inject, ref, vm, props, httpRequest, service }) => {
|
|
93
97
|
const state = reactive({
|
|
@@ -100,7 +104,6 @@ const initState = ({ api: api2, reactive, computed, inject, ref, vm, props, http
|
|
|
100
104
|
form: inject("form", ref({ default: "" })),
|
|
101
105
|
listeners: vm.$listeners,
|
|
102
106
|
docSize: 0,
|
|
103
|
-
// unit(B)
|
|
104
107
|
chunkSize: 0,
|
|
105
108
|
chunkBatchLimit: 5,
|
|
106
109
|
downloadChunkLimit: 5,
|
|
@@ -133,16 +136,17 @@ const initState = ({ api: api2, reactive, computed, inject, ref, vm, props, http
|
|
|
133
136
|
downloadChunkFile: {},
|
|
134
137
|
downloadReplayAtoms: {},
|
|
135
138
|
errorStatusCodes: [0, 401, 429],
|
|
136
|
-
// 0:上传异常 401:没权限(token过期)429:超限
|
|
137
139
|
hasFileInfoInterface: computed(() => service.setting.services.EDM && service.setting.services.EDM.DocumentInfoUrl),
|
|
138
140
|
currentDownloadFile: "",
|
|
139
141
|
isDragover: false,
|
|
140
142
|
downloadCancelToken: {},
|
|
141
|
-
// 取消下载token
|
|
142
143
|
downloadCancelData: {},
|
|
143
|
-
// 取消下载时需要清空的缓存数据
|
|
144
144
|
isHwh5: computed(() => !isEmptyObject(props.hwh5)),
|
|
145
|
-
selected: null
|
|
145
|
+
selected: null,
|
|
146
|
+
types: computed(() => api2.computedSourcetype()),
|
|
147
|
+
triggerClickType: "",
|
|
148
|
+
visible: false,
|
|
149
|
+
downloadParamsWhitelist: ["docId", "wmType", "docVersion"]
|
|
146
150
|
});
|
|
147
151
|
return state;
|
|
148
152
|
};
|
|
@@ -155,8 +159,8 @@ const initApi = ({ api: api2, state, props, constants, vm, $service, t, Modal })
|
|
|
155
159
|
handleClick: handleClick({ constants, vm }),
|
|
156
160
|
getFile: getFile(state),
|
|
157
161
|
clearFiles: clearFiles(state),
|
|
158
|
-
watchFileList: watchFileList({ constants, state, props }),
|
|
159
|
-
watchListType: watchListType({ constants, state }),
|
|
162
|
+
watchFileList: watchFileList({ constants, state, props, api: api2 }),
|
|
163
|
+
watchListType: watchListType({ constants, state, api: api2 }),
|
|
160
164
|
onBeforeDestroy: onBeforeDestroy(state),
|
|
161
165
|
computedUploadDisabled: computedUploadDisabled({ props, state }),
|
|
162
166
|
computedUploadingSize: computedUploadingSize({ state, constants }),
|
|
@@ -176,7 +180,9 @@ const initApi = ({ api: api2, state, props, constants, vm, $service, t, Modal })
|
|
|
176
180
|
previewImageSingle: previewImageSingle({ state, props, service: $service }),
|
|
177
181
|
previewImageBatch: previewImageBatch({ service: $service, api: api2 }),
|
|
178
182
|
abortDownload: abortDownload({ state }),
|
|
179
|
-
createDownloadCancelToken: createDownloadCancelToken({ state, service: $service })
|
|
183
|
+
createDownloadCancelToken: createDownloadCancelToken({ state, service: $service }),
|
|
184
|
+
computedSourcetype: computedSourcetype({ props, constants }),
|
|
185
|
+
getFileSourceType: getFileSourceType({ state, props, constants })
|
|
180
186
|
});
|
|
181
187
|
};
|
|
182
188
|
const mergeApi = ({ api: api2, props, $service, state, constants, emit, mode, Modal, t, vm, CryptoJS, Streamsaver }) => {
|
|
@@ -208,14 +214,15 @@ const mergeApi = ({ api: api2, props, $service, state, constants, emit, mode, Mo
|
|
|
208
214
|
setWriterFile: setWriterFile({ state, emit, Streamsaver }),
|
|
209
215
|
afterDownload: afterDownload({ api: api2, state }),
|
|
210
216
|
getFileHash: getFileHash({ emit, Modal, constants, t, CryptoJS, state }),
|
|
211
|
-
modifyServiceUrlSingle: modifyServiceUrlSingle({ constants }),
|
|
217
|
+
modifyServiceUrlSingle: modifyServiceUrlSingle({ state, props, constants }),
|
|
212
218
|
getKiaScanTip: getKiaScanTip({ Modal, constants, t }),
|
|
213
219
|
downloadFileSingle: downloadFileSingle({ service: $service, constants, props, state, api: api2, emit }),
|
|
214
220
|
downloadFileBatch: downloadFileBatch({ api: api2, service: $service, props, state, emit }),
|
|
215
221
|
downloadFileSingleHwh5: downloadFileSingleHwh5({ state, props, emit, constants }),
|
|
216
222
|
validateDownloadStatus: validateDownloadStatus({ state, Modal }),
|
|
217
223
|
handleChange: handleChange({ vm, constants }),
|
|
218
|
-
handleClickFileList: handleClickFileList({ state, emit })
|
|
224
|
+
handleClickFileList: handleClickFileList({ state, emit }),
|
|
225
|
+
handleTriggerClick: handleTriggerClick({ vm, state, constants, props, emit })
|
|
219
226
|
});
|
|
220
227
|
};
|
|
221
228
|
const initWatch = ({ watch, state, api: api2, props, $service }) => {
|
|
@@ -248,7 +255,7 @@ const initWatch = ({ watch, state, api: api2, props, $service }) => {
|
|
|
248
255
|
};
|
|
249
256
|
let getApi = () => ({});
|
|
250
257
|
const renderless = (props, { computed, inject, onBeforeUnmount, provide, reactive, ref, watch, onMounted }, { t, vm, parent, emit, service, mode, constants }, { Modal, CryptoJS, Streamsaver }) => {
|
|
251
|
-
|
|
258
|
+
let api2 = {};
|
|
252
259
|
const $service = initService({ props, service });
|
|
253
260
|
const httpRequest = $service.httpRequest;
|
|
254
261
|
const state = initState({ reactive, computed, api: api2, inject, ref, vm, props, httpRequest, service });
|
|
@@ -257,7 +264,10 @@ const renderless = (props, { computed, inject, onBeforeUnmount, provide, reactiv
|
|
|
257
264
|
getApi = () => api2;
|
|
258
265
|
provide("uploader", parent);
|
|
259
266
|
onMounted(api2.mounted);
|
|
260
|
-
onBeforeUnmount(
|
|
267
|
+
onBeforeUnmount(() => {
|
|
268
|
+
api2.onBeforeDestroy();
|
|
269
|
+
api2 = null;
|
|
270
|
+
});
|
|
261
271
|
initWatch({ watch, state, api: api2, props, $service });
|
|
262
272
|
return api2;
|
|
263
273
|
};
|
package/filter/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { cloneDeep } from "../chart-core/deps/utils";
|
|
3
|
-
const isEmpty = (value) => [void 0, null, ""].
|
|
3
|
+
const isEmpty = (value) => [void 0, null, ""].includes(value);
|
|
4
4
|
const resize = ({ state, vm, props }) => () => {
|
|
5
5
|
const refs = vm.$refs;
|
|
6
6
|
if (state.showPanel) {
|
package/filter/vue.js
CHANGED
|
@@ -39,9 +39,7 @@ const renderless = (props, { reactive, computed, onMounted, onBeforeUnmount }, {
|
|
|
39
39
|
labelList: computed(() => api2.labelListComputed()),
|
|
40
40
|
showPanel: computed(() => state.showPanelIndex !== -1 || state.filterPanel.show),
|
|
41
41
|
hasFilterValue: computed(
|
|
42
|
-
() => props.filterValue.find(
|
|
43
|
-
(item) => Array.isArray(item) ? item.length > 0 : [void 0, null, ""].indexOf(item) === -1
|
|
44
|
-
)
|
|
42
|
+
() => props.filterValue.find((item) => Array.isArray(item) ? item.length > 0 : ![void 0, null, ""].includes(item))
|
|
45
43
|
)
|
|
46
44
|
});
|
|
47
45
|
Object.assign(api2, {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
const getClientWidth = ({ state, vm }) => () => {
|
|
3
|
+
if (vm.$el) {
|
|
4
|
+
state.centerSpace = (document.documentElement.clientWidth - vm.$el.clientWidth) / 2;
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
const handleClick = ({ props, state, emit }) => (event) => {
|
|
8
|
+
if (state.disabled)
|
|
9
|
+
return;
|
|
10
|
+
if (props.resetTime > 0) {
|
|
11
|
+
state.disabled = true;
|
|
12
|
+
state.initTimer = setTimeout(() => {
|
|
13
|
+
state.disabled = false;
|
|
14
|
+
}, props.resetTime);
|
|
15
|
+
}
|
|
16
|
+
emit("touchstart", event);
|
|
17
|
+
};
|
|
18
|
+
const clearTimer = (state) => () => clearTimeout(state.initTimer);
|
|
19
|
+
const useTouchEvent = ({ state, vm, props }) => () => {
|
|
20
|
+
const screenHeight = window.innerHeight;
|
|
21
|
+
state.scrolling = false;
|
|
22
|
+
window.addEventListener("scroll", function() {
|
|
23
|
+
clearTimeout(state.stayTime);
|
|
24
|
+
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
25
|
+
if (props.animated && scrollTop > screenHeight / 2) {
|
|
26
|
+
state.commHiddenSpace = vm.$el.clientWidth * 0.7;
|
|
27
|
+
state.centerSpace = -state.commHiddenSpace;
|
|
28
|
+
state.specialHiddenSpace = window.innerWidth - vm.$el.clientWidth * 0.3;
|
|
29
|
+
state.stayTime = setTimeout(function() {
|
|
30
|
+
if (scrollTop === state.lastScrollTop) {
|
|
31
|
+
state.centerSpace = (document.documentElement.clientWidth - vm.$el.clientWidth) / 2;
|
|
32
|
+
state.commHiddenSpace = "";
|
|
33
|
+
state.specialHiddenSpace = "";
|
|
34
|
+
}
|
|
35
|
+
}, 1e3);
|
|
36
|
+
state.lastScrollTop = scrollTop;
|
|
37
|
+
} else {
|
|
38
|
+
state.centerSpace = (document.documentElement.clientWidth - vm.$el.clientWidth) / 2;
|
|
39
|
+
state.commHiddenSpace = "";
|
|
40
|
+
state.specialHiddenSpace = "";
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
const onScroll = ({ state, api }) => () => {
|
|
45
|
+
if (state.scrolling) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
state.scrolling = true;
|
|
49
|
+
requestAnimationFrame(api.useTouchEvent);
|
|
50
|
+
};
|
|
51
|
+
const computedStyle = ({ props, state }) => () => {
|
|
52
|
+
const styleObj = {};
|
|
53
|
+
props.position === "center" && (styleObj.right = state.centerSpace + "px");
|
|
54
|
+
props.position !== "left" && (styleObj.left = "");
|
|
55
|
+
if (props.animated) {
|
|
56
|
+
styleObj.transition = "right 0.5s,left 0.5s";
|
|
57
|
+
if (props.position !== "center" && state.commHiddenSpace) {
|
|
58
|
+
styleObj.right = -state.commHiddenSpace + "px";
|
|
59
|
+
}
|
|
60
|
+
if (props.position === "left") {
|
|
61
|
+
styleObj.left = state.specialHiddenSpace && state.specialHiddenSpace + "px";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return styleObj;
|
|
65
|
+
};
|
|
66
|
+
export {
|
|
67
|
+
clearTimer,
|
|
68
|
+
computedStyle,
|
|
69
|
+
getClientWidth,
|
|
70
|
+
handleClick,
|
|
71
|
+
onScroll,
|
|
72
|
+
useTouchEvent
|
|
73
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { getClientWidth, handleClick, clearTimer, useTouchEvent, onScroll, computedStyle } from "./index";
|
|
3
|
+
const api = ["state", "handleClick"];
|
|
4
|
+
const renderless = (props, { computed, reactive, onMounted, onBeforeUnmount }, { vm, emit }) => {
|
|
5
|
+
const state = reactive({
|
|
6
|
+
centerSpace: 0,
|
|
7
|
+
disabled: false,
|
|
8
|
+
initTimer: null,
|
|
9
|
+
scrolling: false,
|
|
10
|
+
commHiddenSpace: "",
|
|
11
|
+
specialHiddenSpace: "",
|
|
12
|
+
stayTime: null,
|
|
13
|
+
lastScrollTop: 0,
|
|
14
|
+
style: computed(() => api2.computedStyle())
|
|
15
|
+
});
|
|
16
|
+
const api2 = {};
|
|
17
|
+
Object.assign(api2, {
|
|
18
|
+
state,
|
|
19
|
+
getClientWidth: getClientWidth({ state, vm }),
|
|
20
|
+
handleClick: handleClick({ props, state, emit }),
|
|
21
|
+
clearTimer: clearTimer(state),
|
|
22
|
+
useTouchEvent: useTouchEvent({ state, vm, props }),
|
|
23
|
+
onScroll: onScroll({ state, api: api2 }),
|
|
24
|
+
computedStyle: computedStyle({ props, state })
|
|
25
|
+
});
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
api2.getClientWidth(), api2.onScroll();
|
|
28
|
+
});
|
|
29
|
+
onBeforeUnmount(api2.clearTimer);
|
|
30
|
+
return api2;
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
api,
|
|
34
|
+
renderless
|
|
35
|
+
};
|
package/form/index.js
CHANGED
|
@@ -117,19 +117,28 @@ const deregisterLabelWidth = ({ api, state }) => (val) => {
|
|
|
117
117
|
state.potentialLabelWidthArr.splice(index, 1);
|
|
118
118
|
};
|
|
119
119
|
const bindDialogEvent = ({ api, dialog, state }) => {
|
|
120
|
+
let unbindDialogEvent = () => {
|
|
121
|
+
};
|
|
120
122
|
if (dialog) {
|
|
121
|
-
|
|
123
|
+
const boxCloseHandler = (isFormReset = true) => {
|
|
122
124
|
isFormReset ? api.resetFields() : api.clearValidate();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
+
};
|
|
126
|
+
const boxDragHandler = () => {
|
|
125
127
|
if (!state.timer) {
|
|
126
128
|
state.timer = setTimeout(() => {
|
|
127
129
|
state.timer = null;
|
|
128
130
|
api.updateTip();
|
|
129
131
|
}, 10);
|
|
130
132
|
}
|
|
131
|
-
}
|
|
133
|
+
};
|
|
134
|
+
dialog.state.emitter.on("boxclose", boxCloseHandler);
|
|
135
|
+
dialog.state.emitter.on("boxdrag", boxDragHandler);
|
|
136
|
+
unbindDialogEvent = () => {
|
|
137
|
+
dialog.state.emitter.off("boxclose", boxCloseHandler);
|
|
138
|
+
dialog.state.emitter.off("boxdrag", boxDragHandler);
|
|
139
|
+
};
|
|
132
140
|
}
|
|
141
|
+
return unbindDialogEvent;
|
|
133
142
|
};
|
|
134
143
|
const showTooltip = ({ vm, state }) => (dom, val) => {
|
|
135
144
|
const tooltip = vm.$refs.tooltip;
|
package/form/vue.js
CHANGED
|
@@ -28,14 +28,17 @@ const api = [
|
|
|
28
28
|
"showTooltip",
|
|
29
29
|
"hideTooltip"
|
|
30
30
|
];
|
|
31
|
-
const renderless = (props, { computed, inject, provide, reactive, watch }, { vm, parent }) => {
|
|
31
|
+
const renderless = (props, { computed, inject, provide, reactive, watch, onBeforeUnmount }, { vm, parent }) => {
|
|
32
32
|
const api2 = {};
|
|
33
33
|
const dialog = inject("dialog", null);
|
|
34
34
|
const state = reactive({
|
|
35
|
+
showAutoWidth: props.showAutoWidth,
|
|
35
36
|
fields: [],
|
|
36
37
|
timer: null,
|
|
38
|
+
tooltipVisible: false,
|
|
37
39
|
potentialLabelWidthArr: [],
|
|
38
40
|
autoLabelWidth: computed(() => api2.computedAutoLabelWidth()),
|
|
41
|
+
isDisplayOnly: computed(() => props.displayOnly),
|
|
39
42
|
hasRequired: computed(() => {
|
|
40
43
|
if (props.rules) {
|
|
41
44
|
return Object.values(props.rules).find((ruleOrRules) => {
|
|
@@ -68,7 +71,9 @@ const renderless = (props, { computed, inject, provide, reactive, watch }, { vm,
|
|
|
68
71
|
});
|
|
69
72
|
api2.created();
|
|
70
73
|
provide("form", parent);
|
|
71
|
-
|
|
74
|
+
provide("showAutoWidth", state.showAutoWidth);
|
|
75
|
+
const unbindDialogEvent = bindDialogEvent({ api: api2, dialog, state });
|
|
76
|
+
onBeforeUnmount(unbindDialogEvent);
|
|
72
77
|
watch(() => props.rules, api2.watchRules);
|
|
73
78
|
return api2;
|
|
74
79
|
};
|
package/form-item/index.js
CHANGED
|
@@ -168,6 +168,9 @@ const validate = ({ api, props, state, t }) => (trigger, callback = () => void 0
|
|
|
168
168
|
api.clearValidate();
|
|
169
169
|
const handlerError = () => {
|
|
170
170
|
state.validateState = !errors ? VALIDATE_STATE.Success : VALIDATE_STATE.Error;
|
|
171
|
+
if (errors && props.error) {
|
|
172
|
+
errors[0].message = props.error;
|
|
173
|
+
}
|
|
171
174
|
state.validateMessage = errors ? errors[0].message : "";
|
|
172
175
|
state.canShowTip = !!errors;
|
|
173
176
|
callback(state.validateMessage, invalidFields);
|
|
@@ -287,7 +290,7 @@ const getValueByPath = (object, prop) => {
|
|
|
287
290
|
};
|
|
288
291
|
const wrapValidate = ({ validateFunc, props }) => {
|
|
289
292
|
if (props.validateDebounce) {
|
|
290
|
-
return debounce(
|
|
293
|
+
return debounce(500, validateFunc);
|
|
291
294
|
} else {
|
|
292
295
|
return validateFunc;
|
|
293
296
|
}
|
package/form-item/vue.js
CHANGED
|
@@ -57,7 +57,6 @@ const initState = ({ reactive, computed, api: api2, mode, inject, props }) => {
|
|
|
57
57
|
computedLabelWidth: "",
|
|
58
58
|
initialValue: null,
|
|
59
59
|
canShowTip: false,
|
|
60
|
-
// 兼容 2.0 validation 的 required
|
|
61
60
|
validationRequired: false,
|
|
62
61
|
validateType: "text",
|
|
63
62
|
tooltip: null,
|
|
@@ -121,17 +120,21 @@ const initApi = ({ api: api2, state, dispatch, broadcast, refs, props, constants
|
|
|
121
120
|
handleMouseleave: handleMouseleave(state)
|
|
122
121
|
});
|
|
123
122
|
};
|
|
124
|
-
const initWatch = ({ watch, api: api2, props }) => {
|
|
123
|
+
const initWatch = ({ watch, api: api2, props, state }) => {
|
|
125
124
|
watch(() => props.error, api2.watchError, { immediate: true });
|
|
126
125
|
watch(() => props.validateStatus, api2.watchValidateStatus);
|
|
126
|
+
watch(() => state.formInstance.displayOnly, api2.clearDisplayedValue);
|
|
127
127
|
};
|
|
128
128
|
const renderless = (props, { computed, inject, onMounted, onUnmounted, provide, reactive, watch }, { vm: instance, constants, t, nextTick, refs, broadcast, dispatch, mode }) => {
|
|
129
129
|
const api2 = {};
|
|
130
130
|
const state = initState({ reactive, computed, api: api2, mode, inject, props });
|
|
131
131
|
provide("formItem", instance);
|
|
132
132
|
initApi({ api: api2, state, dispatch, broadcast, refs, props, constants, instance, t, nextTick });
|
|
133
|
-
initWatch({ watch, api: api2, props });
|
|
133
|
+
initWatch({ watch, api: api2, props, state });
|
|
134
134
|
onMounted(api2.mounted);
|
|
135
|
+
instance.$on("displayed-value-changed", (param) => {
|
|
136
|
+
api2.getDisplayedValue(param);
|
|
137
|
+
});
|
|
135
138
|
onUnmounted(api2.unmounted);
|
|
136
139
|
return api2;
|
|
137
140
|
};
|
package/fullscreen/vue.js
CHANGED
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import sf from "../common/deps/fullscreen/screenfull";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
exit,
|
|
5
|
+
enter,
|
|
6
|
+
toggle,
|
|
7
|
+
request,
|
|
8
|
+
getState,
|
|
9
|
+
shadeClick,
|
|
10
|
+
keypressCallback,
|
|
11
|
+
fullScreenCallback,
|
|
12
|
+
onChangeFullscreen,
|
|
13
|
+
computeWrapperStyle
|
|
14
|
+
} from "./index";
|
|
15
|
+
const api = [
|
|
16
|
+
"state",
|
|
17
|
+
"exit",
|
|
18
|
+
"enter",
|
|
19
|
+
"toggle",
|
|
20
|
+
"request",
|
|
21
|
+
"getState",
|
|
22
|
+
"shadeClick",
|
|
23
|
+
"keypressCallback",
|
|
24
|
+
"fullScreenCallback",
|
|
25
|
+
"onChangeFullscreen"
|
|
26
|
+
];
|
|
5
27
|
const renderless = (props, { reactive, computed, watch }, { vm, emit }) => {
|
|
6
28
|
const api2 = {};
|
|
7
29
|
const state = reactive({
|
|
8
30
|
isFullscreen: false,
|
|
9
31
|
isEnabled: false,
|
|
10
32
|
support: computed(() => state.isEnabled),
|
|
11
|
-
// 如果不支持浏览器全屏,改用网页全屏
|
|
12
33
|
isPageOnly: computed(() => props.pageOnly || !sf.isEnabled),
|
|
13
34
|
wrapperStyle: computed(() => api2.computeWrapperStyle())
|
|
14
35
|
});
|
|
@@ -47,11 +47,8 @@ function funcFromCodePoint() {
|
|
|
47
47
|
const defaultOptions = {
|
|
48
48
|
plugins: {
|
|
49
49
|
XLSX: null,
|
|
50
|
-
// xlsx 插件
|
|
51
50
|
XLSXX: null,
|
|
52
|
-
// xlsx-style 插件
|
|
53
51
|
FileSaver: null
|
|
54
|
-
// FileSaver 插件
|
|
55
52
|
},
|
|
56
53
|
table: {
|
|
57
54
|
sheetName: "tiny-sheet",
|
|
@@ -150,7 +147,11 @@ function buildColids({ $table, colids, columnWidthMethod, datas, ths, ws }) {
|
|
|
150
147
|
width: columnWidth
|
|
151
148
|
}) : columnWidth;
|
|
152
149
|
ws["!cols"].push({ wch: Math.round(columnWidth / 10) });
|
|
153
|
-
datas[level].splice(
|
|
150
|
+
datas[level].splice(
|
|
151
|
+
colids.length - 1,
|
|
152
|
+
1,
|
|
153
|
+
typeof column.title === "string" ? column.title : ths[i].textContent
|
|
154
|
+
);
|
|
154
155
|
break;
|
|
155
156
|
}
|
|
156
157
|
}
|
|
@@ -258,7 +259,16 @@ function buildRef({ colids, datas, excelColNames, ws }) {
|
|
|
258
259
|
ws["!fullref"] = fullref;
|
|
259
260
|
ws["!ref"] = fullref;
|
|
260
261
|
}
|
|
261
|
-
function updateCellStyle({
|
|
262
|
+
function updateCellStyle({
|
|
263
|
+
bodyRowCount,
|
|
264
|
+
bodyTrBgcArr,
|
|
265
|
+
footerTrBgc,
|
|
266
|
+
headerRowCount,
|
|
267
|
+
headerWrapperBgc,
|
|
268
|
+
rowIndex,
|
|
269
|
+
showBorder,
|
|
270
|
+
style
|
|
271
|
+
}) {
|
|
262
272
|
style.font = { name: "Microsoft YaHei", sz: 12, color: { rgb: "000000" } };
|
|
263
273
|
if (rowIndex < headerRowCount) {
|
|
264
274
|
style.fill = { fgColor: { rgb: headerWrapperBgc } };
|
|
@@ -278,7 +288,20 @@ function updateCellStyle({ bodyRowCount, bodyTrBgcArr, footerTrBgc, headerRowCou
|
|
|
278
288
|
}
|
|
279
289
|
style.alignment = { vertical: "center", horizontal: "left", wrapText: false };
|
|
280
290
|
}
|
|
281
|
-
function buildDatas({
|
|
291
|
+
function buildDatas({
|
|
292
|
+
showBorder,
|
|
293
|
+
bodyRowCount,
|
|
294
|
+
bodyTrBgcArr,
|
|
295
|
+
headerRowCount,
|
|
296
|
+
colids,
|
|
297
|
+
datas,
|
|
298
|
+
footerTrBgc,
|
|
299
|
+
headerWrapperBgc,
|
|
300
|
+
excelColNames,
|
|
301
|
+
opts,
|
|
302
|
+
$table,
|
|
303
|
+
ws
|
|
304
|
+
}) {
|
|
282
305
|
if (datas.length === 0) {
|
|
283
306
|
return;
|
|
284
307
|
}
|
|
@@ -298,7 +321,17 @@ function buildDatas({ showBorder, bodyRowCount, bodyTrBgcArr, headerRowCount, co
|
|
|
298
321
|
let type = isIndexColData(i, j, indexColIndex, headerRowCount, bodyRowCount) ? "n" : "s";
|
|
299
322
|
let value = isIndexColData(i, j, indexColIndex, headerRowCount, bodyRowCount) ? parseInt(datas[i][j]) : datas[i][j].trim();
|
|
300
323
|
let style = {};
|
|
301
|
-
updateCellStyle({
|
|
324
|
+
updateCellStyle({
|
|
325
|
+
bodyRowCount,
|
|
326
|
+
bodyTrBgcArr,
|
|
327
|
+
columnIndex: j,
|
|
328
|
+
footerTrBgc,
|
|
329
|
+
headerRowCount,
|
|
330
|
+
headerWrapperBgc,
|
|
331
|
+
rowIndex: i,
|
|
332
|
+
showBorder,
|
|
333
|
+
style
|
|
334
|
+
});
|
|
302
335
|
if (styleMethod) {
|
|
303
336
|
style = styleMethod({ rowIndex: i, columnIndex: j, style });
|
|
304
337
|
}
|
|
@@ -426,7 +459,20 @@ function createExcelFromDom($table, opts) {
|
|
|
426
459
|
buildBody({ bodyRowCount, bodyTrs, colids, datas, headerRowCount, opts, ws });
|
|
427
460
|
buildFooter({ bodyRowCount, colids, datas, footerRowCount, footerTrs, headerRowCount, opts, ws });
|
|
428
461
|
buildRef({ colids, datas, excelColNames, ws });
|
|
429
|
-
buildDatas({
|
|
462
|
+
buildDatas({
|
|
463
|
+
$table,
|
|
464
|
+
bodyRowCount,
|
|
465
|
+
bodyTrBgcArr,
|
|
466
|
+
colids,
|
|
467
|
+
datas,
|
|
468
|
+
excelColNames,
|
|
469
|
+
footerTrBgc,
|
|
470
|
+
headerRowCount,
|
|
471
|
+
headerWrapperBgc,
|
|
472
|
+
opts,
|
|
473
|
+
showBorder,
|
|
474
|
+
ws
|
|
475
|
+
});
|
|
430
476
|
return buildWb({ XLSXX, opts, ws });
|
|
431
477
|
}
|
|
432
478
|
function exportExcel($table, options) {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import "../../../chunk-PKUHTIDK.js";
|
|
2
|
-
const helperGetHGSKeys = (property) => (
|
|
3
|
-
// 以最快的方式判断数组,可忽略准确性
|
|
4
|
-
property ? property.splice && property.join ? property : String(property).split(".") : []
|
|
5
|
-
);
|
|
2
|
+
const helperGetHGSKeys = (property) => property ? property.splice && property.join ? property : String(property).split(".") : [];
|
|
6
3
|
var helperGetHGSKeys_default = helperGetHGSKeys;
|
|
7
4
|
export {
|
|
8
5
|
helperGetHGSKeys_default as default
|
package/grid/utils/common.js
CHANGED
|
@@ -27,17 +27,21 @@ const getFilters = (filters) => (filters || []).map(({ label, value, data, check
|
|
|
27
27
|
checked: !!checked
|
|
28
28
|
}));
|
|
29
29
|
const initFilter = (filter) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
return extend(
|
|
31
|
+
{
|
|
32
|
+
condition: {
|
|
33
|
+
input: "",
|
|
34
|
+
relation: "equals",
|
|
35
|
+
empty: null,
|
|
36
|
+
type: null,
|
|
37
|
+
value: []
|
|
38
|
+
},
|
|
39
|
+
hasFilter: false,
|
|
40
|
+
custom: null
|
|
41
|
+
},
|
|
42
|
+
filter,
|
|
43
|
+
true
|
|
44
|
+
);
|
|
41
45
|
};
|
|
42
46
|
const formatText = (value) => `${isNull(value) ? "" : value}`;
|
|
43
47
|
const setCellValue = (row, column, value) => {
|
package/grid/utils/dom.js
CHANGED
|
@@ -180,7 +180,11 @@ const getCellIndexs = (cell) => {
|
|
|
180
180
|
const getCell = ($table, { row, column }) => new Promise((resolve) => {
|
|
181
181
|
$table.$nextTick(() => {
|
|
182
182
|
const bodyElem = $table.$refs[`${column.fixed || "table"}Body`];
|
|
183
|
-
resolve(
|
|
183
|
+
resolve(
|
|
184
|
+
(bodyElem || $table.$refs.tableBody).$el.querySelector(
|
|
185
|
+
`${ROW_CLS}[${ATTR_NAME}="${getRowid($table, row)}"] .${column.id}`
|
|
186
|
+
)
|
|
187
|
+
);
|
|
184
188
|
});
|
|
185
189
|
});
|
|
186
190
|
export {
|
package/guide/index.js
CHANGED
|
@@ -35,9 +35,8 @@ const createShepherd = ({ state, props, Shepherd, offset }) => () => {
|
|
|
35
35
|
document.querySelector(item2).classList.remove("tiny-guide__z-top");
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
|
-
} else {
|
|
39
|
-
callBack(step, item);
|
|
40
38
|
}
|
|
39
|
+
callBack(step, item);
|
|
41
40
|
});
|
|
42
41
|
}
|
|
43
42
|
state.tour.start();
|
|
@@ -103,7 +102,7 @@ const itemStep = (item, state, deepCopy, index, Shepherd) => {
|
|
|
103
102
|
id: item.id,
|
|
104
103
|
scrollTo: true,
|
|
105
104
|
scrollToHandler(el) {
|
|
106
|
-
if (el.getBoundingClientRect().top > document.documentElement.clientHeight) {
|
|
105
|
+
if (el && el.getBoundingClientRect().top > document.documentElement.clientHeight) {
|
|
107
106
|
if (document.documentElement.scrollTop > 0) {
|
|
108
107
|
window.scrollTo(0, document.documentElement.scrollTop + el.getBoundingClientRect().top / 2);
|
|
109
108
|
} else {
|
package/hrapprover/index.js
CHANGED
|
@@ -73,7 +73,9 @@ const hrChange = ({ emit, state }) => (value) => {
|
|
|
73
73
|
};
|
|
74
74
|
const initService = ({ props, service }) => {
|
|
75
75
|
const { fetchHrapprover } = service || {};
|
|
76
|
-
const fetchHrapproverNoop = () => Promise.reject(
|
|
76
|
+
const fetchHrapproverNoop = () => Promise.reject(
|
|
77
|
+
new Error("[TINY Error][Hrapprover] Prop fetchHrapprover is mandatory when the framework service is not used")
|
|
78
|
+
);
|
|
77
79
|
return {
|
|
78
80
|
fetchHrapprover: props.fetchHrapprover || fetchHrapprover || fetchHrapproverNoop
|
|
79
81
|
};
|
package/index-bar/vue.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
handleScroll,
|
|
4
|
+
updateAnchorChildren,
|
|
5
|
+
handleTouchDown,
|
|
6
|
+
handleTouchMove,
|
|
7
|
+
handleTouchUp,
|
|
8
|
+
handleIndexClick
|
|
9
|
+
} from "./index";
|
|
3
10
|
const api = [
|
|
4
11
|
"state",
|
|
5
12
|
"handleIndexClick",
|
package/input/index.js
CHANGED
|
@@ -56,9 +56,7 @@ const calcTextareaHeight = ({ api, hiddenTextarea, props, state }) => (targetEle
|
|
|
56
56
|
hiddenTextarea.value = targetElement.value || targetElement.placeholder || "";
|
|
57
57
|
let height = hiddenTextarea.scrollHeight;
|
|
58
58
|
const textareaStyle = {};
|
|
59
|
-
if (boxSizing === STYLE.
|
|
60
|
-
height = height + borderSize * 2 + paddingSize;
|
|
61
|
-
} else if (boxSizing === STYLE.ContentBox) {
|
|
59
|
+
if (boxSizing === STYLE.ContentBox) {
|
|
62
60
|
height = height - paddingSize;
|
|
63
61
|
}
|
|
64
62
|
hiddenTextarea.value = "";
|
|
@@ -254,12 +252,6 @@ const getDisplayedValue = ({ state, props }) => () => {
|
|
|
254
252
|
return props.displayOnlyContent || state.nativeInputValue || "-";
|
|
255
253
|
}
|
|
256
254
|
};
|
|
257
|
-
const handleDrop = (emit) => (event) => {
|
|
258
|
-
emit("drop", event);
|
|
259
|
-
};
|
|
260
|
-
const handleDragStart = (emit) => (event) => {
|
|
261
|
-
emit("dragstart", event);
|
|
262
|
-
};
|
|
263
255
|
export {
|
|
264
256
|
blur,
|
|
265
257
|
calcIconOffset,
|
|
@@ -276,8 +268,6 @@ export {
|
|
|
276
268
|
handleCompositionEnd,
|
|
277
269
|
handleCompositionStart,
|
|
278
270
|
handleCompositionUpdate,
|
|
279
|
-
handleDragStart,
|
|
280
|
-
handleDrop,
|
|
281
271
|
handleEnterDisplayOnlyContent,
|
|
282
272
|
handleFocus,
|
|
283
273
|
handleInput,
|