@unovis/vue 1.6.5 → 1.6.6-beta.0

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 (114) hide show
  1. package/components/annotations/index.cjs +1 -1
  2. package/components/annotations/index.cjs.map +1 -1
  3. package/components/annotations/index.js +20 -20
  4. package/components/annotations/index.js.map +1 -1
  5. package/components/area/index.cjs +1 -1
  6. package/components/area/index.cjs.map +1 -1
  7. package/components/area/index.js +19 -19
  8. package/components/area/index.js.map +1 -1
  9. package/components/axis/index.cjs +1 -1
  10. package/components/axis/index.cjs.map +1 -1
  11. package/components/axis/index.js +20 -19
  12. package/components/axis/index.js.map +1 -1
  13. package/components/brush/index.cjs +1 -1
  14. package/components/brush/index.cjs.map +1 -1
  15. package/components/brush/index.js +20 -19
  16. package/components/brush/index.js.map +1 -1
  17. package/components/chord-diagram/index.cjs +1 -1
  18. package/components/chord-diagram/index.cjs.map +1 -1
  19. package/components/chord-diagram/index.js +19 -19
  20. package/components/chord-diagram/index.js.map +1 -1
  21. package/components/crosshair/index.cjs +1 -1
  22. package/components/crosshair/index.cjs.map +1 -1
  23. package/components/crosshair/index.js +19 -19
  24. package/components/crosshair/index.js.map +1 -1
  25. package/components/donut/index.cjs +1 -1
  26. package/components/donut/index.cjs.map +1 -1
  27. package/components/donut/index.js +19 -19
  28. package/components/donut/index.js.map +1 -1
  29. package/components/free-brush/index.cjs +1 -1
  30. package/components/free-brush/index.cjs.map +1 -1
  31. package/components/free-brush/index.js +19 -19
  32. package/components/free-brush/index.js.map +1 -1
  33. package/components/graph/index.cjs +1 -1
  34. package/components/graph/index.cjs.map +1 -1
  35. package/components/graph/index.js +19 -19
  36. package/components/graph/index.js.map +1 -1
  37. package/components/grouped-bar/index.cjs +1 -1
  38. package/components/grouped-bar/index.cjs.map +1 -1
  39. package/components/grouped-bar/index.js +19 -19
  40. package/components/grouped-bar/index.js.map +1 -1
  41. package/components/line/index.cjs +1 -1
  42. package/components/line/index.cjs.map +1 -1
  43. package/components/line/index.js +19 -19
  44. package/components/line/index.js.map +1 -1
  45. package/components/nested-donut/index.cjs +1 -1
  46. package/components/nested-donut/index.cjs.map +1 -1
  47. package/components/nested-donut/index.js +19 -19
  48. package/components/nested-donut/index.js.map +1 -1
  49. package/components/plotband/index.cjs +1 -1
  50. package/components/plotband/index.cjs.map +1 -1
  51. package/components/plotband/index.js +18 -18
  52. package/components/plotband/index.js.map +1 -1
  53. package/components/plotline/index.cjs +1 -1
  54. package/components/plotline/index.cjs.map +1 -1
  55. package/components/plotline/index.js +16 -16
  56. package/components/plotline/index.js.map +1 -1
  57. package/components/sankey/index.cjs +1 -1
  58. package/components/sankey/index.cjs.map +1 -1
  59. package/components/sankey/index.js +18 -17
  60. package/components/sankey/index.js.map +1 -1
  61. package/components/scatter/index.cjs +1 -1
  62. package/components/scatter/index.cjs.map +1 -1
  63. package/components/scatter/index.js +19 -19
  64. package/components/scatter/index.js.map +1 -1
  65. package/components/stacked-bar/index.cjs +1 -1
  66. package/components/stacked-bar/index.cjs.map +1 -1
  67. package/components/stacked-bar/index.js +19 -19
  68. package/components/stacked-bar/index.js.map +1 -1
  69. package/components/timeline/index.cjs +1 -1
  70. package/components/timeline/index.cjs.map +1 -1
  71. package/components/timeline/index.js +17 -17
  72. package/components/timeline/index.js.map +1 -1
  73. package/components/tooltip/index.cjs +1 -1
  74. package/components/tooltip/index.cjs.map +1 -1
  75. package/components/tooltip/index.js +18 -18
  76. package/components/tooltip/index.js.map +1 -1
  77. package/components/topojson-map/index.cjs +1 -1
  78. package/components/topojson-map/index.cjs.map +1 -1
  79. package/components/topojson-map/index.js +21 -21
  80. package/components/topojson-map/index.js.map +1 -1
  81. package/components/treemap/index.cjs +1 -1
  82. package/components/treemap/index.cjs.map +1 -1
  83. package/components/treemap/index.js +17 -17
  84. package/components/treemap/index.js.map +1 -1
  85. package/components/xy-labels/index.cjs +1 -1
  86. package/components/xy-labels/index.cjs.map +1 -1
  87. package/components/xy-labels/index.js +21 -21
  88. package/components/xy-labels/index.js.map +1 -1
  89. package/html-components/bullet-legend/index.cjs +1 -1
  90. package/html-components/bullet-legend/index.cjs.map +1 -1
  91. package/html-components/bullet-legend/index.js +21 -21
  92. package/html-components/bullet-legend/index.js.map +1 -1
  93. package/html-components/flow-legend/index.cjs +1 -1
  94. package/html-components/flow-legend/index.cjs.map +1 -1
  95. package/html-components/flow-legend/index.js +23 -23
  96. package/html-components/flow-legend/index.js.map +1 -1
  97. package/html-components/leaflet-flow-map/index.cjs +1 -1
  98. package/html-components/leaflet-flow-map/index.cjs.map +1 -1
  99. package/html-components/leaflet-flow-map/index.js +18 -18
  100. package/html-components/leaflet-flow-map/index.js.map +1 -1
  101. package/html-components/leaflet-map/index.cjs +1 -1
  102. package/html-components/leaflet-map/index.cjs.map +1 -1
  103. package/html-components/leaflet-map/index.js +18 -18
  104. package/html-components/leaflet-map/index.js.map +1 -1
  105. package/html-components/rolling-pin-legend/index.cjs +1 -1
  106. package/html-components/rolling-pin-legend/index.cjs.map +1 -1
  107. package/html-components/rolling-pin-legend/index.js +22 -22
  108. package/html-components/rolling-pin-legend/index.js.map +1 -1
  109. package/package.json +2 -2
  110. package/utils/props.cjs +1 -1
  111. package/utils/props.cjs.map +1 -1
  112. package/utils/props.d.ts +1 -4
  113. package/utils/props.js +7 -7
  114. package/utils/props.js.map +1 -1
@@ -1,7 +1,7 @@
1
- import { defineComponent as p, computed as u, ref as s, onMounted as f, nextTick as m, onUnmounted as v, watch as g, openBlock as x, createElementBlock as _ } from "vue";
2
- import { RollingPinLegend as i } from "@unovis/ts";
3
- import { useForwardProps as P, arePropsEqual as b } from "../../utils/props.js";
4
- const h = i.selectors, w = /* @__PURE__ */ p({
1
+ import { defineComponent as u, computed as f, ref as i, onMounted as m, nextTick as v, onUnmounted as g, watch as x, openBlock as _, createElementBlock as P } from "vue";
2
+ import { RollingPinLegend as c } from "@unovis/ts";
3
+ import { useForwardProps as b, arePropsEqual as k } from "../../utils/props.js";
4
+ const w = c.selectors, y = /* @__PURE__ */ u({
5
5
  __name: "index",
6
6
  props: {
7
7
  rects: {},
@@ -12,23 +12,23 @@ const h = i.selectors, w = /* @__PURE__ */ p({
12
12
  renderIntoProvidedDomNode: { type: Boolean },
13
13
  data: {}
14
14
  },
15
- setup(c, { expose: d }) {
16
- const l = c;
17
- u(() => l.data);
18
- const n = P(l), o = s(), t = s();
19
- return f(() => {
20
- m(() => {
21
- t.value && (o.value = new i(t.value, n.value));
15
+ setup(d, { expose: p }) {
16
+ const l = d;
17
+ f(() => l.data);
18
+ const n = b(l), e = i(), t = i();
19
+ return m(() => {
20
+ v(() => {
21
+ t.value && (e.value = new c(t.value, n.value));
22
22
  });
23
- }), v(() => {
24
- var e;
25
- (e = o.value) == null || e.destroy();
26
- }), g(n, (e, r) => {
27
- var a;
28
- b(e, r) || (a = o.value) == null || a.setConfig(n.value);
29
- }), d({
30
- component: o
31
- }), (e, r) => (x(), _("div", {
23
+ }), g(() => {
24
+ var o;
25
+ (o = e.value) == null || o.destroy();
26
+ }), x(n, (o, r) => {
27
+ var a, s;
28
+ k(o, r) || ((a = e.value) == null || a.setConfig(n.value), (s = e.value) == null || s.render());
29
+ }), p({
30
+ component: e
31
+ }), (o, r) => (_(), P("div", {
32
32
  "data-vis-rolling-pin-legend": "",
33
33
  ref_key: "elRef",
34
34
  ref: t
@@ -36,7 +36,7 @@ const h = i.selectors, w = /* @__PURE__ */ p({
36
36
  }
37
37
  });
38
38
  export {
39
- h as VisRollingPinLegendSelectors,
40
- w as default
39
+ w as VisRollingPinLegendSelectors,
40
+ y as default
41
41
  };
42
42
  //# 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 }\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","_a","watch","curr","prev","arePropsEqual","__expose","_createElementBlock"],"mappings":";;;AA8CO,MAAMA,IAA+BC,EAAiB;;;;;;;;;;;;AArC7D,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,OAAAC,IAAAN,EAAU,UAAV,QAAAM,EAAiB;AAAA,IAEnB,CAAC,GAEDC,EAAMT,GAAQ,CAACU,GAAMC,MAAS;;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,MAC3BH,IAAAN,EAAU,UAAV,QAAAM,EAAiB,UAAUR,EAAO;AAAA,IAEtC,CAAC,GAGDa,EAAa;AAAA,MACX,WAAAX;AAAA,IAAA,CACD,mBAQCY,EAA8C,OAAA;AAAA,MAAzC,+BAAA;AAAA,eAAgC;AAAA,MAAJ,KAAIV;AAAA,IAAA;;;"}
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","_a","watch","curr","prev","arePropsEqual","_b","__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,OAAAC,IAAAN,EAAU,UAAV,QAAAM,EAAiB;AAAA,IAEnB,CAAC,GAEDC,EAAMT,GAAQ,CAACU,GAAMC,MAAS;;AAC5B,MAAKC,EAAcF,GAAMC,CAAI,OAC3BH,IAAAN,EAAU,UAAV,QAAAM,EAAiB,UAAUR,EAAO,SAClCa,IAAAX,EAAU,UAAV,QAAAW,EAAiB;AAAA,IAErB,CAAC,GAGDC,EAAa;AAAA,MACX,WAAAZ;AAAA,IAAA,CACD,mBAQCa,EAA8C,OAAA;AAAA,MAAzC,+BAAA;AAAA,eAAgC;AAAA,MAAJ,KAAIX;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.5",
4
+ "version": "1.6.6-beta.0",
5
5
  "packageManager": "pnpm@10.23.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -53,7 +53,7 @@
53
53
  "gallery": "vite"
54
54
  },
55
55
  "peerDependencies": {
56
- "@unovis/ts": "1.6.5",
56
+ "@unovis/ts": "1.6.6-beta.0",
57
57
  "vue": "^3"
58
58
  },
59
59
  "devDependencies": {
package/utils/props.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@unovis/ts"),e=require("vue");function c(t,r){return a.isEqual(t,r)}function i(t){const r=e.getCurrentInstance(),n=r.attrs;return e.computed(()=>{const s={},u=(r==null?void 0:r.vnode.props)??{};return Object.keys(u).forEach(o=>{s[e.camelize(o)]=t[e.camelize(o)]}),{...s,...n}})}exports.arePropsEqual=c;exports.useForwardProps=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@unovis/ts"),r=require("vue");function a(s,e){return c.isEqual(s,e)}function i(s){const e=r.getCurrentInstance(),n=r.useAttrs();return r.computed(()=>{const t={},u=(e==null?void 0:e.vnode.props)??{};return Object.keys(u).forEach(o=>{t[r.camelize(o)]=s[r.camelize(o)]}),{...t,...n}})}exports.arePropsEqual=a;exports.useForwardProps=i;
2
2
  //# sourceMappingURL=props.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.cjs","sources":["../../src/utils/props.ts"],"sourcesContent":["import { isEqual } from '@unovis/ts'\nimport { ComponentInternalInstance, camelize, computed, getCurrentInstance } from 'vue'\n\nexport function arePropsEqual<PropTypes> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n return isEqual(prevProps, nextProps)\n}\n\n// source: https://www.radix-vue.com/utilities/use-forward-props.html\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 = vm.attrs\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// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function parseProps <T extends object> (props: T, instance: ComponentInternalInstance | null) {\n const preservedProps = {} as T\n const assignedProps = instance?.vnode.props ?? {}\n\n Object.keys(assignedProps).forEach(key => {\n preservedProps[camelize(key)] = assignedProps[key]\n })\n return preservedProps\n}\n\n"],"names":["arePropsEqual","prevProps","nextProps","isEqual","useForwardProps","props","vm","getCurrentInstance","attrs","computed","preservedProps","assignedProps","key","camelize"],"mappings":"+HAGO,SAASA,EAA0BC,EAAsBC,EAA+B,CAC7F,OAAOC,EAAAA,QAAQF,EAAWC,CAAS,CACrC,CAIO,SAASE,EAAgDC,EAAU,CACxE,MAAMC,EAAKC,EAAAA,mBAAA,EACLC,EAAQF,EAAG,MAEjB,OAAOG,EAAAA,SAAS,IAAM,CACpB,MAAMC,EAAiB,CAAA,EACjBC,GAAgBL,GAAA,YAAAA,EAAI,MAAM,QAAS,CAAA,EAEzC,cAAO,KAAKK,CAAa,EAAE,QAASC,GAAQ,CAC1CF,EAAeG,EAAAA,SAASD,CAAG,CAAY,EAAIP,EAAMQ,EAAAA,SAASD,CAAG,CAAC,CAChE,CAAC,EACM,CAAE,GAAGF,EAAgB,GAAGF,CAAA,CACjC,CAAC,CACH"}
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,GAAgBN,GAAA,YAAAA,EAAI,MAAM,QAAS,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.d.ts CHANGED
@@ -1,7 +1,4 @@
1
- import { ComponentInternalInstance } from 'vue';
2
-
3
1
  export declare function arePropsEqual<PropTypes>(prevProps: PropTypes, nextProps: PropTypes): boolean;
4
2
  export declare function useForwardProps<T extends Record<string, any>>(props: T): import('vue').ComputedRef<T & {
5
3
  [x: string]: unknown;
6
- }>;
7
- export declare function parseProps<T extends object>(props: T, instance: ComponentInternalInstance | null): T;
4
+ } & import('vue').AllowedAttrs>;
package/utils/props.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { isEqual as p } from "@unovis/ts";
2
- import { getCurrentInstance as a, computed as u, camelize as s } from "vue";
3
- function f(t, r) {
2
+ import { getCurrentInstance as u, useAttrs as a, computed as i, camelize as s } from "vue";
3
+ function m(t, r) {
4
4
  return p(t, r);
5
5
  }
6
- function m(t) {
7
- const r = a(), n = r.attrs;
8
- return u(() => {
6
+ function P(t) {
7
+ const r = u(), n = a();
8
+ return i(() => {
9
9
  const o = {}, c = (r == null ? void 0 : r.vnode.props) ?? {};
10
10
  return Object.keys(c).forEach((e) => {
11
11
  o[s(e)] = t[s(e)];
@@ -13,7 +13,7 @@ function m(t) {
13
13
  });
14
14
  }
15
15
  export {
16
- f as arePropsEqual,
17
- m as useForwardProps
16
+ m as arePropsEqual,
17
+ P as useForwardProps
18
18
  };
19
19
  //# sourceMappingURL=props.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.js","sources":["../../src/utils/props.ts"],"sourcesContent":["import { isEqual } from '@unovis/ts'\nimport { ComponentInternalInstance, camelize, computed, getCurrentInstance } from 'vue'\n\nexport function arePropsEqual<PropTypes> (prevProps: PropTypes, nextProps: PropTypes): boolean {\n return isEqual(prevProps, nextProps)\n}\n\n// source: https://www.radix-vue.com/utilities/use-forward-props.html\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 = vm.attrs\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// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport function parseProps <T extends object> (props: T, instance: ComponentInternalInstance | null) {\n const preservedProps = {} as T\n const assignedProps = instance?.vnode.props ?? {}\n\n Object.keys(assignedProps).forEach(key => {\n preservedProps[camelize(key)] = assignedProps[key]\n })\n return preservedProps\n}\n\n"],"names":["arePropsEqual","prevProps","nextProps","isEqual","useForwardProps","props","vm","getCurrentInstance","attrs","computed","preservedProps","assignedProps","key","camelize"],"mappings":";;AAGO,SAASA,EAA0BC,GAAsBC,GAA+B;AAC7F,SAAOC,EAAQF,GAAWC,CAAS;AACrC;AAIO,SAASE,EAAgDC,GAAU;AACxE,QAAMC,IAAKC,EAAA,GACLC,IAAQF,EAAG;AAEjB,SAAOG,EAAS,MAAM;AACpB,UAAMC,IAAiB,CAAA,GACjBC,KAAgBL,KAAA,gBAAAA,EAAI,MAAM,UAAS,CAAA;AAEzC,kBAAO,KAAKK,CAAa,EAAE,QAAQ,CAACC,MAAQ;AAC1C,MAAAF,EAAeG,EAASD,CAAG,CAAY,IAAIP,EAAMQ,EAASD,CAAG,CAAC;AAAA,IAChE,CAAC,GACM,EAAE,GAAGF,GAAgB,GAAGF,EAAA;AAAA,EACjC,CAAC;AACH;"}
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,KAAgBN,KAAA,gBAAAA,EAAI,MAAM,UAAS,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;"}