dtable-ui-component 6.0.126 → 7.0.0-xia.1
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 +16 -14
- package/lib/ActivityIndicator/index.js +8 -7
- package/lib/AsyncUserSelect/index.js +19 -40
- package/lib/AsyncUserSelect/user-item.js +6 -5
- package/lib/AutoNumberFormatter/index.js +4 -3
- package/lib/Badge/index.js +11 -9
- package/lib/ButtonFormatter/index.js +8 -6
- package/lib/CTimeFormatter/index.js +4 -3
- package/lib/CheckboxEditor/index.js +3 -1
- package/lib/CheckboxEditor/mb-editor.js +20 -9
- package/lib/CheckboxEditor/pc-editor.js +24 -12
- package/lib/CheckboxFormatter/index.js +5 -4
- package/lib/CollaboratorEditor/index.js +4 -2
- package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
- package/lib/CollaboratorEditor/pc-editor/index.js +34 -25
- package/lib/CollaboratorFormatter/index.js +10 -8
- package/lib/CollaboratorItem/index.js +5 -4
- package/lib/CollapsibleSettingLayout/index.js +7 -9
- package/lib/Comment/body/comment.js +18 -10
- package/lib/Comment/body/index.js +4 -2
- package/lib/Comment/footer/btns/index.js +7 -4
- package/lib/Comment/footer/index.js +20 -9
- package/lib/Comment/footer/input/index.js +50 -29
- package/lib/Comment/footer/input/participant/index.js +5 -4
- package/lib/Comment/footer/participants/index.js +5 -4
- package/lib/Comment/footer/participants/participant/index.js +3 -1
- package/lib/Comment/footer/participants/participant-select/index.js +24 -8
- package/lib/Comment/index.js +57 -39
- package/lib/Comment/utils/utilities.js +21 -15
- package/lib/CreatorFormatter/index.js +8 -6
- package/lib/DTableColorPicker/ColorPickerPortal/index.js +18 -22
- package/lib/DTableColorPicker/index.js +40 -55
- package/lib/DTableColorPicker/utils.js +6 -4
- package/lib/DTableColumnIcon/index.js +7 -6
- package/lib/DTableCommonAddTool/index.js +8 -6
- package/lib/DTableCustomFooter/index.js +3 -1
- package/lib/DTableCustomizeCollaboratorSelect/index.js +20 -17
- package/lib/DTableCustomizeSelect/index.js +24 -19
- package/lib/DTableDropdownItem/index.js +18 -16
- package/lib/DTableDropdownMenu/index.js +10 -8
- package/lib/DTableEmptyTip/index.js +5 -4
- package/lib/DTableFiltersPopover/index.js +50 -34
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
- package/lib/DTableFiltersPopover/utils/index.js +113 -63
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
- package/lib/DTableFiltersPopover/widgets/filter-group.js +56 -35
- package/lib/DTableFiltersPopover/widgets/filter-item.js +171 -108
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +5 -5
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +161 -136
- package/lib/DTableFiltersPopover/widgets/rate-item.js +20 -15
- package/lib/DTableGroupSelect/index.js +15 -11
- package/lib/DTableGroupSelect/select-option-group.js +32 -23
- package/lib/DTableIcon/index.js +7 -6
- package/lib/DTableIcon/svg-icon.js +7 -5
- package/lib/DTableModalHeader/index.css +3 -20
- package/lib/DTableModalHeader/index.js +3 -1
- package/lib/DTablePopover/index.js +15 -11
- package/lib/DTableRadio/index.js +9 -10
- package/lib/DTableRadioGroup/index.js +17 -8
- package/lib/DTableSearchInput/index.js +29 -19
- package/lib/DTableSelect/dtable-select-label.js +5 -6
- package/lib/DTableSelect/index.js +22 -21
- package/lib/DTableSelect/utils.js +15 -7
- package/lib/DTableSubDropdownMenu/index.js +10 -8
- package/lib/DTableSubDropdownToggle/index.js +12 -12
- package/lib/DTableSwitch/index.js +11 -12
- package/lib/DTableToolTip/index.js +8 -7
- package/lib/DateEditor/index.js +15 -20
- package/lib/DateEditor/mb-editor/index.js +31 -18
- package/lib/DateEditor/pc-editor.js +45 -26
- package/lib/DateFormatter/index.js +5 -4
- package/lib/DatePicker/index.js +15 -9
- package/lib/DatePicker/utils.js +3 -1
- package/lib/DeleteTip/index.js +6 -5
- package/lib/DepartmentMultipleSelectEditor/index.js +23 -25
- package/lib/DepartmentSelectFilter/index.js +8 -6
- package/lib/DepartmentSingleSelectEditor/index.js +3 -1
- package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +47 -48
- package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +58 -36
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
- package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
- package/lib/DigitalSignEditor/index.js +3 -1
- package/lib/DigitalSignEditor/mb-editor/index.js +20 -12
- package/lib/DigitalSignEditor/pc-editor/index.js +24 -17
- package/lib/DigitalSignEditor/service.js +4 -2
- package/lib/DigitalSignEditor/signature-board/index.js +8 -5
- package/lib/DigitalSignEditor/utils.js +4 -2
- package/lib/DigitalSignFormatter/index.js +15 -12
- package/lib/DigitalSignFormatter/utils.js +5 -4
- package/lib/DurationEditor/index.js +31 -21
- package/lib/DurationFormatter/index.js +5 -4
- package/lib/EditEditorButton/index.js +3 -1
- package/lib/EmailFormatter/index.js +4 -3
- package/lib/FieldDisplaySetting/field-item.js +12 -12
- package/lib/FieldDisplaySetting/index.js +10 -12
- package/lib/FileEditor/files-previewer/index.js +3 -1
- package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +18 -10
- package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
- package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +21 -14
- package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
- package/lib/FileEditor/index.js +3 -1
- package/lib/FileEditor/mb-editor/index.js +20 -28
- package/lib/FileEditor/pc-editor/addition-previewer/index.js +3 -1
- package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +25 -11
- package/lib/FileEditor/pc-editor/index.js +27 -19
- package/lib/FileFormatter/index.js +19 -26
- package/lib/FileItemFormatter/index.js +9 -6
- package/lib/FileUploader/index.js +45 -28
- package/lib/FormulaFormatter/index.js +29 -15
- package/lib/GeolocationEditor/index.js +12 -11
- package/lib/GeolocationEditor/map-editor-utils.js +15 -17
- package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/index.js +6 -4
- package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +68 -41
- package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
- package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
- package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
- package/lib/GeolocationEditor/pc-editor/country-editor.js +23 -10
- package/lib/GeolocationEditor/pc-editor/index.js +20 -12
- package/lib/GeolocationEditor/pc-editor/location-editor.js +31 -26
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +54 -34
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +60 -36
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +62 -35
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +65 -36
- package/lib/GeolocationEditor/pc-editor/province-city-editor.js +25 -19
- package/lib/GeolocationEditor/pc-editor/province-editor.js +13 -6
- package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
- package/lib/GeolocationEditor/pc-editor/selector-list.js +7 -6
- package/lib/GeolocationFormatter/index.js +5 -4
- package/lib/HtmlLongTextFormatter/index.js +12 -4
- package/lib/Icon/index.js +5 -3
- package/lib/IconButton/index.js +6 -4
- package/lib/ImageEditor/images-previewer/image-preview/index.js +21 -12
- package/lib/ImageEditor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/index.js +3 -1
- package/lib/ImageEditor/mb-editor/index.js +20 -28
- package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
- package/lib/ImageEditor/pc-editor/addition-previewer/index.js +3 -1
- package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +21 -7
- package/lib/ImageEditor/pc-editor/images-previewer/index.js +9 -3
- package/lib/ImageEditor/pc-editor/index.js +16 -11
- package/lib/ImageFormatter/images-lazy-load.js +11 -19
- package/lib/ImageFormatter/index.js +13 -11
- package/lib/ImagePreviewerLightbox/index.js +13 -15
- package/lib/ImageThumbnail/index.js +13 -10
- package/lib/InputItem/custom-input.js +46 -26
- package/lib/InputItem/custom-keyboard.js +18 -15
- package/lib/InputItem/index.js +50 -34
- package/lib/InputItem/input.js +4 -2
- package/lib/LastModifierFormatter/index.js +8 -6
- package/lib/LinkEditor/index.js +53 -33
- package/lib/LinkEditor/link-editor-option.js +4 -3
- package/lib/LinkEditor/mb-popover/index.js +22 -9
- package/lib/LinkEditor/pc-popover/index.js +10 -5
- package/lib/LinkFormatter/index.js +37 -21
- package/lib/List/index.js +8 -6
- package/lib/List/list-item.js +28 -22
- package/lib/LongTextFormatter/index.js +5 -4
- package/lib/MBEditorHeader/index.js +8 -7
- package/lib/MTimeFormatter/index.js +4 -3
- package/lib/MobileFullScreenPage/body/index.js +5 -3
- package/lib/MobileFullScreenPage/header/index.js +6 -4
- package/lib/MobileFullScreenPage/index.js +11 -13
- package/lib/MobileModal/index.js +3 -1
- package/lib/MobileOperationSheet/index.js +8 -7
- package/lib/MobileSelector/empty/index.js +3 -1
- package/lib/MobileSelector/index.js +7 -5
- package/lib/MobileSelector/option/index.js +5 -3
- package/lib/MobileSelector/options/index.js +3 -1
- package/lib/MobileSelector/search/index.js +5 -3
- package/lib/MobileUpload/index.js +5 -4
- package/lib/Modal/modal.js +15 -14
- package/lib/Modal/prompt.js +4 -4
- package/lib/MultipleSelectEditor/index.js +3 -1
- package/lib/MultipleSelectFormatter/index.js +8 -6
- package/lib/NotificationPopover/index.js +5 -4
- package/lib/NumberEditor/index.js +21 -12
- package/lib/NumberFormatter/index.js +5 -4
- package/lib/PhoneNumberLink/index.js +4 -2
- package/lib/Picker/AbstractPicker.js +27 -23
- package/lib/Popover/index.js +4 -3
- package/lib/Popover/item.js +9 -7
- package/lib/Progress/index.js +8 -9
- package/lib/Radio/Radio.js +8 -4
- package/lib/Radio/RadioItem.js +12 -8
- package/lib/RateFormatter/index.js +13 -13
- package/lib/RoleStatusEditor/index.js +17 -18
- package/lib/RowExpandDialog/body/index.js +49 -32
- package/lib/RowExpandDialog/column-content/index.js +9 -5
- package/lib/RowExpandDialog/header/index.js +8 -6
- package/lib/RowExpandDialog/index.js +34 -49
- package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
- package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
- package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
- package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
- package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
- package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
- package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
- package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +34 -20
- package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +35 -21
- package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
- package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
- package/lib/RowExpandEditor/email-editor/mb-editor/index.js +19 -9
- package/lib/RowExpandEditor/email-editor/pc-editor/index.js +24 -13
- package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
- package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
- package/lib/RowExpandEditor/image-editor/mb-editor/index.js +25 -15
- package/lib/RowExpandEditor/image-editor/pc-editor/index.js +23 -13
- package/lib/RowExpandEditor/index.js +8 -4
- package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
- package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
- package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
- package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +19 -11
- package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +33 -22
- package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
- package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
- package/lib/RowExpandEditor/rate-editor/mb-editor.js +25 -12
- package/lib/RowExpandEditor/rate-editor/pc-editor.js +36 -20
- package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +28 -17
- package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +34 -22
- package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
- package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
- package/lib/RowExpandEditor/url-editor/mb-editor/index.js +13 -5
- package/lib/RowExpandEditor/url-editor/pc-editor/index.js +18 -9
- package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
- package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
- package/lib/RowExpandFormatter/email-formatter/index.js +7 -4
- package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
- package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +12 -10
- package/lib/RowExpandFormatter/formula-formatter/index.js +34 -19
- package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
- package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +8 -7
- package/lib/RowExpandFormatter/index.js +41 -27
- package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +14 -8
- package/lib/RowExpandFormatter/link-formatter/index.js +19 -11
- package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
- package/lib/RowExpandFormatter/rate-formatter/index.js +12 -11
- package/lib/RowExpandFormatter/text/index.js +5 -4
- package/lib/RowExpandFormatter/url-formatter/index.js +7 -4
- package/lib/RowExpandView/body/index.js +35 -22
- package/lib/RowExpandView/column-content/index.js +7 -3
- package/lib/RowExpandView/index.js +30 -42
- package/lib/SelectItem/index.js +8 -6
- package/lib/SelectOptionGroup/index.js +40 -30
- package/lib/SelectedDepartments/index.js +9 -7
- package/lib/SimpleLongTextFormatter/index.js +16 -10
- package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
- package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
- package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
- package/lib/SingleSelectEditor/index.js +3 -1
- package/lib/SingleSelectFormatter/index.js +9 -8
- package/lib/TabBar/Tab.js +16 -14
- package/lib/TabBar/index.js +21 -18
- package/lib/Tabs/index.js +3 -1
- package/lib/TextEditor/index.js +23 -14
- package/lib/TextFormatter/index.js +4 -3
- package/lib/TextareaItem/index.js +26 -19
- package/lib/Toast/index.js +4 -3
- package/lib/UrlFormatter/index.js +4 -3
- package/lib/common/editor-base.js +12 -7
- package/lib/hooks/common-hooks.js +4 -2
- package/lib/select-editor/index.js +3 -1
- package/lib/select-editor/mb-editor/index.js +28 -17
- package/lib/select-editor/pc-editor/index.js +42 -27
- package/lib/toaster/alert.js +7 -6
- package/lib/toaster/toast.js +3 -2
- package/lib/toaster/toastManager.js +4 -2
- package/lib/utils/cell.js +11 -8
- package/lib/utils/column-utils.js +14 -8
- package/lib/utils/departments.js +3 -1
- package/lib/utils/url.js +31 -24
- package/lib/utils/utils.js +6 -2
- package/package.json +1 -1
|
@@ -32,16 +32,21 @@ class FilterItem extends _react.default.Component {
|
|
|
32
32
|
super(_props);
|
|
33
33
|
_this = this;
|
|
34
34
|
this.initSelectOptions = props => {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
const {
|
|
36
|
+
filter,
|
|
37
|
+
filterColumn
|
|
38
|
+
} = props;
|
|
39
|
+
let {
|
|
40
|
+
filterPredicateList,
|
|
41
|
+
filterTermModifierList
|
|
42
|
+
} = (0, _utils.getColumnOptions)(filterColumn);
|
|
40
43
|
// The value of the calculation formula column does not exist in the shared view
|
|
41
44
|
this.filterPredicateOptions = filterPredicateList ? filterPredicateList.map(predicate => {
|
|
42
45
|
return _filterItemUtils.default.generatorPredicateOption(predicate);
|
|
43
46
|
}).filter(item => item) : [];
|
|
44
|
-
const
|
|
47
|
+
const {
|
|
48
|
+
filter_predicate
|
|
49
|
+
} = filter;
|
|
45
50
|
if ((0, _dtableUtils.isDateColumn)(filterColumn)) {
|
|
46
51
|
if (filter_predicate === _dtableUtils.FILTER_PREDICATE_TYPE.IS_WITHIN) {
|
|
47
52
|
filterTermModifierList = _dtableUtils.filterTermModifierIsWithin;
|
|
@@ -53,7 +58,9 @@ class FilterItem extends _react.default.Component {
|
|
|
53
58
|
};
|
|
54
59
|
this.onDeleteFilter = event => {
|
|
55
60
|
event.nativeEvent.stopImmediatePropagation();
|
|
56
|
-
const
|
|
61
|
+
const {
|
|
62
|
+
index
|
|
63
|
+
} = this.props;
|
|
57
64
|
this.props.deleteFilter(index);
|
|
58
65
|
};
|
|
59
66
|
this.resetState = filter => {
|
|
@@ -62,17 +69,22 @@ class FilterItem extends _react.default.Component {
|
|
|
62
69
|
});
|
|
63
70
|
};
|
|
64
71
|
this.onSelectConjunction = value => {
|
|
65
|
-
const
|
|
72
|
+
const {
|
|
73
|
+
filterConjunction
|
|
74
|
+
} = this.props;
|
|
66
75
|
if (filterConjunction === value.filterConjunction) {
|
|
67
76
|
return;
|
|
68
77
|
}
|
|
69
78
|
this.props.updateConjunction(value.filterConjunction);
|
|
70
79
|
};
|
|
71
80
|
this.onSelectColumn = value => {
|
|
72
|
-
const
|
|
73
|
-
index
|
|
74
|
-
filter
|
|
75
|
-
|
|
81
|
+
const {
|
|
82
|
+
index,
|
|
83
|
+
filter
|
|
84
|
+
} = this.props;
|
|
85
|
+
const {
|
|
86
|
+
column
|
|
87
|
+
} = value;
|
|
76
88
|
if (column.key === filter.column_key) return;
|
|
77
89
|
let newFilter = (0, _utils.getFilterByColumn)(column, filter);
|
|
78
90
|
if (!newFilter) return;
|
|
@@ -80,11 +92,14 @@ class FilterItem extends _react.default.Component {
|
|
|
80
92
|
this.props.updateFilter(index, newFilter);
|
|
81
93
|
};
|
|
82
94
|
this.onSelectPredicate = value => {
|
|
83
|
-
const
|
|
84
|
-
index
|
|
85
|
-
filter
|
|
86
|
-
filterColumn
|
|
87
|
-
|
|
95
|
+
const {
|
|
96
|
+
index,
|
|
97
|
+
filter,
|
|
98
|
+
filterColumn
|
|
99
|
+
} = this.props;
|
|
100
|
+
const {
|
|
101
|
+
filterPredicate
|
|
102
|
+
} = value;
|
|
88
103
|
if (filter.filter_predicate === filterPredicate) {
|
|
89
104
|
return;
|
|
90
105
|
}
|
|
@@ -93,10 +108,13 @@ class FilterItem extends _react.default.Component {
|
|
|
93
108
|
this.props.updateFilter(index, newFilter);
|
|
94
109
|
};
|
|
95
110
|
this.onSelectTermModifier = value => {
|
|
96
|
-
const
|
|
97
|
-
index
|
|
98
|
-
filter
|
|
99
|
-
|
|
111
|
+
const {
|
|
112
|
+
index,
|
|
113
|
+
filter
|
|
114
|
+
} = this.props;
|
|
115
|
+
const {
|
|
116
|
+
filterTermModifier
|
|
117
|
+
} = value;
|
|
100
118
|
const inputRangeLabel = [_dtableUtils.FILTER_TERM_MODIFIER_TYPE.EXACT_DATE, _dtableUtils.FILTER_TERM_MODIFIER_TYPE.NUMBER_OF_DAYS_AGO, _dtableUtils.FILTER_TERM_MODIFIER_TYPE.NUMBER_OF_DAYS_FROM_NOW, _dtableUtils.FILTER_TERM_MODIFIER_TYPE.THE_NEXT_NUMBERS_OF_DAYS, _dtableUtils.FILTER_TERM_MODIFIER_TYPE.THE_PAST_NUMBERS_OF_DAYS];
|
|
101
119
|
if (filter.filter_term_modifier === filterTermModifier) {
|
|
102
120
|
return;
|
|
@@ -113,10 +131,13 @@ class FilterItem extends _react.default.Component {
|
|
|
113
131
|
this.props.updateFilter(index, newFilter);
|
|
114
132
|
};
|
|
115
133
|
this.onSelectSingle = value => {
|
|
116
|
-
const
|
|
117
|
-
index
|
|
118
|
-
filter
|
|
119
|
-
|
|
134
|
+
const {
|
|
135
|
+
index,
|
|
136
|
+
filter
|
|
137
|
+
} = this.props;
|
|
138
|
+
const {
|
|
139
|
+
columnOption: option
|
|
140
|
+
} = value;
|
|
120
141
|
if (filter.filter_term === option.id) {
|
|
121
142
|
return;
|
|
122
143
|
}
|
|
@@ -125,28 +146,37 @@ class FilterItem extends _react.default.Component {
|
|
|
125
146
|
this.props.updateFilter(index, newFilter);
|
|
126
147
|
};
|
|
127
148
|
this.onSelectMultiple = value => {
|
|
128
|
-
const
|
|
129
|
-
index
|
|
130
|
-
filter
|
|
131
|
-
|
|
149
|
+
const {
|
|
150
|
+
index,
|
|
151
|
+
filter
|
|
152
|
+
} = this.props;
|
|
153
|
+
const {
|
|
154
|
+
columnOption: option
|
|
155
|
+
} = value;
|
|
132
156
|
let newFilter = (0, _utils.getUpdatedFilterBySelectMultiple)(filter, option);
|
|
133
157
|
this.resetState(newFilter);
|
|
134
158
|
this.props.updateFilter(index, newFilter);
|
|
135
159
|
};
|
|
136
160
|
this.onSelectCollaborator = value => {
|
|
137
|
-
const
|
|
138
|
-
index
|
|
139
|
-
filter
|
|
140
|
-
|
|
161
|
+
const {
|
|
162
|
+
index,
|
|
163
|
+
filter
|
|
164
|
+
} = this.props;
|
|
165
|
+
const {
|
|
166
|
+
columnOption: collaborator
|
|
167
|
+
} = value;
|
|
141
168
|
let newFilter = (0, _utils.getUpdatedFilterByCollaborator)(filter, collaborator);
|
|
142
169
|
this.resetState(newFilter);
|
|
143
170
|
this.props.updateFilter(index, newFilter);
|
|
144
171
|
};
|
|
145
172
|
this.onSelectCreator = value => {
|
|
146
|
-
const
|
|
147
|
-
index
|
|
148
|
-
filter
|
|
149
|
-
|
|
173
|
+
const {
|
|
174
|
+
index,
|
|
175
|
+
filter
|
|
176
|
+
} = this.props;
|
|
177
|
+
const {
|
|
178
|
+
columnOption: collaborator
|
|
179
|
+
} = value;
|
|
150
180
|
let newFilter = (0, _utils.getUpdatedFilterByCreator)(filter, collaborator);
|
|
151
181
|
// the predicate is 'is' or 'is not'
|
|
152
182
|
if (!newFilter) {
|
|
@@ -173,10 +203,13 @@ class FilterItem extends _react.default.Component {
|
|
|
173
203
|
this.onFilterTermChanged(value);
|
|
174
204
|
};
|
|
175
205
|
this.onFilterTermChanged = newFilterTerm => {
|
|
176
|
-
const
|
|
177
|
-
index
|
|
178
|
-
filter
|
|
179
|
-
|
|
206
|
+
const {
|
|
207
|
+
index,
|
|
208
|
+
filter
|
|
209
|
+
} = this.props;
|
|
210
|
+
const {
|
|
211
|
+
filterTerm
|
|
212
|
+
} = this.state;
|
|
180
213
|
if (newFilterTerm !== filterTerm) {
|
|
181
214
|
this.setState({
|
|
182
215
|
filterTerm: newFilterTerm
|
|
@@ -201,11 +234,14 @@ class FilterItem extends _react.default.Component {
|
|
|
201
234
|
this.onFilterTermChanged(index);
|
|
202
235
|
};
|
|
203
236
|
this.getInputComponent = type => {
|
|
204
|
-
const
|
|
205
|
-
filterColumn
|
|
206
|
-
readOnly
|
|
207
|
-
isInModal
|
|
208
|
-
|
|
237
|
+
const {
|
|
238
|
+
filterColumn,
|
|
239
|
+
readOnly,
|
|
240
|
+
isInModal
|
|
241
|
+
} = this.props;
|
|
242
|
+
const {
|
|
243
|
+
filterTerm
|
|
244
|
+
} = this.state;
|
|
209
245
|
if (type === _constants.INPUT_CMP_TYPE_MAP.TEXT) {
|
|
210
246
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableSearchInput.default, {
|
|
211
247
|
value: filterTerm,
|
|
@@ -248,12 +284,13 @@ class FilterItem extends _react.default.Component {
|
|
|
248
284
|
}
|
|
249
285
|
};
|
|
250
286
|
this.renderConjunction = () => {
|
|
251
|
-
const
|
|
252
|
-
index
|
|
253
|
-
filterConjunction
|
|
254
|
-
conjunctionOptions
|
|
255
|
-
readOnly
|
|
256
|
-
isInModal
|
|
287
|
+
const {
|
|
288
|
+
index,
|
|
289
|
+
filterConjunction,
|
|
290
|
+
conjunctionOptions,
|
|
291
|
+
readOnly,
|
|
292
|
+
isInModal
|
|
293
|
+
} = this.props;
|
|
257
294
|
switch (index) {
|
|
258
295
|
case 0:
|
|
259
296
|
{
|
|
@@ -282,10 +319,13 @@ class FilterItem extends _react.default.Component {
|
|
|
282
319
|
this.renderMultipleSelectOption = function () {
|
|
283
320
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
284
321
|
let filterTerm = arguments.length > 1 ? arguments[1] : undefined;
|
|
285
|
-
const
|
|
286
|
-
filter
|
|
287
|
-
readOnly
|
|
288
|
-
|
|
322
|
+
const {
|
|
323
|
+
filter,
|
|
324
|
+
readOnly
|
|
325
|
+
} = _this.props;
|
|
326
|
+
const {
|
|
327
|
+
filter_predicate
|
|
328
|
+
} = filter;
|
|
289
329
|
let isSupportMultipleSelect = false;
|
|
290
330
|
// The first two options are used for single selection, and the last four options are used for multiple selection
|
|
291
331
|
const supportMultipleSelectOptions = [_dtableUtils.FILTER_PREDICATE_TYPE.IS_ANY_OF, _dtableUtils.FILTER_PREDICATE_TYPE.IS_NONE_OF, _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];
|
|
@@ -341,19 +381,24 @@ class FilterItem extends _react.default.Component {
|
|
|
341
381
|
});
|
|
342
382
|
};
|
|
343
383
|
this.renderFilterTerm = filterColumn => {
|
|
344
|
-
const
|
|
345
|
-
index
|
|
346
|
-
filter
|
|
347
|
-
collaborators
|
|
348
|
-
userDepartmentIdsMap
|
|
349
|
-
departments
|
|
350
|
-
lang
|
|
351
|
-
firstDayOfWeek
|
|
352
|
-
readOnly
|
|
353
|
-
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
|
|
384
|
+
const {
|
|
385
|
+
index,
|
|
386
|
+
filter,
|
|
387
|
+
collaborators,
|
|
388
|
+
userDepartmentIdsMap,
|
|
389
|
+
departments,
|
|
390
|
+
lang,
|
|
391
|
+
firstDayOfWeek,
|
|
392
|
+
readOnly
|
|
393
|
+
} = this.props;
|
|
394
|
+
const {
|
|
395
|
+
type
|
|
396
|
+
} = filterColumn;
|
|
397
|
+
const {
|
|
398
|
+
filter_term,
|
|
399
|
+
filter_predicate,
|
|
400
|
+
filter_term_modifier
|
|
401
|
+
} = filter;
|
|
357
402
|
// predicate is empty or not empty
|
|
358
403
|
if (_constants.EMPTY_PREDICATE.includes(filter_predicate)) {
|
|
359
404
|
return null;
|
|
@@ -410,9 +455,9 @@ class FilterItem extends _react.default.Component {
|
|
|
410
455
|
case _dtableUtils.CellType.SINGLE_SELECT:
|
|
411
456
|
{
|
|
412
457
|
// get options
|
|
413
|
-
let
|
|
414
|
-
|
|
415
|
-
|
|
458
|
+
let {
|
|
459
|
+
options = []
|
|
460
|
+
} = filterColumn.data || {};
|
|
416
461
|
if ([_dtableUtils.FILTER_PREDICATE_TYPE.IS_ANY_OF, _dtableUtils.FILTER_PREDICATE_TYPE.IS_NONE_OF].includes(filter_predicate)) {
|
|
417
462
|
return this.renderMultipleSelectOption(options, filter_term);
|
|
418
463
|
}
|
|
@@ -452,9 +497,9 @@ class FilterItem extends _react.default.Component {
|
|
|
452
497
|
}
|
|
453
498
|
case _dtableUtils.CellType.MULTIPLE_SELECT:
|
|
454
499
|
{
|
|
455
|
-
let
|
|
456
|
-
|
|
457
|
-
|
|
500
|
+
let {
|
|
501
|
+
options = []
|
|
502
|
+
} = filterColumn.data || {};
|
|
458
503
|
return this.renderMultipleSelectOption(options, filter_term);
|
|
459
504
|
}
|
|
460
505
|
case _dtableUtils.CellType.DEPARTMENT_SINGLE_SELECT:
|
|
@@ -512,8 +557,9 @@ class FilterItem extends _react.default.Component {
|
|
|
512
557
|
}
|
|
513
558
|
case _dtableUtils.CellType.RATE:
|
|
514
559
|
{
|
|
515
|
-
let
|
|
516
|
-
rate_max_number
|
|
560
|
+
let {
|
|
561
|
+
rate_max_number
|
|
562
|
+
} = filterColumn.data || {};
|
|
517
563
|
let rateList = [];
|
|
518
564
|
for (let i = 0; i < rate_max_number; i++) {
|
|
519
565
|
let rateItem = /*#__PURE__*/(0, _jsxRuntime.jsx)(_rateItem.default, {
|
|
@@ -550,16 +596,19 @@ class FilterItem extends _react.default.Component {
|
|
|
550
596
|
}
|
|
551
597
|
};
|
|
552
598
|
this.renderFormulaFilterTerm = (filterPredicate, filterTerm, index, filterColumn) => {
|
|
553
|
-
const
|
|
554
|
-
data
|
|
555
|
-
|
|
556
|
-
|
|
599
|
+
const {
|
|
600
|
+
data
|
|
601
|
+
} = filterColumn || {};
|
|
602
|
+
const {
|
|
603
|
+
result_type
|
|
604
|
+
} = data || {};
|
|
557
605
|
if (filterPredicate === _dtableUtils.FILTER_PREDICATE_TYPE.IS_CURRENT_USER_ID) {
|
|
558
606
|
return null;
|
|
559
607
|
}
|
|
560
608
|
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.NUMBER) {
|
|
561
|
-
const
|
|
562
|
-
format
|
|
609
|
+
const {
|
|
610
|
+
format
|
|
611
|
+
} = filterColumn.data || {};
|
|
563
612
|
if (format === _dtableUtils.CellType.DURATION) {
|
|
564
613
|
return this.getInputComponent(_constants.INPUT_CMP_TYPE_MAP.DURATION, filterColumn);
|
|
565
614
|
}
|
|
@@ -577,15 +626,18 @@ class FilterItem extends _react.default.Component {
|
|
|
577
626
|
return this.renderFilterTermByArrayType(filterPredicate, filterTerm, index, filterColumn);
|
|
578
627
|
};
|
|
579
628
|
this.renderFilterTermByArrayType = (filterPredicate, filterTerm, index, filterColumn) => {
|
|
580
|
-
const
|
|
581
|
-
collaborators
|
|
582
|
-
departments
|
|
583
|
-
readOnly
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
629
|
+
const {
|
|
630
|
+
collaborators,
|
|
631
|
+
departments,
|
|
632
|
+
readOnly
|
|
633
|
+
} = this.props;
|
|
634
|
+
const {
|
|
635
|
+
data
|
|
636
|
+
} = filterColumn || {};
|
|
637
|
+
const {
|
|
638
|
+
array_type,
|
|
639
|
+
array_data
|
|
640
|
+
} = data || {};
|
|
589
641
|
if (!array_type) {
|
|
590
642
|
return null;
|
|
591
643
|
}
|
|
@@ -594,9 +646,9 @@ class FilterItem extends _react.default.Component {
|
|
|
594
646
|
data: array_data
|
|
595
647
|
};
|
|
596
648
|
if (array_type === _dtableUtils.CellType.SINGLE_SELECT || array_type === _dtableUtils.CellType.MULTIPLE_SELECT) {
|
|
597
|
-
let
|
|
598
|
-
|
|
599
|
-
|
|
649
|
+
let {
|
|
650
|
+
options = []
|
|
651
|
+
} = array_data || {};
|
|
600
652
|
return this.renderMultipleSelectOption(options, filterTerm);
|
|
601
653
|
}
|
|
602
654
|
if (array_type === _dtableUtils.CellType.DEPARTMENT_SINGLE_SELECT) {
|
|
@@ -628,7 +680,9 @@ class FilterItem extends _react.default.Component {
|
|
|
628
680
|
return this.getInputComponent(_constants.INPUT_CMP_TYPE_MAP.TEXT);
|
|
629
681
|
};
|
|
630
682
|
this.isRenderErrorTips = () => {
|
|
631
|
-
const
|
|
683
|
+
const {
|
|
684
|
+
errMsg
|
|
685
|
+
} = this.props;
|
|
632
686
|
return errMsg && errMsg !== _dtableUtils.FILTER_ERR_MSG.INCOMPLETE_FILTER;
|
|
633
687
|
};
|
|
634
688
|
this.renderErrorMessage = () => {
|
|
@@ -658,7 +712,9 @@ class FilterItem extends _react.default.Component {
|
|
|
658
712
|
this.initSelectOptions(_props);
|
|
659
713
|
}
|
|
660
714
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
661
|
-
const
|
|
715
|
+
const {
|
|
716
|
+
filter
|
|
717
|
+
} = this.props;
|
|
662
718
|
if (nextProps.filter !== filter) {
|
|
663
719
|
this.initSelectOptions(nextProps);
|
|
664
720
|
this.setState({
|
|
@@ -672,15 +728,20 @@ class FilterItem extends _react.default.Component {
|
|
|
672
728
|
return shouldUpdated;
|
|
673
729
|
}
|
|
674
730
|
render() {
|
|
675
|
-
const
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
731
|
+
const {
|
|
732
|
+
filterPredicateOptions,
|
|
733
|
+
filterTermModifierOptions
|
|
734
|
+
} = this;
|
|
735
|
+
const {
|
|
736
|
+
filter,
|
|
737
|
+
filterColumn,
|
|
738
|
+
filterColumnOptions,
|
|
739
|
+
readOnly
|
|
740
|
+
} = this.props;
|
|
741
|
+
const {
|
|
742
|
+
filter_predicate,
|
|
743
|
+
filter_term_modifier
|
|
744
|
+
} = filter;
|
|
684
745
|
const activeColumn = _filterItemUtils.default.generatorColumnOption(filterColumn);
|
|
685
746
|
const activePredicate = _filterItemUtils.default.generatorPredicateOption(filter_predicate, true);
|
|
686
747
|
let activeTermModifier = null;
|
|
@@ -690,7 +751,9 @@ class FilterItem extends _react.default.Component {
|
|
|
690
751
|
} else if ((0, _columnUtils.isCheckboxColumn)(filterColumn)) {
|
|
691
752
|
_isCheckboxColumn = true;
|
|
692
753
|
}
|
|
693
|
-
const
|
|
754
|
+
const {
|
|
755
|
+
type
|
|
756
|
+
} = filterColumn;
|
|
694
757
|
const computedColumnTypes = [_dtableUtils.CellType.FORMULA, _dtableUtils.CellType.LINK_FORMULA, _dtableUtils.CellType.LINK];
|
|
695
758
|
const isContainPredicate = [_dtableUtils.FILTER_PREDICATE_TYPE.CONTAINS, _dtableUtils.FILTER_PREDICATE_TYPE.NOT_CONTAIN].includes(filter_predicate);
|
|
696
759
|
const isRenderErrorTips = this.isRenderErrorTips();
|
|
@@ -701,7 +764,7 @@ class FilterItem extends _react.default.Component {
|
|
|
701
764
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
702
765
|
className: "filter-item",
|
|
703
766
|
children: [!readOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
704
|
-
className: "delete-filter",
|
|
767
|
+
className: "delete-filter seatable-icon-btn",
|
|
705
768
|
onClick: this.onDeleteFilter,
|
|
706
769
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
707
770
|
className: "dtable-font dtable-icon-fork-number"
|
|
@@ -289,8 +289,8 @@
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
.dtable-ui-filters-list .delete-filter {
|
|
292
|
-
width:
|
|
293
|
-
height:
|
|
292
|
+
width: 24px;
|
|
293
|
+
height: 24px;
|
|
294
294
|
margin-right: 14px;
|
|
295
295
|
text-align: center;
|
|
296
296
|
}
|
|
@@ -301,8 +301,8 @@
|
|
|
301
301
|
|
|
302
302
|
.dtable-ui-filters-list .delete-filter .dtable-icon-fork-number {
|
|
303
303
|
display: inline-block;
|
|
304
|
-
font-size:
|
|
305
|
-
color:
|
|
304
|
+
font-size: 16px;
|
|
305
|
+
color: var(--bs-icon-color);
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
.dtable-ui-filters-list .multiple-option-name {
|
|
@@ -388,7 +388,7 @@
|
|
|
388
388
|
}
|
|
389
389
|
|
|
390
390
|
.dtable-ui-filters-list .filter-item .dtable-icon-fork-number:hover {
|
|
391
|
-
color:
|
|
391
|
+
color: var(--bs-icon-color);
|
|
392
392
|
}
|
|
393
393
|
|
|
394
394
|
.dtable-ui-filters-list .filter-container-readonly .dtable-select .selected-option-show,
|