@baishuyun/ui-base 2.3.1 → 2.3.3

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 (74) hide show
  1. package/dist/Card/Card-F2t4Rv_v.js +69 -0
  2. package/dist/Card/index.js +3 -4
  3. package/dist/CheckBox/CheckBox-DFoMXJZz.js +67 -0
  4. package/dist/CheckBox/CheckBox-q2vu7qf7.js +33 -0
  5. package/dist/CheckBox/index.js +4 -39
  6. package/dist/ColorPicker/ColorPicker-Bh4KTHxh.js +168 -0
  7. package/dist/ColorPicker/index.js +6 -5
  8. package/dist/DropDown/DropDown-BEzloRRM.js +162 -0
  9. package/dist/DropDown/index.js +7 -4
  10. package/dist/Editor/Buttons-ClWtl3G-.js +595 -0
  11. package/dist/Editor/ToolbarPlugin/Buttons/index.js +14 -8
  12. package/dist/Editor/constants/index.js +53 -20
  13. package/dist/Editor/index.js +518 -576
  14. package/dist/Icon/Icon-DXmPqVzg.js +19 -0
  15. package/dist/Icon/index.js +2 -4
  16. package/dist/InputTag/InputTag-DbiyuWo9.js +139 -0
  17. package/dist/InputTag/index.js +3 -4
  18. package/dist/Loading/Loading-Bi5NO-Ky.js +15 -0
  19. package/dist/Loading/index.js +2 -4
  20. package/dist/Modal/Modal-BO1s8pJe.js +81 -0
  21. package/dist/Modal/index.js +3 -4
  22. package/dist/NotFoundContent/NotFoundContent-CTPpcZOt.js +9 -0
  23. package/dist/NotFoundContent/index.js +2 -4
  24. package/dist/Radio/Radio-dyoBNiKF.js +85 -0
  25. package/dist/Radio/index.js +2 -105
  26. package/dist/Segmented/Segmented-Dd8glDXI.js +62 -0
  27. package/dist/Segmented/index.js +2 -4
  28. package/dist/Select/Select-DoQO-Xi5.js +729 -0
  29. package/dist/Select/SelectInputSearch-gp6gcY3x.js +46 -0
  30. package/dist/Select/index.js +11 -6
  31. package/dist/Tabs/Tabs-Dsxn_7gF.js +410 -0
  32. package/dist/Tabs/index.js +6 -7
  33. package/dist/Tree/index.js +5 -4
  34. package/dist/Tree/utils/index.js +24 -39
  35. package/dist/components/Editor/context/EditorContainerContext.d.ts +8 -0
  36. package/dist/index.js +103 -81
  37. package/dist/style.css +2 -1
  38. package/dist/vendors/Tree-DgwG7Unx.js +231 -0
  39. package/dist/vendors/animations-C5JKFkz4.js +38 -0
  40. package/dist/vendors/clsx-DNOE4Gl8.js +16 -0
  41. package/dist/vendors/color-BPWy9DvT.js +12 -0
  42. package/dist/vendors/fuse.js-BKtvbTjL.js +877 -0
  43. package/dist/vendors/lexical-hZliMgDv.js +6439 -0
  44. package/dist/vendors/lodash-es-Bu9xU1fK.js +334 -0
  45. package/dist/vendors/simplebar-react-CFlS-Nm9.js +370 -0
  46. package/dist/vendors/tinycolor2-DToeAEPD.js +726 -0
  47. package/dist/vendors/useFloatingPortal-BA6P5GxV.js +45 -0
  48. package/dist/vendors/useLocale-BfT0V1j4.js +75 -0
  49. package/package.json +4 -4
  50. package/dist/Card/Card-Y1ISqAp9.js +0 -86
  51. package/dist/CheckBox/CheckBox-C9sXWSA5.js +0 -84
  52. package/dist/ColorPicker/ColorPicker-uPJOs52x.js +0 -215
  53. package/dist/DropDown/DropDown-DGkSeXQT.js +0 -166
  54. package/dist/Editor/index-D7tFsaxU.js +0 -846
  55. package/dist/Icon/Icon-CBlIwtp2.js +0 -24
  56. package/dist/InputTag/InputTag-C-rQUJnF.js +0 -155
  57. package/dist/Loading/Loading-CEB4PLUE.js +0 -9
  58. package/dist/Modal/Modal-z3TvEXwN.js +0 -80
  59. package/dist/NotFoundContent/NotFoundContent-h0-oIXlk.js +0 -6
  60. package/dist/Segmented/Segmented-UgzW78Ey.js +0 -75
  61. package/dist/Select/Select-hwXXDuLU.js +0 -820
  62. package/dist/Select/SelectInputSearch-ChUpUgxa.js +0 -34
  63. package/dist/Tabs/TabSelect-DL8Bhehc.js +0 -445
  64. package/dist/vendors/Tree-CLEy-xqz.js +0 -235
  65. package/dist/vendors/clsx-OuTLNxxd.js +0 -16
  66. package/dist/vendors/color-VzwvCPhF.js +0 -21
  67. package/dist/vendors/fuse.js-D1DCbUBb.js +0 -1022
  68. package/dist/vendors/index-MTmG1Ezy.js +0 -15
  69. package/dist/vendors/lexical-DO7eMeC2.js +0 -5891
  70. package/dist/vendors/lodash-es-DFpaJB4Y.js +0 -305
  71. package/dist/vendors/simplebar-react-D68KzE44.js +0 -408
  72. package/dist/vendors/tinycolor2-Begv3Jc8.js +0 -711
  73. package/dist/vendors/useFloatingPortal-9VUFOAOG.js +0 -45
  74. package/dist/vendors/useLocale-DgqW9M3h.js +0 -47
@@ -1,24 +0,0 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { createFromIconfontCN as e } from "@ant-design/icons";
3
- import { b as a } from "../vendors/lodash-es-DFpaJB4Y.js";
4
- const f = e({
5
- scriptUrl: "https://at.alicdn.com/t/c/font_4786625_djm4gsgobsp.js"
6
- }), b = ({ name: t, style: n, className: r, onClick: c, color: s, size: o = 16 }) => {
7
- const m = {
8
- color: s,
9
- fontSize: a(o) ? `${o}px` : o,
10
- ...n
11
- };
12
- return /* @__PURE__ */ p(
13
- f,
14
- {
15
- onClick: c,
16
- type: `icon-${t}`,
17
- style: m,
18
- className: `${r || ""}`
19
- }
20
- );
21
- };
22
- export {
23
- b as I
24
- };
@@ -1,155 +0,0 @@
1
- import { jsxs as S, jsx as o } from "react/jsx-runtime";
2
- import { useControllableValue as W } from "ahooks";
3
- import { useState as N, useLayoutEffect as A, useRef as m, useEffect as z, useCallback as D } from "react";
4
- import { c as T } from "../vendors/clsx-OuTLNxxd.js";
5
- import { I as V } from "../Icon/Icon-CBlIwtp2.js";
6
- import { motion as B } from "motion/react";
7
- import { S as F } from "../vendors/simplebar-react-D68KzE44.js";
8
- const _ = {
9
- "bsy-inputTag": "_bsy-inputTag_46spj_11",
10
- "bsy-inputTag__container": "_bsy-inputTag__container_46spj_22",
11
- "bsy-inputTag__inputContainer": "_bsy-inputTag__inputContainer_46spj_27",
12
- "bsy-inputTag__inputContainer--zeroMargin": "_bsy-inputTag__inputContainer--zeroMargin_46spj_37",
13
- "bsy-inputTag__input": "_bsy-inputTag__input_46spj_27"
14
- }, b = {
15
- GAP: 4,
16
- OFFSET: 3,
17
- CONTAINER_PADDING: 10,
18
- INPUT_MARGIN: 4
19
- }, L = (l, x) => {
20
- const [c, y] = N(0);
21
- return A(() => {
22
- const i = l.current;
23
- if (!i) return;
24
- const n = () => {
25
- const a = i.children;
26
- let f = 0;
27
- for (let r = 0; r < a.length; r++)
28
- f += a[r].clientWidth;
29
- const h = Math.max(0, a.length - 1) * b.GAP, d = Math.max(0, f + h + b.OFFSET);
30
- y((r) => r === d ? r : d);
31
- };
32
- n();
33
- const u = new ResizeObserver(n);
34
- return u.observe(i), () => {
35
- u.disconnect();
36
- };
37
- }, [x, l]), c;
38
- }, K = (l) => {
39
- const { defaultValue: x, enableActive: c = !1, defaultActiveIndex: y, onActiveIndexChange: i } = l, [n, u] = W(l, {
40
- defaultValue: x || []
41
- }), [a, f] = W(
42
- l,
43
- {
44
- valuePropName: "activeIndex",
45
- trigger: "onActiveIndexChange",
46
- defaultValue: y
47
- }
48
- ), [h, d] = N(""), r = m(null), p = m(null), g = m(null), v = m(!1), w = () => {
49
- if (p.current && p.current.children.length > 0) {
50
- const t = p.current.children.length - 1;
51
- p.current.children[t].scrollIntoView({
52
- behavior: "smooth",
53
- block: "nearest",
54
- inline: "end"
55
- });
56
- }
57
- };
58
- z(() => {
59
- v.current && n.length > 0 && (w(), v.current = !1);
60
- }, [n.length]);
61
- const k = (t) => {
62
- d(t.currentTarget.value);
63
- }, C = () => {
64
- const t = h.trim();
65
- if (t !== "") {
66
- const e = t;
67
- v.current = !0, u([...n, e]), d("");
68
- }
69
- }, M = (t, e) => {
70
- if (!c) return;
71
- const s = a === t ? void 0 : t;
72
- f(s), i == null || i(s ?? -1, e);
73
- }, E = (t) => {
74
- t.key === "Enter" || t.key === "NumpadEnter" ? C() : t.key === "Backspace" && h === "" && n.length > 0 && u(n.slice(0, -1));
75
- }, R = (t) => {
76
- u(n.filter((e, s) => s !== t));
77
- }, [G, P] = N(0), j = L(p, n.length), I = D(() => {
78
- if (!r.current || !g.current) return;
79
- const t = r.current.clientWidth - g.current.clientWidth - b.INPUT_MARGIN - b.CONTAINER_PADDING, e = Math.max(0, t);
80
- P((s) => s === e ? s : e);
81
- }, []);
82
- A(() => {
83
- if (!r.current || !g.current) return;
84
- I();
85
- const t = new ResizeObserver(() => {
86
- I();
87
- });
88
- return t.observe(r.current), t.observe(g.current), () => {
89
- t.disconnect();
90
- };
91
- }, [I]);
92
- const O = Math.min(j, G);
93
- return /* @__PURE__ */ S("div", { className: _["bsy-inputTag"], ref: r, children: [
94
- /* @__PURE__ */ o("div", { className: _["bsy-inputTag__container"], children: n.length ? /* @__PURE__ */ o(F, { style: { width: O + "px" }, children: /* @__PURE__ */ o("div", { className: "flex gap-1 py-[3px]", ref: p, children: n.map((t, e) => /* @__PURE__ */ S(
95
- B.div,
96
- {
97
- className: T(
98
- "rounded-[2px] gap-1 px-[6px] h-[26px] flex items-center flex-shrink-0",
99
- {
100
- "cursor-pointer": c,
101
- "hover:bg-[#e0e0e0]": c && a !== e,
102
- "bg-[#0265ff] text-white": c && a === e,
103
- "bg-[#eee] text-black": !c || a !== e
104
- }
105
- ),
106
- onClick: () => M(e, t),
107
- children: [
108
- /* @__PURE__ */ o("span", { children: t }),
109
- /* @__PURE__ */ o(
110
- "div",
111
- {
112
- className: T(
113
- "cursor-pointer",
114
- c && a === e ? "text-white hover:text-gray-200" : "text-[#666] hover:text-[#0265ff]"
115
- ),
116
- onClick: (s) => {
117
- s.stopPropagation(), R(e);
118
- },
119
- children: /* @__PURE__ */ o(V, { name: "close", size: 12 })
120
- }
121
- )
122
- ]
123
- },
124
- e
125
- )) }) }) : null }),
126
- /* @__PURE__ */ o(
127
- "div",
128
- {
129
- ref: g,
130
- className: T(
131
- _["bsy-inputTag__inputContainer"],
132
- {
133
- [_["bsy-inputTag__inputContainer--zeroMargin"]]: n.length === 0
134
- },
135
- "py-[3px]"
136
- ),
137
- children: /* @__PURE__ */ o(
138
- "input",
139
- {
140
- value: h,
141
- onChange: k,
142
- onKeyDown: E,
143
- onBlur: C,
144
- className: T(_["bsy-inputTag__input"], "placeholder:text-[#999]"),
145
- placeholder: "输入标签"
146
- }
147
- )
148
- }
149
- )
150
- ] });
151
- };
152
- K.displayName = "BsyInputTag";
153
- export {
154
- K as I
155
- };
@@ -1,9 +0,0 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { LoadingOutlined as n } from "@ant-design/icons";
3
- const o = ({ tip: t = "加载中..." }) => /* @__PURE__ */ i("div", { className: "flex flex-col justify-center items-center h-full min-h-[100px] text-slate-500", children: [
4
- /* @__PURE__ */ e(n, { style: { fontSize: 24, marginBottom: 8 }, spin: !0 }),
5
- /* @__PURE__ */ e("span", { children: t })
6
- ] });
7
- export {
8
- o as L
9
- };
@@ -1,80 +0,0 @@
1
- import { jsxs as s, jsx as o } from "react/jsx-runtime";
2
- import { useControllableValue as c } from "ahooks";
3
- import { Modal as r } from "antd";
4
- import { useState as u } from "react";
5
- import { I as n } from "../Icon/Icon-CBlIwtp2.js";
6
- const f = "_modal__title_klsxr_1", b = "_modal__button_groups_klsxr_18", h = "_modal__button_klsxr_18", g = "_modal__icon_klsxr_38", l = {
7
- modal__title: f,
8
- modal__button_groups: b,
9
- modal__button: h,
10
- modal__icon: g
11
- }, p = (e) => {
12
- const { fullSwitch: _ = !1 } = e, [d, a] = c(e, {
13
- valuePropName: "open",
14
- defaultValue: !1,
15
- defaultValuePropName: "defaultOpen",
16
- trigger: "onOpenChange"
17
- }), [t, i] = u(!1), m = e.title ? /* @__PURE__ */ s("div", { className: l.modal__title, children: [
18
- /* @__PURE__ */ o("div", { className: l.modal__titleText, children: e.title }),
19
- _ ? /* @__PURE__ */ s("div", { className: l.modal__button_groups, children: [
20
- /* @__PURE__ */ o(
21
- "div",
22
- {
23
- "aria-label": "toggle fullscreen",
24
- role: "button",
25
- onClick: () => i(!t),
26
- className: l.modal__button,
27
- children: /* @__PURE__ */ o(
28
- n,
29
- {
30
- name: t ? "quanpingsuoxiao" : "quanpingfangda",
31
- className: l.modal__icon
32
- }
33
- )
34
- }
35
- ),
36
- /* @__PURE__ */ o(
37
- "div",
38
- {
39
- role: "button",
40
- "aria-label": "close",
41
- onClick: () => a(!1),
42
- className: l.modal__button,
43
- children: /* @__PURE__ */ o(n, { name: "close", className: l.modal__icon })
44
- }
45
- )
46
- ] }) : /* @__PURE__ */ o(
47
- "div",
48
- {
49
- role: "button",
50
- "aria-label": "close",
51
- onClick: () => a(!1),
52
- className: l.modal__button,
53
- children: /* @__PURE__ */ o(n, { name: "close", className: l.modal__icon })
54
- }
55
- )
56
- ] }) : null;
57
- return /* @__PURE__ */ o(
58
- r,
59
- {
60
- destroyOnHidden: !0,
61
- open: d,
62
- onCancel: () => a(!1),
63
- footer: null,
64
- title: m,
65
- closable: !1,
66
- width: t ? "100%" : e.width,
67
- style: { transition: "width 0.3s ease" },
68
- maskClosable: !1,
69
- styles: {
70
- header: { marginBottom: 0 },
71
- content: { padding: 0, borderRadius: "10px", overflow: "hidden" }
72
- },
73
- children: e.children
74
- }
75
- );
76
- };
77
- p.displayName = "BsyModal";
78
- export {
79
- p as M
80
- };
@@ -1,6 +0,0 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- const o = ({ text: e, className: n = "" }) => /* @__PURE__ */ t("div", { className: `text-center text-sm line-height-normal text-[#999] py-[7px] ${n}`, children: /* @__PURE__ */ t("span", { children: e }) });
3
- o.displayName = "BsyNotFoundContent";
4
- export {
5
- o as N
6
- };
@@ -1,75 +0,0 @@
1
- import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
- import { useState as b, useRef as g, useCallback as C, useLayoutEffect as N } from "react";
3
- import { motion as w } from "motion/react";
4
- import { c as y } from "../vendors/clsx-OuTLNxxd.js";
5
- import { useControllableValue as x } from "ahooks";
6
- const t = {
7
- "bsy-segmented": "_bsy-segmented_ia83v_1",
8
- "bsy-segmented--block": "_bsy-segmented--block_ia83v_12",
9
- "bsy-segmented__item": "_bsy-segmented__item_ia83v_17",
10
- "bsy-segmented__item--disabled": "_bsy-segmented__item--disabled_ia83v_31",
11
- "bsy-segmented__item--block": "_bsy-segmented__item--block_ia83v_36",
12
- "bsy-segmented__item--active": "_bsy-segmented__item--active_ia83v_44",
13
- "bsy-segmented__item--inactive": "_bsy-segmented__item--inactive_ia83v_48",
14
- "bsy-segmented__slider": "_bsy-segmented__slider_ia83v_53"
15
- }, A = (c) => {
16
- const { options: d, block: i = !1, disabled: l = !1 } = c, [m, u] = x(c), [v, f] = b({ width: 0, left: 0 }), [k, p] = b(!1), n = g(null), a = g(/* @__PURE__ */ new Map()), _ = C(() => {
17
- const e = a.current.get(m), s = n.current;
18
- if (e && s) {
19
- const R = s.getBoundingClientRect(), r = e.getBoundingClientRect();
20
- f({
21
- width: r.width,
22
- left: r.left - R.left
23
- });
24
- }
25
- }, [m]);
26
- return N(() => {
27
- _();
28
- const e = new ResizeObserver(_);
29
- return n.current && e.observe(n.current), () => {
30
- e.disconnect();
31
- };
32
- }, [_]), /* @__PURE__ */ h(
33
- "div",
34
- {
35
- ref: n,
36
- className: y(t["bsy-segmented"], i && t["bsy-segmented--block"]),
37
- style: i ? { gridTemplateColumns: `repeat(${d.length}, 1fr)` } : void 0,
38
- children: [
39
- /* @__PURE__ */ o(
40
- w.div,
41
- {
42
- className: t["bsy-segmented__slider"],
43
- animate: v,
44
- transition: k ? { type: "spring", stiffness: 350, damping: 35 } : { duration: 0 }
45
- }
46
- ),
47
- d.map((e) => /* @__PURE__ */ o(
48
- "button",
49
- {
50
- ref: (s) => {
51
- s ? a.current.set(e.value, s) : a.current.delete(e.value);
52
- },
53
- onClick: () => {
54
- l || (u(e.value), p(!0));
55
- },
56
- className: y(
57
- t["bsy-segmented__item"],
58
- i && t["bsy-segmented__item--block"],
59
- m === e.value ? t["bsy-segmented__item--active"] : t["bsy-segmented__item--inactive"],
60
- {
61
- [t["bsy-segmented__item--disabled"]]: l
62
- }
63
- ),
64
- children: e.label
65
- },
66
- e.value
67
- ))
68
- ]
69
- }
70
- );
71
- };
72
- A.displayName = "BsySegmented";
73
- export {
74
- A as S
75
- };