@opentiny/vue-renderless 3.9.3 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-sheet/vue.js +25 -2
- package/anchor/index.js +3 -3
- package/anchor/vue.js +7 -1
- package/area/index.js +4 -4
- package/button/vue.js +4 -2
- package/button-group/index.js +8 -1
- package/button-group/vue.js +5 -10
- package/calendar/index.js +14 -14
- package/calendar-bar/index.js +3 -3
- package/carousel-item/index.js +1 -1
- package/cascader/vue.js +1 -1
- package/cascader-mobile/index.js +299 -0
- package/cascader-mobile/vue.js +102 -0
- package/cascader-panel/store.js +3 -1
- package/chart-boxplot/index.js +0 -1
- package/chart-core/deps/constants.js +20 -2
- package/chart-core/index.js +9 -1
- package/chart-core/modules/extend.js +14 -1
- package/chart-gauge/index.js +3 -1
- package/chart-graph/index.js +3 -1
- package/chart-map/index.js +11 -1
- package/chart-scatter/index.js +10 -2
- package/chart-waterfall/index.js +4 -1
- package/checkbox/index.js +8 -16
- package/checkbox/vue.js +7 -9
- package/column-list-item/vue.js +10 -1
- package/common/bigInt.js +4 -11
- package/common/date.js +2 -2
- package/common/deps/ResizeObserver.js +3 -1
- package/common/deps/date-util.js +9 -1
- package/common/deps/date.js +18 -5
- package/common/deps/fastdom/async.js +41 -0
- package/common/deps/fastdom/index.js +9 -0
- package/common/deps/fastdom/sandbox.js +53 -0
- package/common/deps/fastdom/singleton.js +80 -0
- package/common/deps/fullscreen/screenfull.js +16 -2
- package/common/deps/memorize.js +3 -3
- package/common/deps/popup-manager.js +0 -1
- package/common/deps/requestAnimationFrame.js +1 -1
- package/common/deps/throttle.js +2 -2
- package/common/deps/tree-model/node.js +23 -11
- package/common/deps/tree-model/tree-store.js +28 -7
- package/common/deps/vue-popper.js +14 -2
- package/common/deps/vue-popup.js +16 -23
- package/common/index.js +7 -35
- package/common/runtime.js +1 -1
- package/common/validate/rules/type.js +3 -1
- package/credit-card-form/vue.js +2 -2
- package/date-panel/index.js +35 -31
- package/date-panel/vue.js +12 -12
- package/date-picker/index.js +9 -5
- package/date-picker/vue.js +20 -8
- package/date-picker-mobile/index.js +3 -3
- package/date-range/index.js +91 -19
- package/date-range/vue.js +19 -11
- package/date-table/index.js +39 -6
- package/date-table/vue.js +2 -2
- package/dept/index.js +1 -1
- package/detail-page/vue.js +9 -1
- package/dialog-box/index.js +11 -2
- package/dialog-box/vue.js +30 -6
- package/dialog-select/index.js +27 -5
- package/dialog-select/vue.js +11 -4
- package/drop-roles/index.js +3 -1
- package/dropdown/index.js +28 -7
- package/dropdown/vue.js +12 -7
- package/dropdown-item/index.js +9 -1
- package/dropdown-item/mf.js +3 -3
- package/dropdown-item/vue.js +12 -10
- package/dropdown-menu/index.js +13 -14
- package/dropdown-menu/vue.js +8 -7
- package/espace/vue.js +9 -1
- package/fall-menu/vue.js +12 -1
- package/file-upload/index.js +137 -89
- package/file-upload/vue.js +24 -14
- package/filter/index.js +1 -1
- package/filter/vue.js +1 -3
- package/floating-button/index.js +73 -0
- package/floating-button/vue.js +35 -0
- package/form/index.js +13 -4
- package/form/vue.js +7 -2
- package/form-item/index.js +4 -1
- package/form-item/vue.js +6 -3
- package/fullscreen/vue.js +24 -3
- package/grid/plugins/exportExcel.js +54 -8
- package/grid/static/base/helperGetHGSKeys.js +1 -4
- package/grid/utils/common.js +15 -11
- package/grid/utils/dom.js +5 -1
- package/guide/index.js +2 -3
- package/hrapprover/index.js +3 -1
- package/index-bar/vue.js +8 -1
- package/input/index.js +1 -11
- package/input/vue.js +6 -12
- package/ip-address/index.js +4 -11
- package/ip-address/vue.js +8 -1
- package/link-menu/vue.js +22 -2
- package/locales/index.js +4 -2
- package/logon-user/index.js +3 -1
- package/logout/index.js +6 -2
- package/milestone/vue.js +1 -1
- package/mini-picker/index.js +12 -10
- package/mini-picker/vue.js +10 -10
- package/modal/index.js +5 -3
- package/modal/vue.js +4 -2
- package/month-range/index.js +18 -18
- package/month-range/vue.js +16 -4
- package/month-table/index.js +7 -3
- package/multi-select/vue.js +1 -9
- package/nav-menu/index.js +33 -4
- package/nav-menu/vue.js +9 -1
- package/notify/vue.js +12 -1
- package/numeric/vue.js +6 -2
- package/option/index.js +10 -2
- package/option/vue.js +20 -9
- package/option-group/index.js +3 -1
- package/package.json +2 -1
- package/picker/index.js +88 -17
- package/picker/vue.js +42 -17
- package/picker-column/index.js +6 -6
- package/picker-column/vue.js +5 -5
- package/popconfirm/vue.js +3 -1
- package/popeditor/index.js +55 -13
- package/popeditor/vue.js +23 -7
- package/popover/vue.js +1 -2
- package/popup/vue.js +15 -2
- package/progress/index.js +9 -7
- package/progress/vue.js +12 -4
- package/pull-refresh/vue.js +10 -1
- package/query-builder/index.js +9 -0
- package/query-builder/vue.js +18 -0
- package/radio/vue.js +3 -1
- package/radio-button/vue.js +1 -1
- package/rate/index.js +8 -2
- package/rate/vue.js +27 -4
- package/recycle-scroller/index.js +0 -1
- package/scrollbar/vue-bar.js +18 -2
- package/search/index.js +12 -5
- package/search/vue.js +7 -5
- package/select/index.js +567 -283
- package/select/vue.js +141 -85
- package/select-dropdown/vue.js +8 -6
- package/select-mobile/index.js +26 -13
- package/select-mobile/vue.js +14 -5
- package/select-view/index.js +5 -21
- package/select-view/vue.js +0 -3
- package/selected-box/index.js +3 -1
- package/slider/index.js +5 -5
- package/slider/vue.js +16 -0
- package/slider-button/index.js +41 -0
- package/slider-button/vue.js +36 -0
- package/slider-button-group/slide-button.js +142 -0
- package/slider-button-group/vue.js +52 -0
- package/steps/slide-bar.js +0 -1
- package/switch/index.js +1 -1
- package/switch/vue.js +1 -1
- package/tab-bar/index.js +8 -6
- package/tab-nav/index.js +19 -13
- package/tab-nav/vue.js +10 -9
- package/tabs/index.js +21 -17
- package/tabs/vue.js +1 -4
- package/tag/vue.js +2 -1
- package/tag-group/index.js +23 -10
- package/tag-group/vue.js +5 -4
- package/time/index.js +8 -8
- package/time/vue.js +9 -9
- package/time-line/index.js +24 -2
- package/time-line/vue.js +30 -4
- package/time-panel/index.js +2 -2
- package/time-panel/vue.js +2 -2
- package/time-range/index.js +24 -21
- package/time-range/vue.js +26 -16
- package/time-spinner/index.js +32 -21
- package/time-spinner/vue.js +37 -12
- package/timeline-item/index.js +77 -0
- package/timeline-item/vue.js +44 -0
- package/toggle-menu/vue.js +0 -1
- package/tooltip/index.js +11 -12
- package/tooltip/vue.js +11 -1
- package/top-box/vue.js +13 -1
- package/tree/index.js +228 -15
- package/tree/vue.js +119 -15
- package/tree-menu/index.js +35 -0
- package/tree-menu/vue.js +27 -5
- package/tree-node/index.js +75 -10
- package/tree-node/vue.js +45 -23
- package/upload/index.js +90 -49
- package/upload/vue.js +22 -10
- package/upload-dragger/index.js +4 -3
- package/upload-list/index.js +67 -16
- package/upload-list/vue.js +26 -9
- package/user/index.js +7 -4
- package/user-link/index.js +2 -1
- package/wizard/index.js +4 -1
- package/wizard/vue.js +19 -2
- package/year-range/index.js +1 -1
- package/year-range/vue.js +3 -3
- package/year-table/index.js +2 -2
package/select/index.js
CHANGED
|
@@ -11,9 +11,12 @@ import PopupManager from "../common/deps/popup-manager";
|
|
|
11
11
|
import debounce from "../common/deps/debounce";
|
|
12
12
|
import { getDataset } from "../common/dataset";
|
|
13
13
|
import Memorize from "../common/deps/memorize";
|
|
14
|
-
import { isEmptyObject } from "../common/type";
|
|
14
|
+
import { isEmptyObject, isNull } from "../common/type";
|
|
15
15
|
import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
|
|
16
16
|
import { extend } from "../common/object";
|
|
17
|
+
import { BROWSER_NAME } from "../common";
|
|
18
|
+
import browserInfo from "../common/browser";
|
|
19
|
+
import { fastdom } from "../common/deps/fastdom";
|
|
17
20
|
const handleComposition = ({ api, nextTick, state }) => (event) => {
|
|
18
21
|
const text = event.target.value;
|
|
19
22
|
if (event.type === "compositionend") {
|
|
@@ -24,7 +27,7 @@ const handleComposition = ({ api, nextTick, state }) => (event) => {
|
|
|
24
27
|
state.isOnComposition = !isKorean(lastCharacter);
|
|
25
28
|
}
|
|
26
29
|
};
|
|
27
|
-
const showTip = ({ props, state,
|
|
30
|
+
const showTip = ({ props, state, vm }) => (show) => {
|
|
28
31
|
if (!props.showOverflowTooltip) {
|
|
29
32
|
return;
|
|
30
33
|
}
|
|
@@ -33,52 +36,52 @@ const showTip = ({ props, state, refs }) => (show) => {
|
|
|
33
36
|
clearTimeout(state.tipTimer);
|
|
34
37
|
state.tipTimer = setTimeout(() => {
|
|
35
38
|
state.showTip = state.tipHover;
|
|
36
|
-
}, refs.popover.closeDelay);
|
|
39
|
+
}, vm.$refs.popover.closeDelay);
|
|
37
40
|
} else {
|
|
38
41
|
if (!props.multiple) {
|
|
39
|
-
const reference = refs.reference.$el;
|
|
42
|
+
const reference = vm.$refs.reference.$el;
|
|
40
43
|
overflow = reference.querySelector("input").scrollWidth > reference.scrollWidth;
|
|
41
44
|
} else {
|
|
42
|
-
overflow = refs.tags.scrollHeight > refs.tags.getBoundingClientRect().height;
|
|
45
|
+
overflow = vm.$refs.tags.scrollHeight > vm.$refs.tags.getBoundingClientRect().height;
|
|
43
46
|
}
|
|
44
47
|
state.showTip = show && overflow && !!state.tips && !state.visible;
|
|
45
48
|
}
|
|
46
49
|
};
|
|
47
|
-
const gridOnQueryChange = ({ props,
|
|
50
|
+
const gridOnQueryChange = ({ props, vm, constants, state }) => (value) => {
|
|
48
51
|
const { multiple, valueField, filterMethod, filterable, remote, remoteMethod } = props;
|
|
49
52
|
if (filterable && typeof filterMethod === "function") {
|
|
50
|
-
const table = refs.selectGrid.$refs.tinyTable;
|
|
53
|
+
const table = vm.$refs.selectGrid.$refs.tinyTable;
|
|
51
54
|
const fullData = table.afterFullData;
|
|
52
|
-
refs.selectGrid.scrollTo(null, 0);
|
|
55
|
+
vm.$refs.selectGrid.scrollTo(null, 0);
|
|
53
56
|
table.afterFullData = filterMethod(value, fullData) || [];
|
|
54
|
-
refs.selectGrid.handleTableData(!value).then(() => state.selectEmitter.emit(constants.EVENT_NAME.updatePopper));
|
|
57
|
+
vm.$refs.selectGrid.handleTableData(!value).then(() => state.selectEmitter.emit(constants.EVENT_NAME.updatePopper));
|
|
55
58
|
state.previousQuery = value;
|
|
56
59
|
} else if (remote && typeof remoteMethod === "function") {
|
|
57
60
|
state.previousQuery = value;
|
|
58
|
-
remoteMethod(value).then((data) => {
|
|
61
|
+
remoteMethod(value, props.extraQueryParams).then((data) => {
|
|
59
62
|
if (multiple) {
|
|
60
63
|
const selectedIds = state.selected.map((sel) => sel[valueField]);
|
|
61
|
-
refs.selectGrid.clearSelection();
|
|
62
|
-
refs.selectGrid.setSelection(
|
|
64
|
+
vm.$refs.selectGrid.clearSelection();
|
|
65
|
+
vm.$refs.selectGrid.setSelection(
|
|
63
66
|
data.filter((row) => ~selectedIds.indexOf(row[valueField])),
|
|
64
67
|
true
|
|
65
68
|
);
|
|
66
69
|
state.remoteData = data.filter((row) => !~selectedIds.indexOf(row[valueField])).concat(state.selected);
|
|
67
70
|
} else {
|
|
68
|
-
refs.selectGrid.clearRadioRow();
|
|
69
|
-
refs.selectGrid.setRadioRow(find(data, (item) => props.modelValue == item[props.valueField]));
|
|
71
|
+
vm.$refs.selectGrid.clearRadioRow();
|
|
72
|
+
vm.$refs.selectGrid.setRadioRow(find(data, (item) => props.modelValue == item[props.valueField]));
|
|
70
73
|
state.remoteData = data;
|
|
71
74
|
}
|
|
72
|
-
refs.selectGrid.$refs.tinyTable.lastScrollTop = 0;
|
|
73
|
-
refs.selectGrid.loadData(data);
|
|
74
|
-
refs.selectGrid.handleTableData(!value).then(() => state.selectEmitter.emit(constants.EVENT_NAME.updatePopper));
|
|
75
|
+
vm.$refs.selectGrid.$refs.tinyTable.lastScrollTop = 0;
|
|
76
|
+
vm.$refs.selectGrid.loadData(data);
|
|
77
|
+
vm.$refs.selectGrid.handleTableData(!value).then(() => state.selectEmitter.emit(constants.EVENT_NAME.updatePopper));
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
80
|
};
|
|
78
81
|
const defaultOnQueryChange = ({ props, state, constants, api }) => (value) => {
|
|
79
|
-
if (props.remote && typeof props.remoteMethod === "function") {
|
|
82
|
+
if (props.remote && (typeof props.remoteMethod === "function" || typeof props.initQuery === "function")) {
|
|
80
83
|
state.hoverIndex = -1;
|
|
81
|
-
props.remoteMethod(value);
|
|
84
|
+
props.remoteMethod && props.remoteMethod(value, props.extraQueryParams);
|
|
82
85
|
} else if (typeof props.filterMethod === "function") {
|
|
83
86
|
props.filterMethod(value);
|
|
84
87
|
state.selectEmitter.emit(constants.COMPONENT_NAME.OptionGroup, constants.EVENT_NAME.queryChange);
|
|
@@ -90,12 +93,11 @@ const defaultOnQueryChange = ({ props, state, constants, api }) => (value) => {
|
|
|
90
93
|
api.checkDefaultFirstOption();
|
|
91
94
|
}
|
|
92
95
|
};
|
|
93
|
-
const handleQueryChange = ({ api, constants, nextTick, props, vm, state }) => (value) => {
|
|
94
|
-
|
|
95
|
-
if (state.previousQuery === value || state.isOnComposition) {
|
|
96
|
+
const handleQueryChange = ({ api, constants, nextTick, props, vm, state }) => (value, isChange = false) => {
|
|
97
|
+
if (state.previousQuery === value && !isChange || state.isOnComposition) {
|
|
96
98
|
return;
|
|
97
99
|
}
|
|
98
|
-
if (state.previousQuery === null && (typeof props.filterMethod === "function" || typeof props.remoteMethod === "function")) {
|
|
100
|
+
if (state.previousQuery === null && !isChange && (typeof props.filterMethod === "function" || typeof props.remoteMethod === "function" || typeof props.initQuery === "function")) {
|
|
99
101
|
state.previousQuery = value;
|
|
100
102
|
return;
|
|
101
103
|
}
|
|
@@ -106,21 +108,21 @@ const handleQueryChange = ({ api, constants, nextTick, props, vm, state }) => (v
|
|
|
106
108
|
if (props.renderType === constants.TYPE.Tree) {
|
|
107
109
|
state.previousQuery = value;
|
|
108
110
|
if (state.filterOrSearch && typeof props.filterMethod === "function") {
|
|
109
|
-
refs.selectTree && refs.selectTree.filter(value);
|
|
111
|
+
vm.$refs.selectTree && vm.$refs.selectTree.filter(value);
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
state.previousQuery = value;
|
|
113
|
-
|
|
115
|
+
window.requestAnimationFrame(() => {
|
|
114
116
|
if (state.visible) {
|
|
115
117
|
state.selectEmitter.emit(constants.EVENT_NAME.updatePopper);
|
|
116
118
|
state.showWarper = true;
|
|
117
119
|
}
|
|
118
120
|
});
|
|
119
121
|
state.hoverIndex = -1;
|
|
120
|
-
if (props.multiple && props.filterable) {
|
|
122
|
+
if (props.multiple && props.filterable && !props.shape) {
|
|
121
123
|
nextTick(() => {
|
|
122
|
-
if (refs.input) {
|
|
123
|
-
const length = refs.input.value.length * 15 + 20;
|
|
124
|
+
if (vm.$refs.input) {
|
|
125
|
+
const length = vm.$refs.input.value.length * 15 + 20;
|
|
124
126
|
state.inputLength = state.collapseTags ? Math.min(50, length) : length;
|
|
125
127
|
api.managePlaceholder();
|
|
126
128
|
api.resetInputHeight();
|
|
@@ -132,13 +134,13 @@ const handleQueryChange = ({ api, constants, nextTick, props, vm, state }) => (v
|
|
|
132
134
|
}
|
|
133
135
|
api.defaultOnQueryChange(value);
|
|
134
136
|
};
|
|
135
|
-
const scrollToOption = ({
|
|
137
|
+
const scrollToOption = ({ vm, constants }) => (option) => {
|
|
136
138
|
const target = Array.isArray(option) && option[0] ? option[0].el : option.el;
|
|
137
|
-
if (refs.popper && target) {
|
|
138
|
-
const menu = refs.popper.$el.querySelector(constants.CLASS.SelectDropdownWrap);
|
|
139
|
+
if (vm.$refs.popper && target) {
|
|
140
|
+
const menu = vm.$refs.popper.$el.querySelector(constants.CLASS.SelectDropdownWrap);
|
|
139
141
|
scrollIntoView(menu, target);
|
|
140
142
|
}
|
|
141
|
-
refs.scrollbar && refs.scrollbar.handleScroll();
|
|
143
|
+
vm.$refs.scrollbar && vm.$refs.scrollbar.handleScroll();
|
|
142
144
|
};
|
|
143
145
|
const handleMenuEnter = ({ api, nextTick, state }) => () => {
|
|
144
146
|
nextTick(() => api.scrollToOption(state.selected));
|
|
@@ -185,7 +187,7 @@ const emitChange = ({ emit, props, state, constants }) => (value) => {
|
|
|
185
187
|
const getOption = ({ props, state }) => (value) => {
|
|
186
188
|
let option;
|
|
187
189
|
const isObject = Object.prototype.toString.call(value).toLowerCase() === "[object object]";
|
|
188
|
-
const
|
|
190
|
+
const isNull2 = Object.prototype.toString.call(value).toLowerCase() === "[object null]";
|
|
189
191
|
const isUndefined = Object.prototype.toString.call(value).toLowerCase() === "[object undefined]";
|
|
190
192
|
for (let i = state.cachedOptions.length - 1; i >= 0; i--) {
|
|
191
193
|
const cachedOption = state.cachedOptions[i];
|
|
@@ -198,7 +200,7 @@ const getOption = ({ props, state }) => (value) => {
|
|
|
198
200
|
if (option) {
|
|
199
201
|
return option;
|
|
200
202
|
}
|
|
201
|
-
const label = !isObject && !
|
|
203
|
+
const label = !isObject && !isNull2 && !isUndefined ? value : "";
|
|
202
204
|
let newOption = { value, currentLabel: label };
|
|
203
205
|
if (props.multiple) {
|
|
204
206
|
newOption.hitState = false;
|
|
@@ -232,7 +234,7 @@ const getResultOfSetSelected = ({ props, isGrid, isTree, api }) => {
|
|
|
232
234
|
}
|
|
233
235
|
return result;
|
|
234
236
|
};
|
|
235
|
-
const setGridOrTreeSelected = ({ props, state, vm, isTree, api }) =>
|
|
237
|
+
const setGridOrTreeSelected = ({ props, state, vm, isTree, api }) => {
|
|
236
238
|
if (!props.modelValue) {
|
|
237
239
|
state.selectedLabel = "";
|
|
238
240
|
state.selected = {};
|
|
@@ -241,7 +243,7 @@ const setGridOrTreeSelected = ({ props, state, vm, isTree, api }) => () => {
|
|
|
241
243
|
vm.$refs.selectTree && vm.$refs.selectTree.setCurrentKey && vm.$refs.selectTree.setCurrentKey(null);
|
|
242
244
|
return;
|
|
243
245
|
}
|
|
244
|
-
const isRemote = state.filterOrSearch && props.remote && typeof props.remoteMethod === "function";
|
|
246
|
+
const isRemote = state.filterOrSearch && props.remote && (typeof props.remoteMethod === "function" || typeof props.initQuery === "function");
|
|
245
247
|
const nestdata = isRemote ? state.remoteData : isTree ? api.getTreeData(state.treeData) : state.gridData;
|
|
246
248
|
const data = find(nestdata, (item) => props.modelValue == item[props.valueField]);
|
|
247
249
|
if (isEmptyObject(data)) {
|
|
@@ -280,7 +282,7 @@ const setSelected = ({ api, constants, nextTick, props, vm, state }) => () => {
|
|
|
280
282
|
nextTick(api.resetInputHeight);
|
|
281
283
|
};
|
|
282
284
|
const getPluginOption = ({ api, props, state }) => (value, isTree) => {
|
|
283
|
-
const isRemote = state.filterOrSearch && props.remote && typeof props.remoteMethod === "function";
|
|
285
|
+
const isRemote = state.filterOrSearch && props.remote && (typeof props.remoteMethod === "function" || typeof props.initQuery === "function");
|
|
284
286
|
const { textField, valueField } = props;
|
|
285
287
|
const sourceData = isRemote ? state.remoteData : isTree ? api.getTreeData(state.treeData) : state.gridData;
|
|
286
288
|
const selNode = find(sourceData, (item) => item[valueField] == value);
|
|
@@ -291,7 +293,7 @@ const getPluginOption = ({ api, props, state }) => (value, isTree) => {
|
|
|
291
293
|
}
|
|
292
294
|
return items;
|
|
293
295
|
};
|
|
294
|
-
const toggleCheckAll = ({ api, emit, state }) => () => {
|
|
296
|
+
const toggleCheckAll = ({ api, emit, state, props }) => () => {
|
|
295
297
|
const getEnabledValues = (options) => {
|
|
296
298
|
let values = [];
|
|
297
299
|
for (let i = 0; i < options.length; i++) {
|
|
@@ -310,8 +312,19 @@ const toggleCheckAll = ({ api, emit, state }) => () => {
|
|
|
310
312
|
} else if (state.selectCls === "checked-sur") {
|
|
311
313
|
value = [];
|
|
312
314
|
}
|
|
315
|
+
const requiredValue = [];
|
|
316
|
+
if (props.multiple) {
|
|
317
|
+
state.options.forEach((opt) => {
|
|
318
|
+
if (opt.required)
|
|
319
|
+
requiredValue.push(opt.value);
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
if (Array.isArray(value)) {
|
|
323
|
+
value = requiredValue.concat(value.filter((val) => !requiredValue.find((requireVal) => requireVal === val)));
|
|
324
|
+
}
|
|
313
325
|
api.setSoftFocus();
|
|
314
|
-
|
|
326
|
+
state.isSilentBlur = true;
|
|
327
|
+
api.updateModelValue(value);
|
|
315
328
|
emit("change", value);
|
|
316
329
|
};
|
|
317
330
|
const resetFilter = ({ state, api }) => () => {
|
|
@@ -334,19 +347,20 @@ const handleFocus = ({ emit, props, state, api }) => (event) => {
|
|
|
334
347
|
api.resetFilter();
|
|
335
348
|
}
|
|
336
349
|
};
|
|
337
|
-
const focus = ({
|
|
350
|
+
const focus = ({ vm, state }) => () => {
|
|
338
351
|
var _a;
|
|
339
352
|
if (!state.softFocus) {
|
|
340
|
-
(_a = refs.reference) == null ? void 0 : _a.focus();
|
|
353
|
+
(_a = vm.$refs.reference) == null ? void 0 : _a.focus();
|
|
341
354
|
}
|
|
342
355
|
};
|
|
343
|
-
const blur = ({
|
|
356
|
+
const blur = ({ vm, state }) => () => {
|
|
344
357
|
var _a;
|
|
345
358
|
state.visible = false;
|
|
346
|
-
(_a = refs.reference) == null ? void 0 : _a.blur();
|
|
359
|
+
(_a = vm.$refs.reference) == null ? void 0 : _a.blur();
|
|
347
360
|
};
|
|
348
361
|
const handleBlur = ({ constants, dispatch, emit, state }) => (event) => {
|
|
349
|
-
|
|
362
|
+
clearTimeout(state.timer);
|
|
363
|
+
state.timer = setTimeout(() => {
|
|
350
364
|
var _a;
|
|
351
365
|
if (state.isSilentBlur) {
|
|
352
366
|
state.isSilentBlur = false;
|
|
@@ -354,14 +368,14 @@ const handleBlur = ({ constants, dispatch, emit, state }) => (event) => {
|
|
|
354
368
|
emit("blur", event);
|
|
355
369
|
}
|
|
356
370
|
dispatch(constants.COMPONENT_NAME.FormItem, constants.EVENT_NAME.formBlur, (_a = event == null ? void 0 : event.target) == null ? void 0 : _a.value);
|
|
357
|
-
},
|
|
371
|
+
}, 200);
|
|
358
372
|
state.softFocus = false;
|
|
359
373
|
};
|
|
360
374
|
const handleClearClick = (api) => (event) => {
|
|
361
375
|
api.deleteSelected(event);
|
|
362
376
|
};
|
|
363
|
-
const doDestroy = (
|
|
364
|
-
refs.popper && refs.popper.doDestroy();
|
|
377
|
+
const doDestroy = (vm) => () => {
|
|
378
|
+
vm.$refs.popper && vm.$refs.popper.doDestroy();
|
|
365
379
|
};
|
|
366
380
|
const handleClose = (state) => () => {
|
|
367
381
|
state.visible = false;
|
|
@@ -382,51 +396,67 @@ const toggleLastOptionHitState = ({ state }) => (hit) => {
|
|
|
382
396
|
hitTarget.hitState = !hitTarget.hitState;
|
|
383
397
|
return hitTarget.hitState;
|
|
384
398
|
};
|
|
385
|
-
const deletePrevTag = ({ api, constants,
|
|
386
|
-
const refs = vm.$refs;
|
|
399
|
+
const deletePrevTag = ({ api, constants, props, state, vm }) => (event) => {
|
|
387
400
|
if (event.target.value.length <= 0 && !api.toggleLastOptionHitState()) {
|
|
388
401
|
const value = props.modelValue.slice();
|
|
389
402
|
value.pop();
|
|
390
|
-
|
|
403
|
+
api.updateModelValue(value);
|
|
391
404
|
api.emitChange(value);
|
|
392
405
|
if (props.renderType === constants.TYPE.Grid) {
|
|
393
406
|
const rows = state.selected.slice().filter((item) => value.includes(item[props.valueField]));
|
|
394
|
-
refs.selectGrid.clearSelection();
|
|
395
|
-
refs.selectGrid.setSelection(rows, true);
|
|
407
|
+
vm.$refs.selectGrid.clearSelection();
|
|
408
|
+
vm.$refs.selectGrid.setSelection(rows, true);
|
|
396
409
|
}
|
|
397
410
|
}
|
|
398
411
|
};
|
|
399
|
-
const managePlaceholder = ({
|
|
412
|
+
const managePlaceholder = ({ vm, state }) => () => {
|
|
400
413
|
if (state.currentPlaceholder !== "") {
|
|
401
|
-
state.currentPlaceholder = refs.input.value ? "" : state.cachedPlaceHolder;
|
|
414
|
+
state.currentPlaceholder = vm.$refs.input.value ? "" : state.cachedPlaceHolder;
|
|
402
415
|
}
|
|
403
416
|
};
|
|
404
|
-
const resetInputState = ({ api,
|
|
417
|
+
const resetInputState = ({ api, vm, state }) => (event) => {
|
|
405
418
|
if (event.keyCode !== 8) {
|
|
406
419
|
api.toggleLastOptionHitState(false);
|
|
407
420
|
}
|
|
408
|
-
state.inputLength = refs.input.value.length * 15 + 20;
|
|
421
|
+
state.inputLength = vm.$refs.input.value.length * 15 + 20;
|
|
409
422
|
api.resetInputHeight();
|
|
410
423
|
};
|
|
411
|
-
const resetInputHeight = ({ constants, nextTick, props,
|
|
412
|
-
if (state.collapseTags &&
|
|
424
|
+
const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designConfig }) => () => {
|
|
425
|
+
if (state.collapseTags && !props.filterable) {
|
|
413
426
|
return;
|
|
414
427
|
}
|
|
415
428
|
nextTick(() => {
|
|
416
|
-
|
|
429
|
+
var _a;
|
|
430
|
+
if (!vm.$refs.reference) {
|
|
417
431
|
return;
|
|
418
432
|
}
|
|
419
|
-
const inputChildNodes = refs.reference.$el.childNodes;
|
|
433
|
+
const inputChildNodes = vm.$refs.reference.$el.childNodes;
|
|
420
434
|
const inputContainer = [].filter.call(inputChildNodes, (item) => hasClass(item, "tiny-input-display-only"))[0];
|
|
421
435
|
const input = inputContainer && inputContainer.querySelector("input");
|
|
422
|
-
const tags = refs.tags;
|
|
436
|
+
const tags = vm.$refs.tags;
|
|
423
437
|
if (!input) {
|
|
424
438
|
return;
|
|
425
439
|
}
|
|
426
|
-
|
|
440
|
+
if (!state.isDisplayOnly && props.hoverExpand && !props.disabled) {
|
|
441
|
+
api.calcCollapseTags();
|
|
442
|
+
}
|
|
443
|
+
const sizeInMap = ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.initialInputHeight) || state.initialInputHeight;
|
|
427
444
|
const noSelected = state.selected.length === 0;
|
|
428
445
|
const borderHeight = 2;
|
|
429
|
-
|
|
446
|
+
if (!state.isDisplayOnly) {
|
|
447
|
+
if (!noSelected && tags) {
|
|
448
|
+
fastdom.measure(() => {
|
|
449
|
+
const tagsClientHeight = tags.clientHeight;
|
|
450
|
+
fastdom.mutate(() => {
|
|
451
|
+
input.style.height = Math.max(tagsClientHeight + (tagsClientHeight > sizeInMap ? borderHeight : 0), sizeInMap) + "px";
|
|
452
|
+
});
|
|
453
|
+
});
|
|
454
|
+
} else {
|
|
455
|
+
input.style.height = noSelected ? sizeInMap + "px" : Math.max(0, sizeInMap) + "px";
|
|
456
|
+
}
|
|
457
|
+
} else {
|
|
458
|
+
input.style.height = "auto";
|
|
459
|
+
}
|
|
430
460
|
if (state.visible && state.emptyText !== false) {
|
|
431
461
|
state.selectEmitter.emit(constants.EVENT_NAME.updatePopper, true);
|
|
432
462
|
}
|
|
@@ -448,7 +478,7 @@ const resetHoverIndex = ({ props, state }) => () => {
|
|
|
448
478
|
}
|
|
449
479
|
}
|
|
450
480
|
};
|
|
451
|
-
const handleOptionSelect = ({ api,
|
|
481
|
+
const handleOptionSelect = ({ api, nextTick, props, vm, state }) => (option, byClick) => {
|
|
452
482
|
var _a, _b;
|
|
453
483
|
state.memorize && state.memorize.updateByKey(option[state.memorize._dataKey] || option.value);
|
|
454
484
|
if (props.multiple) {
|
|
@@ -459,7 +489,7 @@ const handleOptionSelect = ({ api, emit, nextTick, props, refs, state }) => (opt
|
|
|
459
489
|
} else if (state.multipleLimit <= 0 || value.length < state.multipleLimit) {
|
|
460
490
|
value.push(option.value);
|
|
461
491
|
}
|
|
462
|
-
|
|
492
|
+
api.updateModelValue(value);
|
|
463
493
|
api.emitChange(value);
|
|
464
494
|
if (option.created) {
|
|
465
495
|
state.query = "";
|
|
@@ -467,16 +497,16 @@ const handleOptionSelect = ({ api, emit, nextTick, props, refs, state }) => (opt
|
|
|
467
497
|
state.inputLength = 20;
|
|
468
498
|
}
|
|
469
499
|
if (props.filterable) {
|
|
470
|
-
(_a = refs.input) == null ? void 0 : _a.focus();
|
|
500
|
+
(_a = vm.$refs.input) == null ? void 0 : _a.focus();
|
|
471
501
|
}
|
|
472
502
|
if (props.searchable) {
|
|
473
|
-
(_b = refs.reference) == null ? void 0 : _b.focus();
|
|
503
|
+
(_b = vm.$refs.reference) == null ? void 0 : _b.focus();
|
|
474
504
|
}
|
|
475
505
|
if (props.autoClose) {
|
|
476
506
|
state.visible = false;
|
|
477
507
|
}
|
|
478
508
|
} else {
|
|
479
|
-
|
|
509
|
+
api.updateModelValue(option.value);
|
|
480
510
|
api.emitChange(option.value);
|
|
481
511
|
if (option.created) {
|
|
482
512
|
state.createdSelected = true;
|
|
@@ -493,9 +523,13 @@ const handleOptionSelect = ({ api, emit, nextTick, props, refs, state }) => (opt
|
|
|
493
523
|
api.scrollToOption(option);
|
|
494
524
|
});
|
|
495
525
|
};
|
|
496
|
-
const
|
|
526
|
+
const initValue = ({ state }) => (vm) => {
|
|
527
|
+
const isExist = state.initValue.find((val) => val === vm.value);
|
|
528
|
+
!isExist && state.initValue.push(vm.value);
|
|
529
|
+
};
|
|
530
|
+
const setSoftFocus = ({ vm, state }) => () => {
|
|
497
531
|
state.softFocus = true;
|
|
498
|
-
const input = refs.input || refs.reference;
|
|
532
|
+
const input = vm.$refs.input || vm.$refs.reference;
|
|
499
533
|
input == null ? void 0 : input.focus();
|
|
500
534
|
};
|
|
501
535
|
const getValueIndex = (props) => (arr = [], value = null) => {
|
|
@@ -515,22 +549,25 @@ const getValueIndex = (props) => (arr = [], value = null) => {
|
|
|
515
549
|
return index;
|
|
516
550
|
}
|
|
517
551
|
};
|
|
518
|
-
const toggleMenu = ({
|
|
552
|
+
const toggleMenu = ({ vm, state, props }) => (e) => {
|
|
553
|
+
const event = e || window.event;
|
|
554
|
+
const enterCode = 13;
|
|
555
|
+
const nodeName = event.target && event.target.nodeName;
|
|
556
|
+
const toggleVisible = props.ignoreEnter ? event.keyCode !== enterCode && nodeName === "INPUT" : true;
|
|
519
557
|
if (!state.selectDisabled) {
|
|
520
|
-
!
|
|
521
|
-
|
|
522
|
-
!props.ignoreEnter && (state.visible = !state.visible);
|
|
523
|
-
state.softFocus = false;
|
|
524
|
-
}
|
|
558
|
+
toggleVisible && !state.softFocus && (state.visible = !state.visible);
|
|
559
|
+
state.softFocus = false;
|
|
525
560
|
if (state.visible) {
|
|
526
|
-
|
|
527
|
-
|
|
561
|
+
if (!(props.filterable && props.shape)) {
|
|
562
|
+
const dom = vm.$refs.input || vm.$refs.reference;
|
|
563
|
+
dom == null ? void 0 : dom.focus();
|
|
564
|
+
}
|
|
528
565
|
}
|
|
529
566
|
}
|
|
530
567
|
};
|
|
531
|
-
const selectOption = ({ api, state, props }) => () => {
|
|
568
|
+
const selectOption = ({ api, state, props }) => (e) => {
|
|
532
569
|
if (!state.visible || props.hideDrop) {
|
|
533
|
-
api.toggleMenu();
|
|
570
|
+
api.toggleMenu(e);
|
|
534
571
|
} else {
|
|
535
572
|
if (state.options[state.hoverIndex]) {
|
|
536
573
|
api.handleOptionSelect(state.options[state.hoverIndex]);
|
|
@@ -539,7 +576,12 @@ const selectOption = ({ api, state, props }) => () => {
|
|
|
539
576
|
};
|
|
540
577
|
const deleteSelected = ({ api, constants, emit, props, vm, state }) => (event) => {
|
|
541
578
|
event.stopPropagation();
|
|
542
|
-
|
|
579
|
+
let selectedValue = [];
|
|
580
|
+
if (props.multiple) {
|
|
581
|
+
const requireOptions = state.options.filter((opt) => opt.required && opt.value);
|
|
582
|
+
selectedValue = props.modelValue.slice().filter((v) => requireOptions.find((opt) => opt.value === v));
|
|
583
|
+
}
|
|
584
|
+
const value = props.multiple ? selectedValue : "";
|
|
543
585
|
const refs = vm.$refs;
|
|
544
586
|
if (props.renderType === constants.TYPE.Tree) {
|
|
545
587
|
state.selected = {};
|
|
@@ -551,12 +593,14 @@ const deleteSelected = ({ api, constants, emit, props, vm, state }) => (event) =
|
|
|
551
593
|
refs.selectGrid.clearRadioRow();
|
|
552
594
|
}
|
|
553
595
|
state.showTip = false;
|
|
554
|
-
|
|
596
|
+
api.updateModelValue(value);
|
|
555
597
|
api.emitChange(value);
|
|
556
598
|
state.visible = false;
|
|
557
599
|
emit("clear");
|
|
558
600
|
};
|
|
559
|
-
const deleteTag = ({ api, constants, emit, props, state, vm }) => (event, tag) => {
|
|
601
|
+
const deleteTag = ({ api, constants, emit, props, state, nextTick, vm }) => (event, tag) => {
|
|
602
|
+
if (tag.required)
|
|
603
|
+
return;
|
|
560
604
|
const refs = vm.$refs;
|
|
561
605
|
const isTree = props.renderType === constants.TYPE.Tree;
|
|
562
606
|
const index = state.selected.indexOf(tag);
|
|
@@ -568,7 +612,7 @@ const deleteTag = ({ api, constants, emit, props, state, vm }) => (event, tag) =
|
|
|
568
612
|
treeIds.push(...api.getChildValue(node.childNodes, props.valueField));
|
|
569
613
|
}
|
|
570
614
|
while (node.parent && !Array.isArray(node.parent.data)) {
|
|
571
|
-
treeIds.push(node.parent.data[props.valueField]);
|
|
615
|
+
node.parent.data && treeIds.push(node.parent.data[props.valueField]);
|
|
572
616
|
node = node.parent;
|
|
573
617
|
}
|
|
574
618
|
state.selected.slice().map((node2) => !treeIds.includes(node2[props.valueField]) && treeValue.push(node2[props.valueField]));
|
|
@@ -584,9 +628,10 @@ const deleteTag = ({ api, constants, emit, props, state, vm }) => (event, tag) =
|
|
|
584
628
|
refs.selectGrid.clearSelection();
|
|
585
629
|
refs.selectGrid.setSelection(rows, true);
|
|
586
630
|
}
|
|
587
|
-
|
|
631
|
+
api.updateModelValue(isTree ? treeValue : value);
|
|
588
632
|
api.emitChange(value);
|
|
589
633
|
emit(constants.EVENT_NAME.removeTag, tag[props.valueField]);
|
|
634
|
+
nextTick(() => state.key++);
|
|
590
635
|
}
|
|
591
636
|
event.stopPropagation();
|
|
592
637
|
};
|
|
@@ -613,13 +658,13 @@ const onOptionDestroy = (state) => (index) => {
|
|
|
613
658
|
state.options.splice(index, 1);
|
|
614
659
|
}
|
|
615
660
|
};
|
|
616
|
-
const resetInputWidth = ({
|
|
661
|
+
const resetInputWidth = ({ vm, state }) => () => {
|
|
617
662
|
var _a, _b, _c;
|
|
618
|
-
state.inputWidth = ((_c = (_b = (_a = refs.reference) == null ? void 0 : _a.$el) == null ? void 0 : _b.getBoundingClientRect()) == null ? void 0 : _c.width) || 0;
|
|
663
|
+
state.inputWidth = ((_c = (_b = (_a = vm.$refs.reference) == null ? void 0 : _a.$el) == null ? void 0 : _b.getBoundingClientRect()) == null ? void 0 : _c.width) || 0;
|
|
619
664
|
};
|
|
620
|
-
const handleResize = ({ api, props }) => () => {
|
|
665
|
+
const handleResize = ({ api, props, state }) => () => {
|
|
621
666
|
api.resetInputWidth();
|
|
622
|
-
if (props.multiple) {
|
|
667
|
+
if (props.multiple && !state.isDisplayOnly) {
|
|
623
668
|
api.resetInputHeight();
|
|
624
669
|
}
|
|
625
670
|
};
|
|
@@ -639,7 +684,7 @@ const checkDefaultFirstOption = (state) => () => {
|
|
|
639
684
|
for (let i = 0; i !== state.options.length; ++i) {
|
|
640
685
|
const option = state.options[i];
|
|
641
686
|
if (state.query) {
|
|
642
|
-
if (!option.disabled && !option.groupDisabled && option.visible) {
|
|
687
|
+
if (!option.disabled && !option.groupDisabled && option.state.visible) {
|
|
643
688
|
state.hoverIndex = i;
|
|
644
689
|
break;
|
|
645
690
|
}
|
|
@@ -652,8 +697,10 @@ const checkDefaultFirstOption = (state) => () => {
|
|
|
652
697
|
}
|
|
653
698
|
};
|
|
654
699
|
const getValueKey = (props) => (item) => {
|
|
700
|
+
if (!item)
|
|
701
|
+
return;
|
|
655
702
|
if (Object.prototype.toString.call(item.value).toLowerCase() !== "[object object]") {
|
|
656
|
-
return item.value;
|
|
703
|
+
return item.value || item[props.valueField];
|
|
657
704
|
}
|
|
658
705
|
return getObj(item.value, props.valueKey);
|
|
659
706
|
};
|
|
@@ -695,120 +742,26 @@ const emptyText = ({ I18N, props, state, t }) => () => {
|
|
|
695
742
|
}
|
|
696
743
|
return state.selected[props.valueField] || state.remoteData.length > 0;
|
|
697
744
|
}
|
|
698
|
-
if (
|
|
699
|
-
return false;
|
|
700
|
-
}
|
|
701
|
-
if (state.filterOrSearch && state.query && state.options.length > 0 && state.filteredOptionsCount === 0) {
|
|
745
|
+
if (state.filterOrSearch && state.query && state.options.length >= 0 && state.filteredOptionsCount === 0) {
|
|
702
746
|
return props.noMatchText || t(I18N.noMatch);
|
|
703
747
|
}
|
|
704
748
|
if (!state.options.some((option) => option.visible)) {
|
|
705
749
|
return props.noDataText || t(I18N.noData);
|
|
706
750
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
const optmzApis = {
|
|
711
|
-
exist: (val, multiple) => multiple ? Array.isArray(val) && val.length : val,
|
|
712
|
-
getValueIndex: (props) => {
|
|
713
|
-
const { options, valueField, modelValue, multiple } = props;
|
|
714
|
-
const contain = (val, arr) => Array.isArray(arr) && ~arr.indexOf(val);
|
|
715
|
-
const equal = (val, opt) => multiple ? contain(opt[valueField], [val]) : opt[valueField] === val;
|
|
716
|
-
let start = 0;
|
|
717
|
-
if (optmzApis.exist(modelValue, multiple)) {
|
|
718
|
-
const lastVal = multiple ? modelValue[modelValue.length - 1] : modelValue;
|
|
719
|
-
for (let i = 0; i < options.length; i++) {
|
|
720
|
-
if (!equal(lastVal, options[i])) {
|
|
721
|
-
continue;
|
|
722
|
-
}
|
|
723
|
-
return i;
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
return start;
|
|
727
|
-
},
|
|
728
|
-
getStartIndex: ({ props, state }) => {
|
|
729
|
-
const { options } = props;
|
|
730
|
-
const { optimizeOpts, optimizeStore } = state;
|
|
731
|
-
const { rSize } = optimizeOpts;
|
|
732
|
-
const { valueIndex } = optimizeStore;
|
|
733
|
-
return valueIndex + rSize > options.length ? options.length - rSize : valueIndex;
|
|
734
|
-
},
|
|
735
|
-
getViewStyle: ({ props, state }) => {
|
|
736
|
-
const { options } = props;
|
|
737
|
-
const { optimizeOpts } = state;
|
|
738
|
-
const { optionHeight } = optimizeOpts;
|
|
739
|
-
return `height:${optionHeight * options.length}px`;
|
|
740
|
-
},
|
|
741
|
-
getStoreDatas: ({ props, state }) => {
|
|
742
|
-
const { options, valueField, modelValue, multiple } = props;
|
|
743
|
-
const { datas, optimizeOpts, optimizeStore } = state;
|
|
744
|
-
const { startIndex } = optimizeStore;
|
|
745
|
-
const { rSize } = optimizeOpts;
|
|
746
|
-
const sliced = datas.slice(startIndex, startIndex + rSize);
|
|
747
|
-
const hiddenOptions = optimizeStore.hiddenOptions = [];
|
|
748
|
-
const findPush = (val) => {
|
|
749
|
-
const opt = options.find((option) => option[valueField] === val);
|
|
750
|
-
if (opt && !~sliced.indexOf(opt)) {
|
|
751
|
-
sliced.push(opt);
|
|
752
|
-
hiddenOptions.push(opt);
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
if (optmzApis.exist(modelValue, multiple)) {
|
|
756
|
-
if (multiple) {
|
|
757
|
-
modelValue.forEach(findPush);
|
|
751
|
+
if (props.remote && state.query === "" && state.options.length === 0) {
|
|
752
|
+
if (props.shape === "filter") {
|
|
753
|
+
return "";
|
|
758
754
|
} else {
|
|
759
|
-
|
|
755
|
+
return false;
|
|
760
756
|
}
|
|
761
757
|
}
|
|
762
|
-
return sliced;
|
|
763
|
-
},
|
|
764
|
-
queryWrap: (refs) => refs.scrollbar.$el.querySelector(".tiny-scrollbar__wrap.virtual"),
|
|
765
|
-
queryItems: (refs) => refs.scrollbar.$el.querySelectorAll(".tiny-option.virtual"),
|
|
766
|
-
createMacro: (cb) => setTimeout(cb),
|
|
767
|
-
setScrollTop: ({ refs, state }) => {
|
|
768
|
-
const { optimizeOpts, optimizeStore } = state;
|
|
769
|
-
const { optionHeight } = optimizeOpts;
|
|
770
|
-
const wrap = optmzApis.queryWrap(refs);
|
|
771
|
-
wrap.scrollTop = optionHeight * optimizeStore.valueIndex;
|
|
772
|
-
},
|
|
773
|
-
setValueIndex: ({ props, state }) => state.optimizeStore.valueIndex = optmzApis.getValueIndex(props),
|
|
774
|
-
addScrollListener: ({ api, refs, state }) => {
|
|
775
|
-
const { optimizeStore } = state;
|
|
776
|
-
const wrap = optmzApis.queryWrap(refs);
|
|
777
|
-
!optimizeStore.bind && wrap.addEventListener("scroll", api.getScrollListener) && (optimizeStore.bind = true);
|
|
778
|
-
},
|
|
779
|
-
removeScrollListener: ({ api, refs, state }) => {
|
|
780
|
-
const { optimizeStore } = state;
|
|
781
|
-
const wrap = optmzApis.queryWrap(refs);
|
|
782
|
-
optimizeStore.bind && wrap.removeEventListener("scroll", api.getScrollListener) && (optimizeStore.bind = false);
|
|
783
|
-
},
|
|
784
|
-
isFirstPage: ({ props, state }) => {
|
|
785
|
-
const { optimizeStore } = state;
|
|
786
|
-
const { datas } = optimizeStore;
|
|
787
|
-
const { options } = props;
|
|
788
|
-
return Array.isArray(datas) && Array.isArray(options) && datas[0] === options[0];
|
|
789
|
-
},
|
|
790
|
-
natural: (val) => val < 0 ? 0 : val,
|
|
791
|
-
updateItems: ({ refs, state, itemFn }) => {
|
|
792
|
-
const { optimizeOpts } = state;
|
|
793
|
-
const { optionHeight } = optimizeOpts;
|
|
794
|
-
const items = optmzApis.queryItems(refs);
|
|
795
|
-
for (let i = 0; i < items.length; i++) {
|
|
796
|
-
const item = items[i];
|
|
797
|
-
const flag = item.classList.contains("virtual-hidden");
|
|
798
|
-
item.style.top = flag ? `-${optionHeight}px` : `${itemFn(i)}px`;
|
|
799
|
-
}
|
|
800
|
-
},
|
|
801
|
-
process: ({ props, start, state }) => {
|
|
802
|
-
const { optimizeStore } = state;
|
|
803
|
-
optimizeStore.startIndex = typeof start !== "undefined" ? start : optmzApis.getStartIndex({ props, state });
|
|
804
|
-
optimizeStore.datas = optmzApis.getStoreDatas({ props, state });
|
|
805
|
-
optimizeStore.firstPage = optmzApis.isFirstPage({ props, state });
|
|
806
758
|
}
|
|
759
|
+
return null;
|
|
807
760
|
};
|
|
808
|
-
const watchValue = ({ api, constants, dispatch, props,
|
|
761
|
+
const watchValue = ({ api, constants, dispatch, props, vm, state }) => (value, oldValue) => {
|
|
809
762
|
if (props.multiple) {
|
|
810
763
|
api.resetInputHeight();
|
|
811
|
-
if (value && value.length > 0 || refs.input && state.query !== "") {
|
|
764
|
+
if (value && value.length > 0 || vm.$refs.input && state.query !== "") {
|
|
812
765
|
state.currentPlaceholder = "";
|
|
813
766
|
} else {
|
|
814
767
|
state.currentPlaceholder = state.cachedPlaceHolder;
|
|
@@ -819,6 +772,8 @@ const watchValue = ({ api, constants, dispatch, props, refs, state }) => (value,
|
|
|
819
772
|
}
|
|
820
773
|
}
|
|
821
774
|
api.setSelected();
|
|
775
|
+
!state.isClickChoose && api.initQuery({ init: true }).then(() => api.setSelected());
|
|
776
|
+
state.isClickChoose = false;
|
|
822
777
|
if (props.filterable && !props.multiple) {
|
|
823
778
|
state.inputLength = 20;
|
|
824
779
|
}
|
|
@@ -827,41 +782,41 @@ const watchValue = ({ api, constants, dispatch, props, refs, state }) => (value,
|
|
|
827
782
|
}
|
|
828
783
|
state.optimizeStore.flag && optmzApis.setValueIndex({ props, state });
|
|
829
784
|
};
|
|
830
|
-
const calcOverFlow = ({
|
|
831
|
-
if (
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
break;
|
|
785
|
+
const calcOverFlow = ({ vm, props, state }) => (height) => {
|
|
786
|
+
if (props.multiple && props.showOverflowTooltip) {
|
|
787
|
+
state.overflow = false;
|
|
788
|
+
const tagDom = vm.$refs.tags;
|
|
789
|
+
const tags = tagDom.querySelectorAll(".tiny-tag");
|
|
790
|
+
if (tags.length) {
|
|
791
|
+
tagDom.scrollTo && tagDom.scrollTo({ top: 0 });
|
|
792
|
+
let { x, width } = tags[0].getBoundingClientRect();
|
|
793
|
+
if (width >= tagDom.getBoundingClientRect().width) {
|
|
794
|
+
state.overflow = 0;
|
|
795
|
+
} else {
|
|
796
|
+
for (let i = 1; i < tags.length; i++) {
|
|
797
|
+
let tx = tags[i].getBoundingClientRect().x;
|
|
798
|
+
if (tx == x) {
|
|
799
|
+
state.overflow = i - 1;
|
|
800
|
+
break;
|
|
801
|
+
}
|
|
848
802
|
}
|
|
849
803
|
}
|
|
850
804
|
}
|
|
805
|
+
vm.$refs.select.style.height = vm.$refs.select.style.height || height;
|
|
806
|
+
vm.$refs.reference.$el.style.position = "absolute";
|
|
807
|
+
const inputWidth = vm.$refs.select.getBoundingClientRect().width;
|
|
808
|
+
const position = state.visible ? "absolute" : "";
|
|
809
|
+
state.selectFiexd = {
|
|
810
|
+
height,
|
|
811
|
+
position,
|
|
812
|
+
width: inputWidth + "px",
|
|
813
|
+
zIndex: PopupManager.nextZIndex()
|
|
814
|
+
};
|
|
815
|
+
state.inputWidth = inputWidth;
|
|
851
816
|
}
|
|
852
|
-
refs.select.style.height = refs.select.style.height || height;
|
|
853
|
-
refs.reference.$el.style.position = "absolute";
|
|
854
|
-
const inputWidth = refs.select.getBoundingClientRect().width;
|
|
855
|
-
const position = state.visible ? "absolute" : "";
|
|
856
|
-
state.selectFiexd = {
|
|
857
|
-
height,
|
|
858
|
-
position,
|
|
859
|
-
width: inputWidth + "px",
|
|
860
|
-
zIndex: PopupManager.nextZIndex()
|
|
861
|
-
};
|
|
862
|
-
state.inputWidth = inputWidth;
|
|
863
817
|
};
|
|
864
818
|
const postOperOfToVisible = ({ props, state, constants }) => {
|
|
819
|
+
var _a;
|
|
865
820
|
if (props.multiple) {
|
|
866
821
|
return;
|
|
867
822
|
}
|
|
@@ -872,7 +827,7 @@ const postOperOfToVisible = ({ props, state, constants }) => {
|
|
|
872
827
|
if (props.filterable && props.allowCreate && state.createdSelected && state.createdLabel) {
|
|
873
828
|
state.selectedLabel = state.createdLabel;
|
|
874
829
|
} else {
|
|
875
|
-
state.selectedLabel = state.selected.state.currentLabel || state.selected.currentLabel;
|
|
830
|
+
state.selectedLabel = ((_a = state.selected.state) == null ? void 0 : _a.currentLabel) || state.selected.currentLabel;
|
|
876
831
|
}
|
|
877
832
|
if (props.filterable) {
|
|
878
833
|
state.query = state.selectedLabel;
|
|
@@ -885,69 +840,92 @@ const postOperOfToVisible = ({ props, state, constants }) => {
|
|
|
885
840
|
};
|
|
886
841
|
const toVisible = ({ constants, state, props, vm, api, nextTick }) => () => {
|
|
887
842
|
var _a;
|
|
888
|
-
const refs = vm.$refs;
|
|
889
843
|
state.selectEmitter.emit(constants.EVENT_NAME.destroyPopper);
|
|
890
844
|
props.remote && props.dropOnlySearch && (state.showWarper = false);
|
|
891
|
-
(_a = refs.input) == null ? void 0 : _a.blur();
|
|
845
|
+
(_a = vm.$refs.input) == null ? void 0 : _a.blur();
|
|
892
846
|
state.query = "";
|
|
893
847
|
state.selectedLabel = "";
|
|
894
848
|
state.inputLength = 20;
|
|
849
|
+
state.previousQuery !== state.query && api.initQuery().then(() => api.setSelected());
|
|
895
850
|
if (props.renderType !== constants.TYPE.Tree) {
|
|
896
851
|
state.previousQuery = props.remoteConfig.clearData && state.previousQuery !== state.query ? void 0 : null;
|
|
897
852
|
}
|
|
898
853
|
api.resetHoverIndex();
|
|
899
854
|
nextTick(() => {
|
|
900
|
-
if (refs.input && refs.input.value === "" && state.selected.length === 0) {
|
|
855
|
+
if (vm.$refs.input && vm.$refs.input.value === "" && state.selected.length === 0) {
|
|
901
856
|
state.currentPlaceholder = state.cachedPlaceHolder;
|
|
902
857
|
}
|
|
903
|
-
if (refs.selectGrid) {
|
|
904
|
-
refs.selectGrid.clearScroll();
|
|
858
|
+
if (vm.$refs.selectGrid) {
|
|
859
|
+
vm.$refs.selectGrid.clearScroll();
|
|
905
860
|
}
|
|
906
861
|
});
|
|
907
862
|
postOperOfToVisible({ props, state, constants });
|
|
908
863
|
};
|
|
909
864
|
const toHide = ({ constants, state, props, vm, api }) => () => {
|
|
910
865
|
var _a, _b;
|
|
911
|
-
const refs = vm.$refs;
|
|
912
866
|
state.selectEmitter.emit(constants.COMPONENT_NAME.SelectDropdown, constants.EVENT_NAME.updatePopper);
|
|
913
867
|
if (state.filterOrSearch) {
|
|
914
|
-
state.query = props.remote || props.
|
|
868
|
+
state.query = props.remote || props.shape ? "" : props.renderType !== constants.TYPE.Tree ? state.selectedLabel : "";
|
|
915
869
|
state.previousQuery !== state.query && api.handleQueryChange(state.query);
|
|
916
870
|
if (props.multiple) {
|
|
917
|
-
props.filterable ? (_a = refs.input) == null ? void 0 : _a.focus() : (_b = refs.reference) == null ? void 0 : _b.focus();
|
|
871
|
+
props.filterable ? (_a = vm.$refs.input) == null ? void 0 : _a.focus() : (_b = vm.$refs.reference) == null ? void 0 : _b.focus();
|
|
918
872
|
} else {
|
|
919
873
|
if (!props.remote) {
|
|
920
874
|
state.selectEmitter.emit(constants.EVENT_NAME.queryChange, "");
|
|
921
875
|
state.selectEmitter.emit(constants.COMPONENT_NAME.OptionGroup, constants.EVENT_NAME.queryChange);
|
|
922
876
|
}
|
|
923
|
-
if (state.selectedLabel) {
|
|
877
|
+
if (state.selectedLabel && !props.shape) {
|
|
924
878
|
state.currentPlaceholder = state.selectedLabel;
|
|
925
879
|
state.selectedLabel = "";
|
|
926
880
|
}
|
|
927
881
|
}
|
|
928
882
|
}
|
|
929
|
-
if (refs.selectGrid) {
|
|
930
|
-
refs.selectGrid.
|
|
931
|
-
|
|
883
|
+
if (vm.$refs.selectGrid) {
|
|
884
|
+
let { fullData } = vm.$refs.selectGrid.getTableData();
|
|
885
|
+
if (props.multiple) {
|
|
886
|
+
const selectedIds = state.selected.map((sel) => sel[props.valueField]);
|
|
887
|
+
vm.$refs.selectGrid.clearSelection();
|
|
888
|
+
vm.$refs.selectGrid.setSelection(
|
|
889
|
+
fullData.filter((row) => ~selectedIds.indexOf(row[props.valueField])),
|
|
890
|
+
true
|
|
891
|
+
);
|
|
892
|
+
} else {
|
|
893
|
+
vm.$refs.selectGrid.clearRadioRow();
|
|
894
|
+
vm.$refs.selectGrid.setRadioRow(find(fullData, (item) => props.modelValue == item[props.valueField]));
|
|
895
|
+
}
|
|
932
896
|
if (state.filterOrSearch && typeof props.filterMethod === "function") {
|
|
933
|
-
refs.selectGrid.handleTableData(true);
|
|
934
|
-
} else if (state.filterOrSearch && props.remote && typeof props.remoteMethod === "function") {
|
|
935
|
-
refs.selectGrid.handleTableData();
|
|
897
|
+
vm.$refs.selectGrid.handleTableData(true);
|
|
898
|
+
} else if (state.filterOrSearch && props.remote && (typeof props.remoteMethod === "function" || typeof props.initQuery === "function")) {
|
|
899
|
+
vm.$refs.selectGrid.handleTableData();
|
|
936
900
|
}
|
|
937
901
|
}
|
|
938
902
|
};
|
|
939
|
-
const watchVisible = ({ api, constants, emit, state,
|
|
903
|
+
const watchVisible = ({ api, constants, emit, state, vm, props }) => (value) => {
|
|
904
|
+
var _a;
|
|
905
|
+
if ((state.filterOrSearch || props.remote) && !value) {
|
|
906
|
+
(_a = vm.$refs.reference) == null ? void 0 : _a.blur();
|
|
907
|
+
}
|
|
940
908
|
if (api.onCopying()) {
|
|
941
909
|
return;
|
|
942
910
|
}
|
|
911
|
+
setTimeout(() => {
|
|
912
|
+
if (!value && !state.selectedLabel) {
|
|
913
|
+
state.cachedOptions.forEach((item) => {
|
|
914
|
+
item.state.visible = true;
|
|
915
|
+
});
|
|
916
|
+
}
|
|
917
|
+
}, 200);
|
|
943
918
|
value ? api.toHide() : api.toVisible();
|
|
944
919
|
emit(constants.EVENT_NAME.visibleChange, value);
|
|
945
920
|
setTimeout(() => {
|
|
946
921
|
state.selectEmitter.emit(constants.EVENT_NAME.updatePopper);
|
|
947
|
-
});
|
|
922
|
+
}, props.updateDelay);
|
|
923
|
+
if (!value && props.shape === "filter") {
|
|
924
|
+
state.softFocus = false;
|
|
925
|
+
}
|
|
948
926
|
if (value && state.optimizeStore.flag) {
|
|
949
927
|
optmzApis.createMacro(() => {
|
|
950
|
-
optmzApis.setScrollTop({ refs, state });
|
|
928
|
+
optmzApis.setScrollTop({ refs: vm.$refs, state });
|
|
951
929
|
api.getScrollListener();
|
|
952
930
|
});
|
|
953
931
|
}
|
|
@@ -967,7 +945,7 @@ const watchOptions = ({ api, constants, nextTick, parent, props, state }) => ()
|
|
|
967
945
|
api.setSelected();
|
|
968
946
|
}
|
|
969
947
|
});
|
|
970
|
-
if (props.defaultFirstOption && (props.
|
|
948
|
+
if (props.defaultFirstOption && (props.filterable || props.searchable || props.remote) && state.filteredOptionsCount) {
|
|
971
949
|
api.checkDefaultFirstOption();
|
|
972
950
|
}
|
|
973
951
|
};
|
|
@@ -982,7 +960,7 @@ const handleCopyClick = ({ parent, props, state }) => () => {
|
|
|
982
960
|
document.execCommand("copy");
|
|
983
961
|
parent.$el.removeChild(input);
|
|
984
962
|
};
|
|
985
|
-
const selectChange = ({ emit, props, state }) => ({ $table, selection, checked, row }) => {
|
|
963
|
+
const selectChange = ({ emit, props, state, api }) => ({ $table, selection, checked, row }) => {
|
|
986
964
|
const { textField, valueField } = props;
|
|
987
965
|
const remoteItem = (row2) => {
|
|
988
966
|
const removeItem = find(state.selected, (item) => item[valueField] === row2[valueField]);
|
|
@@ -993,10 +971,10 @@ const selectChange = ({ emit, props, state }) => ({ $table, selection, checked,
|
|
|
993
971
|
} else {
|
|
994
972
|
checked ? state.selected = state.selected.concat(
|
|
995
973
|
selection.filter((row2) => !~props.modelValue.indexOf(row2[valueField]))
|
|
996
|
-
) : $table.
|
|
974
|
+
) : $table.tableFullData.forEach((row2) => remoteItem(row2));
|
|
997
975
|
}
|
|
998
976
|
const keys = state.selected.map((item) => item[valueField]);
|
|
999
|
-
|
|
977
|
+
api.updateModelValue(keys);
|
|
1000
978
|
emit("change", keys, state.selected);
|
|
1001
979
|
};
|
|
1002
980
|
const getcheckedData = ({ props, state }) => () => {
|
|
@@ -1010,13 +988,13 @@ const getcheckedData = ({ props, state }) => () => {
|
|
|
1010
988
|
return checkedKey;
|
|
1011
989
|
}
|
|
1012
990
|
};
|
|
1013
|
-
const radioChange = ({ emit, props, state }) => ({ row }) => {
|
|
991
|
+
const radioChange = ({ emit, props, state, api }) => ({ row }) => {
|
|
1014
992
|
row.value = row[props.valueField];
|
|
1015
993
|
row.currentLabel = row[props.textField];
|
|
1016
994
|
state.selected = row;
|
|
1017
995
|
state.visible = false;
|
|
1018
996
|
state.currentKey = row[props.valueField];
|
|
1019
|
-
|
|
997
|
+
api.updateModelValue(row.value);
|
|
1020
998
|
emit("change", row);
|
|
1021
999
|
};
|
|
1022
1000
|
const getTreeData = (props) => (data) => {
|
|
@@ -1033,22 +1011,32 @@ const getTreeData = (props) => (data) => {
|
|
|
1033
1011
|
getChild(data, null);
|
|
1034
1012
|
return nodes;
|
|
1035
1013
|
};
|
|
1036
|
-
const treeNodeClick = ({ emit, props, state }) => (data) => {
|
|
1014
|
+
const treeNodeClick = ({ emit, props, state, api, vm }) => (data) => {
|
|
1037
1015
|
if (!props.multiple) {
|
|
1038
1016
|
data.currentLabel = data[props.textField];
|
|
1039
1017
|
data.value = data[props.valueField];
|
|
1040
1018
|
state.selected = data;
|
|
1041
1019
|
state.visible = false;
|
|
1042
|
-
|
|
1020
|
+
api.updateModelValue(data.value);
|
|
1043
1021
|
emit("change", data);
|
|
1022
|
+
} else {
|
|
1023
|
+
if (props.treeOp.checkOnClickNode) {
|
|
1024
|
+
const checkedNodes = vm.$refs.selectTree.getCheckedNodes();
|
|
1025
|
+
const checkedKeys = vm.$refs.selectTree.getCheckedKeys();
|
|
1026
|
+
api.nodeCheckClick(data, { checkedNodes, checkedKeys });
|
|
1027
|
+
}
|
|
1044
1028
|
}
|
|
1045
1029
|
};
|
|
1046
|
-
const nodeCheckClick = ({ emit, props }) => (data, { checkedKeys, checkedNodes }) => {
|
|
1047
|
-
|
|
1030
|
+
const nodeCheckClick = ({ emit, props, state, api }) => (data, { checkedKeys, checkedNodes }) => {
|
|
1031
|
+
const selected = state.selected.map((item) => api.getValueKey(item));
|
|
1032
|
+
if (isEqual(selected, checkedKeys)) {
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
state.selected = checkedNodes.filter((node) => {
|
|
1048
1036
|
node.currentLabel = node[props.textField];
|
|
1049
1037
|
node.value = node[props.valueField];
|
|
1050
1038
|
});
|
|
1051
|
-
|
|
1039
|
+
api.updateModelValue(checkedKeys);
|
|
1052
1040
|
emit("change", checkedKeys, checkedNodes);
|
|
1053
1041
|
};
|
|
1054
1042
|
const nodeCollapse = ({ state, constants }) => () => {
|
|
@@ -1094,11 +1082,23 @@ const watchPropsOption = ({ constants, parent, props, state }) => () => {
|
|
|
1094
1082
|
} else if (renderType === constants.TYPE.Grid) {
|
|
1095
1083
|
state.gridData = data;
|
|
1096
1084
|
} else {
|
|
1085
|
+
let sortData = data.slice();
|
|
1086
|
+
if (props.multiple) {
|
|
1087
|
+
const requiredData = [];
|
|
1088
|
+
sortData = sortData.filter((item) => {
|
|
1089
|
+
if (item.required) {
|
|
1090
|
+
requiredData.push(item);
|
|
1091
|
+
return false;
|
|
1092
|
+
}
|
|
1093
|
+
return true;
|
|
1094
|
+
});
|
|
1095
|
+
sortData = requiredData.concat(sortData);
|
|
1096
|
+
}
|
|
1097
1097
|
if (props.cacheOp && props.cacheOp.key) {
|
|
1098
1098
|
state.memorize = new Memorize(props.cacheOp);
|
|
1099
|
-
state.datas = state.memorize.assemble(
|
|
1099
|
+
state.datas = state.memorize.assemble(sortData.slice());
|
|
1100
1100
|
} else {
|
|
1101
|
-
state.datas =
|
|
1101
|
+
state.datas = sortData;
|
|
1102
1102
|
}
|
|
1103
1103
|
}
|
|
1104
1104
|
});
|
|
@@ -1114,19 +1114,23 @@ const buildRadioConfig = ({ props, state }) => () => {
|
|
|
1114
1114
|
const radioConfig = props.radioConfig;
|
|
1115
1115
|
return __spreadValues(__spreadValues({}, radioConfig), { checkRowKey, highlight });
|
|
1116
1116
|
};
|
|
1117
|
-
const onMouseenterNative = ({ state }) => () => {
|
|
1117
|
+
const onMouseenterNative = ({ state }) => (e) => {
|
|
1118
|
+
if (e.target === e.currentTarget)
|
|
1119
|
+
return;
|
|
1118
1120
|
state.inputHovering = true;
|
|
1119
1121
|
if (state.searchSingleCopy && state.selectedLabel) {
|
|
1120
1122
|
state.softFocus = true;
|
|
1121
1123
|
}
|
|
1122
1124
|
};
|
|
1123
|
-
const onMouseleaveNative = ({ state }) => () => {
|
|
1125
|
+
const onMouseleaveNative = ({ state }) => (e) => {
|
|
1126
|
+
if (e.target === e.currentTarget)
|
|
1127
|
+
return;
|
|
1124
1128
|
state.inputHovering = false;
|
|
1125
1129
|
if (state.searchSingleCopy && state.selectedLabel) {
|
|
1126
1130
|
state.softFocus = false;
|
|
1127
1131
|
}
|
|
1128
1132
|
};
|
|
1129
|
-
const onCopying = ({ state,
|
|
1133
|
+
const onCopying = ({ state, vm }) => () => state.searchSingleCopy && state.selectedLabel && vm.$refs.reference && vm.$refs.reference.hasSelection && vm.$refs.reference.hasSelection();
|
|
1130
1134
|
const watchHoverIndex = ({ state }) => (value) => {
|
|
1131
1135
|
if (typeof value === "number" && value > -1) {
|
|
1132
1136
|
state.hoverOption = state.options[value] || {};
|
|
@@ -1137,11 +1141,87 @@ const watchHoverIndex = ({ state }) => (value) => {
|
|
|
1137
1141
|
option.hover = state.hoverOption === option;
|
|
1138
1142
|
});
|
|
1139
1143
|
};
|
|
1140
|
-
const
|
|
1144
|
+
const handleDropdownClick = ({ emit }) => ($event) => {
|
|
1145
|
+
emit("dropdown-click", $event);
|
|
1146
|
+
};
|
|
1147
|
+
const handleEnterTag = ({ state }) => ($event, key) => {
|
|
1148
|
+
const target = $event.target;
|
|
1149
|
+
if (target && target.scrollWidth > target.offsetWidth) {
|
|
1150
|
+
state.tooltipContent = __spreadProps(__spreadValues({}, state.tooltipContent), { [key]: target.innerText });
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
const calcCollapseTags = ({ state, vm }) => () => {
|
|
1154
|
+
if (state.inputHovering) {
|
|
1155
|
+
return state.isHidden = true;
|
|
1156
|
+
}
|
|
1157
|
+
const tags = vm.$refs.tags;
|
|
1158
|
+
if (!tags) {
|
|
1159
|
+
return;
|
|
1160
|
+
}
|
|
1161
|
+
const { width: tagsContentWidth, paddingLeft, paddingRight } = window.getComputedStyle(tags);
|
|
1162
|
+
const tagsWidth = parseFloat(tagsContentWidth) - parseFloat(paddingLeft) - parseFloat(paddingRight);
|
|
1163
|
+
const collapseTag = tags.querySelector(".tiny-select__tags-collapse");
|
|
1164
|
+
const { width: collapseTagContentWidth, marginRight } = collapseTag && window.getComputedStyle(collapseTag);
|
|
1165
|
+
const collapseTagWidth = collapseTag && parseFloat(collapseTagContentWidth) + parseFloat(marginRight);
|
|
1166
|
+
const tagList = Array.from(tags.querySelectorAll(".tiny-tag"));
|
|
1167
|
+
let { total, dom, idx } = { total: collapseTagWidth, dom: null, idx: 0 };
|
|
1168
|
+
tagList.some((tag, index) => {
|
|
1169
|
+
if (tag !== collapseTag) {
|
|
1170
|
+
const { width: tagContentWidth, marginRight: marginRight2 } = tag && window.getComputedStyle(tag);
|
|
1171
|
+
total += parseFloat(tagContentWidth) + parseFloat(marginRight2);
|
|
1172
|
+
}
|
|
1173
|
+
if (tag !== collapseTag && total > tagsWidth && !dom) {
|
|
1174
|
+
dom = tag;
|
|
1175
|
+
idx = index;
|
|
1176
|
+
}
|
|
1177
|
+
});
|
|
1178
|
+
let isOneLine = total - collapseTagWidth <= tagsWidth;
|
|
1179
|
+
if (isOneLine) {
|
|
1180
|
+
return state.isHidden = true;
|
|
1181
|
+
}
|
|
1182
|
+
if (dom) {
|
|
1183
|
+
dom.before(collapseTag);
|
|
1184
|
+
state.isHidden = false;
|
|
1185
|
+
} else {
|
|
1186
|
+
state.isHidden = true;
|
|
1187
|
+
}
|
|
1188
|
+
state.collapseTagsLength = tagList.length - idx;
|
|
1189
|
+
};
|
|
1190
|
+
const watchInputHover = ({ vm }) => (newVal) => {
|
|
1191
|
+
const [inputHovering, visible] = newVal;
|
|
1192
|
+
if (!inputHovering && !visible) {
|
|
1193
|
+
const tags = vm.$refs.tags;
|
|
1194
|
+
const content = vm.$refs["tags-content"];
|
|
1195
|
+
tags && content && tags.scrollTo({ top: content });
|
|
1196
|
+
}
|
|
1197
|
+
};
|
|
1198
|
+
const initQuery = ({ props, state, constants, vm }) => ({ init } = {}) => {
|
|
1199
|
+
const isRemote = props.filterable && props.remote && (typeof props.remoteMethod === "function" || typeof props.initQuery === "function");
|
|
1200
|
+
const isGrid = props.renderType === constants.TYPE.Grid;
|
|
1201
|
+
let selected;
|
|
1202
|
+
if (isRemote && isGrid && props.initQuery) {
|
|
1203
|
+
let initData = props.initQuery(props.modelValue, props.extraQueryParams, !!init);
|
|
1204
|
+
if (initData.then) {
|
|
1205
|
+
return new Promise((resolve) => {
|
|
1206
|
+
initData.then((selected2) => {
|
|
1207
|
+
state.remoteData = selected2;
|
|
1208
|
+
vm.$refs.selectGrid.loadData(selected2);
|
|
1209
|
+
resolve(selected2);
|
|
1210
|
+
});
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
selected = initData;
|
|
1214
|
+
state.remoteData = selected;
|
|
1215
|
+
vm.$refs.selectGrid.loadData(selected);
|
|
1216
|
+
}
|
|
1217
|
+
return Promise.resolve(selected);
|
|
1218
|
+
};
|
|
1219
|
+
const mounted = ({ api, parent, state, props, vm }) => () => {
|
|
1141
1220
|
var _a;
|
|
1221
|
+
state.defaultCheckedKeys = state.gridCheckedData;
|
|
1142
1222
|
const parentEl = parent.$el;
|
|
1143
1223
|
const inputEl = parentEl.querySelector("input.tiny-input__inner") || parentEl.querySelector("input.tiny-mobile-input__inner");
|
|
1144
|
-
const inputClientRect = inputEl == null ? void 0 : inputEl.getBoundingClientRect();
|
|
1224
|
+
const inputClientRect = (inputEl == null ? void 0 : inputEl.getBoundingClientRect()) || {};
|
|
1145
1225
|
if (inputEl === document.activeElement) {
|
|
1146
1226
|
(_a = document.activeElement) == null ? void 0 : _a.blur();
|
|
1147
1227
|
}
|
|
@@ -1150,31 +1230,127 @@ const mounted = ({ api, parent, state, props, refs }) => () => {
|
|
|
1150
1230
|
if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
|
|
1151
1231
|
state.currentPlaceholder = "";
|
|
1152
1232
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
addResizeListener(refs.tags, api.resetInputHeight);
|
|
1158
|
-
}
|
|
1159
|
-
if (props.remote && props.multiple) {
|
|
1160
|
-
api.resetInputHeight();
|
|
1161
|
-
}
|
|
1162
|
-
state.inputWidth = inputClientRect.width;
|
|
1233
|
+
state.initialInputHeight = state.isDisplayOnly ? sizeMap[state.selectSize] : inputClientRect.height || sizeMap[state.selectSize];
|
|
1234
|
+
addResizeListener(parentEl, api.handleResize);
|
|
1235
|
+
if (vm.$refs.tags) {
|
|
1236
|
+
addResizeListener(vm.$refs.tags, api.resetInputHeight);
|
|
1163
1237
|
}
|
|
1164
|
-
|
|
1238
|
+
if (props.remote && props.multiple) {
|
|
1239
|
+
api.resetInputHeight();
|
|
1240
|
+
}
|
|
1241
|
+
state.inputWidth = inputClientRect.width;
|
|
1242
|
+
api.initQuery({ init: true }).then(() => api.setSelected());
|
|
1165
1243
|
if (props.dataset) {
|
|
1166
1244
|
api.watchPropsOption();
|
|
1167
1245
|
}
|
|
1168
1246
|
};
|
|
1169
|
-
const unMount = ({ api, parent,
|
|
1247
|
+
const unMount = ({ api, parent, vm, state }) => () => {
|
|
1170
1248
|
if (parent.$el && api.handleResize) {
|
|
1171
1249
|
removeResizeListener(parent.$el, api.handleResize);
|
|
1172
1250
|
}
|
|
1173
|
-
if (refs.tags) {
|
|
1174
|
-
removeResizeListener(refs.tags, api.resetInputHeight);
|
|
1251
|
+
if (vm.$refs.tags) {
|
|
1252
|
+
removeResizeListener(vm.$refs.tags, api.resetInputHeight);
|
|
1175
1253
|
}
|
|
1176
1254
|
state.popperElm = null;
|
|
1177
|
-
state.optimizeStore.flag && optmzApis.removeScrollListener({ api, refs, state });
|
|
1255
|
+
state.optimizeStore.flag && optmzApis.removeScrollListener({ api, refs: vm.$refs, state });
|
|
1256
|
+
};
|
|
1257
|
+
const optmzApis = {
|
|
1258
|
+
exist: (val, multiple) => multiple ? Array.isArray(val) && val.length : val,
|
|
1259
|
+
getValueIndex: (props) => {
|
|
1260
|
+
const { options, valueField, modelValue, multiple } = props;
|
|
1261
|
+
const contain = (val, arr) => Array.isArray(arr) && ~arr.indexOf(val);
|
|
1262
|
+
const equal = (val, opt) => multiple ? contain(opt[valueField], [val]) : opt[valueField] === val;
|
|
1263
|
+
let start = 0;
|
|
1264
|
+
if (optmzApis.exist(modelValue, multiple)) {
|
|
1265
|
+
const lastVal = multiple ? modelValue[modelValue.length - 1] : modelValue;
|
|
1266
|
+
for (let i = 0; i < options.length; i++) {
|
|
1267
|
+
if (!equal(lastVal, options[i])) {
|
|
1268
|
+
continue;
|
|
1269
|
+
}
|
|
1270
|
+
return i;
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
return start;
|
|
1274
|
+
},
|
|
1275
|
+
getStartIndex: ({ props, state }) => {
|
|
1276
|
+
const { options } = props;
|
|
1277
|
+
const { optimizeOpts, optimizeStore } = state;
|
|
1278
|
+
const { rSize } = optimizeOpts;
|
|
1279
|
+
const { valueIndex } = optimizeStore;
|
|
1280
|
+
return valueIndex + rSize > options.length ? options.length - rSize : valueIndex;
|
|
1281
|
+
},
|
|
1282
|
+
getViewStyle: ({ props, state }) => {
|
|
1283
|
+
const { options } = props;
|
|
1284
|
+
const { optimizeOpts } = state;
|
|
1285
|
+
const { optionHeight } = optimizeOpts;
|
|
1286
|
+
return `height:${optionHeight * options.length}px`;
|
|
1287
|
+
},
|
|
1288
|
+
getStoreDatas: ({ props, state }) => {
|
|
1289
|
+
const { options, valueField, modelValue, multiple } = props;
|
|
1290
|
+
const { datas, optimizeOpts, optimizeStore } = state;
|
|
1291
|
+
const { startIndex } = optimizeStore;
|
|
1292
|
+
const { rSize } = optimizeOpts;
|
|
1293
|
+
const sliced = datas.slice(startIndex, startIndex + rSize);
|
|
1294
|
+
const hiddenOptions = optimizeStore.hiddenOptions = [];
|
|
1295
|
+
const findPush = (val) => {
|
|
1296
|
+
const opt = options.find((option) => option[valueField] === val);
|
|
1297
|
+
if (opt && !~sliced.indexOf(opt)) {
|
|
1298
|
+
sliced.push(opt);
|
|
1299
|
+
hiddenOptions.push(opt);
|
|
1300
|
+
}
|
|
1301
|
+
};
|
|
1302
|
+
if (optmzApis.exist(modelValue, multiple)) {
|
|
1303
|
+
if (multiple) {
|
|
1304
|
+
modelValue.forEach(findPush);
|
|
1305
|
+
} else {
|
|
1306
|
+
findPush(modelValue);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
return sliced;
|
|
1310
|
+
},
|
|
1311
|
+
queryWrap: (refs) => refs.scrollbar.$el.querySelector(".tiny-scrollbar__wrap.virtual"),
|
|
1312
|
+
queryItems: (refs) => refs.scrollbar.$el.querySelectorAll(".tiny-option.virtual"),
|
|
1313
|
+
createMacro: (cb) => setTimeout(cb),
|
|
1314
|
+
setScrollTop: ({ refs, state }) => {
|
|
1315
|
+
const { optimizeOpts, optimizeStore } = state;
|
|
1316
|
+
const { optionHeight } = optimizeOpts;
|
|
1317
|
+
const wrap = optmzApis.queryWrap(refs);
|
|
1318
|
+
wrap.scrollTop = optionHeight * optimizeStore.valueIndex;
|
|
1319
|
+
},
|
|
1320
|
+
setValueIndex: ({ props, state }) => state.optimizeStore.valueIndex = optmzApis.getValueIndex(props),
|
|
1321
|
+
addScrollListener: ({ api, refs, state }) => {
|
|
1322
|
+
const { optimizeStore } = state;
|
|
1323
|
+
const wrap = optmzApis.queryWrap(refs);
|
|
1324
|
+
!optimizeStore.bind && wrap.addEventListener("scroll", api.getScrollListener) && (optimizeStore.bind = true);
|
|
1325
|
+
},
|
|
1326
|
+
removeScrollListener: ({ api, refs, state }) => {
|
|
1327
|
+
const { optimizeStore } = state;
|
|
1328
|
+
const wrap = optmzApis.queryWrap(refs);
|
|
1329
|
+
optimizeStore.bind && wrap.removeEventListener("scroll", api.getScrollListener) && (optimizeStore.bind = false);
|
|
1330
|
+
},
|
|
1331
|
+
isFirstPage: ({ props, state }) => {
|
|
1332
|
+
const { optimizeStore } = state;
|
|
1333
|
+
const { datas } = optimizeStore;
|
|
1334
|
+
const { options } = props;
|
|
1335
|
+
return Array.isArray(datas) && Array.isArray(options) && datas[0] === options[0];
|
|
1336
|
+
},
|
|
1337
|
+
natural: (val) => val < 0 ? 0 : val,
|
|
1338
|
+
updateItems: ({ refs, state, itemFn }) => {
|
|
1339
|
+
const { optimizeOpts } = state;
|
|
1340
|
+
const { optionHeight } = optimizeOpts;
|
|
1341
|
+
const items = optmzApis.queryItems(refs);
|
|
1342
|
+
for (let i = 0; i < items.length; i++) {
|
|
1343
|
+
const item = items[i];
|
|
1344
|
+
const flag = item.classList.contains("virtual-hidden");
|
|
1345
|
+
item.style.top = flag ? `-${optionHeight}px` : `${itemFn(i)}px`;
|
|
1346
|
+
}
|
|
1347
|
+
},
|
|
1348
|
+
process: ({ props, start, state }) => {
|
|
1349
|
+
const { optimizeStore } = state;
|
|
1350
|
+
optimizeStore.startIndex = typeof start !== "undefined" ? start : optmzApis.getStartIndex({ props, state });
|
|
1351
|
+
optimizeStore.datas = optmzApis.getStoreDatas({ props, state });
|
|
1352
|
+
optimizeStore.firstPage = optmzApis.isFirstPage({ props, state });
|
|
1353
|
+
}
|
|
1178
1354
|
};
|
|
1179
1355
|
const computeOptimizeOpts = ({ props, state }) => () => {
|
|
1180
1356
|
const { optimization } = props;
|
|
@@ -1190,7 +1366,7 @@ const computeOptimizeOpts = ({ props, state }) => () => {
|
|
|
1190
1366
|
return optOpts;
|
|
1191
1367
|
}
|
|
1192
1368
|
};
|
|
1193
|
-
const watchOptimizeOpts = ({ api, props,
|
|
1369
|
+
const watchOptimizeOpts = ({ api, props, vm, state }) => () => {
|
|
1194
1370
|
const { optimizeOpts, optimizeStore } = state;
|
|
1195
1371
|
if (optimizeOpts) {
|
|
1196
1372
|
const { virtualScroll, optionHeight } = optimizeOpts;
|
|
@@ -1201,26 +1377,26 @@ const watchOptimizeOpts = ({ api, props, refs, state }) => () => {
|
|
|
1201
1377
|
optmzApis.process({ props, state });
|
|
1202
1378
|
optmzApis.createMacro(() => {
|
|
1203
1379
|
const itemFn = (i) => optionHeight * (optimizeStore.startIndex + i);
|
|
1204
|
-
optmzApis.addScrollListener({ api, refs, state });
|
|
1205
|
-
optmzApis.updateItems({ refs, state, itemFn });
|
|
1380
|
+
optmzApis.addScrollListener({ api, refs: vm.$refs, state });
|
|
1381
|
+
optmzApis.updateItems({ refs: vm.$refs, state, itemFn });
|
|
1206
1382
|
});
|
|
1207
1383
|
}
|
|
1208
1384
|
}
|
|
1209
1385
|
};
|
|
1210
|
-
const getScrollListener = ({ props,
|
|
1386
|
+
const getScrollListener = ({ props, vm, state }) => {
|
|
1211
1387
|
const listener = () => {
|
|
1212
1388
|
const { options } = props;
|
|
1213
1389
|
const { optimizeOpts } = state;
|
|
1214
1390
|
const { optionHeight } = optimizeOpts;
|
|
1215
1391
|
const viewHeight = optionHeight * options.length;
|
|
1216
|
-
const { clientHeight, scrollTop } = optmzApis.queryWrap(refs);
|
|
1392
|
+
const { clientHeight, scrollTop } = optmzApis.queryWrap(vm.$refs);
|
|
1217
1393
|
const maxScrollTop = viewHeight - clientHeight;
|
|
1218
1394
|
const start = Math.floor(scrollTop / optionHeight);
|
|
1219
1395
|
if (scrollTop <= maxScrollTop) {
|
|
1220
1396
|
optmzApis.process({ props, start, state });
|
|
1221
1397
|
optmzApis.createMacro(() => {
|
|
1222
1398
|
const itemFn = (i) => scrollTop + optionHeight * i - scrollTop % optionHeight;
|
|
1223
|
-
optmzApis.updateItems({ refs, state, itemFn });
|
|
1399
|
+
optmzApis.updateItems({ refs: vm.$refs, state, itemFn });
|
|
1224
1400
|
});
|
|
1225
1401
|
}
|
|
1226
1402
|
};
|
|
@@ -1234,19 +1410,118 @@ const computeMultipleLimit = ({ props, state }) => () => {
|
|
|
1234
1410
|
const { optimizeOpts, optimizeStore } = state;
|
|
1235
1411
|
return optmzApis.natural(multiple && optimizeStore.flag ? multipleLimit || optimizeOpts.limit : multipleLimit);
|
|
1236
1412
|
};
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1413
|
+
const updateModelValue = ({ emit, state }) => (value) => {
|
|
1414
|
+
state.isClickChoose = true;
|
|
1415
|
+
emit("update:modelValue", value);
|
|
1416
|
+
};
|
|
1417
|
+
const getLabelSlotValue = ({ props, state }) => (item) => {
|
|
1418
|
+
const datas = state.optimizeStore.flag ? state.optimizeStore.datas : state.datas;
|
|
1419
|
+
const value = item.state ? item.state.currentValue : item.value;
|
|
1420
|
+
const data = datas.find((data2) => data2.value === value);
|
|
1421
|
+
const obj = __spreadProps(__spreadValues({}, data), {
|
|
1422
|
+
label: item.state ? item.state.currentLabel : item.currentLabel,
|
|
1423
|
+
value
|
|
1424
|
+
});
|
|
1425
|
+
return ["grid", "tree"].includes(props.renderType) ? item : obj;
|
|
1426
|
+
};
|
|
1427
|
+
const computedTagsStyle = ({ props, parent, state }) => () => {
|
|
1428
|
+
const isReadonly = props.disabled || (parent.form || {}).disabled || props.displayOnly;
|
|
1429
|
+
return {
|
|
1430
|
+
"max-width": isReadonly ? "" : state.inputWidth - state.inputPaddingRight + "px",
|
|
1431
|
+
width: "100%"
|
|
1432
|
+
};
|
|
1433
|
+
};
|
|
1434
|
+
const computedReadonly = ({ props, state }) => () => props.readonly || !props.filterable || props.multiple || browserInfo.name !== BROWSER_NAME.IE && browserInfo.name !== BROWSER_NAME.Edge && !state.visible;
|
|
1435
|
+
const computedShowClose = ({ props, state }) => () => props.clearable && !state.selectDisabled && state.inputHovering && (props.multiple ? Array.isArray(props.modelValue) && props.modelValue.length > 0 : !isNull(props.modelValue) && props.modelValue !== "");
|
|
1436
|
+
const computedCollapseTagSize = (state) => () => state.selectSize;
|
|
1437
|
+
const computedShowNewOption = ({ props, state }) => () => props.filterable && props.allowCreate && state.query !== "" && !state.options.filter((option) => !option.created).some((option) => option.state.currentLabel === state.query);
|
|
1438
|
+
const computedShowCopy = ({ props, state }) => () => props.multiple && props.copyable && state.inputHovering && state.selected.length;
|
|
1439
|
+
const computedOptionsAllDisabled = (state) => () => state.options.filter((option) => option.visible).every((option) => option.disabled);
|
|
1440
|
+
const computedDisabledTooltipContent = (state) => () => state.selected.map((item) => item.state ? item.state.currentLabel : item.currentLabel).join("\uFF1B");
|
|
1441
|
+
const computedSelectDisabled = ({ props, parent }) => () => props.disabled || (parent.form || {}).disabled || props.displayOnly || (parent.form || {}).displayOnly;
|
|
1442
|
+
const computedIsExpandAll = (props) => () => {
|
|
1443
|
+
const { defaultExpandAll, lazy } = props.treeOp;
|
|
1444
|
+
return !lazy && defaultExpandAll !== false;
|
|
1445
|
+
};
|
|
1446
|
+
const loadTreeData = ({ state, vm, props, api }) => ({ data = [], init = false }) => {
|
|
1447
|
+
const getTreeDatas = (datas, newDatas = []) => {
|
|
1448
|
+
datas.forEach(({ data: data2, childNodes }) => {
|
|
1449
|
+
let temData = __spreadProps(__spreadValues({}, data2), { children: [] });
|
|
1450
|
+
if (childNodes && childNodes.length) {
|
|
1451
|
+
getTreeDatas(childNodes, temData.children);
|
|
1452
|
+
}
|
|
1453
|
+
newDatas.push(temData);
|
|
1454
|
+
});
|
|
1455
|
+
};
|
|
1456
|
+
if (init) {
|
|
1457
|
+
state.treeData = data;
|
|
1458
|
+
} else if (vm.$refs.selectTree) {
|
|
1459
|
+
const treeData = [];
|
|
1460
|
+
getTreeDatas(vm.$refs.selectTree.state.root.childNodes, treeData);
|
|
1461
|
+
state.treeData = treeData;
|
|
1462
|
+
const { multiple, treeOp } = props;
|
|
1463
|
+
if (multiple && treeOp.lazy) {
|
|
1464
|
+
const checkedNodes = vm.$refs.selectTree.getCheckedNodes();
|
|
1465
|
+
const checkedKeys = vm.$refs.selectTree.getCheckedKeys();
|
|
1466
|
+
api.nodeCheckClick(null, { checkedNodes, checkedKeys });
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
};
|
|
1470
|
+
const watchInitValue = ({ props, emit }) => (value) => {
|
|
1471
|
+
if (props.multiple) {
|
|
1472
|
+
let modelValue = props.modelValue.slice();
|
|
1473
|
+
value.forEach((val) => {
|
|
1474
|
+
modelValue = modelValue.filter((item) => item !== val);
|
|
1475
|
+
});
|
|
1476
|
+
emit("update:modelValue", value.concat(modelValue));
|
|
1477
|
+
}
|
|
1478
|
+
};
|
|
1479
|
+
const watchShowClose = ({ nextTick, state, parent }) => () => {
|
|
1480
|
+
nextTick(() => {
|
|
1481
|
+
const parentEl = parent.$el;
|
|
1482
|
+
const inputEl = parentEl.querySelector("input.tiny-input__inner");
|
|
1483
|
+
if (inputEl) {
|
|
1484
|
+
const { paddingRight } = getComputedStyle(inputEl);
|
|
1485
|
+
state.inputPaddingRight = parseFloat(paddingRight);
|
|
1486
|
+
}
|
|
1487
|
+
});
|
|
1488
|
+
};
|
|
1489
|
+
const computedGetIcon = ({ constants, designConfig, props }) => (name) => {
|
|
1490
|
+
return props.dropdownIcon || (designConfig == null ? void 0 : designConfig.icons[name]) || (constants == null ? void 0 : constants.ICON_MAP[name]);
|
|
1491
|
+
};
|
|
1492
|
+
const computedGetTagType = ({ designConfig, props }) => () => {
|
|
1493
|
+
var _a;
|
|
1494
|
+
if (((_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.tagType) && !props.tagType) {
|
|
1495
|
+
return designConfig.props.tagType;
|
|
1496
|
+
}
|
|
1497
|
+
return props.tagType;
|
|
1498
|
+
};
|
|
1499
|
+
const computedShowDropdownIcon = ({ props, state }) => () => {
|
|
1500
|
+
return !state.showClose && !(props.remote && props.filterable && !props.remoteConfig.showIcon);
|
|
1239
1501
|
};
|
|
1240
1502
|
export {
|
|
1241
1503
|
blur,
|
|
1242
1504
|
buildRadioConfig,
|
|
1243
1505
|
buildSelectConfig,
|
|
1506
|
+
calcCollapseTags,
|
|
1244
1507
|
calcOverFlow,
|
|
1245
1508
|
checkDefaultFirstOption,
|
|
1246
1509
|
computeCollapseTags,
|
|
1247
1510
|
computeMultipleLimit,
|
|
1248
1511
|
computeOptimizeOpts,
|
|
1512
|
+
computedCollapseTagSize,
|
|
1513
|
+
computedDisabledTooltipContent,
|
|
1249
1514
|
computedGetIcon,
|
|
1515
|
+
computedGetTagType,
|
|
1516
|
+
computedIsExpandAll,
|
|
1517
|
+
computedOptionsAllDisabled,
|
|
1518
|
+
computedReadonly,
|
|
1519
|
+
computedSelectDisabled,
|
|
1520
|
+
computedShowClose,
|
|
1521
|
+
computedShowCopy,
|
|
1522
|
+
computedShowDropdownIcon,
|
|
1523
|
+
computedShowNewOption,
|
|
1524
|
+
computedTagsStyle,
|
|
1250
1525
|
debouncRquest,
|
|
1251
1526
|
defaultOnQueryChange,
|
|
1252
1527
|
deletePrevTag,
|
|
@@ -1257,6 +1532,7 @@ export {
|
|
|
1257
1532
|
emptyText,
|
|
1258
1533
|
focus,
|
|
1259
1534
|
getChildValue,
|
|
1535
|
+
getLabelSlotValue,
|
|
1260
1536
|
getOption,
|
|
1261
1537
|
getPluginOption,
|
|
1262
1538
|
getScrollListener,
|
|
@@ -1270,11 +1546,16 @@ export {
|
|
|
1270
1546
|
handleClose,
|
|
1271
1547
|
handleComposition,
|
|
1272
1548
|
handleCopyClick,
|
|
1549
|
+
handleDropdownClick,
|
|
1550
|
+
handleEnterTag,
|
|
1273
1551
|
handleFocus,
|
|
1274
1552
|
handleMenuEnter,
|
|
1275
1553
|
handleOptionSelect,
|
|
1276
1554
|
handleQueryChange,
|
|
1277
1555
|
handleResize,
|
|
1556
|
+
initQuery,
|
|
1557
|
+
initValue,
|
|
1558
|
+
loadTreeData,
|
|
1278
1559
|
managePlaceholder,
|
|
1279
1560
|
mounted,
|
|
1280
1561
|
navigateOptions,
|
|
@@ -1295,7 +1576,6 @@ export {
|
|
|
1295
1576
|
scrollToOption,
|
|
1296
1577
|
selectChange,
|
|
1297
1578
|
selectOption,
|
|
1298
|
-
setGridOrTreeSelected,
|
|
1299
1579
|
setSelected,
|
|
1300
1580
|
setSoftFocus,
|
|
1301
1581
|
showTip,
|
|
@@ -1306,10 +1586,14 @@ export {
|
|
|
1306
1586
|
toggleMenu,
|
|
1307
1587
|
treeNodeClick,
|
|
1308
1588
|
unMount,
|
|
1589
|
+
updateModelValue,
|
|
1309
1590
|
watchHoverIndex,
|
|
1591
|
+
watchInitValue,
|
|
1592
|
+
watchInputHover,
|
|
1310
1593
|
watchOptimizeOpts,
|
|
1311
1594
|
watchOptions,
|
|
1312
1595
|
watchPropsOption,
|
|
1596
|
+
watchShowClose,
|
|
1313
1597
|
watchValue,
|
|
1314
1598
|
watchVisible
|
|
1315
1599
|
};
|