@yuntijs/ui 1.0.0-beta.6 → 1.0.0-beta.60
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/Alert/index.d.ts +13 -0
- package/es/Alert/index.js +25 -0
- package/es/Alert/style.d.ts +4 -0
- package/es/Alert/style.js +13 -0
- package/es/App/index.d.ts +7 -0
- package/es/App/index.js +19 -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/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 +24 -0
- package/es/ChatItem/style.js +38 -0
- package/es/ChatItem/type.d.ts +81 -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 +15 -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 +45 -0
- package/es/Highlighter/index.js +76 -0
- package/es/Highlighter/style.d.ts +8 -0
- package/es/Highlighter/style.js +22 -0
- package/es/Highlighter/theme.d.ts +1 -0
- package/es/Highlighter/theme.js +1661 -0
- package/es/LogViewer/index.d.ts +10 -0
- package/es/LogViewer/index.js +83 -0
- package/es/LogViewer/style.d.ts +4 -0
- package/es/LogViewer/style.js +14 -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 +19 -0
- package/es/Mentions/index.js +136 -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/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 +23 -0
- package/es/Mentions/plugins/mention-node/node.js +97 -0
- package/es/Mentions/plugins/mention-node/replacement.d.ts +5 -0
- package/es/Mentions/plugins/mention-node/replacement.js +42 -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 +5 -0
- package/es/Mentions/plugins/mention-picker/hooks.d.ts +5 -0
- package/es/Mentions/plugins/mention-picker/hooks.js +38 -0
- package/es/Mentions/plugins/mention-picker/index.d.ts +36 -0
- package/es/Mentions/plugins/mention-picker/index.js +87 -0
- package/es/Mentions/plugins/mention-picker/menu-item.d.ts +11 -0
- package/es/Mentions/plugins/mention-picker/menu-item.js +70 -0
- package/es/Mentions/plugins/mention-picker/menu.d.ts +9 -0
- package/es/Mentions/plugins/mention-picker/menu.js +30 -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 +22 -0
- package/es/Mentions/plugins/mention-picker/utils.js +39 -0
- package/es/Mentions/plugins/on-blur-or-focus-block.d.ts +7 -0
- package/es/Mentions/plugins/on-blur-or-focus-block.js +36 -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 +17 -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/assets/img/full-screen-cancel-icon.png +0 -0
- package/es/MonacoEditor/assets/img/full-screen-icon.png +0 -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 +35 -0
- package/es/MonacoEditor/base/index.js +236 -0
- package/es/MonacoEditor/base/monaco.d.ts +6 -0
- package/es/MonacoEditor/base/monaco.js +64 -0
- package/es/MonacoEditor/base/style.d.ts +12 -0
- package/es/MonacoEditor/base/style.js +26 -0
- package/es/MonacoEditor/index.d.ts +4 -2
- package/es/MonacoEditor/index.js +31 -22
- package/es/MonacoEditor/style.d.ts +10 -0
- package/es/MonacoEditor/style.js +25 -0
- 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/ButtonGroup.d.ts +16 -0
- package/es/Page/Header/ButtonGroup.js +75 -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 +35 -0
- package/es/Page/Header/index.js +200 -0
- package/es/Page/Header/style.d.ts +12 -0
- package/es/Page/Header/style.js +23 -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 +20 -0
- package/es/Page/index.js +15 -0
- package/es/Page/style.d.ts +3 -0
- package/es/Page/style.js +12 -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 +12 -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 +14 -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 +23 -0
- package/es/ProCard/index.d.ts +13 -0
- package/es/ProCard/index.js +8 -0
- package/es/Radio/index.d.ts +36 -0
- package/es/Radio/index.js +26 -0
- package/es/Radio/style.d.ts +4 -0
- package/es/Radio/style.js +66 -0
- package/es/SliderInput/index.d.ts +54 -0
- package/es/SliderInput/index.js +74 -0
- 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 +8 -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/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 +33 -1
- package/es/index.js +43 -1
- 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/typings.d.ts +1 -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 +27 -9
- package/umd/index.min.js +1 -1
- package/umd/index.min.js.map +1 -1
package/es/Page/style.js
ADDED
|
@@ -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
|
+
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
|
+
}, {
|
|
11
|
+
hashPriority: 'low'
|
|
12
|
+
});
|
|
@@ -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,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
|
+
return {
|
|
8
|
+
root: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 12px 24px 20px;\n "])))
|
|
9
|
+
};
|
|
10
|
+
}, {
|
|
11
|
+
hashPriority: 'low'
|
|
12
|
+
});
|
|
@@ -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,14 @@
|
|
|
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
|
+
}, {
|
|
13
|
+
hashPriority: 'low'
|
|
14
|
+
});
|
|
@@ -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>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "icon", "title", "description", "extra", "divider"],
|
|
4
|
+
_excluded2 = ["className", "shape", "size"],
|
|
5
|
+
_excluded3 = ["children"];
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
import { Icon } from '@lobehub/ui';
|
|
9
|
+
import { Avatar, Button, Dropdown, Flex } from 'antd';
|
|
10
|
+
import { EllipsisVertical } from 'lucide-react';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import Typography from "../../Typography";
|
|
13
|
+
import { useStyles } from "./style";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
var Paragraph = Typography.Paragraph;
|
|
17
|
+
export var ProCardHeader = function ProCardHeader(props) {
|
|
18
|
+
var className = props.className,
|
|
19
|
+
icon = props.icon,
|
|
20
|
+
title = props.title,
|
|
21
|
+
description = props.description,
|
|
22
|
+
extra = props.extra,
|
|
23
|
+
divider = props.divider,
|
|
24
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
25
|
+
var _useStyles = useStyles({
|
|
26
|
+
divider: divider,
|
|
27
|
+
iconBg: !(icon !== null && icon !== void 0 && icon.src)
|
|
28
|
+
}),
|
|
29
|
+
styles = _useStyles.styles,
|
|
30
|
+
cx = _useStyles.cx;
|
|
31
|
+
var _ref = icon || {},
|
|
32
|
+
iconClassName = _ref.className,
|
|
33
|
+
_ref$shape = _ref.shape,
|
|
34
|
+
shape = _ref$shape === void 0 ? 'square' : _ref$shape,
|
|
35
|
+
_ref$size = _ref.size,
|
|
36
|
+
size = _ref$size === void 0 ? 72 : _ref$size,
|
|
37
|
+
otherIconProps = _objectWithoutProperties(_ref, _excluded2);
|
|
38
|
+
var _ref2 = extra || {},
|
|
39
|
+
extraChildren = _ref2.children,
|
|
40
|
+
otherExtraProps = _objectWithoutProperties(_ref2, _excluded3);
|
|
41
|
+
return /*#__PURE__*/_jsxs(Flex, _objectSpread(_objectSpread({
|
|
42
|
+
className: cx(styles.root, className),
|
|
43
|
+
gap: 20
|
|
44
|
+
}, otherProps), {}, {
|
|
45
|
+
children: [icon && /*#__PURE__*/_jsx(Flex, {
|
|
46
|
+
children: /*#__PURE__*/_jsx(Avatar, _objectSpread({
|
|
47
|
+
className: cx(styles.icon, iconClassName),
|
|
48
|
+
shape: shape,
|
|
49
|
+
size: size
|
|
50
|
+
}, otherIconProps))
|
|
51
|
+
}), /*#__PURE__*/_jsxs(Flex, {
|
|
52
|
+
flex: "1",
|
|
53
|
+
vertical: true,
|
|
54
|
+
children: [/*#__PURE__*/_jsxs(Flex, {
|
|
55
|
+
className: styles.titleBox,
|
|
56
|
+
gap: 4,
|
|
57
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
58
|
+
className: styles.title,
|
|
59
|
+
children: title
|
|
60
|
+
}), extra && /*#__PURE__*/_jsx(Flex, {
|
|
61
|
+
align: "flex-start",
|
|
62
|
+
className: styles.extra,
|
|
63
|
+
justify: "flex-end",
|
|
64
|
+
onClick: function onClick(e) {
|
|
65
|
+
return e.stopPropagation();
|
|
66
|
+
},
|
|
67
|
+
children: /*#__PURE__*/_jsx(Dropdown, _objectSpread(_objectSpread({}, otherExtraProps), {}, {
|
|
68
|
+
children: extraChildren || /*#__PURE__*/_jsx(Button, {
|
|
69
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
70
|
+
icon: EllipsisVertical
|
|
71
|
+
}),
|
|
72
|
+
size: "small",
|
|
73
|
+
type: "text"
|
|
74
|
+
})
|
|
75
|
+
}))
|
|
76
|
+
})]
|
|
77
|
+
}), description && /*#__PURE__*/_jsx(Paragraph, {
|
|
78
|
+
className: styles.description,
|
|
79
|
+
ellipsis: {
|
|
80
|
+
rows: 2
|
|
81
|
+
},
|
|
82
|
+
children: description
|
|
83
|
+
})]
|
|
84
|
+
})]
|
|
85
|
+
}));
|
|
86
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const useStyles: (props?: {
|
|
2
|
+
divider?: boolean | undefined;
|
|
3
|
+
iconBg?: 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
|
+
title: import("antd-style").SerializedStyles;
|
|
9
|
+
description: import("antd-style").SerializedStyles;
|
|
10
|
+
extra: import("antd-style").SerializedStyles;
|
|
11
|
+
rightButtons: import("antd-style").SerializedStyles;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
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$divider = _ref2.divider,
|
|
9
|
+
divider = _ref2$divider === void 0 ? true : _ref2$divider,
|
|
10
|
+
_ref2$iconBg = _ref2.iconBg,
|
|
11
|
+
iconBg = _ref2$iconBg === void 0 ? true : _ref2$iconBg;
|
|
12
|
+
return {
|
|
13
|
+
root: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 24px 20px ", "px 24px;\n ", "\n "])), divider ? 20 : 0, divider && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-bottom: 1px solid ", ";\n "])), token.colorSplit)),
|
|
14
|
+
icon: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &.", "-avatar {\n color: ", ";\n ", "\n &.", "-avatar-square {\n border-radius: 10px;\n }\n .anticon {\n font-size: 40px;\n }\n }\n "])), prefixCls, token.colorPrimary, iconBg && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), token.colorBgLayout), prefixCls),
|
|
15
|
+
titleBox: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-right: 4px;\n margin-bottom: ", "px;\n "])), token.marginXXS),
|
|
16
|
+
title: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: inline-block;\n flex: 1;\n\n width: 100px;\n\n font-size: 16px;\n font-weight: ", ";\n text-overflow: ellipsis;\n white-space: nowrap;\n "])), token.fontWeightStrong),
|
|
17
|
+
description: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-right: 4px;\n &.", "-typography {\n margin-bottom: 0 !important;\n font-size: 12px;\n color: ", ";\n }\n "])), prefixCls, token.colorTextSecondary),
|
|
18
|
+
extra: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-top: -4px;\n "]))),
|
|
19
|
+
rightButtons: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n justify-content: flex-end;\n "])))
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
hashPriority: 'low'
|
|
23
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ProCardContent } from './Content';
|
|
3
|
+
import { ProCardDescriptions } from './Descriptions';
|
|
4
|
+
import { ProCardHeader } from './Header';
|
|
5
|
+
export type { ProCardProps } from './Card';
|
|
6
|
+
export type { ProCardContentProps } from './Content';
|
|
7
|
+
export type { ProCardDescriptionsProps } from './Descriptions';
|
|
8
|
+
export type { ProCardHeaderProps } from './Header';
|
|
9
|
+
export declare const ProCard: import("react").FC<import("./Card").ProCardProps> & {
|
|
10
|
+
Header: typeof ProCardHeader;
|
|
11
|
+
Descriptions: typeof ProCardDescriptions;
|
|
12
|
+
Content: typeof ProCardContent;
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ProCard as InternalProCard } from "./Card";
|
|
2
|
+
import { ProCardContent } from "./Content";
|
|
3
|
+
import { ProCardDescriptions } from "./Descriptions";
|
|
4
|
+
import { ProCardHeader } from "./Header";
|
|
5
|
+
export var ProCard = InternalProCard;
|
|
6
|
+
ProCard.Header = ProCardHeader;
|
|
7
|
+
ProCard.Content = ProCardContent;
|
|
8
|
+
ProCard.Descriptions = ProCardDescriptions;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Radio as AntdRadio, type RadioGroupProps as AntdRadioGroupProps, RadioProps } from 'antd';
|
|
2
|
+
import type { RadioRef } from 'antd/es/radio/interface';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface CustomRadioProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description Set the button style is similar to the Segmented component
|
|
7
|
+
* @default 'false'
|
|
8
|
+
*/
|
|
9
|
+
segmented?: {
|
|
10
|
+
/**
|
|
11
|
+
* @description Set the spacing between buttons
|
|
12
|
+
* @default 'true'
|
|
13
|
+
*/
|
|
14
|
+
gap?: 'small' | 'middle' | 'large' | number | boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @description Set border-radius of buttons
|
|
17
|
+
* @default 'true'
|
|
18
|
+
*/
|
|
19
|
+
borderRadius?: number | boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @description Sets whether the button's border is displayed
|
|
22
|
+
* @default 'false'
|
|
23
|
+
*/
|
|
24
|
+
bordered?: boolean;
|
|
25
|
+
} | boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface RadioGroupProps extends AntdRadioGroupProps, CustomRadioProps {
|
|
28
|
+
}
|
|
29
|
+
type RadioType = React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<RadioRef>> & {
|
|
30
|
+
Group: typeof Group;
|
|
31
|
+
Button: typeof AntdRadio.Button;
|
|
32
|
+
};
|
|
33
|
+
export declare const Radio: RadioType;
|
|
34
|
+
declare const Group: React.FC<RadioGroupProps>;
|
|
35
|
+
export default Radio;
|
|
36
|
+
export { type RadioChangeEvent, type RadioProps } from 'antd';
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { Radio as AntdRadio } from 'antd';
|
|
7
|
+
import AntdGroup from 'antd/es/radio/group';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { useStyles } from "./style";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
export var Radio = AntdRadio;
|
|
12
|
+
var Group = function Group(props) {
|
|
13
|
+
var className = props.className,
|
|
14
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
15
|
+
if (otherProps.segmented) {
|
|
16
|
+
otherProps.optionType = 'button';
|
|
17
|
+
}
|
|
18
|
+
var _useStyles = useStyles(otherProps),
|
|
19
|
+
styles = _useStyles.styles,
|
|
20
|
+
cx = _useStyles.cx;
|
|
21
|
+
return /*#__PURE__*/_jsx(AntdGroup, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
22
|
+
className: cx(styles.custom, className)
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
Radio.Group = Group;
|
|
26
|
+
export default Radio;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
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 size = _ref2.size,
|
|
9
|
+
segmented = _ref2.segmented;
|
|
10
|
+
var gap = function () {
|
|
11
|
+
if (!segmented) {
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
if (segmented !== true) {
|
|
15
|
+
return segmented.gap;
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
}();
|
|
19
|
+
var borderRadius = function () {
|
|
20
|
+
if (!segmented) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (segmented !== true) {
|
|
24
|
+
return segmented.borderRadius;
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}();
|
|
28
|
+
var getGapSize = function getGapSize() {
|
|
29
|
+
var gapSizeMap = {
|
|
30
|
+
small: token.sizeSM,
|
|
31
|
+
middle: token.size,
|
|
32
|
+
large: token.sizeLG
|
|
33
|
+
};
|
|
34
|
+
if (typeof gap === 'string') {
|
|
35
|
+
return gapSizeMap[gap];
|
|
36
|
+
}
|
|
37
|
+
if (gap === true) {
|
|
38
|
+
return size ? gapSizeMap[size] : gapSizeMap['middle'];
|
|
39
|
+
}
|
|
40
|
+
if (!gap) {
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
return gap;
|
|
44
|
+
};
|
|
45
|
+
var getBorderRadius = function getBorderRadius() {
|
|
46
|
+
var borderRadiusSizeMap = {
|
|
47
|
+
small: token.controlHeightSM,
|
|
48
|
+
middle: token.controlHeight,
|
|
49
|
+
large: token.controlHeightLG
|
|
50
|
+
};
|
|
51
|
+
if (borderRadius === true) {
|
|
52
|
+
return size ? borderRadiusSizeMap[size] : borderRadiusSizeMap['middle'];
|
|
53
|
+
}
|
|
54
|
+
if (borderRadius || borderRadius === 0) {
|
|
55
|
+
return borderRadius;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var borderRadiusStyle = getBorderRadius() && css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n label {\n border-inline-start-width: 1px !important;\n border-radius: ", "px !important;\n }\n label::before {\n display: none !important;\n }\n "])), getBorderRadius());
|
|
59
|
+
var gapStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n label {\n margin-right: ", "px !important;\n }\n label:last-child {\n margin-right: 0 !important;\n }\n "])), getGapSize());
|
|
60
|
+
var noBorderd = segmented === true || segmented && !segmented.bordered;
|
|
61
|
+
return {
|
|
62
|
+
custom: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), borderRadiusStyle, gapStyle, noBorderd && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", "-radio-button-wrapper {\n border: none !important;\n }\n .", "-radio-button-wrapper-checked {\n border: 1px solid ", " !important;\n }\n "])), prefixCls, prefixCls, token.colorPrimary))
|
|
63
|
+
};
|
|
64
|
+
}, {
|
|
65
|
+
hashPriority: 'low'
|
|
66
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ColProps } from 'antd';
|
|
2
|
+
import type { InputNumberProps, SliderSingleProps } from 'antd';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface SliderInputProps {
|
|
5
|
+
/** The current value */
|
|
6
|
+
value?: number;
|
|
7
|
+
/** The initial value */
|
|
8
|
+
defaultValue?: number;
|
|
9
|
+
/** The min value */
|
|
10
|
+
min?: number;
|
|
11
|
+
/** The max value */
|
|
12
|
+
max?: number;
|
|
13
|
+
/** The number to which the current value is increased or decreased. It can be an integer or decimal */
|
|
14
|
+
step?: number;
|
|
15
|
+
/** Spacing between grids, could be a number or a object like { xs: 8, sm: 16, md: 24}. Or you can use array to make horizontal and vertical spacing work at the same time [horizontal, vertical] */
|
|
16
|
+
gutter?: number;
|
|
17
|
+
/**
|
|
18
|
+
* @description Slider layout, like <Col> component. Set span offset value like {span: 3, offset: 12} or sm: {span: 3, offset: 12}
|
|
19
|
+
* @type ColProps
|
|
20
|
+
* @default { span: 12 }
|
|
21
|
+
*/
|
|
22
|
+
sliderCol?: ColProps;
|
|
23
|
+
/**
|
|
24
|
+
* @description The layout for input controls, same as sliderCol, see https://ant.design/components/grid#row for detail
|
|
25
|
+
* @type ColProps
|
|
26
|
+
* @default { span: 5 }
|
|
27
|
+
*/
|
|
28
|
+
inputCol?: ColProps;
|
|
29
|
+
/** The label text displayed before (on the left side of) the input field */
|
|
30
|
+
addonAfter?: React.ReactNode;
|
|
31
|
+
/** The label text displayed before (on the left side of) the input field */
|
|
32
|
+
addonBefore?: React.ReactNode;
|
|
33
|
+
/** placeholder */
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
/** The callback triggered when the value is changed */
|
|
36
|
+
onChange?: (value: number) => void;
|
|
37
|
+
/** style */
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
/** className */
|
|
40
|
+
className?: string;
|
|
41
|
+
/**
|
|
42
|
+
* @description the props of slider, see https://ant.design/components/slider#api for detail
|
|
43
|
+
* @type SliderSingleProps
|
|
44
|
+
* @default {}
|
|
45
|
+
*/
|
|
46
|
+
sliderProps?: SliderSingleProps;
|
|
47
|
+
/**
|
|
48
|
+
* @description the props of input, see https://ant.design/components/input-number#api for detail
|
|
49
|
+
* @type InputNumberProps
|
|
50
|
+
* @default {}
|
|
51
|
+
*/
|
|
52
|
+
inputProps?: InputNumberProps;
|
|
53
|
+
}
|
|
54
|
+
export declare const SliderInput: React.FC<SliderInputProps>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
import { Col, InputNumber, Row, Slider } from 'antd';
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export var SliderInput = function SliderInput(_ref) {
|
|
10
|
+
var value = _ref.value,
|
|
11
|
+
defaultValue = _ref.defaultValue,
|
|
12
|
+
_ref$min = _ref.min,
|
|
13
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
14
|
+
max = _ref.max,
|
|
15
|
+
step = _ref.step,
|
|
16
|
+
_ref$gutter = _ref.gutter,
|
|
17
|
+
gutter = _ref$gutter === void 0 ? 16 : _ref$gutter,
|
|
18
|
+
_ref$sliderCol = _ref.sliderCol,
|
|
19
|
+
sliderCol = _ref$sliderCol === void 0 ? {
|
|
20
|
+
span: 12
|
|
21
|
+
} : _ref$sliderCol,
|
|
22
|
+
_ref$inputCol = _ref.inputCol,
|
|
23
|
+
inputCol = _ref$inputCol === void 0 ? {
|
|
24
|
+
span: 5
|
|
25
|
+
} : _ref$inputCol,
|
|
26
|
+
addonAfter = _ref.addonAfter,
|
|
27
|
+
addonBefore = _ref.addonBefore,
|
|
28
|
+
placeholder = _ref.placeholder,
|
|
29
|
+
onChange = _ref.onChange,
|
|
30
|
+
style = _ref.style,
|
|
31
|
+
className = _ref.className,
|
|
32
|
+
_ref$sliderProps = _ref.sliderProps,
|
|
33
|
+
sliderProps = _ref$sliderProps === void 0 ? {} : _ref$sliderProps,
|
|
34
|
+
_ref$inputProps = _ref.inputProps,
|
|
35
|
+
inputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps;
|
|
36
|
+
var _useState = useState(),
|
|
37
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
+
number = _useState2[0],
|
|
39
|
+
setNumber = _useState2[1];
|
|
40
|
+
var onNumberChange = function onNumberChange(newNumber) {
|
|
41
|
+
if (Number.isNaN(newNumber)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
setNumber(newNumber);
|
|
45
|
+
onChange === null || onChange === void 0 || onChange(newNumber);
|
|
46
|
+
};
|
|
47
|
+
return /*#__PURE__*/_jsxs(Row, {
|
|
48
|
+
className: className,
|
|
49
|
+
gutter: gutter,
|
|
50
|
+
style: style,
|
|
51
|
+
children: [/*#__PURE__*/_jsx(Col, _objectSpread(_objectSpread({}, sliderCol), {}, {
|
|
52
|
+
children: /*#__PURE__*/_jsx(Slider, _objectSpread(_objectSpread({}, sliderProps), {}, {
|
|
53
|
+
defaultValue: defaultValue,
|
|
54
|
+
max: max,
|
|
55
|
+
min: min,
|
|
56
|
+
onChange: onNumberChange,
|
|
57
|
+
step: step,
|
|
58
|
+
value: value !== null && value !== void 0 ? value : number
|
|
59
|
+
}))
|
|
60
|
+
})), /*#__PURE__*/_jsx(Col, _objectSpread(_objectSpread({}, inputCol), {}, {
|
|
61
|
+
children: /*#__PURE__*/_jsx(InputNumber, _objectSpread(_objectSpread({}, inputProps), {}, {
|
|
62
|
+
addonAfter: addonAfter,
|
|
63
|
+
addonBefore: addonBefore,
|
|
64
|
+
defaultValue: defaultValue,
|
|
65
|
+
max: max,
|
|
66
|
+
min: min,
|
|
67
|
+
onChange: onNumberChange,
|
|
68
|
+
placeholder: placeholder,
|
|
69
|
+
step: step,
|
|
70
|
+
value: value !== null && value !== void 0 ? value : number
|
|
71
|
+
}))
|
|
72
|
+
}))]
|
|
73
|
+
});
|
|
74
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BadgeProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface StatusProps extends Pick<BadgeProps, 'className' | 'color' | 'status' | 'style' | 'text'> {
|
|
4
|
+
tooltip?: React.ReactNode;
|
|
5
|
+
title?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Status: React.FC<StatusProps>;
|