@mattilsynet/design 2.2.29 → 2.2.30
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/alert/alert.js +8 -9
- package/mtds/alert/alert.js.map +1 -1
- package/mtds/analytics/analytics.js +104 -165
- package/mtds/analytics/analytics.js.map +1 -1
- package/mtds/app/app-observer.js +27 -73
- package/mtds/app/app-observer.js.map +1 -1
- package/mtds/app/app-toggle.js +24 -2
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +10 -16
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.js +32 -36
- package/mtds/app/app.js.map +1 -1
- package/mtds/atlas/atlas-element.d.ts +27 -0
- package/mtds/atlas/atlas-element.js +63 -84
- package/mtds/atlas/atlas-element.js.map +1 -1
- package/mtds/atlas/atlas-marker.js +28 -48
- package/mtds/atlas/atlas-marker.js.map +1 -1
- package/mtds/atlas/atlas-matgeo.d.ts +3 -8
- package/mtds/atlas/atlas-matgeo.js +36 -66
- package/mtds/atlas/atlas-matgeo.js.map +1 -1
- package/mtds/atlas/atlas-wms.js +11 -21
- package/mtds/atlas/atlas-wms.js.map +1 -1
- package/mtds/atlas/atlas.css.js +2 -2
- package/mtds/atlas/atlas.css.js.map +1 -1
- package/mtds/atlas/atlas.js +23 -23
- package/mtds/atlas/atlas.js.map +1 -1
- package/mtds/atlas/atlas.stories.d.ts +1 -0
- package/mtds/atlas/cluster.js +697 -1576
- package/mtds/atlas/cluster.js.map +1 -1
- package/mtds/atlas.iife.js +4 -4
- package/mtds/atlas.js +11 -10
- package/mtds/avatar/avatar.js +8 -8
- package/mtds/avatar/avatar.js.map +1 -1
- package/mtds/badge/badge.js +7 -7
- package/mtds/badge/badge.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs-observer.js +9 -10
- package/mtds/breadcrumbs/breadcrumbs-observer.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs.js +13 -14
- package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
- package/mtds/button/button.js +14 -16
- package/mtds/button/button.js.map +1 -1
- package/mtds/card/card.js +12 -14
- package/mtds/card/card.js.map +1 -1
- package/mtds/chart/chart-axis.js +15 -27
- package/mtds/chart/chart-axis.js.map +1 -1
- package/mtds/chart/chart-bars.js +13 -15
- package/mtds/chart/chart-bars.js.map +1 -1
- package/mtds/chart/chart-element.js +48 -83
- package/mtds/chart/chart-element.js.map +1 -1
- package/mtds/chart/chart-lines.js +32 -54
- package/mtds/chart/chart-lines.js.map +1 -1
- package/mtds/chart/chart-pies.js +14 -34
- package/mtds/chart/chart-pies.js.map +1 -1
- package/mtds/chart/chart.css.js +2 -2
- package/mtds/chart/chart.css.js.map +1 -1
- package/mtds/chart/chart.js +12 -12
- package/mtds/chart/chart.js.map +1 -1
- package/mtds/chip/chip.js +8 -8
- package/mtds/chip/chip.js.map +1 -1
- package/mtds/details/details.js +12 -14
- package/mtds/details/details.js.map +1 -1
- package/mtds/dialog/dialog-observer.js +22 -35
- package/mtds/dialog/dialog-observer.js.map +1 -1
- package/mtds/dialog/dialog.js +12 -12
- package/mtds/dialog/dialog.js.map +1 -1
- package/mtds/divider/divider.js +10 -10
- package/mtds/divider/divider.js.map +1 -1
- package/mtds/errorsummary/errorsummary-observer.js +8 -11
- package/mtds/errorsummary/errorsummary-observer.js.map +1 -1
- package/mtds/errorsummary/errorsummary.js +11 -11
- package/mtds/errorsummary/errorsummary.js.map +1 -1
- package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js +19 -27
- package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
- package/mtds/external/@turf/helpers/dist/esm/index.js +16 -29
- package/mtds/external/@turf/helpers/dist/esm/index.js.map +1 -1
- package/mtds/external/@turf/invariant/dist/esm/index.js +13 -20
- package/mtds/external/@turf/invariant/dist/esm/index.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet-src.js +3096 -6004
- package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet.css.js +2 -2
- package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -1
- package/mtds/external/point-in-polygon-hao/dist/esm/index.js +16 -46
- package/mtds/external/point-in-polygon-hao/dist/esm/index.js.map +1 -1
- package/mtds/external/robust-predicates/esm/orient2d.js +19 -163
- package/mtds/external/robust-predicates/esm/orient2d.js.map +1 -1
- package/mtds/external/robust-predicates/esm/util.js +25 -85
- package/mtds/external/robust-predicates/esm/util.js.map +1 -1
- package/mtds/field/field-observer.js +53 -101
- package/mtds/field/field-observer.js.map +1 -1
- package/mtds/field/field.js +145 -177
- package/mtds/field/field.js.map +1 -1
- package/mtds/fieldset/fieldset-observer.js +14 -24
- package/mtds/fieldset/fieldset-observer.js.map +1 -1
- package/mtds/fieldset/fieldset.js +20 -23
- package/mtds/fieldset/fieldset.js.map +1 -1
- package/mtds/fileupload/fileupload.js +8 -9
- package/mtds/fileupload/fileupload.js.map +1 -1
- package/mtds/helptext/helptext.js +15 -15
- package/mtds/helptext/helptext.js.map +1 -1
- package/mtds/illustrations/index.json +2 -2
- package/mtds/index.iife.js +15 -15
- package/mtds/index.js +26 -26
- package/mtds/input/input.js +28 -30
- package/mtds/input/input.js.map +1 -1
- package/mtds/law/law-helper.js +77 -143
- package/mtds/law/law-helper.js.map +1 -1
- package/mtds/law/law.js +6 -6
- package/mtds/law/law.js.map +1 -1
- package/mtds/layout/layout.js +10 -13
- package/mtds/layout/layout.js.map +1 -1
- package/mtds/link/link.js +7 -8
- package/mtds/link/link.js.map +1 -1
- package/mtds/logo/logo-observer.js +12 -18
- package/mtds/logo/logo-observer.js.map +1 -1
- package/mtds/logo/logo.js +8 -8
- package/mtds/logo/logo.js.map +1 -1
- package/mtds/package.json.js +2 -2
- package/mtds/pagination/pagination-helper.js +11 -17
- package/mtds/pagination/pagination-helper.js.map +1 -1
- package/mtds/pagination/pagination.js +30 -30
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/popover/popover-observer.js +33 -45
- package/mtds/popover/popover-observer.js.map +1 -1
- package/mtds/popover/popover.js +12 -13
- package/mtds/popover/popover.js.map +1 -1
- package/mtds/progress/progress.js +8 -8
- package/mtds/progress/progress.js.map +1 -1
- package/mtds/react-atlas.js +13 -12
- package/mtds/react.js +80 -80
- package/mtds/skeleton/skeleton.js +8 -8
- package/mtds/skeleton/skeleton.js.map +1 -1
- package/mtds/spinner/spinner.js +8 -8
- package/mtds/spinner/spinner.js.map +1 -1
- package/mtds/steps/steps.js +7 -7
- package/mtds/steps/steps.js.map +1 -1
- package/mtds/styles.css +1 -4605
- package/mtds/styles.json +43 -43
- package/mtds/styles.module.css.js +112 -167
- package/mtds/styles.module.css.js.map +1 -1
- package/mtds/table/table-observer.js +19 -22
- package/mtds/table/table-observer.js.map +1 -1
- package/mtds/table/table.d.ts +7 -0
- package/mtds/table/table.js +43 -18
- package/mtds/table/table.js.map +1 -1
- package/mtds/tabs/tabs.js +21 -25
- package/mtds/tabs/tabs.js.map +1 -1
- package/mtds/tag/tag.js +8 -8
- package/mtds/tag/tag.js.map +1 -1
- package/mtds/tailwind.css +6 -25
- package/mtds/toast/toast-helper.js +20 -35
- package/mtds/toast/toast-helper.js.map +1 -1
- package/mtds/toast/toast-observer.js +15 -30
- package/mtds/toast/toast-observer.js.map +1 -1
- package/mtds/toast/toast.js +37 -45
- package/mtds/toast/toast.js.map +1 -1
- package/mtds/togglegroup/togglegroup-observer.js +10 -15
- package/mtds/togglegroup/togglegroup-observer.js.map +1 -1
- package/mtds/togglegroup/togglegroup.js +24 -21
- package/mtds/togglegroup/togglegroup.js.map +1 -1
- package/mtds/tooltip/tooltip-observer.js +32 -48
- package/mtds/tooltip/tooltip-observer.js.map +1 -1
- package/mtds/typography/typography.js +19 -28
- package/mtds/typography/typography.js.map +1 -1
- package/mtds/utils.js +89 -129
- package/mtds/utils.js.map +1 -1
- package/mtds/validation/validation-observer.js +25 -31
- package/mtds/validation/validation-observer.js.map +1 -1
- package/mtds/validation/validation.js +12 -12
- package/mtds/validation/validation.js.map +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-toggle.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":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"app-toggle.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-toggle2.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
(() =>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
window.localStorage.setItem(key, next);
|
|
12
|
-
} catch (_err) {
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
window.mtdsToggleAppExpanded(prev());
|
|
16
|
-
})();
|
|
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
|
+
})();
|
|
17
11
|
//# sourceMappingURL=app-toggle2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-toggle2.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":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-toggle2.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.js
CHANGED
|
@@ -1,55 +1,51 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import { Button } from "../button/button.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
const App = Object.assign(AppComp, {
|
|
16
|
-
Header: forwardRef(
|
|
17
|
-
function AppHeader(rest, ref) {
|
|
18
|
-
return /* @__PURE__ */ jsx("header", { ref, ...rest });
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import a from "clsx";
|
|
3
|
+
import { forwardRef as p } from "react";
|
|
4
|
+
import { Button as s } from "../button/button.js";
|
|
5
|
+
import c from "../styles.module.css.js";
|
|
6
|
+
import d from "./app-toggle.js";
|
|
7
|
+
const f = p(function({ as: t, className: r, ...i }, e) {
|
|
8
|
+
return /* @__PURE__ */ o(t || "div", { className: a(c.app, r), ref: e, ...i });
|
|
9
|
+
}), u = p(function({ as: t, className: r, ...i }, e) {
|
|
10
|
+
return /* @__PURE__ */ o(t || "div", { className: a(c.sticky, r), ref: e, ...i });
|
|
11
|
+
}), k = Object.assign(f, {
|
|
12
|
+
Header: p(
|
|
13
|
+
function(t, r) {
|
|
14
|
+
return /* @__PURE__ */ o("header", { ref: r, ...t });
|
|
19
15
|
}
|
|
20
16
|
),
|
|
21
|
-
Sidebar:
|
|
22
|
-
function
|
|
23
|
-
return /* @__PURE__ */
|
|
17
|
+
Sidebar: p(
|
|
18
|
+
function(t, r) {
|
|
19
|
+
return /* @__PURE__ */ o("dialog", { role: "navigation", ref: r, ...t });
|
|
24
20
|
}
|
|
25
21
|
),
|
|
26
|
-
Sticky:
|
|
27
|
-
Toggle:
|
|
28
|
-
function
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
22
|
+
Sticky: u,
|
|
23
|
+
Toggle: p(
|
|
24
|
+
function({ children: t, ...r }, i) {
|
|
25
|
+
return /* @__PURE__ */ o(
|
|
26
|
+
s,
|
|
31
27
|
{
|
|
32
28
|
"data-command": "toggle-app-expanded",
|
|
33
29
|
"data-tooltip": "Vis meny",
|
|
34
|
-
ref,
|
|
35
|
-
...
|
|
36
|
-
children:
|
|
30
|
+
ref: i,
|
|
31
|
+
...r,
|
|
32
|
+
children: t ?? "Skjul meny"
|
|
37
33
|
}
|
|
38
34
|
);
|
|
39
35
|
}
|
|
40
36
|
),
|
|
41
|
-
Main:
|
|
42
|
-
return /* @__PURE__ */
|
|
37
|
+
Main: p(function(t, r) {
|
|
38
|
+
return /* @__PURE__ */ o("main", { ref: r, ...t });
|
|
43
39
|
}),
|
|
44
|
-
Footer:
|
|
45
|
-
function
|
|
46
|
-
return /* @__PURE__ */
|
|
40
|
+
Footer: p(
|
|
41
|
+
function(t, r) {
|
|
42
|
+
return /* @__PURE__ */ o("footer", { ref: r, ...t });
|
|
47
43
|
}
|
|
48
44
|
),
|
|
49
45
|
// Needed to avoid flash of unstyled content and still be Next.js hydration compatible
|
|
50
|
-
Script: () => /* @__PURE__ */
|
|
46
|
+
Script: () => /* @__PURE__ */ o("script", { id: "mtds-app-script", children: d })
|
|
51
47
|
});
|
|
52
48
|
export {
|
|
53
|
-
App
|
|
49
|
+
k as App
|
|
54
50
|
};
|
|
55
51
|
//# sourceMappingURL=app.js.map
|
package/mtds/app/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sources":["../../designsystem/app/app.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport script from \"./app-toggle.js?raw\";\n\nexport type AppHeaderProps = React.ComponentPropsWithoutRef<\"header\">;\nexport type AppSidebarProps = React.ComponentPropsWithoutRef<\"dialog\">;\nexport type AppStickyProps = React.ComponentPropsWithoutRef<\"div\">;\nexport type AppMainProps = React.ComponentPropsWithoutRef<\"main\">;\nexport type AppFooterProps = React.ComponentPropsWithoutRef<\"footer\">;\nexport type AppProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype AppComponent = <As extends React.ElementType = \"div\">(\n\tprops: AppProps<As>,\n) => JSX.Element;\n\nconst AppComp = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.app, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nconst AppSticky = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.sticky, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport const App = Object.assign(AppComp, {\n\tHeader: forwardRef<HTMLElement, AppHeaderProps>(\n\t\tfunction AppHeader(rest, ref) {\n\t\t\treturn <header ref={ref} {...rest} />;\n\t\t},\n\t),\n\tSidebar: forwardRef<HTMLDialogElement, AppSidebarProps>(\n\t\tfunction AppSidebar(rest, ref) {\n\t\t\treturn <dialog role=\"navigation\" ref={ref} {...rest} />;\n\t\t},\n\t),\n\tSticky: AppSticky,\n\tToggle: forwardRef<HTMLButtonElement, ButtonProps<\"button\">>(\n\t\tfunction AppToggle({ children, ...rest }: ButtonProps<\"button\">, ref) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tdata-command=\"toggle-app-expanded\"\n\t\t\t\t\tdata-tooltip=\"Vis meny\"\n\t\t\t\t\tref={ref as React.Ref<HTMLAnchorElement>}\n\t\t\t\t\t{...rest}\n\t\t\t\t>\n\t\t\t\t\t{children ?? \"Skjul meny\"}\n\t\t\t\t</Button>\n\t\t\t);\n\t\t},\n\t),\n\tMain: forwardRef<HTMLElement, AppMainProps>(function AppMain(rest, ref) {\n\t\treturn <main ref={ref} {...rest} />;\n\t}),\n\tFooter: forwardRef<HTMLElement, AppFooterProps>(\n\t\tfunction AppFooter(rest, ref) {\n\t\t\treturn <footer ref={ref} {...rest} />;\n\t\t},\n\t),\n\t// Needed to avoid flash of unstyled content and still be Next.js hydration compatible\n\tScript: () => <script id=\"mtds-app-script\">{script}</script>,\n});\n"],"names":["App"],"mappings":";;;;;;AAsBA,
|
|
1
|
+
{"version":3,"file":"app.js","sources":["../../designsystem/app/app.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef, type JSX } from \"react\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport type {\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport script from \"./app-toggle.js?raw\";\n\nexport type AppHeaderProps = React.ComponentPropsWithoutRef<\"header\">;\nexport type AppSidebarProps = React.ComponentPropsWithoutRef<\"dialog\">;\nexport type AppStickyProps = React.ComponentPropsWithoutRef<\"div\">;\nexport type AppMainProps = React.ComponentPropsWithoutRef<\"main\">;\nexport type AppFooterProps = React.ComponentPropsWithoutRef<\"footer\">;\nexport type AppProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As>;\n\ntype AppComponent = <As extends React.ElementType = \"div\">(\n\tprops: AppProps<As>,\n) => JSX.Element;\n\nconst AppComp = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.app, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nconst AppSticky = forwardRef<null>(function App<\n\tAs extends React.ElementType = \"div\",\n>({ as, className, ...rest }: AppProps<As>, ref?: PolymorphicRef<As>) {\n\tconst Tag = as || \"div\";\n\n\treturn <Tag className={clsx(styles.sticky, className)} ref={ref} {...rest} />;\n}) as AppComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport const App = Object.assign(AppComp, {\n\tHeader: forwardRef<HTMLElement, AppHeaderProps>(\n\t\tfunction AppHeader(rest, ref) {\n\t\t\treturn <header ref={ref} {...rest} />;\n\t\t},\n\t),\n\tSidebar: forwardRef<HTMLDialogElement, AppSidebarProps>(\n\t\tfunction AppSidebar(rest, ref) {\n\t\t\treturn <dialog role=\"navigation\" ref={ref} {...rest} />;\n\t\t},\n\t),\n\tSticky: AppSticky,\n\tToggle: forwardRef<HTMLButtonElement, ButtonProps<\"button\">>(\n\t\tfunction AppToggle({ children, ...rest }: ButtonProps<\"button\">, ref) {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tdata-command=\"toggle-app-expanded\"\n\t\t\t\t\tdata-tooltip=\"Vis meny\"\n\t\t\t\t\tref={ref as React.Ref<HTMLAnchorElement>}\n\t\t\t\t\t{...rest}\n\t\t\t\t>\n\t\t\t\t\t{children ?? \"Skjul meny\"}\n\t\t\t\t</Button>\n\t\t\t);\n\t\t},\n\t),\n\tMain: forwardRef<HTMLElement, AppMainProps>(function AppMain(rest, ref) {\n\t\treturn <main ref={ref} {...rest} />;\n\t}),\n\tFooter: forwardRef<HTMLElement, AppFooterProps>(\n\t\tfunction AppFooter(rest, ref) {\n\t\t\treturn <footer ref={ref} {...rest} />;\n\t\t},\n\t),\n\t// Needed to avoid flash of unstyled content and still be Next.js hydration compatible\n\tScript: () => <script id=\"mtds-app-script\">{script}</script>,\n});\n"],"names":["AppComp","forwardRef","as","className","rest","ref","jsx","clsx","styles","AppSticky","App","children","Button","script"],"mappings":";;;;;;AAsBA,MAAMA,IAAUC,EAAiB,SAE/B,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAsBC,GAA0B;AAGrE,SAAO,gBAAAC,EAFKJ,KAAM,OAEV,EAAI,WAAWK,EAAKC,EAAO,KAAKL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AACzE,CAAC,GAEKK,IAAYR,EAAiB,SAEjC,EAAE,IAAAC,GAAI,WAAAC,GAAW,GAAGC,EAAA,GAAsBC,GAA0B;AAGrE,SAAO,gBAAAC,EAFKJ,KAAM,OAEV,EAAI,WAAWK,EAAKC,EAAO,QAAQL,CAAS,GAAG,KAAAE,GAAW,GAAGD,EAAA,CAAM;AAC5E,CAAC,GAEYM,IAAM,OAAO,OAAOV,GAAS;AAAA,EACzC,QAAQC;AAAA,IACP,SAAmBG,GAAMC,GAAK;AAC7B,aAAO,gBAAAC,EAAC,UAAA,EAAO,KAAAD,GAAW,GAAGD,EAAA,CAAM;AAAA,IACpC;AAAA,EAAA;AAAA,EAED,SAASH;AAAA,IACR,SAAoBG,GAAMC,GAAK;AAC9B,+BAAQ,UAAA,EAAO,MAAK,cAAa,KAAAA,GAAW,GAAGD,GAAM;AAAA,IACtD;AAAA,EAAA;AAAA,EAED,QAAQK;AAAA,EACR,QAAQR;AAAA,IACP,SAAmB,EAAE,UAAAU,GAAU,GAAGP,EAAA,GAA+BC,GAAK;AACrE,aACC,gBAAAC;AAAA,QAACM;AAAA,QAAA;AAAA,UACA,gBAAa;AAAA,UACb,gBAAa;AAAA,UACb,KAAAP;AAAA,UACC,GAAGD;AAAA,UAEH,UAAAO,KAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAGhB;AAAA,EAAA;AAAA,EAED,MAAMV,EAAsC,SAAiBG,GAAMC,GAAK;AACvE,WAAO,gBAAAC,EAAC,QAAA,EAAK,KAAAD,GAAW,GAAGD,EAAA,CAAM;AAAA,EAClC,CAAC;AAAA,EACD,QAAQH;AAAA,IACP,SAAmBG,GAAMC,GAAK;AAC7B,aAAO,gBAAAC,EAAC,UAAA,EAAO,KAAAD,GAAW,GAAGD,EAAA,CAAM;AAAA,IACpC;AAAA,EAAA;AAAA;AAAA,EAGD,QAAQ,MAAM,gBAAAE,EAAC,UAAA,EAAO,IAAG,mBAAmB,UAAAO,EAAA,CAAO;AACpD,CAAC;"}
|
|
@@ -4,11 +4,37 @@ export { L };
|
|
|
4
4
|
export { MTDSAtlasMarkerElement } from './atlas-marker';
|
|
5
5
|
export { MTDSAtlasMatgeoElement } from './atlas-matgeo';
|
|
6
6
|
export { MTDSAtlasWMSElement } from './atlas-wms';
|
|
7
|
+
type Link = {
|
|
8
|
+
href: string;
|
|
9
|
+
rel: string;
|
|
10
|
+
type: string;
|
|
11
|
+
title: string;
|
|
12
|
+
};
|
|
13
|
+
type BBox = [number, number, number, number];
|
|
14
|
+
export type MTDSAtlasCollections = Record<string, MTDSAtlasCollection>;
|
|
15
|
+
export type MTDSAtlasCollection = {
|
|
16
|
+
crs: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
extent: {
|
|
19
|
+
spatial: {
|
|
20
|
+
bbox: BBox[];
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
geometry: string;
|
|
24
|
+
id: string;
|
|
25
|
+
itemType: string;
|
|
26
|
+
links: Link[];
|
|
27
|
+
title: string;
|
|
28
|
+
};
|
|
7
29
|
declare global {
|
|
8
30
|
interface HTMLElementTagNameMap {
|
|
9
31
|
"mtds-atlas": MTDSAtlasElement;
|
|
10
32
|
}
|
|
33
|
+
interface Window {
|
|
34
|
+
_matgeoCollections?: Promise<MTDSAtlasCollections>;
|
|
35
|
+
}
|
|
11
36
|
}
|
|
37
|
+
export declare const MATGEO_URL = "https://matgeoservice-256616427209.europe-north1.run.app/ogc/features/collections";
|
|
12
38
|
export declare class MTDSAtlasElement extends MTDSElement {
|
|
13
39
|
#private;
|
|
14
40
|
cluster?: L.MarkerClusterGroup;
|
|
@@ -20,4 +46,5 @@ export declare class MTDSAtlasElement extends MTDSElement {
|
|
|
20
46
|
setView(view: string | number[], opts?: L.FitBoundsOptions): L.Map | undefined;
|
|
21
47
|
latLngFromPoint(x: number, y: number): any;
|
|
22
48
|
disconnectedCallback(): void;
|
|
49
|
+
getCollections(): Promise<MTDSAtlasCollections>;
|
|
23
50
|
}
|
|
@@ -1,124 +1,103 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import i from "../external/leaflet/dist/leaflet-src.js";
|
|
2
|
+
import f from "../external/leaflet/dist/leaflet.css.js";
|
|
3
3
|
import "./cluster.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { MTDSAtlasMarkerElement } from "./atlas-marker.js";
|
|
7
|
-
import { MTDSAtlasMatgeoElement } from "./atlas-matgeo.js";
|
|
8
|
-
import { MTDSAtlasWMSElement } from "./atlas-wms.js";
|
|
9
|
-
let
|
|
10
|
-
const
|
|
11
|
-
const KARTVERKET_TILES_URL = "https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png";
|
|
12
|
-
const BOUNDS_NORWAY = [
|
|
4
|
+
import { isBrowser as u, defineElement as g, MTDSElement as C, tag as r, attr as l, on as v, off as w } from "../utils.js";
|
|
5
|
+
import b from "./atlas.css.js";
|
|
6
|
+
import { MTDSAtlasMarkerElement as O } from "./atlas-marker.js";
|
|
7
|
+
import { MTDSAtlasMatgeoElement as R } from "./atlas-matgeo.js";
|
|
8
|
+
import { MTDSAtlasWMSElement as D } from "./atlas-wms.js";
|
|
9
|
+
let c = 0;
|
|
10
|
+
const d = 18, k = "https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png", S = "https://matgeoservice-256616427209.europe-north1.run.app/ogc/features/collections", E = [
|
|
13
11
|
[57.5, 4.73],
|
|
14
12
|
[71.5, 31.44]
|
|
15
13
|
];
|
|
16
|
-
|
|
14
|
+
u() && !window._matgeoCollections && (window._matgeoCollections = fetch(S).then((a) => a.json()).then((a) => a.collections.map((t) => [t.id, t])).then(Object.fromEntries));
|
|
15
|
+
class m extends C {
|
|
17
16
|
cluster;
|
|
18
17
|
map;
|
|
19
18
|
static get observedAttributes() {
|
|
20
19
|
return ["data-view", "data-scrollzoom"];
|
|
21
20
|
}
|
|
22
21
|
constructor() {
|
|
23
|
-
super()
|
|
24
|
-
|
|
25
|
-
tag(
|
|
22
|
+
super(), this.attachShadow({ mode: "open" }).append(
|
|
23
|
+
r(
|
|
26
24
|
"style",
|
|
27
25
|
null,
|
|
28
|
-
`@layer leaflet{${
|
|
29
|
-
@layer mt.v2-2-
|
|
26
|
+
`@layer leaflet{${f}}
|
|
27
|
+
@layer mt.v2-2-30design{${b}`
|
|
30
28
|
),
|
|
31
|
-
|
|
29
|
+
r("figure")
|
|
32
30
|
);
|
|
33
31
|
}
|
|
34
32
|
connectedCallback() {
|
|
35
|
-
const
|
|
36
|
-
const cluster = attr(this, "data-cluster") ?? "false";
|
|
37
|
-
const tiles = new L.TileLayer(KARTVERKET_TILES_URL, {
|
|
33
|
+
const t = this.shadowRoot?.lastElementChild, o = l(this, "data-cluster") ?? "false", e = new i.TileLayer(k, {
|
|
38
34
|
attribution: "© Kartverket",
|
|
39
35
|
className: "leaflet-kartverket-tiles",
|
|
40
|
-
maxZoom:
|
|
36
|
+
maxZoom: d
|
|
41
37
|
});
|
|
42
|
-
this.map = new
|
|
43
|
-
attributionControl:
|
|
44
|
-
fadeAnimation:
|
|
38
|
+
this.map = new i.Map(t, {
|
|
39
|
+
attributionControl: !1,
|
|
40
|
+
fadeAnimation: !1,
|
|
45
41
|
// Prevent popup fades
|
|
46
|
-
layers: [
|
|
47
|
-
zoomControl:
|
|
42
|
+
layers: [e],
|
|
43
|
+
zoomControl: !1,
|
|
48
44
|
zoomSnap: 0.2
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
zoomToBoundsOnClick: true,
|
|
56
|
-
showCoverageOnHover: false,
|
|
57
|
-
disableClusteringAtZoom: cluster === "false" ? 1 : Number(cluster) || KARTVERKET_MAX_ZOOM + 1,
|
|
58
|
-
iconCreateFunction: (cluster2) => new L.DivIcon({
|
|
59
|
-
html: `${cluster2.getChildCount()}`,
|
|
45
|
+
}), v(this, "pointerup,click", this.#t), this.map.addControl(new i.Control.Attribution({ prefix: "" })), this.map.addControl(new i.Control.Zoom({ position: "bottomright" })), this.map.on("popupopen popupclose", this.#e, this), this.cluster = new i.MarkerClusterGroup({
|
|
46
|
+
zoomToBoundsOnClick: !0,
|
|
47
|
+
showCoverageOnHover: !1,
|
|
48
|
+
disableClusteringAtZoom: o === "false" ? 1 : Number(o) || d + 1,
|
|
49
|
+
iconCreateFunction: (s) => new i.DivIcon({
|
|
50
|
+
html: `${s.getChildCount()}`,
|
|
60
51
|
className: "leaflet-cluster-icon",
|
|
61
52
|
iconSize: [30, 30]
|
|
62
53
|
})
|
|
63
54
|
}).addTo(this.map);
|
|
64
|
-
for (const
|
|
65
|
-
this.attributeChangedCallback(
|
|
55
|
+
for (const s of m.observedAttributes)
|
|
56
|
+
this.attributeChangedCallback(s, null, l(this, s));
|
|
66
57
|
}
|
|
67
|
-
attributeChangedCallback(
|
|
68
|
-
|
|
69
|
-
if (name === "data-scrollzoom")
|
|
70
|
-
this.map?.scrollWheelZoom[next === "false" ? "disable" : "enable"]();
|
|
58
|
+
attributeChangedCallback(t, o, e) {
|
|
59
|
+
t === "data-view" && this.setView(e || ""), t === "data-scrollzoom" && this.map?.scrollWheelZoom[e === "false" ? "disable" : "enable"]();
|
|
71
60
|
}
|
|
72
|
-
setView(
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
if (
|
|
76
|
-
if (
|
|
77
|
-
if (b?.isValid()) return this.map?.fitBounds(b.pad(0.1), opts);
|
|
61
|
+
setView(t, o) {
|
|
62
|
+
const e = `${t}`.split(",").map(parseFloat).filter(Number.isFinite), s = this.cluster?.getBounds();
|
|
63
|
+
if (e.length === 3) return this.map?.setView([e[0], e[1]], e[2], o);
|
|
64
|
+
if (t !== "fit") return this.map?.fitBounds(E, o);
|
|
65
|
+
if (s?.isValid()) return this.map?.fitBounds(s.pad(0.1), o);
|
|
78
66
|
this.cluster?.once("layeradd", () => {
|
|
79
67
|
setTimeout(() => this.setView("fit"), 50);
|
|
80
68
|
});
|
|
81
69
|
}
|
|
82
|
-
latLngFromPoint(
|
|
83
|
-
return this.map?.pointerEventToLatLng({ clientX:
|
|
70
|
+
latLngFromPoint(t, o) {
|
|
71
|
+
return this.map?.pointerEventToLatLng({ clientX: t, clientY: o });
|
|
84
72
|
}
|
|
85
73
|
disconnectedCallback() {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
w(this, "pointerup,click", this.#t), this.map?.remove(), this.map = this.cluster = void 0;
|
|
75
|
+
}
|
|
76
|
+
async getCollections() {
|
|
77
|
+
return window._matgeoCollections || Promise.resolve({});
|
|
89
78
|
}
|
|
90
|
-
#
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const id = cont?.textContent?.match(/^#(\S+)/)?.[1] || "";
|
|
95
|
-
const el = document.getElementById(slot?.name || id);
|
|
96
|
-
if (!el) return open && id && popup.close();
|
|
97
|
-
L.Util.setOptions(popup, { maxWidth: this.offsetWidth - 40 });
|
|
98
|
-
attr(el, "data-popover", open ? attr(el, "popover") : null);
|
|
99
|
-
attr(el, "popover", open ? null : attr(el, "data-popover"));
|
|
100
|
-
attr(el, "slot", open ? el.id : null);
|
|
101
|
-
if (open) popup.setContent(tag("slot", { name: el.id }));
|
|
79
|
+
#e({ type: t, popup: o }) {
|
|
80
|
+
const e = t === "popupopen", s = o.getElement()?.querySelector(".leaflet-popup-content"), h = s?.querySelector(":scope > slot"), p = s?.textContent?.match(/^#(\S+)/)?.[1] || "", n = document.getElementById(h?.name || p);
|
|
81
|
+
if (!n) return e && p && o.close();
|
|
82
|
+
i.Util.setOptions(o, { maxWidth: this.offsetWidth - 40 }), l(n, "data-popover", e ? l(n, "popover") : null), l(n, "popover", e ? null : l(n, "data-popover")), l(n, "slot", e ? n.id : null), e && o.setContent(r("slot", { name: n.id }));
|
|
102
83
|
}
|
|
103
|
-
#
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
SKIP_CLICK = 0;
|
|
108
|
-
}, 50);
|
|
84
|
+
#t(t) {
|
|
85
|
+
t.type === "click" ? c && t.stopPropagation?.() : document.body.classList.contains("leaflet-dragging") && (c = setTimeout(() => {
|
|
86
|
+
c = 0;
|
|
87
|
+
}, 50));
|
|
109
88
|
}
|
|
110
89
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
});
|
|
90
|
+
g("mtds-atlas", m);
|
|
91
|
+
u() && (i.Marker.prototype.options.icon = new i.DivIcon({
|
|
92
|
+
html: '<div class="leaflet-marker-generated-slot"><div class="leaflet-marker-generated-icon"></div></div>',
|
|
93
|
+
iconSize: [0, 0]
|
|
94
|
+
}));
|
|
117
95
|
export {
|
|
118
|
-
L,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
96
|
+
i as L,
|
|
97
|
+
S as MATGEO_URL,
|
|
98
|
+
m as MTDSAtlasElement,
|
|
99
|
+
O as MTDSAtlasMarkerElement,
|
|
100
|
+
R as MTDSAtlasMatgeoElement,
|
|
101
|
+
D as MTDSAtlasWMSElement
|
|
123
102
|
};
|
|
124
103
|
//# sourceMappingURL=atlas-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlas-element.js","sources":["../../designsystem/atlas/atlas-element.ts"],"sourcesContent":["import L from \"leaflet\";\nimport LeafletCSS from \"leaflet/dist/leaflet.css?raw\";\nimport type {} from \"leaflet.markercluster\"; // Extend L namespace\nimport \"./cluster.js\";\nimport {\n\tattr,\n\tdefineElement,\n\tisBrowser,\n\tMTDSElement,\n\toff,\n\ton,\n\ttag,\n} from \"../utils\";\nimport css from \"./atlas.css?raw\";\nexport { L };\nexport { MTDSAtlasMarkerElement } from \"./atlas-marker\";\nexport { MTDSAtlasMatgeoElement } from \"./atlas-matgeo\";\nexport { MTDSAtlasWMSElement } from \"./atlas-wms\";\n\n// TODO: Add minimum zoom level for adding markers (minimum 17 som standard?)\n// TODO: Add search helper (https://ws.geonorge.no/adresser/v1/openapi.json + https://ws.geonorge.no/adresser/v1/#/default/get_sok)\n// TODO: matgeo-autoload popover info\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-atlas\": MTDSAtlasElement;\n\t}\n}\n\nlet SKIP_CLICK: number | NodeJS.Timeout = 0;\nconst KARTVERKET_MAX_ZOOM = 18; // Kartverket does not support more than zoom level 18\nconst KARTVERKET_TILES_URL =\n\t\"https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png\";\nconst BOUNDS_NORWAY: L.LatLngBoundsLiteral = [\n\t[57.5, 4.73],\n\t[71.5, 31.44],\n];\n\nexport class MTDSAtlasElement extends MTDSElement {\n\tcluster?: L.MarkerClusterGroup;\n\tmap?: L.Map;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-view\", \"data-scrollzoom\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" }).append(\n\t\t\ttag(\n\t\t\t\t\"style\",\n\t\t\t\tnull,\n\t\t\t\t`@layer leaflet{${LeafletCSS}}\\n@layer mt.design{${css}`,\n\t\t\t),\n\t\t\ttag(\"figure\"),\n\t\t);\n\t}\n\tconnectedCallback() {\n\t\tconst container = this.shadowRoot?.lastElementChild as HTMLElement;\n\t\tconst cluster = attr(this, \"data-cluster\") ?? \"false\";\n\t\tconst tiles = new L.TileLayer(KARTVERKET_TILES_URL, {\n\t\t\tattribution: \"© Kartverket\",\n\t\t\tclassName: \"leaflet-kartverket-tiles\",\n\t\t\tmaxZoom: KARTVERKET_MAX_ZOOM,\n\t\t});\n\n\t\tthis.map = new L.Map(container, {\n\t\t\tattributionControl: false,\n\t\t\tfadeAnimation: false, // Prevent popup fades\n\t\t\tlayers: [tiles],\n\t\t\tzoomControl: false,\n\t\t\tzoomSnap: 0.2,\n\t\t});\n\n\t\ton(this, \"pointerup,click\", this.#skipClick); // Prevent clicks from bubbling up unless sent from Leaflet\n\t\tthis.map.addControl(new L.Control.Attribution({ prefix: \"\" }));\n\t\tthis.map.addControl(new L.Control.Zoom({ position: \"bottomright\" }));\n\t\tthis.map.on(\"popupopen popupclose\", this.#handlePopup, this);\n\t\tthis.cluster = new L.MarkerClusterGroup({\n\t\t\tzoomToBoundsOnClick: true,\n\t\t\tshowCoverageOnHover: false,\n\t\t\tdisableClusteringAtZoom:\n\t\t\t\tcluster === \"false\" ? 1 : Number(cluster) || KARTVERKET_MAX_ZOOM + 1,\n\t\t\ticonCreateFunction: (cluster: L.MarkerCluster) =>\n\t\t\t\tnew L.DivIcon({\n\t\t\t\t\thtml: `${cluster.getChildCount()}`,\n\t\t\t\t\tclassName: \"leaflet-cluster-icon\",\n\t\t\t\t\ticonSize: [30, 30],\n\t\t\t\t}),\n\t\t}).addTo(this.map);\n\n\t\t// Initial setup attributes\n\t\tfor (const name of MTDSAtlasElement.observedAttributes)\n\t\t\tthis.attributeChangedCallback(name, null, attr(this, name));\n\t}\n\tattributeChangedCallback(name: string, _prev?: null, next?: string | null) {\n\t\tif (name === \"data-view\") this.setView(next || \"\");\n\t\tif (name === \"data-scrollzoom\")\n\t\t\tthis.map?.scrollWheelZoom[next === \"false\" ? \"disable\" : \"enable\"]();\n\t}\n\tsetView(view: string | number[], opts?: L.FitBoundsOptions) {\n\t\tconst p = `${view}`.split(\",\").map(parseFloat).filter(Number.isFinite);\n\t\tconst b = this.cluster?.getBounds();\n\n\t\tif (p.length === 3) return this.map?.setView([p[0], p[1]], p[2], opts);\n\t\tif (view !== \"fit\") return this.map?.fitBounds(BOUNDS_NORWAY, opts);\n\t\tif (b?.isValid()) return this.map?.fitBounds(b.pad(0.1), opts);\n\t\tthis.cluster?.once(\"layeradd\", () => {\n\t\t\tsetTimeout(() => this.setView(\"fit\"), 50); // Add all markers before fitting\n\t\t});\n\t}\n\tlatLngFromPoint(x: number, y: number) {\n\t\t// @ts-expect-error -- Missing from Leaflet@2.0.0-alpha.1 types\n\t\treturn this.map?.pointerEventToLatLng({ clientX: x, clientY: y });\n\t}\n\tdisconnectedCallback() {\n\t\toff(this, \"pointerup,click\", this.#skipClick);\n\t\tthis.map?.remove();\n\t\tthis.map = this.cluster = undefined;\n\t}\n\t#handlePopup({ type, popup }: { type: string; popup: L.Popup }) {\n\t\tconst open = type === \"popupopen\";\n\t\tconst cont = popup.getElement()?.querySelector(\".leaflet-popup-content\");\n\t\tconst slot = cont?.querySelector<HTMLSlotElement>(\":scope > slot\");\n\t\tconst id = cont?.textContent?.match(/^#(\\S+)/)?.[1] || \"\";\n\t\tconst el = document.getElementById(slot?.name || id); // If content of popup is #id, replace with <slot>\n\n\t\tif (!el) return open && id && popup.close(); // Close popup if target element not found\n\t\tL.Util.setOptions(popup, { maxWidth: this.offsetWidth - 40 });\n\t\tattr(el, \"data-popover\", open ? attr(el, \"popover\") : null); // Store previous popover mode\n\t\tattr(el, \"popover\", open ? null : attr(el, \"data-popover\")); // But temporarily remove it so popover renders\n\t\tattr(el, \"slot\", open ? el.id : null); // Render popover in slot\n\t\tif (open) popup.setContent(tag(\"slot\", { name: el.id }));\n\t}\n\t#skipClick(event: Partial<MouseEvent>) {\n\t\tif (event.type === \"click\") SKIP_CLICK && event.stopPropagation?.();\n\t\telse if (document.body.classList.contains(\"leaflet-dragging\"))\n\t\t\tSKIP_CLICK = setTimeout(() => {\n\t\t\t\tSKIP_CLICK = 0;\n\t\t\t}, 50); // Was dragging, so skip succeeding click\n\t}\n}\n\ndefineElement(\"mtds-atlas\", MTDSAtlasElement);\n\nif (isBrowser())\n\tL.Marker.prototype.options.icon = new L.DivIcon({\n\t\thtml: '<div class=\"leaflet-marker-generated-slot\"><div class=\"leaflet-marker-generated-icon\"></div></div>',\n\t\ticonSize: [0, 0],\n\t});\n"],"names":["cluster"],"mappings":";;;;;;;;AA6BA,IAAI,aAAsC;AAC1C,MAAM,sBAAsB;AAC5B,MAAM,uBACL;AACD,MAAM,gBAAuC;AAAA,EAC5C,CAAC,MAAM,IAAI;AAAA,EACX,CAAC,MAAM,KAAK;AACb;AAEO,MAAM,yBAAyB,YAAY;AAAA,EACjD;AAAA,EACA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,aAAa,iBAAiB;AAAA,EACvC;AAAA,EACA,cAAc;AACb,UAAA;AACA,SAAK,aAAa,EAAE,MAAM,OAAA,CAAQ,EAAE;AAAA,MACnC;AAAA,QACC;AAAA,QACA;AAAA,QACA,kBAAkB,UAAU;AAAA,0BAA0B,GAAA;AAAA,MAAA;AAAA,MAEvD,IAAI,QAAQ;AAAA,IAAA;AAAA,EAEd;AAAA,EACA,oBAAoB;AACnB,UAAM,YAAY,KAAK,YAAY;AACnC,UAAM,UAAU,KAAK,MAAM,cAAc,KAAK;AAC9C,UAAM,QAAQ,IAAI,EAAE,UAAU,sBAAsB;AAAA,MACnD,aAAa;AAAA,MACb,WAAW;AAAA,MACX,SAAS;AAAA,IAAA,CACT;AAED,SAAK,MAAM,IAAI,EAAE,IAAI,WAAW;AAAA,MAC/B,oBAAoB;AAAA,MACpB,eAAe;AAAA;AAAA,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U,SAAS,kBAAkB;AAC3D,mBAAa,WAAW,MAAM;AAC7B,qBAAa;AAAA,MACd,GAAG,EAAE;AAAA,EACP;AACD;AAEA,cAAc,cAAc,gBAAgB;AAE5C,IAAI,UAAA;AACH,IAAE,OAAO,UAAU,QAAQ,OAAO,IAAI,EAAE,QAAQ;AAAA,IAC/C,MAAM;AAAA,IACN,UAAU,CAAC,GAAG,CAAC;AAAA,EAAA,CACf;"}
|
|
1
|
+
{"version":3,"file":"atlas-element.js","sources":["../../designsystem/atlas/atlas-element.ts"],"sourcesContent":["import L from \"leaflet\";\nimport LeafletCSS from \"leaflet/dist/leaflet.css?raw\";\nimport type {} from \"leaflet.markercluster\"; // Extend L namespace\nimport \"./cluster.js\";\nimport {\n\tattr,\n\tdefineElement,\n\tisBrowser,\n\tMTDSElement,\n\toff,\n\ton,\n\ttag,\n} from \"../utils\";\nimport css from \"./atlas.css?raw\";\nexport { L };\nexport { MTDSAtlasMarkerElement } from \"./atlas-marker\";\nexport { MTDSAtlasMatgeoElement } from \"./atlas-matgeo\";\nexport { MTDSAtlasWMSElement } from \"./atlas-wms\";\n\n// TODO: Add minimum zoom level for adding markers (minimum 17 som standard?)\n// TODO: Add search helper (https://ws.geonorge.no/adresser/v1/openapi.json + https://ws.geonorge.no/adresser/v1/#/default/get_sok)\n// TODO: matgeo-autoload popover info\n\ntype Link = { href: string; rel: string; type: string; title: string };\ntype BBox = [number, number, number, number];\nexport type MTDSAtlasCollections = Record<string, MTDSAtlasCollection>;\nexport type MTDSAtlasCollection = {\n\tcrs: string[];\n\tdescription: string;\n\textent: { spatial: { bbox: BBox[] } };\n\tgeometry: string;\n\tid: string;\n\titemType: string;\n\tlinks: Link[];\n\ttitle: string;\n};\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-atlas\": MTDSAtlasElement;\n\t}\n\n\tinterface Window {\n\t\t_matgeoCollections?: Promise<MTDSAtlasCollections>;\n\t}\n}\n\nlet SKIP_CLICK: number | NodeJS.Timeout = 0;\nconst KARTVERKET_MAX_ZOOM = 18; // Kartverket does not support more than zoom level 18\nconst KARTVERKET_TILES_URL =\n\t\"https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png\";\nexport const MATGEO_URL =\n\t\"https://matgeoservice-256616427209.europe-north1.run.app/ogc/features/collections\";\nconst BOUNDS_NORWAY: L.LatLngBoundsLiteral = [\n\t[57.5, 4.73],\n\t[71.5, 31.44],\n];\n\nif (isBrowser() && !window._matgeoCollections)\n\twindow._matgeoCollections = fetch(MATGEO_URL)\n\t\t.then((res) => res.json())\n\t\t.then((d) => d.collections.map((c: MTDSAtlasCollection) => [c.id, c]))\n\t\t.then(Object.fromEntries);\n\nexport class MTDSAtlasElement extends MTDSElement {\n\tcluster?: L.MarkerClusterGroup;\n\tmap?: L.Map;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-view\", \"data-scrollzoom\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" }).append(\n\t\t\ttag(\n\t\t\t\t\"style\",\n\t\t\t\tnull,\n\t\t\t\t`@layer leaflet{${LeafletCSS}}\\n@layer mt.design{${css}`,\n\t\t\t),\n\t\t\ttag(\"figure\"),\n\t\t);\n\t}\n\tconnectedCallback() {\n\t\tconst container = this.shadowRoot?.lastElementChild as HTMLElement;\n\t\tconst cluster = attr(this, \"data-cluster\") ?? \"false\";\n\t\tconst tiles = new L.TileLayer(KARTVERKET_TILES_URL, {\n\t\t\tattribution: \"© Kartverket\",\n\t\t\tclassName: \"leaflet-kartverket-tiles\",\n\t\t\tmaxZoom: KARTVERKET_MAX_ZOOM,\n\t\t});\n\n\t\tthis.map = new L.Map(container, {\n\t\t\tattributionControl: false,\n\t\t\tfadeAnimation: false, // Prevent popup fades\n\t\t\tlayers: [tiles],\n\t\t\tzoomControl: false,\n\t\t\tzoomSnap: 0.2,\n\t\t});\n\n\t\ton(this, \"pointerup,click\", this.#skipClick); // Prevent clicks from bubbling up unless sent from Leaflet\n\t\tthis.map.addControl(new L.Control.Attribution({ prefix: \"\" }));\n\t\tthis.map.addControl(new L.Control.Zoom({ position: \"bottomright\" }));\n\t\tthis.map.on(\"popupopen popupclose\", this.#handlePopup, this);\n\t\tthis.cluster = new L.MarkerClusterGroup({\n\t\t\tzoomToBoundsOnClick: true,\n\t\t\tshowCoverageOnHover: false,\n\t\t\tdisableClusteringAtZoom:\n\t\t\t\tcluster === \"false\" ? 1 : Number(cluster) || KARTVERKET_MAX_ZOOM + 1,\n\t\t\ticonCreateFunction: (cluster: L.MarkerCluster) =>\n\t\t\t\tnew L.DivIcon({\n\t\t\t\t\thtml: `${cluster.getChildCount()}`,\n\t\t\t\t\tclassName: \"leaflet-cluster-icon\",\n\t\t\t\t\ticonSize: [30, 30],\n\t\t\t\t}),\n\t\t}).addTo(this.map);\n\n\t\t// Initial setup attributes\n\t\tfor (const name of MTDSAtlasElement.observedAttributes)\n\t\t\tthis.attributeChangedCallback(name, null, attr(this, name));\n\t}\n\tattributeChangedCallback(name: string, _prev?: null, next?: string | null) {\n\t\tif (name === \"data-view\") this.setView(next || \"\");\n\t\tif (name === \"data-scrollzoom\")\n\t\t\tthis.map?.scrollWheelZoom[next === \"false\" ? \"disable\" : \"enable\"]();\n\t}\n\tsetView(view: string | number[], opts?: L.FitBoundsOptions) {\n\t\tconst p = `${view}`.split(\",\").map(parseFloat).filter(Number.isFinite);\n\t\tconst b = this.cluster?.getBounds();\n\n\t\tif (p.length === 3) return this.map?.setView([p[0], p[1]], p[2], opts);\n\t\tif (view !== \"fit\") return this.map?.fitBounds(BOUNDS_NORWAY, opts);\n\t\tif (b?.isValid()) return this.map?.fitBounds(b.pad(0.1), opts);\n\t\tthis.cluster?.once(\"layeradd\", () => {\n\t\t\tsetTimeout(() => this.setView(\"fit\"), 50); // Add all markers before fitting\n\t\t});\n\t}\n\tlatLngFromPoint(x: number, y: number) {\n\t\t// @ts-expect-error -- Missing from Leaflet@2.0.0-alpha.1 types\n\t\treturn this.map?.pointerEventToLatLng({ clientX: x, clientY: y });\n\t}\n\tdisconnectedCallback() {\n\t\toff(this, \"pointerup,click\", this.#skipClick);\n\t\tthis.map?.remove();\n\t\tthis.map = this.cluster = undefined;\n\t}\n\tasync getCollections() {\n\t\treturn (\n\t\t\twindow._matgeoCollections || Promise.resolve({} as MTDSAtlasCollections)\n\t\t);\n\t}\n\t#handlePopup({ type, popup }: { type: string; popup: L.Popup }) {\n\t\tconst open = type === \"popupopen\";\n\t\tconst cont = popup.getElement()?.querySelector(\".leaflet-popup-content\");\n\t\tconst slot = cont?.querySelector<HTMLSlotElement>(\":scope > slot\");\n\t\tconst id = cont?.textContent?.match(/^#(\\S+)/)?.[1] || \"\";\n\t\tconst el = document.getElementById(slot?.name || id); // If content of popup is #id, replace with <slot>\n\n\t\tif (!el) return open && id && popup.close(); // Close popup if target element not found\n\t\tL.Util.setOptions(popup, { maxWidth: this.offsetWidth - 40 });\n\t\tattr(el, \"data-popover\", open ? attr(el, \"popover\") : null); // Store previous popover mode\n\t\tattr(el, \"popover\", open ? null : attr(el, \"data-popover\")); // But temporarily remove it so popover renders\n\t\tattr(el, \"slot\", open ? el.id : null); // Render popover in slot\n\t\tif (open) popup.setContent(tag(\"slot\", { name: el.id }));\n\t}\n\t#skipClick(event: Partial<MouseEvent>) {\n\t\tif (event.type === \"click\") SKIP_CLICK && event.stopPropagation?.();\n\t\telse if (document.body.classList.contains(\"leaflet-dragging\"))\n\t\t\tSKIP_CLICK = setTimeout(() => {\n\t\t\t\tSKIP_CLICK = 0;\n\t\t\t}, 50); // Was dragging, so skip succeeding click\n\t}\n}\n\ndefineElement(\"mtds-atlas\", MTDSAtlasElement);\n\nif (isBrowser())\n\tL.Marker.prototype.options.icon = new L.DivIcon({\n\t\thtml: '<div class=\"leaflet-marker-generated-slot\"><div class=\"leaflet-marker-generated-icon\"></div></div>',\n\t\ticonSize: [0, 0],\n\t});\n"],"names":["SKIP_CLICK","KARTVERKET_MAX_ZOOM","KARTVERKET_TILES_URL","MATGEO_URL","BOUNDS_NORWAY","isBrowser","res","d","c","MTDSAtlasElement","MTDSElement","tag","LeafletCSS","css","container","cluster","attr","tiles","L","on","#skipClick","#handlePopup","name","_prev","next","view","opts","p","b","x","y","off","type","popup","open","cont","slot","id","el","event","defineElement"],"mappings":";;;;;;;;AA+CA,IAAIA,IAAsC;AAC1C,MAAMC,IAAsB,IACtBC,IACL,sFACYC,IACZ,qFACKC,IAAuC;AAAA,EAC5C,CAAC,MAAM,IAAI;AAAA,EACX,CAAC,MAAM,KAAK;AACb;AAEIC,EAAA,KAAe,CAAC,OAAO,uBAC1B,OAAO,qBAAqB,MAAMF,CAAU,EAC1C,KAAK,CAACG,MAAQA,EAAI,MAAM,EACxB,KAAK,CAACC,MAAMA,EAAE,YAAY,IAAI,CAACC,MAA2B,CAACA,EAAE,IAAIA,CAAC,CAAC,CAAC,EACpE,KAAK,OAAO,WAAW;AAEnB,MAAMC,UAAyBC,EAAY;AAAA,EACjD;AAAA,EACA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,aAAa,iBAAiB;AAAA,EACvC;AAAA,EACA,cAAc;AACb,UAAA,GACA,KAAK,aAAa,EAAE,MAAM,OAAA,CAAQ,EAAE;AAAA,MACnCC;AAAA,QACC;AAAA,QACA;AAAA,QACA,kBAAkBC,CAAU;AAAA,0BAA0BC,CAAA;AAAA,MAAA;AAAA,MAEvDF,EAAI,QAAQ;AAAA,IAAA;AAAA,EAEd;AAAA,EACA,oBAAoB;AACnB,UAAMG,IAAY,KAAK,YAAY,kBAC7BC,IAAUC,EAAK,MAAM,cAAc,KAAK,SACxCC,IAAQ,IAAIC,EAAE,UAAUhB,GAAsB;AAAA,MACnD,aAAa;AAAA,MACb,WAAW;AAAA,MACX,SAASD;AAAA,IAAA,CACT;AAED,SAAK,MAAM,IAAIiB,EAAE,IAAIJ,GAAW;AAAA,MAC/B,oBAAoB;AA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AAG,KAAK,IAAI,GAChCJ,KAAMD,EAAM,WAAWtB,EAAI,QAAQ,EAAE,MAAM2B,EAAG,GAAA,CAAI,CAAC;AAAA,EACxD;AAAA,EACAlB,GAAWmB,GAA4B;AACtC,IAAIA,EAAM,SAAS,UAASvC,KAAcuC,EAAM,kBAAA,IACvC,SAAS,KAAK,UAAU,SAAS,kBAAkB,MAC3DvC,IAAa,WAAW,MAAM;AAC7B,MAAAA,IAAa;AAAA,IACd,GAAG,EAAE;AAAA,EACP;AACD;AAEAwC,EAAc,cAAc/B,CAAgB;AAExCJ,EAAA,MACHa,EAAE,OAAO,UAAU,QAAQ,OAAO,IAAIA,EAAE,QAAQ;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,CAAC,GAAG,CAAC;AAAA,CACf;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineElement, MTDSElement, tag, attr, on, off } from "../utils.js";
|
|
3
|
-
let
|
|
4
|
-
class
|
|
1
|
+
import i from "../external/leaflet/dist/leaflet-src.js";
|
|
2
|
+
import { defineElement as d, MTDSElement as o, tag as g, attr as s, on as h, off as c } from "../utils.js";
|
|
3
|
+
let l = 0;
|
|
4
|
+
class k extends o {
|
|
5
5
|
atlas;
|
|
6
6
|
marker;
|
|
7
7
|
static get observedAttributes() {
|
|
@@ -9,65 +9,45 @@ class MTDSAtlasMarkerElement extends MTDSElement {
|
|
|
9
9
|
}
|
|
10
10
|
connectedCallback() {
|
|
11
11
|
queueMicrotask(() => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
this.atlas = this.closest("mtds-atlas") || void 0;
|
|
15
|
-
this.marker = new L.Marker(this.#parseLatLng(), {
|
|
12
|
+
const t = g("slot", { name: `${++l}` }), e = new i.DivIcon({ html: t, iconSize: [0, 0] });
|
|
13
|
+
this.atlas = this.closest("mtds-atlas") || void 0, this.marker = new i.Marker(this.#t(), {
|
|
16
14
|
draggable: this.draggable,
|
|
17
|
-
keyboard:
|
|
18
|
-
icon
|
|
19
|
-
});
|
|
20
|
-
this.marker.bindPopup(() => `#${attr(this, "popovertarget")}`);
|
|
21
|
-
this.marker.on("dragend", this.#handleDragEnd);
|
|
22
|
-
on(this, "click,keydown", this);
|
|
23
|
-
attr(this, "slot", `${SLOT}`);
|
|
24
|
-
attr(this, "role", "button");
|
|
25
|
-
attr(this, "tabindex", "0");
|
|
26
|
-
this.attributeChangedCallback("hidden");
|
|
15
|
+
keyboard: !1,
|
|
16
|
+
icon: e
|
|
17
|
+
}), this.marker.bindPopup(() => `#${s(this, "popovertarget")}`), this.marker.on("dragend", this.#e), h(this, "click,keydown", this), s(this, "slot", `${l}`), s(this, "role", "button"), s(this, "tabindex", "0"), this.attributeChangedCallback("hidden");
|
|
27
18
|
});
|
|
28
19
|
}
|
|
29
|
-
attributeChangedCallback(
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const latlng = this.#parseLatLng();
|
|
35
|
-
mark?.getLatLng().equals(latlng) || mark?.setLatLng(latlng);
|
|
20
|
+
attributeChangedCallback(t) {
|
|
21
|
+
const e = this.marker, a = this.atlas?.cluster;
|
|
22
|
+
if (t === "popovertarget" && e?.getPopup()?.update(), t === "data-latlng") {
|
|
23
|
+
const r = this.#t();
|
|
24
|
+
e?.getLatLng().equals(r) || e?.setLatLng(r);
|
|
36
25
|
}
|
|
37
|
-
|
|
38
|
-
mark?.dragging?.[this.draggable ? "enable" : "disable"]();
|
|
39
|
-
if (name === "hidden" && mark && cluster)
|
|
40
|
-
cluster[this.hidden ? "removeLayer" : "addLayer"](mark);
|
|
26
|
+
t === "draggable" && e?.dragging?.[this.draggable ? "enable" : "disable"](), t === "hidden" && e && a && a[this.hidden ? "removeLayer" : "addLayer"](e);
|
|
41
27
|
}
|
|
42
28
|
disconnectedCallback() {
|
|
43
|
-
|
|
44
|
-
this.marker?.unbindPopup().off("dragend", this.#handleDragEnd).remove();
|
|
45
|
-
this.marker = this.atlas = void 0;
|
|
29
|
+
c(this, "click,keydown", this), this.marker?.unbindPopup().off("dragend", this.#e).remove(), this.marker = this.atlas = void 0;
|
|
46
30
|
}
|
|
47
|
-
handleEvent(
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
if (event.key === " " || event.key === "Enter") this.click();
|
|
31
|
+
handleEvent(t) {
|
|
32
|
+
if (t.type === "click") return this.marker?.fire("click");
|
|
33
|
+
t.key === " " && t.preventDefault(), (t.key === " " || t.key === "Enter") && this.click();
|
|
51
34
|
}
|
|
52
35
|
get latlng() {
|
|
53
|
-
return
|
|
36
|
+
return s(this, "data-latlng") || "";
|
|
54
37
|
}
|
|
55
|
-
set latlng(
|
|
56
|
-
|
|
38
|
+
set latlng(t) {
|
|
39
|
+
s(this, "data-latlng", t);
|
|
57
40
|
}
|
|
58
|
-
#
|
|
41
|
+
#t() {
|
|
59
42
|
return this.latlng?.split(",").map(parseFloat);
|
|
60
43
|
}
|
|
61
|
-
#
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
const { lat, lng } = detail.target.getLatLng();
|
|
65
|
-
if (self) self.latlng = `${lat},${lng}`;
|
|
66
|
-
self?.dispatchEvent(new CustomEvent("dragend", { detail, bubbles: true }));
|
|
44
|
+
#e(t) {
|
|
45
|
+
const a = t.target._icon?.firstElementChild?.assignedElements?.()?.[0], { lat: r, lng: n } = t.target.getLatLng();
|
|
46
|
+
a && (a.latlng = `${r},${n}`), a?.dispatchEvent(new CustomEvent("dragend", { detail: t, bubbles: !0 }));
|
|
67
47
|
}
|
|
68
48
|
}
|
|
69
|
-
|
|
49
|
+
d("mtds-atlas-marker", k);
|
|
70
50
|
export {
|
|
71
|
-
MTDSAtlasMarkerElement
|
|
51
|
+
k as MTDSAtlasMarkerElement
|
|
72
52
|
};
|
|
73
53
|
//# sourceMappingURL=atlas-marker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlas-marker.js","sources":["../../designsystem/atlas/atlas-marker.ts"],"sourcesContent":["import L from \"leaflet\";\nimport { attr, defineElement, MTDSElement, off, on, tag } from \"../utils\";\nimport type { MTDSAtlasElement } from \"./atlas-element\";\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-atlas-marker\": MTDSAtlasMarkerElement;\n\t}\n}\n\nlet SLOT = 0;\nexport class MTDSAtlasMarkerElement extends MTDSElement {\n\tatlas?: MTDSAtlasElement;\n\tmarker?: L.Marker;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"hidden\", \"draggable\", \"data-latlng\", \"popovertarget\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconnectedCallback() {\n\t\tqueueMicrotask(() => {\n\t\t\tconst html = tag(\"slot\", { name: `${++SLOT}` });\n\t\t\tconst icon = new L.DivIcon({ html, iconSize: [0, 0] });\n\t\t\tthis.atlas = this.closest<MTDSAtlasElement>(\"mtds-atlas\") || undefined;\n\t\t\tthis.marker = new L.Marker(this.#parseLatLng(), {\n\t\t\t\tdraggable: this.draggable,\n\t\t\t\tkeyboard: false,\n\t\t\t\ticon,\n\t\t\t});\n\t\t\tthis.marker.bindPopup(() => `#${attr(this, \"popovertarget\")}`);\n\t\t\tthis.marker.on(\"dragend\", this.#handleDragEnd);\n\n\t\t\ton(this, \"click,keydown\", this); // Listen for clicks to toggle popup\n\t\t\tattr(this, \"slot\", `${SLOT}`); // Link slot to marker icon\n\t\t\tattr(this, \"role\", \"button\");\n\t\t\tattr(this, \"tabindex\", \"0\");\n\t\t\tthis.attributeChangedCallback(\"hidden\"); // Maybe add to map\n\t\t}); // Let the atlas parent initialize first\n\t}\n\tattributeChangedCallback(name: string) {\n\t\tconst mark = this.marker;\n\t\tconst cluster = this.atlas?.cluster;\n\t\tif (name === \"popovertarget\") mark?.getPopup()?.update();\n\t\tif (name === \"data-latlng\") {\n\t\t\tconst latlng = this.#parseLatLng();\n\t\t\tmark?.getLatLng().equals(latlng) || mark?.setLatLng(latlng);\n\t\t}\n\t\tif (name === \"draggable\")\n\t\t\tmark?.dragging?.[this.draggable ? \"enable\" : \"disable\"]();\n\t\tif (name === \"hidden\" && mark && cluster)\n\t\t\tcluster[this.hidden ? \"removeLayer\" : \"addLayer\"](mark);\n\t}\n\tdisconnectedCallback() {\n\t\toff(this, \"click,keydown\", this);\n\t\tthis.marker?.unbindPopup().off(\"dragend\", this.#handleDragEnd).remove();\n\t\tthis.marker = this.atlas = undefined;\n\t}\n\thandleEvent(event: KeyboardEvent) {\n\t\tif (event.type === \"click\") return this.marker?.fire(\"click\"); //this.atlas?.togglePopup(this.marker, this);\n\t\tif (event.key === \" \") event.preventDefault(); // Prevent page scroll on space key\n\t\tif (event.key === \" \" || event.key === \"Enter\") this.click(); // Forward keyvoard to click for accessibility\n\t}\n\tget latlng() {\n\t\treturn attr(this, \"data-latlng\") || \"\";\n\t}\n\tset latlng(latlng: string) {\n\t\tattr(this, \"data-latlng\", latlng);\n\t}\n\t#parseLatLng() {\n\t\treturn this.latlng?.split(\",\").map(parseFloat) as L.LatLngTuple;\n\t}\n\t#handleDragEnd(detail: L.LeafletEvent) {\n\t\tconst slot = detail.target._icon\n\t\t\t?.firstElementChild as HTMLSlotElement | null;\n\t\tconst self =\n\t\t\tslot?.assignedElements?.()?.[0] as MTDSAtlasMarkerElement | null;\n\t\tconst { lat, lng } = detail.target.getLatLng(); // Using L.Marker.getLatLng() to get position also when in spiderified cluster\n\t\tif (self) self.latlng = `${lat},${lng}`;\n\t\tself?.dispatchEvent(new CustomEvent(\"dragend\", { detail, bubbles: true }));\n\t}\n}\n\ndefineElement(\"mtds-atlas-marker\", MTDSAtlasMarkerElement);\n"],"names":[],"mappings":";;AAUA,
|
|
1
|
+
{"version":3,"file":"atlas-marker.js","sources":["../../designsystem/atlas/atlas-marker.ts"],"sourcesContent":["import L from \"leaflet\";\nimport { attr, defineElement, MTDSElement, off, on, tag } from \"../utils\";\nimport type { MTDSAtlasElement } from \"./atlas-element\";\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-atlas-marker\": MTDSAtlasMarkerElement;\n\t}\n}\n\nlet SLOT = 0;\nexport class MTDSAtlasMarkerElement extends MTDSElement {\n\tatlas?: MTDSAtlasElement;\n\tmarker?: L.Marker;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"hidden\", \"draggable\", \"data-latlng\", \"popovertarget\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconnectedCallback() {\n\t\tqueueMicrotask(() => {\n\t\t\tconst html = tag(\"slot\", { name: `${++SLOT}` });\n\t\t\tconst icon = new L.DivIcon({ html, iconSize: [0, 0] });\n\t\t\tthis.atlas = this.closest<MTDSAtlasElement>(\"mtds-atlas\") || undefined;\n\t\t\tthis.marker = new L.Marker(this.#parseLatLng(), {\n\t\t\t\tdraggable: this.draggable,\n\t\t\t\tkeyboard: false,\n\t\t\t\ticon,\n\t\t\t});\n\t\t\tthis.marker.bindPopup(() => `#${attr(this, \"popovertarget\")}`);\n\t\t\tthis.marker.on(\"dragend\", this.#handleDragEnd);\n\n\t\t\ton(this, \"click,keydown\", this); // Listen for clicks to toggle popup\n\t\t\tattr(this, \"slot\", `${SLOT}`); // Link slot to marker icon\n\t\t\tattr(this, \"role\", \"button\");\n\t\t\tattr(this, \"tabindex\", \"0\");\n\t\t\tthis.attributeChangedCallback(\"hidden\"); // Maybe add to map\n\t\t}); // Let the atlas parent initialize first\n\t}\n\tattributeChangedCallback(name: string) {\n\t\tconst mark = this.marker;\n\t\tconst cluster = this.atlas?.cluster;\n\t\tif (name === \"popovertarget\") mark?.getPopup()?.update();\n\t\tif (name === \"data-latlng\") {\n\t\t\tconst latlng = this.#parseLatLng();\n\t\t\tmark?.getLatLng().equals(latlng) || mark?.setLatLng(latlng);\n\t\t}\n\t\tif (name === \"draggable\")\n\t\t\tmark?.dragging?.[this.draggable ? \"enable\" : \"disable\"]();\n\t\tif (name === \"hidden\" && mark && cluster)\n\t\t\tcluster[this.hidden ? \"removeLayer\" : \"addLayer\"](mark);\n\t}\n\tdisconnectedCallback() {\n\t\toff(this, \"click,keydown\", this);\n\t\tthis.marker?.unbindPopup().off(\"dragend\", this.#handleDragEnd).remove();\n\t\tthis.marker = this.atlas = undefined;\n\t}\n\thandleEvent(event: KeyboardEvent) {\n\t\tif (event.type === \"click\") return this.marker?.fire(\"click\"); //this.atlas?.togglePopup(this.marker, this);\n\t\tif (event.key === \" \") event.preventDefault(); // Prevent page scroll on space key\n\t\tif (event.key === \" \" || event.key === \"Enter\") this.click(); // Forward keyvoard to click for accessibility\n\t}\n\tget latlng() {\n\t\treturn attr(this, \"data-latlng\") || \"\";\n\t}\n\tset latlng(latlng: string) {\n\t\tattr(this, \"data-latlng\", latlng);\n\t}\n\t#parseLatLng() {\n\t\treturn this.latlng?.split(\",\").map(parseFloat) as L.LatLngTuple;\n\t}\n\t#handleDragEnd(detail: L.LeafletEvent) {\n\t\tconst slot = detail.target._icon\n\t\t\t?.firstElementChild as HTMLSlotElement | null;\n\t\tconst self =\n\t\t\tslot?.assignedElements?.()?.[0] as MTDSAtlasMarkerElement | null;\n\t\tconst { lat, lng } = detail.target.getLatLng(); // Using L.Marker.getLatLng() to get position also when in spiderified cluster\n\t\tif (self) self.latlng = `${lat},${lng}`;\n\t\tself?.dispatchEvent(new CustomEvent(\"dragend\", { detail, bubbles: true }));\n\t}\n}\n\ndefineElement(\"mtds-atlas-marker\", MTDSAtlasMarkerElement);\n"],"names":["SLOT","MTDSAtlasMarkerElement","MTDSElement","html","tag","icon","L","#parseLatLng","attr","#handleDragEnd","on","name","mark","cluster","latlng","off","event","detail","self","lat","lng","defineElement"],"mappings":";;AAUA,IAAIA,IAAO;AACJ,MAAMC,UAA+BC,EAAY;AAAA,EACvD;AAAA,EACA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,UAAU,aAAa,eAAe,eAAe;AAAA,EAC9D;AAAA,EACA,oBAAoB;AACnB,mBAAe,MAAM;AACpB,YAAMC,IAAOC,EAAI,QAAQ,EAAE,MAAM,GAAG,EA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