|
@@ -15,11 +15,11 @@ import {hintRef} from "../../hint/extend";
|
|
|
|
|
|
const renderCellURL = (urlContent: string) => {
|
|
const renderCellURL = (urlContent: string) => {
|
|
let host = urlContent;
|
|
let host = urlContent;
|
|
- let suffix = ""
|
|
|
|
|
|
+ let suffix = "";
|
|
try {
|
|
try {
|
|
const urlObj = new URL(urlContent);
|
|
const urlObj = new URL(urlContent);
|
|
host = urlObj.host;
|
|
host = urlObj.host;
|
|
- suffix = urlObj.href.replace(urlObj.origin, "")
|
|
|
|
|
|
+ suffix = urlObj.href.replace(urlObj.origin, "");
|
|
if (suffix.length > 12) {
|
|
if (suffix.length > 12) {
|
|
suffix = suffix.substring(0, 4) + "..." + suffix.substring(suffix.length - 6);
|
|
suffix = suffix.substring(0, 4) + "..." + suffix.substring(suffix.length - 6);
|
|
}
|
|
}
|
|
@@ -404,9 +404,9 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type
|
|
addDragFill(cellElements[0]);
|
|
addDragFill(cellElements[0]);
|
|
let textPlain = inputElement.value;
|
|
let textPlain = inputElement.value;
|
|
if (isDynamicRef(textPlain)) {
|
|
if (isDynamicRef(textPlain)) {
|
|
- textPlain = textPlain.substring(2, 22 + 2)
|
|
|
|
|
|
+ textPlain = textPlain.substring(2, 22 + 2);
|
|
} else {
|
|
} else {
|
|
- textPlain = textPlain.substring(2)
|
|
|
|
|
|
+ textPlain = textPlain.substring(2);
|
|
}
|
|
}
|
|
hintRef(textPlain, protyle, "av");
|
|
hintRef(textPlain, protyle, "av");
|
|
avMaskElement?.remove();
|
|
avMaskElement?.remove();
|
|
@@ -630,7 +630,7 @@ export const renderCell = (cellValue: IAVCellValue) => {
|
|
} else if (["email", "phone"].includes(cellValue.type)) {
|
|
} else if (["email", "phone"].includes(cellValue.type)) {
|
|
text = `<span class="av__celltext av__celltext--url" data-type="${cellValue.type}">${cellValue ? cellValue[cellValue.type as "email"].content : ""}</span>`;
|
|
text = `<span class="av__celltext av__celltext--url" data-type="${cellValue.type}">${cellValue ? cellValue[cellValue.type as "email"].content : ""}</span>`;
|
|
} else if ("url" === cellValue.type) {
|
|
} else if ("url" === cellValue.type) {
|
|
- text = renderCellURL(cellValue?.url?.content || "")
|
|
|
|
|
|
+ text = renderCellURL(cellValue?.url?.content || "");
|
|
} else if (cellValue.type === "block") {
|
|
} else if (cellValue.type === "block") {
|
|
if (cellValue?.isDetached) {
|
|
if (cellValue?.isDetached) {
|
|
text = `<span class="av__celltext">${cellValue.block.content || ""}</span>
|
|
text = `<span class="av__celltext">${cellValue.block.content || ""}</span>
|
|
@@ -709,7 +709,7 @@ const renderRollup = (cellValue: IAVCellValue) => {
|
|
text = `<span class="av__celltext av__celltext--url" data-type="${cellValue.type}">${emailContent}</span>`;
|
|
text = `<span class="av__celltext av__celltext--url" data-type="${cellValue.type}">${emailContent}</span>`;
|
|
}
|
|
}
|
|
} else if ("url" === cellValue.type) {
|
|
} else if ("url" === cellValue.type) {
|
|
- const urlContent = cellValue?.url?.content || ""
|
|
|
|
|
|
+ const urlContent = cellValue?.url?.content || "";
|
|
if (urlContent) {
|
|
if (urlContent) {
|
|
text = renderCellURL(urlContent);
|
|
text = renderCellURL(urlContent);
|
|
}
|
|
}
|