diff --git a/docs/mds/components/cell/version.md b/docs/mds/components/cell/version.md index 3886e463..149884a4 100644 --- a/docs/mds/components/cell/version.md +++ b/docs/mds/components/cell/version.md @@ -1,3 +1,8 @@ +## 1.0.0-next.7 + +- [!tag|B|3|]修复右侧箭头未垂直居中问题。 +- [!tag|O|0|]减少左右两侧间距。 + ## 0.2.11 - [!tag|B|2|]修复左右区域上下居中对齐问题。 diff --git a/docs/mds/components/cell/version_en.md b/docs/mds/components/cell/version_en.md index 45d16b30..7ba59ad6 100644 --- a/docs/mds/components/cell/version_en.md +++ b/docs/mds/components/cell/version_en.md @@ -1,3 +1,8 @@ +## 1.0.0-next.7 + +- [!tag|B|3|]Fix the problem that the right arrow is not vertically centered. +- [!tag|O|0|]Reduce the distance between the left and right sides. + ## 0.2.11 - [!tag|B|2|]Fix the problem of up and down alignment in the left and right areas. diff --git a/docs/mds/components/navBar/api.md b/docs/mds/components/navBar/api.md index 54ca91de..e43a3c9e 100644 --- a/docs/mds/components/navBar/api.md +++ b/docs/mds/components/navBar/api.md @@ -1,13 +1,14 @@ ## NavBar Props -| 名称 | 类型 | 默认值 | 必传 | 说明 | -| -------- | ------------------------------------------------------------------------- | ----------------------- | ---- | ---------------------------------------------------------- | -| title | `string` | 当前语言的 navBar.title | N | 标题。 | -| left | `'back'\|null`\|[`Icon`](https://stdf.design/#/components?nav=icon&tab=1) | `'back'` | N | 左侧内容,`'back'` 返回图标,`null` 无内容,否则渲染图标。 | -| rights | [`Icon[]`](https://stdf.design/#/components?nav=icon&tab=1) | `[]` | N | 右侧内容,Icon Props 组成的数组,建议不超过三个。 | -| line | `boolean` | `true` | N | 是否显示底部分割线。 | -| injClass | `string` | `''` | N | 注入 CSS 名称。 | -| love | `boolean` | `false` | N | 是否开启关爱版。 | +| 名称 | 类型 | 默认值 | 必传 | 说明 | +| ---------- | ------------------------------------------------------------------------- | ----------------------- | ---- | ---------------------------------------------------------- | +| title | `string` | 当前语言的 navBar.title | N | 标题。 | +| titleAlign | `'left'\|'center'\|'right'` | `'left'` | N | 标题对齐方式。 | +| left | `'back'\|null`\|[`Icon`](https://stdf.design/#/components?nav=icon&tab=1) | `'back'` | N | 左侧内容,`'back'` 返回图标,`null` 无内容,否则渲染图标。 | +| rights | [`Icon[]`](https://stdf.design/#/components?nav=icon&tab=1) | `[]` | N | 右侧内容,Icon Props 组成的数组,建议不超过三个。 | +| line | `boolean` | `true` | N | 是否显示底部分割线。 | +| injClass | `string` | `''` | N | 注入 CSS 名称。 | +| love | `boolean` | `false` | N | 是否开启关爱版。 | ## NavBar Events diff --git a/docs/mds/components/navBar/api_en.md b/docs/mds/components/navBar/api_en.md index 90c434a6..d9b9ee50 100644 --- a/docs/mds/components/navBar/api_en.md +++ b/docs/mds/components/navBar/api_en.md @@ -1,13 +1,14 @@ ## NavBar Props -| Name | Type | Default | Required | Description | -| -------- | ------------------------------------------------------------------------- | ----------------------------- | -------- | ----------------------------------------------------------------------------------- | -| title | `string` | Current language navBar.title | N | Title text. | -| left | `'back'\|null`\|[`Icon`](https://stdf.design/#/components?nav=icon&tab=1) | `'back'` | N | Left content, `'back'` for back icon, `null` for no content, otherwise render icon. | -| rights | [`Icon[]`](https://stdf.design/#/components?nav=icon&tab=1) | `[]` | N | Right content array of Icon Props, recommend no more than 3 icons. | -| line | `boolean` | `true` | N | Whether to show bottom divider line. | -| injClass | `string` | `''` | N | Inject CSS class name. | -| love | `boolean` | `false` | N | Whether to enable care version. | +| Name | Type | Default | Required | Description | +| ---------- | ------------------------------------------------------------------------- | ----------------------------- | -------- | ----------------------------------------------------------------------------------- | +| title | `string` | Current language navBar.title | N | Title text. | +| titleAlign | `'left'\|'center'\|'right'` | `'left'` | N | Title alignment. | +| left | `'back'\|null`\|[`Icon`](https://stdf.design/#/components?nav=icon&tab=1) | `'back'` | N | Left content, `'back'` for back icon, `null` for no content, otherwise render icon. | +| rights | [`Icon[]`](https://stdf.design/#/components?nav=icon&tab=1) | `[]` | N | Right content array of Icon Props, recommend no more than 3 icons. | +| line | `boolean` | `true` | N | Whether to show bottom divider line. | +| injClass | `string` | `''` | N | Inject CSS class name. | +| love | `boolean` | `false` | N | Whether to enable care version. | ## NavBar Events diff --git a/docs/mds/components/navBar/version.md b/docs/mds/components/navBar/version.md index e69de29b..9a85b5e5 100644 --- a/docs/mds/components/navBar/version.md +++ b/docs/mds/components/navBar/version.md @@ -0,0 +1,3 @@ +## 1.0.0-next.7 + +- [!tag|A|0|]新增 titleAlign 属性。 diff --git a/docs/mds/components/navBar/version_en.md b/docs/mds/components/navBar/version_en.md index e69de29b..8f5d6c5f 100644 --- a/docs/mds/components/navBar/version_en.md +++ b/docs/mds/components/navBar/version_en.md @@ -0,0 +1,3 @@ +## 1.0.0-next.7 + +- [!tag|A|0|]Add titleAlign property. diff --git a/docs/mds/guide/changelog.md b/docs/mds/guide/changelog.md index 328d1d8a..40de90de 100644 --- a/docs/mds/guide/changelog.md +++ b/docs/mds/guide/changelog.md @@ -1,3 +1,7 @@ +## 1.0.0-next.7 2024-12-16 + +- 增强 NavBar 组件,详见 [NavBar](https://next.stdf.design/components?nav=navBar&tab=4)。 + ## 1.0.0-next.6 2024-12-03 - 新增多语言文件。 diff --git a/docs/mds/guide/changelog_en.md b/docs/mds/guide/changelog_en.md index feee15bb..c7d8a454 100644 --- a/docs/mds/guide/changelog_en.md +++ b/docs/mds/guide/changelog_en.md @@ -1,3 +1,7 @@ +## 1.0.0-next.7 2024-12-16 + +- Enhanced NavBar component, please see [NavBar](https://next.stdf.design/components?nav=navBar&tab=4). + ## 1.0.0-next.6 2024-12-03 - Added multi-language files. diff --git a/packages/stdf/package.json b/packages/stdf/package.json index b5d7ed8c..086cea83 100644 --- a/packages/stdf/package.json +++ b/packages/stdf/package.json @@ -1,6 +1,6 @@ { "name": "stdf", - "version": "1.0.0-next.6", + "version": "1.0.0-next.7", "description": "Mobile web component library based on Svelte and Tailwind", "author": "any-tdf", "funding": "https://stdf.design?fund", diff --git a/packages/stdf/src/lib/components/cell/Cell.svelte b/packages/stdf/src/lib/components/cell/Cell.svelte index 44379c9f..e91fdfac 100644 --- a/packages/stdf/src/lib/components/cell/Cell.svelte +++ b/packages/stdf/src/lib/components/cell/Cell.svelte @@ -88,14 +88,14 @@
-
+
{#if detailChild} {@render detailChild?.()} diff --git a/packages/stdf/src/lib/components/navBar/NavBar.svelte b/packages/stdf/src/lib/components/navBar/NavBar.svelte index 27ef241e..ab8a0b1b 100644 --- a/packages/stdf/src/lib/components/navBar/NavBar.svelte +++ b/packages/stdf/src/lib/components/navBar/NavBar.svelte @@ -11,6 +11,7 @@ let { title = navBarLang.title, + titleAlign = 'left', left = 'back', rights = [], line = true, @@ -26,6 +27,10 @@ //图标大小 //Icon size const iconSize = love ? 30 : 24; + + // 标题对齐方式 + // Title alignment + const titleAlignClass = { left: 'text-left', center: 'text-center', right: 'text-right' };
{title}
{/if}
diff --git a/packages/stdf/src/lib/types/index.ts b/packages/stdf/src/lib/types/index.ts index 6f3268e1..3f5163b2 100644 --- a/packages/stdf/src/lib/types/index.ts +++ b/packages/stdf/src/lib/types/index.ts @@ -388,6 +388,7 @@ export type ModalProps = { export type NavBarProps = { title?: string; + titleAlign?: 'left' | 'center' | 'right'; left?: 'back' | null | IconProps; rights?: IconProps[]; line?: boolean; diff --git a/packages/stdf/src/routes/navBar/en_US/+page.svelte b/packages/stdf/src/routes/navBar/en_US/+page.svelte index 6b6c19c0..2b7e76b3 100644 --- a/packages/stdf/src/routes/navBar/en_US/+page.svelte +++ b/packages/stdf/src/routes/navBar/en_US/+page.svelte @@ -16,6 +16,7 @@
+ (visible1 = true)} /> - +
{/snippet} diff --git a/packages/stdf/src/routes/navBar/zh_CN/+page.svelte b/packages/stdf/src/routes/navBar/zh_CN/+page.svelte index dff7bec0..352917de 100644 --- a/packages/stdf/src/routes/navBar/zh_CN/+page.svelte +++ b/packages/stdf/src/routes/navBar/zh_CN/+page.svelte @@ -16,6 +16,7 @@
+ (visible1 = true)} /> - +
{/snippet}