dtable-ui-component 4.3.7 → 4.3.8
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 +11 -24
- package/lib/ButtonFormatter/index.js +29 -45
- package/lib/CTimeFormatter/index.js +17 -32
- package/lib/CheckboxEditor/index.js +42 -49
- package/lib/CheckboxFormatter/index.js +17 -30
- package/lib/CollaboratorEditor/index.js +118 -135
- package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +90 -99
- package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +61 -69
- package/lib/CollaboratorFormatter/index.js +26 -42
- package/lib/CollaboratorItem/index.js +31 -44
- package/lib/CreatorFormatter/index.js +24 -40
- package/lib/DTableCustomizeCollaboratorSelect/index.js +80 -99
- package/lib/DTableCustomizeCollaboratorSelect/utils.js +12 -13
- package/lib/DTableCustomizeSelect/index.js +92 -103
- package/lib/DTablePopover/index.js +52 -71
- package/lib/DTablePopover/utils.js +1 -1
- package/lib/DTableRadio/index.js +9 -7
- package/lib/DTableSearchInput/index.js +89 -99
- package/lib/DTableSearchInput/utils.js +2 -2
- package/lib/DTableSelect/dtable-select-label.js +5 -3
- package/lib/DTableSelect/index.js +50 -64
- package/lib/DTableSelect/utils.js +36 -41
- package/lib/DTableSwitch/index.js +7 -5
- package/lib/DateEditor/index.js +88 -94
- package/lib/DateEditor/mb-date-editor-popover/index.js +136 -134
- package/lib/DateEditor/pc-date-editor-popover.js +70 -77
- package/lib/DateFormatter/index.js +15 -28
- package/lib/DepartmentSingleSelectFormatter/index.js +9 -9
- package/lib/DigitalSignFormatter/index.js +55 -65
- package/lib/DigitalSignFormatter/utils.js +9 -8
- package/lib/DurationFormatter/index.js +14 -27
- package/lib/EditEditorButton/index.js +10 -22
- package/lib/EmailFormatter/index.js +11 -24
- package/lib/FieldDisplaySetting/field-item.js +18 -20
- package/lib/FieldDisplaySetting/index.js +41 -43
- package/lib/FileEditor/index.js +18 -29
- package/lib/FileFormatter/index.js +29 -43
- package/lib/FileItemFormatter/index.js +17 -32
- package/lib/FileItemFormatter/utils.js +5 -5
- package/lib/FileUploader/index.js +20 -33
- package/lib/FormulaFormatter/cell-value-validator.js +23 -8
- package/lib/FormulaFormatter/index.js +77 -83
- package/lib/FormulaFormatter/utils.js +27 -21
- package/lib/GeolocationFormatter/index.js +19 -32
- package/lib/HtmlLongTextFormatter/index.js +43 -52
- package/lib/HtmlLongTextFormatter/markdown2html.js +2 -2
- package/lib/HtmlLongTextFormatter/unified/index.js +1 -1
- package/lib/HtmlLongTextFormatter/vfile/core.js +10 -10
- package/lib/ImageFormatter/images-lazy-load.js +71 -79
- package/lib/ImageFormatter/index.js +86 -97
- package/lib/ImageFormatter/utils.js +1 -1
- package/lib/ImagePreviewerLightbox/index.js +20 -18
- package/lib/ImagePreviewerLightbox/utils.js +3 -3
- package/lib/LastModifierFormatter/index.js +24 -40
- package/lib/LinkEditor/index.js +163 -167
- package/lib/LinkEditor/link-editor-option.js +41 -56
- package/lib/LinkEditor/mb-link-editor-popover/index.js +90 -99
- package/lib/LinkEditor/pc-link-editor-popover/index.js +63 -71
- package/lib/LinkFormatter/index.js +75 -77
- package/lib/LongTextFormatter/index.js +5 -3
- package/lib/MBEditorHeader/index.js +25 -38
- package/lib/MTimeFormatter/index.js +17 -32
- package/lib/ModalPortal/index.js +15 -32
- package/lib/MultipleSelectEditor/index.js +118 -136
- package/lib/MultipleSelectFormatter/index.js +24 -40
- package/lib/NotificationPopover/index.js +68 -95
- package/lib/NumberEditor/index.js +75 -82
- package/lib/NumberFormatter/index.js +15 -28
- package/lib/RateFormatter/index.js +29 -45
- package/lib/RoleStatusEditor/index.js +20 -22
- package/lib/RowExpandEmailFormatter/index.js +24 -37
- package/lib/RowExpandFileFormatter/index.js +28 -42
- package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +66 -82
- package/lib/RowExpandFormatter/index.js +92 -96
- package/lib/RowExpandFormulaFormatter/index.js +85 -91
- package/lib/RowExpandImageFormatter/index.js +65 -82
- package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +71 -84
- package/lib/RowExpandImageFormatter/utils.js +1 -1
- package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +54 -68
- package/lib/RowExpandLinkFormatter/index.js +131 -137
- package/lib/RowExpandLinkFormatter/utils.js +23 -17
- package/lib/RowExpandLinkFormatter/value-display-utils.js +9 -7
- package/lib/RowExpandRateFormatter/index.js +27 -42
- package/lib/RowExpandUrlFormatter/index.js +27 -40
- package/lib/SelectItem/index.js +17 -33
- package/lib/SelectOptionGroup/index.js +141 -159
- package/lib/SelectOptionGroup/option.js +24 -40
- package/lib/SimpleLongTextFormatter/index.js +55 -67
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +23 -22
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +42 -57
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +31 -46
- package/lib/SingleSelectEditor/index.js +108 -119
- package/lib/SingleSelectFormatter/index.js +21 -37
- package/lib/TextEditor/index.js +45 -51
- package/lib/TextFormatter/index.js +17 -32
- package/lib/UrlFormatter/index.js +11 -24
- package/lib/cellFormatterFactory/index.js +8 -17
- package/lib/common/ClickOutside.js +22 -43
- package/lib/common/delete-tip.js +40 -65
- package/lib/common/modal-portal.js +15 -33
- package/lib/constants/index.js +5 -5
- package/lib/data/dtable-value.js +4 -4
- package/lib/formatterConfig/base-formatter-config.js +24 -3
- package/lib/formatterConfig/index.js +5 -4
- package/lib/lang/index.js +6 -6
- package/lib/locals/de.js +1 -1
- package/lib/locals/en.js +1 -1
- package/lib/locals/fr.js +1 -1
- package/lib/locals/zh-CN.js +1 -1
- package/lib/select-editor/mb-select-editor-popover/index.js +126 -137
- package/lib/select-editor/pc-select-editor-popover/index.js +75 -83
- package/lib/select-editor/select-editor-option.js +41 -56
- package/lib/toaster/alert.js +73 -88
- package/lib/toaster/index.js +1 -1
- package/lib/toaster/toast.js +75 -102
- package/lib/toaster/toastManager.js +55 -91
- package/lib/toaster/toaster.js +58 -57
- package/lib/utils/editor-utils.js +17 -19
- package/lib/utils/utils.js +14 -14
- package/package.json +4 -4
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
1
|
import React from 'react';
|
|
6
2
|
import dayjs from 'dayjs';
|
|
7
3
|
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
|
@@ -9,53 +5,51 @@ import Calendar from '@seafile/seafile-calendar';
|
|
|
9
5
|
import { initDateEditorLanguage } from '../utils/editor-utils';
|
|
10
6
|
import '@seafile/seafile-calendar/assets/index.css';
|
|
11
7
|
import { getLocale } from '../lang';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function PCDateEditorPopover(props) {
|
|
16
|
-
var _this;
|
|
17
|
-
_classCallCheck(this, PCDateEditorPopover);
|
|
18
|
-
_this = _super.call(this, props);
|
|
8
|
+
class PCDateEditorPopover extends React.Component {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
19
11
|
// event trigger sequence: onOpenChange --> onChange
|
|
20
|
-
|
|
12
|
+
this.onChange = value => {
|
|
21
13
|
if (!value) return;
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
let {
|
|
15
|
+
dateFormat
|
|
16
|
+
} = this.props;
|
|
17
|
+
this.setState({
|
|
24
18
|
datePickerValue: value,
|
|
25
19
|
open: true // if value changed, don't close datePicker
|
|
26
20
|
});
|
|
27
|
-
|
|
28
|
-
_this.props.onValueChanged(value.format(dateFormat));
|
|
21
|
+
this.props.onValueChanged(value.format(dateFormat));
|
|
29
22
|
};
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
this.onOpenChange = open => {
|
|
24
|
+
this.setState({
|
|
32
25
|
open: open
|
|
33
26
|
});
|
|
34
27
|
return;
|
|
35
28
|
};
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
this.onClear = () => {
|
|
30
|
+
this.setState({
|
|
38
31
|
datePickerValue: null
|
|
39
32
|
});
|
|
40
33
|
};
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
this.onFocusDatePicker = () => {
|
|
35
|
+
this.setState({
|
|
43
36
|
open: true
|
|
44
37
|
});
|
|
45
38
|
};
|
|
46
|
-
|
|
39
|
+
this.handleMouseDown = event => {
|
|
47
40
|
event.preventDefault();
|
|
48
41
|
event.stopPropagation();
|
|
49
42
|
};
|
|
50
|
-
|
|
51
|
-
return
|
|
43
|
+
this.getCalendarContainer = () => {
|
|
44
|
+
return this.calendarContainerRef.current;
|
|
52
45
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
dateFormat
|
|
56
|
-
showHourAndMinute
|
|
57
|
-
lang
|
|
58
|
-
|
|
46
|
+
this.getCalender = () => {
|
|
47
|
+
let {
|
|
48
|
+
dateFormat,
|
|
49
|
+
showHourAndMinute,
|
|
50
|
+
lang
|
|
51
|
+
} = this.props;
|
|
52
|
+
let defaultValue = dayjs().clone();
|
|
59
53
|
return /*#__PURE__*/React.createElement(Calendar, {
|
|
60
54
|
locale: initDateEditorLanguage(lang),
|
|
61
55
|
style: {
|
|
@@ -67,56 +61,55 @@ var PCDateEditorPopover = /*#__PURE__*/function (_React$Component) {
|
|
|
67
61
|
dateInputPlaceholder: getLocale('Please_input'),
|
|
68
62
|
showDateInput: true,
|
|
69
63
|
focusablePanel: false,
|
|
70
|
-
onClear:
|
|
64
|
+
onClear: this.onClear
|
|
71
65
|
});
|
|
72
66
|
};
|
|
73
|
-
|
|
67
|
+
this.state = {
|
|
74
68
|
open: true,
|
|
75
69
|
datePickerValue: props.value ? dayjs(props.value) : null
|
|
76
70
|
};
|
|
77
|
-
|
|
78
|
-
return _this;
|
|
71
|
+
this.calendarContainerRef = React.createRef();
|
|
79
72
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
value
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
73
|
+
render() {
|
|
74
|
+
let {
|
|
75
|
+
dateFormat
|
|
76
|
+
} = this.props;
|
|
77
|
+
let {
|
|
78
|
+
open,
|
|
79
|
+
datePickerValue
|
|
80
|
+
} = this.state;
|
|
81
|
+
const calendar = this.getCalender();
|
|
82
|
+
return /*#__PURE__*/React.createElement(DatePicker, {
|
|
83
|
+
open: open,
|
|
84
|
+
value: datePickerValue,
|
|
85
|
+
animation: "slide-up",
|
|
86
|
+
style: {
|
|
87
|
+
zIndex: 1001
|
|
88
|
+
},
|
|
89
|
+
calendar: calendar,
|
|
90
|
+
getCalendarContainer: this.getCalendarContainer,
|
|
91
|
+
onChange: this.onChange,
|
|
92
|
+
onOpenChange: this.onOpenChange
|
|
93
|
+
}, _ref => {
|
|
94
|
+
let {
|
|
95
|
+
value
|
|
96
|
+
} = _ref;
|
|
97
|
+
value = value && value.format(dateFormat);
|
|
98
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
99
|
+
className: "dtable-ui-date-editor-container",
|
|
100
|
+
tabIndex: "0",
|
|
101
|
+
onFocus: this.onFocusDatePicker
|
|
102
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
103
|
+
readOnly: true,
|
|
104
|
+
tabIndex: "-1",
|
|
105
|
+
className: "form-control",
|
|
106
|
+
placeholder: getLocale('Please_select'),
|
|
107
|
+
value: value || '',
|
|
108
|
+
onMouseDown: this.handleMouseDown
|
|
109
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
ref: this.calendarContainerRef
|
|
111
|
+
}));
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
122
115
|
export default PCDateEditorPopover;
|
|
@@ -1,36 +1,23 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
1
|
import React from 'react';
|
|
6
2
|
import classnames from 'classnames';
|
|
7
3
|
import { getDateDisplayString } from 'dtable-utils';
|
|
8
4
|
import './index.css';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var _this$props = this.props,
|
|
20
|
-
date = _this$props.value,
|
|
21
|
-
format = _this$props.format,
|
|
22
|
-
containerClassName = _this$props.containerClassName;
|
|
23
|
-
var classname = classnames('dtable-ui cell-formatter-container date-formatter', containerClassName);
|
|
24
|
-
if (date !== '') {
|
|
25
|
-
date = getDateDisplayString(date, format);
|
|
26
|
-
}
|
|
27
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
-
className: classname
|
|
29
|
-
}, date);
|
|
5
|
+
class DateFormatter extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
let {
|
|
8
|
+
value: date,
|
|
9
|
+
format,
|
|
10
|
+
containerClassName
|
|
11
|
+
} = this.props;
|
|
12
|
+
let classname = classnames('dtable-ui cell-formatter-container date-formatter', containerClassName);
|
|
13
|
+
if (date !== '') {
|
|
14
|
+
date = getDateDisplayString(date, format);
|
|
30
15
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: classname
|
|
18
|
+
}, date);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
34
21
|
DateFormatter.defaultProps = {
|
|
35
22
|
value: '',
|
|
36
23
|
format: 'YYYY-MM-DD',
|
|
@@ -2,16 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import './index.css';
|
|
4
4
|
function DepartmentSingleSelectFormatter(props) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const {
|
|
6
|
+
value,
|
|
7
|
+
departments,
|
|
8
|
+
containerClassName,
|
|
9
|
+
tip
|
|
10
|
+
} = props;
|
|
9
11
|
if (!value) return null;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
var name = department ? department.name : deletedTip;
|
|
12
|
+
const deletedTip = tip || 'Deleted department';
|
|
13
|
+
const department = departments.find(department => department.id === value);
|
|
14
|
+
const name = department ? department.name : deletedTip;
|
|
15
15
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
16
|
className: classnames('dtable-ui cell-formatter-container department-single-select-formatter text-truncate', containerClassName)
|
|
17
17
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
1
|
import React, { Component } from 'react';
|
|
6
2
|
import classnames from 'classnames';
|
|
7
3
|
import ImagesLazyLoad from '../ImageFormatter/images-lazy-load';
|
|
@@ -9,87 +5,81 @@ import ImagePreviewerLightbox from '../ImagePreviewerLightbox';
|
|
|
9
5
|
import { getDigitalSignImageUrl } from './utils';
|
|
10
6
|
import { downloadFile } from '../utils/utils';
|
|
11
7
|
import './index.css';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _this$props = _this.props,
|
|
21
|
-
value = _this$props.value,
|
|
22
|
-
config = _this$props.config;
|
|
8
|
+
class DigitalSignFormatter extends Component {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.getSignImages = () => {
|
|
12
|
+
const {
|
|
13
|
+
value,
|
|
14
|
+
config
|
|
15
|
+
} = this.props;
|
|
23
16
|
return [getDigitalSignImageUrl(value, config)].filter(Boolean);
|
|
24
17
|
};
|
|
25
|
-
|
|
26
|
-
if (!
|
|
27
|
-
|
|
18
|
+
this.onClickSignImage = index => {
|
|
19
|
+
if (!this.props.isSupportPreview) return;
|
|
20
|
+
this.setState({
|
|
28
21
|
isPreviewSignImage: true,
|
|
29
22
|
largeSignImageIndex: index
|
|
30
23
|
});
|
|
31
24
|
};
|
|
32
|
-
|
|
33
|
-
if (!
|
|
34
|
-
if (
|
|
35
|
-
|
|
25
|
+
this.hideLargeSignImage = () => {
|
|
26
|
+
if (!this.props.isSupportPreview) return;
|
|
27
|
+
if (this.props.onCloseCallback) {
|
|
28
|
+
this.props.onCloseCallback();
|
|
36
29
|
}
|
|
37
|
-
|
|
30
|
+
this.setState({
|
|
38
31
|
isPreviewSignImage: false,
|
|
39
32
|
largeSignImageIndex: -1
|
|
40
33
|
});
|
|
41
34
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
this.downloadImage = url => {
|
|
36
|
+
let availableUrl = url;
|
|
37
|
+
let rotateIndex = availableUrl.indexOf('?a=');
|
|
45
38
|
if (rotateIndex > -1) {
|
|
46
39
|
availableUrl = availableUrl.slice(0, rotateIndex);
|
|
47
40
|
}
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
const urlSuffix = availableUrl.indexOf('?dl=1');
|
|
42
|
+
const downloadUrl = urlSuffix !== -1 ? availableUrl : availableUrl + '?dl=1';
|
|
50
43
|
downloadFile(downloadUrl);
|
|
51
44
|
};
|
|
52
|
-
|
|
45
|
+
this.state = {
|
|
53
46
|
isPreviewSignImage: false,
|
|
54
47
|
largeSignImageIndex: -1
|
|
55
48
|
};
|
|
56
|
-
return _this;
|
|
57
49
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return DigitalSignFormatter;
|
|
92
|
-
}(Component);
|
|
50
|
+
render() {
|
|
51
|
+
const {
|
|
52
|
+
containerClassName,
|
|
53
|
+
readOnly,
|
|
54
|
+
config,
|
|
55
|
+
isSample
|
|
56
|
+
} = this.props;
|
|
57
|
+
const className = classnames('dtable-ui cell-formatter-container digital-sign-formatter', containerClassName);
|
|
58
|
+
const signImages = this.getSignImages();
|
|
59
|
+
if (signImages.length === 0) return null;
|
|
60
|
+
const {
|
|
61
|
+
isPreviewSignImage,
|
|
62
|
+
largeSignImageIndex
|
|
63
|
+
} = this.state;
|
|
64
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: className
|
|
66
|
+
}, /*#__PURE__*/React.createElement(ImagesLazyLoad, {
|
|
67
|
+
images: signImages,
|
|
68
|
+
server: config.server,
|
|
69
|
+
onImageClick: this.onClickSignImage
|
|
70
|
+
})), isPreviewSignImage && /*#__PURE__*/React.createElement(ImagePreviewerLightbox, {
|
|
71
|
+
className: "digital-sign-formatter-image-previewer",
|
|
72
|
+
readOnly: readOnly,
|
|
73
|
+
server: isSample ? config.server : '',
|
|
74
|
+
imageItems: signImages,
|
|
75
|
+
imageIndex: largeSignImageIndex,
|
|
76
|
+
closeImagePopup: this.hideLargeSignImage,
|
|
77
|
+
downloadImage: this.downloadImage,
|
|
78
|
+
moveToPrevImage: () => {},
|
|
79
|
+
moveToNextImage: () => {}
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
93
83
|
DigitalSignFormatter.defaultProps = {
|
|
94
84
|
isSample: false,
|
|
95
85
|
isSupportPreview: false,
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const getDigitalSignImageUrl = (cellValue, config) => {
|
|
2
2
|
if (!cellValue) return '';
|
|
3
|
-
|
|
3
|
+
const url = cellValue && cellValue.sign_image_url || '';
|
|
4
4
|
if (!url) return '';
|
|
5
5
|
if (!config) return url;
|
|
6
|
-
|
|
7
|
-
server
|
|
8
|
-
workspaceID
|
|
9
|
-
dtableUuid
|
|
6
|
+
const {
|
|
7
|
+
server,
|
|
8
|
+
workspaceID,
|
|
9
|
+
dtableUuid
|
|
10
|
+
} = config || {};
|
|
10
11
|
if (server && (workspaceID || workspaceID === 0) && dtableUuid) {
|
|
11
12
|
return "".concat(server, "/workspace/").concat(workspaceID, "/asset/").concat(dtableUuid).concat(url);
|
|
12
13
|
}
|
|
13
14
|
return url;
|
|
14
15
|
};
|
|
15
|
-
export
|
|
16
|
+
export const isValidDigitalSignImageValue = cellValue => {
|
|
16
17
|
if (!cellValue) return false;
|
|
17
|
-
|
|
18
|
+
const digitalSignImage = cellValue && cellValue.sign_image_url;
|
|
18
19
|
if (!digitalSignImage) return false;
|
|
19
20
|
return true;
|
|
20
21
|
};
|
|
@@ -1,33 +1,20 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
1
|
import React from 'react';
|
|
6
2
|
import classnames from 'classnames';
|
|
7
3
|
import { getDurationDisplayString } from 'dtable-utils';
|
|
8
4
|
import './index.css';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
class DurationFormatter extends React.Component {
|
|
6
|
+
render() {
|
|
7
|
+
let {
|
|
8
|
+
value,
|
|
9
|
+
containerClassName,
|
|
10
|
+
format
|
|
11
|
+
} = this.props;
|
|
12
|
+
let classname = classnames('dtable-ui cell-formatter-container duration-formatter', containerClassName);
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: classname
|
|
15
|
+
}, getDurationDisplayString(value, {
|
|
16
|
+
duration_format: format
|
|
17
|
+
}));
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
key: "render",
|
|
18
|
-
value: function render() {
|
|
19
|
-
var _this$props = this.props,
|
|
20
|
-
value = _this$props.value,
|
|
21
|
-
containerClassName = _this$props.containerClassName,
|
|
22
|
-
format = _this$props.format;
|
|
23
|
-
var classname = classnames('dtable-ui cell-formatter-container duration-formatter', containerClassName);
|
|
24
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
className: classname
|
|
26
|
-
}, getDurationDisplayString(value, {
|
|
27
|
-
duration_format: format
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
}]);
|
|
31
|
-
return DurationFormatter;
|
|
32
|
-
}(React.Component);
|
|
19
|
+
}
|
|
33
20
|
export default DurationFormatter;
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
1
|
import React from 'react';
|
|
6
2
|
import './index.css';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return
|
|
3
|
+
class EditEditorButton extends React.Component {
|
|
4
|
+
render() {
|
|
5
|
+
const {
|
|
6
|
+
text
|
|
7
|
+
} = this.props;
|
|
8
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
9
|
+
className: "dtable-ui-editor-button",
|
|
10
|
+
onClick: this.props.onClick
|
|
11
|
+
}, text);
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
key: "render",
|
|
16
|
-
value: function render() {
|
|
17
|
-
var text = this.props.text;
|
|
18
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
19
|
-
className: "dtable-ui-editor-button",
|
|
20
|
-
onClick: this.props.onClick
|
|
21
|
-
}, text);
|
|
22
|
-
}
|
|
23
|
-
}]);
|
|
24
|
-
return EditEditorButton;
|
|
25
|
-
}(React.Component);
|
|
13
|
+
}
|
|
26
14
|
export default EditEditorButton;
|
|
@@ -1,29 +1,16 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
1
|
import React from 'react';
|
|
6
2
|
import classnames from 'classnames';
|
|
7
3
|
import './index.css';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
class EmailFormatter extends React.Component {
|
|
5
|
+
render() {
|
|
6
|
+
const {
|
|
7
|
+
containerClassName,
|
|
8
|
+
value
|
|
9
|
+
} = this.props;
|
|
10
|
+
let classname = classnames('dtable-ui cell-formatter-container email-formatter', containerClassName);
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: classname
|
|
13
|
+
}, value);
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
key: "render",
|
|
17
|
-
value: function render() {
|
|
18
|
-
var _this$props = this.props,
|
|
19
|
-
containerClassName = _this$props.containerClassName,
|
|
20
|
-
value = _this$props.value;
|
|
21
|
-
var classname = classnames('dtable-ui cell-formatter-container email-formatter', containerClassName);
|
|
22
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
-
className: classname
|
|
24
|
-
}, value);
|
|
25
|
-
}
|
|
26
|
-
}]);
|
|
27
|
-
return EmailFormatter;
|
|
28
|
-
}(React.Component);
|
|
15
|
+
}
|
|
29
16
|
export default EmailFormatter;
|