bkui-vue 2.0.2-beta.30 → 2.0.2-beta.32

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.
@@ -36,6 +36,7 @@ declare const _default: import("vue").DefineComponent<{
36
36
  default: string;
37
37
  };
38
38
  }, {
39
+ isPopoverShow: import("vue").Ref<boolean>;
39
40
  afterShow: () => void;
40
41
  afterHidden: () => void;
41
42
  popoverRef: import("vue").Ref<any>;
@@ -37,6 +37,7 @@ declare const BkDropdown: {
37
37
  onHide?: (...args: any[]) => any;
38
38
  onShowChange?: (...args: any[]) => any;
39
39
  }, {
40
+ isPopoverShow: import("vue").Ref<boolean>;
40
41
  afterShow: () => void;
41
42
  afterHidden: () => void;
42
43
  popoverRef: import("vue").Ref<any>;
@@ -128,6 +129,7 @@ declare const BkDropdown: {
128
129
  onHide?: (...args: any[]) => any;
129
130
  onShowChange?: (...args: any[]) => any;
130
131
  }, {
132
+ isPopoverShow: import("vue").Ref<boolean>;
131
133
  afterShow: () => void;
132
134
  afterHidden: () => void;
133
135
  popoverRef: import("vue").Ref<any>;
@@ -181,6 +183,7 @@ declare const BkDropdown: {
181
183
  onHide?: (...args: any[]) => any;
182
184
  onShowChange?: (...args: any[]) => any;
183
185
  }, {
186
+ isPopoverShow: import("vue").Ref<boolean>;
184
187
  afterShow: () => void;
185
188
  afterHidden: () => void;
186
189
  popoverRef: import("vue").Ref<any>;
@@ -90,7 +90,7 @@ function _defineProperty(obj, key, value) {
90
90
  ;// CONCATENATED MODULE: external "vue"
91
91
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
92
92
  var external_vue_y = x => () => x
93
- const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref });
93
+ const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref });
94
94
  ;// CONCATENATED MODULE: external "../config-provider"
95
95
  var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
96
96
  var config_provider_y = x => () => x
@@ -160,8 +160,13 @@ const merge_namespaceObject = merge_x({ ["default"]: () => __WEBPACK_EXTERNAL_MO
160
160
  emits: ['showChange', 'show', 'hide'],
161
161
  setup: function setup(_props, _ref) {
162
162
  var emit = _ref.emit;
163
+ var popoverRef = (0,external_vue_namespaceObject.ref)(null);
164
+ var isPopoverShow = (0,external_vue_namespaceObject.ref)(false);
165
+ var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
166
+ resolveClassName = _usePrefix.resolveClassName;
163
167
  /** 弹层显示值变更 */
164
168
  var handleShowChagne = function handleShowChagne(val) {
169
+ isPopoverShow.value = val;
165
170
  emit('showChange', val);
166
171
  };
167
172
  /** 显示后回调 */
@@ -174,10 +179,8 @@ const merge_namespaceObject = merge_x({ ["default"]: () => __WEBPACK_EXTERNAL_MO
174
179
  emit('hide');
175
180
  handleShowChagne(false);
176
181
  };
177
- var popoverRef = (0,external_vue_namespaceObject.ref)(null);
178
- var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
179
- resolveClassName = _usePrefix.resolveClassName;
180
182
  return {
183
+ isPopoverShow: isPopoverShow,
181
184
  afterShow: afterShow,
182
185
  afterHidden: afterHidden,
183
186
  popoverRef: popoverRef,
@@ -209,13 +212,15 @@ const merge_namespaceObject = merge_x({ ["default"]: () => __WEBPACK_EXTERNAL_MO
209
212
  var _this$$slots$default, _this$$slots;
210
213
  return (0,external_vue_namespaceObject.createVNode)("div", {
211
214
  "class": ["".concat(_this.resolveClassName('dropdown-reference')), _this.disabled ? 'disabled' : '']
212
- }, [' ', (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots), ' ']);
215
+ }, [(_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots, {
216
+ popoverShow: _this.isPopoverShow
217
+ })]);
213
218
  },
214
219
  content: function content() {
215
220
  var _this$$slots$content, _this$$slots2;
216
221
  return (0,external_vue_namespaceObject.createVNode)("div", {
217
222
  "class": "".concat(_this.resolveClassName('dropdown-content'))
218
- }, [(0,external_vue_namespaceObject.createTextVNode)(" "), (_this$$slots$content = (_this$$slots2 = _this.$slots).content) === null || _this$$slots$content === void 0 ? void 0 : _this$$slots$content.call(_this$$slots2), (0,external_vue_namespaceObject.createTextVNode)(" ")]);
223
+ }, [(_this$$slots$content = (_this$$slots2 = _this.$slots).content) === null || _this$$slots$content === void 0 ? void 0 : _this$$slots$content.call(_this$$slots2)]);
219
224
  }
220
225
  })]);
221
226
  }
@@ -1,5 +1,6 @@
1
1
  import type { ComputedRef, ExtractPropTypes } from 'vue';
2
2
  declare const formItemProps: {
3
+ itemType: import("vue-types").VueTypeDef<string>;
3
4
  label: import("vue-types").VueTypeValidableDef<string> & {
4
5
  default: string;
5
6
  };
@@ -46,6 +47,7 @@ declare const formItemProps: {
46
47
  };
47
48
  export type FormItemProps = Readonly<ExtractPropTypes<typeof formItemProps>>;
48
49
  declare const _default: import("vue").DefineComponent<{
50
+ itemType: import("vue-types").VueTypeDef<string>;
49
51
  label: import("vue-types").VueTypeValidableDef<string> & {
50
52
  default: string;
51
53
  };
@@ -106,6 +108,7 @@ declare const _default: import("vue").DefineComponent<{
106
108
  isError: import("vue").Ref<boolean>;
107
109
  errorMessage: import("vue").Ref<string>;
108
110
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
111
+ itemType: import("vue-types").VueTypeDef<string>;
109
112
  label: import("vue-types").VueTypeValidableDef<string> & {
110
113
  default: string;
111
114
  };
package/lib/form/form.css CHANGED
@@ -19,12 +19,23 @@
19
19
  line-height: 20px;
20
20
  text-align: left;
21
21
  }
22
- .bk-form--vertical .bk-form-content {
23
- text-align: left;
24
- }
25
22
  .bk-form-item {
26
23
  margin-bottom: 24px;
27
24
  }
25
+ .bk-form-item--vertical .bk-form-label {
26
+ float: unset;
27
+ width: auto;
28
+ padding-right: 0;
29
+ margin-bottom: 6px;
30
+ line-height: 20px;
31
+ text-align: left;
32
+ }
33
+ .bk-form-item--default .bk-form-label {
34
+ float: left;
35
+ padding-right: 22px;
36
+ line-height: 32px;
37
+ text-align: right;
38
+ }
28
39
  .bk-form-item.is-required .bk-form-label:after {
29
40
  position: absolute;
30
41
  top: 0;
@@ -51,6 +62,7 @@
51
62
  }
52
63
  .bk-form-label {
53
64
  position: relative;
65
+ box-sizing: border-box;
54
66
  float: left;
55
67
  padding-right: 22px;
56
68
  font-size: 14px;
@@ -59,7 +71,6 @@
59
71
  color: #63656e;
60
72
  text-align: right;
61
73
  vertical-align: middle;
62
- box-sizing: border-box;
63
74
  }
64
75
  .bk-form-label-description {
65
76
  cursor: pointer;
@@ -71,6 +82,7 @@
71
82
  .bk-form-content {
72
83
  position: relative;
73
84
  line-height: 32px;
85
+ text-align: left;
74
86
  }
75
87
  .bk-form-error {
76
88
  position: absolute;
@@ -26,16 +26,34 @@
26
26
  text-align: left;
27
27
 
28
28
  }
29
-
30
- .@{bk-prefix}-form-content {
31
- text-align: left;
32
- }
33
29
  }
34
30
  }
35
31
 
36
32
  .@{bk-prefix}-form-item {
37
33
  margin-bottom: 24px;
38
34
 
35
+ &--vertical {
36
+
37
+ .@{bk-prefix}-form-label {
38
+ float: unset;
39
+ width: auto;
40
+ padding-right: 0;
41
+ margin-bottom: 6px;
42
+ line-height: 20px;
43
+ text-align: left;
44
+ }
45
+ }
46
+
47
+ &--default {
48
+
49
+ .@{bk-prefix}-form-label {
50
+ float: left;
51
+ padding-right: 22px;
52
+ line-height: 32px;
53
+ text-align: right;
54
+ }
55
+ }
56
+
39
57
  &.is-required {
40
58
  .@{bk-prefix}-form-label {
41
59
  &:after {
@@ -73,6 +91,7 @@
73
91
 
74
92
  .@{bk-prefix}-form-label {
75
93
  position: relative;
94
+ box-sizing: border-box;
76
95
  float: left;
77
96
  padding-right: 22px;
78
97
  font-size: 14px;
@@ -80,9 +99,7 @@
80
99
  line-height: 32px;
81
100
  color: #63656e;
82
101
  text-align: right;
83
- text-align: right;
84
102
  vertical-align: middle;
85
- box-sizing: border-box;
86
103
  }
87
104
  .@{bk-prefix}-form-label-description {
88
105
  cursor: pointer;
@@ -95,6 +112,7 @@
95
112
  .@{bk-prefix}-form-content {
96
113
  position: relative;
97
114
  line-height: 32px;
115
+ text-align: left;
98
116
  }
99
117
 
100
118
  .@{bk-prefix}-form-error {
@@ -149,12 +149,23 @@
149
149
  line-height: 20px;
150
150
  text-align: left;
151
151
  }
152
- .bk-form--vertical .bk-form-content {
153
- text-align: left;
154
- }
155
152
  .bk-form-item {
156
153
  margin-bottom: 24px;
157
154
  }
155
+ .bk-form-item--vertical .bk-form-label {
156
+ float: unset;
157
+ width: auto;
158
+ padding-right: 0;
159
+ margin-bottom: 6px;
160
+ line-height: 20px;
161
+ text-align: left;
162
+ }
163
+ .bk-form-item--default .bk-form-label {
164
+ float: left;
165
+ padding-right: 22px;
166
+ line-height: 32px;
167
+ text-align: right;
168
+ }
158
169
  .bk-form-item.is-required .bk-form-label:after {
159
170
  position: absolute;
160
171
  top: 0;
@@ -181,6 +192,7 @@
181
192
  }
182
193
  .bk-form-label {
183
194
  position: relative;
195
+ box-sizing: border-box;
184
196
  float: left;
185
197
  padding-right: 22px;
186
198
  font-size: 14px;
@@ -189,7 +201,6 @@
189
201
  color: #63656e;
190
202
  text-align: right;
191
203
  vertical-align: middle;
192
- box-sizing: border-box;
193
204
  }
194
205
  .bk-form-label-description {
195
206
  cursor: pointer;
@@ -201,6 +212,7 @@
201
212
  .bk-form-content {
202
213
  position: relative;
203
214
  line-height: 32px;
215
+ text-align: left;
204
216
  }
205
217
  .bk-form-error {
206
218
  position: absolute;
@@ -174,6 +174,7 @@ declare const BkForm: {
174
174
  };
175
175
  }, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]> & Readonly<{
176
176
  FormItem: import("vue").DefineComponent<{
177
+ itemType: import("vue-types").VueTypeDef<string>;
177
178
  label: import("vue-types").VueTypeValidableDef<string> & {
178
179
  default: string;
179
180
  };
@@ -234,6 +235,7 @@ declare const BkForm: {
234
235
  isError: import("vue").Ref<boolean>;
235
236
  errorMessage: import("vue").Ref<string>;
236
237
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
238
+ itemType: import("vue-types").VueTypeDef<string>;
237
239
  label: import("vue-types").VueTypeValidableDef<string> & {
238
240
  default: string;
239
241
  };
package/lib/form/index.js CHANGED
@@ -1972,6 +1972,7 @@ function form_item_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
1972
1972
 
1973
1973
 
1974
1974
  var formItemProps = {
1975
+ itemType: shared_.PropTypes.oneOf(['default', 'vertical']),
1975
1976
  label: shared_.PropTypes.string,
1976
1977
  labelWidth: shared_.PropTypes.oneOfType([Number, String]),
1977
1978
  labelPosition: shared_.PropTypes.oneOf(['left', 'center', 'right']),
@@ -2127,7 +2128,7 @@ var isValid = function isValid(value) {
2127
2128
  if (!isForm) {
2128
2129
  return false;
2129
2130
  }
2130
- return form.props.formType === 'vertical';
2131
+ return form.props.formType === 'vertical' || props.itemType === 'vertical';
2131
2132
  });
2132
2133
  var isShowLabel = (0,external_vue_.computed)(function () {
2133
2134
  if (props.label || context.slots.label) {
@@ -2217,19 +2218,18 @@ var isValid = function isValid(value) {
2217
2218
  state.errorMessage = errorMessage;
2218
2219
  }
2219
2220
  form.emit('validate', props.property, false, errorMessage);
2220
- return Promise.reject(state.errorMessage);
2221
2221
  });
2222
2222
  }
2223
2223
  // 同步验证失败
2224
- if (result === false) {
2225
- var errorMessage = getRuleMessage(rule);
2224
+ if (result !== true) {
2225
+ var errorMessage = typeof result === 'string' ? result : getRuleMessage(rule);
2226
2226
  if (showError) {
2227
2227
  state.isError = true;
2228
2228
  // 验证结果返回的是 String 表示验证失败,返回结果作为错误信息
2229
- state.errorMessage = typeof result === 'string' ? result : errorMessage;
2229
+ state.errorMessage = errorMessage;
2230
2230
  }
2231
2231
  form.emit('validate', props.property, false, errorMessage);
2232
- return Promise.reject(state.errorMessage);
2232
+ return Promise.reject(errorMessage);
2233
2233
  }
2234
2234
  // 下一步
2235
2235
  return doValidate();
@@ -2277,7 +2277,7 @@ var isValid = function isValid(value) {
2277
2277
  _this$$slots,
2278
2278
  _this$$slots$default,
2279
2279
  _this$$slots2;
2280
- var itemClassees = (0,shared_.classes)((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(this.resolveClassName('form-item')), true), 'is-error', this.isError), 'is-required', this.required));
2280
+ var itemClassees = (0,shared_.classes)((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])((0,defineProperty["default"])({}, "".concat(this.resolveClassName('form-item')), true), "".concat(this.resolveClassName("form-item--".concat(this.itemType))), Boolean(this.itemType)), 'is-error', this.isError), 'is-required', this.required));
2281
2281
  var renderLabel = function renderLabel() {
2282
2282
  if (_this.$slots.label) {
2283
2283
  return (0,external_vue_.createVNode)("span", null, [_this.$slots.label()]);
package/lib/index.js CHANGED
@@ -3,5 +3,5 @@ export * from './hooks';
3
3
  export { default } from './preset';
4
4
  export * from './config-provider';
5
5
  export * from './directives';
6
- export const version = "2.0.2-beta.30";
6
+ export const version = "2.0.2-beta.32";
7
7
  window.__bkui_vue_version__ = version;
@@ -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;
@@ -2807,6 +2807,7 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
2807
2807
  return ((_usingItem$value = usingItem.value) === null || _usingItem$value === void 0 ? void 0 : _usingItem$value.logical) || SearchLogical.OR;
2808
2808
  });
2809
2809
  var inputKey = (0,external_vue_namespaceObject.ref)((0,shared_namespaceObject.random)(10));
2810
+ var isComposition = (0,external_vue_namespaceObject.ref)(false);
2810
2811
  (0,external_vue_namespaceObject.watch)(editKey, function () {
2811
2812
  if (props.mode === SearchInputMode.DEFAULT && editKey.value) {
2812
2813
  showPopover.value = false;
@@ -2956,7 +2957,9 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
2956
2957
  debounceSetMenuList();
2957
2958
  }
2958
2959
  function handleInputChange(event) {
2959
- var text = event.target.innerText.trim();
2960
+ if (isComposition.value) return;
2961
+ clearInputBr();
2962
+ var text = event.target.innerText;
2960
2963
  if (!usingItem.value) {
2961
2964
  keyword.value = text;
2962
2965
  debounceSetMenuList();
@@ -2975,7 +2978,7 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
2975
2978
  return;
2976
2979
  }
2977
2980
  }
2978
- keyword.value = usingItem.value.isSpecialType() ? text : text.replace(usingItem.value.name, '').replace(':', '').trim();
2981
+ keyword.value = usingItem.value.isSpecialType() ? text : text.replace(usingItem.value.name, '').replace(':', '');
2979
2982
  debounceSetMenuList();
2980
2983
  }
2981
2984
  function handleInputKeyup(event) {
@@ -2988,9 +2991,11 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
2988
2991
  // }
2989
2992
  // return;
2990
2993
  // }
2994
+ if (isComposition.value) return;
2991
2995
  switch (event.code) {
2992
2996
  case 'Enter':
2993
2997
  case 'NumpadEnter':
2998
+ event.preventDefault();
2994
2999
  if (props.valueBehavior === ValueBehavior.NEED_KEY && menuList.value.some(function (item) {
2995
3000
  return item.id === menuHoverId.value;
2996
3001
  })) {
@@ -3005,7 +3010,9 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
3005
3010
  });
3006
3011
  break;
3007
3012
  case 'Backspace':
3013
+ case 'Delete':
3008
3014
  handleKeyBackspace(event);
3015
+ break;
3009
3016
  default:
3010
3017
  showNoSelectValueError.value = false;
3011
3018
  break;
@@ -3111,7 +3118,7 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
3111
3118
  setInputFocus(false, false);
3112
3119
  return;
3113
3120
  }
3114
- } else if (!keyword.value) {
3121
+ } else if (!keyword.value || keyword.value.length === 1) {
3115
3122
  usingItem.value = null;
3116
3123
  keyword.value = '';
3117
3124
  setMenuList();
@@ -3560,12 +3567,30 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
3560
3567
  (0,external_vue_namespaceObject.nextTick)(clearInput);
3561
3568
  }
3562
3569
  }
3570
+ function clearInputBr() {
3571
+ if (!inputRef.value) return;
3572
+ var brs = inputRef.value.querySelectorAll('br');
3573
+ brs === null || brs === void 0 || brs.forEach(function (br) {
3574
+ return br.remove();
3575
+ });
3576
+ }
3563
3577
  function clearInput() {
3564
3578
  if (!inputRef.value) return;
3565
- setTimeout(function () {
3566
- keyword.value = '';
3579
+ // magic code 判断是否是 windows 系统
3580
+ // const isWindows = navigator.userAgent.includes('Windows');
3581
+ // if (isWindows) {
3582
+ // setTimeout(() => {
3583
+ // keyword.value = '';
3584
+ // inputRef.value.innerText = '';
3585
+ // clearInputBr();
3586
+ // }, 32);
3587
+ // return;
3588
+ // }
3589
+ keyword.value = '';
3590
+ (0,external_vue_namespaceObject.nextTick)(function () {
3567
3591
  inputRef.value.innerText = '';
3568
- }, 16);
3592
+ clearInputBr();
3593
+ });
3569
3594
  }
3570
3595
  function str2SelectedItem(str) {
3571
3596
  var _str$split = str.split(':'),
@@ -3645,6 +3670,14 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
3645
3670
  menuHoverId.value = '';
3646
3671
  }
3647
3672
  }
3673
+ function handleCompositionEnd(event) {
3674
+ isComposition.value = false;
3675
+ keyword.value = event.data;
3676
+ handleInputChange(event);
3677
+ }
3678
+ function handleCompositionStart() {
3679
+ isComposition.value = true;
3680
+ }
3648
3681
  // expose
3649
3682
  expose({
3650
3683
  inputFocusForWrapper: inputFocusForWrapper,
@@ -3663,6 +3696,7 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
3663
3696
  menuList: menuList,
3664
3697
  menuHoverId: menuHoverId,
3665
3698
  isFocus: isFocus,
3699
+ isComposition: isComposition,
3666
3700
  usingItem: usingItem,
3667
3701
  showPopover: showPopover,
3668
3702
  showNoSelectValueError: showNoSelectValueError,
@@ -3685,7 +3719,9 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
3685
3719
  customPanelSubmit: customPanelSubmit,
3686
3720
  refleshMenuHover: refleshMenuHover,
3687
3721
  t: t,
3688
- inputKey: inputKey
3722
+ inputKey: inputKey,
3723
+ handleCompositionEnd: handleCompositionEnd,
3724
+ handleCompositionStart: handleCompositionStart
3689
3725
  };
3690
3726
  },
3691
3727
  render: function render() {
@@ -3712,9 +3748,11 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
3712
3748
  'input-after': showInputAfter
3713
3749
  },
3714
3750
  "contenteditable": true,
3715
- "data-placeholder": !inputInnerHtml && !_this.keyword ? _this.placeholder : '',
3751
+ "data-placeholder": !_this.isComposition && !inputInnerHtml && !_this.keyword ? _this.placeholder : '',
3716
3752
  "data-tips": placeholder || '',
3717
3753
  "spellcheck": "false",
3754
+ "onCompositionend": _this.handleCompositionEnd,
3755
+ "onCompositionstart": _this.handleCompositionStart,
3718
3756
  "onFocus": _this.handleInputFocus,
3719
3757
  "onInput": _this.handleInputChange,
3720
3758
  "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;