@unovis/vue 1.3.0-alpha.1 → 1.3.0-alpha.2

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 (52) hide show
  1. package/containers/single-container/index.cjs +2 -0
  2. package/containers/single-container/index.cjs.map +1 -0
  3. package/containers/single-container/{single-container.js → index.js} +12 -12
  4. package/containers/single-container/index.js.map +1 -0
  5. package/containers/single-container/index2.cjs +2 -0
  6. package/containers/single-container/index2.cjs.map +1 -0
  7. package/containers/single-container/index2.js +5 -0
  8. package/containers/single-container/index2.js.map +1 -0
  9. package/containers/single-container/index3.cjs +2 -0
  10. package/containers/single-container/index3.cjs.map +1 -0
  11. package/containers/single-container/index3.js +6 -0
  12. package/containers/single-container/index3.js.map +1 -0
  13. package/containers/xy-container/index.cjs +2 -0
  14. package/containers/xy-container/index.cjs.map +1 -0
  15. package/containers/xy-container/{xy-container.js → index.js} +2 -2
  16. package/containers/xy-container/index.js.map +1 -0
  17. package/containers/xy-container/index2.cjs +2 -0
  18. package/containers/xy-container/index2.cjs.map +1 -0
  19. package/containers/xy-container/index2.js +5 -0
  20. package/containers/xy-container/index2.js.map +1 -0
  21. package/containers/xy-container/index3.cjs +2 -0
  22. package/containers/xy-container/index3.cjs.map +1 -0
  23. package/containers/xy-container/index3.js +6 -0
  24. package/containers/xy-container/index3.js.map +1 -0
  25. package/containers.d.ts +2 -2
  26. package/index.cjs +2 -2
  27. package/index.js +5 -5
  28. package/package.json +14 -2
  29. package/containers/single-container/single-container.cjs +0 -2
  30. package/containers/single-container/single-container.cjs.map +0 -1
  31. package/containers/single-container/single-container.js.map +0 -1
  32. package/containers/single-container/single-container2.cjs +0 -2
  33. package/containers/single-container/single-container2.cjs.map +0 -1
  34. package/containers/single-container/single-container2.js +0 -5
  35. package/containers/single-container/single-container2.js.map +0 -1
  36. package/containers/single-container/single-container3.cjs +0 -2
  37. package/containers/single-container/single-container3.cjs.map +0 -1
  38. package/containers/single-container/single-container3.js +0 -6
  39. package/containers/single-container/single-container3.js.map +0 -1
  40. package/containers/xy-container/xy-container.cjs +0 -2
  41. package/containers/xy-container/xy-container.cjs.map +0 -1
  42. package/containers/xy-container/xy-container.js.map +0 -1
  43. package/containers/xy-container/xy-container2.cjs +0 -2
  44. package/containers/xy-container/xy-container2.cjs.map +0 -1
  45. package/containers/xy-container/xy-container2.js +0 -5
  46. package/containers/xy-container/xy-container2.js.map +0 -1
  47. package/containers/xy-container/xy-container3.cjs +0 -2
  48. package/containers/xy-container/xy-container3.cjs.map +0 -1
  49. package/containers/xy-container/xy-container3.js +0 -6
  50. package/containers/xy-container/xy-container3.js.map +0 -1
  51. /package/containers/single-container/{single-container.d.ts → index.d.ts} +0 -0
  52. /package/containers/xy-container/{xy-container.d.ts → index.d.ts} +0 -0
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("vue"),v=require("@unovis/ts"),u=require("../../utils/context.cjs"),f=require("../../utils/props.cjs"),m=e.defineComponent({__name:"index",props:{component:{},tooltip:{},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(l){const i=l,{data:n}=e.toRefs(i),d=e.getCurrentInstance(),c=e.computed(()=>f.parseProps(i,d)),r=e.ref(),o={component:void 0,tooltip:void 0},a=e.ref(),s=()=>{var t;p(),(t=r.value)==null||t.updateContainer({...c.value,...o})},p=()=>{r.value||a.value&&o.component&&n.value&&(r.value=new v.SingleContainer(a.value,o,n.value))};return e.watch(n,()=>{r.value?(r.value.setData(n.value,!0),s()):p()}),e.watch(c,()=>{s()}),e.onUnmounted(()=>{var t;return(t=r.value)==null?void 0:t.destroy()}),e.provide(u.componentAccessorKey,{data:n,update:t=>{o.component=t,s()},destroy:()=>o.component=void 0}),e.provide(u.tooltipAccessorKey,{data:n,update:t=>{o.tooltip=t,s()},destroy:()=>{o.tooltip=void 0}}),(t,g)=>(e.openBlock(),e.createElementBlock("div",{"data-vis-single-container":"",ref_key:"elRef",ref:a,class:"unovis-single-container"},[e.renderSlot(t.$slots,"default")],512))}});module.exports=m;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/containers/single-container/index.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, getCurrentInstance, computed } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey } from \"../../utils/context\"\nimport { parseProps } from \"../../utils/props\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n component: {},\n tooltip: {},\n duration: {},\n margin: {},\n padding: {},\n sizing: {},\n width: {},\n height: {},\n svgDefs: {},\n ariaLabel: {},\n data: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\nconst { data } = toRefs(props)\nconst instance = getCurrentInstance()\nconst parsedProps = computed(() => parseProps(props, instance))\n\nconst chart = ref<SingleContainer<T> | undefined>()\nconst config: SingleContainerConfigInterface<T> = {\n component: undefined,\n tooltip: undefined,\n}\nconst elRef = ref<HTMLDivElement>()\n\nconst updateContainer = () => {\n initChart()\n chart.value?.updateContainer({ ...parsedProps.value, ...config })\n}\n\nconst initChart = () => {\n if (chart.value) return\n if (elRef.value && config.component && data.value)\n chart.value = new SingleContainer(elRef.value, config, data.value)\n}\n\nwatch(data, () => {\n if (chart.value) {\n chart.value.setData(data.value, true)\n updateContainer()\n } else {\n initChart()\n }\n})\nwatch(parsedProps, () => {\n updateContainer()\n})\n\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => {\n config.component = c\n updateContainer()\n },\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => {\n config.tooltip = t\n updateContainer()\n },\n destroy: () => { config.tooltip = undefined },\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n \"data-vis-single-container\": \"\",\n ref_key: \"elRef\",\n ref: elRef,\n class: \"unovis-single-container\"\n }, [\n _renderSlot(_ctx.$slots, \"default\")\n ], 512))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","props","data","toRefs","instance","getCurrentInstance","parsedProps","computed","parseProps","chart","ref","config","elRef","updateContainer","initChart","_a","SingleContainer","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","_ctx","_cache","_openBlock","_createElementBlock","_renderSlot"],"mappings":"oIAS4BA,EAAiBC,kBAAA,CAC3C,OAAQ,QACR,MAAO,CACL,UAAW,CAAC,EACZ,QAAS,CAAC,EACV,SAAU,CAAC,EACX,OAAQ,CAAC,EACT,QAAS,CAAC,EACV,OAAQ,CAAC,EACT,MAAO,CAAC,EACR,OAAQ,CAAC,EACT,QAAS,CAAC,EACV,UAAW,CAAC,EACZ,KAAM,CAAC,CACT,EACA,MAAMC,EAAc,CAEtB,MAAMC,EAAQD,EAGR,CAAE,KAAAE,CAAA,EAASC,EAAA,OAAOF,CAAK,EACvBG,EAAWC,EAAAA,qBACXC,EAAcC,EAAAA,SAAS,IAAMC,EAAW,WAAAP,EAAOG,CAAQ,CAAC,EAExDK,EAAQC,EAAAA,MACRC,EAA4C,CAChD,UAAW,OACX,QAAS,MAAA,EAELC,EAAQF,EAAAA,MAERG,EAAkB,IAAM,OAClBC,KACJC,EAAAN,EAAA,QAAA,MAAAM,EAAO,gBAAgB,CAAE,GAAGT,EAAY,MAAO,GAAGK,GAAQ,EAG5DG,EAAY,IAAM,CAClBL,EAAM,OACNG,EAAM,OAASD,EAAO,WAAaT,EAAK,QAC1CO,EAAM,MAAQ,IAAIO,kBAAgBJ,EAAM,MAAOD,EAAQT,EAAK,KAAK,EAAA,EAGrEe,OAAAA,EAAA,MAAMf,EAAM,IAAM,CACZO,EAAM,OACRA,EAAM,MAAM,QAAQP,EAAK,MAAO,EAAI,EACpBW,KAENC,GACZ,CACD,EACDG,EAAA,MAAMX,EAAa,IAAM,CACPO,GAAA,CACjB,EAEDK,EAAAA,YAAY,IAAA,OAAM,OAAAH,EAAAN,EAAM,QAAN,YAAAM,EAAa,UAAS,EAExCI,EAAAA,QAAQC,EAAAA,qBAAsB,CAC5B,KAAAlB,EACA,OAASmB,GAAwB,CAC/BV,EAAO,UAAYU,EACHR,GAClB,EACA,QAAS,IAAMF,EAAO,UAAY,MAAA,CACnC,EAEDQ,EAAAA,QAAQG,EAAAA,mBAAoB,CAC1B,KAAApB,EACA,OAAS,GAAe,CACtBS,EAAO,QAAU,EACDE,GAClB,EACA,QAAS,IAAM,CAAEF,EAAO,QAAU,MAAU,CAAA,CAC7C,EAEM,CAACY,EAAUC,KACRC,EAAA,UAAA,EAAcC,EAAA,mBAAoB,MAAO,CAC/C,4BAA6B,GAC7B,QAAS,QACT,IAAKd,EACL,MAAO,yBAAA,EACN,CACDe,aAAYJ,EAAK,OAAQ,SAAS,GACjC,GAAG,EAER,CAEA,CAAC"}
@@ -1,9 +1,9 @@
1
- import { defineComponent as v, toRefs as f, getCurrentInstance as g, computed as h, ref as p, watch as l, onUnmounted as y, provide as u, openBlock as C, createElementBlock as _, renderSlot as k } from "vue";
1
+ import { defineComponent as v, toRefs as f, getCurrentInstance as g, computed as h, ref as p, watch as l, onUnmounted as y, provide as d, openBlock as C, createElementBlock as _, renderSlot as k } from "vue";
2
2
  import { SingleContainer as w } from "@unovis/ts";
3
- import { componentAccessorKey as R, tooltipAccessorKey as A } from "../../utils/context.js";
4
- import { parseProps as B } from "../../utils/props.js";
5
- const x = /* @__PURE__ */ v({
6
- __name: "single-container",
3
+ import { componentAccessorKey as R, tooltipAccessorKey as x } from "../../utils/context.js";
4
+ import { parseProps as A } from "../../utils/props.js";
5
+ const b = /* @__PURE__ */ v({
6
+ __name: "index",
7
7
  props: {
8
8
  component: {},
9
9
  tooltip: {},
@@ -17,8 +17,8 @@ const x = /* @__PURE__ */ v({
17
17
  ariaLabel: {},
18
18
  data: {}
19
19
  },
20
- setup(d) {
21
- const i = d, { data: t } = f(i), m = g(), s = h(() => B(i, m)), n = p(), o = {
20
+ setup(u) {
21
+ const i = u, { data: t } = f(i), m = g(), s = h(() => A(i, m)), n = p(), o = {
22
22
  component: void 0,
23
23
  tooltip: void 0
24
24
  }, r = p(), a = () => {
@@ -34,13 +34,13 @@ const x = /* @__PURE__ */ v({
34
34
  }), y(() => {
35
35
  var e;
36
36
  return (e = n.value) == null ? void 0 : e.destroy();
37
- }), u(R, {
37
+ }), d(R, {
38
38
  data: t,
39
39
  update: (e) => {
40
40
  o.component = e, a();
41
41
  },
42
42
  destroy: () => o.component = void 0
43
- }), u(A, {
43
+ }), d(x, {
44
44
  data: t,
45
45
  update: (e) => {
46
46
  o.tooltip = e, a();
@@ -48,7 +48,7 @@ const x = /* @__PURE__ */ v({
48
48
  destroy: () => {
49
49
  o.tooltip = void 0;
50
50
  }
51
- }), (e, D) => (C(), _("div", {
51
+ }), (e, B) => (C(), _("div", {
52
52
  "data-vis-single-container": "",
53
53
  ref_key: "elRef",
54
54
  ref: r,
@@ -59,6 +59,6 @@ const x = /* @__PURE__ */ v({
59
59
  }
60
60
  });
61
61
  export {
62
- x as default
62
+ b as default
63
63
  };
64
- //# sourceMappingURL=single-container.js.map
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/containers/single-container/index.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, getCurrentInstance, computed } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey } from \"../../utils/context\"\nimport { parseProps } from \"../../utils/props\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n component: {},\n tooltip: {},\n duration: {},\n margin: {},\n padding: {},\n sizing: {},\n width: {},\n height: {},\n svgDefs: {},\n ariaLabel: {},\n data: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\nconst { data } = toRefs(props)\nconst instance = getCurrentInstance()\nconst parsedProps = computed(() => parseProps(props, instance))\n\nconst chart = ref<SingleContainer<T> | undefined>()\nconst config: SingleContainerConfigInterface<T> = {\n component: undefined,\n tooltip: undefined,\n}\nconst elRef = ref<HTMLDivElement>()\n\nconst updateContainer = () => {\n initChart()\n chart.value?.updateContainer({ ...parsedProps.value, ...config })\n}\n\nconst initChart = () => {\n if (chart.value) return\n if (elRef.value && config.component && data.value)\n chart.value = new SingleContainer(elRef.value, config, data.value)\n}\n\nwatch(data, () => {\n if (chart.value) {\n chart.value.setData(data.value, true)\n updateContainer()\n } else {\n initChart()\n }\n})\nwatch(parsedProps, () => {\n updateContainer()\n})\n\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => {\n config.component = c\n updateContainer()\n },\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => {\n config.tooltip = t\n updateContainer()\n },\n destroy: () => { config.tooltip = undefined },\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n \"data-vis-single-container\": \"\",\n ref_key: \"elRef\",\n ref: elRef,\n class: \"unovis-single-container\"\n }, [\n _renderSlot(_ctx.$slots, \"default\")\n ], 512))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","props","data","toRefs","instance","getCurrentInstance","parsedProps","computed","parseProps","chart","ref","config","elRef","updateContainer","initChart","_a","SingleContainer","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","t","_ctx","_cache","_openBlock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QAAAV,EAAO,YAAYU,GACHR;MAClB;AAAA,MACA,SAAS,MAAMF,EAAO,YAAY;AAAA,IAAA,CACnC,GAEDQ,EAAQG,GAAoB;AAAA,MAC1B,MAAApB;AAAA,MACA,QAAQ,CAACqB,MAAe;AACtB,QAAAZ,EAAO,UAAUY,GACDV;MAClB;AAAA,MACA,SAAS,MAAM;AAAE,QAAAF,EAAO,UAAU;AAAA,MAAU;AAAA,IAAA,CAC7C,GAEM,CAACa,GAAUC,OACRC,EAAA,GAAcC,EAAoB,OAAO;AAAA,MAC/C,6BAA6B;AAAA,MAC7B,SAAS;AAAA,MACT,KAAKf;AAAA,MACL,OAAO;AAAA,IAAA,GACN;AAAA,MACDgB,EAAYJ,EAAK,QAAQ,SAAS;AAAA,OACjC,GAAG;AAAA,EAER;AAEA,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e="";module.exports=e;
2
+ //# sourceMappingURL=index2.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ const e = "";
2
+ export {
3
+ e as default
4
+ };
5
+ //# sourceMappingURL=index2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("./index.cjs");require("./index2.cjs");module.exports=e;
2
+ //# sourceMappingURL=index3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index3.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import o from "./index.js";
2
+ import "./index2.js";
3
+ export {
4
+ o as default
5
+ };
6
+ //# sourceMappingURL=index3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const o=require("vue"),y=require("@unovis/ts"),i=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},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(u){const c=u,{data:n}=o.toRefs(c),l=o.getCurrentInstance(),p=o.computed(()=>v.parseProps(c,l)),a=o.ref(),t={components:[],crosshair:void 0,tooltip:void 0,xAxis:void 0,yAxis:void 0},r=o.ref(),s=()=>{var e;(e=a.value)==null||e.updateContainer({...p.value,...t})};return o.watch(n,()=>{a.value&&(a.value.setData(n.value,!0),s())}),o.watch(p,()=>{s()}),o.onMounted(()=>{r.value&&(a.value=new y.XYContainer(r.value,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],s()},destroy:()=>{var e;return t.components=(e=t.components)==null?void 0:e.filter(d=>!d.isDestroyed())}}),o.provide(i.axisAccessorKey,{data:n,update:e=>{t[`${e.config.type}Axis`]=e,s()},destroy:e=>{t[`${e}Axis`]=void 0}}),o.provide(i.crosshairAccessorKey,{data:n,update:e=>{t.crosshair=e,s()},destroy:()=>{t.crosshair=void 0}}),o.provide(i.tooltipAccessorKey,{data:n,update:e=>{t.tooltip=e,s()},destroy:()=>{t.tooltip=void 0}}),(e,d)=>(o.openBlock(),o.createElementBlock("div",{"data-vis-xy-container":"",ref_key:"elRef",ref:r,class:"unovis-xy-container"},[o.renderSlot(e.$slots,"default")],512))}});module.exports=m;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/containers/xy-container/index.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { XYContainer, XYComponentCore, XYContainerConfigInterface, Tooltip, Crosshair, Axis } from '@unovis/ts'\nimport { onMounted, onUnmounted, ref, provide, watch, toRefs, getCurrentInstance, computed } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey, axisAccessorKey, crosshairAccessorKey } from \"../../utils/context\"\nimport { parseProps } from \"../../utils/props\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n components: {},\n xScale: { type: [Object, Function] },\n xDomain: {},\n xDomainMinConstraint: {},\n xDomainMaxConstraint: {},\n xRange: {},\n yScale: { type: [Object, Function] },\n yDomain: {},\n yDomainMinConstraint: {},\n yDomainMaxConstraint: {},\n yRange: {},\n yDirection: {},\n xAxis: {},\n yAxis: {},\n autoMargin: { type: Boolean },\n tooltip: {},\n crosshair: {},\n preventEmptyDomain: { type: [Boolean, null] },\n scaleByDomain: { type: Boolean },\n duration: {},\n margin: {},\n padding: {},\n sizing: {},\n width: {},\n height: {},\n svgDefs: {},\n ariaLabel: {},\n data: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\nconst { data } = toRefs(props)\nconst instance = getCurrentInstance()\nconst parsedProps = computed(() => parseProps(props, instance))\n\nconst chart = ref<XYContainer<T> | undefined>()\nconst config: XYContainerConfigInterface<T> = {\n components: [],\n crosshair: undefined,\n tooltip: undefined,\n xAxis: undefined,\n yAxis: undefined,\n}\nconst elRef = ref<HTMLDivElement>()\n\nconst updateContainer = () => {\n chart.value?.updateContainer({ ...parsedProps.value, ...config })\n}\n\nwatch(data, () => {\n if (chart.value) {\n chart.value.setData(data.value, true)\n updateContainer()\n }\n})\nwatch(parsedProps, () => {\n updateContainer()\n})\n\nonMounted(() => {\n if (elRef.value) chart.value = new XYContainer(elRef.value, config, data.value)\n})\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: XYComponentCore<T>) => {\n config.components = [...config.components!, c]\n updateContainer()\n },\n destroy: () => config.components = config.components?.filter(c => !c.isDestroyed()),\n})\n\nprovide(axisAccessorKey, {\n data,\n update: (c: Axis<T>) => {\n config[`${c.config.type}Axis`] = c\n updateContainer()\n },\n destroy: (c) => { config[`${c}Axis`] = undefined },\n})\n\nprovide(crosshairAccessorKey, {\n data,\n update: (c: Crosshair<T>) => {\n config.crosshair = c\n updateContainer()\n },\n destroy: () => { config.crosshair = undefined },\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => {\n config.tooltip = t\n updateContainer()\n },\n destroy: () => { config.tooltip = undefined },\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n \"data-vis-xy-container\": \"\",\n ref_key: \"elRef\",\n ref: elRef,\n class: \"unovis-xy-container\"\n }, [\n _renderSlot(_ctx.$slots, \"default\")\n ], 512))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","props","data","toRefs","instance","getCurrentInstance","parsedProps","computed","parseProps","chart","ref","config","elRef","updateContainer","_a","watch","onMounted","XYContainer","onUnmounted","provide","componentAccessorKey","c","axisAccessorKey","crosshairAccessorKey","tooltipAccessorKey","t","_ctx","_cache","_openBlock","_createElementBlock","_renderSlot"],"mappings":"oIAS4BA,EAAiBC,kBAAA,CAC3C,OAAQ,QACR,MAAO,CACL,WAAY,CAAC,EACb,OAAQ,CAAE,KAAM,CAAC,OAAQ,QAAQ,CAAE,EACnC,QAAS,CAAC,EACV,qBAAsB,CAAC,EACvB,qBAAsB,CAAC,EACvB,OAAQ,CAAC,EACT,OAAQ,CAAE,KAAM,CAAC,OAAQ,QAAQ,CAAE,EACnC,QAAS,CAAC,EACV,qBAAsB,CAAC,EACvB,qBAAsB,CAAC,EACvB,OAAQ,CAAC,EACT,WAAY,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A,EAAO,WAAaU,CAAC,EAC7BR,GAClB,EACA,QAAS,IAAM,OAAA,OAAAF,EAAO,YAAaG,EAAAH,EAAO,aAAP,YAAAG,EAAmB,OAAYO,GAAA,CAACA,EAAE,YAAA,GAAa,CACnF,EAEDF,EAAAA,QAAQG,EAAAA,gBAAiB,CACvB,KAAApB,EACA,OAASmB,GAAe,CACtBV,EAAO,GAAGU,EAAE,OAAO,IAAI,MAAM,EAAIA,EACjBR,GAClB,EACA,QAAUQ,GAAM,CAASV,EAAA,GAAGU,CAAC,MAAM,EAAI,MAAU,CAAA,CAClD,EAEDF,EAAAA,QAAQI,EAAAA,qBAAsB,CAC5B,KAAArB,EACA,OAASmB,GAAoB,CAC3BV,EAAO,UAAYU,EACHR,GAClB,EACA,QAAS,IAAM,CAAEF,EAAO,UAAY,MAAU,CAAA,CAC/C,EAEDQ,EAAAA,QAAQK,EAAAA,mBAAoB,CAC1B,KAAAtB,EACA,OAASuB,GAAe,CACtBd,EAAO,QAAUc,EACDZ,GAClB,EACA,QAAS,IAAM,CAAEF,EAAO,QAAU,MAAU,CAAA,CAC7C,EAEM,CAACe,EAAUC,KACRC,EAAA,UAAA,EAAcC,EAAA,mBAAoB,MAAO,CAC/C,wBAAyB,GACzB,QAAS,QACT,IAAKjB,EACL,MAAO,qBAAA,EACN,CACDkB,aAAYJ,EAAK,OAAQ,SAAS,GACjC,GAAG,EAER,CAEA,CAAC"}
@@ -3,7 +3,7 @@ import { XYContainer as B } from "@unovis/ts";
3
3
  import { componentAccessorKey as M, axisAccessorKey as _, crosshairAccessorKey as R, tooltipAccessorKey as K } from "../../utils/context.js";
4
4
  import { parseProps as b } from "../../utils/props.js";
5
5
  const j = /* @__PURE__ */ y({
6
- __name: "xy-container",
6
+ __name: "index",
7
7
  props: {
8
8
  components: {},
9
9
  xScale: { type: [Object, Function] },
@@ -100,4 +100,4 @@ const j = /* @__PURE__ */ y({
100
100
  export {
101
101
  j as default
102
102
  };
103
- //# sourceMappingURL=xy-container.js.map
103
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/containers/xy-container/index.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { XYContainer, XYComponentCore, XYContainerConfigInterface, Tooltip, Crosshair, Axis } from '@unovis/ts'\nimport { onMounted, onUnmounted, ref, provide, watch, toRefs, getCurrentInstance, computed } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey, axisAccessorKey, crosshairAccessorKey } from \"../../utils/context\"\nimport { parseProps } from \"../../utils/props\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n components: {},\n xScale: { type: [Object, Function] },\n xDomain: {},\n xDomainMinConstraint: {},\n xDomainMaxConstraint: {},\n xRange: {},\n yScale: { type: [Object, Function] },\n yDomain: {},\n yDomainMinConstraint: {},\n yDomainMaxConstraint: {},\n yRange: {},\n yDirection: {},\n xAxis: {},\n yAxis: {},\n autoMargin: { type: Boolean },\n tooltip: {},\n crosshair: {},\n preventEmptyDomain: { type: [Boolean, null] },\n scaleByDomain: { type: Boolean },\n duration: {},\n margin: {},\n padding: {},\n sizing: {},\n width: {},\n height: {},\n svgDefs: {},\n ariaLabel: {},\n data: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\nconst { data } = toRefs(props)\nconst instance = getCurrentInstance()\nconst parsedProps = computed(() => parseProps(props, instance))\n\nconst chart = ref<XYContainer<T> | undefined>()\nconst config: XYContainerConfigInterface<T> = {\n components: [],\n crosshair: undefined,\n tooltip: undefined,\n xAxis: undefined,\n yAxis: undefined,\n}\nconst elRef = ref<HTMLDivElement>()\n\nconst updateContainer = () => {\n chart.value?.updateContainer({ ...parsedProps.value, ...config })\n}\n\nwatch(data, () => {\n if (chart.value) {\n chart.value.setData(data.value, true)\n updateContainer()\n }\n})\nwatch(parsedProps, () => {\n updateContainer()\n})\n\nonMounted(() => {\n if (elRef.value) chart.value = new XYContainer(elRef.value, config, data.value)\n})\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: XYComponentCore<T>) => {\n config.components = [...config.components!, c]\n updateContainer()\n },\n destroy: () => config.components = config.components?.filter(c => !c.isDestroyed()),\n})\n\nprovide(axisAccessorKey, {\n data,\n update: (c: Axis<T>) => {\n config[`${c.config.type}Axis`] = c\n updateContainer()\n },\n destroy: (c) => { config[`${c}Axis`] = undefined },\n})\n\nprovide(crosshairAccessorKey, {\n data,\n update: (c: Crosshair<T>) => {\n config.crosshair = c\n updateContainer()\n },\n destroy: () => { config.crosshair = undefined },\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => {\n config.tooltip = t\n updateContainer()\n },\n destroy: () => { config.tooltip = undefined },\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n \"data-vis-xy-container\": \"\",\n ref_key: \"elRef\",\n ref: elRef,\n class: \"unovis-xy-container\"\n }, [\n _renderSlot(_ctx.$slots, \"default\")\n ], 512))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","props","data","toRefs","instance","getCurrentInstance","parsedProps","computed","parseProps","chart","ref","config","elRef","updateContainer","_a","watch","onMounted","XYContainer","onUnmounted","provide","componentAccessorKey","c","axisAccessorKey","crosshairAccessorKey","tooltipAccessorKey","t","_ctx","_cache","_openBlock","_createElementBlock","_renderSlot"],"mappings":";;;;AASA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,YAAY,CAAC;AAAA,IACb,QAAQ,EAAE,MAAM,CAAC,QAAQ,QAAQ,EAAE;AAAA,IACnC,SAAS,CAAC;AAAA,IACV,sBAAsB,CAAC;AAAA,IACvB,sBAAsB,CAAC;AAAA,IACvB,QAAQ,CAAC;AAAA,IACT,QAAQ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AAA,IAAA,GACN;AAAA,MACDkB,EAAYJ,EAAK,QAAQ,SAAS;AAAA,OACjC,GAAG;AAAA,EAER;AAEA,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e="";module.exports=e;
2
+ //# sourceMappingURL=index2.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ const e = "";
2
+ export {
3
+ e as default
4
+ };
5
+ //# sourceMappingURL=index2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("./index.cjs");require("./index2.cjs");module.exports=e;
2
+ //# sourceMappingURL=index3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index3.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import o from "./index.js";
2
+ import "./index2.js";
3
+ export {
4
+ o as default
5
+ };
6
+ //# sourceMappingURL=index3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/containers.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { default as VisXYContainer } from "./containers/xy-container/xy-container";
2
- export { default as VisSingleContainer } from "./containers/single-container/single-container";
1
+ export { default as VisXYContainer } from "./containers/xy-container/index";
2
+ export { default as VisSingleContainer } from "./containers/single-container/index";
package/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".unovis-xy-container,.unovis-single-container{display:block;position:relative;width:100%}[data-vis-leaflet-map],[data-vis-leaflet-flow-map]{display:block;position:relative}[data-vis-bullet-legend]{display:block}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./containers/xy-container/xy-container.cjs");require("./containers/xy-container/xy-container2.cjs");const _=require("./containers/single-container/single-container.cjs");require("./containers/single-container/single-container2.cjs");const t=require("./components/line/index.cjs"),u=require("./components/area/index.cjs"),r=require("./components/axis/index.cjs"),i=require("./components/brush/index.cjs"),s=require("./components/free-brush/index.cjs"),n=require("./components/crosshair/index.cjs"),p=require("./components/grouped-bar/index.cjs"),c=require("./components/scatter/index.cjs"),v=require("./components/stacked-bar/index.cjs"),a=require("./components/timeline/index.cjs"),o=require("./components/xy-labels/index.cjs"),l=require("./components/donut/index.cjs"),g=require("./components/topojson-map/index.cjs"),d=require("./components/sankey/index.cjs"),q=require("./components/graph/index.cjs"),y=require("./components/chord-diagram/index.cjs"),x=require("./components/nested-donut/index.cjs"),V=require("./components/tooltip/index.cjs"),$=require("./html-components/leaflet-map/index.cjs");require("./html-components/leaflet-map/index2.cjs");const S=require("./html-components/leaflet-flow-map/index.cjs");require("./html-components/leaflet-flow-map/index2.cjs");const h=require("./html-components/bullet-legend/index.cjs");require("./html-components/bullet-legend/index2.cjs");exports.VisXYContainer=e;exports.VisSingleContainer=_;exports.VisLine=t;exports.VisArea=u;exports.VisAxis=r;exports.VisBrush=i;exports.VisFreeBrush=s;exports.VisCrosshair=n;exports.VisGroupedBar=p;exports.VisScatter=c;exports.VisStackedBar=v;exports.VisTimeline=a;exports.VisXYLabels=o;exports.VisDonut=l;exports.VisTopoJSONMap=g;exports.VisSankey=d;exports.VisGraph=q;exports.VisChordDiagram=y;exports.VisNestedDonut=x;exports.VisTooltip=V;exports.VisLeafletMap=$;exports.VisLeafletFlowMap=S;exports.VisBulletLegend=h;
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".unovis-xy-container,.unovis-single-container{display:block;position:relative;width:100%}[data-vis-leaflet-flow-map],[data-vis-leaflet-map]{display:block;position:relative}[data-vis-bullet-legend]{display:block}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./containers/xy-container/index.cjs");require("./containers/xy-container/index2.cjs");const _=require("./containers/single-container/index.cjs");require("./containers/single-container/index2.cjs");const t=require("./components/line/index.cjs"),u=require("./components/area/index.cjs"),r=require("./components/axis/index.cjs"),i=require("./components/brush/index.cjs"),s=require("./components/free-brush/index.cjs"),n=require("./components/crosshair/index.cjs"),p=require("./components/grouped-bar/index.cjs"),c=require("./components/scatter/index.cjs"),v=require("./components/stacked-bar/index.cjs"),a=require("./components/timeline/index.cjs"),o=require("./components/xy-labels/index.cjs"),l=require("./components/donut/index.cjs"),d=require("./components/topojson-map/index.cjs"),g=require("./components/sankey/index.cjs"),q=require("./components/graph/index.cjs"),y=require("./components/chord-diagram/index.cjs"),x=require("./components/nested-donut/index.cjs"),V=require("./components/tooltip/index.cjs"),$=require("./html-components/leaflet-map/index.cjs");require("./html-components/leaflet-map/index2.cjs");const S=require("./html-components/leaflet-flow-map/index.cjs");require("./html-components/leaflet-flow-map/index2.cjs");const h=require("./html-components/bullet-legend/index.cjs");require("./html-components/bullet-legend/index2.cjs");exports.VisXYContainer=e;exports.VisSingleContainer=_;exports.VisLine=t;exports.VisArea=u;exports.VisAxis=r;exports.VisBrush=i;exports.VisFreeBrush=s;exports.VisCrosshair=n;exports.VisGroupedBar=p;exports.VisScatter=c;exports.VisStackedBar=v;exports.VisTimeline=a;exports.VisXYLabels=o;exports.VisDonut=l;exports.VisTopoJSONMap=d;exports.VisSankey=g;exports.VisGraph=q;exports.VisChordDiagram=y;exports.VisNestedDonut=x;exports.VisTooltip=V;exports.VisLeafletMap=$;exports.VisLeafletFlowMap=S;exports.VisBulletLegend=h;
3
3
  //# sourceMappingURL=index.cjs.map
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".unovis-xy-container,.unovis-single-container{display:block;position:relative;width:100%}[data-vis-leaflet-map],[data-vis-leaflet-flow-map]{display:block;position:relative}[data-vis-bullet-legend]{display:block}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { default as i } from "./containers/xy-container/xy-container.js";
3
- import "./containers/xy-container/xy-container2.js";
4
- import { default as l } from "./containers/single-container/single-container.js";
5
- import "./containers/single-container/single-container2.js";
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".unovis-xy-container,.unovis-single-container{display:block;position:relative;width:100%}[data-vis-leaflet-flow-map],[data-vis-leaflet-map]{display:block;position:relative}[data-vis-bullet-legend]{display:block}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ import { default as i } from "./containers/xy-container/index.js";
3
+ import "./containers/xy-container/index2.js";
4
+ import { default as l } from "./containers/single-container/index.js";
5
+ import "./containers/single-container/index2.js";
6
6
  import { default as u } from "./components/line/index.js";
7
7
  import { default as x } from "./components/area/index.js";
8
8
  import { default as n } from "./components/axis/index.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unovis/vue",
3
3
  "description": "Modular data visualization framework for React, Angular, Svelte, Vue, and vanilla TypeScript or JavaScript",
4
- "version": "1.3.0-alpha.1",
4
+ "version": "1.3.0-alpha.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/f5/unovis.git",
@@ -23,6 +23,18 @@
23
23
  "Nikita Rokotyan <nikita@f5.com> (https://rokotyan.com)",
24
24
  "Rebecca Bol <r.bol@f5.com>"
25
25
  ],
26
+ "exports": {
27
+ ".": {
28
+ "types": "./index.d.ts",
29
+ "require": "./index.cjs",
30
+ "import": "./index.js"
31
+ },
32
+ "./*": {
33
+ "types": "./*/index.d.ts",
34
+ "require": "./*/index.cjs",
35
+ "import": "./*/index.js"
36
+ }
37
+ },
26
38
  "license": "Apache-2.0",
27
39
  "main": "./index.cjs",
28
40
  "module": "./index.js",
@@ -38,7 +50,7 @@
38
50
  "dev": "vite"
39
51
  },
40
52
  "peerDependencies": {
41
- "@unovis/ts": "1.3.0-alpha.1",
53
+ "@unovis/ts": "1.3.0-alpha.2",
42
54
  "vue": "^3"
43
55
  },
44
56
  "devDependencies": {
@@ -1,2 +0,0 @@
1
- "use strict";const e=require("vue"),v=require("@unovis/ts"),u=require("../../utils/context.cjs"),f=require("../../utils/props.cjs"),m=e.defineComponent({__name:"single-container",props:{component:{},tooltip:{},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(l){const i=l,{data:n}=e.toRefs(i),d=e.getCurrentInstance(),c=e.computed(()=>f.parseProps(i,d)),r=e.ref(),o={component:void 0,tooltip:void 0},a=e.ref(),s=()=>{var t;p(),(t=r.value)==null||t.updateContainer({...c.value,...o})},p=()=>{r.value||a.value&&o.component&&n.value&&(r.value=new v.SingleContainer(a.value,o,n.value))};return e.watch(n,()=>{r.value?(r.value.setData(n.value,!0),s()):p()}),e.watch(c,()=>{s()}),e.onUnmounted(()=>{var t;return(t=r.value)==null?void 0:t.destroy()}),e.provide(u.componentAccessorKey,{data:n,update:t=>{o.component=t,s()},destroy:()=>o.component=void 0}),e.provide(u.tooltipAccessorKey,{data:n,update:t=>{o.tooltip=t,s()},destroy:()=>{o.tooltip=void 0}}),(t,g)=>(e.openBlock(),e.createElementBlock("div",{"data-vis-single-container":"",ref_key:"elRef",ref:a,class:"unovis-single-container"},[e.renderSlot(t.$slots,"default")],512))}});module.exports=m;
2
- //# sourceMappingURL=single-container.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-container.cjs","sources":["../../../src/containers/single-container/single-container.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, getCurrentInstance, computed } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey } from \"../../utils/context\"\nimport { parseProps } from \"../../utils/props\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'single-container',\n props: {\n component: {},\n tooltip: {},\n duration: {},\n margin: {},\n padding: {},\n sizing: {},\n width: {},\n height: {},\n svgDefs: {},\n ariaLabel: {},\n data: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\nconst { data } = toRefs(props)\nconst instance = getCurrentInstance()\nconst parsedProps = computed(() => parseProps(props, instance))\n\nconst chart = ref<SingleContainer<T> | undefined>()\nconst config: SingleContainerConfigInterface<T> = {\n component: undefined,\n tooltip: undefined,\n}\nconst elRef = ref<HTMLDivElement>()\n\nconst updateContainer = () => {\n initChart()\n chart.value?.updateContainer({ ...parsedProps.value, ...config })\n}\n\nconst initChart = () => {\n if (chart.value) return\n if (elRef.value && config.component && data.value)\n chart.value = new SingleContainer(elRef.value, config, data.value)\n}\n\nwatch(data, () => {\n if (chart.value) {\n chart.value.setData(data.value, true)\n updateContainer()\n } else {\n initChart()\n }\n})\nwatch(parsedProps, () => {\n updateContainer()\n})\n\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => {\n config.component = c\n updateContainer()\n },\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => {\n config.tooltip = t\n updateContainer()\n },\n destroy: () => { config.tooltip = undefined },\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n \"data-vis-single-container\": \"\",\n ref_key: \"elRef\",\n ref: elRef,\n class: \"unovis-single-container\"\n }, [\n _renderSlot(_ctx.$slots, \"default\")\n ], 512))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","props","data","toRefs","instance","getCurrentInstance","parsedProps","computed","parseProps","chart","ref","config","elRef","updateContainer","initChart","_a","SingleContainer","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","_ctx","_cache","_openBlock","_createElementBlock","_renderSlot"],"mappings":"oIAS4BA,EAAiBC,kBAAA,CAC3C,OAAQ,mBACR,MAAO,CACL,UAAW,CAAC,EACZ,QAAS,CAAC,EACV,SAAU,CAAC,EACX,OAAQ,CAAC,EACT,QAAS,CAAC,EACV,OAAQ,CAAC,EACT,MAAO,CAAC,EACR,OAAQ,CAAC,EACT,QAAS,CAAC,EACV,UAAW,CAAC,EACZ,KAAM,CAAC,CACT,EACA,MAAMC,EAAc,CAEtB,MAAMC,EAAQD,EAGR,CAAE,KAAAE,CAAA,EAASC,EAAA,OAAOF,CAAK,EACvBG,EAAWC,EAAAA,qBACXC,EAAcC,EAAAA,SAAS,IAAMC,EAAW,WAAAP,EAAOG,CAAQ,CAAC,EAExDK,EAAQC,EAAAA,MACRC,EAA4C,CAChD,UAAW,OACX,QAAS,MAAA,EAELC,EAAQF,EAAAA,MAERG,EAAkB,IAAM,OAClBC,KACJC,EAAAN,EAAA,QAAA,MAAAM,EAAO,gBAAgB,CAAE,GAAGT,EAAY,MAAO,GAAGK,GAAQ,EAG5DG,EAAY,IAAM,CAClBL,EAAM,OACNG,EAAM,OAASD,EAAO,WAAaT,EAAK,QAC1CO,EAAM,MAAQ,IAAIO,kBAAgBJ,EAAM,MAAOD,EAAQT,EAAK,KAAK,EAAA,EAGrEe,OAAAA,EAAA,MAAMf,EAAM,IAAM,CACZO,EAAM,OACRA,EAAM,MAAM,QAAQP,EAAK,MAAO,EAAI,EACpBW,KAENC,GACZ,CACD,EACDG,EAAA,MAAMX,EAAa,IAAM,CACPO,GAAA,CACjB,EAEDK,EAAAA,YAAY,IAAA,OAAM,OAAAH,EAAAN,EAAM,QAAN,YAAAM,EAAa,UAAS,EAExCI,EAAAA,QAAQC,EAAAA,qBAAsB,CAC5B,KAAAlB,EACA,OAASmB,GAAwB,CAC/BV,EAAO,UAAYU,EACHR,GAClB,EACA,QAAS,IAAMF,EAAO,UAAY,MAAA,CACnC,EAEDQ,EAAAA,QAAQG,EAAAA,mBAAoB,CAC1B,KAAApB,EACA,OAAS,GAAe,CACtBS,EAAO,QAAU,EACDE,GAClB,EACA,QAAS,IAAM,CAAEF,EAAO,QAAU,MAAU,CAAA,CAC7C,EAEM,CAACY,EAAUC,KACRC,EAAA,UAAA,EAAcC,EAAA,mBAAoB,MAAO,CAC/C,4BAA6B,GAC7B,QAAS,QACT,IAAKd,EACL,MAAO,yBAAA,EACN,CACDe,aAAYJ,EAAK,OAAQ,SAAS,GACjC,GAAG,EAER,CAEA,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-container.js","sources":["../../../src/containers/single-container/single-container.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { SingleContainer, ComponentCore, SingleContainerConfigInterface, Tooltip } from '@unovis/ts'\nimport { onUnmounted, ref, provide, watch, toRefs, getCurrentInstance, computed } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey } from \"../../utils/context\"\nimport { parseProps } from \"../../utils/props\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'single-container',\n props: {\n component: {},\n tooltip: {},\n duration: {},\n margin: {},\n padding: {},\n sizing: {},\n width: {},\n height: {},\n svgDefs: {},\n ariaLabel: {},\n data: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\nconst { data } = toRefs(props)\nconst instance = getCurrentInstance()\nconst parsedProps = computed(() => parseProps(props, instance))\n\nconst chart = ref<SingleContainer<T> | undefined>()\nconst config: SingleContainerConfigInterface<T> = {\n component: undefined,\n tooltip: undefined,\n}\nconst elRef = ref<HTMLDivElement>()\n\nconst updateContainer = () => {\n initChart()\n chart.value?.updateContainer({ ...parsedProps.value, ...config })\n}\n\nconst initChart = () => {\n if (chart.value) return\n if (elRef.value && config.component && data.value)\n chart.value = new SingleContainer(elRef.value, config, data.value)\n}\n\nwatch(data, () => {\n if (chart.value) {\n chart.value.setData(data.value, true)\n updateContainer()\n } else {\n initChart()\n }\n})\nwatch(parsedProps, () => {\n updateContainer()\n})\n\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: ComponentCore<T>) => {\n config.component = c\n updateContainer()\n },\n destroy: () => config.component = undefined,\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => {\n config.tooltip = t\n updateContainer()\n },\n destroy: () => { config.tooltip = undefined },\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n \"data-vis-single-container\": \"\",\n ref_key: \"elRef\",\n ref: elRef,\n class: \"unovis-single-container\"\n }, [\n _renderSlot(_ctx.$slots, \"default\")\n ], 512))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","props","data","toRefs","instance","getCurrentInstance","parsedProps","computed","parseProps","chart","ref","config","elRef","updateContainer","initChart","_a","SingleContainer","watch","onUnmounted","provide","componentAccessorKey","c","tooltipAccessorKey","t","_ctx","_cache","_openBlock","_createElementBlock","_renderSlot"],"mappings":";;;;AASA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,WAAW,CAAC;AAAA,IACZ,SAAS,CAAC;AAAA,IACV,UAAU,CAAC;AAAA,IACX,QAAQ,CAAC;AAAA,IACT,SAAS,CAAC;AAAA,IACV,QAAQ,CAAC;AAAA,IACT,OAAO,CAAC;AAAA,IACR,QAAQ,CAAC;AAAA,IACT,SAAS,CAAC;AAAA,IACV,WAAW,CAAC;AAAA,IACZ,MAAM,CAAC;AAAA,EACT;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAGR,EAAE,MAAAE,EAAA,IAASC,EAAOF,CAAK,GACvBG,IAAW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C,GAAG;AAAA,EAER;AAEA,CAAC;"}
@@ -1,2 +0,0 @@
1
- "use strict";const e="";module.exports=e;
2
- //# sourceMappingURL=single-container2.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-container2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- const e = "";
2
- export {
3
- e as default
4
- };
5
- //# sourceMappingURL=single-container2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-container2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,2 +0,0 @@
1
- "use strict";const e=require("./single-container.cjs");require("./single-container2.cjs");module.exports=e;
2
- //# sourceMappingURL=single-container3.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-container3.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import o from "./single-container.js";
2
- import "./single-container2.js";
3
- export {
4
- o as default
5
- };
6
- //# sourceMappingURL=single-container3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-container3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,2 +0,0 @@
1
- "use strict";const o=require("vue"),y=require("@unovis/ts"),i=require("../../utils/context.cjs"),v=require("../../utils/props.cjs"),m=o.defineComponent({__name:"xy-container",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},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(u){const c=u,{data:n}=o.toRefs(c),l=o.getCurrentInstance(),p=o.computed(()=>v.parseProps(c,l)),a=o.ref(),t={components:[],crosshair:void 0,tooltip:void 0,xAxis:void 0,yAxis:void 0},r=o.ref(),s=()=>{var e;(e=a.value)==null||e.updateContainer({...p.value,...t})};return o.watch(n,()=>{a.value&&(a.value.setData(n.value,!0),s())}),o.watch(p,()=>{s()}),o.onMounted(()=>{r.value&&(a.value=new y.XYContainer(r.value,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],s()},destroy:()=>{var e;return t.components=(e=t.components)==null?void 0:e.filter(d=>!d.isDestroyed())}}),o.provide(i.axisAccessorKey,{data:n,update:e=>{t[`${e.config.type}Axis`]=e,s()},destroy:e=>{t[`${e}Axis`]=void 0}}),o.provide(i.crosshairAccessorKey,{data:n,update:e=>{t.crosshair=e,s()},destroy:()=>{t.crosshair=void 0}}),o.provide(i.tooltipAccessorKey,{data:n,update:e=>{t.tooltip=e,s()},destroy:()=>{t.tooltip=void 0}}),(e,d)=>(o.openBlock(),o.createElementBlock("div",{"data-vis-xy-container":"",ref_key:"elRef",ref:r,class:"unovis-xy-container"},[o.renderSlot(e.$slots,"default")],512))}});module.exports=m;
2
- //# sourceMappingURL=xy-container.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xy-container.cjs","sources":["../../../src/containers/xy-container/xy-container.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { XYContainer, XYComponentCore, XYContainerConfigInterface, Tooltip, Crosshair, Axis } from '@unovis/ts'\nimport { onMounted, onUnmounted, ref, provide, watch, toRefs, getCurrentInstance, computed } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey, axisAccessorKey, crosshairAccessorKey } from \"../../utils/context\"\nimport { parseProps } from \"../../utils/props\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'xy-container',\n props: {\n components: {},\n xScale: { type: [Object, Function] },\n xDomain: {},\n xDomainMinConstraint: {},\n xDomainMaxConstraint: {},\n xRange: {},\n yScale: { type: [Object, Function] },\n yDomain: {},\n yDomainMinConstraint: {},\n yDomainMaxConstraint: {},\n yRange: {},\n yDirection: {},\n xAxis: {},\n yAxis: {},\n autoMargin: { type: Boolean },\n tooltip: {},\n crosshair: {},\n preventEmptyDomain: { type: [Boolean, null] },\n scaleByDomain: { type: Boolean },\n duration: {},\n margin: {},\n padding: {},\n sizing: {},\n width: {},\n height: {},\n svgDefs: {},\n ariaLabel: {},\n data: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\nconst { data } = toRefs(props)\nconst instance = getCurrentInstance()\nconst parsedProps = computed(() => parseProps(props, instance))\n\nconst chart = ref<XYContainer<T> | undefined>()\nconst config: XYContainerConfigInterface<T> = {\n components: [],\n crosshair: undefined,\n tooltip: undefined,\n xAxis: undefined,\n yAxis: undefined,\n}\nconst elRef = ref<HTMLDivElement>()\n\nconst updateContainer = () => {\n chart.value?.updateContainer({ ...parsedProps.value, ...config })\n}\n\nwatch(data, () => {\n if (chart.value) {\n chart.value.setData(data.value, true)\n updateContainer()\n }\n})\nwatch(parsedProps, () => {\n updateContainer()\n})\n\nonMounted(() => {\n if (elRef.value) chart.value = new XYContainer(elRef.value, config, data.value)\n})\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: XYComponentCore<T>) => {\n config.components = [...config.components!, c]\n updateContainer()\n },\n destroy: () => config.components = config.components?.filter(c => !c.isDestroyed()),\n})\n\nprovide(axisAccessorKey, {\n data,\n update: (c: Axis<T>) => {\n config[`${c.config.type}Axis`] = c\n updateContainer()\n },\n destroy: (c) => { config[`${c}Axis`] = undefined },\n})\n\nprovide(crosshairAccessorKey, {\n data,\n update: (c: Crosshair<T>) => {\n config.crosshair = c\n updateContainer()\n },\n destroy: () => { config.crosshair = undefined },\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => {\n config.tooltip = t\n updateContainer()\n },\n destroy: () => { config.tooltip = undefined },\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n \"data-vis-xy-container\": \"\",\n ref_key: \"elRef\",\n ref: elRef,\n class: \"unovis-xy-container\"\n }, [\n _renderSlot(_ctx.$slots, \"default\")\n ], 512))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","props","data","toRefs","instance","getCurrentInstance","parsedProps","computed","parseProps","chart","ref","config","elRef","updateContainer","_a","watch","onMounted","XYContainer","onUnmounted","provide","componentAccessorKey","c","axisAccessorKey","crosshairAccessorKey","tooltipAccessorKey","t","_ctx","_cache","_openBlock","_createElementBlock","_renderSlot"],"mappings":"oIAS4BA,EAAiBC,kBAAA,CAC3C,OAAQ,eACR,MAAO,CACL,WAAY,CAAC,EACb,OAAQ,CAAE,KAAM,CAAC,OAAQ,QAAQ,CAAE,EACnC,QAAS,CAAC,EACV,qBAAsB,CAAC,EACvB,qBAAsB,CAAC,EACvB,OAAQ,CAAC,EACT,OAAQ,CAAE,KAAM,CAAC,OAAQ,QAAQ,CAAE,EACnC,QAAS,CAAC,EACV,qBAAsB,CAAC,EACvB,qBAAsB,CAAC,EACvB,OAAQ,CAAC,EACT,WAAY,CAAC,EACb,MAAO,CAAC,EACR,MAAO,CAAC,EACR,WAAY,CAAE,KAAM,OAAQ,EAC5B,QAAS,CAAC,EACV,UAAW,CAAC,EACZ,mBAAoB,CAAE,KAAM,CAAC,QAAS,IAAI,CAAE,EAC5C,cAAe,CAAE,KAAM,OAAQ,EAC/B,SAAU,CAAC,EACX,OAAQ,CAAC,EACT,QAAS,CAAC,EACV,OAAQ,CAAC,EACT,MAAO,CAAC,EACR,OAAQ,CAAC,EACT,QAAS,CAAC,EACV,UAAW,CAAC,EACZ,KAAM,CAAC,CACT,EACA,MAAMC,EAAc,CAEtB,MAAMC,EAAQD,EAGR,CAAE,KAAAE,CAAA,EAASC,EAAA,OAAOF,CAAK,EACvBG,EAAW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U,EACHR,GAClB,EACA,QAAS,IAAM,CAAEF,EAAO,UAAY,MAAU,CAAA,CAC/C,EAEDQ,EAAAA,QAAQK,EAAAA,mBAAoB,CAC1B,KAAAtB,EACA,OAASuB,GAAe,CACtBd,EAAO,QAAUc,EACDZ,GAClB,EACA,QAAS,IAAM,CAAEF,EAAO,QAAU,MAAU,CAAA,CAC7C,EAEM,CAACe,EAAUC,KACRC,EAAA,UAAA,EAAcC,EAAA,mBAAoB,MAAO,CAC/C,wBAAyB,GACzB,QAAS,QACT,IAAKjB,EACL,MAAO,qBAAA,EACN,CACDkB,aAAYJ,EAAK,OAAQ,SAAS,GACjC,GAAG,EAER,CAEA,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"xy-container.js","sources":["../../../src/containers/xy-container/xy-container.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { XYContainer, XYComponentCore, XYContainerConfigInterface, Tooltip, Crosshair, Axis } from '@unovis/ts'\nimport { onMounted, onUnmounted, ref, provide, watch, toRefs, getCurrentInstance, computed } from 'vue'\nimport { componentAccessorKey, tooltipAccessorKey, axisAccessorKey, crosshairAccessorKey } from \"../../utils/context\"\nimport { parseProps } from \"../../utils/props\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'xy-container',\n props: {\n components: {},\n xScale: { type: [Object, Function] },\n xDomain: {},\n xDomainMinConstraint: {},\n xDomainMaxConstraint: {},\n xRange: {},\n yScale: { type: [Object, Function] },\n yDomain: {},\n yDomainMinConstraint: {},\n yDomainMaxConstraint: {},\n yRange: {},\n yDirection: {},\n xAxis: {},\n yAxis: {},\n autoMargin: { type: Boolean },\n tooltip: {},\n crosshair: {},\n preventEmptyDomain: { type: [Boolean, null] },\n scaleByDomain: { type: Boolean },\n duration: {},\n margin: {},\n padding: {},\n sizing: {},\n width: {},\n height: {},\n svgDefs: {},\n ariaLabel: {},\n data: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\nconst { data } = toRefs(props)\nconst instance = getCurrentInstance()\nconst parsedProps = computed(() => parseProps(props, instance))\n\nconst chart = ref<XYContainer<T> | undefined>()\nconst config: XYContainerConfigInterface<T> = {\n components: [],\n crosshair: undefined,\n tooltip: undefined,\n xAxis: undefined,\n yAxis: undefined,\n}\nconst elRef = ref<HTMLDivElement>()\n\nconst updateContainer = () => {\n chart.value?.updateContainer({ ...parsedProps.value, ...config })\n}\n\nwatch(data, () => {\n if (chart.value) {\n chart.value.setData(data.value, true)\n updateContainer()\n }\n})\nwatch(parsedProps, () => {\n updateContainer()\n})\n\nonMounted(() => {\n if (elRef.value) chart.value = new XYContainer(elRef.value, config, data.value)\n})\nonUnmounted(() => chart.value?.destroy())\n\nprovide(componentAccessorKey, {\n data,\n update: (c: XYComponentCore<T>) => {\n config.components = [...config.components!, c]\n updateContainer()\n },\n destroy: () => config.components = config.components?.filter(c => !c.isDestroyed()),\n})\n\nprovide(axisAccessorKey, {\n data,\n update: (c: Axis<T>) => {\n config[`${c.config.type}Axis`] = c\n updateContainer()\n },\n destroy: (c) => { config[`${c}Axis`] = undefined },\n})\n\nprovide(crosshairAccessorKey, {\n data,\n update: (c: Crosshair<T>) => {\n config.crosshair = c\n updateContainer()\n },\n destroy: () => { config.crosshair = undefined },\n})\n\nprovide(tooltipAccessorKey, {\n data,\n update: (t: Tooltip) => {\n config.tooltip = t\n updateContainer()\n },\n destroy: () => { config.tooltip = undefined },\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n \"data-vis-xy-container\": \"\",\n ref_key: \"elRef\",\n ref: elRef,\n class: \"unovis-xy-container\"\n }, [\n _renderSlot(_ctx.$slots, \"default\")\n ], 512))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","props","data","toRefs","instance","getCurrentInstance","parsedProps","computed","parseProps","chart","ref","config","elRef","updateContainer","_a","watch","onMounted","XYContainer","onUnmounted","provide","componentAccessorKey","c","axisAccessorKey","crosshairAccessorKey","tooltipAccessorKey","t","_ctx","_cache","_openBlock","_createElementBlock","_renderSlot"],"mappings":";;;;AASA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,YAAY,CAAC;AAAA,IACb,QAAQ,EAAE,MAAM,CAAC,QAAQ,QAAQ,EAAE;AAAA,IACnC,SAAS,CAAC;AAAA,IACV,sBAAsB,CAAC;AAAA,IACvB,sBAAsB,CAAC;AAAA,IACvB,QAAQ,CAAC;AAAA,IACT,QAAQ,EAAE,MAAM,CAAC,QAAQ,QAAQ,EAAE;AAAA,IACnC,SAAS,CAAC;AAAA,IACV,sBAAsB,CAAC;AAAA,IACvB,sBAAsB,CAAC;AAAA,IACvB,QAAQ,CAAC;AAAA,IACT,YAAY,CAAC;AAAA,IACb,OAAO,CAAC;AAAA,IACR,OAAO,CAAC;AAAA,IACR,YAAY,EAAE,MAAM,QAAQ;AAAA,IAC5B,SAAS,CAAC;AAAA,IACV,WAAW,CAAC;AAAA,IACZ,oBAAoB,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE;AAAA,IAC5C,eAAe,EAAE,MAAM,QAAQ;AAAA,IAC/B,UAAU,CAAC;AAAA,IACX,QAAQ,CAAC;AAAA,IACT,SAAS,CAAC;AAAA,IACV,QAAQ,CAAC;AAAA,IACT,OAAO,CAAC;AAAA,IACR,QAAQ,CAAC;AAAA,IACT,SAAS,CAAC;AAAA,IACV,WAAW,CAAC;AAAA,IACZ,MAAM,CAAC;AAAA,EACT;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAGR,EAAE,MAAAE,EAAA,IAASC,EAAOF,CAAK,GACvBG,IAAWC,KACXC,IAAcC,EAAS,MAAMC,EAAWP,GAAOG,CAAQ,CAAC,GAExDK,IAAQC,KACRC,IAAwC;AAAA,MAC5C,YAAY,CAAC;A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B;AAAA,MACA,SAAS,MAAM;AAAE,QAAAF,EAAO,YAAY;AAAA,MAAU;AAAA,IAAA,CAC/C,GAEDQ,EAAQK,GAAoB;AAAA,MAC1B,MAAAtB;AAAA,MACA,QAAQ,CAACuB,MAAe;AACtB,QAAAd,EAAO,UAAUc,GACDZ;MAClB;AAAA,MACA,SAAS,MAAM;AAAE,QAAAF,EAAO,UAAU;AAAA,MAAU;AAAA,IAAA,CAC7C,GAEM,CAACe,GAAUC,OACRC,EAAA,GAAcC,EAAoB,OAAO;AAAA,MAC/C,yBAAyB;AAAA,MACzB,SAAS;AAAA,MACT,KAAKjB;AAAA,MACL,OAAO;AAAA,IAAA,GACN;AAAA,MACDkB,EAAYJ,EAAK,QAAQ,SAAS;AAAA,OACjC,GAAG;AAAA,EAER;AAEA,CAAC;"}
@@ -1,2 +0,0 @@
1
- "use strict";const e="";module.exports=e;
2
- //# sourceMappingURL=xy-container2.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xy-container2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- const e = "";
2
- export {
3
- e as default
4
- };
5
- //# sourceMappingURL=xy-container2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xy-container2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,2 +0,0 @@
1
- "use strict";const e=require("./xy-container.cjs");require("./xy-container2.cjs");module.exports=e;
2
- //# sourceMappingURL=xy-container3.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xy-container3.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import o from "./xy-container.js";
2
- import "./xy-container2.js";
3
- export {
4
- o as default
5
- };
6
- //# sourceMappingURL=xy-container3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xy-container3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}