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.
package/vue-devui.es.js CHANGED
@@ -14638,7 +14638,7 @@ function updateExpandLineCount(expandDom, newExpandDom) {
14638
14638
  const newChangedNumRight = parseInt((curMatches == null ? void 0 : curMatches[4]) || "") + parseInt((newMatches == null ? void 0 : newMatches[4]) || "");
14639
14639
  expandDom.children[1].children[0].innerText = `@@ -${(newMatches == null ? void 0 : newMatches[1]) || 0},${newChangedNumLeft} +${(newMatches == null ? void 0 : newMatches[3]) || 0},${newChangedNumRight} @@`;
14640
14640
  }
14641
- function parseDiffCode(container, code, outputFormat) {
14641
+ function parseDiffCode(container, code, outputFormat, isAddCode = false) {
14642
14642
  var _a;
14643
14643
  const diff2HtmlUi = new Diff2HtmlUI(container, code, {
14644
14644
  drawFileList: false,
@@ -14649,7 +14649,7 @@ function parseDiffCode(container, code, outputFormat) {
14649
14649
  });
14650
14650
  if (outputFormat === "side-by-side") {
14651
14651
  let diffHtmlStr = diff2HtmlUi.diffHtml;
14652
- if (diffHtmlStr.match(EmptyDataLangReg)) {
14652
+ if (diffHtmlStr.match(EmptyDataLangReg) && isAddCode) {
14653
14653
  diffHtmlStr = diffHtmlStr.replace(EmptyDataLangReg, "");
14654
14654
  }
14655
14655
  const trList = diffHtmlStr.match(TableTrReg);
@@ -14662,7 +14662,9 @@ function parseDiffCode(container, code, outputFormat) {
14662
14662
  newTrStr += `<tr>${leftTdList == null ? void 0 : leftTdList.join("")}${rightTdList == null ? void 0 : rightTdList.join("")}</tr>`;
14663
14663
  }
14664
14664
  const tbodyAttr = ((_a = diffHtmlStr.match(TableTbodyAttrReg)) == null ? void 0 : _a[1]) || "";
14665
- const newDiffHtmlStr = diffHtmlStr.replace(TableTbodyReg, `<tbody ${tbodyAttr}>${newTrStr}</tbody>`);
14665
+ const emptyDiffHtmlStr = diffHtmlStr.replace(TableTbodyReg, `<tbody${tbodyAttr}></tbody>`);
14666
+ const index2 = emptyDiffHtmlStr.indexOf(`<tbody${tbodyAttr}>`);
14667
+ const newDiffHtmlStr = emptyDiffHtmlStr.slice(0, index2) + newTrStr + emptyDiffHtmlStr.slice(index2);
14666
14668
  diff2HtmlUi.diffHtml = newDiffHtmlStr;
14667
14669
  }
14668
14670
  diff2HtmlUi.draw();
@@ -14683,6 +14685,7 @@ function updateExpandUpDownButton(trNode) {
14683
14685
  trNode.children[0].children[0].innerHTML = AllExpandIcon();
14684
14686
  }
14685
14687
  function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, position, updateExpandButton = false) {
14688
+ var _a, _b;
14686
14689
  let nextL;
14687
14690
  let prevL;
14688
14691
  let nextR;
@@ -14695,9 +14698,9 @@ function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, posit
14695
14698
  prevR = Math.max(nextR - expandThreshold + 1, 1);
14696
14699
  } else if (position === "bottom") {
14697
14700
  const prevLineNode = trNode.previousElementSibling;
14698
- prevL = parseInt(prevLineNode.children[0].innerText) + 1;
14701
+ prevL = parseInt((_a = prevLineNode == null ? void 0 : prevLineNode.children[0]) == null ? void 0 : _a.innerText) + 1;
14699
14702
  nextL = prevL + expandThreshold - 1;
14700
- prevR = parseInt(prevLineNode.children[2].innerText) + 1;
14703
+ prevR = parseInt((_b = prevLineNode == null ? void 0 : prevLineNode.children[2]) == null ? void 0 : _b.innerText) + 1;
14701
14704
  nextR = prevR + expandThreshold - 1;
14702
14705
  } else {
14703
14706
  const prevLineNode = trNode.previousElementSibling;
@@ -14713,9 +14716,14 @@ function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, posit
14713
14716
  updateExpandUpDownButton(trNode);
14714
14717
  }
14715
14718
  }
14719
+ if (isNaN(prevL) || isNaN(prevR) || isNaN(nextL) || isNaN(nextR)) {
14720
+ return false;
14721
+ }
14716
14722
  setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
14723
+ return true;
14717
14724
  }
14718
14725
  function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpandButton = false) {
14726
+ var _a, _b, _c, _d;
14719
14727
  let nextL;
14720
14728
  let prevL;
14721
14729
  let nextR;
@@ -14728,9 +14736,9 @@ function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpa
14728
14736
  prevR = Math.max(nextR - expandThreshold + 1, 1);
14729
14737
  } else if (position === "bottom") {
14730
14738
  const prevLineNode = trNode.previousElementSibling;
14731
- prevL = parseInt(prevLineNode.children[0].children[0].innerText) + 1;
14739
+ prevL = parseInt((_b = (_a = prevLineNode == null ? void 0 : prevLineNode.children[0].children) == null ? void 0 : _a[0]) == null ? void 0 : _b.innerText) + 1;
14732
14740
  nextL = prevL + expandThreshold - 1;
14733
- prevR = parseInt(prevLineNode.children[0].children[1].innerText) + 1;
14741
+ prevR = parseInt((_d = (_c = prevLineNode == null ? void 0 : prevLineNode.children[0].children) == null ? void 0 : _c[1]) == null ? void 0 : _d.innerText) + 1;
14734
14742
  nextR = prevR + expandThreshold - 1;
14735
14743
  } else {
14736
14744
  const prevLineNode = trNode.previousElementSibling;
@@ -14746,7 +14754,11 @@ function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpa
14746
14754
  updateExpandUpDownButton(trNode);
14747
14755
  }
14748
14756
  }
14757
+ if (isNaN(prevL) || isNaN(prevR) || isNaN(nextL) || isNaN(nextR)) {
14758
+ return false;
14759
+ }
14749
14760
  setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
14761
+ return true;
14750
14762
  }
14751
14763
  function getLineNumberFromDataset(expandDom, expandThreshold) {
14752
14764
  var _a, _b, _c;
@@ -14924,10 +14936,16 @@ function useCodeReviewExpand(reviewContentRef, props) {
14924
14936
  }
14925
14937
  }
14926
14938
  const loadMoreLine = trNodes[0].cloneNode(true);
14927
- loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
14939
+ if (loadMoreLine.children[0].children[0]) {
14940
+ loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
14941
+ }
14928
14942
  loadMoreLine.children[1].innerText = "";
14929
14943
  (_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
14930
- updateLineNumberInDatasetForDoubleColumn(loadMoreLine, expandThreshold.value, "bottom");
14944
+ const res = updateLineNumberInDatasetForDoubleColumn(loadMoreLine, expandThreshold.value, "bottom");
14945
+ if (!res) {
14946
+ loadMoreLine.remove();
14947
+ return;
14948
+ }
14931
14949
  attachExpandUpDownButton(loadMoreLine.children[0], "down");
14932
14950
  };
14933
14951
  const insertIncrementCodeForDoubleColumn = (code, direction, referenceDom) => {
@@ -14939,7 +14957,7 @@ function useCodeReviewExpand(reviewContentRef, props) {
14939
14957
  }
14940
14958
  const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
14941
14959
  const container = document.createElement("div");
14942
- parseDiffCode(container, prefix + code, outputFormat.value);
14960
+ parseDiffCode(container, prefix + code, outputFormat.value, true);
14943
14961
  const trNodes = Array.from(container.querySelectorAll("tr"));
14944
14962
  const expandLine = trNodes.find((element) => {
14945
14963
  var _a;
@@ -15001,10 +15019,16 @@ function useCodeReviewExpand(reviewContentRef, props) {
15001
15019
  }
15002
15020
  }
15003
15021
  const loadMoreLine = trNodes[0].cloneNode(true);
15004
- loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
15022
+ if (loadMoreLine.children[0].children[0]) {
15023
+ loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
15024
+ }
15005
15025
  loadMoreLine.children[1].innerText = "";
15006
15026
  (_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
15007
- updateLineNumberInDataset(loadMoreLine, expandThreshold.value, "bottom");
15027
+ const res = updateLineNumberInDataset(loadMoreLine, expandThreshold.value, "bottom");
15028
+ if (!res) {
15029
+ loadMoreLine.remove();
15030
+ return;
15031
+ }
15008
15032
  attachExpandUpDownButton(loadMoreLine.children[0], "down");
15009
15033
  };
15010
15034
  const insertIncrementCode = (code, direction, referenceDom) => {
@@ -15016,7 +15040,7 @@ function useCodeReviewExpand(reviewContentRef, props) {
15016
15040
  }
15017
15041
  const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
15018
15042
  const container = document.createElement("div");
15019
- parseDiffCode(container, prefix + code, outputFormat.value);
15043
+ parseDiffCode(container, prefix + code, outputFormat.value, true);
15020
15044
  const trNodes = Array.from(container.querySelectorAll("tr"));
15021
15045
  const expandLine = trNodes.find((element) => {
15022
15046
  var _a;
@@ -23429,6 +23453,7 @@ function useInputEvent(inputRef, props, states, ctx2) {
23429
23453
  };
23430
23454
  const handleInputChange = () => {
23431
23455
  states.query = states.inputValue;
23456
+ ctx2.emit("inputChange", states.query);
23432
23457
  handleQueryChange(states.query);
23433
23458
  };
23434
23459
  const debouncedOnInputChange = lodash.exports.debounce(handleInputChange, delay.value);
@@ -23487,7 +23512,7 @@ function _isSlot$8(s) {
23487
23512
  var EditableSelect = defineComponent({
23488
23513
  name: "DEditableSelect",
23489
23514
  props: editableSelectProps,
23490
- emits: ["update:modelValue", "focus", "blur", "clear", "change", "visibleChange", "loadMore"],
23515
+ emits: ["update:modelValue", "focus", "blur", "clear", "change", "visibleChange", "loadMore", "inputChange"],
23491
23516
  setup(props, ctx2) {
23492
23517
  const ns2 = useNamespace$1("editable-select");
23493
23518
  const inputRef = ref();
@@ -25945,9 +25970,11 @@ var Tooltip = defineComponent({
25945
25970
  onMouseenterOverlay
25946
25971
  } = useTooltip(origin, props);
25947
25972
  const ns2 = useNamespace$1("tooltip");
25948
- const className2 = computed(() => {
25949
- return [ns2.b(), ns2.m(placement.value)].join(" ");
25950
- });
25973
+ const className2 = computed(() => ({
25974
+ [ns2.b()]: true,
25975
+ [ns2.m(placement.value)]: true,
25976
+ [ns2.m("with-content")]: slots.content
25977
+ }));
25951
25978
  provide(POPPER_TRIGGER_TOKEN, origin);
25952
25979
  return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
25953
25980
  default: () => {
@@ -25974,9 +26001,12 @@ var Tooltip = defineComponent({
25974
26001
  "onMouseenter": onMouseenterOverlay,
25975
26002
  "onMouseleave": onMouseleave
25976
26003
  }, {
25977
- default: () => [createVNode("span", {
25978
- "innerHTML": content2.value
25979
- }, null)]
26004
+ default: () => {
26005
+ var _a;
26006
+ return [slots.content ? (_a = slots.content) == null ? void 0 : _a.call(slots) : createVNode("span", {
26007
+ "innerHTML": content2.value
26008
+ }, null)];
26009
+ }
25980
26010
  })]
25981
26011
  })]
25982
26012
  })]);
@@ -30350,6 +30380,10 @@ const menuProps = {
30350
30380
  router: {
30351
30381
  type: Boolean,
30352
30382
  default: false
30383
+ },
30384
+ disableOverflowStyle: {
30385
+ type: Boolean,
30386
+ default: false
30353
30387
  }
30354
30388
  };
30355
30389
  var menu = "";
@@ -30443,7 +30477,7 @@ var Menu = defineComponent({
30443
30477
  const container = overflowContainerElement.children[1];
30444
30478
  const ob = new IntersectionObserver((entries) => {
30445
30479
  entries.forEach((entry) => {
30446
- if (!entry.isIntersecting) {
30480
+ if (!entry.isIntersecting && !props.disableOverflowStyle) {
30447
30481
  const cloneNode = entry.target.cloneNode(true);
30448
30482
  if (entry.target.classList.contains(`${ns2.b()}-overflow-container`)) {
30449
30483
  if (flag && entry.target.previousElementSibling && container.children.length) {
@@ -30514,7 +30548,7 @@ var Menu = defineComponent({
30514
30548
  "key": "overflowContainer",
30515
30549
  "title": "...",
30516
30550
  "class": overflowContainerClassName
30517
- }, null), [[vShow, overflowItemLength.value > 0 && mode.value === "horizontal"]])]);
30551
+ }, null), [[vShow, overflowItemLength.value > 0 && mode.value === "horizontal" && !props.disableOverflowStyle]])]);
30518
30552
  };
30519
30553
  }
30520
30554
  });
@@ -31899,6 +31933,7 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31899
31933
  };
31900
31934
  const queryChange = (query) => {
31901
31935
  filterQuery.value = query;
31936
+ ctx2.emit("input-change", query);
31902
31937
  };
31903
31938
  const isLoading = computed(() => typeof props.loading === "boolean" && props.loading);
31904
31939
  const debounceTime = computed(() => props.remote ? 300 : 0);
@@ -32563,7 +32598,7 @@ var select = "";
32563
32598
  var Select = defineComponent({
32564
32599
  name: "DSelect",
32565
32600
  props: selectProps,
32566
- emits: ["toggle-change", "value-change", "update:modelValue", "focus", "blur", "remove-tag", "clear"],
32601
+ emits: ["toggle-change", "value-change", "update:modelValue", "focus", "blur", "remove-tag", "clear", "input-change"],
32567
32602
  setup(props, ctx2) {
32568
32603
  const app = getCurrentInstance();
32569
32604
  const t = createI18nTranslate("DSelect", app);
@@ -44030,7 +44065,7 @@ const installs = [
44030
44065
  VirtualListInstall
44031
44066
  ];
44032
44067
  var vueDevui = {
44033
- version: "1.5.14",
44068
+ version: "1.5.15-hotfix.1",
44034
44069
  install(app) {
44035
44070
  installs.forEach((p) => app.use(p));
44036
44071
  }