From d9f6fb8b75c2d19b4c49791b9fd0222e61556a91 Mon Sep 17 00:00:00 2001 From: portikM Date: Fri, 29 Nov 2024 14:45:00 -0500 Subject: [PATCH 1/5] fix(kcodeblock): ts error [KHCP-11924] --- src/components/KCodeBlock/KCodeBlock.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/KCodeBlock/KCodeBlock.vue b/src/components/KCodeBlock/KCodeBlock.vue index 84b9506730..1e11385951 100644 --- a/src/components/KCodeBlock/KCodeBlock.vue +++ b/src/components/KCodeBlock/KCodeBlock.vue @@ -397,7 +397,7 @@ const matchingLineNumbers = ref([]) const currentLineIndex = ref(null) const totalLines = computed((): number[] => Array.from({ length: props.code?.split('\n').length }, (_, index) => index + 1)) -const maxLineNumberWidth = computed((): string => totalLines.value[totalLines.value.length - 1]?.toString().length + 'ch') +const maxLineNumberWidth = computed((): string => totalLines.value[totalLines.value?.length - 1]?.toString().length + 'ch') const linePrefix = computed((): string => props.id.toLowerCase().replace(/\s+/g, '-')) const isProcessing = computed((): boolean => props.processing || isProcessingInternally.value) const isShowingFilteredCode = computed((): boolean => isFilterMode.value && filteredCode.value !== '') From 5dcf284dab4890125b791a2e4192650557749788 Mon Sep 17 00:00:00 2001 From: portikM Date: Fri, 29 Nov 2024 14:45:34 -0500 Subject: [PATCH 2/5] fix(ktabs): allow tab anchores to be links [KHCP-13866] --- docs/components/tabs.md | 96 ++++++++++++++++++++------------ sandbox/pages/SandboxTabs.vue | 20 ++----- src/components/KTabs/KTabs.cy.ts | 36 +++++++++++- src/components/KTabs/KTabs.vue | 72 ++++++++++++------------ src/types/tabs.ts | 3 + 5 files changed, 135 insertions(+), 92 deletions(-) diff --git a/docs/components/tabs.md b/docs/components/tabs.md index f99fcfdcbc..49001b89cd 100644 --- a/docs/components/tabs.md +++ b/docs/components/tabs.md @@ -30,12 +30,18 @@ Required prop, which is an array of tab objects with the following interface: ```ts interface Tab { - hash: string // has to be unique, corresponds to the panel slot name + hash: string title: string - disabled?: boolean + disabled?: boolean, + to?: string | object } ``` +* `hash` - has to be unique, corresponds to the panel slot name +* `title` - title to be displayed in the tab +* `disabled` - whether or not tab is disabled +* `to` - if present, tab will be rendered as either a `router-link` or an `a` +