@mattilsynet/design 3.3.10 → 3.4.1

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.
Files changed (191) hide show
  1. package/mtds/_virtual/_rolldown/runtime.js +17 -0
  2. package/mtds/ai/card.stories.tsx +54 -77
  3. package/mtds/ai/layout.mdx +37 -1
  4. package/mtds/ai/layout.stories.tsx +126 -1
  5. package/mtds/ai/print.mdx +1 -1
  6. package/mtds/ai/print.stories.tsx +1 -2
  7. package/mtds/alert/alert.js +16 -11
  8. package/mtds/alert/alert.js.map +1 -1
  9. package/mtds/analytics/analytics.js +118 -118
  10. package/mtds/analytics/analytics.js.map +1 -1
  11. package/mtds/app/app-observer.js +31 -36
  12. package/mtds/app/app-observer.js.map +1 -1
  13. package/mtds/app/app-toggle.js +12 -26
  14. package/mtds/app/app-toggle.js.map +1 -1
  15. package/mtds/app/app-toggle2.js +6 -11
  16. package/mtds/app/app-toggle2.js.map +1 -1
  17. package/mtds/app/app.js +66 -60
  18. package/mtds/app/app.js.map +1 -1
  19. package/mtds/atlas/atlas-element.js +83 -93
  20. package/mtds/atlas/atlas-element.js.map +1 -1
  21. package/mtds/atlas/atlas-marker.js +63 -52
  22. package/mtds/atlas/atlas-marker.js.map +1 -1
  23. package/mtds/atlas/atlas-matgeo.js +67 -61
  24. package/mtds/atlas/atlas-matgeo.js.map +1 -1
  25. package/mtds/atlas/atlas-wms.js +33 -28
  26. package/mtds/atlas/atlas-wms.js.map +1 -1
  27. package/mtds/atlas/atlas.js +6 -38
  28. package/mtds/atlas/atlas.js.map +1 -1
  29. package/mtds/atlas/atlas2.js +39 -0
  30. package/mtds/atlas/atlas2.js.map +1 -0
  31. package/mtds/atlas/cluster.js +759 -1149
  32. package/mtds/atlas/cluster.js.map +1 -1
  33. package/mtds/atlas.iife.js +3 -4
  34. package/mtds/atlas.js +6 -14
  35. package/mtds/avatar/avatar.js +14 -10
  36. package/mtds/avatar/avatar.js.map +1 -1
  37. package/mtds/badge/badge.js +15 -10
  38. package/mtds/badge/badge.js.map +1 -1
  39. package/mtds/breadcrumbs/breadcrumbs.js +15 -19
  40. package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
  41. package/mtds/button/button.js +18 -20
  42. package/mtds/button/button.js.map +1 -1
  43. package/mtds/card/card.js +22 -15
  44. package/mtds/card/card.js.map +1 -1
  45. package/mtds/chart/chart-axis.js +33 -21
  46. package/mtds/chart/chart-axis.js.map +1 -1
  47. package/mtds/chart/chart-bars.js +23 -21
  48. package/mtds/chart/chart-bars.js.map +1 -1
  49. package/mtds/chart/chart-element.js +94 -88
  50. package/mtds/chart/chart-element.js.map +1 -1
  51. package/mtds/chart/chart-lines.js +35 -37
  52. package/mtds/chart/chart-lines.js.map +1 -1
  53. package/mtds/chart/chart-pies.js +17 -17
  54. package/mtds/chart/chart-pies.js.map +1 -1
  55. package/mtds/chart/chart.js +6 -52
  56. package/mtds/chart/chart.js.map +1 -1
  57. package/mtds/chart/chart2.js +21 -0
  58. package/mtds/chart/chart2.js.map +1 -0
  59. package/mtds/chip/chip.js +15 -11
  60. package/mtds/chip/chip.js.map +1 -1
  61. package/mtds/deprecations.js +76 -158
  62. package/mtds/deprecations.js.map +1 -1
  63. package/mtds/details/details.js +21 -24
  64. package/mtds/details/details.js.map +1 -1
  65. package/mtds/dialog/dialog.js +17 -21
  66. package/mtds/dialog/dialog.js.map +1 -1
  67. package/mtds/divider/divider.js +15 -20
  68. package/mtds/divider/divider.js.map +1 -1
  69. package/mtds/errorsummary/errorsummary.js +14 -16
  70. package/mtds/errorsummary/errorsummary.js.map +1 -1
  71. package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js +22 -25
  72. package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
  73. package/mtds/external/@turf/helpers/dist/esm/index.js +21 -24
  74. package/mtds/external/@turf/helpers/dist/esm/index.js.map +1 -1
  75. package/mtds/external/@turf/invariant/dist/esm/index.js +15 -19
  76. package/mtds/external/@turf/invariant/dist/esm/index.js.map +1 -1
  77. package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js +270 -297
  78. package/mtds/external/@u-elements/u-combobox/dist/u-combobox.js.map +1 -1
  79. package/mtds/external/@u-elements/u-details/dist/u-details.js +75 -101
  80. package/mtds/external/@u-elements/u-details/dist/u-details.js.map +1 -1
  81. package/mtds/external/leaflet/dist/leaflet-src.js +4257 -6151
  82. package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -1
  83. package/mtds/external/leaflet/dist/leaflet.css.js +5 -606
  84. package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -1
  85. package/mtds/external/point-in-polygon-hao/dist/esm/index.js +24 -25
  86. package/mtds/external/point-in-polygon-hao/dist/esm/index.js.map +1 -1
  87. package/mtds/external/robust-predicates/esm/incircle.js +5 -0
  88. package/mtds/external/robust-predicates/esm/incircle.js.map +1 -0
  89. package/mtds/external/robust-predicates/esm/insphere.js +5 -0
  90. package/mtds/external/robust-predicates/esm/insphere.js.map +1 -0
  91. package/mtds/external/robust-predicates/esm/orient2d.js +20 -22
  92. package/mtds/external/robust-predicates/esm/orient2d.js.map +1 -1
  93. package/mtds/external/robust-predicates/esm/orient3d.js +5 -0
  94. package/mtds/external/robust-predicates/esm/orient3d.js.map +1 -0
  95. package/mtds/external/robust-predicates/esm/util.js +20 -28
  96. package/mtds/external/robust-predicates/esm/util.js.map +1 -1
  97. package/mtds/external/robust-predicates/index.js +5 -0
  98. package/mtds/field/field.js +167 -214
  99. package/mtds/field/field.js.map +1 -1
  100. package/mtds/fieldset/fieldset.js +32 -30
  101. package/mtds/fieldset/fieldset.js.map +1 -1
  102. package/mtds/fileupload/fileupload.js +16 -13
  103. package/mtds/fileupload/fileupload.js.map +1 -1
  104. package/mtds/helptext/helptext.js +25 -27
  105. package/mtds/helptext/helptext.js.map +1 -1
  106. package/mtds/identitet/illustrasjons-generator/illustrasjons-generator.d.ts +1 -0
  107. package/mtds/identitet/illustrasjons-generator/index-old-1.d.ts +1 -0
  108. package/mtds/identitet/infografikk-generator/infografikk-generator.d.ts +1 -0
  109. package/mtds/index.iife.js +21 -21
  110. package/mtds/index.js +38 -31
  111. package/mtds/index.js.map +1 -1
  112. package/mtds/input/input.js +33 -47
  113. package/mtds/input/input.js.map +1 -1
  114. package/mtds/law/law-helper.js +106 -95
  115. package/mtds/law/law-helper.js.map +1 -1
  116. package/mtds/law/law.js +15 -10
  117. package/mtds/law/law.js.map +1 -1
  118. package/mtds/layout/layout.js +21 -13
  119. package/mtds/layout/layout.js.map +1 -1
  120. package/mtds/layout/layout.stories.d.ts +1 -0
  121. package/mtds/link/link.js +15 -10
  122. package/mtds/link/link.js.map +1 -1
  123. package/mtds/logo/logo-observer.js +18 -18
  124. package/mtds/logo/logo-observer.js.map +1 -1
  125. package/mtds/logo/logo.js +18 -18
  126. package/mtds/logo/logo.js.map +1 -1
  127. package/mtds/package.js +6 -0
  128. package/mtds/package.js.map +1 -0
  129. package/mtds/package.json.d.ts +112 -0
  130. package/mtds/pagination/pagination.js +46 -60
  131. package/mtds/pagination/pagination.js.map +1 -1
  132. package/mtds/popover/popover-observer.js +15 -15
  133. package/mtds/popover/popover-observer.js.map +1 -1
  134. package/mtds/popover/popover.js +18 -20
  135. package/mtds/popover/popover.js.map +1 -1
  136. package/mtds/print/print.js +15 -10
  137. package/mtds/print/print.js.map +1 -1
  138. package/mtds/print/print.stories.d.ts +0 -1
  139. package/mtds/profilering/epost.d.ts +1 -0
  140. package/mtds/progress/progress.js +15 -13
  141. package/mtds/progress/progress.js.map +1 -1
  142. package/mtds/react-atlas.js +7 -16
  143. package/mtds/react.js +36 -84
  144. package/mtds/skeleton/skeleton.js +15 -11
  145. package/mtds/skeleton/skeleton.js.map +1 -1
  146. package/mtds/spinner/spinner.js +16 -13
  147. package/mtds/spinner/spinner.js.map +1 -1
  148. package/mtds/steps/steps.js +15 -10
  149. package/mtds/steps/steps.js.map +1 -1
  150. package/mtds/styles.css +2 -1
  151. package/mtds/styles.module.js +122 -0
  152. package/mtds/styles.module.js.map +1 -0
  153. package/mtds/table/table-observer.js +23 -28
  154. package/mtds/table/table-observer.js.map +1 -1
  155. package/mtds/table/table.js +88 -60
  156. package/mtds/table/table.js.map +1 -1
  157. package/mtds/tabs/tabs.js +32 -27
  158. package/mtds/tabs/tabs.js.map +1 -1
  159. package/mtds/tag/tag.js +16 -19
  160. package/mtds/tag/tag.js.map +1 -1
  161. package/mtds/tailwind.css +0 -4
  162. package/mtds/toast/toast-helper.js +45 -25
  163. package/mtds/toast/toast-helper.js.map +1 -1
  164. package/mtds/toast/toast-observer.js +18 -18
  165. package/mtds/toast/toast-observer.js.map +1 -1
  166. package/mtds/toast/toast.js +67 -54
  167. package/mtds/toast/toast.js.map +1 -1
  168. package/mtds/togglegroup/togglegroup.js +31 -40
  169. package/mtds/togglegroup/togglegroup.js.map +1 -1
  170. package/mtds/tooltip/tooltip-element.js +12 -25
  171. package/mtds/tooltip/tooltip-element.js.map +1 -1
  172. package/mtds/typography/typography.js +38 -21
  173. package/mtds/typography/typography.js.map +1 -1
  174. package/mtds/utils.js +53 -70
  175. package/mtds/utils.js.map +1 -1
  176. package/mtds/validation/validation-observer.js +40 -47
  177. package/mtds/validation/validation-observer.js.map +1 -1
  178. package/mtds/validation/validation.js +17 -21
  179. package/mtds/validation/validation.js.map +1 -1
  180. package/package.json +9 -9
  181. package/mtds/atlas/atlas.css.js +0 -138
  182. package/mtds/atlas/atlas.css.js.map +0 -1
  183. package/mtds/atlas.js.map +0 -1
  184. package/mtds/chart/chart.css.js +0 -187
  185. package/mtds/chart/chart.css.js.map +0 -1
  186. package/mtds/package.json.js +0 -5
  187. package/mtds/package.json.js.map +0 -1
  188. package/mtds/react-atlas.js.map +0 -1
  189. package/mtds/react.js.map +0 -1
  190. package/mtds/styles.module.css.js +0 -118
  191. package/mtds/styles.module.css.js.map +0 -1
package/mtds/app/app.js CHANGED
@@ -1,61 +1,67 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import a from "clsx";
3
- import { forwardRef as n } from "react";
4
- import { Button as m } from "../button/button.js";
5
- import s from "../styles.module.css.js";
6
- import d from "./app-toggle.js";
7
- const u = n(function({ as: r, className: t, ...p }, e) {
8
- return /* @__PURE__ */ o(r || "div", { className: a(s.app, t), ref: e, ...p });
9
- }), f = n(function({ as: r, className: t, ...p }, e) {
10
- return /* @__PURE__ */ o(r || "div", { className: a(s.sticky, t), ref: e, ...p });
11
- }), b = Object.assign(u, {
12
- Header: n(
13
- function(r, t) {
14
- return /* @__PURE__ */ o("header", { ref: t, ...r });
15
- }
16
- ),
17
- Sidebar: n(
18
- function(r, t) {
19
- return /* @__PURE__ */ o(
20
- "dialog",
21
- {
22
- role: "navigation",
23
- id: "mtds-sidebar",
24
- suppressHydrationWarning: !0,
25
- ref: t,
26
- ...r
27
- }
28
- );
29
- }
30
- ),
31
- Sticky: f,
32
- Toggle: n(
33
- function({ children: r, ...t }, p) {
34
- return /* @__PURE__ */ o(
35
- m,
36
- {
37
- command: "show-modal",
38
- commandfor: "mtds-sidebar",
39
- "data-tooltip": "Vis meny",
40
- ref: p,
41
- ...t,
42
- children: r ?? "Skjul meny"
43
- }
44
- );
45
- }
46
- ),
47
- Main: n(function(r, t) {
48
- return /* @__PURE__ */ o("main", { ref: t, ...r });
49
- }),
50
- Footer: n(
51
- function(r, t) {
52
- return /* @__PURE__ */ o("footer", { ref: t, ...r });
53
- }
54
- ),
55
- // Needed to avoid flash of unstyled content and still be Next.js hydration compatible
56
- Script: () => /* @__PURE__ */ o("script", { id: "mtds-app-script", children: d })
1
+ import e from "../styles.module.js";
2
+ import { Button as t } from "../button/button.js";
3
+ import n from "./app-toggle2.js";
4
+ import r from "clsx";
5
+ import { forwardRef as i } from "react";
6
+ import { jsx as a } from "react/jsx-runtime";
7
+ //#region designsystem/app/app.tsx
8
+ var o = i(function({ as: t, className: n, ...i }, o) {
9
+ return /* @__PURE__ */ a(t || "div", {
10
+ className: r(e.app, n),
11
+ ref: o,
12
+ ...i
13
+ });
14
+ }), s = i(function({ as: t, className: n, ...i }, o) {
15
+ return /* @__PURE__ */ a(t || "div", {
16
+ className: r(e.sticky, n),
17
+ ref: o,
18
+ ...i
19
+ });
20
+ }), c = Object.assign(o, {
21
+ Header: i(function(e, t) {
22
+ return /* @__PURE__ */ a("header", {
23
+ ref: t,
24
+ ...e
25
+ });
26
+ }),
27
+ Sidebar: i(function(e, t) {
28
+ return /* @__PURE__ */ a("dialog", {
29
+ role: "navigation",
30
+ id: "mtds-sidebar",
31
+ suppressHydrationWarning: !0,
32
+ ref: t,
33
+ ...e
34
+ });
35
+ }),
36
+ Sticky: s,
37
+ Toggle: i(function({ children: e, ...n }, r) {
38
+ return /* @__PURE__ */ a(t, {
39
+ command: "show-modal",
40
+ commandfor: "mtds-sidebar",
41
+ "data-tooltip": "Vis meny",
42
+ ref: r,
43
+ ...n,
44
+ children: e ?? "Skjul meny"
45
+ });
46
+ }),
47
+ Main: i(function(e, t) {
48
+ return /* @__PURE__ */ a("main", {
49
+ ref: t,
50
+ ...e
51
+ });
52
+ }),
53
+ Footer: i(function(e, t) {
54
+ return /* @__PURE__ */ a("footer", {
55
+ ref: t,
56
+ ...e
57
+ });
58
+ }),
59
+ Script: () => /* @__PURE__ */ a("script", {
60
+ id: "mtds-app-script",
61
+ children: n
62
+ })
57
63
  });
58
- export {
59
- b as App
60
- };
61
- //# sourceMappingURL=app.js.map
64
+ //#endregion
65
+ export { c as App };
66
+
67
+ //# sourceMappingURL=app.js.map
@@ -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<\n\t\tAs,\n\t\t{\n\t\t\t\"data-variant\"?: \"mobilebar\";\n\t\t}\n\t>;\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 (\n\t\t\t\t<dialog\n\t\t\t\t\trole=\"navigation\"\n\t\t\t\t\tid=\"mtds-sidebar\"\n\t\t\t\t\tsuppressHydrationWarning // Needed due to closedby polyfill\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t);\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\tcommand=\"show-modal\"\n\t\t\t\t\tcommandfor=\"mtds-sidebar\"\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":";;;;;;AA2BA,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,aACC,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,MAAK;AAAA,UACL,IAAG;AAAA,UACH,0BAAwB;AAAA,UACxB,KAAAD;AAAA,UACC,GAAGD;AAAA,QAAA;AAAA,MAAA;AAAA,IAGP;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,SAAQ;AAAA,UACR,YAAW;AAAA,UACX,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;"}
1
+ {"version":3,"file":"app.js","names":[],"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<\n\t\tAs,\n\t\t{\n\t\t\t\"data-variant\"?: \"mobilebar\";\n\t\t}\n\t>;\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 (\n\t\t\t\t<dialog\n\t\t\t\t\trole=\"navigation\"\n\t\t\t\t\tid=\"mtds-sidebar\"\n\t\t\t\t\tsuppressHydrationWarning // Needed due to closedby polyfill\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t);\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\tcommand=\"show-modal\"\n\t\t\t\t\tcommandfor=\"mtds-sidebar\"\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"],"mappings":";;;;;;;AA2BA,IAAM,IAAU,EAAiB,SAE/B,EAAE,OAAI,cAAW,GAAG,KAAsB,GAA0B;CAGrE,OAAO,kBAFK,KAAM,OAEX;EAAK,WAAW,EAAK,EAAO,KAAK,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAC1E,CAAC,GAEK,IAAY,EAAiB,SAEjC,EAAE,OAAI,cAAW,GAAG,KAAsB,GAA0B;CAGrE,OAAO,kBAFK,KAAM,OAEX;EAAK,WAAW,EAAK,EAAO,QAAQ,CAAS;EAAQ;EAAK,GAAI;CAAO,CAAA;AAC7E,CAAC,GAEY,IAAM,OAAO,OAAO,GAAS;CACzC,QAAQ,EACP,SAAmB,GAAM,GAAK;EAC7B,OAAO,kBAAC,UAAD;GAAa;GAAK,GAAI;EAAO,CAAA;CACrC,CACD;CACA,SAAS,EACR,SAAoB,GAAM,GAAK;EAC9B,OACC,kBAAC,UAAD;GACC,MAAK;GACL,IAAG;GACH,0BAAA;GACK;GACL,GAAI;EACJ,CAAA;CAEH,CACD;CACA,QAAQ;CACR,QAAQ,EACP,SAAmB,EAAE,aAAU,GAAG,KAA+B,GAAK;EACrE,OACC,kBAAC,GAAD;GACC,SAAQ;GACR,YAAW;GACX,gBAAa;GACR;GACL,GAAI;aAEH,KAAY;EACN,CAAA;CAEV,CACD;CACA,MAAM,EAAsC,SAAiB,GAAM,GAAK;EACvE,OAAO,kBAAC,QAAD;GAAW;GAAK,GAAI;EAAO,CAAA;CACnC,CAAC;CACD,QAAQ,EACP,SAAmB,GAAM,GAAK;EAC7B,OAAO,kBAAC,UAAD;GAAa;GAAK,GAAI;EAAO,CAAA;CACrC,CACD;CAEA,cAAc,kBAAC,UAAD;EAAQ,IAAG;YAAmB;CAAe,CAAA;AAC5D,CAAC"}
@@ -1,95 +1,85 @@
1
- import i from "../external/leaflet/dist/leaflet-src.js";
2
- import h from "../external/leaflet/dist/leaflet.css.js";
1
+ import { MTDSElement as e, attachStyle as t, attr as n, defineElement as r, isBrowser as i, off as a, on as o, tag as s } from "../utils.js";
2
+ import c from "../external/leaflet/dist/leaflet-src.js";
3
+ import l from "../external/leaflet/dist/leaflet.css.js";
3
4
  import "./cluster.js";
4
- import { defineElement as u, isBrowser as f, MTDSElement as g, tag as m, attachStyle as C, attr as a, 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 l = 0;
10
- const p = 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 = [
11
- [57.5, 4.73],
12
- [71.5, 31.44]
13
- ];
14
- class r extends g {
15
- cluster;
16
- map;
17
- static get observedAttributes() {
18
- return ["data-view", "data-scrollzoom"];
19
- }
20
- constructor() {
21
- super(), this.attachShadow({ mode: "open" }).append(m("figure")), C(this, `@layer leaflet{${h}}
22
- @layer mt.v3-3-10design{${b}`);
23
- }
24
- connectedCallback() {
25
- const t = this.shadowRoot?.lastElementChild, e = a(this, "data-cluster") ?? "false", o = new i.TileLayer(k, {
26
- attribution: "&copy; Kartverket",
27
- className: "leaflet-kartverket-tiles",
28
- maxZoom: p
29
- });
30
- this.map = new i.Map(t, {
31
- attributionControl: !1,
32
- fadeAnimation: !1,
33
- // Prevent popup fades
34
- layers: [o],
35
- zoomControl: !1,
36
- zoomSnap: 0.2
37
- }), 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({
38
- zoomToBoundsOnClick: !0,
39
- showCoverageOnHover: !1,
40
- disableClusteringAtZoom: e === "false" ? 1 : Number(e) || p + 1,
41
- iconCreateFunction: (s) => new i.DivIcon({
42
- html: `${s.getChildCount()}`,
43
- className: "leaflet-cluster-icon",
44
- iconSize: [40, 40]
45
- })
46
- }).addTo(this.map);
47
- for (const s of r.observedAttributes)
48
- this.attributeChangedCallback(s, null, a(this, s));
49
- }
50
- attributeChangedCallback(t, e, o) {
51
- t === "data-view" && this.setView(o || ""), t === "data-scrollzoom" && this.map?.scrollWheelZoom[o === "false" ? "disable" : "enable"]();
52
- }
53
- setView(t, e) {
54
- const o = `${t}`.split(",").map(parseFloat).filter(Number.isFinite), s = this.cluster?.getBounds();
55
- if (o.length === 3) return this.map?.setView([o[0], o[1]], o[2], e);
56
- if (t !== "fit") return this.map?.fitBounds(E, e);
57
- if (s?.isValid()) return this.map?.fitBounds(s.pad(0.1), e);
58
- this.cluster?.once("layeradd", () => {
59
- setTimeout(() => this.setView("fit"), 50);
60
- });
61
- }
62
- latLngFromPoint(t, e) {
63
- return this.map?.pointerEventToLatLng({ clientX: t, clientY: e });
64
- }
65
- disconnectedCallback() {
66
- w(this, "pointerup click", this.#t), this.map?.remove(), this.map = this.cluster = void 0;
67
- }
68
- async getCollections() {
69
- return window._matgeoCollections || (window._matgeoCollections = fetch(S).then((t) => t.json()).then((t) => t.collections.map((e) => [e.id, e])).then(Object.fromEntries)), window._matgeoCollections;
70
- }
71
- #e({ type: t, popup: e }) {
72
- const o = t === "popupopen", s = e.getElement()?.querySelector(".leaflet-popup-content"), d = s?.querySelector(":scope > slot"), c = s?.textContent?.match(/^#(\S+)/)?.[1] || "", n = document.getElementById(d?.name || c);
73
- if (!n) return o && c && e.close();
74
- i.Util.setOptions(e, { maxWidth: this.offsetWidth - 40 }), a(n, "data-popover", o ? a(n, "popover") : null), a(n, "popover", o ? null : a(n, "data-popover")), a(n, "slot", o ? n.id : null), o && e.setContent(m("slot", { name: n.id }));
75
- }
76
- #t(t) {
77
- t.type === "click" ? l && t.stopPropagation?.() : document.body.classList.contains("leaflet-dragging") && (l = setTimeout(() => {
78
- l = 0;
79
- }, 50));
80
- }
81
- }
82
- u("mtds-atlas", r);
83
- f() && (i.Marker.prototype.options.icon = new i.DivIcon({
84
- html: '<div class="leaflet-marker-generated-slot"><div class="leaflet-marker-generated-icon"></div></div>',
85
- iconSize: [0, 0]
86
- }));
87
- export {
88
- i as L,
89
- S as MATGEO_URL,
90
- r as MTDSAtlasElement,
91
- O as MTDSAtlasMarkerElement,
92
- R as MTDSAtlasMatgeoElement,
93
- D as MTDSAtlasWMSElement
5
+ import u from "./atlas.js";
6
+ import { MTDSAtlasMarkerElement as d } from "./atlas-marker.js";
7
+ import { MTDSAtlasMatgeoElement as f } from "./atlas-matgeo.js";
8
+ import { MTDSAtlasWMSElement as p } from "./atlas-wms.js";
9
+ //#region designsystem/atlas/atlas-element.ts
10
+ var m = 0, h = 18, g = "https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png", _ = "https://matgeoservice-256616427209.europe-north1.run.app/ogc/features/collections", v = [[57.5, 4.73], [71.5, 31.44]], y = class r extends e {
11
+ cluster;
12
+ map;
13
+ static get observedAttributes() {
14
+ return ["data-view", "data-scrollzoom"];
15
+ }
16
+ constructor() {
17
+ super(), this.attachShadow({ mode: "open" }).append(s("figure")), t(this, `@layer leaflet{${l}}\n@layer mt.v3-4-1design{${u}`);
18
+ }
19
+ connectedCallback() {
20
+ let e = this.shadowRoot?.lastElementChild, t = n(this, "data-cluster") ?? "false", i = new c.TileLayer(g, {
21
+ attribution: "&copy; Kartverket",
22
+ className: "leaflet-kartverket-tiles",
23
+ maxZoom: h
24
+ });
25
+ this.map = new c.Map(e, {
26
+ attributionControl: !1,
27
+ fadeAnimation: !1,
28
+ layers: [i],
29
+ zoomControl: !1,
30
+ zoomSnap: .2
31
+ }), o(this, "pointerup click", this.#t), this.map.addControl(new c.Control.Attribution({ prefix: "" })), this.map.addControl(new c.Control.Zoom({ position: "bottomright" })), this.map.on("popupopen popupclose", this.#e, this), this.cluster = new c.MarkerClusterGroup({
32
+ zoomToBoundsOnClick: !0,
33
+ showCoverageOnHover: !1,
34
+ disableClusteringAtZoom: t === "false" ? 1 : Number(t) || 19,
35
+ iconCreateFunction: (e) => new c.DivIcon({
36
+ html: `${e.getChildCount()}`,
37
+ className: "leaflet-cluster-icon",
38
+ iconSize: [40, 40]
39
+ })
40
+ }).addTo(this.map);
41
+ for (let e of r.observedAttributes) this.attributeChangedCallback(e, null, n(this, e));
42
+ }
43
+ attributeChangedCallback(e, t, n) {
44
+ e === "data-view" && this.setView(n || ""), e === "data-scrollzoom" && this.map?.scrollWheelZoom[n === "false" ? "disable" : "enable"]();
45
+ }
46
+ setView(e, t) {
47
+ let n = `${e}`.split(",").map(parseFloat).filter(Number.isFinite), r = this.cluster?.getBounds();
48
+ if (n.length === 3) return this.map?.setView([n[0], n[1]], n[2], t);
49
+ if (e !== "fit") return this.map?.fitBounds(v, t);
50
+ if (r?.isValid()) return this.map?.fitBounds(r.pad(.1), t);
51
+ this.cluster?.once("layeradd", () => {
52
+ setTimeout(() => this.setView("fit"), 50);
53
+ });
54
+ }
55
+ latLngFromPoint(e, t) {
56
+ return this.map?.pointerEventToLatLng({
57
+ clientX: e,
58
+ clientY: t
59
+ });
60
+ }
61
+ disconnectedCallback() {
62
+ a(this, "pointerup click", this.#t), this.map?.remove(), this.map = this.cluster = void 0;
63
+ }
64
+ async getCollections() {
65
+ return window._matgeoCollections || (window._matgeoCollections = fetch(_).then((e) => e.json()).then((e) => e.collections.map((e) => [e.id, e])).then(Object.fromEntries)), window._matgeoCollections;
66
+ }
67
+ #e({ type: e, popup: t }) {
68
+ let r = e === "popupopen", i = t.getElement()?.querySelector(".leaflet-popup-content"), a = i?.querySelector(":scope > slot"), o = i?.textContent?.match(/^#(\S+)/)?.[1] || "", l = document.getElementById(a?.name || o);
69
+ if (!l) return r && o && t.close();
70
+ c.Util.setOptions(t, { maxWidth: this.offsetWidth - 40 }), n(l, "data-popover", r ? n(l, "popover") : null), n(l, "popover", r ? null : n(l, "data-popover")), n(l, "slot", r ? l.id : null), r && t.setContent(s("slot", { name: l.id }));
71
+ }
72
+ #t(e) {
73
+ e.type === "click" ? m && e.stopPropagation?.() : document.body.classList.contains("leaflet-dragging") && (m = setTimeout(() => {
74
+ m = 0;
75
+ }, 50));
76
+ }
94
77
  };
95
- //# sourceMappingURL=atlas-element.js.map
78
+ r("mtds-atlas", y), i() && (c.Marker.prototype.options.icon = new c.DivIcon({
79
+ html: "<div class=\"leaflet-marker-generated-slot\"><div class=\"leaflet-marker-generated-icon\"></div></div>",
80
+ iconSize: [0, 0]
81
+ }));
82
+ //#endregion
83
+ export { c as L, _ as MATGEO_URL, y as MTDSAtlasElement, d as MTDSAtlasMarkerElement, f as MTDSAtlasMatgeoElement, p as MTDSAtlasWMSElement };
84
+
85
+ //# 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\tattachStyle,\n\tattr,\n\tdefineElement,\n\tisBrowser,\n\tMTDSElement,\n\toff,\n\ton,\n\ttag,\n} from \"../utils\";\nimport css from \"./atlas.css?raw\";\n\nexport { MTDSAtlasMarkerElement } from \"./atlas-marker\";\nexport { MTDSAtlasMatgeoElement } from \"./atlas-matgeo\";\nexport { MTDSAtlasWMSElement } from \"./atlas-wms\";\nexport { L };\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\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(tag(\"figure\"));\n\t\tattachStyle(this, `@layer leaflet{${LeafletCSS}}\\n@layer mt.design{${css}`);\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: \"&copy; 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: [40, 40],\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\tif (!window._matgeoCollections)\n\t\t\twindow._matgeoCollections = fetch(MATGEO_URL)\n\t\t\t\t.then((res) => res.json())\n\t\t\t\t.then((d) => d.collections.map((c: MTDSAtlasCollection) => [c.id, c]))\n\t\t\t\t.then(Object.fromEntries);\n\t\treturn window._matgeoCollections;\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","MTDSAtlasElement","MTDSElement","tag","attachStyle","LeafletCSS","css","container","cluster","attr","tiles","L","on","#skipClick","#handlePopup","name","_prev","next","view","opts","p","b","x","y","off","res","d","c","type","popup","open","cont","slot","id","el","event","defineElement","isBrowser"],"mappings":";;;;;;;;AAiDA,IAAIA,IAAsC;AAC1C,MAAMC,IAAsB,IACtBC,IACL,sFACYC,IACZ,qFACKC,IAAuC;A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EAC/C,MAAM;AAAA,EACN,UAAU,CAAC,GAAG,CAAC;AAAA,CACf;"}
1
+ {"version":3,"file":"atlas-element.js","names":["#skipClick","#handlePopup"],"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\tattachStyle,\n\tattr,\n\tdefineElement,\n\tisBrowser,\n\tMTDSElement,\n\toff,\n\ton,\n\ttag,\n} from \"../utils\";\nimport css from \"./atlas.css?raw\";\n\nexport { MTDSAtlasMarkerElement } from \"./atlas-marker\";\nexport { MTDSAtlasMatgeoElement } from \"./atlas-matgeo\";\nexport { MTDSAtlasWMSElement } from \"./atlas-wms\";\nexport { L };\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\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(tag(\"figure\"));\n\t\tattachStyle(this, `@layer leaflet{${LeafletCSS}}\\n@layer mt.design{${css}`);\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: \"&copy; 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: [40, 40],\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\tif (!window._matgeoCollections)\n\t\t\twindow._matgeoCollections = fetch(MATGEO_URL)\n\t\t\t\t.then((res) => res.json())\n\t\t\t\t.then((d) => d.collections.map((c: MTDSAtlasCollection) => [c.id, c]))\n\t\t\t\t.then(Object.fromEntries);\n\t\treturn window._matgeoCollections;\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"],"mappings":";;;;;;;;;AAiDA,IAAI,IAAsC,GACpC,IAAsB,IACtB,IACL,sFACY,IACZ,qFACK,IAAuC,CAC5C,CAAC,MAAM,IAAI,GACX,CAAC,MAAM,KAAK,CACb,GAEa,IAAb,MAAa,UAAyB,EAAY;CACjD;CACA;CAEA,WAAW,qBAAqB;EAC/B,OAAO,CAAC,aAAa,iBAAiB;CACvC;CACA,cAAc;EAGb,AAFA,MAAM,GACN,KAAK,aAAa,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KAAM,EAAM,MAAM;EAK1C,AAJA,EAAE,KAAK,WAAW,GAAO,EAAE,UAAU,KAAK,cAAc,GAAG,CAAC,GAC5D,EAAK,GAAI,gBAAgB,IAAO,EAAK,GAAI,SAAS,IAAI,IAAI,GAC1D,EAAK,GAAI,WAAW,IAAO,OAAO,EAAK,GAAI,cAAc,CAAC,GAC1D,EAAK,GAAI,QAAQ,IAAO,EAAG,KAAK,IAAI,GAChC,KAAM,EAAM,WAAW,EAAI,QAAQ,EAAE,MAAM,EAAG,GAAG,CAAC,CAAC;CACxD;CACA,GAAW,GAA4B;EACtC,AAAI,EAAM,SAAS,UAAS,KAAc,EAAM,kBAAkB,IACzD,SAAS,KAAK,UAAU,SAAS,kBAAkB,MAC3D,IAAa,iBAAiB;GAC7B,IAAa;EACd,GAAG,EAAE;CACP;AACD;AAEA,EAAc,cAAc,CAAgB,GAExC,EAAU,MACb,EAAE,OAAO,UAAU,QAAQ,OAAO,IAAI,EAAE,QAAQ;CAC/C,MAAM;CACN,UAAU,CAAC,GAAG,CAAC;AAChB,CAAC"}
@@ -1,53 +1,64 @@
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
- atlas;
6
- marker;
7
- static get observedAttributes() {
8
- return ["hidden", "draggable", "data-latlng", "popovertarget"];
9
- }
10
- connectedCallback() {
11
- queueMicrotask(() => {
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(), {
14
- draggable: this.draggable,
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");
18
- });
19
- }
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);
25
- }
26
- t === "draggable" && e?.dragging?.[this.draggable ? "enable" : "disable"](), t === "hidden" && e && a && a[this.hidden ? "removeLayer" : "addLayer"](e);
27
- }
28
- disconnectedCallback() {
29
- c(this, "click keydown", this), this.marker?.unbindPopup().off("dragend", this.#e).remove(), this.marker = this.atlas = void 0;
30
- }
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();
34
- }
35
- get latlng() {
36
- return s(this, "data-latlng") || "";
37
- }
38
- set latlng(t) {
39
- s(this, "data-latlng", t);
40
- }
41
- #t() {
42
- return this.latlng?.split(",").map(parseFloat);
43
- }
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 }));
47
- }
48
- }
49
- d("mtds-atlas-marker", k);
50
- export {
51
- k as MTDSAtlasMarkerElement
1
+ import { MTDSElement as e, attr as t, defineElement as n, off as r, on as i, tag as a } from "../utils.js";
2
+ import o from "../external/leaflet/dist/leaflet-src.js";
3
+ //#region designsystem/atlas/atlas-marker.ts
4
+ var s = 0, c = class extends e {
5
+ atlas;
6
+ marker;
7
+ static get observedAttributes() {
8
+ return [
9
+ "hidden",
10
+ "draggable",
11
+ "data-latlng",
12
+ "popovertarget"
13
+ ];
14
+ }
15
+ connectedCallback() {
16
+ queueMicrotask(() => {
17
+ let e = a("slot", { name: `${++s}` }), n = new o.DivIcon({
18
+ html: e,
19
+ iconSize: [0, 0]
20
+ });
21
+ this.atlas = this.closest("mtds-atlas") || void 0, this.marker = new o.Marker(this.#e(), {
22
+ draggable: this.draggable,
23
+ keyboard: !1,
24
+ icon: n
25
+ }), this.marker.bindPopup(() => `#${t(this, "popovertarget")}`), this.marker.on("dragend", this.#t), i(this, "click keydown", this), t(this, "slot", `${s}`), t(this, "role", "button"), t(this, "tabindex", "0"), this.attributeChangedCallback("hidden");
26
+ });
27
+ }
28
+ attributeChangedCallback(e) {
29
+ let t = this.marker, n = this.atlas?.cluster;
30
+ if (e === "popovertarget" && t?.getPopup()?.update(), e === "data-latlng") {
31
+ let e = this.#e();
32
+ t?.getLatLng().equals(e) || t?.setLatLng(e);
33
+ }
34
+ e === "draggable" && t?.dragging?.[this.draggable ? "enable" : "disable"](), e === "hidden" && t && n && n[this.hidden ? "removeLayer" : "addLayer"](t);
35
+ }
36
+ disconnectedCallback() {
37
+ r(this, "click keydown", this), this.marker?.unbindPopup().off("dragend", this.#t).remove(), this.marker = this.atlas = void 0;
38
+ }
39
+ handleEvent(e) {
40
+ if (e.type === "click") return this.marker?.fire("click");
41
+ e.key === " " && e.preventDefault(), (e.key === " " || e.key === "Enter") && this.click();
42
+ }
43
+ get latlng() {
44
+ return t(this, "data-latlng") || "";
45
+ }
46
+ set latlng(e) {
47
+ t(this, "data-latlng", e);
48
+ }
49
+ #e() {
50
+ return this.latlng?.split(",").map(parseFloat);
51
+ }
52
+ #t(e) {
53
+ let t = (e.target._icon?.firstElementChild)?.assignedElements?.()?.[0], { lat: n, lng: r } = e.target.getLatLng();
54
+ t && (t.latlng = `${n},${r}`), t?.dispatchEvent(new CustomEvent("dragend", {
55
+ detail: e,
56
+ bubbles: !0
57
+ }));
58
+ }
52
59
  };
53
- //# sourceMappingURL=atlas-marker.js.map
60
+ n("mtds-atlas-marker", c);
61
+ //#endregion
62
+ export { c as MTDSAtlasMarkerElement };
63
+
64
+ //# 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":["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;AA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AE,OAAA,GAC/D,KAAK,SAAS,KAAK,QAAQ;AAAA,EAC5B;AAAA,EACA,YAAYO,GAAsB;AACjC,QAAIA,EAAM,SAAS,gBAAgB,KAAK,QAAQ,KAAK,OAAO;AAC5D,IAAIA,EAAM,QAAQ,OAAKA,EAAM,eAAA,IACzBA,EAAM,QAAQ,OAAOA,EAAM,QAAQ,iBAAc,MAAA;AAAA,EACtD;AAAA,EACA,IAAI,SAAS;AACZ,WAAOR,EAAK,MAAM,aAAa,KAAK;AAAA,EACrC;AAAA,EACA,IAAI,OAAOM,GAAgB;AAC1B,IAAAN,EAAK,MAAM,eAAeM,CAAM;AAAA,EACjC;AAAA,EACAP,KAAe;AACd,WAAO,KAAK,QAAQ,MAAM,GAAG,EAAE,IAAI,UAAU;AAAA,EAC9C;AAAA,EACAE,GAAeQ,GAAwB;AAGtC,UAAMC,IAFOD,EAAO,OAAO,OACxB,mBAEI,mBAAA,IAAuB,CAAC,GACzB,EAAE,KAAAE,GAAK,KAAAC,EAAA,IAAQH,EAAO,OAAO,UAAA;AACnC,IAAIC,MAAMA,EAAK,SAAS,GAAGC,CAAG,IAAIC,CAAG,KACrCF,GAAM,cAAc,IAAI,YAAY,WAAW,EAAE,QAAAD,GAAQ,SAAS,GAAA,CAAM,CAAC;AAAA,EAC1E;AACD;AAEAI,EAAc,qBAAqBpB,CAAsB;"}
1
+ {"version":3,"file":"atlas-marker.js","names":["#parseLatLng","#handleDragEnd"],"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"],"mappings":";;;AAUA,IAAI,IAAO,GACE,IAAb,cAA4C,EAAY;CACvD;CACA;CAEA,WAAW,qBAAqB;EAC/B,OAAO;GAAC;GAAU;GAAa;GAAe;EAAe;CAC9D;CACA,oBAAoB;EACnB,qBAAqB;GACpB,IAAM,IAAO,EAAI,QAAQ,EAAE,MAAM,GAAG,EAAE,IAAO,CAAC,GACxC,IAAO,IAAI,EAAE,QAAQ;IAAE;IAAM,UAAU,CAAC,GAAG,CAAC;GAAE,CAAC;GAcrD,AAbA,KAAK,QAAQ,KAAK,QAA0B,YAAY,KAAK,KAAA,GAC7D,KAAK,SAAS,IAAI,EAAE,OAAO,KAAKA,GAAa,GAAG;IAC/C,WAAW,KAAK;IAChB,UAAU;IACV;GACD,CAAC,GACD,KAAK,OAAO,gBAAgB,IAAI,EAAK,MAAM,eAAe,GAAG,GAC7D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