@titaui/pc 1.7.20 → 1.7.24
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/lib/components/cascader/index.css +38 -11
- package/lib/components/cascader/index.js +10 -5
- package/lib/components/cascader/time.js +31 -0
- package/lib/components/form/form-fields/group/index.js +2 -1
- package/lib/components/menus/components/menu-tree/index.css +4 -0
- package/lib/components/nav-top/components/user-own-menu/utils.js +1 -1
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +4 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +2 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +2 -2
- package/lib/components/scrollbar/index.js +13 -3
- package/lib/components/select-tags/index.css +51 -40
- package/lib/components/select-tags/index.js +8 -10
- package/lib/components/upvote/index.js +19 -14
- package/lib/index.js +8 -0
- package/lib/utils/bs-global.js +0 -7
- package/package.json +1 -1
- package/src/components/cascader/index.scss +50 -27
- package/src/components/cascader/index.tsx +18 -16
- package/src/components/cascader/time.js +13 -0
- package/src/components/form/form-fields/group/index.tsx +3 -3
- package/src/components/menus/components/menu-tree/index.scss +3 -0
- package/src/components/menus/export-modules/manage-menus/index.tsx +1 -1
- package/src/components/nav-top/components/user-own-menu/utils.ts +1 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +1 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +2 -2
- package/src/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +2 -2
- package/src/components/scrollbar/index.tsx +2 -1
- package/src/components/select-tags/index.scss +129 -105
- package/src/components/select-tags/index.tsx +32 -32
- package/src/components/upvote/index.tsx +12 -9
- package/src/index.d.ts +2 -1
- package/src/index.js +2 -1
- package/src/utils/bs-global.js +0 -10
|
@@ -13,37 +13,60 @@
|
|
|
13
13
|
font-size: 14px;
|
|
14
14
|
color: #3F4755;
|
|
15
15
|
}
|
|
16
|
+
&-popup{
|
|
17
|
+
z-index: 2000;
|
|
18
|
+
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
19
|
+
border: 1px solid #F0F2F5;
|
|
20
|
+
border-radius: 12px;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
.rc-cascader-menu{
|
|
23
|
+
width: 139px;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
border: 1px solid #F0F2F5;
|
|
26
|
+
padding: 16px 0 16px 6px;
|
|
27
|
+
&::-webkit-scrollbar{
|
|
28
|
+
width: 6px !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
.rc-cascader-menu-item-active{
|
|
33
|
+
background: unset;
|
|
34
|
+
color: #2879ff;
|
|
35
|
+
}
|
|
36
|
+
.rc-cascader-menu-item{
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
padding: 0 6px;
|
|
40
|
+
height: 36px;
|
|
41
|
+
align-items: center;
|
|
42
|
+
color: #3F4755;
|
|
43
|
+
&:hover{
|
|
44
|
+
color: #2879ff;
|
|
45
|
+
background: #F7F8FA;
|
|
46
|
+
border-radius: 8px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.rc-cascader-menu-item-disabled{
|
|
50
|
+
opacity:1;
|
|
51
|
+
cursor: auto;
|
|
52
|
+
&:hover{
|
|
53
|
+
color: #3F4755;
|
|
54
|
+
background: #FFFFFF;
|
|
55
|
+
border-radius: 8px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
.rc-cascader-menu-item-expand-icon{
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
16
62
|
.tu-icon-caret-down{
|
|
17
63
|
font-size: 16px;
|
|
18
64
|
transform: scale(0.5);
|
|
19
65
|
}
|
|
20
66
|
}
|
|
21
|
-
.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
.rc-cascader-menu{
|
|
28
|
-
width: 139px;
|
|
29
|
-
box-sizing: border-box;
|
|
30
|
-
border: 1px solid #F0F2F5;
|
|
31
|
-
padding: 16px 6px;
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
.rc-cascader-menu-item-active{
|
|
35
|
-
background: unset;
|
|
36
|
-
color: #2879ff;
|
|
37
|
-
}
|
|
38
|
-
.rc-cascader-menu-item{
|
|
39
|
-
box-sizing: border-box;
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
padding: 0 6px;
|
|
42
|
-
height: 36px;
|
|
43
|
-
align-items: center;
|
|
44
|
-
&:hover{
|
|
45
|
-
color: #2879ff;
|
|
46
|
-
background: #F7F8FA;
|
|
47
|
-
border-radius: 8px;
|
|
67
|
+
.titaui-cascader-time-popup{
|
|
68
|
+
.rc-cascader-menu{
|
|
69
|
+
width: 80px;
|
|
70
|
+
text-align: center;
|
|
48
71
|
}
|
|
49
72
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, { useState, useEffect
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import Rccascader from "rc-cascader";
|
|
3
|
+
import TimeCascader from "./time";
|
|
3
4
|
import "rc-cascader/assets/index.less";
|
|
4
5
|
import "./index.scss";
|
|
5
6
|
|
|
@@ -10,6 +11,7 @@ interface Props {
|
|
|
10
11
|
placeholder?: any;
|
|
11
12
|
initText?: any; //想要默认值输入框的值就传进来,不要问组件里为什么不做这个事情,优化算法
|
|
12
13
|
style?: any;
|
|
14
|
+
popupClassName?: any;
|
|
13
15
|
splitSymbol?: string;
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -23,13 +25,13 @@ const Cascader = ({
|
|
|
23
25
|
style = { width: "100px" },
|
|
24
26
|
placeholder = "请选择",
|
|
25
27
|
splitSymbol = "",
|
|
28
|
+
popupClassName = "",
|
|
26
29
|
...restProps
|
|
27
30
|
}: Props) => {
|
|
28
31
|
const [selectValue, setSelectValue] = useState(value);
|
|
29
32
|
const [inputValue, setInputValue] = useState(initText);
|
|
30
33
|
|
|
31
34
|
const handleChange = (value, selectedOptions) => {
|
|
32
|
-
console.log(value, selectedOptions);
|
|
33
35
|
onChange && onChange(value, selectedOptions);
|
|
34
36
|
setSelectValue(value);
|
|
35
37
|
let str = selectedOptions.map((o) => o.label).join(splitSymbol);
|
|
@@ -41,22 +43,22 @@ const Cascader = ({
|
|
|
41
43
|
}, [value]);
|
|
42
44
|
|
|
43
45
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</div>
|
|
55
|
-
<span className="tu-icon-caret-down" />
|
|
46
|
+
<Rccascader
|
|
47
|
+
options={options}
|
|
48
|
+
onChange={handleChange}
|
|
49
|
+
value={selectValue}
|
|
50
|
+
popupClassName={`${preCls}-popup ${popupClassName}`}
|
|
51
|
+
{...restProps}
|
|
52
|
+
>
|
|
53
|
+
<div className={preCls} style={style}>
|
|
54
|
+
<div className={`${preCls}-text`}>
|
|
55
|
+
{inputValue ? inputValue : placeholder}
|
|
56
56
|
</div>
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
<span className="tu-icon-caret-down" />
|
|
58
|
+
</div>
|
|
59
|
+
</Rccascader>
|
|
59
60
|
);
|
|
60
61
|
};
|
|
61
62
|
|
|
63
|
+
Cascader.TimeCascader = TimeCascader;
|
|
62
64
|
export default Cascader;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC,Fragment } from "react";
|
|
2
|
+
import Cascader from './index'
|
|
3
|
+
|
|
4
|
+
const TimeCascader = ({...restProps})=>{
|
|
5
|
+
return <Fragment>
|
|
6
|
+
<Cascader
|
|
7
|
+
popupClassName={' titaui-cascader-time-popup'}
|
|
8
|
+
{...restProps}
|
|
9
|
+
/>
|
|
10
|
+
</Fragment>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default TimeCascader
|
|
@@ -11,6 +11,7 @@ interface IProps {
|
|
|
11
11
|
require?: boolean;
|
|
12
12
|
width?: number;
|
|
13
13
|
children?: ReactElement;
|
|
14
|
+
className?: any;
|
|
14
15
|
direction?: "horizontal" | "vertical";
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -18,15 +19,14 @@ const FieldGroup = (props: IProps, ref) => {
|
|
|
18
19
|
const {
|
|
19
20
|
label = "",
|
|
20
21
|
direction = "vertical",
|
|
21
|
-
|
|
22
|
-
// values,
|
|
22
|
+
className,
|
|
23
23
|
children,
|
|
24
24
|
} = props;
|
|
25
25
|
|
|
26
26
|
useImperativeHandle(ref, () => ({}));
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
|
-
<div className={classNames(precls, `${precls}--${direction}`)}>
|
|
29
|
+
<div className={classNames(precls,className, `${precls}--${direction}`)}>
|
|
30
30
|
<div className={`${precls}__label`}>{label}</div>
|
|
31
31
|
<div className={`${precls}__content`}>
|
|
32
32
|
{React.Children.map(children, (child) => {
|
|
@@ -70,7 +70,7 @@ export default props => {
|
|
|
70
70
|
|
|
71
71
|
<span className={classNames(`${preCls}__e-project-node-actions-user`)}>
|
|
72
72
|
{/* <TextAvatar name={user.name} id={user.userId} width={76} editable onEditUser={onEditUserHandler} /> */}
|
|
73
|
-
<Avatar.Text name={data
|
|
73
|
+
<Avatar.Text name={data?.principalUser?.name} id={data?.principalUser?.userId} width={64} extraCls={isGray&&`${preCls}__e-project-node-gray`} />
|
|
74
74
|
</span>
|
|
75
75
|
|
|
76
76
|
<span className={classNames(`${preCls}__e-project-node-actions-date`)}>
|
|
@@ -218,8 +218,8 @@ export default (props) => {
|
|
|
218
218
|
className={classNames(`${preCls}__e-task-level2-node-actions-user`)}
|
|
219
219
|
>
|
|
220
220
|
<Avatar.Text
|
|
221
|
-
name={user
|
|
222
|
-
id={user
|
|
221
|
+
name={user?.name}
|
|
222
|
+
id={user?.userId}
|
|
223
223
|
width={64}
|
|
224
224
|
editable={hasAuth}
|
|
225
225
|
onEditUser={onEditUserHandler}
|
|
@@ -219,8 +219,8 @@ export default (props) => {
|
|
|
219
219
|
<span className={classNames(`${preCls}__e-task-node-actions`)}>
|
|
220
220
|
<span className={classNames(`${preCls}__e-task-node-actions-user`)}>
|
|
221
221
|
<Avatar.Text
|
|
222
|
-
name={user
|
|
223
|
-
id={user
|
|
222
|
+
name={user?.name}
|
|
223
|
+
id={user?.userId}
|
|
224
224
|
width={64}
|
|
225
225
|
editable={hasEditAuth}
|
|
226
226
|
onEditUser={onEditUserHandler}
|
|
@@ -11,13 +11,14 @@ interface Props {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export default (props: Props) => {
|
|
14
|
-
const { children, style } = props;
|
|
14
|
+
const { children, style,...restProps } = props;
|
|
15
15
|
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
return <SimpleBar
|
|
18
18
|
className={classNames(preCls)}
|
|
19
19
|
timeout={800}
|
|
20
20
|
style={style}
|
|
21
|
+
{...restProps}
|
|
21
22
|
>
|
|
22
23
|
{children}
|
|
23
24
|
</SimpleBar>
|
|
@@ -1,83 +1,112 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.titaui-select-tags {
|
|
2
|
+
display: flex;
|
|
3
|
+
.rc-select-single:not(.rc-select-customize-input) .rc-select-selector {
|
|
4
|
+
border: 1px solid #DFE3EA;
|
|
5
|
+
}
|
|
4
6
|
|
|
5
|
-
.rc-select-focused{
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
.rc-select-focused {
|
|
8
|
+
.rc-select-selector {
|
|
9
|
+
border: 1px solid #DFE3EA !important;
|
|
10
|
+
}
|
|
8
11
|
}
|
|
9
|
-
}
|
|
10
|
-
.rc-select-selection-item-remove{
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
}
|
|
14
|
-
.rc-select-multiple .rc-select-selector .rc-select-selection-search-input {
|
|
15
|
-
display: none;
|
|
16
|
-
}
|
|
17
12
|
|
|
18
|
-
.rc-select-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
.rc-select-selection-item-remove {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
}
|
|
21
17
|
|
|
22
|
-
.rc-select-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
18
|
+
.rc-select-multiple .rc-select-selector .rc-select-selection-search-input {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
26
21
|
|
|
27
|
-
.rc-select-single .rc-select-selector{
|
|
28
|
-
|
|
29
|
-
}
|
|
22
|
+
.rc-select-single:not(.rc-select-customize-input) .rc-select-selector .rc-select-selection-search-input {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
30
25
|
|
|
31
|
-
.rc-select-selector
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
border: 1px solid #DFE3EA;
|
|
37
|
-
height: 36px;
|
|
38
|
-
box-sizing: border-box;
|
|
39
|
-
}
|
|
40
|
-
.rc-select-multiple .rc-select-selector {
|
|
41
|
-
height: unset;
|
|
42
|
-
padding: 7px 12px 0;
|
|
43
|
-
border: 1px solid #DFE3EA;
|
|
44
|
-
}
|
|
45
|
-
.rc-select-multiple .rc-select-selector .rc-select-selection-overflow-item {
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
margin-bottom: 7px;
|
|
49
|
-
}
|
|
50
|
-
.rc-select-multiple .rc-select-selector .rc-select-selection-placeholder{
|
|
51
|
-
line-height: 1;
|
|
52
|
-
margin-bottom: 7px;
|
|
53
|
-
position: relative;
|
|
54
|
-
top: -2px;
|
|
55
|
-
}
|
|
26
|
+
.rc-select-single .rc-select-selector .rc-select-selection-item,
|
|
27
|
+
.rc-select-single .rc-select-selector .rc-select-selection-placeholder {
|
|
28
|
+
top: unset;
|
|
29
|
+
left: 12px;
|
|
30
|
+
}
|
|
56
31
|
|
|
57
|
-
.rc-select-
|
|
58
|
-
|
|
59
|
-
}
|
|
32
|
+
.rc-select-single .rc-select-selector {
|
|
33
|
+
align-items: center;
|
|
34
|
+
}
|
|
60
35
|
|
|
61
|
-
.rc-select-
|
|
62
|
-
font-size: 12px;
|
|
63
|
-
flex: none;
|
|
64
|
-
height: 20px;
|
|
65
|
-
display: flex;
|
|
66
|
-
align-items: center;
|
|
67
|
-
background: #F0F4FA;
|
|
68
|
-
border-radius: 10px;
|
|
69
|
-
margin-right: 2px;
|
|
70
|
-
padding: 0 5px 0 10px;
|
|
71
|
-
.tu-icon-cross{
|
|
36
|
+
.rc-select-selector {
|
|
72
37
|
cursor: pointer;
|
|
73
|
-
|
|
74
|
-
|
|
38
|
+
padding: 0 12px;
|
|
39
|
+
background: #FFFFFF;
|
|
40
|
+
border-radius: 8px;
|
|
41
|
+
border: 1px solid #DFE3EA;
|
|
42
|
+
height: 36px;
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.rc-select-multiple .rc-select-selector {
|
|
47
|
+
height: unset;
|
|
48
|
+
padding: 7px 12px 0;
|
|
49
|
+
border: 1px solid #DFE3EA;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.rc-select-multiple .rc-select-selector .rc-select-selection-overflow-item {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
margin-bottom: 7px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.rc-select-multiple .rc-select-selector .rc-select-selection-placeholder {
|
|
59
|
+
line-height: 1;
|
|
60
|
+
margin-bottom: 7px;
|
|
61
|
+
position: relative;
|
|
62
|
+
top: -2px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.rc-select-selection-item-content {
|
|
66
|
+
margin-right: 8px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.rc-select-multiple .rc-select-selector .rc-select-selection-item {
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
flex: none;
|
|
72
|
+
height: 20px;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
background: #F0F4FA;
|
|
76
|
+
border-radius: 10px;
|
|
77
|
+
margin-right: 2px;
|
|
78
|
+
padding: 0 5px 0 10px;
|
|
79
|
+
|
|
80
|
+
.tu-icon-cross {
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
color: #a4acB9;
|
|
83
|
+
font-size: 14px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.titaui-select-noborder {
|
|
88
|
+
.rc-select-selector {
|
|
89
|
+
border: none !important;
|
|
90
|
+
height: 22px;
|
|
91
|
+
line-height: 1;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.rc-select-arrow {
|
|
96
|
+
font-size: 16px;
|
|
97
|
+
transform: scale(0.5);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.rc-select-show-arrow .rc-select-arrow {
|
|
101
|
+
top: 0;
|
|
102
|
+
bottom: 0;
|
|
103
|
+
margin: auto;
|
|
104
|
+
right: 12px;
|
|
105
|
+
height: 22px;
|
|
75
106
|
}
|
|
76
107
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
.rc-select-dropdown{
|
|
108
|
+
|
|
109
|
+
.titaui-dropDown {
|
|
81
110
|
z-index: 2000;
|
|
82
111
|
box-sizing: border-box;
|
|
83
112
|
padding: 16px 6px;
|
|
@@ -85,48 +114,43 @@
|
|
|
85
114
|
box-shadow: 0px 4px 12px 0px rgba(127, 145, 180, 0.2);
|
|
86
115
|
border: 1px solid #F0F2F5;
|
|
87
116
|
border-radius: 8px;
|
|
88
|
-
}
|
|
89
117
|
|
|
90
|
-
.rc-select-item
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
.rc-select-item-option-selected {
|
|
118
|
+
.rc-select-item {
|
|
119
|
+
font-size: 14px;
|
|
120
|
+
padding: 7px 6px;
|
|
121
|
+
}
|
|
96
122
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
123
|
+
.rc-select-item-option {
|
|
124
|
+
height: 36px;
|
|
125
|
+
box-sizing: border-box;
|
|
126
|
+
line-height: 36px;
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
}
|
|
104
129
|
|
|
105
|
-
.rc-select-
|
|
106
|
-
font-size: 16px;
|
|
107
|
-
transform: scale(0.5);
|
|
108
|
-
}
|
|
109
|
-
.rc-select-show-arrow .rc-select-arrow {
|
|
110
|
-
top: 0;
|
|
111
|
-
bottom: 0;
|
|
112
|
-
margin: auto;
|
|
113
|
-
right: 12px;
|
|
114
|
-
height: 22px;
|
|
115
|
-
}
|
|
130
|
+
.rc-select-item-option-selected {
|
|
116
131
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
132
|
+
color: #2879FF;
|
|
133
|
+
}
|
|
120
134
|
|
|
121
|
-
.
|
|
122
|
-
|
|
123
|
-
|
|
135
|
+
.rc-select-item-option-content {
|
|
136
|
+
line-height: 24px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.rc-select-item-option-active {
|
|
140
|
+
border-radius: 8px;
|
|
141
|
+
color: #2879FF;
|
|
142
|
+
background: #F7F8FA;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
.rc-select-item-option-state {
|
|
148
|
+
display: none;
|
|
124
149
|
}
|
|
125
150
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
line-height: 1;
|
|
151
|
+
|
|
152
|
+
.titaui-select-hasSelectItem {
|
|
153
|
+
.rc-select-item-option-state {
|
|
154
|
+
display: block;
|
|
131
155
|
}
|
|
132
156
|
}
|
|
@@ -22,7 +22,7 @@ interface Props {
|
|
|
22
22
|
suffix?:string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const preCls = "titaui-select";
|
|
25
|
+
const preCls = "titaui-select-tags";
|
|
26
26
|
|
|
27
27
|
const SelectTags: FC<Props> = ({
|
|
28
28
|
selected = [],
|
|
@@ -39,43 +39,43 @@ const SelectTags: FC<Props> = ({
|
|
|
39
39
|
|
|
40
40
|
const [value, setValue] = useState(selected);
|
|
41
41
|
|
|
42
|
-
// useEffect(()=>{
|
|
43
|
-
// if(!selected) return
|
|
44
|
-
// setValue(selected)
|
|
45
|
-
// },[selected])
|
|
46
|
-
|
|
47
42
|
const onhandleChange = (value, options) => {
|
|
48
43
|
onChange && onChange(value, options,name);
|
|
49
44
|
setValue(value);
|
|
50
45
|
};
|
|
51
46
|
|
|
52
47
|
return (
|
|
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
|
-
|
|
48
|
+
<div className={preCls}>
|
|
49
|
+
<Select
|
|
50
|
+
className={classNames(className,{[`${preCls}-noborder`]: noBorder},)}
|
|
51
|
+
dropdownClassName={classNames(
|
|
52
|
+
`titaui-dropDown`,
|
|
53
|
+
{
|
|
54
|
+
[`${preCls}-hasSelectItem`]: mode === "multiple",
|
|
55
|
+
})}
|
|
56
|
+
value={value}
|
|
57
|
+
style={style}
|
|
58
|
+
mode={mode}
|
|
59
|
+
optionFilterProp="children"
|
|
60
|
+
optionLabelProp="children"
|
|
61
|
+
placeholder={placeholder}
|
|
62
|
+
onChange={onhandleChange}
|
|
63
|
+
showArrow={true}
|
|
64
|
+
removeIcon={<span className="tu-icon-cross"></span>}
|
|
65
|
+
inputIcon={<span className="tu-icon-caret-down" />}
|
|
66
|
+
menuItemSelectedIcon={<span className="tu-icon-finished" />}
|
|
67
|
+
{...restProps}
|
|
68
|
+
>
|
|
69
|
+
{data.map((item, key) => {
|
|
70
|
+
return (
|
|
71
|
+
<Option key={key} value={item.value}>
|
|
72
|
+
{item.label}
|
|
73
|
+
</Option>
|
|
74
|
+
);
|
|
75
|
+
})}
|
|
76
|
+
</Select>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
79
|
);
|
|
80
80
|
};
|
|
81
81
|
|
|
@@ -29,6 +29,16 @@ interface Props {
|
|
|
29
29
|
handleRequest?: (type: number) => Promise<any>;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
const getBackgroundImage = (type) => {
|
|
33
|
+
let selected = attitudeArr.find((a) => a.type == type);
|
|
34
|
+
if (selected) {
|
|
35
|
+
return {
|
|
36
|
+
backgroundImage: `url(${selected.img})`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return {};
|
|
40
|
+
};
|
|
41
|
+
|
|
32
42
|
function UpvoteButton({
|
|
33
43
|
type,
|
|
34
44
|
count,
|
|
@@ -110,12 +120,7 @@ function UpvoteButton({
|
|
|
110
120
|
[buttonType]: buttonType && upvoteState.type == 0,
|
|
111
121
|
"feed-upvote-button": true,
|
|
112
122
|
})}
|
|
113
|
-
style={
|
|
114
|
-
backgroundImage: `url(${
|
|
115
|
-
(attitudeArr.find((a) => a.type == upvoteState.type) || {})
|
|
116
|
-
.img
|
|
117
|
-
})`,
|
|
118
|
-
}}
|
|
123
|
+
style={getBackgroundImage(upvoteState.type)}
|
|
119
124
|
/>
|
|
120
125
|
)}
|
|
121
126
|
</a>
|
|
@@ -156,9 +161,7 @@ export const UpvoteButtonForFeed = (props: Props) => {
|
|
|
156
161
|
"feed-upvote-button": true,
|
|
157
162
|
})}
|
|
158
163
|
style={{
|
|
159
|
-
|
|
160
|
-
(attitudeArr.find((a) => a.type == type) || { img: "" }).img
|
|
161
|
-
})`,
|
|
164
|
+
...getBackgroundImage(type),
|
|
162
165
|
marginRight: 4,
|
|
163
166
|
}}
|
|
164
167
|
/>
|