@arkitektum/altinn-studio-custom-components 1.0.2 → 1.1.0
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/dist/main.js +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var
|
|
1
|
+
(()=>{"use strict";var t={420:(t,e,s)=>{var n=s(967);customElements.define("custom-field-adresse",class extends HTMLElement{formatAdresselinje(t){return[t.adresselinje1,t.adresselinje2,t.adresselinje3].filter((t=>t?.length)).join("\n")}formatZipCity(t){return[t.postnr,t.poststed].filter((t=>t?.length)).join(" ")}formatAdresse(t){const e=this.formatAdresselinje(t),s=this.formatZipCity(t);return e?.length?`${e}\n${s}`:s}connectedCallback(){const t="true"===this.getAttribute("hideIfEmpty"),e="true"===this.getAttribute("hideTitle"),s=this.getAttribute("emptyFieldText"),i=JSON.parse(this.getAttribute("formdata")),r=JSON.parse(this.getAttribute("styleoverride")),a=!e&&this.getAttribute("text");if(t&&!(0,n.Rj)(i.data))this.style.display="none";else{const t=this.formatAdresse(i.data);this.innerHTML=(0,n.Px)(a,t?.length?t:s,!0,r)}}})},892:(t,e,s)=>{var n=s(967);customElements.define("custom-field-ansvarlig-soeker",class extends HTMLElement{formatName(t){let e=t?.navn||"";return e+=t?.organisasjonsnummer?.length?`\n Organisasjonsnummer: ${t.organisasjonsnummer}`:"",e}connectedCallback(){const t="true"===this.getAttribute("hideIfEmpty"),e="true"===this.getAttribute("hideTitle"),s=this.getAttribute("emptyFieldText"),i=JSON.parse(this.getAttribute("formdata")),r=JSON.parse(this.getAttribute("styleoverride")),a=!e&&this.getAttribute("text");if(t&&!(0,n.Rj)(i.data))this.style.display="none";else{const t=this.formatName(i.data);this.innerHTML=(0,n.Px)(a,t?.length?t:s,!0,r)}}})},423:(t,e,s)=>{var n=s(967);customElements.define("custom-field-data",class extends HTMLElement{connectedCallback(){const t="true"===this.getAttribute("hideIfEmpty"),e="true"===this.getAttribute("hideTitle"),s=this.getAttribute("emptyFieldText"),i=JSON.parse(this.getAttribute("formdata")),r=!e&&this.getAttribute("text"),a=i?.simpleBinding?.length?i.simpleBinding:s;t&&!(0,n.Rj)(i.simpleBinding)?this.style.display="none":this.innerHTML=(0,n.Px)(r,a)}})},389:(t,e,s)=>{var n=s(967);customElements.define("custom-field-kommunens-saksnummer",class extends HTMLElement{formatKommunensSaksnummer(t){return[t?.saksaar.toString(),t?.sakssekvensnummer.toString()].filter((t=>t?.length)).join("/")}connectedCallback(){const t="true"===this.getAttribute("hideIfEmpty"),e="true"===this.getAttribute("hideTitle"),s=this.getAttribute("emptyFieldText"),i=JSON.parse(this.getAttribute("formdata")),r=!e&&this.getAttribute("text");if(t&&!(0,n.Rj)(i.data))this.style.display="none";else{const t=this.formatKommunensSaksnummer(i.data);this.innerHTML=(0,n.Px)(r,t?.length?t:s)}}})},541:(t,e,s)=>{var n=s(967);customElements.define("custom-field-prosjekt",class extends HTMLElement{formatProsjekt(t){const e=t?.prosjektnr?.length&&`(${t.prosjektnr})`;return[t?.prosjektnavn,e].filter((t=>t?.length)).join(" ")}connectedCallback(){const t="true"===this.getAttribute("hideIfEmpty"),e="true"===this.getAttribute("hideTitle"),s=this.getAttribute("emptyFieldText"),i=JSON.parse(this.getAttribute("formdata")),r=!e&&this.getAttribute("text"),a={prosjektnavn:i.data.prosjektnavn,prosjektnr:i.data.prosjektnr};if(t&&!(0,n.Rj)(a))this.style.display="none";else{const t=this.formatProsjekt(a);this.innerHTML=(0,n.Px)(r,t?.length?t:s)}}})},674:(t,e,s)=>{var n=s(967);customElements.define("custom-field-telefonnummer",class extends HTMLElement{formatPhoneNumbers(t){return[t.telefonnummer,t.mobilnummer].filter((t=>t?.length)).join("\n")}connectedCallback(){const t="true"===this.getAttribute("hideIfEmpty"),e="true"===this.getAttribute("hideTitle"),s=this.getAttribute("emptyFieldText"),i=JSON.parse(this.getAttribute("formdata")),r=!e&&this.getAttribute("text");if(t&&!(0,n.Rj)(i.data))this.style.display="none";else{const t=this.formatPhoneNumbers(i.data);this.innerHTML=(0,n.Px)(r,t?.length?t:s)}}})},917:(t,e,s)=>{var n=s(967);customElements.define("custom-field-utfall-svar-status",class extends HTMLElement{getStatusText(t){return t?.erUtfallBesvaresSenere?"Besvares senere":t?.erUtfallBesvart?"Svar innsendt tidligere":"Besvares nå"}connectedCallback(){const t="true"===this.getAttribute("hideTitle"),e=JSON.parse(this.getAttribute("formdata")),s=!t&&this.getAttribute("text"),i=this.getStatusText(e?.data);this.innerHTML=(0,n.Px)(s,i)}})},203:(t,e,s)=>{var n=s(967);customElements.define("custom-list-data",class extends HTMLElement{getListItemsFromKey(t,e){return t.map((t=>t?.[e]))}connectedCallback(){const t="true"===this.getAttribute("hideIfEmpty"),e="true"===this.getAttribute("hideTitle"),s=this.getAttribute("emptyFieldText"),i=JSON.parse(this.getAttribute("formdata")),r=!e&&this.getAttribute("text"),a=this.getAttribute("itemKey"),l=a?.length?this.getListItemsFromKey(i?.data,a):i?.data;t&&!(0,n.Rj)(l)?this.style.display="none":this.innerHTML=s?.length&&!l?.length?(0,n.Px)(r,s):r?.length?(0,n.RU)(r,l):(0,n.h3)(l)}})},791:(t,e,s)=>{var n=s(967);customElements.define("custom-list-vedlegg",class extends HTMLElement{getAttachmentDescription(t){return t?.vedleggstype?.kodebeskrivelse}getAttachmentFileName(t){return t?.filnavn}getAttachmentListItems(t){return t?.length&&t.map((t=>{const e=this.getAttachmentDescription(t),s=this.getAttachmentFileName(t);return e?.length&&s?.length?`${e} (${s})`:e?.length?e:s?.length?s:null})).filter((t=>t))}connectedCallback(){const t="true"===this.getAttribute("hideIfEmpty"),e="true"===this.getAttribute("hideTitle"),s=this.getAttribute("emptyFieldText"),i=JSON.parse(this.getAttribute("formdata")),r=!e&&this.getAttribute("text"),a=this.getAttachmentListItems(i?.data);t&&!(0,n.Rj)(a)?this.style.display="none":this.innerHTML=s?.length&&!a?.length?(0,n.Px)(r,s):r?.length?(0,n.RU)(r,a):(0,n.h3)(a)}})},967:(t,e,s)=>{function n(t){for(let e in t)return!!t?.[e]?.toString().length>0;return!1}function i(t,e){for(let s in e)t.style[s]=e[s]}function r(t){const e=document.createElement("label");e.classList.add("fds-label","fds-label--md");const s=document.createElement("span");return s.innerHTML=t,e.appendChild(s),e}function a(t,e,s=!0,n){const a=document.createElement("div");return a.classList.add("field"),t?.length&&a.appendChild(r(t)),a.appendChild(function(t){const e=document.createElement("span");return e.classList.add("fds-paragraph","fds-paragraph--md"),e.innerHTML=t,i(e,{whiteSpace:"pre-line"}),e}(e)),i(a,{...n,display:"flex",flexDirection:"column"}),s?a.outerHTML:a}function l(t,e,s=!0){const n=document.createElement(e||"ul");return n.classList.add("fds-paragraph","fds-paragraph--md","fds-list","fds-list--md"),t.forEach((t=>{const e=document.createElement("li");e.innerHTML=t,n.appendChild(e)})),s?n.outerHTML:n}function d(t,e,s){const n=document.createElement("div");return n.classList.add("field"),t?.length&&n.appendChild(r(t)),n.appendChild(l(e,s,!1)),i(n,{display:"flex",flexDirection:"column"}),n.outerHTML}s.d(e,{Px:()=>a,RU:()=>d,Rj:()=>n,h3:()=>l})}},e={};function s(n){var i=e[n];if(void 0!==i)return i.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,s),r.exports}s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s(967),s(420),s(892),s(423),s(389),s(541),s(674),s(917),s(203),s(791)})();
|