@pisell/materials 1.0.1039 → 1.0.1041
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +17 -17
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +18 -23
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +27 -32
- package/es/components/PisellCards/index.d.ts +6 -6
- package/es/components/dataSourceComponents/fields/Input.Email/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Password/index.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Switch/index.d.ts +2 -2
- package/es/components/filter/components/FilterItem/index.js +1 -1
- package/es/components/filter/components/FilterItem/index.less +2 -2
- package/es/components/filter/types.d.ts +1 -1
- package/es/components/pisellDatePicker/index.d.ts +2 -2
- package/es/components/pisellLookup/PisellLookup.less +29 -11
- package/es/components/pisellLookup/components/LookupTrigger.js +4 -2
- package/es/components/pisellModal/index.d.ts +6 -6
- package/es/components/pisellQuickFilter/index.d.ts +2 -2
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +23 -4
- package/es/components/pisellRecordBoard/docs/PisellRecordBoard.md +2 -0
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +34 -5
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +35 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +1 -1
- package/es/components/pisellRecordBoard/shellFrame/index.d.ts +1 -0
- package/es/components/pisellRecordBoard/shellFrame/index.js +52 -4
- package/es/components/pisellRecordBoard/types.d.ts +16 -2
- package/es/components/pisellRecordBoard/utils/recordBoardColumns.js +2 -2
- package/es/components/pisellShellFrame/PisellShellFrame.js +1 -1
- package/es/components/pisellShellFrame/PisellShellFrame.less +5 -0
- package/es/components/radio/index.d.ts +2 -2
- package/es/components/section-footers/index.d.ts +2 -2
- package/es/components/skeleton/index.d.ts +2 -2
- package/es/components/time-picker/index.d.ts +2 -2
- package/es/components/typography/index.d.ts +2 -2
- package/es/components/upload/index.d.ts +2 -2
- package/es/locales/ja.js +28 -1
- package/es/locales/pt.js +28 -1
- package/lib/components/checkbox/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Checkbox/WithMode.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Email/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Url/index.d.ts +2 -2
- package/lib/components/filter/components/FilterItem/index.js +1 -1
- package/lib/components/filter/components/FilterItem/index.less +2 -2
- package/lib/components/filter/types.d.ts +1 -1
- package/lib/components/pisellLookup/PisellLookup.less +29 -11
- package/lib/components/pisellLookup/components/LookupTrigger.js +4 -2
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +23 -4
- package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.md +2 -0
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +34 -5
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +35 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +1 -1
- package/lib/components/pisellRecordBoard/shellFrame/index.d.ts +1 -0
- package/lib/components/pisellRecordBoard/shellFrame/index.js +51 -3
- package/lib/components/pisellRecordBoard/types.d.ts +16 -2
- package/lib/components/pisellRecordBoard/utils/recordBoardColumns.js +2 -2
- package/lib/components/pisellShellFrame/PisellShellFrame.js +1 -1
- package/lib/components/pisellShellFrame/PisellShellFrame.less +5 -0
- package/lib/components/skeleton/index.d.ts +2 -2
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/locales/ja.js +28 -1
- package/lib/locales/pt.js +28 -1
- package/package.json +3 -3
|
@@ -7,15 +7,15 @@ import "./components/PisellImageCard/index.js";
|
|
|
7
7
|
import { BadgeConfig, TabCardProps } from "./components/TabCard/types.js";
|
|
8
8
|
import "./components/TextCard/types.js";
|
|
9
9
|
import { MultilevelCardProps } from "./components/MultilevelCard/types.js";
|
|
10
|
-
import * as
|
|
10
|
+
import * as react11 from "react";
|
|
11
11
|
|
|
12
12
|
//#region src/components/PisellCards/index.d.ts
|
|
13
13
|
declare const PisellCards: {
|
|
14
|
-
TabCard: (props: any) =>
|
|
15
|
-
TextCard: (props: any) =>
|
|
16
|
-
GraphicTextCard: (props: GraphicTextCardProps) =>
|
|
17
|
-
MultilevelCard: (props: any) =>
|
|
18
|
-
PisellImageCard: (props: PisellImageCardProps) =>
|
|
14
|
+
TabCard: (props: any) => react11.JSX.Element;
|
|
15
|
+
TextCard: (props: any) => react11.JSX.Element;
|
|
16
|
+
GraphicTextCard: (props: GraphicTextCardProps) => react11.JSX.Element;
|
|
17
|
+
MultilevelCard: (props: any) => react11.JSX.Element;
|
|
18
|
+
PisellImageCard: (props: PisellImageCardProps) => react11.JSX.Element;
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
21
|
export { PisellCards };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd21 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/Input.Email/index.d.ts
|
|
6
|
-
declare const Email: React.FC<
|
|
6
|
+
declare const Email: React.FC<antd21.InputProps & {
|
|
7
7
|
onChange: (value: string) => void;
|
|
8
8
|
} & WithModeProps & WithFormItemProps>;
|
|
9
9
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd18 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as antd_es_input3 from "antd/es/input";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Input.Password/index.d.ts
|
|
7
|
-
declare const Password: React.FC<
|
|
7
|
+
declare const Password: React.FC<antd_es_input3.PasswordProps & React.RefAttributes<antd18.InputRef> & WithModeProps & WithFormItemProps>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Password };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd22 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts
|
|
6
|
-
declare const Subdomain: React.FC<
|
|
6
|
+
declare const Subdomain: React.FC<antd22.InputProps & {
|
|
7
7
|
onChange: (value: string) => void;
|
|
8
8
|
onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
9
9
|
rootDomain: "custom" | "saas" | "xzero";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as antd_es_input4 from "antd/es/input";
|
|
4
4
|
import * as antd_es_input_TextArea0 from "antd/es/input/TextArea";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Input.TextArea/index.d.ts
|
|
7
|
-
declare const TextArea: React.FC<
|
|
7
|
+
declare const TextArea: React.FC<antd_es_input4.TextAreaProps & React.RefAttributes<antd_es_input_TextArea0.TextAreaRef> & WithModeProps & WithFormItemProps>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { TextArea };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd15 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import * as antd_es_select0 from "antd/es/select";
|
|
5
5
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Select/index.d.ts
|
|
7
|
-
declare const SelectWithDataSource: (props:
|
|
7
|
+
declare const SelectWithDataSource: (props: antd15.SelectProps<any, antd_es_select0.DefaultOptionType> & WithModeProps & WithFormItemProps & {
|
|
8
8
|
options?: any;
|
|
9
9
|
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
10
10
|
labelField: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd14 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/Switch/index.d.ts
|
|
6
|
-
declare const Switch$1: React.FC<
|
|
6
|
+
declare const Switch$1: React.FC<antd14.SwitchProps & React.RefAttributes<HTMLElement> & WithModeProps & WithFormItemProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { Switch$1 as Switch };
|
|
@@ -81,7 +81,7 @@ const FilterItem = (props) => {
|
|
|
81
81
|
hidden: isHidden
|
|
82
82
|
}, (other === null || other === void 0 ? void 0 : other.formItemProps) || {}), /* @__PURE__ */ React.createElement(CustomComponent, componentProps$1));
|
|
83
83
|
}
|
|
84
|
-
if (type === "
|
|
84
|
+
if (type === "rangePickerNew") {
|
|
85
85
|
const componentProps$1 = _objectSpread2(_objectSpread2(_objectSpread2({}, itemProps || {}), other || {}), {}, { prefixCls: "pisell-lowcode" });
|
|
86
86
|
return /* @__PURE__ */ React.createElement(Form.Item, _objectSpread2(_objectSpread2({
|
|
87
87
|
label,
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
.pisell-lowcode-range-picker-wrap {
|
|
14
|
-
width: 257px;
|
|
14
|
+
//width: 257px;
|
|
15
|
+
width: 100%;
|
|
15
16
|
|
|
16
17
|
.pisell-lowcode-range {
|
|
17
|
-
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
18
18
|
font-size: 16px;
|
|
19
19
|
font-weight: 400;
|
|
20
20
|
line-height: 24px;
|
|
@@ -19,7 +19,7 @@ type FilterType = {
|
|
|
19
19
|
* - type 为 "custom" 时使用 other.component,组件接收 value/onChange(由 Form 注入)
|
|
20
20
|
*/
|
|
21
21
|
type FilterItemProps = {
|
|
22
|
-
type: "single" | "input" | "datePicker" | "rangePicker" | "search" | "custom";
|
|
22
|
+
type: "single" | "input" | "datePicker" | "rangePicker" | "rangePickerNew" | "search" | "custom";
|
|
23
23
|
name?: string | string[];
|
|
24
24
|
key: string;
|
|
25
25
|
props?: object;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import * as
|
|
2
|
+
import * as react16 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/pisellDatePicker/index.d.ts
|
|
5
|
-
declare const PisellDatePicker: (props: any) =>
|
|
5
|
+
declare const PisellDatePicker: (props: any) => react16.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { PisellDatePicker };
|
|
@@ -133,7 +133,9 @@
|
|
|
133
133
|
// ============ Input 样式覆盖 ============
|
|
134
134
|
|
|
135
135
|
// 覆盖 Ant Design Input 默认样式(适用于所有尺寸);默认高度 50px
|
|
136
|
-
|
|
136
|
+
// 同时匹配 ant- / pisell-lowcode- 前缀,确保有无 prefixCls 都能生效
|
|
137
|
+
&-trigger-input.pisell-lowcode-input-affix-wrapper,
|
|
138
|
+
&-trigger-input.ant-input-affix-wrapper {
|
|
137
139
|
min-height: 50px;
|
|
138
140
|
border: 1px solid #d0d5dd;
|
|
139
141
|
border-radius: 8px;
|
|
@@ -146,13 +148,15 @@
|
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
&:focus,
|
|
149
|
-
&.pisell-lowcode-input-affix-wrapper-focused
|
|
151
|
+
&.pisell-lowcode-input-affix-wrapper-focused,
|
|
152
|
+
&.ant-input-affix-wrapper-focused {
|
|
150
153
|
border-color: #7f56d9;
|
|
151
154
|
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05), 0 0 0 2px rgba(127, 86, 217, 0.1);
|
|
152
155
|
}
|
|
153
156
|
|
|
154
|
-
// Input
|
|
155
|
-
.pisell-lowcode-input
|
|
157
|
+
// Input 文本样式(antd 内部 input 类名可能为 .ant-input 或 .pisell-lowcode-input)
|
|
158
|
+
.pisell-lowcode-input,
|
|
159
|
+
.ant-input {
|
|
156
160
|
color: #000000;
|
|
157
161
|
font-size: 16px;
|
|
158
162
|
line-height: 24px;
|
|
@@ -165,8 +169,9 @@
|
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
|
|
168
|
-
//
|
|
169
|
-
&-trigger-input.pisell-lowcode-input-affix-wrapper-sm
|
|
172
|
+
// 小号输入框(同时匹配 ant- / pisell-lowcode-)
|
|
173
|
+
&-trigger-input.pisell-lowcode-input-affix-wrapper-sm,
|
|
174
|
+
&-trigger-input.ant-input-affix-wrapper-sm {
|
|
170
175
|
padding: 2px 2px 2px 12px;
|
|
171
176
|
|
|
172
177
|
.pisell-lookup-input-clear {
|
|
@@ -193,8 +198,9 @@
|
|
|
193
198
|
}
|
|
194
199
|
}
|
|
195
200
|
|
|
196
|
-
// 大号输入框,高度 58px
|
|
197
|
-
&-trigger-input.pisell-lowcode-input-affix-wrapper-lg
|
|
201
|
+
// 大号输入框,高度 58px(同时匹配 ant- / pisell-lowcode-)
|
|
202
|
+
&-trigger-input.pisell-lowcode-input-affix-wrapper-lg,
|
|
203
|
+
&-trigger-input.ant-input-affix-wrapper-lg {
|
|
198
204
|
min-height: 58px;
|
|
199
205
|
padding: 6px 6px 6px 16px;
|
|
200
206
|
|
|
@@ -213,10 +219,22 @@
|
|
|
213
219
|
.pisell-lookup-input-confirm {
|
|
214
220
|
padding: 10px;
|
|
215
221
|
line-height: 24px;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
216
224
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
225
|
+
// 无 Lookup 按钮时:class 在包裹层 .pisell-lookup-trigger-input-no-confirm 上,对子元素 affix-wrapper 设左右对称 padding
|
|
226
|
+
&-trigger-input-no-confirm {
|
|
227
|
+
> .ant-input-affix-wrapper,
|
|
228
|
+
> .pisell-lowcode-input-affix-wrapper {
|
|
229
|
+
padding: 4px 16px;
|
|
230
|
+
}
|
|
231
|
+
> .ant-input-affix-wrapper-sm,
|
|
232
|
+
> .pisell-lowcode-input-affix-wrapper-sm {
|
|
233
|
+
padding: 2px 12px;
|
|
234
|
+
}
|
|
235
|
+
> .ant-input-affix-wrapper-lg,
|
|
236
|
+
> .pisell-lowcode-input-affix-wrapper-lg {
|
|
237
|
+
padding: 6px 16px;
|
|
220
238
|
}
|
|
221
239
|
}
|
|
222
240
|
|
|
@@ -146,7 +146,7 @@ const LookupTriggerComponent = forwardRef((props, ref) => {
|
|
|
146
146
|
onClick: handleConfirm,
|
|
147
147
|
className: "pisell-lookup-input-confirm"
|
|
148
148
|
}, confirmButtonText));
|
|
149
|
-
|
|
149
|
+
const inputEl = /* @__PURE__ */ React.createElement(Input, {
|
|
150
150
|
ref: inputRef,
|
|
151
151
|
value,
|
|
152
152
|
onChange: handleChange,
|
|
@@ -159,9 +159,11 @@ const LookupTriggerComponent = forwardRef((props, ref) => {
|
|
|
159
159
|
prefix,
|
|
160
160
|
suffix,
|
|
161
161
|
autoFocus,
|
|
162
|
-
className: `pisell-lookup-trigger-input ${className || ""}
|
|
162
|
+
className: `pisell-lookup-trigger-input ${className || ""}`.trim(),
|
|
163
163
|
style
|
|
164
164
|
});
|
|
165
|
+
if (!showConfirmButton) return /* @__PURE__ */ React.createElement("div", { className: "pisell-lookup-trigger-input pisell-lookup-trigger-input-no-confirm" }, inputEl);
|
|
166
|
+
return inputEl;
|
|
165
167
|
};
|
|
166
168
|
/**
|
|
167
169
|
* 渲染按钮触发器
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PisellContextType } from "../pisell-config-provider/context.js";
|
|
2
2
|
import { PisellModalFuncProps } from "./components/functions/index.js";
|
|
3
3
|
import { InformationProps } from "./components/Information/index.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as antd0 from "antd";
|
|
5
5
|
import { ButtonProps, ModalProps } from "antd";
|
|
6
6
|
import React from "react";
|
|
7
7
|
|
|
@@ -39,24 +39,24 @@ declare const PisellModal: {
|
|
|
39
39
|
(props: PisellModalProps): React.JSX.Element;
|
|
40
40
|
confirm: (props: PisellModalFuncProps) => {
|
|
41
41
|
destroy: () => void;
|
|
42
|
-
update: (configUpdate:
|
|
42
|
+
update: (configUpdate: antd0.ModalFuncProps | ((prevConfig: antd0.ModalFuncProps) => antd0.ModalFuncProps)) => void;
|
|
43
43
|
};
|
|
44
44
|
info: (props: PisellModalFuncProps) => {
|
|
45
45
|
destroy: () => void;
|
|
46
|
-
update: (configUpdate:
|
|
46
|
+
update: (configUpdate: antd0.ModalFuncProps | ((prevConfig: antd0.ModalFuncProps) => antd0.ModalFuncProps)) => void;
|
|
47
47
|
};
|
|
48
48
|
error: (props: PisellModalFuncProps) => {
|
|
49
49
|
destroy: () => void;
|
|
50
|
-
update: (configUpdate:
|
|
50
|
+
update: (configUpdate: antd0.ModalFuncProps | ((prevConfig: antd0.ModalFuncProps) => antd0.ModalFuncProps)) => void;
|
|
51
51
|
};
|
|
52
52
|
warn: (props: PisellModalFuncProps) => any;
|
|
53
53
|
warning: (props: PisellModalFuncProps) => {
|
|
54
54
|
destroy: () => void;
|
|
55
|
-
update: (configUpdate:
|
|
55
|
+
update: (configUpdate: antd0.ModalFuncProps | ((prevConfig: antd0.ModalFuncProps) => antd0.ModalFuncProps)) => void;
|
|
56
56
|
};
|
|
57
57
|
success: (props: PisellModalFuncProps) => {
|
|
58
58
|
destroy: () => void;
|
|
59
|
-
update: (configUpdate:
|
|
59
|
+
update: (configUpdate: antd0.ModalFuncProps | ((prevConfig: antd0.ModalFuncProps) => antd0.ModalFuncProps)) => void;
|
|
60
60
|
};
|
|
61
61
|
Information: (props: InformationProps) => React.JSX.Element;
|
|
62
62
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FilterItemProps } from "../filter/types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as antd17 from "antd";
|
|
3
3
|
import React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/pisellQuickFilter/index.d.ts
|
|
6
|
-
declare const pisellQuickFilter: React.ForwardRefExoticComponent<
|
|
6
|
+
declare const pisellQuickFilter: React.ForwardRefExoticComponent<antd17.FormInstance<any> & {
|
|
7
7
|
hasForm?: boolean | undefined;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
formFiltersPrefix: string;
|
|
@@ -47,7 +47,9 @@ function getDefaultRecordBoardContext(layoutType, selection, rowKey) {
|
|
|
47
47
|
selectedRows: selection.selectedRows,
|
|
48
48
|
onSelectionChange: selection.onSelectionChange,
|
|
49
49
|
rowKey,
|
|
50
|
-
childComponentProps: void 0
|
|
50
|
+
childComponentProps: void 0,
|
|
51
|
+
scrollAreaHeight: null,
|
|
52
|
+
setScrollAreaHeight: void 0
|
|
51
53
|
};
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
@@ -57,6 +59,8 @@ function getDefaultRecordBoardContext(layoutType, selection, rowKey) {
|
|
|
57
59
|
const PisellRecordBoard = (props) => {
|
|
58
60
|
const { children, layoutType = "grid", rowKey: rowKeyProp, data: dataProp, loading: loadingProp, total: totalProp, pagination: paginationProp, onPageChange: onPageChangeProp, searchParams: searchParamsProp, onSearch: onSearchProp, onReset: onResetProp } = props;
|
|
59
61
|
_objectWithoutProperties(props, _excluded);
|
|
62
|
+
/** 默认占满父容器高度(父容器需有高度,如 height:100vh 或 height:100%) */
|
|
63
|
+
const fillHeight = true;
|
|
60
64
|
const mergedChildComponentProps = useMemo(() => mergeChildComponentProps(props), [
|
|
61
65
|
props.grid,
|
|
62
66
|
props.toolBar,
|
|
@@ -67,6 +71,7 @@ const PisellRecordBoard = (props) => {
|
|
|
67
71
|
]);
|
|
68
72
|
const [internalSelectedKeys, setInternalSelectedKeys] = useState([]);
|
|
69
73
|
const [internalSelectedRows, setInternalSelectedRows] = useState([]);
|
|
74
|
+
const [scrollAreaHeight, setScrollAreaHeight] = useState(null);
|
|
70
75
|
const [internalColumnVisibility, setInternalColumnVisibility] = useState(() => {
|
|
71
76
|
var _props$grid$defaultHi, _props$grid, _props$grid$columns, _props$grid2;
|
|
72
77
|
const fromConfig = (_props$grid$defaultHi = (_props$grid = props.grid) === null || _props$grid === void 0 ? void 0 : _props$grid.defaultHiddenColumnKeys) !== null && _props$grid$defaultHi !== void 0 ? _props$grid$defaultHi : [];
|
|
@@ -123,7 +128,10 @@ const PisellRecordBoard = (props) => {
|
|
|
123
128
|
onSelectionChange,
|
|
124
129
|
columnVisibility: internalColumnVisibility,
|
|
125
130
|
onColumnVisibilityChange: onColumnVisibilityChangeInternal,
|
|
126
|
-
childComponentProps: mergedChildComponentProps !== null && mergedChildComponentProps !== void 0 ? mergedChildComponentProps : defaultCtx.childComponentProps
|
|
131
|
+
childComponentProps: mergedChildComponentProps !== null && mergedChildComponentProps !== void 0 ? mergedChildComponentProps : defaultCtx.childComponentProps,
|
|
132
|
+
fillHeight,
|
|
133
|
+
scrollAreaHeight,
|
|
134
|
+
setScrollAreaHeight
|
|
127
135
|
});
|
|
128
136
|
}, [
|
|
129
137
|
layoutType,
|
|
@@ -141,9 +149,20 @@ const PisellRecordBoard = (props) => {
|
|
|
141
149
|
internalSelectedRows,
|
|
142
150
|
onSelectionChangeInternal,
|
|
143
151
|
internalColumnVisibility,
|
|
144
|
-
onColumnVisibilityChangeInternal
|
|
152
|
+
onColumnVisibilityChangeInternal,
|
|
153
|
+
fillHeight,
|
|
154
|
+
scrollAreaHeight
|
|
145
155
|
]);
|
|
146
|
-
|
|
156
|
+
const content = /* @__PURE__ */ React.createElement(RecordBoardProvider, { value: contextValue }, children);
|
|
157
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
158
|
+
className: "pisell-record-board-root",
|
|
159
|
+
style: {
|
|
160
|
+
height: "100%",
|
|
161
|
+
display: "flex",
|
|
162
|
+
flexDirection: "column",
|
|
163
|
+
minHeight: 0
|
|
164
|
+
}
|
|
165
|
+
}, content);
|
|
147
166
|
};
|
|
148
167
|
var PisellRecordBoard_default = PisellRecordBoard;
|
|
149
168
|
|
|
@@ -503,6 +503,8 @@ export default function TableOnRowClickExample() {
|
|
|
503
503
|
| data / loading / total / pagination / onPageChange / searchParams / onSearch / onReset | 各自类型 | 打散的数据与回调 |
|
|
504
504
|
| grid / toolBar / search / paginationConfig / batchActionBar / cardList | 各自类型 | 打散的子组件配置。**grid** 类型为 RecordBoardGridProps(基于 TableProps 省略 dataSource/loading/pagination/columns/scroll/size/rowSelection),多选在 grid 内;支持 Table 透传:onRow、onHeaderRow、expandable、rowClassName、summary 等 |
|
|
505
505
|
|
|
506
|
+
默认占满父容器高度(父容器需有高度,如 `height: 100vh` 或 `height: 100%`),内容区可滚动,分页器贴底。
|
|
507
|
+
|
|
506
508
|
### 子组件
|
|
507
509
|
|
|
508
510
|
| 子组件 | 说明 |
|
|
@@ -12,7 +12,7 @@ const _excluded = [
|
|
|
12
12
|
"columns",
|
|
13
13
|
"rowKey",
|
|
14
14
|
"rowSelection"
|
|
15
|
-
];
|
|
15
|
+
], _excluded2 = ["autoCalc"];
|
|
16
16
|
function getRowKey(record, rowKey) {
|
|
17
17
|
var _ref, _record$id;
|
|
18
18
|
if (typeof rowKey === "function") return rowKey(record);
|
|
@@ -22,7 +22,7 @@ function getRowKey(record, rowKey) {
|
|
|
22
22
|
/**
|
|
23
23
|
* Grid 布局下的数据视图:使用 antd Table,从 context 取 data / loading / 多选态。
|
|
24
24
|
*/
|
|
25
|
-
/** Context 中与 Table 无关的 key,透传 Table
|
|
25
|
+
/** Context 中与 Table 无关的 key,透传 Table 时排除,避免覆盖或无效传递(含 grid 合并进的 columns/scroll 等) */
|
|
26
26
|
const CONTEXT_ONLY_KEYS = [
|
|
27
27
|
"data",
|
|
28
28
|
"loading",
|
|
@@ -43,10 +43,12 @@ const CONTEXT_ONLY_KEYS = [
|
|
|
43
43
|
"columns",
|
|
44
44
|
"scroll",
|
|
45
45
|
"size",
|
|
46
|
-
"defaultHiddenColumnKeys"
|
|
46
|
+
"defaultHiddenColumnKeys",
|
|
47
|
+
"scrollAreaHeight",
|
|
48
|
+
"setScrollAreaHeight"
|
|
47
49
|
];
|
|
48
50
|
const RecordBoardGridView = (props) => {
|
|
49
|
-
var _ref2,
|
|
51
|
+
var _ref2, _ctx$data;
|
|
50
52
|
const ctx = useRecordBoardContext({ displayName: "grid" });
|
|
51
53
|
const { render, columns: columnsProp, rowKey: rowKeyProp, rowSelection: rowSelectionProp } = props, rest = _objectWithoutProperties(props, _excluded);
|
|
52
54
|
const rawColumns = (_ref2 = columnsProp !== null && columnsProp !== void 0 ? columnsProp : ctx.columns) !== null && _ref2 !== void 0 ? _ref2 : [];
|
|
@@ -85,7 +87,34 @@ const RecordBoardGridView = (props) => {
|
|
|
85
87
|
return picked;
|
|
86
88
|
}, [ctx]);
|
|
87
89
|
if (typeof render === "function") return /* @__PURE__ */ React.createElement(React.Fragment, null, render(_objectSpread2(_objectSpread2({}, ctx), rest)));
|
|
88
|
-
const tableScroll = (
|
|
90
|
+
const tableScroll = useMemo(() => {
|
|
91
|
+
var _rest$scroll;
|
|
92
|
+
const scroll = (_rest$scroll = rest.scroll) !== null && _rest$scroll !== void 0 ? _rest$scroll : ctx.scroll;
|
|
93
|
+
if ((scroll === null || scroll === void 0 ? void 0 : scroll.autoCalc) && typeof ctx.scrollAreaHeight === "number") {
|
|
94
|
+
var _scroll$x;
|
|
95
|
+
const wrapHeight = ctx.scrollAreaHeight;
|
|
96
|
+
ctx.pagination;
|
|
97
|
+
return {
|
|
98
|
+
x: (_scroll$x = scroll.x) !== null && _scroll$x !== void 0 ? _scroll$x : columns.reduce((p, c) => {
|
|
99
|
+
var _c$width;
|
|
100
|
+
return p + ((_c$width = c.width) !== null && _c$width !== void 0 ? _c$width : 250);
|
|
101
|
+
}, 0) || 2e3,
|
|
102
|
+
y: Math.max(wrapHeight - 40, 100),
|
|
103
|
+
scrollToFirstRowOnChange: scroll.scrollToFirstRowOnChange
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (scroll && typeof scroll === "object") {
|
|
107
|
+
const _ref4 = scroll, { autoCalc: _a } = _ref4, restScroll = _objectWithoutProperties(_ref4, _excluded2);
|
|
108
|
+
return Object.keys(restScroll).length ? restScroll : void 0;
|
|
109
|
+
}
|
|
110
|
+
return scroll;
|
|
111
|
+
}, [
|
|
112
|
+
rest.scroll,
|
|
113
|
+
ctx.scroll,
|
|
114
|
+
ctx.scrollAreaHeight,
|
|
115
|
+
ctx.pagination,
|
|
116
|
+
columns
|
|
117
|
+
]);
|
|
89
118
|
return /* @__PURE__ */ React.createElement("div", {
|
|
90
119
|
"data-layout-slot": "grid",
|
|
91
120
|
className: "pisell-lowcode-record-board-grid"
|
|
@@ -7,6 +7,41 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
// 纯 CSS 占满高度:滚动发生在 .pisell-record-board-scroll-body,表头 sticky 固定;高度传到 table
|
|
11
|
+
.pisell-record-board-scroll-body .pisell-lowcode-record-board-grid {
|
|
12
|
+
height: 100%;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
min-height: 0;
|
|
16
|
+
|
|
17
|
+
.pisell-lowcode-table-thead .pisell-lowcode-table-cell {
|
|
18
|
+
position: sticky;
|
|
19
|
+
top: 0;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
background: var(--ant-color-bg-container, #ffffff);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 让 antd Table 外层占满,使 scroll.y 生效且高度链不断
|
|
25
|
+
.pisell-lowcode-table-wrapper {
|
|
26
|
+
flex: 1;
|
|
27
|
+
min-height: 0;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
}
|
|
31
|
+
.pisell-lowcode-table-wrapper .pisell-lowcode-table {
|
|
32
|
+
flex: 1;
|
|
33
|
+
min-height: 0;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
}
|
|
37
|
+
.pisell-lowcode-table-wrapper .pisell-lowcode-table .pisell-lowcode-table-container {
|
|
38
|
+
flex: 1;
|
|
39
|
+
min-height: 0;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
10
45
|
// 行状态样式示例(如 grid.rowClassName 返回 'pisell-record-board-row-cancelled')
|
|
11
46
|
.pisell-record-board-row-cancelled {
|
|
12
47
|
background: #fff1f0;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js";
|
|
2
|
+
import { useRecordBoardContext } from "../hooks/useRecordBoardContext.js";
|
|
1
3
|
import { PisellShellFrame } from "../../pisellShellFrame/PisellShellFrame.js";
|
|
2
4
|
import ToolBarReset_default from "./ToolBarReset/index.js";
|
|
3
5
|
import ToolBarQuickFilter_default from "./ToolBarQuickFilter/index.js";
|
|
@@ -5,12 +7,48 @@ import ToolBar_default from "./ToolBar/index.js";
|
|
|
5
7
|
import BatchActionBar_default from "./BatchActionBar/index.js";
|
|
6
8
|
import Pagination_default from "./Pagination/index.js";
|
|
7
9
|
import Search_default from "./Search/index.js";
|
|
8
|
-
import React from "react";
|
|
10
|
+
import React, { useEffect, useRef } from "react";
|
|
9
11
|
|
|
10
12
|
//#region src/components/pisellRecordBoard/shellFrame/index.tsx
|
|
13
|
+
/** fillHeight 时内容区可滚动、分页器贴底;默认表头 sticky;grid.scroll.autoCalc 时需测量高度供 scroll.y */
|
|
14
|
+
const FILL_HEIGHT_SCROLL_STYLE = {
|
|
15
|
+
flex: 1,
|
|
16
|
+
minHeight: 0,
|
|
17
|
+
overflow: "auto"
|
|
18
|
+
};
|
|
19
|
+
/** 测量滚动区高度并写入 context,供 Grid 在 scroll.autoCalc 时计算 scroll.y(对齐 table useGenScroll)。autoCalc 时 overflow 为 hidden,仅 Table 内部滚动。 */
|
|
20
|
+
function ScrollAreaMeasurer({ children, onHeight, autoCalc }) {
|
|
21
|
+
const ref = useRef(null);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const el = ref.current;
|
|
24
|
+
if (!el) return;
|
|
25
|
+
const ro = new ResizeObserver((entries) => {
|
|
26
|
+
const entry = entries[0];
|
|
27
|
+
if (entry) onHeight(entry.contentRect.height);
|
|
28
|
+
});
|
|
29
|
+
ro.observe(el);
|
|
30
|
+
onHeight(el.getBoundingClientRect().height);
|
|
31
|
+
return () => {
|
|
32
|
+
ro.disconnect();
|
|
33
|
+
onHeight(null);
|
|
34
|
+
};
|
|
35
|
+
}, [onHeight]);
|
|
36
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
37
|
+
ref,
|
|
38
|
+
className: "pisell-record-board-scroll-body",
|
|
39
|
+
style: _objectSpread2(_objectSpread2({}, FILL_HEIGHT_SCROLL_STYLE), {}, { overflow: autoCalc ? "hidden" : "auto" })
|
|
40
|
+
}, children);
|
|
41
|
+
}
|
|
42
|
+
const FILL_HEIGHT_WRAPPER_STYLE = {
|
|
43
|
+
flex: 1,
|
|
44
|
+
minHeight: 0,
|
|
45
|
+
display: "flex",
|
|
46
|
+
flexDirection: "column"
|
|
47
|
+
};
|
|
11
48
|
/**
|
|
12
49
|
* Shell Frame:基于 PisellShellFrame 的 RecordBoard 壳层。
|
|
13
50
|
* 提供工具栏、多选操作条、分页;与 Layout 同级,包裹在 Layout 外层。
|
|
51
|
+
* 默认占满父容器高度,内容区可滚动,分页器固定在底部。
|
|
14
52
|
*
|
|
15
53
|
* 使用方式:
|
|
16
54
|
* <PisellRecordBoard>
|
|
@@ -20,16 +58,26 @@ import React from "react";
|
|
|
20
58
|
* </PisellRecordBoard>
|
|
21
59
|
*/
|
|
22
60
|
const RecordBoardShellFrame = ({ children, className, style }) => {
|
|
23
|
-
|
|
61
|
+
var _ctx$setScrollAreaHei, _ctx$grid;
|
|
62
|
+
const ctx = useRecordBoardContext({ displayName: "RecordBoard.ShellFrame" });
|
|
63
|
+
const fillHeight = (ctx === null || ctx === void 0 ? void 0 : ctx.fillHeight) === true;
|
|
64
|
+
const bodyContent = fillHeight ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ScrollAreaMeasurer, {
|
|
65
|
+
onHeight: (_ctx$setScrollAreaHei = ctx === null || ctx === void 0 ? void 0 : ctx.setScrollAreaHeight) !== null && _ctx$setScrollAreaHei !== void 0 ? _ctx$setScrollAreaHei : (() => {}),
|
|
66
|
+
autoCalc: ctx === null || ctx === void 0 || (_ctx$grid = ctx.grid) === null || _ctx$grid === void 0 || (_ctx$grid = _ctx$grid.scroll) === null || _ctx$grid === void 0 ? void 0 : _ctx$grid.autoCalc
|
|
67
|
+
}, children), /* @__PURE__ */ React.createElement(Pagination_default, null)) : /* @__PURE__ */ React.createElement(React.Fragment, null, children, /* @__PURE__ */ React.createElement(Pagination_default, null));
|
|
68
|
+
const shellStyle = fillHeight && style ? _objectSpread2(_objectSpread2({}, style), FILL_HEIGHT_WRAPPER_STYLE) : fillHeight ? FILL_HEIGHT_WRAPPER_STYLE : style;
|
|
69
|
+
const wrapper = /* @__PURE__ */ React.createElement(PisellShellFrame, {
|
|
24
70
|
className,
|
|
25
|
-
style,
|
|
71
|
+
style: shellStyle,
|
|
26
72
|
config: {
|
|
27
73
|
showToolbar: true,
|
|
28
74
|
showBatchActionBar: true
|
|
29
75
|
},
|
|
30
76
|
toolbar: /* @__PURE__ */ React.createElement(ToolBar_default, null),
|
|
31
77
|
batchActionBar: /* @__PURE__ */ React.createElement(BatchActionBar_default, null)
|
|
32
|
-
},
|
|
78
|
+
}, bodyContent);
|
|
79
|
+
if (fillHeight) return /* @__PURE__ */ React.createElement("div", { style: FILL_HEIGHT_WRAPPER_STYLE }, wrapper);
|
|
80
|
+
return wrapper;
|
|
33
81
|
};
|
|
34
82
|
RecordBoardShellFrame.displayName = "RecordBoard.ShellFrame";
|
|
35
83
|
var shellFrame_default = RecordBoardShellFrame;
|
|
@@ -29,7 +29,7 @@ type RecordBoardOptionItem = {
|
|
|
29
29
|
type RecordBoardGetOptions = (() => RecordBoardOptionItem[]) | (() => Promise<RecordBoardOptionItem[]>);
|
|
30
30
|
/** 列筛选配置:不传列 type 时使用。可配置 type + options/props,或传入 component(接收 value/onChange)。 */
|
|
31
31
|
interface RecordBoardColumnFilterConfig {
|
|
32
|
-
type?: 'single' | 'input' | 'datePicker' | 'rangePicker' | 'search';
|
|
32
|
+
type?: 'single' | 'input' | 'datePicker' | 'rangePicker' | 'rangePickerNew' | 'search';
|
|
33
33
|
label?: string;
|
|
34
34
|
options?: RecordBoardOptionItem[];
|
|
35
35
|
/** 同步或异步获取选项,与 options 二选一;支持 singleSelect/multipleSelect 及无 type 时 type:'single' */
|
|
@@ -142,6 +142,12 @@ interface RecordBoardContextValue {
|
|
|
142
142
|
onColumnVisibilityChange?: (visibility: Record<string, boolean>) => void;
|
|
143
143
|
/** 各子组件透传 props,由 Provider 注入 */
|
|
144
144
|
childComponentProps?: RecordBoardChildComponentProps;
|
|
145
|
+
/** 是否占满父容器高度,供 ShellFrame 做弹性布局(内容区纯 CSS 滚动 + 表头 sticky;scroll.autoCalc 时用测量高度) */
|
|
146
|
+
fillHeight?: boolean;
|
|
147
|
+
/** 内容区滚动容器高度(fillHeight 且 grid.scroll.autoCalc 时由 ShellFrame 测量),供 Grid 计算 scroll.y */
|
|
148
|
+
scrollAreaHeight?: number | null;
|
|
149
|
+
/** 设置内容区滚动容器高度(由 ShellFrame 测量组件调用) */
|
|
150
|
+
setScrollAreaHeight?: (height: number | null) => void;
|
|
145
151
|
}
|
|
146
152
|
/**
|
|
147
153
|
* 各 layout 下子组件的可选透传配置(类似 ChildComponentProps)
|
|
@@ -191,10 +197,18 @@ type RecordBoardSearchProps = Record<string, any>;
|
|
|
191
197
|
*/
|
|
192
198
|
type RecordBoardGridProps = {
|
|
193
199
|
/** 列配置;ToolBar 据此派生筛选与排序,ColumnSetting 据此做列显示隐藏 */columns?: RecordBoardColumnType[]; /** 默认隐藏的列 key 列表(对应 columns 的 key 或 dataIndex),用于初始化列显隐状态 */
|
|
194
|
-
defaultHiddenColumnKeys?: string[];
|
|
200
|
+
defaultHiddenColumnKeys?: string[];
|
|
201
|
+
/**
|
|
202
|
+
* 表格滚动配置,对齐 materials Table useGenScroll。
|
|
203
|
+
* - x / y:同 antd Table scroll。
|
|
204
|
+
* - autoCalc:为 true 时根据内容区高度自动计算 scroll.y(需 fillHeight),表头固定、表体滚动。
|
|
205
|
+
* - scrollToFirstRowOnChange:翻页后是否滚动到第一行。
|
|
206
|
+
*/
|
|
195
207
|
scroll?: {
|
|
196
208
|
x?: number | string;
|
|
197
209
|
y?: number | string;
|
|
210
|
+
autoCalc?: boolean;
|
|
211
|
+
scrollToFirstRowOnChange?: boolean;
|
|
198
212
|
}; /** 表格尺寸 */
|
|
199
213
|
size?: 'small' | 'middle' | 'default'; /** 当前选中的行 key 列表(多选) */
|
|
200
214
|
selectedKeys?: Key[]; /** 当前选中的行数据(多选) */
|