dtable-ui-component 0.1.75-beta → 0.1.75-beta4

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 (144) hide show
  1. package/lib/AutoNumberFormatter/index.css +1 -0
  2. package/{es/components/cell-formatter/auto-number-formatter.js → lib/AutoNumberFormatter/index.js} +1 -0
  3. package/lib/ButtonFormatter/index.css +13 -0
  4. package/{es/components/cell-formatter/button-formatter.js → lib/ButtonFormatter/index.js} +1 -0
  5. package/lib/CTimeFormatter/index.css +1 -0
  6. package/{es/components/cell-formatter/ctime-formatter.js → lib/CTimeFormatter/index.js} +1 -0
  7. package/lib/CheckboxFormatter/index.css +1 -0
  8. package/{es/components/cell-formatter/checkbox-formatter.js → lib/CheckboxFormatter/index.js} +1 -0
  9. package/lib/CollaboratorFormatter/index.css +1 -0
  10. package/{es/components/cell-formatter/collaborator-formatter.js → lib/CollaboratorFormatter/index.js} +3 -2
  11. package/lib/CollaboratorItem/index.css +49 -0
  12. package/lib/CollaboratorItem/index.js +64 -0
  13. package/lib/CreatorFormatter/index.css +1 -0
  14. package/{es/components/cell-formatter/creator-formatter.js → lib/CreatorFormatter/index.js} +3 -2
  15. package/lib/DateFormatter/index.css +1 -0
  16. package/{es/components/cell-formatter/date-formatter.js → lib/DateFormatter/index.js} +2 -1
  17. package/lib/DurationFormatter/index.css +1 -0
  18. package/{es/components/cell-formatter/duration-formatter.js → lib/DurationFormatter/index.js} +2 -1
  19. package/lib/EmailFormatter/index.css +5 -0
  20. package/{es/components/cell-formatter/email-formatter.js → lib/EmailFormatter/index.js} +1 -0
  21. package/lib/FileFormatter/index.css +29 -0
  22. package/{es/components/cell-formatter/file-formatter.js → lib/FileFormatter/index.js} +2 -1
  23. package/{es/components/cell-formatter/widgets/file-item-formatter.js → lib/FileItemFormatter/index.js} +3 -2
  24. package/{es/components/file-uploader → lib/FileUploader}/index.js +0 -0
  25. package/lib/FormulaFormatter/index.css +19 -0
  26. package/{es/components/cell-formatter/formula-formatter.js → lib/FormulaFormatter/index.js} +8 -8
  27. package/lib/GeolocationFormatter/index.css +1 -0
  28. package/{es/components/cell-formatter/geolocation-formatter.js → lib/GeolocationFormatter/index.js} +2 -1
  29. package/{es/components/common → lib/ImageFormatter}/images-lazy-load.js +2 -2
  30. package/lib/ImageFormatter/index.css +34 -0
  31. package/{es/components/cell-formatter/image-formatter.js → lib/ImageFormatter/index.js} +4 -3
  32. package/{es/css/image-previewer-ligntbox.css → lib/ImagePreviewerLightbox/index.css} +0 -0
  33. package/{es/components/cell-formatter/widgets/image-previewer-lightbox.js → lib/ImagePreviewerLightbox/index.js} +3 -3
  34. package/lib/LastModifierFormatter/index.css +1 -0
  35. package/{es/components/cell-formatter/last-modifier-formatter.js → lib/LastModifierFormatter/index.js} +5 -4
  36. package/lib/LinkFormatter/index.css +27 -0
  37. package/{es/components/cell-formatter/link-formatter.js → lib/LinkFormatter/index.js} +2 -2
  38. package/{es/css/loading.css → lib/Loading/index.css} +0 -0
  39. package/{es/components/loading.js → lib/Loading/index.js} +1 -1
  40. package/{es/components/cell-formatter/widgets/long-text-formatter → lib/LongTextFormatter}/html-long-text-formatter.js +1 -1
  41. package/lib/LongTextFormatter/index.css +63 -0
  42. package/{es/components/cell-formatter/long-text-formatter.js → lib/LongTextFormatter/index.js} +3 -2
  43. package/{es/components/cell-formatter/widgets/long-text-formatter → lib/LongTextFormatter}/simple-long-text-formatter.js +1 -1
  44. package/lib/MTimeFormatter/index.css +1 -0
  45. package/{es/components/cell-formatter/mtime-formatter.js → lib/MTimeFormatter/index.js} +1 -0
  46. package/{es/components/common/modal-portal.js → lib/ModalPortal/index.js} +0 -0
  47. package/lib/MultipleSelectFormatter/index.css +1 -0
  48. package/{es/components/cell-formatter/multiple-select-formatter.js → lib/MultipleSelectFormatter/index.js} +2 -1
  49. package/lib/NumberFormatter/index.css +1 -0
  50. package/{es/components/cell-formatter/number-formatter.js → lib/NumberFormatter/index.js} +2 -1
  51. package/lib/RateFormatter/index.css +1 -0
  52. package/{es/components/cell-formatter/rate-formatter.js → lib/RateFormatter/index.js} +1 -0
  53. package/{es/components/common/select-item.js → lib/SelectItem/index.js} +0 -0
  54. package/lib/SingleSelectFormatter/index.css +1 -0
  55. package/{es/components/cell-formatter/single-select-formatter.js → lib/SingleSelectFormatter/index.js} +2 -1
  56. package/lib/TextFormatter/index.css +1 -0
  57. package/{es/components/cell-formatter/text-formatter.js → lib/TextFormatter/index.js} +1 -0
  58. package/lib/UrlFormatter/index.css +5 -0
  59. package/{es/components/cell-formatter/url-formatter.js → lib/UrlFormatter/index.js} +1 -0
  60. package/{es → lib}/app.css +0 -0
  61. package/{es → lib}/app.js +1 -1
  62. package/{es → lib}/assets/images/avatar/default_avatar.png +0 -0
  63. package/{es → lib}/assets/images/file/192/excel.png +0 -0
  64. package/{es → lib}/assets/images/file/192/file.png +0 -0
  65. package/{es → lib}/assets/images/file/192/music.png +0 -0
  66. package/{es → lib}/assets/images/file/192/pdf.png +0 -0
  67. package/{es → lib}/assets/images/file/192/pic.png +0 -0
  68. package/{es → lib}/assets/images/file/192/ppt.png +0 -0
  69. package/{es → lib}/assets/images/file/192/txt.png +0 -0
  70. package/{es → lib}/assets/images/file/192/video.png +0 -0
  71. package/{es → lib}/assets/images/file/192/word.png +0 -0
  72. package/{es → lib}/assets/images/file/24/excel.png +0 -0
  73. package/{es → lib}/assets/images/file/24/file.png +0 -0
  74. package/{es → lib}/assets/images/file/24/music.png +0 -0
  75. package/{es → lib}/assets/images/file/24/pdf.png +0 -0
  76. package/{es → lib}/assets/images/file/24/pic.png +0 -0
  77. package/{es → lib}/assets/images/file/24/ppt.png +0 -0
  78. package/{es → lib}/assets/images/file/24/txt.png +0 -0
  79. package/{es → lib}/assets/images/file/24/video.png +0 -0
  80. package/{es → lib}/assets/images/file/24/word.png +0 -0
  81. package/{es → lib}/assets/images/folder/folder-192.png +0 -0
  82. package/{es → lib}/assets/images/folder/folder-24.png +0 -0
  83. package/{es/components/cell-factory/cell-formatter-factory.js → lib/cellFormatterFactory/index.js} +3 -3
  84. package/{es → lib}/components/cell-editor/checkbox-editor.js +0 -0
  85. package/{es → lib}/components/cell-editor/collaborator-editor.js +0 -0
  86. package/{es → lib}/components/cell-editor/date-editor.js +0 -0
  87. package/{es → lib}/components/cell-editor/index.js +0 -0
  88. package/{es → lib}/components/cell-editor/link-editor.js +0 -0
  89. package/{es → lib}/components/cell-editor/multiple-select-editor.js +0 -0
  90. package/{es → lib}/components/cell-editor/number-editor.js +0 -0
  91. package/{es → lib}/components/cell-editor/single-select-editor.js +0 -0
  92. package/{es → lib}/components/cell-editor/text-editor.js +0 -0
  93. package/{es → lib}/components/cell-editor-dialog/pc-file-editor-dialog.js +0 -0
  94. package/{es → lib}/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
  95. package/{es → lib}/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
  96. package/{es → lib}/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
  97. package/{es → lib}/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
  98. package/{es → lib}/components/cell-editor-popover/mb-collaborator-editor-popover.js +0 -0
  99. package/{es → lib}/components/cell-editor-popover/mb-date-editor-popover.js +0 -0
  100. package/{es → lib}/components/cell-editor-popover/mb-link-editor-popover.js +0 -0
  101. package/{es → lib}/components/cell-editor-popover/mb-select-editor-popover.js +0 -0
  102. package/{es → lib}/components/cell-editor-popover/pc-collaborator-editor-popover.js +0 -0
  103. package/{es → lib}/components/cell-editor-popover/pc-date-editor-popover.js +0 -0
  104. package/{es → lib}/components/cell-editor-popover/pc-link-editor-popover.js +0 -0
  105. package/{es → lib}/components/cell-editor-popover/pc-select-editor-popover.js +0 -0
  106. package/{es → lib}/components/common/collaborator-item.js +0 -0
  107. package/{es → lib}/components/common/edit-editor-button.js +0 -0
  108. package/{es → lib}/components/common/link-editor-option.js +0 -0
  109. package/{es → lib}/components/common/mobile/mb-editor-header.js +0 -0
  110. package/{es → lib}/components/common/select-editor-option.js +0 -0
  111. package/{es → lib}/constants/cell-types.js +0 -0
  112. package/lib/constants/index.js +49 -0
  113. package/{es → lib}/css/cell-editor.css +0 -0
  114. package/lib/css/cell-formatter.css +4 -0
  115. package/{es → lib}/css/custom-rc-calendar.css +0 -0
  116. package/lib/formatterConfig/index.js +31 -0
  117. package/lib/index.js +31 -0
  118. package/{es → lib}/lang/index.js +0 -0
  119. package/{es → lib}/locals/de.js +0 -0
  120. package/{es → lib}/locals/en.js +0 -0
  121. package/{es → lib}/locals/fr.js +0 -0
  122. package/{es → lib}/locals/zh-CN.js +0 -0
  123. package/{es/components/toast → lib/toaster}/alert.js +0 -0
  124. package/{es/components/toast → lib/toaster}/index.js +0 -0
  125. package/{es/components/toast → lib/toaster}/toast.js +0 -0
  126. package/{es/components/toast → lib/toaster}/toastManager.js +0 -0
  127. package/{es/components/toast → lib/toaster}/toaster.js +0 -0
  128. package/{es → lib}/utils/cell-value-validator.js +1 -2
  129. package/{es → lib}/utils/column-utils.js +0 -0
  130. package/{es → lib}/utils/editor-utils.js +0 -0
  131. package/{es → lib}/utils/markdown2html.js +0 -0
  132. package/{es → lib}/utils/normalize-long-text-value.js +0 -0
  133. package/{es → lib}/utils/number-precision.js +1 -0
  134. package/{es → lib}/utils/unified/index.js +0 -0
  135. package/{es → lib}/utils/utils.js +0 -0
  136. package/{es → lib}/utils/value-format-utils.js +2 -0
  137. package/{es → lib}/utils/vfile/core.js +0 -0
  138. package/{es → lib}/utils/vfile/index.js +0 -0
  139. package/package.json +5 -5
  140. package/es/components/cell-formatter/formatter-config.js +0 -31
  141. package/es/components/cell-formatter/index.js +0 -27
  142. package/es/constants/index.js +0 -48
  143. package/es/css/cell-formatter.css +0 -247
  144. package/es/index.js +0 -6
@@ -5,6 +5,7 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
6
  import cn from 'astro-classname';
7
7
  import moment from 'moment';
8
+ import './index.css';
8
9
 
9
10
  var MTimeFormatter = /*#__PURE__*/function (_React$Component) {
10
11
  _inherits(MTimeFormatter, _React$Component);
@@ -0,0 +1 @@
1
+ @import url('../css/cell-formatter.css');
@@ -4,7 +4,8 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
6
  import cn from 'astro-classname';
7
- import SelectItem from '../common/select-item';
7
+ import SelectItem from '../SelectItem';
8
+ import './index.css';
8
9
 
9
10
  var MultipleSelectFormatter = /*#__PURE__*/function (_React$PureComponent) {
10
11
  _inherits(MultipleSelectFormatter, _React$PureComponent);
@@ -0,0 +1 @@
1
+ @import url('../css/cell-formatter.css');
@@ -4,7 +4,8 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
6
  import cn from 'astro-classname';
7
- import { getNumberDisplayString } from '../../utils/value-format-utils';
7
+ import { getNumberDisplayString } from '../utils/value-format-utils';
8
+ import './index.css';
8
9
 
9
10
  var NumberFormatter = /*#__PURE__*/function (_React$Component) {
10
11
  _inherits(NumberFormatter, _React$Component);
@@ -0,0 +1 @@
1
+ @import url('../css/cell-formatter.css');
@@ -4,6 +4,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
6
  import cn from 'astro-classname';
7
+ import './index.css';
7
8
 
8
9
  var RateFormatter = /*#__PURE__*/function (_React$Component) {
9
10
  _inherits(RateFormatter, _React$Component);
@@ -0,0 +1 @@
1
+ @import url('../css/cell-formatter.css');
@@ -4,7 +4,8 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
6
  import cn from 'astro-classname';
7
- import SelectItem from '../common/select-item';
7
+ import SelectItem from '../SelectItem';
8
+ import './index.css';
8
9
 
9
10
  var SingleSelectFormatter = /*#__PURE__*/function (_React$PureComponent) {
10
11
  _inherits(SingleSelectFormatter, _React$PureComponent);
@@ -0,0 +1 @@
1
+ @import url('../css/cell-formatter.css');
@@ -4,6 +4,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
6
  import cn from 'astro-classname';
7
+ import './index.css';
7
8
 
8
9
  var TextFormatter = /*#__PURE__*/function (_React$Component) {
9
10
  _inherits(TextFormatter, _React$Component);
@@ -0,0 +1,5 @@
1
+ @import url('../css/cell-formatter.css');
2
+
3
+ .dtable-ui.url-formatter {
4
+ text-decoration: underline;
5
+ }
@@ -4,6 +4,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
6
  import cn from 'astro-classname';
7
+ import './index.css';
7
8
 
8
9
  var UrlFormatter = /*#__PURE__*/function (_React$Component) {
9
10
  _inherits(UrlFormatter, _React$Component);
File without changes
@@ -3,7 +3,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React from 'react';
6
- import { CollaboratorFormatter, SingleSelectFormatter } from './components/cell-formatter';
6
+ import { CollaboratorFormatter, SingleSelectFormatter } from './index';
7
7
  import './app.css';
8
8
 
9
9
  var App = /*#__PURE__*/function (_React$Component) {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import FormatterConfig from '../cell-formatter/formatter-config';
3
+ import formatterConfig from '../formatterConfig';
4
4
 
5
5
  var CellFormatterFactory = /*#__PURE__*/function () {
6
6
  function CellFormatterFactory() {
@@ -10,8 +10,8 @@ var CellFormatterFactory = /*#__PURE__*/function () {
10
10
  _createClass(CellFormatterFactory, [{
11
11
  key: "createFormatter",
12
12
  value: function createFormatter(formatterType) {
13
- if (FormatterConfig[formatterType]) {
14
- return FormatterConfig[formatterType];
13
+ if (formatterConfig[formatterType]) {
14
+ return formatterConfig[formatterType];
15
15
  }
16
16
 
17
17
  return null;
File without changes
File without changes
@@ -0,0 +1,49 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+
3
+ var _DURATION_ZERO_DISPLA, _DURATION_DECIMAL_DIG;
4
+
5
+ import * as CellType from './cell-types';
6
+ var NUMBER_TYPES = {
7
+ 'NUMBER': 'number',
8
+ 'NUMBER_WITH_COMMAS': 'number-with-commas',
9
+ 'PERCENT': 'percent',
10
+ 'YUAN': 'yuan',
11
+ 'EURO': 'euro',
12
+ 'DOLLAR': 'dollar'
13
+ };
14
+ var DATE_TYPES = {
15
+ 'D/M/YYYY': 'D/M/YYYY',
16
+ 'D/M/YYYY HH:mm': 'D/M/YYYY HH:mm',
17
+ 'M/D/YYYY': 'M/D/YY',
18
+ 'M/D/YYYY HH:mm': 'M/D/YYYY HH:mm',
19
+ 'YYYY-MM-DD': 'YYYY-MM-DD',
20
+ 'YYYY-MM-DD HH:mm': 'YYYY-MM-DD HH:mm'
21
+ };
22
+ var FORMULA_RESULT_TYPE = {
23
+ NUMBER: 'number',
24
+ STRING: 'string',
25
+ DATE: 'date',
26
+ BOOL: 'bool',
27
+ ARRAY: 'array'
28
+ };
29
+ var SIMPLE_CELL_COLUMNS = [CellType.TEXT, CellType.NUMBER, CellType.DATE, CellType.CTIME, CellType.MTIME, CellType.GEOLOCATION, CellType.AUTO_NUMBER, CellType.URL, CellType.EMAIL, CellType.DURATION, CellType.CHECKBOX, CellType.RATE];
30
+ var ARRAY_FORMAL_COLUMNS = [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR];
31
+ var SIMPLE_CELL_FORMULA_RESULTS = [FORMULA_RESULT_TYPE.NUMBER, FORMULA_RESULT_TYPE.STRING, FORMULA_RESULT_TYPE.DATE, FORMULA_RESULT_TYPE.BOOL];
32
+ var COLLABORATOR_COLUMN_TYPES = [CellType.COLLABORATOR, CellType.CREATOR, CellType.LAST_MODIFIER];
33
+ var ARRAY_FORMAL_COLUMNS_TYPES = [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR];
34
+ var DEFAULT_NUMBER_FORMAT = 'number';
35
+ var DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
36
+ var DURATION_FORMATS_MAP = {
37
+ H_MM: 'h:mm',
38
+ H_MM_SS: 'h:mm:ss'
39
+ };
40
+ var DURATION_FORMATS = [{
41
+ name: DURATION_FORMATS_MAP.H_MM,
42
+ type: DURATION_FORMATS_MAP.H_MM
43
+ }, {
44
+ name: DURATION_FORMATS_MAP.H_MM_SS,
45
+ type: DURATION_FORMATS_MAP.H_MM_SS
46
+ }];
47
+ var DURATION_ZERO_DISPLAY = (_DURATION_ZERO_DISPLA = {}, _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM, '0:00'), _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM_SS, '0:00'), _DURATION_ZERO_DISPLA);
48
+ var DURATION_DECIMAL_DIGITS = (_DURATION_DECIMAL_DIG = {}, _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM, 0), _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM_SS, 0), _DURATION_DECIMAL_DIG);
49
+ export { CellType, NUMBER_TYPES, DATE_TYPES, FORMULA_RESULT_TYPE, SIMPLE_CELL_COLUMNS, ARRAY_FORMAL_COLUMNS, SIMPLE_CELL_FORMULA_RESULTS, COLLABORATOR_COLUMN_TYPES, ARRAY_FORMAL_COLUMNS_TYPES, DEFAULT_NUMBER_FORMAT, DEFAULT_DATE_FORMAT, DURATION_FORMATS_MAP, DURATION_FORMATS, DURATION_ZERO_DISPLAY, DURATION_DECIMAL_DIGITS };
File without changes
@@ -0,0 +1,4 @@
1
+ .dtable-ui.cell-formatter-container {
2
+ overflow: hidden;
3
+ line-height: 1;
4
+ }
File without changes
@@ -0,0 +1,31 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+
3
+ var _FormatterConfig;
4
+
5
+ import React from 'react';
6
+ import { CellType } from '../constants';
7
+ import CheckboxFormatter from '../CheckboxFormatter';
8
+ import ImageFormatter from '../ImageFormatter';
9
+ import LongTextFormatter from '../LongTextFormatter';
10
+ import TextCellFormatter from '../TextFormatter';
11
+ import SingleSelectFormatter from '../SingleSelectFormatter';
12
+ import MultipleSelectFormatter from '../MultipleSelectFormatter';
13
+ import FileFormatter from '../FileFormatter';
14
+ import LinkFormatter from '../LinkFormatter';
15
+ import CollaboratorFormatter from '../CollaboratorFormatter';
16
+ import NumberFormatter from '../NumberFormatter';
17
+ import DateFormatter from '../DateFormatter';
18
+ import CreatorFormatter from '../CreatorFormatter';
19
+ import CTimeFormatter from '../CTimeFormatter';
20
+ import LastModifierFormatter from '../LastModifierFormatter';
21
+ import MTimeFormatter from '../MTimeFormatter';
22
+ import GeolocationFormatter from '../GeolocationFormatter';
23
+ import FormulaFormatter from '../FormulaFormatter';
24
+ import AutoNumberFormatter from '../AutoNumberFormatter';
25
+ import UrlFormatter from '../UrlFormatter';
26
+ import EmailFormatter from '../EmailFormatter';
27
+ import DurationFormatter from '../DurationFormatter';
28
+ import RateFormatter from '../RateFormatter';
29
+ import ButtonFormatter from '../ButtonFormatter';
30
+ var FormatterConfig = (_FormatterConfig = {}, _defineProperty(_FormatterConfig, CellType.DEFAULT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_FormatterConfig, CellType.TEXT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_FormatterConfig, CellType.CHECKBOX, /*#__PURE__*/React.createElement(CheckboxFormatter, null)), _defineProperty(_FormatterConfig, CellType.LONG_TEXT, /*#__PURE__*/React.createElement(LongTextFormatter, null)), _defineProperty(_FormatterConfig, CellType.SINGLE_SELECT, /*#__PURE__*/React.createElement(SingleSelectFormatter, null)), _defineProperty(_FormatterConfig, CellType.IMAGE, /*#__PURE__*/React.createElement(ImageFormatter, null)), _defineProperty(_FormatterConfig, CellType.FILE, /*#__PURE__*/React.createElement(FileFormatter, null)), _defineProperty(_FormatterConfig, CellType.MULTIPLE_SELECT, /*#__PURE__*/React.createElement(MultipleSelectFormatter, null)), _defineProperty(_FormatterConfig, CellType.COLLABORATOR, /*#__PURE__*/React.createElement(CollaboratorFormatter, null)), _defineProperty(_FormatterConfig, CellType.NUMBER, /*#__PURE__*/React.createElement(NumberFormatter, null)), _defineProperty(_FormatterConfig, CellType.DATE, /*#__PURE__*/React.createElement(DateFormatter, null)), _defineProperty(_FormatterConfig, CellType.LINK, /*#__PURE__*/React.createElement(LinkFormatter, null)), _defineProperty(_FormatterConfig, CellType.CREATOR, /*#__PURE__*/React.createElement(CreatorFormatter, null)), _defineProperty(_FormatterConfig, CellType.CTIME, /*#__PURE__*/React.createElement(CTimeFormatter, null)), _defineProperty(_FormatterConfig, CellType.LAST_MODIFIER, /*#__PURE__*/React.createElement(LastModifierFormatter, null)), _defineProperty(_FormatterConfig, CellType.MTIME, /*#__PURE__*/React.createElement(MTimeFormatter, null)), _defineProperty(_FormatterConfig, CellType.GEOLOCATION, /*#__PURE__*/React.createElement(GeolocationFormatter, null)), _defineProperty(_FormatterConfig, CellType.FORMULA, /*#__PURE__*/React.createElement(FormulaFormatter, null)), _defineProperty(_FormatterConfig, CellType.AUTO_NUMBER, /*#__PURE__*/React.createElement(AutoNumberFormatter, null)), _defineProperty(_FormatterConfig, CellType.URL, /*#__PURE__*/React.createElement(UrlFormatter, null)), _defineProperty(_FormatterConfig, CellType.EMAIL, /*#__PURE__*/React.createElement(EmailFormatter, null)), _defineProperty(_FormatterConfig, CellType.DURATION, /*#__PURE__*/React.createElement(DurationFormatter, null)), _defineProperty(_FormatterConfig, CellType.RATE, /*#__PURE__*/React.createElement(RateFormatter, null)), _defineProperty(_FormatterConfig, CellType.BUTTON, /*#__PURE__*/React.createElement(ButtonFormatter, null)), _FormatterConfig);
31
+ export default FormatterConfig;
package/lib/index.js ADDED
@@ -0,0 +1,31 @@
1
+ export { default as toaster } from './toaster';
2
+ export { setLocale } from './lang';
3
+ export { getDateDisplayString, getNumberDisplayString, formatStringToNumber, formatNumberString } from './utils/value-format-utils';
4
+ export { default as CheckboxFormatter } from './CheckboxFormatter';
5
+ export { default as ImageFormatter } from './ImageFormatter';
6
+ export { default as LongTextFormatter } from './LongTextFormatter';
7
+ export { default as TextFormatter } from './TextFormatter';
8
+ export { default as SingleSelectFormatter } from './SingleSelectFormatter';
9
+ export { default as MultipleSelectFormatter } from './MultipleSelectFormatter';
10
+ export { default as FileFormatter } from './FileFormatter';
11
+ export { default as LinkFormatter } from './LinkFormatter';
12
+ export { default as CollaboratorFormatter } from './CollaboratorFormatter';
13
+ export { default as NumberFormatter } from './NumberFormatter';
14
+ export { default as DateFormatter } from './DateFormatter';
15
+ export { default as CreatorFormatter } from './CreatorFormatter';
16
+ export { default as CTimeFormatter } from './CTimeFormatter';
17
+ export { default as LastModifierFormatter } from './LastModifierFormatter';
18
+ export { default as MTimeFormatter } from './MTimeFormatter';
19
+ export { default as GeolocationFormatter } from './GeolocationFormatter';
20
+ export { default as FormulaFormatter } from './FormulaFormatter';
21
+ export { default as AutoNumberFormatter } from './AutoNumberFormatter';
22
+ export { default as UrlFormatter } from './UrlFormatter';
23
+ export { default as EmailFormatter } from './EmailFormatter';
24
+ export { default as DurationFormatter } from './DurationFormatter';
25
+ export { default as RateFormatter } from './RateFormatter';
26
+ export { default as ButtonFormatter } from './ButtonFormatter';
27
+ export { default as ImagePreviewerLightbox } from './ImagePreviewerLightbox';
28
+ export { default as CollaboratorItem } from './CollaboratorItem';
29
+ export { default as FileItemFormatter } from './FileItemFormatter';
30
+ export { default as Loading } from './Loading';
31
+ export { TextEditor, NumberEditor, CheckboxEditor, SingleSelectEditor, CollaboratorEditor, DateEditor, LinkEditor } from './components/cell-editor';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -2,8 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
 
3
3
  var _validators;
4
4
 
5
- import * as CellType from '../constants/cell-types';
6
- import { FORMULA_RESULT_TYPE } from '../constants';
5
+ import { FORMULA_RESULT_TYPE, CellType } from '../constants';
7
6
 
8
7
  var numberValidator = function numberValidator(value) {
9
8
  return (value || value === 0) && Object.prototype.toString.call(value) === '[object Number]';
File without changes
File without changes
File without changes
File without changes
@@ -48,6 +48,7 @@ function float2Fixed(num) {
48
48
  function checkBoundary(num) {
49
49
  if (_boundaryCheckingState) {
50
50
  if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
51
+ // eslint-disable-next-line no-console
51
52
  console.warn("".concat(num, " is beyond boundary when transfer to integer, the results may not be accurate"));
52
53
  }
53
54
  }
File without changes
File without changes
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-case-declarations */
1
2
  import moment from 'moment';
2
3
  import NP from './number-precision';
3
4
  import { NUMBER_TYPES, DEFAULT_NUMBER_FORMAT, DURATION_FORMATS_MAP, DURATION_FORMATS, DURATION_ZERO_DISPLAY, DURATION_DECIMAL_DIGITS, FORMULA_RESULT_TYPE, COLLABORATOR_COLUMN_TYPES, ARRAY_FORMAL_COLUMNS_TYPES, DEFAULT_DATE_FORMAT } from '../constants';
@@ -167,6 +168,7 @@ export var getDateDisplayString = function getDateDisplayString(value, format) {
167
168
  switch (format) {
168
169
  case 'D/M/YYYY':
169
170
  case 'DD/MM/YYYY':
171
+ // no-case-declarations
170
172
  var formatValue = date.format('YYYY-MM-DD');
171
173
  var formatValueList = formatValue.split('-');
172
174
  return "".concat(formatValueList[2], "/").concat(formatValueList[1], "/").concat(formatValueList[0]);
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.1.75beta",
3
+ "version": "0.1.75beta4",
4
4
  "main": "./es/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "0.0.9",
@@ -45,11 +45,11 @@
45
45
  "eslint": "eslint --ext .jsx,.js src --max-warnings=0",
46
46
  "storybook": "start-storybook -p 6006",
47
47
  "build-storybook": "build-storybook -c .storybook -o docs",
48
- "pub:esm": "npm run clean:esm && export BABEL_ENV=production && ./node_modules/.bin/babel src --out-dir es --copy-files",
49
- "pub:lib": "npm run clean:lib && export BABEL_ENV=node && ./node_modules/.bin/babel src --out-dir lib --copy-files",
48
+ "pub:esm": "npm run clean:esm && export BABEL_ENV=node && ./node_modules/.bin/babel src --out-dir es --copy-files",
49
+ "pub:lib": "npm run clean:lib && export BABEL_ENV=production && ./node_modules/.bin/babel src --out-dir lib --copy-files",
50
50
  "pub:umd": "npm run build",
51
- "pub:optimized": "rm es/index.local.js",
52
- "prepublishOnly": "npm run pub:esm && npm run pub:umd && npm run pub:optimized"
51
+ "pub:optimized": "rm lib/index.local.js",
52
+ "prepublishOnly": "npm run pub:lib && npm run pub:umd && npm run pub:optimized"
53
53
  },
54
54
  "files": [
55
55
  "assets",
@@ -1,31 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
-
3
- var _FormatterConfig;
4
-
5
- import React from 'react';
6
- import * as CellTypes from '../../constants/cell-types';
7
- import CheckboxFormatter from './checkbox-formatter';
8
- import ImageFormatter from './image-formatter';
9
- import LongTextFormatter from './long-text-formatter';
10
- import TextCellFormatter from './text-formatter';
11
- import SingleSelectFormatter from './single-select-formatter';
12
- import MultipleSelectFormatter from './multiple-select-formatter';
13
- import FileFormatter from './file-formatter';
14
- import LinkFormatter from './link-formatter';
15
- import CollaboratorFormatter from './collaborator-formatter';
16
- import NumberFormatter from './number-formatter';
17
- import DateFormatter from './date-formatter';
18
- import CreatorFormatter from './creator-formatter';
19
- import CTimeFormatter from './ctime-formatter';
20
- import LastModifierFormatter from './last-modifier-formatter';
21
- import MTimeFormatter from './mtime-formatter';
22
- import GeolocationFormatter from './geolocation-formatter';
23
- import FormulaFormatter from './formula-formatter';
24
- import AutoNumberFormatter from './auto-number-formatter';
25
- import UrlFormatter from './url-formatter';
26
- import EmailFormatter from './email-formatter';
27
- import DurationFormatter from './duration-formatter';
28
- import RateFormatter from './rate-formatter';
29
- import ButtonFormatter from './button-formatter';
30
- var FormatterConfig = (_FormatterConfig = {}, _defineProperty(_FormatterConfig, CellTypes.DEFAULT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.TEXT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.CHECKBOX, /*#__PURE__*/React.createElement(CheckboxFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.LONG_TEXT, /*#__PURE__*/React.createElement(LongTextFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.SINGLE_SELECT, /*#__PURE__*/React.createElement(SingleSelectFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.IMAGE, /*#__PURE__*/React.createElement(ImageFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.FILE, /*#__PURE__*/React.createElement(FileFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.MULTIPLE_SELECT, /*#__PURE__*/React.createElement(MultipleSelectFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.COLLABORATOR, /*#__PURE__*/React.createElement(CollaboratorFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.NUMBER, /*#__PURE__*/React.createElement(NumberFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.DATE, /*#__PURE__*/React.createElement(DateFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.LINK, /*#__PURE__*/React.createElement(LinkFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.CREATOR, /*#__PURE__*/React.createElement(CreatorFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.CTIME, /*#__PURE__*/React.createElement(CTimeFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.LAST_MODIFIER, /*#__PURE__*/React.createElement(LastModifierFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.MTIME, /*#__PURE__*/React.createElement(MTimeFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.GEOLOCATION, /*#__PURE__*/React.createElement(GeolocationFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.FORMULA, /*#__PURE__*/React.createElement(FormulaFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.AUTO_NUMBER, /*#__PURE__*/React.createElement(AutoNumberFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.URL, /*#__PURE__*/React.createElement(UrlFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.EMAIL, /*#__PURE__*/React.createElement(EmailFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.DURATION, /*#__PURE__*/React.createElement(DurationFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.RATE, /*#__PURE__*/React.createElement(RateFormatter, null)), _defineProperty(_FormatterConfig, CellTypes.BUTTON, /*#__PURE__*/React.createElement(ButtonFormatter, null)), _FormatterConfig);
31
- export default FormatterConfig;
@@ -1,27 +0,0 @@
1
- import '../../css/cell-formatter.css';
2
- export { default as TextFormatter } from './text-formatter';
3
- export { default as NumberFormatter } from './number-formatter';
4
- export { default as DateFormatter } from './date-formatter';
5
- export { default as CheckboxFormatter } from './checkbox-formatter';
6
- export { default as CollaboratorFormatter } from './collaborator-formatter';
7
- export { default as SingleSelectFormatter } from './single-select-formatter';
8
- export { default as MultipleSelectFormatter } from './multiple-select-formatter';
9
- export { default as LongTextFormatter } from './long-text-formatter';
10
- export { default as FileFormatter } from './file-formatter';
11
- export { default as ImageFormatter } from './image-formatter';
12
- export { default as GeolocationFormatter } from './geolocation-formatter';
13
- export { default as CTimeFormatter } from './ctime-formatter';
14
- export { default as CreatorFormatter } from './creator-formatter';
15
- export { default as LastModifierFormatter } from './last-modifier-formatter';
16
- export { default as MTimeFormatter } from './mtime-formatter';
17
- export { default as FormulaFormatter } from './formula-formatter';
18
- export { default as LinkFormatter } from './link-formatter';
19
- export { default as AutoNumberFormatter } from './auto-number-formatter';
20
- export { default as UrlFormatter } from './url-formatter';
21
- export { default as EmailFormatter } from './email-formatter';
22
- export { default as DurationFormatter } from './duration-formatter';
23
- export { default as RateFormatter } from './rate-formatter';
24
- export { default as ButtonFormatter } from './button-formatter';
25
- export { default as FileItemFormatter } from './widgets/file-item-formatter';
26
- export { default as ImagePreviewerLightbox } from './widgets/image-previewer-lightbox';
27
- export { default as CollaboratorItem } from '../common/collaborator-item';
@@ -1,48 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
-
3
- var _DURATION_ZERO_DISPLA, _DURATION_DECIMAL_DIG;
4
-
5
- import * as CellType from './cell-types';
6
- export var NUMBER_TYPES = {
7
- 'NUMBER': 'number',
8
- 'NUMBER_WITH_COMMAS': 'number-with-commas',
9
- 'PERCENT': 'percent',
10
- 'YUAN': 'yuan',
11
- 'EURO': 'euro',
12
- 'DOLLAR': 'dollar'
13
- };
14
- export var DATE_TYPES = {
15
- 'D/M/YYYY': 'D/M/YYYY',
16
- 'D/M/YYYY HH:mm': 'D/M/YYYY HH:mm',
17
- 'M/D/YYYY': 'M/D/YY',
18
- 'M/D/YYYY HH:mm': 'M/D/YYYY HH:mm',
19
- 'YYYY-MM-DD': 'YYYY-MM-DD',
20
- 'YYYY-MM-DD HH:mm': 'YYYY-MM-DD HH:mm'
21
- };
22
- export var FORMULA_RESULT_TYPE = {
23
- NUMBER: 'number',
24
- STRING: 'string',
25
- DATE: 'date',
26
- BOOL: 'bool',
27
- ARRAY: 'array'
28
- };
29
- export var SIMPLE_CELL_COLUMNS = [CellType.TEXT, CellType.NUMBER, CellType.DATE, CellType.CTIME, CellType.MTIME, CellType.GEOLOCATION, CellType.AUTO_NUMBER, CellType.URL, CellType.EMAIL, CellType.DURATION, CellType.CHECKBOX, CellType.RATE];
30
- export var ARRAY_FORMAL_COLUMNS = [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR];
31
- export var SIMPLE_CELL_FORMULA_RESULTS = [FORMULA_RESULT_TYPE.NUMBER, FORMULA_RESULT_TYPE.STRING, FORMULA_RESULT_TYPE.DATE, FORMULA_RESULT_TYPE.BOOL];
32
- export var COLLABORATOR_COLUMN_TYPES = [CellType.COLLABORATOR, CellType.CREATOR, CellType.LAST_MODIFIER];
33
- export var ARRAY_FORMAL_COLUMNS_TYPES = [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR];
34
- export var DEFAULT_NUMBER_FORMAT = 'number';
35
- export var DEFAULT_DATE_FORMAT = 'YYYY-MM-DD';
36
- export var DURATION_FORMATS_MAP = {
37
- H_MM: 'h:mm',
38
- H_MM_SS: 'h:mm:ss'
39
- };
40
- export var DURATION_FORMATS = [{
41
- name: DURATION_FORMATS_MAP.H_MM,
42
- type: DURATION_FORMATS_MAP.H_MM
43
- }, {
44
- name: DURATION_FORMATS_MAP.H_MM_SS,
45
- type: DURATION_FORMATS_MAP.H_MM_SS
46
- }];
47
- export var DURATION_ZERO_DISPLAY = (_DURATION_ZERO_DISPLA = {}, _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM, '0:00'), _defineProperty(_DURATION_ZERO_DISPLA, DURATION_FORMATS_MAP.H_MM_SS, '0:00'), _DURATION_ZERO_DISPLA);
48
- export var DURATION_DECIMAL_DIGITS = (_DURATION_DECIMAL_DIG = {}, _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM, 0), _defineProperty(_DURATION_DECIMAL_DIG, DURATION_FORMATS_MAP.H_MM_SS, 0), _DURATION_DECIMAL_DIG);