vue-devui 1.5.14 → 1.5.15-hotfix.1

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);
@@ -6502,7 +6502,9 @@ function parseDiffCode(container, code, outputFormat) {
6502
6502
  newTrStr += `<tr>${leftTdList == null ? void 0 : leftTdList.join("")}${rightTdList == null ? void 0 : rightTdList.join("")}</tr>`;
6503
6503
  }
6504
6504
  const tbodyAttr = ((_a = diffHtmlStr.match(TableTbodyAttrReg)) == null ? void 0 : _a[1]) || "";
6505
- const newDiffHtmlStr = diffHtmlStr.replace(TableTbodyReg, `<tbody ${tbodyAttr}>${newTrStr}</tbody>`);
6505
+ const emptyDiffHtmlStr = diffHtmlStr.replace(TableTbodyReg, `<tbody${tbodyAttr}></tbody>`);
6506
+ const index2 = emptyDiffHtmlStr.indexOf(`<tbody${tbodyAttr}>`);
6507
+ const newDiffHtmlStr = emptyDiffHtmlStr.slice(0, index2) + newTrStr + emptyDiffHtmlStr.slice(index2);
6506
6508
  diff2HtmlUi.diffHtml = newDiffHtmlStr;
6507
6509
  }
6508
6510
  diff2HtmlUi.draw();
@@ -6523,6 +6525,7 @@ function updateExpandUpDownButton(trNode) {
6523
6525
  trNode.children[0].children[0].innerHTML = AllExpandIcon();
6524
6526
  }
6525
6527
  function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, position, updateExpandButton = false) {
6528
+ var _a, _b;
6526
6529
  let nextL;
6527
6530
  let prevL;
6528
6531
  let nextR;
@@ -6535,9 +6538,9 @@ function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, posit
6535
6538
  prevR = Math.max(nextR - expandThreshold + 1, 1);
6536
6539
  } else if (position === "bottom") {
6537
6540
  const prevLineNode = trNode.previousElementSibling;
6538
- prevL = parseInt(prevLineNode.children[0].innerText) + 1;
6541
+ prevL = parseInt((_a = prevLineNode == null ? void 0 : prevLineNode.children[0]) == null ? void 0 : _a.innerText) + 1;
6539
6542
  nextL = prevL + expandThreshold - 1;
6540
- prevR = parseInt(prevLineNode.children[2].innerText) + 1;
6543
+ prevR = parseInt((_b = prevLineNode == null ? void 0 : prevLineNode.children[2]) == null ? void 0 : _b.innerText) + 1;
6541
6544
  nextR = prevR + expandThreshold - 1;
6542
6545
  } else {
6543
6546
  const prevLineNode = trNode.previousElementSibling;
@@ -6553,9 +6556,14 @@ function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, posit
6553
6556
  updateExpandUpDownButton(trNode);
6554
6557
  }
6555
6558
  }
6559
+ if (isNaN(prevL) || isNaN(prevR) || isNaN(nextL) || isNaN(nextR)) {
6560
+ return false;
6561
+ }
6556
6562
  setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
6563
+ return true;
6557
6564
  }
6558
6565
  function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpandButton = false) {
6566
+ var _a, _b, _c, _d;
6559
6567
  let nextL;
6560
6568
  let prevL;
6561
6569
  let nextR;
@@ -6568,9 +6576,9 @@ function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpa
6568
6576
  prevR = Math.max(nextR - expandThreshold + 1, 1);
6569
6577
  } else if (position === "bottom") {
6570
6578
  const prevLineNode = trNode.previousElementSibling;
6571
- prevL = parseInt(prevLineNode.children[0].children[0].innerText) + 1;
6579
+ prevL = parseInt((_b = (_a = prevLineNode == null ? void 0 : prevLineNode.children[0].children) == null ? void 0 : _a[0]) == null ? void 0 : _b.innerText) + 1;
6572
6580
  nextL = prevL + expandThreshold - 1;
6573
- prevR = parseInt(prevLineNode.children[0].children[1].innerText) + 1;
6581
+ prevR = parseInt((_d = (_c = prevLineNode == null ? void 0 : prevLineNode.children[0].children) == null ? void 0 : _c[1]) == null ? void 0 : _d.innerText) + 1;
6574
6582
  nextR = prevR + expandThreshold - 1;
6575
6583
  } else {
6576
6584
  const prevLineNode = trNode.previousElementSibling;
@@ -6586,7 +6594,11 @@ function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpa
6586
6594
  updateExpandUpDownButton(trNode);
6587
6595
  }
6588
6596
  }
6597
+ if (isNaN(prevL) || isNaN(prevR) || isNaN(nextL) || isNaN(nextR)) {
6598
+ return false;
6599
+ }
6589
6600
  setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
6601
+ return true;
6590
6602
  }
6591
6603
  function getLineNumberFromDataset(expandDom, expandThreshold) {
6592
6604
  var _a, _b, _c;
@@ -6764,10 +6776,16 @@ function useCodeReviewExpand(reviewContentRef, props) {
6764
6776
  }
6765
6777
  }
6766
6778
  const loadMoreLine = trNodes[0].cloneNode(true);
6767
- loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
6779
+ if (loadMoreLine.children[0].children[0]) {
6780
+ loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
6781
+ }
6768
6782
  loadMoreLine.children[1].innerText = "";
6769
6783
  (_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
6770
- updateLineNumberInDatasetForDoubleColumn(loadMoreLine, expandThreshold.value, "bottom");
6784
+ const res = updateLineNumberInDatasetForDoubleColumn(loadMoreLine, expandThreshold.value, "bottom");
6785
+ if (!res) {
6786
+ loadMoreLine.remove();
6787
+ return;
6788
+ }
6771
6789
  attachExpandUpDownButton(loadMoreLine.children[0], "down");
6772
6790
  };
6773
6791
  const insertIncrementCodeForDoubleColumn = (code, direction, referenceDom) => {
@@ -6779,7 +6797,7 @@ function useCodeReviewExpand(reviewContentRef, props) {
6779
6797
  }
6780
6798
  const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
6781
6799
  const container = document.createElement("div");
6782
- parseDiffCode(container, prefix + code, outputFormat.value);
6800
+ parseDiffCode(container, prefix + code, outputFormat.value, true);
6783
6801
  const trNodes = Array.from(container.querySelectorAll("tr"));
6784
6802
  const expandLine = trNodes.find((element) => {
6785
6803
  var _a;
@@ -6841,10 +6859,16 @@ function useCodeReviewExpand(reviewContentRef, props) {
6841
6859
  }
6842
6860
  }
6843
6861
  const loadMoreLine = trNodes[0].cloneNode(true);
6844
- loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
6862
+ if (loadMoreLine.children[0].children[0]) {
6863
+ loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
6864
+ }
6845
6865
  loadMoreLine.children[1].innerText = "";
6846
6866
  (_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
6847
- updateLineNumberInDataset(loadMoreLine, expandThreshold.value, "bottom");
6867
+ const res = updateLineNumberInDataset(loadMoreLine, expandThreshold.value, "bottom");
6868
+ if (!res) {
6869
+ loadMoreLine.remove();
6870
+ return;
6871
+ }
6848
6872
  attachExpandUpDownButton(loadMoreLine.children[0], "down");
6849
6873
  };
6850
6874
  const insertIncrementCode = (code, direction, referenceDom) => {
@@ -6856,7 +6880,7 @@ function useCodeReviewExpand(reviewContentRef, props) {
6856
6880
  }
6857
6881
  const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
6858
6882
  const container = document.createElement("div");
6859
- parseDiffCode(container, prefix + code, outputFormat.value);
6883
+ parseDiffCode(container, prefix + code, outputFormat.value, true);
6860
6884
  const trNodes = Array.from(container.querySelectorAll("tr"));
6861
6885
  const expandLine = trNodes.find((element) => {
6862
6886
  var _a;