@teamix/pro 1.2.0 → 1.2.5
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 +1072 -507
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-component.js +2 -1
- package/es/actions/dialog-form.js +2 -1
- package/es/actions/dialog.js +2 -1
- package/es/actions/index.js +1 -1
- package/es/actions/utils.d.ts +1 -0
- package/es/actions/utils.js +27 -0
- package/es/card/card-container.d.ts +18 -0
- package/es/card/card-container.js +24 -0
- package/es/card/divider.d.ts +6 -0
- package/es/card/divider.js +16 -0
- package/es/card/index.d.ts +59 -32
- package/es/card/index.js +191 -107
- package/es/card/index.scss +124 -9
- package/es/card/utils.d.ts +9 -0
- package/es/card/utils.js +30 -0
- package/es/form/Components/ProField/index.js +2 -6
- package/es/form/ProForm/index.js +43 -17
- package/es/form/ProForm/index.scss +0 -1
- package/es/form/ProForm/useAutoSubmit.d.ts +1 -1
- package/es/form/ProForm/useAutoSubmit.js +3 -3
- package/es/form/ProForm/useInitialRequest.d.ts +1 -1
- package/es/form/ProForm/useInitialRequest.js +2 -2
- package/es/form/SchemaForm/initializeDataSource.js +1 -1
- package/es/form/SchemaForm/initializeFormButton.js +3 -2
- package/es/form/SchemaForm/initializeRequest.js +6 -3
- package/es/form/SchemaForm/initializeRules.js +1 -1
- package/es/form/SchemaForm/reactions.d.ts +5 -4
- package/es/form/SchemaForm/reactions.js +20 -11
- package/es/form/locales/validate.d.ts +159 -0
- package/es/form/locales/validate.js +158 -0
- package/es/form/typing.d.ts +4 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/InfoGroup/index.js +5 -2
- package/es/info/components/InfoValueItem/index.js +5 -7
- package/es/info/components/baseInfo/index.js +4 -2
- package/es/info/index.js +25 -11
- package/es/info/typing.d.ts +6 -0
- package/es/nocode/configurators/Card.js +8 -4
- package/es/table/components/Layout/index.js +1 -1
- package/es/table/components/ToolBar/FilterColumnIcon.js +2 -24
- package/es/table/components/ToolBar/index.scss +0 -3
- package/es/table/index.js +15 -7
- package/es/table/typing.d.ts +4 -4
- package/lib/actions/dialog-component.js +3 -1
- package/lib/actions/dialog-form.js +3 -1
- package/lib/actions/dialog.js +3 -1
- package/lib/actions/index.js +1 -1
- package/lib/actions/utils.d.ts +1 -0
- package/lib/actions/utils.js +33 -0
- package/lib/card/card-container.d.ts +18 -0
- package/lib/card/card-container.js +37 -0
- package/lib/card/divider.d.ts +6 -0
- package/lib/card/divider.js +26 -0
- package/lib/card/index.d.ts +59 -32
- package/lib/card/index.js +211 -110
- package/lib/card/index.scss +124 -9
- package/lib/card/utils.d.ts +9 -0
- package/lib/card/utils.js +41 -0
- package/lib/form/Components/ProField/index.js +1 -5
- package/lib/form/ProForm/index.js +41 -14
- package/lib/form/ProForm/index.scss +0 -1
- package/lib/form/ProForm/useAutoSubmit.d.ts +1 -1
- package/lib/form/ProForm/useAutoSubmit.js +3 -3
- package/lib/form/ProForm/useInitialRequest.d.ts +1 -1
- package/lib/form/ProForm/useInitialRequest.js +2 -2
- package/lib/form/SchemaForm/initializeDataSource.js +1 -1
- package/lib/form/SchemaForm/initializeFormButton.js +5 -2
- package/lib/form/SchemaForm/initializeRequest.js +5 -2
- package/lib/form/SchemaForm/initializeRules.js +1 -1
- package/lib/form/SchemaForm/reactions.d.ts +5 -4
- package/lib/form/SchemaForm/reactions.js +23 -12
- package/lib/form/locales/validate.d.ts +159 -0
- package/lib/form/locales/validate.js +165 -0
- package/lib/form/typing.d.ts +4 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/InfoGroup/index.js +5 -2
- package/lib/info/components/InfoValueItem/index.js +5 -7
- package/lib/info/components/baseInfo/index.js +4 -2
- package/lib/info/index.js +24 -10
- package/lib/info/typing.d.ts +6 -0
- package/lib/nocode/configurators/Card.js +8 -4
- package/lib/table/components/Layout/index.js +1 -1
- package/lib/table/components/ToolBar/FilterColumnIcon.js +2 -24
- package/lib/table/components/ToolBar/index.scss +0 -3
- package/lib/table/index.js +16 -7
- package/lib/table/typing.d.ts +4 -4
- package/package.json +5 -4
package/es/table/index.js
CHANGED
@@ -49,6 +49,7 @@ import { createForm, formilyReactive } from '../form';
|
|
49
49
|
import { ProActionGroup } from '../actions';
|
50
50
|
import debounce from 'lodash.debounce';
|
51
51
|
import classNames from 'classnames';
|
52
|
+
import ProPageContainer from '../page-container';
|
52
53
|
export * from './typing';
|
53
54
|
var cls = baseClass('teamix-pro-table');
|
54
55
|
var toJS = formilyReactive.toJS;
|
@@ -236,10 +237,10 @@ var ProTable = function ProTable(props) {
|
|
236
237
|
|
237
238
|
var dataFilterForm = useMemo(function () {
|
238
239
|
return createForm();
|
239
|
-
}, []); //
|
240
|
+
}, []); // TODO 获取内容区是否超出一屏(暂时仅支持全家桶)
|
240
241
|
|
241
242
|
var getFooterSuctionState = function getFooterSuctionState() {
|
242
|
-
var containerDom = document.querySelector('.teamix-pro-page-container');
|
243
|
+
var containerDom = document.querySelector('.teamix-pro-page-container-scroll-container');
|
243
244
|
|
244
245
|
if (containerDom) {
|
245
246
|
var offsetHeight = containerDom.offsetHeight;
|
@@ -250,6 +251,11 @@ var ProTable = function ProTable(props) {
|
|
250
251
|
} else {
|
251
252
|
setFooterSuctionState(false);
|
252
253
|
}
|
254
|
+
} else {
|
255
|
+
// 非全家桶用户暂时不判断滚动条逻辑
|
256
|
+
if (footerSuction) {
|
257
|
+
setFooterSuctionState(true);
|
258
|
+
}
|
253
259
|
}
|
254
260
|
}; // rowSelection 相关
|
255
261
|
|
@@ -365,7 +371,9 @@ var ProTable = function ProTable(props) {
|
|
365
371
|
return _request(params);
|
366
372
|
},
|
367
373
|
request: function request(params) {
|
368
|
-
|
374
|
+
if (dataFilterForm.validate()) {
|
375
|
+
_request(params);
|
376
|
+
}
|
369
377
|
},
|
370
378
|
reset: function reset() {
|
371
379
|
var _actionRef$current, _actionRef$current$se;
|
@@ -652,7 +660,7 @@ var ProTable = function ProTable(props) {
|
|
652
660
|
var renderFooterAction = function renderFooterAction() {
|
653
661
|
var _footerAction$actions;
|
654
662
|
|
655
|
-
if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (_footerAction$actions = footerAction.actions) === null || _footerAction$actions === void 0 ? void 0 : _footerAction$actions.length)
|
663
|
+
if (_typeof(footerAction) === 'object' && (footerAction === null || footerAction === void 0 ? void 0 : (_footerAction$actions = footerAction.actions) === null || _footerAction$actions === void 0 ? void 0 : _footerAction$actions.length) >= 0) {
|
656
664
|
// 默认 context
|
657
665
|
var defaultContext = {
|
658
666
|
action: actionRef.current,
|
@@ -752,11 +760,11 @@ var ProTable = function ProTable(props) {
|
|
752
760
|
}, /*#__PURE__*/React.createElement("div", {
|
753
761
|
className: cls({
|
754
762
|
'': true,
|
755
|
-
fullscreen: fullscreenState,
|
756
|
-
|
763
|
+
fullscreen: fullscreenState // 'footer-suction': footerSuctionState && footerSuction,
|
764
|
+
|
757
765
|
}),
|
758
766
|
ref: tableRef
|
759
|
-
}, renderTable(), renderFooter()));
|
767
|
+
}, renderTable(), footerSuctionState && footerSuction && /*#__PURE__*/React.createElement(ProPageContainer.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && renderFooter()));
|
760
768
|
};
|
761
769
|
|
762
770
|
export default ProTable;
|
package/es/table/typing.d.ts
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
import { ColumnProps, TableProps } from '@alicloudfe/components/types/table';
|
5
5
|
import { ProFieldType, ProFieldRenderProps, ProFieldDataSourceItem } from '../field';
|
6
6
|
import { IFilterProps } from '../form';
|
7
|
-
import {
|
7
|
+
import { ProActionGroupProps, ProActionButtonProps } from '../actions';
|
8
8
|
import { PaginationProps } from '@alicloudfe/components/types/pagination';
|
9
9
|
import { HeaderProps as ProTableHeaderProps } from '@teamix/utils';
|
10
10
|
import { Method } from 'axios';
|
@@ -50,7 +50,7 @@ export declare type ProTableColumnProps = {
|
|
50
50
|
/** 表头的过滤菜单宽度 */
|
51
51
|
filtersWidth?: string | number;
|
52
52
|
/** 操作组配置 */
|
53
|
-
actionSchema?:
|
53
|
+
actionSchema?: ProActionGroupProps;
|
54
54
|
/** 指定列对应的字段,支持`a.b`形式的快速取值 和 数组取值 */
|
55
55
|
dataIndex?: string | string[];
|
56
56
|
/** 指定 valueType 为日期时间格式时,可以格式化日期时间 */
|
@@ -99,7 +99,7 @@ export declare type ProTableProps = {
|
|
99
99
|
/** 获取内置 rowSelection */
|
100
100
|
getRowSelection?: (rowSelection: rowSelectionType) => void;
|
101
101
|
/** 表格底部(左侧)配置 */
|
102
|
-
footerAction?:
|
102
|
+
footerAction?: ProActionGroupProps | React.ReactNode;
|
103
103
|
/** 筛选区自动搜索的防抖时间(毫秒) */
|
104
104
|
filterDebounce?: number;
|
105
105
|
/** ProTable action 的引用,便于手动触发一些方法 */
|
@@ -211,7 +211,7 @@ export declare type ProTableTopAreaProps = {
|
|
211
211
|
/** 标题区 */
|
212
212
|
header?: ProTableHeaderProps;
|
213
213
|
/** 主操作区 */
|
214
|
-
mainAction?:
|
214
|
+
mainAction?: ProActionGroupProps | React.ReactNode;
|
215
215
|
/** 工具栏区 */
|
216
216
|
toolBar?: boolean | ProTableToolBarItem[];
|
217
217
|
/** 快捷操作区 */
|
@@ -10,6 +10,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
|
11
11
|
var _dialog = _interopRequireDefault(require("./dialog"));
|
12
12
|
|
13
|
+
var _utils = require("./utils");
|
14
|
+
|
13
15
|
var _excluded = ["schema", "component"];
|
14
16
|
|
15
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -30,7 +32,7 @@ function useDialogComponentAction(action, context) {
|
|
30
32
|
others = _objectWithoutProperties(action, _excluded);
|
31
33
|
|
32
34
|
return (0, _dialog.default)(Object.assign({
|
33
|
-
content: /*#__PURE__*/_react.default.createElement(Component, _objectSpread({}, schema)),
|
35
|
+
content: /*#__PURE__*/_react.default.createElement(Component, _objectSpread({}, (0, _utils.addContext)(schema, context))),
|
34
36
|
closeable: true
|
35
37
|
}, others), context);
|
36
38
|
}
|
@@ -22,6 +22,8 @@ var _request = require("./request");
|
|
22
22
|
|
23
23
|
var _dialog = _interopRequireDefault(require("./dialog"));
|
24
24
|
|
25
|
+
var _utils2 = require("./utils");
|
26
|
+
|
25
27
|
var _excluded = ["schema"],
|
26
28
|
_excluded2 = ["schema", "useFieldValuesForRequest", "initialValues", "initialRequest", "formProps", "size", "onFinish"];
|
27
29
|
|
@@ -141,7 +143,7 @@ var DialogForm = function DialogForm(props) {
|
|
141
143
|
}, /*#__PURE__*/_react.default.createElement(_form.default, _objectSpread(_objectSpread({
|
142
144
|
form: form,
|
143
145
|
schema: (0, _utils.getTargetValue)(formSchema, context)
|
144
|
-
}, getDefaultFormPropsByDialogSize(size)), (0, _utils.getTargetValue)(others, context))));
|
146
|
+
}, getDefaultFormPropsByDialogSize(size)), (0, _utils2.addContext)((0, _utils.getTargetValue)(others, context), context))));
|
145
147
|
};
|
146
148
|
|
147
149
|
function useDialogFormAction(action, context) {
|
package/lib/actions/dialog.js
CHANGED
@@ -26,6 +26,8 @@ var _base = require("./base");
|
|
26
26
|
|
27
27
|
var _request = require("./request");
|
28
28
|
|
29
|
+
var _utils2 = require("./utils");
|
30
|
+
|
29
31
|
var _excluded = ["url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
|
30
32
|
_excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "message", "footerDescription", "footerAlign", "overlayProps"],
|
31
33
|
_excluded3 = ["className"];
|
@@ -247,7 +249,7 @@ function useDialogAction(action, context) {
|
|
247
249
|
});
|
248
250
|
var dialogContent = Component ? /*#__PURE__*/_react.default.createElement(Component, _objectSpread({
|
249
251
|
key: (0, _utils.uuid)()
|
250
|
-
}, componentProps)) : addContextForReactNode(content, dialogContext);
|
252
|
+
}, (0, _utils2.addContext)(componentProps, dialogContext))) : addContextForReactNode(content, dialogContext);
|
251
253
|
|
252
254
|
var quickShowProps = _objectSpread(_objectSpread({
|
253
255
|
// @ts-ignore
|
package/lib/actions/index.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export declare function addContext(props?: any, context?: any): any;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.addContext = addContext;
|
7
|
+
var _excluded = ["context"];
|
8
|
+
|
9
|
+
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; }
|
10
|
+
|
11
|
+
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; }
|
12
|
+
|
13
|
+
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; }
|
14
|
+
|
15
|
+
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; }
|
16
|
+
|
17
|
+
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; }
|
18
|
+
|
19
|
+
function addContext(props, context) {
|
20
|
+
if (!props) {
|
21
|
+
return {
|
22
|
+
context: context
|
23
|
+
};
|
24
|
+
}
|
25
|
+
|
26
|
+
var propsContext = props.context,
|
27
|
+
others = _objectWithoutProperties(props, _excluded);
|
28
|
+
|
29
|
+
var mergedContext = Object.assign({}, propsContext, context);
|
30
|
+
return _objectSpread({
|
31
|
+
context: mergedContext
|
32
|
+
}, others);
|
33
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ProCardProps } from './index';
|
3
|
+
/**
|
4
|
+
* @deprecated 建议使用 ProCardProps 代替
|
5
|
+
*/
|
6
|
+
export declare type ProCardContainerProps = ProCardProps;
|
7
|
+
/**
|
8
|
+
* @deprecated 建议使用 ProCard 代替
|
9
|
+
*/
|
10
|
+
export declare const ProCardContainer: React.FC<ProCardContainerProps>;
|
11
|
+
/**
|
12
|
+
* @deprecated 建议使用 ProCardContainer 代替
|
13
|
+
*/
|
14
|
+
export declare const CardContainer: React.FC<ProCardProps>;
|
15
|
+
/**
|
16
|
+
* @deprecated 建议使用 ProCardContainerProps 代替
|
17
|
+
*/
|
18
|
+
export declare type CardContainerProps = ProCardContainerProps;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.ProCardContainer = exports.CardContainer = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _index = require("./index");
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
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; }
|
15
|
+
|
16
|
+
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; }
|
17
|
+
|
18
|
+
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; }
|
19
|
+
|
20
|
+
/**
|
21
|
+
* @deprecated 建议使用 ProCard 代替
|
22
|
+
*/
|
23
|
+
var ProCardContainer = function ProCardContainer(props) {
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_index.ProCard, _objectSpread({}, props));
|
25
|
+
};
|
26
|
+
|
27
|
+
exports.ProCardContainer = ProCardContainer;
|
28
|
+
ProCardContainer.defaultProps = {
|
29
|
+
compacted: true,
|
30
|
+
direction: 'column'
|
31
|
+
};
|
32
|
+
/**
|
33
|
+
* @deprecated 建议使用 ProCardContainer 代替
|
34
|
+
*/
|
35
|
+
|
36
|
+
var CardContainer = ProCardContainer;
|
37
|
+
exports.CardContainer = CardContainer;
|
@@ -0,0 +1,26 @@
|
|
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
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
+
|
12
|
+
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; }
|
13
|
+
|
14
|
+
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; }
|
15
|
+
|
16
|
+
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; }
|
17
|
+
|
18
|
+
var ProCardDivider = function ProCardDivider(props) {
|
19
|
+
return /*#__PURE__*/_react.default.createElement("div", _objectSpread({
|
20
|
+
className: "teamix-pro-card-divider"
|
21
|
+
}, props));
|
22
|
+
};
|
23
|
+
|
24
|
+
ProCardDivider.isProCardDivider = true;
|
25
|
+
var _default = ProCardDivider;
|
26
|
+
exports.default = _default;
|
package/lib/card/index.d.ts
CHANGED
@@ -1,59 +1,86 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import { ProActionGroupProps } from '../actions';
|
3
3
|
import './index.scss';
|
4
|
-
export
|
5
|
-
|
6
|
-
spacing?: [number, number] | number;
|
7
|
-
wrap?: boolean;
|
8
|
-
} & React.HTMLAttributes<HTMLElement>;
|
9
|
-
export declare const ProCardContainer: React.FC<ProCardContainerProps>;
|
10
|
-
export interface ProCardProps {
|
4
|
+
export * from './card-container';
|
5
|
+
export interface ProCardProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
11
6
|
/** 内容部分 */
|
12
7
|
children?: React.ReactNode;
|
13
8
|
/**卡片标题 */
|
14
9
|
title?: React.ReactNode;
|
15
10
|
/**卡片副标题 */
|
16
11
|
subTitle?: React.ReactNode;
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
/** 标题右侧图标 hover 提示信息 */
|
13
|
+
tooltip?: React.ReactNode;
|
14
|
+
/** 标题右侧图标 */
|
15
|
+
tooltipIcon?: React.ReactNode;
|
16
|
+
/** 标题右侧描述 */
|
17
|
+
description?: React.ReactNode;
|
18
|
+
/** 额外信息区域,位于卡片右上角,可以配置一些常用轻量操作 */
|
19
|
+
extra?: React.ReactNode | ProActionGroupProps;
|
20
|
+
/** 卡片操作区域,位于卡片最下方,可以配置一些常用轻量操作 */
|
21
|
+
actions?: React.ReactNode | ProActionGroupProps;
|
22
|
+
/** 卡片背景图 */
|
20
23
|
image?: string;
|
21
|
-
|
24
|
+
/** 卡片标题下方是否有分割线 */
|
22
25
|
divider?: boolean;
|
23
|
-
|
26
|
+
/** 卡片是否有边框 */
|
24
27
|
bordered?: boolean;
|
25
|
-
|
28
|
+
/**
|
29
|
+
* @deprecated 已经没有这个效果了,将在下一个 minor 版本移除
|
30
|
+
*/
|
26
31
|
hoveredShadow?: boolean;
|
27
|
-
|
32
|
+
/** 卡片是否为紧凑模式,紧凑模式下卡片没有内边距和边框 */
|
28
33
|
compacted?: boolean;
|
29
|
-
|
34
|
+
/** 卡片内容是否居中展示 */
|
30
35
|
centered?: boolean;
|
31
|
-
|
36
|
+
/** 加载中状态 */
|
32
37
|
loading?: boolean;
|
33
|
-
|
38
|
+
/** 背景色 */
|
34
39
|
backgroundColor?: 'blue' | 'green' | 'red' | 'orange' | 'yellow' | 'grey' | 'transparent';
|
35
|
-
|
40
|
+
/** 内容区栅格排列 flex 方向,仅仅在卡片嵌套模式下生效 */
|
41
|
+
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
42
|
+
/** 内容区栅格的间距,仅仅在卡片嵌套模式下生效 */
|
43
|
+
spacing?: [number, number] | number;
|
44
|
+
/** 内容区栅格超出部分是否换行展示,仅仅在卡片嵌套模式下生效 */
|
45
|
+
wrap?: boolean;
|
46
|
+
/** 卡片嵌套使用的模式下,子卡片分隔 */
|
47
|
+
split?: 'horizontal' | 'vertical';
|
48
|
+
/** 卡片嵌套使用的模式下,卡片占父卡片内容区域的栅格数量 */
|
36
49
|
col?: number | string;
|
37
|
-
|
50
|
+
/** 卡片是否可折叠 */
|
51
|
+
collapsible?: boolean;
|
52
|
+
/** 默认是否折叠,用于非受控模式 */
|
53
|
+
defaultCollapsed?: boolean;
|
54
|
+
/** 是否折叠,受控模式 */
|
55
|
+
collapsed?: boolean;
|
56
|
+
/** 折叠状态改变的回调函数 */
|
57
|
+
onCollapse?: (collapsed: boolean) => void;
|
58
|
+
/** 卡片 class */
|
38
59
|
className?: string;
|
39
|
-
|
60
|
+
/** 卡片样式 */
|
40
61
|
style?: React.CSSProperties;
|
41
|
-
|
62
|
+
/** 卡片内容 class */
|
42
63
|
contentClassName?: string;
|
43
|
-
|
64
|
+
/** 卡片内容样式 */
|
44
65
|
contentStyle?: React.CSSProperties;
|
66
|
+
/** 上下文 */
|
67
|
+
context?: any;
|
45
68
|
}
|
46
|
-
declare const ProCard:
|
69
|
+
export declare const ProCard: {
|
70
|
+
(props: ProCardProps): JSX.Element;
|
71
|
+
defaultProps: {
|
72
|
+
bordered: boolean;
|
73
|
+
spacing: number;
|
74
|
+
direction: string;
|
75
|
+
};
|
76
|
+
Divider: {
|
77
|
+
(props: React.HTMLAttributes<HTMLElement>): JSX.Element;
|
78
|
+
isProCardDivider: boolean;
|
79
|
+
};
|
80
|
+
isProCard: boolean;
|
81
|
+
};
|
47
82
|
export default ProCard;
|
48
|
-
/**
|
49
|
-
* @deprecated 建议使用 ProCardContainer 代替
|
50
|
-
*/
|
51
|
-
export declare const CardContainer: React.FC<ProCardContainerProps>;
|
52
83
|
/**
|
53
84
|
* @deprecated 建议使用 ProCardProps 代替
|
54
85
|
*/
|
55
86
|
export declare type CardProps = ProCardProps;
|
56
|
-
/**
|
57
|
-
* @deprecated 建议使用 ProCardContainerProps 代替
|
58
|
-
*/
|
59
|
-
export declare type CardContainerProps = ProCardContainerProps;
|