@teamix/pro 1.2.10 → 1.2.11
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/dist/212.js +1 -1
- package/dist/pro.css +1 -1
- package/dist/pro.js +454 -366
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/base.d.ts +16 -6
- package/es/actions/base.js +66 -12
- package/es/actions/confirm.d.ts +1 -1
- package/es/actions/danger-confirm.d.ts +1 -1
- package/es/actions/dialog-component.d.ts +1 -1
- package/es/actions/dialog-form.d.ts +1 -1
- package/es/actions/dialog-form.js +2 -2
- package/es/actions/dialog-info.d.ts +1 -1
- package/es/actions/dialog-table.d.ts +1 -1
- package/es/actions/dialog.d.ts +6 -2
- package/es/actions/dialog.js +3 -3
- package/es/actions/drawer-form.d.ts +1 -1
- package/es/actions/drawer-info.d.ts +1 -1
- package/es/actions/drawer-table.d.ts +1 -1
- package/es/actions/drawer.d.ts +1 -1
- package/es/actions/error.d.ts +1 -1
- package/es/actions/link.d.ts +2 -2
- package/es/actions/link.js +2 -2
- package/es/actions/notice.d.ts +1 -1
- package/es/actions/request.d.ts +1 -1
- package/es/actions/request.js +2 -2
- package/es/card/index.d.ts +10 -1
- package/es/card/index.js +20 -5
- package/es/card/index.scss +19 -0
- package/es/card/tab.d.ts +6 -0
- package/es/card/tab.js +27 -0
- package/es/form/ProForm/index.js +3 -23
- package/es/form/SchemaForm/index.js +7 -6
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/page-header/index.d.ts +20 -11
- package/es/page-header/index.js +23 -47
- package/es/page-header/index.scss +0 -11
- package/es/table/components/Filter/index.js +3 -3
- package/es/table/index.js +1 -1
- package/es/utils/components/tags/index.d.ts +11 -0
- package/es/utils/components/tags/index.js +50 -0
- package/es/utils/components/tags/index.scss +12 -0
- package/lib/actions/base.d.ts +16 -6
- package/lib/actions/base.js +67 -12
- package/lib/actions/confirm.d.ts +1 -1
- package/lib/actions/danger-confirm.d.ts +1 -1
- package/lib/actions/dialog-component.d.ts +1 -1
- package/lib/actions/dialog-form.d.ts +1 -1
- package/lib/actions/dialog-form.js +2 -2
- package/lib/actions/dialog-info.d.ts +1 -1
- package/lib/actions/dialog-table.d.ts +1 -1
- package/lib/actions/dialog.d.ts +6 -2
- package/lib/actions/dialog.js +3 -3
- package/lib/actions/drawer-form.d.ts +1 -1
- package/lib/actions/drawer-info.d.ts +1 -1
- package/lib/actions/drawer-table.d.ts +1 -1
- package/lib/actions/drawer.d.ts +1 -1
- package/lib/actions/error.d.ts +1 -1
- package/lib/actions/link.d.ts +2 -2
- package/lib/actions/link.js +2 -2
- package/lib/actions/notice.d.ts +1 -1
- package/lib/actions/request.d.ts +1 -1
- package/lib/actions/request.js +2 -2
- package/lib/card/index.d.ts +10 -1
- package/lib/card/index.js +22 -4
- package/lib/card/index.scss +19 -0
- package/lib/card/tab.d.ts +6 -0
- package/lib/card/tab.js +39 -0
- package/lib/form/ProForm/index.js +3 -23
- package/lib/form/SchemaForm/index.js +7 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/page-header/index.d.ts +20 -11
- package/lib/page-header/index.js +22 -45
- package/lib/page-header/index.scss +0 -11
- package/lib/table/components/Filter/index.js +2 -2
- package/lib/table/index.js +1 -1
- package/lib/utils/components/tags/index.d.ts +11 -0
- package/lib/utils/components/tags/index.js +66 -0
- package/lib/utils/components/tags/index.scss +12 -0
- package/package.json +1 -1
package/lib/actions/request.d.ts
CHANGED
@@ -3,7 +3,7 @@ import { BaseAction } from './base';
|
|
3
3
|
export interface RequestAction extends CommonRequestConfig, BaseAction {
|
4
4
|
}
|
5
5
|
export declare function doRequest(action: RequestAction, context?: any, history?: any, extraParams?: any): Promise<unknown>;
|
6
|
-
export declare function useRequestAction(action: RequestAction,
|
6
|
+
export declare function useRequestAction(action: RequestAction, actionContext?: any): {
|
7
7
|
loading: boolean;
|
8
8
|
};
|
9
9
|
export default useRequestAction;
|
package/lib/actions/request.js
CHANGED
@@ -51,7 +51,7 @@ function doRequest(action, context, history, extraParams) {
|
|
51
51
|
}, others), context, history, extraParams);
|
52
52
|
}
|
53
53
|
|
54
|
-
function useRequestAction(action,
|
54
|
+
function useRequestAction(action, actionContext) {
|
55
55
|
var _useState = (0, _react.useState)(false),
|
56
56
|
_useState2 = _slicedToArray(_useState, 2),
|
57
57
|
loading = _useState2[0],
|
@@ -62,7 +62,7 @@ function useRequestAction(action, context) {
|
|
62
62
|
var onFinish = action.onFinish,
|
63
63
|
others = _objectWithoutProperties(action, _excluded2);
|
64
64
|
|
65
|
-
return _objectSpread(_objectSpread({}, (0, _base.eventHandler)(action, function () {
|
65
|
+
return _objectSpread(_objectSpread({}, (0, _base.eventHandler)(action, actionContext, function (context) {
|
66
66
|
setLoading(true);
|
67
67
|
doRequest(_objectSpread({}, others), context, history).then(function () {
|
68
68
|
setLoading(false);
|
package/lib/card/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { ProTagItem } from '../utils/components/tags';
|
2
3
|
import { ProActionGroupProps } from '../actions';
|
3
4
|
import './index.scss';
|
4
5
|
export * from './card-container';
|
@@ -13,6 +14,8 @@ export interface ProCardProps extends Omit<React.HTMLAttributes<HTMLElement>, 't
|
|
13
14
|
tooltip?: React.ReactNode;
|
14
15
|
/** 标题右侧图标 */
|
15
16
|
tooltipIcon?: React.ReactNode;
|
17
|
+
/** 标签组 */
|
18
|
+
tags?: ProTagItem[];
|
16
19
|
/** 标题右侧描述 */
|
17
20
|
description?: React.ReactNode;
|
18
21
|
/** 额外信息区域,位于卡片右上角,可以配置一些常用轻量操作 */
|
@@ -35,6 +38,8 @@ export interface ProCardProps extends Omit<React.HTMLAttributes<HTMLElement>, 't
|
|
35
38
|
centered?: boolean;
|
36
39
|
/** 加载中状态 */
|
37
40
|
loading?: boolean;
|
41
|
+
/** 空状态 */
|
42
|
+
empty?: boolean;
|
38
43
|
/** 边框颜色 */
|
39
44
|
borderColor?: 'blue' | 'green' | 'red' | 'orange' | 'yellow' | 'grey' | 'transparent' | 'none';
|
40
45
|
/** 背景色 */
|
@@ -83,9 +88,13 @@ export declare const ProCard: {
|
|
83
88
|
(props: import("./selectable").ProCardSelectableProps): JSX.Element;
|
84
89
|
defaultProps: {
|
85
90
|
hoveredShadow: boolean;
|
86
|
-
};
|
91
|
+
}; /** 标签组 */
|
87
92
|
isProCard: boolean;
|
88
93
|
};
|
94
|
+
Tab: {
|
95
|
+
(props: import("@alifd/next/types/tab").TabProps): JSX.Element;
|
96
|
+
Item: typeof import("@alifd/next/types/tab").Item;
|
97
|
+
};
|
89
98
|
isProCard: boolean;
|
90
99
|
};
|
91
100
|
export default ProCard;
|
package/lib/card/index.js
CHANGED
@@ -12,12 +12,16 @@ var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
|
13
13
|
var _classnames3 = _interopRequireDefault(require("classnames"));
|
14
14
|
|
15
|
+
var _result = _interopRequireDefault(require("@teamix/result"));
|
16
|
+
|
15
17
|
var _components = require("@alicloudfe/components");
|
16
18
|
|
17
19
|
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
18
20
|
|
19
21
|
var _utils = require("@teamix/utils");
|
20
22
|
|
23
|
+
var _tags = require("../utils/components/tags");
|
24
|
+
|
21
25
|
var _skeleton = require("../skeleton");
|
22
26
|
|
23
27
|
var _actions = require("../actions");
|
@@ -28,6 +32,8 @@ var _divider = _interopRequireDefault(require("./divider"));
|
|
28
32
|
|
29
33
|
var _selectable = _interopRequireDefault(require("./selectable"));
|
30
34
|
|
35
|
+
var _tab = _interopRequireDefault(require("./tab"));
|
36
|
+
|
31
37
|
require("./index.scss");
|
32
38
|
|
33
39
|
var _cardContainer = require("./card-container");
|
@@ -44,7 +50,7 @@ Object.keys(_cardContainer).forEach(function (key) {
|
|
44
50
|
});
|
45
51
|
});
|
46
52
|
var _excluded = ["context"],
|
47
|
-
_excluded2 = ["children", "title", "subTitle", "tooltip", "tooltipIcon", "description", "extra", "actions", "style", "className", "image", "hoveredShadow", "divider", "bordered", "compacted", "centered", "loading", "borderColor", "backgroundColor", "contentClassName", "contentStyle", "direction", "wrap", "spacing", "split", "collapsible", "defaultCollapsed", "collapsed", "onCollapse", "context"];
|
53
|
+
_excluded2 = ["children", "title", "subTitle", "tooltip", "tooltipIcon", "tags", "description", "extra", "actions", "style", "className", "image", "hoveredShadow", "divider", "bordered", "compacted", "centered", "loading", "empty", "borderColor", "backgroundColor", "contentClassName", "contentStyle", "direction", "wrap", "spacing", "split", "collapsible", "defaultCollapsed", "collapsed", "onCollapse", "context"];
|
48
54
|
|
49
55
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
50
56
|
|
@@ -109,6 +115,7 @@ var ProCard = function ProCard(props) {
|
|
109
115
|
subTitle = props.subTitle,
|
110
116
|
tooltip = props.tooltip,
|
111
117
|
tooltipIcon = props.tooltipIcon,
|
118
|
+
tags = props.tags,
|
112
119
|
description = props.description,
|
113
120
|
extra = props.extra,
|
114
121
|
actions = props.actions,
|
@@ -121,6 +128,7 @@ var ProCard = function ProCard(props) {
|
|
121
128
|
compacted = props.compacted,
|
122
129
|
centered = props.centered,
|
123
130
|
loading = props.loading,
|
131
|
+
empty = props.empty,
|
124
132
|
borderColor = props.borderColor,
|
125
133
|
backgroundColor = props.backgroundColor,
|
126
134
|
contentClassName = props.contentClassName,
|
@@ -212,7 +220,7 @@ var ProCard = function ProCard(props) {
|
|
212
220
|
}, _defineProperty(_classnames, "border-".concat(borderColor), borderColor), _defineProperty(_classnames, "compacted", compacted), _defineProperty(_classnames, "hoverable", hoveredShadow), _classnames));
|
213
221
|
var cardContentClassName = (0, _classnames3.default)(cls('content'), contentClassName, getFlexDirectionClassName(direction, split), (_classnames2 = {
|
214
222
|
'contain-pro-card': containProCard
|
215
|
-
}, _defineProperty(_classnames2, "split-".concat(split), split), _defineProperty(_classnames2, 'flex-wrap', wrap), _defineProperty(_classnames2, "centered", centered), _classnames2));
|
223
|
+
}, _defineProperty(_classnames2, "split-".concat(split), split), _defineProperty(_classnames2, 'flex-wrap', wrap), _defineProperty(_classnames2, "centered", centered || empty), _classnames2));
|
216
224
|
var cardContentMargin = containProCard && !split ? {
|
217
225
|
marginRight: -horizonal,
|
218
226
|
marginLeft: -horizonal,
|
@@ -247,7 +255,7 @@ var ProCard = function ProCard(props) {
|
|
247
255
|
}, /*#__PURE__*/_react.default.createElement(_components.Balloon.Tooltip, {
|
248
256
|
align: "t",
|
249
257
|
trigger: tooltipTrigger
|
250
|
-
}, tooltip)), description && /*#__PURE__*/_react.default.createElement("div", {
|
258
|
+
}, tooltip)), tags && (0, _tags.renderTags)(tags, 'small'), description && /*#__PURE__*/_react.default.createElement("div", {
|
251
259
|
className: cls('title-description')
|
252
260
|
}, description));
|
253
261
|
};
|
@@ -272,7 +280,16 @@ var ProCard = function ProCard(props) {
|
|
272
280
|
}, loading && /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Card.Content, null), !loading && /*#__PURE__*/_react.default.createElement("div", {
|
273
281
|
className: cardContentClassName,
|
274
282
|
style: cardContentStyle
|
275
|
-
},
|
283
|
+
}, empty && /*#__PURE__*/_react.default.createElement("div", {
|
284
|
+
className: cls('empty')
|
285
|
+
}, childrenModified ? childrenModified : /*#__PURE__*/_react.default.createElement(_result.default, {
|
286
|
+
theme: "hybridcloud-container",
|
287
|
+
img: "noData",
|
288
|
+
title: (0, _utils.getMessage)('noData'),
|
289
|
+
style: {
|
290
|
+
padding: '50px 0 60px'
|
291
|
+
}
|
292
|
+
})), !empty && childrenModified)));
|
276
293
|
};
|
277
294
|
|
278
295
|
exports.ProCard = ProCard;
|
@@ -283,6 +300,7 @@ ProCard.defaultProps = {
|
|
283
300
|
};
|
284
301
|
ProCard.Divider = _divider.default;
|
285
302
|
ProCard.Selectable = _selectable.default;
|
303
|
+
ProCard.Tab = _tab.default;
|
286
304
|
ProCard.isProCard = true;
|
287
305
|
var _default = ProCard;
|
288
306
|
exports.default = _default;
|
package/lib/card/index.scss
CHANGED
@@ -153,6 +153,25 @@
|
|
153
153
|
}
|
154
154
|
}
|
155
155
|
|
156
|
+
&-tab {
|
157
|
+
margin-top: calc(0px - var(--s-2));
|
158
|
+
|
159
|
+
& > .next-tabs-bar {
|
160
|
+
border-bottom: none;
|
161
|
+
}
|
162
|
+
|
163
|
+
& > .next-tabs-content {
|
164
|
+
padding-top: var(--s-5, 20px);
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
&-empty {
|
169
|
+
display: flex;
|
170
|
+
flex-direction: column;
|
171
|
+
align-items: center;
|
172
|
+
color: var(--color-text1-8, #848484);
|
173
|
+
}
|
174
|
+
|
156
175
|
& > .next-card-actions {
|
157
176
|
& > .teamix-pro-actions {
|
158
177
|
& > .next-btn {
|
package/lib/card/tab.js
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
11
|
+
|
12
|
+
var _components = require("@alicloudfe/components");
|
13
|
+
|
14
|
+
var _excluded = ["className"];
|
15
|
+
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
+
|
18
|
+
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; }
|
19
|
+
|
20
|
+
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; }
|
21
|
+
|
22
|
+
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; }
|
23
|
+
|
24
|
+
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; }
|
25
|
+
|
26
|
+
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; }
|
27
|
+
|
28
|
+
var ProCardTab = function ProCardTab(props) {
|
29
|
+
var className = props.className,
|
30
|
+
others = _objectWithoutProperties(props, _excluded);
|
31
|
+
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_components.Tab, _objectSpread({
|
33
|
+
className: (0, _classnames.default)('teamix-pro-card-tab', className)
|
34
|
+
}, others));
|
35
|
+
};
|
36
|
+
|
37
|
+
ProCardTab.Item = _components.Tab.Item;
|
38
|
+
var _default = ProCardTab;
|
39
|
+
exports.default = _default;
|
@@ -84,7 +84,8 @@ var ProForm = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
84
84
|
context: context
|
85
85
|
});
|
86
86
|
}, [scope, context]);
|
87
|
-
var onAutoSubmit = (0, _useAutoSubmit.default)(onSubmit);
|
87
|
+
var onAutoSubmit = (0, _useAutoSubmit.default)(onSubmit); // todo 需要formily支持断点下的属性更新
|
88
|
+
|
88
89
|
var getTeamixLayout = (0, _react.useMemo)(function () {
|
89
90
|
return breakpoints ? {
|
90
91
|
breakpoints: breakpoints,
|
@@ -136,28 +137,7 @@ var ProForm = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
136
137
|
schema: schema,
|
137
138
|
scope: mergedScope,
|
138
139
|
components: components
|
139
|
-
}), children);
|
140
|
-
// <FormLayout
|
141
|
-
// className={cls(prefixCls, className)}
|
142
|
-
// {...otherProps}
|
143
|
-
// {...getTeamixLayout}
|
144
|
-
// >
|
145
|
-
// <SchemaForm schema={schema} scope={scope} components={components} />
|
146
|
-
// {children}
|
147
|
-
// </FormLayout>
|
148
|
-
// ) : (
|
149
|
-
// <Form
|
150
|
-
// className={cls(prefixCls, className)}
|
151
|
-
// {...otherProps}
|
152
|
-
// {...getTeamixLayout}
|
153
|
-
// form={form}
|
154
|
-
// onAutoSubmit={onAutoSubmit}
|
155
|
-
// onAutoSubmitFailed={onSubmitFailed}
|
156
|
-
// >
|
157
|
-
// <SchemaForm schema={schema} scope={scope} components={components} />
|
158
|
-
// {children}
|
159
|
-
// </Form>
|
160
|
-
// );
|
140
|
+
}), children);
|
161
141
|
});
|
162
142
|
ProForm.defaultProps = {
|
163
143
|
colon: false,
|
@@ -105,6 +105,7 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
105
105
|
var schema = _ref.schema,
|
106
106
|
scope = _ref.scope,
|
107
107
|
components = _ref.components;
|
108
|
+
// 创建 SchemaField
|
108
109
|
var SchemaField = (0, _react.useMemo)(function () {
|
109
110
|
return (0, _react2.createSchemaField)({
|
110
111
|
components: _objectSpread(_objectSpread({}, _ProField.default), {}, {
|
@@ -135,15 +136,15 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
135
136
|
Text: _index.default
|
136
137
|
})
|
137
138
|
});
|
138
|
-
}, []); // 合并schema中request的scope
|
139
|
+
}, []); // 合并 schema 中 request 的 scope
|
139
140
|
|
140
141
|
var mergedScope = (0, _react.useMemo)(function () {
|
141
142
|
return _objectSpread({}, scope);
|
142
|
-
}, [scope]); // 格式化schema
|
143
|
+
}, [scope]); // 格式化 schema
|
143
144
|
|
144
145
|
var formatSchema = (0, _react.useCallback)(function (schema) {
|
145
146
|
var schemaProperties = {};
|
146
|
-
schema.forEach(function (item) {
|
147
|
+
schema === null || schema === void 0 ? void 0 : schema.forEach(function (item) {
|
147
148
|
var newItem = (0, _warning.default)(item);
|
148
149
|
var _newItem = newItem,
|
149
150
|
originalComponent = _newItem.component; // 根据component的不同,初始化为内置的item
|
@@ -279,15 +280,15 @@ var _default = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
279
280
|
});
|
280
281
|
return schemaProperties;
|
281
282
|
}, [mergedScope]);
|
282
|
-
var
|
283
|
+
var proFormSchema = (0, _react.useMemo)(function () {
|
283
284
|
return {
|
284
285
|
type: 'object',
|
285
286
|
properties: formatSchema(schema)
|
286
287
|
};
|
287
|
-
}, []); // console.log(
|
288
|
+
}, []); // console.log(proFormSchema);
|
288
289
|
|
289
290
|
return /*#__PURE__*/_react.default.createElement(SchemaField, {
|
290
|
-
schema:
|
291
|
+
schema: proFormSchema,
|
291
292
|
components: components,
|
292
293
|
scope: mergedScope
|
293
294
|
});
|
package/lib/index.d.ts
CHANGED
@@ -21,5 +21,5 @@ export * from './page-container';
|
|
21
21
|
export * from './page-header';
|
22
22
|
export * from './skeleton';
|
23
23
|
export * from './table';
|
24
|
-
declare const version = "1.2.
|
24
|
+
declare const version = "1.2.10";
|
25
25
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils, };
|
package/lib/index.js
CHANGED
@@ -253,5 +253,5 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
253
253
|
_icon.default.setConfig(_utils.default.getTeamixIconConfig());
|
254
254
|
|
255
255
|
// export * from './sidebar';
|
256
|
-
var version = '1.2.
|
256
|
+
var version = '1.2.10';
|
257
257
|
exports.version = version;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { TagProps, CloseableProps } from '@alicloudfe/components/types/tag';
|
3
2
|
import { ItemProps } from '@alicloudfe/components/types/breadcrumb';
|
3
|
+
import { LinkPath } from '@teamix/utils';
|
4
|
+
import { ProTagItem } from '../utils/components/tags';
|
4
5
|
import { ProActionGroupProps } from '../actions';
|
5
6
|
import { ProInfoProps } from '../info';
|
6
7
|
import './index.scss';
|
@@ -10,14 +11,7 @@ export interface ProPageHeaderBreadcrumbItem extends ItemProps {
|
|
10
11
|
*/
|
11
12
|
text?: string;
|
12
13
|
}
|
13
|
-
export declare type ProPageHeaderTagItem =
|
14
|
-
closable: true;
|
15
|
-
})) & {
|
16
|
-
/**
|
17
|
-
* @deprecated 建议使用 children 代替
|
18
|
-
*/
|
19
|
-
text?: string;
|
20
|
-
};
|
14
|
+
export declare type ProPageHeaderTagItem = ProTagItem;
|
21
15
|
declare type Color = 'blue' | 'green' | 'orange' | 'red' | 'yellow' | string;
|
22
16
|
export declare type ProPageHeaderDataItem = {
|
23
17
|
title: string;
|
@@ -25,20 +19,35 @@ export declare type ProPageHeaderDataItem = {
|
|
25
19
|
color?: Color;
|
26
20
|
} & React.HTMLAttributes<HTMLElement>;
|
27
21
|
export declare type ProPageHeaderProps = {
|
22
|
+
/** 标题 */
|
28
23
|
title?: React.ReactNode;
|
24
|
+
/** 描述 */
|
29
25
|
description?: React.ReactNode;
|
30
|
-
|
26
|
+
/** 图标 */
|
27
|
+
icon?: React.ReactNode;
|
28
|
+
/** 图标颜色 */
|
31
29
|
iconColor?: Color;
|
30
|
+
/** 图标背景类型 */
|
32
31
|
iconBackgroundType?: 'circle' | 'square';
|
32
|
+
/** 图标背景色 */
|
33
33
|
iconBackgroundColor?: Color;
|
34
|
-
|
34
|
+
/** 返回按钮配置 */
|
35
|
+
goback?: boolean | LinkPath | ((e: React.MouseEvent) => void);
|
36
|
+
/** 背景图 */
|
35
37
|
image?: string;
|
38
|
+
/** 加载中 */
|
36
39
|
loading?: boolean;
|
40
|
+
/** 面包屑配置 */
|
37
41
|
breadcrumb?: ProPageHeaderBreadcrumbItem[];
|
42
|
+
/** 额外信息区配置 */
|
38
43
|
extra?: ProActionGroupProps | React.ReactNode;
|
44
|
+
/** 操作区配置 */
|
39
45
|
operation?: ProActionGroupProps | React.ReactNode;
|
46
|
+
/** 标签组 */
|
40
47
|
tags?: ProPageHeaderTagItem[];
|
48
|
+
/** 数据概览项 */
|
41
49
|
data?: ProPageHeaderDataItem[];
|
50
|
+
/** 底部详情 */
|
42
51
|
info?: ProInfoProps | React.ReactNode;
|
43
52
|
} & Omit<React.HTMLAttributes<HTMLElement>, 'title'>;
|
44
53
|
declare const ProPageHeader: React.FC<ProPageHeaderProps>;
|
package/lib/page-header/index.js
CHANGED
@@ -17,6 +17,8 @@ var _components = require("@alicloudfe/components");
|
|
17
17
|
|
18
18
|
var _utils = require("@teamix/utils");
|
19
19
|
|
20
|
+
var _tags = require("../utils/components/tags");
|
21
|
+
|
20
22
|
var _actions = require("../actions");
|
21
23
|
|
22
24
|
var _skeleton = require("../skeleton");
|
@@ -26,9 +28,8 @@ var _info = _interopRequireDefault(require("../info"));
|
|
26
28
|
require("./index.scss");
|
27
29
|
|
28
30
|
var _excluded = ["text", "children"],
|
29
|
-
_excluded2 = ["
|
30
|
-
_excluded3 = ["
|
31
|
-
_excluded4 = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
|
31
|
+
_excluded2 = ["color", "title", "num", "className"],
|
32
|
+
_excluded3 = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
|
32
33
|
|
33
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
34
35
|
|
@@ -83,40 +84,6 @@ var renderActionGroup = function renderActionGroup(group, defaultProps) {
|
|
83
84
|
return group;
|
84
85
|
};
|
85
86
|
|
86
|
-
var renderTags = function renderTags(tags) {
|
87
|
-
if (!tags) {
|
88
|
-
return null;
|
89
|
-
}
|
90
|
-
|
91
|
-
return /*#__PURE__*/_react.default.createElement(_components.Tag.Group, {
|
92
|
-
className: cls('tags')
|
93
|
-
}, tags.map(function (tag, i) {
|
94
|
-
// @ts-ignore
|
95
|
-
var text = tag.text,
|
96
|
-
children = tag.children,
|
97
|
-
closable = tag.closable,
|
98
|
-
others = _objectWithoutProperties(tag, _excluded2);
|
99
|
-
|
100
|
-
if (closable) {
|
101
|
-
return /*#__PURE__*/_react.default.createElement(_components.Tag.Closeable, _objectSpread({
|
102
|
-
key: i,
|
103
|
-
size: "large",
|
104
|
-
style: {
|
105
|
-
marginBottom: 0
|
106
|
-
}
|
107
|
-
}, others), text || children);
|
108
|
-
}
|
109
|
-
|
110
|
-
return /*#__PURE__*/_react.default.createElement(_components.Tag, _objectSpread({
|
111
|
-
key: i,
|
112
|
-
size: "large",
|
113
|
-
style: {
|
114
|
-
marginBottom: 0
|
115
|
-
}
|
116
|
-
}, others), text || children);
|
117
|
-
}));
|
118
|
-
};
|
119
|
-
|
120
87
|
var isPresetColor = function isPresetColor(color) {
|
121
88
|
if (!color) {
|
122
89
|
return false;
|
@@ -154,7 +121,7 @@ var renderData = function renderData(data) {
|
|
154
121
|
title = item.title,
|
155
122
|
num = item.num,
|
156
123
|
customClassName = item.className,
|
157
|
-
others = _objectWithoutProperties(item,
|
124
|
+
others = _objectWithoutProperties(item, _excluded2);
|
158
125
|
|
159
126
|
var _getColorAndStyle = getColorAndStyle(color),
|
160
127
|
className = _getColorAndStyle.className,
|
@@ -202,7 +169,7 @@ var ProPageHeader = function ProPageHeader(props) {
|
|
202
169
|
children = props.children,
|
203
170
|
className = props.className,
|
204
171
|
style = props.style,
|
205
|
-
others = _objectWithoutProperties(props,
|
172
|
+
others = _objectWithoutProperties(props, _excluded3);
|
206
173
|
|
207
174
|
var history = (0, _reactRouterDom.useHistory)();
|
208
175
|
var backgroundImage = image ? "url('".concat(image, "')") : undefined;
|
@@ -220,12 +187,22 @@ var ProPageHeader = function ProPageHeader(props) {
|
|
220
187
|
iconClass = _getColorAndStyle2.className,
|
221
188
|
iconStyle = _getColorAndStyle2.style;
|
222
189
|
|
223
|
-
var onBack = function onBack() {
|
190
|
+
var onBack = function onBack(e) {
|
191
|
+
if (!goback) {
|
192
|
+
return;
|
193
|
+
}
|
194
|
+
|
195
|
+
if (typeof goback === 'function') {
|
196
|
+
goback(e);
|
197
|
+
return;
|
198
|
+
}
|
199
|
+
|
224
200
|
if (goback === true) {
|
225
201
|
history.go(-1);
|
226
|
-
|
227
|
-
history.push && history.push(goback);
|
202
|
+
return;
|
228
203
|
}
|
204
|
+
|
205
|
+
(0, _utils.goToLink)(goback, history);
|
229
206
|
};
|
230
207
|
|
231
208
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, goback && /*#__PURE__*/_react.default.createElement(_icon.default, {
|
@@ -233,14 +210,14 @@ var ProPageHeader = function ProPageHeader(props) {
|
|
233
210
|
onClick: onBack,
|
234
211
|
type: "return-line",
|
235
212
|
size: "large"
|
236
|
-
}), icon && /*#__PURE__*/_react.default.createElement(_icon.default, {
|
213
|
+
}), icon && (typeof icon === 'string' ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
237
214
|
className: (0, _classnames2.default)(iconClass, cls('title-icon')),
|
238
215
|
style: iconStyle,
|
239
216
|
type: icon,
|
240
217
|
size: "large"
|
241
|
-
}), /*#__PURE__*/_react.default.createElement("span", {
|
218
|
+
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, icon)), /*#__PURE__*/_react.default.createElement("span", {
|
242
219
|
className: cls('title-name')
|
243
|
-
}, title), renderTags(tags));
|
220
|
+
}, title), (0, _tags.renderTags)(tags, 'large'));
|
244
221
|
};
|
245
222
|
|
246
223
|
return /*#__PURE__*/_react.default.createElement("header", _objectSpread({
|
@@ -124,17 +124,6 @@ $prefix: 'teamix-pro-page-header';
|
|
124
124
|
cursor: pointer;
|
125
125
|
}
|
126
126
|
|
127
|
-
.#{$prefix}-tags {
|
128
|
-
display: inline-flex;
|
129
|
-
align-items: center;
|
130
|
-
|
131
|
-
& > div {
|
132
|
-
&:last-child {
|
133
|
-
margin-right: 0;
|
134
|
-
}
|
135
|
-
}
|
136
|
-
}
|
137
|
-
|
138
127
|
.#{$prefix}-color {
|
139
128
|
&-blue {
|
140
129
|
color: var(--color-notice-5);
|
@@ -237,7 +237,7 @@ var Filter = function Filter(props) {
|
|
237
237
|
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.resetPage) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7);
|
238
238
|
setVisible(false);
|
239
239
|
}
|
240
|
-
},
|
240
|
+
}, (0, _utils.getMessage)('ok')), /*#__PURE__*/_react.default.createElement(_components.Button, {
|
241
241
|
type: "normal",
|
242
242
|
size: "small",
|
243
243
|
className: cls({
|
@@ -254,7 +254,7 @@ var Filter = function Filter(props) {
|
|
254
254
|
})));
|
255
255
|
(_actionRef$current10 = actionRef.current) === null || _actionRef$current10 === void 0 ? void 0 : (_actionRef$current10$ = _actionRef$current10.filterDataSource) === null || _actionRef$current10$ === void 0 ? void 0 : _actionRef$current10$.call(_actionRef$current10, column.dataIndex); // setVisible(!visible);
|
256
256
|
}
|
257
|
-
},
|
257
|
+
}, (0, _utils.getMessage)('reset'))))));
|
258
258
|
};
|
259
259
|
|
260
260
|
var _default = Filter;
|
package/lib/table/index.js
CHANGED
@@ -817,7 +817,7 @@ var ProTable = function ProTable(props) {
|
|
817
817
|
|
818
818
|
}),
|
819
819
|
ref: tableRef
|
820
|
-
}, renderTable(), footerSuctionState && footerSuction && /*#__PURE__*/_react.default.createElement(_pageContainer.default.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && renderFooter()));
|
820
|
+
}, renderTable(), footerSuctionState && footerSuction && !fullscreenState && /*#__PURE__*/_react.default.createElement(_pageContainer.default.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && !fullscreenState && renderFooter(), fullscreenState && renderFooter()));
|
821
821
|
};
|
822
822
|
|
823
823
|
var _default = ProTable;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { TagProps, CloseableProps } from '@alicloudfe/components/types/tag';
|
2
|
+
import './index.scss';
|
3
|
+
export declare type ProTagItem = (TagProps | (CloseableProps & {
|
4
|
+
closable: true;
|
5
|
+
})) & {
|
6
|
+
/**
|
7
|
+
* @deprecated 建议使用 children 代替
|
8
|
+
*/
|
9
|
+
text?: string;
|
10
|
+
};
|
11
|
+
export declare const renderTags: (tags?: ProTagItem[] | undefined, size?: "small" | "large" | "medium" | undefined) => JSX.Element | null;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.renderTags = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _components = require("@alicloudfe/components");
|
11
|
+
|
12
|
+
var _utils = require("@teamix/utils");
|
13
|
+
|
14
|
+
require("./index.scss");
|
15
|
+
|
16
|
+
var _excluded = ["text", "children", "closable"];
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
+
|
20
|
+
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; }
|
21
|
+
|
22
|
+
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; }
|
23
|
+
|
24
|
+
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; }
|
25
|
+
|
26
|
+
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; }
|
27
|
+
|
28
|
+
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; }
|
29
|
+
|
30
|
+
var cls = (0, _utils.baseClass)('teamix-pro-tags');
|
31
|
+
|
32
|
+
var renderTags = function renderTags(tags, size) {
|
33
|
+
if (!tags || !tags.length) {
|
34
|
+
return null;
|
35
|
+
}
|
36
|
+
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_components.Tag.Group, {
|
38
|
+
className: cls('')
|
39
|
+
}, tags.map(function (tag, i) {
|
40
|
+
// @ts-ignore
|
41
|
+
var text = tag.text,
|
42
|
+
children = tag.children,
|
43
|
+
closable = tag.closable,
|
44
|
+
others = _objectWithoutProperties(tag, _excluded);
|
45
|
+
|
46
|
+
if (closable) {
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_components.Tag.Closeable, _objectSpread({
|
48
|
+
key: i,
|
49
|
+
size: size,
|
50
|
+
style: {
|
51
|
+
marginBottom: 0
|
52
|
+
}
|
53
|
+
}, others), text || children);
|
54
|
+
}
|
55
|
+
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_components.Tag, _objectSpread({
|
57
|
+
key: i,
|
58
|
+
size: size,
|
59
|
+
style: {
|
60
|
+
marginBottom: 0
|
61
|
+
}
|
62
|
+
}, others), text || children);
|
63
|
+
}));
|
64
|
+
};
|
65
|
+
|
66
|
+
exports.renderTags = renderTags;
|