@coffic/cosy-ui 0.8.28 → 0.8.29
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/dist/app.css +1 -1
- package/dist/index-astro.ts +0 -1
- package/dist/index-collection.ts +85 -84
- package/dist/src-astro/entities/CourseDoc.ts +75 -74
- package/dist/src-astro/entities/SidebarItem.ts +67 -65
- package/dist/src-astro/footer/Footer.astro +9 -14
- package/dist/src-astro/footer/FooterCopyright.astro +29 -0
- package/dist/src-astro/footer/FooterSection.astro +3 -0
- package/dist/src-astro/layout-dashboard/DashboardLayout.astro +21 -2
- package/dist/src-astro/layout-dashboard/types.ts +2 -2
- package/dist/src-astro/{sidebar-nav → sidebar}/SidebarNav.astro +17 -0
- package/dist/src-astro/sidebar/index.ts +2 -9
- package/dist/src-astro/types/sidebar.ts +28 -24
- package/package.json +1 -1
- package/dist/src-astro/sidebar/SidebarBasic.astro +0 -0
- package/dist/src-astro/sidebar-nav/SidebarNavBasic.astro +0 -32
- package/dist/src-astro/sidebar-nav/index.ts +0 -11
@@ -75,6 +75,11 @@ const debugClass = debug ? 'cosy:border cosy:border-red-500' : '';
|
|
75
75
|
debugClass,
|
76
76
|
]}>
|
77
77
|
{item.text}
|
78
|
+
{item.badge !== undefined && item.badge !== null && (
|
79
|
+
<span class="cosy:badge cosy:badge-sm cosy:ml-2">
|
80
|
+
{item.badge}
|
81
|
+
</span>
|
82
|
+
)}
|
78
83
|
</a>
|
79
84
|
{item.items && (
|
80
85
|
<ul class:list={[debugClass]}>
|
@@ -95,6 +100,12 @@ const debugClass = debug ? 'cosy:border cosy:border-red-500' : '';
|
|
95
100
|
debugClass,
|
96
101
|
]}>
|
97
102
|
{subitem.text}
|
103
|
+
{subitem.badge !== undefined &&
|
104
|
+
subitem.badge !== null && (
|
105
|
+
<span class="cosy:badge cosy:badge-xs cosy:ml-2">
|
106
|
+
{subitem.badge}
|
107
|
+
</span>
|
108
|
+
)}
|
98
109
|
</a>
|
99
110
|
{subitem.items && (
|
100
111
|
<ul class:list={[debugClass]}>
|
@@ -115,6 +126,12 @@ const debugClass = debug ? 'cosy:border cosy:border-red-500' : '';
|
|
115
126
|
debugClass,
|
116
127
|
]}>
|
117
128
|
{subsubitem.text}
|
129
|
+
{subsubitem.badge !== undefined &&
|
130
|
+
subsubitem.badge !== null && (
|
131
|
+
<span class="cosy:badge cosy:badge-xs cosy:ml-2">
|
132
|
+
{subsubitem.badge}
|
133
|
+
</span>
|
134
|
+
)}
|
118
135
|
</a>
|
119
136
|
</li>
|
120
137
|
);
|
@@ -1,11 +1,4 @@
|
|
1
1
|
import Sidebar from './Sidebar.astro';
|
2
|
-
import
|
3
|
-
import BasicSourceCode from './SidebarBasic.astro?raw';
|
4
|
-
import { extractSimpleExample } from '../../src/utils/component';
|
2
|
+
import SidebarNav from './SidebarNav.astro';
|
5
3
|
|
6
|
-
export { Sidebar,
|
7
|
-
|
8
|
-
// 导出示例源代码
|
9
|
-
export const SidebarExampleCodes = {
|
10
|
-
Basic: extractSimpleExample(BasicSourceCode, 'Sidebar'),
|
11
|
-
};
|
4
|
+
export { Sidebar, SidebarNav };
|
@@ -2,35 +2,39 @@
|
|
2
2
|
* 侧边栏项目
|
3
3
|
*/
|
4
4
|
export interface ISidebarItem {
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
href: string;
|
6
|
+
text: string;
|
7
|
+
items?: ISidebarItem[];
|
8
|
+
/**
|
9
|
+
* 可选徽标内容
|
10
|
+
*/
|
11
|
+
badge?: string | number;
|
8
12
|
}
|
9
13
|
|
10
14
|
/**
|
11
15
|
* 侧边栏配置
|
12
16
|
*/
|
13
17
|
export interface ISidebarProps {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
/**
|
19
|
+
* 侧边栏项目
|
20
|
+
*/
|
21
|
+
sidebarItems: ISidebarItem[];
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
/**
|
24
|
+
* 桌面端类名
|
25
|
+
*/
|
26
|
+
class?: string;
|
23
27
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
/**
|
29
|
+
* 是否开启调试模式,显示边框
|
30
|
+
* @default false
|
31
|
+
*/
|
32
|
+
debug?: boolean;
|
29
33
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
+
/**
|
35
|
+
* 侧边栏顶部外边距
|
36
|
+
*/
|
37
|
+
marginTop?:
|
34
38
|
| 'xs'
|
35
39
|
| 'sm'
|
36
40
|
| 'md'
|
@@ -42,10 +46,10 @@ export interface ISidebarProps {
|
|
42
46
|
| '5xl'
|
43
47
|
| string;
|
44
48
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
/**
|
50
|
+
* 侧边栏底部外边距
|
51
|
+
*/
|
52
|
+
marginBottom?:
|
49
53
|
| 'xs'
|
50
54
|
| 'sm'
|
51
55
|
| 'md'
|
package/package.json
CHANGED
File without changes
|
@@ -1,32 +0,0 @@
|
|
1
|
-
---
|
2
|
-
import SidebarNav from './SidebarNav.astro';
|
3
|
-
import type { ISidebarItem } from '../types/sidebar';
|
4
|
-
|
5
|
-
const sidebarItems: ISidebarItem[] = [
|
6
|
-
{
|
7
|
-
text: '入门指南',
|
8
|
-
href: '/docs/getting-started',
|
9
|
-
items: [
|
10
|
-
{ href: '/docs/getting-started/installation', text: '安装' },
|
11
|
-
{ href: '/docs/getting-started/quick-start', text: '快速开始' },
|
12
|
-
],
|
13
|
-
},
|
14
|
-
{
|
15
|
-
text: '基础组件',
|
16
|
-
href: '/docs/components',
|
17
|
-
items: [
|
18
|
-
{ href: '/docs/components/button', text: 'Button 按钮' },
|
19
|
-
{ href: '/docs/components/alert', text: 'Alert 提示' },
|
20
|
-
{ href: '/docs/components/card', text: 'Card 卡片' },
|
21
|
-
],
|
22
|
-
},
|
23
|
-
];
|
24
|
-
---
|
25
|
-
|
26
|
-
<div class="cosy:w-64 cosy:bg-base-100">
|
27
|
-
<SidebarNav
|
28
|
-
sidebarItems={sidebarItems}
|
29
|
-
currentPath="/docs/getting-started/installation"
|
30
|
-
debug={false}
|
31
|
-
/>
|
32
|
-
</div>
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import SidebarNav from './SidebarNav.astro';
|
2
|
-
import SidebarNavBasic from './SidebarNavBasic.astro';
|
3
|
-
import BasicSourceCode from './SidebarNavBasic.astro?raw';
|
4
|
-
import { extractSimpleExample } from '../../src/utils/component';
|
5
|
-
|
6
|
-
export { SidebarNav, SidebarNavBasic };
|
7
|
-
|
8
|
-
// 导出示例源代码
|
9
|
-
export const SidebarNavExampleCodes = {
|
10
|
-
Basic: extractSimpleExample(BasicSourceCode, 'SidebarNav'),
|
11
|
-
};
|