@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
@@ -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;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
var _excluded = ["schema"],
|
2
|
-
_excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish"
|
2
|
+
_excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish"];
|
3
3
|
|
4
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
5
5
|
|
@@ -133,7 +133,6 @@ export function useDialogFormAction(action, context) {
|
|
133
133
|
_action$size = action.size,
|
134
134
|
size = _action$size === void 0 ? 'small' : _action$size,
|
135
135
|
_onFinish = action.onFinish,
|
136
|
-
_onCancel = action.onCancel,
|
137
136
|
others = _objectWithoutProperties(action, _excluded2);
|
138
137
|
|
139
138
|
var formRef = useRef();
|
@@ -169,9 +168,6 @@ export function useDialogFormAction(action, context) {
|
|
169
168
|
var _formRef$current;
|
170
169
|
|
171
170
|
_onFinish && _onFinish((_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.values);
|
172
|
-
},
|
173
|
-
onCancel: function onCancel() {
|
174
|
-
_onCancel && _onCancel();
|
175
171
|
}
|
176
172
|
}, others), context);
|
177
173
|
}
|
package/es/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/es/actions/dialog.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
var _excluded = ["url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
|
2
|
-
_excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "footerDescription", "footerAlign", "overlayProps"],
|
2
|
+
_excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "message", "footerDescription", "footerAlign", "overlayProps"],
|
3
3
|
_excluded3 = ["className"];
|
4
4
|
|
5
5
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
@@ -34,6 +34,7 @@ import { useHistory } from 'react-router-dom';
|
|
34
34
|
import { Dialog, Drawer } from '@alicloudfe/components';
|
35
35
|
import { getTargetValue, uuid, goToLink } from '@teamix/utils';
|
36
36
|
import ProForm, { createForm } from '../form';
|
37
|
+
import { renderProMessage } from '../utils/message';
|
37
38
|
import { eventHandler } from './base';
|
38
39
|
import { doRequest } from './request';
|
39
40
|
|
@@ -105,6 +106,7 @@ export function useDialogAction(action, context) {
|
|
105
106
|
link = _getTargetValue.link,
|
106
107
|
beforeContent = _getTargetValue.beforeContent,
|
107
108
|
afterContent = _getTargetValue.afterContent,
|
109
|
+
message = _getTargetValue.message,
|
108
110
|
footerDescription = _getTargetValue.footerDescription,
|
109
111
|
footerAlign = _getTargetValue.footerAlign,
|
110
112
|
_getTargetValue$overl = _getTargetValue.overlayProps,
|
@@ -222,20 +224,25 @@ export function useDialogAction(action, context) {
|
|
222
224
|
var dialogContent = Component ? /*#__PURE__*/React.createElement(Component, _objectSpread({
|
223
225
|
key: uuid()
|
224
226
|
}, componentProps)) : addContextForReactNode(content, dialogContext);
|
225
|
-
|
227
|
+
|
228
|
+
var quickShowProps = _objectSpread(_objectSpread({
|
226
229
|
// @ts-ignore
|
227
230
|
onOk: onOk,
|
228
231
|
title: addContextForReactNode(title, dialogContext),
|
229
232
|
content: /*#__PURE__*/React.createElement(React.Fragment, null, beforeContent && /*#__PURE__*/React.createElement("div", {
|
230
233
|
className: "teamix-pro-dialog-before-content"
|
231
|
-
}, beforeContent
|
234
|
+
}, addContextForReactNode(beforeContent, dialogContext)), message && /*#__PURE__*/React.createElement("div", {
|
235
|
+
className: "teamix-pro-dialog-message"
|
236
|
+
}, renderProMessage(message)), dialogContent, afterContent && /*#__PURE__*/React.createElement("div", {
|
232
237
|
className: "teamix-pro-dialog-after-content"
|
233
|
-
}, afterContent), footerDescription && /*#__PURE__*/React.createElement("div", {
|
238
|
+
}, addContextForReactNode(afterContent, dialogContext)), footerDescription && /*#__PURE__*/React.createElement("div", {
|
234
239
|
className: classnames('teamix-pro-dialog-footer-description', getFooterAlignClass(isDrawer, footerAlign))
|
235
240
|
}, renderDialogFooterDescription(footerDescription))),
|
236
241
|
closeable: !loading,
|
237
242
|
footerAlign: footerAlign
|
238
|
-
}, containerOtherProps), containerProps)
|
243
|
+
}, containerOtherProps), containerProps);
|
244
|
+
|
245
|
+
var ret = container.show(quickShowProps);
|
239
246
|
store.hide = ret.hide;
|
240
247
|
};
|
241
248
|
|
package/es/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;
|
package/es/actions/index.js
CHANGED
@@ -56,7 +56,7 @@ export function registerActionHandler(id, extendActionId, defaultConfig) {
|
|
56
56
|
defaultConfig: defaultConfig
|
57
57
|
});
|
58
58
|
}
|
59
|
-
export
|
59
|
+
export function useAction(config, context) {
|
60
60
|
if (!config) {
|
61
61
|
return {};
|
62
62
|
}
|
@@ -129,7 +129,7 @@ export var useAction = function useAction(config, context) {
|
|
129
129
|
return useAction(_objectSpread(_objectSpread({
|
130
130
|
type: registedAction.extendActionId
|
131
131
|
}, registedAction.defaultConfig), others), context);
|
132
|
-
}
|
132
|
+
}
|
133
133
|
|
134
134
|
var buttonContent = function buttonContent(content, iconType, iconSize, context) {
|
135
135
|
var renderedContent = typeof content === 'function' ? content(context) : content;
|
@@ -145,7 +145,7 @@ var buttonContent = function buttonContent(content, iconType, iconSize, context)
|
|
145
145
|
}), renderedContent];
|
146
146
|
};
|
147
147
|
|
148
|
-
export var
|
148
|
+
export var ProActionButton = function ProActionButton(props) {
|
149
149
|
var config = props.config,
|
150
150
|
icon = props.icon,
|
151
151
|
_props$iconSize = props.iconSize,
|
@@ -210,7 +210,7 @@ function renderCommonActionButtonMenuItem(action, key, context) {
|
|
210
210
|
return renderMenuButtonItem(action, key, context);
|
211
211
|
}
|
212
212
|
|
213
|
-
export var
|
213
|
+
export var ProActionMenuButton = function ProActionMenuButton(props) {
|
214
214
|
var icon = props.icon,
|
215
215
|
iconSize = props.iconSize,
|
216
216
|
label = props.label,
|
@@ -258,19 +258,13 @@ function renderCommonActionButton(button, context, isTypeText) {
|
|
258
258
|
var buttonProps = _objectSpread({
|
259
259
|
context: Object.assign({}, context, buttonContext),
|
260
260
|
text: text || isTypeText
|
261
|
-
}, others);
|
262
|
-
|
261
|
+
}, others);
|
263
262
|
|
264
263
|
if (!button.actions) {
|
265
|
-
return (
|
266
|
-
|
267
|
-
// @ts-ignore
|
268
|
-
React.createElement(ActionButton, _objectSpread({}, buttonProps))
|
269
|
-
);
|
270
|
-
} // @ts-ignore
|
271
|
-
|
264
|
+
return /*#__PURE__*/React.createElement(ProActionButton, _objectSpread({}, buttonProps));
|
265
|
+
}
|
272
266
|
|
273
|
-
return /*#__PURE__*/React.createElement(
|
267
|
+
return /*#__PURE__*/React.createElement(ProActionMenuButton, _objectSpread({}, buttonProps));
|
274
268
|
}
|
275
269
|
|
276
270
|
function getDefaultMoreButton(type, moreText) {
|
@@ -297,9 +291,7 @@ function getDefaultMoreButton(type, moreText) {
|
|
297
291
|
var MAX_ACTTIONS = 4;
|
298
292
|
|
299
293
|
function getActionConfig(action, context) {
|
300
|
-
// @ts-ignore
|
301
294
|
if (action.actions) {
|
302
|
-
// @ts-ignore
|
303
295
|
var actions = action.actions,
|
304
296
|
_others = _objectWithoutProperties(action, _excluded6);
|
305
297
|
|
@@ -308,8 +300,7 @@ function getActionConfig(action, context) {
|
|
308
300
|
return getActionConfig(a, context);
|
309
301
|
})
|
310
302
|
}, getTargetValue(_others, context));
|
311
|
-
}
|
312
|
-
|
303
|
+
}
|
313
304
|
|
314
305
|
var config = action.config,
|
315
306
|
others = _objectWithoutProperties(action, _excluded7);
|
@@ -319,7 +310,7 @@ function getActionConfig(action, context) {
|
|
319
310
|
}, getTargetValue(others, context));
|
320
311
|
}
|
321
312
|
|
322
|
-
export function
|
313
|
+
export function ProActionGroup(props) {
|
323
314
|
var _props$type3 = props.type,
|
324
315
|
type = _props$type3 === void 0 ? 'button' : _props$type3,
|
325
316
|
_props$divider = props.divider,
|
@@ -341,8 +332,8 @@ export function ActionGroup(props) {
|
|
341
332
|
});
|
342
333
|
var formatedActions = formatGroupActions(filteredActions, max, getDefaultMoreButton(type, moreText));
|
343
334
|
return /*#__PURE__*/React.createElement("div", _objectSpread({
|
344
|
-
className: cls('teamix-pro-actions', type, className, {
|
345
|
-
divider: divider
|
335
|
+
className: cls('teamix-pro-actions', "teamix-pro-actions-type-".concat(type), className, {
|
336
|
+
'teamix-pro-actions-divider': type === 'button' ? false : divider
|
346
337
|
})
|
347
338
|
}, containerProps), formatedActions.map(function (actionBtn, i) {
|
348
339
|
var isLastOne = i === formatedActions.length - 1;
|
@@ -358,4 +349,19 @@ var ProAction = function ProAction(props) {
|
|
358
349
|
return renderCommonActionButton(props);
|
359
350
|
};
|
360
351
|
|
361
|
-
export default ProAction;
|
352
|
+
export default ProAction;
|
353
|
+
/**
|
354
|
+
* @deprecated 建议使用 ProActionGroup 代替
|
355
|
+
*/
|
356
|
+
|
357
|
+
export var ActionGroup = ProActionGroup;
|
358
|
+
/**
|
359
|
+
* @deprecated 建议使用 ProActionButton 代替
|
360
|
+
*/
|
361
|
+
|
362
|
+
export var ActionButton = ProActionButton;
|
363
|
+
/**
|
364
|
+
* @deprecated 建议使用 ProActionMenuButton 代替
|
365
|
+
*/
|
366
|
+
|
367
|
+
export var ActionMenuButton = ProActionMenuButton;
|
package/es/actions/index.scss
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
display: flex;
|
3
3
|
align-items: center;
|
4
4
|
flex-wrap: wrap;
|
5
|
-
&.button {
|
5
|
+
&.teamix-pro-actions-type-button {
|
6
6
|
& > button {
|
7
7
|
&:not(:last-child) {
|
8
8
|
margin-right: var(--s-2);
|
@@ -10,7 +10,7 @@
|
|
10
10
|
}
|
11
11
|
}
|
12
12
|
|
13
|
-
&.text:not(.divider) {
|
13
|
+
&.teamix-pro-actions-type-text:not(.teamix-pro-actions-divider) {
|
14
14
|
& > button {
|
15
15
|
&:not(:last-child) {
|
16
16
|
margin-right: var(--s-4);
|
@@ -58,6 +58,16 @@
|
|
58
58
|
margin-bottom: var(--s-2);
|
59
59
|
}
|
60
60
|
|
61
|
+
.teamix-pro-dialog-message {
|
62
|
+
margin-bottom: var(--s-2);
|
63
|
+
|
64
|
+
&+.next-loading {
|
65
|
+
.teamix-pro-form {
|
66
|
+
margin-top: 20px;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
61
71
|
.teamix-pro-dialog-after-content {
|
62
72
|
margin-top: var(--s-2);
|
63
73
|
}
|
@@ -67,6 +77,11 @@
|
|
67
77
|
}
|
68
78
|
|
69
79
|
.next-dialog-body {
|
80
|
+
.teamix-pro-dialog-footer-description {
|
81
|
+
.teamix-pro-form {
|
82
|
+
margin-bottom: 0;
|
83
|
+
}
|
84
|
+
}
|
70
85
|
.teamix-pro-form {
|
71
86
|
margin-bottom: -20px;
|
72
87
|
}
|
package/es/card/index.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ActionGroupProps } from '../actions';
|
3
3
|
import './index.scss';
|
4
|
-
export declare type
|
4
|
+
export declare type ProCardContainerProps = {
|
5
5
|
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
6
6
|
spacing?: [number, number] | number;
|
7
7
|
wrap?: boolean;
|
8
8
|
} & React.HTMLAttributes<HTMLElement>;
|
9
|
-
export declare const
|
10
|
-
export interface
|
9
|
+
export declare const ProCardContainer: React.FC<ProCardContainerProps>;
|
10
|
+
export interface ProCardProps {
|
11
11
|
/** 内容部分 */
|
12
12
|
children?: React.ReactNode;
|
13
13
|
/**卡片标题 */
|
@@ -43,5 +43,17 @@ export interface CardProps {
|
|
43
43
|
/**卡片内容样式 */
|
44
44
|
contentStyle?: React.CSSProperties;
|
45
45
|
}
|
46
|
-
declare const
|
47
|
-
export default
|
46
|
+
declare const ProCard: React.FC<ProCardProps>;
|
47
|
+
export default ProCard;
|
48
|
+
/**
|
49
|
+
* @deprecated 建议使用 ProCardContainer 代替
|
50
|
+
*/
|
51
|
+
export declare const CardContainer: React.FC<ProCardContainerProps>;
|
52
|
+
/**
|
53
|
+
* @deprecated 建议使用 ProCardProps 代替
|
54
|
+
*/
|
55
|
+
export declare type CardProps = ProCardProps;
|
56
|
+
/**
|
57
|
+
* @deprecated 建议使用 ProCardContainerProps 代替
|
58
|
+
*/
|
59
|
+
export declare type CardContainerProps = ProCardContainerProps;
|
package/es/card/index.js
CHANGED
@@ -8,8 +8,8 @@ import React from 'react';
|
|
8
8
|
import classnames from 'classnames';
|
9
9
|
import { Card as BasicCard } from '@alicloudfe/components';
|
10
10
|
import { baseClass } from '@teamix/utils';
|
11
|
-
import {
|
12
|
-
import {
|
11
|
+
import { ProSkeletonRaw } from '../skeleton';
|
12
|
+
import { ProActionGroup } from '../actions';
|
13
13
|
import './index.scss';
|
14
14
|
var cls = baseClass('teamix-pro-card');
|
15
15
|
|
@@ -43,7 +43,7 @@ function getColClassAndStyle(col) {
|
|
43
43
|
};
|
44
44
|
}
|
45
45
|
|
46
|
-
export var
|
46
|
+
export var ProCardContainer = function ProCardContainer(props) {
|
47
47
|
var children = props.children,
|
48
48
|
style = props.style,
|
49
49
|
className = props.className,
|
@@ -90,7 +90,7 @@ export var CardContainer = function CardContainer(props) {
|
|
90
90
|
className: classnames(className, cls('container'), cls("container-flex-".concat(direction)), _defineProperty({}, cls('container-wrap'), wrap))
|
91
91
|
}, childrenModified);
|
92
92
|
};
|
93
|
-
|
93
|
+
ProCardContainer.defaultProps = {
|
94
94
|
spacing: 16,
|
95
95
|
direction: 'column'
|
96
96
|
};
|
@@ -101,7 +101,7 @@ var renderExtra = function renderExtra(extra) {
|
|
101
101
|
}
|
102
102
|
|
103
103
|
if (extra.actions instanceof Array) {
|
104
|
-
return /*#__PURE__*/React.createElement(
|
104
|
+
return /*#__PURE__*/React.createElement(ProActionGroup, _objectSpread(_objectSpread({}, extra), {}, {
|
105
105
|
type: "text"
|
106
106
|
}));
|
107
107
|
}
|
@@ -109,7 +109,7 @@ var renderExtra = function renderExtra(extra) {
|
|
109
109
|
return extra;
|
110
110
|
};
|
111
111
|
|
112
|
-
var
|
112
|
+
var ProCard = function ProCard(props) {
|
113
113
|
var children = props.children,
|
114
114
|
title = props.title,
|
115
115
|
subTitle = props.subTitle,
|
@@ -138,7 +138,7 @@ var Card = function Card(props) {
|
|
138
138
|
component: "img",
|
139
139
|
src: image
|
140
140
|
}), (title || extra) && /*#__PURE__*/React.createElement(BasicCard.Header, {
|
141
|
-
title: loading ? /*#__PURE__*/React.createElement(
|
141
|
+
title: loading ? /*#__PURE__*/React.createElement(ProSkeletonRaw.Card.Title, null) : title,
|
142
142
|
subTitle: !loading && subTitle,
|
143
143
|
extra: !loading && renderExtra(extra)
|
144
144
|
}), divider && /*#__PURE__*/React.createElement(BasicCard.Divider, null), /*#__PURE__*/React.createElement(BasicCard.Content, {
|
@@ -146,13 +146,18 @@ var Card = function Card(props) {
|
|
146
146
|
centered: centered
|
147
147
|
}),
|
148
148
|
style: contentStyle
|
149
|
-
}, loading && /*#__PURE__*/React.createElement(
|
149
|
+
}, loading && /*#__PURE__*/React.createElement(ProSkeletonRaw.Card.Content, null), !loading && children));
|
150
150
|
};
|
151
151
|
|
152
|
-
|
152
|
+
ProCard.defaultProps = {
|
153
153
|
bordered: true,
|
154
154
|
hoveredShadow: false
|
155
155
|
}; // @ts-ignore
|
156
156
|
|
157
|
-
|
158
|
-
export default
|
157
|
+
ProCard.isProCard = true;
|
158
|
+
export default ProCard;
|
159
|
+
/**
|
160
|
+
* @deprecated 建议使用 ProCardContainer 代替
|
161
|
+
*/
|
162
|
+
|
163
|
+
export var CardContainer = ProCardContainer;
|
@@ -1,79 +1,2 @@
|
|
1
|
-
|
2
|
-
declare const _default: React.ForwardRefExoticComponent<(Partial<import("@teamix/pro-field/lib/components/FieldText").IProFieldText & {
|
3
|
-
type: "text";
|
4
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldTextArea").IProFieldTextArea & {
|
5
|
-
type: "textarea";
|
6
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldMoney").IProFieldMoney & {
|
7
|
-
type: "money";
|
8
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldCheckBox").IProFieldCheckBox & {
|
9
|
-
type: "checkbox";
|
10
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldRadio").IProFieldRadio & {
|
11
|
-
type: "radio";
|
12
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldSelect").IProFieldSelect & {
|
13
|
-
type: "select";
|
14
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldMultipleSelect").IProFieldMultipleSelect & {
|
15
|
-
type: "multipleSelect";
|
16
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDate & {
|
17
|
-
type: "date";
|
18
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateWeek & {
|
19
|
-
type: "dateWeek";
|
20
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateMonth & {
|
21
|
-
type: "dateMonth";
|
22
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateYear & {
|
23
|
-
type: "dateYear";
|
24
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateQuarter & {
|
25
|
-
type: "dateQuarter";
|
26
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateRange & {
|
27
|
-
type: "dateRange";
|
28
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateWeekRange & {
|
29
|
-
type: "dateWeekRange";
|
30
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateMonthRange & {
|
31
|
-
type: "dateMonthRange";
|
32
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateYearRange & {
|
33
|
-
type: "dateYearRange";
|
34
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateQuarterRange & {
|
35
|
-
type: "dateQuarterRange";
|
36
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateTime & {
|
37
|
-
type: "dateTime";
|
38
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateTimeRange & {
|
39
|
-
type: "dateTimeRange";
|
40
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldTime & {
|
41
|
-
type: "time";
|
42
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldTimeRange & {
|
43
|
-
type: "timeRange";
|
44
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldNumber").IProFieldNumber & {
|
45
|
-
type: "number";
|
46
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldPercent").IProFieldPercent & {
|
47
|
-
type: "percent";
|
48
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldCascader & {
|
49
|
-
type: "cascader";
|
50
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldMultipleCascader & {
|
51
|
-
type: "multipleCascader";
|
52
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldArbitraryCascader & {
|
53
|
-
type: "arbitraryCascader";
|
54
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldSwitch").IProFieldSwitch & {
|
55
|
-
type: "switch";
|
56
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldColor").IProFieldColor & {
|
57
|
-
type: "color" | "colorSwatches" | "colorRadio" | "colorTwitter";
|
58
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldIcon").IProFieldIcon & {
|
59
|
-
type: "icon";
|
60
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldTreeSelect").IProFieldTreeSelect & {
|
61
|
-
type: "treeSelect";
|
62
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldJson").IProFieldJson & {
|
63
|
-
type: "json";
|
64
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldTransfer").IProFieldTransfer & {
|
65
|
-
type: "transfer";
|
66
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldRange").IProFieldRange & {
|
67
|
-
type: "range";
|
68
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldPassword").IProFieldPassword & {
|
69
|
-
type: "password";
|
70
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldSearch").IProFieldSearch & {
|
71
|
-
type: "search";
|
72
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldTagFilter").IProFieldTagFilter & {
|
73
|
-
type: "tagFilter";
|
74
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldTagFilter").IProFieldMultipleTagFilter & {
|
75
|
-
type: "multipleTagPicker";
|
76
|
-
}> | Partial<import("@teamix/pro-field/lib/components/FieldMenuSelect").IProFieldMenuSelect & {
|
77
|
-
type: "menuSelect";
|
78
|
-
}> | Pick<Partial<import("@teamix/pro-field").IProFieldCustom>, keyof import("@teamix/pro-field").IProFieldCustom>) & React.RefAttributes<unknown>>;
|
1
|
+
declare const _default: any;
|
79
2
|
export default _default;
|