config-editor-base 3.0.5 → 3.0.7

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/index.js CHANGED
@@ -1445,7 +1445,7 @@ var lodash = createCommonjsModule(function (module, exports) {
1445
1445
  var undefined$1;
1446
1446
 
1447
1447
  /** Used as the semantic version number. */
1448
- var VERSION = '4.17.21';
1448
+ var VERSION = '4.17.23';
1449
1449
 
1450
1450
  /** Used as the size to enable large array optimizations. */
1451
1451
  var LARGE_ARRAY_SIZE = 200;
@@ -5199,7 +5199,7 @@ var lodash = createCommonjsModule(function (module, exports) {
5199
5199
  if (isArray(iteratee)) {
5200
5200
  return function(value) {
5201
5201
  return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
5202
- }
5202
+ };
5203
5203
  }
5204
5204
  return iteratee;
5205
5205
  });
@@ -5803,8 +5803,47 @@ var lodash = createCommonjsModule(function (module, exports) {
5803
5803
  */
5804
5804
  function baseUnset(object, path) {
5805
5805
  path = castPath(path, object);
5806
- object = parent(object, path);
5807
- return object == null || delete object[toKey(last(path))];
5806
+
5807
+ // Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
5808
+ var index = -1,
5809
+ length = path.length;
5810
+
5811
+ if (!length) {
5812
+ return true;
5813
+ }
5814
+
5815
+ var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
5816
+
5817
+ while (++index < length) {
5818
+ var key = path[index];
5819
+
5820
+ // skip non-string keys (e.g., Symbols, numbers)
5821
+ if (typeof key !== 'string') {
5822
+ continue;
5823
+ }
5824
+
5825
+ // Always block "__proto__" anywhere in the path if it's not expected
5826
+ if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
5827
+ return false;
5828
+ }
5829
+
5830
+ // Block "constructor.prototype" chains
5831
+ if (key === 'constructor' &&
5832
+ (index + 1) < length &&
5833
+ typeof path[index + 1] === 'string' &&
5834
+ path[index + 1] === 'prototype') {
5835
+
5836
+ // Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
5837
+ if (isRootPrimitive && index === 0) {
5838
+ continue;
5839
+ }
5840
+
5841
+ return false;
5842
+ }
5843
+ }
5844
+
5845
+ var obj = parent(object, path);
5846
+ return obj == null || delete obj[toKey(last(path))];
5808
5847
  }
5809
5848
 
5810
5849
  /**
@@ -18995,8 +19034,18 @@ var EditorToolModalWrapper = /*#__PURE__*/function (_React$Component) {
18995
19034
  var _proto = EditorToolModalWrapper.prototype;
18996
19035
  _proto.render = function render() {
18997
19036
  return /*#__PURE__*/React.createElement("div", {
18998
- className: "tools-side-bar"
18999
- }, /*#__PURE__*/React.createElement("button", {
19037
+ className: classNames('tools-side-bar', {
19038
+ 'tools-side-bar-expanded': this.props.isExpanded
19039
+ })
19040
+ }, this.props.name === 'filter-builder-modal' && /*#__PURE__*/React.createElement("button", {
19041
+ type: "button",
19042
+ className: "close expand-toggle",
19043
+ onClick: this.props.onToggleExpand
19044
+ }, /*#__PURE__*/React.createElement("span", {
19045
+ style: {
19046
+ color: "gray"
19047
+ }
19048
+ }, this.props.isExpanded ? "\xBB" : "\xAB")), /*#__PURE__*/React.createElement("button", {
19000
19049
  type: "button",
19001
19050
  className: "close",
19002
19051
  onClick: this.props.onClick
@@ -19274,6 +19323,7 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19274
19323
  isDownloadConfig: false,
19275
19324
  isCompareChanges: false,
19276
19325
  activeSideBar: 'schema-modal',
19326
+ isSideBarExpanded: false,
19277
19327
  showNewToolsHighlight: true
19278
19328
  };
19279
19329
  setTimeout(function () {
@@ -19281,6 +19331,7 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19281
19331
  showNewToolsHighlight: false
19282
19332
  });
19283
19333
  }, 10000);
19334
+ _this.toggleSideBarExpand = _this.toggleSideBarExpand.bind(_this);
19284
19335
  _this.input = '';
19285
19336
  _this.s3 = _this.props.fetchFileContentExt ? true : false;
19286
19337
  return _this;
@@ -19296,11 +19347,17 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19296
19347
  var _this2 = this;
19297
19348
  var sideBar = this.state.activeSideBar == name ? 'none' : name;
19298
19349
  this.setState({
19299
- activeSideBar: sideBar
19350
+ activeSideBar: sideBar,
19351
+ isSideBarExpanded: sideBar === 'none' ? false : this.state.isSideBarExpanded
19300
19352
  }, function () {
19301
19353
  _this2.props.setConfigContentPreSubmit();
19302
19354
  });
19303
19355
  };
19356
+ _proto.toggleSideBarExpand = function toggleSideBarExpand() {
19357
+ this.setState({
19358
+ isSideBarExpanded: !this.state.isSideBarExpanded
19359
+ });
19360
+ };
19304
19361
  _proto.hideUischemaModal = function hideUischemaModal() {
19305
19362
  this.setState({
19306
19363
  showUischemaModal: false
@@ -19490,7 +19547,8 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19490
19547
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
19491
19548
  className: classNames({
19492
19549
  'config-editor fe-header': true,
19493
- 'encryption-padding': this.state.activeSideBar != 'none'
19550
+ 'encryption-padding': this.state.activeSideBar != 'none' && !this.state.isSideBarExpanded,
19551
+ 'encryption-padding-expanded': this.state.activeSideBar != 'none' && this.state.isSideBarExpanded
19494
19552
  })
19495
19553
  }, /*#__PURE__*/React.createElement("header", {
19496
19554
  className: "top-header-offline"
@@ -19502,9 +19560,12 @@ var EditorSection = /*#__PURE__*/function (_React$Component) {
19502
19560
  }
19503
19561
  }, /*#__PURE__*/React.createElement(EditorToolModalWrapper, {
19504
19562
  modal: modal.modal,
19563
+ name: modal.name,
19505
19564
  onClick: function onClick() {
19506
19565
  return _this6.subMenuBtnClick('none');
19507
- }
19566
+ },
19567
+ isExpanded: _this6.state.isSideBarExpanded,
19568
+ onToggleExpand: _this6.toggleSideBarExpand
19508
19569
  }));
19509
19570
  }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", null, editorConfigFiles.length == 0 && this.props.demoMode == false ? /*#__PURE__*/React.createElement("div", {
19510
19571
  className: "schema-loader-callout config-loader"
@@ -24021,16 +24082,24 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24021
24082
  var fileList = dbcData.filesWithoutPrefix.join(', ');
24022
24083
  this.props.showAlert("warning", "No valid CAN channel prefix found for: " + fileList + ". Specify the relevant channel via e.g. \"can1-\", \"can2-\" prefixes in the DBC file names.");
24023
24084
  }
24085
+ var validFileNames = dbcData.parsedFiles.filter(function (f) {
24086
+ return f.hasValidPrefix;
24087
+ }).map(function (f) {
24088
+ return f.filename;
24089
+ });
24024
24090
  this.setState({
24025
24091
  dbcData: dbcData,
24092
+ dbcFileNames: validFileNames,
24026
24093
  isLoading: false
24027
24094
  }, function () {
24028
24095
  _this5.mergeData();
24029
24096
  });
24030
- var validFiles = dbcData.parsedFiles.filter(function (f) {
24031
- return f.hasValidPrefix;
24032
- }).length;
24033
- this.props.showAlert("success", "Loaded " + validFiles + " DBC file(s) with valid prefix");
24097
+ var validFiles = validFileNames.length;
24098
+ if (validFiles === 0) {
24099
+ this.props.showAlert("warning", "Loaded 0 DBC file(s) with valid prefix - add a prefix such as 'can1-' or 'can2-' in order to use the DBC");
24100
+ } else {
24101
+ this.props.showAlert("success", "Loaded " + validFiles + " DBC file(s) with valid prefix");
24102
+ }
24034
24103
  } catch (e) {
24035
24104
  this.props.showAlert("danger", "Error parsing DBC files: " + e.message);
24036
24105
  this.setState({
@@ -24295,7 +24364,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24295
24364
  });
24296
24365
  };
24297
24366
  _proto.generateFilterConfig = function generateFilterConfig() {
24298
- var _this10 = this;
24367
+ var _this0 = this;
24299
24368
  var _this$state6 = this.state,
24300
24369
  mergedEntries = _this$state6.mergedEntries,
24301
24370
  groupJ1939Pgns = _this$state6.groupJ1939Pgns,
@@ -24339,8 +24408,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24339
24408
  } else {
24340
24409
  var count11Bit = 0;
24341
24410
  var count29Bit = 0;
24342
- for (var _iterator10 = _createForOfIteratorHelperLoose(entries), _step10; !(_step10 = _iterator10()).done;) {
24343
- var entry = _step10.value;
24411
+ for (var _iterator0 = _createForOfIteratorHelperLoose(entries), _step0; !(_step0 = _iterator0()).done;) {
24412
+ var entry = _step0.value;
24344
24413
  if (entry.isGroup && entry.groupedIds) {
24345
24414
  count29Bit += 1;
24346
24415
  } else if (entry.idInt > 0x7FF) {
@@ -24377,8 +24446,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24377
24446
  var configKey = channelToConfigKey[_channel];
24378
24447
  if (!configKey) continue;
24379
24448
  var filters = [];
24380
- for (var _iterator11 = _createForOfIteratorHelperLoose(_entries), _step11; !(_step11 = _iterator11()).done;) {
24381
- var _entry4 = _step11.value;
24449
+ for (var _iterator1 = _createForOfIteratorHelperLoose(_entries), _step1; !(_step1 = _iterator1()).done;) {
24450
+ var _entry4 = _step1.value;
24382
24451
  var prescaler_type = 0;
24383
24452
  var prescaler_value = undefined;
24384
24453
  var filterTypeValue = filterType === "rejection" ? 1 : 0;
@@ -24514,12 +24583,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24514
24583
  this.setState({
24515
24584
  generatedFilterConfig: filterConfig
24516
24585
  }, function () {
24517
- _this10.testMergedFile();
24586
+ _this0.testMergedFile();
24518
24587
  });
24519
24588
  return filterConfig;
24520
24589
  };
24521
24590
  _proto.testMergedFile = function testMergedFile() {
24522
- var _this11 = this;
24591
+ var _this1 = this;
24523
24592
  var _this$state7 = this.state,
24524
24593
  generatedFilterConfig = _this$state7.generatedFilterConfig,
24525
24594
  filterMergeMode = _this$state7.filterMergeMode;
@@ -24553,7 +24622,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24553
24622
  this.setState({
24554
24623
  mergedConfig: mergedConfigTemp
24555
24624
  }, function () {
24556
- var schemaContent = _this11.props.schemaContent;
24625
+ var schemaContent = _this1.props.schemaContent;
24557
24626
  if (schemaContent && mergedConfigTemp) {
24558
24627
  try {
24559
24628
  var ajv = new Ajv({
@@ -24566,12 +24635,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24566
24635
  if (!valid && validate.errors) {
24567
24636
  console.log("AJV validation errors:", validate.errors);
24568
24637
  }
24569
- _this11.setState({
24638
+ _this1.setState({
24570
24639
  mergedConfigValid: valid
24571
24640
  });
24572
24641
  } catch (e) {
24573
24642
  console.log("AJV compilation/validation exception:", e);
24574
- _this11.setState({
24643
+ _this1.setState({
24575
24644
  mergedConfigValid: false
24576
24645
  });
24577
24646
  }
@@ -24638,8 +24707,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24638
24707
  var existing11Bit = 0;
24639
24708
  var existing29Bit = 0;
24640
24709
  if (formData[_configKey] && formData[_configKey].filter && formData[_configKey].filter.id) {
24641
- for (var _iterator12 = _createForOfIteratorHelperLoose(formData[_configKey].filter.id), _step12; !(_step12 = _iterator12()).done;) {
24642
- var filter = _step12.value;
24710
+ for (var _iterator10 = _createForOfIteratorHelperLoose(formData[_configKey].filter.id), _step10; !(_step10 = _iterator10()).done;) {
24711
+ var filter = _step10.value;
24643
24712
  if (filter.id_format === 1) {
24644
24713
  existing29Bit++;
24645
24714
  } else {
@@ -24650,8 +24719,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24650
24719
  var new11Bit = 0;
24651
24720
  var new29Bit = 0;
24652
24721
  if (generatedFilterConfig[_configKey] && generatedFilterConfig[_configKey].filter && generatedFilterConfig[_configKey].filter.id) {
24653
- for (var _iterator13 = _createForOfIteratorHelperLoose(generatedFilterConfig[_configKey].filter.id), _step13; !(_step13 = _iterator13()).done;) {
24654
- var _filter3 = _step13.value;
24722
+ for (var _iterator11 = _createForOfIteratorHelperLoose(generatedFilterConfig[_configKey].filter.id), _step11; !(_step11 = _iterator11()).done;) {
24723
+ var _filter3 = _step11.value;
24655
24724
  if (_filter3.id_format === 1) {
24656
24725
  new29Bit++;
24657
24726
  } else {
@@ -24691,8 +24760,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24691
24760
  var filters = config.phy[channel].filter;
24692
24761
  var seen = new Set();
24693
24762
  var uniqueFilters = [];
24694
- for (var _iterator14 = _createForOfIteratorHelperLoose(filters), _step14; !(_step14 = _iterator14()).done;) {
24695
- var filter = _step14.value;
24763
+ for (var _iterator12 = _createForOfIteratorHelperLoose(filters), _step12; !(_step12 = _iterator12()).done;) {
24764
+ var filter = _step12.value;
24696
24765
  var fieldsWithoutName = _objectWithoutPropertiesLoose(filter, _excluded);
24697
24766
  var key = JSON.stringify(fieldsWithoutName);
24698
24767
  if (!seen.has(key)) {
@@ -24713,8 +24782,8 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24713
24782
  var _filters = config[_channel3].filter.id;
24714
24783
  var _seen = new Set();
24715
24784
  var _uniqueFilters = [];
24716
- for (var _iterator15 = _createForOfIteratorHelperLoose(_filters), _step15; !(_step15 = _iterator15()).done;) {
24717
- var _filter4 = _step15.value;
24785
+ for (var _iterator13 = _createForOfIteratorHelperLoose(_filters), _step13; !(_step13 = _iterator13()).done;) {
24786
+ var _filter4 = _step13.value;
24718
24787
  var _fieldsWithoutName = _objectWithoutPropertiesLoose(_filter4, _excluded2);
24719
24788
  var _key = JSON.stringify(_fieldsWithoutName);
24720
24789
  if (!_seen.has(_key)) {
@@ -24810,15 +24879,15 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24810
24879
  });
24811
24880
  };
24812
24881
  _proto.render = function render() {
24813
- var _this12 = this;
24814
- var _this$state10 = this.state,
24815
- csvFileName = _this$state10.csvFileName,
24816
- dbcFileNames = _this$state10.dbcFileNames,
24817
- csvData = _this$state10.csvData,
24818
- mergedEntries = _this$state10.mergedEntries,
24819
- searchQuery = _this$state10.searchQuery,
24820
- groupJ1939Pgns = _this$state10.groupJ1939Pgns,
24821
- isLoading = _this$state10.isLoading;
24882
+ var _this10 = this;
24883
+ var _this$state0 = this.state,
24884
+ csvFileName = _this$state0.csvFileName,
24885
+ dbcFileNames = _this$state0.dbcFileNames,
24886
+ csvData = _this$state0.csvData,
24887
+ mergedEntries = _this$state0.mergedEntries,
24888
+ searchQuery = _this$state0.searchQuery,
24889
+ groupJ1939Pgns = _this$state0.groupJ1939Pgns,
24890
+ isLoading = _this$state0.isLoading;
24822
24891
  var filteredEntries = this.getFilteredEntries();
24823
24892
  var allFilteredSelected = filteredEntries.length > 0 && filteredEntries.every(function (e) {
24824
24893
  return e.selected;
@@ -24849,7 +24918,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24849
24918
  }, /*#__PURE__*/React.createElement(Files, {
24850
24919
  onChange: this.handleCsvUpload,
24851
24920
  onError: function onError(error) {
24852
- return _this12.props.showAlert("danger", error.message);
24921
+ return _this10.props.showAlert("danger", error.message);
24853
24922
  },
24854
24923
  accepts: [".csv"],
24855
24924
  multiple: false,
@@ -24863,7 +24932,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24863
24932
  }, /*#__PURE__*/React.createElement(Files, {
24864
24933
  onChange: this.handleDbcUpload,
24865
24934
  onError: function onError(error) {
24866
- return _this12.props.showAlert("danger", error.message);
24935
+ return _this10.props.showAlert("danger", error.message);
24867
24936
  },
24868
24937
  accepts: [".dbc"],
24869
24938
  multiple: true,
@@ -24873,14 +24942,14 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24873
24942
  }, /*#__PURE__*/React.createElement("button", {
24874
24943
  className: "btn btn-primary"
24875
24944
  }, "Load DBC(s)"))), function () {
24876
- var isFirmwareSupported = _this12.isFirmwareVersionSupported();
24877
- var isCanmod = _this12.props.deviceType === "CANmod";
24878
- var isCanmodRouter = isCanmod && _this12.isCanmodRouter();
24945
+ var isFirmwareSupported = _this10.isFirmwareVersionSupported();
24946
+ var isCanmod = _this10.props.deviceType === "CANmod";
24947
+ var isCanmodRouter = isCanmod && _this10.isCanmodRouter();
24879
24948
  var isDeviceSupported = !isCanmod || isCanmodRouter;
24880
- var hasConfig = _this12.props.formData && Object.keys(_this12.props.formData).length > 0;
24949
+ var hasConfig = _this10.props.formData && Object.keys(_this10.props.formData).length > 0;
24881
24950
  return /*#__PURE__*/React.createElement("button", {
24882
24951
  className: "btn",
24883
- onClick: _this12.onReset,
24952
+ onClick: _this10.onReset,
24884
24953
  disabled: !hasConfig || !isFirmwareSupported || !isDeviceSupported,
24885
24954
  style: {
24886
24955
  backgroundColor: "#fff",
@@ -24914,10 +24983,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24914
24983
  type: "checkbox",
24915
24984
  checked: groupJ1939Pgns,
24916
24985
  onChange: function onChange() {
24917
- _this12.setState({
24986
+ _this10.setState({
24918
24987
  groupJ1939Pgns: !groupJ1939Pgns
24919
24988
  }, function () {
24920
- _this12.mergeData();
24989
+ _this10.mergeData();
24921
24990
  });
24922
24991
  },
24923
24992
  style: {
@@ -24927,7 +24996,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24927
24996
  }), "Group 29-bit IDs as PGNs"), /*#__PURE__*/React.createElement("p", {
24928
24997
  className: "field-description field-description-shift"
24929
24998
  }, "In J1939/ISOBUS/NMEA protocol use cases it can be relevant to evaluate messages at the 18-bit PGN level instead of the 29-bit ID level.")), csvData && function () {
24930
- var isEnabled = _this12.props.formData && _this12.isFirmwareVersionSupported();
24999
+ var isEnabled = _this10.props.formData && _this10.isFirmwareVersionSupported();
24931
25000
  return /*#__PURE__*/React.createElement("div", {
24932
25001
  className: "form-group pl0 field-string",
24933
25002
  style: {
@@ -24944,9 +25013,9 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24944
25013
  }
24945
25014
  }, /*#__PURE__*/React.createElement("input", {
24946
25015
  type: "checkbox",
24947
- checked: _this12.state.showFilteredSummary,
25016
+ checked: _this10.state.showFilteredSummary,
24948
25017
  onChange: function onChange() {
24949
- return _this12.toggleFilteredSummary();
25018
+ return _this10.toggleFilteredSummary();
24950
25019
  },
24951
25020
  disabled: !isEnabled,
24952
25021
  style: {
@@ -24995,10 +25064,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
24995
25064
  }, label, ":"), /*#__PURE__*/React.createElement("input", {
24996
25065
  type: "text",
24997
25066
  className: "form-control encryption-input",
24998
- value: _this12.state["channelMap" + label],
25067
+ value: _this10.state["channelMap" + label],
24999
25068
  onChange: function onChange(e) {
25000
- var _this12$setState;
25001
- return _this12.setState((_this12$setState = {}, _this12$setState["channelMap" + label] = e.target.value, _this12$setState));
25069
+ var _this10$setState;
25070
+ return _this10.setState((_this10$setState = {}, _this10$setState["channelMap" + label] = e.target.value, _this10$setState));
25002
25071
  },
25003
25072
  style: {
25004
25073
  width: "36px",
@@ -25114,11 +25183,11 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25114
25183
  marginLeft: "8px"
25115
25184
  }
25116
25185
  }, "Signals")), filteredEntries.map(function (entry) {
25117
- var isChannelValid = _this12.props.deviceType === "CANmod" ? _this12.isChannelValid(entry.channel) : true;
25186
+ var isChannelValid = _this10.props.deviceType === "CANmod" ? _this10.isChannelValid(entry.channel) : true;
25118
25187
  return /*#__PURE__*/React.createElement("div", {
25119
25188
  key: entry.uniqueId,
25120
25189
  onClick: function onClick() {
25121
- return isChannelValid && _this12.handleEntryToggle(entry.uniqueId);
25190
+ return isChannelValid && _this10.handleEntryToggle(entry.uniqueId);
25122
25191
  },
25123
25192
  style: {
25124
25193
  display: "flex",
@@ -25146,7 +25215,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25146
25215
  checked: entry.selected,
25147
25216
  disabled: !isChannelValid,
25148
25217
  onChange: function onChange() {
25149
- return isChannelValid && _this12.handleEntryToggle(entry.uniqueId);
25218
+ return isChannelValid && _this10.handleEntryToggle(entry.uniqueId);
25150
25219
  }
25151
25220
  }), /*#__PURE__*/React.createElement("span", null))), /*#__PURE__*/React.createElement("span", {
25152
25221
  className: "binary-text-alt-2",
@@ -25183,7 +25252,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25183
25252
  display: "flex",
25184
25253
  alignItems: "center"
25185
25254
  }
25186
- }, _this12.renderBarChart(entry.isGroup ? entry.groupedPercentage : entry.percentage, maxPercentage), /*#__PURE__*/React.createElement("span", {
25255
+ }, _this10.renderBarChart(entry.isGroup ? entry.groupedPercentage : entry.percentage, maxPercentage), /*#__PURE__*/React.createElement("span", {
25187
25256
  style: {
25188
25257
  marginLeft: "4px",
25189
25258
  fontFamily: "monospace",
@@ -25274,7 +25343,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25274
25343
  marginLeft: "4px"
25275
25344
  },
25276
25345
  onClick: function onClick() {
25277
- return _this12.selectTop(30);
25346
+ return _this10.selectTop(30);
25278
25347
  }
25279
25348
  }, "Top 30"), /*#__PURE__*/React.createElement("span", {
25280
25349
  style: {
@@ -25287,7 +25356,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25287
25356
  cursor: "pointer"
25288
25357
  },
25289
25358
  onClick: function onClick() {
25290
- return _this12.selectTop(50);
25359
+ return _this10.selectTop(50);
25291
25360
  }
25292
25361
  }, "Top 50"), /*#__PURE__*/React.createElement("span", {
25293
25362
  style: {
@@ -25300,7 +25369,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25300
25369
  cursor: "pointer"
25301
25370
  },
25302
25371
  onClick: function onClick() {
25303
- return _this12.selectMatched(true);
25372
+ return _this10.selectMatched(true);
25304
25373
  }
25305
25374
  }, "Matched"), /*#__PURE__*/React.createElement("span", {
25306
25375
  style: {
@@ -25313,13 +25382,13 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25313
25382
  cursor: "pointer"
25314
25383
  },
25315
25384
  onClick: function onClick() {
25316
- return _this12.selectMatched(false);
25385
+ return _this10.selectMatched(false);
25317
25386
  }
25318
25387
  }, "Unmatched")), csvData && function () {
25319
- var activeCsvData = _this12.state.showFilteredSummary && _this12.state.filteredCsvData ? _this12.state.filteredCsvData : csvData;
25320
- var isFiltered = _this12.state.showFilteredSummary && _this12.state.filteredCsvData;
25321
- var originalFileSize = _this12.csvFileSize / (1024 * 1024);
25322
- var filteredFileSize = isFiltered ? originalFileSize * (1 - _this12.state.filterReductionPercent / 100) : originalFileSize;
25388
+ var activeCsvData = _this10.state.showFilteredSummary && _this10.state.filteredCsvData ? _this10.state.filteredCsvData : csvData;
25389
+ var isFiltered = _this10.state.showFilteredSummary && _this10.state.filteredCsvData;
25390
+ var originalFileSize = _this10.csvFileSize / (1024 * 1024);
25391
+ var filteredFileSize = isFiltered ? originalFileSize * (1 - _this10.state.filterReductionPercent / 100) : originalFileSize;
25323
25392
  return /*#__PURE__*/React.createElement("div", {
25324
25393
  style: {
25325
25394
  fontSize: "12px",
@@ -25346,7 +25415,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25346
25415
  color: "#5cb85c",
25347
25416
  marginTop: "4px"
25348
25417
  }
25349
- }, "Showing filtered summary (reduction: ", /*#__PURE__*/React.createElement("strong", null, _this12.state.filterReductionPercent.toFixed(1), "%"), ")"));
25418
+ }, "Showing filtered summary (reduction: ", /*#__PURE__*/React.createElement("strong", null, _this10.state.filterReductionPercent.toFixed(1), "%"), ")"));
25350
25419
  }(), function () {
25351
25420
  var hasSelection = mergedEntries.some(function (e) {
25352
25421
  return e.selected;
@@ -25372,10 +25441,10 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25372
25441
  }, /*#__PURE__*/React.createElement("div", {
25373
25442
  className: "col-xs-6",
25374
25443
  style: {
25375
- opacity: _this12.props.deviceType === "CANmod" ? 0.5 : 1,
25376
- pointerEvents: _this12.props.deviceType === "CANmod" ? "none" : "auto"
25444
+ opacity: _this10.props.deviceType === "CANmod" ? 0.5 : 1,
25445
+ pointerEvents: _this10.props.deviceType === "CANmod" ? "none" : "auto"
25377
25446
  },
25378
- title: _this12.props.deviceType === "CANmod" ? "CANmod only supports acceptance filters" : ""
25447
+ title: _this10.props.deviceType === "CANmod" ? "CANmod only supports acceptance filters" : ""
25379
25448
  }, /*#__PURE__*/React.createElement(SimpleDropdown, {
25380
25449
  name: "Type",
25381
25450
  options: [{
@@ -25385,53 +25454,53 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25385
25454
  value: "rejection",
25386
25455
  label: "Rejection"
25387
25456
  }],
25388
- value: _this12.state.filterType,
25457
+ value: _this10.state.filterType,
25389
25458
  onChange: function onChange(opt) {
25390
- return _this12.setState({
25459
+ return _this10.setState({
25391
25460
  filterType: opt.value
25392
25461
  }, function () {
25393
- return _this12.generateFilterConfig();
25462
+ return _this10.generateFilterConfig();
25394
25463
  });
25395
25464
  }
25396
- })), _this12.state.filterType === "acceptance" && /*#__PURE__*/React.createElement("div", {
25465
+ })), _this10.state.filterType === "acceptance" && /*#__PURE__*/React.createElement("div", {
25397
25466
  className: "col-xs-6"
25398
25467
  }, /*#__PURE__*/React.createElement(SimpleDropdown, {
25399
25468
  name: "Prescaler",
25400
25469
  options: prescalerOptions,
25401
- value: _this12.state.prescalerType,
25470
+ value: _this10.state.prescalerType,
25402
25471
  onChange: function onChange(opt) {
25403
- return _this12.setState({
25472
+ return _this10.setState({
25404
25473
  prescalerType: opt.value
25405
25474
  }, function () {
25406
- return _this12.generateFilterConfig();
25475
+ return _this10.generateFilterConfig();
25407
25476
  });
25408
25477
  }
25409
- }))), _this12.state.filterType === "acceptance" && _this12.state.prescalerType !== "none" && /*#__PURE__*/React.createElement("div", {
25478
+ }))), _this10.state.filterType === "acceptance" && _this10.state.prescalerType !== "none" && /*#__PURE__*/React.createElement("div", {
25410
25479
  className: "form-group pl0 field-string"
25411
- }, _this12.state.prescalerType === "count" && "Count value", _this12.state.prescalerType === "time" && "Time interval (ms)", _this12.state.prescalerType === "data" && "Data mask (hex)", (_this12.state.prescalerType === "count" || _this12.state.prescalerType === "time") && /*#__PURE__*/React.createElement("input", {
25480
+ }, _this10.state.prescalerType === "count" && "Count value", _this10.state.prescalerType === "time" && "Time interval (ms)", _this10.state.prescalerType === "data" && "Data mask (hex)", (_this10.state.prescalerType === "count" || _this10.state.prescalerType === "time") && /*#__PURE__*/React.createElement("input", {
25412
25481
  type: "number",
25413
25482
  className: "form-control encryption-input",
25414
25483
  min: "1",
25415
- max: _this12.state.prescalerType === "count" ? 256 : 4194304,
25416
- value: _this12.state.prescalerValue,
25484
+ max: _this10.state.prescalerType === "count" ? 256 : 4194304,
25485
+ value: _this10.state.prescalerValue,
25417
25486
  onChange: function onChange(e) {
25418
- return _this12.setState({
25487
+ return _this10.setState({
25419
25488
  prescalerValue: parseInt(e.target.value) || 1
25420
25489
  }, function () {
25421
- return _this12.generateFilterConfig();
25490
+ return _this10.generateFilterConfig();
25422
25491
  });
25423
25492
  }
25424
- }), _this12.state.prescalerType === "data" && /*#__PURE__*/React.createElement("input", {
25493
+ }), _this10.state.prescalerType === "data" && /*#__PURE__*/React.createElement("input", {
25425
25494
  type: "text",
25426
25495
  className: "form-control encryption-input",
25427
- value: _this12.state.dataPrescalerMask,
25496
+ value: _this10.state.dataPrescalerMask,
25428
25497
  onChange: function onChange(e) {
25429
25498
  var val = e.target.value.toUpperCase();
25430
25499
  if (/^[a-fA-F0-9]*$/.test(val) && val.length <= 16) {
25431
- _this12.setState({
25500
+ _this10.setState({
25432
25501
  dataPrescalerMask: val
25433
25502
  }, function () {
25434
- return _this12.generateFilterConfig();
25503
+ return _this10.generateFilterConfig();
25435
25504
  });
25436
25505
  }
25437
25506
  },
@@ -25442,7 +25511,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25442
25511
  }
25443
25512
  }), /*#__PURE__*/React.createElement("span", {
25444
25513
  className: "field-description field-description-shift"
25445
- }, _this12.state.prescalerType === "count" && "Accept every Nth message (1-256)", _this12.state.prescalerType === "time" && "Minimum time between messages (1-4194304 ms)", _this12.state.prescalerType === "data" && "Hex mask for data change detection")), /*#__PURE__*/React.createElement("div", {
25514
+ }, _this10.state.prescalerType === "count" && "Accept every Nth message (1-256)", _this10.state.prescalerType === "time" && "Minimum time between messages (1-4194304 ms)", _this10.state.prescalerType === "data" && "Hex mask for data change detection")), /*#__PURE__*/React.createElement("div", {
25446
25515
  className: "form-group pl0 field-string",
25447
25516
  style: {
25448
25517
  marginBottom: "10px"
@@ -25465,12 +25534,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25465
25534
  type: "radio",
25466
25535
  name: "filterMergeMode",
25467
25536
  value: "replace",
25468
- checked: _this12.state.filterMergeMode === "replace",
25537
+ checked: _this10.state.filterMergeMode === "replace",
25469
25538
  onChange: function onChange(e) {
25470
- return _this12.setState({
25539
+ return _this10.setState({
25471
25540
  filterMergeMode: e.target.value
25472
25541
  }, function () {
25473
- return _this12.generateFilterConfig();
25542
+ return _this10.generateFilterConfig();
25474
25543
  });
25475
25544
  },
25476
25545
  style: {
@@ -25493,12 +25562,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25493
25562
  type: "radio",
25494
25563
  name: "filterMergeMode",
25495
25564
  value: "append_top",
25496
- checked: _this12.state.filterMergeMode === "append_top",
25565
+ checked: _this10.state.filterMergeMode === "append_top",
25497
25566
  onChange: function onChange(e) {
25498
- return _this12.setState({
25567
+ return _this10.setState({
25499
25568
  filterMergeMode: e.target.value
25500
25569
  }, function () {
25501
- return _this12.generateFilterConfig();
25570
+ return _this10.generateFilterConfig();
25502
25571
  });
25503
25572
  },
25504
25573
  style: {
@@ -25521,12 +25590,12 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25521
25590
  type: "radio",
25522
25591
  name: "filterMergeMode",
25523
25592
  value: "append_bottom",
25524
- checked: _this12.state.filterMergeMode === "append_bottom",
25593
+ checked: _this10.state.filterMergeMode === "append_bottom",
25525
25594
  onChange: function onChange(e) {
25526
- return _this12.setState({
25595
+ return _this10.setState({
25527
25596
  filterMergeMode: e.target.value
25528
25597
  }, function () {
25529
- return _this12.generateFilterConfig();
25598
+ return _this10.generateFilterConfig();
25530
25599
  });
25531
25600
  },
25532
25601
  style: {
@@ -25562,9 +25631,9 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25562
25631
  }, 0);
25563
25632
  return " (" + count11Bit + " 11-bit, " + count29Bit + " 29-bit) | " + sizePercent.toFixed(1) + "%";
25564
25633
  }()), function () {
25565
- var isFirmwareSupported = _this12.isFirmwareVersionSupported();
25566
- var isCanmod = _this12.props.deviceType === "CANmod";
25567
- var isCanmodRouter = isCanmod && _this12.isCanmodRouter();
25634
+ var isFirmwareSupported = _this10.isFirmwareVersionSupported();
25635
+ var isCanmod = _this10.props.deviceType === "CANmod";
25636
+ var isCanmodRouter = isCanmod && _this10.isCanmodRouter();
25568
25637
  var minFirmware = isCanmod ? MIN_FIRMWARE_CANMOD_ROUTER : MIN_FIRMWARE_CANEDGE;
25569
25638
  var isDeviceSupported = !isCanmod || isCanmodRouter;
25570
25639
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
@@ -25575,25 +25644,25 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25575
25644
  }
25576
25645
  }, /*#__PURE__*/React.createElement("button", {
25577
25646
  className: "btn btn-primary",
25578
- onClick: _this12.onMerge,
25579
- disabled: !_this12.props.formData || Object.keys(_this12.props.formData).length === 0 || _this12.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported
25647
+ onClick: _this10.onMerge,
25648
+ disabled: !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported
25580
25649
  }, "Merge files"), /*#__PURE__*/React.createElement("button", {
25581
25650
  className: "btn btn-default",
25582
- onClick: _this12.onDownload,
25583
- disabled: Object.keys(_this12.state.generatedFilterConfig).length === 0
25651
+ onClick: _this10.onDownload,
25652
+ disabled: Object.keys(_this10.state.generatedFilterConfig).length === 0
25584
25653
  }, "Download JSON")), function () {
25585
- var mergeDisabled = !_this12.props.formData || Object.keys(_this12.props.formData).length === 0 || _this12.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported;
25654
+ var mergeDisabled = !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported;
25586
25655
  if (!mergeDisabled) return null;
25587
25656
  var reason = "";
25588
- if (!_this12.props.formData || Object.keys(_this12.props.formData).length === 0) {
25657
+ if (!_this10.props.formData || Object.keys(_this10.props.formData).length === 0) {
25589
25658
  reason = "No configuration file loaded";
25590
25659
  } else if (!isDeviceSupported) {
25591
25660
  reason = "Only CANmod.router is supported for CANmod devices";
25592
25661
  } else if (!isFirmwareSupported) {
25593
25662
  reason = "Merging requires firmware " + minFirmware + ".XX+ - please update your device";
25594
- } else if (_this12.state.mergedConfigValid === "Unknown") {
25663
+ } else if (_this10.state.mergedConfigValid === "Unknown") {
25595
25664
  reason = "No filters selected";
25596
- } else if (_this12.state.mergedConfigValid === false) {
25665
+ } else if (_this10.state.mergedConfigValid === false) {
25597
25666
  reason = "Generated filter configuration is invalid";
25598
25667
  }
25599
25668
  return reason ? /*#__PURE__*/React.createElement("div", {
@@ -25604,7 +25673,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25604
25673
  }
25605
25674
  }, reason) : null;
25606
25675
  }());
25607
- }(), Object.keys(_this12.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement("div", {
25676
+ }(), Object.keys(_this10.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement("div", {
25608
25677
  style: {
25609
25678
  marginTop: "10px"
25610
25679
  }
@@ -25617,17 +25686,17 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25617
25686
  }
25618
25687
  }, /*#__PURE__*/React.createElement("input", {
25619
25688
  type: "checkbox",
25620
- checked: _this12.state.showFilterPreview,
25689
+ checked: _this10.state.showFilterPreview,
25621
25690
  onChange: function onChange() {
25622
- return _this12.setState({
25623
- showFilterPreview: !_this12.state.showFilterPreview
25691
+ return _this10.setState({
25692
+ showFilterPreview: !_this10.state.showFilterPreview
25624
25693
  });
25625
25694
  },
25626
25695
  style: {
25627
25696
  marginRight: "6px",
25628
25697
  marginBottom: "4px"
25629
25698
  }
25630
- }), "Show partial config preview"), _this12.state.showFilterPreview && /*#__PURE__*/React.createElement("div", {
25699
+ }), "Show partial config preview"), _this10.state.showFilterPreview && /*#__PURE__*/React.createElement("div", {
25631
25700
  style: {
25632
25701
  marginTop: "10px"
25633
25702
  }
@@ -25638,7 +25707,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25638
25707
  overflow: "auto",
25639
25708
  fontSize: "11px"
25640
25709
  }
25641
- }, JSON.stringify(_this12.state.generatedFilterConfig, null, 2)))));
25710
+ }, JSON.stringify(_this10.state.generatedFilterConfig, null, 2)))));
25642
25711
  }()), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null)));
25643
25712
  };
25644
25713
  return FilterBuilderTool;