vue-devui 1.5.14 → 1.5.15

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.
@@ -4477,7 +4477,7 @@ var lodash = { exports: {} };
4477
4477
  customizer = typeof customizer == "function" ? customizer : undefined$1;
4478
4478
  return baseIsMatch(object, source, getMatchData(source), customizer);
4479
4479
  }
4480
- function isNaN(value) {
4480
+ function isNaN2(value) {
4481
4481
  return isNumber(value) && value != +value;
4482
4482
  }
4483
4483
  function isNative(value) {
@@ -5551,7 +5551,7 @@ var lodash = { exports: {} };
5551
5551
  lodash2.isMap = isMap;
5552
5552
  lodash2.isMatch = isMatch;
5553
5553
  lodash2.isMatchWith = isMatchWith;
5554
- lodash2.isNaN = isNaN;
5554
+ lodash2.isNaN = isNaN2;
5555
5555
  lodash2.isNative = isNative;
5556
5556
  lodash2.isNil = isNil;
5557
5557
  lodash2.isNull = isNull;
@@ -6478,7 +6478,7 @@ function updateExpandLineCount(expandDom, newExpandDom) {
6478
6478
  const newChangedNumRight = parseInt((curMatches == null ? void 0 : curMatches[4]) || "") + parseInt((newMatches == null ? void 0 : newMatches[4]) || "");
6479
6479
  expandDom.children[1].children[0].innerText = `@@ -${(newMatches == null ? void 0 : newMatches[1]) || 0},${newChangedNumLeft} +${(newMatches == null ? void 0 : newMatches[3]) || 0},${newChangedNumRight} @@`;
6480
6480
  }
6481
- function parseDiffCode(container, code, outputFormat) {
6481
+ function parseDiffCode(container, code, outputFormat, isAddCode = false) {
6482
6482
  var _a;
6483
6483
  const diff2HtmlUi = new Diff2HtmlUI(container, code, {
6484
6484
  drawFileList: false,
@@ -6489,7 +6489,7 @@ function parseDiffCode(container, code, outputFormat) {
6489
6489
  });
6490
6490
  if (outputFormat === "side-by-side") {
6491
6491
  let diffHtmlStr = diff2HtmlUi.diffHtml;
6492
- if (diffHtmlStr.match(EmptyDataLangReg)) {
6492
+ if (diffHtmlStr.match(EmptyDataLangReg) && isAddCode) {
6493
6493
  diffHtmlStr = diffHtmlStr.replace(EmptyDataLangReg, "");
6494
6494
  }
6495
6495
  const trList = diffHtmlStr.match(TableTrReg);
@@ -6523,6 +6523,7 @@ function updateExpandUpDownButton(trNode) {
6523
6523
  trNode.children[0].children[0].innerHTML = AllExpandIcon();
6524
6524
  }
6525
6525
  function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, position, updateExpandButton = false) {
6526
+ var _a, _b;
6526
6527
  let nextL;
6527
6528
  let prevL;
6528
6529
  let nextR;
@@ -6535,9 +6536,9 @@ function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, posit
6535
6536
  prevR = Math.max(nextR - expandThreshold + 1, 1);
6536
6537
  } else if (position === "bottom") {
6537
6538
  const prevLineNode = trNode.previousElementSibling;
6538
- prevL = parseInt(prevLineNode.children[0].innerText) + 1;
6539
+ prevL = parseInt((_a = prevLineNode == null ? void 0 : prevLineNode.children[0]) == null ? void 0 : _a.innerText) + 1;
6539
6540
  nextL = prevL + expandThreshold - 1;
6540
- prevR = parseInt(prevLineNode.children[2].innerText) + 1;
6541
+ prevR = parseInt((_b = prevLineNode == null ? void 0 : prevLineNode.children[2]) == null ? void 0 : _b.innerText) + 1;
6541
6542
  nextR = prevR + expandThreshold - 1;
6542
6543
  } else {
6543
6544
  const prevLineNode = trNode.previousElementSibling;
@@ -6553,9 +6554,14 @@ function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, posit
6553
6554
  updateExpandUpDownButton(trNode);
6554
6555
  }
6555
6556
  }
6557
+ if (isNaN(prevL) || isNaN(prevR) || isNaN(nextL) || isNaN(nextR)) {
6558
+ return false;
6559
+ }
6556
6560
  setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
6561
+ return true;
6557
6562
  }
6558
6563
  function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpandButton = false) {
6564
+ var _a, _b, _c, _d;
6559
6565
  let nextL;
6560
6566
  let prevL;
6561
6567
  let nextR;
@@ -6568,9 +6574,9 @@ function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpa
6568
6574
  prevR = Math.max(nextR - expandThreshold + 1, 1);
6569
6575
  } else if (position === "bottom") {
6570
6576
  const prevLineNode = trNode.previousElementSibling;
6571
- prevL = parseInt(prevLineNode.children[0].children[0].innerText) + 1;
6577
+ prevL = parseInt((_b = (_a = prevLineNode == null ? void 0 : prevLineNode.children[0].children) == null ? void 0 : _a[0]) == null ? void 0 : _b.innerText) + 1;
6572
6578
  nextL = prevL + expandThreshold - 1;
6573
- prevR = parseInt(prevLineNode.children[0].children[1].innerText) + 1;
6579
+ prevR = parseInt((_d = (_c = prevLineNode == null ? void 0 : prevLineNode.children[0].children) == null ? void 0 : _c[1]) == null ? void 0 : _d.innerText) + 1;
6574
6580
  nextR = prevR + expandThreshold - 1;
6575
6581
  } else {
6576
6582
  const prevLineNode = trNode.previousElementSibling;
@@ -6586,7 +6592,11 @@ function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpa
6586
6592
  updateExpandUpDownButton(trNode);
6587
6593
  }
6588
6594
  }
6595
+ if (isNaN(prevL) || isNaN(prevR) || isNaN(nextL) || isNaN(nextR)) {
6596
+ return false;
6597
+ }
6589
6598
  setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
6599
+ return true;
6590
6600
  }
6591
6601
  function getLineNumberFromDataset(expandDom, expandThreshold) {
6592
6602
  var _a, _b, _c;
@@ -6764,10 +6774,16 @@ function useCodeReviewExpand(reviewContentRef, props) {
6764
6774
  }
6765
6775
  }
6766
6776
  const loadMoreLine = trNodes[0].cloneNode(true);
6767
- loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
6777
+ if (loadMoreLine.children[0].children[0]) {
6778
+ loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
6779
+ }
6768
6780
  loadMoreLine.children[1].innerText = "";
6769
6781
  (_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
6770
- updateLineNumberInDatasetForDoubleColumn(loadMoreLine, expandThreshold.value, "bottom");
6782
+ const res = updateLineNumberInDatasetForDoubleColumn(loadMoreLine, expandThreshold.value, "bottom");
6783
+ if (!res) {
6784
+ loadMoreLine.remove();
6785
+ return;
6786
+ }
6771
6787
  attachExpandUpDownButton(loadMoreLine.children[0], "down");
6772
6788
  };
6773
6789
  const insertIncrementCodeForDoubleColumn = (code, direction, referenceDom) => {
@@ -6779,7 +6795,7 @@ function useCodeReviewExpand(reviewContentRef, props) {
6779
6795
  }
6780
6796
  const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
6781
6797
  const container = document.createElement("div");
6782
- parseDiffCode(container, prefix + code, outputFormat.value);
6798
+ parseDiffCode(container, prefix + code, outputFormat.value, true);
6783
6799
  const trNodes = Array.from(container.querySelectorAll("tr"));
6784
6800
  const expandLine = trNodes.find((element) => {
6785
6801
  var _a;
@@ -6841,10 +6857,16 @@ function useCodeReviewExpand(reviewContentRef, props) {
6841
6857
  }
6842
6858
  }
6843
6859
  const loadMoreLine = trNodes[0].cloneNode(true);
6844
- loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
6860
+ if (loadMoreLine.children[0].children[0]) {
6861
+ loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
6862
+ }
6845
6863
  loadMoreLine.children[1].innerText = "";
6846
6864
  (_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
6847
- updateLineNumberInDataset(loadMoreLine, expandThreshold.value, "bottom");
6865
+ const res = updateLineNumberInDataset(loadMoreLine, expandThreshold.value, "bottom");
6866
+ if (!res) {
6867
+ loadMoreLine.remove();
6868
+ return;
6869
+ }
6848
6870
  attachExpandUpDownButton(loadMoreLine.children[0], "down");
6849
6871
  };
6850
6872
  const insertIncrementCode = (code, direction, referenceDom) => {
@@ -6856,7 +6878,7 @@ function useCodeReviewExpand(reviewContentRef, props) {
6856
6878
  }
6857
6879
  const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
6858
6880
  const container = document.createElement("div");
6859
- parseDiffCode(container, prefix + code, outputFormat.value);
6881
+ parseDiffCode(container, prefix + code, outputFormat.value, true);
6860
6882
  const trNodes = Array.from(container.querySelectorAll("tr"));
6861
6883
  const expandLine = trNodes.find((element) => {
6862
6884
  var _a;