config-editor-base 3.0.9 → 3.1.3

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.
@@ -18963,15 +18963,23 @@ var PartialConfigLoader = /*#__PURE__*/function (_React$Component) {
18963
18963
  className: "browse-file-name"
18964
18964
  }, jsonFileName))), Object.keys(jsonFile).length ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("pre", {
18965
18965
  className: "browse-file-preview"
18966
- }, JSON.stringify(jsonFile, null, 2)), formData ? /*#__PURE__*/React.createElement("div", null, mergedConfigValid ? /*#__PURE__*/React.createElement("span", null, " ", /*#__PURE__*/React.createElement("p", {
18967
- className: "btn-highlight"
18966
+ }, JSON.stringify(jsonFile, null, 2)), formData ? /*#__PURE__*/React.createElement("div", null, mergedConfigValid ? /*#__PURE__*/React.createElement("div", {
18967
+ className: "btn-highlight",
18968
+ style: {
18969
+ fontSize: "12px",
18970
+ marginBottom: "8px"
18971
+ }
18968
18972
  }, /*#__PURE__*/React.createElement("i", {
18969
18973
  className: "fa fa-check"
18970
- }), " \xA0Merged Configuration File validated")) : null, !mergedConfigValid ? /*#__PURE__*/React.createElement("p", {
18971
- className: "red-text"
18974
+ }), " Merged Configuration File validated") : null, !mergedConfigValid ? /*#__PURE__*/React.createElement("div", {
18975
+ className: "red-text",
18976
+ style: {
18977
+ fontSize: "12px",
18978
+ marginBottom: "8px"
18979
+ }
18972
18980
  }, /*#__PURE__*/React.createElement("i", {
18973
18981
  className: "fa fa-times"
18974
- }), " \xA0Merged Configuration File is invalid") : null, /*#__PURE__*/React.createElement("button", {
18982
+ }), " Merged Configuration File is invalid") : null, /*#__PURE__*/React.createElement("button", {
18975
18983
  className: "btn btn-primary",
18976
18984
  onClick: this.onReview
18977
18985
  }, "Merge files")) : null) : null) : /*#__PURE__*/React.createElement("div", {
@@ -19297,7 +19305,6 @@ var EditorChangesComparison$1 = connect(mapStateToProps$1)(EditorChangesComparis
19297
19305
  var regexRevision = new RegExp('\\d{2}\\.\\d{2}\\.json', 'g');
19298
19306
  var isDownloadConfig = false;
19299
19307
  var activatedTab;
19300
- var FormWithNavStable = applyNav(Form, EditorNavs);
19301
19308
  var EditorSection = /*#__PURE__*/function (_React$Component) {
19302
19309
  function EditorSection(props) {
19303
19310
  var _this;
@@ -19832,6 +19839,64 @@ var SimpleDropdown = /*#__PURE__*/function (_React$Component) {
19832
19839
  return SimpleDropdown;
19833
19840
  }(React.Component);
19834
19841
 
19842
+ var CollapsiblePreview = /*#__PURE__*/function (_React$Component) {
19843
+ function CollapsiblePreview() {
19844
+ return _React$Component.apply(this, arguments) || this;
19845
+ }
19846
+ _inheritsLoose(CollapsiblePreview, _React$Component);
19847
+ var _proto = CollapsiblePreview.prototype;
19848
+ _proto.render = function render() {
19849
+ var _this$props = this.props,
19850
+ open = _this$props.open,
19851
+ onToggle = _this$props.onToggle,
19852
+ data = _this$props.data,
19853
+ onDownload = _this$props.onDownload,
19854
+ label = _this$props.label;
19855
+ return /*#__PURE__*/React.createElement("div", {
19856
+ style: {
19857
+ marginTop: "10px"
19858
+ }
19859
+ }, /*#__PURE__*/React.createElement("div", {
19860
+ onClick: onToggle,
19861
+ style: {
19862
+ display: "inline-flex",
19863
+ alignItems: "center",
19864
+ cursor: "pointer",
19865
+ fontSize: "12px",
19866
+ color: "#999999",
19867
+ userSelect: "none"
19868
+ }
19869
+ }, /*#__PURE__*/React.createElement("i", {
19870
+ className: open ? "fa fa-angle-down" : "fa fa-angle-right",
19871
+ style: {
19872
+ marginRight: "6px",
19873
+ width: "8px"
19874
+ }
19875
+ }), label || "Show partial config preview"), open ? /*#__PURE__*/React.createElement("div", {
19876
+ style: {
19877
+ marginTop: "10px"
19878
+ }
19879
+ }, /*#__PURE__*/React.createElement("pre", {
19880
+ className: "browse-file-preview",
19881
+ style: {
19882
+ maxHeight: "300px",
19883
+ overflow: "auto",
19884
+ fontSize: "11px"
19885
+ }
19886
+ }, JSON.stringify(data, null, 2)), onDownload ? /*#__PURE__*/React.createElement("button", {
19887
+ className: "btn",
19888
+ onClick: onDownload,
19889
+ style: {
19890
+ backgroundColor: "#fff",
19891
+ border: "1px solid #ccc",
19892
+ color: "#333",
19893
+ marginTop: "8px"
19894
+ }
19895
+ }, "Download JSON") : null) : null);
19896
+ };
19897
+ return CollapsiblePreview;
19898
+ }(React.Component);
19899
+
19835
19900
  var obdPids = [
19836
19901
  {
19837
19902
  service: "01",
@@ -22743,48 +22808,28 @@ var OBDTool = /*#__PURE__*/function (_React$Component) {
22743
22808
  marginBottom: "15px",
22744
22809
  marginTop: "10px"
22745
22810
  }
22746
- }, "When testing supported PIDs, make sure the ignition is on for 2 minutes before you connect the device. Let the device be connected for 5 minutes to perform the test."), mergedConfigValid === false && /*#__PURE__*/React.createElement("p", {
22747
- className: "red-text"
22811
+ }, "When testing supported PIDs, make sure the ignition is on for 2 minutes before you connect the device. Let the device be connected for 5 minutes to perform the test."), mergedConfigValid === false && /*#__PURE__*/React.createElement("div", {
22812
+ className: "red-text",
22813
+ style: {
22814
+ fontSize: "12px",
22815
+ marginBottom: "8px"
22816
+ }
22748
22817
  }, /*#__PURE__*/React.createElement("i", {
22749
22818
  className: "fa fa-times"
22750
22819
  }), " Merged Configuration File is invalid"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
22751
22820
  className: "btn btn-primary",
22752
22821
  onClick: this.onMerge,
22753
22822
  disabled: !formData || Object.keys(formData).length === 0 || mergedConfigValid !== true
22754
- }, "Merge files"), /*#__PURE__*/React.createElement("button", {
22755
- className: "btn btn-default",
22756
- onClick: this.onDownload,
22757
- disabled: Object.keys(generatedConfig).length === 0,
22758
- style: {
22759
- marginLeft: "10px"
22760
- }
22761
- }, "Download JSON"))), Object.keys(generatedConfig).length > 0 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("label", {
22762
- style: {
22763
- display: "flex",
22764
- alignItems: "center",
22765
- cursor: "pointer",
22766
- fontSize: "12px",
22767
- marginTop: "8px"
22768
- }
22769
- }, /*#__PURE__*/React.createElement("input", {
22770
- type: "checkbox",
22771
- checked: showPreview,
22772
- onChange: function onChange() {
22823
+ }, "Merge files"))), Object.keys(generatedConfig).length > 0 && /*#__PURE__*/React.createElement(CollapsiblePreview, {
22824
+ open: showPreview,
22825
+ onToggle: function onToggle() {
22773
22826
  return _this9.setState({
22774
22827
  showPreview: !showPreview
22775
22828
  });
22776
22829
  },
22777
- style: {
22778
- marginRight: "6px",
22779
- marginBottom: "4px"
22780
- }
22781
- }), "Show partial config preview"), showPreview && /*#__PURE__*/React.createElement("div", {
22782
- style: {
22783
- marginTop: "10px"
22784
- }
22785
- }, /*#__PURE__*/React.createElement("pre", {
22786
- className: "browse-file-preview"
22787
- }, JSON.stringify(combinedConfig, null, 2))))), /*#__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)));
22830
+ data: combinedConfig,
22831
+ onDownload: this.onDownload
22832
+ })), /*#__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)));
22788
22833
  };
22789
22834
  return OBDTool;
22790
22835
  }(React.Component);
@@ -25643,11 +25688,7 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25643
25688
  className: "btn btn-primary",
25644
25689
  onClick: _this10.onMerge,
25645
25690
  disabled: !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported
25646
- }, "Merge files"), /*#__PURE__*/React.createElement("button", {
25647
- className: "btn btn-default",
25648
- onClick: _this10.onDownload,
25649
- disabled: Object.keys(_this10.state.generatedFilterConfig).length === 0
25650
- }, "Download JSON")), function () {
25691
+ }, "Merge files")), function () {
25651
25692
  var mergeDisabled = !_this10.props.formData || Object.keys(_this10.props.formData).length === 0 || _this10.state.mergedConfigValid !== true || !isFirmwareSupported || !isDeviceSupported;
25652
25693
  if (!mergeDisabled) return null;
25653
25694
  var reason = "";
@@ -25670,41 +25711,16 @@ var FilterBuilderTool = /*#__PURE__*/function (_React$Component) {
25670
25711
  }
25671
25712
  }, reason) : null;
25672
25713
  }());
25673
- }(), Object.keys(_this10.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement("div", {
25674
- style: {
25675
- marginTop: "10px"
25676
- }
25677
- }, /*#__PURE__*/React.createElement("label", {
25678
- style: {
25679
- display: "flex",
25680
- alignItems: "center",
25681
- cursor: "pointer",
25682
- fontSize: "12px"
25683
- }
25684
- }, /*#__PURE__*/React.createElement("input", {
25685
- type: "checkbox",
25686
- checked: _this10.state.showFilterPreview,
25687
- onChange: function onChange() {
25714
+ }(), Object.keys(_this10.state.generatedFilterConfig).length > 0 && /*#__PURE__*/React.createElement(CollapsiblePreview, {
25715
+ open: _this10.state.showFilterPreview,
25716
+ onToggle: function onToggle() {
25688
25717
  return _this10.setState({
25689
25718
  showFilterPreview: !_this10.state.showFilterPreview
25690
25719
  });
25691
25720
  },
25692
- style: {
25693
- marginRight: "6px",
25694
- marginBottom: "4px"
25695
- }
25696
- }), "Show partial config preview"), _this10.state.showFilterPreview && /*#__PURE__*/React.createElement("div", {
25697
- style: {
25698
- marginTop: "10px"
25699
- }
25700
- }, /*#__PURE__*/React.createElement("pre", {
25701
- className: "browse-file-preview",
25702
- style: {
25703
- maxHeight: "300px",
25704
- overflow: "auto",
25705
- fontSize: "11px"
25706
- }
25707
- }, JSON.stringify(_this10.state.generatedFilterConfig, null, 2)))));
25721
+ data: _this10.state.generatedFilterConfig,
25722
+ onDownload: _this10.onDownload
25723
+ }));
25708
25724
  }()), /*#__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)));
25709
25725
  };
25710
25726
  return FilterBuilderTool;