Skip to content

Commit 89d1586

Browse files
committed
feat: AsyncUserSelect
1 parent 13b393a commit 89d1586

File tree

14 files changed

+514
-16
lines changed

14 files changed

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

0 commit comments

Comments
 (0)