dtable-ui-component 4.4.3-2 → 4.4.3-alpha1
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 +7 -14
- package/lib/ButtonFormatter/index.js +9 -16
- package/lib/CTimeFormatter/index.js +9 -16
- package/lib/CheckboxEditor/index.js +8 -15
- package/lib/CheckboxFormatter/index.js +8 -15
- package/lib/CollaboratorEditor/index.js +21 -29
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +25 -32
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +18 -25
- package/lib/CollaboratorFormatter/index.js +12 -19
- package/lib/CollaboratorItem/index.js +10 -17
- package/lib/CreatorFormatter/index.js +12 -19
- package/lib/DTableCommonAddTool/index.js +6 -13
- package/lib/DTableCustomizeCollaboratorSelect/index.js +18 -26
- package/lib/DTableCustomizeSelect/index.js +15 -23
- package/lib/DTableFiltersPopover/constants/index.js +33 -38
- package/lib/DTableFiltersPopover/index.js +31 -38
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +46 -53
- package/lib/DTableFiltersPopover/utils/index.js +99 -128
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +26 -34
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +25 -33
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +26 -34
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +26 -34
- package/lib/DTableFiltersPopover/widgets/filter-item.js +120 -128
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +18 -26
- package/lib/DTableFiltersPopover/widgets/rate-item.js +8 -15
- package/lib/DTablePopover/index.js +8 -15
- package/lib/DTablePopover/utils.js +2 -9
- package/lib/DTableRadio/index.js +10 -17
- package/lib/DTableSearchInput/index.js +13 -21
- package/lib/DTableSearchInput/utils.js +2 -9
- package/lib/DTableSelect/dtable-select-label.js +6 -13
- package/lib/DTableSelect/index.js +10 -18
- package/lib/DTableSelect/utils.js +10 -20
- package/lib/DTableSwitch/index.js +7 -14
- package/lib/DateEditor/index.js +22 -30
- package/lib/DateEditor/mb-date-editor-popover/index.js +47 -55
- package/lib/DateEditor/pc-date-editor-popover.js +20 -27
- package/lib/DateFormatter/index.js +9 -16
- package/lib/Department-editor/constants.js +1 -7
- package/lib/Department-editor/department-multiple-select/index.js +24 -32
- package/lib/Department-editor/department-single-select.js +33 -41
- package/lib/Department-editor/index.js +14 -22
- package/lib/Department-editor/selected-departments/index.js +25 -32
- package/lib/Department-editor/utils.js +3 -11
- package/lib/DepartmentSingleSelectFormatter/index.js +9 -16
- package/lib/DigitalSignFormatter/index.js +15 -23
- package/lib/DigitalSignFormatter/utils.js +3 -11
- package/lib/DurationFormatter/index.js +9 -16
- package/lib/EditEditorButton/index.js +5 -12
- package/lib/EmailFormatter/index.js +7 -14
- package/lib/FieldDisplaySetting/field-item.js +14 -21
- package/lib/FieldDisplaySetting/index.js +19 -27
- package/lib/FileEditor/index.js +8 -15
- package/lib/FileEditor/pc-files-addition/index.js +0 -1
- package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +0 -1
- package/lib/FileEditor/pc-files-preview/index.js +0 -1
- package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +0 -1
- package/lib/FileFormatter/index.js +11 -19
- package/lib/FileItemFormatter/index.js +6 -14
- package/lib/FileItemFormatter/utils.js +2 -9
- package/lib/FileUploader/index.js +4 -11
- package/lib/FormulaFormatter/cell-value-validator.js +18 -24
- package/lib/FormulaFormatter/index.js +32 -39
- package/lib/FormulaFormatter/utils.js +13 -29
- package/lib/GeolocationFormatter/index.js +9 -16
- package/lib/HtmlLongTextFormatter/index.js +9 -17
- package/lib/HtmlLongTextFormatter/markdown2html.js +47 -0
- package/lib/HtmlLongTextFormatter/unified/index.js +400 -0
- package/lib/HtmlLongTextFormatter/vfile/core.js +155 -0
- package/lib/HtmlLongTextFormatter/vfile/index.js +40 -0
- package/lib/ImageFormatter/images-lazy-load.js +9 -16
- package/lib/ImageFormatter/index.js +16 -24
- package/lib/ImageFormatter/utils.js +2 -9
- package/lib/ImagePreviewerLightbox/index.js +12 -19
- package/lib/ImagePreviewerLightbox/utils.js +3 -11
- package/lib/LastModifierFormatter/index.js +12 -19
- package/lib/LinkEditor/index.js +25 -33
- package/lib/LinkEditor/link-editor-option.js +8 -15
- package/lib/LinkEditor/mb-link-editor-popover/index.js +23 -30
- package/lib/LinkEditor/pc-link-editor-popover/index.js +17 -24
- package/lib/LinkFormatter/index.js +13 -20
- package/lib/Loading/index.js +4 -11
- package/lib/LongTextFormatter/index.js +6 -13
- package/lib/MBEditorHeader/index.js +7 -14
- package/lib/MTimeFormatter/index.js +9 -16
- package/lib/ModalPortal/index.js +5 -12
- package/lib/MultipleSelectEditor/index.js +17 -25
- package/lib/MultipleSelectFormatter/index.js +10 -17
- package/lib/NotificationPopover/index.js +16 -24
- package/lib/NumberEditor/index.js +18 -25
- package/lib/NumberFormatter/index.js +9 -16
- package/lib/RateFormatter/index.js +8 -15
- package/lib/RoleStatusEditor/index.js +14 -22
- package/lib/RowExpandEmailFormatter/index.js +10 -17
- package/lib/RowExpandFileFormatter/index.js +8 -16
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +18 -27
- package/lib/RowExpandFormatter/index.js +78 -86
- package/lib/RowExpandFormulaFormatter/index.js +34 -42
- package/lib/RowExpandImageFormatter/index.js +10 -19
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +18 -27
- package/lib/RowExpandImageFormatter/utils.js +2 -9
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +7 -16
- package/lib/RowExpandLinkFormatter/index.js +37 -46
- package/lib/RowExpandLinkFormatter/utils.js +6 -17
- package/lib/RowExpandLinkFormatter/value-display-utils.js +5 -12
- package/lib/RowExpandRateFormatter/index.js +8 -15
- package/lib/RowExpandUrlFormatter/index.js +14 -21
- package/lib/SelectItem/index.js +4 -12
- package/lib/SelectOptionGroup/KeyCodes.js +1 -7
- package/lib/SelectOptionGroup/index.js +33 -32
- package/lib/SelectOptionGroup/option.js +4 -19
- package/lib/SimpleLongTextFormatter/index.js +20 -27
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +1 -7
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +8 -15
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +7 -14
- package/lib/SingleSelectEditor/index.js +18 -26
- package/lib/SingleSelectFormatter/index.js +9 -16
- package/lib/TextEditor/index.js +7 -14
- package/lib/TextFormatter/index.js +7 -14
- package/lib/UrlFormatter/index.js +7 -14
- package/lib/cellFormatterFactory/index.js +4 -11
- package/lib/common/ClickOutside.js +4 -12
- package/lib/common/delete-tip.js +12 -20
- package/lib/common/modal-portal.js +5 -13
- package/lib/constants/index.js +9 -28
- package/lib/data/dtable-value.js +6 -11
- package/lib/formatterConfig/base-formatter-config.js +46 -53
- package/lib/formatterConfig/index.js +9 -16
- package/lib/hooks/common-hooks.js +4 -11
- package/lib/index.js +75 -432
- package/lib/lang/index.js +13 -24
- package/lib/locals/de.js +1 -7
- package/lib/locals/en.js +1 -7
- package/lib/locals/fr.js +1 -7
- package/lib/locals/zh-CN.js +1 -7
- package/lib/select-editor/index.js +4 -27
- package/lib/select-editor/mb-select-editor-popover/index.js +33 -41
- package/lib/select-editor/pc-select-editor-popover/index.js +19 -26
- package/lib/select-editor/select-editor-option.js +8 -15
- package/lib/toaster/alert.js +11 -18
- package/lib/toaster/index.js +3 -10
- package/lib/toaster/toast.js +8 -16
- package/lib/toaster/toastManager.js +5 -13
- package/lib/toaster/toaster.js +7 -15
- package/lib/utils/dayjs.js +4 -11
- package/lib/utils/editor-utils.js +5 -15
- package/lib/utils/event-bus.js +1 -7
- package/lib/utils/utils.js +6 -17
- package/package.json +77 -63
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
require("./index.css");
|
|
11
|
-
class TextFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import './index.css';
|
|
4
|
+
class TextFormatter extends React.Component {
|
|
12
5
|
constructor() {
|
|
13
6
|
super(...arguments);
|
|
14
7
|
this.getFormattedValue = val => {
|
|
@@ -26,12 +19,12 @@ class TextFormatter extends _react.default.Component {
|
|
|
26
19
|
containerClassName,
|
|
27
20
|
value
|
|
28
21
|
} = this.props;
|
|
29
|
-
const classname = (
|
|
22
|
+
const classname = classnames('dtable-ui cell-formatter-container text-formatter', containerClassName);
|
|
30
23
|
const formattedValue = this.getFormattedValue(value);
|
|
31
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
32
25
|
className: classname,
|
|
33
26
|
title: formattedValue
|
|
34
27
|
}, formattedValue);
|
|
35
28
|
}
|
|
36
29
|
}
|
|
37
|
-
|
|
30
|
+
export default TextFormatter;
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
require("./index.css");
|
|
11
|
-
class UrlFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import './index.css';
|
|
4
|
+
class UrlFormatter extends React.Component {
|
|
12
5
|
render() {
|
|
13
6
|
const {
|
|
14
7
|
containerClassName,
|
|
15
8
|
value
|
|
16
9
|
} = this.props;
|
|
17
|
-
let classname = (
|
|
18
|
-
return /*#__PURE__*/
|
|
10
|
+
let classname = classnames('dtable-ui cell-formatter-container url-formatter', containerClassName);
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
12
|
className: classname
|
|
20
13
|
}, value);
|
|
21
14
|
}
|
|
22
15
|
}
|
|
23
|
-
|
|
16
|
+
export default UrlFormatter;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _formatterConfig = _interopRequireDefault(require("../formatterConfig"));
|
|
1
|
+
import FormatterConfig from '../formatterConfig';
|
|
9
2
|
class CellFormatterFactory {
|
|
10
3
|
createFormatter(formatterType) {
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
4
|
+
if (FormatterConfig[formatterType]) {
|
|
5
|
+
return FormatterConfig[formatterType];
|
|
13
6
|
}
|
|
14
7
|
return null;
|
|
15
8
|
}
|
|
16
9
|
}
|
|
17
10
|
const cellFormatterFactory = new CellFormatterFactory();
|
|
18
|
-
|
|
11
|
+
export default cellFormatterFactory;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
class ClickOutside extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default class ClickOutside extends React.Component {
|
|
10
3
|
constructor() {
|
|
11
4
|
super(...arguments);
|
|
12
5
|
this.isClickedInside = false;
|
|
@@ -28,9 +21,8 @@ class ClickOutside extends _react.default.Component {
|
|
|
28
21
|
document.removeEventListener('mousedown', this.handleDocumentClick);
|
|
29
22
|
}
|
|
30
23
|
render() {
|
|
31
|
-
return
|
|
24
|
+
return React.cloneElement(React.Children.only(this.props.children), {
|
|
32
25
|
onMouseDownCapture: this.handleMouseDown
|
|
33
26
|
});
|
|
34
27
|
}
|
|
35
|
-
}
|
|
36
|
-
exports.default = ClickOutside;
|
|
28
|
+
}
|
package/lib/common/delete-tip.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _modalPortal = _interopRequireDefault(require("./modal-portal"));
|
|
10
|
-
var _lang = require("../lang");
|
|
11
|
-
require("./delete-tip.css");
|
|
12
|
-
class DeleteTip extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ModalPortal from './modal-portal';
|
|
3
|
+
import { getLocale } from '../lang';
|
|
4
|
+
import './delete-tip.css';
|
|
5
|
+
export default class DeleteTip extends React.Component {
|
|
13
6
|
constructor() {
|
|
14
7
|
super(...arguments);
|
|
15
8
|
this.onMouseDown = e => {
|
|
@@ -31,7 +24,7 @@ class DeleteTip extends _react.default.Component {
|
|
|
31
24
|
position,
|
|
32
25
|
deleteTip
|
|
33
26
|
} = this.props;
|
|
34
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/React.createElement(ModalPortal, null, /*#__PURE__*/React.createElement("div", {
|
|
35
28
|
ref: node => this.tipContainer = node,
|
|
36
29
|
className: "dtable-tip tip-container",
|
|
37
30
|
style: {
|
|
@@ -39,17 +32,16 @@ class DeleteTip extends _react.default.Component {
|
|
|
39
32
|
left: position.left
|
|
40
33
|
},
|
|
41
34
|
onClick: e => e.stopPropagation()
|
|
42
|
-
}, /*#__PURE__*/
|
|
35
|
+
}, /*#__PURE__*/React.createElement("b", {
|
|
43
36
|
className: "mb-4"
|
|
44
|
-
}, deleteTip), /*#__PURE__*/
|
|
37
|
+
}, deleteTip), /*#__PURE__*/React.createElement("div", {
|
|
45
38
|
className: "d-flex justify-content-end"
|
|
46
|
-
}, /*#__PURE__*/
|
|
39
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
47
40
|
className: "btn btn-secondary mr-2",
|
|
48
41
|
onClick: toggle
|
|
49
|
-
},
|
|
42
|
+
}, getLocale('Cancel')), /*#__PURE__*/React.createElement("button", {
|
|
50
43
|
className: "btn btn-primary",
|
|
51
44
|
onClick: onDelete
|
|
52
|
-
},
|
|
45
|
+
}, getLocale('Delete')))));
|
|
53
46
|
}
|
|
54
|
-
}
|
|
55
|
-
exports.default = DeleteTip;
|
|
47
|
+
}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
10
3
|
const modalRoot = document.getElementById('modal-wrapper');
|
|
11
|
-
class ModalPortal extends
|
|
4
|
+
export default class ModalPortal extends React.Component {
|
|
12
5
|
constructor(props) {
|
|
13
6
|
super(props);
|
|
14
7
|
this.el = document.createElement('div');
|
|
@@ -20,7 +13,6 @@ class ModalPortal extends _react.default.Component {
|
|
|
20
13
|
modalRoot.removeChild(this.el);
|
|
21
14
|
}
|
|
22
15
|
render() {
|
|
23
|
-
return
|
|
16
|
+
return ReactDOM.createPortal(this.props.children, this.el);
|
|
24
17
|
}
|
|
25
|
-
}
|
|
26
|
-
exports.default = ModalPortal;
|
|
18
|
+
}
|
package/lib/constants/index.js
CHANGED
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ARRAY_FORMAT_COLUMNS = void 0;
|
|
7
|
-
Object.defineProperty(exports, "CellType", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _dtableUtils.CellType;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
exports.EVENT_BUS_TYPE = exports.DATE_TYPES = void 0;
|
|
14
|
-
Object.defineProperty(exports, "FORMULA_RESULT_TYPE", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () {
|
|
17
|
-
return _dtableUtils.FORMULA_RESULT_TYPE;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
exports.SIMPLE_CELL_FORMULA_RESULTS = exports.SIMPLE_CELL_COLUMNS = exports.NUMBER_TYPES = void 0;
|
|
21
|
-
var _dtableUtils = require("dtable-utils");
|
|
22
|
-
const NUMBER_TYPES = exports.NUMBER_TYPES = {
|
|
1
|
+
import { CellType, FORMULA_RESULT_TYPE } from 'dtable-utils';
|
|
2
|
+
const NUMBER_TYPES = {
|
|
23
3
|
'NUMBER': 'number',
|
|
24
4
|
'NUMBER_WITH_COMMAS': 'number-with-commas',
|
|
25
5
|
'PERCENT': 'percent',
|
|
@@ -28,7 +8,7 @@ const NUMBER_TYPES = exports.NUMBER_TYPES = {
|
|
|
28
8
|
'DOLLAR': 'dollar',
|
|
29
9
|
'CUSTOM_CURRENCY': 'custom_currency'
|
|
30
10
|
};
|
|
31
|
-
const DATE_TYPES =
|
|
11
|
+
const DATE_TYPES = {
|
|
32
12
|
'D/M/YYYY': 'D/M/YYYY',
|
|
33
13
|
'D/M/YYYY HH:mm': 'D/M/YYYY HH:mm',
|
|
34
14
|
'M/D/YYYY': 'M/D/YY',
|
|
@@ -36,9 +16,10 @@ const DATE_TYPES = exports.DATE_TYPES = {
|
|
|
36
16
|
'YYYY-MM-DD': 'YYYY-MM-DD',
|
|
37
17
|
'YYYY-MM-DD HH:mm': 'YYYY-MM-DD HH:mm'
|
|
38
18
|
};
|
|
39
|
-
const SIMPLE_CELL_COLUMNS =
|
|
40
|
-
const ARRAY_FORMAT_COLUMNS =
|
|
41
|
-
const SIMPLE_CELL_FORMULA_RESULTS =
|
|
42
|
-
const EVENT_BUS_TYPE =
|
|
19
|
+
const SIMPLE_CELL_COLUMNS = [CellType.TEXT, CellType.NUMBER, CellType.DATE, CellType.CTIME, CellType.MTIME, CellType.AUTO_NUMBER, CellType.URL, CellType.EMAIL, CellType.DURATION, CellType.CHECKBOX, CellType.RATE];
|
|
20
|
+
const ARRAY_FORMAT_COLUMNS = [CellType.IMAGE, CellType.FILE, CellType.MULTIPLE_SELECT, CellType.COLLABORATOR];
|
|
21
|
+
const SIMPLE_CELL_FORMULA_RESULTS = [FORMULA_RESULT_TYPE.NUMBER, FORMULA_RESULT_TYPE.STRING, FORMULA_RESULT_TYPE.DATE, FORMULA_RESULT_TYPE.BOOL];
|
|
22
|
+
const EVENT_BUS_TYPE = {
|
|
43
23
|
OPEN_SELECT: 'open-select'
|
|
44
|
-
};
|
|
24
|
+
};
|
|
25
|
+
export { CellType, NUMBER_TYPES, DATE_TYPES, FORMULA_RESULT_TYPE, SIMPLE_CELL_COLUMNS, ARRAY_FORMAT_COLUMNS, SIMPLE_CELL_FORMULA_RESULTS, EVENT_BUS_TYPE };
|
package/lib/data/dtable-value.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SIGN_CONFIG = exports.DTABLE_VALUE = exports.DEPARTMENTS = exports.COLLABORATORS = void 0;
|
|
7
|
-
const DTABLE_VALUE = exports.DTABLE_VALUE = {
|
|
1
|
+
const DTABLE_VALUE = {
|
|
8
2
|
'tables': [{
|
|
9
3
|
'_id': '0000',
|
|
10
4
|
'name': 'Table1',
|
|
@@ -2715,7 +2709,7 @@ const DTABLE_VALUE = exports.DTABLE_VALUE = {
|
|
|
2715
2709
|
'header_settings': {}
|
|
2716
2710
|
}]
|
|
2717
2711
|
};
|
|
2718
|
-
const DEPARTMENTS =
|
|
2712
|
+
const DEPARTMENTS = [{
|
|
2719
2713
|
id: 1,
|
|
2720
2714
|
id_in_org: 1,
|
|
2721
2715
|
name: '海文互知',
|
|
@@ -2734,7 +2728,7 @@ const DEPARTMENTS = exports.DEPARTMENTS = [{
|
|
|
2734
2728
|
org_id: -1,
|
|
2735
2729
|
parent_id: 1
|
|
2736
2730
|
}];
|
|
2737
|
-
const COLLABORATORS =
|
|
2731
|
+
const COLLABORATORS = [{
|
|
2738
2732
|
'avatar_url': 'https://dev.seatable.cn/image-view/avatars/0/0/916e1e9e7c6184061cb7d96a680292/resized/80/de58ef113a311d390934b06ceafd77cf.png',
|
|
2739
2733
|
'contact_email': '',
|
|
2740
2734
|
'email': 'anbing@1.com',
|
|
@@ -2763,8 +2757,9 @@ const COLLABORATORS = exports.COLLABORATORS = [{
|
|
|
2763
2757
|
'name_pinyin': 'an\'bing',
|
|
2764
2758
|
'id': 'W-00009'
|
|
2765
2759
|
}];
|
|
2766
|
-
const SIGN_CONFIG =
|
|
2760
|
+
const SIGN_CONFIG = {
|
|
2767
2761
|
server: 'https://dev.seatable.cn',
|
|
2768
2762
|
workspaceID: 3,
|
|
2769
2763
|
dtableUuid: '8327efbf-c9ff-4a14-9010-00e801a7e295'
|
|
2770
|
-
};
|
|
2764
|
+
};
|
|
2765
|
+
export { DTABLE_VALUE, COLLABORATORS, DEPARTMENTS, SIGN_CONFIG };
|
|
@@ -1,54 +1,47 @@
|
|
|
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
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[_constants.CellType.GEOLOCATION]: /*#__PURE__*/_react.default.createElement(_GeolocationFormatter.default, null),
|
|
48
|
-
[_constants.CellType.AUTO_NUMBER]: /*#__PURE__*/_react.default.createElement(_AutoNumberFormatter.default, null),
|
|
49
|
-
[_constants.CellType.URL]: /*#__PURE__*/_react.default.createElement(_UrlFormatter.default, null),
|
|
50
|
-
[_constants.CellType.EMAIL]: /*#__PURE__*/_react.default.createElement(_EmailFormatter.default, null),
|
|
51
|
-
[_constants.CellType.DURATION]: /*#__PURE__*/_react.default.createElement(_DurationFormatter.default, null),
|
|
52
|
-
[_constants.CellType.RATE]: /*#__PURE__*/_react.default.createElement(_RateFormatter.default, null),
|
|
53
|
-
[_constants.CellType.BUTTON]: /*#__PURE__*/_react.default.createElement(_ButtonFormatter.default, null)
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CellType } from '../constants';
|
|
3
|
+
import CheckboxFormatter from '../CheckboxFormatter';
|
|
4
|
+
import ImageFormatter from '../ImageFormatter';
|
|
5
|
+
import SimpleLongTextFormatter from '../SimpleLongTextFormatter';
|
|
6
|
+
import TextCellFormatter from '../TextFormatter';
|
|
7
|
+
import SingleSelectFormatter from '../SingleSelectFormatter';
|
|
8
|
+
import MultipleSelectFormatter from '../MultipleSelectFormatter';
|
|
9
|
+
import FileFormatter from '../FileFormatter';
|
|
10
|
+
import CollaboratorFormatter from '../CollaboratorFormatter';
|
|
11
|
+
import NumberFormatter from '../NumberFormatter';
|
|
12
|
+
import DateFormatter from '../DateFormatter';
|
|
13
|
+
import CreatorFormatter from '../CreatorFormatter';
|
|
14
|
+
import CTimeFormatter from '../CTimeFormatter';
|
|
15
|
+
import LastModifierFormatter from '../LastModifierFormatter';
|
|
16
|
+
import MTimeFormatter from '../MTimeFormatter';
|
|
17
|
+
import GeolocationFormatter from '../GeolocationFormatter';
|
|
18
|
+
import AutoNumberFormatter from '../AutoNumberFormatter';
|
|
19
|
+
import UrlFormatter from '../UrlFormatter';
|
|
20
|
+
import EmailFormatter from '../EmailFormatter';
|
|
21
|
+
import DurationFormatter from '../DurationFormatter';
|
|
22
|
+
import RateFormatter from '../RateFormatter';
|
|
23
|
+
import ButtonFormatter from '../ButtonFormatter';
|
|
24
|
+
export default {
|
|
25
|
+
[CellType.DEFAULT]: /*#__PURE__*/React.createElement(TextCellFormatter, null),
|
|
26
|
+
[CellType.TEXT]: /*#__PURE__*/React.createElement(TextCellFormatter, null),
|
|
27
|
+
[CellType.CHECKBOX]: /*#__PURE__*/React.createElement(CheckboxFormatter, null),
|
|
28
|
+
[CellType.LONG_TEXT]: /*#__PURE__*/React.createElement(SimpleLongTextFormatter, null),
|
|
29
|
+
[CellType.SINGLE_SELECT]: /*#__PURE__*/React.createElement(SingleSelectFormatter, null),
|
|
30
|
+
[CellType.IMAGE]: /*#__PURE__*/React.createElement(ImageFormatter, null),
|
|
31
|
+
[CellType.FILE]: /*#__PURE__*/React.createElement(FileFormatter, null),
|
|
32
|
+
[CellType.MULTIPLE_SELECT]: /*#__PURE__*/React.createElement(MultipleSelectFormatter, null),
|
|
33
|
+
[CellType.COLLABORATOR]: /*#__PURE__*/React.createElement(CollaboratorFormatter, null),
|
|
34
|
+
[CellType.NUMBER]: /*#__PURE__*/React.createElement(NumberFormatter, null),
|
|
35
|
+
[CellType.DATE]: /*#__PURE__*/React.createElement(DateFormatter, null),
|
|
36
|
+
[CellType.CREATOR]: /*#__PURE__*/React.createElement(CreatorFormatter, null),
|
|
37
|
+
[CellType.CTIME]: /*#__PURE__*/React.createElement(CTimeFormatter, null),
|
|
38
|
+
[CellType.LAST_MODIFIER]: /*#__PURE__*/React.createElement(LastModifierFormatter, null),
|
|
39
|
+
[CellType.MTIME]: /*#__PURE__*/React.createElement(MTimeFormatter, null),
|
|
40
|
+
[CellType.GEOLOCATION]: /*#__PURE__*/React.createElement(GeolocationFormatter, null),
|
|
41
|
+
[CellType.AUTO_NUMBER]: /*#__PURE__*/React.createElement(AutoNumberFormatter, null),
|
|
42
|
+
[CellType.URL]: /*#__PURE__*/React.createElement(UrlFormatter, null),
|
|
43
|
+
[CellType.EMAIL]: /*#__PURE__*/React.createElement(EmailFormatter, null),
|
|
44
|
+
[CellType.DURATION]: /*#__PURE__*/React.createElement(DurationFormatter, null),
|
|
45
|
+
[CellType.RATE]: /*#__PURE__*/React.createElement(RateFormatter, null),
|
|
46
|
+
[CellType.BUTTON]: /*#__PURE__*/React.createElement(ButtonFormatter, null)
|
|
54
47
|
};
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _constants = require("../constants");
|
|
10
|
-
var _baseFormatterConfig = _interopRequireDefault(require("./base-formatter-config"));
|
|
11
|
-
var _LinkFormatter = _interopRequireDefault(require("../LinkFormatter"));
|
|
12
|
-
var _FormulaFormatter = _interopRequireDefault(require("../FormulaFormatter"));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CellType } from '../constants';
|
|
3
|
+
import BaseFormatterConfig from './base-formatter-config';
|
|
4
|
+
import LinkFormatter from '../LinkFormatter';
|
|
5
|
+
import FormulaFormatter from '../FormulaFormatter';
|
|
13
6
|
const FormatterConfig = {
|
|
14
|
-
...
|
|
15
|
-
[
|
|
16
|
-
[
|
|
7
|
+
...BaseFormatterConfig,
|
|
8
|
+
[CellType.FORMULA]: /*#__PURE__*/React.createElement(FormulaFormatter, null),
|
|
9
|
+
[CellType.LINK]: /*#__PURE__*/React.createElement(LinkFormatter, null)
|
|
17
10
|
};
|
|
18
|
-
|
|
11
|
+
export default FormatterConfig;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useClickOutside = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
const useClickOutside = (_ref, deps) => {
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export const useClickOutside = (_ref, deps) => {
|
|
9
3
|
let {
|
|
10
4
|
currDOM,
|
|
11
5
|
onClickOutside
|
|
12
6
|
} = _ref;
|
|
13
|
-
|
|
7
|
+
useEffect(() => {
|
|
14
8
|
const onMousedown = event => {
|
|
15
9
|
if (currDOM && event && currDOM.contains(event.target)) {
|
|
16
10
|
return;
|
|
@@ -24,5 +18,4 @@ const useClickOutside = (_ref, deps) => {
|
|
|
24
18
|
|
|
25
19
|
// eslint-disable-next-line
|
|
26
20
|
}, deps || []);
|
|
27
|
-
};
|
|
28
|
-
exports.useClickOutside = useClickOutside;
|
|
21
|
+
};
|