@moubing/bing-ui 0.11.2 → 0.12.0
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/README.md +300 -171
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/bing-ui.css +1 -1
- package/dist/components/BingAnimatedText/BingAnimatedText.js +7 -0
- package/dist/components/BingAnimatedText/BingAnimatedText.vue_vue_type_script_setup_true_lang.js +194 -0
- package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.js +7 -0
- package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BingAutocomplete/BingAutocomplete.js +7 -0
- package/dist/components/BingAutocomplete/BingAutocomplete.vue.d.ts +4 -4
- package/dist/components/BingAutocomplete/BingAutocomplete.vue_vue_type_script_setup_true_lang.js +560 -0
- package/dist/components/BingButton/BingButton.js +7 -0
- package/dist/components/BingButton/BingButton.vue.d.ts +2 -2
- package/dist/components/BingButton/BingButton.vue_vue_type_script_setup_true_lang.js +200 -0
- package/dist/components/BingCard/BingCard.js +7 -0
- package/dist/components/BingCard/BingCard.vue_vue_type_script_setup_true_lang.js +481 -0
- package/dist/components/BingCarouselTransition/BingCarouselTransition.js +7 -0
- package/dist/components/BingCarouselTransition/BingCarouselTransition.vue_vue_type_script_setup_true_lang.js +174 -0
- package/dist/components/BingCheckbox/BingCheckbox.js +7 -0
- package/dist/components/BingCheckbox/BingCheckbox.vue.d.ts +4 -4
- package/dist/components/BingCheckbox/BingCheckbox.vue_vue_type_script_setup_true_lang.js +233 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.context.js +4 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.js +7 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.highlight.js +78 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.js +7 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.vue_vue_type_script_setup_true_lang.js +347 -0
- package/dist/components/BingColorPicker/BingColorPicker.js +7 -0
- package/dist/components/BingColorPicker/BingColorPicker.utils.d.ts +70 -0
- package/dist/components/BingColorPicker/BingColorPicker.utils.js +265 -0
- package/dist/components/BingColorPicker/BingColorPicker.vue.d.ts +7 -7
- package/dist/components/BingColorPicker/BingColorPicker.vue_vue_type_script_setup_true_lang.js +540 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.js +7 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue.d.ts +27 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.js +7 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue.d.ts +26 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.js +5 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.types.d.ts +5 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.vue.d.ts +18 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/components/BingConfigProvider/index.d.ts +3 -0
- package/dist/components/BingCursor/BingCursor.controller.js +240 -0
- package/dist/components/BingCursor/BingCursor.js +7 -0
- package/dist/components/BingCursor/BingCursor.native.js +20 -0
- package/dist/components/BingCursor/BingCursor.presets.js +60 -0
- package/dist/components/BingCursor/BingCursor.shapes.js +83 -0
- package/dist/components/BingCursor/BingCursor.styleSource.js +83 -0
- package/dist/components/BingCursor/BingCursor.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/BingDatePicker/BingDatePicker.js +7 -0
- package/dist/components/BingDatePicker/BingDatePicker.utils.d.ts +26 -0
- package/dist/components/BingDatePicker/BingDatePicker.utils.js +137 -0
- package/dist/components/BingDatePicker/BingDatePicker.vue.d.ts +14 -14
- package/dist/components/BingDatePicker/BingDatePicker.vue_vue_type_script_setup_true_lang.js +804 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.js +7 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.vue.d.ts +37 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.vue_vue_type_script_setup_true_lang.js +248 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.js +7 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue.d.ts +26 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue_vue_type_script_setup_true_lang.js +97 -0
- package/dist/components/BingDeckTransition/BingDeckTransition.js +7 -0
- package/dist/components/BingDeckTransition/BingDeckTransition.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/BingDialog/BingDialog.js +7 -0
- package/dist/components/BingDialog/BingDialog.vue.d.ts +4 -5
- package/dist/components/BingDialog/BingDialog.vue_vue_type_script_setup_true_lang.js +558 -0
- package/dist/components/BingDropDown/BingDropDown.context.js +4 -0
- package/dist/components/BingDropDown/BingDropDown.js +7 -0
- package/dist/components/BingDropDown/BingDropDown.vue.d.ts +1 -2
- package/dist/components/BingDropDown/BingDropDown.vue_vue_type_script_setup_true_lang.js +649 -0
- package/dist/components/BingDropDown/BingDropDownItem.js +7 -0
- package/dist/components/BingDropDown/BingDropDownItem.vue.d.ts +1 -1
- package/dist/components/BingDropDown/BingDropDownItem.vue_vue_type_script_setup_true_lang.js +308 -0
- package/dist/components/BingFilePreview/BingFilePreview.js +7 -0
- package/dist/components/BingFilePreview/BingFilePreview.vue.d.ts +4 -5
- package/dist/components/BingFilePreview/BingFilePreview.vue_vue_type_script_setup_true_lang.js +589 -0
- package/dist/components/BingForm/BingForm.context.js +7 -0
- package/dist/components/BingForm/BingForm.js +7 -0
- package/dist/components/BingForm/BingForm.vue.d.ts +0 -1
- package/dist/components/BingForm/BingForm.vue_vue_type_script_setup_true_lang.js +300 -0
- package/dist/components/BingForm/formFocus.js +13 -0
- package/dist/components/BingForm/formTabOrder.js +27 -0
- package/dist/components/BingForm/useFormControl.d.ts +1 -1
- package/dist/components/BingForm/useFormControl.js +24 -0
- package/dist/components/BingForm/useFormNextHint.js +135 -0
- package/dist/components/BingFormItem/BingFormItem.js +7 -0
- package/dist/components/BingFormItem/BingFormItem.vue.d.ts +1 -1
- package/dist/components/BingFormItem/BingFormItem.vue_vue_type_script_setup_true_lang.js +252 -0
- package/dist/components/BingIcon/BingIcon.js +7 -0
- package/dist/components/BingIcon/BingIcon.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/BingImage/BingImage.js +7 -0
- package/dist/components/BingImage/BingImage.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BingImagePreview/BingImagePreview.js +7 -0
- package/dist/components/BingImagePreview/BingImagePreview.vue.d.ts +4 -5
- package/dist/components/BingImagePreview/BingImagePreview.vue_vue_type_script_setup_true_lang.js +699 -0
- package/dist/components/BingInput/BingInput.js +7 -0
- package/dist/components/BingInput/BingInput.vue.d.ts +6 -6
- package/dist/components/BingInput/BingInput.vue_vue_type_script_setup_true_lang.js +311 -0
- package/dist/components/BingRadio/BingRadio.js +7 -0
- package/dist/components/BingRadio/BingRadio.vue.d.ts +4 -4
- package/dist/components/BingRadio/BingRadio.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.context.js +4 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.js +7 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.vue.d.ts +4 -4
- package/dist/components/BingRadioGroup/BingRadioGroup.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/components/BingResizable/BingResizable.js +7 -0
- package/dist/components/BingResizable/BingResizable.vue.d.ts +1 -1
- package/dist/components/BingResizable/BingResizable.vue_vue_type_script_setup_true_lang.js +555 -0
- package/dist/components/BingScrollbar/BingScrollbar.js +7 -0
- package/dist/components/BingScrollbar/BingScrollbar.vue.d.ts +2 -2
- package/dist/components/BingScrollbar/BingScrollbar.vue_vue_type_script_setup_true_lang.js +398 -0
- package/dist/components/BingSelect/BingSelect.js +7 -0
- package/dist/components/BingSelect/BingSelect.vue.d.ts +7 -7
- package/dist/components/BingSelect/BingSelect.vue_vue_type_script_setup_true_lang.js +1066 -0
- package/dist/components/BingSlider/BingSlider.js +7 -0
- package/dist/components/BingSlider/BingSlider.vue.d.ts +6 -6
- package/dist/components/BingSlider/BingSlider.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/components/BingSortableList/BingSortableList.js +7 -0
- package/dist/components/BingSortableList/BingSortableList.vue_vue_type_script_setup_true_lang.js +334 -0
- package/dist/components/BingSortableList/BingSortableListItem.js +7 -0
- package/dist/components/BingSortableList/BingSortableListItem.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/components/BingSplitPane/BingSplitPane.js +7 -0
- package/dist/components/BingSplitPane/BingSplitPane.vue_vue_type_script_setup_true_lang.js +167 -0
- package/dist/components/BingTable/BingTable.js +7 -0
- package/dist/components/BingTable/BingTable.measurements.js +72 -0
- package/dist/components/BingTable/BingTable.vue.d.ts +1 -2
- package/dist/components/BingTable/BingTable.vue_vue_type_script_setup_true_lang.js +1416 -0
- package/dist/components/BingTable/BingTableCellValue.js +7 -0
- package/dist/components/BingTable/BingTableCellValue.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/components/BingTable/BingTableHeaderCell.js +5 -0
- package/dist/components/BingTable/BingTableHeaderCell.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/BingTable/BingTableHeaderContent.js +7 -0
- package/dist/components/BingTable/BingTableHeaderContent.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/components/BingTable/useTableColumns.js +126 -0
- package/dist/components/BingTableColumnControls/BingTableColumnControls.js +7 -0
- package/dist/components/BingTableColumnControls/BingTableColumnControls.vue.d.ts +1 -1
- package/dist/components/BingTableColumnControls/BingTableColumnControls.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/components/BingTabs/BingTabs.js +7 -0
- package/dist/components/BingTabs/BingTabs.vue.d.ts +2 -3
- package/dist/components/BingTabs/BingTabs.vue_vue_type_script_setup_true_lang.js +320 -0
- package/dist/components/BingTag/BingTag.js +7 -0
- package/dist/components/BingTag/BingTag.vue.d.ts +0 -1
- package/dist/components/BingTag/BingTag.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/components/BingTextarea/BingTextarea.js +7 -0
- package/dist/components/BingTextarea/BingTextarea.vue.d.ts +6 -6
- package/dist/components/BingTextarea/BingTextarea.vue_vue_type_script_setup_true_lang.js +243 -0
- package/dist/components/BingToast/BingToast.js +7 -0
- package/dist/components/BingToast/BingToast.service.js +132 -0
- package/dist/components/BingToast/BingToast.types.d.ts +1 -1
- package/dist/components/BingToast/BingToast.types.js +19 -0
- package/dist/components/BingToast/BingToast.vue.d.ts +0 -1
- package/dist/components/BingToast/BingToast.vue_vue_type_script_setup_true_lang.js +307 -0
- package/dist/components/BingTooltip/BingTooltip.js +7 -0
- package/dist/components/BingTooltip/BingTooltip.shared.js +14 -0
- package/dist/components/BingTooltip/BingTooltip.vue.d.ts +4 -5
- package/dist/components/BingTooltip/BingTooltip.vue_vue_type_script_setup_true_lang.js +572 -0
- package/dist/components/BingTreeSelect/BingTreeSelect.js +7 -0
- package/dist/components/BingTreeSelect/BingTreeSelect.vue.d.ts +7 -7
- package/dist/components/BingTreeSelect/BingTreeSelect.vue_vue_type_script_setup_true_lang.js +1274 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/icons/LICENSE-lucide.txt +39 -0
- package/dist/icons/createIcon.d.ts +8 -0
- package/dist/icons/createIcon.js +36 -0
- package/dist/icons/icons.d.ts +51 -0
- package/dist/icons/icons.js +252 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/index.js +48 -0
- package/dist/motion/clickParticles.d.ts +1 -1
- package/dist/motion/clickParticles2.js +66 -0
- package/dist/motion/index.d.ts +1 -1
- package/dist/motion/index.js +17 -0
- package/dist/motion/liquidHover.js +36 -0
- package/dist/motion/optionDetailMotion.d.ts +7 -1
- package/dist/motion/optionDetailMotion.js +74 -0
- package/dist/motion/panelMotion.js +19 -0
- package/dist/motion/reducedMotion.d.ts +16 -0
- package/dist/motion/reducedMotion.js +28 -0
- package/dist/motion/selectPanelMotion.js +115 -0
- package/dist/motion/smoothScroll.d.ts +2 -0
- package/dist/motion/smoothScroll.js +276 -0
- package/dist/motion/useClickFeedback.js +47 -0
- package/dist/motion/useTextControlCaret.js +136 -0
- package/dist/utils/clipboard.d.ts +9 -0
- package/dist/utils/clipboard.js +16 -0
- package/dist/utils/config.d.ts +42 -0
- package/dist/utils/config.js +37 -0
- package/dist/utils/controlAttrs.js +37 -0
- package/dist/utils/floating.d.ts +86 -0
- package/dist/utils/floating.js +99 -0
- package/dist/utils/glass.js +25 -0
- package/dist/utils/overlay.js +94 -0
- package/dist/utils/scrollLock.js +44 -0
- package/dist/utils/search.d.ts +16 -0
- package/dist/utils/search.js +23 -0
- package/dist/utils/useClientReady.js +10 -0
- package/dist/utils/useDeferredBlurValidation.d.ts +18 -0
- package/dist/utils/useDeferredBlurValidation.js +34 -0
- package/dist/utils/useKeyboardScrollSync.d.ts +11 -0
- package/dist/utils/useKeyboardScrollSync.js +28 -0
- package/dist/utils/useOptionDetailPanel.d.ts +50 -0
- package/dist/utils/useOptionDetailPanel.js +180 -0
- package/dist/utils/useOutsidePointerDown.d.ts +8 -0
- package/dist/utils/useOutsidePointerDown.js +17 -0
- package/dist/utils/useSearchShortcutFocus.d.ts +18 -0
- package/dist/utils/useSearchShortcutFocus.js +47 -0
- package/dist/utils/useVirtualList.d.ts +42 -0
- package/dist/utils/useVirtualList.js +74 -0
- package/package.json +15 -9
- package/dist/bing-ui.es.js +0 -31278
- package/dist/bing-ui.umd.js +0 -229
|
@@ -0,0 +1,1066 @@
|
|
|
1
|
+
import { useConfigZIndex as e } from "../../utils/config.js";
|
|
2
|
+
import { useReducedMotion as t } from "../../motion/reducedMotion.js";
|
|
3
|
+
import { createSelectPanelEnter as n, createSelectPanelLeave as r } from "../../motion/selectPanelMotion.js";
|
|
4
|
+
import { enterLiquidHover as i, leaveLiquidHover as a } from "../../motion/liquidHover.js";
|
|
5
|
+
import { useClickFeedback as ee } from "../../motion/useClickFeedback.js";
|
|
6
|
+
import { isolateFormControls as te, useFormControl as ne } from "../BingForm/useFormControl.js";
|
|
7
|
+
import re from "../BingButton/BingButton.js";
|
|
8
|
+
import { CheckCheck as ie, ChevronDown as ae, ListX as oe, Search as se, X as ce } from "../../icons/icons.js";
|
|
9
|
+
import o from "../BingIcon/BingIcon.js";
|
|
10
|
+
import le from "../BingInput/BingInput.js";
|
|
11
|
+
import { compactSmoothScrollOptions as ue, resolveComponentSmoothScroll as de } from "../../motion/smoothScroll.js";
|
|
12
|
+
import fe from "../BingScrollbar/BingScrollbar.js";
|
|
13
|
+
import { useOverlay as pe } from "../../utils/overlay.js";
|
|
14
|
+
import { useClientReady as me } from "../../utils/useClientReady.js";
|
|
15
|
+
import { createGlassCssVariables as he, defaultGlassEffect as s } from "../../utils/glass.js";
|
|
16
|
+
import ge from "../BingCheckbox/BingCheckbox.js";
|
|
17
|
+
import { computeFloatingPosition as _e, getAvailableSpace as ve, isVerticalSide as ye, resolveFloatingSide as be, useFloatingAutoUpdate as xe } from "../../utils/floating.js";
|
|
18
|
+
import { getMetaEntries as Se, normalizeSearchText as Ce, searchQueryMatches as we } from "../../utils/search.js";
|
|
19
|
+
import { useKeyboardScrollSync as Te } from "../../utils/useKeyboardScrollSync.js";
|
|
20
|
+
import { useDeferredBlurValidation as Ee } from "../../utils/useDeferredBlurValidation.js";
|
|
21
|
+
import { useOutsidePointerDown as De } from "../../utils/useOutsidePointerDown.js";
|
|
22
|
+
import { useSearchShortcutFocus as Oe } from "../../utils/useSearchShortcutFocus.js";
|
|
23
|
+
import { useVirtualList as ke } from "../../utils/useVirtualList.js";
|
|
24
|
+
import { useOptionDetailPanel as Ae } from "../../utils/useOptionDetailPanel.js";
|
|
25
|
+
import je from "../BingTag/BingTag.js";
|
|
26
|
+
import Me from "../BingTooltip/BingTooltip.js";
|
|
27
|
+
import { Fragment as Ne, Teleport as Pe, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as Fe, createVNode as p, defineComponent as Ie, nextTick as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as Le, onMounted as Re, openBlock as _, ref as v, renderList as ze, renderSlot as Be, toDisplayString as y, unref as b, useId as Ve, useSlots as He, watch as Ue, withCtx as We, withDirectives as Ge, withModifiers as Ke } from "vue";
|
|
28
|
+
import { gsap as qe } from "gsap";
|
|
29
|
+
//#region src/components/BingSelect/BingSelect.vue?vue&type=script&setup=true&lang.ts
|
|
30
|
+
var Je = { class: "bing-select__control" }, Ye = [
|
|
31
|
+
"id",
|
|
32
|
+
"disabled",
|
|
33
|
+
"aria-label",
|
|
34
|
+
"aria-describedby",
|
|
35
|
+
"aria-invalid",
|
|
36
|
+
"aria-expanded",
|
|
37
|
+
"aria-activedescendant"
|
|
38
|
+
], Xe = {
|
|
39
|
+
key: 0,
|
|
40
|
+
class: "bing-select__tags-placeholder"
|
|
41
|
+
}, Ze = ["aria-multiselectable"], Qe = [
|
|
42
|
+
"id",
|
|
43
|
+
"data-option-index",
|
|
44
|
+
"disabled",
|
|
45
|
+
"aria-selected",
|
|
46
|
+
"onClick",
|
|
47
|
+
"onMouseenter",
|
|
48
|
+
"onMousemove",
|
|
49
|
+
"onMouseleave"
|
|
50
|
+
], $e = { class: "bing-select__option-surface" }, et = { class: "bing-select__option-main" }, tt = { class: "bing-select__option-label" }, nt = {
|
|
51
|
+
key: 0,
|
|
52
|
+
class: "bing-select__empty"
|
|
53
|
+
}, rt = { class: "bing-select__option-detail-title" }, it = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "bing-select__option-detail-text"
|
|
56
|
+
}, at = { class: "bing-select__option-detail-meta-key" }, ot = { class: "bing-select__option-detail-meta-value" }, st = 240, x = /* @__PURE__ */ Ie({
|
|
57
|
+
__name: "BingSelect",
|
|
58
|
+
props: {
|
|
59
|
+
id: { default: void 0 },
|
|
60
|
+
modelValue: { default: null },
|
|
61
|
+
options: { default: () => [] },
|
|
62
|
+
multiple: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: !1
|
|
65
|
+
},
|
|
66
|
+
placeholder: { default: "请选择选项" },
|
|
67
|
+
disabled: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: void 0
|
|
70
|
+
},
|
|
71
|
+
clearable: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: !0
|
|
74
|
+
},
|
|
75
|
+
showSelectAll: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: !0
|
|
78
|
+
},
|
|
79
|
+
selectAllText: { default: "全选" },
|
|
80
|
+
clearAllText: { default: "清空已选" },
|
|
81
|
+
emptyText: { default: "暂无选项" },
|
|
82
|
+
searchable: {
|
|
83
|
+
type: [Boolean, String],
|
|
84
|
+
default: "auto"
|
|
85
|
+
},
|
|
86
|
+
searchPlaceholder: { default: "搜索选项(/)" },
|
|
87
|
+
noSearchResultsText: { default: "未找到匹配选项" },
|
|
88
|
+
smoothScroll: {
|
|
89
|
+
type: [Boolean, Object],
|
|
90
|
+
default: !0
|
|
91
|
+
},
|
|
92
|
+
size: { default: void 0 },
|
|
93
|
+
block: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: !1
|
|
96
|
+
},
|
|
97
|
+
width: { default: void 0 },
|
|
98
|
+
minWidth: { default: 180 },
|
|
99
|
+
panelMinHeight: { default: 0 },
|
|
100
|
+
panelMaxHeight: { default: 320 },
|
|
101
|
+
panelPlacement: { default: "auto" },
|
|
102
|
+
panelAlign: { default: "start" },
|
|
103
|
+
panelGap: { default: 10 },
|
|
104
|
+
virtual: {
|
|
105
|
+
type: [Boolean, String],
|
|
106
|
+
default: "auto"
|
|
107
|
+
},
|
|
108
|
+
virtualThreshold: { default: 80 },
|
|
109
|
+
virtualItemHeight: { default: void 0 },
|
|
110
|
+
virtualOverscan: { default: 4 },
|
|
111
|
+
ariaLabel: { default: void 0 },
|
|
112
|
+
ariaDescribedby: { default: void 0 },
|
|
113
|
+
status: { default: void 0 },
|
|
114
|
+
glass: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: s.glass
|
|
117
|
+
},
|
|
118
|
+
glassBlur: { default: void 0 },
|
|
119
|
+
glassOpacity: { default: void 0 },
|
|
120
|
+
glassSaturation: { default: void 0 }
|
|
121
|
+
},
|
|
122
|
+
emits: [
|
|
123
|
+
"update:modelValue",
|
|
124
|
+
"change",
|
|
125
|
+
"clear",
|
|
126
|
+
"open",
|
|
127
|
+
"close"
|
|
128
|
+
],
|
|
129
|
+
setup(s, { emit: Ie }) {
|
|
130
|
+
let x = t(), { vClickFeedback: ct, playClickFeedback: lt } = ee(), S = s, C = Ie, ut = me(), { formItem: dt, resolvedId: ft, resolvedSize: pt, resolvedDisabled: w, resolvedStatus: mt, resolvedAriaDescribedby: ht } = ne(S);
|
|
131
|
+
te();
|
|
132
|
+
let gt = He(), _t = c(() => de(S.smoothScroll, ue, {
|
|
133
|
+
keyboard: !1,
|
|
134
|
+
smoothTouchpad: !1,
|
|
135
|
+
respectReducedMotion: !0
|
|
136
|
+
})), vt = `bing-select-${Ve()}`, yt = `${vt}-listbox`, T = v(null), E = v(null), bt = v(null), xt = v(null), St = v(null), D = v(null), Ct = v(null), O = v(null), k = v(null), A = v(null), wt = v(null), Tt = v([]), j = v(!1), Et = v(!1), M = v(-1), N = v(!1), Dt = v(""), P = v(2 ** 53 - 1), Ot = v(0), F = v({
|
|
137
|
+
align: "start",
|
|
138
|
+
left: 0,
|
|
139
|
+
minHeight: 0,
|
|
140
|
+
maxHeight: 320,
|
|
141
|
+
placement: "bottom",
|
|
142
|
+
top: 0,
|
|
143
|
+
width: 0
|
|
144
|
+
}), I, L, kt = 0, At = De(lr), jt = Oe({
|
|
145
|
+
input: bt,
|
|
146
|
+
isOpen: () => j.value,
|
|
147
|
+
isSearchable: () => en.value
|
|
148
|
+
}), Mt = Ee({
|
|
149
|
+
formItem: dt,
|
|
150
|
+
isOpen: () => j.value,
|
|
151
|
+
isInteractionTarget: or
|
|
152
|
+
}), { isSyncing: Nt, start: Pt, scheduleEnd: Ft, finish: It } = Te(N), R = Ae({
|
|
153
|
+
listPanel: D,
|
|
154
|
+
detailPanel: A,
|
|
155
|
+
detailContent: wt,
|
|
156
|
+
itemSelector: ".bing-select__option",
|
|
157
|
+
indexAttribute: "optionIndex",
|
|
158
|
+
isOpen: () => j.value,
|
|
159
|
+
isKeyboardNavigating: N,
|
|
160
|
+
getItemState: (e) => {
|
|
161
|
+
let t = S.options[e];
|
|
162
|
+
return t ? {
|
|
163
|
+
disabled: t.disabled,
|
|
164
|
+
hasDetail: Bn(t)
|
|
165
|
+
} : void 0;
|
|
166
|
+
},
|
|
167
|
+
getItemElement: Xn,
|
|
168
|
+
getItemSurface: fr,
|
|
169
|
+
getKeyboardIndex: () => M.value,
|
|
170
|
+
onPointerRestore: (e) => {
|
|
171
|
+
M.value = e;
|
|
172
|
+
}
|
|
173
|
+
}), { index: Lt, shouldRender: Rt, placement: zt } = R, Bt = c(() => typeof S.panelMaxHeight == "number" ? `${S.panelMaxHeight}px` : S.panelMaxHeight), Vt = c(() => typeof S.panelMinHeight == "number" ? `${S.panelMinHeight}px` : S.panelMinHeight), Ht = c(() => Math.max(0, Math.floor(S.virtualThreshold))), Ut = c(() => ({
|
|
174
|
+
sm: 28,
|
|
175
|
+
md: 32,
|
|
176
|
+
lg: 36
|
|
177
|
+
})[pt.value] + (gt.option ? 16 : 0)), Wt = c(() => S.virtualItemHeight !== void 0 && Number.isFinite(S.virtualItemHeight) ? Math.max(28, Math.floor(S.virtualItemHeight)) : Ut.value), Gt = c(() => Math.max(0, Math.floor(S.virtualOverscan))), z = ke({
|
|
178
|
+
count: () => V.value.length,
|
|
179
|
+
mode: () => S.virtual,
|
|
180
|
+
threshold: () => Ht.value,
|
|
181
|
+
itemHeight: () => Wt.value,
|
|
182
|
+
overscan: () => Gt.value,
|
|
183
|
+
scrollbar: k,
|
|
184
|
+
fallbackViewportHeight: Ot,
|
|
185
|
+
itemHeightVar: "--bing-select-virtual-item-height"
|
|
186
|
+
}), { enabled: B, viewportHeight: Kt, startIndex: qt, endIndex: Jt, bodyStyle: Yt, stackStyle: Xt, refresh: Zt, clampScroll: Qt } = z, $t = c(() => Ce(Dt.value)), en = c(() => S.searchable === !0 ? !0 : S.searchable === !1 ? !1 : S.options.length > 8), tn = c(() => S.searchPlaceholder.includes("/") ? S.searchPlaceholder : `${S.searchPlaceholder} (/)`), V = c(() => {
|
|
187
|
+
let e = S.options.map((e, t) => ({
|
|
188
|
+
index: t,
|
|
189
|
+
option: e
|
|
190
|
+
})), t = en.value ? $t.value : "";
|
|
191
|
+
return t ? e.filter(({ option: e }) => Fn(e, t)) : e;
|
|
192
|
+
}), nn = c(() => V.value.map((e) => e.option)), rn = c(() => en.value && $t.value.length > 0), an = c(() => {
|
|
193
|
+
let e = {
|
|
194
|
+
"--bing-select-min-width": An(S.minWidth),
|
|
195
|
+
...on.value
|
|
196
|
+
};
|
|
197
|
+
return S.width !== void 0 && (e["--bing-select-width"] = An(S.width)), e;
|
|
198
|
+
}), on = c(() => he("bing-select", {
|
|
199
|
+
glass: S.glass,
|
|
200
|
+
glassBlur: S.glassBlur,
|
|
201
|
+
glassOpacity: S.glassOpacity,
|
|
202
|
+
glassSaturation: S.glassSaturation
|
|
203
|
+
})), sn = c(() => [
|
|
204
|
+
"bing-select",
|
|
205
|
+
`bing-select--${pt.value}`,
|
|
206
|
+
`bing-select--status-${mt.value}`,
|
|
207
|
+
{
|
|
208
|
+
"is-open": j.value,
|
|
209
|
+
"is-disabled": w.value,
|
|
210
|
+
"is-invalid": mt.value === "error",
|
|
211
|
+
"is-block": S.block || !!dt,
|
|
212
|
+
"has-value": K.value,
|
|
213
|
+
"is-multiple": S.multiple
|
|
214
|
+
}
|
|
215
|
+
]), cn = c(() => [
|
|
216
|
+
"bing-select__panel",
|
|
217
|
+
`is-placement-${F.value.placement}`,
|
|
218
|
+
`is-align-${F.value.align}`,
|
|
219
|
+
{
|
|
220
|
+
"is-glass": S.glass,
|
|
221
|
+
"is-multiple": S.multiple,
|
|
222
|
+
"is-keyboard-navigating": N.value,
|
|
223
|
+
"is-keyboard-scrolling": Nt.value
|
|
224
|
+
}
|
|
225
|
+
]), ln = xe(() => {
|
|
226
|
+
Yn(), Zt(), R.updatePosition();
|
|
227
|
+
}, { enabled: () => j.value }), un = e("popover"), dn = pe({
|
|
228
|
+
open: () => Et.value,
|
|
229
|
+
elements: () => [
|
|
230
|
+
T.value,
|
|
231
|
+
D.value,
|
|
232
|
+
O.value,
|
|
233
|
+
A.value
|
|
234
|
+
],
|
|
235
|
+
zIndex: () => un.value,
|
|
236
|
+
onEscape: () => $(!0)
|
|
237
|
+
}), fn = c(() => ({
|
|
238
|
+
position: "fixed",
|
|
239
|
+
top: `${F.value.top}px`,
|
|
240
|
+
left: `${F.value.left}px`,
|
|
241
|
+
width: `${F.value.width}px`,
|
|
242
|
+
zIndex: dn.zIndex.value,
|
|
243
|
+
"--bing-select-panel-min-height": `${F.value.minHeight}px`,
|
|
244
|
+
"--bing-select-panel-max-height": `${F.value.maxHeight}px`,
|
|
245
|
+
"--bing-select-option-height": `${B.value ? Wt.value : Ut.value}px`,
|
|
246
|
+
...on.value
|
|
247
|
+
})), pn = c(() => {
|
|
248
|
+
let e = F.value.left - 32 - 8, t = F.value.left + F.value.width + 8, n = e >= 8 || !Y() ? e : Jn(t, 8, Math.max(8, window.innerWidth - 32 - 8));
|
|
249
|
+
return {
|
|
250
|
+
position: "fixed",
|
|
251
|
+
top: `${F.value.top}px`,
|
|
252
|
+
left: `${n}px`,
|
|
253
|
+
zIndex: dn.zIndex.value + 1,
|
|
254
|
+
...on.value
|
|
255
|
+
};
|
|
256
|
+
}), mn = c(() => B.value ? V.value.slice(qt.value, Jt.value) : V.value), hn = c(() => {
|
|
257
|
+
if (B.value) return { height: `${Wt.value}px` };
|
|
258
|
+
}), H = c(() => {
|
|
259
|
+
let e = S.modelValue;
|
|
260
|
+
return S.multiple ? Array.isArray(e) ? e : e === null ? [] : [e] : Array.isArray(e) ? e.length > 0 ? [e[0]] : [] : e === null ? [] : [e];
|
|
261
|
+
}), U = c(() => In(H.value)), W = c(() => S.multiple && !gt.value), gn = c(() => U.value.slice(0, P.value)), _n = c(() => Math.max(0, U.value.length - P.value)), vn = c(() => pt.value === "lg" ? "md" : "sm"), G = c(() => nn.value.filter((e) => !e.disabled)), yn = c(() => G.value.map((e) => e.value)), bn = c(() => G.value.filter((e) => X(e)).length), K = c(() => U.value.length > 0), xn = c(() => S.clearable && !w.value && K.value), Sn = c(() => S.multiple && S.showSelectAll), Cn = c(() => G.value.length > 0), q = c(() => Cn.value && G.value.every((e) => Mn(H.value, e.value))), wn = c(() => G.value.some((e) => Mn(H.value, e.value)) && !q.value), Tn = c(() => j.value && M.value >= 0 ? Ln(M.value) : void 0), J = c(() => {
|
|
262
|
+
let e = S.options[Lt.value];
|
|
263
|
+
return Bn(e) ? e : void 0;
|
|
264
|
+
}), En = c(() => J.value ? X(J.value) : !1), Dn = c(() => J.value ? Rn(J.value) : void 0), On = c(() => zn(J.value)), kn = c(() => {
|
|
265
|
+
if (!K.value) return S.placeholder;
|
|
266
|
+
let e = U.value.map((e) => e.label);
|
|
267
|
+
return S.multiple && e.length > 2 ? `${e.slice(0, 2).join(", ")} +${e.length - 2}` : e.join(S.multiple ? ", " : "");
|
|
268
|
+
});
|
|
269
|
+
function Y() {
|
|
270
|
+
return typeof window < "u" && typeof document < "u";
|
|
271
|
+
}
|
|
272
|
+
function An(e) {
|
|
273
|
+
if (typeof e == "number") return `${e}px`;
|
|
274
|
+
let t = e.trim();
|
|
275
|
+
return /^-?\d+(\.\d+)?$/.test(t) ? `${t}px` : e;
|
|
276
|
+
}
|
|
277
|
+
function jn(e, t) {
|
|
278
|
+
return e === t;
|
|
279
|
+
}
|
|
280
|
+
function Mn(e, t) {
|
|
281
|
+
return e.some((e) => jn(e, t));
|
|
282
|
+
}
|
|
283
|
+
function Nn(e) {
|
|
284
|
+
return e.filter((t, n) => e.findIndex((e) => jn(e, t)) === n);
|
|
285
|
+
}
|
|
286
|
+
function Pn(e) {
|
|
287
|
+
return Ce([
|
|
288
|
+
e.label,
|
|
289
|
+
e.value,
|
|
290
|
+
e.description,
|
|
291
|
+
e.detail,
|
|
292
|
+
...zn(e).flatMap((e) => [e.key, e.value])
|
|
293
|
+
].join(" "));
|
|
294
|
+
}
|
|
295
|
+
function Fn(e, t) {
|
|
296
|
+
return we(Pn(e), t);
|
|
297
|
+
}
|
|
298
|
+
function In(e) {
|
|
299
|
+
let t = Array.isArray(e) ? e : e === null ? [] : [e];
|
|
300
|
+
return S.options.filter((e) => Mn(t, e.value));
|
|
301
|
+
}
|
|
302
|
+
function Ln(e) {
|
|
303
|
+
return `${vt}-option-${e}`;
|
|
304
|
+
}
|
|
305
|
+
function X(e) {
|
|
306
|
+
return Mn(H.value, e.value);
|
|
307
|
+
}
|
|
308
|
+
function Rn(e) {
|
|
309
|
+
return typeof e.detail == "string" && e.detail.trim() ? e.detail : e.description;
|
|
310
|
+
}
|
|
311
|
+
function zn(e) {
|
|
312
|
+
return Se(e?.meta);
|
|
313
|
+
}
|
|
314
|
+
function Bn(e) {
|
|
315
|
+
return e ? !!(gt["option-detail"] || Rn(e) || zn(e).length > 0) : !1;
|
|
316
|
+
}
|
|
317
|
+
function Z(e, t) {
|
|
318
|
+
Mt.cancel();
|
|
319
|
+
let n = {
|
|
320
|
+
value: e,
|
|
321
|
+
option: t,
|
|
322
|
+
options: In(e)
|
|
323
|
+
};
|
|
324
|
+
C("update:modelValue", e), C("change", n), dt?.handleControlChange();
|
|
325
|
+
}
|
|
326
|
+
function Vn() {
|
|
327
|
+
return V.value.find((e) => !e.option.disabled)?.index ?? -1;
|
|
328
|
+
}
|
|
329
|
+
function Hn() {
|
|
330
|
+
let e = V.value.find((e) => !e.option.disabled && X(e.option))?.index ?? -1;
|
|
331
|
+
M.value = e >= 0 ? e : Vn();
|
|
332
|
+
}
|
|
333
|
+
function Un() {
|
|
334
|
+
!Y() || !kt || (window.cancelAnimationFrame(kt), kt = 0);
|
|
335
|
+
}
|
|
336
|
+
function Wn() {
|
|
337
|
+
let e = U.value.length;
|
|
338
|
+
if (!W.value || e === 0) {
|
|
339
|
+
P.value = e;
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
let t = xt.value, n = St.value;
|
|
343
|
+
if (!t || !n || t.clientWidth <= 0) {
|
|
344
|
+
P.value = e;
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
let r = Array.from(n.querySelectorAll(".bing-select__measure-tag"), (e) => e.getBoundingClientRect().width), i = new Map(Array.from(n.querySelectorAll(".bing-select__measure-overflow"), (e) => [Number(e.dataset.overflowCount), e.getBoundingClientRect().width])), a = t.clientWidth;
|
|
348
|
+
if (r.reduce((e, t) => e + t, 0) + Math.max(0, r.length - 1) * 5 <= a) {
|
|
349
|
+
P.value = e;
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
let ee = 0, te = 0;
|
|
353
|
+
for (let t = 0; t < e - 1; t += 1) {
|
|
354
|
+
ee += (t > 0 ? 5 : 0) + (r[t] ?? 0);
|
|
355
|
+
let n = e - t - 1, ne = i.get(n) ?? 0;
|
|
356
|
+
if (ee + 5 + ne > a) break;
|
|
357
|
+
te = t + 1;
|
|
358
|
+
}
|
|
359
|
+
P.value = te;
|
|
360
|
+
}
|
|
361
|
+
function Q() {
|
|
362
|
+
Y() && (Un(), kt = window.requestAnimationFrame(() => {
|
|
363
|
+
kt = 0, Wn();
|
|
364
|
+
}));
|
|
365
|
+
}
|
|
366
|
+
function Gn() {
|
|
367
|
+
if (L?.disconnect(), L = void 0, !(!W.value || !Y())) {
|
|
368
|
+
if (typeof ResizeObserver > "u") {
|
|
369
|
+
window.addEventListener("resize", Q), Q();
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
L = new ResizeObserver(Q), xt.value && L.observe(xt.value), Q();
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
function Kn() {
|
|
376
|
+
if (typeof S.panelMaxHeight == "number") return Math.max(0, S.panelMaxHeight);
|
|
377
|
+
let e = Number.parseFloat(S.panelMaxHeight);
|
|
378
|
+
return Number.isFinite(e) ? Math.max(0, e) : 320;
|
|
379
|
+
}
|
|
380
|
+
function qn() {
|
|
381
|
+
if (typeof S.panelMinHeight == "number") return Math.max(0, S.panelMinHeight);
|
|
382
|
+
let e = Number.parseFloat(S.panelMinHeight);
|
|
383
|
+
return Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
384
|
+
}
|
|
385
|
+
function Jn(e, t, n) {
|
|
386
|
+
return Math.min(n, Math.max(t, e));
|
|
387
|
+
}
|
|
388
|
+
function Yn() {
|
|
389
|
+
if (!Y() || !T.value || !D.value) return;
|
|
390
|
+
let e = Number.isFinite(S.panelGap) ? Math.max(0, S.panelGap) : 10, t = T.value.getBoundingClientRect(), n = window.innerWidth, r = window.innerHeight, i = Kn(), a = Math.min(qn(), i), ee = D.value.querySelector(".bing-select__panel-body"), te = Ct.value?.getBoundingClientRect().height ?? 0, ne = z.getContentHeight() ?? ee?.scrollHeight ?? 0, re = B.value ? Wt.value : Ut.value, ie = Math.max(re, V.value.length * re), ae = te + (ne || ie) + 2, oe = Jn(ae, a, i), se = {
|
|
391
|
+
gap: e,
|
|
392
|
+
padding: 12,
|
|
393
|
+
viewport: {
|
|
394
|
+
width: n,
|
|
395
|
+
height: r
|
|
396
|
+
}
|
|
397
|
+
}, ce = S.panelPlacement === "auto" ? be({
|
|
398
|
+
anchor: t,
|
|
399
|
+
floating: {
|
|
400
|
+
width: 0,
|
|
401
|
+
height: oe
|
|
402
|
+
},
|
|
403
|
+
side: "bottom",
|
|
404
|
+
...se
|
|
405
|
+
}) : S.panelPlacement, o = S.panelAlign, le = ye(ce) ? ve(t, ce, se) : r - 24, ue = Math.max(0, Math.min(i, le)), de = Math.min(a, ue), fe = Jn(ae, de, ue), pe = Math.max(0, fe - te - 2), me = Math.max(0, n - 24), he = Math.min(Math.max(t.width, st), me), s = _e({
|
|
406
|
+
anchor: t,
|
|
407
|
+
floating: {
|
|
408
|
+
width: he,
|
|
409
|
+
height: fe
|
|
410
|
+
},
|
|
411
|
+
side: ce,
|
|
412
|
+
flip: "none",
|
|
413
|
+
align: o === "middle" ? "center" : o,
|
|
414
|
+
...se
|
|
415
|
+
}), ge = s.left, xe = s.top;
|
|
416
|
+
Ot.value = pe, Kt.value = pe, F.value = {
|
|
417
|
+
align: o,
|
|
418
|
+
left: ge,
|
|
419
|
+
minHeight: de,
|
|
420
|
+
maxHeight: ue,
|
|
421
|
+
placement: ce,
|
|
422
|
+
top: xe,
|
|
423
|
+
width: he
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
function Xn(e) {
|
|
427
|
+
return e < 0 || !Y() ? null : document.getElementById(Ln(e));
|
|
428
|
+
}
|
|
429
|
+
function Zn(e) {
|
|
430
|
+
let t = e.target;
|
|
431
|
+
if (t) {
|
|
432
|
+
if (z.readViewport(t), N.value) {
|
|
433
|
+
R.scheduleKeyboardShow(), Ft();
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
R.handleListScroll();
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
function Qn(e) {
|
|
440
|
+
R.rememberPointer(e);
|
|
441
|
+
}
|
|
442
|
+
function $n() {
|
|
443
|
+
let e = D.value;
|
|
444
|
+
return e ? Array.from(e.querySelectorAll(".bing-select__option")) : [];
|
|
445
|
+
}
|
|
446
|
+
function er() {
|
|
447
|
+
let e = D.value;
|
|
448
|
+
return e ? Array.from(e.querySelectorAll(".bing-select__option-liquid")) : [];
|
|
449
|
+
}
|
|
450
|
+
function tr() {
|
|
451
|
+
return Array.from(O.value?.querySelectorAll(".bing-select__action-button") ?? []);
|
|
452
|
+
}
|
|
453
|
+
function nr() {
|
|
454
|
+
I?.kill(), I = void 0;
|
|
455
|
+
}
|
|
456
|
+
function rr() {
|
|
457
|
+
let e = D.value;
|
|
458
|
+
if (!e) return;
|
|
459
|
+
let t = $n(), r = O.value, i = tr(), a = [
|
|
460
|
+
e,
|
|
461
|
+
r,
|
|
462
|
+
...i,
|
|
463
|
+
...t
|
|
464
|
+
].filter(Boolean);
|
|
465
|
+
if (nr(), qe.killTweensOf([...a, ...er()]), x()) {
|
|
466
|
+
qe.set(a, {
|
|
467
|
+
autoAlpha: 1,
|
|
468
|
+
x: 0,
|
|
469
|
+
y: 0,
|
|
470
|
+
scale: 1,
|
|
471
|
+
scaleX: 1,
|
|
472
|
+
scaleY: 1,
|
|
473
|
+
clearProps: "transform"
|
|
474
|
+
});
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
I = n({
|
|
478
|
+
panel: e,
|
|
479
|
+
items: t,
|
|
480
|
+
actionRail: r,
|
|
481
|
+
actionButtons: i,
|
|
482
|
+
placement: F.value.placement,
|
|
483
|
+
align: F.value.align,
|
|
484
|
+
onComplete: () => {
|
|
485
|
+
I = void 0;
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
function ir(e) {
|
|
490
|
+
Et.value = !1, M.value = -1, N.value = !1, It(), R.hide(!0), Sr(), e && E.value?.focus();
|
|
491
|
+
}
|
|
492
|
+
function ar(e = !1) {
|
|
493
|
+
let t = D.value;
|
|
494
|
+
if (!t) {
|
|
495
|
+
ir(e);
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
let n = $n(), i = O.value, a = tr();
|
|
499
|
+
if (nr(), qe.killTweensOf([
|
|
500
|
+
t,
|
|
501
|
+
i,
|
|
502
|
+
...a,
|
|
503
|
+
...n,
|
|
504
|
+
...er()
|
|
505
|
+
].filter(Boolean)), n.forEach((e) => e.classList.remove("is-liquid-active")), x()) {
|
|
506
|
+
ir(e);
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
I = r({
|
|
510
|
+
panel: t,
|
|
511
|
+
items: n,
|
|
512
|
+
actionRail: i,
|
|
513
|
+
actionButtons: a,
|
|
514
|
+
placement: F.value.placement,
|
|
515
|
+
align: F.value.align,
|
|
516
|
+
onComplete: () => {
|
|
517
|
+
I = void 0, ir(e);
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
function or(e) {
|
|
522
|
+
return e instanceof Node ? !!(T.value?.contains(e) || D.value?.contains(e) || O.value?.contains(e) || A.value?.contains(e)) : !1;
|
|
523
|
+
}
|
|
524
|
+
async function sr() {
|
|
525
|
+
w.value || j.value || (Et.value = !0, j.value = !0, Hn(), At.start(), jt.start(), ln.start(), C("open"), await m(), Yn(), Zt(), rr(), Dr(), await jt.focus(), N.value && R.scheduleKeyboardShow());
|
|
526
|
+
}
|
|
527
|
+
function $(e = !1) {
|
|
528
|
+
j.value && (k.value?.stop(), j.value = !1, It(), At.stop(), jt.stop(), ln.dispose(), R.hide(), C("close"), ar(e));
|
|
529
|
+
}
|
|
530
|
+
function cr() {
|
|
531
|
+
if (!w.value) {
|
|
532
|
+
if (j.value) {
|
|
533
|
+
$();
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
sr();
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
function lr(e) {
|
|
540
|
+
let t = T.value, n = D.value, r = O.value, i = A.value;
|
|
541
|
+
!t || !(e.target instanceof Node) || dn.contains(e.target) || !t.contains(e.target) && !n?.contains(e.target) && !r?.contains(e.target) && !i?.contains(e.target) && $();
|
|
542
|
+
}
|
|
543
|
+
function ur(e) {
|
|
544
|
+
e.stopPropagation(), E.value?.focus(), cr();
|
|
545
|
+
}
|
|
546
|
+
function dr(e) {
|
|
547
|
+
return e.querySelector(".bing-select__option-liquid");
|
|
548
|
+
}
|
|
549
|
+
function fr(e) {
|
|
550
|
+
return e.querySelector(".bing-select__option-surface") ?? e;
|
|
551
|
+
}
|
|
552
|
+
function pr(e, t, n) {
|
|
553
|
+
let r = fr(e).getBoundingClientRect(), i = Jn(n.clientX - r.left, 0, r.width), a = Jn(n.clientY - r.top, 0, r.height), ee = `${i}px ${a}px`;
|
|
554
|
+
t.style.setProperty("--bing-select-liquid-x", `${i}px`), t.style.setProperty("--bing-select-liquid-y", `${a}px`), t.style.transformOrigin = ee;
|
|
555
|
+
}
|
|
556
|
+
function mr(e, t, n) {
|
|
557
|
+
R.rememberPointer(e), N.value = !1, It(), M.value = t.disabled ? M.value : n;
|
|
558
|
+
let r = e.currentTarget;
|
|
559
|
+
if (t.disabled) {
|
|
560
|
+
R.hide(!0);
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
if (Bn(t) ? R.show(r, n) : R.hide(!0), x()) return;
|
|
564
|
+
let a = dr(r);
|
|
565
|
+
a && (r.classList.add("is-liquid-active"), pr(r, a, e), i(a));
|
|
566
|
+
}
|
|
567
|
+
function hr(e, t, n) {
|
|
568
|
+
R.rememberPointer(e), N.value = !1, It();
|
|
569
|
+
let r = e.currentTarget;
|
|
570
|
+
if (t.disabled) {
|
|
571
|
+
R.hide(!0);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
if (Bn(t) ? (R.cancelHide(), (Lt.value !== n || !Rt.value) && R.show(r, n)) : R.hide(!0), x()) return;
|
|
575
|
+
let a = dr(r);
|
|
576
|
+
a && (pr(r, a, e), r.classList.contains("is-liquid-active") || (r.classList.add("is-liquid-active"), i(a)));
|
|
577
|
+
}
|
|
578
|
+
function gr(e, t) {
|
|
579
|
+
if (t.disabled || x()) return;
|
|
580
|
+
let n = e.currentTarget, r = dr(n);
|
|
581
|
+
n.classList.remove("is-liquid-active"), r && a(r);
|
|
582
|
+
}
|
|
583
|
+
function _r(e) {
|
|
584
|
+
if (w.value || e.disabled) return;
|
|
585
|
+
let t = X(e);
|
|
586
|
+
if (S.multiple) {
|
|
587
|
+
Z(t ? H.value.filter((t) => !jn(t, e.value)) : Nn([...H.value, e.value]), e);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
Z(e.value, e), $(!0);
|
|
591
|
+
}
|
|
592
|
+
function vr() {
|
|
593
|
+
!S.multiple || w.value || !Cn.value || q.value || Z(Nn([...H.value, ...yn.value]));
|
|
594
|
+
}
|
|
595
|
+
function yr() {
|
|
596
|
+
!S.multiple || w.value || bn.value === 0 || Z(H.value.filter((e) => !Mn(yn.value, e)));
|
|
597
|
+
}
|
|
598
|
+
function br() {
|
|
599
|
+
if (q.value) {
|
|
600
|
+
yr();
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
vr();
|
|
604
|
+
}
|
|
605
|
+
function xr() {
|
|
606
|
+
if (!xn.value) return;
|
|
607
|
+
let e = S.multiple ? [] : null;
|
|
608
|
+
C("clear"), Z(e);
|
|
609
|
+
}
|
|
610
|
+
function Sr() {
|
|
611
|
+
Dt.value = "";
|
|
612
|
+
}
|
|
613
|
+
function Cr(e) {
|
|
614
|
+
w.value || (Z(H.value.filter((t) => !jn(t, e.value)), e), m(() => E.value?.focus()));
|
|
615
|
+
}
|
|
616
|
+
function wr(e) {
|
|
617
|
+
e.stopPropagation(), xr();
|
|
618
|
+
}
|
|
619
|
+
function Tr(e) {
|
|
620
|
+
e.stopPropagation();
|
|
621
|
+
}
|
|
622
|
+
function Er(e) {
|
|
623
|
+
if (e.key === "ArrowDown") {
|
|
624
|
+
e.preventDefault(), Or(1);
|
|
625
|
+
return;
|
|
626
|
+
}
|
|
627
|
+
if (e.key === "ArrowUp") {
|
|
628
|
+
e.preventDefault(), Or(-1);
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
if (e.key === "Home") {
|
|
632
|
+
e.preventDefault(), kr("first");
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
if (e.key === "End") {
|
|
636
|
+
e.preventDefault(), kr("last");
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
if (e.key === "Enter") {
|
|
640
|
+
e.preventDefault(), Ar(e);
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
if (e.key === "Escape" && Dt.value) {
|
|
644
|
+
Sr();
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
if (e.key === "Escape") {
|
|
648
|
+
$(!0);
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
e.key === "Tab" && $();
|
|
652
|
+
}
|
|
653
|
+
function Dr() {
|
|
654
|
+
M.value < 0 || m(() => {
|
|
655
|
+
if (B.value) {
|
|
656
|
+
z.scrollToIndex(V.value.findIndex((e) => e.index === M.value), { beforeScroll: Pt });
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
k.value?.stop(), Xn(M.value)?.scrollIntoView?.({ block: "nearest" });
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
function Or(e) {
|
|
663
|
+
let t = V.value;
|
|
664
|
+
if (t.length === 0) return;
|
|
665
|
+
let n = t.findIndex((e) => e.index === M.value);
|
|
666
|
+
n < 0 && (n = e > 0 ? -1 : 0);
|
|
667
|
+
for (let r = 0; r < t.length; r += 1) {
|
|
668
|
+
n = (n + e + t.length) % t.length;
|
|
669
|
+
let r = t[n];
|
|
670
|
+
if (r && !r.option.disabled) {
|
|
671
|
+
N.value = !0, M.value = r.index, Dr(), R.scheduleKeyboardShow();
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
function kr(e) {
|
|
677
|
+
let t = (e === "first" ? V.value : [...V.value].reverse()).find((e) => !e.option.disabled);
|
|
678
|
+
t && (N.value = !0, M.value = t.index, Dr(), R.scheduleKeyboardShow());
|
|
679
|
+
}
|
|
680
|
+
function Ar(e) {
|
|
681
|
+
let t = S.options[M.value];
|
|
682
|
+
!t || w.value || t.disabled || (lt(e, document.getElementById(Ln(M.value))), _r(t));
|
|
683
|
+
}
|
|
684
|
+
function jr(e) {
|
|
685
|
+
if (!(e.key === "Escape" && (e.defaultPrevented || !dn.isTop(e))) && !w.value && !jt.handleShortcut(e)) {
|
|
686
|
+
if (e.key === "Tab") {
|
|
687
|
+
$();
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
if (e.key === "Escape") {
|
|
691
|
+
j.value && (e.preventDefault(), $(!0));
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
if (e.key === "ArrowDown") {
|
|
695
|
+
if (e.preventDefault(), N.value = !0, !j.value) {
|
|
696
|
+
lt(e, E.value), sr();
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
Or(1);
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
if (e.key === "ArrowUp") {
|
|
703
|
+
if (e.preventDefault(), N.value = !0, !j.value) {
|
|
704
|
+
lt(e, E.value), sr();
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
Or(-1);
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
if (e.key === "Home" && j.value) {
|
|
711
|
+
e.preventDefault(), kr("first");
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
if (e.key === "End" && j.value) {
|
|
715
|
+
e.preventDefault(), kr("last");
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
719
|
+
if (e.preventDefault(), N.value = !0, !j.value) {
|
|
720
|
+
lt(e, E.value), sr();
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
Ar(e);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return Ue(() => w.value, (e) => {
|
|
728
|
+
e && $();
|
|
729
|
+
}), Ue(() => $t.value, () => {
|
|
730
|
+
R.hide(!0), Hn(), z.reset(), j.value && m(() => {
|
|
731
|
+
Yn(), z.reset(), m(() => {
|
|
732
|
+
z.reset(), Zt();
|
|
733
|
+
});
|
|
734
|
+
});
|
|
735
|
+
}), Ue(() => [
|
|
736
|
+
S.options,
|
|
737
|
+
S.modelValue,
|
|
738
|
+
S.multiple
|
|
739
|
+
], () => {
|
|
740
|
+
m(Q), j.value && (k.value?.stop(), Hn(), m(() => {
|
|
741
|
+
Qt(), Yn(), Zt(), R.updatePosition();
|
|
742
|
+
}));
|
|
743
|
+
}, { deep: !0 }), Ue(() => [
|
|
744
|
+
W.value,
|
|
745
|
+
pt.value,
|
|
746
|
+
S.clearable
|
|
747
|
+
], () => {
|
|
748
|
+
m(Gn);
|
|
749
|
+
}), Ue(() => [
|
|
750
|
+
Vt.value,
|
|
751
|
+
Bt.value,
|
|
752
|
+
S.panelPlacement,
|
|
753
|
+
S.panelAlign,
|
|
754
|
+
S.panelGap,
|
|
755
|
+
B.value,
|
|
756
|
+
Wt.value,
|
|
757
|
+
Gt.value
|
|
758
|
+
], () => {
|
|
759
|
+
j.value && (k.value?.stop(), m(() => {
|
|
760
|
+
Qt(), Yn(), Zt(), R.updatePosition();
|
|
761
|
+
}));
|
|
762
|
+
}), Re(() => {
|
|
763
|
+
m(Gn);
|
|
764
|
+
}), Le(() => {
|
|
765
|
+
k.value?.stop(), ln.dispose(), Un(), nr(), L?.disconnect(), L = void 0, Y() && window.removeEventListener("resize", Q), qe.killTweensOf([
|
|
766
|
+
D.value,
|
|
767
|
+
O.value,
|
|
768
|
+
...tr(),
|
|
769
|
+
A.value,
|
|
770
|
+
wt.value,
|
|
771
|
+
...Tt.value,
|
|
772
|
+
...er()
|
|
773
|
+
].filter(Boolean));
|
|
774
|
+
}), (e, t) => (_(), d("div", {
|
|
775
|
+
ref_key: "rootRef",
|
|
776
|
+
ref: T,
|
|
777
|
+
class: h(sn.value),
|
|
778
|
+
style: g(an.value),
|
|
779
|
+
onKeydown: jr
|
|
780
|
+
}, [
|
|
781
|
+
f("div", Je, [
|
|
782
|
+
Ge((_(), d("button", {
|
|
783
|
+
ref_key: "triggerRef",
|
|
784
|
+
ref: E,
|
|
785
|
+
class: h(["bing-select__trigger", { "is-tag-trigger": W.value }]),
|
|
786
|
+
type: "button",
|
|
787
|
+
id: b(ft),
|
|
788
|
+
disabled: b(w),
|
|
789
|
+
"aria-label": s.ariaLabel || kn.value,
|
|
790
|
+
"aria-describedby": b(ht),
|
|
791
|
+
"aria-invalid": b(mt) === "error" || void 0,
|
|
792
|
+
"aria-haspopup": "listbox",
|
|
793
|
+
"aria-expanded": j.value,
|
|
794
|
+
"aria-controls": yt,
|
|
795
|
+
"aria-activedescendant": Tn.value,
|
|
796
|
+
onClick: cr,
|
|
797
|
+
onBlur: t[0] ||= (...e) => b(Mt).handleBlur && b(Mt).handleBlur(...e)
|
|
798
|
+
}, [W.value ? u("", !0) : (_(), d("span", {
|
|
799
|
+
key: 0,
|
|
800
|
+
class: h(["bing-select__value", { "is-placeholder": !K.value }])
|
|
801
|
+
}, [Be(e.$slots, "value", {
|
|
802
|
+
selectedOptions: U.value,
|
|
803
|
+
placeholder: s.placeholder
|
|
804
|
+
}, () => [Fe(y(kn.value), 1)], !0)], 2))], 42, Ye)), [[b(ct)]]),
|
|
805
|
+
W.value ? (_(), d("div", {
|
|
806
|
+
key: 0,
|
|
807
|
+
ref_key: "tagsViewportRef",
|
|
808
|
+
ref: xt,
|
|
809
|
+
class: "bing-select__tags-value"
|
|
810
|
+
}, [K.value ? (_(!0), d(Ne, { key: 1 }, ze(gn.value, (e) => (_(), l(je, {
|
|
811
|
+
key: e.value,
|
|
812
|
+
class: "bing-select__value-tag",
|
|
813
|
+
label: e.label,
|
|
814
|
+
size: vn.value,
|
|
815
|
+
closable: "",
|
|
816
|
+
disabled: b(w),
|
|
817
|
+
"close-aria-label": `移除 ${e.label}`,
|
|
818
|
+
onClose: (t) => Cr(e)
|
|
819
|
+
}, null, 8, [
|
|
820
|
+
"label",
|
|
821
|
+
"size",
|
|
822
|
+
"disabled",
|
|
823
|
+
"close-aria-label",
|
|
824
|
+
"onClose"
|
|
825
|
+
]))), 128)) : (_(), d("span", Xe, y(s.placeholder), 1)), _n.value > 0 ? (_(), l(je, {
|
|
826
|
+
key: 2,
|
|
827
|
+
class: "bing-select__overflow-tag",
|
|
828
|
+
label: `+${_n.value}`,
|
|
829
|
+
size: vn.value,
|
|
830
|
+
tone: "neutral"
|
|
831
|
+
}, null, 8, ["label", "size"])) : u("", !0)], 512)) : u("", !0),
|
|
832
|
+
xn.value ? (_(), l(re, {
|
|
833
|
+
key: 1,
|
|
834
|
+
variant: "ghost",
|
|
835
|
+
size: "xs",
|
|
836
|
+
rounded: "sm",
|
|
837
|
+
throttle: !1,
|
|
838
|
+
class: "bing-select__clear",
|
|
839
|
+
"aria-label": "清空选择",
|
|
840
|
+
onClick: wr,
|
|
841
|
+
onKeydown: t[1] ||= Ke(() => {}, ["stop"])
|
|
842
|
+
}, {
|
|
843
|
+
prefix: We(() => [p(o, {
|
|
844
|
+
icon: b(ce),
|
|
845
|
+
size: 16,
|
|
846
|
+
"stroke-width": 1.75
|
|
847
|
+
}, null, 8, ["icon"])]),
|
|
848
|
+
_: 1
|
|
849
|
+
})) : u("", !0),
|
|
850
|
+
p(re, {
|
|
851
|
+
variant: "ghost",
|
|
852
|
+
size: "xs",
|
|
853
|
+
rounded: "sm",
|
|
854
|
+
throttle: !1,
|
|
855
|
+
class: "bing-select__chevron",
|
|
856
|
+
tabindex: "-1",
|
|
857
|
+
"aria-hidden": "true",
|
|
858
|
+
disabled: b(w),
|
|
859
|
+
onClick: ur
|
|
860
|
+
}, {
|
|
861
|
+
prefix: We(() => [p(o, {
|
|
862
|
+
icon: b(ae),
|
|
863
|
+
size: 16,
|
|
864
|
+
"stroke-width": 1.75
|
|
865
|
+
}, null, 8, ["icon"])]),
|
|
866
|
+
_: 1
|
|
867
|
+
}, 8, ["disabled"])
|
|
868
|
+
]),
|
|
869
|
+
W.value && K.value ? (_(), d("div", {
|
|
870
|
+
key: 0,
|
|
871
|
+
ref_key: "tagMeasureRef",
|
|
872
|
+
ref: St,
|
|
873
|
+
class: "bing-select__tag-measure",
|
|
874
|
+
"aria-hidden": "true"
|
|
875
|
+
}, [(_(!0), d(Ne, null, ze(U.value, (e) => (_(), l(je, {
|
|
876
|
+
key: `measure-${e.value}`,
|
|
877
|
+
class: "bing-select__value-tag bing-select__measure-tag",
|
|
878
|
+
label: e.label,
|
|
879
|
+
size: vn.value,
|
|
880
|
+
closable: ""
|
|
881
|
+
}, null, 8, ["label", "size"]))), 128)), (_(!0), d(Ne, null, ze(U.value.length, (e) => (_(), l(je, {
|
|
882
|
+
key: `overflow-${e}`,
|
|
883
|
+
class: "bing-select__overflow-tag bing-select__measure-overflow",
|
|
884
|
+
"data-overflow-count": e,
|
|
885
|
+
label: `+${e}`,
|
|
886
|
+
size: vn.value,
|
|
887
|
+
tone: "neutral"
|
|
888
|
+
}, null, 8, [
|
|
889
|
+
"data-overflow-count",
|
|
890
|
+
"label",
|
|
891
|
+
"size"
|
|
892
|
+
]))), 128))], 512)) : u("", !0),
|
|
893
|
+
b(ut) ? (_(), l(Pe, {
|
|
894
|
+
key: 1,
|
|
895
|
+
to: "body"
|
|
896
|
+
}, [
|
|
897
|
+
Et.value && Sn.value ? (_(), d("div", {
|
|
898
|
+
key: 0,
|
|
899
|
+
ref_key: "actionRailRef",
|
|
900
|
+
ref: O,
|
|
901
|
+
class: "bing-select__action-rail",
|
|
902
|
+
style: g(pn.value),
|
|
903
|
+
"aria-label": "选择操作",
|
|
904
|
+
onPointerdown: t[2] ||= Ke(() => {}, ["stop"]),
|
|
905
|
+
onClick: t[3] ||= Ke(() => {}, ["stop"])
|
|
906
|
+
}, [p(Me, {
|
|
907
|
+
content: `${q.value ? s.clearAllText : s.selectAllText}: ${bn.value} / ${G.value.length}`,
|
|
908
|
+
placement: "left",
|
|
909
|
+
align: "center",
|
|
910
|
+
"open-delay": 120
|
|
911
|
+
}, {
|
|
912
|
+
default: We(() => [p(re, {
|
|
913
|
+
variant: "ghost",
|
|
914
|
+
size: "xs",
|
|
915
|
+
rounded: "sm",
|
|
916
|
+
throttle: !1,
|
|
917
|
+
class: h(["bing-select__action-button", { "is-active": q.value || wn.value }]),
|
|
918
|
+
"data-action": "toggle-select-all",
|
|
919
|
+
disabled: !Cn.value,
|
|
920
|
+
"aria-pressed": q.value,
|
|
921
|
+
"aria-label": `${q.value ? s.clearAllText : s.selectAllText}:已选 ${bn.value} 项,共 ${G.value.length} 项`,
|
|
922
|
+
onClick: br
|
|
923
|
+
}, {
|
|
924
|
+
prefix: We(() => [p(o, {
|
|
925
|
+
icon: q.value ? b(oe) : b(ie),
|
|
926
|
+
size: "sm",
|
|
927
|
+
"stroke-width": q.value ? 2.3 : 2.35
|
|
928
|
+
}, null, 8, ["icon", "stroke-width"])]),
|
|
929
|
+
_: 1
|
|
930
|
+
}, 8, [
|
|
931
|
+
"class",
|
|
932
|
+
"disabled",
|
|
933
|
+
"aria-pressed",
|
|
934
|
+
"aria-label"
|
|
935
|
+
])]),
|
|
936
|
+
_: 1
|
|
937
|
+
}, 8, ["content"])], 36)) : u("", !0),
|
|
938
|
+
Et.value ? (_(), d("div", {
|
|
939
|
+
key: 1,
|
|
940
|
+
id: yt,
|
|
941
|
+
ref_key: "panelRef",
|
|
942
|
+
ref: D,
|
|
943
|
+
class: h(cn.value),
|
|
944
|
+
style: g(fn.value),
|
|
945
|
+
role: "listbox",
|
|
946
|
+
"aria-multiselectable": s.multiple || void 0,
|
|
947
|
+
onKeydown: jr,
|
|
948
|
+
onPointermove: t[7] ||= (...e) => b(R).rememberPointer && b(R).rememberPointer(...e),
|
|
949
|
+
onWheelPassive: Qn
|
|
950
|
+
}, [en.value ? (_(), d("div", {
|
|
951
|
+
key: 0,
|
|
952
|
+
ref_key: "bulkActionsRef",
|
|
953
|
+
ref: Ct,
|
|
954
|
+
class: "bing-select__bulk-actions"
|
|
955
|
+
}, [en.value ? (_(), l(le, {
|
|
956
|
+
key: 0,
|
|
957
|
+
ref_key: "searchInputRef",
|
|
958
|
+
ref: bt,
|
|
959
|
+
modelValue: Dt.value,
|
|
960
|
+
"onUpdate:modelValue": t[4] ||= (e) => Dt.value = e,
|
|
961
|
+
class: "bing-select__search",
|
|
962
|
+
type: "search",
|
|
963
|
+
icon: b(se),
|
|
964
|
+
size: "sm",
|
|
965
|
+
block: "",
|
|
966
|
+
placeholder: tn.value,
|
|
967
|
+
autocomplete: "off",
|
|
968
|
+
spellcheck: !1,
|
|
969
|
+
"clear-aria-label": "清空搜索",
|
|
970
|
+
onClear: Sr,
|
|
971
|
+
onKeydown: Ke(Er, ["stop"])
|
|
972
|
+
}, null, 8, [
|
|
973
|
+
"modelValue",
|
|
974
|
+
"icon",
|
|
975
|
+
"placeholder"
|
|
976
|
+
])) : u("", !0)], 512)) : u("", !0), p(fe, {
|
|
977
|
+
ref_key: "panelScrollRef",
|
|
978
|
+
ref: k,
|
|
979
|
+
class: "bing-select__panel-scroll",
|
|
980
|
+
height: Ot.value,
|
|
981
|
+
smooth: _t.value,
|
|
982
|
+
focusable: !1,
|
|
983
|
+
always: "",
|
|
984
|
+
"aria-label": "选项列表",
|
|
985
|
+
onScroll: Zn
|
|
986
|
+
}, {
|
|
987
|
+
default: We(() => [f("div", {
|
|
988
|
+
class: h(["bing-select__panel-body", { "is-virtual": b(B) }]),
|
|
989
|
+
style: g(b(Yt))
|
|
990
|
+
}, [f("div", {
|
|
991
|
+
class: h(["bing-select__option-stack", { "is-virtual": b(B) }]),
|
|
992
|
+
style: g(b(Xt)),
|
|
993
|
+
onMouseenter: t[5] ||= (...e) => b(R).cancelHide && b(R).cancelHide(...e),
|
|
994
|
+
onMouseleave: t[6] ||= (e) => b(R).scheduleHide()
|
|
995
|
+
}, [(_(!0), d(Ne, null, ze(mn.value, (n) => Ge((_(), d("button", {
|
|
996
|
+
id: Ln(n.index),
|
|
997
|
+
key: n.option.value,
|
|
998
|
+
ref_for: !0,
|
|
999
|
+
ref_key: "optionRefs",
|
|
1000
|
+
ref: Tt,
|
|
1001
|
+
class: h(["bing-select__option", {
|
|
1002
|
+
"is-selected": X(n.option),
|
|
1003
|
+
"is-active": M.value === n.index,
|
|
1004
|
+
"is-disabled": n.option.disabled
|
|
1005
|
+
}]),
|
|
1006
|
+
type: "button",
|
|
1007
|
+
role: "option",
|
|
1008
|
+
"data-option-index": n.index,
|
|
1009
|
+
style: g(hn.value),
|
|
1010
|
+
disabled: n.option.disabled,
|
|
1011
|
+
"aria-selected": X(n.option),
|
|
1012
|
+
onClick: (e) => _r(n.option),
|
|
1013
|
+
onMouseenter: (e) => mr(e, n.option, n.index),
|
|
1014
|
+
onMousemove: (e) => hr(e, n.option, n.index),
|
|
1015
|
+
onMouseleave: (e) => gr(e, n.option)
|
|
1016
|
+
}, [f("span", $e, [
|
|
1017
|
+
t[10] ||= f("span", {
|
|
1018
|
+
class: "bing-select__option-liquid",
|
|
1019
|
+
"aria-hidden": "true"
|
|
1020
|
+
}, null, -1),
|
|
1021
|
+
p(ge, {
|
|
1022
|
+
decorative: "",
|
|
1023
|
+
"model-value": X(n.option),
|
|
1024
|
+
size: 16,
|
|
1025
|
+
shape: s.multiple ? "rounded" : "circle"
|
|
1026
|
+
}, null, 8, ["model-value", "shape"]),
|
|
1027
|
+
f("span", et, [Be(e.$slots, "option", {
|
|
1028
|
+
option: n.option,
|
|
1029
|
+
selected: X(n.option)
|
|
1030
|
+
}, () => [f("span", tt, y(n.option.label), 1)], !0)])
|
|
1031
|
+
])], 46, Qe)), [[b(ct)]])), 128))], 38), nn.value.length === 0 ? (_(), d("div", nt, y(rn.value ? s.noSearchResultsText : s.emptyText), 1)) : u("", !0)], 6)]),
|
|
1032
|
+
_: 3
|
|
1033
|
+
}, 8, ["height", "smooth"])], 46, Ze)) : u("", !0),
|
|
1034
|
+
b(Rt) && J.value ? (_(), d("div", {
|
|
1035
|
+
key: 2,
|
|
1036
|
+
ref_key: "optionDetailPanelRef",
|
|
1037
|
+
ref: A,
|
|
1038
|
+
class: h(["bing-select__option-detail-panel", `is-placement-${b(zt)}`]),
|
|
1039
|
+
style: g(on.value),
|
|
1040
|
+
"aria-hidden": "true",
|
|
1041
|
+
onPointerdown: Tr,
|
|
1042
|
+
onClick: Tr,
|
|
1043
|
+
onMouseenter: t[8] ||= (...e) => b(R).cancelHide && b(R).cancelHide(...e),
|
|
1044
|
+
onMouseleave: t[9] ||= (e) => b(R).scheduleHide()
|
|
1045
|
+
}, [f("div", {
|
|
1046
|
+
ref_key: "optionDetailContentRef",
|
|
1047
|
+
ref: wt,
|
|
1048
|
+
class: "bing-select__option-detail-content"
|
|
1049
|
+
}, [Be(e.$slots, "option-detail", {
|
|
1050
|
+
option: J.value,
|
|
1051
|
+
selected: En.value,
|
|
1052
|
+
index: b(Lt)
|
|
1053
|
+
}, () => [
|
|
1054
|
+
f("span", rt, y(J.value.label), 1),
|
|
1055
|
+
Dn.value ? (_(), d("span", it, y(Dn.value), 1)) : u("", !0),
|
|
1056
|
+
(_(!0), d(Ne, null, ze(On.value, (e) => (_(), d("span", {
|
|
1057
|
+
key: e.key,
|
|
1058
|
+
class: "bing-select__option-detail-meta"
|
|
1059
|
+
}, [f("span", at, y(e.key), 1), f("span", ot, y(e.value), 1)]))), 128))
|
|
1060
|
+
], !0)], 512)], 38)) : u("", !0)
|
|
1061
|
+
])) : u("", !0)
|
|
1062
|
+
], 38));
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
//#endregion
|
|
1066
|
+
export { x as default };
|