@mattilsynet/design 2.2.4 → 2.2.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/app/app-observer.js +1 -1
- package/mtds/app/app-toggle.js +26 -10
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +10 -26
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.js +1 -1
- package/mtds/chart/chart-element.js +1 -1
- package/mtds/chart/chart-element.js.map +1 -1
- package/mtds/chart/chart-lines.d.ts +1 -1
- package/mtds/chart/chart-lines.js +30 -30
- package/mtds/chart/chart-lines.js.map +1 -1
- package/mtds/chart/chart.css.js +10 -4
- package/mtds/chart/chart.css.js.map +1 -1
- package/mtds/chart/chart.d.ts +2 -2
- package/mtds/chart/chart.js.map +1 -1
- package/mtds/chart/chart.stories.d.ts +1 -1
- package/mtds/field/field.js +1 -0
- package/mtds/field/field.js.map +1 -1
- package/mtds/index.d.ts +1 -0
- package/mtds/index.iife.js +20 -14
- package/mtds/map/map.d.ts +14 -0
- package/mtds/package.json.js +1 -1
- package/mtds/popover/popover-observer.js +1 -2
- package/mtds/popover/popover-observer.js.map +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/styles.json +42 -41
- package/mtds/styles.module.css.js +82 -80
- package/mtds/styles.module.css.js.map +1 -1
- package/mtds/tailwind.css +5 -0
- package/mtds/toast/toast.js +8 -7
- package/mtds/toast/toast.js.map +1 -1
- package/package.json +1 -1
- package/mtds/_virtual/client.js +0 -6
- package/mtds/_virtual/client.js.map +0 -1
- package/mtds/_virtual/client2.js +0 -5
- package/mtds/_virtual/client2.js.map +0 -1
- package/mtds/_virtual/index.js +0 -5
- package/mtds/_virtual/index.js.map +0 -1
- package/mtds/_virtual/react-dom-client.development.js +0 -5
- package/mtds/_virtual/react-dom-client.development.js.map +0 -1
- package/mtds/_virtual/react-dom-client.production.js +0 -5
- package/mtds/_virtual/react-dom-client.production.js.map +0 -1
- package/mtds/_virtual/scheduler.development.js +0 -5
- package/mtds/_virtual/scheduler.development.js.map +0 -1
- package/mtds/_virtual/scheduler.production.js +0 -5
- package/mtds/_virtual/scheduler.production.js.map +0 -1
- package/mtds/external/react-dom/cjs/react-dom-client.development.js +0 -15323
- package/mtds/external/react-dom/cjs/react-dom-client.development.js.map +0 -1
- package/mtds/external/react-dom/cjs/react-dom-client.production.js +0 -9409
- package/mtds/external/react-dom/cjs/react-dom-client.production.js.map +0 -1
- package/mtds/external/react-dom/client.js +0 -24
- package/mtds/external/react-dom/client.js.map +0 -1
- package/mtds/external/scheduler/cjs/scheduler.development.js +0 -237
- package/mtds/external/scheduler/cjs/scheduler.development.js.map +0 -1
- package/mtds/external/scheduler/cjs/scheduler.production.js +0 -234
- package/mtds/external/scheduler/cjs/scheduler.production.js.map +0 -1
- package/mtds/external/scheduler/index.js +0 -11
- package/mtds/external/scheduler/index.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Control } from 'ol/control';
|
|
2
|
+
import { Tile } from 'ol/layer';
|
|
3
|
+
export declare class Zoom extends Control {
|
|
4
|
+
/**
|
|
5
|
+
* @param {Object} [options] Control options.
|
|
6
|
+
*/
|
|
7
|
+
constructor({ target }?: Record<string, string>);
|
|
8
|
+
handleRotateNorth(): void;
|
|
9
|
+
}
|
|
10
|
+
export type MtdsTileTypes = "color" | "gray" | "gray-subtle";
|
|
11
|
+
export type MtdsTileOptions = ConstructorParameters<typeof Tile>[0];
|
|
12
|
+
export declare class MtdsTile extends Tile {
|
|
13
|
+
constructor(type: MtdsTileTypes, options?: MtdsTileOptions);
|
|
14
|
+
}
|
package/mtds/package.json.js
CHANGED
|
@@ -28,10 +28,9 @@ function L(o) {
|
|
|
28
28
|
for (const e of document.getElementsByClassName(l))
|
|
29
29
|
!e.contains(o.target) && n !== e && e.hidePopover();
|
|
30
30
|
if (n && t) {
|
|
31
|
-
o.preventDefault();
|
|
32
31
|
const e = a(t, "popovertargetaction"), i = e === "show" || (e === "hide" ? !1 : void 0);
|
|
33
32
|
if (t instanceof HTMLButtonElement && !e && n.contains(t)) return;
|
|
34
|
-
n instanceof HTMLElement && n.isConnected && n.togglePopover && n.togglePopover(i);
|
|
33
|
+
n instanceof HTMLElement && n.isConnected && n.togglePopover && (o.preventDefault(), n.togglePopover(i));
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
v(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-observer.js","sources":["../../designsystem/popover/popover-observer.ts"],"sourcesContent":["import { flip, type Placement, shift, size } from \"@floating-ui/dom\";\nimport styles from \"../styles.module.css\";\nimport { anchorPosition, attr, on, onLoaded, QUICK_EVENT } from \"../utils\";\n\nconst CSS_POPOVER = styles.popover.split(\" \")[0];\nconst CSS_AUTO = `_mtds-popover-auto`;\n\ntype EventToggle = Event & Partial<ToggleEvent>;\n\nfunction handlePopoverToggle({ target: el, newState }: EventToggle) {\n\tif (el instanceof HTMLElement && el.classList.contains(CSS_POPOVER)) {\n\t\tconst isClosing = newState === \"closed\";\n\t\tconst isContain = attr(el, \"data-overscroll\") === \"contain\";\n\t\tconst anchor = (el.getRootNode() as ShadowRoot)?.querySelector<HTMLElement>(\n\t\t\t`[popovertarget=\"${el.id}\"]`,\n\t\t);\n\n\t\tif (isClosing) anchorPosition(el, false);\n\t\telse if (anchor)\n\t\t\tanchorPosition(el, anchor, {\n\t\t\t\tplacement: (attr(el, \"data-position\") || \"bottom\") as Placement,\n\t\t\t\tmiddleware: [flip(), shift({ padding: 10 })].concat(\n\t\t\t\t\tisContain\n\t\t\t\t\t\t? size({\n\t\t\t\t\t\t\t\tpadding: 10,\n\t\t\t\t\t\t\t\tapply({ availableHeight }) {\n\t\t\t\t\t\t\t\t\tel.style.maxHeight = `${Math.max(50, availableHeight)}px`;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: [],\n\t\t\t\t),\n\t\t\t});\n\t}\n}\n\nfunction handlePopoverBeforetoggle({ target: el, newState }: EventToggle) {\n\tif (\n\t\tnewState === \"open\" &&\n\t\tel instanceof HTMLElement &&\n\t\tel.classList.contains(CSS_POPOVER) &&\n\t\tattr(el, \"popover\") !== \"manual\"\n\t) {\n\t\tel.classList.add(CSS_AUTO);\n\t\tattr(el, \"popover\", \"manual\"); // Make manual to prevent closing when clicking scrollbar\n\t}\n}\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 handlePopoverLinkClick(event: Event) {\n\tconst el = (event.target as Element)?.closest?.(\"a,button\");\n\tconst id = el && attr(el, \"popovertarget\");\n\tconst pop = id ? document.getElementById(id) : el?.closest(`.${CSS_POPOVER}`);\n\n\t// Manually close popovers where click was outside\n\tfor (const open of document.getElementsByClassName(CSS_AUTO))\n\t\tif (!open.contains(event.target as Node) && pop !== open)\n\t\t\t(open as HTMLElement).hidePopover();\n\n\tif (pop && el) {\n\t\
|
|
1
|
+
{"version":3,"file":"popover-observer.js","sources":["../../designsystem/popover/popover-observer.ts"],"sourcesContent":["import { flip, type Placement, shift, size } from \"@floating-ui/dom\";\nimport styles from \"../styles.module.css\";\nimport { anchorPosition, attr, on, onLoaded, QUICK_EVENT } from \"../utils\";\n\nconst CSS_POPOVER = styles.popover.split(\" \")[0];\nconst CSS_AUTO = `_mtds-popover-auto`;\n\ntype EventToggle = Event & Partial<ToggleEvent>;\n\nfunction handlePopoverToggle({ target: el, newState }: EventToggle) {\n\tif (el instanceof HTMLElement && el.classList.contains(CSS_POPOVER)) {\n\t\tconst isClosing = newState === \"closed\";\n\t\tconst isContain = attr(el, \"data-overscroll\") === \"contain\";\n\t\tconst anchor = (el.getRootNode() as ShadowRoot)?.querySelector<HTMLElement>(\n\t\t\t`[popovertarget=\"${el.id}\"]`,\n\t\t);\n\n\t\tif (isClosing) anchorPosition(el, false);\n\t\telse if (anchor)\n\t\t\tanchorPosition(el, anchor, {\n\t\t\t\tplacement: (attr(el, \"data-position\") || \"bottom\") as Placement,\n\t\t\t\tmiddleware: [flip(), shift({ padding: 10 })].concat(\n\t\t\t\t\tisContain\n\t\t\t\t\t\t? size({\n\t\t\t\t\t\t\t\tpadding: 10,\n\t\t\t\t\t\t\t\tapply({ availableHeight }) {\n\t\t\t\t\t\t\t\t\tel.style.maxHeight = `${Math.max(50, availableHeight)}px`;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: [],\n\t\t\t\t),\n\t\t\t});\n\t}\n}\n\nfunction handlePopoverBeforetoggle({ target: el, newState }: EventToggle) {\n\tif (\n\t\tnewState === \"open\" &&\n\t\tel instanceof HTMLElement &&\n\t\tel.classList.contains(CSS_POPOVER) &&\n\t\tattr(el, \"popover\") !== \"manual\"\n\t) {\n\t\tel.classList.add(CSS_AUTO);\n\t\tattr(el, \"popover\", \"manual\"); // Make manual to prevent closing when clicking scrollbar\n\t}\n}\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 handlePopoverLinkClick(event: Event) {\n\tconst el = (event.target as Element)?.closest?.(\"a,button\");\n\tconst id = el && attr(el, \"popovertarget\");\n\tconst pop = id ? document.getElementById(id) : el?.closest(`.${CSS_POPOVER}`);\n\n\t// Manually close popovers where click was outside\n\tfor (const open of document.getElementsByClassName(CSS_AUTO))\n\t\tif (!open.contains(event.target as Node) && pop !== open)\n\t\t\t(open as HTMLElement).hidePopover();\n\n\tif (pop && el) {\n\t\tconst action = attr(el, \"popovertargetaction\");\n\t\tconst open = action === \"show\" || (action === \"hide\" ? false : undefined);\n\n\t\t// Popover can be disconneted by click handler deeper down in the DOM three before reaching document\n\t\tif (el instanceof HTMLButtonElement && !action && pop.contains(el)) return; // Require \"popovertargetaction\" attribute to make buttons inside popover toggle\n\t\tif (pop instanceof HTMLElement && pop.isConnected && pop.togglePopover) {\n\t\t\tevent.preventDefault(); // Prevent browser popover API since we are doing it ourselves\n\t\t\tpop.togglePopover(open);\n\t\t}\n\t}\n}\n\nonLoaded(() => {\n\ton(document, \"click\", handlePopoverLinkClick); // Allow `<a>` to use `popovertarget` as well\n\ton(document, \"toggle\", handlePopoverToggle, QUICK_EVENT); // Use capture since toggle does not bubble\n\ton(document, \"beforetoggle\", handlePopoverBeforetoggle, QUICK_EVENT); // Use capture since toggle does not bubble\n});\n"],"names":["CSS_POPOVER","styles","CSS_AUTO","handlePopoverToggle","el","newState","isClosing","isContain","attr","anchor","anchorPosition","flip","shift","size","availableHeight","handlePopoverBeforetoggle","handlePopoverLinkClick","event","id","pop","open","action","onLoaded","on","QUICK_EVENT"],"mappings":";;;AAIA,MAAMA,IAAcC,EAAO,QAAQ,MAAM,GAAG,EAAE,CAAC,GACzCC,IAAW;AAIjB,SAASC,EAAoB,EAAE,QAAQC,GAAI,UAAAC,KAAyB;AACnE,MAAID,aAAc,eAAeA,EAAG,UAAU,SAASJ,CAAW,GAAG;AACpE,UAAMM,IAAYD,MAAa,UACzBE,IAAYC,EAAKJ,GAAI,iBAAiB,MAAM,WAC5CK,IAAUL,EAAG,YAAA,GAA8B;AAAA,MAChD,mBAAmBA,EAAG,EAAE;AAAA,IAAA;AAGzB,IAAIE,IAAWI,EAAeN,GAAI,EAAK,IAC9BK,KACRC,EAAeN,GAAIK,GAAQ;AAAA,MAC1B,WAAYD,EAAKJ,GAAI,eAAe,KAAK;AAAA,MACzC,YAAY,CAACO,EAAA,GAAQC,EAAM,EAAE,SAAS,GAAA,CAAI,CAAC,EAAE;AAAA,QAC5CL,IACGM,EAAK;AAAA,UACL,SAAS;AAAA,UACT,MAAM,EAAE,iBAAAC,KAAmB;AAC1B,YAAAV,EAAG,MAAM,YAAY,GAAG,KAAK,IAAI,IAAIU,CAAe,CAAC;AAAA,UACtD;AAAA,QAAA,CACA,IACA,CAAA;AAAA,MAAC;AAAA,IACL,CACA;AAAA,EACH;AACD;AAEA,SAASC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