@dtjoy/dt-design 1.0.0 → 1.0.1
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/esm/blockHeader/index.d.ts +1 -1
- package/esm/blockHeader/index.js +4 -2
- package/esm/blockHeader/style/index.d.ts +2 -0
- package/esm/blockHeader/style/index.js +2 -0
- package/esm/blockHeader/{style.less → style/index.less} +142 -141
- package/esm/button/index.d.ts +10 -0
- package/esm/button/index.js +29 -0
- package/esm/button/style/index.d.ts +2 -0
- package/esm/button/style/index.js +2 -0
- package/esm/button/style/index.less +120 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -2
- package/esm/style/index.d.ts +1 -0
- package/esm/style/index.js +1 -0
- package/esm/style/index.less +1 -0
- package/esm/style/themes/index.less +1 -0
- package/lib/blockHeader/index.d.ts +1 -1
- package/lib/blockHeader/index.js +3 -1
- package/lib/blockHeader/style/index.d.ts +2 -0
- package/lib/blockHeader/style/index.js +4 -0
- package/lib/blockHeader/{style.less → style/index.less} +142 -141
- package/lib/button/index.d.ts +10 -0
- package/lib/button/index.js +33 -0
- package/lib/button/style/index.d.ts +2 -0
- package/lib/button/style/index.js +4 -0
- package/lib/button/style/index.less +120 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +7 -1
- package/lib/style/index.d.ts +1 -0
- package/lib/style/index.js +3 -0
- package/lib/style/index.less +1 -0
- package/lib/style/themes/index.less +1 -0
- package/package.json +1 -1
- package/esm/styles/entry.less +0 -6
- package/esm/styles/variables.less +0 -1
- package/lib/styles/entry.less +0 -6
- package/lib/styles/variables.less +0 -1
package/esm/blockHeader/index.js
CHANGED
|
@@ -15,9 +15,11 @@ import { QuestionOutlined, UpOutlined } from '@dtinsight/react-icons';
|
|
|
15
15
|
import { Tooltip } from 'antd';
|
|
16
16
|
import { globalConfig } from 'antd/es/config-provider';
|
|
17
17
|
import classNames from 'classnames';
|
|
18
|
-
import { toTooltipProps } from "../_util";
|
|
19
18
|
// import useLocale from '../locale/useLocale';
|
|
20
|
-
import "./style
|
|
19
|
+
import "./style";
|
|
20
|
+
import stles from "./style/index.less";
|
|
21
|
+
console.log(stles);
|
|
22
|
+
import { toTooltipProps } from "../_util";
|
|
21
23
|
function isControlled(props) {
|
|
22
24
|
return props.expand !== undefined;
|
|
23
25
|
}
|
|
@@ -1,141 +1,142 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
&--
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
1
|
+
@import '../../style/themes/index.less';
|
|
2
|
+
|
|
3
|
+
@card_prefix: ~'@{ant-prefix}-block-header';
|
|
4
|
+
|
|
5
|
+
.@{card_prefix} {
|
|
6
|
+
&__title {
|
|
7
|
+
border-radius: 4px;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
&--large {
|
|
12
|
+
.title__box {
|
|
13
|
+
line-height: 24px;
|
|
14
|
+
.title__text {
|
|
15
|
+
font-size: 16px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&--middle {
|
|
20
|
+
.title__box {
|
|
21
|
+
line-height: 22px;
|
|
22
|
+
.title__text {
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
&--small {
|
|
28
|
+
.title__box {
|
|
29
|
+
line-height: 20px;
|
|
30
|
+
.title__text {
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
&--background {
|
|
36
|
+
padding: 0 12px;
|
|
37
|
+
background-color: #f9f9fa;
|
|
38
|
+
&.@{card_prefix}__title {
|
|
39
|
+
&--middle,
|
|
40
|
+
&--large {
|
|
41
|
+
height: 40px;
|
|
42
|
+
}
|
|
43
|
+
&--small {
|
|
44
|
+
height: 32px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
&--pointer {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
.title {
|
|
52
|
+
&__box {
|
|
53
|
+
flex: 1;
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
}
|
|
57
|
+
&__addon-before {
|
|
58
|
+
margin-right: 8px;
|
|
59
|
+
color: @primary-color;
|
|
60
|
+
&--middle {
|
|
61
|
+
.addon-before--default {
|
|
62
|
+
width: 4px;
|
|
63
|
+
height: 16px;
|
|
64
|
+
background-color: @primary-color;
|
|
65
|
+
}
|
|
66
|
+
font-size: 20px;
|
|
67
|
+
}
|
|
68
|
+
&--small {
|
|
69
|
+
.addon-before--default {
|
|
70
|
+
width: 4px;
|
|
71
|
+
height: 16px;
|
|
72
|
+
background-color: @primary-color;
|
|
73
|
+
}
|
|
74
|
+
font-size: 16px;
|
|
75
|
+
}
|
|
76
|
+
&--large {
|
|
77
|
+
.addon-before--default {
|
|
78
|
+
width: 4px;
|
|
79
|
+
height: 20px;
|
|
80
|
+
background-color: @primary-color;
|
|
81
|
+
}
|
|
82
|
+
font-size: 24px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
&__tooltip {
|
|
86
|
+
display: flex;
|
|
87
|
+
margin-right: 4px;
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
color: #b1b4c5;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
}
|
|
92
|
+
&__text {
|
|
93
|
+
color: @text-color;
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
margin-right: 4px;
|
|
96
|
+
}
|
|
97
|
+
&__description {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
color: @label-color;
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
}
|
|
103
|
+
&__addon-after {
|
|
104
|
+
color: @label-color;
|
|
105
|
+
}
|
|
106
|
+
&__collapse {
|
|
107
|
+
color: @label-color;
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
user-select: none;
|
|
112
|
+
.collapse {
|
|
113
|
+
&__text {
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
margin: 0 4px;
|
|
116
|
+
}
|
|
117
|
+
&__icon {
|
|
118
|
+
font-size: 16px;
|
|
119
|
+
transition: transform 0.4s;
|
|
120
|
+
&--down {
|
|
121
|
+
transform: rotate(-180deg);
|
|
122
|
+
}
|
|
123
|
+
&--up {
|
|
124
|
+
transform: rotate(0deg);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
&__content {
|
|
132
|
+
opacity: 0;
|
|
133
|
+
height: 0;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
transition: opacity 0.5s ease, height 0.5s ease;
|
|
136
|
+
&--active {
|
|
137
|
+
opacity: 1;
|
|
138
|
+
padding: 16px 24px;
|
|
139
|
+
height: auto;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps as AntdButtonProps } from 'antd';
|
|
3
|
+
import { ButtonType as AntdButtonType } from 'antd/es/button';
|
|
4
|
+
import './style';
|
|
5
|
+
declare type ButtonType = AntdButtonType | 'secondary' | 'tertiary';
|
|
6
|
+
export interface ButtonProps extends Omit<AntdButtonProps, 'type'> {
|
|
7
|
+
type?: ButtonType;
|
|
8
|
+
}
|
|
9
|
+
export default function Button({ className, icon, children, size, type, ...rest }: ButtonProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var _excluded = ["className", "icon", "children", "size", "type"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Button as AntdButton } from 'antd';
|
|
7
|
+
import { globalConfig } from 'antd/es/config-provider';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
import "./style";
|
|
10
|
+
export default function Button(_ref) {
|
|
11
|
+
var className = _ref.className,
|
|
12
|
+
icon = _ref.icon,
|
|
13
|
+
children = _ref.children,
|
|
14
|
+
_ref$size = _ref.size,
|
|
15
|
+
size = _ref$size === void 0 ? 'middle' : _ref$size,
|
|
16
|
+
type = _ref.type,
|
|
17
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
var prefixCls = globalConfig().getPrefixCls('btn');
|
|
19
|
+
var typeClassName = type ? "".concat(prefixCls, "--").concat(type) : '';
|
|
20
|
+
return /*#__PURE__*/React.createElement(AntdButton, _extends({
|
|
21
|
+
className: classNames(prefixCls, className, typeClassName),
|
|
22
|
+
size: size,
|
|
23
|
+
type: type
|
|
24
|
+
}, rest), icon && /*#__PURE__*/React.createElement("span", {
|
|
25
|
+
className: "".concat(prefixCls, "__icon ").concat(prefixCls, "__icon--").concat(size)
|
|
26
|
+
}, icon), children && /*#__PURE__*/React.createElement("span", {
|
|
27
|
+
className: "".concat(prefixCls, "__text ").concat(prefixCls, "__text--").concat(size)
|
|
28
|
+
}, children));
|
|
29
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
@import '../../style/themes/index.less';
|
|
2
|
+
|
|
3
|
+
@prefix-cls: ~'@{ant-prefix}-btn';
|
|
4
|
+
|
|
5
|
+
.@{prefix-cls} {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
padding: 4px 16px;
|
|
10
|
+
|
|
11
|
+
&__icon {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
font-size: inherit;
|
|
16
|
+
line-height: 0;
|
|
17
|
+
// 因为 dtstack-icon 组件的 font-size 是 16px,现在需要继承 Button 组件的 font-size
|
|
18
|
+
.dtstack-icon {
|
|
19
|
+
font-size: inherit;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--small {
|
|
23
|
+
font-size: 12px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&--middle {
|
|
27
|
+
font-size: 16px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&--large {
|
|
31
|
+
font-size: 18px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
& + .@{prefix-cls}__text {
|
|
35
|
+
&--small {
|
|
36
|
+
margin-left: 2px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--middle {
|
|
40
|
+
margin-left: 8px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&--large {
|
|
44
|
+
margin-left: 8px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__text {
|
|
50
|
+
display: inline-block;
|
|
51
|
+
|
|
52
|
+
&--small {
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&--middle {
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&--large {
|
|
61
|
+
font-size: 14px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&-sm {
|
|
66
|
+
padding: 2px 12px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&-lg {
|
|
70
|
+
padding: 3px 40px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-primary[disabled],
|
|
74
|
+
&-primary[disabled]:hover {
|
|
75
|
+
// color: @primary-color-disabled;
|
|
76
|
+
background: @disabled-color;
|
|
77
|
+
border-color: @disabled-color;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&-secondary {
|
|
81
|
+
border-color: @primary-color;
|
|
82
|
+
color: @primary-color;
|
|
83
|
+
|
|
84
|
+
&:hover,
|
|
85
|
+
&:focus {
|
|
86
|
+
background-color: @item-hover-bg;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&-tertiary {
|
|
91
|
+
// background-color: @table-title-fill-bg;
|
|
92
|
+
border-color: @border-color-base;
|
|
93
|
+
|
|
94
|
+
&:hover,
|
|
95
|
+
&:focus {
|
|
96
|
+
background-color: @item-hover-bg;
|
|
97
|
+
border-color: @primary-color;
|
|
98
|
+
color: @primary-color;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&-secondary,
|
|
103
|
+
&-tertiary {
|
|
104
|
+
&[disabled],
|
|
105
|
+
&[disabled]:hover {
|
|
106
|
+
background: #f3f3f3;
|
|
107
|
+
color: @disabled-color;
|
|
108
|
+
border-color: @border-color-base;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&-default {
|
|
113
|
+
&[disabled],
|
|
114
|
+
&[disabled]:hover {
|
|
115
|
+
background: transparent;
|
|
116
|
+
color: @disabled-color;
|
|
117
|
+
border-color: @border-color-base;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
package/esm/index.d.ts
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import '@dtinsight/react-icons/dist/index.css';
|
|
2
|
-
import "./styles/entry.less";
|
|
3
2
|
export { default as BlockHeader } from "./blockHeader";
|
|
4
|
-
|
|
3
|
+
export { default as Button } from "./button";
|
|
5
4
|
// export { default as Catalogue } from './catalogue';
|
|
6
5
|
// export { default as Chat } from './chat';
|
|
7
6
|
// export { default as CollapsibleActionItems } from './collapsibleActionItems';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.less";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./themes/index.less";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "~antd/es/style/themes/default.less";
|
package/lib/blockHeader/index.js
CHANGED
|
@@ -9,13 +9,15 @@ var _reactIcons = require("@dtinsight/react-icons");
|
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _configProvider = require("antd/es/config-provider");
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
require("./style");
|
|
13
|
+
var _index = _interopRequireDefault(require("./style/index.less"));
|
|
12
14
|
var _util = require("../_util");
|
|
13
|
-
require("./style.less");
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
18
|
// import useLocale from '../locale/useLocale';
|
|
18
19
|
|
|
20
|
+
console.log(_index.default);
|
|
19
21
|
function isControlled(props) {
|
|
20
22
|
return props.expand !== undefined;
|
|
21
23
|
}
|
|
@@ -1,141 +1,142 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
&--
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
1
|
+
@import '../../style/themes/index.less';
|
|
2
|
+
|
|
3
|
+
@card_prefix: ~'@{ant-prefix}-block-header';
|
|
4
|
+
|
|
5
|
+
.@{card_prefix} {
|
|
6
|
+
&__title {
|
|
7
|
+
border-radius: 4px;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
&--large {
|
|
12
|
+
.title__box {
|
|
13
|
+
line-height: 24px;
|
|
14
|
+
.title__text {
|
|
15
|
+
font-size: 16px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&--middle {
|
|
20
|
+
.title__box {
|
|
21
|
+
line-height: 22px;
|
|
22
|
+
.title__text {
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
&--small {
|
|
28
|
+
.title__box {
|
|
29
|
+
line-height: 20px;
|
|
30
|
+
.title__text {
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
&--background {
|
|
36
|
+
padding: 0 12px;
|
|
37
|
+
background-color: #f9f9fa;
|
|
38
|
+
&.@{card_prefix}__title {
|
|
39
|
+
&--middle,
|
|
40
|
+
&--large {
|
|
41
|
+
height: 40px;
|
|
42
|
+
}
|
|
43
|
+
&--small {
|
|
44
|
+
height: 32px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
&--pointer {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
.title {
|
|
52
|
+
&__box {
|
|
53
|
+
flex: 1;
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
}
|
|
57
|
+
&__addon-before {
|
|
58
|
+
margin-right: 8px;
|
|
59
|
+
color: @primary-color;
|
|
60
|
+
&--middle {
|
|
61
|
+
.addon-before--default {
|
|
62
|
+
width: 4px;
|
|
63
|
+
height: 16px;
|
|
64
|
+
background-color: @primary-color;
|
|
65
|
+
}
|
|
66
|
+
font-size: 20px;
|
|
67
|
+
}
|
|
68
|
+
&--small {
|
|
69
|
+
.addon-before--default {
|
|
70
|
+
width: 4px;
|
|
71
|
+
height: 16px;
|
|
72
|
+
background-color: @primary-color;
|
|
73
|
+
}
|
|
74
|
+
font-size: 16px;
|
|
75
|
+
}
|
|
76
|
+
&--large {
|
|
77
|
+
.addon-before--default {
|
|
78
|
+
width: 4px;
|
|
79
|
+
height: 20px;
|
|
80
|
+
background-color: @primary-color;
|
|
81
|
+
}
|
|
82
|
+
font-size: 24px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
&__tooltip {
|
|
86
|
+
display: flex;
|
|
87
|
+
margin-right: 4px;
|
|
88
|
+
font-size: 16px;
|
|
89
|
+
color: #b1b4c5;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
}
|
|
92
|
+
&__text {
|
|
93
|
+
color: @text-color;
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
margin-right: 4px;
|
|
96
|
+
}
|
|
97
|
+
&__description {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
color: @label-color;
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
}
|
|
103
|
+
&__addon-after {
|
|
104
|
+
color: @label-color;
|
|
105
|
+
}
|
|
106
|
+
&__collapse {
|
|
107
|
+
color: @label-color;
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
user-select: none;
|
|
112
|
+
.collapse {
|
|
113
|
+
&__text {
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
margin: 0 4px;
|
|
116
|
+
}
|
|
117
|
+
&__icon {
|
|
118
|
+
font-size: 16px;
|
|
119
|
+
transition: transform 0.4s;
|
|
120
|
+
&--down {
|
|
121
|
+
transform: rotate(-180deg);
|
|
122
|
+
}
|
|
123
|
+
&--up {
|
|
124
|
+
transform: rotate(0deg);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
&__content {
|
|
132
|
+
opacity: 0;
|
|
133
|
+
height: 0;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
transition: opacity 0.5s ease, height 0.5s ease;
|
|
136
|
+
&--active {
|
|
137
|
+
opacity: 1;
|
|
138
|
+
padding: 16px 24px;
|
|
139
|
+
height: auto;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps as AntdButtonProps } from 'antd';
|
|
3
|
+
import { ButtonType as AntdButtonType } from 'antd/es/button';
|
|
4
|
+
import './style';
|
|
5
|
+
declare type ButtonType = AntdButtonType | 'secondary' | 'tertiary';
|
|
6
|
+
export interface ButtonProps extends Omit<AntdButtonProps, 'type'> {
|
|
7
|
+
type?: ButtonType;
|
|
8
|
+
}
|
|
9
|
+
export default function Button({ className, icon, children, size, type, ...rest }: ButtonProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Button;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _antd = require("antd");
|
|
9
|
+
var _configProvider = require("antd/es/config-provider");
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
require("./style");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
+
function Button({
|
|
15
|
+
className,
|
|
16
|
+
icon,
|
|
17
|
+
children,
|
|
18
|
+
size = 'middle',
|
|
19
|
+
type,
|
|
20
|
+
...rest
|
|
21
|
+
}) {
|
|
22
|
+
const prefixCls = (0, _configProvider.globalConfig)().getPrefixCls('btn');
|
|
23
|
+
const typeClassName = type ? `${prefixCls}--${type}` : '';
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Button, _extends({
|
|
25
|
+
className: (0, _classnames.default)(prefixCls, className, typeClassName),
|
|
26
|
+
size: size,
|
|
27
|
+
type: type
|
|
28
|
+
}, rest), icon && /*#__PURE__*/_react.default.createElement("span", {
|
|
29
|
+
className: `${prefixCls}__icon ${prefixCls}__icon--${size}`
|
|
30
|
+
}, icon), children && /*#__PURE__*/_react.default.createElement("span", {
|
|
31
|
+
className: `${prefixCls}__text ${prefixCls}__text--${size}`
|
|
32
|
+
}, children));
|
|
33
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
@import '../../style/themes/index.less';
|
|
2
|
+
|
|
3
|
+
@prefix-cls: ~'@{ant-prefix}-btn';
|
|
4
|
+
|
|
5
|
+
.@{prefix-cls} {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
padding: 4px 16px;
|
|
10
|
+
|
|
11
|
+
&__icon {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
font-size: inherit;
|
|
16
|
+
line-height: 0;
|
|
17
|
+
// 因为 dtstack-icon 组件的 font-size 是 16px,现在需要继承 Button 组件的 font-size
|
|
18
|
+
.dtstack-icon {
|
|
19
|
+
font-size: inherit;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--small {
|
|
23
|
+
font-size: 12px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&--middle {
|
|
27
|
+
font-size: 16px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&--large {
|
|
31
|
+
font-size: 18px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
& + .@{prefix-cls}__text {
|
|
35
|
+
&--small {
|
|
36
|
+
margin-left: 2px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--middle {
|
|
40
|
+
margin-left: 8px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&--large {
|
|
44
|
+
margin-left: 8px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__text {
|
|
50
|
+
display: inline-block;
|
|
51
|
+
|
|
52
|
+
&--small {
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&--middle {
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&--large {
|
|
61
|
+
font-size: 14px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&-sm {
|
|
66
|
+
padding: 2px 12px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&-lg {
|
|
70
|
+
padding: 3px 40px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-primary[disabled],
|
|
74
|
+
&-primary[disabled]:hover {
|
|
75
|
+
// color: @primary-color-disabled;
|
|
76
|
+
background: @disabled-color;
|
|
77
|
+
border-color: @disabled-color;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&-secondary {
|
|
81
|
+
border-color: @primary-color;
|
|
82
|
+
color: @primary-color;
|
|
83
|
+
|
|
84
|
+
&:hover,
|
|
85
|
+
&:focus {
|
|
86
|
+
background-color: @item-hover-bg;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&-tertiary {
|
|
91
|
+
// background-color: @table-title-fill-bg;
|
|
92
|
+
border-color: @border-color-base;
|
|
93
|
+
|
|
94
|
+
&:hover,
|
|
95
|
+
&:focus {
|
|
96
|
+
background-color: @item-hover-bg;
|
|
97
|
+
border-color: @primary-color;
|
|
98
|
+
color: @primary-color;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&-secondary,
|
|
103
|
+
&-tertiary {
|
|
104
|
+
&[disabled],
|
|
105
|
+
&[disabled]:hover {
|
|
106
|
+
background: #f3f3f3;
|
|
107
|
+
color: @disabled-color;
|
|
108
|
+
border-color: @border-color-base;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&-default {
|
|
113
|
+
&[disabled],
|
|
114
|
+
&[disabled]:hover {
|
|
115
|
+
background: transparent;
|
|
116
|
+
color: @disabled-color;
|
|
117
|
+
border-color: @border-color-base;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -9,7 +9,13 @@ Object.defineProperty(exports, "BlockHeader", {
|
|
|
9
9
|
return _blockHeader.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "Button", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _button.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
require("@dtinsight/react-icons/dist/index.css");
|
|
13
|
-
require("./styles/entry.less");
|
|
14
19
|
var _blockHeader = _interopRequireDefault(require("./blockHeader"));
|
|
20
|
+
var _button = _interopRequireDefault(require("./button"));
|
|
15
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./themes/index.less";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "~antd/es/style/themes/default.less";
|
package/package.json
CHANGED
package/esm/styles/entry.less
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@primary-color: red;
|
package/lib/styles/entry.less
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@primary-color: red;
|