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
package/lib/components/cell-formatter/widgets/long-text-formatter/html-long-text-formatter.js
DELETED
|
@@ -1,107 +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 _markdown2html = require("../../../../utils/markdown2html");
|
|
19
|
-
|
|
20
|
-
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); }
|
|
21
|
-
|
|
22
|
-
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; }
|
|
23
|
-
|
|
24
|
-
var HtmlLongTextFormatter = /*#__PURE__*/function (_Component) {
|
|
25
|
-
(0, _inheritsLoose2.default)(HtmlLongTextFormatter, _Component);
|
|
26
|
-
|
|
27
|
-
function HtmlLongTextFormatter(_props) {
|
|
28
|
-
var _this;
|
|
29
|
-
|
|
30
|
-
_this = _Component.call(this, _props) || this;
|
|
31
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "translateValue", function (props) {
|
|
32
|
-
var value = props.value;
|
|
33
|
-
|
|
34
|
-
if (!value) {
|
|
35
|
-
_this.setState({
|
|
36
|
-
innerHtml: null
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
var valueType = Object.prototype.toString.call(value);
|
|
43
|
-
|
|
44
|
-
if (valueType === '[object String]') {
|
|
45
|
-
_this.convertMarkdown(value);
|
|
46
|
-
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (valueType === '[object Object]') {
|
|
51
|
-
_this.convertMarkdown(value.text);
|
|
52
|
-
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return;
|
|
57
|
-
});
|
|
58
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "convertMarkdown", function (mdFile) {
|
|
59
|
-
_markdown2html.processor.process(mdFile).then(function (result) {
|
|
60
|
-
var innerHtml = String(result).replace(/<a /ig, '<a target="_blank" ');
|
|
61
|
-
|
|
62
|
-
_this.setState({
|
|
63
|
-
innerHtml: innerHtml
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
_this.state = {
|
|
68
|
-
innerHtml: null
|
|
69
|
-
};
|
|
70
|
-
return _this;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
var _proto = HtmlLongTextFormatter.prototype;
|
|
74
|
-
|
|
75
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
76
|
-
this.translateValue(this.props);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
_proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
80
|
-
var value = this.props.value;
|
|
81
|
-
|
|
82
|
-
if (nextProps.value !== value) {
|
|
83
|
-
this.translateValue(nextProps);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
_proto.render = function render() {
|
|
88
|
-
var innerHtml = this.state.innerHtml;
|
|
89
|
-
var className = this.props.className;
|
|
90
|
-
if (!innerHtml) return null;
|
|
91
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
-
className: className + " article",
|
|
93
|
-
dangerouslySetInnerHTML: {
|
|
94
|
-
__html: innerHtml
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return HtmlLongTextFormatter;
|
|
100
|
-
}(_react.Component);
|
|
101
|
-
|
|
102
|
-
HtmlLongTextFormatter.propTypes = {
|
|
103
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
|
|
104
|
-
className: _propTypes.default.string
|
|
105
|
-
};
|
|
106
|
-
var _default = HtmlLongTextFormatter;
|
|
107
|
-
exports.default = _default;
|
package/lib/components/cell-formatter/widgets/long-text-formatter/simple-long-text-formatter.js
DELETED
|
@@ -1,110 +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 _normalizeLongTextValue = _interopRequireDefault(require("../../../../utils/normalize-long-text-value"));
|
|
19
|
-
|
|
20
|
-
var SimpleLongTextFormatter = /*#__PURE__*/function (_React$Component) {
|
|
21
|
-
(0, _inheritsLoose2.default)(SimpleLongTextFormatter, _React$Component);
|
|
22
|
-
|
|
23
|
-
function SimpleLongTextFormatter() {
|
|
24
|
-
var _this;
|
|
25
|
-
|
|
26
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
27
|
-
args[_key] = arguments[_key];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
31
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderLinks", function (value) {
|
|
32
|
-
var links = value.links;
|
|
33
|
-
if (!Array.isArray(links) || links.length === 0) return null;
|
|
34
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
35
|
-
className: "long-text-links"
|
|
36
|
-
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
37
|
-
className: "dtable-font dtable-icon-url"
|
|
38
|
-
}), links.length);
|
|
39
|
-
});
|
|
40
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderCheckList", function (value) {
|
|
41
|
-
var checkList = value.checklist;
|
|
42
|
-
if (!checkList || checkList.total === 0) return null;
|
|
43
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
44
|
-
className: "long-text-check-list"
|
|
45
|
-
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
46
|
-
className: "dtable-font dtable-icon-check-square-solid " + (checkList.completed === checkList.total ? 'long-text-check-list-completed' : '')
|
|
47
|
-
}), checkList.completed + "/" + checkList.total);
|
|
48
|
-
});
|
|
49
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderImages", function (value) {
|
|
50
|
-
var images = value.images;
|
|
51
|
-
if (!Array.isArray(images) || images.length === 0) return null;
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
53
|
-
className: "long-text-images"
|
|
54
|
-
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
55
|
-
src: images[0],
|
|
56
|
-
alt: ""
|
|
57
|
-
}), /*#__PURE__*/_react.default.createElement("i", {
|
|
58
|
-
className: "image-number"
|
|
59
|
-
}, images.length > 1 ? '+' + images.length : null));
|
|
60
|
-
});
|
|
61
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderContent", function (value) {
|
|
62
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
63
|
-
className: "long-text-content"
|
|
64
|
-
}, value.preview);
|
|
65
|
-
});
|
|
66
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "translateValue", function () {
|
|
67
|
-
var value = _this.props.value;
|
|
68
|
-
if (!value) return {};
|
|
69
|
-
var valueType = Object.prototype.toString.call(value);
|
|
70
|
-
|
|
71
|
-
if (valueType === '[object String]') {
|
|
72
|
-
return (0, _normalizeLongTextValue.default)(value);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (valueType === '[object Object]') {
|
|
76
|
-
return value;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return {};
|
|
80
|
-
});
|
|
81
|
-
return _this;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
var _proto = SimpleLongTextFormatter.prototype;
|
|
85
|
-
|
|
86
|
-
_proto.render = function render() {
|
|
87
|
-
var className = this.props.className;
|
|
88
|
-
var value = this.translateValue();
|
|
89
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
-
className: className
|
|
91
|
-
}, this.renderLinks(value), this.renderCheckList(value), this.renderImages(value), this.renderContent(value));
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
return SimpleLongTextFormatter;
|
|
95
|
-
}(_react.default.Component);
|
|
96
|
-
|
|
97
|
-
(0, _defineProperty2.default)(SimpleLongTextFormatter, "defaultProps", {
|
|
98
|
-
value: {
|
|
99
|
-
text: '',
|
|
100
|
-
images: [],
|
|
101
|
-
links: [],
|
|
102
|
-
preview: ''
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
SimpleLongTextFormatter.propTypes = {
|
|
106
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
|
|
107
|
-
className: _propTypes.default.string
|
|
108
|
-
};
|
|
109
|
-
var _default = SimpleLongTextFormatter;
|
|
110
|
-
exports.default = _default;
|
|
@@ -1,158 +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 _loading = _interopRequireDefault(require("../loading"));
|
|
19
|
-
|
|
20
|
-
var _utils = require("../../utils/utils");
|
|
21
|
-
|
|
22
|
-
var propTypes = {
|
|
23
|
-
images: _propTypes.default.array.isRequired,
|
|
24
|
-
server: _propTypes.default.string,
|
|
25
|
-
onImageClick: _propTypes.default.func
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var ImagesLazyLoad = /*#__PURE__*/function (_React$Component) {
|
|
29
|
-
(0, _inheritsLoose2.default)(ImagesLazyLoad, _React$Component);
|
|
30
|
-
|
|
31
|
-
function ImagesLazyLoad(props) {
|
|
32
|
-
var _this;
|
|
33
|
-
|
|
34
|
-
_this = _React$Component.call(this, props) || this;
|
|
35
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "componentDidMount", function () {
|
|
36
|
-
var images = _this.state.images;
|
|
37
|
-
|
|
38
|
-
_this.lazyLoadImages(images);
|
|
39
|
-
});
|
|
40
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "componentWillReceiveProps", function (nextProps) {
|
|
41
|
-
if (nextProps.images.toString() !== _this.props.images.toString()) {
|
|
42
|
-
_this.lazyLoadImages(nextProps.images);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "componentWillUnmount", function () {
|
|
46
|
-
// prevent async operation
|
|
47
|
-
_this.setState = function (state, callback) {
|
|
48
|
-
return;
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "lazyLoadImages", function (images) {
|
|
52
|
-
if (!Array.isArray(images) || images.length === 0) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
var server = _this.props.server.server;
|
|
57
|
-
images.forEach(function (item) {
|
|
58
|
-
var url = (0, _utils.getImageThumbnailUrl)(item, server);
|
|
59
|
-
|
|
60
|
-
_this.lazyLoadImage(url, function (image) {
|
|
61
|
-
var _this$state = _this.state,
|
|
62
|
-
loadedCount = _this$state.loadedCount,
|
|
63
|
-
loadedImages = _this$state.loadedImages;
|
|
64
|
-
|
|
65
|
-
_this.setState({
|
|
66
|
-
loadedCount: loadedCount + 1,
|
|
67
|
-
loadedImages: loadedImages.concat(image)
|
|
68
|
-
});
|
|
69
|
-
}, function () {
|
|
70
|
-
var loadedCount = _this.state.loadedCount;
|
|
71
|
-
|
|
72
|
-
_this.setState({
|
|
73
|
-
loadedCount: loadedCount + 1
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "lazyLoadImage", function (url, resolve, reject) {
|
|
79
|
-
if (!url) {
|
|
80
|
-
reject('img path is require');
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
var image = new Image();
|
|
85
|
-
|
|
86
|
-
image.onload = function () {
|
|
87
|
-
resolve(image);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
image.onerror = function (e) {
|
|
91
|
-
reject(e);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
image.src = url;
|
|
95
|
-
});
|
|
96
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMouseDown", function (event) {
|
|
97
|
-
event.stopPropagation();
|
|
98
|
-
});
|
|
99
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onImageClick", function (event, index) {
|
|
100
|
-
event.stopPropagation();
|
|
101
|
-
|
|
102
|
-
_this.props.onImageClick(index);
|
|
103
|
-
});
|
|
104
|
-
_this.state = {
|
|
105
|
-
images: props.images,
|
|
106
|
-
loadedImages: [],
|
|
107
|
-
loadedCount: 0
|
|
108
|
-
};
|
|
109
|
-
return _this;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
var _proto = ImagesLazyLoad.prototype;
|
|
113
|
-
|
|
114
|
-
_proto.render = function render() {
|
|
115
|
-
var _this2 = this;
|
|
116
|
-
|
|
117
|
-
var _this$state2 = this.state,
|
|
118
|
-
images = _this$state2.images,
|
|
119
|
-
loadedImages = _this$state2.loadedImages,
|
|
120
|
-
loadedCount = _this$state2.loadedCount;
|
|
121
|
-
|
|
122
|
-
if (!Array.isArray(images) || images.length === 0) {
|
|
123
|
-
return '';
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (images.length > loadedCount) {
|
|
127
|
-
var style = {
|
|
128
|
-
marginLeft: '4px'
|
|
129
|
-
};
|
|
130
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
131
|
-
style: style
|
|
132
|
-
}, /*#__PURE__*/_react.default.createElement(_loading.default, null));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (images.length === loadedCount) {
|
|
136
|
-
return loadedImages.map(function (image, index) {
|
|
137
|
-
return /*#__PURE__*/_react.default.createElement("img", {
|
|
138
|
-
key: index,
|
|
139
|
-
className: "image-item",
|
|
140
|
-
src: image.src,
|
|
141
|
-
onMouseDown: _this2.onMouseDown,
|
|
142
|
-
onClick: function onClick(event) {
|
|
143
|
-
return _this2.onImageClick(event, index);
|
|
144
|
-
},
|
|
145
|
-
alt: ""
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return '';
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
return ImagesLazyLoad;
|
|
154
|
-
}(_react.default.Component);
|
|
155
|
-
|
|
156
|
-
ImagesLazyLoad.propTypes = propTypes;
|
|
157
|
-
var _default = ImagesLazyLoad;
|
|
158
|
-
exports.default = _default;
|
|
@@ -1,51 +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 _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
|
-
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
|
-
var propTypes = {
|
|
17
|
-
children: _propTypes.default.object.isRequired
|
|
18
|
-
};
|
|
19
|
-
var modalRoot = document.getElementById('modal-wrapper');
|
|
20
|
-
|
|
21
|
-
var ModalPortal = /*#__PURE__*/function (_React$Component) {
|
|
22
|
-
(0, _inheritsLoose2.default)(ModalPortal, _React$Component);
|
|
23
|
-
|
|
24
|
-
function ModalPortal(props) {
|
|
25
|
-
var _this;
|
|
26
|
-
|
|
27
|
-
_this = _React$Component.call(this, props) || this;
|
|
28
|
-
_this.el = document.createElement('div');
|
|
29
|
-
return _this;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var _proto = ModalPortal.prototype;
|
|
33
|
-
|
|
34
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
35
|
-
modalRoot.appendChild(this.el);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
39
|
-
modalRoot.removeChild(this.el);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
_proto.render = function render() {
|
|
43
|
-
return /*#__PURE__*/_reactDom.default.createPortal(this.props.children, this.el);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return ModalPortal;
|
|
47
|
-
}(_react.default.Component);
|
|
48
|
-
|
|
49
|
-
ModalPortal.propTypes = propTypes;
|
|
50
|
-
var _default = ModalPortal;
|
|
51
|
-
exports.default = _default;
|
|
@@ -1,73 +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 propTypes = {
|
|
19
|
-
option: _propTypes.default.shape({
|
|
20
|
-
id: _propTypes.default.string.isRequired,
|
|
21
|
-
name: _propTypes.default.string.isRequired,
|
|
22
|
-
color: _propTypes.default.string.isRequired
|
|
23
|
-
}).isRequired,
|
|
24
|
-
fontSize: _propTypes.default.number
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var SelectItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
28
|
-
(0, _inheritsLoose2.default)(SelectItem, _React$PureComponent);
|
|
29
|
-
|
|
30
|
-
function SelectItem() {
|
|
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$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
|
|
38
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getStyle", function (option, fontSize) {
|
|
39
|
-
return {
|
|
40
|
-
display: 'inline-block',
|
|
41
|
-
padding: '0px 10px',
|
|
42
|
-
marginRight: '8px',
|
|
43
|
-
height: '20px',
|
|
44
|
-
lineHeight: '20px',
|
|
45
|
-
textAlign: 'center',
|
|
46
|
-
borderRadius: '10px',
|
|
47
|
-
fontSize: fontSize ? fontSize + "px" : '13px',
|
|
48
|
-
backgroundColor: option.color,
|
|
49
|
-
color: option.textColor || null
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
return _this;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
var _proto = SelectItem.prototype;
|
|
56
|
-
|
|
57
|
-
_proto.render = function render() {
|
|
58
|
-
var _this$props = this.props,
|
|
59
|
-
option = _this$props.option,
|
|
60
|
-
fontSize = _this$props.fontSize;
|
|
61
|
-
var style = this.getStyle(option, fontSize);
|
|
62
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
63
|
-
className: "dtable-ui select-item",
|
|
64
|
-
style: style
|
|
65
|
-
}, option.name);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
return SelectItem;
|
|
69
|
-
}(_react.default.PureComponent);
|
|
70
|
-
|
|
71
|
-
SelectItem.propTypes = propTypes;
|
|
72
|
-
var _default = SelectItem;
|
|
73
|
-
exports.default = _default;
|
|
@@ -1,63 +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 propTypes = {
|
|
19
|
-
isCheckRepeat: _propTypes.default.bool,
|
|
20
|
-
onFileUploadProgress: _propTypes.default.func,
|
|
21
|
-
onFileUploadSuccss: _propTypes.default.func,
|
|
22
|
-
onFileUploadFailed: _propTypes.default.func,
|
|
23
|
-
dtableWebAPI: _propTypes.default.object.isRequired
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
var FileUploader = /*#__PURE__*/function (_React$Component) {
|
|
27
|
-
(0, _inheritsLoose2.default)(FileUploader, _React$Component);
|
|
28
|
-
|
|
29
|
-
function FileUploader(props) {
|
|
30
|
-
var _this;
|
|
31
|
-
|
|
32
|
-
_this = _React$Component.call(this, props) || this;
|
|
33
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFilesChanged", function () {});
|
|
34
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "uploadFiles", function (fileList, isMultiple) {
|
|
35
|
-
if (isMultiple === void 0) {
|
|
36
|
-
isMultiple = false;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "checkRepeat", function () {});
|
|
40
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "cancelUploadFile", function () {});
|
|
41
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFileUploadProgress", function () {});
|
|
42
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFileUploadSuccss", function () {});
|
|
43
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFileUploadFailed", function () {});
|
|
44
|
-
_this.state = {};
|
|
45
|
-
_this.uploadFiles = [];
|
|
46
|
-
return _this;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
var _proto = FileUploader.prototype;
|
|
50
|
-
|
|
51
|
-
_proto.render = function render() {
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement("input", {
|
|
53
|
-
type: "file",
|
|
54
|
-
onChange: this.onFilesChanged
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
return FileUploader;
|
|
59
|
-
}(_react.default.Component);
|
|
60
|
-
|
|
61
|
-
FileUploader.propTypes = propTypes;
|
|
62
|
-
var _default = FileUploader;
|
|
63
|
-
exports.default = _default;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.default = Loading;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
require("../css/loading.css");
|
|
11
|
-
|
|
12
|
-
function Loading() {
|
|
13
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
14
|
-
className: "loading-icon loading-tip"
|
|
15
|
-
});
|
|
16
|
-
}
|