Skip to content

Commit 6e009ab

Browse files
committed
doc: 文档格式化
1 parent a7d97e5 commit 6e009ab

File tree

1 file changed

+161
-161
lines changed

1 file changed

+161
-161
lines changed

src/BootstrapBlazor.Server/Components/Samples/DateTimePickers.razor

Lines changed: 161 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -13,233 +13,233 @@
1313
</BootstrapInputGroup>
1414
</div>
1515
</section>
16-
<DateTimePicker ViewMode="DatePickerViewMode.DateTime" TimeFormat="hh\:mm" IsButton="_isButton"
17-
Value="@DateTimePickerValue" OnValueChanged="@TimePickerValueChanged">
18-
<TimePickerSetting ShowClockScale="true" IsAutoSwitch="false" />
19-
</DateTimePicker>
20-
<ConsoleLogger @ref="TimePickerLogger" class="mt-3" />
16+
<DateTimePicker ViewMode="DatePickerViewMode.DateTime" TimeFormat="hh\:mm" IsButton="_isButton"
17+
Value="@DateTimePickerValue" OnValueChanged="@TimePickerValueChanged">
18+
<TimePickerSetting ShowClockScale="true" IsAutoSwitch="false" />
19+
</DateTimePicker>
20+
<ConsoleLogger @ref="TimePickerLogger" class="mt-3" />
2121
</DemoBlock>
2222

2323
<DemoBlock Title="@Localizer["NormalTitle"]" Introduction="@Localizer["NormalIntro"]" Name="Normal">
24-
<section ignore>
25-
<GroupBox Title="@Localizer["Feature"]">
26-
<div class="row g-3 form-inline text-end">
24+
<section ignore>
25+
<GroupBox Title="@Localizer["Feature"]">
26+
<div class="row g-3 form-inline text-end">
2727
<div class="col-12 col-sm-6 col-lg-3">
2828
<BootstrapInputGroup>
2929
<BootstrapInputGroupLabel DisplayText="@Localizer["FeatureShowLunar"]"></BootstrapInputGroupLabel>
3030
<Switch @bind-Value="_showLunar" />
3131
</BootstrapInputGroup>
32-
</div>
32+
</div>
3333
<div class="col-12 col-sm-6 col-lg-3">
3434
<BootstrapInputGroup>
3535
<BootstrapInputGroupLabel DisplayText="@Localizer["FeatureShowSolarTerm"]"></BootstrapInputGroupLabel>
3636
<Switch @bind-Value="_showSolarTerm" />
3737
</BootstrapInputGroup>
38-
</div>
38+
</div>
3939
<div class="col-12 col-sm-6 col-lg-3">
4040
<BootstrapInputGroup>
4141
<BootstrapInputGroupLabel DisplayText="@Localizer["FeatureShowFestivals"]"></BootstrapInputGroupLabel>
4242
<Switch @bind-Value="_showFestivals" />
4343
</BootstrapInputGroup>
44-
</div>
45-
<div class="col-12 col-sm-6 col-lg-3">
44+
</div>
45+
<div class="col-12 col-sm-6 col-lg-3">
4646
<BootstrapInputGroup>
4747
<BootstrapInputGroupLabel DisplayText="@Localizer["FeatureShowHolidays"]"></BootstrapInputGroupLabel>
4848
<Switch @bind-Value="_showHolidays" />
49-
</BootstrapInputGroup>
50-
</div>
51-
</div>
52-
</GroupBox>
53-
<div class="mt-3">
54-
<Pre>builder.Services.AddBootstrapHolidayService();</Pre>
55-
</div>
56-
</section>
57-
<DatePickerBody @bind-Value="Value" OnConfirm="@NormalOnConfirm" ShowFooter="false" ShowLunar="_showLunar" ShowSolarTerm="_showSolarTerm" ShowFestivals="_showFestivals" ShowHolidays="_showHolidays" />
58-
<ConsoleLogger @ref="NormalLogger" class="mt-3" />
59-
<section ignore>
60-
<Tips class="mt-3">
61-
<p>@((MarkupString)Localizer["FeatureIntro"].Value)</p>
62-
<ul class="ul-demo mt-3">
63-
<li>@((MarkupString)Localizer["FeatureShowLunarIntro"].Value)</li>
64-
<li>@((MarkupString)Localizer["FeatureShowSolarTermIntro"].Value)</li>
65-
<li>@((MarkupString)Localizer["FeatureShowFestivalsIntro"].Value)</li>
66-
<li>@((MarkupString)Localizer["FeatureShowHolidaysIntro"].Value)</li>
67-
</ul>
68-
<div>@((MarkupString)Localizer["FeatureFestivalIntro"].Value)</div>
69-
</Tips>
70-
</section>
49+
</BootstrapInputGroup>
50+
</div>
51+
</div>
52+
</GroupBox>
53+
<div class="mt-3">
54+
<Pre>builder.Services.AddBootstrapHolidayService();</Pre>
55+
</div>
56+
</section>
57+
<DatePickerBody @bind-Value="Value" OnConfirm="@NormalOnConfirm" ShowFooter="false" ShowLunar="_showLunar" ShowSolarTerm="_showSolarTerm" ShowFestivals="_showFestivals" ShowHolidays="_showHolidays" />
58+
<ConsoleLogger @ref="NormalLogger" class="mt-3" />
59+
<section ignore>
60+
<Tips class="mt-3">
61+
<p>@((MarkupString)Localizer["FeatureIntro"].Value)</p>
62+
<ul class="ul-demo mt-3">
63+
<li>@((MarkupString)Localizer["FeatureShowLunarIntro"].Value)</li>
64+
<li>@((MarkupString)Localizer["FeatureShowSolarTermIntro"].Value)</li>
65+
<li>@((MarkupString)Localizer["FeatureShowFestivalsIntro"].Value)</li>
66+
<li>@((MarkupString)Localizer["FeatureShowHolidaysIntro"].Value)</li>
67+
</ul>
68+
<div>@((MarkupString)Localizer["FeatureFestivalIntro"].Value)</div>
69+
</Tips>
70+
</section>
7171
</DemoBlock>
7272

7373
<DemoBlock Title="@Localizer["ValidateFormTitle"]" Introduction="@Localizer["ValidateFormIntro"]" Name="ValidateForm">
74-
<ValidateForm Model="this">
75-
<div class="row g-3">
76-
<div class="col-12 col-sm-auto">
77-
<DateTimePicker @bind-Value="@ValidateFormValue" />
78-
</div>
79-
<div class="col-12 col-sm-auto align-self-end">
80-
<Button ButtonType="ButtonType.Submit" Text="@Localizer["SubmitText"]" Icon="fa-solid fa-floppy-disk"></Button>
81-
</div>
82-
</div>
83-
</ValidateForm>
74+
<ValidateForm Model="this">
75+
<div class="row g-3">
76+
<div class="col-12 col-sm-auto">
77+
<DateTimePicker @bind-Value="@ValidateFormValue" />
78+
</div>
79+
<div class="col-12 col-sm-auto align-self-end">
80+
<Button ButtonType="ButtonType.Submit" Text="@Localizer["SubmitText"]" Icon="fa-solid fa-floppy-disk"></Button>
81+
</div>
82+
</div>
83+
</ValidateForm>
8484
</DemoBlock>
8585

8686
<DemoBlock Title="@Localizer["ShowIconTitle"]" Introduction="@Localizer["ShowIconIntro"]" Name="ShowIcon">
87-
<DateTimePicker TValue="DateTimeOffset?" ShowIcon="false" />
87+
<DateTimePicker TValue="DateTimeOffset ?" ShowIcon="false" />
8888
</DemoBlock>
8989

9090
<DemoBlock Title="@Localizer["DateTimeOffsetTitle"]" Introduction="@Localizer["DateTimeOffsetIntro"]" Name="DateTimeOffset">
91-
<DateTimePicker @bind-Value="DateTimeOffsetValue" />
91+
<DateTimePicker @bind-Value="DateTimeOffsetValue" />
9292
</DemoBlock>
9393

9494
<DemoBlock Title="@Localizer["BindValueTitle"]" Introduction="@Localizer["BindValueIntro"]" Name="BindValue">
95-
<div class="row g-3">
96-
<div class="col-sm-6">
97-
<DateTimePicker @bind-Value="@BindValue" IsEditable="true" DateFormat="dd/MM/yyyy" />
98-
</div>
99-
<div class="col-sm-6">
100-
<input class="form-control" @bind="@BindValueString" />
101-
</div>
102-
</div>
95+
<div class="row g-3">
96+
<div class="col-sm-6">
97+
<DateTimePicker @bind-Value="@BindValue" IsEditable="true" DateFormat="dd/MM/yyyy" />
98+
</div>
99+
<div class="col-sm-6">
100+
<input class="form-control" @bind="@BindValueString" />
101+
</div>
102+
</div>
103103
</DemoBlock>
104104

105105
<DemoBlock Title="@Localizer["IsEditableTitle"]" Introduction="@Localizer["IsEditableIntro"]" Name="IsEditable">
106-
<div class="row g-3">
107-
<div class="col-sm-6">
108-
<DateTimePicker @bind-Value="@BindValue" IsEditable="true" DateFormat="yyyy-MM-dd" />
109-
</div>
110-
</div>
106+
<div class="row g-3">
107+
<div class="col-sm-6">
108+
<DateTimePicker @bind-Value="@BindValue" IsEditable="true" DateFormat="yyyy-MM-dd" />
109+
</div>
110+
</div>
111111
</DemoBlock>
112112

113113
<DemoBlock Title="@Localizer["ViewModeTitle"]" Introduction="@Localizer["ViewModeIntro"]" Name="ViewMode">
114-
<section ignore>@((MarkupString)Localizer["ViewModeTip"].Value)</section>
115-
<div class="row g-3">
116-
<div class="col-12 col-sm-6">
117-
<DateTimePicker @bind-Value="YearValue" ShowLabel="true" DisplayText="Year" ViewMode="DatePickerViewMode.Year" DateFormat="yyyy" />
118-
</div>
119-
<div class="col-12 col-sm-6">
120-
<DateTimePicker @bind-Value="MonthValue" ShowLabel="true" DisplayText="Month" ViewMode="DatePickerViewMode.Month" DateFormat="yyyy-MM" />
121-
</div>
122-
<div class="col-12 col-sm-6">
123-
<DateTimePicker @bind-Value="DateValue" ShowLabel="true" DisplayText="Date" ViewMode="DatePickerViewMode.Date" DateFormat="yyyy-MM-dd" />
124-
</div>
125-
<div class="col-12 col-sm-6">
126-
<DateTimePicker @bind-Value="DateTimeValue" ShowLabel="true" DisplayText="DateTime" ViewMode="DatePickerViewMode.DateTime" DateTimeFormat="yyyy-MM-dd HH:mm:ss" />
127-
</div>
128-
</div>
114+
<section ignore>@((MarkupString)Localizer["ViewModeTip"].Value)</section>
115+
<div class="row g-3">
116+
<div class="col-12 col-sm-6">
117+
<DateTimePicker @bind-Value="YearValue" ShowLabel="true" DisplayText="Year" ViewMode="DatePickerViewMode.Year" DateFormat="yyyy" />
118+
</div>
119+
<div class="col-12 col-sm-6">
120+
<DateTimePicker @bind-Value="MonthValue" ShowLabel="true" DisplayText="Month" ViewMode="DatePickerViewMode.Month" DateFormat="yyyy-MM" />
121+
</div>
122+
<div class="col-12 col-sm-6">
123+
<DateTimePicker @bind-Value="DateValue" ShowLabel="true" DisplayText="Date" ViewMode="DatePickerViewMode.Date" DateFormat="yyyy-MM-dd" />
124+
</div>
125+
<div class="col-12 col-sm-6">
126+
<DateTimePicker @bind-Value="DateTimeValue" ShowLabel="true" DisplayText="DateTime" ViewMode="DatePickerViewMode.DateTime" DateTimeFormat="yyyy-MM-dd HH:mm:ss" />
127+
</div>
128+
</div>
129129
</DemoBlock>
130130

131131
<DemoBlock Title="@Localizer["NullValueTitle"]" Introduction="@Localizer["NullValueIntro"]" Name="NullValue">
132-
<section ignore>@((MarkupString)Localizer["NullValueTip"].Value)</section>
133-
<div class="row g-3">
134-
<div class="col-12 col-sm-8">
135-
<DateTimePicker @bind-Value="@BindNullValue" />
136-
</div>
137-
<div class="col-12 col-sm-4">
138-
<Display TValue="string" Value="@GetNullValueString" />
139-
</div>
140-
</div>
132+
<section ignore>@((MarkupString)Localizer["NullValueTip"].Value)</section>
133+
<div class="row g-3">
134+
<div class="col-12 col-sm-8">
135+
<DateTimePicker @bind-Value="@BindNullValue" />
136+
</div>
137+
<div class="col-12 col-sm-4">
138+
<Display TValue="string" Value="@GetNullValueString" />
139+
</div>
140+
</div>
141141
</DemoBlock>
142142

143143
<DemoBlock Title="@Localizer["ShowLabelTitle"]" Introduction="@Localizer["ShowLabelIntro"]" Name="ShowLabel">
144-
<section ignore class="mb-3">
145-
@((MarkupString)Localizer["ShowLabelTip"].Value)
146-
</section>
147-
<DateTimePicker ShowLabel="true" DisplayText="@Localizer["DisplayText"]" @bind-Value="@ShowLabelValue" />
144+
<section ignore class="mb-3">
145+
@((MarkupString)Localizer["ShowLabelTip"].Value)
146+
</section>
147+
<DateTimePicker ShowLabel="true" DisplayText="@Localizer["DisplayText"]" @bind-Value="@ShowLabelValue" />
148148
</DemoBlock>
149149

150150
<DemoBlock Title="@Localizer["DisabledTitle"]" Introduction="@Localizer["DisabledIntro"]" Name="IsDisabled">
151-
<div class="row g-3">
152-
<div class="col-12 col-sm-6">
153-
<DateTimePicker IsDisabled="IsDisabled" Value="DateTime.Today" />
154-
</div>
155-
<div class="col-12 col-sm-6">
156-
<Switch @bind-Value="@IsDisabled" />
157-
</div>
158-
</div>
151+
<div class="row g-3">
152+
<div class="col-12 col-sm-6">
153+
<DateTimePicker IsDisabled="IsDisabled" Value="DateTime.Today" />
154+
</div>
155+
<div class="col-12 col-sm-6">
156+
<Switch @bind-Value="@IsDisabled" />
157+
</div>
158+
</div>
159159
</DemoBlock>
160160

161161
<DemoBlock Title="@Localizer["ShowSidebarTitle"]" Introduction="@Localizer["ShowSidebarIntro"]" Name="ShowSidebar">
162-
<DateTimePicker ShowSidebar="true" @bind-Value="SidebarValue" />
162+
<DateTimePicker ShowSidebar="true" @bind-Value="SidebarValue" />
163163
</DemoBlock>
164164

165165
<DemoBlock Title="@Localizer["MinValueTitle"]" Introduction="@Localizer["MinValueIntro"]" Name="MinValue">
166-
<DateTimePicker @bind-Value="@AllowValue"
167-
MinValue="@(DateTime.Today.AddDays(1 - DateTime.Today.Day))"
168-
MaxValue="@(DateTime.Today.AddDays(46 - DateTime.Today.Day))" />
166+
<DateTimePicker @bind-Value="@AllowValue"
167+
MinValue="@(DateTime.Today.AddDays(1 - DateTime.Today.Day))"
168+
MaxValue="@(DateTime.Today.AddDays(46 - DateTime.Today.Day))" />
169169
</DemoBlock>
170170

171171
<DemoBlock Title="@Localizer["BlockAutoCloseTitle"]" Introduction="@Localizer["BlockAutoCloseIntro"]" Name="AutoClose">
172-
<section ignore class="mb-3">
173-
@((MarkupString)Localizer["BlockAutoCloseDesc"].Value)
174-
</section>
175-
<DateTimePicker @bind-Value="@AutoCloseValue" AutoClose="false" />
172+
<section ignore class="mb-3">
173+
@((MarkupString)Localizer["BlockAutoCloseDesc"].Value)
174+
</section>
175+
<DateTimePicker @bind-Value="@AutoCloseValue" AutoClose="false" />
176176
</DemoBlock>
177177

178178
<DemoBlock Title="@Localizer["BlockGroupTitle"]" Introduction="@Localizer["BlockGroupIntro"]" Name="Group">
179-
<div class="row g-3">
180-
<div class="col-12 col-sm-6">
181-
<BootstrapInputGroup>
182-
<BootstrapInputGroupLabel DisplayText="@Localizer["BlockGroupLabel"]" />
183-
<DateTimePicker TValue="DateTime" ShowIcon="false" />
184-
</BootstrapInputGroup>
185-
</div>
186-
<div class="col-12 col-sm-6">
187-
<BootstrapInputGroup>
188-
<DateTimePicker TValue="DateTime" />
189-
<BootstrapInputGroupLabel DisplayText="@Localizer["BlockGroupSuffixLabel"]" />
190-
</BootstrapInputGroup>
191-
</div>
192-
<div class="col-12 col-sm-6">
193-
<BootstrapInputGroup>
194-
<BootstrapInputGroupLabel DisplayText="@Localizer["BlockGroupLabel"]" />
195-
<DateTimePicker TValue="DateTime" ShowIcon="false" />
196-
<BootstrapInputGroupLabel DisplayText="@Localizer["BlockGroupSuffixLabel"]" />
197-
</BootstrapInputGroup>
198-
</div>
199-
</div>
179+
<div class="row g-3">
180+
<div class="col-12 col-sm-6">
181+
<BootstrapInputGroup>
182+
<BootstrapInputGroupLabel DisplayText="@Localizer["BlockGroupLabel"]" />
183+
<DateTimePicker TValue="DateTime" ShowIcon="false" />
184+
</BootstrapInputGroup>
185+
</div>
186+
<div class="col-12 col-sm-6">
187+
<BootstrapInputGroup>
188+
<DateTimePicker TValue="DateTime" />
189+
<BootstrapInputGroupLabel DisplayText="@Localizer["BlockGroupSuffixLabel"]" />
190+
</BootstrapInputGroup>
191+
</div>
192+
<div class="col-12 col-sm-6">
193+
<BootstrapInputGroup>
194+
<BootstrapInputGroupLabel DisplayText="@Localizer["BlockGroupLabel"]" />
195+
<DateTimePicker TValue="DateTime" ShowIcon="false" />
196+
<BootstrapInputGroupLabel DisplayText="@Localizer["BlockGroupSuffixLabel"]" />
197+
</BootstrapInputGroup>
198+
</div>
199+
</div>
200200
</DemoBlock>
201201

202202
<DemoBlock Title="@Localizer["DayTemplateTitle"]" Introduction="@Localizer["DayTemplateIntro"]" Name="DayTemplate">
203-
<DateTimePicker TValue="DateTimeOffset?" CustomClass="custom-picker">
204-
<DayTemplate>
205-
<span class="custom-cell">
206-
<span>@context.Day</span>
207-
<span class="@GetMarkByDay(context)"></span>
208-
</span>
209-
</DayTemplate>
210-
</DateTimePicker>
203+
<DateTimePicker TValue="DateTimeOffset ?" CustomClass="custom-picker">
204+
<DayTemplate>
205+
<span class="custom-cell">
206+
<span>@context.Day</span>
207+
<span class="@GetMarkByDay(context)"></span>
208+
</span>
209+
</DayTemplate>
210+
</DateTimePicker>
211211
</DemoBlock>
212212

213213
<DemoBlock Title="@Localizer["DisableDayCallbackTitle"]" Introduction="@Localizer["DisableDayCallbackIntro"]" Name="OnDisabledDayCallback">
214-
<section ignore>
215-
<Tips>
216-
@((MarkupString)Localizer["DisableDayCallbackTip"].Value)
217-
</Tips>
218-
<GroupBox Title="@Localizer["DisableOptions"]">
219-
<div class="row g-3 form-inline text-end">
220-
<div class="col-12 col-sm-6 col-md-auto">
221-
<Switch DisplayText="@Localizer["DisableWeekend"]" ShowLabel="true" @bind-Value="_disableWeekend" OnValueChanged="OnDisabledDaysChanged" />
222-
</div>
223-
<div class="col-12 col-sm-6 col-md-auto">
224-
<Switch DisplayText="@Localizer["DisableToday"]" ShowLabel="true" @bind-Value="_disableToday" OnValueChanged="OnDisabledDaysChanged" />
225-
</div>
226-
</div>
227-
</GroupBox>
228-
</section>
229-
<div class="row form-inline g-3">
230-
<div class="col-12 col-sm-6">
231-
<DateTimePicker ViewMode="DatePickerViewMode.DateTime" DisplayText="@Localizer["DisableDayCallbackAllowNullDisplayText"]"
232-
ShowLabel="true" @bind-Value="@_disabledNullValue" @ref="_picker1"
233-
OnGetDisabledDaysCallback="OnGetDisabledDaysCallback" DisplayDisabledDayAsEmpty="true">
234-
</DateTimePicker>
235-
</div>
236-
<div class="col-12 col-sm-6">
237-
<DateTimePicker ViewMode="DatePickerViewMode.DateTime" DisplayText="@Localizer["DisableDayCallbackNotAllowNullDisplayText"]"
238-
ShowLabel="true" @bind-Value="@_disabledValue" @ref="_picker2"
239-
OnGetDisabledDaysCallback="OnGetDisabledDaysCallback">
240-
</DateTimePicker>
241-
</div>
242-
</div>
214+
<section ignore>
215+
<Tips>
216+
@((MarkupString)Localizer["DisableDayCallbackTip"].Value)
217+
</Tips>
218+
<GroupBox Title="@Localizer["DisableOptions"]">
219+
<div class="row g-3 form-inline text-end">
220+
<div class="col-12 col-sm-6 col-md-auto">
221+
<Switch DisplayText="@Localizer["DisableWeekend"]" ShowLabel="true" @bind-Value="_disableWeekend" OnValueChanged="OnDisabledDaysChanged" />
222+
</div>
223+
<div class="col-12 col-sm-6 col-md-auto">
224+
<Switch DisplayText="@Localizer["DisableToday"]" ShowLabel="true" @bind-Value="_disableToday" OnValueChanged="OnDisabledDaysChanged" />
225+
</div>
226+
</div>
227+
</GroupBox>
228+
</section>
229+
<div class="row form-inline g-3">
230+
<div class="col-12 col-sm-6">
231+
<DateTimePicker ViewMode="DatePickerViewMode.DateTime" DisplayText="@Localizer["DisableDayCallbackAllowNullDisplayText"]"
232+
ShowLabel="true" @bind-Value="@_disabledNullValue" @ref="_picker1"
233+
OnGetDisabledDaysCallback="OnGetDisabledDaysCallback" DisplayDisabledDayAsEmpty="true">
234+
</DateTimePicker>
235+
</div>
236+
<div class="col-12 col-sm-6">
237+
<DateTimePicker ViewMode="DatePickerViewMode.DateTime" DisplayText="@Localizer["DisableDayCallbackNotAllowNullDisplayText"]"
238+
ShowLabel="true" @bind-Value="@_disabledValue" @ref="_picker2"
239+
OnGetDisabledDaysCallback="OnGetDisabledDaysCallback">
240+
</DateTimePicker>
241+
</div>
242+
</div>
243243
</DemoBlock>
244244

245245
<AttributeTable Items="@GetAttributes()" />

0 commit comments

Comments
 (0)