dtable-ui-component 0.1.73 → 0.1.75-beta10

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 (170) hide show
  1. package/README.md +15 -2
  2. package/assets/{dtable-fonts → dtable-font}/dtable-font.eot +0 -0
  3. package/assets/{dtable-fonts → dtable-font}/dtable-font.svg +0 -0
  4. package/assets/{dtable-fonts → dtable-font}/dtable-font.ttf +0 -0
  5. package/assets/{dtable-fonts → dtable-font}/dtable-font.woff +0 -0
  6. package/assets/{dtable-fonts → dtable-font}/dtable-font.woff2 +0 -0
  7. package/assets/dtable-font.css +6 -6
  8. package/lib/AutoNumberFormatter/index.css +1 -0
  9. package/{es/components/cell-formatter/auto-number-formatter.js → lib/AutoNumberFormatter/index.js} +1 -0
  10. package/lib/ButtonFormatter/index.css +13 -0
  11. package/{es/components/cell-formatter/button-formatter.js → lib/ButtonFormatter/index.js} +1 -0
  12. package/lib/CTimeFormatter/index.css +1 -0
  13. package/{es/components/cell-formatter/ctime-formatter.js → lib/CTimeFormatter/index.js} +1 -0
  14. package/{es/components/cell-editor/checkbox-editor.js → lib/CheckboxEditor/index.js} +0 -0
  15. package/lib/CheckboxFormatter/index.css +1 -0
  16. package/{es/components/cell-formatter/checkbox-formatter.js → lib/CheckboxFormatter/index.js} +1 -0
  17. package/lib/CollaboratorEditor/index.css +48 -0
  18. package/{es/components/cell-editor/collaborator-editor.js → lib/CollaboratorEditor/index.js} +6 -5
  19. package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.css +86 -0
  20. package/{es/components/cell-editor-popover/mb-collaborator-editor-popover.js → lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js} +2 -1
  21. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.css +1 -0
  22. package/{es/components/cell-editor-popover/pc-collaborator-editor-popover.js → lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js} +2 -1
  23. package/lib/CollaboratorFormatter/index.css +1 -0
  24. package/{es/components/cell-formatter/collaborator-formatter.js → lib/CollaboratorFormatter/index.js} +3 -2
  25. package/lib/CollaboratorItem/index.css +49 -0
  26. package/{es/components/common/collaborator-item.js → lib/CollaboratorItem/index.js} +1 -0
  27. package/lib/CreatorFormatter/index.css +1 -0
  28. package/{es/components/cell-formatter/creator-formatter.js → lib/CreatorFormatter/index.js} +3 -2
  29. package/lib/DateEditor/index.css +4 -0
  30. package/{es/components/cell-editor/date-editor.js → lib/DateEditor/index.js} +5 -4
  31. package/{es/css → lib/DateEditor/mb-date-editor-popover}/custom-rc-calendar.css +0 -0
  32. package/lib/DateEditor/mb-date-editor-popover/index.css +45 -0
  33. package/{es/components/cell-editor-popover/mb-date-editor-popover.js → lib/DateEditor/mb-date-editor-popover/index.js} +10 -10
  34. package/{es/components/cell-editor-popover → lib/DateEditor}/pc-date-editor-popover.js +2 -2
  35. package/lib/DateFormatter/index.css +1 -0
  36. package/{es/components/cell-formatter/date-formatter.js → lib/DateFormatter/index.js} +2 -1
  37. package/lib/DurationFormatter/index.css +1 -0
  38. package/{es/components/cell-formatter/duration-formatter.js → lib/DurationFormatter/index.js} +2 -1
  39. package/{es/components/common/edit-editor-button.js → lib/EditEditorButton/index.js} +0 -0
  40. package/lib/EmailFormatter/index.css +5 -0
  41. package/{es/components/cell-formatter/email-formatter.js → lib/EmailFormatter/index.js} +1 -0
  42. package/{es/components/cell-editor-dialog/pc-file-editor-dialog.js → lib/FileEditor/index.js} +10 -10
  43. package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-addition/index.js +0 -0
  44. package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-addition/pc-file-uploaded-item.js +0 -0
  45. package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-preview/index.js +0 -0
  46. package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-preview/pc-file-item-preview.js +0 -0
  47. package/lib/FileFormatter/index.css +29 -0
  48. package/{es/components/cell-formatter/file-formatter.js → lib/FileFormatter/index.js} +2 -1
  49. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/excel.png +0 -0
  50. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/file.png +0 -0
  51. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/music.png +0 -0
  52. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/pdf.png +0 -0
  53. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/pic.png +0 -0
  54. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/ppt.png +0 -0
  55. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/txt.png +0 -0
  56. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/video.png +0 -0
  57. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/word.png +0 -0
  58. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/excel.png +0 -0
  59. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/file.png +0 -0
  60. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/music.png +0 -0
  61. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/pdf.png +0 -0
  62. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/pic.png +0 -0
  63. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/ppt.png +0 -0
  64. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/txt.png +0 -0
  65. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/video.png +0 -0
  66. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/word.png +0 -0
  67. package/{es/assets/images → lib/FileItemFormatter/assets}/folder/folder-192.png +0 -0
  68. package/{es/assets/images → lib/FileItemFormatter/assets}/folder/folder-24.png +0 -0
  69. package/{es/components/cell-formatter/widgets/file-item-formatter.js → lib/FileItemFormatter/index.js} +2 -2
  70. package/lib/FileItemFormatter/utils.js +72 -0
  71. package/{es/components/file-uploader → lib/FileUploader}/index.js +0 -0
  72. package/{es/utils → lib/FormulaFormatter}/cell-value-validator.js +1 -2
  73. package/lib/FormulaFormatter/index.css +19 -0
  74. package/{es/components/cell-formatter/formula-formatter.js → lib/FormulaFormatter/index.js} +7 -8
  75. package/{es/utils/column-utils.js → lib/FormulaFormatter/utils.js} +5 -1
  76. package/lib/GeolocationFormatter/index.css +1 -0
  77. package/{es/components/cell-formatter/geolocation-formatter.js → lib/GeolocationFormatter/index.js} +2 -1
  78. package/lib/HtmlLongTextFormatter/index.css +63 -0
  79. package/{es/components/cell-formatter/widgets/long-text-formatter/html-long-text-formatter.js → lib/HtmlLongTextFormatter/index.js} +2 -1
  80. package/{es/utils → lib/HtmlLongTextFormatter}/markdown2html.js +0 -0
  81. package/{es/utils → lib/HtmlLongTextFormatter}/unified/index.js +1 -0
  82. package/{es/utils → lib/HtmlLongTextFormatter}/vfile/core.js +1 -0
  83. package/{es/utils → lib/HtmlLongTextFormatter}/vfile/index.js +0 -0
  84. package/{es/components/common → lib/ImageFormatter}/images-lazy-load.js +2 -2
  85. package/lib/ImageFormatter/index.css +34 -0
  86. package/{es/components/cell-formatter/image-formatter.js → lib/ImageFormatter/index.js} +4 -3
  87. package/lib/ImageFormatter/utils.js +7 -0
  88. package/{es/css/image-previewer-ligntbox.css → lib/ImagePreviewerLightbox/index.css} +0 -0
  89. package/{es/components/cell-formatter/widgets/image-previewer-lightbox.js → lib/ImagePreviewerLightbox/index.js} +3 -3
  90. package/lib/ImagePreviewerLightbox/utils.js +8 -0
  91. package/lib/LastModifierFormatter/index.css +1 -0
  92. package/{es/components/cell-formatter/last-modifier-formatter.js → lib/LastModifierFormatter/index.js} +5 -4
  93. package/lib/LinkEditor/index.css +9 -0
  94. package/{es/components/cell-editor/link-editor.js → lib/LinkEditor/index.js} +10 -9
  95. package/{es/components/common → lib/LinkEditor}/link-editor-option.js +0 -0
  96. package/lib/LinkEditor/mb-link-editor-popover/index.css +85 -0
  97. package/{es/components/cell-editor-popover/mb-link-editor-popover.js → lib/LinkEditor/mb-link-editor-popover/index.js} +2 -1
  98. package/lib/LinkEditor/pc-link-editor-popover/index.css +63 -0
  99. package/{es/components/cell-editor-popover/pc-link-editor-popover.js → lib/LinkEditor/pc-link-editor-popover/index.js} +1 -0
  100. package/lib/LinkFormatter/index.css +27 -0
  101. package/{es/components/cell-formatter/link-formatter.js → lib/LinkFormatter/index.js} +2 -2
  102. package/{es/css/loading.css → lib/Loading/index.css} +0 -0
  103. package/{es/components/loading.js → lib/Loading/index.js} +1 -1
  104. package/{es/components/cell-formatter/long-text-formatter.js → lib/LongTextFormatter/index.js} +2 -2
  105. package/{es/components/common/mobile/mb-editor-header.js → lib/MBEditorHeader/index.js} +0 -0
  106. package/lib/MTimeFormatter/index.css +1 -0
  107. package/{es/components/cell-formatter/mtime-formatter.js → lib/MTimeFormatter/index.js} +1 -0
  108. package/{es/components/common/modal-portal.js → lib/ModalPortal/index.js} +0 -0
  109. package/lib/MultipleSelectEditor/index.css +9 -0
  110. package/{es/components/cell-editor/multiple-select-editor.js → lib/MultipleSelectEditor/index.js} +5 -6
  111. package/lib/MultipleSelectFormatter/index.css +1 -0
  112. package/{es/components/cell-formatter/multiple-select-formatter.js → lib/MultipleSelectFormatter/index.js} +2 -1
  113. package/{es/components/cell-editor/number-editor.js → lib/NumberEditor/index.js} +2 -2
  114. package/lib/NumberFormatter/index.css +1 -0
  115. package/{es/components/cell-formatter/number-formatter.js → lib/NumberFormatter/index.js} +2 -1
  116. package/lib/RateFormatter/index.css +1 -0
  117. package/{es/components/cell-formatter/rate-formatter.js → lib/RateFormatter/index.js} +1 -0
  118. package/{es/components/common/select-item.js → lib/SelectItem/index.js} +0 -0
  119. package/lib/SimpleLongTextFormatter/index.css +63 -0
  120. package/{es/components/cell-formatter/widgets/long-text-formatter/simple-long-text-formatter.js → lib/SimpleLongTextFormatter/index.js} +2 -1
  121. package/{es/utils → lib/SimpleLongTextFormatter}/normalize-long-text-value.js +4 -4
  122. package/lib/SingleSelectEditor/index.css +9 -0
  123. package/{es/components/cell-editor/single-select-editor.js → lib/SingleSelectEditor/index.js} +5 -6
  124. package/lib/SingleSelectFormatter/index.css +1 -0
  125. package/{es/components/cell-formatter/single-select-formatter.js → lib/SingleSelectFormatter/index.js} +2 -1
  126. package/{es/components/cell-editor/text-editor.js → lib/TextEditor/index.js} +2 -2
  127. package/lib/TextFormatter/index.css +1 -0
  128. package/{es/components/cell-formatter/text-formatter.js → lib/TextFormatter/index.js} +1 -0
  129. package/lib/UrlFormatter/index.css +5 -0
  130. package/{es/components/cell-formatter/url-formatter.js → lib/UrlFormatter/index.js} +1 -0
  131. package/{es → lib}/assets/images/avatar/default_avatar.png +0 -0
  132. package/{es/components/cell-factory/cell-formatter-factory.js → lib/cellFormatterFactory/index.js} +3 -3
  133. package/{es → lib}/constants/cell-types.js +0 -0
  134. package/lib/constants/index.js +49 -0
  135. package/lib/css/cell-editor.css +6 -0
  136. package/lib/css/cell-formatter.css +4 -0
  137. package/lib/css/mb-cell-editor.css +55 -0
  138. package/lib/formatterConfig/index.js +31 -0
  139. package/lib/index.js +45 -0
  140. package/{es → lib}/lang/index.js +0 -0
  141. package/{es → lib}/locals/de.js +0 -0
  142. package/{es → lib}/locals/en.js +0 -0
  143. package/{es → lib}/locals/fr.js +0 -0
  144. package/{es → lib}/locals/zh-CN.js +0 -0
  145. package/lib/select-editor/index.js +4 -0
  146. package/lib/select-editor/mb-select-editor-popover/index.css +127 -0
  147. package/{es/components/cell-editor-popover/mb-select-editor-popover.js → lib/select-editor/mb-select-editor-popover/index.js} +12 -11
  148. package/lib/select-editor/pc-select-editor-popover/index.css +72 -0
  149. package/{es/components/cell-editor-popover/pc-select-editor-popover.js → lib/select-editor/pc-select-editor-popover/index.js} +1 -0
  150. package/{es/components/common → lib/select-editor}/select-editor-option.js +0 -0
  151. package/{es/components/toast → lib/toaster}/alert.js +0 -0
  152. package/{es/components/toast → lib/toaster}/index.js +0 -0
  153. package/{es/components/toast → lib/toaster}/toast.js +0 -0
  154. package/{es/components/toast → lib/toaster}/toastManager.js +0 -0
  155. package/{es/components/toast → lib/toaster}/toaster.js +0 -0
  156. package/{es → lib}/utils/editor-utils.js +0 -0
  157. package/{es → lib}/utils/number-precision.js +1 -0
  158. package/lib/utils/utils.js +25 -0
  159. package/{es → lib}/utils/value-format-utils.js +3 -2
  160. package/package.json +5 -5
  161. package/es/app.css +0 -20
  162. package/es/app.js +0 -91
  163. package/es/components/cell-editor/index.js +0 -9
  164. package/es/components/cell-formatter/formatter-config.js +0 -31
  165. package/es/components/cell-formatter/index.js +0 -27
  166. package/es/constants/index.js +0 -48
  167. package/es/css/cell-editor.css +0 -614
  168. package/es/css/cell-formatter.css +0 -247
  169. package/es/index.js +0 -6
  170. package/es/utils/utils.js +0 -116
package/lib/index.js ADDED
@@ -0,0 +1,45 @@
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
+
9
+ export { default as CheckboxFormatter } from './CheckboxFormatter';
10
+ export { default as ImageFormatter } from './ImageFormatter';
11
+ export { default as LongTextFormatter } from './LongTextFormatter';
12
+ export { default as SimpleLongTextFormatter } from './SimpleLongTextFormatter';
13
+ export { default as HtmlLongTextFormatter } from './HtmlLongTextFormatter';
14
+ export { default as TextFormatter } from './TextFormatter';
15
+ export { default as SingleSelectFormatter } from './SingleSelectFormatter';
16
+ export { default as MultipleSelectFormatter } from './MultipleSelectFormatter';
17
+ export { default as FileFormatter } from './FileFormatter';
18
+ export { default as LinkFormatter } from './LinkFormatter';
19
+ export { default as CollaboratorFormatter } from './CollaboratorFormatter';
20
+ export { default as NumberFormatter } from './NumberFormatter';
21
+ export { default as DateFormatter } from './DateFormatter';
22
+ export { default as CreatorFormatter } from './CreatorFormatter';
23
+ export { default as CTimeFormatter } from './CTimeFormatter';
24
+ export { default as LastModifierFormatter } from './LastModifierFormatter';
25
+ export { default as MTimeFormatter } from './MTimeFormatter';
26
+ export { default as GeolocationFormatter } from './GeolocationFormatter';
27
+ export { default as FormulaFormatter } from './FormulaFormatter';
28
+ export { default as AutoNumberFormatter } from './AutoNumberFormatter';
29
+ export { default as UrlFormatter } from './UrlFormatter';
30
+ export { default as EmailFormatter } from './EmailFormatter';
31
+ export { default as DurationFormatter } from './DurationFormatter';
32
+ export { default as RateFormatter } from './RateFormatter';
33
+ export { default as ButtonFormatter } from './ButtonFormatter';
34
+ export { default as ImagePreviewerLightbox } from './ImagePreviewerLightbox';
35
+ export { default as CollaboratorItem } from './CollaboratorItem';
36
+ export { default as FileItemFormatter } from './FileItemFormatter'; // editor
37
+
38
+ export { default as TextEditor } from './TextEditor';
39
+ export { default as NumberEditor } from './NumberEditor';
40
+ export { default as CheckboxEditor } from './CheckboxEditor';
41
+ export { default as SingleSelectEditor } from './SingleSelectEditor';
42
+ export { default as MultipleSelectEditor } from './MultipleSelectEditor';
43
+ export { default as CollaboratorEditor } from './CollaboratorEditor';
44
+ export { default as DateEditor } from './DateEditor';
45
+ export { default as LinkEditor } from './LinkEditor';
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -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);
File without changes
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
  }
@@ -0,0 +1,25 @@
1
+ export var debounce = function debounce(fn, wait) {
2
+ var timeout = null;
3
+ return function () {
4
+ if (timeout !== null) clearTimeout(timeout);
5
+ timeout = setTimeout(fn, wait);
6
+ };
7
+ };
8
+ export var throttle = function throttle(func, delay) {
9
+ var timer = null;
10
+ var startTime = Date.now();
11
+ return function () {
12
+ var curTime = Date.now();
13
+ var remaining = delay - (curTime - startTime);
14
+ var context = this;
15
+ var args = arguments;
16
+ clearTimeout(timer);
17
+
18
+ if (remaining <= 0) {
19
+ func.apply(context, args);
20
+ startTime = Date.now();
21
+ } else {
22
+ timer = setTimeout(func, remaining);
23
+ }
24
+ };
25
+ };
@@ -1,7 +1,7 @@
1
+ /* eslint-disable no-case-declarations */
1
2
  import moment from 'moment';
2
3
  import NP from './number-precision';
3
- 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';
4
- 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';
5
5
  NP.enableBoundaryChecking(false);
6
6
  var _separatorMap = {
7
7
  'comma': ',',
@@ -167,6 +167,7 @@ export var getDateDisplayString = function getDateDisplayString(value, format) {
167
167
  switch (format) {
168
168
  case 'D/M/YYYY':
169
169
  case 'DD/MM/YYYY':
170
+ // no-case-declarations
170
171
  var formatValue = date.format('YYYY-MM-DD');
171
172
  var formatValueList = formatValue.split('-');
172
173
  return "".concat(formatValueList[2], "/").concat(formatValueList[1], "/").concat(formatValueList[0]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.1.73",
3
+ "version": "0.1.75beta10",
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 && rm lib/app.js && rm lib/app.css",
52
+ "prepublishOnly": "npm run pub:lib && npm run pub:umd && npm run pub:optimized"
53
53
  },
54
54
  "files": [
55
55
  "assets",
package/es/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/es/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 './components/cell-formatter';
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,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);