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,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _DTablePopover = _interopRequireDefault(require("../DTablePopover"));
|
|
11
|
-
var _constants = require("./constants");
|
|
12
|
-
var _departmentSingleSelect = _interopRequireDefault(require("./department-single-select"));
|
|
13
|
-
var _lang = require("../lang");
|
|
14
|
-
require("./index.css");
|
|
15
|
-
class DepartmentSingleSelectEditor extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import DTablePopover from '../DTablePopover';
|
|
3
|
+
import { DEPARTMENT_SELECT_RANGE_OPTIONS } from './constants';
|
|
4
|
+
import DepartmentSingleSelect from './department-single-select';
|
|
5
|
+
import { getLocale } from '../lang';
|
|
6
|
+
import './index.css';
|
|
7
|
+
class DepartmentSingleSelectEditor extends Component {
|
|
16
8
|
constructor(props) {
|
|
17
9
|
super(props);
|
|
18
10
|
this.onCommit = value => {
|
|
@@ -32,16 +24,16 @@ class DepartmentSingleSelectEditor extends _react.Component {
|
|
|
32
24
|
return updated;
|
|
33
25
|
};
|
|
34
26
|
this.createSpecificDepartments = () => {
|
|
35
|
-
return
|
|
27
|
+
return DEPARTMENT_SELECT_RANGE_OPTIONS.slice(0, 2).map(option => {
|
|
36
28
|
const {
|
|
37
29
|
type,
|
|
38
30
|
name
|
|
39
31
|
} = option;
|
|
40
32
|
return {
|
|
41
33
|
value: type,
|
|
42
|
-
label: /*#__PURE__*/
|
|
34
|
+
label: /*#__PURE__*/React.createElement("span", {
|
|
43
35
|
className: "text-truncate department-name"
|
|
44
|
-
},
|
|
36
|
+
}, getLocale(name))
|
|
45
37
|
};
|
|
46
38
|
});
|
|
47
39
|
};
|
|
@@ -83,7 +75,7 @@ class DepartmentSingleSelectEditor extends _react.Component {
|
|
|
83
75
|
userDepartmentIdsMap,
|
|
84
76
|
departments
|
|
85
77
|
} = this.props;
|
|
86
|
-
const dom = /*#__PURE__*/
|
|
78
|
+
const dom = /*#__PURE__*/React.createElement(DepartmentSingleSelect, {
|
|
87
79
|
column: column,
|
|
88
80
|
value: this.state.value,
|
|
89
81
|
enableSelectRange: this.enableSelectRange,
|
|
@@ -92,9 +84,9 @@ class DepartmentSingleSelectEditor extends _react.Component {
|
|
|
92
84
|
departments: departments,
|
|
93
85
|
onCommit: this.onCommit
|
|
94
86
|
});
|
|
95
|
-
return this.isRowExpand ? /*#__PURE__*/
|
|
87
|
+
return this.isRowExpand ? /*#__PURE__*/React.createElement("div", {
|
|
96
88
|
ref: ref => this.outerRef = ref
|
|
97
|
-
}, /*#__PURE__*/
|
|
89
|
+
}, /*#__PURE__*/React.createElement(DTablePopover, {
|
|
98
90
|
hideArrow: true,
|
|
99
91
|
popoverClassName: "select-editor-popover",
|
|
100
92
|
target: target,
|
|
@@ -104,4 +96,4 @@ class DepartmentSingleSelectEditor extends _react.Component {
|
|
|
104
96
|
}, dom)) : dom;
|
|
105
97
|
}
|
|
106
98
|
}
|
|
107
|
-
|
|
99
|
+
export default DepartmentSingleSelectEditor;
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _dtableUtils = require("dtable-utils");
|
|
10
|
-
var _constants = require("../constants");
|
|
11
|
-
var _lang = require("../../lang");
|
|
12
|
-
require("./index.css");
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { DEPARTMENT_SELECT_RANGE_MAP } from 'dtable-utils';
|
|
3
|
+
import { DEPARTMENT_SELECT_RANGE_OPTIONS } from '../constants';
|
|
4
|
+
import { getLocale } from '../../lang';
|
|
5
|
+
import './index.css';
|
|
13
6
|
function SelectedDepartments(props) {
|
|
14
7
|
const {
|
|
15
8
|
value,
|
|
@@ -17,7 +10,7 @@ function SelectedDepartments(props) {
|
|
|
17
10
|
isShowRemoveIcon,
|
|
18
11
|
departments
|
|
19
12
|
} = props;
|
|
20
|
-
const idDepartmentMap =
|
|
13
|
+
const idDepartmentMap = useMemo(() => {
|
|
21
14
|
let idDepartmentMap = {};
|
|
22
15
|
departments.forEach(department => {
|
|
23
16
|
idDepartmentMap[department.id] = department;
|
|
@@ -25,12 +18,12 @@ function SelectedDepartments(props) {
|
|
|
25
18
|
return idDepartmentMap;
|
|
26
19
|
}, [departments]);
|
|
27
20
|
const dom = Array.isArray(value) ? value.map((content, index) => {
|
|
28
|
-
if ([
|
|
29
|
-
const name =
|
|
30
|
-
return /*#__PURE__*/
|
|
21
|
+
if ([DEPARTMENT_SELECT_RANGE_MAP.CURRENT_USER_DEPARTMENT, DEPARTMENT_SELECT_RANGE_MAP.CURRENT_USER_DEPARTMENT_AND_SUB].includes(content)) {
|
|
22
|
+
const name = getLocale(DEPARTMENT_SELECT_RANGE_OPTIONS.find(option => option.type === content).name);
|
|
23
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
24
|
key: "department-".concat(index),
|
|
32
25
|
className: "department mr-1"
|
|
33
|
-
}, /*#__PURE__*/
|
|
26
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
34
27
|
className: "department-name text-truncate",
|
|
35
28
|
title: name,
|
|
36
29
|
"aria-label": name
|
|
@@ -41,41 +34,41 @@ function SelectedDepartments(props) {
|
|
|
41
34
|
const {
|
|
42
35
|
name
|
|
43
36
|
} = department;
|
|
44
|
-
return /*#__PURE__*/
|
|
37
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
45
38
|
key: "department-".concat(index),
|
|
46
39
|
className: "department mr-1"
|
|
47
|
-
}, /*#__PURE__*/
|
|
40
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
48
41
|
className: "department-avatar-container d-flex align-items-center justify-content-center"
|
|
49
|
-
}, /*#__PURE__*/
|
|
42
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
50
43
|
className: "dtable-font dtable-icon-department-single-selection"
|
|
51
|
-
})), /*#__PURE__*/
|
|
44
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
52
45
|
className: "department-name text-truncate",
|
|
53
46
|
title: name,
|
|
54
47
|
"aria-label": name
|
|
55
|
-
}, name), isShowRemoveIcon && /*#__PURE__*/
|
|
48
|
+
}, name), isShowRemoveIcon && /*#__PURE__*/React.createElement("span", {
|
|
56
49
|
className: "remove-container"
|
|
57
|
-
}, /*#__PURE__*/
|
|
50
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
58
51
|
className: "remove-icon",
|
|
59
52
|
onClick: event => removeDepartment(event, content)
|
|
60
|
-
}, /*#__PURE__*/
|
|
53
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
61
54
|
className: "dtable-font dtable-icon-fork-number department-remove-icon"
|
|
62
55
|
}))));
|
|
63
56
|
}
|
|
64
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
65
58
|
key: "department-".concat(index),
|
|
66
59
|
className: "department empty-department mr-1"
|
|
67
|
-
}, /*#__PURE__*/
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
68
61
|
className: "department-avatar-container d-flex align-items-center justify-content-center"
|
|
69
|
-
}, /*#__PURE__*/
|
|
62
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
70
63
|
className: "dtable-font dtable-icon-department-single-selection"
|
|
71
|
-
})), /*#__PURE__*/
|
|
64
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
72
65
|
className: "department-name"
|
|
73
|
-
},
|
|
66
|
+
}, getLocale('Deleted_department')), isShowRemoveIcon && /*#__PURE__*/React.createElement("span", {
|
|
74
67
|
className: "remove-container"
|
|
75
|
-
}, /*#__PURE__*/
|
|
68
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
76
69
|
className: "remove-icon",
|
|
77
70
|
onClick: event => removeDepartment(event, content)
|
|
78
|
-
}, /*#__PURE__*/
|
|
71
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
79
72
|
className: "dtable-font dtable-icon-fork-number department-remove-icon"
|
|
80
73
|
}))));
|
|
81
74
|
}) : null;
|
|
@@ -85,4 +78,4 @@ SelectedDepartments.defaultProps = {
|
|
|
85
78
|
isShowRemoveIcon: false,
|
|
86
79
|
departments: []
|
|
87
80
|
};
|
|
88
|
-
|
|
81
|
+
export default SelectedDepartments;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.searchDepartments = exports.getNormalizedDepartments = void 0;
|
|
7
|
-
const searchDepartments = (departments, searchValue) => {
|
|
1
|
+
export const searchDepartments = (departments, searchValue) => {
|
|
8
2
|
const validSearchValue = searchValue ? searchValue.trim().toLowerCase() : '';
|
|
9
3
|
const validDepartments = Array.isArray(departments) ? departments : [];
|
|
10
4
|
if (!validSearchValue) return validDepartments;
|
|
@@ -16,8 +10,7 @@ const searchDepartments = (departments, searchValue) => {
|
|
|
16
10
|
return name.toString().toLowerCase().indexOf(validSearchValue) > -1;
|
|
17
11
|
});
|
|
18
12
|
};
|
|
19
|
-
|
|
20
|
-
const getNormalizedDepartments = function (departments) {
|
|
13
|
+
export const getNormalizedDepartments = function (departments) {
|
|
21
14
|
let canExpand = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
22
15
|
let parentIdMap = {};
|
|
23
16
|
for (let i = 0; i < departments.length; i++) {
|
|
@@ -33,5 +26,4 @@ const getNormalizedDepartments = function (departments) {
|
|
|
33
26
|
isExpanded
|
|
34
27
|
};
|
|
35
28
|
});
|
|
36
|
-
};
|
|
37
|
-
exports.getNormalizedDepartments = getNormalizedDepartments;
|
|
29
|
+
};
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
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");
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import './index.css';
|
|
11
4
|
function DepartmentSingleSelectFormatter(props) {
|
|
12
5
|
const {
|
|
13
6
|
value,
|
|
@@ -19,14 +12,14 @@ function DepartmentSingleSelectFormatter(props) {
|
|
|
19
12
|
const deletedTip = tip || 'Deleted department';
|
|
20
13
|
const department = departments.find(department => department.id === value);
|
|
21
14
|
const name = department ? department.name : deletedTip;
|
|
22
|
-
return /*#__PURE__*/
|
|
23
|
-
className: (
|
|
24
|
-
}, /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: classnames('dtable-ui cell-formatter-container department-single-select-formatter text-truncate', containerClassName)
|
|
17
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
25
18
|
className: "department-avatar-container d-flex align-items-center justify-content-center"
|
|
26
|
-
}, /*#__PURE__*/
|
|
19
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
27
20
|
className: "dtable-font dtable-icon-department-single-selection"
|
|
28
|
-
})), /*#__PURE__*/
|
|
21
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
29
22
|
className: "department-name text-truncate"
|
|
30
23
|
}, name));
|
|
31
24
|
}
|
|
32
|
-
|
|
25
|
+
export default DepartmentSingleSelectFormatter;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _imagesLazyLoad = _interopRequireDefault(require("../ImageFormatter/images-lazy-load"));
|
|
12
|
-
var _ImagePreviewerLightbox = _interopRequireDefault(require("../ImagePreviewerLightbox"));
|
|
13
|
-
var _utils = require("./utils");
|
|
14
|
-
var _utils2 = require("../utils/utils");
|
|
15
|
-
require("./index.css");
|
|
16
|
-
class DigitalSignFormatter extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import ImagesLazyLoad from '../ImageFormatter/images-lazy-load';
|
|
4
|
+
import ImagePreviewerLightbox from '../ImagePreviewerLightbox';
|
|
5
|
+
import { getDigitalSignImageUrl } from './utils';
|
|
6
|
+
import { downloadFile } from '../utils/utils';
|
|
7
|
+
import './index.css';
|
|
8
|
+
class DigitalSignFormatter extends Component {
|
|
17
9
|
constructor(props) {
|
|
18
10
|
super(props);
|
|
19
11
|
this.getSignImages = () => {
|
|
@@ -21,7 +13,7 @@ class DigitalSignFormatter extends _react.Component {
|
|
|
21
13
|
value,
|
|
22
14
|
config
|
|
23
15
|
} = this.props;
|
|
24
|
-
return [
|
|
16
|
+
return [getDigitalSignImageUrl(value, config)].filter(Boolean);
|
|
25
17
|
};
|
|
26
18
|
this.onClickSignImage = index => {
|
|
27
19
|
if (!this.props.isSupportPreview) return;
|
|
@@ -48,7 +40,7 @@ class DigitalSignFormatter extends _react.Component {
|
|
|
48
40
|
}
|
|
49
41
|
const urlSuffix = availableUrl.indexOf('?dl=1');
|
|
50
42
|
const downloadUrl = urlSuffix !== -1 ? availableUrl : availableUrl + '?dl=1';
|
|
51
|
-
|
|
43
|
+
downloadFile(downloadUrl);
|
|
52
44
|
};
|
|
53
45
|
this.state = {
|
|
54
46
|
isPreviewSignImage: false,
|
|
@@ -62,20 +54,20 @@ class DigitalSignFormatter extends _react.Component {
|
|
|
62
54
|
config,
|
|
63
55
|
isSample
|
|
64
56
|
} = this.props;
|
|
65
|
-
const className = (
|
|
57
|
+
const className = classnames('dtable-ui cell-formatter-container digital-sign-formatter', containerClassName);
|
|
66
58
|
const signImages = this.getSignImages();
|
|
67
59
|
if (signImages.length === 0) return null;
|
|
68
60
|
const {
|
|
69
61
|
isPreviewSignImage,
|
|
70
62
|
largeSignImageIndex
|
|
71
63
|
} = this.state;
|
|
72
|
-
return /*#__PURE__*/
|
|
64
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
73
65
|
className: className
|
|
74
|
-
}, /*#__PURE__*/
|
|
66
|
+
}, /*#__PURE__*/React.createElement(ImagesLazyLoad, {
|
|
75
67
|
images: signImages,
|
|
76
68
|
server: config.server,
|
|
77
69
|
onImageClick: this.onClickSignImage
|
|
78
|
-
})), isPreviewSignImage && /*#__PURE__*/
|
|
70
|
+
})), isPreviewSignImage && /*#__PURE__*/React.createElement(ImagePreviewerLightbox, {
|
|
79
71
|
className: "digital-sign-formatter-image-previewer",
|
|
80
72
|
readOnly: readOnly,
|
|
81
73
|
server: isSample ? config.server : '',
|
|
@@ -96,4 +88,4 @@ DigitalSignFormatter.defaultProps = {
|
|
|
96
88
|
config: {},
|
|
97
89
|
containerClassName: ''
|
|
98
90
|
};
|
|
99
|
-
|
|
91
|
+
export default DigitalSignFormatter;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isValidDigitalSignImageValue = exports.getDigitalSignImageUrl = void 0;
|
|
7
|
-
const getDigitalSignImageUrl = (cellValue, config) => {
|
|
1
|
+
export const getDigitalSignImageUrl = (cellValue, config) => {
|
|
8
2
|
if (!cellValue) return '';
|
|
9
3
|
const url = cellValue && cellValue.sign_image_url || '';
|
|
10
4
|
if (!url) return '';
|
|
@@ -19,11 +13,9 @@ const getDigitalSignImageUrl = (cellValue, config) => {
|
|
|
19
13
|
}
|
|
20
14
|
return url;
|
|
21
15
|
};
|
|
22
|
-
|
|
23
|
-
const isValidDigitalSignImageValue = cellValue => {
|
|
16
|
+
export const isValidDigitalSignImageValue = cellValue => {
|
|
24
17
|
if (!cellValue) return false;
|
|
25
18
|
const digitalSignImage = cellValue && cellValue.sign_image_url;
|
|
26
19
|
if (!digitalSignImage) return false;
|
|
27
20
|
return true;
|
|
28
|
-
};
|
|
29
|
-
exports.isValidDigitalSignImageValue = isValidDigitalSignImageValue;
|
|
21
|
+
};
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _dtableUtils = require("dtable-utils");
|
|
11
|
-
require("./index.css");
|
|
12
|
-
class DurationFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { getDurationDisplayString } from 'dtable-utils';
|
|
4
|
+
import './index.css';
|
|
5
|
+
class DurationFormatter extends React.Component {
|
|
13
6
|
render() {
|
|
14
7
|
let {
|
|
15
8
|
value,
|
|
16
9
|
containerClassName,
|
|
17
10
|
format
|
|
18
11
|
} = this.props;
|
|
19
|
-
let classname = (
|
|
20
|
-
return /*#__PURE__*/
|
|
12
|
+
let classname = classnames('dtable-ui cell-formatter-container duration-formatter', containerClassName);
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
14
|
className: classname
|
|
22
|
-
},
|
|
15
|
+
}, getDurationDisplayString(value, {
|
|
23
16
|
duration_format: format
|
|
24
17
|
}));
|
|
25
18
|
}
|
|
26
19
|
}
|
|
27
|
-
|
|
20
|
+
export default DurationFormatter;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
require("./index.css");
|
|
10
|
-
class EditEditorButton extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
class EditEditorButton extends React.Component {
|
|
11
4
|
render() {
|
|
12
5
|
const {
|
|
13
6
|
text
|
|
14
7
|
} = this.props;
|
|
15
|
-
return /*#__PURE__*/
|
|
8
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
16
9
|
className: "dtable-ui-editor-button",
|
|
17
10
|
onClick: this.props.onClick
|
|
18
11
|
}, text);
|
|
19
12
|
}
|
|
20
13
|
}
|
|
21
|
-
|
|
14
|
+
export default EditEditorButton;
|
|
@@ -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 EmailFormatter extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import './index.css';
|
|
4
|
+
class EmailFormatter 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 email-formatter', containerClassName);
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
12
|
className: classname
|
|
20
13
|
}, value);
|
|
21
14
|
}
|
|
22
15
|
}
|
|
23
|
-
|
|
16
|
+
export default EmailFormatter;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _dtableUtils = require("dtable-utils");
|
|
10
|
-
var _index = require("../index");
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
|
+
import { COLUMNS_ICON_CONFIG } from 'dtable-utils';
|
|
3
|
+
import { DTableSwitch } from '../index';
|
|
11
4
|
function FieldItem(_ref) {
|
|
12
5
|
let {
|
|
13
6
|
field,
|
|
@@ -16,8 +9,8 @@ function FieldItem(_ref) {
|
|
|
16
9
|
onMoveField
|
|
17
10
|
} = _ref;
|
|
18
11
|
let enteredCounter = 0;
|
|
19
|
-
const fieldItemRef =
|
|
20
|
-
const [isItemDropTipShow, setDropTipShow] =
|
|
12
|
+
const fieldItemRef = useRef(null);
|
|
13
|
+
const [isItemDropTipShow, setDropTipShow] = useState(false);
|
|
21
14
|
const handleClickField = e => {
|
|
22
15
|
e.nativeEvent.stopImmediatePropagation();
|
|
23
16
|
const value = e.target.checked;
|
|
@@ -61,30 +54,30 @@ function FieldItem(_ref) {
|
|
|
61
54
|
onMoveField(droppedColumnKey, field.key);
|
|
62
55
|
};
|
|
63
56
|
const placeholder = () => {
|
|
64
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
65
58
|
className: "field-switch"
|
|
66
|
-
}, /*#__PURE__*/
|
|
67
|
-
className: "dtable-font ".concat(
|
|
68
|
-
}), /*#__PURE__*/
|
|
59
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
60
|
+
className: "dtable-font ".concat(COLUMNS_ICON_CONFIG[field.type])
|
|
61
|
+
}), /*#__PURE__*/React.createElement("span", null, field.name));
|
|
69
62
|
};
|
|
70
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
71
64
|
ref: fieldItemRef,
|
|
72
65
|
className: "field-item-container ".concat(isCollapsed ? 'd-none' : ''),
|
|
73
66
|
onDrop: onDrop,
|
|
74
67
|
onDragEnter: onTableDragEnter,
|
|
75
68
|
onDragOver: onDragOver,
|
|
76
69
|
onDragLeave: onDragLeave
|
|
77
|
-
}, /*#__PURE__*/
|
|
70
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
78
71
|
className: "field-dragbar",
|
|
79
72
|
draggable: "true",
|
|
80
73
|
onDragStart: onDragStart
|
|
81
|
-
}, /*#__PURE__*/
|
|
74
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
82
75
|
className: "dtable-font dtable-icon-drag pr-2"
|
|
83
|
-
})), /*#__PURE__*/
|
|
76
|
+
})), /*#__PURE__*/React.createElement(DTableSwitch, {
|
|
84
77
|
checked: field.shown,
|
|
85
78
|
switchClassName: "flex-fill",
|
|
86
79
|
placeholder: placeholder(),
|
|
87
80
|
onChange: handleClickField
|
|
88
81
|
}));
|
|
89
82
|
}
|
|
90
|
-
|
|
83
|
+
export default FieldItem;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _reactstrap = require("reactstrap");
|
|
11
|
-
var _reactTransitionGroup = require("react-transition-group");
|
|
12
|
-
var _fieldItem = _interopRequireDefault(require("./field-item"));
|
|
13
|
-
require("./index.css");
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { Label } from 'reactstrap';
|
|
3
|
+
import { Transition } from 'react-transition-group';
|
|
4
|
+
import FieldItem from './field-item';
|
|
5
|
+
import './index.css';
|
|
14
6
|
const FIELD_ITEM_HEIGHT = 30;
|
|
15
7
|
const BANNER_HEIGHT = 24;
|
|
16
8
|
const DURATION = 300;
|
|
@@ -23,8 +15,8 @@ function FieldDisplaySetting(_ref) {
|
|
|
23
15
|
onMoveField,
|
|
24
16
|
onToggleFieldsVisibility
|
|
25
17
|
} = _ref;
|
|
26
|
-
const nodeRef =
|
|
27
|
-
const [isCollapsed, setCollapsed] =
|
|
18
|
+
const nodeRef = useRef(null);
|
|
19
|
+
const [isCollapsed, setCollapsed] = useState(true);
|
|
28
20
|
const expandAllFields = () => {
|
|
29
21
|
setCollapsed(!isCollapsed);
|
|
30
22
|
};
|
|
@@ -50,37 +42,37 @@ function FieldDisplaySetting(_ref) {
|
|
|
50
42
|
height: 0
|
|
51
43
|
}
|
|
52
44
|
};
|
|
53
|
-
return /*#__PURE__*/
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
46
|
className: "field-setting"
|
|
55
|
-
}, /*#__PURE__*/
|
|
47
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
56
48
|
className: "field-setting-header d-flex align-items-center justify-content-between",
|
|
57
49
|
onClick: expandAllFields
|
|
58
|
-
}, /*#__PURE__*/
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
59
51
|
className: "mb-0"
|
|
60
|
-
}, textProperties.titleValue), /*#__PURE__*/
|
|
52
|
+
}, textProperties.titleValue), /*#__PURE__*/React.createElement("span", {
|
|
61
53
|
className: "dtable-font dtable-icon-right expand-button ".concat(isCollapsed ? '' : 'revolving')
|
|
62
|
-
})), /*#__PURE__*/
|
|
54
|
+
})), /*#__PURE__*/React.createElement(Transition, {
|
|
63
55
|
nodeRef: nodeRef,
|
|
64
56
|
in: !isCollapsed,
|
|
65
57
|
timeout: DURATION
|
|
66
|
-
}, state => /*#__PURE__*/
|
|
58
|
+
}, state => /*#__PURE__*/React.createElement("div", {
|
|
67
59
|
className: "field-setting-wrapper",
|
|
68
60
|
ref: nodeRef,
|
|
69
61
|
style: {
|
|
70
62
|
...defaultStyle,
|
|
71
63
|
...transitionStyles[state]
|
|
72
64
|
}
|
|
73
|
-
}, /*#__PURE__*/
|
|
65
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
74
66
|
className: "field-setting-banner ".concat(isCollapsed ? 'd-none' : 'd-flex', " align-items-center justify-content-between h-5 mt-2 mb-2")
|
|
75
|
-
}, /*#__PURE__*/
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
76
68
|
className: "mb-0"
|
|
77
|
-
}, textProperties.bannerValue), /*#__PURE__*/
|
|
69
|
+
}, textProperties.bannerValue), /*#__PURE__*/React.createElement("span", {
|
|
78
70
|
className: "show-all-button",
|
|
79
71
|
onClick: onToggleFieldsVisibility
|
|
80
|
-
}, fieldAllShown ? textProperties.hideValue : textProperties.showValue)), /*#__PURE__*/
|
|
72
|
+
}, fieldAllShown ? textProperties.hideValue : textProperties.showValue)), /*#__PURE__*/React.createElement("div", {
|
|
81
73
|
className: "field-setting-body"
|
|
82
74
|
}, fields.map((field, index) => {
|
|
83
|
-
return /*#__PURE__*/
|
|
75
|
+
return /*#__PURE__*/React.createElement(FieldItem, {
|
|
84
76
|
key: "".concat(field.key, "-").concat(index),
|
|
85
77
|
field: field,
|
|
86
78
|
isCollapsed: isCollapsed,
|
|
@@ -89,4 +81,4 @@ function FieldDisplaySetting(_ref) {
|
|
|
89
81
|
});
|
|
90
82
|
})))));
|
|
91
83
|
}
|
|
92
|
-
|
|
84
|
+
export default FieldDisplaySetting;
|
package/lib/FileEditor/index.js
CHANGED
|
@@ -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 _reactstrap = require("reactstrap");
|
|
10
|
-
var _lang = require("../lang");
|
|
11
|
-
class FileEditor extends _react.default.Component {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal, ModalHeader, ModalBody } from 'reactstrap';
|
|
3
|
+
import { getLocale } from '../lang';
|
|
4
|
+
class FileEditor extends React.Component {
|
|
12
5
|
constructor(props) {
|
|
13
6
|
super(props);
|
|
14
7
|
this.state = {};
|
|
@@ -17,12 +10,12 @@ class FileEditor extends _react.default.Component {
|
|
|
17
10
|
let {
|
|
18
11
|
closeEditor
|
|
19
12
|
} = this.props;
|
|
20
|
-
return /*#__PURE__*/
|
|
13
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
21
14
|
isOpen: true,
|
|
22
15
|
toggle: closeEditor
|
|
23
|
-
}, /*#__PURE__*/
|
|
16
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
24
17
|
toggle: closeEditor
|
|
25
|
-
},
|
|
18
|
+
}, getLocale('Add_Files')), /*#__PURE__*/React.createElement(ModalBody, {
|
|
26
19
|
className: "file-editor-container"
|
|
27
20
|
}));
|
|
28
21
|
}
|
|
@@ -31,4 +24,4 @@ FileEditor.defaultProps = {
|
|
|
31
24
|
isCheckRepeat: false,
|
|
32
25
|
columnType: 'file'
|
|
33
26
|
};
|
|
34
|
-
|
|
27
|
+
export default FileEditor;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|