@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,60 @@
1
+ //#region src/components/BingCursor/BingCursor.presets.ts
2
+ var e = {
3
+ default: [4, 3],
4
+ pointer: [12, 3],
5
+ "not-allowed": [16, 16],
6
+ text: [16, 16],
7
+ grab: [16, 16],
8
+ grabbing: [16, 16],
9
+ move: [16, 16],
10
+ crosshair: [16, 16],
11
+ "col-resize": [16, 16],
12
+ "row-resize": [16, 16],
13
+ "ew-resize": [16, 16],
14
+ "ns-resize": [16, 16],
15
+ "nwse-resize": [16, 16],
16
+ "nesw-resize": [16, 16],
17
+ "zoom-in": [13, 13],
18
+ "zoom-out": [13, 13]
19
+ };
20
+ function t(t) {
21
+ return Object.prototype.hasOwnProperty.call(e, t);
22
+ }
23
+ var n = {
24
+ "n-resize": "ns-resize",
25
+ "s-resize": "ns-resize",
26
+ "e-resize": "ew-resize",
27
+ "w-resize": "ew-resize",
28
+ "ne-resize": "nesw-resize",
29
+ "sw-resize": "nesw-resize",
30
+ "nw-resize": "nwse-resize",
31
+ "se-resize": "nwse-resize",
32
+ "all-scroll": "move",
33
+ "no-drop": "not-allowed"
34
+ };
35
+ function r(e, r, i = "auto", a = !1) {
36
+ let o = e.closest("[data-bing-cursor]")?.getAttribute("data-bing-cursor");
37
+ if (o === "native" || e.closest("iframe, select, video, audio, dialog[open], [popover]") || r === "none" || i === "auto" && (!o || !t(o)) && r && r !== "auto" && !t(r) && !n[r]) return null;
38
+ if (e.closest("button, input, textarea, select, option, fieldset")?.matches(":disabled") || e.closest("[aria-disabled=\"true\"], [inert]")) return "not-allowed";
39
+ let s;
40
+ if (o && t(o)) s = o;
41
+ else if (i !== "auto") s = i;
42
+ else if (t(r)) s = r;
43
+ else if (n[r]) s = n[r];
44
+ else if (r && r !== "auto") return null;
45
+ else {
46
+ let t = e.closest("input"), n = t?.getAttribute("type")?.toLowerCase() ?? "text", r = e.closest("[contenteditable]");
47
+ s = e.closest("textarea") || t && [
48
+ "text",
49
+ "search",
50
+ "email",
51
+ "password",
52
+ "tel",
53
+ "url",
54
+ "number"
55
+ ].includes(n) || r && r.getAttribute("contenteditable") !== "false" ? "text" : e.closest("a[href], button, summary, [role=\"button\"], [role=\"link\"], [role=\"tab\"]") ? "pointer" : "default";
56
+ }
57
+ return s === "grab" && a ? "grabbing" : s;
58
+ }
59
+ //#endregion
60
+ export { e as cursorHotspots, r as resolveCursorType };
@@ -0,0 +1,83 @@
1
+ //#region src/components/BingCursor/BingCursor.shapes.ts
2
+ var e = (e) => Math.round(e * 1e3) / 1e3, t = (t, n) => `${e(t)} ${e(n)}`;
3
+ function n(e, n, r) {
4
+ return `M${t(e - r, n)}a${r} ${r} 0 1 0 ${r * 2} 0a${r} ${r} 0 1 0 ${-r * 2} 0Z`;
5
+ }
6
+ function r(e, n, r, i, a = 1.55) {
7
+ let o = Math.hypot(r - e, i - n), s = a / 2, c = -(i - n) / o * s, l = (r - e) / o * s;
8
+ return `M${t(e + c, n + l)}L${t(r + c, i + l)}A${s} ${s} 0 0 0 ${t(r - c, i - l)}L${t(e - c, n - l)}A${s} ${s} 0 0 0 ${t(e + c, n + l)}Z`;
9
+ }
10
+ function i(e, n = 0) {
11
+ let r = n * Math.PI / 180;
12
+ return e.map(([e, n], i) => `${i ? "L" : "M"}${t(16 + (e - 16) * Math.cos(r) - (n - 16) * Math.sin(r), 16 + (e - 16) * Math.sin(r) + (n - 16) * Math.cos(r))}`).join("") + "Z";
13
+ }
14
+ var a = (e, t = 1) => ({
15
+ d: e,
16
+ ink: t,
17
+ outline: 0,
18
+ strokeWidth: 0
19
+ });
20
+ function o(e, t = 1, n = 2.5, r = []) {
21
+ return [{
22
+ d: e,
23
+ ink: t,
24
+ outline: 1 - t,
25
+ strokeWidth: n
26
+ }, ...r];
27
+ }
28
+ var s = [
29
+ [2, 16],
30
+ [8.3, 9.7],
31
+ [9.7, 11.1],
32
+ [5.8, 15],
33
+ [26.2, 15],
34
+ [22.3, 11.1],
35
+ [23.7, 9.7],
36
+ [30, 16],
37
+ [23.7, 22.3],
38
+ [22.3, 20.9],
39
+ [26.2, 17],
40
+ [5.8, 17],
41
+ [9.7, 20.9],
42
+ [8.3, 22.3]
43
+ ], c = "M21.1 18.7L29.2 26.8C30.9 28.5 28.5 30.9 26.8 29.2L18.7 21.1A9.9 9.9 0 1 1 21.1 18.7Z", l = a(n(13, 13, 8.1), 0), u = {
44
+ default: o("M4 3L24.6 17.1C25.5 17.7 25.2 18.8 24.1 18.7L16.2 18.2L20.5 27Q20.8 27.8 20 28.2L17.5 29.4Q16.7 29.8 16.3 29L12 20.1L5.9 25.3C5.1 26 4 25.4 4 24.4V3Z", 1, 3.2),
45
+ pointer: o("M10 16V5.2C10 2.3 14 2.3 14 5.2v7.4c.9-2.1 4-1.5 4 .8v.5c1-1.8 4-1.1 4 1.1v.7c1.4-1.3 3.8-.3 3.8 1.8v4.3c0 3.1-2 4.8-2.7 7.2H12.4c-.4-2.8-2.4-4.7-4-6.4L4.8 19c-1.6-1.8.8-4.3 2.5-2.8l2.7 2.4V16Z", 1, 2.8, [
46
+ a(r(14, 15, 14, 20), 0),
47
+ a(r(18, 16, 18, 20), 0),
48
+ a(r(22, 17.5, 22, 20.5), 0)
49
+ ]),
50
+ grab: o("m9.2 17-3-7.4C5.1 7.1 8.5 5.6 9.6 8l2.5 5.2V4.6c0-2.7 3.7-2.7 3.7 0v7.8L17 5.4c.4-2.6 4-2.1 3.6.5l-1 7.4 2.8-5.5c1.2-2.3 4.4-.7 3.2 1.6L22.8 17c.2 4.4-1.5 6.6-1.8 11.5h-9.6c-.2-2.8-1.5-4.4-3.2-6.2l-3.7-4.1c-1.9-2.1.7-4.5 2.5-2.8L9.2 17Z", 1, 2.8, [
51
+ a(r(12.6, 17, 13.1, 21), 0),
52
+ a(r(16.2, 17, 16.2, 21), 0),
53
+ a(r(19.4, 17.4, 18.9, 21), 0)
54
+ ]),
55
+ grabbing: o("M7.5 17.5V12c0-2.8 3.8-3.2 4.1-.5v-1c0-2.9 4-2.9 4 0v.3c.4-2.7 4.2-2.5 4.2.4v1c1-2.1 4.2-1.4 4.2 1.2v5.3c0 3.6-2.7 4.8-2.9 9.3H11c-.3-3.1-1.8-4.4-3.6-6.2l-2.5-2.6c-1.9-2 .6-4.7 2.6-3Z", 1, 2.8, [
56
+ a(r(11.6, 13, 11.6, 16) + r(7.5, 16.3, 11, 18.9), 0),
57
+ a(r(15.6, 13, 15.6, 16), 0),
58
+ a(r(19.8, 14, 19.8, 16.5), 0)
59
+ ]),
60
+ "not-allowed": o(n(16, 16, 10), 0, 4.2, [a(r(9, 9, 23, 23, 2.5))]),
61
+ text: o("M11 4.1H13C14.3 4.1 15.4 4.5 16 5.3C16.6 4.5 17.7 4.1 19 4.1H21V5.9H19C17.7 5.9 16.9 6.4 16.9 8V24C16.9 25.6 17.7 26.1 19 26.1H21V27.9H19C17.7 27.9 16.6 27.5 16 26.7C15.4 27.5 14.3 27.9 13 27.9H11V26.1H13C14.3 26.1 15.1 25.6 15.1 24V8C15.1 6.4 14.3 5.9 13 5.9H11Z"),
62
+ crosshair: o([
63
+ r(16, 3, 16, 13, 1.8),
64
+ r(16, 19, 16, 29, 1.8),
65
+ r(3, 16, 13, 16, 1.8),
66
+ r(19, 16, 29, 16, 1.8)
67
+ ].join("")),
68
+ move: o("M16 2.1L21 7.1L19.7 8.4L16.9 5.6V15.1H26.4L23.6 12.3L24.9 11L29.9 16L24.9 21L23.6 19.7L26.4 16.9H16.9V26.4L19.7 23.6L21 24.9L16 29.9L11 24.9L12.3 23.6L15.1 26.4V16.9H5.6L8.4 19.7L7.1 21L2.1 16L7.1 11L8.4 12.3L5.6 15.1H15.1V5.6L12.3 8.4L11 7.1Z"),
69
+ "col-resize": o(i(s)),
70
+ "row-resize": o(i(s, 90)),
71
+ "ew-resize": o(i(s)),
72
+ "ns-resize": o(i(s, 90)),
73
+ "nwse-resize": o(i(s, 45)),
74
+ "nesw-resize": o(i(s, -45)),
75
+ "zoom-in": o(c, 1, 2.5, [
76
+ l,
77
+ a(r(9, 13, 17, 13, 1.8)),
78
+ a(r(13, 9, 13, 17, 1.8))
79
+ ]),
80
+ "zoom-out": o(c, 1, 2.5, [l, a(r(9, 13, 17, 13, 1.8))])
81
+ };
82
+ //#endregion
83
+ export { u as cursorShapes };
@@ -0,0 +1,83 @@
1
+ //#region src/components/BingCursor/BingCursor.styleSource.ts
2
+ var e = "--bing-cursor-source";
3
+ function t(t) {
4
+ let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = t.createElement("style");
5
+ a.dataset.bingCursorSource = "", a.textContent = `@layer bing-cursor-defaults {
6
+ :where(:root) { ${e}: auto; }
7
+ :where(a:any-link) { ${e}: pointer; }
8
+ :where(button, input) { ${e}: default; }
9
+ :where(textarea, input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="number"]) { ${e}: text; }
10
+ }`, t.head.prepend(a);
11
+ function o(t, n, r = e) {
12
+ t.getPropertyValue(r) !== n.appliedValue || t.getPropertyPriority(r) !== n.appliedPriority || (n.value ? t.setProperty(r, n.value, n.priority) : t.removeProperty(r));
13
+ }
14
+ function s(t, n, r = e, i = t.cursor, a = t.getPropertyPriority("cursor")) {
15
+ let s = n.get(t);
16
+ if (!i) {
17
+ s && o(t, s, r), n.delete(t);
18
+ return;
19
+ }
20
+ s || (s = {
21
+ value: t.getPropertyValue(r),
22
+ priority: t.getPropertyPriority(r),
23
+ appliedValue: i,
24
+ appliedPriority: a
25
+ }, n.set(t, s)), (t.getPropertyValue(r) !== i || t.getPropertyPriority(r) !== a) && t.setProperty(r, i, a), s.appliedValue = t.getPropertyValue(r), s.appliedPriority = t.getPropertyPriority(r);
26
+ }
27
+ function c() {
28
+ let r = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
29
+ function l(e) {
30
+ if (c.has(e)) return;
31
+ c.add(e);
32
+ let t = e.ownerNode;
33
+ if (!(t instanceof Element && t.hasAttribute("data-bing-cursor-style"))) try {
34
+ u(e.cssRules);
35
+ } catch {}
36
+ }
37
+ function u(t) {
38
+ for (let o of t) {
39
+ if ("style" in o) {
40
+ let t = o.style;
41
+ (t.cursor || n.has(t)) && (r.add(t), s(t, n));
42
+ let c = t.cursor || (t.parentRule?.parentStyleSheet?.ownerNode === a ? t.getPropertyValue(e) : "");
43
+ for (let [e, n] of i) (c || n.records.has(t)) && (r.add(t), s(t, n.records, e, c ? n.render(c) : "", t.getPropertyPriority("cursor")));
44
+ }
45
+ "styleSheet" in o && o.styleSheet ? l(o.styleSheet) : "cssRules" in o && u(o.cssRules);
46
+ }
47
+ }
48
+ for (let e of [...t.styleSheets, ...t.adoptedStyleSheets ?? []]) l(e);
49
+ for (let [e, t] of n) r.has(e) || (o(e, t), n.delete(e));
50
+ for (let [e, t] of i) for (let [n, i] of t.records) r.has(n) || (o(n, i, e), t.records.delete(n));
51
+ }
52
+ return {
53
+ palette(e, t) {
54
+ let n = {
55
+ render: t,
56
+ records: /* @__PURE__ */ new Map()
57
+ };
58
+ return i.set(e, n), c(), () => {
59
+ for (let [t, r] of n.records) o(t, r, e);
60
+ i.delete(e);
61
+ };
62
+ },
63
+ read(n, i = !0, a) {
64
+ i && c();
65
+ let l = /* @__PURE__ */ new Set();
66
+ for (let e = n; e; e = e.parentElement) {
67
+ if (!("style" in e) || a?.contains(e)) continue;
68
+ let t = e.style;
69
+ l.add(t), s(t, r);
70
+ }
71
+ for (let [e, t] of r) l.has(e) || (o(e, t), r.delete(e));
72
+ return t.defaultView.getComputedStyle(n).getPropertyValue(e).trim() || "auto";
73
+ },
74
+ destroy() {
75
+ for (let [e, t] of i) for (let [n, r] of t.records) o(n, r, e);
76
+ i.clear();
77
+ for (let [e, t] of [...n, ...r]) o(e, t);
78
+ n.clear(), r.clear(), a.remove();
79
+ }
80
+ };
81
+ }
82
+ //#endregion
83
+ export { t as createCursorStyleSource };
@@ -0,0 +1,73 @@
1
+ import { registerCursor as e } from "./BingCursor.controller.js";
2
+ import { createNativeCursor as t } from "./BingCursor.native.js";
3
+ import { computed as n, createCommentVNode as r, createElementBlock as i, defineComponent as a, normalizeStyle as o, onBeforeUnmount as s, onMounted as c, openBlock as l, ref as u, renderSlot as d, watch as f } from "vue";
4
+ //#region src/components/BingCursor/BingCursor.vue?vue&type=script&setup=true&lang.ts
5
+ var p = /* @__PURE__ */ a({
6
+ __name: "BingCursor",
7
+ props: {
8
+ type: { default: "auto" },
9
+ global: {
10
+ type: Boolean,
11
+ default: !1
12
+ },
13
+ disabled: {
14
+ type: Boolean,
15
+ default: !1
16
+ },
17
+ size: { default: 28 },
18
+ color: {},
19
+ outlineColor: {},
20
+ hotspot: {}
21
+ },
22
+ emits: ["change", "visibility-change"],
23
+ setup(a, { emit: p }) {
24
+ let m = a, h = p, g = u(null), _ = u(null), v = u(!1), y = n(() => ({
25
+ "--bing-cursor-color": m.color,
26
+ "--bing-cursor-outline": m.outlineColor,
27
+ color: "var(--bing-cursor-color, #171717)",
28
+ backgroundColor: "var(--bing-cursor-outline, #ffffff)"
29
+ })), b, x = !1, S = "default";
30
+ return c(() => {
31
+ v.value = !0, b = e({
32
+ root: g.value,
33
+ options: () => m,
34
+ nativeCursor(e) {
35
+ if (!_.value) return;
36
+ let n = _.value.ownerDocument.defaultView.getComputedStyle(_.value);
37
+ return t(e, m.size, n.color, n.backgroundColor, m.hotspot);
38
+ },
39
+ show(e) {
40
+ e !== S && (S = e, h("change", e)), x || (x = !0, h("visibility-change", !0));
41
+ },
42
+ hide() {
43
+ x && (x = !1, h("visibility-change", !1));
44
+ }
45
+ });
46
+ }), f(_, () => b?.refresh(), { flush: "post" }), f(() => [
47
+ m.disabled,
48
+ m.global,
49
+ m.type,
50
+ m.size,
51
+ m.hotspot,
52
+ m.color,
53
+ m.outlineColor
54
+ ], () => b?.refresh(), {
55
+ deep: !0,
56
+ flush: "post"
57
+ }), s(() => b?.destroy()), (e, t) => (l(), i("div", {
58
+ ref_key: "rootRef",
59
+ ref: g,
60
+ class: "bing-cursor"
61
+ }, [d(e.$slots, "default", {}, void 0, !0), v.value ? (l(), i("span", {
62
+ key: 0,
63
+ ref_key: "paletteRef",
64
+ ref: _,
65
+ hidden: "",
66
+ "aria-hidden": "true",
67
+ "data-bing-cursor-palette": "",
68
+ style: o(y.value)
69
+ }, null, 4)) : r("", !0)], 512));
70
+ }
71
+ });
72
+ //#endregion
73
+ export { p as default };
@@ -0,0 +1,7 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./BingDatePicker.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/BingDatePicker/BingDatePicker.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-f8860d48"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,26 @@
1
+ import { default as dayjs, Dayjs } from 'dayjs';
2
+ import { BingDatePickerType } from './BingDatePicker.types';
3
+ export type DatePeriodUnit = 'day' | 'month' | 'year';
4
+ export interface DatePickerShortcut {
5
+ label: string;
6
+ text: string;
7
+ value: Dayjs | [Dayjs, Dayjs];
8
+ }
9
+ export declare const defaultValueFormats: Record<BingDatePickerType, string>;
10
+ export declare function normalizeFirstDayOfWeek(value: number): number;
11
+ /** 从 0 开始、按步长递增且小于 `max` 的整数。 */
12
+ export declare function createStepOptions(max: number, step: number): number[];
13
+ /** 抹掉当前类型用不到的精度;`time` 统一落在 2000-01-01。 */
14
+ export declare function normalizeForType(value: Dayjs, type: BingDatePickerType): dayjs.Dayjs;
15
+ /** 按值格式严格解析,无效时返回 `null`。 */
16
+ export declare function parseDateValue(value: string | null | undefined, type: BingDatePickerType, format: string): dayjs.Dayjs | null;
17
+ /** 按类型精度比较两个值,返回值的正负表示先后。 */
18
+ export declare function compareTypedValue(value: Dayjs, target: Dayjs, type: BingDatePickerType, mode?: 'start' | 'end'): number;
19
+ export declare function getWeekdayLabels(locale: string, firstDayOfWeek: number): string[];
20
+ /** 月视图固定 6 行 × 7 列,从包含月初的那一周开始。 */
21
+ export declare function getCalendarCells(month: Dayjs, firstDayOfWeek: number): dayjs.Dayjs[];
22
+ export declare function getMonthCells(year: number): dayjs.Dayjs[];
23
+ /** 年份面板每页 12 年,起始年份为 12 的整数倍。 */
24
+ export declare function getYearBlockStart(year: number): number;
25
+ export declare function getYearCells(year: number): dayjs.Dayjs[];
26
+ export declare function createShortcuts(type: BingDatePickerType, range: boolean, now?: dayjs.Dayjs): DatePickerShortcut[];
@@ -0,0 +1,137 @@
1
+ import e from "dayjs";
2
+ import t from "dayjs/plugin/customParseFormat";
3
+ //#region src/components/BingDatePicker/BingDatePicker.utils.ts
4
+ e.extend(t);
5
+ var n = {
6
+ date: "YYYY-MM-DD",
7
+ datetime: "YYYY-MM-DD HH:mm:ss",
8
+ month: "YYYY-MM",
9
+ year: "YYYY",
10
+ time: "HH:mm:ss"
11
+ }, r = {
12
+ date: "day",
13
+ datetime: "second",
14
+ month: "month",
15
+ year: "year"
16
+ };
17
+ function i(e) {
18
+ return (Math.floor(e) % 7 + 7) % 7;
19
+ }
20
+ function a(e, t) {
21
+ let n = Math.max(1, Math.floor(t)), r = [];
22
+ for (let t = 0; t < e; t += n) r.push(t);
23
+ return r;
24
+ }
25
+ function o(e, t) {
26
+ let n = e.millisecond(0);
27
+ return t === "date" ? n.startOf("day") : t === "month" ? n.startOf("month") : t === "year" ? n.startOf("year") : t === "time" ? n.year(2e3).month(0).date(1) : n;
28
+ }
29
+ function s(t, n, r) {
30
+ if (!t) return null;
31
+ let i = n === "time" ? e(`2000-01-01 ${t}`, `YYYY-MM-DD ${r}`, !0) : e(t, r, !0);
32
+ return i.isValid() ? o(i, n) : null;
33
+ }
34
+ function c(e) {
35
+ return e.hour() * 3600 + e.minute() * 60 + e.second();
36
+ }
37
+ function l(e, t, n, i = "start") {
38
+ if (n === "time") return c(e) - c(t);
39
+ if (n === "datetime") return e.valueOf() - t.valueOf();
40
+ let a = r[n];
41
+ return (i === "end" ? e.endOf(a).valueOf() : e.startOf(a).valueOf()) - (i === "end" ? t.endOf(a).valueOf() : t.startOf(a).valueOf());
42
+ }
43
+ function u(t, n) {
44
+ let r = new Intl.DateTimeFormat(t, { weekday: "short" }), a = e("2024-01-07"), o = i(n);
45
+ return Array.from({ length: 7 }, (e, t) => r.format(a.add((o + t) % 7, "day").toDate()));
46
+ }
47
+ function d(e, t) {
48
+ let n = i(t), r = e.startOf("month"), a = (r.day() - n + 7) % 7, o = r.subtract(a, "day");
49
+ return Array.from({ length: 42 }, (e, t) => o.add(t, "day"));
50
+ }
51
+ function f(t) {
52
+ return Array.from({ length: 12 }, (n, r) => e().year(t).month(r).startOf("month"));
53
+ }
54
+ function p(e) {
55
+ return Math.floor(e / 12) * 12;
56
+ }
57
+ function m(t) {
58
+ let n = p(t);
59
+ return Array.from({ length: 12 }, (t, r) => e().year(n + r).startOf("year"));
60
+ }
61
+ function h(t, n, r = e()) {
62
+ let i = o(r, t);
63
+ if (!n) {
64
+ if (t === "date") return [{
65
+ label: "今天",
66
+ text: "今天",
67
+ value: i
68
+ }, {
69
+ label: "昨天",
70
+ text: "昨天",
71
+ value: i.subtract(1, "day").startOf("day")
72
+ }];
73
+ let e = t === "datetime" || t === "time" ? "此刻" : t === "month" ? "本月" : "今年";
74
+ return [{
75
+ label: e,
76
+ text: e,
77
+ value: i
78
+ }];
79
+ }
80
+ if (t === "month") return [{
81
+ label: "近6个月",
82
+ text: "近6个月",
83
+ value: [i.subtract(5, "month").startOf("month"), i.startOf("month")]
84
+ }, {
85
+ label: "今年",
86
+ text: "今年",
87
+ value: [i.startOf("year"), i.endOf("year").startOf("month")]
88
+ }];
89
+ if (t === "year") {
90
+ let t = Math.floor(i.year() / 10) * 10;
91
+ return [{
92
+ label: "近5年",
93
+ text: "近5年",
94
+ value: [i.subtract(4, "year").startOf("year"), i.startOf("year")]
95
+ }, {
96
+ label: "当前十年",
97
+ text: "当前十年",
98
+ value: [e().year(t).startOf("year"), e().year(t + 9).startOf("year")]
99
+ }];
100
+ }
101
+ if (t === "time") {
102
+ let n = (n) => o(e(`2000-01-01 ${n}`), t);
103
+ return [{
104
+ label: "上午",
105
+ text: "上午",
106
+ value: [n("09:00:00"), n("12:00:00")]
107
+ }, {
108
+ label: "工作时段",
109
+ text: "工作时段",
110
+ value: [n("09:00:00"), n("18:00:00")]
111
+ }];
112
+ }
113
+ return [
114
+ {
115
+ label: "近7天",
116
+ text: "近7天",
117
+ value: [i.subtract(6, "day").startOf("day"), i.endOf("day")]
118
+ },
119
+ {
120
+ label: "近30天",
121
+ text: "近30天",
122
+ value: [i.subtract(29, "day").startOf("day"), i.endOf("day")]
123
+ },
124
+ {
125
+ label: "本月",
126
+ text: "本月",
127
+ value: [i.startOf("month"), i.endOf("month")]
128
+ },
129
+ {
130
+ label: "今年",
131
+ text: "今年",
132
+ value: [i.startOf("year"), i.endOf("year")]
133
+ }
134
+ ];
135
+ }
136
+ //#endregion
137
+ export { l as compareTypedValue, h as createShortcuts, a as createStepOptions, n as defaultValueFormats, d as getCalendarCells, f as getMonthCells, u as getWeekdayLabels, p as getYearBlockStart, m as getYearCells, o as normalizeForType, s as parseDateValue };
@@ -1,38 +1,38 @@
1
1
  import { Dayjs } from 'dayjs';
2
- import { BingDatePickerChangePayload, BingDatePickerExpose, BingDatePickerModelValue, BingDatePickerProps, BingDatePickerType } from './BingDatePicker.types';
2
+ import { BingDatePickerChangePayload, BingDatePickerExpose, BingDatePickerModelValue, BingDatePickerProps } from './BingDatePicker.types';
3
3
  declare const __VLS_export: import('vue').DefineComponent<BingDatePickerProps, BingDatePickerExpose, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
4
- clear: () => any;
4
+ close: () => any;
5
+ confirm: (payload: BingDatePickerChangePayload) => any;
6
+ open: () => any;
5
7
  change: (payload: BingDatePickerChangePayload) => any;
8
+ clear: () => any;
6
9
  cancel: () => any;
7
- close: () => any;
8
10
  "update:modelValue": (value: BingDatePickerModelValue) => any;
9
- open: () => any;
10
- confirm: (payload: BingDatePickerChangePayload) => any;
11
11
  }, string, import('vue').PublicProps, Readonly<BingDatePickerProps> & Readonly<{
12
- onClear?: (() => any) | undefined;
12
+ onClose?: (() => any) | undefined;
13
+ onConfirm?: ((payload: BingDatePickerChangePayload) => any) | undefined;
14
+ onOpen?: (() => any) | undefined;
13
15
  onChange?: ((payload: BingDatePickerChangePayload) => any) | undefined;
16
+ onClear?: (() => any) | undefined;
14
17
  onCancel?: (() => any) | undefined;
15
- onClose?: (() => any) | undefined;
16
18
  "onUpdate:modelValue"?: ((value: BingDatePickerModelValue) => any) | undefined;
17
- onOpen?: (() => any) | undefined;
18
- onConfirm?: ((payload: BingDatePickerChangePayload) => any) | undefined;
19
19
  }>, {
20
+ status: "default" | "error" | "success" | "warning";
20
21
  disabled: boolean;
21
22
  minWidth: string | number;
22
23
  id: string;
23
- type: BingDatePickerType;
24
+ type: import('./BingDatePicker.types').BingDatePickerType;
24
25
  size: import('./BingDatePicker.types').BingDatePickerSize;
25
26
  block: boolean;
26
27
  ariaLabel: string;
27
- modelValue: BingDatePickerModelValue;
28
- min: string;
29
28
  max: string;
29
+ min: string;
30
+ format: string;
31
+ modelValue: BingDatePickerModelValue;
30
32
  placeholder: string;
31
33
  clearable: boolean;
32
34
  ariaDescribedby: string;
33
- status: "default" | "error" | "success" | "warning";
34
35
  range: boolean;
35
- format: string;
36
36
  glass: boolean;
37
37
  glassBlur: string | number;
38
38
  glassOpacity: number;