@baishuyun/ui-base 6.2.0 → 6.3.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.
- package/dist/DropDown/{DropDown-BR-Tz58r.js → DropDown-Bcm6qk53.js} +57 -51
- package/dist/DropDown/index.js +1 -1
- package/dist/Editor/{Buttons-DdZg3jAa.js → Buttons-CYdwN-yX.js} +78 -76
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +2 -2
- package/dist/Editor/index.js +2 -2
- package/dist/components/Calendar/context/CalendarContext.d.ts +2 -2
- package/dist/components/Calendar/utils/dateUtils.d.ts +14 -11
- package/dist/components/Calendar/utils/eventUtils.d.ts +2 -2
- package/dist/components/Calendar/utils/timeUtils.d.ts +3 -2
- package/dist/components/DatePicker/utils/pickerLocale.d.ts +1 -1
- package/dist/components/DropDown/__tests__/DropDown.test.d.ts +1 -0
- package/dist/components/DropDown/interface.d.ts +4 -0
- package/dist/index.js +1 -1
- package/package.json +5 -2
|
@@ -92,70 +92,76 @@ k.displayName = "BsyDropDownMenuList";
|
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/components/DropDown/DropDown.tsx
|
|
94
94
|
var A = (r) => {
|
|
95
|
-
let { t: a } = e(), { children: f, menus:
|
|
95
|
+
let { t: a } = e(), { children: f, menus: h, onClick: b, onSearch: C, searchKey: w = "label", showSearch: T = !0, closeOnSelect: E = !0, searchPlaceholder: O = a("search"), offset: A = {
|
|
96
96
|
x: 0,
|
|
97
97
|
y: 0
|
|
98
|
-
}, zIndex:
|
|
98
|
+
}, zIndex: j = 1101, style: M, activeKey: N = [], getPopupContainer: P } = r, [F, I] = g(r, {
|
|
99
99
|
valuePropName: "visible",
|
|
100
100
|
defaultValue: !1,
|
|
101
101
|
trigger: "onOpenChange"
|
|
102
|
-
}), [
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
e.disabled || (
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
}, { filteredMenus:
|
|
111
|
-
menus:
|
|
112
|
-
searchValue:
|
|
113
|
-
enableInternalFilter: !
|
|
114
|
-
searchKey:
|
|
115
|
-
}), { refs:
|
|
116
|
-
isOpen:
|
|
117
|
-
close:
|
|
102
|
+
}), [L, R] = m(""), z = () => {
|
|
103
|
+
I(!F);
|
|
104
|
+
}, B = () => {
|
|
105
|
+
I(!1);
|
|
106
|
+
}, V = (e) => {
|
|
107
|
+
e.disabled || (b?.(e), E && B());
|
|
108
|
+
}, H = (e) => {
|
|
109
|
+
R(e), C?.(e);
|
|
110
|
+
}, { filteredMenus: U, hasNoResults: W } = S({
|
|
111
|
+
menus: h,
|
|
112
|
+
searchValue: L,
|
|
113
|
+
enableInternalFilter: !C,
|
|
114
|
+
searchKey: w
|
|
115
|
+
}), { refs: G, floatingStyles: K, getReferenceProps: q, getFloatingProps: J } = i({
|
|
116
|
+
isOpen: F,
|
|
117
|
+
close: B,
|
|
118
118
|
showMask: !1,
|
|
119
|
-
zIndex:
|
|
119
|
+
zIndex: j,
|
|
120
120
|
offset: {
|
|
121
|
-
x: o(
|
|
122
|
-
y: o(
|
|
121
|
+
x: o(A.x) ? A.x : 0,
|
|
122
|
+
y: o(A.y) ? A.y : 0
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
return /* @__PURE__ */ l(s, { children: [d(f) ? u(f, {
|
|
126
|
-
...
|
|
127
|
-
ref:
|
|
126
|
+
...q(),
|
|
127
|
+
ref: G.setReference,
|
|
128
128
|
onClick: (e) => {
|
|
129
|
-
|
|
129
|
+
z(), f.props.onClick?.(e);
|
|
130
130
|
}
|
|
131
|
-
}) : f, /* @__PURE__ */ c(y, {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
131
|
+
}) : f, /* @__PURE__ */ c(y, {
|
|
132
|
+
root: p(() => {
|
|
133
|
+
let e = F ? P?.() : void 0;
|
|
134
|
+
return e?.nodeType === 1 ? e : void 0;
|
|
135
|
+
}, [F, P]),
|
|
136
|
+
children: /* @__PURE__ */ c(_, { children: F && /* @__PURE__ */ c("div", {
|
|
137
|
+
ref: G.setFloating,
|
|
138
|
+
...J(),
|
|
139
|
+
style: K,
|
|
140
|
+
children: /* @__PURE__ */ c(v.div, {
|
|
141
|
+
...t,
|
|
142
|
+
children: /* @__PURE__ */ l("div", {
|
|
143
|
+
className: D.dropdown__panel,
|
|
144
|
+
style: M,
|
|
145
|
+
children: [T && /* @__PURE__ */ c("div", {
|
|
146
|
+
className: D.dropdown__search,
|
|
147
|
+
children: /* @__PURE__ */ c(n, {
|
|
148
|
+
value: L,
|
|
149
|
+
onChange: H,
|
|
150
|
+
searchPlaceholder: O
|
|
151
|
+
})
|
|
152
|
+
}), /* @__PURE__ */ c(x, {
|
|
153
|
+
style: { maxHeight: 300 },
|
|
154
|
+
children: /* @__PURE__ */ c(k, {
|
|
155
|
+
menus: U,
|
|
156
|
+
onClick: V,
|
|
157
|
+
hasNoResults: W,
|
|
158
|
+
activeKey: N
|
|
159
|
+
})
|
|
160
|
+
})]
|
|
161
|
+
})
|
|
156
162
|
})
|
|
157
|
-
})
|
|
158
|
-
})
|
|
163
|
+
}) })
|
|
164
|
+
})] });
|
|
159
165
|
};
|
|
160
166
|
A.displayName = "BsyDropDown";
|
|
161
167
|
//#endregion
|
package/dist/DropDown/index.js
CHANGED
|
@@ -4,5 +4,5 @@ import "../vendors/useLocale-DvdSwM9e.js";
|
|
|
4
4
|
import "../Select/SelectInputSearch-CraymTXM.js";
|
|
5
5
|
import "../NotFoundContent/NotFoundContent-7xV-zOG2.js";
|
|
6
6
|
import "../vendors/useFloatingPortal-DsEtsAGW.js";
|
|
7
|
-
import { t as e } from "./DropDown-
|
|
7
|
+
import { t as e } from "./DropDown-Bcm6qk53.js";
|
|
8
8
|
export { e as default };
|
|
@@ -3,26 +3,26 @@ import { t } from "../Modal/Modal-B5AW5GKt.js";
|
|
|
3
3
|
import { t as n } from "../ColorPicker/ColorPicker-CKqNqAsK.js";
|
|
4
4
|
import { t as r } from "../vendors/useLocale-DvdSwM9e.js";
|
|
5
5
|
import { t as i } from "../CheckBox/CheckBox-DIunYcfS.js";
|
|
6
|
-
import { t as a } from "../DropDown/DropDown-
|
|
6
|
+
import { t as a } from "../DropDown/DropDown-Bcm6qk53.js";
|
|
7
7
|
import { FONT_SIZES as o } from "./constants/index.js";
|
|
8
8
|
import { AlignCenterOutlined as s, AlignLeftOutlined as c, AlignRightOutlined as l } from "@ant-design/icons";
|
|
9
9
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
10
|
import p, { createContext as m, forwardRef as h, useCallback as g, useContext as _, useImperativeHandle as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
11
11
|
import { Button as S, Form as C, Input as w, message as T } from "antd";
|
|
12
12
|
import E from "clsx";
|
|
13
|
-
import { AnimatePresence as
|
|
14
|
-
import { $createParagraphNode as
|
|
15
|
-
import { useLexicalComposerContext as
|
|
16
|
-
import { $patchStyleText as
|
|
17
|
-
import { $createLinkNode as
|
|
13
|
+
import { AnimatePresence as ee, motion as D } from "motion/react";
|
|
14
|
+
import { $createParagraphNode as te, $createTextNode as O, $getRoot as ne, $getSelection as k, $isElementNode as A, $isRangeSelection as j, FORMAT_ELEMENT_COMMAND as re, FORMAT_TEXT_COMMAND as M, createCommand as ie } from "lexical";
|
|
15
|
+
import { useLexicalComposerContext as N } from "@lexical/react/LexicalComposerContext";
|
|
16
|
+
import { $patchStyleText as P } from "@lexical/selection";
|
|
17
|
+
import { $createLinkNode as F, $toggleLink as ae, TOGGLE_LINK_COMMAND as oe } from "@lexical/link";
|
|
18
18
|
//#region src/components/Editor/ToolbarPlugin/context/TextFormatsContext.tsx
|
|
19
|
-
var
|
|
19
|
+
var I = m(null), L = {
|
|
20
20
|
"lexical-editor__toolbar-button": "_lexical-editor__toolbar-button_1y192_1",
|
|
21
21
|
"lexical-editor__toolbar-button-active": "_lexical-editor__toolbar-button-active_1y192_7"
|
|
22
|
-
},
|
|
22
|
+
}, R = (t) => {
|
|
23
23
|
let { icon: n, tooltip: r, onClick: i, disabled: a = !1, active: o = !1, size: s = 14 } = t;
|
|
24
24
|
return /* @__PURE__ */ d("button", {
|
|
25
|
-
className: E(
|
|
25
|
+
className: E(L["lexical-editor__toolbar-button"], { [L["lexical-editor__toolbar-button-active"]]: o }),
|
|
26
26
|
type: "button",
|
|
27
27
|
onClick: i,
|
|
28
28
|
disabled: a,
|
|
@@ -32,42 +32,46 @@ var B = m(null), V = {
|
|
|
32
32
|
size: s
|
|
33
33
|
})
|
|
34
34
|
});
|
|
35
|
-
},
|
|
36
|
-
let e = _(
|
|
35
|
+
}, z = () => {
|
|
36
|
+
let e = _(I);
|
|
37
37
|
if (!e) throw Error("useTextFormatsContext must be used within TextFormatsProvider");
|
|
38
38
|
return e;
|
|
39
|
-
},
|
|
40
|
-
let [e] =
|
|
41
|
-
return /* @__PURE__ */ d(
|
|
39
|
+
}, B = () => {
|
|
40
|
+
let [e] = N(), t = z(), { t: n } = r(), i = t.bold;
|
|
41
|
+
return /* @__PURE__ */ d(R, {
|
|
42
42
|
icon: "bold",
|
|
43
43
|
tooltip: n("editor.bold"),
|
|
44
44
|
active: i,
|
|
45
45
|
onClick: () => {
|
|
46
|
-
e.dispatchCommand(
|
|
46
|
+
e.dispatchCommand(M, "bold");
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
},
|
|
50
|
-
let [e] =
|
|
51
|
-
return /* @__PURE__ */ d(
|
|
49
|
+
}, V = () => {
|
|
50
|
+
let [e] = N(), t = z(), { t: n } = r(), i = t.underline;
|
|
51
|
+
return /* @__PURE__ */ d(R, {
|
|
52
52
|
icon: "underline",
|
|
53
53
|
tooltip: n("editor.underline"),
|
|
54
54
|
active: i,
|
|
55
55
|
onClick: () => {
|
|
56
|
-
e.dispatchCommand(
|
|
56
|
+
e.dispatchCommand(M, "underline");
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
-
},
|
|
60
|
-
let [e] =
|
|
61
|
-
return /* @__PURE__ */ d(
|
|
59
|
+
}, H = () => {
|
|
60
|
+
let [e] = N(), t = z(), { t: n } = r(), i = t.italic;
|
|
61
|
+
return /* @__PURE__ */ d(R, {
|
|
62
62
|
icon: "italic",
|
|
63
63
|
tooltip: n("editor.italic"),
|
|
64
64
|
active: i,
|
|
65
65
|
onClick: () => {
|
|
66
|
-
e.dispatchCommand(
|
|
66
|
+
e.dispatchCommand(M, "italic");
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
|
-
},
|
|
70
|
-
let
|
|
69
|
+
}, U = m(null), W = () => {
|
|
70
|
+
let e = _(U);
|
|
71
|
+
if (!e) throw Error("useEditorContainer must be used within EditorContainerProvider");
|
|
72
|
+
return e;
|
|
73
|
+
}, G = () => {
|
|
74
|
+
let [e] = N(), t = z(), { getPopupContainer: n } = W();
|
|
71
75
|
return /* @__PURE__ */ d(a, {
|
|
72
76
|
menus: y(() => o.map((e) => ({
|
|
73
77
|
key: e.value,
|
|
@@ -76,34 +80,31 @@ var B = m(null), V = {
|
|
|
76
80
|
onClick: g((t) => {
|
|
77
81
|
let n = t.key;
|
|
78
82
|
e.update(() => {
|
|
79
|
-
let e =
|
|
80
|
-
|
|
83
|
+
let e = k();
|
|
84
|
+
j(e) && P(e, { "font-size": n });
|
|
81
85
|
});
|
|
82
86
|
}, [e]),
|
|
83
87
|
activeKey: [t.fontSize],
|
|
84
88
|
showSearch: !1,
|
|
89
|
+
getPopupContainer: n,
|
|
85
90
|
style: {
|
|
86
91
|
width: "60px",
|
|
87
92
|
minWidth: "60px"
|
|
88
93
|
},
|
|
89
94
|
children: /* @__PURE__ */ d("div", {
|
|
90
95
|
className: "dropdown__trigger inline-flex",
|
|
91
|
-
children: /* @__PURE__ */ d(
|
|
96
|
+
children: /* @__PURE__ */ d(R, {
|
|
92
97
|
icon: "fontsize",
|
|
93
98
|
tooltip: "字号",
|
|
94
99
|
active: !1
|
|
95
100
|
})
|
|
96
101
|
})
|
|
97
102
|
});
|
|
98
|
-
},
|
|
99
|
-
let e =
|
|
100
|
-
if (!e) throw Error("useEditorContainer must be used within EditorContainerProvider");
|
|
101
|
-
return e;
|
|
102
|
-
}, oe = () => {
|
|
103
|
-
let [e] = F(), t = U(), { t: i } = r(), { getPopupContainer: a } = K(), o = g((t) => {
|
|
103
|
+
}, K = () => {
|
|
104
|
+
let [e] = N(), t = z(), { t: i } = r(), { getPopupContainer: a } = W(), o = g((t) => {
|
|
104
105
|
e.update(() => {
|
|
105
|
-
let e =
|
|
106
|
-
|
|
106
|
+
let e = k();
|
|
107
|
+
j(e) && P(e, { color: t });
|
|
107
108
|
});
|
|
108
109
|
}, [e]);
|
|
109
110
|
return /* @__PURE__ */ d(n, {
|
|
@@ -113,7 +114,7 @@ var B = m(null), V = {
|
|
|
113
114
|
getPopupContainer: a,
|
|
114
115
|
children: /* @__PURE__ */ d("div", {
|
|
115
116
|
className: "trigger-picker inline-flex",
|
|
116
|
-
children: /* @__PURE__ */ d(
|
|
117
|
+
children: /* @__PURE__ */ d(R, {
|
|
117
118
|
icon: "fontcolor",
|
|
118
119
|
tooltip: i("editor.fontColor"),
|
|
119
120
|
onClick: () => {},
|
|
@@ -122,10 +123,10 @@ var B = m(null), V = {
|
|
|
122
123
|
})
|
|
123
124
|
});
|
|
124
125
|
}, se = () => {
|
|
125
|
-
let [e] =
|
|
126
|
+
let [e] = N(), t = z(), { t: i } = r(), { getPopupContainer: a } = W(), o = g((t) => {
|
|
126
127
|
e.update(() => {
|
|
127
|
-
let e =
|
|
128
|
-
|
|
128
|
+
let e = k();
|
|
129
|
+
j(e) && P(e, { "background-color": t });
|
|
129
130
|
});
|
|
130
131
|
}, [e]);
|
|
131
132
|
return /* @__PURE__ */ d(n, {
|
|
@@ -135,7 +136,7 @@ var B = m(null), V = {
|
|
|
135
136
|
getPopupContainer: a,
|
|
136
137
|
children: /* @__PURE__ */ d("div", {
|
|
137
138
|
className: "trigger-picker inline-flex",
|
|
138
|
-
children: /* @__PURE__ */ d(
|
|
139
|
+
children: /* @__PURE__ */ d(R, {
|
|
139
140
|
icon: "fill",
|
|
140
141
|
tooltip: i("editor.fill"),
|
|
141
142
|
onClick: () => {},
|
|
@@ -144,7 +145,7 @@ var B = m(null), V = {
|
|
|
144
145
|
})
|
|
145
146
|
});
|
|
146
147
|
}, ce = () => {
|
|
147
|
-
let [e] =
|
|
148
|
+
let [e] = N(), { align: t } = z(), { t: n } = r(), { getPopupContainer: i } = W(), o = [
|
|
148
149
|
{
|
|
149
150
|
key: "left",
|
|
150
151
|
label: n("leftAlign"),
|
|
@@ -160,30 +161,31 @@ var B = m(null), V = {
|
|
|
160
161
|
label: n("editor.rightAlign"),
|
|
161
162
|
icon: /* @__PURE__ */ d(l, {})
|
|
162
163
|
}
|
|
163
|
-
],
|
|
164
|
-
e.dispatchCommand(
|
|
165
|
-
}, [e]),
|
|
164
|
+
], u = g((t) => {
|
|
165
|
+
e.dispatchCommand(re, t);
|
|
166
|
+
}, [e]), p = o.map((e) => ({
|
|
166
167
|
key: e.key,
|
|
167
168
|
label: /* @__PURE__ */ f("div", {
|
|
168
169
|
className: "flex items-center gap-2",
|
|
169
170
|
children: [e.icon, /* @__PURE__ */ d("span", { children: e.label })]
|
|
170
171
|
})
|
|
171
|
-
})),
|
|
172
|
-
|
|
173
|
-
}, [
|
|
172
|
+
})), m = g((e) => {
|
|
173
|
+
u(e.key);
|
|
174
|
+
}, [u]), h = o.find((e) => e.key === t)?.icon || /* @__PURE__ */ d(c, {});
|
|
174
175
|
return /* @__PURE__ */ d(a, {
|
|
175
|
-
menus:
|
|
176
|
-
onClick:
|
|
176
|
+
menus: p,
|
|
177
|
+
onClick: m,
|
|
177
178
|
showSearch: !1,
|
|
178
179
|
activeKey: [t],
|
|
180
|
+
getPopupContainer: i,
|
|
179
181
|
style: {
|
|
180
182
|
width: "110px",
|
|
181
183
|
minWidth: "110px"
|
|
182
184
|
},
|
|
183
185
|
children: /* @__PURE__ */ d("div", {
|
|
184
186
|
className: "trigger-dropdown inline-flex text-sm",
|
|
185
|
-
children: /* @__PURE__ */ d(
|
|
186
|
-
icon:
|
|
187
|
+
children: /* @__PURE__ */ d(R, {
|
|
188
|
+
icon: h,
|
|
187
189
|
tooltip: n("editor.alignment"),
|
|
188
190
|
onClick: () => {},
|
|
189
191
|
active: !1
|
|
@@ -191,7 +193,7 @@ var B = m(null), V = {
|
|
|
191
193
|
})
|
|
192
194
|
});
|
|
193
195
|
}, le = () => {
|
|
194
|
-
let [e] =
|
|
196
|
+
let [e] = N(), { link: n } = z(), { t: a } = r(), [o, s] = x(!1), [c, l] = x(""), [p, m] = x(""), [h, _] = x(!0), [v, y] = T.useMessage(), b = g((e) => e ? e.startsWith("@") ? "javascript:void(0);" : e.match(/^https?:\/\//) ? e : `http://${e}` : "", []), C = () => {
|
|
195
197
|
if (!c) {
|
|
196
198
|
v.warning(a("editor.linkAddressEmpty"));
|
|
197
199
|
return;
|
|
@@ -202,14 +204,14 @@ var B = m(null), V = {
|
|
|
202
204
|
target: "_blank",
|
|
203
205
|
rel: "noopener noreferrer",
|
|
204
206
|
title: c
|
|
205
|
-
} : { title: c }, n =
|
|
206
|
-
if (
|
|
207
|
+
} : { title: c }, n = k(), r = F(t, e), i = O(p || c);
|
|
208
|
+
if (j(n)) n.isCollapsed() ? (r.append(i), n.insertNodes([r])) : ae(t);
|
|
207
209
|
else {
|
|
208
210
|
r.append(i);
|
|
209
|
-
let e =
|
|
210
|
-
if (
|
|
211
|
+
let e = ne(), t = e.getLastChild();
|
|
212
|
+
if (A(t) && t.isEmpty()) t.append(r);
|
|
211
213
|
else {
|
|
212
|
-
let t =
|
|
214
|
+
let t = te();
|
|
213
215
|
t.append(r), e.append(t);
|
|
214
216
|
}
|
|
215
217
|
}
|
|
@@ -218,7 +220,7 @@ var B = m(null), V = {
|
|
|
218
220
|
n ? (l(n.link === "javascript:void(0);" ? "" : n.link), m(n.linkText)) : (l(""), m("")), s(!0);
|
|
219
221
|
}, [n]);
|
|
220
222
|
return /* @__PURE__ */ f(u, { children: [
|
|
221
|
-
/* @__PURE__ */ d(
|
|
223
|
+
/* @__PURE__ */ d(R, {
|
|
222
224
|
icon: "Insertlink",
|
|
223
225
|
tooltip: a("link"),
|
|
224
226
|
onClick: E,
|
|
@@ -282,12 +284,12 @@ var B = m(null), V = {
|
|
|
282
284
|
})
|
|
283
285
|
] });
|
|
284
286
|
}, ue = () => {
|
|
285
|
-
let [e] =
|
|
286
|
-
return /* @__PURE__ */ d(
|
|
287
|
+
let [e] = N(), { link: t } = z(), { t: n } = r();
|
|
288
|
+
return /* @__PURE__ */ d(R, {
|
|
287
289
|
icon: "cancellink",
|
|
288
290
|
tooltip: n("cancelLink"),
|
|
289
291
|
onClick: () => {
|
|
290
|
-
t && e.dispatchCommand(
|
|
292
|
+
t && e.dispatchCommand(oe, null);
|
|
291
293
|
}
|
|
292
294
|
});
|
|
293
295
|
}, q = {
|
|
@@ -391,9 +393,9 @@ var Y = h((t, n) => {
|
|
|
391
393
|
children: h("editor.clickOrDragToUpload")
|
|
392
394
|
})]
|
|
393
395
|
}),
|
|
394
|
-
/* @__PURE__ */ d(
|
|
396
|
+
/* @__PURE__ */ d(ee, {
|
|
395
397
|
mode: "wait",
|
|
396
|
-
children: i && c && /* @__PURE__ */ f(
|
|
398
|
+
children: i && c && /* @__PURE__ */ f(D.div, {
|
|
397
399
|
className: q["picture-modal__preview"],
|
|
398
400
|
initial: {
|
|
399
401
|
opacity: 0,
|
|
@@ -420,7 +422,7 @@ var Y = h((t, n) => {
|
|
|
420
422
|
]
|
|
421
423
|
},
|
|
422
424
|
children: [
|
|
423
|
-
/* @__PURE__ */ d(
|
|
425
|
+
/* @__PURE__ */ d(D.div, {
|
|
424
426
|
className: q["picture-modal__preview-image"],
|
|
425
427
|
initial: {
|
|
426
428
|
opacity: 0,
|
|
@@ -443,7 +445,7 @@ var Y = h((t, n) => {
|
|
|
443
445
|
alt: h("editor.previewImage")
|
|
444
446
|
})
|
|
445
447
|
}),
|
|
446
|
-
/* @__PURE__ */ f(
|
|
448
|
+
/* @__PURE__ */ f(D.div, {
|
|
447
449
|
className: q["picture-modal__preview-info"],
|
|
448
450
|
initial: {
|
|
449
451
|
opacity: 0,
|
|
@@ -465,7 +467,7 @@ var Y = h((t, n) => {
|
|
|
465
467
|
children: g(c.size)
|
|
466
468
|
})]
|
|
467
469
|
}),
|
|
468
|
-
/* @__PURE__ */ d(
|
|
470
|
+
/* @__PURE__ */ d(D.div, {
|
|
469
471
|
className: q["picture-modal__preview-delete"],
|
|
470
472
|
role: "button",
|
|
471
473
|
onClick: () => {
|
|
@@ -504,8 +506,8 @@ var Y = h((t, n) => {
|
|
|
504
506
|
Y.displayName = "UploadImage";
|
|
505
507
|
//#endregion
|
|
506
508
|
//#region src/components/Editor/commands/ImageCommands.ts
|
|
507
|
-
var X =
|
|
508
|
-
let { t: n } = r(), [i] =
|
|
509
|
+
var X = ie("INSERT_INLINE_IMAGE_COMMAND"), de = () => {
|
|
510
|
+
let { t: n } = r(), [i] = N(), [a, o] = x(!1), s = b(null), c = b(null), l = [{
|
|
509
511
|
key: "upload",
|
|
510
512
|
title: n("editor.uploadImage"),
|
|
511
513
|
icon: /* @__PURE__ */ d(e, { name: "picture" })
|
|
@@ -531,7 +533,7 @@ var X = ne("INSERT_INLINE_IMAGE_COMMAND"), de = () => {
|
|
|
531
533
|
upload: /* @__PURE__ */ d(Y, { ref: c }),
|
|
532
534
|
url: /* @__PURE__ */ d(J, { ref: s })
|
|
533
535
|
};
|
|
534
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
536
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(R, {
|
|
535
537
|
icon: "picture",
|
|
536
538
|
tooltip: n("picture"),
|
|
537
539
|
onClick: () => o(!0)
|
|
@@ -580,11 +582,11 @@ var X = ne("INSERT_INLINE_IMAGE_COMMAND"), de = () => {
|
|
|
580
582
|
}, fe = (e) => {
|
|
581
583
|
Z.delete(e);
|
|
582
584
|
}, pe = (e) => Z.get(e), me = () => Array.from(Z.keys()), $ = {
|
|
583
|
-
bold:
|
|
584
|
-
underline:
|
|
585
|
-
italic:
|
|
586
|
-
fontSize:
|
|
587
|
-
fontColor:
|
|
585
|
+
bold: B,
|
|
586
|
+
underline: V,
|
|
587
|
+
italic: H,
|
|
588
|
+
fontSize: G,
|
|
589
|
+
fontColor: K,
|
|
588
590
|
fill: se,
|
|
589
591
|
align: ce,
|
|
590
592
|
link: le,
|
|
@@ -595,4 +597,4 @@ Object.entries($).forEach(([e, t]) => {
|
|
|
595
597
|
Q(e, t);
|
|
596
598
|
});
|
|
597
599
|
//#endregion
|
|
598
|
-
export { fe as a,
|
|
600
|
+
export { fe as a, R as c, Q as i, I as l, pe as n, X as o, me as r, U as s, $ as t };
|
|
@@ -10,6 +10,6 @@ import "../../../CheckBox/CheckBox-CkVe5Boq.js";
|
|
|
10
10
|
import "../../../CheckBox/CheckBox-DIunYcfS.js";
|
|
11
11
|
import "../../../NotFoundContent/NotFoundContent-7xV-zOG2.js";
|
|
12
12
|
import "../../../vendors/useFloatingPortal-DsEtsAGW.js";
|
|
13
|
-
import "../../../DropDown/DropDown-
|
|
14
|
-
import { a as e, i as t, n, r, t as i } from "../../Buttons-
|
|
13
|
+
import "../../../DropDown/DropDown-Bcm6qk53.js";
|
|
14
|
+
import { a as e, i as t, n, r, t as i } from "../../Buttons-CYdwN-yX.js";
|
|
15
15
|
export { i as default, n as getToolbarButton, r as listRegisteredToolbarButtons, t as registerToolbarButton, e as unregisterToolbarButton };
|
package/dist/Editor/index.js
CHANGED
|
@@ -10,8 +10,8 @@ import "../CheckBox/CheckBox-CkVe5Boq.js";
|
|
|
10
10
|
import "../CheckBox/CheckBox-DIunYcfS.js";
|
|
11
11
|
import "../NotFoundContent/NotFoundContent-7xV-zOG2.js";
|
|
12
12
|
import "../vendors/useFloatingPortal-DsEtsAGW.js";
|
|
13
|
-
import "../DropDown/DropDown-
|
|
14
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s } from "./Buttons-
|
|
13
|
+
import "../DropDown/DropDown-Bcm6qk53.js";
|
|
14
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s } from "./Buttons-CYdwN-yX.js";
|
|
15
15
|
import { DEFAULT_BACKGROUND_COLOR as c, DEFAULT_FONT_COLOR as l, DEFAULT_FONT_SIZE as u } from "./constants/index.js";
|
|
16
16
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
17
17
|
import m, { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
|
|
@@ -25,5 +25,5 @@ export interface CalendarDispatchContextValue {
|
|
|
25
25
|
switchNextDate: () => void;
|
|
26
26
|
onPanelChange: (mode: CalendarMode) => void;
|
|
27
27
|
}
|
|
28
|
-
export declare const CalendarStateContext:
|
|
29
|
-
export declare const CalendarDispatchContext:
|
|
28
|
+
export declare const CalendarStateContext: import('use-context-selector').Context<CalendarStateContextValue | null>;
|
|
29
|
+
export declare const CalendarDispatchContext: import('use-context-selector').Context<CalendarDispatchContextValue | null>;
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { CalendarFormatMessage } from '../internalTypes';
|
|
2
2
|
import { CalendarMode, CalendarTimeInput } from '../interface';
|
|
3
|
-
export declare const getWeekStart: (date: Date | CalendarTimeInput, timeZone?: string) =>
|
|
4
|
-
export declare const getWeekEnd: (date: Date | CalendarTimeInput, timeZone?: string) =>
|
|
3
|
+
export declare const getWeekStart: (date: Date | CalendarTimeInput, timeZone?: string) => import('dayjs').Dayjs;
|
|
4
|
+
export declare const getWeekEnd: (date: Date | CalendarTimeInput, timeZone?: string) => import('dayjs').Dayjs;
|
|
5
5
|
export declare const formatYearMonth: (date: Date | CalendarTimeInput, timeZone: string | undefined, formatMessage: CalendarFormatMessage) => string;
|
|
6
6
|
export declare const formatFullDate: (date: Date | CalendarTimeInput, timeZone: string | undefined, formatMessage: CalendarFormatMessage) => string;
|
|
7
7
|
/** 月/周视图格子日数字:每月 1 号展示 monthDay,其余仅数字。 */
|
|
8
8
|
export declare const formatCalendarDayNumber: (date: Date | CalendarTimeInput, formatMessage: CalendarFormatMessage, timeZone?: string) => string;
|
|
9
9
|
export declare const formatWeekEndDate: (weekEnd: Date | CalendarTimeInput, weekStart: Date | CalendarTimeInput, timeZone: string | undefined, formatMessage: CalendarFormatMessage) => string;
|
|
10
|
-
export declare const addDays: (date: Date, days: number, timeZone?: string) =>
|
|
11
|
-
export declare const addWeeks: (date: Date, weeks: number, timeZone?: string) =>
|
|
12
|
-
export declare const addMonths: (date: Date, months: number, timeZone?: string) =>
|
|
10
|
+
export declare const addDays: (date: Date, days: number, timeZone?: string) => Date;
|
|
11
|
+
export declare const addWeeks: (date: Date, weeks: number, timeZone?: string) => Date;
|
|
12
|
+
export declare const addMonths: (date: Date, months: number, timeZone?: string) => Date;
|
|
13
13
|
export declare const getMonthWeekCount: (date: Date, timeZone?: string) => number;
|
|
14
|
-
export declare const getDynamicMonthViewDates: (date: Date, timeZone?: string) =>
|
|
14
|
+
export declare const getDynamicMonthViewDates: (date: Date, timeZone?: string) => import('dayjs').Dayjs[];
|
|
15
15
|
export declare const getMonthViewRange: (date: Date, timeZone?: string) => {
|
|
16
|
-
start:
|
|
17
|
-
end:
|
|
16
|
+
start: import('dayjs').Dayjs;
|
|
17
|
+
end: import('dayjs').Dayjs;
|
|
18
18
|
};
|
|
19
19
|
/** 用于月视图单元格批量比较,避免在 render 中重复 parse 锚点日期。 */
|
|
20
|
-
export declare const getCalendarMonthKey: (date: Date | CalendarTimeInput, timeZone?: string) =>
|
|
20
|
+
export declare const getCalendarMonthKey: (date: Date | CalendarTimeInput, timeZone?: string) => number;
|
|
21
21
|
export declare const isCurrentMonth: (date: Date | CalendarTimeInput, currentMonth: Date, timeZone?: string) => boolean;
|
|
22
22
|
export declare const getVisibleRangeByMode: (currentDate: Date, viewMode: CalendarMode, timeZone?: string) => {
|
|
23
|
-
start:
|
|
24
|
-
end:
|
|
23
|
+
start: import('dayjs').Dayjs;
|
|
24
|
+
end: import('dayjs').Dayjs;
|
|
25
|
+
} | {
|
|
26
|
+
start: null;
|
|
27
|
+
end: null;
|
|
25
28
|
};
|
|
@@ -39,6 +39,6 @@ export declare const toAbsolutePosition: (layoutEvent: {
|
|
|
39
39
|
isLastInColumn: boolean;
|
|
40
40
|
};
|
|
41
41
|
/** 半开区间重叠(已解析的 dayjs 实例,供 filter + clamp 热路径复用)。 */
|
|
42
|
-
export declare const overlapsHalfOpenInstant: (start: Dayjs, end: Dayjs, rangeStart: Dayjs, rangeEnd: Dayjs) =>
|
|
42
|
+
export declare const overlapsHalfOpenInstant: (start: Dayjs, end: Dayjs, rangeStart: Dayjs, rangeEnd: Dayjs) => boolean;
|
|
43
43
|
/** 半开区间重叠判断:[eventStart, eventEnd) 与 [rangeStart, rangeEnd) */
|
|
44
|
-
export declare const overlapsRangeHalfOpen: (eventStart: CalendarTimeInput, eventEnd: CalendarTimeInput, rangeStart: CalendarTimeInput, rangeEnd: CalendarTimeInput, timeZone?: string) =>
|
|
44
|
+
export declare const overlapsRangeHalfOpen: (eventStart: CalendarTimeInput, eventEnd: CalendarTimeInput, rangeStart: CalendarTimeInput, rangeEnd: CalendarTimeInput, timeZone?: string) => boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as dayjs } from 'dayjs';
|
|
1
2
|
import { CalendarAxis } from '../interface';
|
|
2
3
|
export declare const ZOOM_CONFIG: {
|
|
3
4
|
readonly short: {
|
|
@@ -21,7 +22,7 @@ export declare const getZoomConfig: (axis: CalendarAxis) => ZoomConfig;
|
|
|
21
22
|
export declare const minutesToPixels: (minutes: number, zoomConfig: ZoomConfig) => number;
|
|
22
23
|
export declare const getTotalHeight: (zoomConfig: ZoomConfig) => number;
|
|
23
24
|
export declare const formatTimeLabel: (index: number, zoomConfig: ZoomConfig) => string;
|
|
24
|
-
export declare const getCurrentTimeInTZ: (timeZone?: string) =>
|
|
25
|
+
export declare const getCurrentTimeInTZ: (timeZone?: string) => dayjs.Dayjs;
|
|
25
26
|
export declare const getTimeZoneLabel: (timeZone?: string) => string;
|
|
26
|
-
export declare const isToday: (date: Date, timeZone?: string) =>
|
|
27
|
+
export declare const isToday: (date: Date, timeZone?: string) => boolean;
|
|
27
28
|
export declare const getCurrentTimeTop: (zoomConfig: ZoomConfig, timeZone?: string) => number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Locale } from '../../../locale/index';
|
|
2
|
-
export declare const getPickerLocale: (locale: Locale) =>
|
|
2
|
+
export declare const getPickerLocale: (locale: Locale) => import('@rc-component/picker/interface').Locale;
|
|
3
3
|
export declare const DAYJS_LOCALE_MAP: Record<Locale, string>;
|
|
4
4
|
export declare const resolveDayjsLocale: (locale: Locale) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { t as b } from "./NotFoundContent/NotFoundContent-7xV-zOG2.js";
|
|
|
27
27
|
import "./vendors/useFloatingPortal-DsEtsAGW.js";
|
|
28
28
|
import "./Tree/index.js";
|
|
29
29
|
import { n as x, t as S } from "./Tabs/Tabs-CPRNkfMo.js";
|
|
30
|
-
import { t as C } from "./DropDown/DropDown-
|
|
30
|
+
import { t as C } from "./DropDown/DropDown-Bcm6qk53.js";
|
|
31
31
|
import { t as w } from "./Loading/Loading-WjmzBabh.js";
|
|
32
32
|
import "./NotFoundContent/index.js";
|
|
33
33
|
import { t as T } from "./InputTag/InputTag-zP5QdId7.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ui-base",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "百数云低代码平台通用组件库",
|
|
6
6
|
"author": "bsy-fe team",
|
|
@@ -52,11 +52,14 @@
|
|
|
52
52
|
"@lexical/rich-text": "^0.33.1",
|
|
53
53
|
"@lexical/selection": "^0.33.1",
|
|
54
54
|
"@lexical/utils": "^0.33.1",
|
|
55
|
+
"@tanstack/react-table": "^8.21.3",
|
|
56
|
+
"@tanstack/react-virtual": "^3.14.3",
|
|
57
|
+
"ahooks": "^3.8.5",
|
|
55
58
|
"clsx": "^2.1.1",
|
|
56
59
|
"fuse.js": "^7.1.0",
|
|
57
|
-
"ahooks": "^3.8.5",
|
|
58
60
|
"lexical": "^0.33.1",
|
|
59
61
|
"lodash-es": "^4.17.21",
|
|
62
|
+
"overlayscrollbars": "^2.16.0",
|
|
60
63
|
"simplebar-react": "^3.3.2",
|
|
61
64
|
"tinycolor2": "^1.6.0",
|
|
62
65
|
"use-context-selector": "^2.0.0"
|