From c0197de70d725bda02e83cbeeb254bf84c77e1c4 Mon Sep 17 00:00:00 2001 From: Tony-ST0754 <6914529@qq.com> Date: Sun, 1 Nov 2026 15:52:09 +0800 Subject: [PATCH 01/68] =?UTF-8?q?feat(DateTimePicker):=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=9C=A8=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat(DateTimePicker):添加组件在移动端弹窗显示 --- .../DateTimePicker/DatePickerBody.razor | 18 ++-- .../DateTimePicker/DatePickerBody.razor.cs | 17 ++- .../DateTimePicker/DateTimePicker.razor | 56 ++++++++-- .../DateTimePicker/DateTimePicker.razor.cs | 88 ++++++++++++++- .../DateTimePicker/DateTimePicker.razor.js | 102 +++++++++++++++++- .../DateTimePicker/DateTimePicker.razor.scss | 71 ++++++++++++ 6 files changed, 321 insertions(+), 31 deletions(-) diff --git a/src/BootstrapBlazor/Components/DateTimePicker/DatePickerBody.razor b/src/BootstrapBlazor/Components/DateTimePicker/DatePickerBody.razor index 8db866aa238..2930e845105 100644 --- a/src/BootstrapBlazor/Components/DateTimePicker/DatePickerBody.razor +++ b/src/BootstrapBlazor/Components/DateTimePicker/DatePickerBody.razor @@ -1,25 +1,25 @@ -@namespace BootstrapBlazor.Components +@namespace BootstrapBlazor.Components @inherits BootstrapComponentBase
| @w | - } -
|---|
|
- @if (isOverflow)
- {
- -
- }
- else if (IsDisabled(day))
- {
-
- @if (ShowLunar)
- {
- @text
- @GetLunarText(day)
- }
- else if (DayDisabledTemplate != null)
- {
- @DayDisabledTemplate(day)
- }
- else
- {
- @text
- }
-
- }
- else
- {
- |
- }
-
|
- @if (isOverflow)
- {
- -
- }
- else
- {
- |
- }
-
|
- |
- }
-
| @w | } - - @if (!IsDisabled(DateTime.Today)) +
|---|
|
+ @if (isOverflow)
+ {
+ -
+ }
+ else if (IsDisabled(day))
+ {
+
+ @if (ShowLunar)
+ {
+ @text
+ @GetLunarText(day)
+ }
+ else if (DayDisabledTemplate != null)
+ {
+ @DayDisabledTemplate(day)
+ }
+ else
+ {
+ @text
+ }
+
+ }
+ else
+ {
+ |
+ }
+
|
+ |
+ }
+
ShowSidebar property value is set to true, the component displays the shortcut sidebar",
"SidebarTip": "by setting ShowSidebar The parameter enables the display sidebar shortcut options function, by setting SidebarItems The parameter collection replaces the default shortcuts built into the component",
diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json
index 04b333dc695..e449c246318 100644
--- a/src/BootstrapBlazor.Server/Locales/zh-CN.json
+++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json
@@ -1798,7 +1798,7 @@
"Limit": "时间范围",
"MaxMinValueIntro": "设置时间的取值范围",
"MaxMinValueTitle": "最大值和最小值",
- "NormalIntro": "以「日」为基本单位,选择一段时间",
+ "NormalIntro": "以「日」为基本单位,选择一段时间。移动端自动使用单面板弹窗,清空、今天和确定按钮位于弹窗底部;仅选择开始日期后,可通过标题栏的「重选」按钮重新选择开始日期",
"NormalTitle": "基本功能",
"SidebarIntro": "设置 ShowSidebar 属性值为 true 时,组件显示快捷方式侧边栏",
"SidebarTip": "通过设置 ShowSidebar 参数开启显示侧边栏快捷选项功能,通过设置 SidebarItems 参数集合替换组件内置的默认快捷项",
diff --git a/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.razor b/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.razor
index e418f132eb3..29a613be0d4 100644
--- a/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.razor
+++ b/src/BootstrapBlazor/Components/DateTimeRange/DateTimeRange.razor
@@ -6,7 +6,8 @@
{
| @w | + } +
|---|
|
+ @if (isOverflow)
+ {
+ -
+ }
+ else if (IsDisabled(day))
+ {
+
+ @if (ShowLunar)
+ {
+ @text
+ @GetLunarText(day)
+ }
+ else if (DayDisabledTemplate != null)
+ {
+ @DayDisabledTemplate(day)
+ }
+ else
+ {
+ @text
+ }
+
+ }
+ else
+ {
+ |
+ }
+
|
+ @if (isOverflow)
+ {
+ -
+ }
+ else
+ {
+ |
+ }
+
|
+ |
+ }
+
| @w | - } -
|---|
|
- @if (isOverflow)
- {
- -
- }
- else if (IsDisabled(day))
- {
-
- @if (ShowLunar)
- {
- @text
- @GetLunarText(day)
- }
- else if (DayDisabledTemplate != null)
- {
- @DayDisabledTemplate(day)
- }
- else
- {
- @text
- }
-
- }
- else
- {
- |
- }
-
|
- @if (isOverflow)
- {
- -
- }
- else
- {
- |
- }
-
|
- |
- }
-
AutoClose The default value is true When selecting a date, the pop-up window will automatically close. When the value is set to false, the pop-up window needs to be closed when the confirm button is clicked",
@@ -1794,7 +1801,7 @@
"Limit": "time limit",
"MaxMinValueIntro": "set time range",
"MaxMinValueTitle": "Max and Min",
- "NormalIntro": "Take 'day' as the basic unit, select a period of time",
+ "NormalIntro": "Select a date range in days. On small screens, a single-panel dialog is used with Clear, Today and OK actions in its footer. After selecting only the start date, use Reselect in the header to choose the start date again",
"NormalTitle": "Basic skills",
"SidebarIntro": "When the ShowSidebar property value is set to true, the component displays the shortcut sidebar",
"SidebarTip": "by setting ShowSidebar The parameter enables the display sidebar shortcut options function, by setting SidebarItems The parameter collection replaces the default shortcuts built into the component",
@@ -5141,6 +5148,11 @@
"TablesTemplateColumnTitle": "TemplateColumn",
"TablesVisibleIntro": "If the IsVisibleWhenAdd or IsVisibleWhenEdit property is set to false, hide this column when creating or updating. In this example, the New pop-up window does not display Count Edit Pop up window does not display Complete edit the item",
"TablesVisibleTitle": "Editor Visible/Hidden",
+ "TablesRequiredIntro": "Set the Required property to control whether a column is required when adding or editing an item.",
+ "TablesRequiredDescription1": "The model's [Required] attribute has the highest priority and overrides other settings when applied.",
+ "TablesRequiredDescription2": "The nearest setting takes precedence: Required on a TableColumn has higher priority than [AutoGenerateColumn(Required = true)].",
+ "TablesRequiredDescription3": "An explicitly set Required on a TableColumn overrides IsRequiredWhenAdd / IsRequiredWhenEdit. If Required is not set, those parameters are applied according to the Add/Edit state.",
+ "TablesRequiredTitle": "Table Required/Optional",
"TableTemplateColumnText1": "Template",
"TableTemplateColumnText2": "Name & Count"
},
diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json
index 60d2812def9..f63eae1851d 100644
--- a/src/BootstrapBlazor.Server/Locales/zh-CN.json
+++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json
@@ -1714,6 +1714,13 @@
"Title": "计数器 CountUp"
},
"BootstrapBlazor.Server.Components.Samples.DateTimePickers": {
+ "NestedDialogTitle": "嵌套弹窗表单中的日期选择",
+ "NestedDialogIntro": "先打开表单,再打开其中的日期或日期时间选择器。客户端直接判断视口:小于 768px 时使用原生 dialog,不小于 768px 时沿用原有 Popover,无需 Responsive 组件。跨越断点时关闭当前选择面板并切换模式,再次打开使用新模式。检查关闭选择器后仍能编辑原表单、必填验证和提交有效、反复打开不会产生重复弹窗;日期时间选择器还需检查内置时间选择器的确认和取消。外层表单使用 DialogService,日期选择器本身不依赖 Dialog 宿主。",
+ "NestedDialogOpen": "打开表单弹窗",
+ "NestedDateLabel": "必填日期",
+ "NestedDateTimeLabel": "日期时间(内含时间选择器)",
+ "NestedRangeLabel": "日期范围",
+ "NestedSubmitted": "表单验证和提交成功。",
"BindValueIntro": "日期组件时间改变时文本框内的数值也跟着改变,通过设置 IsEditable=\"true\" 开启手工录入功能",
"BindValueTitle": "数据双向绑定",
"BlockAutoCloseDesc": "AutoClose 默认值为 true 点选日期时自动关闭弹窗,设置值为 false 时,需要点击 确认 按钮时关闭弹窗",
@@ -1794,7 +1801,7 @@
"Limit": "时间范围",
"MaxMinValueIntro": "设置时间的取值范围",
"MaxMinValueTitle": "最大值和最小值",
- "NormalIntro": "以「日」为基本单位,选择一段时间",
+ "NormalIntro": "以「日」为基本单位,选择一段时间。移动端自动使用单面板弹窗,清空、今天和确定按钮位于弹窗底部;仅选择开始日期后,可通过标题栏的「重选」按钮重新选择开始日期",
"NormalTitle": "基本功能",
"SidebarIntro": "设置 ShowSidebar 属性值为 true 时,组件显示快捷方式侧边栏",
"SidebarTip": "通过设置 ShowSidebar 参数开启显示侧边栏快捷选项功能,通过设置 SidebarItems 参数集合替换组件内置的默认快捷项",
@@ -5141,6 +5148,11 @@
"TablesTemplateColumnTitle": "模板列",
"TablesVisibleIntro": "Visible 默认值为 true 如果有列设置了 IsVisibleWhenAdd 或者 IsVisibleWhenEdit 属性为 false 时, 新建或者更新时隐藏此列。本例中 新建 弹窗不显示 数量 编辑 弹窗不显示 是否 编辑项。[AutoGenerateClass(Visible = false)] 全部禁止显示,再通过 IsVisibleWhenAdd 或者 IsVisibleWhenEdit 单独设置编辑状态下的可见性,本例中,地址 列默认不可见,新建、编辑 弹窗内均可以编辑Required 属性可以控制列在编辑/新增时是否为必填项",
+ "TablesRequiredDescription1": "模型标签 [Required] 优先级别最高,一旦设置会覆盖其他设置",
+ "TablesRequiredDescription2": "根据就近原则,TableColumn 列上的 Required 属性优先级高于 [AutoGenerateColumn(Required = true)]",
+ "TablesRequiredDescription3": "显式设置 TableColumn 的 Required 会覆盖 IsRequiredWhenAdd / IsRequiredWhenEdit;不设置 Required 时,才按 新建/编辑 状态使用这两个参数",
+ "TablesRequiredTitle": "Table 编辑/新增时是否为必填项",
"TableTemplateColumnText1": "模板列",
"TableTemplateColumnText2": "姓名 & 数量"
},
From 3042d0931da78d3314f5c2580586584acd718761 Mon Sep 17 00:00:00 2001
From: Argo Zhang