@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.
Files changed (210) hide show
  1. package/README.md +300 -171
  2. package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
  3. package/dist/bing-ui.css +1 -1
  4. package/dist/components/BingAnimatedText/BingAnimatedText.js +7 -0
  5. package/dist/components/BingAnimatedText/BingAnimatedText.vue_vue_type_script_setup_true_lang.js +194 -0
  6. package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.js +7 -0
  7. package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.vue_vue_type_script_setup_true_lang.js +244 -0
  8. package/dist/components/BingAutocomplete/BingAutocomplete.js +7 -0
  9. package/dist/components/BingAutocomplete/BingAutocomplete.vue.d.ts +4 -4
  10. package/dist/components/BingAutocomplete/BingAutocomplete.vue_vue_type_script_setup_true_lang.js +560 -0
  11. package/dist/components/BingButton/BingButton.js +7 -0
  12. package/dist/components/BingButton/BingButton.vue.d.ts +2 -2
  13. package/dist/components/BingButton/BingButton.vue_vue_type_script_setup_true_lang.js +200 -0
  14. package/dist/components/BingCard/BingCard.js +7 -0
  15. package/dist/components/BingCard/BingCard.vue_vue_type_script_setup_true_lang.js +481 -0
  16. package/dist/components/BingCarouselTransition/BingCarouselTransition.js +7 -0
  17. package/dist/components/BingCarouselTransition/BingCarouselTransition.vue_vue_type_script_setup_true_lang.js +174 -0
  18. package/dist/components/BingCheckbox/BingCheckbox.js +7 -0
  19. package/dist/components/BingCheckbox/BingCheckbox.vue.d.ts +4 -4
  20. package/dist/components/BingCheckbox/BingCheckbox.vue_vue_type_script_setup_true_lang.js +233 -0
  21. package/dist/components/BingCheckboxGroup/BingCheckboxGroup.context.js +4 -0
  22. package/dist/components/BingCheckboxGroup/BingCheckboxGroup.js +7 -0
  23. package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue.d.ts +4 -4
  24. package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue_vue_type_script_setup_true_lang.js +105 -0
  25. package/dist/components/BingCodeBlock/BingCodeBlock.highlight.js +78 -0
  26. package/dist/components/BingCodeBlock/BingCodeBlock.js +7 -0
  27. package/dist/components/BingCodeBlock/BingCodeBlock.vue_vue_type_script_setup_true_lang.js +347 -0
  28. package/dist/components/BingColorPicker/BingColorPicker.js +7 -0
  29. package/dist/components/BingColorPicker/BingColorPicker.utils.d.ts +70 -0
  30. package/dist/components/BingColorPicker/BingColorPicker.utils.js +265 -0
  31. package/dist/components/BingColorPicker/BingColorPicker.vue.d.ts +7 -7
  32. package/dist/components/BingColorPicker/BingColorPicker.vue_vue_type_script_setup_true_lang.js +540 -0
  33. package/dist/components/BingColorPicker/BingColorPickerFormatEditor.js +7 -0
  34. package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue.d.ts +27 -0
  35. package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue_vue_type_script_setup_true_lang.js +142 -0
  36. package/dist/components/BingColorPicker/BingColorPickerSpectrum.js +7 -0
  37. package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue.d.ts +26 -0
  38. package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue_vue_type_script_setup_true_lang.js +168 -0
  39. package/dist/components/BingConfigProvider/BingConfigProvider.js +5 -0
  40. package/dist/components/BingConfigProvider/BingConfigProvider.types.d.ts +5 -0
  41. package/dist/components/BingConfigProvider/BingConfigProvider.vue.d.ts +18 -0
  42. package/dist/components/BingConfigProvider/BingConfigProvider.vue_vue_type_script_setup_true_lang.js +18 -0
  43. package/dist/components/BingConfigProvider/index.d.ts +3 -0
  44. package/dist/components/BingCursor/BingCursor.controller.js +240 -0
  45. package/dist/components/BingCursor/BingCursor.js +7 -0
  46. package/dist/components/BingCursor/BingCursor.native.js +20 -0
  47. package/dist/components/BingCursor/BingCursor.presets.js +60 -0
  48. package/dist/components/BingCursor/BingCursor.shapes.js +83 -0
  49. package/dist/components/BingCursor/BingCursor.styleSource.js +83 -0
  50. package/dist/components/BingCursor/BingCursor.vue_vue_type_script_setup_true_lang.js +73 -0
  51. package/dist/components/BingDatePicker/BingDatePicker.js +7 -0
  52. package/dist/components/BingDatePicker/BingDatePicker.utils.d.ts +26 -0
  53. package/dist/components/BingDatePicker/BingDatePicker.utils.js +137 -0
  54. package/dist/components/BingDatePicker/BingDatePicker.vue.d.ts +14 -14
  55. package/dist/components/BingDatePicker/BingDatePicker.vue_vue_type_script_setup_true_lang.js +804 -0
  56. package/dist/components/BingDatePicker/BingDatePickerCalendar.js +7 -0
  57. package/dist/components/BingDatePicker/BingDatePickerCalendar.vue.d.ts +37 -0
  58. package/dist/components/BingDatePicker/BingDatePickerCalendar.vue_vue_type_script_setup_true_lang.js +248 -0
  59. package/dist/components/BingDatePicker/BingDatePickerTimePanel.js +7 -0
  60. package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue.d.ts +26 -0
  61. package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue_vue_type_script_setup_true_lang.js +97 -0
  62. package/dist/components/BingDeckTransition/BingDeckTransition.js +7 -0
  63. package/dist/components/BingDeckTransition/BingDeckTransition.vue_vue_type_script_setup_true_lang.js +187 -0
  64. package/dist/components/BingDialog/BingDialog.js +7 -0
  65. package/dist/components/BingDialog/BingDialog.vue.d.ts +4 -5
  66. package/dist/components/BingDialog/BingDialog.vue_vue_type_script_setup_true_lang.js +558 -0
  67. package/dist/components/BingDropDown/BingDropDown.context.js +4 -0
  68. package/dist/components/BingDropDown/BingDropDown.js +7 -0
  69. package/dist/components/BingDropDown/BingDropDown.vue.d.ts +1 -2
  70. package/dist/components/BingDropDown/BingDropDown.vue_vue_type_script_setup_true_lang.js +649 -0
  71. package/dist/components/BingDropDown/BingDropDownItem.js +7 -0
  72. package/dist/components/BingDropDown/BingDropDownItem.vue.d.ts +1 -1
  73. package/dist/components/BingDropDown/BingDropDownItem.vue_vue_type_script_setup_true_lang.js +308 -0
  74. package/dist/components/BingFilePreview/BingFilePreview.js +7 -0
  75. package/dist/components/BingFilePreview/BingFilePreview.vue.d.ts +4 -5
  76. package/dist/components/BingFilePreview/BingFilePreview.vue_vue_type_script_setup_true_lang.js +589 -0
  77. package/dist/components/BingForm/BingForm.context.js +7 -0
  78. package/dist/components/BingForm/BingForm.js +7 -0
  79. package/dist/components/BingForm/BingForm.vue.d.ts +0 -1
  80. package/dist/components/BingForm/BingForm.vue_vue_type_script_setup_true_lang.js +300 -0
  81. package/dist/components/BingForm/formFocus.js +13 -0
  82. package/dist/components/BingForm/formTabOrder.js +27 -0
  83. package/dist/components/BingForm/useFormControl.d.ts +1 -1
  84. package/dist/components/BingForm/useFormControl.js +24 -0
  85. package/dist/components/BingForm/useFormNextHint.js +135 -0
  86. package/dist/components/BingFormItem/BingFormItem.js +7 -0
  87. package/dist/components/BingFormItem/BingFormItem.vue.d.ts +1 -1
  88. package/dist/components/BingFormItem/BingFormItem.vue_vue_type_script_setup_true_lang.js +252 -0
  89. package/dist/components/BingIcon/BingIcon.js +7 -0
  90. package/dist/components/BingIcon/BingIcon.vue_vue_type_script_setup_true_lang.js +48 -0
  91. package/dist/components/BingImage/BingImage.js +7 -0
  92. package/dist/components/BingImage/BingImage.vue_vue_type_script_setup_true_lang.js +244 -0
  93. package/dist/components/BingImagePreview/BingImagePreview.js +7 -0
  94. package/dist/components/BingImagePreview/BingImagePreview.vue.d.ts +4 -5
  95. package/dist/components/BingImagePreview/BingImagePreview.vue_vue_type_script_setup_true_lang.js +699 -0
  96. package/dist/components/BingInput/BingInput.js +7 -0
  97. package/dist/components/BingInput/BingInput.vue.d.ts +6 -6
  98. package/dist/components/BingInput/BingInput.vue_vue_type_script_setup_true_lang.js +311 -0
  99. package/dist/components/BingRadio/BingRadio.js +7 -0
  100. package/dist/components/BingRadio/BingRadio.vue.d.ts +4 -4
  101. package/dist/components/BingRadio/BingRadio.vue_vue_type_script_setup_true_lang.js +170 -0
  102. package/dist/components/BingRadioGroup/BingRadioGroup.context.js +4 -0
  103. package/dist/components/BingRadioGroup/BingRadioGroup.js +7 -0
  104. package/dist/components/BingRadioGroup/BingRadioGroup.vue.d.ts +4 -4
  105. package/dist/components/BingRadioGroup/BingRadioGroup.vue_vue_type_script_setup_true_lang.js +125 -0
  106. package/dist/components/BingResizable/BingResizable.js +7 -0
  107. package/dist/components/BingResizable/BingResizable.vue.d.ts +1 -1
  108. package/dist/components/BingResizable/BingResizable.vue_vue_type_script_setup_true_lang.js +555 -0
  109. package/dist/components/BingScrollbar/BingScrollbar.js +7 -0
  110. package/dist/components/BingScrollbar/BingScrollbar.vue.d.ts +2 -2
  111. package/dist/components/BingScrollbar/BingScrollbar.vue_vue_type_script_setup_true_lang.js +398 -0
  112. package/dist/components/BingSelect/BingSelect.js +7 -0
  113. package/dist/components/BingSelect/BingSelect.vue.d.ts +7 -7
  114. package/dist/components/BingSelect/BingSelect.vue_vue_type_script_setup_true_lang.js +1066 -0
  115. package/dist/components/BingSlider/BingSlider.js +7 -0
  116. package/dist/components/BingSlider/BingSlider.vue.d.ts +6 -6
  117. package/dist/components/BingSlider/BingSlider.vue_vue_type_script_setup_true_lang.js +130 -0
  118. package/dist/components/BingSortableList/BingSortableList.js +7 -0
  119. package/dist/components/BingSortableList/BingSortableList.vue_vue_type_script_setup_true_lang.js +334 -0
  120. package/dist/components/BingSortableList/BingSortableListItem.js +7 -0
  121. package/dist/components/BingSortableList/BingSortableListItem.vue_vue_type_script_setup_true_lang.js +76 -0
  122. package/dist/components/BingSplitPane/BingSplitPane.js +7 -0
  123. package/dist/components/BingSplitPane/BingSplitPane.vue_vue_type_script_setup_true_lang.js +167 -0
  124. package/dist/components/BingTable/BingTable.js +7 -0
  125. package/dist/components/BingTable/BingTable.measurements.js +72 -0
  126. package/dist/components/BingTable/BingTable.vue.d.ts +1 -2
  127. package/dist/components/BingTable/BingTable.vue_vue_type_script_setup_true_lang.js +1416 -0
  128. package/dist/components/BingTable/BingTableCellValue.js +7 -0
  129. package/dist/components/BingTable/BingTableCellValue.vue_vue_type_script_setup_true_lang.js +68 -0
  130. package/dist/components/BingTable/BingTableHeaderCell.js +5 -0
  131. package/dist/components/BingTable/BingTableHeaderCell.vue_vue_type_script_setup_true_lang.js +45 -0
  132. package/dist/components/BingTable/BingTableHeaderContent.js +7 -0
  133. package/dist/components/BingTable/BingTableHeaderContent.vue_vue_type_script_setup_true_lang.js +110 -0
  134. package/dist/components/BingTable/useTableColumns.js +126 -0
  135. package/dist/components/BingTableColumnControls/BingTableColumnControls.js +7 -0
  136. package/dist/components/BingTableColumnControls/BingTableColumnControls.vue.d.ts +1 -1
  137. package/dist/components/BingTableColumnControls/BingTableColumnControls.vue_vue_type_script_setup_true_lang.js +251 -0
  138. package/dist/components/BingTabs/BingTabs.js +7 -0
  139. package/dist/components/BingTabs/BingTabs.vue.d.ts +2 -3
  140. package/dist/components/BingTabs/BingTabs.vue_vue_type_script_setup_true_lang.js +320 -0
  141. package/dist/components/BingTag/BingTag.js +7 -0
  142. package/dist/components/BingTag/BingTag.vue.d.ts +0 -1
  143. package/dist/components/BingTag/BingTag.vue_vue_type_script_setup_true_lang.js +65 -0
  144. package/dist/components/BingTextarea/BingTextarea.js +7 -0
  145. package/dist/components/BingTextarea/BingTextarea.vue.d.ts +6 -6
  146. package/dist/components/BingTextarea/BingTextarea.vue_vue_type_script_setup_true_lang.js +243 -0
  147. package/dist/components/BingToast/BingToast.js +7 -0
  148. package/dist/components/BingToast/BingToast.service.js +132 -0
  149. package/dist/components/BingToast/BingToast.types.d.ts +1 -1
  150. package/dist/components/BingToast/BingToast.types.js +19 -0
  151. package/dist/components/BingToast/BingToast.vue.d.ts +0 -1
  152. package/dist/components/BingToast/BingToast.vue_vue_type_script_setup_true_lang.js +307 -0
  153. package/dist/components/BingTooltip/BingTooltip.js +7 -0
  154. package/dist/components/BingTooltip/BingTooltip.shared.js +14 -0
  155. package/dist/components/BingTooltip/BingTooltip.vue.d.ts +4 -5
  156. package/dist/components/BingTooltip/BingTooltip.vue_vue_type_script_setup_true_lang.js +572 -0
  157. package/dist/components/BingTreeSelect/BingTreeSelect.js +7 -0
  158. package/dist/components/BingTreeSelect/BingTreeSelect.vue.d.ts +7 -7
  159. package/dist/components/BingTreeSelect/BingTreeSelect.vue_vue_type_script_setup_true_lang.js +1274 -0
  160. package/dist/components/index.d.ts +1 -0
  161. package/dist/icons/LICENSE-lucide.txt +39 -0
  162. package/dist/icons/createIcon.d.ts +8 -0
  163. package/dist/icons/createIcon.js +36 -0
  164. package/dist/icons/icons.d.ts +51 -0
  165. package/dist/icons/icons.js +252 -0
  166. package/dist/icons/index.d.ts +3 -0
  167. package/dist/index.js +48 -0
  168. package/dist/motion/clickParticles.d.ts +1 -1
  169. package/dist/motion/clickParticles2.js +66 -0
  170. package/dist/motion/index.d.ts +1 -1
  171. package/dist/motion/index.js +17 -0
  172. package/dist/motion/liquidHover.js +36 -0
  173. package/dist/motion/optionDetailMotion.d.ts +7 -1
  174. package/dist/motion/optionDetailMotion.js +74 -0
  175. package/dist/motion/panelMotion.js +19 -0
  176. package/dist/motion/reducedMotion.d.ts +16 -0
  177. package/dist/motion/reducedMotion.js +28 -0
  178. package/dist/motion/selectPanelMotion.js +115 -0
  179. package/dist/motion/smoothScroll.d.ts +2 -0
  180. package/dist/motion/smoothScroll.js +276 -0
  181. package/dist/motion/useClickFeedback.js +47 -0
  182. package/dist/motion/useTextControlCaret.js +136 -0
  183. package/dist/utils/clipboard.d.ts +9 -0
  184. package/dist/utils/clipboard.js +16 -0
  185. package/dist/utils/config.d.ts +42 -0
  186. package/dist/utils/config.js +37 -0
  187. package/dist/utils/controlAttrs.js +37 -0
  188. package/dist/utils/floating.d.ts +86 -0
  189. package/dist/utils/floating.js +99 -0
  190. package/dist/utils/glass.js +25 -0
  191. package/dist/utils/overlay.js +94 -0
  192. package/dist/utils/scrollLock.js +44 -0
  193. package/dist/utils/search.d.ts +16 -0
  194. package/dist/utils/search.js +23 -0
  195. package/dist/utils/useClientReady.js +10 -0
  196. package/dist/utils/useDeferredBlurValidation.d.ts +18 -0
  197. package/dist/utils/useDeferredBlurValidation.js +34 -0
  198. package/dist/utils/useKeyboardScrollSync.d.ts +11 -0
  199. package/dist/utils/useKeyboardScrollSync.js +28 -0
  200. package/dist/utils/useOptionDetailPanel.d.ts +50 -0
  201. package/dist/utils/useOptionDetailPanel.js +180 -0
  202. package/dist/utils/useOutsidePointerDown.d.ts +8 -0
  203. package/dist/utils/useOutsidePointerDown.js +17 -0
  204. package/dist/utils/useSearchShortcutFocus.d.ts +18 -0
  205. package/dist/utils/useSearchShortcutFocus.js +47 -0
  206. package/dist/utils/useVirtualList.d.ts +42 -0
  207. package/dist/utils/useVirtualList.js +74 -0
  208. package/package.json +15 -9
  209. package/dist/bing-ui.es.js +0 -31278
  210. package/dist/bing-ui.umd.js +0 -229
@@ -0,0 +1,558 @@
1
+ import { useConfigZIndex as e } from "../../utils/config.js";
2
+ import { useReducedMotion as t } from "../../motion/reducedMotion.js";
3
+ import n from "../BingButton/BingButton.js";
4
+ import { Eye as r, EyeOff as i, X as a } from "../../icons/icons.js";
5
+ import o from "../BingIcon/BingIcon.js";
6
+ import s from "../BingScrollbar/BingScrollbar.js";
7
+ import { useOverlay as ee } from "../../utils/overlay.js";
8
+ import { useClientReady as c } from "../../utils/useClientReady.js";
9
+ import { normalizeGlassCssLength as te } from "../../utils/glass.js";
10
+ import { createScrollLock as ne } from "../../utils/scrollLock.js";
11
+ import { Fragment as re, Teleport as ie, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, nextTick as ae, normalizeClass as oe, normalizeStyle as _, onBeforeUnmount as se, openBlock as v, ref as y, renderList as ce, renderSlot as b, toDisplayString as x, unref as S, useId as le, watch as C, withCtx as w } from "vue";
12
+ import { gsap as T } from "gsap";
13
+ //#region src/components/BingDialog/BingDialog.vue?vue&type=script&setup=true&lang.ts
14
+ var ue = {
15
+ key: 0,
16
+ class: "bing-dialog__ambience",
17
+ "aria-hidden": "true"
18
+ }, de = [
19
+ "aria-label",
20
+ "aria-labelledby",
21
+ "aria-describedby"
22
+ ], fe = { class: "bing-dialog__header" }, pe = { class: "bing-dialog__heading" }, me = ["id"], he = { class: "bing-dialog__actions" }, ge = ["aria-pressed"], _e = {
23
+ key: 0,
24
+ class: "bing-dialog__header-addon"
25
+ }, ve = { class: "bing-dialog__body" }, ye = {
26
+ key: 0,
27
+ class: "bing-dialog__footer"
28
+ }, be = 220, xe = /* @__PURE__ */ g({
29
+ __name: "BingDialog",
30
+ props: {
31
+ modelValue: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ title: { default: void 0 },
36
+ width: { default: "520px" },
37
+ maxWidth: { default: void 0 },
38
+ height: { default: void 0 },
39
+ maxHeight: { default: void 0 },
40
+ zIndex: {},
41
+ lockScroll: {
42
+ type: Boolean,
43
+ default: !0
44
+ },
45
+ smoothScroll: {
46
+ type: [Boolean, Object],
47
+ default: !0
48
+ },
49
+ closeOnOverlay: {
50
+ type: Boolean,
51
+ default: !0
52
+ },
53
+ closeOnEsc: {
54
+ type: Boolean,
55
+ default: !0
56
+ },
57
+ closeOnConfirm: {
58
+ type: Boolean,
59
+ default: !1
60
+ },
61
+ showClose: {
62
+ type: Boolean,
63
+ default: !0
64
+ },
65
+ showFooter: {
66
+ type: Boolean,
67
+ default: !0
68
+ },
69
+ cancelText: { default: "关闭" },
70
+ confirmText: { default: "确定" },
71
+ confirmLoading: {
72
+ type: Boolean,
73
+ default: !1
74
+ },
75
+ confirmDisabled: {
76
+ type: Boolean,
77
+ default: !1
78
+ },
79
+ glass: {
80
+ type: Boolean,
81
+ default: !0
82
+ },
83
+ overlayBlur: {
84
+ type: Boolean,
85
+ default: !0
86
+ },
87
+ overlayOrbs: { default: () => [] },
88
+ overlayOrbsAnimated: {
89
+ type: Boolean,
90
+ default: !1
91
+ },
92
+ showPeek: {
93
+ type: Boolean,
94
+ default: !0
95
+ },
96
+ peekOpacity: { default: 0 },
97
+ ariaLabel: { default: void 0 },
98
+ ariaDescribedby: { default: void 0 },
99
+ glassBlur: { default: void 0 },
100
+ glassOpacity: { default: void 0 },
101
+ glassSaturation: { default: void 0 }
102
+ },
103
+ emits: [
104
+ "update:modelValue",
105
+ "close",
106
+ "cancel",
107
+ "confirm"
108
+ ],
109
+ setup(g, { emit: xe }) {
110
+ let Se = t(), E = g, D = xe, Ce = e("dialog", () => E.zIndex), O = c(), we = `bing-dialog-${le()}`, k = 0, A, j, M = !1, N, P = y(E.modelValue), F = y(!1), I = y(!1), L = y(null), R = y(null), z = y(null), Te = l(() => typeof E.width == "number" ? `${E.width}px` : E.width), Ee = ee({
111
+ open: () => O.value && P.value,
112
+ elements: () => [L.value?.querySelector(".bing-dialog")],
113
+ zIndex: () => Ce.value,
114
+ modal: !0,
115
+ closeOnEscape: () => E.modelValue && E.closeOnEsc,
116
+ onEscape: () => G("escape")
117
+ }), De = l(() => ({
118
+ "--bing-dialog-overlay-glass-blur": E.glassBlur === void 0 ? "var(--bing-glass-blur, 16px)" : te(E.glassBlur),
119
+ "--bing-dialog-overlay-glass-saturation": E.glassSaturation === void 0 ? "var(--bing-glass-saturation, 1.05)" : String(Math.max(0, E.glassSaturation)),
120
+ zIndex: Ee.zIndex.value
121
+ })), Oe = l(() => ({
122
+ width: Te.value,
123
+ height: B(E.height),
124
+ maxWidth: E.maxWidth === void 0 ? void 0 : `min(100%, ${B(E.maxWidth)})`,
125
+ maxHeight: E.height === void 0 && E.maxHeight === void 0 ? void 0 : `min(${B(E.maxHeight) ?? "100dvh"}, calc(100dvh - 2 * var(--bing-dialog-gutter)))`
126
+ }));
127
+ function B(e) {
128
+ return typeof e == "number" ? `${Math.max(0, e)}px` : e;
129
+ }
130
+ let ke = l(() => ["bing-dialog"]), Ae = l(() => ["bing-dialog-root", {
131
+ "is-active": F.value,
132
+ "is-peeking": I.value,
133
+ "has-overlay-blur": E.overlayBlur,
134
+ "has-animated-orbs": E.overlayBlur && E.overlayOrbsAnimated
135
+ }]), V = l(() => E.title ? `${we}-title` : void 0), je = l(() => E.ariaLabel ?? (E.title ? void 0 : "对话框")), Me = l(() => Math.min(1, Math.max(0, E.peekOpacity))), H = l(() => E.overlayBlur ? E.overlayOrbs : []);
136
+ function Ne(e, t) {
137
+ return typeof e == "number" ? `${e}px` : e ?? `${t}px`;
138
+ }
139
+ function Pe(e) {
140
+ return {
141
+ left: `${e.x ?? 50}%`,
142
+ top: `${e.y ?? 50}%`,
143
+ width: Ne(e.size, 360),
144
+ height: Ne(e.size, 360),
145
+ "--bing-dialog-orb-color": e.color,
146
+ "--bing-dialog-orb-opacity": Math.min(1, Math.max(0, e.opacity ?? .18)),
147
+ "--bing-dialog-orb-blur": `${Math.max(0, e.blur ?? 64)}px`
148
+ };
149
+ }
150
+ function U() {
151
+ return typeof window < "u" && typeof document < "u";
152
+ }
153
+ let { lock: Fe, unlock: W } = ne();
154
+ function Ie() {
155
+ if (E.modelValue && E.lockScroll) {
156
+ Fe();
157
+ return;
158
+ }
159
+ E.lockScroll || W();
160
+ }
161
+ function G(e) {
162
+ z.value?.stop(), D("update:modelValue", !1), D("close", e);
163
+ }
164
+ function Le() {
165
+ G("close");
166
+ }
167
+ function Re() {
168
+ D("cancel"), G("cancel");
169
+ }
170
+ function ze() {
171
+ D("confirm"), E.closeOnConfirm && G("confirm");
172
+ }
173
+ function Be() {
174
+ E.closeOnOverlay && G("overlay");
175
+ }
176
+ let Ve = /^(auto|scroll|overlay)$/;
177
+ function He(e, t, n) {
178
+ if (!n) return !1;
179
+ let r = t === "vertical", i = r ? e.clientHeight : e.clientWidth, a = r ? e.scrollHeight : e.scrollWidth, o = Math.max(0, a - i);
180
+ if (o <= .5) return !1;
181
+ let s = window.getComputedStyle(e), ee = r ? s.overflowY : s.overflowX;
182
+ if (!Ve.test(ee)) return !1;
183
+ let c = r ? e.scrollTop : e.scrollLeft;
184
+ return n < 0 ? c > .5 : c < o - .5;
185
+ }
186
+ function Ue(e) {
187
+ if (!(e.target instanceof Element)) return !1;
188
+ let t = e.target.closest(".bing-dialog");
189
+ if (!t || !L.value?.contains(t)) return !1;
190
+ let n = e.deltaX || (e.shiftKey ? e.deltaY : 0), r = e.shiftKey && !e.deltaX ? 0 : e.deltaY, i = e.target instanceof HTMLElement ? e.target : e.target.parentElement;
191
+ for (; i && i !== t;) {
192
+ if (He(i, "horizontal", n) || He(i, "vertical", r)) return !0;
193
+ i = i.parentElement;
194
+ }
195
+ return !1;
196
+ }
197
+ function We(e) {
198
+ e.defaultPrevented || Ue(e) || e.preventDefault();
199
+ }
200
+ function Ge() {
201
+ U() && (k &&= (window.cancelAnimationFrame(k), 0), A &&= (window.clearTimeout(A), void 0));
202
+ }
203
+ function K() {
204
+ N?.revert(), N = void 0;
205
+ }
206
+ function Ke(e) {
207
+ let t = e.motionX ?? 48, n = e.motionY ?? 34, r = Math.abs(t), i = Math.abs(n), a = t < 0 ? -1 : 1, o = n < 0 ? -1 : 1;
208
+ return [
209
+ {
210
+ x: -r * .42 * a,
211
+ y: -i * .28 * o
212
+ },
213
+ {
214
+ x: r * .34 * a,
215
+ y: -i * .7 * o
216
+ },
217
+ {
218
+ x: r * .72 * a,
219
+ y: i * .18 * o
220
+ },
221
+ {
222
+ x: -r * .16 * a,
223
+ y: i * .78 * o
224
+ },
225
+ {
226
+ x: -r * .62 * a,
227
+ y: i * .08 * o
228
+ }
229
+ ];
230
+ }
231
+ function q() {
232
+ if (K(), !E.modelValue || !E.overlayBlur || !E.overlayOrbsAnimated || Se() || !L.value) return;
233
+ let e = Array.from(L.value.querySelectorAll(".bing-dialog__orb"));
234
+ e.length !== 0 && (N = T.context(() => {
235
+ e.forEach((e, t) => {
236
+ let n = H.value[t];
237
+ if (!n) return;
238
+ let r = Ke(n), i = Math.max(4, n.duration ?? 12) / r.length, a = T.timeline({
239
+ delay: Math.max(0, n.delay ?? t * .28),
240
+ repeat: -1
241
+ });
242
+ T.set(e, {
243
+ x: r[0].x,
244
+ y: r[0].y,
245
+ force3D: !0
246
+ }), r.slice(1).forEach((t) => {
247
+ a.to(e, {
248
+ x: t.x,
249
+ y: t.y,
250
+ duration: i,
251
+ ease: "sine.inOut",
252
+ force3D: !0
253
+ });
254
+ }), a.to(e, {
255
+ x: r[0].x,
256
+ y: r[0].y,
257
+ duration: i,
258
+ ease: "sine.inOut",
259
+ force3D: !0
260
+ });
261
+ });
262
+ }, L.value));
263
+ }
264
+ async function qe() {
265
+ await ae(), q();
266
+ }
267
+ function J() {
268
+ j?.kill(), j = void 0;
269
+ }
270
+ function Je() {
271
+ return L.value ? {
272
+ overlay: L.value.querySelector(".bing-dialog__overlay"),
273
+ overlayBlur: L.value.querySelector(".bing-dialog__overlay-blur"),
274
+ ambience: L.value.querySelector(".bing-dialog__ambience"),
275
+ dialog: L.value.querySelector(".bing-dialog"),
276
+ peek: L.value.querySelector(".bing-dialog__peek"),
277
+ peekAnchor: R.value
278
+ } : null;
279
+ }
280
+ function Y(e) {
281
+ return e.filter((e) => e !== null);
282
+ }
283
+ function Ye(e) {
284
+ let t = Je();
285
+ if (!t) return;
286
+ let n = Y([
287
+ t.overlay,
288
+ t.overlayBlur,
289
+ t.ambience
290
+ ]), r = Se() ? 0 : e ? .32 : .42, i = e ? "power3.inOut" : "power4.out";
291
+ if (!t.dialog || !t.peekAnchor) return;
292
+ J();
293
+ let a = .08;
294
+ if (e) {
295
+ let e = t.dialog.getBoundingClientRect(), n = t.peek?.getBoundingClientRect();
296
+ if (!n) return;
297
+ let r = n.left + n.width / 2, i = n.top + n.height / 2, o = r - e.left, s = i - e.top;
298
+ a = Math.min(.12, Math.max(.055, n.width / Math.max(e.width, e.height))), T.set(t.dialog, {
299
+ transformOrigin: `${o}px ${s}px`,
300
+ transition: "none"
301
+ }), T.set(t.peekAnchor, {
302
+ x: r,
303
+ y: i,
304
+ xPercent: -50,
305
+ yPercent: -50
306
+ });
307
+ }
308
+ if (j = T.timeline({
309
+ defaults: {
310
+ duration: r,
311
+ ease: i,
312
+ overwrite: "auto"
313
+ },
314
+ onComplete: () => {
315
+ if (j = void 0, !e) {
316
+ let e = Y([
317
+ ...n,
318
+ t.dialog,
319
+ t.peekAnchor
320
+ ]);
321
+ T.set(e, { clearProps: "opacity,visibility,transform,transformOrigin,transition" });
322
+ }
323
+ }
324
+ }), e) {
325
+ T.set(t.peekAnchor, {
326
+ autoAlpha: 0,
327
+ scale: 1
328
+ }), j.to(n, { opacity: 0 }, 0).to(t.dialog, {
329
+ scale: a,
330
+ opacity: Me.value,
331
+ force3D: !0
332
+ }, 0).to(t.peekAnchor, {
333
+ autoAlpha: 1,
334
+ duration: r * .58,
335
+ ease: "power3.out"
336
+ }, r * .18);
337
+ return;
338
+ }
339
+ j.to(t.dialog, {
340
+ scale: 1,
341
+ opacity: 1,
342
+ force3D: !0
343
+ }, 0).to(t.peekAnchor, {
344
+ autoAlpha: 0,
345
+ duration: Math.min(r * .48, .18),
346
+ ease: "power2.in"
347
+ }, 0).to(t.overlay, { opacity: 1 }, .04).to(t.overlayBlur, { opacity: +!!E.overlayBlur }, .04).to(t.ambience, { opacity: E.overlayBlur && H.value.length > 0 ? 1 : 0 }, .04);
348
+ }
349
+ function X() {
350
+ !U() || !M || (window.removeEventListener("pointerup", Q), window.removeEventListener("pointercancel", Q), window.removeEventListener("blur", Q), M = !1);
351
+ }
352
+ function Xe() {
353
+ !U() || M || (window.addEventListener("pointerup", Q), window.addEventListener("pointercancel", Q), window.addEventListener("blur", Q), M = !0);
354
+ }
355
+ function Ze() {
356
+ if (I.value = !1, X(), J(), L.value) {
357
+ let e = Je();
358
+ e && T.set(Y([
359
+ e.overlay,
360
+ e.overlayBlur,
361
+ e.ambience,
362
+ e.dialog,
363
+ e.peekAnchor
364
+ ]), { clearProps: "opacity,visibility,transform,transformOrigin,transition" });
365
+ }
366
+ }
367
+ async function Qe(e) {
368
+ if (!U()) {
369
+ P.value = e, F.value = e;
370
+ return;
371
+ }
372
+ if (Ge(), e) {
373
+ P.value = !0, F.value = !1, await ae(), Ze(), q(), k = window.requestAnimationFrame(() => {
374
+ k = 0, F.value = !0;
375
+ });
376
+ return;
377
+ }
378
+ z.value?.stop(), F.value = !1, K(), Ze(), A = window.setTimeout(() => {
379
+ A = void 0, P.value = !1, W();
380
+ }, be);
381
+ }
382
+ function $e(e) {
383
+ if (e.preventDefault(), !(I.value || "repeat" in e && e.repeat)) {
384
+ if (I.value = !0, "pointerId" in e) {
385
+ let t = e.currentTarget;
386
+ Xe();
387
+ try {
388
+ t?.setPointerCapture?.(e.pointerId);
389
+ } catch {}
390
+ }
391
+ Ye(!0);
392
+ }
393
+ }
394
+ function Z() {
395
+ X(), I.value && (I.value = !1, Ye(!1));
396
+ }
397
+ function Q() {
398
+ Z();
399
+ }
400
+ function $(e) {
401
+ return e.key === " " || e.key === "Enter";
402
+ }
403
+ function et(e) {
404
+ $(e) && $e(e);
405
+ }
406
+ function tt(e) {
407
+ $(e) && (e.preventDefault(), Z());
408
+ }
409
+ return C(() => [
410
+ O.value,
411
+ E.modelValue,
412
+ E.lockScroll
413
+ ], () => {
414
+ O.value && Ie();
415
+ }, { immediate: !0 }), C([O, () => E.modelValue], ([e, t]) => {
416
+ e && Qe(t);
417
+ }, { immediate: !0 }), C(() => [
418
+ E.overlayBlur,
419
+ E.overlayOrbsAnimated,
420
+ E.overlayOrbs
421
+ ], qe, {
422
+ deep: !0,
423
+ flush: "post"
424
+ }), se(() => {
425
+ Ge(), K(), X(), J(), z.value?.stop(), W();
426
+ }), (e, t) => S(O) ? (v(), u(ie, {
427
+ key: 0,
428
+ to: "body"
429
+ }, [P.value ? (v(), f("div", {
430
+ key: 0,
431
+ ref_key: "rootRef",
432
+ ref: L,
433
+ class: oe(Ae.value),
434
+ style: _(De.value),
435
+ onWheel: We
436
+ }, [
437
+ t[3] ||= p("div", {
438
+ class: "bing-dialog__overlay-blur",
439
+ "aria-hidden": "true"
440
+ }, null, -1),
441
+ H.value.length > 0 ? (v(), f("div", ue, [(v(!0), f(re, null, ce(H.value, (e, n) => (v(), f("span", {
442
+ key: e.id ?? n,
443
+ class: "bing-dialog__orb-anchor",
444
+ style: _(Pe(e))
445
+ }, [...t[0] ||= [p("span", { class: "bing-dialog__orb" }, null, -1)]], 4))), 128))])) : d("", !0),
446
+ p("div", {
447
+ class: "bing-dialog__overlay",
448
+ "aria-hidden": "true",
449
+ onClick: Be
450
+ }),
451
+ p("section", {
452
+ class: oe(ke.value),
453
+ style: _(Oe.value),
454
+ role: "dialog",
455
+ tabindex: "-1",
456
+ "aria-modal": "true",
457
+ "aria-label": je.value,
458
+ "aria-labelledby": V.value,
459
+ "aria-describedby": g.ariaDescribedby
460
+ }, [
461
+ t[1] ||= p("div", {
462
+ class: "bing-dialog__surface",
463
+ "aria-hidden": "true"
464
+ }, null, -1),
465
+ t[2] ||= p("div", {
466
+ class: "bing-dialog__outline",
467
+ "aria-hidden": "true"
468
+ }, null, -1),
469
+ p("header", fe, [
470
+ p("div", pe, [b(e.$slots, "title", {}, () => [g.title ? (v(), f("h2", {
471
+ key: 0,
472
+ id: V.value,
473
+ class: "bing-dialog__title"
474
+ }, x(g.title), 9, me)) : d("", !0)], !0)]),
475
+ p("div", he, [g.showPeek ? (v(), f("button", {
476
+ key: 0,
477
+ class: "bing-dialog__icon-button bing-dialog__peek",
478
+ type: "button",
479
+ "aria-label": "按住查看背景",
480
+ "aria-pressed": I.value || void 0,
481
+ onPointerdown: $e,
482
+ onPointerup: Z,
483
+ onPointercancel: Z,
484
+ onLostpointercapture: Z,
485
+ onBlur: Z,
486
+ onKeydown: et,
487
+ onKeyup: tt
488
+ }, [h(o, {
489
+ icon: I.value ? S(i) : S(r),
490
+ size: "sm",
491
+ "stroke-width": 1.75
492
+ }, null, 8, ["icon"])], 40, ge)) : d("", !0), g.showClose ? (v(), u(n, {
493
+ key: 1,
494
+ class: "bing-dialog__close",
495
+ throttle: !1,
496
+ variant: "ghost",
497
+ size: "sm",
498
+ rounded: "md",
499
+ "aria-label": "关闭弹窗",
500
+ onClick: Le
501
+ }, {
502
+ prefix: w(() => [h(o, {
503
+ icon: S(a),
504
+ size: "sm",
505
+ "stroke-width": 1.75
506
+ }, null, 8, ["icon"])]),
507
+ _: 1
508
+ })) : d("", !0)]),
509
+ e.$slots["header-addon"] ? (v(), f("div", _e, [b(e.$slots, "header-addon", {}, void 0, !0)])) : d("", !0)
510
+ ]),
511
+ h(s, {
512
+ ref_key: "bodyScrollRef",
513
+ ref: z,
514
+ class: "bing-dialog__body-scroll",
515
+ smooth: g.smoothScroll,
516
+ focusable: !0
517
+ }, {
518
+ default: w(() => [p("div", ve, [b(e.$slots, "default", {}, void 0, !0)])]),
519
+ _: 3
520
+ }, 8, ["smooth"]),
521
+ e.$slots.footer || g.showFooter ? (v(), f("footer", ye, [b(e.$slots, "footer", {
522
+ close: G,
523
+ cancel: Re,
524
+ confirm: ze
525
+ }, () => [h(n, {
526
+ variant: "secondary",
527
+ throttle: !1,
528
+ onClick: Re
529
+ }, {
530
+ default: w(() => [m(x(g.cancelText), 1)]),
531
+ _: 1
532
+ }), h(n, {
533
+ variant: "primary",
534
+ throttle: !0,
535
+ loading: g.confirmLoading,
536
+ disabled: g.confirmDisabled,
537
+ onClick: ze
538
+ }, {
539
+ default: w(() => [m(x(g.confirmText), 1)]),
540
+ _: 1
541
+ }, 8, ["loading", "disabled"])], !0)])) : d("", !0)
542
+ ], 14, de),
543
+ g.showPeek ? (v(), f("div", {
544
+ key: 1,
545
+ ref_key: "peekAnchorRef",
546
+ ref: R,
547
+ class: "bing-dialog__peek-anchor",
548
+ "aria-hidden": "true"
549
+ }, [h(o, {
550
+ icon: S(i),
551
+ size: "sm",
552
+ "stroke-width": 1.75
553
+ }, null, 8, ["icon"])], 512)) : d("", !0)
554
+ ], 38)) : d("", !0)])) : d("", !0);
555
+ }
556
+ });
557
+ //#endregion
558
+ export { xe as default };
@@ -0,0 +1,4 @@
1
+ //#region src/components/BingDropDown/BingDropDown.context.ts
2
+ var e = Symbol("BingDropDownContext");
3
+ //#endregion
4
+ export { e as bingDropDownContextKey };
@@ -0,0 +1,7 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./BingDropDown.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/BingDropDown/BingDropDown.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-50c9e835"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -18,12 +18,11 @@ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<BingDr
18
18
  "onAfter-enter"?: (() => any) | undefined;
19
19
  "onAfter-leave"?: (() => any) | undefined;
20
20
  }>, {
21
+ open: boolean | null;
21
22
  trigger: import('./BingDropDown.types').BingDropDownTrigger;
22
23
  placement: BingDropDownPlacement;
23
- size: import('./BingDropDown.types').BingDropDownSize;
24
24
  block: boolean;
25
25
  ariaLabel: string;
26
- open: boolean | null;
27
26
  glass: boolean;
28
27
  glassBlur: string | number;
29
28
  glassOpacity: number;