dtable-ui-component 6.0.109 → 6.0.110
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/ImagePreviewerLightbox/index.css +49 -6
- package/lib/ImagePreviewerLightbox/index.js +46 -25
- package/lib/locales/de.json +5 -0
- package/lib/locales/en.json +5 -0
- package/lib/locales/es.json +5 -0
- package/lib/locales/fr.json +5 -0
- package/lib/locales/pt.json +5 -0
- package/lib/locales/ru.json +5 -0
- package/lib/locales/zh-CN.json +5 -0
- package/package.json +13 -14
|
@@ -4,18 +4,61 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.ril__outer .ril__toolbarItem {
|
|
7
|
-
height: 50px;
|
|
8
|
-
color: #fff;
|
|
9
|
-
display: inline-block;
|
|
10
|
-
font-size: 120%;
|
|
11
|
-
line-height: 50px;
|
|
12
7
|
max-width: 100%;
|
|
13
|
-
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
14
11
|
padding: 0;
|
|
12
|
+
color: #fff;
|
|
13
|
+
overflow: hidden;
|
|
15
14
|
text-overflow: ellipsis;
|
|
16
15
|
white-space: nowrap;
|
|
17
16
|
}
|
|
18
17
|
|
|
18
|
+
.ril__outer .ril__toolbarItem button {
|
|
19
|
+
background-size: 20px;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ril__builtinButton:hover,
|
|
24
|
+
.ril__builtinButton:focus {
|
|
25
|
+
background-color: #666;
|
|
26
|
+
opacity: 1 !important;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ril__viewOriginalButton {
|
|
30
|
+
height: 40px;
|
|
31
|
+
width: 178px!important;
|
|
32
|
+
-ms-flex-negative: 0;
|
|
33
|
+
background: #333;
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
color: #fff;
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
font-style: normal;
|
|
39
|
+
font-weight: 400;
|
|
40
|
+
line-height: normal
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.mobile-image-footer-choice .ril__builtinButton {
|
|
44
|
+
opacity: 1 !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ril__builtinButton:hover,
|
|
48
|
+
.ril__builtinButton:focus {
|
|
49
|
+
background-color: #666 !important;
|
|
50
|
+
opacity: 1 !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ril__builtinButtonDisabled {
|
|
54
|
+
cursor: default;
|
|
55
|
+
opacity: 0.5 !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ril__builtinButtonDisabled:hover {
|
|
59
|
+
opacity: 0.5 !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
19
62
|
.ril-caption .ril__builtinButton {
|
|
20
63
|
width: 24px;
|
|
21
64
|
}
|
|
@@ -27,31 +27,44 @@ function ImagePreviewerLightbox(props) {
|
|
|
27
27
|
onRotateImage
|
|
28
28
|
} = props;
|
|
29
29
|
const imageSrcList = imageItems.map(src => {
|
|
30
|
+
let name = '';
|
|
31
|
+
try {
|
|
32
|
+
name = src ? decodeURIComponent(src.slice(src.lastIndexOf('/') + 1)) : '';
|
|
33
|
+
} catch (error) {
|
|
34
|
+
// eslint-disable-next-line no-console
|
|
35
|
+
console.log(error);
|
|
36
|
+
}
|
|
30
37
|
if (server && dtableUuid && (0, _url.isCustomAssetUrl)(src)) {
|
|
31
38
|
const assetUuid = src.slice(src.lastIndexOf('/') + 1, src.lastIndexOf('.'));
|
|
32
|
-
return
|
|
39
|
+
return {
|
|
40
|
+
name,
|
|
41
|
+
thumbnail: server + '/dtable/' + dtableUuid + '/custom-asset/' + assetUuid
|
|
42
|
+
};
|
|
33
43
|
}
|
|
34
44
|
if (server && dtableUuid && workspaceID && (0, _url.isDigitalSignsUrl)(src)) {
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
return {
|
|
46
|
+
name,
|
|
47
|
+
thumbnail: (0, _url.generateCurrentBaseImageUrl)({
|
|
48
|
+
server,
|
|
49
|
+
workspaceID,
|
|
50
|
+
dtableUuid,
|
|
51
|
+
partUrl: src
|
|
52
|
+
})
|
|
53
|
+
};
|
|
41
54
|
}
|
|
42
|
-
return
|
|
55
|
+
return {
|
|
56
|
+
name: name || '',
|
|
57
|
+
thumbnail: src
|
|
58
|
+
};
|
|
43
59
|
});
|
|
44
60
|
const imagesLength = imageSrcList.length;
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
// eslint-disable-next-line no-console
|
|
53
|
-
console.log(error);
|
|
54
|
-
}
|
|
61
|
+
const [currentImageIndex, setCurrentImageIndex] = _react.default.useState(imageIndex || 0);
|
|
62
|
+
const imageItem = imageSrcList[currentImageIndex];
|
|
63
|
+
const URL = imageItem ? imageItem.thumbnail : '';
|
|
64
|
+
const imageName = imageItem ? imageItem.name : '';
|
|
65
|
+
_react.default.useEffect(() => {
|
|
66
|
+
setCurrentImageIndex(imageIndex);
|
|
67
|
+
}, [imageIndex]);
|
|
55
68
|
const canRotateImage = onRotateImage && !readOnly && !['gif', 'heic', 'heif'].includes((0, _url.getFileSuffix)(URL)) && (0, _url.isInternalImg)(URL, server);
|
|
56
69
|
let mainSrc = URL;
|
|
57
70
|
if ((0, _url.needUseThumbnailImage)(URL)) {
|
|
@@ -66,18 +79,21 @@ function ImagePreviewerLightbox(props) {
|
|
|
66
79
|
className: "d-flex",
|
|
67
80
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
68
81
|
className: "text-truncate",
|
|
69
|
-
children: imageName
|
|
82
|
+
children: imageName || ''
|
|
70
83
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
71
84
|
className: "flex-shrink-0 pl-1",
|
|
72
|
-
children: ["(",
|
|
85
|
+
children: ["(", currentImageIndex + 1, "/", imagesLength, ")"]
|
|
73
86
|
})]
|
|
74
87
|
});
|
|
75
88
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactImageLightbox.default, {
|
|
89
|
+
imageItems: imageSrcList,
|
|
90
|
+
currentIndex: currentImageIndex,
|
|
91
|
+
setImageIndex: index => setCurrentImageIndex(index),
|
|
76
92
|
wrapperClassName: (0, _classnames.default)('dtable-ui-component', className),
|
|
77
93
|
imageTitle: imageTitleDOM,
|
|
78
94
|
mainSrc: mainSrc,
|
|
79
|
-
nextSrc: imageSrcList[(
|
|
80
|
-
prevSrc: imageSrcList[(
|
|
95
|
+
nextSrc: imageSrcList[(currentImageIndex + 1) % imagesLength] ? imageSrcList[(currentImageIndex + 1) % imagesLength].thumbnail : '',
|
|
96
|
+
prevSrc: imageSrcList[(currentImageIndex + imagesLength - 1) % imagesLength] ? imageSrcList[(currentImageIndex + imagesLength - 1) % imagesLength].thumbnail : '',
|
|
81
97
|
imagePadding: 70,
|
|
82
98
|
viewOriginalImageLabel: (0, _lang.getLocale)('View_original_image'),
|
|
83
99
|
enableRotate: canRotateImage,
|
|
@@ -88,14 +104,19 @@ function ImagePreviewerLightbox(props) {
|
|
|
88
104
|
onClickMoveDown: props.moveToNextRowImage,
|
|
89
105
|
onViewOriginal: props.onViewOriginal,
|
|
90
106
|
onRotateImage: canRotateImage ? deg => {
|
|
91
|
-
onRotateImage(
|
|
107
|
+
onRotateImage(currentImageIndex, deg);
|
|
92
108
|
} : null,
|
|
93
109
|
onClickDelete: !readOnly && deleteImage ? () => {
|
|
94
|
-
deleteImage(
|
|
110
|
+
deleteImage(currentImageIndex, 'previewer');
|
|
95
111
|
} : null,
|
|
96
112
|
onClickDownload: downloadImage ? () => {
|
|
97
113
|
downloadImage(URL);
|
|
98
|
-
} : null
|
|
114
|
+
} : null,
|
|
115
|
+
zoomInTip: (0, _lang.getLocale)('Zoom_in'),
|
|
116
|
+
zoomOutTip: (0, _lang.getLocale)('Zoom_out'),
|
|
117
|
+
rotateTip: (0, _lang.getLocale)('Rotate_image'),
|
|
118
|
+
deleteTip: (0, _lang.getLocale)('Delete_image'),
|
|
119
|
+
downloadImageTip: (0, _lang.getLocale)('Download_image')
|
|
99
120
|
});
|
|
100
121
|
}
|
|
101
122
|
var _default = exports.default = ImagePreviewerLightbox;
|
package/lib/locales/de.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"Search_collaborator": "Mitarbeiter suchen",
|
|
10
10
|
"No_collaborators_available": "Es sind keine Mitarbeiter verfügbar.",
|
|
11
11
|
"Done": "Erledigt",
|
|
12
|
+
"Rotate_image": "Rotate image",
|
|
13
|
+
"Delete_image": "delete image",
|
|
14
|
+
"Download_image": "Download image",
|
|
15
|
+
"Zoom_in": "Zoom in",
|
|
16
|
+
"Zoom_out": "Zoom out",
|
|
12
17
|
"Choose_a_collaborator": "Wählen Sie einen Mitarbeiter",
|
|
13
18
|
"Please_select": "Auswählen",
|
|
14
19
|
"Clear": "Leeren",
|
package/lib/locales/en.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"Search_collaborator": "Search collaborator",
|
|
10
10
|
"No_collaborators_available": "No collaborators available.",
|
|
11
11
|
"Done": "Done",
|
|
12
|
+
"Rotate_image": "Rotate image",
|
|
13
|
+
"Delete_image": "delete image",
|
|
14
|
+
"Download_image": "Download image",
|
|
15
|
+
"Zoom_in": "Zoom in",
|
|
16
|
+
"Zoom_out": "Zoom out",
|
|
12
17
|
"Choose_a_collaborator": "Choose a collaborator",
|
|
13
18
|
"Please_select": "Please select",
|
|
14
19
|
"Clear": "Clear",
|
package/lib/locales/es.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"Search_collaborator": "Search collaborator",
|
|
10
10
|
"No_collaborators_available": "No hay colaboradores disponibles.",
|
|
11
11
|
"Done": "Hecho",
|
|
12
|
+
"Rotate_image": "Rotate image",
|
|
13
|
+
"Delete_image": "delete image",
|
|
14
|
+
"Download_image": "Download image",
|
|
15
|
+
"Zoom_in": "Zoom in",
|
|
16
|
+
"Zoom_out": "Zoom out",
|
|
12
17
|
"Choose_a_collaborator": "Choose a collaborator",
|
|
13
18
|
"Please_select": "Seleccione",
|
|
14
19
|
"Clear": "Limpiar",
|
package/lib/locales/fr.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"Search_collaborator": "Rechercher des collaborateurs",
|
|
10
10
|
"No_collaborators_available": "Aucun collaborateur n'est disponible.",
|
|
11
11
|
"Done": "Fait",
|
|
12
|
+
"Rotate_image": "Rotate image",
|
|
13
|
+
"Delete_image": "delete image",
|
|
14
|
+
"Download_image": "Download image",
|
|
15
|
+
"Zoom_in": "Zoom in",
|
|
16
|
+
"Zoom_out": "Zoom out",
|
|
12
17
|
"Choose_a_collaborator": "Choisissez un collaborateur",
|
|
13
18
|
"Please_select": "Sélectionner",
|
|
14
19
|
"Clear": "Effacer",
|
package/lib/locales/pt.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"Search_collaborator": "Encontre um colaborador",
|
|
10
10
|
"No_collaborators_available": "Nenhum colaborador disponível.",
|
|
11
11
|
"Done": "Feita",
|
|
12
|
+
"Rotate_image": "Rotate image",
|
|
13
|
+
"Delete_image": "delete image",
|
|
14
|
+
"Download_image": "Download image",
|
|
15
|
+
"Zoom_in": "Zoom in",
|
|
16
|
+
"Zoom_out": "Zoom out",
|
|
12
17
|
"Choose_a_collaborator": "Choose a collaborator",
|
|
13
18
|
"Please_select": "Por favor, selecione",
|
|
14
19
|
"Clear": "Clara",
|
package/lib/locales/ru.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"Search_collaborator": "Поиск сотрудника",
|
|
10
10
|
"No_collaborators_available": "Нет сотрудников.",
|
|
11
11
|
"Done": "Выполнено",
|
|
12
|
+
"Rotate_image": "Rotate image",
|
|
13
|
+
"Delete_image": "delete image",
|
|
14
|
+
"Download_image": "Download image",
|
|
15
|
+
"Zoom_in": "Zoom in",
|
|
16
|
+
"Zoom_out": "Zoom out",
|
|
12
17
|
"Choose_a_collaborator": "Choose a collaborator",
|
|
13
18
|
"Please_select": "Please select",
|
|
14
19
|
"Clear": "Очистить",
|
package/lib/locales/zh-CN.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"Search_collaborator": "搜索协作人",
|
|
10
10
|
"No_collaborators_available": "没有找到协作人",
|
|
11
11
|
"Done": "完成",
|
|
12
|
+
"Rotate_image": "旋转",
|
|
13
|
+
"Delete_image": "删除",
|
|
14
|
+
"Download_image": "下载",
|
|
15
|
+
"Zoom_in": "放大",
|
|
16
|
+
"Zoom_out": "缩小",
|
|
12
17
|
"Choose_a_collaborator": "选择一个协作人",
|
|
13
18
|
"Please_select": "请选择",
|
|
14
19
|
"Clear": "清除",
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-ui-component",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.110",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@seafile/react-image-lightbox": "
|
|
6
|
+
"@seafile/react-image-lightbox": "^5.0.4",
|
|
7
7
|
"@seafile/seafile-calendar": "^1.0.8",
|
|
8
|
-
"@seafile/seafile-editor": "
|
|
8
|
+
"@seafile/seafile-editor": "^3.0.26",
|
|
9
9
|
"classnames": "~2.5.*",
|
|
10
10
|
"dayjs": "1.10.7",
|
|
11
11
|
"dtable-utils": "~5.0.27",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@types/jest": "^29.5.10",
|
|
83
83
|
"autoprefixer": "10.4.5",
|
|
84
84
|
"babel-eslint": "10.0.1",
|
|
85
|
-
"babel-jest": "^
|
|
85
|
+
"babel-jest": "^30.3.0",
|
|
86
86
|
"babel-loader": "^8.2.3",
|
|
87
87
|
"babel-plugin-import": "^1.13.6",
|
|
88
88
|
"babel-plugin-named-asset-import": "^0.3.6",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
93
93
|
"circular-dependency-plugin": "^5.2.2",
|
|
94
94
|
"css-loader": "^6.5.1",
|
|
95
|
-
"css-minimizer-webpack-plugin": "^
|
|
95
|
+
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
96
96
|
"dotenv": "^10.0.0",
|
|
97
97
|
"dotenv-expand": "^5.1.0",
|
|
98
98
|
"eslint": "^8.3.0",
|
|
@@ -103,19 +103,21 @@
|
|
|
103
103
|
"fs-extra": "^10.0.0",
|
|
104
104
|
"html-webpack-plugin": "^5.5.0",
|
|
105
105
|
"identity-obj-proxy": "3.0.0",
|
|
106
|
-
"jest": "^
|
|
107
|
-
"jest-
|
|
108
|
-
"jest-
|
|
106
|
+
"jest": "^30.3.0",
|
|
107
|
+
"jest-cli": "^30.3.0",
|
|
108
|
+
"jest-environment-jsdom": "^30.3.0",
|
|
109
|
+
"jest-resolve": "^30.3.0",
|
|
110
|
+
"jest-watch-typeahead": "^3.0.1",
|
|
109
111
|
"less": "^4.2.0",
|
|
110
112
|
"less-loader": "^11.1.3",
|
|
111
113
|
"mini-css-extract-plugin": "^2.4.5",
|
|
112
|
-
"node-polyfill-webpack-plugin": "2.0.1",
|
|
113
114
|
"path-browserify": "^1.0.1",
|
|
114
115
|
"postcss": "^8.5.3",
|
|
115
116
|
"postcss-flexbugs-fixes": "^5.0.2",
|
|
116
117
|
"postcss-loader": "^6.2.1",
|
|
117
118
|
"postcss-normalize": "^10.0.1",
|
|
118
119
|
"postcss-preset-env": "^7.0.1",
|
|
120
|
+
"process": "^0.11.10",
|
|
119
121
|
"prompts": "^2.4.2",
|
|
120
122
|
"prop-types": "15.8.1",
|
|
121
123
|
"react": "18.3.1",
|
|
@@ -133,11 +135,8 @@
|
|
|
133
135
|
"style-loader": "^3.3.1",
|
|
134
136
|
"terser-webpack-plugin": "^5.2.5",
|
|
135
137
|
"url-loader": "^4.1.1",
|
|
136
|
-
"
|
|
137
|
-
"webpack": "^5.
|
|
138
|
-
"webpack-dev-server": "^5.2.2",
|
|
139
|
-
"webpack-manifest-plugin": "^4.0.2",
|
|
140
|
-
"workbox-webpack-plugin": "^6.4.1",
|
|
138
|
+
"webpack": "^5.105.4",
|
|
139
|
+
"webpack-dev-server": "^5.2.3",
|
|
141
140
|
"worker-loader": "3.0.8"
|
|
142
141
|
}
|
|
143
142
|
}
|