Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps-dev): Bump vue-tsc from 2.1.10 to 2.2.0 #3336

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 42 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kuma-gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"vite-svg-loader": "^5.1.0",
"vitepress": "^1.6.1",
"vitest": "^3.0.2",
"vue-tsc": "^2.1.10"
"vue-tsc": "^2.2.0"
},
"browserslist": [
"> 1%",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,20 @@
<template
v-for="key in Object.keys(slots)"
:key="key"
#[key]="{ row, rowValue }"
#[key]="{ row }"
>
<slot
v-if="(props.items ?? []).length > 0"
:name="key"
:row="row as Row"
:row-value="rowValue"
/>
</template>
</KTable>
</template>

<script lang="ts" setup generic="Row extends {}">
import { KTable } from '@kong/kongponents'
import { useSlots, ref, watch, Ref, inject } from 'vue'
import { ref, watch, Ref, inject } from 'vue'

import { runInDebug } from '../../'
import type { TableHeader as KTableHeader, TablePreferences } from '@kong/kongponents'
Expand Down Expand Up @@ -85,7 +84,11 @@ const emit = defineEmits<{
(e: 'resize', value: ResizeValue): void
}>()

const slots = useSlots()
const slots = defineSlots<{
[key: string]: (props: {
row: Row
}) => any
}>()

const items = ref(props.items) as Ref<typeof props.items>
const cacheKey = ref<number>(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}"
>
<header
v-if="$slots.title || $slots.actions"
v-if="slots.title || slots.actions"
class="app-view-title-bar"
>
<KongIcon v-if="props.fullscreen" />
Expand All @@ -41,7 +41,7 @@
class="actions"
>
<XTeleportSlot
v-if="$slots.title"
v-if="slots.title"
name="app-view-docs"
/>
<slot name="actions">
Expand All @@ -50,7 +50,9 @@
</div>
</header>

<aside v-if="$slots.notifications">
<aside
v-if="slots.notifications"
>
<XAlert
class="mb-4"
variant="warning"
Expand Down Expand Up @@ -96,10 +98,6 @@ type AppView = {
}
type Breadcrumbs = Map<symbol, BreadcrumbItem[]>

const routeView = inject<RouteView>(ROUTE_VIEW_PARENT)!

const summary: string = inject('app-summary-view', '')
provide('app-summary-view', '')

const props = withDefaults(defineProps<{
breadcrumbs?: BreadcrumbItem[] | null
Expand All @@ -110,7 +108,12 @@ const props = withDefaults(defineProps<{
fullscreen: false,
docs: '',
})
const slots = defineSlots()

const routeView = inject<RouteView>(ROUTE_VIEW_PARENT)!

const summary: string = inject('app-summary-view', '')
provide('app-summary-view', '')
const map: Breadcrumbs = new Map()
const _breadcrumbs = ref<BreadcrumbItem[]>([])
const symbol = Symbol('app-view')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
>
<slot
name="error"
:data="srcData"
:data="srcData as TypeOf<T>"
:error="allErrors[0]"
:refresh="props.src !== '' ? refresh : () => {}"
>
Expand All @@ -61,7 +61,7 @@
<slot
v-if="props.loader && typeof slots.loadable === 'undefined'"
name="connecting"
:data="srcData"
:data="undefined"
:error="srcError"
:refresh="props.src !== '' ? refresh : () => {}"
>
Expand All @@ -86,7 +86,7 @@
typeOf(): any
}" setup
>
import { computed, ref, useSlots, provide } from 'vue'
import { computed, ref, provide } from 'vue'

import type { TypeOf } from '@/app/application'
import ErrorBlock from '@/app/common/ErrorBlock.vue'
Expand All @@ -103,12 +103,38 @@ const props = withDefaults(defineProps<{
loader: true,
variant: 'default',
})
const slots = defineSlots<{
default(props: {
data: NonNullable<TypeOf<T>>
error: Error | undefined
refresh: () => void
}): any
connecting(props: {
data: undefined
error: Error | undefined
refresh: () => void
}): any
error(props: {
data: NonNullable<TypeOf<T>>
error: Error | undefined
refresh: () => void
}): any
disconnected(props: {
data: NonNullable<TypeOf<T>>
error: Error | undefined
refresh: () => void
}): any
loadable(props: {
data: NonNullable<TypeOf<T>>
error: Error | undefined
refresh: () => void
}): any
}>()

provide('data-loader', {
props,
})

const slots = useSlots()

const srcData = ref<unknown>(undefined)
const srcError = ref<Error | undefined>(undefined)
Expand Down
10 changes: 6 additions & 4 deletions packages/kuma-gui/src/app/common/ErrorBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</div>

<div class="error-block-message mt-4">
<slot v-if="$slots.default" />
<slot v-if="slots.default" />
<template
v-else-if="props.error instanceof ApiError"
>
Expand Down Expand Up @@ -87,7 +87,7 @@
<div
class="error-block-message"
>
<slot v-if="$slots.default" />
<slot v-if="slots.default" />
<template
v-else-if="props.error instanceof ApiError"
>
Expand Down Expand Up @@ -123,15 +123,17 @@ import { inject } from 'vue'
import { useI18n } from '@/app/application'
import { ApiError } from '@/app/kuma/services/kuma-api/ApiError'

const { t } = useI18n()
const prompt = inject('x-prompt', undefined)

const props = withDefaults(defineProps<{
error: Error
appearance?: 'warning' | 'danger'
}>(), {
appearance: 'warning',
})
const slots = defineSlots()

const { t } = useI18n()
const prompt = inject('x-prompt', undefined)
</script>

<style lang="scss" scoped>
Expand Down
3 changes: 2 additions & 1 deletion packages/kuma-gui/src/app/common/ResourceStatus.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<DefinitionCard>
<template
v-if="$slots.icon"
v-if="slots.icon"
#icon
>
<slot name="icon" />
Expand Down Expand Up @@ -38,6 +38,7 @@ const props = withDefaults(defineProps<{
}>(), {
online: undefined,
})
const slots = defineSlots()
</script>

<style lang="scss" scoped>
Expand Down
Loading
Loading