dtable-ui-component 6.0.38-alpha.2 → 6.0.39
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/index.css +7 -6
- package/lib/DTableFiltersPopover/constants/index.js +2 -30
- package/lib/DTableFiltersPopover/index.css +14 -50
- package/lib/DTableFiltersPopover/index.js +136 -118
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +4 -10
- package/lib/DTableFiltersPopover/utils/index.js +82 -358
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.css +0 -0
- package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +4 -6
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +2 -13
- package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +6 -20
- package/lib/DTableFiltersPopover/widgets/filter-item.js +53 -138
- package/lib/DTableFiltersPopover/widgets/filter-list/index.css +10 -119
- package/lib/DTableFiltersPopover/widgets/filter-list/index.js +39 -226
- package/lib/GeolocationEditor/mb-editor/map-editor/index.css +5 -2
- package/lib/GeolocationEditor/mb-editor/map-editor/index.js +96 -51
- package/lib/GeolocationEditor/pc-editor/index.css +6 -15
- package/lib/GeolocationEditor/pc-editor/index.js +4 -1
- package/lib/GeolocationEditor/pc-editor/map-editor/index.css +33 -0
- package/lib/GeolocationEditor/pc-editor/map-editor/index.js +143 -99
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.css +13 -11
- package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +100 -70
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +20 -11
- package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +2 -2
- package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +19 -5
- package/lib/locales/de.json +5 -3
- package/lib/locales/en.json +5 -8
- package/lib/locales/es.json +5 -3
- package/lib/locales/fr.json +5 -3
- package/lib/locales/pt.json +5 -3
- package/lib/locales/ru.json +5 -3
- package/lib/locales/zh-CN.json +5 -8
- package/lib/utils/column-utils.js +2 -21
- package/package.json +2 -2
- package/lib/DTableFiltersPopover/widgets/filter-group.js +0 -185
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
.dtable-ui-checkbox-editor {
|
|
2
|
+
position: relative;
|
|
2
3
|
width: 24px;
|
|
3
4
|
height: 24px;
|
|
4
|
-
border: 2px solid #e0e0e0;
|
|
5
|
-
border-radius: 3px;
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
5
|
}
|
|
10
6
|
|
|
11
7
|
.dtable-ui-checkbox-editor .dtable-ui-checkbox-check-mark {
|
|
12
|
-
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
font-size: 16px;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
color: #20c933;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
.dtable-ui-checkbox-check-svg {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
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;
|
|
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,32 +67,4 @@ 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
|
-
};
|
|
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';
|
|
70
|
+
};
|
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
min-width: 300px;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.dtable-filter-popover .popover
|
|
7
|
-
max-height: calc(100vh - 170px);
|
|
8
|
-
overflow: auto;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.dtable-filter-popover .filter-popover-footer {
|
|
6
|
+
.dtable-filter-popover .dtable-filter-popover-footer {
|
|
12
7
|
display: flex;
|
|
13
8
|
align-items: center;
|
|
14
9
|
justify-content: flex-end;
|
|
@@ -16,59 +11,28 @@
|
|
|
16
11
|
border-top: 1px solid #e9ecef;
|
|
17
12
|
}
|
|
18
13
|
|
|
19
|
-
.dtable-filter-popover .add-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
height: 40px;
|
|
23
|
-
padding: 0 1rem;
|
|
24
|
-
font-size: 14px;
|
|
25
|
-
font-weight: 500;
|
|
26
|
-
background: #fff;
|
|
27
|
-
color: #666;
|
|
28
|
-
border-bottom-left-radius: 3px;
|
|
29
|
-
border-bottom-right-radius: 3px;
|
|
30
|
-
position: relative;
|
|
14
|
+
.dtable-filter-popover .popover-add-tool {
|
|
15
|
+
border-top: none;
|
|
16
|
+
color: #666666;
|
|
31
17
|
}
|
|
32
18
|
|
|
33
|
-
.dtable-filter-popover .add-
|
|
34
|
-
|
|
35
|
-
display: inline-flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
height: 28px;
|
|
38
|
-
margin-left: -10px;
|
|
39
|
-
padding: 0 10px;
|
|
40
|
-
border-radius: 4px;
|
|
41
|
-
font-size: 14px;
|
|
42
|
-
font-weight: 500;
|
|
43
|
-
color: #666;
|
|
44
|
-
cursor: pointer;
|
|
19
|
+
.dtable-filter-popover .popover-add-tool.disabled {
|
|
20
|
+
color: #c2c2c2;
|
|
45
21
|
}
|
|
46
22
|
|
|
47
|
-
.dtable-filter-popover .add-
|
|
48
|
-
|
|
49
|
-
background
|
|
23
|
+
.dtable-filter-popover .popover-add-tool.disabled:hover {
|
|
24
|
+
cursor: not-allowed;
|
|
25
|
+
background: #fff;
|
|
50
26
|
}
|
|
51
27
|
|
|
52
|
-
.dtable-filter-popover .add-
|
|
53
|
-
font-size: 12px;
|
|
54
|
-
font-weight: 600;
|
|
28
|
+
.dtable-filter-popover .popover-add-tool .popover-add-icon {
|
|
55
29
|
margin-right: 14px;
|
|
56
30
|
}
|
|
57
31
|
|
|
58
|
-
.dtable-filter-popover .filter-
|
|
32
|
+
.dtable-filter-popover .dtable-filter-popover-footer {
|
|
59
33
|
display: flex;
|
|
60
|
-
height: 100%;
|
|
61
34
|
align-items: center;
|
|
35
|
+
justify-content: flex-end;
|
|
36
|
+
padding: 1rem;
|
|
37
|
+
border-top: 1px solid #e9ecef;
|
|
62
38
|
}
|
|
63
|
-
|
|
64
|
-
.dtable-filter-popover .filter-term .filter-item-checkbox {
|
|
65
|
-
width: 22px;
|
|
66
|
-
height: 22px;
|
|
67
|
-
display: flex;
|
|
68
|
-
align-items: center;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
border: 2px solid #e0e0e0;
|
|
71
|
-
border-radius: 3px;
|
|
72
|
-
cursor: pointer;
|
|
73
|
-
}
|
|
74
|
-
|
|
@@ -7,18 +7,19 @@ 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"));
|
|
10
11
|
var _reactstrap = require("reactstrap");
|
|
11
12
|
var _dtableUtils = require("dtable-utils");
|
|
12
13
|
var _DTableCommonAddTool = _interopRequireDefault(require("../DTableCommonAddTool"));
|
|
13
|
-
var _utils = require("
|
|
14
|
+
var _utils = require("../utils/utils");
|
|
15
|
+
var _utils2 = require("./utils");
|
|
14
16
|
var _filterList = _interopRequireDefault(require("./widgets/filter-list"));
|
|
15
|
-
var
|
|
16
|
-
var _constants = require("
|
|
17
|
+
var _eventBus = _interopRequireDefault(require("../utils/event-bus"));
|
|
18
|
+
var _constants = require("../constants");
|
|
17
19
|
var _lang = require("../lang");
|
|
18
20
|
require("./index.css");
|
|
19
21
|
/**
|
|
20
|
-
* filter
|
|
21
|
-
* let filter = {
|
|
22
|
+
* filter = {
|
|
22
23
|
* column_key: '',
|
|
23
24
|
* filter_predicate: '',
|
|
24
25
|
* filter_term: '',
|
|
@@ -28,60 +29,93 @@ require("./index.css");
|
|
|
28
29
|
class DTableFiltersPopover extends _react.Component {
|
|
29
30
|
constructor(props) {
|
|
30
31
|
super(props);
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
this.onHotKey = e => {
|
|
33
|
+
if ((0, _isHotkey.default)('esc', e) && !this.isSelectOpen) {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
this.props.hidePopover();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
this.setSelectStatus = status => {
|
|
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()) {
|
|
38
54
|
const isSubmitDisabled = false;
|
|
39
55
|
this.setState({
|
|
40
56
|
filters,
|
|
41
|
-
filterConjunction,
|
|
42
57
|
isSubmitDisabled
|
|
43
58
|
});
|
|
44
59
|
return;
|
|
45
60
|
}
|
|
46
61
|
this.setState({
|
|
47
|
-
filters
|
|
48
|
-
filterConjunction
|
|
62
|
+
filters
|
|
49
63
|
}, () => {
|
|
50
|
-
|
|
64
|
+
const update = {
|
|
51
65
|
filters,
|
|
52
|
-
filter_conjunction: filterConjunction
|
|
53
|
-
}
|
|
66
|
+
filter_conjunction: this.state.filterConjunction
|
|
67
|
+
};
|
|
68
|
+
this.props.update(update);
|
|
54
69
|
});
|
|
55
70
|
};
|
|
56
|
-
this.
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
this.deleteFilter = (filterIndex, scheduleUpdate) => {
|
|
72
|
+
const filters = this.state.filters.slice(0);
|
|
73
|
+
filters.splice(filterIndex, 1);
|
|
74
|
+
if (filters.length === 0) {
|
|
75
|
+
scheduleUpdate();
|
|
76
|
+
}
|
|
77
|
+
this.update(filters);
|
|
78
|
+
};
|
|
79
|
+
this.updateFilter = (filterIndex, updated) => {
|
|
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
|
+
});
|
|
65
91
|
return;
|
|
66
92
|
}
|
|
67
|
-
this.
|
|
68
|
-
|
|
93
|
+
this.setState({
|
|
94
|
+
filterConjunction: conjunction
|
|
95
|
+
}, () => {
|
|
96
|
+
const update = {
|
|
97
|
+
filters: this.state.filters,
|
|
98
|
+
filter_conjunction: conjunction
|
|
99
|
+
};
|
|
100
|
+
this.props.update(update);
|
|
69
101
|
});
|
|
70
102
|
};
|
|
71
|
-
this.
|
|
72
|
-
|
|
103
|
+
this.addFilter = scheduleUpdate => {
|
|
104
|
+
let {
|
|
73
105
|
columns
|
|
74
106
|
} = this.props;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const newFilterGroup = (0, _utils.getDefaultFilterGroup)(columns);
|
|
79
|
-
if (!newFilterGroup) {
|
|
80
|
-
return;
|
|
107
|
+
let defaultColumn = columns[0];
|
|
108
|
+
if (!_dtableUtils.FILTER_COLUMN_OPTIONS[defaultColumn.type]) {
|
|
109
|
+
defaultColumn = columns.find(c => _dtableUtils.FILTER_COLUMN_OPTIONS[c.type]);
|
|
81
110
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
111
|
+
if (!defaultColumn) return;
|
|
112
|
+
let filter = (0, _utils2.getFilterByColumn)(defaultColumn);
|
|
113
|
+
const filters = this.state.filters.slice(0);
|
|
114
|
+
if (filters.length === 0) {
|
|
115
|
+
scheduleUpdate();
|
|
116
|
+
}
|
|
117
|
+
filters.push(filter);
|
|
118
|
+
this.update(filters);
|
|
85
119
|
};
|
|
86
120
|
this.onClosePopover = () => {
|
|
87
121
|
this.props.hidePopover();
|
|
@@ -101,29 +135,31 @@ class DTableFiltersPopover extends _react.Component {
|
|
|
101
135
|
this.onPopoverInsideClick = e => {
|
|
102
136
|
e.stopPropagation();
|
|
103
137
|
};
|
|
104
|
-
const {
|
|
105
|
-
filterConjunction: _filterConjunction,
|
|
106
|
-
filters: _filters,
|
|
107
|
-
columns: _columns,
|
|
108
|
-
isNeedSubmit
|
|
109
|
-
} = props;
|
|
110
138
|
this.state = {
|
|
111
|
-
filters: (0, _dtableUtils.getValidFilters)(
|
|
112
|
-
filterConjunction:
|
|
113
|
-
isSubmitDisabled: true
|
|
139
|
+
filters: (0, _dtableUtils.getValidFilters)(props.filters, props.columns),
|
|
140
|
+
filterConjunction: props.filterConjunction || 'And'
|
|
114
141
|
};
|
|
115
|
-
this.
|
|
142
|
+
this.isSelectOpen = false;
|
|
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();
|
|
116
153
|
}
|
|
117
154
|
render() {
|
|
118
155
|
const {
|
|
119
156
|
target,
|
|
120
157
|
columns,
|
|
121
|
-
|
|
122
|
-
|
|
158
|
+
className,
|
|
159
|
+
userDepartmentIdsMap,
|
|
123
160
|
departments,
|
|
124
161
|
lang,
|
|
125
|
-
|
|
126
|
-
userDepartmentIdsMap,
|
|
162
|
+
readOnly,
|
|
127
163
|
firstDayOfWeek
|
|
128
164
|
} = this.props;
|
|
129
165
|
const {
|
|
@@ -131,75 +167,57 @@ class DTableFiltersPopover extends _react.Component {
|
|
|
131
167
|
filterConjunction
|
|
132
168
|
} = this.state;
|
|
133
169
|
const canAddFilter = columns.length > 0;
|
|
134
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
170
|
+
return /*#__PURE__*/_react.default.createElement(_reactstrap.UncontrolledPopover, {
|
|
171
|
+
placement: "auto-start",
|
|
172
|
+
isOpen: true,
|
|
135
173
|
target: target,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
hideDTablePopoverWithEsc: this.props.hidePopover,
|
|
174
|
+
fade: false,
|
|
175
|
+
hideArrow: true,
|
|
176
|
+
className: "dtable-filter-popover",
|
|
140
177
|
boundariesElement: document.body
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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')))));
|
|
178
|
+
}, _ref => {
|
|
179
|
+
let {
|
|
180
|
+
update: scheduleUpdate
|
|
181
|
+
} = _ref;
|
|
182
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
183
|
+
ref: ref => this.dtablePopoverRef = ref,
|
|
184
|
+
onClick: this.onPopoverInsideClick,
|
|
185
|
+
className: className
|
|
186
|
+
}, /*#__PURE__*/_react.default.createElement(_filterList.default, {
|
|
187
|
+
filterConjunction: filterConjunction,
|
|
188
|
+
filters: filters,
|
|
189
|
+
columns: columns,
|
|
190
|
+
emptyPlaceholder: (0, _lang.getLocale)('No_filters'),
|
|
191
|
+
collaborators: this.props.collaborators,
|
|
192
|
+
readOnly: readOnly,
|
|
193
|
+
scheduleUpdate: scheduleUpdate,
|
|
194
|
+
userDepartmentIdsMap: userDepartmentIdsMap,
|
|
195
|
+
departments: departments,
|
|
196
|
+
lang: lang,
|
|
197
|
+
updateFilter: this.updateFilter,
|
|
198
|
+
deleteFilter: this.deleteFilter,
|
|
199
|
+
updateFilterConjunction: this.updateFilterConjunction,
|
|
200
|
+
firstDayOfWeek: firstDayOfWeek
|
|
201
|
+
}), /*#__PURE__*/_react.default.createElement(_DTableCommonAddTool.default, {
|
|
202
|
+
className: "popover-add-tool ".concat(canAddFilter ? '' : 'disabled'),
|
|
203
|
+
callBack: canAddFilter ? () => this.addFilter(scheduleUpdate) : () => {},
|
|
204
|
+
footerName: (0, _lang.getLocale)('Add_filter'),
|
|
205
|
+
addIconClassName: "popover-add-icon"
|
|
206
|
+
}), this.isNeedSubmit() && /*#__PURE__*/_react.default.createElement("div", {
|
|
207
|
+
className: "dtable-filter-popover-footer"
|
|
208
|
+
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
|
|
209
|
+
className: "mr-2",
|
|
210
|
+
onClick: this.onClosePopover
|
|
211
|
+
}, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
|
|
212
|
+
color: "primary",
|
|
213
|
+
disabled: this.state.isSubmitDisabled,
|
|
214
|
+
onClick: this.onSubmitFilters
|
|
215
|
+
}, (0, _lang.getLocale)('Submit'))));
|
|
216
|
+
});
|
|
198
217
|
}
|
|
199
218
|
}
|
|
200
219
|
DTableFiltersPopover.defaultProps = {
|
|
201
220
|
className: '',
|
|
202
|
-
|
|
203
|
-
isSupportAdvanced: false
|
|
221
|
+
readOnly: false
|
|
204
222
|
};
|
|
205
223
|
var _default = exports.default = DTableFiltersPopover;
|
|
@@ -24,9 +24,7 @@ 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"
|
|
28
|
-
title: name,
|
|
29
|
-
"aria-label": name
|
|
27
|
+
className: "select-option-name"
|
|
30
28
|
}, name))
|
|
31
29
|
};
|
|
32
30
|
}
|
|
@@ -73,13 +71,13 @@ class FilterItemUtils {
|
|
|
73
71
|
}, FILTER_TERM_MODIFIER_SHOW[filterTermModifier])
|
|
74
72
|
};
|
|
75
73
|
}
|
|
76
|
-
static generatorSingleSelectOption(option
|
|
74
|
+
static generatorSingleSelectOption(option) {
|
|
77
75
|
return {
|
|
78
76
|
value: {
|
|
79
77
|
columnOption: option
|
|
80
78
|
},
|
|
81
79
|
label: /*#__PURE__*/_react.default.createElement("div", {
|
|
82
|
-
className: "select-option-name
|
|
80
|
+
className: "select-option-name"
|
|
83
81
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
84
82
|
className: "single-select-option",
|
|
85
83
|
style: {
|
|
@@ -88,11 +86,7 @@ class FilterItemUtils {
|
|
|
88
86
|
},
|
|
89
87
|
title: option.name,
|
|
90
88
|
"aria-label": option.name
|
|
91
|
-
}, option.name)
|
|
92
|
-
className: "single-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
|
-
})))
|
|
89
|
+
}, option.name))
|
|
96
90
|
};
|
|
97
91
|
}
|
|
98
92
|
static generatorMultipleSelectOption(option, filterTerm) {
|