dtable-ui-component 0.3.18 → 0.3.20

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.
@@ -1,11 +1,8 @@
1
- import React, { Fragment } from 'react';
2
- import MediaQuery from 'react-responsive';
1
+ import React from 'react';
3
2
  import classnames from 'classnames';
4
- import ModalPortal from '../ModalPortal';
5
3
  import Lightbox from '@seafile/react-image-lightbox';
6
4
  import { checkSVGImage, isInternalImg } from './utils';
7
5
  import '@seafile/react-image-lightbox/style.css';
8
- import './index.css';
9
6
 
10
7
  function ImagePreviewerLightbox(props) {
11
8
  var imageItems = props.imageItems,
@@ -30,113 +27,27 @@ function ImagePreviewerLightbox(props) {
30
27
  }, imageTitle), /*#__PURE__*/React.createElement("span", {
31
28
  className: "flex-shrink-0"
32
29
  }, "(", imageIndex + 1, "/", imageItemsLength, ")"));
33
- var toolbarButtons = [];
34
-
35
- if (moveToPrevRowImage) {
36
- toolbarButtons.push( /*#__PURE__*/React.createElement("button", {
37
- className: "dtable-font dtable-icon-retract",
38
- onClick: function onClick(event) {
39
- moveToPrevRowImage(event);
40
- }
41
- }));
42
- }
43
-
44
- if (moveToNextRowImage) {
45
- toolbarButtons.push( /*#__PURE__*/React.createElement("button", {
46
- className: "dtable-font dtable-icon-display",
47
- onClick: function onClick(event) {
48
- moveToNextRowImage(event);
49
- }
50
- }));
51
- }
52
-
53
- if (!readOnly && deleteImage) {
54
- toolbarButtons.push( /*#__PURE__*/React.createElement("button", {
55
- className: "dtable-font dtable-icon-delete",
56
- onClick: function onClick() {
57
- deleteImage(imageIndex, 'previewer');
58
- }
59
- }));
60
- }
61
-
62
- if (downloadImage) {
63
- toolbarButtons.push( /*#__PURE__*/React.createElement("button", {
64
- className: "dtable-font dtable-icon-download",
65
- onClick: function onClick() {
66
- downloadImage(URL);
67
- }
68
- }));
69
- }
70
-
71
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MediaQuery, {
72
- query: "(min-width: 767.8px)"
73
- }, /*#__PURE__*/React.createElement(Lightbox, {
74
- wrapperClassName: classnames('PC-image-previewer', className),
30
+ return /*#__PURE__*/React.createElement(Lightbox, {
31
+ wrapperClassName: classnames('dtable-ui-component', className),
75
32
  imageTitle: imageTitleEl,
76
- toolbarButtons: toolbarButtons,
77
33
  mainSrc: imageItems[imageIndex],
78
34
  nextSrc: imageItems[(imageIndex + 1) % imageItemsLength],
79
35
  prevSrc: imageItems[(imageIndex + imageItemsLength - 1) % imageItemsLength],
80
36
  onCloseRequest: props.closeImagePopup,
81
37
  onMovePrevRequest: props.moveToPrevImage,
82
38
  onMoveNextRequest: props.moveToNextImage,
39
+ onClickMoveUp: moveToPrevRowImage,
40
+ onClickMoveDown: moveToNextRowImage,
83
41
  onRotateImage: canRotateImage ? function (deg) {
84
42
  onRotateImage(imageIndex, deg);
85
43
  } : null,
86
- imagePadding: 70,
87
- reactModalStyle: {
88
- overlay: {
89
- zIndex: 1051
90
- }
91
- }
92
- })), /*#__PURE__*/React.createElement(MediaQuery, {
93
- query: "(max-width: 767.8px)"
94
- }, /*#__PURE__*/React.createElement(Lightbox, {
95
- isDesktop: false,
96
- wrapperClassName: classnames('mobile-image-previewer dtable-ui-component', className),
97
- mainSrc: imageItems[imageIndex],
98
- nextSrc: imageItems[(imageIndex + 1) % imageItemsLength],
99
- prevSrc: imageItems[(imageIndex + imageItemsLength - 1) % imageItemsLength],
100
- onCloseRequest: props.closeImagePopup,
101
- onMovePrevRequest: props.moveToPrevImage,
102
- onMoveNextRequest: props.moveToNextImage,
103
- imagePadding: 0,
104
- animationDisabled: true,
105
- imageTitle: imageTitleEl,
106
- reactModalStyle: {
107
- overlay: {
108
- zIndex: 1051,
109
- backgroundColor: '#000'
110
- }
111
- }
112
- }), /*#__PURE__*/React.createElement(ModalPortal, null, /*#__PURE__*/React.createElement("div", {
113
- className: "image-footer-choice mobile-image-footer-choice dtable-ui-component"
114
- }, /*#__PURE__*/React.createElement("div", {
115
- className: "image-footer-icon"
116
- }, /*#__PURE__*/React.createElement("div", {
117
- className: "d-flex"
118
- }, canRotateImage && /*#__PURE__*/React.createElement("span", {
119
- className: "image-footer-choice-item mr-4",
120
- onClick: function onClick() {
121
- onRotateImage(imageIndex, 90);
122
- }
123
- }, /*#__PURE__*/React.createElement("i", {
124
- className: "dtable-font dtable-icon-rotate"
125
- })), downloadImage && /*#__PURE__*/React.createElement("span", {
126
- className: "image-footer-choice-item",
127
- onClick: function onClick() {
128
- downloadImage(URL);
129
- }
130
- }, /*#__PURE__*/React.createElement("i", {
131
- className: "dtable-font dtable-icon-download"
132
- }))), !readOnly && deleteImage && /*#__PURE__*/React.createElement("span", {
133
- className: "image-footer-choice-item",
134
- onClick: function onClick() {
44
+ onClickDelete: !readOnly && deleteImage ? function () {
135
45
  deleteImage(imageIndex, 'previewer');
136
- }
137
- }, /*#__PURE__*/React.createElement("i", {
138
- className: "dtable-font dtable-icon-delete"
139
- })))))));
46
+ } : null,
47
+ onClickDownload: downloadImage ? function () {
48
+ downloadImage(URL);
49
+ } : null
50
+ });
140
51
  }
141
52
 
142
53
  export default ImagePreviewerLightbox;
@@ -14,7 +14,7 @@ var DTABLE_VALUE = {
14
14
  '0bPT': ['bing.an@seafile.com', 'anbing@1.com', 'f1690214fb354581ba0d3550b372d667@auth.local'],
15
15
  'RBN9': '409842',
16
16
  '18wI': ['217573', '31392'],
17
- 'ne46': ['https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg', 'https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg', 'https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg', 'https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg', 'https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg', 'https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg', 'https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg', 'https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg', 'https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg', 'https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg'],
17
+ 'ne46': ['https://www.baidu.com/img/flexible/logo/pc/result@2.png', 'https://www.seafile.com/media/img/seafile-logo.png', 'https://www.baidu.com/img/flexible/logo/pc/result@2.png', 'https://www.seafile.com/media/img/seafile-logo.png', 'https://www.baidu.com/img/flexible/logo/pc/result@2.png', 'https://www.seafile.com/media/img/seafile-logo.png', 'https://www.baidu.com/img/flexible/logo/pc/result@2.png', 'https://www.seafile.com/media/img/seafile-logo.png', 'https://www.baidu.com/img/flexible/logo/pc/result@2.png', 'https://www.seafile.com/media/img/seafile-logo.png'],
18
18
  'U8Ee': [{
19
19
  'name': '01.txt',
20
20
  'type': 'file',
@@ -1416,7 +1416,7 @@ var DTABLE_VALUE = {
1416
1416
  '0bPT': ['bing.an@seafile.com', 'anbing@1.com', 'f1690214fb354581ba0d3550b372d667@auth.local'],
1417
1417
  'RBN9': '409842',
1418
1418
  '18wI': ['217573', '31392'],
1419
- 'ne46': ['https://dev.seatable.cn/workspace/3/asset/8327efbf-c9ff-4a14-9010-00e801a7e295/images/2023-02/test.jpeg'],
1419
+ 'ne46': ['https://www.baidu.com/img/flexible/logo/pc/result@2.png'],
1420
1420
  'U8Ee': [{
1421
1421
  'name': '01.txt',
1422
1422
  'type': 'file',
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.3.18",
3
+ "version": "0.3.20",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
- "@seafile/react-image-lightbox": "0.0.9",
6
+ "@seafile/react-image-lightbox": "2.0.4",
7
7
  "@seafile/seafile-calendar": "0.0.24",
8
- "@seafile/seafile-editor": "0.3.121",
8
+ "@seafile/seafile-editor": "0.3.137",
9
9
  "antd-mobile": "2.3.1",
10
10
  "bail": "1.0.5",
11
11
  "classnames": "^2.3.2",
@@ -137,7 +137,7 @@
137
137
  "resolve": "1.15.0",
138
138
  "resolve-url-loader": "3.1.1",
139
139
  "sass-loader": "8.0.2",
140
- "semver": "6.3.0",
140
+ "semver": "6.3.1",
141
141
  "style-loader": "0.23.1",
142
142
  "terser-webpack-plugin": "2.3.4",
143
143
  "ts-pnp": "1.1.5",
@@ -1,87 +0,0 @@
1
- .dtable-ui-component.mobile-image-previewer .ril-prev-button,
2
- .dtable-ui-component.mobile-image-previewer .ril-next-button,
3
- .dtable-ui-component.mobile-image-previewer .ril-caption .ril-zoom-in,
4
- .dtable-ui-component.mobile-image-previewer .ril-caption .ril-zoom-out {
5
- display: none;
6
- }
7
-
8
- .dtable-ui-component.mobile-image-previewer .ril-toolbar .ril__toolbarRightSide {
9
- padding-right: 14px;
10
- }
11
-
12
- .dtable-ui-component.image-footer-choice.mobile-image-footer-choice {
13
- height: 100px;
14
- background-color: #000;
15
- z-index: 1052;
16
- padding: 0;
17
- width: 100%;
18
- border-radius: 2px;
19
- border-top-right-radius: 0;
20
- border-top-left-radius: 0;
21
- bottom: 0;
22
- position: absolute;
23
- color: #fff;
24
- background: rgba(0, 0, 0, 0.6);
25
- display: flex;
26
- justify-content: space-between;
27
- align-items: center;
28
- }
29
-
30
- .dtable-ui-component.image-footer-choice.mobile-image-footer-choice .image-footer-icon {
31
- width: 100%;
32
- display: flex;
33
- align-items: center;
34
- justify-content: space-between;
35
- flex-direction: row-reverse;
36
- margin: 0 20px;
37
- }
38
-
39
- .dtable-ui-component.image-footer-choice.mobile-image-footer-choice .image-footer-icon .image-footer-choice-item {
40
- height: 40px;
41
- width: 40px;
42
- border-radius: 5px;
43
- background-color: #333;
44
- cursor: pointer;
45
- display: flex;
46
- justify-content: center;
47
- align-items: center;
48
- color: #dbdbdb;
49
- }
50
-
51
- .dtable-ui-component.image-footer-choice.mobile-image-footer-choice .image-footer-icon .image-footer-choice-item i {
52
- font-size: 20px;
53
- }
54
-
55
- .ril__outer .ril-caption button.dtable-font {
56
- height: 50px;
57
- font-size: 20px;
58
- }
59
-
60
- .ril__outer .ril-toolbar button.dtable-font {
61
- border: none;
62
- }
63
-
64
- .ril__outer .ril-toolbar button.dtable-font:focus {
65
- outline: none;
66
- }
67
-
68
- .ril__outer button.dtable-font {
69
- font-size: 16px;
70
- }
71
-
72
- .ril__outer .ril-toolbar .ril-close {
73
- width: 30px;
74
- height: 53px;
75
- }
76
-
77
- .ril__outer .ril__toolbarItem {
78
- height: 50px;
79
- }
80
-
81
- .ril__outer .ril__toolbarItem button {
82
- opacity: 0.7;
83
- }
84
-
85
- .ril__outer .ril__toolbarItem button:hover {
86
- opacity: 1;
87
- }