dtable-ui-component 4.3.7 → 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 (120) 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.js +92 -103
  15. package/lib/DTablePopover/index.js +52 -71
  16. package/lib/DTablePopover/utils.js +1 -1
  17. package/lib/DTableRadio/index.js +9 -7
  18. package/lib/DTableSearchInput/index.js +89 -99
  19. package/lib/DTableSearchInput/utils.js +2 -2
  20. package/lib/DTableSelect/dtable-select-label.js +5 -3
  21. package/lib/DTableSelect/index.js +50 -64
  22. package/lib/DTableSelect/utils.js +36 -41
  23. package/lib/DTableSwitch/index.js +7 -5
  24. package/lib/DateEditor/index.js +88 -94
  25. package/lib/DateEditor/mb-date-editor-popover/index.js +136 -134
  26. package/lib/DateEditor/pc-date-editor-popover.js +70 -77
  27. package/lib/DateFormatter/index.js +15 -28
  28. package/lib/DepartmentSingleSelectFormatter/index.js +9 -9
  29. package/lib/DigitalSignFormatter/index.js +55 -65
  30. package/lib/DigitalSignFormatter/utils.js +9 -8
  31. package/lib/DurationFormatter/index.js +14 -27
  32. package/lib/EditEditorButton/index.js +10 -22
  33. package/lib/EmailFormatter/index.js +11 -24
  34. package/lib/FieldDisplaySetting/field-item.js +18 -20
  35. package/lib/FieldDisplaySetting/index.js +41 -43
  36. package/lib/FileEditor/index.js +18 -29
  37. package/lib/FileFormatter/index.js +29 -43
  38. package/lib/FileItemFormatter/index.js +17 -32
  39. package/lib/FileItemFormatter/utils.js +5 -5
  40. package/lib/FileUploader/index.js +20 -33
  41. package/lib/FormulaFormatter/cell-value-validator.js +23 -8
  42. package/lib/FormulaFormatter/index.js +77 -83
  43. package/lib/FormulaFormatter/utils.js +27 -21
  44. package/lib/GeolocationFormatter/index.js +19 -32
  45. package/lib/HtmlLongTextFormatter/index.js +43 -52
  46. package/lib/HtmlLongTextFormatter/markdown2html.js +2 -2
  47. package/lib/HtmlLongTextFormatter/unified/index.js +1 -1
  48. package/lib/HtmlLongTextFormatter/vfile/core.js +10 -10
  49. package/lib/ImageFormatter/images-lazy-load.js +71 -79
  50. package/lib/ImageFormatter/index.js +86 -97
  51. package/lib/ImageFormatter/utils.js +1 -1
  52. package/lib/ImagePreviewerLightbox/index.js +20 -18
  53. package/lib/ImagePreviewerLightbox/utils.js +3 -3
  54. package/lib/LastModifierFormatter/index.js +24 -40
  55. package/lib/LinkEditor/index.js +163 -167
  56. package/lib/LinkEditor/link-editor-option.js +41 -56
  57. package/lib/LinkEditor/mb-link-editor-popover/index.js +90 -99
  58. package/lib/LinkEditor/pc-link-editor-popover/index.js +63 -71
  59. package/lib/LinkFormatter/index.js +75 -77
  60. package/lib/LongTextFormatter/index.js +5 -3
  61. package/lib/MBEditorHeader/index.js +25 -38
  62. package/lib/MTimeFormatter/index.js +17 -32
  63. package/lib/ModalPortal/index.js +15 -32
  64. package/lib/MultipleSelectEditor/index.js +118 -136
  65. package/lib/MultipleSelectFormatter/index.js +24 -40
  66. package/lib/NotificationPopover/index.js +68 -95
  67. package/lib/NumberEditor/index.js +75 -82
  68. package/lib/NumberFormatter/index.js +15 -28
  69. package/lib/RateFormatter/index.js +29 -45
  70. package/lib/RoleStatusEditor/index.js +20 -22
  71. package/lib/RowExpandEmailFormatter/index.js +24 -37
  72. package/lib/RowExpandFileFormatter/index.js +28 -42
  73. package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +66 -82
  74. package/lib/RowExpandFormatter/index.js +92 -96
  75. package/lib/RowExpandFormulaFormatter/index.js +85 -91
  76. package/lib/RowExpandImageFormatter/index.js +65 -82
  77. package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +71 -84
  78. package/lib/RowExpandImageFormatter/utils.js +1 -1
  79. package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +54 -68
  80. package/lib/RowExpandLinkFormatter/index.js +131 -137
  81. package/lib/RowExpandLinkFormatter/utils.js +23 -17
  82. package/lib/RowExpandLinkFormatter/value-display-utils.js +9 -7
  83. package/lib/RowExpandRateFormatter/index.js +27 -42
  84. package/lib/RowExpandUrlFormatter/index.js +27 -40
  85. package/lib/SelectItem/index.js +17 -33
  86. package/lib/SelectOptionGroup/index.js +141 -159
  87. package/lib/SelectOptionGroup/option.js +24 -40
  88. package/lib/SimpleLongTextFormatter/index.js +55 -67
  89. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +23 -22
  90. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +42 -57
  91. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +31 -46
  92. package/lib/SingleSelectEditor/index.js +108 -119
  93. package/lib/SingleSelectFormatter/index.js +21 -37
  94. package/lib/TextEditor/index.js +45 -51
  95. package/lib/TextFormatter/index.js +17 -32
  96. package/lib/UrlFormatter/index.js +11 -24
  97. package/lib/cellFormatterFactory/index.js +8 -17
  98. package/lib/common/ClickOutside.js +22 -43
  99. package/lib/common/delete-tip.js +40 -65
  100. package/lib/common/modal-portal.js +15 -33
  101. package/lib/constants/index.js +5 -5
  102. package/lib/data/dtable-value.js +4 -4
  103. package/lib/formatterConfig/base-formatter-config.js +24 -3
  104. package/lib/formatterConfig/index.js +5 -4
  105. package/lib/lang/index.js +6 -6
  106. package/lib/locals/de.js +1 -1
  107. package/lib/locals/en.js +1 -1
  108. package/lib/locals/fr.js +1 -1
  109. package/lib/locals/zh-CN.js +1 -1
  110. package/lib/select-editor/mb-select-editor-popover/index.js +126 -137
  111. package/lib/select-editor/pc-select-editor-popover/index.js +75 -83
  112. package/lib/select-editor/select-editor-option.js +41 -56
  113. package/lib/toaster/alert.js +73 -88
  114. package/lib/toaster/index.js +1 -1
  115. package/lib/toaster/toast.js +75 -102
  116. package/lib/toaster/toastManager.js +55 -91
  117. package/lib/toaster/toaster.js +58 -57
  118. package/lib/utils/editor-utils.js +17 -19
  119. package/lib/utils/utils.js +14 -14
  120. package/package.json +4 -4
@@ -1,112 +1,85 @@
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 { Popover } from 'reactstrap';
7
3
  import './index.css';
8
- var NotificationPopover = /*#__PURE__*/function (_React$Component) {
9
- _inherits(NotificationPopover, _React$Component);
10
- var _super = _createSuper(NotificationPopover);
11
- function NotificationPopover() {
12
- var _this;
13
- _classCallCheck(this, NotificationPopover);
14
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15
- args[_key] = arguments[_key];
16
- }
17
- _this = _super.call.apply(_super, [this].concat(args));
18
- _this.handleOutsideClick = function (e) {
19
- if (!_this.notificationContainerRef.contains(e.target)) {
20
- document.removeEventListener('mousedown', _this.handleOutsideClick);
4
+ export default class NotificationPopover extends React.Component {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.handleOutsideClick = e => {
8
+ if (!this.notificationContainerRef.contains(e.target)) {
9
+ document.removeEventListener('mousedown', this.handleOutsideClick);
21
10
  if (e.target.className === 'tool notification' || e.target.parentNode.className === 'tool notification') {
22
11
  return;
23
12
  }
24
- _this.props.onNotificationListToggle();
13
+ this.props.onNotificationListToggle();
25
14
  }
26
15
  };
27
- _this.onNotificationDialogToggle = function () {
28
- _this.props.onNotificationDialogToggle();
29
- _this.props.onNotificationListToggle();
16
+ this.onNotificationDialogToggle = () => {
17
+ this.props.onNotificationDialogToggle();
18
+ this.props.onNotificationListToggle();
30
19
  };
31
- _this.onWeixinQRCodeDialogToggle = function () {
32
- _this.props.onOpenWeixinQRCodeDialog();
33
- _this.props.onNotificationListToggle();
20
+ this.onWeixinQRCodeDialogToggle = () => {
21
+ this.props.onOpenWeixinQRCodeDialog();
22
+ this.props.onNotificationListToggle();
34
23
  };
35
- _this.onHandleScroll = function () {
36
- if (_this.notificationListRef.offsetHeight + _this.notificationListRef.scrollTop + 1 >= _this.notificationsWrapperRef.offsetHeight) {
37
- _this.props.listNotifications && _this.props.listNotifications();
24
+ this.onHandleScroll = () => {
25
+ if (this.notificationListRef.offsetHeight + this.notificationListRef.scrollTop + 1 >= this.notificationsWrapperRef.offsetHeight) {
26
+ this.props.listNotifications && this.props.listNotifications();
38
27
  }
39
28
  };
40
- return _this;
41
29
  }
42
- _createClass(NotificationPopover, [{
43
- key: "componentDidMount",
44
- value: function componentDidMount() {
45
- document.addEventListener('mousedown', this.handleOutsideClick);
46
- }
47
- }, {
48
- key: "componentWillUnmount",
49
- value: function componentWillUnmount() {
50
- document.removeEventListener('mousedown', this.handleOutsideClick);
51
- }
52
- }, {
53
- key: "render",
54
- value: function render() {
55
- var _this2 = this;
56
- var _this$props = this.props,
57
- headerText = _this$props.headerText,
58
- bodyText = _this$props.bodyText,
59
- footerText = _this$props.footerText;
60
- return /*#__PURE__*/React.createElement(Popover, {
61
- className: "notification-wrapper",
62
- target: "notification-popover",
63
- isOpen: true,
64
- fade: false,
65
- hideArrow: true,
66
- placement: "bottom"
67
- }, /*#__PURE__*/React.createElement("div", {
68
- className: "notification-container",
69
- ref: function ref(_ref3) {
70
- return _this2.notificationContainerRef = _ref3;
71
- }
72
- }, /*#__PURE__*/React.createElement("div", {
73
- className: "notification-header"
74
- }, headerText, /*#__PURE__*/React.createElement("span", {
75
- className: "dtable-font dtable-icon-x notification-close-icon",
76
- onClick: this.props.onNotificationListToggle
77
- })), /*#__PURE__*/React.createElement("div", {
78
- className: "notification-body"
79
- }, this.props.enableWeixin && /*#__PURE__*/React.createElement("div", {
80
- className: "show-weixin-qrcode",
81
- onClick: this.onWeixinQRCodeDialogToggle
82
- }, /*#__PURE__*/React.createElement("i", {
83
- className: "dtable-font dtable-icon-wechat weixin-icon"
84
- }), /*#__PURE__*/React.createElement("span", {
85
- className: "ml-2"
86
- }, "\u5173\u6CE8\u516C\u4F17\u53F7\u83B7\u53D6\u5B9E\u65F6\u901A\u77E5")), /*#__PURE__*/React.createElement("div", {
87
- className: "mark-notifications",
88
- onClick: this.props.onMarkAllNotifications
89
- }, bodyText), /*#__PURE__*/React.createElement("div", {
90
- className: "notification-list-container",
91
- onScroll: this.onHandleScroll,
92
- ref: function ref(_ref2) {
93
- return _this2.notificationListRef = _ref2;
94
- }
95
- }, /*#__PURE__*/React.createElement("div", {
96
- ref: function ref(_ref) {
97
- return _this2.notificationsWrapperRef = _ref;
98
- }
99
- }, this.props.children)), /*#__PURE__*/React.createElement("div", {
100
- className: "notification-footer",
101
- onClick: this.onNotificationDialogToggle
102
- }, footerText))));
103
- }
104
- }]);
105
- return NotificationPopover;
106
- }(React.Component);
30
+ componentDidMount() {
31
+ document.addEventListener('mousedown', this.handleOutsideClick);
32
+ }
33
+ componentWillUnmount() {
34
+ document.removeEventListener('mousedown', this.handleOutsideClick);
35
+ }
36
+ render() {
37
+ const {
38
+ headerText,
39
+ bodyText,
40
+ footerText
41
+ } = this.props;
42
+ return /*#__PURE__*/React.createElement(Popover, {
43
+ className: "notification-wrapper",
44
+ target: "notification-popover",
45
+ isOpen: true,
46
+ fade: false,
47
+ hideArrow: true,
48
+ placement: "bottom"
49
+ }, /*#__PURE__*/React.createElement("div", {
50
+ className: "notification-container",
51
+ ref: ref => this.notificationContainerRef = ref
52
+ }, /*#__PURE__*/React.createElement("div", {
53
+ className: "notification-header"
54
+ }, headerText, /*#__PURE__*/React.createElement("span", {
55
+ className: "dtable-font dtable-icon-x notification-close-icon",
56
+ onClick: this.props.onNotificationListToggle
57
+ })), /*#__PURE__*/React.createElement("div", {
58
+ className: "notification-body"
59
+ }, this.props.enableWeixin && /*#__PURE__*/React.createElement("div", {
60
+ className: "show-weixin-qrcode",
61
+ onClick: this.onWeixinQRCodeDialogToggle
62
+ }, /*#__PURE__*/React.createElement("i", {
63
+ className: "dtable-font dtable-icon-wechat weixin-icon"
64
+ }), /*#__PURE__*/React.createElement("span", {
65
+ className: "ml-2"
66
+ }, "\u5173\u6CE8\u516C\u4F17\u53F7\u83B7\u53D6\u5B9E\u65F6\u901A\u77E5")), /*#__PURE__*/React.createElement("div", {
67
+ className: "mark-notifications",
68
+ onClick: this.props.onMarkAllNotifications
69
+ }, bodyText), /*#__PURE__*/React.createElement("div", {
70
+ className: "notification-list-container",
71
+ onScroll: this.onHandleScroll,
72
+ ref: ref => this.notificationListRef = ref
73
+ }, /*#__PURE__*/React.createElement("div", {
74
+ ref: ref => this.notificationsWrapperRef = ref
75
+ }, this.props.children)), /*#__PURE__*/React.createElement("div", {
76
+ className: "notification-footer",
77
+ onClick: this.onNotificationDialogToggle
78
+ }, footerText))));
79
+ }
80
+ }
107
81
  NotificationPopover.defaultProps = {
108
82
  headerText: '',
109
83
  bodyText: '',
110
84
  footerText: ''
111
- };
112
- export { NotificationPopover as default };
85
+ };
@@ -1,132 +1,125 @@
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 isHotkey from 'is-hotkey';
7
3
  import { getNumberDisplayString, formatStringToNumber, replaceNumberNotAllowInput } from 'dtable-utils';
8
4
  import { NUMBER_TYPES } from '../constants';
9
5
  import { isMac } from '../utils/utils';
10
- var NumberEditor = /*#__PURE__*/function (_React$Component) {
11
- _inherits(NumberEditor, _React$Component);
12
- var _super = _createSuper(NumberEditor);
13
- function NumberEditor(props) {
14
- var _this;
15
- _classCallCheck(this, NumberEditor);
16
- _this = _super.call(this, props);
17
- _this.onEditorHandle = function () {
18
- if (_this.props.isReadOnly) {
6
+ class NumberEditor extends React.Component {
7
+ constructor(props) {
8
+ super(props);
9
+ this.onEditorHandle = () => {
10
+ if (this.props.isReadOnly) {
19
11
  return;
20
12
  }
21
- _this.setState({
13
+ this.setState({
22
14
  isEditorShow: true,
23
- inputValue: _this.state.textValue
24
- }, function () {
25
- _this.input.focus();
15
+ inputValue: this.state.textValue
16
+ }, () => {
17
+ this.input.focus();
26
18
  });
27
19
  };
28
- _this.onCommit = function () {
29
- var updated = {};
30
- var column = _this.props.column;
31
- var inputValue = _this.state.inputValue ? _this.state.inputValue.toString() : '';
32
- var value = inputValue ? formatStringToNumber(inputValue) : ''; // format the number to submit
20
+ this.onCommit = () => {
21
+ let updated = {};
22
+ let {
23
+ column
24
+ } = this.props;
25
+ let inputValue = this.state.inputValue ? this.state.inputValue.toString() : '';
26
+ let value = inputValue ? formatStringToNumber(inputValue) : ''; // format the number to submit
33
27
  updated[column.key] = value;
34
- _this.props.onCommit(updated);
35
- var newValue = getNumberDisplayString(value, column.data); // format the number to display
36
- _this.setState({
28
+ this.props.onCommit(updated);
29
+ let newValue = getNumberDisplayString(value, column.data); // format the number to display
30
+ this.setState({
37
31
  isEditorShow: false,
38
32
  textValue: newValue
39
33
  });
40
34
  };
41
- _this.onChange = function (event) {
42
- var data = _this.props.column.data; // data maybe 'null'
43
- var value = event.target.value.trim();
44
- var currency_symbol = null;
35
+ this.onChange = event => {
36
+ const {
37
+ data
38
+ } = this.props.column; // data maybe 'null'
39
+ let value = event.target.value.trim();
40
+ let currency_symbol = null;
45
41
  if (data && data.format === 'custom_currency') {
46
42
  currency_symbol = data['currency_symbol'];
47
43
  }
48
44
 
49
45
  //Prevent the repetition of periods bug in the Chinese input method of the Windows system
50
46
  if (!isMac() && value.indexOf('.。') > -1) return;
51
- value = replaceNumberNotAllowInput(value, _this.dataFormat, currency_symbol);
52
- if (value === _this.state.inputValue) return;
53
- _this.setState({
47
+ value = replaceNumberNotAllowInput(value, this.dataFormat, currency_symbol);
48
+ if (value === this.state.inputValue) return;
49
+ this.setState({
54
50
  inputValue: value
55
51
  });
56
52
  };
57
- _this.onBlur = function () {
58
- _this.onCommit();
53
+ this.onBlur = () => {
54
+ this.onCommit();
59
55
  };
60
- _this.onKeyDown = function (event) {
61
- var _event$currentTarget = event.currentTarget,
62
- selectionStart = _event$currentTarget.selectionStart,
63
- selectionEnd = _event$currentTarget.selectionEnd,
64
- value = _event$currentTarget.value;
56
+ this.onKeyDown = event => {
57
+ let {
58
+ selectionStart,
59
+ selectionEnd,
60
+ value
61
+ } = event.currentTarget;
65
62
  if (isHotkey('enter', event)) {
66
63
  event.preventDefault();
67
- _this.onBlur();
64
+ this.onBlur();
68
65
  } else if (event.keyCode === 37 && selectionStart === 0 || event.keyCode === 39 && selectionEnd === value.length) {
69
66
  event.stopPropagation();
70
67
  }
71
68
  };
72
- _this.onPaste = function (e) {
69
+ this.onPaste = e => {
73
70
  e.stopPropagation();
74
71
  };
75
- _this.onCut = function (e) {
72
+ this.onCut = e => {
76
73
  e.stopPropagation();
77
74
  };
78
- _this.getStyle = function () {
75
+ this.getStyle = () => {
79
76
  return {
80
77
  width: '320px',
81
78
  textAlign: 'left'
82
79
  };
83
80
  };
84
- _this.setInputRef = function (input) {
85
- _this.input = input;
86
- return _this.input;
81
+ this.setInputRef = input => {
82
+ this.input = input;
83
+ return this.input;
87
84
  };
88
- var _this$props = _this.props,
89
- _value = _this$props.value,
90
- _column = _this$props.column;
91
- var dataFormat = _column.data && _column.data.format;
92
- _this.dataFormat = dataFormat || NUMBER_TYPES.NUMBER;
93
- var initValue = getNumberDisplayString(_value, _column.data); // format the number to display
85
+ let {
86
+ value: _value,
87
+ column: _column
88
+ } = this.props;
89
+ let dataFormat = _column.data && _column.data.format;
90
+ this.dataFormat = dataFormat || NUMBER_TYPES.NUMBER;
91
+ let initValue = getNumberDisplayString(_value, _column.data); // format the number to display
94
92
 
95
- _this.state = {
93
+ this.state = {
96
94
  inputValue: initValue,
97
95
  textValue: initValue,
98
96
  isEditorShow: false
99
97
  };
100
- return _this;
101
98
  }
102
- _createClass(NumberEditor, [{
103
- key: "render",
104
- value: function render() {
105
- var style = this.getStyle();
106
- return /*#__PURE__*/React.createElement("div", {
107
- className: "cell-editor number-editor"
108
- }, /*#__PURE__*/React.createElement("div", {
109
- className: "number-editor-container"
110
- }, !this.state.isEditorShow && /*#__PURE__*/React.createElement("div", {
111
- className: "form-control",
112
- style: style,
113
- onClick: this.onEditorHandle
114
- }, this.state.textValue), this.state.isEditorShow && /*#__PURE__*/React.createElement("input", {
115
- ref: this.setInputRef,
116
- type: "text",
117
- className: "form-control",
118
- style: style,
119
- value: this.state.inputValue,
120
- onChange: this.onChange,
121
- onBlur: this.onBlur,
122
- onCut: this.onCut,
123
- onPaste: this.onPaste,
124
- onKeyDown: this.onKeyDown
125
- })));
126
- }
127
- }]);
128
- return NumberEditor;
129
- }(React.Component);
99
+ render() {
100
+ let style = this.getStyle();
101
+ return /*#__PURE__*/React.createElement("div", {
102
+ className: "cell-editor number-editor"
103
+ }, /*#__PURE__*/React.createElement("div", {
104
+ className: "number-editor-container"
105
+ }, !this.state.isEditorShow && /*#__PURE__*/React.createElement("div", {
106
+ className: "form-control",
107
+ style: style,
108
+ onClick: this.onEditorHandle
109
+ }, this.state.textValue), this.state.isEditorShow && /*#__PURE__*/React.createElement("input", {
110
+ ref: this.setInputRef,
111
+ type: "text",
112
+ className: "form-control",
113
+ style: style,
114
+ value: this.state.inputValue,
115
+ onChange: this.onChange,
116
+ onBlur: this.onBlur,
117
+ onCut: this.onCut,
118
+ onPaste: this.onPaste,
119
+ onKeyDown: this.onKeyDown
120
+ })));
121
+ }
122
+ }
130
123
  NumberEditor.defaultProps = {
131
124
  isReadOnly: false,
132
125
  value: ''
@@ -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 { getNumberDisplayString } from 'dtable-utils';
8
4
  import './index.css';
9
- var NumberFormatter = /*#__PURE__*/function (_React$Component) {
10
- _inherits(NumberFormatter, _React$Component);
11
- var _super = _createSuper(NumberFormatter);
12
- function NumberFormatter() {
13
- _classCallCheck(this, NumberFormatter);
14
- return _super.apply(this, arguments);
15
- }
16
- _createClass(NumberFormatter, [{
17
- key: "render",
18
- value: function render() {
19
- var _this$props = this.props,
20
- number = _this$props.value,
21
- data = _this$props.data,
22
- containerClassName = _this$props.containerClassName;
23
- var classname = classnames('dtable-ui cell-formatter-container number-formatter', containerClassName);
24
- if (number || number === 0) {
25
- number = getNumberDisplayString(number, data);
26
- }
27
- return /*#__PURE__*/React.createElement("div", {
28
- className: classname
29
- }, number);
5
+ class NumberFormatter extends React.Component {
6
+ render() {
7
+ let {
8
+ value: number,
9
+ data,
10
+ containerClassName
11
+ } = this.props;
12
+ let classname = classnames('dtable-ui cell-formatter-container number-formatter', containerClassName);
13
+ if (number || number === 0) {
14
+ number = getNumberDisplayString(number, data);
30
15
  }
31
- }]);
32
- return NumberFormatter;
33
- }(React.Component);
16
+ return /*#__PURE__*/React.createElement("div", {
17
+ className: classname
18
+ }, number);
19
+ }
20
+ }
34
21
  NumberFormatter.defaultProps = {
35
22
  value: '',
36
23
  containerClassName: ''
@@ -1,34 +1,22 @@
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 RateFormatter = /*#__PURE__*/function (_React$Component) {
9
- _inherits(RateFormatter, _React$Component);
10
- var _super = _createSuper(RateFormatter);
11
- function RateFormatter() {
12
- var _this;
13
- _classCallCheck(this, RateFormatter);
14
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
15
- args[_key] = arguments[_key];
16
- }
17
- _this = _super.call.apply(_super, [this].concat(args));
18
- _this.getRateList = function () {
19
- var _this$props = _this.props,
20
- data = _this$props.data,
21
- value = _this$props.value;
22
- var _ref = data || {},
23
- _ref$rate_max_number = _ref.rate_max_number,
24
- rate_max_number = _ref$rate_max_number === void 0 ? 5 : _ref$rate_max_number,
25
- _ref$rate_style_color = _ref.rate_style_color,
26
- rate_style_color = _ref$rate_style_color === void 0 ? '#e5e5e5' : _ref$rate_style_color,
27
- _ref$rate_style_type = _ref.rate_style_type,
28
- rate_style_type = _ref$rate_style_type === void 0 ? 'dtable-icon-rate' : _ref$rate_style_type;
29
- var validValue = Math.min(rate_max_number, value);
30
- var rateList = [];
31
- for (var i = 0; i < validValue; i++) {
4
+ class RateFormatter extends React.Component {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.getRateList = () => {
8
+ const {
9
+ data,
10
+ value
11
+ } = this.props;
12
+ const {
13
+ rate_max_number = 5,
14
+ rate_style_color = '#e5e5e5',
15
+ rate_style_type = 'dtable-icon-rate'
16
+ } = data || {};
17
+ const validValue = Math.min(rate_max_number, value);
18
+ let rateList = [];
19
+ for (let i = 0; i < validValue; i++) {
32
20
  rateList.push( /*#__PURE__*/React.createElement("i", {
33
21
  key: "dtable-ui-component-rate-".concat(i),
34
22
  className: "dtable-font ".concat(rate_style_type),
@@ -39,24 +27,20 @@ var RateFormatter = /*#__PURE__*/function (_React$Component) {
39
27
  }
40
28
  return rateList;
41
29
  };
42
- return _this;
43
30
  }
44
- _createClass(RateFormatter, [{
45
- key: "render",
46
- value: function render() {
47
- var _this$props2 = this.props,
48
- number = _this$props2.value,
49
- containerClassName = _this$props2.containerClassName;
50
- var className = classnames('dtable-ui cell-formatter-container rate-formatter', containerClassName);
51
- if (!number) return null;
52
- var rateList = this.getRateList();
53
- return /*#__PURE__*/React.createElement("div", {
54
- className: className
55
- }, rateList);
56
- }
57
- }]);
58
- return RateFormatter;
59
- }(React.Component);
31
+ render() {
32
+ const {
33
+ value: number,
34
+ containerClassName
35
+ } = this.props;
36
+ const className = classnames('dtable-ui cell-formatter-container rate-formatter', containerClassName);
37
+ if (!number) return null;
38
+ const rateList = this.getRateList();
39
+ return /*#__PURE__*/React.createElement("div", {
40
+ className: className
41
+ }, rateList);
42
+ }
43
+ }
60
44
  RateFormatter.defaultProps = {
61
45
  value: '',
62
46
  containerClassName: ''
@@ -1,20 +1,20 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
1
  import React, { useState } from 'react';
3
2
  import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
4
3
  import classnames from 'classnames';
5
4
  import './index.css';
6
- var RoleStatusEditor = function RoleStatusEditor(_ref) {
7
- var isShowDropdownIcon = _ref.isShowDropdownIcon,
8
- currentOption = _ref.currentOption,
9
- menuOptions = _ref.menuOptions,
10
- onChangeOption = _ref.onChangeOption,
11
- closeShowDropdownIcon = _ref.closeShowDropdownIcon;
12
- var _useState = useState(false),
13
- _useState2 = _slicedToArray(_useState, 2),
14
- isOpen = _useState2[0],
15
- setIsOpen = _useState2[1];
16
- var handleClickMenuOption = function handleClickMenuOption(menuOption) {
17
- var value = menuOption.value;
5
+ const RoleStatusEditor = _ref => {
6
+ let {
7
+ isShowDropdownIcon,
8
+ currentOption,
9
+ menuOptions,
10
+ onChangeOption,
11
+ closeShowDropdownIcon
12
+ } = _ref;
13
+ const [isOpen, setIsOpen] = useState(false);
14
+ const handleClickMenuOption = menuOption => {
15
+ const {
16
+ value
17
+ } = menuOption;
18
18
  closeShowDropdownIcon && closeShowDropdownIcon();
19
19
  if (value === currentOption.value) return;
20
20
  onChangeOption(value);
@@ -22,9 +22,7 @@ var RoleStatusEditor = function RoleStatusEditor(_ref) {
22
22
  return /*#__PURE__*/React.createElement(Dropdown, {
23
23
  isOpen: isOpen,
24
24
  className: "role-status-editor",
25
- toggle: function toggle() {
26
- return setIsOpen(!isOpen);
27
- }
25
+ toggle: () => setIsOpen(!isOpen)
28
26
  }, /*#__PURE__*/React.createElement(DropdownToggle, {
29
27
  className: "dropdown-toggle-button d-flex align-items-center",
30
28
  tag: "div"
@@ -41,14 +39,14 @@ var RoleStatusEditor = function RoleStatusEditor(_ref) {
41
39
  boundariesElement: document.body
42
40
  }
43
41
  }
44
- }, menuOptions.map(function (option) {
45
- var value = option.value,
46
- label = option.label;
42
+ }, menuOptions.map(option => {
43
+ const {
44
+ value,
45
+ label
46
+ } = option;
47
47
  return /*#__PURE__*/React.createElement(DropdownItem, {
48
48
  key: "item-".concat(value),
49
- onClick: function onClick() {
50
- return handleClickMenuOption(option);
51
- }
49
+ onClick: () => handleClickMenuOption(option)
52
50
  }, label, value === currentOption.value && /*#__PURE__*/React.createElement("i", {
53
51
  className: "dtable-font dtable-icon-check-mark ml-2"
54
52
  }));