dtable-ui-component 0.1.75 → 0.1.79

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 (164) hide show
  1. package/README.md +20 -2
  2. package/lib/AutoNumberFormatter/index.css +1 -0
  3. package/{es/components/cell-formatter/auto-number-formatter.js → lib/AutoNumberFormatter/index.js} +1 -0
  4. package/lib/ButtonFormatter/index.css +13 -0
  5. package/{es/components/cell-formatter/button-formatter.js → lib/ButtonFormatter/index.js} +1 -0
  6. package/lib/CTimeFormatter/index.css +1 -0
  7. package/{es/components/cell-formatter/ctime-formatter.js → lib/CTimeFormatter/index.js} +1 -0
  8. package/lib/CheckboxEditor/index.js +104 -0
  9. package/lib/CheckboxFormatter/index.css +1 -0
  10. package/{es/components/cell-formatter/checkbox-formatter.js → lib/CheckboxFormatter/index.js} +1 -0
  11. package/lib/CollaboratorEditor/index.css +48 -0
  12. package/lib/CollaboratorEditor/index.js +237 -0
  13. package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.css +86 -0
  14. package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +178 -0
  15. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.css +1 -0
  16. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +110 -0
  17. package/lib/CollaboratorFormatter/index.css +1 -0
  18. package/{es/components/cell-formatter/collaborator-formatter.js → lib/CollaboratorFormatter/index.js} +3 -2
  19. package/lib/CollaboratorItem/index.css +49 -0
  20. package/{es/components/common/collaborator-item.js → lib/CollaboratorItem/index.js} +1 -0
  21. package/lib/CreatorFormatter/index.css +1 -0
  22. package/{es/components/cell-formatter/creator-formatter.js → lib/CreatorFormatter/index.js} +3 -2
  23. package/lib/DateEditor/index.css +4 -0
  24. package/lib/DateEditor/index.js +152 -0
  25. package/{es/css → lib/DateEditor/mb-date-editor-popover}/custom-rc-calendar.css +0 -0
  26. package/lib/DateEditor/mb-date-editor-popover/index.css +45 -0
  27. package/lib/DateEditor/mb-date-editor-popover/index.js +245 -0
  28. package/lib/DateEditor/pc-date-editor-popover.js +142 -0
  29. package/lib/DateFormatter/index.css +1 -0
  30. package/{es/components/cell-formatter/date-formatter.js → lib/DateFormatter/index.js} +2 -1
  31. package/lib/DtableSelect/index.js +140 -0
  32. package/lib/DurationFormatter/index.css +1 -0
  33. package/{es/components/cell-formatter/duration-formatter.js → lib/DurationFormatter/index.js} +2 -1
  34. package/{es/components/common/edit-editor-button.js → lib/EditEditorButton/index.js} +0 -0
  35. package/lib/EmailFormatter/index.css +5 -0
  36. package/{es/components/cell-formatter/email-formatter.js → lib/EmailFormatter/index.js} +1 -0
  37. package/lib/FileEditor/index.js +46 -0
  38. package/lib/FileEditor/pc-files-addition/index.js +0 -0
  39. package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +0 -0
  40. package/lib/FileEditor/pc-files-preview/index.js +0 -0
  41. package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +0 -0
  42. package/lib/FileFormatter/index.css +29 -0
  43. package/{es/components/cell-formatter/file-formatter.js → lib/FileFormatter/index.js} +2 -1
  44. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/excel.png +0 -0
  45. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/file.png +0 -0
  46. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/music.png +0 -0
  47. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/pdf.png +0 -0
  48. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/pic.png +0 -0
  49. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/ppt.png +0 -0
  50. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/txt.png +0 -0
  51. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/video.png +0 -0
  52. package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/word.png +0 -0
  53. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/excel.png +0 -0
  54. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/file.png +0 -0
  55. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/music.png +0 -0
  56. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/pdf.png +0 -0
  57. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/pic.png +0 -0
  58. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/ppt.png +0 -0
  59. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/txt.png +0 -0
  60. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/video.png +0 -0
  61. package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/word.png +0 -0
  62. package/{es/assets/images → lib/FileItemFormatter/assets}/folder/folder-192.png +0 -0
  63. package/{es/assets/images → lib/FileItemFormatter/assets}/folder/folder-24.png +0 -0
  64. package/{es/components/cell-formatter/widgets/file-item-formatter.js → lib/FileItemFormatter/index.js} +2 -2
  65. package/lib/FileItemFormatter/utils.js +72 -0
  66. package/{es/components/file-uploader → lib/FileUploader}/index.js +0 -0
  67. package/{es/utils → lib/FormulaFormatter}/cell-value-validator.js +1 -2
  68. package/lib/FormulaFormatter/index.css +19 -0
  69. package/{es/components/cell-formatter/formula-formatter.js → lib/FormulaFormatter/index.js} +7 -8
  70. package/{es/utils/column-utils.js → lib/FormulaFormatter/utils.js} +5 -1
  71. package/lib/GeolocationFormatter/index.css +1 -0
  72. package/{es/components/cell-formatter/geolocation-formatter.js → lib/GeolocationFormatter/index.js} +2 -1
  73. package/lib/HtmlLongTextFormatter/index.css +63 -0
  74. package/{es/components/cell-formatter/widgets/long-text-formatter/html-long-text-formatter.js → lib/HtmlLongTextFormatter/index.js} +5 -2
  75. package/{es/utils → lib/HtmlLongTextFormatter}/markdown2html.js +2 -2
  76. package/{es/utils → lib/HtmlLongTextFormatter}/unified/index.js +8 -5
  77. package/{es/utils → lib/HtmlLongTextFormatter}/vfile/core.js +4 -2
  78. package/{es/utils → lib/HtmlLongTextFormatter}/vfile/index.js +4 -3
  79. package/{es/components/common → lib/ImageFormatter}/images-lazy-load.js +2 -2
  80. package/lib/ImageFormatter/index.css +34 -0
  81. package/{es/components/cell-formatter/image-formatter.js → lib/ImageFormatter/index.js} +4 -3
  82. package/lib/ImageFormatter/utils.js +7 -0
  83. package/{es/css/image-previewer-ligntbox.css → lib/ImagePreviewerLightbox/index.css} +0 -0
  84. package/{es/components/cell-formatter/widgets/image-previewer-lightbox.js → lib/ImagePreviewerLightbox/index.js} +3 -3
  85. package/lib/ImagePreviewerLightbox/utils.js +8 -0
  86. package/lib/LastModifierFormatter/index.css +1 -0
  87. package/{es/components/cell-formatter/last-modifier-formatter.js → lib/LastModifierFormatter/index.js} +5 -4
  88. package/lib/LinkEditor/index.css +9 -0
  89. package/lib/LinkEditor/index.js +304 -0
  90. package/{es/components/common → lib/LinkEditor}/link-editor-option.js +0 -0
  91. package/lib/LinkEditor/mb-link-editor-popover/index.css +85 -0
  92. package/lib/LinkEditor/mb-link-editor-popover/index.js +171 -0
  93. package/lib/LinkEditor/pc-link-editor-popover/index.css +63 -0
  94. package/lib/LinkEditor/pc-link-editor-popover/index.js +115 -0
  95. package/lib/LinkFormatter/index.css +27 -0
  96. package/{es/components/cell-formatter/link-formatter.js → lib/LinkFormatter/index.js} +2 -2
  97. package/{es/css/loading.css → lib/Loading/index.css} +0 -0
  98. package/{es/components/loading.js → lib/Loading/index.js} +1 -1
  99. package/{es/components/cell-formatter/long-text-formatter.js → lib/LongTextFormatter/index.js} +4 -6
  100. package/{es/components/common/mobile/mb-editor-header.js → lib/MBEditorHeader/index.js} +0 -0
  101. package/lib/MTimeFormatter/index.css +1 -0
  102. package/{es/components/cell-formatter/mtime-formatter.js → lib/MTimeFormatter/index.js} +1 -0
  103. package/{es/components/common/modal-portal.js → lib/ModalPortal/index.js} +0 -0
  104. package/lib/MultipleSelectEditor/index.css +9 -0
  105. package/lib/MultipleSelectEditor/index.js +236 -0
  106. package/lib/MultipleSelectFormatter/index.css +1 -0
  107. package/{es/components/cell-formatter/multiple-select-formatter.js → lib/MultipleSelectFormatter/index.js} +2 -1
  108. package/lib/NumberEditor/index.js +154 -0
  109. package/lib/NumberFormatter/index.css +1 -0
  110. package/{es/components/cell-formatter/number-formatter.js → lib/NumberFormatter/index.js} +2 -1
  111. package/lib/RateFormatter/index.css +1 -0
  112. package/{es/components/cell-formatter/rate-formatter.js → lib/RateFormatter/index.js} +1 -0
  113. package/{es/components/common/select-item.js → lib/SelectItem/index.js} +0 -0
  114. package/lib/SimpleLongTextFormatter/index.css +63 -0
  115. package/{es/components/cell-formatter/widgets/long-text-formatter/simple-long-text-formatter.js → lib/SimpleLongTextFormatter/index.js} +5 -2
  116. package/{es/utils → lib/SimpleLongTextFormatter}/normalize-long-text-value.js +3 -3
  117. package/lib/SingleSelectEditor/index.css +9 -0
  118. package/lib/SingleSelectEditor/index.js +201 -0
  119. package/lib/SingleSelectFormatter/index.css +1 -0
  120. package/{es/components/cell-formatter/single-select-formatter.js → lib/SingleSelectFormatter/index.js} +2 -1
  121. package/lib/TextEditor/index.js +122 -0
  122. package/lib/TextFormatter/index.css +1 -0
  123. package/{es/components/cell-formatter/text-formatter.js → lib/TextFormatter/index.js} +1 -0
  124. package/lib/UrlFormatter/index.css +5 -0
  125. package/{es/components/cell-formatter/url-formatter.js → lib/UrlFormatter/index.js} +1 -0
  126. package/{es → lib}/assets/images/avatar/default_avatar.png +0 -0
  127. package/{es/components/cell-factory/cell-formatter-factory.js → lib/cellFormatterFactory/index.js} +3 -3
  128. package/{es → lib}/constants/cell-types.js +0 -0
  129. package/lib/constants/index.js +49 -0
  130. package/lib/css/cell-editor.css +6 -0
  131. package/lib/css/cell-formatter.css +4 -0
  132. package/lib/css/mb-cell-editor.css +55 -0
  133. package/lib/formatterConfig/index.js +31 -0
  134. package/lib/index.js +45 -0
  135. package/{es → lib}/lang/index.js +0 -0
  136. package/{es → lib}/locals/de.js +0 -0
  137. package/{es → lib}/locals/en.js +0 -0
  138. package/{es → lib}/locals/fr.js +0 -0
  139. package/{es → lib}/locals/zh-CN.js +0 -0
  140. package/lib/select-editor/index.js +4 -0
  141. package/lib/select-editor/mb-select-editor-popover/index.css +127 -0
  142. package/lib/select-editor/mb-select-editor-popover/index.js +231 -0
  143. package/lib/select-editor/pc-select-editor-popover/index.css +72 -0
  144. package/lib/select-editor/pc-select-editor-popover/index.js +144 -0
  145. package/{es/components/common → lib/select-editor}/select-editor-option.js +0 -0
  146. package/{es/components/toast → lib/toaster}/alert.js +0 -0
  147. package/{es/components/toast → lib/toaster}/index.js +0 -0
  148. package/{es/components/toast → lib/toaster}/toast.js +0 -0
  149. package/{es/components/toast → lib/toaster}/toastManager.js +0 -0
  150. package/{es/components/toast → lib/toaster}/toaster.js +0 -0
  151. package/lib/utils/editor-utils.js +71 -0
  152. package/{es → lib}/utils/number-precision.js +1 -0
  153. package/lib/utils/utils.js +25 -0
  154. package/{es → lib}/utils/value-format-utils.js +7 -10
  155. package/package.json +9 -8
  156. package/es/app.css +0 -20
  157. package/es/app.js +0 -91
  158. package/es/components/cell-formatter/formatter-config.js +0 -31
  159. package/es/components/cell-formatter/index.js +0 -27
  160. package/es/constants/index.js +0 -48
  161. package/es/css/cell-editor.css +0 -614
  162. package/es/css/cell-formatter.css +0 -247
  163. package/es/index.js +0 -6
  164. package/es/utils/utils.js +0 -116
@@ -0,0 +1,71 @@
1
+ var zhCN = require('@seafile/seafile-calendar/lib/locale/zh_CN');
2
+
3
+ var zhTW = require('@seafile/seafile-calendar/lib/locale/zh_TW');
4
+
5
+ var enUS = require('@seafile/seafile-calendar/lib/locale/en_US');
6
+
7
+ var frFR = require('@seafile/seafile-calendar/lib/locale/fr_FR');
8
+
9
+ var deDE = require('@seafile/seafile-calendar/lib/locale/de_DE');
10
+
11
+ var esES = require('@seafile/seafile-calendar/lib/locale/es_ES');
12
+
13
+ var plPL = require('@seafile/seafile-calendar/lib/locale/pl_PL');
14
+
15
+ var csCZ = require('@seafile/seafile-calendar/lib/locale/cs_CZ');
16
+
17
+ export var initDateEditorLanguage = function initDateEditorLanguage(lang) {
18
+ var language;
19
+
20
+ switch (lang) {
21
+ case 'zh-cn':
22
+ language = zhCN;
23
+ break;
24
+
25
+ case 'zh-tw':
26
+ language = zhTW;
27
+ break;
28
+
29
+ case 'en':
30
+ language = enUS;
31
+ break;
32
+
33
+ case 'fr':
34
+ language = frFR;
35
+ break;
36
+
37
+ case 'de':
38
+ language = deDE;
39
+ break;
40
+
41
+ case 'es':
42
+ language = esES;
43
+ break;
44
+
45
+ case 'es-ar':
46
+ language = esES;
47
+ break;
48
+
49
+ case 'es-mx':
50
+ language = esES;
51
+ break;
52
+
53
+ case 'pl':
54
+ language = plPL;
55
+ break;
56
+
57
+ case 'cs':
58
+ language = csCZ;
59
+ break;
60
+
61
+ default:
62
+ language = zhCN;
63
+ }
64
+
65
+ return language;
66
+ };
67
+ export var getSelectOptionItem = function getSelectOptionItem(options, optionId) {
68
+ return options.find(function (option) {
69
+ return option.id === optionId;
70
+ });
71
+ };
@@ -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]);
@@ -179,19 +180,15 @@ export var getDateDisplayString = function getDateDisplayString(value, format) {
179
180
  return "".concat(formatDateList[2], "/").concat(formatDateList[1], "/").concat(formatDateList[0], " ").concat(formatValuesList[1]);
180
181
 
181
182
  case 'M/D/YYYY':
182
- return date.format('M/D/YYYY');
183
-
184
183
  case 'M/D/YYYY HH:mm':
185
- return date.format('M/D/YYYY HH:mm');
186
-
187
184
  case 'YYYY-MM-DD':
188
- return date.format('YYYY-MM-DD');
189
-
190
185
  case 'YYYY-MM-DD HH:mm':
191
- return date.format('YYYY-MM-DD HH:mm');
186
+ case 'DD.MM.YYYY':
187
+ case 'DD.MM.YYYY HH:mm':
188
+ return date.format(format);
192
189
 
193
190
  default:
194
- return value;
191
+ return date.format('YYYY-MM-DD');
195
192
  }
196
193
  };
197
194
  export var getDurationDisplayString = function getDurationDisplayString(value, duration_format) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.1.75",
4
- "main": "./es/index.js",
3
+ "version": "0.1.79",
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,10 +16,11 @@
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
+ "react-select": "^3.1.0",
23
24
  "react-transition-group": "^4.4.1",
24
25
  "reactstrap": "^8.4.1",
25
26
  "rehype-format": "^2.2.0",
@@ -45,11 +46,11 @@
45
46
  "eslint": "eslint --ext .jsx,.js src --max-warnings=0",
46
47
  "storybook": "start-storybook -p 6006",
47
48
  "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 && rm -rf es/components/cell-editor/ && rm -rf es/components/cell-editor-dialog/ && rm -rf es/components/cell-editor-popover/ && rm es/utils/editor-utils.js",
49
- "pub:lib": "npm run clean:lib && export BABEL_ENV=node && ./node_modules/.bin/babel src --out-dir lib --copy-files",
49
+ "pub:esm": "npm run clean:esm && export BABEL_ENV=node && ./node_modules/.bin/babel src --out-dir es --copy-files",
50
+ "pub:lib": "npm run clean:lib && export BABEL_ENV=production && ./node_modules/.bin/babel src --out-dir lib --copy-files",
50
51
  "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"
52
+ "pub:optimized": "rm lib/index.local.js && rm lib/app.js && rm lib/app.css",
53
+ "prepublishOnly": "npm run pub:lib && npm run pub:umd && npm run pub:optimized"
53
54
  },
54
55
  "files": [
55
56
  "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,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);