@unovis/vue 1.7.0-pre.2 → 1.7.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 (184) hide show
  1. package/README.md +4 -0
  2. package/components/annotations/index.cjs +1 -1
  3. package/components/annotations/index.cjs.map +1 -1
  4. package/components/annotations/index.d.ts +1 -1
  5. package/components/annotations/index.js +18 -20
  6. package/components/annotations/index.js.map +1 -1
  7. package/components/area/index.cjs +1 -1
  8. package/components/area/index.cjs.map +1 -1
  9. package/components/area/index.d.ts +1 -1
  10. package/components/area/index.js +22 -23
  11. package/components/area/index.js.map +1 -1
  12. package/components/axis/index.cjs +1 -1
  13. package/components/axis/index.cjs.map +1 -1
  14. package/components/axis/index.d.ts +1 -1
  15. package/components/axis/index.js +26 -25
  16. package/components/axis/index.js.map +1 -1
  17. package/components/boxplot/index.cjs +2 -0
  18. package/components/boxplot/index.cjs.map +1 -0
  19. package/components/boxplot/index.d.ts +19 -0
  20. package/components/boxplot/index.js +31 -0
  21. package/components/boxplot/index.js.map +1 -0
  22. package/components/boxplot/index2.cjs +2 -0
  23. package/components/boxplot/index2.cjs.map +1 -0
  24. package/components/boxplot/index2.js +7 -0
  25. package/components/boxplot/index2.js.map +1 -0
  26. package/components/brush/index.cjs +1 -1
  27. package/components/brush/index.cjs.map +1 -1
  28. package/components/brush/index.d.ts +1 -1
  29. package/components/brush/index.js +22 -24
  30. package/components/brush/index.js.map +1 -1
  31. package/components/chord-diagram/index.cjs +1 -1
  32. package/components/chord-diagram/index.cjs.map +1 -1
  33. package/components/chord-diagram/index.d.ts +1 -1
  34. package/components/chord-diagram/index.js +22 -24
  35. package/components/chord-diagram/index.js.map +1 -1
  36. package/components/crosshair/index.cjs +1 -1
  37. package/components/crosshair/index.cjs.map +1 -1
  38. package/components/crosshair/index.d.ts +3 -3
  39. package/components/crosshair/index.js +20 -24
  40. package/components/crosshair/index.js.map +1 -1
  41. package/components/donut/index.cjs +1 -1
  42. package/components/donut/index.cjs.map +1 -1
  43. package/components/donut/index.d.ts +1 -1
  44. package/components/donut/index.js +22 -24
  45. package/components/donut/index.js.map +1 -1
  46. package/components/free-brush/index.cjs +1 -1
  47. package/components/free-brush/index.cjs.map +1 -1
  48. package/components/free-brush/index.d.ts +1 -1
  49. package/components/free-brush/index.js +21 -24
  50. package/components/free-brush/index.js.map +1 -1
  51. package/components/graph/index.cjs +1 -1
  52. package/components/graph/index.cjs.map +1 -1
  53. package/components/graph/index.d.ts +1 -1
  54. package/components/graph/index.js +26 -22
  55. package/components/graph/index.js.map +1 -1
  56. package/components/grouped-bar/index.cjs +1 -1
  57. package/components/grouped-bar/index.cjs.map +1 -1
  58. package/components/grouped-bar/index.d.ts +1 -1
  59. package/components/grouped-bar/index.js +24 -25
  60. package/components/grouped-bar/index.js.map +1 -1
  61. package/components/heatmap/index.cjs +2 -0
  62. package/components/heatmap/index.cjs.map +1 -0
  63. package/components/heatmap/index.d.ts +19 -0
  64. package/components/heatmap/index.js +49 -0
  65. package/components/heatmap/index.js.map +1 -0
  66. package/components/heatmap/index2.cjs +2 -0
  67. package/components/heatmap/index2.cjs.map +1 -0
  68. package/components/heatmap/index2.js +7 -0
  69. package/components/heatmap/index2.js.map +1 -0
  70. package/components/line/index.cjs +1 -1
  71. package/components/line/index.cjs.map +1 -1
  72. package/components/line/index.d.ts +1 -1
  73. package/components/line/index.js +22 -24
  74. package/components/line/index.js.map +1 -1
  75. package/components/nested-donut/index.cjs +1 -1
  76. package/components/nested-donut/index.cjs.map +1 -1
  77. package/components/nested-donut/index.d.ts +1 -1
  78. package/components/nested-donut/index.js +22 -25
  79. package/components/nested-donut/index.js.map +1 -1
  80. package/components/plotband/index.cjs +1 -1
  81. package/components/plotband/index.cjs.map +1 -1
  82. package/components/plotband/index.d.ts +1 -1
  83. package/components/plotband/index.js +16 -17
  84. package/components/plotband/index.js.map +1 -1
  85. package/components/plotline/index.cjs +1 -1
  86. package/components/plotline/index.cjs.map +1 -1
  87. package/components/plotline/index.d.ts +1 -1
  88. package/components/plotline/index.js +16 -17
  89. package/components/plotline/index.js.map +1 -1
  90. package/components/radial-bar/index.cjs +2 -0
  91. package/components/radial-bar/index.cjs.map +1 -0
  92. package/components/radial-bar/index.d.ts +19 -0
  93. package/components/radial-bar/index.js +54 -0
  94. package/components/radial-bar/index.js.map +1 -0
  95. package/components/radial-bar/index2.cjs +2 -0
  96. package/components/radial-bar/index2.cjs.map +1 -0
  97. package/components/radial-bar/index2.js +7 -0
  98. package/components/radial-bar/index2.js.map +1 -0
  99. package/components/sankey/index.cjs +1 -1
  100. package/components/sankey/index.cjs.map +1 -1
  101. package/components/sankey/index.d.ts +1 -1
  102. package/components/sankey/index.js +24 -23
  103. package/components/sankey/index.js.map +1 -1
  104. package/components/scatter/index.cjs +1 -1
  105. package/components/scatter/index.cjs.map +1 -1
  106. package/components/scatter/index.d.ts +1 -1
  107. package/components/scatter/index.js +22 -24
  108. package/components/scatter/index.js.map +1 -1
  109. package/components/stacked-bar/index.cjs +1 -1
  110. package/components/stacked-bar/index.cjs.map +1 -1
  111. package/components/stacked-bar/index.d.ts +1 -1
  112. package/components/stacked-bar/index.js +23 -23
  113. package/components/stacked-bar/index.js.map +1 -1
  114. package/components/timeline/index.cjs +1 -1
  115. package/components/timeline/index.cjs.map +1 -1
  116. package/components/timeline/index.d.ts +3 -3
  117. package/components/timeline/index.js +20 -24
  118. package/components/timeline/index.js.map +1 -1
  119. package/components/tooltip/index.cjs +1 -1
  120. package/components/tooltip/index.cjs.map +1 -1
  121. package/components/tooltip/index.d.ts +1 -1
  122. package/components/tooltip/index.js +15 -17
  123. package/components/tooltip/index.js.map +1 -1
  124. package/components/topojson-map/index.cjs +1 -1
  125. package/components/topojson-map/index.cjs.map +1 -1
  126. package/components/topojson-map/index.d.ts +1 -1
  127. package/components/topojson-map/index.js +52 -25
  128. package/components/topojson-map/index.js.map +1 -1
  129. package/components/treemap/index.cjs +1 -1
  130. package/components/treemap/index.cjs.map +1 -1
  131. package/components/treemap/index.d.ts +1 -1
  132. package/components/treemap/index.js +22 -24
  133. package/components/treemap/index.js.map +1 -1
  134. package/components/xy-labels/index.cjs +1 -1
  135. package/components/xy-labels/index.cjs.map +1 -1
  136. package/components/xy-labels/index.d.ts +1 -1
  137. package/components/xy-labels/index.js +21 -24
  138. package/components/xy-labels/index.js.map +1 -1
  139. package/components.d.ts +3 -0
  140. package/containers/single-container/index.cjs +1 -1
  141. package/containers/single-container/index.cjs.map +1 -1
  142. package/containers/single-container/index.js +26 -26
  143. package/containers/single-container/index.js.map +1 -1
  144. package/containers/xy-container/index.cjs +1 -1
  145. package/containers/xy-container/index.cjs.map +1 -1
  146. package/containers/xy-container/index.js +25 -30
  147. package/containers/xy-container/index.js.map +1 -1
  148. package/html-components/bullet-legend/index.cjs +1 -1
  149. package/html-components/bullet-legend/index.cjs.map +1 -1
  150. package/html-components/bullet-legend/index.d.ts +1 -1
  151. package/html-components/bullet-legend/index.js +23 -24
  152. package/html-components/bullet-legend/index.js.map +1 -1
  153. package/html-components/flow-legend/index.cjs +1 -1
  154. package/html-components/flow-legend/index.cjs.map +1 -1
  155. package/html-components/flow-legend/index.d.ts +1 -1
  156. package/html-components/flow-legend/index.js +21 -23
  157. package/html-components/flow-legend/index.js.map +1 -1
  158. package/html-components/leaflet-flow-map/index.cjs +1 -1
  159. package/html-components/leaflet-flow-map/index.cjs.map +1 -1
  160. package/html-components/leaflet-flow-map/index.d.ts +1 -1
  161. package/html-components/leaflet-flow-map/index.js +22 -24
  162. package/html-components/leaflet-flow-map/index.js.map +1 -1
  163. package/html-components/leaflet-map/index.cjs +1 -1
  164. package/html-components/leaflet-map/index.cjs.map +1 -1
  165. package/html-components/leaflet-map/index.d.ts +1 -1
  166. package/html-components/leaflet-map/index.js +22 -24
  167. package/html-components/leaflet-map/index.js.map +1 -1
  168. package/html-components/rolling-pin-legend/index.cjs +1 -1
  169. package/html-components/rolling-pin-legend/index.cjs.map +1 -1
  170. package/html-components/rolling-pin-legend/index.d.ts +1 -1
  171. package/html-components/rolling-pin-legend/index.js +22 -24
  172. package/html-components/rolling-pin-legend/index.js.map +1 -1
  173. package/index.cjs +2 -2
  174. package/index.js +95 -86
  175. package/index.js.map +1 -1
  176. package/package.json +12 -12
  177. package/utils/context.cjs.map +1 -1
  178. package/utils/context.js +1 -1
  179. package/utils/context.js.map +1 -1
  180. package/utils/props.cjs +1 -1
  181. package/utils/props.cjs.map +1 -1
  182. package/utils/props.d.ts +1 -4
  183. package/utils/props.js +9 -9
  184. package/utils/props.js.map +1 -1
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.7.0-pre.2",
4
+ "version": "1.7.0",
5
5
  "packageManager": "pnpm@10.23.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -45,34 +45,34 @@
45
45
  "type": "module",
46
46
  "sideEffects": false,
47
47
  "scripts": {
48
- "build": "vite build; rm -rf dist/.cache; cp LICENSE README.md package.json ./dist",
48
+ "build": "pnpm check && vite build && rm -rf dist/.cache && cp LICENSE README.md package.json ./dist",
49
49
  "check": "vue-tsc --noEmit",
50
- "generate": "rollup -c ./autogen/rollup.config.js; node .autogen.cjs; rm .autogen.cjs",
50
+ "generate": "tsx ./autogen/index.ts",
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.7.0-pre.2",
57
+ "@unovis/ts": "1.7.0",
57
58
  "vue": "^3"
58
59
  },
59
60
  "devDependencies": {
61
+ "@unovis/ts": "workspace:*",
60
62
  "@unovis/shared": "workspace:*",
61
63
  "@antfu/eslint-config": "^3.9.1",
62
- "@rollup/plugin-node-resolve": "^13.0.4",
63
64
  "@vitejs/plugin-vue": "^5.2.3",
64
65
  "@vue/tsconfig": "^0.4.0",
66
+ "buffer-from": "^1.1.2",
65
67
  "de-indent": "^1.0.2",
66
68
  "jju": "^1.4.0",
67
- "rollup": "^2.61.1",
68
- "rollup-plugin-commonjs": "^10.1.0",
69
- "rollup-plugin-typescript2": "^0.31.1",
69
+ "tsx": "^4.19.1",
70
70
  "tslib": "^2.3.1",
71
- "typescript": "~5.6.3",
72
- "vite": "^6.2.4",
71
+ "typescript": "catalog:",
72
+ "vite": "catalog:",
73
73
  "vite-plugin-css-injected-by-js": "^3.3.0",
74
74
  "vite-plugin-dts": "^3.5.3",
75
75
  "vue": "^3.5.13",
76
- "vue-tsc": "^1.8.10"
76
+ "vue-tsc": "^2.1.0"
77
77
  }
78
78
  }
@@ -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,EAAuB,OAAO,sBAAsB,EAMpDC,EAAqB,OAAO,oBAAoB,EAMhDC,EAAuB,OAAO,sBAAsB,EAMpDC,EAAkB,OAAO,iBAAiB,EAM1CC,EAAyB,OAAO,wBAAwB"}
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,
@@ -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,IAAuB,OAAO,sBAAsB,GAMpDC,IAAqB,OAAO,oBAAoB,GAMhDC,IAAuB,OAAO,sBAAsB,GAMpDC,IAAkB,OAAO,iBAAiB,GAM1CC,IAAyB,OAAO,wBAAwB;"}
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 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"),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
@@ -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,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.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,19 +1,19 @@
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) {
4
- return p(t, r);
2
+ import { getCurrentInstance as u, useAttrs as a, computed as i, camelize as s } from "vue";
3
+ function f(r, t) {
4
+ return p(r, t);
5
5
  }
6
- function m(t) {
7
- const r = a(), n = r.attrs;
8
- return u(() => {
9
- const o = {}, c = (r == null ? void 0 : r.vnode.props) ?? {};
6
+ function P(r) {
7
+ const t = u(), n = a();
8
+ return i(() => {
9
+ const o = {}, c = t?.vnode.props ?? {};
10
10
  return Object.keys(c).forEach((e) => {
11
- o[s(e)] = t[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
- m as useForwardProps
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,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;"}