versacall-core-library-react 2.0.58 → 2.0.59
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.
|
@@ -81,6 +81,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
81
81
|
|
|
82
82
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
83
83
|
|
|
84
|
+
// import { TrendingUpOutlined } from '@material-ui/icons';
|
|
85
|
+
|
|
84
86
|
/* eslint-disable no-nested-ternary */
|
|
85
87
|
var CoreTagFilter = /*#__PURE__*/function (_Component) {
|
|
86
88
|
_inherits(CoreTagFilter, _Component);
|
|
@@ -143,9 +145,26 @@ var CoreTagFilter = /*#__PURE__*/function (_Component) {
|
|
|
143
145
|
})));
|
|
144
146
|
}
|
|
145
147
|
}
|
|
148
|
+
}, {
|
|
149
|
+
key: "checkIfExists",
|
|
150
|
+
value: function checkIfExists(collection, tag) {
|
|
151
|
+
var tags = this.props.tags;
|
|
152
|
+
|
|
153
|
+
if (tags && tags[collection]) {
|
|
154
|
+
if (tags[collection].some(function (x) {
|
|
155
|
+
return x.tag === tag;
|
|
156
|
+
})) {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
146
163
|
}, {
|
|
147
164
|
key: "renderFilter",
|
|
148
165
|
value: function renderFilter() {
|
|
166
|
+
var _this2 = this;
|
|
167
|
+
|
|
149
168
|
var filter = this.props.filter;
|
|
150
169
|
var moduleTagFilters = filter.moduleTagFilters,
|
|
151
170
|
moduleLocationFilters = filter.moduleLocationFilters,
|
|
@@ -159,35 +178,39 @@ var CoreTagFilter = /*#__PURE__*/function (_Component) {
|
|
|
159
178
|
key: "mtag_".concat(tag)
|
|
160
179
|
}, index !== 0 && /*#__PURE__*/_react.default.createElement("span", null, "\xA0OR\xA0"), /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
161
180
|
icon: /*#__PURE__*/_react.default.createElement(_LocalOffer.default, null),
|
|
162
|
-
label: tag
|
|
181
|
+
label: tag,
|
|
182
|
+
color: _this2.checkIfExists('moduleTags', tag) ? 'default' : 'secondary'
|
|
163
183
|
}));
|
|
164
184
|
}), showLocOr && /*#__PURE__*/_react.default.createElement("span", null, "\xA0OR\xA0"), moduleLocationFilters.map(function (tag, index) {
|
|
165
185
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
166
186
|
key: "mloc_".concat(tag)
|
|
167
187
|
}, index !== 0 && /*#__PURE__*/_react.default.createElement("span", null, "\xA0OR\xA0"), /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
168
188
|
icon: /*#__PURE__*/_react.default.createElement(_LocationOn.default, null),
|
|
169
|
-
label: tag
|
|
189
|
+
label: tag,
|
|
190
|
+
color: _this2.checkIfExists('locationTags', tag) ? 'default' : 'secondary'
|
|
170
191
|
}));
|
|
171
192
|
}), ")"), showMpTagAnd && /*#__PURE__*/_react.default.createElement("span", null, "\xA0AND\xA0"), monitoringPointTagFilters.length > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "(", monitoringPointTagFilters.map(function (tag, index) {
|
|
172
193
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
173
194
|
key: "mptag_".concat(tag)
|
|
174
195
|
}, index !== 0 && /*#__PURE__*/_react.default.createElement("span", null, "\xA0OR\xA0"), /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
175
196
|
icon: /*#__PURE__*/_react.default.createElement(_LocalOffer.default, null),
|
|
176
|
-
label: tag
|
|
197
|
+
label: tag,
|
|
198
|
+
color: _this2.checkIfExists('monitoringPointTags', tag) ? 'default' : 'secondary'
|
|
177
199
|
}));
|
|
178
200
|
}), ")"), showTypeAnd && /*#__PURE__*/_react.default.createElement("span", null, "\xA0AND\xA0"), monitoringPointTypeFilters.length > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "(", monitoringPointTypeFilters.map(function (tag, index) {
|
|
179
201
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
180
202
|
key: "mptype_".concat(tag)
|
|
181
203
|
}, index !== 0 && /*#__PURE__*/_react.default.createElement("span", null, "\xA0OR\xA0"), /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
182
204
|
icon: /*#__PURE__*/_react.default.createElement(_Category.default, null),
|
|
183
|
-
label: tag
|
|
205
|
+
label: tag,
|
|
206
|
+
color: _this2.checkIfExists('typeTags', tag) ? 'default' : 'secondary'
|
|
184
207
|
}));
|
|
185
208
|
}), ")"));
|
|
186
209
|
}
|
|
187
210
|
}, {
|
|
188
211
|
key: "render",
|
|
189
212
|
value: function render() {
|
|
190
|
-
var
|
|
213
|
+
var _this3 = this;
|
|
191
214
|
|
|
192
215
|
var _this$props = this.props,
|
|
193
216
|
intl = _this$props.intl,
|
|
@@ -214,7 +237,7 @@ var CoreTagFilter = /*#__PURE__*/function (_Component) {
|
|
|
214
237
|
variant: "outlined",
|
|
215
238
|
color: "secondary",
|
|
216
239
|
onClick: function onClick() {
|
|
217
|
-
return
|
|
240
|
+
return _this3.setState({
|
|
218
241
|
openDialog: true
|
|
219
242
|
});
|
|
220
243
|
}
|
|
@@ -234,7 +257,7 @@ var CoreTagFilter = /*#__PURE__*/function (_Component) {
|
|
|
234
257
|
control: /*#__PURE__*/_react.default.createElement(_Switch.default, {
|
|
235
258
|
checked: filter.isAdvanced,
|
|
236
259
|
onChange: function onChange(event) {
|
|
237
|
-
return
|
|
260
|
+
return _this3.props.updateFilter(_objectSpread(_objectSpread({}, filter), {}, {
|
|
238
261
|
isAdvanced: event.target.checked
|
|
239
262
|
}));
|
|
240
263
|
}
|
|
@@ -246,7 +269,7 @@ var CoreTagFilter = /*#__PURE__*/function (_Component) {
|
|
|
246
269
|
}),
|
|
247
270
|
value: filter.advancedFilter,
|
|
248
271
|
onChange: function onChange(event) {
|
|
249
|
-
return
|
|
272
|
+
return _this3.props.updateFilter(_objectSpread(_objectSpread({}, filter), {}, {
|
|
250
273
|
advancedFilter: event.target.value
|
|
251
274
|
}));
|
|
252
275
|
},
|
|
@@ -269,7 +292,7 @@ var CoreTagFilter = /*#__PURE__*/function (_Component) {
|
|
|
269
292
|
maxWidth: "md",
|
|
270
293
|
open: openDialog,
|
|
271
294
|
onClose: function onClose() {
|
|
272
|
-
return
|
|
295
|
+
return _this3.setState({
|
|
273
296
|
openDialog: false
|
|
274
297
|
});
|
|
275
298
|
},
|
|
@@ -278,10 +301,10 @@ var CoreTagFilter = /*#__PURE__*/function (_Component) {
|
|
|
278
301
|
tags: tags,
|
|
279
302
|
filter: filter,
|
|
280
303
|
updateFilter: function updateFilter(change) {
|
|
281
|
-
return
|
|
304
|
+
return _this3.updateFilter(change);
|
|
282
305
|
},
|
|
283
306
|
close: function close() {
|
|
284
|
-
return
|
|
307
|
+
return _this3.setState({
|
|
285
308
|
openDialog: false
|
|
286
309
|
});
|
|
287
310
|
},
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"versacall": {
|
|
3
3
|
"title": "Versacall Core Library React",
|
|
4
4
|
"applicationType": "react-library",
|
|
5
|
-
"build":
|
|
5
|
+
"build": 59
|
|
6
6
|
},
|
|
7
7
|
"name": "versacall-core-library-react",
|
|
8
|
-
"version": "2.0.
|
|
8
|
+
"version": "2.0.59",
|
|
9
9
|
"description": "Versacall Core Library",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"module": "dist/index.js",
|