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.
- package/code-review/index.es.js +36 -14
- package/code-review/index.umd.js +14 -14
- package/editor-md/index.es.js +11 -6
- package/editor-md/index.umd.js +8 -8
- package/editor-md/style.css +1 -1
- package/menu/index.es.js +6 -2
- package/menu/index.umd.js +1 -1
- package/package.json +1 -1
- package/splitter/index.es.js +11 -6
- package/splitter/index.umd.js +4 -4
- package/splitter/style.css +1 -1
- package/style.css +1 -1
- package/table/index.es.js +11 -6
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tooltip/index.es.js +11 -6
- package/tooltip/index.umd.js +9 -9
- package/tooltip/style.css +1 -1
- package/types/code-review/src/utils.d.ts +3 -3
- package/types/menu/src/menu-types.d.ts +4 -0
- package/types/menu/src/menu.d.ts +9 -0
- package/vue-devui.es.js +52 -21
- package/vue-devui.umd.js +31 -31
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
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -25945,9 +25967,11 @@ var Tooltip = defineComponent({
|
|
|
25945
25967
|
onMouseenterOverlay
|
|
25946
25968
|
} = useTooltip(origin, props);
|
|
25947
25969
|
const ns2 = useNamespace$1("tooltip");
|
|
25948
|
-
const className2 = computed(() => {
|
|
25949
|
-
|
|
25950
|
-
|
|
25970
|
+
const className2 = computed(() => ({
|
|
25971
|
+
[ns2.b()]: true,
|
|
25972
|
+
[ns2.m(placement.value)]: true,
|
|
25973
|
+
[ns2.m("with-content")]: slots.content
|
|
25974
|
+
}));
|
|
25951
25975
|
provide(POPPER_TRIGGER_TOKEN, origin);
|
|
25952
25976
|
return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
|
|
25953
25977
|
default: () => {
|
|
@@ -25974,9 +25998,12 @@ var Tooltip = defineComponent({
|
|
|
25974
25998
|
"onMouseenter": onMouseenterOverlay,
|
|
25975
25999
|
"onMouseleave": onMouseleave
|
|
25976
26000
|
}, {
|
|
25977
|
-
default: () =>
|
|
25978
|
-
|
|
25979
|
-
|
|
26001
|
+
default: () => {
|
|
26002
|
+
var _a;
|
|
26003
|
+
return [slots.content ? (_a = slots.content) == null ? void 0 : _a.call(slots) : createVNode("span", {
|
|
26004
|
+
"innerHTML": content2.value
|
|
26005
|
+
}, null)];
|
|
26006
|
+
}
|
|
25980
26007
|
})]
|
|
25981
26008
|
})]
|
|
25982
26009
|
})]);
|
|
@@ -30350,6 +30377,10 @@ const menuProps = {
|
|
|
30350
30377
|
router: {
|
|
30351
30378
|
type: Boolean,
|
|
30352
30379
|
default: false
|
|
30380
|
+
},
|
|
30381
|
+
disableOverflowStyle: {
|
|
30382
|
+
type: Boolean,
|
|
30383
|
+
default: false
|
|
30353
30384
|
}
|
|
30354
30385
|
};
|
|
30355
30386
|
var menu = "";
|
|
@@ -30443,7 +30474,7 @@ var Menu = defineComponent({
|
|
|
30443
30474
|
const container = overflowContainerElement.children[1];
|
|
30444
30475
|
const ob = new IntersectionObserver((entries) => {
|
|
30445
30476
|
entries.forEach((entry) => {
|
|
30446
|
-
if (!entry.isIntersecting) {
|
|
30477
|
+
if (!entry.isIntersecting && !props.disableOverflowStyle) {
|
|
30447
30478
|
const cloneNode = entry.target.cloneNode(true);
|
|
30448
30479
|
if (entry.target.classList.contains(`${ns2.b()}-overflow-container`)) {
|
|
30449
30480
|
if (flag && entry.target.previousElementSibling && container.children.length) {
|
|
@@ -30514,7 +30545,7 @@ var Menu = defineComponent({
|
|
|
30514
30545
|
"key": "overflowContainer",
|
|
30515
30546
|
"title": "...",
|
|
30516
30547
|
"class": overflowContainerClassName
|
|
30517
|
-
}, null), [[vShow, overflowItemLength.value > 0 && mode.value === "horizontal"]])]);
|
|
30548
|
+
}, null), [[vShow, overflowItemLength.value > 0 && mode.value === "horizontal" && !props.disableOverflowStyle]])]);
|
|
30518
30549
|
};
|
|
30519
30550
|
}
|
|
30520
30551
|
});
|
|
@@ -44030,7 +44061,7 @@ const installs = [
|
|
|
44030
44061
|
VirtualListInstall
|
|
44031
44062
|
];
|
|
44032
44063
|
var vueDevui = {
|
|
44033
|
-
version: "1.5.
|
|
44064
|
+
version: "1.5.15",
|
|
44034
44065
|
install(app) {
|
|
44035
44066
|
installs.forEach((p) => app.use(p));
|
|
44036
44067
|
}
|