@opentiny/vue-renderless 3.18.5 → 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/fluent-editor/options.js +26 -24
- 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/action-menu/index.js
CHANGED
|
@@ -9,14 +9,14 @@ const computedMaxShowNum = ({ props, state }) => () => {
|
|
|
9
9
|
return 2;
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
const computedSpacing = ({ props, state }) => () => {
|
|
12
|
+
const computedSpacing = ({ props, state, designConfig }) => () => {
|
|
13
13
|
if (props.spacing !== void 0) {
|
|
14
14
|
return String(props.spacing).includes("px") ? props.spacing : props.spacing + "px";
|
|
15
15
|
}
|
|
16
16
|
if (state.isCardMode) {
|
|
17
17
|
return "10px";
|
|
18
18
|
} else {
|
|
19
|
-
return "
|
|
19
|
+
return (designConfig == null ? void 0 : designConfig.props.spacing) || "8px";
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
const computedMoreText = ({ props, state, t }) => () => {
|
package/action-menu/vue.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
computedSuffixIcon
|
|
10
10
|
} from "./index";
|
|
11
11
|
const api = ["state", "handleMoreClick", "handleItemClick", "visibleChange"];
|
|
12
|
-
const renderless = (props, { computed, reactive }, { emit, t }) => {
|
|
12
|
+
const renderless = (props, { computed, reactive }, { emit, t, designConfig }) => {
|
|
13
13
|
const api2 = {};
|
|
14
14
|
const state = reactive({
|
|
15
15
|
visibleOptions: computed(() => props.options.slice(0, state.maxShowNum)),
|
|
@@ -26,7 +26,7 @@ const renderless = (props, { computed, reactive }, { emit, t }) => {
|
|
|
26
26
|
handleItemClick: handleItemClick(emit),
|
|
27
27
|
visibleChange: visibleChange(emit),
|
|
28
28
|
computedMaxShowNum: computedMaxShowNum({ props, state }),
|
|
29
|
-
computedSpacing: computedSpacing({ props, state }),
|
|
29
|
+
computedSpacing: computedSpacing({ props, state, designConfig }),
|
|
30
30
|
computedMoreText: computedMoreText({ props, state, t }),
|
|
31
31
|
computedSuffixIcon: computedSuffixIcon({ props, state })
|
|
32
32
|
});
|
package/anchor/index.js
CHANGED
|
@@ -94,7 +94,7 @@ const setChildOffsetTop = ({ state, props }) => {
|
|
|
94
94
|
if (!((_a = props.links) == null ? void 0 : _a.length)) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
state.
|
|
97
|
+
state.childOffsetTop = ((_b = document.querySelector(props.links[0].link)) == null ? void 0 : _b.offsetTop) || 0;
|
|
98
98
|
};
|
|
99
99
|
const getContainer = ({ props }) => () => props.containerId && document.querySelector(props.containerId) || document.body;
|
|
100
100
|
const mounted = ({ state, api, props, nextTick }) => () => {
|
|
@@ -118,12 +118,14 @@ const unmounted = ({ state, api }) => () => {
|
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
const onItersectionObserver = ({ state, props, api, vm, emit }) => () => {
|
|
121
|
-
const { expandLink, scrollContainer } = state;
|
|
121
|
+
const { expandLink, scrollContainer, childOffsetTop } = state;
|
|
122
|
+
const { offsetTop } = props;
|
|
122
123
|
state.currentLink && updateSkidPosition({ vm, state, emit });
|
|
124
|
+
const rootMargin = offsetTop ? `${-offsetTop}px 0px 0px 0px` : "";
|
|
123
125
|
state.intersectionObserver = new IntersectionObserver(
|
|
124
126
|
(entries) => {
|
|
125
127
|
const { top } = scrollContainer.getBoundingClientRect();
|
|
126
|
-
const scrollStartTop = top +
|
|
128
|
+
const scrollStartTop = top + childOffsetTop + offsetTop;
|
|
127
129
|
entries.forEach((item) => {
|
|
128
130
|
const key = item.target.id;
|
|
129
131
|
state.observerLinks[key] = item;
|
|
@@ -141,7 +143,7 @@ const onItersectionObserver = ({ state, props, api, vm, emit }) => () => {
|
|
|
141
143
|
for (let key in state.observerLinks) {
|
|
142
144
|
if (Object.prototype.hasOwnProperty.call(state.observerLinks, key)) {
|
|
143
145
|
const item = state.observerLinks[key];
|
|
144
|
-
if (item.isIntersecting && item.intersectionRatio >= 0 && item.target.getBoundingClientRect().top
|
|
146
|
+
if (item.isIntersecting && item.intersectionRatio >= 0 && item.target.getBoundingClientRect().top <= scrollStartTop) {
|
|
145
147
|
const link = `#${item.target.id}`;
|
|
146
148
|
if (!expandLink[link].children) {
|
|
147
149
|
api.getCurrentAnchor(link);
|
|
@@ -153,7 +155,7 @@ const onItersectionObserver = ({ state, props, api, vm, emit }) => () => {
|
|
|
153
155
|
}
|
|
154
156
|
}
|
|
155
157
|
},
|
|
156
|
-
{ root: scrollContainer, threshold: [0, 0.25, 0.5, 1] }
|
|
158
|
+
{ root: scrollContainer, threshold: [0, 0.25, 0.5, 1], rootMargin }
|
|
157
159
|
);
|
|
158
160
|
addObserver({ props, state });
|
|
159
161
|
};
|
|
@@ -169,7 +171,7 @@ const linkClick = ({ state, vm, emit, props, api }) => (e, item) => {
|
|
|
169
171
|
setMarkClass({ state, props });
|
|
170
172
|
if (scrollContainer && scrollContainer !== document.body && !isChangeHash) {
|
|
171
173
|
const linkEl = scrollContainer.querySelector(item.link);
|
|
172
|
-
const top = (linkEl == null ? void 0 : linkEl.
|
|
174
|
+
const top = (linkEl == null ? void 0 : linkEl.getBoundingClientRect().top) - scrollContainer.getBoundingClientRect().top + scrollContainer.scrollTop - props.offsetTop;
|
|
173
175
|
const param = { top, left: 0, behavior: "smooth" };
|
|
174
176
|
scrollContainer == null ? void 0 : scrollContainer.scrollTo(param);
|
|
175
177
|
scrollContainer == null ? void 0 : scrollContainer.addEventListener("scroll", api.handleScroll());
|
package/anchor/vue.js
CHANGED
package/badge/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
const computedContent = ({ props, state }) => () => typeof
|
|
2
|
+
const computedContent = ({ props, state }) => () => (typeof props.value === "number" || typeof props.value === "string") && typeof props.max === "number" ? props.max < Number(state.valueRef) ? `${props.max}+` : state.valueRef : state.valueRef;
|
|
3
3
|
const computedValueRef = ({ props }) => () => {
|
|
4
|
-
if (typeof props.value === "number") {
|
|
4
|
+
if (typeof props.value === "number" || typeof props.value === "string") {
|
|
5
5
|
return props.value;
|
|
6
|
+
} else {
|
|
7
|
+
return void 0;
|
|
6
8
|
}
|
|
7
|
-
return typeof props.modelValue === "number" ? props.modelValue : void 0;
|
|
8
9
|
};
|
|
9
10
|
const computedTransform = ({ designConfig, props }) => () => {
|
|
10
11
|
if ((designConfig == null ? void 0 : designConfig.transform) === "unset") {
|
package/base-select/index.js
CHANGED
|
@@ -420,7 +420,7 @@ const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designCo
|
|
|
420
420
|
if (!state.isDisplayOnly && (props.hoverExpand || props.clickExpand) && !props.disabled) {
|
|
421
421
|
api.calcCollapseTags();
|
|
422
422
|
}
|
|
423
|
-
const sizeInMap = (designConfig == null ? void 0 : designConfig.state.initialInputHeight) || state.initialInputHeight ||
|
|
423
|
+
const sizeInMap = (designConfig == null ? void 0 : designConfig.state.initialInputHeight) || state.initialInputHeight || 32;
|
|
424
424
|
const noSelected = state.selected.length === 0;
|
|
425
425
|
const spacingHeight = designConfig ? (_a = designConfig.state) == null ? void 0 : _a.spacingHeight : constants.SPACING_HEIGHT;
|
|
426
426
|
if (!state.isDisplayOnly) {
|
|
@@ -1198,7 +1198,7 @@ const mounted = ({ api, parent, state, props, vm, designConfig }) => () => {
|
|
|
1198
1198
|
document.activeElement.blur();
|
|
1199
1199
|
}
|
|
1200
1200
|
state.completed = true;
|
|
1201
|
-
const defaultSizeMap = { default:
|
|
1201
|
+
const defaultSizeMap = { default: 32, mini: 24, small: 36, medium: 40 };
|
|
1202
1202
|
const sizeMap = ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.sizeMap) || defaultSizeMap;
|
|
1203
1203
|
if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
|
|
1204
1204
|
state.currentPlaceholder = "";
|
|
@@ -1249,7 +1249,7 @@ const optmzApis = {
|
|
|
1249
1249
|
vm.$refs.scrollbar.$el.querySelectorAll(
|
|
1250
1250
|
'.tiny-recycle-scroller__slot, .tiny-recycle-scroller__item-view:not([style*="transform: translateY(-9999px) translateX(0px)"])'
|
|
1251
1251
|
)
|
|
1252
|
-
).map((item) => item.querySelector(`[data-tag="tiny-
|
|
1252
|
+
).map((item) => item.querySelector(`[data-tag="tiny-option"]:not(${querySelectKey})`)).filter((v) => v);
|
|
1253
1253
|
},
|
|
1254
1254
|
setScrollTop: ({ refs, state }) => {
|
|
1255
1255
|
const { optimizeStore } = state;
|
package/breadcrumb-item/vue.js
CHANGED
|
@@ -7,7 +7,7 @@ const renderless = (props, { reactive, inject, computed }, { refs, router, emit,
|
|
|
7
7
|
const constants = breadcrumb._constants;
|
|
8
8
|
const state = reactive({
|
|
9
9
|
size: inject("size", null),
|
|
10
|
-
separator: computed(() => breadcrumb.separator || (designConfig == null ? void 0 : designConfig.separator) || "
|
|
10
|
+
separator: computed(() => breadcrumb.separator || (designConfig == null ? void 0 : designConfig.separator) || "/")
|
|
11
11
|
});
|
|
12
12
|
const api2 = {
|
|
13
13
|
state,
|
package/bulletin-board/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "../common/xss
|
|
2
|
+
import { xss } from "../common/xss";
|
|
3
3
|
const getRoute = (route) => `/${route || ""}`.replace(/^\/+/, "/");
|
|
4
4
|
const computedDataList = ({ props, state }) => () => {
|
|
5
5
|
const list = props.data[Number(state.actName) - 1] || [];
|
package/button/index.js
CHANGED
package/button-group/index.js
CHANGED
|
@@ -23,7 +23,12 @@ const getItemClass = ({ props, state }) => (node) => {
|
|
|
23
23
|
if (state.disabled || node.disabled) {
|
|
24
24
|
return { disabled: true };
|
|
25
25
|
}
|
|
26
|
-
return props.plain ? {
|
|
26
|
+
return props.plain ? {
|
|
27
|
+
plain: props.plain,
|
|
28
|
+
medium: props.size === "medium",
|
|
29
|
+
small: props.size === "small",
|
|
30
|
+
mini: props.size === "mini"
|
|
31
|
+
} : {};
|
|
27
32
|
};
|
|
28
33
|
export {
|
|
29
34
|
getItemClass,
|
package/carousel-item/index.js
CHANGED
|
@@ -46,7 +46,7 @@ const translateItem = ({ api, CARD_SCALE, parent, state, carouselParent }) => ({
|
|
|
46
46
|
} else {
|
|
47
47
|
state.active = index === activeIndex;
|
|
48
48
|
if (length === 2 && !state.active) {
|
|
49
|
-
state.translate = vnode.type === TYPE_VERTICAL ?
|
|
49
|
+
state.translate = vnode.type === TYPE_VERTICAL ? parentHeight : parentWidth;
|
|
50
50
|
} else {
|
|
51
51
|
state.translate = vnode.type === TYPE_VERTICAL ? parentHeight * (index - activeIndex) : parentWidth * (index - activeIndex);
|
|
52
52
|
}
|
package/cascader/vue.js
CHANGED
|
@@ -68,7 +68,8 @@ const initState = ({
|
|
|
68
68
|
t,
|
|
69
69
|
constants,
|
|
70
70
|
vm,
|
|
71
|
-
inject
|
|
71
|
+
inject,
|
|
72
|
+
designConfig
|
|
72
73
|
}) => {
|
|
73
74
|
const state = reactive({
|
|
74
75
|
showAutoWidth: inject("showAutoWidth", null),
|
|
@@ -102,7 +103,8 @@ const initState = ({
|
|
|
102
103
|
collapseTagsLength: 0,
|
|
103
104
|
isHidden: false,
|
|
104
105
|
tooltipVisible: false,
|
|
105
|
-
tooltipContent: ""
|
|
106
|
+
tooltipContent: "",
|
|
107
|
+
tagTypeWhenMultiple: (designConfig == null ? void 0 : designConfig.tagTypeWhenMultiple) || ""
|
|
106
108
|
});
|
|
107
109
|
return state;
|
|
108
110
|
};
|
|
@@ -206,7 +208,7 @@ const renderless = (props, {
|
|
|
206
208
|
toRefs,
|
|
207
209
|
watch,
|
|
208
210
|
inject
|
|
209
|
-
}, { t, emit, nextTick, constants, parent, slots, dispatch, vm }) => {
|
|
211
|
+
}, { t, emit, nextTick, constants, parent, slots, dispatch, vm, designConfig }) => {
|
|
210
212
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
211
213
|
const { updatePopper } = userPopper({
|
|
212
214
|
reactive,
|
|
@@ -228,7 +230,18 @@ const renderless = (props, {
|
|
|
228
230
|
onDeactivated
|
|
229
231
|
});
|
|
230
232
|
const api2 = {};
|
|
231
|
-
const state = initState({
|
|
233
|
+
const state = initState({
|
|
234
|
+
reactive,
|
|
235
|
+
props,
|
|
236
|
+
computed,
|
|
237
|
+
parent,
|
|
238
|
+
api: api2,
|
|
239
|
+
t,
|
|
240
|
+
constants,
|
|
241
|
+
vm,
|
|
242
|
+
inject,
|
|
243
|
+
designConfig
|
|
244
|
+
});
|
|
232
245
|
initApi({ api: api2, state, constants, dispatch, emit, vm, props, updatePopper, nextTick, parent, t });
|
|
233
246
|
initWatch({ watch, state, api: api2, props, nextTick, updatePopper });
|
|
234
247
|
onBeforeUpdate(api2.handleBeforeUpdate);
|
package/chart-core/deps/utils.js
CHANGED
|
@@ -7,7 +7,7 @@ import { isObject, typeOf as getType, isNull } from "../../common/type";
|
|
|
7
7
|
import _debounce from "../../common/deps/debounce";
|
|
8
8
|
import _numerify from "./numerify";
|
|
9
9
|
import { escapeHtml } from "../../common/string";
|
|
10
|
-
import { xss } from "../../common";
|
|
10
|
+
import { xss } from "../../common/xss";
|
|
11
11
|
import { setObj, getObj, isEqual } from "../../common/object";
|
|
12
12
|
import { typeOf, isObject as isObject2 } from "../../common/type";
|
|
13
13
|
const debounce = (callback, delay) => _debounce(delay, false, callback);
|
package/checkbox/index.js
CHANGED
|
@@ -111,7 +111,7 @@ const computedIsGroupDisplayOnly = ({ state }) => () => state.isGroup && (state.
|
|
|
111
111
|
const computedDisplayLabel = ({ state, props, t }) => () => {
|
|
112
112
|
state.showLabel = true;
|
|
113
113
|
if (props.trueLabel !== void 0 && props.falseLabel !== void 0) {
|
|
114
|
-
return props.modelValue
|
|
114
|
+
return props.modelValue;
|
|
115
115
|
} else {
|
|
116
116
|
return props.modelValue ? t("yes") : t("no");
|
|
117
117
|
}
|
package/common/deps/dom.js
CHANGED
|
@@ -170,6 +170,13 @@ const getScrollParent = (el, root = defaultRoot) => {
|
|
|
170
170
|
}
|
|
171
171
|
return root;
|
|
172
172
|
};
|
|
173
|
+
const useScrollParent = ({ onMounted, ref, watch }) => (elRef, root = defaultRoot) => {
|
|
174
|
+
const scrollParent = ref();
|
|
175
|
+
const setScrollParent = () => scrollParent.value = getScrollParent(elRef.value, root);
|
|
176
|
+
watch(elRef, setScrollParent);
|
|
177
|
+
onMounted(() => elRef.value && setScrollParent());
|
|
178
|
+
return scrollParent;
|
|
179
|
+
};
|
|
173
180
|
const isDisplayNone = (elm) => {
|
|
174
181
|
if (isServer)
|
|
175
182
|
return false;
|
|
@@ -205,5 +212,6 @@ export {
|
|
|
205
212
|
preventDefault,
|
|
206
213
|
removeClass,
|
|
207
214
|
setStyle,
|
|
208
|
-
stopPropagation
|
|
215
|
+
stopPropagation,
|
|
216
|
+
useScrollParent
|
|
209
217
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "../../chunk-G2ADBYYC.js";
|
|
2
|
+
import { on, isServer } from "./dom";
|
|
3
|
+
let width;
|
|
4
|
+
let height;
|
|
5
|
+
const useWindowSize = (ref) => () => {
|
|
6
|
+
if (!width) {
|
|
7
|
+
width = ref(0);
|
|
8
|
+
height = ref(0);
|
|
9
|
+
if (!isServer) {
|
|
10
|
+
const update = () => {
|
|
11
|
+
width.value = window.innerWidth;
|
|
12
|
+
height.value = window.innerHeight;
|
|
13
|
+
};
|
|
14
|
+
update();
|
|
15
|
+
on(window, "resize", update, { passive: true });
|
|
16
|
+
on(window, "orientationchange", update, { passive: true });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return { width, height };
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
useWindowSize
|
|
23
|
+
};
|
|
@@ -138,7 +138,7 @@ var vue_popper_default = (options) => {
|
|
|
138
138
|
};
|
|
139
139
|
const destroyPopper = (remove) => {
|
|
140
140
|
if (remove) {
|
|
141
|
-
if (state.popperElm) {
|
|
141
|
+
if (state.popperElm && state.popperElm.parentNode === document.body) {
|
|
142
142
|
off(state.popperElm, "click", stop);
|
|
143
143
|
state.popperElm.remove();
|
|
144
144
|
}
|
package/common/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { log as uLog, xss } from "./xss
|
|
2
|
+
import { log as uLog, xss } from "./xss";
|
|
3
3
|
const KEY_CODE = {
|
|
4
4
|
Backspace: 8,
|
|
5
5
|
Tab: 9,
|
|
@@ -237,7 +237,7 @@ const CASCADER = {
|
|
|
237
237
|
PropsHover: "hoverThreshold",
|
|
238
238
|
MenuConnector: "cascader-menu-"
|
|
239
239
|
};
|
|
240
|
-
const version = "3.
|
|
240
|
+
const version = "3.19.0";
|
|
241
241
|
const log = (data, type = "log") => {
|
|
242
242
|
uLog.logger[type](data);
|
|
243
243
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
const unknownProp = null;
|
|
3
|
+
const numericProp = [Number, String];
|
|
4
|
+
const truthProp = {
|
|
5
|
+
type: Boolean,
|
|
6
|
+
default: true
|
|
7
|
+
};
|
|
8
|
+
const makeRequiredProp = (type) => ({
|
|
9
|
+
type,
|
|
10
|
+
required: true
|
|
11
|
+
});
|
|
12
|
+
const makeArrayProp = () => ({
|
|
13
|
+
type: Array,
|
|
14
|
+
default: () => []
|
|
15
|
+
});
|
|
16
|
+
const makeNumberProp = (defaultVal) => ({
|
|
17
|
+
type: Number,
|
|
18
|
+
default: defaultVal
|
|
19
|
+
});
|
|
20
|
+
const makeNumericProp = (defaultVal) => ({
|
|
21
|
+
type: numericProp,
|
|
22
|
+
default: defaultVal
|
|
23
|
+
});
|
|
24
|
+
const makeStringProp = (defaultVal) => ({
|
|
25
|
+
type: String,
|
|
26
|
+
default: defaultVal
|
|
27
|
+
});
|
|
28
|
+
const makeStringValidProp = (defaultVal, optionals = []) => ({
|
|
29
|
+
type: String,
|
|
30
|
+
default: defaultVal,
|
|
31
|
+
validator: (val) => optionals.includes(val)
|
|
32
|
+
});
|
|
33
|
+
export {
|
|
34
|
+
makeArrayProp,
|
|
35
|
+
makeNumberProp,
|
|
36
|
+
makeNumericProp,
|
|
37
|
+
makeRequiredProp,
|
|
38
|
+
makeStringProp,
|
|
39
|
+
makeStringValidProp,
|
|
40
|
+
numericProp,
|
|
41
|
+
truthProp,
|
|
42
|
+
unknownProp
|
|
43
|
+
};
|
package/common/runtime.js
CHANGED
package/crop/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { on, off } from "../common/deps/dom";
|
|
3
3
|
import { toFileSize } from "../common/string";
|
|
4
|
-
const computedCropImages = ({ constants, t }) => () => t(constants.CROP_IMAGE);
|
|
5
4
|
const watchImageSrc = (state) => (value) => state.src = value;
|
|
6
|
-
const watchAlt = (state) => (value) => state.alt = value || "image";
|
|
7
5
|
const watchVisible = ({ api, state }) => (value) => {
|
|
8
6
|
if (value) {
|
|
9
7
|
on(document.body, "keydown", api.shortcutKeys);
|
|
@@ -13,35 +11,38 @@ const watchVisible = ({ api, state }) => (value) => {
|
|
|
13
11
|
state.cropvisible = value;
|
|
14
12
|
};
|
|
15
13
|
const shortcutKeys = (api) => (e) => {
|
|
16
|
-
if (e.keyCode
|
|
14
|
+
if (e.keyCode === 187 && e.ctrlKey) {
|
|
17
15
|
e.preventDefault();
|
|
18
16
|
api.zoom(0.1);
|
|
19
17
|
}
|
|
20
|
-
if (e.keyCode
|
|
18
|
+
if (e.keyCode === 189 && e.ctrlKey) {
|
|
21
19
|
e.preventDefault();
|
|
22
20
|
api.zoom(-0.1);
|
|
23
21
|
}
|
|
24
|
-
if (e.keyCode
|
|
22
|
+
if (e.keyCode === 38 && e.ctrlKey) {
|
|
25
23
|
e.preventDefault();
|
|
26
24
|
api.move(0, 1);
|
|
27
25
|
}
|
|
28
|
-
if (e.keyCode
|
|
26
|
+
if (e.keyCode === 40 && e.ctrlKey) {
|
|
29
27
|
e.preventDefault();
|
|
30
28
|
api.move(0, -1);
|
|
31
29
|
}
|
|
32
|
-
if (e.keyCode
|
|
30
|
+
if (e.keyCode === 37 && e.ctrlKey) {
|
|
33
31
|
e.preventDefault();
|
|
34
32
|
api.move(1, 0);
|
|
35
33
|
}
|
|
36
|
-
if (e.keyCode
|
|
34
|
+
if (e.keyCode === 39 && e.ctrlKey) {
|
|
37
35
|
e.preventDefault();
|
|
38
36
|
api.move(-1, 0);
|
|
39
37
|
}
|
|
38
|
+
if (e.keyCode === 27) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
api.closeCrop();
|
|
41
|
+
}
|
|
40
42
|
};
|
|
41
43
|
const closeCrop = ({ emit, state }) => () => {
|
|
42
44
|
emit("update:cropvisible", false);
|
|
43
45
|
emit("update:visible", false);
|
|
44
|
-
state.cropImg = "";
|
|
45
46
|
};
|
|
46
47
|
const createCrop = ({ emit, props, refs, state }) => () => {
|
|
47
48
|
const Cropper = props.plugin;
|
|
@@ -67,7 +68,6 @@ const createCrop = ({ emit, props, refs, state }) => () => {
|
|
|
67
68
|
minCropBoxHeight: props.minCropBoxHeight,
|
|
68
69
|
minContainerWidth: props.minContainerWidth,
|
|
69
70
|
minContainerHeight: props.minContainerHeight,
|
|
70
|
-
preview: document.querySelectorAll(".croppreview"),
|
|
71
71
|
ready() {
|
|
72
72
|
emit("ready");
|
|
73
73
|
},
|
|
@@ -88,19 +88,13 @@ const createCrop = ({ emit, props, refs, state }) => () => {
|
|
|
88
88
|
const closeCropArea = (api) => () => api.clear();
|
|
89
89
|
const clear = (state) => () => state.cropper.clear();
|
|
90
90
|
const cropImage = ({ api, emit, props, state }) => () => {
|
|
91
|
-
|
|
91
|
+
const canvas = api.getCroppedCanvas();
|
|
92
92
|
if (props.cropType.toLowerCase() === "base64") {
|
|
93
|
-
emit("cropdata",
|
|
93
|
+
emit("cropdata", canvas.toDataURL("image/jpeg", props.quality));
|
|
94
94
|
} else if (props.cropType.toLowerCase() === "blob") {
|
|
95
|
-
|
|
96
|
-
canvas.toBlob(
|
|
97
|
-
(blobObj) => {
|
|
98
|
-
emit("cropdata", blobObj);
|
|
99
|
-
},
|
|
100
|
-
"image/jpeg",
|
|
101
|
-
props.quality
|
|
102
|
-
);
|
|
95
|
+
canvas.toBlob((blobObj) => emit("cropdata", blobObj), "image/jpeg", props.quality);
|
|
103
96
|
}
|
|
97
|
+
api.closeCrop();
|
|
104
98
|
};
|
|
105
99
|
const getCroppedCanvas = (state) => () => state.cropper.getCroppedCanvas();
|
|
106
100
|
const getCropBoxData = (state) => () => state.cropper.getCropBoxData();
|
|
@@ -144,7 +138,6 @@ export {
|
|
|
144
138
|
clear,
|
|
145
139
|
closeCrop,
|
|
146
140
|
closeCropArea,
|
|
147
|
-
computedCropImages,
|
|
148
141
|
createCrop,
|
|
149
142
|
cropImage,
|
|
150
143
|
destroy,
|
|
@@ -171,7 +164,6 @@ export {
|
|
|
171
164
|
setImage,
|
|
172
165
|
shortcutKeys,
|
|
173
166
|
showFileChooser,
|
|
174
|
-
watchAlt,
|
|
175
167
|
watchImageSrc,
|
|
176
168
|
watchVisible,
|
|
177
169
|
zoom
|
package/crop/vue.js
CHANGED
|
@@ -5,8 +5,6 @@ import {
|
|
|
5
5
|
watchVisible,
|
|
6
6
|
clear,
|
|
7
7
|
replace,
|
|
8
|
-
computedCropImages,
|
|
9
|
-
watchAlt,
|
|
10
8
|
getCroppedCanvas,
|
|
11
9
|
setCanvasData,
|
|
12
10
|
setDragMode,
|
|
@@ -66,62 +64,70 @@ const api = [
|
|
|
66
64
|
"cropImage",
|
|
67
65
|
"zoom"
|
|
68
66
|
];
|
|
69
|
-
const initRenderIcon = (api2) => {
|
|
67
|
+
const initRenderIcon = (api2, t) => {
|
|
70
68
|
const renderIcon = [
|
|
71
69
|
{
|
|
72
70
|
method: () => api2.showFileChooser(),
|
|
73
|
-
icon: "IconNew"
|
|
71
|
+
icon: "IconNew",
|
|
72
|
+
title: t("ui.crop.choose")
|
|
74
73
|
},
|
|
74
|
+
{ split: true },
|
|
75
75
|
{
|
|
76
|
-
method: () => api2.zoom(0.1),
|
|
77
|
-
icon: "
|
|
76
|
+
method: () => api2.zoom(-0.1),
|
|
77
|
+
icon: "IconZoomOut",
|
|
78
|
+
title: t("ui.crop.zoomOut")
|
|
78
79
|
},
|
|
79
80
|
{
|
|
80
|
-
method: () => api2.zoom(
|
|
81
|
-
icon: "
|
|
81
|
+
method: () => api2.zoom(0.1),
|
|
82
|
+
icon: "IconZoomIn",
|
|
83
|
+
title: t("ui.crop.zoomIn")
|
|
82
84
|
},
|
|
83
85
|
{
|
|
84
86
|
method: () => api2.rotate(-45),
|
|
85
|
-
icon: "IconRepeat"
|
|
87
|
+
icon: "IconRepeat",
|
|
88
|
+
title: t("ui.crop.rotate_45")
|
|
86
89
|
},
|
|
87
90
|
{
|
|
88
91
|
method: () => api2.rotate(45),
|
|
89
|
-
icon: "IconRefres"
|
|
92
|
+
icon: "IconRefres",
|
|
93
|
+
title: t("ui.crop.rotate45")
|
|
90
94
|
},
|
|
95
|
+
{ split: true },
|
|
91
96
|
{
|
|
92
97
|
method: () => api2.closeCropArea(),
|
|
93
|
-
icon: "IconCrop"
|
|
98
|
+
icon: "IconCrop",
|
|
99
|
+
title: t("ui.crop.closeCropArea")
|
|
94
100
|
},
|
|
95
101
|
{
|
|
96
102
|
method: () => api2.reset(),
|
|
97
|
-
icon: "IconConmentRefresh"
|
|
103
|
+
icon: "IconConmentRefresh",
|
|
104
|
+
title: t("ui.crop.reset")
|
|
98
105
|
},
|
|
106
|
+
{ split: true },
|
|
99
107
|
{
|
|
100
|
-
method: () => api2.
|
|
101
|
-
icon: "
|
|
108
|
+
method: () => api2.closeCrop(),
|
|
109
|
+
icon: "IconClose",
|
|
110
|
+
title: t("ui.crop.closeCrop")
|
|
102
111
|
},
|
|
103
112
|
{
|
|
104
|
-
method: () => api2.
|
|
105
|
-
icon: "
|
|
113
|
+
method: () => api2.cropImage(),
|
|
114
|
+
icon: "IconYes",
|
|
115
|
+
title: t("ui.crop.cropImage")
|
|
106
116
|
}
|
|
107
117
|
];
|
|
108
118
|
return renderIcon;
|
|
109
119
|
};
|
|
110
|
-
const initState = ({ reactive, props,
|
|
120
|
+
const initState = ({ reactive, props, api: api2, t }) => {
|
|
111
121
|
const state = reactive({
|
|
112
122
|
src: props.src,
|
|
113
|
-
cropImg: "",
|
|
114
123
|
cropper: "",
|
|
115
|
-
alt: props.alt,
|
|
116
124
|
data: null,
|
|
117
125
|
cropvisible: props.cropvisible,
|
|
118
|
-
renderIcon: initRenderIcon(api2)
|
|
119
|
-
previewShow: props.previewShow,
|
|
120
|
-
cropImages: computed(() => api2.computedCropImages())
|
|
126
|
+
renderIcon: initRenderIcon(api2, t)
|
|
121
127
|
});
|
|
122
128
|
return state;
|
|
123
129
|
};
|
|
124
|
-
const initApi = ({ api: api2, state, emit, refs, props
|
|
130
|
+
const initApi = ({ api: api2, state, emit, refs, props }) => {
|
|
125
131
|
Object.assign(api2, {
|
|
126
132
|
state,
|
|
127
133
|
zoom: zoom(state),
|
|
@@ -138,7 +144,6 @@ const initApi = ({ api: api2, state, emit, refs, props, constants, t }) => {
|
|
|
138
144
|
getData: getData(state),
|
|
139
145
|
disable: disable(state),
|
|
140
146
|
destroy: destroy(state),
|
|
141
|
-
watchAlt: watchAlt(state),
|
|
142
147
|
setDragMode: setDragMode(state),
|
|
143
148
|
getImageData: getImageData(state),
|
|
144
149
|
watchImageSrc: watchImageSrc(state),
|
|
@@ -152,7 +157,7 @@ const initApi = ({ api: api2, state, emit, refs, props, constants, t }) => {
|
|
|
152
157
|
getCroppedCanvas: getCroppedCanvas(state),
|
|
153
158
|
getContainerData: getContainerData(state),
|
|
154
159
|
createCrop: createCrop({ emit, props, refs, state }),
|
|
155
|
-
computedCropImages: computedCropImages({ constants, t }),
|
|
160
|
+
// computedCropImages: computedCropImages({ constants, t }),
|
|
156
161
|
shortcutKeys: shortcutKeys(api2),
|
|
157
162
|
closeCropArea: closeCropArea(api2),
|
|
158
163
|
setImage: setImage({ api: api2, state, props }),
|
|
@@ -163,12 +168,11 @@ const initApi = ({ api: api2, state, emit, refs, props, constants, t }) => {
|
|
|
163
168
|
const initWatch = ({ watch, props, api: api2 }) => {
|
|
164
169
|
watch(() => props.cropvisible, api2.watchVisible);
|
|
165
170
|
watch(() => props.src, api2.watchImageSrc, { immediate: true });
|
|
166
|
-
watch(() => props.alt, api2.watchAlt, { immediate: true });
|
|
167
171
|
};
|
|
168
|
-
const renderless = (props, {
|
|
172
|
+
const renderless = (props, { onMounted, reactive, watch }, { emit, refs, t }) => {
|
|
169
173
|
const api2 = {};
|
|
170
|
-
const state = initState({ reactive, props,
|
|
171
|
-
initApi({ api: api2, state, emit, refs, props
|
|
174
|
+
const state = initState({ reactive, props, api: api2, t });
|
|
175
|
+
initApi({ api: api2, state, emit, refs, props });
|
|
172
176
|
onMounted(api2.createCrop);
|
|
173
177
|
initWatch({ watch, props, api: api2 });
|
|
174
178
|
return api2;
|
package/date-panel/index.js
CHANGED
|
@@ -219,8 +219,18 @@ const dateToLocaleStringForIE = (timezone, value) => {
|
|
|
219
219
|
const offsetTime = new Date(value).getTime() + offsetTimezone * 36e5;
|
|
220
220
|
return new Date(offsetTime);
|
|
221
221
|
};
|
|
222
|
-
const
|
|
223
|
-
|
|
222
|
+
const getNowTime = ({ props }) => () => {
|
|
223
|
+
return new Promise((resolve) => {
|
|
224
|
+
resolve(props.nowClick());
|
|
225
|
+
}).then((res) => {
|
|
226
|
+
return res;
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
const changeToNow = ({ api, state, props }) => async () => {
|
|
230
|
+
let now = /* @__PURE__ */ new Date();
|
|
231
|
+
if (props.nowClick !== void 0) {
|
|
232
|
+
now = await api.getNowTime();
|
|
233
|
+
}
|
|
224
234
|
const timezone = state.timezone;
|
|
225
235
|
const isServiceTimezone = timezone.isServiceTimezone;
|
|
226
236
|
let disabledDate = !state.disabledDate;
|
|
@@ -442,6 +452,7 @@ export {
|
|
|
442
452
|
getDefaultValue,
|
|
443
453
|
getDisabledConfirm,
|
|
444
454
|
getDisabledNow,
|
|
455
|
+
getNowTime,
|
|
445
456
|
getRenderTz,
|
|
446
457
|
getYearLabel,
|
|
447
458
|
handleClear,
|