dtable-ui-component 7.0.1-beta.select1 → 7.0.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/lib/AsyncUserSelect/index.css +28 -38
- package/lib/AsyncUserSelect/index.js +18 -29
- package/lib/DTableCustomizeCollaboratorSelect/index.css +86 -0
- package/lib/DTableCustomizeCollaboratorSelect/index.js +158 -0
- package/lib/DTableCustomizeSelect/index.css +42 -120
- package/lib/DTableCustomizeSelect/index.js +6 -12
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +19 -7
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -5
- package/lib/DTableFiltersPopover/widgets/filter-item.js +7 -15
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +3 -3
- package/lib/DTableGroupSelect/index.css +96 -0
- package/lib/DTableGroupSelect/index.js +131 -0
- package/lib/DTableGroupSelect/option.js +42 -0
- package/lib/DTableGroupSelect/select-option-group.css +54 -0
- package/lib/DTableGroupSelect/select-option-group.js +227 -0
- package/lib/DTableSelect/dtable-select-label.css +3 -8
- package/lib/DTableSelect/dtable-select-label.js +1 -1
- package/lib/DTableSelect/index.js +3 -3
- package/lib/DTableSelect/user-select.css +46 -7
- package/lib/DTableSelect/utils.js +79 -170
- package/lib/ImageEditor/images-previewer/image-preview/index.js +2 -1
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +2 -2
- package/lib/ImageFormatter/images-lazy-load.js +2 -2
- package/lib/ImageFormatter/index.js +5 -2
- package/lib/ImagePreviewerLightbox/index.js +2 -1
- package/lib/ImageThumbnail/index.js +2 -1
- package/lib/SelectOptionGroup/KeyCodes.js +4 -96
- package/lib/SelectOptionGroup/index.css +54 -44
- package/lib/SelectOptionGroup/index.js +18 -35
- package/lib/SelectOptionGroup/option.js +4 -16
- package/lib/index.js +10 -3
- package/lib/utils/url.js +10 -35
- package/package.json +2 -2
- package/lib/DTableCustomizeSearchInput/index.css +0 -75
- package/lib/DTableCustomizeSearchInput/index.js +0 -133
- package/lib/DTableSelect/select-dropdown-indicator/index.css +0 -16
- package/lib/DTableSelect/select-dropdown-indicator/index.js +0 -24
- package/lib/assets/icons/close.svg +0 -1
- package/lib/assets/icons/down.svg +0 -3
|
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactstrap = require("reactstrap");
|
|
11
|
+
var _dtableUtils = require("dtable-utils");
|
|
11
12
|
var _UploadProgress = _interopRequireDefault(require("../../../../UploadProgress"));
|
|
12
|
-
var _url = require("../../../../utils/url");
|
|
13
13
|
var _FileUploader = _interopRequireDefault(require("../../../../FileUploader"));
|
|
14
14
|
var _lang = require("../../../../lang");
|
|
15
15
|
require("./index.css");
|
|
@@ -163,7 +163,7 @@ class LocalImageAddition extends _react.default.Component {
|
|
|
163
163
|
const uploadLocalImageValue = this.props.uploadLocalImageValue;
|
|
164
164
|
let uploadedFileList = [];
|
|
165
165
|
uploadedFileList = uploadLocalImageValue.length > 0 && uploadLocalImageValue.map((imgSrc, index) => {
|
|
166
|
-
let imageThumbnailUrl = (0,
|
|
166
|
+
let imageThumbnailUrl = (0, _dtableUtils.getImageThumbnailUrl)(imgSrc);
|
|
167
167
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
168
168
|
className: "dtable-ui-image-wrapper",
|
|
169
169
|
onMouseEnter: event => this.showDeleteIcon(event, index),
|
|
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _dtableUtils = require("dtable-utils");
|
|
11
12
|
var _Loading = _interopRequireDefault(require("../Loading"));
|
|
12
|
-
var _url = require("../utils/url");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
const ImagesLazyLoad = _ref => {
|
|
15
15
|
let images = _ref.images,
|
|
@@ -52,7 +52,7 @@ const ImagesLazyLoad = _ref => {
|
|
|
52
52
|
setLoadedImages([]);
|
|
53
53
|
setLoadedCount(0);
|
|
54
54
|
currentImages.forEach((item, index) => {
|
|
55
|
-
const url = (0,
|
|
55
|
+
const url = (0, _dtableUtils.getImageThumbnailUrl)(item, {
|
|
56
56
|
server,
|
|
57
57
|
dtableUuid
|
|
58
58
|
});
|
|
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _dtableUtils = require("dtable-utils");
|
|
11
12
|
var _imagesLazyLoad = _interopRequireDefault(require("./images-lazy-load"));
|
|
12
13
|
var _ImagePreviewerLightbox = _interopRequireDefault(require("../ImagePreviewerLightbox"));
|
|
13
|
-
var _url = require("../utils/url");
|
|
14
14
|
require("./index.css");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
class ImageFormatter extends _react.default.Component {
|
|
@@ -80,7 +80,10 @@ class ImageFormatter extends _react.default.Component {
|
|
|
80
80
|
}
|
|
81
81
|
if (isSample) {
|
|
82
82
|
let item = value[0];
|
|
83
|
-
let url = (0,
|
|
83
|
+
let url = (0, _dtableUtils.getImageThumbnailUrl)(item, {
|
|
84
|
+
server,
|
|
85
|
+
dtableUuid
|
|
86
|
+
});
|
|
84
87
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
85
88
|
className: className,
|
|
86
89
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
@@ -9,6 +9,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _reactImageLightbox = _interopRequireDefault(require("@seafile/react-image-lightbox"));
|
|
12
|
+
var _dtableUtils = require("dtable-utils");
|
|
12
13
|
var _url = require("../utils/url");
|
|
13
14
|
var _lang = require("../lang");
|
|
14
15
|
require("@seafile/react-image-lightbox/style.css");
|
|
@@ -70,7 +71,7 @@ function ImagePreviewerLightbox(props) {
|
|
|
70
71
|
const canRotateImage = onRotateImage && !readOnly && !['gif', 'heic', 'heif'].includes((0, _url.getFileSuffix)(URL)) && (0, _url.isInternalImg)(URL, server);
|
|
71
72
|
let mainSrc = URL;
|
|
72
73
|
if ((0, _url.needUseThumbnailImage)(URL)) {
|
|
73
|
-
mainSrc = (0,
|
|
74
|
+
mainSrc = (0, _dtableUtils.getImageThumbnailUrl)(URL, {
|
|
74
75
|
server,
|
|
75
76
|
dtableUuid,
|
|
76
77
|
workspaceID,
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _DTableToolTip = _interopRequireDefault(require("../DTableToolTip"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _dtableUtils = require("dtable-utils");
|
|
11
12
|
var _DeleteTip = _interopRequireDefault(require("../DeleteTip"));
|
|
12
13
|
var _url = require("../utils/url");
|
|
13
14
|
var _lang = require("../lang");
|
|
@@ -24,7 +25,7 @@ class ImageThumbnail extends _react.default.Component {
|
|
|
24
25
|
});
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
|
-
const imageThumbnailUrl = (0,
|
|
28
|
+
const imageThumbnailUrl = (0, _dtableUtils.getImageThumbnailUrl)(src);
|
|
28
29
|
(0, _url.checkImgExists)(imageThumbnailUrl).then(() => {
|
|
29
30
|
this.setState({
|
|
30
31
|
imageThumbnailUrl
|
|
@@ -5,105 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
const KeyCodes = {
|
|
8
|
-
Backspace: 8,
|
|
9
|
-
Tab: 9,
|
|
10
|
-
Enter: 13,
|
|
11
|
-
Shift: 16,
|
|
12
|
-
Ctrl: 17,
|
|
13
|
-
Alt: 18,
|
|
14
|
-
PauseBreak: 19,
|
|
15
|
-
CapsLock: 20,
|
|
16
|
-
Escape: 27,
|
|
17
|
-
Esc: 27,
|
|
18
|
-
Space: 32,
|
|
19
|
-
PageUp: 33,
|
|
20
|
-
PageDown: 34,
|
|
21
|
-
End: 35,
|
|
22
|
-
Home: 36,
|
|
23
8
|
LeftArrow: 37,
|
|
24
9
|
UpArrow: 38,
|
|
25
10
|
RightArrow: 39,
|
|
26
11
|
DownArrow: 40,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
2: 50,
|
|
32
|
-
3: 51,
|
|
33
|
-
4: 52,
|
|
34
|
-
5: 53,
|
|
35
|
-
6: 54,
|
|
36
|
-
7: 55,
|
|
37
|
-
8: 56,
|
|
38
|
-
9: 57,
|
|
39
|
-
a: 65,
|
|
40
|
-
b: 66,
|
|
41
|
-
c: 67,
|
|
42
|
-
d: 68,
|
|
43
|
-
e: 69,
|
|
44
|
-
f: 70,
|
|
45
|
-
g: 71,
|
|
46
|
-
h: 72,
|
|
47
|
-
i: 73,
|
|
48
|
-
j: 74,
|
|
49
|
-
k: 75,
|
|
50
|
-
l: 76,
|
|
51
|
-
m: 77,
|
|
52
|
-
n: 78,
|
|
53
|
-
o: 79,
|
|
54
|
-
p: 80,
|
|
55
|
-
q: 81,
|
|
56
|
-
r: 82,
|
|
57
|
-
s: 83,
|
|
58
|
-
t: 84,
|
|
59
|
-
u: 85,
|
|
60
|
-
v: 86,
|
|
61
|
-
w: 87,
|
|
62
|
-
x: 88,
|
|
63
|
-
y: 89,
|
|
64
|
-
z: 90,
|
|
65
|
-
LeftWindowKey: 91,
|
|
66
|
-
RightWindowKey: 92,
|
|
67
|
-
SelectKey: 93,
|
|
68
|
-
NumPad0: 96,
|
|
69
|
-
NumPad1: 97,
|
|
70
|
-
NumPad2: 98,
|
|
71
|
-
NumPad3: 99,
|
|
72
|
-
NumPad4: 100,
|
|
73
|
-
NumPad5: 101,
|
|
74
|
-
NumPad6: 102,
|
|
75
|
-
NumPad7: 103,
|
|
76
|
-
NumPad8: 104,
|
|
77
|
-
NumPad9: 105,
|
|
78
|
-
Multiply: 106,
|
|
79
|
-
Add: 107,
|
|
80
|
-
Subtract: 109,
|
|
81
|
-
DecimalPoint: 110,
|
|
82
|
-
Divide: 111,
|
|
83
|
-
F1: 112,
|
|
84
|
-
F2: 113,
|
|
85
|
-
F3: 114,
|
|
86
|
-
F4: 115,
|
|
87
|
-
F5: 116,
|
|
88
|
-
F6: 117,
|
|
89
|
-
F7: 118,
|
|
90
|
-
F8: 119,
|
|
91
|
-
F9: 120,
|
|
92
|
-
F10: 121,
|
|
93
|
-
F12: 123,
|
|
94
|
-
NumLock: 144,
|
|
95
|
-
ScrollLock: 145,
|
|
96
|
-
SemiColon: 186,
|
|
97
|
-
EqualSign: 187,
|
|
98
|
-
Comma: 188,
|
|
99
|
-
Dash: 189,
|
|
100
|
-
Period: 190,
|
|
101
|
-
ForwardSlash: 191,
|
|
102
|
-
GraveAccent: 192,
|
|
103
|
-
OpenBracket: 219,
|
|
104
|
-
BackSlash: 220,
|
|
105
|
-
CloseBracket: 221,
|
|
106
|
-
SingleQuote: 222,
|
|
107
|
-
ChineseInputMethod: 229
|
|
12
|
+
Enter: 13,
|
|
13
|
+
Tab: 9,
|
|
14
|
+
Escape: 27,
|
|
15
|
+
Esc: 27
|
|
108
16
|
};
|
|
109
17
|
var _default = exports.default = KeyCodes;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
.
|
|
1
|
+
.option-group {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
2
4
|
position: absolute;
|
|
3
5
|
left: 0;
|
|
4
6
|
min-height: 60px;
|
|
5
7
|
min-width: 100%;
|
|
6
8
|
max-width: 15rem;
|
|
7
|
-
padding
|
|
9
|
+
padding: 0.5rem 0;
|
|
8
10
|
box-shadow: var(--bs-border-secondary-shadow);
|
|
9
11
|
background: #fff;
|
|
10
12
|
border: 1px solid var(--bs-border-secondary-color);
|
|
@@ -12,33 +14,34 @@
|
|
|
12
14
|
z-index: 10001;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
.
|
|
17
|
+
.option-group .option-group-search {
|
|
16
18
|
width: 100%;
|
|
17
19
|
min-width: 170px;
|
|
18
|
-
|
|
20
|
+
padding: 0 10px 6px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.option-group-search .form-control {
|
|
24
|
+
height: 31px;
|
|
19
25
|
}
|
|
20
26
|
|
|
21
|
-
.
|
|
27
|
+
.option-group .none-search-result {
|
|
22
28
|
height: 100px;
|
|
23
29
|
width: 100%;
|
|
24
|
-
padding:
|
|
25
|
-
color:
|
|
30
|
+
padding: 10px;
|
|
31
|
+
color: #666666;
|
|
26
32
|
}
|
|
27
33
|
|
|
28
|
-
.
|
|
34
|
+
.option-group .option-group-content {
|
|
35
|
+
flex: 1;
|
|
29
36
|
max-height: 252px;
|
|
30
37
|
overflow-y: auto;
|
|
31
|
-
padding: 8px;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
|
-
.
|
|
35
|
-
|
|
36
|
-
display: flex;
|
|
37
|
-
justify-content: space-between;
|
|
38
|
-
align-items: center;
|
|
40
|
+
.option {
|
|
41
|
+
display: block;
|
|
39
42
|
width: 100%;
|
|
40
43
|
line-height: 24px;
|
|
41
|
-
padding: 0.25rem
|
|
44
|
+
padding: 0.25rem 10px;
|
|
42
45
|
clear: both;
|
|
43
46
|
font-weight: 400;
|
|
44
47
|
text-align: inherit;
|
|
@@ -47,57 +50,64 @@
|
|
|
47
50
|
overflow: hidden;
|
|
48
51
|
text-overflow: ellipsis;
|
|
49
52
|
white-space: nowrap;
|
|
50
|
-
border-radius: 4px;
|
|
51
|
-
height: 32px;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
.
|
|
55
|
+
.option.option-active {
|
|
56
|
+
background-color: #20a0ff;
|
|
57
|
+
color: #fff;
|
|
55
58
|
cursor: pointer;
|
|
56
|
-
background-color: var(--bs-btn-background-hover);
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
.
|
|
60
|
-
|
|
61
|
+
.option:hover .header-icon .dtable-font,
|
|
62
|
+
.option:hover .header-icon .multicolor-icon,
|
|
63
|
+
.option.option-active .select-option-name {
|
|
64
|
+
color: #fff;
|
|
61
65
|
}
|
|
62
66
|
|
|
63
|
-
.
|
|
64
|
-
|
|
67
|
+
.option.option-active .header-icon .dtable-font,
|
|
68
|
+
.option.option-active .header-icon .multicolor-icon {
|
|
69
|
+
color: #fff;
|
|
65
70
|
}
|
|
66
71
|
|
|
67
|
-
.
|
|
68
|
-
|
|
72
|
+
.option:not(.option-active):hover .header-icon .dtable-font,
|
|
73
|
+
.option:not(.option-active):hover .header-icon .multicolor-icon {
|
|
74
|
+
color: #aaa;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.option .select-option-name .single-select-option {
|
|
78
|
+
margin: 0 0 0 12px;
|
|
69
79
|
}
|
|
70
80
|
|
|
71
|
-
.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
81
|
+
.option .select-option-name .multiple-select-option {
|
|
82
|
+
margin: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.option-group-dtable-ui-single-select-selector .select-option-name,
|
|
86
|
+
.option-group-dtable-ui-multiple-select-selector .multiple-option-name {
|
|
75
87
|
display: flex;
|
|
76
88
|
align-items: center;
|
|
77
89
|
justify-content: space-between;
|
|
78
|
-
width: 100%;
|
|
79
90
|
}
|
|
80
91
|
|
|
81
|
-
.
|
|
82
|
-
.selector-group-select .group-check-icon {
|
|
92
|
+
.option-group-dtable-ui-multiple-select-selector .multiple-check-icon {
|
|
83
93
|
display: inline-flex;
|
|
94
|
+
width: 20px;
|
|
84
95
|
text-align: center;
|
|
85
|
-
color: var(--bs-icon-color);
|
|
86
96
|
}
|
|
87
97
|
|
|
88
|
-
.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
font-size: 14px;
|
|
98
|
+
.option-group-dtable-ui-multiple-select-selector .multiple-check-icon .dtable-icon-check-mark {
|
|
99
|
+
font-size: 12px;
|
|
100
|
+
color: #798d99;
|
|
92
101
|
}
|
|
93
102
|
|
|
94
|
-
.
|
|
95
|
-
.
|
|
96
|
-
|
|
103
|
+
.option-group-dtable-ui-single-select-selector .option:hover,
|
|
104
|
+
.option-group-dtable-ui-single-select-selector .option.option-active,
|
|
105
|
+
.option-group-dtable-ui-multiple-select-selector .option:hover,
|
|
106
|
+
.option-group-dtable-ui-multiple-select-selector .option.option-active {
|
|
107
|
+
background-color: #f5f5f5;
|
|
97
108
|
}
|
|
98
109
|
|
|
99
|
-
.select-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
margin-left: 0 !important;
|
|
110
|
+
.option-group-selector-single-select .option.option-active .select-option-name,
|
|
111
|
+
.option-group-selector-multiple-select .option.option-active .select-option-name {
|
|
112
|
+
color: #212529;
|
|
103
113
|
}
|
|
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _ClickOutside = _interopRequireDefault(require("../ClickOutside"));
|
|
12
|
-
var _DTableCustomizeSearchInput = _interopRequireDefault(require("../DTableCustomizeSearchInput"));
|
|
13
11
|
var _option = _interopRequireDefault(require("./option"));
|
|
12
|
+
var _DTableSearchInput = _interopRequireDefault(require("../DTableSearchInput"));
|
|
14
13
|
var _KeyCodes = _interopRequireDefault(require("./KeyCodes"));
|
|
14
|
+
var _ClickOutside = _interopRequireDefault(require("../ClickOutside"));
|
|
15
15
|
require("./index.css");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
const OPTION_HEIGHT = 32;
|
|
@@ -19,16 +19,21 @@ class SelectOptionGroup extends _react.Component {
|
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props);
|
|
21
21
|
this.resetMenuStyle = () => {
|
|
22
|
+
if (!this.optionGroupRef) return;
|
|
22
23
|
const _this$props = this.props,
|
|
23
24
|
isInModal = _this$props.isInModal,
|
|
24
25
|
position = _this$props.position;
|
|
25
26
|
const _this$optionGroupRef$ = this.optionGroupRef.getBoundingClientRect(),
|
|
26
27
|
top = _this$optionGroupRef$.top,
|
|
27
|
-
height = _this$optionGroupRef$.height
|
|
28
|
+
height = _this$optionGroupRef$.height,
|
|
29
|
+
width = _this$optionGroupRef$.width;
|
|
28
30
|
if (isInModal) {
|
|
29
31
|
if (position.y + position.height + height > window.innerHeight) {
|
|
30
32
|
this.optionGroupRef.style.top = position.y - height + 'px';
|
|
31
33
|
}
|
|
34
|
+
if (position && position.x + width > window.innerWidth) {
|
|
35
|
+
this.optionGroupRef.style.left = window.innerWidth - width - 10 + 'px';
|
|
36
|
+
}
|
|
32
37
|
this.optionGroupRef.style.opacity = 1;
|
|
33
38
|
this.searchInputRef.current && this.searchInputRef.current.inputRef.focus();
|
|
34
39
|
} else {
|
|
@@ -122,17 +127,10 @@ class SelectOptionGroup extends _react.Component {
|
|
|
122
127
|
});
|
|
123
128
|
}
|
|
124
129
|
};
|
|
125
|
-
this.clearSearch = () => {
|
|
126
|
-
this.setState({
|
|
127
|
-
searchVal: '',
|
|
128
|
-
activeIndex: -1
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
130
|
this.renderOptGroup = searchVal => {
|
|
132
131
|
let _this$props2 = this.props,
|
|
133
132
|
noOptionsPlaceholder = _this$props2.noOptionsPlaceholder,
|
|
134
|
-
onSelectOption = _this$props2.onSelectOption
|
|
135
|
-
value = _this$props2.value;
|
|
133
|
+
onSelectOption = _this$props2.onSelectOption;
|
|
136
134
|
this.filterOptions = this.props.getFilterOptions(searchVal);
|
|
137
135
|
if (this.filterOptions.length === 0) {
|
|
138
136
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -143,16 +141,7 @@ class SelectOptionGroup extends _react.Component {
|
|
|
143
141
|
return this.filterOptions.map((opt, i) => {
|
|
144
142
|
let key = opt.value.column ? opt.value.column.key : i;
|
|
145
143
|
let isActive = this.state.activeIndex === i;
|
|
146
|
-
|
|
147
|
-
if (value) {
|
|
148
|
-
// Handle both single value and array of values
|
|
149
|
-
if (Array.isArray(value.value)) {
|
|
150
|
-
isSelected = value.value.includes(opt.value);
|
|
151
|
-
} else {
|
|
152
|
-
isSelected = opt.value === value.value || JSON.stringify(opt.value) === JSON.stringify(value.value);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_option.default, {
|
|
144
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_option.default, {
|
|
156
145
|
index: i,
|
|
157
146
|
isActive: isActive,
|
|
158
147
|
value: opt.value,
|
|
@@ -160,13 +149,8 @@ class SelectOptionGroup extends _react.Component {
|
|
|
160
149
|
changeIndex: this.changeIndex,
|
|
161
150
|
supportMultipleSelect: this.props.supportMultipleSelect,
|
|
162
151
|
disableHover: this.state.disableHover,
|
|
163
|
-
children:
|
|
164
|
-
|
|
165
|
-
children: opt.label
|
|
166
|
-
}), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
167
|
-
className: "dtable-font dtable-icon-check seatable-check-color"
|
|
168
|
-
})]
|
|
169
|
-
}, key);
|
|
152
|
+
children: opt.label
|
|
153
|
+
}, "".concat(key, "-").concat(i));
|
|
170
154
|
});
|
|
171
155
|
};
|
|
172
156
|
this.state = {
|
|
@@ -231,8 +215,9 @@ class SelectOptionGroup extends _react.Component {
|
|
|
231
215
|
ref: ref => this.clickOutsideRef = ref,
|
|
232
216
|
onClickOutside: this.props.onClickOutside,
|
|
233
217
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
234
|
-
className: (0, _classnames.default)('
|
|
235
|
-
'pt-0': isShowSelected
|
|
218
|
+
className: (0, _classnames.default)('option-group', className ? 'option-group-' + className : '', {
|
|
219
|
+
'pt-0': isShowSelected,
|
|
220
|
+
'create-new-option-group': addOptionAble
|
|
236
221
|
}),
|
|
237
222
|
ref: ref => this.optionGroupRef = ref,
|
|
238
223
|
style: style,
|
|
@@ -242,18 +227,16 @@ class SelectOptionGroup extends _react.Component {
|
|
|
242
227
|
onClick: e => e.stopPropagation(),
|
|
243
228
|
children: value.label || ''
|
|
244
229
|
}), searchable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
245
|
-
className: "
|
|
246
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
230
|
+
className: "option-group-search",
|
|
231
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
|
|
247
232
|
className: "option-search-control",
|
|
248
233
|
placeholder: searchPlaceholder,
|
|
249
234
|
onChange: this.onChangeSearch,
|
|
250
|
-
clearValue: this.clearSearch,
|
|
251
235
|
autoFocus: true,
|
|
252
|
-
isClearable: true,
|
|
253
236
|
ref: this.searchInputRef
|
|
254
237
|
})
|
|
255
238
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
256
|
-
className: "
|
|
239
|
+
className: "option-group-content",
|
|
257
240
|
ref: ref => this.optionGroupContentRef = ref,
|
|
258
241
|
children: this.renderOptGroup(searchVal)
|
|
259
242
|
}), addOptionAble && AddOption]
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
10
|
class Option extends _react.Component {
|
|
13
11
|
constructor() {
|
|
14
12
|
super(...arguments);
|
|
15
|
-
this.onSelectOption = event => {
|
|
13
|
+
this.onSelectOption = (value, event) => {
|
|
16
14
|
if (this.props.supportMultipleSelect) {
|
|
17
15
|
event.stopPropagation();
|
|
18
16
|
}
|
|
19
|
-
this.props.onSelectOption(
|
|
17
|
+
this.props.onSelectOption(value, event);
|
|
20
18
|
};
|
|
21
19
|
this.onMouseEnter = () => {
|
|
22
20
|
if (!this.props.disableHover) {
|
|
@@ -28,21 +26,11 @@ class Option extends _react.Component {
|
|
|
28
26
|
this.props.changeIndex(-1);
|
|
29
27
|
}
|
|
30
28
|
};
|
|
31
|
-
this.onKeyDown = e => {
|
|
32
|
-
if (e.key === 'Enter' || e.key === 'Space') {
|
|
33
|
-
e.target.click();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
29
|
}
|
|
37
30
|
render() {
|
|
38
31
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
39
|
-
className:
|
|
40
|
-
|
|
41
|
-
}),
|
|
42
|
-
tabIndex: "0",
|
|
43
|
-
role: "menuitem",
|
|
44
|
-
onClick: this.onSelectOption,
|
|
45
|
-
onKeyDown: this.onKeyDown,
|
|
32
|
+
className: this.props.isActive ? 'option option-active' : 'option',
|
|
33
|
+
onClick: this.onSelectOption.bind(this, this.props.value),
|
|
46
34
|
onMouseEnter: this.onMouseEnter,
|
|
47
35
|
onMouseLeave: this.onMouseLeave,
|
|
48
36
|
children: this.props.children
|
package/lib/index.js
CHANGED
|
@@ -118,10 +118,10 @@ Object.defineProperty(exports, "DTableCustomFooter", {
|
|
|
118
118
|
return _DTableCustomFooter.default;
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
|
-
Object.defineProperty(exports, "
|
|
121
|
+
Object.defineProperty(exports, "DTableCustomizeCollaboratorSelect", {
|
|
122
122
|
enumerable: true,
|
|
123
123
|
get: function () {
|
|
124
|
-
return
|
|
124
|
+
return _DTableCustomizeCollaboratorSelect.default;
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
Object.defineProperty(exports, "DTableCustomizeSelect", {
|
|
@@ -154,6 +154,12 @@ Object.defineProperty(exports, "DTableFiltersPopover", {
|
|
|
154
154
|
return _DTableFiltersPopover.default;
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
+
Object.defineProperty(exports, "DTableGroupSelect", {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function () {
|
|
160
|
+
return _index.default;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
157
163
|
Object.defineProperty(exports, "DTableIcon", {
|
|
158
164
|
enumerable: true,
|
|
159
165
|
get: function () {
|
|
@@ -712,11 +718,12 @@ var _DTableRadio = _interopRequireDefault(require("./DTableRadio"));
|
|
|
712
718
|
var _DTableCommonAddTool = _interopRequireDefault(require("./DTableCommonAddTool"));
|
|
713
719
|
var _NotificationPopover = _interopRequireDefault(require("./NotificationPopover"));
|
|
714
720
|
var _DTableSelect = _interopRequireDefault(require("./DTableSelect"));
|
|
721
|
+
var _index = _interopRequireDefault(require("./DTableGroupSelect/index"));
|
|
715
722
|
var _dtableSelectLabel = _interopRequireDefault(require("./DTableSelect/dtable-select-label"));
|
|
716
723
|
var _DTableSwitch = _interopRequireDefault(require("./DTableSwitch"));
|
|
717
724
|
var _DTableCustomizeSelect = _interopRequireDefault(require("./DTableCustomizeSelect"));
|
|
725
|
+
var _DTableCustomizeCollaboratorSelect = _interopRequireDefault(require("./DTableCustomizeCollaboratorSelect"));
|
|
718
726
|
var _DTableSearchInput = _interopRequireDefault(require("./DTableSearchInput"));
|
|
719
|
-
var _DTableCustomizeSearchInput = _interopRequireDefault(require("./DTableCustomizeSearchInput"));
|
|
720
727
|
var _DTableColorPicker = _interopRequireDefault(require("./DTableColorPicker"));
|
|
721
728
|
var _ModalPortal = _interopRequireDefault(require("./ModalPortal"));
|
|
722
729
|
var _RoleStatusEditor = _interopRequireDefault(require("./RoleStatusEditor"));
|
package/lib/utils/url.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.needUseThumbnailImage = exports.isTargetUrl = exports.isInternalURL = exports.isInternalImg = exports.isDigitalSignsUrl = exports.isCustomAssetUrl = exports.isBase64 = exports.isAIUrl = exports.imageCheck = exports.getValidFileImageUrls = exports.
|
|
6
|
+
exports.needUseThumbnailImage = exports.isTargetUrl = exports.isInternalURL = exports.isInternalImg = exports.isDigitalSignsUrl = exports.isCustomAssetUrl = exports.isBase64 = exports.isAIUrl = exports.imageCheck = exports.getValidFileImageUrls = exports.getFileThumbnailInfo = exports.getFileSuffix = exports.getFileName = exports.getFileIconUrl = exports.generateCurrentBaseImageUrl = exports.generateCurrentBaseImageThumbnailUrl = exports.checkSVGImage = exports.checkImgExists = void 0;
|
|
7
|
+
var _dtableUtils = require("dtable-utils");
|
|
7
8
|
var _file = require("../constants/file");
|
|
8
9
|
const isTargetUrl = (target, url) => {
|
|
9
10
|
if (!url || typeof url !== 'string') return false;
|
|
@@ -95,32 +96,6 @@ const generateCurrentBaseImageUrl = _ref2 => {
|
|
|
95
96
|
return "".concat(validServer, "/workspace/").concat(workspaceID, "/asset/").concat(dtableUuid).concat(partUrl);
|
|
96
97
|
};
|
|
97
98
|
exports.generateCurrentBaseImageUrl = generateCurrentBaseImageUrl;
|
|
98
|
-
const getImageThumbnailUrl = function (url) {
|
|
99
|
-
let _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
100
|
-
server = _ref3.server,
|
|
101
|
-
dtableUuid = _ref3.dtableUuid,
|
|
102
|
-
workspaceID = _ref3.workspaceID,
|
|
103
|
-
_ref3$size = _ref3.size,
|
|
104
|
-
size = _ref3$size === void 0 ? 256 : _ref3$size;
|
|
105
|
-
if (!url || typeof url !== 'string') return '';
|
|
106
|
-
if (server && dtableUuid && isCustomAssetUrl(url)) {
|
|
107
|
-
const assetUuid = url.slice(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));
|
|
108
|
-
return server + '/dtable/' + dtableUuid + '/custom-asset-thumbnail/' + assetUuid + '?size=' + size;
|
|
109
|
-
}
|
|
110
|
-
if (isAIUrl(url) || checkSVGImage(url) || !isInternalImg(url) || isBase64(url)) return url;
|
|
111
|
-
if (server && workspaceID && dtableUuid && isDigitalSignsUrl(url)) {
|
|
112
|
-
return generateCurrentBaseImageThumbnailUrl({
|
|
113
|
-
server,
|
|
114
|
-
workspaceID,
|
|
115
|
-
dtableUuid,
|
|
116
|
-
size,
|
|
117
|
-
partUrl: url
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
if (url.includes('/thumbnail/workspace')) return url;
|
|
121
|
-
return url.replace('/workspace', '/thumbnail/workspace') + '?size=' + size;
|
|
122
|
-
};
|
|
123
|
-
exports.getImageThumbnailUrl = getImageThumbnailUrl;
|
|
124
99
|
const getFileName = url => {
|
|
125
100
|
if (!url) return null;
|
|
126
101
|
let validUrl = url;
|
|
@@ -145,9 +120,9 @@ const imageCheck = filename => {
|
|
|
145
120
|
};
|
|
146
121
|
exports.imageCheck = imageCheck;
|
|
147
122
|
const isInternalURL = function (url) {
|
|
148
|
-
let
|
|
149
|
-
|
|
150
|
-
server =
|
|
123
|
+
let _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
124
|
+
_ref3$server = _ref3.server,
|
|
125
|
+
server = _ref3$server === void 0 ? '' : _ref3$server;
|
|
151
126
|
if (!url || typeof url !== 'string') return false;
|
|
152
127
|
return server && url.indexOf(server) > -1;
|
|
153
128
|
};
|
|
@@ -182,10 +157,10 @@ const getFileIconUrl = (filename, direntType) => {
|
|
|
182
157
|
};
|
|
183
158
|
exports.getFileIconUrl = getFileIconUrl;
|
|
184
159
|
const getFileThumbnailInfo = function (file) {
|
|
185
|
-
let
|
|
186
|
-
server =
|
|
187
|
-
dtableUuid =
|
|
188
|
-
workspaceID =
|
|
160
|
+
let _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
161
|
+
server = _ref4.server,
|
|
162
|
+
dtableUuid = _ref4.dtableUuid,
|
|
163
|
+
workspaceID = _ref4.workspaceID;
|
|
189
164
|
const defaultIcon = _file.FILEEXT_ICON_MAP['default'];
|
|
190
165
|
const defaultIconUrl = _file.FILEEXT_ICON_URL_MAP[defaultIcon];
|
|
191
166
|
if (!file || !file.name) return {
|
|
@@ -195,7 +170,7 @@ const getFileThumbnailInfo = function (file) {
|
|
|
195
170
|
const isImage = imageCheck(file.name);
|
|
196
171
|
if (isImage && server) return {
|
|
197
172
|
isImage,
|
|
198
|
-
fileIconUrl: getImageThumbnailUrl(file.url, {
|
|
173
|
+
fileIconUrl: (0, _dtableUtils.getImageThumbnailUrl)(file.url, {
|
|
199
174
|
server,
|
|
200
175
|
dtableUuid,
|
|
201
176
|
workspaceID
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-ui-component",
|
|
3
|
-
"version": "7.0.1
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@seafile/react-image-lightbox": "5.0.9",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@seafile/seafile-editor": "^3.0.34",
|
|
9
9
|
"classnames": "~2.5.*",
|
|
10
10
|
"dayjs": "1.10.7",
|
|
11
|
-
"dtable-utils": "~5.0.
|
|
11
|
+
"dtable-utils": "~5.0.32",
|
|
12
12
|
"is-hotkey": "0.2.0",
|
|
13
13
|
"rc-checkbox": "3.5.0",
|
|
14
14
|
"react-color": "2.19.3",
|