dtable-ui-component 0.1.75-beta2 → 0.1.75-beta3
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/es/AutoNumberFormatter/index.css +1 -0
- package/es/AutoNumberFormatter/index.js +36 -0
- package/es/ButtonFormatter/index.css +13 -0
- package/es/ButtonFormatter/index.js +56 -0
- package/es/CTimeFormatter/index.css +1 -0
- package/es/CTimeFormatter/index.js +58 -0
- package/es/CheckboxFormatter/index.css +1 -0
- package/es/CheckboxFormatter/index.js +45 -0
- package/es/CollaboratorFormatter/index.css +1 -0
- package/es/CollaboratorFormatter/index.js +91 -0
- package/es/CollaboratorItem/index.css +49 -0
- package/es/CollaboratorItem/index.js +64 -0
- package/es/CreatorFormatter/index.css +1 -0
- package/es/CreatorFormatter/index.js +87 -0
- package/es/DateFormatter/index.css +1 -0
- package/es/DateFormatter/index.js +60 -0
- package/es/DurationFormatter/index.css +1 -0
- package/es/DurationFormatter/index.js +38 -0
- package/es/EmailFormatter/index.css +5 -0
- package/es/EmailFormatter/index.js +36 -0
- package/es/FileFormatter/index.css +29 -0
- package/es/FileFormatter/index.js +64 -0
- package/es/FileItemFormatter/index.js +50 -0
- package/es/FileUploader/index.js +53 -0
- package/es/FormulaFormatter/index.css +19 -0
- package/es/FormulaFormatter/index.js +164 -0
- package/es/GeolocationFormatter/index.css +1 -0
- package/es/GeolocationFormatter/index.js +53 -0
- package/es/ImageFormatter/images-lazy-load.js +150 -0
- package/es/ImageFormatter/index.css +34 -0
- package/es/ImageFormatter/index.js +154 -0
- package/es/ImagePreviewerLightbox/index.css +87 -0
- package/es/ImagePreviewerLightbox/index.js +119 -0
- package/es/LastModifierFormatter/index.css +1 -0
- package/es/LastModifierFormatter/index.js +87 -0
- package/es/LinkFormatter/index.css +27 -0
- package/es/LinkFormatter/index.js +144 -0
- package/es/Loading/index.css +54 -0
- package/es/Loading/index.js +7 -0
- package/es/LongTextFormatter/html-long-text-formatter.js +96 -0
- package/es/LongTextFormatter/index.css +63 -0
- package/es/LongTextFormatter/index.js +29 -0
- package/es/LongTextFormatter/simple-long-text-formatter.js +104 -0
- package/es/MTimeFormatter/index.css +1 -0
- package/es/MTimeFormatter/index.js +58 -0
- package/es/ModalPortal/index.js +44 -0
- package/es/MultipleSelectFormatter/index.css +1 -0
- package/es/MultipleSelectFormatter/index.js +70 -0
- package/es/NumberFormatter/index.css +1 -0
- package/es/NumberFormatter/index.js +47 -0
- package/es/RateFormatter/index.css +1 -0
- package/es/RateFormatter/index.js +80 -0
- package/es/SelectItem/index.js +58 -0
- package/es/SingleSelectFormatter/index.css +1 -0
- package/es/SingleSelectFormatter/index.js +70 -0
- package/es/TextFormatter/index.css +1 -0
- package/es/TextFormatter/index.js +56 -0
- package/es/UrlFormatter/index.css +5 -0
- package/es/UrlFormatter/index.js +36 -0
- package/es/app.css +20 -0
- package/es/app.js +91 -0
- 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/cellFormatterFactory/index.js +25 -0
- package/es/components/cell-editor/checkbox-editor.js +104 -0
- package/es/components/cell-editor/collaborator-editor.js +236 -0
- package/es/components/cell-editor/date-editor.js +151 -0
- package/es/components/cell-editor/index.js +9 -0
- package/es/components/cell-editor/link-editor.js +303 -0
- package/es/components/cell-editor/multiple-select-editor.js +237 -0
- package/es/components/cell-editor/number-editor.js +154 -0
- package/es/components/cell-editor/single-select-editor.js +202 -0
- package/es/components/cell-editor/text-editor.js +122 -0
- package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +46 -0
- 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 +177 -0
- package/es/components/cell-editor-popover/mb-date-editor-popover.js +245 -0
- package/es/components/cell-editor-popover/mb-link-editor-popover.js +170 -0
- package/es/components/cell-editor-popover/mb-select-editor-popover.js +230 -0
- package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +109 -0
- package/es/components/cell-editor-popover/pc-date-editor-popover.js +142 -0
- package/es/components/cell-editor-popover/pc-link-editor-popover.js +114 -0
- package/es/components/cell-editor-popover/pc-select-editor-popover.js +143 -0
- package/es/components/common/collaborator-item.js +63 -0
- package/es/components/common/edit-editor-button.js +56 -0
- package/es/components/common/link-editor-option.js +113 -0
- package/es/components/common/mobile/mb-editor-header.js +48 -0
- package/es/components/common/select-editor-option.js +106 -0
- package/es/constants/cell-types.js +25 -0
- package/es/constants/index.js +49 -0
- package/es/css/cell-editor.css +614 -0
- package/es/css/cell-formatter.css +4 -0
- package/es/css/custom-rc-calendar.css +118 -0
- package/es/formatterConfig/index.js +31 -0
- package/es/index.js +31 -0
- package/es/lang/index.js +50 -0
- package/es/locals/de.js +2 -0
- package/es/locals/en.js +17 -0
- package/es/locals/fr.js +2 -0
- package/es/locals/zh-CN.js +17 -0
- package/{lib/toast → es/toaster}/alert.js +0 -0
- package/{lib/toast → es/toaster}/index.js +0 -0
- package/{lib/toast → es/toaster}/toast.js +0 -0
- package/{lib/toast → es/toaster}/toastManager.js +0 -0
- package/{lib/toast → es/toaster}/toaster.js +0 -0
- package/es/utils/cell-value-validator.js +31 -0
- package/es/utils/column-utils.js +7 -0
- package/es/utils/editor-utils.js +71 -0
- package/es/utils/markdown2html.js +62 -0
- package/es/utils/normalize-long-text-value.js +69 -0
- package/es/utils/number-precision.js +164 -0
- package/es/utils/unified/index.js +470 -0
- package/es/utils/utils.js +116 -0
- package/es/utils/value-format-utils.js +497 -0
- package/es/utils/vfile/core.js +172 -0
- package/es/utils/vfile/index.js +48 -0
- package/lib/AutoNumberFormatter/index.js +38 -27
- package/lib/ButtonFormatter/index.js +59 -47
- package/lib/CTimeFormatter/index.js +53 -39
- package/lib/CheckboxFormatter/index.js +48 -35
- package/lib/CollaboratorFormatter/index.js +64 -42
- package/lib/CollaboratorItem/index.js +61 -44
- package/lib/CreatorFormatter/index.js +62 -42
- package/lib/DateFormatter/index.js +55 -40
- package/lib/DurationFormatter/index.js +42 -29
- package/lib/EmailFormatter/index.js +38 -27
- package/lib/FileFormatter/index.js +65 -50
- package/lib/FileItemFormatter/index.js +44 -31
- package/lib/FileUploader/index.js +44 -34
- package/lib/FormulaFormatter/index.js +102 -81
- package/lib/GeolocationFormatter/index.js +50 -35
- package/lib/ImageFormatter/images-lazy-load.js +81 -73
- package/lib/ImageFormatter/index.js +109 -90
- package/lib/ImagePreviewerLightbox/index.js +60 -27
- package/lib/LastModifierFormatter/index.js +62 -42
- package/lib/LinkFormatter/index.js +80 -59
- package/lib/Loading/index.js +13 -4
- package/lib/LongTextFormatter/html-long-text-formatter.js +60 -49
- package/lib/LongTextFormatter/index.js +28 -9
- package/lib/LongTextFormatter/simple-long-text-formatter.js +58 -52
- package/lib/MTimeFormatter/index.js +53 -39
- package/lib/ModalPortal/index.js +37 -30
- package/lib/MultipleSelectFormatter/index.js +55 -39
- package/lib/NumberFormatter/index.js +50 -35
- package/lib/RateFormatter/index.js +52 -37
- package/lib/SelectItem/index.js +46 -31
- package/lib/SingleSelectFormatter/index.js +54 -38
- package/lib/TextFormatter/index.js +44 -31
- package/lib/UrlFormatter/index.js +38 -27
- package/lib/app.js +80 -75
- package/lib/cellFormatterFactory/index.js +20 -17
- package/lib/components/cell-editor/checkbox-editor.js +66 -59
- package/lib/components/cell-editor/collaborator-editor.js +126 -113
- package/lib/components/cell-editor/date-editor.js +119 -99
- package/lib/components/cell-editor/index.js +40 -9
- package/lib/components/cell-editor/link-editor.js +140 -122
- package/lib/components/cell-editor/multiple-select-editor.js +127 -114
- package/lib/components/cell-editor/number-editor.js +86 -78
- package/lib/components/cell-editor/single-select-editor.js +120 -106
- package/lib/components/cell-editor/text-editor.js +72 -65
- package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +51 -31
- package/lib/components/cell-editor-dialog/pc-files-addition/index.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-preview/index.js +1 -0
- package/lib/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +1 -0
- package/lib/components/cell-editor-popover/mb-collaborator-editor-popover.js +111 -105
- package/lib/components/cell-editor-popover/mb-date-editor-popover.js +157 -140
- package/lib/components/cell-editor-popover/mb-link-editor-popover.js +109 -103
- package/lib/components/cell-editor-popover/mb-select-editor-popover.js +155 -142
- package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +89 -74
- package/lib/components/cell-editor-popover/pc-date-editor-popover.js +102 -88
- package/lib/components/cell-editor-popover/pc-link-editor-popover.js +91 -77
- package/lib/components/cell-editor-popover/pc-select-editor-popover.js +105 -91
- package/lib/components/common/collaborator-item.js +59 -43
- package/lib/components/common/edit-editor-button.js +39 -28
- package/lib/components/common/link-editor-option.js +71 -63
- package/lib/components/common/mobile/mb-editor-header.js +52 -39
- package/lib/components/common/select-editor-option.js +74 -58
- package/lib/constants/cell-types.js +54 -25
- package/lib/constants/index.js +28 -5
- package/lib/formatterConfig/index.js +59 -28
- package/lib/index.js +139 -31
- package/lib/lang/index.js +27 -11
- package/lib/locals/de.js +6 -1
- package/lib/locals/en.js +6 -1
- package/lib/locals/fr.js +6 -1
- package/lib/locals/zh-CN.js +6 -1
- package/lib/toaster/alert.js +164 -0
- package/lib/toaster/index.js +12 -0
- package/lib/toaster/toast.js +223 -0
- package/lib/toaster/toastManager.js +189 -0
- package/lib/toaster/toaster.js +92 -0
- package/lib/utils/cell-value-validator.js +9 -5
- package/lib/utils/column-utils.js +13 -5
- package/lib/utils/editor-utils.js +13 -3
- package/lib/utils/markdown2html.js +7 -1
- package/lib/utils/normalize-long-text-value.js +6 -1
- package/lib/utils/number-precision.js +32 -13
- package/lib/utils/utils.js +33 -8
- package/lib/utils/value-format-utils.js +110 -58
- package/package.json +5 -5
|
@@ -1,29 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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("./html-long-text-formatter"));
|
|
15
|
+
|
|
16
|
+
var _simpleLongTextFormatter = _interopRequireDefault(require("./simple-long-text-formatter"));
|
|
17
|
+
|
|
18
|
+
require("./index.css");
|
|
6
19
|
|
|
7
20
|
function LongTextFormatter(props) {
|
|
8
21
|
var isSample = props.isSample,
|
|
9
22
|
value = props.value,
|
|
10
23
|
containerClassName = props.containerClassName;
|
|
11
|
-
var className =
|
|
24
|
+
var className = (0, _astroClassname.default)('dtable-ui cell-formatter-container long-text-formatter', containerClassName);
|
|
12
25
|
|
|
13
26
|
if (isSample) {
|
|
14
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_simpleLongTextFormatter.default, {
|
|
15
28
|
value: value,
|
|
16
29
|
className: className
|
|
17
30
|
});
|
|
18
31
|
}
|
|
19
32
|
|
|
20
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_htmlLongTextFormatter.default, {
|
|
21
34
|
value: value,
|
|
22
35
|
className: className
|
|
23
36
|
});
|
|
24
37
|
}
|
|
25
38
|
|
|
39
|
+
LongTextFormatter.propTypes = {
|
|
40
|
+
isSample: _propTypes.default.bool,
|
|
41
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
|
|
42
|
+
containerClassName: _propTypes.default.string
|
|
43
|
+
};
|
|
26
44
|
LongTextFormatter.defaultProps = {
|
|
27
45
|
isSample: true
|
|
28
46
|
};
|
|
29
|
-
|
|
47
|
+
var _default = LongTextFormatter;
|
|
48
|
+
exports.default = _default;
|
|
@@ -1,72 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import getPreviewContent from '../utils/normalize-long-text-value';
|
|
1
|
+
"use strict";
|
|
7
2
|
|
|
8
|
-
var
|
|
9
|
-
|
|
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"));
|
|
10
13
|
|
|
11
|
-
|
|
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);
|
|
12
22
|
|
|
13
23
|
function SimpleLongTextFormatter() {
|
|
14
24
|
var _this;
|
|
15
25
|
|
|
16
|
-
_classCallCheck(this, SimpleLongTextFormatter);
|
|
17
|
-
|
|
18
26
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
27
|
args[_key] = arguments[_key];
|
|
20
28
|
}
|
|
21
29
|
|
|
22
|
-
_this =
|
|
23
|
-
|
|
24
|
-
_this.renderLinks = function (value) {
|
|
30
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
31
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderLinks", function (value) {
|
|
25
32
|
var links = value.links;
|
|
26
33
|
if (!Array.isArray(links) || links.length === 0) return null;
|
|
27
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
28
35
|
className: "long-text-links"
|
|
29
|
-
}, /*#__PURE__*/
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
30
37
|
className: "dtable-font dtable-icon-url"
|
|
31
38
|
}), links.length);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
_this.renderCheckList = function (value) {
|
|
39
|
+
});
|
|
40
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderCheckList", function (value) {
|
|
35
41
|
var checkList = value.checklist;
|
|
36
42
|
if (!checkList || checkList.total === 0) return null;
|
|
37
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
38
44
|
className: "long-text-check-list"
|
|
39
|
-
}, /*#__PURE__*/
|
|
40
|
-
className: "dtable-font dtable-icon-check-square-solid "
|
|
41
|
-
}),
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
_this.renderImages = function (value) {
|
|
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) {
|
|
45
50
|
var images = value.images;
|
|
46
51
|
if (!Array.isArray(images) || images.length === 0) return null;
|
|
47
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
48
53
|
className: "long-text-images"
|
|
49
|
-
}, /*#__PURE__*/
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
50
55
|
src: images[0],
|
|
51
56
|
alt: ""
|
|
52
|
-
}), /*#__PURE__*/
|
|
57
|
+
}), /*#__PURE__*/_react.default.createElement("i", {
|
|
53
58
|
className: "image-number"
|
|
54
59
|
}, images.length > 1 ? '+' + images.length : null));
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
60
|
+
});
|
|
61
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderContent", function (value) {
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
59
63
|
className: "long-text-content"
|
|
60
64
|
}, value.preview);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
_this.translateValue = function () {
|
|
65
|
+
});
|
|
66
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "translateValue", function () {
|
|
64
67
|
var value = _this.props.value;
|
|
65
68
|
if (!value) return {};
|
|
66
69
|
var valueType = Object.prototype.toString.call(value);
|
|
67
70
|
|
|
68
71
|
if (valueType === '[object String]') {
|
|
69
|
-
return
|
|
72
|
+
return (0, _normalizeLongTextValue.default)(value);
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
if (valueType === '[object Object]') {
|
|
@@ -74,31 +77,34 @@ var SimpleLongTextFormatter = /*#__PURE__*/function (_React$Component) {
|
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
return {};
|
|
77
|
-
};
|
|
78
|
-
|
|
80
|
+
});
|
|
79
81
|
return _this;
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}]);
|
|
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
|
+
};
|
|
92
93
|
|
|
93
94
|
return SimpleLongTextFormatter;
|
|
94
|
-
}(
|
|
95
|
+
}(_react.default.Component);
|
|
95
96
|
|
|
96
|
-
SimpleLongTextFormatter
|
|
97
|
+
(0, _defineProperty2.default)(SimpleLongTextFormatter, "defaultProps", {
|
|
97
98
|
value: {
|
|
98
99
|
text: '',
|
|
99
100
|
images: [],
|
|
100
101
|
links: [],
|
|
101
102
|
preview: ''
|
|
102
103
|
}
|
|
104
|
+
});
|
|
105
|
+
SimpleLongTextFormatter.propTypes = {
|
|
106
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
|
|
107
|
+
className: _propTypes.default.string
|
|
103
108
|
};
|
|
104
|
-
|
|
109
|
+
var _default = SimpleLongTextFormatter;
|
|
110
|
+
exports.default = _default;
|
|
@@ -1,58 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import cn from 'astro-classname';
|
|
7
|
-
import moment from 'moment';
|
|
8
|
-
import './index.css';
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
10
|
-
var
|
|
11
|
-
|
|
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
|
+
require("./index.css");
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
var propTypes = {
|
|
25
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
26
|
+
containerClassName: _propTypes.default.string
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var MTimeFormatter = /*#__PURE__*/function (_React$Component) {
|
|
30
|
+
(0, _inheritsLoose2.default)(MTimeFormatter, _React$Component);
|
|
14
31
|
|
|
15
32
|
function MTimeFormatter() {
|
|
16
33
|
var _this;
|
|
17
34
|
|
|
18
|
-
_classCallCheck(this, MTimeFormatter);
|
|
19
|
-
|
|
20
35
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
36
|
args[_key] = arguments[_key];
|
|
22
37
|
}
|
|
23
38
|
|
|
24
|
-
_this =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
|
|
39
|
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
40
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "formatDate", function (date) {
|
|
41
|
+
return (0, _moment.default)(date).format('YYYY-MM-DD HH:mm:ss');
|
|
42
|
+
});
|
|
30
43
|
return _this;
|
|
31
44
|
}
|
|
32
45
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
46
|
-
className: classname
|
|
47
|
-
}, date);
|
|
46
|
+
var _proto = MTimeFormatter.prototype;
|
|
47
|
+
|
|
48
|
+
_proto.render = function render() {
|
|
49
|
+
var _this$props = this.props,
|
|
50
|
+
date = _this$props.value,
|
|
51
|
+
containerClassName = _this$props.containerClassName;
|
|
52
|
+
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
|
|
53
|
+
|
|
54
|
+
if (date !== '') {
|
|
55
|
+
date = this.formatDate(date);
|
|
48
56
|
}
|
|
49
|
-
|
|
57
|
+
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
+
className: classname
|
|
60
|
+
}, date);
|
|
61
|
+
};
|
|
50
62
|
|
|
51
63
|
return MTimeFormatter;
|
|
52
|
-
}(
|
|
64
|
+
}(_react.default.Component);
|
|
53
65
|
|
|
54
|
-
MTimeFormatter
|
|
66
|
+
(0, _defineProperty2.default)(MTimeFormatter, "defaultProps", {
|
|
55
67
|
value: '',
|
|
56
68
|
containerClassName: ''
|
|
57
|
-
};
|
|
58
|
-
|
|
69
|
+
});
|
|
70
|
+
MTimeFormatter.propTypes = propTypes;
|
|
71
|
+
var _default = MTimeFormatter;
|
|
72
|
+
exports.default = _default;
|
package/lib/ModalPortal/index.js
CHANGED
|
@@ -1,44 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
+
};
|
|
7
19
|
var modalRoot = document.getElementById('modal-wrapper');
|
|
8
20
|
|
|
9
21
|
var ModalPortal = /*#__PURE__*/function (_React$Component) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _super = _createSuper(ModalPortal);
|
|
22
|
+
(0, _inheritsLoose2.default)(ModalPortal, _React$Component);
|
|
13
23
|
|
|
14
24
|
function ModalPortal(props) {
|
|
15
25
|
var _this;
|
|
16
26
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
_this = _super.call(this, props);
|
|
27
|
+
_this = _React$Component.call(this, props) || this;
|
|
20
28
|
_this.el = document.createElement('div');
|
|
21
29
|
return _this;
|
|
22
30
|
}
|
|
23
31
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return ReactDOM.createPortal(this.props.children, this.el);
|
|
38
|
-
}
|
|
39
|
-
}]);
|
|
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
|
+
};
|
|
40
45
|
|
|
41
46
|
return ModalPortal;
|
|
42
|
-
}(
|
|
47
|
+
}(_react.default.Component);
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
ModalPortal.propTypes = propTypes;
|
|
50
|
+
var _default = ModalPortal;
|
|
51
|
+
exports.default = _default;
|
|
@@ -1,29 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import cn from 'astro-classname';
|
|
7
|
-
import SelectItem from '../SelectItem';
|
|
8
|
-
import './index.css';
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
10
|
-
var
|
|
11
|
-
|
|
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 _SelectItem = _interopRequireDefault(require("../SelectItem"));
|
|
21
|
+
|
|
22
|
+
require("./index.css");
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
var propTypes = {
|
|
25
|
+
value: _propTypes.default.array,
|
|
26
|
+
fontSize: _propTypes.default.number,
|
|
27
|
+
containerClassName: _propTypes.default.string,
|
|
28
|
+
options: _propTypes.default.array.isRequired
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var MultipleSelectFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
32
|
+
(0, _inheritsLoose2.default)(MultipleSelectFormatter, _React$PureComponent);
|
|
14
33
|
|
|
15
34
|
function MultipleSelectFormatter() {
|
|
16
35
|
var _this;
|
|
17
36
|
|
|
18
|
-
_classCallCheck(this, MultipleSelectFormatter);
|
|
19
|
-
|
|
20
37
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
38
|
args[_key] = arguments[_key];
|
|
22
39
|
}
|
|
23
40
|
|
|
24
|
-
_this =
|
|
25
|
-
|
|
26
|
-
_this.getOptions = function () {
|
|
41
|
+
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
|
|
42
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getOptions", function () {
|
|
27
43
|
var _this$props = _this.props,
|
|
28
44
|
value = _this$props.value,
|
|
29
45
|
options = _this$props.options;
|
|
@@ -33,38 +49,38 @@ var MultipleSelectFormatter = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
33
49
|
});
|
|
34
50
|
if (selectedOptions.length === 0) return [];
|
|
35
51
|
return selectedOptions.map(function (option) {
|
|
36
|
-
return /*#__PURE__*/
|
|
37
|
-
key: "multiple-"
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_SelectItem.default, {
|
|
53
|
+
key: "multiple-" + option.id,
|
|
38
54
|
option: option
|
|
39
55
|
});
|
|
40
56
|
});
|
|
41
|
-
};
|
|
42
|
-
|
|
57
|
+
});
|
|
43
58
|
return _this;
|
|
44
59
|
}
|
|
45
60
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (!value || Array.isArray(value) && value.length === 0) {
|
|
55
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className: classname
|
|
57
|
-
});
|
|
58
|
-
}
|
|
61
|
+
var _proto = MultipleSelectFormatter.prototype;
|
|
62
|
+
|
|
63
|
+
_proto.render = function render() {
|
|
64
|
+
var _this$props2 = this.props,
|
|
65
|
+
value = _this$props2.value,
|
|
66
|
+
containerClassName = _this$props2.containerClassName;
|
|
67
|
+
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container multiple-select-formatter', containerClassName);
|
|
59
68
|
|
|
60
|
-
|
|
61
|
-
return /*#__PURE__*/
|
|
69
|
+
if (!value || Array.isArray(value) && value.length === 0) {
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
62
71
|
className: classname
|
|
63
|
-
}
|
|
72
|
+
});
|
|
64
73
|
}
|
|
65
|
-
|
|
74
|
+
|
|
75
|
+
var options = this.getOptions();
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
className: classname
|
|
78
|
+
}, options);
|
|
79
|
+
};
|
|
66
80
|
|
|
67
81
|
return MultipleSelectFormatter;
|
|
68
|
-
}(
|
|
82
|
+
}(_react.default.PureComponent);
|
|
69
83
|
|
|
70
|
-
|
|
84
|
+
MultipleSelectFormatter.propTypes = propTypes;
|
|
85
|
+
var _default = MultipleSelectFormatter;
|
|
86
|
+
exports.default = _default;
|
|
@@ -1,47 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import cn from 'astro-classname';
|
|
7
|
-
import { getNumberDisplayString } from '../utils/value-format-utils';
|
|
8
|
-
import './index.css';
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
10
|
-
var
|
|
11
|
-
_inherits(NumberFormatter, _React$Component);
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
12
4
|
|
|
13
|
-
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports.default = void 0;
|
|
14
7
|
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
var _astroClassname = _interopRequireDefault(require("astro-classname"));
|
|
17
|
+
|
|
18
|
+
var _valueFormatUtils = require("../utils/value-format-utils");
|
|
19
|
+
|
|
20
|
+
require("./index.css");
|
|
21
|
+
|
|
22
|
+
var propTypes = {
|
|
23
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
24
|
+
data: _propTypes.default.object,
|
|
25
|
+
containerClassName: _propTypes.default.string
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var NumberFormatter = /*#__PURE__*/function (_React$Component) {
|
|
29
|
+
(0, _inheritsLoose2.default)(NumberFormatter, _React$Component);
|
|
30
|
+
|
|
31
|
+
function NumberFormatter() {
|
|
32
|
+
return _React$Component.apply(this, arguments) || this;
|
|
19
33
|
}
|
|
20
34
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: classname
|
|
36
|
-
}, number);
|
|
35
|
+
var _proto = NumberFormatter.prototype;
|
|
36
|
+
|
|
37
|
+
_proto.render = function render() {
|
|
38
|
+
var _this$props = this.props,
|
|
39
|
+
number = _this$props.value,
|
|
40
|
+
data = _this$props.data,
|
|
41
|
+
containerClassName = _this$props.containerClassName;
|
|
42
|
+
var classname = (0, _astroClassname.default)('dtable-ui cell-formatter-container number-formatter', containerClassName);
|
|
43
|
+
|
|
44
|
+
if (number || number === 0) {
|
|
45
|
+
number = (0, _valueFormatUtils.getNumberDisplayString)(number, data);
|
|
37
46
|
}
|
|
38
|
-
|
|
47
|
+
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
+
className: classname
|
|
50
|
+
}, number);
|
|
51
|
+
};
|
|
39
52
|
|
|
40
53
|
return NumberFormatter;
|
|
41
|
-
}(
|
|
54
|
+
}(_react.default.Component);
|
|
42
55
|
|
|
43
|
-
NumberFormatter
|
|
56
|
+
(0, _defineProperty2.default)(NumberFormatter, "defaultProps", {
|
|
44
57
|
value: '',
|
|
45
58
|
containerClassName: ''
|
|
46
|
-
};
|
|
47
|
-
|
|
59
|
+
});
|
|
60
|
+
NumberFormatter.propTypes = propTypes;
|
|
61
|
+
var _default = NumberFormatter;
|
|
62
|
+
exports.default = _default;
|