@unovis/vue 1.6.5 → 1.6.6-beta.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 (125) hide show
  1. package/components/annotations/index.cjs +1 -1
  2. package/components/annotations/index.cjs.map +1 -1
  3. package/components/annotations/index.js +18 -20
  4. package/components/annotations/index.js.map +1 -1
  5. package/components/area/index.cjs +1 -1
  6. package/components/area/index.cjs.map +1 -1
  7. package/components/area/index.js +21 -25
  8. package/components/area/index.js.map +1 -1
  9. package/components/axis/index.cjs +1 -1
  10. package/components/axis/index.cjs.map +1 -1
  11. package/components/axis/index.js +23 -26
  12. package/components/axis/index.js.map +1 -1
  13. package/components/brush/index.cjs +1 -1
  14. package/components/brush/index.cjs.map +1 -1
  15. package/components/brush/index.js +22 -25
  16. package/components/brush/index.js.map +1 -1
  17. package/components/chord-diagram/index.cjs +1 -1
  18. package/components/chord-diagram/index.cjs.map +1 -1
  19. package/components/chord-diagram/index.js +21 -25
  20. package/components/chord-diagram/index.js.map +1 -1
  21. package/components/crosshair/index.cjs +1 -1
  22. package/components/crosshair/index.cjs.map +1 -1
  23. package/components/crosshair/index.js +21 -25
  24. package/components/crosshair/index.js.map +1 -1
  25. package/components/donut/index.cjs +1 -1
  26. package/components/donut/index.cjs.map +1 -1
  27. package/components/donut/index.js +21 -25
  28. package/components/donut/index.js.map +1 -1
  29. package/components/free-brush/index.cjs +1 -1
  30. package/components/free-brush/index.cjs.map +1 -1
  31. package/components/free-brush/index.js +21 -25
  32. package/components/free-brush/index.js.map +1 -1
  33. package/components/graph/index.cjs +1 -1
  34. package/components/graph/index.cjs.map +1 -1
  35. package/components/graph/index.js +21 -25
  36. package/components/graph/index.js.map +1 -1
  37. package/components/grouped-bar/index.cjs +1 -1
  38. package/components/grouped-bar/index.cjs.map +1 -1
  39. package/components/grouped-bar/index.js +20 -24
  40. package/components/grouped-bar/index.js.map +1 -1
  41. package/components/line/index.cjs +1 -1
  42. package/components/line/index.cjs.map +1 -1
  43. package/components/line/index.js +21 -25
  44. package/components/line/index.js.map +1 -1
  45. package/components/nested-donut/index.cjs +1 -1
  46. package/components/nested-donut/index.cjs.map +1 -1
  47. package/components/nested-donut/index.js +21 -25
  48. package/components/nested-donut/index.js.map +1 -1
  49. package/components/plotband/index.cjs +1 -1
  50. package/components/plotband/index.cjs.map +1 -1
  51. package/components/plotband/index.js +18 -20
  52. package/components/plotband/index.js.map +1 -1
  53. package/components/plotline/index.cjs +1 -1
  54. package/components/plotline/index.cjs.map +1 -1
  55. package/components/plotline/index.js +18 -20
  56. package/components/plotline/index.js.map +1 -1
  57. package/components/sankey/index.cjs +1 -1
  58. package/components/sankey/index.cjs.map +1 -1
  59. package/components/sankey/index.js +21 -24
  60. package/components/sankey/index.js.map +1 -1
  61. package/components/scatter/index.cjs +1 -1
  62. package/components/scatter/index.cjs.map +1 -1
  63. package/components/scatter/index.js +21 -25
  64. package/components/scatter/index.js.map +1 -1
  65. package/components/stacked-bar/index.cjs +1 -1
  66. package/components/stacked-bar/index.cjs.map +1 -1
  67. package/components/stacked-bar/index.js +21 -25
  68. package/components/stacked-bar/index.js.map +1 -1
  69. package/components/timeline/index.cjs +1 -1
  70. package/components/timeline/index.cjs.map +1 -1
  71. package/components/timeline/index.js +21 -25
  72. package/components/timeline/index.js.map +1 -1
  73. package/components/tooltip/index.cjs +1 -1
  74. package/components/tooltip/index.cjs.map +1 -1
  75. package/components/tooltip/index.js +17 -19
  76. package/components/tooltip/index.js.map +1 -1
  77. package/components/topojson-map/index.cjs +1 -1
  78. package/components/topojson-map/index.cjs.map +1 -1
  79. package/components/topojson-map/index.js +21 -25
  80. package/components/topojson-map/index.js.map +1 -1
  81. package/components/treemap/index.cjs +1 -1
  82. package/components/treemap/index.cjs.map +1 -1
  83. package/components/treemap/index.js +21 -25
  84. package/components/treemap/index.js.map +1 -1
  85. package/components/xy-labels/index.cjs +1 -1
  86. package/components/xy-labels/index.cjs.map +1 -1
  87. package/components/xy-labels/index.js +21 -25
  88. package/components/xy-labels/index.js.map +1 -1
  89. package/containers/single-container/index.cjs +1 -1
  90. package/containers/single-container/index.cjs.map +1 -1
  91. package/containers/single-container/index.js +23 -24
  92. package/containers/single-container/index.js.map +1 -1
  93. package/containers/xy-container/index.cjs +1 -1
  94. package/containers/xy-container/index.cjs.map +1 -1
  95. package/containers/xy-container/index.js +22 -29
  96. package/containers/xy-container/index.js.map +1 -1
  97. package/html-components/bullet-legend/index.cjs +1 -1
  98. package/html-components/bullet-legend/index.cjs.map +1 -1
  99. package/html-components/bullet-legend/index.js +21 -23
  100. package/html-components/bullet-legend/index.js.map +1 -1
  101. package/html-components/flow-legend/index.cjs +1 -1
  102. package/html-components/flow-legend/index.cjs.map +1 -1
  103. package/html-components/flow-legend/index.js +20 -22
  104. package/html-components/flow-legend/index.js.map +1 -1
  105. package/html-components/leaflet-flow-map/index.cjs +1 -1
  106. package/html-components/leaflet-flow-map/index.cjs.map +1 -1
  107. package/html-components/leaflet-flow-map/index.js +21 -24
  108. package/html-components/leaflet-flow-map/index.js.map +1 -1
  109. package/html-components/leaflet-map/index.cjs +1 -1
  110. package/html-components/leaflet-map/index.cjs.map +1 -1
  111. package/html-components/leaflet-map/index.js +21 -24
  112. package/html-components/leaflet-map/index.js.map +1 -1
  113. package/html-components/rolling-pin-legend/index.cjs +1 -1
  114. package/html-components/rolling-pin-legend/index.cjs.map +1 -1
  115. package/html-components/rolling-pin-legend/index.js +21 -23
  116. package/html-components/rolling-pin-legend/index.js.map +1 -1
  117. package/package.json +5 -4
  118. package/utils/context.cjs.map +1 -1
  119. package/utils/context.js +1 -1
  120. package/utils/context.js.map +1 -1
  121. package/utils/props.cjs +1 -1
  122. package/utils/props.cjs.map +1 -1
  123. package/utils/props.d.ts +1 -4
  124. package/utils/props.js +9 -9
  125. package/utils/props.js.map +1 -1
@@ -1,8 +1,8 @@
1
- import { defineComponent as d, inject as m, computed as f, ref as y, onMounted as F, nextTick as b, onUnmounted as v, watch as s, openBlock as S, createElementBlock as B } from "vue";
2
- import { Treemap as c } from "@unovis/ts";
3
- import { useForwardProps as T, arePropsEqual as g } from "../../utils/props.js";
4
- import { componentAccessorKey as L } from "../../utils/context.js";
5
- const _ = { "data-vis-component": "" }, k = c.selectors, A = /* @__PURE__ */ d({
1
+ import { defineComponent as p, inject as d, computed as m, ref as f, onMounted as y, nextTick as F, onUnmounted as b, watch as r, openBlock as v, createElementBlock as S } from "vue";
2
+ import { Treemap as s } from "@unovis/ts";
3
+ import { useForwardProps as B, arePropsEqual as T } from "../../utils/props.js";
4
+ import { componentAccessorKey as g } from "../../utils/context.js";
5
+ const L = { "data-vis-component": "" }, z = s.selectors, k = /* @__PURE__ */ p({
6
6
  __name: "index",
7
7
  props: {
8
8
  id: { type: Function },
@@ -36,29 +36,25 @@ const _ = { "data-vis-component": "" }, k = c.selectors, A = /* @__PURE__ */ d({
36
36
  attributes: {},
37
37
  data: {}
38
38
  },
39
- setup(u, { expose: p }) {
40
- const o = m(L), l = u, n = f(() => o.data.value ?? l.data), a = T(l), t = y();
41
- return F(() => {
42
- b(() => {
43
- var e;
44
- t.value = new c(a.value), (e = t.value) == null || e.setData(n.value), o.update(t.value);
39
+ setup(u, { expose: c }) {
40
+ const t = d(g), a = u, o = m(() => t.data.value ?? a.data), n = B(a), e = f();
41
+ return y(() => {
42
+ F(() => {
43
+ e.value = new s(n.value), e.value?.setData(o.value), t.update(e.value);
45
44
  });
46
- }), v(() => {
47
- var e;
48
- (e = t.value) == null || e.destroy(), o.destroy();
49
- }), s(a, (e, i) => {
50
- var r;
51
- g(e, i) || (r = t.value) == null || r.setConfig(a.value);
52
- }), s(n, () => {
53
- var e;
54
- (e = t.value) == null || e.setData(n.value);
55
- }), p({
56
- component: t
57
- }), (e, i) => (S(), B("div", _));
45
+ }), b(() => {
46
+ e.value?.destroy(), t.destroy();
47
+ }), r(n, (l, i) => {
48
+ T(l, i) || (e.value?.setConfig(n.value), e.value?.render());
49
+ }), r(o, () => {
50
+ e.value?.setData(o.value);
51
+ }), c({
52
+ component: e
53
+ }), (l, i) => (v(), S("div", L));
58
54
  }
59
55
  });
60
56
  export {
61
- k as VisTreemapSelectors,
62
- A as default
57
+ z as VisTreemapSelectors,
58
+ k as default
63
59
  };
64
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/treemap/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport { Treemap, TreemapConfigInterface, StringAccessor } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick, inject } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\nimport { componentAccessorKey } from '../../utils/context'\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props \ntype Props = TreemapConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<Treemap<Datum>>()\n\n\nonMounted(() => {\n nextTick(() => {\n component.value = new Treemap<Datum>(config.value)\n component.value?.setData(data.value)\n accessor.update(component.value)\n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n accessor.destroy()\n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\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 VisTreemapSelectors = Treemap.selectors\n</script>\n\n<template>\n <div data-vis-component />\n</template>\n\n\n"],"names":["VisTreemapSelectors","Treemap","accessor","inject","componentAccessorKey","props","__props","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","_a","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_openBlock","_createElementBlock","_hoisted_1"],"mappings":";;;;wCAkDaA,IAAsBC,EAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3C3C,UAAMC,IAAWC,EAAOC,CAAoB,GAItCC,IAAQC,GAERC,IAAOC,EAAS,MAAMN,EAAS,KAAK,SAASG,EAAM,IAAI,GAEvDI,IAASC,EAAgBL,CAAK,GAG9BM,IAAYC,EAAA;AAGlB,WAAAC,EAAU,MAAM;AACd,MAAAC,EAAS,MAAM;;AACb,QAAAH,EAAU,QAAQ,IAAIV,EAAeQ,EAAO,KAAK,IACjDM,IAAAJ,EAAU,UAAV,QAAAI,EAAiB,QAAQR,EAAK,QAC9BL,EAAS,OAAOS,EAAU,KAAK;AAAA,MACjC,CAAC;AAAA,IACH,CAAC,GAEDK,EAAY,MAAM;;AAChB,OAAAD,IAAAJ,EAAU,UAAV,QAAAI,EAAiB,WACjBb,EAAS,QAAA;AAAA,IACX,CAAC,GAEDe,EAAMR,GAAQ,CAACS,GAAMC,MAAS;;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MAC3BJ,IAAAJ,EAAU,UAAV,QAAAI,EAAiB,UAAUN,EAAO;AAAA,IAEtC,CAAC,GAEDQ,EAAMV,GAAM,MAAM;;AAChB,OAAAQ,IAAAJ,EAAU,UAAV,QAAAI,EAAiB,QAAQR,EAAK;AAAA,IAChC,CAAC,GAEDc,EAAa;AAAA,MACX,WAAAV;AAAA,IAAA,CACD,cAQCW,EAAA,GAAAC,EAA0B,OAA1BC,CAA0B;AAAA;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/treemap/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport { Treemap, TreemapConfigInterface, StringAccessor } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick, inject } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\nimport { componentAccessorKey } from '../../utils/context'\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props \ntype Props = TreemapConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<Treemap<Datum>>()\n\n\nonMounted(() => {\n nextTick(() => {\n component.value = new Treemap<Datum>(config.value)\n component.value?.setData(data.value)\n accessor.update(component.value)\n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n accessor.destroy()\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 VisTreemapSelectors = Treemap.selectors\n</script>\n\n<template>\n <div data-vis-component />\n</template>\n\n\n"],"names":["VisTreemapSelectors","Treemap","accessor","inject","componentAccessorKey","props","__props","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_openBlock","_createElementBlock","_hoisted_1"],"mappings":";;;;wCAmDaA,IAAsBC,EAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5C3C,UAAMC,IAAWC,EAAOC,CAAoB,GAItCC,IAAQC,GAERC,IAAOC,EAAS,MAAMN,EAAS,KAAK,SAASG,EAAM,IAAI,GAEvDI,IAASC,EAAgBL,CAAK,GAG9BM,IAAYC,EAAA;AAGlB,WAAAC,EAAU,MAAM;AACd,MAAAC,EAAS,MAAM;AACb,QAAAH,EAAU,QAAQ,IAAIV,EAAeQ,EAAO,KAAK,GACjDE,EAAU,OAAO,QAAQJ,EAAK,KAAK,GACnCL,EAAS,OAAOS,EAAU,KAAK;AAAA,MACjC,CAAC;AAAA,IACH,CAAC,GAEDI,EAAY,MAAM;AAChB,MAAAJ,EAAU,OAAO,QAAA,GACjBT,EAAS,QAAA;AAAA,IACX,CAAC,GAEDc,EAAMP,GAAQ,CAACQ,GAAMC,MAAS;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MAC3BP,EAAU,OAAO,UAAUF,EAAO,KAAK,GACvCE,EAAU,OAAO,OAAA;AAAA,IAErB,CAAC,GAEDK,EAAMT,GAAM,MAAM;AAChB,MAAAI,EAAU,OAAO,QAAQJ,EAAK,KAAK;AAAA,IACrC,CAAC,GAEDa,EAAa;AAAA,MACX,WAAAT;AAAA,IAAA,CACD,cAQCU,EAAA,GAAAC,EAA0B,OAA1BC,CAA0B;AAAA;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),s=require("@unovis/ts"),i=require("../../utils/props.cjs"),d=require("../../utils/context.cjs"),F={"data-vis-component":""},g=s.XYLabels.selectors,b=t.defineComponent({__name:"index",props:{color:{type:[Function,String,Array,null]},y:{type:[Function,Number,null]},xPositioning:{type:[Function,String,null]},yPositioning:{type:[Function,String,null]},labelFontSize:{type:[Function,Number,null]},label:{type:[Function,String,null]},backgroundColor:{type:[Function,String,Array,null]},cursor:{type:[Function,String,null]},labelTextBrightnessRatio:{},clustering:{type:Boolean},clusterLabel:{type:[Function,String,null]},clusterFontSize:{type:[Function,Number,null]},clusterBackgroundColor:{type:[Function,String,Array,null]},clusterCursor:{type:[Function,String,null]},clusterLabelColor:{type:[Function,String,Array,null]},x:{type:[Function,Number,null]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(p,{expose:y}){const o=t.inject(d.componentAccessorKey),r=p,l=t.computed(()=>o.data.value??r.data),u=i.useForwardProps(r),n=t.ref();return t.onMounted(()=>{t.nextTick(()=>{var e;n.value=new s.XYLabels(u.value),(e=n.value)==null||e.setData(l.value),o.update(n.value)})}),t.onUnmounted(()=>{var e;(e=n.value)==null||e.destroy(),o.destroy()}),t.watch(u,(e,c)=>{var a;i.arePropsEqual(e,c)||(a=n.value)==null||a.setConfig(u.value)}),t.watch(l,()=>{var e;(e=n.value)==null||e.setData(l.value)}),y({component:n}),(e,c)=>(t.openBlock(),t.createElementBlock("div",F))}});exports.VisXYLabelsSelectors=g;exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("@unovis/ts"),a=require("../../utils/props.cjs"),y=require("../../utils/context.cjs"),d={"data-vis-component":""},F=i.XYLabels.selectors,g=e.defineComponent({__name:"index",props:{color:{type:[Function,String,Array,null]},y:{type:[Function,Number,null]},xPositioning:{type:[Function,String,null]},yPositioning:{type:[Function,String,null]},labelFontSize:{type:[Function,Number,null]},label:{type:[Function,String,null]},backgroundColor:{type:[Function,String,Array,null]},cursor:{type:[Function,String,null]},labelTextBrightnessRatio:{},clustering:{type:Boolean},clusterLabel:{type:[Function,String,null]},clusterFontSize:{type:[Function,Number,null]},clusterBackgroundColor:{type:[Function,String,Array,null]},clusterCursor:{type:[Function,String,null]},clusterLabelColor:{type:[Function,String,Array,null]},x:{type:[Function,Number,null]},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(s,{expose:p}){const n=e.inject(y.componentAccessorKey),u=s,o=e.computed(()=>n.data.value??u.data),l=a.useForwardProps(u),t=e.ref();return e.onMounted(()=>{e.nextTick(()=>{t.value=new i.XYLabels(l.value),t.value?.setData(o.value),n.update(t.value)})}),e.onUnmounted(()=>{t.value?.destroy(),n.destroy()}),e.watch(l,(r,c)=>{a.arePropsEqual(r,c)||(t.value?.setConfig(l.value),t.value?.render())}),e.watch(o,()=>{t.value?.setData(o.value)}),p({component:t}),(r,c)=>(e.openBlock(),e.createElementBlock("div",d))}});exports.VisXYLabelsSelectors=F;exports.default=g;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/xy-labels/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport { XYLabels, XYLabelsConfigInterface, NumericAccessor } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick, inject } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\nimport { componentAccessorKey } from '../../utils/context'\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props \ntype Props = XYLabelsConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<XYLabels<Datum>>()\n\n\nonMounted(() => {\n nextTick(() => {\n component.value = new XYLabels<Datum>(config.value)\n component.value?.setData(data.value)\n accessor.update(component.value)\n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n accessor.destroy()\n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\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 VisXYLabelsSelectors = XYLabels.selectors\n</script>\n\n<template>\n <div data-vis-component />\n</template>\n\n\n"],"names":["VisXYLabelsSelectors","XYLabels","accessor","inject","componentAccessorKey","props","__props","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","_a","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_openBlock","_createElementBlock","_hoisted_1"],"mappings":"+PAkDaA,EAAuBC,EAAAA,SAAS,04BA3C7C,MAAMC,EAAWC,EAAAA,OAAOC,sBAAoB,EAItCC,EAAQC,EAERC,EAAOC,EAAAA,SAAS,IAAMN,EAAS,KAAK,OAASG,EAAM,IAAI,EAEvDI,EAASC,EAAAA,gBAAgBL,CAAK,EAG9BM,EAAYC,EAAAA,IAAA,EAGlBC,OAAAA,EAAAA,UAAU,IAAM,CACdC,EAAAA,SAAS,IAAM,OACbH,EAAU,MAAQ,IAAIV,WAAgBQ,EAAO,KAAK,GAClDM,EAAAJ,EAAU,QAAV,MAAAI,EAAiB,QAAQR,EAAK,OAC9BL,EAAS,OAAOS,EAAU,KAAK,CACjC,CAAC,CACH,CAAC,EAEDK,EAAAA,YAAY,IAAM,QAChBD,EAAAJ,EAAU,QAAV,MAAAI,EAAiB,UACjBb,EAAS,QAAA,CACX,CAAC,EAEDe,EAAAA,MAAMR,EAAQ,CAACS,EAAMC,IAAS,OACvBC,EAAAA,cAAcF,EAAMC,CAAI,IAC3BJ,EAAAJ,EAAU,QAAV,MAAAI,EAAiB,UAAUN,EAAO,MAEtC,CAAC,EAEDQ,EAAAA,MAAMV,EAAM,IAAM,QAChBQ,EAAAJ,EAAU,QAAV,MAAAI,EAAiB,QAAQR,EAAK,MAChC,CAAC,EAEDc,EAAa,CACX,UAAAV,CAAA,CACD,UAQCW,YAAA,EAAAC,qBAA0B,MAA1BC,CAA0B"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/xy-labels/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport { XYLabels, XYLabelsConfigInterface, NumericAccessor } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick, inject } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\nimport { componentAccessorKey } from '../../utils/context'\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props \ntype Props = XYLabelsConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<XYLabels<Datum>>()\n\n\nonMounted(() => {\n nextTick(() => {\n component.value = new XYLabels<Datum>(config.value)\n component.value?.setData(data.value)\n accessor.update(component.value)\n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n accessor.destroy()\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 VisXYLabelsSelectors = XYLabels.selectors\n</script>\n\n<template>\n <div data-vis-component />\n</template>\n\n\n"],"names":["VisXYLabelsSelectors","XYLabels","accessor","inject","componentAccessorKey","props","__props","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_openBlock","_createElementBlock","_hoisted_1"],"mappings":"+PAmDaA,EAAuBC,EAAAA,SAAS,04BA5C7C,MAAMC,EAAWC,EAAAA,OAAOC,sBAAoB,EAItCC,EAAQC,EAERC,EAAOC,EAAAA,SAAS,IAAMN,EAAS,KAAK,OAASG,EAAM,IAAI,EAEvDI,EAASC,EAAAA,gBAAgBL,CAAK,EAG9BM,EAAYC,EAAAA,IAAA,EAGlBC,OAAAA,EAAAA,UAAU,IAAM,CACdC,EAAAA,SAAS,IAAM,CACbH,EAAU,MAAQ,IAAIV,WAAgBQ,EAAO,KAAK,EAClDE,EAAU,OAAO,QAAQJ,EAAK,KAAK,EACnCL,EAAS,OAAOS,EAAU,KAAK,CACjC,CAAC,CACH,CAAC,EAEDI,EAAAA,YAAY,IAAM,CAChBJ,EAAU,OAAO,QAAA,EACjBT,EAAS,QAAA,CACX,CAAC,EAEDc,EAAAA,MAAMP,EAAQ,CAACQ,EAAMC,IAAS,CACvBC,EAAAA,cAAcF,EAAMC,CAAI,IAC3BP,EAAU,OAAO,UAAUF,EAAO,KAAK,EACvCE,EAAU,OAAO,OAAA,EAErB,CAAC,EAEDK,EAAAA,MAAMT,EAAM,IAAM,CAChBI,EAAU,OAAO,QAAQJ,EAAK,KAAK,CACrC,CAAC,EAEDa,EAAa,CACX,UAAAT,CAAA,CACD,UAQCU,YAAA,EAAAC,qBAA0B,MAA1BC,CAA0B"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as y, inject as m, computed as d, ref as F, onMounted as g, nextTick as b, onUnmounted as S, watch as a, openBlock as v, createElementBlock as f } from "vue";
2
- import { XYLabels as i } from "@unovis/ts";
3
- import { useForwardProps as x, arePropsEqual as _ } from "../../utils/props.js";
4
- import { componentAccessorKey as C } from "../../utils/context.js";
5
- const B = { "data-vis-component": "" }, N = i.selectors, P = /* @__PURE__ */ y({
1
+ import { defineComponent as p, inject as y, computed as d, ref as m, onMounted as F, nextTick as g, onUnmounted as b, watch as c, openBlock as v, createElementBlock as S } from "vue";
2
+ import { XYLabels as a } from "@unovis/ts";
3
+ import { useForwardProps as f, arePropsEqual as x } from "../../utils/props.js";
4
+ import { componentAccessorKey as _ } from "../../utils/context.js";
5
+ const C = { "data-vis-component": "" }, L = a.selectors, N = /* @__PURE__ */ p({
6
6
  __name: "index",
7
7
  props: {
8
8
  color: { type: [Function, String, Array, null] },
@@ -30,29 +30,25 @@ const B = { "data-vis-component": "" }, N = i.selectors, P = /* @__PURE__ */ y({
30
30
  attributes: {},
31
31
  data: {}
32
32
  },
33
- setup(s, { expose: p }) {
34
- const e = m(C), r = s, o = d(() => e.data.value ?? r.data), l = x(r), n = F();
35
- return g(() => {
36
- b(() => {
37
- var t;
38
- n.value = new i(l.value), (t = n.value) == null || t.setData(o.value), e.update(n.value);
33
+ setup(i, { expose: s }) {
34
+ const e = y(_), l = i, n = d(() => e.data.value ?? l.data), o = f(l), t = m();
35
+ return F(() => {
36
+ g(() => {
37
+ t.value = new a(o.value), t.value?.setData(n.value), e.update(t.value);
39
38
  });
40
- }), S(() => {
41
- var t;
42
- (t = n.value) == null || t.destroy(), e.destroy();
43
- }), a(l, (t, u) => {
44
- var c;
45
- _(t, u) || (c = n.value) == null || c.setConfig(l.value);
46
- }), a(o, () => {
47
- var t;
48
- (t = n.value) == null || t.setData(o.value);
49
- }), p({
50
- component: n
51
- }), (t, u) => (v(), f("div", B));
39
+ }), b(() => {
40
+ t.value?.destroy(), e.destroy();
41
+ }), c(o, (r, u) => {
42
+ x(r, u) || (t.value?.setConfig(o.value), t.value?.render());
43
+ }), c(n, () => {
44
+ t.value?.setData(n.value);
45
+ }), s({
46
+ component: t
47
+ }), (r, u) => (v(), S("div", C));
52
48
  }
53
49
  });
54
50
  export {
55
- N as VisXYLabelsSelectors,
56
- P as default
51
+ L as VisXYLabelsSelectors,
52
+ N as default
57
53
  };
58
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport { XYLabels, XYLabelsConfigInterface, NumericAccessor } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick, inject } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\nimport { componentAccessorKey } from '../../utils/context'\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props \ntype Props = XYLabelsConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<XYLabels<Datum>>()\n\n\nonMounted(() => {\n nextTick(() => {\n component.value = new XYLabels<Datum>(config.value)\n component.value?.setData(data.value)\n accessor.update(component.value)\n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n accessor.destroy()\n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\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 VisXYLabelsSelectors = XYLabels.selectors\n</script>\n\n<template>\n <div data-vis-component />\n</template>\n\n\n"],"names":["VisXYLabelsSelectors","XYLabels","accessor","inject","componentAccessorKey","props","__props","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","_a","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_openBlock","_createElementBlock","_hoisted_1"],"mappings":";;;;wCAkDaA,IAAuBC,EAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3C7C,UAAMC,IAAWC,EAAOC,CAAoB,GAItCC,IAAQC,GAERC,IAAOC,EAAS,MAAMN,EAAS,KAAK,SAASG,EAAM,IAAI,GAEvDI,IAASC,EAAgBL,CAAK,GAG9BM,IAAYC,EAAA;AAGlB,WAAAC,EAAU,MAAM;AACd,MAAAC,EAAS,MAAM;;AACb,QAAAH,EAAU,QAAQ,IAAIV,EAAgBQ,EAAO,KAAK,IAClDM,IAAAJ,EAAU,UAAV,QAAAI,EAAiB,QAAQR,EAAK,QAC9BL,EAAS,OAAOS,EAAU,KAAK;AAAA,MACjC,CAAC;AAAA,IACH,CAAC,GAEDK,EAAY,MAAM;;AAChB,OAAAD,IAAAJ,EAAU,UAAV,QAAAI,EAAiB,WACjBb,EAAS,QAAA;AAAA,IACX,CAAC,GAEDe,EAAMR,GAAQ,CAACS,GAAMC,MAAS;;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MAC3BJ,IAAAJ,EAAU,UAAV,QAAAI,EAAiB,UAAUN,EAAO;AAAA,IAEtC,CAAC,GAEDQ,EAAMV,GAAM,MAAM;;AAChB,OAAAQ,IAAAJ,EAAU,UAAV,QAAAI,EAAiB,QAAQR,EAAK;AAAA,IAChC,CAAC,GAEDc,EAAa;AAAA,MACX,WAAAV;AAAA,IAAA,CACD,cAQCW,EAAA,GAAAC,EAA0B,OAA1BC,CAA0B;AAAA;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/xy-labels/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum\">\n// !!! This code was automatically generated. You should not change it !!!\nimport { XYLabels, XYLabelsConfigInterface, NumericAccessor } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick, inject } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\nimport { componentAccessorKey } from '../../utils/context'\n\nconst accessor = inject(componentAccessorKey)\n\n// data and required props \ntype Props = XYLabelsConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => accessor.data.value ?? props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<XYLabels<Datum>>()\n\n\nonMounted(() => {\n nextTick(() => {\n component.value = new XYLabels<Datum>(config.value)\n component.value?.setData(data.value)\n accessor.update(component.value)\n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n accessor.destroy()\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 VisXYLabelsSelectors = XYLabels.selectors\n</script>\n\n<template>\n <div data-vis-component />\n</template>\n\n\n"],"names":["VisXYLabelsSelectors","XYLabels","accessor","inject","componentAccessorKey","props","__props","data","computed","config","useForwardProps","component","ref","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_openBlock","_createElementBlock","_hoisted_1"],"mappings":";;;;wCAmDaA,IAAuBC,EAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5C7C,UAAMC,IAAWC,EAAOC,CAAoB,GAItCC,IAAQC,GAERC,IAAOC,EAAS,MAAMN,EAAS,KAAK,SAASG,EAAM,IAAI,GAEvDI,IAASC,EAAgBL,CAAK,GAG9BM,IAAYC,EAAA;AAGlB,WAAAC,EAAU,MAAM;AACd,MAAAC,EAAS,MAAM;AACb,QAAAH,EAAU,QAAQ,IAAIV,EAAgBQ,EAAO,KAAK,GAClDE,EAAU,OAAO,QAAQJ,EAAK,KAAK,GACnCL,EAAS,OAAOS,EAAU,KAAK;AAAA,MACjC,CAAC;AAAA,IACH,CAAC,GAEDI,EAAY,MAAM;AAChB,MAAAJ,EAAU,OAAO,QAAA,GACjBT,EAAS,QAAA;AAAA,IACX,CAAC,GAEDc,EAAMP,GAAQ,CAACQ,GAAMC,MAAS;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MAC3BP,EAAU,OAAO,UAAUF,EAAO,KAAK,GACvCE,EAAU,OAAO,OAAA;AAAA,IAErB,CAAC,GAEDK,EAAMT,GAAM,MAAM;AAChB,MAAAI,EAAU,OAAO,QAAQJ,EAAK,KAAK;AAAA,IACrC,CAAC,GAEDa,EAAa;AAAA,MACX,WAAAT;AAAA,IAAA,CACD,cAQCU,EAAA,GAAAC,EAA0B,OAA1BC,CAA0B;AAAA;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("@unovis/ts"),a=require("../../utils/context.cjs"),v=require("../../utils/props.cjs"),f=e.defineComponent({__name:"index",props:{component:{},tooltip:{},annotations:{},onRenderComplete:{type:Function},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(d,{expose:p}){const r=d,{data:i}=e.toRefs(r),l=v.useForwardProps(r);let o;const t=e.reactive({component:void 0,tooltip:void 0,annotations:void 0}),s=e.ref(),c=()=>{o||s.value&&t.component&&(o=new u.SingleContainer(s.value,{...e.toRaw(t)},i.value))};return e.watchEffect(()=>{var n;c(),(n=t.component)==null||n.config,o==null||o.updateContainer({...e.toRaw(l.value),...e.toRaw(t)})}),e.watch(i,()=>{o?o.setData(i.value,!0):c()}),e.onUnmounted(()=>o==null?void 0:o.destroy()),e.provide(a.componentAccessorKey,{data:i,update:n=>t.component=n,destroy:()=>t.component=void 0}),e.provide(a.tooltipAccessorKey,{data:i,update:n=>t.tooltip=n,destroy:()=>{t.tooltip=void 0}}),e.provide(a.annotationsAccessorKey,{data:i,update:n=>t.annotations=n,destroy:()=>{t.annotations=void 0}}),p({component:o}),(n,m)=>(e.openBlock(),e.createElementBlock("div",{"data-vis-single-container":"",ref_key:"elRef",ref:s,class:"unovis-single-container"},[e.renderSlot(n.$slots,"default")],512))}});exports.default=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("@unovis/ts"),r=require("../../utils/context.cjs"),v=require("../../utils/props.cjs"),f=e.defineComponent({__name:"index",props:{component:{},tooltip:{},annotations:{},onRenderComplete:{type:Function},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(d,{expose:p}){const s=d,{data:a}=e.toRefs(s),l=v.useForwardProps(s);let t;const o=e.reactive({component:void 0,tooltip:void 0,annotations:void 0}),i=e.ref(),c=()=>{t||i.value&&o.component&&(t=new u.SingleContainer(i.value,{...e.toRaw(o)},a.value))};return e.watchEffect(()=>{c(),o.component?.config,t?.updateContainer({...e.toRaw(l.value),...e.toRaw(o)})}),e.watch(a,()=>{t?t.setData(a.value,!0):c()}),e.onUnmounted(()=>t?.destroy()),e.provide(r.componentAccessorKey,{data:a,update:n=>o.component=n,destroy:()=>o.component=void 0}),e.provide(r.tooltipAccessorKey,{data:a,update:n=>o.tooltip=n,destroy:()=>{o.tooltip=void 0}}),e.provide(r.annotationsAccessorKey,{data:a,update:n=>o.annotations=n,destroy:()=>{o.annotations=void 0}}),p({component:t}),(n,m)=>(e.openBlock(),e.createElementBlock("div",{"data-vis-single-container":"",ref_key:"elRef",ref:i,class:"unovis-single-container"},[e.renderSlot(n.$slots,"default")],512))}});exports.default=f;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/containers/single-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip, Annotations } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, watchEffect, reactive, toRaw } from 'vue'\nimport { annotationsAccessorKey, componentAccessorKey, tooltipAccessorKey, } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<SingleContainerConfigInterface<T> & { data?: T }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nlet chart: SingleContainer<T>\nconst config = reactive({\n component: undefined,\n tooltip: undefined,\n annotations: undefined,\n}) as SingleContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nconst initChart = () => {\n if (chart) return\n if (elRef.value && config.component)\n chart = new SingleContainer(elRef.value, { ...toRaw(config) }, data.value)\n}\n\nwatchEffect(() => {\n initChart()\n // watch deep changes in components config\n const t = config.component?.config\n chart?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nwatch(data, () => {\n if (chart) {\n chart.setData(data.value, true)\n } else {\n initChart()\n }\n})\n\nonUnmounted(() => chart?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => config.component = c,\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-single-container ref=\"elRef\" class='unovis-single-container'>\n <slot />\n </div>\n</template>\n\n\n\n<style>\n.unovis-single-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","config","reactive","elRef","ref","initChart","SingleContainer","toRaw","watchEffect","_a","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","t","annotationsAccessorKey","a","__expose","_createElementBlock","_renderSlot","_ctx"],"mappings":"ycAMA,MAAMA,EAAQC,EACR,CAAE,KAAAC,CAAA,EAASC,EAAAA,OAAOH,CAAK,EACvBI,EAAcC,EAAAA,gBAAgBL,CAAK,EAEzC,IAAIM,EACJ,MAAMC,EAASC,EAAAA,SAAS,CACtB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script setup lang=\"ts\" generic=\"T\">\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip, Annotations } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, watchEffect, reactive, toRaw } from 'vue'\nimport { annotationsAccessorKey, componentAccessorKey, tooltipAccessorKey, } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<SingleContainerConfigInterface<T> & { data?: T }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nlet chart: SingleContainer<T>\nconst config = reactive({\n component: undefined,\n tooltip: undefined,\n annotations: undefined,\n}) as SingleContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nconst initChart = () => {\n if (chart) return\n if (elRef.value && config.component)\n chart = new SingleContainer(elRef.value, { ...toRaw(config) }, data.value)\n}\n\nwatchEffect(() => {\n initChart()\n // watch deep changes in components config\n const t = config.component?.config\n chart?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nwatch(data, () => {\n if (chart) {\n chart.setData(data.value, true)\n } else {\n initChart()\n }\n})\n\nonUnmounted(() => chart?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => config.component = c,\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-single-container ref=\"elRef\" class='unovis-single-container'>\n <slot />\n </div>\n</template>\n\n\n\n<style>\n.unovis-single-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","config","reactive","elRef","ref","initChart","SingleContainer","toRaw","watchEffect","watch","onUnmounted","provide","componentAccessorKey","c","toolt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BAICmB,EAAAA,mBAEM,MAAA,CAFD,4BAAA,WAA8B,QAAJ,IAAIhB,EAAQ,MAAM,yBAAA,GAC/CiB,aAAQC,EAAA,OAAA,SAAA,CAAA"}
@@ -1,5 +1,5 @@
1
- import { defineComponent as m, toRefs as f, reactive as u, ref as v, watchEffect as g, watch as y, onUnmounted as w, provide as a, openBlock as _, createElementBlock as C, renderSlot as R, toRaw as s } from "vue";
2
- import { SingleContainer as h } from "@unovis/ts";
1
+ import { defineComponent as m, toRefs as f, reactive as u, ref as v, watchEffect as g, watch as y, onUnmounted as h, provide as i, openBlock as w, createElementBlock as _, renderSlot as C, toRaw as r } from "vue";
2
+ import { SingleContainer as R } from "@unovis/ts";
3
3
  import { componentAccessorKey as k, tooltipAccessorKey as x, annotationsAccessorKey as A } from "../../utils/context.js";
4
4
  import { useForwardProps as K } from "../../utils/props.js";
5
5
  const S = /* @__PURE__ */ m({
@@ -19,46 +19,45 @@ const S = /* @__PURE__ */ m({
19
19
  ariaLabel: {},
20
20
  data: {}
21
21
  },
22
- setup(c, { expose: d }) {
23
- const r = c, { data: n } = f(r), l = K(r);
24
- let o;
25
- const e = u({
22
+ setup(p, { expose: d }) {
23
+ const s = p, { data: n } = f(s), l = K(s);
24
+ let e;
25
+ const o = u({
26
26
  component: void 0,
27
27
  tooltip: void 0,
28
28
  annotations: void 0
29
- }), i = v(), p = () => {
30
- o || i.value && e.component && (o = new h(i.value, { ...s(e) }, n.value));
29
+ }), a = v(), c = () => {
30
+ e || a.value && o.component && (e = new R(a.value, { ...r(o) }, n.value));
31
31
  };
32
32
  return g(() => {
33
- var t;
34
- p(), (t = e.component) == null || t.config, o == null || o.updateContainer({ ...s(l.value), ...s(e) });
33
+ c(), o.component?.config, e?.updateContainer({ ...r(l.value), ...r(o) });
35
34
  }), y(n, () => {
36
- o ? o.setData(n.value, !0) : p();
37
- }), w(() => o == null ? void 0 : o.destroy()), a(k, {
35
+ e ? e.setData(n.value, !0) : c();
36
+ }), h(() => e?.destroy()), i(k, {
38
37
  data: n,
39
- update: (t) => e.component = t,
40
- destroy: () => e.component = void 0
41
- }), a(x, {
38
+ update: (t) => o.component = t,
39
+ destroy: () => o.component = void 0
40
+ }), i(x, {
42
41
  data: n,
43
- update: (t) => e.tooltip = t,
42
+ update: (t) => o.tooltip = t,
44
43
  destroy: () => {
45
- e.tooltip = void 0;
44
+ o.tooltip = void 0;
46
45
  }
47
- }), a(A, {
46
+ }), i(A, {
48
47
  data: n,
49
- update: (t) => e.annotations = t,
48
+ update: (t) => o.annotations = t,
50
49
  destroy: () => {
51
- e.annotations = void 0;
50
+ o.annotations = void 0;
52
51
  }
53
52
  }), d({
54
- component: o
55
- }), (t, B) => (_(), C("div", {
53
+ component: e
54
+ }), (t, B) => (w(), _("div", {
56
55
  "data-vis-single-container": "",
57
56
  ref_key: "elRef",
58
- ref: i,
57
+ ref: a,
59
58
  class: "unovis-single-container"
60
59
  }, [
61
- R(t.$slots, "default")
60
+ C(t.$slots, "default")
62
61
  ], 512));
63
62
  }
64
63
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip, Annotations } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, watchEffect, reactive, toRaw } from 'vue'\nimport { annotationsAccessorKey, componentAccessorKey, tooltipAccessorKey, } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<SingleContainerConfigInterface<T> & { data?: T }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nlet chart: SingleContainer<T>\nconst config = reactive({\n component: undefined,\n tooltip: undefined,\n annotations: undefined,\n}) as SingleContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nconst initChart = () => {\n if (chart) return\n if (elRef.value && config.component)\n chart = new SingleContainer(elRef.value, { ...toRaw(config) }, data.value)\n}\n\nwatchEffect(() => {\n initChart()\n // watch deep changes in components config\n const t = config.component?.config\n chart?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nwatch(data, () => {\n if (chart) {\n chart.setData(data.value, true)\n } else {\n initChart()\n }\n})\n\nonUnmounted(() => chart?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => config.component = c,\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-single-container ref=\"elRef\" class='unovis-single-container'>\n <slot />\n </div>\n</template>\n\n\n\n<style>\n.unovis-single-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","config","reactive","elRef","ref","initChart","SingleContainer","toRaw","watchEffect","_a","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","annotationsAccessorKey","a","__expose","_createElementBlock","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAMA,UAAMA,IAAQC,GACR,EAAE,MAAAC,EAAA,IAASC,EAAOH,CAAK,GACvBI,IAAcC,EAAgBL,CAAK;AAEzC,QAAIM;AACJ,UAAMC,IAASC,EAAS;AAAA,MACtB,WAAW;AAAA,MACX,SAAS;AAAA,MACT,aAAa;AAAA,IAAA,CACd,GACKC,IAAQC,EAAA,GAERC,IAAY,MAAM;AACtB,MAAIL,KACAG,EAAM,SAASF,EAAO,cACxBD,IAAQ,IAAIM,EAAgBH,EAAM,OAAO,EAAE,GAAGI,EAAMN,CAAM,EAAA,GAAKL,EAAK,KAAK;AAAA,IAC7E;AAEA,WAAAY,EAAY,MAAM;;AAChB,MAAAH,EAAA,IAEUI,IAAAR,EAAO,cAAP,QAAAQ,EAAkB,QAC5BT,KAAA,QAAAA,EAAO,gBAAgB,EAAE,GAAGO,EAAMT,EAAY,KAAK,GAAG,GAAGS,EAAMN,CAAM;IACvE,CAAC,GAEDS,EAAMd,GAAM,MAAM;AAChB,MAAII,IACFA,EAAM,QAAQJ,EAAK,OAAO,EAAI,IAE9BS,EAAA;AAAA,IAEJ,CAAC,GAEDM,EAAY,MAAMX,KAAA,gBAAAA,EAAO,SAAS,GAElCY,EAAQC,GAAsB;AAAA,MAC5B,MAAAjB;AAAA,MACA,QAAQ,CAACkB,MAAwBb,EAAO,YAAYa;AAAA,MACpD,SAAS,MAAMb,EAAO,YAAY;AAAA,IAAA,CACnC,GAEDW,EAAQG,GAAoB;AAAA,MAC1B,MAAAnB;AAAA,MACA,QAAQ,CAAC,MAAeK,EAAO,UAAU;AAAA,MACzC,SAAS,MAAM;AAAE,QAAAA,EAAO,UAAU;AAAA,MAAU;AAAA,IAAA,CAC7C,GAEDW,EAAQI,GAAwB;AAAA,MAC9B,MAAApB;AAAA,MACA,QAAQ,CAACqB,MAAmBhB,EAAO,cAAcgB;AAAA,MACjD,SAAS,MAAM;AAAE,QAAAhB,EAAO,cAAc;AAAA,MAAU;AAAA,IAAA,CACjD,GAGDiB,EAAa;AAAA,MACX,WAAWlB;AAAA,IAAA,CACZ,mBAICmB,EAEM,OAAA;AAAA,MAFD,6BAAA;AAAA,eAA8B;AAAA,MAAJ,KAAIhB;AAAA,MAAQ,OAAM;AAAA,IAAA;MAC/CiB,EAAQC,EAAA,QAAA,SAAA;AAAA,IAAA;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip, Annotations } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, watchEffect, reactive, toRaw } from 'vue'\nimport { annotationsAccessorKey, componentAccessorKey, tooltipAccessorKey, } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<SingleContainerConfigInterface<T> & { data?: T }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nlet chart: SingleContainer<T>\nconst config = reactive({\n component: undefined,\n tooltip: undefined,\n annotations: undefined,\n}) as SingleContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nconst initChart = () => {\n if (chart) return\n if (elRef.value && config.component)\n chart = new SingleContainer(elRef.value, { ...toRaw(config) }, data.value)\n}\n\nwatchEffect(() => {\n initChart()\n // watch deep changes in components config\n const t = config.component?.config\n chart?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nwatch(data, () => {\n if (chart) {\n chart.setData(data.value, true)\n } else {\n initChart()\n }\n})\n\nonUnmounted(() => chart?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => config.component = c,\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-single-container ref=\"elRef\" class='unovis-single-container'>\n <slot />\n </div>\n</template>\n\n\n\n<style>\n.unovis-single-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","config","reactive","elRef","ref","initChart","SingleContainer","toRaw","watchEffect","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","annotationsAccessorKey","a","__expose","_createElementBlock","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAMA,UAAMA,IAAQC,GACR,EAAE,MAAAC,EAAA,IAASC,EAAOH,CAAK,GACvBI,IAAcC,E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A,MAAQ,OAAM;AAAA,IAAA;MAC/CgB,EAAQC,EAAA,QAAA,SAAA;AAAA,IAAA;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),l=require("@unovis/ts"),i=require("../../utils/context.cjs"),v=require("../../utils/props.cjs"),y=o.defineComponent({__name:"index",props:{components:{},xScale:{type:[Object,Function]},xDomain:{},xDomainMinConstraint:{},xDomainMaxConstraint:{},xRange:{},yScale:{type:[Object,Function]},yDomain:{},yDomainMinConstraint:{},yDomainMaxConstraint:{},yRange:{},yDirection:{},xAxis:{},yAxis:{},autoMargin:{type:Boolean},tooltip:{},crosshair:{},preventEmptyDomain:{type:[Boolean,null]},scaleByDomain:{type:Boolean},annotations:{},clipPathExtend:{},onRenderComplete:{type:Function},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(p,{expose:d}){const c=p,{data:n}=o.toRefs(c),u=v.useForwardProps(c),a=o.ref(),t=o.reactive({components:[],annotations:void 0,crosshair:void 0,tooltip:void 0,xAxis:void 0,yAxis:void 0}),r=o.ref();return o.watch(n,()=>{a.value&&a.value.setData(n.value,!0)}),o.watchEffect(()=>{var e;t.components.map(s=>s.config),(e=a.value)==null||e.updateContainer({...o.toRaw(u.value),...o.toRaw(t)})}),o.onMounted(()=>{r.value&&(a.value=new l.XYContainer(r.value,{...o.toRaw(t)},n.value))}),o.onUnmounted(()=>{var e;return(e=a.value)==null?void 0:e.destroy()}),o.provide(i.componentAccessorKey,{data:n,update:e=>t.components=[...t.components,e],destroy:()=>{var e;return t.components=(e=t.components)==null?void 0:e.filter(s=>!s.isDestroyed())}}),o.provide(i.axisAccessorKey,{data:n,update:e=>t[`${e.config.type}Axis`]=e,destroy:e=>{t[`${e}Axis`]=void 0}}),o.provide(i.crosshairAccessorKey,{data:n,update:e=>t.crosshair=e,destroy:()=>{t.crosshair=void 0}}),o.provide(i.tooltipAccessorKey,{data:n,update:e=>t.tooltip=e,destroy:()=>{t.tooltip=void 0}}),o.provide(i.annotationsAccessorKey,{data:n,update:e=>t.annotations=e,destroy:()=>{t.annotations=void 0}}),d({component:a}),(e,s)=>(o.openBlock(),o.createElementBlock("div",{"data-vis-xy-container":"",ref_key:"elRef",ref:r,class:"unovis-xy-container"},[o.renderSlot(e.$slots,"default")],512))}});exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),y=require("@unovis/ts"),s=require("../../utils/context.cjs"),v=require("../../utils/props.cjs"),m=o.defineComponent({__name:"index",props:{components:{},xScale:{type:[Object,Function]},xDomain:{},xDomainMinConstraint:{},xDomainMaxConstraint:{},xRange:{},yScale:{type:[Object,Function]},yDomain:{},yDomainMinConstraint:{},yDomainMaxConstraint:{},yRange:{},yDirection:{},xAxis:{},yAxis:{},autoMargin:{type:Boolean},tooltip:{},crosshair:{},preventEmptyDomain:{type:[Boolean,null]},scaleByDomain:{type:Boolean},annotations:{},clipPathExtend:{},onRenderComplete:{type:Function},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(d,{expose:l}){const c=d,{data:n}=o.toRefs(c),u=v.useForwardProps(c),a=o.ref(),t=o.reactive({components:[],annotations:void 0,crosshair:void 0,tooltip:void 0,xAxis:void 0,yAxis:void 0}),r=o.ref(),p=()=>{a.value||!r.value||!Object.values(t).some(i=>Array.isArray(i)?i.length:i)||(a.value=new y.XYContainer(r.value,{...o.toRaw(t)},n.value))};return o.watchEffect(()=>{p(),t.components.map(e=>e.config),a.value?.updateContainer({...o.toRaw(u.value),...o.toRaw(t)})}),o.watch(n,()=>{a.value?a.value.setData(n.value,!0):p()}),o.onUnmounted(()=>a.value?.destroy()),o.provide(s.componentAccessorKey,{data:n,update:e=>t.components=[...t.components,e],destroy:()=>t.components=t.components?.filter(e=>!e.isDestroyed())}),o.provide(s.axisAccessorKey,{data:n,update:e=>t[`${e.config.type}Axis`]=e,destroy:e=>{t[`${e}Axis`]=void 0}}),o.provide(s.crosshairAccessorKey,{data:n,update:e=>t.crosshair=e,destroy:()=>{t.crosshair=void 0}}),o.provide(s.tooltipAccessorKey,{data:n,update:e=>t.tooltip=e,destroy:()=>{t.tooltip=void 0}}),o.provide(s.annotationsAccessorKey,{data:n,update:e=>t.annotations=e,destroy:()=>{t.annotations=void 0}}),l({component:a}),(e,i)=>(o.openBlock(),o.createElementBlock("div",{"data-vis-xy-container":"",ref_key:"elRef",ref:r,class:"unovis-xy-container"},[o.renderSlot(e.$slots,"default")],512))}});exports.default=m;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/containers/xy-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { XYContainer, XYComponentCore, XYContainerConfigInterface, Tooltip, Crosshair, Axis, Annotations } from '@unovis/ts'\nimport { onMounted, onUnmounted, ref, provide, watch, toRefs, reactive, watchEffect, toRaw } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey, axisAccessorKey, crosshairAccessorKey, annotationsAccessorKey } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<XYContainerConfigInterface<T> & { data?: T[] }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nconst chart = ref<XYContainer<T> | undefined>()\nconst config = reactive({\n components: [],\n annotations: undefined,\n crosshair: undefined,\n tooltip: undefined,\n xAxis: undefined,\n yAxis: undefined,\n}) as XYContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nwatch(data, () => {\n if (chart.value) {\n chart.value.setData(data.value, true)\n }\n})\n\nwatchEffect(() => {\n // watch deep changes in components config\n const t = config.components.map(i => i.config)\n chart.value?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nonMounted(() => {\n if (elRef.value) chart.value = new XYContainer(elRef.value, { ...toRaw(config) }, data.value)\n})\n\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: XYComponentCore<T>) => config.components = [...config.components!, c],\n destroy: () => config.components = config.components?.filter(c => !c.isDestroyed()),\n})\n\nprovide(axisAccessorKey, {\n data,\n update: (c: Axis<T>) => config[`${c.config.type}Axis`] = c,\n destroy: (c) => { config[`${c}Axis`] = undefined },\n})\n\nprovide(crosshairAccessorKey, {\n data,\n update: (c: Crosshair<T>) => config.crosshair = c,\n destroy: () => { config.crosshair = undefined },\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-xy-container ref=\"elRef\" class='unovis-xy-container'>\n <slot />\n </div>\n</template>\n\n\n<style>\n.unovis-xy-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","ref","config","reactive","elRef","watch","watchEffect","i","_a","toRaw","onMounted","XYContainer","onUnmounted","provide","componentAccessorKey","c","axisAccessorKey","crosshairAccessorKey","tooltipAccessorKey","t","annotationsAccessorKey","a","__expose","_createElementBlock","_renderSlot","_ctx"],"mappings":"mzBAMA,MAAMA,EAAQC,EACR,CAAE,KAAAC,CAAA,EAASC,EAAAA,OAAOH,CAAK,EACvBI,EAAcC,EAAAA,gBAAgBL,CAAK,EAEnCM,EAAQC,EAAAA,IAAA,EACRC,EAASC,EAAAA,SAAS,CACtB,WAAY,CAAA,EACZ,YAAa,OACb,UAAW,OACX,QAAS,OACT,MAAO,OACP,MAAO,MAAA,CACR,EACKC,EAAQH,EAAAA,IAAA,EAEdI,OAAAA,EAAAA,MAAMT,EAAM,IAAM,CACZI,EAAM,OACRA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,EAAAA,QAAQO,EAAAA,uBAAwB,CAC9B,KAAAxB,EACA,OAASyB,GAAmBnB,EAAO,YAAcmB,EACjD,QAAS,IAAM,CAAEnB,EAAO,YAAc,MAAU,CAAA,CACjD,EAEDoB,EAAa,CACX,UAAWtB,CAAA,CACZ,wBAICuB,EAAAA,mBAEM,MAAA,CAFD,wBAAA,WAA0B,QAAJ,IAAInB,EAAQ,MAAM,qBAAA,GAC3CoB,aAAQC,EAAA,OAAA,SAAA,CAAA"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/containers/xy-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { XYContainer, XYComponentCore, XYContainerConfigInterface, Tooltip, Crosshair, Axis, Annotations } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, reactive, watchEffect, toRaw } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey, axisAccessorKey, crosshairAccessorKey, annotationsAccessorKey } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<XYContainerConfigInterface<T> & { data?: T[] }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nconst chart = ref<XYContainer<T>>()\nconst config = reactive({\n components: [],\n annotations: undefined,\n crosshair: undefined,\n tooltip: undefined,\n xAxis: undefined,\n yAxis: undefined,\n}) as XYContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nconst initChart = () => {\n if (chart.value || !elRef.value) return\n // config holds only child-registration slots — if all are empty, no slot has registered yet\n const hasContent = Object.values(config).some(v => Array.isArray(v) ? v.length : v)\n if (!hasContent) return\n chart.value = new XYContainer(elRef.value, { ...toRaw(config) }, data.value)\n}\n\nwatchEffect(() => {\n initChart()\n // touch deep changes in components config to track them\n const t = config.components.map(i => i.config)\n chart.value?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nwatch(data, () => {\n if (chart.value) chart.value.setData(data.value, true)\n else initChart()\n})\n\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: XYComponentCore<T>) => config.components = [...config.components!, c],\n destroy: () => config.components = config.components?.filter(c => !c.isDestroyed()),\n})\n\nprovide(axisAccessorKey, {\n data,\n update: (c: Axis<T>) => config[`${c.config.type}Axis`] = c,\n destroy: (c) => { config[`${c}Axis`] = undefined },\n})\n\nprovide(crosshairAccessorKey, {\n data,\n update: (c: Crosshair<T>) => config.crosshair = c,\n destroy: () => { config.crosshair = undefined },\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-xy-container ref=\"elRef\" class='unovis-xy-container'>\n <slot />\n </div>\n</template>\n\n\n<style>\n.unovis-xy-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","ref","config","reactive","elRef","initChart","v","XYContainer","toRaw","watchEffect","i","watch","onUnmounted","provide","componentAccessorKey","c","axisAccessorKey","crosshairAccessorKey","tooltipAccessorKey","t","annotationsAccessorKey","a","__expose","_createElementBlock","_renderSlot","_ctx"],"mappings":"mzBAMA,MAAMA,EAAQC,EACR,CAAE,KAAAC,CAAA,EAASC,EAAAA,OAAOH,CAAK,EACvBI,EAAcC,EAAAA,gBAAgBL,CAAK,EAEnCM,EAAQC,EAAAA,IAAA,EACRC,EAASC,EAAAA,SAAS,CACtB,WAAY,CAAA,EACZ,YAAa,OACb,UAAW,OACX,QAAS,OACT,MAAO,OACP,MAAO,MAAA,CACR,EACKC,EAAQH,EAAAA,IAAA,EAERI,EAAY,IAAM,CAClBL,EAAM,OAAS,CAACI,EAAM,OAGtB,CADe,OAAO,OAAOF,CAAM,EAAE,KAAKI,GAAK,MAAM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W,EAAAA,QAAQO,EAAAA,uBAAwB,CAC9B,KAAAxB,EACA,OAASyB,GAAmBnB,EAAO,YAAcmB,EACjD,QAAS,IAAM,CAAEnB,EAAO,YAAc,MAAU,CAAA,CACjD,EAEDoB,EAAa,CACX,UAAWtB,CAAA,CACZ,wBAICuB,EAAAA,mBAEM,MAAA,CAFD,wBAAA,WAA0B,QAAJ,IAAInB,EAAQ,MAAM,qBAAA,GAC3CoB,aAAQC,EAAA,OAAA,SAAA,CAAA"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as u, toRefs as y, ref as p, reactive as v, watch as f, watchEffect as x, toRaw as r, onMounted as h, onUnmounted as D, provide as a, openBlock as g, createElementBlock as A, renderSlot as C } from "vue";
1
+ import { defineComponent as y, toRefs as v, ref as d, reactive as f, watchEffect as x, toRaw as r, watch as h, onUnmounted as A, provide as a, openBlock as g, createElementBlock as D, renderSlot as C } from "vue";
2
2
  import { XYContainer as R } from "@unovis/ts";
3
- import { componentAccessorKey as w, axisAccessorKey as B, crosshairAccessorKey as M, tooltipAccessorKey as _, annotationsAccessorKey as K } from "../../utils/context.js";
4
- import { useForwardProps as E } from "../../utils/props.js";
5
- const S = /* @__PURE__ */ u({
3
+ import { componentAccessorKey as w, axisAccessorKey as B, crosshairAccessorKey as _, tooltipAccessorKey as K, annotationsAccessorKey as M } from "../../utils/context.js";
4
+ import { useForwardProps as b } from "../../utils/props.js";
5
+ const O = /* @__PURE__ */ y({
6
6
  __name: "index",
7
7
  props: {
8
8
  components: {},
@@ -37,62 +37,55 @@ const S = /* @__PURE__ */ u({
37
37
  ariaLabel: {},
38
38
  data: {}
39
39
  },
40
- setup(d, { expose: l }) {
41
- const c = d, { data: t } = y(c), m = E(c), n = p(), e = v({
40
+ setup(l, { expose: m }) {
41
+ const c = l, { data: t } = v(c), u = b(c), n = d(), e = f({
42
42
  components: [],
43
43
  annotations: void 0,
44
44
  crosshair: void 0,
45
45
  tooltip: void 0,
46
46
  xAxis: void 0,
47
47
  yAxis: void 0
48
- }), s = p();
49
- return f(t, () => {
50
- n.value && n.value.setData(t.value, !0);
51
- }), x(() => {
52
- var o;
53
- e.components.map((i) => i.config), (o = n.value) == null || o.updateContainer({ ...r(m.value), ...r(e) });
54
- }), h(() => {
55
- s.value && (n.value = new R(s.value, { ...r(e) }, t.value));
56
- }), D(() => {
57
- var o;
58
- return (o = n.value) == null ? void 0 : o.destroy();
59
- }), a(w, {
48
+ }), i = d(), p = () => {
49
+ n.value || !i.value || !Object.values(e).some((s) => Array.isArray(s) ? s.length : s) || (n.value = new R(i.value, { ...r(e) }, t.value));
50
+ };
51
+ return x(() => {
52
+ p(), e.components.map((o) => o.config), n.value?.updateContainer({ ...r(u.value), ...r(e) });
53
+ }), h(t, () => {
54
+ n.value ? n.value.setData(t.value, !0) : p();
55
+ }), A(() => n.value?.destroy()), a(w, {
60
56
  data: t,
61
57
  update: (o) => e.components = [...e.components, o],
62
- destroy: () => {
63
- var o;
64
- return e.components = (o = e.components) == null ? void 0 : o.filter((i) => !i.isDestroyed());
65
- }
58
+ destroy: () => e.components = e.components?.filter((o) => !o.isDestroyed())
66
59
  }), a(B, {
67
60
  data: t,
68
61
  update: (o) => e[`${o.config.type}Axis`] = o,
69
62
  destroy: (o) => {
70
63
  e[`${o}Axis`] = void 0;
71
64
  }
72
- }), a(M, {
65
+ }), a(_, {
73
66
  data: t,
74
67
  update: (o) => e.crosshair = o,
75
68
  destroy: () => {
76
69
  e.crosshair = void 0;
77
70
  }
78
- }), a(_, {
71
+ }), a(K, {
79
72
  data: t,
80
73
  update: (o) => e.tooltip = o,
81
74
  destroy: () => {
82
75
  e.tooltip = void 0;
83
76
  }
84
- }), a(K, {
77
+ }), a(M, {
85
78
  data: t,
86
79
  update: (o) => e.annotations = o,
87
80
  destroy: () => {
88
81
  e.annotations = void 0;
89
82
  }
90
- }), l({
83
+ }), m({
91
84
  component: n
92
- }), (o, i) => (g(), A("div", {
85
+ }), (o, s) => (g(), D("div", {
93
86
  "data-vis-xy-container": "",
94
87
  ref_key: "elRef",
95
- ref: s,
88
+ ref: i,
96
89
  class: "unovis-xy-container"
97
90
  }, [
98
91
  C(o.$slots, "default")
@@ -100,6 +93,6 @@ const S = /* @__PURE__ */ u({
100
93
  }
101
94
  });
102
95
  export {
103
- S as default
96
+ O as default
104
97
  };
105
98
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/containers/xy-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { XYContainer, XYComponentCore, XYContainerConfigInterface, Tooltip, Crosshair, Axis, Annotations } from '@unovis/ts'\nimport { onMounted, onUnmounted, ref, provide, watch, toRefs, reactive, watchEffect, toRaw } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey, axisAccessorKey, crosshairAccessorKey, annotationsAccessorKey } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<XYContainerConfigInterface<T> & { data?: T[] }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nconst chart = ref<XYContainer<T> | undefined>()\nconst config = reactive({\n components: [],\n annotations: undefined,\n crosshair: undefined,\n tooltip: undefined,\n xAxis: undefined,\n yAxis: undefined,\n}) as XYContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nwatch(data, () => {\n if (chart.value) {\n chart.value.setData(data.value, true)\n }\n})\n\nwatchEffect(() => {\n // watch deep changes in components config\n const t = config.components.map(i => i.config)\n chart.value?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nonMounted(() => {\n if (elRef.value) chart.value = new XYContainer(elRef.value, { ...toRaw(config) }, data.value)\n})\n\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: XYComponentCore<T>) => config.components = [...config.components!, c],\n destroy: () => config.components = config.components?.filter(c => !c.isDestroyed()),\n})\n\nprovide(axisAccessorKey, {\n data,\n update: (c: Axis<T>) => config[`${c.config.type}Axis`] = c,\n destroy: (c) => { config[`${c}Axis`] = undefined },\n})\n\nprovide(crosshairAccessorKey, {\n data,\n update: (c: Crosshair<T>) => config.crosshair = c,\n destroy: () => { config.crosshair = undefined },\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-xy-container ref=\"elRef\" class='unovis-xy-container'>\n <slot />\n </div>\n</template>\n\n\n<style>\n.unovis-xy-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","ref","config","reactive","elRef","watch","watchEffect","_a","toRaw","onMounted","XYContainer","onUnmounted","provide","componentAccessorKey","c","axisAccessorKey","crosshairAccessorKey","tooltipAccessorKey","t","annotationsAccessorKey","a","__expose","_createElementBlock","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,UAAMA,IAAQC,GACR,EAAE,MAAAC,EAAA,IAASC,EAAOH,CAAK,GACvBI,IAAcC,EAAgBL,CAAK,GAEnCM,IAAQC,EAAA,GACRC,IAASC,EAAS;AAAA,MACtB,YAAY,CAAA;AAAA,MACZ,aAAa;AAAA,MACb,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,MACP,OAAO;AAAA,IAAA,CACR,GACKC,IAAQH,EAAA;AAEd,WAAAI,EAAMT,GAAM,MAAM;AAChB,MAAII,EAAM,SACRA,EAAM,MAAM,QAAQJ,EAAK,OAAO,EAAI;AAAA,IAExC,CAAC,GAEDU,EAAY,MAAM;;AAEN,MAAAJ,EAAO,WAAW,IAAI,CAAA,MAAK,EAAE,MAAM,IAC7CK,IAAAP,EAAM,UAAN,QAAAO,EAAa,gB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ACwB,MAAmBlB,EAAO,cAAckB;AAAA,MACjD,SAAS,MAAM;AAAE,QAAAlB,EAAO,cAAc;AAAA,MAAU;AAAA,IAAA,CACjD,GAEDmB,EAAa;AAAA,MACX,WAAWrB;AAAA,IAAA,CACZ,mBAICsB,EAEM,OAAA;AAAA,MAFD,yBAAA;AAAA,eAA0B;AAAA,MAAJ,KAAIlB;AAAA,MAAQ,OAAM;AAAA,IAAA;MAC3CmB,EAAQC,EAAA,QAAA,SAAA;AAAA,IAAA;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/containers/xy-container/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"T\">\nimport { XYContainer, XYComponentCore, XYContainerConfigInterface, Tooltip, Crosshair, Axis, Annotations } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, reactive, watchEffect, toRaw } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey, axisAccessorKey, crosshairAccessorKey, annotationsAccessorKey } from \"../../utils/context\"\nimport { useForwardProps } from \"../../utils/props\"\n\nconst props = defineProps<XYContainerConfigInterface<T> & { data?: T[] }>()\nconst { data } = toRefs(props)\nconst parsedProps = useForwardProps(props)\n\nconst chart = ref<XYContainer<T>>()\nconst config = reactive({\n components: [],\n annotations: undefined,\n crosshair: undefined,\n tooltip: undefined,\n xAxis: undefined,\n yAxis: undefined,\n}) as XYContainerConfigInterface<T>\nconst elRef = ref<HTMLDivElement>()\n\nconst initChart = () => {\n if (chart.value || !elRef.value) return\n // config holds only child-registration slots — if all are empty, no slot has registered yet\n const hasContent = Object.values(config).some(v => Array.isArray(v) ? v.length : v)\n if (!hasContent) return\n chart.value = new XYContainer(elRef.value, { ...toRaw(config) }, data.value)\n}\n\nwatchEffect(() => {\n initChart()\n // touch deep changes in components config to track them\n const t = config.components.map(i => i.config)\n chart.value?.updateContainer({ ...toRaw(parsedProps.value), ...toRaw(config) })\n})\n\nwatch(data, () => {\n if (chart.value) chart.value.setData(data.value, true)\n else initChart()\n})\n\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: XYComponentCore<T>) => config.components = [...config.components!, c],\n destroy: () => config.components = config.components?.filter(c => !c.isDestroyed()),\n})\n\nprovide(axisAccessorKey, {\n data,\n update: (c: Axis<T>) => config[`${c.config.type}Axis`] = c,\n destroy: (c) => { config[`${c}Axis`] = undefined },\n})\n\nprovide(crosshairAccessorKey, {\n data,\n update: (c: Crosshair<T>) => config.crosshair = c,\n destroy: () => { config.crosshair = undefined },\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => config.tooltip = t,\n destroy: () => { config.tooltip = undefined },\n})\n\nprovide(annotationsAccessorKey, {\n data,\n update: (a: Annotations) => config.annotations = a,\n destroy: () => { config.annotations = undefined },\n})\n\ndefineExpose({\n component: chart\n})\n</script>\n\n<template>\n <div data-vis-xy-container ref=\"elRef\" class='unovis-xy-container'>\n <slot />\n </div>\n</template>\n\n\n<style>\n.unovis-xy-container {\n display: block;\n position: relative;\n width: 100%;\n}\n</style>\n"],"names":["props","__props","data","toRefs","parsedProps","useForwardProps","chart","ref","config","reactive","elRef","initChart","v","XYContainer","toRaw","watchEffect","i","watch","onUnmounted","provide","componentAccessorKey","c","axisAccessorKey","crosshairAccessorKey","tooltipAccessorKey","t","annotationsAccessorKey","a","__expose","_createElementBlock","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,UAAMA,IAAQC,GACR,EAAE,MAAAC,EAAA,IAASC,EAAOH,CAAK,GACvBI,IAAcC,EAAgBL,CAAK,GAEnCM,IAAQC,EAAA,GACRC,IAASC,EAAS;AAAA,MACtB,YAAY,CAAA;AAAA,MACZ,aAAa;AAAA,MACb,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,MACP,OAAO;AAAA,IAAA,CACR,GACKC,IAAQH,EAAA,GAERI,IAAY,MAAM;AAItB,MAHIL,EAAM,SAAS,CA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W,EAAQK,GAAoB;AAAA,MAC1B,MAAAtB;AAAA,MACA,QAAQ,CAACuB,MAAejB,EAAO,UAAUiB;AAAA,MACzC,SAAS,MAAM;AAAE,QAAAjB,EAAO,UAAU;AAAA,MAAU;AAAA,IAAA,CAC7C,GAEDW,EAAQO,GAAwB;AAAA,MAC9B,MAAAxB;AAAA,MACA,QAAQ,CAACyB,MAAmBnB,EAAO,cAAcmB;AAAA,MACjD,SAAS,MAAM;AAAE,QAAAnB,EAAO,cAAc;AAAA,MAAU;AAAA,IAAA,CACjD,GAEDoB,EAAa;AAAA,MACX,WAAWtB;AAAA,IAAA,CACZ,mBAICuB,EAEM,OAAA;AAAA,MAFD,yBAAA;AAAA,eAA0B;AAAA,MAAJ,KAAInB;AAAA,MAAQ,OAAM;AAAA,IAAA;MAC3CoB,EAAQC,EAAA,QAAA,SAAA;AAAA,IAAA;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("@unovis/ts"),s=require("../../utils/props.cjs"),p=i.BulletLegend.selectors,f=e.defineComponent({__name:"index",props:{items:{},labelClassName:{},onLegendItemClick:{type:Function},labelFontSize:{},labelMaxWidth:{},bulletSize:{},bulletSpacing:{},bulletShape:{type:[Function,null]},orientation:{},renderIntoProvidedDomNode:{type:Boolean},data:{}},setup(c,{expose:d}){const r=c;e.computed(()=>r.data);const n=s.useForwardProps(r),o=e.ref(),l=e.ref();return e.onMounted(()=>{e.nextTick(()=>{l.value&&(o.value=new i.BulletLegend(l.value,{...n.value,renderIntoProvidedDomNode:!0}))})}),e.onUnmounted(()=>{var t;(t=o.value)==null||t.destroy()}),e.watch(n,(t,u)=>{var a;s.arePropsEqual(t,u)||(a=o.value)==null||a.setConfig(n.value)}),d({component:o}),(t,u)=>(e.openBlock(),e.createElementBlock("div",{"data-vis-bullet-legend":"",ref_key:"elRef",ref:l},null,512))}});exports.VisBulletLegendSelectors=p;exports.default=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("@unovis/ts"),a=require("../../utils/props.cjs"),c=s.BulletLegend.selectors,p=e.defineComponent({__name:"index",props:{items:{},labelClassName:{},onLegendItemClick:{type:Function},labelFontSize:{},labelMaxWidth:{},bulletSize:{},bulletSpacing:{},bulletShape:{type:[Function,null]},orientation:{},renderIntoProvidedDomNode:{type:Boolean},data:{}},setup(d,{expose:i}){const l=d;e.computed(()=>l.data);const n=a.useForwardProps(l),t=e.ref(),o=e.ref();return e.onMounted(()=>{e.nextTick(()=>{o.value&&(t.value=new s.BulletLegend(o.value,{...n.value,renderIntoProvidedDomNode:!0}))})}),e.onUnmounted(()=>{t.value?.destroy()}),e.watch(n,(r,u)=>{a.arePropsEqual(r,u)||(t.value?.setConfig(n.value),t.value?.render())}),i({component:t}),(r,u)=>(e.openBlock(),e.createElementBlock("div",{"data-vis-bullet-legend":"",ref_key:"elRef",ref:o},null,512))}});exports.VisBulletLegendSelectors=c;exports.default=p;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/html-components/bullet-legend/index.vue"],"sourcesContent":["<script setup lang=\"ts\" >\n// !!! This code was automatically generated. You should not change it !!!\nimport { BulletLegend, BulletLegendConfigInterface, BulletLegendItemInterface } 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 = BulletLegendConfigInterface\nconst props = defineProps<Props & { data?: null }>()\n\nconst data = computed(() => props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<BulletLegend>()\nconst elRef = ref<HTMLDivElement>()\n\nonMounted(() => {\n nextTick(() => {\n if(elRef.value)\n component.value = new BulletLegend(elRef.value, { ...config.value, renderIntoProvidedDomNode: true })\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 }\n})\n\n\ndefineExpose({\n component\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisBulletLegendSelectors = BulletLegend.selectors\n</script>\n\n<template>\n <div data-vis-bullet-legend ref=\"elRef\"/>\n</template>\n\n\n<style>\n [data-vis-bullet-legend] {\n display:block;\n }\n</style>\n"],"names":["VisBulletLegendSelectors","BulletLegend","props","__props","computed","config","useForwardProps","component","ref","elRef","onMounted","nextTick","onUnmounted","_a","watch","curr","prev","arePropsEqual","__expose","_createElementBlock"],"mappings":"8LA8CaA,EAA2BC,EAAAA,aAAa,2SArCrD,MAAMC,EAAQC,EAEDC,EAAAA,SAAS,IAAMF,EAAM,IAAI,EAEtC,MAAMG,EAASC,EAAAA,gBAAgBJ,CAAK,EAG9BK,EAAYC,EAAAA,IAAA,EACZC,EAAQD,EAAAA,IAAA,EAEdE,OAAAA,EAAAA,UAAU,IAAM,CACdC,EAAAA,SAAS,IAAM,CACVF,EAAM,QACTF,EAAU,MAAQ,IAAIN,EAAAA,aAAaQ,EAAM,MAAO,CAAE,GAAGJ,EAAO,MAAO,0BAA2B,EAAA,CAAM,EAGtG,CAAC,CACH,CAAC,EAEDO,EAAAA,YAAY,IAAM,QAChBC,EAAAN,EAAU,QAAV,MAAAM,EAAiB,SAEnB,CAAC,EAEDC,EAAAA,MAAMT,EAAQ,CAACU,EAAMC,IAAS,OACvBC,EAAAA,cAAcF,EAAMC,CAAI,IAC3BH,EAAAN,EAAU,QAAV,MAAAM,EAAiB,UAAUR,EAAO,MAEtC,CAAC,EAGDa,EAAa,CACX,UAAAX,CAAA,CACD,wBAQCY,EAAAA,mBAAyC,MAAA,CAApC,yBAAA,WAA2B,QAAJ,IAAIV,CAAA"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/html-components/bullet-legend/index.vue"],"sourcesContent":["<script setup lang=\"ts\" >\n// !!! This code was automatically generated. You should not change it !!!\nimport { BulletLegend, BulletLegendConfigInterface, BulletLegendItemInterface } 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 = BulletLegendConfigInterface\nconst props = defineProps<Props & { data?: null }>()\n\nconst data = computed(() => props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<BulletLegend>()\nconst elRef = ref<HTMLDivElement>()\n\nonMounted(() => {\n nextTick(() => {\n if(elRef.value)\n component.value = new BulletLegend(elRef.value, { ...config.value, renderIntoProvidedDomNode: true })\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\n\ndefineExpose({\n component\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisBulletLegendSelectors = BulletLegend.selectors\n</script>\n\n<template>\n <div data-vis-bullet-legend ref=\"elRef\"/>\n</template>\n\n\n<style>\n [data-vis-bullet-legend] {\n display:block;\n }\n</style>\n"],"names":["VisBulletLegendSelectors","BulletLegend","props","__props","computed","config","useForwardProps","component","ref","elRef","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_createElementBlock"],"mappings":"8LA+CaA,EAA2BC,EAAAA,aAAa,2SAtCrD,MAAMC,EAAQC,EAEDC,EAAAA,SAAS,IAAMF,EAAM,IAAI,EAEtC,MAAMG,EAASC,EAAAA,gBAAgBJ,CAAK,EAG9BK,EAAYC,EAAAA,IAAA,EACZC,EAAQD,EAAAA,IAAA,EAEdE,OAAAA,EAAAA,UAAU,IAAM,CACdC,EAAAA,SAAS,IAAM,CACVF,EAAM,QACTF,EAAU,MAAQ,IAAIN,EAAAA,aAAaQ,EAAM,MAAO,CAAE,GAAGJ,EAAO,MAAO,0BAA2B,EAAA,CAAM,EAGtG,CAAC,CACH,CAAC,EAEDO,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,EAGDU,EAAa,CACX,UAAAV,CAAA,CACD,wBAQCW,EAAAA,mBAAyC,MAAA,CAApC,yBAAA,WAA2B,QAAJ,IAAIT,CAAA"}