@para-ui/core 5.0.0-beta.4 → 5.0.0-beta.7
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/README.md +46 -0
- package/es/AutoButton/index.js +22 -22
- package/es/Button/index.d.ts +7 -4
- package/es/CheckboxGroup/index.d.ts +6 -6
- package/es/CheckboxGroup/index.js +21 -21
- package/es/FormItem/compoments/formSelect/index.d.ts +2 -2
- package/es/FormItem/compoments/formSelect/index.js +13 -13
- package/es/Pagination/index.js +11 -10
- package/es/RadioGroup/index.d.ts +6 -7
- package/es/RadioGroup/index.js +2 -2
- package/es/Select/index.d.ts +39 -16
- package/es/Select/index.js +324 -317
- package/es/Table/interface.d.ts +9 -11
- package/es/ToggleButton/ToggleButtonGroup.d.ts +8 -8
- package/es/ToggleButton/ToggleButtonGroup.js +27 -27
- package/es/ToggleButton/index.d.ts +5 -6
- package/es/ToggleButton/index.js +13 -13
- package/es/Utils/type.d.ts +3 -1
- package/es/_virtual/index3.js +2 -2
- package/es/_virtual/index4.js +2 -2
- package/es/node_modules/@para-snack/core/dist/index.js +1 -1
- package/es/node_modules/classnames/index.js +1 -1
- package/lib/Argv/batchEdit/index.js +1 -1
- package/lib/AutoButton/index.js +1 -1
- package/lib/Button/index.d.ts +7 -4
- package/lib/CheckboxGroup/index.d.ts +6 -6
- package/lib/CheckboxGroup/index.js +1 -1
- package/lib/CodeEditor/index.js +1 -1
- package/lib/FormItem/compoments/formSelect/index.d.ts +2 -2
- package/lib/FormItem/compoments/formSelect/index.js +1 -1
- package/lib/InputCode/index.js +1 -1
- package/lib/Pagination/index.js +1 -1
- package/lib/RadioGroup/index.d.ts +6 -7
- package/lib/RadioGroup/index.js +1 -1
- package/lib/Select/index.d.ts +39 -16
- package/lib/Select/index.js +1 -1
- package/lib/Table/interface.d.ts +9 -11
- package/lib/ToggleButton/ToggleButtonGroup.d.ts +8 -8
- package/lib/ToggleButton/ToggleButtonGroup.js +1 -1
- package/lib/ToggleButton/index.d.ts +5 -6
- package/lib/ToggleButton/index.js +1 -1
- package/lib/Utils/type.d.ts +3 -1
- package/lib/node_modules/@para-snack/core/dist/index.js +1 -1
- package/lib/node_modules/classnames/index.js +1 -1
- package/package.json +1 -1
- /package/lib/{CodeEditor → InputCode}/index.css +0 -0
package/README.md
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
1
|
+
## 🎉 para-ui/core@5.0.0-beta.7 发布
|
|
2
|
+
|
|
3
|
+
⚠️【Breaking Change】
|
|
4
|
+
|
|
5
|
+
- 【表格-Table】`setCheck` 签名修正:`(arr: T[], data: T) => void` → `(keys: string[], data: T[]) => void`。第一参数始终为选中行的 rowKey 字符串数组(JS 对象键规范保证),第二参数为选中行的数据数组;原类型声明与运行时不符,业务代码普遍通过 `useState<any>` 绕过,升级后需按新签名声明
|
|
6
|
+
- 【表格-Table】`checkDefaultValue` 签名修正:`T[]` → `string[]`,与 `setCheck` 对齐,传入的是 rowKey 字符串数组;业务主键为 `number` 时需自行 `keys.map(String)`
|
|
7
|
+
- 【表格-Table】`data` 由 `Anyjson[]` 收窄为 `T[]`,`render(row)` 等回调里 `row` 按 `<Table<T>>` 指定的业务类型精确推导;以前依赖 `Anyjson` 索引签名访问未声明字段的代码需在 `T` 中显式声明字段
|
|
8
|
+
- 【表格-Table】`HeadDataProps` / `HeadDataReqProps` / `TableProps` / `ReqProps` / `FilterEnumsProps` 移除 `[name: string]: unknown` / `[key: string]: unknown` 索引签名,未声明字段的透传写法会 TS 报错
|
|
9
|
+
- 【表格-Table】`TableHeadBodyPublicProps.operate` 补齐泛型:`HeadDataProps` → `HeadDataProps<T>`,`operate.render(row)` 的 `row` 能推导为业务类型 `T`
|
|
10
|
+
- 【按钮-Button / IconButton】移除 `[name: string]: any` 索引签名;原生属性基类由 `React.ButtonHTMLAttributes<any>` 精确化为 `button / a` 共用的 DOM 属性集合,`type` 收窄为 `'button' | 'submit' | 'reset'`。原来依赖"未声明字段透传"或 `type` 传入自定义字符串的写法会 TS 报错
|
|
11
|
+
|
|
12
|
+
🔧【Bugfix】
|
|
13
|
+
|
|
14
|
+
- 【自动按钮-AutoButton】修复 `SplitButton.options` 内嵌套数组项被当成单选项渲染导致报错的问题
|
|
15
|
+
|
|
16
|
+
## 🎉 para-ui/core@5.0.0-beta.6 发布
|
|
17
|
+
|
|
18
|
+
🎁【Feature】
|
|
19
|
+
|
|
20
|
+
- 【下拉框-Select】泛型按 `multiple` 判别:`SelectProps` 拆分为 `SelectSingleProps | SelectMultipleProps`,单选 `value` / `onChange` 推导为 `T`,多选推导为 `T[]`,使用方无需再处理 `T | T[]` 联合
|
|
21
|
+
|
|
22
|
+
⚠️【Breaking Change】
|
|
23
|
+
|
|
24
|
+
- 【下拉框-Select】单选清空时 `onChange` 入参由 `''` 调整为 `undefined`。原有 `if (val === '')` 写法需改为 `if (val === undefined)`;受控模式下旧代码传 `value=""` 仍能被识别为清空(向后兼容保留)
|
|
25
|
+
|
|
26
|
+
🔧【Bugfix】
|
|
27
|
+
|
|
28
|
+
- 【下拉框-Select】修复受控模式下 `value` 被置为 `undefined` 时 UI 未同步清空的问题
|
|
29
|
+
|
|
30
|
+
## 🎉 para-ui/core@5.0.0-beta.5 发布
|
|
31
|
+
|
|
32
|
+
🎁【Feature】
|
|
33
|
+
|
|
34
|
+
- 【单选框组-RadioGroup】支持泛型,`value`/`onChange` 可指定精确类型,替代原 `unknown`
|
|
35
|
+
- 【切换按钮-ToggleButton / ToggleButtonGroup】支持泛型,值类型由调用方指定
|
|
36
|
+
- 【复选框组-CheckboxGroup】支持泛型,`value` 可窄化到 `'a' | 'b'` 等枚举
|
|
37
|
+
- 【下拉框-Select】支持泛型,`value`/`onChange` 可窄化;`SelectProps` 严格化(移除索引签名,禁止未声明字段透传);新增共享类型 `SelectOptionValue`
|
|
38
|
+
|
|
39
|
+
🔧【Bugfix】
|
|
40
|
+
|
|
41
|
+
- 【下拉框-Select】修复 `fetchSuggestions` 未走全局 `componentsProps.Select` 默认值合并
|
|
42
|
+
- 【下拉框-Select】`handleInitValue` 内 `multiple` 判断与其它位置保持一致
|
|
43
|
+
- 【下拉框-Select】`closest` 内部辅助函数去除 `any`,复用 `VendorPrefixedElement` 类型
|
|
44
|
+
- 【动态多值框-FormSelect】过滤自定义 `change` 回调,不再泄漏到 Select DOM
|
|
45
|
+
- 【切换按钮组-ToggleButtonGroup】`icon` 字段不再透传给 Button 造成无效属性
|
|
46
|
+
|
|
1
47
|
## 🎉 para-ui/core@5.0.0-beta.4 发布
|
|
2
48
|
|
|
3
49
|
🔧【Bugfix】
|
package/es/AutoButton/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { j as n } from "../_virtual/jsx-runtime.js";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as w, useRef as y, useEffect as S, Fragment as u } from "react";
|
|
3
3
|
import { Button as i } from "../Button/index.js";
|
|
4
4
|
import z from "../AutoTips/index.js";
|
|
5
5
|
import { PopConfirm as E } from "../PopConfirm/index.js";
|
|
6
6
|
import { MoreVert as F } from "../node_modules/@para-ui/icons/MoreVert/index.js";
|
|
7
|
-
import { $prefixCls as
|
|
7
|
+
import { $prefixCls as C } from "../GlobalContext/constant.js";
|
|
8
8
|
import { Dropdown as O } from "../Dropdown/index.js";
|
|
9
9
|
import { Tooltip as J } from "../Tooltip/index.js";
|
|
10
|
-
import
|
|
10
|
+
import v from "clsx";
|
|
11
11
|
import L from "../GlobalContext/useFormatMessage.js";
|
|
12
12
|
import V from "./lang/index.js";
|
|
13
13
|
import q from "../Utils/Hooks/useResizeObserver.js";
|
|
@@ -17,12 +17,12 @@ const lt = (P) => {
|
|
|
17
17
|
className: M,
|
|
18
18
|
style: T,
|
|
19
19
|
list: e,
|
|
20
|
-
marginRight:
|
|
20
|
+
marginRight: f = "16px",
|
|
21
21
|
moreProps: B,
|
|
22
22
|
morePlacement: N = "bottomLeft",
|
|
23
23
|
moreMaxWidth: R = "500px",
|
|
24
24
|
trigger: k = ["hover"]
|
|
25
|
-
} = P,
|
|
25
|
+
} = P, A = L("AutoButton", V), [l, d] = w(null), c = y(null), a = y({
|
|
26
26
|
timer: null
|
|
27
27
|
});
|
|
28
28
|
q({
|
|
@@ -33,7 +33,7 @@ const lt = (P) => {
|
|
|
33
33
|
}, [e]);
|
|
34
34
|
const h = () => {
|
|
35
35
|
a.current.timer && clearTimeout(a.current.timer), a.current.timer = setTimeout(() => {
|
|
36
|
-
|
|
36
|
+
d(e.length), e.length > 1 && b();
|
|
37
37
|
}, 100);
|
|
38
38
|
}, b = (t) => {
|
|
39
39
|
if (t === null || t === 0) return;
|
|
@@ -41,9 +41,9 @@ const lt = (P) => {
|
|
|
41
41
|
const o = c.current;
|
|
42
42
|
if (o && o.scrollWidth > o.clientWidth) {
|
|
43
43
|
const r = Number(t) - 1;
|
|
44
|
-
|
|
44
|
+
d(r), b(r);
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, D = (t, o, r) => {
|
|
47
47
|
if (r) {
|
|
48
48
|
r.onClick && r.onClick(o);
|
|
49
49
|
return;
|
|
@@ -55,11 +55,11 @@ const lt = (P) => {
|
|
|
55
55
|
variant: "text",
|
|
56
56
|
disabled: t.disabled,
|
|
57
57
|
loading: t.loading,
|
|
58
|
-
className:
|
|
58
|
+
className: v("item-btn", {
|
|
59
59
|
"item-btn-disabled": t.disabled
|
|
60
60
|
}),
|
|
61
61
|
onClick: (s) => {
|
|
62
|
-
t.disabled ||
|
|
62
|
+
t.disabled || D(t, s, r);
|
|
63
63
|
},
|
|
64
64
|
children: /* @__PURE__ */ n.jsx(z, { placement: "top-start", children: t[o] })
|
|
65
65
|
}
|
|
@@ -70,16 +70,16 @@ const lt = (P) => {
|
|
|
70
70
|
...t.disabledTooltip,
|
|
71
71
|
children: g(t, o, r)
|
|
72
72
|
}
|
|
73
|
-
) : g(t, o, r),
|
|
73
|
+
) : g(t, o, r), $ = () => /* @__PURE__ */ n.jsx(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
76
|
className: "auto-button-dropdown-content",
|
|
77
77
|
style: { maxWidth: R },
|
|
78
|
-
children: e && e.map((t, o) => l !== null && l > o ? null : t.buttonType !== "split" ? /* @__PURE__ */ n.jsx(u, { children: m(t, j(t, "children")) }, o) : /* @__PURE__ */ n.jsx(u, { children: t.options?.map((r, s) => /* @__PURE__ */ n.jsx(u, { children: m(r, j(r, "label", t)) }, `${o}-${s}`)) }, o))
|
|
78
|
+
children: e && e.map((t, o) => l !== null && l > o ? null : t.buttonType !== "split" ? /* @__PURE__ */ n.jsx(u, { children: m(t, j(t, "children")) }, o) : /* @__PURE__ */ n.jsx(u, { children: t.options?.map((r, s) => Array.isArray(r) ? null : /* @__PURE__ */ n.jsx(u, { children: m(r, j(r, "label", t)) }, `${o}-${s}`)) }, o))
|
|
79
79
|
}
|
|
80
|
-
),
|
|
80
|
+
), I = () => {
|
|
81
81
|
if (!(l !== null && e.length > l)) return null;
|
|
82
|
-
const { buttonType: t, icon: o = /* @__PURE__ */ n.jsx(F, {}), children: r =
|
|
82
|
+
const { buttonType: t, icon: o = /* @__PURE__ */ n.jsx(F, {}), children: r = A({ id: "more" }) } = B || {};
|
|
83
83
|
let s = /* @__PURE__ */ n.jsx(
|
|
84
84
|
i,
|
|
85
85
|
{
|
|
@@ -99,8 +99,8 @@ const lt = (P) => {
|
|
|
99
99
|
)), /* @__PURE__ */ n.jsx(
|
|
100
100
|
O,
|
|
101
101
|
{
|
|
102
|
-
overlayClassName: `${
|
|
103
|
-
overlay:
|
|
102
|
+
overlayClassName: `${C}-auto-button-dropdown`,
|
|
103
|
+
overlay: $(),
|
|
104
104
|
placement: N,
|
|
105
105
|
trigger: k,
|
|
106
106
|
children: s
|
|
@@ -110,29 +110,29 @@ const lt = (P) => {
|
|
|
110
110
|
return /* @__PURE__ */ n.jsxs(
|
|
111
111
|
"div",
|
|
112
112
|
{
|
|
113
|
-
className:
|
|
113
|
+
className: v(M, `${C}-auto-button`),
|
|
114
114
|
style: T,
|
|
115
115
|
ref: c,
|
|
116
116
|
children: [
|
|
117
117
|
e.map((t, o) => {
|
|
118
118
|
if (l !== null && l <= o) return null;
|
|
119
|
-
const { buttonType: r, popConfirmProps: s, ...
|
|
119
|
+
const { buttonType: r, popConfirmProps: s, ...W } = t;
|
|
120
120
|
let p = i;
|
|
121
121
|
const x = {
|
|
122
|
-
marginRight: l === o + 1 ? 0 :
|
|
122
|
+
marginRight: l === o + 1 ? 0 : f
|
|
123
123
|
};
|
|
124
|
-
return l !== null && e.length > l && (x.marginRight =
|
|
124
|
+
return l !== null && e.length > l && (x.marginRight = f), r === "icon" && (p = i.IconButton), r === "split" && (p = i.SplitButton), /* @__PURE__ */ n.jsx(u, { children: m(
|
|
125
125
|
t,
|
|
126
126
|
/* @__PURE__ */ n.jsx(
|
|
127
127
|
p,
|
|
128
128
|
{
|
|
129
|
-
...
|
|
129
|
+
...W,
|
|
130
130
|
style: x
|
|
131
131
|
}
|
|
132
132
|
)
|
|
133
133
|
) }, o);
|
|
134
134
|
}),
|
|
135
|
-
|
|
135
|
+
I()
|
|
136
136
|
]
|
|
137
137
|
}
|
|
138
138
|
);
|
package/es/Button/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { default as React, FunctionComponent } from 'react';
|
|
2
2
|
import { TooltipProps } from '../Tooltip';
|
|
3
3
|
import { default as SplitButton } from './SplitButton';
|
|
4
|
-
|
|
4
|
+
type ButtonOrAnchorAttributes = Omit<React.ButtonHTMLAttributes<HTMLElement> & React.AnchorHTMLAttributes<HTMLElement>, 'type'>;
|
|
5
|
+
export interface ButtonProps extends ButtonOrAnchorAttributes {
|
|
6
|
+
/** 原生 button type */
|
|
7
|
+
type?: 'button' | 'submit' | 'reset';
|
|
5
8
|
variant?: 'contained' | 'outlined' | 'text';
|
|
6
9
|
/** 设置按钮载入状态 */
|
|
7
10
|
loading?: boolean | {
|
|
@@ -35,9 +38,10 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<any> {
|
|
|
35
38
|
target?: string;
|
|
36
39
|
/** 禁用提示 */
|
|
37
40
|
disabledTooltip?: TooltipProps;
|
|
38
|
-
[name: string]: any;
|
|
39
41
|
}
|
|
40
|
-
export interface IconButtonProps extends
|
|
42
|
+
export interface IconButtonProps extends ButtonOrAnchorAttributes {
|
|
43
|
+
/** 原生 button type */
|
|
44
|
+
type?: 'button' | 'submit' | 'reset';
|
|
41
45
|
/** 按钮形状 */
|
|
42
46
|
variant?: 'contained' | 'outlined' | 'text' | 'activate';
|
|
43
47
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -65,7 +69,6 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<any> {
|
|
|
65
69
|
target?: string;
|
|
66
70
|
/** 禁用提示 */
|
|
67
71
|
disabledTooltip?: TooltipProps;
|
|
68
|
-
[name: string]: any;
|
|
69
72
|
}
|
|
70
73
|
declare const InternalButton: FunctionComponent<ButtonProps>;
|
|
71
74
|
declare const IconButton: FunctionComponent<IconButtonProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as React,
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { CheckboxProps } from '../Checkbox';
|
|
3
3
|
import { LabelTooltipProps } from '../Label';
|
|
4
4
|
import { HelperTextDetailProps } from '../HelperText';
|
|
@@ -6,7 +6,7 @@ export interface CheckboxListProps extends CheckboxProps {
|
|
|
6
6
|
/** 唯一标识值 */
|
|
7
7
|
name?: string | number;
|
|
8
8
|
}
|
|
9
|
-
export interface CheckboxGroupProps extends HelperTextDetailProps {
|
|
9
|
+
export interface CheckboxGroupProps<T extends string | number = string | number> extends HelperTextDetailProps {
|
|
10
10
|
/** 样式class */
|
|
11
11
|
className?: string;
|
|
12
12
|
/** style */
|
|
@@ -28,15 +28,15 @@ export interface CheckboxGroupProps extends HelperTextDetailProps {
|
|
|
28
28
|
/** 是否禁用 */
|
|
29
29
|
disabled?: boolean;
|
|
30
30
|
/** 默认值 不受控 */
|
|
31
|
-
defaultValue?:
|
|
31
|
+
defaultValue?: T[];
|
|
32
32
|
/** 值 */
|
|
33
|
-
value?:
|
|
33
|
+
value?: T[];
|
|
34
34
|
/** 选中选值 */
|
|
35
35
|
id?: string;
|
|
36
36
|
/** 选项数据 */
|
|
37
37
|
list: CheckboxListProps[] | CheckboxListProps[][];
|
|
38
38
|
/** 改变值 */
|
|
39
|
-
onChange?: (val:
|
|
39
|
+
onChange?: (val: T[]) => void;
|
|
40
40
|
}
|
|
41
|
-
export declare
|
|
41
|
+
export declare function CheckboxGroup<T extends string | number = string | number>(props: CheckboxGroupProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
42
42
|
export default CheckboxGroup;
|
|
@@ -6,7 +6,7 @@ import R from "../HelperText/index.js";
|
|
|
6
6
|
import { DeepClone as S } from "@paraview/lib";
|
|
7
7
|
import { $prefixCls as t } from "../GlobalContext/constant.js";
|
|
8
8
|
import './index.css';/* empty css */
|
|
9
|
-
|
|
9
|
+
function K(l) {
|
|
10
10
|
const {
|
|
11
11
|
label: h = "",
|
|
12
12
|
labelTooltip: n,
|
|
@@ -30,9 +30,9 @@ const M = (l) => {
|
|
|
30
30
|
}, []), C(() => {
|
|
31
31
|
l.value !== void 0 && f(l.value);
|
|
32
32
|
}, [l.value]);
|
|
33
|
-
const N = (e) => (
|
|
33
|
+
const N = (e) => (a, s) => {
|
|
34
34
|
const o = e[m], r = S(d);
|
|
35
|
-
if (
|
|
35
|
+
if (s)
|
|
36
36
|
r.push(o);
|
|
37
37
|
else {
|
|
38
38
|
const B = r.indexOf(o);
|
|
@@ -42,8 +42,8 @@ const M = (l) => {
|
|
|
42
42
|
}, V = () => {
|
|
43
43
|
if (h || g) {
|
|
44
44
|
const e = () => {
|
|
45
|
-
let
|
|
46
|
-
return n && n.className && (
|
|
45
|
+
let a = "checkbox-group-label";
|
|
46
|
+
return n && n.className && (a += ` ${n.className}`), a;
|
|
47
47
|
};
|
|
48
48
|
return /* @__PURE__ */ c.jsx(
|
|
49
49
|
I,
|
|
@@ -55,12 +55,12 @@ const M = (l) => {
|
|
|
55
55
|
}
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
|
-
}, $ = (e,
|
|
58
|
+
}, $ = (e, a, s) => {
|
|
59
59
|
const o = {
|
|
60
60
|
display: "inline-block",
|
|
61
61
|
...e.style
|
|
62
62
|
};
|
|
63
|
-
return b && p &&
|
|
63
|
+
return b && p && s.length !== a + 1 && (o.marginRight = b), x && (o.width = x), o;
|
|
64
64
|
}, A = () => {
|
|
65
65
|
let e = `${t}-checkbox-group`;
|
|
66
66
|
return y && (e += ` ${y}`), i && (e += ` ${t}-checkbox-group-${i}`), k && (e += ` ${t}-checkbox-group-error`), u && (e += ` ${t}-checkbox-group-disabled`), p ? e += ` ${t}-checkbox-group-row` : e += ` ${t}-checkbox-group-column`, e;
|
|
@@ -72,7 +72,7 @@ const M = (l) => {
|
|
|
72
72
|
style: T,
|
|
73
73
|
children: [
|
|
74
74
|
V(),
|
|
75
|
-
/* @__PURE__ */ c.jsx("div", { className: "checkbox-group-content", children: v.map((e,
|
|
75
|
+
/* @__PURE__ */ c.jsx("div", { className: "checkbox-group-content", children: v.map((e, a) => {
|
|
76
76
|
if (Array.isArray(e))
|
|
77
77
|
return /* @__PURE__ */ c.jsx(
|
|
78
78
|
"div",
|
|
@@ -91,7 +91,7 @@ const M = (l) => {
|
|
|
91
91
|
checked: d.indexOf(o[m]) !== -1,
|
|
92
92
|
size: i,
|
|
93
93
|
disabled: !!(u || o.disabled),
|
|
94
|
-
key:
|
|
94
|
+
key: a,
|
|
95
95
|
onChange: N(o)
|
|
96
96
|
}
|
|
97
97
|
)
|
|
@@ -99,28 +99,28 @@ const M = (l) => {
|
|
|
99
99
|
r
|
|
100
100
|
))
|
|
101
101
|
},
|
|
102
|
-
|
|
102
|
+
a
|
|
103
103
|
);
|
|
104
|
-
const
|
|
104
|
+
const s = e;
|
|
105
105
|
return /* @__PURE__ */ c.jsx(
|
|
106
106
|
"span",
|
|
107
107
|
{
|
|
108
108
|
className: "checkbox-item-box",
|
|
109
|
-
style: $(
|
|
109
|
+
style: $(s, a, v),
|
|
110
110
|
children: /* @__PURE__ */ E(
|
|
111
111
|
w,
|
|
112
112
|
{
|
|
113
|
-
...
|
|
113
|
+
...s,
|
|
114
114
|
style: {},
|
|
115
|
-
checked: d.indexOf(
|
|
115
|
+
checked: d.indexOf(s[m]) !== -1,
|
|
116
116
|
size: i,
|
|
117
|
-
disabled: !!(u ||
|
|
118
|
-
key:
|
|
119
|
-
onChange: N(
|
|
117
|
+
disabled: !!(u || s.disabled),
|
|
118
|
+
key: a,
|
|
119
|
+
onChange: N(s)
|
|
120
120
|
}
|
|
121
121
|
)
|
|
122
122
|
},
|
|
123
|
-
|
|
123
|
+
a
|
|
124
124
|
);
|
|
125
125
|
}) }),
|
|
126
126
|
/* @__PURE__ */ c.jsx(
|
|
@@ -135,9 +135,9 @@ const M = (l) => {
|
|
|
135
135
|
]
|
|
136
136
|
}
|
|
137
137
|
);
|
|
138
|
-
}
|
|
138
|
+
}
|
|
139
139
|
export {
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
K as CheckboxGroup,
|
|
141
|
+
K as default
|
|
142
142
|
};
|
|
143
143
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { SelectProps } from '../../../Select';
|
|
3
|
-
export
|
|
3
|
+
export type FormSelectProps = Omit<SelectProps, 'value' | 'defaultValue' | 'onChange'> & {
|
|
4
4
|
/**
|
|
5
5
|
* 默认值
|
|
6
6
|
*/
|
|
@@ -13,6 +13,6 @@ export interface FormSelectProps extends SelectProps {
|
|
|
13
13
|
* 绑定值
|
|
14
14
|
*/
|
|
15
15
|
value?: string;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
declare const FormSelect: FC<FormSelectProps>;
|
|
18
18
|
export default FormSelect;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const h = (
|
|
5
|
-
const { defaultValue: s = "", change:
|
|
6
|
-
a
|
|
1
|
+
import { j as m } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import f from "../../../Select/index.js";
|
|
4
|
+
const h = (r) => {
|
|
5
|
+
const { defaultValue: s = "", change: t, value: e, ...u } = r, [c, o] = l.useState(e !== void 0 ? e : s), n = (a) => {
|
|
6
|
+
o(a), t && t(a);
|
|
7
7
|
};
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
}, [e]), /* @__PURE__ */
|
|
11
|
-
|
|
8
|
+
return l.useEffect(() => {
|
|
9
|
+
o(e);
|
|
10
|
+
}, [e]), /* @__PURE__ */ m.jsx(
|
|
11
|
+
f,
|
|
12
12
|
{
|
|
13
13
|
labelMode: "inside",
|
|
14
|
-
onChange:
|
|
14
|
+
onChange: n,
|
|
15
15
|
hideErrorDom: null,
|
|
16
|
-
...
|
|
17
|
-
value:
|
|
16
|
+
...u,
|
|
17
|
+
value: c
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
};
|
package/es/Pagination/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { j as r } from "../_virtual/jsx-runtime.js";
|
|
|
2
2
|
import de, { useState as g, useRef as q, useEffect as u, useMemo as w } from "react";
|
|
3
3
|
import xe from "../GlobalContext/index.js";
|
|
4
4
|
import { $prefixCls as z, $rcPrefixCls as he } from "../GlobalContext/constant.js";
|
|
5
|
-
import { TextField as
|
|
6
|
-
import
|
|
5
|
+
import { TextField as ve } from "../TextField/index.js";
|
|
6
|
+
import Pe from "../GlobalContext/useFormatMessage.js";
|
|
7
7
|
import je from "./lang/index.js";
|
|
8
8
|
import be from "../Select/index.js";
|
|
9
9
|
import { Button as G } from "../Button/index.js";
|
|
@@ -31,7 +31,7 @@ const Oe = (y) => {
|
|
|
31
31
|
changeRowsPerPage: F,
|
|
32
32
|
getPopupContainer: O,
|
|
33
33
|
resizeLine: W
|
|
34
|
-
} = y, p =
|
|
34
|
+
} = y, p = Pe("Pagination", je), { language: k, locale: f } = de.useContext(xe), [c, V] = g(L), [K, X] = g([]), [n, R] = g(S), [i, Y] = g(), [d, E] = g(), [o, U] = g(null), x = q(null), a = q({
|
|
35
35
|
layoutArr: ["jumper", "pageRow", "pager-btn", "sizes", "pager-num"]
|
|
36
36
|
});
|
|
37
37
|
a.current.type = l, a.current.autoType = M, u(() => () => {
|
|
@@ -87,7 +87,7 @@ const Oe = (y) => {
|
|
|
87
87
|
U(t), t > 3 ? _(t) : x.current.classList.remove(`${z}-pagination-over`);
|
|
88
88
|
} else
|
|
89
89
|
x.current.classList.remove(`${z}-pagination-over`);
|
|
90
|
-
},
|
|
90
|
+
}, v = (e) => a.current.type instanceof Array && a.current.type.indexOf(e) === -1, P = (e) => {
|
|
91
91
|
if (o === null) return !1;
|
|
92
92
|
switch (e) {
|
|
93
93
|
case "jumper":
|
|
@@ -128,6 +128,7 @@ const Oe = (y) => {
|
|
|
128
128
|
}
|
|
129
129
|
s !== void 0 && R(s), N && N(s);
|
|
130
130
|
}, ee = (e) => {
|
|
131
|
+
if (e === void 0) return;
|
|
131
132
|
const t = Number(e);
|
|
132
133
|
e !== c && (V(t), F && F(t));
|
|
133
134
|
}, te = (e) => {
|
|
@@ -143,11 +144,11 @@ const Oe = (y) => {
|
|
|
143
144
|
const t = /(?=(\B)(\d{3})+$)/g;
|
|
144
145
|
return e.toString().replace(t, ",");
|
|
145
146
|
}, oe = w(() => {
|
|
146
|
-
if (l === "simple" ||
|
|
147
|
+
if (l === "simple" || v("sizes") || P("sizes"))
|
|
147
148
|
return null;
|
|
148
149
|
const e = ae(m);
|
|
149
150
|
return /* @__PURE__ */ r.jsx("div", { className: "total-num pagination-space", children: p({ id: "total" }, { total: e }) });
|
|
150
|
-
}, [m, k, f, o]), ie = w(() =>
|
|
151
|
+
}, [m, k, f, o]), ie = w(() => v("pageRow") || P("pageRow") ? null : /* @__PURE__ */ r.jsx("div", { className: "page-line-memo pagination-space", children: /* @__PURE__ */ r.jsx(
|
|
151
152
|
be,
|
|
152
153
|
{
|
|
153
154
|
className: "page-line-select",
|
|
@@ -165,7 +166,7 @@ const Oe = (y) => {
|
|
|
165
166
|
] }), le = () => /* @__PURE__ */ r.jsxs("div", { className: "jump-next-icon", children: [
|
|
166
167
|
/* @__PURE__ */ r.jsx("span", { children: "..." }),
|
|
167
168
|
/* @__PURE__ */ r.jsx(Ce, {})
|
|
168
|
-
] }), ce = () => C !== "num" || l === "simple" ? !0 : l === "complex" ?
|
|
169
|
+
] }), ce = () => C !== "num" || l === "simple" ? !0 : l === "complex" ? P("pager-num") : v("pager"), ue = w(() => ce() ? null : /* @__PURE__ */ r.jsxs("div", { className: "pagination-content pagination-space", children: [
|
|
169
170
|
I.indexOf("prev") !== -1 && /* @__PURE__ */ r.jsx("div", { className: "left-page", children: /* @__PURE__ */ r.jsx(
|
|
170
171
|
"div",
|
|
171
172
|
{
|
|
@@ -195,7 +196,7 @@ const Oe = (y) => {
|
|
|
195
196
|
children: /* @__PURE__ */ r.jsx(H, {})
|
|
196
197
|
}
|
|
197
198
|
) })
|
|
198
|
-
] }), [m, n, i, c, y.flippingArrow, C, o]), me = () => C === "btn" || l === "simple" ? !1 : l === "complex" ?
|
|
199
|
+
] }), [m, n, i, c, y.flippingArrow, C, o]), me = () => C === "btn" || l === "simple" ? !1 : l === "complex" ? P("pager-btn") : v("pager"), pe = w(() => me() ? null : /* @__PURE__ */ r.jsxs("div", { className: "pagination-btn-content pagination-space", children: [
|
|
199
200
|
/* @__PURE__ */ r.jsx(
|
|
200
201
|
G,
|
|
201
202
|
{
|
|
@@ -218,10 +219,10 @@ const Oe = (y) => {
|
|
|
218
219
|
children: p({ id: "nextPage" })
|
|
219
220
|
}
|
|
220
221
|
)
|
|
221
|
-
] }), [n, i, C, f, o]), ge = w(() =>
|
|
222
|
+
] }), [n, i, C, f, o]), ge = w(() => v("jumper") || P("jumper") ? null : /* @__PURE__ */ r.jsxs("div", { className: "skip-page-memo pagination-space", children: [
|
|
222
223
|
/* @__PURE__ */ r.jsx("span", { children: p({ id: "jumpTo" }) }),
|
|
223
224
|
/* @__PURE__ */ r.jsx(
|
|
224
|
-
|
|
225
|
+
ve,
|
|
225
226
|
{
|
|
226
227
|
className: "skip-page-text-field",
|
|
227
228
|
size: "large",
|
package/es/RadioGroup/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { default as React,
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { RadioProps } from '../Radio';
|
|
3
3
|
import { LabelTooltipProps } from '../Label';
|
|
4
4
|
import { HelperTextDetailProps } from '../HelperText';
|
|
5
5
|
export interface RadioListProps extends RadioProps {
|
|
6
6
|
[name: string]: unknown;
|
|
7
7
|
}
|
|
8
|
-
export interface RadioGroupProps extends HelperTextDetailProps {
|
|
8
|
+
export interface RadioGroupProps<T = unknown> extends HelperTextDetailProps {
|
|
9
9
|
/** 样式class */
|
|
10
10
|
className?: string;
|
|
11
11
|
/** style */
|
|
@@ -27,16 +27,15 @@ export interface RadioGroupProps extends HelperTextDetailProps {
|
|
|
27
27
|
/** 是否禁用 */
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
/** 默认值 不受控 */
|
|
30
|
-
defaultValue?:
|
|
30
|
+
defaultValue?: T;
|
|
31
31
|
/** 默认值 */
|
|
32
|
-
value?:
|
|
32
|
+
value?: T;
|
|
33
33
|
/** 选中选值 */
|
|
34
34
|
id?: string;
|
|
35
35
|
/** 选项数据 */
|
|
36
36
|
list: RadioListProps[] | RadioListProps[][];
|
|
37
37
|
/** 改变值 */
|
|
38
|
-
onChange?: (val:
|
|
39
|
-
[name: string]: unknown;
|
|
38
|
+
onChange?: (val: T, item?: RadioListProps) => void;
|
|
40
39
|
}
|
|
41
|
-
export declare
|
|
40
|
+
export declare function RadioGroup<T = unknown>(props: RadioGroupProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
42
41
|
export default RadioGroup;
|
package/es/RadioGroup/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import A from "../Label/index.js";
|
|
|
5
5
|
import B from "../HelperText/index.js";
|
|
6
6
|
import { $prefixCls as l } from "../GlobalContext/constant.js";
|
|
7
7
|
import './index.css';/* empty css */
|
|
8
|
-
|
|
8
|
+
function F(i) {
|
|
9
9
|
const {
|
|
10
10
|
className: m = "",
|
|
11
11
|
style: w,
|
|
@@ -122,7 +122,7 @@ const F = (i) => {
|
|
|
122
122
|
]
|
|
123
123
|
}
|
|
124
124
|
);
|
|
125
|
-
}
|
|
125
|
+
}
|
|
126
126
|
export {
|
|
127
127
|
F as RadioGroup,
|
|
128
128
|
F as default
|
package/es/Select/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { default as React,
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { EmptyProps } from '../Empty';
|
|
3
3
|
import { LabelTooltipProps } from '../Label';
|
|
4
4
|
import { TooltipProps } from '../Tooltip';
|
|
5
5
|
import { HelperTextDetailProps } from '../HelperText';
|
|
6
|
-
import { SelectOptionBase } from '../Utils/type';
|
|
6
|
+
import { SelectOptionBase, SelectOptionValue } from '../Utils/type';
|
|
7
7
|
/** Select 下拉选项类型 */
|
|
8
8
|
export interface SelectOption extends SelectOptionBase {
|
|
9
9
|
/** 子选项数组 */
|
|
10
10
|
children?: SelectOption[];
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
/** Select 共享 props —— 不含随 multiple 变化的 value/defaultValue/onChange/onEnter/multiple */
|
|
13
|
+
export interface SelectBaseProps<T extends SelectOptionValue = SelectOptionValue> extends HelperTextDetailProps {
|
|
13
14
|
/** 样式class */
|
|
14
15
|
className?: string;
|
|
15
16
|
/** style */
|
|
@@ -35,13 +36,11 @@ export interface SelectProps extends HelperTextDetailProps {
|
|
|
35
36
|
/** 搜索提示语 */
|
|
36
37
|
searchPlaceholder?: string;
|
|
37
38
|
/** 是否禁用,传入数组时表示禁用的选项值列表 */
|
|
38
|
-
disabled?: boolean |
|
|
39
|
+
disabled?: boolean | T[];
|
|
39
40
|
/**
|
|
40
41
|
* 禁用提示
|
|
41
42
|
*/
|
|
42
43
|
disabledTooltip?: TooltipProps;
|
|
43
|
-
/** 是否多选 */
|
|
44
|
-
multiple?: boolean;
|
|
45
44
|
/** 是否必填 */
|
|
46
45
|
required?: boolean;
|
|
47
46
|
/** 下拉选项数组 */
|
|
@@ -60,10 +59,6 @@ export interface SelectProps extends HelperTextDetailProps {
|
|
|
60
59
|
showValue?: string;
|
|
61
60
|
/** 下级字段 */
|
|
62
61
|
childrenName?: string;
|
|
63
|
-
/** 默认值,多选时为数组,单选时为单值 */
|
|
64
|
-
defaultValue?: string | number | boolean | Array<string | number | boolean>;
|
|
65
|
-
/** 选中值,多选时为数组,单选时为单值(受控) */
|
|
66
|
-
value?: string | number | boolean | Array<string | number | boolean>;
|
|
67
62
|
/** 超出换行 */
|
|
68
63
|
overLine?: boolean;
|
|
69
64
|
/** 是否有搜索 */
|
|
@@ -80,10 +75,6 @@ export interface SelectProps extends HelperTextDetailProps {
|
|
|
80
75
|
morePopoverClassName?: string;
|
|
81
76
|
/** 返回输入建议的方法 */
|
|
82
77
|
fetchSuggestions?: (val: string, cb: (data: SelectOption[]) => void) => void;
|
|
83
|
-
/** 改变值回调 */
|
|
84
|
-
onChange?: (val: string | number | boolean | Array<string | number | boolean>, e: React.SyntheticEvent) => void;
|
|
85
|
-
/** 全局回车事件 */
|
|
86
|
-
onEnter?: (val: string | number | boolean | Array<string | number | boolean>) => void;
|
|
87
78
|
/** 搜索框输入框回车事件 */
|
|
88
79
|
onEnterInput?: (val: string) => void;
|
|
89
80
|
/** 点击清空内容回调 */
|
|
@@ -92,7 +83,39 @@ export interface SelectProps extends HelperTextDetailProps {
|
|
|
92
83
|
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
93
84
|
/** 失去焦点改变值 */
|
|
94
85
|
blurChangeValueBol?: boolean;
|
|
95
|
-
[name: string]: unknown;
|
|
96
86
|
}
|
|
97
|
-
|
|
87
|
+
/** 单选模式 */
|
|
88
|
+
export interface SelectSingleProps<T extends SelectOptionValue = SelectOptionValue> extends SelectBaseProps<T> {
|
|
89
|
+
/** 是否多选(未传或 false 为单选) */
|
|
90
|
+
multiple?: false;
|
|
91
|
+
/** 默认值(单选) */
|
|
92
|
+
defaultValue?: T;
|
|
93
|
+
/** 选中值(单选受控) */
|
|
94
|
+
value?: T;
|
|
95
|
+
/** 改变值回调;清空时 val 为空字符串 */
|
|
96
|
+
/** 改变值回调;清空时 val 为 undefined */
|
|
97
|
+
onChange?: (val: T | undefined, e: React.SyntheticEvent) => void;
|
|
98
|
+
/** 全局回车事件(单选) */
|
|
99
|
+
onEnter?: (val: T) => void;
|
|
100
|
+
}
|
|
101
|
+
/** 多选模式 */
|
|
102
|
+
export interface SelectMultipleProps<T extends SelectOptionValue = SelectOptionValue> extends SelectBaseProps<T> {
|
|
103
|
+
/** 是否多选 */
|
|
104
|
+
multiple: true;
|
|
105
|
+
/** 默认值(多选) */
|
|
106
|
+
defaultValue?: T[];
|
|
107
|
+
/** 选中值(多选受控) */
|
|
108
|
+
value?: T[];
|
|
109
|
+
/** 改变值回调(多选) */
|
|
110
|
+
onChange?: (val: T[], e: React.SyntheticEvent) => void;
|
|
111
|
+
/** 全局回车事件(多选) */
|
|
112
|
+
onEnter?: (val: T[]) => void;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Select 的 props
|
|
116
|
+
* - `multiple` 未传或为 `false`:value / defaultValue 为 `T`,onChange/onEnter 入参为 `T`(清空时 `undefined`)
|
|
117
|
+
* - `multiple` 为 `true`:value / defaultValue 为 `T[]`,onChange/onEnter 入参为 `T[]`(清空时 `[]`)
|
|
118
|
+
*/
|
|
119
|
+
export type SelectProps<T extends SelectOptionValue = SelectOptionValue> = SelectSingleProps<T> | SelectMultipleProps<T>;
|
|
120
|
+
declare function Select<T extends SelectOptionValue = SelectOptionValue>(outerProps: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
98
121
|
export default Select;
|