@unovis/vue 1.6.6-beta.0 → 1.6.6
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.
- package/components/annotations/index.cjs +1 -1
- package/components/annotations/index.cjs.map +1 -1
- package/components/annotations/index.d.ts +1 -1
- package/components/annotations/index.js +18 -20
- package/components/annotations/index.js.map +1 -1
- package/components/area/index.cjs +1 -1
- package/components/area/index.cjs.map +1 -1
- package/components/area/index.d.ts +1 -1
- package/components/area/index.js +21 -25
- package/components/area/index.js.map +1 -1
- package/components/axis/index.cjs +1 -1
- package/components/axis/index.cjs.map +1 -1
- package/components/axis/index.d.ts +1 -1
- package/components/axis/index.js +21 -25
- package/components/axis/index.js.map +1 -1
- package/components/brush/index.cjs +1 -1
- package/components/brush/index.cjs.map +1 -1
- package/components/brush/index.d.ts +1 -1
- package/components/brush/index.js +21 -25
- package/components/brush/index.js.map +1 -1
- package/components/chord-diagram/index.cjs +1 -1
- package/components/chord-diagram/index.cjs.map +1 -1
- package/components/chord-diagram/index.d.ts +1 -1
- package/components/chord-diagram/index.js +21 -25
- package/components/chord-diagram/index.js.map +1 -1
- package/components/crosshair/index.cjs +1 -1
- package/components/crosshair/index.cjs.map +1 -1
- package/components/crosshair/index.d.ts +1 -1
- package/components/crosshair/index.js +21 -25
- package/components/crosshair/index.js.map +1 -1
- package/components/donut/index.cjs +1 -1
- package/components/donut/index.cjs.map +1 -1
- package/components/donut/index.d.ts +1 -1
- package/components/donut/index.js +21 -25
- package/components/donut/index.js.map +1 -1
- package/components/free-brush/index.cjs +1 -1
- package/components/free-brush/index.cjs.map +1 -1
- package/components/free-brush/index.d.ts +1 -1
- package/components/free-brush/index.js +21 -25
- package/components/free-brush/index.js.map +1 -1
- package/components/graph/index.cjs +1 -1
- package/components/graph/index.cjs.map +1 -1
- package/components/graph/index.js +21 -25
- package/components/graph/index.js.map +1 -1
- package/components/grouped-bar/index.cjs +1 -1
- package/components/grouped-bar/index.cjs.map +1 -1
- package/components/grouped-bar/index.d.ts +1 -1
- package/components/grouped-bar/index.js +21 -25
- package/components/grouped-bar/index.js.map +1 -1
- package/components/line/index.cjs +1 -1
- package/components/line/index.cjs.map +1 -1
- package/components/line/index.d.ts +1 -1
- package/components/line/index.js +21 -25
- package/components/line/index.js.map +1 -1
- package/components/nested-donut/index.cjs +1 -1
- package/components/nested-donut/index.cjs.map +1 -1
- package/components/nested-donut/index.d.ts +1 -1
- package/components/nested-donut/index.js +21 -25
- package/components/nested-donut/index.js.map +1 -1
- package/components/plotband/index.cjs +1 -1
- package/components/plotband/index.cjs.map +1 -1
- package/components/plotband/index.d.ts +1 -1
- package/components/plotband/index.js +18 -20
- package/components/plotband/index.js.map +1 -1
- package/components/plotline/index.cjs +1 -1
- package/components/plotline/index.cjs.map +1 -1
- package/components/plotline/index.d.ts +1 -1
- package/components/plotline/index.js +18 -20
- package/components/plotline/index.js.map +1 -1
- package/components/sankey/index.cjs +1 -1
- package/components/sankey/index.cjs.map +1 -1
- package/components/sankey/index.d.ts +1 -1
- package/components/sankey/index.js +21 -25
- package/components/sankey/index.js.map +1 -1
- package/components/scatter/index.cjs +1 -1
- package/components/scatter/index.cjs.map +1 -1
- package/components/scatter/index.d.ts +1 -1
- package/components/scatter/index.js +21 -25
- package/components/scatter/index.js.map +1 -1
- package/components/stacked-bar/index.cjs +1 -1
- package/components/stacked-bar/index.cjs.map +1 -1
- package/components/stacked-bar/index.d.ts +1 -1
- package/components/stacked-bar/index.js +21 -25
- package/components/stacked-bar/index.js.map +1 -1
- package/components/timeline/index.cjs +1 -1
- package/components/timeline/index.cjs.map +1 -1
- package/components/timeline/index.d.ts +1 -1
- package/components/timeline/index.js +21 -25
- package/components/timeline/index.js.map +1 -1
- package/components/tooltip/index.cjs +1 -1
- package/components/tooltip/index.cjs.map +1 -1
- package/components/tooltip/index.d.ts +1 -1
- package/components/tooltip/index.js +18 -20
- package/components/tooltip/index.js.map +1 -1
- package/components/topojson-map/index.cjs +1 -1
- package/components/topojson-map/index.cjs.map +1 -1
- package/components/topojson-map/index.d.ts +1 -1
- package/components/topojson-map/index.js +21 -25
- package/components/topojson-map/index.js.map +1 -1
- package/components/treemap/index.cjs +1 -1
- package/components/treemap/index.cjs.map +1 -1
- package/components/treemap/index.d.ts +1 -1
- package/components/treemap/index.js +21 -25
- package/components/treemap/index.js.map +1 -1
- package/components/xy-labels/index.cjs +1 -1
- package/components/xy-labels/index.cjs.map +1 -1
- package/components/xy-labels/index.d.ts +1 -1
- package/components/xy-labels/index.js +21 -25
- package/components/xy-labels/index.js.map +1 -1
- package/containers/single-container/index.cjs +1 -1
- package/containers/single-container/index.cjs.map +1 -1
- package/containers/single-container/index.js +23 -24
- package/containers/single-container/index.js.map +1 -1
- package/containers/xy-container/index.cjs +1 -1
- package/containers/xy-container/index.cjs.map +1 -1
- package/containers/xy-container/index.js +22 -29
- package/containers/xy-container/index.js.map +1 -1
- package/html-components/bullet-legend/index.cjs +1 -1
- package/html-components/bullet-legend/index.cjs.map +1 -1
- package/html-components/bullet-legend/index.d.ts +1 -1
- package/html-components/bullet-legend/index.js +20 -22
- package/html-components/bullet-legend/index.js.map +1 -1
- package/html-components/flow-legend/index.cjs +1 -1
- package/html-components/flow-legend/index.cjs.map +1 -1
- package/html-components/flow-legend/index.d.ts +1 -1
- package/html-components/flow-legend/index.js +20 -22
- package/html-components/flow-legend/index.js.map +1 -1
- package/html-components/leaflet-flow-map/index.cjs +1 -1
- package/html-components/leaflet-flow-map/index.cjs.map +1 -1
- package/html-components/leaflet-flow-map/index.d.ts +1 -1
- package/html-components/leaflet-flow-map/index.js +21 -24
- package/html-components/leaflet-flow-map/index.js.map +1 -1
- package/html-components/leaflet-map/index.cjs +1 -1
- package/html-components/leaflet-map/index.cjs.map +1 -1
- package/html-components/leaflet-map/index.d.ts +1 -1
- package/html-components/leaflet-map/index.js +21 -24
- package/html-components/leaflet-map/index.js.map +1 -1
- package/html-components/rolling-pin-legend/index.cjs +1 -1
- package/html-components/rolling-pin-legend/index.cjs.map +1 -1
- package/html-components/rolling-pin-legend/index.d.ts +1 -1
- package/html-components/rolling-pin-legend/index.js +20 -22
- package/html-components/rolling-pin-legend/index.js.map +1 -1
- package/package.json +6 -5
- package/utils/context.cjs.map +1 -1
- package/utils/context.js +1 -1
- package/utils/context.js.map +1 -1
- package/utils/props.cjs +1 -1
- package/utils/props.cjs.map +1 -1
- package/utils/props.js +7 -7
- package/utils/props.js.map +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { LeafletMap as
|
|
3
|
-
import { useForwardProps as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as d, computed as y, ref as a, onMounted as m, nextTick as f, onUnmounted as F, watch as r, openBlock as g, createElementBlock as v } from "vue";
|
|
2
|
+
import { LeafletMap as p } from "@unovis/ts";
|
|
3
|
+
import { useForwardProps as S, arePropsEqual as M } from "../../utils/props.js";
|
|
4
|
+
const h = p.selectors, k = /* @__PURE__ */ d({
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
7
7
|
width: {},
|
|
@@ -55,32 +55,29 @@ const C = s.selectors, w = /* @__PURE__ */ m({
|
|
|
55
55
|
attributes: {},
|
|
56
56
|
data: {}
|
|
57
57
|
},
|
|
58
|
-
setup(
|
|
59
|
-
const
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
setup(c, { expose: s }) {
|
|
59
|
+
const i = c, n = y(() => i.data), e = S(i), t = a(), o = a();
|
|
60
|
+
return m(() => {
|
|
61
|
+
f(() => {
|
|
62
|
+
o.value && (t.value = new p(o.value, e.value, n.value));
|
|
63
63
|
});
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}), y({
|
|
74
|
-
component: n
|
|
75
|
-
}), (t, u) => (S(), M("div", {
|
|
64
|
+
}), F(() => {
|
|
65
|
+
t.value?.destroy();
|
|
66
|
+
}), r(e, (l, u) => {
|
|
67
|
+
M(l, u) || (t.value?.setConfig(e.value), t.value?.render());
|
|
68
|
+
}), r(n, () => {
|
|
69
|
+
t.value?.setData(n.value);
|
|
70
|
+
}), s({
|
|
71
|
+
component: t
|
|
72
|
+
}), (l, u) => (g(), v("div", {
|
|
76
73
|
"data-vis-leaflet-map": "",
|
|
77
74
|
ref_key: "elRef",
|
|
78
|
-
ref:
|
|
75
|
+
ref: o
|
|
79
76
|
}, null, 512));
|
|
80
77
|
}
|
|
81
78
|
});
|
|
82
79
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
h as VisLeafletMapSelectors,
|
|
81
|
+
k as default
|
|
85
82
|
};
|
|
86
83
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/html-components/leaflet-map/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum extends GenericDataRecord\">\n// !!! This code was automatically generated. You should not change it !!!\nimport { LeafletMap, LeafletMapConfigInterface, GenericDataRecord, MapLibreStyleSpecs } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\n\n\n// data and required props \ntype Props = LeafletMapConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<LeafletMap<Datum>>()\nconst elRef = ref<HTMLDivElement>()\n\nonMounted(() => {\n nextTick(() => {\n if(elRef.value)\n component.value = new LeafletMap<Datum>(elRef.value, config.value, data.value)\n \n \n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n \n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\n component.value?.render()\n }\n})\n\nwatch(data, () => {\n component.value?.setData(data.value)\n})\n\ndefineExpose({\n component\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisLeafletMapSelectors = LeafletMap.selectors\n</script>\n\n<template>\n <div data-vis-leaflet-map ref=\"elRef\"/>\n</template>\n\n\n<style>\n [data-vis-leaflet-map] {\n display:block;\n position:relative;\n }\n</style>\n"],"names":["VisLeafletMapSelectors","LeafletMap","props","__props","data","computed","config","useForwardProps","component","ref","elRef","onMounted","nextTick","onUnmounted","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/html-components/leaflet-map/index.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Datum extends GenericDataRecord\">\n// !!! This code was automatically generated. You should not change it !!!\nimport { LeafletMap, LeafletMapConfigInterface, GenericDataRecord, MapLibreStyleSpecs } from '@unovis/ts'\nimport { onMounted, onUnmounted, computed, ref, watch, nextTick } from 'vue'\nimport { arePropsEqual, useForwardProps } from '../../utils/props'\n\n\n// data and required props \ntype Props = LeafletMapConfigInterface<Datum>\nconst props = defineProps<Props & { data?: Datum[] }>()\n\nconst data = computed(() => props.data)\n// config\nconst config = useForwardProps(props)\n\n// component declaration\nconst component = ref<LeafletMap<Datum>>()\nconst elRef = ref<HTMLDivElement>()\n\nonMounted(() => {\n nextTick(() => {\n if(elRef.value)\n component.value = new LeafletMap<Datum>(elRef.value, config.value, data.value)\n \n \n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n \n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\n component.value?.render()\n }\n})\n\nwatch(data, () => {\n component.value?.setData(data.value)\n})\n\ndefineExpose({\n component\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisLeafletMapSelectors = LeafletMap.selectors\n</script>\n\n<template>\n <div data-vis-leaflet-map ref=\"elRef\"/>\n</template>\n\n\n<style>\n [data-vis-leaflet-map] {\n display:block;\n position:relative;\n }\n</style>\n"],"names":["VisLeafletMapSelectors","LeafletMap","props","__props","data","computed","config","useForwardProps","component","ref","elRef","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_createElementBlock"],"mappings":";;;AAkDO,MAAMA,IAAyBC,EAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAzCjD,UAAMC,IAAQC,GAERC,IAAOC,EAAS,MAAMH,EAAM,IAAI,GAEhCI,IAASC,EAAgBL,CAAK,GAG9BM,IAAYC,EAAA,GACZC,IAAQD,EAAA;AAEd,WAAAE,EAAU,MAAM;AACd,MAAAC,EAAS,MAAM;AACb,QAAGF,EAAM,UACTF,EAAU,QAAQ,IAAIP,EAAkBS,EAAM,OAAOJ,EAAO,OAAOF,EAAK,KAAK;AAAA,MAG/E,CAAC;AAAA,IACH,CAAC,GAEDS,EAAY,MAAM;AAChB,MAAAL,EAAU,OAAO,QAAA;AAAA,IAEnB,CAAC,GAEDM,EAAMR,GAAQ,CAACS,GAAMC,MAAS;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MAC3BR,EAAU,OAAO,UAAUF,EAAO,KAAK,GACvCE,EAAU,OAAO,OAAA;AAAA,IAErB,CAAC,GAEDM,EAAMV,GAAM,MAAM;AAChB,MAAAI,EAAU,OAAO,QAAQJ,EAAK,KAAK;AAAA,IACrC,CAAC,GAEDc,EAAa;AAAA,MACX,WAAAV;AAAA,IAAA,CACD,mBAQCW,EAAuC,OAAA;AAAA,MAAlC,wBAAA;AAAA,eAAyB;AAAA,MAAJ,KAAIT;AAAA,IAAA;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
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"),d=i.RollingPinLegend.selectors,p=e.defineComponent({__name:"index",props:{rects:{},leftLabelText:{},rightLabelText:{},labelClassName:{},labelFontSize:{},renderIntoProvidedDomNode:{type:Boolean},data:{}},setup(u,{expose:c}){const l=u;e.computed(()=>l.data);const o=a.useForwardProps(l),n=e.ref(),t=e.ref();return e.onMounted(()=>{e.nextTick(()=>{t.value&&(n.value=new i.RollingPinLegend(t.value,o.value))})}),e.onUnmounted(()=>{n.value?.destroy()}),e.watch(o,(r,s)=>{a.arePropsEqual(r,s)||(n.value?.setConfig(o.value),n.value?.render())}),c({component:n}),(r,s)=>(e.openBlock(),e.createElementBlock("div",{"data-vis-rolling-pin-legend":"",ref_key:"elRef",ref:t},null,512))}});exports.VisRollingPinLegendSelectors=d;exports.default=p;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/html-components/rolling-pin-legend/index.vue"],"sourcesContent":["<script setup lang=\"ts\" >\n// !!! This code was automatically generated. You should not change it !!!\nimport { RollingPinLegend, RollingPinLegendConfigInterface, RollingPinLegendItem } 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 = RollingPinLegendConfigInterface\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<RollingPinLegend>()\nconst elRef = ref<HTMLDivElement>()\n\nonMounted(() => {\n nextTick(() => {\n if(elRef.value)\n component.value = new RollingPinLegend(elRef.value, config.value)\n \n \n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n \n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\n component.value?.render()\n }\n})\n\n\ndefineExpose({\n component\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisRollingPinLegendSelectors = RollingPinLegend.selectors\n</script>\n\n<template>\n <div data-vis-rolling-pin-legend ref=\"elRef\"/>\n</template>\n\n\n<style>\n [data-vis-rolling-pin-legend] {\n display:block;\n }\n</style>\n"],"names":["VisRollingPinLegendSelectors","RollingPinLegend","props","__props","computed","config","useForwardProps","component","ref","elRef","onMounted","nextTick","onUnmounted","
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/html-components/rolling-pin-legend/index.vue"],"sourcesContent":["<script setup lang=\"ts\" >\n// !!! This code was automatically generated. You should not change it !!!\nimport { RollingPinLegend, RollingPinLegendConfigInterface, RollingPinLegendItem } 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 = RollingPinLegendConfigInterface\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<RollingPinLegend>()\nconst elRef = ref<HTMLDivElement>()\n\nonMounted(() => {\n nextTick(() => {\n if(elRef.value)\n component.value = new RollingPinLegend(elRef.value, config.value)\n \n \n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n \n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\n component.value?.render()\n }\n})\n\n\ndefineExpose({\n component\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisRollingPinLegendSelectors = RollingPinLegend.selectors\n</script>\n\n<template>\n <div data-vis-rolling-pin-legend ref=\"elRef\"/>\n</template>\n\n\n<style>\n [data-vis-rolling-pin-legend] {\n display:block;\n }\n</style>\n"],"names":["VisRollingPinLegendSelectors","RollingPinLegend","props","__props","computed","config","useForwardProps","component","ref","elRef","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_createElementBlock"],"mappings":"8LA+CaA,EAA+BC,EAAAA,iBAAiB,0MAtC7D,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,iBAAiBQ,EAAM,MAAOJ,EAAO,KAAK,EAGlE,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,mBAA8C,MAAA,CAAzC,8BAAA,WAAgC,QAAJ,IAAIT,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RollingPinLegend, RollingPinLegendConfigInterface } from '@unovis/ts';
|
|
2
2
|
|
|
3
|
-
export declare const VisRollingPinLegendSelectors: typeof import("@unovis/ts/
|
|
3
|
+
export declare const VisRollingPinLegendSelectors: typeof import("@unovis/ts/components/rolling-pin-legend/style");
|
|
4
4
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<RollingPinLegendConfigInterface & {
|
|
5
5
|
data?: null;
|
|
6
6
|
}>>, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { RollingPinLegend as
|
|
3
|
-
import { useForwardProps as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as d, computed as p, ref as a, onMounted as u, nextTick as f, onUnmounted as m, watch as v, openBlock as g, createElementBlock as x } from "vue";
|
|
2
|
+
import { RollingPinLegend as s } from "@unovis/ts";
|
|
3
|
+
import { useForwardProps as _, arePropsEqual as P } from "../../utils/props.js";
|
|
4
|
+
const R = s.selectors, h = /* @__PURE__ */ d({
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
7
7
|
rects: {},
|
|
@@ -12,31 +12,29 @@ const w = c.selectors, y = /* @__PURE__ */ u({
|
|
|
12
12
|
renderIntoProvidedDomNode: { type: Boolean },
|
|
13
13
|
data: {}
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
setup(i, { expose: c }) {
|
|
16
|
+
const t = i;
|
|
17
|
+
p(() => t.data);
|
|
18
|
+
const o = _(t), e = a(), n = a();
|
|
19
|
+
return u(() => {
|
|
20
|
+
f(() => {
|
|
21
|
+
n.value && (e.value = new s(n.value, o.value));
|
|
22
22
|
});
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
k(o, r) || ((a = e.value) == null || a.setConfig(n.value), (s = e.value) == null || s.render());
|
|
29
|
-
}), p({
|
|
23
|
+
}), m(() => {
|
|
24
|
+
e.value?.destroy();
|
|
25
|
+
}), v(o, (l, r) => {
|
|
26
|
+
P(l, r) || (e.value?.setConfig(o.value), e.value?.render());
|
|
27
|
+
}), c({
|
|
30
28
|
component: e
|
|
31
|
-
}), (
|
|
29
|
+
}), (l, r) => (g(), x("div", {
|
|
32
30
|
"data-vis-rolling-pin-legend": "",
|
|
33
31
|
ref_key: "elRef",
|
|
34
|
-
ref:
|
|
32
|
+
ref: n
|
|
35
33
|
}, null, 512));
|
|
36
34
|
}
|
|
37
35
|
});
|
|
38
36
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
R as VisRollingPinLegendSelectors,
|
|
38
|
+
h as default
|
|
41
39
|
};
|
|
42
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/html-components/rolling-pin-legend/index.vue"],"sourcesContent":["<script setup lang=\"ts\" >\n// !!! This code was automatically generated. You should not change it !!!\nimport { RollingPinLegend, RollingPinLegendConfigInterface, RollingPinLegendItem } 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 = RollingPinLegendConfigInterface\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<RollingPinLegend>()\nconst elRef = ref<HTMLDivElement>()\n\nonMounted(() => {\n nextTick(() => {\n if(elRef.value)\n component.value = new RollingPinLegend(elRef.value, config.value)\n \n \n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n \n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\n component.value?.render()\n }\n})\n\n\ndefineExpose({\n component\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisRollingPinLegendSelectors = RollingPinLegend.selectors\n</script>\n\n<template>\n <div data-vis-rolling-pin-legend ref=\"elRef\"/>\n</template>\n\n\n<style>\n [data-vis-rolling-pin-legend] {\n display:block;\n }\n</style>\n"],"names":["VisRollingPinLegendSelectors","RollingPinLegend","props","__props","computed","config","useForwardProps","component","ref","elRef","onMounted","nextTick","onUnmounted","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/html-components/rolling-pin-legend/index.vue"],"sourcesContent":["<script setup lang=\"ts\" >\n// !!! This code was automatically generated. You should not change it !!!\nimport { RollingPinLegend, RollingPinLegendConfigInterface, RollingPinLegendItem } 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 = RollingPinLegendConfigInterface\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<RollingPinLegend>()\nconst elRef = ref<HTMLDivElement>()\n\nonMounted(() => {\n nextTick(() => {\n if(elRef.value)\n component.value = new RollingPinLegend(elRef.value, config.value)\n \n \n })\n})\n\nonUnmounted(() => {\n component.value?.destroy()\n \n})\n\nwatch(config, (curr, prev) => {\n if (!arePropsEqual(curr, prev)) {\n component.value?.setConfig(config.value)\n component.value?.render()\n }\n})\n\n\ndefineExpose({\n component\n})\n</script>\n\n<script lang=\"ts\">\nexport const VisRollingPinLegendSelectors = RollingPinLegend.selectors\n</script>\n\n<template>\n <div data-vis-rolling-pin-legend ref=\"elRef\"/>\n</template>\n\n\n<style>\n [data-vis-rolling-pin-legend] {\n display:block;\n }\n</style>\n"],"names":["VisRollingPinLegendSelectors","RollingPinLegend","props","__props","computed","config","useForwardProps","component","ref","elRef","onMounted","nextTick","onUnmounted","watch","curr","prev","arePropsEqual","__expose","_createElementBlock"],"mappings":";;;AA+CO,MAAMA,IAA+BC,EAAiB;;;;;;;;;;;;AAtC7D,UAAMC,IAAQC;AAED,IAAAC,EAAS,MAAMF,EAAM,IAAI;AAEtC,UAAMG,IAASC,EAAgBJ,CAAK,GAG9BK,IAAYC,EAAA,GACZC,IAAQD,EAAA;AAEd,WAAAE,EAAU,MAAM;AACd,MAAAC,EAAS,MAAM;AACb,QAAGF,EAAM,UACTF,EAAU,QAAQ,IAAIN,EAAiBQ,EAAM,OAAOJ,EAAO,KAAK;AAAA,MAGlE,CAAC;AAAA,IACH,CAAC,GAEDO,EAAY,MAAM;AAChB,MAAAL,EAAU,OAAO,QAAA;AAAA,IAEnB,CAAC,GAEDM,EAAMR,GAAQ,CAACS,GAAMC,MAAS;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MAC3BR,EAAU,OAAO,UAAUF,EAAO,KAAK,GACvCE,EAAU,OAAO,OAAA;AAAA,IAErB,CAAC,GAGDU,EAAa;AAAA,MACX,WAAAV;AAAA,IAAA,CACD,mBAQCW,EAA8C,OAAA;AAAA,MAAzC,+BAAA;AAAA,eAAgC;AAAA,MAAJ,KAAIT;AAAA,IAAA;;;"}
|
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.6.6
|
|
4
|
+
"version": "1.6.6",
|
|
5
5
|
"packageManager": "pnpm@10.23.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -50,10 +50,11 @@
|
|
|
50
50
|
"generate": "rollup -c ./autogen/rollup.config.js; node .autogen.cjs; rm .autogen.cjs",
|
|
51
51
|
"publish:dist": "cd ./dist; npm publish",
|
|
52
52
|
"build:gallery": "vite build --mode gallery",
|
|
53
|
-
"gallery": "vite"
|
|
53
|
+
"gallery": "vite",
|
|
54
|
+
"license:check": "pnpm license-report --config=../../lic-report-config.json > licences.md"
|
|
54
55
|
},
|
|
55
56
|
"peerDependencies": {
|
|
56
|
-
"@unovis/ts": "1.6.6
|
|
57
|
+
"@unovis/ts": "1.6.6",
|
|
57
58
|
"vue": "^3"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
@@ -70,8 +71,8 @@
|
|
|
70
71
|
"rollup-plugin-commonjs": "^10.1.0",
|
|
71
72
|
"rollup-plugin-typescript2": "^0.31.1",
|
|
72
73
|
"tslib": "^2.3.1",
|
|
73
|
-
"typescript": "
|
|
74
|
-
"vite": "
|
|
74
|
+
"typescript": "catalog:",
|
|
75
|
+
"vite": "catalog:",
|
|
75
76
|
"vite-plugin-css-injected-by-js": "^3.3.0",
|
|
76
77
|
"vite-plugin-dts": "^3.5.3",
|
|
77
78
|
"vue": "^3.5.13",
|
package/utils/context.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.cjs","sources":["../../src/utils/context.ts"],"sourcesContent":["import { XYComponentCore, ComponentCore, Tooltip, Crosshair, Axis, Annotations } from '@unovis/ts'\nimport { InjectionKey, Ref } from 'vue'\n\nexport const componentAccessorKey = Symbol('componentAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: XYComponentCore<any> | ComponentCore<any>) => void;\n destroy: () => void;\n}>\n\nexport const tooltipAccessorKey = Symbol('tooltipAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Tooltip) => void;\n destroy: () => void;\n}>\n\nexport const crosshairAccessorKey = Symbol('crosshairAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Crosshair<any>) => void;\n destroy: () => void;\n}>\n\nexport const axisAccessorKey = Symbol('axisAccessorKey') as InjectionKey< {\n data: Ref<any>;\n update: (c: Axis<any>) => void;\n destroy: (c: string) => void;\n}>\n\nexport const annotationsAccessorKey = Symbol('annotationsAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Annotations) => void;\n destroy: () => void;\n}>\n"],"names":["componentAccessorKey","tooltipAccessorKey","crosshairAccessorKey","axisAccessorKey","annotationsAccessorKey"],"mappings":"gFAGO,MAAMA,
|
|
1
|
+
{"version":3,"file":"context.cjs","sources":["../../src/utils/context.ts"],"sourcesContent":["import { XYComponentCore, ComponentCore, Tooltip, Crosshair, Axis, Annotations } from '@unovis/ts'\nimport { InjectionKey, Ref } from 'vue'\n\nexport const componentAccessorKey = Symbol('componentAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: XYComponentCore<any> | ComponentCore<any>) => void;\n destroy: () => void;\n}>\n\nexport const tooltipAccessorKey = Symbol('tooltipAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Tooltip) => void;\n destroy: () => void;\n}>\n\nexport const crosshairAccessorKey = Symbol('crosshairAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Crosshair<any>) => void;\n destroy: () => void;\n}>\n\nexport const axisAccessorKey = Symbol('axisAccessorKey') as InjectionKey< {\n data: Ref<any>;\n update: (c: Axis<any>) => void;\n destroy: (c: string) => void;\n}>\n\nexport const annotationsAccessorKey = Symbol('annotationsAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Annotations) => void;\n destroy: () => void;\n}>\n"],"names":["componentAccessorKey","tooltipAccessorKey","crosshairAccessorKey","axisAccessorKey","annotationsAccessorKey"],"mappings":"gFAGO,MAAMA,SAA8B,sBAAsB,EAMpDC,SAA4B,oBAAoB,EAMhDC,SAA8B,sBAAsB,EAMpDC,SAAyB,iBAAiB,EAM1CC,SAAgC,wBAAwB"}
|
package/utils/context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const o = Symbol("componentAccessorKey"), s = Symbol("tooltipAccessorKey"), c = Symbol("crosshairAccessorKey"), e = Symbol("axisAccessorKey"), t = Symbol("annotationsAccessorKey");
|
|
1
|
+
const o = /* @__PURE__ */ Symbol("componentAccessorKey"), s = /* @__PURE__ */ Symbol("tooltipAccessorKey"), c = /* @__PURE__ */ Symbol("crosshairAccessorKey"), e = /* @__PURE__ */ Symbol("axisAccessorKey"), t = /* @__PURE__ */ Symbol("annotationsAccessorKey");
|
|
2
2
|
export {
|
|
3
3
|
t as annotationsAccessorKey,
|
|
4
4
|
e as axisAccessorKey,
|
package/utils/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../src/utils/context.ts"],"sourcesContent":["import { XYComponentCore, ComponentCore, Tooltip, Crosshair, Axis, Annotations } from '@unovis/ts'\nimport { InjectionKey, Ref } from 'vue'\n\nexport const componentAccessorKey = Symbol('componentAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: XYComponentCore<any> | ComponentCore<any>) => void;\n destroy: () => void;\n}>\n\nexport const tooltipAccessorKey = Symbol('tooltipAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Tooltip) => void;\n destroy: () => void;\n}>\n\nexport const crosshairAccessorKey = Symbol('crosshairAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Crosshair<any>) => void;\n destroy: () => void;\n}>\n\nexport const axisAccessorKey = Symbol('axisAccessorKey') as InjectionKey< {\n data: Ref<any>;\n update: (c: Axis<any>) => void;\n destroy: (c: string) => void;\n}>\n\nexport const annotationsAccessorKey = Symbol('annotationsAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Annotations) => void;\n destroy: () => void;\n}>\n"],"names":["componentAccessorKey","tooltipAccessorKey","crosshairAccessorKey","axisAccessorKey","annotationsAccessorKey"],"mappings":"AAGO,MAAMA,
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../src/utils/context.ts"],"sourcesContent":["import { XYComponentCore, ComponentCore, Tooltip, Crosshair, Axis, Annotations } from '@unovis/ts'\nimport { InjectionKey, Ref } from 'vue'\n\nexport const componentAccessorKey = Symbol('componentAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: XYComponentCore<any> | ComponentCore<any>) => void;\n destroy: () => void;\n}>\n\nexport const tooltipAccessorKey = Symbol('tooltipAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Tooltip) => void;\n destroy: () => void;\n}>\n\nexport const crosshairAccessorKey = Symbol('crosshairAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Crosshair<any>) => void;\n destroy: () => void;\n}>\n\nexport const axisAccessorKey = Symbol('axisAccessorKey') as InjectionKey< {\n data: Ref<any>;\n update: (c: Axis<any>) => void;\n destroy: (c: string) => void;\n}>\n\nexport const annotationsAccessorKey = Symbol('annotationsAccessorKey') as InjectionKey<{\n data: Ref<any>;\n update: (c: Annotations) => void;\n destroy: () => void;\n}>\n"],"names":["componentAccessorKey","tooltipAccessorKey","crosshairAccessorKey","axisAccessorKey","annotationsAccessorKey"],"mappings":"AAGO,MAAMA,2BAA8B,sBAAsB,GAMpDC,2BAA4B,oBAAoB,GAMhDC,2BAA8B,sBAAsB,GAMpDC,2BAAyB,iBAAiB,GAM1CC,2BAAgC,wBAAwB;"}
|
package/utils/props.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@unovis/ts"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@unovis/ts"),e=require("vue");function a(r,s){return c.isEqual(r,s)}function i(r){const s=e.getCurrentInstance(),n=e.useAttrs();return e.computed(()=>{const t={},u=s?.vnode.props??{};return Object.keys(u).forEach(o=>{t[e.camelize(o)]=r[e.camelize(o)]}),{...t,...n}})}exports.arePropsEqual=a;exports.useForwardProps=i;
|
|
2
2
|
//# sourceMappingURL=props.cjs.map
|
package/utils/props.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.cjs","sources":["../../src/utils/props.ts"],"sourcesContent":["import { isEqual } from '@unovis/ts'\nimport { camelize, computed, getCurrentInstance, useAttrs } from 'vue'\n\nexport function arePropsEqual<PropTypes> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n return isEqual(prevProps, nextProps)\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function useForwardProps<T extends Record<string, any>> (props: T) {\n const vm = getCurrentInstance()\n const attrs = useAttrs()\n\n return computed(() => {\n const preservedProps = {} as T\n const assignedProps = vm?.vnode.props ?? {}\n\n Object.keys(assignedProps).forEach((key) => {\n preservedProps[camelize(key) as keyof T] = props[camelize(key)]\n })\n return { ...preservedProps, ...attrs }\n })\n}\n\n"],"names":["arePropsEqual","prevProps","nextProps","isEqual","useForwardProps","props","vm","getCurrentInstance","attrs","useAttrs","computed","preservedProps","assignedProps","key","camelize"],"mappings":"+HAGO,SAASA,EAA0BC,EAAsBC,EAA+B,CAC7F,OAAOC,EAAAA,QAAQF,EAAWC,CAAS,CACrC,CAGO,SAASE,EAAgDC,EAAU,CACxE,MAAMC,EAAKC,EAAAA,mBAAA,EACLC,EAAQC,EAAAA,SAAA,EAEd,OAAOC,EAAAA,SAAS,IAAM,CACpB,MAAMC,EAAiB,CAAA,EACjBC,
|
|
1
|
+
{"version":3,"file":"props.cjs","sources":["../../src/utils/props.ts"],"sourcesContent":["import { isEqual } from '@unovis/ts'\nimport { camelize, computed, getCurrentInstance, useAttrs } from 'vue'\n\nexport function arePropsEqual<PropTypes> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n return isEqual(prevProps, nextProps)\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function useForwardProps<T extends Record<string, any>> (props: T) {\n const vm = getCurrentInstance()\n const attrs = useAttrs()\n\n return computed(() => {\n const preservedProps = {} as T\n const assignedProps = vm?.vnode.props ?? {}\n\n Object.keys(assignedProps).forEach((key) => {\n preservedProps[camelize(key) as keyof T] = props[camelize(key)]\n })\n return { ...preservedProps, ...attrs }\n })\n}\n\n"],"names":["arePropsEqual","prevProps","nextProps","isEqual","useForwardProps","props","vm","getCurrentInstance","attrs","useAttrs","computed","preservedProps","assignedProps","key","camelize"],"mappings":"+HAGO,SAASA,EAA0BC,EAAsBC,EAA+B,CAC7F,OAAOC,EAAAA,QAAQF,EAAWC,CAAS,CACrC,CAGO,SAASE,EAAgDC,EAAU,CACxE,MAAMC,EAAKC,EAAAA,mBAAA,EACLC,EAAQC,EAAAA,SAAA,EAEd,OAAOC,EAAAA,SAAS,IAAM,CACpB,MAAMC,EAAiB,CAAA,EACjBC,EAAgBN,GAAI,MAAM,OAAS,CAAA,EAEzC,cAAO,KAAKM,CAAa,EAAE,QAASC,GAAQ,CAC1CF,EAAeG,EAAAA,SAASD,CAAG,CAAY,EAAIR,EAAMS,EAAAA,SAASD,CAAG,CAAC,CAChE,CAAC,EACM,CAAE,GAAGF,EAAgB,GAAGH,CAAA,CACjC,CAAC,CACH"}
|
package/utils/props.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { isEqual as p } from "@unovis/ts";
|
|
2
2
|
import { getCurrentInstance as u, useAttrs as a, computed as i, camelize as s } from "vue";
|
|
3
|
-
function
|
|
4
|
-
return p(
|
|
3
|
+
function f(r, t) {
|
|
4
|
+
return p(r, t);
|
|
5
5
|
}
|
|
6
|
-
function P(
|
|
7
|
-
const
|
|
6
|
+
function P(r) {
|
|
7
|
+
const t = u(), n = a();
|
|
8
8
|
return i(() => {
|
|
9
|
-
const o = {}, c =
|
|
9
|
+
const o = {}, c = t?.vnode.props ?? {};
|
|
10
10
|
return Object.keys(c).forEach((e) => {
|
|
11
|
-
o[s(e)] =
|
|
11
|
+
o[s(e)] = r[s(e)];
|
|
12
12
|
}), { ...o, ...n };
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
f as arePropsEqual,
|
|
17
17
|
P as useForwardProps
|
|
18
18
|
};
|
|
19
19
|
//# sourceMappingURL=props.js.map
|
package/utils/props.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../src/utils/props.ts"],"sourcesContent":["import { isEqual } from '@unovis/ts'\nimport { camelize, computed, getCurrentInstance, useAttrs } from 'vue'\n\nexport function arePropsEqual<PropTypes> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n return isEqual(prevProps, nextProps)\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function useForwardProps<T extends Record<string, any>> (props: T) {\n const vm = getCurrentInstance()\n const attrs = useAttrs()\n\n return computed(() => {\n const preservedProps = {} as T\n const assignedProps = vm?.vnode.props ?? {}\n\n Object.keys(assignedProps).forEach((key) => {\n preservedProps[camelize(key) as keyof T] = props[camelize(key)]\n })\n return { ...preservedProps, ...attrs }\n })\n}\n\n"],"names":["arePropsEqual","prevProps","nextProps","isEqual","useForwardProps","props","vm","getCurrentInstance","attrs","useAttrs","computed","preservedProps","assignedProps","key","camelize"],"mappings":";;AAGO,SAASA,EAA0BC,GAAsBC,GAA+B;AAC7F,SAAOC,EAAQF,GAAWC,CAAS;AACrC;AAGO,SAASE,EAAgDC,GAAU;AACxE,QAAMC,IAAKC,EAAA,GACLC,IAAQC,EAAA;AAEd,SAAOC,EAAS,MAAM;AACpB,UAAMC,IAAiB,CAAA,GACjBC,
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../src/utils/props.ts"],"sourcesContent":["import { isEqual } from '@unovis/ts'\nimport { camelize, computed, getCurrentInstance, useAttrs } from 'vue'\n\nexport function arePropsEqual<PropTypes> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n return isEqual(prevProps, nextProps)\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function useForwardProps<T extends Record<string, any>> (props: T) {\n const vm = getCurrentInstance()\n const attrs = useAttrs()\n\n return computed(() => {\n const preservedProps = {} as T\n const assignedProps = vm?.vnode.props ?? {}\n\n Object.keys(assignedProps).forEach((key) => {\n preservedProps[camelize(key) as keyof T] = props[camelize(key)]\n })\n return { ...preservedProps, ...attrs }\n })\n}\n\n"],"names":["arePropsEqual","prevProps","nextProps","isEqual","useForwardProps","props","vm","getCurrentInstance","attrs","useAttrs","computed","preservedProps","assignedProps","key","camelize"],"mappings":";;AAGO,SAASA,EAA0BC,GAAsBC,GAA+B;AAC7F,SAAOC,EAAQF,GAAWC,CAAS;AACrC;AAGO,SAASE,EAAgDC,GAAU;AACxE,QAAMC,IAAKC,EAAA,GACLC,IAAQC,EAAA;AAEd,SAAOC,EAAS,MAAM;AACpB,UAAMC,IAAiB,CAAA,GACjBC,IAAgBN,GAAI,MAAM,SAAS,CAAA;AAEzC,kBAAO,KAAKM,CAAa,EAAE,QAAQ,CAACC,MAAQ;AAC1C,MAAAF,EAAeG,EAASD,CAAG,CAAY,IAAIR,EAAMS,EAASD,CAAG,CAAC;AAAA,IAChE,CAAC,GACM,EAAE,GAAGF,GAAgB,GAAGH,EAAA;AAAA,EACjC,CAAC;AACH;"}
|