dtable-ui-component 0.1.75-beta3 → 0.1.75-beta4
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.js +27 -38
- package/lib/ButtonFormatter/index.js +47 -59
- package/lib/CTimeFormatter/index.js +39 -53
- package/lib/CheckboxFormatter/index.js +35 -48
- package/lib/CollaboratorFormatter/index.js +42 -64
- package/lib/CollaboratorItem/index.js +44 -61
- package/lib/CreatorFormatter/index.js +42 -62
- package/lib/DateFormatter/index.js +40 -55
- package/lib/DurationFormatter/index.js +29 -42
- package/lib/EmailFormatter/index.js +27 -38
- package/lib/FileFormatter/index.js +50 -65
- package/lib/FileItemFormatter/index.js +32 -44
- package/lib/FileUploader/index.js +34 -44
- package/lib/FormulaFormatter/index.js +81 -102
- package/lib/GeolocationFormatter/index.js +35 -50
- package/lib/ImageFormatter/images-lazy-load.js +73 -81
- package/lib/ImageFormatter/index.js +90 -109
- package/lib/ImagePreviewerLightbox/index.js +27 -60
- package/lib/LastModifierFormatter/index.js +42 -62
- package/lib/LinkFormatter/index.js +59 -80
- package/lib/Loading/index.js +4 -13
- package/lib/LongTextFormatter/html-long-text-formatter.js +49 -60
- package/lib/LongTextFormatter/index.js +9 -28
- package/lib/LongTextFormatter/simple-long-text-formatter.js +52 -58
- package/lib/MTimeFormatter/index.js +39 -53
- package/lib/ModalPortal/index.js +30 -37
- package/lib/MultipleSelectFormatter/index.js +39 -55
- package/lib/NumberFormatter/index.js +35 -50
- package/lib/RateFormatter/index.js +37 -52
- package/lib/SelectItem/index.js +31 -46
- package/lib/SingleSelectFormatter/index.js +38 -54
- package/lib/TextFormatter/index.js +31 -44
- package/lib/UrlFormatter/index.js +27 -38
- package/lib/app.js +75 -80
- package/lib/cellFormatterFactory/index.js +17 -20
- 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 -28
- package/lib/formatterConfig/index.js +28 -59
- package/lib/index.js +31 -139
- 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/toaster/alert.js +92 -106
- package/lib/toaster/index.js +3 -12
- package/lib/toaster/toast.js +103 -147
- package/lib/toaster/toastManager.js +78 -97
- package/lib/toaster/toaster.js +36 -52
- package/lib/utils/cell-value-validator.js +5 -9
- 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 +13 -31
- package/lib/utils/utils.js +8 -33
- package/lib/utils/value-format-utils.js +58 -108
- package/package.json +5 -5
- package/es/AutoNumberFormatter/index.css +0 -1
- package/es/AutoNumberFormatter/index.js +0 -36
- package/es/ButtonFormatter/index.css +0 -13
- package/es/ButtonFormatter/index.js +0 -56
- package/es/CTimeFormatter/index.css +0 -1
- package/es/CTimeFormatter/index.js +0 -58
- package/es/CheckboxFormatter/index.css +0 -1
- package/es/CheckboxFormatter/index.js +0 -45
- package/es/CollaboratorFormatter/index.css +0 -1
- package/es/CollaboratorFormatter/index.js +0 -91
- package/es/CollaboratorItem/index.css +0 -49
- package/es/CollaboratorItem/index.js +0 -64
- package/es/CreatorFormatter/index.css +0 -1
- package/es/CreatorFormatter/index.js +0 -87
- package/es/DateFormatter/index.css +0 -1
- package/es/DateFormatter/index.js +0 -60
- package/es/DurationFormatter/index.css +0 -1
- package/es/DurationFormatter/index.js +0 -38
- package/es/EmailFormatter/index.css +0 -5
- package/es/EmailFormatter/index.js +0 -36
- package/es/FileFormatter/index.css +0 -29
- package/es/FileFormatter/index.js +0 -64
- package/es/FileItemFormatter/index.js +0 -50
- package/es/FileUploader/index.js +0 -53
- package/es/FormulaFormatter/index.css +0 -19
- package/es/FormulaFormatter/index.js +0 -164
- package/es/GeolocationFormatter/index.css +0 -1
- package/es/GeolocationFormatter/index.js +0 -53
- package/es/ImageFormatter/images-lazy-load.js +0 -150
- package/es/ImageFormatter/index.css +0 -34
- package/es/ImageFormatter/index.js +0 -154
- package/es/ImagePreviewerLightbox/index.css +0 -87
- package/es/ImagePreviewerLightbox/index.js +0 -119
- package/es/LastModifierFormatter/index.css +0 -1
- package/es/LastModifierFormatter/index.js +0 -87
- package/es/LinkFormatter/index.css +0 -27
- package/es/LinkFormatter/index.js +0 -144
- package/es/Loading/index.css +0 -54
- package/es/Loading/index.js +0 -7
- package/es/LongTextFormatter/html-long-text-formatter.js +0 -96
- package/es/LongTextFormatter/index.css +0 -63
- package/es/LongTextFormatter/index.js +0 -29
- package/es/LongTextFormatter/simple-long-text-formatter.js +0 -104
- package/es/MTimeFormatter/index.css +0 -1
- package/es/MTimeFormatter/index.js +0 -58
- package/es/ModalPortal/index.js +0 -44
- package/es/MultipleSelectFormatter/index.css +0 -1
- package/es/MultipleSelectFormatter/index.js +0 -70
- package/es/NumberFormatter/index.css +0 -1
- package/es/NumberFormatter/index.js +0 -47
- package/es/RateFormatter/index.css +0 -1
- package/es/RateFormatter/index.js +0 -80
- package/es/SelectItem/index.js +0 -58
- package/es/SingleSelectFormatter/index.css +0 -1
- package/es/SingleSelectFormatter/index.js +0 -70
- package/es/TextFormatter/index.css +0 -1
- package/es/TextFormatter/index.js +0 -56
- package/es/UrlFormatter/index.css +0 -5
- package/es/UrlFormatter/index.js +0 -36
- 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/cellFormatterFactory/index.js +0 -25
- 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/common/collaborator-item.js +0 -63
- 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 -49
- package/es/css/cell-editor.css +0 -614
- package/es/css/cell-formatter.css +0 -4
- package/es/css/custom-rc-calendar.css +0 -118
- package/es/formatterConfig/index.js +0 -31
- package/es/index.js +0 -31
- 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/toaster/alert.js +0 -150
- package/es/toaster/index.js +0 -3
- package/es/toaster/toast.js +0 -179
- package/es/toaster/toastManager.js +0 -170
- package/es/toaster/toaster.js +0 -76
- package/es/utils/cell-value-validator.js +0 -31
- 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 -164
- package/es/utils/unified/index.js +0 -470
- package/es/utils/utils.js +0 -116
- package/es/utils/value-format-utils.js +0 -497
- package/es/utils/vfile/core.js +0 -172
- package/es/utils/vfile/index.js +0 -48
package/lib/toaster/toaster.js
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
|
-
|
|
14
|
-
var _toastManager = _interopRequireDefault(require("./toastManager"));
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import ReactDOM from 'react-dom';
|
|
5
|
+
import ToastManager from './toastManager';
|
|
20
6
|
var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
21
7
|
/**
|
|
22
8
|
* The Toaster manages the interactionsb between
|
|
@@ -26,67 +12,65 @@ var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'und
|
|
|
26
12
|
var Toaster = function Toaster() {
|
|
27
13
|
var _this = this;
|
|
28
14
|
|
|
29
|
-
(
|
|
15
|
+
_classCallCheck(this, Toaster);
|
|
16
|
+
|
|
17
|
+
this._bindNotify = function (handler) {
|
|
30
18
|
_this.notifyHandler = handler;
|
|
31
|
-
}
|
|
32
|
-
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
this._bindGetToasts = function (handler) {
|
|
33
22
|
_this.getToastsHandler = handler;
|
|
34
|
-
}
|
|
35
|
-
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
this._bindCloseAll = function (handler) {
|
|
36
26
|
_this.closeAllHandler = handler;
|
|
37
|
-
}
|
|
38
|
-
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
this.getToasts = function () {
|
|
39
30
|
return _this.getToastsHandler();
|
|
40
|
-
}
|
|
41
|
-
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
this.closeAll = function () {
|
|
42
34
|
return _this.closeAllHandler();
|
|
43
|
-
}
|
|
44
|
-
(0, _defineProperty2.default)(this, "notify", function (title, settings) {
|
|
45
|
-
if (settings === void 0) {
|
|
46
|
-
settings = {};
|
|
47
|
-
}
|
|
35
|
+
};
|
|
48
36
|
|
|
37
|
+
this.notify = function (title) {
|
|
38
|
+
var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
49
39
|
return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
|
|
50
40
|
intent: 'none'
|
|
51
41
|
}));
|
|
52
|
-
}
|
|
53
|
-
(0, _defineProperty2.default)(this, "success", function (title, settings) {
|
|
54
|
-
if (settings === void 0) {
|
|
55
|
-
settings = {};
|
|
56
|
-
}
|
|
42
|
+
};
|
|
57
43
|
|
|
44
|
+
this.success = function (title) {
|
|
45
|
+
var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
58
46
|
return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
|
|
59
47
|
intent: 'success'
|
|
60
48
|
}));
|
|
61
|
-
}
|
|
62
|
-
(0, _defineProperty2.default)(this, "warning", function (title, settings) {
|
|
63
|
-
if (settings === void 0) {
|
|
64
|
-
settings = {};
|
|
65
|
-
}
|
|
49
|
+
};
|
|
66
50
|
|
|
51
|
+
this.warning = function (title) {
|
|
52
|
+
var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
67
53
|
return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
|
|
68
54
|
intent: 'warning'
|
|
69
55
|
}));
|
|
70
|
-
}
|
|
71
|
-
(0, _defineProperty2.default)(this, "danger", function (title, settings) {
|
|
72
|
-
if (settings === void 0) {
|
|
73
|
-
settings = {};
|
|
74
|
-
}
|
|
56
|
+
};
|
|
75
57
|
|
|
58
|
+
this.danger = function (title) {
|
|
59
|
+
var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
76
60
|
return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
|
|
77
61
|
intent: 'danger'
|
|
78
62
|
}));
|
|
79
|
-
}
|
|
63
|
+
};
|
|
64
|
+
|
|
80
65
|
if (!isBrowser) return;
|
|
81
66
|
var container = document.createElement('div');
|
|
82
67
|
container.setAttribute('data-evergreen-toaster-container', '');
|
|
83
68
|
document.body.appendChild(container);
|
|
84
|
-
|
|
85
|
-
_reactDom.default.render( /*#__PURE__*/_react.default.createElement(_toastManager.default, {
|
|
69
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(ToastManager, {
|
|
86
70
|
bindNotify: this._bindNotify,
|
|
87
71
|
bindGetToasts: this._bindGetToasts,
|
|
88
72
|
bindCloseAll: this._bindCloseAll
|
|
89
73
|
}), container);
|
|
90
74
|
};
|
|
91
75
|
|
|
92
|
-
|
|
76
|
+
export { Toaster as default };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.default = void 0;
|
|
5
|
-
|
|
6
|
-
var _constants = require("../constants");
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
2
|
|
|
8
3
|
var _validators;
|
|
9
4
|
|
|
5
|
+
import { FORMULA_RESULT_TYPE, CellType } from '../constants';
|
|
6
|
+
|
|
10
7
|
var numberValidator = function numberValidator(value) {
|
|
11
8
|
return (value || value === 0) && Object.prototype.toString.call(value) === '[object Number]';
|
|
12
9
|
};
|
|
@@ -19,7 +16,7 @@ var checkboxValidator = function checkboxValidator(value) {
|
|
|
19
16
|
return typeof value === 'boolean';
|
|
20
17
|
};
|
|
21
18
|
|
|
22
|
-
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);
|
|
23
20
|
|
|
24
21
|
var cellValueValidator = function cellValueValidator(cellValue, type) {
|
|
25
22
|
var validator = validators[type];
|
|
@@ -31,5 +28,4 @@ var cellValueValidator = function cellValueValidator(cellValue, type) {
|
|
|
31
28
|
return true;
|
|
32
29
|
};
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
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
|
/**
|
|
@@ -64,7 +49,7 @@ 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
|
|
67
|
-
console.warn(num
|
|
52
|
+
console.warn("".concat(num, " is beyond boundary when transfer to integer, the results may not be accurate"));
|
|
68
53
|
}
|
|
69
54
|
}
|
|
70
55
|
}
|
|
@@ -79,7 +64,7 @@ function times(num1, num2) {
|
|
|
79
64
|
}
|
|
80
65
|
|
|
81
66
|
if (others.length > 0) {
|
|
82
|
-
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))));
|
|
83
68
|
}
|
|
84
69
|
|
|
85
70
|
var num1Changed = float2Fixed(num1);
|
|
@@ -100,7 +85,7 @@ function plus(num1, num2) {
|
|
|
100
85
|
}
|
|
101
86
|
|
|
102
87
|
if (others.length > 0) {
|
|
103
|
-
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))));
|
|
104
89
|
}
|
|
105
90
|
|
|
106
91
|
var baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
|
|
@@ -117,7 +102,7 @@ function minus(num1, num2) {
|
|
|
117
102
|
}
|
|
118
103
|
|
|
119
104
|
if (others.length > 0) {
|
|
120
|
-
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))));
|
|
121
106
|
}
|
|
122
107
|
|
|
123
108
|
var baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
|
|
@@ -134,7 +119,7 @@ function divide(num1, num2) {
|
|
|
134
119
|
}
|
|
135
120
|
|
|
136
121
|
if (others.length > 0) {
|
|
137
|
-
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))));
|
|
138
123
|
}
|
|
139
124
|
|
|
140
125
|
var num1Changed = float2Fixed(num1);
|
|
@@ -160,15 +145,13 @@ var _boundaryCheckingState = true;
|
|
|
160
145
|
* @param flag Mark switch, true is on, false is off, default is true
|
|
161
146
|
*/
|
|
162
147
|
|
|
163
|
-
function enableBoundaryChecking(
|
|
164
|
-
|
|
165
|
-
flag = true;
|
|
166
|
-
}
|
|
167
|
-
|
|
148
|
+
function enableBoundaryChecking() {
|
|
149
|
+
var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
168
150
|
_boundaryCheckingState = flag;
|
|
169
151
|
}
|
|
170
152
|
|
|
171
|
-
|
|
153
|
+
export { strip, plus, minus, times, divide, round, digitLength, float2Fixed, enableBoundaryChecking };
|
|
154
|
+
export default {
|
|
172
155
|
strip: strip,
|
|
173
156
|
plus: plus,
|
|
174
157
|
minus: minus,
|
|
@@ -178,5 +161,4 @@ var _default = {
|
|
|
178
161
|
digitLength: digitLength,
|
|
179
162
|
float2Fixed: float2Fixed,
|
|
180
163
|
enableBoundaryChecking: enableBoundaryChecking
|
|
181
|
-
};
|
|
182
|
-
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
|
+
};
|