bkui-vue 0.0.1-beta.464 → 0.0.1-beta.466
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 +63 -67
- package/dist/index.esm.js +15211 -14541
- package/dist/index.umd.js +65 -69
- 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 +58 -34
- package/lib/alert/alert.d.ts +1 -1
- package/lib/alert/index.d.ts +60 -40
- package/lib/alert/index.js +1 -1
- package/lib/animate-number/animate-number.d.ts +3 -3
- package/lib/animate-number/index.d.ts +60 -27
- package/lib/backtop/backtop.d.ts +2 -2
- package/lib/backtop/index.d.ts +61 -43
- package/lib/badge/badge.d.ts +1 -1
- package/lib/badge/index.d.ts +63 -60
- package/lib/badge/index.js +1 -1
- package/lib/breadcrumb/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb/breadcrumb.d.ts +2 -2
- package/lib/breadcrumb/index.d.ts +61 -39
- package/lib/button/button-group.d.ts +4 -4
- package/lib/button/button.d.ts +3 -3
- package/lib/button/index.d.ts +74 -68
- package/lib/button/index.js +1 -1
- package/lib/card/card.d.ts +1 -1
- package/lib/card/index.d.ts +63 -64
- package/lib/card/index.js +1 -1
- package/lib/cascader/cascader-panel.d.ts +1 -1
- package/lib/cascader/cascader.d.ts +2 -2
- package/lib/cascader/index.d.ts +81 -146
- package/lib/cascader/index.js +2 -1
- package/lib/cascader/index.js.LICENSE.txt +1 -0
- package/lib/checkbox/checkbox-group.d.ts +2 -2
- package/lib/checkbox/checkbox.d.ts +10 -10
- package/lib/checkbox/index.d.ts +76 -64
- package/lib/checkbox/index.js +1 -1
- package/lib/checkbox/type.d.ts +1 -1
- package/lib/code-diff/code-diff.d.ts +6 -6
- package/lib/code-diff/index.d.ts +30 -43
- package/lib/code-diff/index.js +1 -1
- package/lib/collapse/collapse-panel.d.ts +1 -1
- package/lib/collapse/collapse.d.ts +1 -1
- package/lib/collapse/index.d.ts +68 -74
- package/lib/collapse-transition/collapse-transition.d.ts +2 -2
- package/lib/color-picker/color-picker.d.ts +2 -2
- package/lib/color-picker/components/color-input.d.ts +2 -2
- package/lib/color-picker/components/hue-slider.d.ts +2 -2
- package/lib/color-picker/components/input-container.d.ts +2 -2
- package/lib/color-picker/components/recommend-colors.d.ts +2 -2
- package/lib/color-picker/components/saturation-panel.d.ts +2 -2
- package/lib/color-picker/index.d.ts +63 -62
- package/lib/color-picker/index.js +1 -1
- package/lib/config-provider/config-provider.d.ts +3 -3
- package/lib/config-provider/index.d.ts +175 -138
- package/lib/container/col.d.ts +2 -2
- package/lib/container/container.d.ts +2 -2
- package/lib/container/index.d.ts +29 -48
- package/lib/container/row.d.ts +2 -2
- package/lib/date-picker/base/confirm.d.ts +5 -5
- package/lib/date-picker/base/date-table.d.ts +3 -3
- package/lib/date-picker/base/month-table.d.ts +4 -4
- package/lib/date-picker/base/picker-dropdown.d.ts +4 -4
- package/lib/date-picker/base/time-spinner.d.ts +2 -2
- package/lib/date-picker/base/year-table.d.ts +4 -4
- package/lib/date-picker/date-picker.d.ts +37 -28
- package/lib/date-picker/index.d.ts +162 -209
- package/lib/date-picker/index.js +1 -1
- package/lib/date-picker/interface.d.ts +10 -10
- package/lib/date-picker/panel/date-range.d.ts +18 -15
- package/lib/date-picker/panel/date.d.ts +12 -12
- package/lib/date-picker/panel/time-range.d.ts +8 -2
- package/lib/date-picker/panel/time.d.ts +5 -2
- package/lib/date-picker/props.d.ts +3 -3
- package/lib/date-picker/time-picker.d.ts +11 -2
- package/lib/dialog/dialog.d.ts +2 -2
- package/lib/dialog/index.d.ts +90 -163
- package/lib/dialog/index.js +2 -1
- package/lib/dialog/index.js.LICENSE.txt +1 -0
- package/lib/directives/index.js +1 -1
- package/lib/divider/divider.d.ts +2 -2
- package/lib/divider/index.d.ts +61 -37
- package/lib/dropdown/dropdown-item.d.ts +1 -1
- package/lib/dropdown/dropdown-menu.d.ts +2 -2
- package/lib/dropdown/dropdown.d.ts +2 -2
- package/lib/dropdown/index.d.ts +66 -54
- package/lib/exception/exception.d.ts +2 -2
- package/lib/exception/index.d.ts +60 -29
- package/lib/exception/index.js +1 -1
- package/lib/exception/typings/index.d.ts +2 -2
- package/lib/fixed-navbar/fixed-navbar.d.ts +1 -1
- package/lib/fixed-navbar/index.d.ts +58 -34
- package/lib/form/compose-form-item.d.ts +2 -2
- package/lib/form/form-item.d.ts +3 -3
- package/lib/form/form.d.ts +3 -3
- package/lib/form/index.d.ts +62 -40
- package/lib/form/index.js +1 -1
- package/lib/icon/angle-double-down-line.js +1 -1
- package/lib/icon/angle-double-left-line.js +1 -1
- package/lib/icon/angle-double-left.js +1 -1
- package/lib/icon/angle-double-right-line.js +1 -1
- package/lib/icon/angle-double-right.js +1 -1
- package/lib/icon/angle-double-up-line.js +1 -1
- package/lib/icon/angle-down-fill.js +1 -1
- package/lib/icon/angle-down-line.js +1 -1
- package/lib/icon/angle-down.js +1 -1
- package/lib/icon/angle-left.js +1 -1
- package/lib/icon/angle-right.js +1 -1
- package/lib/icon/angle-up-fill.js +1 -1
- package/lib/icon/angle-up.js +1 -1
- package/lib/icon/archive-fill.js +1 -1
- package/lib/icon/arrows-left.js +1 -1
- package/lib/icon/arrows-right.js +1 -1
- package/lib/icon/audio-fill.js +1 -1
- package/lib/icon/bk.js +1 -1
- package/lib/icon/circle.js +1 -1
- package/lib/icon/close-line.js +1 -1
- package/lib/icon/close.js +1 -1
- package/lib/icon/code.js +1 -1
- package/lib/icon/cog-shape.js +1 -1
- package/lib/icon/collapse-left.js +1 -1
- package/lib/icon/copy-shape.js +1 -1
- package/lib/icon/copy.js +1 -1
- package/lib/icon/data-shape.js +1 -1
- package/lib/icon/del.js +1 -1
- package/lib/icon/doc-fill.js +1 -1
- package/lib/icon/done.js +1 -1
- package/lib/icon/down-shape.js +1 -1
- package/lib/icon/down-small.js +1 -1
- package/lib/icon/edit-line.js +1 -1
- package/lib/icon/ellipsis.js +1 -1
- package/lib/icon/enlarge-line.js +1 -1
- package/lib/icon/error.js +1 -1
- package/lib/icon/excel-fill.js +1 -1
- package/lib/icon/exclamation-circle-shape.js +1 -1
- package/lib/icon/eye.js +1 -1
- package/lib/icon/filliscreen-line.js +1 -1
- package/lib/icon/fix-line.js +1 -1
- package/lib/icon/fix-shape.js +1 -1
- package/lib/icon/folder-open.js +1 -1
- package/lib/icon/folder-shape-open.js +1 -1
- package/lib/icon/folder-shape.js +1 -1
- package/lib/icon/folder.js +1 -1
- package/lib/icon/funnel.js +1 -1
- package/lib/icon/help-document-fill.js +1 -1
- package/lib/icon/help-fill.js +1 -1
- package/lib/icon/help.js +1 -1
- package/lib/icon/image-fill.js +1 -1
- package/lib/icon/img-error.js +1 -1
- package/lib/icon/img-placehoulder.js +1 -1
- package/lib/icon/index.js +1 -1
- package/lib/icon/info-line.js +1 -1
- package/lib/icon/info.js +1 -1
- package/lib/icon/left-shape.js +1 -1
- package/lib/icon/left-turn-line.js +1 -1
- package/lib/icon/narrow-line.js +1 -1
- package/lib/icon/original.js +1 -1
- package/lib/icon/pdf-fill.js +1 -1
- package/lib/icon/play-shape.js +1 -1
- package/lib/icon/plus.js +1 -1
- package/lib/icon/ppt-fill.js +1 -1
- package/lib/icon/qq.js +1 -1
- package/lib/icon/right-shape.js +1 -1
- package/lib/icon/right-turn-line.js +1 -1
- package/lib/icon/search.js +1 -1
- package/lib/icon/share.js +1 -1
- package/lib/icon/spinner.js +1 -1
- package/lib/icon/success.js +1 -1
- package/lib/icon/switcher-loading.js +1 -1
- package/lib/icon/text-file.js +1 -1
- package/lib/icon/text-fill.js +1 -1
- package/lib/icon/transfer.js +1 -1
- package/lib/icon/tree-application-shape.js +1 -1
- package/lib/icon/unfull-screen.js +1 -1
- package/lib/icon/unvisible.js +1 -1
- package/lib/icon/up-shape.js +1 -1
- package/lib/icon/upload.js +1 -1
- package/lib/icon/video-fill.js +1 -1
- package/lib/icon/warn.js +1 -1
- package/lib/icon/weixin-pro.js +1 -1
- package/lib/icon/weixin.js +1 -1
- package/lib/image/image-viewer.d.ts +2 -2
- package/lib/image/image.d.ts +1 -1
- package/lib/image/index.d.ts +63 -57
- package/lib/info-box/index.d.ts +1 -1
- package/lib/info-box/index.js +2 -1
- package/lib/info-box/index.js.LICENSE.txt +1 -0
- package/lib/input/index.d.ts +82 -119
- package/lib/input/index.js +1 -1
- package/lib/input/input.d.ts +6 -6
- package/lib/link/index.d.ts +59 -40
- package/lib/link/link.d.ts +1 -1
- package/lib/loading/directive.d.ts +2 -2
- package/lib/loading/index.d.ts +67 -71
- package/lib/loading/index.js +1 -1
- package/lib/loading/loading.d.ts +3 -3
- package/lib/locale/lang/en.d.ts +1 -1
- package/lib/menu/index.d.ts +69 -32
- package/lib/menu/index.js +1 -1
- package/lib/menu/menu-group.d.ts +2 -2
- package/lib/menu/menu-item.d.ts +5 -1
- package/lib/menu/menu.d.ts +1 -1
- package/lib/menu/submenu.d.ts +5 -1
- package/lib/menu/utils.d.ts +1 -1
- package/lib/message/index.js +1 -1
- package/lib/message/messageConstructor.d.ts +5 -5
- package/lib/modal/index.d.ts +84 -123
- package/lib/modal/modal.d.ts +3 -3
- package/lib/navigation/index.d.ts +84 -65
- package/lib/navigation/index.js +1 -1
- package/lib/navigation/navigation-title.d.ts +6 -3
- package/lib/navigation/navigation.d.ts +10 -3
- package/lib/notify/index.js +1 -1
- package/lib/notify/notifyConstructor.d.ts +1 -1
- package/lib/overflow-title/components/overflow-title.d.ts +2 -2
- package/lib/overflow-title/index.d.ts +62 -37
- package/lib/overflow-title/props.d.ts +2 -2
- package/lib/pagination/index.d.ts +75 -94
- package/lib/pagination/index.js +1 -1
- package/lib/pagination/pagination.d.ts +6 -6
- package/lib/pagination/type.d.ts +1 -1
- package/lib/plugin-popover/index.js +1 -1
- package/lib/pop-confirm/index.d.ts +66 -63
- package/lib/pop-confirm/pop-confirm.d.ts +2 -2
- package/lib/popover/arrow.d.ts +1 -1
- package/lib/popover/content.d.ts +2 -2
- package/lib/popover/index.d.ts +93 -164
- package/lib/popover/index.js +1 -1
- package/lib/popover/plugin-popover.d.ts +1 -1
- package/lib/popover/popover.d.ts +7 -7
- package/lib/popover/props.d.ts +4 -4
- package/lib/popover/reference.d.ts +1 -1
- package/lib/popover/root.d.ts +13 -2
- package/lib/popover/use-floating.d.ts +3 -3
- package/lib/popover2/index.d.ts +55 -10
- package/lib/popover2/popover.d.ts +1 -1
- package/lib/process/index.d.ts +60 -46
- package/lib/process/index.js +2 -1
- package/lib/process/index.js.LICENSE.txt +1 -0
- package/lib/process/process.d.ts +2 -2
- package/lib/progress/index.d.ts +76 -103
- package/lib/progress/index.js +1 -1
- package/lib/progress/progress.d.ts +6 -6
- package/lib/radio/index.d.ts +63 -41
- package/lib/radio/index.js +1 -1
- package/lib/radio/radio-button.d.ts +5 -5
- package/lib/radio/radio-group.d.ts +2 -2
- package/lib/radio/radio.d.ts +2 -2
- package/lib/radio/type.d.ts +1 -1
- package/lib/rate/index.d.ts +61 -34
- package/lib/rate/rate.d.ts +3 -3
- package/lib/rate/star.d.ts +1 -1
- package/lib/resize-layout/index.d.ts +65 -66
- package/lib/resize-layout/index.js +1 -1
- package/lib/resize-layout/resize-layout.d.ts +1 -1
- package/lib/search-select/index.d.ts +70 -69
- package/lib/search-select/index.js +2 -1
- package/lib/search-select/index.js.LICENSE.txt +1 -0
- package/lib/search-select/input.d.ts +1 -1
- package/lib/search-select/menu.d.ts +1 -1
- package/lib/search-select/search-select.d.ts +2 -2
- package/lib/search-select/selected.d.ts +2 -2
- package/lib/search-select/utils.d.ts +4 -4
- package/lib/select/index.d.ts +308 -512
- package/lib/select/index.js +2 -1
- package/lib/select/index.js.LICENSE.txt +1 -0
- package/lib/select/option.d.ts +2 -2
- package/lib/select/optionGroup.d.ts +2 -2
- package/lib/select/select.d.ts +76 -66
- package/lib/select/selectTagInput.d.ts +2 -2
- package/lib/select/type.d.ts +3 -3
- package/lib/shared/index.d.ts +2 -2
- package/lib/shared/index.js +1 -1
- package/lib/shared/mask-manager.d.ts +2 -2
- package/lib/shared/popover.d.ts +1 -1
- package/lib/shared/vue-types.d.ts +7 -7
- package/lib/sideslider/index.d.ts +84 -125
- package/lib/sideslider/index.js +2 -1
- package/lib/sideslider/index.js.LICENSE.txt +1 -0
- package/lib/sideslider/sideslider.d.ts +3 -3
- package/lib/slider/index.d.ts +73 -103
- package/lib/slider/index.js +2 -1
- package/lib/slider/index.js.LICENSE.txt +1 -0
- package/lib/slider/slider-button.d.ts +1 -1
- package/lib/slider/slider.d.ts +1 -1
- package/lib/steps/index.d.ts +68 -62
- package/lib/steps/index.js +2 -1
- package/lib/steps/index.js.LICENSE.txt +1 -0
- package/lib/steps/steps.d.ts +5 -5
- package/lib/swiper/index.d.ts +60 -44
- package/lib/swiper/swiper.d.ts +1 -1
- package/lib/switcher/index.d.ts +72 -77
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.d.ts +3 -3
- package/lib/tab/index.d.ts +81 -99
- package/lib/tab/index.js +1 -1
- package/lib/tab/props.d.ts +1 -1
- package/lib/tab/tab-nav.d.ts +2 -2
- package/lib/tab/tab-panel.d.ts +2 -2
- package/lib/tab/tab.d.ts +3 -3
- package/lib/table/components/table-cell.d.ts +2 -2
- package/lib/table/components/table-column.d.ts +18 -12
- package/lib/table/components/table-row.d.ts +1 -1
- package/lib/table/index.d.ts +213 -302
- package/lib/table/index.js +1 -1
- package/lib/table/plugins/body-empty.d.ts +1 -1
- package/lib/table/plugins/col-group.d.ts +2 -2
- package/lib/table/plugins/head-filter.d.ts +1 -1
- package/lib/table/plugins/head-sort.d.ts +1 -1
- package/lib/table/plugins/settings.d.ts +1 -1
- package/lib/table/plugins/use-active-columns.d.ts +3 -3
- package/lib/table/plugins/use-fixed-column.d.ts +3 -3
- package/lib/table/props.d.ts +19 -19
- package/lib/table/table.css +3 -0
- package/lib/table/table.d.ts +6 -6
- package/lib/table/table.less +4 -0
- package/lib/table/table.variable.css +3 -0
- package/lib/table/use-column.d.ts +4 -4
- package/lib/table/use-common.d.ts +1 -1
- package/lib/table-column/index.d.ts +113 -106
- package/lib/table-column/index.js +1 -1
- package/lib/tag/index.d.ts +68 -50
- package/lib/tag/index.js +1 -1
- package/lib/tag/tag.d.ts +5 -1
- package/lib/tag-input/index.d.ts +105 -317
- package/lib/tag-input/index.js +1 -1
- package/lib/tag-input/list-tag-render.d.ts +2 -2
- package/lib/tag-input/tag-input.d.ts +7 -7
- package/lib/tag-input/tag-input.less +11 -11
- package/lib/tag-input/tag-props.d.ts +3 -3
- package/lib/tag-input/tag-render.d.ts +2 -2
- package/lib/time-picker/index.d.ts +116 -187
- package/lib/timeline/index.d.ts +57 -28
- package/lib/timeline/timeline.d.ts +2 -2
- package/lib/transfer/index.d.ts +67 -82
- package/lib/transfer/transfer.d.ts +1 -1
- package/lib/tree/index.d.ts +84 -146
- package/lib/tree/index.js +1 -1
- package/lib/tree/props.d.ts +4 -4
- package/lib/tree/tree.d.ts +3 -3
- package/lib/upload/index.d.ts +93 -150
- package/lib/upload/index.js +2 -1
- package/lib/upload/index.js.LICENSE.txt +1 -0
- package/lib/upload/upload-list.d.ts +1 -1
- package/lib/upload/upload-trigger.d.ts +1 -1
- package/lib/upload/upload.d.ts +4 -4
- package/lib/upload/upload.type.d.ts +12 -12
- package/lib/upload/use-file-handler.d.ts +1 -24
- package/lib/virtual-render/index.d.ts +64 -160
- package/lib/virtual-render/index.js +1 -1
- package/lib/virtual-render/props.d.ts +1 -1
- package/lib/virtual-render/virtual-render.d.ts +16 -3
- package/package.json +38 -37
@@ -2,66 +2,67 @@ declare const BkSearchSelect: {
|
|
2
2
|
new (...args: any[]): {
|
3
3
|
$: import("vue").ComponentInternalInstance;
|
4
4
|
$data: {};
|
5
|
-
$props:
|
6
|
-
data
|
7
|
-
maxHeight
|
8
|
-
minHeight
|
9
|
-
clearable
|
10
|
-
modelValue
|
11
|
-
conditions
|
12
|
-
valueBehavior
|
13
|
-
valueSplitCode
|
14
|
-
shrink
|
15
|
-
uniqueSelect
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
};
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
}>> & {
|
5
|
+
$props: {
|
6
|
+
data?: import("./utils").ISearchItem[];
|
7
|
+
maxHeight?: number;
|
8
|
+
minHeight?: number;
|
9
|
+
clearable?: boolean;
|
10
|
+
modelValue?: import("./utils").ISearchValue[];
|
11
|
+
conditions?: import("./utils").ICommonItem[];
|
12
|
+
valueBehavior?: import("./utils").ValueBehavior;
|
13
|
+
valueSplitCode?: string;
|
14
|
+
shrink?: boolean;
|
15
|
+
uniqueSelect?: boolean;
|
16
|
+
class?: unknown;
|
17
|
+
style?: unknown;
|
18
|
+
key?: string | number | symbol;
|
19
|
+
ref?: import("vue").VNodeRef;
|
20
|
+
ref_for?: boolean;
|
21
|
+
ref_key?: string;
|
22
|
+
onVnodeBeforeMount?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
23
|
+
[key: string]: any;
|
24
|
+
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
25
|
+
[key: string]: any;
|
26
|
+
}>) => void)[];
|
27
|
+
onVnodeMounted?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
28
|
+
[key: string]: any;
|
29
|
+
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
30
|
+
[key: string]: any;
|
31
|
+
}>) => void)[];
|
32
|
+
onVnodeBeforeUpdate?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
33
|
+
[key: string]: any;
|
34
|
+
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
35
|
+
[key: string]: any;
|
36
|
+
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
37
|
+
[key: string]: any;
|
38
|
+
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
39
|
+
[key: string]: any;
|
40
|
+
}>) => void)[];
|
41
|
+
onVnodeUpdated?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
42
|
+
[key: string]: any;
|
43
|
+
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
44
|
+
[key: string]: any;
|
45
|
+
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
46
|
+
[key: string]: any;
|
47
|
+
}>, oldVNode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
48
|
+
[key: string]: any;
|
49
|
+
}>) => void)[];
|
50
|
+
onVnodeBeforeUnmount?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
51
|
+
[key: string]: any;
|
52
|
+
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
53
|
+
[key: string]: any;
|
54
|
+
}>) => void)[];
|
55
|
+
onVnodeUnmounted?: ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
56
|
+
[key: string]: any;
|
57
|
+
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
58
|
+
[key: string]: any;
|
59
|
+
}>) => void)[];
|
60
|
+
readonly placeholder?: string;
|
62
61
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
62
|
+
readonly getMenuList?: import("./utils").GetMenuListFunc;
|
63
|
+
readonly validateValues?: import("./utils").ValidateValuesFunc;
|
63
64
|
onSearch?: (...args: any[]) => any;
|
64
|
-
}
|
65
|
+
};
|
65
66
|
$attrs: {
|
66
67
|
[x: string]: unknown;
|
67
68
|
};
|
@@ -69,10 +70,10 @@ declare const BkSearchSelect: {
|
|
69
70
|
[x: string]: unknown;
|
70
71
|
};
|
71
72
|
$slots: Readonly<{
|
72
|
-
[name: string]: import("vue").Slot
|
73
|
+
[name: string]: import("vue").Slot<any>;
|
73
74
|
}>;
|
74
|
-
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}
|
75
|
-
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}
|
75
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
76
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
76
77
|
$emit: (event: "search" | "update:modelValue", ...args: any[]) => void;
|
77
78
|
$el: any;
|
78
79
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
@@ -221,7 +222,7 @@ declare const BkSearchSelect: {
|
|
221
222
|
conditions: import("./utils").ICommonItem[];
|
222
223
|
showInputBefore: boolean;
|
223
224
|
showCondition: boolean;
|
224
|
-
}>>;
|
225
|
+
}, {}>>;
|
225
226
|
wrapRef: import("vue").Ref<HTMLDivElement>;
|
226
227
|
isFocus: import("vue").Ref<boolean>;
|
227
228
|
copyData: import("vue").ShallowRef<import("./utils").ISearchItem[]>;
|
@@ -341,7 +342,7 @@ declare const BkSearchSelect: {
|
|
341
342
|
valueSplitCode: string;
|
342
343
|
shrink: boolean;
|
343
344
|
uniqueSelect: boolean;
|
344
|
-
}> & {
|
345
|
+
}, {}, string, {}> & {
|
345
346
|
beforeCreate?: (() => void) | (() => void)[];
|
346
347
|
created?: (() => void) | (() => void)[];
|
347
348
|
beforeMount?: (() => void) | (() => void)[];
|
@@ -356,11 +357,11 @@ declare const BkSearchSelect: {
|
|
356
357
|
unmounted?: (() => void) | (() => void)[];
|
357
358
|
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
358
359
|
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
359
|
-
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}
|
360
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>, info: string) => boolean | void)[];
|
360
361
|
};
|
361
362
|
$forceUpdate: () => void;
|
362
363
|
$nextTick: typeof import("vue").nextTick;
|
363
|
-
$watch
|
364
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
|
364
365
|
} & Readonly<import("vue").ExtractPropTypes<{
|
365
366
|
data: {
|
366
367
|
type: import("vue").PropType<import("./utils").ISearchItem[]>;
|
@@ -507,7 +508,7 @@ declare const BkSearchSelect: {
|
|
507
508
|
conditions: import("./utils").ICommonItem[];
|
508
509
|
showInputBefore: boolean;
|
509
510
|
showCondition: boolean;
|
510
|
-
}>>;
|
511
|
+
}, {}>>;
|
511
512
|
wrapRef: import("vue").Ref<HTMLDivElement>;
|
512
513
|
isFocus: import("vue").Ref<boolean>;
|
513
514
|
copyData: import("vue").ShallowRef<import("./utils").ISearchItem[]>;
|
@@ -616,7 +617,7 @@ declare const BkSearchSelect: {
|
|
616
617
|
or: string;
|
617
618
|
and: string;
|
618
619
|
}>;
|
619
|
-
}> & {} &
|
620
|
+
}> & {} & import("vue").ComponentCustomProperties & {};
|
620
621
|
__isFragment?: never;
|
621
622
|
__isTeleport?: never;
|
622
623
|
__isSuspense?: never;
|
@@ -766,7 +767,7 @@ declare const BkSearchSelect: {
|
|
766
767
|
conditions: import("./utils").ICommonItem[];
|
767
768
|
showInputBefore: boolean;
|
768
769
|
showCondition: boolean;
|
769
|
-
}>>;
|
770
|
+
}, {}>>;
|
770
771
|
wrapRef: import("vue").Ref<HTMLDivElement>;
|
771
772
|
isFocus: import("vue").Ref<boolean>;
|
772
773
|
copyData: import("vue").ShallowRef<import("./utils").ISearchItem[]>;
|
@@ -886,6 +887,6 @@ declare const BkSearchSelect: {
|
|
886
887
|
valueSplitCode: string;
|
887
888
|
shrink: boolean;
|
888
889
|
uniqueSelect: boolean;
|
889
|
-
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("
|
890
|
+
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]>;
|
890
891
|
export default BkSearchSelect;
|
891
892
|
export { BkSearchSelect, };
|
@@ -1 +1,2 @@
|
|
1
|
-
!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,a)=>(()=>{var o={7162:(e,t,n)=>{e.exports=n(5047)},5047:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),o=new I(r||[]);return a._invoke=function(e,t,n){var r=d;return function(i,a){if(r===h)throw new Error("Generator is already running");if(r===f){if("throw"===i)throw a;return V()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var l=S(o,n);if(l){if(l===p)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?f:v,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=f,n.method="throw",n.arg=u.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var d="suspendedStart",v="suspendedYield",h="executing",f="completed",p={};function m(){}function g(){}function _(){}var y={};u(y,a,(function(){return this}));var w=Object.getPrototypeOf,b=w&&w(w(N([])));b&&b!==n&&r.call(b,a)&&(y=b);var x=_.prototype=m.prototype=Object.create(y);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,a,o,l){var u=c(e[i],e,a);if("throw"!==u.type){var s=u.arg,d=s.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,l)}),(function(e){n("throw",e,o,l)})):t.resolve(d).then((function(e){s.value=e,o(s)}),(function(e){return n("throw",e,o,l)}))}l(u.arg)}var i;this._invoke=function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,p):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}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 n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:V}}function V(){return{value:t,done:!0}}return g.prototype=_,u(x,"constructor",_),u(_,"constructor",g),g.displayName=u(_,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,u(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},k(E.prototype),u(E.prototype,o,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new E(s(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},k(x),u(x,l,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=N,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},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 n=this;function i(r,i){return l.type="throw",l.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],l=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),s=r.call(o,"finallyLoc");if(u&&s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(o)},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),p},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),p}},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,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},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=a},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t}},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return o[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:()=>D,default:()=>A});var e=u(4212);function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n=u(748),r=null,i=null;function a(e,t){void 0===t&&(t={});var n=document.createElement(e);return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}function o(e,t,n){return(window.getComputedStyle(e,n||null)||{display:"none"})[t]}function l(e){if(!document.documentElement.contains(e))return{detached:!0,rendered:!1};for(var t=e;t!==document;){if("none"===o(t,"display"))return{detached:!1,rendered:!1};t=t.parentNode}return{detached:!1,rendered:!0}}var c=0,d=null;function v(e,t){if(e.__resize_mutation_handler__||(e.__resize_mutation_handler__=h.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))&&p(e)})),u=l(e),s=u.detached,v=u.rendered;e.__resize_observer_triggered__=!1===s&&!1===v,e.__resize_observer__=i,i.observe(e)}else if(e.attachEvent&&e.addEventListener)e.__resize_legacy_resize_handler__=function(){p(e)},e.attachEvent("onresize",e.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",e.__resize_mutation_handler__);else if(c||(d=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=o(e,"position");t&&"static"!==t||(e.style.position="relative"),e.__resize_old_position__=t,e.__resize_last__={};var n=a("div",{className:"resize-triggers"}),r=a("div",{className:"resize-expand-trigger"}),i=a("div"),l=a("div",{className:"resize-contract-trigger"});r.appendChild(i),n.appendChild(r),n.appendChild(l),e.appendChild(n),e.__resize_triggers__={triggers:n,expand:r,expandChild:i,contract:l},m(e),e.addEventListener("scroll",f,!0),e.__resize_last__={width:e.offsetWidth,height:e.offsetHeight}}(e),e.__resize_rendered__=l(e).rendered,window.MutationObserver){var g=new MutationObserver(e.__resize_mutation_handler__);g.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),e.__resize_mutation_observer__=g}e.__resize_listeners__.push(t),c++}function h(){var e=l(this),t=e.rendered,n=e.detached;t!==this.__resize_rendered__&&(!n&&this.__resize_triggers__&&(m(this),this.addEventListener("scroll",f,!0)),this.__resize_rendered__=t,p(this))}function f(){var e,t,n=this;m(this),this.__resize_raf__&&(e=this.__resize_raf__,i||(i=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),i(e)),this.__resize_raf__=(t=function(){var e,t,r,i,a,o,l=(r=(t=(e=n).__resize_last__).width,i=t.height,a=e.offsetWidth,o=e.offsetHeight,a!==r||o!==i?{width:a,height:o}:null);l&&(n.__resize_last__=l,p(n))},r||(r=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),r(t))}function p(e){e&&e.__resize_listeners__&&e.__resize_listeners__.forEach((function(t){t.call(e,e)}))}function m(e){var t=e.__resize_triggers__,n=t.expand,r=t.expandChild,i=t.contract,a=i.scrollWidth,o=i.scrollHeight,l=n.offsetWidth,u=n.offsetHeight,s=n.scrollWidth,c=n.scrollHeight;i.scrollLeft=a,i.scrollTop=o,r.style.width=l+1+"px",r.style.height=u+1+"px",n.scrollLeft=s,n.scrollTop=c}var g=u(2717),_=u(4061),y=u(6870),w=u(7162),b=u.n(w);function x(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(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(o,l)}u((r=r.apply(e,t||[])).next())}))}Object.create,Object.create;var k=u(5537),E=u.n(k);const S=(0,n.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 r=t.emit,i=(0,g.useLocale)("searchSelect"),a=(0,g.usePrefix)().resolveClassName,o=(0,n.computed)((function(){return void 0===e.footerBtns||0===e.footerBtns.length?[{id:"confirm",name:i.value.ok},{id:"cancel",name:i.value.cancel,disabled:!1}]:e.footerBtns}));return{handleClick:function(e){r("selectItem",e)},handleClickCondition:function(e){r("selectCondition",e)},handleClickFooterBtn:function(e){r("footerClick",e)},filterList:(0,n.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 r;return(null===(r=t.value)||void 0===r?void 0:r.name)?[(0,n.createVNode)("span",{class:"menu-name"},[t.name,(0,n.createTextVNode)(":")]),t.value.name]:function(t){if(!t)return t;var r=e.keyword,i=r.length;if(!(null==r?void 0:r.trim().length)||!t.toLocaleLowerCase().includes(r.toLocaleLowerCase()))return t;var a=[],o=-1;return r=r.replace(/([.*/]{1})/gim,"\\$1"),t.replace(new RegExp("".concat(r),"igm"),(function(e,r){return 0===a.length&&0!==r?a.push(t.slice(0,r)):o>=0&&a.push(t.slice(o+e.length,r)),a.push((0,n.createVNode)("span",{class:"is-keyword"},[e])),o=r,e})),o>=0&&a.push(t.slice(o+i)),a.length?a:t}(t.name)},localFooterBtns:o,resolveClassName:a}},render:function(){var e,t,r,i=this;return(0,n.createVNode)("div",{class:this.resolveClassName("search-select-menu")},[!!(null===(e=this.conditions)||void 0===e?void 0:e.length)&&(0,n.createVNode)("ul",{class:"menu-header"},[this.conditions.map((function(e){return(0,n.createVNode)("li",{key:e.id,class:"menu-header-item ".concat(e.disabled?"is-disabled":""),onClick:function(){return!e.disabled&&i.handleClickCondition(e)}},[e.name])}))]),(0,n.createVNode)("ul",{class:"menu-content"},[null===(t=this.list)||void 0===t?void 0:t.map((function(e){return(0,n.createVNode)("li",{class:"menu-item ".concat(e.disabled?"is-disabled":""," ").concat(i.hoverId!==e.id||e.disabled?"":"is-hover"),key:e.id,id:e.id,tabindex:"-1",onClick:function(){return!e.disabled&&i.handleClick(e)}},[i.$slots.default?i.$slots.default({item:e,list:i.list,multiple:!!i.multiple,hoverId:i.hoverId,getSearchNode:i.getSearchNode}):(0,n.createVNode)(n.Fragment,null,[i.getSearchNode(e),i.multiple&&i.selected.includes(e.id)&&(0,n.createVNode)(y.Done,{class:"is-selected"},null)])])}))]),this.multiple&&(null===(r=this.localFooterBtns)||void 0===r?void 0:r.length)&&(0,n.createVNode)("div",{class:"menu-footer"},[this.localFooterBtns.map((function(e){return(0,n.createVNode)("span",{class:"menu-footer-btn ".concat(e.disabled?"is-disabled":""),key:e.id,onClick:function(){return!e.disabled&&i.handleClickFooterBtn(e)}},[e.name])}))])])}});function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var I;!function(e){e.ALL="all",e.NEEDKEY="need-key"}(I||(I={}));var N,V=Symbol("SEARCH_SLECT_PROVIDER_KEY"),z=function(){return(0,n.inject)(V)};!function(e){e.DEFAULT="default",e.EDIT="edit"}(N||(N={}));var O=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]:"|";L(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)}))}}])&&C(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const T=(0,n.defineComponent)({name:"SearchSelectInput",directives:{clickoutside:_.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:N.DEFAULT},getMenuList:Function,validateValues:Function,valueBehavior:String},emits:["focus","add","delete"],setup:function(t,r){var i=r.emit,a=r.expose,o=(0,g.useLocale)("searchSelect"),l=(0,g.usePrefix)().resolveClassName,u=(0,n.ref)(null),s=(0,n.ref)(null),c=(0,n.ref)(""),d=(0,n.ref)(!1),v=(0,n.ref)(!1),h=(0,n.ref)(!1),f=(0,n.ref)(t.defautUsingItem),p=(0,n.ref)(""),m=(0,n.ref)(!1),_=(0,e.debounce)(300,M),y=!1,w=(0,n.ref)([]),k=(0,n.ref)([]),E=z(),S=E.editKey,L=E.onValidate,C=E.valueSplitCode;function V(e){switch(e.code){case"ArrowDown":case"ArrowUp":T(e);break;case"Enter":case"NumpadEnter":!function(e){if(y){e.preventDefault();var t=k.value.find((function(e){return e.id===p.value}));t&&B(t)}}(e)}}function T(e){var t;e.preventDefault(),null===(t=u.value)||void 0===t||t.blur();for(var n=k.value.length,r=n,i=k.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 a=k.value[i];if(a&&!a.disabled){r=-1;var o=document.getElementById(a.id);return null==o||o.focus(),void(p.value=a.id)}r-=1}}function F(e){q(),e&&M()}function j(e){var n;return x(this,void 0,void 0,b().mark((function r(){var a,o,l,u,s;return b().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==e||e.preventDefault(),r.next=3,new Promise((function(e){return setTimeout(e,0)}));case 3:if(f.value){r.next=16;break}if(c.value&&t.valueBehavior!==I.NEEDKEY){r.next=6;break}return r.abrupt("return");case 6:return a={id:c.value,name:c.value},r.next=9,D(a);case 9:if(r.sent){r.next=12;break}return r.abrupt("return");case 12:return i("add",new O(a,"text",C.value)),c.value="",M(),r.abrupt("return");case 16:if(null==(o=f.value.values)?void 0:o.length){r.next=43;break}if(!(null===(n=c.value)||void 0===n?void 0:n.length)){r.next=41;break}if(!c.value.includes(C.value)){r.next=29;break}return l=c.value.split(C.value),r.next=23,D({id:c.value,name:c.value});case 23:if(r.sent){r.next=26;break}return r.abrupt("return");case 26:l.forEach((function(e){return f.value.addValue({id:e,name:e})})),r.next=36;break;case 29:return u={id:c.value,name:c.value},r.next=32,D(u);case 32:if(r.sent){r.next=35;break}return r.abrupt("return");case 35:f.value.addValue(u);case 36:return i("add",f.value),c.value="",f.value=null,q(!0),r.abrupt("return");case 41:return d.value=!0,r.abrupt("return");case 43:if(!c.value){r.next=56;break}return s={id:c.value,name:c.value},r.next=47,D(s);case 47:if(r.sent){r.next=50;break}return r.abrupt("return");case 50:return f.value.addValue(s),i("add",f.value),c.value="",f.value=null,q(!0),r.abrupt("return");case 56:return r.next=58,D();case 58:if(r.sent){r.next=61;break}return r.abrupt("return");case 61:K();case 62:case"end":return r.stop()}}),r)})))}function B(e,n){var r,i,a,o,l;return x(this,void 0,void 0,b().mark((function s(){var d,v;return b().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(console.info(e,"=========="),!(null===(r=e.value)||void 0===r?void 0:r.id)){s.next=9;break}if((t.valueBehavior!==I.NEEDKEY||!e.value)&&t.validateValues){s.next=9;break}return(d=new O(Object.assign(Object.assign({},e),{id:null!==(i=e.realId)&&void 0!==i?i:e.id}),n,C.value)).addValue(e.value),K(d),t.valueBehavior===I.NEEDKEY&&p.value&&q(!0),p.value="",s.abrupt("return");case 9:if(f.value&&(null===(a=null==u?void 0:u.value)||void 0===a?void 0:a.innerText)){s.next=17;break}return f.value=new O(e,n,C.value),c.value="",(v="condition"===n)&&K(),h.value=v||!!f.value.children.length,q(t.valueBehavior===I.NEEDKEY&&!!p.value),s.abrupt("return");case 17:if("condition"!==(null===(o=f.value)||void 0===o?void 0:o.type)){s.next=21;break}return f.value=new O(e,n,C.value),K(),s.abrupt("return");case 21:return f.value.addValue(e),s.next=24,D(e);case 24:if(s.sent){s.next=27;break}return s.abrupt("return");case 27:f.value.multiple||K(),t.valueBehavior===I.NEEDKEY&&(null===(l=f.value)||void 0===l?void 0:l.multiple)&&q();case 29:case"end":return s.stop()}}),s)})))}function D(e){return x(this,void 0,void 0,b().mark((function n(){var r,i,a,o;return b().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(f.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=f.value,i=r.searchItem,a=r.validate,o=r.values,!a||"function"!=typeof t.validateValues){n.next=9;break}return n.next=8,A(i,e?[e]:o);case 9:return L(""),n.abrupt("return",!0);case 11:case"end":return n.stop()}}),n)})))}function A(e,n){var r;return x(this,void 0,void 0,b().mark((function i(){var a;return b().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(a=i.sent)&&!1!==a){i.next=6;break}return L(a||"校验错误"),i.abrupt("return",!1);case 6:return L(""),i.abrupt("return",!0);case 8:case"end":return i.stop()}}),i)})))}function q(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&(0,n.nextTick)().then((function(){M()})),v.value=!0,h.value=!0,d.value=!1;var t=setTimeout((function(){if(u.value){u.value.focus();var e=window.getSelection();0===e.focusOffset&&(e.selectAllChildren(u.value),e.collapseToEnd())}window.clearTimeout(t)}),0);i("focus",v.value)}function M(){var n,r,i,a,o;return x(this,void 0,void 0,b().mark((function l(){var u,s;return b().wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(u=[],"function"!=typeof t.getMenuList||void 0!==(null===(r=null===(n=f.value)||void 0===n?void 0:n.searchItem)||void 0===r?void 0:r.async)&&!0!==f.value.searchItem.async){l.next=9;break}return m.value=!0,l.next=5,t.getMenuList(null===(i=f.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==f?void 0:f.value)?"condition"===f.value.type?u=t.conditions:(null===(o=f.value.values)||void 0===o?void 0:o.length)&&!f.value.multiple&&t.mode!==N.EDIT||(u=f.value.children.filter((function(e){return e.name.toLocaleLowerCase().includes(c.value.toLocaleLowerCase())}))):(null===(a=c.value)||void 0===a?void 0:a.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:k.value=u,t.valueBehavior===I.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){i("add",null!=e?e:f.value),f.value=null,c.value="",q(t.valueBehavior===I.NEEDKEY)}function H(){var e=u.value.innerText;"\n"===e[e.length-1]||"\r"===e[0]?(R(e.slice(0,-1)),H()):"\n"!==e[0]&&"\r"!==e[0]||(R(e.slice(1)),H())}function R(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u.value&&(u.value.innerHTML=t||(null===(e=f.value)||void 0===e?void 0:e.inputInnerHtml)||"")}return(0,n.watch)(S,(function(){t.mode===N.DEFAULT&&S.value&&(h.value=!1)})),(0,n.watchEffect)((function(){c.value||R()}),{flush:"pre"}),(0,n.watch)([k,h],(function(){var e;(null===(e=k.value)||void 0===e?void 0:e.some((function(e){return!e.disabled})))&&h.value?y||(t.valueBehavior===I.NEEDKEY?p.value=k.value.find((function(e){return!e.disabled})).id:p.value="",y=!0,document.addEventListener("keydown",V)):(document.removeEventListener("keydown",V),y=!1,t.valueBehavior!==I.NEEDKEY&&(p.value=""))})),a({handleInputFocus:F,isFocus:v}),{popoverRef:s,inputRef:u,keyword:c,loading:m,remoteMenuList:w,menuList:k,menuHoverId:p,isFocus:v,usingItem:f,showPopover:h,showNoSelectValueError:d,debounceSetMenuList:_,documentArrowEvent:T,handleClickOutside:function(e){var n,r;!(null===(n=s.value)||void 0===n?void 0:n.contains(e.target))&&(null===(r=t.clickOutside)||void 0===r?void 0:r.call(t,e.target,s.value))&&(h.value=!1,v.value=!1,i("focus",v.value))},handleInputFocus:F,handleInputChange:function(e){var t,n,r,i,a,o,l,s,d;H();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,q(),c.value=v.replace((null===(t=f.value)||void 0===t?void 0:t.keyInnerText)||"","").trim(),_();else if(!c.value&&v.length<((null===(r=null===(n=f.value)||void 0===n?void 0:n.inputInnerText)||void 0===r?void 0:r.length)||1)){var h=v.replace(" "," ").replace((null===(i=f.value)||void 0===i?void 0:i.keyInnerText.replace(" "," ").trim())||"","").trim();if(v&&(null===(a=f.value)||void 0===a?void 0:a.keyInnerText)&&v.replace(" "," ").includes(f.value.keyInnerText.replace(" "," ").trim())&&h&&(null===(o=f.value.values)||void 0===o?void 0:o.length))return c.value=h,console.info("outerText",h),void _();!h&&(null==v?void 0:v.length)||(f.value=null),c.value=h?v:"",_()}else(null===(s=null===(l=f.value)||void 0===l?void 0:l.values)||void 0===s?void 0:s.length)||(c.value=v.replace(" "," ").replace((null===(d=f.value)||void 0===d?void 0:d.keyInnerText.replace(" "," "))||"","").trim(),q(),_())},handleInputKeyup:function(e){switch(e.code){case"Enter":case"NumpadEnter":if(t.valueBehavior===I.NEEDKEY&&k.value.some((function(e){return e.id===p.value})))return;j(e);break;case"Backspace":!function(){var e,r;if(!f.value&&!c.value)return i("delete"),void(0,n.nextTick)(M);if(null===(e=f.value)||void 0===e?void 0:e.values.length){if((null===(r=f.value)||void 0===r?void 0:r.multiple)||f.value.isInValueList(f.value.values[0])||t.mode===N.EDIT&&!c.value)return f.value.values.splice(-1,1),c.value="",void q()}else c.value||(f.value=null,c.value="",M());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=f.value)||void 0===t?void 0:t.values.length))return;c.value="",j();break;case"cancel":f.value.values=[],h.value=!1}},resolveClassName:l,t:o}},render:function(){var e,t,r=this,i=this.usingItem||{},a=i.multiple,o=i.values,l=i.placeholder,u=i.inputInnerHtml,s=!(null===(e=this.keyword)||void 0===e?void 0:e.length)&&!(null==o?void 0:o.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,n;return null===(n=(t=r.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,n.createVNode)(E(),{trigger:"manual",theme:"light",placement:"bottom-start",arrow:!1,disableOutsideClick:!0,isShow:c},{default:function(){var e;return(0,n.withDirectives)((0,n.createVNode)("div",{ref:"inputRef",class:{"div-input":!0,"input-before":r.showInputBefore&&!(null===(e=r.keyword)||void 0===e?void 0:e.length),"input-after":s},contenteditable:!0,"data-placeholder":u||r.keyword?"":r.placeholder,"data-tips":l||"",spellcheck:"false",onFocus:r.handleInputFocus,onInput:r.handleInputChange,onKeydown:r.handleInputKeyup},null),[[(0,n.resolveDirective)("clickoutside"),r.handleClickOutside]])},content:function(){var e;return r.loading?(0,n.createVNode)("div",null,[r.t.loading]):r.showNoSelectValueError?(0,n.createVNode)("div",null,[r.t.filterQueryMustHasValue]):(null===(e=r.menuList)||void 0===e?void 0:e.length)?(0,n.createVNode)("div",{ref:"popoverRef",class:r.resolveClassName("search-select-popover")},[(0,n.createVNode)(S,{list:r.menuList,keyword:r.keyword,multiple:!!a,hoverId:r.menuHoverId,selected:(null==o?void 0:o.map((function(e){return e.id})))||[],conditions:d?r.conditions:[],onSelectItem:r.handleSelectItem,onSelectCondition:r.handleSelectCondtionItem,onFooterClick:r.handleMenuFooterClick},Object.assign({},v))]):void 0}})}}),F=(0,n.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 r=t.emit,i=(0,n.ref)(null),a=z(),o=a.onEditClick,l=a.onEditEnter,u=a.onEditBlur,s=a.editKey,c=a.valueSplitCode;return{inputRef:i,editKey:s,copySeletedItem:function(e){var t=new O(e.searchItem,e.type,c.value);return t.values=e.values.slice(),t},handleDeleteSelected:function(e){r("delete",e)},handleEditSeleted:function(e,t,n){e.preventDefault(),e.stopPropagation(),o(t,n),setTimeout((function(){return i.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,r){return e.editKey==="".concat(t.id,"_").concat(r)?(0,n.createVNode)("div",{class:"selected-input",key:e.editKey.toString()},[(0,n.createVNode)(T,{ref:"inputRef",key:e.editKey.toString(),mode:N.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,r)},onFocus:e.handleInputFocus},null)]):(0,n.createVNode)("li",{class:"search-container-selected ".concat((e.overflowIndex>=0?r<e.overflowIndex:r>=0)?"":"hidden-selected"),key:"".concat(t.id,"_").concat(r)},[(0,n.createVNode)("span",{class:"selected-name",onClick:function(n){return e.handleEditSeleted(n,t,r)}},[t.inputInnerText]),(0,n.createVNode)(y.Error,{class:"selected-clear",onClick:function(){return e.handleDeleteSelected(r)}},null)])};return(0,n.createVNode)(n.Fragment,null,[this.selectedList.map((function(r,i){return[e.overflowIndex>=0&&i===e.overflowIndex&&(0,n.createVNode)("div",{class:"search-container-selected overflow-selected"},[(0,n.createTextVNode)("+"),e.selectedList.length-e.overflowIndex]),t(r,i)]}))])}});var j={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:I.ALL,validator:function(e){return[I.ALL,I.NEEDKEY].includes(e)}}};const B=(0,n.defineComponent)({name:"SearchSelect",directives:{clickoutside:_.clickoutside},props:j,emits:["update:modelValue","search"],setup:function(t,r){var i,a=r.emit,o=(0,g.useLocale)("searchSelect"),l=(0,g.usePrefix)().resolveClassName,u=(0,n.computed)((function(){return void 0===t.conditions?[{id:"or",name:o.value.or},{id:"and",name:o.value.and}]:t.conditions})),s=(0,n.ref)(null),h=(0,n.ref)(null),p=(0,n.ref)(!1),m=(0,n.ref)([]),_=(0,n.ref)(-1),y=(0,e.debounce)(32,C),w=(0,n.ref)(""),b=(0,n.ref)(""),x=(0,n.computed)((function(){return t.valueSplitCode})),k=(0,n.shallowRef)([]);function E(e,t){w.value="".concat(e.id,"_").concat(t)}function S(e,t){var n=m.value.slice();n.splice(t,1,e),a("update:modelValue",n.map((function(e){return e.toValue()}))),w.value=""}function L(e){b.value=e||""}function C(){if(p.value||m.value.length<1)_.value=-1;else{for(var e=h.value.querySelector(".".concat(l("search-select-container"))),n=h.value.querySelector(".search-container").clientWidth-6-2,r=e.querySelectorAll(".search-container-selected:not(.overflow-selected)"),i=0,a=0,o=0;0===a&&i<=n-40&&o<=r.length-1;){var u=r[o];if(u.clientHeight>t.minHeight)return void(_.value=o);(i+=u?u.clientWidth+6:0)>=n-40&&(a=o),o+=1}a===r.length-1&&i<=n?_.value=-1:_.value=i>=n-40?a:a-1}}return(0,n.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,n.watch)((function(){return t.modelValue}),(function(e){var n,r;if(!(null==e?void 0:e.length))return m.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=m.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 a=t.data.find((function(t){return t.id===e.id})),o="default";a||(a=t.conditions.find((function(t){return t.id===e.id})))&&(o="condition"),a||(null===(n=e.values)||void 0===n?void 0:n.length)||(o="text");var l=new O(a||e,o,x.value);l.values=e.values||[],i.push(l)}})),m.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,n.onMounted)((function(){v(h.value.querySelector(".".concat(l("search-select-container"))),y)})),(0,n.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",f),e.removeChild(e.__resize_triggers__.triggers),e.__resize_triggers__=null),e.__resize_listeners__=null}!--c&&d&&d.parentNode.removeChild(d)}}(h.value.querySelector(".".concat(l("search-select-container"))),y)})),i={onEditClick:E,onEditEnter:S,onEditBlur:function(){w.value="",L("")},onValidate:L,editKey:w,valueSplitCode:x},(0,n.provide)(V,i),{inputRef:s,wrapRef:h,isFocus:p,copyData:k,selectedList:m,overflowIndex:_,validateStr:b,splitCode:x,onEditClick:E,onEditEnter:S,handleWrapClick:function(){w.value||s.value.handleInputFocus()},handleInputFocus:function(e){var t;e&&(_.value=-1),!1===e&&(null===(t=h.value.querySelector(".".concat(l("search-select-container"))))||void 0===t||t.scrollTo(0,0)),p.value=e},handleResize:C,handleClearAll:function(){m.value=[],_.value=-1,a("update:modelValue",[])},handleInputOutside:function(e){var t;return!(null===(t=h.value)||void 0===t?void 0:t.contains(e))},handleAddSelected:function(e){var t=m.value.slice();t.push(e),L(""),a("update:modelValue",t.map((function(e){return e.toValue()})))},handleDeleteSelected:function(e){var t=m.value.slice();t.splice("number"==typeof e?e:m.value.length-1,1),L(""),a("update:modelValue",t.map((function(e){return e.toValue()})))},handleClickSearch:function(e){a("search",e)},localConditions:u,resolveClassName:l,t:o}},render:function(){var e,r,i,a=this,o="".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=a.$slots).menu)||void 0===n?void 0:n.call(t,e)}}:{});return(0,n.createVNode)("div",{class:this.resolveClassName("search-select"),ref:"wrapRef"},[(0,n.createVNode)("div",{class:(e={},t(e,this.resolveClassName("search-select-container"),!0),t(e,"is-focus",this.isFocus),e),onClick:this.handleWrapClick},[(0,n.createVNode)("div",{class:"search-prefix"},[null===(i=(r=this.$slots).prepend)||void 0===i?void 0:i.call(r)]),(0,n.createVNode)("div",{class:"search-container",style:{maxHeight:o}},[(0,n.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,n.createVNode)("div",{class:"search-container-input"},[(0,n.createVNode)(T,{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,n.createVNode)("div",{class:"search-nextfix"},[this.clearable&&!!this.selectedList.length&&(0,n.createVNode)(y.Close,{class:"search-clear",onClick:this.handleClearAll},null),this.$slots.append?this.$slots.append():(0,n.createVNode)(y.Search,{onClick:this.handleClickSearch,class:"search-nextfix-icon ".concat(this.isFocus?"is-focus":"")},null)])]),!!this.validateStr.length&&(0,n.createVNode)("div",{class:this.resolveClassName("search-select-tips")},[this.$slots.validate?this.$slots.validate():(0,n.createVNode)(n.Fragment,null,[(0,n.createVNode)(y.ExclamationCircleShape,{class:"select-tips"},null),this.validateStr||""])])])}});var D=(0,e.withInstall)(B);const A=D})(),s})()));
|
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 F=(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 F(e){M(),e&&q()}function j(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;return E(this,void 0,void 0,k().mark((function s(){var d,v;return k().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(console.info(e,"=========="),!(null===(r=e.value)||void 0===r?void 0:r.id)){s.next=9;break}if((t.valueBehavior!==N.NEEDKEY||!e.value)&&t.validateValues){s.next=9;break}return(d=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(d),t.valueBehavior===N.NEEDKEY&&p.value&&M(!0),p.value="",s.abrupt("return");case 9:if(h.value&&(null===(o=null==u?void 0:u.value)||void 0===o?void 0:o.innerText)){s.next=17;break}return h.value=new T(e,n,C.value),c.value="",(v="condition"===n)&&K(),f.value=v||!!h.value.children.length,M(t.valueBehavior===N.NEEDKEY&&!!p.value),s.abrupt("return");case 17:if("condition"!==(null===(a=h.value)||void 0===a?void 0:a.type)){s.next=21;break}return h.value=new T(e,n,C.value),K(),s.abrupt("return");case 21:return h.value.addValue(e),s.next=24,D(e);case 24:if(s.sent){s.next=27;break}return s.abrupt("return");case 27:h.value.multiple||K(),t.valueBehavior===N.NEEDKEY&&(null===(l=h.value)||void 0===l?void 0:l.multiple)&&M();case 29:case"end":return s.stop()}}),s)})))}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:F,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:F,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;j(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="",j();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}})}}),j=(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)(F,{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)(j,{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)(F,{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})()));
|
@@ -0,0 +1 @@
|
|
1
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
@@ -189,7 +189,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
189
189
|
conditions: ICommonItem[];
|
190
190
|
showInputBefore: boolean;
|
191
191
|
showCondition: boolean;
|
192
|
-
}>>;
|
192
|
+
}, {}>>;
|
193
193
|
wrapRef: import("vue").Ref<HTMLDivElement>;
|
194
194
|
isFocus: import("vue").Ref<boolean>;
|
195
195
|
copyData: ShallowRef<ISearchItem[]>;
|
@@ -357,5 +357,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
357
357
|
valueSplitCode: string;
|
358
358
|
shrink: boolean;
|
359
359
|
uniqueSelect: boolean;
|
360
|
-
}>;
|
360
|
+
}, {}>;
|
361
361
|
export default _default;
|
@@ -118,7 +118,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
118
118
|
conditions: ICommonItem[];
|
119
119
|
showInputBefore: boolean;
|
120
120
|
showCondition: boolean;
|
121
|
-
}>>;
|
121
|
+
}, {}>>;
|
122
122
|
editKey: import("vue").Ref<String>;
|
123
123
|
copySeletedItem: (item: SelectedItem) => SelectedItem;
|
124
124
|
handleDeleteSelected: (index: number) => void;
|
@@ -151,5 +151,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
151
151
|
}, {
|
152
152
|
conditions: ICommonItem[];
|
153
153
|
overflowIndex: number;
|
154
|
-
}>;
|
154
|
+
}, {}>;
|
155
155
|
export default _default;
|
@@ -9,9 +9,9 @@ export declare enum ValueBehavior {
|
|
9
9
|
ALL = "all",
|
10
10
|
NEEDKEY = "need-key"
|
11
11
|
}
|
12
|
-
export
|
13
|
-
export
|
14
|
-
export
|
12
|
+
export type GetMenuListFunc = (item: ISearchItem, keyword: string) => Promise<ISearchItem[]>;
|
13
|
+
export type ValidateValuesFunc = (item: ISearchItem, values: ICommonItem[]) => Promise<string | true>;
|
14
|
+
export type MenuSlotParams = {
|
15
15
|
item: ISearchItem;
|
16
16
|
list: ISearchItem[];
|
17
17
|
hoverId: string;
|
@@ -62,7 +62,7 @@ export interface IMenuFooterItem {
|
|
62
62
|
name: string;
|
63
63
|
disabled?: boolean;
|
64
64
|
}
|
65
|
-
export
|
65
|
+
export type SearchItemType = 'text' | 'default' | 'condition';
|
66
66
|
export declare class SelectedItem {
|
67
67
|
searchItem: ISearchItem;
|
68
68
|
type: SearchItemType;
|