dtable-ui-component 0.1.75-beta1 → 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.
- package/README.md +15 -2
- package/lib/AutoNumberFormatter/index.css +1 -0
- package/{es/components/cell-formatter/auto-number-formatter.js → lib/AutoNumberFormatter/index.js} +1 -0
- package/lib/ButtonFormatter/index.css +13 -0
- package/{es/components/cell-formatter/button-formatter.js → lib/ButtonFormatter/index.js} +1 -0
- package/lib/CTimeFormatter/index.css +1 -0
- package/{es/components/cell-formatter/ctime-formatter.js → lib/CTimeFormatter/index.js} +1 -0
- package/{es/components/cell-editor/checkbox-editor.js → lib/CheckboxEditor/index.js} +0 -0
- package/lib/CheckboxFormatter/index.css +1 -0
- package/{es/components/cell-formatter/checkbox-formatter.js → lib/CheckboxFormatter/index.js} +1 -0
- package/lib/CollaboratorEditor/index.css +48 -0
- package/{es/components/cell-editor/collaborator-editor.js → lib/CollaboratorEditor/index.js} +6 -5
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.css +86 -0
- package/{es/components/cell-editor-popover/mb-collaborator-editor-popover.js → lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js} +2 -1
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.css +1 -0
- package/{es/components/cell-editor-popover/pc-collaborator-editor-popover.js → lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js} +2 -1
- package/lib/CollaboratorFormatter/index.css +1 -0
- package/{es/components/cell-formatter/collaborator-formatter.js → lib/CollaboratorFormatter/index.js} +3 -2
- package/lib/CollaboratorItem/index.css +49 -0
- package/{es/components/common/collaborator-item.js → lib/CollaboratorItem/index.js} +1 -0
- package/lib/CreatorFormatter/index.css +1 -0
- package/{es/components/cell-formatter/creator-formatter.js → lib/CreatorFormatter/index.js} +3 -2
- package/lib/DateEditor/index.css +4 -0
- package/{es/components/cell-editor/date-editor.js → lib/DateEditor/index.js} +5 -4
- package/{es/css → lib/DateEditor/mb-date-editor-popover}/custom-rc-calendar.css +0 -0
- package/lib/DateEditor/mb-date-editor-popover/index.css +45 -0
- package/{es/components/cell-editor-popover/mb-date-editor-popover.js → lib/DateEditor/mb-date-editor-popover/index.js} +10 -10
- package/{es/components/cell-editor-popover → lib/DateEditor}/pc-date-editor-popover.js +2 -2
- package/lib/DateFormatter/index.css +1 -0
- package/{es/components/cell-formatter/date-formatter.js → lib/DateFormatter/index.js} +2 -1
- package/lib/DurationFormatter/index.css +1 -0
- package/{es/components/cell-formatter/duration-formatter.js → lib/DurationFormatter/index.js} +2 -1
- package/{es/components/common/edit-editor-button.js → lib/EditEditorButton/index.js} +0 -0
- package/lib/EmailFormatter/index.css +5 -0
- package/{es/components/cell-formatter/email-formatter.js → lib/EmailFormatter/index.js} +1 -0
- package/{es/components/cell-editor-dialog/pc-file-editor-dialog.js → lib/FileEditor/index.js} +10 -10
- package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-addition/index.js +0 -0
- package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-addition/pc-file-uploaded-item.js +0 -0
- package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-preview/index.js +0 -0
- package/{es/components/cell-editor-dialog → lib/FileEditor}/pc-files-preview/pc-file-item-preview.js +0 -0
- package/lib/FileFormatter/index.css +29 -0
- package/{es/components/cell-formatter/file-formatter.js → lib/FileFormatter/index.js} +2 -1
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/excel.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/file.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/music.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/pdf.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/pic.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/ppt.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/txt.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/video.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/192/word.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/excel.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/file.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/music.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/pdf.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/pic.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/ppt.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/txt.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/video.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/file/24/word.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/folder/folder-192.png +0 -0
- package/{es/assets/images → lib/FileItemFormatter/assets}/folder/folder-24.png +0 -0
- package/{es/components/cell-formatter/widgets/file-item-formatter.js → lib/FileItemFormatter/index.js} +2 -2
- package/lib/FileItemFormatter/utils.js +72 -0
- package/{es/components/file-uploader → lib/FileUploader}/index.js +0 -0
- package/{es/utils → lib/FormulaFormatter}/cell-value-validator.js +1 -2
- package/lib/FormulaFormatter/index.css +19 -0
- package/{es/components/cell-formatter/formula-formatter.js → lib/FormulaFormatter/index.js} +7 -8
- package/{es/utils/column-utils.js → lib/FormulaFormatter/utils.js} +5 -1
- package/lib/GeolocationFormatter/index.css +1 -0
- package/{es/components/cell-formatter/geolocation-formatter.js → lib/GeolocationFormatter/index.js} +2 -1
- package/lib/HtmlLongTextFormatter/index.css +63 -0
- package/{es/components/cell-formatter/widgets/long-text-formatter/html-long-text-formatter.js → lib/HtmlLongTextFormatter/index.js} +2 -1
- package/{es/utils → lib/HtmlLongTextFormatter}/markdown2html.js +0 -0
- package/{es/utils → lib/HtmlLongTextFormatter}/unified/index.js +1 -0
- package/{es/utils → lib/HtmlLongTextFormatter}/vfile/core.js +1 -0
- package/{es/utils → lib/HtmlLongTextFormatter}/vfile/index.js +0 -0
- package/{es/components/common → lib/ImageFormatter}/images-lazy-load.js +2 -2
- package/lib/ImageFormatter/index.css +34 -0
- package/{es/components/cell-formatter/image-formatter.js → lib/ImageFormatter/index.js} +4 -3
- package/lib/ImageFormatter/utils.js +7 -0
- package/{es/css/image-previewer-ligntbox.css → lib/ImagePreviewerLightbox/index.css} +0 -0
- package/{es/components/cell-formatter/widgets/image-previewer-lightbox.js → lib/ImagePreviewerLightbox/index.js} +3 -3
- package/lib/ImagePreviewerLightbox/utils.js +8 -0
- package/lib/LastModifierFormatter/index.css +1 -0
- package/{es/components/cell-formatter/last-modifier-formatter.js → lib/LastModifierFormatter/index.js} +5 -4
- package/lib/LinkEditor/index.css +9 -0
- package/{es/components/cell-editor/link-editor.js → lib/LinkEditor/index.js} +10 -9
- package/{es/components/common → lib/LinkEditor}/link-editor-option.js +0 -0
- package/lib/LinkEditor/mb-link-editor-popover/index.css +85 -0
- package/{es/components/cell-editor-popover/mb-link-editor-popover.js → lib/LinkEditor/mb-link-editor-popover/index.js} +2 -1
- package/lib/LinkEditor/pc-link-editor-popover/index.css +63 -0
- package/{es/components/cell-editor-popover/pc-link-editor-popover.js → lib/LinkEditor/pc-link-editor-popover/index.js} +1 -0
- package/lib/LinkFormatter/index.css +27 -0
- package/{es/components/cell-formatter/link-formatter.js → lib/LinkFormatter/index.js} +2 -2
- package/{es/css/loading.css → lib/Loading/index.css} +0 -0
- package/{es/components/loading.js → lib/Loading/index.js} +1 -1
- package/{es/components/cell-formatter/long-text-formatter.js → lib/LongTextFormatter/index.js} +2 -2
- package/{es/components/common/mobile/mb-editor-header.js → lib/MBEditorHeader/index.js} +0 -0
- package/lib/MTimeFormatter/index.css +1 -0
- package/{es/components/cell-formatter/mtime-formatter.js → lib/MTimeFormatter/index.js} +1 -0
- package/{es/components/common/modal-portal.js → lib/ModalPortal/index.js} +0 -0
- package/lib/MultipleSelectEditor/index.css +9 -0
- package/{es/components/cell-editor/multiple-select-editor.js → lib/MultipleSelectEditor/index.js} +5 -6
- package/lib/MultipleSelectFormatter/index.css +1 -0
- package/{es/components/cell-formatter/multiple-select-formatter.js → lib/MultipleSelectFormatter/index.js} +2 -1
- package/{es/components/cell-editor/number-editor.js → lib/NumberEditor/index.js} +2 -2
- package/lib/NumberFormatter/index.css +1 -0
- package/{es/components/cell-formatter/number-formatter.js → lib/NumberFormatter/index.js} +2 -1
- package/lib/RateFormatter/index.css +1 -0
- package/{es/components/cell-formatter/rate-formatter.js → lib/RateFormatter/index.js} +1 -0
- package/{es/components/common/select-item.js → lib/SelectItem/index.js} +0 -0
- package/lib/SimpleLongTextFormatter/index.css +63 -0
- package/{es/components/cell-formatter/widgets/long-text-formatter/simple-long-text-formatter.js → lib/SimpleLongTextFormatter/index.js} +2 -1
- package/{es/utils → lib/SimpleLongTextFormatter}/normalize-long-text-value.js +3 -3
- package/lib/SingleSelectEditor/index.css +9 -0
- package/{es/components/cell-editor/single-select-editor.js → lib/SingleSelectEditor/index.js} +5 -6
- package/lib/SingleSelectFormatter/index.css +1 -0
- package/{es/components/cell-formatter/single-select-formatter.js → lib/SingleSelectFormatter/index.js} +2 -1
- package/{es/components/cell-editor/text-editor.js → lib/TextEditor/index.js} +2 -2
- package/lib/TextFormatter/index.css +1 -0
- package/{es/components/cell-formatter/text-formatter.js → lib/TextFormatter/index.js} +1 -0
- package/lib/UrlFormatter/index.css +5 -0
- package/{es/components/cell-formatter/url-formatter.js → lib/UrlFormatter/index.js} +1 -0
- package/{es/components/cell-factory/cell-formatter-factory.js → lib/cellFormatterFactory/index.js} +3 -3
- package/lib/constants/cell-types.js +25 -54
- package/lib/constants/index.js +5 -26
- package/lib/css/cell-editor.css +0 -608
- package/lib/css/cell-formatter.css +0 -243
- package/lib/css/mb-cell-editor.css +55 -0
- package/lib/formatterConfig/index.js +31 -0
- package/lib/index.js +45 -64
- package/lib/lang/index.js +11 -27
- package/lib/locals/de.js +1 -6
- package/lib/locals/en.js +1 -6
- package/lib/locals/fr.js +1 -6
- package/lib/locals/zh-CN.js +1 -6
- package/lib/select-editor/index.js +4 -0
- package/lib/select-editor/mb-select-editor-popover/index.css +127 -0
- package/{es/components/cell-editor-popover/mb-select-editor-popover.js → lib/select-editor/mb-select-editor-popover/index.js} +12 -11
- package/lib/select-editor/pc-select-editor-popover/index.css +72 -0
- package/{es/components/cell-editor-popover/pc-select-editor-popover.js → lib/select-editor/pc-select-editor-popover/index.js} +1 -0
- package/{es/components/common → lib/select-editor}/select-editor-option.js +0 -0
- package/{es/components/toast → lib/toaster}/alert.js +0 -0
- package/{es/components/toast → lib/toaster}/index.js +0 -0
- package/{es/components/toast → lib/toaster}/toast.js +0 -0
- package/{es/components/toast → lib/toaster}/toastManager.js +0 -0
- package/{es/components/toast → lib/toaster}/toaster.js +0 -0
- package/lib/utils/editor-utils.js +3 -13
- package/lib/utils/number-precision.js +14 -31
- package/lib/utils/utils.js +3 -119
- package/lib/utils/value-format-utils.js +59 -108
- package/package.json +5 -5
- package/es/app.css +0 -20
- package/es/app.js +0 -91
- package/es/assets/images/avatar/default_avatar.png +0 -0
- package/es/components/cell-editor/index.js +0 -9
- package/es/components/cell-formatter/formatter-config.js +0 -31
- package/es/components/cell-formatter/index.js +0 -27
- package/es/constants/cell-types.js +0 -25
- package/es/constants/index.js +0 -48
- package/es/css/cell-editor.css +0 -614
- package/es/css/cell-formatter.css +0 -247
- package/es/index.js +0 -6
- package/es/lang/index.js +0 -50
- package/es/locals/de.js +0 -2
- package/es/locals/en.js +0 -17
- package/es/locals/fr.js +0 -2
- package/es/locals/zh-CN.js +0 -17
- package/es/utils/editor-utils.js +0 -71
- package/es/utils/number-precision.js +0 -163
- package/es/utils/utils.js +0 -116
- package/es/utils/value-format-utils.js +0 -495
- package/lib/app.css +0 -20
- package/lib/app.js +0 -96
- package/lib/assets/images/file/192/excel.png +0 -0
- package/lib/assets/images/file/192/file.png +0 -0
- package/lib/assets/images/file/192/music.png +0 -0
- package/lib/assets/images/file/192/pdf.png +0 -0
- package/lib/assets/images/file/192/pic.png +0 -0
- package/lib/assets/images/file/192/ppt.png +0 -0
- package/lib/assets/images/file/192/txt.png +0 -0
- package/lib/assets/images/file/192/video.png +0 -0
- package/lib/assets/images/file/192/word.png +0 -0
- package/lib/assets/images/file/24/excel.png +0 -0
- package/lib/assets/images/file/24/file.png +0 -0
- package/lib/assets/images/file/24/music.png +0 -0
- package/lib/assets/images/file/24/pdf.png +0 -0
- package/lib/assets/images/file/24/pic.png +0 -0
- package/lib/assets/images/file/24/ppt.png +0 -0
- package/lib/assets/images/file/24/txt.png +0 -0
- package/lib/assets/images/file/24/video.png +0 -0
- package/lib/assets/images/file/24/word.png +0 -0
- package/lib/assets/images/folder/folder-192.png +0 -0
- package/lib/assets/images/folder/folder-24.png +0 -0
- package/lib/components/cell-editor/checkbox-editor.js +0 -111
- package/lib/components/cell-editor/collaborator-editor.js +0 -249
- package/lib/components/cell-editor/date-editor.js +0 -171
- package/lib/components/cell-editor/index.js +0 -40
- package/lib/components/cell-editor/link-editor.js +0 -321
- package/lib/components/cell-editor/multiple-select-editor.js +0 -250
- package/lib/components/cell-editor/number-editor.js +0 -162
- package/lib/components/cell-editor/single-select-editor.js +0 -216
- package/lib/components/cell-editor/text-editor.js +0 -129
- package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +0 -66
- package/lib/components/cell-editor-dialog/pc-files-addition/index.js +0 -1
- package/lib/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -1
- package/lib/components/cell-editor-dialog/pc-files-preview/index.js +0 -1
- package/lib/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -1
- package/lib/components/cell-editor-popover/mb-collaborator-editor-popover.js +0 -183
- package/lib/components/cell-editor-popover/mb-date-editor-popover.js +0 -262
- package/lib/components/cell-editor-popover/mb-link-editor-popover.js +0 -176
- package/lib/components/cell-editor-popover/mb-select-editor-popover.js +0 -243
- package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +0 -124
- package/lib/components/cell-editor-popover/pc-date-editor-popover.js +0 -156
- package/lib/components/cell-editor-popover/pc-link-editor-popover.js +0 -128
- package/lib/components/cell-editor-popover/pc-select-editor-popover.js +0 -157
- package/lib/components/cell-factory/cell-formatter-factory.js +0 -28
- package/lib/components/cell-formatter/auto-number-formatter.js +0 -45
- package/lib/components/cell-formatter/button-formatter.js +0 -66
- package/lib/components/cell-formatter/checkbox-formatter.js +0 -56
- package/lib/components/cell-formatter/collaborator-formatter.js +0 -111
- package/lib/components/cell-formatter/creator-formatter.js +0 -105
- package/lib/components/cell-formatter/ctime-formatter.js +0 -70
- package/lib/components/cell-formatter/date-formatter.js +0 -73
- package/lib/components/cell-formatter/duration-formatter.js +0 -49
- package/lib/components/cell-formatter/email-formatter.js +0 -45
- package/lib/components/cell-formatter/file-formatter.js +0 -77
- package/lib/components/cell-formatter/formatter-config.js +0 -66
- package/lib/components/cell-formatter/formula-formatter.js +0 -189
- package/lib/components/cell-formatter/geolocation-formatter.js +0 -66
- package/lib/components/cell-formatter/image-formatter.js +0 -171
- package/lib/components/cell-formatter/index.js +0 -112
- package/lib/components/cell-formatter/last-modifier-formatter.js +0 -105
- package/lib/components/cell-formatter/link-formatter.js +0 -165
- package/lib/components/cell-formatter/long-text-formatter.js +0 -46
- package/lib/components/cell-formatter/mtime-formatter.js +0 -70
- package/lib/components/cell-formatter/multiple-select-formatter.js +0 -84
- package/lib/components/cell-formatter/number-formatter.js +0 -60
- package/lib/components/cell-formatter/rate-formatter.js +0 -93
- package/lib/components/cell-formatter/single-select-formatter.js +0 -84
- package/lib/components/cell-formatter/text-formatter.js +0 -67
- package/lib/components/cell-formatter/url-formatter.js +0 -45
- package/lib/components/cell-formatter/widgets/file-item-formatter.js +0 -63
- package/lib/components/cell-formatter/widgets/image-previewer-lightbox.js +0 -152
- package/lib/components/cell-formatter/widgets/long-text-formatter/html-long-text-formatter.js +0 -107
- package/lib/components/cell-formatter/widgets/long-text-formatter/simple-long-text-formatter.js +0 -110
- package/lib/components/common/collaborator-item.js +0 -79
- package/lib/components/common/edit-editor-button.js +0 -67
- package/lib/components/common/images-lazy-load.js +0 -158
- package/lib/components/common/link-editor-option.js +0 -121
- package/lib/components/common/mobile/mb-editor-header.js +0 -61
- package/lib/components/common/modal-portal.js +0 -51
- package/lib/components/common/select-editor-option.js +0 -122
- package/lib/components/common/select-item.js +0 -73
- package/lib/components/file-uploader/index.js +0 -63
- package/lib/components/loading.js +0 -16
- package/lib/components/toast/alert.js +0 -164
- package/lib/components/toast/index.js +0 -12
- package/lib/components/toast/toast.js +0 -223
- package/lib/components/toast/toastManager.js +0 -189
- package/lib/components/toast/toaster.js +0 -92
- package/lib/css/custom-rc-calendar.css +0 -118
- package/lib/css/image-previewer-ligntbox.css +0 -87
- package/lib/css/loading.css +0 -54
- package/lib/utils/cell-value-validator.js +0 -41
- package/lib/utils/column-utils.js +0 -15
- package/lib/utils/markdown2html.js +0 -68
- package/lib/utils/normalize-long-text-value.js +0 -74
- package/lib/utils/unified/index.js +0 -470
- package/lib/utils/vfile/core.js +0 -172
- package/lib/utils/vfile/index.js +0 -48
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.formatStringToNumber = exports.formatNumberString = void 0;
|
|
7
|
-
exports.getCellValueDisplayString = getCellValueDisplayString;
|
|
8
|
-
exports.getOptionName = exports.getNumberDisplayString = exports.getMultipleOptionName = exports.getLongtextDisplayString = exports.getGeolocationDisplayString = exports.getFormulaDisplayString = exports.getDurationDisplayString = exports.getDateDisplayString = exports.getCollaboratorsName = void 0;
|
|
9
|
-
|
|
10
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
11
|
-
|
|
12
|
-
var _numberPrecision = _interopRequireDefault(require("./number-precision"));
|
|
13
|
-
|
|
14
|
-
var _constants = require("../constants");
|
|
15
|
-
|
|
16
|
-
var CellType = _interopRequireWildcard(require("../constants/cell-types"));
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
|
-
_numberPrecision.default.enableBoundaryChecking(false);
|
|
23
|
-
|
|
1
|
+
/* eslint-disable no-case-declarations */
|
|
2
|
+
import moment from 'moment';
|
|
3
|
+
import NP from './number-precision';
|
|
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
|
+
NP.enableBoundaryChecking(false);
|
|
24
6
|
var _separatorMap = {
|
|
25
7
|
'comma': ',',
|
|
26
8
|
'dot': '.',
|
|
@@ -44,7 +26,7 @@ var _toThousands = function _toThousands(num, isCurrency, formatData) {
|
|
|
44
26
|
var decimalDigits = enable_precision ? precision : _getDecimalDigits(num);
|
|
45
27
|
var value = parseFloat(num.toFixed(decimalDigits));
|
|
46
28
|
var integer = Math.trunc(value);
|
|
47
|
-
var decimalValue = String(Math.abs(
|
|
29
|
+
var decimalValue = String(Math.abs(NP.minus(value, integer)).toFixed(decimalDigits)).slice(1);
|
|
48
30
|
|
|
49
31
|
if (isCurrency) {
|
|
50
32
|
if (decimalValue.length === 2) {
|
|
@@ -85,7 +67,7 @@ var _getDecimalDigits = function _getDecimalDigits(num) {
|
|
|
85
67
|
return digitsLength > 8 ? 8 : digitsLength;
|
|
86
68
|
};
|
|
87
69
|
|
|
88
|
-
var getNumberDisplayString = function getNumberDisplayString(value, formatData) {
|
|
70
|
+
export var getNumberDisplayString = function getNumberDisplayString(value, formatData) {
|
|
89
71
|
// formatData: old version maybe 'null'
|
|
90
72
|
var type = Object.prototype.toString.call(value);
|
|
91
73
|
|
|
@@ -101,7 +83,7 @@ var getNumberDisplayString = function getNumberDisplayString(value, formatData)
|
|
|
101
83
|
|
|
102
84
|
var _ref2 = formatData || {},
|
|
103
85
|
_ref2$format = _ref2.format,
|
|
104
|
-
format = _ref2$format === void 0 ?
|
|
86
|
+
format = _ref2$format === void 0 ? DEFAULT_NUMBER_FORMAT : _ref2$format;
|
|
105
87
|
|
|
106
88
|
switch (format) {
|
|
107
89
|
case 'number':
|
|
@@ -109,17 +91,17 @@ var getNumberDisplayString = function getNumberDisplayString(value, formatData)
|
|
|
109
91
|
|
|
110
92
|
case 'percent':
|
|
111
93
|
{
|
|
112
|
-
return _toThousands(Number.parseFloat((value * 100).toFixed(8)), false, formatData)
|
|
94
|
+
return "".concat(_toThousands(Number.parseFloat((value * 100).toFixed(8)), false, formatData), "%");
|
|
113
95
|
}
|
|
114
96
|
|
|
115
97
|
case 'yuan':
|
|
116
|
-
return "\uFFE5"
|
|
98
|
+
return "\uFFE5".concat(_toThousands(value, true, formatData));
|
|
117
99
|
|
|
118
100
|
case 'dollar':
|
|
119
|
-
return "$"
|
|
101
|
+
return "$".concat(_toThousands(value, true, formatData));
|
|
120
102
|
|
|
121
103
|
case 'euro':
|
|
122
|
-
return "\u20AC"
|
|
104
|
+
return "\u20AC".concat(_toThousands(value, true, formatData));
|
|
123
105
|
|
|
124
106
|
case 'duration':
|
|
125
107
|
{
|
|
@@ -130,10 +112,7 @@ var getNumberDisplayString = function getNumberDisplayString(value, formatData)
|
|
|
130
112
|
return '' + value;
|
|
131
113
|
}
|
|
132
114
|
};
|
|
133
|
-
|
|
134
|
-
exports.getNumberDisplayString = getNumberDisplayString;
|
|
135
|
-
|
|
136
|
-
var formatStringToNumber = function formatStringToNumber(value) {
|
|
115
|
+
export var formatStringToNumber = function formatStringToNumber(value) {
|
|
137
116
|
var isIncludePercent = value.indexOf('%') > -1;
|
|
138
117
|
var newData = parseFloat(value.replace(/[^.-\d]/g, ''));
|
|
139
118
|
|
|
@@ -143,31 +122,28 @@ var formatStringToNumber = function formatStringToNumber(value) {
|
|
|
143
122
|
|
|
144
123
|
return isNaN(newData) ? '' : newData;
|
|
145
124
|
};
|
|
146
|
-
|
|
147
|
-
exports.formatStringToNumber = formatStringToNumber;
|
|
148
|
-
|
|
149
|
-
var formatNumberString = function formatNumberString(value, format) {
|
|
125
|
+
export var formatNumberString = function formatNumberString(value, format) {
|
|
150
126
|
var formattedValue = '';
|
|
151
127
|
|
|
152
128
|
switch (format) {
|
|
153
|
-
case
|
|
154
|
-
case
|
|
129
|
+
case NUMBER_TYPES.NUMBER:
|
|
130
|
+
case NUMBER_TYPES.NUMBER_WITH_COMMAS:
|
|
155
131
|
formattedValue = value.replace(/[^.-\d,]/g, '');
|
|
156
132
|
break;
|
|
157
133
|
|
|
158
|
-
case
|
|
134
|
+
case NUMBER_TYPES.PERCENT:
|
|
159
135
|
formattedValue = value.replace(/[^.-\d,%]/g, '');
|
|
160
136
|
break;
|
|
161
137
|
|
|
162
|
-
case
|
|
138
|
+
case NUMBER_TYPES.YUAN:
|
|
163
139
|
formattedValue = value.replace(/[^.-\d¥,]/g, '');
|
|
164
140
|
break;
|
|
165
141
|
|
|
166
|
-
case
|
|
142
|
+
case NUMBER_TYPES.DOLLAR:
|
|
167
143
|
formattedValue = value.replace(/[^.-\d$,]/g, '');
|
|
168
144
|
break;
|
|
169
145
|
|
|
170
|
-
case
|
|
146
|
+
case NUMBER_TYPES.EURO:
|
|
171
147
|
formattedValue = value.replace(/[^.-\d€,]/g, '');
|
|
172
148
|
break;
|
|
173
149
|
|
|
@@ -177,10 +153,7 @@ var formatNumberString = function formatNumberString(value, format) {
|
|
|
177
153
|
|
|
178
154
|
return formattedValue;
|
|
179
155
|
};
|
|
180
|
-
|
|
181
|
-
exports.formatNumberString = formatNumberString;
|
|
182
|
-
|
|
183
|
-
var getDateDisplayString = function getDateDisplayString(value, format) {
|
|
156
|
+
export var getDateDisplayString = function getDateDisplayString(value, format) {
|
|
184
157
|
var formattedValue = '';
|
|
185
158
|
|
|
186
159
|
if (!value) {
|
|
@@ -188,22 +161,23 @@ var getDateDisplayString = function getDateDisplayString(value, format) {
|
|
|
188
161
|
return formattedValue;
|
|
189
162
|
}
|
|
190
163
|
|
|
191
|
-
var date = (
|
|
164
|
+
var date = moment(value);
|
|
192
165
|
if (!date.isValid()) return value;
|
|
193
166
|
|
|
194
167
|
switch (format) {
|
|
195
168
|
case 'D/M/YYYY':
|
|
196
169
|
case 'DD/MM/YYYY':
|
|
170
|
+
// no-case-declarations
|
|
197
171
|
var formatValue = date.format('YYYY-MM-DD');
|
|
198
172
|
var formatValueList = formatValue.split('-');
|
|
199
|
-
return formatValueList[2]
|
|
173
|
+
return "".concat(formatValueList[2], "/").concat(formatValueList[1], "/").concat(formatValueList[0]);
|
|
200
174
|
|
|
201
175
|
case 'D/M/YYYY HH:mm':
|
|
202
176
|
case 'DD/MM/YYYY HH:mm':
|
|
203
177
|
var formatValues = date.format('YYYY-MM-DD HH:mm');
|
|
204
178
|
var formatValuesList = formatValues.split(' ');
|
|
205
179
|
var formatDateList = formatValuesList[0].split('-');
|
|
206
|
-
return formatDateList[2]
|
|
180
|
+
return "".concat(formatDateList[2], "/").concat(formatDateList[1], "/").concat(formatDateList[0], " ").concat(formatValuesList[1]);
|
|
207
181
|
|
|
208
182
|
case 'M/D/YYYY':
|
|
209
183
|
return date.format('M/D/YYYY');
|
|
@@ -221,21 +195,18 @@ var getDateDisplayString = function getDateDisplayString(value, format) {
|
|
|
221
195
|
return value;
|
|
222
196
|
}
|
|
223
197
|
};
|
|
224
|
-
|
|
225
|
-
exports.getDateDisplayString = getDateDisplayString;
|
|
226
|
-
|
|
227
|
-
var getDurationDisplayString = function getDurationDisplayString(value, duration_format) {
|
|
198
|
+
export var getDurationDisplayString = function getDurationDisplayString(value, duration_format) {
|
|
228
199
|
if (!value && value !== 0) return '';
|
|
229
|
-
duration_format = duration_format ||
|
|
200
|
+
duration_format = duration_format || DURATION_FORMATS_MAP.H_MM;
|
|
230
201
|
|
|
231
|
-
if (
|
|
202
|
+
if (DURATION_FORMATS.findIndex(function (format) {
|
|
232
203
|
return format.type === duration_format;
|
|
233
204
|
}) < 0) {
|
|
234
205
|
return '';
|
|
235
206
|
}
|
|
236
207
|
|
|
237
208
|
if (value === 0) {
|
|
238
|
-
return
|
|
209
|
+
return DURATION_ZERO_DISPLAY[duration_format];
|
|
239
210
|
}
|
|
240
211
|
|
|
241
212
|
var includeDecimal = duration_format.indexOf('.') > -1;
|
|
@@ -255,33 +226,31 @@ var getDurationDisplayString = function getDurationDisplayString(value, duration
|
|
|
255
226
|
decimal = decimal ? decimal - 0 : 0;
|
|
256
227
|
}
|
|
257
228
|
|
|
258
|
-
var decimalDigits =
|
|
229
|
+
var decimalDigits = DURATION_DECIMAL_DIGITS[duration_format];
|
|
259
230
|
var decimalSuffix = getDurationDecimalSuffix(duration_format, decimal);
|
|
260
231
|
var displayString = value < 0 ? '-' : '';
|
|
261
232
|
var hours = parseInt(positiveValue / 3600);
|
|
262
233
|
var minutes = parseInt((positiveValue - hours * 3600) / 60);
|
|
263
234
|
|
|
264
|
-
if (duration_format ===
|
|
265
|
-
displayString += hours
|
|
235
|
+
if (duration_format === DURATION_FORMATS_MAP.H_MM) {
|
|
236
|
+
displayString += "".concat(hours, ":").concat(minutes > 9 ? minutes : '0' + minutes);
|
|
266
237
|
return displayString;
|
|
267
238
|
}
|
|
268
239
|
|
|
269
240
|
var seconds = Number.parseFloat((positiveValue - hours * 3600 - minutes * 60).toFixed(decimalDigits));
|
|
270
241
|
|
|
271
242
|
if (hours > 0) {
|
|
272
|
-
displayString += hours
|
|
273
|
-
minutes = minutes > 9 ? minutes : "0"
|
|
243
|
+
displayString += "".concat(hours, ":");
|
|
244
|
+
minutes = minutes > 9 ? minutes : "0".concat(minutes);
|
|
274
245
|
}
|
|
275
246
|
|
|
276
|
-
seconds = seconds > 9 ? seconds : "0"
|
|
277
|
-
displayString += minutes
|
|
247
|
+
seconds = seconds > 9 ? seconds : "0".concat(seconds);
|
|
248
|
+
displayString += "".concat(minutes, ":").concat(seconds).concat(decimalSuffix);
|
|
278
249
|
return displayString;
|
|
279
250
|
};
|
|
280
251
|
|
|
281
|
-
exports.getDurationDisplayString = getDurationDisplayString;
|
|
282
|
-
|
|
283
252
|
var getMathRoundedDuration = function getMathRoundedDuration(num, duration_format) {
|
|
284
|
-
var decimalDigits =
|
|
253
|
+
var decimalDigits = DURATION_DECIMAL_DIGITS[duration_format];
|
|
285
254
|
|
|
286
255
|
if (decimalDigits < 1) {
|
|
287
256
|
return num;
|
|
@@ -292,15 +261,15 @@ var getMathRoundedDuration = function getMathRoundedDuration(num, duration_forma
|
|
|
292
261
|
};
|
|
293
262
|
|
|
294
263
|
var getDurationDecimalSuffix = function getDurationDecimalSuffix(duration_format, decimal) {
|
|
295
|
-
if (duration_format ===
|
|
264
|
+
if (duration_format === DURATION_FORMATS_MAP.H_MM_SS_S) {
|
|
296
265
|
return decimal === 0 ? '.0' : '';
|
|
297
|
-
} else if (duration_format ===
|
|
266
|
+
} else if (duration_format === DURATION_FORMATS_MAP.H_MM_SS_SS) {
|
|
298
267
|
if (decimal === 0) {
|
|
299
268
|
return '.00';
|
|
300
269
|
} else if (decimal < 10) {
|
|
301
270
|
return '0';
|
|
302
271
|
}
|
|
303
|
-
} else if (duration_format ===
|
|
272
|
+
} else if (duration_format === DURATION_FORMATS_MAP.H_MM_SS_SSS) {
|
|
304
273
|
if (decimal === 0) {
|
|
305
274
|
return '.000';
|
|
306
275
|
} else if (decimal < 10) {
|
|
@@ -313,17 +282,14 @@ var getDurationDecimalSuffix = function getDurationDecimalSuffix(duration_format
|
|
|
313
282
|
return '';
|
|
314
283
|
};
|
|
315
284
|
|
|
316
|
-
var getOptionName = function getOptionName(options, targetOptionID) {
|
|
285
|
+
export var getOptionName = function getOptionName(options, targetOptionID) {
|
|
317
286
|
if (!targetOptionID || !options || !Array.isArray(options)) return null;
|
|
318
287
|
var option = options.find(function (option) {
|
|
319
288
|
return option.id === targetOptionID;
|
|
320
289
|
});
|
|
321
290
|
return option ? option.name : null;
|
|
322
291
|
};
|
|
323
|
-
|
|
324
|
-
exports.getOptionName = getOptionName;
|
|
325
|
-
|
|
326
|
-
var getMultipleOptionName = function getMultipleOptionName(options, cellVal) {
|
|
292
|
+
export var getMultipleOptionName = function getMultipleOptionName(options, cellVal) {
|
|
327
293
|
if (!cellVal || !options || !Array.isArray(options)) return null;
|
|
328
294
|
var selectedOptions = options.filter(function (option) {
|
|
329
295
|
return cellVal.includes(option.id);
|
|
@@ -333,10 +299,7 @@ var getMultipleOptionName = function getMultipleOptionName(options, cellVal) {
|
|
|
333
299
|
return option.name;
|
|
334
300
|
}).join(', ');
|
|
335
301
|
};
|
|
336
|
-
|
|
337
|
-
exports.getMultipleOptionName = getMultipleOptionName;
|
|
338
|
-
|
|
339
|
-
var getLongtextDisplayString = function getLongtextDisplayString(value) {
|
|
302
|
+
export var getLongtextDisplayString = function getLongtextDisplayString(value) {
|
|
340
303
|
var _ref3 = value || {},
|
|
341
304
|
text = _ref3.text;
|
|
342
305
|
|
|
@@ -346,10 +309,7 @@ var getLongtextDisplayString = function getLongtextDisplayString(value) {
|
|
|
346
309
|
|
|
347
310
|
return text;
|
|
348
311
|
};
|
|
349
|
-
|
|
350
|
-
exports.getLongtextDisplayString = getLongtextDisplayString;
|
|
351
|
-
|
|
352
|
-
var getCollaboratorsName = function getCollaboratorsName(collaborators, cellVal) {
|
|
312
|
+
export var getCollaboratorsName = function getCollaboratorsName(collaborators, cellVal) {
|
|
353
313
|
if (cellVal) {
|
|
354
314
|
var collaboratorsName = [];
|
|
355
315
|
cellVal.forEach(function (v) {
|
|
@@ -371,10 +331,7 @@ var getCollaboratorsName = function getCollaboratorsName(collaborators, cellVal)
|
|
|
371
331
|
|
|
372
332
|
return null;
|
|
373
333
|
};
|
|
374
|
-
|
|
375
|
-
exports.getCollaboratorsName = getCollaboratorsName;
|
|
376
|
-
|
|
377
|
-
var getGeolocationDisplayString = function getGeolocationDisplayString(value, columnData) {
|
|
334
|
+
export var getGeolocationDisplayString = function getGeolocationDisplayString(value, columnData) {
|
|
378
335
|
var _ref4 = columnData || {},
|
|
379
336
|
geo_format = _ref4.geo_format;
|
|
380
337
|
|
|
@@ -385,7 +342,7 @@ var getGeolocationDisplayString = function getGeolocationDisplayString(value, co
|
|
|
385
342
|
}
|
|
386
343
|
|
|
387
344
|
if (geo_format === 'lng_lat' && value.lng && value.lat) {
|
|
388
|
-
return cellValue.lng
|
|
345
|
+
return "".concat(cellValue.lng, ", ").concat(cellValue.lat);
|
|
389
346
|
}
|
|
390
347
|
|
|
391
348
|
if (geo_format === 'country_region' && cellValue.country_region) {
|
|
@@ -398,20 +355,17 @@ var getGeolocationDisplayString = function getGeolocationDisplayString(value, co
|
|
|
398
355
|
detail = cellValue.detail;
|
|
399
356
|
|
|
400
357
|
if (geo_format === 'province') {
|
|
401
|
-
return ""
|
|
358
|
+
return "".concat(province || '');
|
|
402
359
|
}
|
|
403
360
|
|
|
404
361
|
if (geo_format === 'province_city') {
|
|
405
|
-
return ""
|
|
362
|
+
return "".concat(province || '').concat(city || '');
|
|
406
363
|
}
|
|
407
364
|
|
|
408
|
-
return ""
|
|
365
|
+
return "".concat(province || '').concat(city || '').concat(district || '').concat(detail || '');
|
|
409
366
|
};
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
var getFormulaDisplayString = function getFormulaDisplayString(cellValue, columnData, _temp) {
|
|
414
|
-
var _ref5 = _temp === void 0 ? {} : _temp,
|
|
367
|
+
export var getFormulaDisplayString = function getFormulaDisplayString(cellValue, columnData) {
|
|
368
|
+
var _ref5 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
415
369
|
_ref5$collaborators = _ref5.collaborators,
|
|
416
370
|
collaborators = _ref5$collaborators === void 0 ? [] : _ref5$collaborators;
|
|
417
371
|
|
|
@@ -421,16 +375,16 @@ var getFormulaDisplayString = function getFormulaDisplayString(cellValue, column
|
|
|
421
375
|
|
|
422
376
|
var result_type = columnData.result_type;
|
|
423
377
|
|
|
424
|
-
if (result_type ===
|
|
378
|
+
if (result_type === FORMULA_RESULT_TYPE.NUMBER) {
|
|
425
379
|
return getNumberDisplayString(cellValue, columnData);
|
|
426
380
|
}
|
|
427
381
|
|
|
428
|
-
if (result_type ===
|
|
382
|
+
if (result_type === FORMULA_RESULT_TYPE.DATE) {
|
|
429
383
|
var format = columnData.format;
|
|
430
384
|
return getDateDisplayString(cellValue, format);
|
|
431
385
|
}
|
|
432
386
|
|
|
433
|
-
if (result_type ===
|
|
387
|
+
if (result_type === FORMULA_RESULT_TYPE.ARRAY) {
|
|
434
388
|
var array_type = columnData.array_type,
|
|
435
389
|
array_data = columnData.array_data;
|
|
436
390
|
|
|
@@ -438,11 +392,11 @@ var getFormulaDisplayString = function getFormulaDisplayString(cellValue, column
|
|
|
438
392
|
return null;
|
|
439
393
|
}
|
|
440
394
|
|
|
441
|
-
if (
|
|
395
|
+
if (COLLABORATOR_COLUMN_TYPES.includes(array_type)) {
|
|
442
396
|
return cellValue;
|
|
443
397
|
}
|
|
444
398
|
|
|
445
|
-
if (
|
|
399
|
+
if (ARRAY_FORMAL_COLUMNS_TYPES.indexOf(array_type) < 0 && Array.isArray(cellValue)) {
|
|
446
400
|
return cellValue.map(function (val) {
|
|
447
401
|
return getCellValueDisplayString(val, array_type, {
|
|
448
402
|
data: array_data,
|
|
@@ -463,11 +417,8 @@ var getFormulaDisplayString = function getFormulaDisplayString(cellValue, column
|
|
|
463
417
|
|
|
464
418
|
return cellValue;
|
|
465
419
|
};
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
function getCellValueDisplayString(cellValue, type, _temp2) {
|
|
470
|
-
var _ref6 = _temp2 === void 0 ? {} : _temp2,
|
|
420
|
+
export function getCellValueDisplayString(cellValue, type) {
|
|
421
|
+
var _ref6 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
471
422
|
data = _ref6.data,
|
|
472
423
|
_ref6$collaborators = _ref6.collaborators,
|
|
473
424
|
collaborators = _ref6$collaborators === void 0 ? [] : _ref6$collaborators;
|
|
@@ -516,7 +467,7 @@ function getCellValueDisplayString(cellValue, type, _temp2) {
|
|
|
516
467
|
{
|
|
517
468
|
var _ref7 = newData || {},
|
|
518
469
|
_ref7$format = _ref7.format,
|
|
519
|
-
format = _ref7$format === void 0 ?
|
|
470
|
+
format = _ref7$format === void 0 ? DEFAULT_DATE_FORMAT : _ref7$format;
|
|
520
471
|
|
|
521
472
|
return getDateDisplayString(cellValue, format);
|
|
522
473
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-ui-component",
|
|
3
|
-
"version": "0.1.
|
|
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=
|
|
49
|
-
"pub:lib": "npm run clean:lib && export BABEL_ENV=
|
|
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
|
|
52
|
-
"prepublishOnly": "npm run pub:
|
|
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;
|
|
Binary file
|
|
@@ -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,25 +0,0 @@
|
|
|
1
|
-
export var DEFAULT = 'default';
|
|
2
|
-
export var NUMBER = 'number';
|
|
3
|
-
export var TEXT = 'text';
|
|
4
|
-
export var CHECKBOX = 'checkbox';
|
|
5
|
-
export var DATE = 'date';
|
|
6
|
-
export var SINGLE_SELECT = 'single-select';
|
|
7
|
-
export var LONG_TEXT = 'long-text';
|
|
8
|
-
export var IMAGE = 'image';
|
|
9
|
-
export var FILE = 'file';
|
|
10
|
-
export var MULTIPLE_SELECT = 'multiple-select';
|
|
11
|
-
export var COLLABORATOR = 'collaborator';
|
|
12
|
-
export var LINK = 'link';
|
|
13
|
-
export var FORMULA = 'formula';
|
|
14
|
-
export var LINK_FORMULA = 'link-formula';
|
|
15
|
-
export var CREATOR = 'creator';
|
|
16
|
-
export var CTIME = 'ctime';
|
|
17
|
-
export var LAST_MODIFIER = 'last-modifier';
|
|
18
|
-
export var MTIME = 'mtime';
|
|
19
|
-
export var GEOLOCATION = 'geolocation';
|
|
20
|
-
export var AUTO_NUMBER = 'auto-number';
|
|
21
|
-
export var URL = 'url';
|
|
22
|
-
export var EMAIL = 'email';
|
|
23
|
-
export var DURATION = 'duration';
|
|
24
|
-
export var RATE = 'rate';
|
|
25
|
-
export var BUTTON = 'button';
|