@opentiny/vue-renderless 3.28.2 → 3.30.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/alert/vue.js +4 -1
- package/anchor/index.js +11 -1
- package/anchor/vue.js +2 -2
- package/base-select/index.js +6 -3
- package/base-select/vue.js +1 -1
- package/calendar-view/index.js +44 -2
- package/calendar-view/vue.js +6 -0
- package/date-range/index.js +1 -1
- package/dialog-box/vue.js +4 -1
- package/dialog-select/index.js +1 -1
- package/drawer/index.js +13 -1
- package/drawer/vue.js +13 -3
- package/fluent-editor/index.js +142 -10
- package/fluent-editor/vue.js +30 -8
- package/form-item/index.js +1 -1
- package/form-item/vue.js +11 -1
- package/grid-select/index.js +3 -3
- package/guide/index.js +17 -11
- package/guide/vue.js +2 -1
- package/input/vue.js +3 -2
- package/modal/index.js +11 -11
- package/modal/vue.js +3 -0
- package/notify/vue.js +4 -1
- package/package.json +3 -3
- package/picker/vue.js +3 -2
- package/qr-code/vue.js +3 -1
- package/rate/index.js +5 -4
- package/rate/vue.js +1 -1
- package/rich-text/index.js +91 -2
- package/rich-text/vue.js +11 -2
- package/search/vue.js +6 -1
- package/select/index.js +11 -3
- package/select/vue.js +5 -4
- package/statistic/index.js +48 -1
- package/statistic/vue.js +31 -11
- package/tabs-mf/index.js +10 -2
- package/tag-group/index.js +3 -0
- package/tag-input/index.js +91 -0
- package/tag-input/vue.js +72 -0
- package/time/index.js +22 -0
- package/time/vue.js +14 -2
- package/time-spinner/index.js +2 -2
- package/tree-select/index.js +49 -14
- package/types/action-menu.type.d.ts +4 -0
- package/types/alert.type.d.ts +2 -0
- package/types/anchor.type.d.ts +1 -1
- package/types/button-group.type.d.ts +5 -0
- package/types/date-picker.type.d.ts +1 -1
- package/types/dialog-box.type.d.ts +2 -0
- package/types/drawer.type.d.ts +7 -1
- package/types/{dropdown-item.type-b3ced3ce.d.ts → dropdown-item.type-f83b014f.d.ts} +1 -1
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-a54e1c06.d.ts → form.type-e0db2f7c.d.ts} +9 -0
- package/types/form.type.d.ts +1 -1
- package/types/modal.type.d.ts +2 -0
- package/types/popeditor.type.d.ts +2 -2
- package/types/rate.type.d.ts +5 -2
- package/types/search.type.d.ts +1 -0
- package/types/statistic.type.d.ts +17 -1
- package/types/tag-input.type.d.ts +113 -0
- package/types/tree-menu.type.d.ts +1 -1
- package/user/index.js +5 -5
package/statistic/vue.js
CHANGED
|
@@ -1,17 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../chunk-G2ADBYYC.js";
|
|
5
|
+
import { getIntegerAndDecimal, animateValue } from "./index";
|
|
6
|
+
const api = ["state", "getIntegerAndDecimal", "animateValue"];
|
|
4
7
|
const renderless = (props, hooks) => {
|
|
5
|
-
const
|
|
6
|
-
getIntegerAndDecimal: getIntegerAndDecimal({ props })
|
|
7
|
-
};
|
|
8
|
-
const { reactive, computed } = hooks;
|
|
8
|
+
const { reactive, computed, watch } = hooks;
|
|
9
9
|
const state = reactive({
|
|
10
|
-
value: computed(() => api2.getIntegerAndDecimal(props))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
value: computed(() => api2.getIntegerAndDecimal(props)),
|
|
11
|
+
animatingValue: props.value,
|
|
12
|
+
displayValue: computed(() => {
|
|
13
|
+
if (props.useAnimation) {
|
|
14
|
+
const tempProps = __spreadProps(__spreadValues({}, props), { value: state.animatingValue });
|
|
15
|
+
return getIntegerAndDecimal({ props: tempProps })();
|
|
16
|
+
}
|
|
17
|
+
return state.value;
|
|
18
|
+
})
|
|
14
19
|
});
|
|
20
|
+
const api2 = {
|
|
21
|
+
state,
|
|
22
|
+
getIntegerAndDecimal: getIntegerAndDecimal({ props }),
|
|
23
|
+
animateValue: animateValue({ props, state })
|
|
24
|
+
};
|
|
25
|
+
watch(
|
|
26
|
+
() => props.value,
|
|
27
|
+
(newVal) => {
|
|
28
|
+
if (props.useAnimation) {
|
|
29
|
+
state.animatingValue = props.startValue;
|
|
30
|
+
api2.animateValue();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{ immediate: true }
|
|
34
|
+
);
|
|
15
35
|
return api2;
|
|
16
36
|
};
|
|
17
37
|
export {
|
package/tabs-mf/index.js
CHANGED
|
@@ -39,7 +39,9 @@ const canLeave = (props) => (newTab, oldTab) => {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
const changeCurrentName = ({ emit, state }) => (name) => {
|
|
42
|
-
state.items.forEach((item) =>
|
|
42
|
+
state.items.forEach((item) => {
|
|
43
|
+
item.selected = item.name === name;
|
|
44
|
+
});
|
|
43
45
|
emit("update:activeName", name);
|
|
44
46
|
emit("update:modelValue", name);
|
|
45
47
|
};
|
|
@@ -111,7 +113,13 @@ const removeItem = ({ props, state, emit, api }) => (name, silent = false) => {
|
|
|
111
113
|
state.navs = [...state.navs];
|
|
112
114
|
if (isCurrent) {
|
|
113
115
|
const nextName = nextNav ? nextNav.name : ((_a = state.items[0]) == null ? void 0 : _a.name) || "";
|
|
114
|
-
|
|
116
|
+
if (silent) {
|
|
117
|
+
state.items.forEach((item) => {
|
|
118
|
+
item.selected = item.name === nextName;
|
|
119
|
+
});
|
|
120
|
+
} else {
|
|
121
|
+
api.changeCurrentName(nextName);
|
|
122
|
+
}
|
|
115
123
|
state.currentItem = state.items.find((item) => item.name === nextName) || null;
|
|
116
124
|
}
|
|
117
125
|
if (!silent) {
|
package/tag-group/index.js
CHANGED
|
@@ -26,6 +26,9 @@ const getHiddenTags = ({ props, vm, state }) => () => {
|
|
|
26
26
|
Array.from(tags).forEach((el, index) => {
|
|
27
27
|
const item = props.data[index];
|
|
28
28
|
const element = el;
|
|
29
|
+
if (element.offsetHeight === 0) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
29
32
|
if (element.offsetTop >= element.offsetHeight && item) {
|
|
30
33
|
state.hiddenTags.push(__spreadValues({}, item));
|
|
31
34
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
const addTag = ({ emit, props, state }) => () => {
|
|
3
|
+
const value = state.currentValue.trim();
|
|
4
|
+
if (!value) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
if (state.tagList.length >= props.max) {
|
|
8
|
+
state.currentValue = "";
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const tags = [...state.tagList || []];
|
|
12
|
+
let newTags = [value];
|
|
13
|
+
if (props.separator !== void 0) {
|
|
14
|
+
newTags = value.split(props.separator).filter((val) => val);
|
|
15
|
+
}
|
|
16
|
+
tags.push(...newTags);
|
|
17
|
+
state.tagList = tags;
|
|
18
|
+
emit("update:modelValue", tags);
|
|
19
|
+
state.currentValue = "";
|
|
20
|
+
};
|
|
21
|
+
const removeTag = ({ emit, props, state }) => (index) => {
|
|
22
|
+
state.tagList.splice(index, 1);
|
|
23
|
+
emit("update:modelValue", state.tagList);
|
|
24
|
+
};
|
|
25
|
+
const handleBackspace = ({ emit, props, state }) => () => {
|
|
26
|
+
if (state.currentValue === "") {
|
|
27
|
+
state.tagList.pop();
|
|
28
|
+
emit("update:modelValue", state.tagList);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const handleClear = ({ emit, props, state }) => () => {
|
|
32
|
+
state.tagList = [];
|
|
33
|
+
emit("update:modelValue", state.tagList);
|
|
34
|
+
state.currentValue = "";
|
|
35
|
+
};
|
|
36
|
+
const handleMouseOver = ({ state }) => (event) => {
|
|
37
|
+
state.isHovering = true;
|
|
38
|
+
};
|
|
39
|
+
const handleMouseLeave = ({ state }) => () => {
|
|
40
|
+
state.isHovering = false;
|
|
41
|
+
};
|
|
42
|
+
const handleInputFocus = ({ state }) => () => {
|
|
43
|
+
state.isFocused = true;
|
|
44
|
+
};
|
|
45
|
+
const handleInputBlur = ({ state }) => () => {
|
|
46
|
+
state.isFocused = false;
|
|
47
|
+
};
|
|
48
|
+
const handleDragStart = ({ state }) => (index, event) => {
|
|
49
|
+
var _a;
|
|
50
|
+
state.draggingIndex = index;
|
|
51
|
+
if (event.target) {
|
|
52
|
+
(_a = event.dataTransfer) == null ? void 0 : _a.setData("text/plain", event.target);
|
|
53
|
+
event.dataTransfer.effectAllowed = "move";
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const handleDragOver = () => (index, event) => {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
event.dataTransfer.dropEffect = "move";
|
|
59
|
+
};
|
|
60
|
+
const handleDragEnter = ({ state, emit }) => (index, event) => {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
if (index === state.draggingIndex)
|
|
63
|
+
return;
|
|
64
|
+
state.dragTargetIndex = index;
|
|
65
|
+
};
|
|
66
|
+
const handleDrop = ({ emit, props, state }) => (index, event) => {
|
|
67
|
+
var _a;
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
const newTags = [...(_a = state.tagList) != null ? _a : []];
|
|
70
|
+
const draggingTag = newTags[state.draggingIndex];
|
|
71
|
+
newTags.splice(state.draggingIndex, 1);
|
|
72
|
+
newTags.splice(state.dragTargetIndex, 0, draggingTag);
|
|
73
|
+
state.draggingIndex = null;
|
|
74
|
+
state.dragTargetIndex = null;
|
|
75
|
+
state.tagList = newTags;
|
|
76
|
+
emit("update:modelValue", newTags);
|
|
77
|
+
};
|
|
78
|
+
export {
|
|
79
|
+
addTag,
|
|
80
|
+
handleBackspace,
|
|
81
|
+
handleClear,
|
|
82
|
+
handleDragEnter,
|
|
83
|
+
handleDragOver,
|
|
84
|
+
handleDragStart,
|
|
85
|
+
handleDrop,
|
|
86
|
+
handleInputBlur,
|
|
87
|
+
handleInputFocus,
|
|
88
|
+
handleMouseLeave,
|
|
89
|
+
handleMouseOver,
|
|
90
|
+
removeTag
|
|
91
|
+
};
|
package/tag-input/vue.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import {
|
|
3
|
+
addTag,
|
|
4
|
+
removeTag,
|
|
5
|
+
handleBackspace,
|
|
6
|
+
handleClear,
|
|
7
|
+
handleMouseLeave,
|
|
8
|
+
handleMouseOver,
|
|
9
|
+
handleInputFocus,
|
|
10
|
+
handleInputBlur,
|
|
11
|
+
handleDragEnter,
|
|
12
|
+
handleDragStart,
|
|
13
|
+
handleDragOver,
|
|
14
|
+
handleDrop
|
|
15
|
+
} from "./index";
|
|
16
|
+
const api = [
|
|
17
|
+
"addTag",
|
|
18
|
+
"removeTag",
|
|
19
|
+
"state",
|
|
20
|
+
"handleBackspace",
|
|
21
|
+
"handleClear",
|
|
22
|
+
"handleMouseLeave",
|
|
23
|
+
"handleMouseOver",
|
|
24
|
+
"handleInputFocus",
|
|
25
|
+
"handleInputBlur",
|
|
26
|
+
"handleDragStart",
|
|
27
|
+
"handleDragOver",
|
|
28
|
+
"handleDragEnter",
|
|
29
|
+
"handleDrop"
|
|
30
|
+
];
|
|
31
|
+
const renderless = (props, { reactive, computed, ref }, { emit, parent }) => {
|
|
32
|
+
const state = reactive({
|
|
33
|
+
currentValue: "",
|
|
34
|
+
tagList: props.modelValue || [],
|
|
35
|
+
disabled: computed(() => props.disabled),
|
|
36
|
+
closeable: computed(() => !props.readonly && !props.disabled),
|
|
37
|
+
showClearIcon: computed(() => {
|
|
38
|
+
return props.clearable && !props.readonly && !props.disabled && (state.isHovering || state.isFocused) && ((props.modelValue || []).length > 0 || state.currentValue);
|
|
39
|
+
}),
|
|
40
|
+
showTagList: computed(() => {
|
|
41
|
+
const limit = props.minCollapsedNum < props.max ? props.minCollapsedNum : props.max;
|
|
42
|
+
return (state.tagList || []).slice(0, limit);
|
|
43
|
+
}),
|
|
44
|
+
collapsedTagList: computed(() => {
|
|
45
|
+
return props.minCollapsedNum < props.max ? (state.tagList || []).slice(props.minCollapsedNum) : [];
|
|
46
|
+
}),
|
|
47
|
+
isHovering: false,
|
|
48
|
+
isFocused: false,
|
|
49
|
+
draggingIndex: null,
|
|
50
|
+
dragTargetIndex: null
|
|
51
|
+
});
|
|
52
|
+
const api2 = {
|
|
53
|
+
state,
|
|
54
|
+
addTag: addTag({ emit, props, state }),
|
|
55
|
+
removeTag: removeTag({ emit, props, state }),
|
|
56
|
+
handleBackspace: handleBackspace({ emit, props, state }),
|
|
57
|
+
handleClear: handleClear({ emit, props, state }),
|
|
58
|
+
handleMouseLeave: handleMouseLeave({ state }),
|
|
59
|
+
handleMouseOver: handleMouseOver({ state }),
|
|
60
|
+
handleInputBlur: handleInputBlur({ state }),
|
|
61
|
+
handleInputFocus: handleInputFocus({ state }),
|
|
62
|
+
handleDragStart: handleDragStart({ emit, props, state }),
|
|
63
|
+
handleDragOver: handleDragOver(),
|
|
64
|
+
handleDragEnter: handleDragEnter({ emit, state }),
|
|
65
|
+
handleDrop: handleDrop({ emit, props, state })
|
|
66
|
+
};
|
|
67
|
+
return api2;
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
api,
|
|
71
|
+
renderless
|
|
72
|
+
};
|
package/time/index.js
CHANGED
|
@@ -19,11 +19,32 @@ const watchVisible = ({ nextTick, vm, state, api }) => (value) => {
|
|
|
19
19
|
state.oldValue = state.value;
|
|
20
20
|
vm.$refs.spinner.emitSelectRange("hours");
|
|
21
21
|
api.adjustSpinners();
|
|
22
|
+
api.adjustPosition();
|
|
22
23
|
});
|
|
23
24
|
} else {
|
|
24
25
|
state.needInitAdjust = true;
|
|
25
26
|
}
|
|
26
27
|
};
|
|
28
|
+
const adjustPosition = ({ vm, state }) => () => {
|
|
29
|
+
const panel = vm.$el;
|
|
30
|
+
if (!panel)
|
|
31
|
+
return;
|
|
32
|
+
const parentElement = panel.parentElement;
|
|
33
|
+
if (!parentElement)
|
|
34
|
+
return;
|
|
35
|
+
const parentRect = parentElement.getBoundingClientRect();
|
|
36
|
+
const viewportWidth = window.innerWidth || document.documentElement.clientWidth;
|
|
37
|
+
const panelWidth = panel.offsetWidth || 240;
|
|
38
|
+
const wouldOverflowRight = parentRect.left + panelWidth > viewportWidth;
|
|
39
|
+
const wouldOverflowLeft = parentRect.right - panelWidth < 0;
|
|
40
|
+
if (wouldOverflowRight && !wouldOverflowLeft) {
|
|
41
|
+
state.alignDirection = "right";
|
|
42
|
+
} else if (wouldOverflowLeft && !wouldOverflowRight) {
|
|
43
|
+
state.alignDirection = "left";
|
|
44
|
+
} else {
|
|
45
|
+
state.alignDirection = "";
|
|
46
|
+
}
|
|
47
|
+
};
|
|
27
48
|
const handleCancel = ({ state, emit }) => () => {
|
|
28
49
|
emit("pick", state.oldValue, false);
|
|
29
50
|
};
|
|
@@ -75,6 +96,7 @@ const displayValue = ({ state, t }) => () => {
|
|
|
75
96
|
return formattedValue;
|
|
76
97
|
};
|
|
77
98
|
export {
|
|
99
|
+
adjustPosition,
|
|
78
100
|
adjustSpinners,
|
|
79
101
|
changeSelectionRange,
|
|
80
102
|
displayValue,
|
package/time/vue.js
CHANGED
|
@@ -10,11 +10,20 @@ import {
|
|
|
10
10
|
handleChange,
|
|
11
11
|
setSelectionRange,
|
|
12
12
|
displayValue,
|
|
13
|
-
handleConfirm
|
|
13
|
+
handleConfirm,
|
|
14
|
+
adjustPosition
|
|
14
15
|
} from "./index";
|
|
15
16
|
import { compuAmPmMode } from "../time-range";
|
|
16
17
|
import { isDate1 as isDate } from "@opentiny/utils";
|
|
17
|
-
const api = [
|
|
18
|
+
const api = [
|
|
19
|
+
"state",
|
|
20
|
+
"handleChange",
|
|
21
|
+
"setSelectionRange",
|
|
22
|
+
"handleCancel",
|
|
23
|
+
"handleConfirm",
|
|
24
|
+
"adjustSpinners",
|
|
25
|
+
"adjustPosition"
|
|
26
|
+
];
|
|
18
27
|
const initState = ({ reactive, props, computed, api: api2 }) => {
|
|
19
28
|
const state = reactive({
|
|
20
29
|
popperClass: "",
|
|
@@ -30,6 +39,8 @@ const initState = ({ reactive, props, computed, api: api2 }) => {
|
|
|
30
39
|
visible: false,
|
|
31
40
|
showTimePickerButton: false,
|
|
32
41
|
needInitAdjust: true,
|
|
42
|
+
alignDirection: "",
|
|
43
|
+
// 对齐方向: 'left', 'right', 或 '' (默认)
|
|
33
44
|
displayValue: computed(() => api2.displayValue()),
|
|
34
45
|
showSeconds: computed(() => (state.format || "").includes("ss")),
|
|
35
46
|
useArrow: computed(() => state.arrowControl || props.timeArrowControl || false),
|
|
@@ -48,6 +59,7 @@ const renderless = (props, { computed, onMounted, reactive, watch, nextTick }, {
|
|
|
48
59
|
state,
|
|
49
60
|
compuAmPmMode: compuAmPmMode(state),
|
|
50
61
|
adjustSpinners: adjustSpinners(vm),
|
|
62
|
+
adjustPosition: adjustPosition({ vm, state }),
|
|
51
63
|
handleCancel: handleCancel({ state, emit }),
|
|
52
64
|
setSelectionRange: setSelectionRange({ state, emit }),
|
|
53
65
|
watchVisible: watchVisible({ nextTick, vm, state, api: api2 }),
|
package/time-spinner/index.js
CHANGED
|
@@ -75,7 +75,7 @@ const handleScroll = ({ api, vm, state }) => (type) => {
|
|
|
75
75
|
api.modifyDateField(type, value);
|
|
76
76
|
};
|
|
77
77
|
const selectDateScroll = ({ state, props }) => (type, value) => {
|
|
78
|
-
if (
|
|
78
|
+
if (props.endDate instanceof Date) {
|
|
79
79
|
const endHours = props.endDate.getHours();
|
|
80
80
|
const endMinutes = props.endDate.getMinutes();
|
|
81
81
|
const endSeconds = props.endDate.getSeconds();
|
|
@@ -86,7 +86,7 @@ const selectDateScroll = ({ state, props }) => (type, value) => {
|
|
|
86
86
|
} else {
|
|
87
87
|
value = state.hours === endHours && state.minutes === endMinutes && value > endSeconds ? state.seconds : value;
|
|
88
88
|
}
|
|
89
|
-
} else if (
|
|
89
|
+
} else if (props.startDate instanceof Date) {
|
|
90
90
|
const startHours = props.startDate.getHours();
|
|
91
91
|
const startMinutes = props.startDate.getMinutes();
|
|
92
92
|
const startSeconds = props.startDate.getSeconds();
|
package/tree-select/index.js
CHANGED
|
@@ -3,18 +3,35 @@ import {
|
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../chunk-G2ADBYYC.js";
|
|
5
5
|
import { find } from "@opentiny/utils";
|
|
6
|
+
const getSingleSelectedData = ({ props, data }) => __spreadProps(__spreadValues({}, data), {
|
|
7
|
+
currentLabel: data[props.textField],
|
|
8
|
+
value: data[props.valueField],
|
|
9
|
+
state: {
|
|
10
|
+
currentLabel: data[props.textField]
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
const updateSingleSelected = ({ props, vm, data }) => {
|
|
14
|
+
var _a;
|
|
15
|
+
vm.$refs.baseSelectRef.updateSelectedData(data);
|
|
16
|
+
const baseState = vm.$refs.baseSelectRef.state;
|
|
17
|
+
if (!baseState)
|
|
18
|
+
return;
|
|
19
|
+
const currentLabel = (_a = data == null ? void 0 : data[props.textField]) != null ? _a : "";
|
|
20
|
+
baseState.selectedLabel = currentLabel;
|
|
21
|
+
if (props.filterable || props.searchable) {
|
|
22
|
+
baseState.query = currentLabel;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
6
25
|
const filter = ({ vm }) => (value) => {
|
|
7
26
|
vm.$refs.treeRef.filter(value);
|
|
8
27
|
};
|
|
9
28
|
const nodeClick = ({ props, vm, emit }) => (data) => {
|
|
10
29
|
if (!props.multiple) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}));
|
|
30
|
+
updateSingleSelected({
|
|
31
|
+
props,
|
|
32
|
+
vm,
|
|
33
|
+
data: getSingleSelectedData({ props, data })
|
|
34
|
+
});
|
|
18
35
|
emit("change", data[props.valueField]);
|
|
19
36
|
emit("update:modelValue", data[props.valueField]);
|
|
20
37
|
vm.$refs.baseSelectRef.hidePanel();
|
|
@@ -114,17 +131,35 @@ const mounted = ({ api, state, props, vm }) => () => {
|
|
|
114
131
|
const data = options && options.length > 0 ? options[0] : null;
|
|
115
132
|
if (!data)
|
|
116
133
|
return;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
}));
|
|
134
|
+
updateSingleSelected({
|
|
135
|
+
props,
|
|
136
|
+
vm,
|
|
137
|
+
data: getSingleSelectedData({ props, data })
|
|
138
|
+
});
|
|
124
139
|
state.currentKey = data[props.valueField];
|
|
125
140
|
}
|
|
126
141
|
};
|
|
127
142
|
const watchValue = ({ api, props, vm, state }) => (newValue, oldValue) => {
|
|
143
|
+
if (!props.multiple) {
|
|
144
|
+
if (newValue === oldValue || newValue === state.currentKey)
|
|
145
|
+
return;
|
|
146
|
+
if (newValue === null || newValue === void 0 || newValue === "") {
|
|
147
|
+
updateSingleSelected({ props, vm, data: {} });
|
|
148
|
+
state.currentKey = "";
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const options = api.getPluginOption(newValue);
|
|
152
|
+
const data = options && options.length > 0 ? options[0] : null;
|
|
153
|
+
if (!data)
|
|
154
|
+
return;
|
|
155
|
+
updateSingleSelected({
|
|
156
|
+
props,
|
|
157
|
+
vm,
|
|
158
|
+
data: getSingleSelectedData({ props, data })
|
|
159
|
+
});
|
|
160
|
+
state.currentKey = data[props.valueField];
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
128
163
|
if (props.multiple) {
|
|
129
164
|
const xorResult = oldValue.filter((item) => !newValue.includes(item));
|
|
130
165
|
const tagId = xorResult[0];
|
package/types/alert.type.d.ts
CHANGED
|
@@ -113,6 +113,8 @@ interface IAlertState {
|
|
|
113
113
|
contentDefaultHeight: number;
|
|
114
114
|
contentMaxHeight: number;
|
|
115
115
|
scrollStatus: boolean;
|
|
116
|
+
titleId: string;
|
|
117
|
+
contentId: string;
|
|
116
118
|
}
|
|
117
119
|
type IAlertProps = ExtractPropTypes<typeof alertProps>;
|
|
118
120
|
type IAlertConstants = typeof $constants;
|
package/types/anchor.type.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ declare const mounted: ({ state, api, props, nextTick }: Pick<IAnchorRenderlessP
|
|
|
49
49
|
declare const updated: ({ api }: Pick<IAnchorRenderlessParams, 'api'>) => () => void;
|
|
50
50
|
declare const unmounted: ({ state, api }: Pick<IAnchorRenderlessParams, 'state' | 'api'>) => () => void;
|
|
51
51
|
declare const onItersectionObserver: ({ state, props, api, vm, emit }: Pick<IAnchorRenderlessParams, 'state' | 'props' | 'api' | 'vm' | 'emit'>) => () => void;
|
|
52
|
-
declare const linkClick: ({ state, vm, emit, props, api }: Pick<IAnchorRenderlessParams, 'state' | 'vm' | 'emit' | 'props' | 'api'>) => (e: Event, item: IAnchorLinkItem) => void;
|
|
52
|
+
declare const linkClick: ({ state, vm, emit, props, api, framework }: Pick<IAnchorRenderlessParams, 'state' | 'vm' | 'emit' | 'props' | 'api' | 'framework'>) => (e: Event, item: IAnchorLinkItem) => void;
|
|
53
53
|
|
|
54
54
|
type IAnchorObject = HTMLElement | null;
|
|
55
55
|
interface IAnchorState {
|
|
@@ -33,6 +33,11 @@ declare const buttonGroupProps: {
|
|
|
33
33
|
type: BooleanConstructor;
|
|
34
34
|
default: boolean;
|
|
35
35
|
};
|
|
36
|
+
displayMode: {
|
|
37
|
+
type: PropType<"default" | "merged">;
|
|
38
|
+
default: string;
|
|
39
|
+
validator: (val: string) => boolean;
|
|
40
|
+
};
|
|
36
41
|
tiny_mode: StringConstructor;
|
|
37
42
|
tiny_mode_root: BooleanConstructor;
|
|
38
43
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -120,7 +120,7 @@ declare const datePickerProps: {
|
|
|
120
120
|
underlay: {
|
|
121
121
|
type: ObjectConstructor;
|
|
122
122
|
};
|
|
123
|
-
}, () =>
|
|
123
|
+
}, () => _opentiny_vue_common.VNode<vue.RendererNode, vue.RendererElement, {
|
|
124
124
|
[key: string]: any;
|
|
125
125
|
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{
|
|
126
126
|
shape: {
|
package/types/drawer.type.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ declare const drawerProps: {
|
|
|
15
15
|
DEFAULT_HEIGHT: string;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
+
appendToBody: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: () => boolean;
|
|
21
|
+
};
|
|
18
22
|
visible: {
|
|
19
23
|
type: BooleanConstructor;
|
|
20
24
|
default: boolean;
|
|
@@ -80,7 +84,8 @@ declare const computedWidth: ({ state, designConfig, props, constants }: Pick<ID
|
|
|
80
84
|
declare const close: ({ api }: {
|
|
81
85
|
api: IDrawerApi;
|
|
82
86
|
}) => (force?: boolean) => void;
|
|
83
|
-
declare const
|
|
87
|
+
declare const closed: ({ state, emit }: Pick<IDrawerRenderlessParams, 'state' | 'emit'>) => () => void;
|
|
88
|
+
declare const watchVisible: ({ props, parent, api }: Pick<IDrawerRenderlessParams, 'props' | 'parent' | 'api'>) => (value: boolean) => void;
|
|
84
89
|
declare const open: ({ state, emit, vm }: Pick<IDrawerRenderlessParams, 'state' | 'emit' | 'vm'>) => () => void;
|
|
85
90
|
declare const confirm: ({ api }: {
|
|
86
91
|
api: IDrawerApi;
|
|
@@ -124,6 +129,7 @@ interface IDrawerApi {
|
|
|
124
129
|
open: ReturnType<typeof open>;
|
|
125
130
|
confirm: ReturnType<typeof confirm>;
|
|
126
131
|
close: ReturnType<typeof close>;
|
|
132
|
+
closed: ReturnType<typeof closed>;
|
|
127
133
|
mousemove: ReturnType<typeof mousemove>;
|
|
128
134
|
mouseup: ReturnType<typeof mouseup>;
|
|
129
135
|
mousedown: ReturnType<typeof mousedown>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { k as IDropdownItemApi, i as IDropdownItemConstants, q as IDropdownItemMfDataStore, p as IDropdownItemOptionStyle, h as IDropdownItemProps, m as IDropdownItemRenderlessParamUtils, l as IDropdownItemRenderlessParams, j as IDropdownItemState, n as IDropdownItemStyle, o as IDropdownItemTag, g as IDropdownItemVm } from './dropdown-item.type-
|
|
2
|
+
export { k as IDropdownItemApi, i as IDropdownItemConstants, q as IDropdownItemMfDataStore, p as IDropdownItemOptionStyle, h as IDropdownItemProps, m as IDropdownItemRenderlessParamUtils, l as IDropdownItemRenderlessParams, j as IDropdownItemState, n as IDropdownItemStyle, o as IDropdownItemTag, g as IDropdownItemVm } from './dropdown-item.type-f83b014f.js';
|
|
3
3
|
import './shared.type.js';
|
|
4
4
|
import './dropdown.type.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { b as IDropdownMenuApi, e as IDropdownMenuPopperParams, I as IDropdownMenuProps, d as IDropdownMenuRenderlessParamUtils, c as IDropdownMenuRenderlessParams, a as IDropdownMenuState, f as IDropdownMenuVm } from './dropdown-item.type-
|
|
2
|
+
export { b as IDropdownMenuApi, e as IDropdownMenuPopperParams, I as IDropdownMenuProps, d as IDropdownMenuRenderlessParamUtils, c as IDropdownMenuRenderlessParams, a as IDropdownMenuState, f as IDropdownMenuVm } from './dropdown-item.type-f83b014f.js';
|
|
3
3
|
import './shared.type.js';
|
|
4
4
|
import './dropdown.type.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-
|
|
2
|
+
export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-e0db2f7c.js';
|
|
3
3
|
import './shared.type.js';
|
|
@@ -137,6 +137,10 @@ declare const formItemProps: {
|
|
|
137
137
|
};
|
|
138
138
|
messageType: StringConstructor;
|
|
139
139
|
label: StringConstructor;
|
|
140
|
+
labelLine: {
|
|
141
|
+
type: NumberConstructor;
|
|
142
|
+
default: number;
|
|
143
|
+
};
|
|
140
144
|
labelWidth: StringConstructor;
|
|
141
145
|
manual: BooleanConstructor;
|
|
142
146
|
popperOptions: {
|
|
@@ -293,6 +297,10 @@ interface IFormItemState {
|
|
|
293
297
|
isErrorBlock: boolean;
|
|
294
298
|
tooltipType: string;
|
|
295
299
|
isMultiple: boolean;
|
|
300
|
+
errorId: string;
|
|
301
|
+
labelId: string;
|
|
302
|
+
disabled?: boolean;
|
|
303
|
+
inlineMessage?: boolean | string;
|
|
296
304
|
}
|
|
297
305
|
type IFormItemConstants = typeof $constants;
|
|
298
306
|
type IFormItemProps = ExtractPropTypes<typeof formItemProps>;
|
|
@@ -332,6 +340,7 @@ interface IFormItemApi {
|
|
|
332
340
|
onFieldChange: ReturnType<typeof onFieldChange>;
|
|
333
341
|
addValidateEvents: ReturnType<typeof addValidateEvents>;
|
|
334
342
|
validate: ReturnType<typeof validate$1>;
|
|
343
|
+
validateOrigin: ReturnType<typeof validate$1>;
|
|
335
344
|
getDisplayedValue: ReturnType<typeof getDisplayedValue>;
|
|
336
345
|
clearDisplayedValue: ReturnType<typeof clearDisplayedValue>;
|
|
337
346
|
handleMouseenter: ReturnType<typeof handleMouseenter>;
|
package/types/form.type.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { p as IFormApi, r as IFormInstance, n as IFormProps, q as IFormRenderlessParamUtils, o as IFormRenderlessParams, l as IFormRules, m as IFormState } from './form.type-
|
|
2
|
+
export { p as IFormApi, r as IFormInstance, n as IFormProps, q as IFormRenderlessParamUtils, o as IFormRenderlessParams, l as IFormRules, m as IFormState } from './form.type-e0db2f7c.js';
|
|
3
3
|
import './shared.type.js';
|
package/types/modal.type.d.ts
CHANGED
|
@@ -190,6 +190,8 @@ interface IModalState {
|
|
|
190
190
|
prevEvent: null | Event;
|
|
191
191
|
options: any[];
|
|
192
192
|
theme: string | undefined;
|
|
193
|
+
titleId: string;
|
|
194
|
+
contentId: string;
|
|
193
195
|
}
|
|
194
196
|
type IModalProps = ExtractPropTypes<typeof modalProps>;
|
|
195
197
|
type IModalConstants = typeof $constants;
|
|
@@ -94,7 +94,7 @@ declare const popeditorProps: {
|
|
|
94
94
|
underlay: {
|
|
95
95
|
type: ObjectConstructor;
|
|
96
96
|
};
|
|
97
|
-
}, () =>
|
|
97
|
+
}, () => _opentiny_vue_common.VNode<vue.RendererNode, vue.RendererElement, {
|
|
98
98
|
[key: string]: any;
|
|
99
99
|
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{
|
|
100
100
|
shape: {
|
|
@@ -136,7 +136,7 @@ declare const popeditorProps: {
|
|
|
136
136
|
underlay: {
|
|
137
137
|
type: ObjectConstructor;
|
|
138
138
|
};
|
|
139
|
-
}, () =>
|
|
139
|
+
}, () => _opentiny_vue_common.VNode<vue.RendererNode, vue.RendererElement, {
|
|
140
140
|
[key: string]: any;
|
|
141
141
|
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{
|
|
142
142
|
shape: {
|
package/types/rate.type.d.ts
CHANGED
|
@@ -99,6 +99,10 @@ declare const rateProps: {
|
|
|
99
99
|
type: StringConstructor;
|
|
100
100
|
default: string;
|
|
101
101
|
};
|
|
102
|
+
clearable: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
default: boolean;
|
|
105
|
+
};
|
|
102
106
|
tiny_mode: StringConstructor;
|
|
103
107
|
tiny_mode_root: BooleanConstructor;
|
|
104
108
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -160,8 +164,7 @@ declare const showDecimalIcon: ({ props, state }: {
|
|
|
160
164
|
props: any;
|
|
161
165
|
state: any;
|
|
162
166
|
}) => (item: any) => any;
|
|
163
|
-
declare const getIconStyle: ({
|
|
164
|
-
api: any;
|
|
167
|
+
declare const getIconStyle: ({ props, state }: {
|
|
165
168
|
props: any;
|
|
166
169
|
state: any;
|
|
167
170
|
}) => (item: any) => {
|
package/types/search.type.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ interface ISearchState {
|
|
|
100
100
|
showClear: boolean;
|
|
101
101
|
formItemSize: string;
|
|
102
102
|
searchSize: string;
|
|
103
|
+
instanceId: string;
|
|
103
104
|
}
|
|
104
105
|
type ISearchProps = ExtractPropTypes<typeof searchProps>;
|
|
105
106
|
type ISearchRenderlessParams = ISharedRenderlessFunctionParams<never> & {
|