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,72 +1,47 @@
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 ModalPortal from './modal-portal';
7
3
  import { getLocale } from '../lang';
8
4
  import './delete-tip.css';
9
- var DeleteTip = /*#__PURE__*/function (_React$Component) {
10
- _inherits(DeleteTip, _React$Component);
11
- var _super = _createSuper(DeleteTip);
12
- function DeleteTip() {
13
- var _this;
14
- _classCallCheck(this, DeleteTip);
15
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
16
- args[_key] = arguments[_key];
17
- }
18
- _this = _super.call.apply(_super, [this].concat(args));
19
- _this.handleOutsideClick = function (e) {
20
- if (_this.tipContainer && !_this.tipContainer.contains(e.target)) {
21
- _this.props.toggle();
5
+ export default class DeleteTip extends React.Component {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.handleOutsideClick = e => {
9
+ if (this.tipContainer && !this.tipContainer.contains(e.target)) {
10
+ this.props.toggle();
22
11
  }
23
12
  };
24
- return _this;
25
13
  }
26
- _createClass(DeleteTip, [{
27
- key: "componentDidMount",
28
- value: function componentDidMount() {
29
- document.addEventListener('click', this.handleOutsideClick);
30
- }
31
- }, {
32
- key: "componentWillUnmount",
33
- value: function componentWillUnmount() {
34
- document.removeEventListener('click', this.handleOutsideClick);
35
- }
36
- }, {
37
- key: "render",
38
- value: function render() {
39
- var _this2 = this;
40
- var _this$props = this.props,
41
- toggle = _this$props.toggle,
42
- onDelete = _this$props.onDelete,
43
- position = _this$props.position,
44
- deleteTip = _this$props.deleteTip;
45
- return /*#__PURE__*/React.createElement(ModalPortal, null, /*#__PURE__*/React.createElement("div", {
46
- ref: function ref(node) {
47
- return _this2.tipContainer = node;
48
- },
49
- className: "dtable-tip tip-container",
50
- style: {
51
- top: position.top,
52
- left: position.left
53
- },
54
- onClick: function onClick(e) {
55
- return e.stopPropagation();
56
- }
57
- }, /*#__PURE__*/React.createElement("b", {
58
- className: "mb-4"
59
- }, deleteTip), /*#__PURE__*/React.createElement("div", {
60
- className: "d-flex justify-content-end"
61
- }, /*#__PURE__*/React.createElement("button", {
62
- className: "btn btn-secondary mr-2",
63
- onClick: toggle
64
- }, getLocale('Cancel')), /*#__PURE__*/React.createElement("button", {
65
- className: "btn btn-primary",
66
- onClick: onDelete
67
- }, getLocale('Delete')))));
68
- }
69
- }]);
70
- return DeleteTip;
71
- }(React.Component);
72
- export { DeleteTip as default };
14
+ componentDidMount() {
15
+ document.addEventListener('click', this.handleOutsideClick);
16
+ }
17
+ componentWillUnmount() {
18
+ document.removeEventListener('click', this.handleOutsideClick);
19
+ }
20
+ render() {
21
+ const {
22
+ toggle,
23
+ onDelete,
24
+ position,
25
+ deleteTip
26
+ } = this.props;
27
+ return /*#__PURE__*/React.createElement(ModalPortal, null, /*#__PURE__*/React.createElement("div", {
28
+ ref: node => this.tipContainer = node,
29
+ className: "dtable-tip tip-container",
30
+ style: {
31
+ top: position.top,
32
+ left: position.left
33
+ },
34
+ onClick: e => e.stopPropagation()
35
+ }, /*#__PURE__*/React.createElement("b", {
36
+ className: "mb-4"
37
+ }, deleteTip), /*#__PURE__*/React.createElement("div", {
38
+ className: "d-flex justify-content-end"
39
+ }, /*#__PURE__*/React.createElement("button", {
40
+ className: "btn btn-secondary mr-2",
41
+ onClick: toggle
42
+ }, getLocale('Cancel')), /*#__PURE__*/React.createElement("button", {
43
+ className: "btn btn-primary",
44
+ onClick: onDelete
45
+ }, getLocale('Delete')))));
46
+ }
47
+ }
@@ -1,36 +1,18 @@
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 ReactDOM from 'react-dom';
7
- var modalRoot = document.getElementById('modal-wrapper');
8
- var ModalPortal = /*#__PURE__*/function (_React$Component) {
9
- _inherits(ModalPortal, _React$Component);
10
- var _super = _createSuper(ModalPortal);
11
- function ModalPortal(props) {
12
- var _this;
13
- _classCallCheck(this, ModalPortal);
14
- _this = _super.call(this, props);
15
- _this.el = document.createElement('div');
16
- return _this;
3
+ const modalRoot = document.getElementById('modal-wrapper');
4
+ export default class ModalPortal extends React.Component {
5
+ constructor(props) {
6
+ super(props);
7
+ this.el = document.createElement('div');
17
8
  }
18
- _createClass(ModalPortal, [{
19
- key: "componentDidMount",
20
- value: function componentDidMount() {
21
- modalRoot.appendChild(this.el);
22
- }
23
- }, {
24
- key: "componentWillUnmount",
25
- value: function componentWillUnmount() {
26
- modalRoot.removeChild(this.el);
27
- }
28
- }, {
29
- key: "render",
30
- value: function render() {
31
- return ReactDOM.createPortal(this.props.children, this.el);
32
- }
33
- }]);
34
- return ModalPortal;
35
- }(React.Component);
36
- export { ModalPortal as default };
9
+ componentDidMount() {
10
+ modalRoot.appendChild(this.el);
11
+ }
12
+ componentWillUnmount() {
13
+ modalRoot.removeChild(this.el);
14
+ }
15
+ render() {
16
+ return ReactDOM.createPortal(this.props.children, this.el);
17
+ }
18
+ }
@@ -1,5 +1,5 @@
1
1
  import { CellType, FORMULA_RESULT_TYPE } from 'dtable-utils';
2
- var NUMBER_TYPES = {
2
+ const NUMBER_TYPES = {
3
3
  'NUMBER': 'number',
4
4
  'NUMBER_WITH_COMMAS': 'number-with-commas',
5
5
  'PERCENT': 'percent',
@@ -8,7 +8,7 @@ var NUMBER_TYPES = {
8
8
  'DOLLAR': 'dollar',
9
9
  'CUSTOM_CURRENCY': 'custom_currency'
10
10
  };
11
- var DATE_TYPES = {
11
+ const DATE_TYPES = {
12
12
  'D/M/YYYY': 'D/M/YYYY',
13
13
  'D/M/YYYY HH:mm': 'D/M/YYYY HH:mm',
14
14
  'M/D/YYYY': 'M/D/YY',
@@ -16,7 +16,7 @@ var DATE_TYPES = {
16
16
  'YYYY-MM-DD': 'YYYY-MM-DD',
17
17
  'YYYY-MM-DD HH:mm': 'YYYY-MM-DD HH:mm'
18
18
  };
19
- var SIMPLE_CELL_COLUMNS = [CellType.TEXT, CellType.NUMBER, CellType.DATE, CellType.CTIME, CellType.MTIME, CellType.AUTO_NUMBER, CellType.URL, CellType.EMAIL, CellType.DURATION, CellType.CHECKBOX, CellType.RATE];
20
- var ARRAY_FORMAT_COLUMNS = [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR];
21
- var SIMPLE_CELL_FORMULA_RESULTS = [FORMULA_RESULT_TYPE.NUMBER, FORMULA_RESULT_TYPE.STRING, FORMULA_RESULT_TYPE.DATE, FORMULA_RESULT_TYPE.BOOL];
19
+ const SIMPLE_CELL_COLUMNS = [CellType.TEXT, CellType.NUMBER, CellType.DATE, CellType.CTIME, CellType.MTIME, CellType.AUTO_NUMBER, CellType.URL, CellType.EMAIL, CellType.DURATION, CellType.CHECKBOX, CellType.RATE];
20
+ const ARRAY_FORMAT_COLUMNS = [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR];
21
+ const SIMPLE_CELL_FORMULA_RESULTS = [FORMULA_RESULT_TYPE.NUMBER, FORMULA_RESULT_TYPE.STRING, FORMULA_RESULT_TYPE.DATE, FORMULA_RESULT_TYPE.BOOL];
22
22
  export { CellType, NUMBER_TYPES, DATE_TYPES, FORMULA_RESULT_TYPE, SIMPLE_CELL_COLUMNS, ARRAY_FORMAT_COLUMNS, SIMPLE_CELL_FORMULA_RESULTS };
@@ -1,4 +1,4 @@
1
- var DTABLE_VALUE = {
1
+ const DTABLE_VALUE = {
2
2
  'tables': [{
3
3
  '_id': '0000',
4
4
  'name': 'Table1',
@@ -2709,7 +2709,7 @@ var DTABLE_VALUE = {
2709
2709
  'header_settings': {}
2710
2710
  }]
2711
2711
  };
2712
- var DEPARTMENTS = [{
2712
+ const DEPARTMENTS = [{
2713
2713
  id: 1,
2714
2714
  id_in_org: 1,
2715
2715
  name: '海文互知',
@@ -2728,7 +2728,7 @@ var DEPARTMENTS = [{
2728
2728
  org_id: -1,
2729
2729
  parent_id: 1
2730
2730
  }];
2731
- var COLLABORATORS = [{
2731
+ const COLLABORATORS = [{
2732
2732
  'avatar_url': 'https://dev.seatable.cn/image-view/avatars/0/0/916e1e9e7c6184061cb7d96a680292/resized/80/de58ef113a311d390934b06ceafd77cf.png',
2733
2733
  'contact_email': '',
2734
2734
  'email': 'anbing@1.com',
@@ -2757,7 +2757,7 @@ var COLLABORATORS = [{
2757
2757
  'name_pinyin': 'an\'bing',
2758
2758
  'id': 'W-00009'
2759
2759
  }];
2760
- var SIGN_CONFIG = {
2760
+ const SIGN_CONFIG = {
2761
2761
  server: 'https://dev.seatable.cn',
2762
2762
  workspaceID: 3,
2763
2763
  dtableUuid: '8327efbf-c9ff-4a14-9010-00e801a7e295'
@@ -1,5 +1,3 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- var _CellType$DEFAULT$Cel;
3
1
  import React from 'react';
4
2
  import { CellType } from '../constants';
5
3
  import CheckboxFormatter from '../CheckboxFormatter';
@@ -23,4 +21,27 @@ import EmailFormatter from '../EmailFormatter';
23
21
  import DurationFormatter from '../DurationFormatter';
24
22
  import RateFormatter from '../RateFormatter';
25
23
  import ButtonFormatter from '../ButtonFormatter';
26
- export default (_CellType$DEFAULT$Cel = {}, _defineProperty(_CellType$DEFAULT$Cel, CellType.DEFAULT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.TEXT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.CHECKBOX, /*#__PURE__*/React.createElement(CheckboxFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.LONG_TEXT, /*#__PURE__*/React.createElement(SimpleLongTextFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.SINGLE_SELECT, /*#__PURE__*/React.createElement(SingleSelectFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.IMAGE, /*#__PURE__*/React.createElement(ImageFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.FILE, /*#__PURE__*/React.createElement(FileFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.MULTIPLE_SELECT, /*#__PURE__*/React.createElement(MultipleSelectFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.COLLABORATOR, /*#__PURE__*/React.createElement(CollaboratorFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.NUMBER, /*#__PURE__*/React.createElement(NumberFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.DATE, /*#__PURE__*/React.createElement(DateFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.CREATOR, /*#__PURE__*/React.createElement(CreatorFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.CTIME, /*#__PURE__*/React.createElement(CTimeFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.LAST_MODIFIER, /*#__PURE__*/React.createElement(LastModifierFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.MTIME, /*#__PURE__*/React.createElement(MTimeFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.GEOLOCATION, /*#__PURE__*/React.createElement(GeolocationFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.AUTO_NUMBER, /*#__PURE__*/React.createElement(AutoNumberFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.URL, /*#__PURE__*/React.createElement(UrlFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.EMAIL, /*#__PURE__*/React.createElement(EmailFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.DURATION, /*#__PURE__*/React.createElement(DurationFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.RATE, /*#__PURE__*/React.createElement(RateFormatter, null)), _defineProperty(_CellType$DEFAULT$Cel, CellType.BUTTON, /*#__PURE__*/React.createElement(ButtonFormatter, null)), _CellType$DEFAULT$Cel);
24
+ export default {
25
+ [CellType.DEFAULT]: /*#__PURE__*/React.createElement(TextCellFormatter, null),
26
+ [CellType.TEXT]: /*#__PURE__*/React.createElement(TextCellFormatter, null),
27
+ [CellType.CHECKBOX]: /*#__PURE__*/React.createElement(CheckboxFormatter, null),
28
+ [CellType.LONG_TEXT]: /*#__PURE__*/React.createElement(SimpleLongTextFormatter, null),
29
+ [CellType.SINGLE_SELECT]: /*#__PURE__*/React.createElement(SingleSelectFormatter, null),
30
+ [CellType.IMAGE]: /*#__PURE__*/React.createElement(ImageFormatter, null),
31
+ [CellType.FILE]: /*#__PURE__*/React.createElement(FileFormatter, null),
32
+ [CellType.MULTIPLE_SELECT]: /*#__PURE__*/React.createElement(MultipleSelectFormatter, null),
33
+ [CellType.COLLABORATOR]: /*#__PURE__*/React.createElement(CollaboratorFormatter, null),
34
+ [CellType.NUMBER]: /*#__PURE__*/React.createElement(NumberFormatter, null),
35
+ [CellType.DATE]: /*#__PURE__*/React.createElement(DateFormatter, null),
36
+ [CellType.CREATOR]: /*#__PURE__*/React.createElement(CreatorFormatter, null),
37
+ [CellType.CTIME]: /*#__PURE__*/React.createElement(CTimeFormatter, null),
38
+ [CellType.LAST_MODIFIER]: /*#__PURE__*/React.createElement(LastModifierFormatter, null),
39
+ [CellType.MTIME]: /*#__PURE__*/React.createElement(MTimeFormatter, null),
40
+ [CellType.GEOLOCATION]: /*#__PURE__*/React.createElement(GeolocationFormatter, null),
41
+ [CellType.AUTO_NUMBER]: /*#__PURE__*/React.createElement(AutoNumberFormatter, null),
42
+ [CellType.URL]: /*#__PURE__*/React.createElement(UrlFormatter, null),
43
+ [CellType.EMAIL]: /*#__PURE__*/React.createElement(EmailFormatter, null),
44
+ [CellType.DURATION]: /*#__PURE__*/React.createElement(DurationFormatter, null),
45
+ [CellType.RATE]: /*#__PURE__*/React.createElement(RateFormatter, null),
46
+ [CellType.BUTTON]: /*#__PURE__*/React.createElement(ButtonFormatter, null)
47
+ };
@@ -1,10 +1,11 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- var _objectSpread2;
4
1
  import React from 'react';
5
2
  import { CellType } from '../constants';
6
3
  import BaseFormatterConfig from './base-formatter-config';
7
4
  import LinkFormatter from '../LinkFormatter';
8
5
  import FormulaFormatter from '../FormulaFormatter';
9
- var FormatterConfig = _objectSpread(_objectSpread({}, BaseFormatterConfig), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, CellType.FORMULA, /*#__PURE__*/React.createElement(FormulaFormatter, null)), _defineProperty(_objectSpread2, CellType.LINK, /*#__PURE__*/React.createElement(LinkFormatter, null)), _objectSpread2));
6
+ const FormatterConfig = {
7
+ ...BaseFormatterConfig,
8
+ [CellType.FORMULA]: /*#__PURE__*/React.createElement(FormulaFormatter, null),
9
+ [CellType.LINK]: /*#__PURE__*/React.createElement(LinkFormatter, null)
10
+ };
10
11
  export default FormatterConfig;
package/lib/lang/index.js CHANGED
@@ -2,16 +2,16 @@ import de from '../locals/de';
2
2
  import en from '../locals/en';
3
3
  import fr from '../locals/fr';
4
4
  import zh_CN from '../locals/zh-CN';
5
- var langData = {
5
+ let langData = {
6
6
  'de': de,
7
7
  'en': en,
8
8
  'fr': fr,
9
9
  'zh-cn': zh_CN
10
10
  };
11
- var LANGUAGE = 'en';
12
- var LANGUAGE_MAP = langData[LANGUAGE];
11
+ const LANGUAGE = 'en';
12
+ let LANGUAGE_MAP = langData[LANGUAGE];
13
13
  export function setLocale(args) {
14
- var lang = typeof args === 'string' ? args : LANGUAGE;
14
+ let lang = typeof args === 'string' ? args : LANGUAGE;
15
15
  LANGUAGE_MAP = langData[lang] || langData[LANGUAGE];
16
16
  }
17
17
  export function getLocale(key, def) {
@@ -26,14 +26,14 @@ export function substitute(str, obj) {
26
26
  if (str.indexOf('{') < 0) {
27
27
  return str;
28
28
  }
29
- return str.replace(/\\?\{([^{}]+)\}/g, function (match, name) {
29
+ return str.replace(/\\?\{([^{}]+)\}/g, (match, name) => {
30
30
  if (match.charAt(0) === '\\') {
31
31
  return match.slice(1);
32
32
  }
33
33
  return obj[name] === null || obj[name] === undefined ? '' : obj[name];
34
34
  });
35
35
  } else if (typeof str === 'function') {
36
- var val = str(obj);
36
+ let val = str(obj);
37
37
  if (val === obj && typeof val === 'object') {
38
38
  val = Object.assign({}, obj);
39
39
  }
package/lib/locals/de.js CHANGED
@@ -1,2 +1,2 @@
1
- var de = {};
1
+ const de = {};
2
2
  export default de;
package/lib/locals/en.js CHANGED
@@ -1,4 +1,4 @@
1
- var en = {
1
+ const en = {
2
2
  Add_an_option: 'Add an option',
3
3
  Find_an_option: 'Find a option',
4
4
  No_options_available: 'No options available',
package/lib/locals/fr.js CHANGED
@@ -1,2 +1,2 @@
1
- var fr = {};
1
+ const fr = {};
2
2
  export default fr;
@@ -1,4 +1,4 @@
1
- var zh_CN = {
1
+ const zh_CN = {
2
2
  Add_an_option: '添加一个选项',
3
3
  Find_an_option: '查找标签',
4
4
  No_options_available: '没有找到标签。',