@mattilsynet/design 3.3.5 → 3.3.6
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/mtds/ai/print.stories.tsx +45 -1
- package/mtds/app/app-observer.js +1 -1
- package/mtds/app/app-toggle.js +10 -26
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +26 -10
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.js +1 -1
- package/mtds/atlas/atlas-element.js +1 -1
- package/mtds/index.iife.js +1 -1
- package/mtds/package.json.js +1 -1
- package/mtds/print/print.stories.d.ts +1 -0
- package/mtds/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { CodeIcon, PrinterIcon } from "@phosphor-icons/react";
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
Grid,
|
|
6
|
+
Heading,
|
|
7
|
+
Ingress,
|
|
8
|
+
Muted,
|
|
9
|
+
Print,
|
|
10
|
+
Prose,
|
|
11
|
+
Table,
|
|
12
|
+
} from "../react";
|
|
4
13
|
import styles from "../styles.module.css";
|
|
5
14
|
import css from "../styles.module.css?inline";
|
|
6
15
|
|
|
@@ -837,3 +846,38 @@ export const Vedtak: Story = {
|
|
|
837
846
|
</div>
|
|
838
847
|
),
|
|
839
848
|
};
|
|
849
|
+
|
|
850
|
+
export const Overskrifter: Story = {
|
|
851
|
+
render: () => (
|
|
852
|
+
<div id="my-print">
|
|
853
|
+
<style>
|
|
854
|
+
{`${css}:root {
|
|
855
|
+
--mtdsc-print-office: 'hovedkontoret';
|
|
856
|
+
--mtdsc-print-department: 'avdeling brukerdialog og kommunikasjon';
|
|
857
|
+
}`}
|
|
858
|
+
</style>
|
|
859
|
+
<Print as={Prose}>
|
|
860
|
+
<Heading data-size="2xl">Heading data-size="2xl"</Heading>
|
|
861
|
+
<p>Text</p>
|
|
862
|
+
<Heading data-size="xl">Heading data-size="xl"</Heading>
|
|
863
|
+
<p>Text</p>
|
|
864
|
+
<Heading data-size="lg">Heading data-size="lg"</Heading>
|
|
865
|
+
<p>Text</p>
|
|
866
|
+
<Heading data-size="md">Heading data-size="md"</Heading>
|
|
867
|
+
<p>Text</p>
|
|
868
|
+
<Heading data-size="sm">Heading data-size="sm"</Heading>
|
|
869
|
+
<p>Text</p>
|
|
870
|
+
<Heading data-size="xs">Heading data-size="xs"</Heading>
|
|
871
|
+
<p>Text</p>
|
|
872
|
+
<Heading data-size="2xs">Heading data-size="2xs"</Heading>
|
|
873
|
+
<p>Text</p>
|
|
874
|
+
<p>
|
|
875
|
+
<Ingress>Ingress</Ingress>
|
|
876
|
+
</p>
|
|
877
|
+
<p>
|
|
878
|
+
<Muted>Muted</Muted>
|
|
879
|
+
</p>
|
|
880
|
+
</Print>
|
|
881
|
+
</div>
|
|
882
|
+
),
|
|
883
|
+
};
|
package/mtds/app/app-observer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import P from "../styles.module.css.js";
|
|
2
2
|
import { getByCSSModule as _, onHotReload as h, on as r, QUICK_EVENT as m, debounce as E } from "../utils.js";
|
|
3
|
-
import "./app-
|
|
3
|
+
import "./app-toggle.js";
|
|
4
4
|
const y = P.app.split(" ")[0], I = `[data-command="toggle-app-expanded"],.${y} > [command="show-modal"]`, u = `.${y} > dialog,.${y} dialog ~ main`, S = _("sticky"), w = (t) => {
|
|
5
5
|
document.startViewTransition ? document.startViewTransition(t) : t();
|
|
6
6
|
}, x = (t) => (
|
package/mtds/app/app-toggle.js
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
document.adoptedStyleSheets.push(sheet);
|
|
12
|
-
window.mtdsToggleAppExpanded = (force) => {
|
|
13
|
-
try {
|
|
14
|
-
const next = force ?? !prev();
|
|
15
|
-
sheet.replaceSync?.(\`:root { \${key}: var(\${key}--\${next})}\`);
|
|
16
|
-
window.localStorage.setItem(key, next);
|
|
17
|
-
} catch (_err) {} // localStorage is full or replaceSync is not supported
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// Set and store initial state
|
|
21
|
-
window.mtdsToggleAppExpanded(prev());
|
|
22
|
-
})();
|
|
23
|
-
`;
|
|
24
|
-
export {
|
|
25
|
-
t as default
|
|
26
|
-
};
|
|
1
|
+
typeof window < "u" && window.CSSStyleSheet && document.adoptedStyleSheets && (() => {
|
|
2
|
+
const e = "--mtds-app-expanded", d = new CSSStyleSheet(), o = () => !window.localStorage.getItem(e)?.includes("false");
|
|
3
|
+
document.adoptedStyleSheets.push(d), window.mtdsToggleAppExpanded = (n) => {
|
|
4
|
+
try {
|
|
5
|
+
const t = n ?? !o();
|
|
6
|
+
d.replaceSync?.(`:root { ${e}: var(${e}--${t})}`), window.localStorage.setItem(e, t);
|
|
7
|
+
} catch {
|
|
8
|
+
}
|
|
9
|
+
}, window.mtdsToggleAppExpanded(o());
|
|
10
|
+
})();
|
|
27
11
|
//# sourceMappingURL=app-toggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-toggle.js","sources":["../../designsystem/app/app-toggle.js
|
|
1
|
+
{"version":3,"file":"app-toggle.js","sources":["../../designsystem/app/app-toggle.js"],"sourcesContent":["if (\n\ttypeof window !== \"undefined\" &&\n\twindow.CSSStyleSheet &&\n\tdocument.adoptedStyleSheets\n)\n\t(() => {\n\t\tconst key = \"--mtds-app-expanded\";\n\t\tconst sheet = new CSSStyleSheet();\n\t\tconst prev = () => !window.localStorage.getItem(key)?.includes(\"false\");\n\n\t\tdocument.adoptedStyleSheets.push(sheet);\n\t\twindow.mtdsToggleAppExpanded = (force) => {\n\t\t\ttry {\n\t\t\t\tconst next = force ?? !prev();\n\t\t\t\tsheet.replaceSync?.(`:root { ${key}: var(${key}--${next})}`);\n\t\t\t\twindow.localStorage.setItem(key, next);\n\t\t\t} catch (_err) {} // localStorage is full or replaceSync is not supported\n\t\t};\n\n\t\t// Set and store initial state\n\t\twindow.mtdsToggleAppExpanded(prev());\n\t})();\n"],"names":["key","sheet","prev","force","next"],"mappings":"AACC,OAAO,SAAW,OAClB,OAAO,iBACP,SAAS,uBAER,MAAM;AACN,QAAMA,IAAM,uBACNC,IAAQ,IAAI,cAAa,GACzBC,IAAO,MAAM,CAAC,OAAO,aAAa,QAAQF,CAAG,GAAG,SAAS,OAAO;AAEtE,WAAS,mBAAmB,KAAKC,CAAK,GACtC,OAAO,wBAAwB,CAACE,MAAU;AACzC,QAAI;AACH,YAAMC,IAAOD,KAAS,CAACD,EAAI;AAC3B,MAAAD,EAAM,cAAc,WAAWD,CAAG,SAASA,CAAG,KAAKI,CAAI,IAAI,GAC3D,OAAO,aAAa,QAAQJ,GAAKI,CAAI;AAAA,IACtC,QAAe;AAAA,IAAC;AAAA,EACjB,GAGA,OAAO,sBAAsBF,GAAM;AACpC,GAAC;"}
|
package/mtds/app/app-toggle2.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
const t = `if (
|
|
2
|
+
typeof window !== "undefined" &&
|
|
3
|
+
window.CSSStyleSheet &&
|
|
4
|
+
document.adoptedStyleSheets
|
|
5
|
+
)
|
|
6
|
+
(() => {
|
|
7
|
+
const key = "--mtds-app-expanded";
|
|
8
|
+
const sheet = new CSSStyleSheet();
|
|
9
|
+
const prev = () => !window.localStorage.getItem(key)?.includes("false");
|
|
10
|
+
|
|
11
|
+
document.adoptedStyleSheets.push(sheet);
|
|
12
|
+
window.mtdsToggleAppExpanded = (force) => {
|
|
13
|
+
try {
|
|
14
|
+
const next = force ?? !prev();
|
|
15
|
+
sheet.replaceSync?.(\`:root { \${key}: var(\${key}--\${next})}\`);
|
|
16
|
+
window.localStorage.setItem(key, next);
|
|
17
|
+
} catch (_err) {} // localStorage is full or replaceSync is not supported
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Set and store initial state
|
|
21
|
+
window.mtdsToggleAppExpanded(prev());
|
|
22
|
+
})();
|
|
23
|
+
`;
|
|
24
|
+
export {
|
|
25
|
+
t as default
|
|
26
|
+
};
|
|
11
27
|
//# sourceMappingURL=app-toggle2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-toggle2.js","sources":["../../designsystem/app/app-toggle.js"],"sourcesContent":["if (
|
|
1
|
+
{"version":3,"file":"app-toggle2.js","sources":["../../designsystem/app/app-toggle.js?raw"],"sourcesContent":["export default \"if (\\n\\ttypeof window !== \\\"undefined\\\" &&\\n\\twindow.CSSStyleSheet &&\\n\\tdocument.adoptedStyleSheets\\n)\\n\\t(() => {\\n\\t\\tconst key = \\\"--mtds-app-expanded\\\";\\n\\t\\tconst sheet = new CSSStyleSheet();\\n\\t\\tconst prev = () => !window.localStorage.getItem(key)?.includes(\\\"false\\\");\\n\\n\\t\\tdocument.adoptedStyleSheets.push(sheet);\\n\\t\\twindow.mtdsToggleAppExpanded = (force) => {\\n\\t\\t\\ttry {\\n\\t\\t\\t\\tconst next = force ?? !prev();\\n\\t\\t\\t\\tsheet.replaceSync?.(`:root { ${key}: var(${key}--${next})}`);\\n\\t\\t\\t\\twindow.localStorage.setItem(key, next);\\n\\t\\t\\t} catch (_err) {} // localStorage is full or replaceSync is not supported\\n\\t\\t};\\n\\n\\t\\t// Set and store initial state\\n\\t\\twindow.mtdsToggleAppExpanded(prev());\\n\\t})();\\n\""],"names":["script"],"mappings":"AAAA,MAAAA,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
package/mtds/app/app.js
CHANGED
|
@@ -3,7 +3,7 @@ import a from "clsx";
|
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import { Button as m } from "../button/button.js";
|
|
5
5
|
import s from "../styles.module.css.js";
|
|
6
|
-
import d from "./app-
|
|
6
|
+
import d from "./app-toggle2.js";
|
|
7
7
|
const u = n(function({ as: r, className: t, ...p }, e) {
|
|
8
8
|
return /* @__PURE__ */ o(r || "div", { className: a(s.app, t), ref: e, ...p });
|
|
9
9
|
}), f = n(function({ as: r, className: t, ...p }, e) {
|
|
@@ -19,7 +19,7 @@ class r extends g {
|
|
|
19
19
|
}
|
|
20
20
|
constructor() {
|
|
21
21
|
super(), this.attachShadow({ mode: "open" }).append(m("figure")), C(this, `@layer leaflet{${h}}
|
|
22
|
-
@layer mt.v3-3-
|
|
22
|
+
@layer mt.v3-3-6design{${b}`);
|
|
23
23
|
}
|
|
24
24
|
connectedCallback() {
|
|
25
25
|
const t = this.shadowRoot?.lastElementChild, e = a(this, "data-cluster") ?? "false", o = new i.TileLayer(k, {
|
package/mtds/index.iife.js
CHANGED
|
@@ -20,7 +20,7 @@ Add a heading (h2–h6), or set aria-label or aria-labelledby to provide an acce
|
|
|
20
20
|
::slotted([slot="summary"])::before { content: ''; display: inline-block; vertical-align: middle; margin-inline: .05em .3125em; border-block: .3125em solid transparent; border-inline-start: .5em solid }
|
|
21
21
|
::slotted([slot="summary"][aria-expanded="true"])::before { rotate: 90deg }
|
|
22
22
|
:host > [part="details-content"]:not([hidden=""]) { display: block }`,Yc=Kc(Xn,'<slot name="summary"></slot><slot part="details-content" hidden="until-found"></slot>'),ur=class extends lr{static get observedAttributes(){return["open"]}constructor(){var t;super(),jc(this,Xn),(t=this.shadowRoot)==null||t.prepend(qe("slot",{name:"summary"}),qe("slot",{part:"details-content"})),console.warn(`\x1B[1m<u-details> is deprecated as <details> now has sufficient screen reader support 🎉\x1B[0m
|
|
23
|
-
Please use <details> and <summary>, but import '@u-elements/u-details/polyfill' to polyfill support for Talkback screen reader when used with Firefox on Android.`,this)}connectedCallback(){var t;this._content=(t=this.shadowRoot)==null?void 0:t.children[1],st(this,"role","group"),cr(this._content,"beforematch",this),cr(this,"click keydown",this),this.attributeChangedCallback()}disconnectedCallback(){this._content&&jn(this._content,"beforematch",this),jn(this,"click keydown",this),this._content=void 0}attributeChangedCallback(t,e,n){const o="onbeforematch"in this?"until-found":!0,i=this.open;for(const r of this.children)r.nodeName==="U-SUMMARY"&&st(r,"aria-expanded",`${i}`);if(this._content&&(st(this._content,"aria-hidden",`${!i}`),st(this._content,"tabindex",i?null:"-1"),this._content.hidden=i?!1:o),i&&this.name){const r=Xc(this).querySelectorAll(`${this.nodeName}[name="${this.name}"]`);for(const s of r)s!==this&&(s.open=!1)}t==="open"&&e===null!=(n===null)&&this.dispatchEvent(new Event("toggle"))}handleEvent(t){var e,n;const o=t.key===" "||t.key==="Enter",i=t.target instanceof Element&&((e=t.target.closest('[slot="summary"]'))==null?void 0:e.parentElement)===this;t.defaultPrevented||(t.type==="beforematch"&&(this.open=!0),i&&t.type==="click"&&(this.open=!this.open),i&&t.type==="keydown"&&o&&((n=t.preventDefault)==null||n.call(t),t.target.dispatchEvent(new MouseEvent("click",t))))}get open(){return this.hasAttribute("open")}set open(t){st(this,"open",t?"":null)}get name(){return st(this,"name")||""}set name(t){st(this,"name",t)}},fr=class extends lr{connectedCallback(){st(this,"role","button"),this.slot="summary",this.tabIndex=0}};dr.define("u-details",ur),dr.define("u-summary",fr);const Qc="3.3.
|
|
23
|
+
Please use <details> and <summary>, but import '@u-elements/u-details/polyfill' to polyfill support for Talkback screen reader when used with Firefox on Android.`,this)}connectedCallback(){var t;this._content=(t=this.shadowRoot)==null?void 0:t.children[1],st(this,"role","group"),cr(this._content,"beforematch",this),cr(this,"click keydown",this),this.attributeChangedCallback()}disconnectedCallback(){this._content&&jn(this._content,"beforematch",this),jn(this,"click keydown",this),this._content=void 0}attributeChangedCallback(t,e,n){const o="onbeforematch"in this?"until-found":!0,i=this.open;for(const r of this.children)r.nodeName==="U-SUMMARY"&&st(r,"aria-expanded",`${i}`);if(this._content&&(st(this._content,"aria-hidden",`${!i}`),st(this._content,"tabindex",i?null:"-1"),this._content.hidden=i?!1:o),i&&this.name){const r=Xc(this).querySelectorAll(`${this.nodeName}[name="${this.name}"]`);for(const s of r)s!==this&&(s.open=!1)}t==="open"&&e===null!=(n===null)&&this.dispatchEvent(new Event("toggle"))}handleEvent(t){var e,n;const o=t.key===" "||t.key==="Enter",i=t.target instanceof Element&&((e=t.target.closest('[slot="summary"]'))==null?void 0:e.parentElement)===this;t.defaultPrevented||(t.type==="beforematch"&&(this.open=!0),i&&t.type==="click"&&(this.open=!this.open),i&&t.type==="keydown"&&o&&((n=t.preventDefault)==null||n.call(t),t.target.dispatchEvent(new MouseEvent("click",t))))}get open(){return this.hasAttribute("open")}set open(t){st(this,"open",t?"":null)}get name(){return st(this,"name")||""}set name(t){st(this,"name",t)}},fr=class extends lr{connectedCallback(){st(this,"role","button"),this.slot="summary",this.tabIndex=0}};dr.define("u-details",ur),dr.define("u-summary",fr);const Qc="3.3.6",mr="_alert_14zqc_1 _ds-alert_o04yn_1",pr="_app_14zqc_1",hr="_sticky_14zqc_1",gr="_avatar_14zqc_1 _ds-avatar_o04yn_1",br="_badge_14zqc_1",vr="_breadcrumbs_14zqc_1 _ds-breadcrumbs_o04yn_3",yr="_button_14zqc_1 _ds-button_o04yn_1",wr="_card_14zqc_1",_r="_group_14zqc_1",Sr="_chip_14zqc_1 _ds-chip_o04yn_3",xr="_details_14zqc_1 _ds-details_o04yn_1",Er="_dialog_14zqc_1 _ds-dialog_o04yn_3",$r="__drawer_14zqc_1",Cr="_divider_14zqc_1",Ar="_errorsummary_14zqc_1 _ds-error-summary_o04yn_3",Tr="_field_14zqc_1 _ds-field_o04yn_1",kr="_suggestion_14zqc_1 _ds-suggestion_o04yn_3",Lr="_affixes_14zqc_1 _ds-field-affixes_o04yn_1",Rr="_fieldset_14zqc_1 _ds-fieldset_o04yn_1",Ir="_fileupload_14zqc_1",Or="_helptext_14zqc_1 _ds-focus_o04yn_1",Mr="_input_14zqc_1 _ds-input_o04yn_1",Dr="_law_14zqc_1",Pr="_grid_14zqc_1",Nr="_flex_14zqc_1",Hr="_link_14zqc_1",qr="_logo_14zqc_1",Br="__logo_14zqc_1",Ur="_pagination_14zqc_1 _ds-pagination_o04yn_3",zr="_popover_14zqc_1 _ds-popover_o04yn_1",Fr="_print_14zqc_1",Wr="_progress_14zqc_1",Vr="__indeterminate_14zqc_1",Gr="_skeleton_14zqc_1 _ds-skeleton_o04yn_3",jr="__skeleton_14zqc_1",Xr="_spinner_14zqc_1",Kr="_steps_14zqc_1",Yr="_table_14zqc_1 _ds-table_o04yn_3",Qr="__scrollShadow_14zqc_1",Zr="_tabs_14zqc_1 _ds-tabs_o04yn_3",Jr="__scrollMask_14zqc_1",ts="_tag_14zqc_1 _ds-tag_o04yn_3",es="_toast_14zqc_1",ns="__toastClose_14zqc_1",os="__toastOpen_14zqc_1",is="__toastTimeout_14zqc_1",rs="_togglegroup_14zqc_1 _ds-toggle-group_o04yn_3",ss="__tooltip_14zqc_1 _ds-tooltip_o04yn_3",as="_heading_14zqc_1 _ds-heading_o04yn_1",ls="_ingress_14zqc_1",cs="_muted_14zqc_1",ds="_info_14zqc_1",us="_prose_14zqc_1",fs="_validation_14zqc_1 _ds-validation-message_o04yn_1",ms="_body_14zqc_162",ps="__checked_14zqc_1",C={alert:mr,app:pr,sticky:hr,avatar:gr,badge:br,breadcrumbs:vr,button:yr,card:wr,group:_r,chip:Sr,details:xr,dialog:Er,_drawer:$r,divider:Cr,errorsummary:Ar,field:Tr,suggestion:kr,affixes:Lr,fieldset:Rr,fileupload:Ir,helptext:Or,input:Mr,law:Dr,grid:Pr,flex:Nr,link:Hr,logo:qr,_logo:Br,pagination:Ur,popover:zr,print:Fr,progress:Wr,_indeterminate:Vr,skeleton:Gr,_skeleton:jr,spinner:Xr,steps:Kr,table:Yr,_scrollShadow:Qr,tabs:Zr,_scrollMask:Jr,tag:ts,toast:es,_toastClose:ns,_toastOpen:os,_toastTimeout:is,togglegroup:rs,_tooltip:ss,heading:as,ingress:ls,muted:cs,info:ds,prose:us,validation:fs,body:ms,_checked:ps},Zc=Object.freeze(Object.defineProperty({__proto__:null,_checked:ps,_drawer:$r,_indeterminate:Vr,_logo:Br,_scrollMask:Jr,_scrollShadow:Qr,_skeleton:jr,_toastClose:ns,_toastOpen:os,_toastTimeout:is,_tooltip:ss,affixes:Lr,alert:mr,app:pr,avatar:gr,badge:br,body:ms,breadcrumbs:vr,button:yr,card:wr,chip:Sr,default:C,details:xr,dialog:Er,divider:Cr,errorsummary:Ar,field:Tr,fieldset:Rr,fileupload:Ir,flex:Nr,grid:Pr,group:_r,heading:as,helptext:Or,info:ds,ingress:ls,input:Mr,law:Dr,link:Hr,logo:qr,muted:cs,pagination:Ur,popover:zr,print:Fr,progress:Wr,prose:us,skeleton:Gr,spinner:Xr,steps:Kr,sticky:hr,suggestion:kr,table:Yr,tabs:Zr,tag:ts,toast:es,togglegroup:rs,validation:fs},Symbol.toStringTag,{value:"Module"}));function hs(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=hs(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function Jc(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=hs(t))&&(o&&(o+=" "),o+=e);return o}const Jt={capture:!0,passive:!0},N=()=>typeof window<"u"&&typeof document<"u",wt=t=>N()?document.getElementsByClassName(C[t].split(" ")[0]):[];function qt(t,e){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>t.apply(this,o),e)}}const g=(t,e,n)=>n===void 0?t.getAttribute(e)??null:(n===null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),M=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.addEventListener(i,...o);return()=>gs(t,...e)},gs=(t,...e)=>{const[n,...o]=e;for(const i of n.split(" "))t.removeEventListener(i,...o)},ut=(t,e)=>{if(!N())return;window._mtdsHotReloadCleanup||(window._mtdsHotReloadCleanup=new Map);const n=()=>{window._mtdsHotReloadCleanup?.get(t)?.map(o=>o()),window._mtdsHotReloadCleanup?.set(t,e())};document.readyState!=="complete"?M(window,"load",n):document.fonts?.ready?.then(n)||setTimeout(n,0)},Be=(t,e,n)=>{let o=0;const i=()=>{if(!t.isConnected)return r();e(s),s.takeRecords(),o=0},r=()=>s?.disconnect?.(),s=new MutationObserver(()=>{o||(o=requestAnimationFrame(i))});return s.observe(t,n),i(),r},R=(t,e,n)=>{const o=document.createElement(t);if(n&&(o.textContent=n),e)for(const[i,r]of Object.entries(e))g(o,i,r);return o},td=typeof HTMLElement>"u"?class{}:HTMLElement,ed=(t,e)=>!N()||window.customElements.get(t)||window.customElements.define(t,e),nd=typeof window<"u"&&window.CSSStyleSheet&&document.adoptedStyleSheets,od=(t,e)=>{if(!nd)return;t.shadowRoot||t.attachShadow({mode:"open"}).append(R("slot"));const n=new CSSStyleSheet;n.replaceSync(e),t.shadowRoot.adoptedStyleSheets=[n]},id=`[data-command="toggle-app-expanded"],.${C.app.split(" ")[0]} > [command="show-modal"]`,rd=`.${C.breadcrumbs.split(" ")[0]}`,sd=`.${C.card.split(" ")[0]}`,bs=`.${C.chip.split(" ")[0]}`,ad=`.${C.helptext.split(" ")[0]}`,ld=`.${C.pagination.split(" ")[0]}`,cd='summary,u-summary,a,button,[role="tab"],[role="button"]',Kn="mattilsynet.matomo.cloud",dd=["setCustomUrl","setDocumentTitle","setReferrerUrl"],W="mtds-analytics-banner",ud="https://www.mattilsynet.no/om-mattilsynet/personvernerklaering/informasjonskapsler";function vs(t,e={}){if(N()){if(window._paq||(window._paq=[],window._paq.push(["HeatmapSessionRecording::disable"]),window._paq.push(["enableLinkTracking"]),window._paq.push(["setTrackerUrl",`https://${Kn}/matomo.php`])),window._mtm||(window._mtm=window._mtm||[],window._mtm.push({"mtm.startTime":Date.now(),event:"mtm.Start"})),t==="init"){window._mtdsTracking={enabled:window.location.hostname!=="localhost",...window._mtdsTracking,...e};const{consent:n,enabled:o,matomoId:i,matomoTagManagerId:r}=window._mtdsTracking;if(i&&window._paq.push(["setSiteId",i]),o){n!=="custom"&&fd();const s=r?`https://cdn.matomo.cloud/${Kn}/container_${r}.js`:`https://cdn.matomo.cloud/${Kn}/matomo.js`;document.querySelector(`script[src="${s}"]`)||document.head.append(R("script",{async:"",src:s}))}}if(window._mtdsTracking?.enabled!==!1){if(window._mtdsTracking?.enabled==="debug")return console.info(`analytics ${t}:`,e);if(t==="pageview"){const{url:n,title:o}=e;window._paq.push(["setCustomUrl",n||location.href]),window._paq.push(["setDocumentTitle",o||document.title]),window._paq.push(["trackPageView"])}else if(t==="event"){const{category:n,action:o,name:i,value:r}=e,s=["trackEvent",n,o,i,r];let a=location.href;window._paq.push([function(){a=this.getCurrentUrl()}]),window._paq.push(["setCustomUrl",a.split("#")[0]]),window._paq.push(s.filter(l=>l!==void 0)),window._paq.push(["setCustomUrl",a])}else if(t==="search"){const{query:n,category:o=!1,results:i=!1}=e;window._paq.push(["trackSiteSearch",n,o,i])}else if(t==="matomo"){const n=e;dd.includes(n?.[0])&&typeof n[1]!="string"&&(n[1]=`${n[1]??""}`),window._paq.push(n)}}}}function fd(){if(document.getElementById(W)||window.localStorage.getItem(W))return;document.body.insertAdjacentHTML("afterbegin",`<dialog id="${W}" data-analytics="ignore"><style>
|
|
24
24
|
#${W}[open] { box-sizing: border-box; display: flex; align-items: center; background: #116e6b; border-radius: .5em; border: 0; box-shadow: 0 .25em .5em rgba(0,0,0,.3); color: #fff; font-size: .875em; inset: auto auto 1em 1em; max-width: calc(100vw - 2em); outline: 0; padding: .5em; position: fixed; z-index: 99999 }
|
|
25
25
|
#${W} button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; width: 1.5em; height: 1.5em; font: 300 1.5em/1.35 sans-serif; border-radius: .25em; place-content: center; transition: .2s; transition-property: background, scale }
|
|
26
26
|
#${W} button:focus-visible { outline: 2px solid }
|
package/mtds/package.json.js
CHANGED