@baishuyun/ui-base 6.21.0 → 6.22.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/Amap/index.js +1 -1
- package/dist/Calendar/{Calendar-DYI9CWYE.js → Calendar-C9LHoXQc.js} +1 -1
- package/dist/Calendar/index.js +3 -3
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/CheckBox-BErX3YWP.js +75 -0
- package/dist/CheckBox/CheckBox-Dp7hxT2F.js +37 -0
- package/dist/CheckBox/index.js +3 -3
- package/dist/ColorPicker/index.js +1 -1
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/DatePicker/{DatePicker-CopVj7KA.js → DatePicker-ByZiiZPq.js} +1 -1
- package/dist/DatePicker/{DatePickerPanel-CLCEPUcL.js → DatePickerPanel-DiOVoMv4.js} +1 -1
- package/dist/DatePicker/index.js +2 -2
- package/dist/DropDown/index.js +1 -1
- package/dist/Editor/index.js +1068 -952
- package/dist/Gantt/index.js +1 -1
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/index.js +1 -1
- package/dist/Loading/index.js +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/NotFoundContent/index.js +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Radio/Radio-C0OAW-K-.js +96 -0
- package/dist/Radio/index.js +2 -2
- package/dist/ScrollBar/index.js +1 -1
- package/dist/Segmented/index.js +1 -1
- package/dist/Select/{Select-VIy6OKEj.js → Select-DryXF1Tp.js} +2 -2
- package/dist/Select/index.js +6 -6
- package/dist/Table/index.js +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/Tree/index.js +4 -4
- package/dist/components/CheckBox/CheckBox.d.ts +2 -45
- package/dist/components/CheckBox/Group.d.ts +3 -33
- package/dist/components/CheckBox/index.d.ts +1 -1
- package/dist/components/CheckBox/interface.d.ts +142 -0
- package/dist/components/CheckBox/style/resolveCheckBoxThemeVars.d.ts +2 -0
- package/dist/components/Editor/context/EditorContainerContext.d.ts +2 -1
- package/dist/components/Editor/index.d.ts +1 -1
- package/dist/components/Editor/interface.d.ts +15 -0
- package/dist/components/Editor/plugins/DefaultTextStylePlugin.d.ts +1 -0
- package/dist/components/Editor/plugins/ImePendingFormatPlugin.d.ts +1 -0
- package/dist/components/Editor/utils/applyDefaultTextStyle.d.ts +2 -0
- package/dist/components/Editor/utils/imePendingFormat.d.ts +8 -0
- package/dist/components/Editor/utils/readTextFormats.d.ts +3 -1
- package/dist/components/Editor/utils/stripInlineStyleProperty.d.ts +1 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Radio/interface.d.ts +67 -0
- package/dist/components/Radio/style/resolveRadioThemeVars.d.ts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +8 -8
- package/dist/style.css +1 -1
- package/dist/vendors/{Tree-D0Q1IZ2D.js → Tree-DWK-JPnJ.js} +2 -2
- package/dist/vendors/{version-BVdbN53a.js → version-DH5GPcND.js} +1 -1
- package/package.json +1 -1
- package/dist/CheckBox/CheckBox-CM24-quL.js +0 -33
- package/dist/CheckBox/CheckBox-CcHskTz_.js +0 -67
- package/dist/Radio/Radio-D9jhW7K6.js +0 -85
package/dist/Gantt/index.js
CHANGED
package/dist/Icon/index.js
CHANGED
package/dist/InputTag/index.js
CHANGED
package/dist/Loading/index.js
CHANGED
package/dist/Modal/index.js
CHANGED
package/dist/Overlay/index.js
CHANGED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { t as e } from "../vendors/cssVars-UpriQzph.js";
|
|
2
|
+
import { uniqueId as t } from "lodash-es";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as i, forwardRef as a, useContext as o } from "react";
|
|
5
|
+
import s from "clsx";
|
|
6
|
+
import { useControllableValue as c } from "ahooks";
|
|
7
|
+
//#region src/components/Radio/context/context.ts
|
|
8
|
+
var l = i(null), u = /* @__PURE__ */ function(e) {
|
|
9
|
+
return e.NONE = "none", e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e;
|
|
10
|
+
}({}), d = {
|
|
11
|
+
"bsy-radio": "_bsy-radio_mkmuc_1",
|
|
12
|
+
"bsy-radio--disabled": "_bsy-radio--disabled_mkmuc_8",
|
|
13
|
+
"bsy-radio--full-width": "_bsy-radio--full-width_mkmuc_11",
|
|
14
|
+
"bsy-radio__input": "_bsy-radio__input_mkmuc_15",
|
|
15
|
+
"bsy-radio__input--checked": "_bsy-radio__input--checked_mkmuc_39",
|
|
16
|
+
"bsy-radio__input--disabled": "_bsy-radio__input--disabled_mkmuc_46",
|
|
17
|
+
"bsy-radio__label": "_bsy-radio__label_mkmuc_61",
|
|
18
|
+
"bsy-radio__label--left": "_bsy-radio__label--left_mkmuc_68",
|
|
19
|
+
"bsy-radio-group": "_bsy-radio-group_mkmuc_78",
|
|
20
|
+
"bsy-radio-group--none": "_bsy-radio-group--none_mkmuc_82",
|
|
21
|
+
"bsy-radio-group--vertical": "_bsy-radio-group--vertical_mkmuc_86",
|
|
22
|
+
"bsy-radio-group--horizontal": "_bsy-radio-group--horizontal_mkmuc_91"
|
|
23
|
+
}, f = (t) => {
|
|
24
|
+
if (!t) return {};
|
|
25
|
+
let n = {};
|
|
26
|
+
return e(n, "--bsy-radio-checked-bg", t.checkedBg), e(n, "--bsy-radio-checked-border", t.checkedBorder), e(n, "--bsy-radio-dot-color", t.dotColor), e(n, "--bsy-radio-unchecked-bg", t.uncheckedBg), e(n, "--bsy-radio-color-border", t.colorBorder), e(n, "--bsy-radio-color-border-hover", t.colorBorderHover), e(n, "--bsy-radio-color-bg-disabled", t.colorBgDisabled), e(n, "--bsy-radio-color-border-disabled", t.colorBorderDisabled), e(n, "--bsy-radio-checked-disabled-bg", t.checkedDisabledBg), e(n, "--bsy-radio-checked-disabled-border", t.checkedDisabledBorder), e(n, "--bsy-radio-checked-disabled-dot", t.checkedDisabledDot), n;
|
|
27
|
+
}, p = a((e, i) => {
|
|
28
|
+
let { checked: a, onChange: c, value: p = t("radio"), disabled: m = !1, children: h, style: g, labelPosition: _ = "right", className: v, theme: y } = e, b = o(l), x = b ? b.value === p : a, S = () => {
|
|
29
|
+
m || b?.disabled || (b ? x ? b.onDeselect?.(p) : b.onChange?.(p) : c?.(!x));
|
|
30
|
+
}, C = m || b?.disabled, w = b?.layout === u.NONE || !b?.layout, T = s(d["bsy-radio"], {
|
|
31
|
+
[d["bsy-radio--disabled"]]: C,
|
|
32
|
+
[d["bsy-radio--full-width"]]: w
|
|
33
|
+
}, v), E = s(d["bsy-radio__input"], {
|
|
34
|
+
[d["bsy-radio__input--checked"]]: x,
|
|
35
|
+
[d["bsy-radio__input--disabled"]]: C
|
|
36
|
+
}), D = s(d["bsy-radio__label"], { [d["bsy-radio__label--left"]]: _ === "left" });
|
|
37
|
+
return /* @__PURE__ */ r("div", {
|
|
38
|
+
role: "radio",
|
|
39
|
+
className: T,
|
|
40
|
+
onClick: S,
|
|
41
|
+
style: {
|
|
42
|
+
...f(y),
|
|
43
|
+
...g
|
|
44
|
+
},
|
|
45
|
+
children: [/* @__PURE__ */ n("div", {
|
|
46
|
+
ref: i,
|
|
47
|
+
role: "radio",
|
|
48
|
+
"aria-checked": x,
|
|
49
|
+
tabIndex: C ? -1 : 0,
|
|
50
|
+
className: E,
|
|
51
|
+
"data-layout": b?.layout
|
|
52
|
+
}), h && /* @__PURE__ */ n("span", {
|
|
53
|
+
className: D,
|
|
54
|
+
children: h
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
p.displayName = "BsyRadio";
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/components/Radio/Group.tsx
|
|
61
|
+
var m = ({ disabled: e, layout: t = u.NONE, children: r, className: i, style: a, theme: o, onDeselect: p, ...m }) => {
|
|
62
|
+
let [h, g] = c(m, {
|
|
63
|
+
defaultValue: "",
|
|
64
|
+
valuePropName: "value",
|
|
65
|
+
defaultValuePropName: "defaultValue",
|
|
66
|
+
trigger: "onChange"
|
|
67
|
+
}), _ = s(d["bsy-radio-group"], {
|
|
68
|
+
[d["bsy-radio-group--none"]]: t === u.NONE,
|
|
69
|
+
[d["bsy-radio-group--vertical"]]: t === u.VERTICAL,
|
|
70
|
+
[d["bsy-radio-group--horizontal"]]: t === u.HORIZONTAL
|
|
71
|
+
}, i);
|
|
72
|
+
return /* @__PURE__ */ n(l.Provider, {
|
|
73
|
+
value: {
|
|
74
|
+
value: h,
|
|
75
|
+
onChange: g,
|
|
76
|
+
disabled: e,
|
|
77
|
+
layout: t,
|
|
78
|
+
onDeselect: p
|
|
79
|
+
},
|
|
80
|
+
children: /* @__PURE__ */ n("div", {
|
|
81
|
+
className: _,
|
|
82
|
+
style: {
|
|
83
|
+
...f(o),
|
|
84
|
+
...a
|
|
85
|
+
},
|
|
86
|
+
children: r
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
m.displayName = "BsyRadioGroup";
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/components/Radio/index.ts
|
|
93
|
+
var h = p;
|
|
94
|
+
h.Group = m;
|
|
95
|
+
//#endregion
|
|
96
|
+
export { h as t };
|
package/dist/Radio/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
2
|
-
import { t as e } from "./Radio-
|
|
1
|
+
import "../vendors/version-DH5GPcND.js";
|
|
2
|
+
import { t as e } from "./Radio-C0OAW-K-.js";
|
|
3
3
|
export { e as default };
|
package/dist/ScrollBar/index.js
CHANGED
package/dist/Segmented/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import { n as i, r as a } from "../vendors/animations-ISccYUE3.js";
|
|
|
5
5
|
import { t as o } from "../vendors/useLatchedPopupPortalRoot-CC6af8t-.js";
|
|
6
6
|
import { t as s } from "../vendors/cssVars-UpriQzph.js";
|
|
7
7
|
import { t as c } from "./SelectInputSearch-MApQHnU9.js";
|
|
8
|
-
import { n as l, t as u } from "../vendors/Tree-
|
|
9
|
-
import { t as d } from "../CheckBox/CheckBox-
|
|
8
|
+
import { n as l, t as u } from "../vendors/Tree-DWK-JPnJ.js";
|
|
9
|
+
import { t as d } from "../CheckBox/CheckBox-Dp7hxT2F.js";
|
|
10
10
|
import { t as f } from "../NotFoundContent/NotFoundContent-DJUQ0_2D.js";
|
|
11
11
|
import { t as p } from "../ScrollBar/ScrollBar-IMTuAOF5.js";
|
|
12
12
|
import { t as m } from "../vendors/useFloatingPortal-DJ1iKmW-.js";
|
package/dist/Select/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
1
|
+
import "../vendors/version-DH5GPcND.js";
|
|
2
2
|
import "../ScrollBar/style-D26azwz6.js";
|
|
3
3
|
import "../Icon/Icon-DrdQOEJE.js";
|
|
4
4
|
import "../vendors/LocaleContext-DXQoOKM2.js";
|
|
5
5
|
import "../Overlay/OverlayContext-CVSFoyqN.js";
|
|
6
6
|
import "../vendors/useLocale-Be4e7Xfn.js";
|
|
7
7
|
import "../vendors/useLatchedPopupPortalRoot-CC6af8t-.js";
|
|
8
|
-
import { n as e, r as t, t as n } from "./Select-
|
|
8
|
+
import { n as e, r as t, t as n } from "./Select-DryXF1Tp.js";
|
|
9
9
|
import "./SelectInputSearch-MApQHnU9.js";
|
|
10
|
-
import "../vendors/Tree-
|
|
11
|
-
import "../CheckBox/CheckBox-
|
|
12
|
-
import "../CheckBox/CheckBox-
|
|
13
|
-
import "../Radio/Radio-
|
|
10
|
+
import "../vendors/Tree-DWK-JPnJ.js";
|
|
11
|
+
import "../CheckBox/CheckBox-BErX3YWP.js";
|
|
12
|
+
import "../CheckBox/CheckBox-Dp7hxT2F.js";
|
|
13
|
+
import "../Radio/Radio-C0OAW-K-.js";
|
|
14
14
|
import "../NotFoundContent/NotFoundContent-DJUQ0_2D.js";
|
|
15
15
|
import "../ScrollBar/ScrollBar-IMTuAOF5.js";
|
|
16
16
|
import "../vendors/useFloatingPortal-DJ1iKmW-.js";
|
package/dist/Table/index.js
CHANGED
package/dist/Tabs/index.js
CHANGED
package/dist/Tooltip/index.js
CHANGED
package/dist/Tree/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
1
|
+
import "../vendors/version-DH5GPcND.js";
|
|
2
2
|
import "../Icon/Icon-DrdQOEJE.js";
|
|
3
|
-
import { t as e } from "../vendors/Tree-
|
|
4
|
-
import "../CheckBox/CheckBox-
|
|
5
|
-
import "../Radio/Radio-
|
|
3
|
+
import { t as e } from "../vendors/Tree-DWK-JPnJ.js";
|
|
4
|
+
import "../CheckBox/CheckBox-BErX3YWP.js";
|
|
5
|
+
import "../Radio/Radio-C0OAW-K-.js";
|
|
6
6
|
export { e as Tree };
|
|
@@ -1,46 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description 是否选中
|
|
5
|
-
*/
|
|
6
|
-
checked?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* @description 默认是否选中
|
|
9
|
-
*/
|
|
10
|
-
defaultChecked?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* @description 是否禁用
|
|
13
|
-
*/
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* @description 半选状态
|
|
17
|
-
*/
|
|
18
|
-
indeterminate?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* @description 值改变时的回调
|
|
21
|
-
*/
|
|
22
|
-
onChange?: (checked: boolean) => void;
|
|
23
|
-
/**
|
|
24
|
-
* @description 自定义类名
|
|
25
|
-
*/
|
|
26
|
-
className?: string;
|
|
27
|
-
/**
|
|
28
|
-
* @description 自定义样式
|
|
29
|
-
*/
|
|
30
|
-
style?: React.CSSProperties;
|
|
31
|
-
/**
|
|
32
|
-
* @description 子元素
|
|
33
|
-
*/
|
|
34
|
-
children?: React.ReactNode;
|
|
35
|
-
/**
|
|
36
|
-
* @description label 的位置,默认在右侧
|
|
37
|
-
* @default 'right'
|
|
38
|
-
*/
|
|
39
|
-
labelPosition?: 'left' | 'right';
|
|
40
|
-
/**
|
|
41
|
-
* @description checkbox 的值,用于 checkbox group
|
|
42
|
-
*/
|
|
43
|
-
value?: string | number;
|
|
44
|
-
}
|
|
45
|
-
declare const BsyCheckbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
import { CheckboxProps } from './interface';
|
|
2
|
+
declare const BsyCheckbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
46
3
|
export default BsyCheckbox;
|
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @description 选中的值
|
|
5
|
-
*/
|
|
6
|
-
value?: Array<string | number>;
|
|
7
|
-
/**
|
|
8
|
-
* @description 默认选中的值
|
|
9
|
-
*/
|
|
10
|
-
defaultValue?: Array<string | number>;
|
|
11
|
-
/**
|
|
12
|
-
* @description 值改变时的回调
|
|
13
|
-
*/
|
|
14
|
-
onChange?: (checkedValues: Array<string | number>) => void;
|
|
15
|
-
/**
|
|
16
|
-
* @description 是否禁用
|
|
17
|
-
*/
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* @description 布局方式
|
|
21
|
-
* @default 'none'
|
|
22
|
-
*/
|
|
23
|
-
layout?: Layout;
|
|
24
|
-
/**
|
|
25
|
-
* @description Checkbox 子元素
|
|
26
|
-
*/
|
|
27
|
-
children?: React.ReactNode;
|
|
28
|
-
/**
|
|
29
|
-
* @description 自定义类名
|
|
30
|
-
*/
|
|
31
|
-
className?: string;
|
|
32
|
-
}
|
|
33
|
-
declare const CheckboxGroup: React.FC<CheckboxGroupProps>;
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CheckboxGroupProps } from './interface';
|
|
3
|
+
declare const CheckboxGroup: FC<CheckboxGroupProps>;
|
|
34
4
|
export default CheckboxGroup;
|
|
@@ -5,5 +5,5 @@ type CompoundedComponent = typeof InternalCheckbox & {
|
|
|
5
5
|
};
|
|
6
6
|
declare const Checkbox: CompoundedComponent;
|
|
7
7
|
export default Checkbox;
|
|
8
|
-
export type { CheckboxProps } from './
|
|
8
|
+
export type { CheckboxProps, CheckboxGroupProps, CheckBoxTheme } from './interface';
|
|
9
9
|
export type { Layout } from './constants';
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { Layout } from './constants';
|
|
3
|
+
export interface CheckBoxTheme {
|
|
4
|
+
/**
|
|
5
|
+
* @description 选中背景色
|
|
6
|
+
*/
|
|
7
|
+
checkedBg?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @description 选中边框色
|
|
10
|
+
*/
|
|
11
|
+
checkedBorder?: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description 选中勾选图标色
|
|
14
|
+
*/
|
|
15
|
+
checkIconColor?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description 未选背景色
|
|
18
|
+
*/
|
|
19
|
+
uncheckedBg?: string;
|
|
20
|
+
/**
|
|
21
|
+
* @description 未选边框色
|
|
22
|
+
*/
|
|
23
|
+
colorBorder?: string;
|
|
24
|
+
/**
|
|
25
|
+
* @description 未选悬停边框色
|
|
26
|
+
*/
|
|
27
|
+
colorBorderHover?: string;
|
|
28
|
+
/**
|
|
29
|
+
* @description 半选背景色
|
|
30
|
+
*/
|
|
31
|
+
indeterminateBg?: string;
|
|
32
|
+
/**
|
|
33
|
+
* @description 半选边框色
|
|
34
|
+
*/
|
|
35
|
+
indeterminateBorder?: string;
|
|
36
|
+
/**
|
|
37
|
+
* @description 半选指示条颜色
|
|
38
|
+
*/
|
|
39
|
+
indeterminateIndicator?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @description 禁用背景色
|
|
42
|
+
*/
|
|
43
|
+
colorBgDisabled?: string;
|
|
44
|
+
/**
|
|
45
|
+
* @description 禁用边框色
|
|
46
|
+
*/
|
|
47
|
+
colorBorderDisabled?: string;
|
|
48
|
+
/**
|
|
49
|
+
* @description 禁用勾选图标色
|
|
50
|
+
*/
|
|
51
|
+
checkIconColorDisabled?: string;
|
|
52
|
+
/**
|
|
53
|
+
* @description 禁用半选指示条颜色
|
|
54
|
+
*/
|
|
55
|
+
indeterminateIndicatorDisabled?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface CheckboxProps {
|
|
58
|
+
/**
|
|
59
|
+
* @description 是否选中
|
|
60
|
+
*/
|
|
61
|
+
checked?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @description 默认是否选中
|
|
64
|
+
*/
|
|
65
|
+
defaultChecked?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* @description 是否禁用
|
|
68
|
+
*/
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* @description 半选状态
|
|
72
|
+
*/
|
|
73
|
+
indeterminate?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* @description 值改变时的回调
|
|
76
|
+
*/
|
|
77
|
+
onChange?: (checked: boolean) => void;
|
|
78
|
+
/**
|
|
79
|
+
* @description 自定义类名
|
|
80
|
+
*/
|
|
81
|
+
className?: string;
|
|
82
|
+
/**
|
|
83
|
+
* @description 自定义样式
|
|
84
|
+
*/
|
|
85
|
+
style?: CSSProperties;
|
|
86
|
+
/**
|
|
87
|
+
* @description 子元素
|
|
88
|
+
*/
|
|
89
|
+
children?: ReactNode;
|
|
90
|
+
/**
|
|
91
|
+
* @description label 的位置,默认在右侧
|
|
92
|
+
* @default 'right'
|
|
93
|
+
*/
|
|
94
|
+
labelPosition?: 'left' | 'right';
|
|
95
|
+
/**
|
|
96
|
+
* @description checkbox 的值,用于 checkbox group
|
|
97
|
+
*/
|
|
98
|
+
value?: string | number;
|
|
99
|
+
/**
|
|
100
|
+
* @description 组件级颜色 token
|
|
101
|
+
*/
|
|
102
|
+
theme?: CheckBoxTheme;
|
|
103
|
+
}
|
|
104
|
+
export interface CheckboxGroupProps {
|
|
105
|
+
/**
|
|
106
|
+
* @description 选中的值
|
|
107
|
+
*/
|
|
108
|
+
value?: Array<string | number>;
|
|
109
|
+
/**
|
|
110
|
+
* @description 默认选中的值
|
|
111
|
+
*/
|
|
112
|
+
defaultValue?: Array<string | number>;
|
|
113
|
+
/**
|
|
114
|
+
* @description 值改变时的回调
|
|
115
|
+
*/
|
|
116
|
+
onChange?: (checkedValues: Array<string | number>) => void;
|
|
117
|
+
/**
|
|
118
|
+
* @description 是否禁用
|
|
119
|
+
*/
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* @description 布局方式
|
|
123
|
+
* @default 'none'
|
|
124
|
+
*/
|
|
125
|
+
layout?: Layout;
|
|
126
|
+
/**
|
|
127
|
+
* @description Checkbox 子元素
|
|
128
|
+
*/
|
|
129
|
+
children?: ReactNode;
|
|
130
|
+
/**
|
|
131
|
+
* @description 自定义类名
|
|
132
|
+
*/
|
|
133
|
+
className?: string;
|
|
134
|
+
/**
|
|
135
|
+
* @description 自定义样式
|
|
136
|
+
*/
|
|
137
|
+
style?: CSSProperties;
|
|
138
|
+
/**
|
|
139
|
+
* @description 组件级颜色 token,子项可覆盖同名变量
|
|
140
|
+
*/
|
|
141
|
+
theme?: CheckBoxTheme;
|
|
142
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dispatch, MutableRefObject, RefObject, SetStateAction } from 'react';
|
|
2
|
-
import { EditorAi, EditorAiMode, EditorAiPreset, EditorAiStatus, EditorUpload } from '../interface';
|
|
2
|
+
import { EditorAi, EditorAiMode, EditorAiPreset, EditorAiStatus, EditorDefaultTextStyle, EditorUpload } from '../interface';
|
|
3
3
|
export type EditorAiSession = {
|
|
4
4
|
originalHtml: string;
|
|
5
5
|
originalText?: string;
|
|
@@ -9,6 +9,7 @@ export type EditorAiSession = {
|
|
|
9
9
|
interface EditorContainerContextType {
|
|
10
10
|
containerRef: RefObject<HTMLDivElement | null>;
|
|
11
11
|
toolbarRef: RefObject<HTMLDivElement>;
|
|
12
|
+
defaultTextStyle: EditorDefaultTextStyle;
|
|
12
13
|
upload?: EditorUpload;
|
|
13
14
|
aiOpen: EditorAiMode | null;
|
|
14
15
|
setAiOpen: Dispatch<SetStateAction<EditorAiMode | null>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Editor as default } from './Editor';
|
|
2
2
|
export { EditorHtmlPreview } from './EditorHtmlPreview';
|
|
3
|
-
export type { EditorUpload, EditorUploadContext, EditorUploadResult, EditorAi, EditorAiMode, EditorAiPreset, EditorAiStatus, EditorProps, EditorTheme, EditorContainerTheme, EditorToolbarFloating, EditorToolbarMode, EditorToolbarOffset, EditorToolbarPlacement, EditorToolbarProps, EditorToolbarSize, EditorToolbarTheme, } from './interface';
|
|
3
|
+
export type { EditorUpload, EditorUploadContext, EditorUploadResult, EditorAi, EditorAiMode, EditorAiPreset, EditorAiStatus, EditorProps, EditorTheme, EditorContainerTheme, EditorDefaultTextStyle, EditorToolbarFloating, EditorToolbarMode, EditorToolbarOffset, EditorToolbarPlacement, EditorToolbarProps, EditorToolbarSize, EditorToolbarTheme, } from './interface';
|
|
4
4
|
export { registerToolbarButton, unregisterToolbarButton, listRegisteredToolbarButtons, } from './ToolbarPlugin/Buttons';
|
|
5
5
|
export type { IconToolbarButtonName, TextToolbarButtonName, ToolbarButtonName, RegisteredToolbarButtonProps, } from './ToolbarPlugin/Buttons';
|
|
6
6
|
export type { ToolbarConfigButton } from './ToolbarPlugin/interface.d';
|
|
@@ -49,8 +49,18 @@ export interface EditorContainerTheme {
|
|
|
49
49
|
borderWidth?: string | number;
|
|
50
50
|
/** 根节点圆角 @default 4px */
|
|
51
51
|
borderRadius?: string | number;
|
|
52
|
+
/** 输入容器背景色;未传保持透明 */
|
|
53
|
+
bgColor?: string;
|
|
52
54
|
}
|
|
53
55
|
|
|
56
|
+
/** 实例级默认字符样式;只影响新输入与工具栏回落,不改写已有 HTML */
|
|
57
|
+
export type EditorDefaultTextStyle = {
|
|
58
|
+
color?: string;
|
|
59
|
+
/** `32` 与 `'32px'` 等价 */
|
|
60
|
+
fontSize?: string | number;
|
|
61
|
+
backgroundColor?: string;
|
|
62
|
+
};
|
|
63
|
+
|
|
54
64
|
export interface EditorTheme {
|
|
55
65
|
toolbar?: EditorToolbarTheme;
|
|
56
66
|
container?: EditorContainerTheme;
|
|
@@ -120,6 +130,11 @@ export type EditorProps = {
|
|
|
120
130
|
|
|
121
131
|
toolbar?: EditorToolbarProps;
|
|
122
132
|
|
|
133
|
+
/**
|
|
134
|
+
* 空稿输入与工具栏未着色时的字符样式,不改写已回填 HTML。
|
|
135
|
+
*/
|
|
136
|
+
defaultTextStyle?: EditorDefaultTextStyle;
|
|
137
|
+
|
|
123
138
|
/**
|
|
124
139
|
* 编辑器受控内容
|
|
125
140
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function DefaultTextStylePlugin(): null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ImePendingFormatPlugin(): null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ImePendingFormat = {
|
|
2
|
+
format: number;
|
|
3
|
+
style: string;
|
|
4
|
+
offset: number;
|
|
5
|
+
key: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function $deferPendingFormatForIme(): ImePendingFormat | null;
|
|
8
|
+
export declare function $applyPendingFormatAfterIme(pending: ImePendingFormat): void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { LexicalEditor } from 'lexical';
|
|
2
2
|
import { TextFormatsState } from '../ToolbarPlugin/context/TextFormatsContext';
|
|
3
|
+
import { EditorDefaultTextStyle } from '../interface';
|
|
4
|
+
export declare const createIdleTextFormats: (defaults?: EditorDefaultTextStyle) => TextFormatsState;
|
|
3
5
|
export declare const IDLE_TEXT_FORMATS: TextFormatsState;
|
|
4
|
-
export declare const $readTextFormats: (isFocused: boolean) => TextFormatsState;
|
|
6
|
+
export declare const $readTextFormats: (isFocused: boolean, defaults?: EditorDefaultTextStyle) => TextFormatsState;
|
|
5
7
|
export declare const applyWithLiveFormats: (editor: LexicalEditor, apply: (formats: TextFormatsState) => void) => void;
|
|
6
8
|
export declare const ensureEditableLiveFormats: (editor: LexicalEditor) => TextFormatsState;
|
|
@@ -45,6 +45,68 @@ export interface RadioProps {
|
|
|
45
45
|
* @description radio 的值,用于 radio group
|
|
46
46
|
*/
|
|
47
47
|
value?: string | number;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @description 组件级颜色 token
|
|
51
|
+
*/
|
|
52
|
+
theme?: RadioTheme;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface RadioTheme {
|
|
56
|
+
/**
|
|
57
|
+
* @description 选中背景色
|
|
58
|
+
*/
|
|
59
|
+
checkedBg?: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @description 选中边框色
|
|
63
|
+
*/
|
|
64
|
+
checkedBorder?: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @description 选中圆点色
|
|
68
|
+
*/
|
|
69
|
+
dotColor?: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @description 未选背景色
|
|
73
|
+
*/
|
|
74
|
+
uncheckedBg?: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @description 未选边框色
|
|
78
|
+
*/
|
|
79
|
+
colorBorder?: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @description 未选悬停边框色
|
|
83
|
+
*/
|
|
84
|
+
colorBorderHover?: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @description 禁用未选背景色
|
|
88
|
+
*/
|
|
89
|
+
colorBgDisabled?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @description 禁用未选边框色
|
|
93
|
+
*/
|
|
94
|
+
colorBorderDisabled?: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @description 禁用已选背景色
|
|
98
|
+
*/
|
|
99
|
+
checkedDisabledBg?: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @description 禁用已选边框色
|
|
103
|
+
*/
|
|
104
|
+
checkedDisabledBorder?: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @description 禁用已选圆点色
|
|
108
|
+
*/
|
|
109
|
+
checkedDisabledDot?: string;
|
|
48
110
|
}
|
|
49
111
|
|
|
50
112
|
export interface RadioGroupProps {
|
|
@@ -93,4 +155,9 @@ export interface RadioGroupProps {
|
|
|
93
155
|
* @description 自定义样式
|
|
94
156
|
*/
|
|
95
157
|
style?: React.CSSProperties;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @description 组件级颜色 token,子项可覆盖同名变量
|
|
161
|
+
*/
|
|
162
|
+
theme?: RadioTheme;
|
|
96
163
|
}
|