@chengkejie/form-page 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/cjs/FormPage.d.ts +30 -30
- package/dist/cjs/FormPage.d.ts.map +1 -1
- package/dist/cjs/FormPage.js +779 -761
- package/dist/cjs/components/CompanySelect/index.d.ts +6 -6
- package/dist/cjs/components/CompanySelect/index.js +80 -80
- package/dist/cjs/components/CustomNode/index.d.ts +6 -6
- package/dist/cjs/components/CustomNode/index.js +12 -12
- package/dist/cjs/components/ExtraDatePicker/index.d.ts +7 -7
- package/dist/cjs/components/ExtraDatePicker/index.js +139 -139
- package/dist/cjs/components/Section/index.d.ts +6 -6
- package/dist/cjs/components/Section/index.js +32 -32
- package/dist/cjs/components/SelectSearch/index.d.ts +6 -6
- package/dist/cjs/components/SelectSearch/index.d.ts.map +1 -1
- package/dist/cjs/components/SelectSearch/index.js +66 -39
- package/dist/cjs/components/SettingDialog/index.d.ts +11 -11
- package/dist/cjs/components/SettingDialog/index.js +130 -130
- package/dist/cjs/context.d.ts +33 -33
- package/dist/cjs/context.js +22 -22
- package/dist/cjs/index.d.ts +11 -11
- package/dist/cjs/index.js +76 -76
- package/dist/cjs/tableKeyMap.d.ts +2 -2
- package/dist/cjs/tableKeyMap.js +12 -12
- package/dist/cjs/types.d.ts +241 -234
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/types.js +4 -4
- package/dist/esm/FormPage.d.ts +30 -30
- package/dist/esm/FormPage.d.ts.map +1 -1
- package/dist/esm/FormPage.js +777 -759
- package/dist/esm/components/CompanySelect/index.d.ts +6 -6
- package/dist/esm/components/CompanySelect/index.js +74 -74
- package/dist/esm/components/CustomNode/index.d.ts +6 -6
- package/dist/esm/components/CustomNode/index.js +6 -6
- package/dist/esm/components/ExtraDatePicker/index.d.ts +7 -7
- package/dist/esm/components/ExtraDatePicker/index.js +132 -132
- package/dist/esm/components/Section/index.d.ts +6 -6
- package/dist/esm/components/Section/index.js +27 -27
- package/dist/esm/components/SelectSearch/index.d.ts +6 -6
- package/dist/esm/components/SelectSearch/index.d.ts.map +1 -1
- package/dist/esm/components/SelectSearch/index.js +60 -33
- package/dist/esm/components/SettingDialog/index.d.ts +11 -11
- package/dist/esm/components/SettingDialog/index.js +122 -122
- package/dist/esm/context.d.ts +33 -33
- package/dist/esm/context.js +13 -13
- package/dist/esm/index.d.ts +11 -11
- package/dist/esm/index.js +8 -8
- package/dist/esm/tableKeyMap.d.ts +2 -2
- package/dist/esm/tableKeyMap.js +6 -6
- package/dist/esm/types.d.ts +241 -234
- package/dist/esm/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,6 +93,7 @@ function App() {
|
|
|
93
93
|
| `searchFn` | `(data, params, fromButton) => Promise<{ data: any[]; total: number }>` | `() => {}` | **查询接口**。`data`=表单字段值,`params`=分页参数,`fromButton`=是否由按钮触发(区分搜索/重置与翻页静默刷新) |
|
|
94
94
|
| `exportFn` | `(...args) => any` | `() => {}` | 导出接口,复用同一表单字段,点击「导出」按钮时触发 |
|
|
95
95
|
| `rowSelectionFn` | `((keys, records) => void) \| null` | `null` | 行选择回调;传 `null` 不启用行选择 |
|
|
96
|
+
| `rowSelectionProps` | `Record<string, any>` | `{}` | 透传给 Table `rowSelection` 的自定义配置,如 `getProps: (record) => ({ disabled: ... })` 局部禁用某些行的勾选框;`selectedRowKeys`/`onChange` 由组件内部管理,传入同名字段会被忽略。全选时自动跳过被禁用的行 |
|
|
96
97
|
| `tableProps` | [`TableConfigProps`](#tableprops-表格配置) | `{}` | 表格配置(含 `tableId` / `columns` / `primaryKey` 等) |
|
|
97
98
|
| `conditionProps` | [`ConditionItem[]`](#conditionprops-搜索条件配置) | `[]` | 搜索条件配置数组,每项的 `type` 决定渲染哪种控件 |
|
|
98
99
|
| `buttonProps` | [`ButtonConfigProps`](#buttonprops-按钮配置) | `{}` | 操作按钮区配置 |
|
|
@@ -336,9 +337,11 @@ interface ButtonConfigProps {
|
|
|
336
337
|
|
|
337
338
|
| 风格 | 视觉 | 说明 |
|
|
338
339
|
|------|------|------|
|
|
339
|
-
| `'primary'`(默认) |
|
|
340
|
+
| `'primary'`(默认) | 搜索/导出 = 主题色实心主按钮;重置 = 白底主题橙描边幽灵按钮 | 两个主操作实心 + 重置描边 |
|
|
340
341
|
| `'ghost'` | 全部 = 白底 + 主题橙(`#ff7e07`)描边幽灵按钮 | 权重一致,见下图风格 |
|
|
341
342
|
|
|
343
|
+
> 默认 `'primary'` 下,「重置」按钮即白底主题橙描边样式(同 `ghost` 的 `ghostBtn` 视觉),因此示例 ② 的 `{ name: 'reset', style: 'ghost' }` 在默认风格下为冗余写法,主要用于「整体 `ghost`」时强调仍按需覆盖。
|
|
344
|
+
|
|
342
345
|
```tsx
|
|
343
346
|
// ① 整体风格:全部幽灵描边
|
|
344
347
|
buttonProps={{ buttons: ['submit', 'reset', 'export'], buttonStyle: 'ghost' }}
|
package/dist/cjs/FormPage.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ConditionItem, SelectCondition, InputCondition, TreeSelectCondition, CascaderSelectCondition, DatePickerCondition, MonthPickerCondition, RangePickerCondition, SectionCondition, CompanySelectCondition, ExtraDatePickerCondition, SelectSearchCondition, CustomNodeCondition, CustomCondition, TableConfigProps, ButtonConfigProps, ButtonItemConfig, FormPageProps, FormPageRef } from './types';
|
|
3
|
-
export type { FormPageProps, FormPageRef, ConditionItem, TableConfigProps, ButtonConfigProps, ButtonItemConfig, SelectCondition, InputCondition, TreeSelectCondition, CascaderSelectCondition, DatePickerCondition, MonthPickerCondition, RangePickerCondition, SectionCondition, CompanySelectCondition, ExtraDatePickerCondition, SelectSearchCondition, CustomNodeCondition, CustomCondition, };
|
|
4
|
-
/**
|
|
5
|
-
* 估算字符串在「字数」意义上的宽度(用于 alignLabelWidth 按字数对齐)。
|
|
6
|
-
* 全角字符(中日韩、全角标点)计 1,半角字符两个计 1(最少 1)。
|
|
7
|
-
*/
|
|
8
|
-
export declare const stringWidth: (s: string) => number;
|
|
9
|
-
declare const _default: React.ForwardRefExoticComponent<FormPageProps & React.RefAttributes<FormPageRef>>;
|
|
10
|
-
export default _default;
|
|
11
|
-
/**
|
|
12
|
-
* 条件类型的枚举常量,供外部使用时避免硬编码字符串
|
|
13
|
-
* 与 condition 映射表中的 key 一一对应
|
|
14
|
-
*/
|
|
15
|
-
export declare const FormPageData: {
|
|
16
|
-
Type: {
|
|
17
|
-
Select: string;
|
|
18
|
-
Input: string;
|
|
19
|
-
TreeSelect: string;
|
|
20
|
-
DatePicker: string;
|
|
21
|
-
MonthPicker: string;
|
|
22
|
-
Section: string;
|
|
23
|
-
RangePicker: string;
|
|
24
|
-
CompanySelect: string;
|
|
25
|
-
ExtraDatePicker: string;
|
|
26
|
-
SelectSearch: string;
|
|
27
|
-
CustomNode: string;
|
|
28
|
-
cascaderSelect: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ConditionItem, SelectCondition, InputCondition, TreeSelectCondition, CascaderSelectCondition, DatePickerCondition, MonthPickerCondition, RangePickerCondition, SectionCondition, CompanySelectCondition, ExtraDatePickerCondition, SelectSearchCondition, CustomNodeCondition, CustomCondition, TableConfigProps, ButtonConfigProps, ButtonItemConfig, FormPageProps, FormPageRef } from './types';
|
|
3
|
+
export type { FormPageProps, FormPageRef, ConditionItem, TableConfigProps, ButtonConfigProps, ButtonItemConfig, SelectCondition, InputCondition, TreeSelectCondition, CascaderSelectCondition, DatePickerCondition, MonthPickerCondition, RangePickerCondition, SectionCondition, CompanySelectCondition, ExtraDatePickerCondition, SelectSearchCondition, CustomNodeCondition, CustomCondition, };
|
|
4
|
+
/**
|
|
5
|
+
* 估算字符串在「字数」意义上的宽度(用于 alignLabelWidth 按字数对齐)。
|
|
6
|
+
* 全角字符(中日韩、全角标点)计 1,半角字符两个计 1(最少 1)。
|
|
7
|
+
*/
|
|
8
|
+
export declare const stringWidth: (s: string) => number;
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<FormPageProps & React.RefAttributes<FormPageRef>>;
|
|
10
|
+
export default _default;
|
|
11
|
+
/**
|
|
12
|
+
* 条件类型的枚举常量,供外部使用时避免硬编码字符串
|
|
13
|
+
* 与 condition 映射表中的 key 一一对应
|
|
14
|
+
*/
|
|
15
|
+
export declare const FormPageData: {
|
|
16
|
+
Type: {
|
|
17
|
+
Select: string;
|
|
18
|
+
Input: string;
|
|
19
|
+
TreeSelect: string;
|
|
20
|
+
DatePicker: string;
|
|
21
|
+
MonthPicker: string;
|
|
22
|
+
Section: string;
|
|
23
|
+
RangePicker: string;
|
|
24
|
+
CompanySelect: string;
|
|
25
|
+
ExtraDatePicker: string;
|
|
26
|
+
SelectSearch: string;
|
|
27
|
+
CustomNode: string;
|
|
28
|
+
cascaderSelect: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
31
|
//# sourceMappingURL=FormPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormPage.d.ts","sourceRoot":"","sources":["../src/FormPage.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAQN,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,GAChB,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,WAAW,MAAO,MAAM,KAAG,MAavC,CAAC;;
|
|
1
|
+
{"version":3,"file":"FormPage.d.ts","sourceRoot":"","sources":["../src/FormPage.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAQN,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,GAChB,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,WAAW,MAAO,MAAM,KAAG,MAavC,CAAC;;AAorBF,wBAAoC;AAEpC;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;CAexB,CAAC"}
|