Skip to content

Commit fa03fb3

Browse files
committed
docs: update theme
1 parent ac561c1 commit fa03fb3

File tree

5 files changed

+34
-20
lines changed

5 files changed

+34
-20
lines changed

docs/.vuepress/config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,15 @@ export default defineUserConfig<DefaultThemeOptions>({
242242
text: 'Pagination',
243243
link: `/${pkg.config.version_short}/components/pagination.html`,
244244
},
245+
{
246+
text: 'Placeholders',
247+
link: `/${pkg.config.version_short}/components/placeholders.html`,
248+
disabled: true,
249+
badge: {
250+
color: 'warning',
251+
text: 'WIP v4.1',
252+
}
253+
},
245254
{
246255
text: 'Popover',
247256
link: `/${pkg.config.version_short}/components/popover.html`,

docs/.vuepress/theme-coreui/src/client/components/SidebarNav.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RouterLink, useRoute } from 'vue-router'
44
import type { RouteLocationNormalizedLoaded } from 'vue-router'
55
import type { ResolvedSidebarItem } from '../../shared'
66

7-
import { CNavGroup, CNavItem, CSidebarNav } from './../../../../../../src'
7+
import { CBadge, CNavGroup, CNavItem, CSidebarNav } from './../../../../../../src'
88
import { CIcon } from '@coreui/icons-vue'
99

1010
const normalizePath = (path: string): string =>
@@ -76,20 +76,28 @@ const renderItem = (item: ResolvedSidebarItem): VNode => {
7676
CNavItem,
7777
{
7878
active: props.isActive,
79+
disabled: item.disabled,
7980
href: item.link,
8081
},
8182
{
82-
default: () => item.text,
83+
default: () => [
84+
item.text,
85+
item.badge &&
86+
h(
87+
CBadge,
88+
{
89+
class: 'ms-auto',
90+
color: item.badge.color,
91+
},
92+
item.badge.text,
93+
),
94+
],
8395
},
8496
),
8597
},
8698
)
8799
}
88100

89-
// export default defineComponent({
90-
91-
// })
92-
93101
export const SidebarNav = ({ items }) => {
94102
return h(
95103
CSidebarNav,

docs/.vuepress/theme-coreui/src/client/layouts/Layout.vue

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,6 @@ export default defineComponent({
9696
frontmatter.value.pageClass,
9797
])
9898
99-
// close sidebar after navigation
100-
let unregisterRouterHook
101-
onMounted(() => {
102-
const router = useRouter()
103-
unregisterRouterHook = router.afterEach(() => {
104-
toggleSidebar(false)
105-
})
106-
})
107-
onUnmounted(() => {
108-
unregisterRouterHook()
109-
})
110-
11199
// handle scrollBehavior with transition
112100
const scrollPromise = useScrollPromise()
113101
const onBeforeEnter = scrollPromise.resolve
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
.docs-sidebar {
22
--cui-sidebar-bg: #f0f4f7;
33
--cui-sidebar-brand-bg: transparent;
4-
--cui-sidebar-brand-color: rgba(44, 56, 74, 0.95);
5-
--cui-sidebar-nav-link-color: rgba(44, 56, 74, 0.95);
4+
--cui-sidebar-brand-color: rgba(44,56,74,0.87);
5+
--cui-sidebar-nav-link-color: rgba(44,56,74,0.87);
66
--cui-sidebar-nav-link-active-color: #321fdb;
77
--cui-sidebar-nav-link-hover-color: #321fdb;
88
--cui-sidebar-nav-group-bg: transparent;
99
--cui-sidebar-nav-group-toggle-show-color: #321fdb;
10+
--cui-sidebar-nav-link-disabled-color: #{$text-disabled};
1011
}

docs/.vuepress/theme-coreui/src/shared/nav.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
/**
22
* Base nav item, displayed as text
33
*/
4+
5+
type Badge = {
6+
color: string,
7+
text: string
8+
}
49
export interface NavItem {
10+
badge?: Badge
11+
disabled?: boolean
12+
icon?: string
513
text: string
614
ariaLabel?: string
715
}

0 commit comments

Comments
 (0)