dtable-ui-component 4.4.3-2 → 4.4.3-alpha1
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/AutoNumberFormatter/index.js +7 -14
- package/lib/ButtonFormatter/index.js +9 -16
- package/lib/CTimeFormatter/index.js +9 -16
- package/lib/CheckboxEditor/index.js +8 -15
- package/lib/CheckboxFormatter/index.js +8 -15
- package/lib/CollaboratorEditor/index.js +21 -29
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +25 -32
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +18 -25
- package/lib/CollaboratorFormatter/index.js +12 -19
- package/lib/CollaboratorItem/index.js +10 -17
- package/lib/CreatorFormatter/index.js +12 -19
- package/lib/DTableCommonAddTool/index.js +6 -13
- package/lib/DTableCustomizeCollaboratorSelect/index.js +18 -26
- package/lib/DTableCustomizeSelect/index.js +15 -23
- package/lib/DTableFiltersPopover/constants/index.js +33 -38
- package/lib/DTableFiltersPopover/index.js +31 -38
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +46 -53
- package/lib/DTableFiltersPopover/utils/index.js +99 -128
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +26 -34
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +25 -33
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +26 -34
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +26 -34
- package/lib/DTableFiltersPopover/widgets/filter-item.js +120 -128
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +18 -26
- package/lib/DTableFiltersPopover/widgets/rate-item.js +8 -15
- package/lib/DTablePopover/index.js +8 -15
- package/lib/DTablePopover/utils.js +2 -9
- package/lib/DTableRadio/index.js +10 -17
- package/lib/DTableSearchInput/index.js +13 -21
- package/lib/DTableSearchInput/utils.js +2 -9
- package/lib/DTableSelect/dtable-select-label.js +6 -13
- package/lib/DTableSelect/index.js +10 -18
- package/lib/DTableSelect/utils.js +10 -20
- package/lib/DTableSwitch/index.js +7 -14
- package/lib/DateEditor/index.js +22 -30
- package/lib/DateEditor/mb-date-editor-popover/index.js +47 -55
- package/lib/DateEditor/pc-date-editor-popover.js +20 -27
- package/lib/DateFormatter/index.js +9 -16
- package/lib/Department-editor/constants.js +1 -7
- package/lib/Department-editor/department-multiple-select/index.js +24 -32
- package/lib/Department-editor/department-single-select.js +33 -41
- package/lib/Department-editor/index.js +14 -22
- package/lib/Department-editor/selected-departments/index.js +25 -32
- package/lib/Department-editor/utils.js +3 -11
- package/lib/DepartmentSingleSelectFormatter/index.js +9 -16
- package/lib/DigitalSignFormatter/index.js +15 -23
- package/lib/DigitalSignFormatter/utils.js +3 -11
- package/lib/DurationFormatter/index.js +9 -16
- package/lib/EditEditorButton/index.js +5 -12
- package/lib/EmailFormatter/index.js +7 -14
- package/lib/FieldDisplaySetting/field-item.js +14 -21
- package/lib/FieldDisplaySetting/index.js +19 -27
- package/lib/FileEditor/index.js +8 -15
- package/lib/FileEditor/pc-files-addition/index.js +0 -1
- package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +0 -1
- package/lib/FileEditor/pc-files-preview/index.js +0 -1
- package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +0 -1
- package/lib/FileFormatter/index.js +11 -19
- package/lib/FileItemFormatter/index.js +6 -14
- package/lib/FileItemFormatter/utils.js +2 -9
- package/lib/FileUploader/index.js +4 -11
- package/lib/FormulaFormatter/cell-value-validator.js +18 -24
- package/lib/FormulaFormatter/index.js +32 -39
- package/lib/FormulaFormatter/utils.js +13 -29
- package/lib/GeolocationFormatter/index.js +9 -16
- package/lib/HtmlLongTextFormatter/index.js +9 -17
- package/lib/HtmlLongTextFormatter/markdown2html.js +47 -0
- package/lib/HtmlLongTextFormatter/unified/index.js +400 -0
- package/lib/HtmlLongTextFormatter/vfile/core.js +155 -0
- package/lib/HtmlLongTextFormatter/vfile/index.js +40 -0
- package/lib/ImageFormatter/images-lazy-load.js +9 -16
- package/lib/ImageFormatter/index.js +16 -24
- package/lib/ImageFormatter/utils.js +2 -9
- package/lib/ImagePreviewerLightbox/index.js +12 -19
- package/lib/ImagePreviewerLightbox/utils.js +3 -11
- package/lib/LastModifierFormatter/index.js +12 -19
- package/lib/LinkEditor/index.js +25 -33
- package/lib/LinkEditor/link-editor-option.js +8 -15
- package/lib/LinkEditor/mb-link-editor-popover/index.js +23 -30
- package/lib/LinkEditor/pc-link-editor-popover/index.js +17 -24
- package/lib/LinkFormatter/index.js +13 -20
- package/lib/Loading/index.js +4 -11
- package/lib/LongTextFormatter/index.js +6 -13
- package/lib/MBEditorHeader/index.js +7 -14
- package/lib/MTimeFormatter/index.js +9 -16
- package/lib/ModalPortal/index.js +5 -12
- package/lib/MultipleSelectEditor/index.js +17 -25
- package/lib/MultipleSelectFormatter/index.js +10 -17
- package/lib/NotificationPopover/index.js +16 -24
- package/lib/NumberEditor/index.js +18 -25
- package/lib/NumberFormatter/index.js +9 -16
- package/lib/RateFormatter/index.js +8 -15
- package/lib/RoleStatusEditor/index.js +14 -22
- package/lib/RowExpandEmailFormatter/index.js +10 -17
- package/lib/RowExpandFileFormatter/index.js +8 -16
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +18 -27
- package/lib/RowExpandFormatter/index.js +78 -86
- package/lib/RowExpandFormulaFormatter/index.js +34 -42
- package/lib/RowExpandImageFormatter/index.js +10 -19
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +18 -27
- package/lib/RowExpandImageFormatter/utils.js +2 -9
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +7 -16
- package/lib/RowExpandLinkFormatter/index.js +37 -46
- package/lib/RowExpandLinkFormatter/utils.js +6 -17
- package/lib/RowExpandLinkFormatter/value-display-utils.js +5 -12
- package/lib/RowExpandRateFormatter/index.js +8 -15
- package/lib/RowExpandUrlFormatter/index.js +14 -21
- package/lib/SelectItem/index.js +4 -12
- package/lib/SelectOptionGroup/KeyCodes.js +1 -7
- package/lib/SelectOptionGroup/index.js +33 -32
- package/lib/SelectOptionGroup/option.js +4 -19
- package/lib/SimpleLongTextFormatter/index.js +20 -27
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +1 -7
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +8 -15
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +7 -14
- package/lib/SingleSelectEditor/index.js +18 -26
- package/lib/SingleSelectFormatter/index.js +9 -16
- package/lib/TextEditor/index.js +7 -14
- package/lib/TextFormatter/index.js +7 -14
- package/lib/UrlFormatter/index.js +7 -14
- package/lib/cellFormatterFactory/index.js +4 -11
- package/lib/common/ClickOutside.js +4 -12
- package/lib/common/delete-tip.js +12 -20
- package/lib/common/modal-portal.js +5 -13
- package/lib/constants/index.js +9 -28
- package/lib/data/dtable-value.js +6 -11
- package/lib/formatterConfig/base-formatter-config.js +46 -53
- package/lib/formatterConfig/index.js +9 -16
- package/lib/hooks/common-hooks.js +4 -11
- package/lib/index.js +75 -432
- package/lib/lang/index.js +13 -24
- package/lib/locals/de.js +1 -7
- package/lib/locals/en.js +1 -7
- package/lib/locals/fr.js +1 -7
- package/lib/locals/zh-CN.js +1 -7
- package/lib/select-editor/index.js +4 -27
- package/lib/select-editor/mb-select-editor-popover/index.js +33 -41
- package/lib/select-editor/pc-select-editor-popover/index.js +19 -26
- package/lib/select-editor/select-editor-option.js +8 -15
- package/lib/toaster/alert.js +11 -18
- package/lib/toaster/index.js +3 -10
- package/lib/toaster/toast.js +8 -16
- package/lib/toaster/toastManager.js +5 -13
- package/lib/toaster/toaster.js +7 -15
- package/lib/utils/dayjs.js +4 -11
- package/lib/utils/editor-utils.js +5 -15
- package/lib/utils/event-bus.js +1 -7
- package/lib/utils/utils.js +6 -17
- package/package.json +77 -63
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _imagesLazyLoad = _interopRequireDefault(require("./images-lazy-load"));
|
|
12
|
-
var _utils = require("./utils");
|
|
13
|
-
var _ImagePreviewerLightbox = _interopRequireDefault(require("../ImagePreviewerLightbox"));
|
|
14
|
-
require("./index.css");
|
|
15
|
-
class ImageFormatter extends _react.default.Component {
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import ImagesLazyLoad from './images-lazy-load';
|
|
4
|
+
import { getImageThumbnailUrl } from './utils';
|
|
5
|
+
import ImagePreviewerLightbox from '../ImagePreviewerLightbox';
|
|
6
|
+
import './index.css';
|
|
7
|
+
class ImageFormatter extends React.Component {
|
|
16
8
|
constructor(props) {
|
|
17
9
|
super(props);
|
|
18
10
|
this.onImageClick = index => {
|
|
@@ -77,7 +69,7 @@ class ImageFormatter extends _react.default.Component {
|
|
|
77
69
|
containerClassName,
|
|
78
70
|
readOnly
|
|
79
71
|
} = this.props;
|
|
80
|
-
const className = (
|
|
72
|
+
const className = classnames('dtable-ui cell-formatter-container image-formatter', containerClassName);
|
|
81
73
|
const {
|
|
82
74
|
isPreviewImage,
|
|
83
75
|
previewImageIndex
|
|
@@ -87,24 +79,24 @@ class ImageFormatter extends _react.default.Component {
|
|
|
87
79
|
}
|
|
88
80
|
if (isSample) {
|
|
89
81
|
let item = value[0];
|
|
90
|
-
let url =
|
|
91
|
-
return /*#__PURE__*/
|
|
82
|
+
let url = getImageThumbnailUrl(item, server);
|
|
83
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
92
84
|
className: className
|
|
93
|
-
}, /*#__PURE__*/
|
|
85
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
94
86
|
className: "image-item",
|
|
95
87
|
src: url,
|
|
96
88
|
alt: ""
|
|
97
|
-
}), value.length !== 1 && /*#__PURE__*/
|
|
89
|
+
}), value.length !== 1 && /*#__PURE__*/React.createElement("span", {
|
|
98
90
|
className: "image-item-count"
|
|
99
91
|
}, "+".concat(value.length)));
|
|
100
92
|
}
|
|
101
|
-
return /*#__PURE__*/
|
|
93
|
+
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
102
94
|
className: className
|
|
103
|
-
}, /*#__PURE__*/
|
|
95
|
+
}, /*#__PURE__*/React.createElement(ImagesLazyLoad, {
|
|
104
96
|
images: value,
|
|
105
97
|
server: server,
|
|
106
98
|
onImageClick: this.onImageClick
|
|
107
|
-
})), isPreviewImage && /*#__PURE__*/
|
|
99
|
+
})), isPreviewImage && /*#__PURE__*/React.createElement(ImagePreviewerLightbox, {
|
|
108
100
|
imageItems: value,
|
|
109
101
|
imageIndex: previewImageIndex,
|
|
110
102
|
closeImagePopup: this.closeImagePopup,
|
|
@@ -128,4 +120,4 @@ ImageFormatter.defaultProps = {
|
|
|
128
120
|
server: '',
|
|
129
121
|
containerClassName: ''
|
|
130
122
|
};
|
|
131
|
-
|
|
123
|
+
export default ImageFormatter;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getImageThumbnailUrl = void 0;
|
|
7
|
-
const getImageThumbnailUrl = (url, server) => {
|
|
1
|
+
export const getImageThumbnailUrl = (url, server) => {
|
|
8
2
|
if (server && url.indexOf(server) > -1) {
|
|
9
3
|
return url.replace('/workspace', '/thumbnail/workspace') + '?size=256';
|
|
10
4
|
}
|
|
11
5
|
return url;
|
|
12
|
-
};
|
|
13
|
-
exports.getImageThumbnailUrl = getImageThumbnailUrl;
|
|
6
|
+
};
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _reactImageLightbox = _interopRequireDefault(require("@seafile/react-image-lightbox"));
|
|
11
|
-
var _utils = require("./utils");
|
|
12
|
-
require("@seafile/react-image-lightbox/style.css");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import Lightbox from '@seafile/react-image-lightbox';
|
|
4
|
+
import { checkSVGImage, isInternalImg } from './utils';
|
|
5
|
+
import '@seafile/react-image-lightbox/style.css';
|
|
13
6
|
function ImagePreviewerLightbox(props) {
|
|
14
7
|
const {
|
|
15
8
|
imageItems,
|
|
@@ -27,16 +20,16 @@ function ImagePreviewerLightbox(props) {
|
|
|
27
20
|
const URL = imageItems[imageIndex];
|
|
28
21
|
const imageTitle = URL ? decodeURI(URL.slice(URL.lastIndexOf('/') + 1)) : '';
|
|
29
22
|
// svg image is vectorgraph and can't rotate, external image can't rotate
|
|
30
|
-
const canRotateImage = onRotateImage && !readOnly && !
|
|
31
|
-
const imageTitleEl = /*#__PURE__*/
|
|
23
|
+
const canRotateImage = onRotateImage && !readOnly && !checkSVGImage(URL) && isInternalImg(URL, server);
|
|
24
|
+
const imageTitleEl = /*#__PURE__*/React.createElement("span", {
|
|
32
25
|
className: "d-flex"
|
|
33
|
-
}, /*#__PURE__*/
|
|
26
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
34
27
|
className: "text-truncate"
|
|
35
|
-
}, imageTitle), /*#__PURE__*/
|
|
28
|
+
}, imageTitle), /*#__PURE__*/React.createElement("span", {
|
|
36
29
|
className: "flex-shrink-0"
|
|
37
30
|
}, "(", imageIndex + 1, "/", imageItemsLength, ")"));
|
|
38
|
-
return /*#__PURE__*/
|
|
39
|
-
wrapperClassName: (
|
|
31
|
+
return /*#__PURE__*/React.createElement(Lightbox, {
|
|
32
|
+
wrapperClassName: classnames('dtable-ui-component', className),
|
|
40
33
|
imageTitle: imageTitleEl,
|
|
41
34
|
mainSrc: imageItems[imageIndex],
|
|
42
35
|
nextSrc: imageItems[(imageIndex + 1) % imageItemsLength],
|
|
@@ -57,4 +50,4 @@ function ImagePreviewerLightbox(props) {
|
|
|
57
50
|
} : null
|
|
58
51
|
});
|
|
59
52
|
}
|
|
60
|
-
|
|
53
|
+
export default ImagePreviewerLightbox;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isInternalImg = exports.checkSVGImage = void 0;
|
|
7
|
-
const isInternalImg = (url, server) => {
|
|
1
|
+
export const isInternalImg = (url, server) => {
|
|
8
2
|
if (!url) return;
|
|
9
3
|
const currentServer = server || window.dtable && window.dtable.server;
|
|
10
4
|
return url.indexOf(currentServer) > -1;
|
|
11
5
|
};
|
|
12
|
-
|
|
13
|
-
const checkSVGImage = url => {
|
|
6
|
+
export const checkSVGImage = url => {
|
|
14
7
|
if (!url) return false;
|
|
15
8
|
return url.substr(-4).toLowerCase() === '.svg';
|
|
16
|
-
};
|
|
17
|
-
exports.checkSVGImage = checkSVGImage;
|
|
9
|
+
};
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _CollaboratorItem = _interopRequireDefault(require("../CollaboratorItem"));
|
|
11
|
-
var _default_avatar = _interopRequireDefault(require("../assets/images/avatar/default_avatar.png"));
|
|
12
|
-
require("./index.css");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import CollaboratorItem from '../CollaboratorItem';
|
|
4
|
+
import DefaultAvatar from '../assets/images/avatar/default_avatar.png';
|
|
5
|
+
import './index.css';
|
|
13
6
|
// there will be there conditions
|
|
14
7
|
// 1 value is not exist, typeof value is array, but it's length is 0
|
|
15
8
|
// 2 value is exist, but can't find in collaborators
|
|
16
9
|
// 3 value is exist, typeof value is a string
|
|
17
10
|
// 4 value is exist, typeof value is array
|
|
18
|
-
class LastModifierFormatter extends
|
|
11
|
+
class LastModifierFormatter extends React.PureComponent {
|
|
19
12
|
constructor() {
|
|
20
13
|
super(...arguments);
|
|
21
14
|
this.getCollaborators = () => {
|
|
@@ -32,10 +25,10 @@ class LastModifierFormatter extends _react.default.PureComponent {
|
|
|
32
25
|
if (!collaborator) {
|
|
33
26
|
collaborator = {
|
|
34
27
|
name: item,
|
|
35
|
-
avatar_url:
|
|
28
|
+
avatar_url: DefaultAvatar
|
|
36
29
|
};
|
|
37
30
|
}
|
|
38
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/React.createElement(CollaboratorItem, {
|
|
39
32
|
key: index,
|
|
40
33
|
collaborator: collaborator
|
|
41
34
|
});
|
|
@@ -47,14 +40,14 @@ class LastModifierFormatter extends _react.default.PureComponent {
|
|
|
47
40
|
containerClassName,
|
|
48
41
|
value
|
|
49
42
|
} = this.props;
|
|
50
|
-
const classname = (
|
|
43
|
+
const classname = classnames('dtable-ui cell-formatter-container last-modified-formatter', containerClassName);
|
|
51
44
|
if (!value || Array.isArray(value) && value.length === 0) {
|
|
52
|
-
return /*#__PURE__*/
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
53
46
|
className: classname
|
|
54
47
|
});
|
|
55
48
|
}
|
|
56
49
|
const collaborators = this.getCollaborators();
|
|
57
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
58
51
|
className: classname
|
|
59
52
|
}, collaborators);
|
|
60
53
|
}
|
|
@@ -62,4 +55,4 @@ class LastModifierFormatter extends _react.default.PureComponent {
|
|
|
62
55
|
LastModifierFormatter.defaultProps = {
|
|
63
56
|
value: ''
|
|
64
57
|
};
|
|
65
|
-
|
|
58
|
+
export default LastModifierFormatter;
|
package/lib/LinkEditor/index.js
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _lang = require("../lang");
|
|
13
|
-
var _constants = require("../constants");
|
|
14
|
-
var _EditEditorButton = _interopRequireDefault(require("../EditEditorButton"));
|
|
15
|
-
var _linkEditorOption = _interopRequireDefault(require("./link-editor-option"));
|
|
16
|
-
var _pcLinkEditorPopover = _interopRequireDefault(require("./pc-link-editor-popover"));
|
|
17
|
-
var _mbLinkEditorPopover = _interopRequireDefault(require("./mb-link-editor-popover"));
|
|
18
|
-
require("./index.css");
|
|
19
|
-
class LinkEditor extends _react.default.Component {
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import MediaQuery from 'react-responsive';
|
|
3
|
+
import { getNumberDisplayString, getDateDisplayString } from 'dtable-utils';
|
|
4
|
+
import { getLocale } from '../lang';
|
|
5
|
+
import { CellType } from '../constants';
|
|
6
|
+
import EditEditorButton from '../EditEditorButton';
|
|
7
|
+
import LinkEditorOption from './link-editor-option';
|
|
8
|
+
import PCLinkEditorPopover from './pc-link-editor-popover';
|
|
9
|
+
import MBLinkEditorPopover from './mb-link-editor-popover';
|
|
10
|
+
import './index.css';
|
|
11
|
+
class LinkEditor extends React.Component {
|
|
20
12
|
constructor(props) {
|
|
21
13
|
super(props);
|
|
22
14
|
this.onMouseDown = e => {
|
|
@@ -73,16 +65,16 @@ class LinkEditor extends _react.default.Component {
|
|
|
73
65
|
data
|
|
74
66
|
} = linkedColumn;
|
|
75
67
|
switch (type) {
|
|
76
|
-
case
|
|
68
|
+
case CellType.NUMBER:
|
|
77
69
|
{
|
|
78
|
-
return
|
|
70
|
+
return getNumberDisplayString(value, data);
|
|
79
71
|
}
|
|
80
|
-
case
|
|
72
|
+
case CellType.DATE:
|
|
81
73
|
{
|
|
82
74
|
let {
|
|
83
75
|
format
|
|
84
76
|
} = data;
|
|
85
|
-
return
|
|
77
|
+
return getDateDisplayString(value, format);
|
|
86
78
|
}
|
|
87
79
|
default:
|
|
88
80
|
return value;
|
|
@@ -221,32 +213,32 @@ class LinkEditor extends _react.default.Component {
|
|
|
221
213
|
let options = this.getAvailableLinkedOptions();
|
|
222
214
|
let selectedOptions = this.formatLinkedValuesToOptions();
|
|
223
215
|
let isShowRemoveIcon = !isReadOnly;
|
|
224
|
-
return /*#__PURE__*/
|
|
216
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
225
217
|
ref: this.setEditorContainerRef,
|
|
226
218
|
className: "dtable-ui-link-editor"
|
|
227
|
-
}, /*#__PURE__*/
|
|
219
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
228
220
|
ref: this.setEditorRef,
|
|
229
221
|
className: "dtable-ui-link-editor-container",
|
|
230
222
|
onClick: this.onAddOptionToggle
|
|
231
|
-
}, selectedOptions.length === 0 && /*#__PURE__*/
|
|
232
|
-
text:
|
|
223
|
+
}, selectedOptions.length === 0 && /*#__PURE__*/React.createElement(EditEditorButton, {
|
|
224
|
+
text: getLocale('Add_an_option')
|
|
233
225
|
}), selectedOptions.length !== 0 && selectedOptions.map(option => {
|
|
234
|
-
return /*#__PURE__*/
|
|
226
|
+
return /*#__PURE__*/React.createElement(LinkEditorOption, {
|
|
235
227
|
key: option.id,
|
|
236
228
|
option: option,
|
|
237
229
|
isShowRemoveIcon: isShowRemoveIcon,
|
|
238
230
|
onDeleteLinkOption: this.onDeleteOption
|
|
239
231
|
});
|
|
240
|
-
})), isPopoverShow && /*#__PURE__*/
|
|
232
|
+
})), isPopoverShow && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MediaQuery, {
|
|
241
233
|
query: "(min-width: 768px)"
|
|
242
|
-
}, /*#__PURE__*/
|
|
234
|
+
}, /*#__PURE__*/React.createElement(PCLinkEditorPopover, {
|
|
243
235
|
popoverPosition: popoverPosition,
|
|
244
236
|
options: options,
|
|
245
237
|
selectedOptions: selectedOptions,
|
|
246
238
|
onOptionItemToggle: this.onOptionItemToggle
|
|
247
|
-
})), /*#__PURE__*/
|
|
239
|
+
})), /*#__PURE__*/React.createElement(MediaQuery, {
|
|
248
240
|
query: "(max-width: 767.8px)"
|
|
249
|
-
}, /*#__PURE__*/
|
|
241
|
+
}, /*#__PURE__*/React.createElement(MBLinkEditorPopover, {
|
|
250
242
|
isReadOnly: this.props.isReadOnly,
|
|
251
243
|
value: this.state.newValue,
|
|
252
244
|
column: this.props.column,
|
|
@@ -259,4 +251,4 @@ class LinkEditor extends _react.default.Component {
|
|
|
259
251
|
LinkEditor.defaultProps = {
|
|
260
252
|
isReadOnly: false
|
|
261
253
|
};
|
|
262
|
-
|
|
254
|
+
export default LinkEditor;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
class LinkEditorOption extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
class LinkEditorOption extends React.Component {
|
|
10
3
|
constructor() {
|
|
11
4
|
super(...arguments);
|
|
12
5
|
this.onDeleteOption = event => {
|
|
@@ -61,21 +54,21 @@ class LinkEditorOption extends _react.default.Component {
|
|
|
61
54
|
let optionStyle = this.getOptionStyle();
|
|
62
55
|
let optionNameStyle = this.getOptionNameStyle();
|
|
63
56
|
let operationStyle = this.getOperationStyle();
|
|
64
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
65
58
|
className: "dtable-ui link-option-item",
|
|
66
59
|
style: containerStyle
|
|
67
|
-
}, /*#__PURE__*/
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
68
61
|
className: "option-info",
|
|
69
62
|
style: optionStyle
|
|
70
|
-
}, /*#__PURE__*/
|
|
63
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
71
64
|
className: "option-name",
|
|
72
65
|
style: optionNameStyle,
|
|
73
66
|
title: option.name
|
|
74
|
-
}, option.name)), isShowRemoveIcon && /*#__PURE__*/
|
|
67
|
+
}, option.name)), isShowRemoveIcon && /*#__PURE__*/React.createElement("div", {
|
|
75
68
|
className: "option-remove",
|
|
76
69
|
style: operationStyle,
|
|
77
70
|
onClick: this.onDeleteOption
|
|
78
|
-
}, /*#__PURE__*/
|
|
71
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
79
72
|
className: "dtable-font dtable-icon-fork-number",
|
|
80
73
|
style: {
|
|
81
74
|
fontSize: '12px',
|
|
@@ -87,4 +80,4 @@ class LinkEditorOption extends _react.default.Component {
|
|
|
87
80
|
LinkEditorOption.defaultProps = {
|
|
88
81
|
isShowRemoveIcon: false
|
|
89
82
|
};
|
|
90
|
-
|
|
83
|
+
export default LinkEditorOption;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _lang = require("../../lang");
|
|
10
|
-
var _MBEditorHeader = _interopRequireDefault(require("../../MBEditorHeader"));
|
|
11
|
-
require("./index.css");
|
|
12
|
-
class MBLinkEditorPopover extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getLocale } from '../../lang';
|
|
3
|
+
import MBEditorHeader from '../../MBEditorHeader';
|
|
4
|
+
import './index.css';
|
|
5
|
+
class MBLinkEditorPopover extends React.Component {
|
|
13
6
|
constructor(props) {
|
|
14
7
|
super(props);
|
|
15
8
|
this.handleHistaryBack = e => {
|
|
@@ -68,16 +61,16 @@ class MBLinkEditorPopover extends _react.default.Component {
|
|
|
68
61
|
} = this.props;
|
|
69
62
|
return options.map((option, index) => {
|
|
70
63
|
let isSelect = value.some(item => item === option.id);
|
|
71
|
-
return /*#__PURE__*/
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
72
65
|
className: "mb-link-option-item",
|
|
73
66
|
key: index,
|
|
74
67
|
onMouseDown: this.onSelectOption.bind(this, option)
|
|
75
|
-
}, /*#__PURE__*/
|
|
68
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
76
69
|
className: "mb-option-info"
|
|
77
|
-
}, /*#__PURE__*/
|
|
70
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
78
71
|
className: "option-name",
|
|
79
72
|
title: option.name
|
|
80
|
-
}, option.name)), isSelect && /*#__PURE__*/
|
|
73
|
+
}, option.name)), isSelect && /*#__PURE__*/React.createElement("i", {
|
|
81
74
|
className: "mb-option-checked dtable-font dtable-icon-check-mark"
|
|
82
75
|
}));
|
|
83
76
|
});
|
|
@@ -104,42 +97,42 @@ class MBLinkEditorPopover extends _react.default.Component {
|
|
|
104
97
|
searchVal
|
|
105
98
|
} = this.state;
|
|
106
99
|
let filterOptions = this.getFilterOptions();
|
|
107
|
-
return /*#__PURE__*/
|
|
100
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
108
101
|
ref: this.setEditorPopover,
|
|
109
102
|
className: "dtable-ui-mb-editor-popover mb-link-editor-popover",
|
|
110
103
|
onClick: this.onContainerClick
|
|
111
|
-
}, /*#__PURE__*/
|
|
104
|
+
}, /*#__PURE__*/React.createElement(MBEditorHeader, {
|
|
112
105
|
title: column.name,
|
|
113
|
-
leftContent: /*#__PURE__*/
|
|
106
|
+
leftContent: /*#__PURE__*/React.createElement("i", {
|
|
114
107
|
className: "dtable-font dtable-icon-return"
|
|
115
108
|
}),
|
|
116
|
-
rightContent: /*#__PURE__*/
|
|
109
|
+
rightContent: /*#__PURE__*/React.createElement("span", null, getLocale('Done')),
|
|
117
110
|
onLeftClick: this.props.onClosePopover,
|
|
118
111
|
onRightClick: this.props.onClosePopover
|
|
119
|
-
}), /*#__PURE__*/
|
|
112
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
120
113
|
className: "dtable-ui-mb-editor-body dtable-ui-mb-link-editor-body"
|
|
121
|
-
}, /*#__PURE__*/
|
|
114
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
122
115
|
className: "mb-search-link-items"
|
|
123
|
-
}, /*#__PURE__*/
|
|
116
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
124
117
|
className: "form-control",
|
|
125
118
|
type: "text",
|
|
126
|
-
placeholder:
|
|
119
|
+
placeholder: getLocale('Find_an_option'),
|
|
127
120
|
value: searchVal,
|
|
128
121
|
onChange: this.onChangeSearch,
|
|
129
122
|
onClick: this.onInputClick
|
|
130
|
-
})), /*#__PURE__*/
|
|
123
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
131
124
|
className: "mb-link-container"
|
|
132
|
-
}, /*#__PURE__*/
|
|
125
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
133
126
|
className: "title"
|
|
134
|
-
},
|
|
127
|
+
}, getLocale('Choose_an_option')), /*#__PURE__*/React.createElement("div", {
|
|
135
128
|
className: "content"
|
|
136
|
-
}, filterOptions.length === 0 && /*#__PURE__*/
|
|
129
|
+
}, filterOptions.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
137
130
|
className: "search-result-none"
|
|
138
|
-
},
|
|
131
|
+
}, getLocale('No_options_available')), filterOptions.length > 0 && this.renderFilteredOptions(filterOptions)))));
|
|
139
132
|
}
|
|
140
133
|
}
|
|
141
134
|
MBLinkEditorPopover.defaultProps = {
|
|
142
135
|
isReadOnly: false,
|
|
143
136
|
value: []
|
|
144
137
|
};
|
|
145
|
-
|
|
138
|
+
export default MBLinkEditorPopover;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _lang = require("../../lang");
|
|
10
|
-
require("./index.css");
|
|
11
|
-
class PCLinkEditorPopover extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getLocale } from '../../lang';
|
|
3
|
+
import './index.css';
|
|
4
|
+
class PCLinkEditorPopover extends React.Component {
|
|
12
5
|
constructor(props) {
|
|
13
6
|
super(props);
|
|
14
7
|
this.onValueChanged = event => {
|
|
@@ -54,44 +47,44 @@ class PCLinkEditorPopover extends _react.default.Component {
|
|
|
54
47
|
}, {
|
|
55
48
|
position: 'absolute'
|
|
56
49
|
});
|
|
57
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
58
51
|
className: "dtable-ui-editor-popover dtable-ui-link-editor-popover",
|
|
59
52
|
style: popoverStyle
|
|
60
|
-
}, /*#__PURE__*/
|
|
53
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
61
54
|
className: "link-options-search"
|
|
62
|
-
}, /*#__PURE__*/
|
|
55
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
63
56
|
className: "form-control",
|
|
64
57
|
value: searchValue,
|
|
65
58
|
onChange: this.onValueChanged,
|
|
66
59
|
onClick: this.onInputClick,
|
|
67
|
-
placeholder:
|
|
68
|
-
})), /*#__PURE__*/
|
|
60
|
+
placeholder: getLocale('Find_an_option')
|
|
61
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
69
62
|
className: "link-options-container"
|
|
70
63
|
}, options.length > 0 && options.map((option, index) => {
|
|
71
64
|
let isSelect = selectedOptions.some(selectedOption => {
|
|
72
65
|
return selectedOption.id === option.id;
|
|
73
66
|
});
|
|
74
|
-
return /*#__PURE__*/
|
|
67
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
75
68
|
key: index,
|
|
76
69
|
className: "link-option-item",
|
|
77
70
|
onClick: this.onOptionItemToggle.bind(this, option)
|
|
78
|
-
}, /*#__PURE__*/
|
|
71
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
79
72
|
className: "option-info"
|
|
80
|
-
}, /*#__PURE__*/
|
|
73
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
81
74
|
className: "option-name",
|
|
82
75
|
title: option.name
|
|
83
|
-
}, option.name)), /*#__PURE__*/
|
|
76
|
+
}, option.name)), /*#__PURE__*/React.createElement("div", {
|
|
84
77
|
className: "option-checked"
|
|
85
|
-
}, isSelect && /*#__PURE__*/
|
|
78
|
+
}, isSelect && /*#__PURE__*/React.createElement("i", {
|
|
86
79
|
className: "dtable-font dtable-icon-check-mark"
|
|
87
80
|
})));
|
|
88
|
-
}), options.length === 0 && /*#__PURE__*/
|
|
81
|
+
}), options.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
89
82
|
className: "link-option-null"
|
|
90
|
-
},
|
|
83
|
+
}, getLocale('No_options_available'))));
|
|
91
84
|
}
|
|
92
85
|
}
|
|
93
86
|
PCLinkEditorPopover.defaultProps = {
|
|
94
87
|
popoverPosition: {},
|
|
95
88
|
options: []
|
|
96
89
|
};
|
|
97
|
-
|
|
90
|
+
export default PCLinkEditorPopover;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _dtableUtils = require("dtable-utils");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { CellType, getNumberDisplayString, getDateDisplayString } from 'dtable-utils';
|
|
11
4
|
// link value is get form parant's interface
|
|
12
|
-
class LinkFormatter extends
|
|
5
|
+
class LinkFormatter extends React.Component {
|
|
13
6
|
constructor(props) {
|
|
14
7
|
super(props);
|
|
15
8
|
this.getLinkedCellValue = row => {
|
|
@@ -54,11 +47,11 @@ class LinkFormatter extends _react.default.Component {
|
|
|
54
47
|
display_column_key: displayColumnKey
|
|
55
48
|
} = column.data;
|
|
56
49
|
let displayValue = this.getDisplayValue(linkedTable, row, displayColumnKey);
|
|
57
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
58
51
|
key: index,
|
|
59
52
|
className: "link-item",
|
|
60
53
|
onClick: this.expandLinkedTableRow.bind(this, row)
|
|
61
|
-
}, /*#__PURE__*/
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
62
55
|
className: "link-name",
|
|
63
56
|
title: displayValue
|
|
64
57
|
}, displayValue));
|
|
@@ -76,16 +69,16 @@ class LinkFormatter extends _react.default.Component {
|
|
|
76
69
|
} = linkedColumn;
|
|
77
70
|
// todo: improve
|
|
78
71
|
switch (type) {
|
|
79
|
-
case
|
|
72
|
+
case CellType.NUMBER:
|
|
80
73
|
{
|
|
81
|
-
return
|
|
74
|
+
return getNumberDisplayString(value, data);
|
|
82
75
|
}
|
|
83
|
-
case
|
|
76
|
+
case CellType.DATE:
|
|
84
77
|
{
|
|
85
78
|
let {
|
|
86
79
|
format
|
|
87
80
|
} = data;
|
|
88
|
-
return
|
|
81
|
+
return getDateDisplayString(value, format);
|
|
89
82
|
}
|
|
90
83
|
default:
|
|
91
84
|
return value;
|
|
@@ -112,9 +105,9 @@ class LinkFormatter extends _react.default.Component {
|
|
|
112
105
|
const {
|
|
113
106
|
containerClassName
|
|
114
107
|
} = this.props;
|
|
115
|
-
const classname = (
|
|
108
|
+
const classname = classnames('dtable-ui cell-formatter-container link-formatter', containerClassName);
|
|
116
109
|
let displayValues = this.getDisplayValues();
|
|
117
|
-
return /*#__PURE__*/
|
|
110
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
118
111
|
className: classname
|
|
119
112
|
}, displayValues);
|
|
120
113
|
}
|
|
@@ -126,4 +119,4 @@ LinkFormatter.defaultProps = {
|
|
|
126
119
|
column: {},
|
|
127
120
|
row: {}
|
|
128
121
|
};
|
|
129
|
-
|
|
122
|
+
export default LinkFormatter;
|
package/lib/Loading/index.js
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = Loading;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
require("./index.css");
|
|
10
|
-
function Loading() {
|
|
11
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
export default function Loading() {
|
|
4
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
12
5
|
className: "loading-icon loading-tip"
|
|
13
6
|
});
|
|
14
7
|
}
|