dtable-ui-component 0.1.75-beta1 → 0.1.75-beta5
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/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/lib/CheckboxFormatter/index.css +1 -0
- package/{es/components/cell-formatter/checkbox-formatter.js → lib/CheckboxFormatter/index.js} +1 -0
- 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/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/lib/EmailFormatter/index.css +5 -0
- package/{es/components/cell-formatter/email-formatter.js → lib/EmailFormatter/index.js} +1 -0
- package/lib/FileFormatter/index.css +29 -0
- package/{es/components/cell-formatter/file-formatter.js → lib/FileFormatter/index.js} +2 -1
- package/{es/components/cell-formatter/widgets/file-item-formatter.js → lib/FileItemFormatter/index.js} +3 -2
- package/{es/components/file-uploader → lib/FileUploader}/index.js +0 -0
- package/lib/FormulaFormatter/index.css +19 -0
- package/{es/components/cell-formatter/formula-formatter.js → lib/FormulaFormatter/index.js} +8 -8
- package/lib/GeolocationFormatter/index.css +1 -0
- package/{es/components/cell-formatter/geolocation-formatter.js → lib/GeolocationFormatter/index.js} +2 -1
- 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/{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/LastModifierFormatter/index.css +1 -0
- package/{es/components/cell-formatter/last-modifier-formatter.js → lib/LastModifierFormatter/index.js} +5 -4
- 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/widgets/long-text-formatter → lib/LongTextFormatter}/html-long-text-formatter.js +1 -1
- package/lib/LongTextFormatter/index.css +63 -0
- package/{es/components/cell-formatter/long-text-formatter.js → lib/LongTextFormatter/index.js} +3 -2
- package/{es/components/cell-formatter/widgets/long-text-formatter → lib/LongTextFormatter}/simple-long-text-formatter.js +1 -1
- 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/MultipleSelectFormatter/index.css +1 -0
- package/{es/components/cell-formatter/multiple-select-formatter.js → lib/MultipleSelectFormatter/index.js} +2 -1
- 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/SingleSelectFormatter/index.css +1 -0
- package/{es/components/cell-formatter/single-select-formatter.js → lib/SingleSelectFormatter/index.js} +2 -1
- 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/lib/app.js +75 -80
- package/{es/components/cell-factory/cell-formatter-factory.js → lib/cellFormatterFactory/index.js} +3 -3
- package/lib/components/cell-editor/checkbox-editor.js +59 -66
- package/lib/components/cell-editor/collaborator-editor.js +113 -126
- package/lib/components/cell-editor/date-editor.js +99 -119
- package/lib/components/cell-editor/index.js +9 -40
- package/lib/components/cell-editor/link-editor.js +122 -140
- package/lib/components/cell-editor/multiple-select-editor.js +114 -127
- package/lib/components/cell-editor/number-editor.js +78 -86
- package/lib/components/cell-editor/single-select-editor.js +106 -120
- package/lib/components/cell-editor/text-editor.js +65 -72
- package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +31 -51
- 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 +105 -111
- package/lib/components/cell-editor-popover/mb-date-editor-popover.js +140 -157
- package/lib/components/cell-editor-popover/mb-link-editor-popover.js +103 -109
- package/lib/components/cell-editor-popover/mb-select-editor-popover.js +142 -155
- package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +74 -89
- package/lib/components/cell-editor-popover/pc-date-editor-popover.js +88 -102
- package/lib/components/cell-editor-popover/pc-link-editor-popover.js +77 -91
- package/lib/components/cell-editor-popover/pc-select-editor-popover.js +91 -105
- package/lib/components/common/collaborator-item.js +43 -59
- package/lib/components/common/edit-editor-button.js +28 -39
- package/lib/components/common/link-editor-option.js +63 -71
- package/lib/components/common/mobile/mb-editor-header.js +39 -52
- package/lib/components/common/select-editor-option.js +58 -74
- package/lib/constants/cell-types.js +25 -54
- package/lib/constants/index.js +5 -26
- package/lib/css/cell-formatter.css +0 -243
- package/lib/formatterConfig/index.js +31 -0
- package/lib/index.js +31 -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/{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/cell-value-validator.js +4 -14
- package/lib/utils/column-utils.js +5 -13
- package/lib/utils/editor-utils.js +3 -13
- package/lib/utils/markdown2html.js +1 -7
- package/lib/utils/normalize-long-text-value.js +1 -6
- package/lib/utils/number-precision.js +14 -31
- package/lib/utils/utils.js +8 -33
- package/lib/utils/value-format-utils.js +60 -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/assets/images/file/192/excel.png +0 -0
- package/es/assets/images/file/192/file.png +0 -0
- package/es/assets/images/file/192/music.png +0 -0
- package/es/assets/images/file/192/pdf.png +0 -0
- package/es/assets/images/file/192/pic.png +0 -0
- package/es/assets/images/file/192/ppt.png +0 -0
- package/es/assets/images/file/192/txt.png +0 -0
- package/es/assets/images/file/192/video.png +0 -0
- package/es/assets/images/file/192/word.png +0 -0
- package/es/assets/images/file/24/excel.png +0 -0
- package/es/assets/images/file/24/file.png +0 -0
- package/es/assets/images/file/24/music.png +0 -0
- package/es/assets/images/file/24/pdf.png +0 -0
- package/es/assets/images/file/24/pic.png +0 -0
- package/es/assets/images/file/24/ppt.png +0 -0
- package/es/assets/images/file/24/txt.png +0 -0
- package/es/assets/images/file/24/video.png +0 -0
- package/es/assets/images/file/24/word.png +0 -0
- package/es/assets/images/folder/folder-192.png +0 -0
- package/es/assets/images/folder/folder-24.png +0 -0
- package/es/components/cell-editor/checkbox-editor.js +0 -104
- package/es/components/cell-editor/collaborator-editor.js +0 -236
- package/es/components/cell-editor/date-editor.js +0 -151
- package/es/components/cell-editor/index.js +0 -9
- package/es/components/cell-editor/link-editor.js +0 -303
- package/es/components/cell-editor/multiple-select-editor.js +0 -237
- package/es/components/cell-editor/number-editor.js +0 -154
- package/es/components/cell-editor/single-select-editor.js +0 -202
- package/es/components/cell-editor/text-editor.js +0 -122
- package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +0 -46
- package/es/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
- package/es/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
- package/es/components/cell-editor-popover/mb-collaborator-editor-popover.js +0 -177
- package/es/components/cell-editor-popover/mb-date-editor-popover.js +0 -245
- package/es/components/cell-editor-popover/mb-link-editor-popover.js +0 -170
- package/es/components/cell-editor-popover/mb-select-editor-popover.js +0 -230
- package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +0 -109
- package/es/components/cell-editor-popover/pc-date-editor-popover.js +0 -142
- package/es/components/cell-editor-popover/pc-link-editor-popover.js +0 -114
- package/es/components/cell-editor-popover/pc-select-editor-popover.js +0 -143
- package/es/components/cell-formatter/formatter-config.js +0 -31
- package/es/components/cell-formatter/index.js +0 -27
- package/es/components/common/edit-editor-button.js +0 -56
- package/es/components/common/link-editor-option.js +0 -113
- package/es/components/common/mobile/mb-editor-header.js +0 -48
- package/es/components/common/select-editor-option.js +0 -106
- 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/css/custom-rc-calendar.css +0 -118
- 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/cell-value-validator.js +0 -32
- package/es/utils/column-utils.js +0 -7
- package/es/utils/editor-utils.js +0 -71
- package/es/utils/markdown2html.js +0 -62
- package/es/utils/normalize-long-text-value.js +0 -69
- package/es/utils/number-precision.js +0 -163
- package/es/utils/unified/index.js +0 -470
- package/es/utils/utils.js +0 -116
- package/es/utils/value-format-utils.js +0 -495
- package/es/utils/vfile/core.js +0 -172
- package/es/utils/vfile/index.js +0 -48
- 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/images-lazy-load.js +0 -158
- package/lib/components/common/modal-portal.js +0 -51
- 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/image-previewer-ligntbox.css +0 -87
- package/lib/css/loading.css +0 -54
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
|
|
3
|
+
var _FormatterConfig;
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { CellType } from '../constants';
|
|
7
|
+
import CheckboxFormatter from '../CheckboxFormatter';
|
|
8
|
+
import ImageFormatter from '../ImageFormatter';
|
|
9
|
+
import LongTextFormatter from '../LongTextFormatter';
|
|
10
|
+
import TextCellFormatter from '../TextFormatter';
|
|
11
|
+
import SingleSelectFormatter from '../SingleSelectFormatter';
|
|
12
|
+
import MultipleSelectFormatter from '../MultipleSelectFormatter';
|
|
13
|
+
import FileFormatter from '../FileFormatter';
|
|
14
|
+
import LinkFormatter from '../LinkFormatter';
|
|
15
|
+
import CollaboratorFormatter from '../CollaboratorFormatter';
|
|
16
|
+
import NumberFormatter from '../NumberFormatter';
|
|
17
|
+
import DateFormatter from '../DateFormatter';
|
|
18
|
+
import CreatorFormatter from '../CreatorFormatter';
|
|
19
|
+
import CTimeFormatter from '../CTimeFormatter';
|
|
20
|
+
import LastModifierFormatter from '../LastModifierFormatter';
|
|
21
|
+
import MTimeFormatter from '../MTimeFormatter';
|
|
22
|
+
import GeolocationFormatter from '../GeolocationFormatter';
|
|
23
|
+
import FormulaFormatter from '../FormulaFormatter';
|
|
24
|
+
import AutoNumberFormatter from '../AutoNumberFormatter';
|
|
25
|
+
import UrlFormatter from '../UrlFormatter';
|
|
26
|
+
import EmailFormatter from '../EmailFormatter';
|
|
27
|
+
import DurationFormatter from '../DurationFormatter';
|
|
28
|
+
import RateFormatter from '../RateFormatter';
|
|
29
|
+
import ButtonFormatter from '../ButtonFormatter';
|
|
30
|
+
var FormatterConfig = (_FormatterConfig = {}, _defineProperty(_FormatterConfig, CellType.DEFAULT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_FormatterConfig, CellType.TEXT, /*#__PURE__*/React.createElement(TextCellFormatter, null)), _defineProperty(_FormatterConfig, CellType.CHECKBOX, /*#__PURE__*/React.createElement(CheckboxFormatter, null)), _defineProperty(_FormatterConfig, CellType.LONG_TEXT, /*#__PURE__*/React.createElement(LongTextFormatter, null)), _defineProperty(_FormatterConfig, CellType.SINGLE_SELECT, /*#__PURE__*/React.createElement(SingleSelectFormatter, null)), _defineProperty(_FormatterConfig, CellType.IMAGE, /*#__PURE__*/React.createElement(ImageFormatter, null)), _defineProperty(_FormatterConfig, CellType.FILE, /*#__PURE__*/React.createElement(FileFormatter, null)), _defineProperty(_FormatterConfig, CellType.MULTIPLE_SELECT, /*#__PURE__*/React.createElement(MultipleSelectFormatter, null)), _defineProperty(_FormatterConfig, CellType.COLLABORATOR, /*#__PURE__*/React.createElement(CollaboratorFormatter, null)), _defineProperty(_FormatterConfig, CellType.NUMBER, /*#__PURE__*/React.createElement(NumberFormatter, null)), _defineProperty(_FormatterConfig, CellType.DATE, /*#__PURE__*/React.createElement(DateFormatter, null)), _defineProperty(_FormatterConfig, CellType.LINK, /*#__PURE__*/React.createElement(LinkFormatter, null)), _defineProperty(_FormatterConfig, CellType.CREATOR, /*#__PURE__*/React.createElement(CreatorFormatter, null)), _defineProperty(_FormatterConfig, CellType.CTIME, /*#__PURE__*/React.createElement(CTimeFormatter, null)), _defineProperty(_FormatterConfig, CellType.LAST_MODIFIER, /*#__PURE__*/React.createElement(LastModifierFormatter, null)), _defineProperty(_FormatterConfig, CellType.MTIME, /*#__PURE__*/React.createElement(MTimeFormatter, null)), _defineProperty(_FormatterConfig, CellType.GEOLOCATION, /*#__PURE__*/React.createElement(GeolocationFormatter, null)), _defineProperty(_FormatterConfig, CellType.FORMULA, /*#__PURE__*/React.createElement(FormulaFormatter, null)), _defineProperty(_FormatterConfig, CellType.AUTO_NUMBER, /*#__PURE__*/React.createElement(AutoNumberFormatter, null)), _defineProperty(_FormatterConfig, CellType.URL, /*#__PURE__*/React.createElement(UrlFormatter, null)), _defineProperty(_FormatterConfig, CellType.EMAIL, /*#__PURE__*/React.createElement(EmailFormatter, null)), _defineProperty(_FormatterConfig, CellType.DURATION, /*#__PURE__*/React.createElement(DurationFormatter, null)), _defineProperty(_FormatterConfig, CellType.RATE, /*#__PURE__*/React.createElement(RateFormatter, null)), _defineProperty(_FormatterConfig, CellType.BUTTON, /*#__PURE__*/React.createElement(ButtonFormatter, null)), _FormatterConfig);
|
|
31
|
+
export default FormatterConfig;
|
package/lib/index.js
CHANGED
|
@@ -1,64 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exports.DateFormatter = _cellFormatter.DateFormatter;
|
|
33
|
-
exports.SingleSelectFormatter = _cellFormatter.SingleSelectFormatter;
|
|
34
|
-
exports.MultipleSelectFormatter = _cellFormatter.MultipleSelectFormatter;
|
|
35
|
-
exports.CollaboratorFormatter = _cellFormatter.CollaboratorFormatter;
|
|
36
|
-
exports.ImageFormatter = _cellFormatter.ImageFormatter;
|
|
37
|
-
exports.FileFormatter = _cellFormatter.FileFormatter;
|
|
38
|
-
exports.LongTextFormatter = _cellFormatter.LongTextFormatter;
|
|
39
|
-
exports.GeolocationFormatter = _cellFormatter.GeolocationFormatter;
|
|
40
|
-
exports.LinkFormatter = _cellFormatter.LinkFormatter;
|
|
41
|
-
exports.FormulaFormatter = _cellFormatter.FormulaFormatter;
|
|
42
|
-
exports.CTimeFormatter = _cellFormatter.CTimeFormatter;
|
|
43
|
-
exports.CreatorFormatter = _cellFormatter.CreatorFormatter;
|
|
44
|
-
exports.LastModifierFormatter = _cellFormatter.LastModifierFormatter;
|
|
45
|
-
exports.MTimeFormatter = _cellFormatter.MTimeFormatter;
|
|
46
|
-
exports.AutoNumberFormatter = _cellFormatter.AutoNumberFormatter;
|
|
47
|
-
exports.UrlFormatter = _cellFormatter.UrlFormatter;
|
|
48
|
-
exports.EmailFormatter = _cellFormatter.EmailFormatter;
|
|
49
|
-
exports.DurationFormatter = _cellFormatter.DurationFormatter;
|
|
50
|
-
exports.RateFormatter = _cellFormatter.RateFormatter;
|
|
51
|
-
exports.ButtonFormatter = _cellFormatter.ButtonFormatter;
|
|
52
|
-
exports.FileItemFormatter = _cellFormatter.FileItemFormatter;
|
|
53
|
-
exports.ImagePreviewerLightbox = _cellFormatter.ImagePreviewerLightbox;
|
|
54
|
-
exports.CollaboratorItem = _cellFormatter.CollaboratorItem;
|
|
55
|
-
|
|
56
|
-
var _cellEditor = require("./components/cell-editor");
|
|
57
|
-
|
|
58
|
-
exports.TextEditor = _cellEditor.TextEditor;
|
|
59
|
-
exports.NumberEditor = _cellEditor.NumberEditor;
|
|
60
|
-
exports.CheckboxEditor = _cellEditor.CheckboxEditor;
|
|
61
|
-
exports.SingleSelectEditor = _cellEditor.SingleSelectEditor;
|
|
62
|
-
exports.CollaboratorEditor = _cellEditor.CollaboratorEditor;
|
|
63
|
-
exports.DateEditor = _cellEditor.DateEditor;
|
|
64
|
-
exports.LinkEditor = _cellEditor.LinkEditor;
|
|
1
|
+
export { default as toaster } from './toaster';
|
|
2
|
+
export { setLocale } from './lang';
|
|
3
|
+
export { getDateDisplayString, getNumberDisplayString, formatStringToNumber, formatNumberString } from './utils/value-format-utils';
|
|
4
|
+
export { default as CheckboxFormatter } from './CheckboxFormatter';
|
|
5
|
+
export { default as ImageFormatter } from './ImageFormatter';
|
|
6
|
+
export { default as LongTextFormatter } from './LongTextFormatter';
|
|
7
|
+
export { default as TextFormatter } from './TextFormatter';
|
|
8
|
+
export { default as SingleSelectFormatter } from './SingleSelectFormatter';
|
|
9
|
+
export { default as MultipleSelectFormatter } from './MultipleSelectFormatter';
|
|
10
|
+
export { default as FileFormatter } from './FileFormatter';
|
|
11
|
+
export { default as LinkFormatter } from './LinkFormatter';
|
|
12
|
+
export { default as CollaboratorFormatter } from './CollaboratorFormatter';
|
|
13
|
+
export { default as NumberFormatter } from './NumberFormatter';
|
|
14
|
+
export { default as DateFormatter } from './DateFormatter';
|
|
15
|
+
export { default as CreatorFormatter } from './CreatorFormatter';
|
|
16
|
+
export { default as CTimeFormatter } from './CTimeFormatter';
|
|
17
|
+
export { default as LastModifierFormatter } from './LastModifierFormatter';
|
|
18
|
+
export { default as MTimeFormatter } from './MTimeFormatter';
|
|
19
|
+
export { default as GeolocationFormatter } from './GeolocationFormatter';
|
|
20
|
+
export { default as FormulaFormatter } from './FormulaFormatter';
|
|
21
|
+
export { default as AutoNumberFormatter } from './AutoNumberFormatter';
|
|
22
|
+
export { default as UrlFormatter } from './UrlFormatter';
|
|
23
|
+
export { default as EmailFormatter } from './EmailFormatter';
|
|
24
|
+
export { default as DurationFormatter } from './DurationFormatter';
|
|
25
|
+
export { default as RateFormatter } from './RateFormatter';
|
|
26
|
+
export { default as ButtonFormatter } from './ButtonFormatter';
|
|
27
|
+
export { default as ImagePreviewerLightbox } from './ImagePreviewerLightbox';
|
|
28
|
+
export { default as CollaboratorItem } from './CollaboratorItem';
|
|
29
|
+
export { default as FileItemFormatter } from './FileItemFormatter';
|
|
30
|
+
export { default as Loading } from './Loading';
|
|
31
|
+
export { TextEditor, NumberEditor, CheckboxEditor, SingleSelectEditor, CollaboratorEditor, DateEditor, LinkEditor } from './components/cell-editor';
|
package/lib/lang/index.js
CHANGED
|
@@ -1,35 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.getLocale = getLocale;
|
|
7
|
-
exports.setLocale = setLocale;
|
|
8
|
-
exports.substitute = substitute;
|
|
9
|
-
|
|
10
|
-
var _de = _interopRequireDefault(require("../locals/de"));
|
|
11
|
-
|
|
12
|
-
var _en = _interopRequireDefault(require("../locals/en"));
|
|
13
|
-
|
|
14
|
-
var _fr = _interopRequireDefault(require("../locals/fr"));
|
|
15
|
-
|
|
16
|
-
var _zhCN = _interopRequireDefault(require("../locals/zh-CN"));
|
|
17
|
-
|
|
1
|
+
import de from '../locals/de';
|
|
2
|
+
import en from '../locals/en';
|
|
3
|
+
import fr from '../locals/fr';
|
|
4
|
+
import zh_CN from '../locals/zh-CN';
|
|
18
5
|
var langData = {
|
|
19
|
-
'de':
|
|
20
|
-
'en':
|
|
21
|
-
'fr':
|
|
22
|
-
'zh-cn':
|
|
6
|
+
'de': de,
|
|
7
|
+
'en': en,
|
|
8
|
+
'fr': fr,
|
|
9
|
+
'zh-cn': zh_CN
|
|
23
10
|
};
|
|
24
11
|
var LANGUAGE = 'en';
|
|
25
12
|
var LANGUAGE_MAP = {};
|
|
26
|
-
|
|
27
|
-
function setLocale(args) {
|
|
13
|
+
export function setLocale(args) {
|
|
28
14
|
var lang = typeof args === 'string' ? args : LANGUAGE;
|
|
29
15
|
LANGUAGE_MAP = langData[lang] || langData[LANGUAGE];
|
|
30
16
|
}
|
|
31
|
-
|
|
32
|
-
function getLocale(key, def) {
|
|
17
|
+
export function getLocale(key, def) {
|
|
33
18
|
if (!key) return def;
|
|
34
19
|
|
|
35
20
|
if (!LANGUAGE_MAP[key]) {
|
|
@@ -38,8 +23,7 @@ function getLocale(key, def) {
|
|
|
38
23
|
|
|
39
24
|
return LANGUAGE_MAP[key];
|
|
40
25
|
}
|
|
41
|
-
|
|
42
|
-
function substitute(str, obj) {
|
|
26
|
+
export function substitute(str, obj) {
|
|
43
27
|
if (typeof str === 'string') {
|
|
44
28
|
if (str.indexOf('{') < 0) {
|
|
45
29
|
return str;
|
package/lib/locals/de.js
CHANGED
package/lib/locals/en.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = void 0;
|
|
5
1
|
var en = {
|
|
6
2
|
Add_an_option: "Add an option",
|
|
7
3
|
Find_an_option: "Find a option",
|
|
@@ -18,5 +14,4 @@ var en = {
|
|
|
18
14
|
Please_select: "Please select",
|
|
19
15
|
Clear: "Clear"
|
|
20
16
|
};
|
|
21
|
-
|
|
22
|
-
exports.default = _default;
|
|
17
|
+
export default en;
|
package/lib/locals/fr.js
CHANGED
package/lib/locals/zh-CN.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = void 0;
|
|
5
1
|
var zh_CN = {
|
|
6
2
|
Add_an_option: '添加一个选项',
|
|
7
3
|
Find_an_option: "查找标签",
|
|
@@ -18,5 +14,4 @@ var zh_CN = {
|
|
|
18
14
|
Please_select: "请选择",
|
|
19
15
|
Clear: "清空"
|
|
20
16
|
};
|
|
21
|
-
|
|
22
|
-
exports.default = _default;
|
|
17
|
+
export default zh_CN;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = void 0;
|
|
5
|
-
|
|
6
|
-
var CellType = _interopRequireWildcard(require("../constants/cell-types"));
|
|
7
|
-
|
|
8
|
-
var _constants = require("../constants");
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
2
|
|
|
10
3
|
var _validators;
|
|
11
4
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
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; }
|
|
5
|
+
import { FORMULA_RESULT_TYPE, CellType } from '../constants';
|
|
15
6
|
|
|
16
7
|
var numberValidator = function numberValidator(value) {
|
|
17
8
|
return (value || value === 0) && Object.prototype.toString.call(value) === '[object Number]';
|
|
@@ -25,7 +16,7 @@ var checkboxValidator = function checkboxValidator(value) {
|
|
|
25
16
|
return typeof value === 'boolean';
|
|
26
17
|
};
|
|
27
18
|
|
|
28
|
-
var validators = (_validators = {}, _validators
|
|
19
|
+
var validators = (_validators = {}, _defineProperty(_validators, CellType.NUMBER, numberValidator), _defineProperty(_validators, CellType.RATE, numberValidator), _defineProperty(_validators, CellType.DURATION, numberValidator), _defineProperty(_validators, CellType.CHECKBOX, checkboxValidator), _defineProperty(_validators, CellType.TEXT, textValidator), _defineProperty(_validators, CellType.DATE, textValidator), _defineProperty(_validators, CellType.CTIME, textValidator), _defineProperty(_validators, CellType.MTIME, textValidator), _defineProperty(_validators, CellType.GEOLOCATION, textValidator), _defineProperty(_validators, CellType.AUTO_NUMBER, textValidator), _defineProperty(_validators, CellType.URL, textValidator), _defineProperty(_validators, CellType.EMAIL, textValidator), _defineProperty(_validators, FORMULA_RESULT_TYPE.DATE, textValidator), _defineProperty(_validators, FORMULA_RESULT_TYPE.STRING, textValidator), _defineProperty(_validators, FORMULA_RESULT_TYPE.NUMBER, numberValidator), _defineProperty(_validators, FORMULA_RESULT_TYPE.BOOL, checkboxValidator), _validators);
|
|
29
20
|
|
|
30
21
|
var cellValueValidator = function cellValueValidator(cellValue, type) {
|
|
31
22
|
var validator = validators[type];
|
|
@@ -37,5 +28,4 @@ var cellValueValidator = function cellValueValidator(cellValue, type) {
|
|
|
37
28
|
return true;
|
|
38
29
|
};
|
|
39
30
|
|
|
40
|
-
|
|
41
|
-
exports.default = _default;
|
|
31
|
+
export default cellValueValidator;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.isArrayFormalColumn = isArrayFormalColumn;
|
|
5
|
-
exports.isSimpleCellFormatter = isSimpleCellFormatter;
|
|
6
|
-
|
|
7
|
-
var _constants = require("../constants");
|
|
8
|
-
|
|
9
|
-
function isSimpleCellFormatter(type) {
|
|
10
|
-
return _constants.SIMPLE_CELL_COLUMNS.includes(type) || _constants.SIMPLE_CELL_FORMULA_RESULTS.includes(type);
|
|
1
|
+
import { ARRAY_FORMAL_COLUMNS, SIMPLE_CELL_COLUMNS, SIMPLE_CELL_FORMULA_RESULTS } from '../constants';
|
|
2
|
+
export function isSimpleCellFormatter(type) {
|
|
3
|
+
return SIMPLE_CELL_COLUMNS.includes(type) || SIMPLE_CELL_FORMULA_RESULTS.includes(type);
|
|
11
4
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return _constants.ARRAY_FORMAL_COLUMNS.includes(columnType);
|
|
5
|
+
export function isArrayFormalColumn(columnType) {
|
|
6
|
+
return ARRAY_FORMAL_COLUMNS.includes(columnType);
|
|
15
7
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.initDateEditorLanguage = exports.getSelectOptionItem = void 0;
|
|
5
|
-
|
|
6
1
|
var zhCN = require('@seafile/seafile-calendar/lib/locale/zh_CN');
|
|
7
2
|
|
|
8
3
|
var zhTW = require('@seafile/seafile-calendar/lib/locale/zh_TW');
|
|
@@ -19,7 +14,7 @@ var plPL = require('@seafile/seafile-calendar/lib/locale/pl_PL');
|
|
|
19
14
|
|
|
20
15
|
var csCZ = require('@seafile/seafile-calendar/lib/locale/cs_CZ');
|
|
21
16
|
|
|
22
|
-
var initDateEditorLanguage = function initDateEditorLanguage(lang) {
|
|
17
|
+
export var initDateEditorLanguage = function initDateEditorLanguage(lang) {
|
|
23
18
|
var language;
|
|
24
19
|
|
|
25
20
|
switch (lang) {
|
|
@@ -69,13 +64,8 @@ var initDateEditorLanguage = function initDateEditorLanguage(lang) {
|
|
|
69
64
|
|
|
70
65
|
return language;
|
|
71
66
|
};
|
|
72
|
-
|
|
73
|
-
exports.initDateEditorLanguage = initDateEditorLanguage;
|
|
74
|
-
|
|
75
|
-
var getSelectOptionItem = function getSelectOptionItem(options, optionId) {
|
|
67
|
+
export var getSelectOptionItem = function getSelectOptionItem(options, optionId) {
|
|
76
68
|
return options.find(function (option) {
|
|
77
69
|
return option.id === optionId;
|
|
78
70
|
});
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
exports.getSelectOptionItem = getSelectOptionItem;
|
|
71
|
+
};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.processorGetAST = exports.processor = void 0;
|
|
5
|
-
|
|
6
1
|
var unified = require('./unified');
|
|
7
2
|
|
|
8
3
|
var markdown = require('remark-parse');
|
|
@@ -61,8 +56,7 @@ var processor = unified().use(markdown, {
|
|
|
61
56
|
}).use(mathjax, {
|
|
62
57
|
displayMath: ['$$', '$$']
|
|
63
58
|
}).use(raw).use(format).use(stringify);
|
|
64
|
-
exports.processor = processor;
|
|
65
59
|
var processorGetAST = unified().use(markdown, {
|
|
66
60
|
commonmark: true
|
|
67
61
|
}).use(slug);
|
|
68
|
-
|
|
62
|
+
export { processor, processorGetAST };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = void 0;
|
|
5
1
|
var hrefReg = /\[.+\]\(\S+\)|<img src=(\S+).+\/>|!\[\]\(\S+\)|<\S+>/g;
|
|
6
2
|
var imageReg1 = /^<img( width=[\\|/|"](\d)+[\\|/|"])? src="(\S+)" .?\/>/;
|
|
7
3
|
var imageReg2 = /^!\[\]\((\S+)\)/;
|
|
@@ -70,5 +66,4 @@ var getPreviewContent = function getPreviewContent(markdownContent) {
|
|
|
70
66
|
};
|
|
71
67
|
};
|
|
72
68
|
|
|
73
|
-
|
|
74
|
-
exports.default = _default;
|
|
69
|
+
export default getPreviewContent;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = void 0;
|
|
5
|
-
exports.digitLength = digitLength;
|
|
6
|
-
exports.divide = divide;
|
|
7
|
-
exports.enableBoundaryChecking = enableBoundaryChecking;
|
|
8
|
-
exports.float2Fixed = float2Fixed;
|
|
9
|
-
exports.minus = minus;
|
|
10
|
-
exports.plus = plus;
|
|
11
|
-
exports.round = round;
|
|
12
|
-
exports.strip = strip;
|
|
13
|
-
exports.times = times;
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
14
2
|
|
|
15
3
|
/**
|
|
16
4
|
* @desc Solve the problem of floating calculation, avoid multiple digits after the decimal point and loss of calculation accuracy.
|
|
@@ -21,11 +9,8 @@ exports.times = times;
|
|
|
21
9
|
* Correct wrong data
|
|
22
10
|
* strip(0.09999999999999998)=0.1
|
|
23
11
|
*/
|
|
24
|
-
function strip(num
|
|
25
|
-
|
|
26
|
-
precision = 12;
|
|
27
|
-
}
|
|
28
|
-
|
|
12
|
+
function strip(num) {
|
|
13
|
+
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 12;
|
|
29
14
|
return +parseFloat(num.toPrecision(precision));
|
|
30
15
|
}
|
|
31
16
|
/**
|
|
@@ -63,7 +48,8 @@ function float2Fixed(num) {
|
|
|
63
48
|
function checkBoundary(num) {
|
|
64
49
|
if (_boundaryCheckingState) {
|
|
65
50
|
if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
|
|
66
|
-
|
|
51
|
+
// eslint-disable-next-line no-console
|
|
52
|
+
console.warn("".concat(num, " is beyond boundary when transfer to integer, the results may not be accurate"));
|
|
67
53
|
}
|
|
68
54
|
}
|
|
69
55
|
}
|
|
@@ -78,7 +64,7 @@ function times(num1, num2) {
|
|
|
78
64
|
}
|
|
79
65
|
|
|
80
66
|
if (others.length > 0) {
|
|
81
|
-
return times.apply(void 0, [times(num1, num2), others[0]].concat(others.slice(1)));
|
|
67
|
+
return times.apply(void 0, [times(num1, num2), others[0]].concat(_toConsumableArray(others.slice(1))));
|
|
82
68
|
}
|
|
83
69
|
|
|
84
70
|
var num1Changed = float2Fixed(num1);
|
|
@@ -99,7 +85,7 @@ function plus(num1, num2) {
|
|
|
99
85
|
}
|
|
100
86
|
|
|
101
87
|
if (others.length > 0) {
|
|
102
|
-
return plus.apply(void 0, [plus(num1, num2), others[0]].concat(others.slice(1)));
|
|
88
|
+
return plus.apply(void 0, [plus(num1, num2), others[0]].concat(_toConsumableArray(others.slice(1))));
|
|
103
89
|
}
|
|
104
90
|
|
|
105
91
|
var baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
|
|
@@ -116,7 +102,7 @@ function minus(num1, num2) {
|
|
|
116
102
|
}
|
|
117
103
|
|
|
118
104
|
if (others.length > 0) {
|
|
119
|
-
return minus.apply(void 0, [minus(num1, num2), others[0]].concat(others.slice(1)));
|
|
105
|
+
return minus.apply(void 0, [minus(num1, num2), others[0]].concat(_toConsumableArray(others.slice(1))));
|
|
120
106
|
}
|
|
121
107
|
|
|
122
108
|
var baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
|
|
@@ -133,7 +119,7 @@ function divide(num1, num2) {
|
|
|
133
119
|
}
|
|
134
120
|
|
|
135
121
|
if (others.length > 0) {
|
|
136
|
-
return divide.apply(void 0, [divide(num1, num2), others[0]].concat(others.slice(1)));
|
|
122
|
+
return divide.apply(void 0, [divide(num1, num2), others[0]].concat(_toConsumableArray(others.slice(1))));
|
|
137
123
|
}
|
|
138
124
|
|
|
139
125
|
var num1Changed = float2Fixed(num1);
|
|
@@ -159,15 +145,13 @@ var _boundaryCheckingState = true;
|
|
|
159
145
|
* @param flag Mark switch, true is on, false is off, default is true
|
|
160
146
|
*/
|
|
161
147
|
|
|
162
|
-
function enableBoundaryChecking(
|
|
163
|
-
|
|
164
|
-
flag = true;
|
|
165
|
-
}
|
|
166
|
-
|
|
148
|
+
function enableBoundaryChecking() {
|
|
149
|
+
var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
167
150
|
_boundaryCheckingState = flag;
|
|
168
151
|
}
|
|
169
152
|
|
|
170
|
-
|
|
153
|
+
export { strip, plus, minus, times, divide, round, digitLength, float2Fixed, enableBoundaryChecking };
|
|
154
|
+
export default {
|
|
171
155
|
strip: strip,
|
|
172
156
|
plus: plus,
|
|
173
157
|
minus: minus,
|
|
@@ -177,5 +161,4 @@ var _default = {
|
|
|
177
161
|
digitLength: digitLength,
|
|
178
162
|
float2Fixed: float2Fixed,
|
|
179
163
|
enableBoundaryChecking: enableBoundaryChecking
|
|
180
|
-
};
|
|
181
|
-
exports.default = _default;
|
|
164
|
+
};
|
package/lib/utils/utils.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.throttle = exports.isInternalImg = exports.isFunction = exports.getImageThumbnailUrl = exports.getFileIconUrl = exports.debounce = exports.checkSVGImage = void 0;
|
|
5
1
|
var FILEEXT_ICON_MAP = {
|
|
6
2
|
// text file
|
|
7
3
|
md: "txt.png",
|
|
@@ -50,8 +46,7 @@ var FILEEXT_ICON_MAP = {
|
|
|
50
46
|
// default
|
|
51
47
|
default: "file.png"
|
|
52
48
|
};
|
|
53
|
-
|
|
54
|
-
var getFileIconUrl = function getFileIconUrl(filename, direntType) {
|
|
49
|
+
export var getFileIconUrl = function getFileIconUrl(filename, direntType) {
|
|
55
50
|
if (direntType === "dir") {
|
|
56
51
|
var _iconUrl = "assets/images/folder/" + FILEEXT_ICON_MAP["folder"];
|
|
57
52
|
|
|
@@ -75,30 +70,21 @@ var getFileIconUrl = function getFileIconUrl(filename, direntType) {
|
|
|
75
70
|
|
|
76
71
|
return iconUrl;
|
|
77
72
|
};
|
|
78
|
-
|
|
79
|
-
exports.getFileIconUrl = getFileIconUrl;
|
|
80
|
-
|
|
81
|
-
var getImageThumbnailUrl = function getImageThumbnailUrl(url, server) {
|
|
73
|
+
export var getImageThumbnailUrl = function getImageThumbnailUrl(url, server) {
|
|
82
74
|
if (server && url.indexOf(server) > -1) {
|
|
83
75
|
return url.replace("/workspace", "/thumbnail/workspace") + "?size=256";
|
|
84
76
|
}
|
|
85
77
|
|
|
86
78
|
return url;
|
|
87
79
|
};
|
|
88
|
-
|
|
89
|
-
exports.getImageThumbnailUrl = getImageThumbnailUrl;
|
|
90
|
-
|
|
91
|
-
var debounce = function debounce(fn, wait) {
|
|
80
|
+
export var debounce = function debounce(fn, wait) {
|
|
92
81
|
var timeout = null;
|
|
93
82
|
return function () {
|
|
94
83
|
if (timeout !== null) clearTimeout(timeout);
|
|
95
84
|
timeout = setTimeout(fn, wait);
|
|
96
85
|
};
|
|
97
86
|
};
|
|
98
|
-
|
|
99
|
-
exports.debounce = debounce;
|
|
100
|
-
|
|
101
|
-
var throttle = function throttle(func, delay) {
|
|
87
|
+
export var throttle = function throttle(func, delay) {
|
|
102
88
|
var timer = null;
|
|
103
89
|
var startTime = Date.now();
|
|
104
90
|
return function () {
|
|
@@ -116,26 +102,15 @@ var throttle = function throttle(func, delay) {
|
|
|
116
102
|
}
|
|
117
103
|
};
|
|
118
104
|
};
|
|
119
|
-
|
|
120
|
-
exports.throttle = throttle;
|
|
121
|
-
|
|
122
|
-
var isFunction = function isFunction(functionToCheck) {
|
|
105
|
+
export var isFunction = function isFunction(functionToCheck) {
|
|
123
106
|
var getType = {};
|
|
124
107
|
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
|
125
108
|
};
|
|
126
|
-
|
|
127
|
-
exports.isFunction = isFunction;
|
|
128
|
-
|
|
129
|
-
var isInternalImg = function isInternalImg(url) {
|
|
109
|
+
export var isInternalImg = function isInternalImg(url) {
|
|
130
110
|
if (!url) return;
|
|
131
111
|
return url.indexOf(window.dtable.server) > -1;
|
|
132
112
|
};
|
|
133
|
-
|
|
134
|
-
exports.isInternalImg = isInternalImg;
|
|
135
|
-
|
|
136
|
-
var checkSVGImage = function checkSVGImage(url) {
|
|
113
|
+
export var checkSVGImage = function checkSVGImage(url) {
|
|
137
114
|
if (!url) return false;
|
|
138
115
|
return url.substr(-4).toLowerCase() === '.svg';
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
exports.checkSVGImage = checkSVGImage;
|
|
116
|
+
};
|