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
|
@@ -18,8 +18,10 @@ 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
|
-
|
|
21
|
+
const {
|
|
22
|
+
type,
|
|
23
|
+
data
|
|
24
|
+
} = column;
|
|
23
25
|
if (_constants.MULTIPLE_SELECTOR_COLUMNS.includes(type)) {
|
|
24
26
|
return true;
|
|
25
27
|
}
|
|
@@ -27,15 +29,17 @@ const isFilterTermArray = (column, filterPredicate) => {
|
|
|
27
29
|
return true;
|
|
28
30
|
}
|
|
29
31
|
if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type]) {
|
|
30
|
-
const
|
|
31
|
-
result_type
|
|
32
|
-
array_type
|
|
32
|
+
const {
|
|
33
|
+
result_type,
|
|
34
|
+
array_type
|
|
35
|
+
} = data || {};
|
|
33
36
|
if (result_type !== _dtableUtils.FORMULA_RESULT_TYPE.ARRAY) return false;
|
|
34
37
|
return isArrayFilterTermByArrayType(array_type);
|
|
35
38
|
}
|
|
36
39
|
if (type === _dtableUtils.CellType.LINK) {
|
|
37
|
-
const
|
|
38
|
-
array_type
|
|
40
|
+
const {
|
|
41
|
+
array_type
|
|
42
|
+
} = data || {};
|
|
39
43
|
return isArrayFilterTermByArrayType(array_type);
|
|
40
44
|
}
|
|
41
45
|
return false;
|
|
@@ -43,8 +47,10 @@ const isFilterTermArray = (column, filterPredicate) => {
|
|
|
43
47
|
exports.isFilterTermArray = isFilterTermArray;
|
|
44
48
|
const getUpdatedFilterByCreator = (filter, collaborator) => {
|
|
45
49
|
const multipleSelectType = [_dtableUtils.FILTER_PREDICATE_TYPE.CONTAINS, _dtableUtils.FILTER_PREDICATE_TYPE.NOT_CONTAIN];
|
|
46
|
-
let
|
|
47
|
-
|
|
50
|
+
let {
|
|
51
|
+
filter_predicate,
|
|
52
|
+
filter_term: filterTerm
|
|
53
|
+
} = filter;
|
|
48
54
|
if (multipleSelectType.includes(filter_predicate)) {
|
|
49
55
|
filterTerm = filterTerm ? filter.filter_term.slice(0) : [];
|
|
50
56
|
let selectedEmail = collaborator.email;
|
|
@@ -118,15 +124,18 @@ const getUpdatedFilterByRate = (filter, value) => {
|
|
|
118
124
|
};
|
|
119
125
|
exports.getUpdatedFilterByRate = getUpdatedFilterByRate;
|
|
120
126
|
const getColumnOptions = column => {
|
|
121
|
-
const
|
|
122
|
-
|
|
127
|
+
const {
|
|
128
|
+
type,
|
|
129
|
+
data
|
|
130
|
+
} = column;
|
|
123
131
|
if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type]) {
|
|
124
132
|
return getFormulaColumnFilterOptions(column);
|
|
125
133
|
}
|
|
126
134
|
if (type === _dtableUtils.CellType.LINK) {
|
|
127
|
-
const
|
|
128
|
-
array_type
|
|
129
|
-
array_data
|
|
135
|
+
const {
|
|
136
|
+
array_type,
|
|
137
|
+
array_data
|
|
138
|
+
} = data || {};
|
|
130
139
|
if (array_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
131
140
|
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
132
141
|
type: _dtableUtils.CellType.CHECKBOX
|
|
@@ -143,11 +152,14 @@ const getColumnOptions = column => {
|
|
|
143
152
|
};
|
|
144
153
|
exports.getColumnOptions = getColumnOptions;
|
|
145
154
|
const getFormulaColumnFilterOptions = column => {
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
const {
|
|
156
|
+
data
|
|
157
|
+
} = column;
|
|
158
|
+
const {
|
|
159
|
+
result_type,
|
|
160
|
+
array_type,
|
|
161
|
+
array_data
|
|
162
|
+
} = data || {};
|
|
151
163
|
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
152
164
|
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
153
165
|
type: _dtableUtils.CellType.CHECKBOX
|
|
@@ -203,7 +215,9 @@ const getFilterOptionsByArrayType = (array_type, array_data) => {
|
|
|
203
215
|
type: _dtableUtils.CellType.TEXT,
|
|
204
216
|
data: array_data
|
|
205
217
|
});
|
|
206
|
-
const
|
|
218
|
+
const {
|
|
219
|
+
filterPredicateList
|
|
220
|
+
} = filterOptions;
|
|
207
221
|
if (filterPredicateList && !filterPredicateList.includes(_dtableUtils.FILTER_PREDICATE_TYPE.EMPTY)) {
|
|
208
222
|
filterPredicateList.push(_dtableUtils.FILTER_PREDICATE_TYPE.EMPTY);
|
|
209
223
|
}
|
|
@@ -214,10 +228,13 @@ const getFilterOptionsByArrayType = (array_type, array_data) => {
|
|
|
214
228
|
};
|
|
215
229
|
const getFilterByColumn = function (column) {
|
|
216
230
|
let filter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
231
|
+
let {
|
|
232
|
+
type: columnType,
|
|
233
|
+
data: columnData
|
|
234
|
+
} = column;
|
|
235
|
+
let {
|
|
236
|
+
filterPredicateList
|
|
237
|
+
} = getColumnOptions(column);
|
|
221
238
|
if (!filterPredicateList) return;
|
|
222
239
|
let filterPredicate = filterPredicateList[0];
|
|
223
240
|
let updatedFilter = Object.assign({}, filter, {
|
|
@@ -236,7 +253,9 @@ const getFilterByColumn = function (column) {
|
|
|
236
253
|
}
|
|
237
254
|
// rate
|
|
238
255
|
if (columnType === _dtableUtils.CellType.RATE) {
|
|
239
|
-
const
|
|
256
|
+
const {
|
|
257
|
+
rate_max_number
|
|
258
|
+
} = columnData;
|
|
240
259
|
updatedFilter.filter_term = rate_max_number;
|
|
241
260
|
return updatedFilter;
|
|
242
261
|
}
|
|
@@ -262,9 +281,10 @@ const getFilterByColumn = function (column) {
|
|
|
262
281
|
}
|
|
263
282
|
// link
|
|
264
283
|
if (columnType === _dtableUtils.CellType.LINK) {
|
|
265
|
-
let
|
|
266
|
-
array_type
|
|
267
|
-
array_data
|
|
284
|
+
let {
|
|
285
|
+
array_type,
|
|
286
|
+
array_data
|
|
287
|
+
} = columnData || {};
|
|
268
288
|
if (array_type) {
|
|
269
289
|
if (array_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
270
290
|
array_type = _dtableUtils.CellType.CHECKBOX;
|
|
@@ -288,11 +308,14 @@ const getFilterByColumn = function (column) {
|
|
|
288
308
|
};
|
|
289
309
|
exports.getFilterByColumn = getFilterByColumn;
|
|
290
310
|
const getFormulaColumnFilter = (column, filter) => {
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
311
|
+
const {
|
|
312
|
+
data
|
|
313
|
+
} = column;
|
|
314
|
+
let {
|
|
315
|
+
result_type,
|
|
316
|
+
array_type,
|
|
317
|
+
array_data
|
|
318
|
+
} = data || {};
|
|
296
319
|
if (result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY) {
|
|
297
320
|
const linkedColumn = {
|
|
298
321
|
key: column.key,
|
|
@@ -333,7 +356,9 @@ const getUpdatedFilterByPredicate = (filter, column, filterPredicate) => {
|
|
|
333
356
|
let updatedFilter = Object.assign({}, filter, {
|
|
334
357
|
filter_predicate: filterPredicate
|
|
335
358
|
});
|
|
336
|
-
let
|
|
359
|
+
let {
|
|
360
|
+
type: columnType
|
|
361
|
+
} = column;
|
|
337
362
|
if (columnType === _dtableUtils.CellType.CHECKBOX) {
|
|
338
363
|
updatedFilter.filter_term = false;
|
|
339
364
|
return updatedFilter;
|
|
@@ -416,7 +441,9 @@ const getFormulaAndLinkFilters = (filters, columns) => {
|
|
|
416
441
|
let formulaFilters = [];
|
|
417
442
|
filters.forEach(filter => {
|
|
418
443
|
const filterColumn = columns.find(column => column.key === (filter === null || filter === void 0 ? void 0 : filter.column_key));
|
|
419
|
-
const
|
|
444
|
+
const {
|
|
445
|
+
type
|
|
446
|
+
} = filterColumn;
|
|
420
447
|
if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type] || type === _dtableUtils.CellType.LINK) {
|
|
421
448
|
formulaFilters.push(filter);
|
|
422
449
|
}
|
|
@@ -426,8 +453,10 @@ const getFormulaAndLinkFilters = (filters, columns) => {
|
|
|
426
453
|
exports.getFormulaAndLinkFilters = getFormulaAndLinkFilters;
|
|
427
454
|
const getFilterColumns = columns => {
|
|
428
455
|
return columns.filter(column => {
|
|
429
|
-
const
|
|
430
|
-
|
|
456
|
+
const {
|
|
457
|
+
data,
|
|
458
|
+
type
|
|
459
|
+
} = column;
|
|
431
460
|
if (data && (type === _dtableUtils.CellType.LINK || _dtableUtils.FORMULA_COLUMN_TYPES_MAP[type] && data.result_type === _dtableUtils.FORMULA_RESULT_TYPE.ARRAY)) {
|
|
432
461
|
return (0, _dtableUtils.checkColumnHasFilterOptions)({
|
|
433
462
|
type: data.array_type,
|
|
@@ -439,14 +468,18 @@ const getFilterColumns = columns => {
|
|
|
439
468
|
};
|
|
440
469
|
exports.getFilterColumns = getFilterColumns;
|
|
441
470
|
const applyFilterOperation = operation => {
|
|
442
|
-
const
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
471
|
+
const {
|
|
472
|
+
type,
|
|
473
|
+
filter_conjunction,
|
|
474
|
+
filters,
|
|
475
|
+
payload
|
|
476
|
+
} = operation;
|
|
446
477
|
switch (type) {
|
|
447
478
|
case _constants.FILTER_OPERATION_TYPE.MODIFY_CONJUNCTION:
|
|
448
479
|
{
|
|
449
|
-
const
|
|
480
|
+
const {
|
|
481
|
+
new_filter_conjunction
|
|
482
|
+
} = payload;
|
|
450
483
|
return {
|
|
451
484
|
filter_conjunction: new_filter_conjunction,
|
|
452
485
|
filters
|
|
@@ -454,7 +487,9 @@ const applyFilterOperation = operation => {
|
|
|
454
487
|
}
|
|
455
488
|
case _constants.FILTER_OPERATION_TYPE.DELETE_FILTER:
|
|
456
489
|
{
|
|
457
|
-
const
|
|
490
|
+
const {
|
|
491
|
+
filter_index
|
|
492
|
+
} = payload;
|
|
458
493
|
let updatedFilters = [...filters];
|
|
459
494
|
if (!updatedFilters[filter_index]) {
|
|
460
495
|
return {
|
|
@@ -470,8 +505,10 @@ const applyFilterOperation = operation => {
|
|
|
470
505
|
}
|
|
471
506
|
case _constants.FILTER_OPERATION_TYPE.UPDATE_FILTER:
|
|
472
507
|
{
|
|
473
|
-
const
|
|
474
|
-
|
|
508
|
+
const {
|
|
509
|
+
filter_index,
|
|
510
|
+
new_filter
|
|
511
|
+
} = payload;
|
|
475
512
|
let updatedFilters = [...filters];
|
|
476
513
|
if (!updatedFilters[filter_index]) {
|
|
477
514
|
return {
|
|
@@ -487,10 +524,12 @@ const applyFilterOperation = operation => {
|
|
|
487
524
|
}
|
|
488
525
|
case _constants.FILTER_OPERATION_TYPE.MOVE_FILTER:
|
|
489
526
|
{
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
527
|
+
const {
|
|
528
|
+
source_filter_index,
|
|
529
|
+
target_filter_index,
|
|
530
|
+
source_group_index,
|
|
531
|
+
target_group_index
|
|
532
|
+
} = payload;
|
|
494
533
|
const isFromFilterGroup = typeof source_group_index === 'number';
|
|
495
534
|
const isToFilterGroup = typeof target_group_index === 'number';
|
|
496
535
|
let updatedFilters = [...filters];
|
|
@@ -551,8 +590,10 @@ const applyFilterOperation = operation => {
|
|
|
551
590
|
}
|
|
552
591
|
case _constants.FILTER_OPERATION_TYPE.ADD_FILTER_INTO_GROUP:
|
|
553
592
|
{
|
|
554
|
-
const
|
|
555
|
-
|
|
593
|
+
const {
|
|
594
|
+
filter,
|
|
595
|
+
group_index
|
|
596
|
+
} = payload;
|
|
556
597
|
let updatedFilters = [...filters];
|
|
557
598
|
let updatedFilterGroup = updatedFilters[group_index];
|
|
558
599
|
if (!updatedFilterGroup) {
|
|
@@ -573,8 +614,10 @@ const applyFilterOperation = operation => {
|
|
|
573
614
|
}
|
|
574
615
|
case _constants.FILTER_OPERATION_TYPE.MODIFY_CONJUNCTION_IN_GROUP:
|
|
575
616
|
{
|
|
576
|
-
const
|
|
577
|
-
|
|
617
|
+
const {
|
|
618
|
+
group_index,
|
|
619
|
+
new_filter_conjunction
|
|
620
|
+
} = payload;
|
|
578
621
|
let updatedFilters = [...filters];
|
|
579
622
|
let updatedFilterGroup = updatedFilters[group_index];
|
|
580
623
|
if (!updatedFilterGroup) {
|
|
@@ -591,8 +634,10 @@ const applyFilterOperation = operation => {
|
|
|
591
634
|
}
|
|
592
635
|
case _constants.FILTER_OPERATION_TYPE.DELETE_FILTER_IN_GROUP:
|
|
593
636
|
{
|
|
594
|
-
const
|
|
595
|
-
|
|
637
|
+
const {
|
|
638
|
+
group_index,
|
|
639
|
+
filter_index
|
|
640
|
+
} = payload;
|
|
596
641
|
let updatedFilters = [...filters];
|
|
597
642
|
let updatedFilterGroup = updatedFilters[group_index];
|
|
598
643
|
if (!updatedFilterGroup || !updatedFilterGroup.filters || !updatedFilterGroup.filters[filter_index]) {
|
|
@@ -611,9 +656,11 @@ const applyFilterOperation = operation => {
|
|
|
611
656
|
}
|
|
612
657
|
case _constants.FILTER_OPERATION_TYPE.UPDATE_FILTER_IN_GROUP:
|
|
613
658
|
{
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
|
|
659
|
+
const {
|
|
660
|
+
group_index,
|
|
661
|
+
filter_index,
|
|
662
|
+
new_filter
|
|
663
|
+
} = payload;
|
|
617
664
|
let updatedFilters = [...filters];
|
|
618
665
|
let updatedFilterGroup = updatedFilters[group_index];
|
|
619
666
|
if (!updatedFilterGroup || !updatedFilterGroup.filters || !updatedFilterGroup.filters[filter_index]) {
|
|
@@ -674,15 +721,18 @@ const getCreatorUpdatedFilterTerm = (filterTerm, filterPredicate, collaborator)
|
|
|
674
721
|
};
|
|
675
722
|
exports.getCreatorUpdatedFilterTerm = getCreatorUpdatedFilterTerm;
|
|
676
723
|
const getFilterConfigOptions = column => {
|
|
677
|
-
const
|
|
678
|
-
|
|
724
|
+
const {
|
|
725
|
+
type,
|
|
726
|
+
data
|
|
727
|
+
} = column;
|
|
679
728
|
if (_dtableUtils.FORMULA_COLUMN_TYPES_MAP[type]) {
|
|
680
729
|
return getFormulaColumnFilterOptions(column);
|
|
681
730
|
}
|
|
682
731
|
if (type === _dtableUtils.CellType.LINK) {
|
|
683
|
-
const
|
|
684
|
-
array_type
|
|
685
|
-
array_data
|
|
732
|
+
const {
|
|
733
|
+
array_type,
|
|
734
|
+
array_data
|
|
735
|
+
} = data || {};
|
|
686
736
|
if (array_type === _dtableUtils.FORMULA_RESULT_TYPE.BOOL) {
|
|
687
737
|
return (0, _dtableUtils.getColumnFilterOptions)({
|
|
688
738
|
type: _dtableUtils.CellType.CHECKBOX
|
|
@@ -66,14 +66,15 @@ 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
|
|
69
|
+
let {
|
|
70
|
+
filterIndex,
|
|
71
|
+
filterTerm,
|
|
72
|
+
collaborators,
|
|
73
|
+
placeholder,
|
|
74
|
+
filter_predicate,
|
|
75
|
+
isInModal,
|
|
76
|
+
readOnly
|
|
77
|
+
} = this.props;
|
|
77
78
|
let isSupportMultipleSelect = this.supportMultipleSelectOptions.indexOf(filter_predicate) > -1 ? true : false;
|
|
78
79
|
let selectedCollaborators = Array.isArray(filterTerm) && filterTerm.length > 0 && filterTerm.map(item => {
|
|
79
80
|
let collaborator = collaborators.find(c => c.email === item);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").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"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
11
|
var _ModalPortal = _interopRequireDefault(require("../../../ModalPortal"));
|
|
@@ -17,18 +16,14 @@ var _lang = require("../../../lang");
|
|
|
17
16
|
var _departments = require("../../../constants/departments");
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
18
|
function DepartmentMultipleSelectFilter(props) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const _useState3 = (0, _react.useState)(value || []),
|
|
29
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
30
|
-
selectedDepartments = _useState4[0],
|
|
31
|
-
setSelectedDepartments = _useState4[1];
|
|
19
|
+
const {
|
|
20
|
+
value,
|
|
21
|
+
isInModal,
|
|
22
|
+
readOnly,
|
|
23
|
+
departments
|
|
24
|
+
} = props;
|
|
25
|
+
const [isShowSelector, setIsShowSelector] = (0, _react.useState)(false);
|
|
26
|
+
const [selectedDepartments, setSelectedDepartments] = (0, _react.useState)(value || []);
|
|
32
27
|
const selectorRef = (0, _react.useRef)(null);
|
|
33
28
|
(0, _commonHooks.useClickOutside)({
|
|
34
29
|
currDOM: selectorRef.current,
|
|
@@ -36,8 +31,10 @@ function DepartmentMultipleSelectFilter(props) {
|
|
|
36
31
|
}, [selectedDepartments]);
|
|
37
32
|
function renderUserDepartmentOptions() {
|
|
38
33
|
return _departments.DEPARTMENT_SELECT_RANGE_OPTIONS.slice(0, 2).map((option, index) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
34
|
+
const {
|
|
35
|
+
type,
|
|
36
|
+
name
|
|
37
|
+
} = option;
|
|
41
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
42
39
|
className: "department-item",
|
|
43
40
|
onClick: event => selectDepartment(event, type),
|
package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").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"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
11
|
var _SelectedDepartments = _interopRequireDefault(require("../../../SelectedDepartments"));
|
|
@@ -17,20 +16,16 @@ var _commonHooks = require("../../../hooks/common-hooks");
|
|
|
17
16
|
var _lang = require("../../../lang");
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
18
|
function DepartmentSingleSelectFilter(props) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const _useState3 = (0, _react.useState)(value || ''),
|
|
31
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
32
|
-
selectedDepartment = _useState4[0],
|
|
33
|
-
setSelectedDepartment = _useState4[1];
|
|
19
|
+
const {
|
|
20
|
+
value,
|
|
21
|
+
column,
|
|
22
|
+
isInModal,
|
|
23
|
+
userDepartmentIdsMap,
|
|
24
|
+
departments,
|
|
25
|
+
readOnly
|
|
26
|
+
} = props;
|
|
27
|
+
const [isShowSelector, setIsShowSelector] = (0, _react.useState)(false);
|
|
28
|
+
const [selectedDepartment, setSelectedDepartment] = (0, _react.useState)(value || '');
|
|
34
29
|
const selectorRef = (0, _react.useRef)(null);
|
|
35
30
|
let selectedDepartmentIds = [];
|
|
36
31
|
selectedDepartmentIds.push(value);
|
|
@@ -41,8 +36,10 @@ function DepartmentSingleSelectFilter(props) {
|
|
|
41
36
|
function renderUserDepartmentOptions(onSelect) {
|
|
42
37
|
if (!departments || departments.length === 0) return [];
|
|
43
38
|
return _departments.DEPARTMENT_SELECT_RANGE_OPTIONS.slice(0, 2).map((option, index) => {
|
|
44
|
-
const
|
|
45
|
-
|
|
39
|
+
const {
|
|
40
|
+
type,
|
|
41
|
+
name
|
|
42
|
+
} = option;
|
|
46
43
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
47
44
|
className: "department-item",
|
|
48
45
|
onClick: event => onSelect(event, type),
|
|
@@ -24,7 +24,9 @@ class FilterCalendar extends _react.Component {
|
|
|
24
24
|
e.preventDefault();
|
|
25
25
|
};
|
|
26
26
|
this.onChange = value => {
|
|
27
|
-
const
|
|
27
|
+
const {
|
|
28
|
+
onChange
|
|
29
|
+
} = this.props;
|
|
28
30
|
const searchFormat = 'YYYY-MM-DD';
|
|
29
31
|
this.setState({
|
|
30
32
|
value
|
|
@@ -86,9 +88,10 @@ class FilterCalendar extends _react.Component {
|
|
|
86
88
|
this.defaultCalendarValue = null;
|
|
87
89
|
}
|
|
88
90
|
componentDidMount() {
|
|
89
|
-
const
|
|
90
|
-
value
|
|
91
|
-
lang
|
|
91
|
+
const {
|
|
92
|
+
value,
|
|
93
|
+
lang
|
|
94
|
+
} = this.props;
|
|
92
95
|
const iszhcn = lang === 'zh-cn';
|
|
93
96
|
if (iszhcn) {
|
|
94
97
|
now = now.locale('zh-cn');
|
|
@@ -104,9 +107,10 @@ class FilterCalendar extends _react.Component {
|
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
render() {
|
|
107
|
-
const
|
|
108
|
-
isReadOnly
|
|
109
|
-
firstDayOfWeek
|
|
110
|
+
const {
|
|
111
|
+
isReadOnly,
|
|
112
|
+
firstDayOfWeek
|
|
113
|
+
} = this.props;
|
|
110
114
|
const state = this.state;
|
|
111
115
|
if (isReadOnly) return /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
112
116
|
className: "ant-calendar-picker-input ant-input form-control",
|
|
@@ -152,7 +156,9 @@ class FilterCalendar extends _react.Component {
|
|
|
152
156
|
zIndex: 1001
|
|
153
157
|
},
|
|
154
158
|
children: _ref => {
|
|
155
|
-
let
|
|
159
|
+
let {
|
|
160
|
+
value
|
|
161
|
+
} = _ref;
|
|
156
162
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
157
163
|
tabIndex: "0",
|
|
158
164
|
onFocus: this.onReadOnlyFocus,
|
|
@@ -21,8 +21,12 @@ class FilterGroup extends _react.Component {
|
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
23
|
this.onSelectGroupConjunction = conjunctionOption => {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const {
|
|
25
|
+
filterConjunction
|
|
26
|
+
} = this.props;
|
|
27
|
+
const {
|
|
28
|
+
filterConjunction: newConjunction
|
|
29
|
+
} = conjunctionOption;
|
|
26
30
|
if (newConjunction === filterConjunction) {
|
|
27
31
|
return;
|
|
28
32
|
}
|
|
@@ -30,17 +34,22 @@ class FilterGroup extends _react.Component {
|
|
|
30
34
|
};
|
|
31
35
|
this.deleteFilterGroup = event => {
|
|
32
36
|
event.nativeEvent.stopImmediatePropagation();
|
|
33
|
-
const
|
|
37
|
+
const {
|
|
38
|
+
index
|
|
39
|
+
} = this.props;
|
|
34
40
|
this.props.deleteFilterGroup(index);
|
|
35
41
|
};
|
|
36
42
|
this.modifyConjunctionInGroup = new_filter_conjunction => {
|
|
37
|
-
const
|
|
43
|
+
const {
|
|
44
|
+
index
|
|
45
|
+
} = this.props;
|
|
38
46
|
this.props.modifyConjunctionInGroup(index, new_filter_conjunction);
|
|
39
47
|
};
|
|
40
48
|
this.addFilterIntoGroup = () => {
|
|
41
|
-
const
|
|
42
|
-
columns
|
|
43
|
-
index
|
|
49
|
+
const {
|
|
50
|
+
columns,
|
|
51
|
+
index
|
|
52
|
+
} = this.props;
|
|
44
53
|
const newFilter = (0, _utils.getDefaultFilter)(columns);
|
|
45
54
|
if (!newFilter) {
|
|
46
55
|
return;
|
|
@@ -48,18 +57,23 @@ class FilterGroup extends _react.Component {
|
|
|
48
57
|
this.props.addFilterIntoGroup(index, newFilter);
|
|
49
58
|
};
|
|
50
59
|
this.deleteFilterInGroup = filter_index => {
|
|
51
|
-
const
|
|
60
|
+
const {
|
|
61
|
+
index
|
|
62
|
+
} = this.props;
|
|
52
63
|
this.props.deleteFilterInGroup(index, filter_index);
|
|
53
64
|
};
|
|
54
65
|
this.updateFilterInGroup = (filter_index, new_filter) => {
|
|
55
|
-
const
|
|
66
|
+
const {
|
|
67
|
+
index
|
|
68
|
+
} = this.props;
|
|
56
69
|
this.props.updateFilterInGroup(index, filter_index, new_filter);
|
|
57
70
|
};
|
|
58
71
|
this.renderConjunction = () => {
|
|
59
|
-
const
|
|
60
|
-
index
|
|
61
|
-
filterConjunction
|
|
62
|
-
conjunctionOptions
|
|
72
|
+
const {
|
|
73
|
+
index,
|
|
74
|
+
filterConjunction,
|
|
75
|
+
conjunctionOptions
|
|
76
|
+
} = this.props;
|
|
63
77
|
switch (index) {
|
|
64
78
|
case 0:
|
|
65
79
|
{
|
|
@@ -84,29 +98,35 @@ class FilterGroup extends _react.Component {
|
|
|
84
98
|
}
|
|
85
99
|
};
|
|
86
100
|
this.renderGroupFilters = () => {
|
|
87
|
-
const
|
|
88
|
-
columns
|
|
89
|
-
conjunctionOptions
|
|
90
|
-
columnOptions
|
|
91
|
-
filter
|
|
92
|
-
groupIndex
|
|
93
|
-
collaborators
|
|
94
|
-
lang
|
|
95
|
-
userDepartmentIdsMap
|
|
96
|
-
departments
|
|
97
|
-
firstDayOfWeek
|
|
98
|
-
readOnly
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
const {
|
|
102
|
+
columns,
|
|
103
|
+
conjunctionOptions,
|
|
104
|
+
columnOptions,
|
|
105
|
+
filter,
|
|
106
|
+
index: groupIndex,
|
|
107
|
+
collaborators,
|
|
108
|
+
lang,
|
|
109
|
+
userDepartmentIdsMap,
|
|
110
|
+
departments,
|
|
111
|
+
firstDayOfWeek,
|
|
112
|
+
readOnly
|
|
113
|
+
} = this.props;
|
|
114
|
+
const {
|
|
115
|
+
filters: subFilters,
|
|
116
|
+
filter_conjunction
|
|
117
|
+
} = filter;
|
|
101
118
|
const subFilterConjunction = _constants.SUPPORT_CONJUNCTIONS.includes(filter_conjunction) ? filter_conjunction : _dtableUtils.FILTER_CONJUNCTION_TYPE.AND;
|
|
102
119
|
const subFiltersLength = Array.isArray(subFilters) ? subFilters.length : 0;
|
|
103
120
|
if (subFiltersLength === 0) {
|
|
104
121
|
return null;
|
|
105
122
|
}
|
|
106
123
|
return subFilters.map((currentFilter, subFilterIndex) => {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
124
|
+
const {
|
|
125
|
+
column_key: sub_filter_column_key
|
|
126
|
+
} = currentFilter;
|
|
127
|
+
const {
|
|
128
|
+
error_message
|
|
129
|
+
} = _dtableUtils.ValidateFilter.validate(currentFilter, columns);
|
|
110
130
|
const filterColumn = columns.find(column => column.key === sub_filter_column_key) || {};
|
|
111
131
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_filterItem.default, {
|
|
112
132
|
isInModal: this.props.isInModal,
|
|
@@ -131,14 +151,15 @@ class FilterGroup extends _react.Component {
|
|
|
131
151
|
};
|
|
132
152
|
}
|
|
133
153
|
render() {
|
|
134
|
-
const
|
|
135
|
-
level
|
|
136
|
-
index
|
|
137
|
-
readOnly
|
|
154
|
+
const {
|
|
155
|
+
level,
|
|
156
|
+
index,
|
|
157
|
+
readOnly
|
|
158
|
+
} = this.props;
|
|
138
159
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
139
160
|
className: (0, _classnames.default)('filter-item', 'filter-group', "level-".concat(level)),
|
|
140
161
|
children: [!readOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
141
|
-
className: "delete-filter",
|
|
162
|
+
className: "delete-filter seatable-icon-btn",
|
|
142
163
|
onClick: this.deleteFilterGroup,
|
|
143
164
|
role: "button",
|
|
144
165
|
tabIndex: 0,
|