@yuntijs/ui 1.0.0-beta.75 → 1.0.0-beta.77
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/ButtonGroup/index.d.ts +24 -0
- package/es/{Page/Header/ButtonGroup.js → ButtonGroup/index.js} +7 -4
- package/es/Page/Header/index.d.ts +2 -2
- package/es/Page/Header/index.js +2 -2
- package/es/Page/index.d.ts +0 -2
- package/es/Page/index.js +1 -1
- package/es/SelectCard/style.d.ts +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +2 -1
- package/umd/index.min.js +1 -1
- package/umd/index.min.js.map +1 -1
- package/es/Page/Header/ButtonGroup.d.ts +0 -18
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ButtonProps } from 'antd';
|
|
2
|
+
import type { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
3
|
+
import type { ItemType } from 'antd/es/menu/interface';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export type ButtonType = {
|
|
6
|
+
key: string;
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
danger?: boolean;
|
|
10
|
+
ghost?: boolean;
|
|
11
|
+
block?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
loading?: boolean | {
|
|
14
|
+
delay?: number;
|
|
15
|
+
};
|
|
16
|
+
type?: ButtonProps['type'];
|
|
17
|
+
};
|
|
18
|
+
export type ButtonGroupItem = ButtonType | ItemType;
|
|
19
|
+
export interface ButtonGroupProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'onClick'> {
|
|
20
|
+
onClick?: (key: string, e: React.MouseEvent<HTMLElement, MouseEvent> | React.KeyboardEvent<HTMLElement>) => void;
|
|
21
|
+
items?: ButtonGroupItem[];
|
|
22
|
+
size?: SizeType;
|
|
23
|
+
}
|
|
24
|
+
export declare const ButtonGroup: React.FC<ButtonGroupProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toArray from "@babel/runtime/helpers/esm/toArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["items", "onClick"],
|
|
4
|
+
var _excluded = ["items", "onClick", "size"],
|
|
5
5
|
_excluded2 = ["key", "label"],
|
|
6
6
|
_excluded3 = ["key", "label"];
|
|
7
7
|
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; }
|
|
@@ -9,11 +9,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
import { Button, Dropdown, Space } from 'antd';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
export var
|
|
12
|
+
export var ButtonGroup = function ButtonGroup(props) {
|
|
13
13
|
var _props$items = props.items,
|
|
14
14
|
items = _props$items === void 0 ? [] : _props$items,
|
|
15
15
|
_props$onClick = props.onClick,
|
|
16
16
|
_onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
|
|
17
|
+
size = props.size,
|
|
17
18
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
18
19
|
if (items.length <= 2) {
|
|
19
20
|
return /*#__PURE__*/_jsx(Space, _objectSpread(_objectSpread({
|
|
@@ -27,7 +28,8 @@ export var HeaderButtonGroup = function HeaderButtonGroup(props) {
|
|
|
27
28
|
return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
|
|
28
29
|
onClick: function onClick(e) {
|
|
29
30
|
return _onClick(key, e);
|
|
30
|
-
}
|
|
31
|
+
},
|
|
32
|
+
size: size
|
|
31
33
|
}, btnProps), {}, {
|
|
32
34
|
children: label
|
|
33
35
|
}), key);
|
|
@@ -56,7 +58,8 @@ export var HeaderButtonGroup = function HeaderButtonGroup(props) {
|
|
|
56
58
|
},
|
|
57
59
|
overlayStyle: {
|
|
58
60
|
minWidth: 100
|
|
59
|
-
}
|
|
61
|
+
},
|
|
62
|
+
size: size
|
|
60
63
|
}, otherProps), {}, {
|
|
61
64
|
children: firstLabel
|
|
62
65
|
}), firstKey);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type ButtonGroupProps } from "../../ButtonGroup";
|
|
2
3
|
import { StatusProps } from "../../Status";
|
|
3
|
-
import { type HeaderButtonGroupProps } from './ButtonGroup';
|
|
4
4
|
import { HeaderIconProps } from './Icon';
|
|
5
5
|
export interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
6
6
|
/** 是否有边框,默认没有 */
|
|
@@ -26,7 +26,7 @@ export interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
26
26
|
/** 描述列表自定义渲染 */
|
|
27
27
|
descriptionsRender?: (descriptionsElement: React.ReactNode) => React.ReactNode;
|
|
28
28
|
/** 右侧扩展区域 */
|
|
29
|
-
extraContent?:
|
|
29
|
+
extraContent?: ButtonGroupProps;
|
|
30
30
|
/** 右侧扩展区域自定义渲染 */
|
|
31
31
|
extraContentRender?: (buttonsElement: React.ReactNode) => React.ReactNode;
|
|
32
32
|
/** 控制 header 与 content 的分割线,当 bordered 为 true 时,divider 自动设置为 false */
|
package/es/Page/Header/index.js
CHANGED
|
@@ -9,11 +9,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
9
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
10
|
import { Flex, Skeleton, Tooltip } from 'antd';
|
|
11
11
|
import React, { useContext, useMemo } from 'react';
|
|
12
|
+
import { ButtonGroup } from "../../ButtonGroup";
|
|
12
13
|
import Divider from "../../Divider";
|
|
13
14
|
import { Status } from "../../Status";
|
|
14
15
|
import Typography from "../../Typography";
|
|
15
16
|
import { PageContext } from "../PageContext";
|
|
16
|
-
import { HeaderButtonGroup } from "./ButtonGroup";
|
|
17
17
|
import { HeaderIcon, getIconSize } from "./Icon";
|
|
18
18
|
import { useStyles } from "./style";
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -108,7 +108,7 @@ export var PageHeader = function PageHeader(props) {
|
|
|
108
108
|
if (!extraContent && !extraContentRender) {
|
|
109
109
|
return null;
|
|
110
110
|
}
|
|
111
|
-
var buttons = /*#__PURE__*/_jsx(
|
|
111
|
+
var buttons = /*#__PURE__*/_jsx(ButtonGroup, _objectSpread({
|
|
112
112
|
className: styles.rightButtons
|
|
113
113
|
}, extraContent));
|
|
114
114
|
if (extraContentRender) {
|
package/es/Page/index.d.ts
CHANGED
|
@@ -6,9 +6,7 @@ import { PageHeader } from './Header';
|
|
|
6
6
|
import { PageTitle } from './Title';
|
|
7
7
|
export type { PageBreadcrumbProps } from './Breadcrumb';
|
|
8
8
|
export type { PageContentProps } from './Content';
|
|
9
|
-
export { HeaderButtonGroup } from './Header/ButtonGroup';
|
|
10
9
|
export type { PageHeaderProps } from './Header';
|
|
11
|
-
export type { HeaderButtonGroupProps } from './Header/ButtonGroup';
|
|
12
10
|
export type { PageProps } from './Page';
|
|
13
11
|
export type { PageTitleProps } from './Title';
|
|
14
12
|
export declare const Page: import("react").FC<import("./Page").PageProps> & {
|
package/es/Page/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { PageFooter } from "./Footer";
|
|
|
4
4
|
import { PageHeader } from "./Header";
|
|
5
5
|
import { Page as InternalPage } from "./Page";
|
|
6
6
|
import { PageTitle } from "./Title";
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
// export type { } from './Footer';
|
|
9
9
|
|
|
10
10
|
export var Page = InternalPage;
|
package/es/SelectCard/style.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const getNumberBySize: (size: SelectCardProps['size']) => {
|
|
|
3
3
|
cardWidth: number;
|
|
4
4
|
imgHeight: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const useStyles: (props?: Pick<SelectCardProps, "
|
|
6
|
+
export declare const useStyles: (props?: Pick<SelectCardProps, "disabled" | "size"> | undefined) => import("antd-style").ReturnStyles<{
|
|
7
7
|
option: import("antd-style").SerializedStyles;
|
|
8
8
|
optionSelected: import("antd-style").SerializedStyles;
|
|
9
9
|
check: import("antd-style").SerializedStyles;
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuntijs/ui",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.77",
|
|
4
4
|
"description": "☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yuntijs",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"author": "Luobo Zhang <zhang.pc3@gmail.com>",
|
|
21
|
+
"sideEffects": false,
|
|
21
22
|
"main": "es/index.js",
|
|
22
23
|
"module": "es/index.js",
|
|
23
24
|
"types": "es/index.d.ts",
|