dtable-ui-component 0.1.75-beta7 → 0.1.76

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 (91) hide show
  1. package/README.md +20 -2
  2. package/lib/{components/cell-editor/checkbox-editor.js → CheckboxEditor/index.js} +0 -0
  3. package/lib/CollaboratorEditor/index.css +48 -0
  4. package/lib/{components/cell-editor/collaborator-editor.js → CollaboratorEditor/index.js} +6 -5
  5. package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.css +86 -0
  6. package/lib/{components/cell-editor-popover/mb-collaborator-editor-popover.js → CollaboratorEditor/mb-collaborator-editor-popover/index.js} +2 -1
  7. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.css +1 -0
  8. package/lib/{components/cell-editor-popover/pc-collaborator-editor-popover.js → CollaboratorEditor/pc-collaborator-editor-popover/index.js} +2 -1
  9. package/lib/DateEditor/index.css +4 -0
  10. package/lib/{components/cell-editor/date-editor.js → DateEditor/index.js} +5 -4
  11. package/lib/{css → DateEditor/mb-date-editor-popover}/custom-rc-calendar.css +0 -0
  12. package/lib/DateEditor/mb-date-editor-popover/index.css +45 -0
  13. package/lib/{components/cell-editor-popover/mb-date-editor-popover.js → DateEditor/mb-date-editor-popover/index.js} +10 -10
  14. package/lib/{components/cell-editor-popover → DateEditor}/pc-date-editor-popover.js +2 -2
  15. package/lib/{components/common/edit-editor-button.js → EditEditorButton/index.js} +0 -0
  16. package/lib/{components/cell-editor-dialog/pc-file-editor-dialog.js → FileEditor/index.js} +10 -10
  17. package/lib/{components/cell-editor-dialog → FileEditor}/pc-files-addition/index.js +0 -0
  18. package/lib/{components/cell-editor-dialog → FileEditor}/pc-files-addition/pc-file-uploaded-item.js +0 -0
  19. package/lib/{components/cell-editor-dialog → FileEditor}/pc-files-preview/index.js +0 -0
  20. package/lib/{components/cell-editor-dialog → FileEditor}/pc-files-preview/pc-file-item-preview.js +0 -0
  21. package/lib/{assets/images → FileItemFormatter/assets}/file/192/excel.png +0 -0
  22. package/lib/{assets/images → FileItemFormatter/assets}/file/192/file.png +0 -0
  23. package/lib/{assets/images → FileItemFormatter/assets}/file/192/music.png +0 -0
  24. package/lib/{assets/images → FileItemFormatter/assets}/file/192/pdf.png +0 -0
  25. package/lib/{assets/images → FileItemFormatter/assets}/file/192/pic.png +0 -0
  26. package/lib/{assets/images → FileItemFormatter/assets}/file/192/ppt.png +0 -0
  27. package/lib/{assets/images → FileItemFormatter/assets}/file/192/txt.png +0 -0
  28. package/lib/{assets/images → FileItemFormatter/assets}/file/192/video.png +0 -0
  29. package/lib/{assets/images → FileItemFormatter/assets}/file/192/word.png +0 -0
  30. package/lib/{assets/images → FileItemFormatter/assets}/file/24/excel.png +0 -0
  31. package/lib/{assets/images → FileItemFormatter/assets}/file/24/file.png +0 -0
  32. package/lib/{assets/images → FileItemFormatter/assets}/file/24/music.png +0 -0
  33. package/lib/{assets/images → FileItemFormatter/assets}/file/24/pdf.png +0 -0
  34. package/lib/{assets/images → FileItemFormatter/assets}/file/24/pic.png +0 -0
  35. package/lib/{assets/images → FileItemFormatter/assets}/file/24/ppt.png +0 -0
  36. package/lib/{assets/images → FileItemFormatter/assets}/file/24/txt.png +0 -0
  37. package/lib/{assets/images → FileItemFormatter/assets}/file/24/video.png +0 -0
  38. package/lib/{assets/images → FileItemFormatter/assets}/file/24/word.png +0 -0
  39. package/lib/{assets/images → FileItemFormatter/assets}/folder/folder-192.png +0 -0
  40. package/lib/{assets/images → FileItemFormatter/assets}/folder/folder-24.png +0 -0
  41. package/lib/FileItemFormatter/index.js +2 -2
  42. package/lib/FileItemFormatter/utils.js +72 -0
  43. package/lib/{utils → FormulaFormatter}/cell-value-validator.js +0 -0
  44. package/lib/FormulaFormatter/index.js +2 -3
  45. package/lib/{utils/column-utils.js → FormulaFormatter/utils.js} +5 -1
  46. package/lib/{LongTextFormatter → HtmlLongTextFormatter}/index.css +0 -0
  47. package/lib/{LongTextFormatter/html-long-text-formatter.js → HtmlLongTextFormatter/index.js} +5 -2
  48. package/lib/{utils → HtmlLongTextFormatter}/markdown2html.js +0 -0
  49. package/lib/{utils → HtmlLongTextFormatter}/unified/index.js +1 -0
  50. package/lib/{utils → HtmlLongTextFormatter}/vfile/core.js +1 -0
  51. package/lib/{utils → HtmlLongTextFormatter}/vfile/index.js +0 -0
  52. package/lib/ImageFormatter/images-lazy-load.js +1 -1
  53. package/lib/ImageFormatter/index.js +1 -1
  54. package/lib/ImageFormatter/utils.js +7 -0
  55. package/lib/ImagePreviewerLightbox/index.js +1 -1
  56. package/lib/ImagePreviewerLightbox/utils.js +8 -0
  57. package/lib/LinkEditor/index.css +9 -0
  58. package/lib/{components/cell-editor/link-editor.js → LinkEditor/index.js} +10 -9
  59. package/lib/{components/common → LinkEditor}/link-editor-option.js +0 -0
  60. package/lib/LinkEditor/mb-link-editor-popover/index.css +85 -0
  61. package/lib/{components/cell-editor-popover/mb-link-editor-popover.js → LinkEditor/mb-link-editor-popover/index.js} +2 -1
  62. package/lib/LinkEditor/pc-link-editor-popover/index.css +63 -0
  63. package/lib/{components/cell-editor-popover/pc-link-editor-popover.js → LinkEditor/pc-link-editor-popover/index.js} +1 -0
  64. package/lib/LongTextFormatter/index.js +4 -7
  65. package/lib/{components/common/mobile/mb-editor-header.js → MBEditorHeader/index.js} +0 -0
  66. package/lib/MultipleSelectEditor/index.css +9 -0
  67. package/lib/{components/cell-editor/multiple-select-editor.js → MultipleSelectEditor/index.js} +5 -6
  68. package/lib/{components/cell-editor/number-editor.js → NumberEditor/index.js} +2 -2
  69. package/lib/SimpleLongTextFormatter/index.css +63 -0
  70. package/lib/{LongTextFormatter/simple-long-text-formatter.js → SimpleLongTextFormatter/index.js} +5 -2
  71. package/lib/{utils → SimpleLongTextFormatter}/normalize-long-text-value.js +1 -1
  72. package/lib/SingleSelectEditor/index.css +9 -0
  73. package/lib/{components/cell-editor/single-select-editor.js → SingleSelectEditor/index.js} +5 -6
  74. package/lib/{components/cell-editor/text-editor.js → TextEditor/index.js} +2 -2
  75. package/lib/css/cell-editor.css +0 -608
  76. package/lib/css/mb-cell-editor.css +55 -0
  77. package/lib/formatterConfig/index.js +2 -2
  78. package/lib/index.js +18 -6
  79. package/lib/select-editor/index.js +4 -0
  80. package/lib/select-editor/mb-select-editor-popover/index.css +127 -0
  81. package/lib/{components/cell-editor-popover/mb-select-editor-popover.js → select-editor/mb-select-editor-popover/index.js} +12 -11
  82. package/lib/select-editor/pc-select-editor-popover/index.css +72 -0
  83. package/lib/{components/cell-editor-popover/pc-select-editor-popover.js → select-editor/pc-select-editor-popover/index.js} +1 -0
  84. package/lib/{components/common → select-editor}/select-editor-option.js +0 -0
  85. package/lib/utils/utils.js +0 -91
  86. package/lib/utils/value-format-utils.js +1 -2
  87. package/package.json +5 -5
  88. package/lib/app.css +0 -20
  89. package/lib/app.js +0 -91
  90. package/lib/components/cell-editor/index.js +0 -9
  91. package/lib/components/common/collaborator-item.js +0 -63
package/lib/index.js CHANGED
@@ -1,6 +1,11 @@
1
- export { default as toaster } from './toaster';
2
- export { setLocale } from './lang';
3
- export { getDateDisplayString, getNumberDisplayString, formatStringToNumber, formatNumberString } from './utils/value-format-utils';
1
+ // toaster
2
+ export { default as toaster } from './toaster'; // Loading
3
+
4
+ export { default as Loading } from './Loading';
5
+ export { setLocale } from './lang'; // utils
6
+
7
+ export { getDateDisplayString, getNumberDisplayString, formatStringToNumber, formatNumberString } from './utils/value-format-utils'; // formatter
8
+
4
9
  export { default as CheckboxFormatter } from './CheckboxFormatter';
5
10
  export { default as ImageFormatter } from './ImageFormatter';
6
11
  export { default as LongTextFormatter } from './LongTextFormatter';
@@ -26,6 +31,13 @@ export { default as RateFormatter } from './RateFormatter';
26
31
  export { default as ButtonFormatter } from './ButtonFormatter';
27
32
  export { default as ImagePreviewerLightbox } from './ImagePreviewerLightbox';
28
33
  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';
34
+ export { default as FileItemFormatter } from './FileItemFormatter'; // editor
35
+
36
+ export { default as TextEditor } from './TextEditor';
37
+ export { default as NumberEditor } from './NumberEditor';
38
+ export { default as CheckboxEditor } from './CheckboxEditor';
39
+ export { default as SingleSelectEditor } from './SingleSelectEditor';
40
+ export { default as MultipleSelectEditor } from './MultipleSelectEditor';
41
+ export { default as CollaboratorEditor } from './CollaboratorEditor';
42
+ export { default as DateEditor } from './DateEditor';
43
+ export { default as LinkEditor } from './LinkEditor';
@@ -0,0 +1,4 @@
1
+ import MBSelectEditorPopover from './mb-select-editor-popover';
2
+ import PCSelectEditorPopover from './pc-select-editor-popover';
3
+ import SelectEditorOption from './select-editor-option';
4
+ export { MBSelectEditorPopover, PCSelectEditorPopover, SelectEditorOption };
@@ -0,0 +1,127 @@
1
+ @import url('../../css/mb-cell-editor.css');
2
+
3
+ @media screen and (max-width: 767.8px) {
4
+ .dtable-ui-mb-select-editor-body .mb-selected-item {
5
+ margin-top: 10px;
6
+ display: flex;
7
+ flex-direction: column;
8
+ }
9
+
10
+ .dtable-ui-mb-select-editor-body .mb-selected-item .title {
11
+ padding: 6px 16px;
12
+ border-bottom: 1px solid #e9e9e9;
13
+ }
14
+
15
+ .dtable-ui-mb-select-editor-body .mb-selected-item .content {
16
+ display: flex;
17
+ flex-wrap: wrap;
18
+ align-items: center;
19
+ min-height: 50px;
20
+ padding: 8px 16px;
21
+ border-bottom: 1px solid #e9e9e9;
22
+ overflow: auto;
23
+ background-color: #fff;
24
+ }
25
+
26
+ .dtable-ui-mb-select-editor-body .mb-selected-item .content .select-option-item {
27
+ margin: 3px 10px 3px 0;
28
+ }
29
+
30
+ .dtable-ui-mb-select-editor-body .mb-search-select-items {
31
+ padding: 8px 16px;
32
+ margin-top: 20px;
33
+ border-top: 1px solid #e9e9e9;
34
+ border-bottom: 1px solid #e9e9e9;
35
+ background-color: #fff;
36
+ }
37
+
38
+ .dtable-ui-mb-select-editor-body .mb-search-select-items > input {
39
+ outline: none;
40
+ height: 30px;
41
+ padding: 0;
42
+ line-height: 30px;
43
+ border: none;
44
+ }
45
+ .dtable-ui-mb-select-editor-body .mb-search-select-items > input:focus,
46
+ .dtable-ui-mb-select-editor-body .mb-search-select-items > input:active {
47
+ outline: none;
48
+ box-shadow: none;
49
+ }
50
+
51
+ .dtable-ui-mb-select-editor-body .mb-select-options-container {
52
+ display: flex;
53
+ flex-direction: column;
54
+ margin-top: 10px;
55
+ }
56
+
57
+ .dtable-ui-mb-select-editor-body .mb-select-options-container .title {
58
+ padding: 6px 16px;
59
+ border-bottom: 1px solid #e9e9e9;
60
+ }
61
+
62
+ .dtable-ui-mb-select-editor-body .mb-select-options-container .content {
63
+ display: flex;
64
+ flex-direction: column;
65
+ border-bottom: 1px solid #e9e9e9;
66
+ }
67
+
68
+ .dtable-ui-mb-select-editor-body .mb-select-options-container .search-result-none {
69
+ padding: 16px 0;
70
+ }
71
+
72
+ .dtable-ui-mb-select-editor-body .mb-select-options-container .mb-select-option-item {
73
+ display: flex;
74
+ align-items: center;
75
+ justify-content: space-between;
76
+ height: 50px;
77
+ padding: 10px 10px 10px 16px;
78
+ font-size: 13px;
79
+ background-color: #fff;
80
+ color: #202428;
81
+ }
82
+
83
+ .dtable-ui-mb-select-editor-body .mb-select-options-container .mb-select-option-item + .mb-select-option-item {
84
+ border-top: 1px solid #e9e9e9;
85
+ }
86
+
87
+ .dtable-ui-mb-select-editor-body .mb-select-options-container .mb-select-option-item .item-name {
88
+ display: inline-block;
89
+ padding: 0 10px;
90
+ margin-top: 5px;
91
+ height: 20px;
92
+ line-height: 20px;
93
+ text-align: center;
94
+ text-overflow: ellipsis;
95
+ border-radius: 10px;
96
+ overflow: hidden;
97
+ }
98
+
99
+ .dtable-ui-mb-select-editor-body .mb-select-options-container .mb-select-option-item .dtable-font {
100
+ font-size: 12px;
101
+ color: #798d99;
102
+ }
103
+
104
+ .dtable-ui-mb-select-editor-body .mb-create-select-item {
105
+ display: flex;
106
+ align-items: center;
107
+ height: 50px;
108
+ padding: 0 10px;
109
+ margin-top: 20px;
110
+ border-top: 1px solid #dedede;
111
+ border-bottom: 1px solid #e9e9e9;
112
+ background-color: #fff;
113
+ }
114
+
115
+ .dtable-ui-mb-select-editor-body .mb-create-select-item .dtable-font {
116
+ margin-right: 10px;
117
+ font-size: 12px;
118
+ font-weight: 600px;
119
+ transition: translateY(1px);
120
+ }
121
+
122
+ .dtable-ui-mb-select-editor-body .mb-create-select-item .add-new-option {
123
+ font-size: 14px;
124
+ font-weight: 500px;
125
+ }
126
+
127
+ }
@@ -5,18 +5,19 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
5
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
6
  import React, { Fragment } from 'react';
7
7
  import { getLocale } from '../../lang';
8
- import SelectEditorOption from '../common/select-editor-option';
9
- import MBEditorHeader from '../common/mobile/mb-editor-header';
8
+ import SelectEditorOption from '../select-editor-option';
9
+ import MBEditorHeader from '../../MBEditorHeader';
10
+ import './index.css';
10
11
 
11
- var MBSingleSelectPopover = /*#__PURE__*/function (_React$Component) {
12
- _inherits(MBSingleSelectPopover, _React$Component);
12
+ var MBSelectEditorPopover = /*#__PURE__*/function (_React$Component) {
13
+ _inherits(MBSelectEditorPopover, _React$Component);
13
14
 
14
- var _super = _createSuper(MBSingleSelectPopover);
15
+ var _super = _createSuper(MBSelectEditorPopover);
15
16
 
16
- function MBSingleSelectPopover(props) {
17
+ function MBSelectEditorPopover(props) {
17
18
  var _this;
18
19
 
19
- _classCallCheck(this, MBSingleSelectPopover);
20
+ _classCallCheck(this, MBSelectEditorPopover);
20
21
 
21
22
  _this = _super.call(this, props);
22
23
 
@@ -128,7 +129,7 @@ var MBSingleSelectPopover = /*#__PURE__*/function (_React$Component) {
128
129
  return _this;
129
130
  }
130
131
 
131
- _createClass(MBSingleSelectPopover, [{
132
+ _createClass(MBSelectEditorPopover, [{
132
133
  key: "componentDidMount",
133
134
  value: function componentDidMount() {
134
135
  history.pushState(null, null, '#'); // eslint-disable-line
@@ -218,13 +219,13 @@ var MBSingleSelectPopover = /*#__PURE__*/function (_React$Component) {
218
219
  }
219
220
  }]);
220
221
 
221
- return MBSingleSelectPopover;
222
+ return MBSelectEditorPopover;
222
223
  }(React.Component);
223
224
 
224
- MBSingleSelectPopover.defaultProps = {
225
+ MBSelectEditorPopover.defaultProps = {
225
226
  isReadOnly: false,
226
227
  isShowRemoveIcon: false,
227
228
  isSupportNewOption: false,
228
229
  value: []
229
230
  };
230
- export default MBSingleSelectPopover;
231
+ export default MBSelectEditorPopover;
@@ -0,0 +1,72 @@
1
+ @import url('../../css/cell-editor.css');
2
+
3
+ .dtable-ui-select-editor-popover .select-options-search {
4
+ padding: 10px 10px 0 10px;
5
+ }
6
+
7
+ .dtable-ui-select-editor-popover .select-options-search input {
8
+ height: 28px;
9
+ }
10
+
11
+ .dtable-ui-select-editor-popover .select-options-container {
12
+ min-height: 160px;
13
+ max-height: 200px;
14
+ margin: 10px 0;
15
+ padding: 0 10px;
16
+ overflow: auto;
17
+ }
18
+
19
+ /* option item */
20
+ .dtable-ui-select-editor-popover .select-option-item {
21
+ display: flex;
22
+ height: 30px;
23
+ padding-left: 12px;
24
+ font-size: 14px;
25
+ line-height: 30px;
26
+ margin-left: 10px;
27
+ cursor: pointer;
28
+ }
29
+
30
+ .dtable-ui-select-editor-popover .select-option-item:hover {
31
+ background-color: #f5f5f5;
32
+ }
33
+
34
+ .dtable-ui-select-editor-popover .option-info {
35
+ flex: 1;
36
+ display: flex;
37
+ align-items: center;
38
+ }
39
+
40
+ .dtable-ui-select-editor-popover .option-checked {
41
+ width: 20px;
42
+ text-align: center;
43
+ }
44
+
45
+ .dtable-ui-select-editor-popover .option-checked .dtable-font {
46
+ font-size: 12px;
47
+ color: #798d99;
48
+ }
49
+
50
+ .dtable-ui-select-editor-popover .select-options-add {
51
+ display: flex;
52
+ align-items: center;
53
+ padding: 0 10px;
54
+ height: 30px;
55
+ border-top: 1px solid #ccc;
56
+ }
57
+
58
+ .dtable-ui-select-editor-popover .select-options-add .dtable-font {
59
+ margin-right: 5px;
60
+ font-size: 12px;
61
+ font-weight: 600;
62
+ }
63
+
64
+ .dtable-ui-select-editor-popover .select-options-add > span {
65
+ display: inline-block;
66
+ font-size: 14px;
67
+ font-weight: 500;
68
+ color: #212529;
69
+ white-space: nowrap;
70
+ overflow: hidden;
71
+ text-overflow: ellipsis;
72
+ }
@@ -5,6 +5,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
5
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
6
  import React from 'react';
7
7
  import { getLocale } from '../../lang';
8
+ import './index.css';
8
9
 
9
10
  var PCSelectEditorPopover = /*#__PURE__*/function (_React$Component) {
10
11
  _inherits(PCSelectEditorPopover, _React$Component);
@@ -1,82 +1,3 @@
1
- var FILEEXT_ICON_MAP = {
2
- // text file
3
- md: "txt.png",
4
- txt: "txt.png",
5
- // pdf file
6
- pdf: "pdf.png",
7
- // document file
8
- doc: "word.png",
9
- docx: "word.png",
10
- odt: "word.png",
11
- fodt: "word.png",
12
- ppt: "ppt.png",
13
- pptx: "ppt.png",
14
- odp: "ppt.png",
15
- fodp: "ppt.png",
16
- xls: "excel.png",
17
- xlsx: "excel.png",
18
- ods: "excel.png",
19
- fods: "excel.png",
20
- // video
21
- mp4: "video.png",
22
- ogv: "video.png",
23
- webm: "video.png",
24
- mov: "video.png",
25
- flv: "video.png",
26
- wmv: "video.png",
27
- rmvb: "video.png",
28
- // music file
29
- mp3: "music.png",
30
- oga: "music.png",
31
- ogg: "music.png",
32
- flac: "music.png",
33
- aac: "music.png",
34
- ac3: "music.png",
35
- wma: "music.png",
36
- // image file
37
- jpg: "pic.png",
38
- jpeg: "pic.png",
39
- png: "pic.png",
40
- svg: "pic.png",
41
- gif: "pic.png",
42
- bmp: "pic.png",
43
- ico: "pic.png",
44
- // folder dir
45
- folder: "folder-192.png",
46
- // default
47
- default: "file.png"
48
- };
49
- export var getFileIconUrl = function getFileIconUrl(filename, direntType) {
50
- if (direntType === "dir") {
51
- var _iconUrl = "assets/images/folder/" + FILEEXT_ICON_MAP["folder"];
52
-
53
- return _iconUrl;
54
- }
55
-
56
- var iconUrl = "";
57
-
58
- if (filename.lastIndexOf(".") === -1) {
59
- iconUrl = "assets/images/file/192/" + FILEEXT_ICON_MAP["default"];
60
- return iconUrl;
61
- }
62
-
63
- var file_ext = filename.substr(filename.lastIndexOf(".") + 1).toLowerCase();
64
-
65
- if (FILEEXT_ICON_MAP[file_ext]) {
66
- iconUrl = "assets/images/file/192/" + FILEEXT_ICON_MAP[file_ext];
67
- } else {
68
- iconUrl = "assets/images/file/192/" + FILEEXT_ICON_MAP["default"];
69
- }
70
-
71
- return iconUrl;
72
- };
73
- export var getImageThumbnailUrl = function getImageThumbnailUrl(url, server) {
74
- if (server && url.indexOf(server) > -1) {
75
- return url.replace("/workspace", "/thumbnail/workspace") + "?size=256";
76
- }
77
-
78
- return url;
79
- };
80
1
  export var debounce = function debounce(fn, wait) {
81
2
  var timeout = null;
82
3
  return function () {
@@ -101,16 +22,4 @@ export var throttle = function throttle(func, delay) {
101
22
  timer = setTimeout(func, remaining);
102
23
  }
103
24
  };
104
- };
105
- export var isFunction = function isFunction(functionToCheck) {
106
- var getType = {};
107
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
108
- };
109
- export var isInternalImg = function isInternalImg(url) {
110
- if (!url) return;
111
- return url.indexOf(window.dtable.server) > -1;
112
- };
113
- export var checkSVGImage = function checkSVGImage(url) {
114
- if (!url) return false;
115
- return url.substr(-4).toLowerCase() === '.svg';
116
25
  };
@@ -1,8 +1,7 @@
1
1
  /* eslint-disable no-case-declarations */
2
2
  import moment from 'moment';
3
3
  import NP from './number-precision';
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';
5
- import * as CellType from '../constants/cell-types';
4
+ import { CellType, 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';
6
5
  NP.enableBoundaryChecking(false);
7
6
  var _separatorMap = {
8
7
  'comma': ',',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.1.75beta7",
4
- "main": "./es/index.js",
3
+ "version": "0.1.76",
4
+ "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "0.0.9",
7
7
  "@seafile/seafile-calendar": "0.0.15",
@@ -16,9 +16,9 @@
16
16
  "hast-util-to-html": "3.1.0",
17
17
  "is-hotkey": "^0.1.6",
18
18
  "moment": "^2.26.0",
19
- "react": "^16.13.0",
19
+ "react": "16.14.0",
20
20
  "react-app-polyfill": "^1.0.6",
21
- "react-dom": "^16.13.0",
21
+ "react-dom": "16.14.0",
22
22
  "react-responsive": "^8.0.3",
23
23
  "react-transition-group": "^4.4.1",
24
24
  "reactstrap": "^8.4.1",
@@ -48,7 +48,7 @@
48
48
  "pub:esm": "npm run clean:esm && export BABEL_ENV=node && ./node_modules/.bin/babel src --out-dir es --copy-files",
49
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 lib/index.local.js",
51
+ "pub:optimized": "rm lib/index.local.js && rm lib/app.js && rm lib/app.css",
52
52
  "prepublishOnly": "npm run pub:lib && npm run pub:umd && npm run pub:optimized"
53
53
  },
54
54
  "files": [
package/lib/app.css DELETED
@@ -1,20 +0,0 @@
1
- html, body, #root {
2
- width: 100%;
3
- height: 100%;
4
- }
5
-
6
- .app {
7
- width: 100%;
8
- height: 100%;
9
- display: flex;
10
- flex-direction: column;
11
- }
12
-
13
- .app .app-body {
14
- flex: 1;
15
- }
16
-
17
- .app .app-body .collaborator-container {
18
- padding: 5px;
19
- border: 1px solid;
20
- }
package/lib/app.js DELETED
@@ -1,91 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- import React from 'react';
6
- import { CollaboratorFormatter, SingleSelectFormatter } from './index';
7
- import './app.css';
8
-
9
- var App = /*#__PURE__*/function (_React$Component) {
10
- _inherits(App, _React$Component);
11
-
12
- var _super = _createSuper(App);
13
-
14
- function App() {
15
- var _this;
16
-
17
- _classCallCheck(this, App);
18
-
19
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
20
- args[_key] = arguments[_key];
21
- }
22
-
23
- _this = _super.call.apply(_super, [this].concat(args));
24
-
25
- _this.onDeleteCollaborator = function () {//
26
- };
27
-
28
- return _this;
29
- }
30
-
31
- _createClass(App, [{
32
- key: "render",
33
- value: function render() {
34
- var collaborators = [{
35
- name: '小强',
36
- email: '214402@qq.com',
37
- avatar_url: '你好饿',
38
- contact_email: 'adbd'
39
- }];
40
- var options = [{
41
- id: '1111',
42
- name: '未开始',
43
- color: '#e3f9f6'
44
- }, {
45
- id: '2222',
46
- name: '进行中',
47
- color: '#ff7500'
48
- }, {
49
- id: '3333',
50
- name: '待评审',
51
- color: '#eaff56'
52
- }, {
53
- id: '4444',
54
- name: '已评审',
55
- color: '#faff72'
56
- }, {
57
- id: '5555',
58
- name: '完成',
59
- color: '#00e500'
60
- }];
61
- return /*#__PURE__*/React.createElement("div", {
62
- className: "app"
63
- }, /*#__PURE__*/React.createElement("header", {
64
- className: "app-header"
65
- }, /*#__PURE__*/React.createElement("h1", {
66
- className: "text-center"
67
- }, 'seatable ui component test')), /*#__PURE__*/React.createElement("div", {
68
- className: "app-body"
69
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", null, "collaborators\u6D4B\u8BD5"), /*#__PURE__*/React.createElement("div", null, "\u5355\u4E2Acollaborators\u6D4B\u8BD5"), /*#__PURE__*/React.createElement(CollaboratorFormatter, {
70
- value: '123',
71
- collaborators: collaborators
72
- }), /*#__PURE__*/React.createElement("div", null, "\u591A\u4E2Acollaborators\u6D4B\u8BD5"), /*#__PURE__*/React.createElement(CollaboratorFormatter, {
73
- value: ['123', '4567'],
74
- collaborators: collaborators
75
- }), /*#__PURE__*/React.createElement("div", null, "\u5E26\u5220\u9664\u6309\u94AE\u6D4B\u8BD5"), /*#__PURE__*/React.createElement(CollaboratorFormatter, {
76
- containerClassName: "collaborator-container",
77
- value: ['123', '4567'],
78
- collaborators: collaborators,
79
- enableDeleteCollaborator: true,
80
- onDeleteCollaborator: this.onDeleteCollaborator
81
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", null, "single-select\u6D4B\u8BD5"), /*#__PURE__*/React.createElement(SingleSelectFormatter, {
82
- value: '3333',
83
- options: options
84
- }))));
85
- }
86
- }]);
87
-
88
- return App;
89
- }(React.Component);
90
-
91
- export default App;
@@ -1,9 +0,0 @@
1
- import "../../css/cell-editor.css";
2
- export { default as NumberEditor } from './number-editor';
3
- export { default as TextEditor } from './text-editor';
4
- export { default as CheckboxEditor } from './checkbox-editor';
5
- export { default as SingleSelectEditor } from './single-select-editor';
6
- export { default as MultipleSelectEditor } from './multiple-select-editor';
7
- export { default as CollaboratorEditor } from './collaborator-editor';
8
- export { default as LinkEditor } from './link-editor';
9
- export { default as DateEditor } from './date-editor';
@@ -1,63 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
- import React from 'react';
6
-
7
- var CollaboratorItem = /*#__PURE__*/function (_React$Component) {
8
- _inherits(CollaboratorItem, _React$Component);
9
-
10
- var _super = _createSuper(CollaboratorItem);
11
-
12
- function CollaboratorItem() {
13
- var _this;
14
-
15
- _classCallCheck(this, CollaboratorItem);
16
-
17
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
18
- args[_key] = arguments[_key];
19
- }
20
-
21
- _this = _super.call.apply(_super, [this].concat(args));
22
-
23
- _this.onDeleteCollaborator = function () {
24
- var collaborator = _this.props.collaborator;
25
-
26
- _this.props.onDeleteCollaborator(collaborator);
27
- };
28
-
29
- return _this;
30
- }
31
-
32
- _createClass(CollaboratorItem, [{
33
- key: "render",
34
- value: function render() {
35
- var _this$props = this.props,
36
- collaborator = _this$props.collaborator,
37
- enableDeleteCollaborator = _this$props.enableDeleteCollaborator;
38
- return /*#__PURE__*/React.createElement("div", {
39
- className: "dtable-ui collaborator-item"
40
- }, /*#__PURE__*/React.createElement("span", {
41
- className: "collaborator-avatar"
42
- }, /*#__PURE__*/React.createElement("img", {
43
- className: "collaborator-avatar-icon",
44
- alt: collaborator.name,
45
- src: collaborator.avatar_url
46
- })), /*#__PURE__*/React.createElement("span", {
47
- className: "collaborator-name"
48
- }, collaborator.name), enableDeleteCollaborator && /*#__PURE__*/React.createElement("span", {
49
- className: "collaborator-remove",
50
- onClick: this.onDeleteCollaborator
51
- }, /*#__PURE__*/React.createElement("i", {
52
- className: "dtable-font dtable-icon-fork-number"
53
- })));
54
- }
55
- }]);
56
-
57
- return CollaboratorItem;
58
- }(React.Component);
59
-
60
- CollaboratorItem.defaultProps = {
61
- enableDelete: false
62
- };
63
- export default CollaboratorItem;