@aloudata/aloudata-design 0.4.0-beta.6 → 0.4.0-beta.8
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/Avatar/component/Avatar/index.d.ts +84 -0
- package/es/Avatar/component/Avatar/index.js +42 -0
- package/es/Avatar/index.d.ts +1 -13
- package/es/Avatar/index.js +1 -30
- package/es/Avatar/style/index.less +1 -1
- package/es/Button/index.d.ts +1 -1
- package/es/Button/index.js +3 -8
- package/es/Button/style/index.less +7 -1
- package/es/Button/style/variables.less +26 -26
- package/es/Checkbox/component/CheckboxGroup/index.d.ts +4 -0
- package/es/Checkbox/component/CheckboxGroup/index.js +27 -0
- package/es/Checkbox/index.d.ts +4 -5
- package/es/Checkbox/index.js +3 -12
- package/es/Checkbox/style/index.less +36 -12
- package/es/Checkbox/type.d.ts +94 -0
- package/es/Checkbox/type.js +6 -0
- package/es/Divider/index.d.ts +40 -2
- package/es/Divider/index.js +10 -1
- package/es/Divider/style/index.less +4 -0
- package/es/Divider/style/index.less.d.ts +183 -0
- package/es/Icon/icons.js +135 -58
- package/es/Input/components/Input/index.d.ts +13 -1
- package/es/Input/components/Input/index.js +1 -3
- package/es/Input/components/Password/index.d.ts +6 -1
- package/es/Input/components/Password/index.js +11 -3
- package/es/Input/components/TextArea/index.d.ts +1 -1
- package/es/Input/style/index.less +139 -59
- package/es/InputNumber/index.d.ts +3 -3
- package/es/InputNumber/style/index.less +66 -26
- package/es/InputNumber/type.d.ts +161 -0
- package/es/InputNumber/type.js +1 -0
- package/es/Steps/style/index.less +10 -4
- package/es/Table/Table.js +31 -23
- package/es/Table/components/TableHead/index.d.ts +0 -1
- package/es/Table/components/TableHead/index.js +1 -2
- package/es/Table/interface.d.ts +1 -0
- package/es/Table/style/index.less +2 -1
- package/es/Table/utils.js +16 -9
- package/es/Tabs/style/index.less +1 -1
- package/es/Tooltip/style/index.less +1 -1
- package/es/index.d.ts +3 -3
- package/es/style/themes/default/scrollBar.less +10 -7
- package/es/style/themes/default/themeColor.module.less +164 -166
- package/lib/Avatar/component/Avatar/index.d.ts +84 -0
- package/lib/Avatar/component/Avatar/index.js +61 -0
- package/lib/Avatar/index.d.ts +1 -13
- package/lib/Avatar/index.js +3 -44
- package/lib/Avatar/style/index.less +1 -1
- package/lib/Button/index.d.ts +1 -1
- package/lib/Button/index.js +3 -8
- package/lib/Button/style/index.less +7 -1
- package/lib/Button/style/variables.less +26 -26
- package/lib/Checkbox/component/CheckboxGroup/index.d.ts +4 -0
- package/lib/Checkbox/component/CheckboxGroup/index.js +42 -0
- package/lib/Checkbox/index.d.ts +4 -5
- package/lib/Checkbox/index.js +4 -13
- package/lib/Checkbox/style/index.less +36 -12
- package/lib/Checkbox/type.d.ts +94 -0
- package/lib/Checkbox/type.js +13 -0
- package/lib/Divider/index.d.ts +40 -2
- package/lib/Divider/index.js +11 -1
- package/lib/Divider/style/index.less +4 -0
- package/lib/Divider/style/index.less.d.ts +183 -0
- package/lib/Icon/icons.js +135 -58
- package/lib/Input/components/Input/index.d.ts +13 -1
- package/lib/Input/components/Input/index.js +1 -3
- package/lib/Input/components/Password/index.d.ts +6 -1
- package/lib/Input/components/Password/index.js +14 -4
- package/lib/Input/components/TextArea/index.d.ts +1 -1
- package/lib/Input/style/index.less +139 -59
- package/lib/InputNumber/index.d.ts +3 -3
- package/lib/InputNumber/style/index.less +66 -26
- package/lib/InputNumber/type.d.ts +161 -0
- package/lib/InputNumber/type.js +5 -0
- package/lib/Steps/style/index.less +10 -4
- package/lib/Table/Table.js +31 -23
- package/lib/Table/components/TableHead/index.d.ts +0 -1
- package/lib/Table/components/TableHead/index.js +1 -2
- package/lib/Table/interface.d.ts +1 -0
- package/lib/Table/style/index.less +2 -1
- package/lib/Table/utils.js +16 -9
- package/lib/Tabs/style/index.less +1 -1
- package/lib/Tooltip/style/index.less +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/style/themes/default/scrollBar.less +10 -7
- package/lib/style/themes/default/themeColor.module.less +164 -166
- package/package.json +2 -2
- package/es/Table/hooks/useTableColumn.d.ts +0 -28
- package/es/Table/hooks/useTableColumn.js +0 -53
- package/lib/Table/hooks/useTableColumn.d.ts +0 -28
- package/lib/Table/hooks/useTableColumn.js +0 -66
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AvatarProps as antdAvatarProps } from 'antd/es/avatar/avatar';
|
|
3
|
+
import Group from 'antd/es/avatar/group';
|
|
4
|
+
export type { GroupProps } from 'antd/es/avatar/group';
|
|
5
|
+
declare type TSize = 'large' | 'middle' | 'small' | number;
|
|
6
|
+
export interface IAvatarProps extends Omit<antdAvatarProps, 'size'> {
|
|
7
|
+
/**
|
|
8
|
+
* @description 指定头像的形状
|
|
9
|
+
* @type 'circle' |'square'
|
|
10
|
+
* @default circle
|
|
11
|
+
*/
|
|
12
|
+
shape?: 'circle' | 'square';
|
|
13
|
+
/**
|
|
14
|
+
* @description 字符类型距离左右两侧边界单位像素
|
|
15
|
+
* @type number
|
|
16
|
+
* @default 4
|
|
17
|
+
*/
|
|
18
|
+
gap?: number;
|
|
19
|
+
/**
|
|
20
|
+
* @description 图片头像的资源地址或者图片元素
|
|
21
|
+
* @type string | ReactNode
|
|
22
|
+
* @default -
|
|
23
|
+
*/
|
|
24
|
+
src?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* @description 设置图片类头像响应式资源地址
|
|
27
|
+
* @type string
|
|
28
|
+
* @default -
|
|
29
|
+
*/
|
|
30
|
+
srcSet?: string;
|
|
31
|
+
/**
|
|
32
|
+
* @description 图片是否允许拖动
|
|
33
|
+
* @type boolean | 'true' | 'false'
|
|
34
|
+
* @default -
|
|
35
|
+
*/
|
|
36
|
+
draggable?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @description 设置头像的自定义图标
|
|
39
|
+
* @type ReactNode
|
|
40
|
+
* @default -
|
|
41
|
+
*/
|
|
42
|
+
icon?: React.ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* @description 图像无法显示时的替代文本
|
|
45
|
+
* @type string
|
|
46
|
+
* @default -
|
|
47
|
+
*/
|
|
48
|
+
alt?: string;
|
|
49
|
+
/**
|
|
50
|
+
* @description CORS属性设置
|
|
51
|
+
* @type '' | 'anonymous' | 'use-credentials'
|
|
52
|
+
* @default -
|
|
53
|
+
*/
|
|
54
|
+
crossOrigin?: '' | 'anonymous' | 'use-credentials';
|
|
55
|
+
/**
|
|
56
|
+
* @description 点击事件
|
|
57
|
+
* @type (e?: React.MouseEvent<HTMLElement>) => void
|
|
58
|
+
* @default -
|
|
59
|
+
*/
|
|
60
|
+
onClick?: (e?: React.MouseEvent<HTMLElement>) => void;
|
|
61
|
+
/**
|
|
62
|
+
* @description 图片加载失败的事件,返回false会关闭组件默认的fallback行为
|
|
63
|
+
* @type () => boolean
|
|
64
|
+
* @default -
|
|
65
|
+
*/
|
|
66
|
+
onError?: () => boolean;
|
|
67
|
+
/**
|
|
68
|
+
* @description 头像的大小,可以显示的设置数字或者预设的大小值
|
|
69
|
+
* @type 'large' | 'middle' | 'small' | number
|
|
70
|
+
* @default middle
|
|
71
|
+
*/
|
|
72
|
+
size?: TSize;
|
|
73
|
+
/**
|
|
74
|
+
* @description 是否展示完整的children内容,如果children为string则默认截取第一个单词作为头像展示
|
|
75
|
+
* @type boolean
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
showFullValue?: boolean;
|
|
79
|
+
}
|
|
80
|
+
interface ICompoundedComponent extends React.ForwardRefExoticComponent<IAvatarProps & React.RefAttributes<HTMLElement>> {
|
|
81
|
+
Group: typeof Group;
|
|
82
|
+
}
|
|
83
|
+
declare const _default: ICompoundedComponent;
|
|
84
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var _excluded = ["size", "showFullValue", "children"];
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import InternalAvatar from 'antd/es/avatar/avatar';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
var ZERO = 0;
|
|
11
|
+
|
|
12
|
+
var Avatar = function Avatar(props) {
|
|
13
|
+
var _props$size = props.size,
|
|
14
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
15
|
+
_props$showFullValue = props.showFullValue,
|
|
16
|
+
showFullValue = _props$showFullValue === void 0 ? false : _props$showFullValue,
|
|
17
|
+
children = props.children,
|
|
18
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
19
|
+
|
|
20
|
+
var getSizeClass = function getSizeClass(avatarSize) {
|
|
21
|
+
if (['large', 'small', 'mini'].includes("".concat(avatarSize))) {
|
|
22
|
+
return classNames('ald-avatar', "ald-avatar-".concat(avatarSize));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return classNames('ald-avatar', 'ald-avatar-middle');
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var getChildren = function getChildren() {
|
|
29
|
+
if (!showFullValue && typeof children === 'string') {
|
|
30
|
+
return children[ZERO].toLocaleUpperCase();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return children;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return /*#__PURE__*/React.createElement(InternalAvatar, Object.assign({
|
|
37
|
+
size: typeof size === 'number' ? size : undefined,
|
|
38
|
+
className: getSizeClass(size)
|
|
39
|
+
}, restProps), getChildren());
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default Avatar;
|
package/es/Avatar/index.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AvatarProps as antdAvatarProps } from 'antd/es/avatar/avatar';
|
|
3
|
-
import Group from 'antd/es/avatar/group';
|
|
4
|
-
export type { GroupProps } from 'antd/es/avatar/group';
|
|
5
|
-
declare type TSize = 'large' | 'middle' | 'small' | 'mini' | number;
|
|
6
|
-
interface IAvatarProps extends Omit<antdAvatarProps, 'size'> {
|
|
7
|
-
size?: TSize;
|
|
8
|
-
}
|
|
1
|
+
import Avatar, { IAvatarProps } from './component/Avatar';
|
|
9
2
|
export type { IAvatarProps };
|
|
10
|
-
interface ICompoundedComponent extends React.ForwardRefExoticComponent<IAvatarProps & React.RefAttributes<HTMLElement>> {
|
|
11
|
-
Group: typeof Group;
|
|
12
|
-
}
|
|
13
|
-
declare const Avatar: ICompoundedComponent;
|
|
14
|
-
export { Group };
|
|
15
3
|
export default Avatar;
|
package/es/Avatar/index.js
CHANGED
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
var _excluded = ["size"];
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
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; }
|
|
6
|
-
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
import InternalAvatar from 'antd/es/avatar/avatar';
|
|
9
1
|
import Group from 'antd/es/avatar/group';
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
var Avatar = function A(props) {
|
|
13
|
-
var _props$size = props.size,
|
|
14
|
-
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
15
|
-
restProps = _objectWithoutProperties(props, _excluded);
|
|
16
|
-
|
|
17
|
-
var getSizeClass = function getSizeClass(avatarSize) {
|
|
18
|
-
if (['large', 'small', 'mini'].includes("".concat(avatarSize))) {
|
|
19
|
-
return classNames('ald-avatar', "ald-avatar-".concat(avatarSize));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return classNames('ald-avatar', 'ald-avatar-middle');
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return /*#__PURE__*/React.createElement(InternalAvatar, Object.assign({
|
|
26
|
-
size: typeof size === 'number' ? size : undefined,
|
|
27
|
-
className: getSizeClass(size)
|
|
28
|
-
}, restProps));
|
|
29
|
-
};
|
|
30
|
-
|
|
2
|
+
import Avatar from './component/Avatar';
|
|
31
3
|
Avatar.Group = Group;
|
|
32
|
-
export { Group };
|
|
33
4
|
export default Avatar;
|
package/es/Button/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ButtonProps as AntdButtonProps } from 'antd/lib/button';
|
|
3
3
|
export declare type ButtonType = 'primary' | 'secondary' | 'dangerous' | 'text' | 'link';
|
|
4
|
-
export declare type Size = '
|
|
4
|
+
export declare type Size = 'small' | 'default' | 'large';
|
|
5
5
|
export interface IButtonProps extends Omit<AntdButtonProps, 'type' | 'size' | 'dangerous' | 'shape' | 'icon' | 'href' | 'target' | 'onClick' | 'loading'> {
|
|
6
6
|
/**
|
|
7
7
|
* @description 类型
|
package/es/Button/index.js
CHANGED
|
@@ -17,10 +17,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
var iconPrefixCls = 'aldicon';
|
|
20
|
-
var ICON_LARGE =
|
|
21
|
-
var ICON_MIDDLE =
|
|
22
|
-
var ICON_SMALL =
|
|
23
|
-
var ICON_MINI = 12;
|
|
20
|
+
var ICON_LARGE = 24;
|
|
21
|
+
var ICON_MIDDLE = 20;
|
|
22
|
+
var ICON_SMALL = 16;
|
|
24
23
|
|
|
25
24
|
function Button(props) {
|
|
26
25
|
var prefix = 'ald-btn';
|
|
@@ -75,10 +74,6 @@ function Button(props) {
|
|
|
75
74
|
return ICON_SMALL;
|
|
76
75
|
}
|
|
77
76
|
|
|
78
|
-
if (ButtonSize === 'mini') {
|
|
79
|
-
return ICON_MINI;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
77
|
return ICON_MIDDLE;
|
|
83
78
|
}
|
|
84
79
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
display: inline-flex;
|
|
16
16
|
align-items: center;
|
|
17
17
|
justify-content: center;
|
|
18
|
-
font-weight:
|
|
18
|
+
font-weight: 600;
|
|
19
19
|
font-size: 12px;
|
|
20
20
|
text-shadow: none;
|
|
21
21
|
}
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
background-color: @button-primary-bg-color-disable;
|
|
52
52
|
border-color: @button-primary-bg-color-disable;
|
|
53
53
|
cursor: default;
|
|
54
|
+
opacity: 0.5;
|
|
54
55
|
|
|
55
56
|
&:hover,
|
|
56
57
|
&:focus,
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
background-color: @button-dangerous-bg-color-disable;
|
|
89
90
|
border-color: @button-dangerous-bg-color-disable;
|
|
90
91
|
cursor: default;
|
|
92
|
+
opacity: 0.5;
|
|
91
93
|
|
|
92
94
|
&:hover,
|
|
93
95
|
&:focus,
|
|
@@ -134,6 +136,7 @@
|
|
|
134
136
|
background-color: @button-secondary-bg-color-disable;
|
|
135
137
|
border-color: @button-secondary-border-color;
|
|
136
138
|
cursor: default;
|
|
139
|
+
opacity: 0.5;
|
|
137
140
|
|
|
138
141
|
&:hover,
|
|
139
142
|
&:focus,
|
|
@@ -168,6 +171,7 @@
|
|
|
168
171
|
color: @button-text-color-disable;
|
|
169
172
|
background-color: @button-text-bg-color-disable;
|
|
170
173
|
cursor: default;
|
|
174
|
+
opacity: 0.5;
|
|
171
175
|
|
|
172
176
|
&:hover,
|
|
173
177
|
&:focus,
|
|
@@ -208,6 +212,7 @@
|
|
|
208
212
|
background-color: @button-link-bg-color-disable;
|
|
209
213
|
border-color: @button-link-bg-color-disable;
|
|
210
214
|
cursor: default;
|
|
215
|
+
opacity: 0.5;
|
|
211
216
|
|
|
212
217
|
&:hover,
|
|
213
218
|
&:focus,
|
|
@@ -231,6 +236,7 @@
|
|
|
231
236
|
height: @button-height-large;
|
|
232
237
|
padding: @button-border-padding-large;
|
|
233
238
|
font-size: @button-text-size-large;
|
|
239
|
+
line-height: 24px;
|
|
234
240
|
border-radius: @button-border-radius-large;
|
|
235
241
|
|
|
236
242
|
&.ant-btn-icon-only {
|
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
@button-height-large: 36px;
|
|
8
8
|
@button-text-size-large: 16px;
|
|
9
9
|
@button-border-radius-large: 8px;
|
|
10
|
-
@button-border-padding-large:
|
|
10
|
+
@button-border-padding-large: 6px 14px;
|
|
11
11
|
@button-left-icon-margin-right-large: 8px;
|
|
12
12
|
|
|
13
13
|
@button-height-middle: 32px;
|
|
14
14
|
@button-text-size-middle: 14px;
|
|
15
|
-
@button-border-radius-middle:
|
|
16
|
-
@button-border-padding-middle:
|
|
15
|
+
@button-border-radius-middle: 8px;
|
|
16
|
+
@button-border-padding-middle: 6px 12px;
|
|
17
17
|
@button-left-icon-margin-right-middle: 8px;
|
|
18
18
|
|
|
19
19
|
@button-height-small: 28px;
|
|
20
20
|
@button-text-size-small: 12px;
|
|
21
|
-
@button-border-radius-small:
|
|
22
|
-
@button-border-padding-small:
|
|
21
|
+
@button-border-radius-small: 6px;
|
|
22
|
+
@button-border-padding-small: 6px 10px;
|
|
23
23
|
@button-left-icon-margin-right-small: 4px;
|
|
24
24
|
|
|
25
25
|
@button-height-mini: 24px;
|
|
@@ -29,39 +29,39 @@
|
|
|
29
29
|
@button-left-icon-margin-right-mini: 4px;
|
|
30
30
|
|
|
31
31
|
/**** type控制 ****/
|
|
32
|
-
@button-primary-bg-color: @
|
|
33
|
-
@button-primary-bg-color-active: @
|
|
34
|
-
@button-primary-bg-color-disable: @
|
|
32
|
+
@button-primary-bg-color: @B40;
|
|
33
|
+
@button-primary-bg-color-active: @B30;
|
|
34
|
+
@button-primary-bg-color-disable: @B40;
|
|
35
35
|
@button-primary-color: @ND0;
|
|
36
36
|
@button-primary-color-active: @ND0;
|
|
37
37
|
@button-primary-color-disable: @ND0;
|
|
38
38
|
|
|
39
|
-
@button-dangerous-bg-color: @
|
|
40
|
-
@button-dangerous-bg-color-active: @
|
|
41
|
-
@button-dangerous-bg-color-disable: @
|
|
39
|
+
@button-dangerous-bg-color: @SC40;
|
|
40
|
+
@button-dangerous-bg-color-active: @SC30;
|
|
41
|
+
@button-dangerous-bg-color-disable: @SC40;
|
|
42
42
|
@button-dangerous-color: @ND0;
|
|
43
43
|
@button-dangerous-color-active: @ND0;
|
|
44
44
|
@button-dangerous-color-disable: @ND0;
|
|
45
45
|
|
|
46
|
-
@button-secondary-bg-color: @
|
|
47
|
-
@button-secondary-bg-color-active: @
|
|
48
|
-
@button-secondary-bg-color-disable: @
|
|
49
|
-
@button-secondary-color: @
|
|
50
|
-
@button-secondary-color-active: @
|
|
51
|
-
@button-secondary-color-disable: @
|
|
52
|
-
@button-secondary-border-color: @
|
|
53
|
-
@button-secondary-border-color-active: @
|
|
46
|
+
@button-secondary-bg-color: @BG100;
|
|
47
|
+
@button-secondary-bg-color-active: @BG90;
|
|
48
|
+
@button-secondary-bg-color-disable: @BG100;
|
|
49
|
+
@button-secondary-color: @NL20;
|
|
50
|
+
@button-secondary-color-active: @NL20;
|
|
51
|
+
@button-secondary-color-disable: @NL20;
|
|
52
|
+
@button-secondary-border-color: @BG60;
|
|
53
|
+
@button-secondary-border-color-active: @BG60;
|
|
54
54
|
|
|
55
55
|
@button-text-bg-color: transparent;
|
|
56
|
-
@button-text-bg-color-active: @
|
|
56
|
+
@button-text-bg-color-active: @NL90;
|
|
57
57
|
@button-text-bg-color-disable: transparent;
|
|
58
|
-
@button-text-color: @
|
|
59
|
-
@button-text-color-active: @
|
|
60
|
-
@button-text-color-disable: @
|
|
58
|
+
@button-text-color: @NL20;
|
|
59
|
+
@button-text-color-active: @NL20;
|
|
60
|
+
@button-text-color-disable: @NL20;
|
|
61
61
|
|
|
62
62
|
@button-link-bg-color: transparent;
|
|
63
63
|
@button-link-bg-color-active: transparent;
|
|
64
64
|
@button-link-bg-color-disable: transparent;
|
|
65
|
-
@button-link-color: @
|
|
66
|
-
@button-link-color-active: @
|
|
67
|
-
@button-link-color-disable: @
|
|
65
|
+
@button-link-color: @B30;
|
|
66
|
+
@button-link-color-active: @B20;
|
|
67
|
+
@button-link-color-disable: @B30;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "antd/es/checkbox/style";
|
|
2
|
+
import _Checkbox from "antd/es/checkbox";
|
|
3
|
+
var _excluded = ["className", "direction"];
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { EDirection } from '../../type'; // "vertical" | "horizontal"
|
|
12
|
+
|
|
13
|
+
var AntdCheckboxGroup = _Checkbox.Group;
|
|
14
|
+
|
|
15
|
+
var CheckboxGroup = function CheckboxGroup(props) {
|
|
16
|
+
var className = props.className,
|
|
17
|
+
direction = props.direction,
|
|
18
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
19
|
+
|
|
20
|
+
return /*#__PURE__*/React.createElement(AntdCheckboxGroup, Object.assign({
|
|
21
|
+
className: classNames('ald-checkbox', className, {
|
|
22
|
+
'ald-checkout-group-vertical': direction === EDirection.VERTICAL
|
|
23
|
+
})
|
|
24
|
+
}, otherProps));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default CheckboxGroup;
|
package/es/Checkbox/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { CheckboxGroupProps } from 'antd/lib/checkbox';
|
|
2
|
+
import { ICheckboxGroupProps, ICheckboxProps } from './type';
|
|
4
3
|
export type { CheckboxValueType, CheckboxOptionType } from 'antd/es/checkbox/Group';
|
|
5
4
|
export type { CheckboxChangeEvent } from 'antd/es/checkbox/Checkbox';
|
|
6
|
-
declare function Checkbox(props:
|
|
5
|
+
declare function Checkbox(props: ICheckboxProps): JSX.Element;
|
|
7
6
|
declare namespace Checkbox {
|
|
8
|
-
var Group: (props:
|
|
7
|
+
var Group: (props: ICheckboxGroupProps) => JSX.Element;
|
|
9
8
|
}
|
|
10
|
-
export type {
|
|
9
|
+
export type { ICheckboxProps, ICheckboxGroupProps };
|
|
11
10
|
export default Checkbox;
|
package/es/Checkbox/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "antd/es/checkbox/style";
|
|
2
2
|
import _Checkbox from "antd/es/checkbox";
|
|
3
|
-
var _excluded = ["className"]
|
|
4
|
-
_excluded2 = ["className"];
|
|
3
|
+
var _excluded = ["className"];
|
|
5
4
|
|
|
6
5
|
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; }
|
|
7
6
|
|
|
@@ -9,7 +8,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
9
8
|
|
|
10
9
|
import React from 'react';
|
|
11
10
|
import classNames from 'classnames';
|
|
12
|
-
|
|
11
|
+
import CheckboxGroup from './component/CheckboxGroup';
|
|
13
12
|
|
|
14
13
|
function Checkbox(props) {
|
|
15
14
|
var className = props.className,
|
|
@@ -20,13 +19,5 @@ function Checkbox(props) {
|
|
|
20
19
|
}, otherProps));
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
Checkbox.Group =
|
|
24
|
-
var className = props.className,
|
|
25
|
-
otherProps = _objectWithoutProperties(props, _excluded2);
|
|
26
|
-
|
|
27
|
-
return /*#__PURE__*/React.createElement(CheckboxGroup, Object.assign({
|
|
28
|
-
className: classNames('ald-checkbox', className)
|
|
29
|
-
}, otherProps));
|
|
30
|
-
};
|
|
31
|
-
|
|
22
|
+
Checkbox.Group = CheckboxGroup;
|
|
32
23
|
export default Checkbox;
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
.ant-checkbox-checked {
|
|
26
26
|
&::after,
|
|
27
27
|
.ant-checkbox-inner {
|
|
28
|
-
background-color: @
|
|
29
|
-
border-color: @
|
|
28
|
+
background-color: @B95;
|
|
29
|
+
border-color: @B40;
|
|
30
30
|
border-radius: 4px;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.ant-checkbox-inner {
|
|
34
|
-
background-color: @
|
|
35
|
-
border-color: @
|
|
34
|
+
background-color: @B95;
|
|
35
|
+
border-color: @B40;
|
|
36
36
|
|
|
37
37
|
&::after {
|
|
38
38
|
top: 3px;
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
z-index: 10;
|
|
41
41
|
width: 10px;
|
|
42
42
|
height: 8px;
|
|
43
|
-
background: url('data:image/svg+xml;base64,
|
|
43
|
+
background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEwIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOS42NzU3MyAwLjI2Mjg1MkMxMC4wODI4IDAuNjM2MDQ0IDEwLjExMDQgMS4yNjg2MSA5LjczNzE2IDEuNjc1NzNMNC4yMzcxNiA3LjY3NTczQzQuMDQ3NzUgNy44ODIzNiAzLjc4MDMxIDguMDAwMDEgMy41MDAwMSA4LjAwMDAxQzMuMjE5NyA4LjAwMDAxIDIuOTUyMjYgNy44ODIzNiAyLjc2Mjg1IDcuNjc1NzNMMC4yNjI4NTIgNC45NDg0NkMtMC4xMTAzNDEgNC41NDEzNCAtMC4wODI4Mzc4IDMuOTA4NzcgMC4zMjQyODEgMy41MzU1OEMwLjczMTQgMy4xNjIzOSAxLjM2Mzk3IDMuMTg5ODkgMS43MzcxNiAzLjU5NzAxTDMuNTAwMDEgNS41MjAxMUw4LjI2Mjg1IDAuMzI0MjgxQzguNjM2MDQgLTAuMDgyODM3OCA5LjI2ODYxIC0wLjExMDM0MSA5LjY3NTczIDAuMjYyODUyWiIgZmlsbD0iIzE1NzBFRiIvPgo8L3N2Zz4K')
|
|
44
44
|
no-repeat;
|
|
45
45
|
border-width: 0;
|
|
46
46
|
transform: none;
|
|
@@ -50,15 +50,17 @@
|
|
|
50
50
|
|
|
51
51
|
.ant-checkbox-disabled {
|
|
52
52
|
cursor: default;
|
|
53
|
+
opacity: 0.5;
|
|
53
54
|
|
|
54
55
|
& + span {
|
|
55
56
|
color: @NL0;
|
|
56
57
|
cursor: default;
|
|
58
|
+
opacity: 0.5;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
.ant-checkbox-inner {
|
|
60
|
-
background-color: @
|
|
61
|
-
border-color: @
|
|
62
|
+
background-color: @B95;
|
|
63
|
+
border-color: @B40;
|
|
62
64
|
|
|
63
65
|
&::after {
|
|
64
66
|
top: 3px;
|
|
@@ -66,7 +68,7 @@
|
|
|
66
68
|
z-index: 10;
|
|
67
69
|
width: 10px;
|
|
68
70
|
height: 8px;
|
|
69
|
-
background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEwIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+
|
|
71
|
+
background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEwIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOS42NzU3MyAwLjI2Mjg1MkMxMC4wODI4IDAuNjM2MDQ0IDEwLjExMDQgMS4yNjg2MSA5LjczNzE2IDEuNjc1NzNMNC4yMzcxNiA3LjY3NTczQzQuMDQ3NzUgNy44ODIzNiAzLjc4MDMxIDguMDAwMDEgMy41MDAwMSA4LjAwMDAxQzMuMjE5NyA4LjAwMDAxIDIuOTUyMjYgNy44ODIzNiAyLjc2Mjg1IDcuNjc1NzNMMC4yNjI4NTIgNC45NDg0NkMtMC4xMTAzNDEgNC41NDEzNCAtMC4wODI4Mzc4IDMuOTA4NzcgMC4zMjQyODEgMy41MzU1OEMwLjczMTQgMy4xNjIzOSAxLjM2Mzk3IDMuMTg5ODkgMS43MzcxNiAzLjU5NzAxTDMuNTAwMDEgNS41MjAxMUw4LjI2Mjg1IDAuMzI0MjgxQzguNjM2MDQgLTAuMDgyODM3OCA5LjI2ODYxIC0wLjExMDM0MSA5LjY3NTczIDAuMjYyODUyWiIgZmlsbD0iIzE1NzBFRiIvPgo8L3N2Zz4K');
|
|
70
72
|
border-width: 0;
|
|
71
73
|
transform: none;
|
|
72
74
|
}
|
|
@@ -75,12 +77,13 @@
|
|
|
75
77
|
|
|
76
78
|
.ant-checkbox-indeterminate {
|
|
77
79
|
.ant-checkbox-inner {
|
|
78
|
-
background-color: @
|
|
79
|
-
border-color: @
|
|
80
|
+
background-color: @B95;
|
|
81
|
+
border-color: @B40;
|
|
80
82
|
|
|
81
83
|
&::after {
|
|
82
84
|
width: 10px;
|
|
83
85
|
height: 2px;
|
|
86
|
+
background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMiIgdmlld0JveD0iMCAwIDEwIDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMCIgaGVpZ2h0PSIyIiByeD0iMSIgZmlsbD0iIzE1NzBFRiIvPgo8L3N2Zz4K');
|
|
84
87
|
background-color: @ND0;
|
|
85
88
|
border-radius: 2px;
|
|
86
89
|
}
|
|
@@ -88,22 +91,43 @@
|
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
.ant-checkbox + span {
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
91
96
|
padding-right: 10px;
|
|
92
97
|
padding-left: 10px;
|
|
93
98
|
}
|
|
99
|
+
|
|
100
|
+
&:hover .ant-checkbox-inner {
|
|
101
|
+
border-color: @B40;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ant-checkbox-disabled .ant-checkbox-inner:hover {
|
|
105
|
+
box-shadow: unset;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.ant-checkbox:hover .ant-checkbox-inner {
|
|
109
|
+
border-color: @B40;
|
|
110
|
+
box-shadow: @shadow-primary;
|
|
111
|
+
}
|
|
94
112
|
}
|
|
95
113
|
|
|
96
114
|
.ant-checkbox-group.ald-checkbox,
|
|
97
115
|
.ant-checkbox-wrapper.ald-checkbox {
|
|
98
116
|
.ant-checkbox-input:focus + .ant-checkbox-inner {
|
|
99
|
-
border-color: @
|
|
117
|
+
border-color: @B40;
|
|
100
118
|
}
|
|
101
119
|
|
|
102
120
|
.ant-checkbox:hover .ant-checkbox-inner {
|
|
103
|
-
border-color: @
|
|
121
|
+
border-color: @B40;
|
|
104
122
|
}
|
|
105
123
|
}
|
|
106
124
|
|
|
107
125
|
.ald-checkbox.ant-checkbox-wrapper-disabled {
|
|
108
126
|
cursor: default;
|
|
109
127
|
}
|
|
128
|
+
|
|
129
|
+
.ald-checkout-group-vertical {
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
gap: 16px;
|
|
133
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { CheckboxChangeEvent, CheckboxGroupProps, CheckboxProps } from 'antd/lib/checkbox';
|
|
2
|
+
import { CheckboxOptionType, CheckboxValueType } from 'antd/lib/checkbox/Group';
|
|
3
|
+
export declare enum EDirection {
|
|
4
|
+
VERTICAL = "vertical",
|
|
5
|
+
HORIZONTAL = "horizontal"
|
|
6
|
+
}
|
|
7
|
+
export interface ICheckboxProps extends CheckboxProps {
|
|
8
|
+
/**
|
|
9
|
+
* @description 自动获取焦点
|
|
10
|
+
* @type boolean
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
autoFocus?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @description 指定当前是否选中
|
|
16
|
+
* @type boolean
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
checked?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @description 初始是否选中
|
|
22
|
+
* @type boolean
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
defaultChecked?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* @description 失效状态
|
|
28
|
+
* @type boolean
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @description 设置 indeterminate 状态,只负责样式控制
|
|
34
|
+
* @type boolean
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
indeterminate?: false;
|
|
38
|
+
/**
|
|
39
|
+
* @description 变化时的回调函数
|
|
40
|
+
* @type function(e:Event)
|
|
41
|
+
* @default -
|
|
42
|
+
*/
|
|
43
|
+
onChange?: (e: CheckboxChangeEvent) => void;
|
|
44
|
+
}
|
|
45
|
+
export interface ICheckboxGroupProps extends CheckboxGroupProps {
|
|
46
|
+
/**
|
|
47
|
+
* @description 默认选中的选项
|
|
48
|
+
* @type string[]
|
|
49
|
+
* @default []
|
|
50
|
+
*/
|
|
51
|
+
defaultValue?: Array<CheckboxValueType>;
|
|
52
|
+
/**
|
|
53
|
+
* @description 整组失效
|
|
54
|
+
* @type boolean
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* @description CheckboxGroup 下所有 input[type="checkbox"] 的 name 属性
|
|
60
|
+
* @type string
|
|
61
|
+
* @default -
|
|
62
|
+
*/
|
|
63
|
+
name?: string;
|
|
64
|
+
/**
|
|
65
|
+
* @description 指定可选项
|
|
66
|
+
* @type string[] | number[] | Option[]
|
|
67
|
+
* @default []
|
|
68
|
+
*/
|
|
69
|
+
options?: Array<CheckboxOptionType | string | number>;
|
|
70
|
+
/**
|
|
71
|
+
* @description 指定选中的选项
|
|
72
|
+
* @type string[]
|
|
73
|
+
* @default []
|
|
74
|
+
*/
|
|
75
|
+
value?: Array<CheckboxValueType>;
|
|
76
|
+
/**
|
|
77
|
+
* @description 变化时毁掉函数
|
|
78
|
+
* @type function(checkedValue)
|
|
79
|
+
* @default -
|
|
80
|
+
*/
|
|
81
|
+
onChange?: (checkedValue: Array<CheckboxValueType>) => void;
|
|
82
|
+
/**
|
|
83
|
+
* @description 复选按钮组的方向
|
|
84
|
+
* @type 'vertical' | 'horizontal'
|
|
85
|
+
* @default -
|
|
86
|
+
*/
|
|
87
|
+
direction: EDirection.VERTICAL;
|
|
88
|
+
/**
|
|
89
|
+
* @description className
|
|
90
|
+
* @type string
|
|
91
|
+
* @default -
|
|
92
|
+
*/
|
|
93
|
+
className?: string;
|
|
94
|
+
}
|