@moubing/bing-ui 0.11.2 → 0.12.1

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
@@ -4,22 +4,24 @@ type __VLS_Slots = {} & {
4
4
  icon?: (props: typeof __VLS_1) => any;
5
5
  };
6
6
  declare const __VLS_base: import('vue').DefineComponent<BingInputProps, BingInputExpose, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
- clear: () => any;
8
- input: (value: string, event: Event) => any;
9
7
  blur: (event: FocusEvent) => any;
10
8
  focus: (event: FocusEvent) => any;
9
+ clear: () => any;
10
+ input: (value: string, event: Event) => any;
11
11
  keydown: (event: KeyboardEvent) => any;
12
12
  "update:modelValue": (value: string | number) => any;
13
13
  "debounced-input": (value: string) => any;
14
14
  }, string, import('vue').PublicProps, Readonly<BingInputProps> & Readonly<{
15
- onClear?: (() => any) | undefined;
16
- onInput?: ((value: string, event: Event) => any) | undefined;
17
15
  onBlur?: ((event: FocusEvent) => any) | undefined;
18
16
  onFocus?: ((event: FocusEvent) => any) | undefined;
17
+ onClear?: (() => any) | undefined;
18
+ onInput?: ((value: string, event: Event) => any) | undefined;
19
19
  onKeydown?: ((event: KeyboardEvent) => any) | undefined;
20
20
  "onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
21
21
  "onDebounced-input"?: ((value: string) => any) | undefined;
22
22
  }>, {
23
+ name: string;
24
+ status: "default" | "error" | "success" | "warning";
23
25
  disabled: boolean;
24
26
  id: string;
25
27
  type: import('./BingInput.types').BingInputType;
@@ -36,8 +38,6 @@ declare const __VLS_base: import('vue').DefineComponent<BingInputProps, BingInpu
36
38
  debounceDelay: number;
37
39
  clearAriaLabel: string;
38
40
  ariaDescribedby: string;
39
- status: "default" | "error" | "success" | "warning";
40
- name: string;
41
41
  autocomplete: string;
42
42
  spellcheck: boolean | "true" | "false";
43
43
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,311 @@
1
+ import { useClickFeedback as e } from "../../motion/useClickFeedback.js";
2
+ import { useFormControl as t } from "../BingForm/useFormControl.js";
3
+ import n from "../BingButton/BingButton.js";
4
+ import { useControlAttrs as r } from "../../utils/controlAttrs.js";
5
+ import { useTextControlCaret as i } from "../../motion/useTextControlCaret.js";
6
+ import { ChevronDown as a, ChevronUp as ee, X as te } from "../../icons/icons.js";
7
+ import o from "../BingIcon/BingIcon.js";
8
+ import { computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, mergeProps as m, nextTick as ne, onBeforeUnmount as re, openBlock as h, ref as g, renderSlot as ie, unref as _, useSlots as ae, watch as v, withCtx as oe, withModifiers as y } from "vue";
9
+ //#region src/components/BingInput/BingInput.vue?vue&type=script&setup=true&lang.ts
10
+ var se = {
11
+ key: 0,
12
+ class: "bing-input__icon"
13
+ }, ce = { class: "bing-input__content" }, le = [
14
+ "id",
15
+ "value",
16
+ "type",
17
+ "min",
18
+ "max",
19
+ "step",
20
+ "placeholder",
21
+ "disabled",
22
+ "readonly",
23
+ "name",
24
+ "autocomplete",
25
+ "spellcheck",
26
+ "aria-label",
27
+ "aria-describedby",
28
+ "aria-invalid"
29
+ ], ue = {
30
+ key: 1,
31
+ class: "bing-input__actions"
32
+ }, de = {
33
+ key: 0,
34
+ class: "bing-input__stepper"
35
+ }, fe = ["disabled"], pe = ["disabled"], b = /* @__PURE__ */ p({
36
+ inheritAttrs: !1,
37
+ __name: "BingInput",
38
+ props: {
39
+ id: { default: void 0 },
40
+ modelValue: { default: "" },
41
+ type: { default: "text" },
42
+ min: {},
43
+ max: {},
44
+ step: {},
45
+ placeholder: { default: void 0 },
46
+ disabled: {
47
+ type: Boolean,
48
+ default: void 0
49
+ },
50
+ readonly: {
51
+ type: Boolean,
52
+ default: !1
53
+ },
54
+ clearable: {
55
+ type: Boolean,
56
+ default: void 0
57
+ },
58
+ smoothCaret: {
59
+ type: Boolean,
60
+ default: !0
61
+ },
62
+ icon: { default: void 0 },
63
+ iconLabel: { default: void 0 },
64
+ size: { default: void 0 },
65
+ block: {
66
+ type: Boolean,
67
+ default: !1
68
+ },
69
+ debounceDelay: { default: 180 },
70
+ clearAriaLabel: { default: "清空输入" },
71
+ ariaLabel: { default: void 0 },
72
+ ariaDescribedby: { default: void 0 },
73
+ status: { default: void 0 },
74
+ name: { default: void 0 },
75
+ autocomplete: { default: "off" },
76
+ spellcheck: {
77
+ type: [Boolean, String],
78
+ default: void 0
79
+ }
80
+ },
81
+ emits: [
82
+ "update:modelValue",
83
+ "input",
84
+ "debounced-input",
85
+ "clear",
86
+ "focus",
87
+ "blur",
88
+ "keydown"
89
+ ],
90
+ setup(p, { expose: b, emit: me }) {
91
+ let x = p, S = me, { playClickFeedback: C } = e(), { rootAttrs: he, controlAttrs: ge } = r(), { formItem: w, resolvedId: _e, resolvedSize: ve, resolvedDisabled: T, resolvedStatus: E, resolvedAriaDescribedby: ye } = t(x), be = ae(), D = g(null), O = g(null), k = g(null), A = g(null);
92
+ i(O, k, A, () => x.smoothCaret);
93
+ let j = g(!1), M = g(""), N = "", P, F = !1, I = 0, L, R, z, B = s(() => Math.max(0, Math.floor(x.debounceDelay))), V = s(() => !!(x.icon || be.icon)), H = s(() => x.modelValue !== null && String(x.modelValue).length > 0), U = s(() => (x.clearable ?? x.type === "search") && !x.readonly && !T.value && H.value), W = s(() => x.type === "number"), xe = s(() => [
94
+ "bing-input",
95
+ `bing-input--${ve.value}`,
96
+ `bing-input--status-${E.value}`,
97
+ {
98
+ "is-block": x.block,
99
+ "is-disabled": T.value,
100
+ "is-invalid": E.value === "error",
101
+ "has-icon": V.value,
102
+ "has-value": H.value,
103
+ "can-clear": U.value,
104
+ "has-actions": U.value || W.value
105
+ }
106
+ ]);
107
+ function G() {
108
+ L !== void 0 && (clearTimeout(L), L = void 0);
109
+ }
110
+ function K(e) {
111
+ if (G(), B.value === 0) {
112
+ S("debounced-input", e);
113
+ return;
114
+ }
115
+ L = setTimeout(() => {
116
+ L = void 0, S("debounced-input", e);
117
+ }, B.value);
118
+ }
119
+ function q(e, t) {
120
+ let n = e === "" ? NaN : Number(e);
121
+ S("update:modelValue", x.type === "number" && Number.isFinite(n) ? n : e), S("input", e, t), K(e), w?.handleControlChange();
122
+ }
123
+ function Se(e) {
124
+ let t = e.target.value;
125
+ if (j.value || e.isComposing) {
126
+ M.value = t;
127
+ return;
128
+ }
129
+ let n = P === t;
130
+ P = void 0, !n && q(t, e);
131
+ }
132
+ function Ce(e) {
133
+ N = e.target.value, M.value = N, P = void 0, j.value = !0, F = L !== void 0, G();
134
+ }
135
+ function J(e) {
136
+ if (!j.value) return;
137
+ let t = e.target.value;
138
+ j.value = !1, P = t, t === N ? F && K(t) : q(t, e), F = !1;
139
+ }
140
+ function we(e) {
141
+ !j.value && !e.isComposing && e.keyCode !== 229 && (P = void 0), S("keydown", e);
142
+ }
143
+ function Y(e) {
144
+ let t = O.value;
145
+ if (!t || !W.value || x.readonly || T.value) return !1;
146
+ let n = t.value;
147
+ if (t.step.toLowerCase() === "any") {
148
+ let n = t.valueAsNumber, r = t.min.trim() === "" || !Number.isFinite(Number(t.min)) ? -Infinity : Number(t.min), i = t.max.trim() === "" || !Number.isFinite(Number(t.max)) ? Infinity : Number(t.max), a = Math.min(i, Math.max(r, (Number.isFinite(n) ? n : 0) + e));
149
+ r <= i && Number.isFinite(a) && (!Number.isFinite(n) || (a - n) * e > 0) && (t.valueAsNumber = a);
150
+ } else t.stepUp(e);
151
+ return t.value === n ? !1 : (t.dispatchEvent(new Event("input", { bubbles: !0 })), t.dispatchEvent(new Event("change", { bubbles: !0 })), !0);
152
+ }
153
+ function X() {
154
+ clearTimeout(R), clearInterval(z), R = void 0, z = void 0, typeof window < "u" && (window.removeEventListener("pointerup", X), window.removeEventListener("pointercancel", X), window.removeEventListener("blur", X));
155
+ }
156
+ function Z(e, t) {
157
+ t.button !== 0 || x.readonly || T.value || (t.preventDefault(), X(), O.value?.focus(), Y(e) && (C(t), window.addEventListener("pointerup", X), window.addEventListener("pointercancel", X), window.addEventListener("blur", X), R = setTimeout(() => {
158
+ z = setInterval(() => {
159
+ Y(e) || X();
160
+ }, 80);
161
+ }, 400)));
162
+ }
163
+ function Q(e, t) {
164
+ t.detail === 0 && !t.pointerType && (O.value?.focus(), Y(e) && C(t));
165
+ }
166
+ function Te() {
167
+ U.value && (j.value = !1, P = void 0, F = !1, G(), S("update:modelValue", ""), S("clear"), S("debounced-input", ""), w?.handleControlChange(), O.value?.focus());
168
+ }
169
+ function Ee(e) {
170
+ S("focus", e);
171
+ }
172
+ function De(e) {
173
+ J(e), S("blur", e);
174
+ }
175
+ function Oe() {
176
+ I += 1;
177
+ }
178
+ async function ke(e) {
179
+ let t = D.value;
180
+ if (!t || e.relatedTarget instanceof Node && t.contains(e.relatedTarget)) return;
181
+ let n = ++I;
182
+ await ne(), !(n !== I || D.value !== t || t.contains(t.ownerDocument.activeElement)) && w?.handleControlBlur();
183
+ }
184
+ function $() {
185
+ O.value?.focus();
186
+ }
187
+ function Ae() {
188
+ O.value?.blur();
189
+ }
190
+ function je() {
191
+ O.value?.select();
192
+ }
193
+ return re(() => {
194
+ I += 1, G(), X();
195
+ }), v([
196
+ T,
197
+ () => x.readonly,
198
+ () => x.type
199
+ ], X), v(() => x.modelValue, (e) => {
200
+ !j.value && String(e ?? "") !== P && (P = void 0);
201
+ }), b({
202
+ get input() {
203
+ return O.value;
204
+ },
205
+ focus: $,
206
+ blur: Ae,
207
+ select: je
208
+ }), (e, t) => (h(), u("div", m(_(he)(), {
209
+ ref_key: "rootRef",
210
+ ref: D,
211
+ class: xe.value,
212
+ onClick: $,
213
+ onFocusin: Oe,
214
+ onFocusout: ke
215
+ }), [
216
+ V.value ? (h(), u("span", se, [ie(e.$slots, "icon", {}, () => [x.icon ? (h(), c(o, {
217
+ key: 0,
218
+ icon: x.icon,
219
+ size: "sm",
220
+ "stroke-width": 1.75,
221
+ decorative: !x.iconLabel,
222
+ label: x.iconLabel
223
+ }, null, 8, [
224
+ "icon",
225
+ "decorative",
226
+ "label"
227
+ ])) : l("", !0)], !0)])) : l("", !0),
228
+ d("span", ce, [d("input", m(_(ge)(), {
229
+ ref_key: "inputRef",
230
+ ref: O,
231
+ class: "bing-input__field",
232
+ id: _(_e),
233
+ value: j.value ? M.value : x.modelValue,
234
+ type: x.type,
235
+ min: x.min,
236
+ max: x.max,
237
+ step: x.step,
238
+ placeholder: x.placeholder,
239
+ disabled: _(T),
240
+ readonly: x.readonly,
241
+ name: x.name,
242
+ autocomplete: x.autocomplete,
243
+ spellcheck: x.spellcheck,
244
+ "aria-label": x.ariaLabel || void 0,
245
+ "aria-describedby": _(ye),
246
+ "aria-invalid": _(E) === "error" || void 0,
247
+ onInput: Se,
248
+ onCompositionstart: Ce,
249
+ onCompositionend: J,
250
+ onFocus: Ee,
251
+ onBlur: De,
252
+ onKeydown: we
253
+ }), null, 16, le), d("span", {
254
+ ref_key: "caretLayerRef",
255
+ ref: k,
256
+ class: "bing-input__caret-layer",
257
+ "aria-hidden": "true"
258
+ }, [d("span", {
259
+ ref_key: "caretRef",
260
+ ref: A,
261
+ class: "bing-input__caret"
262
+ }, null, 512)], 512)]),
263
+ U.value || W.value ? (h(), u("span", ue, [W.value ? (h(), u("span", de, [d("button", {
264
+ type: "button",
265
+ class: "bing-input__step",
266
+ tabindex: "-1",
267
+ "aria-label": "增加数值",
268
+ disabled: _(T) || x.readonly,
269
+ onPointerdown: t[0] ||= (e) => Z(1, e),
270
+ onPointerleave: X,
271
+ onClick: t[1] ||= y((e) => Q(1, e), ["stop"])
272
+ }, [f(o, {
273
+ icon: _(ee),
274
+ size: "xs",
275
+ "stroke-width": 1.75
276
+ }, null, 8, ["icon"])], 40, fe), d("button", {
277
+ type: "button",
278
+ class: "bing-input__step",
279
+ tabindex: "-1",
280
+ "aria-label": "减少数值",
281
+ disabled: _(T) || x.readonly,
282
+ onPointerdown: t[2] ||= (e) => Z(-1, e),
283
+ onPointerleave: X,
284
+ onClick: t[3] ||= y((e) => Q(-1, e), ["stop"])
285
+ }, [f(o, {
286
+ icon: _(a),
287
+ size: "xs",
288
+ "stroke-width": 1.75
289
+ }, null, 8, ["icon"])], 40, pe)])) : l("", !0), U.value ? (h(), c(n, {
290
+ key: 1,
291
+ variant: "ghost",
292
+ size: "xs",
293
+ rounded: "sm",
294
+ throttle: !1,
295
+ class: "bing-input__clear",
296
+ "aria-label": x.clearAriaLabel,
297
+ onMousedown: t[4] ||= y(() => {}, ["prevent"]),
298
+ onClick: y(Te, ["stop"])
299
+ }, {
300
+ prefix: oe(() => [f(o, {
301
+ icon: _(te),
302
+ size: "xs",
303
+ "stroke-width": 1.75
304
+ }, null, 8, ["icon"])]),
305
+ _: 1
306
+ }, 8, ["aria-label"])) : l("", !0)])) : l("", !0)
307
+ ], 16));
308
+ }
309
+ });
310
+ //#endregion
311
+ export { b as default };
@@ -0,0 +1,7 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./BingRadio.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/BingRadio/BingRadio.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-c9261b05"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -6,16 +6,18 @@ type __VLS_Slots = {} & {
6
6
  description?: (props: typeof __VLS_3) => any;
7
7
  };
8
8
  declare const __VLS_base: import('vue').DefineComponent<BingRadioProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
- change: (value: import('..').BingRadioValue, event: Event) => any;
10
9
  blur: (event: FocusEvent) => any;
11
10
  focus: (event: FocusEvent) => any;
11
+ change: (value: import('..').BingRadioValue, event: Event) => any;
12
12
  "update:modelValue": (value: import('..').BingRadioValue) => any;
13
13
  }, string, import('vue').PublicProps, Readonly<BingRadioProps> & Readonly<{
14
- onChange?: ((value: import('..').BingRadioValue, event: Event) => any) | undefined;
15
14
  onBlur?: ((event: FocusEvent) => any) | undefined;
16
15
  onFocus?: ((event: FocusEvent) => any) | undefined;
16
+ onChange?: ((value: import('..').BingRadioValue, event: Event) => any) | undefined;
17
17
  "onUpdate:modelValue"?: ((value: import('..').BingRadioValue) => any) | undefined;
18
18
  }>, {
19
+ name: string;
20
+ status: "default" | "error" | "success" | "warning";
19
21
  disabled: boolean;
20
22
  label: string;
21
23
  id: string;
@@ -23,8 +25,6 @@ declare const __VLS_base: import('vue').DefineComponent<BingRadioProps, {}, {},
23
25
  ariaLabel: string;
24
26
  modelValue: import('..').BingRadioValue | null;
25
27
  ariaDescribedby: string;
26
- status: "default" | "error" | "success" | "warning";
27
- name: string;
28
28
  value: import('..').BingRadioValue;
29
29
  description: string;
30
30
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,170 @@
1
+ import { useReducedMotion as e } from "../../motion/reducedMotion.js";
2
+ import { useClickFeedback as t } from "../../motion/useClickFeedback.js";
3
+ import { useFormControl as n } from "../BingForm/useFormControl.js";
4
+ import { bingRadioGroupContextKey as r } from "../BingRadioGroup/BingRadioGroup.context.js";
5
+ import { computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, defineComponent as l, inject as u, normalizeClass as d, onBeforeUnmount as f, openBlock as p, ref as m, renderSlot as h, toDisplayString as g, unref as _, useSlots as v, watch as y } from "vue";
6
+ import { gsap as b } from "gsap";
7
+ //#region src/components/BingRadio/BingRadio.vue?vue&type=script&setup=true&lang.ts
8
+ var x = [
9
+ "id",
10
+ "checked",
11
+ "disabled",
12
+ "name",
13
+ "value",
14
+ "aria-label",
15
+ "aria-describedby",
16
+ "aria-invalid"
17
+ ], S = {
18
+ class: "bing-radio__control",
19
+ "aria-hidden": "true"
20
+ }, C = {
21
+ key: 0,
22
+ class: "bing-radio__content"
23
+ }, w = {
24
+ key: 0,
25
+ class: "bing-radio__label"
26
+ }, T = {
27
+ key: 1,
28
+ class: "bing-radio__description"
29
+ }, E = /* @__PURE__ */ l({
30
+ __name: "BingRadio",
31
+ props: {
32
+ id: { default: void 0 },
33
+ modelValue: {
34
+ type: [
35
+ String,
36
+ Number,
37
+ Boolean,
38
+ null
39
+ ],
40
+ default: null
41
+ },
42
+ value: {
43
+ type: [
44
+ String,
45
+ Number,
46
+ Boolean
47
+ ],
48
+ default: !0
49
+ },
50
+ disabled: {
51
+ type: Boolean,
52
+ default: void 0
53
+ },
54
+ size: { default: void 0 },
55
+ label: { default: void 0 },
56
+ description: { default: void 0 },
57
+ ariaLabel: { default: void 0 },
58
+ ariaDescribedby: { default: void 0 },
59
+ status: { default: void 0 },
60
+ name: { default: void 0 }
61
+ },
62
+ emits: [
63
+ "update:modelValue",
64
+ "change",
65
+ "focus",
66
+ "blur"
67
+ ],
68
+ setup(l, { emit: E }) {
69
+ let D = e(), O = l, k = E, { playClickFeedback: A } = t(), j = v(), M = u(r, null), { formItem: N, resolvedSize: P, resolvedDisabled: F, resolvedStatus: I, resolvedId: L, resolvedAriaDescribedby: R } = n({
70
+ get id() {
71
+ return O.id;
72
+ },
73
+ get size() {
74
+ return O.size ?? M?.size.value;
75
+ },
76
+ get disabled() {
77
+ return M?.disabled.value || O.disabled;
78
+ },
79
+ get status() {
80
+ return O.status ?? M?.status.value;
81
+ },
82
+ get ariaDescribedby() {
83
+ return O.ariaDescribedby;
84
+ }
85
+ }, { register: !M }), z = m(null), B = i(() => O.value), V = i(() => O.name ?? M?.name.value), H = i(() => (M ? M.modelValue.value : O.modelValue) === B.value), U = i(() => !!(O.label || j.default)), W = i(() => !!(O.description || j.description)), G = i(() => [
86
+ "bing-radio",
87
+ `bing-radio--${P.value}`,
88
+ `bing-radio--status-${I.value}`,
89
+ {
90
+ "is-checked": H.value,
91
+ "is-disabled": F.value,
92
+ "is-invalid": I.value === "error",
93
+ "has-description": W.value,
94
+ "has-content": U.value || W.value
95
+ }
96
+ ]);
97
+ function K(e) {
98
+ let t = z.value;
99
+ if (!(!t || D())) {
100
+ if (b.killTweensOf(t), e) {
101
+ b.fromTo(t, {
102
+ autoAlpha: 0,
103
+ scale: .18
104
+ }, {
105
+ autoAlpha: 1,
106
+ scale: 1,
107
+ duration: .24,
108
+ ease: "back.out(3)",
109
+ clearProps: "transform,opacity,visibility",
110
+ overwrite: !0
111
+ });
112
+ return;
113
+ }
114
+ b.to(t, {
115
+ autoAlpha: 0,
116
+ scale: .3,
117
+ duration: .14,
118
+ ease: "power2.in",
119
+ clearProps: "transform,opacity,visibility",
120
+ overwrite: !0
121
+ });
122
+ }
123
+ }
124
+ function q(e) {
125
+ if (e.defaultPrevented || F.value) return;
126
+ let t = e.currentTarget.parentElement?.querySelector(".bing-radio__control");
127
+ A(e, t);
128
+ }
129
+ function J(e) {
130
+ if (e.target.checked) {
131
+ if (M) {
132
+ M.updateValue(B.value, e);
133
+ return;
134
+ }
135
+ k("update:modelValue", B.value), k("change", B.value, e), N?.handleControlChange();
136
+ }
137
+ }
138
+ function Y(e) {
139
+ k("blur", e), M?.handleRadioBlur(e), M || N?.handleControlBlur();
140
+ }
141
+ return y(H, K), f(() => {
142
+ z.value && b.killTweensOf(z.value);
143
+ }), (e, t) => (p(), o("label", { class: d(G.value) }, [
144
+ s("input", {
145
+ class: "bing-radio__input",
146
+ type: "radio",
147
+ id: _(L),
148
+ checked: H.value,
149
+ disabled: _(F),
150
+ name: V.value,
151
+ value: String(B.value),
152
+ "aria-label": l.ariaLabel || void 0,
153
+ "aria-describedby": _(R),
154
+ "aria-invalid": _(I) === "error" || void 0,
155
+ onChange: J,
156
+ onClick: q,
157
+ onFocus: t[0] ||= (e) => k("focus", e),
158
+ onBlur: Y
159
+ }, null, 40, x),
160
+ s("span", S, [s("span", {
161
+ ref_key: "dotRef",
162
+ ref: z,
163
+ class: "bing-radio__dot"
164
+ }, null, 512)]),
165
+ U.value || W.value ? (p(), o("span", C, [U.value ? (p(), o("span", w, [h(e.$slots, "default", {}, () => [c(g(l.label), 1)], !0)])) : a("", !0), W.value ? (p(), o("span", T, [h(e.$slots, "description", {}, () => [c(g(l.description), 1)], !0)])) : a("", !0)])) : a("", !0)
166
+ ], 2));
167
+ }
168
+ });
169
+ //#endregion
170
+ export { E as default };
@@ -0,0 +1,4 @@
1
+ //#region src/components/BingRadioGroup/BingRadioGroup.context.ts
2
+ var e = Symbol("BingRadioGroupContext");
3
+ //#endregion
4
+ export { e as bingRadioGroupContextKey };
@@ -0,0 +1,7 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./BingRadioGroup.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/BingRadioGroup/BingRadioGroup.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-f2c893db"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -4,16 +4,18 @@ type __VLS_Slots = {} & {
4
4
  default?: (props: typeof __VLS_1) => any;
5
5
  };
6
6
  declare const __VLS_base: import('vue').DefineComponent<BingRadioGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
- change: (value: BingRadioValue, event: Event) => any;
8
7
  blur: (event: FocusEvent) => any;
9
8
  focus: (event: FocusEvent) => any;
9
+ change: (value: BingRadioValue, event: Event) => any;
10
10
  "update:modelValue": (value: BingRadioValue) => any;
11
11
  }, string, import('vue').PublicProps, Readonly<BingRadioGroupProps> & Readonly<{
12
- onChange?: ((value: BingRadioValue, event: Event) => any) | undefined;
13
12
  onBlur?: ((event: FocusEvent) => any) | undefined;
14
13
  onFocus?: ((event: FocusEvent) => any) | undefined;
14
+ onChange?: ((value: BingRadioValue, event: Event) => any) | undefined;
15
15
  "onUpdate:modelValue"?: ((value: BingRadioValue) => any) | undefined;
16
16
  }>, {
17
+ name: string;
18
+ status: "default" | "error" | "success" | "warning";
17
19
  disabled: boolean;
18
20
  direction: import('./BingRadioGroup.types').BingRadioGroupDirection;
19
21
  id: string;
@@ -21,8 +23,6 @@ declare const __VLS_base: import('vue').DefineComponent<BingRadioGroupProps, {},
21
23
  ariaLabel: string;
22
24
  modelValue: BingRadioValue | null;
23
25
  ariaDescribedby: string;
24
- status: "default" | "error" | "success" | "warning";
25
- name: string;
26
26
  options: BingRadioGroupOption[];
27
27
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
28
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;