@yuntijs/ui 1.0.0-beta.9 → 1.0.0-beta.91
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/es/App/index.d.ts +7 -0
- package/es/App/index.js +19 -0
- package/es/ButtonGroup/index.d.ts +24 -0
- package/es/ButtonGroup/index.js +66 -0
- package/es/Card/index.d.ts +1 -0
- package/es/Card/index.js +1 -0
- package/es/CardList/Item/index.d.ts +4 -0
- package/es/CardList/Item/index.js +43 -0
- package/es/CardList/Item/style.d.ts +0 -0
- package/es/CardList/Item/style.js +0 -0
- package/es/CardList/index.d.ts +2 -0
- package/es/CardList/index.js +39 -0
- package/es/ChatInputArea/desktop/ChatInputArea.d.ts +19 -0
- package/es/ChatInputArea/desktop/ChatInputArea.js +72 -0
- package/es/ChatInputArea/index.d.ts +6 -0
- package/es/ChatInputArea/index.js +6 -0
- package/es/ChatItem/components/Actions.d.ts +10 -0
- package/es/ChatItem/components/Actions.js +23 -0
- package/es/ChatItem/components/MessageContent.d.ts +21 -0
- package/es/ChatItem/components/MessageContent.js +59 -0
- package/es/ChatItem/index.d.ts +4 -0
- package/es/ChatItem/index.js +120 -0
- package/es/ChatItem/style.d.ts +25 -0
- package/es/ChatItem/style.js +39 -0
- package/es/ChatItem/type.d.ts +86 -0
- package/es/ChatItem/type.js +1 -0
- package/es/CollapseGroup/index.d.ts +4 -0
- package/es/CollapseGroup/index.js +23 -0
- package/es/CollapseGroup/style.d.ts +3 -0
- package/es/CollapseGroup/style.js +11 -0
- package/es/ConfigProvider/index.d.ts +3 -0
- package/es/ConfigProvider/index.js +17 -11
- package/es/Descriptions/index.d.ts +14 -0
- package/es/Descriptions/index.js +31 -0
- package/es/Descriptions/style.d.ts +4 -0
- package/es/Descriptions/style.js +24 -0
- package/es/Divider/index.d.ts +38 -0
- package/es/Divider/index.js +66 -0
- package/es/Divider/style.d.ts +3 -0
- package/es/Divider/style.js +12 -0
- package/es/DragPanel/index.d.ts +10 -0
- package/es/DragPanel/index.js +97 -0
- package/es/DragPanel/style.d.ts +7 -0
- package/es/DragPanel/style.js +15 -0
- package/es/Drawer/index.d.ts +13 -0
- package/es/Drawer/index.js +20 -0
- package/es/Drawer/style.d.ts +4 -0
- package/es/Drawer/style.js +16 -0
- package/es/Dropdown/index.d.ts +14 -0
- package/es/Dropdown/index.js +59 -0
- package/es/Dropdown/style.d.ts +7 -0
- package/es/Dropdown/style.js +13 -0
- package/es/EditableMessage/index.d.ts +75 -0
- package/es/EditableMessage/index.js +99 -0
- package/es/Form/collapse-list/index.d.ts +40 -0
- package/es/Form/collapse-list/index.js +209 -0
- package/es/Form/collapse-list/style.d.ts +5 -0
- package/es/Form/collapse-list/style.js +13 -0
- package/es/Form/index.d.ts +8 -0
- package/es/Form/index.js +5 -0
- package/es/FormHelper/autoFocus.d.ts +10 -0
- package/es/FormHelper/autoFocus.js +38 -0
- package/es/FormHelper/index.d.ts +13 -0
- package/es/FormHelper/index.js +41 -0
- package/es/Highlighter/FullFeatured.d.ts +18 -0
- package/es/Highlighter/FullFeatured.js +102 -0
- package/es/Highlighter/SyntaxHighlighter/index.d.ts +7 -0
- package/es/Highlighter/SyntaxHighlighter/index.js +51 -0
- package/es/Highlighter/SyntaxHighlighter/style.d.ts +5 -0
- package/es/Highlighter/SyntaxHighlighter/style.js +16 -0
- package/es/Highlighter/index.d.ts +50 -0
- package/es/Highlighter/index.js +77 -0
- package/es/Highlighter/style.d.ts +9 -0
- package/es/Highlighter/style.js +23 -0
- package/es/Highlighter/theme.d.ts +1 -0
- package/es/Highlighter/theme.js +1661 -0
- package/es/JsonViewer/index.d.ts +21 -0
- package/es/JsonViewer/index.js +121 -0
- package/es/JsonViewer/style.d.ts +7 -0
- package/es/JsonViewer/style.js +19 -0
- package/es/LogViewer/index.d.ts +10 -0
- package/es/LogViewer/index.js +141 -0
- package/es/LogViewer/style.d.ts +6 -0
- package/es/LogViewer/style.js +16 -0
- package/es/LogViewer/types.d.ts +235 -0
- package/es/LogViewer/types.js +1 -0
- package/es/Mentions/constants.d.ts +6 -0
- package/es/Mentions/constants.js +28 -0
- package/es/Mentions/hooks.d.ts +20 -0
- package/es/Mentions/hooks.js +133 -0
- package/es/Mentions/index.d.ts +23 -0
- package/es/Mentions/index.js +157 -0
- package/es/Mentions/plugins/OnBlurBlockPlugin.d.ts +7 -0
- package/es/Mentions/plugins/OnBlurBlockPlugin.js +35 -0
- package/es/Mentions/plugins/custom-text/node.d.ts +11 -0
- package/es/Mentions/plugins/custom-text/node.js +72 -0
- package/es/Mentions/plugins/editable.d.ts +4 -0
- package/es/Mentions/plugins/editable.js +13 -0
- package/es/Mentions/plugins/mention-node/component.d.ts +6 -0
- package/es/Mentions/plugins/mention-node/component.js +64 -0
- package/es/Mentions/plugins/mention-node/index.d.ts +9 -0
- package/es/Mentions/plugins/mention-node/index.js +32 -0
- package/es/Mentions/plugins/mention-node/node.d.ts +22 -0
- package/es/Mentions/plugins/mention-node/node.js +100 -0
- package/es/Mentions/plugins/mention-node/replacement.d.ts +5 -0
- package/es/Mentions/plugins/mention-node/replacement.js +43 -0
- package/es/Mentions/plugins/mention-node/style.d.ts +8 -0
- package/es/Mentions/plugins/mention-node/style.js +47 -0
- package/es/Mentions/plugins/mention-node/utils.d.ts +4 -0
- package/es/Mentions/plugins/mention-node/utils.js +10 -0
- package/es/Mentions/plugins/mention-picker/hooks.d.ts +5 -0
- package/es/Mentions/plugins/mention-picker/hooks.js +65 -0
- package/es/Mentions/plugins/mention-picker/index.d.ts +39 -0
- package/es/Mentions/plugins/mention-picker/index.js +137 -0
- package/es/Mentions/plugins/mention-picker/menu-item.d.ts +12 -0
- package/es/Mentions/plugins/mention-picker/menu-item.js +73 -0
- package/es/Mentions/plugins/mention-picker/menu.d.ts +10 -0
- package/es/Mentions/plugins/mention-picker/menu.js +31 -0
- package/es/Mentions/plugins/mention-picker/style.d.ts +11 -0
- package/es/Mentions/plugins/mention-picker/style.js +19 -0
- package/es/Mentions/plugins/mention-picker/utils.d.ts +31 -0
- package/es/Mentions/plugins/mention-picker/utils.js +66 -0
- package/es/Mentions/provider.d.ts +12 -0
- package/es/Mentions/provider.js +15 -0
- package/es/Mentions/style.d.ts +11 -0
- package/es/Mentions/style.js +22 -0
- package/es/Mentions/types.d.ts +12 -0
- package/es/Mentions/types.js +1 -0
- package/es/Mentions/utils.d.ts +9 -0
- package/es/Mentions/utils.js +95 -0
- package/es/Modal/index.d.ts +19 -0
- package/es/Modal/index.js +36 -0
- package/es/Modal/style.d.ts +4 -0
- package/es/Modal/style.js +17 -0
- package/es/MonacoEditor/base/controller.d.ts +17 -0
- package/es/MonacoEditor/base/controller.js +49 -0
- package/es/MonacoEditor/base/helper.d.ts +65 -0
- package/es/MonacoEditor/base/helper.js +324 -0
- package/es/MonacoEditor/base/index.d.ts +39 -0
- package/es/MonacoEditor/base/index.js +238 -0
- package/es/MonacoEditor/base/monaco.d.ts +6 -0
- package/es/MonacoEditor/base/monaco.js +64 -0
- package/es/MonacoEditor/{style.d.ts → base/style.d.ts} +4 -1
- package/es/MonacoEditor/base/style.js +43 -0
- package/es/MonacoEditor/index.d.ts +5 -4
- package/es/MonacoEditor/index.js +26 -62
- package/es/Page/Breadcrumb/index.d.ts +9 -0
- package/es/Page/Breadcrumb/index.js +56 -0
- package/es/Page/Content/index.d.ts +4 -0
- package/es/Page/Content/index.js +59 -0
- package/es/Page/Content/style.d.ts +3 -0
- package/es/Page/Content/style.js +12 -0
- package/es/Page/Footer/index.d.ts +2 -0
- package/es/Page/Footer/index.js +6 -0
- package/es/Page/Header/Icon.d.ts +17 -0
- package/es/Page/Header/Icon.js +42 -0
- package/es/Page/Header/index.d.ts +43 -0
- package/es/Page/Header/index.js +202 -0
- package/es/Page/Header/style.d.ts +12 -0
- package/es/Page/Header/style.js +21 -0
- package/es/Page/Page.d.ts +9 -0
- package/es/Page/Page.js +49 -0
- package/es/Page/PageContext.d.ts +15 -0
- package/es/Page/PageContext.js +21 -0
- package/es/Page/Title/index.d.ts +5 -0
- package/es/Page/Title/index.js +18 -0
- package/es/Page/Title/style.d.ts +3 -0
- package/es/Page/Title/style.js +10 -0
- package/es/Page/index.d.ts +18 -0
- package/es/Page/index.js +15 -0
- package/es/Page/style.d.ts +3 -0
- package/es/Page/style.js +10 -0
- package/es/ProCard/Card/index.d.ts +6 -0
- package/es/ProCard/Card/index.js +25 -0
- package/es/ProCard/Card/style.d.ts +7 -0
- package/es/ProCard/Card/style.js +15 -0
- package/es/ProCard/Content/index.d.ts +4 -0
- package/es/ProCard/Content/index.js +24 -0
- package/es/ProCard/Content/style.d.ts +3 -0
- package/es/ProCard/Content/style.js +10 -0
- package/es/ProCard/Descriptions/index.d.ts +4 -0
- package/es/ProCard/Descriptions/index.js +28 -0
- package/es/ProCard/Descriptions/style.d.ts +3 -0
- package/es/ProCard/Descriptions/style.js +12 -0
- package/es/ProCard/Header/index.d.ts +15 -0
- package/es/ProCard/Header/index.js +86 -0
- package/es/ProCard/Header/style.d.ts +12 -0
- package/es/ProCard/Header/style.js +21 -0
- package/es/ProCard/index.d.ts +13 -0
- package/es/ProCard/index.js +8 -0
- package/es/SelectCard/index.d.ts +33 -0
- package/es/SelectCard/index.js +132 -0
- package/es/SelectCard/style.d.ts +10 -0
- package/es/SelectCard/style.js +42 -0
- package/es/SliderInput/index.js +2 -2
- package/es/Status/index.d.ts +7 -0
- package/es/Status/index.js +39 -0
- package/es/Status/style.d.ts +4 -0
- package/es/Status/style.js +14 -0
- package/es/Table/collapse/index.d.ts +9 -0
- package/es/Table/collapse/index.js +39 -0
- package/es/Table/collapse/style.d.ts +3 -0
- package/es/Table/collapse/style.js +11 -0
- package/es/Table/index.d.ts +20 -0
- package/es/Table/index.js +56 -0
- package/es/Typography/index.d.ts +32 -0
- package/es/Typography/index.js +77 -0
- package/es/WaveformIcon/index.d.ts +9 -0
- package/es/WaveformIcon/index.js +51 -0
- package/es/hooks/languageMap.d.ts +1 -0
- package/es/hooks/languageMap.js +1 -0
- package/es/hooks/useHighlight.d.ts +5 -0
- package/es/hooks/useHighlight.js +78 -0
- package/es/index.d.ts +38 -3
- package/es/index.js +48 -3
- package/es/notification/index.d.ts +24 -0
- package/es/notification/index.js +237 -0
- package/es/notification/style.d.ts +2 -0
- package/es/notification/style.js +28 -0
- package/es/styles/colors/colors.d.ts +39 -0
- package/es/styles/colors/colors.js +86 -0
- package/es/styles/colors/generateColorPalette.d.ts +11 -0
- package/es/styles/colors/generateColorPalette.js +31 -0
- package/es/styles/colors/neutralColors.d.ts +9 -0
- package/es/styles/colors/neutralColors.js +32 -0
- package/es/styles/index.d.ts +4 -0
- package/es/styles/index.js +4 -0
- package/es/useSpeechSynthes/const/polyfill.d.ts +3 -0
- package/es/useSpeechSynthes/const/polyfill.js +21 -0
- package/es/useSpeechSynthes/index.d.ts +13 -0
- package/es/useSpeechSynthes/index.js +69 -0
- package/es/utils/constants.d.ts +1 -0
- package/es/utils/constants.js +1 -0
- package/es/utils/tools.d.ts +1 -0
- package/es/utils/tools.js +1 -0
- package/package.json +31 -9
- package/umd/index.min.css +2 -0
- package/umd/index.min.css.map +1 -0
- package/umd/index.min.js +1 -1
- package/umd/index.min.js.map +1 -1
- package/es/MonacoEditor/style.js +0 -24
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["className", "classNames", "icon", "title", "titleRender", "subTitle", "status", "descriptions", "descriptionsRender", "extraContent", "extraContentRender", "bordered", "divider"];
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
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; }
|
|
10
|
+
import { Flex, Skeleton, Tooltip } from 'antd';
|
|
11
|
+
import React, { useContext, useMemo } from 'react';
|
|
12
|
+
import { ButtonGroup } from "../../ButtonGroup";
|
|
13
|
+
import Divider from "../../Divider";
|
|
14
|
+
import { Status } from "../../Status";
|
|
15
|
+
import Typography from "../../Typography";
|
|
16
|
+
import { PageContext } from "../PageContext";
|
|
17
|
+
import { HeaderIcon, getIconSize } from "./Icon";
|
|
18
|
+
import { useStyles } from "./style";
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
var Paragraph = Typography.Paragraph;
|
|
22
|
+
export var PageHeader = function PageHeader(props) {
|
|
23
|
+
var className = props.className,
|
|
24
|
+
classNames = props.classNames,
|
|
25
|
+
icon = props.icon,
|
|
26
|
+
title = props.title,
|
|
27
|
+
titleRender = props.titleRender,
|
|
28
|
+
subTitle = props.subTitle,
|
|
29
|
+
status = props.status,
|
|
30
|
+
_props$descriptions = props.descriptions,
|
|
31
|
+
descriptions = _props$descriptions === void 0 ? [] : _props$descriptions,
|
|
32
|
+
descriptionsRender = props.descriptionsRender,
|
|
33
|
+
_props$extraContent = props.extraContent,
|
|
34
|
+
extraContent = _props$extraContent === void 0 ? {} : _props$extraContent,
|
|
35
|
+
extraContentRender = props.extraContentRender,
|
|
36
|
+
bordered = props.bordered,
|
|
37
|
+
divider = props.divider,
|
|
38
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
39
|
+
var _useStyles = useStyles({
|
|
40
|
+
bordered: bordered,
|
|
41
|
+
divider: divider
|
|
42
|
+
}),
|
|
43
|
+
styles = _useStyles.styles,
|
|
44
|
+
cx = _useStyles.cx;
|
|
45
|
+
var iconProps = useMemo(function () {
|
|
46
|
+
if (!icon || typeof icon === 'string') {
|
|
47
|
+
return {
|
|
48
|
+
src: icon,
|
|
49
|
+
size: subTitle ? 'large' : 'default'
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (subTitle && icon.size === undefined) {
|
|
53
|
+
icon.size = 'large';
|
|
54
|
+
}
|
|
55
|
+
return icon;
|
|
56
|
+
}, [icon, subTitle]);
|
|
57
|
+
var TitleNode = useMemo(function () {
|
|
58
|
+
var titleElement = /*#__PURE__*/_jsx("span", {
|
|
59
|
+
className: cx(styles.title, classNames === null || classNames === void 0 ? void 0 : classNames.title),
|
|
60
|
+
children: title
|
|
61
|
+
});
|
|
62
|
+
if (titleRender) {
|
|
63
|
+
return titleRender(titleElement);
|
|
64
|
+
}
|
|
65
|
+
return titleElement;
|
|
66
|
+
}, [classNames === null || classNames === void 0 ? void 0 : classNames.title, cx, styles.title, title, titleRender]);
|
|
67
|
+
var DescriptionsNode = useMemo(function () {
|
|
68
|
+
var descriptionsElement = [];
|
|
69
|
+
var _iterator = _createForOfIteratorHelper(descriptions.filter(function (d) {
|
|
70
|
+
return !!d;
|
|
71
|
+
}).entries()),
|
|
72
|
+
_step;
|
|
73
|
+
try {
|
|
74
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
75
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
76
|
+
index = _step$value[0],
|
|
77
|
+
desc = _step$value[1];
|
|
78
|
+
var descIcon = desc.icon,
|
|
79
|
+
text = desc.text;
|
|
80
|
+
if (status || index >= 1) {
|
|
81
|
+
descriptionsElement.push( /*#__PURE__*/_jsx(Divider, {
|
|
82
|
+
dashed: false,
|
|
83
|
+
type: "vertical"
|
|
84
|
+
}, "divider-".concat(index)));
|
|
85
|
+
}
|
|
86
|
+
descriptionsElement.push( /*#__PURE__*/_jsxs(Flex, {
|
|
87
|
+
align: "center",
|
|
88
|
+
gap: 4,
|
|
89
|
+
children: [descIcon && /*#__PURE__*/_jsx(Tooltip, {
|
|
90
|
+
title: descIcon.tooltip,
|
|
91
|
+
children: descIcon.content
|
|
92
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
93
|
+
children: text
|
|
94
|
+
})]
|
|
95
|
+
}, "desc-".concat(index)));
|
|
96
|
+
}
|
|
97
|
+
} catch (err) {
|
|
98
|
+
_iterator.e(err);
|
|
99
|
+
} finally {
|
|
100
|
+
_iterator.f();
|
|
101
|
+
}
|
|
102
|
+
if (descriptionsRender) {
|
|
103
|
+
return descriptionsRender(descriptionsElement);
|
|
104
|
+
}
|
|
105
|
+
return descriptionsElement;
|
|
106
|
+
}, [descriptions, descriptionsRender, status]);
|
|
107
|
+
var ExtraContentNode = useMemo(function () {
|
|
108
|
+
if (!extraContent && !extraContentRender) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
var buttons = /*#__PURE__*/_jsx(ButtonGroup, _objectSpread({
|
|
112
|
+
className: styles.rightButtons
|
|
113
|
+
}, extraContent));
|
|
114
|
+
if (extraContentRender) {
|
|
115
|
+
return extraContentRender(buttons);
|
|
116
|
+
}
|
|
117
|
+
return buttons;
|
|
118
|
+
}, [extraContent, extraContentRender, styles.rightButtons]);
|
|
119
|
+
var _useContext = useContext(PageContext),
|
|
120
|
+
loading = _useContext.loading,
|
|
121
|
+
pageStatus = _useContext.status;
|
|
122
|
+
if (loading) {
|
|
123
|
+
return /*#__PURE__*/_jsxs(Flex, {
|
|
124
|
+
className: cx(styles.root, className),
|
|
125
|
+
gap: 20,
|
|
126
|
+
children: [/*#__PURE__*/_jsx(Flex, {
|
|
127
|
+
children: /*#__PURE__*/_jsx(Skeleton.Avatar, {
|
|
128
|
+
active: true,
|
|
129
|
+
className: styles.icon,
|
|
130
|
+
shape: iconProps === null || iconProps === void 0 ? void 0 : iconProps.shape,
|
|
131
|
+
size: getIconSize(iconProps === null || iconProps === void 0 ? void 0 : iconProps.size)
|
|
132
|
+
})
|
|
133
|
+
}), /*#__PURE__*/_jsxs(Flex, {
|
|
134
|
+
flex: "2",
|
|
135
|
+
justify: "space-between",
|
|
136
|
+
vertical: true,
|
|
137
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
138
|
+
className: styles.titleBox,
|
|
139
|
+
children: [/*#__PURE__*/_jsx(Skeleton.Input, {
|
|
140
|
+
active: true,
|
|
141
|
+
size: 25
|
|
142
|
+
}), subTitle && /*#__PURE__*/_jsx("div", {
|
|
143
|
+
className: cx(styles.subTitle, className),
|
|
144
|
+
children: /*#__PURE__*/_jsx(Skeleton.Input, {
|
|
145
|
+
active: true,
|
|
146
|
+
size: 18
|
|
147
|
+
})
|
|
148
|
+
})]
|
|
149
|
+
}), /*#__PURE__*/_jsx(Skeleton.Input, {
|
|
150
|
+
active: true,
|
|
151
|
+
size: 18
|
|
152
|
+
})]
|
|
153
|
+
}), /*#__PURE__*/_jsx(Flex, {
|
|
154
|
+
align: "center",
|
|
155
|
+
flex: "0 0 140px",
|
|
156
|
+
justify: "flex-end",
|
|
157
|
+
children: /*#__PURE__*/_jsx(Skeleton.Button, {
|
|
158
|
+
active: true
|
|
159
|
+
})
|
|
160
|
+
})]
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (pageStatus) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
return /*#__PURE__*/_jsxs(Flex, _objectSpread(_objectSpread({
|
|
167
|
+
className: cx(styles.root, className),
|
|
168
|
+
gap: 20
|
|
169
|
+
}, otherProps), {}, {
|
|
170
|
+
children: [iconProps && /*#__PURE__*/_jsx(Flex, {
|
|
171
|
+
children: /*#__PURE__*/_jsx(HeaderIcon, _objectSpread({
|
|
172
|
+
className: styles.icon
|
|
173
|
+
}, iconProps))
|
|
174
|
+
}), /*#__PURE__*/_jsxs(Flex, {
|
|
175
|
+
flex: "2",
|
|
176
|
+
justify: "space-between",
|
|
177
|
+
vertical: true,
|
|
178
|
+
children: [/*#__PURE__*/_jsxs(Flex, {
|
|
179
|
+
className: cx(styles.titleBox, classNames === null || classNames === void 0 ? void 0 : classNames.titleWrapper),
|
|
180
|
+
vertical: true,
|
|
181
|
+
children: [TitleNode, subTitle && /*#__PURE__*/_jsx(Paragraph, {
|
|
182
|
+
className: cx(styles.subTitle, classNames === null || classNames === void 0 ? void 0 : classNames.subTitle),
|
|
183
|
+
ellipsis: {
|
|
184
|
+
rows: 2
|
|
185
|
+
},
|
|
186
|
+
children: subTitle
|
|
187
|
+
})]
|
|
188
|
+
}), /*#__PURE__*/_jsxs(Flex, {
|
|
189
|
+
align: "center",
|
|
190
|
+
className: cx(styles.descriptions, classNames === null || classNames === void 0 ? void 0 : classNames.descriptions),
|
|
191
|
+
gap: 4,
|
|
192
|
+
children: [status && /*#__PURE__*/_jsx(Status, _objectSpread({}, status)), DescriptionsNode]
|
|
193
|
+
})]
|
|
194
|
+
}), /*#__PURE__*/_jsx(Flex, {
|
|
195
|
+
align: "center",
|
|
196
|
+
className: classNames === null || classNames === void 0 ? void 0 : classNames.extraContent,
|
|
197
|
+
flex: "1",
|
|
198
|
+
justify: "flex-end",
|
|
199
|
+
children: ExtraContentNode
|
|
200
|
+
})]
|
|
201
|
+
}));
|
|
202
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const useStyles: (props?: {
|
|
2
|
+
bordered?: boolean | undefined;
|
|
3
|
+
divider?: boolean | undefined;
|
|
4
|
+
} | undefined) => import("antd-style").ReturnStyles<{
|
|
5
|
+
root: import("antd-style").SerializedStyles;
|
|
6
|
+
icon: import("antd-style").SerializedStyles;
|
|
7
|
+
titleBox: import("antd-style").SerializedStyles;
|
|
8
|
+
subTitle: import("antd-style").SerializedStyles;
|
|
9
|
+
title: import("antd-style").SerializedStyles;
|
|
10
|
+
descriptions: import("antd-style").SerializedStyles;
|
|
11
|
+
rightButtons: import("antd-style").SerializedStyles;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
token = _ref.token,
|
|
7
|
+
prefixCls = _ref.prefixCls;
|
|
8
|
+
var _ref2$bordered = _ref2.bordered,
|
|
9
|
+
bordered = _ref2$bordered === void 0 ? false : _ref2$bordered,
|
|
10
|
+
_ref2$divider = _ref2.divider,
|
|
11
|
+
divider = _ref2$divider === void 0 ? true : _ref2$divider;
|
|
12
|
+
return {
|
|
13
|
+
root: bordered ? css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-bottom: ", "px;\n padding: ", "px;\n\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n "])), token.marginXS, token.padding, token.colorBgBase, token.borderRadius, token.boxShadowTertiary) : css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-top: ", "px;\n margin-bottom: ", "px;\n ", "\n "])), token.paddingXS, token.marginXS, divider && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding-bottom: ", "px;\n border-bottom: 1px solid ", ";\n "])), token.paddingLG, token.colorSplit)),
|
|
14
|
+
icon: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n &.", "-avatar.", "-avatar-square {\n color: ", ";\n border-radius: 10px;\n }\n .", "-skeleton-avatar {\n border-radius: 10px;\n }\n "])), prefixCls, prefixCls, token.colorPrimary, prefixCls),
|
|
15
|
+
titleBox: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-bottom: ", "px;\n "])), token.marginSM),
|
|
16
|
+
subTitle: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-top: ", "px;\n &.", "-typography {\n margin-bottom: 0 !important;\n font-size: ", "px;\n color: ", ";\n }\n "])), token.marginXXS, prefixCls, token.fontSize, token.colorTextSecondary),
|
|
17
|
+
title: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n font-size: ", "px;\n font-weight: 700;\n "])), token.fontSizeHeading5),
|
|
18
|
+
descriptions: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-bottom: ", "px;\n font-size: ", "px;\n color: ", ";\n .", "-badge.", "-badge-status {\n font-size: ", "px;\n & > .", "-badge-status-text {\n font-size: ", "px;\n color: ", ";\n }\n }\n "])), token.marginXXS, token.fontSize, token.colorTextSecondary, prefixCls, prefixCls, token.fontSize, prefixCls, token.fontSize, token.colorTextSecondary),
|
|
19
|
+
rightButtons: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n justify-content: flex-end;\n "])))
|
|
20
|
+
};
|
|
21
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FlexProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { PageContextValue } from './PageContext';
|
|
4
|
+
export interface PageProps extends React.HTMLAttributes<HTMLDivElement>, Pick<FlexProps, 'gap'> {
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
status?: PageContextValue['status'];
|
|
7
|
+
Link?: PageContextValue['Link'];
|
|
8
|
+
}
|
|
9
|
+
export declare const Page: React.FC<PageProps>;
|
package/es/Page/Page.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["loading", "className", "children", "Link", "status", "gap"];
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
import { Flex } from 'antd';
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import { useLink } from "../ConfigProvider";
|
|
10
|
+
import { DefaultLink, PageContext } from "./PageContext";
|
|
11
|
+
import { useStyles } from "./style";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var Page = function Page(props) {
|
|
14
|
+
var LinkFromRootConfigProvider = useLink();
|
|
15
|
+
var loading = props.loading,
|
|
16
|
+
className = props.className,
|
|
17
|
+
children = props.children,
|
|
18
|
+
_props$Link = props.Link,
|
|
19
|
+
Link = _props$Link === void 0 ? LinkFromRootConfigProvider || DefaultLink : _props$Link,
|
|
20
|
+
status = props.status,
|
|
21
|
+
_props$gap = props.gap,
|
|
22
|
+
gap = _props$gap === void 0 ? 16 : _props$gap,
|
|
23
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
24
|
+
var _useStyles = useStyles(otherProps),
|
|
25
|
+
styles = _useStyles.styles,
|
|
26
|
+
cx = _useStyles.cx;
|
|
27
|
+
var _useState = useState([]),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
breadcrumbItems = _useState2[0],
|
|
30
|
+
setBreadcrumbItems = _useState2[1];
|
|
31
|
+
return /*#__PURE__*/_jsx(Flex, _objectSpread(_objectSpread({
|
|
32
|
+
className: cx(styles.root, className),
|
|
33
|
+
gap: gap,
|
|
34
|
+
vertical: true
|
|
35
|
+
}, otherProps), {}, {
|
|
36
|
+
children: /*#__PURE__*/_jsx(PageContext.Provider, {
|
|
37
|
+
value: {
|
|
38
|
+
loading: loading,
|
|
39
|
+
Link: Link,
|
|
40
|
+
breadcrumb: {
|
|
41
|
+
items: breadcrumbItems,
|
|
42
|
+
setItems: setBreadcrumbItems
|
|
43
|
+
},
|
|
44
|
+
status: status
|
|
45
|
+
},
|
|
46
|
+
children: children
|
|
47
|
+
})
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ExceptionStatusType } from 'antd/es/result';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BreadcrumbLinkProps, PageBreadcrumbProps } from './Breadcrumb';
|
|
4
|
+
export interface PageContextValue {
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
/** Link component */
|
|
7
|
+
Link: typeof React.Component | React.FC<any>;
|
|
8
|
+
breadcrumb?: {
|
|
9
|
+
items?: PageBreadcrumbProps['items'];
|
|
10
|
+
setItems?: (items?: PageBreadcrumbProps['items']) => void;
|
|
11
|
+
};
|
|
12
|
+
status?: ExceptionStatusType;
|
|
13
|
+
}
|
|
14
|
+
export declare const DefaultLink: React.FC<Omit<BreadcrumbLinkProps, 'Link'>>;
|
|
15
|
+
export declare const PageContext: React.Context<PageContextValue>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["to", "children"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import React, { createContext } from 'react';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export var DefaultLink = function DefaultLink(props) {
|
|
9
|
+
var to = props.to,
|
|
10
|
+
children = props.children,
|
|
11
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
12
|
+
return /*#__PURE__*/_jsx("a", _objectSpread(_objectSpread({
|
|
13
|
+
href: "#".concat(to)
|
|
14
|
+
}, otherProps), {}, {
|
|
15
|
+
children: children
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
export var PageContext = /*#__PURE__*/createContext({
|
|
19
|
+
loading: false,
|
|
20
|
+
Link: DefaultLink
|
|
21
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { useStyles } from "./style";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
export var PageTitle = function PageTitle(_ref) {
|
|
10
|
+
var className = _ref.className,
|
|
11
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
var _useStyles = useStyles(),
|
|
13
|
+
cx = _useStyles.cx,
|
|
14
|
+
styles = _useStyles.styles;
|
|
15
|
+
return /*#__PURE__*/_jsx("h2", _objectSpread({
|
|
16
|
+
className: cx(styles.root, className)
|
|
17
|
+
}, otherProps));
|
|
18
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
token = _ref.token;
|
|
7
|
+
return {
|
|
8
|
+
root: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0;\n\n font-family: ", ";\n font-size: 16px;\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n "])), token.fontFamily, token.fontWeightStrong, token.lineHeight, token.colorText)
|
|
9
|
+
};
|
|
10
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PageBreadcrumb } from './Breadcrumb';
|
|
3
|
+
import { PageContent } from './Content';
|
|
4
|
+
import { PageFooter } from './Footer';
|
|
5
|
+
import { PageHeader } from './Header';
|
|
6
|
+
import { PageTitle } from './Title';
|
|
7
|
+
export type { PageBreadcrumbProps } from './Breadcrumb';
|
|
8
|
+
export type { PageContentProps } from './Content';
|
|
9
|
+
export type { PageHeaderProps } from './Header';
|
|
10
|
+
export type { PageProps } from './Page';
|
|
11
|
+
export type { PageTitleProps } from './Title';
|
|
12
|
+
export declare const Page: import("react").FC<import("./Page").PageProps> & {
|
|
13
|
+
Breadcrumb: typeof PageBreadcrumb;
|
|
14
|
+
Title: typeof PageTitle;
|
|
15
|
+
Header: typeof PageHeader;
|
|
16
|
+
Content: typeof PageContent;
|
|
17
|
+
Footer: typeof PageFooter;
|
|
18
|
+
};
|
package/es/Page/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PageBreadcrumb } from "./Breadcrumb";
|
|
2
|
+
import { PageContent } from "./Content";
|
|
3
|
+
import { PageFooter } from "./Footer";
|
|
4
|
+
import { PageHeader } from "./Header";
|
|
5
|
+
import { Page as InternalPage } from "./Page";
|
|
6
|
+
import { PageTitle } from "./Title";
|
|
7
|
+
|
|
8
|
+
// export type { } from './Footer';
|
|
9
|
+
|
|
10
|
+
export var Page = InternalPage;
|
|
11
|
+
Page.Breadcrumb = PageBreadcrumb;
|
|
12
|
+
Page.Title = PageTitle;
|
|
13
|
+
Page.Header = PageHeader;
|
|
14
|
+
Page.Content = PageContent;
|
|
15
|
+
Page.Footer = PageFooter;
|
package/es/Page/style.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
token = _ref.token;
|
|
7
|
+
return {
|
|
8
|
+
root: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: inherit;\n height: 100%;\n min-height: inherit;\n padding: ", "px ", "px ", "px;\n "])), token.padding, token.paddingLG, token.paddingXL)
|
|
9
|
+
};
|
|
10
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "bordered", "hoverable", "children"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { useStyles } from "./style";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
export var ProCard = function ProCard(_ref) {
|
|
10
|
+
var className = _ref.className,
|
|
11
|
+
_ref$bordered = _ref.bordered,
|
|
12
|
+
bordered = _ref$bordered === void 0 ? false : _ref$bordered,
|
|
13
|
+
_ref$hoverable = _ref.hoverable,
|
|
14
|
+
hoverable = _ref$hoverable === void 0 ? true : _ref$hoverable,
|
|
15
|
+
children = _ref.children,
|
|
16
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
var _useStyles = useStyles(),
|
|
18
|
+
cx = _useStyles.cx,
|
|
19
|
+
styles = _useStyles.styles;
|
|
20
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
21
|
+
className: cx(styles.root, bordered && styles.bordered, hoverable && styles.hoverable, className)
|
|
22
|
+
}, otherProps), {}, {
|
|
23
|
+
children: children
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
|
+
root: import("antd-style").SerializedStyles;
|
|
3
|
+
bordered: import("antd-style").SerializedStyles;
|
|
4
|
+
hoverable: import("antd-style").SerializedStyles;
|
|
5
|
+
text: import("antd-style").SerializedStyles;
|
|
6
|
+
error: import("antd-style").SerializedStyles;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
token = _ref.token,
|
|
7
|
+
prefixCls = _ref.prefixCls;
|
|
8
|
+
return {
|
|
9
|
+
root: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n overflow: hidden;\n\n margin: 0;\n padding: 0;\n\n font-family: ", ";\n color: ", ";\n\n background: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n "])), token.fontFamily, token.colorText, token.colorBgContainer, token.borderRadius * 2, token.boxShadowTertiary),
|
|
10
|
+
bordered: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n box-shadow: none;\n "])), token.colorBorder),
|
|
11
|
+
hoverable: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n cursor: pointer;\n transition:\n box-shadow ", ",\n border-color ", ";\n &:hover {\n border-color: transparent;\n box-shadow: ", ";\n }\n "])), token.motionDurationMid, token.motionDurationMid, token.boxShadow),
|
|
12
|
+
text: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: inline-block;\n\n max-width: 200px;\n\n color: ", ";\n text-overflow: ellipsis;\n white-space: nowrap;\n "])), token.colorTextSecondary),
|
|
13
|
+
error: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorErrorText)
|
|
14
|
+
};
|
|
15
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "children"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import { Flex } from 'antd';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { useStyles } from "./style";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export var ProCardContent = function ProCardContent(props) {
|
|
11
|
+
var className = props.className,
|
|
12
|
+
children = props.children,
|
|
13
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
14
|
+
var _useStyles = useStyles(),
|
|
15
|
+
styles = _useStyles.styles,
|
|
16
|
+
cx = _useStyles.cx;
|
|
17
|
+
return /*#__PURE__*/_jsx(Flex, _objectSpread(_objectSpread({
|
|
18
|
+
className: cx(styles.root, className),
|
|
19
|
+
gap: 20,
|
|
20
|
+
vertical: true
|
|
21
|
+
}, otherProps), {}, {
|
|
22
|
+
children: children
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
token = _ref.token;
|
|
7
|
+
return {
|
|
8
|
+
root: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 12px 24px 20px;\n "])))
|
|
9
|
+
};
|
|
10
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "colon", "column", "size"];
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import Descriptions from "../../Descriptions";
|
|
8
|
+
import { useStyles } from "./style";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export var ProCardDescriptions = function ProCardDescriptions(_ref) {
|
|
11
|
+
var className = _ref.className,
|
|
12
|
+
_ref$colon = _ref.colon,
|
|
13
|
+
colon = _ref$colon === void 0 ? false : _ref$colon,
|
|
14
|
+
_ref$column = _ref.column,
|
|
15
|
+
column = _ref$column === void 0 ? 2 : _ref$column,
|
|
16
|
+
_ref$size = _ref.size,
|
|
17
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
18
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var _useStyles = useStyles(),
|
|
20
|
+
cx = _useStyles.cx,
|
|
21
|
+
styles = _useStyles.styles;
|
|
22
|
+
return /*#__PURE__*/_jsx(Descriptions, _objectSpread({
|
|
23
|
+
className: cx(styles.root, className),
|
|
24
|
+
colon: colon,
|
|
25
|
+
column: column,
|
|
26
|
+
size: size
|
|
27
|
+
}, otherProps));
|
|
28
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
token = _ref.token,
|
|
7
|
+
prefixCls = _ref.prefixCls;
|
|
8
|
+
var lableWidth = 70;
|
|
9
|
+
return {
|
|
10
|
+
root: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", "-descriptions {\n .", "-descriptions-row {\n & > td {\n padding-top: 4px !important;\n padding-bottom: 4px !important;\n }\n .", "-descriptions-item {\n &-container {\n .", "-descriptions-item-label {\n overflow: hidden;\n width: ", "px;\n white-space: nowrap;\n }\n .", "-descriptions-item-content {\n overflow: hidden;\n display: inline-block;\n\n width: calc(100% - ", "px);\n\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n }\n }\n }\n "])), prefixCls, prefixCls, prefixCls, prefixCls, lableWidth, prefixCls, lableWidth)
|
|
11
|
+
};
|
|
12
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AvatarProps, DropDownProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ProCardHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
|
+
/** 图标 src 路径或者详细配置 */
|
|
5
|
+
icon?: AvatarProps;
|
|
6
|
+
/** 标题 */
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
/** 描述 */
|
|
9
|
+
description?: React.ReactNode;
|
|
10
|
+
/** 右侧扩展区域 */
|
|
11
|
+
extra?: DropDownProps;
|
|
12
|
+
/** 控制 header 与 content 的分割线 */
|
|
13
|
+
divider?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const ProCardHeader: React.FC<ProCardHeaderProps>;
|