vue-devui 1.5.14 → 1.5.15-feat.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);
@@ -14683,6 +14683,7 @@ function updateExpandUpDownButton(trNode) {
14683
14683
  trNode.children[0].children[0].innerHTML = AllExpandIcon();
14684
14684
  }
14685
14685
  function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, position, updateExpandButton = false) {
14686
+ var _a, _b;
14686
14687
  let nextL;
14687
14688
  let prevL;
14688
14689
  let nextR;
@@ -14695,9 +14696,9 @@ function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, posit
14695
14696
  prevR = Math.max(nextR - expandThreshold + 1, 1);
14696
14697
  } else if (position === "bottom") {
14697
14698
  const prevLineNode = trNode.previousElementSibling;
14698
- prevL = parseInt(prevLineNode.children[0].innerText) + 1;
14699
+ prevL = parseInt((_a = prevLineNode == null ? void 0 : prevLineNode.children[0]) == null ? void 0 : _a.innerText) + 1;
14699
14700
  nextL = prevL + expandThreshold - 1;
14700
- prevR = parseInt(prevLineNode.children[2].innerText) + 1;
14701
+ prevR = parseInt((_b = prevLineNode == null ? void 0 : prevLineNode.children[2]) == null ? void 0 : _b.innerText) + 1;
14701
14702
  nextR = prevR + expandThreshold - 1;
14702
14703
  } else {
14703
14704
  const prevLineNode = trNode.previousElementSibling;
@@ -14713,9 +14714,14 @@ function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, posit
14713
14714
  updateExpandUpDownButton(trNode);
14714
14715
  }
14715
14716
  }
14717
+ if (isNaN(prevL) || isNaN(prevR) || isNaN(nextL) || isNaN(nextR)) {
14718
+ return false;
14719
+ }
14716
14720
  setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
14721
+ return true;
14717
14722
  }
14718
14723
  function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpandButton = false) {
14724
+ var _a, _b, _c, _d;
14719
14725
  let nextL;
14720
14726
  let prevL;
14721
14727
  let nextR;
@@ -14728,9 +14734,9 @@ function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpa
14728
14734
  prevR = Math.max(nextR - expandThreshold + 1, 1);
14729
14735
  } else if (position === "bottom") {
14730
14736
  const prevLineNode = trNode.previousElementSibling;
14731
- prevL = parseInt(prevLineNode.children[0].children[0].innerText) + 1;
14737
+ prevL = parseInt((_b = (_a = prevLineNode == null ? void 0 : prevLineNode.children[0].children) == null ? void 0 : _a[0]) == null ? void 0 : _b.innerText) + 1;
14732
14738
  nextL = prevL + expandThreshold - 1;
14733
- prevR = parseInt(prevLineNode.children[0].children[1].innerText) + 1;
14739
+ prevR = parseInt((_d = (_c = prevLineNode == null ? void 0 : prevLineNode.children[0].children) == null ? void 0 : _c[1]) == null ? void 0 : _d.innerText) + 1;
14734
14740
  nextR = prevR + expandThreshold - 1;
14735
14741
  } else {
14736
14742
  const prevLineNode = trNode.previousElementSibling;
@@ -14746,7 +14752,11 @@ function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpa
14746
14752
  updateExpandUpDownButton(trNode);
14747
14753
  }
14748
14754
  }
14755
+ if (isNaN(prevL) || isNaN(prevR) || isNaN(nextL) || isNaN(nextR)) {
14756
+ return false;
14757
+ }
14749
14758
  setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
14759
+ return true;
14750
14760
  }
14751
14761
  function getLineNumberFromDataset(expandDom, expandThreshold) {
14752
14762
  var _a, _b, _c;
@@ -14924,10 +14934,16 @@ function useCodeReviewExpand(reviewContentRef, props) {
14924
14934
  }
14925
14935
  }
14926
14936
  const loadMoreLine = trNodes[0].cloneNode(true);
14927
- loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
14937
+ if (loadMoreLine.children[0].children[0]) {
14938
+ loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
14939
+ }
14928
14940
  loadMoreLine.children[1].innerText = "";
14929
14941
  (_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
14930
- updateLineNumberInDatasetForDoubleColumn(loadMoreLine, expandThreshold.value, "bottom");
14942
+ const res = updateLineNumberInDatasetForDoubleColumn(loadMoreLine, expandThreshold.value, "bottom");
14943
+ if (!res) {
14944
+ loadMoreLine.remove();
14945
+ return;
14946
+ }
14931
14947
  attachExpandUpDownButton(loadMoreLine.children[0], "down");
14932
14948
  };
14933
14949
  const insertIncrementCodeForDoubleColumn = (code, direction, referenceDom) => {
@@ -14939,7 +14955,7 @@ function useCodeReviewExpand(reviewContentRef, props) {
14939
14955
  }
14940
14956
  const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
14941
14957
  const container = document.createElement("div");
14942
- parseDiffCode(container, prefix + code, outputFormat.value);
14958
+ parseDiffCode(container, prefix + code, outputFormat.value, true);
14943
14959
  const trNodes = Array.from(container.querySelectorAll("tr"));
14944
14960
  const expandLine = trNodes.find((element) => {
14945
14961
  var _a;
@@ -15001,10 +15017,16 @@ function useCodeReviewExpand(reviewContentRef, props) {
15001
15017
  }
15002
15018
  }
15003
15019
  const loadMoreLine = trNodes[0].cloneNode(true);
15004
- loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
15020
+ if (loadMoreLine.children[0].children[0]) {
15021
+ loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
15022
+ }
15005
15023
  loadMoreLine.children[1].innerText = "";
15006
15024
  (_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
15007
- updateLineNumberInDataset(loadMoreLine, expandThreshold.value, "bottom");
15025
+ const res = updateLineNumberInDataset(loadMoreLine, expandThreshold.value, "bottom");
15026
+ if (!res) {
15027
+ loadMoreLine.remove();
15028
+ return;
15029
+ }
15008
15030
  attachExpandUpDownButton(loadMoreLine.children[0], "down");
15009
15031
  };
15010
15032
  const insertIncrementCode = (code, direction, referenceDom) => {
@@ -15016,7 +15038,7 @@ function useCodeReviewExpand(reviewContentRef, props) {
15016
15038
  }
15017
15039
  const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
15018
15040
  const container = document.createElement("div");
15019
- parseDiffCode(container, prefix + code, outputFormat.value);
15041
+ parseDiffCode(container, prefix + code, outputFormat.value, true);
15020
15042
  const trNodes = Array.from(container.querySelectorAll("tr"));
15021
15043
  const expandLine = trNodes.find((element) => {
15022
15044
  var _a;
@@ -23429,6 +23451,7 @@ function useInputEvent(inputRef, props, states, ctx2) {
23429
23451
  };
23430
23452
  const handleInputChange = () => {
23431
23453
  states.query = states.inputValue;
23454
+ ctx2.emit("inputChange", states.query);
23432
23455
  handleQueryChange(states.query);
23433
23456
  };
23434
23457
  const debouncedOnInputChange = lodash.exports.debounce(handleInputChange, delay.value);
@@ -23487,7 +23510,7 @@ function _isSlot$8(s) {
23487
23510
  var EditableSelect = defineComponent({
23488
23511
  name: "DEditableSelect",
23489
23512
  props: editableSelectProps,
23490
- emits: ["update:modelValue", "focus", "blur", "clear", "change", "visibleChange", "loadMore"],
23513
+ emits: ["update:modelValue", "focus", "blur", "clear", "change", "visibleChange", "loadMore", "inputChange"],
23491
23514
  setup(props, ctx2) {
23492
23515
  const ns2 = useNamespace$1("editable-select");
23493
23516
  const inputRef = ref();
@@ -25945,9 +25968,11 @@ var Tooltip = defineComponent({
25945
25968
  onMouseenterOverlay
25946
25969
  } = useTooltip(origin, props);
25947
25970
  const ns2 = useNamespace$1("tooltip");
25948
- const className2 = computed(() => {
25949
- return [ns2.b(), ns2.m(placement.value)].join(" ");
25950
- });
25971
+ const className2 = computed(() => ({
25972
+ [ns2.b()]: true,
25973
+ [ns2.m(placement.value)]: true,
25974
+ [ns2.m("with-content")]: slots.content
25975
+ }));
25951
25976
  provide(POPPER_TRIGGER_TOKEN, origin);
25952
25977
  return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
25953
25978
  default: () => {
@@ -25974,9 +25999,12 @@ var Tooltip = defineComponent({
25974
25999
  "onMouseenter": onMouseenterOverlay,
25975
26000
  "onMouseleave": onMouseleave
25976
26001
  }, {
25977
- default: () => [createVNode("span", {
25978
- "innerHTML": content2.value
25979
- }, null)]
26002
+ default: () => {
26003
+ var _a;
26004
+ return [slots.content ? (_a = slots.content) == null ? void 0 : _a.call(slots) : createVNode("span", {
26005
+ "innerHTML": content2.value
26006
+ }, null)];
26007
+ }
25980
26008
  })]
25981
26009
  })]
25982
26010
  })]);
@@ -30350,6 +30378,10 @@ const menuProps = {
30350
30378
  router: {
30351
30379
  type: Boolean,
30352
30380
  default: false
30381
+ },
30382
+ disableOverflowStyle: {
30383
+ type: Boolean,
30384
+ default: false
30353
30385
  }
30354
30386
  };
30355
30387
  var menu = "";
@@ -30443,7 +30475,7 @@ var Menu = defineComponent({
30443
30475
  const container = overflowContainerElement.children[1];
30444
30476
  const ob = new IntersectionObserver((entries) => {
30445
30477
  entries.forEach((entry) => {
30446
- if (!entry.isIntersecting) {
30478
+ if (!entry.isIntersecting && !props.disableOverflowStyle) {
30447
30479
  const cloneNode = entry.target.cloneNode(true);
30448
30480
  if (entry.target.classList.contains(`${ns2.b()}-overflow-container`)) {
30449
30481
  if (flag && entry.target.previousElementSibling && container.children.length) {
@@ -30514,7 +30546,7 @@ var Menu = defineComponent({
30514
30546
  "key": "overflowContainer",
30515
30547
  "title": "...",
30516
30548
  "class": overflowContainerClassName
30517
- }, null), [[vShow, overflowItemLength.value > 0 && mode.value === "horizontal"]])]);
30549
+ }, null), [[vShow, overflowItemLength.value > 0 && mode.value === "horizontal" && !props.disableOverflowStyle]])]);
30518
30550
  };
30519
30551
  }
30520
30552
  });
@@ -31899,6 +31931,7 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31899
31931
  };
31900
31932
  const queryChange = (query) => {
31901
31933
  filterQuery.value = query;
31934
+ ctx2.emit("input-change", query);
31902
31935
  };
31903
31936
  const isLoading = computed(() => typeof props.loading === "boolean" && props.loading);
31904
31937
  const debounceTime = computed(() => props.remote ? 300 : 0);
@@ -32563,7 +32596,7 @@ var select = "";
32563
32596
  var Select = defineComponent({
32564
32597
  name: "DSelect",
32565
32598
  props: selectProps,
32566
- emits: ["toggle-change", "value-change", "update:modelValue", "focus", "blur", "remove-tag", "clear"],
32599
+ emits: ["toggle-change", "value-change", "update:modelValue", "focus", "blur", "remove-tag", "clear", "input-change"],
32567
32600
  setup(props, ctx2) {
32568
32601
  const app = getCurrentInstance();
32569
32602
  const t = createI18nTranslate("DSelect", app);
@@ -44030,7 +44063,7 @@ const installs = [
44030
44063
  VirtualListInstall
44031
44064
  ];
44032
44065
  var vueDevui = {
44033
- version: "1.5.14",
44066
+ version: "1.5.15-feat.1",
44034
44067
  install(app) {
44035
44068
  installs.forEach((p) => app.use(p));
44036
44069
  }