dtable-ui-component 0.2.7 → 0.2.8-beta

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.
Files changed (109) hide show
  1. package/lib/DTableRadio/index.css +14 -2
  2. package/lib/DTableRadio/index.js +7 -5
  3. package/package.json +1 -1
  4. package/es/app.css +0 -20
  5. package/es/app.js +0 -91
  6. package/es/assets/images/avatar/default_avatar.png +0 -0
  7. package/es/assets/images/file/192/excel.png +0 -0
  8. package/es/assets/images/file/192/file.png +0 -0
  9. package/es/assets/images/file/192/music.png +0 -0
  10. package/es/assets/images/file/192/pdf.png +0 -0
  11. package/es/assets/images/file/192/pic.png +0 -0
  12. package/es/assets/images/file/192/ppt.png +0 -0
  13. package/es/assets/images/file/192/txt.png +0 -0
  14. package/es/assets/images/file/192/video.png +0 -0
  15. package/es/assets/images/file/192/word.png +0 -0
  16. package/es/assets/images/file/24/excel.png +0 -0
  17. package/es/assets/images/file/24/file.png +0 -0
  18. package/es/assets/images/file/24/music.png +0 -0
  19. package/es/assets/images/file/24/pdf.png +0 -0
  20. package/es/assets/images/file/24/pic.png +0 -0
  21. package/es/assets/images/file/24/ppt.png +0 -0
  22. package/es/assets/images/file/24/txt.png +0 -0
  23. package/es/assets/images/file/24/video.png +0 -0
  24. package/es/assets/images/file/24/word.png +0 -0
  25. package/es/assets/images/folder/folder-192.png +0 -0
  26. package/es/assets/images/folder/folder-24.png +0 -0
  27. package/es/components/cell-editor/checkbox-editor.js +0 -104
  28. package/es/components/cell-editor/collaborator-editor.js +0 -236
  29. package/es/components/cell-editor/date-editor.js +0 -151
  30. package/es/components/cell-editor/index.js +0 -9
  31. package/es/components/cell-editor/link-editor.js +0 -303
  32. package/es/components/cell-editor/multiple-select-editor.js +0 -237
  33. package/es/components/cell-editor/number-editor.js +0 -154
  34. package/es/components/cell-editor/single-select-editor.js +0 -202
  35. package/es/components/cell-editor/text-editor.js +0 -122
  36. package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +0 -46
  37. package/es/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
  38. package/es/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
  39. package/es/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
  40. package/es/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
  41. package/es/components/cell-editor-popover/mb-collaborator-editor-popover.js +0 -177
  42. package/es/components/cell-editor-popover/mb-date-editor-popover.js +0 -245
  43. package/es/components/cell-editor-popover/mb-link-editor-popover.js +0 -170
  44. package/es/components/cell-editor-popover/mb-select-editor-popover.js +0 -230
  45. package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +0 -109
  46. package/es/components/cell-editor-popover/pc-date-editor-popover.js +0 -142
  47. package/es/components/cell-editor-popover/pc-link-editor-popover.js +0 -114
  48. package/es/components/cell-editor-popover/pc-select-editor-popover.js +0 -143
  49. package/es/components/cell-factory/cell-formatter-factory.js +0 -25
  50. package/es/components/cell-formatter/auto-number-formatter.js +0 -35
  51. package/es/components/cell-formatter/button-formatter.js +0 -55
  52. package/es/components/cell-formatter/checkbox-formatter.js +0 -44
  53. package/es/components/cell-formatter/collaborator-formatter.js +0 -91
  54. package/es/components/cell-formatter/creator-formatter.js +0 -87
  55. package/es/components/cell-formatter/ctime-formatter.js +0 -57
  56. package/es/components/cell-formatter/date-formatter.js +0 -59
  57. package/es/components/cell-formatter/duration-formatter.js +0 -37
  58. package/es/components/cell-formatter/email-formatter.js +0 -35
  59. package/es/components/cell-formatter/file-formatter.js +0 -63
  60. package/es/components/cell-formatter/formatter-config.js +0 -31
  61. package/es/components/cell-formatter/formula-formatter.js +0 -173
  62. package/es/components/cell-formatter/geolocation-formatter.js +0 -49
  63. package/es/components/cell-formatter/image-formatter.js +0 -153
  64. package/es/components/cell-formatter/index.js +0 -26
  65. package/es/components/cell-formatter/last-modifier-formatter.js +0 -87
  66. package/es/components/cell-formatter/link-formatter.js +0 -144
  67. package/es/components/cell-formatter/long-text-formatter.js +0 -106
  68. package/es/components/cell-formatter/mtime-formatter.js +0 -57
  69. package/es/components/cell-formatter/multiple-select-formatter.js +0 -70
  70. package/es/components/cell-formatter/number-formatter.js +0 -46
  71. package/es/components/cell-formatter/rate-formatter.js +0 -74
  72. package/es/components/cell-formatter/single-select-formatter.js +0 -69
  73. package/es/components/cell-formatter/text-formatter.js +0 -35
  74. package/es/components/cell-formatter/url-formatter.js +0 -35
  75. package/es/components/cell-formatter/widgets/file-item-formatter.js +0 -50
  76. package/es/components/cell-formatter/widgets/image-previewer-lightbox.js +0 -119
  77. package/es/components/common/collaborator-item.js +0 -63
  78. package/es/components/common/edit-editor-button.js +0 -56
  79. package/es/components/common/images-lazy-load.js +0 -148
  80. package/es/components/common/link-editor-option.js +0 -113
  81. package/es/components/common/mobile/mb-editor-header.js +0 -48
  82. package/es/components/common/modal-portal.js +0 -44
  83. package/es/components/common/select-editor-option.js +0 -106
  84. package/es/components/common/select-item.js +0 -58
  85. package/es/components/file-uploader/index.js +0 -53
  86. package/es/components/loading.js +0 -7
  87. package/es/components/toast/alert.js +0 -150
  88. package/es/components/toast/index.js +0 -3
  89. package/es/components/toast/toast.js +0 -179
  90. package/es/components/toast/toastManager.js +0 -170
  91. package/es/components/toast/toaster.js +0 -76
  92. package/es/css/cell-editor.css +0 -614
  93. package/es/css/cell-formatter.css +0 -241
  94. package/es/css/custom-rc-calendar.css +0 -118
  95. package/es/css/image-previewer-ligntbox.css +0 -87
  96. package/es/css/loading.css +0 -54
  97. package/es/index.js +0 -5
  98. package/es/lang/index.js +0 -50
  99. package/es/locals/de.js +0 -2
  100. package/es/locals/en.js +0 -17
  101. package/es/locals/fr.js +0 -2
  102. package/es/locals/zh-CN.js +0 -17
  103. package/es/utils/cell-types.js +0 -25
  104. package/es/utils/constants.js +0 -41
  105. package/es/utils/editor-utils.js +0 -71
  106. package/es/utils/normalize-long-text-value.js +0 -68
  107. package/es/utils/number-precision.js +0 -163
  108. package/es/utils/utils.js +0 -116
  109. package/es/utils/value-format-utils.js +0 -281
@@ -1,143 +0,0 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
- import React from 'react';
7
- import { getLocale } from '../../lang';
8
-
9
- var PCSelectEditorPopover = /*#__PURE__*/function (_React$Component) {
10
- _inherits(PCSelectEditorPopover, _React$Component);
11
-
12
- var _super = _createSuper(PCSelectEditorPopover);
13
-
14
- function PCSelectEditorPopover(props) {
15
- var _this;
16
-
17
- _classCallCheck(this, PCSelectEditorPopover);
18
-
19
- _this = _super.call(this, props);
20
-
21
- _this.onValueChanged = function (event) {
22
- var value = event.target.value;
23
-
24
- _this.setState({
25
- searchValue: value
26
- });
27
- };
28
-
29
- _this.onInputClick = function (event) {
30
- event.nativeEvent.stopImmediatePropagation();
31
- event.stopPropagation();
32
- };
33
-
34
- _this.onAddNewOption = function () {
35
- var name = _this.state.searchValue.trim();
36
-
37
- _this.props.onAddNewOption(name);
38
- };
39
-
40
- _this.onOptionItemToggle = function (item) {
41
- _this.props.onOptionItemToggle(item);
42
- };
43
-
44
- _this.getFilterOptions = function () {
45
- var options = _this.props.options;
46
-
47
- var filter = _this.state.searchValue.toLowerCase();
48
-
49
- if (!filter) {
50
- return options;
51
- }
52
-
53
- return options.filter(function (option) {
54
- return option.name.toString().toLowerCase().indexOf(filter) > -1;
55
- });
56
- };
57
-
58
- _this.getOptionStyle = function (option) {
59
- var textColor = option.textColor || null;
60
- return {
61
- display: 'inline-block',
62
- padding: '0px 10px',
63
- height: '20px',
64
- lineHeight: '20px',
65
- borderRadius: '10px',
66
- fontSize: '13px',
67
- backgroundColor: option.color,
68
- color: textColor
69
- };
70
- };
71
-
72
- _this.state = {
73
- searchValue: ''
74
- };
75
- return _this;
76
- }
77
-
78
- _createClass(PCSelectEditorPopover, [{
79
- key: "render",
80
- value: function render() {
81
- var _this2 = this;
82
-
83
- var options = this.getFilterOptions();
84
- var _this$props = this.props,
85
- popoverPosition = _this$props.popoverPosition,
86
- selectedOptions = _this$props.selectedOptions,
87
- isSupportNewOption = _this$props.isSupportNewOption;
88
- var searchValue = this.state.searchValue;
89
- var popoverStyle = Object.assign({}, _objectSpread({}, popoverPosition), {
90
- position: 'absolute'
91
- });
92
- return /*#__PURE__*/React.createElement("div", {
93
- className: "dtable-ui-editor-popover dtable-ui-select-editor-popover",
94
- style: popoverStyle
95
- }, /*#__PURE__*/React.createElement("div", {
96
- className: "select-options-search"
97
- }, /*#__PURE__*/React.createElement("input", {
98
- className: "form-control",
99
- onChange: this.onValueChanged,
100
- onClick: this.onInputClick,
101
- placeholder: getLocale('Find_an_option')
102
- })), /*#__PURE__*/React.createElement("div", {
103
- className: "select-options-container"
104
- }, options.length > 0 && options.map(function (option, index) {
105
- var optionStyle = _this2.getOptionStyle(option);
106
-
107
- var isSelect = selectedOptions.some(function (selectedOption) {
108
- return selectedOption.id === option.id;
109
- });
110
- return /*#__PURE__*/React.createElement("div", {
111
- key: index,
112
- className: "select-option-item",
113
- onClick: _this2.onOptionItemToggle.bind(_this2, option)
114
- }, /*#__PURE__*/React.createElement("div", {
115
- className: "option-info"
116
- }, /*#__PURE__*/React.createElement("div", {
117
- className: "option-name",
118
- style: optionStyle
119
- }, option.name)), /*#__PURE__*/React.createElement("div", {
120
- className: "option-checked"
121
- }, isSelect && /*#__PURE__*/React.createElement("i", {
122
- className: "dtable-font dtable-icon-check-mark"
123
- })));
124
- }), options.length === 0 && /*#__PURE__*/React.createElement("div", {
125
- className: "search-option-null"
126
- }, getLocale('No_options_available'))), isSupportNewOption && !!searchValue && /*#__PURE__*/React.createElement("div", {
127
- className: "select-options-add",
128
- onClick: this.onAddNewOption
129
- }, /*#__PURE__*/React.createElement("i", {
130
- className: "dtable-font dtable-icon-add-table"
131
- }), /*#__PURE__*/React.createElement("span", null, getLocale('Add_an_option'), ' ', searchValue)));
132
- }
133
- }]);
134
-
135
- return PCSelectEditorPopover;
136
- }(React.Component);
137
-
138
- PCSelectEditorPopover.defaultProps = {
139
- popoverPosition: {},
140
- options: [],
141
- isShowAddBtn: false
142
- };
143
- export default PCSelectEditorPopover;
@@ -1,25 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import FormatterConfig from '../cell-formatter/formatter-config';
4
-
5
- var CellFormatterFactory = /*#__PURE__*/function () {
6
- function CellFormatterFactory() {
7
- _classCallCheck(this, CellFormatterFactory);
8
- }
9
-
10
- _createClass(CellFormatterFactory, [{
11
- key: "createFormatter",
12
- value: function createFormatter(formatterType) {
13
- if (FormatterConfig[formatterType]) {
14
- return FormatterConfig[formatterType];
15
- }
16
-
17
- return null;
18
- }
19
- }]);
20
-
21
- return CellFormatterFactory;
22
- }();
23
-
24
- var cellFormatterFactory = new CellFormatterFactory();
25
- export default cellFormatterFactory;
@@ -1,35 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
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
-
8
- var AutoNumberFormatter = /*#__PURE__*/function (_React$Component) {
9
- _inherits(AutoNumberFormatter, _React$Component);
10
-
11
- var _super = _createSuper(AutoNumberFormatter);
12
-
13
- function AutoNumberFormatter() {
14
- _classCallCheck(this, AutoNumberFormatter);
15
-
16
- return _super.apply(this, arguments);
17
- }
18
-
19
- _createClass(AutoNumberFormatter, [{
20
- key: "render",
21
- value: function render() {
22
- var _this$props = this.props,
23
- containerClassName = _this$props.containerClassName,
24
- value = _this$props.value;
25
- var classname = cn('dtable-ui cell-formatter-container auto-number-formatter', containerClassName);
26
- return /*#__PURE__*/React.createElement("div", {
27
- className: classname
28
- }, value);
29
- }
30
- }]);
31
-
32
- return AutoNumberFormatter;
33
- }(React.Component);
34
-
35
- export default AutoNumberFormatter;
@@ -1,55 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
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
-
8
- var ButtonFormatter = /*#__PURE__*/function (_React$Component) {
9
- _inherits(ButtonFormatter, _React$Component);
10
-
11
- var _super = _createSuper(ButtonFormatter);
12
-
13
- function ButtonFormatter() {
14
- _classCallCheck(this, ButtonFormatter);
15
-
16
- return _super.apply(this, arguments);
17
- }
18
-
19
- _createClass(ButtonFormatter, [{
20
- key: "render",
21
- value: function render() {
22
- var _this$props = this.props,
23
- data = _this$props.data,
24
- containerClassName = _this$props.containerClassName,
25
- optionColors = _this$props.optionColors;
26
-
27
- var _ref = data || {},
28
- button_color = _ref.button_color,
29
- button_type = _ref.button_type,
30
- button_name = _ref.button_name;
31
-
32
- if (!button_type) return null;
33
- var colorOption = Array.isArray(optionColors) ? optionColors.find(function (item) {
34
- return item.COLOR === button_color;
35
- }) || optionColors[0] : {
36
- COLOR: '#FFFCB5',
37
- BORDER_COLOR: '#E8E79D',
38
- TEXT_COLOR: '#202428'
39
- };
40
- var btnStyle = {
41
- backgroundColor: colorOption.COLOR,
42
- borderColor: colorOption.BORDER_COLOR,
43
- color: colorOption.TEXT_COLOR
44
- };
45
- return /*#__PURE__*/React.createElement("div", {
46
- className: cn('dtable-ui cell-formatter-container button-formatter', containerClassName),
47
- style: btnStyle
48
- }, button_name);
49
- }
50
- }]);
51
-
52
- return ButtonFormatter;
53
- }(React.Component);
54
-
55
- export default ButtonFormatter;
@@ -1,44 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
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
-
8
- var CheckboxFormatter = /*#__PURE__*/function (_React$PureComponent) {
9
- _inherits(CheckboxFormatter, _React$PureComponent);
10
-
11
- var _super = _createSuper(CheckboxFormatter);
12
-
13
- function CheckboxFormatter() {
14
- _classCallCheck(this, CheckboxFormatter);
15
-
16
- return _super.apply(this, arguments);
17
- }
18
-
19
- _createClass(CheckboxFormatter, [{
20
- key: "render",
21
- value: function render() {
22
- var _this$props = this.props,
23
- value = _this$props.value,
24
- containerClassName = _this$props.containerClassName;
25
- value = value === true ? true : false;
26
- var classname = cn('dtable-ui cell-formatter-container checkbox-formatter', containerClassName);
27
- return /*#__PURE__*/React.createElement("div", {
28
- className: classname
29
- }, /*#__PURE__*/React.createElement("input", {
30
- className: "checkbox",
31
- type: "checkbox",
32
- readOnly: true,
33
- checked: value
34
- }));
35
- }
36
- }]);
37
-
38
- return CheckboxFormatter;
39
- }(React.PureComponent);
40
-
41
- CheckboxFormatter.defaultProps = {
42
- value: false
43
- };
44
- export default CheckboxFormatter;
@@ -1,91 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
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 CollaboratorItem from '../common/collaborator-item';
8
- import DefaultAvatar from '../../assets/images/avatar/default_avatar.png';
9
-
10
- // there will be there conditions
11
- // 1 value is not exist, typeof value is array, but it's length is 0
12
- // 2 value is exist, but can't find in collaborators
13
- // 3 value is exist, typeof value is a string
14
- // 4 value is exist, typeof value is array
15
- var CollaboratorFormatter = /*#__PURE__*/function (_React$PureComponent) {
16
- _inherits(CollaboratorFormatter, _React$PureComponent);
17
-
18
- var _super = _createSuper(CollaboratorFormatter);
19
-
20
- function CollaboratorFormatter() {
21
- var _this;
22
-
23
- _classCallCheck(this, CollaboratorFormatter);
24
-
25
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
26
- args[_key] = arguments[_key];
27
- }
28
-
29
- _this = _super.call.apply(_super, [this].concat(args));
30
-
31
- _this.getCollaborators = function () {
32
- var _this$props = _this.props,
33
- value = _this$props.value,
34
- collaborators = _this$props.collaborators,
35
- enableDeleteCollaborator = _this$props.enableDeleteCollaborator,
36
- onDeleteCollaborator = _this$props.onDeleteCollaborator;
37
-
38
- if (!Array.isArray(value)) {
39
- value = [value];
40
- }
41
-
42
- return value.map(function (item, index) {
43
- var collaborator = collaborators.find(function (collaborator) {
44
- return collaborator.email === item;
45
- });
46
-
47
- if (!collaborator) {
48
- collaborator = {
49
- name: item,
50
- avatar_url: DefaultAvatar
51
- };
52
- }
53
-
54
- ;
55
- return /*#__PURE__*/React.createElement(CollaboratorItem, {
56
- key: index,
57
- collaborator: collaborator,
58
- enableDeleteCollaborator: enableDeleteCollaborator,
59
- onDeleteCollaborator: onDeleteCollaborator
60
- });
61
- });
62
- };
63
-
64
- return _this;
65
- }
66
-
67
- _createClass(CollaboratorFormatter, [{
68
- key: "render",
69
- value: function render() {
70
- var _this$props2 = this.props,
71
- containerClassName = _this$props2.containerClassName,
72
- value = _this$props2.value;
73
- var classname = cn('dtable-ui cell-formatter-container collaborator-formatter', containerClassName);
74
-
75
- if (!value || Array.isArray(value) && value.length === 0) {
76
- return /*#__PURE__*/React.createElement("div", {
77
- className: classname
78
- });
79
- }
80
-
81
- var collaborators = this.getCollaborators();
82
- return /*#__PURE__*/React.createElement("div", {
83
- className: classname
84
- }, collaborators);
85
- }
86
- }]);
87
-
88
- return CollaboratorFormatter;
89
- }(React.PureComponent);
90
-
91
- export default CollaboratorFormatter;
@@ -1,87 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
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 ColloboratorItem from '../common/collaborator-item';
8
- import DefaultAvatar from '../../assets/images/avatar/default_avatar.png';
9
-
10
- // there will be there conditions
11
- // 1 value is not exist, typeof value is array, but it's length is 0
12
- // 2 value is exist, but can't find in collaborators
13
- // 3 value is exist, typeof value is a string
14
- // 4 vlaue is exist, typeof value is array
15
- var CreatorFormatter = /*#__PURE__*/function (_React$PureComponent) {
16
- _inherits(CreatorFormatter, _React$PureComponent);
17
-
18
- var _super = _createSuper(CreatorFormatter);
19
-
20
- function CreatorFormatter() {
21
- var _this;
22
-
23
- _classCallCheck(this, CreatorFormatter);
24
-
25
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
26
- args[_key] = arguments[_key];
27
- }
28
-
29
- _this = _super.call.apply(_super, [this].concat(args));
30
-
31
- _this.getCollaborators = function () {
32
- var _this$props = _this.props,
33
- value = _this$props.value,
34
- collaborators = _this$props.collaborators;
35
-
36
- if (!Array.isArray(value)) {
37
- value = [value];
38
- }
39
-
40
- return value.map(function (item, index) {
41
- var collaborator = collaborators.find(function (collaborator) {
42
- return collaborator.email === item;
43
- }); // the collaborator can be not exist, beacuse the row created by third app
44
-
45
- if (!collaborator) {
46
- collaborator = {
47
- name: item,
48
- avatar_url: DefaultAvatar
49
- };
50
- }
51
-
52
- ;
53
- return /*#__PURE__*/React.createElement(ColloboratorItem, {
54
- key: index,
55
- collaborator: collaborator
56
- });
57
- });
58
- };
59
-
60
- return _this;
61
- }
62
-
63
- _createClass(CreatorFormatter, [{
64
- key: "render",
65
- value: function render() {
66
- var _this$props2 = this.props,
67
- containerClassName = _this$props2.containerClassName,
68
- value = _this$props2.value;
69
- var classname = cn('dtable-ui cell-formatter-container creator-formatter', containerClassName);
70
-
71
- if (!value || Array.isArray(value) && value.length === 0) {
72
- return /*#__PURE__*/React.createElement("div", {
73
- className: classname
74
- });
75
- }
76
-
77
- var collaborators = this.getCollaborators();
78
- return /*#__PURE__*/React.createElement("div", {
79
- className: classname
80
- }, collaborators);
81
- }
82
- }]);
83
-
84
- return CreatorFormatter;
85
- }(React.PureComponent);
86
-
87
- export default CreatorFormatter;
@@ -1,57 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
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
-
9
- var CTimeFormatter = /*#__PURE__*/function (_React$Component) {
10
- _inherits(CTimeFormatter, _React$Component);
11
-
12
- var _super = _createSuper(CTimeFormatter);
13
-
14
- function CTimeFormatter() {
15
- var _this;
16
-
17
- _classCallCheck(this, CTimeFormatter);
18
-
19
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
20
- args[_key] = arguments[_key];
21
- }
22
-
23
- _this = _super.call.apply(_super, [this].concat(args));
24
-
25
- _this.formatDate = function (date) {
26
- return moment(date).format('YYYY-MM-DD HH:mm:ss');
27
- };
28
-
29
- return _this;
30
- }
31
-
32
- _createClass(CTimeFormatter, [{
33
- key: "render",
34
- value: function render() {
35
- var _this$props = this.props,
36
- date = _this$props.value,
37
- containerClassName = _this$props.containerClassName;
38
- var classname = cn('dtable-ui cell-formatter-container ctime-formatter', containerClassName);
39
-
40
- if (date !== '') {
41
- date = this.formatDate(date);
42
- }
43
-
44
- return /*#__PURE__*/React.createElement("div", {
45
- className: classname
46
- }, date);
47
- }
48
- }]);
49
-
50
- return CTimeFormatter;
51
- }(React.Component);
52
-
53
- CTimeFormatter.defaultProps = {
54
- value: '',
55
- containerClassName: ''
56
- };
57
- export default CTimeFormatter;
@@ -1,59 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
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 { formatDateToString } from '../../utils/value-format-utils';
8
-
9
- var DateFormatter = /*#__PURE__*/function (_React$Component) {
10
- _inherits(DateFormatter, _React$Component);
11
-
12
- var _super = _createSuper(DateFormatter);
13
-
14
- function DateFormatter() {
15
- var _this;
16
-
17
- _classCallCheck(this, DateFormatter);
18
-
19
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
20
- args[_key] = arguments[_key];
21
- }
22
-
23
- _this = _super.call.apply(_super, [this].concat(args));
24
-
25
- _this.formatDate = function (date, format) {
26
- return formatDateToString(date, format);
27
- };
28
-
29
- return _this;
30
- }
31
-
32
- _createClass(DateFormatter, [{
33
- key: "render",
34
- value: function render() {
35
- var _this$props = this.props,
36
- date = _this$props.value,
37
- format = _this$props.format,
38
- containerClassName = _this$props.containerClassName;
39
- var classname = cn('dtable-ui cell-formatter-container date-formatter', containerClassName);
40
-
41
- if (date !== '') {
42
- date = this.formatDate(date, format);
43
- }
44
-
45
- return /*#__PURE__*/React.createElement("div", {
46
- className: classname
47
- }, date);
48
- }
49
- }]);
50
-
51
- return DateFormatter;
52
- }(React.Component);
53
-
54
- DateFormatter.defaultProps = {
55
- value: '',
56
- format: 'YYYY-MM-DD',
57
- containerClassName: ''
58
- };
59
- export default DateFormatter;
@@ -1,37 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
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 { getDurationDisplayString } from '../../utils/value-format-utils';
8
-
9
- var DurationFormatter = /*#__PURE__*/function (_React$Component) {
10
- _inherits(DurationFormatter, _React$Component);
11
-
12
- var _super = _createSuper(DurationFormatter);
13
-
14
- function DurationFormatter() {
15
- _classCallCheck(this, DurationFormatter);
16
-
17
- return _super.apply(this, arguments);
18
- }
19
-
20
- _createClass(DurationFormatter, [{
21
- key: "render",
22
- value: function render() {
23
- var _this$props = this.props,
24
- value = _this$props.value,
25
- containerClassName = _this$props.containerClassName,
26
- format = _this$props.format;
27
- var classname = cn('dtable-ui cell-formatter-container duration-formatter', containerClassName);
28
- return /*#__PURE__*/React.createElement("div", {
29
- className: classname
30
- }, getDurationDisplayString(value, format));
31
- }
32
- }]);
33
-
34
- return DurationFormatter;
35
- }(React.Component);
36
-
37
- export default DurationFormatter;
@@ -1,35 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
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
-
8
- var EmailFormatter = /*#__PURE__*/function (_React$Component) {
9
- _inherits(EmailFormatter, _React$Component);
10
-
11
- var _super = _createSuper(EmailFormatter);
12
-
13
- function EmailFormatter() {
14
- _classCallCheck(this, EmailFormatter);
15
-
16
- return _super.apply(this, arguments);
17
- }
18
-
19
- _createClass(EmailFormatter, [{
20
- key: "render",
21
- value: function render() {
22
- var _this$props = this.props,
23
- containerClassName = _this$props.containerClassName,
24
- value = _this$props.value;
25
- var classname = cn('dtable-ui cell-formatter-container email-formatter', containerClassName);
26
- return /*#__PURE__*/React.createElement("div", {
27
- className: classname
28
- }, value);
29
- }
30
- }]);
31
-
32
- return EmailFormatter;
33
- }(React.Component);
34
-
35
- export default EmailFormatter;