@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,300 @@
1
+ import { useConfigSize as e } from "../../utils/config.js";
2
+ import { bingFormContextKey as t, cloneErrors as n } from "./BingForm.context.js";
3
+ import { isInActiveOverlayScope as r } from "../../utils/overlay.js";
4
+ import { useFormNextHint as i } from "./useFormNextHint.js";
5
+ import { computed as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, defineComponent as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as ee, onMounted as te, openBlock as p, provide as m, reactive as ne, ref as h, renderSlot as re, toDisplayString as g, toRaw as _, unref as v, watch as y, withModifiers as ie } from "vue";
6
+ //#region src/components/BingForm/BingForm.vue?vue&type=script&setup=true&lang.ts
7
+ var ae = { class: "bing-form__layout" }, oe = ["data-target", "data-offscreen"], se = { class: "bing-form__next-hint-text" }, b = /* @__PURE__ */ l({
8
+ __name: "BingForm",
9
+ props: {
10
+ model: { default: void 0 },
11
+ schema: { default: void 0 },
12
+ layout: { default: "grid" },
13
+ columns: { default: () => ({
14
+ base: 1,
15
+ sm: 2,
16
+ xl: 5
17
+ }) },
18
+ gap: { default: () => ({
19
+ row: 12,
20
+ column: 16
21
+ }) },
22
+ labelPosition: { default: "top" },
23
+ labelWidth: { default: 112 },
24
+ size: {},
25
+ disabled: {
26
+ type: Boolean,
27
+ default: !1
28
+ },
29
+ validateTrigger: { default: "auto" },
30
+ scrollToError: {
31
+ type: Boolean,
32
+ default: !0
33
+ },
34
+ focusOnError: {
35
+ type: Boolean,
36
+ default: !0
37
+ },
38
+ nextStepHint: {
39
+ type: Boolean,
40
+ default: !1
41
+ }
42
+ },
43
+ emits: ["submit", "invalid"],
44
+ setup(l, { expose: b, emit: ce }) {
45
+ let x = l, S = ce, C = e(() => x.size), w = h(null), T = h(null), { context: le, hint: E, style: ue } = i(w, T, () => x.nextStepHint && !x.disabled), D = ne({}), O = /* @__PURE__ */ new Set(), k, A = 0, j = 0, M = !1, N = 0, P = 0, F = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Map(), L = 0;
46
+ y(() => [x.model, x.schema], () => {
47
+ j += 1;
48
+ }, {
49
+ deep: !0,
50
+ flush: "sync"
51
+ });
52
+ let R = a(() => Array.isArray(x.validateTrigger) ? x.validateTrigger : [x.validateTrigger]), z = a(() => fe(x.columns, {
53
+ base: 1,
54
+ sm: 2,
55
+ xl: 5
56
+ })), B = a(() => U(x.labelWidth)), V = a(() => [
57
+ "bing-form",
58
+ `bing-form--${x.layout}`,
59
+ `bing-form--label-${x.labelPosition}`,
60
+ `bing-form--${C.value}`,
61
+ { "is-disabled": x.disabled }
62
+ ]), H = a(() => {
63
+ let e = z.value, t = de(x.gap);
64
+ return {
65
+ "--bing-form-columns-base": String(e.base),
66
+ "--bing-form-columns-sm": String(e.sm),
67
+ "--bing-form-columns-md": String(e.md),
68
+ "--bing-form-columns-lg": String(e.lg),
69
+ "--bing-form-columns-xl": String(e.xl),
70
+ "--bing-form-row-gap": t.row,
71
+ "--bing-form-column-gap": t.column,
72
+ "--bing-form-label-width": B.value
73
+ };
74
+ });
75
+ function U(e) {
76
+ return typeof e == "number" ? `${e}px` : e;
77
+ }
78
+ function de(e) {
79
+ if (typeof e == "string" || typeof e == "number") {
80
+ let t = U(e);
81
+ return {
82
+ row: t,
83
+ column: t
84
+ };
85
+ }
86
+ return {
87
+ row: U(e.row ?? 12),
88
+ column: U(e.column ?? 16)
89
+ };
90
+ }
91
+ function fe(e, t) {
92
+ let n = [
93
+ "base",
94
+ "sm",
95
+ "md",
96
+ "lg",
97
+ "xl"
98
+ ], r = {
99
+ base: t.base ?? 1,
100
+ sm: t.sm ?? t.base ?? 1,
101
+ md: t.md ?? t.sm ?? t.base ?? 1,
102
+ lg: t.lg ?? t.md ?? t.sm ?? t.base ?? 1,
103
+ xl: t.xl ?? t.lg ?? t.md ?? t.sm ?? t.base ?? 1
104
+ };
105
+ if (typeof e == "number") return n.forEach((t) => {
106
+ r[t] = Math.max(1, Math.floor(e));
107
+ }), r;
108
+ let i = r.base;
109
+ return n.forEach((t) => {
110
+ let n = e[t];
111
+ typeof n == "number" && (i = Math.max(1, Math.floor(n))), r[t] = i;
112
+ }), r;
113
+ }
114
+ function W(e) {
115
+ let t = _(e);
116
+ if (typeof structuredClone == "function") try {
117
+ return structuredClone(t);
118
+ } catch {
119
+ return JSON.parse(JSON.stringify(t));
120
+ }
121
+ return JSON.parse(JSON.stringify(t));
122
+ }
123
+ function pe(e, t) {
124
+ Object.keys(e).forEach((n) => {
125
+ n in t || delete e[n];
126
+ }), Object.entries(W(t)).forEach(([t, n]) => {
127
+ e[t] = n;
128
+ });
129
+ }
130
+ function me(e) {
131
+ return e.length > 0 ? e.map(String).join(".") : "_form";
132
+ }
133
+ function he(e) {
134
+ let t = {};
135
+ return e.forEach((e) => {
136
+ let n = me(e.path);
137
+ t[n] ??= [], t[n].push(e.message);
138
+ }), t;
139
+ }
140
+ function G(e, t) {
141
+ return e === t || e.startsWith(`${t}.`) || t.startsWith(`${e}.`);
142
+ }
143
+ function ge(e) {
144
+ Object.keys(D).forEach((e) => {
145
+ delete D[e];
146
+ }), Object.entries(e).forEach(([e, t]) => {
147
+ D[e] = [...t];
148
+ });
149
+ }
150
+ function _e(e, t) {
151
+ Object.keys(D).forEach((t) => {
152
+ G(t, e) && delete D[t];
153
+ }), Object.entries(t).forEach(([t, n]) => {
154
+ G(t, e) && (D[t] = [...n]);
155
+ });
156
+ }
157
+ async function K(e) {
158
+ let t = {
159
+ id: ++A,
160
+ prop: e,
161
+ cancelled: !1
162
+ };
163
+ for (let t of F) t.prop === e && (t.cancelled = !0);
164
+ F.add(t), e ? I.set(e, t.id) : L = t.id;
165
+ try {
166
+ for (; !M && !t.cancelled;) {
167
+ let n = j, r = x.schema, i = r ? await r.safeParseAsync(W(x.model ?? {})) : void 0;
168
+ if (M || t.cancelled) return !1;
169
+ if (n !== j) continue;
170
+ let a = i && !i.success ? he(i.error.issues) : {}, o = Object.entries(a).filter(([t]) => !e || G(t, e)).length === 0;
171
+ if (e) t.id >= L && _e(e, a);
172
+ else {
173
+ let e = new Set([...Object.keys(D), ...Object.keys(a)]);
174
+ for (let n of e) [...I].some(([e, r]) => r > t.id && G(n, e)) || (a[n] ? D[n] = [...a[n]] : delete D[n]);
175
+ }
176
+ return o;
177
+ }
178
+ return !1;
179
+ } finally {
180
+ F.delete(t);
181
+ }
182
+ }
183
+ function q(e, t) {
184
+ return !e || e === "manual" || R.value.includes(e) ? !0 : R.value.includes("auto") ? e === "blur" || e === "submit" || e === "change" && !!(t && J(t).length) : !1;
185
+ }
186
+ function J(e) {
187
+ return Object.entries(D).filter(([t]) => G(t, e)).flatMap(([, e]) => e);
188
+ }
189
+ function Y() {
190
+ return n(D);
191
+ }
192
+ function X(e) {
193
+ N += 1;
194
+ for (let t of F) (!e || !t.prop || G(t.prop, e)) && (t.cancelled = !0);
195
+ if (e ? I.set(e, ++A) : (I.clear(), L = ++A), !e) {
196
+ ge({});
197
+ return;
198
+ }
199
+ Object.keys(D).forEach((t) => {
200
+ G(t, e) && delete D[t];
201
+ });
202
+ }
203
+ function ve(e) {
204
+ O.add(e);
205
+ }
206
+ function ye(e) {
207
+ O.delete(e);
208
+ }
209
+ function be() {
210
+ return [...O].filter((e) => J(e.prop).length > 0).sort((e, t) => {
211
+ let n = e.element(), r = t.element();
212
+ if (!n || !r) return 0;
213
+ let i = n.compareDocumentPosition(r);
214
+ return i & 4 ? -1 : i & 2 ? 1 : 0;
215
+ });
216
+ }
217
+ function Z(e = !1) {
218
+ let t = w.value;
219
+ if (!(!t || !r(t))) for (let t of be()) {
220
+ let n = t.target();
221
+ if (n) {
222
+ e && n.focus({ preventScroll: !0 }), x.scrollToError && t.scrollToField();
223
+ break;
224
+ }
225
+ }
226
+ }
227
+ async function xe() {
228
+ let e = A + 1, t = N, n = await K();
229
+ return !n && !M && L === e && t === N && (await u(), !M && L === e && t === N && Z()), n;
230
+ }
231
+ async function Q(e, t) {
232
+ return q(t, e) ? K(e) : J(e).length === 0;
233
+ }
234
+ function Se() {
235
+ x.model && k && pe(x.model, k), X();
236
+ }
237
+ async function Ce(e) {
238
+ if (x.disabled) return;
239
+ let t = ++N, n = w.value?.ownerDocument.activeElement, r = P, i = j, a = e, o = q("submit") ? await K() : !0;
240
+ if (M || x.disabled || t !== N) return;
241
+ let s = {
242
+ valid: o,
243
+ errors: Y(),
244
+ event: a
245
+ };
246
+ S("submit", s), o || (S("invalid", {
247
+ valid: o,
248
+ errors: s.errors
249
+ }), await u(), !M && !x.disabled && t === N && r === P && i === j && w.value?.ownerDocument.activeElement === n && Z(x.focusOnError));
250
+ }
251
+ function $() {
252
+ P += 1;
253
+ }
254
+ return te(() => {
255
+ k = x.model ? W(x.model) : void 0;
256
+ }), ee(() => {
257
+ M = !0, F.forEach((e) => {
258
+ e.cancelled = !0;
259
+ });
260
+ }), m(t, {
261
+ size: C,
262
+ disabled: a(() => x.disabled),
263
+ columns: z,
264
+ labelPosition: a(() => x.labelPosition),
265
+ labelWidth: B,
266
+ validateField: Q,
267
+ clearValidate: X,
268
+ getFieldErrors: J,
269
+ registerField: ve,
270
+ unregisterField: ye,
271
+ nextHint: le
272
+ }), b({
273
+ validate: xe,
274
+ validateField: (e) => Q(e),
275
+ clearValidate: X,
276
+ resetFields: Se,
277
+ getErrors: Y
278
+ }), (e, t) => (p(), s("form", {
279
+ ref_key: "rootRef",
280
+ ref: w,
281
+ class: d(V.value),
282
+ style: f(H.value),
283
+ novalidate: "",
284
+ onSubmit: ie(Ce, ["prevent"]),
285
+ onFocusinCapture: $,
286
+ onFocusoutCapture: $
287
+ }, [c("div", ae, [re(e.$slots, "default", {}, void 0, !0)]), v(E) ? (p(), s("span", {
288
+ key: 0,
289
+ ref_key: "nextHintRef",
290
+ ref: T,
291
+ class: "bing-form__next-hint",
292
+ style: f(v(ue)),
293
+ "data-target": v(E).target.id || void 0,
294
+ "data-offscreen": v(E).offscreen || void 0,
295
+ "aria-hidden": "true"
296
+ }, [c("span", se, g(v(E).text), 1), t[0] ||= c("kbd", null, "Tab", -1)], 12, oe)) : o("", !0)], 38));
297
+ }
298
+ });
299
+ //#endregion
300
+ export { b as default };
@@ -0,0 +1,13 @@
1
+ //#region src/components/BingForm/formFocus.ts
2
+ var e = "input:not([type=\"hidden\"]),textarea,select,button,[tabindex],[contenteditable=\"true\"]";
3
+ function t(e) {
4
+ return !!(e?.isConnected && !e.matches(":disabled,[aria-disabled=\"true\"]") && !e.closest("[inert],[hidden]") && e.getClientRects().length > 0 && !["hidden", "collapse"].includes(e.ownerDocument.defaultView.getComputedStyle(e).visibility));
5
+ }
6
+ function n(n) {
7
+ if (!n) return null;
8
+ if (n.matches(e) && t(n)) return n;
9
+ let r = Array.from(n.querySelectorAll(e)).filter(t);
10
+ return r.find((e) => e === n.ownerDocument.activeElement) ?? r.find((e) => e.matches("input[type=\"radio\"]:checked")) ?? r[0] ?? null;
11
+ }
12
+ //#endregion
13
+ export { n as findFormControlTarget };
@@ -0,0 +1,27 @@
1
+ //#region src/components/BingForm/formTabOrder.ts
2
+ var e = "input,textarea,select,button,a[href],area[href],summary,iframe,object,embed,audio[controls],video[controls],[tabindex],[contenteditable]", t = "iframe,object,embed,audio[controls],video[controls],select,input[type=\"file\"],input[type=\"color\"],input[type=\"date\"],input[type=\"time\"],input[type=\"month\"],input[type=\"week\"],input[type=\"datetime-local\"],[contenteditable]:not([contenteditable=\"false\"])";
3
+ function n(e) {
4
+ return !e.closest("[hidden],[inert]") && e.getClientRects().length > 0 && !["hidden", "collapse"].includes(e.ownerDocument.defaultView.getComputedStyle(e).visibility);
5
+ }
6
+ function r(e) {
7
+ return e.matches("input[type=\"radio\"]") && !!e.name;
8
+ }
9
+ function i(e, t) {
10
+ return e.name === t.name && e.form === t.form && e.getRootNode() === t.getRootNode();
11
+ }
12
+ function a(a, o) {
13
+ if (o.closest("form") !== a || o.shadowRoot || o.matches(t)) return null;
14
+ let s = Array.from(a.ownerDocument.body.querySelectorAll("*"));
15
+ if (s.some((e) => e.hasAttribute("tabindex") && e.tabIndex > 0)) return null;
16
+ let c = s.filter((r) => {
17
+ let i = r.shadowRoot || r.localName.includes("-") || r.matches(t);
18
+ return !i && !(r.matches(e) && r.tabIndex >= 0 && !r.matches(":disabled,input[type=\"hidden\"]")) ? !1 : n(r) || !!(i && !r.closest("[hidden],[inert]") && r.ownerDocument.defaultView.getComputedStyle(r).display === "contents");
19
+ }), l = c.filter((e) => {
20
+ if (!r(e)) return !0;
21
+ let t = c.filter((t) => r(t) && i(e, t));
22
+ return e === (t.find((e) => e === o) ?? t.find((e) => e.checked) ?? t[0]);
23
+ }), u = l.indexOf(o), d = u < 0 ? void 0 : l[u + 1];
24
+ return !d || d.closest("form") !== a || d.shadowRoot || d.localName.includes("-") || d.matches(t) ? null : d;
25
+ }
26
+ //#endregion
27
+ export { a as nextFormTabStop };
@@ -11,7 +11,7 @@ export declare function useFormControl<Size extends string | number>(props: {
11
11
  }): {
12
12
  formItem: import('./BingForm.context').BingFormItemContext | null;
13
13
  resolvedId: import('vue').ComputedRef<string>;
14
- resolvedSize: import('vue').ComputedRef<import('./BingForm.types').BingFormSize | Size>;
14
+ resolvedSize: import('vue').ComputedRef<"sm" | "md" | "lg" | Size>;
15
15
  resolvedDisabled: import('vue').ComputedRef<boolean>;
16
16
  resolvedStatus: import('vue').ComputedRef<BingControlStatus>;
17
17
  resolvedAriaDescribedby: import('vue').ComputedRef<string | undefined>;
@@ -0,0 +1,24 @@
1
+ import { useBingConfig as e } from "../../utils/config.js";
2
+ import { bingFormContextKey as t, bingFormItemContextKey as n } from "./BingForm.context.js";
3
+ import { computed as r, inject as i, onBeforeUnmount as a, provide as o, useId as s } from "vue";
4
+ //#region src/components/BingForm/useFormControl.ts
5
+ function c(o, c = {}) {
6
+ let l = i(n, null), u = i(t, null), d = e(), f = `bing-control-${s()}`, p = c.register === !1 ? void 0 : l?.nextControlId?.(f) ?? l?.controlId.value, m = r(() => o.id ?? p ?? f), h = r(() => o.size ?? l?.size.value ?? u?.size.value ?? d.size.value ?? "md"), g = r(() => o.disabled ?? l?.disabled.value ?? u?.disabled.value ?? !1), _ = r(() => o.status ?? l?.status.value ?? "default"), v = r(() => [...new Set([o.ariaDescribedby, l?.ariaDescribedby.value].filter(Boolean))].join(" ") || void 0), y = r(() => c.group ? l?.labelId?.value : void 0);
7
+ return c.register !== !1 && l?.registerControl && a(l.registerControl({
8
+ id: m,
9
+ group: c.group ?? !1
10
+ })), {
11
+ formItem: l,
12
+ resolvedId: m,
13
+ resolvedSize: h,
14
+ resolvedDisabled: g,
15
+ resolvedStatus: _,
16
+ resolvedAriaDescribedby: v,
17
+ resolvedAriaLabelledby: y
18
+ };
19
+ }
20
+ function l() {
21
+ o(n, null), o(t, null);
22
+ }
23
+ //#endregion
24
+ export { l as isolateFormControls, c as useFormControl };
@@ -0,0 +1,135 @@
1
+ import { isInActiveOverlayScope as e, onOverlayScopeChange as t } from "../../utils/overlay.js";
2
+ import { nextFormTabStop as n } from "./formTabOrder.js";
3
+ import { nextTick as r, onBeforeUnmount as i, onMounted as a, shallowRef as o, watch as s } from "vue";
4
+ //#region src/components/BingForm/useFormNextHint.ts
5
+ function c(c, l, u) {
6
+ let d = /* @__PURE__ */ new Set(), f = o(null), p = o({ visibility: "hidden" }), m, h = () => {}, g = !0;
7
+ function _(e) {
8
+ let t = e.ownerDocument, n = {
9
+ left: 0,
10
+ top: 0,
11
+ right: t.documentElement.clientWidth,
12
+ bottom: t.documentElement.clientHeight
13
+ };
14
+ for (let r = e.parentElement; r; r = r.parentElement) {
15
+ let e = t.defaultView.getComputedStyle(r), i = r.getBoundingClientRect();
16
+ /(auto|scroll|hidden|clip)/.test(e.overflowX) && (n.left = Math.max(n.left, i.left), n.right = Math.min(n.right, i.right)), /(auto|scroll|hidden|clip)/.test(e.overflowY) && (n.top = Math.max(n.top, i.top), n.bottom = Math.min(n.bottom, i.bottom));
17
+ }
18
+ return n;
19
+ }
20
+ function v(e) {
21
+ let t = e.getBoundingClientRect(), n = _(e);
22
+ return t.top >= n.top && t.bottom <= n.bottom && t.left >= n.left && t.right <= n.right;
23
+ }
24
+ function y(e) {
25
+ return [...d].find((t) => t.element() === e.closest(".bing-form-item"));
26
+ }
27
+ function b() {
28
+ let t = c.value, i = t?.ownerDocument.activeElement;
29
+ if (f.value = null, p.value = { visibility: "hidden" }, !u() || !g || !t || !i || !e(t)) return;
30
+ let a = y(i);
31
+ if (!a || i.closest("[aria-expanded=\"true\"]")) return;
32
+ let o = n(t, i);
33
+ if (!o || o.matches("[aria-disabled=\"true\"]")) return;
34
+ let s = (o instanceof HTMLButtonElement || o instanceof HTMLInputElement) && o.type === "submit" && o.form === t, l = y(o);
35
+ if (!s && (!l || l === a || l.target() !== o)) return;
36
+ let d = !v(o), m = d ? a.element() : s ? o : l?.element();
37
+ m && (f.value = {
38
+ target: o,
39
+ anchor: m,
40
+ offscreen: d,
41
+ submit: s,
42
+ text: d ? s ? "下一步:前往提交" : `下一项:${l.label()}` : s ? "前往提交" : "下一项"
43
+ }, r(x));
44
+ }
45
+ function x() {
46
+ let e = c.value, t = l.value, n = f.value;
47
+ if (!e || !t || !n || !u()) return;
48
+ let r = _(n.anchor), i = e.getBoundingClientRect(), a = n.anchor.getBoundingClientRect(), o = i.width / e.offsetWidth || 1, s = i.height / e.offsetHeight || 1, d = t.offsetHeight * s, m, h, g = Math.min(r.right - 4, i.right, a.right);
49
+ if (n.submit && !n.offscreen) m = a.left, h = a.top - d - 6, g = Math.min(r.right - 4, i.right);
50
+ else {
51
+ let e = n.anchor.querySelector(".bing-form-item__label"), t = e ? Array.from(e.children).filter((e) => !e.matches("kbd") && e.getBoundingClientRect().width > 0) : [];
52
+ if (!e || !t.length || n.anchor.classList.contains("bing-form-item--label-left")) return;
53
+ let r = e.getBoundingClientRect();
54
+ m = Math.max(...t.map((e) => e.getBoundingClientRect().right)) + 10, h = r.top + (r.height - d) / 2;
55
+ }
56
+ if (!(g - m < 88 * o || m < r.left || h < r.top || h + d > r.bottom)) {
57
+ if (n.submit && !n.offscreen) {
58
+ let n = m + Math.min(t.offsetWidth * o, g - m), r = e.querySelectorAll(".bing-form-item__control,.bing-form-item__label,.bing-form-item__message-text,button,a[href]");
59
+ if (Array.from(r).some((e) => {
60
+ let t = e.getBoundingClientRect();
61
+ return t.width > 0 && t.height > 0 && t.left < n && t.right > m && t.top < h + d && t.bottom > h;
62
+ })) return;
63
+ }
64
+ p.value = {
65
+ left: `${(m - i.left) / o - e.clientLeft + e.scrollLeft}px`,
66
+ top: `${(h - i.top) / s - e.clientTop + e.scrollTop}px`,
67
+ maxWidth: `${Math.min(280, (g - m) / o)}px`,
68
+ visibility: "visible"
69
+ };
70
+ }
71
+ }
72
+ function S() {
73
+ if (m?.(), m = void 0, f.value = null, !u() || !c.value) return;
74
+ let e = c.value, n = e.ownerDocument, r = n.defaultView, i = 0, a = !1;
75
+ h = () => {
76
+ !a && !i && (i = r.requestAnimationFrame(() => {
77
+ i = 0, b();
78
+ }));
79
+ };
80
+ let o = new MutationObserver((e) => {
81
+ e.some((e) => !l.value?.contains(e.target)) && h();
82
+ });
83
+ o.observe(e, {
84
+ subtree: !0,
85
+ childList: !0,
86
+ characterData: !0,
87
+ attributes: !0,
88
+ attributeFilter: [
89
+ "disabled",
90
+ "hidden",
91
+ "inert",
92
+ "tabindex",
93
+ "style",
94
+ "class",
95
+ "aria-expanded",
96
+ "aria-disabled",
97
+ "name",
98
+ "type",
99
+ "open"
100
+ ]
101
+ });
102
+ let s = new ResizeObserver(h);
103
+ s.observe(e);
104
+ let d = t(n, h), p = [
105
+ "focusin",
106
+ "focusout",
107
+ "input",
108
+ "change",
109
+ "scroll"
110
+ ];
111
+ p.forEach((e) => n.addEventListener(e, h, !0)), r.addEventListener("resize", h);
112
+ let _ = () => {
113
+ g = !1, C();
114
+ }, v = () => {
115
+ g = !0, h();
116
+ };
117
+ r.addEventListener("blur", _), r.addEventListener("focus", v), m = () => {
118
+ a = !0, r.cancelAnimationFrame(i), o.disconnect(), s.disconnect(), d(), p.forEach((e) => n.removeEventListener(e, h, !0)), r.removeEventListener("resize", h), r.removeEventListener("blur", _), r.removeEventListener("focus", v), h = () => {}, C();
119
+ }, h();
120
+ }
121
+ function C() {
122
+ f.value = null, p.value = { visibility: "hidden" };
123
+ }
124
+ return a(S), s(u, S, { flush: "post" }), i(() => m?.()), {
125
+ context: { register(e) {
126
+ return d.add(e), h(), () => {
127
+ d.delete(e), h();
128
+ };
129
+ } },
130
+ hint: f,
131
+ style: p
132
+ };
133
+ }
134
+ //#endregion
135
+ export { c as useFormNextHint };
@@ -0,0 +1,7 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./BingFormItem.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/BingFormItem/BingFormItem.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-17e9dcd8"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -6,7 +6,7 @@ declare var __VLS_1: {
6
6
  'aria-describedby': string | undefined;
7
7
  invalid: boolean;
8
8
  disabled: boolean;
9
- size: import('..').BingFormSize;
9
+ size: import('..').BingConfigSize;
10
10
  };
11
11
  type __VLS_Slots = {} & {
12
12
  default?: (props: typeof __VLS_1) => any;