dtable-ui-component 6.0.125 → 6.0.126
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/ActionSheet/index.js +14 -16
- package/lib/ActivityIndicator/index.js +7 -8
- package/lib/AsyncUserSelect/index.css +5 -0
- package/lib/AsyncUserSelect/index.js +40 -19
- package/lib/AsyncUserSelect/user-item.js +5 -6
- package/lib/AutoNumberFormatter/index.js +3 -4
- package/lib/Badge/index.js +9 -11
- package/lib/ButtonFormatter/index.js +6 -8
- package/lib/CTimeFormatter/index.js +3 -4
- package/lib/CheckboxEditor/index.js +1 -3
- package/lib/CheckboxEditor/mb-editor.js +9 -20
- package/lib/CheckboxEditor/pc-editor.js +12 -24
- package/lib/CheckboxFormatter/index.js +4 -5
- package/lib/CollaboratorEditor/index.js +2 -4
- package/lib/CollaboratorEditor/mb-editor/index.js +11 -19
- package/lib/CollaboratorEditor/pc-editor/index.js +25 -34
- package/lib/CollaboratorFormatter/index.js +8 -10
- package/lib/CollaboratorItem/index.js +4 -5
- package/lib/CollapsibleSettingLayout/index.js +9 -7
- package/lib/Comment/body/comment.js +10 -18
- package/lib/Comment/body/index.js +2 -4
- package/lib/Comment/footer/btns/index.js +4 -7
- package/lib/Comment/footer/index.js +9 -20
- package/lib/Comment/footer/input/index.js +29 -50
- package/lib/Comment/footer/input/participant/index.js +4 -5
- package/lib/Comment/footer/participants/index.js +4 -5
- package/lib/Comment/footer/participants/participant/index.js +1 -3
- package/lib/Comment/footer/participants/participant-select/index.js +8 -24
- package/lib/Comment/index.js +39 -57
- package/lib/Comment/utils/utilities.js +15 -21
- package/lib/CreatorFormatter/index.js +6 -8
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +23 -19
- package/lib/DTableColorPicker/index.css +0 -2
- package/lib/DTableColorPicker/index.js +56 -41
- package/lib/DTableColorPicker/utils.js +4 -6
- package/lib/DTableColumnIcon/index.js +6 -7
- package/lib/DTableCommonAddTool/index.css +1 -3
- package/lib/DTableCommonAddTool/index.js +6 -8
- package/lib/DTableCustomFooter/index.css +1 -3
- package/lib/DTableCustomFooter/index.js +1 -3
- package/lib/DTableCustomizeCollaboratorSelect/index.js +17 -20
- package/lib/DTableCustomizeSelect/index.js +19 -24
- package/lib/DTableDropdownItem/index.js +16 -18
- package/lib/DTableDropdownMenu/index.js +8 -10
- package/lib/DTableEmptyTip/index.js +4 -5
- package/lib/DTableFiltersPopover/index.css +0 -2
- package/lib/DTableFiltersPopover/index.js +26 -41
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +1 -3
- package/lib/DTableFiltersPopover/utils/index.js +63 -113
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +8 -9
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +16 -13
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +18 -15
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +8 -14
- package/lib/DTableFiltersPopover/widgets/filter-group.js +34 -55
- package/lib/DTableFiltersPopover/widgets/filter-item.js +107 -170
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +136 -161
- package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -20
- package/lib/DTableGroupSelect/index.js +11 -15
- package/lib/DTableGroupSelect/select-option-group.js +23 -32
- package/lib/DTableIcon/index.js +6 -7
- package/lib/DTableIcon/svg-icon.js +5 -7
- package/lib/DTableModalHeader/index.js +1 -3
- package/lib/DTablePopover/index.js +13 -16
- package/lib/DTableRadio/index.js +10 -9
- package/lib/DTableRadioGroup/index.js +8 -17
- package/lib/DTableSearchInput/index.js +19 -29
- package/lib/DTableSelect/dtable-select-label.js +6 -5
- package/lib/DTableSelect/index.js +21 -22
- package/lib/DTableSelect/utils.js +7 -15
- package/lib/DTableSubDropdownMenu/index.js +8 -10
- package/lib/DTableSubDropdownToggle/index.js +12 -12
- package/lib/DTableSwitch/index.css +0 -1
- package/lib/DTableSwitch/index.js +12 -11
- package/lib/DTableToolTip/index.js +7 -8
- package/lib/DateEditor/index.js +20 -15
- package/lib/DateEditor/mb-editor/index.js +18 -31
- package/lib/DateEditor/pc-editor.js +26 -45
- package/lib/DateFormatter/index.js +4 -5
- package/lib/DatePicker/index.js +9 -15
- package/lib/DatePicker/utils.js +1 -3
- package/lib/DeleteTip/index.js +5 -6
- package/lib/DepartmentMultipleSelectEditor/index.js +25 -23
- package/lib/DepartmentSelectFilter/index.js +6 -8
- package/lib/DepartmentSingleSelectEditor/index.js +1 -3
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +48 -47
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +36 -58
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +13 -19
- package/lib/DepartmentSingleSelectFormatter/index.js +4 -6
- package/lib/DigitalSignEditor/index.js +1 -3
- package/lib/DigitalSignEditor/mb-editor/index.js +12 -20
- package/lib/DigitalSignEditor/pc-editor/index.js +17 -24
- package/lib/DigitalSignEditor/service.js +2 -4
- package/lib/DigitalSignEditor/signature-board/index.js +5 -8
- package/lib/DigitalSignEditor/utils.js +2 -4
- package/lib/DigitalSignFormatter/index.js +12 -15
- package/lib/DigitalSignFormatter/utils.js +4 -5
- package/lib/DurationEditor/index.js +21 -31
- package/lib/DurationFormatter/index.js +4 -5
- package/lib/EditEditorButton/index.js +1 -3
- package/lib/EmailFormatter/index.js +3 -4
- package/lib/FieldDisplaySetting/field-item.js +12 -12
- package/lib/FieldDisplaySetting/index.js +11 -9
- package/lib/FileEditor/files-previewer/index.js +1 -3
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +10 -18
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +7 -8
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +3 -4
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +5 -6
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +14 -21
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +29 -57
- package/lib/FileEditor/index.js +1 -3
- package/lib/FileEditor/mb-editor/index.js +28 -20
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -3
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +11 -25
- package/lib/FileEditor/pc-editor/index.js +19 -27
- package/lib/FileFormatter/index.js +26 -19
- package/lib/FileItemFormatter/index.js +6 -9
- package/lib/FileUploader/index.js +28 -45
- package/lib/FormulaFormatter/index.js +15 -29
- package/lib/GeolocationEditor/index.js +11 -12
- package/lib/GeolocationEditor/map-editor-utils.js +17 -15
- package/lib/GeolocationEditor/mb-editor/country-editor.js +17 -14
- package/lib/GeolocationEditor/mb-editor/index.js +4 -6
- package/lib/GeolocationEditor/mb-editor/location-editor.js +18 -15
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +41 -68
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +50 -89
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +17 -14
- package/lib/GeolocationEditor/mb-editor/province-editor.js +17 -14
- package/lib/GeolocationEditor/pc-editor/country-editor.js +10 -23
- package/lib/GeolocationEditor/pc-editor/index.js +12 -20
- package/lib/GeolocationEditor/pc-editor/location-editor.js +26 -31
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +34 -54
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +36 -60
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +35 -62
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +36 -65
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +19 -25
- package/lib/GeolocationEditor/pc-editor/province-editor.js +6 -13
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +5 -6
- package/lib/GeolocationEditor/pc-editor/selector-list.js +6 -7
- package/lib/GeolocationFormatter/index.js +4 -5
- package/lib/HtmlLongTextFormatter/index.js +4 -12
- package/lib/Icon/index.js +3 -5
- package/lib/IconButton/index.js +4 -6
- package/lib/ImageEditor/images-previewer/image-preview/index.js +12 -21
- package/lib/ImageEditor/images-previewer/index.js +3 -9
- package/lib/ImageEditor/index.js +1 -3
- package/lib/ImageEditor/mb-editor/index.js +28 -20
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +2 -6
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +1 -3
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +7 -21
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +3 -9
- package/lib/ImageEditor/pc-editor/index.js +11 -16
- package/lib/ImageFormatter/images-lazy-load.js +19 -11
- package/lib/ImageFormatter/index.js +11 -13
- package/lib/ImagePreviewerLightbox/index.js +15 -13
- package/lib/ImageThumbnail/index.js +10 -13
- package/lib/InputItem/custom-input.js +26 -46
- package/lib/InputItem/custom-keyboard.js +15 -18
- package/lib/InputItem/index.js +34 -50
- package/lib/InputItem/input.js +2 -4
- package/lib/LastModifierFormatter/index.js +6 -8
- package/lib/LinkEditor/index.js +33 -53
- package/lib/LinkEditor/link-editor-option.js +3 -4
- package/lib/LinkEditor/mb-popover/index.js +9 -22
- package/lib/LinkEditor/pc-popover/index.js +5 -10
- package/lib/LinkFormatter/index.js +21 -37
- package/lib/List/index.js +6 -8
- package/lib/List/list-item.js +22 -28
- package/lib/LongTextFormatter/index.js +4 -5
- package/lib/MBEditorHeader/index.js +7 -8
- package/lib/MTimeFormatter/index.js +3 -4
- package/lib/MobileFullScreenPage/body/index.js +3 -5
- package/lib/MobileFullScreenPage/header/index.js +4 -6
- package/lib/MobileFullScreenPage/index.js +13 -11
- package/lib/MobileModal/index.js +1 -3
- package/lib/MobileOperationSheet/index.js +7 -8
- package/lib/MobileSelector/empty/index.js +1 -3
- package/lib/MobileSelector/index.js +5 -7
- package/lib/MobileSelector/option/index.js +3 -5
- package/lib/MobileSelector/options/index.js +1 -3
- package/lib/MobileSelector/search/index.js +3 -5
- package/lib/MobileUpload/index.js +4 -5
- package/lib/Modal/modal.js +14 -15
- package/lib/Modal/prompt.js +4 -4
- package/lib/MultipleSelectEditor/index.js +1 -3
- package/lib/MultipleSelectFormatter/index.js +6 -8
- package/lib/NotificationPopover/index.css +1 -6
- package/lib/NotificationPopover/index.js +6 -7
- package/lib/NumberEditor/index.js +12 -21
- package/lib/NumberFormatter/index.js +4 -5
- package/lib/PhoneNumberLink/index.js +2 -4
- package/lib/Picker/AbstractPicker.js +23 -27
- package/lib/Popover/index.js +3 -4
- package/lib/Popover/item.js +7 -9
- package/lib/Progress/index.js +9 -8
- package/lib/Radio/Radio.js +4 -8
- package/lib/Radio/RadioItem.js +8 -12
- package/lib/RateFormatter/index.js +13 -13
- package/lib/RoleStatusEditor/index.js +18 -17
- package/lib/RowExpandDialog/body/index.js +32 -49
- package/lib/RowExpandDialog/column-content/index.js +5 -9
- package/lib/RowExpandDialog/header/index.js +6 -8
- package/lib/RowExpandDialog/index.js +49 -34
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +4 -5
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +8 -10
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +22 -33
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +26 -40
- package/lib/RowExpandEditor/date-editor/mb-editor.js +12 -18
- package/lib/RowExpandEditor/date-editor/pc-editor.js +15 -20
- package/lib/RowExpandEditor/department-editor/mb-editor.js +16 -11
- package/lib/RowExpandEditor/department-editor/pc-editor.js +19 -14
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +20 -34
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +21 -35
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +10 -17
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +13 -19
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +9 -19
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +13 -24
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +18 -31
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +16 -23
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +17 -29
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +13 -26
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +15 -25
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +13 -23
- package/lib/RowExpandEditor/index.js +4 -8
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +17 -18
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +10 -16
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +16 -23
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +11 -19
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +22 -33
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +8 -14
- package/lib/RowExpandEditor/number-editor/pc-editor.js +13 -20
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +12 -25
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +20 -36
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +17 -28
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +22 -34
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +4 -5
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +15 -26
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +5 -13
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +9 -18
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +2 -4
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +2 -4
- package/lib/RowExpandFormatter/email-formatter/index.js +4 -7
- package/lib/RowExpandFormatter/file-formatter/index.js +8 -9
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +10 -12
- package/lib/RowExpandFormatter/formula-formatter/index.js +19 -34
- package/lib/RowExpandFormatter/image-formatter/index.js +9 -11
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +7 -8
- package/lib/RowExpandFormatter/index.js +27 -41
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +8 -14
- package/lib/RowExpandFormatter/link-formatter/index.js +11 -19
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +3 -5
- package/lib/RowExpandFormatter/rate-formatter/index.js +11 -12
- package/lib/RowExpandFormatter/text/index.js +4 -5
- package/lib/RowExpandFormatter/url-formatter/index.js +4 -7
- package/lib/RowExpandView/body/index.js +22 -35
- package/lib/RowExpandView/column-content/index.js +3 -7
- package/lib/RowExpandView/index.js +42 -30
- package/lib/SelectItem/index.js +5 -7
- package/lib/SelectOptionGroup/index.css +3 -3
- package/lib/SelectOptionGroup/index.js +31 -40
- package/lib/SelectedDepartments/index.js +7 -9
- package/lib/SimpleLongTextFormatter/index.js +10 -16
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +3 -4
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +12 -21
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -4
- package/lib/SingleSelectEditor/index.js +1 -3
- package/lib/SingleSelectFormatter/index.js +8 -9
- package/lib/TabBar/Tab.js +14 -16
- package/lib/TabBar/index.js +18 -21
- package/lib/Tabs/index.js +1 -3
- package/lib/TextEditor/index.js +14 -23
- package/lib/TextFormatter/index.js +3 -4
- package/lib/TextareaItem/index.js +19 -26
- package/lib/Toast/index.js +3 -4
- package/lib/UrlFormatter/index.js +3 -4
- package/lib/common/editor-base.js +7 -12
- package/lib/hooks/common-hooks.js +2 -4
- package/lib/select-editor/index.js +1 -3
- package/lib/select-editor/mb-editor/index.js +17 -28
- package/lib/select-editor/pc-editor/index.js +27 -42
- package/lib/toaster/alert.js +6 -7
- package/lib/toaster/toast.js +2 -3
- package/lib/toaster/toastManager.js +2 -4
- package/lib/utils/cell.js +8 -11
- package/lib/utils/column-utils.js +8 -14
- package/lib/utils/departments.js +1 -3
- package/lib/utils/url.js +24 -31
- package/lib/utils/utils.js +2 -6
- package/package.json +8 -8
|
@@ -29,10 +29,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
29
29
|
constructor(props) {
|
|
30
30
|
super(props);
|
|
31
31
|
this.updateFilters = _ref => {
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
filters
|
|
35
|
-
} = _ref;
|
|
32
|
+
let filter_conjunction = _ref.filter_conjunction,
|
|
33
|
+
filters = _ref.filters;
|
|
36
34
|
const filterConjunction = filter_conjunction || this.state.filterConjunction;
|
|
37
35
|
if (this.isNeedSubmit) {
|
|
38
36
|
const isSubmitDisabled = false;
|
|
@@ -54,12 +52,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
54
52
|
});
|
|
55
53
|
};
|
|
56
54
|
this.addFilter = () => {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
} = this.props;
|
|
60
|
-
const {
|
|
61
|
-
filters
|
|
62
|
-
} = this.state;
|
|
55
|
+
const columns = this.props.columns;
|
|
56
|
+
const filters = this.state.filters;
|
|
63
57
|
const newFilter = (0, _utils.getDefaultFilter)(columns);
|
|
64
58
|
if (!newFilter) {
|
|
65
59
|
return;
|
|
@@ -69,12 +63,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
69
63
|
});
|
|
70
64
|
};
|
|
71
65
|
this.addFilterGroup = () => {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
} = this.props;
|
|
75
|
-
const {
|
|
76
|
-
filters
|
|
77
|
-
} = this.state;
|
|
66
|
+
const columns = this.props.columns;
|
|
67
|
+
const filters = this.state.filters;
|
|
78
68
|
const newFilterGroup = (0, _utils.getDefaultFilterGroup)(columns);
|
|
79
69
|
if (!newFilterGroup) {
|
|
80
70
|
return;
|
|
@@ -87,10 +77,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
87
77
|
this.props.hidePopover();
|
|
88
78
|
};
|
|
89
79
|
this.onSubmitFilters = () => {
|
|
90
|
-
const
|
|
91
|
-
filters,
|
|
92
|
-
filterConjunction
|
|
93
|
-
} = this.state;
|
|
80
|
+
const _this$state = this.state,
|
|
81
|
+
filters = _this$state.filters,
|
|
82
|
+
filterConjunction = _this$state.filterConjunction;
|
|
94
83
|
const update = {
|
|
95
84
|
filters,
|
|
96
85
|
filter_conjunction: filterConjunction
|
|
@@ -101,12 +90,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
101
90
|
this.onPopoverInsideClick = e => {
|
|
102
91
|
e.stopPropagation();
|
|
103
92
|
};
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
isNeedSubmit
|
|
109
|
-
} = props;
|
|
93
|
+
const _filterConjunction = props.filterConjunction,
|
|
94
|
+
_filters = props.filters,
|
|
95
|
+
_columns = props.columns,
|
|
96
|
+
isNeedSubmit = props.isNeedSubmit;
|
|
110
97
|
this.state = {
|
|
111
98
|
filters: (0, _dtableUtils.getValidFilters)(_filters, _columns),
|
|
112
99
|
filterConjunction: _constants.SUPPORT_CONJUNCTIONS.includes(_filterConjunction) ? _filterConjunction : _dtableUtils.FILTER_CONJUNCTION_TYPE.AND,
|
|
@@ -115,21 +102,19 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
115
102
|
this.isNeedSubmit = isNeedSubmit;
|
|
116
103
|
}
|
|
117
104
|
render() {
|
|
118
|
-
const
|
|
119
|
-
target,
|
|
120
|
-
columns,
|
|
121
|
-
placement,
|
|
122
|
-
isSupportAdvanced,
|
|
123
|
-
departments,
|
|
124
|
-
lang,
|
|
125
|
-
readOnly,
|
|
126
|
-
userDepartmentIdsMap,
|
|
127
|
-
firstDayOfWeek
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
filterConjunction
|
|
132
|
-
} = this.state;
|
|
105
|
+
const _this$props = this.props,
|
|
106
|
+
target = _this$props.target,
|
|
107
|
+
columns = _this$props.columns,
|
|
108
|
+
placement = _this$props.placement,
|
|
109
|
+
isSupportAdvanced = _this$props.isSupportAdvanced,
|
|
110
|
+
departments = _this$props.departments,
|
|
111
|
+
lang = _this$props.lang,
|
|
112
|
+
readOnly = _this$props.readOnly,
|
|
113
|
+
userDepartmentIdsMap = _this$props.userDepartmentIdsMap,
|
|
114
|
+
firstDayOfWeek = _this$props.firstDayOfWeek;
|
|
115
|
+
const _this$state2 = this.state,
|
|
116
|
+
filters = _this$state2.filters,
|
|
117
|
+
filterConjunction = _this$state2.filterConjunction;
|
|
133
118
|
const canAddFilter = columns.length > 0;
|
|
134
119
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTablePopover.default, {
|
|
135
120
|
target: target,
|
|
@@ -18,10 +18,8 @@ const isArrayFilterTermByArrayType = array_type => {
|
|
|
18
18
|
return _dtableUtils.COLLABORATOR_COLUMN_TYPES.includes(array_type) || array_type === _dtableUtils.CellType.SINGLE_SELECT || array_type === _dtableUtils.CellType.MULTIPLE_SELECT;
|
|
19
19
|
};
|
|
20
20
|
const isFilterTermArray = (column, filterPredicate) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
data
|
|
24
|
-
} = column;
|
|
21
|
+
const type = column.type,
|
|
22
|
+
data = column.data;
|
|
25
23
|
if (_constants.MULTIPLE_SELECTOR_COLUMNS.includes(type)) {
|
|
26
24
|
return true;
|
|
27
25
|
}
|
|
@@ -29,17 +27,15 @@ const isFilterTermArray = (column, filterPredicate) => {
|
|
|
29
27
|
return true;
|
|
30
28
|
}
|
|
31
29
|
if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type]) {
|
|
32
|
-
const {
|
|
33
|
-
result_type,
|
|
34
|
-
array_type
|
|
35
|
-
} = data || {};
|
|
30
|
+
const _ref = data || {},
|
|
31
|
+
result_type = _ref.result_type,
|
|
32
|
+
array_type = _ref.array_type;
|
|
36
33
|
if (result_type !== _dtableUtils.FORMULA_RESULT_TYPE.ARRAY) return false;
|
|
37
34
|
return isArrayFilterTermByArrayType(array_type);
|
|
38
35
|
}
|
|
39
36
|
if (type === _dtableUtils.CellType.LINK) {
|
|
40
|
-
const {
|
|
41
|
-
array_type
|
|
42
|
-
} = data || {};
|
|
37
|
+
const _ref2 = data || {},
|
|
38
|
+
array_type = _ref2.array_type;
|
|
43
39
|
return isArrayFilterTermByArrayType(array_type);
|
|
44
40
|
}
|
|
45
41
|
return false;
|
|
@@ -47,10 +43,8 @@ const isFilterTermArray = (column, filterPredicate) => {
|
|
|
47
43
|
exports.isFilterTermArray = isFilterTermArray;
|
|
48
44
|
const getUpdatedFilterByCreator = (filter, collaborator) => {
|
|
49
45
|
const multipleSelectType = [_dtableUtils.FILTER_PREDICATE_TYPE.CONTAINS, _dtableUtils.FILTER_PREDICATE_TYPE.NOT_CONTAIN];
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
filter_term: filterTerm
|
|
53
|
-
} = filter;
|
|
46
|
+
let filter_predicate = filter.filter_predicate,
|
|
47
|
+
filterTerm = filter.filter_term;
|
|
54
48
|
if (multipleSelectType.includes(filter_predicate)) {
|
|
55
49
|
filterTerm = filterTerm ? filter.filter_term.slice(0) : [];
|
|
56
50
|
let selectedEmail = collaborator.email;
|
|
@@ -124,18 +118,15 @@ const getUpdatedFilterByRate = (filter, value) => {
|
|
|
124
118
|
};
|
|
125
119
|
exports.getUpdatedFilterByRate = getUpdatedFilterByRate;
|
|
126
120
|
const getColumnOptions = column => {
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
data
|
|
130
|
-
} = column;
|
|
121
|
+
const type = column.type,
|
|
122
|
+
data = column.data;
|
|
131
123
|
if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type]) {
|
|
132
124
|
return getFormulaColumnFilterOptions(column);
|
|
133
125
|
}
|
|
134
126
|
if (type === _dtableUtils.CellType.LINK) {
|
|
135
|
-
const {
|
|
136
|
-
array_type,
|
|
137
|
-
array_data
|
|
138
|
-
} = data || {};
|
|
127
|
+
const _ref3 = data || {},
|
|
128
|
+
array_type = _ref3.array_type,
|
|
129
|
+
array_data = _ref3.array_data;
|
|
139
130
|
if (array_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
140
131
|
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
141
132
|
type: _dtableUtils.CellType.CHECKBOX
|
|
@@ -152,14 +143,11 @@ const getColumnOptions = column => {
|
|
|
152
143
|
};
|
|
153
144
|
exports.getColumnOptions = getColumnOptions;
|
|
154
145
|
const getFormulaColumnFilterOptions = column => {
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
array_type,
|
|
161
|
-
array_data
|
|
162
|
-
} = data || {};
|
|
146
|
+
const data = column.data;
|
|
147
|
+
const _ref4 = data || {},
|
|
148
|
+
result_type = _ref4.result_type,
|
|
149
|
+
array_type = _ref4.array_type,
|
|
150
|
+
array_data = _ref4.array_data;
|
|
163
151
|
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
164
152
|
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
165
153
|
type: _dtableUtils.CellType.CHECKBOX
|
|
@@ -215,9 +203,7 @@ const getFilterOptionsByArrayType = (array_type, array_data) => {
|
|
|
215
203
|
type: _dtableUtils.CellType.TEXT,
|
|
216
204
|
data: array_data
|
|
217
205
|
});
|
|
218
|
-
const
|
|
219
|
-
filterPredicateList
|
|
220
|
-
} = filterOptions;
|
|
206
|
+
const filterPredicateList = filterOptions.filterPredicateList;
|
|
221
207
|
if (filterPredicateList && !filterPredicateList.includes(_dtableUtils.FILTER_PREDICATE_TYPE.EMPTY)) {
|
|
222
208
|
filterPredicateList.push(_dtableUtils.FILTER_PREDICATE_TYPE.EMPTY);
|
|
223
209
|
}
|
|
@@ -228,13 +214,10 @@ const getFilterOptionsByArrayType = (array_type, array_data) => {
|
|
|
228
214
|
};
|
|
229
215
|
const getFilterByColumn = function (column) {
|
|
230
216
|
let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
231
|
-
let
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
let {
|
|
236
|
-
filterPredicateList
|
|
237
|
-
} = getColumnOptions(column);
|
|
217
|
+
let columnType = column.type,
|
|
218
|
+
columnData = column.data;
|
|
219
|
+
let _getColumnOptions = getColumnOptions(column),
|
|
220
|
+
filterPredicateList = _getColumnOptions.filterPredicateList;
|
|
238
221
|
if (!filterPredicateList) return;
|
|
239
222
|
let filterPredicate = filterPredicateList[0];
|
|
240
223
|
let updatedFilter = Object.assign({}, filter, {
|
|
@@ -253,9 +236,7 @@ const getFilterByColumn = function (column) {
|
|
|
253
236
|
}
|
|
254
237
|
// rate
|
|
255
238
|
if (columnType === _dtableUtils.CellType.RATE) {
|
|
256
|
-
const
|
|
257
|
-
rate_max_number
|
|
258
|
-
} = columnData;
|
|
239
|
+
const rate_max_number = columnData.rate_max_number;
|
|
259
240
|
updatedFilter.filter_term = rate_max_number;
|
|
260
241
|
return updatedFilter;
|
|
261
242
|
}
|
|
@@ -281,10 +262,9 @@ const getFilterByColumn = function (column) {
|
|
|
281
262
|
}
|
|
282
263
|
// link
|
|
283
264
|
if (columnType === _dtableUtils.CellType.LINK) {
|
|
284
|
-
let {
|
|
285
|
-
array_type,
|
|
286
|
-
array_data
|
|
287
|
-
} = columnData || {};
|
|
265
|
+
let _ref5 = columnData || {},
|
|
266
|
+
array_type = _ref5.array_type,
|
|
267
|
+
array_data = _ref5.array_data;
|
|
288
268
|
if (array_type) {
|
|
289
269
|
if (array_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
290
270
|
array_type = _dtableUtils.CellType.CHECKBOX;
|
|
@@ -308,14 +288,11 @@ const getFilterByColumn = function (column) {
|
|
|
308
288
|
};
|
|
309
289
|
exports.getFilterByColumn = getFilterByColumn;
|
|
310
290
|
const getFormulaColumnFilter = (column, filter) => {
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
array_type,
|
|
317
|
-
array_data
|
|
318
|
-
} = data || {};
|
|
291
|
+
const data = column.data;
|
|
292
|
+
let _ref6 = data || {},
|
|
293
|
+
result_type = _ref6.result_type,
|
|
294
|
+
array_type = _ref6.array_type,
|
|
295
|
+
array_data = _ref6.array_data;
|
|
319
296
|
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY) {
|
|
320
297
|
const linkedColumn = {
|
|
321
298
|
key: column.key,
|
|
@@ -356,9 +333,7 @@ const getUpdatedFilterByPredicate = (filter, column, filterPredicate) => {
|
|
|
356
333
|
let updatedFilter = Object.assign({}, filter, {
|
|
357
334
|
filter_predicate: filterPredicate
|
|
358
335
|
});
|
|
359
|
-
let
|
|
360
|
-
type: columnType
|
|
361
|
-
} = column;
|
|
336
|
+
let columnType = column.type;
|
|
362
337
|
if (columnType === _dtableUtils.CellType.CHECKBOX) {
|
|
363
338
|
updatedFilter.filter_term = false;
|
|
364
339
|
return updatedFilter;
|
|
@@ -441,9 +416,7 @@ const getFormulaAndLinkFilters = (filters, columns) => {
|
|
|
441
416
|
let formulaFilters = [];
|
|
442
417
|
filters.forEach(filter => {
|
|
443
418
|
const filterColumn = columns.find(column => column.key === (filter === null || filter === void 0 ? void 0 : filter.column_key));
|
|
444
|
-
const
|
|
445
|
-
type
|
|
446
|
-
} = filterColumn;
|
|
419
|
+
const type = filterColumn.type;
|
|
447
420
|
if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type] || type === _dtableUtils.CellType.LINK) {
|
|
448
421
|
formulaFilters.push(filter);
|
|
449
422
|
}
|
|
@@ -453,10 +426,8 @@ const getFormulaAndLinkFilters = (filters, columns) => {
|
|
|
453
426
|
exports.getFormulaAndLinkFilters = getFormulaAndLinkFilters;
|
|
454
427
|
const getFilterColumns = columns => {
|
|
455
428
|
return columns.filter(column => {
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
type
|
|
459
|
-
} = column;
|
|
429
|
+
const data = column.data,
|
|
430
|
+
type = column.type;
|
|
460
431
|
if (data && (type === _dtableUtils.CellType.LINK || _dtableUtils.FORMULA_COLUMN_TYPES_MAP[type] && data.result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY)) {
|
|
461
432
|
return (0, _dtableUtils.checkColumnHasFilterOptions)({
|
|
462
433
|
type: data.array_type,
|
|
@@ -468,18 +439,14 @@ const getFilterColumns = columns => {
|
|
|
468
439
|
};
|
|
469
440
|
exports.getFilterColumns = getFilterColumns;
|
|
470
441
|
const applyFilterOperation = operation => {
|
|
471
|
-
const
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
payload
|
|
476
|
-
} = operation;
|
|
442
|
+
const type = operation.type,
|
|
443
|
+
filter_conjunction = operation.filter_conjunction,
|
|
444
|
+
filters = operation.filters,
|
|
445
|
+
payload = operation.payload;
|
|
477
446
|
switch (type) {
|
|
478
447
|
case _constants.FILTER_OPERATION_TYPE.MODIFY_CONJUNCTION:
|
|
479
448
|
{
|
|
480
|
-
const
|
|
481
|
-
new_filter_conjunction
|
|
482
|
-
} = payload;
|
|
449
|
+
const new_filter_conjunction = payload.new_filter_conjunction;
|
|
483
450
|
return {
|
|
484
451
|
filter_conjunction: new_filter_conjunction,
|
|
485
452
|
filters
|
|
@@ -487,9 +454,7 @@ const applyFilterOperation = operation => {
|
|
|
487
454
|
}
|
|
488
455
|
case _constants.FILTER_OPERATION_TYPE.DELETE_FILTER:
|
|
489
456
|
{
|
|
490
|
-
const
|
|
491
|
-
filter_index
|
|
492
|
-
} = payload;
|
|
457
|
+
const filter_index = payload.filter_index;
|
|
493
458
|
let updatedFilters = [...filters];
|
|
494
459
|
if (!updatedFilters[filter_index]) {
|
|
495
460
|
return {
|
|
@@ -505,10 +470,8 @@ const applyFilterOperation = operation => {
|
|
|
505
470
|
}
|
|
506
471
|
case _constants.FILTER_OPERATION_TYPE.UPDATE_FILTER:
|
|
507
472
|
{
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
new_filter
|
|
511
|
-
} = payload;
|
|
473
|
+
const filter_index = payload.filter_index,
|
|
474
|
+
new_filter = payload.new_filter;
|
|
512
475
|
let updatedFilters = [...filters];
|
|
513
476
|
if (!updatedFilters[filter_index]) {
|
|
514
477
|
return {
|
|
@@ -524,12 +487,10 @@ const applyFilterOperation = operation => {
|
|
|
524
487
|
}
|
|
525
488
|
case _constants.FILTER_OPERATION_TYPE.MOVE_FILTER:
|
|
526
489
|
{
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
target_group_index
|
|
532
|
-
} = payload;
|
|
490
|
+
const source_filter_index = payload.source_filter_index,
|
|
491
|
+
target_filter_index = payload.target_filter_index,
|
|
492
|
+
source_group_index = payload.source_group_index,
|
|
493
|
+
target_group_index = payload.target_group_index;
|
|
533
494
|
const isFromFilterGroup = typeof source_group_index === 'number';
|
|
534
495
|
const isToFilterGroup = typeof target_group_index === 'number';
|
|
535
496
|
let updatedFilters = [...filters];
|
|
@@ -590,10 +551,8 @@ const applyFilterOperation = operation => {
|
|
|
590
551
|
}
|
|
591
552
|
case _constants.FILTER_OPERATION_TYPE.ADD_FILTER_INTO_GROUP:
|
|
592
553
|
{
|
|
593
|
-
const
|
|
594
|
-
|
|
595
|
-
group_index
|
|
596
|
-
} = payload;
|
|
554
|
+
const filter = payload.filter,
|
|
555
|
+
group_index = payload.group_index;
|
|
597
556
|
let updatedFilters = [...filters];
|
|
598
557
|
let updatedFilterGroup = updatedFilters[group_index];
|
|
599
558
|
if (!updatedFilterGroup) {
|
|
@@ -614,10 +573,8 @@ const applyFilterOperation = operation => {
|
|
|
614
573
|
}
|
|
615
574
|
case _constants.FILTER_OPERATION_TYPE.MODIFY_CONJUNCTION_IN_GROUP:
|
|
616
575
|
{
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
new_filter_conjunction
|
|
620
|
-
} = payload;
|
|
576
|
+
const group_index = payload.group_index,
|
|
577
|
+
new_filter_conjunction = payload.new_filter_conjunction;
|
|
621
578
|
let updatedFilters = [...filters];
|
|
622
579
|
let updatedFilterGroup = updatedFilters[group_index];
|
|
623
580
|
if (!updatedFilterGroup) {
|
|
@@ -634,10 +591,8 @@ const applyFilterOperation = operation => {
|
|
|
634
591
|
}
|
|
635
592
|
case _constants.FILTER_OPERATION_TYPE.DELETE_FILTER_IN_GROUP:
|
|
636
593
|
{
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
filter_index
|
|
640
|
-
} = payload;
|
|
594
|
+
const group_index = payload.group_index,
|
|
595
|
+
filter_index = payload.filter_index;
|
|
641
596
|
let updatedFilters = [...filters];
|
|
642
597
|
let updatedFilterGroup = updatedFilters[group_index];
|
|
643
598
|
if (!updatedFilterGroup || !updatedFilterGroup.filters || !updatedFilterGroup.filters[filter_index]) {
|
|
@@ -656,11 +611,9 @@ const applyFilterOperation = operation => {
|
|
|
656
611
|
}
|
|
657
612
|
case _constants.FILTER_OPERATION_TYPE.UPDATE_FILTER_IN_GROUP:
|
|
658
613
|
{
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
new_filter
|
|
663
|
-
} = payload;
|
|
614
|
+
const group_index = payload.group_index,
|
|
615
|
+
filter_index = payload.filter_index,
|
|
616
|
+
new_filter = payload.new_filter;
|
|
664
617
|
let updatedFilters = [...filters];
|
|
665
618
|
let updatedFilterGroup = updatedFilters[group_index];
|
|
666
619
|
if (!updatedFilterGroup || !updatedFilterGroup.filters || !updatedFilterGroup.filters[filter_index]) {
|
|
@@ -721,18 +674,15 @@ const getCreatorUpdatedFilterTerm = (filterTerm, filterPredicate, collaborator)
|
|
|
721
674
|
};
|
|
722
675
|
exports.getCreatorUpdatedFilterTerm = getCreatorUpdatedFilterTerm;
|
|
723
676
|
const getFilterConfigOptions = column => {
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
data
|
|
727
|
-
} = column;
|
|
677
|
+
const type = column.type,
|
|
678
|
+
data = column.data;
|
|
728
679
|
if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type]) {
|
|
729
680
|
return getFormulaColumnFilterOptions(column);
|
|
730
681
|
}
|
|
731
682
|
if (type === _dtableUtils.CellType.LINK) {
|
|
732
|
-
const {
|
|
733
|
-
array_type,
|
|
734
|
-
array_data
|
|
735
|
-
} = data || {};
|
|
683
|
+
const _ref7 = data || {},
|
|
684
|
+
array_type = _ref7.array_type,
|
|
685
|
+
array_data = _ref7.array_data;
|
|
736
686
|
if (array_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
737
687
|
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
738
688
|
type: _dtableUtils.CellType.CHECKBOX
|
|
@@ -66,15 +66,14 @@ class CollaboratorFilter extends _react.Component {
|
|
|
66
66
|
this.supportMultipleSelectOptions = [_dtableUtils.FILTER_PREDICATE_TYPE.HAS_ANY_OF, _dtableUtils.FILTER_PREDICATE_TYPE.HAS_ALL_OF, _dtableUtils.FILTER_PREDICATE_TYPE.HAS_NONE_OF, _dtableUtils.FILTER_PREDICATE_TYPE.IS_EXACTLY];
|
|
67
67
|
}
|
|
68
68
|
render() {
|
|
69
|
-
let
|
|
70
|
-
filterIndex,
|
|
71
|
-
filterTerm,
|
|
72
|
-
collaborators,
|
|
73
|
-
placeholder,
|
|
74
|
-
filter_predicate,
|
|
75
|
-
isInModal,
|
|
76
|
-
readOnly
|
|
77
|
-
} = this.props;
|
|
69
|
+
let _this$props = this.props,
|
|
70
|
+
filterIndex = _this$props.filterIndex,
|
|
71
|
+
filterTerm = _this$props.filterTerm,
|
|
72
|
+
collaborators = _this$props.collaborators,
|
|
73
|
+
placeholder = _this$props.placeholder,
|
|
74
|
+
filter_predicate = _this$props.filter_predicate,
|
|
75
|
+
isInModal = _this$props.isInModal,
|
|
76
|
+
readOnly = _this$props.readOnly;
|
|
78
77
|
let isSupportMultipleSelect = this.supportMultipleSelectOptions.indexOf(filter_predicate) > -1 ? true : false;
|
|
79
78
|
let selectedCollaborators = Array.isArray(filterTerm) && filterTerm.length > 0 && filterTerm.map(item => {
|
|
80
79
|
let collaborator = collaborators.find(c => c.email === item);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
12
|
var _ModalPortal = _interopRequireDefault(require("../../../ModalPortal"));
|
|
@@ -16,14 +17,18 @@ var _lang = require("../../../lang");
|
|
|
16
17
|
var _departments = require("../../../constants/departments");
|
|
17
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
function DepartmentMultipleSelectFilter(props) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
const value = props.value,
|
|
21
|
+
isInModal = props.isInModal,
|
|
22
|
+
readOnly = props.readOnly,
|
|
23
|
+
departments = props.departments;
|
|
24
|
+
const _useState = (0, _react.useState)(false),
|
|
25
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
26
|
+
isShowSelector = _useState2[0],
|
|
27
|
+
setIsShowSelector = _useState2[1];
|
|
28
|
+
const _useState3 = (0, _react.useState)(value || []),
|
|
29
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
30
|
+
selectedDepartments = _useState4[0],
|
|
31
|
+
setSelectedDepartments = _useState4[1];
|
|
27
32
|
const selectorRef = (0, _react.useRef)(null);
|
|
28
33
|
(0, _commonHooks.useClickOutside)({
|
|
29
34
|
currDOM: selectorRef.current,
|
|
@@ -31,10 +36,8 @@ function DepartmentMultipleSelectFilter(props) {
|
|
|
31
36
|
}, [selectedDepartments]);
|
|
32
37
|
function renderUserDepartmentOptions() {
|
|
33
38
|
return _departments.DEPARTMENT_SELECT_RANGE_OPTIONS.slice(0, 2).map((option, index) => {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
name
|
|
37
|
-
} = option;
|
|
39
|
+
const type = option.type,
|
|
40
|
+
name = option.name;
|
|
38
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
39
42
|
className: "department-item",
|
|
40
43
|
onClick: event => selectDepartment(event, type),
|
package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
12
|
var _SelectedDepartments = _interopRequireDefault(require("../../../SelectedDepartments"));
|
|
@@ -16,16 +17,20 @@ var _commonHooks = require("../../../hooks/common-hooks");
|
|
|
16
17
|
var _lang = require("../../../lang");
|
|
17
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
function DepartmentSingleSelectFilter(props) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
const value = props.value,
|
|
21
|
+
column = props.column,
|
|
22
|
+
isInModal = props.isInModal,
|
|
23
|
+
userDepartmentIdsMap = props.userDepartmentIdsMap,
|
|
24
|
+
departments = props.departments,
|
|
25
|
+
readOnly = props.readOnly;
|
|
26
|
+
const _useState = (0, _react.useState)(false),
|
|
27
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
28
|
+
isShowSelector = _useState2[0],
|
|
29
|
+
setIsShowSelector = _useState2[1];
|
|
30
|
+
const _useState3 = (0, _react.useState)(value || ''),
|
|
31
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
32
|
+
selectedDepartment = _useState4[0],
|
|
33
|
+
setSelectedDepartment = _useState4[1];
|
|
29
34
|
const selectorRef = (0, _react.useRef)(null);
|
|
30
35
|
let selectedDepartmentIds = [];
|
|
31
36
|
selectedDepartmentIds.push(value);
|
|
@@ -36,10 +41,8 @@ function DepartmentSingleSelectFilter(props) {
|
|
|
36
41
|
function renderUserDepartmentOptions(onSelect) {
|
|
37
42
|
if (!departments || departments.length === 0) return [];
|
|
38
43
|
return _departments.DEPARTMENT_SELECT_RANGE_OPTIONS.slice(0, 2).map((option, index) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
name
|
|
42
|
-
} = option;
|
|
44
|
+
const type = option.type,
|
|
45
|
+
name = option.name;
|
|
43
46
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
44
47
|
className: "department-item",
|
|
45
48
|
onClick: event => onSelect(event, type),
|
|
@@ -24,9 +24,7 @@ class FilterCalendar extends _react.Component {
|
|
|
24
24
|
e.preventDefault();
|
|
25
25
|
};
|
|
26
26
|
this.onChange = value => {
|
|
27
|
-
const
|
|
28
|
-
onChange
|
|
29
|
-
} = this.props;
|
|
27
|
+
const onChange = this.props.onChange;
|
|
30
28
|
const searchFormat = 'YYYY-MM-DD';
|
|
31
29
|
this.setState({
|
|
32
30
|
value
|
|
@@ -88,10 +86,9 @@ class FilterCalendar extends _react.Component {
|
|
|
88
86
|
this.defaultCalendarValue = null;
|
|
89
87
|
}
|
|
90
88
|
componentDidMount() {
|
|
91
|
-
const
|
|
92
|
-
value,
|
|
93
|
-
lang
|
|
94
|
-
} = this.props;
|
|
89
|
+
const _this$props = this.props,
|
|
90
|
+
value = _this$props.value,
|
|
91
|
+
lang = _this$props.lang;
|
|
95
92
|
const iszhcn = lang === 'zh-cn';
|
|
96
93
|
if (iszhcn) {
|
|
97
94
|
now = now.locale('zh-cn');
|
|
@@ -107,10 +104,9 @@ class FilterCalendar extends _react.Component {
|
|
|
107
104
|
}
|
|
108
105
|
}
|
|
109
106
|
render() {
|
|
110
|
-
const
|
|
111
|
-
isReadOnly,
|
|
112
|
-
firstDayOfWeek
|
|
113
|
-
} = this.props;
|
|
107
|
+
const _this$props2 = this.props,
|
|
108
|
+
isReadOnly = _this$props2.isReadOnly,
|
|
109
|
+
firstDayOfWeek = _this$props2.firstDayOfWeek;
|
|
114
110
|
const state = this.state;
|
|
115
111
|
if (isReadOnly) return /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
116
112
|
className: "ant-calendar-picker-input ant-input form-control",
|
|
@@ -156,9 +152,7 @@ class FilterCalendar extends _react.Component {
|
|
|
156
152
|
zIndex: 1001
|
|
157
153
|
},
|
|
158
154
|
children: _ref => {
|
|
159
|
-
let
|
|
160
|
-
value
|
|
161
|
-
} = _ref;
|
|
155
|
+
let value = _ref.value;
|
|
162
156
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
163
157
|
tabIndex: "0",
|
|
164
158
|
onFocus: this.onReadOnlyFocus,
|