@baishuyun/ui-base 2.2.3 → 2.2.5
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/Card/Card-Y1ISqAp9.js +86 -0
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/{CheckBox-VlP6u_-s.js → CheckBox-C9sXWSA5.js} +1 -1
- package/dist/CheckBox/index.js +1 -1
- package/dist/ColorPicker/{ColorPicker-049kyJn6.js → ColorPicker-DNIXPakN.js} +70 -64
- package/dist/ColorPicker/index.js +1 -1
- package/dist/DropDown/{DropDown-BkTY-3y0.js → DropDown-DGkSeXQT.js} +1 -1
- package/dist/DropDown/index.js +1 -1
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +6 -2
- package/dist/Editor/{index-C0MY9j94.js → index-CCq3AgcW.js} +426 -412
- package/dist/Editor/index.js +115 -108
- package/dist/Icon/Icon-CBlIwtp2.js +24 -0
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/{InputTag-S9hHXsyQ.js → InputTag-C6MbuO-e.js} +1 -1
- package/dist/InputTag/index.js +1 -1
- package/dist/Modal/{Modal-oRJ-Almn.js → Modal-z3TvEXwN.js} +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/Select/{Select-BiARGTPz.js → Select-hwXXDuLU.js} +3 -3
- package/dist/Select/{SelectInputSearch-DigfTvpo.js → SelectInputSearch-ChUpUgxa.js} +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/Tabs/{TabSelect-bKB0Qe9F.js → TabSelect-DL8Bhehc.js} +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Tree/index.js +1 -1
- package/dist/components/Card/Card.type.d.ts +9 -1
- package/dist/components/ColorPicker/ColorPicker.type.d.ts +11 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/index.d.ts +6 -3
- package/dist/components/Editor/ToolbarPlugin/Buttons/registry.d.ts +6 -0
- package/dist/components/Editor/ToolbarPlugin/interface.d.ts +4 -3
- package/dist/components/Editor/index.d.ts +5 -0
- package/dist/index.js +9 -9
- package/dist/vendors/{Tree-CjrhMBFX.js → Tree-CLEy-xqz.js} +2 -2
- package/dist/vendors/{lexical-DdSmj_Kv.js → lexical-DO7eMeC2.js} +7 -7
- package/package.json +2 -2
- package/dist/Card/Card-DHOMkrEE.js +0 -74
- package/dist/Icon/Icon-CkHAU1fA.js +0 -24
|
@@ -17,10 +17,18 @@ export interface CardProps {
|
|
|
17
17
|
*/
|
|
18
18
|
minWidth?: number;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* 是否默认展开(非受控模式)
|
|
21
21
|
* @default false
|
|
22
22
|
*/
|
|
23
23
|
defaultExpanded?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 是否展开(受控模式)
|
|
26
|
+
*/
|
|
27
|
+
expanded?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 展开状态变化回调
|
|
30
|
+
*/
|
|
31
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
24
32
|
/**
|
|
25
33
|
* 自定义类名
|
|
26
34
|
*/
|
|
@@ -22,4 +22,15 @@ export interface ColorPickerProps {
|
|
|
22
22
|
* 预设颜色
|
|
23
23
|
*/
|
|
24
24
|
presetColors?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* 指定颜色选择器浮层菜单渲染的父级 DOM 节点
|
|
27
|
+
* @default undefined (默认渲染到 body 元素上)
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <ColorPicker getPopupContainer={() => document.getElementById('container')}>
|
|
31
|
+
* <button>选择颜色</button>
|
|
32
|
+
* </ColorPicker>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
getPopupContainer?: () => HTMLElement;
|
|
25
36
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { getToolbarButton, listRegisteredToolbarButtons, registerToolbarButton, unregisterToolbarButton } from './registry';
|
|
2
|
+
declare const builtinButtons: {
|
|
2
3
|
bold: import('react').FC<{}>;
|
|
3
4
|
underline: import('react').FC<{}>;
|
|
4
5
|
italic: import('react').FC<{}>;
|
|
@@ -10,5 +11,7 @@ declare const Buttons: {
|
|
|
10
11
|
unLink: import('react').FC<{}>;
|
|
11
12
|
picture: import('react').FC<{}>;
|
|
12
13
|
};
|
|
13
|
-
export type
|
|
14
|
-
export
|
|
14
|
+
export type BuiltinButtonName = keyof typeof builtinButtons;
|
|
15
|
+
export type ToolbarButtonName = BuiltinButtonName | (string & {});
|
|
16
|
+
export { registerToolbarButton, unregisterToolbarButton, getToolbarButton, listRegisteredToolbarButtons, };
|
|
17
|
+
export default builtinButtons;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
export type ToolbarButtonComponent = ComponentType<any>;
|
|
3
|
+
export declare const registerToolbarButton: (name: string, component: ToolbarButtonComponent) => void;
|
|
4
|
+
export declare const unregisterToolbarButton: (name: string) => void;
|
|
5
|
+
export declare const getToolbarButton: (name: string) => ToolbarButtonComponent | undefined;
|
|
6
|
+
export declare const listRegisteredToolbarButtons: () => string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ToolbarButtonName } from './Buttons';
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
export interface ToolbarButtonProps {
|
|
@@ -13,11 +13,12 @@ export interface ToolbarButtonProps {
|
|
|
13
13
|
key: string;
|
|
14
14
|
/**
|
|
15
15
|
* @description 按钮组名称
|
|
16
|
+
* @description 自定义按钮名称需要通过 registerToolbarButton 先注册
|
|
16
17
|
*/
|
|
17
18
|
buttons: Array<
|
|
18
|
-
|
|
|
19
|
+
| ToolbarButtonName
|
|
19
20
|
| {
|
|
20
|
-
name:
|
|
21
|
+
name: ToolbarButtonName;
|
|
21
22
|
/**
|
|
22
23
|
* @description 各个 button 组件的 props
|
|
23
24
|
*/
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export { Editor as default } from './Editor';
|
|
2
2
|
export type { EditorProps } from './interface';
|
|
3
|
+
export { registerToolbarButton, unregisterToolbarButton, listRegisteredToolbarButtons, } from './ToolbarPlugin/Buttons';
|
|
4
|
+
export type { ToolbarButtonName } from './ToolbarPlugin/Buttons';
|
|
5
|
+
export { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
6
|
+
export { $getRoot } from 'lexical';
|
|
7
|
+
export { default as BaseButton } from './ToolbarPlugin/BaseButton/BaseButton';
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { I as W } from "./Icon/Icon-
|
|
1
|
+
import { I as W } from "./Icon/Icon-CBlIwtp2.js";
|
|
2
2
|
import { jsx as p } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo as a, useCallback as u } from "react";
|
|
4
4
|
import { z as i, L as f } from "./vendors/useLocale-DgqW9M3h.js";
|
|
5
|
-
import { C as Y } from "./Card/Card-
|
|
6
|
-
import { M as _ } from "./Modal/Modal-
|
|
7
|
-
import { C as oe } from "./ColorPicker/ColorPicker-
|
|
5
|
+
import { C as Y } from "./Card/Card-Y1ISqAp9.js";
|
|
6
|
+
import { M as _ } from "./Modal/Modal-z3TvEXwN.js";
|
|
7
|
+
import { C as oe } from "./ColorPicker/ColorPicker-DNIXPakN.js";
|
|
8
8
|
import { S as ae } from "./Segmented/Segmented-UgzW78Ey.js";
|
|
9
|
-
import { S as re } from "./Select/Select-
|
|
10
|
-
import { T as se } from "./vendors/Tree-
|
|
9
|
+
import { S as re } from "./Select/Select-hwXXDuLU.js";
|
|
10
|
+
import { T as se } from "./vendors/Tree-CLEy-xqz.js";
|
|
11
11
|
import { default as ce } from "./CheckBox/index.js";
|
|
12
12
|
import { default as de } from "./Radio/index.js";
|
|
13
|
-
import { a as pe, T as ue } from "./Tabs/TabSelect-
|
|
14
|
-
import { D as Ce } from "./DropDown/DropDown-
|
|
13
|
+
import { a as pe, T as ue } from "./Tabs/TabSelect-DL8Bhehc.js";
|
|
14
|
+
import { D as Ce } from "./DropDown/DropDown-DGkSeXQT.js";
|
|
15
15
|
import { L as Ie } from "./Loading/Loading-CEB4PLUE.js";
|
|
16
16
|
import { N as Le } from "./NotFoundContent/NotFoundContent-h0-oIXlk.js";
|
|
17
|
-
import { I as ke } from "./InputTag/InputTag-
|
|
17
|
+
import { I as ke } from "./InputTag/InputTag-C6MbuO-e.js";
|
|
18
18
|
const C = "Please select", U = "search", I = "No search data", x = "Select All", L = "Please enter the content", S = "No Data", k = "No Data Found", h = "Data Searching...", A = "Select All by Search", P = "Left Align", y = "Center Align", N = "Right Align", R = "Underline", F = "Link", T = "Hyper Link", D = "Show Content", b = "Link Address", v = "Open in New Tab", z = "Confirm", w = "Cancel", M = "Cancel Link", E = "preset color", O = { linkTip: "Support https://link or @form alias", bold: "Bold", italic: "Italic", fontSize: "Font Size", fontColor: "Font Color", fill: "fill", alignment: "Alignment", centerAlign: "Center Align", rightAlign: "Right Align", uploadImage: "Upload Image", imageUrl: "Image URL", imageUrlPlaceholder: "Please enter image URL", imageUrlRequired: "Please enter image URL", imageUrlInvalid: "Please enter a valid image URL", imageUrlNote: "Note: Enter image URL to insert image", inputImageUrl: "Enter Image URL", uploadImageNote: "Note: Single image size cannot exceed 1MB", uploadImageText: "Click or drag to upload image", previewImage: "Preview Image", underline: "Underline", imageFormatOnly: "Only image formats are supported", uploadImageFirst: "Please upload image first", imageAddSuccess: "Image added successfully", operationFailed: "Operation failed", onlyImageFormatsSupported: "Only image formats are supported", pleaseUploadImageFirst: "Please upload image first", imageSizeNote: "Image size cannot exceed 1MB", clickOrDragToUpload: "Click or drag to upload image", enterImageUrl: "Enter image URL", pleaseEnterImageUrl: "Please enter image URL", pleaseEnterValidImageUrl: "Please enter a valid image URL", linkAddressEmpty: "Link address cannot be empty" }, B = "Picture", V = "Custom Color", j = "Add Picture", q = {
|
|
19
19
|
select: C,
|
|
20
20
|
search: U,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as l, jsxs as N, Fragment as O } from "react/jsx-runtime";
|
|
2
2
|
import M, { useMemo as j, useCallback as P, createContext as A, useContext as V, useEffect as R } from "react";
|
|
3
|
-
import { I as $ } from "../Icon/Icon-
|
|
3
|
+
import { I as $ } from "../Icon/Icon-CBlIwtp2.js";
|
|
4
4
|
import { c as E } from "./clsx-OuTLNxxd.js";
|
|
5
5
|
import { n as _ } from "./lodash-es-DFpaJB4Y.js";
|
|
6
|
-
import { B as z } from "../CheckBox/CheckBox-
|
|
6
|
+
import { B as z } from "../CheckBox/CheckBox-C9sXWSA5.js";
|
|
7
7
|
import F from "../Radio/index.js";
|
|
8
8
|
import { AnimatePresence as W, motion as q } from "motion/react";
|
|
9
9
|
import { useControllableValue as B } from "ahooks";
|
|
@@ -2,17 +2,17 @@ var xl = Object.defineProperty;
|
|
|
2
2
|
var Cl = (n, e, t) => e in n ? xl(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var ae = (n, e, t) => Cl(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as nr from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { useContext as vl, createContext as Sl, useMemo as Ht, useLayoutEffect as vt, useEffect as rt, useState as ht, useRef as bl, Suspense as kl, forwardRef as Jo, useCallback as wl } from "react";
|
|
6
6
|
import { jsx as xe, jsxs as Uo, Fragment as jo } from "react/jsx-runtime";
|
|
7
7
|
import { flushSync as Tl, createPortal as Nl } from "react-dom";
|
|
8
|
-
const Vo =
|
|
8
|
+
const Vo = Sl(null);
|
|
9
9
|
function El(n, e) {
|
|
10
10
|
return { getTheme: function() {
|
|
11
11
|
return e ?? null;
|
|
12
12
|
} };
|
|
13
13
|
}
|
|
14
14
|
function St() {
|
|
15
|
-
const n =
|
|
15
|
+
const n = vl(Vo);
|
|
16
16
|
return n == null && (function(e, ...t) {
|
|
17
17
|
const r = new URL("https://lexical.dev/docs/error"), i = new URLSearchParams();
|
|
18
18
|
i.append("code", e);
|
|
@@ -5873,19 +5873,19 @@ export {
|
|
|
5873
5873
|
Xn as i,
|
|
5874
5874
|
rn as j,
|
|
5875
5875
|
du as k,
|
|
5876
|
-
|
|
5876
|
+
P as l,
|
|
5877
5877
|
Oc as m,
|
|
5878
5878
|
xu as n,
|
|
5879
5879
|
St as o,
|
|
5880
|
-
|
|
5880
|
+
ie as p,
|
|
5881
5881
|
kt as q,
|
|
5882
5882
|
Qt as r,
|
|
5883
5883
|
M as s,
|
|
5884
5884
|
pu as t,
|
|
5885
|
-
|
|
5885
|
+
Re as u,
|
|
5886
5886
|
fu as v,
|
|
5887
5887
|
Mi as w,
|
|
5888
5888
|
v as x,
|
|
5889
5889
|
oe as y,
|
|
5890
|
-
|
|
5890
|
+
ca as z
|
|
5891
5891
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ui-base",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "百数云低代码平台通用组件库",
|
|
6
6
|
"author": "bsy-fe team",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"project": {
|
|
87
87
|
"iconfont": {
|
|
88
|
-
"scriptUrl": "https://at.alicdn.com/t/c/
|
|
88
|
+
"scriptUrl": "https://at.alicdn.com/t/c/font_4786625_djm4gsgobsp.js"
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { jsxs as e, jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { useState as l } from "react";
|
|
3
|
-
import { c as n } from "../vendors/clsx-OuTLNxxd.js";
|
|
4
|
-
import { I as p } from "../Icon/Icon-CkHAU1fA.js";
|
|
5
|
-
const _ = {
|
|
6
|
-
"bsy-card": "_bsy-card_myftj_1",
|
|
7
|
-
"bsy-card__header": "_bsy-card__header_myftj_6",
|
|
8
|
-
"bsy-card__title": "_bsy-card__title_myftj_13",
|
|
9
|
-
"bsy-card__icon-container": "_bsy-card__icon-container_myftj_24",
|
|
10
|
-
"bsy-card__icon": "_bsy-card__icon_myftj_24",
|
|
11
|
-
"bsy-card__icon--expanded": "_bsy-card__icon--expanded_myftj_43",
|
|
12
|
-
"bsy-card__content": "_bsy-card__content_myftj_46",
|
|
13
|
-
"bsy-card__content--expanded": "_bsy-card__content--expanded_myftj_52",
|
|
14
|
-
"bsy-card__content-inner": "_bsy-card__content-inner_myftj_55"
|
|
15
|
-
}, x = ({
|
|
16
|
-
title: r,
|
|
17
|
-
children: t,
|
|
18
|
-
minWidth: s = 240,
|
|
19
|
-
defaultExpanded: i = !1,
|
|
20
|
-
className: o,
|
|
21
|
-
style: y,
|
|
22
|
-
styles: a
|
|
23
|
-
}) => {
|
|
24
|
-
const [d, b] = l(i), m = () => {
|
|
25
|
-
b(!d);
|
|
26
|
-
};
|
|
27
|
-
return /* @__PURE__ */ e(
|
|
28
|
-
"div",
|
|
29
|
-
{
|
|
30
|
-
className: n(_["bsy-card"], o),
|
|
31
|
-
style: {
|
|
32
|
-
minWidth: `${s}px`,
|
|
33
|
-
...y
|
|
34
|
-
},
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ e(
|
|
37
|
-
"div",
|
|
38
|
-
{
|
|
39
|
-
className: _["bsy-card__header"],
|
|
40
|
-
onClick: m,
|
|
41
|
-
style: a == null ? void 0 : a.header,
|
|
42
|
-
children: [
|
|
43
|
-
/* @__PURE__ */ c("div", { className: _["bsy-card__title"], role: "heading", children: r }),
|
|
44
|
-
/* @__PURE__ */ c("div", { className: _["bsy-card__icon-container"], children: /* @__PURE__ */ c(
|
|
45
|
-
p,
|
|
46
|
-
{
|
|
47
|
-
name: "xialakuangxiala1",
|
|
48
|
-
className: n(
|
|
49
|
-
_["bsy-card__icon"],
|
|
50
|
-
d && _["bsy-card__icon--expanded"]
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
) })
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
),
|
|
57
|
-
/* @__PURE__ */ c(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
className: n(
|
|
61
|
-
_["bsy-card__content"],
|
|
62
|
-
d && _["bsy-card__content--expanded"]
|
|
63
|
-
),
|
|
64
|
-
children: /* @__PURE__ */ c("div", { className: _["bsy-card__content-inner"], style: a == null ? void 0 : a.body, children: t })
|
|
65
|
-
}
|
|
66
|
-
)
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
x.displayName = "BsyCard";
|
|
72
|
-
export {
|
|
73
|
-
x as C
|
|
74
|
-
};
|
|
@@ -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 f } from "../vendors/lodash-es-DFpaJB4Y.js";
|
|
4
|
-
const a = e({
|
|
5
|
-
scriptUrl: "https://at.alicdn.com/t/c/font_4786625_c3hfvyi874p.js"
|
|
6
|
-
}), I = ({ name: o, style: c, className: n, onClick: r, color: s, size: t = 16 }) => {
|
|
7
|
-
const m = {
|
|
8
|
-
color: s,
|
|
9
|
-
fontSize: f(t) ? `${t}px` : t,
|
|
10
|
-
...c
|
|
11
|
-
};
|
|
12
|
-
return /* @__PURE__ */ p(
|
|
13
|
-
a,
|
|
14
|
-
{
|
|
15
|
-
onClick: r,
|
|
16
|
-
type: `icon-${o}`,
|
|
17
|
-
style: m,
|
|
18
|
-
className: `${n || ""}`
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
I
|
|
24
|
-
};
|