{"version":3,"file":"index.cjs","sources":["../../../src/html-components/leaflet-flow-map/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"PointDatum extends GenericDataRecord,FlowDatum extends GenericDataRecord\">\n// !!! This code was automatically generated. You should not change it !!!\nimport { LeafletFlowMap, LeafletFlowMapConfigInterface, GenericDataRecord, MapLibreStyleSpecs } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\n\n\n// data and required props \ntype Props = LeafletFlowMapConfigInterface<PointDatum, FlowDatum>\nconst props = defineProps<Props & { data?: { points: PointDatum[]; flows?: FlowDatum[] } }>()\n\nconst data = computed(() => props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<LeafletFlowMap<PointDatum, FlowDatum>>()\nconst elRef = ref<HTMLDivElement>()\n\nonMounted(() => {\n  nextTick(() => {\n    if(elRef.value)\n    component.value = new LeafletFlowMap<PointDatum, FlowDatum>(elRef.value, config.value, data.value)\n    \n    \n  })\n})\n\nonUnmounted(() => {\n  component.value?.destroy()\n  \n})\n\nwatch(config, (curr, prev) => {\n  if (!arePropsEqual(curr, prev)) {\n    component.value?.setConfig(config.value)\n    component.value?.render()\n  }\n})\n\nwatch(data, () => {\n  component.value?.setData(data.value)\n})\n\ndefineExpose({\n  component\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisLeafletFlowMapSelectors = LeafletFlowMap.selectors\n</script>\n\n<template>\n  <div data-vis-leaflet-flow-map ref=\"elRef\"/>\n</template>\n\n\n<style>\n  [data-vis-leaflet-flow-map] {\n    display:block;\n    position:relative;\n  }\n</style>\n"],"names":["VisLeafletFlowMapSelectors","LeafletFlowMap","props","__props","data","computed","config","useForwardProps","component","ref","elRef","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_createElementBlock"],"mappings":"8LAkDaA,EAA6BC,EAAAA,eAAe,++DAzCzD,MAAMC,EAAQC,EAERC,EAAOC,EAAAA,SAAS,IAAMH,EAAM,IAAI,EAEhCI,EAASC,EAAAA,gBAAgBL,CAAK,EAG9BM,EAAYC,EAAAA,IAAA,EACZC,EAAQD,EAAAA,IAAA,EAEdE,OAAAA,EAAAA,UAAU,IAAM,CACdC,EAAAA,SAAS,IAAM,CACVF,EAAM,QACTF,EAAU,MAAQ,IAAIP,EAAAA,eAAsCS,EAAM,MAAOJ,EAAO,MAAOF,EAAK,KAAK,EAGnG,CAAC,CACH,CAAC,EAEDS,EAAAA,YAAY,IAAM,CAChBL,EAAU,OAAO,QAAA,CAEnB,CAAC,EAEDM,EAAAA,MAAMR,EAAQ,CAACS,EAAMC,IAAS,CACvBC,EAAAA,cAAcF,EAAMC,CAAI,IAC3BR,EAAU,OAAO,UAAUF,EAAO,KAAK,EACvCE,EAAU,OAAO,OAAA,EAErB,CAAC,EAEDM,EAAAA,MAAMV,EAAM,IAAM,CAChBI,EAAU,OAAO,QAAQJ,EAAK,KAAK,CACrC,CAAC,EAEDc,EAAa,CACX,UAAAV,CAAA,CACD,wBAQCW,EAAAA,mBAA4C,MAAA,CAAvC,4BAAA,WAA8B,QAAJ,IAAIT,CAAA"}