@baishuyun/ui-base 6.10.0 → 6.11.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 (181) hide show
  1. package/dist/Amap/{Amap-BNnmSPnl.js → Amap-BLSziesG.js} +1 -1
  2. package/dist/Amap/AmapCircle/index.js +4 -4
  3. package/dist/Amap/{AmapCircle-BDW6pnNR.js → AmapCircle-2qupysHe.js} +1 -1
  4. package/dist/Amap/AmapMarker/index.js +5 -5
  5. package/dist/Amap/{AmapMarker-CdoPWdff.js → AmapMarker-xEqoVnFR.js} +2 -2
  6. package/dist/Amap/AmapMarkerCluster/index.js +5 -5
  7. package/dist/Amap/{AmapMarkerCluster-CSIxiVC5.js → AmapMarkerCluster-CvEQa3o9.js} +2 -2
  8. package/dist/Amap/AmapProvider/index.js +6 -5
  9. package/dist/Amap/{AmapProvider-Cwi6WOe0.js → AmapProvider-CvRHhN42.js} +2 -2
  10. package/dist/Amap/hooks/index.js +3 -3
  11. package/dist/Amap/{hooks-DAN31s_-.js → hooks-BTcFpdd0.js} +1 -1
  12. package/dist/Amap/index.js +12 -11
  13. package/dist/Calendar/{AllDaySection-DNsVyixx.js → AllDaySection-BqbcPQls.js} +3 -3
  14. package/dist/Calendar/{Calendar-DL2X3z_z.js → Calendar-BS0nzK4h.js} +12 -13
  15. package/dist/Calendar/{CurrentTimeIndicator-twXtFHIp.js → CurrentTimeIndicator-dRYot1Rk.js} +24 -18
  16. package/dist/Calendar/{EventCard-CvEnWcKd.js → EventCard-Di5UX4pB.js} +3 -4
  17. package/dist/Calendar/{TimeGrid-D62R57Bo.js → TimeGrid-CBpDFAM4.js} +1 -1
  18. package/dist/Calendar/context/index.js +2 -2
  19. package/dist/Calendar/index.js +21 -20
  20. package/dist/Calendar/subcomponents/AllDaySection/index.js +8 -7
  21. package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +6 -5
  22. package/dist/Calendar/subcomponents/EventCard/index.js +7 -6
  23. package/dist/Calendar/subcomponents/TimeAxis/index.js +4 -4
  24. package/dist/Calendar/subcomponents/TimeGrid/index.js +4 -3
  25. package/dist/Calendar/{theme-BRVmxhqD.js → theme-i60ueO92.js} +2 -2
  26. package/dist/Calendar/utils/index.js +4 -4
  27. package/dist/Calendar/utils/layout/index.js +3 -3
  28. package/dist/Calendar/utils/theme/index.js +2 -2
  29. package/dist/Card/index.js +2 -2
  30. package/dist/CheckBox/{CheckBox-CcM19LnP.js → CheckBox-nBm0u6zX.js} +1 -1
  31. package/dist/CheckBox/index.js +3 -3
  32. package/dist/ColorPicker/ColorPicker-DVwg07Gs.js +174 -0
  33. package/dist/ColorPicker/index.js +7 -6
  34. package/dist/ConfigProvider/index.js +4 -3
  35. package/dist/DatePicker/DatePicker-DNPnHLT2.js +101 -0
  36. package/dist/DatePicker/{DatePickerPanel-Bz3uvbYF.js → DatePickerPanel-TS6AxAH-.js} +5 -5
  37. package/dist/DatePicker/index.js +10 -9
  38. package/dist/DatePicker/style/index.js +2 -2
  39. package/dist/DatePicker/{style-BwmM26RP.js → style-UKXn1N_p.js} +1 -1
  40. package/dist/DropDown/DropDown-DWf5yf4l.js +178 -0
  41. package/dist/DropDown/index.js +11 -10
  42. package/dist/DropDown/style/index.js +2 -2
  43. package/dist/DropDown/{style-BSgosymi.js → style-LLDVPpPa.js} +1 -1
  44. package/dist/Editor/Buttons-BBioCubp.js +1148 -0
  45. package/dist/Editor/ToolbarPlugin/Buttons/index.js +17 -16
  46. package/dist/Editor/constants/index.js +3 -3
  47. package/dist/Editor/index.js +1015 -257
  48. package/dist/Gantt/GanttChart/index.js +18 -17
  49. package/dist/Gantt/{GanttChart-6gpw5vi6.js → GanttChart-BaEW7EDO.js} +8 -10
  50. package/dist/Gantt/GanttTable/index.js +11 -11
  51. package/dist/Gantt/{GanttTable-lVu-YUtt.js → GanttTable-CdXhMHF6.js} +5 -5
  52. package/dist/Gantt/GanttToolBar/index.js +14 -13
  53. package/dist/Gantt/{GanttToolBar-CarBWZg-.js → GanttToolBar-COwsYlMG.js} +3 -4
  54. package/dist/Gantt/{collapseKeys-_ShTXPKt.js → collapseKeys-B4SOVHjd.js} +2 -2
  55. package/dist/Gantt/index.js +26 -25
  56. package/dist/Gantt/{theme-CiMD9Y6i.js → theme-2LyXJRDe.js} +1 -1
  57. package/dist/Gantt/{timelineViewConfig-CLIpppp0.js → timelineViewConfig-9HArvbmb.js} +1 -1
  58. package/dist/Gantt/utils/index.js +6 -6
  59. package/dist/Gantt/utils/theme/index.js +2 -2
  60. package/dist/Icon/index.js +1 -1
  61. package/dist/InputTag/{InputTag-DxPO0DwD.js → InputTag-Jpm8H32L.js} +2 -2
  62. package/dist/InputTag/index.js +5 -5
  63. package/dist/Loading/{Loading-CVyzO5-s.js → Loading-CiRe7i2R.js} +1 -1
  64. package/dist/Loading/index.js +4 -4
  65. package/dist/Modal/Modal-Cb7Msq26.js +96 -0
  66. package/dist/Modal/index.js +3 -2
  67. package/dist/NotFoundContent/index.js +2 -2
  68. package/dist/Overlay/OverlayContext-CVSFoyqN.js +23 -0
  69. package/dist/Overlay/index.js +3 -0
  70. package/dist/Radio/index.js +2 -2
  71. package/dist/ScrollBar/{ScrollBar-CnwYQfXM.js → ScrollBar-N2pOLv-8.js} +1 -1
  72. package/dist/ScrollBar/index.js +2 -2
  73. package/dist/Segmented/{Segmented-Ck2ZmfF7.js → Segmented-BCQRrc65.js} +1 -1
  74. package/dist/Segmented/index.js +2 -2
  75. package/dist/Select/Select-BY5Rpo3f.js +753 -0
  76. package/dist/Select/{SelectInputSearch-CrGW_eVo.js → SelectInputSearch-i3egm8Wy.js} +1 -1
  77. package/dist/Select/index.js +14 -13
  78. package/dist/Table/{Table-CL-KfNY3.js → Table-CSPdFGYn.js} +5 -5
  79. package/dist/Table/hooks/index.js +2 -2
  80. package/dist/Table/{hooks-uCDY9dqx.js → hooks-BceUZQQm.js} +1 -1
  81. package/dist/Table/index.js +8 -8
  82. package/dist/Table/{processRowspan-nIGqGyHh.js → processRowspan-B0WELhG2.js} +1 -1
  83. package/dist/Table/style/index.js +2 -2
  84. package/dist/Table/{style-x9xfw6te.js → style-C4wp0IOM.js} +1 -1
  85. package/dist/Table/utils/index.js +2 -2
  86. package/dist/Tabs/Tabs-C0m3mt-j.js +413 -0
  87. package/dist/Tabs/index.js +6 -5
  88. package/dist/Tooltip/Tooltip-Bb3Jx-If.js +172 -0
  89. package/dist/Tooltip/index.js +3 -2
  90. package/dist/Tree/index.js +4 -4
  91. package/dist/Tree/utils/index.js +1 -1
  92. package/dist/components/ColorPicker/ColorPalettes.d.ts +2 -0
  93. package/dist/components/ColorPicker/ColorPicker.type.d.ts +1 -7
  94. package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +2 -0
  95. package/dist/components/DatePicker/interface.d.ts +2 -0
  96. package/dist/components/Editor/ToolbarPlugin/Buttons/BulletListButton.d.ts +2 -0
  97. package/dist/components/Editor/ToolbarPlugin/Buttons/CodeButton.d.ts +2 -0
  98. package/dist/components/Editor/ToolbarPlugin/Buttons/CodeLanguageButton.d.ts +2 -0
  99. package/dist/components/Editor/ToolbarPlugin/Buttons/HeadingButton.d.ts +2 -0
  100. package/dist/components/Editor/ToolbarPlugin/Buttons/IndentButton.d.ts +2 -0
  101. package/dist/components/Editor/ToolbarPlugin/Buttons/NumberListButton.d.ts +2 -0
  102. package/dist/components/Editor/ToolbarPlugin/Buttons/OutdentButton.d.ts +2 -0
  103. package/dist/components/Editor/ToolbarPlugin/Buttons/RedoButton.d.ts +2 -0
  104. package/dist/components/Editor/ToolbarPlugin/Buttons/SourceButton.d.ts +2 -0
  105. package/dist/components/Editor/ToolbarPlugin/Buttons/StrikeThroughButton.d.ts +2 -0
  106. package/dist/components/Editor/ToolbarPlugin/Buttons/SubscriptButton.d.ts +2 -0
  107. package/dist/components/Editor/ToolbarPlugin/Buttons/SuperscriptButton.d.ts +2 -0
  108. package/dist/components/Editor/ToolbarPlugin/Buttons/TableButton.d.ts +2 -0
  109. package/dist/components/Editor/ToolbarPlugin/Buttons/UndoButton.d.ts +2 -0
  110. package/dist/components/Editor/ToolbarPlugin/Buttons/index.d.ts +13 -0
  111. package/dist/components/Editor/ToolbarPlugin/context/HistoryStateProvider.d.ts +8 -0
  112. package/dist/components/Editor/ToolbarPlugin/context/TextFormatsContext.d.ts +10 -1
  113. package/dist/components/Editor/ToolbarPlugin/icons/ToolbarIcon.d.ts +13 -0
  114. package/dist/components/Editor/constants/codeLanguages.d.ts +69 -0
  115. package/dist/components/Editor/constants/index.d.ts +3 -0
  116. package/dist/components/Editor/context/EditorContainerContext.d.ts +0 -1
  117. package/dist/components/Editor/context/SourceModeContext.d.ts +9 -0
  118. package/dist/components/Editor/htmlConfig.d.ts +2 -0
  119. package/dist/components/Editor/interface.d.ts +1 -1
  120. package/dist/components/Editor/plugins/CodeHighlightPlugin.d.ts +1 -0
  121. package/dist/components/Editor/plugins/HeadingPlugin.d.ts +3 -0
  122. package/dist/components/Editor/plugins/LinkColorPlugin.d.ts +2 -0
  123. package/dist/components/Editor/plugins/PasteStripImagePlugin.d.ts +1 -0
  124. package/dist/components/Editor/plugins/SourceModePlugin.d.ts +7 -0
  125. package/dist/components/Editor/plugins/TabIndentPlugin.d.ts +1 -0
  126. package/dist/components/Editor/plugins/TablePlugin.d.ts +1 -0
  127. package/dist/components/Editor/utils/codeHighlighter.d.ts +12 -0
  128. package/dist/components/Editor/utils/fillRootFromHtml.d.ts +2 -0
  129. package/dist/components/Editor/utils/formatEditorHtml.d.ts +1 -0
  130. package/dist/components/Editor/utils/formatTruncatedFilename.d.ts +4 -0
  131. package/dist/components/Editor/utils/isEmptyEditorHtml.d.ts +1 -0
  132. package/dist/components/Editor/utils/sanitizeEditorHtml.d.ts +1 -0
  133. package/dist/components/Editor/utils/stripImagesFromHtml.d.ts +1 -0
  134. package/dist/components/Editor/utils/stripInlineStyleProperty.d.ts +2 -0
  135. package/dist/components/Editor/utils/writeHtmlSource.d.ts +1 -0
  136. package/dist/components/Overlay/OverlayContext.d.ts +16 -0
  137. package/dist/components/Overlay/index.d.ts +2 -0
  138. package/dist/components/Tooltip/Tooltip.type.d.ts +1 -1
  139. package/dist/components/index.d.ts +2 -0
  140. package/dist/index.js +53 -51
  141. package/dist/locale/lang/en-US.json.d.ts +21 -2
  142. package/dist/locale/lang/zh-CN.json.d.ts +21 -2
  143. package/dist/locale/lang/zh-TW.json.d.ts +21 -2
  144. package/dist/style.css +1 -1
  145. package/dist/vendors/{ConfigProvider-DxrZpdIb.js → ConfigProvider-4xHyyeop.js} +84 -36
  146. package/dist/vendors/{LocaleContext-Dcw6C1LX.js → LocaleContext-I4PW9j4M.js} +21 -2
  147. package/dist/vendors/{Tree-D1s-eADo.js → Tree-B09frqQX.js} +3 -2
  148. package/dist/vendors/{useLocale-BKZX2_zw.js → useLocale-FGYsRWSe.js} +1 -1
  149. package/dist/vendors/{version-L-kG2La0.js → version-BxI5QM5W.js} +1 -1
  150. package/package.json +10 -1
  151. package/dist/ColorPicker/ColorPicker-D3JuQ7a7.js +0 -153
  152. package/dist/DatePicker/DatePicker-Dah_CjYG.js +0 -96
  153. package/dist/DropDown/DropDown-Daxr9BYf.js +0 -171
  154. package/dist/Editor/Buttons-DG_-Sg_C.js +0 -600
  155. package/dist/Modal/Modal-LiztSF7x.js +0 -92
  156. package/dist/Select/Select-CBI5PgeQ.js +0 -746
  157. package/dist/Tabs/Tabs-B1RsYb2W.js +0 -409
  158. package/dist/Tooltip/Tooltip-DWWWYn1a.js +0 -168
  159. /package/dist/Amap/{AmapContext-D7Njjm5a.js → AmapContext-CJBe6lld.js} +0 -0
  160. /package/dist/Amap/{useMarkerInfoWindowController-BQmhR0N7.js → useMarkerInfoWindowController-Cjx0xQXw.js} +0 -0
  161. /package/dist/Calendar/{TimeAxis-D7bgZDKs.js → TimeAxis-C9e2BdYs.js} +0 -0
  162. /package/dist/Calendar/{colorUtils-lXNjGoCk.js → colorUtils-CBLTsDX0.js} +0 -0
  163. /package/dist/Calendar/{context-CBJnz0IH.js → context-4tCN5X33.js} +0 -0
  164. /package/dist/Calendar/{layout-BglMom3m.js → layout-Dz-grtu9.js} +0 -0
  165. /package/dist/Card/{Card-CtKLNh3n.js → Card-Ds5Rpq--.js} +0 -0
  166. /package/dist/CheckBox/{CheckBox-Bb0UuX1Y.js → CheckBox-ByWSy9Yr.js} +0 -0
  167. /package/dist/DatePicker/{ensureDayjsPlugins-CVL-fnAl.js → ensureDayjsPlugins-Cn9Bkjkj.js} +0 -0
  168. /package/dist/DatePicker/{pickerLocale-BeMlfhKu.js → pickerLocale-BRnNjLcv.js} +0 -0
  169. /package/dist/Gantt/{GanttHighlightContext-grda5bhd.js → GanttHighlightContext-ChThr8ia.js} +0 -0
  170. /package/dist/Gantt/{columnResize-DV1tSBx_.js → columnResize-jG0Wy2PC.js} +0 -0
  171. /package/dist/Gantt/{constants-BObDP0h6.js → constants-LIz5jwed.js} +0 -0
  172. /package/dist/Gantt/{highlightTarget-DrP0_NrM.js → highlightTarget-BpkYTonb.js} +0 -0
  173. /package/dist/NotFoundContent/{NotFoundContent-J-TEnljc.js → NotFoundContent-BLmzWNBi.js} +0 -0
  174. /package/dist/Radio/{Radio-CBUZ7DB5.js → Radio-CX9cUqb7.js} +0 -0
  175. /package/dist/Table/{constants-CcwjDbe7.js → constants-kRpjsoet.js} +0 -0
  176. /package/dist/vendors/{animations-Mlw78WYo.js → animations-rwUbyoT0.js} +0 -0
  177. /package/dist/vendors/{cssVars-B8o94Yao.js → cssVars-l4-kP_14.js} +0 -0
  178. /package/dist/vendors/{mergeRefs-Bai1cIzv.js → mergeRefs-TiJ0xjUN.js} +0 -0
  179. /package/dist/vendors/{useFloatingOverlay-BApqkHSu.js → useFloatingOverlay-B3M9k8nj.js} +0 -0
  180. /package/dist/vendors/{useFloatingPortal-C8V67X0v.js → useFloatingPortal-CmVJbuRm.js} +0 -0
  181. /package/dist/vendors/{useLatchedPopupPortalRoot-hwf14FJ5.js → useLatchedPopupPortalRoot-4fVhqVT4.js} +0 -0
@@ -1,409 +0,0 @@
1
- import { t as e } from "../Icon/Icon-BBDcb-yw.js";
2
- import { t } from "../vendors/useLocale-BKZX2_zw.js";
3
- import { n } from "../vendors/animations-Mlw78WYo.js";
4
- import { t as r } from "../vendors/useFloatingPortal-C8V67X0v.js";
5
- import { isString as i } from "lodash-es";
6
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { createContext as c, useCallback as l, useContext as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
8
- import h from "clsx";
9
- import { useControllableValue as g, useEventListener as _, useMutationObserver as v, useToggle as y } from "ahooks";
10
- import { AnimatePresence as b, motion as x } from "motion/react";
11
- import { FloatingPortal as S } from "@floating-ui/react";
12
- import "tinycolor2";
13
- //#region src/components/Tabs/constants.ts
14
- var C = {
15
- LINE: "line",
16
- CARD: "card",
17
- FILLED_CARD: "filled-card",
18
- BADGE_CARD: "badge-card"
19
- }, w = c({
20
- color: "#0269ff",
21
- type: C.LINE
22
- }), T = "_active_1oc43_18", E = "_disabled_1oc43_26", D = "_line_1oc43_44", O = "_card_1oc43_53", k = {
23
- "bsy-tab": "_bsy-tab_1oc43_1",
24
- "badge-card": "_badge-card_1oc43_9",
25
- active: T,
26
- disabled: E,
27
- line: D,
28
- card: O,
29
- "filled-card": "_filled-card_1oc43_78"
30
- };
31
- //#endregion
32
- //#region src/utils/color.ts
33
- function A(e, t) {
34
- if (t < 0 || t > 1) return console.error("Alpha value must be between 0 and 1."), null;
35
- e = e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (e, t, n, r) => t + t + n + n + r + r);
36
- let n = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
37
- return n ? `rgba(${parseInt(n[1], 16)}, ${parseInt(n[2], 16)}, ${parseInt(n[3], 16)}, ${t})` : (console.error("Invalid HEX color format."), null);
38
- }
39
- //#endregion
40
- //#region src/components/Tabs/Tab/Tab.tsx
41
- var j = (e, t = 24) => e.length <= t ? e : e.slice(0, t) + "...", M = (e) => typeof e == "string" ? j(e) : e, N = ({ label: e, active: t = !1, onClick: n, tabKey: r }) => {
42
- let { type: a = C.LINE, disabled: s, color: c } = u(w), l = i(e) ? e : "", d = () => {
43
- s || n?.(r);
44
- }, f = {
45
- "data-tab-item": !0,
46
- "data-tab-key": r,
47
- role: "tab",
48
- "aria-selected": t,
49
- "aria-controls": `panel-${r}`,
50
- onClick: d
51
- };
52
- return a === C.LINE ? /* @__PURE__ */ o("div", {
53
- ...f,
54
- className: h(k["bsy-tab"], k.line, {
55
- [k.disabled]: s,
56
- [k.active]: t
57
- }),
58
- title: l,
59
- children: M(e)
60
- }) : a === C.CARD ? /* @__PURE__ */ o("div", {
61
- ...f,
62
- className: h(k["bsy-tab"], k.card, {
63
- [k.active]: t,
64
- [k.disabled]: s
65
- }),
66
- title: l,
67
- style: { "--theme-bg-color": A(c, .1) },
68
- children: /* @__PURE__ */ o("span", { children: M(e) })
69
- }) : a === C.FILLED_CARD ? /* @__PURE__ */ o("div", {
70
- ...f,
71
- className: h(k["bsy-tab"], k["filled-card"], {
72
- [k.active]: t,
73
- [k.disabled]: s
74
- }),
75
- title: l,
76
- children: M(e)
77
- }) : a === C.BADGE_CARD ? /* @__PURE__ */ o("div", {
78
- ...f,
79
- className: h(k["bsy-tab"], k["badge-card"], {
80
- [k.active]: t,
81
- [k.disabled]: s
82
- }),
83
- title: l,
84
- children: /* @__PURE__ */ o("span", { children: M(e) })
85
- }) : null;
86
- };
87
- N.displayName = "BsyTab";
88
- //#endregion
89
- //#region src/components/Tabs/TabList/useTabScroll.ts
90
- var P = ({ disabled: e, children: t }) => {
91
- let n = p(null), r = p(null), [i, a] = m(!1), [o, s] = m(!1), [c, u] = m(!1), [f, h] = m(0), g = l(() => {
92
- let e = n.current, t = r.current;
93
- if (!e || !t) return;
94
- let i = e.clientWidth, o = t.scrollWidth, c = o > i;
95
- a(c), c ? (s(f < 0), u(f > -(o - i))) : (s(!1), u(!1), h(0));
96
- }, [f]);
97
- return _("resize", () => g()), d(() => {
98
- g();
99
- }, [
100
- f,
101
- t,
102
- g
103
- ]), {
104
- listRef: n,
105
- wrapperRef: r,
106
- showControls: i,
107
- canScrollLeft: o,
108
- canScrollRight: c,
109
- translateX: f,
110
- scrollLeft: () => {
111
- if (!o || e) return;
112
- let t = n.current;
113
- if (!t) return;
114
- let r = t.clientWidth * .6;
115
- h(Math.min(0, f + r));
116
- },
117
- scrollRight: () => {
118
- if (!c || e) return;
119
- let t = n.current, i = r.current;
120
- if (!t || !i) return;
121
- let a = t.clientWidth * .6, o = t.clientWidth, s = -(i.scrollWidth - o);
122
- h(Math.max(s, f - a));
123
- }
124
- };
125
- }, F = ({ activeKey: e, type: t, showIndicator: n, wrapperRef: r, items: i }) => {
126
- let [a, o] = m({
127
- width: 0,
128
- left: 0,
129
- ready: !1
130
- }), s = l((e) => {
131
- if (!n || !r.current) return;
132
- let t = r.current.getBoundingClientRect(), i = e.getBoundingClientRect(), a = i.left - t.left, s = i.width;
133
- o({
134
- width: s,
135
- left: a,
136
- ready: !0
137
- });
138
- }, [n, r]);
139
- return d(() => {
140
- if (!e || !r.current) return;
141
- let t = r.current.querySelector(`[data-tab-key="${e}"]`);
142
- t && n && s(t);
143
- }, [
144
- e,
145
- n,
146
- r,
147
- s,
148
- t,
149
- i
150
- ]), v(() => {
151
- if (!n) return;
152
- let e = r.current?.querySelector("[aria-selected=\"true\"]");
153
- e && s(e);
154
- }, r, {
155
- subtree: !0,
156
- characterData: !0
157
- }), {
158
- indicatorStyle: a,
159
- handleTabClick: (e) => {
160
- s(e);
161
- }
162
- };
163
- }, I = ({ children: e, activeKey: n, className: r, style: i, items: a }) => {
164
- let { t: c } = t(), { type: l = C.LINE, color: d, disabled: f } = u(w), p = [C.LINE, C.CARD].includes(l), { listRef: m, wrapperRef: g, showControls: _, canScrollLeft: v, canScrollRight: y, translateX: b, scrollLeft: x, scrollRight: S } = P({
165
- disabled: f,
166
- children: e
167
- }), { indicatorStyle: T, handleTabClick: E } = F({
168
- activeKey: n,
169
- type: l,
170
- showIndicator: p,
171
- wrapperRef: g,
172
- items: a
173
- }), D = T.ready, O = (e) => {
174
- if (f) return;
175
- let t = e.target.closest("[data-tab-item]");
176
- t && E(t);
177
- };
178
- return /* @__PURE__ */ s("div", {
179
- className: h("relative max-h-[36px]", r),
180
- style: i,
181
- children: [
182
- _ && /* @__PURE__ */ o("button", {
183
- className: h("absolute left-0 top-0 bottom-0 z-10 w-8 flex items-center justify-center", {
184
- "text-gray-400 cursor-not-allowed": !v || f,
185
- "text-gray-600": v && !f
186
- }),
187
- onClick: x,
188
- disabled: !v || f,
189
- "aria-label": c("tabs.scrollPrev"),
190
- children: /* @__PURE__ */ o("svg", {
191
- className: "w-4 h-4",
192
- fill: "none",
193
- stroke: "currentColor",
194
- viewBox: "0 0 24 24",
195
- children: /* @__PURE__ */ o("path", {
196
- strokeLinecap: "round",
197
- strokeLinejoin: "round",
198
- strokeWidth: 2,
199
- d: "M15 19l-7-7 7-7"
200
- })
201
- })
202
- }),
203
- /* @__PURE__ */ o("div", {
204
- className: h({
205
- "pl-8": _,
206
- "pr-8": _
207
- }),
208
- children: /* @__PURE__ */ o("div", {
209
- ref: m,
210
- className: h("overflow-hidden", {
211
- "border-b border-[#e0e0e0]": l === C.LINE,
212
- "border-b-2": l === C.FILLED_CARD || l === C.BADGE_CARD,
213
- "pb-[2px]": l === C.BADGE_CARD
214
- }),
215
- style: { borderColor: l === C.LINE ? void 0 : d },
216
- children: /* @__PURE__ */ s("div", {
217
- ref: g,
218
- role: "tablist",
219
- className: h("relative text-sm flex flex-nowrap", {
220
- "gap-x-[26px]": l === C.LINE,
221
- "gap-x-[10px]": l === C.FILLED_CARD || l === C.BADGE_CARD,
222
- "bg-[#f0f0f0]": l === C.CARD
223
- }),
224
- onClick: O,
225
- style: {
226
- "--theme-color": d,
227
- transform: `translateX(${b}px)`,
228
- transition: "transform 0.3s ease-in-out"
229
- },
230
- children: [e, p && T.ready && /* @__PURE__ */ o("div", {
231
- className: h("absolute h-0.5", {
232
- "bottom-0": l === C.LINE,
233
- "top-0": l === C.CARD,
234
- "transition-all duration-300 ease-in-out": D
235
- }),
236
- style: {
237
- backgroundColor: d,
238
- width: `${T.width}px`,
239
- left: `${T.left}px`
240
- }
241
- })]
242
- })
243
- })
244
- }),
245
- _ && /* @__PURE__ */ o("button", {
246
- className: h("absolute right-0 top-0 bottom-0 z-10 w-8 flex items-center justify-center", {
247
- "text-gray-400 cursor-not-allowed": !y || f,
248
- "text-gray-600": y && !f
249
- }),
250
- onClick: S,
251
- disabled: !y || f,
252
- "aria-label": c("tabs.scrollNext"),
253
- children: /* @__PURE__ */ o("svg", {
254
- className: "w-4 h-4",
255
- fill: "none",
256
- stroke: "currentColor",
257
- viewBox: "0 0 24 24",
258
- children: /* @__PURE__ */ o("path", {
259
- strokeLinecap: "round",
260
- strokeLinejoin: "round",
261
- strokeWidth: 2,
262
- d: "M9 5l7 7-7 7"
263
- })
264
- })
265
- })
266
- ]
267
- });
268
- };
269
- I.displayName = "BsyTabList";
270
- //#endregion
271
- //#region src/components/Tabs/TabPanel/TabPanel.tsx
272
- var L = ({ items: e, activeKey: t, className: n }) => {
273
- let r = e.find((e) => e.key === t);
274
- return !r || !r.children ? null : /* @__PURE__ */ o("div", {
275
- className: n,
276
- role: "tabpanel",
277
- "aria-labelledby": `tab-${t}`,
278
- children: r.children
279
- });
280
- };
281
- L.displayName = "BsyTabPanel";
282
- //#endregion
283
- //#region src/components/Tabs/Tabs.tsx
284
- var R = (e) => {
285
- let [t, n] = g(e, {
286
- defaultValuePropName: "defaultActiveKey",
287
- valuePropName: "activeKey",
288
- trigger: "onChange"
289
- }), r = e.items?.some((e) => e.children), i = e.color || "#0265ff";
290
- return /* @__PURE__ */ o(w.Provider, {
291
- value: {
292
- color: i,
293
- type: e.type,
294
- disabled: e.disabled
295
- },
296
- children: /* @__PURE__ */ s("div", {
297
- className: "bsy-tabs",
298
- children: [/* @__PURE__ */ o(I, {
299
- items: e.items,
300
- activeKey: t,
301
- children: e.items?.map((e) => /* @__PURE__ */ o(N, {
302
- tabKey: e.key,
303
- label: e.label,
304
- active: t === e.key,
305
- onClick: (e) => n(e)
306
- }, e.key))
307
- }), r && e.items && /* @__PURE__ */ o(L, {
308
- items: e.items,
309
- activeKey: t,
310
- className: "bsy-tabs__content"
311
- })]
312
- })
313
- });
314
- };
315
- R.displayName = "BsyTabs";
316
- //#endregion
317
- //#region src/components/Tabs/TabSelect/tabSelect.module.scss
318
- var z = "_active_5a1wn_11", B = "_icon_5a1wn_45", V = {
319
- "bsy-tabs-select__trigger": "_bsy-tabs-select__trigger_5a1wn_1",
320
- active: z,
321
- "bsy-tabs-select__trigger-icon": "_bsy-tabs-select__trigger-icon_5a1wn_14",
322
- "bsy-tabs-select__trigger-input": "_bsy-tabs-select__trigger-input_5a1wn_17",
323
- "bsy-tabs-select__panel": "_bsy-tabs-select__panel_5a1wn_21",
324
- "bsy-tabs-select__panel-item": "_bsy-tabs-select__panel-item_5a1wn_32",
325
- icon: B
326
- }, H = (i) => {
327
- let { color: c = "#0269ff" } = i, { t: l } = t(), [u, { toggle: d, setLeft: p }] = y(!1), { refs: m, floatingStyles: _, getFloatingProps: v, getReferenceProps: w, referenceStyle: T } = r({
328
- isOpen: u,
329
- close: p,
330
- offset: {
331
- x: 0,
332
- y: 4
333
- },
334
- zIndex: 1e3
335
- }), [E, D] = g(i, {
336
- trigger: "onChange",
337
- defaultValuePropName: "defaultValue",
338
- valuePropName: "value",
339
- defaultValue: C.LINE
340
- }), O = Object.values(C).map((e) => ({
341
- label: e,
342
- value: e
343
- })), k = f(() => [
344
- {
345
- label: l("tabs.previewTab1"),
346
- key: "1"
347
- },
348
- {
349
- label: l("tabs.previewTab2"),
350
- key: "2"
351
- },
352
- {
353
- label: l("tabs.previewTab3"),
354
- key: "3"
355
- }
356
- ], [l]);
357
- return /* @__PURE__ */ s("div", {
358
- className: V["bsy-tabs-select"],
359
- children: [/* @__PURE__ */ s("div", {
360
- className: h(V["bsy-tabs-select__trigger"], { [V.active]: u }),
361
- ref: m.setReference,
362
- ...w(),
363
- style: T,
364
- onClick: () => d(),
365
- children: [/* @__PURE__ */ o("div", {
366
- className: h(V["bsy-tabs-select__trigger-input"], { [V.active]: E }),
367
- children: E && /* @__PURE__ */ o(R, {
368
- activeKey: "1",
369
- type: E,
370
- color: c,
371
- disabled: !0,
372
- items: k
373
- }, E)
374
- }), /* @__PURE__ */ o("div", {
375
- className: V["bsy-tabs-select__trigger-icon"],
376
- children: /* @__PURE__ */ o(e, {
377
- name: "arrow-down",
378
- className: h(V.icon, { active: u })
379
- })
380
- })]
381
- }), /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(b, { children: u && /* @__PURE__ */ o(a, { children: /* @__PURE__ */ o("div", {
382
- ref: m.setFloating,
383
- style: _,
384
- ...v(),
385
- children: /* @__PURE__ */ o(x.div, {
386
- ...n,
387
- children: /* @__PURE__ */ o("div", {
388
- className: V["bsy-tabs-select__panel"],
389
- children: O.map((e) => /* @__PURE__ */ o("div", {
390
- className: h(V["bsy-tabs-select__panel-item"], { [V.active]: E === e.value }),
391
- onClick: () => {
392
- D(e.value), p();
393
- },
394
- children: /* @__PURE__ */ o(R, {
395
- activeKey: "1",
396
- type: e.value,
397
- disabled: !0,
398
- color: c,
399
- items: k
400
- }, e.value)
401
- }, e.value))
402
- })
403
- })
404
- }) }) }) })]
405
- });
406
- };
407
- H.displayName = "BsyTabSelect";
408
- //#endregion
409
- export { C as i, R as n, L as r, H as t };
@@ -1,168 +0,0 @@
1
- import { n as e } from "../vendors/mergeRefs-Bai1cIzv.js";
2
- import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
3
- import { Fragment as i, cloneElement as ee, createContext as a, isValidElement as te, useCallback as ne, useEffect as re, useMemo as o, useRef as ie, useState as s } from "react";
4
- import { useControllableValue as c } from "ahooks";
5
- import { FloatingArrow as l, FloatingPortal as u, arrow as d, autoUpdate as f, flip as p, offset as m, safePolygon as h, shift as g, size as _, useClick as v, useDismiss as y, useFloating as ae, useHover as oe, useInteractions as se, useRole as ce, useTransitionStyles as le } from "@floating-ui/react";
6
- //#region src/components/Tooltip/context/TooltipFloatingContext.ts
7
- var b = a(null), x = {
8
- "bsy-tooltip": "_bsy-tooltip_bqmfs_1",
9
- "bsy-tooltip__trigger": "_bsy-tooltip__trigger_bqmfs_4",
10
- "bsy-tooltip__content": "_bsy-tooltip__content_bqmfs_8"
11
- }, ue = "M0 14C0 14 1.44834 13.9879 4.14272 10.7864C5.24990 9.46652 6.28557 8.66663 7.0002 8.66663C7.71415 8.66663 8.73670 9.55158 9.85697 10.8831C12.5664 14.1005 14 14 14 14H0Z", de = "#525867", S = (e, t) => e ? t ? (n) => {
12
- e(n), t(n);
13
- } : e : t, C = (e) => {
14
- if (!(e === "auto" || e === void 0)) return typeof e == "number" ? `${e}px` : e;
15
- }, fe = (e) => e.type === i || (e.type?.toString().includes("Fragment") ?? !1), w = ({ children: i, content: a, trigger: w = "hover", style: T, zIndex: E, showArrow: D = !0, placement: O = "bottom", onClose: k, hoverDelay: A = 500, getPopupContainer: j, moveToFloatingKeepOpen: M = !1, widthMode: N = "content", width: P, minWidth: F = 60, maxWidth: I = 340, offset: L = 10, fallbackPlacements: R, virtualReference: z, flipBoundary: B, animated: V = !1, animationConfig: H, ...pe }) => {
16
- let U = ie(null), [me, he] = s(null), [W, G] = c(pe, {
17
- valuePropName: "visible",
18
- trigger: "onVisibleChange",
19
- defaultValue: !1
20
- }), ge = ne((e) => {
21
- !e && W && k && k(), G(e);
22
- }, [
23
- W,
24
- k,
25
- G
26
- ]), _e = o(() => {
27
- let e = R ? { fallbackPlacements: R } : {};
28
- B && (e.boundary = B);
29
- let t = [
30
- m(L),
31
- p(e),
32
- g({ padding: 8 })
33
- ];
34
- return D && t.push(d({ element: U })), N === "reference" && t.push(_({ apply({ rects: e, elements: t }) {
35
- t.floating.style.width = `${e.reference.width}px`;
36
- let n = C(F);
37
- n && (t.floating.style.minWidth = n);
38
- let r = C(I);
39
- r && (t.floating.style.maxWidth = r);
40
- } })), t;
41
- }, [
42
- N,
43
- F,
44
- I,
45
- L,
46
- R,
47
- B,
48
- D
49
- ]), { refs: K, floatingStyles: q, context: J } = ae({
50
- open: W,
51
- onOpenChange: ge,
52
- whileElementsMounted: W ? (e, t, n) => f(e, t, n, {
53
- animationFrame: !1,
54
- ancestorScroll: !0,
55
- ancestorResize: !0,
56
- elementResize: !0,
57
- layoutShift: !1
58
- }) : void 0,
59
- placement: O,
60
- middleware: _e,
61
- transform: !1
62
- }), { isMounted: Y, styles: ve } = le(J, V && H ? H : { duration: 0 }), ye = V ? Y : W, X = o(() => {
63
- let e = {
64
- ...q,
65
- ...T,
66
- ...E === void 0 ? null : { "--bsy-tooltip-z-index": E }
67
- };
68
- switch (N) {
69
- case "content":
70
- e.width = "auto";
71
- break;
72
- case "manual":
73
- P !== void 0 && (e.width = C(P));
74
- break;
75
- case "reference": break;
76
- default: e.width = "max-content";
77
- }
78
- return N !== "reference" && (F !== void 0 && (e.minWidth = C(F)), I !== void 0 && (e.maxWidth = C(I))), e;
79
- }, [
80
- q,
81
- T,
82
- E,
83
- N,
84
- P,
85
- F,
86
- I
87
- ]);
88
- re(() => {
89
- z && K.setPositionReference(z);
90
- }, [z, K]);
91
- let { getReferenceProps: be, getFloatingProps: xe } = se([
92
- oe(J, {
93
- enabled: w === "hover",
94
- delay: { open: A },
95
- handleClose: M ? h() : void 0
96
- }),
97
- v(J, { enabled: w === "click" }),
98
- y(J),
99
- ce(J, { role: "tooltip" })
100
- ]), Z = be(), Q = {
101
- ...Z,
102
- onClick: (e) => {
103
- w === "click" && e.stopPropagation(), Z.onClick?.(e);
104
- },
105
- onMouseEnter: (e) => {
106
- w === "hover" && e.stopPropagation(), Z.onMouseEnter?.(e);
107
- },
108
- onMouseLeave: (e) => {
109
- w === "hover" && e.stopPropagation(), Z.onMouseLeave?.(e);
110
- },
111
- onMouseMove: (e) => {
112
- Z.onMouseMove?.(e);
113
- }
114
- }, Se = j?.(), Ce = typeof T?.background == "string" ? T.background : de, we = e(K.setFloating, he), $ = ye ? /* @__PURE__ */ n(u, {
115
- root: Se ?? void 0,
116
- children: /* @__PURE__ */ r("div", {
117
- ref: we,
118
- style: V ? {
119
- ...X,
120
- ...ve
121
- } : X,
122
- ...xe(),
123
- className: x["bsy-tooltip__content"],
124
- onClick: (e) => e.stopPropagation(),
125
- children: [D ? /* @__PURE__ */ n(l, {
126
- ref: U,
127
- context: J,
128
- width: 14,
129
- height: 14,
130
- tipRadius: 2,
131
- fill: Ce,
132
- d: ue
133
- }) : null, /* @__PURE__ */ n(b.Provider, {
134
- value: me,
135
- children: a
136
- })]
137
- })
138
- }) : null;
139
- if (te(i) && !fe(i)) {
140
- let n = i.props, a = i.ref;
141
- return /* @__PURE__ */ r(t, { children: [ee(i, {
142
- ...n,
143
- ...Q,
144
- ref: a ? e(K.setReference, a) : K.setReference,
145
- style: n.style,
146
- onClick: S(n.onClick, Q.onClick),
147
- onMouseEnter: S(n.onMouseEnter, Q.onMouseEnter),
148
- onMouseLeave: S(n.onMouseLeave, Q.onMouseLeave),
149
- onMouseMove: S(n.onMouseMove, Q.onMouseMove)
150
- }), $] });
151
- }
152
- return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("div", {
153
- className: x["bsy-tooltip"],
154
- children: /* @__PURE__ */ n("div", {
155
- ref: K.setReference,
156
- ...Q,
157
- className: x["bsy-tooltip__trigger"],
158
- children: i
159
- })
160
- }), $] });
161
- }, T = ({ content: e, children: r, ...i }) => e ? /* @__PURE__ */ n(w, {
162
- content: e,
163
- ...i,
164
- children: r
165
- }) : /* @__PURE__ */ n(t, { children: r });
166
- T.displayName = "BsyTooltip";
167
- //#endregion
168
- export { b as n, T as t };