@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,125 @@
1
+ import { isolateFormControls as e, useFormControl as t } from "../BingForm/useFormControl.js";
2
+ import { bingRadioGroupContextKey as n } from "./BingRadioGroup.context.js";
3
+ import r from "../BingRadio/BingRadio.js";
4
+ import { Fragment as i, computed as a, createBlock as o, createElementBlock as s, defineComponent as c, normalizeClass as l, openBlock as u, provide as d, ref as f, renderList as p, renderSlot as m, unref as h, useId as g } from "vue";
5
+ //#region src/components/BingRadioGroup/BingRadioGroup.vue?vue&type=script&setup=true&lang.ts
6
+ var _ = [
7
+ "id",
8
+ "aria-label",
9
+ "aria-labelledby",
10
+ "aria-describedby",
11
+ "aria-invalid"
12
+ ], v = /* @__PURE__ */ c({
13
+ __name: "BingRadioGroup",
14
+ props: {
15
+ id: { default: void 0 },
16
+ modelValue: {
17
+ type: [
18
+ String,
19
+ Number,
20
+ Boolean,
21
+ null
22
+ ],
23
+ default: null
24
+ },
25
+ options: { default: () => [] },
26
+ disabled: {
27
+ type: Boolean,
28
+ default: void 0
29
+ },
30
+ size: { default: void 0 },
31
+ direction: { default: "wrap" },
32
+ name: { default: void 0 },
33
+ ariaLabel: { default: void 0 },
34
+ ariaDescribedby: { default: void 0 },
35
+ status: { default: void 0 }
36
+ },
37
+ emits: [
38
+ "update:modelValue",
39
+ "change",
40
+ "focus",
41
+ "blur"
42
+ ],
43
+ setup(c, { emit: v }) {
44
+ let y = c, b = v, { formItem: x, resolvedId: S, resolvedSize: C, resolvedDisabled: w, resolvedStatus: T, resolvedAriaDescribedby: E, resolvedAriaLabelledby: D } = t(y, { group: !0 });
45
+ e();
46
+ let O = `bing-radio-group-${g()}`, k = f(null), A = f(!1), j = a(() => y.name ?? O), M = a(() => [
47
+ "bing-radio-group",
48
+ `bing-radio-group--${C.value}`,
49
+ `bing-radio-group--${y.direction}`,
50
+ `bing-radio-group--status-${T.value}`,
51
+ {
52
+ "is-disabled": w.value,
53
+ "is-invalid": T.value === "error"
54
+ }
55
+ ]);
56
+ function N(e) {
57
+ return w.value || !!e.disabled;
58
+ }
59
+ function P(e, t) {
60
+ w.value || (b("update:modelValue", e), b("change", e, t), x?.handleControlChange());
61
+ }
62
+ function F(e) {
63
+ A.value || (A.value = !0, b("focus", e));
64
+ }
65
+ function I(e) {
66
+ let t = k.value, n = e.relatedTarget;
67
+ t && n instanceof Node && t.contains(n) || (A.value = !1, b("blur", e), x?.handleControlBlur());
68
+ }
69
+ function L(e) {
70
+ I(e);
71
+ }
72
+ function R() {
73
+ return Array.from(k.value?.querySelectorAll("input[type=\"radio\"]:not(:disabled)") ?? []);
74
+ }
75
+ function z(e) {
76
+ let t = R();
77
+ if (t.length === 0) return;
78
+ let n = document.activeElement, r = t.findIndex((e) => e === n), i = t.findIndex((e) => e.checked), a = t[((r >= 0 ? r : i >= 0 ? i : 0) + e + t.length) % t.length];
79
+ a?.focus(), a?.click();
80
+ }
81
+ function B(e) {
82
+ [
83
+ "ArrowRight",
84
+ "ArrowDown",
85
+ "ArrowLeft",
86
+ "ArrowUp"
87
+ ].includes(e.key) && (e.preventDefault(), z(e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : -1));
88
+ }
89
+ return d(n, {
90
+ modelValue: a(() => y.modelValue ?? null),
91
+ disabled: w,
92
+ size: C,
93
+ name: j,
94
+ status: T,
95
+ updateValue: P,
96
+ handleRadioBlur: L,
97
+ isOptionDisabled: N
98
+ }), (e, t) => (u(), s("div", {
99
+ id: h(S),
100
+ ref_key: "rootRef",
101
+ ref: k,
102
+ class: l(M.value),
103
+ role: "radiogroup",
104
+ "aria-label": c.ariaLabel || void 0,
105
+ "aria-labelledby": c.ariaLabel ? void 0 : h(D),
106
+ "aria-describedby": h(E),
107
+ "aria-invalid": h(T) === "error" || void 0,
108
+ onFocusin: F,
109
+ onKeydown: B
110
+ }, [m(e.$slots, "default", {}, () => [(u(!0), s(i, null, p(c.options, (e) => (u(), o(r, {
111
+ key: String(e.value),
112
+ value: e.value,
113
+ label: e.label,
114
+ description: e.description,
115
+ disabled: N(e)
116
+ }, null, 8, [
117
+ "value",
118
+ "label",
119
+ "description",
120
+ "disabled"
121
+ ]))), 128))], !0)], 42, _));
122
+ }
123
+ });
124
+ //#endregion
125
+ export { v as default };
@@ -0,0 +1,7 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./BingResizable.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/BingResizable/BingResizable.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-c551ac19"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -29,8 +29,8 @@ declare const __VLS_base: import('vue').DefineComponent<BingResizableProps, Bing
29
29
  position: Partial<BingResizablePosition>;
30
30
  size: BingResizableSize;
31
31
  ariaLabel: string;
32
- step: import('./BingResizable.types').BingResizableStep;
33
32
  mode: import('./BingResizable.types').BingResizableMode;
33
+ step: import('./BingResizable.types').BingResizableStep;
34
34
  defaultSize: BingResizableSize;
35
35
  defaultPosition: Partial<BingResizablePosition>;
36
36
  snapMode: import('./BingResizable.types').BingResizableSnapMode;
@@ -0,0 +1,555 @@
1
+ import { useReducedMotion as e } from "../../motion/reducedMotion.js";
2
+ import { ArrowDownLeft as t, ArrowDownRight as n, ArrowLeftRight as r, ArrowUpDown as i, ArrowUpLeft as a, ArrowUpRight as o } from "../../icons/icons.js";
3
+ import s from "../BingIcon/BingIcon.js";
4
+ import { Fragment as c, computed as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as ee, defineComponent as p, normalizeClass as te, normalizeStyle as ne, onBeforeUnmount as re, openBlock as m, ref as h, renderList as ie, renderSlot as ae, toDisplayString as oe } from "vue";
5
+ import { gsap as g } from "gsap";
6
+ //#region src/components/BingResizable/BingResizable.vue?vue&type=script&setup=true&lang.ts
7
+ var se = ["aria-label"], ce = { class: "bing-resizable__content" }, le = {
8
+ key: 0,
9
+ class: "bing-resizable__size",
10
+ "aria-hidden": "true"
11
+ }, ue = [
12
+ "aria-label",
13
+ "disabled",
14
+ "onPointerdown",
15
+ "onKeydown"
16
+ ], de = {
17
+ class: "bing-resizable__handle-mark",
18
+ "aria-hidden": "true"
19
+ }, fe = /* @__PURE__ */ p({
20
+ __name: "BingResizable",
21
+ props: {
22
+ size: { default: void 0 },
23
+ defaultSize: { default: () => ({
24
+ width: 320,
25
+ height: 220
26
+ }) },
27
+ position: { default: void 0 },
28
+ defaultPosition: { default: () => ({
29
+ x: 0,
30
+ y: 0
31
+ }) },
32
+ minWidth: { default: 80 },
33
+ minHeight: { default: 80 },
34
+ maxWidth: { default: void 0 },
35
+ maxHeight: { default: void 0 },
36
+ mode: { default: "fixed" },
37
+ snapMode: { default: "live" },
38
+ directions: { default: () => [
39
+ "right",
40
+ "bottom",
41
+ "bottom-right"
42
+ ] },
43
+ step: { default: 1 },
44
+ disabled: {
45
+ type: Boolean,
46
+ default: !1
47
+ },
48
+ lockAspectRatio: {
49
+ type: Boolean,
50
+ default: !1
51
+ },
52
+ contain: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ showSize: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ handleSize: { default: 12 },
61
+ ariaLabel: { default: void 0 }
62
+ },
63
+ emits: [
64
+ "update:size",
65
+ "update:position",
66
+ "resize-start",
67
+ "resize",
68
+ "resize-end"
69
+ ],
70
+ setup(p, { expose: fe, emit: pe }) {
71
+ let me = e(), he = [
72
+ "top",
73
+ "right",
74
+ "bottom",
75
+ "left",
76
+ "top-left",
77
+ "top-right",
78
+ "bottom-left",
79
+ "bottom-right"
80
+ ], ge = {
81
+ top: i,
82
+ right: r,
83
+ bottom: i,
84
+ left: r,
85
+ "top-left": a,
86
+ "top-right": o,
87
+ "bottom-left": t,
88
+ "bottom-right": n
89
+ }, _ = p, v = pe, y = h(null), b = h(null), x = h(null), _e = h(H(_.defaultSize)), S = h(H(_.defaultSize)), C = h(U(_.defaultPosition)), w = h(U(_.defaultPosition)), T = h(!1), E = h(!1), D = h(!1), O = h(null), k, A = {
90
+ x: 0,
91
+ y: 0
92
+ }, j = "", M = "", N = "", P = "", F = !1, ve = l(() => [
93
+ "bing-resizable",
94
+ `bing-resizable--${_.mode}`,
95
+ {
96
+ "is-disabled": _.disabled,
97
+ "is-resizing": D.value,
98
+ "is-contain": _.contain,
99
+ "is-ratio-locked": _.lockAspectRatio
100
+ }
101
+ ]), I = l(() => D.value ? S.value : _.size ? _.size : T.value ? _e.value : _.defaultSize), L = l(() => D.value ? w.value : _.position ? U(_.position) : E.value ? C.value : U(_.defaultPosition)), R = l(() => H(I.value)), ye = l(() => {
102
+ let e = L.value;
103
+ return {
104
+ width: B(I.value.width),
105
+ height: B(I.value.height),
106
+ minWidth: B(_.minWidth),
107
+ minHeight: B(_.minHeight),
108
+ maxWidth: B(_.maxWidth),
109
+ maxHeight: B(_.maxHeight),
110
+ left: `${e.x}px`,
111
+ top: `${e.y}px`,
112
+ "--bing-resizable-handle-size": `${Math.max(6, _.handleSize)}px`
113
+ };
114
+ }), be = l(() => _.directions.filter((e) => he.includes(e))), xe = l(() => {
115
+ let e = D.value ? S.value : R.value;
116
+ return `${Math.round(e.width)} × ${Math.round(e.height)}`;
117
+ });
118
+ function z() {
119
+ return typeof window < "u" && typeof document < "u";
120
+ }
121
+ function B(e) {
122
+ return typeof e == "number" ? `${e}px` : e;
123
+ }
124
+ function V(e, t) {
125
+ if (typeof e == "number" && Number.isFinite(e)) return e;
126
+ if (typeof e == "string") {
127
+ let t = Number.parseFloat(e);
128
+ if (Number.isFinite(t)) return t;
129
+ }
130
+ return t;
131
+ }
132
+ function H(e) {
133
+ return {
134
+ width: Math.max(0, V(e?.width, 320)),
135
+ height: Math.max(0, V(e?.height, 220))
136
+ };
137
+ }
138
+ function U(e) {
139
+ return {
140
+ x: V(e?.x, 0),
141
+ y: V(e?.y, 0)
142
+ };
143
+ }
144
+ function W(e) {
145
+ return Math.round(e * 1e3) / 1e3;
146
+ }
147
+ function G(e, t, n) {
148
+ return Math.min(n, Math.max(t, e));
149
+ }
150
+ function K(e, t) {
151
+ return !Number.isFinite(t) || t <= 1 ? e : Math.round(e / t) * t;
152
+ }
153
+ function Se(e, t) {
154
+ return Math.abs(e.width - t.width) < .001 && Math.abs(e.height - t.height) < .001;
155
+ }
156
+ function Ce(e, t) {
157
+ return Math.abs(e.x - t.x) < .001 && Math.abs(e.y - t.y) < .001;
158
+ }
159
+ function we() {
160
+ if (typeof _.step == "number") {
161
+ let e = Math.max(1, _.step);
162
+ return {
163
+ x: e,
164
+ y: e
165
+ };
166
+ }
167
+ return {
168
+ x: Math.max(1, _.step.x ?? 1),
169
+ y: Math.max(1, _.step.y ?? 1)
170
+ };
171
+ }
172
+ function q(e) {
173
+ return {
174
+ top: e.includes("top"),
175
+ right: e.includes("right"),
176
+ bottom: e.includes("bottom"),
177
+ left: e.includes("left")
178
+ };
179
+ }
180
+ function Te(e) {
181
+ return e === "top" || e === "bottom" ? "ns-resize" : e === "left" || e === "right" ? "ew-resize" : e === "top-left" || e === "bottom-right" ? "nwse-resize" : "nesw-resize";
182
+ }
183
+ function Ee(e) {
184
+ return [
185
+ "ew-resize",
186
+ "ns-resize",
187
+ "nwse-resize",
188
+ "nesw-resize"
189
+ ].includes(e);
190
+ }
191
+ function J(e) {
192
+ let t = q(e);
193
+ return `${t.left ? "100%" : t.right ? "0%" : "50%"} ${t.top ? "100%" : t.bottom ? "0%" : "50%"}`;
194
+ }
195
+ function De(e) {
196
+ return `调整${{
197
+ top: "上边",
198
+ right: "右边",
199
+ bottom: "下边",
200
+ left: "左边",
201
+ "top-left": "左上角",
202
+ "top-right": "右上角",
203
+ "bottom-left": "左下角",
204
+ "bottom-right": "右下角"
205
+ }[e]}尺寸`;
206
+ }
207
+ function Oe() {
208
+ let e = y.value?.getBoundingClientRect();
209
+ return {
210
+ width: e?.width ? e.width : V(I.value.width, R.value.width),
211
+ height: e?.height ? e.height : V(I.value.height, R.value.height)
212
+ };
213
+ }
214
+ function ke() {
215
+ if (!_.contain) return null;
216
+ let e = y.value?.parentElement, t = e?.getBoundingClientRect();
217
+ if (!e || !t?.width || !t?.height) return null;
218
+ let n = window.getComputedStyle(e), r = V(n.paddingLeft, 0) + V(n.paddingRight, 0) + V(n.borderLeftWidth, 0) + V(n.borderRightWidth, 0), i = V(n.paddingTop, 0) + V(n.paddingBottom, 0) + V(n.borderTopWidth, 0) + V(n.borderBottomWidth, 0);
219
+ return {
220
+ width: Math.max(0, t.width - r),
221
+ height: Math.max(0, t.height - i)
222
+ };
223
+ }
224
+ function Ae() {
225
+ return {
226
+ minWidth: Math.max(0, V(_.minWidth, 0)),
227
+ minHeight: Math.max(0, V(_.minHeight, 0)),
228
+ maxWidth: Math.max(0, V(_.maxWidth, Infinity)),
229
+ maxHeight: Math.max(0, V(_.maxHeight, Infinity))
230
+ };
231
+ }
232
+ function je(e, t, n) {
233
+ let r = Ae();
234
+ if (_.lockAspectRatio && n && n.aspectRatio > 0) {
235
+ let i = n.aspectRatio, a = G(Ne(e, t, n.direction, n) === "width" ? e : t * i, Math.max(r.minWidth, r.minHeight * i), Math.min(r.maxWidth, r.maxHeight * i));
236
+ return {
237
+ width: a,
238
+ height: a / i
239
+ };
240
+ }
241
+ return {
242
+ width: G(e, r.minWidth, r.maxWidth),
243
+ height: G(t, r.minHeight, r.maxHeight)
244
+ };
245
+ }
246
+ function Me(e, t, n, r) {
247
+ if (!_.lockAspectRatio || r.aspectRatio <= 0) return {
248
+ width: e,
249
+ height: t
250
+ };
251
+ let i = q(n), a = r.aspectRatio;
252
+ return (i.left || i.right) && !(i.top || i.bottom) ? {
253
+ width: e,
254
+ height: e / a
255
+ } : (i.top || i.bottom) && !(i.left || i.right) ? {
256
+ width: t * a,
257
+ height: t
258
+ } : Math.abs(e - r.startSize.width) >= Math.abs(t - r.startSize.height) ? {
259
+ width: e,
260
+ height: e / a
261
+ } : {
262
+ width: t * a,
263
+ height: t
264
+ };
265
+ }
266
+ function Ne(e, t, n, r) {
267
+ let i = q(n);
268
+ return (i.left || i.right) && !(i.top || i.bottom) ? "width" : (i.top || i.bottom) && !(i.left || i.right) ? "height" : Math.abs(e - r.startSize.width) >= Math.abs(t - r.startSize.height) ? "width" : "height";
269
+ }
270
+ function Pe(e, t, n, r) {
271
+ let i = we();
272
+ if (_.lockAspectRatio && r.aspectRatio > 0) {
273
+ if (Ne(e, t, n, r) === "width") {
274
+ let t = K(e, i.x);
275
+ return {
276
+ width: t,
277
+ height: t / r.aspectRatio
278
+ };
279
+ }
280
+ let a = K(t, i.y);
281
+ return {
282
+ width: a * r.aspectRatio,
283
+ height: a
284
+ };
285
+ }
286
+ return {
287
+ width: K(e, i.x),
288
+ height: K(t, i.y)
289
+ };
290
+ }
291
+ function Fe(e, t) {
292
+ let n = q(t.direction);
293
+ if (t.mode === "mirror") {
294
+ let n = Math.abs(e.width - t.startSize.width) > .001, r = Math.abs(e.height - t.startSize.height) > .001;
295
+ return {
296
+ x: n ? t.startPosition.x + (t.startSize.width - e.width) / 2 : t.startPosition.x,
297
+ y: r ? t.startPosition.y + (t.startSize.height - e.height) / 2 : t.startPosition.y
298
+ };
299
+ }
300
+ return {
301
+ x: n.left ? t.startPosition.x + t.startSize.width - e.width : t.startPosition.x,
302
+ y: n.top ? t.startPosition.y + t.startSize.height - e.height : t.startPosition.y
303
+ };
304
+ }
305
+ function Ie(e, t, n) {
306
+ if (!n.parentSize) return {
307
+ size: e,
308
+ position: t
309
+ };
310
+ let r = e.width, i = e.height, a = t.x, o = t.y;
311
+ return a < 0 && (r += a, a = 0), o < 0 && (i += o, o = 0), a + r > n.parentSize.width && (r = n.parentSize.width - a), o + i > n.parentSize.height && (i = n.parentSize.height - o), {
312
+ size: je(r, i),
313
+ position: {
314
+ x: a,
315
+ y: o
316
+ }
317
+ };
318
+ }
319
+ function Y(e, t, n, r = e.snapMode === "live") {
320
+ let i = q(e.direction), a = e.mode === "mirror" ? 2 : 1, o = e.startSize.width + ((i.right ? t : 0) - (i.left ? t : 0)) * a, s = e.startSize.height + ((i.bottom ? n : 0) - (i.top ? n : 0)) * a, c = Me(o, s, e.direction, e);
321
+ if (o = c.width, s = c.height, r) {
322
+ let t = Pe(o, s, e.direction, e);
323
+ o = t.width, s = t.height;
324
+ }
325
+ let l = je(o, s, e), u = Fe(l, e), d = Ie(l, u, e);
326
+ return l = d.size, u = d.position, {
327
+ size: {
328
+ width: W(l.width),
329
+ height: W(l.height)
330
+ },
331
+ position: {
332
+ x: W(u.x),
333
+ y: W(u.y)
334
+ }
335
+ };
336
+ }
337
+ function Le(e, t, n) {
338
+ let r = Oe();
339
+ return {
340
+ direction: e,
341
+ startClientX: t,
342
+ startClientY: n,
343
+ startSize: r,
344
+ startPosition: L.value,
345
+ aspectRatio: r.height > 0 ? r.width / r.height : 1,
346
+ mode: _.mode,
347
+ snapMode: _.snapMode,
348
+ parentSize: ke()
349
+ };
350
+ }
351
+ function X(e, t, n) {
352
+ return {
353
+ direction: e,
354
+ size: S.value,
355
+ position: w.value,
356
+ delta: t,
357
+ event: n
358
+ };
359
+ }
360
+ function Z() {
361
+ _.size || (_e.value = S.value, T.value = !0), _.position || (C.value = w.value, E.value = !0), v("update:size", S.value), v("update:position", w.value);
362
+ }
363
+ function Re(e) {
364
+ if (!z() || F) return;
365
+ let t = Te(e);
366
+ j = Ee(document.documentElement.style.cursor) ? "" : document.documentElement.style.cursor, M = Ee(document.body?.style.cursor ?? "") ? "" : document.body?.style.cursor ?? "", N = document.documentElement.style.userSelect, P = document.body?.style.userSelect ?? "", document.documentElement.style.cursor = t, document.body.style.cursor = t, document.documentElement.style.userSelect = "none", document.body.style.userSelect = "none", F = !0;
367
+ }
368
+ function ze() {
369
+ !z() || !F || (document.documentElement.style.cursor = j, document.body.style.cursor = M, document.documentElement.style.userSelect = N, document.body.style.userSelect = P, j = "", M = "", N = "", P = "", F = !1);
370
+ }
371
+ function Be() {
372
+ if (z()) {
373
+ window.addEventListener("pointermove", Ge), window.addEventListener("pointerup", Q), window.addEventListener("pointercancel", Q), window.addEventListener("pointerout", qe), window.addEventListener("blur", $), window.addEventListener("keydown", Ye), document.addEventListener("visibilitychange", Je);
374
+ try {
375
+ window.parent && window.parent !== window && (window.parent.addEventListener("pointerup", Q), window.parent.addEventListener("pointercancel", Q), window.parent.addEventListener("blur", $));
376
+ } catch {}
377
+ }
378
+ }
379
+ function Ve() {
380
+ if (z()) {
381
+ window.removeEventListener("pointermove", Ge), window.removeEventListener("pointerup", Q), window.removeEventListener("pointercancel", Q), window.removeEventListener("pointerout", qe), window.removeEventListener("blur", $), window.removeEventListener("keydown", Ye), document.removeEventListener("visibilitychange", Je);
382
+ try {
383
+ window.parent && window.parent !== window && (window.parent.removeEventListener("pointerup", Q), window.parent.removeEventListener("pointercancel", Q), window.parent.removeEventListener("blur", $));
384
+ } catch {}
385
+ }
386
+ }
387
+ function He(e) {
388
+ me() || (b.value && g.to(b.value, {
389
+ scale: 1.006,
390
+ transformOrigin: J(e),
391
+ duration: .16,
392
+ ease: "power2.out",
393
+ overwrite: !0,
394
+ force3D: !0
395
+ }), x.value && g.fromTo(x.value, {
396
+ autoAlpha: 0,
397
+ scale: .985
398
+ }, {
399
+ autoAlpha: 1,
400
+ scale: 1,
401
+ transformOrigin: J(e),
402
+ duration: .18,
403
+ ease: "power2.out",
404
+ overwrite: !0,
405
+ force3D: !0
406
+ }));
407
+ }
408
+ function Ue(e) {
409
+ me() || (b.value && g.to(b.value, {
410
+ scale: 1,
411
+ transformOrigin: J(e),
412
+ duration: .42,
413
+ ease: "elastic.out(1, 0.78)",
414
+ overwrite: !0,
415
+ force3D: !0
416
+ }), x.value && g.to(x.value, {
417
+ autoAlpha: 0,
418
+ scale: 1.018,
419
+ transformOrigin: J(e),
420
+ duration: .28,
421
+ ease: "power3.out",
422
+ overwrite: !0,
423
+ force3D: !0
424
+ }));
425
+ }
426
+ function We(e, t) {
427
+ if (!(_.disabled || t.button !== 0)) {
428
+ t.preventDefault(), k = Le(e, t.clientX, t.clientY), A = {
429
+ x: 0,
430
+ y: 0
431
+ }, S.value = k.startSize, w.value = k.startPosition, O.value = e, D.value = !0, Re(e), Be(), He(e);
432
+ try {
433
+ t.currentTarget?.setPointerCapture?.(t.pointerId);
434
+ } catch {}
435
+ v("resize-start", X(e, A, t));
436
+ }
437
+ }
438
+ function Ge(e) {
439
+ if (!k) return;
440
+ e.preventDefault(), A = {
441
+ x: e.clientX - k.startClientX,
442
+ y: e.clientY - k.startClientY
443
+ };
444
+ let t = Y(k, A.x, A.y);
445
+ Se(t.size, S.value) && Ce(t.position, w.value) || (S.value = t.size, w.value = t.position, Z(), v("resize", X(k.direction, A, e)));
446
+ }
447
+ function Ke(e, t = !0) {
448
+ let n = k;
449
+ if (Ve(), ze(), !n) return;
450
+ let r = n.direction;
451
+ if (n.snapMode === "end") {
452
+ let e = Y(n, A.x, A.y, !0);
453
+ S.value = e.size, w.value = e.position;
454
+ }
455
+ Z(), e && t && v("resize-end", X(r, A, e)), Ue(r), k = void 0, O.value = null, D.value = !1;
456
+ }
457
+ function Q(e) {
458
+ Ke(e);
459
+ }
460
+ function $() {
461
+ Ke(void 0, !1);
462
+ }
463
+ function qe(e) {
464
+ e.relatedTarget || (e.clientX <= 0 || e.clientY <= 0 || e.clientX >= window.innerWidth || e.clientY >= window.innerHeight) && $();
465
+ }
466
+ function Je() {
467
+ document.visibilityState === "hidden" && $();
468
+ }
469
+ function Ye(e) {
470
+ e.key === "Escape" && Ke(e);
471
+ }
472
+ function Xe(e, t) {
473
+ let n = q(e), r = we(), i = t.shiftKey ? 4 : 1, a = r.x * i, o = r.y * i;
474
+ return t.key === "ArrowLeft" && (n.left || n.right) ? {
475
+ x: -a,
476
+ y: 0
477
+ } : t.key === "ArrowRight" && (n.left || n.right) ? {
478
+ x: a,
479
+ y: 0
480
+ } : t.key === "ArrowUp" && (n.top || n.bottom) ? {
481
+ x: 0,
482
+ y: -o
483
+ } : t.key === "ArrowDown" && (n.top || n.bottom) ? {
484
+ x: 0,
485
+ y: o
486
+ } : null;
487
+ }
488
+ function Ze(e, t) {
489
+ if (_.disabled) return;
490
+ let n = Xe(e, t);
491
+ if (!n) return;
492
+ t.preventDefault();
493
+ let r = Y(Le(e, 0, 0), n.x, n.y, !0);
494
+ S.value = r.size, w.value = r.position, O.value = e, D.value = !0, v("resize-start", X(e, {
495
+ x: 0,
496
+ y: 0
497
+ }, t)), Z(), v("resize", X(e, n, t)), v("resize-end", X(e, n, t)), He(e), Ue(e), O.value = null, D.value = !1;
498
+ }
499
+ function Qe() {
500
+ S.value = H(_.defaultSize), w.value = U(_.defaultPosition), _e.value = S.value, C.value = w.value, T.value = !0, E.value = !0, v("update:size", S.value), v("update:position", w.value);
501
+ }
502
+ function $e() {
503
+ return D.value ? S.value : H(I.value);
504
+ }
505
+ function et() {
506
+ return L.value;
507
+ }
508
+ return re(() => {
509
+ Ve(), ze(), g.killTweensOf([b.value, x.value].filter(Boolean));
510
+ }), fe({
511
+ reset: Qe,
512
+ getSize: $e,
513
+ getPosition: et
514
+ }), (e, t) => (m(), d("div", {
515
+ ref_key: "rootRef",
516
+ ref: y,
517
+ class: te(ve.value),
518
+ style: ne(ye.value),
519
+ role: "group",
520
+ "aria-label": p.ariaLabel
521
+ }, [f("div", {
522
+ ref_key: "surfaceRef",
523
+ ref: b,
524
+ class: "bing-resizable__surface"
525
+ }, [
526
+ f("div", ce, [ae(e.$slots, "default", {}, void 0, !0)]),
527
+ f("span", {
528
+ ref_key: "feedbackRef",
529
+ ref: x,
530
+ class: "bing-resizable__feedback",
531
+ "aria-hidden": "true"
532
+ }, null, 512),
533
+ p.showSize ? (m(), d("output", le, oe(xe.value), 1)) : u("", !0),
534
+ (m(!0), d(c, null, ie(be.value, (n) => (m(), d("button", {
535
+ key: n,
536
+ type: "button",
537
+ class: te(["bing-resizable__handle", [`bing-resizable__handle--${n}`, { "is-active": O.value === n }]]),
538
+ "aria-label": De(n),
539
+ disabled: p.disabled,
540
+ onPointerdown: (e) => We(n, e),
541
+ onKeydown: (e) => Ze(n, e)
542
+ }, [ae(e.$slots, "handle", {
543
+ direction: n,
544
+ active: O.value === n
545
+ }, () => [f("span", de, [t[0] ||= f("span", { class: "bing-resizable__handle-line" }, null, -1), ee(s, {
546
+ class: "bing-resizable__handle-icon",
547
+ icon: ge[n],
548
+ size: n.includes("-") ? 13 : 14,
549
+ "stroke-width": 1.75
550
+ }, null, 8, ["icon", "size"])])], !0)], 42, ue))), 128))
551
+ ], 512)], 14, se));
552
+ }
553
+ });
554
+ //#endregion
555
+ export { fe as default };
@@ -0,0 +1,7 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./BingScrollbar.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/BingScrollbar/BingScrollbar.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-72049e96"]]);
6
+ //#endregion
7
+ export { n as default };