{"version":3,"file":"index.cjs","sources":["../../../src/html-components/leaflet-map/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport type { LeafletMapConfigInterface, GenericDataRecord } from \"@unovis/ts\";\nimport { LeafletMap } from \"@unovis/ts\";\nimport { createSignal, onCleanup, createEffect, on, onMount } from 'solid-js'\nimport { arePropsEqual } from '../../utils/props'\n\nexport type VisLeafletMapProps<Datum extends GenericDataRecord> = LeafletMapConfigInterface<Datum>& {\n  data?: Datum[];\n};\n\nexport const VisLeafletMapSelectors = LeafletMap.selectors\n\nexport function VisLeafletMap<Datum extends GenericDataRecord>(props: VisLeafletMapProps<Datum>) {\n  const [component, setComponent] = createSignal<LeafletMap<Datum>>()\n   \n  const [ref, setRef] = createSignal<HTMLDivElement>()\n\n  onMount(() => {\n    const r = ref()\n    if(r) setComponent(new LeafletMap<Datum>(r, props, props.data));\n    \n    \n  })\n\n  onCleanup(() => {\n    component()?.destroy()\n    \n  })\n\n  createEffect(\n    on(\n      () => ({ ...props }),\n      (curr, prev) => {\n        if (!arePropsEqual(prev, curr)) {\n          component()?.setConfig(curr)\n          \n        }\n      },\n      {\n        defer: true\n      }\n    )\n  )\n\n  \n\n  return <div  ref={setRef} style={{ display:\"block\", position:\"relative\" }} />\n}\n"],"names":["VisLeafletMapSelectors","LeafletMap","selectors","VisLeafletMap","props","component","setComponent","createSignal","ref","setRef","onMount","r","data","onCleanup","destroy","createEffect","on","curr","prev","arePropsEqual","setConfig","defer","_el$","_tmpl$","_$use"],"mappings":"iQAUO,MAAMA,EAAyBC,EAAAA,WAAWC,UAE1C,SAASC,EAA+CC,EAAkC,CAC/F,KAAM,CAACC,EAAWC,CAAY,EAAIC,eAAAA,EAE5B,CAACC,EAAKC,CAAM,EAAIF,eAAAA,EAEtBG,OAAAA,EAAAA,QAAQ,IAAM,CACZ,MAAMC,EAAIH,EAAAA,EACPG,KAAgB,IAAIV,EAAAA,WAAkBU,EAAGP,EAAOA,EAAMQ,IAAI,CAAC,CAGhE,CAAC,EAEDC,EAAAA,UAAU,IAAM,CACdR,EAAAA,GAAaS,QAAAA,CAEf,CAAC,EAEDC,EAAAA,aACEC,EAAAA,GACE,KAAO,CAAE,GAAGZ,CAAAA,GACZ,CAACa,EAAMC,IAAS,CACTC,EAAAA,cAAcD,EAAMD,CAAI,GAC3BZ,EAAAA,GAAae,UAAUH,CAAI,CAG/B,EACA,CACEI,MAAO,EAAA,CAEX,CACF,GAIA,IAAA,CAAA,IAAAC,EAAAC,EAAAA,EAAAC,OAAAA,EAAAA,IAAkBf,EAAMa,CAAA,EAAAA,CAAA,GAAA,CAC1B"}