dtable-ui-component 6.0.42 → 6.0.44
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/CheckboxEditor/mb-editor.js +4 -0
- package/lib/CheckboxEditor/pc-editor.js +4 -0
- package/lib/DTableCommonAddTool/index.js +1 -1
- package/lib/DTableCustomizeSelect/index.css +3 -3
- package/lib/DTableFiltersPopover/constants/index.js +30 -2
- package/lib/DTableFiltersPopover/index.css +54 -15
- package/lib/DTableFiltersPopover/index.js +117 -135
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +10 -4
- package/lib/DTableFiltersPopover/utils/index.js +354 -83
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +7 -5
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +20 -7
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +25 -6
- package/lib/DTableFiltersPopover/widgets/filter-calendar.js +1 -1
- package/lib/DTableFiltersPopover/widgets/filter-group.js +188 -0
- package/lib/DTableFiltersPopover/widgets/filter-item.js +193 -66
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +183 -74
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +232 -42
- package/lib/DTableGroupSelect/index.css +3 -3
- package/lib/DTableGroupSelect/select-option-group.css +5 -5
- package/lib/DTableSearchInput/index.js +2 -2
- package/lib/DepartmentMultipleSelectEditor/index.js +22 -4
- package/lib/DurationEditor/index.js +19 -4
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +29 -33
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +28 -27
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +27 -26
- package/lib/NumberEditor/index.js +4 -2
- package/lib/SelectOptionGroup/index.css +13 -8
- package/lib/locales/de.json +5 -0
- package/lib/locales/en.json +5 -0
- package/lib/locales/es.json +5 -0
- package/lib/locales/fr.json +5 -0
- package/lib/locales/pt.json +5 -0
- package/lib/locales/ru.json +5 -0
- package/lib/locales/zh-CN.json +5 -0
- package/lib/utils/column-utils.js +21 -2
- package/package.json +4 -4
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.css +0 -0
|
@@ -28,6 +28,10 @@ class MBCheckboxEditor extends _react.Component {
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
this.onChangeCheckboxValue = event => {
|
|
31
|
+
const {
|
|
32
|
+
readOnly
|
|
33
|
+
} = this.props;
|
|
34
|
+
if (readOnly) return;
|
|
31
35
|
if (event) {
|
|
32
36
|
event.stopPropagation();
|
|
33
37
|
event.nativeEvent.stopImmediatePropagation();
|
|
@@ -39,6 +39,10 @@ class PCCheckboxEditor extends _react.Component {
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
this.onChangeCheckboxValue = event => {
|
|
42
|
+
const {
|
|
43
|
+
readOnly
|
|
44
|
+
} = this.props;
|
|
45
|
+
if (readOnly) return;
|
|
42
46
|
if (event) {
|
|
43
47
|
event.stopPropagation();
|
|
44
48
|
event.nativeEvent.stopImmediatePropagation();
|
|
@@ -23,7 +23,7 @@ function DTableCommonAddTool(_ref) {
|
|
|
23
23
|
}, !hideIcon && /*#__PURE__*/_react.default.createElement("span", {
|
|
24
24
|
className: "dtable-font dtable-icon-add-table ".concat(addIconClassName || '')
|
|
25
25
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
26
|
-
className: "text-truncate"
|
|
26
|
+
className: "add-new-option text-truncate"
|
|
27
27
|
}, footerName));
|
|
28
28
|
}
|
|
29
29
|
var _default = exports.default = DTableCommonAddTool;
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
background: #fff;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.dtable-select.
|
|
60
|
+
.dtable-select.dtable-ui-collaborator-selector .option-group .option-group-content,
|
|
61
61
|
.dtable-select.selector-group .option-group .option-group-content {
|
|
62
62
|
padding: 10px;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
.dtable-select.custom-select.
|
|
65
|
+
.dtable-select.custom-select.dtable-ui-collaborator-selector .option-group .option-group-content {
|
|
66
66
|
padding: 10px 0;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.dtable-select.custom-select.
|
|
69
|
+
.dtable-select.custom-select.dtable-ui-collaborator-selector .option {
|
|
70
70
|
padding: 5px 0 5px 10px !important;
|
|
71
71
|
line-height: 20px;
|
|
72
72
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.STRING_PREDICATE = exports.SPECIAL_TERM_TYPE = exports.SIMPLE_TEXT_INPUT_COLUMNS_MAP = exports.MULTIPLE_SELECTOR_COLUMNS = exports.FORMULA_COLUMN_TYPES = exports.FILTER_TERM_MODIFIER_SHOW = exports.DATE_LABEL_MAP = exports.DATE_EMPTY_LABEL_MAP = exports.ARRAY_PREDICATE = void 0;
|
|
6
|
+
exports.SUPPORT_CONJUNCTIONS = exports.STRING_PREDICATE = exports.SPECIAL_TERM_TYPE = exports.SIMPLE_TEXT_INPUT_COLUMNS_MAP = exports.MULTIPLE_SELECTOR_COLUMNS = exports.INPUT_CMP_TYPE_MAP = exports.FORMULA_COLUMN_TYPES = exports.FILTER_TERM_MODIFIER_SHOW = exports.FILTER_OPERATION_TYPE = exports.FILTER_ERR_MSG_LIST = exports.FILTER_ACTION_TYPE = exports.EMPTY_PREDICATE = exports.DELETED_OPTION_TIPS = exports.DELETED_OPTION_BACKGROUND_COLOR = exports.DATE_LABEL_MAP = exports.DATE_EMPTY_LABEL_MAP = exports.ARRAY_PREDICATE = void 0;
|
|
7
7
|
var _dtableUtils = require("dtable-utils");
|
|
8
8
|
const FORMULA_COLUMN_TYPES = exports.FORMULA_COLUMN_TYPES = [_dtableUtils.CellType.FORMULA, _dtableUtils.CellType.LINK_FORMULA];
|
|
9
9
|
const SPECIAL_TERM_TYPE = exports.SPECIAL_TERM_TYPE = {
|
|
@@ -67,4 +67,32 @@ const FILTER_TERM_MODIFIER_SHOW = exports.FILTER_TERM_MODIFIER_SHOW = {
|
|
|
67
67
|
'this_week': 'This_week',
|
|
68
68
|
'this_month': 'This_month',
|
|
69
69
|
'this_year': 'This_year'
|
|
70
|
-
};
|
|
70
|
+
};
|
|
71
|
+
const FILTER_ACTION_TYPE = exports.FILTER_ACTION_TYPE = {
|
|
72
|
+
DELETE: 'delete',
|
|
73
|
+
ADD: 'add',
|
|
74
|
+
UPDATE_FILTER_CONJUNCTION: 'update_filter_conjunction',
|
|
75
|
+
UPDATE_FILTER: 'update_filter'
|
|
76
|
+
};
|
|
77
|
+
const FILTER_ERR_MSG_LIST = exports.FILTER_ERR_MSG_LIST = [_dtableUtils.FILTER_ERR_MSG.INVALID_FILTER, _dtableUtils.FILTER_ERR_MSG.INCOMPLETE_FILTER, _dtableUtils.FILTER_ERR_MSG.COLUMN_MISSING, _dtableUtils.FILTER_ERR_MSG.COLUMN_NOT_SUPPORTED, _dtableUtils.FILTER_ERR_MSG.UNMATCHED_PREDICATE, _dtableUtils.FILTER_ERR_MSG.UNMATCHED_MODIFIER, _dtableUtils.FILTER_ERR_MSG.INVALID_TERM];
|
|
78
|
+
const FILTER_OPERATION_TYPE = exports.FILTER_OPERATION_TYPE = {
|
|
79
|
+
MODIFY_CONJUNCTION: 'MODIFY_CONJUNCTION',
|
|
80
|
+
DELETE_FILTER: 'DELETE_FILTER',
|
|
81
|
+
UPDATE_FILTER: 'UPDATE_FILTER',
|
|
82
|
+
ADD_FILTER: 'ADD_FILTER',
|
|
83
|
+
MOVE_FILTER: 'MOVE_FILTER',
|
|
84
|
+
MODIFY_CONJUNCTION_IN_GROUP: 'MODIFY_CONJUNCTION_IN_GROUP',
|
|
85
|
+
ADD_FILTER_INTO_GROUP: 'ADD_FILTER_INTO_GROUP',
|
|
86
|
+
DELETE_FILTER_IN_GROUP: 'DELETE_FILTER_IN_GROUP',
|
|
87
|
+
UPDATE_FILTER_IN_GROUP: 'UPDATE_FILTER_IN_GROUP'
|
|
88
|
+
};
|
|
89
|
+
const INPUT_CMP_TYPE_MAP = exports.INPUT_CMP_TYPE_MAP = {
|
|
90
|
+
TEXT: 'text',
|
|
91
|
+
NUMBER: 'number',
|
|
92
|
+
DURATION: 'duration',
|
|
93
|
+
CHECKBOX: 'checkbox'
|
|
94
|
+
};
|
|
95
|
+
const SUPPORT_CONJUNCTIONS = exports.SUPPORT_CONJUNCTIONS = [_dtableUtils.FILTER_CONJUNCTION_TYPE.AND, _dtableUtils.FILTER_CONJUNCTION_TYPE.OR];
|
|
96
|
+
const EMPTY_PREDICATE = exports.EMPTY_PREDICATE = [_dtableUtils.FILTER_PREDICATE_TYPE.EMPTY, _dtableUtils.FILTER_PREDICATE_TYPE.NOT_EMPTY];
|
|
97
|
+
const DELETED_OPTION_BACKGROUND_COLOR = exports.DELETED_OPTION_BACKGROUND_COLOR = '#eaeaea';
|
|
98
|
+
const DELETED_OPTION_TIPS = exports.DELETED_OPTION_TIPS = 'deleted_option';
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
.dtable-filter-popover .popover {
|
|
1
|
+
.dtable-ui-filter-popover .popover {
|
|
2
2
|
max-width: none;
|
|
3
3
|
min-width: 300px;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.dtable-filter-popover .dtable-
|
|
6
|
+
.dtable-ui-filter-popover .popover .dtable-ui-filters-list {
|
|
7
|
+
max-height: calc(100vh - 170px);
|
|
8
|
+
overflow: auto;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dtable-ui-filter-popover .dtable-ui-filters-list .filter-container .filter-term .filter-popover-duration-editor {
|
|
12
|
+
width: 100% !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dtable-ui-filter-popover .filter-popover-footer {
|
|
7
16
|
display: flex;
|
|
8
17
|
align-items: center;
|
|
9
18
|
justify-content: flex-end;
|
|
@@ -11,28 +20,58 @@
|
|
|
11
20
|
border-top: 1px solid #e9ecef;
|
|
12
21
|
}
|
|
13
22
|
|
|
14
|
-
.dtable-filter-popover .
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
.dtable-ui-filter-popover .add-buttons {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
height: 40px;
|
|
27
|
+
padding: 0 1rem;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
background: #fff;
|
|
31
|
+
color: #666;
|
|
32
|
+
border-bottom-left-radius: 3px;
|
|
33
|
+
border-bottom-right-radius: 3px;
|
|
34
|
+
position: relative;
|
|
17
35
|
}
|
|
18
36
|
|
|
19
|
-
.dtable-filter-popover .
|
|
20
|
-
|
|
37
|
+
.dtable-ui-filter-popover .add-buttons .btn-add-filter,
|
|
38
|
+
.dtable-ui-filter-popover .add-buttons .btn-add-filter-group {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
height: 28px;
|
|
42
|
+
margin-left: -10px;
|
|
43
|
+
padding: 0 10px;
|
|
44
|
+
border-radius: 4px;
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
color: #666;
|
|
48
|
+
cursor: pointer;
|
|
21
49
|
}
|
|
22
50
|
|
|
23
|
-
.dtable-filter-popover .
|
|
24
|
-
|
|
25
|
-
background: #
|
|
51
|
+
.dtable-ui-filter-popover .add-buttons .btn-add-filter:hover,
|
|
52
|
+
.dtable-ui-filter-popover .add-buttons .btn-add-filter-group:hover {
|
|
53
|
+
background-color: #f5f5f5;
|
|
26
54
|
}
|
|
27
55
|
|
|
28
|
-
.dtable-filter-popover .
|
|
56
|
+
.dtable-ui-filter-popover .add-buttons .popover-add-icon {
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
font-weight: 600;
|
|
29
59
|
margin-right: 14px;
|
|
30
60
|
}
|
|
31
61
|
|
|
32
|
-
.dtable-filter-popover .
|
|
62
|
+
.dtable-ui-filter-popover .filter-term .checkbox-filter-term {
|
|
33
63
|
display: flex;
|
|
64
|
+
height: 100%;
|
|
34
65
|
align-items: center;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.dtable-ui-filter-popover .filter-term .dtable-ui-filter-item-checkbox {
|
|
69
|
+
width: 22px;
|
|
70
|
+
height: 22px;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
border: 2px solid #e0e0e0;
|
|
75
|
+
border-radius: 3px;
|
|
76
|
+
cursor: pointer;
|
|
38
77
|
}
|
|
@@ -7,19 +7,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _isHotkey = _interopRequireDefault(require("is-hotkey"));
|
|
11
10
|
var _reactstrap = require("reactstrap");
|
|
12
11
|
var _dtableUtils = require("dtable-utils");
|
|
13
12
|
var _DTableCommonAddTool = _interopRequireDefault(require("../DTableCommonAddTool"));
|
|
14
|
-
var _utils = require("
|
|
15
|
-
var _utils2 = require("./utils");
|
|
13
|
+
var _utils = require("./utils");
|
|
16
14
|
var _filterList = _interopRequireDefault(require("./widgets/filter-list"));
|
|
17
|
-
var
|
|
18
|
-
var _constants = require("
|
|
15
|
+
var _DTablePopover = _interopRequireDefault(require("../DTablePopover"));
|
|
16
|
+
var _constants = require("./constants");
|
|
19
17
|
var _lang = require("../lang");
|
|
20
18
|
require("./index.css");
|
|
21
19
|
/**
|
|
22
|
-
* filter
|
|
20
|
+
* filter data structure
|
|
21
|
+
* let filter = {
|
|
23
22
|
* column_key: '',
|
|
24
23
|
* filter_predicate: '',
|
|
25
24
|
* filter_term: '',
|
|
@@ -29,93 +28,60 @@ require("./index.css");
|
|
|
29
28
|
class DTableFiltersPopover extends _react.Component {
|
|
30
29
|
constructor(props) {
|
|
31
30
|
super(props);
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.isSelectOpen = status;
|
|
40
|
-
};
|
|
41
|
-
this.hideDTablePopover = e => {
|
|
42
|
-
if (this.dtablePopoverRef && !(0, _utils.getEventClassName)(e).includes('popover') && !this.dtablePopoverRef.contains(e.target)) {
|
|
43
|
-
this.props.hidePopover(e);
|
|
44
|
-
e.preventDefault();
|
|
45
|
-
e.stopPropagation();
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
this.isNeedSubmit = () => {
|
|
50
|
-
return this.props.isNeedSubmit;
|
|
51
|
-
};
|
|
52
|
-
this.update = filters => {
|
|
53
|
-
if (this.isNeedSubmit()) {
|
|
31
|
+
this.updateFilters = _ref => {
|
|
32
|
+
let {
|
|
33
|
+
filter_conjunction,
|
|
34
|
+
filters
|
|
35
|
+
} = _ref;
|
|
36
|
+
const filterConjunction = filter_conjunction || this.state.filterConjunction;
|
|
37
|
+
if (this.isNeedSubmit) {
|
|
54
38
|
const isSubmitDisabled = false;
|
|
55
39
|
this.setState({
|
|
56
40
|
filters,
|
|
41
|
+
filterConjunction,
|
|
57
42
|
isSubmitDisabled
|
|
58
43
|
});
|
|
59
44
|
return;
|
|
60
45
|
}
|
|
61
46
|
this.setState({
|
|
62
|
-
filters
|
|
47
|
+
filters,
|
|
48
|
+
filterConjunction
|
|
63
49
|
}, () => {
|
|
64
|
-
|
|
50
|
+
this.props.update({
|
|
65
51
|
filters,
|
|
66
|
-
filter_conjunction:
|
|
67
|
-
};
|
|
68
|
-
this.props.update(update);
|
|
52
|
+
filter_conjunction: filterConjunction
|
|
53
|
+
});
|
|
69
54
|
});
|
|
70
55
|
};
|
|
71
|
-
this.
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const filters = this.state.filters.slice(0);
|
|
81
|
-
filters[filterIndex] = updated;
|
|
82
|
-
this.update(filters);
|
|
83
|
-
};
|
|
84
|
-
this.updateFilterConjunction = conjunction => {
|
|
85
|
-
if (this.isNeedSubmit()) {
|
|
86
|
-
const isSubmitDisabled = false;
|
|
87
|
-
this.setState({
|
|
88
|
-
filterConjunction: conjunction,
|
|
89
|
-
isSubmitDisabled
|
|
90
|
-
});
|
|
56
|
+
this.addFilter = () => {
|
|
57
|
+
const {
|
|
58
|
+
columns
|
|
59
|
+
} = this.props;
|
|
60
|
+
const {
|
|
61
|
+
filters
|
|
62
|
+
} = this.state;
|
|
63
|
+
const newFilter = (0, _utils.getDefaultFilter)(columns);
|
|
64
|
+
if (!newFilter) {
|
|
91
65
|
return;
|
|
92
66
|
}
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
}, () => {
|
|
96
|
-
const update = {
|
|
97
|
-
filters: this.state.filters,
|
|
98
|
-
filter_conjunction: conjunction
|
|
99
|
-
};
|
|
100
|
-
this.props.update(update);
|
|
67
|
+
this.updateFilters({
|
|
68
|
+
filters: [...filters, newFilter]
|
|
101
69
|
});
|
|
102
70
|
};
|
|
103
|
-
this.
|
|
104
|
-
|
|
71
|
+
this.addFilterGroup = () => {
|
|
72
|
+
const {
|
|
105
73
|
columns
|
|
106
74
|
} = this.props;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (!
|
|
112
|
-
|
|
113
|
-
const filters = this.state.filters.slice(0);
|
|
114
|
-
if (filters.length === 0) {
|
|
115
|
-
scheduleUpdate();
|
|
75
|
+
const {
|
|
76
|
+
filters
|
|
77
|
+
} = this.state;
|
|
78
|
+
const newFilterGroup = (0, _utils.getDefaultFilterGroup)(columns);
|
|
79
|
+
if (!newFilterGroup) {
|
|
80
|
+
return;
|
|
116
81
|
}
|
|
117
|
-
|
|
118
|
-
|
|
82
|
+
this.updateFilters({
|
|
83
|
+
filters: [...filters, newFilterGroup]
|
|
84
|
+
});
|
|
119
85
|
};
|
|
120
86
|
this.onClosePopover = () => {
|
|
121
87
|
this.props.hidePopover();
|
|
@@ -135,31 +101,29 @@ class DTableFiltersPopover extends _react.Component {
|
|
|
135
101
|
this.onPopoverInsideClick = e => {
|
|
136
102
|
e.stopPropagation();
|
|
137
103
|
};
|
|
104
|
+
const {
|
|
105
|
+
filterConjunction: _filterConjunction,
|
|
106
|
+
filters: _filters,
|
|
107
|
+
columns: _columns,
|
|
108
|
+
isNeedSubmit
|
|
109
|
+
} = props;
|
|
138
110
|
this.state = {
|
|
139
|
-
filters: (0, _dtableUtils.getValidFilters)(
|
|
140
|
-
filterConjunction:
|
|
111
|
+
filters: (0, _dtableUtils.getValidFilters)(_filters, _columns),
|
|
112
|
+
filterConjunction: _constants.SUPPORT_CONJUNCTIONS.includes(_filterConjunction) ? _filterConjunction : _dtableUtils.FILTER_CONJUNCTION_TYPE.AND,
|
|
113
|
+
isSubmitDisabled: true
|
|
141
114
|
};
|
|
142
|
-
this.
|
|
143
|
-
}
|
|
144
|
-
componentDidMount() {
|
|
145
|
-
document.addEventListener('mousedown', this.hideDTablePopover, true);
|
|
146
|
-
document.addEventListener('keydown', this.onHotKey);
|
|
147
|
-
this.unsubscribeOpenSelect = _eventBus.default.subscribe(_constants.EVENT_BUS_TYPE.OPEN_SELECT, this.setSelectStatus);
|
|
148
|
-
}
|
|
149
|
-
componentWillUnmount() {
|
|
150
|
-
document.removeEventListener('mousedown', this.hideDTablePopover, true);
|
|
151
|
-
document.removeEventListener('keydown', this.onHotKey);
|
|
152
|
-
this.unsubscribeOpenSelect();
|
|
115
|
+
this.isNeedSubmit = isNeedSubmit;
|
|
153
116
|
}
|
|
154
117
|
render() {
|
|
155
118
|
const {
|
|
156
119
|
target,
|
|
157
120
|
columns,
|
|
158
|
-
|
|
159
|
-
|
|
121
|
+
placement,
|
|
122
|
+
isSupportAdvanced,
|
|
160
123
|
departments,
|
|
161
124
|
lang,
|
|
162
125
|
readOnly,
|
|
126
|
+
userDepartmentIdsMap,
|
|
163
127
|
firstDayOfWeek
|
|
164
128
|
} = this.props;
|
|
165
129
|
const {
|
|
@@ -167,57 +131,75 @@ class DTableFiltersPopover extends _react.Component {
|
|
|
167
131
|
filterConjunction
|
|
168
132
|
} = this.state;
|
|
169
133
|
const canAddFilter = columns.length > 0;
|
|
170
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
171
|
-
placement: "auto-start",
|
|
172
|
-
isOpen: true,
|
|
134
|
+
return /*#__PURE__*/_react.default.createElement(_DTablePopover.default, {
|
|
173
135
|
target: target,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
136
|
+
placement: placement,
|
|
137
|
+
popoverClassName: "dtable-ui-filter-popover",
|
|
138
|
+
hideDTablePopover: this.props.hidePopover,
|
|
139
|
+
hideDTablePopoverWithEsc: this.props.hidePopover,
|
|
177
140
|
boundariesElement: document.body
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
142
|
+
ref: ref => this.dtablePopoverRef = ref,
|
|
143
|
+
onClick: this.onPopoverInsideClick,
|
|
144
|
+
className: this.props.className
|
|
145
|
+
}, /*#__PURE__*/_react.default.createElement(_filterList.default, {
|
|
146
|
+
isInModal: true,
|
|
147
|
+
filterConjunction: filterConjunction,
|
|
148
|
+
filters: filters,
|
|
149
|
+
columns: columns,
|
|
150
|
+
emptyPlaceholder: (0, _lang.getLocale)('No_filters'),
|
|
151
|
+
collaborators: this.props.collaborators,
|
|
152
|
+
readOnly: readOnly,
|
|
153
|
+
userDepartmentIdsMap: userDepartmentIdsMap,
|
|
154
|
+
departments: departments,
|
|
155
|
+
lang: lang,
|
|
156
|
+
firstDayOfWeek: firstDayOfWeek,
|
|
157
|
+
updateFilters: this.updateFilters
|
|
158
|
+
}), !isSupportAdvanced && !readOnly && /*#__PURE__*/_react.default.createElement(_DTableCommonAddTool.default, {
|
|
159
|
+
className: "popover-add-tool ".concat(canAddFilter ? '' : 'disabled'),
|
|
160
|
+
callBack: canAddFilter ? () => this.addFilter() : () => {},
|
|
161
|
+
footerName: (0, _lang.getLocale)('Add_filter'),
|
|
162
|
+
addIconClassName: "popover-add-icon"
|
|
163
|
+
}), isSupportAdvanced && !readOnly && /*#__PURE__*/_react.default.createElement("div", {
|
|
164
|
+
className: "add-buttons"
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
+
className: "btn-add-filter mr-4",
|
|
167
|
+
onClick: canAddFilter ? () => this.addFilter() : () => {},
|
|
168
|
+
role: "button",
|
|
169
|
+
tabIndex: 0,
|
|
170
|
+
"aria-label": (0, _lang.getLocale)('Add_filter')
|
|
171
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
172
|
+
"aria-hidden": "true",
|
|
173
|
+
className: "dtable-font dtable-icon-add-table popover-add-icon"
|
|
174
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
175
|
+
className: "add-new-option"
|
|
176
|
+
}, (0, _lang.getLocale)('Add_filter'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
177
|
+
className: "btn-add-filter-group",
|
|
178
|
+
onClick: canAddFilter ? () => this.addFilterGroup() : () => {},
|
|
179
|
+
role: "button",
|
|
180
|
+
tabIndex: 0,
|
|
181
|
+
"aria-label": (0, _lang.getLocale)('Add_filter_group')
|
|
182
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
183
|
+
"aria-hidden": "true",
|
|
184
|
+
className: "dtable-font dtable-icon-add-table popover-add-icon"
|
|
185
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
186
|
+
className: "add-new-option"
|
|
187
|
+
}, (0, _lang.getLocale)('Add_filter_group')))), this.isNeedSubmit && /*#__PURE__*/_react.default.createElement("div", {
|
|
188
|
+
className: "filter-popover-footer"
|
|
189
|
+
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
|
|
190
|
+
disabled: readOnly,
|
|
191
|
+
className: "mr-2",
|
|
192
|
+
onClick: this.onClosePopover
|
|
193
|
+
}, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
|
|
194
|
+
disabled: this.state.isSubmitDisabled || readOnly,
|
|
195
|
+
color: "primary",
|
|
196
|
+
onClick: this.onSubmitFilters
|
|
197
|
+
}, (0, _lang.getLocale)('Submit')))));
|
|
217
198
|
}
|
|
218
199
|
}
|
|
219
200
|
DTableFiltersPopover.defaultProps = {
|
|
220
201
|
className: '',
|
|
221
|
-
|
|
202
|
+
placement: 'auto-start',
|
|
203
|
+
isSupportAdvanced: false
|
|
222
204
|
};
|
|
223
205
|
var _default = exports.default = DTableFiltersPopover;
|
|
@@ -24,7 +24,9 @@ class FilterItemUtils {
|
|
|
24
24
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
25
25
|
className: _dtableUtils.COLUMNS_ICON_CONFIG[type]
|
|
26
26
|
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
27
|
-
className: "select-option-name"
|
|
27
|
+
className: "select-option-name",
|
|
28
|
+
title: name,
|
|
29
|
+
"aria-label": name
|
|
28
30
|
}, name))
|
|
29
31
|
};
|
|
30
32
|
}
|
|
@@ -71,13 +73,13 @@ class FilterItemUtils {
|
|
|
71
73
|
}, FILTER_TERM_MODIFIER_SHOW[filterTermModifier])
|
|
72
74
|
};
|
|
73
75
|
}
|
|
74
|
-
static generatorSingleSelectOption(option) {
|
|
76
|
+
static generatorSingleSelectOption(option, selectedOption) {
|
|
75
77
|
return {
|
|
76
78
|
value: {
|
|
77
79
|
columnOption: option
|
|
78
80
|
},
|
|
79
81
|
label: /*#__PURE__*/_react.default.createElement("div", {
|
|
80
|
-
className: "select-option-name"
|
|
82
|
+
className: "select-option-name single-select-option-name"
|
|
81
83
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
82
84
|
className: "single-select-option",
|
|
83
85
|
style: {
|
|
@@ -86,7 +88,11 @@ class FilterItemUtils {
|
|
|
86
88
|
},
|
|
87
89
|
title: option.name,
|
|
88
90
|
"aria-label": option.name
|
|
89
|
-
}, option.name)
|
|
91
|
+
}, option.name), /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
+
className: "single-select-check-icon"
|
|
93
|
+
}, (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.id) === option.id && /*#__PURE__*/_react.default.createElement("i", {
|
|
94
|
+
className: "option-edit dtable-font dtable-icon-check-mark"
|
|
95
|
+
})))
|
|
90
96
|
};
|
|
91
97
|
}
|
|
92
98
|
static generatorMultipleSelectOption(option, filterTerm) {
|