@opentiny/vue-renderless 3.18.6 → 3.19.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-menu/index.js +2 -2
- package/action-menu/vue.js +2 -2
- package/anchor/index.js +8 -6
- package/anchor/vue.js +1 -1
- package/badge/index.js +4 -3
- package/base-select/index.js +3 -3
- package/breadcrumb-item/vue.js +1 -1
- package/bulletin-board/index.js +1 -1
- package/button/index.js +1 -1
- package/button-group/index.js +6 -1
- package/carousel-item/index.js +1 -1
- package/cascader/vue.js +17 -4
- package/chart-core/deps/utils.js +1 -1
- package/checkbox/index.js +1 -1
- package/common/deps/dom.js +9 -1
- package/common/deps/useWindowSize.js +23 -0
- package/common/deps/vue-popper.js +1 -1
- package/common/index.js +2 -2
- package/common/prop-util.js +43 -0
- package/common/runtime.js +1 -1
- package/crop/index.js +14 -22
- package/crop/vue.js +33 -29
- package/date-panel/index.js +13 -2
- package/date-panel/vue.js +16 -10
- package/dialog-select/index.js +78 -0
- package/dialog-select/vue.js +28 -6
- package/drawer/index.js +14 -1
- package/drawer/vue.js +4 -3
- package/dropdown-item/index.js +2 -2
- package/dropdown-item/vue.js +9 -6
- package/espace/index.js +1 -1
- package/fall-menu/index.js +5 -1
- package/fall-menu/vue.js +15 -2
- package/filter-box/vue.js +5 -2
- package/floatbar/index.js +1 -1
- package/form/index.js +7 -4
- package/form/vue.js +1 -1
- package/grid/plugins/export.js +1 -1
- package/grid/utils/dom.js +3 -1
- package/guide/index.js +17 -2
- package/guide/vue.js +5 -3
- package/image-viewer/vue.js +1 -1
- package/input/index.js +6 -7
- package/input/vue.js +10 -11
- package/ip-address/index.js +0 -10
- package/ip-address/vue.js +2 -5
- package/load-list/index.js +43 -0
- package/load-list/vue.js +69 -0
- package/locales/index.js +1 -5
- package/logout/index.js +1 -1
- package/milestone/index.js +55 -8
- package/milestone/vue.js +16 -3
- package/modal/index.js +6 -6
- package/modal/vue.js +4 -3
- package/nav-menu/index.js +1 -1
- package/package.json +1 -1
- package/pager/index.js +25 -0
- package/pager/vue.js +18 -4
- package/picker/index.js +3 -3
- package/picker/vue.js +1 -1
- package/popeditor/index.js +12 -1
- package/popeditor/vue.js +9 -5
- package/rich-text/table-module.js +4 -3
- package/roles/index.js +1 -1
- package/select/index.js +6 -6
- package/select/vue.js +2 -1
- package/selected-box/vue.js +2 -1
- package/slider/index.js +2 -2
- package/slider-button-group/vue.js +3 -2
- package/split/vue.js +4 -2
- package/sticky/index.js +89 -0
- package/sticky/vue.js +74 -0
- package/tabbar-item/vue.js +1 -1
- package/tall-storage/index.js +1 -1
- package/time/vue.js +2 -1
- package/time-range/vue.js +4 -1
- package/time-spinner/index.js +4 -1
- package/toggle-menu/index.js +1 -1
- package/transfer-panel/vue.js +7 -6
- package/tree/index.js +17 -7
- package/tree/vue.js +10 -6
- package/tree-node/index.js +2 -2
- package/tree-node/vue.js +6 -2
- package/types/action-menu.type.d.ts +1 -1
- package/types/alert.type.d.ts +2 -0
- package/types/anchor.type.d.ts +5 -1
- package/types/badge.type.d.ts +1 -1
- package/types/button-group.type.d.ts +3 -0
- package/types/button.type.d.ts +1 -1
- package/types/date-picker.type.d.ts +3 -0
- package/types/drawer.type.d.ts +5 -1
- package/types/{dropdown-item.type-16d59fd0.d.ts → dropdown-item.type-c9badbc1.d.ts} +2 -2
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/fall-menu.type.d.ts +1 -0
- package/types/file-upload.type.d.ts +1 -1
- package/types/image.type.d.ts +4 -0
- package/types/input.type.d.ts +8 -4
- package/types/load-list.type.d.ts +58 -0
- package/types/milestone.type.d.ts +27 -1
- package/types/modal.type.d.ts +3 -2
- package/types/pager.type.d.ts +5 -1
- package/types/picker.type.d.ts +3 -0
- package/types/popover.type.d.ts +1 -1
- package/types/search.type.d.ts +0 -3
- package/types/steps.type.d.ts +1 -0
- package/types/tag.type.d.ts +1 -0
- package/types/tooltip.type.d.ts +3 -0
- package/types/transfer.type.d.ts +3 -3
- package/types/tree-menu.type.d.ts +8 -0
- package/types/upload-dragger.type.d.ts +1 -1
- package/types/{upload-list.type-4194f534.d.ts → upload-list.type-26173587.d.ts} +11 -3
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-contact.type.d.ts +127 -1
- package/types/user-head.type.d.ts +1 -4
- package/upload-list/vue.js +7 -7
- package/virtual-scroll-box/index.js +294 -0
- package/virtual-scroll-box/vue.js +43 -0
- package/virtual-tree/index.js +168 -0
- package/virtual-tree/vue.js +53 -0
package/input/vue.js
CHANGED
|
@@ -86,7 +86,8 @@ const initState = ({
|
|
|
86
86
|
parent,
|
|
87
87
|
constants,
|
|
88
88
|
api: api2,
|
|
89
|
-
vm
|
|
89
|
+
vm,
|
|
90
|
+
designConfig
|
|
90
91
|
}) => {
|
|
91
92
|
const state = reactive({
|
|
92
93
|
mode,
|
|
@@ -104,7 +105,10 @@ const initState = ({
|
|
|
104
105
|
inputSize: computed(() => props.size || state.formItemSize || (parent.tinyForm || {}).size),
|
|
105
106
|
inputSizeMf: computed(() => props.size || state.formItemSize || (parent.tinyForm || {}).size),
|
|
106
107
|
showClear: computed(
|
|
107
|
-
() =>
|
|
108
|
+
() => {
|
|
109
|
+
var _a;
|
|
110
|
+
return props.clearable && !state.inputDisabled && !props.readonly && state.nativeInputValue && (!((_a = designConfig == null ? void 0 : designConfig.options) == null ? void 0 : _a.isCloseIconHide) || state.focused || state.hovering);
|
|
111
|
+
}
|
|
108
112
|
),
|
|
109
113
|
textareaHeight: vm.theme === "saas" ? "28px" : "30px",
|
|
110
114
|
upperLimit: computed(() => parent.$attrs.maxlength),
|
|
@@ -155,7 +159,6 @@ const initApi = ({
|
|
|
155
159
|
emit,
|
|
156
160
|
vm,
|
|
157
161
|
props,
|
|
158
|
-
CLASS_PREFIX,
|
|
159
162
|
parent,
|
|
160
163
|
nextTick
|
|
161
164
|
}) => {
|
|
@@ -169,7 +172,7 @@ const initApi = ({
|
|
|
169
172
|
setShowMoreBtn: setShowMoreBtn({ state, vm }),
|
|
170
173
|
handleChange: handleChange(emit),
|
|
171
174
|
watchFormSelect: watchFormSelect({ emit, props, state }),
|
|
172
|
-
calcIconOffset: calcIconOffset({
|
|
175
|
+
calcIconOffset: calcIconOffset({ vm, parent }),
|
|
173
176
|
getSuffixVisible: getSuffixVisible({ parent, props, state }),
|
|
174
177
|
calculateNodeStyling: calculateNodeStyling(),
|
|
175
178
|
handleCompositionStart: handleCompositionStart(state),
|
|
@@ -309,16 +312,12 @@ const initWatch = ({
|
|
|
309
312
|
{ immediate: true }
|
|
310
313
|
);
|
|
311
314
|
};
|
|
312
|
-
const renderless = (props, { computed, onMounted, onBeforeUnmount, onUpdated, reactive, toRefs, watch, inject }, { vm, refs, parent, emit, constants, nextTick, broadcast, dispatch, mode }) => {
|
|
315
|
+
const renderless = (props, { computed, onMounted, onBeforeUnmount, onUpdated, reactive, toRefs, watch, inject }, { vm, refs, parent, emit, constants, nextTick, broadcast, dispatch, mode, designConfig }) => {
|
|
313
316
|
const api2 = {};
|
|
314
317
|
const componentName = constants.COMPONENT_NAME.FormItem;
|
|
315
318
|
const eventName = { change: "form.change", blur: "form.blur" };
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
InputGroup: constants.inputGroupMode(mode)
|
|
319
|
-
};
|
|
320
|
-
const state = initState({ reactive, computed, mode, props, parent, constants, api: api2, vm });
|
|
321
|
-
initApi({ api: api2, state, dispatch, broadcast, emit, refs, props, CLASS_PREFIX, parent, vm, nextTick });
|
|
319
|
+
const state = initState({ reactive, computed, mode, props, parent, constants, api: api2, vm, designConfig });
|
|
320
|
+
initApi({ api: api2, state, dispatch, broadcast, emit, refs, props, parent, vm, nextTick });
|
|
322
321
|
const storages = useStorageBox({ api: api2, props, reactive, toRefs });
|
|
323
322
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
324
323
|
mergeApi({ api: api2, storages, componentName, emit, eventName, props, state, nextTick, parent, vm, mode, constants });
|
package/ip-address/index.js
CHANGED
|
@@ -254,21 +254,11 @@ const keydown = ({ api, props, state }) => ({ item, index, event }) => {
|
|
|
254
254
|
return false;
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
const getHeightOfSize = (size, isLineHeight = "height") => {
|
|
258
|
-
const sizeMap = {
|
|
259
|
-
medium: "42px",
|
|
260
|
-
small: "36px",
|
|
261
|
-
mini: "24px"
|
|
262
|
-
};
|
|
263
|
-
const sizePX = sizeMap[size];
|
|
264
|
-
return sizePX ? isLineHeight + ":" + sizePX + ";" : "";
|
|
265
|
-
};
|
|
266
257
|
export {
|
|
267
258
|
blur,
|
|
268
259
|
change,
|
|
269
260
|
focus,
|
|
270
261
|
getCursorPosition,
|
|
271
|
-
getHeightOfSize,
|
|
272
262
|
getValue,
|
|
273
263
|
inputEvent,
|
|
274
264
|
ipValidator,
|
package/ip-address/vue.js
CHANGED
|
@@ -15,8 +15,7 @@ import {
|
|
|
15
15
|
change,
|
|
16
16
|
blur,
|
|
17
17
|
keyup,
|
|
18
|
-
keydown
|
|
19
|
-
getHeightOfSize
|
|
18
|
+
keydown
|
|
20
19
|
} from "./index";
|
|
21
20
|
import { KEY_CODE } from "../common";
|
|
22
21
|
const api = ["state", "focus", "inputEvent", "blur", "keyup", "keydown", "change", "select"];
|
|
@@ -40,9 +39,7 @@ const initState = ({
|
|
|
40
39
|
],
|
|
41
40
|
formDisabled: computed(() => (parent.tinyForm || {}).disabled),
|
|
42
41
|
disabled: computed(() => props.disabled || state.formDisabled),
|
|
43
|
-
|
|
44
|
-
lineHeightStyle: computed(() => getHeightOfSize(props.size, "line-height")),
|
|
45
|
-
allHeightStyle: computed(() => `${state.heightStyle}${state.lineHeightStyle}`)
|
|
42
|
+
size: computed(() => props.size)
|
|
46
43
|
}));
|
|
47
44
|
return state;
|
|
48
45
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { isDisplayNone } from "../common/deps/dom";
|
|
3
|
+
const clickList = ({ emit, props }) => () => {
|
|
4
|
+
const list = {
|
|
5
|
+
id: props.id,
|
|
6
|
+
content: props.content,
|
|
7
|
+
subtext: props.subText,
|
|
8
|
+
contentdes: props.contentDes
|
|
9
|
+
};
|
|
10
|
+
emit("click", list);
|
|
11
|
+
};
|
|
12
|
+
const check = ({ api, emit, props, state, vm }) => () => {
|
|
13
|
+
if (state.loading || props.finished || props.disabled || props.error || // skip check when inside an inactive tab
|
|
14
|
+
state.tabStatus === false) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const offset = +props.offset;
|
|
18
|
+
const scrollParentRect = api.useRect(state.scroller);
|
|
19
|
+
if (!scrollParentRect.height || isDisplayNone(vm.$el)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
let isReachEdge = false;
|
|
23
|
+
const placeholderRect = api.useRect(vm.$refs.placeholder);
|
|
24
|
+
if (props.direction === "up") {
|
|
25
|
+
isReachEdge = scrollParentRect.top - placeholderRect.top <= offset;
|
|
26
|
+
} else {
|
|
27
|
+
isReachEdge = placeholderRect.bottom - scrollParentRect.bottom <= offset;
|
|
28
|
+
}
|
|
29
|
+
if (isReachEdge) {
|
|
30
|
+
state.loading = true;
|
|
31
|
+
emit("update:loading", true);
|
|
32
|
+
emit("load");
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const clickErrorText = ({ api, emit }) => () => {
|
|
36
|
+
emit("update:error", false);
|
|
37
|
+
api.check();
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
check,
|
|
41
|
+
clickErrorText,
|
|
42
|
+
clickList
|
|
43
|
+
};
|
package/load-list/vue.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { clickList, check, clickErrorText } from "./index";
|
|
3
|
+
import { getScrollParent } from "../common/deps/dom";
|
|
4
|
+
import { useRect } from "../common/deps/useRect";
|
|
5
|
+
import { useEventListener } from "../common/deps/useEventListener";
|
|
6
|
+
import debounce from "../common/deps/debounce";
|
|
7
|
+
const api = ["state", "clickList", "check", "clickErrorText"];
|
|
8
|
+
const renderless = (props, {
|
|
9
|
+
inject,
|
|
10
|
+
reactive,
|
|
11
|
+
computed,
|
|
12
|
+
onMounted,
|
|
13
|
+
unref,
|
|
14
|
+
watch,
|
|
15
|
+
onUpdated,
|
|
16
|
+
isRef,
|
|
17
|
+
onUnmounted,
|
|
18
|
+
onActivated,
|
|
19
|
+
onDeactivated,
|
|
20
|
+
toRef
|
|
21
|
+
}, { emit, vm, nextTick }) => {
|
|
22
|
+
const api2 = {};
|
|
23
|
+
const state = reactive({
|
|
24
|
+
loading: props.loading,
|
|
25
|
+
tabStatus: inject("TabStatus", null),
|
|
26
|
+
scrollParent: null,
|
|
27
|
+
scroller: computed(() => props.scroller || state.scrollParent)
|
|
28
|
+
});
|
|
29
|
+
Object.assign(api2, {
|
|
30
|
+
state,
|
|
31
|
+
clickList: clickList({ emit, props }),
|
|
32
|
+
useRect: useRect(unref),
|
|
33
|
+
check: debounce(+props.delay, check({ api: api2, emit, props, state, vm })),
|
|
34
|
+
clickErrorText: clickErrorText({ api: api2, emit }),
|
|
35
|
+
useEventListener: useEventListener({
|
|
36
|
+
unref,
|
|
37
|
+
isRef,
|
|
38
|
+
watch,
|
|
39
|
+
nextTick,
|
|
40
|
+
onMounted,
|
|
41
|
+
onUnmounted,
|
|
42
|
+
onActivated,
|
|
43
|
+
onDeactivated
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
watch(
|
|
47
|
+
() => [props.loading, props.finished, props.error],
|
|
48
|
+
() => api2.check()
|
|
49
|
+
);
|
|
50
|
+
watch(
|
|
51
|
+
() => state.tabStatus,
|
|
52
|
+
(tabActive) => tabActive && api2.check()
|
|
53
|
+
);
|
|
54
|
+
api2.useEventListener("scroll", api2.check, { target: toRef(state, "scroller"), passive: true });
|
|
55
|
+
onUpdated(() => {
|
|
56
|
+
state.loading = props.loading;
|
|
57
|
+
});
|
|
58
|
+
onMounted(() => {
|
|
59
|
+
state.scrollParent = getScrollParent(vm.$el);
|
|
60
|
+
if (props.immediateCheck) {
|
|
61
|
+
api2.check();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return api2;
|
|
65
|
+
};
|
|
66
|
+
export {
|
|
67
|
+
api,
|
|
68
|
+
renderless
|
|
69
|
+
};
|
package/locales/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "../common";
|
|
2
|
+
import { xss } from "../common/xss";
|
|
3
3
|
const getLocales = ({ api, service, state }) => () => {
|
|
4
4
|
Promise.all([service.getLocale(), service.getCurrentLocale()]).then(([locales, current]) => {
|
|
5
5
|
state.locales = locales || ["zhCN"];
|
|
@@ -14,12 +14,8 @@ const setText = (state) => () => {
|
|
|
14
14
|
};
|
|
15
15
|
const switchLanguage = ({ api, state, service }) => (lang) => {
|
|
16
16
|
const { locales, current } = state;
|
|
17
|
-
const domain = service.getDomain();
|
|
18
17
|
const hasMultiLocale = state.locales.length === 2;
|
|
19
18
|
state.current = hasMultiLocale ? state.current = locales.indexOf(current) === 0 ? locales[1] : locales[0] : lang;
|
|
20
|
-
const expires = new Date((/* @__PURE__ */ new Date()).getTime() + 36e5).toGMTString();
|
|
21
|
-
const currLang = state.current.substring(0, 2) === "zh" ? "zh" : "en";
|
|
22
|
-
document.cookie = `lang=${currLang};expires=${expires};domain=${domain};path=/`;
|
|
23
19
|
api.setText();
|
|
24
20
|
};
|
|
25
21
|
const changeLocale = ({ props, service, vnode }) => (value, oldValue) => {
|
package/logout/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "../common";
|
|
2
|
+
import { xss } from "../common/xss";
|
|
3
3
|
const logout = ({ service, state, props }) => () => {
|
|
4
4
|
let { isMock, isLocal, redirectUrl = "", getLogoutUrl, showLogin } = service;
|
|
5
5
|
if (typeof props.beforeLogout === "function" && !state.logout) {
|
package/milestone/index.js
CHANGED
|
@@ -32,14 +32,54 @@ const flagOperate = ({ constants, refs, state }) => ({ event, over, text }) => {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
const getMileIcon = ({ constants, props }) => (node) => {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const smbConstants = {
|
|
36
|
+
STATUS_COLOR_MAP: {
|
|
37
|
+
DEFAULT: {
|
|
38
|
+
BORDER_COLOR: "#C2C2C2",
|
|
39
|
+
BACKGROUND_COLOR: "#FFFFFF",
|
|
40
|
+
COLOR: "#191919",
|
|
41
|
+
BOX_SHADOW_PX: "0px 0px 0px 4px",
|
|
42
|
+
FLAG_CONTENT_CLS: ".content"
|
|
43
|
+
},
|
|
44
|
+
COMPLETED: {
|
|
45
|
+
BORDER_COLOR: "#191919",
|
|
46
|
+
BACKGROUND_COLOR: "#FFFFFF",
|
|
47
|
+
COLOR: "#191919",
|
|
48
|
+
BOX_SHADOW_PX: "0px 0px 0px 4px",
|
|
49
|
+
FLAG_CONTENT_CLS: ".content"
|
|
50
|
+
},
|
|
51
|
+
DOING: {
|
|
52
|
+
BORDER_COLOR: "#191919",
|
|
53
|
+
BACKGROUND_COLOR: "#191919",
|
|
54
|
+
COLOR: "#FFFFFF",
|
|
55
|
+
BOX_SHADOW_PX: "0px 0px 0px 4px",
|
|
56
|
+
FLAG_CONTENT_CLS: ".content"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const status = node[props.statusField];
|
|
61
|
+
const statusColor = props.milestonesStatus[status];
|
|
62
|
+
if (props.solid || status === constants.STATUS_MAP.DOING) {
|
|
63
|
+
return {
|
|
64
|
+
"background-color": statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR + "!important",
|
|
65
|
+
color: smbConstants.STATUS_COLOR_MAP.DOING.COLOR + "!important",
|
|
66
|
+
"border-color": statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BORDER_COLOR,
|
|
67
|
+
boxShadow: "unset"
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (status === constants.STATUS_MAP.COMPLETED) {
|
|
71
|
+
return {
|
|
72
|
+
"background-color": smbConstants.STATUS_COLOR_MAP.COMPLETED.BACKGROUND_COLOR + "!important",
|
|
73
|
+
color: statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.COLOR + "!important",
|
|
74
|
+
"border-color": statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.BORDER_COLOR,
|
|
75
|
+
boxShadow: "unset"
|
|
76
|
+
};
|
|
77
|
+
}
|
|
39
78
|
return {
|
|
40
|
-
background:
|
|
41
|
-
color:
|
|
42
|
-
|
|
79
|
+
background: smbConstants.STATUS_COLOR_MAP.DEFAULT.BACKGROUND_COLOR + "!important",
|
|
80
|
+
color: statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.COLOR + "!important",
|
|
81
|
+
"border-color": statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.BORDER_COLOR,
|
|
82
|
+
boxShadow: "unset"
|
|
43
83
|
};
|
|
44
84
|
};
|
|
45
85
|
const getMileContent = (props) => ({ data, index }) => {
|
|
@@ -65,11 +105,18 @@ const handleFlagClick = (emit) => ({ idx, flag }) => {
|
|
|
65
105
|
emit("flagclick", idx, flag);
|
|
66
106
|
emit("flag-click", idx, flag);
|
|
67
107
|
};
|
|
108
|
+
const getFlagStyle = (props) => ({ index, idx }) => {
|
|
109
|
+
return {
|
|
110
|
+
left: `calc(${100 / props.data[props.flagBefore ? index : index + 1][props.flagField].length * idx}% + ${idx * 8}px)`
|
|
111
|
+
};
|
|
112
|
+
};
|
|
68
113
|
export {
|
|
69
114
|
flagOperate,
|
|
115
|
+
getFlagStyle,
|
|
70
116
|
getLineColor,
|
|
71
117
|
getMileContent,
|
|
72
118
|
getMileIcon,
|
|
73
119
|
handleClick,
|
|
74
|
-
handleFlagClick
|
|
120
|
+
handleFlagClick,
|
|
121
|
+
hexToRgb
|
|
75
122
|
};
|
package/milestone/vue.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
handleClick,
|
|
4
|
+
flagOperate,
|
|
5
|
+
getMileIcon,
|
|
6
|
+
getMileContent,
|
|
7
|
+
getLineColor,
|
|
8
|
+
handleFlagClick,
|
|
9
|
+
hexToRgb,
|
|
10
|
+
getFlagStyle
|
|
11
|
+
} from "./index";
|
|
3
12
|
const api = [
|
|
4
13
|
"state",
|
|
5
14
|
"showTip",
|
|
@@ -10,7 +19,9 @@ const api = [
|
|
|
10
19
|
"getMileContent",
|
|
11
20
|
"getMileFlagStyle",
|
|
12
21
|
"getLineColor",
|
|
13
|
-
"getStatus"
|
|
22
|
+
"getStatus",
|
|
23
|
+
"hexToRgb",
|
|
24
|
+
"getFlagStyle"
|
|
14
25
|
];
|
|
15
26
|
const renderless = (props, { reactive }, { emit, refs, constants }) => {
|
|
16
27
|
const state = reactive({
|
|
@@ -23,7 +34,9 @@ const renderless = (props, { reactive }, { emit, refs, constants }) => {
|
|
|
23
34
|
handleFlagClick: handleFlagClick(emit),
|
|
24
35
|
handleClick: handleClick({ emit }),
|
|
25
36
|
getMileIcon: getMileIcon({ constants, props }),
|
|
26
|
-
flagOperate: flagOperate({ constants, refs, state })
|
|
37
|
+
flagOperate: flagOperate({ constants, refs, state }),
|
|
38
|
+
hexToRgb,
|
|
39
|
+
getFlagStyle: getFlagStyle(props)
|
|
27
40
|
};
|
|
28
41
|
return api2;
|
|
29
42
|
};
|
package/modal/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import PopupManager from "../common/deps/popup-manager";
|
|
|
5
5
|
import { getDomNode } from "../common/deps/dom";
|
|
6
6
|
import { getViewportWindow } from "../common/global";
|
|
7
7
|
const DragClass = "is__drag";
|
|
8
|
-
let timer;
|
|
9
8
|
const emitZoom = ({ params, parent, emit, event }) => {
|
|
10
9
|
let { $listeners, events = {} } = parent;
|
|
11
10
|
if ($listeners.zoom) {
|
|
@@ -83,12 +82,12 @@ const selfClickEvent = ({ api, parent, props }) => (event) => {
|
|
|
83
82
|
api.close("mask");
|
|
84
83
|
}
|
|
85
84
|
};
|
|
86
|
-
const mouseEnterEvent = () => () => {
|
|
87
|
-
clearTimeout(timer);
|
|
85
|
+
const mouseEnterEvent = (state) => () => {
|
|
86
|
+
clearTimeout(state.timer);
|
|
88
87
|
};
|
|
89
|
-
const mouseLeaveEvent = ({ api, props }) => () => {
|
|
88
|
+
const mouseLeaveEvent = ({ api, props, state }) => () => {
|
|
90
89
|
api.addMsgQueue();
|
|
91
|
-
timer = window.setTimeout(
|
|
90
|
+
state.timer = window.setTimeout(
|
|
92
91
|
() => {
|
|
93
92
|
api.close("close");
|
|
94
93
|
},
|
|
@@ -158,7 +157,7 @@ const open = ({
|
|
|
158
157
|
}, 10);
|
|
159
158
|
if (state.isMsg) {
|
|
160
159
|
api.addMsgQueue();
|
|
161
|
-
timer = window.setTimeout(
|
|
160
|
+
state.timer = window.setTimeout(
|
|
162
161
|
() => {
|
|
163
162
|
api.close(params.type);
|
|
164
163
|
},
|
|
@@ -226,6 +225,7 @@ const close = ({ emit, parent, props, state }) => (type) => {
|
|
|
226
225
|
setTimeout(() => {
|
|
227
226
|
state.visible = false;
|
|
228
227
|
let params = { type, $modal: parent };
|
|
228
|
+
emit("close", params);
|
|
229
229
|
if (events.hide) {
|
|
230
230
|
events.hide.call(parent, params);
|
|
231
231
|
} else {
|
package/modal/vue.js
CHANGED
|
@@ -70,7 +70,8 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
70
70
|
prevEvent: null,
|
|
71
71
|
options: [],
|
|
72
72
|
theme: props.tiny_theme,
|
|
73
|
-
boxStyle: computed(() => api2.computedBoxStyle())
|
|
73
|
+
boxStyle: computed(() => api2.computedBoxStyle()),
|
|
74
|
+
timer: 0
|
|
74
75
|
});
|
|
75
76
|
Object.assign(api2, {
|
|
76
77
|
state,
|
|
@@ -83,8 +84,8 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
83
84
|
mounted: mounted({ api: api2, parent, props, isMobileFirstMode, state }),
|
|
84
85
|
beforeUnmouted: beforeUnmouted({ api: api2, parent, isMobileFirstMode }),
|
|
85
86
|
selfClickEvent: selfClickEvent({ api: api2, parent, props }),
|
|
86
|
-
mouseEnterEvent: mouseEnterEvent(),
|
|
87
|
-
mouseLeaveEvent: mouseLeaveEvent({ api: api2, props }),
|
|
87
|
+
mouseEnterEvent: mouseEnterEvent(state),
|
|
88
|
+
mouseLeaveEvent: mouseLeaveEvent({ api: api2, props, state }),
|
|
88
89
|
updateZindex: updateZindex({ state, props }),
|
|
89
90
|
handleEvent: handleEvent({ api: api2, emit, parent, props, isMobileFirstMode }),
|
|
90
91
|
closeEvent: closeEvent(api2),
|
package/nav-menu/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import PopupManager from "../common/deps/popup-manager";
|
|
|
5
5
|
import { mapTree } from "../grid/static";
|
|
6
6
|
import { transformTreeData } from "../common/array";
|
|
7
7
|
import { on, off } from "../common/deps/dom";
|
|
8
|
-
import { xss } from "../common/xss
|
|
8
|
+
import { xss } from "../common/xss";
|
|
9
9
|
const { nextZIndex } = PopupManager;
|
|
10
10
|
const computedIsShowMore = ({ props, state }) => () => !/^(retract|fixed|hidden)$/.test(props.overflow) && state.more && state.more.length;
|
|
11
11
|
const computedPopClass = (state) => () => {
|
package/package.json
CHANGED
package/pager/index.js
CHANGED
|
@@ -13,6 +13,7 @@ const computedInternalLayout = ({ props }) => () => {
|
|
|
13
13
|
props.mode === "simple" && (layout = "sizes, total, prev, current, next");
|
|
14
14
|
props.mode === "complete" && (layout = "sizes, total, prev, pager, next, jumper");
|
|
15
15
|
props.mode === "fixed" && (layout = "prev,pager,next");
|
|
16
|
+
props.mode === "simplest" && (layout = "total, prev, simplest-pager, next");
|
|
16
17
|
} else if (!props.mode && props.layout || props.mode && props.layout) {
|
|
17
18
|
layout = props.layout;
|
|
18
19
|
} else {
|
|
@@ -52,6 +53,27 @@ const computedInternalPageCount = ({ props, state }) => () => {
|
|
|
52
53
|
}
|
|
53
54
|
return null;
|
|
54
55
|
};
|
|
56
|
+
const computedSimplestPagerOption = ({ props, state }) => () => {
|
|
57
|
+
const itemSizes = Math.max(1, Math.ceil(props.total / state.internalPageSize));
|
|
58
|
+
return Array.from({ length: itemSizes }).map((item, index) => ({
|
|
59
|
+
value: index + 1,
|
|
60
|
+
label: `${index + 1}/${itemSizes}`
|
|
61
|
+
}));
|
|
62
|
+
};
|
|
63
|
+
const computedSimplestPagerWidth = ({ state }) => () => {
|
|
64
|
+
const baseWidth = 60;
|
|
65
|
+
const num = String(state.internalCurrentPage).length + String(state.simplestPagerOption.length).length;
|
|
66
|
+
return baseWidth + num * 8;
|
|
67
|
+
};
|
|
68
|
+
const computedPageSizeText = ({ props, designConfig }) => () => {
|
|
69
|
+
if (props.pageSizeText) {
|
|
70
|
+
return props.pageSizeText;
|
|
71
|
+
}
|
|
72
|
+
if ((designConfig == null ? void 0 : designConfig.state) && Object.hasOwnProperty.call(designConfig.state, "pageSizeText")) {
|
|
73
|
+
return designConfig.state.pageSizeText;
|
|
74
|
+
}
|
|
75
|
+
return "";
|
|
76
|
+
};
|
|
55
77
|
const handleJumperFocus = ({ state }) => (e) => {
|
|
56
78
|
var _a;
|
|
57
79
|
state.jumperBackup = (_a = e.target) == null ? void 0 : _a.value;
|
|
@@ -344,7 +366,10 @@ export {
|
|
|
344
366
|
clickSizes,
|
|
345
367
|
computedInternalLayout,
|
|
346
368
|
computedInternalPageCount,
|
|
369
|
+
computedPageSizeText,
|
|
347
370
|
computedShowPager,
|
|
371
|
+
computedSimplestPagerOption,
|
|
372
|
+
computedSimplestPagerWidth,
|
|
348
373
|
computedTotalText,
|
|
349
374
|
copyEmit,
|
|
350
375
|
emitChange,
|
package/pager/vue.js
CHANGED
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
computedInternalLayout,
|
|
5
5
|
computedTotalText,
|
|
6
6
|
computedInternalPageCount,
|
|
7
|
+
computedSimplestPagerOption,
|
|
8
|
+
computedSimplestPagerWidth,
|
|
9
|
+
computedPageSizeText,
|
|
7
10
|
handleJumperFocus,
|
|
8
11
|
handleSizeChange,
|
|
9
12
|
handleJumperInput,
|
|
@@ -60,7 +63,7 @@ const api = [
|
|
|
60
63
|
"clickSizes"
|
|
61
64
|
];
|
|
62
65
|
const renderless = (props, { reactive, computed, watch }, { emit, vm, nextTick, t, designConfig }) => {
|
|
63
|
-
var _a, _b, _c, _d
|
|
66
|
+
var _a, _b, _c, _d;
|
|
64
67
|
const api2 = {};
|
|
65
68
|
const state = reactive({
|
|
66
69
|
showSizes: false,
|
|
@@ -71,14 +74,22 @@ const renderless = (props, { reactive, computed, watch }, { emit, vm, nextTick,
|
|
|
71
74
|
internalTotal: props.total,
|
|
72
75
|
jumperValue: "1",
|
|
73
76
|
jumperBackup: "1",
|
|
77
|
+
simplestPagerOption: computed(() => api2.computedSimplestPagerOption()),
|
|
78
|
+
simplestPagerWidth: computed(() => api2.computedSimplestPagerWidth()),
|
|
74
79
|
showPager: computed(() => api2.computedShowPager()),
|
|
75
80
|
internalLayout: computed(() => api2.computedInternalLayout()),
|
|
76
81
|
totalText: computed(() => api2.computedTotalText()),
|
|
77
82
|
internalPageCount: computed(() => api2.computedInternalPageCount()),
|
|
78
|
-
|
|
79
|
-
align: props.align || ((_c = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _c.align) || "
|
|
83
|
+
showJumperSuffix: (_b = (_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.showJumperSuffix) != null ? _b : true,
|
|
84
|
+
align: props.align || ((_c = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _c.align) || "right",
|
|
80
85
|
totalI18n: ((_d = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _d.totalI18n) || "totals",
|
|
81
|
-
totalFixedLeft: (
|
|
86
|
+
totalFixedLeft: computed(
|
|
87
|
+
() => {
|
|
88
|
+
var _a2, _b2, _c2, _d2;
|
|
89
|
+
return (_d2 = (_c2 = (_b2 = props.totalFixedLeft) != null ? _b2 : (_a2 = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a2.totalFixedLeft) != null ? _c2 : props.mode !== "simplest") != null ? _d2 : true;
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
pageSizeText: computed(() => api2.computedPageSizeText())
|
|
82
93
|
});
|
|
83
94
|
Object.assign(api2, {
|
|
84
95
|
state,
|
|
@@ -86,6 +97,9 @@ const renderless = (props, { reactive, computed, watch }, { emit, vm, nextTick,
|
|
|
86
97
|
computedInternalLayout: computedInternalLayout({ props }),
|
|
87
98
|
computedTotalText: computedTotalText({ props, t }),
|
|
88
99
|
computedInternalPageCount: computedInternalPageCount({ props, state }),
|
|
100
|
+
computedSimplestPagerOption: computedSimplestPagerOption({ props, state }),
|
|
101
|
+
computedSimplestPagerWidth: computedSimplestPagerWidth({ state }),
|
|
102
|
+
computedPageSizeText: computedPageSizeText({ props, designConfig }),
|
|
89
103
|
getValidCurrentPage: getValidCurrentPage({ state }),
|
|
90
104
|
handleJumperFocus: handleJumperFocus({ state }),
|
|
91
105
|
handleSizeChange: handleSizeChange({ props, state, api: api2, emit, vm }),
|
package/picker/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const watchMobileVisible = ({ api, props, state, nextTick }) => ([dateMobileVisi
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
const watchPickerVisible = ({ api, vm, dispatch, emit, props, state, nextTick }) => (value) => {
|
|
50
|
-
if (props.readonly || state.pickerDisabled || state.
|
|
50
|
+
if (props.readonly || state.pickerDisabled || state.isMobileScreen)
|
|
51
51
|
return;
|
|
52
52
|
if (value) {
|
|
53
53
|
api.showPicker();
|
|
@@ -703,9 +703,9 @@ const handleClose = ({ api, props, state }) => () => {
|
|
|
703
703
|
const handleFocus = ({ emit, vm, state, api }) => () => {
|
|
704
704
|
const type = state.type;
|
|
705
705
|
if (DATEPICKER.TriggerTypes.includes(type)) {
|
|
706
|
-
if (state.
|
|
706
|
+
if (state.isMobileScreen && state.isDateMobileComponent) {
|
|
707
707
|
api.dateMobileToggle(true);
|
|
708
|
-
} else if (state.
|
|
708
|
+
} else if (state.isMobileScreen && state.isTimeMobileComponent) {
|
|
709
709
|
api.timeMobileToggle(true);
|
|
710
710
|
} else {
|
|
711
711
|
state.pickerVisible = true;
|
package/picker/vue.js
CHANGED
|
@@ -123,7 +123,7 @@ const initState = ({ api: api2, reactive, vm, computed, props, utils, parent, br
|
|
|
123
123
|
labelTooltip: "",
|
|
124
124
|
displayOnlyTooltip: "",
|
|
125
125
|
isDisplayOnly: computed(() => props.displayOnly || (parent.tinyForm || {}).displayOnly),
|
|
126
|
-
|
|
126
|
+
isMobileScreen: computed(() => breakpoint.current.value === "default"),
|
|
127
127
|
dateMobileOption: {
|
|
128
128
|
visible: false,
|
|
129
129
|
type: props.type,
|
package/popeditor/index.js
CHANGED
|
@@ -254,7 +254,7 @@ const initDisplay = ({ api, constants, props, state, nextTick }) => (value) => {
|
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
const openDialog = ({ api, props, state, emit }) => () => {
|
|
257
|
+
const openDialog = ({ api, props, state, emit, nextTick }) => () => {
|
|
258
258
|
if (state.disabled) {
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
@@ -264,6 +264,9 @@ const openDialog = ({ api, props, state, emit }) => () => {
|
|
|
264
264
|
state.showContent = true;
|
|
265
265
|
emit("popup");
|
|
266
266
|
props.autoLookup && props.alwaysLoad && api.query();
|
|
267
|
+
nextTick(() => {
|
|
268
|
+
api.computedTreeMaxHeight();
|
|
269
|
+
});
|
|
267
270
|
};
|
|
268
271
|
const localFilter = ({ props, state }) => {
|
|
269
272
|
const keys = Object.keys(state.search);
|
|
@@ -651,10 +654,18 @@ const selectedBoxDrag = ({ props, state }) => ({ state: { select } }) => {
|
|
|
651
654
|
state.selectedValues = values;
|
|
652
655
|
}
|
|
653
656
|
};
|
|
657
|
+
const computedTreeMaxHeight = ({ vm, state }) => () => {
|
|
658
|
+
var _a;
|
|
659
|
+
const dialogBoxEl = vm.$refs.popeditorDialogBox.$el;
|
|
660
|
+
const searchInputBottom = 20;
|
|
661
|
+
const searchInputHeight = ((_a = dialogBoxEl.querySelector(".tiny-popeditor__filter-input")) == null ? void 0 : _a.clientHeight) || 0;
|
|
662
|
+
state.treeWrapperMaxHeight = `${dialogBoxEl.querySelector(".tiny-dialog-box__body").clientHeight - searchInputHeight - searchInputBottom}px`;
|
|
663
|
+
};
|
|
654
664
|
export {
|
|
655
665
|
closeSuggestPanel,
|
|
656
666
|
computedGetTitle,
|
|
657
667
|
computedModalWidth,
|
|
668
|
+
computedTreeMaxHeight,
|
|
658
669
|
computedTreeOp,
|
|
659
670
|
createSearchForm,
|
|
660
671
|
doClear,
|
package/popeditor/vue.js
CHANGED
|
@@ -46,7 +46,8 @@ import {
|
|
|
46
46
|
selectedBoxClear,
|
|
47
47
|
selectedBoxDelete,
|
|
48
48
|
selectedBoxDrag,
|
|
49
|
-
radioChangeFn
|
|
49
|
+
radioChangeFn,
|
|
50
|
+
computedTreeMaxHeight
|
|
50
51
|
} from "./index";
|
|
51
52
|
const api = [
|
|
52
53
|
"state",
|
|
@@ -76,7 +77,8 @@ const api = [
|
|
|
76
77
|
"selectedBoxClear",
|
|
77
78
|
"selectedBoxDelete",
|
|
78
79
|
"selectedBoxDrag",
|
|
79
|
-
"radioChangeFn"
|
|
80
|
+
"radioChangeFn",
|
|
81
|
+
"computedTreeMaxHeight"
|
|
80
82
|
];
|
|
81
83
|
const initState = ({ reactive, computed, props, api: api2, constants, t, parent, vm }) => {
|
|
82
84
|
const state = reactive({
|
|
@@ -117,7 +119,8 @@ const initState = ({ reactive, computed, props, api: api2, constants, t, parent,
|
|
|
117
119
|
showSuggestPanel: false,
|
|
118
120
|
inputHover: false,
|
|
119
121
|
search: null,
|
|
120
|
-
closeSuggestPanelInvoker: null
|
|
122
|
+
closeSuggestPanelInvoker: null,
|
|
123
|
+
treeWrapperMaxHeight: "auto"
|
|
121
124
|
});
|
|
122
125
|
return state;
|
|
123
126
|
};
|
|
@@ -140,7 +143,7 @@ const initApi = ({ api: api2, props, state, parent, vm, emit, popper, constants,
|
|
|
140
143
|
selectedGridSelectAll: selectedGridSelectAll({ constants, props, vm, state }),
|
|
141
144
|
selectedGridSelectChange: selectedGridSelectChange({ constants, props, vm, state }),
|
|
142
145
|
handleReset: handleReset({ api: api2, state, props }),
|
|
143
|
-
openDialog: openDialog({ api: api2, emit, props, state }),
|
|
146
|
+
openDialog: openDialog({ api: api2, emit, props, state, nextTick }),
|
|
144
147
|
initDisplay: initDisplay({ api: api2, constants, props, state, nextTick }),
|
|
145
148
|
handleSearch: handleSearch({ api: api2, props, state, vm, constants }),
|
|
146
149
|
computedTreeOp: computedTreeOp({ api: api2, constants }),
|
|
@@ -167,7 +170,8 @@ const initApi = ({ api: api2, props, state, parent, vm, emit, popper, constants,
|
|
|
167
170
|
selectedBoxClear: selectedBoxClear(api2),
|
|
168
171
|
selectedBoxDelete: selectedBoxDelete(api2),
|
|
169
172
|
selectedBoxDrag: selectedBoxDrag({ props, state }),
|
|
170
|
-
radioChangeFn: radioChangeFn({ props, api: api2 })
|
|
173
|
+
radioChangeFn: radioChangeFn({ props, api: api2 }),
|
|
174
|
+
computedTreeMaxHeight: computedTreeMaxHeight({ vm, state })
|
|
171
175
|
});
|
|
172
176
|
state.search = api2.createSearchForm(false);
|
|
173
177
|
};
|