versacall-core-library-react 2.0.38 → 2.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/dist/components/CoreAlert/CoreAlert.js +26 -20
- package/dist/components/CoreAppBar/CoreAppBar.js +47 -41
- package/dist/components/CoreAppBar/CoreAppBarDrawer.js +35 -29
- package/dist/components/CoreAppSelector/AppLink.js +6 -6
- package/dist/components/CoreAppSelector/CoreAppSelector.js +24 -18
- package/dist/components/CoreDialogueToolBar/CoreDialogueToolBar.js +11 -11
- package/dist/components/CoreDrawer/CoreDrawer.js +35 -29
- package/dist/components/CoreDropDownTextfield/CoreDropDownTextfield.js +24 -18
- package/dist/components/CoreElapsedTime/CoreElapsedTime.js +19 -13
- package/dist/components/CoreFrame/CoreFrame.js +7 -5
- package/dist/components/CorePlugin/CorePlugin.js +23 -15
- package/dist/components/CorePlugin/OldCorePlugin.js +20 -14
- package/dist/components/CoreSaveChangesDialog/CoreSaveChangesDialog.js +84 -0
- package/dist/components/CoreSaveChangesDialog/index.js +15 -0
- package/dist/components/CoreShiftTagFilter/CoreShiftTagFilter.js +183 -42
- package/dist/components/CoreShiftTagFilter/OldCoreShiftTagFilter.js +48 -40
- package/dist/components/CoreSideBar/CoreSideBar.js +56 -50
- package/dist/components/CoreSideBar/CoreSideBarDrawer.js +36 -30
- package/dist/components/CoreSnackBar/CoreSnackBar.js +25 -19
- package/dist/components/CoreTable/CoreTable.js +40 -32
- package/dist/components/CoreTable/CoreTableChips.js +3 -3
- package/dist/components/CoreTable/CoreTableHead.js +32 -26
- package/dist/components/CoreTable/CoreTableToolbar.js +13 -13
- package/dist/components/CoreTagFilter/CoreTagFilter.js +64 -50
- package/dist/components/CoreTagFilter/OldCoreTagFilter.js +66 -54
- package/dist/components/CoreTagFilter/OldTagChip.js +2 -2
- package/dist/components/CoreTagFilter/OldTagFilterSelector.js +25 -19
- package/dist/components/CoreTagFilter/OldTagOption.js +10 -6
- package/dist/components/CoreTagFilter/TagFilterBuilder.js +351 -49
- package/dist/components/CoreTextField/CoreTextField.js +24 -18
- package/dist/components/CoreTheme/CoreTheme.js +1 -1
- package/dist/components/CoreTile/CoreTile.js +5 -5
- package/dist/components/CoreTile/CoreTileToolbar.js +3 -3
- package/dist/components/CoreTimerInput/CoreTimerInput.js +16 -14
- package/dist/components/CoreTimerInput/CoreTimerInputOld.js +10 -8
- package/dist/components/CoreToolbar/CoreToolbar.js +12 -12
- package/dist/components/CoreTracker/CoreTracker.js +19 -13
- package/dist/components/CoreTranslate/CoreTranslate.js +9 -5
- package/dist/components/CoreTranslate/translations/en.json +4 -0
- package/dist/components/CoreTranslateWrapper/CoreTranslateWrapper.js +1 -1
- package/dist/components/CoreWidget/CoreWidget.js +22 -14
- package/dist/components/CoreWrapper/CoreWrapper.js +6 -6
- package/dist/components/index.js +8 -0
- package/dist/context/Authentication/AuthenticationContext.js +1 -1
- package/dist/context/Authentication/AuthenticationProvider.js +19 -13
- package/dist/context/Authentication/index.js +4 -4
- package/dist/context/Authentication/withAuthentication.js +3 -3
- package/dist/context/Channels/ChannelsConsumer.js +19 -13
- package/dist/context/Channels/ChannelsContext.js +1 -1
- package/dist/context/Channels/ChannelsProvider.js +19 -13
- package/dist/context/Channels/DataChannel.js +16 -12
- package/dist/context/Channels/EntityChannel.js +16 -12
- package/dist/context/Channels/EveryoneChannel.js +16 -12
- package/dist/context/Channels/OrganizationChannel.js +16 -12
- package/dist/context/Channels/UserChannel.js +16 -12
- package/dist/context/Channels/withChannels.js +3 -3
- package/dist/context/Core/CoreContext.js +1 -1
- package/dist/context/Core/CoreProvider.js +19 -13
- package/dist/context/Core/index.js +4 -4
- package/dist/context/Core/withCore.js +3 -3
- package/dist/context/Organization/OrganizationContext.js +1 -1
- package/dist/context/Organization/OrganizationProvider.js +19 -13
- package/dist/context/Organization/index.js +4 -4
- package/dist/context/Organization/withOrganization.js +3 -3
- package/dist/context/Plugin/PluginContext.js +1 -1
- package/dist/context/Plugin/PluginProvider.js +23 -15
- package/dist/context/Plugin/index.js +4 -4
- package/dist/context/Plugin/withPlugin.js +3 -3
- package/dist/context/index.js +5 -0
- package/dist/functions/TagEvaluator.js +2 -4
- package/dist/functions/index.js +14 -14
- package/dist/icons/CopyIcon.js +3 -3
- package/dist/icons/DeleteIcon.js +3 -3
- package/dist/icons/DuplicateIcon.js +3 -3
- package/dist/icons/EditIcon.js +3 -3
- package/dist/icons/FabAddIcon.js +6 -4
- package/dist/icons/PasteIcon.js +3 -3
- package/dist/icons/index.js +4 -4
- package/dist/index.js +6 -0
- package/package.json +2 -2
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -11,13 +13,25 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
13
|
|
|
12
14
|
var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
|
|
13
15
|
|
|
14
|
-
var
|
|
16
|
+
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
17
|
+
|
|
18
|
+
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
19
|
+
|
|
20
|
+
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
21
|
+
|
|
22
|
+
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
|
|
15
23
|
|
|
16
24
|
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
|
|
17
25
|
|
|
26
|
+
var _InputAdornment = _interopRequireDefault(require("@material-ui/core/InputAdornment"));
|
|
27
|
+
|
|
28
|
+
var _Link = _interopRequireDefault(require("@material-ui/core/Link"));
|
|
29
|
+
|
|
30
|
+
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
|
|
31
|
+
|
|
18
32
|
var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
19
33
|
|
|
20
|
-
var
|
|
34
|
+
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
21
35
|
|
|
22
36
|
var _FilterList = _interopRequireDefault(require("@material-ui/icons/FilterList"));
|
|
23
37
|
|
|
@@ -31,29 +45,39 @@ var _LocalOffer = _interopRequireDefault(require("@material-ui/icons/LocalOffer"
|
|
|
31
45
|
|
|
32
46
|
var _Category = _interopRequireDefault(require("@material-ui/icons/Category"));
|
|
33
47
|
|
|
48
|
+
var _reactIntl = require("react-intl");
|
|
49
|
+
|
|
34
50
|
var _scrollbarModule = _interopRequireDefault(require("../../css/scrollbar.module.css"));
|
|
35
51
|
|
|
36
52
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
53
|
|
|
38
|
-
function
|
|
54
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
55
|
+
|
|
56
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
57
|
|
|
40
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
58
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
41
59
|
|
|
42
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
60
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
43
61
|
|
|
44
|
-
function _iterableToArray(iter) { if (Symbol.iterator
|
|
62
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
45
63
|
|
|
46
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr))
|
|
64
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
47
65
|
|
|
48
|
-
function
|
|
66
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
67
|
+
|
|
68
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
49
69
|
|
|
50
70
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
51
71
|
|
|
52
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
72
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
73
|
+
|
|
74
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
53
75
|
|
|
54
|
-
function
|
|
76
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
55
77
|
|
|
56
|
-
function
|
|
78
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
79
|
+
|
|
80
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
57
81
|
|
|
58
82
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
59
83
|
|
|
@@ -75,18 +99,34 @@ function TagFilterBuilder(props) {
|
|
|
75
99
|
search = _useState2[0],
|
|
76
100
|
setSearch = _useState2[1];
|
|
77
101
|
|
|
78
|
-
var
|
|
102
|
+
var _useState3 = (0, _react.useState)(false),
|
|
103
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
104
|
+
showAddCustom = _useState4[0],
|
|
105
|
+
setShowAddCustom = _useState4[1];
|
|
106
|
+
|
|
107
|
+
var _useState5 = (0, _react.useState)([]),
|
|
108
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
109
|
+
customTypeOptions = _useState6[0],
|
|
110
|
+
setCustomTypeOptions = _useState6[1];
|
|
111
|
+
|
|
112
|
+
var _useState7 = (0, _react.useState)(''),
|
|
113
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
114
|
+
customType = _useState8[0],
|
|
115
|
+
setCustomType = _useState8[1];
|
|
116
|
+
|
|
117
|
+
var _useState9 = (0, _react.useState)(''),
|
|
118
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
119
|
+
customTag = _useState10[0],
|
|
120
|
+
setCustomTag = _useState10[1];
|
|
121
|
+
|
|
122
|
+
var intl = props.intl,
|
|
123
|
+
tags = props.tags,
|
|
79
124
|
filter = props.filter,
|
|
80
125
|
updateFilter = props.updateFilter,
|
|
81
126
|
hideModuleTagFilters = props.hideModuleTagFilters,
|
|
82
127
|
hideModuleLocationFilters = props.hideModuleLocationFilters,
|
|
83
128
|
hideMonitoringPointTagFilters = props.hideMonitoringPointTagFilters,
|
|
84
129
|
hideMonitoringPointTypeFilters = props.hideMonitoringPointTypeFilters;
|
|
85
|
-
/* return (
|
|
86
|
-
<div>
|
|
87
|
-
Hello
|
|
88
|
-
</div>
|
|
89
|
-
); */
|
|
90
130
|
|
|
91
131
|
var updateSearch = function updateSearch(value) {
|
|
92
132
|
if (value.length > 0) {
|
|
@@ -128,31 +168,31 @@ function TagFilterBuilder(props) {
|
|
|
128
168
|
switch (filterListName) {
|
|
129
169
|
case 'moduleTagFilters':
|
|
130
170
|
keyPrefix = 'mtag';
|
|
131
|
-
icon = _react.default.createElement(_LocalOffer.default, null);
|
|
171
|
+
icon = /*#__PURE__*/_react.default.createElement(_LocalOffer.default, null);
|
|
132
172
|
break;
|
|
133
173
|
|
|
134
174
|
case 'moduleLocationFilters':
|
|
135
175
|
keyPrefix = 'loc';
|
|
136
|
-
icon = _react.default.createElement(_LocationOn.default, null);
|
|
176
|
+
icon = /*#__PURE__*/_react.default.createElement(_LocationOn.default, null);
|
|
137
177
|
break;
|
|
138
178
|
|
|
139
179
|
case 'monitoringPointTagFilters':
|
|
140
180
|
keyPrefix = 'mptag';
|
|
141
|
-
icon = _react.default.createElement(_LocalOffer.default, null);
|
|
181
|
+
icon = /*#__PURE__*/_react.default.createElement(_LocalOffer.default, null);
|
|
142
182
|
break;
|
|
143
183
|
|
|
144
184
|
case 'monitoringPointTypeFilters':
|
|
145
185
|
keyPrefix = 'ttag';
|
|
146
|
-
icon = _react.default.createElement(_Category.default, null);
|
|
186
|
+
icon = /*#__PURE__*/_react.default.createElement(_Category.default, null);
|
|
147
187
|
break;
|
|
148
188
|
|
|
149
189
|
default:
|
|
150
190
|
keyPrefix = 'def';
|
|
151
|
-
icon = _react.default.createElement(_LocalOffer.default, null);
|
|
191
|
+
icon = /*#__PURE__*/_react.default.createElement(_LocalOffer.default, null);
|
|
152
192
|
break;
|
|
153
193
|
}
|
|
154
194
|
|
|
155
|
-
return _react.default.createElement("div", {
|
|
195
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
156
196
|
key: "".concat(keyPrefix, "_").concat(tagInfo.tag),
|
|
157
197
|
style: {
|
|
158
198
|
margin: 5,
|
|
@@ -167,7 +207,7 @@ function TagFilterBuilder(props) {
|
|
|
167
207
|
return isSelected ? deselectItem(filterListName, tagInfo.tag) : selectItem(filterListName, tagInfo.tag);
|
|
168
208
|
},
|
|
169
209
|
"aria-hidden": "true"
|
|
170
|
-
}, icon, _react.default.createElement("span", {
|
|
210
|
+
}, icon, /*#__PURE__*/_react.default.createElement("span", {
|
|
171
211
|
style: {
|
|
172
212
|
marginLeft: 10,
|
|
173
213
|
flexGrow: 1
|
|
@@ -175,24 +215,129 @@ function TagFilterBuilder(props) {
|
|
|
175
215
|
}, tagInfo.tag), "(".concat(tagInfo.count, ")"));
|
|
176
216
|
};
|
|
177
217
|
|
|
218
|
+
var showCustom = function showCustom(which) {
|
|
219
|
+
var typeOptions = [];
|
|
220
|
+
|
|
221
|
+
if (which === 'module') {
|
|
222
|
+
if (!hideModuleTagFilters) {
|
|
223
|
+
typeOptions.push('moduleTagFilters');
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (!hideModuleLocationFilters) {
|
|
227
|
+
typeOptions.push('moduleLocationFilters');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
setCustomType(!hideModuleLocationFilters ? 'moduleLocationFilters' : 'moduleTagFilters');
|
|
231
|
+
} else {
|
|
232
|
+
if (!hideMonitoringPointTagFilters) {
|
|
233
|
+
typeOptions.push('monitoringPointTagFilters');
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (!hideMonitoringPointTypeFilters) {
|
|
237
|
+
typeOptions.push('monitoringPointTypeFilters');
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
setCustomType(!hideMonitoringPointTagFilters ? 'monitoringPointTagFilters' : 'monitoringPointTypeFilters');
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
setCustomTypeOptions(typeOptions);
|
|
244
|
+
setCustomTag('');
|
|
245
|
+
setShowAddCustom(true);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
var addCustomTag = function addCustomTag() {
|
|
249
|
+
var newFilter = _objectSpread({}, filter);
|
|
250
|
+
|
|
251
|
+
if (!newFilter[customType].includes(customTag)) {
|
|
252
|
+
newFilter[customType].push(customTag);
|
|
253
|
+
updateFilter(newFilter);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
setShowAddCustom(false);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
var handleKeyPress = function handleKeyPress(e) {
|
|
260
|
+
if (e.which === 13) {
|
|
261
|
+
if (customTag.length > 0) {
|
|
262
|
+
addCustomTag();
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
178
267
|
var showModules = !hideModuleTagFilters || !hideModuleLocationFilters;
|
|
179
268
|
var showMonitoringPoints = !hideMonitoringPointTagFilters || !hideMonitoringPointTypeFilters;
|
|
180
269
|
var columns = 0;
|
|
181
270
|
if (showModules) columns++;
|
|
182
|
-
if (showMonitoringPoints) columns++; //
|
|
271
|
+
if (showMonitoringPoints) columns++; // Add any tags that aren't on the supplied list to the supplied list. This is needed in case we reference tags that have been deleted/etc.
|
|
272
|
+
|
|
273
|
+
var adjustedModuleTags = _toConsumableArray(tags.moduleTags);
|
|
274
|
+
|
|
275
|
+
filter.moduleTagFilters.forEach(function (x) {
|
|
276
|
+
if (!adjustedModuleTags.find(function (tagInfo) {
|
|
277
|
+
return tagInfo.tag === x;
|
|
278
|
+
})) {
|
|
279
|
+
adjustedModuleTags.push({
|
|
280
|
+
tag: x,
|
|
281
|
+
count: 0
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
var adjustedLocationTags = _toConsumableArray(tags.locationTags);
|
|
287
|
+
|
|
288
|
+
filter.moduleLocationFilters.forEach(function (x) {
|
|
289
|
+
if (!adjustedLocationTags.find(function (tagInfo) {
|
|
290
|
+
return tagInfo.tag === x;
|
|
291
|
+
})) {
|
|
292
|
+
adjustedLocationTags.push({
|
|
293
|
+
tag: x,
|
|
294
|
+
count: 0
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
var adjustedMonitoringPointTags = _toConsumableArray(tags.monitoringPointTags);
|
|
183
300
|
|
|
184
|
-
|
|
301
|
+
filter.monitoringPointTagFilters.forEach(function (x) {
|
|
302
|
+
if (!adjustedMonitoringPointTags.find(function (tagInfo) {
|
|
303
|
+
return tagInfo.tag === x;
|
|
304
|
+
})) {
|
|
305
|
+
adjustedMonitoringPointTags.push({
|
|
306
|
+
tag: x,
|
|
307
|
+
count: 0
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
var adjustedMonitoringPointTypes = _toConsumableArray(tags.typeTags);
|
|
313
|
+
|
|
314
|
+
filter.monitoringPointTypeFilters.forEach(function (x) {
|
|
315
|
+
if (!adjustedMonitoringPointTypes.find(function (tagInfo) {
|
|
316
|
+
return tagInfo.tag === x;
|
|
317
|
+
})) {
|
|
318
|
+
adjustedMonitoringPointTypes.push({
|
|
319
|
+
tag: x,
|
|
320
|
+
count: 0
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}); // Filter or not
|
|
324
|
+
// const filteredModuleTags = search.length > 0 ? tags.moduleTags.filter(x => x.tag.includes(search)) : [...tags.moduleTags];
|
|
325
|
+
// const filteredLocationTags = search.length > 0 ? tags.locationTags.filter(x => x.tag.includes(search)) : [...tags.locationTags];
|
|
326
|
+
// const filteredMonitoringPointTags = search.length > 0 ? tags.monitoringPointTags.filter(x => x.tag.includes(search)) : [...tags.monitoringPointTags];
|
|
327
|
+
// const filteredTypeTags = search.length > 0 ? tags.typeTags.filter(x => x.tag.includes(search)) : [...tags.typeTags];
|
|
328
|
+
|
|
329
|
+
var filteredModuleTags = search.length > 0 ? adjustedModuleTags.filter(function (x) {
|
|
185
330
|
return x.tag.includes(search);
|
|
186
|
-
}) : _toConsumableArray(
|
|
187
|
-
var filteredLocationTags = search.length > 0 ?
|
|
331
|
+
}) : _toConsumableArray(adjustedModuleTags);
|
|
332
|
+
var filteredLocationTags = search.length > 0 ? adjustedLocationTags.filter(function (x) {
|
|
188
333
|
return x.tag.includes(search);
|
|
189
|
-
}) : _toConsumableArray(
|
|
190
|
-
var filteredMonitoringPointTags = search.length > 0 ?
|
|
334
|
+
}) : _toConsumableArray(adjustedLocationTags);
|
|
335
|
+
var filteredMonitoringPointTags = search.length > 0 ? adjustedMonitoringPointTags.filter(function (x) {
|
|
191
336
|
return x.tag.includes(search);
|
|
192
|
-
}) : _toConsumableArray(
|
|
193
|
-
var filteredTypeTags = search.length > 0 ?
|
|
337
|
+
}) : _toConsumableArray(adjustedMonitoringPointTags);
|
|
338
|
+
var filteredTypeTags = search.length > 0 ? adjustedMonitoringPointTypes.filter(function (x) {
|
|
194
339
|
return x.tag.includes(search);
|
|
195
|
-
}) : _toConsumableArray(
|
|
340
|
+
}) : _toConsumableArray(adjustedMonitoringPointTypes); // Sort by highest quantities of tags
|
|
196
341
|
|
|
197
342
|
filteredModuleTags.sort(function (a, b) {
|
|
198
343
|
return b.count - a.count;
|
|
@@ -206,23 +351,25 @@ function TagFilterBuilder(props) {
|
|
|
206
351
|
filteredTypeTags.sort(function (a, b) {
|
|
207
352
|
return b.count - a.count;
|
|
208
353
|
});
|
|
209
|
-
|
|
354
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
355
|
+
|
|
356
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.default, {
|
|
210
357
|
container: true
|
|
211
|
-
}, _react.default.createElement(_Grid.default, {
|
|
358
|
+
}, /*#__PURE__*/_react.default.createElement(_Grid.default, {
|
|
212
359
|
item: true,
|
|
213
360
|
xs: 12
|
|
214
|
-
}, _react.default.createElement("div", {
|
|
361
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
215
362
|
style: style.header
|
|
216
|
-
}, _react.default.createElement(_FilterList.default, {
|
|
363
|
+
}, /*#__PURE__*/_react.default.createElement(_FilterList.default, {
|
|
217
364
|
style: {
|
|
218
365
|
marginRight: 10
|
|
219
366
|
}
|
|
220
|
-
}), _react.default.createElement(_Typography.default, {
|
|
367
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
221
368
|
variant: "h6",
|
|
222
369
|
style: {
|
|
223
370
|
flexGrow: 1
|
|
224
371
|
}
|
|
225
|
-
}, "Tag Filter Builder"), _react.default.createElement(_TextField.default, {
|
|
372
|
+
}, "Tag Filter Builder"), /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
226
373
|
id: "searchbar",
|
|
227
374
|
placeholder: "Search...",
|
|
228
375
|
value: search,
|
|
@@ -230,51 +377,204 @@ function TagFilterBuilder(props) {
|
|
|
230
377
|
return updateSearch(e.target.value);
|
|
231
378
|
},
|
|
232
379
|
InputProps: {
|
|
233
|
-
startAdornment: _react.default.createElement(_InputAdornment.default, {
|
|
380
|
+
startAdornment: /*#__PURE__*/_react.default.createElement(_InputAdornment.default, {
|
|
234
381
|
position: "start"
|
|
235
|
-
}, _react.default.createElement(_Search.default, null))
|
|
382
|
+
}, /*#__PURE__*/_react.default.createElement(_Search.default, null))
|
|
236
383
|
}
|
|
237
|
-
}), _react.default.createElement(_IconButton.default, {
|
|
384
|
+
}), /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
238
385
|
onClick: function onClick() {
|
|
239
386
|
return props.close();
|
|
240
387
|
}
|
|
241
|
-
}, _react.default.createElement(_Close.default, null)))), showModules && _react.default.createElement(_Grid.default, {
|
|
388
|
+
}, /*#__PURE__*/_react.default.createElement(_Close.default, null)))), showModules && /*#__PURE__*/_react.default.createElement(_Grid.default, {
|
|
242
389
|
item: true,
|
|
243
390
|
xs: columns === 1 ? 12 : 6,
|
|
244
391
|
style: {
|
|
245
392
|
padding: 10
|
|
246
393
|
}
|
|
247
|
-
},
|
|
394
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
395
|
+
style: {
|
|
396
|
+
display: 'flex'
|
|
397
|
+
}
|
|
398
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
399
|
+
style: {
|
|
400
|
+
flexGrow: 1
|
|
401
|
+
}
|
|
402
|
+
}, "Modules", " (".concat((filter.moduleTagFilters.length + filter.moduleLocationFilters.length).toString(), ")")), /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
403
|
+
component: "button",
|
|
404
|
+
variant: "body2",
|
|
405
|
+
style: {
|
|
406
|
+
marginRight: 10
|
|
407
|
+
},
|
|
408
|
+
onClick: function onClick() {
|
|
409
|
+
return updateFilter(_objectSpread(_objectSpread({}, filter), {}, {
|
|
410
|
+
moduleTagFilters: [],
|
|
411
|
+
moduleLocationFilters: []
|
|
412
|
+
}));
|
|
413
|
+
}
|
|
414
|
+
}, intl.formatMessage({
|
|
415
|
+
id: '__clear'
|
|
416
|
+
})), /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
417
|
+
component: "button",
|
|
418
|
+
variant: "body2",
|
|
419
|
+
onClick: function onClick() {
|
|
420
|
+
return showCustom('module');
|
|
421
|
+
}
|
|
422
|
+
}, intl.formatMessage({
|
|
423
|
+
id: '__add_custom'
|
|
424
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
248
425
|
style: style.list,
|
|
249
426
|
className: _scrollbarModule.default.scroll
|
|
250
427
|
}, !hideModuleTagFilters && filteredModuleTags.map(function (moduleTag) {
|
|
251
428
|
return renderTag(moduleTag, 'moduleTagFilters');
|
|
252
429
|
}), !hideModuleLocationFilters && filteredLocationTags.map(function (locationTag) {
|
|
253
430
|
return renderTag(locationTag, 'moduleLocationFilters');
|
|
254
|
-
}))), showMonitoringPoints && _react.default.createElement(_Grid.default, {
|
|
431
|
+
}))), showMonitoringPoints && /*#__PURE__*/_react.default.createElement(_Grid.default, {
|
|
255
432
|
item: true,
|
|
256
433
|
xs: columns === 1 ? 12 : 6,
|
|
257
434
|
style: {
|
|
258
435
|
padding: 10
|
|
259
436
|
}
|
|
260
|
-
},
|
|
437
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
438
|
+
style: {
|
|
439
|
+
display: 'flex'
|
|
440
|
+
}
|
|
441
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
442
|
+
style: {
|
|
443
|
+
flexGrow: 1
|
|
444
|
+
}
|
|
445
|
+
}, "Monitoring Points", " (".concat((filter.monitoringPointTagFilters.length + filter.monitoringPointTypeFilters.length).toString(), ")")), /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
446
|
+
component: "button",
|
|
447
|
+
variant: "body2",
|
|
448
|
+
style: {
|
|
449
|
+
marginRight: 10
|
|
450
|
+
},
|
|
451
|
+
onClick: function onClick() {
|
|
452
|
+
return updateFilter(_objectSpread(_objectSpread({}, filter), {}, {
|
|
453
|
+
monitoringPointTagFilters: [],
|
|
454
|
+
monitoringPointTypeFilters: []
|
|
455
|
+
}));
|
|
456
|
+
}
|
|
457
|
+
}, intl.formatMessage({
|
|
458
|
+
id: '__clear'
|
|
459
|
+
})), /*#__PURE__*/_react.default.createElement(_Link.default, {
|
|
460
|
+
component: "button",
|
|
461
|
+
variant: "body2",
|
|
462
|
+
onClick: function onClick() {
|
|
463
|
+
return showCustom('monitoringPoint');
|
|
464
|
+
}
|
|
465
|
+
}, intl.formatMessage({
|
|
466
|
+
id: '__add_custom'
|
|
467
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
261
468
|
style: style.list,
|
|
262
469
|
className: _scrollbarModule.default.scroll
|
|
263
470
|
}, !hideMonitoringPointTagFilters && filteredMonitoringPointTags.map(function (mpTag) {
|
|
264
471
|
return renderTag(mpTag, 'monitoringPointTagFilters');
|
|
265
472
|
}), !hideMonitoringPointTypeFilters && filteredTypeTags.map(function (typeTag) {
|
|
266
473
|
return renderTag(typeTag, 'monitoringPointTypeFilters');
|
|
267
|
-
}))), columns === 0 && _react.default.createElement(_Grid.default, {
|
|
474
|
+
}))), columns === 0 && /*#__PURE__*/_react.default.createElement(_Grid.default, {
|
|
268
475
|
item: true,
|
|
269
476
|
xs: 12,
|
|
270
477
|
style: {
|
|
271
478
|
padding: 20,
|
|
272
479
|
textAlign: 'center'
|
|
273
480
|
}
|
|
274
|
-
}, "All types of tags have been hidden. Unhide some tags to be able to use the builder."))
|
|
481
|
+
}, "All types of tags have been hidden. Unhide some tags to be able to use the builder.")), showAddCustom && /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
482
|
+
open: true,
|
|
483
|
+
onClose: function onClose() {
|
|
484
|
+
return setShowAddCustom(false);
|
|
485
|
+
}
|
|
486
|
+
}, /*#__PURE__*/_react.default.createElement(_DialogContent.default, null, /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
487
|
+
variant: "outlined",
|
|
488
|
+
label: intl.formatMessage({
|
|
489
|
+
id: '__type'
|
|
490
|
+
}),
|
|
491
|
+
margin: "normal",
|
|
492
|
+
value: customType,
|
|
493
|
+
onChange: function onChange(e) {
|
|
494
|
+
return setCustomType(e.target.value);
|
|
495
|
+
},
|
|
496
|
+
fullWidth: true,
|
|
497
|
+
select: true
|
|
498
|
+
}, customTypeOptions.map(function (cto) {
|
|
499
|
+
switch (cto) {
|
|
500
|
+
case 'moduleTagFilters':
|
|
501
|
+
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
502
|
+
key: cto,
|
|
503
|
+
value: cto
|
|
504
|
+
}, /*#__PURE__*/_react.default.createElement(_LocalOffer.default, {
|
|
505
|
+
style: {
|
|
506
|
+
marginRight: 10
|
|
507
|
+
}
|
|
508
|
+
}), "Module Configuration Tag");
|
|
509
|
+
|
|
510
|
+
case 'moduleLocationFilters':
|
|
511
|
+
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
512
|
+
key: cto,
|
|
513
|
+
value: cto
|
|
514
|
+
}, /*#__PURE__*/_react.default.createElement(_LocationOn.default, {
|
|
515
|
+
style: {
|
|
516
|
+
marginRight: 10
|
|
517
|
+
}
|
|
518
|
+
}), "Module Location Tag");
|
|
519
|
+
|
|
520
|
+
case 'monitoringPointTagFilters':
|
|
521
|
+
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
522
|
+
key: cto,
|
|
523
|
+
value: cto
|
|
524
|
+
}, /*#__PURE__*/_react.default.createElement(_LocalOffer.default, {
|
|
525
|
+
style: {
|
|
526
|
+
marginRight: 10
|
|
527
|
+
}
|
|
528
|
+
}), "Monitoring Point Tag");
|
|
529
|
+
|
|
530
|
+
case 'monitoringPointTypeFilters':
|
|
531
|
+
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
532
|
+
key: cto,
|
|
533
|
+
value: cto
|
|
534
|
+
}, /*#__PURE__*/_react.default.createElement(_Category.default, {
|
|
535
|
+
style: {
|
|
536
|
+
marginRight: 10
|
|
537
|
+
}
|
|
538
|
+
}), "Monitoring Point Type");
|
|
539
|
+
|
|
540
|
+
default:
|
|
541
|
+
return /*#__PURE__*/_react.default.createElement("option", {
|
|
542
|
+
key: cto,
|
|
543
|
+
value: cto
|
|
544
|
+
}, cto);
|
|
545
|
+
}
|
|
546
|
+
})), /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
547
|
+
variant: "outlined",
|
|
548
|
+
label: intl.formatMessage({
|
|
549
|
+
id: '__custom_tag'
|
|
550
|
+
}),
|
|
551
|
+
margin: "normal",
|
|
552
|
+
fullWidth: true,
|
|
553
|
+
autoFocus: true,
|
|
554
|
+
onKeyPress: function onKeyPress(e) {
|
|
555
|
+
return handleKeyPress(e);
|
|
556
|
+
},
|
|
557
|
+
InputLabelProps: {
|
|
558
|
+
shrink: true
|
|
559
|
+
},
|
|
560
|
+
value: customTag,
|
|
561
|
+
onChange: function onChange(e) {
|
|
562
|
+
return setCustomTag(e.target.value.replace(/[^a-z0-9_]/g, ''));
|
|
563
|
+
}
|
|
564
|
+
})), /*#__PURE__*/_react.default.createElement(_DialogActions.default, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
565
|
+
variant: "contained",
|
|
566
|
+
color: "primary",
|
|
567
|
+
disabled: customTag.length === 0,
|
|
568
|
+
onClick: function onClick() {
|
|
569
|
+
return addCustomTag();
|
|
570
|
+
}
|
|
571
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, {
|
|
572
|
+
id: "__add"
|
|
573
|
+
})))));
|
|
275
574
|
}
|
|
276
575
|
|
|
277
576
|
TagFilterBuilder.propTypes = {
|
|
577
|
+
intl: _propTypes.default.shape().isRequired,
|
|
278
578
|
tags: _propTypes.default.shape().isRequired,
|
|
279
579
|
filter: _propTypes.default.shape().isRequired,
|
|
280
580
|
updateFilter: _propTypes.default.func.isRequired,
|
|
@@ -284,5 +584,7 @@ TagFilterBuilder.propTypes = {
|
|
|
284
584
|
hideMonitoringPointTagFilters: _propTypes.default.bool.isRequired,
|
|
285
585
|
hideMonitoringPointTypeFilters: _propTypes.default.bool.isRequired
|
|
286
586
|
};
|
|
287
|
-
|
|
587
|
+
|
|
588
|
+
var _default = (0, _reactIntl.injectIntl)(TagFilterBuilder);
|
|
589
|
+
|
|
288
590
|
exports.default = _default;
|