@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,1274 @@
|
|
|
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, resetLiquidHover as ee, setLiquidHoverOrigin as te } from "../../motion/liquidHover.js";
|
|
5
|
+
import { useClickFeedback as ne } from "../../motion/useClickFeedback.js";
|
|
6
|
+
import { isolateFormControls as re, useFormControl as ie } from "../BingForm/useFormControl.js";
|
|
7
|
+
import o from "../BingButton/BingButton.js";
|
|
8
|
+
import { CheckCheck as ae, ChevronDown as oe, ChevronRight as se, Info as ce, ListCollapse as le, ListTree as ue, ListX as de, Search as fe, X as pe } from "../../icons/icons.js";
|
|
9
|
+
import s from "../BingIcon/BingIcon.js";
|
|
10
|
+
import me from "../BingInput/BingInput.js";
|
|
11
|
+
import { compactSmoothScrollOptions as he, resolveComponentSmoothScroll as ge } from "../../motion/smoothScroll.js";
|
|
12
|
+
import _e from "../BingScrollbar/BingScrollbar.js";
|
|
13
|
+
import { useOverlay as ve } from "../../utils/overlay.js";
|
|
14
|
+
import { useClientReady as ye } from "../../utils/useClientReady.js";
|
|
15
|
+
import { createGlassCssVariables as be, defaultGlassEffect as c } from "../../utils/glass.js";
|
|
16
|
+
import xe from "../BingCheckbox/BingCheckbox.js";
|
|
17
|
+
import { computeFloatingPosition as Se, getAvailableSpace as Ce, isVerticalSide as we, resolveFloatingSide as Te, useFloatingAutoUpdate as Ee } from "../../utils/floating.js";
|
|
18
|
+
import { getMetaEntries as De, normalizeSearchText as Oe, searchQueryMatches as ke } from "../../utils/search.js";
|
|
19
|
+
import { useKeyboardScrollSync as Ae } from "../../utils/useKeyboardScrollSync.js";
|
|
20
|
+
import { useDeferredBlurValidation as je } from "../../utils/useDeferredBlurValidation.js";
|
|
21
|
+
import { useOutsidePointerDown as Me } from "../../utils/useOutsidePointerDown.js";
|
|
22
|
+
import { useSearchShortcutFocus as Ne } from "../../utils/useSearchShortcutFocus.js";
|
|
23
|
+
import { useVirtualList as Pe } from "../../utils/useVirtualList.js";
|
|
24
|
+
import { useOptionDetailPanel as Fe } from "../../utils/useOptionDetailPanel.js";
|
|
25
|
+
import Ie from "../BingTag/BingTag.js";
|
|
26
|
+
import Le from "../BingTooltip/BingTooltip.js";
|
|
27
|
+
import { Fragment as Re, Teleport as ze, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as Be, createVNode as m, defineComponent as Ve, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as He, openBlock as v, ref as y, renderList as Ue, renderSlot as We, toDisplayString as b, unref as x, useId as Ge, useSlots as Ke, watch as S, withCtx as C, withDirectives as qe, withModifiers as Je } from "vue";
|
|
28
|
+
import { gsap as Ye } from "gsap";
|
|
29
|
+
//#region src/components/BingTreeSelect/BingTreeSelect.vue?vue&type=script&setup=true&lang.ts
|
|
30
|
+
var Xe = { class: "bing-tree-select__control" }, Ze = [
|
|
31
|
+
"id",
|
|
32
|
+
"disabled",
|
|
33
|
+
"aria-label",
|
|
34
|
+
"aria-describedby",
|
|
35
|
+
"aria-invalid",
|
|
36
|
+
"aria-expanded",
|
|
37
|
+
"aria-activedescendant"
|
|
38
|
+
], Qe = {
|
|
39
|
+
key: 0,
|
|
40
|
+
class: "bing-tree-select__tags-value"
|
|
41
|
+
}, $e = {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "bing-tree-select__tags-placeholder"
|
|
44
|
+
}, et = ["aria-multiselectable"], tt = [
|
|
45
|
+
"id",
|
|
46
|
+
"aria-level",
|
|
47
|
+
"aria-expanded",
|
|
48
|
+
"aria-selected",
|
|
49
|
+
"aria-disabled",
|
|
50
|
+
"data-depth",
|
|
51
|
+
"data-node-index",
|
|
52
|
+
"onClick",
|
|
53
|
+
"onMouseenter",
|
|
54
|
+
"onMousemove"
|
|
55
|
+
], nt = { class: "bing-tree-select__node-surface" }, rt = {
|
|
56
|
+
key: 1,
|
|
57
|
+
class: "bing-tree-select__leaf-spacer",
|
|
58
|
+
"aria-hidden": "true"
|
|
59
|
+
}, it = { class: "bing-tree-select__node-main" }, at = { class: "bing-tree-select__node-label" }, ot = ["title", "aria-label"], st = ["title"], ct = {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "bing-tree-select__empty"
|
|
62
|
+
}, lt = { class: "bing-tree-select__node-detail-title" }, ut = {
|
|
63
|
+
key: 0,
|
|
64
|
+
class: "bing-tree-select__node-detail-text"
|
|
65
|
+
}, dt = { class: "bing-tree-select__node-detail-meta-key" }, ft = { class: "bing-tree-select__node-detail-meta-value" }, pt = 280, mt = /* @__PURE__ */ Ve({
|
|
66
|
+
__name: "BingTreeSelect",
|
|
67
|
+
props: {
|
|
68
|
+
id: { default: void 0 },
|
|
69
|
+
modelValue: { default: null },
|
|
70
|
+
options: { default: () => [] },
|
|
71
|
+
multiple: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: !1
|
|
74
|
+
},
|
|
75
|
+
checkStrictly: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: !1
|
|
78
|
+
},
|
|
79
|
+
placeholder: { default: "请选择节点" },
|
|
80
|
+
disabled: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: void 0
|
|
83
|
+
},
|
|
84
|
+
clearable: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: !0
|
|
87
|
+
},
|
|
88
|
+
showSelectAll: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: !0
|
|
91
|
+
},
|
|
92
|
+
selectAllText: { default: "全选" },
|
|
93
|
+
clearAllText: { default: "清空已选" },
|
|
94
|
+
showTreeActions: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: !0
|
|
97
|
+
},
|
|
98
|
+
expandAllText: { default: "全部展开" },
|
|
99
|
+
collapseAllText: { default: "全部收起" },
|
|
100
|
+
emptyText: { default: "暂无节点" },
|
|
101
|
+
searchable: {
|
|
102
|
+
type: [Boolean, String],
|
|
103
|
+
default: "auto"
|
|
104
|
+
},
|
|
105
|
+
searchPlaceholder: { default: "搜索节点(/)" },
|
|
106
|
+
noSearchResultsText: { default: "未找到匹配节点" },
|
|
107
|
+
smoothScroll: {
|
|
108
|
+
type: [Boolean, Object],
|
|
109
|
+
default: !0
|
|
110
|
+
},
|
|
111
|
+
defaultExpandedValues: { default: () => [] },
|
|
112
|
+
defaultExpandAll: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: !1
|
|
115
|
+
},
|
|
116
|
+
size: { default: void 0 },
|
|
117
|
+
block: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: !1
|
|
120
|
+
},
|
|
121
|
+
panelMinHeight: { default: 180 },
|
|
122
|
+
panelMaxHeight: { default: 360 },
|
|
123
|
+
panelPlacement: { default: "auto" },
|
|
124
|
+
panelAlign: { default: "start" },
|
|
125
|
+
panelGap: { default: 10 },
|
|
126
|
+
virtual: {
|
|
127
|
+
type: [Boolean, String],
|
|
128
|
+
default: "auto"
|
|
129
|
+
},
|
|
130
|
+
virtualThreshold: { default: 120 },
|
|
131
|
+
virtualItemHeight: { default: void 0 },
|
|
132
|
+
virtualOverscan: { default: 5 },
|
|
133
|
+
ariaLabel: { default: void 0 },
|
|
134
|
+
ariaDescribedby: { default: void 0 },
|
|
135
|
+
status: { default: void 0 },
|
|
136
|
+
glass: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
default: c.glass
|
|
139
|
+
},
|
|
140
|
+
glassBlur: { default: void 0 },
|
|
141
|
+
glassOpacity: { default: void 0 },
|
|
142
|
+
glassSaturation: { default: void 0 }
|
|
143
|
+
},
|
|
144
|
+
emits: [
|
|
145
|
+
"update:modelValue",
|
|
146
|
+
"change",
|
|
147
|
+
"clear",
|
|
148
|
+
"open",
|
|
149
|
+
"close",
|
|
150
|
+
"expand",
|
|
151
|
+
"collapse"
|
|
152
|
+
],
|
|
153
|
+
setup(c, { emit: Ve }) {
|
|
154
|
+
let mt = t(), { vClickFeedback: ht, playClickFeedback: w } = ne(), T = c, gt = Ve, _t = ye(), { formItem: vt, resolvedId: yt, resolvedSize: E, resolvedDisabled: D, resolvedStatus: bt, resolvedAriaDescribedby: xt } = ie(T);
|
|
155
|
+
re();
|
|
156
|
+
let St = Ke(), Ct = l(() => ge(T.smoothScroll, he, {
|
|
157
|
+
keyboard: !1,
|
|
158
|
+
smoothTouchpad: !1,
|
|
159
|
+
respectReducedMotion: !0
|
|
160
|
+
})), wt = `bing-tree-select-${Ge()}`, Tt = `${wt}-listbox`, O = y(null), k = y(null), Et = y(null), A = y(null), Dt = y(null), j = y(null), M = y(null), N = y(null), Ot = y(null), P = y(!1), kt = y(!1), F = y(void 0), I = y(!1), At = y(""), L = y([]), jt = y(0), R = y({
|
|
161
|
+
align: "start",
|
|
162
|
+
left: 0,
|
|
163
|
+
minHeight: 180,
|
|
164
|
+
maxHeight: 360,
|
|
165
|
+
placement: "bottom",
|
|
166
|
+
top: 0,
|
|
167
|
+
width: pt
|
|
168
|
+
}), Mt, Nt = !1, Pt = Me(Er), Ft = Ne({
|
|
169
|
+
input: Et,
|
|
170
|
+
isOpen: () => P.value,
|
|
171
|
+
isSearchable: () => cn.value
|
|
172
|
+
}), It = je({
|
|
173
|
+
formItem: vt,
|
|
174
|
+
isOpen: () => P.value,
|
|
175
|
+
isInteractionTarget: Cr
|
|
176
|
+
}), { isSyncing: Lt, start: Rt, scheduleEnd: zt, finish: Bt } = Ae(I), z = Fe({
|
|
177
|
+
listPanel: A,
|
|
178
|
+
detailPanel: N,
|
|
179
|
+
detailContent: Ot,
|
|
180
|
+
itemSelector: ".bing-tree-select__node",
|
|
181
|
+
indexAttribute: "nodeIndex",
|
|
182
|
+
isOpen: () => P.value,
|
|
183
|
+
isKeyboardNavigating: I,
|
|
184
|
+
getItemState: (e) => {
|
|
185
|
+
let t = V.value.flat[e];
|
|
186
|
+
return t ? {
|
|
187
|
+
disabled: t.disabled,
|
|
188
|
+
hasDetail: fr(t)
|
|
189
|
+
} : void 0;
|
|
190
|
+
},
|
|
191
|
+
getItemElement: pr,
|
|
192
|
+
getItemSurface: mr,
|
|
193
|
+
getKeyboardIndex: () => F.value === void 0 ? -1 : U.value.find((e) => q(e.value, F.value))?.index ?? -1,
|
|
194
|
+
onPointerRestore: (e) => {
|
|
195
|
+
let t = V.value.flat[e];
|
|
196
|
+
t?.selectable && (F.value = t.value);
|
|
197
|
+
},
|
|
198
|
+
hiddenScale: 1,
|
|
199
|
+
enterEase: "power3.out",
|
|
200
|
+
force3D: !1
|
|
201
|
+
}), { index: Vt, shouldRender: Ht, placement: Ut } = z, Wt = l(() => typeof T.panelMinHeight == "number" ? `${T.panelMinHeight}px` : T.panelMinHeight), Gt = l(() => typeof T.panelMaxHeight == "number" ? `${T.panelMaxHeight}px` : T.panelMaxHeight), Kt = l(() => Math.max(0, Math.floor(T.virtualThreshold))), qt = l(() => ({
|
|
202
|
+
sm: 28,
|
|
203
|
+
md: 32,
|
|
204
|
+
lg: 36
|
|
205
|
+
})[E.value]), Jt = l(() => T.virtualItemHeight !== void 0 && Number.isFinite(T.virtualItemHeight) ? Math.max(qt.value, Math.floor(T.virtualItemHeight)) : qt.value), Yt = l(() => Math.max(0, Math.floor(T.virtualOverscan))), Xt = Pe({
|
|
206
|
+
count: () => U.value.length,
|
|
207
|
+
mode: () => T.virtual,
|
|
208
|
+
threshold: () => Kt.value,
|
|
209
|
+
itemHeight: () => Jt.value,
|
|
210
|
+
overscan: () => Yt.value,
|
|
211
|
+
scrollbar: M,
|
|
212
|
+
fallbackViewportHeight: jt,
|
|
213
|
+
itemHeightVar: "--bing-tree-select-virtual-item-height"
|
|
214
|
+
}), { enabled: Zt, scrollTop: Qt, viewportHeight: $t, startIndex: en, endIndex: tn, bodyStyle: nn, stackStyle: rn, refresh: B, clampScroll: an } = Xt, V = l(() => Qn(T.options)), on = l(() => new Set(L.value)), sn = l(() => Oe(At.value)), H = l(() => cn.value && sn.value.length > 0), cn = l(() => T.searchable === !0 ? !0 : T.searchable === !1 ? !1 : V.value.flat.length > 8), ln = l(() => T.searchPlaceholder.includes("/") ? T.searchPlaceholder : `${T.searchPlaceholder} (/)`), U = l(() => H.value ? er(V.value.roots, sn.value) : $n(V.value.roots)), un = l(() => Zt.value ? U.value.slice(en.value, tn.value) : U.value), dn = l(() => {
|
|
215
|
+
if (!Zt.value) return;
|
|
216
|
+
let e = Math.min(6, Math.max(4, Jt.value - 28));
|
|
217
|
+
return {
|
|
218
|
+
height: `${Jt.value}px`,
|
|
219
|
+
"--bing-tree-select-node-visual-gap": `${e}px`
|
|
220
|
+
};
|
|
221
|
+
}), fn = l(() => {
|
|
222
|
+
let e = T.modelValue;
|
|
223
|
+
return T.multiple ? Array.isArray(e) ? e : e === null ? [] : [e] : Array.isArray(e) ? e.length > 0 ? [e[0]] : [] : e === null ? [] : [e];
|
|
224
|
+
}), W = l(() => T.multiple && !T.checkStrictly ? rr(fn.value) : tr(fn.value)), pn = l(() => new Set(W.value)), mn = l(() => ir(W.value)), hn = l(() => T.multiple && !St.value), gn = l(() => mn.value.slice(0, 2)), _n = l(() => Math.max(0, mn.value.length - gn.value.length)), vn = l(() => E.value === "lg" ? "md" : "sm"), yn = l(() => mn.value.length > 0), bn = l(() => T.clearable && !D.value && yn.value), xn = l(() => V.value.expandableValues.length > 0), Sn = l(() => T.showTreeActions && xn.value), Cn = l(() => T.multiple && T.showSelectAll), wn = l(() => (H.value ? V.value.flat.filter((e) => Zn(e, sn.value)) : V.value.flat).filter(sr)), Tn = l(() => J(wn.value.flatMap((e) => T.checkStrictly ? [e.value] : e.branchValues))), En = l(() => Tn.value.length > 0), Dn = l(() => wn.value.filter((e) => X(e)).length), G = l(() => En.value && Tn.value.every((e) => pn.value.has(e))), On = l(() => Tn.value.some((e) => pn.value.has(e)) && !G.value), kn = l(() => Cn.value || Sn.value), An = l(() => V.value.expandableValues.filter((e) => on.value.has(e)).length), jn = l(() => xn.value && An.value === V.value.expandableValues.length), Mn = l(() => {
|
|
225
|
+
if (!P.value || F.value === void 0) return;
|
|
226
|
+
let e = V.value.valueMap.get(F.value);
|
|
227
|
+
return e ? ar(e) : void 0;
|
|
228
|
+
}), K = l(() => V.value.flat[Vt.value]), Nn = l(() => K.value?.node), Pn = l(() => K.value ? X(K.value) : !1), Fn = l(() => K.value ? or(K.value) : !1), In = l(() => Nn.value?.description), Ln = l(() => Yn(Nn.value)), Rn = l(() => {
|
|
229
|
+
if (!yn.value) return T.placeholder;
|
|
230
|
+
let e = mn.value.map((e) => e.label);
|
|
231
|
+
return T.multiple && e.length > 2 ? `${e.slice(0, 2).join(", ")} +${e.length - 2}` : e.join(T.multiple ? ", " : "");
|
|
232
|
+
}), zn = l(() => [
|
|
233
|
+
"bing-tree-select",
|
|
234
|
+
`bing-tree-select--${E.value}`,
|
|
235
|
+
`bing-tree-select--status-${bt.value}`,
|
|
236
|
+
{
|
|
237
|
+
"is-open": P.value,
|
|
238
|
+
"is-disabled": D.value,
|
|
239
|
+
"is-invalid": bt.value === "error",
|
|
240
|
+
"is-block": T.block || !!vt,
|
|
241
|
+
"has-value": yn.value,
|
|
242
|
+
"is-multiple": T.multiple,
|
|
243
|
+
"is-cascade": T.multiple && !T.checkStrictly
|
|
244
|
+
}
|
|
245
|
+
]), Bn = l(() => be("bing-tree-select", {
|
|
246
|
+
glass: T.glass,
|
|
247
|
+
glassBlur: T.glassBlur,
|
|
248
|
+
glassOpacity: T.glassOpacity,
|
|
249
|
+
glassSaturation: T.glassSaturation
|
|
250
|
+
})), Vn = l(() => ({ ...Bn.value })), Hn = l(() => [
|
|
251
|
+
"bing-tree-select__panel",
|
|
252
|
+
`is-placement-${R.value.placement}`,
|
|
253
|
+
`is-align-${R.value.align}`,
|
|
254
|
+
{
|
|
255
|
+
"is-glass": T.glass,
|
|
256
|
+
"is-searching": H.value,
|
|
257
|
+
"is-multiple": T.multiple,
|
|
258
|
+
"is-keyboard-navigating": I.value,
|
|
259
|
+
"is-keyboard-scrolling": Lt.value
|
|
260
|
+
}
|
|
261
|
+
]), Un = Ee(() => {
|
|
262
|
+
Q(), B(), z.updatePosition();
|
|
263
|
+
}, { enabled: () => P.value }), Wn = e("popover"), Gn = ve({
|
|
264
|
+
open: () => kt.value,
|
|
265
|
+
elements: () => [
|
|
266
|
+
O.value,
|
|
267
|
+
A.value,
|
|
268
|
+
j.value,
|
|
269
|
+
N.value
|
|
270
|
+
],
|
|
271
|
+
zIndex: () => Wn.value,
|
|
272
|
+
onEscape: () => $(!0)
|
|
273
|
+
}), Kn = l(() => ({
|
|
274
|
+
position: "fixed",
|
|
275
|
+
top: `${R.value.top}px`,
|
|
276
|
+
left: `${R.value.left}px`,
|
|
277
|
+
width: `${R.value.width}px`,
|
|
278
|
+
zIndex: Gn.zIndex.value,
|
|
279
|
+
"--bing-tree-select-panel-min-height": `${R.value.minHeight}px`,
|
|
280
|
+
"--bing-tree-select-panel-max-height": `${R.value.maxHeight}px`,
|
|
281
|
+
"--bing-tree-select-node-height": `${qt.value}px`,
|
|
282
|
+
"--bing-tree-select-node-font-size": E.value === "sm" ? "13px" : "14px",
|
|
283
|
+
"--bing-tree-select-node-line-height": E.value === "sm" ? "18px" : "20px",
|
|
284
|
+
...Bn.value
|
|
285
|
+
})), qn = l(() => {
|
|
286
|
+
let e = R.value.left - 32 - 8, t = R.value.left + R.value.width + 8, n = e >= 8 || !Jn() ? e : dr(t, 8, Math.max(8, window.innerWidth - 32 - 8));
|
|
287
|
+
return {
|
|
288
|
+
position: "fixed",
|
|
289
|
+
top: `${R.value.top}px`,
|
|
290
|
+
left: `${n}px`,
|
|
291
|
+
zIndex: Gn.zIndex.value + 1,
|
|
292
|
+
...Bn.value
|
|
293
|
+
};
|
|
294
|
+
});
|
|
295
|
+
function Jn() {
|
|
296
|
+
return typeof window < "u" && typeof document < "u";
|
|
297
|
+
}
|
|
298
|
+
function q(e, t) {
|
|
299
|
+
return e === t;
|
|
300
|
+
}
|
|
301
|
+
function J(e) {
|
|
302
|
+
return e.filter((t, n) => e.findIndex((e) => q(e, t)) === n);
|
|
303
|
+
}
|
|
304
|
+
function Yn(e) {
|
|
305
|
+
return De(e?.meta);
|
|
306
|
+
}
|
|
307
|
+
function Xn(e) {
|
|
308
|
+
return Oe([
|
|
309
|
+
e.label,
|
|
310
|
+
e.value,
|
|
311
|
+
e.description,
|
|
312
|
+
...Yn(e).flatMap((e) => [e.key, e.value])
|
|
313
|
+
].join(" "));
|
|
314
|
+
}
|
|
315
|
+
function Zn(e, t) {
|
|
316
|
+
return ke(e.searchText, t);
|
|
317
|
+
}
|
|
318
|
+
function Qn(e) {
|
|
319
|
+
let t = [], n = /* @__PURE__ */ new Map(), r = 0;
|
|
320
|
+
function i(e, a, ee, te, ne) {
|
|
321
|
+
return e.map((e) => {
|
|
322
|
+
let re = [...te, e.value], ie = [...ne, e.label], o = {
|
|
323
|
+
branchValues: [],
|
|
324
|
+
childBranchValues: [],
|
|
325
|
+
children: [],
|
|
326
|
+
depth: a,
|
|
327
|
+
disabled: !!e.disabled,
|
|
328
|
+
index: r,
|
|
329
|
+
label: e.label,
|
|
330
|
+
node: e,
|
|
331
|
+
parent: ee,
|
|
332
|
+
parentValue: ee?.value,
|
|
333
|
+
path: re,
|
|
334
|
+
pathLabels: ie,
|
|
335
|
+
searchText: Xn(e),
|
|
336
|
+
selectable: e.selectable !== !1 && !e.disabled,
|
|
337
|
+
value: e.value
|
|
338
|
+
};
|
|
339
|
+
return r += 1, t.push(o), n.set(o.value, o), o.children = i(Array.isArray(e.children) ? e.children : [], a + 1, o, re, ie), o.childBranchValues = J(o.children.flatMap((e) => e.branchValues)), o.branchValues = J([...o.selectable ? [o.value] : [], ...o.childBranchValues]), o;
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
let a = i(e, 0, void 0, [], []);
|
|
343
|
+
return {
|
|
344
|
+
expandableValues: t.filter((e) => e.children.length > 0).map((e) => e.value),
|
|
345
|
+
flat: t,
|
|
346
|
+
roots: a,
|
|
347
|
+
valueMap: n
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function $n(e) {
|
|
351
|
+
let t = [];
|
|
352
|
+
function n(e) {
|
|
353
|
+
t.push(e), e.children.length > 0 && on.value.has(e.value) && e.children.forEach(n);
|
|
354
|
+
}
|
|
355
|
+
return e.forEach(n), t;
|
|
356
|
+
}
|
|
357
|
+
function er(e, t) {
|
|
358
|
+
function n(e) {
|
|
359
|
+
let r = Zn(e, t), i = e.children.flatMap((e) => n(e));
|
|
360
|
+
return r || i.length > 0 ? [e, ...i] : [];
|
|
361
|
+
}
|
|
362
|
+
return e.flatMap((e) => n(e));
|
|
363
|
+
}
|
|
364
|
+
function tr(e) {
|
|
365
|
+
let t = new Set(e);
|
|
366
|
+
return V.value.flat.filter((e) => t.has(e.value)).map((e) => e.value);
|
|
367
|
+
}
|
|
368
|
+
function nr(e) {
|
|
369
|
+
let t = new Set(e);
|
|
370
|
+
function n(e) {
|
|
371
|
+
if (e.children.forEach(n), !(!e.selectable || e.children.length === 0)) {
|
|
372
|
+
if (e.childBranchValues.length > 0 && e.childBranchValues.every((e) => t.has(e))) {
|
|
373
|
+
t.add(e.value);
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
t.delete(e.value);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return V.value.roots.forEach(n), tr([...t]);
|
|
380
|
+
}
|
|
381
|
+
function rr(e) {
|
|
382
|
+
let t = /* @__PURE__ */ new Set();
|
|
383
|
+
return e.forEach((e) => {
|
|
384
|
+
let n = V.value.valueMap.get(e);
|
|
385
|
+
n && n.branchValues.forEach((e) => t.add(e));
|
|
386
|
+
}), nr(t);
|
|
387
|
+
}
|
|
388
|
+
function ir(e) {
|
|
389
|
+
let t = new Set(Array.isArray(e) ? e : e === null ? [] : [e]);
|
|
390
|
+
return V.value.flat.filter((e) => t.has(e.value)).map((e) => e.node);
|
|
391
|
+
}
|
|
392
|
+
function ar(e) {
|
|
393
|
+
return `${wt}-node-${e.index}`;
|
|
394
|
+
}
|
|
395
|
+
function Y(e) {
|
|
396
|
+
return e.children.length === 0 ? !1 : H.value || on.value.has(e.value);
|
|
397
|
+
}
|
|
398
|
+
function X(e) {
|
|
399
|
+
return T.multiple && !T.checkStrictly ? e.branchValues.length > 0 && e.branchValues.every((e) => pn.value.has(e)) : pn.value.has(e.value);
|
|
400
|
+
}
|
|
401
|
+
function or(e) {
|
|
402
|
+
if (!T.multiple || T.checkStrictly || e.branchValues.length === 0) return !1;
|
|
403
|
+
let t = e.branchValues.filter((e) => pn.value.has(e)).length;
|
|
404
|
+
return t > 0 && t < e.branchValues.length;
|
|
405
|
+
}
|
|
406
|
+
function sr(e) {
|
|
407
|
+
return e.selectable && !e.disabled;
|
|
408
|
+
}
|
|
409
|
+
function Z(e, t) {
|
|
410
|
+
It.cancel();
|
|
411
|
+
let n = {
|
|
412
|
+
value: e,
|
|
413
|
+
node: t,
|
|
414
|
+
nodes: ir(e)
|
|
415
|
+
};
|
|
416
|
+
gt("update:modelValue", e), gt("change", n), vt?.handleControlChange();
|
|
417
|
+
}
|
|
418
|
+
function cr(e) {
|
|
419
|
+
return T.checkStrictly ? tr(e) : nr(new Set(e));
|
|
420
|
+
}
|
|
421
|
+
function lr() {
|
|
422
|
+
if (typeof T.panelMinHeight == "number") return Math.max(0, T.panelMinHeight);
|
|
423
|
+
let e = Number.parseFloat(T.panelMinHeight);
|
|
424
|
+
return Number.isFinite(e) ? Math.max(0, e) : 180;
|
|
425
|
+
}
|
|
426
|
+
function ur() {
|
|
427
|
+
if (typeof T.panelMaxHeight == "number") return Math.max(0, T.panelMaxHeight);
|
|
428
|
+
let e = Number.parseFloat(T.panelMaxHeight);
|
|
429
|
+
return Number.isFinite(e) ? Math.max(0, e) : 360;
|
|
430
|
+
}
|
|
431
|
+
function dr(e, t, n) {
|
|
432
|
+
return Math.min(n, Math.max(t, e));
|
|
433
|
+
}
|
|
434
|
+
function fr(e) {
|
|
435
|
+
return e ? !!(St["node-detail"] || e.node.description || Yn(e.node).length > 0) : !1;
|
|
436
|
+
}
|
|
437
|
+
function pr(e) {
|
|
438
|
+
if (e < 0 || !Jn()) return null;
|
|
439
|
+
let t = V.value.flat[e];
|
|
440
|
+
return t ? document.getElementById(ar(t)) : null;
|
|
441
|
+
}
|
|
442
|
+
function mr(e) {
|
|
443
|
+
return e.querySelector(".bing-tree-select__node-surface") ?? e;
|
|
444
|
+
}
|
|
445
|
+
function Q() {
|
|
446
|
+
if (!Jn() || !O.value || !A.value) return;
|
|
447
|
+
let e = Number.isFinite(T.panelGap) ? Math.max(0, T.panelGap) : 10, t = O.value.getBoundingClientRect(), n = window.innerWidth, r = window.innerHeight, i = ur(), a = Math.min(lr(), i), ee = A.value.querySelector(".bing-tree-select__panel-body"), te = Dt.value?.getBoundingClientRect().height ?? 0, ne = Xt.getContentHeight() ?? ee?.scrollHeight ?? 0, re = Math.max(Jt.value, U.value.length * Jt.value), ie = te + (ne || re) + 2, o = dr(ie, a, i), ae = {
|
|
448
|
+
gap: e,
|
|
449
|
+
padding: 12,
|
|
450
|
+
viewport: {
|
|
451
|
+
width: n,
|
|
452
|
+
height: r
|
|
453
|
+
}
|
|
454
|
+
}, oe = T.panelPlacement === "auto" ? Te({
|
|
455
|
+
anchor: t,
|
|
456
|
+
floating: {
|
|
457
|
+
width: 0,
|
|
458
|
+
height: o
|
|
459
|
+
},
|
|
460
|
+
side: "bottom",
|
|
461
|
+
...ae
|
|
462
|
+
}) : T.panelPlacement, se = T.panelAlign, ce = we(oe) ? Ce(t, oe, ae) : r - 24, le = Math.max(0, Math.min(i, ce || i)), ue = Math.min(a, le), de = dr(ie, ue, le), fe = Math.max(0, de - te - 2), pe = t.width || O.value.offsetWidth || pt, s = kn.value ? 40 : 0, me = Math.max(0, n - 24 - s), he = Math.min(Math.max(pe, pt), me), ge = Se({
|
|
463
|
+
anchor: t,
|
|
464
|
+
floating: {
|
|
465
|
+
width: he,
|
|
466
|
+
height: de
|
|
467
|
+
},
|
|
468
|
+
side: oe,
|
|
469
|
+
flip: "none",
|
|
470
|
+
align: se === "middle" ? "center" : se,
|
|
471
|
+
...ae
|
|
472
|
+
}), _e = ge.left;
|
|
473
|
+
kn.value && _e - s < 8 && _e + he + s > n - 8 && (_e = Math.max(12, n - 12 - s - he));
|
|
474
|
+
let ve = ge.top;
|
|
475
|
+
jt.value = fe, $t.value = fe, R.value = {
|
|
476
|
+
align: se,
|
|
477
|
+
left: _e,
|
|
478
|
+
minHeight: ue,
|
|
479
|
+
maxHeight: le,
|
|
480
|
+
placement: oe,
|
|
481
|
+
top: ve,
|
|
482
|
+
width: he
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
function hr(e) {
|
|
486
|
+
z.rememberPointer(e);
|
|
487
|
+
}
|
|
488
|
+
function gr(e) {
|
|
489
|
+
let t = e.target;
|
|
490
|
+
if (t) {
|
|
491
|
+
if (Xt.readViewport(t), I.value) {
|
|
492
|
+
z.scheduleKeyboardShow(), zt();
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
z.handleListScroll();
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
function _r() {
|
|
499
|
+
let e = A.value;
|
|
500
|
+
return e ? Array.from(e.querySelectorAll(".bing-tree-select__node")) : [];
|
|
501
|
+
}
|
|
502
|
+
function vr() {
|
|
503
|
+
let e = j.value;
|
|
504
|
+
return e ? Array.from(e.querySelectorAll(".bing-tree-select__action-button")) : [];
|
|
505
|
+
}
|
|
506
|
+
function yr() {
|
|
507
|
+
Mt?.kill(), Mt = void 0;
|
|
508
|
+
}
|
|
509
|
+
function br() {
|
|
510
|
+
let e = A.value;
|
|
511
|
+
if (!e) return;
|
|
512
|
+
let t = _r(), r = j.value, i = vr(), a = [
|
|
513
|
+
e,
|
|
514
|
+
r,
|
|
515
|
+
...i,
|
|
516
|
+
...t
|
|
517
|
+
].filter(Boolean);
|
|
518
|
+
if (yr(), Ye.killTweensOf(a), mt()) {
|
|
519
|
+
Ye.set(a, {
|
|
520
|
+
autoAlpha: 1,
|
|
521
|
+
x: 0,
|
|
522
|
+
y: 0,
|
|
523
|
+
scale: 1,
|
|
524
|
+
scaleX: 1,
|
|
525
|
+
scaleY: 1,
|
|
526
|
+
clearProps: "transform"
|
|
527
|
+
});
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
Mt = n({
|
|
531
|
+
panel: e,
|
|
532
|
+
items: t,
|
|
533
|
+
actionRail: r,
|
|
534
|
+
actionButtons: i,
|
|
535
|
+
placement: R.value.placement,
|
|
536
|
+
align: R.value.align,
|
|
537
|
+
onComplete: () => {
|
|
538
|
+
Mt = void 0;
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
function xr(e) {
|
|
543
|
+
Wr(), kt.value = !1, F.value = void 0, I.value = !1, z.hide(!0), Lr(), e && k.value?.focus();
|
|
544
|
+
}
|
|
545
|
+
function Sr(e = !1) {
|
|
546
|
+
let t = A.value;
|
|
547
|
+
if (!t) {
|
|
548
|
+
xr(e);
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
let n = _r(), i = j.value, a = vr();
|
|
552
|
+
if (yr(), Ye.killTweensOf([
|
|
553
|
+
t,
|
|
554
|
+
i,
|
|
555
|
+
...a,
|
|
556
|
+
...n
|
|
557
|
+
].filter(Boolean)), mt()) {
|
|
558
|
+
xr(e);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
Mt = r({
|
|
562
|
+
panel: t,
|
|
563
|
+
items: n,
|
|
564
|
+
actionRail: i,
|
|
565
|
+
actionButtons: a,
|
|
566
|
+
placement: R.value.placement,
|
|
567
|
+
align: R.value.align,
|
|
568
|
+
onComplete: () => {
|
|
569
|
+
Mt = void 0, xr(e);
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
function Cr(e) {
|
|
574
|
+
return e instanceof Node ? !!(O.value?.contains(e) || A.value?.contains(e) || j.value?.contains(e) || N.value?.contains(e)) : !1;
|
|
575
|
+
}
|
|
576
|
+
async function wr() {
|
|
577
|
+
D.value || P.value || (kt.value = !0, P.value = !0, Yr(), Pt.start(), Ft.start(), Un.start(), gt("open"), await h(), Q(), B(), br(), Zr(), await Ft.focus(), I.value && z.scheduleKeyboardShow());
|
|
578
|
+
}
|
|
579
|
+
function $(e = !1) {
|
|
580
|
+
P.value && (M.value?.stop(), P.value = !1, Bt(), Pt.stop(), Ft.stop(), Un.dispose(), z.hide(), gt("close"), Sr(e));
|
|
581
|
+
}
|
|
582
|
+
function Tr() {
|
|
583
|
+
if (!D.value) {
|
|
584
|
+
if (P.value) {
|
|
585
|
+
$();
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
wr();
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
function Er(e) {
|
|
592
|
+
let t = O.value, n = A.value, r = j.value, i = N.value;
|
|
593
|
+
!t || !(e.target instanceof Node) || Gn.contains(e.target) || !t.contains(e.target) && !n?.contains(e.target) && !r?.contains(e.target) && !i?.contains(e.target) && $();
|
|
594
|
+
}
|
|
595
|
+
function Dr(e) {
|
|
596
|
+
e.stopPropagation(), k.value?.focus(), Tr();
|
|
597
|
+
}
|
|
598
|
+
function Or(e) {
|
|
599
|
+
return {
|
|
600
|
+
value: e.value,
|
|
601
|
+
node: e.node,
|
|
602
|
+
expandedValues: [...L.value]
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
function kr(e, t) {
|
|
606
|
+
e.children.length === 0 || H.value || t !== on.value.has(e.value) && (M.value?.stop(), L.value = t ? J([...L.value, e.value]) : L.value.filter((t) => !q(t, e.value)), gt(t ? "expand" : "collapse", Or(e)), h(() => {
|
|
607
|
+
an(), Q(), B();
|
|
608
|
+
}));
|
|
609
|
+
}
|
|
610
|
+
function Ar(e) {
|
|
611
|
+
kr(e, !on.value.has(e.value));
|
|
612
|
+
}
|
|
613
|
+
function jr() {
|
|
614
|
+
H.value || !xn.value || (M.value?.stop(), L.value = [...V.value.expandableValues], h(() => {
|
|
615
|
+
an(), Q(), B();
|
|
616
|
+
}));
|
|
617
|
+
}
|
|
618
|
+
function Mr() {
|
|
619
|
+
H.value || !xn.value || (M.value?.stop(), L.value = [], h(() => {
|
|
620
|
+
an(), Q(), B();
|
|
621
|
+
}));
|
|
622
|
+
}
|
|
623
|
+
function Nr() {
|
|
624
|
+
if (jn.value) {
|
|
625
|
+
Mr();
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
jr();
|
|
629
|
+
}
|
|
630
|
+
function Pr() {
|
|
631
|
+
!Cn.value || D.value || !En.value || G.value || Z(cr(J([...W.value, ...Tn.value])));
|
|
632
|
+
}
|
|
633
|
+
function Fr() {
|
|
634
|
+
if (!Cn.value || D.value || Dn.value === 0) return;
|
|
635
|
+
let e = new Set(Tn.value);
|
|
636
|
+
Z(cr(W.value.filter((t) => !e.has(t))));
|
|
637
|
+
}
|
|
638
|
+
function Ir() {
|
|
639
|
+
if (G.value) {
|
|
640
|
+
Fr();
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
Pr();
|
|
644
|
+
}
|
|
645
|
+
function Lr() {
|
|
646
|
+
At.value = "";
|
|
647
|
+
}
|
|
648
|
+
function Rr(e, t) {
|
|
649
|
+
if (!(D.value || e.disabled)) {
|
|
650
|
+
if (!e.selectable) {
|
|
651
|
+
if (t && e.children.length && !H.value) {
|
|
652
|
+
let n = Xr(e.value);
|
|
653
|
+
n && w(t, mr(n));
|
|
654
|
+
}
|
|
655
|
+
Ar(e);
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
if (t && w(t, Xr(e.value)), T.multiple) {
|
|
659
|
+
if (T.checkStrictly) {
|
|
660
|
+
Z(cr(pn.value.has(e.value) ? W.value.filter((t) => !q(t, e.value)) : J([...W.value, e.value])), e.node);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
let t = new Set(W.value);
|
|
664
|
+
X(e) ? e.branchValues.forEach((e) => t.delete(e)) : e.branchValues.forEach((e) => t.add(e)), Z(cr([...t]), e.node);
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
Z(e.value, e.node), $(!0);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
function zr() {
|
|
671
|
+
if (!bn.value) return;
|
|
672
|
+
let e = T.multiple ? [] : null;
|
|
673
|
+
gt("clear"), Z(e);
|
|
674
|
+
}
|
|
675
|
+
function Br(e) {
|
|
676
|
+
if (D.value) return;
|
|
677
|
+
let t = V.value.valueMap.get(e.value);
|
|
678
|
+
if (T.multiple && !T.checkStrictly && t) {
|
|
679
|
+
let n = new Set(W.value);
|
|
680
|
+
t.branchValues.forEach((e) => n.delete(e)), Z(cr([...n]), e), h(() => k.value?.focus());
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
let n = W.value.filter((t) => !q(t, e.value));
|
|
684
|
+
Z(T.multiple ? cr(n) : null, e), h(() => k.value?.focus());
|
|
685
|
+
}
|
|
686
|
+
function Vr(e) {
|
|
687
|
+
e.stopPropagation(), zr();
|
|
688
|
+
}
|
|
689
|
+
function Hr(e) {
|
|
690
|
+
e.stopPropagation();
|
|
691
|
+
}
|
|
692
|
+
let Ur = /* @__PURE__ */ new Set();
|
|
693
|
+
function Wr() {
|
|
694
|
+
Ur.forEach(ee), Ur.clear();
|
|
695
|
+
}
|
|
696
|
+
function Gr(e) {
|
|
697
|
+
let t = e.currentTarget.querySelector(".bing-tree-select__node-liquid");
|
|
698
|
+
t && Ur.has(t) && a(t);
|
|
699
|
+
}
|
|
700
|
+
function Kr(e, t) {
|
|
701
|
+
if (z.rememberPointer(e), I.value = !1, Bt(), t.selectable && !t.disabled && (F.value = t.value, !mt())) {
|
|
702
|
+
let t = mr(e.currentTarget), n = t.querySelector(".bing-tree-select__node-liquid");
|
|
703
|
+
n && (Ur.add(n), te(t, n, e), i(n));
|
|
704
|
+
}
|
|
705
|
+
if (t.disabled || !fr(t)) {
|
|
706
|
+
z.hide(!0);
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
z.show(e.currentTarget, t.index);
|
|
710
|
+
}
|
|
711
|
+
function qr(e, t) {
|
|
712
|
+
if (z.rememberPointer(e), I.value = !1, Bt(), t.selectable && !t.disabled && (F.value = t.value), t.disabled || !fr(t)) {
|
|
713
|
+
z.hide(!0);
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
z.cancelHide(), (Vt.value !== t.index || !Ht.value) && z.show(e.currentTarget, t.index);
|
|
717
|
+
}
|
|
718
|
+
S(un, Wr, { flush: "pre" }), S(I, (e) => {
|
|
719
|
+
e && Wr();
|
|
720
|
+
}), He(Wr);
|
|
721
|
+
function Jr() {
|
|
722
|
+
return U.value.filter(sr);
|
|
723
|
+
}
|
|
724
|
+
function Yr() {
|
|
725
|
+
let e = U.value.find((e) => sr(e) && X(e)), t = Jr()[0];
|
|
726
|
+
F.value = e?.value ?? t?.value;
|
|
727
|
+
}
|
|
728
|
+
function Xr(e) {
|
|
729
|
+
if (e === void 0) return null;
|
|
730
|
+
let t = V.value.valueMap.get(e);
|
|
731
|
+
return !t || !Jn() ? null : document.getElementById(ar(t));
|
|
732
|
+
}
|
|
733
|
+
function Zr() {
|
|
734
|
+
F.value !== void 0 && h(() => {
|
|
735
|
+
if (Zt.value) {
|
|
736
|
+
Xt.scrollToIndex(U.value.findIndex((e) => q(e.value, F.value)), {
|
|
737
|
+
offsetTop: 0,
|
|
738
|
+
beforeScroll: Rt
|
|
739
|
+
});
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
M.value?.stop(), Xr(F.value)?.scrollIntoView?.({ block: "nearest" });
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
function Qr(e) {
|
|
746
|
+
let t = Jr();
|
|
747
|
+
if (t.length === 0) return;
|
|
748
|
+
I.value = !0;
|
|
749
|
+
let n = t.findIndex((e) => F.value === void 0 ? !1 : q(e.value, F.value));
|
|
750
|
+
n < 0 && (n = e > 0 ? -1 : 0), n = (n + e + t.length) % t.length, F.value = t[n]?.value, Zr(), z.scheduleKeyboardShow();
|
|
751
|
+
}
|
|
752
|
+
function $r(e) {
|
|
753
|
+
let t = Jr(), n = e === "first" ? t[0] : t[t.length - 1];
|
|
754
|
+
n && (I.value = !0, F.value = n.value, Zr(), z.scheduleKeyboardShow());
|
|
755
|
+
}
|
|
756
|
+
function ei() {
|
|
757
|
+
if (F.value !== void 0) return V.value.valueMap.get(F.value);
|
|
758
|
+
}
|
|
759
|
+
function ti(e) {
|
|
760
|
+
let t = ei();
|
|
761
|
+
t && Rr(t, e);
|
|
762
|
+
}
|
|
763
|
+
function ni(e) {
|
|
764
|
+
e.parent && (I.value = !0, F.value = e.parent.value, Zr(), z.scheduleKeyboardShow());
|
|
765
|
+
}
|
|
766
|
+
function ri(e) {
|
|
767
|
+
if (!(e.key === "Escape" && (e.defaultPrevented || !Gn.isTop(e))) && !D.value && !Ft.handleShortcut(e)) {
|
|
768
|
+
if (e.key === "Tab") {
|
|
769
|
+
$();
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
if (e.key === "Escape") {
|
|
773
|
+
P.value && (e.preventDefault(), $(!0));
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
if (e.key === "ArrowDown") {
|
|
777
|
+
if (e.preventDefault(), I.value = !0, !P.value) {
|
|
778
|
+
w(e, k.value), wr();
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
Qr(1);
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
if (e.key === "ArrowUp") {
|
|
785
|
+
if (e.preventDefault(), I.value = !0, !P.value) {
|
|
786
|
+
w(e, k.value), wr();
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
Qr(-1);
|
|
790
|
+
return;
|
|
791
|
+
}
|
|
792
|
+
if (e.key === "Home" && P.value) {
|
|
793
|
+
e.preventDefault(), $r("first");
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
if (e.key === "End" && P.value) {
|
|
797
|
+
e.preventDefault(), $r("last");
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
if (e.key === "ArrowRight" && P.value) {
|
|
801
|
+
I.value = !0;
|
|
802
|
+
let t = ei();
|
|
803
|
+
if (t?.children.length && !Y(t) && !H.value) {
|
|
804
|
+
e.preventDefault();
|
|
805
|
+
let n = Xr(t.value);
|
|
806
|
+
n && w(e, mr(n)), kr(t, !0);
|
|
807
|
+
}
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
if (e.key === "ArrowLeft" && P.value) {
|
|
811
|
+
I.value = !0;
|
|
812
|
+
let t = ei();
|
|
813
|
+
if (t?.children.length && Y(t) && !H.value) {
|
|
814
|
+
e.preventDefault();
|
|
815
|
+
let n = Xr(t.value);
|
|
816
|
+
n && w(e, mr(n)), kr(t, !1);
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
t?.parent && (e.preventDefault(), ni(t));
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
823
|
+
if (e.preventDefault(), I.value = !0, !P.value) {
|
|
824
|
+
w(e, k.value), wr();
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
ti(e);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
function ii(e) {
|
|
832
|
+
if (e.key === "ArrowDown") {
|
|
833
|
+
e.preventDefault(), Qr(1);
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
if (e.key === "ArrowUp") {
|
|
837
|
+
e.preventDefault(), Qr(-1);
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
if (e.key === "Home") {
|
|
841
|
+
e.preventDefault(), $r("first");
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
if (e.key === "End") {
|
|
845
|
+
e.preventDefault(), $r("last");
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
if (e.key === "Enter") {
|
|
849
|
+
e.preventDefault(), ti(e);
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
if (e.key === "Escape" && At.value) {
|
|
853
|
+
Lr();
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
if (e.key === "Escape") {
|
|
857
|
+
$(!0);
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
e.key === "Tab" && $();
|
|
861
|
+
}
|
|
862
|
+
return S(() => [
|
|
863
|
+
V.value.expandableValues,
|
|
864
|
+
T.defaultExpandedValues,
|
|
865
|
+
T.defaultExpandAll
|
|
866
|
+
], () => {
|
|
867
|
+
M.value?.stop();
|
|
868
|
+
let e = new Set(V.value.expandableValues);
|
|
869
|
+
if (!Nt) {
|
|
870
|
+
L.value = T.defaultExpandAll ? [...V.value.expandableValues] : T.defaultExpandedValues.filter((t) => e.has(t)), Nt = !0;
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
if (T.defaultExpandAll) {
|
|
874
|
+
L.value = [...V.value.expandableValues];
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
L.value = L.value.filter((t) => e.has(t));
|
|
878
|
+
}, {
|
|
879
|
+
deep: !0,
|
|
880
|
+
immediate: !0
|
|
881
|
+
}), S(() => D.value, (e) => {
|
|
882
|
+
e && $();
|
|
883
|
+
}), S(() => sn.value, () => {
|
|
884
|
+
z.hide(!0), Qt.value = 0, Yr(), P.value && (M.value?.scrollTo(0), h(() => {
|
|
885
|
+
an(), Q(), B(), z.updatePosition();
|
|
886
|
+
}));
|
|
887
|
+
}), S(() => [
|
|
888
|
+
T.options,
|
|
889
|
+
T.modelValue,
|
|
890
|
+
T.multiple,
|
|
891
|
+
T.checkStrictly
|
|
892
|
+
], () => {
|
|
893
|
+
P.value && (M.value?.stop(), Yr(), h(() => {
|
|
894
|
+
an(), Q(), B(), z.updatePosition();
|
|
895
|
+
}));
|
|
896
|
+
}, { deep: !0 }), S(() => [
|
|
897
|
+
Wt.value,
|
|
898
|
+
Gt.value,
|
|
899
|
+
T.panelPlacement,
|
|
900
|
+
T.panelAlign,
|
|
901
|
+
T.panelGap,
|
|
902
|
+
Zt.value,
|
|
903
|
+
Jt.value,
|
|
904
|
+
Yt.value
|
|
905
|
+
], () => {
|
|
906
|
+
P.value && (M.value?.stop(), h(() => {
|
|
907
|
+
an(), Q(), B(), z.updatePosition();
|
|
908
|
+
}));
|
|
909
|
+
}), He(() => {
|
|
910
|
+
M.value?.stop(), Un.dispose(), yr(), Ye.killTweensOf([
|
|
911
|
+
A.value,
|
|
912
|
+
j.value,
|
|
913
|
+
...vr(),
|
|
914
|
+
N.value,
|
|
915
|
+
Ot.value,
|
|
916
|
+
..._r()
|
|
917
|
+
].filter(Boolean));
|
|
918
|
+
}), (e, t) => (v(), f("div", {
|
|
919
|
+
ref_key: "rootRef",
|
|
920
|
+
ref: O,
|
|
921
|
+
class: g(zn.value),
|
|
922
|
+
style: _(Vn.value),
|
|
923
|
+
onKeydown: ri
|
|
924
|
+
}, [p("div", Xe, [
|
|
925
|
+
qe((v(), f("button", {
|
|
926
|
+
ref_key: "triggerRef",
|
|
927
|
+
ref: k,
|
|
928
|
+
class: g(["bing-tree-select__trigger", { "is-tag-trigger": hn.value }]),
|
|
929
|
+
type: "button",
|
|
930
|
+
id: x(yt),
|
|
931
|
+
disabled: x(D),
|
|
932
|
+
"aria-label": c.ariaLabel || Rn.value,
|
|
933
|
+
"aria-describedby": x(xt),
|
|
934
|
+
"aria-invalid": x(bt) === "error" || void 0,
|
|
935
|
+
"aria-haspopup": "tree",
|
|
936
|
+
"aria-expanded": P.value,
|
|
937
|
+
"aria-controls": Tt,
|
|
938
|
+
"aria-activedescendant": Mn.value,
|
|
939
|
+
onClick: Tr,
|
|
940
|
+
onBlur: t[0] ||= (...e) => x(It).handleBlur && x(It).handleBlur(...e)
|
|
941
|
+
}, [hn.value ? d("", !0) : (v(), f("span", {
|
|
942
|
+
key: 0,
|
|
943
|
+
class: g(["bing-tree-select__value", { "is-placeholder": !yn.value }])
|
|
944
|
+
}, [We(e.$slots, "value", {
|
|
945
|
+
selectedNodes: mn.value,
|
|
946
|
+
placeholder: c.placeholder
|
|
947
|
+
}, () => [Be(b(Rn.value), 1)], !0)], 2))], 42, Ze)), [[x(ht)]]),
|
|
948
|
+
hn.value ? (v(), f("div", Qe, [yn.value ? (v(), f(Re, { key: 1 }, [(v(!0), f(Re, null, Ue(gn.value, (e) => (v(), u(Ie, {
|
|
949
|
+
key: e.value,
|
|
950
|
+
class: "bing-tree-select__value-tag",
|
|
951
|
+
label: e.label,
|
|
952
|
+
size: vn.value,
|
|
953
|
+
closable: "",
|
|
954
|
+
disabled: x(D),
|
|
955
|
+
"close-aria-label": `移除 ${e.label}`,
|
|
956
|
+
onClose: (t) => Br(e)
|
|
957
|
+
}, null, 8, [
|
|
958
|
+
"label",
|
|
959
|
+
"size",
|
|
960
|
+
"disabled",
|
|
961
|
+
"close-aria-label",
|
|
962
|
+
"onClose"
|
|
963
|
+
]))), 128)), _n.value > 0 ? (v(), u(Ie, {
|
|
964
|
+
key: 0,
|
|
965
|
+
class: "bing-tree-select__overflow-tag",
|
|
966
|
+
label: `+${_n.value}`,
|
|
967
|
+
size: vn.value,
|
|
968
|
+
tone: "neutral"
|
|
969
|
+
}, null, 8, ["label", "size"])) : d("", !0)], 64)) : (v(), f("span", $e, b(c.placeholder), 1))])) : d("", !0),
|
|
970
|
+
bn.value ? (v(), u(o, {
|
|
971
|
+
key: 1,
|
|
972
|
+
variant: "ghost",
|
|
973
|
+
size: "xs",
|
|
974
|
+
rounded: "sm",
|
|
975
|
+
throttle: !1,
|
|
976
|
+
class: "bing-tree-select__clear",
|
|
977
|
+
"aria-label": "清空选择",
|
|
978
|
+
onClick: Vr,
|
|
979
|
+
onKeydown: t[1] ||= Je(() => {}, ["stop"])
|
|
980
|
+
}, {
|
|
981
|
+
prefix: C(() => [m(s, {
|
|
982
|
+
icon: x(pe),
|
|
983
|
+
size: "sm",
|
|
984
|
+
"stroke-width": 1.75
|
|
985
|
+
}, null, 8, ["icon"])]),
|
|
986
|
+
_: 1
|
|
987
|
+
})) : d("", !0),
|
|
988
|
+
m(o, {
|
|
989
|
+
variant: "ghost",
|
|
990
|
+
size: "xs",
|
|
991
|
+
rounded: "sm",
|
|
992
|
+
throttle: !1,
|
|
993
|
+
class: "bing-tree-select__chevron",
|
|
994
|
+
tabindex: "-1",
|
|
995
|
+
"aria-hidden": "true",
|
|
996
|
+
disabled: x(D),
|
|
997
|
+
onClick: Dr
|
|
998
|
+
}, {
|
|
999
|
+
prefix: C(() => [m(s, {
|
|
1000
|
+
icon: x(oe),
|
|
1001
|
+
size: "sm",
|
|
1002
|
+
"stroke-width": 1.75
|
|
1003
|
+
}, null, 8, ["icon"])]),
|
|
1004
|
+
_: 1
|
|
1005
|
+
}, 8, ["disabled"])
|
|
1006
|
+
]), x(_t) ? (v(), u(ze, {
|
|
1007
|
+
key: 0,
|
|
1008
|
+
to: "body"
|
|
1009
|
+
}, [
|
|
1010
|
+
kt.value && kn.value ? (v(), f("div", {
|
|
1011
|
+
key: 0,
|
|
1012
|
+
ref_key: "actionRailRef",
|
|
1013
|
+
ref: j,
|
|
1014
|
+
class: "bing-tree-select__action-rail",
|
|
1015
|
+
style: _(qn.value),
|
|
1016
|
+
"aria-label": "树形选择操作",
|
|
1017
|
+
onPointerdown: t[2] ||= Je(() => {}, ["stop"]),
|
|
1018
|
+
onClick: t[3] ||= Je(() => {}, ["stop"])
|
|
1019
|
+
}, [Cn.value ? (v(), u(Le, {
|
|
1020
|
+
key: 0,
|
|
1021
|
+
content: `${G.value ? c.clearAllText : c.selectAllText}: ${Dn.value} / ${wn.value.length}`,
|
|
1022
|
+
placement: "left",
|
|
1023
|
+
align: "center",
|
|
1024
|
+
"open-delay": 120
|
|
1025
|
+
}, {
|
|
1026
|
+
default: C(() => [m(o, {
|
|
1027
|
+
variant: "ghost",
|
|
1028
|
+
size: "xs",
|
|
1029
|
+
rounded: "sm",
|
|
1030
|
+
throttle: !1,
|
|
1031
|
+
class: g(["bing-tree-select__action-button", { "is-active": G.value || On.value }]),
|
|
1032
|
+
"data-action": "toggle-select-all",
|
|
1033
|
+
disabled: !En.value,
|
|
1034
|
+
"aria-pressed": G.value,
|
|
1035
|
+
"aria-label": `${G.value ? c.clearAllText : c.selectAllText}:已选 ${Dn.value} 项,共 ${wn.value.length} 项`,
|
|
1036
|
+
onClick: Ir
|
|
1037
|
+
}, {
|
|
1038
|
+
prefix: C(() => [m(s, {
|
|
1039
|
+
icon: G.value ? x(de) : x(ae),
|
|
1040
|
+
size: "sm",
|
|
1041
|
+
"stroke-width": 1.75
|
|
1042
|
+
}, null, 8, ["icon"])]),
|
|
1043
|
+
_: 1
|
|
1044
|
+
}, 8, [
|
|
1045
|
+
"class",
|
|
1046
|
+
"disabled",
|
|
1047
|
+
"aria-pressed",
|
|
1048
|
+
"aria-label"
|
|
1049
|
+
])]),
|
|
1050
|
+
_: 1
|
|
1051
|
+
}, 8, ["content"])) : d("", !0), Sn.value ? (v(), u(Le, {
|
|
1052
|
+
key: 1,
|
|
1053
|
+
content: `${jn.value ? c.collapseAllText : c.expandAllText}: ${An.value} / ${V.value.expandableValues.length}`,
|
|
1054
|
+
placement: "left",
|
|
1055
|
+
align: "center",
|
|
1056
|
+
"open-delay": 120
|
|
1057
|
+
}, {
|
|
1058
|
+
default: C(() => [m(o, {
|
|
1059
|
+
variant: "ghost",
|
|
1060
|
+
size: "xs",
|
|
1061
|
+
rounded: "sm",
|
|
1062
|
+
throttle: !1,
|
|
1063
|
+
class: g(["bing-tree-select__action-button", { "is-active": An.value > 0 }]),
|
|
1064
|
+
"data-action": "toggle-expand-all",
|
|
1065
|
+
disabled: H.value || !xn.value,
|
|
1066
|
+
"aria-pressed": jn.value,
|
|
1067
|
+
"aria-label": `${jn.value ? c.collapseAllText : c.expandAllText}:已展开 ${An.value} 项,共 ${V.value.expandableValues.length} 项`,
|
|
1068
|
+
onClick: Nr
|
|
1069
|
+
}, {
|
|
1070
|
+
prefix: C(() => [m(s, {
|
|
1071
|
+
icon: jn.value ? x(le) : x(ue),
|
|
1072
|
+
size: "sm",
|
|
1073
|
+
"stroke-width": 1.75
|
|
1074
|
+
}, null, 8, ["icon"])]),
|
|
1075
|
+
_: 1
|
|
1076
|
+
}, 8, [
|
|
1077
|
+
"class",
|
|
1078
|
+
"disabled",
|
|
1079
|
+
"aria-pressed",
|
|
1080
|
+
"aria-label"
|
|
1081
|
+
])]),
|
|
1082
|
+
_: 1
|
|
1083
|
+
}, 8, ["content"])) : d("", !0)], 36)) : d("", !0),
|
|
1084
|
+
kt.value ? (v(), f("div", {
|
|
1085
|
+
key: 1,
|
|
1086
|
+
id: Tt,
|
|
1087
|
+
ref_key: "panelRef",
|
|
1088
|
+
ref: A,
|
|
1089
|
+
class: g(Hn.value),
|
|
1090
|
+
style: _(Kn.value),
|
|
1091
|
+
role: "tree",
|
|
1092
|
+
"aria-multiselectable": c.multiple || void 0,
|
|
1093
|
+
onKeydown: ri,
|
|
1094
|
+
onPointermove: t[8] ||= (...e) => x(z).rememberPointer && x(z).rememberPointer(...e),
|
|
1095
|
+
onWheelPassive: hr
|
|
1096
|
+
}, [cn.value ? (v(), f("div", {
|
|
1097
|
+
key: 0,
|
|
1098
|
+
ref_key: "toolbarRef",
|
|
1099
|
+
ref: Dt,
|
|
1100
|
+
class: "bing-tree-select__toolbar"
|
|
1101
|
+
}, [cn.value ? (v(), u(me, {
|
|
1102
|
+
key: 0,
|
|
1103
|
+
ref_key: "searchInputRef",
|
|
1104
|
+
ref: Et,
|
|
1105
|
+
modelValue: At.value,
|
|
1106
|
+
"onUpdate:modelValue": t[4] ||= (e) => At.value = e,
|
|
1107
|
+
class: "bing-tree-select__search",
|
|
1108
|
+
type: "search",
|
|
1109
|
+
icon: x(fe),
|
|
1110
|
+
size: "sm",
|
|
1111
|
+
block: "",
|
|
1112
|
+
placeholder: ln.value,
|
|
1113
|
+
autocomplete: "off",
|
|
1114
|
+
spellcheck: !1,
|
|
1115
|
+
"clear-aria-label": "清空搜索",
|
|
1116
|
+
onClear: Lr,
|
|
1117
|
+
onKeydown: Je(ii, ["stop"])
|
|
1118
|
+
}, null, 8, [
|
|
1119
|
+
"modelValue",
|
|
1120
|
+
"icon",
|
|
1121
|
+
"placeholder"
|
|
1122
|
+
])) : d("", !0)], 512)) : d("", !0), m(_e, {
|
|
1123
|
+
ref_key: "panelScrollRef",
|
|
1124
|
+
ref: M,
|
|
1125
|
+
class: "bing-tree-select__panel-scroll",
|
|
1126
|
+
height: jt.value,
|
|
1127
|
+
smooth: Ct.value,
|
|
1128
|
+
focusable: !1,
|
|
1129
|
+
always: "",
|
|
1130
|
+
"aria-label": "树形节点列表",
|
|
1131
|
+
onScroll: gr
|
|
1132
|
+
}, {
|
|
1133
|
+
default: C(() => [p("div", {
|
|
1134
|
+
class: g(["bing-tree-select__panel-body", { "is-virtual": x(Zt) }]),
|
|
1135
|
+
style: _(x(nn))
|
|
1136
|
+
}, [p("div", {
|
|
1137
|
+
class: g(["bing-tree-select__node-stack", { "is-virtual": x(Zt) }]),
|
|
1138
|
+
style: _(x(rn)),
|
|
1139
|
+
onMouseenter: t[6] ||= (...e) => x(z).cancelHide && x(z).cancelHide(...e),
|
|
1140
|
+
onMouseleave: t[7] ||= (e) => x(z).scheduleHide()
|
|
1141
|
+
}, [(v(!0), f(Re, null, Ue(un.value, (n) => (v(), f("div", {
|
|
1142
|
+
id: ar(n),
|
|
1143
|
+
key: `${n.path.join("__")}__${n.index}`,
|
|
1144
|
+
class: g(["bing-tree-select__node", {
|
|
1145
|
+
"is-selected": X(n),
|
|
1146
|
+
"is-indeterminate": or(n),
|
|
1147
|
+
"is-active": F.value === n.value,
|
|
1148
|
+
"is-disabled": n.disabled,
|
|
1149
|
+
"is-branch": n.children.length > 0,
|
|
1150
|
+
"has-detail": fr(n),
|
|
1151
|
+
"is-leaf": n.children.length === 0,
|
|
1152
|
+
"is-not-selectable": !n.selectable
|
|
1153
|
+
}]),
|
|
1154
|
+
role: "treeitem",
|
|
1155
|
+
style: _(dn.value),
|
|
1156
|
+
"aria-level": n.depth + 1,
|
|
1157
|
+
"aria-expanded": n.children.length ? Y(n) : void 0,
|
|
1158
|
+
"aria-selected": X(n),
|
|
1159
|
+
"aria-disabled": n.disabled || !n.selectable || void 0,
|
|
1160
|
+
"data-depth": n.depth,
|
|
1161
|
+
"data-node-index": n.index,
|
|
1162
|
+
onClick: (e) => Rr(n, e),
|
|
1163
|
+
onMouseenter: (e) => Kr(e, n),
|
|
1164
|
+
onMousemove: (e) => qr(e, n),
|
|
1165
|
+
onMouseleave: Gr
|
|
1166
|
+
}, [p("div", nt, [
|
|
1167
|
+
t[11] ||= p("span", {
|
|
1168
|
+
class: "bing-tree-select__node-liquid",
|
|
1169
|
+
"aria-hidden": "true"
|
|
1170
|
+
}, null, -1),
|
|
1171
|
+
p("span", {
|
|
1172
|
+
class: "bing-tree-select__node-indent",
|
|
1173
|
+
style: _({ width: `${n.depth * 16}px` }),
|
|
1174
|
+
"aria-hidden": "true"
|
|
1175
|
+
}, null, 4),
|
|
1176
|
+
n.children.length > 0 ? (v(), u(o, {
|
|
1177
|
+
key: 0,
|
|
1178
|
+
variant: "ghost",
|
|
1179
|
+
size: "xs",
|
|
1180
|
+
rounded: "sm",
|
|
1181
|
+
throttle: !1,
|
|
1182
|
+
class: "bing-tree-select__expand",
|
|
1183
|
+
"aria-label": Y(n) ? `收起 ${n.label}` : `展开 ${n.label}`,
|
|
1184
|
+
"aria-expanded": Y(n),
|
|
1185
|
+
disabled: H.value,
|
|
1186
|
+
onClick: Je((e) => Ar(n), ["stop"]),
|
|
1187
|
+
onKeydown: t[5] ||= Je(() => {}, ["stop"])
|
|
1188
|
+
}, {
|
|
1189
|
+
prefix: C(() => [m(s, {
|
|
1190
|
+
icon: Y(n) ? x(oe) : x(se),
|
|
1191
|
+
size: "xs",
|
|
1192
|
+
"stroke-width": 1.75
|
|
1193
|
+
}, null, 8, ["icon"])]),
|
|
1194
|
+
_: 2
|
|
1195
|
+
}, 1032, [
|
|
1196
|
+
"aria-label",
|
|
1197
|
+
"aria-expanded",
|
|
1198
|
+
"disabled",
|
|
1199
|
+
"onClick"
|
|
1200
|
+
])) : (v(), f("span", rt)),
|
|
1201
|
+
m(xe, {
|
|
1202
|
+
decorative: "",
|
|
1203
|
+
"model-value": X(n),
|
|
1204
|
+
indeterminate: or(n),
|
|
1205
|
+
disabled: n.disabled || !n.selectable,
|
|
1206
|
+
size: x(E) === "lg" ? "md" : "sm",
|
|
1207
|
+
shape: c.multiple ? "rounded" : "circle"
|
|
1208
|
+
}, null, 8, [
|
|
1209
|
+
"model-value",
|
|
1210
|
+
"indeterminate",
|
|
1211
|
+
"disabled",
|
|
1212
|
+
"size",
|
|
1213
|
+
"shape"
|
|
1214
|
+
]),
|
|
1215
|
+
p("span", it, [We(e.$slots, "node", {
|
|
1216
|
+
node: n.node,
|
|
1217
|
+
selected: X(n),
|
|
1218
|
+
indeterminate: or(n),
|
|
1219
|
+
depth: n.depth,
|
|
1220
|
+
expanded: Y(n)
|
|
1221
|
+
}, () => [p("span", at, b(n.label), 1)], !0)]),
|
|
1222
|
+
n.children.length > 0 ? (v(), f("span", {
|
|
1223
|
+
key: 2,
|
|
1224
|
+
class: "bing-tree-select__child-count",
|
|
1225
|
+
title: `${n.children.length} child nodes`,
|
|
1226
|
+
"aria-label": `${n.children.length} child nodes`
|
|
1227
|
+
}, b(n.children.length), 9, ot)) : d("", !0),
|
|
1228
|
+
fr(n) ? (v(), f("span", {
|
|
1229
|
+
key: 3,
|
|
1230
|
+
class: "bing-tree-select__node-detail-indicator",
|
|
1231
|
+
title: `Details available for ${n.label}`,
|
|
1232
|
+
"aria-hidden": "true"
|
|
1233
|
+
}, [m(s, {
|
|
1234
|
+
icon: x(ce),
|
|
1235
|
+
size: 12,
|
|
1236
|
+
"stroke-width": 1.75
|
|
1237
|
+
}, null, 8, ["icon"])], 8, st)) : d("", !0)
|
|
1238
|
+
])], 46, tt))), 128))], 38), U.value.length === 0 ? (v(), f("div", ct, b(H.value ? c.noSearchResultsText : c.emptyText), 1)) : d("", !0)], 6)]),
|
|
1239
|
+
_: 3
|
|
1240
|
+
}, 8, ["height", "smooth"])], 46, et)) : d("", !0),
|
|
1241
|
+
x(Ht) && K.value && Nn.value ? (v(), f("div", {
|
|
1242
|
+
key: 2,
|
|
1243
|
+
ref_key: "nodeDetailPanelRef",
|
|
1244
|
+
ref: N,
|
|
1245
|
+
class: g(["bing-tree-select__node-detail-panel", `is-placement-${x(Ut)}`]),
|
|
1246
|
+
style: _(Bn.value),
|
|
1247
|
+
"aria-hidden": "true",
|
|
1248
|
+
onPointerdown: Hr,
|
|
1249
|
+
onClick: Hr,
|
|
1250
|
+
onMouseenter: t[9] ||= (...e) => x(z).cancelHide && x(z).cancelHide(...e),
|
|
1251
|
+
onMouseleave: t[10] ||= (e) => x(z).scheduleHide()
|
|
1252
|
+
}, [p("div", {
|
|
1253
|
+
ref_key: "nodeDetailContentRef",
|
|
1254
|
+
ref: Ot,
|
|
1255
|
+
class: "bing-tree-select__node-detail-content"
|
|
1256
|
+
}, [We(e.$slots, "node-detail", {
|
|
1257
|
+
node: Nn.value,
|
|
1258
|
+
selected: Pn.value,
|
|
1259
|
+
indeterminate: Fn.value,
|
|
1260
|
+
depth: K.value.depth,
|
|
1261
|
+
expanded: Y(K.value)
|
|
1262
|
+
}, () => [
|
|
1263
|
+
p("span", lt, b(Nn.value.label), 1),
|
|
1264
|
+
In.value ? (v(), f("span", ut, b(In.value), 1)) : d("", !0),
|
|
1265
|
+
(v(!0), f(Re, null, Ue(Ln.value, (e) => (v(), f("span", {
|
|
1266
|
+
key: e.key,
|
|
1267
|
+
class: "bing-tree-select__node-detail-meta"
|
|
1268
|
+
}, [p("span", dt, b(e.key), 1), p("span", ft, b(e.value), 1)]))), 128))
|
|
1269
|
+
], !0)], 512)], 38)) : d("", !0)
|
|
1270
|
+
])) : d("", !0)], 38));
|
|
1271
|
+
}
|
|
1272
|
+
});
|
|
1273
|
+
//#endregion
|
|
1274
|
+
export { mt as default };
|