@opentiny/vue-renderless 3.12.1 → 3.13.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/index.js +50 -1
- package/alert/vue.js +36 -9
- package/calendar-bar/index.js +2 -2
- package/calendar-view/index.js +5 -11
- package/calendar-view/vue.js +1 -1
- package/cascader-mobile/index.js +1 -1
- package/cascader-mobile/vue.js +1 -1
- package/cascader-view/index.js +1 -1
- package/checkbox/vue.js +1 -0
- package/checkbox-group/vue.js +1 -0
- package/col/vue.js +3 -2
- package/common/date.js +2 -0
- package/common/deps/popper.js +14 -1
- package/common/index.js +1 -1
- package/common/runtime.js +1 -1
- package/container/index.js +17 -1
- package/container/vue.js +12 -3
- package/dropdown-item/vue.js +1 -1
- package/grid/utils/common.js +10 -5
- package/input/index.js +8 -2
- package/input/vue.js +13 -8
- package/label/index.js +56 -0
- package/label/vue.js +26 -0
- package/mask/index.js +13 -0
- package/mask/vue.js +18 -0
- package/numeric/index.js +13 -3
- package/numeric/vue.js +6 -1
- package/option/index.js +1 -2
- package/option/vue.js +7 -1
- package/package.json +1 -1
- package/pager/index.js +358 -0
- package/pager/vue.js +114 -2
- package/picker/index.js +1 -1
- package/pop-upload/index.js +0 -2
- package/pop-upload/vue.js +0 -4
- package/pull-refresh/index.js +55 -63
- package/pull-refresh/vue.js +20 -7
- package/select/index.js +9 -1
- package/select/vue.js +5 -4
- package/slider/index.js +27 -3
- package/slider/vue.js +26 -6
- package/tag/vue.js +5 -1
- package/tall-storage/index.js +4 -5
- package/types/action-menu.type.d.ts +5 -0
- package/types/alert.type.d.ts +17 -2
- package/types/button.type.d.ts +1 -0
- package/types/checkbox.type.d.ts +6 -3
- package/types/collapse.type.d.ts +1 -1
- package/types/date-picker.type.d.ts +1 -1
- package/types/{dropdown-item.type-bf83e929.d.ts → dropdown-item.type-8ea6c633.d.ts} +1 -1
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/dropdown.type.d.ts +1 -0
- package/types/file-upload.type.d.ts +1 -1
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-d0fd42f3.d.ts → form.type-654dccd8.d.ts} +1 -1
- package/types/form.type.d.ts +1 -1
- package/types/input.type.d.ts +21 -3
- package/types/label.type.d.ts +81 -0
- package/types/milestone.type.d.ts +1 -1
- package/types/numeric.type.d.ts +1 -1
- package/types/pager.type.d.ts +159 -1
- package/types/popeditor.type.d.ts +1 -1
- package/types/popover.type.d.ts +1 -1
- package/types/progress.type.d.ts +1 -1
- package/types/slider.type.d.ts +8 -0
- package/types/steps.type.d.ts +1 -1
- package/types/switch.type.d.ts +3 -3
- package/types/tab-item.type.d.ts +0 -1
- package/types/tag.type.d.ts +12 -0
- package/types/upload-dragger.type.d.ts +2 -2
- package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-f76f2393.d.ts} +2 -2
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
package/pull-refresh/index.js
CHANGED
|
@@ -9,15 +9,10 @@ const initPullRefresh = ({ t, props, state }) => () => {
|
|
|
9
9
|
pullingDownText: t("ui.pullRefresh.pullingDown"),
|
|
10
10
|
pullUpDisabled: false,
|
|
11
11
|
pullDownDisabled: false,
|
|
12
|
-
headHeight:
|
|
13
|
-
footHeight: 50
|
|
12
|
+
headHeight: 48
|
|
14
13
|
};
|
|
15
14
|
state.pullUp = __spreadValues(__spreadValues({}, defaultOption), props.pullUp);
|
|
16
15
|
state.pullDown = __spreadValues(__spreadValues({}, defaultOption), props.pullDown);
|
|
17
|
-
state.refreshStyle = {
|
|
18
|
-
paddingTop: state.pullDown.headHeight + "px",
|
|
19
|
-
paddingBottom: state.pullUp.footHeight + "px"
|
|
20
|
-
};
|
|
21
16
|
state.loosingText = (_a = props.loosingText) != null ? _a : t("ui.pullRefresh.loosing");
|
|
22
17
|
state.successText = (_b = props.successText) != null ? _b : t("ui.pullRefresh.success");
|
|
23
18
|
state.failedText = (_c = props.failedText) != null ? _c : t("ui.pullRefresh.failed");
|
|
@@ -25,70 +20,62 @@ const initPullRefresh = ({ t, props, state }) => () => {
|
|
|
25
20
|
const onTouchstart = (state) => (event) => {
|
|
26
21
|
state.draggposition = event.touches[0].clientY;
|
|
27
22
|
};
|
|
28
|
-
const onTouchmove = ({
|
|
23
|
+
const onTouchmove = ({ state, refs }) => (event) => {
|
|
29
24
|
if (event.touches[0].clientY < state.draggposition) {
|
|
30
|
-
|
|
31
|
-
if (props.hasMore) {
|
|
32
|
-
state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
|
|
33
|
-
state.pullUpReplaces = Math.abs(state.translate3d) > state.pullUp.footHeight ? state.loosingText : state.pullUp.pullingUpText;
|
|
34
|
-
state.pullDownReplaces = "";
|
|
35
|
-
}
|
|
36
|
-
}
|
|
25
|
+
pullUpTouchMove(state);
|
|
37
26
|
} else {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
pullDownTouchMove(state, refs, event);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const pullUpTouchMove = (state) => {
|
|
31
|
+
if (state.disabledPullUp || state.pullUpLoading || !state.hasMore) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const pullDownTouchMove = (state, refs, event) => {
|
|
36
|
+
if (state.disabledPullDown || state.pullDownLoading) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (refs.content.scrollTop <= 0) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
|
|
42
|
+
state.pullDownReplaces = Math.abs(state.translate3d) > state.pullDown.headHeight ? state.loosingText : state.pullDown.pullingDownText;
|
|
43
43
|
}
|
|
44
44
|
state.animationDuration = 0;
|
|
45
|
-
state.pullUpLoading = false;
|
|
46
|
-
state.pullDownLoading = false;
|
|
47
45
|
};
|
|
48
|
-
const onTouchend = ({ api, props, state }) => () => {
|
|
46
|
+
const onTouchend = ({ api, props, state, emit, refs }) => (event) => {
|
|
49
47
|
state.animationDuration = props.animationDuration;
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
state.translate3d = state.pullDown.headHeight;
|
|
53
|
-
const { handler } = state.pullDown;
|
|
54
|
-
const pullDownPromise = handler && handler();
|
|
55
|
-
state.pullDownLoading = true;
|
|
56
|
-
if (pullDownPromise == null ? void 0 : pullDownPromise.then) {
|
|
57
|
-
pullDownPromise.then(
|
|
58
|
-
() => {
|
|
59
|
-
api.handlerModelValue("down", "success");
|
|
60
|
-
},
|
|
61
|
-
(e) => {
|
|
62
|
-
api.handlerModelValue("down", "failed");
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
console.error(new Error("handler down is not promise"));
|
|
68
|
-
} else {
|
|
69
|
-
state.translate3d = -state.pullUp.footHeight;
|
|
70
|
-
const { handler } = state.pullUp;
|
|
71
|
-
const pullUpPromise = handler && handler();
|
|
72
|
-
state.pullUpLoading = true;
|
|
73
|
-
if (pullUpPromise == null ? void 0 : pullUpPromise.then) {
|
|
74
|
-
pullUpPromise.then(
|
|
75
|
-
() => {
|
|
76
|
-
api.handlerModelValue("up", "success");
|
|
77
|
-
},
|
|
78
|
-
(e) => {
|
|
79
|
-
api.handlerModelValue("up", "failed");
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
console.error(new Error("handler up is not promise"));
|
|
85
|
-
}
|
|
86
|
-
api.clearPullRefresh();
|
|
48
|
+
if (event.changedTouches[0].clientY < state.draggposition) {
|
|
49
|
+
pullUpTouchEnd(state, emit, refs);
|
|
87
50
|
} else {
|
|
88
|
-
state
|
|
51
|
+
pullDownTouchEnd(api, state, emit);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const pullDownTouchEnd = (api, state, emit) => {
|
|
55
|
+
if (Math.abs(state.translate3d) < state.pullDown.headHeight) {
|
|
89
56
|
state.pullDownLoading = false;
|
|
90
57
|
api.clearPullRefresh();
|
|
58
|
+
return;
|
|
91
59
|
}
|
|
60
|
+
state.translate3d = state.pullDown.headHeight;
|
|
61
|
+
state.pullDownLoading = true;
|
|
62
|
+
emit("update:modelValue", true);
|
|
63
|
+
emit("pullDown");
|
|
64
|
+
};
|
|
65
|
+
const pullUpTouchEnd = (state, emit, refs) => {
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
const footNode = refs.foot;
|
|
68
|
+
if (!state.hasMore || !footNode) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const contentNode = refs.content;
|
|
72
|
+
const bottomDis = footNode.offsetTop + footNode.clientHeight - contentNode.scrollTop - contentNode.clientHeight;
|
|
73
|
+
if (bottomDis <= state.pullUpDistance) {
|
|
74
|
+
state.pullUpLoading = true;
|
|
75
|
+
emit("update:modelValue", true);
|
|
76
|
+
emit("pullUp");
|
|
77
|
+
}
|
|
78
|
+
}, 300);
|
|
92
79
|
};
|
|
93
80
|
const mountedHandler = ({ api, refs }) => () => {
|
|
94
81
|
const track = refs.track;
|
|
@@ -108,7 +95,7 @@ const handlerModelValue = ({ api, state }) => (value, result) => {
|
|
|
108
95
|
if (value === "down") {
|
|
109
96
|
state.pullDownReplaces = state[`${result}Text`];
|
|
110
97
|
} else {
|
|
111
|
-
state.
|
|
98
|
+
state.pullUpStateText = state[`${result}Text`];
|
|
112
99
|
}
|
|
113
100
|
setTimeout(() => {
|
|
114
101
|
api.clearPullRefresh();
|
|
@@ -116,8 +103,9 @@ const handlerModelValue = ({ api, state }) => (value, result) => {
|
|
|
116
103
|
};
|
|
117
104
|
const clearPullRefresh = (state) => () => {
|
|
118
105
|
state.translate3d = 0;
|
|
119
|
-
state.pullUpReplaces = "";
|
|
120
106
|
state.pullDownReplaces = "";
|
|
107
|
+
state.pullDownLoading = false;
|
|
108
|
+
state.pullUpLoading = false;
|
|
121
109
|
};
|
|
122
110
|
export {
|
|
123
111
|
beforeUnmountHandler,
|
|
@@ -127,5 +115,9 @@ export {
|
|
|
127
115
|
mountedHandler,
|
|
128
116
|
onTouchend,
|
|
129
117
|
onTouchmove,
|
|
130
|
-
onTouchstart
|
|
118
|
+
onTouchstart,
|
|
119
|
+
pullDownTouchEnd,
|
|
120
|
+
pullDownTouchMove,
|
|
121
|
+
pullUpTouchEnd,
|
|
122
|
+
pullUpTouchMove
|
|
131
123
|
};
|
package/pull-refresh/vue.js
CHANGED
|
@@ -10,10 +10,9 @@ import {
|
|
|
10
10
|
clearPullRefresh
|
|
11
11
|
} from "./index";
|
|
12
12
|
const api = ["state"];
|
|
13
|
-
const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t, refs }) => {
|
|
13
|
+
const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t, refs, emit, nextTick }) => {
|
|
14
14
|
const api2 = {};
|
|
15
15
|
const state = reactive({
|
|
16
|
-
pullUpReplaces: "",
|
|
17
16
|
pullDownReplaces: "",
|
|
18
17
|
refreshStyle: {},
|
|
19
18
|
translate3d: 0,
|
|
@@ -23,17 +22,23 @@ const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t,
|
|
|
23
22
|
loosingText: "",
|
|
24
23
|
successText: "",
|
|
25
24
|
failedText: "",
|
|
26
|
-
noMoreText: "",
|
|
25
|
+
noMoreText: t("ui.pullRefresh.noMore"),
|
|
26
|
+
pullUpLoadingText: props.pullUpLoadingText,
|
|
27
|
+
pullDownLoadingText: props.pullDownLoadingText,
|
|
27
28
|
pullUp: null,
|
|
28
29
|
pullDown: null,
|
|
30
|
+
hasMore: true,
|
|
29
31
|
successDuration: props.successDuration,
|
|
30
|
-
animationDuration: props.animationDuration
|
|
32
|
+
animationDuration: props.animationDuration,
|
|
33
|
+
disabledPullDown: props.disabledPullDown,
|
|
34
|
+
disabledPullUp: props.disabledPullUp,
|
|
35
|
+
pullUpDistance: typeof props.pullUpDistance === "string" ? Number(props.pullUpDistance) : props.pullUpDistance
|
|
31
36
|
});
|
|
32
37
|
Object.assign(api2, {
|
|
33
38
|
state,
|
|
34
39
|
onTouchstart: onTouchstart(state),
|
|
35
|
-
onTouchmove: onTouchmove({
|
|
36
|
-
onTouchend: onTouchend({ api: api2, props, state }),
|
|
40
|
+
onTouchmove: onTouchmove({ state, refs }),
|
|
41
|
+
onTouchend: onTouchend({ api: api2, props, state, emit, refs }),
|
|
37
42
|
mountedHandler: mountedHandler({ api: api2, refs }),
|
|
38
43
|
beforeUnmountHandler: beforeUnmountHandler({ api: api2, refs }),
|
|
39
44
|
handlerModelValue: handlerModelValue({ api: api2, state }),
|
|
@@ -44,7 +49,15 @@ const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t,
|
|
|
44
49
|
() => props.hasMore,
|
|
45
50
|
(value) => {
|
|
46
51
|
if (!value) {
|
|
47
|
-
state.
|
|
52
|
+
state.hasMore = false;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{ immediate: true }
|
|
56
|
+
);
|
|
57
|
+
watch(
|
|
58
|
+
() => props.modelValue,
|
|
59
|
+
(value) => {
|
|
60
|
+
if (!value) {
|
|
48
61
|
api2.clearPullRefresh();
|
|
49
62
|
}
|
|
50
63
|
}
|
package/select/index.js
CHANGED
|
@@ -86,7 +86,6 @@ const defaultOnQueryChange = ({ props, state, constants, api }) => (value) => {
|
|
|
86
86
|
props.filterMethod(value);
|
|
87
87
|
state.selectEmitter.emit(constants.COMPONENT_NAME.OptionGroup, constants.EVENT_NAME.queryChange);
|
|
88
88
|
} else {
|
|
89
|
-
state.filteredOptionsCount = state.optionsCount;
|
|
90
89
|
state.selectEmitter.emit(constants.EVENT_NAME.queryChange, value);
|
|
91
90
|
}
|
|
92
91
|
if (props.defaultFirstOption && (props.filterable || props.remote) && state.filteredOptionsCount) {
|
|
@@ -134,6 +133,13 @@ const handleQueryChange = ({ api, constants, nextTick, props, vm, state }) => (v
|
|
|
134
133
|
}
|
|
135
134
|
api.defaultOnQueryChange(value);
|
|
136
135
|
};
|
|
136
|
+
const debouncedQueryChange = ({ props, api }) => (event) => {
|
|
137
|
+
const value = props.shape ? event : event.target.value;
|
|
138
|
+
api.handleDebouncedQueryChange(value);
|
|
139
|
+
};
|
|
140
|
+
const handleDebouncedQueryChange = ({ state, api }) => debounce(state.debounce, (value) => {
|
|
141
|
+
api.handleQueryChange(value);
|
|
142
|
+
});
|
|
137
143
|
const scrollToOption = ({ vm, constants }) => (option) => {
|
|
138
144
|
const target = Array.isArray(option) && option[0] ? option[0].el : option.el;
|
|
139
145
|
if (vm.$refs.popper && target) {
|
|
@@ -1553,6 +1559,7 @@ export {
|
|
|
1553
1559
|
computedShowNewOption,
|
|
1554
1560
|
computedTagsStyle,
|
|
1555
1561
|
debouncRquest,
|
|
1562
|
+
debouncedQueryChange,
|
|
1556
1563
|
defaultOnQueryChange,
|
|
1557
1564
|
deletePrevTag,
|
|
1558
1565
|
deleteSelected,
|
|
@@ -1576,6 +1583,7 @@ export {
|
|
|
1576
1583
|
handleClose,
|
|
1577
1584
|
handleComposition,
|
|
1578
1585
|
handleCopyClick,
|
|
1586
|
+
handleDebouncedQueryChange,
|
|
1579
1587
|
handleDropdownClick,
|
|
1580
1588
|
handleEnterTag,
|
|
1581
1589
|
handleFocus,
|
package/select/vue.js
CHANGED
|
@@ -99,7 +99,9 @@ import {
|
|
|
99
99
|
computedGetIcon,
|
|
100
100
|
computedGetTagType,
|
|
101
101
|
computedShowDropdownIcon,
|
|
102
|
-
clearNoMatchValue
|
|
102
|
+
clearNoMatchValue,
|
|
103
|
+
debouncedQueryChange,
|
|
104
|
+
handleDebouncedQueryChange
|
|
103
105
|
} from "./index";
|
|
104
106
|
import debounce from "../common/deps/debounce";
|
|
105
107
|
import { isNumber } from "../common/type";
|
|
@@ -276,9 +278,8 @@ const addApi = ({ api: api2, props, state, emit, constants, parent, nextTick, di
|
|
|
276
278
|
handleOptionSelect: handleOptionSelect({ api: api2, nextTick, props, vm, state }),
|
|
277
279
|
getPluginOption: getPluginOption({ api: api2, props, state }),
|
|
278
280
|
toggleCheckAll: toggleCheckAll({ api: api2, emit, state, props }),
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}),
|
|
281
|
+
handleDebouncedQueryChange: handleDebouncedQueryChange({ state, api: api2 }),
|
|
282
|
+
debouncedQueryChange: debouncedQueryChange({ props, api: api2 }),
|
|
282
283
|
debouncedOnInputChange: debounce(state.debounce, () => {
|
|
283
284
|
api2.onInputChange();
|
|
284
285
|
}),
|
package/slider/index.js
CHANGED
|
@@ -17,6 +17,7 @@ const bindKeyDown = ({ api, props, state }) => (event) => {
|
|
|
17
17
|
if (state.disabled || state.activeIndex < 0) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
+
event.preventDefault();
|
|
20
21
|
let currentValue = 0;
|
|
21
22
|
switch (event.keyCode) {
|
|
22
23
|
case KEY_CODE.Home:
|
|
@@ -114,7 +115,9 @@ const bindMouseUp = ({ api, emit, state }) => () => {
|
|
|
114
115
|
if (state.disabled || !state.isDrag) {
|
|
115
116
|
return;
|
|
116
117
|
}
|
|
117
|
-
state.
|
|
118
|
+
if (state.mouseOuterBtn) {
|
|
119
|
+
state.showTip = false;
|
|
120
|
+
}
|
|
118
121
|
state.isDrag = false;
|
|
119
122
|
off(window, "mouseup", api.bindMouseUp);
|
|
120
123
|
off(window, "mousemove", api.bindMouseMove);
|
|
@@ -123,6 +126,7 @@ const bindMouseUp = ({ api, emit, state }) => () => {
|
|
|
123
126
|
emit("stop", api.getActiveButtonValue());
|
|
124
127
|
};
|
|
125
128
|
const displayTip = ({ api, nextTick, state }) => (event) => {
|
|
129
|
+
state.mouseOuterBtn = false;
|
|
126
130
|
if (!state.showTip) {
|
|
127
131
|
state.showTip = true;
|
|
128
132
|
api.changeActiveValue(api.getActiveButtonIndex(event) === 0);
|
|
@@ -131,7 +135,10 @@ const displayTip = ({ api, nextTick, state }) => (event) => {
|
|
|
131
135
|
});
|
|
132
136
|
}
|
|
133
137
|
};
|
|
134
|
-
const hideTip = (state) => () =>
|
|
138
|
+
const hideTip = (state) => () => {
|
|
139
|
+
state.mouseOuterBtn = true;
|
|
140
|
+
!state.isDrag && (state.showTip = false);
|
|
141
|
+
};
|
|
135
142
|
const setTipStyle = ({
|
|
136
143
|
constants,
|
|
137
144
|
mode,
|
|
@@ -288,7 +295,7 @@ const initSlider = ({ api, props, state }) => (value) => {
|
|
|
288
295
|
};
|
|
289
296
|
const calculateValue = ({ props, state, vm }) => (event) => {
|
|
290
297
|
let currentValue = 0;
|
|
291
|
-
if (state.sliderSize
|
|
298
|
+
if (state.sliderSize === 0) {
|
|
292
299
|
const handleEl = vm.$refs.slider;
|
|
293
300
|
state.sliderSize = handleEl["client" + (props.vertical ? "Height" : "Width")];
|
|
294
301
|
state.sliderOffset = handleEl.getBoundingClientRect();
|
|
@@ -362,9 +369,13 @@ const watchActiveValue = ({ api, emit, props, state }) => (newValue, oldValue) =
|
|
|
362
369
|
} else {
|
|
363
370
|
state.activeValue = nNewValue || 0;
|
|
364
371
|
}
|
|
372
|
+
if (!state.isSlotTyping) {
|
|
373
|
+
state.slotValue = state.activeValue;
|
|
374
|
+
}
|
|
365
375
|
};
|
|
366
376
|
const watchModelValue = ({ api, state }) => (value) => {
|
|
367
377
|
if (!state.innerTrigger) {
|
|
378
|
+
state.isInit = true;
|
|
368
379
|
api.initSlider(value);
|
|
369
380
|
api.setActiveButtonValue(value);
|
|
370
381
|
} else {
|
|
@@ -417,6 +428,16 @@ const inputValueChange = ({ props, state, api }) => ($event, pos) => {
|
|
|
417
428
|
}
|
|
418
429
|
api.initSlider([Math.min(...state.inputValue), Math.max(...state.inputValue)]);
|
|
419
430
|
};
|
|
431
|
+
const handleSlotInputFocus = (state) => () => {
|
|
432
|
+
state.isSlotTyping = true;
|
|
433
|
+
};
|
|
434
|
+
const handleSlotInputBlur = (state) => () => {
|
|
435
|
+
state.isSlotTyping = false;
|
|
436
|
+
state.slotValue = state.activeValue;
|
|
437
|
+
};
|
|
438
|
+
const handleSlotInput = (state) => (event) => {
|
|
439
|
+
state.activeValue = Number(event.target.value);
|
|
440
|
+
};
|
|
420
441
|
export {
|
|
421
442
|
autoSlider,
|
|
422
443
|
bindEvent,
|
|
@@ -436,6 +457,9 @@ export {
|
|
|
436
457
|
getActiveButtonValue,
|
|
437
458
|
getLabels,
|
|
438
459
|
getPoints,
|
|
460
|
+
handleSlotInput,
|
|
461
|
+
handleSlotInputBlur,
|
|
462
|
+
handleSlotInputFocus,
|
|
439
463
|
hideTip,
|
|
440
464
|
initSlider,
|
|
441
465
|
inputValueChange,
|
package/slider/vue.js
CHANGED
|
@@ -27,7 +27,10 @@ import {
|
|
|
27
27
|
watchModelValue,
|
|
28
28
|
getPoints,
|
|
29
29
|
getLabels,
|
|
30
|
-
inputValueChange
|
|
30
|
+
inputValueChange,
|
|
31
|
+
handleSlotInputFocus,
|
|
32
|
+
handleSlotInputBlur,
|
|
33
|
+
handleSlotInput
|
|
31
34
|
} from "./index";
|
|
32
35
|
const api = [
|
|
33
36
|
"state",
|
|
@@ -54,7 +57,10 @@ const api = [
|
|
|
54
57
|
"customBeforeAppearHook",
|
|
55
58
|
"customAppearHook",
|
|
56
59
|
"customAfterAppearHook",
|
|
57
|
-
"inputValueChange"
|
|
60
|
+
"inputValueChange",
|
|
61
|
+
"handleSlotInputFocus",
|
|
62
|
+
"handleSlotInputBlur",
|
|
63
|
+
"handleSlotInput"
|
|
58
64
|
];
|
|
59
65
|
const initState = ({ reactive, computed, props, api: api2, parent, inject }) => {
|
|
60
66
|
const state = reactive({
|
|
@@ -85,7 +91,10 @@ const initState = ({ reactive, computed, props, api: api2, parent, inject }) =>
|
|
|
85
91
|
rangeDiff: computed(() => props.max - props.min),
|
|
86
92
|
tipValue: computed(() => api2.formatTipValue(state.activeValue)),
|
|
87
93
|
formDisabled: computed(() => (parent.tinyForm || {}).disabled),
|
|
88
|
-
disabled: computed(() => props.disabled || state.formDisabled)
|
|
94
|
+
disabled: computed(() => props.disabled || state.formDisabled),
|
|
95
|
+
slotValue: "",
|
|
96
|
+
isSlotTyping: false,
|
|
97
|
+
mouseOuterBtn: false
|
|
89
98
|
});
|
|
90
99
|
return state;
|
|
91
100
|
};
|
|
@@ -122,9 +131,21 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
|
|
|
122
131
|
watchActiveValue: watchActiveValue({ api: api2, emit, props, state }),
|
|
123
132
|
getPoints: getPoints({ props, state }),
|
|
124
133
|
getLabels: getLabels({ props, state }),
|
|
125
|
-
inputValueChange: inputValueChange({ props, api: api2, state })
|
|
134
|
+
inputValueChange: inputValueChange({ props, api: api2, state }),
|
|
135
|
+
handleSlotInputFocus: handleSlotInputFocus(state),
|
|
136
|
+
handleSlotInputBlur: handleSlotInputBlur(state),
|
|
137
|
+
handleSlotInput: handleSlotInput(state)
|
|
126
138
|
});
|
|
127
|
-
watch(
|
|
139
|
+
watch(
|
|
140
|
+
() => props.modelValue,
|
|
141
|
+
(value) => {
|
|
142
|
+
if (props.max < props.min) {
|
|
143
|
+
throw new Error("Slider min should not be greater than max.");
|
|
144
|
+
}
|
|
145
|
+
api2.watchModelValue(value);
|
|
146
|
+
},
|
|
147
|
+
{ immediate: true }
|
|
148
|
+
);
|
|
128
149
|
watch(() => state.activeValue, api2.watchActiveValue, { immediate: true });
|
|
129
150
|
watch(
|
|
130
151
|
() => props.min,
|
|
@@ -142,7 +163,6 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
|
|
|
142
163
|
api2.setActiveButtonValue(value);
|
|
143
164
|
}
|
|
144
165
|
);
|
|
145
|
-
watch(() => state.activeValue, api2.watchActiveValue, { immediate: true });
|
|
146
166
|
watch(
|
|
147
167
|
() => state.leftBtnValue,
|
|
148
168
|
(newVal) => {
|
package/tag/vue.js
CHANGED
|
@@ -5,7 +5,11 @@ const renderless = (props, { reactive, computed }, { emit, parent }) => {
|
|
|
5
5
|
const state = reactive({
|
|
6
6
|
type: computed(() => props.theme || props.type),
|
|
7
7
|
show: true,
|
|
8
|
-
selected: false
|
|
8
|
+
selected: false,
|
|
9
|
+
mini: props.mini,
|
|
10
|
+
color: props.color,
|
|
11
|
+
text: props.text,
|
|
12
|
+
maxWidth: props.maxWidth
|
|
9
13
|
});
|
|
10
14
|
const api2 = {
|
|
11
15
|
state,
|
package/tall-storage/index.js
CHANGED
|
@@ -38,8 +38,7 @@ const keydown = ({ emit, props, state }) => () => {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
const sortDeduplication = (array) => {
|
|
42
|
-
const memorySpace = 5;
|
|
41
|
+
const sortDeduplication = (array, memorySpace = 5) => {
|
|
43
42
|
const length = array.length;
|
|
44
43
|
let newArray = [];
|
|
45
44
|
let fillterObj = {};
|
|
@@ -74,7 +73,7 @@ const isJSONobject = (string, type) => {
|
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
};
|
|
77
|
-
const setLocalStorageage = (name, value) => {
|
|
76
|
+
const setLocalStorageage = (name, value, memorySpace = 5) => {
|
|
78
77
|
if (typeof value === "string") {
|
|
79
78
|
const oldValue = localStorage.getItem(name);
|
|
80
79
|
const isArray = isJSONobject(oldValue, Array);
|
|
@@ -82,7 +81,7 @@ const setLocalStorageage = (name, value) => {
|
|
|
82
81
|
if (oldValue && isArray) {
|
|
83
82
|
let oldArray = JSON.parse(localStorage.getItem(name));
|
|
84
83
|
oldArray.unshift(value);
|
|
85
|
-
oldArray = sortDeduplication(oldArray);
|
|
84
|
+
oldArray = sortDeduplication(oldArray, memorySpace);
|
|
86
85
|
newValue = JSON.stringify(oldArray);
|
|
87
86
|
} else if (oldValue === null || oldValue === value) {
|
|
88
87
|
newValue = value;
|
|
@@ -94,7 +93,7 @@ const setLocalStorageage = (name, value) => {
|
|
|
94
93
|
};
|
|
95
94
|
const addMemory = (props) => (value) => {
|
|
96
95
|
if (props.name && value) {
|
|
97
|
-
setLocalStorageage(props.name, value);
|
|
96
|
+
setLocalStorageage(props.name, value, props.memorySpace);
|
|
98
97
|
}
|
|
99
98
|
};
|
|
100
99
|
const searchMemory = ({ props, state }) => (inputVal) => {
|
|
@@ -42,6 +42,11 @@ declare const actionMenuProps: {
|
|
|
42
42
|
type: StringConstructor;
|
|
43
43
|
default: string;
|
|
44
44
|
};
|
|
45
|
+
suffixIcon: ObjectConstructor;
|
|
46
|
+
showIcon: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
45
50
|
tiny_mode: StringConstructor;
|
|
46
51
|
tiny_mode_root: BooleanConstructor;
|
|
47
52
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
package/types/alert.type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtractPropTypes } from 'vue';
|
|
1
|
+
import { ExtractPropTypes, CSSProperties } from 'vue';
|
|
2
2
|
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
3
3
|
|
|
4
4
|
declare const $constants: {
|
|
@@ -76,7 +76,19 @@ declare const alertProps: {
|
|
|
76
76
|
type: BooleanConstructor;
|
|
77
77
|
default: boolean;
|
|
78
78
|
};
|
|
79
|
-
customClass: (
|
|
79
|
+
customClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
|
|
80
|
+
offset: {
|
|
81
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
82
|
+
default: number;
|
|
83
|
+
};
|
|
84
|
+
autoHide: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
88
|
+
target: {
|
|
89
|
+
type: StringConstructor;
|
|
90
|
+
default: string;
|
|
91
|
+
};
|
|
80
92
|
tiny_mode: StringConstructor;
|
|
81
93
|
tiny_mode_root: BooleanConstructor;
|
|
82
94
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -98,6 +110,7 @@ interface IAlertState {
|
|
|
98
110
|
type IAlertProps = ExtractPropTypes<typeof alertProps>;
|
|
99
111
|
type IAlertConstants = typeof $constants;
|
|
100
112
|
type IAlertRenderlessParams = ISharedRenderlessFunctionParams<IAlertConstants> & {
|
|
113
|
+
api: IAlertApi;
|
|
101
114
|
state: IAlertState;
|
|
102
115
|
props: IAlertProps;
|
|
103
116
|
};
|
|
@@ -107,6 +120,8 @@ interface IAlertApi {
|
|
|
107
120
|
computedGetTitle: () => string;
|
|
108
121
|
handleClose: () => void;
|
|
109
122
|
handleHeaderClick: () => void;
|
|
123
|
+
watchAutoHide: (value: boolean) => void;
|
|
124
|
+
computedStyle: () => CSSProperties;
|
|
110
125
|
}
|
|
111
126
|
type IAlertRenderlessParamUtils = ISharedRenderlessParamUtils<IAlertConstants>;
|
|
112
127
|
|
package/types/button.type.d.ts
CHANGED
package/types/checkbox.type.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ExtractPropTypes, ComputedRef } from 'vue';
|
|
2
|
+
import { PropType } from '@opentiny/vue-common';
|
|
2
3
|
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
3
4
|
|
|
5
|
+
type IconPosition = 'center' | 'top';
|
|
4
6
|
declare const $constants: {
|
|
5
7
|
FORM_ITEM: string;
|
|
6
8
|
FORM_CHANGE: string;
|
|
@@ -18,10 +20,10 @@ declare const checkboxProps: {
|
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
modelValue: {
|
|
21
|
-
type: (
|
|
23
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
22
24
|
};
|
|
23
25
|
label: {
|
|
24
|
-
type: (
|
|
26
|
+
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
|
|
25
27
|
default: string;
|
|
26
28
|
};
|
|
27
29
|
indeterminate: BooleanConstructor;
|
|
@@ -38,7 +40,7 @@ declare const checkboxProps: {
|
|
|
38
40
|
border: BooleanConstructor;
|
|
39
41
|
size: StringConstructor;
|
|
40
42
|
text: StringConstructor;
|
|
41
|
-
customClass: (
|
|
43
|
+
customClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
|
|
42
44
|
validateEvent: {
|
|
43
45
|
type: BooleanConstructor;
|
|
44
46
|
default: boolean;
|
|
@@ -51,6 +53,7 @@ declare const checkboxProps: {
|
|
|
51
53
|
type: BooleanConstructor;
|
|
52
54
|
default: boolean;
|
|
53
55
|
};
|
|
56
|
+
iconPosition: PropType<IconPosition>;
|
|
54
57
|
tiny_mode: StringConstructor;
|
|
55
58
|
tiny_mode_root: BooleanConstructor;
|
|
56
59
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
package/types/collapse.type.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare const collapseProps: {
|
|
|
24
24
|
accordion: BooleanConstructor;
|
|
25
25
|
beforeClose: FunctionConstructor;
|
|
26
26
|
modelValue: {
|
|
27
|
-
type: (
|
|
27
|
+
type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
28
28
|
default: () => never[];
|
|
29
29
|
};
|
|
30
30
|
tiny_mode: StringConstructor;
|
|
@@ -28,7 +28,7 @@ declare const $constants: {
|
|
|
28
28
|
};
|
|
29
29
|
declare const datePickerProps: {
|
|
30
30
|
type: {
|
|
31
|
-
type: PropType<"date" | "dates" | "
|
|
31
|
+
type: PropType<"date" | "dates" | "daterange" | "week" | "month" | "monthrange" | "year" | "years" | "yearrange" | "datetime" | "datetimerange">;
|
|
32
32
|
default: string;
|
|
33
33
|
};
|
|
34
34
|
_constants: {
|
|
@@ -250,7 +250,7 @@ declare const confirm: ({ emit, props, state }: Pick<IDropdownItemRenderlessPara
|
|
|
250
250
|
declare const reset: ({ emit, props }: Pick<IDropdownItemRenderlessParams, 'emit' | 'props'>) => () => void;
|
|
251
251
|
declare const clickOutside: (parent: IDropdownItemRenderlessParams['parent']) => () => void;
|
|
252
252
|
declare const handleClick: ({ props, dispatch, vm, emit }: Pick<IDropdownItemRenderlessParams, 'props' | 'dispatch' | 'vm' | 'emit'>) => (event: MouseEvent) => void;
|
|
253
|
-
declare const computedGetIcon: ({ constants, designConfig }: Pick<IDropdownItemRenderlessParams, 'constants' | 'designConfig'>) => (name?: string) => object;
|
|
253
|
+
declare const computedGetIcon: ({ constants, designConfig }: Pick<IDropdownItemRenderlessParams, 'constants' | 'designConfig'>) => (name?: string) => object | string;
|
|
254
254
|
declare const getTip: ({ props, vm }: Pick<IDropdownItemRenderlessParams, 'props' | 'vm'>) => string;
|
|
255
255
|
|
|
256
256
|
type IDropdownItemVm = ComponentPublicInstance & {
|
|
@@ -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-8ea6c633.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-8ea6c633.js';
|
|
3
3
|
import './shared.type.js';
|
|
4
4
|
import './dropdown.type.js';
|
package/types/dropdown.type.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { C as IFileUploadAfterDownload, m as IFileUploadApi, D as IFileUploadBatchSegmentDownload, y as IFileUploadBatchSegmentUpload, a as IFileUploadConstants, w as IFileUploadDownloadFileInner, x as IFileUploadDownloadFileSingle, u as IFileUploadDownloadFileSingleInner, t as IFileUploadEdmDownload, s as IFileUploadFile, A as IFileUploadGetFormData, v as IFileUploadLargeDocumentDownload, r as IFileUploadModalVm, o as IFileUploadProps, p as IFileUploadRenderlessParamUtils, q as IFileUploadRenderlessParams, z as IFileUploadSegmentUploadInner, n as IFileUploadService, B as IFileUploadSetWriterFile, E as IFileUploadSliceDownloadChunk, l as IFileUploadState, F as IFileUploadStreamsaver, I as IFileUploadVm } from './upload-list.type-
|
|
2
|
+
export { C as IFileUploadAfterDownload, m as IFileUploadApi, D as IFileUploadBatchSegmentDownload, y as IFileUploadBatchSegmentUpload, a as IFileUploadConstants, w as IFileUploadDownloadFileInner, x as IFileUploadDownloadFileSingle, u as IFileUploadDownloadFileSingleInner, t as IFileUploadEdmDownload, s as IFileUploadFile, A as IFileUploadGetFormData, v as IFileUploadLargeDocumentDownload, r as IFileUploadModalVm, o as IFileUploadProps, p as IFileUploadRenderlessParamUtils, q as IFileUploadRenderlessParams, z as IFileUploadSegmentUploadInner, n as IFileUploadService, B as IFileUploadSetWriterFile, E as IFileUploadSliceDownloadChunk, l as IFileUploadState, F as IFileUploadStreamsaver, I as IFileUploadVm } from './upload-list.type-f76f2393.js';
|
|
3
3
|
import './shared.type.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'vue';
|
|
2
|
-
export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-
|
|
2
|
+
export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-654dccd8.js';
|
|
3
3
|
import './shared.type.js';
|