@baishuyun/ui-base 6.9.0 → 6.10.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 (116) hide show
  1. package/dist/Amap/AmapCircle/index.js +1 -1
  2. package/dist/Amap/AmapMarker/index.js +1 -1
  3. package/dist/Amap/AmapMarkerCluster/index.js +1 -1
  4. package/dist/Amap/AmapProvider/index.js +1 -1
  5. package/dist/Amap/hooks/index.js +1 -1
  6. package/dist/Amap/index.js +1 -1
  7. package/dist/Calendar/{AllDaySection-a96dIzs3.js → AllDaySection-DNsVyixx.js} +3 -3
  8. package/dist/Calendar/{Calendar-MghsGFZ0.js → Calendar-DL2X3z_z.js} +11 -11
  9. package/dist/Calendar/{CurrentTimeIndicator-CNKsVEXH.js → CurrentTimeIndicator-twXtFHIp.js} +1 -1
  10. package/dist/Calendar/{EventCard-B1LoBxth.js → EventCard-CvEnWcKd.js} +3 -3
  11. package/dist/Calendar/{TimeGrid-DIw8oCqY.js → TimeGrid-D62R57Bo.js} +1 -1
  12. package/dist/Calendar/context/index.js +2 -2
  13. package/dist/Calendar/index.js +17 -17
  14. package/dist/Calendar/subcomponents/AllDaySection/index.js +7 -7
  15. package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +5 -5
  16. package/dist/Calendar/subcomponents/EventCard/index.js +6 -6
  17. package/dist/Calendar/subcomponents/TimeAxis/index.js +4 -4
  18. package/dist/Calendar/subcomponents/TimeGrid/index.js +3 -3
  19. package/dist/Calendar/{theme-xnrMsnkg.js → theme-BRVmxhqD.js} +2 -2
  20. package/dist/Calendar/utils/index.js +4 -4
  21. package/dist/Calendar/utils/layout/index.js +3 -3
  22. package/dist/Calendar/utils/theme/index.js +2 -2
  23. package/dist/Card/index.js +1 -1
  24. package/dist/CheckBox/{CheckBox-nBm0u6zX.js → CheckBox-CcM19LnP.js} +1 -1
  25. package/dist/CheckBox/index.js +3 -3
  26. package/dist/ColorPicker/ColorPicker-D3JuQ7a7.js +153 -0
  27. package/dist/ColorPicker/index.js +3 -4
  28. package/dist/ConfigProvider/index.js +1 -1
  29. package/dist/DatePicker/{DatePicker-uizefM92.js → DatePicker-Dah_CjYG.js} +5 -5
  30. package/dist/DatePicker/{DatePickerPanel-bbGVwlo7.js → DatePickerPanel-Bz3uvbYF.js} +3 -3
  31. package/dist/DatePicker/index.js +6 -6
  32. package/dist/DatePicker/style/index.js +2 -2
  33. package/dist/DatePicker/{style-CNtPPsZp.js → style-BwmM26RP.js} +1 -1
  34. package/dist/DropDown/{DropDown-yDH9V_9Y.js → DropDown-Daxr9BYf.js} +7 -7
  35. package/dist/DropDown/index.js +8 -8
  36. package/dist/DropDown/style/index.js +2 -2
  37. package/dist/DropDown/{style-Fdp-U4md.js → style-BSgosymi.js} +1 -1
  38. package/dist/Editor/Buttons-DG_-Sg_C.js +600 -0
  39. package/dist/Editor/ToolbarPlugin/Buttons/index.js +12 -13
  40. package/dist/Editor/constants/index.js +1 -1
  41. package/dist/Editor/index.js +194 -180
  42. package/dist/Gantt/GanttChart/index.js +15 -15
  43. package/dist/Gantt/{GanttChart-CDw1IQ4F.js → GanttChart-6gpw5vi6.js} +22 -24
  44. package/dist/Gantt/GanttTable/index.js +9 -9
  45. package/dist/Gantt/{GanttTable-xbXD_PWI.js → GanttTable-lVu-YUtt.js} +5 -5
  46. package/dist/Gantt/GanttToolBar/index.js +11 -11
  47. package/dist/Gantt/{GanttToolBar-BTeTsR6Z.js → GanttToolBar-CarBWZg-.js} +2 -2
  48. package/dist/Gantt/{collapseKeys-B4SOVHjd.js → collapseKeys-_ShTXPKt.js} +2 -2
  49. package/dist/Gantt/index.js +23 -23
  50. package/dist/Gantt/{theme-DLNvgM9X.js → theme-CiMD9Y6i.js} +1 -1
  51. package/dist/Gantt/{timelineViewConfig-9HArvbmb.js → timelineViewConfig-CLIpppp0.js} +1 -1
  52. package/dist/Gantt/utils/index.js +6 -6
  53. package/dist/Gantt/utils/theme/index.js +2 -2
  54. package/dist/Icon/index.js +1 -1
  55. package/dist/InputTag/{InputTag-hzCCJQ1z.js → InputTag-DxPO0DwD.js} +1 -1
  56. package/dist/InputTag/index.js +3 -3
  57. package/dist/Loading/index.js +2 -2
  58. package/dist/Modal/index.js +1 -1
  59. package/dist/NotFoundContent/index.js +2 -2
  60. package/dist/Radio/index.js +2 -2
  61. package/dist/ScrollBar/{ScrollBar-QhXVe8zd.js → ScrollBar-CnwYQfXM.js} +1 -1
  62. package/dist/ScrollBar/index.js +2 -2
  63. package/dist/Segmented/{Segmented-BDz1hMDT.js → Segmented-Ck2ZmfF7.js} +1 -1
  64. package/dist/Segmented/index.js +2 -2
  65. package/dist/Select/{Select-D6EK7whJ.js → Select-CBI5PgeQ.js} +10 -8
  66. package/dist/Select/index.js +11 -11
  67. package/dist/Table/{Table-yQXQEk6d.js → Table-CL-KfNY3.js} +4 -4
  68. package/dist/Table/hooks/index.js +2 -2
  69. package/dist/Table/{hooks-BceUZQQm.js → hooks-uCDY9dqx.js} +1 -1
  70. package/dist/Table/index.js +6 -6
  71. package/dist/Table/{processRowspan-B0WELhG2.js → processRowspan-nIGqGyHh.js} +1 -1
  72. package/dist/Table/style/index.js +2 -2
  73. package/dist/Table/{style-DgiPEsSp.js → style-x9xfw6te.js} +1 -1
  74. package/dist/Table/utils/index.js +2 -2
  75. package/dist/Tabs/Tabs-B1RsYb2W.js +409 -0
  76. package/dist/Tabs/index.js +3 -4
  77. package/dist/Tooltip/{Tooltip-Ch9lti_7.js → Tooltip-DWWWYn1a.js} +1 -1
  78. package/dist/Tooltip/index.js +2 -2
  79. package/dist/Tree/index.js +4 -4
  80. package/dist/Tree/utils/index.js +1 -1
  81. package/dist/components/ColorPicker/ColorPalettes.d.ts +1 -8
  82. package/dist/components/ColorPicker/ColorPicker.type.d.ts +5 -2
  83. package/dist/components/ColorPicker/constants.d.ts +3 -1
  84. package/dist/components/ColorPicker/index.d.ts +1 -1
  85. package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/UploadImage.d.ts +5 -4
  86. package/dist/components/Editor/plugins/LinkColorPlugin.d.ts +2 -0
  87. package/dist/index.js +36 -37
  88. package/dist/style.css +1 -1
  89. package/dist/vendors/{Tree-DXmVRDn0.js → Tree-D1s-eADo.js} +2 -2
  90. package/dist/vendors/{version-D76DufO-.js → version-L-kG2La0.js} +1 -1
  91. package/package.json +1 -1
  92. package/dist/ColorPicker/ColorPicker-t1uBeATW.js +0 -155
  93. package/dist/Editor/Buttons-BhStZyIa.js +0 -620
  94. package/dist/Tabs/Tabs-BiKW70CL.js +0 -398
  95. package/dist/vendors/color-D6XBXROa.js +0 -12
  96. /package/dist/Calendar/{TimeAxis-C9e2BdYs.js → TimeAxis-D7bgZDKs.js} +0 -0
  97. /package/dist/Calendar/{colorUtils-CBLTsDX0.js → colorUtils-lXNjGoCk.js} +0 -0
  98. /package/dist/Calendar/{context-4tCN5X33.js → context-CBJnz0IH.js} +0 -0
  99. /package/dist/Calendar/{layout-Dz-grtu9.js → layout-BglMom3m.js} +0 -0
  100. /package/dist/CheckBox/{CheckBox-ByWSy9Yr.js → CheckBox-Bb0UuX1Y.js} +0 -0
  101. /package/dist/DatePicker/{ensureDayjsPlugins-Cn9Bkjkj.js → ensureDayjsPlugins-CVL-fnAl.js} +0 -0
  102. /package/dist/DatePicker/{pickerLocale-BRnNjLcv.js → pickerLocale-BeMlfhKu.js} +0 -0
  103. /package/dist/Gantt/{GanttHighlightContext-ChThr8ia.js → GanttHighlightContext-grda5bhd.js} +0 -0
  104. /package/dist/Gantt/{columnResize-jG0Wy2PC.js → columnResize-DV1tSBx_.js} +0 -0
  105. /package/dist/Gantt/{constants-LIz5jwed.js → constants-BObDP0h6.js} +0 -0
  106. /package/dist/Gantt/{highlightTarget-BpkYTonb.js → highlightTarget-DrP0_NrM.js} +0 -0
  107. /package/dist/Loading/{Loading-DiywS7ex.js → Loading-CVyzO5-s.js} +0 -0
  108. /package/dist/NotFoundContent/{NotFoundContent-BLmzWNBi.js → NotFoundContent-J-TEnljc.js} +0 -0
  109. /package/dist/Radio/{Radio-CX9cUqb7.js → Radio-CBUZ7DB5.js} +0 -0
  110. /package/dist/Select/{SelectInputSearch-COUzreau.js → SelectInputSearch-CrGW_eVo.js} +0 -0
  111. /package/dist/Table/{constants-kRpjsoet.js → constants-CcwjDbe7.js} +0 -0
  112. /package/dist/vendors/{animations-rwUbyoT0.js → animations-Mlw78WYo.js} +0 -0
  113. /package/dist/vendors/{cssVars-BYg1matG.js → cssVars-B8o94Yao.js} +0 -0
  114. /package/dist/vendors/{mergeRefs-Bsywq1Vo.js → mergeRefs-Bai1cIzv.js} +0 -0
  115. /package/dist/vendors/{useFloatingPortal-CmVJbuRm.js → useFloatingPortal-C8V67X0v.js} +0 -0
  116. /package/dist/vendors/{useLatchedPopupPortalRoot-4fVhqVT4.js → useLatchedPopupPortalRoot-hwf14FJ5.js} +0 -0
@@ -0,0 +1,409 @@
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,8 +1,7 @@
1
- import "../vendors/version-D76DufO-.js";
1
+ import "../vendors/version-L-kG2La0.js";
2
2
  import "../Icon/Icon-BBDcb-yw.js";
3
3
  import "../vendors/LocaleContext-Dcw6C1LX.js";
4
4
  import "../vendors/useLocale-BKZX2_zw.js";
5
- import "../vendors/color-D6XBXROa.js";
6
- import "../vendors/useFloatingPortal-CmVJbuRm.js";
7
- import { i as e, n as t, r as n, t as r } from "./Tabs-BiKW70CL.js";
5
+ import "../vendors/useFloatingPortal-C8V67X0v.js";
6
+ import { i as e, n as t, r as n, t as r } from "./Tabs-B1RsYb2W.js";
8
7
  export { e as TABS_TYPE, n as TabPanel, r as TabSelect, t as default };
@@ -1,4 +1,4 @@
1
- import { n as e } from "../vendors/mergeRefs-Bsywq1Vo.js";
1
+ import { n as e } from "../vendors/mergeRefs-Bai1cIzv.js";
2
2
  import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
3
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
4
  import { useControllableValue as c } from "ahooks";
@@ -1,3 +1,3 @@
1
- import "../vendors/version-D76DufO-.js";
2
- import { n as e, t } from "./Tooltip-Ch9lti_7.js";
1
+ import "../vendors/version-L-kG2La0.js";
2
+ import { n as e, t } from "./Tooltip-DWWWYn1a.js";
3
3
  export { e as TooltipFloatingContext, t as default };
@@ -1,6 +1,6 @@
1
- import "../vendors/version-D76DufO-.js";
1
+ import "../vendors/version-L-kG2La0.js";
2
2
  import "../Icon/Icon-BBDcb-yw.js";
3
- import { t as e } from "../vendors/Tree-DXmVRDn0.js";
4
- import "../CheckBox/CheckBox-ByWSy9Yr.js";
5
- import "../Radio/Radio-CX9cUqb7.js";
3
+ import { t as e } from "../vendors/Tree-D1s-eADo.js";
4
+ import "../CheckBox/CheckBox-Bb0UuX1Y.js";
5
+ import "../Radio/Radio-CBUZ7DB5.js";
6
6
  export { e as Tree };
@@ -1,4 +1,4 @@
1
- import "../../vendors/version-D76DufO-.js";
1
+ import "../../vendors/version-L-kG2La0.js";
2
2
  import { isString as e } from "lodash-es";
3
3
  //#region src/components/Tree/utils/index.ts
4
4
  var t = (e, n, r, i = []) => {
@@ -1,15 +1,8 @@
1
- /**
2
- * 预设颜色网格组件
3
- */
4
1
  interface PresetColorsProps {
5
- /** 当前选中的颜色 */
6
2
  currentColor: string;
7
- /** 颜色选择回调 */
8
3
  onColorSelect: (color: string) => void;
9
- /** 颜色选项 */
10
4
  options: string[];
11
- /** 网格样式 */
12
- style?: React.CSSProperties;
5
+ className?: string;
13
6
  }
14
7
  declare const ColorPalettes: React.FC<PresetColorsProps>;
15
8
  export default ColorPalettes;
@@ -1,4 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
+ /** 内置色卡:`vivid` 鲜艳色相深浅档,`basic` 强调色 + 浅底 + 灰度 */
3
+ export type ColorPickerPalette = 'vivid' | 'basic';
2
4
  /**
3
5
  * 颜色选择器的属性接口
4
6
  */
@@ -25,9 +27,10 @@ export interface ColorPickerProps {
25
27
  /** @default false */
26
28
  disabled?: boolean;
27
29
  /**
28
- * 预设颜色
30
+ * 预设色板。`vivid` / `basic` 使用内置色卡,也可传入自定义颜色数组。
31
+ * @default 'vivid'
29
32
  */
30
- presetColors?: string[];
33
+ presetColors?: ColorPickerPalette | string[];
31
34
  /**
32
35
  * 指定颜色选择器浮层(含内部自定义取色面板)渲染的父级 DOM 节点
33
36
  * @default undefined (默认渲染到 body 元素上)
@@ -1,2 +1,4 @@
1
+ import { ColorPickerPalette } from './ColorPicker.type';
1
2
  declare const COLOR_OPTIONS_RGBA: string[];
2
- export { COLOR_OPTIONS_RGBA };
3
+ declare const resolvePresetColors: (presetColors?: ColorPickerPalette | string[]) => string[];
4
+ export { COLOR_OPTIONS_RGBA, resolvePresetColors };
@@ -1,3 +1,3 @@
1
1
  export { ColorPicker as default } from './ColorPicker';
2
- export type { ColorPickerProps } from './ColorPicker.type';
2
+ export type { ColorPickerPalette, ColorPickerProps } from './ColorPicker.type';
3
3
  export { COLOR_OPTIONS_RGBA } from './constants';
@@ -1,8 +1,9 @@
1
+ export interface UploadImageItem {
2
+ src: string;
3
+ fileName: string;
4
+ }
1
5
  export interface UploadImageRef {
2
- getValue: () => Promise<{
3
- src: string;
4
- fileName: string;
5
- }>;
6
+ getValue: () => Promise<UploadImageItem[]>;
6
7
  }
7
8
  declare const UploadImage: import('react').ForwardRefExoticComponent<import('react').RefAttributes<UploadImageRef>>;
8
9
  export default UploadImage;
@@ -0,0 +1,2 @@
1
+ /** 链接内文字始终用主题蓝,去掉会盖住 .editor-link 的内联 color */
2
+ export default function LinkColorPlugin(): null;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./vendors/version-D76DufO-.js";
1
+ import "./vendors/version-L-kG2La0.js";
2
2
  import "./ScrollBar/style-D26azwz6.js";
3
3
  import { t as e } from "./Icon/Icon-BBDcb-yw.js";
4
4
  import "./vendors/LocaleContext-Dcw6C1LX.js";
@@ -13,45 +13,44 @@ import { t as c } from "./Amap/AmapMarker-CdoPWdff.js";
13
13
  import { t as l } from "./Amap/AmapMarkerCluster-CSIxiVC5.js";
14
14
  import { t as u } from "./Card/Card-CtKLNh3n.js";
15
15
  import { t as d } from "./Modal/Modal-LiztSF7x.js";
16
- import { t as f } from "./ColorPicker/ColorPicker-t1uBeATW.js";
16
+ import { t as f } from "./ColorPicker/ColorPicker-D3JuQ7a7.js";
17
17
  import "./vendors/useFloatingOverlay-BApqkHSu.js";
18
18
  import "./vendors/useLocale-BKZX2_zw.js";
19
- import "./vendors/color-D6XBXROa.js";
20
- import "./vendors/useLatchedPopupPortalRoot-4fVhqVT4.js";
21
- import { t as p } from "./Segmented/Segmented-BDz1hMDT.js";
22
- import { n as m, t as h } from "./Tooltip/Tooltip-Ch9lti_7.js";
23
- import { t as g } from "./Select/Select-D6EK7whJ.js";
24
- import "./Select/SelectInputSearch-COUzreau.js";
25
- import { t as _ } from "./vendors/Tree-DXmVRDn0.js";
26
- import "./CheckBox/CheckBox-ByWSy9Yr.js";
27
- import { t as v } from "./CheckBox/CheckBox-nBm0u6zX.js";
28
- import { t as y } from "./Radio/Radio-CX9cUqb7.js";
29
- import { t as b } from "./NotFoundContent/NotFoundContent-BLmzWNBi.js";
30
- import { t as x } from "./ScrollBar/ScrollBar-QhXVe8zd.js";
31
- import "./vendors/useFloatingPortal-CmVJbuRm.js";
19
+ import "./vendors/useLatchedPopupPortalRoot-hwf14FJ5.js";
20
+ import { t as p } from "./Segmented/Segmented-Ck2ZmfF7.js";
21
+ import { n as m, t as h } from "./Tooltip/Tooltip-DWWWYn1a.js";
22
+ import { t as g } from "./Select/Select-CBI5PgeQ.js";
23
+ import "./Select/SelectInputSearch-CrGW_eVo.js";
24
+ import { t as _ } from "./vendors/Tree-D1s-eADo.js";
25
+ import "./CheckBox/CheckBox-Bb0UuX1Y.js";
26
+ import { t as v } from "./CheckBox/CheckBox-CcM19LnP.js";
27
+ import { t as y } from "./Radio/Radio-CBUZ7DB5.js";
28
+ import { t as b } from "./NotFoundContent/NotFoundContent-J-TEnljc.js";
29
+ import { t as x } from "./ScrollBar/ScrollBar-CnwYQfXM.js";
30
+ import "./vendors/useFloatingPortal-C8V67X0v.js";
32
31
  import "./Tree/index.js";
33
- import { n as S, t as C } from "./Tabs/Tabs-BiKW70CL.js";
34
- import { t as w } from "./DropDown/DropDown-yDH9V_9Y.js";
35
- import "./DropDown/style-Fdp-U4md.js";
36
- import { t as T } from "./Loading/Loading-DiywS7ex.js";
32
+ import { n as S, t as C } from "./Tabs/Tabs-B1RsYb2W.js";
33
+ import { t as w } from "./DropDown/DropDown-Daxr9BYf.js";
34
+ import "./DropDown/style-BSgosymi.js";
35
+ import { t as T } from "./Loading/Loading-CVyzO5-s.js";
37
36
  import "./NotFoundContent/index.js";
38
- import { t as E } from "./InputTag/InputTag-hzCCJQ1z.js";
39
- import "./Calendar/context-4tCN5X33.js";
40
- import { t as D } from "./Calendar/Calendar-MghsGFZ0.js";
41
- import { t as O } from "./DatePicker/DatePicker-uizefM92.js";
42
- import "./DatePicker/ensureDayjsPlugins-Cn9Bkjkj.js";
43
- import "./DatePicker/pickerLocale-BRnNjLcv.js";
44
- import "./DatePicker/style-CNtPPsZp.js";
45
- import "./Calendar/layout-Dz-grtu9.js";
46
- import "./Calendar/TimeAxis-C9e2BdYs.js";
47
- import "./Calendar/TimeGrid-DIw8oCqY.js";
48
- import "./Calendar/CurrentTimeIndicator-CNKsVEXH.js";
49
- import "./Calendar/EventCard-B1LoBxth.js";
50
- import "./Calendar/AllDaySection-a96dIzs3.js";
51
- import "./Calendar/theme-xnrMsnkg.js";
52
- import { a as k, c as A, d as j, f as M, n as N, o as P, r as F, t as I, u as L } from "./Table/processRowspan-B0WELhG2.js";
53
- import { t as R } from "./Table/Table-yQXQEk6d.js";
54
- import { n as z, t as B } from "./Table/hooks-BceUZQQm.js";
55
- import { t as V } from "./Table/style-DgiPEsSp.js";
37
+ import { t as E } from "./InputTag/InputTag-DxPO0DwD.js";
38
+ import "./Calendar/context-CBJnz0IH.js";
39
+ import { t as D } from "./Calendar/Calendar-DL2X3z_z.js";
40
+ import { t as O } from "./DatePicker/DatePicker-Dah_CjYG.js";
41
+ import "./DatePicker/ensureDayjsPlugins-CVL-fnAl.js";
42
+ import "./DatePicker/pickerLocale-BeMlfhKu.js";
43
+ import "./DatePicker/style-BwmM26RP.js";
44
+ import "./Calendar/layout-BglMom3m.js";
45
+ import "./Calendar/TimeAxis-D7bgZDKs.js";
46
+ import "./Calendar/TimeGrid-D62R57Bo.js";
47
+ import "./Calendar/CurrentTimeIndicator-twXtFHIp.js";
48
+ import "./Calendar/EventCard-CvEnWcKd.js";
49
+ import "./Calendar/AllDaySection-DNsVyixx.js";
50
+ import "./Calendar/theme-BRVmxhqD.js";
51
+ import { a as k, c as A, d as j, f as M, n as N, o as P, r as F, t as I, u as L } from "./Table/processRowspan-nIGqGyHh.js";
52
+ import { t as R } from "./Table/Table-CL-KfNY3.js";
53
+ import { n as z, t as B } from "./Table/hooks-uCDY9dqx.js";
54
+ import { t as V } from "./Table/style-x9xfw6te.js";
56
55
  import "overlayscrollbars/overlayscrollbars.css";
57
56
  export { i as Amap, s as AmapCircle, c as AmapMarker, l as AmapMarkerCluster, r as AmapProvider, D as Calendar, u as Card, v as Checkbox, f as ColorPicker, n as ConfigProvider, O as DatePicker, w as DropDown, e as Icon, E as InputTag, T as Loading, t as LocalTheme, d as Modal, b as NotFoundContent, y as Radio, y as Ratio, x as ScrollBar, p as Segmented, g as Select, C as TabSelect, R as Table, S as Tabs, h as Tooltip, m as TooltipFloatingContext, _ as Tree, k as calculateFixedOffset, P as expandLeafColumns, I as getCellRowspan, A as getColumnsWidth, L as getRowKey, N as processRowspan, V as resolveTableThemeVars, F as shouldRenderCell, j as sortData, M as splitFixedColumns, a as useAmap, B as useColumnResize, o as useCurrentLocation, z as useTableVirtual };