dtable-ui-component 4.3.6 → 4.3.8

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 (122) hide show
  1. package/lib/AutoNumberFormatter/index.js +11 -24
  2. package/lib/ButtonFormatter/index.js +29 -45
  3. package/lib/CTimeFormatter/index.js +17 -32
  4. package/lib/CheckboxEditor/index.js +42 -49
  5. package/lib/CheckboxFormatter/index.js +17 -30
  6. package/lib/CollaboratorEditor/index.js +118 -135
  7. package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +90 -99
  8. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +61 -69
  9. package/lib/CollaboratorFormatter/index.js +26 -42
  10. package/lib/CollaboratorItem/index.js +31 -44
  11. package/lib/CreatorFormatter/index.js +24 -40
  12. package/lib/DTableCustomizeCollaboratorSelect/index.js +80 -99
  13. package/lib/DTableCustomizeCollaboratorSelect/utils.js +12 -13
  14. package/lib/DTableCustomizeSelect/index.css +22 -59
  15. package/lib/DTableCustomizeSelect/index.js +99 -95
  16. package/lib/DTablePopover/index.js +52 -71
  17. package/lib/DTablePopover/utils.js +1 -1
  18. package/lib/DTableRadio/index.js +9 -7
  19. package/lib/DTableSearchInput/index.js +89 -99
  20. package/lib/DTableSearchInput/utils.js +2 -2
  21. package/lib/DTableSelect/dtable-select-label.js +5 -3
  22. package/lib/DTableSelect/index.js +50 -64
  23. package/lib/DTableSelect/utils.js +36 -41
  24. package/lib/DTableSwitch/index.js +7 -5
  25. package/lib/DateEditor/index.js +88 -94
  26. package/lib/DateEditor/mb-date-editor-popover/index.js +136 -134
  27. package/lib/DateEditor/pc-date-editor-popover.js +70 -77
  28. package/lib/DateFormatter/index.js +15 -28
  29. package/lib/DepartmentSingleSelectFormatter/index.js +9 -9
  30. package/lib/DigitalSignFormatter/index.js +55 -65
  31. package/lib/DigitalSignFormatter/utils.js +9 -8
  32. package/lib/DurationFormatter/index.js +14 -27
  33. package/lib/EditEditorButton/index.js +10 -22
  34. package/lib/EmailFormatter/index.js +11 -24
  35. package/lib/FieldDisplaySetting/field-item.js +18 -20
  36. package/lib/FieldDisplaySetting/index.js +41 -43
  37. package/lib/FileEditor/index.js +18 -29
  38. package/lib/FileFormatter/index.js +29 -43
  39. package/lib/FileItemFormatter/index.js +17 -32
  40. package/lib/FileItemFormatter/utils.js +5 -5
  41. package/lib/FileUploader/index.js +20 -33
  42. package/lib/FormulaFormatter/cell-value-validator.js +23 -8
  43. package/lib/FormulaFormatter/index.js +77 -83
  44. package/lib/FormulaFormatter/utils.js +27 -21
  45. package/lib/GeolocationFormatter/index.js +19 -32
  46. package/lib/HtmlLongTextFormatter/index.js +43 -52
  47. package/lib/HtmlLongTextFormatter/markdown2html.js +2 -2
  48. package/lib/HtmlLongTextFormatter/unified/index.js +1 -1
  49. package/lib/HtmlLongTextFormatter/vfile/core.js +10 -10
  50. package/lib/ImageFormatter/images-lazy-load.js +71 -79
  51. package/lib/ImageFormatter/index.js +86 -97
  52. package/lib/ImageFormatter/utils.js +1 -1
  53. package/lib/ImagePreviewerLightbox/index.js +20 -18
  54. package/lib/ImagePreviewerLightbox/utils.js +3 -3
  55. package/lib/LastModifierFormatter/index.js +24 -40
  56. package/lib/LinkEditor/index.js +163 -167
  57. package/lib/LinkEditor/link-editor-option.js +41 -56
  58. package/lib/LinkEditor/mb-link-editor-popover/index.js +90 -99
  59. package/lib/LinkEditor/pc-link-editor-popover/index.js +63 -71
  60. package/lib/LinkFormatter/index.js +75 -77
  61. package/lib/LongTextFormatter/index.js +5 -3
  62. package/lib/MBEditorHeader/index.js +25 -38
  63. package/lib/MTimeFormatter/index.js +17 -32
  64. package/lib/ModalPortal/index.js +15 -32
  65. package/lib/MultipleSelectEditor/index.js +118 -136
  66. package/lib/MultipleSelectFormatter/index.js +24 -40
  67. package/lib/NotificationPopover/index.js +68 -95
  68. package/lib/NumberEditor/index.js +75 -82
  69. package/lib/NumberFormatter/index.js +15 -28
  70. package/lib/RateFormatter/index.js +29 -45
  71. package/lib/RoleStatusEditor/index.js +20 -22
  72. package/lib/RowExpandEmailFormatter/index.js +24 -37
  73. package/lib/RowExpandFileFormatter/index.js +28 -42
  74. package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +66 -82
  75. package/lib/RowExpandFormatter/index.js +92 -96
  76. package/lib/RowExpandFormulaFormatter/index.js +85 -91
  77. package/lib/RowExpandImageFormatter/index.js +65 -82
  78. package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +71 -84
  79. package/lib/RowExpandImageFormatter/utils.js +1 -1
  80. package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +54 -68
  81. package/lib/RowExpandLinkFormatter/index.js +131 -137
  82. package/lib/RowExpandLinkFormatter/utils.js +23 -17
  83. package/lib/RowExpandLinkFormatter/value-display-utils.js +9 -7
  84. package/lib/RowExpandRateFormatter/index.js +27 -42
  85. package/lib/RowExpandUrlFormatter/index.js +27 -40
  86. package/lib/SelectItem/index.js +17 -33
  87. package/lib/SelectOptionGroup/index.css +103 -0
  88. package/lib/SelectOptionGroup/index.js +157 -135
  89. package/lib/SelectOptionGroup/option.js +31 -38
  90. package/lib/SimpleLongTextFormatter/index.js +55 -67
  91. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +23 -22
  92. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +42 -57
  93. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +31 -46
  94. package/lib/SingleSelectEditor/index.js +108 -119
  95. package/lib/SingleSelectFormatter/index.js +21 -37
  96. package/lib/TextEditor/index.js +45 -51
  97. package/lib/TextFormatter/index.js +17 -32
  98. package/lib/UrlFormatter/index.js +11 -24
  99. package/lib/cellFormatterFactory/index.js +8 -17
  100. package/lib/common/ClickOutside.js +28 -0
  101. package/lib/common/delete-tip.js +40 -65
  102. package/lib/common/modal-portal.js +15 -33
  103. package/lib/constants/index.js +5 -5
  104. package/lib/data/dtable-value.js +4 -4
  105. package/lib/formatterConfig/base-formatter-config.js +24 -3
  106. package/lib/formatterConfig/index.js +5 -4
  107. package/lib/lang/index.js +6 -6
  108. package/lib/locals/de.js +1 -1
  109. package/lib/locals/en.js +1 -1
  110. package/lib/locals/fr.js +1 -1
  111. package/lib/locals/zh-CN.js +1 -1
  112. package/lib/select-editor/mb-select-editor-popover/index.js +126 -137
  113. package/lib/select-editor/pc-select-editor-popover/index.js +75 -83
  114. package/lib/select-editor/select-editor-option.js +41 -56
  115. package/lib/toaster/alert.js +73 -88
  116. package/lib/toaster/index.js +1 -1
  117. package/lib/toaster/toast.js +75 -102
  118. package/lib/toaster/toastManager.js +55 -91
  119. package/lib/toaster/toaster.js +58 -57
  120. package/lib/utils/editor-utils.js +17 -19
  121. package/lib/utils/utils.js +14 -14
  122. package/package.json +4 -4
@@ -1,7 +1,3 @@
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
1
  import React from 'react';
6
2
  import dayjs from 'dayjs';
7
3
  import DatePicker from '@seafile/seafile-calendar/lib/Picker';
@@ -9,53 +5,51 @@ import Calendar from '@seafile/seafile-calendar';
9
5
  import { initDateEditorLanguage } from '../utils/editor-utils';
10
6
  import '@seafile/seafile-calendar/assets/index.css';
11
7
  import { getLocale } from '../lang';
12
- var PCDateEditorPopover = /*#__PURE__*/function (_React$Component) {
13
- _inherits(PCDateEditorPopover, _React$Component);
14
- var _super = _createSuper(PCDateEditorPopover);
15
- function PCDateEditorPopover(props) {
16
- var _this;
17
- _classCallCheck(this, PCDateEditorPopover);
18
- _this = _super.call(this, props);
8
+ class PCDateEditorPopover extends React.Component {
9
+ constructor(props) {
10
+ super(props);
19
11
  // event trigger sequence: onOpenChange --> onChange
20
- _this.onChange = function (value) {
12
+ this.onChange = value => {
21
13
  if (!value) return;
22
- var dateFormat = _this.props.dateFormat;
23
- _this.setState({
14
+ let {
15
+ dateFormat
16
+ } = this.props;
17
+ this.setState({
24
18
  datePickerValue: value,
25
19
  open: true // if value changed, don't close datePicker
26
20
  });
27
-
28
- _this.props.onValueChanged(value.format(dateFormat));
21
+ this.props.onValueChanged(value.format(dateFormat));
29
22
  };
30
- _this.onOpenChange = function (open) {
31
- _this.setState({
23
+ this.onOpenChange = open => {
24
+ this.setState({
32
25
  open: open
33
26
  });
34
27
  return;
35
28
  };
36
- _this.onClear = function () {
37
- _this.setState({
29
+ this.onClear = () => {
30
+ this.setState({
38
31
  datePickerValue: null
39
32
  });
40
33
  };
41
- _this.onFocusDatePicker = function () {
42
- _this.setState({
34
+ this.onFocusDatePicker = () => {
35
+ this.setState({
43
36
  open: true
44
37
  });
45
38
  };
46
- _this.handleMouseDown = function (event) {
39
+ this.handleMouseDown = event => {
47
40
  event.preventDefault();
48
41
  event.stopPropagation();
49
42
  };
50
- _this.getCalendarContainer = function () {
51
- return _this.calendarContainerRef.current;
43
+ this.getCalendarContainer = () => {
44
+ return this.calendarContainerRef.current;
52
45
  };
53
- _this.getCalender = function () {
54
- var _this$props = _this.props,
55
- dateFormat = _this$props.dateFormat,
56
- showHourAndMinute = _this$props.showHourAndMinute,
57
- lang = _this$props.lang;
58
- var defaultValue = dayjs().clone();
46
+ this.getCalender = () => {
47
+ let {
48
+ dateFormat,
49
+ showHourAndMinute,
50
+ lang
51
+ } = this.props;
52
+ let defaultValue = dayjs().clone();
59
53
  return /*#__PURE__*/React.createElement(Calendar, {
60
54
  locale: initDateEditorLanguage(lang),
61
55
  style: {
@@ -67,56 +61,55 @@ var PCDateEditorPopover = /*#__PURE__*/function (_React$Component) {
67
61
  dateInputPlaceholder: getLocale('Please_input'),
68
62
  showDateInput: true,
69
63
  focusablePanel: false,
70
- onClear: _this.onClear
64
+ onClear: this.onClear
71
65
  });
72
66
  };
73
- _this.state = {
67
+ this.state = {
74
68
  open: true,
75
69
  datePickerValue: props.value ? dayjs(props.value) : null
76
70
  };
77
- _this.calendarContainerRef = React.createRef();
78
- return _this;
71
+ this.calendarContainerRef = React.createRef();
79
72
  }
80
- _createClass(PCDateEditorPopover, [{
81
- key: "render",
82
- value: function render() {
83
- var _this2 = this;
84
- var dateFormat = this.props.dateFormat;
85
- var _this$state = this.state,
86
- open = _this$state.open,
87
- datePickerValue = _this$state.datePickerValue;
88
- var calendar = this.getCalender();
89
- return /*#__PURE__*/React.createElement(DatePicker, {
90
- open: open,
91
- value: datePickerValue,
92
- animation: "slide-up",
93
- style: {
94
- zIndex: 1001
95
- },
96
- calendar: calendar,
97
- getCalendarContainer: this.getCalendarContainer,
98
- onChange: this.onChange,
99
- onOpenChange: this.onOpenChange
100
- }, function (_ref) {
101
- var value = _ref.value;
102
- value = value && value.format(dateFormat);
103
- return /*#__PURE__*/React.createElement("span", {
104
- className: "dtable-ui-date-editor-container",
105
- tabIndex: "0",
106
- onFocus: _this2.onFocusDatePicker
107
- }, /*#__PURE__*/React.createElement("input", {
108
- readOnly: true,
109
- tabIndex: "-1",
110
- className: "form-control",
111
- placeholder: getLocale('Please_select'),
112
- value: value || '',
113
- onMouseDown: _this2.handleMouseDown
114
- }), /*#__PURE__*/React.createElement("div", {
115
- ref: _this2.calendarContainerRef
116
- }));
117
- });
118
- }
119
- }]);
120
- return PCDateEditorPopover;
121
- }(React.Component);
73
+ render() {
74
+ let {
75
+ dateFormat
76
+ } = this.props;
77
+ let {
78
+ open,
79
+ datePickerValue
80
+ } = this.state;
81
+ const calendar = this.getCalender();
82
+ return /*#__PURE__*/React.createElement(DatePicker, {
83
+ open: open,
84
+ value: datePickerValue,
85
+ animation: "slide-up",
86
+ style: {
87
+ zIndex: 1001
88
+ },
89
+ calendar: calendar,
90
+ getCalendarContainer: this.getCalendarContainer,
91
+ onChange: this.onChange,
92
+ onOpenChange: this.onOpenChange
93
+ }, _ref => {
94
+ let {
95
+ value
96
+ } = _ref;
97
+ value = value && value.format(dateFormat);
98
+ return /*#__PURE__*/React.createElement("span", {
99
+ className: "dtable-ui-date-editor-container",
100
+ tabIndex: "0",
101
+ onFocus: this.onFocusDatePicker
102
+ }, /*#__PURE__*/React.createElement("input", {
103
+ readOnly: true,
104
+ tabIndex: "-1",
105
+ className: "form-control",
106
+ placeholder: getLocale('Please_select'),
107
+ value: value || '',
108
+ onMouseDown: this.handleMouseDown
109
+ }), /*#__PURE__*/React.createElement("div", {
110
+ ref: this.calendarContainerRef
111
+ }));
112
+ });
113
+ }
114
+ }
122
115
  export default PCDateEditorPopover;
@@ -1,36 +1,23 @@
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
1
  import React from 'react';
6
2
  import classnames from 'classnames';
7
3
  import { getDateDisplayString } from 'dtable-utils';
8
4
  import './index.css';
9
- var DateFormatter = /*#__PURE__*/function (_React$Component) {
10
- _inherits(DateFormatter, _React$Component);
11
- var _super = _createSuper(DateFormatter);
12
- function DateFormatter() {
13
- _classCallCheck(this, DateFormatter);
14
- return _super.apply(this, arguments);
15
- }
16
- _createClass(DateFormatter, [{
17
- key: "render",
18
- value: function render() {
19
- var _this$props = this.props,
20
- date = _this$props.value,
21
- format = _this$props.format,
22
- containerClassName = _this$props.containerClassName;
23
- var classname = classnames('dtable-ui cell-formatter-container date-formatter', containerClassName);
24
- if (date !== '') {
25
- date = getDateDisplayString(date, format);
26
- }
27
- return /*#__PURE__*/React.createElement("div", {
28
- className: classname
29
- }, date);
5
+ class DateFormatter extends React.Component {
6
+ render() {
7
+ let {
8
+ value: date,
9
+ format,
10
+ containerClassName
11
+ } = this.props;
12
+ let classname = classnames('dtable-ui cell-formatter-container date-formatter', containerClassName);
13
+ if (date !== '') {
14
+ date = getDateDisplayString(date, format);
30
15
  }
31
- }]);
32
- return DateFormatter;
33
- }(React.Component);
16
+ return /*#__PURE__*/React.createElement("div", {
17
+ className: classname
18
+ }, date);
19
+ }
20
+ }
34
21
  DateFormatter.defaultProps = {
35
22
  value: '',
36
23
  format: 'YYYY-MM-DD',
@@ -2,16 +2,16 @@ import React from 'react';
2
2
  import classnames from 'classnames';
3
3
  import './index.css';
4
4
  function DepartmentSingleSelectFormatter(props) {
5
- var value = props.value,
6
- departments = props.departments,
7
- containerClassName = props.containerClassName,
8
- tip = props.tip;
5
+ const {
6
+ value,
7
+ departments,
8
+ containerClassName,
9
+ tip
10
+ } = props;
9
11
  if (!value) return null;
10
- var deletedTip = tip || 'Deleted department';
11
- var department = departments.find(function (department) {
12
- return department.id === value;
13
- });
14
- var name = department ? department.name : deletedTip;
12
+ const deletedTip = tip || 'Deleted department';
13
+ const department = departments.find(department => department.id === value);
14
+ const name = department ? department.name : deletedTip;
15
15
  return /*#__PURE__*/React.createElement("div", {
16
16
  className: classnames('dtable-ui cell-formatter-container department-single-select-formatter text-truncate', containerClassName)
17
17
  }, /*#__PURE__*/React.createElement("div", {
@@ -1,7 +1,3 @@
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
1
  import React, { Component } from 'react';
6
2
  import classnames from 'classnames';
7
3
  import ImagesLazyLoad from '../ImageFormatter/images-lazy-load';
@@ -9,87 +5,81 @@ import ImagePreviewerLightbox from '../ImagePreviewerLightbox';
9
5
  import { getDigitalSignImageUrl } from './utils';
10
6
  import { downloadFile } from '../utils/utils';
11
7
  import './index.css';
12
- var DigitalSignFormatter = /*#__PURE__*/function (_Component) {
13
- _inherits(DigitalSignFormatter, _Component);
14
- var _super = _createSuper(DigitalSignFormatter);
15
- function DigitalSignFormatter(props) {
16
- var _this;
17
- _classCallCheck(this, DigitalSignFormatter);
18
- _this = _super.call(this, props);
19
- _this.getSignImages = function () {
20
- var _this$props = _this.props,
21
- value = _this$props.value,
22
- config = _this$props.config;
8
+ class DigitalSignFormatter extends Component {
9
+ constructor(props) {
10
+ super(props);
11
+ this.getSignImages = () => {
12
+ const {
13
+ value,
14
+ config
15
+ } = this.props;
23
16
  return [getDigitalSignImageUrl(value, config)].filter(Boolean);
24
17
  };
25
- _this.onClickSignImage = function (index) {
26
- if (!_this.props.isSupportPreview) return;
27
- _this.setState({
18
+ this.onClickSignImage = index => {
19
+ if (!this.props.isSupportPreview) return;
20
+ this.setState({
28
21
  isPreviewSignImage: true,
29
22
  largeSignImageIndex: index
30
23
  });
31
24
  };
32
- _this.hideLargeSignImage = function () {
33
- if (!_this.props.isSupportPreview) return;
34
- if (_this.props.onCloseCallback) {
35
- _this.props.onCloseCallback();
25
+ this.hideLargeSignImage = () => {
26
+ if (!this.props.isSupportPreview) return;
27
+ if (this.props.onCloseCallback) {
28
+ this.props.onCloseCallback();
36
29
  }
37
- _this.setState({
30
+ this.setState({
38
31
  isPreviewSignImage: false,
39
32
  largeSignImageIndex: -1
40
33
  });
41
34
  };
42
- _this.downloadImage = function (url) {
43
- var availableUrl = url;
44
- var rotateIndex = availableUrl.indexOf('?a=');
35
+ this.downloadImage = url => {
36
+ let availableUrl = url;
37
+ let rotateIndex = availableUrl.indexOf('?a=');
45
38
  if (rotateIndex > -1) {
46
39
  availableUrl = availableUrl.slice(0, rotateIndex);
47
40
  }
48
- var urlSuffix = availableUrl.indexOf('?dl=1');
49
- var downloadUrl = urlSuffix !== -1 ? availableUrl : availableUrl + '?dl=1';
41
+ const urlSuffix = availableUrl.indexOf('?dl=1');
42
+ const downloadUrl = urlSuffix !== -1 ? availableUrl : availableUrl + '?dl=1';
50
43
  downloadFile(downloadUrl);
51
44
  };
52
- _this.state = {
45
+ this.state = {
53
46
  isPreviewSignImage: false,
54
47
  largeSignImageIndex: -1
55
48
  };
56
- return _this;
57
49
  }
58
- _createClass(DigitalSignFormatter, [{
59
- key: "render",
60
- value: function render() {
61
- var _this$props2 = this.props,
62
- containerClassName = _this$props2.containerClassName,
63
- readOnly = _this$props2.readOnly,
64
- config = _this$props2.config,
65
- isSample = _this$props2.isSample;
66
- var className = classnames('dtable-ui cell-formatter-container digital-sign-formatter', containerClassName);
67
- var signImages = this.getSignImages();
68
- if (signImages.length === 0) return null;
69
- var _this$state = this.state,
70
- isPreviewSignImage = _this$state.isPreviewSignImage,
71
- largeSignImageIndex = _this$state.largeSignImageIndex;
72
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
73
- className: className
74
- }, /*#__PURE__*/React.createElement(ImagesLazyLoad, {
75
- images: signImages,
76
- server: config.server,
77
- onImageClick: this.onClickSignImage
78
- })), isPreviewSignImage && /*#__PURE__*/React.createElement(ImagePreviewerLightbox, {
79
- className: "digital-sign-formatter-image-previewer",
80
- readOnly: readOnly,
81
- server: isSample ? config.server : '',
82
- imageItems: signImages,
83
- imageIndex: largeSignImageIndex,
84
- closeImagePopup: this.hideLargeSignImage,
85
- downloadImage: this.downloadImage,
86
- moveToPrevImage: function moveToPrevImage() {},
87
- moveToNextImage: function moveToNextImage() {}
88
- }));
89
- }
90
- }]);
91
- return DigitalSignFormatter;
92
- }(Component);
50
+ render() {
51
+ const {
52
+ containerClassName,
53
+ readOnly,
54
+ config,
55
+ isSample
56
+ } = this.props;
57
+ const className = classnames('dtable-ui cell-formatter-container digital-sign-formatter', containerClassName);
58
+ const signImages = this.getSignImages();
59
+ if (signImages.length === 0) return null;
60
+ const {
61
+ isPreviewSignImage,
62
+ largeSignImageIndex
63
+ } = this.state;
64
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
65
+ className: className
66
+ }, /*#__PURE__*/React.createElement(ImagesLazyLoad, {
67
+ images: signImages,
68
+ server: config.server,
69
+ onImageClick: this.onClickSignImage
70
+ })), isPreviewSignImage && /*#__PURE__*/React.createElement(ImagePreviewerLightbox, {
71
+ className: "digital-sign-formatter-image-previewer",
72
+ readOnly: readOnly,
73
+ server: isSample ? config.server : '',
74
+ imageItems: signImages,
75
+ imageIndex: largeSignImageIndex,
76
+ closeImagePopup: this.hideLargeSignImage,
77
+ downloadImage: this.downloadImage,
78
+ moveToPrevImage: () => {},
79
+ moveToNextImage: () => {}
80
+ }));
81
+ }
82
+ }
93
83
  DigitalSignFormatter.defaultProps = {
94
84
  isSample: false,
95
85
  isSupportPreview: false,
@@ -1,20 +1,21 @@
1
- export var getDigitalSignImageUrl = function getDigitalSignImageUrl(cellValue, config) {
1
+ export const getDigitalSignImageUrl = (cellValue, config) => {
2
2
  if (!cellValue) return '';
3
- var url = cellValue && cellValue.sign_image_url || '';
3
+ const url = cellValue && cellValue.sign_image_url || '';
4
4
  if (!url) return '';
5
5
  if (!config) return url;
6
- var _ref = config || {},
7
- server = _ref.server,
8
- workspaceID = _ref.workspaceID,
9
- dtableUuid = _ref.dtableUuid;
6
+ const {
7
+ server,
8
+ workspaceID,
9
+ dtableUuid
10
+ } = config || {};
10
11
  if (server && (workspaceID || workspaceID === 0) && dtableUuid) {
11
12
  return "".concat(server, "/workspace/").concat(workspaceID, "/asset/").concat(dtableUuid).concat(url);
12
13
  }
13
14
  return url;
14
15
  };
15
- export var isValidDigitalSignImageValue = function isValidDigitalSignImageValue(cellValue) {
16
+ export const isValidDigitalSignImageValue = cellValue => {
16
17
  if (!cellValue) return false;
17
- var digitalSignImage = cellValue && cellValue.sign_image_url;
18
+ const digitalSignImage = cellValue && cellValue.sign_image_url;
18
19
  if (!digitalSignImage) return false;
19
20
  return true;
20
21
  };
@@ -1,33 +1,20 @@
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
1
  import React from 'react';
6
2
  import classnames from 'classnames';
7
3
  import { getDurationDisplayString } from 'dtable-utils';
8
4
  import './index.css';
9
- var DurationFormatter = /*#__PURE__*/function (_React$Component) {
10
- _inherits(DurationFormatter, _React$Component);
11
- var _super = _createSuper(DurationFormatter);
12
- function DurationFormatter() {
13
- _classCallCheck(this, DurationFormatter);
14
- return _super.apply(this, arguments);
5
+ class DurationFormatter extends React.Component {
6
+ render() {
7
+ let {
8
+ value,
9
+ containerClassName,
10
+ format
11
+ } = this.props;
12
+ let classname = classnames('dtable-ui cell-formatter-container duration-formatter', containerClassName);
13
+ return /*#__PURE__*/React.createElement("div", {
14
+ className: classname
15
+ }, getDurationDisplayString(value, {
16
+ duration_format: format
17
+ }));
15
18
  }
16
- _createClass(DurationFormatter, [{
17
- key: "render",
18
- value: function render() {
19
- var _this$props = this.props,
20
- value = _this$props.value,
21
- containerClassName = _this$props.containerClassName,
22
- format = _this$props.format;
23
- var classname = classnames('dtable-ui cell-formatter-container duration-formatter', containerClassName);
24
- return /*#__PURE__*/React.createElement("div", {
25
- className: classname
26
- }, getDurationDisplayString(value, {
27
- duration_format: format
28
- }));
29
- }
30
- }]);
31
- return DurationFormatter;
32
- }(React.Component);
19
+ }
33
20
  export default DurationFormatter;
@@ -1,26 +1,14 @@
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
1
  import React from 'react';
6
2
  import './index.css';
7
- var EditEditorButton = /*#__PURE__*/function (_React$Component) {
8
- _inherits(EditEditorButton, _React$Component);
9
- var _super = _createSuper(EditEditorButton);
10
- function EditEditorButton() {
11
- _classCallCheck(this, EditEditorButton);
12
- return _super.apply(this, arguments);
3
+ class EditEditorButton extends React.Component {
4
+ render() {
5
+ const {
6
+ text
7
+ } = this.props;
8
+ return /*#__PURE__*/React.createElement("span", {
9
+ className: "dtable-ui-editor-button",
10
+ onClick: this.props.onClick
11
+ }, text);
13
12
  }
14
- _createClass(EditEditorButton, [{
15
- key: "render",
16
- value: function render() {
17
- var text = this.props.text;
18
- return /*#__PURE__*/React.createElement("span", {
19
- className: "dtable-ui-editor-button",
20
- onClick: this.props.onClick
21
- }, text);
22
- }
23
- }]);
24
- return EditEditorButton;
25
- }(React.Component);
13
+ }
26
14
  export default EditEditorButton;
@@ -1,29 +1,16 @@
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
1
  import React from 'react';
6
2
  import classnames from 'classnames';
7
3
  import './index.css';
8
- var EmailFormatter = /*#__PURE__*/function (_React$Component) {
9
- _inherits(EmailFormatter, _React$Component);
10
- var _super = _createSuper(EmailFormatter);
11
- function EmailFormatter() {
12
- _classCallCheck(this, EmailFormatter);
13
- return _super.apply(this, arguments);
4
+ class EmailFormatter extends React.Component {
5
+ render() {
6
+ const {
7
+ containerClassName,
8
+ value
9
+ } = this.props;
10
+ let classname = classnames('dtable-ui cell-formatter-container email-formatter', containerClassName);
11
+ return /*#__PURE__*/React.createElement("div", {
12
+ className: classname
13
+ }, value);
14
14
  }
15
- _createClass(EmailFormatter, [{
16
- key: "render",
17
- value: function render() {
18
- var _this$props = this.props,
19
- containerClassName = _this$props.containerClassName,
20
- value = _this$props.value;
21
- var classname = classnames('dtable-ui cell-formatter-container email-formatter', containerClassName);
22
- return /*#__PURE__*/React.createElement("div", {
23
- className: classname
24
- }, value);
25
- }
26
- }]);
27
- return EmailFormatter;
28
- }(React.Component);
15
+ }
29
16
  export default EmailFormatter;