bkui-vue 0.0.2-beta.9 → 0.0.2-table-refactor.1
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 +69 -61
- package/dist/index.esm.js +15913 -15468
- package/dist/index.umd.js +69 -61
- package/dist/locale/en.esm.js +1 -1
- package/dist/locale/en.esm.js.map +1 -1
- package/dist/locale/en.umd.js +1 -1
- package/dist/locale/en.umd.js.map +1 -1
- package/dist/locale/zh-cn.esm.js +1 -1
- package/dist/locale/zh-cn.esm.js.map +1 -1
- package/dist/locale/zh-cn.umd.js +1 -1
- package/dist/locale/zh-cn.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/affix.d.ts +1 -1
- package/lib/affix/index.d.ts +4 -4
- package/lib/alert/alert.css +7 -0
- package/lib/alert/alert.d.ts +5 -5
- package/lib/alert/alert.less +16 -6
- package/lib/alert/alert.variable.css +7 -0
- package/lib/alert/index.d.ts +10 -10
- package/lib/animate-number/index.d.ts +1 -1
- package/lib/backtop/index.d.ts +1 -1
- package/lib/badge/badge.d.ts +2 -2
- package/lib/badge/index.d.ts +7 -7
- package/lib/breadcrumb/index.d.ts +2 -2
- package/lib/button/button.css +20 -0
- package/lib/button/button.less +105 -94
- package/lib/button/button.variable.css +20 -0
- package/lib/button/index.d.ts +2 -2
- package/lib/card/card.d.ts +1 -1
- package/lib/card/index.d.ts +4 -4
- package/lib/cascader/cascader.d.ts +1 -0
- package/lib/cascader/index.d.ts +5 -2
- package/lib/cascader/index.js +1 -1
- package/lib/cascader/interface.d.ts +1 -1
- package/lib/checkbox/checkbox-group.d.ts +6 -3
- package/lib/checkbox/checkbox.d.ts +4 -4
- package/lib/checkbox/index.d.ts +22 -19
- package/lib/checkbox/index.js +1 -1
- package/lib/code-diff/index.d.ts +1 -1
- package/lib/collapse/index.d.ts +2 -2
- package/lib/collapse-transition/index.d.ts +128 -2
- package/lib/collapse-transition/index.js +1 -1
- package/lib/color-picker/color-picker.d.ts +16 -0
- package/lib/color-picker/components/recommend-colors.d.ts +16 -0
- package/lib/color-picker/index.d.ts +19 -1
- package/lib/color-picker/index.js +1 -1
- package/lib/config-provider/config-provider.d.ts +3 -0
- package/lib/config-provider/index.d.ts +5 -1
- package/lib/config-provider/index.js +1 -1
- package/lib/config-provider/token.d.ts +1 -0
- package/lib/config-provider/use-global-config.d.ts +2 -0
- package/lib/config-provider/use-prefix.d.ts +2 -0
- package/lib/container/index.d.ts +2 -2
- package/lib/date-picker/date-picker.d.ts +3 -1
- package/lib/date-picker/index.d.ts +12 -5
- package/lib/date-picker/index.js +1 -1
- package/lib/date-picker/panel/date-range.d.ts +2 -1
- package/lib/dialog/index.d.ts +1 -1
- package/lib/directives/index.js +1 -1
- package/lib/directives/tooltips.d.ts +3 -2
- package/lib/divider/index.d.ts +1 -1
- package/lib/dropdown/dropdown.css +1 -0
- package/lib/dropdown/dropdown.variable.css +1 -0
- package/lib/dropdown/index.d.ts +2 -2
- package/lib/exception/index.d.ts +2 -2
- package/lib/fixed-navbar/index.d.ts +1 -1
- package/lib/form/index.d.ts +3 -3
- package/lib/form/index.js +1 -1
- package/lib/hooks.d.ts +1 -1
- package/lib/hooks.js +1 -1
- package/lib/icon/assistant.d.ts +4 -0
- package/lib/icon/assistant.js +1 -0
- package/lib/icon/index.d.ts +1 -0
- package/lib/icon/index.js +1 -1
- package/lib/image/index.d.ts +1 -1
- package/lib/image/index.js +1 -1
- package/lib/info-box/index.js +1 -1
- package/lib/input/index.d.ts +146 -50
- package/lib/input/index.js +2 -1
- package/lib/input/index.js.LICENSE.txt +1 -0
- package/lib/input/input.css +34 -6
- package/lib/input/input.d.ts +100 -11
- package/lib/input/input.less +53 -14
- package/lib/input/input.variable.css +34 -6
- package/lib/input/util.d.ts +6 -0
- package/lib/link/index.d.ts +4 -4
- package/lib/link/link.d.ts +1 -1
- package/lib/loading/index.d.ts +2 -2
- package/lib/locale/index.js +1 -1
- package/lib/locale/lang/en.d.ts +1 -0
- package/lib/menu/index.d.ts +2 -2
- package/lib/message/index.js +1 -1
- package/lib/message/message.css +33 -9
- package/lib/message/message.less +78 -54
- package/lib/message/message.variable.css +33 -9
- package/lib/message/messageConstructor.d.ts +25 -4
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal/index.js +1 -1
- package/lib/navigation/index.d.ts +4 -1
- package/lib/navigation/index.js +1 -1
- package/lib/navigation/navigation.d.ts +1 -0
- package/lib/notify/index.js +1 -1
- package/lib/notify/notifyConstructor.d.ts +1 -1
- package/lib/overflow-title/components/overflow-title.d.ts +257 -1
- package/lib/overflow-title/index.d.ts +387 -2
- package/lib/overflow-title/index.js +1 -1
- package/lib/overflow-title/props.d.ts +129 -0
- package/lib/pagination/index.d.ts +2 -2
- package/lib/plugin-popover/index.js +1 -1
- package/lib/pop-confirm/index.d.ts +1 -1
- package/lib/popover/content.d.ts +33 -0
- package/lib/popover/index.d.ts +74 -16
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.css +1 -0
- package/lib/popover/popover.d.ts +40 -7
- package/lib/popover/popover.less +3 -2
- package/lib/popover/popover.variable.css +1 -0
- package/lib/popover/props.d.ts +25 -2
- package/lib/popover/use-floating.d.ts +1 -1
- package/lib/popover/use-popover-init.d.ts +2 -1
- package/lib/popover2/index.d.ts +1 -1
- package/lib/preset.d.ts +2 -0
- package/lib/process/index.d.ts +1 -1
- package/lib/progress/index.d.ts +1 -1
- package/lib/radio/index.d.ts +23 -23
- package/lib/radio/radio-button.d.ts +4 -4
- package/lib/radio/radio-group.d.ts +4 -4
- package/lib/radio/radio.d.ts +4 -4
- package/lib/rate/index.d.ts +8 -4
- package/lib/rate/index.js +1 -1
- package/lib/rate/rate.d.ts +2 -1
- package/lib/resize-layout/index.d.ts +4 -4
- package/lib/resize-layout/index.js +1 -1
- package/lib/resize-layout/resize-layout.css +12 -0
- package/lib/resize-layout/resize-layout.d.ts +1 -1
- package/lib/resize-layout/resize-layout.less +12 -0
- package/lib/resize-layout/resize-layout.variable.css +12 -0
- package/lib/search-select/index.d.ts +62 -29
- package/lib/search-select/index.js +1 -1
- package/lib/search-select/input.d.ts +5 -1
- package/lib/search-select/menu.d.ts +33 -2
- package/lib/search-select/search-select.css +31 -11
- package/lib/search-select/search-select.d.ts +23 -20
- package/lib/search-select/search-select.less +29 -10
- package/lib/search-select/search-select.variable.css +31 -11
- package/lib/search-select/selected.d.ts +5 -1
- package/lib/search-select/utils.d.ts +13 -5
- package/lib/select/index.d.ts +180 -72
- package/lib/select/index.js +1 -1
- package/lib/select/option.d.ts +11 -0
- package/lib/select/select.css +9 -1
- package/lib/select/select.d.ts +75 -31
- package/lib/select/select.less +11 -1
- package/lib/select/select.variable.css +9 -1
- package/lib/select/selectTagInput.d.ts +8 -5
- package/lib/shared/helper.d.ts +1 -1
- package/lib/shared/index.js +1 -1
- package/lib/shared/mask-manager.d.ts +3 -4
- package/lib/shared/pop-manager.d.ts +6 -2
- package/lib/shared/popover.d.ts +2 -2
- package/lib/shared/vue-types.d.ts +3 -2
- package/lib/sideslider/index.d.ts +1 -1
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/index.js +1 -1
- package/lib/steps/index.d.ts +1 -1
- package/lib/steps/index.js +1 -1
- package/lib/styles/mixins/clearfix.css +8 -0
- package/lib/styles/mixins/clearfix.less +10 -0
- package/lib/styles/mixins/clearfix.variable.css +8 -0
- package/lib/styles/mixins/mixins.css +72 -0
- package/lib/styles/mixins/mixins.less +5 -0
- package/lib/styles/mixins/mixins.variable.css +72 -0
- package/lib/styles/mixins/popper.less +6 -5
- package/lib/swiper/index.d.ts +1 -1
- package/lib/swiper/index.js +1 -1
- package/lib/swiper/swiper.css +0 -6
- package/lib/swiper/swiper.less +0 -8
- package/lib/swiper/swiper.variable.css +0 -6
- package/lib/switcher/index.d.ts +30 -16
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.d.ts +74 -5
- package/lib/tab/index.d.ts +3 -3
- package/lib/tab/tab-nav.d.ts +12 -2
- package/lib/tab/tab-panel.d.ts +1 -1
- package/lib/table/components/table-cell.d.ts +22 -24
- package/lib/table/components/table-column.d.ts +123 -81
- package/lib/table/const.d.ts +18 -2
- package/lib/table/events.d.ts +26 -26
- package/lib/table/index.d.ts +279 -294
- package/lib/table/index.js +1 -1
- package/lib/table/plugins/head-filter.css +3 -0
- package/lib/table/plugins/head-filter.less +3 -0
- package/lib/table/plugins/head-filter.variable.css +3 -0
- package/lib/table/plugins/settings.d.ts +7 -17
- package/lib/table/plugins/use-column-resize.d.ts +30 -10
- package/lib/table/plugins/use-fixed-column.d.ts +6 -5
- package/lib/table/plugins/use-pagination.d.ts +7 -4
- package/lib/table/props.d.ts +117 -58
- package/lib/table/render.d.ts +7 -17
- package/lib/table/table.css +79 -10
- package/lib/table/table.d.ts +95 -72
- package/lib/table/table.less +55 -20
- package/lib/table/table.variable.css +79 -10
- package/lib/table/use-attributes.d.ts +55 -0
- package/lib/table/use-column.d.ts +175 -49
- package/lib/table/use-common.d.ts +1608 -88
- package/lib/table/use-render.d.ts +11 -0
- package/lib/table/utils.d.ts +30 -29
- package/lib/table-column/index.d.ts +235 -405
- package/lib/table-column/index.js +1 -1
- package/lib/tag/index.d.ts +10 -10
- package/lib/tag/index.js +1 -1
- package/lib/tag/tag.d.ts +5 -5
- package/lib/tag-input/index.d.ts +49 -7
- package/lib/tag-input/index.js +1 -1
- package/lib/tag-input/tag-input.css +6 -1
- package/lib/tag-input/tag-input.d.ts +46 -6
- package/lib/tag-input/tag-input.less +9 -4
- package/lib/tag-input/tag-input.variable.css +6 -1
- package/lib/tag-input/tag-props.d.ts +16 -2
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/timeline/index.d.ts +1 -1
- package/lib/transfer/index.d.ts +1 -1
- package/lib/tree/constant.d.ts +2 -2
- package/lib/tree/index.d.ts +37 -7
- package/lib/tree/index.js +1 -1
- package/lib/tree/props.d.ts +8 -1
- package/lib/tree/tree.d.ts +20 -2
- package/lib/tree/use-node-action.d.ts +3 -2
- package/lib/tree/use-node-attribute.d.ts +15 -8
- package/lib/tree/use-tree-init.d.ts +1 -2
- package/lib/tree/util.d.ts +7 -2
- package/lib/upload/index.d.ts +1 -1
- package/lib/virtual-render/index.d.ts +43 -1
- package/lib/virtual-render/index.js +1 -1
- package/lib/virtual-render/props.d.ts +15 -0
- package/lib/virtual-render/v-virtual-render.d.ts +1 -0
- package/lib/virtual-render/virtual-render.d.ts +27 -2
- package/lib/volar.components.d.ts +24 -24
- package/package.json +17 -16
@@ -9,14 +9,13 @@ declare const BkSearchSelect: {
|
|
9
9
|
clearable?: boolean;
|
10
10
|
modelValue?: import("./utils").ISearchValue[];
|
11
11
|
conditions?: import("./utils").ICommonItem[];
|
12
|
-
valueBehavior?:
|
13
|
-
valueSplitCode?: string;
|
12
|
+
valueBehavior?: "all" | "need-key";
|
14
13
|
shrink?: boolean;
|
15
14
|
uniqueSelect?: boolean;
|
16
15
|
class?: unknown;
|
17
16
|
style?: unknown;
|
18
|
-
key?: string | number | symbol;
|
19
17
|
ref?: import("vue").VNodeRef;
|
18
|
+
key?: string | number | symbol;
|
20
19
|
ref_for?: boolean;
|
21
20
|
ref_key?: string;
|
22
21
|
onVnodeBeforeMount?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
@@ -108,16 +107,12 @@ declare const BkSearchSelect: {
|
|
108
107
|
placeholder: StringConstructor;
|
109
108
|
getMenuList: import("vue").PropType<import("./utils").GetMenuListFunc>;
|
110
109
|
validateValues: import("vue").PropType<import("./utils").ValidateValuesFunc>;
|
111
|
-
valueSplitCode: {
|
112
|
-
type: StringConstructor;
|
113
|
-
default: string;
|
114
|
-
};
|
115
110
|
uniqueSelect: {
|
116
111
|
type: BooleanConstructor;
|
117
112
|
default: boolean;
|
118
113
|
};
|
119
114
|
valueBehavior: {
|
120
|
-
type: import("vue").PropType<
|
115
|
+
type: import("vue").PropType<"all" | "need-key">;
|
121
116
|
default: import("./utils").ValueBehavior;
|
122
117
|
validator(v: import("./utils").ValueBehavior): boolean;
|
123
118
|
};
|
@@ -161,8 +156,10 @@ declare const BkSearchSelect: {
|
|
161
156
|
id: string;
|
162
157
|
realId?: string;
|
163
158
|
isSelected?: boolean;
|
159
|
+
logical?: import("./utils").SearchLogical;
|
164
160
|
};
|
165
161
|
isSelected?: boolean;
|
162
|
+
logical?: import("./utils").SearchLogical;
|
166
163
|
}[]>;
|
167
164
|
menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
|
168
165
|
menuHoverId: import("vue").Ref<string>;
|
@@ -178,6 +175,7 @@ declare const BkSearchSelect: {
|
|
178
175
|
handleClickOutside: (e: MouseEvent) => void;
|
179
176
|
handleInputFocus: (e: FocusEvent) => void;
|
180
177
|
handleInputChange: (event: Event) => void;
|
178
|
+
handleLogicalChange: (logical: import("./utils").SearchLogical) => void;
|
181
179
|
handleInputKeyup: (event: KeyboardEvent) => void;
|
182
180
|
handleSelectItem: (item: import("./utils").ICommonItem, type?: import("./utils").SearchItemType) => Promise<void>;
|
183
181
|
handleSelectCondtionItem: (item: import("./utils").ICommonItem) => void;
|
@@ -191,6 +189,7 @@ declare const BkSearchSelect: {
|
|
191
189
|
cancel: string;
|
192
190
|
or: string;
|
193
191
|
and: string;
|
192
|
+
logical: string;
|
194
193
|
}>;
|
195
194
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "add" | "delete")[], "focus" | "add" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
196
195
|
data: {
|
@@ -239,10 +238,13 @@ declare const BkSearchSelect: {
|
|
239
238
|
id: string;
|
240
239
|
realId?: string;
|
241
240
|
isSelected?: boolean;
|
241
|
+
logical?: import("./utils").SearchLogical;
|
242
242
|
};
|
243
243
|
isSelected?: boolean;
|
244
|
+
logical?: import("./utils").SearchLogical;
|
244
245
|
}[];
|
245
246
|
condition: string;
|
247
|
+
logical: import("./utils").SearchLogical;
|
246
248
|
searchItem: {
|
247
249
|
id: string;
|
248
250
|
name: string;
|
@@ -256,8 +258,10 @@ declare const BkSearchSelect: {
|
|
256
258
|
id: string;
|
257
259
|
realId?: string;
|
258
260
|
isSelected?: boolean;
|
261
|
+
logical?: import("./utils").SearchLogical;
|
259
262
|
};
|
260
263
|
isSelected?: boolean;
|
264
|
+
logical?: import("./utils").SearchLogical;
|
261
265
|
}[];
|
262
266
|
multiple?: boolean;
|
263
267
|
async?: boolean;
|
@@ -274,13 +278,17 @@ declare const BkSearchSelect: {
|
|
274
278
|
id: string;
|
275
279
|
realId?: string;
|
276
280
|
isSelected?: boolean;
|
281
|
+
logical?: import("./utils").SearchLogical;
|
277
282
|
};
|
278
283
|
isSelected?: boolean;
|
284
|
+
logical?: import("./utils").SearchLogical;
|
279
285
|
};
|
280
286
|
isSelected?: boolean;
|
287
|
+
onlyRecommendChildren?: boolean;
|
288
|
+
logical?: import("./utils").SearchLogical;
|
289
|
+
showLogicalPanel?: boolean;
|
281
290
|
};
|
282
291
|
type: import("./utils").SearchItemType;
|
283
|
-
splitCode: string;
|
284
292
|
readonly multiple: boolean;
|
285
293
|
readonly placeholder: string;
|
286
294
|
readonly children: {
|
@@ -293,14 +301,17 @@ declare const BkSearchSelect: {
|
|
293
301
|
id: string;
|
294
302
|
realId?: string;
|
295
303
|
isSelected?: boolean;
|
304
|
+
logical?: import("./utils").SearchLogical;
|
296
305
|
};
|
297
306
|
isSelected?: boolean;
|
307
|
+
logical?: import("./utils").SearchLogical;
|
298
308
|
}[];
|
299
309
|
readonly validate: boolean;
|
300
310
|
readonly inputInnerHtml: string;
|
301
311
|
readonly inputInnerText: string;
|
302
312
|
readonly keyInnerHtml: string;
|
303
313
|
readonly keyInnerText: string;
|
314
|
+
readonly showLogical: boolean;
|
304
315
|
isSpecialType: () => boolean;
|
305
316
|
addValue: (item: import("./utils").ICommonItem) => void;
|
306
317
|
toValue: () => import("./utils").ISearchValue;
|
@@ -309,7 +320,6 @@ declare const BkSearchSelect: {
|
|
309
320
|
}[]>;
|
310
321
|
overflowIndex: import("vue").Ref<number>;
|
311
322
|
validateStr: import("vue").Ref<string>;
|
312
|
-
splitCode: import("vue").ComputedRef<string>;
|
313
323
|
onEditClick: (item: import("./utils").SelectedItem, index: number) => void;
|
314
324
|
onEditEnter: (item: import("./utils").SelectedItem, index: number) => void;
|
315
325
|
handleWrapClick: () => void;
|
@@ -330,6 +340,7 @@ declare const BkSearchSelect: {
|
|
330
340
|
cancel: string;
|
331
341
|
or: string;
|
332
342
|
and: string;
|
343
|
+
logical: string;
|
333
344
|
}>;
|
334
345
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("search" | "update:modelValue")[], string, {
|
335
346
|
data: import("./utils").ISearchItem[];
|
@@ -338,8 +349,7 @@ declare const BkSearchSelect: {
|
|
338
349
|
clearable: boolean;
|
339
350
|
modelValue: import("./utils").ISearchValue[];
|
340
351
|
conditions: import("./utils").ICommonItem[];
|
341
|
-
valueBehavior:
|
342
|
-
valueSplitCode: string;
|
352
|
+
valueBehavior: "all" | "need-key";
|
343
353
|
shrink: boolean;
|
344
354
|
uniqueSelect: boolean;
|
345
355
|
}, {}, string, {}> & {
|
@@ -394,16 +404,12 @@ declare const BkSearchSelect: {
|
|
394
404
|
placeholder: StringConstructor;
|
395
405
|
getMenuList: import("vue").PropType<import("./utils").GetMenuListFunc>;
|
396
406
|
validateValues: import("vue").PropType<import("./utils").ValidateValuesFunc>;
|
397
|
-
valueSplitCode: {
|
398
|
-
type: StringConstructor;
|
399
|
-
default: string;
|
400
|
-
};
|
401
407
|
uniqueSelect: {
|
402
408
|
type: BooleanConstructor;
|
403
409
|
default: boolean;
|
404
410
|
};
|
405
411
|
valueBehavior: {
|
406
|
-
type: import("vue").PropType<
|
412
|
+
type: import("vue").PropType<"all" | "need-key">;
|
407
413
|
default: import("./utils").ValueBehavior;
|
408
414
|
validator(v: import("./utils").ValueBehavior): boolean;
|
409
415
|
};
|
@@ -447,8 +453,10 @@ declare const BkSearchSelect: {
|
|
447
453
|
id: string;
|
448
454
|
realId?: string;
|
449
455
|
isSelected?: boolean;
|
456
|
+
logical?: import("./utils").SearchLogical;
|
450
457
|
};
|
451
458
|
isSelected?: boolean;
|
459
|
+
logical?: import("./utils").SearchLogical;
|
452
460
|
}[]>;
|
453
461
|
menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
|
454
462
|
menuHoverId: import("vue").Ref<string>;
|
@@ -464,6 +472,7 @@ declare const BkSearchSelect: {
|
|
464
472
|
handleClickOutside: (e: MouseEvent) => void;
|
465
473
|
handleInputFocus: (e: FocusEvent) => void;
|
466
474
|
handleInputChange: (event: Event) => void;
|
475
|
+
handleLogicalChange: (logical: import("./utils").SearchLogical) => void;
|
467
476
|
handleInputKeyup: (event: KeyboardEvent) => void;
|
468
477
|
handleSelectItem: (item: import("./utils").ICommonItem, type?: import("./utils").SearchItemType) => Promise<void>;
|
469
478
|
handleSelectCondtionItem: (item: import("./utils").ICommonItem) => void;
|
@@ -477,6 +486,7 @@ declare const BkSearchSelect: {
|
|
477
486
|
cancel: string;
|
478
487
|
or: string;
|
479
488
|
and: string;
|
489
|
+
logical: string;
|
480
490
|
}>;
|
481
491
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "add" | "delete")[], "focus" | "add" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
482
492
|
data: {
|
@@ -525,10 +535,13 @@ declare const BkSearchSelect: {
|
|
525
535
|
id: string;
|
526
536
|
realId?: string;
|
527
537
|
isSelected?: boolean;
|
538
|
+
logical?: import("./utils").SearchLogical;
|
528
539
|
};
|
529
540
|
isSelected?: boolean;
|
541
|
+
logical?: import("./utils").SearchLogical;
|
530
542
|
}[];
|
531
543
|
condition: string;
|
544
|
+
logical: import("./utils").SearchLogical;
|
532
545
|
searchItem: {
|
533
546
|
id: string;
|
534
547
|
name: string;
|
@@ -542,8 +555,10 @@ declare const BkSearchSelect: {
|
|
542
555
|
id: string;
|
543
556
|
realId?: string;
|
544
557
|
isSelected?: boolean;
|
558
|
+
logical?: import("./utils").SearchLogical;
|
545
559
|
};
|
546
560
|
isSelected?: boolean;
|
561
|
+
logical?: import("./utils").SearchLogical;
|
547
562
|
}[];
|
548
563
|
multiple?: boolean;
|
549
564
|
async?: boolean;
|
@@ -560,13 +575,17 @@ declare const BkSearchSelect: {
|
|
560
575
|
id: string;
|
561
576
|
realId?: string;
|
562
577
|
isSelected?: boolean;
|
578
|
+
logical?: import("./utils").SearchLogical;
|
563
579
|
};
|
564
580
|
isSelected?: boolean;
|
581
|
+
logical?: import("./utils").SearchLogical;
|
565
582
|
};
|
566
583
|
isSelected?: boolean;
|
584
|
+
onlyRecommendChildren?: boolean;
|
585
|
+
logical?: import("./utils").SearchLogical;
|
586
|
+
showLogicalPanel?: boolean;
|
567
587
|
};
|
568
588
|
type: import("./utils").SearchItemType;
|
569
|
-
splitCode: string;
|
570
589
|
readonly multiple: boolean;
|
571
590
|
readonly placeholder: string;
|
572
591
|
readonly children: {
|
@@ -579,14 +598,17 @@ declare const BkSearchSelect: {
|
|
579
598
|
id: string;
|
580
599
|
realId?: string;
|
581
600
|
isSelected?: boolean;
|
601
|
+
logical?: import("./utils").SearchLogical;
|
582
602
|
};
|
583
603
|
isSelected?: boolean;
|
604
|
+
logical?: import("./utils").SearchLogical;
|
584
605
|
}[];
|
585
606
|
readonly validate: boolean;
|
586
607
|
readonly inputInnerHtml: string;
|
587
608
|
readonly inputInnerText: string;
|
588
609
|
readonly keyInnerHtml: string;
|
589
610
|
readonly keyInnerText: string;
|
611
|
+
readonly showLogical: boolean;
|
590
612
|
isSpecialType: () => boolean;
|
591
613
|
addValue: (item: import("./utils").ICommonItem) => void;
|
592
614
|
toValue: () => import("./utils").ISearchValue;
|
@@ -595,7 +617,6 @@ declare const BkSearchSelect: {
|
|
595
617
|
}[]>;
|
596
618
|
overflowIndex: import("vue").Ref<number>;
|
597
619
|
validateStr: import("vue").Ref<string>;
|
598
|
-
splitCode: import("vue").ComputedRef<string>;
|
599
620
|
onEditClick: (item: import("./utils").SelectedItem, index: number) => void;
|
600
621
|
onEditEnter: (item: import("./utils").SelectedItem, index: number) => void;
|
601
622
|
handleWrapClick: () => void;
|
@@ -616,6 +637,7 @@ declare const BkSearchSelect: {
|
|
616
637
|
cancel: string;
|
617
638
|
or: string;
|
618
639
|
and: string;
|
640
|
+
logical: string;
|
619
641
|
}>;
|
620
642
|
}> & {} & import("vue").ComponentCustomProperties & {};
|
621
643
|
__isFragment?: never;
|
@@ -653,16 +675,12 @@ declare const BkSearchSelect: {
|
|
653
675
|
placeholder: StringConstructor;
|
654
676
|
getMenuList: import("vue").PropType<import("./utils").GetMenuListFunc>;
|
655
677
|
validateValues: import("vue").PropType<import("./utils").ValidateValuesFunc>;
|
656
|
-
valueSplitCode: {
|
657
|
-
type: StringConstructor;
|
658
|
-
default: string;
|
659
|
-
};
|
660
678
|
uniqueSelect: {
|
661
679
|
type: BooleanConstructor;
|
662
680
|
default: boolean;
|
663
681
|
};
|
664
682
|
valueBehavior: {
|
665
|
-
type: import("vue").PropType<
|
683
|
+
type: import("vue").PropType<"all" | "need-key">;
|
666
684
|
default: import("./utils").ValueBehavior;
|
667
685
|
validator(v: import("./utils").ValueBehavior): boolean;
|
668
686
|
};
|
@@ -706,8 +724,10 @@ declare const BkSearchSelect: {
|
|
706
724
|
id: string;
|
707
725
|
realId?: string;
|
708
726
|
isSelected?: boolean;
|
727
|
+
logical?: import("./utils").SearchLogical;
|
709
728
|
};
|
710
729
|
isSelected?: boolean;
|
730
|
+
logical?: import("./utils").SearchLogical;
|
711
731
|
}[]>;
|
712
732
|
menuList: import("vue").Ref<import("./utils").ISearchItem[]>;
|
713
733
|
menuHoverId: import("vue").Ref<string>;
|
@@ -723,6 +743,7 @@ declare const BkSearchSelect: {
|
|
723
743
|
handleClickOutside: (e: MouseEvent) => void;
|
724
744
|
handleInputFocus: (e: FocusEvent) => void;
|
725
745
|
handleInputChange: (event: Event) => void;
|
746
|
+
handleLogicalChange: (logical: import("./utils").SearchLogical) => void;
|
726
747
|
handleInputKeyup: (event: KeyboardEvent) => void;
|
727
748
|
handleSelectItem: (item: import("./utils").ICommonItem, type?: import("./utils").SearchItemType) => Promise<void>;
|
728
749
|
handleSelectCondtionItem: (item: import("./utils").ICommonItem) => void;
|
@@ -736,6 +757,7 @@ declare const BkSearchSelect: {
|
|
736
757
|
cancel: string;
|
737
758
|
or: string;
|
738
759
|
and: string;
|
760
|
+
logical: string;
|
739
761
|
}>;
|
740
762
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "add" | "delete")[], "focus" | "add" | "delete", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
741
763
|
data: {
|
@@ -784,10 +806,13 @@ declare const BkSearchSelect: {
|
|
784
806
|
id: string;
|
785
807
|
realId?: string;
|
786
808
|
isSelected?: boolean;
|
809
|
+
logical?: import("./utils").SearchLogical;
|
787
810
|
};
|
788
811
|
isSelected?: boolean;
|
812
|
+
logical?: import("./utils").SearchLogical;
|
789
813
|
}[];
|
790
814
|
condition: string;
|
815
|
+
logical: import("./utils").SearchLogical;
|
791
816
|
searchItem: {
|
792
817
|
id: string;
|
793
818
|
name: string;
|
@@ -801,8 +826,10 @@ declare const BkSearchSelect: {
|
|
801
826
|
id: string;
|
802
827
|
realId?: string;
|
803
828
|
isSelected?: boolean;
|
829
|
+
logical?: import("./utils").SearchLogical;
|
804
830
|
};
|
805
831
|
isSelected?: boolean;
|
832
|
+
logical?: import("./utils").SearchLogical;
|
806
833
|
}[];
|
807
834
|
multiple?: boolean;
|
808
835
|
async?: boolean;
|
@@ -819,13 +846,17 @@ declare const BkSearchSelect: {
|
|
819
846
|
id: string;
|
820
847
|
realId?: string;
|
821
848
|
isSelected?: boolean;
|
849
|
+
logical?: import("./utils").SearchLogical;
|
822
850
|
};
|
823
851
|
isSelected?: boolean;
|
852
|
+
logical?: import("./utils").SearchLogical;
|
824
853
|
};
|
825
854
|
isSelected?: boolean;
|
855
|
+
onlyRecommendChildren?: boolean;
|
856
|
+
logical?: import("./utils").SearchLogical;
|
857
|
+
showLogicalPanel?: boolean;
|
826
858
|
};
|
827
859
|
type: import("./utils").SearchItemType;
|
828
|
-
splitCode: string;
|
829
860
|
readonly multiple: boolean;
|
830
861
|
readonly placeholder: string;
|
831
862
|
readonly children: {
|
@@ -838,14 +869,17 @@ declare const BkSearchSelect: {
|
|
838
869
|
id: string;
|
839
870
|
realId?: string;
|
840
871
|
isSelected?: boolean;
|
872
|
+
logical?: import("./utils").SearchLogical;
|
841
873
|
};
|
842
874
|
isSelected?: boolean;
|
875
|
+
logical?: import("./utils").SearchLogical;
|
843
876
|
}[];
|
844
877
|
readonly validate: boolean;
|
845
878
|
readonly inputInnerHtml: string;
|
846
879
|
readonly inputInnerText: string;
|
847
880
|
readonly keyInnerHtml: string;
|
848
881
|
readonly keyInnerText: string;
|
882
|
+
readonly showLogical: boolean;
|
849
883
|
isSpecialType: () => boolean;
|
850
884
|
addValue: (item: import("./utils").ICommonItem) => void;
|
851
885
|
toValue: () => import("./utils").ISearchValue;
|
@@ -854,7 +888,6 @@ declare const BkSearchSelect: {
|
|
854
888
|
}[]>;
|
855
889
|
overflowIndex: import("vue").Ref<number>;
|
856
890
|
validateStr: import("vue").Ref<string>;
|
857
|
-
splitCode: import("vue").ComputedRef<string>;
|
858
891
|
onEditClick: (item: import("./utils").SelectedItem, index: number) => void;
|
859
892
|
onEditEnter: (item: import("./utils").SelectedItem, index: number) => void;
|
860
893
|
handleWrapClick: () => void;
|
@@ -875,6 +908,7 @@ declare const BkSearchSelect: {
|
|
875
908
|
cancel: string;
|
876
909
|
or: string;
|
877
910
|
and: string;
|
911
|
+
logical: string;
|
878
912
|
}>;
|
879
913
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("search" | "update:modelValue")[], "search" | "update:modelValue", {
|
880
914
|
data: import("./utils").ISearchItem[];
|
@@ -883,10 +917,9 @@ declare const BkSearchSelect: {
|
|
883
917
|
clearable: boolean;
|
884
918
|
modelValue: import("./utils").ISearchValue[];
|
885
919
|
conditions: import("./utils").ICommonItem[];
|
886
|
-
valueBehavior:
|
887
|
-
valueSplitCode: string;
|
920
|
+
valueBehavior: "all" | "need-key";
|
888
921
|
shrink: boolean;
|
889
922
|
uniqueSelect: boolean;
|
890
923
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]>;
|
891
924
|
export default BkSearchSelect;
|
892
|
-
export { BkSearchSelect
|
925
|
+
export { BkSearchSelect };
|
@@ -1,2 +1,2 @@
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../directives","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,e["../config-provider"],e["../directives"],e["../icon"],e["../popover"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r,i,o)=>(()=>{var a={2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=i},5537:e=>{"use strict";e.exports=o},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t},7609:(e,t,n)=>{var r=n(7425).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",s=l.asyncIterator||"@@asyncIterator",c=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),l=new I(r||[]);return a(o,"_invoke",{value:E(e,n,l)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=v;var h={};function p(){}function m(){}function y(){}var g={};d(g,u,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(N([])));b&&b!==n&&o.call(b,u)&&(g=b);var w=y.prototype=p.prototype=Object.create(g);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(i,a,l,u){var s=f(e[i],e,a);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==r(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,l,u)}),(function(e){n("throw",e,l,u)})):t.resolve(d).then((function(e){c.value=e,l(c)}),(function(e){return n("throw",e,l,u)}))}u(s.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function E(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===h)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=f(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function N(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:V}}function V(){return{value:void 0,done:!0}}return m.prototype=y,a(w,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:m,configurable:!0}),m.displayName=d(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(k.prototype),d(k.prototype,s,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new k(v(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(w),d(w,c,"Generator"),d(w,u,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,n)=>{var r=n(7609)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return a[e](n,n.exports,u),n.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";u.r(s),u.d(s,{BkSearchSelect:()=>A,default:()=>M});var e=u(4212);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(n)?n:String(n)}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=u(748),o=null,a=null;function l(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function c(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function d(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===c(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var v=0,f=null;function h(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=p.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,i=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&y(e)})),o=d(e),a=o.detached,u=o.rendered;e.__resize_observer_triggered__=!1===a&&!1===u,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){y(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(v||(f=function(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){var t=c(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=l("div",{className:"resize-triggers"}),r=l("div",{className:"resize-expand-trigger"}),i=l("div"),o=l("div",{className:"resize-contract-trigger"});r.appendChild(i),n.appendChild(r),n.appendChild(o),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:i,contract:o},g(e),e.addEventListener("scroll",m,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=d(e).rendered,window.MutationObserver){var s=new MutationObserver(e.__resize_mutation_handler__);s.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=s}e.__resize_listeners__.push(t),v++}function p(){var e=d(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(g(this),this.addEventListener("scroll",m,!0)),this.__resize_rendered__=t,y(this))}function m(){var e,t,n=this;g(this),this.__resize_raf__&&(e=this.__resize_raf__,a||(a=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),a(e)),this.__resize_raf__=(t=function(){var e,t,r,i,o,a,l=(r=(t=(e=n).__resize_last__).width,i=t.height,o=e.offsetWidth,a=e.offsetHeight,o!==r||a!==i?{width:o,height:a}:null);l&&(n.__resize_last__=l,y(n))},o||(o=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),o(t))}function y(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function g(e){var t=e.__resize_triggers__,n=t.expand,r=t.expandChild,i=t.contract,o=i.scrollWidth,a=i.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,s=n.scrollWidth,c=n.scrollHeight;i.scrollLeft=o,i.scrollTop=a,r.style.width=l+1+"px",r.style.height=u+1+"px",n.scrollLeft=s,n.scrollTop=c}var _=u(2717),b=u(4061),w=u(6870),x=u(2841),k=u.n(x);function E(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((r=r.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var S=u(5537),L=u.n(S);const C=(0,i.defineComponent)({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:function(){return[]}},conditions:{type:Array},footerBtns:{type:Array,default:function(){return[]}}},emits:["selectItem","selectCondition","footerClick"],setup:function(e,t){var n=t.emit,r=(0,_.useLocale)("searchSelect"),o=(0,_.usePrefix)().resolveClassName,a=(0,i.computed)((function(){return void 0===e.footerBtns||0===e.footerBtns.length?[{id:"confirm",name:r.value.ok},{id:"cancel",name:r.value.cancel,disabled:!1}]:e.footerBtns}));return{handleClick:function(e){n("selectItem",e)},handleClickCondition:function(e){n("selectCondition",e)},handleClickFooterBtn:function(e){n("footerClick",e)},filterList:(0,i.computed)((function(){var t,n;return(null===(t=e.list)||void 0===t?void 0:t.length)?(null===(n=e.keyword)||void 0===n?void 0:n.length)?e.list.filter((function(t){return t.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())})):e.list:[]})),getSearchNode:function(t){var n;return(null===(n=t.value)||void 0===n?void 0:n.name)?[(0,i.createVNode)("span",{class:"menu-name"},[t.name,(0,i.createTextVNode)(":")]),t.value.name]:function(t){if(!t)return t;var n=e.keyword,r=n.length;if(!(null==n?void 0:n.trim().length)||!t.toLocaleLowerCase().includes(n.toLocaleLowerCase()))return t;var o=[],a=-1;return n=n.replace(/([.*/]{1})/gim,"\\$1"),t.replace(new RegExp("".concat(n),"igm"),(function(e,n){return 0===o.length&&0!==n?o.push(t.slice(0,n)):a>=0&&o.push(t.slice(a+e.length,n)),o.push((0,i.createVNode)("span",{class:"is-keyword"},[e])),a=n,e})),a>=0&&o.push(t.slice(a+r)),o.length?o:t}(t.name)},localFooterBtns:a,resolveClassName:o}},render:function(){var e,t,n,r=this;return(0,i.createVNode)("div",{class:this.resolveClassName("search-select-menu")},[!!(null===(e=this.conditions)||void 0===e?void 0:e.length)&&(0,i.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,i.createVNode)("li",{key:e.id,class:"menu-header-item ".concat(e.disabled?"is-disabled":""),onClick:function(){return!e.disabled&&r.handleClickCondition(e)}},[e.name])}))]),(0,i.createVNode)("ul",{class:"menu-content"},[null===(t=this.list)||void 0===t?void 0:t.map((function(e){return(0,i.createVNode)("li",{class:"menu-item ".concat(e.disabled?"is-disabled":""," ").concat(r.hoverId!==e.id||e.disabled?"":"is-hover"),key:e.id,id:e.id,tabindex:"-1",onClick:function(){return!e.disabled&&r.handleClick(e)}},[r.$slots.default?r.$slots.default({item:e,list:r.list,multiple:!!r.multiple,hoverId:r.hoverId,getSearchNode:r.getSearchNode}):(0,i.createVNode)(i.Fragment,null,[r.getSearchNode(e),r.multiple&&r.selected.includes(e.id)&&(0,i.createVNode)(w.Done,{class:"is-selected"},null)])])}))]),this.multiple&&(null===(n=this.localFooterBtns)||void 0===n?void 0:n.length)&&(0,i.createVNode)("div",{class:"menu-footer"},[this.localFooterBtns.map((function(e){return(0,i.createVNode)("span",{class:"menu-footer-btn ".concat(e.disabled?"is-disabled":""),key:e.id,onClick:function(){return!e.disabled&&r.handleClickFooterBtn(e)}},[e.name])}))])])}});function I(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}var N;!function(e){e.ALL="all",e.NEEDKEY="need-key"}(N||(N={}));var V,O=Symbol("SEARCH_SLECT_PROVIDER_KEY"),z=function(){return(0,i.inject)(O)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(V||(V={}));var T=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"|";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.searchItem=t,this.type=n,this.splitCode=r,this.values=[],this.id=t.id,this.name=t.name}var t,n;return t=e,(n=[{key:"multiple",get:function(){return!!this.searchItem.multiple}},{key:"placeholder",get:function(){return this.searchItem.placeholder||""}},{key:"children",get:function(){return this.searchItem.children||[]}},{key:"validate",get:function(){return!this.searchItem.noValidate}},{key:"inputInnerHtml",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerHtml).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(this.splitCode))||"")}},{key:"inputInnerText",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerText).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(this.splitCode))||"")}},{key:"keyInnerHtml",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"keyInnerText",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"isSpecialType",value:function(){return["text","condition"].includes(this.type)}},{key:"addValue",value:function(e){if(this.multiple){var t=this.values.findIndex((function(t){return t.id===e.id}));return t>-1?void this.values.splice(t,1):void this.values.push(e)}this.values=[e]}},{key:"toValue",value:function(){var e,t={id:this.id,name:this.name};return(null===(e=this.values)||void 0===e?void 0:e.length)&&(t.values=this.values.map((function(e){return{id:e.id,name:e.name}}))),this.type&&"default"!==this.type&&(t.type=this.type),t}},{key:"toValueKey",value:function(){return JSON.stringify(this.toValue())}},{key:"isInValueList",value:function(e){return this.children.some((function(t){return t.id===(null==e?void 0:e.id)}))}}])&&I(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const j=(0,i.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:b.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:V.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup:function(t,n){var r=n.emit,o=n.expose,a=(0,_.useLocale)("searchSelect"),l=(0,_.usePrefix)().resolveClassName,u=(0,i.ref)(null),s=(0,i.ref)(null),c=(0,i.ref)(""),d=(0,i.ref)(!1),v=(0,i.ref)(!1),f=(0,i.ref)(!1),h=(0,i.ref)(t.defautUsingItem),p=(0,i.ref)(""),m=(0,i.ref)(!1),y=(0,e.debounce)(300,q),g=!1,b=(0,i.ref)([]),w=(0,i.ref)([]),x=z(),S=x.editKey,L=x.onValidate,C=x.valueSplitCode;function I(e){switch(e.code){case"ArrowDown":case"ArrowUp":O(e);break;case"Enter":case"NumpadEnter":!function(e){if(g){e.preventDefault();var t=w.value.find((function(e){return e.id===p.value}));t&&B(t)}}(e)}}function O(e){var t;e.preventDefault(),null===(t=u.value)||void 0===t||t.blur();for(var n=w.value.length,r=n,i=w.value.findIndex((function(e){return e.id===p.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var o=w.value[i];if(o&&!o.disabled){r=-1;var a=document.getElementById(o.id);return null==a||a.focus(),void(p.value=o.id)}r-=1}}function j(e){M(),e&&q()}function F(e){var n;return E(this,void 0,void 0,k().mark((function i(){var o,a,l,u,s;return k().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return null==e||e.preventDefault(),i.next=3,new Promise((function(e){return setTimeout(e,0)}));case 3:if(h.value){i.next=16;break}if(c.value&&t.valueBehavior!==N.NEEDKEY){i.next=6;break}return i.abrupt("return");case 6:return o={id:c.value,name:c.value},i.next=9,D(o);case 9:if(i.sent){i.next=12;break}return i.abrupt("return");case 12:return r("add",new T(o,"text",C.value)),c.value="",q(),i.abrupt("return");case 16:if(null==(a=h.value.values)?void 0:a.length){i.next=43;break}if(!(null===(n=c.value)||void 0===n?void 0:n.length)){i.next=41;break}if(!c.value.includes(C.value)){i.next=29;break}return l=c.value.split(C.value),i.next=23,D({id:c.value,name:c.value});case 23:if(i.sent){i.next=26;break}return i.abrupt("return");case 26:l.forEach((function(e){return h.value.addValue({id:e,name:e})})),i.next=36;break;case 29:return u={id:c.value,name:c.value},i.next=32,D(u);case 32:if(i.sent){i.next=35;break}return i.abrupt("return");case 35:h.value.addValue(u);case 36:return r("add",h.value),c.value="",h.value=null,M(!0),i.abrupt("return");case 41:return d.value=!0,i.abrupt("return");case 43:if(!c.value){i.next=56;break}return s={id:c.value,name:c.value},i.next=47,D(s);case 47:if(i.sent){i.next=50;break}return i.abrupt("return");case 50:return h.value.addValue(s),r("add",h.value),c.value="",h.value=null,M(!0),i.abrupt("return");case 56:return i.next=58,D();case 58:if(i.sent){i.next=61;break}return i.abrupt("return");case 61:K();case 62:case"end":return i.stop()}}),i)})))}function B(e,n){var r,i,o,a,l,s;return E(this,void 0,void 0,k().mark((function d(){var v,m;return k().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:if(!(null===(r=e.value)||void 0===r?void 0:r.id)){d.next=21;break}if((t.valueBehavior!==N.NEEDKEY||!e.value)&&t.validateValues){d.next=8;break}return(v=new T(Object.assign(Object.assign({},e),{id:null!==(i=e.realId)&&void 0!==i?i:e.id}),n,C.value)).addValue(e.value),K(v),t.valueBehavior===N.NEEDKEY&&p.value&&M(!0),p.value="",d.abrupt("return");case 8:return h.value=new T(Object.assign(Object.assign({},e),{id:null!==(o=e.realId)&&void 0!==o?o:e.id}),n,C.value),h.value.addValue(e.value),d.next=12,D(e.value);case 12:if(d.sent){d.next=16;break}return h.value=null,d.abrupt("return");case 16:return K(h.value),p.value="",M(!0),d.abrupt("return");case 21:if(h.value&&(null===(a=null==u?void 0:u.value)||void 0===a?void 0:a.innerText)){d.next=29;break}return h.value=new T(e,n,C.value),c.value="",(m="condition"===n)&&K(),f.value=m||!!h.value.children.length,M(t.valueBehavior===N.NEEDKEY&&!!p.value),d.abrupt("return");case 29:if("condition"!==(null===(l=h.value)||void 0===l?void 0:l.type)){d.next=33;break}return h.value=new T(e,n,C.value),K(),d.abrupt("return");case 33:return h.value.addValue(e),d.next=36,D(e);case 36:if(d.sent){d.next=39;break}return d.abrupt("return");case 39:h.value.multiple||K(),t.valueBehavior===N.NEEDKEY&&(null===(s=h.value)||void 0===s?void 0:s.multiple)&&M();case 41:case"end":return d.stop()}}),d)})))}function D(e){return E(this,void 0,void 0,k().mark((function n(){var r,i,o,a;return k().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(h.value){n.next=4;break}return n.next=3,A(null,[e]);case 3:case 8:return n.abrupt("return",n.sent);case 4:if(r=h.value,i=r.searchItem,o=r.validate,a=r.values,!o||"function"!=typeof t.validateValues){n.next=9;break}return n.next=8,A(i,e?[e]:a);case 9:return L(""),n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n)})))}function A(e,n){var r;return E(this,void 0,void 0,k().mark((function i(){var o;return k().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=t.validateValues)||void 0===r?void 0:r.call(t,null!=e?e:null,n).catch((function(){return!1}));case 2:if("string"!=typeof(o=i.sent)&&!1!==o){i.next=6;break}return L(o||"校验错误"),i.abrupt("return",!1);case 6:return L(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function M(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(0,i.nextTick)().then((function(){q()})),v.value=!0,f.value=!0,d.value=!1;var e=setTimeout((function(){if(u.value){u.value.focus();var t=window.getSelection();0===t.focusOffset&&(t.selectAllChildren(u.value),t.collapseToEnd())}window.clearTimeout(e)}),0);r("focus",v.value)}function q(){var n,r,i,o,a;return E(this,void 0,void 0,k().mark((function l(){var u,s;return k().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(u=[],"function"!=typeof t.getMenuList||void 0!==(null===(r=null===(n=h.value)||void 0===n?void 0:n.searchItem)||void 0===r?void 0:r.async)&&!0!==h.value.searchItem.async){l.next=9;break}return m.value=!0,l.next=5,t.getMenuList(null===(i=h.value)||void 0===i?void 0:i.searchItem,c.value).catch((function(){return[]}));case 5:u=l.sent,m.value=!1,l.next=10;break;case 9:(null==h?void 0:h.value)?"condition"===h.value.type?u=t.conditions:(null===(a=h.value.values)||void 0===a?void 0:a.length)&&!h.value.multiple&&t.mode!==V.EDIT||(u=h.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())}))):(null===(o=c.value)||void 0===o?void 0:o.length)?t.data.filter((function(e){return!e.isSelected})).forEach((function(t){var n,r;t.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())?(u.push(t),null===(n=t.children)||void 0===n||n.forEach((function(n){u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:{id:c.value,name:c.value}}))):(null===(r=t.children)||void 0===r||r.forEach((function(n){n.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())&&u.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),u.push(Object.assign(Object.assign({},t),{value:{id:c.value,name:c.value}})))})):u=t.data.filter((function(e){return!e.isSelected})).slice();case 10:w.value=u,t.valueBehavior===N.NEEDKEY&&(s=u.find((function(e){return!e.disabled})))&&(!p.value||p.value&&!u.some((function(e){return e.id===p.value})))&&(p.value=s.id);case 12:case"end":return l.stop()}}),l)})))}function K(e){r("add",null!=e?e:h.value),h.value=null,c.value="",M(t.valueBehavior===N.NEEDKEY)}function P(){var e=u.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(H(e.slice(0,-1)),P()):"\n"!==e[0]&&"\r"!==e[0]||(H(e.slice(1)),P())}function H(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u.value&&(u.value.innerHTML=t||(null===(e=h.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,i.watch)(S,(function(){t.mode===V.DEFAULT&&S.value&&(f.value=!1)})),(0,i.watchEffect)((function(){c.value||H()}),{flush:"pre"}),(0,i.watch)([w,f],(function(){var e;(null===(e=w.value)||void 0===e?void 0:e.some((function(e){return!e.disabled})))&&f.value?g||(t.valueBehavior===N.NEEDKEY?p.value=w.value.find((function(e){return!e.disabled})).id:p.value="",g=!0,document.addEventListener("keydown",I)):(document.removeEventListener("keydown",I),g=!1,t.valueBehavior!==N.NEEDKEY&&(p.value=""))})),o({handleInputFocus:j,isFocus:v}),{popoverRef:s,inputRef:u,keyword:c,loading:m,remoteMenuList:b,menuList:w,menuHoverId:p,isFocus:v,usingItem:h,showPopover:f,showNoSelectValueError:d,debounceSetMenuList:y,documentArrowEvent:O,handleClickOutside:function(e){var n,i;!(null===(n=s.value)||void 0===n?void 0:n.contains(e.target))&&(null===(i=t.clickOutside)||void 0===i?void 0:i.call(t,e.target,s.value))&&(f.value=!1,v.value=!1,r("focus",v.value))},handleInputFocus:j,handleInputChange:function(e){var t,n,r,i,o,a,l,s,d;P();var v=e.target.innerText;if(/(\r|\n)/gm.test(v)||/\s{2}/gm.test(v))e.preventDefault(),v=v.replace(/(\r|\n)/gm,C.value).replace(/\s{2}/gm,""),u.value.innerText=v,M(),c.value=v.replace((null===(t=h.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),y();else if(!c.value&&v.length<((null===(r=null===(n=h.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var f=v.replace(" "," ").replace((null===(i=h.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();if(v&&(null===(o=h.value)||void 0===o?void 0:o.keyInnerText)&&v.replace(" "," ").includes(h.value.keyInnerText.replace(" "," ").trim())&&f&&(null===(a=h.value.values)||void 0===a?void 0:a.length))return c.value=f,console.info("outerText",f),void y();!f&&(null==v?void 0:v.length)||(h.value=null),c.value=f?v:"",y()}else(null===(s=null===(l=h.value)||void 0===l?void 0:l.values)||void 0===s?void 0:s.length)||(c.value=v.replace(" "," ").replace((null===(d=h.value)||void 0===d?void 0:d.keyInnerText.replace(" "," "))||"","").trim(),M(),y())},handleInputKeyup:function(e){switch(e.code){case"Enter":case"NumpadEnter":if(t.valueBehavior===N.NEEDKEY&&w.value.some((function(e){return e.id===p.value})))return;F(e);break;case"Backspace":!function(){var e,n;if(!h.value&&!c.value)return r("delete"),void(0,i.nextTick)(q);if(null===(e=h.value)||void 0===e?void 0:e.values.length){if((null===(n=h.value)||void 0===n?void 0:n.multiple)||h.value.isInValueList(h.value.values[0])||t.mode===V.EDIT&&!c.value)return h.value.values.splice(-1,1),c.value="",void M()}else c.value||(h.value=null,c.value="",q());L("")}();default:d.value=!1}},handleSelectItem:B,handleSelectCondtionItem:function(e){B(e,"condition")},handleMenuFooterClick:function(e){var t;switch(e.id){case"confirm":if(!(null===(t=h.value)||void 0===t?void 0:t.values.length))return;c.value="",F();break;case"cancel":h.value.values=[],f.value=!1}},resolveClassName:l,t:a}},render:function(){var e,t,n=this,r=this.usingItem||{},o=r.multiple,a=r.values,l=r.placeholder,u=r.inputInnerHtml,s=!(null===(e=this.keyword)||void 0===e?void 0:e.length)&&!(null==a?void 0:a.length)&&l,c=this.loading||this.showNoSelectValueError||this.showPopover&&!!(null===(t=this.menuList)||void 0===t?void 0:t.length),d=!this.usingItem&&this.showCondition,v=Object.assign({},this.$slots.menu?{default:function(e){var t,r;return null===(r=(t=n.$slots).menu)||void 0===r?void 0:r.call(t,e)}}:{});return(0,i.createVNode)(L(),{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:c},{default:function(){var e;return(0,i.withDirectives)((0,i.createVNode)("div",{ref:"inputRef",class:{"div-input":!0,"input-before":n.showInputBefore&&!(null===(e=n.keyword)||void 0===e?void 0:e.length),"input-after":s},contenteditable:!0,"data-placeholder":u||n.keyword?"":n.placeholder,"data-tips":l||"",spellcheck:"false",onFocus:n.handleInputFocus,onInput:n.handleInputChange,onKeydown:n.handleInputKeyup},null),[[(0,i.resolveDirective)("clickoutside"),n.handleClickOutside]])},content:function(){var e;return n.loading?(0,i.createVNode)("div",null,[n.t.loading]):n.showNoSelectValueError?(0,i.createVNode)("div",null,[n.t.filterQueryMustHasValue]):(null===(e=n.menuList)||void 0===e?void 0:e.length)?(0,i.createVNode)("div",{ref:"popoverRef",class:n.resolveClassName("search-select-popover")},[(0,i.createVNode)(C,{list:n.menuList,keyword:n.keyword,multiple:!!o,hoverId:n.menuHoverId,selected:(null==a?void 0:a.map((function(e){return e.id})))||[],conditions:d?n.conditions:[],onSelectItem:n.handleSelectItem,onSelectCondition:n.handleSelectCondtionItem,onFooterClick:n.handleMenuFooterClick},Object.assign({},v))]):void 0}})}}),F=(0,i.defineComponent)({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:function(){return[]}},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup:function(e,t){var n=t.emit,r=(0,i.ref)(null),o=z(),a=o.onEditClick,l=o.onEditEnter,u=o.onEditBlur,s=o.editKey,c=o.valueSplitCode;return{inputRef:r,editKey:s,copySeletedItem:function(e){var t=new T(e.searchItem,e.type,c.value);return t.values=e.values.slice(),t},handleDeleteSelected:function(e){n("delete",e)},handleEditSeleted:function(e,t,n){e.preventDefault(),e.stopPropagation(),a(t,n),setTimeout((function(){return r.value.handleInputFocus()}),200)},handleInputOutside:function(){return!0},handleAddSelected:function(e,t){l(e,t)},handleInputFocus:function(e){e||u()}}},render:function(){var e=this,t=function(t,n){return e.editKey==="".concat(t.id,"_").concat(n)?(0,i.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,i.createVNode)(j,{ref:"inputRef",key:e.editKey.toString(),mode:V.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(t),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,valueBehavior:e.valueBehavior,onAdd:function(t){return e.handleAddSelected(t,n)},onFocus:e.handleInputFocus},null)]):(0,i.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?n<e.overflowIndex:n>=0)?"":"hidden-selected"),key:"".concat(t.id,"_").concat(n)},[(0,i.createVNode)("span",{class:"selected-name",onClick:function(r){return e.handleEditSeleted(r,t,n)}},[t.inputInnerText]),(0,i.createVNode)(w.Error,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(n)}},null)])};return(0,i.createVNode)(i.Fragment,null,[this.selectedList.map((function(n,r){return[e.overflowIndex>=0&&r===e.overflowIndex&&(0,i.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,i.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),t(n,r)]}))])}});var B={data:{type:Array,default:function(){return[]}},modelValue:{type:Array,default:function(){return[]}},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:function(){return[]}},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,valueSplitCode:{type:String,default:"|"},uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:N.ALL,validator:function(e){return[N.ALL,N.NEEDKEY].includes(e)}}};const D=(0,i.defineComponent)({name:"SearchSelect",directives:{clickoutside:b.clickoutside},props:B,emits:["update:modelValue","search"],setup:function(t,n){var r,o=n.emit,a=(0,_.useLocale)("searchSelect"),l=(0,_.usePrefix)().resolveClassName,u=(0,i.computed)((function(){return void 0===t.conditions?[{id:"or",name:a.value.or},{id:"and",name:a.value.and}]:t.conditions})),s=(0,i.ref)(null),c=(0,i.ref)(null),d=(0,i.ref)(!1),p=(0,i.ref)([]),y=(0,i.ref)(-1),g=(0,e.debounce)(32,C),b=(0,i.ref)(""),w=(0,i.ref)(""),x=(0,i.computed)((function(){return t.valueSplitCode})),k=(0,i.shallowRef)([]);function E(e,t){b.value="".concat(e.id,"_").concat(t)}function S(e,t){var n=p.value.slice();n.splice(t,1,e),o("update:modelValue",n.map((function(e){return e.toValue()}))),b.value=""}function L(e){w.value=e||""}function C(){if(d.value||p.value.length<1)y.value=-1;else{for(var e=c.value.querySelector(".".concat(l("search-select-container"))),n=c.value.querySelector(".search-container").clientWidth-6-2,r=e.querySelectorAll(".search-container-selected:not(.overflow-selected)"),i=0,o=0,a=0;0===o&&i<=n-40&&a<=r.length-1;){var u=r[a];if(u.clientHeight>t.minHeight)return void(y.value=a);(i+=u?u.clientWidth+6:0)>=n-40&&(o=a),a+=1}o===r.length-1&&i<=n?y.value=-1:y.value=i>=n-40?o:o-1}}return(0,i.watch)((function(){return t.data}),(function(){var e;k.value=JSON.parse(JSON.stringify(t.data)),null===(e=k.value)||void 0===e||e.forEach((function(e){e.isSelected=t.uniqueSelect&&!!t.modelValue.some((function(t){return t.id===e.id}))}))}),{immediate:!0}),(0,i.watch)((function(){return t.modelValue}),(function(e){var n,r;if(!(null==e?void 0:e.length))return p.value=[],void(null===(n=k.value)||void 0===n||n.forEach((function(e){e.isSelected=!1})));var i=[];e.forEach((function(e){var n,r=p.value.find((function(t){return t.id===e.id&&t.name===e.name}));if((null==r?void 0:r.toValueKey())===JSON.stringify(e))r.values=e.values||[],i.push(r);else{var o=t.data.find((function(t){return t.id===e.id})),a="default";o||(o=t.conditions.find((function(t){return t.id===e.id})))&&(a="condition"),o||(null===(n=e.values)||void 0===n?void 0:n.length)||(a="text");var l=new T(o||e,a,x.value);l.values=e.values||[],i.push(l)}})),p.value=i,null===(r=k.value)||void 0===r||r.forEach((function(e){e.isSelected=t.uniqueSelect&&!!i.some((function(t){return t.id===e.id}))}))}),{immediate:!0,deep:!0}),(0,i.onMounted)((function(){h(c.value.querySelector(".".concat(l("search-select-container"))),g)})),(0,i.onBeforeUnmount)((function(){!function(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",m),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}! --v&&f&&f.parentNode.removeChild(f)}}(c.value.querySelector(".".concat(l("search-select-container"))),g)})),r={onEditClick:E,onEditEnter:S,onEditBlur:function(){b.value="",L("")},onValidate:L,editKey:b,valueSplitCode:x},(0,i.provide)(O,r),{inputRef:s,wrapRef:c,isFocus:d,copyData:k,selectedList:p,overflowIndex:y,validateStr:w,splitCode:x,onEditClick:E,onEditEnter:S,handleWrapClick:function(){b.value||s.value.handleInputFocus()},handleInputFocus:function(e){var t;e&&(y.value=-1),!1===e&&(null===(t=c.value.querySelector(".".concat(l("search-select-container"))))||void 0===t||t.scrollTo(0,0)),d.value=e},handleResize:C,handleClearAll:function(){p.value=[],y.value=-1,o("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=c.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=p.value.slice();t.push(e),L(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=p.value.slice();t.splice("number"==typeof e?e:p.value.length-1,1),L(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleClickSearch:function(e){o("search",e)},localConditions:u,resolveClassName:l,t:a}},render:function(){var e,t,n,o=this,a="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),l=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,u=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=o.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,i.createVNode)("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[(0,i.createVNode)("div",{class:(e={},r(e,this.resolveClassName("search-select-container"),!0),r(e,"is-focus",this.isFocus),e),onClick:this.handleWrapClick},[(0,i.createVNode)("div",{class:"search-prefix"},[null===(n=(t=this.$slots).prepend)||void 0===n?void 0:n.call(t)]),(0,i.createVNode)("div",{class:"search-container",style:{maxHeight:a}},[(0,i.createVNode)(F,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},Object.assign({},u)),(0,i.createVNode)("div",{class:"search-container-input"},[(0,i.createVNode)(j,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:l,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},u))])]),(0,i.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,i.createVNode)(w.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,i.createVNode)(w.Search,{onClick:this.handleClickSearch,class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,i.createVNode)("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)(w.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var A=(0,e.withInstall)(D);const M=A})(),s})()));
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"),require("../checkbox"),require("../radio"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../directives","../icon","../popover","../checkbox","../radio"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"),require("../popover"),require("../checkbox"),require("../radio")):t(e["../shared"],e.vue,e["../config-provider"],e["../directives"],e["../icon"],e["../popover"],e["../checkbox"],e["../radio"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r,i,o,a,l)=>(()=>{var u={5800:e=>{"use strict";e.exports=a},2717:e=>{"use strict";e.exports=n},4061:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=i},5537:e=>{"use strict";e.exports=o},8900:e=>{"use strict";e.exports=l},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t},7609:(e,t,n)=>{var r=n(7425).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",s=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function v(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),l=new I(r||[]);return a(o,"_invoke",{value:E(e,n,l)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=v;var h={};function p(){}function m(){}function g(){}var y={};d(y,u,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(N([])));b&&b!==n&&o.call(b,u)&&(y=b);var w=g.prototype=p.prototype=Object.create(y);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(i,a,l,u){var c=f(e[i],e,a);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==r(d)&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,l,u)}),(function(e){n("throw",e,l,u)})):t.resolve(d).then((function(e){s.value=e,l(s)}),(function(e){return n("throw",e,l,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function E(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var l=S(a,n);if(l){if(l===h)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=f(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function N(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:V}}function V(){return{value:void 0,done:!0}}return m.prototype=g,a(w,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:m,configurable:!0}),m.displayName=d(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,d(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(k.prototype),d(k.prototype,c,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new k(v(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(w),d(w,s,"Generator"),d(w,u,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,n)=>{var r=n(7609)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},c={};function s(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return u[e](n,n.exports,s),n.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return(()=>{"use strict";s.r(d),s.d(d,{BkSearchSelect:()=>K,default:()=>H});var e=s(4212);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(n)?n:String(n)}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=s(748),o=null,a=null;function l(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function u(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function c(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===u(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var v=0,f=null;function h(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=p.bind(e)),!e.__resize_listeners__)if(e.__resize_listeners__=[],window.ResizeObserver){var n=e.offsetWidth,r=e.offsetHeight,i=new ResizeObserver((function(){(e.__resize_observer_triggered__||(e.__resize_observer_triggered__=!0,e.offsetWidth!==n||e.offsetHeight!==r))&&g(e)})),o=c(e),a=o.detached,s=o.rendered;e.__resize_observer_triggered__=!1===a&&!1===s,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){g(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(v||(f=function(e){var t=document.createElement("style");return t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),(document.querySelector("head")||document.body).appendChild(t),t}('.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}')),function(e){var t=u(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=l("div",{className:"resize-triggers"}),r=l("div",{className:"resize-expand-trigger"}),i=l("div"),o=l("div",{className:"resize-contract-trigger"});r.appendChild(i),n.appendChild(r),n.appendChild(o),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:i,contract:o},y(e),e.addEventListener("scroll",m,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=c(e).rendered,window.MutationObserver){var d=new MutationObserver(e.__resize_mutation_handler__);d.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=d}e.__resize_listeners__.push(t),v++}function p(){var e=c(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(y(this),this.addEventListener("scroll",m,!0)),this.__resize_rendered__=t,g(this))}function m(){var e,t,n=this;y(this),this.__resize_raf__&&(e=this.__resize_raf__,a||(a=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),a(e)),this.__resize_raf__=(t=function(){var e,t,r,i,o,a,l=(r=(t=(e=n).__resize_last__).width,i=t.height,o=e.offsetWidth,a=e.offsetHeight,o!==r||a!==i?{width:o,height:a}:null);l&&(n.__resize_last__=l,g(n))},o||(o=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),o(t))}function g(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function y(e){var t=e.__resize_triggers__,n=t.expand,r=t.expandChild,i=t.contract,o=i.scrollWidth,a=i.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,c=n.scrollWidth,s=n.scrollHeight;i.scrollLeft=o,i.scrollTop=a,r.style.width=l+1+"px",r.style.height=u+1+"px",n.scrollLeft=c,n.scrollTop=s}var _=s(2717),b=s(4061),w=s(6870),x=s(2841),k=s.n(x);function E(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}u((r=r.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var S,L=s(5537),C=s.n(L),I=s(5800),N=s.n(I),V=s(8900),O=s.n(V);function z(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}!function(e){e.ALL="all",e.NEEDKEY="need-key"}(S||(S={}));var T,j,F=Symbol("SEARCH_SLECT_PROVIDER_KEY"),D=function(){return(0,i.inject)(F)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(T||(T={})),function(e){e.AND="&",e.OR="|"}(j||(j={}));var A=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.searchItem=t,this.type=n,this.values=[],this.id=t.id,this.name=t.name,this.logical=t.logical||j.OR}var t,n;return t=e,(n=[{key:"multiple",get:function(){return!!this.searchItem.multiple}},{key:"placeholder",get:function(){return this.searchItem.placeholder||""}},{key:"children",get:function(){return this.searchItem.children||[]}},{key:"validate",get:function(){return!this.searchItem.noValidate}},{key:"inputInnerHtml",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerHtml).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(" ".concat(this.logical," ")))||"")}},{key:"inputInnerText",get:function(){var e;return this.isSpecialType()?this.name:"".concat(this.keyInnerText).concat((null===(e=this.values)||void 0===e?void 0:e.map((function(e){return e.name})).join(" ".concat(this.logical," ")))||"")}},{key:"keyInnerHtml",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"keyInnerText",get:function(){return this.isSpecialType()?this.name:this.name?"".concat(this.name,": "):""}},{key:"showLogical",get:function(){return!!this.searchItem.showLogicalPanel}},{key:"isSpecialType",value:function(){return["text","condition"].includes(this.type)}},{key:"addValue",value:function(e){if(this.multiple){var t=this.values.findIndex((function(t){return t.id===e.id}));return t>-1?void this.values.splice(t,1):void this.values.push(e)}this.values=[e]}},{key:"toValue",value:function(){var e,t={id:this.id,name:this.name};return(null===(e=this.values)||void 0===e?void 0:e.length)&&(t.values=this.values.map((function(e){return{id:e.id,name:e.name}})),this.multiple&&this.logical!==j.OR&&(t.logical=this.logical)),this.type&&"default"!==this.type&&(t.type=this.type),t}},{key:"toValueKey",value:function(){return JSON.stringify(this.toValue())}},{key:"isInValueList",value:function(e){return this.children.some((function(t){return t.id===(null==e?void 0:e.id)}))}}])&&z(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const B=(0,i.defineComponent)({name:"SearchSelectMenu",props:{list:{type:Array},hoverId:String,keyword:{type:String,default:""},multiple:{type:Boolean,default:!1},selected:{type:Array,default:function(){return[]}},conditions:{type:Array},footerBtns:{type:Array,default:function(){return[]}},showLogical:{type:Boolean,default:!0},logical:{type:String,default:j.OR}},emits:["selectItem","selectCondition","footerClick","update:logical"],setup:function(e,t){var n=t.emit,r=(0,_.useLocale)("searchSelect"),o=(0,_.usePrefix)().resolveClassName,a=(0,i.computed)((function(){return void 0===e.footerBtns||0===e.footerBtns.length?[{id:"confirm",name:r.value.ok},{id:"cancel",name:r.value.cancel,disabled:!1}]:e.footerBtns}));function l(e){n("selectItem",e)}return{handleClick:l,handleClickCondition:function(e){n("selectCondition",e)},handleClickFooterBtn:function(e){n("footerClick",e)},handleSelectedChange:function(e,t){e.stopPropagation(),e.preventDefault(),l(t)},handleLogicalChange:function(e){n("update:logical",e)},filterList:(0,i.computed)((function(){var t,n;return(null===(t=e.list)||void 0===t?void 0:t.length)?(null===(n=e.keyword)||void 0===n?void 0:n.length)?e.list.filter((function(t){return t.name.toLocaleLowerCase().includes(e.keyword.toLocaleLowerCase())})):e.list:[]})),getSearchNode:function(t){var n;return(null===(n=t.value)||void 0===n?void 0:n.name)?[(0,i.createVNode)("span",{class:"menu-name"},[t.name,(0,i.createTextVNode)(":")]),t.value.name]:function(t){if(!t)return t;var n=e.keyword,r=n.length;if(!(null==n?void 0:n.trim().length)||!t.toLocaleLowerCase().includes(n.toLocaleLowerCase()))return t;var o=[],a=-1;return n=n.replace(/([.*/]{1})/gim,"\\$1"),t.replace(new RegExp("".concat(n),"igm"),(function(e,n){return 0===o.length&&0!==n?o.push(t.slice(0,n)):a>=0&&o.push(t.slice(a+e.length,n)),o.push((0,i.createVNode)("span",{class:"is-keyword"},[e])),a=n,e})),a>=0&&o.push(t.slice(a+r)),o.length?o:t}(t.name)},localFooterBtns:a,resolveClassName:o,t:r}},render:function(){var e,t,n=this,r=(0,i.createVNode)("ul",{class:"menu-content"},[null===(e=this.list)||void 0===e?void 0:e.map((function(e){return(0,i.createVNode)("li",{class:"menu-item ".concat(e.disabled?"is-disabled":""," ").concat(n.hoverId!==e.id||e.disabled?"":"is-hover"),key:e.id,id:e.id,tabindex:"-1",onClick:function(){return!e.disabled&&n.handleClick(e)}},[n.$slots.default?n.$slots.default({item:e,list:n.list,multiple:!!n.multiple,hoverId:n.hoverId,getSearchNode:n.getSearchNode}):(0,i.createVNode)(i.Fragment,null,[n.multiple&&(0,i.createVNode)("span",{onClick:function(t){return n.handleSelectedChange(t,e)}},[(0,i.createVNode)(N(),{modelValue:n.selected.includes(e.id),class:"is-selected"},null)]),n.getSearchNode(e)])])}))]);return(0,i.createVNode)("div",{class:this.resolveClassName("search-select-menu")},[!!(null===(t=this.conditions)||void 0===t?void 0:t.length)&&(0,i.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,i.createVNode)("li",{key:e.id,class:"menu-header-item ".concat(e.disabled?"is-disabled":""),onClick:function(){return!e.disabled&&n.handleClickCondition(e)}},[e.name])}))]),n.showLogical&&n.multiple?(0,i.createVNode)("div",{class:"menu-content-wrapper"},[r,(0,i.createVNode)("div",{class:"menu-condition"},[(0,i.createVNode)("div",{class:"menu-condition-title"},[n.t.logical]),(0,i.createVNode)(O(),{modelValue:n.logical,onChange:n.handleLogicalChange,label:"|"},{default:function(){return[n.t.or,(0,i.createTextVNode)(" |")]}}),(0,i.createVNode)(O(),{modelValue:n.logical,onChange:n.handleLogicalChange,label:"&"},{default:function(){return[n.t.and,(0,i.createTextVNode)(" &")]}})])]):r])}}),R=(0,i.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:b.clickoutside},props:{data:{type:Array,required:!0},showInputBefore:Boolean,showCondition:Boolean,clickOutside:Function,placeholder:String,conditions:{type:Array,default:function(){return[]}},defautUsingItem:Object,mode:{type:String,default:T.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup:function(t,n){var r=n.emit,o=n.expose,a=(0,_.useLocale)("searchSelect"),l=(0,_.usePrefix)().resolveClassName,u=(0,i.ref)(null),c=(0,i.ref)(null),s=(0,i.ref)(""),d=(0,i.ref)(!1),v=(0,i.ref)(!1),f=(0,i.ref)(!1),h=(0,i.ref)(t.defautUsingItem),p=(0,i.ref)(""),m=(0,i.ref)(!1),g=(0,e.debounce)(300,M),y=!1,b=(0,i.ref)([]),w=(0,i.ref)([]),x=D(),L=x.editKey,C=x.onValidate,I=(0,i.computed)((function(){var e;return(null===(e=h.value)||void 0===e?void 0:e.logical)||j.OR}));function N(e){switch(e.code){case"ArrowDown":case"ArrowUp":V(e);break;case"Enter":case"NumpadEnter":!function(e){if(y){e.preventDefault();var t=w.value.find((function(e){return e.id===p.value}));t&&F(t)}}(e)}}function V(e){var t;e.preventDefault(),null===(t=u.value)||void 0===t||t.blur();for(var n=w.value.length,r=n,i=w.value.findIndex((function(e){return e.id===p.value}));r>=0;){i=(i="ArrowDown"===e.code?i+1:i-1)>n-1?0:i<0?n-1:i;var o=w.value[i];if(o&&!o.disabled){r=-1;var a=document.getElementById(o.id);return null==a||a.focus(),void(p.value=o.id)}r-=1}}function O(e){q(),e&&M()}function z(e){var n;return E(this,void 0,void 0,k().mark((function i(){var o,a,l,u,c;return k().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return null==e||e.preventDefault(),i.next=3,new Promise((function(e){return setTimeout(e,0)}));case 3:if(h.value){i.next=16;break}if(s.value&&t.valueBehavior!==S.NEEDKEY){i.next=6;break}return i.abrupt("return");case 6:return o={id:s.value,name:s.value},i.next=9,B(o);case 9:if(i.sent){i.next=12;break}return i.abrupt("return");case 12:return r("add",new A(o,"text")),s.value="",M(),i.abrupt("return");case 16:if(null==(a=h.value.values)?void 0:a.length){i.next=43;break}if(!(null===(n=s.value)||void 0===n?void 0:n.length)){i.next=41;break}if(!s.value.includes(I.value)){i.next=29;break}return l=s.value.split(I.value),i.next=23,B({id:s.value,name:s.value});case 23:if(i.sent){i.next=26;break}return i.abrupt("return");case 26:l.forEach((function(e){return h.value.addValue({id:e,name:e})})),i.next=36;break;case 29:return u={id:s.value,name:s.value},i.next=32,B(u);case 32:if(i.sent){i.next=35;break}return i.abrupt("return");case 35:h.value.addValue(u);case 36:return r("add",h.value),s.value="",h.value=null,q(!0),i.abrupt("return");case 41:return d.value=!0,i.abrupt("return");case 43:if(!s.value){i.next=56;break}return c={id:s.value,name:s.value},i.next=47,B(c);case 47:if(i.sent){i.next=50;break}return i.abrupt("return");case 50:return h.value.addValue(c),r("add",h.value),s.value="",h.value=null,q(!0),i.abrupt("return");case 56:return i.next=58,B();case 58:if(i.sent){i.next=61;break}return i.abrupt("return");case 61:P();case 62:case"end":return i.stop()}}),i)})))}function F(e,n){var r,i,o,a,l,c;return E(this,void 0,void 0,k().mark((function d(){var v,m;return k().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:if(!(null===(r=e.value)||void 0===r?void 0:r.id)){d.next=20;break}if((t.valueBehavior!==S.NEEDKEY||!e.value)&&t.validateValues){d.next=8;break}return(v=new A(Object.assign(Object.assign({},e),{id:null!==(i=e.realId)&&void 0!==i?i:e.id}),n)).addValue(e.value),P(v),t.valueBehavior===S.NEEDKEY&&p.value&&q(!0),p.value="",d.abrupt("return");case 8:return h.value=new A(Object.assign(Object.assign({},e),{id:null!==(o=e.realId)&&void 0!==o?o:e.id}),n),h.value.addValue(e.value),d.next=12,B(e.value);case 12:if(d.sent){d.next=16;break}return h.value=null,d.abrupt("return");case 16:return P(h.value),p.value="",q(!0),d.abrupt("return");case 20:if(h.value&&(null===(a=null==u?void 0:u.value)||void 0===a?void 0:a.innerText)){d.next=28;break}return h.value=new A(e,n),s.value="",(m="condition"===n)&&P(),f.value=m||!!h.value.children.length,q(t.valueBehavior===S.NEEDKEY&&!!p.value),d.abrupt("return");case 28:if("condition"!==(null===(l=h.value)||void 0===l?void 0:l.type)){d.next=32;break}return h.value=new A(e,n),P(),d.abrupt("return");case 32:return h.value.addValue(e),d.next=35,B(e);case 35:if(d.sent){d.next=38;break}return d.abrupt("return");case 38:h.value.multiple||P(),t.valueBehavior===S.NEEDKEY&&(null===(c=h.value)||void 0===c?void 0:c.multiple)&&q();case 40:case"end":return d.stop()}}),d)})))}function B(e){return E(this,void 0,void 0,k().mark((function n(){var r,i,o,a;return k().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(h.value){n.next=4;break}return n.next=3,R(null,[e]);case 3:case 8:return n.abrupt("return",n.sent);case 4:if(r=h.value,i=r.searchItem,o=r.validate,a=r.values,!o||"function"!=typeof t.validateValues){n.next=9;break}return n.next=8,R(i,e?[e]:a);case 9:return C(""),n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n)})))}function R(e,n){var r;return E(this,void 0,void 0,k().mark((function i(){var o;return k().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,null===(r=t.validateValues)||void 0===r?void 0:r.call(t,null!=e?e:null,n).catch((function(){return!1}));case 2:if("string"!=typeof(o=i.sent)&&!1!==o){i.next=6;break}return C(o||"校验错误"),i.abrupt("return",!1);case 6:return C(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function q(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(0,i.nextTick)().then((function(){M()})),v.value=!0,f.value=!0,d.value=!1;var e=setTimeout((function(){if(u.value){u.value.focus();var t=window.getSelection();0===t.focusOffset&&(t.selectAllChildren(u.value),t.collapseToEnd())}window.clearTimeout(e)}),0);r("focus",v.value)}function M(){var n,r,i,o,a;return E(this,void 0,void 0,k().mark((function l(){var u,c;return k().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(u=[],"function"!=typeof t.getMenuList||void 0!==(null===(r=null===(n=h.value)||void 0===n?void 0:n.searchItem)||void 0===r?void 0:r.async)&&!0!==h.value.searchItem.async){l.next=9;break}return m.value=!0,l.next=5,t.getMenuList(null===(i=h.value)||void 0===i?void 0:i.searchItem,s.value).catch((function(){return[]}));case 5:u=l.sent,m.value=!1,l.next=10;break;case 9:(null==h?void 0:h.value)?"condition"===h.value.type?u=t.conditions:(null===(a=h.value.values)||void 0===a?void 0:a.length)&&!h.value.multiple&&t.mode!==T.EDIT||(u=h.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(s.value.toLocaleLowerCase())}))):(null===(o=s.value)||void 0===o?void 0:o.length)?t.data.filter((function(e){return!e.isSelected})).forEach((function(t){var n,r;if(t.name.toLocaleLowerCase().includes(s.value.toLocaleLowerCase())){var i;u.push(t);var o=[];null===(n=t.children)||void 0===n||n.forEach((function(n){o.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),!o.length&&!t.onlyRecommendChildren&&o.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:{id:s.value,name:s.value}})),(i=u).push.apply(i,o)}else{var a,l=[];null===(r=t.children)||void 0===r||r.forEach((function(n){n.name.toLocaleLowerCase().includes(s.value.toLocaleLowerCase())&&l.push(Object.assign(Object.assign({},t),{realId:t.id,id:(0,e.random)(10),value:n}))})),!l.length&&!t.onlyRecommendChildren&&l.push(Object.assign(Object.assign({},t),{value:{id:s.value,name:s.value}})),(a=u).push.apply(a,l)}})):u=t.data.filter((function(e){return!e.isSelected})).slice();case 10:w.value=u,t.valueBehavior===S.NEEDKEY&&(c=u.find((function(e){return!e.disabled})))&&(!p.value||p.value&&!u.some((function(e){return e.id===p.value})))&&(p.value=c.id);case 12:case"end":return l.stop()}}),l)})))}function P(e){r("add",null!=e?e:h.value),h.value=null,s.value="",q(t.valueBehavior===S.NEEDKEY)}function K(){var e=u.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(H(e.slice(0,-1)),K()):"\n"!==e[0]&&"\r"!==e[0]||(H(e.slice(1)),K())}function H(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u.value&&(u.value.innerHTML=t||(null===(e=h.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,i.watch)(L,(function(){t.mode===T.DEFAULT&&L.value&&(f.value=!1)})),(0,i.watchEffect)((function(){s.value||H()}),{flush:"pre"}),(0,i.watch)([w,f],(function(){var e;(null===(e=w.value)||void 0===e?void 0:e.some((function(e){return!e.disabled})))&&f.value?y||(t.valueBehavior===S.NEEDKEY?p.value=w.value.find((function(e){return!e.disabled})).id:p.value="",y=!0,document.addEventListener("keydown",N)):(document.removeEventListener("keydown",N),y=!1,t.valueBehavior!==S.NEEDKEY&&(p.value=""))})),o({handleInputFocus:O,isFocus:v}),{popoverRef:c,inputRef:u,keyword:s,loading:m,remoteMenuList:b,menuList:w,menuHoverId:p,isFocus:v,usingItem:h,showPopover:f,showNoSelectValueError:d,debounceSetMenuList:g,documentArrowEvent:V,handleClickOutside:function(e){var n,i,o,a,l;if(!(null===(n=c.value)||void 0===n?void 0:n.contains(e.target))&&(null===(i=t.clickOutside)||void 0===i?void 0:i.call(t,e.target,c.value))){if((null===(a=null===(o=h.value)||void 0===o?void 0:o.values)||void 0===a?void 0:a.length)&&(null===(l=h.value)||void 0===l?void 0:l.multiple))return s.value="",void z();f.value=!1,v.value=!1,r("focus",v.value)}},handleInputFocus:O,handleInputChange:function(e){var t,n,r,i,o,a,l,c,d;K();var v=e.target.innerText;if(/(\r|\n)/gm.test(v)||/\s{2}/gm.test(v))e.preventDefault(),v=v.replace(/(\r|\n)/gm," ".concat(I.value," ")).replace(/\s{2}/gm,""),u.value.innerText=v,q(),s.value=v.replace((null===(t=h.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),g();else if(!s.value&&v.length<((null===(r=null===(n=h.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var f=v.replace(" "," ").replace((null===(i=h.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();if(v&&(null===(o=h.value)||void 0===o?void 0:o.keyInnerText)&&v.replace(" "," ").includes(h.value.keyInnerText.replace(" "," ").trim())&&f&&(null===(a=h.value.values)||void 0===a?void 0:a.length))return s.value=f,console.info("outerText",f),void g();!f&&(null==v?void 0:v.length)||(h.value=null),s.value=f?v:"",g()}else(null===(c=null===(l=h.value)||void 0===l?void 0:l.values)||void 0===c?void 0:c.length)||(s.value=v.replace(" "," ").replace((null===(d=h.value)||void 0===d?void 0:d.keyInnerText.replace(" "," "))||"","").trim(),q(),g())},handleLogicalChange:function(e){h.value&&(h.value.logical=e)},handleInputKeyup:function(e){switch(e.code){case"Enter":case"NumpadEnter":if(t.valueBehavior===S.NEEDKEY&&w.value.some((function(e){return e.id===p.value})))return;z(e);break;case"Backspace":!function(){var e,n;if(!h.value&&!s.value)return r("delete"),void(0,i.nextTick)(M);if(null===(e=h.value)||void 0===e?void 0:e.values.length){if((null===(n=h.value)||void 0===n?void 0:n.multiple)||h.value.isInValueList(h.value.values[0])||t.mode===T.EDIT&&!s.value)return h.value.values.splice(-1,1),s.value="",void q()}else s.value||(h.value=null,s.value="",M());C("")}();default:d.value=!1}},handleSelectItem:F,handleSelectCondtionItem:function(e){F(e,"condition")},handleMenuFooterClick:function(e){var t;switch(e.id){case"confirm":if(!(null===(t=h.value)||void 0===t?void 0:t.values.length))return;s.value="",z();break;case"cancel":h.value.values=[],f.value=!1}},resolveClassName:l,t:a}},render:function(){var e,t,n=this,r=this.usingItem||{},o=r.multiple,a=r.values,l=r.placeholder,u=r.inputInnerHtml,c=!(null===(e=this.keyword)||void 0===e?void 0:e.length)&&!(null==a?void 0:a.length)&&l,s=this.loading||this.showNoSelectValueError||this.showPopover&&!!(null===(t=this.menuList)||void 0===t?void 0:t.length),d=!this.usingItem&&this.showCondition,v=Object.assign({},this.$slots.menu?{default:function(e){var t,r;return null===(r=(t=n.$slots).menu)||void 0===r?void 0:r.call(t,e)}}:{});return(0,i.createVNode)(C(),{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:s},{default:function(){var e;return(0,i.withDirectives)((0,i.createVNode)("div",{ref:"inputRef",class:{"div-input":!0,"input-before":n.showInputBefore&&!(null===(e=n.keyword)||void 0===e?void 0:e.length),"input-after":c},contenteditable:!0,"data-placeholder":u||n.keyword?"":n.placeholder,"data-tips":l||"",spellcheck:"false",onFocus:n.handleInputFocus,onInput:n.handleInputChange,onKeydown:n.handleInputKeyup},null),[[(0,i.resolveDirective)("clickoutside"),n.handleClickOutside]])},content:function(){var e,t,r;return n.loading?(0,i.createVNode)("div",null,[n.t.loading]):n.showNoSelectValueError?(0,i.createVNode)("div",null,[n.t.filterQueryMustHasValue]):(null===(e=n.menuList)||void 0===e?void 0:e.length)?(0,i.createVNode)("div",{ref:"popoverRef",class:n.resolveClassName("search-select-popover")},[(0,i.createVNode)(B,{list:n.menuList,keyword:n.keyword,multiple:!!o,hoverId:n.menuHoverId,selected:(null==a?void 0:a.map((function(e){return e.id})))||[],conditions:d?n.conditions:[],logical:null===(t=n.usingItem)||void 0===t?void 0:t.logical,showLogical:null===(r=n.usingItem)||void 0===r?void 0:r.showLogical,"onUpdate:logical":n.handleLogicalChange,onSelectItem:n.handleSelectItem,onSelectCondition:n.handleSelectCondtionItem,onFooterClick:n.handleMenuFooterClick},Object.assign({},v))]):void 0}})}}),q=(0,i.defineComponent)({name:"SearchSelected",props:{data:{type:Array,required:!0},selectedList:{type:Array,required:!0},overflowIndex:{type:Number,default:-1},conditions:{type:Array,default:function(){return[]}},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["delete"],setup:function(e,t){var n=t.emit,r=(0,i.ref)(null),o=D(),a=o.onEditClick,l=o.onEditEnter,u=o.onEditBlur,c=o.editKey;return{inputRef:r,editKey:c,copySeletedItem:function(e){var t=new A(e.searchItem,e.type);return t.values=e.values.slice(),t.logical=e.logical||j.OR,t},handleDeleteSelected:function(e){n("delete",e)},handleEditSeleted:function(e,t,n){e.preventDefault(),e.stopPropagation(),a(t,n),setTimeout((function(){return r.value.handleInputFocus()}),200)},handleInputOutside:function(){return!0},handleAddSelected:function(e,t){l(e,t)},handleInputFocus:function(e){e||u()}}},render:function(){var e=this,t=function(t,n){return e.editKey==="".concat(t.id,"_").concat(n)?(0,i.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,i.createVNode)(R,{ref:"inputRef",key:e.editKey.toString(),mode:T.EDIT,data:e.data,showCondition:!1,conditions:e.conditions,defautUsingItem:e.copySeletedItem(t),clickOutside:e.handleInputOutside,getMenuList:e.getMenuList,validateValues:e.validateValues,valueBehavior:e.valueBehavior,onAdd:function(t){return e.handleAddSelected(t,n)},onFocus:e.handleInputFocus},null)]):(0,i.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?n<e.overflowIndex:n>=0)?"":"hidden-selected"),key:"".concat(t.id,"_").concat(n)},[(0,i.createVNode)("span",{class:"selected-name",onClick:function(r){return e.handleEditSeleted(r,t,n)}},[t.inputInnerText]),(0,i.createVNode)(w.Error,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(n)}},null)])};return(0,i.createVNode)(i.Fragment,null,[this.selectedList.map((function(n,r){return[e.overflowIndex>=0&&r===e.overflowIndex&&(0,i.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,i.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),t(n,r)]}))])}});var M={data:{type:Array,default:function(){return[]}},modelValue:{type:Array,default:function(){return[]}},shrink:{type:Boolean,default:!0},maxHeight:{type:Number,default:120},minHeight:{type:Number,default:26},conditions:{type:Array,default:function(){return[]}},clearable:{type:Boolean,default:!0},placeholder:String,getMenuList:Function,validateValues:Function,uniqueSelect:{type:Boolean,default:!1},valueBehavior:{type:String,default:S.ALL,validator:function(e){return[S.ALL,S.NEEDKEY].includes(e)}}};const P=(0,i.defineComponent)({name:"SearchSelect",directives:{clickoutside:b.clickoutside},props:M,emits:["update:modelValue","search"],setup:function(t,n){var r,o=n.emit,a=(0,_.useLocale)("searchSelect"),l=(0,_.usePrefix)().resolveClassName,u=(0,i.computed)((function(){return void 0===t.conditions?[{id:"or",name:a.value.or},{id:"and",name:a.value.and}]:t.conditions})),c=(0,i.ref)(null),s=(0,i.ref)(null),d=(0,i.ref)(!1),p=(0,i.ref)([]),g=(0,i.ref)(-1),y=(0,e.debounce)(32,L),b=(0,i.ref)(""),w=(0,i.ref)(""),x=(0,i.shallowRef)([]);function k(e,t){b.value="".concat(e.id,"_").concat(t)}function E(e,t){var n=p.value.slice();n.splice(t,1,e),o("update:modelValue",n.map((function(e){return e.toValue()}))),b.value=""}function S(e){w.value=e||""}function L(){if(d.value||p.value.length<1)g.value=-1;else{for(var e=s.value.querySelector(".".concat(l("search-select-container"))),n=s.value.querySelector(".search-container").clientWidth-6-2,r=e.querySelectorAll(".search-container-selected:not(.overflow-selected)"),i=0,o=0,a=0;0===o&&i<=n-40&&a<=r.length-1;){var u=r[a];if(u.clientHeight>t.minHeight)return void(g.value=a);(i+=u?u.clientWidth+6:0)>=n-40&&(o=a),a+=1}o===r.length-1&&i<=n?g.value=-1:g.value=i>=n-40?o:o-1}}return(0,i.watch)((function(){return t.data}),(function(){var e;x.value=JSON.parse(JSON.stringify(t.data)),null===(e=x.value)||void 0===e||e.forEach((function(e){e.isSelected=t.uniqueSelect&&!!t.modelValue.some((function(t){return t.id===e.id}))}))}),{immediate:!0}),(0,i.watch)((function(){return t.modelValue}),(function(e){var n,r;if(!(null==e?void 0:e.length))return p.value=[],void(null===(n=x.value)||void 0===n||n.forEach((function(e){e.isSelected=!1})));var i=[];e.forEach((function(e){var n,r=p.value.find((function(t){return t.id===e.id&&t.name===e.name}));if((null==r?void 0:r.toValueKey())===JSON.stringify(e))r.values=e.values||[],r.logical=e.logical||j.OR,i.push(r);else{var o=t.data.find((function(t){return t.id===e.id})),a="default";o||(o=t.conditions.find((function(t){return t.id===e.id})))&&(a="condition"),o||(null===(n=e.values)||void 0===n?void 0:n.length)||(a="text");var l=new A(o||e,a);l.values=e.values||[],l.logical=e.logical||j.OR,i.push(l)}})),p.value=i,null===(r=x.value)||void 0===r||r.forEach((function(e){e.isSelected=t.uniqueSelect&&!!i.some((function(t){return t.id===e.id}))}))}),{immediate:!0,deep:!0}),(0,i.onMounted)((function(){h(s.value.querySelector(".".concat(l("search-select-container"))),y)})),(0,i.onBeforeUnmount)((function(){!function(e,t){var n=e.__resize_listeners__;if(n){if(t&&n.splice(n.indexOf(t),1),!n.length||!t){if(e.detachEvent&&e.removeEventListener)return e.detachEvent("onresize",e.__resize_legacy_resize_handler__),void document.removeEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);e.__resize_observer__?(e.__resize_observer__.unobserve(e),e.__resize_observer__.disconnect(),e.__resize_observer__=null):(e.__resize_mutation_observer__&&(e.__resize_mutation_observer__.disconnect(),e.__resize_mutation_observer__=null),e.removeEventListener("scroll",m),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}! --v&&f&&f.parentNode.removeChild(f)}}(s.value.querySelector(".".concat(l("search-select-container"))),y)})),r={onEditClick:k,onEditEnter:E,onEditBlur:function(){b.value="",S("")},onValidate:S,editKey:b},(0,i.provide)(F,r),{inputRef:c,wrapRef:s,isFocus:d,copyData:x,selectedList:p,overflowIndex:g,validateStr:w,onEditClick:k,onEditEnter:E,handleWrapClick:function(){b.value||c.value.handleInputFocus()},handleInputFocus:function(e){var t;e&&(g.value=-1),!1===e&&(null===(t=s.value.querySelector(".".concat(l("search-select-container"))))||void 0===t||t.scrollTo(0,0)),d.value=e},handleResize:L,handleClearAll:function(){p.value=[],g.value=-1,o("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=s.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=p.value.slice();t.push(e),S(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=p.value.slice();t.splice("number"==typeof e?e:p.value.length-1,1),S(""),o("update:modelValue",t.map((function(e){return e.toValue()})))},handleClickSearch:function(e){o("search",e)},localConditions:u,resolveClassName:l,t:a}},render:function(){var e,t,n,o=this,a="".concat(!this.shrink||this.isFocus?this.maxHeight:this.minHeight,"px"),l=!!this.selectedList.length&&"condition"!==this.selectedList.slice(-1)[0].type,u=Object.assign({},this.$slots.menu?{menu:function(e){var t,n;return null===(n=(t=o.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,i.createVNode)("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[(0,i.createVNode)("div",{class:(e={},r(e,this.resolveClassName("search-select-container"),!0),r(e,"is-focus",this.isFocus),e),onClick:this.handleWrapClick},[(0,i.createVNode)("div",{class:"search-prefix"},[null===(n=(t=this.$slots).prepend)||void 0===n?void 0:n.call(t)]),(0,i.createVNode)("div",{class:"search-container",style:{maxHeight:a}},[(0,i.createVNode)(q,{data:this.copyData,conditions:this.localConditions,selectedList:this.selectedList,overflowIndex:this.overflowIndex,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onDelete:this.handleDeleteSelected},Object.assign({},u)),(0,i.createVNode)("div",{class:"search-container-input"},[(0,i.createVNode)(R,{ref:"inputRef",data:this.copyData,showInputBefore:!this.selectedList.length,showCondition:l,conditions:this.localConditions,placeholder:this.placeholder||this.t.pleaseSelect,clickOutside:this.handleInputOutside,getMenuList:this.getMenuList,validateValues:this.validateValues,valueBehavior:this.valueBehavior,onAdd:this.handleAddSelected,onDelete:this.handleDeleteSelected,onFocus:this.handleInputFocus},Object.assign({},u))])]),(0,i.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,i.createVNode)(w.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,i.createVNode)(w.Search,{onClick:this.handleClickSearch,class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,i.createVNode)("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)(w.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var K=(0,e.withInstall)(P);const H=K})(),d})()));
|