@giteeteam/apps-team-components 1.3.0-alpha.3 → 1.3.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/README.md +24 -21
- package/dist/components/common/PriceTag.js +18 -18
- package/dist/components/common/expand-component/style.js +6 -6
- package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.js +1 -1
- package/dist/components/common/overflow-tooltip/OverflowTooltip.js +1 -1
- package/dist/components/common/overflow-tooltip/style/index.js +13 -13
- package/dist/components/common/style/global.js +2 -2
- package/dist/components/common/style/mixin.js +14 -14
- package/dist/components/common/user-field/style/index.js +21 -21
- package/dist/components/default-empty-icon/config.js +3 -2
- package/dist/components/default-empty-icon/style.js +52 -52
- package/dist/components/fields/ancestor/utils.js +12 -1
- package/dist/components/fields/bind-workspace/style/index.js +3 -3
- package/dist/components/fields/cascade/utils.js +2 -1
- package/dist/components/fields/dropdown/BaseField.js +4 -4
- package/dist/components/fields/dropdown/ReadView.js +1 -1
- package/dist/components/fields/dropdown/hook.js +1 -1
- package/dist/components/fields/dropdown/style.js +72 -72
- package/dist/components/fields/hyper-link/style/index.js +14 -14
- package/dist/components/fields/item-type/ItemTypeIcon.js +5 -1
- package/dist/components/fields/item-type/style/index.js +5 -5
- package/dist/components/fields/long-text/style/index.js +5 -5
- package/dist/components/fields/priority/style/index.js +50 -50
- package/dist/components/fields/status/SelectFlowHandler.js +4 -4
- package/dist/components/fields/status/Transition.js +1 -1
- package/dist/components/fields/status/TransitionButton.js +2 -2
- package/dist/components/fields/status/TransitionPanel.js +1 -1
- package/dist/components/fields/status/View.js +1 -1
- package/dist/components/fields/status/style/index.js +324 -298
- package/dist/components/fields/tag/style/index.js +5 -5
- package/dist/components/fields/team/style/index.js +2 -2
- package/dist/components/fields/user/style/index.js +8 -8
- package/dist/components/fields/user-group/ReadView.js +6 -2
- package/dist/components/filters/filter-search/utils.js +5 -2
- package/dist/components/table-components/EditTableCell.js +1 -1
- package/dist/components/table-components/style/index.js +5 -5
- package/dist/icons/empty-icon/data-empty.png.js +3 -0
- package/dist/icons/empty-icon/forbidden.png.js +3 -0
- package/dist/icons/empty-icon/index.js +8 -0
- package/dist/icons/empty-icon/load-error.png.js +3 -0
- package/dist/icons/empty-icon/not-found.png.js +3 -0
- package/dist/icons/empty-icon/workspace-empty.svg +126 -126
- package/dist/icons/empty-icon/workspace-empty.svg.js +3 -0
- package/dist/icons/index.js +7 -7
- package/dist/icons/style/index.js +21 -21
- package/dist/lib/array.js +44 -2
- package/dist/lib/config.js +3 -3
- package/dist/lib/dataType.js +5 -1
- package/dist/lib/date.js +48 -3
- package/dist/lib/error/index.js +2 -0
- package/dist/lib/error/utils.js +17 -2
- package/dist/lib/fetch.js +41 -6
- package/dist/lib/icons/utils.js +3 -1
- package/dist/lib/path.js +1 -1
- package/dist/lib/storage.js +38 -1
- package/dist/lib/workflow.js +2 -0
- package/dist/public/icons/BulbIcon.svg +1 -1
- package/dist/public/icons/Cloud.svg +1 -1
- package/dist/public/icons/ConsultIcon.svg +1 -1
- package/dist/public/icons/Demo.svg +1 -1
- package/dist/public/icons/ErrorTemplate.svg +1 -1
- package/dist/public/icons/Fail.svg +1 -1
- package/dist/public/icons/Flag.svg +1 -1
- package/dist/public/icons/GiteeIcon.svg +1 -1
- package/dist/public/icons/IntelligenceGradient.svg +1 -1
- package/dist/public/icons/Issue_Approval.svg +1 -1
- package/dist/public/icons/Issue_Bug.svg +1 -1
- package/dist/public/icons/Issue_Demand.svg +1 -1
- package/dist/public/icons/Issue_Doc.svg +1 -1
- package/dist/public/icons/Issue_Idea.svg +1 -1
- package/dist/public/icons/Issue_List.svg +1 -1
- package/dist/public/icons/Issue_Plan.svg +1 -1
- package/dist/public/icons/Issue_Product.svg +1 -1
- package/dist/public/icons/Issue_Risk.svg +1 -1
- package/dist/public/icons/Issue_Story.svg +1 -1
- package/dist/public/icons/Issue_Subtask.svg +1 -1
- package/dist/public/icons/Issue_Task.svg +1 -1
- package/dist/public/icons/Issue_Test.svg +1 -1
- package/dist/public/icons/Issue_TestExcution.svg +1 -1
- package/dist/public/icons/Issue_TestPlan.svg +1 -1
- package/dist/public/icons/Issue_Time.svg +1 -1
- package/dist/public/icons/Issue_develop.svg +1 -1
- package/dist/public/icons/KanbanCover.svg +7 -7
- package/dist/public/icons/ListCover.svg +117 -117
- package/dist/public/icons/ManHour.svg +1 -1
- package/dist/public/icons/MobileIcon.svg +1 -1
- package/dist/public/icons/NoItemType.svg +10 -10
- package/dist/public/icons/ProductIcon.svg +1 -1
- package/dist/public/icons/RedFlagIcon.svg +1 -1
- package/dist/public/icons/Safe.svg +1 -1
- package/dist/public/icons/StarIcon.svg +60 -60
- package/dist/public/icons/StructureCover.svg +1 -1
- package/dist/public/icons/Success.svg +1 -1
- package/dist/public/icons/TeamIcon.svg +1 -1
- package/dist/public/icons/WebIcon.svg +1 -1
- package/dist/public/icons/iconfont.svg +467 -467
- package/dist/public/icons/iconfont_single_color.css +912 -912
- package/dist/public/mockServiceWorker.js +284 -284
- package/dist/style/common.js +16 -1
- package/dist/style/global.js +7 -7
- package/package.json +111 -111
package/README.md
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
# @giteeteam/apps-team-components
|
|
2
|
-
|
|
3
|
-
- gitee team components
|
|
4
|
-
|
|
5
|
-
## 安装
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm i
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 预览
|
|
12
|
-
**开发前务必先阅读预览首页文档**
|
|
13
|
-
```
|
|
14
|
-
pnpm storybook
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
# 1.1.x版本
|
|
18
|
-
- team最低版本为4.16.0
|
|
19
|
-
|
|
20
|
-
# 1.2.x版本
|
|
21
|
-
- team最低版本为4.21.0
|
|
1
|
+
# @giteeteam/apps-team-components
|
|
2
|
+
|
|
3
|
+
- gitee team components
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm i
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 预览
|
|
12
|
+
**开发前务必先阅读预览首页文档**
|
|
13
|
+
```
|
|
14
|
+
pnpm storybook
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
# 1.1.x版本
|
|
18
|
+
- team最低版本为4.16.0
|
|
19
|
+
|
|
20
|
+
# 1.2.x版本
|
|
21
|
+
- team最低版本为4.21.0
|
|
22
|
+
|
|
23
|
+
# 1.3.x版本
|
|
24
|
+
- team最低版本为4.23.0
|
|
@@ -4,26 +4,26 @@ import { ClassNames } from '@emotion/react';
|
|
|
4
4
|
import { i18n } from '../../lib/i18n.js';
|
|
5
5
|
import SimpleOverflowToolTip from './overflow-tooltip/SimpleOverflowToolTip.js';
|
|
6
6
|
|
|
7
|
-
const containerStyle = `
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
max-width: 100%;
|
|
7
|
+
const containerStyle = `
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
max-width: 100%;
|
|
11
11
|
`;
|
|
12
|
-
const textStyle = `
|
|
13
|
-
flex: 1;
|
|
14
|
-
width: 0;
|
|
12
|
+
const textStyle = `
|
|
13
|
+
flex: 1;
|
|
14
|
+
width: 0;
|
|
15
15
|
`;
|
|
16
|
-
const tagStyle = `
|
|
17
|
-
height: 18px;
|
|
18
|
-
padding: 0 4px;
|
|
19
|
-
margin-left: 8px;
|
|
20
|
-
font-size: 12px;
|
|
21
|
-
font-weight: 500;
|
|
22
|
-
line-height: 18px;
|
|
23
|
-
color: #fff;
|
|
24
|
-
background: linear-gradient(230deg, #66dbff 0%, #3683ff 100%);
|
|
25
|
-
border-radius: 5px 0;
|
|
26
|
-
white-space: nowrap;
|
|
16
|
+
const tagStyle = `
|
|
17
|
+
height: 18px;
|
|
18
|
+
padding: 0 4px;
|
|
19
|
+
margin-left: 8px;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
line-height: 18px;
|
|
23
|
+
color: #fff;
|
|
24
|
+
background: linear-gradient(230deg, #66dbff 0%, #3683ff 100%);
|
|
25
|
+
border-radius: 5px 0;
|
|
26
|
+
white-space: nowrap;
|
|
27
27
|
`;
|
|
28
28
|
const PriceTag = ({ text, className, edition, expired }) => {
|
|
29
29
|
const isTagVisible = useMemo(() => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const expandFooter = `
|
|
2
|
-
font-size: 12px;
|
|
3
|
-
color: #0c62ff;
|
|
4
|
-
text-align: right;
|
|
1
|
+
const expandFooter = `
|
|
2
|
+
font-size: 12px;
|
|
3
|
+
color: #0c62ff;
|
|
4
|
+
text-align: right;
|
|
5
5
|
`;
|
|
6
|
-
const expandBtn = `
|
|
7
|
-
cursor: pointer;
|
|
6
|
+
const expandBtn = `
|
|
7
|
+
cursor: pointer;
|
|
8
8
|
`;
|
|
9
9
|
|
|
10
10
|
export { expandBtn, expandFooter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useRef, cloneElement, memo } from 'react';
|
|
3
3
|
import { ClassNames } from '@emotion/react';
|
|
4
4
|
import { tooltipOverflowStyle, getTooltipMaxlineStyle } from './style/index.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, memo } from 'react';
|
|
3
3
|
import { ClassNames } from '@emotion/react';
|
|
4
4
|
import { Tooltip } from 'antd';
|
|
5
5
|
import { tooltipOverflowStyle, getTooltipMaxlineStyle } from './style/index.js';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
const tooltipOverflowStyle = `
|
|
2
|
-
display: -webkit-box;
|
|
3
|
-
overflow: hidden;
|
|
4
|
-
text-overflow: ellipsis;
|
|
5
|
-
word-break: break-all;
|
|
6
|
-
white-space: pre-line !important;
|
|
7
|
-
-webkit-box-orient: vertical;
|
|
1
|
+
const tooltipOverflowStyle = `
|
|
2
|
+
display: -webkit-box;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
text-overflow: ellipsis;
|
|
5
|
+
word-break: break-all;
|
|
6
|
+
white-space: pre-line !important;
|
|
7
|
+
-webkit-box-orient: vertical;
|
|
8
8
|
`;
|
|
9
|
-
const simpleTooltipStyle = `
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
text-overflow: ellipsis;
|
|
12
|
-
white-space: nowrap;
|
|
9
|
+
const simpleTooltipStyle = `
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
text-overflow: ellipsis;
|
|
12
|
+
white-space: nowrap;
|
|
13
13
|
`;
|
|
14
14
|
const getTooltipMaxlineStyle = (n) => {
|
|
15
|
-
return `
|
|
16
|
-
-webkit-line-clamp: ${n};
|
|
15
|
+
return `
|
|
16
|
+
-webkit-line-clamp: ${n};
|
|
17
17
|
`;
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { gray4, gray6 } from '../../../style/common.js';
|
|
2
2
|
|
|
3
|
-
const hoverStyle = `
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: space-between;
|
|
8
|
-
height: 32px;
|
|
9
|
-
padding: 0 8px !important;
|
|
10
|
-
color: rgb(226 236 255 50%);
|
|
11
|
-
border: 1px solid ${gray4};
|
|
12
|
-
border-radius: 4px;
|
|
3
|
+
const hoverStyle = `
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
height: 32px;
|
|
9
|
+
padding: 0 8px !important;
|
|
10
|
+
color: rgb(226 236 255 50%);
|
|
11
|
+
border: 1px solid ${gray4};
|
|
12
|
+
border-radius: 4px;
|
|
13
13
|
`;
|
|
14
|
-
const hoverIconStyle = `
|
|
15
|
-
display: none;
|
|
16
|
-
font-size: 12px;
|
|
17
|
-
color: ${gray6};
|
|
14
|
+
const hoverIconStyle = `
|
|
15
|
+
display: none;
|
|
16
|
+
font-size: 12px;
|
|
17
|
+
color: ${gray6};
|
|
18
18
|
`;
|
|
19
19
|
|
|
20
20
|
export { hoverIconStyle, hoverStyle };
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
const avatarSize = '20px';
|
|
2
|
-
const avatarItemStyle = `
|
|
3
|
-
flex-shrink: 0;
|
|
2
|
+
const avatarItemStyle = `
|
|
3
|
+
flex-shrink: 0;
|
|
4
4
|
`;
|
|
5
|
-
const avatarStyle = `
|
|
6
|
-
display: inline-block;
|
|
7
|
-
width: ${avatarSize};
|
|
8
|
-
height: ${avatarSize};
|
|
9
|
-
margin-right: 3px;
|
|
10
|
-
vertical-align: middle;
|
|
11
|
-
background: #fff center/contain no-repeat;
|
|
12
|
-
border-radius: 50%;
|
|
5
|
+
const avatarStyle = `
|
|
6
|
+
display: inline-block;
|
|
7
|
+
width: ${avatarSize};
|
|
8
|
+
height: ${avatarSize};
|
|
9
|
+
margin-right: 3px;
|
|
10
|
+
vertical-align: middle;
|
|
11
|
+
background: #fff center/contain no-repeat;
|
|
12
|
+
border-radius: 50%;
|
|
13
13
|
`;
|
|
14
|
-
const defaultAvatarStyle = `
|
|
15
|
-
display: inline-flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
width: ${avatarSize};
|
|
19
|
-
height: ${avatarSize};
|
|
20
|
-
margin-right: 6px;
|
|
21
|
-
font-size: 12px;
|
|
22
|
-
color: #fff;
|
|
23
|
-
background: #5243aa;
|
|
24
|
-
border-radius: 50%;
|
|
14
|
+
const defaultAvatarStyle = `
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
width: ${avatarSize};
|
|
19
|
+
height: ${avatarSize};
|
|
20
|
+
margin-right: 6px;
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
color: #fff;
|
|
23
|
+
background: #5243aa;
|
|
24
|
+
border-radius: 50%;
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
27
|
export { avatarItemStyle, avatarStyle, defaultAvatarStyle };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import '../../icons/empty-icon/index.js';
|
|
2
|
+
import { smallDefaultClass, largeItemClass, largeWorkspaceClass } from './style.js';
|
|
3
|
+
import img from '../../icons/empty-icon/small-default@2x.png.js';
|
|
1
4
|
import img$1 from '../../icons/empty-icon/large-item@2x.png.js';
|
|
2
5
|
import img$2 from '../../icons/empty-icon/large-workspace@2x.png.js';
|
|
3
|
-
import img from '../../icons/empty-icon/small-default@2x.png.js';
|
|
4
|
-
import { smallDefaultClass, largeItemClass, largeWorkspaceClass } from './style.js';
|
|
5
6
|
|
|
6
7
|
const config = {
|
|
7
8
|
smallDefault: {
|
|
@@ -10,58 +10,58 @@ const autoMarginClass = randomClassName('auto-margin');
|
|
|
10
10
|
const smallDefaultClass = randomClassName('small-default');
|
|
11
11
|
const largeWorkspaceClass = randomClassName('large-workspace');
|
|
12
12
|
const largeItemClass = randomClassName('large-item');
|
|
13
|
-
const emptyIconWrapper = `
|
|
14
|
-
margin-top: 12px;
|
|
15
|
-
text-align: center;
|
|
16
|
-
|
|
17
|
-
&.${centerClass} {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
user-select: none;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&.${smallTextClass} {
|
|
26
|
-
.${textClass} {
|
|
27
|
-
font-size: 12px;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&.${smallMarginClass} {
|
|
32
|
-
margin-top: 16px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&.${largeMarginClass} {
|
|
36
|
-
margin-top: 48px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&.${noMarginClass} {
|
|
40
|
-
margin: 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&.${autoMarginClass} {
|
|
44
|
-
margin: auto;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.${smallDefaultClass} {
|
|
48
|
-
width: 90px;
|
|
49
|
-
height: 90px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.${largeWorkspaceClass},
|
|
53
|
-
.${largeItemClass} {
|
|
54
|
-
width: 180px;
|
|
55
|
-
height: 180px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.${textClass} {
|
|
59
|
-
padding: 0;
|
|
60
|
-
margin: 12px 0;
|
|
61
|
-
font-size: 14px;
|
|
62
|
-
line-height: 22px;
|
|
63
|
-
color: #848c9f;
|
|
64
|
-
}
|
|
13
|
+
const emptyIconWrapper = `
|
|
14
|
+
margin-top: 12px;
|
|
15
|
+
text-align: center;
|
|
16
|
+
|
|
17
|
+
&.${centerClass} {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
user-select: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.${smallTextClass} {
|
|
26
|
+
.${textClass} {
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.${smallMarginClass} {
|
|
32
|
+
margin-top: 16px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.${largeMarginClass} {
|
|
36
|
+
margin-top: 48px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.${noMarginClass} {
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.${autoMarginClass} {
|
|
44
|
+
margin: auto;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.${smallDefaultClass} {
|
|
48
|
+
width: 90px;
|
|
49
|
+
height: 90px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.${largeWorkspaceClass},
|
|
53
|
+
.${largeItemClass} {
|
|
54
|
+
width: 180px;
|
|
55
|
+
height: 180px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.${textClass} {
|
|
59
|
+
padding: 0;
|
|
60
|
+
margin: 12px 0;
|
|
61
|
+
font-size: 14px;
|
|
62
|
+
line-height: 22px;
|
|
63
|
+
color: #848c9f;
|
|
64
|
+
}
|
|
65
65
|
`;
|
|
66
66
|
|
|
67
67
|
export { autoMarginClass, centerClass, emptyIconWrapper, largeItemClass, largeMarginClass, largeWorkspaceClass, noMarginClass, smallDefaultClass, smallMarginClass, smallTextClass, textClass };
|
|
@@ -13,5 +13,16 @@ const formatDisplayValue = (value) => {
|
|
|
13
13
|
}
|
|
14
14
|
return value;
|
|
15
15
|
};
|
|
16
|
+
const formatAncestorFormValues = (itemValue) => {
|
|
17
|
+
logger('formatAncestorFormValues', itemValue);
|
|
18
|
+
const { objectId, ancestors } = itemValue || {};
|
|
19
|
+
const ancestorValue = (ancestors || []).concat(objectId).filter(Boolean).join('-');
|
|
20
|
+
return ancestorValue;
|
|
21
|
+
};
|
|
22
|
+
const formatAncestorSubmitValues = (submitValues) => {
|
|
23
|
+
logger('formatAncestorSubmitValues', submitValues);
|
|
24
|
+
const ancestorsValue = ((submitValues === null || submitValues === void 0 ? void 0 : submitValues.ancestor) || '').split('-').filter(Boolean);
|
|
25
|
+
return ancestorsValue;
|
|
26
|
+
};
|
|
16
27
|
|
|
17
|
-
export { formatDisplayValue };
|
|
28
|
+
export { formatAncestorFormValues, formatAncestorSubmitValues, formatDisplayValue };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const VALUE_SPLIT = '__RC_CASCADER_SPLIT__';
|
|
1
2
|
const LABEL_JOIN_STR = ' / ';
|
|
2
3
|
const getShowValue = (values) => {
|
|
3
4
|
if (!Array.isArray(values) || !values.length)
|
|
@@ -19,4 +20,4 @@ const getShowValue = (values) => {
|
|
|
19
20
|
return showValue;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
export { LABEL_JOIN_STR, getShowValue };
|
|
23
|
+
export { LABEL_JOIN_STR, VALUE_SPLIT, getShowValue };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs, Fragment
|
|
1
|
+
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { useMemo, useState, useRef, useEffect, useCallback } from 'react';
|
|
3
3
|
import { Overlay } from 'react-overlays';
|
|
4
4
|
import { DownOutlined } from '@ant-design/icons';
|
|
5
5
|
import { ClassNames } from '@emotion/react';
|
|
6
6
|
import { Checkbox, Divider, Spin, Select, Col } from 'antd';
|
|
7
7
|
import debug from 'debug';
|
|
8
|
-
import { isObject,
|
|
8
|
+
import { isNil, isObject, noop, isPlainObject, xorWith } from 'lodash-es';
|
|
9
9
|
import { emptyIconWrapper } from '../../../style/global.js';
|
|
10
10
|
import useSWR from 'swr';
|
|
11
11
|
import EmptyField from '../../common/EmptyField.js';
|
|
@@ -18,12 +18,12 @@ import EmptyIcon from '../../default-empty-icon/index.js';
|
|
|
18
18
|
import { getFieldWidthStyle } from '../base-component/utils.js';
|
|
19
19
|
import { getRealValueByIqlTo } from '../../filters/filter-search/utils.js';
|
|
20
20
|
import { REMOTE_DATA_QUOTE_FIELD_TYPE } from '../../../lib/constants/field.js';
|
|
21
|
-
import { FIELD_CONTAINERS_PAGE, CURRENT_WORKSPACE, FIELD_TYPE_KEY_MAPPINGS
|
|
21
|
+
import { BASE_FIELD_WIDTH, FIELD_CONTAINERS_PAGE, CURRENT_WORKSPACE, FIELD_TYPE_KEY_MAPPINGS } from '../../../lib/global.js';
|
|
22
22
|
import useAntdConfig from '../../../lib/hooks/useAntdConfig.js';
|
|
23
23
|
import useI18n from '../../../lib/hooks/useI18n.js';
|
|
24
24
|
import { API_KEY } from '../../../lib/swr/constants.js';
|
|
25
25
|
import useViewClass from '../hooks/useViewClass.js';
|
|
26
|
-
import {
|
|
26
|
+
import { EMPTY_OPTIONS, useCommonProps } from './hook.js';
|
|
27
27
|
import { dropdownSelectDisabled, onlyWorkspaceStyle, onlyWorkspaceDividerStyle, dropdownSelectStyle, optionDisplayWrapClass, dropdownSelectOptionClass, disabledClass, workspaceClass, dropdownStyle, hiddenHoverClass, displayWrapClass, valueOptionContentClass, valueOptionClass, valueOptionIconClass, valueOptionLabelClass, hoverIconClass } from './style.js';
|
|
28
28
|
|
|
29
29
|
const loggers = debug('dropdown:BaseField');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs, Fragment
|
|
1
|
+
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo, useMemo } from 'react';
|
|
3
3
|
import EmptyField from '../../common/EmptyField.js';
|
|
4
4
|
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMemo, useState, useRef, useCallback } from 'react';
|
|
2
2
|
import { uniqWith, debounce } from 'lodash-es';
|
|
3
3
|
import { getArrayValue } from '../../../lib/array.js';
|
|
4
4
|
import { REMOTE_DATA_QUOTE_FIELD_TYPE } from '../../../lib/constants/field.js';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { randomClassName } from '../../../style/common.js';
|
|
2
2
|
import { hoverStyle, hoverIconStyle } from '../../common/style/mixin.js';
|
|
3
3
|
|
|
4
|
-
const dropdownSelectDisabled = `
|
|
5
|
-
text-decoration: line-through;
|
|
4
|
+
const dropdownSelectDisabled = `
|
|
5
|
+
text-decoration: line-through;
|
|
6
6
|
`;
|
|
7
|
-
const onlyWorkspaceStyle = `
|
|
8
|
-
padding: 5px 12px;
|
|
7
|
+
const onlyWorkspaceStyle = `
|
|
8
|
+
padding: 5px 12px;
|
|
9
9
|
`;
|
|
10
|
-
const onlyWorkspaceDividerStyle = `
|
|
11
|
-
&:not(.add-weights) {
|
|
12
|
-
margin: 4px 0;
|
|
13
|
-
}
|
|
10
|
+
const onlyWorkspaceDividerStyle = `
|
|
11
|
+
&:not(.add-weights) {
|
|
12
|
+
margin: 4px 0;
|
|
13
|
+
}
|
|
14
14
|
`;
|
|
15
15
|
const hiddenHoverClass = randomClassName('hidden-hover');
|
|
16
16
|
const displayWrapClass = randomClassName('display-wrap');
|
|
@@ -21,73 +21,73 @@ const valueOptionLabelClass = randomClassName('value-option-label');
|
|
|
21
21
|
const workspaceClass = randomClassName('workspace');
|
|
22
22
|
const hoverIconClass = randomClassName('hover-icon');
|
|
23
23
|
const optionDisplayWrapClass = randomClassName('option-display-wrap');
|
|
24
|
-
const dropdownStyle = (antPrefix) => `
|
|
25
|
-
width: 100%;
|
|
26
|
-
|
|
27
|
-
&:not(.${hiddenHoverClass}) &:not(.${displayWrapClass}) :hover {
|
|
28
|
-
${hoverStyle}
|
|
29
|
-
|
|
30
|
-
.${hoverIconClass} {
|
|
31
|
-
display: inline-block;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.${hoverIconClass} {
|
|
36
|
-
${hoverIconStyle}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.${antPrefix}-select {
|
|
40
|
-
width: 100%;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.${antPrefix}-select-selection-item) {
|
|
44
|
-
.${workspaceClass} {
|
|
45
|
-
display: none;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.${valueOptionClass} {
|
|
50
|
-
margin-bottom: 8px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.${valueOptionContentClass} {
|
|
54
|
-
width: 100%;
|
|
55
|
-
padding-top: 6px;
|
|
56
|
-
|
|
57
|
-
.${valueOptionIconClass} {
|
|
58
|
-
position: absolute;
|
|
59
|
-
margin-top: 3px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.${valueOptionLabelClass} {
|
|
63
|
-
display: inline-block;
|
|
64
|
-
width: ~'calc(100% - 22px)';
|
|
65
|
-
margin-left: 22px;
|
|
66
|
-
overflow: hidden;
|
|
67
|
-
text-overflow: ellipsis;
|
|
68
|
-
white-space: nowrap;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.${optionDisplayWrapClass} {
|
|
73
|
-
.${antPrefix}-select-selection-overflow {
|
|
74
|
-
display: block;
|
|
75
|
-
.${antPrefix}-select-selection-overflow-item {
|
|
76
|
-
width: fit-content;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
24
|
+
const dropdownStyle = (antPrefix) => `
|
|
25
|
+
width: 100%;
|
|
26
|
+
|
|
27
|
+
&:not(.${hiddenHoverClass}) &:not(.${displayWrapClass}) :hover {
|
|
28
|
+
${hoverStyle}
|
|
29
|
+
|
|
30
|
+
.${hoverIconClass} {
|
|
31
|
+
display: inline-block;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.${hoverIconClass} {
|
|
36
|
+
${hoverIconStyle}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.${antPrefix}-select {
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.${antPrefix}-select-selection-item) {
|
|
44
|
+
.${workspaceClass} {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.${valueOptionClass} {
|
|
50
|
+
margin-bottom: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.${valueOptionContentClass} {
|
|
54
|
+
width: 100%;
|
|
55
|
+
padding-top: 6px;
|
|
56
|
+
|
|
57
|
+
.${valueOptionIconClass} {
|
|
58
|
+
position: absolute;
|
|
59
|
+
margin-top: 3px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.${valueOptionLabelClass} {
|
|
63
|
+
display: inline-block;
|
|
64
|
+
width: ~'calc(100% - 22px)';
|
|
65
|
+
margin-left: 22px;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
text-overflow: ellipsis;
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.${optionDisplayWrapClass} {
|
|
73
|
+
.${antPrefix}-select-selection-overflow {
|
|
74
|
+
display: block;
|
|
75
|
+
.${antPrefix}-select-selection-overflow-item {
|
|
76
|
+
width: fit-content;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
80
|
`;
|
|
81
81
|
const dropdownSelectOptionClass = randomClassName('dropdown-select-option');
|
|
82
82
|
const disabledClass = randomClassName('disabled');
|
|
83
|
-
const dropdownSelectStyle = (antPrefix) => `
|
|
84
|
-
.${dropdownSelectOptionClass}.${disabledClass} {
|
|
85
|
-
text-decoration: line-through;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.${antPrefix}-select-selection-item-content {
|
|
89
|
-
text-decoration: line-through;
|
|
90
|
-
}
|
|
83
|
+
const dropdownSelectStyle = (antPrefix) => `
|
|
84
|
+
.${dropdownSelectOptionClass}.${disabledClass} {
|
|
85
|
+
text-decoration: line-through;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.${antPrefix}-select-selection-item-content {
|
|
89
|
+
text-decoration: line-through;
|
|
90
|
+
}
|
|
91
91
|
`;
|
|
92
92
|
|
|
93
93
|
export { disabledClass, displayWrapClass, dropdownSelectDisabled, dropdownSelectOptionClass, dropdownSelectStyle, dropdownStyle, hiddenHoverClass, hoverIconClass, onlyWorkspaceDividerStyle, onlyWorkspaceStyle, optionDisplayWrapClass, valueOptionClass, valueOptionContentClass, valueOptionIconClass, valueOptionLabelClass, workspaceClass };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { blue6 } from '../../../../style/common.js';
|
|
2
2
|
|
|
3
|
-
const hyperLinkListStyle = `
|
|
4
|
-
display: flex;
|
|
5
|
-
width: 100%;
|
|
3
|
+
const hyperLinkListStyle = `
|
|
4
|
+
display: flex;
|
|
5
|
+
width: 100%;
|
|
6
6
|
`;
|
|
7
|
-
const hyperLinkItemStyle = `
|
|
8
|
-
${hyperLinkListStyle} & {
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
color: @blue-6;
|
|
11
|
-
text-overflow: ellipsis;
|
|
12
|
-
white-space: nowrap;
|
|
13
|
-
-webkit-line-clamp: 1;
|
|
14
|
-
}
|
|
7
|
+
const hyperLinkItemStyle = `
|
|
8
|
+
${hyperLinkListStyle} & {
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
color: @blue-6;
|
|
11
|
+
text-overflow: ellipsis;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
-webkit-line-clamp: 1;
|
|
14
|
+
}
|
|
15
15
|
`;
|
|
16
|
-
const hyperLinkTipItem = `
|
|
17
|
-
display: block;
|
|
18
|
-
color: ${blue6};
|
|
16
|
+
const hyperLinkTipItem = `
|
|
17
|
+
display: block;
|
|
18
|
+
color: ${blue6};
|
|
19
19
|
`;
|
|
20
20
|
|
|
21
21
|
export { hyperLinkItemStyle, hyperLinkListStyle, hyperLinkTipItem };
|