chore: revert unovis/ts to 1.2.1

This commit is contained in:
zernonia 2023-11-13 17:33:56 +08:00
parent 6269496a5b
commit b577c23011
13 changed files with 23 additions and 58 deletions

View File

@ -17,7 +17,7 @@
"@radix-icons/vue": "^1.0.0", "@radix-icons/vue": "^1.0.0",
"@stackblitz/sdk": "^1.9.0", "@stackblitz/sdk": "^1.9.0",
"@tanstack/vue-table": "^8.10.7", "@tanstack/vue-table": "^8.10.7",
"@unovis/ts": "^1.3.0", "@unovis/ts": "^1.2.1",
"@unovis/vue": "1.3.0", "@unovis/vue": "1.3.0",
"@vee-validate/zod": "^4.11.8", "@vee-validate/zod": "^4.11.8",
"@vueuse/core": "^10.5.0", "@vueuse/core": "^10.5.0",

View File

@ -4,7 +4,7 @@ import { VisArea, VisAxis, VisLine, VisXYContainer } from '@unovis/vue'
import { Area, Axis, Line } from '@unovis/ts' import { Area, Axis, Line } from '@unovis/ts'
import { ref } from 'vue' import { ref } from 'vue'
import { useMounted } from '@vueuse/core' import { useMounted } from '@vueuse/core'
import { ChartCrosshair, ChartLegend, defaultColors } from '@/lib/registry/new-york/ui/chart' import { ChartCrosshair, ChartLegend, defaultColors } from '@/lib/registry/default/ui/chart'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{

View File

@ -4,7 +4,7 @@ import { VisAxis, VisGroupedBar, VisStackedBar, VisXYContainer } from '@unovis/v
import { Axis, GroupedBar, StackedBar } from '@unovis/ts' import { Axis, GroupedBar, StackedBar } from '@unovis/ts'
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import { useMounted } from '@vueuse/core' import { useMounted } from '@vueuse/core'
import { ChartCrosshair, ChartLegend, defaultColors } from '@/lib/registry/new-york/ui/chart' import { ChartCrosshair, ChartLegend, defaultColors } from '@/lib/registry/default/ui/chart'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{

View File

@ -25,7 +25,7 @@ function template(d: any, ...a: any) {
const legendReference = props.items.find(i => i.name === key) const legendReference = props.items.find(i => i.name === key)
return { ...legendReference, value } return { ...legendReference, value }
}) })
createApp(ChartTooltip, { title: d[props.index], data: omittedData }).mount(componentDiv) createApp(ChartTooltip, { title: d[props.index].toString(), data: omittedData }).mount(componentDiv)
wm.set(d, componentDiv.innerHTML) wm.set(d, componentDiv.innerHTML)
return componentDiv.innerHTML return componentDiv.innerHTML
} }

View File

@ -21,8 +21,8 @@ onMounted(() => {
nextTick(() => { nextTick(() => {
const elements = elRef.value?.querySelectorAll(selector) const elements = elRef.value?.querySelectorAll(selector)
const classes = buttonVariants({ variant: 'ghost', size: 'xs' }).split(' ') const classes = buttonVariants({ variant: 'ghost', size: 'xs' }).split(' ')
console.log(elements, classes)
elements?.forEach(el => el.classList.add(...classes, '!mr-2')) elements?.forEach(el => el.classList.add(...classes, '!inline-flex', '!mr-2'))
}) })
}) })

View File

@ -33,7 +33,7 @@ defineProps<{
</span> </span>
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</div> </div>
<span class="font-semibold">{{ item.value }}</span> <span class="font-semibold ml-4">{{ item.value }}</span>
</div> </div>
</CardContent> </CardContent>
</Card> </Card>

View File

@ -3,4 +3,8 @@ export { default as ChartSingleTooltip } from './ChartSingleTooltip.vue'
export { default as ChartLegend } from './ChartLegend.vue' export { default as ChartLegend } from './ChartLegend.vue'
export { default as ChartCrosshair } from './ChartCrosshair.vue' export { default as ChartCrosshair } from './ChartCrosshair.vue'
export const defaultColors = ['hsl(var(--primary))', 'hsl(var(--muted))'] const COLOR_COUNT = 3
export const defaultColors = [
...Array.from(Array(COLOR_COUNT).keys()).map(i => `hsl(var(--primary) / ${1 - (1 / COLOR_COUNT) * i})`),
...Array.from(Array(COLOR_COUNT).keys()).map(i => `hsl(var(--secondary) / ${1 - (1 / COLOR_COUNT) * i})`),
]

View File

@ -25,7 +25,7 @@ function template(d: any, ...a: any) {
const legendReference = props.items.find(i => i.name === key) const legendReference = props.items.find(i => i.name === key)
return { ...legendReference, value } return { ...legendReference, value }
}) })
createApp(ChartTooltip, { title: d[props.index], data: omittedData }).mount(componentDiv) createApp(ChartTooltip, { title: d[props.index].toString(), data: omittedData }).mount(componentDiv)
wm.set(d, componentDiv.innerHTML) wm.set(d, componentDiv.innerHTML)
return componentDiv.innerHTML return componentDiv.innerHTML
} }

View File

@ -22,7 +22,7 @@ onMounted(() => {
const elements = elRef.value?.querySelectorAll(selector) const elements = elRef.value?.querySelectorAll(selector)
const classes = buttonVariants({ variant: 'ghost', size: 'xs' }).split(' ') const classes = buttonVariants({ variant: 'ghost', size: 'xs' }).split(' ')
elements?.forEach(el => el.classList.add(...classes, '!mr-2')) elements?.forEach(el => el.classList.add(...classes, '!inline-flex', '!mr-2'))
}) })
}) })

View File

@ -33,7 +33,7 @@ defineProps<{
</span> </span>
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</div> </div>
<span class="font-semibold">{{ item.value }}</span> <span class="font-semibold ml-4">{{ item.value }}</span>
</div> </div>
</CardContent> </CardContent>
</Card> </Card>

View File

@ -43,11 +43,6 @@
"@commitlint/config-conventional" "@commitlint/config-conventional"
] ]
}, },
"pnpm": {
"patchedDependencies": {
"@unovis/vue@1.3.0": "patches/@unovis__vue@1.3.0.patch"
}
},
"simple-git-hooks": { "simple-git-hooks": {
"pre-commit": "pnpm lint-staged", "pre-commit": "pnpm lint-staged",
"commit-msg": "pnpm commitlint --edit ${1}" "commit-msg": "pnpm commitlint --edit ${1}"

View File

@ -1,13 +0,0 @@
diff --git a/package.json b/package.json
index cf65a07e0d7abc8bf22e213d9746287cacb336cd..109ef112fc62a2e2dc1b0006e600a9521ace0041 100644
--- a/package.json
+++ b/package.json
@@ -51,7 +51,7 @@
"gallery": "vite"
},
"peerDependencies": {
- "@unovis/ts": "1.2.1",
+ "@unovis/ts": "^1.3.0",
"vue": "^3"
},
"devDependencies": {

View File

@ -4,11 +4,6 @@ settings:
autoInstallPeers: true autoInstallPeers: true
excludeLinksFromLockfile: false excludeLinksFromLockfile: false
patchedDependencies:
'@unovis/vue@1.3.0':
hash: ngtngm7gel5uviv7fhlhavdy3a
path: patches/@unovis__vue@1.3.0.patch
importers: importers:
.: .:
@ -65,11 +60,11 @@ importers:
specifier: ^8.10.7 specifier: ^8.10.7
version: 8.10.7(vue@3.3.7) version: 8.10.7(vue@3.3.7)
'@unovis/ts': '@unovis/ts':
specifier: ^1.3.0 specifier: ^1.2.1
version: 1.3.0 version: 1.2.1
'@unovis/vue': '@unovis/vue':
specifier: 1.3.0 specifier: 1.3.0
version: 1.3.0(patch_hash=ngtngm7gel5uviv7fhlhavdy3a)(@unovis/ts@1.3.0)(vue@3.3.7) version: 1.3.0(@unovis/ts@1.2.1)(vue@3.3.7)
'@vee-validate/zod': '@vee-validate/zod':
specifier: ^4.11.8 specifier: ^4.11.8
version: 4.11.8(vue@3.3.7) version: 4.11.8(vue@3.3.7)
@ -235,7 +230,7 @@ importers:
version: 2.4.2 version: 2.4.2
radix-vue: radix-vue:
specifier: ^1.1.0 specifier: ^1.1.0
version: 1.1.0(vue@3.3.7) version: 1.1.1(vue@3.3.7)
recast: recast:
specifier: ^0.23.4 specifier: ^0.23.4
version: 0.23.4 version: 0.23.4
@ -2175,10 +2170,6 @@ packages:
'@types/d3-zoom': 3.0.8 '@types/d3-zoom': 3.0.8
dev: false dev: false
/@types/dagre@0.7.52:
resolution: {integrity: sha512-XKJdy+OClLk3hketHi9Qg6gTfe1F3y+UFnHxKA2rn9Dw+oXa4Gb378Ztz9HlMgZKSxpPmn4BNVh9wgkpvrK1uw==}
dev: false
/@types/diff@5.0.3: /@types/diff@5.0.3:
resolution: {integrity: sha512-amrLbRqTU9bXMCc6uX0sWpxsQzRIo9z6MJPkH1pkez/qOxuqSZVuryJAWoBRq94CeG8JxY+VK4Le9HtjQR5T9A==} resolution: {integrity: sha512-amrLbRqTU9bXMCc6uX0sWpxsQzRIo9z6MJPkH1pkez/qOxuqSZVuryJAWoBRq94CeG8JxY+VK4Le9HtjQR5T9A==}
dev: true dev: true
@ -2579,15 +2570,14 @@ packages:
lodash-es: 4.17.21 lodash-es: 4.17.21
dev: false dev: false
/@unovis/ts@1.3.0: /@unovis/ts@1.2.1:
resolution: {integrity: sha512-LHUNDVzStCDu1JS7jiEjWRT1dL5my5B6nKkXFBKmz7Elwy+2zQ4KmLNE7oDHsMvgINzH6Gg1NwqGbrkn6E2ctA==} resolution: {integrity: sha512-787MjSqvfgN+YlOlA3pz39E7ozky1CWlTioROZXeSa0gCkQhfaacOaUAYcDEgyAhU8oHkByG5keCN7eP7hoUlg==}
dependencies: dependencies:
'@emotion/css': 11.11.2 '@emotion/css': 11.11.2
'@juggle/resize-observer': 3.4.0 '@juggle/resize-observer': 3.4.0
'@types/d3': 7.4.3 '@types/d3': 7.4.3
'@types/d3-collection': 1.0.13 '@types/d3-collection': 1.0.13
'@types/d3-sankey': 0.11.2 '@types/d3-sankey': 0.11.2
'@types/dagre': 0.7.52
'@types/geojson': 7946.0.13 '@types/geojson': 7946.0.13
'@types/leaflet': 1.7.6 '@types/leaflet': 1.7.6
'@types/supercluster': 5.0.3 '@types/supercluster': 5.0.3
@ -2616,16 +2606,15 @@ packages:
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
/@unovis/vue@1.3.0(patch_hash=ngtngm7gel5uviv7fhlhavdy3a)(@unovis/ts@1.3.0)(vue@3.3.7): /@unovis/vue@1.3.0(@unovis/ts@1.2.1)(vue@3.3.7):
resolution: {integrity: sha512-t/72dKYDBJ1p+8wINxVdGwjst6YRqImEpJMyJdHvFn5Opl4SD0say35eGHmX9HH3f7yDLMtMQyQUE9Ure8eyIQ==} resolution: {integrity: sha512-t/72dKYDBJ1p+8wINxVdGwjst6YRqImEpJMyJdHvFn5Opl4SD0say35eGHmX9HH3f7yDLMtMQyQUE9Ure8eyIQ==}
peerDependencies: peerDependencies:
'@unovis/ts': 1.2.1 '@unovis/ts': 1.2.1
vue: ^3 vue: ^3
dependencies: dependencies:
'@unovis/ts': 1.3.0 '@unovis/ts': 1.2.1
vue: 3.3.7(typescript@5.2.2) vue: 3.3.7(typescript@5.2.2)
dev: false dev: false
patched: true
/@vee-validate/zod@4.11.8(vue@3.3.7): /@vee-validate/zod@4.11.8(vue@3.3.7):
resolution: {integrity: sha512-qAyqDEigklMf669ZqIw9t95g0Ipzu9rMYUqcZpANlCvyaIAeBlJGcsv+2CewlqgwuC6BL9EAURLJ8Ux5WlBgXg==} resolution: {integrity: sha512-qAyqDEigklMf669ZqIw9t95g0Ipzu9rMYUqcZpANlCvyaIAeBlJGcsv+2CewlqgwuC6BL9EAURLJ8Ux5WlBgXg==}
@ -7716,16 +7705,6 @@ packages:
resolution: {integrity: sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==} resolution: {integrity: sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==}
dev: false dev: false
/radix-vue@1.1.0(vue@3.3.7):
resolution: {integrity: sha512-xD8pIxzng7Gi/pypZ7HeoSkYbBRHzFDnHJjEmGzq59SDa6gjKAuG4NPkWvdFjUGASWHLSOnofZXZJs+auDtSOQ==}
dependencies:
'@floating-ui/dom': 1.5.3
'@floating-ui/vue': 1.0.2(vue@3.3.7)
transitivePeerDependencies:
- '@vue/composition-api'
- vue
dev: false
/radix-vue@1.1.1(vue@3.3.7): /radix-vue@1.1.1(vue@3.3.7):
resolution: {integrity: sha512-tKXwEyxJdQRdCGVhe9rjPcbluDUhtzNJ4hKd66KwP+DAgcgbLELp2xyV/3mMl3htH3y5h7ndy9aEASy/thFs5g==} resolution: {integrity: sha512-tKXwEyxJdQRdCGVhe9rjPcbluDUhtzNJ4hKd66KwP+DAgcgbLELp2xyV/3mMl3htH3y5h7ndy9aEASy/thFs5g==}
dependencies: dependencies: