bkui-vue 2.0.1-beta.41 → 2.0.1-beta.42
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/dist/index.cjs.js +20 -20
- package/dist/index.esm.js +3375 -3360
- package/dist/index.umd.js +20 -20
- package/lib/index.js +1 -1
- package/lib/search-select/index.d.ts +12 -6
- package/lib/search-select/index.js +33 -10
- package/lib/search-select/input.d.ts +2 -1
- package/lib/search-select/search-select.d.ts +4 -2
- package/lib/search-select/selected.d.ts +4 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
@@ -95,7 +95,7 @@ declare const BkSearchSelect: {
|
|
95
95
|
};
|
96
96
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
97
97
|
handleClickOutside: (e: MouseEvent) => void;
|
98
|
-
handleInputFocus: () => void;
|
98
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
99
99
|
handleInputChange: (event: Event) => void;
|
100
100
|
handleInputPaste: (event: ClipboardEvent) => void;
|
101
101
|
handleLogicalChange: (logical: import("./utils").SearchLogical) => void;
|
@@ -109,6 +109,7 @@ declare const BkSearchSelect: {
|
|
109
109
|
inputClearForWrapper: () => void;
|
110
110
|
deleteInputTextNode: () => void;
|
111
111
|
customPanelSubmit: (value: string) => void;
|
112
|
+
refleshMenuHover: () => void;
|
112
113
|
t: import("vue").ComputedRef<{
|
113
114
|
pleaseSelect: string;
|
114
115
|
loading: string;
|
@@ -217,7 +218,7 @@ declare const BkSearchSelect: {
|
|
217
218
|
};
|
218
219
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
219
220
|
handleClickOutside: (e: MouseEvent) => void;
|
220
|
-
handleInputFocus: () => void;
|
221
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
221
222
|
handleInputChange: (event: Event) => void;
|
222
223
|
handleInputPaste: (event: ClipboardEvent) => void;
|
223
224
|
handleLogicalChange: (logical: import("./utils").SearchLogical) => void;
|
@@ -231,6 +232,7 @@ declare const BkSearchSelect: {
|
|
231
232
|
inputClearForWrapper: () => void;
|
232
233
|
deleteInputTextNode: () => void;
|
233
234
|
customPanelSubmit: (value: string) => void;
|
235
|
+
refleshMenuHover: () => void;
|
234
236
|
t: import("vue").ComputedRef<{
|
235
237
|
pleaseSelect: string;
|
236
238
|
loading: string;
|
@@ -527,7 +529,7 @@ declare const BkSearchSelect: {
|
|
527
529
|
};
|
528
530
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
529
531
|
handleClickOutside: (e: MouseEvent) => void;
|
530
|
-
handleInputFocus: () => void;
|
532
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
531
533
|
handleInputChange: (event: Event) => void;
|
532
534
|
handleInputPaste: (event: ClipboardEvent) => void;
|
533
535
|
handleLogicalChange: (logical: import("./utils").SearchLogical) => void;
|
@@ -541,6 +543,7 @@ declare const BkSearchSelect: {
|
|
541
543
|
inputClearForWrapper: () => void;
|
542
544
|
deleteInputTextNode: () => void;
|
543
545
|
customPanelSubmit: (value: string) => void;
|
546
|
+
refleshMenuHover: () => void;
|
544
547
|
t: import("vue").ComputedRef<{
|
545
548
|
pleaseSelect: string;
|
546
549
|
loading: string;
|
@@ -649,7 +652,7 @@ declare const BkSearchSelect: {
|
|
649
652
|
};
|
650
653
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
651
654
|
handleClickOutside: (e: MouseEvent) => void;
|
652
|
-
handleInputFocus: () => void;
|
655
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
653
656
|
handleInputChange: (event: Event) => void;
|
654
657
|
handleInputPaste: (event: ClipboardEvent) => void;
|
655
658
|
handleLogicalChange: (logical: import("./utils").SearchLogical) => void;
|
@@ -663,6 +666,7 @@ declare const BkSearchSelect: {
|
|
663
666
|
inputClearForWrapper: () => void;
|
664
667
|
deleteInputTextNode: () => void;
|
665
668
|
customPanelSubmit: (value: string) => void;
|
669
|
+
refleshMenuHover: () => void;
|
666
670
|
t: import("vue").ComputedRef<{
|
667
671
|
pleaseSelect: string;
|
668
672
|
loading: string;
|
@@ -914,7 +918,7 @@ declare const BkSearchSelect: {
|
|
914
918
|
};
|
915
919
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
916
920
|
handleClickOutside: (e: MouseEvent) => void;
|
917
|
-
handleInputFocus: () => void;
|
921
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
918
922
|
handleInputChange: (event: Event) => void;
|
919
923
|
handleInputPaste: (event: ClipboardEvent) => void;
|
920
924
|
handleLogicalChange: (logical: import("./utils").SearchLogical) => void;
|
@@ -928,6 +932,7 @@ declare const BkSearchSelect: {
|
|
928
932
|
inputClearForWrapper: () => void;
|
929
933
|
deleteInputTextNode: () => void;
|
930
934
|
customPanelSubmit: (value: string) => void;
|
935
|
+
refleshMenuHover: () => void;
|
931
936
|
t: import("vue").ComputedRef<{
|
932
937
|
pleaseSelect: string;
|
933
938
|
loading: string;
|
@@ -1036,7 +1041,7 @@ declare const BkSearchSelect: {
|
|
1036
1041
|
};
|
1037
1042
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
1038
1043
|
handleClickOutside: (e: MouseEvent) => void;
|
1039
|
-
handleInputFocus: () => void;
|
1044
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
1040
1045
|
handleInputChange: (event: Event) => void;
|
1041
1046
|
handleInputPaste: (event: ClipboardEvent) => void;
|
1042
1047
|
handleLogicalChange: (logical: import("./utils").SearchLogical) => void;
|
@@ -1050,6 +1055,7 @@ declare const BkSearchSelect: {
|
|
1050
1055
|
inputClearForWrapper: () => void;
|
1051
1056
|
deleteInputTextNode: () => void;
|
1052
1057
|
customPanelSubmit: (value: string) => void;
|
1058
|
+
refleshMenuHover: () => void;
|
1053
1059
|
t: import("vue").ComputedRef<{
|
1054
1060
|
pleaseSelect: string;
|
1055
1061
|
loading: string;
|
@@ -1553,7 +1553,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
1553
1553
|
var usingItem = (0,external_vue_namespaceObject.ref)(props.defaultUsingItem);
|
1554
1554
|
var menuHoverId = (0,external_vue_namespaceObject.ref)('');
|
1555
1555
|
var loading = (0,external_vue_namespaceObject.ref)(false);
|
1556
|
-
var debounceSetMenuList = (0,shared_namespaceObject.debounce)(
|
1556
|
+
var debounceSetMenuList = (0,shared_namespaceObject.debounce)(100, setMenuList);
|
1557
1557
|
// const selectMenuList = ref<ICommonItem[]>([]);
|
1558
1558
|
var isBindEvent = false;
|
1559
1559
|
var remoteMenuList = (0,external_vue_namespaceObject.ref)([]);
|
@@ -1635,9 +1635,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
1635
1635
|
}
|
1636
1636
|
}
|
1637
1637
|
function documentEnterEvent(e) {
|
1638
|
+
var _menuList$value2;
|
1638
1639
|
if (!isBindEvent) return;
|
1639
1640
|
e.preventDefault();
|
1640
|
-
var item = menuList.value.find(function (item) {
|
1641
|
+
var item = (_menuList$value2 = menuList.value) === null || _menuList$value2 === void 0 ? void 0 : _menuList$value2.find(function (item) {
|
1641
1642
|
return item.id === menuHoverId.value;
|
1642
1643
|
});
|
1643
1644
|
item && handleSelectItem(item);
|
@@ -1669,15 +1670,22 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
1669
1670
|
showPopover.value = false;
|
1670
1671
|
emit('focus', isFocus.value);
|
1671
1672
|
}
|
1672
|
-
|
1673
|
+
var isOriginFocus = false;
|
1674
|
+
function handleInputFocus(event) {
|
1675
|
+
if (isOriginFocus) return;
|
1673
1676
|
showNoSelectValueError.value = false;
|
1674
1677
|
if (props.mode === SearchInputMode.EDIT && usingItem.value && !isFocus.value) {
|
1675
1678
|
var nodeList = Array.from(inputRef.value.querySelectorAll("[data-type=\"".concat(usingItem.value.values.length ? 'value' : usingItem.value.type, "\"]")));
|
1676
1679
|
if (!nodeList.length) return;
|
1680
|
+
event === null || event === void 0 || event.preventDefault();
|
1677
1681
|
var range = document.createRange();
|
1678
1682
|
var selection = window.getSelection();
|
1679
1683
|
range.selectNodeContents(nodeList.at(-1));
|
1680
1684
|
selection === null || selection === void 0 || selection.removeAllRanges();
|
1685
|
+
isOriginFocus = true;
|
1686
|
+
setTimeout(function () {
|
1687
|
+
isOriginFocus = false;
|
1688
|
+
}, 200);
|
1681
1689
|
selection.addRange(range); // 注意这里会触发focus事件
|
1682
1690
|
setInputFocus(true, false);
|
1683
1691
|
return;
|
@@ -1722,7 +1730,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
1722
1730
|
case 'NumpadEnter':
|
1723
1731
|
if (props.valueBehavior === ValueBehavior.NEED_KEY && menuList.value.some(function (item) {
|
1724
1732
|
return item.id === menuHoverId.value;
|
1725
|
-
}))
|
1733
|
+
})) {
|
1734
|
+
var _keyword$value;
|
1735
|
+
if (!usingItem.value && (_keyword$value = keyword.value) !== null && _keyword$value !== void 0 && _keyword$value.length) {
|
1736
|
+
event.preventDefault();
|
1737
|
+
}
|
1738
|
+
return;
|
1739
|
+
}
|
1726
1740
|
handleKeyEnter(event).then(function (v) {
|
1727
1741
|
return v && clearInput();
|
1728
1742
|
});
|
@@ -1809,6 +1823,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
1809
1823
|
var _usingItem$value3;
|
1810
1824
|
// 删除已选择项
|
1811
1825
|
if (!usingItem.value && !keyword.value) {
|
1826
|
+
menuHoverId.value = '';
|
1812
1827
|
emit('delete');
|
1813
1828
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
1814
1829
|
setTimeout(setMenuList, 16);
|
@@ -2040,7 +2055,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
2040
2055
|
function _setMenuList() {
|
2041
2056
|
_setMenuList = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee5() {
|
2042
2057
|
var _props$data, _usingItem$value$sear, _usingItem$value$valu;
|
2043
|
-
var list, _usingItem$value14, _keyword$
|
2058
|
+
var list, _usingItem$value14, _keyword$value3, hoverItem;
|
2044
2059
|
return regenerator_default().wrap(function _callee5$(_context5) {
|
2045
2060
|
while (1) switch (_context5.prev = _context5.next) {
|
2046
2061
|
case 0:
|
@@ -2061,7 +2076,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
2061
2076
|
break;
|
2062
2077
|
case 9:
|
2063
2078
|
if (!(usingItem !== null && usingItem !== void 0 && usingItem.value)) {
|
2064
|
-
if (!((_keyword$
|
2079
|
+
if (!((_keyword$value3 = keyword.value) !== null && _keyword$value3 !== void 0 && _keyword$value3.length)) {
|
2065
2080
|
list = props.data.filter(function (item) {
|
2066
2081
|
return !item.isSelected;
|
2067
2082
|
}).slice();
|
@@ -2239,7 +2254,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
2239
2254
|
isFocus.value = true;
|
2240
2255
|
showPopover.value = true;
|
2241
2256
|
showNoSelectValueError.value = false;
|
2242
|
-
needCursorToEnd && (0,external_vue_namespaceObject.nextTick)(setCursorToEnd);
|
2257
|
+
!props.getMenuList && needCursorToEnd && (0,external_vue_namespaceObject.nextTick)(setCursorToEnd);
|
2243
2258
|
emit('focus', isFocus.value);
|
2244
2259
|
}
|
2245
2260
|
function setSelectedItem(item) {
|
@@ -2278,8 +2293,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
2278
2293
|
return undefined;
|
2279
2294
|
}
|
2280
2295
|
function deleteInputTextNode() {
|
2281
|
-
var _keyword$
|
2282
|
-
if ((_keyword$
|
2296
|
+
var _keyword$value2;
|
2297
|
+
if ((_keyword$value2 = keyword.value) !== null && _keyword$value2 !== void 0 && _keyword$value2.length) {
|
2283
2298
|
keyword.value = '';
|
2284
2299
|
var nodes = Array.from(inputRef.value.childNodes);
|
2285
2300
|
nodes.forEach(function (node) {
|
@@ -2333,13 +2348,19 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
2333
2348
|
return v && clearInput();
|
2334
2349
|
});
|
2335
2350
|
}
|
2351
|
+
function refleshMenuHover() {
|
2352
|
+
if (!usingItem.value) {
|
2353
|
+
menuHoverId.value = '';
|
2354
|
+
}
|
2355
|
+
}
|
2336
2356
|
// expose
|
2337
2357
|
expose({
|
2338
2358
|
inputFocusForWrapper: inputFocusForWrapper,
|
2339
2359
|
inputEnterForWrapper: inputEnterForWrapper,
|
2340
2360
|
inputClearForWrapper: inputClearForWrapper,
|
2341
2361
|
handleInputFocus: handleInputFocus,
|
2342
|
-
isFocus: isFocus
|
2362
|
+
isFocus: isFocus,
|
2363
|
+
refleshMenuHover: refleshMenuHover
|
2343
2364
|
});
|
2344
2365
|
return {
|
2345
2366
|
popoverRef: popoverRef,
|
@@ -2370,6 +2391,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
2370
2391
|
inputClearForWrapper: inputClearForWrapper,
|
2371
2392
|
deleteInputTextNode: deleteInputTextNode,
|
2372
2393
|
customPanelSubmit: customPanelSubmit,
|
2394
|
+
refleshMenuHover: refleshMenuHover,
|
2373
2395
|
t: t
|
2374
2396
|
};
|
2375
2397
|
},
|
@@ -2928,6 +2950,7 @@ var SearchSelectProps = {
|
|
2928
2950
|
var list = selectedList.value.slice();
|
2929
2951
|
list.splice(typeof index === 'number' ? index : selectedList.value.length - 1, 1);
|
2930
2952
|
onValidate('');
|
2953
|
+
inputRef.value.refleshMenuHover();
|
2931
2954
|
emit('update:modelValue', list.map(function (item) {
|
2932
2955
|
return item.toValue();
|
2933
2956
|
}));
|
@@ -53,7 +53,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
53
53
|
};
|
54
54
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
55
55
|
handleClickOutside: (e: MouseEvent) => void;
|
56
|
-
handleInputFocus: () => void;
|
56
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
57
57
|
handleInputChange: (event: Event) => void;
|
58
58
|
handleInputPaste: (event: ClipboardEvent) => void;
|
59
59
|
handleLogicalChange: (logical: SearchLogical) => void;
|
@@ -67,6 +67,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
67
67
|
inputClearForWrapper: () => void;
|
68
68
|
deleteInputTextNode: () => void;
|
69
69
|
customPanelSubmit: (value: string) => void;
|
70
|
+
refleshMenuHover: () => void;
|
70
71
|
t: import("vue").ComputedRef<{
|
71
72
|
pleaseSelect: string;
|
72
73
|
loading: string;
|
@@ -127,7 +127,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
127
127
|
};
|
128
128
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
129
129
|
handleClickOutside: (e: MouseEvent) => void;
|
130
|
-
handleInputFocus: () => void;
|
130
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
131
131
|
handleInputChange: (event: Event) => void;
|
132
132
|
handleInputPaste: (event: ClipboardEvent) => void;
|
133
133
|
handleLogicalChange: (logical: SearchLogical) => void;
|
@@ -141,6 +141,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
141
141
|
inputClearForWrapper: () => void;
|
142
142
|
deleteInputTextNode: () => void;
|
143
143
|
customPanelSubmit: (value: string) => void;
|
144
|
+
refleshMenuHover: () => void;
|
144
145
|
t: import("vue").ComputedRef<{
|
145
146
|
pleaseSelect: string;
|
146
147
|
loading: string;
|
@@ -249,7 +250,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
249
250
|
};
|
250
251
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
251
252
|
handleClickOutside: (e: MouseEvent) => void;
|
252
|
-
handleInputFocus: () => void;
|
253
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
253
254
|
handleInputChange: (event: Event) => void;
|
254
255
|
handleInputPaste: (event: ClipboardEvent) => void;
|
255
256
|
handleLogicalChange: (logical: SearchLogical) => void;
|
@@ -263,6 +264,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
263
264
|
inputClearForWrapper: () => void;
|
264
265
|
deleteInputTextNode: () => void;
|
265
266
|
customPanelSubmit: (value: string) => void;
|
267
|
+
refleshMenuHover: () => void;
|
266
268
|
t: import("vue").ComputedRef<{
|
267
269
|
pleaseSelect: string;
|
268
270
|
loading: string;
|
@@ -79,7 +79,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
79
79
|
};
|
80
80
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
81
81
|
handleClickOutside: (e: MouseEvent) => void;
|
82
|
-
handleInputFocus: () => void;
|
82
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
83
83
|
handleInputChange: (event: Event) => void;
|
84
84
|
handleInputPaste: (event: ClipboardEvent) => void;
|
85
85
|
handleLogicalChange: (logical: SearchLogical) => void;
|
@@ -93,6 +93,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
93
93
|
inputClearForWrapper: () => void;
|
94
94
|
deleteInputTextNode: () => void;
|
95
95
|
customPanelSubmit: (value: string) => void;
|
96
|
+
refleshMenuHover: () => void;
|
96
97
|
t: import("vue").ComputedRef<{
|
97
98
|
pleaseSelect: string;
|
98
99
|
loading: string;
|
@@ -201,7 +202,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
201
202
|
};
|
202
203
|
documentArrowEvent: (e: KeyboardEvent) => void;
|
203
204
|
handleClickOutside: (e: MouseEvent) => void;
|
204
|
-
handleInputFocus: () => void;
|
205
|
+
handleInputFocus: (event?: FocusEvent) => void;
|
205
206
|
handleInputChange: (event: Event) => void;
|
206
207
|
handleInputPaste: (event: ClipboardEvent) => void;
|
207
208
|
handleLogicalChange: (logical: SearchLogical) => void;
|
@@ -215,6 +216,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
215
216
|
inputClearForWrapper: () => void;
|
216
217
|
deleteInputTextNode: () => void;
|
217
218
|
customPanelSubmit: (value: string) => void;
|
219
|
+
refleshMenuHover: () => void;
|
218
220
|
t: import("vue").ComputedRef<{
|
219
221
|
pleaseSelect: string;
|
220
222
|
loading: string;
|