@mattilsynet/design 3.1.10 → 3.1.12

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.
@@ -1,4 +1,4 @@
1
- const o = "3.1.10";
1
+ const o = "3.1.12";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,13 +1,13 @@
1
- import { onHotReload as s, on as a, attr as c } from "../utils.js";
2
- function i({ target: p }) {
3
- const o = p?.closest?.("a"), t = o && c(o, "popovertarget"), e = t ? document.getElementById(t) : o?.closest("[popover]");
4
- if (o && e instanceof HTMLElement && e.popover) {
5
- const n = c(o, "popovertargetaction"), r = n === "show" || (n === "hide" ? !1 : void 0);
6
- e.togglePopover(r);
1
+ import { onHotReload as i, on as s, attr as c } from "../utils.js";
2
+ function l({ target: r }) {
3
+ const o = r?.closest?.('a,button,[role="button"]'), t = o && c(o, "popovertarget"), e = t ? document.getElementById(t) : o?.closest("[popover]");
4
+ if (!(t && o instanceof HTMLButtonElement) && o && e instanceof HTMLElement && e.popover) {
5
+ const n = c(o, "popovertargetaction"), p = n === "show" || (n === "hide" ? !1 : void 0);
6
+ e.togglePopover(p);
7
7
  }
8
8
  }
9
- s("popover", () => [
10
- a(document, "click", i)
9
+ i("popover", () => [
10
+ s(document, "click", l)
11
11
  // Allow `<a>` to use `popovertarget` as well
12
12
  ]);
13
13
  //# sourceMappingURL=popover-observer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-observer.js","sources":["../../designsystem/popover/popover-observer.ts"],"sourcesContent":["import { attr, on, onHotReload } from \"../utils\";\n\n// Polyfill popovertarget for <a> (not supported by native)\n// and automatically assume popovertarget is the closest parent popover\n// but respect the popovertarget and popovertargetaction attribute\nfunction handlePopoverClick({ target }: Event) {\n\tconst a = (target as Element)?.closest?.(\"a\");\n\tconst id = a && attr(a, \"popovertarget\");\n\tconst pop = id ? document.getElementById(id) : a?.closest(\"[popover]\");\n\n\tif (a && pop instanceof HTMLElement && pop.popover) {\n\t\tconst action = attr(a, \"popovertargetaction\");\n\t\tconst open = action === \"show\" || (action === \"hide\" ? false : undefined);\n\t\tpop.togglePopover(open);\n\t}\n}\n\nonHotReload(\"popover\", () => [\n\ton(document, \"click\", handlePopoverClick), // Allow `<a>` to use `popovertarget` as well\n]);\n"],"names":["handlePopoverClick","target","a","id","attr","pop","action","open","onHotReload","on"],"mappings":";AAKA,SAASA,EAAmB,EAAE,QAAAC,KAAiB;AAC9C,QAAMC,IAAKD,GAAoB,UAAU,GAAG,GACtCE,IAAKD,KAAKE,EAAKF,GAAG,eAAe,GACjCG,IAAMF,IAAK,SAAS,eAAeA,CAAE,IAAID,GAAG,QAAQ,WAAW;AAErE,MAAIA,KAAKG,aAAe,eAAeA,EAAI,SAAS;AACnD,UAAMC,IAASF,EAAKF,GAAG,qBAAqB,GACtCK,IAAOD,MAAW,WAAWA,MAAW,SAAS,KAAQ;AAC/D,IAAAD,EAAI,cAAcE,CAAI;AAAA,EACvB;AACD;AAEAC,EAAY,WAAW,MAAM;AAAA,EAC5BC,EAAG,UAAU,SAAST,CAAkB;AAAA;AACzC,CAAC;"}
1
+ {"version":3,"file":"popover-observer.js","sources":["../../designsystem/popover/popover-observer.ts"],"sourcesContent":["import { attr, on, onHotReload } from \"../utils\";\n\n// Polyfill popovertarget for <a> (not supported by native)\n// and automatically assume popovertarget is the closest parent popover\n// but respect the popovertarget and popovertargetaction attribute\nfunction handlePopoverClick({ target }: Event) {\n\tconst trigger = (target as Element)?.closest?.(`a,button,[role=\"button\"]`);\n\tconst id = trigger && attr(trigger, \"popovertarget\");\n\tconst pop = id ? document.getElementById(id) : trigger?.closest(\"[popover]\");\n\n\tif (id && trigger instanceof HTMLButtonElement) return; // Native support for buttons with popovertarget, only polyfill for <a> or missing popovertarget\n\tif (trigger && pop instanceof HTMLElement && pop.popover) {\n\t\tconst action = attr(trigger, \"popovertargetaction\");\n\t\tconst open = action === \"show\" || (action === \"hide\" ? false : undefined);\n\t\tpop.togglePopover(open);\n\t}\n}\n\nonHotReload(\"popover\", () => [\n\ton(document, \"click\", handlePopoverClick), // Allow `<a>` to use `popovertarget` as well\n]);\n"],"names":["handlePopoverClick","target","trigger","id","attr","pop","action","open","onHotReload","on"],"mappings":";AAKA,SAASA,EAAmB,EAAE,QAAAC,KAAiB;AAC9C,QAAMC,IAAWD,GAAoB,UAAU,0BAA0B,GACnEE,IAAKD,KAAWE,EAAKF,GAAS,eAAe,GAC7CG,IAAMF,IAAK,SAAS,eAAeA,CAAE,IAAID,GAAS,QAAQ,WAAW;AAE3E,MAAI,EAAAC,KAAMD,aAAmB,sBACzBA,KAAWG,aAAe,eAAeA,EAAI,SAAS;AACzD,UAAMC,IAASF,EAAKF,GAAS,qBAAqB,GAC5CK,IAAOD,MAAW,WAAWA,MAAW,SAAS,KAAQ;AAC/D,IAAAD,EAAI,cAAcE,CAAI;AAAA,EACvB;AACD;AAEAC,EAAY,WAAW,MAAM;AAAA,EAC5BC,EAAG,UAAU,SAAST,CAAkB;AAAA;AACzC,CAAC;"}
@@ -1,16 +1,16 @@
1
1
  import { Atlas as r } from "./atlas/atlas.js";
2
- import { MTDSAtlasMarkerElement as l } from "./atlas/atlas-marker.js";
3
- import { MTDSAtlasMatgeoElement as a } from "./atlas/atlas-matgeo.js";
4
- import { MTDSAtlasWMSElement as f } from "./atlas/atlas-wms.js";
5
- import { default as s } from "./external/leaflet/dist/leaflet-src.js";
6
- import { MATGEO_URL as A, MTDSAtlasElement as E } from "./atlas/atlas-element.js";
2
+ import { default as l } from "./external/leaflet/dist/leaflet-src.js";
3
+ import { MATGEO_URL as a, MTDSAtlasElement as M } from "./atlas/atlas-element.js";
4
+ import { MTDSAtlasMarkerElement as p } from "./atlas/atlas-marker.js";
5
+ import { MTDSAtlasMatgeoElement as x } from "./atlas/atlas-matgeo.js";
6
+ import { MTDSAtlasWMSElement as E } from "./atlas/atlas-wms.js";
7
7
  export {
8
8
  r as Atlas,
9
- s as L,
10
- A as MATGEO_URL,
11
- E as MTDSAtlasElement,
12
- l as MTDSAtlasMarkerElement,
13
- a as MTDSAtlasMatgeoElement,
14
- f as MTDSAtlasWMSElement
9
+ l as L,
10
+ a as MATGEO_URL,
11
+ M as MTDSAtlasElement,
12
+ p as MTDSAtlasMarkerElement,
13
+ x as MTDSAtlasMatgeoElement,
14
+ E as MTDSAtlasWMSElement
15
15
  };
16
16
  //# sourceMappingURL=react-atlas.js.map