@teamix/pro 1.1.33 → 1.1.37

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 (59) hide show
  1. package/dist/pro.css +1 -1
  2. package/dist/pro.js +435 -271
  3. package/dist/pro.min.css +1 -1
  4. package/dist/pro.min.js +1 -1
  5. package/es/actions/dialog-form.d.ts +8 -1
  6. package/es/actions/dialog-form.js +32 -15
  7. package/es/actions/dialog-info.d.ts +9 -0
  8. package/es/actions/dialog-info.js +23 -0
  9. package/es/actions/dialog.d.ts +2 -0
  10. package/es/actions/dialog.js +11 -4
  11. package/es/actions/drawer-info.d.ts +6 -0
  12. package/es/actions/drawer-info.js +7 -0
  13. package/es/actions/index.d.ts +11 -5
  14. package/es/actions/index.js +28 -12
  15. package/es/actions/index.scss +8 -0
  16. package/es/actions/link.js +4 -12
  17. package/es/form/SchemaForm/reactions.js +4 -2
  18. package/es/index.d.ts +1 -1
  19. package/es/index.js +1 -1
  20. package/es/info/components/InfoValueItem/index.js +108 -26
  21. package/es/info/components/baseInfo/index.d.ts +3 -1
  22. package/es/info/components/baseInfo/index.js +6 -33
  23. package/es/info/components/headerInfo/index.d.ts +3 -1
  24. package/es/info/components/headerInfo/index.js +8 -39
  25. package/es/info/components/tableInfo/index.js +4 -21
  26. package/es/info/index.js +47 -25
  27. package/es/info/index.scss +0 -4
  28. package/es/info/typing.d.ts +14 -5
  29. package/es/page-header/index.d.ts +9 -5
  30. package/es/page-header/index.js +22 -7
  31. package/es/table/index.js +3 -1
  32. package/lib/actions/dialog-form.d.ts +8 -1
  33. package/lib/actions/dialog-form.js +32 -15
  34. package/lib/actions/dialog-info.d.ts +9 -0
  35. package/lib/actions/dialog-info.js +37 -0
  36. package/lib/actions/dialog.d.ts +2 -0
  37. package/lib/actions/dialog.js +11 -4
  38. package/lib/actions/drawer-info.d.ts +6 -0
  39. package/lib/actions/drawer-info.js +18 -0
  40. package/lib/actions/index.d.ts +11 -5
  41. package/lib/actions/index.js +30 -12
  42. package/lib/actions/index.scss +8 -0
  43. package/lib/actions/link.js +5 -12
  44. package/lib/form/SchemaForm/reactions.js +4 -2
  45. package/lib/index.d.ts +1 -1
  46. package/lib/index.js +1 -1
  47. package/lib/info/components/InfoValueItem/index.js +107 -25
  48. package/lib/info/components/baseInfo/index.d.ts +3 -1
  49. package/lib/info/components/baseInfo/index.js +5 -40
  50. package/lib/info/components/headerInfo/index.d.ts +3 -1
  51. package/lib/info/components/headerInfo/index.js +7 -46
  52. package/lib/info/components/tableInfo/index.js +4 -22
  53. package/lib/info/index.js +49 -25
  54. package/lib/info/index.scss +0 -4
  55. package/lib/info/typing.d.ts +14 -5
  56. package/lib/page-header/index.d.ts +9 -5
  57. package/lib/page-header/index.js +22 -7
  58. package/lib/table/index.js +3 -1
  59. package/package.json +1 -1
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -9,9 +7,7 @@ exports.default = void 0;
9
7
 
10
8
  var _components = require("@alicloudfe/components");
11
9
 
12
- var _card = _interopRequireDefault(require("../../../card"));
13
-
14
- var _react = _interopRequireWildcard(require("react"));
10
+ var _react = _interopRequireDefault(require("react"));
15
11
 
16
12
  var _ProInfoItem = _interopRequireDefault(require("../ProInfoItem"));
17
13
 
@@ -19,51 +15,27 @@ require("./index.scss");
19
15
 
20
16
  var _layout = _interopRequireDefault(require("../../utils/layout"));
21
17
 
22
- var _hooks = require("@teamix/hooks");
23
-
24
18
  var _utils = require("../../utils/utils");
25
19
 
26
20
  var _InfoValueItem = _interopRequireDefault(require("../InfoValueItem"));
27
21
 
28
22
  var _utils2 = require("../../utils");
29
23
 
30
- var _excluded = ["header", "columns", "dataSource", "layout", "loading", "result", "actionRef", "className"];
31
-
32
- 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); }
33
-
34
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
-
36
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
25
 
38
- 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
-
40
- 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
-
42
- 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
-
44
- 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; }
45
-
46
- 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; }
47
-
48
26
  var Row = _components.Grid.Row,
49
27
  Col = _components.Grid.Col;
50
28
 
51
29
  var ProHeaderInfo = function ProHeaderInfo(props) {
52
30
  var _size$width;
53
31
 
54
- var header = props.header,
55
- columns = props.columns,
32
+ var columns = props.columns,
56
33
  dataSource = props.dataSource,
57
34
  layout = props.layout,
58
35
  loading = props.loading,
59
36
  result = props.result,
60
37
  actionRef = props.actionRef,
61
- className = props.className,
62
- others = _objectWithoutProperties(props, _excluded);
63
-
64
- var context = (0, _react.useContext)(_utils2.ProInfoGroupContext);
65
- var ref = (0, _react.useRef)();
66
- var size = context.visible ? context.size : (0, _hooks.useSize)(ref);
38
+ size = props.size;
67
39
 
68
40
  var defaultLayout = _layout.default[(0, _utils.getLayout)((_size$width = size === null || size === void 0 ? void 0 : size.width) !== null && _size$width !== void 0 ? _size$width : 0)];
69
41
 
@@ -105,21 +77,10 @@ var ProHeaderInfo = function ProHeaderInfo(props) {
105
77
  });
106
78
  };
107
79
 
108
- return (
109
- /*#__PURE__*/
110
- // TODO 优化透传方式
111
- _react.default.createElement("div", _objectSpread({
112
- ref: ref,
113
- className: "teamix-pro-info ".concat(className !== null && className !== void 0 ? className : '')
114
- }, others), (size === null || size === void 0 ? void 0 : size.width) && /*#__PURE__*/_react.default.createElement(_card.default, _objectSpread({
115
- compacted: true,
116
- hoveredShadow: false,
117
- bordered: false
118
- }, header), /*#__PURE__*/_react.default.createElement(Row, {
119
- wrap: true,
120
- className: "teamix-pro-info-content-row"
121
- }, renderContent())))
122
- );
80
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (size === null || size === void 0 ? void 0 : size.width) && /*#__PURE__*/_react.default.createElement(Row, {
81
+ wrap: true,
82
+ className: "teamix-pro-info-content-row"
83
+ }, renderContent()));
123
84
  };
124
85
 
125
86
  var _default = ProHeaderInfo;
@@ -13,8 +13,6 @@ require("./index.scss");
13
13
 
14
14
  var _components = require("@alicloudfe/components");
15
15
 
16
- var _card = _interopRequireDefault(require("../../../card"));
17
-
18
16
  var _utils = require("@teamix/utils");
19
17
 
20
18
  var _InfoValueItem = _interopRequireDefault(require("../InfoValueItem"));
@@ -23,8 +21,6 @@ var _2 = require("../../..");
23
21
 
24
22
  var _utils2 = require("../../utils");
25
23
 
26
- var _excluded = ["header", "columns", "dataSource", "layout", "loading", "result", "actionRef", "className"];
27
-
28
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
25
 
30
26
  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); }
@@ -49,22 +45,14 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
49
45
 
50
46
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
51
47
 
52
- 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; }
53
-
54
- 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; }
55
-
56
48
  var ProTableInfo = function ProTableInfo(props) {
57
- var header = props.header,
58
- columns = props.columns,
49
+ var columns = props.columns,
59
50
  dataSource = props.dataSource,
60
51
  _props$layout = props.layout,
61
52
  layout = _props$layout === void 0 ? {} : _props$layout,
62
53
  loading = props.loading,
63
54
  result = props.result,
64
- actionRef = props.actionRef,
65
- className = props.className,
66
- others = _objectWithoutProperties(props, _excluded);
67
-
55
+ actionRef = props.actionRef;
68
56
  var _layout$colNum = layout.colNum,
69
57
  colNum = _layout$colNum === void 0 ? 2 : _layout$colNum,
70
58
  _layout$labelGutter = layout.labelGutter,
@@ -194,20 +182,14 @@ var ProTableInfo = function ProTableInfo(props) {
194
182
  }
195
183
  };
196
184
 
197
- return /*#__PURE__*/_react.default.createElement("div", _objectSpread({
198
- className: "teamix-pro-info ".concat(className)
199
- }, others), /*#__PURE__*/_react.default.createElement(_card.default, _objectSpread({
200
- compacted: true,
201
- hoveredShadow: false,
202
- bordered: false
203
- }, header), /*#__PURE__*/_react.default.createElement(_components.Table.StickyLock, {
185
+ return /*#__PURE__*/_react.default.createElement(_components.Table.StickyLock, {
204
186
  className: "teamix-pro-info-table",
205
187
  cellProps: setCellProps,
206
188
  columns: newColumns(),
207
189
  hasHeader: false,
208
190
  hasBorder: true,
209
191
  dataSource: newDataSource
210
- })));
192
+ });
211
193
  };
212
194
 
213
195
  var _default = ProTableInfo;
package/lib/info/index.js CHANGED
@@ -24,6 +24,10 @@ var _utils = require("./utils");
24
24
 
25
25
  var _utils2 = require("@teamix/utils");
26
26
 
27
+ var _hooks = require("@teamix/hooks");
28
+
29
+ var _ = require("..");
30
+
27
31
  var _typing = require("./typing");
28
32
 
29
33
  Object.keys(_typing).forEach(function (key) {
@@ -37,7 +41,7 @@ Object.keys(_typing).forEach(function (key) {
37
41
  }
38
42
  });
39
43
  });
40
- var _excluded = ["type", "url", "method", "formatResult", "params", "actionRef", "header", "onError"];
44
+ var _excluded = ["type", "url", "method", "formatResult", "params", "actionRef", "header", "onError", "className", "style", "columns", "layout", "dataSource"];
41
45
 
42
46
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43
47
 
@@ -68,7 +72,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
68
72
  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; }
69
73
 
70
74
  var ProInfo = function ProInfo(props) {
71
- var type = props.type,
75
+ var _props$type = props.type,
76
+ type = _props$type === void 0 ? 'base' : _props$type,
72
77
  url = props.url,
73
78
  _props$method = props.method,
74
79
  method = _props$method === void 0 ? 'post' : _props$method,
@@ -78,15 +83,25 @@ var ProInfo = function ProInfo(props) {
78
83
  _props$header = props.header,
79
84
  header = _props$header === void 0 ? {} : _props$header,
80
85
  _onError = props.onError,
86
+ className = props.className,
87
+ style = props.style,
88
+ columns = props.columns,
89
+ layout = props.layout,
90
+ dataSource = props.dataSource,
81
91
  others = _objectWithoutProperties(props, _excluded);
82
92
 
83
93
  var _useContext = (0, _react.useContext)(_utils.ProInfoGroupContext),
84
94
  contextUrl = _useContext.url,
85
95
  contextMethod = _useContext.method,
86
96
  contextParams = _useContext.params,
87
- contextFormatResult = _useContext.formatResult; // 请求数据
97
+ contextFormatResult = _useContext.formatResult,
98
+ contextVisible = _useContext.visible,
99
+ contextSize = _useContext.size; // 获取容器宽度
88
100
 
89
101
 
102
+ var ref = (0, _react.useRef)();
103
+ var size = contextVisible ? contextSize : (0, _hooks.useSize)(ref); // 请求数据
104
+
90
105
  var _useState = (0, _react.useState)(false),
91
106
  _useState2 = _slicedToArray(_useState, 2),
92
107
  loading = _useState2[0],
@@ -149,31 +164,40 @@ var ProInfo = function ProInfo(props) {
149
164
  getData.run({});
150
165
  }
151
166
  });
152
-
153
- if (type === 'table') {
154
- return /*#__PURE__*/_react.default.createElement(_tableInfo.default, _objectSpread(_objectSpread({}, others), {}, {
155
- header: header,
156
- loading: loading || getData.loading,
157
- result: getDataSource(getData.data),
158
- actionRef: actionRef
159
- }));
160
- }
161
-
162
- if (type === 'header') {
163
- return /*#__PURE__*/_react.default.createElement(_headerInfo.default, _objectSpread(_objectSpread({}, others), {}, {
164
- header: header,
165
- loading: loading || getData.loading,
166
- result: getDataSource(getData.data),
167
- actionRef: actionRef
168
- }));
169
- }
170
-
171
- return /*#__PURE__*/_react.default.createElement(_baseInfo.default, _objectSpread(_objectSpread({}, others), {}, {
167
+ return /*#__PURE__*/_react.default.createElement("div", {
168
+ ref: ref,
169
+ className: "teamix-pro-info ".concat(className !== null && className !== void 0 ? className : ''),
170
+ style: style
171
+ }, /*#__PURE__*/_react.default.createElement(_.ProCard, _objectSpread(_objectSpread({
172
+ compacted: true,
173
+ hoveredShadow: false,
174
+ bordered: false,
175
+ backgroundColor: "transparent"
176
+ }, header), others), type === 'table' && /*#__PURE__*/_react.default.createElement(_tableInfo.default, {
177
+ dataSource: dataSource,
178
+ columns: columns,
179
+ loading: loading || getData.loading,
180
+ result: getDataSource(getData.data),
181
+ actionRef: actionRef,
182
+ layout: layout
183
+ }), type === 'header' && /*#__PURE__*/_react.default.createElement(_headerInfo.default, {
184
+ dataSource: dataSource,
185
+ columns: columns,
172
186
  header: header,
173
187
  loading: loading || getData.loading,
174
188
  result: getDataSource(getData.data),
175
- actionRef: actionRef
176
- }));
189
+ actionRef: actionRef,
190
+ layout: layout,
191
+ size: size
192
+ }), type === 'base' && /*#__PURE__*/_react.default.createElement(_baseInfo.default, {
193
+ dataSource: dataSource,
194
+ columns: columns,
195
+ loading: loading || getData.loading,
196
+ result: getDataSource(getData.data),
197
+ actionRef: actionRef,
198
+ layout: layout,
199
+ size: size
200
+ })));
177
201
  };
178
202
 
179
203
  ProInfo.Group = _InfoGroup.default;
@@ -1,10 +1,6 @@
1
1
  .teamix-pro-info {
2
2
  color: var(--color-brand1-6);
3
3
 
4
- .next-card {
5
- background: none;
6
- }
7
-
8
4
  .teamix-pro-info-content-row {
9
5
  width: 100%;
10
6
  }
@@ -3,6 +3,12 @@ import { ActionGroupProps, IActionButton } from '../actions';
3
3
  import { Method } from 'axios';
4
4
  import React from 'react';
5
5
  import { CardProps } from '../card';
6
+ /** 列record函数 */
7
+ declare type ProInfoCellFunProp = (value: any, record: any) => any;
8
+ declare type FieldRenderProps = keyof IProFieldFormatterProps;
9
+ declare type ProInfoCellRender = {
10
+ [key in FieldRenderProps]?: IProFieldFormatterProps[key] | ProInfoCellFunProp;
11
+ } | ((...other: any) => React.ReactNode);
6
12
  /** ProInfoBaseProps info 基础定义 */
7
13
  export declare type ProInfoBaseProps = {
8
14
  /** ProColums 定义,取代 Table 的 columns */
@@ -27,7 +33,7 @@ export declare type ProInfoBaseProps = {
27
33
  onError?: (error: Error) => void;
28
34
  /** ProInfo action 的引用,便于手动触发一些方法 */
29
35
  actionRef?: React.MutableRefObject<ProInfoActionType | undefined>;
30
- /** 标题区 */
36
+ /** 标题区 推荐将header中的内容平铺到ProCard中。即将不支持此写法 */
31
37
  header?: ProInfoHeaderProps;
32
38
  /** info 数据源 */
33
39
  dataSource?: {
@@ -35,7 +41,7 @@ export declare type ProInfoBaseProps = {
35
41
  };
36
42
  /** 布局值 */
37
43
  layout?: BaseInfoLayoutProps;
38
- };
44
+ } & ProInfoHeaderProps;
39
45
  /** ProInfoItemProps info 单元格 定义 */
40
46
  export interface ProInfoItemProps {
41
47
  /** 标题 */
@@ -49,9 +55,9 @@ export interface ProInfoItemProps {
49
55
  /** 对应 ProField 里面的 type */
50
56
  valueType?: IProFieldType;
51
57
  /** 渲染单元格内容字段 */
52
- render?: IProFieldFormatterProps | ((...other: any) => React.ReactNode);
58
+ render?: ProInfoCellRender;
53
59
  /** 枚举值 */
54
- dataSource?: IProFieldOptionItem[];
60
+ dataSource?: IProFieldOptionItem[] | ProInfoCellFunProp;
55
61
  /** 表头的筛选菜单项,当值为 true 时,自动使用 dataSource 生成 */
56
62
  filters?: boolean;
57
63
  /** 操作组配置 */
@@ -138,7 +144,9 @@ export declare type InfoValueItemProps = {
138
144
  infoItem: ProInfoItemProps;
139
145
  record: any;
140
146
  actionRef?: React.MutableRefObject<ProInfoActionType | undefined>;
141
- } & IProFieldProps;
147
+ render?: ProInfoCellRender;
148
+ dataSource?: IProFieldOptionItem[] | ProInfoCellFunProp;
149
+ } & Omit<IProFieldProps, 'render' | 'dataSource'>;
142
150
  export declare type ProInfoHeaderProps = CardProps;
143
151
  /** ProInfoGroupContextProps */
144
152
  export declare type ProInfoGroupContextProps = {
@@ -173,3 +181,4 @@ export declare type ProInfoTransparentBase = {
173
181
  /** style */
174
182
  style?: React.CSSProperties;
175
183
  };
184
+ export {};
@@ -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;
@@ -25,7 +25,8 @@ var _info = _interopRequireDefault(require("../info"));
25
25
 
26
26
  require("./index.scss");
27
27
 
28
- var _excluded = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
28
+ var _excluded = ["text", "children", "closable"],
29
+ _excluded2 = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
29
30
 
30
31
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
32
 
@@ -85,15 +86,29 @@ var renderTags = function renderTags(tags) {
85
86
  return /*#__PURE__*/_react.default.createElement(_components.Tag.Group, {
86
87
  className: cls('tags')
87
88
  }, tags.map(function (tag, i) {
88
- return /*#__PURE__*/_react.default.createElement(_components.Tag, {
89
+ // @ts-ignore
90
+ var text = tag.text,
91
+ children = tag.children,
92
+ closable = tag.closable,
93
+ others = _objectWithoutProperties(tag, _excluded);
94
+
95
+ if (closable) {
96
+ return /*#__PURE__*/_react.default.createElement(_components.Tag.Closeable, _objectSpread({
97
+ key: i,
98
+ size: "large",
99
+ style: {
100
+ marginBottom: 0
101
+ }
102
+ }, others), text || children);
103
+ }
104
+
105
+ return /*#__PURE__*/_react.default.createElement(_components.Tag, _objectSpread({
89
106
  key: i,
90
107
  size: "large",
91
- type: tag.type,
92
- color: tag.color,
93
108
  style: {
94
109
  marginBottom: 0
95
110
  }
96
- }, tag.text);
111
+ }, others), text || children);
97
112
  }));
98
113
  };
99
114
 
@@ -111,7 +126,7 @@ var getColorAndStyle = function getColorAndStyle(color, backgroundColor, backgro
111
126
 
112
127
  var isColorPresetColor = isPresetColor(color);
113
128
  var isBgColorPresetColor = isPresetColor(backgroundColor);
114
- var className = (0, _classnames2.default)((_classnames = {}, _defineProperty(_classnames, "".concat(cls("color-".concat(color))), isColorPresetColor), _defineProperty(_classnames, "".concat(cls("color-bg-".concat(color))), isBgColorPresetColor), _defineProperty(_classnames, "".concat(cls("bg-type-".concat(backgroundType))), !!backgroundType), _classnames));
129
+ var className = (0, _classnames2.default)((_classnames = {}, _defineProperty(_classnames, "".concat(cls("color-".concat(color))), isColorPresetColor), _defineProperty(_classnames, "".concat(cls("bg-color-".concat(backgroundColor))), isBgColorPresetColor), _defineProperty(_classnames, "".concat(cls("bg-type-".concat(backgroundType))), !!backgroundType), _classnames));
115
130
  var styleColor = isColorPresetColor ? undefined : color;
116
131
  var styleBgColor = isBgColorPresetColor ? undefined : backgroundColor;
117
132
  var style = {
@@ -178,7 +193,7 @@ var PageHeader = function PageHeader(props) {
178
193
  children = props.children,
179
194
  className = props.className,
180
195
  style = props.style,
181
- others = _objectWithoutProperties(props, _excluded);
196
+ others = _objectWithoutProperties(props, _excluded2);
182
197
 
183
198
  var history = (0, _reactRouterDom.useHistory)();
184
199
  var backgroundImage = image ? "url('".concat(image, "')") : undefined;
@@ -666,10 +666,12 @@ var ProTable = function ProTable(props) {
666
666
  }
667
667
 
668
668
  function onChangePaginationSize(currentPageSize) {
669
+ var _request5;
670
+
669
671
  setPageSize(currentPageSize);
670
672
  setCurrentPage(1);
671
673
 
672
- _request(_defineProperty({}, targetPageSizeKey, currentPageSize));
674
+ _request((_request5 = {}, _defineProperty(_request5, targetPageSizeKey, currentPageSize), _defineProperty(_request5, targetPageKey, 1), _request5));
673
675
  }
674
676
 
675
677
  function renderRowSelection() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.1.33",
3
+ "version": "1.1.37",
4
4
  "description": "TeamixPro大包",
5
5
  "repository": "http://gitlab.alibaba-inc.com/teamix/pro",
6
6
  "author": "Velociraptor(迅猛龙)",