bkui-vue 2.0.2-beta.28 → 2.0.2-beta.29
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 +21 -21
- package/dist/index.esm.js +3842 -3833
- package/dist/index.umd.js +21 -21
- package/lib/index.js +1 -1
- package/lib/search-select/index.d.ts +18 -0
- package/lib/search-select/index.js +33 -14
- package/lib/search-select/input.d.ts +3 -0
- package/lib/search-select/search-select.d.ts +6 -0
- package/lib/search-select/selected.d.ts +6 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
@@ -90,6 +90,7 @@ declare const BkSearchSelect: {
|
|
90
90
|
menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
|
91
91
|
menuHoverId: import("vue").Ref<string>;
|
92
92
|
isFocus: import("vue").Ref<boolean>;
|
93
|
+
isComposition: import("vue").Ref<boolean>;
|
93
94
|
usingItem: import("vue").Ref<import("./utils").SelectedItem>;
|
94
95
|
showPopover: import("vue").Ref<boolean>;
|
95
96
|
showNoSelectValueError: import("vue").Ref<boolean>;
|
@@ -125,6 +126,8 @@ declare const BkSearchSelect: {
|
|
125
126
|
logical: string;
|
126
127
|
}>;
|
127
128
|
inputKey: import("vue").Ref<string>;
|
129
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
130
|
+
handleCompositionStart: () => void;
|
128
131
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
129
132
|
data: {
|
130
133
|
type: import("vue").PropType<import("./utils").ISearchItem[]>;
|
@@ -223,6 +226,7 @@ declare const BkSearchSelect: {
|
|
223
226
|
menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
|
224
227
|
menuHoverId: import("vue").Ref<string>;
|
225
228
|
isFocus: import("vue").Ref<boolean>;
|
229
|
+
isComposition: import("vue").Ref<boolean>;
|
226
230
|
usingItem: import("vue").Ref<import("./utils").SelectedItem>;
|
227
231
|
showPopover: import("vue").Ref<boolean>;
|
228
232
|
showNoSelectValueError: import("vue").Ref<boolean>;
|
@@ -258,6 +262,8 @@ declare const BkSearchSelect: {
|
|
258
262
|
logical: string;
|
259
263
|
}>;
|
260
264
|
inputKey: import("vue").Ref<string>;
|
265
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
266
|
+
handleCompositionStart: () => void;
|
261
267
|
}, {}, {}, {}, {
|
262
268
|
maxHeight: number;
|
263
269
|
mode: import("./utils").SearchInputMode;
|
@@ -546,6 +552,7 @@ declare const BkSearchSelect: {
|
|
546
552
|
menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
|
547
553
|
menuHoverId: import("vue").Ref<string>;
|
548
554
|
isFocus: import("vue").Ref<boolean>;
|
555
|
+
isComposition: import("vue").Ref<boolean>;
|
549
556
|
usingItem: import("vue").Ref<import("./utils").SelectedItem>;
|
550
557
|
showPopover: import("vue").Ref<boolean>;
|
551
558
|
showNoSelectValueError: import("vue").Ref<boolean>;
|
@@ -581,6 +588,8 @@ declare const BkSearchSelect: {
|
|
581
588
|
logical: string;
|
582
589
|
}>;
|
583
590
|
inputKey: import("vue").Ref<string>;
|
591
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
592
|
+
handleCompositionStart: () => void;
|
584
593
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
585
594
|
data: {
|
586
595
|
type: import("vue").PropType<import("./utils").ISearchItem[]>;
|
@@ -679,6 +688,7 @@ declare const BkSearchSelect: {
|
|
679
688
|
menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
|
680
689
|
menuHoverId: import("vue").Ref<string>;
|
681
690
|
isFocus: import("vue").Ref<boolean>;
|
691
|
+
isComposition: import("vue").Ref<boolean>;
|
682
692
|
usingItem: import("vue").Ref<import("./utils").SelectedItem>;
|
683
693
|
showPopover: import("vue").Ref<boolean>;
|
684
694
|
showNoSelectValueError: import("vue").Ref<boolean>;
|
@@ -714,6 +724,8 @@ declare const BkSearchSelect: {
|
|
714
724
|
logical: string;
|
715
725
|
}>;
|
716
726
|
inputKey: import("vue").Ref<string>;
|
727
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
728
|
+
handleCompositionStart: () => void;
|
717
729
|
}, {}, {}, {}, {
|
718
730
|
maxHeight: number;
|
719
731
|
mode: import("./utils").SearchInputMode;
|
@@ -951,6 +963,7 @@ declare const BkSearchSelect: {
|
|
951
963
|
menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
|
952
964
|
menuHoverId: import("vue").Ref<string>;
|
953
965
|
isFocus: import("vue").Ref<boolean>;
|
966
|
+
isComposition: import("vue").Ref<boolean>;
|
954
967
|
usingItem: import("vue").Ref<import("./utils").SelectedItem>;
|
955
968
|
showPopover: import("vue").Ref<boolean>;
|
956
969
|
showNoSelectValueError: import("vue").Ref<boolean>;
|
@@ -986,6 +999,8 @@ declare const BkSearchSelect: {
|
|
986
999
|
logical: string;
|
987
1000
|
}>;
|
988
1001
|
inputKey: import("vue").Ref<string>;
|
1002
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
1003
|
+
handleCompositionStart: () => void;
|
989
1004
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
990
1005
|
data: {
|
991
1006
|
type: import("vue").PropType<import("./utils").ISearchItem[]>;
|
@@ -1084,6 +1099,7 @@ declare const BkSearchSelect: {
|
|
1084
1099
|
menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
|
1085
1100
|
menuHoverId: import("vue").Ref<string>;
|
1086
1101
|
isFocus: import("vue").Ref<boolean>;
|
1102
|
+
isComposition: import("vue").Ref<boolean>;
|
1087
1103
|
usingItem: import("vue").Ref<import("./utils").SelectedItem>;
|
1088
1104
|
showPopover: import("vue").Ref<boolean>;
|
1089
1105
|
showNoSelectValueError: import("vue").Ref<boolean>;
|
@@ -1119,6 +1135,8 @@ declare const BkSearchSelect: {
|
|
1119
1135
|
logical: string;
|
1120
1136
|
}>;
|
1121
1137
|
inputKey: import("vue").Ref<string>;
|
1138
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
1139
|
+
handleCompositionStart: () => void;
|
1122
1140
|
}, {}, {}, {}, {
|
1123
1141
|
maxHeight: number;
|
1124
1142
|
mode: import("./utils").SearchInputMode;
|
@@ -2831,6 +2831,7 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
2831
2831
|
return ((_usingItem$value = usingItem.value) === null || _usingItem$value === void 0 ? void 0 : _usingItem$value.logical) || SearchLogical.OR;
|
2832
2832
|
});
|
2833
2833
|
var inputKey = (0,external_vue_namespaceObject.ref)((0,shared_namespaceObject.random)(10));
|
2834
|
+
var isComposition = (0,external_vue_namespaceObject.ref)(false);
|
2834
2835
|
(0,external_vue_namespaceObject.watch)(editKey, function () {
|
2835
2836
|
if (props.mode === SearchInputMode.DEFAULT && editKey.value) {
|
2836
2837
|
showPopover.value = false;
|
@@ -2980,7 +2981,9 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
2980
2981
|
debounceSetMenuList();
|
2981
2982
|
}
|
2982
2983
|
function handleInputChange(event) {
|
2983
|
-
|
2984
|
+
if (isComposition.value) return;
|
2985
|
+
clearInputBr();
|
2986
|
+
var text = event.target.innerText;
|
2984
2987
|
if (!usingItem.value) {
|
2985
2988
|
keyword.value = text;
|
2986
2989
|
debounceSetMenuList();
|
@@ -2999,7 +3002,7 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
2999
3002
|
return;
|
3000
3003
|
}
|
3001
3004
|
}
|
3002
|
-
keyword.value = usingItem.value.isSpecialType() ? text : text.replace(usingItem.value.name, '').replace(':', '')
|
3005
|
+
keyword.value = usingItem.value.isSpecialType() ? text : text.replace(usingItem.value.name, '').replace(':', '');
|
3003
3006
|
debounceSetMenuList();
|
3004
3007
|
}
|
3005
3008
|
function handleInputKeyup(event) {
|
@@ -3012,6 +3015,7 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
3012
3015
|
// }
|
3013
3016
|
// return;
|
3014
3017
|
// }
|
3018
|
+
if (isComposition.value) return;
|
3015
3019
|
switch (event.code) {
|
3016
3020
|
case 'Enter':
|
3017
3021
|
case 'NumpadEnter':
|
@@ -3030,7 +3034,9 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
3030
3034
|
});
|
3031
3035
|
break;
|
3032
3036
|
case 'Backspace':
|
3037
|
+
case 'Delete':
|
3033
3038
|
handleKeyBackspace(event);
|
3039
|
+
break;
|
3034
3040
|
default:
|
3035
3041
|
showNoSelectValueError.value = false;
|
3036
3042
|
break;
|
@@ -3136,7 +3142,7 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
3136
3142
|
setInputFocus(false, false);
|
3137
3143
|
return;
|
3138
3144
|
}
|
3139
|
-
} else if (!keyword.value) {
|
3145
|
+
} else if (!keyword.value || keyword.value.length === 1) {
|
3140
3146
|
usingItem.value = null;
|
3141
3147
|
keyword.value = '';
|
3142
3148
|
setMenuList();
|
@@ -3595,15 +3601,15 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
3595
3601
|
function clearInput() {
|
3596
3602
|
if (!inputRef.value) return;
|
3597
3603
|
// magic code 判断是否是 windows 系统
|
3598
|
-
|
3599
|
-
if (isWindows) {
|
3600
|
-
|
3601
|
-
|
3602
|
-
|
3603
|
-
|
3604
|
-
|
3605
|
-
|
3606
|
-
}
|
3604
|
+
// const isWindows = navigator.userAgent.includes('Windows');
|
3605
|
+
// if (isWindows) {
|
3606
|
+
// setTimeout(() => {
|
3607
|
+
// keyword.value = '';
|
3608
|
+
// inputRef.value.innerText = '';
|
3609
|
+
// clearInputBr();
|
3610
|
+
// }, 32);
|
3611
|
+
// return;
|
3612
|
+
// }
|
3607
3613
|
keyword.value = '';
|
3608
3614
|
(0,external_vue_namespaceObject.nextTick)(function () {
|
3609
3615
|
inputRef.value.innerText = '';
|
@@ -3688,6 +3694,14 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
3688
3694
|
menuHoverId.value = '';
|
3689
3695
|
}
|
3690
3696
|
}
|
3697
|
+
function handleCompositionEnd(event) {
|
3698
|
+
isComposition.value = false;
|
3699
|
+
keyword.value = event.data;
|
3700
|
+
handleInputChange(event);
|
3701
|
+
}
|
3702
|
+
function handleCompositionStart() {
|
3703
|
+
isComposition.value = true;
|
3704
|
+
}
|
3691
3705
|
// expose
|
3692
3706
|
expose({
|
3693
3707
|
inputFocusForWrapper: inputFocusForWrapper,
|
@@ -3706,6 +3720,7 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
3706
3720
|
menuList: menuList,
|
3707
3721
|
menuHoverId: menuHoverId,
|
3708
3722
|
isFocus: isFocus,
|
3723
|
+
isComposition: isComposition,
|
3709
3724
|
usingItem: usingItem,
|
3710
3725
|
showPopover: showPopover,
|
3711
3726
|
showNoSelectValueError: showNoSelectValueError,
|
@@ -3728,7 +3743,9 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
3728
3743
|
customPanelSubmit: customPanelSubmit,
|
3729
3744
|
refleshMenuHover: refleshMenuHover,
|
3730
3745
|
t: t,
|
3731
|
-
inputKey: inputKey
|
3746
|
+
inputKey: inputKey,
|
3747
|
+
handleCompositionEnd: handleCompositionEnd,
|
3748
|
+
handleCompositionStart: handleCompositionStart
|
3732
3749
|
};
|
3733
3750
|
},
|
3734
3751
|
render: function render() {
|
@@ -3755,9 +3772,11 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
3755
3772
|
'input-after': showInputAfter
|
3756
3773
|
},
|
3757
3774
|
"contenteditable": true,
|
3758
|
-
"data-placeholder": !inputInnerHtml && !_this.keyword ? _this.placeholder : '',
|
3775
|
+
"data-placeholder": !_this.isComposition && !inputInnerHtml && !_this.keyword ? _this.placeholder : '',
|
3759
3776
|
"data-tips": placeholder || '',
|
3760
3777
|
"spellcheck": "false",
|
3778
|
+
"onCompositionend": _this.handleCompositionEnd,
|
3779
|
+
"onCompositionstart": _this.handleCompositionStart,
|
3761
3780
|
"onFocus": _this.handleInputFocus,
|
3762
3781
|
"onInput": _this.handleInputChange,
|
3763
3782
|
"onKeydown": _this.handleInputKeyup,
|
@@ -49,6 +49,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
49
49
|
menuList: Ref<ISearchItem[]>;
|
50
50
|
menuHoverId: Ref<string>;
|
51
51
|
isFocus: Ref<boolean>;
|
52
|
+
isComposition: Ref<boolean>;
|
52
53
|
usingItem: Ref<SelectedItem>;
|
53
54
|
showPopover: Ref<boolean>;
|
54
55
|
showNoSelectValueError: Ref<boolean>;
|
@@ -84,6 +85,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
84
85
|
logical: string;
|
85
86
|
}>;
|
86
87
|
inputKey: Ref<string>;
|
88
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
89
|
+
handleCompositionStart: () => void;
|
87
90
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], "focus" | "delete" | "add" | "selectKey", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
88
91
|
data: {
|
89
92
|
type: PropType<ISearchItem[]>;
|
@@ -122,6 +122,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
122
122
|
menuList: import("vue").Ref<ISearchItem[]>;
|
123
123
|
menuHoverId: import("vue").Ref<string>;
|
124
124
|
isFocus: import("vue").Ref<boolean>;
|
125
|
+
isComposition: import("vue").Ref<boolean>;
|
125
126
|
usingItem: import("vue").Ref<SelectedItem>;
|
126
127
|
showPopover: import("vue").Ref<boolean>;
|
127
128
|
showNoSelectValueError: import("vue").Ref<boolean>;
|
@@ -157,6 +158,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
157
158
|
logical: string;
|
158
159
|
}>;
|
159
160
|
inputKey: import("vue").Ref<string>;
|
161
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
162
|
+
handleCompositionStart: () => void;
|
160
163
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
161
164
|
data: {
|
162
165
|
type: PropType<ISearchItem[]>;
|
@@ -255,6 +258,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
255
258
|
menuList: import("vue").Ref<ISearchItem[]>;
|
256
259
|
menuHoverId: import("vue").Ref<string>;
|
257
260
|
isFocus: import("vue").Ref<boolean>;
|
261
|
+
isComposition: import("vue").Ref<boolean>;
|
258
262
|
usingItem: import("vue").Ref<SelectedItem>;
|
259
263
|
showPopover: import("vue").Ref<boolean>;
|
260
264
|
showNoSelectValueError: import("vue").Ref<boolean>;
|
@@ -290,6 +294,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
290
294
|
logical: string;
|
291
295
|
}>;
|
292
296
|
inputKey: import("vue").Ref<string>;
|
297
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
298
|
+
handleCompositionStart: () => void;
|
293
299
|
}, {}, {}, {}, {
|
294
300
|
maxHeight: number;
|
295
301
|
mode: import("./utils").SearchInputMode;
|
@@ -78,6 +78,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
78
78
|
menuList: import("vue").Ref<ISearchItem[]>;
|
79
79
|
menuHoverId: import("vue").Ref<string>;
|
80
80
|
isFocus: import("vue").Ref<boolean>;
|
81
|
+
isComposition: import("vue").Ref<boolean>;
|
81
82
|
usingItem: import("vue").Ref<SelectedItem>;
|
82
83
|
showPopover: import("vue").Ref<boolean>;
|
83
84
|
showNoSelectValueError: import("vue").Ref<boolean>;
|
@@ -113,6 +114,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
113
114
|
logical: string;
|
114
115
|
}>;
|
115
116
|
inputKey: import("vue").Ref<string>;
|
117
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
118
|
+
handleCompositionStart: () => void;
|
116
119
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
117
120
|
data: {
|
118
121
|
type: PropType<ISearchItem[]>;
|
@@ -211,6 +214,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
211
214
|
menuList: import("vue").Ref<ISearchItem[]>;
|
212
215
|
menuHoverId: import("vue").Ref<string>;
|
213
216
|
isFocus: import("vue").Ref<boolean>;
|
217
|
+
isComposition: import("vue").Ref<boolean>;
|
214
218
|
usingItem: import("vue").Ref<SelectedItem>;
|
215
219
|
showPopover: import("vue").Ref<boolean>;
|
216
220
|
showNoSelectValueError: import("vue").Ref<boolean>;
|
@@ -246,6 +250,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
246
250
|
logical: string;
|
247
251
|
}>;
|
248
252
|
inputKey: import("vue").Ref<string>;
|
253
|
+
handleCompositionEnd: (event: CompositionEvent) => void;
|
254
|
+
handleCompositionStart: () => void;
|
249
255
|
}, {}, {}, {}, {
|
250
256
|
maxHeight: number;
|
251
257
|
mode: SearchInputMode;
|