Skip to content

Commit

Permalink
📝 docs: add v1-7-0 notification (#2124)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem authored Sep 2, 2024
1 parent dfd448e commit 165f9d3
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 50 deletions.
50 changes: 8 additions & 42 deletions docs/Masa.Blazor.Docs/wwwroot/data/notifications.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,31 @@
[
{
"title": "v1.3.2 Release",
"content": "Highlights:\r\n- **Theme**: support for more color roles.",
"type": 0,
"href": "/blazor/getting-started/release-notes?v=v1.3.2",
"createdAt": "2024-01-09"
},
{
"title": "v1.3.3 Release",
"content": "Highlights:\r\n- **Dialog**: fix the issue that dialog may not be clickable in low network speed scenarios.\r\n- **Image**: should show placeholder when set `Src` to null.",
"type": 0,
"href": "/blazor/getting-started/release-notes?v=v1.3.3",
"createdAt": "2024-01-22"
},
{
"title": "v1.3.4 Release",
"content": "Highlights:\r\n- **ScrollToTarget**: new component that supports automatic scrolling to the specified element and highlighting of the active item.",
"type": 0,
"href": "/blazor/getting-started/release-notes?v=v1.3.4",
"createdAt": "2024-01-26"
},
{
"title": "v1.4.0 Release",
"content": "We provides a best practice example of how to integrate MAUI hybrid with MASA Blazor. You can find the repository at [Masa.Blazor.MauiDemo](https://github.com/masastack/Masa.Blazor.MauiDemo).\r\nHighlights:\r\n- **Overlay**: add fade transition animation, use *block* scroll strategy, and update the bg color of scrim.\r\n- **PageStack**: new component that provides a container similar to a page stack, mainly for mobile.\r\n- **PageTabs**: add the `Closeable` state to tabs, hover to display the close button.\r\n- **Sortable**: new component for replacing the DragZone component.",
"type": 0,
"href": "/blazor/getting-started/release-notes?v=v1.4.0",
"createdAt": "2024-04-07"
},
{
"title": "v1.4.1 Release",
"content": "Highlights:\r\n- **Theme**: add support for OnError, OnInfo, OnSuccess, OnWarning, InverseSurface, InverseOnSurface and InversePrimary color roles.\r\n- **Snackbar**: Use reverse-surface color as the background color.",
"type": 0,
"href": "/blazor/getting-started/release-notes?v=v1.4.1",
"createdAt": "2024-04-17"
},
{
"title": "v1.4.2 Release",
"content": "Highlights:\r\n- **EnqueuedSnackbars**: Reset position when app bottom or top changed.\r\n- **BottomNavigation**: Reset the bottom of app to 0 if disposing.",
"type": 0,
"href": "/blazor/getting-started/release-notes?v=v1.4.2",
"createdAt": "2024-04-22"
},
{
"title": "v1.5.0 Release",
"content": "Highlights:\r\n- **Button**: add `IconName`, `LeftIconName` and `RightIconName` to simplify the usage of icon buttons.\r\n- **Card**: add sub-component parameter, includes `Title`, `Subtitle` and `Text`.\r\n- **DataTable**: add support for cell ellipsis and custom cell content in `Headers`.\r\n- **ListItem**: add sub-component parameters, includes `Title`, `Subtitle`, `PrependAvatar`, `PrependIcon`, `AppendAvatar` and `AppendIcon`.",
"type": 0,
"href": "/blazor/getting-started/release-notes?v=v1.5.0",
"createdAt": "2024-05-07"
},
{
"title": "v1.5.1 Release",
"content": "Bug fixes and documentation updates.",
"type": 0,
"href": "/blazor/getting-started/release-notes?v=v1.5.1",
"createdAt": "2024-05-10"
},
{
"title": "v1.6.0",
"content": "Highlight:\r\n- Remove all references to BlazorComponent.\r\n- **ExpansionPanel**: add sub-component parameters, including `Title` and `Text`.\r\n- **Form**: the context object provided by `ChildContent` now offers `Validate`, `Reset`, and `ResetValidation` methods, as well as an `IsValid` property.",
"type": 0,
"href": "/blazor/getting-started/release-notes?v=v1.6.0",
"createdAt": "2024-07-02"
},
{
"title": "v1.7.0",
"content": "Highlight:\r\n- **PdfMobileViewer**: a PDF viewer designed for mobile.\r\n- **Toggle**: a wrapper that allows you to toggle between two states.\r\n- **AppThemeStylesheet**: using for avoiding the brief flicker when application is loaded, more details can ben found in the docs.\r\n- **DateTimePicker**: a default **MTextField** component is built-in now, and you can customize the MTextField component using the **PDefaultDateTimePickerActivator**.\r\n- **Form**: auto label generation, built-in complex type validation, setting the validation timing by the `ValidateOn` property.\r\n- **PageStack**: support going back to a specific page or delta, and optionally replacing it with a new page.",
"type": 0,
"href": "/blazor/getting-started/release-notes?v=v1.7.0",
"upgradeGuide": "/blazor/getting-started/upgrade-guide#upgrading-from-v1-6-x-to-v1-7-0",
"createdAt": "2024-09-02"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ DataAnnotations validation now natively supports complex types, no need to refer
}
```

#### Treeview {#v1-7-0-treeview}

After enabling the `Selectable` property, you can now select by clicking on the row. To disable this functionality, you need to set `SelectOnRowClick` to `false`.

```diff
<MTreeview @bind-Value="_selected"
+ SelectOnRowClick="false"
Selectable="true">
</MTreeview>
```

## Upgrading form v1.5.x to v1.6.0

### Change the script
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ DataAnnotations 验证现在内置支持复杂类型,不需要引用额外的
}
```

#### Treeview {#v1-7-0-treeview}

现在应用 `Selectable` 属性后,可以通过单击行来选择。要禁用此功能,需要将 `SelectOnRowClick` 设置为 `false`

```diff
<MTreeview @bind-Value="_selected"
+ SelectOnRowClick="false"
Selectable="true">
</MTreeview>
```

## 从 v1.5.x 升级到 v1.6.0

### 更改脚本
Expand Down
19 changes: 13 additions & 6 deletions docs/Masa.Docs.Shared/Components/Menus/NotificationsMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@{
var outline = _menu ? "" : "-outline";
}
<MToggle Value="UnreadNotifications.Count > 0"
<MToggle Value="UnreadNotifications.Count > 0"
DataOn="@($"mdi-bell-ring{outline}")"
DataOff="@($"mdi-bell{outline}")"
Context="toggleContext">
Expand Down Expand Up @@ -41,7 +41,7 @@
}
</MButton>
</MToolbar>
<MDivider />
<MDivider/>
<MResponsive MaxHeight="340"
MinHeight="204"
Style="overflow-y: scroll">
Expand All @@ -52,7 +52,7 @@
@I18n.T("notifications.done", ReadNotifications.Count)
</p>

<MIcon Icon="@("$masaBlazor")" Size="96" Color="#D7D7D7" />
<MIcon Icon="@("$masaBlazor")" Size="96" Color="#D7D7D7"/>
</div>
}
else
Expand All @@ -62,7 +62,7 @@
{
if (index != 0)
{
<MDivider Class="my-1" />
<MDivider Class="my-1"/>
}

<MListItem Ripple="false">
Expand All @@ -81,8 +81,15 @@

<MChip Outlined Small Href="@item.Href" OnClick="@(() => OnClick(item))">
@I18n.T($"notifications.{item.HrefText}")
<MIcon XSmall Icon="@("mdi-open-in-new")" Class="ml-1" />
<MIcon XSmall Icon="@("mdi-open-in-new")" Class="ml-1"/>
</MChip>
@if (item.UpgradeGuide != null)
{
<MChip Outlined Small Href="@item.UpgradeGuide" Class="ml-2">
@I18n.T($"notifications.upgrade-guide")
<MIcon XSmall Icon="@("mdi-open-in-new")" Class="ml-1"/>
</MChip>
}
</div>
</MListItemContent>
@if (!_showArchived)
Expand All @@ -99,4 +106,4 @@
}
</MResponsive>
</ChildContent>
</AppMenuCustom>
</AppMenuCustom>
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public NotificationItem(string title,
public NotificationType Type { get; init; }

public string Href { get; init; }

public string? UpgradeGuide { get; init; }

public DateOnly CreatedAt { get; init; }

Expand Down
3 changes: 2 additions & 1 deletion docs/Masa.Docs.Shared/wwwroot/locale/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@
"viewUnread": "View unread({0})",
"done": "All done",
"release-notes": "Release notes",
"view-details": "View details"
"view-details": "View details",
"upgrade-guide": "Upgrade guide"
},
"intro": {
"blazor": {
Expand Down
3 changes: 2 additions & 1 deletion docs/Masa.Docs.Shared/wwwroot/locale/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,8 @@
"viewRead": "查看已读({0})",
"done": "全部完成",
"release-notes": "发行说明",
"view-details": "查看详情"
"view-details": "查看详情",
"upgrade-guide": "升级指南"
},
"intro": {
"blazor": {
Expand Down

0 comments on commit 165f9d3

Please sign in to comment.