@teamix/pro 1.1.35 → 1.1.39

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.
Files changed (43) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +956 -333
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/es/actions/dialog.d.ts +9 -0
  6. package/es/actions/dialog.js +96 -26
  7. package/es/actions/index.scss +31 -0
  8. package/es/actions/link.js +4 -2
  9. package/es/actions/request.d.ts +1 -1
  10. package/es/actions/request.js +2 -2
  11. package/es/form/Components/ProField/index.d.ts +1 -84
  12. package/es/form/typing.d.ts +5 -5
  13. package/es/index.d.ts +1 -1
  14. package/es/index.js +1 -1
  15. package/es/info/components/InfoValueItem/index.js +3 -0
  16. package/es/info/components/baseInfo/index.js +29 -10
  17. package/es/info/index.js +31 -10
  18. package/es/info/typing.d.ts +3 -1
  19. package/es/page-header/index.d.ts +9 -5
  20. package/es/page-header/index.js +21 -6
  21. package/es/table/components/Filter/index.js +7 -2
  22. package/es/table/components/Filter/index.scss +1 -1
  23. package/es/table/typing.d.ts +2 -0
  24. package/lib/actions/dialog.d.ts +9 -0
  25. package/lib/actions/dialog.js +99 -25
  26. package/lib/actions/index.scss +31 -0
  27. package/lib/actions/link.js +5 -2
  28. package/lib/actions/request.d.ts +1 -1
  29. package/lib/actions/request.js +2 -2
  30. package/lib/form/Components/ProField/index.d.ts +1 -84
  31. package/lib/form/typing.d.ts +5 -5
  32. package/lib/index.d.ts +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/info/components/InfoValueItem/index.js +3 -0
  35. package/lib/info/components/baseInfo/index.js +29 -10
  36. package/lib/info/index.js +32 -11
  37. package/lib/info/typing.d.ts +3 -1
  38. package/lib/page-header/index.d.ts +9 -5
  39. package/lib/page-header/index.js +21 -6
  40. package/lib/table/components/Filter/index.js +7 -2
  41. package/lib/table/components/Filter/index.scss +1 -1
  42. package/lib/table/typing.d.ts +2 -0
  43. package/package.json +1 -1
package/es/info/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var _excluded = ["type", "url", "method", "formatResult", "params", "actionRef", "header", "onError", "className", "style", "columns", "layout", "dataSource"];
1
+ var _excluded = ["type", "url", "method", "formatResult", "params", "actionRef", "header", "onError", "className", "style", "columns", "layout", "dataSource", "loading", "extra"];
2
2
 
3
3
  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; }
4
4
 
@@ -22,10 +22,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
22
22
 
23
23
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
24
24
 
25
- import React, { useContext, useEffect, useRef, useState } from 'react';
26
- import ProTableInfo from './components/TableInfo';
27
- import ProHeaderInfo from './components/HeaderInfo';
28
- import ProBaseInfo from './components/BaseInfo';
25
+ import React, { isValidElement, useContext, useEffect, useRef, useState } from 'react';
26
+ import ProTableInfo from './components/tableInfo';
27
+ import ProHeaderInfo from './components/headerInfo';
28
+ import ProBaseInfo from './components/baseInfo';
29
29
  import ProInfoGroup from './components/InfoGroup';
30
30
  import './index.scss';
31
31
  import { ProInfoGroupContext, useActionType } from './utils';
@@ -51,6 +51,8 @@ var ProInfo = function ProInfo(props) {
51
51
  columns = props.columns,
52
52
  layout = props.layout,
53
53
  dataSource = props.dataSource,
54
+ userLoading = props.loading,
55
+ extra = props.extra,
54
56
  others = _objectWithoutProperties(props, _excluded);
55
57
 
56
58
  var _useContext = useContext(ProInfoGroupContext),
@@ -127,19 +129,38 @@ var ProInfo = function ProInfo(props) {
127
129
  getData.run({});
128
130
  }
129
131
  });
132
+
133
+ var getExtra = function getExtra() {
134
+ if (!extra) {
135
+ return undefined;
136
+ }
137
+
138
+ if ( /*#__PURE__*/isValidElement(extra)) {
139
+ return extra;
140
+ }
141
+
142
+ return _objectSpread(_objectSpread({}, extra), {}, {
143
+ context: {
144
+ record: dataSource !== null && dataSource !== void 0 ? dataSource : getDataSource(getData.data)
145
+ }
146
+ });
147
+ };
148
+
130
149
  return /*#__PURE__*/React.createElement("div", {
131
150
  ref: ref,
132
151
  className: "teamix-pro-info ".concat(className !== null && className !== void 0 ? className : ''),
133
152
  style: style
134
- }, /*#__PURE__*/React.createElement(ProCard, _objectSpread(_objectSpread({
153
+ }, /*#__PURE__*/React.createElement(ProCard, _objectSpread(_objectSpread(_objectSpread({
135
154
  compacted: true,
136
155
  hoveredShadow: false,
137
156
  bordered: false,
138
157
  backgroundColor: "transparent"
139
- }, header), others), type === 'table' && /*#__PURE__*/React.createElement(ProTableInfo, {
158
+ }, header), others), {}, {
159
+ extra: getExtra()
160
+ }), type === 'table' && /*#__PURE__*/React.createElement(ProTableInfo, {
140
161
  dataSource: dataSource,
141
162
  columns: columns,
142
- loading: loading || getData.loading,
163
+ loading: userLoading || loading || getData.loading,
143
164
  result: getDataSource(getData.data),
144
165
  actionRef: actionRef,
145
166
  layout: layout
@@ -147,7 +168,7 @@ var ProInfo = function ProInfo(props) {
147
168
  dataSource: dataSource,
148
169
  columns: columns,
149
170
  header: header,
150
- loading: loading || getData.loading,
171
+ loading: userLoading || loading || getData.loading,
151
172
  result: getDataSource(getData.data),
152
173
  actionRef: actionRef,
153
174
  layout: layout,
@@ -155,7 +176,7 @@ var ProInfo = function ProInfo(props) {
155
176
  }), type === 'base' && /*#__PURE__*/React.createElement(ProBaseInfo, {
156
177
  dataSource: dataSource,
157
178
  columns: columns,
158
- loading: loading || getData.loading,
179
+ loading: userLoading || loading || getData.loading,
159
180
  result: getDataSource(getData.data),
160
181
  actionRef: actionRef,
161
182
  layout: layout,
@@ -41,6 +41,8 @@ export declare type ProInfoBaseProps = {
41
41
  };
42
42
  /** 布局值 */
43
43
  layout?: BaseInfoLayoutProps;
44
+ /** 加载动画 */
45
+ loading?: boolean;
44
46
  } & ProInfoHeaderProps;
45
47
  /** ProInfoItemProps info 单元格 定义 */
46
48
  export interface ProInfoItemProps {
@@ -147,7 +149,7 @@ export declare type InfoValueItemProps = {
147
149
  render?: ProInfoCellRender;
148
150
  dataSource?: IProFieldOptionItem[] | ProInfoCellFunProp;
149
151
  } & Omit<IProFieldProps, 'render' | 'dataSource'>;
150
- export declare type ProInfoHeaderProps = CardProps;
152
+ export declare type ProInfoHeaderProps = Omit<CardProps, 'loading'>;
151
153
  /** ProInfoGroupContextProps */
152
154
  export declare type ProInfoGroupContextProps = {
153
155
  /** 因为其他数据都为异步。visible 只用作标识 */
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { TagProps, CloseableProps } from '@alicloudfe/components/types/tag';
2
3
  import { ActionGroupProps } from '../actions';
3
4
  import { ProInfoProps } from '../info';
4
5
  import './index.scss';
@@ -12,11 +13,14 @@ export interface LinkItem {
12
13
  text: string;
13
14
  onClick?: (e?: React.MouseEvent<Element, MouseEvent>) => void;
14
15
  }
15
- export interface TagItem {
16
- type?: 'normal' | 'primary';
17
- color?: string;
18
- text: string;
19
- }
16
+ export declare type TagItem = (TagProps | (CloseableProps & {
17
+ closable: true;
18
+ })) & {
19
+ /**
20
+ * @deprecated 建议使用 children 代替
21
+ */
22
+ text?: string;
23
+ };
20
24
  declare type Color = 'blue' | 'green' | 'orange' | 'red' | 'yellow' | string;
21
25
  export interface DataItem {
22
26
  title: string;
@@ -1,4 +1,5 @@
1
- var _excluded = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
1
+ var _excluded = ["text", "children", "closable"],
2
+ _excluded2 = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
2
3
 
3
4
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
5
 
@@ -66,15 +67,29 @@ var renderTags = function renderTags(tags) {
66
67
  return /*#__PURE__*/React.createElement(Tag.Group, {
67
68
  className: cls('tags')
68
69
  }, tags.map(function (tag, i) {
69
- return /*#__PURE__*/React.createElement(Tag, {
70
+ // @ts-ignore
71
+ var text = tag.text,
72
+ children = tag.children,
73
+ closable = tag.closable,
74
+ others = _objectWithoutProperties(tag, _excluded);
75
+
76
+ if (closable) {
77
+ return /*#__PURE__*/React.createElement(Tag.Closeable, _objectSpread({
78
+ key: i,
79
+ size: "large",
80
+ style: {
81
+ marginBottom: 0
82
+ }
83
+ }, others), text || children);
84
+ }
85
+
86
+ return /*#__PURE__*/React.createElement(Tag, _objectSpread({
70
87
  key: i,
71
88
  size: "large",
72
- type: tag.type,
73
- color: tag.color,
74
89
  style: {
75
90
  marginBottom: 0
76
91
  }
77
- }, tag.text);
92
+ }, others), text || children);
78
93
  }));
79
94
  };
80
95
 
@@ -159,7 +174,7 @@ var PageHeader = function PageHeader(props) {
159
174
  children = props.children,
160
175
  className = props.className,
161
176
  style = props.style,
162
- others = _objectWithoutProperties(props, _excluded);
177
+ others = _objectWithoutProperties(props, _excluded2);
163
178
 
164
179
  var history = useHistory();
165
180
  var backgroundImage = image ? "url('".concat(image, "')") : undefined;
@@ -35,7 +35,9 @@ var RadioItem = Menu.RadioItem;
35
35
 
36
36
  var Filter = function Filter(props) {
37
37
  var column = props.column,
38
- actionRef = props.actionRef; // 选中过滤项
38
+ actionRef = props.actionRef;
39
+ var _column$filtersWidth = column.filtersWidth,
40
+ filtersWidth = _column$filtersWidth === void 0 ? 130 : _column$filtersWidth; // 选中过滤项
39
41
 
40
42
  var _useState = useState([]),
41
43
  _useState2 = _slicedToArray(_useState, 2),
@@ -154,7 +156,10 @@ var Filter = function Filter(props) {
154
156
  return setVisible(false);
155
157
  }
156
158
  }, /*#__PURE__*/React.createElement("div", {
157
- className: cls()
159
+ className: cls(),
160
+ style: {
161
+ width: filtersWidth
162
+ }
158
163
  }, /*#__PURE__*/React.createElement(Menu, null, renderSelect(), /*#__PURE__*/React.createElement("div", {
159
164
  className: cls({
160
165
  'btn-box': true
@@ -1,5 +1,5 @@
1
1
  .teamix-pro-table-toolbar-filter {
2
- width: 130px;
2
+ min-width: 130px;
3
3
  max-height: 350px;
4
4
  overflow-y: auto;
5
5
  box-shadow: var(--popup-local-shadow, 0px 6px 24px 0px rgba(0, 0, 0, 0.1));
@@ -47,6 +47,8 @@ export declare type ProColumnProps = {
47
47
  filtersMode?: 'single' | 'multiple';
48
48
  /** 表头的过滤菜单项在搜索之前的参数操作 */
49
49
  beforeFilter?: (rules: string[]) => string;
50
+ /** 表头的过滤菜单宽度 */
51
+ filtersWidth?: string | number;
50
52
  /** 操作组配置 */
51
53
  actionSchema?: ActionGroupProps;
52
54
  /** 指定列对应的字段,支持`a.b`形式的快速取值 和 数组取值 */
@@ -1,14 +1,23 @@
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 { IFormSchema, IFormSchemaItem } from '../form';
4
5
  import { RequestAction } from './request';
5
6
  export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShowConfig, 'onError' | 'type'>, Omit<quickShowDrawerProps, 'trigger' | 'animation' | 'height' | 'locale' | 'onOk' | 'onCancel' | 'onError'> {
7
+ /** 点击「确认按钮」后的数据请求地址,非必填,不填就不发请求 */
6
8
  url?: string;
9
+ /** 弹窗类型,支持普通弹窗和抽屉两种模式,默认为普通弹窗 */
7
10
  dialogType?: 'dialog' | 'drawer';
11
+ /** 弹窗快捷调用类型 */
8
12
  dialogQuickShowType?: 'alert' | 'confirm';
13
+ /** 弹窗消息类型 */
9
14
  messageType?: 'success' | 'warning' | 'error' | 'notice' | 'help' | 'loading';
15
+ /** 位于弹窗内容上方的自定义内容区 */
10
16
  beforeContent?: React.ReactNode;
17
+ /** 位于弹窗内容下方的自定义内容区 */
11
18
  afterContent?: React.ReactNode;
19
+ /** 弹窗页脚描述区,位于按钮组的对面 */
20
+ footerDescription?: React.ReactNode | IFormSchema | IFormSchemaItem;
12
21
  }
13
22
  export declare function useDialogAction(action: DialogAction, context?: any): {
14
23
  [x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
@@ -10,18 +10,25 @@ exports.useDialogAction = useDialogAction;
10
10
 
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
 
13
+ var _classnames = _interopRequireDefault(require("classnames"));
14
+
13
15
  var _reactRouterDom = require("react-router-dom");
14
16
 
15
17
  var _components = require("@alicloudfe/components");
16
18
 
17
19
  var _utils = require("@teamix/utils");
18
20
 
21
+ var _form = _interopRequireWildcard(require("../form"));
22
+
19
23
  var _base = require("./base");
20
24
 
21
25
  var _request = require("./request");
22
26
 
23
27
  var _excluded = ["url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
24
- _excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent"];
28
+ _excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "footerDescription", "footerAlign", "overlayProps"],
29
+ _excluded3 = ["className"];
30
+
31
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
32
 
26
33
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
34
 
@@ -31,16 +38,16 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
31
38
 
32
39
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
33
40
 
34
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
35
-
36
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
37
-
38
41
  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; }
39
42
 
40
43
  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; }
41
44
 
42
45
  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; }
43
46
 
47
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
48
+
49
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
50
+
44
51
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
45
52
 
46
53
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -59,6 +66,27 @@ function addContextForReactNode(content, context) {
59
66
  }
60
67
 
61
68
  return content;
69
+ }
70
+
71
+ var FooterForm = function FooterForm(props) {
72
+ var schema = props.schema,
73
+ context = props.context,
74
+ formRef = props.formRef;
75
+ var form = (0, _form.createForm)();
76
+ (0, _react.useEffect)(function () {
77
+ formRef.current = form;
78
+ }, []);
79
+ return /*#__PURE__*/_react.default.createElement(_form.default, {
80
+ layout: "inline",
81
+ feedbackLayout: "none",
82
+ form: form,
83
+ schema: (0, _utils.getTargetValue)(schema, context)
84
+ });
85
+ };
86
+
87
+ function getFooterAlignClass(isDrawer, align) {
88
+ var footerAlign = align ? align : isDrawer ? 'left' : 'right';
89
+ return "footer-align-".concat(footerAlign);
62
90
  } // 弹窗 -> 请求(点击确认,发送数据请求)
63
91
 
64
92
 
@@ -68,8 +96,10 @@ function useDialogAction(action, context) {
68
96
  loading = _useState2[0],
69
97
  setLoading = _useState2[1];
70
98
 
99
+ var footerDescriptionRef = (0, _react.useRef)();
71
100
  var history = (0, _reactRouterDom.useHistory)();
72
- return _objectSpread({}, (0, _base.eventHandler)(action, function () {
101
+
102
+ var onActionStart = function onActionStart() {
73
103
  var url = action.url,
74
104
  method = action.method,
75
105
  params = action.params,
@@ -98,19 +128,54 @@ function useDialogAction(action, context) {
98
128
  link = _getTargetValue.link,
99
129
  beforeContent = _getTargetValue.beforeContent,
100
130
  afterContent = _getTargetValue.afterContent,
101
- dialogOtherProps = _objectWithoutProperties(_getTargetValue, _excluded2);
131
+ footerDescription = _getTargetValue.footerDescription,
132
+ footerAlign = _getTargetValue.footerAlign,
133
+ _getTargetValue$overl = _getTargetValue.overlayProps,
134
+ overlayProps = _getTargetValue$overl === void 0 ? {} : _getTargetValue$overl,
135
+ containerProps = _objectWithoutProperties(_getTargetValue, _excluded2);
136
+
137
+ var isDrawer = dialogType === 'drawer';
138
+ var container = isDrawer ? _components.Drawer : _components.Dialog;
139
+
140
+ var overlayClassName = overlayProps.className,
141
+ overlayOtherProps = _objectWithoutProperties(overlayProps, _excluded3);
102
142
 
103
- var dialogMethod = dialogType === 'drawer' ? _components.Drawer : _components.Dialog;
104
- var dialogProps = dialogType === 'drawer' ? {} : {
143
+ var dialogOnlyProps = {
105
144
  type: dialogQuickShowType,
106
145
  messageProps: {
107
146
  type: messageType
147
+ },
148
+ overlayProps: _objectSpread({
149
+ className: (0, _classnames.default)('teamix-pro-action-dialog', overlayClassName, {
150
+ 'has-footer-description': !!footerDescription
151
+ })
152
+ }, overlayOtherProps)
153
+ };
154
+ var containerOtherProps = isDrawer ? {} : dialogOnlyProps;
155
+
156
+ var renderDialogFooterDescription = function renderDialogFooterDescription(footer) {
157
+ if (footer instanceof Array || footer.component) {
158
+ var _schema = footer instanceof Array ? footer : [footer];
159
+
160
+ return /*#__PURE__*/_react.default.createElement(FooterForm, {
161
+ formRef: footerDescriptionRef,
162
+ context: context,
163
+ schema: [{
164
+ component: 'FormFlex',
165
+ children: _schema
166
+ }]
167
+ });
108
168
  }
169
+
170
+ return footer;
109
171
  };
110
172
 
111
173
  var onOk = function onOk() {
112
174
  return new Promise( /*#__PURE__*/function () {
113
175
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve) {
176
+ var _footerDescriptionRef;
177
+
178
+ var footerDescriptionValues, requestContext;
114
179
  return regeneratorRuntime.wrap(function _callee$(_context) {
115
180
  while (1) {
116
181
  switch (_context.prev = _context.next) {
@@ -130,29 +195,33 @@ function useDialogAction(action, context) {
130
195
 
131
196
  case 5:
132
197
  setLoading(true);
133
- _context.prev = 6;
134
- _context.next = 9;
135
- return (0, _request.doRequest)(action, context, history);
136
-
137
- case 9:
198
+ footerDescriptionValues = Object.assign({}, footerDescriptionRef === null || footerDescriptionRef === void 0 ? void 0 : (_footerDescriptionRef = footerDescriptionRef.current) === null || _footerDescriptionRef === void 0 ? void 0 : _footerDescriptionRef.values);
199
+ _context.prev = 7;
200
+ requestContext = Object.assign({
201
+ footer: footerDescriptionValues
202
+ }, context);
203
+ _context.next = 11;
204
+ return (0, _request.doRequest)(action, requestContext, history, footerDescriptionValues);
205
+
206
+ case 11:
138
207
  onFinish && onFinish();
139
208
  resolve(true);
140
- _context.next = 18;
209
+ _context.next = 20;
141
210
  break;
142
211
 
143
- case 13:
144
- _context.prev = 13;
145
- _context.t0 = _context["catch"](6);
212
+ case 15:
213
+ _context.prev = 15;
214
+ _context.t0 = _context["catch"](7);
146
215
  setLoading(false);
147
216
  resolve(false);
148
217
  return _context.abrupt("return");
149
218
 
150
- case 18:
219
+ case 20:
151
220
  case "end":
152
221
  return _context.stop();
153
222
  }
154
223
  }
155
- }, _callee, null, [[6, 13]]);
224
+ }, _callee, null, [[7, 15]]);
156
225
  }));
157
226
 
158
227
  return function (_x) {
@@ -176,7 +245,7 @@ function useDialogAction(action, context) {
176
245
  var dialogContent = Component ? /*#__PURE__*/_react.default.createElement(Component, _objectSpread({
177
246
  key: (0, _utils.uuid)()
178
247
  }, componentProps)) : addContextForReactNode(content, dialogContext);
179
- var ret = dialogMethod.show(_objectSpread(_objectSpread({
248
+ var ret = container.show(_objectSpread(_objectSpread({
180
249
  // @ts-ignore
181
250
  onOk: onOk,
182
251
  title: addContextForReactNode(title, dialogContext),
@@ -184,11 +253,16 @@ function useDialogAction(action, context) {
184
253
  className: "teamix-pro-dialog-before-content"
185
254
  }, beforeContent), dialogContent, afterContent && /*#__PURE__*/_react.default.createElement("div", {
186
255
  className: "teamix-pro-dialog-after-content"
187
- }, afterContent)),
188
- closeable: !loading
189
- }, dialogProps), dialogOtherProps));
256
+ }, afterContent), footerDescription && /*#__PURE__*/_react.default.createElement("div", {
257
+ className: (0, _classnames.default)('teamix-pro-dialog-footer-description', getFooterAlignClass(isDrawer, footerAlign))
258
+ }, renderDialogFooterDescription(footerDescription))),
259
+ closeable: !loading,
260
+ footerAlign: footerAlign
261
+ }, containerOtherProps), containerProps));
190
262
  store.hide = ret.hide;
191
- }));
263
+ };
264
+
265
+ return _objectSpread({}, (0, _base.eventHandler)(action, onActionStart));
192
266
  }
193
267
 
194
268
  var _default = useDialogAction;
@@ -29,6 +29,31 @@
29
29
  }
30
30
  }
31
31
 
32
+ .teamix-pro-dialog-footer-description {
33
+ position: absolute;
34
+ z-index: 5;
35
+ display: flex;
36
+ align-items: center;
37
+ bottom: var(--dialog-footer-padding-top, 16px);
38
+ height: var(--btn-size-m-height, 32px);
39
+
40
+ &.footer-align-right {
41
+ left: var(--dialog-footer-padding-left-right, 20px);
42
+ }
43
+ &.footer-align-center {
44
+ left: var(--dialog-footer-padding-left-right, 20px);
45
+ }
46
+ &.footer-align-left {
47
+ right: var(--dialog-footer-padding-left-right, 20px);
48
+ }
49
+ }
50
+
51
+ .teamix-pro-action-dialog.has-footer-description {
52
+ .next-message {
53
+ position: static;
54
+ }
55
+ }
56
+
32
57
  .teamix-pro-dialog-before-content {
33
58
  margin-bottom: var(--s-2);
34
59
  }
@@ -40,3 +65,9 @@
40
65
  .next-menu-divider + .next-menu-divider {
41
66
  display: none;
42
67
  }
68
+
69
+ .next-dialog-body {
70
+ .teamix-pro-form {
71
+ margin-bottom: -20px;
72
+ }
73
+ }
@@ -8,6 +8,8 @@ exports.useLinkAction = useLinkAction;
8
8
 
9
9
  var _utils = require("@teamix/utils");
10
10
 
11
+ var _reactRouterDom = require("react-router-dom");
12
+
11
13
  var _base = require("./base");
12
14
 
13
15
  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; }
@@ -17,9 +19,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
17
19
  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; }
18
20
 
19
21
  function useLinkAction(action, context) {
20
- var linkAction = (0, _utils.getTargetValue)(action, context);
22
+ var history = (0, _reactRouterDom.useHistory)();
21
23
  return _objectSpread({}, (0, _base.eventHandler)(action, function () {
22
- (0, _utils.goToLink)(linkAction);
24
+ var linkAction = (0, _utils.getTargetValue)(action, context);
25
+ (0, _utils.goToLink)(linkAction, history);
23
26
  }));
24
27
  }
25
28
 
@@ -2,7 +2,7 @@ import { CommonRequestConfig } from '@teamix/utils';
2
2
  import { BaseAction } from './base';
3
3
  export interface RequestAction extends CommonRequestConfig, BaseAction {
4
4
  }
5
- export declare function doRequest(action: RequestAction, context?: any, history?: any): Promise<unknown>;
5
+ export declare function doRequest(action: RequestAction, context?: any, history?: any, extraParams?: any): Promise<unknown>;
6
6
  export declare function useRequestAction(action: RequestAction, context?: any): {
7
7
  loading: boolean;
8
8
  };
@@ -41,14 +41,14 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
41
41
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
42
42
 
43
43
  // action 里的数据请求都默认是 post 类型
44
- function doRequest(action, context, history) {
44
+ function doRequest(action, context, history, extraParams) {
45
45
  var _action$method = action.method,
46
46
  method = _action$method === void 0 ? 'post' : _action$method,
47
47
  others = _objectWithoutProperties(action, _excluded);
48
48
 
49
49
  return (0, _utils.doCommonRequest)(_objectSpread({
50
50
  method: method
51
- }, others), context, history);
51
+ }, others), context, history, extraParams);
52
52
  }
53
53
 
54
54
  function useRequestAction(action, context) {