@teamix/pro 1.1.39 → 1.1.40
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 +14 -10
- package/dist/pro.css +1 -1
- package/dist/pro.js +2214 -4073
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.d.ts +5 -5
- package/es/actions/dialog-form.js +1 -5
- package/es/actions/dialog.d.ts +6 -3
- package/es/actions/dialog.js +12 -5
- package/es/actions/index.d.ts +54 -47
- package/es/actions/index.js +28 -22
- package/es/actions/index.scss +17 -2
- package/es/card/index.d.ts +17 -5
- package/es/card/index.js +16 -11
- package/es/form/Components/ProField/index.d.ts +1 -78
- package/es/form/Components/ProField/index.js +34 -40
- package/es/form/Filter/index.js +2 -2
- package/es/form/ProForm/index.d.ts +2 -2
- package/es/form/ProForm/index.js +1 -6
- package/es/form/ProForm/index.scss +19 -1
- package/es/form/ProForm/useFieldRequest.d.ts +5 -0
- package/es/form/ProForm/useFieldRequest.js +26 -0
- package/es/form/SchemaForm/adapterDecorator.js +2 -2
- package/es/form/SchemaForm/index.d.ts +2 -2
- package/es/form/SchemaForm/index.js +12 -21
- package/es/form/SchemaForm/initializeArrayCards.d.ts +2 -2
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +2 -2
- package/es/form/SchemaForm/initializeArrayItems.d.ts +2 -2
- package/es/form/SchemaForm/initializeArrayTable.d.ts +2 -2
- package/es/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/es/form/SchemaForm/initializeDataSource.js +2 -2
- package/es/form/SchemaForm/initializeFormButton.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormStep.d.ts +3 -3
- package/es/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/es/form/SchemaForm/initializeRequest.js +2 -2
- package/es/form/SchemaForm/initializeRules.js +44 -16
- package/es/form/SchemaForm/reactions.d.ts +5 -5
- package/es/form/SchemaForm/reactions.js +20 -18
- package/es/form/fieldTypeMap.d.ts +4 -0
- package/es/form/fieldTypeMap.js +41 -0
- package/es/form/index.d.ts +92 -4
- package/es/form/index.js +18 -5
- package/es/form/schemaNameMap.js +3 -0
- package/es/form/typing.d.ts +44 -21
- package/es/form/utils.d.ts +3 -1
- package/es/form/utils.js +38 -1
- package/es/form/warning.d.ts +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/InfoGroup/index.js +73 -15
- package/es/info/components/InfoGroup/index.scss +45 -3
- package/es/info/components/InfoValueItem/index.js +6 -4
- package/es/info/components/InfoValueItem/index.scss +5 -1
- package/es/info/components/ProInfoItem/index.js +3 -3
- package/es/info/components/ProInfoItem/index.scss +1 -0
- package/es/info/components/baseInfo/index.d.ts +2 -3
- package/es/info/components/headerInfo/index.d.ts +2 -3
- package/es/info/components/tableInfo/index.d.ts +2 -3
- package/es/info/components/tableInfo/index.js +2 -2
- package/es/info/index.js +52 -49
- package/es/info/typing.d.ts +52 -36
- package/es/info/utils/index.d.ts +2 -2
- package/es/info/utils/utils.d.ts +1 -1
- package/es/nocode/pages/renderer.js +2 -2
- package/es/page-header/index.d.ts +34 -21
- package/es/page-header/index.js +39 -30
- package/es/page-header/index.scss +2 -1
- package/es/table/components/EmptyContent/index.d.ts +2 -0
- package/es/table/components/EmptyContent/index.js +11 -0
- package/es/table/components/Filter/index.d.ts +2 -2
- package/es/table/components/Filter/index.js +16 -8
- package/es/table/components/Layout/index.js +2 -2
- package/es/table/components/QuickAction/index.d.ts +2 -2
- package/es/table/components/QuickAction/index.js +3 -3
- package/es/table/components/ToolBar/Fullscreen.js +1 -0
- package/es/table/index.js +76 -14
- package/es/table/index.scss +4 -0
- package/es/table/typing.d.ts +27 -14
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +2 -2
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +1 -1
- package/es/table/utils/index.js +33 -11
- package/es/templates/List/index.d.ts +2 -2
- package/es/utils/message.d.ts +3 -0
- package/es/utils/message.js +19 -0
- package/lib/actions/dialog-form.d.ts +5 -5
- package/lib/actions/dialog-form.js +1 -5
- package/lib/actions/dialog.d.ts +6 -3
- package/lib/actions/dialog.js +13 -5
- package/lib/actions/index.d.ts +54 -47
- package/lib/actions/index.js +37 -30
- package/lib/actions/index.scss +17 -2
- package/lib/card/index.d.ts +17 -5
- package/lib/card/index.js +18 -12
- package/lib/form/Components/ProField/index.d.ts +1 -78
- package/lib/form/Components/ProField/index.js +32 -38
- package/lib/form/Filter/index.js +2 -2
- package/lib/form/ProForm/index.d.ts +2 -2
- package/lib/form/ProForm/index.js +1 -7
- package/lib/form/ProForm/index.scss +19 -1
- package/lib/form/ProForm/useFieldRequest.d.ts +5 -0
- package/lib/form/ProForm/useFieldRequest.js +37 -0
- package/lib/form/SchemaForm/adapterDecorator.js +4 -2
- package/lib/form/SchemaForm/index.d.ts +2 -2
- package/lib/form/SchemaForm/index.js +11 -22
- package/lib/form/SchemaForm/initializeArrayCards.d.ts +2 -2
- package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +2 -2
- package/lib/form/SchemaForm/initializeArrayItems.d.ts +2 -2
- package/lib/form/SchemaForm/initializeArrayTable.d.ts +2 -2
- package/lib/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/lib/form/SchemaForm/initializeDataSource.js +2 -2
- package/lib/form/SchemaForm/initializeFormButton.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormCollapse.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormStep.d.ts +3 -3
- package/lib/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/lib/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/lib/form/SchemaForm/initializeRequest.js +1 -1
- package/lib/form/SchemaForm/initializeRules.js +41 -13
- package/lib/form/SchemaForm/reactions.d.ts +5 -5
- package/lib/form/SchemaForm/reactions.js +22 -20
- package/lib/form/fieldTypeMap.d.ts +4 -0
- package/lib/form/fieldTypeMap.js +48 -0
- package/lib/form/index.d.ts +92 -4
- package/lib/form/index.js +17 -31
- package/lib/form/schemaNameMap.js +3 -0
- package/lib/form/typing.d.ts +44 -21
- package/lib/form/utils.d.ts +3 -1
- package/lib/form/utils.js +43 -1
- package/lib/form/warning.d.ts +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/InfoGroup/index.js +76 -14
- package/lib/info/components/InfoGroup/index.scss +45 -3
- package/lib/info/components/InfoValueItem/index.js +5 -3
- package/lib/info/components/InfoValueItem/index.scss +5 -1
- package/lib/info/components/ProInfoItem/index.js +2 -2
- package/lib/info/components/ProInfoItem/index.scss +1 -0
- package/lib/info/components/baseInfo/index.d.ts +2 -3
- package/lib/info/components/headerInfo/index.d.ts +2 -3
- package/lib/info/components/tableInfo/index.d.ts +2 -3
- package/lib/info/components/tableInfo/index.js +1 -1
- package/lib/info/index.js +51 -48
- package/lib/info/typing.d.ts +52 -36
- package/lib/info/utils/index.d.ts +2 -2
- package/lib/info/utils/utils.d.ts +1 -1
- package/lib/nocode/pages/renderer.js +1 -1
- package/lib/page-header/index.d.ts +34 -21
- package/lib/page-header/index.js +37 -28
- package/lib/page-header/index.scss +2 -1
- package/lib/table/components/EmptyContent/index.d.ts +2 -0
- package/lib/table/components/EmptyContent/index.js +25 -0
- package/lib/table/components/Filter/index.d.ts +2 -2
- package/lib/table/components/Filter/index.js +16 -8
- package/lib/table/components/Layout/index.js +1 -1
- package/lib/table/components/QuickAction/index.d.ts +2 -2
- package/lib/table/components/QuickAction/index.js +1 -1
- package/lib/table/components/ToolBar/Fullscreen.js +1 -0
- package/lib/table/index.js +77 -14
- package/lib/table/index.scss +4 -0
- package/lib/table/typing.d.ts +27 -14
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +1 -1
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +2 -2
- package/lib/table/utils/index.js +33 -11
- package/lib/templates/List/index.d.ts +2 -2
- package/lib/utils/message.d.ts +3 -0
- package/lib/utils/message.js +32 -0
- package/package.json +4 -4
- package/es/form/Components/Search/index.d.ts +0 -11
- package/es/form/Components/Search/index.js +0 -89
- package/es/form/SchemaForm/initializeArrayIcon.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayIcon.js +0 -62
- package/es/form/SchemaForm/initializeProField.d.ts +0 -5
- package/es/form/SchemaForm/initializeProField.js +0 -70
- package/es/info/utils/useInfoRequest.d.ts +0 -14
- package/es/info/utils/useInfoRequest.js +0 -76
- package/lib/form/Components/Search/index.d.ts +0 -11
- package/lib/form/Components/Search/index.js +0 -103
- package/lib/form/SchemaForm/initializeArrayIcon.d.ts +0 -3
- package/lib/form/SchemaForm/initializeArrayIcon.js +0 -73
- package/lib/form/SchemaForm/initializeProField.d.ts +0 -5
- package/lib/form/SchemaForm/initializeProField.js +0 -77
- package/lib/info/utils/useInfoRequest.d.ts +0 -14
- package/lib/info/utils/useInfoRequest.js +0 -85
package/es/table/typing.d.ts
CHANGED
@@ -2,19 +2,19 @@
|
|
2
2
|
* ProTable 类型定义
|
3
3
|
*/
|
4
4
|
import { ColumnProps, TableProps } from '@alicloudfe/components/types/table';
|
5
|
-
import {
|
5
|
+
import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem } from '../field';
|
6
6
|
import { IFilterProps } from '../form';
|
7
|
-
import { ActionGroupProps,
|
7
|
+
import { ActionGroupProps, ProActionButtonProps } from '../actions';
|
8
8
|
import { PaginationProps } from '@alicloudfe/components/types/pagination';
|
9
9
|
import { HeaderProps as ProTableHeaderProps } from '@teamix/utils';
|
10
10
|
import { Method } from 'axios';
|
11
11
|
import React from 'react';
|
12
12
|
import type { Form as FormType } from '@formily/core';
|
13
|
-
declare type IFieldRenderProps = keyof
|
13
|
+
declare type IFieldRenderProps = keyof ProFieldRenderProps;
|
14
14
|
/** 列record函数 */
|
15
15
|
declare type ProTableCellFunProp = (value: any, index: number, record: any) => any;
|
16
16
|
declare type ITableCellRender = {
|
17
|
-
[key in IFieldRenderProps]?:
|
17
|
+
[key in IFieldRenderProps]?: ProFieldRenderProps[key] | ProTableCellFunProp;
|
18
18
|
} | ((...other: any) => React.ReactNode);
|
19
19
|
declare type TDataService = {
|
20
20
|
/** 翻页器总数 */
|
@@ -22,7 +22,7 @@ declare type TDataService = {
|
|
22
22
|
/** 表格数据 */
|
23
23
|
data?: any;
|
24
24
|
};
|
25
|
-
export declare type
|
25
|
+
export declare type ProTableColumnProps = {
|
26
26
|
/**
|
27
27
|
* 会在 title 之后展示一个 icon,hover 之后提示一些信息
|
28
28
|
*/
|
@@ -32,7 +32,7 @@ export declare type ProColumnProps = {
|
|
32
32
|
*/
|
33
33
|
tooltipIcon?: React.ReactNode;
|
34
34
|
/** 对应 ProField 里面的 type */
|
35
|
-
valueType?:
|
35
|
+
valueType?: ProFieldType;
|
36
36
|
/** 【列配置】是否默认隐藏列 */
|
37
37
|
columnFilters?: boolean;
|
38
38
|
/** 【列配置】是否禁用隐藏列 */
|
@@ -40,7 +40,7 @@ export declare type ProColumnProps = {
|
|
40
40
|
/** 渲染单元格内容字段 */
|
41
41
|
render?: ITableCellRender;
|
42
42
|
/** 枚举值 */
|
43
|
-
dataSource?:
|
43
|
+
dataSource?: ProFieldDataSourceItem[] | ProTableCellFunProp;
|
44
44
|
/** 表头的过滤菜单项,当值为 true 时,自动使用 dataSource 生成 */
|
45
45
|
filters?: boolean | ProTableColumnsFilterItemProps[];
|
46
46
|
/** 表头的过滤菜单项过滤方式 single 单选 multiple 多选 */
|
@@ -56,9 +56,10 @@ export declare type ProColumnProps = {
|
|
56
56
|
/** 指定 valueType 为日期时间格式时,可以格式化日期时间 */
|
57
57
|
format?: string;
|
58
58
|
} & Omit<ColumnProps, 'filters' | 'dataIndex' | 'filtersMode'>;
|
59
|
+
export declare type ProColumnProps = ProTableColumnProps;
|
59
60
|
export declare type ProTableProps = {
|
60
61
|
/** ProColums 定义,取代 Table 的 columns */
|
61
|
-
columns:
|
62
|
+
columns: ProTableColumnProps[];
|
62
63
|
/** 请求地址 */
|
63
64
|
url?: string;
|
64
65
|
/** 请求方法 */
|
@@ -163,7 +164,15 @@ export declare type ProTableActionType = {
|
|
163
164
|
current?: number;
|
164
165
|
/** 每页数据量 */
|
165
166
|
pageSize?: number;
|
167
|
+
/** 翻页页数的请求参数名*/
|
168
|
+
targetPageKey?: string;
|
169
|
+
/** 翻页单页数量的请求参数名 */
|
170
|
+
targetPageSizeKey?: string;
|
166
171
|
};
|
172
|
+
/** 重置翻页器为1,不发送请求 */
|
173
|
+
resetPage?: () => void;
|
174
|
+
/** 获取数据过滤区表单实例 */
|
175
|
+
dataFilterForm?: FormType;
|
167
176
|
} & ProTableActionTypeMutations;
|
168
177
|
/** action State 定义 */
|
169
178
|
export declare type ProTableActionTypeMutations = {
|
@@ -177,6 +186,8 @@ export declare type ProTableActionTypeMutations = {
|
|
177
186
|
off?: (...args: any) => void;
|
178
187
|
/** 设置 列 过滤规则 */
|
179
188
|
setFilterRules?: (rules: ProTableColumnsFilterRulesItem) => void;
|
189
|
+
/** 获取 列 过滤规则 */
|
190
|
+
getFilterRules?: () => object;
|
180
191
|
/** 重新计算表格maxHeight高度 */
|
181
192
|
resetTableMaxBodyHeight?: () => void;
|
182
193
|
};
|
@@ -185,7 +196,7 @@ export declare type ProTableActionTypeState = {
|
|
185
196
|
fullScreenState: boolean;
|
186
197
|
filterRules: ProTableColumnsFilterRulesItem;
|
187
198
|
};
|
188
|
-
export declare type
|
199
|
+
export declare type ProTableDataFilterProps = {
|
189
200
|
/** 展示形式 */
|
190
201
|
mode?: 'inline' | 'panel';
|
191
202
|
/** mode='panel' 时是否默认展开 */
|
@@ -195,25 +206,27 @@ export declare type dataFilterProps = {
|
|
195
206
|
/** 搜索时是否传入值为空字符串的参数,默认不传 */
|
196
207
|
searchEmptyString?: boolean;
|
197
208
|
} & IFilterProps;
|
209
|
+
export declare type dataFilterProps = ProTableDataFilterProps;
|
198
210
|
export declare type ProTableTopAreaProps = {
|
199
211
|
/** 标题区 */
|
200
212
|
header?: ProTableHeaderProps;
|
201
213
|
/** 主操作区 */
|
202
214
|
mainAction?: ActionGroupProps | React.ReactNode;
|
203
215
|
/** 工具栏区 */
|
204
|
-
toolBar?: boolean |
|
216
|
+
toolBar?: boolean | ProTableToolBarItem[];
|
205
217
|
/** 快捷操作区 */
|
206
|
-
extra?:
|
218
|
+
extra?: ProActionButtonProps | React.ReactNode | React.ReactNode[];
|
207
219
|
/** 数据过滤区 */
|
208
|
-
dataFilter?:
|
220
|
+
dataFilter?: ProTableDataFilterProps;
|
209
221
|
/** 数据过滤区 form 表单模型 */
|
210
222
|
dataFilterForm?: FormType;
|
211
223
|
};
|
212
224
|
/** 单个工具栏 */
|
213
|
-
declare type
|
225
|
+
export declare type ProTableToolBarItem = React.ReactNode | 'refresh' | 'density' | 'filterColumn' | 'fullscreen';
|
226
|
+
export declare type toolBarItem = ProTableToolBarItem;
|
214
227
|
export declare type ProTableLayoutProps = {
|
215
228
|
actionRef: React.MutableRefObject<ProTableActionType | undefined>;
|
216
|
-
columns?:
|
229
|
+
columns?: ProTableColumnProps[];
|
217
230
|
rowSelection?: innerRowSelectionType | rowSelectionType;
|
218
231
|
} & ProTableTopAreaProps;
|
219
232
|
/** columns 列过滤 */
|
@@ -2,12 +2,12 @@
|
|
2
2
|
* 渲染列的逻辑函数
|
3
3
|
*/
|
4
4
|
import React from 'react';
|
5
|
-
import {
|
5
|
+
import { ProTableColumnProps, ProTableActionType } from '../typing';
|
6
6
|
/**
|
7
7
|
* 增加了 icon 的功能 render title
|
8
8
|
*/
|
9
|
-
export declare const renderColumnsTitle: (item:
|
9
|
+
export declare const renderColumnsTitle: (item: ProTableColumnProps, actionRef: React.MutableRefObject<ProTableActionType | undefined>) => JSX.Element;
|
10
10
|
/**
|
11
11
|
* 负责单元格的具体渲染
|
12
12
|
*/
|
13
|
-
export declare const renderCell: (value: any, item:
|
13
|
+
export declare const renderCell: (value: any, item: ProTableColumnProps, index: number, record: any, actionRef: React.MutableRefObject<ProTableActionType | undefined>) => JSX.Element;
|
@@ -29,7 +29,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
29
29
|
*/
|
30
30
|
import React from 'react';
|
31
31
|
import { getTargetValue, LabelIconTip } from '@teamix/utils';
|
32
|
-
import {
|
32
|
+
import { ProActionGroup } from '../../actions';
|
33
33
|
import ProField from '../../field';
|
34
34
|
import Filter from '../components/Filter';
|
35
35
|
/**
|
@@ -93,7 +93,7 @@ export var renderCell = function renderCell(value, item, index, record, actionRe
|
|
93
93
|
record: record,
|
94
94
|
action: actionRef.current
|
95
95
|
};
|
96
|
-
return /*#__PURE__*/React.createElement(
|
96
|
+
return /*#__PURE__*/React.createElement(ProActionGroup, _objectSpread(_objectSpread({
|
97
97
|
type: "text"
|
98
98
|
}, actionSchema), {}, {
|
99
99
|
context: _objectSpread(_objectSpread({}, defaultContext), actionSchema.context)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import { ProTableColumnProps, ProTableActionType } from '../typing';
|
3
3
|
import { ColumnProps } from '@alicloudfe/components/types/table';
|
4
4
|
/**
|
5
5
|
* ProColumn => Column
|
6
6
|
*/
|
7
|
-
export default function genProColumnToColumn(columns:
|
7
|
+
export default function genProColumnToColumn(columns: ProTableColumnProps[],
|
8
8
|
/** 是否渲染骨架屏 */
|
9
9
|
showSkeleton: boolean, actionRef: React.MutableRefObject<ProTableActionType | undefined>): ColumnProps[];
|
@@ -12,7 +12,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
12
12
|
|
13
13
|
import React from 'react';
|
14
14
|
import { renderColumnsTitle, renderCell } from './columnRender';
|
15
|
-
import {
|
15
|
+
import { ProSkeletonRaw as Skeleton } from '../../skeleton';
|
16
16
|
/**
|
17
17
|
* ProColumn => Column
|
18
18
|
*/
|
package/es/table/utils/index.js
CHANGED
@@ -45,6 +45,28 @@ var mutations = {
|
|
45
45
|
state.filterRules = rules;
|
46
46
|
},
|
47
47
|
|
48
|
+
/**
|
49
|
+
* 获取筛选规则。为params
|
50
|
+
*/
|
51
|
+
getFilterRules: function getFilterRules() {
|
52
|
+
var result = {};
|
53
|
+
|
54
|
+
if (state.filterRules) {
|
55
|
+
result = Object.entries(state.filterRules).map(function (_ref) {
|
56
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
57
|
+
k = _ref2[0],
|
58
|
+
v = _ref2[1];
|
59
|
+
|
60
|
+
return _defineProperty({}, k, v.params);
|
61
|
+
}).reduce(function (acc, cur) {
|
62
|
+
acc = _objectSpread(_objectSpread({}, acc), cur);
|
63
|
+
return acc;
|
64
|
+
}, {});
|
65
|
+
}
|
66
|
+
|
67
|
+
return result;
|
68
|
+
},
|
69
|
+
|
48
70
|
/**
|
49
71
|
* 绑定监听函数
|
50
72
|
* @param fun 监听函数
|
@@ -55,14 +77,14 @@ var mutations = {
|
|
55
77
|
callback[state][name] = fun;
|
56
78
|
},
|
57
79
|
off: function off(name) {
|
58
|
-
callback = Object.fromEntries(Object.entries(callback).map(function (
|
59
|
-
var
|
60
|
-
k =
|
61
|
-
v =
|
80
|
+
callback = Object.fromEntries(Object.entries(callback).map(function (_ref4) {
|
81
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
82
|
+
k = _ref5[0],
|
83
|
+
v = _ref5[1];
|
62
84
|
|
63
|
-
var filterV = Object.fromEntries(Object.entries(v).filter(function (
|
64
|
-
var
|
65
|
-
k =
|
85
|
+
var filterV = Object.fromEntries(Object.entries(v).filter(function (_ref6) {
|
86
|
+
var _ref7 = _slicedToArray(_ref6, 1),
|
87
|
+
k = _ref7[0];
|
66
88
|
|
67
89
|
return k !== name;
|
68
90
|
}));
|
@@ -77,10 +99,10 @@ var useOn = function useOn(state) {
|
|
77
99
|
}
|
78
100
|
|
79
101
|
if (callback[state]) {
|
80
|
-
Object.entries(callback[state]).forEach(function (
|
81
|
-
var
|
82
|
-
k =
|
83
|
-
v =
|
102
|
+
Object.entries(callback[state]).forEach(function (_ref8) {
|
103
|
+
var _ref9 = _slicedToArray(_ref8, 2),
|
104
|
+
k = _ref9[0],
|
105
|
+
v = _ref9[1];
|
84
106
|
|
85
107
|
if (v) {
|
86
108
|
v === null || v === void 0 ? void 0 : v.apply(void 0, args);
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { PageProps } from '../../page-container';
|
2
|
-
import {
|
2
|
+
import { ProPageHeaderProps } from '../../page-header';
|
3
3
|
import { ProTableProps } from '../../table';
|
4
4
|
export declare type ListPageProps = PageProps<{
|
5
|
-
header:
|
5
|
+
header: ProPageHeaderProps;
|
6
6
|
content: ProTableProps;
|
7
7
|
}>;
|
8
8
|
export declare const ListPage: (props: ListPageProps) => JSX.Element;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
2
|
+
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
4
|
+
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
|
+
|
7
|
+
import React from 'react';
|
8
|
+
import { Message } from '@alicloudfe/components';
|
9
|
+
export var renderProMessage = function renderProMessage(message) {
|
10
|
+
if (typeof message === 'string') {
|
11
|
+
return /*#__PURE__*/React.createElement(Message, {
|
12
|
+
type: "notice"
|
13
|
+
}, message);
|
14
|
+
}
|
15
|
+
|
16
|
+
return /*#__PURE__*/React.createElement(Message, _objectSpread({
|
17
|
+
type: "notice"
|
18
|
+
}, message));
|
19
|
+
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import { ProFormProps, ProFormSchema } from '../form';
|
3
3
|
import { RequestAction } from './request';
|
4
4
|
import { DialogAction } from './dialog';
|
5
5
|
export interface DialogFormAction extends DialogAction {
|
@@ -10,11 +10,11 @@ export interface DialogFormAction extends DialogAction {
|
|
10
10
|
/** 表单提交发送数据请求时,是否携带全部表单数据。默认携带 */
|
11
11
|
useFieldValuesForRequest?: boolean;
|
12
12
|
/**
|
13
|
-
* @deprecated 建议使用 schema 配置
|
13
|
+
* @deprecated 建议使用 schema 配置 ProFormProps 代替
|
14
14
|
*/
|
15
|
-
formProps?: Omit<
|
16
|
-
/** 同时支持两种配置方式,如果想完整定制表单,可使用完整的表单配置项
|
17
|
-
schema:
|
15
|
+
formProps?: Omit<ProFormProps, 'schema'>;
|
16
|
+
/** 同时支持两种配置方式,如果想完整定制表单,可使用完整的表单配置项 ProFormProps,否则可以只配置 ProFormSchema */
|
17
|
+
schema: ProFormSchema | ProFormProps;
|
18
18
|
}
|
19
19
|
export declare function useDialogFormAction(action: DialogFormAction, context?: any): {
|
20
20
|
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
@@ -23,7 +23,7 @@ var _request = require("./request");
|
|
23
23
|
var _dialog = _interopRequireDefault(require("./dialog"));
|
24
24
|
|
25
25
|
var _excluded = ["schema"],
|
26
|
-
_excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish"
|
26
|
+
_excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish"];
|
27
27
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
29
|
|
@@ -155,7 +155,6 @@ function useDialogFormAction(action, context) {
|
|
155
155
|
_action$size = action.size,
|
156
156
|
size = _action$size === void 0 ? 'small' : _action$size,
|
157
157
|
_onFinish = action.onFinish,
|
158
|
-
_onCancel = action.onCancel,
|
159
158
|
others = _objectWithoutProperties(action, _excluded2);
|
160
159
|
|
161
160
|
var formRef = (0, _react.useRef)();
|
@@ -191,9 +190,6 @@ function useDialogFormAction(action, context) {
|
|
191
190
|
var _formRef$current;
|
192
191
|
|
193
192
|
_onFinish && _onFinish((_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.values);
|
194
|
-
},
|
195
|
-
onCancel: function onCancel() {
|
196
|
-
_onCancel && _onCancel();
|
197
193
|
}
|
198
194
|
}, others), context);
|
199
195
|
}
|
package/lib/actions/dialog.d.ts
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { QuickShowConfig } from '@alicloudfe/components/types/dialog';
|
3
3
|
import { quickShowDrawerProps } from '@alicloudfe/components/types/drawer';
|
4
|
-
import {
|
4
|
+
import { ProFormSchema, ProFormSchemaItem } from '../form';
|
5
|
+
import { ProMessageProps } from '../utils/message';
|
5
6
|
import { RequestAction } from './request';
|
6
7
|
export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShowConfig, 'onError' | 'type'>, Omit<quickShowDrawerProps, 'trigger' | 'animation' | 'height' | 'locale' | 'onOk' | 'onCancel' | 'onError'> {
|
7
8
|
/** 点击「确认按钮」后的数据请求地址,非必填,不填就不发请求 */
|
@@ -12,12 +13,14 @@ export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShow
|
|
12
13
|
dialogQuickShowType?: 'alert' | 'confirm';
|
13
14
|
/** 弹窗消息类型 */
|
14
15
|
messageType?: 'success' | 'warning' | 'error' | 'notice' | 'help' | 'loading';
|
15
|
-
/**
|
16
|
+
/** 位于弹窗内容最上方的自定义内容区 */
|
16
17
|
beforeContent?: React.ReactNode;
|
18
|
+
/** 位于弹窗内容上方的消息提示区 */
|
19
|
+
message?: ProMessageProps;
|
17
20
|
/** 位于弹窗内容下方的自定义内容区 */
|
18
21
|
afterContent?: React.ReactNode;
|
19
22
|
/** 弹窗页脚描述区,位于按钮组的对面 */
|
20
|
-
footerDescription?: React.ReactNode |
|
23
|
+
footerDescription?: React.ReactNode | ProFormSchema | ProFormSchemaItem;
|
21
24
|
}
|
22
25
|
export declare function useDialogAction(action: DialogAction, context?: any): {
|
23
26
|
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
package/lib/actions/dialog.js
CHANGED
@@ -20,12 +20,14 @@ var _utils = require("@teamix/utils");
|
|
20
20
|
|
21
21
|
var _form = _interopRequireWildcard(require("../form"));
|
22
22
|
|
23
|
+
var _message = require("../utils/message");
|
24
|
+
|
23
25
|
var _base = require("./base");
|
24
26
|
|
25
27
|
var _request = require("./request");
|
26
28
|
|
27
29
|
var _excluded = ["url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
|
28
|
-
_excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "footerDescription", "footerAlign", "overlayProps"],
|
30
|
+
_excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "message", "footerDescription", "footerAlign", "overlayProps"],
|
29
31
|
_excluded3 = ["className"];
|
30
32
|
|
31
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -128,6 +130,7 @@ function useDialogAction(action, context) {
|
|
128
130
|
link = _getTargetValue.link,
|
129
131
|
beforeContent = _getTargetValue.beforeContent,
|
130
132
|
afterContent = _getTargetValue.afterContent,
|
133
|
+
message = _getTargetValue.message,
|
131
134
|
footerDescription = _getTargetValue.footerDescription,
|
132
135
|
footerAlign = _getTargetValue.footerAlign,
|
133
136
|
_getTargetValue$overl = _getTargetValue.overlayProps,
|
@@ -245,20 +248,25 @@ function useDialogAction(action, context) {
|
|
245
248
|
var dialogContent = Component ? /*#__PURE__*/_react.default.createElement(Component, _objectSpread({
|
246
249
|
key: (0, _utils.uuid)()
|
247
250
|
}, componentProps)) : addContextForReactNode(content, dialogContext);
|
248
|
-
|
251
|
+
|
252
|
+
var quickShowProps = _objectSpread(_objectSpread({
|
249
253
|
// @ts-ignore
|
250
254
|
onOk: onOk,
|
251
255
|
title: addContextForReactNode(title, dialogContext),
|
252
256
|
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, beforeContent && /*#__PURE__*/_react.default.createElement("div", {
|
253
257
|
className: "teamix-pro-dialog-before-content"
|
254
|
-
}, beforeContent
|
258
|
+
}, addContextForReactNode(beforeContent, dialogContext)), message && /*#__PURE__*/_react.default.createElement("div", {
|
259
|
+
className: "teamix-pro-dialog-message"
|
260
|
+
}, (0, _message.renderProMessage)(message)), dialogContent, afterContent && /*#__PURE__*/_react.default.createElement("div", {
|
255
261
|
className: "teamix-pro-dialog-after-content"
|
256
|
-
}, afterContent), footerDescription && /*#__PURE__*/_react.default.createElement("div", {
|
262
|
+
}, addContextForReactNode(afterContent, dialogContext)), footerDescription && /*#__PURE__*/_react.default.createElement("div", {
|
257
263
|
className: (0, _classnames.default)('teamix-pro-dialog-footer-description', getFooterAlignClass(isDrawer, footerAlign))
|
258
264
|
}, renderDialogFooterDescription(footerDescription))),
|
259
265
|
closeable: !loading,
|
260
266
|
footerAlign: footerAlign
|
261
|
-
}, containerOtherProps), containerProps)
|
267
|
+
}, containerOtherProps), containerProps);
|
268
|
+
|
269
|
+
var ret = container.show(quickShowProps);
|
262
270
|
store.hide = ret.hide;
|
263
271
|
};
|
264
272
|
|
package/lib/actions/index.d.ts
CHANGED
@@ -4,75 +4,82 @@ import { MenuButtonProps } from '@alicloudfe/components/types/menu-button';
|
|
4
4
|
import { LinkAction } from './link';
|
5
5
|
import { RequestAction } from './request';
|
6
6
|
import { DialogAction } from './dialog';
|
7
|
-
import { ConfirmAction } from './confirm';
|
8
|
-
import { DangerConfirmAction } from './danger-confirm';
|
9
|
-
import { NoticeAction } from './notice';
|
10
|
-
import { ErrorAction } from './error';
|
11
7
|
import { DialogFormAction } from './dialog-form';
|
12
8
|
import { DialogTableAction } from './dialog-table';
|
13
9
|
import { DialogInfoAction } from './dialog-info';
|
14
|
-
import { DrawerAction } from './drawer';
|
15
|
-
import { DrawerFormAction } from './drawer-form';
|
16
|
-
import { DrawerTableAction } from './drawer-table';
|
17
|
-
import { DrawerInfoAction } from './drawer-info';
|
18
10
|
import './index.scss';
|
19
|
-
export declare type
|
20
|
-
type: '
|
21
|
-
} & LinkAction) | ({
|
22
|
-
type: 'request';
|
23
|
-
} & RequestAction) | ({
|
24
|
-
type: 'confirm';
|
25
|
-
} & ConfirmAction) | ({
|
26
|
-
type: 'danger-confirm';
|
27
|
-
} & DangerConfirmAction) | ({
|
28
|
-
type: 'notice';
|
29
|
-
} & NoticeAction) | ({
|
30
|
-
type: 'error';
|
31
|
-
} & ErrorAction) | ({
|
32
|
-
type: 'dialog';
|
33
|
-
} & DialogAction) | ({
|
34
|
-
type: 'dialog-form';
|
11
|
+
export declare type ProActionConfig = ({
|
12
|
+
type: 'dialog-form' | 'drawer-form';
|
35
13
|
} & DialogFormAction) | ({
|
36
|
-
type: 'dialog-table';
|
14
|
+
type: 'dialog-table' | 'drawer-table';
|
37
15
|
} & DialogTableAction) | ({
|
38
|
-
type: 'dialog-info';
|
16
|
+
type: 'dialog-info' | 'drawer-info';
|
39
17
|
} & DialogInfoAction) | ({
|
40
|
-
type: 'drawer';
|
41
|
-
} &
|
42
|
-
type: '
|
43
|
-
} &
|
44
|
-
type: '
|
45
|
-
} &
|
46
|
-
type: 'drawer-info';
|
47
|
-
} & DrawerInfoAction);
|
18
|
+
type: 'dialog' | 'drawer' | 'confirm' | 'danger-confirm' | 'notice' | 'error';
|
19
|
+
} & DialogAction) | ({
|
20
|
+
type: 'request';
|
21
|
+
} & RequestAction) | ({
|
22
|
+
type: 'link';
|
23
|
+
} & LinkAction);
|
48
24
|
export declare function registerActionHandler(id: string, extendActionId: string, defaultConfig: any): void;
|
49
|
-
export declare
|
50
|
-
export interface
|
51
|
-
config?:
|
25
|
+
export declare function useAction(config?: ProActionConfig, context?: any): any;
|
26
|
+
export interface ProActionButtonProps extends ButtonProps {
|
27
|
+
config?: ProActionConfig;
|
52
28
|
visible?: any;
|
53
29
|
disabled?: any;
|
54
30
|
icon?: string;
|
55
31
|
context?: any;
|
56
32
|
onClick?: (event: React.MouseEvent<Element, MouseEvent>, context?: any) => void;
|
57
33
|
}
|
58
|
-
export declare const
|
59
|
-
export interface
|
60
|
-
actions:
|
34
|
+
export declare const ProActionButton: (props: ProActionButtonProps) => JSX.Element;
|
35
|
+
export interface ProActionMenuButtonProps extends MenuButtonProps {
|
36
|
+
actions: ProActionProps[];
|
61
37
|
visible?: any;
|
62
38
|
icon?: string;
|
63
39
|
context?: any;
|
64
40
|
}
|
65
|
-
export declare const
|
66
|
-
export declare type
|
67
|
-
export declare type
|
41
|
+
export declare const ProActionMenuButton: (props: ProActionMenuButtonProps) => JSX.Element;
|
42
|
+
export declare type ProActionProps = ProActionButtonProps | ProActionMenuButtonProps;
|
43
|
+
export declare type ProActionGroupProps = {
|
68
44
|
type?: 'button' | 'text';
|
69
45
|
context?: any;
|
70
|
-
actions:
|
46
|
+
actions: ProActionProps[];
|
71
47
|
max?: number;
|
72
48
|
moreText?: string;
|
73
49
|
divider?: boolean;
|
74
50
|
} & React.HTMLAttributes<HTMLElement>;
|
75
|
-
export declare function
|
76
|
-
|
77
|
-
declare const ProAction: (props: IProAction) => JSX.Element;
|
51
|
+
export declare function ProActionGroup(props: ProActionGroupProps): JSX.Element;
|
52
|
+
declare const ProAction: (props: ProActionProps) => JSX.Element;
|
78
53
|
export default ProAction;
|
54
|
+
/**
|
55
|
+
* @deprecated 建议使用 ProActionGroup 代替
|
56
|
+
*/
|
57
|
+
export declare const ActionGroup: typeof ProActionGroup;
|
58
|
+
/**
|
59
|
+
* @deprecated 建议使用 ProActionButton 代替
|
60
|
+
*/
|
61
|
+
export declare const ActionButton: (props: ProActionButtonProps) => JSX.Element;
|
62
|
+
/**
|
63
|
+
* @deprecated 建议使用 ProActionMenuButton 代替
|
64
|
+
*/
|
65
|
+
export declare const ActionMenuButton: (props: ProActionMenuButtonProps) => JSX.Element;
|
66
|
+
/**
|
67
|
+
* @deprecated 建议使用 ProActionConfig 代替
|
68
|
+
*/
|
69
|
+
export declare type ActionConfig = ProActionConfig;
|
70
|
+
/**
|
71
|
+
* @deprecated 建议使用 ProActionButtonProps 代替
|
72
|
+
*/
|
73
|
+
export declare type IActionButton = ProActionButtonProps;
|
74
|
+
/**
|
75
|
+
* @deprecated 建议使用 ProActionMenuButtonProps 代替
|
76
|
+
*/
|
77
|
+
export declare type IActionMenuButton = ProActionMenuButtonProps;
|
78
|
+
/**
|
79
|
+
* @deprecated 建议使用 ProActionGroupProps 代替
|
80
|
+
*/
|
81
|
+
export declare type ActionGroupProps = ProActionGroupProps;
|
82
|
+
/**
|
83
|
+
* @deprecated 建议使用 ProActionProps 代替
|
84
|
+
*/
|
85
|
+
export declare type ICommonActionButton = ProActionProps;
|