1import { _ as p, d as m, B as d } from "./main-BueDL5c3.js"; 2import { d as u } from "./displayerStatesMixin-BlpS49gT.js"; 3import { resolveComponent as y, createBlock as h, openBlock as r, withCtx as s, createElementBlock as l, normalizeClass as c } from "vue"; 4const f = { 5 computed: { 6 htmlValue() { 7 const e = document.createElement("div"); 8 return e[this.config.html ? "innerHTML" : "textContent"] = this.value, [...e.querySelectorAll("a, button, details, embed, iframe, keygen, label, select, textarea, audio[controls],img[usemap], input, menu[type=toolbar], object[usemap], video[controls]")].forEach( 9 (n) => n.parentNode.removeChild(n) 10 ), e.innerHTML.trim(); 11 } 12 } 13}, v = { 14 name: "displayer-link", 15 components: { 16 BaseDisplayer: d 17 }, 18 // Add the displayerMixin to get access to all the displayers methods and computed properties inside this component 19 mixins: [m, f, u], 20 props: { 21 // An optional html to use instead of the computed htmlValue when displaying the inner html of the link. 22 html: { 23 optional: !0 24 } 25 }, 26 computed: { 27 // The link href taken from the propertyHref property of the entry 28 href() { 29 let e = this.config.propertyHref; 30 return typeof e == "string" ? e = [e] : Array.isArray(e) || (e = []), e.map((t) => this.entry[t]).find((t) => t) || "#"; 31 }, 32 linkContent() { 33 return this.hasViewRight ? this.html ? this.html : this.htmlValue || this.$t("livedata.displayer.link.noValue") : this.$t("livedata.displayer.emptyValue"); 34 }, 35 hasViewRight() { 36 return this.logic.isActionAllowed("view", this.entry); 37 } 38 } 39}, k = ["href", "innerHTML"], g = ["innerHTML"]; 40function w(e, t, n, V, M, i) { 41 const a = y("BaseDisplayer"); 42 return r(), h(a, { 43 class: "displayer-link", 44 "property-id": e.propertyId, 45 entry: e.entry, 46 "is-view": e.isView, 47 "onUpdate:isView": t[0] || (t[0] = (o) => e.isView = o), 48 "is-empty": !1, 49 onSaveEdit: e.genericSave 50 }, { 51 viewer: s(() => [ 52 i.linkContent && i.hasViewRight ? (r(), l("a", { 53 key: 0, 54 href: e.sanitizeUrl(i.href), 55 class: c({ "explicit-empty-value": !n.html && !e.htmlValue }), 56 innerHTML: e.sanitizeHtml(i.linkContent) 57 }, null, 10, k)) : (r(), l("span", { 58 key: 1, 59 innerHTML: e.sanitizeHtml(i.linkContent) 60 }, null, 8, g)) 61 ]), 62 editor: s(() => [...t[1] || (t[1] = [])]), 63 _: 1 64 }, 8, ["property-id", "entry", "is-view", "onSaveEdit"]); 65} 66const C = /* @__PURE__ */ p(v, [["render", w]]), B = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 67 __proto__: null, 68 default: C 69}, Symbol.toStringTag, { value: "Module" })); 70export { 71 C as D, 72 B as a, 73 f as d 74}; 75//# sourceMappingURL=DisplayerLink-DzP8NoSc.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.