Skip to content

Commit 1759585

Browse files
committed
feat: AsyncUserSelect
1 parent 13b393a commit 1759585

File tree

14 files changed

+503
-16
lines changed

14 files changed

+503
-16
lines changed

.babelrc

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,40 @@
11
{
22
"env": {
33
"test": {
4-
"presets": [["react-app", {"absoluteRuntime" : false, "BABEL_ENV" : "test"}]]
4+
"presets": [
5+
[
6+
"react-app",
7+
{
8+
"absoluteRuntime": false,
9+
"runtime": "automatic",
10+
"BABEL_ENV": "test"
11+
}
12+
]
13+
]
514
},
615
"development": {
7-
"presets": [["react-app", {"absoluteRuntime" : false, "BABEL_ENV" : "development"}]]
16+
"presets": [
17+
[
18+
"react-app",
19+
{
20+
"absoluteRuntime": false,
21+
"runtime": "automatic",
22+
"BABEL_ENV": "development"
23+
}
24+
]
25+
]
826
},
927
"production": {
10-
"presets": [["react-app", {"absoluteRuntime" : false, "BABEL_ENV" : "production"}]]
28+
"presets": [
29+
[
30+
"react-app",
31+
{
32+
"absoluteRuntime": false,
33+
"runtime": "automatic",
34+
"BABEL_ENV": "production"
35+
}
36+
]
37+
]
1138
},
1239
"node": {
1340
"presets": [

package-lock.json

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@seafile/react-image-lightbox": "4.0.2",
77
"@seafile/seafile-calendar": "0.0.31",
88
"@seafile/seafile-editor": "~2.0.14",
9-
"classnames": "2.3.2",
9+
"classnames": "~2.5.*",
1010
"dayjs": "1.10.7",
1111
"dtable-utils": "~5.0.22",
1212
"is-hotkey": "0.2.0",

src/AsyncUserSelect/index.css

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
.dtable-ui-selected-users-container {
2+
flex-wrap: wrap;
3+
min-height: 38px;
4+
max-width: calc(100% - 10px);
5+
}
6+
7+
.dtable-ui-selected-users-container .dtable-ui-user-select-placeholder {
8+
color: #808080;
9+
}
10+
11+
.dtable-ui-user-select-popover .popover {
12+
width: 385px;
13+
max-width: 385px;
14+
}
15+
16+
.dtable-ui-user-select-container {
17+
position: relative;
18+
}
19+
20+
.dtable-ui-user-select-container .dtable-ui-user-search-container {
21+
padding: 10px 10px 0 10px;
22+
}
23+
24+
.dtable-ui-user-select-container .dtable-ui-user-search-container input {
25+
height: 28px;
26+
}
27+
28+
.dtable-ui-user-select-container .dtable-ui-user-list-container {
29+
min-height: 160px;
30+
max-height: 200px;
31+
margin: 10px 0;
32+
overflow: auto;
33+
}
34+
35+
.dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container {
36+
display: flex;
37+
align-items: center;
38+
justify-content: space-between;
39+
height: 30px;
40+
padding: 0 10px;
41+
font-size: 14px;
42+
cursor: pointer;
43+
}
44+
45+
.dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container:hover,
46+
.dtable-ui-user-select-container .dtable-ui-user-list-container .dtable-ui-user-item-container-highlight {
47+
background: #f5f5f5;
48+
cursor: pointer;
49+
}
50+
51+
.no-user-search-result {
52+
color: #666666;
53+
font-size: 14px;
54+
padding-left: 10px;
55+
padding: 10px;
56+
overflow: auto;
57+
}
58+
59+
.dtable-ui-user-select-popover .popover .dtable-ui-user-item {
60+
background: transparent;
61+
}
62+
63+
.dtable-ui-user-list-container .dtable-ui-collaborator-check-icon .dtable-icon-check-mark {
64+
color: #798d99;
65+
font-size: 12px;
66+
}
67+
68+
/* user-item */
69+
.dtable-ui-user-item {
70+
display: inline-flex;
71+
align-items: center;
72+
margin: 2px 10px 2px 0;
73+
padding: 0 8px 0 2px;
74+
height: 20px;
75+
font-size: 13px;
76+
border-radius: 10px;
77+
background: #eaeaea;
78+
}
79+
80+
.dtable-ui-user-item .user-item .user-avatar img {
81+
width: 16px;
82+
height: 16px;
83+
}
84+
85+
.dtable-ui-user-item .user-avatar {
86+
display: flex;
87+
align-items: center;
88+
justify-content: center;
89+
transform: translateY(0);
90+
flex-shrink: 0;
91+
}
92+
93+
.dtable-ui-user-item .user-name {
94+
margin-left: 5px;
95+
}
96+
97+
.dtable-ui-user-item .user-avatar img {
98+
width: 16px;
99+
height: 16px;
100+
border-radius: 50%;
101+
}
102+
103+
.dtable-ui-user-item .user-remove {
104+
display: inline-block;
105+
width: 14px;
106+
margin: 0 -2px 0 2px;
107+
}
108+
109+
.dtable-ui-user-item .user-remove .dtable-font {
110+
display: inline-block;
111+
font-size: 16px;
112+
color: #909090;
113+
transform: scale(.8);
114+
cursor: pointer;
115+
}
116+
117+
.dtable-ui-user-item .user-remove .dtable-font:hover {
118+
color: #666666;
119+
cursor: pointer;
120+
}

0 commit comments

Comments
 (0)