@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.
- package/README.md +4 -0
- 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 +22 -23
- 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 +26 -25
- package/components/axis/index.js.map +1 -1
- package/components/boxplot/index.cjs +2 -0
- package/components/boxplot/index.cjs.map +1 -0
- package/components/boxplot/index.d.ts +19 -0
- package/components/boxplot/index.js +31 -0
- package/components/boxplot/index.js.map +1 -0
- package/components/boxplot/index2.cjs +2 -0
- package/components/boxplot/index2.cjs.map +1 -0
- package/components/boxplot/index2.js +7 -0
- package/components/boxplot/index2.js.map +1 -0
- 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 +22 -24
- 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 +22 -24
- 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 +3 -3
- package/components/crosshair/index.js +20 -24
- 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 +22 -24
- 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 -24
- 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.d.ts +1 -1
- package/components/graph/index.js +26 -22
- 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 +24 -25
- package/components/grouped-bar/index.js.map +1 -1
- package/components/heatmap/index.cjs +2 -0
- package/components/heatmap/index.cjs.map +1 -0
- package/components/heatmap/index.d.ts +19 -0
- package/components/heatmap/index.js +49 -0
- package/components/heatmap/index.js.map +1 -0
- package/components/heatmap/index2.cjs +2 -0
- package/components/heatmap/index2.cjs.map +1 -0
- package/components/heatmap/index2.js +7 -0
- package/components/heatmap/index2.js.map +1 -0
- 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 +22 -24
- 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 +22 -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 +16 -17
- 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 +16 -17
- package/components/plotline/index.js.map +1 -1
- package/components/radial-bar/index.cjs +2 -0
- package/components/radial-bar/index.cjs.map +1 -0
- package/components/radial-bar/index.d.ts +19 -0
- package/components/radial-bar/index.js +54 -0
- package/components/radial-bar/index.js.map +1 -0
- package/components/radial-bar/index2.cjs +2 -0
- package/components/radial-bar/index2.cjs.map +1 -0
- package/components/radial-bar/index2.js +7 -0
- package/components/radial-bar/index2.js.map +1 -0
- 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 +24 -23
- 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 +22 -24
- 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 +23 -23
- 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 +3 -3
- package/components/timeline/index.js +20 -24
- 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 +15 -17
- 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 +52 -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 +22 -24
- 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 -24
- package/components/xy-labels/index.js.map +1 -1
- package/components.d.ts +3 -0
- package/containers/single-container/index.cjs +1 -1
- package/containers/single-container/index.cjs.map +1 -1
- package/containers/single-container/index.js +26 -26
- 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 +25 -30
- 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 +23 -24
- 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 +21 -23
- 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 +22 -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 +22 -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 +22 -24
- package/html-components/rolling-pin-legend/index.js.map +1 -1
- package/index.cjs +2 -2
- package/index.js +95 -86
- package/index.js.map +1 -1
- package/package.json +12 -12
- 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.d.ts +1 -4
- package/utils/props.js +9 -9
- 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
|
|
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
|
|
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": "
|
|
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
|
|
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
|
-
"
|
|
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": "
|
|
72
|
-
"vite": "
|
|
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.
|
|
76
|
+
"vue-tsc": "^2.1.0"
|
|
77
77
|
}
|
|
78
78
|
}
|
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
|
|
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 {
|
|
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
|
|
3
|
-
function f(
|
|
4
|
-
return p(
|
|
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
|
|
7
|
-
const
|
|
8
|
-
return
|
|
9
|
-
const o = {}, c =
|
|
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)] =
|
|
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 {
|
|
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;"}
|