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,48 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _selectedDepartments = _interopRequireDefault(require("../../../Department-editor/selected-departments"));
|
|
12
|
-
var _departmentMultipleSelect = _interopRequireDefault(require("../../../Department-editor/department-multiple-select"));
|
|
13
|
-
var _constants = require("../../../Department-editor/constants");
|
|
14
|
-
var _commonHooks = require("../../../hooks/common-hooks");
|
|
15
|
-
var _lang = require("../../../lang");
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import SelectedDepartments from '../../../Department-editor/selected-departments';
|
|
4
|
+
import DepartmentMultipleSelect from '../../../Department-editor/department-multiple-select';
|
|
5
|
+
import { DEPARTMENT_SELECT_RANGE_OPTIONS } from '../../../Department-editor/constants';
|
|
6
|
+
import { useClickOutside } from '../../../hooks/common-hooks';
|
|
7
|
+
import { getLocale } from '../../../lang';
|
|
16
8
|
function DepartmentMultipleSelectFilter(props) {
|
|
17
9
|
const {
|
|
18
10
|
value,
|
|
19
11
|
departments
|
|
20
12
|
} = props;
|
|
21
|
-
const [isShowSelector, setIsShowSelector] =
|
|
22
|
-
const [selectedDepartments, setSelectedDepartments] =
|
|
23
|
-
const selectorRef =
|
|
24
|
-
|
|
13
|
+
const [isShowSelector, setIsShowSelector] = useState(false);
|
|
14
|
+
const [selectedDepartments, setSelectedDepartments] = useState(value || []);
|
|
15
|
+
const selectorRef = useRef(null);
|
|
16
|
+
useClickOutside({
|
|
25
17
|
currDOM: selectorRef.current,
|
|
26
18
|
onClickOutside: () => setIsShowSelector(false)
|
|
27
19
|
}, [selectedDepartments]);
|
|
28
20
|
function renderUserDepartmentOptions() {
|
|
29
|
-
return
|
|
21
|
+
return DEPARTMENT_SELECT_RANGE_OPTIONS.slice(0, 2).map((option, index) => {
|
|
30
22
|
const {
|
|
31
23
|
type,
|
|
32
24
|
name
|
|
33
25
|
} = option;
|
|
34
|
-
return /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
35
27
|
className: "dropdown-item d-flex align-items-center",
|
|
36
28
|
key: index,
|
|
37
29
|
onClick: event => selectDepartment(event, type)
|
|
38
|
-
}, /*#__PURE__*/
|
|
30
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
39
31
|
type: "checkbox",
|
|
40
32
|
className: "vam department-select-input",
|
|
41
33
|
checked: selectedDepartments.includes(type),
|
|
42
34
|
onChange: event => selectDepartment(event, type)
|
|
43
|
-
}), /*#__PURE__*/
|
|
35
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
44
36
|
className: "text-truncate department-name"
|
|
45
|
-
},
|
|
37
|
+
}, getLocale(name)));
|
|
46
38
|
});
|
|
47
39
|
}
|
|
48
40
|
function onSelectToggle(event) {
|
|
@@ -67,25 +59,25 @@ function DepartmentMultipleSelectFilter(props) {
|
|
|
67
59
|
columnOption
|
|
68
60
|
});
|
|
69
61
|
}
|
|
70
|
-
return /*#__PURE__*/
|
|
62
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
71
63
|
ref: selectorRef,
|
|
72
|
-
className: (
|
|
64
|
+
className: classnames('dtable-select custom-select', {
|
|
73
65
|
'focus': isShowSelector
|
|
74
66
|
}),
|
|
75
67
|
onClick: onSelectToggle,
|
|
76
68
|
id: "filter-department-editor"
|
|
77
|
-
}, /*#__PURE__*/
|
|
69
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
78
70
|
className: "selected-option"
|
|
79
|
-
}, selectedDepartments.length > 0 ? /*#__PURE__*/
|
|
71
|
+
}, selectedDepartments.length > 0 ? /*#__PURE__*/React.createElement("span", {
|
|
80
72
|
className: "selected-option-show"
|
|
81
|
-
}, /*#__PURE__*/
|
|
73
|
+
}, /*#__PURE__*/React.createElement(SelectedDepartments, {
|
|
82
74
|
value: selectedDepartments,
|
|
83
75
|
departments: departments
|
|
84
|
-
})) : /*#__PURE__*/
|
|
76
|
+
})) : /*#__PURE__*/React.createElement("span", {
|
|
85
77
|
className: "select-placeholder"
|
|
86
|
-
},
|
|
78
|
+
}, getLocale('Select_department')), /*#__PURE__*/React.createElement("span", {
|
|
87
79
|
className: "dtable-font dtable-icon-drop-down"
|
|
88
|
-
})), isShowSelector && /*#__PURE__*/
|
|
80
|
+
})), isShowSelector && /*#__PURE__*/React.createElement(DepartmentMultipleSelect, {
|
|
89
81
|
isShowSelectedDepartments: false,
|
|
90
82
|
classNamePrefix: "filter",
|
|
91
83
|
value: selectedDepartments,
|
|
@@ -94,4 +86,4 @@ function DepartmentMultipleSelectFilter(props) {
|
|
|
94
86
|
departments: departments
|
|
95
87
|
}));
|
|
96
88
|
}
|
|
97
|
-
|
|
89
|
+
export default DepartmentMultipleSelectFilter;
|
package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _selectedDepartments = _interopRequireDefault(require("../../../Department-editor/selected-departments"));
|
|
12
|
-
var _departmentSingleSelect = _interopRequireDefault(require("../../../Department-editor/department-single-select"));
|
|
13
|
-
var _constants = require("../../../Department-editor/constants");
|
|
14
|
-
var _commonHooks = require("../../../hooks/common-hooks");
|
|
15
|
-
var _lang = require("../../../lang");
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import SelectedDepartments from '../../../Department-editor/selected-departments';
|
|
4
|
+
import DepartmentSingleSelect from '../../../Department-editor/department-single-select';
|
|
5
|
+
import { DEPARTMENT_SELECT_RANGE_OPTIONS } from '../../../Department-editor/constants';
|
|
6
|
+
import { useClickOutside } from '../../../hooks/common-hooks';
|
|
7
|
+
import { getLocale } from '../../../lang';
|
|
16
8
|
function DepartmentSingleSelectFilter(props) {
|
|
17
9
|
const {
|
|
18
10
|
value,
|
|
@@ -21,33 +13,33 @@ function DepartmentSingleSelectFilter(props) {
|
|
|
21
13
|
departments,
|
|
22
14
|
userDepartmentIdsMap
|
|
23
15
|
} = props;
|
|
24
|
-
const [isShowSelector, setIsShowSelector] =
|
|
25
|
-
const [selectedDepartment, setSelectedDepartment] =
|
|
26
|
-
const selectorRef =
|
|
16
|
+
const [isShowSelector, setIsShowSelector] = useState(false);
|
|
17
|
+
const [selectedDepartment, setSelectedDepartment] = useState(value || '');
|
|
18
|
+
const selectorRef = useRef(null);
|
|
27
19
|
let selectedDepartmentIds = [];
|
|
28
20
|
selectedDepartmentIds.push(value);
|
|
29
|
-
|
|
21
|
+
useClickOutside({
|
|
30
22
|
currDOM: selectorRef.current,
|
|
31
23
|
onClickOutside: () => setIsShowSelector(false)
|
|
32
24
|
}, [selectedDepartment]);
|
|
33
25
|
function renderUserDepartmentOptions(onSelect) {
|
|
34
26
|
if (!roleId) return [];
|
|
35
|
-
return
|
|
27
|
+
return DEPARTMENT_SELECT_RANGE_OPTIONS.slice(0, 2).map((option, index) => {
|
|
36
28
|
const {
|
|
37
29
|
type,
|
|
38
30
|
name
|
|
39
31
|
} = option;
|
|
40
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
41
33
|
className: "dropdown-item department-item d-flex align-items-center",
|
|
42
34
|
key: index,
|
|
43
35
|
onClick: event => onSelect(event, type)
|
|
44
|
-
}, /*#__PURE__*/
|
|
36
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
45
37
|
className: "department-item-left-content d-flex align-items-center"
|
|
46
|
-
}, /*#__PURE__*/
|
|
38
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
47
39
|
className: "text-truncate department-name"
|
|
48
|
-
},
|
|
40
|
+
}, getLocale(name)), selectedDepartment === type && /*#__PURE__*/React.createElement("span", {
|
|
49
41
|
className: "department-check-icon"
|
|
50
|
-
}, /*#__PURE__*/
|
|
42
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
51
43
|
className: "dtable-font dtable-icon-check-mark"
|
|
52
44
|
}))));
|
|
53
45
|
});
|
|
@@ -66,25 +58,25 @@ function DepartmentSingleSelectFilter(props) {
|
|
|
66
58
|
columnOption
|
|
67
59
|
});
|
|
68
60
|
}
|
|
69
|
-
return /*#__PURE__*/
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
70
62
|
ref: selectorRef,
|
|
71
|
-
className: (
|
|
63
|
+
className: classnames('dtable-select custom-select', {
|
|
72
64
|
'focus': isShowSelector
|
|
73
65
|
}),
|
|
74
66
|
onClick: onSelectToggle,
|
|
75
67
|
id: "filter-department-editor"
|
|
76
|
-
}, /*#__PURE__*/
|
|
68
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
77
69
|
className: "selected-option"
|
|
78
|
-
}, value ? /*#__PURE__*/
|
|
70
|
+
}, value ? /*#__PURE__*/React.createElement("span", {
|
|
79
71
|
className: "selected-option-show"
|
|
80
|
-
}, /*#__PURE__*/
|
|
72
|
+
}, /*#__PURE__*/React.createElement(SelectedDepartments, {
|
|
81
73
|
value: selectedDepartmentIds,
|
|
82
74
|
departments: departments
|
|
83
|
-
})) : /*#__PURE__*/
|
|
75
|
+
})) : /*#__PURE__*/React.createElement("span", {
|
|
84
76
|
className: "select-placeholder"
|
|
85
|
-
},
|
|
77
|
+
}, getLocale('Select_department')), /*#__PURE__*/React.createElement("span", {
|
|
86
78
|
className: "dtable-font dtable-icon-drop-down"
|
|
87
|
-
})), isShowSelector && /*#__PURE__*/
|
|
79
|
+
})), isShowSelector && /*#__PURE__*/React.createElement(DepartmentSingleSelect, {
|
|
88
80
|
enableSelectRange: false,
|
|
89
81
|
column: column,
|
|
90
82
|
value: value,
|
|
@@ -94,4 +86,4 @@ function DepartmentSingleSelectFilter(props) {
|
|
|
94
86
|
renderUserDepartmentOptions: renderUserDepartmentOptions
|
|
95
87
|
}));
|
|
96
88
|
}
|
|
97
|
-
|
|
89
|
+
export default DepartmentSingleSelectFilter;
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
require("dayjs/locale/en-gb");
|
|
13
|
-
var _seafileCalendar = _interopRequireDefault(require("@seafile/seafile-calendar"));
|
|
14
|
-
var _Picker = _interopRequireDefault(require("@seafile/seafile-calendar/lib/Picker"));
|
|
15
|
-
var _lang = require("../../lang");
|
|
16
|
-
var _utils = require("../utils");
|
|
17
|
-
require("@seafile/seafile-calendar/assets/index.css");
|
|
18
|
-
let now = (0, _dayjs.default)();
|
|
19
|
-
class FilterCalendar extends _react.Component {
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import dayjs from '../../utils/dayjs';
|
|
3
|
+
import 'dayjs/locale/zh-cn';
|
|
4
|
+
import 'dayjs/locale/en-gb';
|
|
5
|
+
import Calendar from '@seafile/seafile-calendar';
|
|
6
|
+
import DatePicker from '@seafile/seafile-calendar/lib/Picker';
|
|
7
|
+
import { translateCalendar } from '../../lang';
|
|
8
|
+
import { getDateColumnFormat } from '../utils';
|
|
9
|
+
import '@seafile/seafile-calendar/assets/index.css';
|
|
10
|
+
let now = dayjs();
|
|
11
|
+
class FilterCalendar extends Component {
|
|
20
12
|
constructor(props) {
|
|
21
13
|
super(props);
|
|
22
14
|
this.handleMouseDown = e => {
|
|
@@ -80,10 +72,10 @@ class FilterCalendar extends _react.Component {
|
|
|
80
72
|
open: false,
|
|
81
73
|
value: null
|
|
82
74
|
};
|
|
83
|
-
const DataFormat =
|
|
75
|
+
const DataFormat = getDateColumnFormat(props.filterColumn).trim();
|
|
84
76
|
//Minutes and seconds are not supported at present
|
|
85
77
|
this.columnDataFormat = DataFormat.split(' ')[0];
|
|
86
|
-
this.calendarContainerRef =
|
|
78
|
+
this.calendarContainerRef = React.createRef();
|
|
87
79
|
this.defaultCalendarValue = null;
|
|
88
80
|
}
|
|
89
81
|
componentDidMount() {
|
|
@@ -98,10 +90,10 @@ class FilterCalendar extends _react.Component {
|
|
|
98
90
|
now = now.locale('en-gb');
|
|
99
91
|
}
|
|
100
92
|
this.defaultCalendarValue = now.clone();
|
|
101
|
-
if (value && (
|
|
102
|
-
let validValue = (
|
|
93
|
+
if (value && dayjs(value).isValid()) {
|
|
94
|
+
let validValue = dayjs(value).isValid() ? dayjs(value) : dayjs(this.defaultCalendarValue);
|
|
103
95
|
this.setState({
|
|
104
|
-
value: iszhcn ? (
|
|
96
|
+
value: iszhcn ? dayjs(validValue).locale('zh-cn') : dayjs(validValue).locale('en-gb')
|
|
105
97
|
});
|
|
106
98
|
}
|
|
107
99
|
}
|
|
@@ -110,7 +102,7 @@ class FilterCalendar extends _react.Component {
|
|
|
110
102
|
isReadOnly
|
|
111
103
|
} = this.props;
|
|
112
104
|
const state = this.state;
|
|
113
|
-
if (isReadOnly) return /*#__PURE__*/
|
|
105
|
+
if (isReadOnly) return /*#__PURE__*/React.createElement("input", {
|
|
114
106
|
className: "ant-calendar-picker-input ant-input form-control",
|
|
115
107
|
value: state.value ? state.value.format(this.columnDataFormat) : '',
|
|
116
108
|
disabled: true
|
|
@@ -123,13 +115,13 @@ class FilterCalendar extends _react.Component {
|
|
|
123
115
|
color: 'gray',
|
|
124
116
|
fontSize: '12px'
|
|
125
117
|
};
|
|
126
|
-
const clearIcon =
|
|
118
|
+
const clearIcon = React.createElement('i', {
|
|
127
119
|
className: 'item-icon dtable-font dtable-icon-x',
|
|
128
120
|
style: clearStyle
|
|
129
121
|
});
|
|
130
|
-
const calendar = /*#__PURE__*/
|
|
122
|
+
const calendar = /*#__PURE__*/React.createElement(Calendar, {
|
|
131
123
|
className: "dtable-rc-calendar",
|
|
132
|
-
locale:
|
|
124
|
+
locale: translateCalendar(),
|
|
133
125
|
style: {
|
|
134
126
|
zIndex: 1001
|
|
135
127
|
},
|
|
@@ -141,9 +133,9 @@ class FilterCalendar extends _react.Component {
|
|
|
141
133
|
onClear: this.onClear,
|
|
142
134
|
clearIcon: clearIcon
|
|
143
135
|
});
|
|
144
|
-
return /*#__PURE__*/
|
|
136
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
145
137
|
className: "date-picker-container"
|
|
146
|
-
}, /*#__PURE__*/
|
|
138
|
+
}, /*#__PURE__*/React.createElement(DatePicker, {
|
|
147
139
|
calendar: calendar,
|
|
148
140
|
value: state.value,
|
|
149
141
|
onChange: this.onChange,
|
|
@@ -157,19 +149,19 @@ class FilterCalendar extends _react.Component {
|
|
|
157
149
|
let {
|
|
158
150
|
value
|
|
159
151
|
} = _ref;
|
|
160
|
-
return /*#__PURE__*/
|
|
152
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
161
153
|
tabIndex: "0",
|
|
162
154
|
onFocus: this.onReadOnlyFocus
|
|
163
|
-
}, /*#__PURE__*/
|
|
155
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
164
156
|
tabIndex: "-1",
|
|
165
157
|
readOnly: true,
|
|
166
158
|
className: "ant-calendar-picker-input ant-input form-control",
|
|
167
159
|
value: value ? value.format(this.columnDataFormat) : '',
|
|
168
160
|
onMouseDown: this.handleMouseDown
|
|
169
|
-
}), /*#__PURE__*/
|
|
161
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
170
162
|
ref: this.calendarContainerRef
|
|
171
163
|
}));
|
|
172
164
|
}));
|
|
173
165
|
}
|
|
174
166
|
}
|
|
175
|
-
|
|
167
|
+
export default FilterCalendar;
|