@mattilsynet/design 2.2.28 → 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.
Files changed (177) hide show
  1. package/mtds/alert/alert.js +8 -9
  2. package/mtds/alert/alert.js.map +1 -1
  3. package/mtds/analytics/analytics.js +104 -165
  4. package/mtds/analytics/analytics.js.map +1 -1
  5. package/mtds/app/app-observer.js +28 -74
  6. package/mtds/app/app-observer.js.map +1 -1
  7. package/mtds/app/app-toggle.js +26 -16
  8. package/mtds/app/app-toggle.js.map +1 -1
  9. package/mtds/app/app-toggle2.js +10 -4
  10. package/mtds/app/app-toggle2.js.map +1 -1
  11. package/mtds/app/app.js +32 -36
  12. package/mtds/app/app.js.map +1 -1
  13. package/mtds/atlas/atlas-element.d.ts +27 -0
  14. package/mtds/atlas/atlas-element.js +63 -84
  15. package/mtds/atlas/atlas-element.js.map +1 -1
  16. package/mtds/atlas/atlas-marker.js +28 -48
  17. package/mtds/atlas/atlas-marker.js.map +1 -1
  18. package/mtds/atlas/atlas-matgeo.d.ts +3 -8
  19. package/mtds/atlas/atlas-matgeo.js +36 -66
  20. package/mtds/atlas/atlas-matgeo.js.map +1 -1
  21. package/mtds/atlas/atlas-wms.js +11 -21
  22. package/mtds/atlas/atlas-wms.js.map +1 -1
  23. package/mtds/atlas/atlas.css.js +2 -2
  24. package/mtds/atlas/atlas.css.js.map +1 -1
  25. package/mtds/atlas/atlas.js +23 -23
  26. package/mtds/atlas/atlas.js.map +1 -1
  27. package/mtds/atlas/atlas.stories.d.ts +1 -0
  28. package/mtds/atlas/cluster.js +697 -1576
  29. package/mtds/atlas/cluster.js.map +1 -1
  30. package/mtds/atlas.iife.js +4 -4
  31. package/mtds/atlas.js +11 -10
  32. package/mtds/avatar/avatar.js +8 -8
  33. package/mtds/avatar/avatar.js.map +1 -1
  34. package/mtds/badge/badge.js +7 -7
  35. package/mtds/badge/badge.js.map +1 -1
  36. package/mtds/breadcrumbs/breadcrumbs-observer.js +9 -10
  37. package/mtds/breadcrumbs/breadcrumbs-observer.js.map +1 -1
  38. package/mtds/breadcrumbs/breadcrumbs.js +13 -14
  39. package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
  40. package/mtds/button/button.js +14 -16
  41. package/mtds/button/button.js.map +1 -1
  42. package/mtds/card/card.js +12 -14
  43. package/mtds/card/card.js.map +1 -1
  44. package/mtds/chart/chart-axis.js +15 -27
  45. package/mtds/chart/chart-axis.js.map +1 -1
  46. package/mtds/chart/chart-bars.js +13 -15
  47. package/mtds/chart/chart-bars.js.map +1 -1
  48. package/mtds/chart/chart-element.js +48 -83
  49. package/mtds/chart/chart-element.js.map +1 -1
  50. package/mtds/chart/chart-lines.js +32 -54
  51. package/mtds/chart/chart-lines.js.map +1 -1
  52. package/mtds/chart/chart-pies.js +14 -34
  53. package/mtds/chart/chart-pies.js.map +1 -1
  54. package/mtds/chart/chart.css.js +2 -2
  55. package/mtds/chart/chart.css.js.map +1 -1
  56. package/mtds/chart/chart.js +12 -12
  57. package/mtds/chart/chart.js.map +1 -1
  58. package/mtds/chip/chip.js +8 -8
  59. package/mtds/chip/chip.js.map +1 -1
  60. package/mtds/chip/chip.stories.d.ts +1 -0
  61. package/mtds/details/details.js +12 -14
  62. package/mtds/details/details.js.map +1 -1
  63. package/mtds/dialog/dialog-observer.js +22 -35
  64. package/mtds/dialog/dialog-observer.js.map +1 -1
  65. package/mtds/dialog/dialog.js +12 -12
  66. package/mtds/dialog/dialog.js.map +1 -1
  67. package/mtds/divider/divider.js +10 -10
  68. package/mtds/divider/divider.js.map +1 -1
  69. package/mtds/errorsummary/errorsummary-observer.js +8 -11
  70. package/mtds/errorsummary/errorsummary-observer.js.map +1 -1
  71. package/mtds/errorsummary/errorsummary.js +11 -11
  72. package/mtds/errorsummary/errorsummary.js.map +1 -1
  73. package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js +19 -27
  74. package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
  75. package/mtds/external/@turf/helpers/dist/esm/index.js +16 -29
  76. package/mtds/external/@turf/helpers/dist/esm/index.js.map +1 -1
  77. package/mtds/external/@turf/invariant/dist/esm/index.js +13 -20
  78. package/mtds/external/@turf/invariant/dist/esm/index.js.map +1 -1
  79. package/mtds/external/leaflet/dist/leaflet-src.js +3096 -6004
  80. package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -1
  81. package/mtds/external/leaflet/dist/leaflet.css.js +2 -2
  82. package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -1
  83. package/mtds/external/point-in-polygon-hao/dist/esm/index.js +16 -46
  84. package/mtds/external/point-in-polygon-hao/dist/esm/index.js.map +1 -1
  85. package/mtds/external/robust-predicates/esm/orient2d.js +19 -163
  86. package/mtds/external/robust-predicates/esm/orient2d.js.map +1 -1
  87. package/mtds/external/robust-predicates/esm/util.js +25 -85
  88. package/mtds/external/robust-predicates/esm/util.js.map +1 -1
  89. package/mtds/field/field-observer.js +53 -119
  90. package/mtds/field/field-observer.js.map +1 -1
  91. package/mtds/field/field.d.ts +0 -1
  92. package/mtds/field/field.js +145 -177
  93. package/mtds/field/field.js.map +1 -1
  94. package/mtds/fieldset/fieldset-observer.js +14 -24
  95. package/mtds/fieldset/fieldset-observer.js.map +1 -1
  96. package/mtds/fieldset/fieldset.d.ts +3 -9
  97. package/mtds/fieldset/fieldset.js +20 -23
  98. package/mtds/fieldset/fieldset.js.map +1 -1
  99. package/mtds/fileupload/fileupload.js +8 -9
  100. package/mtds/fileupload/fileupload.js.map +1 -1
  101. package/mtds/fileupload/fileupload.stories.d.ts +1 -0
  102. package/mtds/helptext/helptext.js +15 -15
  103. package/mtds/helptext/helptext.js.map +1 -1
  104. package/mtds/illustrations/index.json +2 -2
  105. package/mtds/index.iife.js +15 -15
  106. package/mtds/index.js +27 -26
  107. package/mtds/index.js.map +1 -1
  108. package/mtds/input/input.js +28 -30
  109. package/mtds/input/input.js.map +1 -1
  110. package/mtds/law/law-helper.js +77 -143
  111. package/mtds/law/law-helper.js.map +1 -1
  112. package/mtds/law/law.js +6 -6
  113. package/mtds/law/law.js.map +1 -1
  114. package/mtds/layout/layout.js +10 -13
  115. package/mtds/layout/layout.js.map +1 -1
  116. package/mtds/link/link.js +7 -8
  117. package/mtds/link/link.js.map +1 -1
  118. package/mtds/logo/logo-observer.js +12 -18
  119. package/mtds/logo/logo-observer.js.map +1 -1
  120. package/mtds/logo/logo.js +8 -8
  121. package/mtds/logo/logo.js.map +1 -1
  122. package/mtds/package.json.js +2 -2
  123. package/mtds/pagination/pagination-helper.js +11 -17
  124. package/mtds/pagination/pagination-helper.js.map +1 -1
  125. package/mtds/pagination/pagination.js +30 -30
  126. package/mtds/pagination/pagination.js.map +1 -1
  127. package/mtds/popover/popover-observer.js +33 -45
  128. package/mtds/popover/popover-observer.js.map +1 -1
  129. package/mtds/popover/popover.js +12 -13
  130. package/mtds/popover/popover.js.map +1 -1
  131. package/mtds/progress/progress.js +8 -8
  132. package/mtds/progress/progress.js.map +1 -1
  133. package/mtds/react-atlas.js +13 -12
  134. package/mtds/react-types.d.ts +1 -0
  135. package/mtds/react.js +80 -80
  136. package/mtds/skeleton/skeleton.js +8 -8
  137. package/mtds/skeleton/skeleton.js.map +1 -1
  138. package/mtds/spinner/spinner.js +8 -8
  139. package/mtds/spinner/spinner.js.map +1 -1
  140. package/mtds/steps/steps.js +7 -7
  141. package/mtds/steps/steps.js.map +1 -1
  142. package/mtds/styles.css +1 -4591
  143. package/mtds/styles.json +43 -43
  144. package/mtds/styles.module.css.js +112 -167
  145. package/mtds/styles.module.css.js.map +1 -1
  146. package/mtds/table/table-observer.js +19 -22
  147. package/mtds/table/table-observer.js.map +1 -1
  148. package/mtds/table/table.d.ts +7 -0
  149. package/mtds/table/table.js +43 -18
  150. package/mtds/table/table.js.map +1 -1
  151. package/mtds/tabs/tabs.js +21 -25
  152. package/mtds/tabs/tabs.js.map +1 -1
  153. package/mtds/tag/tag.js +8 -8
  154. package/mtds/tag/tag.js.map +1 -1
  155. package/mtds/tailwind.css +6 -25
  156. package/mtds/toast/toast-helper.js +20 -35
  157. package/mtds/toast/toast-helper.js.map +1 -1
  158. package/mtds/toast/toast-observer.js +15 -30
  159. package/mtds/toast/toast-observer.js.map +1 -1
  160. package/mtds/toast/toast.js +37 -45
  161. package/mtds/toast/toast.js.map +1 -1
  162. package/mtds/togglegroup/togglegroup-observer.js +10 -15
  163. package/mtds/togglegroup/togglegroup-observer.js.map +1 -1
  164. package/mtds/togglegroup/togglegroup.js +24 -21
  165. package/mtds/togglegroup/togglegroup.js.map +1 -1
  166. package/mtds/tooltip/tooltip-observer.js +32 -48
  167. package/mtds/tooltip/tooltip-observer.js.map +1 -1
  168. package/mtds/typography/typography.js +19 -28
  169. package/mtds/typography/typography.js.map +1 -1
  170. package/mtds/utils.js +89 -129
  171. package/mtds/utils.js.map +1 -1
  172. package/mtds/validation/validation-observer.d.ts +1 -0
  173. package/mtds/validation/validation-observer.js +31 -0
  174. package/mtds/validation/validation-observer.js.map +1 -0
  175. package/mtds/validation/validation.js +12 -12
  176. package/mtds/validation/validation.js.map +1 -1
  177. package/package.json +8 -6
@@ -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,IAAI,OAAO;AACJ,MAAM,+BAA+B,YAAY;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,YAAM,OAAO,IAAI,QAAQ,EAAE,MAAM,GAAG,EAAE,IAAI,IAAI;AAC9C,YAAM,OAAO,IAAI,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC,GAAG,CAAC,GAAG;AACrD,WAAK,QAAQ,KAAK,QAA0B,YAAY,KAAK;AAC7D,WAAK,SAAS,IAAI,EAAE,OAAO,KAAK,gBAAgB;AAAA,QAC/C,WAAW,KAAK;AAAA,QAChB,UAAU;AAAA,QACV;AAAA,MAAA,CACA;AACD,WAAK,OAAO,UAAU,MAAM,IAAI,KAAK,MAAM,eAAe,CAAC,EAAE;AAC7D,WAAK,OAAO,GAAG,WAAW,KAAK,cAAc;AAE7C,SAAG,MAAM,iBAAiB,IAAI;AAC9B,WAAK,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M,mBAAA,IAAuB,CAAC;AAC/B,UAAM,EAAE,KAAK,IAAA,IAAQ,OAAO,OAAO,UAAA;AACnC,QAAI,KAAM,MAAK,SAAS,GAAG,GAAG,IAAI,GAAG;AACrC,UAAM,cAAc,IAAI,YAAY,WAAW,EAAE,QAAQ,SAAS,KAAA,CAAM,CAAC;AAAA,EAC1E;AACD;AAEA,cAAc,qBAAqB,sBAAsB;"}
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,EAAEJ,CAAI,IAAI,GACxCK,IAAO,IAAIC,EAAE,QAAQ,EAAE,MAAAH,GAAM,UAAU,CAAC,GAAG,CAAC,GAAG;AACrD,WAAK,QAAQ,KAAK,QAA0B,YAAY,KAAK,QAC7D,KAAK,SAAS,IAAIG,EAAE,OAAO,KAAKC,MAAgB;AAAA,QAC/C,WAAW,KAAK;AAAA,QAChB,UAAU;AAAA,QACV,MAAAF;AAAA,MAAA,CACA,GACD,KAAK,OAAO,UAAU,MAAM,IAAIG,EAAK,MAAM,eAAe,CAAC,EAAE,GAC7D,KAAK,OAAO,GAAG,WAAW,KAAKC,EAAc,GAE7CC,EAAG,MAAM,iBAAiB,IAAI,GAC9BF,EAAK,MAAM,QAAQ,GAAGR,CAAI,EAAE,GAC5BQ,EAAK,MAAM,QAAQ,QAAQ,GAC3BA,EAAK,MAAM,YAAY,GAAG,GAC1B,KAAK,yBAAyB,QAAQ;AAAA,IACvC,CAAC;AAAA,EACF;AAAA,EACA,yBAAyBG,GAAc;AACtC,UAAMC,IAAO,KAAK,QACZC,IAAU,KAAK,OAAO;AAE5B,QADIF,MAAS,mBAAiBC,GAAM,SAAA,GAAY,OAAA,GAC5CD,MAAS,eAAe;AAC3B,YAAMG,IAAS,KAAKP,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L } from 'leaflet';
2
2
  import { MTDSElement } from '../utils';
3
- import { MTDSAtlasElement } from './atlas-element';
3
+ import { MTDSAtlasCollection, MTDSAtlasElement } from './atlas-element';
4
4
  type Feature = L.Polygon["feature"];
5
- type Collection = Record<string, unknown>;
6
- type Collections = Map<string, Collection>;
7
5
  type LayerWithFeature = L.Layer & {
8
6
  feature?: Feature;
9
7
  };
@@ -14,12 +12,9 @@ declare global {
14
12
  interface GlobalEventHandlersEventMap {
15
13
  atlasfeatureclick: CustomEvent<Omit<L.LeafletMouseEvent, "target"> & {
16
14
  targets: LayerWithFeature[];
17
- collections: Collections;
15
+ collections: MTDSAtlasCollection[];
18
16
  }>;
19
17
  }
20
- interface Window {
21
- _matgeoCollections?: Promise<Collections>;
22
- }
23
18
  }
24
19
  export declare class MTDSAtlasMatgeoElement extends MTDSElement {
25
20
  #private;
@@ -32,6 +27,6 @@ export declare class MTDSAtlasMatgeoElement extends MTDSElement {
32
27
  disconnectedCallback(): void;
33
28
  refresh(nocache?: boolean | L.LeafletEvent): void;
34
29
  handleEvent(event: L.LeafletMouseEvent): void;
35
- getCollection(): Promise<any>;
30
+ getCollection(): Promise<MTDSAtlasCollection | undefined>;
36
31
  }
37
32
  export {};
@@ -1,93 +1,63 @@
1
- import { booleanPointInPolygon } from "../external/@turf/boolean-point-in-polygon/dist/esm/index.js";
2
- import { point } from "../external/@turf/helpers/dist/esm/index.js";
3
- import L from "../external/leaflet/dist/leaflet-src.js";
4
- import { isBrowser, defineElement, MTDSElement, debounce, attr } from "../utils.js";
5
- const MATGEO_EVENTS = "moveend zoomend refresh";
6
- const MATGEO_URL = "https://matgeoservice-256616427209.europe-north1.run.app/ogc/features/collections";
7
- if (isBrowser() && !window._matgeoCollections)
8
- window._matgeoCollections = fetch(MATGEO_URL).then((res) => res.json()).then((d) => new Map(d.collections?.map((c) => [c.id, c])));
9
- class MTDSAtlasMatgeoElement extends MTDSElement {
1
+ import { booleanPointInPolygon as c } from "../external/@turf/boolean-point-in-polygon/dist/esm/index.js";
2
+ import { point as d } from "../external/@turf/helpers/dist/esm/index.js";
3
+ import r from "../external/leaflet/dist/leaflet-src.js";
4
+ import { defineElement as g, MTDSElement as m, debounce as p, attr as n } from "../utils.js";
5
+ const h = "moveend zoomend refresh";
6
+ class u extends m {
10
7
  atlas;
11
8
  geojson;
12
9
  static get observedAttributes() {
13
10
  return ["hidden", "data-collection", "data-color", "popovertarget"];
14
11
  }
15
12
  constructor() {
16
- super();
17
- this.refresh = debounce(this.refresh, 300);
13
+ super(), this.refresh = p(this.refresh, 300);
18
14
  }
19
15
  connectedCallback() {
20
16
  queueMicrotask(() => {
21
- this.atlas = this.closest("mtds-atlas") || void 0;
22
- this.atlas?.map?.on(MATGEO_EVENTS, this.refresh, this);
23
- this.geojson = new L.GeoJSON(null, {
24
- style: this.#getStyle(),
25
- onEachFeature: (_, layer) => layer.on("click", this.handleEvent, this)
26
- }).bindPopup(() => `#${attr(this, "popovertarget")}`);
27
- this.refresh();
28
- this.attributeChangedCallback("hidden");
17
+ this.atlas = this.closest("mtds-atlas") || void 0, this.atlas?.map?.on(h, this.refresh, this), this.geojson = new r.GeoJSON(null, {
18
+ style: this.#t(),
19
+ onEachFeature: (t, s) => s.on("click", this.handleEvent, this)
20
+ }).bindPopup(() => `#${n(this, "popovertarget")}`), this.refresh(), this.attributeChangedCallback("hidden");
29
21
  });
30
22
  }
31
- attributeChangedCallback(name) {
32
- const geojson = this.geojson;
33
- const map = this.atlas?.map;
34
- if (name === "popovertarget") geojson?.getPopup()?.update();
35
- if (name === "data-color") geojson?.setStyle(this.#getStyle());
36
- if (name === "data-collection") this.refresh();
37
- if (name === "hidden" && geojson && map)
38
- map[this.hidden ? "removeLayer" : "addLayer"](geojson);
23
+ attributeChangedCallback(t) {
24
+ const s = this.geojson, o = this.atlas?.map;
25
+ t === "popovertarget" && s?.getPopup()?.update(), t === "data-color" && s?.setStyle(this.#t()), t === "data-collection" && this.refresh(), t === "hidden" && s && o && o[this.hidden ? "removeLayer" : "addLayer"](s);
39
26
  }
40
27
  disconnectedCallback() {
41
- this.atlas?.map?.off(MATGEO_EVENTS, this.refresh, this);
42
- this.geojson?.unbindPopup().remove();
43
- this.geojson = this.atlas = void 0;
44
- }
45
- refresh(nocache) {
46
- if (!this.geojson || !this.atlas?.map?.hasLayer(this.geojson)) return;
47
- getCollections().then((collections) => {
48
- const collection = attr(this, "data-collection") || "";
49
- const cache = nocache === true ? `&nocache=${Date.now()}` : "";
50
- const bbox = this.atlas?.map?.getBounds().toBBoxString();
51
- if (!collections.has(collection))
52
- console.warn(
53
- `mtds-atlas-matgeo: Please set a vaild \x1B[103mdata-collection="${Array.from(collections.keys()).join(" | ")}"\x1B[m`
54
- );
55
- else
56
- fetch(`${MATGEO_URL}/${collection}/items?bbox=${bbox}${cache}`).then((res) => res.json()).then((data) => this.geojson?.clearLayers().addData(data));
28
+ this.atlas?.map?.off(h, this.refresh, this), this.geojson?.unbindPopup().remove(), this.geojson = this.atlas = void 0;
29
+ }
30
+ refresh(t) {
31
+ !this.geojson || !this.atlas?.map?.hasLayer(this.geojson) || this.getCollection().then((s) => {
32
+ const o = s?.links.find(({ rel: e }) => e === "items"), a = t === !0 ? `&nocache=${Date.now()}` : "", i = this.atlas?.map?.getBounds().toBBoxString();
33
+ s ? fetch(`${o?.href}?bbox=${i}${a}`).then((e) => e.json()).then((e) => this.geojson?.clearLayers().addData(e)) : this.atlas?.getCollections().then((e) => {
34
+ const l = `mtds-atlas-matgeo: Please set a vaild \x1B[103mdata-collection="${Object.keys(e).join(" | ")}"\x1B[m`;
35
+ console.warn(l);
36
+ });
57
37
  });
58
38
  }
59
- handleEvent(event) {
60
- event.originalEvent.stopPropagation();
61
- getCollections().then((collections) => {
62
- const targets = [event.target];
63
- const detail = { ...event, targets, collections };
64
- const point$1 = point([event.latlng.lng, event.latlng.lat]);
65
- this.atlas?.map?.eachLayer((layer) => {
66
- if (layer === event.target) return;
67
- const inside = layer.feature?.geometry && booleanPointInPolygon(point$1, layer.feature.geometry) || layer instanceof L.Marker && layer.getLatLng().equals(event.latlng);
68
- if (inside) targets.push(layer);
69
- });
70
- this.dispatchEvent(new MouseEvent("click", event.originalEvent));
71
- this.dispatchEvent(
72
- new CustomEvent("atlasfeatureclick", { detail, bubbles: true })
39
+ handleEvent(t) {
40
+ t.originalEvent.stopPropagation(), this.atlas?.getCollections().then((s) => {
41
+ const o = [t.target], a = { ...t, targets: o, collections: s }, i = d([t.latlng.lng, t.latlng.lat]);
42
+ this.atlas?.map?.eachLayer((e) => {
43
+ if (e === t.target) return;
44
+ (e.feature?.geometry && c(i, e.feature.geometry) || e instanceof r.Marker && e.getLatLng().equals(t.latlng)) && o.push(e);
45
+ }), this.dispatchEvent(new MouseEvent("click", t.originalEvent)), this.dispatchEvent(
46
+ new CustomEvent("atlasfeatureclick", { detail: a, bubbles: !0 })
73
47
  );
74
48
  });
75
49
  }
76
50
  async getCollection() {
77
- const id = attr(this, "data-collection") || "";
78
- return getCollections().then((col) => col.get(id));
51
+ return this.atlas?.getCollections().then((t) => t?.[n(this, "data-collection") || ""]);
79
52
  }
80
- #getStyle() {
53
+ #t() {
81
54
  return {
82
- color: `var(--mtds-color-${attr(this, "data-color") || "main"}-base-default)`
55
+ color: `var(--mtds-color-${n(this, "data-color") || "main"}-base-default)`
83
56
  };
84
57
  }
85
58
  }
86
- defineElement("mtds-atlas-matgeo", MTDSAtlasMatgeoElement);
87
- function getCollections() {
88
- return window._matgeoCollections || Promise.resolve(/* @__PURE__ */ new Map());
89
- }
59
+ g("mtds-atlas-matgeo", u);
90
60
  export {
91
- MTDSAtlasMatgeoElement
61
+ u as MTDSAtlasMatgeoElement
92
62
  };
93
63
  //# sourceMappingURL=atlas-matgeo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"atlas-matgeo.js","sources":["../../designsystem/atlas/atlas-matgeo.ts"],"sourcesContent":["import { booleanPointInPolygon as inGeo } from \"@turf/boolean-point-in-polygon\";\nimport { point as turfPoint } from \"@turf/helpers\";\n\nimport L from \"leaflet\";\nimport {\n\tattr,\n\tdebounce,\n\tdefineElement,\n\tisBrowser,\n\tMTDSElement,\n} from \"../utils\";\nimport type { MTDSAtlasElement } from \"./atlas-element\";\n\ntype Feature = L.Polygon[\"feature\"];\ntype Collection = Record<string, unknown>;\ntype Collections = Map<string, Collection>;\ntype LayerWithFeature = L.Layer & { feature?: Feature };\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-atlas-matgeo\": MTDSAtlasMatgeoElement;\n\t}\n\tinterface GlobalEventHandlersEventMap {\n\t\tatlasfeatureclick: CustomEvent<\n\t\t\tOmit<L.LeafletMouseEvent, \"target\"> & {\n\t\t\t\ttargets: LayerWithFeature[];\n\t\t\t\tcollections: Collections;\n\t\t\t}\n\t\t>;\n\t}\n\tinterface Window {\n\t\t_matgeoCollections?: Promise<Collections>;\n\t}\n}\n\nconst MATGEO_EVENTS = \"moveend zoomend refresh\";\nconst MATGEO_URL =\n\t\"https://matgeoservice-256616427209.europe-north1.run.app/ogc/features/collections\";\n\nif (isBrowser() && !window._matgeoCollections)\n\twindow._matgeoCollections = fetch(MATGEO_URL)\n\t\t.then((res) => res.json())\n\t\t.then((d) => new Map(d.collections?.map((c: Collection) => [c.id, c])));\n\nexport class MTDSAtlasMatgeoElement extends MTDSElement {\n\tatlas?: MTDSAtlasElement;\n\tgeojson?: L.GeoJSON;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"hidden\", \"data-collection\", \"data-color\", \"popovertarget\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.refresh = debounce(this.refresh, 300); // Debounce to avoid too many requests\n\t}\n\tconnectedCallback() {\n\t\tqueueMicrotask(() => {\n\t\t\tthis.atlas = this.closest<MTDSAtlasElement>(\"mtds-atlas\") || undefined;\n\t\t\tthis.atlas?.map?.on(MATGEO_EVENTS, this.refresh, this);\n\t\t\tthis.geojson = new L.GeoJSON(null, {\n\t\t\t\tstyle: this.#getStyle(),\n\t\t\t\tonEachFeature: (_, layer) => layer.on(\"click\", this.handleEvent, this),\n\t\t\t}).bindPopup(() => `#${attr(this, \"popovertarget\")}`);\n\t\t\tthis.refresh();\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 geojson = this.geojson;\n\t\tconst map = this.atlas?.map;\n\t\tif (name === \"popovertarget\") geojson?.getPopup()?.update();\n\t\tif (name === \"data-color\") geojson?.setStyle(this.#getStyle());\n\t\tif (name === \"data-collection\") this.refresh();\n\t\tif (name === \"hidden\" && geojson && map)\n\t\t\tmap[this.hidden ? \"removeLayer\" : \"addLayer\"](geojson);\n\t}\n\tdisconnectedCallback() {\n\t\tthis.atlas?.map?.off(MATGEO_EVENTS, this.refresh, this);\n\t\tthis.geojson?.unbindPopup().remove();\n\t\tthis.geojson = this.atlas = undefined;\n\t}\n\trefresh(nocache?: boolean | L.LeafletEvent) {\n\t\tif (!this.geojson || !this.atlas?.map?.hasLayer(this.geojson)) return;\n\t\tgetCollections().then((collections) => {\n\t\t\tconst collection = attr(this, \"data-collection\") || \"\";\n\t\t\tconst cache = nocache === true ? `&nocache=${Date.now()}` : \"\";\n\t\t\tconst bbox = this.atlas?.map?.getBounds().toBBoxString();\n\t\t\tif (!collections.has(collection))\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`mtds-atlas-matgeo: Please set a vaild \\x1B[103mdata-collection=\"${Array.from(collections.keys()).join(\" | \")}\"\\x1B[m`,\n\t\t\t\t);\n\t\t\telse\n\t\t\t\tfetch(`${MATGEO_URL}/${collection}/items?bbox=${bbox}${cache}`)\n\t\t\t\t\t.then((res) => res.json())\n\t\t\t\t\t.then((data) => this.geojson?.clearLayers().addData(data));\n\t\t});\n\t}\n\thandleEvent(event: L.LeafletMouseEvent) {\n\t\tevent.originalEvent.stopPropagation(); // Prevent clicks from bubbling from ShadowDOM\n\t\tgetCollections().then((collections) => {\n\t\t\tconst targets: LayerWithFeature[] = [event.target]; // Leaflet does not list all clicked layers, so we find them manually\n\t\t\tconst detail = { ...event, targets, collections };\n\t\t\tconst point = turfPoint([event.latlng.lng, event.latlng.lat]);\n\n\t\t\tthis.atlas?.map?.eachLayer((layer: LayerWithFeature) => {\n\t\t\t\tif (layer === event.target) return; // Already added\n\t\t\t\tconst inside =\n\t\t\t\t\t(layer.feature?.geometry && inGeo(point, layer.feature.geometry)) ||\n\t\t\t\t\t(layer instanceof L.Marker && layer.getLatLng().equals(event.latlng));\n\t\t\t\tif (inside) targets.push(layer);\n\t\t\t});\n\n\t\t\tthis.dispatchEvent(new MouseEvent(\"click\", event.originalEvent)); // Forward click, but from <mtds-atlas-matgeo> element\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent(\"atlasfeatureclick\", { detail, bubbles: true }),\n\t\t\t);\n\t\t});\n\t}\n\tasync getCollection() {\n\t\tconst id = attr(this, \"data-collection\") || \"\";\n\t\treturn getCollections().then((col) => col.get(id));\n\t}\n\t#getStyle() {\n\t\treturn {\n\t\t\tcolor: `var(--mtds-color-${attr(this, \"data-color\") || \"main\"}-base-default)`,\n\t\t};\n\t}\n}\n\ndefineElement(\"mtds-atlas-matgeo\", MTDSAtlasMatgeoElement);\n\nfunction getCollections() {\n\treturn window._matgeoCollections || Promise.resolve(new Map());\n}\n"],"names":["point","turfPoint","inGeo"],"mappings":";;;;AAkCA,MAAM,gBAAgB;AACtB,MAAM,aACL;AAED,IAAI,UAAA,KAAe,CAAC,OAAO;AAC1B,SAAO,qBAAqB,MAAM,UAAU,EAC1C,KAAK,CAAC,QAAQ,IAAI,KAAA,CAAM,EACxB,KAAK,CAAC,MAAM,IAAI,IAAI,EAAE,aAAa,IAAI,CAAC,MAAkB,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAEjE,MAAM,+BAA+B,YAAY;AAAA,EACvD;AAAA,EACA;AAAA,EAEA,WAAW,qBAAqB;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AK,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;AAAA,EAClD;AAAA,EACA,YAAY;AACX,WAAO;AAAA,MACN,OAAO,oBAAoB,KAAK,MAAM,YAAY,KAAK,MAAM;AAAA,IAAA;AAAA,EAE/D;AACD;AAEA,cAAc,qBAAqB,sBAAsB;AAEzD,SAAS,iBAAiB;AACzB,SAAO,OAAO,sBAAsB,QAAQ,QAAQ,oBAAI,KAAK;AAC9D;"}
1
+ {"version":3,"file":"atlas-matgeo.js","sources":["../../designsystem/atlas/atlas-matgeo.ts"],"sourcesContent":["import { booleanPointInPolygon as inGeo } from \"@turf/boolean-point-in-polygon\";\nimport { point as turfPoint } from \"@turf/helpers\";\n\nimport L from \"leaflet\";\nimport { attr, debounce, defineElement, MTDSElement } from \"../utils\";\nimport type { MTDSAtlasCollection, MTDSAtlasElement } from \"./atlas-element\";\n\ntype Feature = L.Polygon[\"feature\"];\ntype LayerWithFeature = L.Layer & { feature?: Feature };\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-atlas-matgeo\": MTDSAtlasMatgeoElement;\n\t}\n\tinterface GlobalEventHandlersEventMap {\n\t\tatlasfeatureclick: CustomEvent<\n\t\t\tOmit<L.LeafletMouseEvent, \"target\"> & {\n\t\t\t\ttargets: LayerWithFeature[];\n\t\t\t\tcollections: MTDSAtlasCollection[];\n\t\t\t}\n\t\t>;\n\t}\n}\n\nconst EVENTS = \"moveend zoomend refresh\";\n\nexport class MTDSAtlasMatgeoElement extends MTDSElement {\n\tatlas?: MTDSAtlasElement;\n\tgeojson?: L.GeoJSON;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"hidden\", \"data-collection\", \"data-color\", \"popovertarget\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconstructor() {\n\t\tsuper();\n\t\tthis.refresh = debounce(this.refresh, 300); // Debounce to avoid too many requests\n\t}\n\tconnectedCallback() {\n\t\tqueueMicrotask(() => {\n\t\t\tthis.atlas = this.closest<MTDSAtlasElement>(\"mtds-atlas\") || undefined;\n\t\t\tthis.atlas?.map?.on(EVENTS, this.refresh, this);\n\t\t\tthis.geojson = new L.GeoJSON(null, {\n\t\t\t\tstyle: this.#getStyle(),\n\t\t\t\tonEachFeature: (_, layer) => layer.on(\"click\", this.handleEvent, this),\n\t\t\t}).bindPopup(() => `#${attr(this, \"popovertarget\")}`);\n\t\t\tthis.refresh();\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 geojson = this.geojson;\n\t\tconst map = this.atlas?.map;\n\t\tif (name === \"popovertarget\") geojson?.getPopup()?.update();\n\t\tif (name === \"data-color\") geojson?.setStyle(this.#getStyle());\n\t\tif (name === \"data-collection\") this.refresh();\n\t\tif (name === \"hidden\" && geojson && map)\n\t\t\tmap[this.hidden ? \"removeLayer\" : \"addLayer\"](geojson);\n\t}\n\tdisconnectedCallback() {\n\t\tthis.atlas?.map?.off(EVENTS, this.refresh, this);\n\t\tthis.geojson?.unbindPopup().remove();\n\t\tthis.geojson = this.atlas = undefined;\n\t}\n\trefresh(nocache?: boolean | L.LeafletEvent) {\n\t\tif (!this.geojson || !this.atlas?.map?.hasLayer(this.geojson)) return;\n\t\tthis.getCollection().then((collection) => {\n\t\t\tconst items = collection?.links.find(({ rel }) => rel === \"items\");\n\t\t\tconst cache = nocache === true ? `&nocache=${Date.now()}` : \"\";\n\t\t\tconst bbox = this.atlas?.map?.getBounds().toBBoxString();\n\n\t\t\tif (!collection)\n\t\t\t\tthis.atlas?.getCollections().then((collections) => {\n\t\t\t\t\tconst message = `mtds-atlas-matgeo: Please set a vaild \\x1B[103mdata-collection=\"${Object.keys(collections).join(\" | \")}\"\\x1B[m`;\n\t\t\t\t\tconsole.warn(message);\n\t\t\t\t});\n\t\t\telse\n\t\t\t\tfetch(`${items?.href}?bbox=${bbox}${cache}`)\n\t\t\t\t\t.then((res) => res.json())\n\t\t\t\t\t.then((data) => this.geojson?.clearLayers().addData(data));\n\t\t});\n\t}\n\thandleEvent(event: L.LeafletMouseEvent) {\n\t\tevent.originalEvent.stopPropagation(); // Prevent clicks from bubbling from ShadowDOM\n\t\tthis.atlas?.getCollections().then((collections) => {\n\t\t\tconst targets: LayerWithFeature[] = [event.target]; // Leaflet does not list all clicked layers, so we find them manually\n\t\t\tconst detail = { ...event, targets, collections };\n\t\t\tconst point = turfPoint([event.latlng.lng, event.latlng.lat]);\n\n\t\t\tthis.atlas?.map?.eachLayer((layer: LayerWithFeature) => {\n\t\t\t\tif (layer === event.target) return; // Already added\n\t\t\t\tconst inside =\n\t\t\t\t\t(layer.feature?.geometry && inGeo(point, layer.feature.geometry)) ||\n\t\t\t\t\t(layer instanceof L.Marker && layer.getLatLng().equals(event.latlng));\n\t\t\t\tif (inside) targets.push(layer);\n\t\t\t});\n\n\t\t\tthis.dispatchEvent(new MouseEvent(\"click\", event.originalEvent)); // Forward click, but from <mtds-atlas-matgeo> element\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent(\"atlasfeatureclick\", { detail, bubbles: true }),\n\t\t\t);\n\t\t});\n\t}\n\tasync getCollection() {\n\t\treturn this.atlas\n\t\t\t?.getCollections()\n\t\t\t.then((cols) => cols?.[attr(this, \"data-collection\") || \"\"]);\n\t}\n\t#getStyle() {\n\t\treturn {\n\t\t\tcolor: `var(--mtds-color-${attr(this, \"data-color\") || \"main\"}-base-default)`,\n\t\t};\n\t}\n}\n\ndefineElement(\"mtds-atlas-matgeo\", MTDSAtlasMatgeoElement);\n"],"names":["EVENTS","MTDSAtlasMatgeoElement","MTDSElement","debounce","L","#getStyle","_","layer","attr","name","geojson","map","nocache","collection","items","rel","cache","bbox","res","data","collections","message","event","targets","detail","point","turfPoint","inGeo","cols","defineElement"],"mappings":";;;;AAuBA,MAAMA,IAAS;AAER,MAAMC,UAA+BC,EAAY;AAAA,EACvD;AAAA,EACA;AAAA,EAEA,WAAW,qBAAqB;AA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;AAAA,EACA,MAAM,gBAAgB;AACrB,WAAO,KAAK,OACT,eAAA,EACD,KAAK,CAACI,MAASA,IAAOpB,EAAK,MAAM,iBAAiB,KAAK,EAAE,CAAC;AAAA,EAC7D;AAAA,EACAH,KAAY;AACX,WAAO;AAAA,MACN,OAAO,oBAAoBG,EAAK,MAAM,YAAY,KAAK,MAAM;AAAA,IAAA;AAAA,EAE/D;AACD;AAEAqB,EAAc,qBAAqB5B,CAAsB;"}
@@ -1,6 +1,6 @@
1
- import L from "../external/leaflet/dist/leaflet-src.js";
2
- import { defineElement, MTDSElement, attr } from "../utils.js";
3
- class MTDSAtlasWMSElement extends MTDSElement {
1
+ import s from "../external/leaflet/dist/leaflet-src.js";
2
+ import { defineElement as a, MTDSElement as i, attr as r } from "../utils.js";
3
+ class d extends i {
4
4
  atlas;
5
5
  wms;
6
6
  static get observedAttributes() {
@@ -8,32 +8,22 @@ class MTDSAtlasWMSElement extends MTDSElement {
8
8
  }
9
9
  connectedCallback() {
10
10
  queueMicrotask(() => {
11
- this.atlas = this.closest("mtds-atlas") || void 0;
12
- this.refresh();
11
+ this.atlas = this.closest("mtds-atlas") || void 0, this.refresh();
13
12
  });
14
13
  }
15
- attributeChangedCallback(name) {
16
- if (name === "data-url") this.refresh();
17
- if (name === "popovertarget") this.wms?.getPopup()?.update();
18
- if (name === "hidden" && this.wms) {
19
- this.atlas?.map?.[this.hidden ? "removeLayer" : "addLayer"](this.wms);
20
- this.wms.bringToFront();
21
- }
14
+ attributeChangedCallback(t) {
15
+ t === "data-url" && this.refresh(), t === "popovertarget" && this.wms?.getPopup()?.update(), t === "hidden" && this.wms && (this.atlas?.map?.[this.hidden ? "removeLayer" : "addLayer"](this.wms), this.wms.bringToFront());
22
16
  }
23
17
  refresh() {
24
- const url = new URL(attr(this, "data-url") || "");
25
- const params = Object.fromEntries(url.searchParams.entries());
26
- this.wms?.unbindPopup().remove();
27
- this.wms = new L.TileLayer.WMS(`${url.origin}${url.pathname}`, params);
28
- this.attributeChangedCallback("hidden");
18
+ const t = new URL(r(this, "data-url") || ""), e = Object.fromEntries(t.searchParams.entries());
19
+ this.wms?.unbindPopup().remove(), this.wms = new s.TileLayer.WMS(`${t.origin}${t.pathname}`, e), this.attributeChangedCallback("hidden");
29
20
  }
30
21
  disconnectedCallback() {
31
- this.wms?.unbindPopup().remove();
32
- this.wms = this.atlas = void 0;
22
+ this.wms?.unbindPopup().remove(), this.wms = this.atlas = void 0;
33
23
  }
34
24
  }
35
- defineElement("mtds-atlas-wms", MTDSAtlasWMSElement);
25
+ a("mtds-atlas-wms", d);
36
26
  export {
37
- MTDSAtlasWMSElement
27
+ d as MTDSAtlasWMSElement
38
28
  };
39
29
  //# sourceMappingURL=atlas-wms.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"atlas-wms.js","sources":["../../designsystem/atlas/atlas-wms.ts"],"sourcesContent":["import L from \"leaflet\";\nimport { attr, defineElement, MTDSElement } from \"../utils\";\nimport type { MTDSAtlasElement } from \"./atlas-element\";\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-atlas-wms\": MTDSAtlasWMSElement;\n\t}\n}\n\nexport class MTDSAtlasWMSElement extends MTDSElement {\n\tatlas?: MTDSAtlasElement;\n\twms?: L.TileLayer.WMS;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"hidden\", \"data-url\", \"popovertarget\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconnectedCallback() {\n\t\tqueueMicrotask(() => {\n\t\t\tthis.atlas = this.closest<MTDSAtlasElement>(\"mtds-atlas\") || undefined;\n\t\t\tthis.refresh();\n\t\t}); // Let the atlas parent initialize first\n\t}\n\tattributeChangedCallback(name?: string) {\n\t\tif (name === \"data-url\") this.refresh();\n\t\tif (name === \"popovertarget\") this.wms?.getPopup()?.update();\n\t\tif (name === \"hidden\" && this.wms) {\n\t\t\tthis.atlas?.map?.[this.hidden ? \"removeLayer\" : \"addLayer\"](this.wms);\n\t\t\tthis.wms.bringToFront();\n\t\t}\n\t}\n\trefresh() {\n\t\tconst url = new URL(attr(this, \"data-url\") || \"\");\n\t\tconst params = Object.fromEntries(url.searchParams.entries());\n\t\tthis.wms?.unbindPopup().remove();\n\t\tthis.wms = new L.TileLayer.WMS(`${url.origin}${url.pathname}`, params);\n\t\tthis.attributeChangedCallback(\"hidden\"); // Maybe add to map\n\t}\n\tdisconnectedCallback() {\n\t\tthis.wms?.unbindPopup().remove();\n\t\tthis.wms = this.atlas = undefined;\n\t}\n}\n\ndefineElement(\"mtds-atlas-wms\", MTDSAtlasWMSElement);\n"],"names":[],"mappings":";;AAUO,MAAM,4BAA4B,YAAY;AAAA,EACpD;AAAA,EACA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,UAAU,YAAY,eAAe;AAAA,EAC9C;AAAA,EACA,oBAAoB;AACnB,mBAAe,MAAM;AACpB,WAAK,QAAQ,KAAK,QAA0B,YAAY,KAAK;AAC7D,WAAK,QAAA;AAAA,IACN,CAAC;AAAA,EACF;AAAA,EACA,yBAAyB,MAAe;AACvC,QAAI,SAAS,WAAY,MAAK,QAAA;AAC9B,QAAI,SAAS,gBAAiB,MAAK,KAAK,SAAA,GAAY,OAAA;AACpD,QAAI,SAAS,YAAY,KAAK,KAAK;AAClC,WAAK,OAAO,MAAM,KAAK,SAAS,gBAAgB,UAAU,EAAE,KAAK,GAAG;AACpE,WAAK,IAAI,aAAA;AAAA,IACV;AAAA,EACD;AAAA,EACA,UAAU;AACT,UAAM,MAAM,IAAI,IAAI,KAAK,MAAM,UAAU,KAAK,EAAE;AAChD,UAAM,SAAS,OAAO,YAAY,IAAI,aAAa,SAAS;AAC5D,SAAK,KAAK,YAAA,EAAc,OAAA;AACxB,SAAK,MAAM,IAAI,EAAE,UAAU,IAAI,GAAG,IAAI,MAAM,GAAG,IAAI,QAAQ,IAAI,MAAM;AACrE,SAAK,yBAAyB,QAAQ;AAAA,EACvC;AAAA,EACA,uBAAuB;AACtB,SAAK,KAAK,YAAA,EAAc,OAAA;AACxB,SAAK,MAAM,KAAK,QAAQ;AAAA,EACzB;AACD;AAEA,cAAc,kBAAkB,mBAAmB;"}
1
+ {"version":3,"file":"atlas-wms.js","sources":["../../designsystem/atlas/atlas-wms.ts"],"sourcesContent":["import L from \"leaflet\";\nimport { attr, defineElement, MTDSElement } from \"../utils\";\nimport type { MTDSAtlasElement } from \"./atlas-element\";\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t\"mtds-atlas-wms\": MTDSAtlasWMSElement;\n\t}\n}\n\nexport class MTDSAtlasWMSElement extends MTDSElement {\n\tatlas?: MTDSAtlasElement;\n\twms?: L.TileLayer.WMS;\n\n\tstatic get observedAttributes() {\n\t\treturn [\"hidden\", \"data-url\", \"popovertarget\"]; // Using ES2015 syntax for backwards compatibility\n\t}\n\tconnectedCallback() {\n\t\tqueueMicrotask(() => {\n\t\t\tthis.atlas = this.closest<MTDSAtlasElement>(\"mtds-atlas\") || undefined;\n\t\t\tthis.refresh();\n\t\t}); // Let the atlas parent initialize first\n\t}\n\tattributeChangedCallback(name?: string) {\n\t\tif (name === \"data-url\") this.refresh();\n\t\tif (name === \"popovertarget\") this.wms?.getPopup()?.update();\n\t\tif (name === \"hidden\" && this.wms) {\n\t\t\tthis.atlas?.map?.[this.hidden ? \"removeLayer\" : \"addLayer\"](this.wms);\n\t\t\tthis.wms.bringToFront();\n\t\t}\n\t}\n\trefresh() {\n\t\tconst url = new URL(attr(this, \"data-url\") || \"\");\n\t\tconst params = Object.fromEntries(url.searchParams.entries());\n\t\tthis.wms?.unbindPopup().remove();\n\t\tthis.wms = new L.TileLayer.WMS(`${url.origin}${url.pathname}`, params);\n\t\tthis.attributeChangedCallback(\"hidden\"); // Maybe add to map\n\t}\n\tdisconnectedCallback() {\n\t\tthis.wms?.unbindPopup().remove();\n\t\tthis.wms = this.atlas = undefined;\n\t}\n}\n\ndefineElement(\"mtds-atlas-wms\", MTDSAtlasWMSElement);\n"],"names":["MTDSAtlasWMSElement","MTDSElement","name","url","attr","params","L","defineElement"],"mappings":";;AAUO,MAAMA,UAA4BC,EAAY;AAAA,EACpD;AAAA,EACA;AAAA,EAEA,WAAW,qBAAqB;AAC/B,WAAO,CAAC,UAAU,YAAY,eAAe;AAAA,EAC9C;AAAA,EACA,oBAAoB;AACnB,mBAAe,MAAM;AACpB,WAAK,QAAQ,KAAK,QAA0B,YAAY,KAAK,QAC7D,KAAK,QAAA;AAAA,IACN,CAAC;AAAA,EACF;AAAA,EACA,yBAAyBC,GAAe;AACvC,IAAIA,MAAS,cAAY,KAAK,QAAA,GAC1BA,MAAS,mBAAiB,KAAK,KAAK,SAAA,GAAY,OAAA,GAChDA,MAAS,YAAY,KAAK,QAC7B,KAAK,OAAO,MAAM,KAAK,SAAS,gBAAgB,UAAU,EAAE,KAAK,GAAG,GACpE,KAAK,IAAI,aAAA;AAAA,EAEX;AAAA,EACA,UAAU;AACT,UAAMC,IAAM,IAAI,IAAIC,EAAK,MAAM,UAAU,KAAK,EAAE,GAC1CC,IAAS,OAAO,YAAYF,EAAI,aAAa,SAAS;AAC5D,SAAK,KAAK,YAAA,EAAc,OAAA,GACxB,KAAK,MAAM,IAAIG,EAAE,UAAU,IAAI,GAAGH,EAAI,MAAM,GAAGA,EAAI,QAAQ,IAAIE,CAAM,GACrE,KAAK,yBAAyB,QAAQ;AAAA,EACvC;AAAA,EACA,uBAAuB;AACtB,SAAK,KAAK,YAAA,EAAc,OAAA,GACxB,KAAK,MAAM,KAAK,QAAQ;AAAA,EACzB;AACD;AAEAE,EAAc,kBAAkBP,CAAmB;"}
@@ -1,4 +1,4 @@
1
- const css = `/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */
1
+ const t = `/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */
2
2
  :host {
3
3
  --mtdsc-atlas-border: 1px solid var(--mtds-color-border-subtle);
4
4
  --mtdsc-atlas-cluster-border: 1px solid;
@@ -123,6 +123,6 @@ const css = `/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */
123
123
  .leaflet-popup:has(slot) .leaflet-popup-content { margin: 0; font: inherit }
124
124
  `;
125
125
  export {
126
- css as default
126
+ t as default
127
127
  };
128
128
  //# sourceMappingURL=atlas.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"atlas.css.js","sources":["../../designsystem/atlas/atlas.css?raw"],"sourcesContent":["export default \"/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */\\n:host {\\n\\t--mtdsc-atlas-border: 1px solid var(--mtds-color-border-subtle);\\n\\t--mtdsc-atlas-cluster-border: 1px solid;\\n\\t--mtdsc-atlas-marker-background: var(--mtds-color-base-default);\\n\\t--mtdsc-atlas-marker-border: 1px solid;\\n\\t--mtdsc-atlas-marker-color: var(--mtds-color-base-contrast-default);\\n\\t--mtdsc-atlas-marker-inset: 3px;\\n\\t--mtdsc-atlas-marker-shadow: rgba(0,0,0,.2);\\n\\t--mtdsc-atlas-marker-size: var(--mtds-6);\\n\\t--mtdsc-atlas-tile-background: #fbfbfb;\\n\\t--mtdsc-atlas-tile-filter: grayscale(1) contrast(0.75) brightness(1.15);\\n\\n\\tborder-radius: var(--mtds-border-radius-md);\\n\\taspect-ratio: 2;\\n\\toverflow: clip;\\n\\tposition: relative;\\n}\\n:host(:not([hidden])) { display: block }\\n:host([data-cursor=\\\"pointer\\\"]) .leaflet-grab { cursor: pointer }\\n\\n/* Focus */\\n.leaflet-control-zoom a:focus-visible,\\n:host:has(.leaflet-container:focus-visible),\\n::slotted(mtds-atlas-marker:focus-visible) {\\n\\tbox-shadow: var(--mtdsc-focus-boxShadow);\\n\\toutline: var(--mtdsc-focus-outline);\\n\\toutline-offset: var(--mtds-border-width-focus);\\n}\\n\\n/* Tiles */\\n.leaflet-kartverket-tiles { filter: var(--mtdsc-atlas-tile-filter); transition: filter 0.5s }\\n.leaflet-container {\\n\\tbackground: var(--mtdsc-atlas-tile-background);\\n\\tborder-radius: inherit;\\n\\tborder: var(--mtdsc-atlas-border);\\n\\tbox-sizing: border-box;\\n\\tfont: inherit;\\n\\theight: 100%;\\n\\tmargin: 0;\\n\\toutline: 0;\\n\\tposition: relative;\\n\\tz-index: 1; /* Ensure <slot> is always on top */\\n}\\n:host([data-tiles=\\\"color\\\"]) {\\n\\t--mtdsc-atlas-tile-background: #e5fcfd;\\n\\t--mtdsc-atlas-tile-filter: grayscale(0.2);\\n}\\n\\n/* Controls */\\n.leaflet-control-attribution { font-size: 12px; border-top-left-radius: var(--mtds-border-radius-md) }\\n.leaflet-control-zoom { border-radius: var(--mtds-border-radius-md); border: 1px solid var(--mtds-color-border-default) }\\n.leaflet-control-zoom a { background: var(--mtds-color-surface-default); border-color: inherit; color: var(--mtds-color-text-default); height: var(--mtds-10); line-height: var(--mtds-10); transition: 0.2s; width: var(--mtds-10) }\\n.leaflet-control-zoom a:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit }\\n.leaflet-control-zoom a:last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit }\\n.leaflet-control-zoom a:hover { background: var(--mtds-color-surface-hover) }\\n.leaflet-control-zoom a:active { background: var(--mtds-color-surface-active) }\\n\\n/* Markers */\\n.leaflet-marker-generated-icon,\\n::slotted(mtds-atlas-marker) {\\n\\tall: unset;\\n\\tcolor: var(--mtdsc-atlas-marker-color);\\n\\tbackground: var(--mtdsc-atlas-marker-background);\\n\\tborder-radius: 100%;\\n\\tbox-sizing: border-box;\\n\\tcursor: pointer;\\n\\tdisplay: grid;\\n\\tplace-items: center;\\n\\tplace-content: center;\\n\\tfont-size: var(--mtds-body-sm-font-size);\\n\\tfont-weight: var(--mtds-font-weight-bold);\\n\\theight: var(--mtdsc-atlas-marker-size);\\n\\t/* biome-ignore lint/complexity/noImportantStyles: Overwrite Tailwind */\\n\\tmargin-bottom: calc(var(--mtdsc-atlas-marker-size) * .25 + var(--mtdsc-atlas-marker-inset))!important;\\n\\twidth: var(--mtdsc-atlas-marker-size);\\n}\\n.leaflet-marker-generated-icon::after,\\n::slotted(mtds-atlas-marker)::after {\\n\\tbox-shadow: 2px 2px 2px var(--mtdsc-atlas-marker-shadow);\\n\\taspect-ratio: 1;\\n\\tbackground: var(--mtdsc-atlas-marker-color);\\n\\tcolor: var(--mtdsc-atlas-marker-background);\\n\\tborder-radius: 50% 50% 0 50%;\\n\\t/* biome-ignore lint/complexity/noImportantStyles: Overwrite Tailwind */\\n\\tborder: var(--mtdsc-atlas-marker-border)!important;\\n\\tcontent: \\\"\\\";\\n\\trotate: 45deg;\\n\\tposition: absolute;\\n\\tinset: calc(var(--mtdsc-atlas-marker-inset) * -1);\\n\\tz-index: -1;\\n}\\n::slotted(mtds-atlas-marker[data-color]) {\\n\\t--mtdsc-atlas-marker-background: var(--mtds-color-base-default); /* Ensure data-color is respected */\\n\\t--mtdsc-atlas-marker-color: var(--mtds-color-base-contrast-default);\\n}\\n::slotted(mtds-atlas-marker.leaflet-drag-target) {\\n\\tcursor: grabbing;\\n}\\n\\n.leaflet-marker-generated-slot,\\n.leaflet-marker-icon slot { display: block; position: absolute; left: 0; top: 0; translate: -50% -100% }\\n.leaflet-marker-icon { background: none; border: 0 }\\n.leaflet-cluster-icon {\\n\\tbox-shadow: 0 3px 3px var(--mtdsc-atlas-marker-shadow);\\n\\tbackground-color: var(--mtds-color-base-default);\\n\\tborder-radius: 100%;\\n\\tborder: var(--mtdsc-atlas-cluster-border);\\n\\tbox-sizing: border-box;\\n\\toutline: 1px solid var(--mtds-color-base-default);\\n\\tcolor: var(--mtds-color-base-contrast-default);\\n\\tdisplay: flex;\\n\\tfont-size: var(--mtds-body-xs-font-size);\\n\\tfont-weight: var(--mtds-font-weight-bold);\\n\\tplace-content: center;\\n\\tplace-items: center;\\n}\\n\\n/* Popover */\\n.leaflet-popup:has(slot) .leaflet-popup-tip { background: var(--mtds-color-surface-default) }\\n.leaflet-popup:has(slot) .leaflet-popup-close-button { display: none } /* Popup closes on clicking marker anyway */\\n.leaflet-popup:has(slot) .leaflet-popup-content-wrapper { display: contents } /* No need for styling this element */\\n.leaflet-popup:has(slot) .leaflet-popup-content { margin: 0; font: inherit }\\n\""],"names":[],"mappings":"AAAA,MAAA,MAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"atlas.css.js","sources":["../../designsystem/atlas/atlas.css?raw"],"sourcesContent":["export default \"/* NOTE: Using --mtds- not --mtds- since we're inside shadow dom */\\n:host {\\n\\t--mtdsc-atlas-border: 1px solid var(--mtds-color-border-subtle);\\n\\t--mtdsc-atlas-cluster-border: 1px solid;\\n\\t--mtdsc-atlas-marker-background: var(--mtds-color-base-default);\\n\\t--mtdsc-atlas-marker-border: 1px solid;\\n\\t--mtdsc-atlas-marker-color: var(--mtds-color-base-contrast-default);\\n\\t--mtdsc-atlas-marker-inset: 3px;\\n\\t--mtdsc-atlas-marker-shadow: rgba(0,0,0,.2);\\n\\t--mtdsc-atlas-marker-size: var(--mtds-6);\\n\\t--mtdsc-atlas-tile-background: #fbfbfb;\\n\\t--mtdsc-atlas-tile-filter: grayscale(1) contrast(0.75) brightness(1.15);\\n\\n\\tborder-radius: var(--mtds-border-radius-md);\\n\\taspect-ratio: 2;\\n\\toverflow: clip;\\n\\tposition: relative;\\n}\\n:host(:not([hidden])) { display: block }\\n:host([data-cursor=\\\"pointer\\\"]) .leaflet-grab { cursor: pointer }\\n\\n/* Focus */\\n.leaflet-control-zoom a:focus-visible,\\n:host:has(.leaflet-container:focus-visible),\\n::slotted(mtds-atlas-marker:focus-visible) {\\n\\tbox-shadow: var(--mtdsc-focus-boxShadow);\\n\\toutline: var(--mtdsc-focus-outline);\\n\\toutline-offset: var(--mtds-border-width-focus);\\n}\\n\\n/* Tiles */\\n.leaflet-kartverket-tiles { filter: var(--mtdsc-atlas-tile-filter); transition: filter 0.5s }\\n.leaflet-container {\\n\\tbackground: var(--mtdsc-atlas-tile-background);\\n\\tborder-radius: inherit;\\n\\tborder: var(--mtdsc-atlas-border);\\n\\tbox-sizing: border-box;\\n\\tfont: inherit;\\n\\theight: 100%;\\n\\tmargin: 0;\\n\\toutline: 0;\\n\\tposition: relative;\\n\\tz-index: 1; /* Ensure <slot> is always on top */\\n}\\n:host([data-tiles=\\\"color\\\"]) {\\n\\t--mtdsc-atlas-tile-background: #e5fcfd;\\n\\t--mtdsc-atlas-tile-filter: grayscale(0.2);\\n}\\n\\n/* Controls */\\n.leaflet-control-attribution { font-size: 12px; border-top-left-radius: var(--mtds-border-radius-md) }\\n.leaflet-control-zoom { border-radius: var(--mtds-border-radius-md); border: 1px solid var(--mtds-color-border-default) }\\n.leaflet-control-zoom a { background: var(--mtds-color-surface-default); border-color: inherit; color: var(--mtds-color-text-default); height: var(--mtds-10); line-height: var(--mtds-10); transition: 0.2s; width: var(--mtds-10) }\\n.leaflet-control-zoom a:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit }\\n.leaflet-control-zoom a:last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit }\\n.leaflet-control-zoom a:hover { background: var(--mtds-color-surface-hover) }\\n.leaflet-control-zoom a:active { background: var(--mtds-color-surface-active) }\\n\\n/* Markers */\\n.leaflet-marker-generated-icon,\\n::slotted(mtds-atlas-marker) {\\n\\tall: unset;\\n\\tcolor: var(--mtdsc-atlas-marker-color);\\n\\tbackground: var(--mtdsc-atlas-marker-background);\\n\\tborder-radius: 100%;\\n\\tbox-sizing: border-box;\\n\\tcursor: pointer;\\n\\tdisplay: grid;\\n\\tplace-items: center;\\n\\tplace-content: center;\\n\\tfont-size: var(--mtds-body-sm-font-size);\\n\\tfont-weight: var(--mtds-font-weight-bold);\\n\\theight: var(--mtdsc-atlas-marker-size);\\n\\t/* biome-ignore lint/complexity/noImportantStyles: Overwrite Tailwind */\\n\\tmargin-bottom: calc(var(--mtdsc-atlas-marker-size) * .25 + var(--mtdsc-atlas-marker-inset))!important;\\n\\twidth: var(--mtdsc-atlas-marker-size);\\n}\\n.leaflet-marker-generated-icon::after,\\n::slotted(mtds-atlas-marker)::after {\\n\\tbox-shadow: 2px 2px 2px var(--mtdsc-atlas-marker-shadow);\\n\\taspect-ratio: 1;\\n\\tbackground: var(--mtdsc-atlas-marker-color);\\n\\tcolor: var(--mtdsc-atlas-marker-background);\\n\\tborder-radius: 50% 50% 0 50%;\\n\\t/* biome-ignore lint/complexity/noImportantStyles: Overwrite Tailwind */\\n\\tborder: var(--mtdsc-atlas-marker-border)!important;\\n\\tcontent: \\\"\\\";\\n\\trotate: 45deg;\\n\\tposition: absolute;\\n\\tinset: calc(var(--mtdsc-atlas-marker-inset) * -1);\\n\\tz-index: -1;\\n}\\n::slotted(mtds-atlas-marker[data-color]) {\\n\\t--mtdsc-atlas-marker-background: var(--mtds-color-base-default); /* Ensure data-color is respected */\\n\\t--mtdsc-atlas-marker-color: var(--mtds-color-base-contrast-default);\\n}\\n::slotted(mtds-atlas-marker.leaflet-drag-target) {\\n\\tcursor: grabbing;\\n}\\n\\n.leaflet-marker-generated-slot,\\n.leaflet-marker-icon slot { display: block; position: absolute; left: 0; top: 0; translate: -50% -100% }\\n.leaflet-marker-icon { background: none; border: 0 }\\n.leaflet-cluster-icon {\\n\\tbox-shadow: 0 3px 3px var(--mtdsc-atlas-marker-shadow);\\n\\tbackground-color: var(--mtds-color-base-default);\\n\\tborder-radius: 100%;\\n\\tborder: var(--mtdsc-atlas-cluster-border);\\n\\tbox-sizing: border-box;\\n\\toutline: 1px solid var(--mtds-color-base-default);\\n\\tcolor: var(--mtds-color-base-contrast-default);\\n\\tdisplay: flex;\\n\\tfont-size: var(--mtds-body-xs-font-size);\\n\\tfont-weight: var(--mtds-font-weight-bold);\\n\\tplace-content: center;\\n\\tplace-items: center;\\n}\\n\\n/* Popover */\\n.leaflet-popup:has(slot) .leaflet-popup-tip { background: var(--mtds-color-surface-default) }\\n.leaflet-popup:has(slot) .leaflet-popup-close-button { display: none } /* Popup closes on clicking marker anyway */\\n.leaflet-popup:has(slot) .leaflet-popup-content-wrapper { display: contents } /* No need for styling this element */\\n.leaflet-popup:has(slot) .leaflet-popup-content { margin: 0; font: inherit }\\n\""],"names":["css"],"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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,38 +1,38 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import { toCustomElementProps } from "../utils.js";
4
- import { MTDSAtlasElement } from "./atlas-element.js";
5
- const AtlasComp = forwardRef(
6
- function Atlas2(props, ref) {
7
- return /* @__PURE__ */ jsx("mtds-atlas", { ref, ...toCustomElementProps(props) });
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as o } from "react";
3
+ import { toCustomElementProps as s } from "../utils.js";
4
+ import { MATGEO_URL as M, MTDSAtlasElement as p } from "./atlas-element.js";
5
+ const n = o(
6
+ function(t, r) {
7
+ return /* @__PURE__ */ a("mtds-atlas", { ref: r, ...s(t) });
8
8
  }
9
- );
10
- const Atlas = Object.assign(AtlasComp, {
11
- Marker: forwardRef(
12
- function AtlasMarker(props, ref) {
13
- return /* @__PURE__ */ jsx("mtds-atlas-marker", { ref, ...toCustomElementProps(props) });
9
+ ), c = Object.assign(n, {
10
+ Marker: o(
11
+ function(t, r) {
12
+ return /* @__PURE__ */ a("mtds-atlas-marker", { ref: r, ...s(t) });
14
13
  }
15
14
  ),
16
- Matgeo: forwardRef(
17
- function AtlasMatgeo({ onFeatureClick, ...rest }, ref) {
18
- return /* @__PURE__ */ jsx(
15
+ Matgeo: o(
16
+ function({ onFeatureClick: t, ...r }, m) {
17
+ return /* @__PURE__ */ a(
19
18
  "mtds-atlas-matgeo",
20
19
  {
21
- ref,
22
- onatlasfeatureclick: onFeatureClick,
23
- ...toCustomElementProps(rest)
20
+ ref: m,
21
+ onatlasfeatureclick: t,
22
+ ...s(r)
24
23
  }
25
24
  );
26
25
  }
27
26
  ),
28
- WMS: forwardRef(
29
- function AtlasWMS(props, ref) {
30
- return /* @__PURE__ */ jsx("mtds-atlas-wms", { ref, ...toCustomElementProps(props) });
27
+ WMS: o(
28
+ function(t, r) {
29
+ return /* @__PURE__ */ a("mtds-atlas-wms", { ref: r, ...s(t) });
31
30
  }
32
31
  )
33
32
  });
34
33
  export {
35
- Atlas,
36
- MTDSAtlasElement
34
+ c as Atlas,
35
+ M as MATGEO_URL,
36
+ p as MTDSAtlasElement
37
37
  };
38
38
  //# sourceMappingURL=atlas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"atlas.js","sources":["../../designsystem/atlas/atlas.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { CustomReactElementProps } from \"../react-types\";\nimport { toCustomElementProps } from \"../utils\";\nimport type {\n\tMTDSAtlasElement,\n\tMTDSAtlasMarkerElement,\n\tMTDSAtlasMatgeoElement,\n\tMTDSAtlasWMSElement,\n} from \"./atlas-element\";\n\nexport * from \"./atlas-element\"; // Expose { L } for Leaflet import\n\ndeclare global {\n\tnamespace React.JSX {\n\t\tinterface IntrinsicElements {\n\t\t\t\"mtds-atlas\": CustomReactElementProps<MTDSAtlasElement> & {\n\t\t\t\t\"data-cluster\"?: number | `${number}` | boolean | \"true\" | \"false\";\n\t\t\t\t\"data-scrollzoom\"?: boolean | \"true\" | \"false\";\n\t\t\t\t\"data-tiles\"?: \"color\" | \"gray\";\n\t\t\t\t\"data-view\"?: string | number[];\n\t\t\t};\n\t\t\t\"mtds-atlas-marker\": CustomReactElementProps<MTDSAtlasMarkerElement> & {\n\t\t\t\t\"data-latlng\": string;\n\t\t\t};\n\t\t\t\"mtds-atlas-wms\": CustomReactElementProps<MTDSAtlasWMSElement> & {\n\t\t\t\t\"data-url\": string;\n\t\t\t};\n\t\t\t\"mtds-atlas-matgeo\": CustomReactElementProps<MTDSAtlasMatgeoElement> & {\n\t\t\t\t\"data-collection\": string;\n\t\t\t\tonatlasfeatureclick?: (\n\t\t\t\t\tevent: GlobalEventHandlersEventMap[\"atlasfeatureclick\"],\n\t\t\t\t) => void;\n\t\t\t};\n\t\t}\n\t}\n}\n\nexport type AtlasProps = React.JSX.IntrinsicElements[\"mtds-atlas\"];\nexport type AtlasMarkerProps = React.JSX.IntrinsicElements[\"mtds-atlas-marker\"];\nexport type AtlasWMSProps = React.JSX.IntrinsicElements[\"mtds-atlas-wms\"];\nexport type AtlasMatgeoProps =\n\tReact.JSX.IntrinsicElements[\"mtds-atlas-matgeo\"] & {\n\t\tonFeatureClick?: React.JSX.IntrinsicElements[\"mtds-atlas-matgeo\"][\"onatlasfeatureclick\"];\n\t};\n\nconst AtlasComp = forwardRef<MTDSAtlasElement, AtlasProps>(\n\tfunction Atlas(props, ref) {\n\t\treturn <mtds-atlas ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport const Atlas = Object.assign(AtlasComp, {\n\tMarker: forwardRef<MTDSAtlasMarkerElement, AtlasMarkerProps>(\n\t\tfunction AtlasMarker(props, ref) {\n\t\t\treturn <mtds-atlas-marker ref={ref} {...toCustomElementProps(props)} />;\n\t\t},\n\t),\n\tMatgeo: forwardRef<MTDSAtlasMatgeoElement, AtlasMatgeoProps>(\n\t\tfunction AtlasMatgeo({ onFeatureClick, ...rest }, ref) {\n\t\t\treturn (\n\t\t\t\t<mtds-atlas-matgeo\n\t\t\t\t\tref={ref}\n\t\t\t\t\tonatlasfeatureclick={onFeatureClick}\n\t\t\t\t\t{...toCustomElementProps(rest)}\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t),\n\tWMS: forwardRef<MTDSAtlasWMSElement, AtlasWMSProps>(\n\t\tfunction AtlasWMS(props, ref) {\n\t\t\treturn <mtds-atlas-wms ref={ref} {...toCustomElementProps(props)} />;\n\t\t},\n\t),\n});\n"],"names":["Atlas"],"mappings":";;;;AA6CA,MAAM,YAAY;AAAA,EACjB,SAASA,OAAM,OAAO,KAAK;AAC1B,+BAAQ,cAAA,EAAW,KAAW,GAAG,qBAAqB,KAAK,GAAG;AAAA,EAC/D;AACD;AAEO,MAAM,QAAQ,OAAO,OAAO,WAAW;AAAA,EAC7C,QAAQ;AAAA,IACP,SAAS,YAAY,OAAO,KAAK;AAChC,iCAAQ,qBAAA,EAAkB,KAAW,GAAG,qBAAqB,KAAK,GAAG;AAAA,IACtE;AAAA,EAAA;AAAA,EAED,QAAQ;AAAA,IACP,SAAS,YAAY,EAAE,gBAAgB,GAAG,KAAA,GAAQ,KAAK;AACtD,aACC;AAAA,QAAC;AAAA,QAAA;AAAA,UACA;AAAA,UACA,qBAAqB;AAAA,UACpB,GAAG,qBAAqB,IAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IAGhC;AAAA,EAAA;AAAA,EAED,KAAK;AAAA,IACJ,SAAS,SAAS,OAAO,KAAK;AAC7B,iCAAQ,kBAAA,EAAe,KAAW,GAAG,qBAAqB,KAAK,GAAG;AAAA,IACnE;AAAA,EAAA;AAEF,CAAC;"}
1
+ {"version":3,"file":"atlas.js","sources":["../../designsystem/atlas/atlas.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { CustomReactElementProps } from \"../react-types\";\nimport { toCustomElementProps } from \"../utils\";\nimport type {\n\tMTDSAtlasElement,\n\tMTDSAtlasMarkerElement,\n\tMTDSAtlasMatgeoElement,\n\tMTDSAtlasWMSElement,\n} from \"./atlas-element\";\n\nexport * from \"./atlas-element\"; // Expose { L } for Leaflet import\n\ndeclare global {\n\tnamespace React.JSX {\n\t\tinterface IntrinsicElements {\n\t\t\t\"mtds-atlas\": CustomReactElementProps<MTDSAtlasElement> & {\n\t\t\t\t\"data-cluster\"?: number | `${number}` | boolean | \"true\" | \"false\";\n\t\t\t\t\"data-scrollzoom\"?: boolean | \"true\" | \"false\";\n\t\t\t\t\"data-tiles\"?: \"color\" | \"gray\";\n\t\t\t\t\"data-view\"?: string | number[];\n\t\t\t};\n\t\t\t\"mtds-atlas-marker\": CustomReactElementProps<MTDSAtlasMarkerElement> & {\n\t\t\t\t\"data-latlng\": string;\n\t\t\t};\n\t\t\t\"mtds-atlas-wms\": CustomReactElementProps<MTDSAtlasWMSElement> & {\n\t\t\t\t\"data-url\": string;\n\t\t\t};\n\t\t\t\"mtds-atlas-matgeo\": CustomReactElementProps<MTDSAtlasMatgeoElement> & {\n\t\t\t\t\"data-collection\": string;\n\t\t\t\tonatlasfeatureclick?: (\n\t\t\t\t\tevent: GlobalEventHandlersEventMap[\"atlasfeatureclick\"],\n\t\t\t\t) => void;\n\t\t\t};\n\t\t}\n\t}\n}\n\nexport type AtlasProps = React.JSX.IntrinsicElements[\"mtds-atlas\"];\nexport type AtlasMarkerProps = React.JSX.IntrinsicElements[\"mtds-atlas-marker\"];\nexport type AtlasWMSProps = React.JSX.IntrinsicElements[\"mtds-atlas-wms\"];\nexport type AtlasMatgeoProps =\n\tReact.JSX.IntrinsicElements[\"mtds-atlas-matgeo\"] & {\n\t\tonFeatureClick?: React.JSX.IntrinsicElements[\"mtds-atlas-matgeo\"][\"onatlasfeatureclick\"];\n\t};\n\nconst AtlasComp = forwardRef<MTDSAtlasElement, AtlasProps>(\n\tfunction Atlas(props, ref) {\n\t\treturn <mtds-atlas ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport const Atlas = Object.assign(AtlasComp, {\n\tMarker: forwardRef<MTDSAtlasMarkerElement, AtlasMarkerProps>(\n\t\tfunction AtlasMarker(props, ref) {\n\t\t\treturn <mtds-atlas-marker ref={ref} {...toCustomElementProps(props)} />;\n\t\t},\n\t),\n\tMatgeo: forwardRef<MTDSAtlasMatgeoElement, AtlasMatgeoProps>(\n\t\tfunction AtlasMatgeo({ onFeatureClick, ...rest }, ref) {\n\t\t\treturn (\n\t\t\t\t<mtds-atlas-matgeo\n\t\t\t\t\tref={ref}\n\t\t\t\t\tonatlasfeatureclick={onFeatureClick}\n\t\t\t\t\t{...toCustomElementProps(rest)}\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t),\n\tWMS: forwardRef<MTDSAtlasWMSElement, AtlasWMSProps>(\n\t\tfunction AtlasWMS(props, ref) {\n\t\t\treturn <mtds-atlas-wms ref={ref} {...toCustomElementProps(props)} />;\n\t\t},\n\t),\n});\n"],"names":["AtlasComp","forwardRef","props","ref","toCustomElementProps","Atlas","onFeatureClick","rest","jsx"],"mappings":";;;;AA6CA,MAAMA,IAAYC;AAAA,EACjB,SAAeC,GAAOC,GAAK;AAC1B,6BAAQ,cAAA,EAAW,KAAAA,GAAW,GAAGC,EAAqBF,CAAK,GAAG;AAAA,EAC/D;AACD,GAEaG,IAAQ,OAAO,OAAOL,GAAW;AAAA,EAC7C,QAAQC;AAAA,IACP,SAAqBC,GAAOC,GAAK;AAChC,+BAAQ,qBAAA,EAAkB,KAAAA,GAAW,GAAGC,EAAqBF,CAAK,GAAG;AAAA,IACtE;AAAA,EAAA;AAAA,EAED,QAAQD;AAAA,IACP,SAAqB,EAAE,gBAAAK,GAAgB,GAAGC,EAAA,GAAQJ,GAAK;AACtD,aACC,gBAAAK;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,KAAAL;AAAA,UACA,qBAAqBG;AAAA,UACpB,GAAGF,EAAqBG,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IAGhC;AAAA,EAAA;AAAA,EAED,KAAKN;AAAA,IACJ,SAAkBC,GAAOC,GAAK;AAC7B,+BAAQ,kBAAA,EAAe,KAAAA,GAAW,GAAGC,EAAqBF,CAAK,GAAG;AAAA,IACnE;AAAA,EAAA;AAEF,CAAC;"}
@@ -19,6 +19,7 @@ export declare const WithClustering: Story;
19
19
  export declare const WithPopover: Story;
20
20
  export declare const WithPopoverDynamic: Story;
21
21
  export declare const WithMatgeo: Story;
22
+ export declare const WithMatgeoToggle: Story;
22
23
  export declare const WithWMS: Story;
23
24
  export declare const WithTooltip: Story;
24
25
  export declare const WithClickToAddMarker: Story;