dtable-ui-component 0.1.75-beta1 → 0.1.75-beta5
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.css +1 -0
- package/{es/components/cell-formatter/auto-number-formatter.js → lib/AutoNumberFormatter/index.js} +1 -0
- package/lib/ButtonFormatter/index.css +13 -0
- package/{es/components/cell-formatter/button-formatter.js → lib/ButtonFormatter/index.js} +1 -0
- package/lib/CTimeFormatter/index.css +1 -0
- package/{es/components/cell-formatter/ctime-formatter.js → lib/CTimeFormatter/index.js} +1 -0
- package/lib/CheckboxFormatter/index.css +1 -0
- package/{es/components/cell-formatter/checkbox-formatter.js → lib/CheckboxFormatter/index.js} +1 -0
- package/lib/CollaboratorFormatter/index.css +1 -0
- package/{es/components/cell-formatter/collaborator-formatter.js → lib/CollaboratorFormatter/index.js} +3 -2
- package/lib/CollaboratorItem/index.css +49 -0
- package/{es/components/common/collaborator-item.js → lib/CollaboratorItem/index.js} +1 -0
- package/lib/CreatorFormatter/index.css +1 -0
- package/{es/components/cell-formatter/creator-formatter.js → lib/CreatorFormatter/index.js} +3 -2
- package/lib/DateFormatter/index.css +1 -0
- package/{es/components/cell-formatter/date-formatter.js → lib/DateFormatter/index.js} +2 -1
- package/lib/DurationFormatter/index.css +1 -0
- package/{es/components/cell-formatter/duration-formatter.js → lib/DurationFormatter/index.js} +2 -1
- package/lib/EmailFormatter/index.css +5 -0
- package/{es/components/cell-formatter/email-formatter.js → lib/EmailFormatter/index.js} +1 -0
- package/lib/FileFormatter/index.css +29 -0
- package/{es/components/cell-formatter/file-formatter.js → lib/FileFormatter/index.js} +2 -1
- package/{es/components/cell-formatter/widgets/file-item-formatter.js → lib/FileItemFormatter/index.js} +3 -2
- package/{es/components/file-uploader → lib/FileUploader}/index.js +0 -0
- package/lib/FormulaFormatter/index.css +19 -0
- package/{es/components/cell-formatter/formula-formatter.js → lib/FormulaFormatter/index.js} +8 -8
- package/lib/GeolocationFormatter/index.css +1 -0
- package/{es/components/cell-formatter/geolocation-formatter.js → lib/GeolocationFormatter/index.js} +2 -1
- package/{es/components/common → lib/ImageFormatter}/images-lazy-load.js +2 -2
- package/lib/ImageFormatter/index.css +34 -0
- package/{es/components/cell-formatter/image-formatter.js → lib/ImageFormatter/index.js} +4 -3
- package/{es/css/image-previewer-ligntbox.css → lib/ImagePreviewerLightbox/index.css} +0 -0
- package/{es/components/cell-formatter/widgets/image-previewer-lightbox.js → lib/ImagePreviewerLightbox/index.js} +3 -3
- package/lib/LastModifierFormatter/index.css +1 -0
- package/{es/components/cell-formatter/last-modifier-formatter.js → lib/LastModifierFormatter/index.js} +5 -4
- package/lib/LinkFormatter/index.css +27 -0
- package/{es/components/cell-formatter/link-formatter.js → lib/LinkFormatter/index.js} +2 -2
- package/{es/css/loading.css → lib/Loading/index.css} +0 -0
- package/{es/components/loading.js → lib/Loading/index.js} +1 -1
- package/{es/components/cell-formatter/widgets/long-text-formatter → lib/LongTextFormatter}/html-long-text-formatter.js +1 -1
- package/lib/LongTextFormatter/index.css +63 -0
- package/{es/components/cell-formatter/long-text-formatter.js → lib/LongTextFormatter/index.js} +3 -2
- package/{es/components/cell-formatter/widgets/long-text-formatter → lib/LongTextFormatter}/simple-long-text-formatter.js +1 -1
- package/lib/MTimeFormatter/index.css +1 -0
- package/{es/components/cell-formatter/mtime-formatter.js → lib/MTimeFormatter/index.js} +1 -0
- package/{es/components/common/modal-portal.js → lib/ModalPortal/index.js} +0 -0
- package/lib/MultipleSelectFormatter/index.css +1 -0
- package/{es/components/cell-formatter/multiple-select-formatter.js → lib/MultipleSelectFormatter/index.js} +2 -1
- package/lib/NumberFormatter/index.css +1 -0
- package/{es/components/cell-formatter/number-formatter.js → lib/NumberFormatter/index.js} +2 -1
- package/lib/RateFormatter/index.css +1 -0
- package/{es/components/cell-formatter/rate-formatter.js → lib/RateFormatter/index.js} +1 -0
- package/{es/components/common/select-item.js → lib/SelectItem/index.js} +0 -0
- package/lib/SingleSelectFormatter/index.css +1 -0
- package/{es/components/cell-formatter/single-select-formatter.js → lib/SingleSelectFormatter/index.js} +2 -1
- package/lib/TextFormatter/index.css +1 -0
- package/{es/components/cell-formatter/text-formatter.js → lib/TextFormatter/index.js} +1 -0
- package/lib/UrlFormatter/index.css +5 -0
- package/{es/components/cell-formatter/url-formatter.js → lib/UrlFormatter/index.js} +1 -0
- package/lib/app.js +75 -80
- package/{es/components/cell-factory/cell-formatter-factory.js → lib/cellFormatterFactory/index.js} +3 -3
- package/lib/components/cell-editor/checkbox-editor.js +59 -66
- package/lib/components/cell-editor/collaborator-editor.js +113 -126
- package/lib/components/cell-editor/date-editor.js +99 -119
- package/lib/components/cell-editor/index.js +9 -40
- package/lib/components/cell-editor/link-editor.js +122 -140
- package/lib/components/cell-editor/multiple-select-editor.js +114 -127
- package/lib/components/cell-editor/number-editor.js +78 -86
- package/lib/components/cell-editor/single-select-editor.js +106 -120
- package/lib/components/cell-editor/text-editor.js +65 -72
- package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +31 -51
- package/lib/components/cell-editor-dialog/pc-files-addition/index.js +0 -1
- package/lib/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -1
- package/lib/components/cell-editor-dialog/pc-files-preview/index.js +0 -1
- package/lib/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -1
- package/lib/components/cell-editor-popover/mb-collaborator-editor-popover.js +105 -111
- package/lib/components/cell-editor-popover/mb-date-editor-popover.js +140 -157
- package/lib/components/cell-editor-popover/mb-link-editor-popover.js +103 -109
- package/lib/components/cell-editor-popover/mb-select-editor-popover.js +142 -155
- package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +74 -89
- package/lib/components/cell-editor-popover/pc-date-editor-popover.js +88 -102
- package/lib/components/cell-editor-popover/pc-link-editor-popover.js +77 -91
- package/lib/components/cell-editor-popover/pc-select-editor-popover.js +91 -105
- package/lib/components/common/collaborator-item.js +43 -59
- package/lib/components/common/edit-editor-button.js +28 -39
- package/lib/components/common/link-editor-option.js +63 -71
- package/lib/components/common/mobile/mb-editor-header.js +39 -52
- package/lib/components/common/select-editor-option.js +58 -74
- package/lib/constants/cell-types.js +25 -54
- package/lib/constants/index.js +5 -26
- package/lib/css/cell-formatter.css +0 -243
- package/lib/formatterConfig/index.js +31 -0
- package/lib/index.js +31 -64
- package/lib/lang/index.js +11 -27
- package/lib/locals/de.js +1 -6
- package/lib/locals/en.js +1 -6
- package/lib/locals/fr.js +1 -6
- package/lib/locals/zh-CN.js +1 -6
- package/{es/components/toast → lib/toaster}/alert.js +0 -0
- package/{es/components/toast → lib/toaster}/index.js +0 -0
- package/{es/components/toast → lib/toaster}/toast.js +0 -0
- package/{es/components/toast → lib/toaster}/toastManager.js +0 -0
- package/{es/components/toast → lib/toaster}/toaster.js +0 -0
- package/lib/utils/cell-value-validator.js +4 -14
- package/lib/utils/column-utils.js +5 -13
- package/lib/utils/editor-utils.js +3 -13
- package/lib/utils/markdown2html.js +1 -7
- package/lib/utils/normalize-long-text-value.js +1 -6
- package/lib/utils/number-precision.js +14 -31
- package/lib/utils/utils.js +8 -33
- package/lib/utils/value-format-utils.js +60 -108
- package/package.json +5 -5
- package/es/app.css +0 -20
- package/es/app.js +0 -91
- package/es/assets/images/avatar/default_avatar.png +0 -0
- package/es/assets/images/file/192/excel.png +0 -0
- package/es/assets/images/file/192/file.png +0 -0
- package/es/assets/images/file/192/music.png +0 -0
- package/es/assets/images/file/192/pdf.png +0 -0
- package/es/assets/images/file/192/pic.png +0 -0
- package/es/assets/images/file/192/ppt.png +0 -0
- package/es/assets/images/file/192/txt.png +0 -0
- package/es/assets/images/file/192/video.png +0 -0
- package/es/assets/images/file/192/word.png +0 -0
- package/es/assets/images/file/24/excel.png +0 -0
- package/es/assets/images/file/24/file.png +0 -0
- package/es/assets/images/file/24/music.png +0 -0
- package/es/assets/images/file/24/pdf.png +0 -0
- package/es/assets/images/file/24/pic.png +0 -0
- package/es/assets/images/file/24/ppt.png +0 -0
- package/es/assets/images/file/24/txt.png +0 -0
- package/es/assets/images/file/24/video.png +0 -0
- package/es/assets/images/file/24/word.png +0 -0
- package/es/assets/images/folder/folder-192.png +0 -0
- package/es/assets/images/folder/folder-24.png +0 -0
- package/es/components/cell-editor/checkbox-editor.js +0 -104
- package/es/components/cell-editor/collaborator-editor.js +0 -236
- package/es/components/cell-editor/date-editor.js +0 -151
- package/es/components/cell-editor/index.js +0 -9
- package/es/components/cell-editor/link-editor.js +0 -303
- package/es/components/cell-editor/multiple-select-editor.js +0 -237
- package/es/components/cell-editor/number-editor.js +0 -154
- package/es/components/cell-editor/single-select-editor.js +0 -202
- package/es/components/cell-editor/text-editor.js +0 -122
- package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +0 -46
- package/es/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
- package/es/components/cell-editor-popover/mb-collaborator-editor-popover.js +0 -177
- package/es/components/cell-editor-popover/mb-date-editor-popover.js +0 -245
- package/es/components/cell-editor-popover/mb-link-editor-popover.js +0 -170
- package/es/components/cell-editor-popover/mb-select-editor-popover.js +0 -230
- package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +0 -109
- package/es/components/cell-editor-popover/pc-date-editor-popover.js +0 -142
- package/es/components/cell-editor-popover/pc-link-editor-popover.js +0 -114
- package/es/components/cell-editor-popover/pc-select-editor-popover.js +0 -143
- package/es/components/cell-formatter/formatter-config.js +0 -31
- package/es/components/cell-formatter/index.js +0 -27
- package/es/components/common/edit-editor-button.js +0 -56
- package/es/components/common/link-editor-option.js +0 -113
- package/es/components/common/mobile/mb-editor-header.js +0 -48
- package/es/components/common/select-editor-option.js +0 -106
- package/es/constants/cell-types.js +0 -25
- package/es/constants/index.js +0 -48
- package/es/css/cell-editor.css +0 -614
- package/es/css/cell-formatter.css +0 -247
- package/es/css/custom-rc-calendar.css +0 -118
- package/es/index.js +0 -6
- package/es/lang/index.js +0 -50
- package/es/locals/de.js +0 -2
- package/es/locals/en.js +0 -17
- package/es/locals/fr.js +0 -2
- package/es/locals/zh-CN.js +0 -17
- package/es/utils/cell-value-validator.js +0 -32
- package/es/utils/column-utils.js +0 -7
- package/es/utils/editor-utils.js +0 -71
- package/es/utils/markdown2html.js +0 -62
- package/es/utils/normalize-long-text-value.js +0 -69
- package/es/utils/number-precision.js +0 -163
- package/es/utils/unified/index.js +0 -470
- package/es/utils/utils.js +0 -116
- package/es/utils/value-format-utils.js +0 -495
- package/es/utils/vfile/core.js +0 -172
- package/es/utils/vfile/index.js +0 -48
- package/lib/components/cell-factory/cell-formatter-factory.js +0 -28
- package/lib/components/cell-formatter/auto-number-formatter.js +0 -45
- package/lib/components/cell-formatter/button-formatter.js +0 -66
- package/lib/components/cell-formatter/checkbox-formatter.js +0 -56
- package/lib/components/cell-formatter/collaborator-formatter.js +0 -111
- package/lib/components/cell-formatter/creator-formatter.js +0 -105
- package/lib/components/cell-formatter/ctime-formatter.js +0 -70
- package/lib/components/cell-formatter/date-formatter.js +0 -73
- package/lib/components/cell-formatter/duration-formatter.js +0 -49
- package/lib/components/cell-formatter/email-formatter.js +0 -45
- package/lib/components/cell-formatter/file-formatter.js +0 -77
- package/lib/components/cell-formatter/formatter-config.js +0 -66
- package/lib/components/cell-formatter/formula-formatter.js +0 -189
- package/lib/components/cell-formatter/geolocation-formatter.js +0 -66
- package/lib/components/cell-formatter/image-formatter.js +0 -171
- package/lib/components/cell-formatter/index.js +0 -112
- package/lib/components/cell-formatter/last-modifier-formatter.js +0 -105
- package/lib/components/cell-formatter/link-formatter.js +0 -165
- package/lib/components/cell-formatter/long-text-formatter.js +0 -46
- package/lib/components/cell-formatter/mtime-formatter.js +0 -70
- package/lib/components/cell-formatter/multiple-select-formatter.js +0 -84
- package/lib/components/cell-formatter/number-formatter.js +0 -60
- package/lib/components/cell-formatter/rate-formatter.js +0 -93
- package/lib/components/cell-formatter/single-select-formatter.js +0 -84
- package/lib/components/cell-formatter/text-formatter.js +0 -67
- package/lib/components/cell-formatter/url-formatter.js +0 -45
- package/lib/components/cell-formatter/widgets/file-item-formatter.js +0 -63
- package/lib/components/cell-formatter/widgets/image-previewer-lightbox.js +0 -152
- package/lib/components/cell-formatter/widgets/long-text-formatter/html-long-text-formatter.js +0 -107
- package/lib/components/cell-formatter/widgets/long-text-formatter/simple-long-text-formatter.js +0 -110
- package/lib/components/common/images-lazy-load.js +0 -158
- package/lib/components/common/modal-portal.js +0 -51
- package/lib/components/common/select-item.js +0 -73
- package/lib/components/file-uploader/index.js +0 -63
- package/lib/components/loading.js +0 -16
- package/lib/components/toast/alert.js +0 -164
- package/lib/components/toast/index.js +0 -12
- package/lib/components/toast/toast.js +0 -223
- package/lib/components/toast/toastManager.js +0 -189
- package/lib/components/toast/toaster.js +0 -92
- package/lib/css/image-previewer-ligntbox.css +0 -87
- package/lib/css/loading.css +0 -54
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
9
|
-
|
|
10
|
-
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
|
-
var _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
19
|
-
|
|
20
|
-
var _imagesLazyLoad = _interopRequireDefault(require("../common/images-lazy-load"));
|
|
21
|
-
|
|
22
|
-
var _utils = require("../../utils/utils");
|
|
23
|
-
|
|
24
|
-
var _imagePreviewerLightbox = _interopRequireDefault(require("./widgets/image-previewer-lightbox"));
|
|
25
|
-
|
|
26
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
|
|
28
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
30
|
-
var ImageFormatter = /*#__PURE__*/function (_React$Component) {
|
|
31
|
-
(0, _inheritsLoose2.default)(ImageFormatter, _React$Component);
|
|
32
|
-
|
|
33
|
-
function ImageFormatter(props) {
|
|
34
|
-
var _this;
|
|
35
|
-
|
|
36
|
-
_this = _React$Component.call(this, props) || this;
|
|
37
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onImageClick", function (index) {
|
|
38
|
-
if (!_this.props.isSupportPreview) return;
|
|
39
|
-
|
|
40
|
-
_this.setState({
|
|
41
|
-
isPreviewImage: true,
|
|
42
|
-
previewImageIndex: index
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "closeImagePopup", function () {
|
|
46
|
-
if (!_this.props.isSupportPreview) return;
|
|
47
|
-
|
|
48
|
-
_this.setState({
|
|
49
|
-
isPreviewImage: false,
|
|
50
|
-
previewImageIndex: -1
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "movePrev", function () {
|
|
54
|
-
var images = _this.props.value;
|
|
55
|
-
|
|
56
|
-
_this.setState(function (prevState) {
|
|
57
|
-
return {
|
|
58
|
-
previewImageIndex: (prevState.previewImageIndex + images.length - 1) % images.length
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "moveNext", function () {
|
|
63
|
-
var images = _this.props.value;
|
|
64
|
-
|
|
65
|
-
_this.setState(function (prevState) {
|
|
66
|
-
return {
|
|
67
|
-
previewImageIndex: (prevState.previewImageIndex + 1) % images.length
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "downloadImage", function (imageItemUrl) {
|
|
72
|
-
if (!_this.props.downloadImage) return;
|
|
73
|
-
|
|
74
|
-
_this.props.downloadImage(imageItemUrl);
|
|
75
|
-
});
|
|
76
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "deleteImage", function (index) {
|
|
77
|
-
var readOnly = _this.props.readOnly;
|
|
78
|
-
if (readOnly) return;
|
|
79
|
-
if (!_this.props.deleteImage) return;
|
|
80
|
-
|
|
81
|
-
_this.props.deleteImage(index);
|
|
82
|
-
});
|
|
83
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onRotateImage", function (index, degree) {
|
|
84
|
-
var readOnly = _this.props.readOnly;
|
|
85
|
-
if (readOnly) return;
|
|
86
|
-
if (!_this.props.rotateImage) return;
|
|
87
|
-
|
|
88
|
-
_this.props.rotateImage(index, degree);
|
|
89
|
-
});
|
|
90
|
-
_this.state = {
|
|
91
|
-
isPreviewImage: false,
|
|
92
|
-
previewImageIndex: -1
|
|
93
|
-
};
|
|
94
|
-
return _this;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
var _proto = ImageFormatter.prototype;
|
|
98
|
-
|
|
99
|
-
_proto.render = function render() {
|
|
100
|
-
var _this$props = this.props,
|
|
101
|
-
isSample = _this$props.isSample,
|
|
102
|
-
value = _this$props.value,
|
|
103
|
-
server = _this$props.server,
|
|
104
|
-
containerClassName = _this$props.containerClassName,
|
|
105
|
-
readOnly = _this$props.readOnly;
|
|
106
|
-
var className = (0, _astroClassname.default)('dtable-ui cell-formatter-container image-formatter', containerClassName);
|
|
107
|
-
var _this$state = this.state,
|
|
108
|
-
isPreviewImage = _this$state.isPreviewImage,
|
|
109
|
-
previewImageIndex = _this$state.previewImageIndex;
|
|
110
|
-
|
|
111
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (isSample) {
|
|
116
|
-
var item = value[0];
|
|
117
|
-
var url = (0, _utils.getImageThumbnailUrl)(item, server);
|
|
118
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
119
|
-
className: className
|
|
120
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
121
|
-
className: "image-item",
|
|
122
|
-
src: url,
|
|
123
|
-
alt: ""
|
|
124
|
-
}), value.length !== 1 && /*#__PURE__*/_react.default.createElement("span", {
|
|
125
|
-
className: "image-item-count"
|
|
126
|
-
}, "+" + value.length));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
-
className: className
|
|
131
|
-
}, /*#__PURE__*/_react.default.createElement(_imagesLazyLoad.default, {
|
|
132
|
-
images: value,
|
|
133
|
-
server: server,
|
|
134
|
-
onImageClick: this.onImageClick
|
|
135
|
-
})), isPreviewImage && /*#__PURE__*/_react.default.createElement(_imagePreviewerLightbox.default, {
|
|
136
|
-
imageItems: value,
|
|
137
|
-
imageIndex: previewImageIndex,
|
|
138
|
-
closeImagePopup: this.closeImagePopup,
|
|
139
|
-
moveToPrevImage: this.movePrev,
|
|
140
|
-
moveToNextImage: this.moveNext,
|
|
141
|
-
deleteImage: readOnly ? null : this.deleteImage,
|
|
142
|
-
downloadImage: this.downloadImage,
|
|
143
|
-
onRotateImage: readOnly ? null : this.onRotateImage,
|
|
144
|
-
readOnly: readOnly
|
|
145
|
-
}));
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
return ImageFormatter;
|
|
149
|
-
}(_react.default.Component);
|
|
150
|
-
|
|
151
|
-
(0, _defineProperty2.default)(ImageFormatter, "defaultProps", {
|
|
152
|
-
isSample: false,
|
|
153
|
-
isSupportPreview: false,
|
|
154
|
-
readOnly: true,
|
|
155
|
-
value: [],
|
|
156
|
-
server: '',
|
|
157
|
-
containerClassName: ''
|
|
158
|
-
});
|
|
159
|
-
ImageFormatter.propTypes = {
|
|
160
|
-
isSample: _propTypes.default.bool,
|
|
161
|
-
readOnly: _propTypes.default.bool,
|
|
162
|
-
isSupportPreview: _propTypes.default.bool,
|
|
163
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]),
|
|
164
|
-
server: _propTypes.default.string,
|
|
165
|
-
containerClassName: _propTypes.default.string,
|
|
166
|
-
deleteImage: _propTypes.default.func,
|
|
167
|
-
downloadImage: _propTypes.default.func,
|
|
168
|
-
rotateImage: _propTypes.default.func
|
|
169
|
-
};
|
|
170
|
-
var _default = ImageFormatter;
|
|
171
|
-
exports.default = _default;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.UrlFormatter = exports.TextFormatter = exports.SingleSelectFormatter = exports.RateFormatter = exports.NumberFormatter = exports.MultipleSelectFormatter = exports.MTimeFormatter = exports.LongTextFormatter = exports.LinkFormatter = exports.LastModifierFormatter = exports.ImagePreviewerLightbox = exports.ImageFormatter = exports.GeolocationFormatter = exports.FormulaFormatter = exports.FileItemFormatter = exports.FileFormatter = exports.EmailFormatter = exports.DurationFormatter = exports.DateFormatter = exports.CreatorFormatter = exports.CollaboratorItem = exports.CollaboratorFormatter = exports.CheckboxFormatter = exports.CTimeFormatter = exports.ButtonFormatter = exports.AutoNumberFormatter = void 0;
|
|
7
|
-
|
|
8
|
-
require("../../css/cell-formatter.css");
|
|
9
|
-
|
|
10
|
-
var _textFormatter = _interopRequireDefault(require("./text-formatter"));
|
|
11
|
-
|
|
12
|
-
exports.TextFormatter = _textFormatter.default;
|
|
13
|
-
|
|
14
|
-
var _numberFormatter = _interopRequireDefault(require("./number-formatter"));
|
|
15
|
-
|
|
16
|
-
exports.NumberFormatter = _numberFormatter.default;
|
|
17
|
-
|
|
18
|
-
var _dateFormatter = _interopRequireDefault(require("./date-formatter"));
|
|
19
|
-
|
|
20
|
-
exports.DateFormatter = _dateFormatter.default;
|
|
21
|
-
|
|
22
|
-
var _checkboxFormatter = _interopRequireDefault(require("./checkbox-formatter"));
|
|
23
|
-
|
|
24
|
-
exports.CheckboxFormatter = _checkboxFormatter.default;
|
|
25
|
-
|
|
26
|
-
var _collaboratorFormatter = _interopRequireDefault(require("./collaborator-formatter"));
|
|
27
|
-
|
|
28
|
-
exports.CollaboratorFormatter = _collaboratorFormatter.default;
|
|
29
|
-
|
|
30
|
-
var _singleSelectFormatter = _interopRequireDefault(require("./single-select-formatter"));
|
|
31
|
-
|
|
32
|
-
exports.SingleSelectFormatter = _singleSelectFormatter.default;
|
|
33
|
-
|
|
34
|
-
var _multipleSelectFormatter = _interopRequireDefault(require("./multiple-select-formatter"));
|
|
35
|
-
|
|
36
|
-
exports.MultipleSelectFormatter = _multipleSelectFormatter.default;
|
|
37
|
-
|
|
38
|
-
var _longTextFormatter = _interopRequireDefault(require("./long-text-formatter"));
|
|
39
|
-
|
|
40
|
-
exports.LongTextFormatter = _longTextFormatter.default;
|
|
41
|
-
|
|
42
|
-
var _fileFormatter = _interopRequireDefault(require("./file-formatter"));
|
|
43
|
-
|
|
44
|
-
exports.FileFormatter = _fileFormatter.default;
|
|
45
|
-
|
|
46
|
-
var _imageFormatter = _interopRequireDefault(require("./image-formatter"));
|
|
47
|
-
|
|
48
|
-
exports.ImageFormatter = _imageFormatter.default;
|
|
49
|
-
|
|
50
|
-
var _geolocationFormatter = _interopRequireDefault(require("./geolocation-formatter"));
|
|
51
|
-
|
|
52
|
-
exports.GeolocationFormatter = _geolocationFormatter.default;
|
|
53
|
-
|
|
54
|
-
var _ctimeFormatter = _interopRequireDefault(require("./ctime-formatter"));
|
|
55
|
-
|
|
56
|
-
exports.CTimeFormatter = _ctimeFormatter.default;
|
|
57
|
-
|
|
58
|
-
var _creatorFormatter = _interopRequireDefault(require("./creator-formatter"));
|
|
59
|
-
|
|
60
|
-
exports.CreatorFormatter = _creatorFormatter.default;
|
|
61
|
-
|
|
62
|
-
var _lastModifierFormatter = _interopRequireDefault(require("./last-modifier-formatter"));
|
|
63
|
-
|
|
64
|
-
exports.LastModifierFormatter = _lastModifierFormatter.default;
|
|
65
|
-
|
|
66
|
-
var _mtimeFormatter = _interopRequireDefault(require("./mtime-formatter"));
|
|
67
|
-
|
|
68
|
-
exports.MTimeFormatter = _mtimeFormatter.default;
|
|
69
|
-
|
|
70
|
-
var _formulaFormatter = _interopRequireDefault(require("./formula-formatter"));
|
|
71
|
-
|
|
72
|
-
exports.FormulaFormatter = _formulaFormatter.default;
|
|
73
|
-
|
|
74
|
-
var _linkFormatter = _interopRequireDefault(require("./link-formatter"));
|
|
75
|
-
|
|
76
|
-
exports.LinkFormatter = _linkFormatter.default;
|
|
77
|
-
|
|
78
|
-
var _autoNumberFormatter = _interopRequireDefault(require("./auto-number-formatter"));
|
|
79
|
-
|
|
80
|
-
exports.AutoNumberFormatter = _autoNumberFormatter.default;
|
|
81
|
-
|
|
82
|
-
var _urlFormatter = _interopRequireDefault(require("./url-formatter"));
|
|
83
|
-
|
|
84
|
-
exports.UrlFormatter = _urlFormatter.default;
|
|
85
|
-
|
|
86
|
-
var _emailFormatter = _interopRequireDefault(require("./email-formatter"));
|
|
87
|
-
|
|
88
|
-
exports.EmailFormatter = _emailFormatter.default;
|
|
89
|
-
|
|
90
|
-
var _durationFormatter = _interopRequireDefault(require("./duration-formatter"));
|
|
91
|
-
|
|
92
|
-
exports.DurationFormatter = _durationFormatter.default;
|
|
93
|
-
|
|
94
|
-
var _rateFormatter = _interopRequireDefault(require("./rate-formatter"));
|
|
95
|
-
|
|
96
|
-
exports.RateFormatter = _rateFormatter.default;
|
|
97
|
-
|
|
98
|
-
var _buttonFormatter = _interopRequireDefault(require("./button-formatter"));
|
|
99
|
-
|
|
100
|
-
exports.ButtonFormatter = _buttonFormatter.default;
|
|
101
|
-
|
|
102
|
-
var _fileItemFormatter = _interopRequireDefault(require("./widgets/file-item-formatter"));
|
|
103
|
-
|
|
104
|
-
exports.FileItemFormatter = _fileItemFormatter.default;
|
|
105
|
-
|
|
106
|
-
var _imagePreviewerLightbox = _interopRequireDefault(require("./widgets/image-previewer-lightbox"));
|
|
107
|
-
|
|
108
|
-
exports.ImagePreviewerLightbox = _imagePreviewerLightbox.default;
|
|
109
|
-
|
|
110
|
-
var _collaboratorItem = _interopRequireDefault(require("../common/collaborator-item"));
|
|
111
|
-
|
|
112
|
-
exports.CollaboratorItem = _collaboratorItem.default;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
9
|
-
|
|
10
|
-
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
|
-
var _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
19
|
-
|
|
20
|
-
var _collaboratorItem = _interopRequireDefault(require("../common/collaborator-item"));
|
|
21
|
-
|
|
22
|
-
var _default_avatar = _interopRequireDefault(require("../../assets/images/avatar/default_avatar.png"));
|
|
23
|
-
|
|
24
|
-
var propTypes = {
|
|
25
|
-
containerClassName: _propTypes.default.string,
|
|
26
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array]).isRequired,
|
|
27
|
-
collaborators: _propTypes.default.arrayOf(_propTypes.default.exact({
|
|
28
|
-
email: _propTypes.default.string.isRequired,
|
|
29
|
-
name: _propTypes.default.string.isRequired,
|
|
30
|
-
contact_email: _propTypes.default.string.isRequired,
|
|
31
|
-
avatar_url: _propTypes.default.string.isRequired
|
|
32
|
-
}))
|
|
33
|
-
}; // there will be there conditions
|
|
34
|
-
// 1 value is not exist, typeof value is array, but it's length is 0
|
|
35
|
-
// 2 value is exist, but can't find in collaborators
|
|
36
|
-
// 3 value is exist, typeof value is a string
|
|
37
|
-
// 4 vlaue is exist, typeof value is array
|
|
38
|
-
|
|
39
|
-
var LastModifierFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
40
|
-
(0, _inheritsLoose2.default)(LastModifierFormatter, _React$PureComponent);
|
|
41
|
-
|
|
42
|
-
function LastModifierFormatter() {
|
|
43
|
-
var _this;
|
|
44
|
-
|
|
45
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
46
|
-
args[_key] = arguments[_key];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
|
|
50
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCollaborators", function () {
|
|
51
|
-
var _this$props = _this.props,
|
|
52
|
-
value = _this$props.value,
|
|
53
|
-
collaborators = _this$props.collaborators;
|
|
54
|
-
|
|
55
|
-
if (!Array.isArray(value)) {
|
|
56
|
-
value = [value];
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return value.map(function (item, index) {
|
|
60
|
-
var collaborator = collaborators.find(function (collaborator) {
|
|
61
|
-
return collaborator.email === item;
|
|
62
|
-
}); // the collaborator can be not exist, because the row modified by third app
|
|
63
|
-
|
|
64
|
-
if (!collaborator) {
|
|
65
|
-
collaborator = {
|
|
66
|
-
name: item,
|
|
67
|
-
avatar_url: _default_avatar.default
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return /*#__PURE__*/_react.default.createElement(_collaboratorItem.default, {
|
|
72
|
-
key: index,
|
|
73
|
-
collaborator: collaborator
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
return _this;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
var _proto = LastModifierFormatter.prototype;
|
|
81
|
-
|
|
82
|
-
_proto.render = function render() {
|
|
83
|
-
var _this$props2 = this.props,
|
|
84
|
-
containerClassName = _this$props2.containerClassName,
|
|
85
|
-
value = _this$props2.value;
|
|
86
|
-
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container last-modified-formatter', containerClassName);
|
|
87
|
-
|
|
88
|
-
if (!value || Array.isArray(value) && value.length === 0) {
|
|
89
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
-
className: classname
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
var collaborators = this.getCollaborators();
|
|
95
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
-
className: classname
|
|
97
|
-
}, collaborators);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
return LastModifierFormatter;
|
|
101
|
-
}(_react.default.PureComponent);
|
|
102
|
-
|
|
103
|
-
LastModifierFormatter.propTypes = propTypes;
|
|
104
|
-
var _default = LastModifierFormatter;
|
|
105
|
-
exports.default = _default;
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
9
|
-
|
|
10
|
-
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
|
-
var _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
19
|
-
|
|
20
|
-
var CellTypes = _interopRequireWildcard(require("../../constants/cell-types"));
|
|
21
|
-
|
|
22
|
-
var _valueFormatUtils = require("../../utils/value-format-utils");
|
|
23
|
-
|
|
24
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
-
|
|
26
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
-
|
|
28
|
-
var propTypes = {
|
|
29
|
-
containerClassName: _propTypes.default.string,
|
|
30
|
-
row: _propTypes.default.object.isRequired,
|
|
31
|
-
column: _propTypes.default.object.isRequired,
|
|
32
|
-
enableOpenLinkedRow: _propTypes.default.bool,
|
|
33
|
-
currentTableId: _propTypes.default.string.isRequired,
|
|
34
|
-
linkMetaData: _propTypes.default.shape({
|
|
35
|
-
getLinkedTable: _propTypes.default.func.isRequired,
|
|
36
|
-
getLinkedRows: _propTypes.default.func.isRequired,
|
|
37
|
-
getLinkedCellValue: _propTypes.default.func.isRequired,
|
|
38
|
-
expandLinkedTableRow: _propTypes.default.func.isRequired
|
|
39
|
-
})
|
|
40
|
-
}; // link value is get form parant's interface
|
|
41
|
-
|
|
42
|
-
var LinkFormatter = /*#__PURE__*/function (_React$Component) {
|
|
43
|
-
(0, _inheritsLoose2.default)(LinkFormatter, _React$Component);
|
|
44
|
-
|
|
45
|
-
function LinkFormatter(props) {
|
|
46
|
-
var _this;
|
|
47
|
-
|
|
48
|
-
_this = _React$Component.call(this, props) || this;
|
|
49
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getLinkedCellValue", function (row) {
|
|
50
|
-
if (!row) return [];
|
|
51
|
-
var _this$props = _this.props,
|
|
52
|
-
column = _this$props.column,
|
|
53
|
-
currentTableId = _this$props.currentTableId,
|
|
54
|
-
linkMetaData = _this$props.linkMetaData;
|
|
55
|
-
|
|
56
|
-
var _ref = column.data || {},
|
|
57
|
-
link_id = _ref.link_id,
|
|
58
|
-
table_id = _ref.table_id,
|
|
59
|
-
other_table_id = _ref.other_table_id;
|
|
60
|
-
|
|
61
|
-
_this.linkID = link_id;
|
|
62
|
-
_this.tableID = currentTableId === table_id ? table_id : other_table_id;
|
|
63
|
-
_this.otherTableID = _this.tableID === table_id ? other_table_id : table_id;
|
|
64
|
-
return linkMetaData.getLinkedCellValue(_this.linkID, _this.tableID, _this.otherTableID, row._id);
|
|
65
|
-
});
|
|
66
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "expandLinkedTableRow", function (row) {
|
|
67
|
-
var _this$props2 = _this.props,
|
|
68
|
-
enableOpenLinkedRow = _this$props2.enableOpenLinkedRow,
|
|
69
|
-
linkMetaData = _this$props2.linkMetaData;
|
|
70
|
-
|
|
71
|
-
if (enableOpenLinkedRow) {
|
|
72
|
-
linkMetaData.expandLinkedTableRow(row, _this.otherTableID);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getDisplayValues", function () {
|
|
76
|
-
var _this$props3 = _this.props,
|
|
77
|
-
column = _this$props3.column,
|
|
78
|
-
linkMetaData = _this$props3.linkMetaData;
|
|
79
|
-
var rowIds = _this.state.value;
|
|
80
|
-
|
|
81
|
-
if (rowIds && Array.isArray(rowIds) && rowIds.length > 0) {
|
|
82
|
-
var linkedTable = linkMetaData.getLinkedTable(_this.otherTableID);
|
|
83
|
-
var linkedRows = linkMetaData.getLinkedRows(_this.otherTableID, rowIds);
|
|
84
|
-
var result = linkedRows.map(function (row, index) {
|
|
85
|
-
var displayColumnKey = column.data.display_column_key;
|
|
86
|
-
|
|
87
|
-
var displayValue = _this.getDisplayValue(linkedTable, row, displayColumnKey);
|
|
88
|
-
|
|
89
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
-
key: index,
|
|
91
|
-
className: "link-item",
|
|
92
|
-
onClick: _this.expandLinkedTableRow.bind((0, _assertThisInitialized2.default)(_this), row)
|
|
93
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
-
className: "link-name"
|
|
95
|
-
}, displayValue));
|
|
96
|
-
});
|
|
97
|
-
return result;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return null;
|
|
101
|
-
});
|
|
102
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getDisplayValue", function (linkedTable, row, displayColumnKey) {
|
|
103
|
-
var value = row[displayColumnKey];
|
|
104
|
-
var linkedColumn = linkedTable.columns.find(function (column) {
|
|
105
|
-
return column.key === displayColumnKey;
|
|
106
|
-
});
|
|
107
|
-
var type = linkedColumn.type,
|
|
108
|
-
data = linkedColumn.data; // todo: improve
|
|
109
|
-
|
|
110
|
-
switch (type) {
|
|
111
|
-
case CellTypes.NUMBER:
|
|
112
|
-
{
|
|
113
|
-
return (0, _valueFormatUtils.getNumberDisplayString)(value, data);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
case CellTypes.DATE:
|
|
117
|
-
{
|
|
118
|
-
var format = data.format;
|
|
119
|
-
return (0, _valueFormatUtils.getDateDisplayString)(value, format);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
default:
|
|
123
|
-
return value;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
_this.linkID = '';
|
|
127
|
-
_this.tableID = '';
|
|
128
|
-
_this.otherTableID = '';
|
|
129
|
-
_this.state = {
|
|
130
|
-
value: _this.getLinkedCellValue(props.row)
|
|
131
|
-
};
|
|
132
|
-
return _this;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
var _proto = LinkFormatter.prototype;
|
|
136
|
-
|
|
137
|
-
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
|
138
|
-
var nextRow = nextProps.row;
|
|
139
|
-
|
|
140
|
-
if (nextRow._id !== this.props.row._id) {
|
|
141
|
-
this.setState({
|
|
142
|
-
value: this.getLinkedCellValue(nextRow)
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
_proto.render = function render() {
|
|
148
|
-
var containerClassName = this.props.containerClassName;
|
|
149
|
-
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container link-formatter', containerClassName);
|
|
150
|
-
var displayValues = this.getDisplayValues();
|
|
151
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
152
|
-
className: classname
|
|
153
|
-
}, displayValues);
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
return LinkFormatter;
|
|
157
|
-
}(_react.default.Component);
|
|
158
|
-
|
|
159
|
-
(0, _defineProperty2.default)(LinkFormatter, "defaultProps", {
|
|
160
|
-
enableOpenLinkedRow: false,
|
|
161
|
-
value: []
|
|
162
|
-
});
|
|
163
|
-
LinkFormatter.propTypes = propTypes;
|
|
164
|
-
var _default = LinkFormatter;
|
|
165
|
-
exports.default = _default;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
|
-
var _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
13
|
-
|
|
14
|
-
var _htmlLongTextFormatter = _interopRequireDefault(require("./widgets/long-text-formatter/html-long-text-formatter"));
|
|
15
|
-
|
|
16
|
-
var _simpleLongTextFormatter = _interopRequireDefault(require("./widgets/long-text-formatter/simple-long-text-formatter"));
|
|
17
|
-
|
|
18
|
-
function LongTextFormatter(props) {
|
|
19
|
-
var isSample = props.isSample,
|
|
20
|
-
value = props.value,
|
|
21
|
-
containerClassName = props.containerClassName;
|
|
22
|
-
var className = (0, _astroClassname.default)('dtable-ui cell-formatter-container long-text-formatter', containerClassName);
|
|
23
|
-
|
|
24
|
-
if (isSample) {
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement(_simpleLongTextFormatter.default, {
|
|
26
|
-
value: value,
|
|
27
|
-
className: className
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(_htmlLongTextFormatter.default, {
|
|
32
|
-
value: value,
|
|
33
|
-
className: className
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
LongTextFormatter.propTypes = {
|
|
38
|
-
isSample: _propTypes.default.bool,
|
|
39
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
|
|
40
|
-
containerClassName: _propTypes.default.string
|
|
41
|
-
};
|
|
42
|
-
LongTextFormatter.defaultProps = {
|
|
43
|
-
isSample: true
|
|
44
|
-
};
|
|
45
|
-
var _default = LongTextFormatter;
|
|
46
|
-
exports.default = _default;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
9
|
-
|
|
10
|
-
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
|
-
var _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
19
|
-
|
|
20
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
21
|
-
|
|
22
|
-
var propTypes = {
|
|
23
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
24
|
-
containerClassName: _propTypes.default.string
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var MTimeFormatter = /*#__PURE__*/function (_React$Component) {
|
|
28
|
-
(0, _inheritsLoose2.default)(MTimeFormatter, _React$Component);
|
|
29
|
-
|
|
30
|
-
function MTimeFormatter() {
|
|
31
|
-
var _this;
|
|
32
|
-
|
|
33
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34
|
-
args[_key] = arguments[_key];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
38
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "formatDate", function (date) {
|
|
39
|
-
return (0, _moment.default)(date).format('YYYY-MM-DD HH:mm:ss');
|
|
40
|
-
});
|
|
41
|
-
return _this;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
var _proto = MTimeFormatter.prototype;
|
|
45
|
-
|
|
46
|
-
_proto.render = function render() {
|
|
47
|
-
var _this$props = this.props,
|
|
48
|
-
date = _this$props.value,
|
|
49
|
-
containerClassName = _this$props.containerClassName;
|
|
50
|
-
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
|
|
51
|
-
|
|
52
|
-
if (date !== '') {
|
|
53
|
-
date = this.formatDate(date);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
-
className: classname
|
|
58
|
-
}, date);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return MTimeFormatter;
|
|
62
|
-
}(_react.default.Component);
|
|
63
|
-
|
|
64
|
-
(0, _defineProperty2.default)(MTimeFormatter, "defaultProps", {
|
|
65
|
-
value: '',
|
|
66
|
-
containerClassName: ''
|
|
67
|
-
});
|
|
68
|
-
MTimeFormatter.propTypes = propTypes;
|
|
69
|
-
var _default = MTimeFormatter;
|
|
70
|
-
exports.default = _default;
|