Compare commits

...

277 Commits

Author SHA1 Message Date
Argo-Tianyi
22fc37261f chore: bump verson to 5.7.0 2021-08-19 09:05:43 +08:00
Argo
138d960e6c !1738 feat(#I4699U): add default background color for Display when inside form
* style: 增加表单中 Display 组件背景色
2021-08-18 16:10:09 +00:00
Argo
28b5e6de96 !1737 feat(#I4697U): table toolbar show text when not set icon parameter on mobile
* feat: 移动端 Toolbar 未设置图标时显示文字
2021-08-18 15:18:48 +00:00
Nine
a6e15e4fbd !1736 doc(#I4667Y): add english translation of FormLabel page
* fix: 移除重复资源文件
* Merge branch 'dev' of https://gitee.com/LongbowEnterprise/BootstrapBla…
* doc: 添加 label示例资源文件
2021-08-18 08:56:03 +00:00
Argo
0c81400946 !1735 doc(#I461WW): update sample code for ValidateForm
* chore: bump version to 5.6.8
* doc: 更新 Table 组件 SearchMode 文档
* doc: 更新 ValidateForm 示例文档
2021-08-17 10:38:03 +00:00
Argo
f1ac4a8208 !1734 feat(#I461UK): add SearchMode parameter on Table
* Merge branch 'dev' into dev-search
* doc: 更新搜索功能体验
* doc: 增加 Search 相关说明
* feat: 增加 ShowSearchButton 可单独控制搜索按钮
* feat: 更新默认搜索样式增加 Card
* doc: 更新搜索栏提示信息
* style: 更新样式
* refactor: 移除对 Editable 的过滤
* feat: 增加 SearchMode 参数
* feat: EditorForm 增加 Items 参数用于接收指定列
2021-08-17 10:29:21 +00:00
Argo
660399107e !1733 feat(#I45YF4): add Items parameter on EditorForm
* feat: EditorForm 增加 Items 参数用于接收指定列
2021-08-17 04:21:44 +00:00
Argo
c8582e6ce0 !1732 feat(#I45X3W): add ShowCardView parameter for manual switch the TableRenderMode
* doc: 更新显示视图示例
* feat: 增加 ShowCardView 按钮
2021-08-17 02:13:43 +00:00
Argo
47238cec36 !1731 doc(#I45WXS): rename RenderTableModel to RenderTableMode
* refactor: rename ActiveRenderModel to ActiveRenderMode
* refactor: 纠正单词拼写错误 Model 更改为  Mode
2021-08-17 02:00:35 +00:00
Argo
d0c115568b !1730 fix(#I45VIZ): not show popup window after set IsDisabled from true to false
* doc: IsDisabled 参数默认更改为 true
* feat: DateTimeRange 组件禁用时也执行客户端脚本
2021-08-16 15:37:36 +00:00
Argo
a83141311e !1729 fix(#I45VCK): DateTimePicker dynamic support Disabled parameter
* doc: 更新禁用默认值
* doc: 更新文档
* fix: 修复 DateTimePicker 组件开启后再禁用时仍然弹出日期框问题
2021-08-16 14:39:33 +00:00
Argo
7fddfead03 !1728 fix(#I45VC8): popup window when set enable then disable
* fix: 修复组件启用后禁用仍弹出对话框
2021-08-16 14:15:11 +00:00
Argo
77271460f5 !1727 fix(#I45QNP): dispose popover instance after hide
* fix: 修复删除按钮未选择时仍弹出确认框
2021-08-16 12:35:36 +08:00
Argo
965a636c8a !1726 fix(#I45N52): throw exception when call GetAllStrings
* chore: bump version to 5.6.6
* feat: GetAllStrings 兼容第三方组件
* refactor: 增加 GetAllStrings 逻辑
* refactor: 格式化代码
* refactor: 调整资源文件读取顺序
2021-08-15 15:59:44 +00:00
Argo
51fe6e79d1 !1725 fix(#I45N4T): resolve can't insert new row when set IsTracking to true in EditInCell mode
* fix: 修复 InCell 模式下无法新建问题
2021-08-15 15:58:14 +00:00
Argo
b7b2b0b67f !1724 refactor(#I44MWD): remove readonly from Items property on Tree component
* feat: 更新逻辑保证示例可用
* wip: refactor Tree component
2021-08-15 03:34:18 +00:00
Argo
c861bd5c34 !1723 feat(#I45L4I): support Nullable enum data type when AutoGenerateTemplate
* doc: 更新示例文档增加 Row="3" 设置示例
* refactor: InCell 编辑模式使用 Display 渲染只读列
* revert: 移除自动创建组件对 Readonly 兼容代码
* doc: 修复示例说明 Select 默认项问题
* doc: 地址字段增加默认值
* doc: 新建时对只读字段进行默认值赋值
2021-08-15 03:27:38 +00:00
Argo
21857beb44 !1721 feat(#I45IO4): Select component support Nullable enum data type in AutoGenerateTemplate method
* chore: bump version to 5.6.5
* refactor: revert data type to IEnumerable
* feat: 重构表单自动生成逻辑增加对可为空枚举类型支持
* refactor: change Items data type to List
2021-08-14 09:08:36 +00:00
Argo
06a43f914f !1720 fix(#I451AE): show in wrong place when set Filterable to true and set Height
* fix: 修复固定表头并开启数据过滤功能时弹窗位置不正确问题
2021-08-14 05:01:14 +00:00
Argo
0322772ff5 !1719 fix(#I45H57): localization function compatible CentOS/WSL host
* chore: bump version to 5.6.4
* fix: 修复 wsl 环境缺失文化时组件显示不正确问题
2021-08-13 16:58:00 +00:00
Argo
2c2820b5f9 !1718 fix(#I45GV8): resolve show toast when not provider OnSaveAsync method on IsTracking mode
* chore: bump version to 5.6.3
* fix: 修复 Add Edit Delete 逻辑
2021-08-13 21:02:18 +08:00
Argo
da945de399 !1717 feat(#I45DE4): add IsTracking parameter on Table component
* chore: 更新版本到 5.6.2
* doc: 更新 IsTracking 模式示例
* feat: 增加 IsTracking 参数用于跟踪模型
* doc: 增加关闭按钮资源文件
2021-08-13 05:34:27 +00:00
Argo-Tianyi
825f1f32ae fix: add namesapce for BootstrapInput component 2021-08-13 11:04:05 +08:00
Argo
1dbf520197 !1716 feat(#I45B26): add FloatingLabel component
* doc: 更新示例
* doc: 增加悬浮标签示例
* feat: 移除前置标签
* refactor: 重构代码
* doc: 增加 FloatingLabel 示例
* feat: 增加 FloatingLabel 组件
* refactor: 更改类型可继承
2021-08-13 02:39:01 +00:00
Nine
38921a64ee !1714 doc(#I458BW): add english translation of installwasm and installserver page
* doc: 修复文档
* doc: 修复资源文件丢失 ‘}’ 问题
* Merge branch 'dev' of https://gitee.com/LongbowEnterprise/BootstrapBla…
* doc: InstallServer InstallWasm页面添加资源文件
2021-08-12 16:05:08 +00:00
Argo
97d239e1e4 !1715 feat(#I458DK): DynamicDataTableContext add DBNull process logic
* fix: 增加对 DBNull 的处理逻辑
* feat: 更改第二个回调参数为可选参数
2021-08-12 14:42:48 +00:00
Argo-Tianyi
c8fe737903 fix: add missing namespace 2021-08-12 16:44:42 +08:00
Argo
0064372daf !1713 feat(#I4567F): add HeaderTemplate on ModalDialog/Dialog component
* doc: 更新说明文档
* chore: 更新版本号 5.6.1
* doc: 增加自定义Header模板复杂示例
* feat: 增加 HeaderTemplate
2021-08-12 08:36:01 +00:00
Argo-Tianyi
f257533179 chore: bump version to 5.6.0 2021-08-13 00:21:23 +08:00
Argo
936326b4c1 !1712 fix(#I453H8): resolve set enabled to false not work in EditDialog
* doc: 格式化文档
* doc: 增加 EditDialog 弹窗示例
* fix: 修复 EditDialog 未判断 Enaable 参数问题
2021-08-12 04:11:19 +00:00
Argo-Tianyi
9be042d5cc Revert "!1707 doc(#I4515X): add english translation of localization page"
This reverts commit 6231e2e017.
2021-08-12 12:35:51 +08:00
Jacheers
9c0f2f80d9 !1711 【轻量级 PR】:doc: update Blazor word
* InstallContent.razor文件第24行“Blazor App”误为“Blazozr App”
2021-08-11 16:24:50 +00:00
Argo
906831033a !1710 chore(#I451BN): update the project settings for dependence version
* chore: 更新项目文件
2021-08-11 16:17:26 +00:00
Argo
2196238b8b !1709 feat(#I450PE): add index parameter method of ActiveTab on Tab component
* doc: 增加 ActiveTab 示例
* feat: 增加 ActiveTab 方法
* feat: support align in table cell
2021-08-11 16:12:32 +00:00
Argo
9315bd2409 !1708 feat(#I451B7): switch support align parameter inside table cell
* feat: support align in table cell
2021-08-11 16:07:24 +00:00
Nine
6231e2e017 !1707 doc(#I4515X): add english translation of localization page
* Merge branch 'dev-en-localizer' of https://gitee.com/LongbowEnterprise…
* doc: 本地化文档添加资源文件以
* doc: 本地化文档添加资源文件以
2021-08-11 16:02:36 +00:00
Argo
4fa6c1916b !1706 feat(#I450MD): upgrade bootstrap css framework to v5.1
* doc: 更新更新日志路径
* chore: 更新配置文件依赖组件版本号使用通配符
* chore: 更新打包文件
* chore: 更新依赖版本号
* style: 增加 color 最大宽度样式
* chore: 移除字体设置
* chore: 移除 sourceMap 链接
* chore: 移除 map 文件
* chore: add map files
* chore: update bootstrap to 5.1
2021-08-11 11:13:32 +00:00
Argo
deab1c60b5 !1705 fix(#I44WS2): resolve dialog flash after click button inside popup window
* fix: 修复点击弹窗中按钮后闪烁问题
* chore: remove abstractions dependence
2021-08-11 04:31:45 +00:00
Argo
37e4f2e094 !1704 chore(#I44WDE): upgrade framework version to 5.0.9
* chore: 更新依赖为 5.0.9
* chore: 更新脚本升级 sdk 版本 400
2021-08-11 03:24:34 +00:00
Argo
673ff3f2b9 !1703 fix(#I44W1K): resolve popup confirm dialog flash after second click
* fix: 修复 PopupConfirm 按钮多次点击按钮失效问题
2021-08-11 02:58:46 +00:00
Argo
1c8f8d118b !1702 perf(#I44V2G): upgrade to net6.0 preview7
* chore: upgrade net6.0 preview7
2021-08-11 01:46:09 +00:00
Argo
1346b55e1b !1701 feat(#I44TYN): add NullSwitch component support Nullable<bool>
* chore: bump version to 5.5.4
* doc: 增加 NullSwitch 组件示例
* doc: 更新示例
* feat: 新增 NullSwitch 组件支持可为空 Switch 组件
* refactor: 移动部分属性到 Toggle 类中
2021-08-10 13:00:41 +00:00
Argo
72107cf2f7 !1700 feat:(#I44QUY): don't show the label front input in table cell under ValidateForm
* style: 增加 Table 组件内置到 form 中的样式
* doc: 更新表单中使用 Table 示例
2021-08-10 07:10:47 +00:00
Argo
d3da06b63f !1699 fix(#I44N03): not reset checkbox state when client add button
* fix: 修复点击新建按钮后行选中状态未清除问题
2021-08-09 16:31:56 +00:00
Argo
85539cfc27 !1698 fix(#I44MZ9): can't click add/edit button after click delete button
* chore: bump  version to 5.5.3
* refactor: 重构代码
* fix: 增加 d-none 样式修复点击删除按钮后无法点击新建按钮问题
2021-08-09 16:12:55 +00:00
Argo
155de49306 !1697 fix(#I44MZ1): double/float/decimal data type of TableColumn throw exception when click edit button
* fix: 修复浮点数值设置 Step 编辑模式下报错问题
2021-08-09 16:08:54 +00:00
Argo
631c939e71 !1696 feat(#I44LZT): carousel item support width 100%
* feat: 移除 sealed 关键字
* style: 增加宽度 100% 样式
2021-08-09 10:16:39 +00:00
Kyle_Young
aafce4a023 !1695 feat: set width to 100%
* update src/BootstrapBlazor/Components/Carousel/CarouselImage.razor.
2021-08-09 10:07:16 +00:00
Argo
12066f50fe !1694 fix(#I44GIG): table filter support double and decimal data type
* chore: bump version to 5.5.2
* fix: NumberFilter 更改为泛型支持多种数据类型
2021-08-09 04:53:45 +00:00
Argo
ac91d53091 !1693 refactor(#I44I8C): adjust dropdown-arrow for multiple select
* refactor: 更新多项选择器组件小箭头支持向上展开时隐藏
2021-08-09 04:21:58 +00:00
Argo
3960c54c26 !1692 feat(#I44I7S): remove dropdown menu max height style
* style: remove dropdown-menu style
2021-08-09 04:17:49 +00:00
Argo
29e36f4df5 !1691 feat(#I44F4H): EditForm/InCell mode support Readonly parameter on Table component
* doc: 表单编辑示例增加 readonly 示例
* style: 微调样式放置标签出现背景色
* feat: 增加 EditForm 对 Readonly 支持
* fix: 修复 CheckboxList 数据源给错问题
* chore: 更新 nuget 数据源配置
* doc: 示例更新地址列为只读列不可编辑
* style: 增加行内只读列背景色
* feat: 增加行内编辑对 readonly 字段支持
2021-08-08 09:35:53 +00:00
Nine
4a748c87d4 !1689 doc(#I44B3G): add english translation of template and globalization page
* Merge branch 'dev' of https://gitee.com/LongbowEnterprise/BootstrapBla…
* Merge branch 'dev' of https://gitee.com/LongbowEnterprise/BootstrapBla…
* doc:添加 Globalization 页面资源文件以及全球化
* doc: 添加模板页面资源文件以及全球化
2021-08-07 08:08:58 +00:00
Argo
82d1e663d0 !1690 feat(#I44CUD): table component add OnAfterSaveAsync parameter
* chore: bump version 5.5.2-beta01
* doc: 增加 OnAfterSaveAsync 回调方法说明
* refactor: 移除 loading 私有字段
* feat: 增加 OnAfterSaveAsync 回调方法
2021-08-07 08:05:39 +00:00
Argo
3e63782f6a !1688 doc(#I448F3): update docs for Search component
* doc: remove script of ad
* doc: update attribute for Search
* doc: update docs for Search
* refactor: add await keyword
2021-08-06 07:42:25 +00:00
Argo
6b2be0b8ad !1687 feat(#I444LV): Search auto focus after click search button
* doc: 更新示例文档
* feat: 点击 Search 按钮后获得焦点
* feat: 公开 FocusAsync 方法
2021-08-05 16:31:44 +00:00
Argo
bd1ae94dd7 !1686 fix(#I4421V): SearchDialog missing layout parameter from Table
* chore: bump version to 5.5.1
* fix: 修复 SearchDialog 未使用布局设置参数问题
* fix: 修复代码文件链接错误
2021-08-05 08:18:33 +00:00
Argo-Tianyi
a086096ad3 chore: bump version to 5.5.0 2021-08-06 00:06:40 +08:00
Argo
080716ce4f !1685 feat(#I43XTG): use parameters in EditForm mode on Table component
* doc: 增加 Card 两行样式
* style: 行内编辑下拉框充满
* style: 微调行内编辑组件周边间隙
* style: 移除行内编辑行背景色样式
* style: 行内编辑微调边距
* feat: 移除编辑行背景色
* feat: 更新表单编辑模式下布局
2021-08-04 16:04:26 +00:00
Argo
a4af8f7b7d !1684 feat(#I43XRX): support new item function in EditInCell mode on Table component
* feat: 增加行内编辑新建功能
* fix: 修复编辑模板 Footer 顶部无间隙问题
* style: 移除 modal-footer 顶部间隙
2021-08-04 15:28:06 +00:00
大胃Q
8b06ac2774 !1682 feat(#I43XRL): add click event for the middle item in Cascader component
* 修复级联选择  中间级别菜单 无法选中的bug
2021-08-04 15:23:36 +00:00
Argo
cffe83c216 !1683 feat(#I43XM7): add IsAutoFocus and IsAutoClearAfterSearch parameter on Search component
* doc: 更新自动获取焦点示例
* feat: Search 增加自动获得焦点功能
2021-08-04 13:55:46 +00:00
Argo
f48f2d48cb !1681 fix(#I43SQJ): add three parameters on table can change layout of EditDialog
* chore: bump version to 5.4.7
* doc: 更新 Table 参数列表
* fix: 修复内置编辑弹窗内布局默认为一行两列
* chore: 更新样式
2021-08-04 03:21:42 +00:00
Argo-Tianyi
854d1d8dba chore: update dependence lib 2021-08-04 10:31:50 +08:00
Argo
1834c12809 !1680 doc(#I43STU): add sample code of update Markdown content by call async method
* doc: 增加异步加载数据示例
2021-08-04 02:30:04 +00:00
Argo
e1fb947782 !1679 chore: bump extensions version to 5.1.1
* chore: bump version to 5.1.1
* chore: 更新 Nuget.Config 文件内容
2021-08-03 15:19:20 +00:00
Argo
f7ada54151 !1678 fix(#I43RIH): markdown not support set value in async
* chore: bump version to 5.1.0
* chore: 更新打包配置信息
* chore: 更新项目文件
* chore: 更新打包脚本支持 setMarkdown 方法
* chore: 更新 Markdown 项目打包脚本
* chore: 更新文件内联配置文件
* chore: 更新 Markdown 组件配置文件
2021-08-03 14:57:27 +00:00
Argo
9c44328a22 !1677 doc(#I43EJP): remove duplicate sample code
* doc: 增加 AD 代码
* doc: 移除重复示例
2021-08-03 11:45:52 +00:00
Argo
29d8532541 !1676 feat(#I1L30Y): update class for Tabs component
* Merge branch 'dev' into dev-tab
* chore: 更新样式文件
* refactor: 更新 Nuget.Config 文件
* refactor: remove height setting form body
* wip: 临时提交
* feat: ModalDialog 增加 Class 参数用于自定义弹窗样式
* feat: 增加 Class 属性用于自定义弹窗样式
* feat: DialogService 重构代码
* chore: 独立打包配置文件
* chore: 更新打包样式
* feat: 微调 Table 组件行内编辑间隙
2021-08-03 07:15:14 +00:00
Argo
84a208a92b !1675 feat(#I43ONF): add Class parameter on Dialog component
* feat: ModalDialog 增加 Class 参数用于自定义弹窗样式
* feat: 增加 Class 属性用于自定义弹窗样式
* feat: DialogService 重构代码
* chore: 独立打包配置文件
* chore: 更新打包样式
* feat: 微调 Table 组件行内编辑间隙
2021-08-03 07:10:55 +00:00
Argo
945ffa04cb !1674 chore(#I43ODR): separate bundle script into target file
* chore: 独立打包配置文件
* chore: 更新打包样式
* feat: 微调 Table 组件行内编辑间隙
2021-08-03 06:51:30 +00:00
Argo
0affa249cf !1673 fix(#I43DZ9): resolve can input when Set IsDisabled to true on ColorPicker component
* chore: bump version to 5.4.5
* fix: 修复 ColorPicker 组件禁用状态仍然可输入
2021-08-01 16:53:46 +00:00
Argo
3b136056ee !1672 feat(#I43DYV): redesign ColorPicker component
* refactor: 升级脚本版本号
* Merge branch 'dev' into dev-color
* doc: 增加 ColorPicker 组件内置表单示例
* feat: ColorPicker 组件兼容 ValidateForm
* style: ColorPIcker 适配 Row 布局
* doc: 更新示例
* refactor: 更新 color-picker 样式
* chore: 更新打包脚本
* refactor: 精简代码
* chore: 移除 color 相关脚本与样式
2021-08-01 16:41:05 +00:00
Argo
ea50046ca2 !1671 feat(#I43BBA): add Empty on Table component
* chore: 更新打包样式
* Merge branch 'dev' into dev-table-empty
* doc: 更新打包样式
* doc: 更新示例
* doc: 更新无数据相关参数说明
* doc: 增加 EmptyText 资源文件
* style: 增加无数据时 Empty 样式
* feat: Table 增加 Empty 相关参数
* doc: Empty 组件更新参数说明 Desc 重命名为 Text
* doc: Empty 组件更新资源文件
* feat: 重构 Empty 组件
2021-08-01 16:35:21 +00:00
Argo
2f6862f74d !1670 feat(#I43DYN): add LabelAlign parameter on SearchDialog component
* Merge branch 'dev' into dev-searchdialog
* doc: 更新参数说明
* doc: 增加右对齐搜索弹窗示例
* feat: 增加 LabelAlign 参数
* refactor: 移除 parametr 标签
* feat: SearchDialog 增加对齐方式参数
* feat: Editdialog 增加 LabelAlign 参数
* refactor: 重命名 TextAlign 为 LabelAlign
* doc: 更新示例弹窗内布局每行 2 个组件
* feat: EditDialog 增加行布局参数
* feat: 编辑搜索弹窗移除 modal-footer 样式
* chore: 更新弹窗 footer 样式
* doc: 更新示例文档
* revert: 增加 Data 数据判断
* refactor: 移除对 Data 数据源判断
* chore: 更新索引
* feat: Spinner 组件适配 bs5
* doc: 更新文档说明
* doc: 增加 EditorForm 参数说明
* doc: 更新按钮右侧对齐示例
* doc: 更新 Inline 模式示例
* refactor: 使用 is-center 样式
* chore: 更新样式
* chore: 增加对齐样式
* feat: EditorForm 增加标签对齐参数
2021-08-01 16:31:13 +00:00
Argo
2e684551cd !1669 feat(#I43DYL): add LabelAlign parameter on EditDialog component
* Merge branch 'dev' into dev-editdialog
* Merge branch 'dev' into dev-editdialog
* doc: 更新参数说明
* doc: 增加 EditDialog 弹出右对齐弹窗示例
* refactor: 增加 LabelAlign 参数
* chore: 移除 parameter 标签
* feat: Editdialog 增加 LabelAlign 参数
* refactor: 重命名 TextAlign 为 LabelAlign
* doc: 更新示例弹窗内布局每行 2 个组件
* feat: EditDialog 增加行布局参数
* feat: 编辑搜索弹窗移除 modal-footer 样式
* chore: 更新弹窗 footer 样式
* doc: 更新示例文档
* revert: 增加 Data 数据判断
* refactor: 移除对 Data 数据源判断
* chore: 更新索引
* feat: Spinner 组件适配 bs5
* doc: 更新文档说明
* doc: 增加 EditorForm 参数说明
* doc: 更新按钮右侧对齐示例
* doc: 更新 Inline 模式示例
* refactor: 使用 is-center 样式
* chore: 更新样式
* chore: 增加对齐样式
* feat: EditorForm 增加标签对齐参数
2021-08-01 16:27:43 +00:00
Argo
628b744fd9 !1667 feat(#I43DXD): add LabelAlign parameter on EditorForm component
* Merge branch 'dev' into dev-align
* doc: 更新参数说明
* doc: 更新示例弹窗内布局每行 2 个组件
* feat: EditDialog 增加行布局参数
* feat: 编辑搜索弹窗移除 modal-footer 样式
* chore: 更新弹窗 footer 样式
* doc: 更新示例文档
* revert: 增加 Data 数据判断
* refactor: 移除对 Data 数据源判断
* chore: 更新索引
* feat: Spinner 组件适配 bs5
* doc: 更新文档说明
* doc: 增加 EditorForm 参数说明
* doc: 更新按钮右侧对齐示例
* doc: 更新 Inline 模式示例
* refactor: 使用 is-center 样式
* chore: 更新样式
* chore: 增加对齐样式
* feat: EditorForm 增加标签对齐参数
2021-08-01 16:21:31 +00:00
Argo
9eb11e7ec4 !1668 feat(#I43DY8): remove ad link
* chore: 移除冗余样式
* chore: 移除 ad
* refactor: 微调小按钮位置
* doc: 更改广告位置
* chore: 调整广告位置
2021-08-01 16:19:10 +00:00
Argo
d9cd820544 !1666 feat(#I43CCA): spinner compatible bs5
* chore: bump version to 5.4.4
* feat: Spinner 组件适配 bs5
2021-08-01 03:31:07 +00:00
Argo
3bc979089b !1665 feat(#I43BXP): Checkbox support inline layout
* Merge branch 'dev' into dev-checkbox
* doc: Checkbox 示例更改为 inline 布局
* feat: 适配 Checkbox inline 布局
* feat: 增加 btn-block 样式
* doc: Table 编辑模板增加 inline 布局示例
* feat: EditDialog 增加行布局参数
* doc: SearchDialog 增加行布局示例
* feat: SearchDialog 支持行布局参数
* feat: DialogBase 增加行布局参数
* feat: EditForm 支持 inline 模式
* doc: 更新 Row inline 布局示例
* chore: 更新打包脚本与样式
* doc: 更新注释
* style: 适配 CheckboxList 组件 inline 布局
* style: 适配 inline 模式下 switch 组件
* style: 修复 inline 模式下垂直对齐问题
* feat: 增加 inline 模式
* feat: 增加 inline 样式
2021-07-31 16:58:00 +00:00
Argo
d5017b6e7b !1663 feat(#I43BX5): add btn-block style compatible bs4
* Merge branch 'dev' into dev-block
* feat: 增加 btn-block 样式
* doc: Table 编辑模板增加 inline 布局示例
* feat: EditDialog 增加行布局参数
* doc: SearchDialog 增加行布局示例
* feat: SearchDialog 支持行布局参数
* feat: DialogBase 增加行布局参数
* feat: EditForm 支持 inline 模式
* doc: 更新 Row inline 布局示例
* chore: 更新打包脚本与样式
* doc: 更新注释
* style: 适配 CheckboxList 组件 inline 布局
* style: 适配 inline 模式下 switch 组件
* style: 修复 inline 模式下垂直对齐问题
* feat: 增加 inline 模式
* feat: 增加 inline 样式
2021-07-31 16:47:16 +00:00
Argo
cb5eb42583 !1662 feat(#I43BWZ): EditDialog support Inline layout
* doc: Table 编辑模板增加 inline 布局示例
* feat: EditDialog 增加行布局参数
* doc: SearchDialog 增加行布局示例
* feat: SearchDialog 支持行布局参数
* feat: DialogBase 增加行布局参数
* feat: EditForm 支持 inline 模式
* doc: 更新 Row inline 布局示例
* chore: 更新打包脚本与样式
* doc: 更新注释
* style: 适配 CheckboxList 组件 inline 布局
* style: 适配 inline 模式下 switch 组件
* style: 修复 inline 模式下垂直对齐问题
* feat: 增加 inline 模式
* feat: 增加 inline 样式
2021-07-31 16:38:03 +00:00
Argo
e6766ce550 !1661 feat(#I43BWW): SearchDialog add inline layout
* doc: SearchDialog 增加行布局示例
* feat: SearchDialog 支持行布局参数
* feat: DialogBase 增加行布局参数
* feat: EditForm 支持 inline 模式
* doc: 更新 Row inline 布局示例
* chore: 更新打包脚本与样式
* doc: 更新注释
* style: 适配 CheckboxList 组件 inline 布局
* style: 适配 inline 模式下 switch 组件
* style: 修复 inline 模式下垂直对齐问题
* feat: 增加 inline 模式
* feat: 增加 inline 样式
2021-07-31 16:35:54 +00:00
Argo
098b973bb9 !1660 feat(#I43BWU): add inline layout for EditForm component
* feat: EditForm 支持 inline 模式
* doc: 更新 Row inline 布局示例
* chore: 更新打包脚本与样式
* doc: 更新注释
* style: 适配 CheckboxList 组件 inline 布局
* style: 适配 inline 模式下 switch 组件
* style: 修复 inline 模式下垂直对齐问题
* feat: 增加 inline 模式
* feat: 增加 inline 样式
2021-07-31 16:34:44 +00:00
Argo
200bc26955 !1659 feat(#I43BWR): add inline layout for Row component
* doc: 更新 Row inline 布局示例
* chore: 更新打包脚本与样式
* doc: 更新注释
* style: 适配 CheckboxList 组件 inline 布局
* style: 适配 inline 模式下 switch 组件
* style: 修复 inline 模式下垂直对齐问题
* feat: 增加 inline 模式
* feat: 增加 inline 样式
2021-07-31 16:33:16 +00:00
Argo
646e3813da !1658 feat(#I43BWO): add localization for error message when throw exception
* feat: 增加错误提示信息本地化
* refactor: 调整 z-index 出错时覆盖 header
* doc: 错误信息节点增加 span
* chore: 增加 App 资源文件
2021-07-31 16:32:00 +00:00
Argo
b95eb655a4 !1657 feat(#I43BWN): disable auto close column list dropdown on table component
* feat: Table 组件 ColumnList 下拉框不自动关闭
2021-07-31 16:30:29 +00:00
Argo
a740daefcc !1656 fix(#I43A3Q): resolve cancel button not show when set ShowDeleteButton to false
* chore: bumb version to 5.4.3
* fix: 修复 InCell 模式下不显示 delete 按钮时 cancel 按钮也不可用
2021-07-31 04:40:59 +00:00
Argo
6c3b5ee245 !1655 feat(#I43A1B): resolve can not pick the front day that is disabled in preview month
* doc: 日期范围示例更改为45天
* fix: 修复当月前几个日期无法选中问题
* doc: remove space line
2021-07-31 04:17:01 +00:00
Argo
cc06c39579 !1654 feat(#I439RJ): division source link into targets config file
* refactor: separate source link to target file
2021-07-31 02:58:21 +00:00
Argo
b8c3c5539a !1653 fix(#I439LU): the selected day in other month style is current
* doc: 更新设置时间范围示例
* fix: 修复跨越后当前日期样式错误问题仍然是 current
2021-07-31 02:28:20 +00:00
Argo
7504ef4dee !1651 feat(#I439H7): resolve can pick the date out of range value
* fix: 修复选中设置时间范围外日期时点击确认后仍然改变值
2021-07-31 02:03:16 +00:00
Argo
5cbce6d684 !1650 fix(#I435I5): all menu item will be set active when put menu in route / page
* chore: bump version to 5.4.2
* fix: 修复 / 路由页面内菜单禁用导航后全部被设置为 active 问题
2021-07-30 07:01:55 +00:00
Argo
f821650298 !1649 feat(#I434SC): add loading for Search component
* feat: 增加 Search 组件搜索时 loading 样式
* feat: 重构 AutoComplete 组件移动样式
2021-07-30 04:23:17 +00:00
Argo
3d9c3b9e34 !1648 fix(#I431UW): throw exception when set ShowDetailRow to true use Items as data source in table component
* chore: bump version to 5.4.1
* Merge branch 'dev' into dev-table
* doc: TableColumn 页面表头移除汉字使用资源文件
* fix: 修复 ColumnVisibles 为空导致组件异常问题
2021-07-29 16:23:30 +00:00
Argo
85da2d726b !1647 fix(#I431US): remove static instance in Title service
* doc: 更新 NavMenu 代码使用 TitleService 方法设置 Title
* feat: 重构 TitleService 服务
2021-07-29 16:18:39 +00:00
Argo
a76f17f97e !1646 feat(#I42KQH): reset toast z-index to 1090 when modal is open
* style: 更新 弹窗 打开后 Toast 坐标 1090
2021-07-29 07:55:30 +00:00
Argo-Tianyi
c8c530191a chore: bump version to 5.4.0 2021-07-29 10:54:34 +08:00
Argo
a1965745ff !1645 feat(#I42WFL): refactor dropdown component support dynamic reset items parameter
* doc: 更新 Dropdown 组件动态更新 Items 示例
* feat: Dropdown 支持动态更改 Items
2021-07-29 02:52:46 +00:00
Argo
a724ce9be4 !1644 feat(#I42W80): add ShowEdit/DeleteButtonCallback parameter on Table component
* feat: 增加编辑与删除按钮回调方法用于控制是否显示等功能
2021-07-29 02:34:05 +00:00
Argo
b719c826d6 !1643 doc(#I42VZL): add en json file for install page
* doc: 更改快速上手英文名称
* doc: 添加Install英文资源
2021-07-29 02:14:04 +00:00
Argo
60c7cafb4e !1642 refactor(#I42VKX): remove obsolete method or parameters
* chore: 移除 obsolete 过期方法
2021-07-29 01:34:59 +00:00
Argo
0f936e3ff3 !1641 fix(#I42V4Y): table detail mode colspan incorrect when set ShowColumnList to true
* feat: 明细行合并单元格支持设置列是否显示模式
2021-07-28 16:36:01 +00:00
Nine
34c93e54fd !1639 doc(#I42V3R): add english translation of install page
* Merge branch 'dev' of https://gitee.com/LongbowEnterprise/BootstrapBla…
* doc: 添加Install页面的资源文件以及页面的全球化
* doc: 添加动态输出文字资源文件
* Merge branch 'dev' of https://gitee.com/LongbowEnterprise/BootstrapBla…
* doc(#I42OB8):添加主页页脚资源文件以及全球化
* doc(#I42OB8): 添加主页资源文件以及全球化
* refactor((#I42M9M): 格式化文档
* refactor(#I42M9M): 删除多余命名空间
* doc(#I42M9M): 更新简介文档的url连接
2021-07-28 16:25:58 +00:00
Argo
92424835d8 !1640 fix(#I42V4G): resolve colspan incorrect when set ShowLineNo to true
* fix: 明细行模式下开启 ShowLineNo 后合并单元格数量不正确
2021-07-28 16:18:12 +00:00
Argo
333cc4606c !1638 fix(#I42V1Q): resolve can select item when set IsDisable to true
* chore: bump version to 5.3.6
* fix: 修复禁用逻辑
* feat: 模板增加分组支持
* refactor: 移除 Value 数据
* refactor: 增加禁用模式判断
* fix: 修复 Select 下拉框禁用模式下仍然可选
2021-07-28 15:52:52 +00:00
Argo
ac8c0c3337 !1637 doc(#I42SBY): update footer link align left
* chore: 更新 footer 左对齐
* style: 更新样式
* chore: 更新资源文件
* doc: 增加动态文字样式
2021-07-28 07:48:34 +00:00
Nine
ac67f88581 !1636 doc(I42OB8): add english translation of home page
* doc: 添加动态输出文字资源文件
* Merge branch 'dev' of https://gitee.com/LongbowEnterprise/BootstrapBla…
* doc(#I42OB8):添加主页页脚资源文件以及全球化
* doc(#I42OB8): 添加主页资源文件以及全球化
* refactor((#I42M9M): 格式化文档
* refactor(#I42M9M): 删除多余命名空间
* doc(#I42M9M): 更新简介文档的url连接
2021-07-28 04:30:24 +00:00
Argo
efc817ec5b !1635 fix(#I42O73): resolve introduction throw exception when call dispose
* fix: 修复 Dispose 时报错问题
* doc: update resource file
2021-07-27 14:06:01 +00:00
Nine
d57d04b69f !1634 doc(#I42M9M): refactor localizer of Introduction doc
* refactor((#I42M9M): 格式化文档
* refactor(#I42M9M): 删除多余命名空间
* doc(#I42M9M): 更新简介文档的url连接
2021-07-27 13:33:40 +00:00
Argo
38b06117d4 !1633 feat(#I42JZQ): add BeforeRowButtonTemplate on Table component
* doc: 增加 BeforeRowButtonTemplate 文档说明
* doc: 更新 BeforeRowButtonTemplate 文档
* feat: Table 组件增加 BeforeRowButtonTemplate
2021-07-27 03:52:14 +00:00
Argo-Tianyi
85e8a5b590 chore: bump version to 5.3.4 2021-07-27 10:08:48 +08:00
Argo
0e1278d312 !1632 fix(#I42ETN): add active row style in DetailRow mode
* chore: bump version to 5.3.3
* fix: 修复明细行模式下选中行样式
2021-07-26 18:09:08 +00:00
Argo
95390dd9bc !1631 chore(#I42HAV): redesign bundle config file
* chore: 重构项目内部脚本与样式文件打包配置
2021-07-26 11:56:40 +00:00
Argo
d0682ae9b1 !1630 doc(#I42B4W): rename css/javascript file name
* chore: 打包脚本排序
* refactor: 移除 hotReloadProfile 配置项
* chore: 更新打包配置文件
* doc: rename file name
* chore: add file nesting config
* refactor: 更新 Alert 样式
2021-07-25 16:22:41 +00:00
Argo
53ecc3867d !1629 doc(#I42B4N): refactor introduction page
* refactor: 增加 cs 文件
* doc: 更新资源文件内容
2021-07-25 16:19:36 +00:00
Nine
343a37e2e0 !1628 doc(I429JT): add English translation of profile page
* doc :  遗漏简介页面文档
* doc: Introduction 页面添加英文翻译
2021-07-25 13:45:33 +00:00
Argo
93240d3e1c !1627 feat(#I429IM): add strip css for table detail function
* chore: bump version to 5.3.2
* style: 修复明细行下背景色问题
* style: 修复固定列最右侧滚动条列被穿透问题
2021-07-24 12:24:38 +00:00
Argo
a84771f7b2 !1626 feat(#I423Q9): add ShowFilterHeader parameter on Table component
* doc: 更新示例
* feat: 字符串类型过滤条件增加实时响应功能
* feat: ValidateBase 增加 OnValueChanged 回调方法
* feat: 重构 父类 OnFilterValueChanged 方法
* feat: DateTimePicker 增加 OnDateTimeChanged 回调方法
* feat: 增加清除过滤条件逻辑
* style: 增加清除过滤条件按钮样式
* feat: 增加清除过滤条件逻辑
* doc: 过滤行示例代码增加枚举与布尔类型
* feat: Dropdown 支持集成
* feat: 过滤组件支持 FilterRow 模式
* refactor: 更改 IsRow 为 IsHeaderRow
* feat: TableFilter 支持过滤行逻辑
* style: 微调 FilterButton 样式
* feat: 增加 FilterButton 按钮
* Merge branch 'dev' into dev-table
* doc: 更新测试示例
* style: 增加多表头样式
* feat: 增加 ShowFilterHeader 配置
* doc: 合并 Filter 代码
2021-07-23 04:34:02 +00:00
Argo
aa3455c6e2 !1625 feat(#I423P6): add OnValueChanged callback on ValidateBase component
* doc: 更新 Cascader 参数文档
* feat: ValidateBase 增加 OnValueChanged 回调方法
* feat: Dropdown 支持集成
2021-07-23 04:24:20 +00:00
Argo
790ce871af !1624 feat(#I420W5): set Display empty default height to 35px
* style: 增加 Display 空值时高度
2021-07-22 11:40:31 +00:00
Argo
36113acf41 !1623 fix(#I420F0): update Select for not render selected item
* chore: bump version to 5.3.0
* doc: 更新示例文档
* doc: 更新 Select 示例
* fix: 更新 SelectedItem 逻辑
2021-07-22 10:41:15 +00:00
Argo
8f670a6281 !1622 fix(#I41ZUB): resolve localization in WTM not retrieve right resource from resx file
* fix: 修复本地化上一个工厂未找到资源逻辑判断
* refactor: 优化 Factory 类增加修饰符
2021-07-22 09:37:37 +00:00
Argo
139b9e0327 !1621 feat(#I41UHU): toolbar on table compatible bs5
* chore: bump version to 5.2.5
* fix: 修复 Table 组件搜索按钮工具栏未适配 bs5 问题
2021-07-21 15:03:21 +00:00
Argo
accafea5a7 !1620 feat(#I41UHR): Switch compatible in Table
* style: 增加 Switch 在 Table 组件内样式
2021-07-21 14:59:40 +00:00
Argo
3d541beae7 !1619 feat(#I41UE4): bootstrap blazor compatible the third part localization
* chore: bump version to 5.2.4
* refactor: 优化代码
* chore: 增加 DI 引用
* feat: 更新逻辑取被 BB 覆盖的本地化引擎
* feat: 支持 abp 本地化实验
2021-07-21 13:55:43 +00:00
circlelee1981
b7c4a1f6ea !1617 fix(#I41GPD): update StringFilter the default value
* update StringFilter.razor.cs string类型默认筛选条件修正
2021-07-20 01:58:35 +00:00
Argo
abbec239b6 !1615 fix(#I40STK): resolve colspan incorrect when set IsMultipleSelected to true
* chore: 更新打包文件
* fix: 修复开启多选后明细行 colspan 不正确问题
2021-07-18 17:06:54 +00:00
Argo
1fb750a295 !1614 fix(#I4175P): tab support not found render template
* feat: Layout 增加 NotFound 模板
* feat: Tab 组件增加 NotFound 模板
* feat: 增加资源文件
2021-07-18 16:18:23 +00:00
Argo
d2a0bdf863 !1613 doc(#I418DH): update carousel in home page
* chore: bump version to 5.1.2
* chore: 微调走马灯指示条颜色
* doc: 更改生态位置
* doc: 增加图片超链接
* doc: 更新 readme.md
* doc: 增加驰骋工作流链接
2021-07-18 13:34:52 +00:00
Argo
67548bee4e !1612 fix(#I40ISO): resolve can't selected the item return by OnSearchTextChanged callback
* fix: 修复 OnSearchTextChanged 导致选项无法选中问题
* doc: format document
2021-07-18 08:27:43 +00:00
Argo
b0170dcae1 !1611 fix(#I417RK): resolve throw exception when set ShowSearch to true on Select
* fix: 修复 Select 组件设置 ShowSearch 时回车提交报错问题
2021-07-18 06:56:51 +00:00
Argo
0b7b9610bc !1610 fix(#I417MJ): resolve throw exception in browser when select switch the active item in ValidateForm
* chore: 移除对 map 的依赖
* chore: 更新样式适配 bs5
* refactor: 增加 div 用于 tooltip 渲染
* revert(#I40ISO): 撤销提交
2021-07-18 04:43:29 +00:00
Argo
9029f7bfbf !1609 fix(#I40O7E): resolve filter dialog show on wrong position when fixed column
* fix: 修复固定列后过滤弹窗错位问题
2021-07-18 02:29:54 +00:00
Argo
65bd70e4cb !1608 fix(#I4163B): toast compatible bootstrap v5
* chore: bump version to 5.2.1
* fix: toast 组件适配 bs5
* chore: update props config error
* Squashed commit of the following:
2021-07-17 07:51:30 +00:00
Argo-Tianyi
db88ae9451 chore: bump version to 5.2.0 2021-07-17 14:41:23 +08:00
Argo
cd2b332881 !1607 feat(#I415NR): upgrade bootstrap to v5
* !1606 feat(#I415MH): colorpicker 适配 bs5
* !1605 feat(#I415CU): editor compatible bs5
* !1604 doc(#I40VVA): update tag sample code
* !1603 feat(#I40VV8): tag compatible bs5
* chore: bump version preview-6.0
* style: 微调 z-index 防止 header 被遮挡
* style: 微调 Select 组件小箭头样式
* refactor: 移除所有 form-inline form-group form-row
* doc: 微调 Index 样式
* refactor: coms 组件移除 form-inline
* doc: 组件页面适配 bs5
* refactor: SkeletonEditor 适配 bs5
* refactor: Camera 适配 bs5
* refactor: BarcodeReader 适配 bs5
* refactor: 更新 Upload 组件适配 bs5
* docs: 更新 tooltip 组件文档
* refactor: 重构 toggle 样式
* doc: Toasts 适配 bs5
* doc: textarea 适配 bs5
* doc: tabs 适配 bs5
* doc: switch 适配 bs5
* doc: swal 适配 bs5
* doc: Spinners 适配 bs5
* doc: Slider 适配 bs5
* doc: skeletons 适配 bs5
* refactor: Rates 适配 bs5
* refactor: Progress 适配 bs5
* !1601 feat(#I40LIR): DateTimePicker compatible bs5
* !1598 feat(#I40FRB): checkbox compatible bs5
* !1597 feat(#I40EW8): Cascader component compatible bs5
* !1596 feat(#I40E3S): row component compatible bs5
* !1595 feat(#I40DO6): dialog compatible bs5
* refactor: 解决 Transition 冲突
* Merge branch 'dev' into dev-bs5
* !1594 feat(#I40DN7): modal compatible bs5
* !1591 feat(#I40BGR): popover compatible bs5
* !1590 feat(#I40BGU): remove form-inline and form-group style sheet
* !1589 feat(#I40BGT): carousel compatible bs5
* !1588 feat(#I40BGS): auto expand by active item compatible bs5
* !1584 feat(#I404I2): popover compatible bs5
* !1583 feat(#I404I1): menu compatible bs5
* !1582 feat(#I404I0): longbow.lgbTab compatible bs5
* !1581 feat(#I403YI): table compatible bs5
* !1580 feat(#I403P0): badge remove base class add text-dark for info/warning
* !1579 feat(#I402YZ): dropdown widget compatible bs5
* !1578 feat(#I402YW): dropdown compatible bs5
* chore: 修复 Layout tooltip 不显示问题
* Merge branch 'dev' into dev-bs5
* !1577 feat(#I4020C): text-left/right compatible bs5
* !1576 feat(#I40203): tooltip compatible bs5
* !1575 refactor(#I401VC): remove form-select-input style from select component
* !1573 feat(#I401KX): collapse compatible bs5
* !1572 feat(#I4017Z): alert component compatible bs5
* !1571 feat(#I400W8): toggle compatible bs5
* !1570 feat(#I400RV): badge compatible bs5
* !1568 doc(#I4000I): redesign index layout compatible bs5
* !1567 feat(#I3ZZXX): margin/float css compatible bs5
* !1566 feat(#I3ZZUR): dropdown compatible bs5
* !1565 feat(: layout compatible bs5
* !1563 feat(#I3ZZPI): select compatible bs5
2021-07-17 06:38:25 +00:00
Argo-Tianyi
fc7d4b8630 chore: bump version to 5.1.4 2021-07-14 16:25:24 +08:00
Argo
c7d54d4f47 !1602 feat(#I40N2J): upgrade Formatter callback on TableColumn
* feat: 优化 Formatter 参数更改为 TableColumnContent 泛型
2021-07-14 07:59:23 +00:00
Argo
ff4b0d2434 !1600 refactor(#I40KEK): rename Data parameter to Lookup on Display component
* refactor: Display 组件 Data 更改为 Lookup
2021-07-14 02:56:14 +00:00
Argo
b49da5c8e7 !1599 fix(#I40ISO): resolve not show selected text when set OnSearchTextChanged callback
* fix: 修复自定义查询过滤条件时无法选中问题
2021-07-13 14:57:24 +00:00
Argo
15fbb06bae !1593 fix(#I40DLM): Modal show method can't show modal twice
* fix: 修复 Show 二次无法弹出对话框问题
2021-07-13 04:13:28 +00:00
Argo
3313e0b150 !1587 doc(#I40B2C): add Duration sample code
* doc: 增加 Duration 参数说明
* refactor: 微调方法名称
* doc: 增加设置时长示例代码
* doc: 优化 Transition 示例
2021-07-12 12:16:53 +00:00
Argo
9e3fb143b5 !1586 feat(#I40B0E): add duration parameter on Transition component
* feat: 增加 Duration 功能
2021-07-12 11:57:12 +00:00
Argo
f8459a7167 !1585 feat(#I4073Q): display component support customer class style sheet
* chore: bump version to 5.1.2
* feat: Display 组件支持自定义 class
2021-07-12 05:23:04 +00:00
Argo
69128eca17 !1574 refactor(#I401L8): improve Transition component and format doc
* fix: 增加合并 class 样式逻辑
* chore: 更新打包文件
* doc: 格式化文档
* refactor: 重构 Transition 组件增加注释
* chore: 格式化 js 脚本文件
* chore: 格式化项目文件
2021-07-10 07:22:06 +00:00
Argo
8398cbfc3a !1569 fix(#I4004S): not show body data when set Items and OnQueryAsync both
* chore: bump version to 5.1.1
* fix: 修复同时设置 Items 与 OnQueryAsync 时不显示内容问题
2021-07-09 15:02:18 +00:00
Argo-Tianyi
f8d1bbf78f Revert "!1564 feat(#I3ZZR5): layout compatible bs5"
This reverts commit af34f38476.
2021-07-09 20:24:46 +08:00
Argo
af34f38476 !1564 feat(#I3ZZR5): layout compatible bs5
* doc: 精简模板页样式
* !1563 feat(#I3ZZPI): select compatible bs5
2021-07-09 12:07:24 +00:00
Argo
670b6c910d !1561 fix(#I3ZW5B): resolve no data show in body first render on Table component
* chore: bump version to 5.1.0
* fix: 修复 Query 导致表格未显示数据
2021-07-09 04:03:26 +00:00
Nine
27d521420e !1559 feat(#I3QMQS): add Transitions component
* refactor:移动 Animate 样式到 组件内部
* docs:优化 Transition 文档
* refactor:删除  Enums 命名空间
* docs:移除文档中的 Enums 命名空间
* docs:更新 Transition 组件为新组件
* build:移除 props 文件中 bundle 配置
* feat : Transition组件 文档完成
* feat: Transition 组件完成
2021-07-08 09:04:11 +00:00
ReaZhuang
1a11547f55 !1560 perf(#I3ZQV4): improve AutoComplete keyboard event performance
* fix AutoComplete keyboard event
2021-07-08 08:40:40 +00:00
Argo-Tianyi
1779c62de3 chore: bump versionto 5.0.38 2021-07-08 10:40:47 +08:00
Argo
faa82ff0c5 !1558 doc(#I3ZLCU): update AutoComplete component doc
* doc: 更新 AutoComplete 组件参数文档
2021-07-07 16:22:12 +00:00
Argo
7a04736a36 !1557 doc(#I3ZLCR): update table fix column sample code
* doc: 更新菜单标记
* doc: 更新固定列文档
2021-07-07 16:15:06 +00:00
Argo
edebcd9da6 !1556 feat(#I3ZLCL): table fix column feature compatible light/dark header mode
* style: 增加 light dark 下固定列背景色适配
* fix: 增加 fix 背景色防止穿透
* fix: 防止鼠标悬停时表头穿透
2021-07-07 16:10:37 +00:00
Argo
5b38756101 !1554 feat(#I3ZKQU): keep original header when set MultipleTemplate on Table component
* chore: bump version to 5.0.38-beta06
* doc: 更新示例
* feat: 多表头时保持原始表头功能
* chore: 更新计算 filter 出现窗口位置方法
* chore: 更新多标头样式
2021-07-07 11:21:08 +00:00
Argo
70d827a6af !1552 fix(#I3ZJVJ): add localization for tooltip on table header sort function
* chore: bump version to 5.0.38-beta05
* doc: 增加表头排序 Tooltip 文档
* feat: Table 表头排序提示信息支持本地化
* doc: 增加排序 Tooltip 本地化
* chore: 更新 Table 客户端脚本支持 Tooltip 本地化
2021-07-07 09:27:37 +00:00
Argo
aea634d4ec !1551 fix(#I3ZDH6): resolve not expand child nodes in Table component
* fix: 修复 TableTree 失效问题
2021-07-06 11:31:11 +00:00
Argo
f74d459d11 !1550 fix(#I3ZDRF): can't check the row when set ClickToSelect to true in mobile mode
* fix: 移动端开启多行选择与 ClickToSelect 时 Checkbox 点击无效
2021-07-06 10:12:34 +00:00
Argo
b39ebcb782 !1549 fix(#I3Z9FG): can not checked the item click checkbox when set IsMultiple is true
* fix: 阻止事件冒泡
2021-07-06 02:26:25 +00:00
Argo
657a6293e9 !1548 fix(#I3Z9DJ): resolve filter popup show in wrong place
* script: 更新 Filter 弹窗脚本调用方式修复动态列过滤弹窗位置不正确问题
* doc: 增加 Filter 示例
2021-07-06 02:22:30 +00:00
Argo
3ac0341f43 !1547 revert(#I3Z3W8): missing DisplayName when only use AutoGenerateColumnAttribute
* chore: bump version to 5.0.38-beta04
* revert: 恢复 DisplayName 获取方法
* doc: 修复文档链接失效问题
2021-07-05 06:14:38 +00:00
Argo
e103d7f0ae !1546 doc(#I3Z3HQ): update only show advance search button sample code
* doc: 增加文档更新标签
* doc: 增加仅显示高级搜索示例
* fix: 修复语法错误
* doc: 增加 ShowSearchText 参数文档
2021-07-05 04:57:32 +00:00
Argo
a9f540bc00 !1545 feat(#I3Z3FZ): add ShowSearchText parameter on Table component
* feat: 增加 ShowSearchText 参数用于控制是否显示搜索文本框默认 true
2021-07-05 04:38:16 +00:00
Argo
bf5fc32f39 !1544 fix(#I3Z3BD): resolve CreateCallback delete use wrong cache key
* chore: bump version to 5.0.38-beta03
* fix: 修复 CreateCallback 缓存键值错误
2021-07-05 04:01:54 +00:00
Argo
61448d43ba !1543 feat(#I3Z2ZB): add common Attribute extensions methods
* refactor: 增加扩展方法
* refactor: 增加参数标识
* doc: 更新扩展方法示例
* feat: 增加扩展方法
2021-07-05 03:28:47 +00:00
Argo
ed3a77fa2f !1542 feat(#I3Z2TU): add dynamic assembly check in GetDisplayName method
* refactor: 支持自定义属性逻辑与以前一致
* refactor: 优化内部逻辑
* feat: 增加 InternalTable GetProperties 重载
* feat: GetDisplayName 逻辑兼容动态程序集
2021-07-05 03:18:40 +00:00
Argo
8bc5415bc0 !1541 fix(#I3Z2NH): resolve set ComponentType on AutoGenerateColumnAttribute not working issue
* fix: 修复 InternalTableColumn 未拷贝 ComponentType 值问题
* doc: 格式化示例文档
2021-07-05 03:04:37 +00:00
Argo
873c491aa1 !1540 feat(#I3Z00I): table support dynamic change column when use DataTable as datasource
* feat: 更新 Table GetValue 方法支持动态类型
* refactor: 更新 AddAutoGenerateColumnAttribute 参数
* refactor: 移除不用的命名空间
* doc: 增加动态列调整示例
* feat: 增加对动态类型列调整后更新数据逻辑
* refactor: 优化 Columns 属性逻辑移除 Lazy
* doc: 更新资源文件
* refactor: 精简代码
* feat: 移除 static 关键字
* refactor: 增加 IDynamicObject 接口
* doc: 增加注释文字
* Merge branch 'dev' into dev-dynamic
* feat: 扩展方法支持 AutoGenerateColumnAttribute 标签
* doc: 增加自定义验证标签示例
* feat: 增加验证标签逻辑
* feat: 增加动态对象上下文扩展方法
* refactor: 资源文件读取时增加动态程序集判断
* feat: 实现 DataTable 的增删改查功能
* feat: ValidateForm 资源文件查找增加动态程序集过滤
* refactor: 使用 nameof 代替字符串
* feat: 增加 Lazy 优化 GetColumns 性能
* refactor: QueryData 支持动态类型
* revert: 重置 SetPropertyValueLambda 方法
* doc: 移除 TODO
* refactor: 更新 DynamicObjectContext 消除警告
* Merge branch 'dev' into dev-dynamic
* feat: 增加动态类型逻辑
* feat: IDynamicObject 移除 ICloneable 接口
* Merge branch 'dev-emit' into dev-dynamic
* feat: 增加动态类生成辅助类
* doc: 更新示例
* feat: 准备使用 Emit 动态生成对象用于生成 Lambda 表达式
* feat: 增加设置默认值方法
* feat: 完善 Clone 方法
* feat: 完善 Clone 方法
* feat: 增加 Clone 功能
* feat: 增加保存功能
* feat: 更新编辑示例
* feat: 模型读写支持动态类型
* feat: 增加编辑功能
* feat: EditorForm 级联模型判定更新允许使用子类
* refactor: 移除不用的命名空间
2021-07-04 05:02:16 +00:00
Argo
53ee7f78b5 !1539 feat(#I3Z008): support add customer Attribute on dynamic class property
* refactor: 更新 EmitHelper 帮助类
2021-07-04 04:57:24 +00:00
Argo
28d64821e2 !1538 refactor(#I3YZVB): remove ICloneable from IDynamicObject
* refactor: 移除  ICloneable 接口
* refactor: 增加 IDynamicObject 接口
* doc: 增加注释文字
2021-07-04 02:41:29 +00:00
Argo
06ce616e95 !1537 refactor(#I3YZMP): update SelectedRows logic on Table component
* fix: 修复 SelectRows 数据被清空问题
2021-07-03 15:25:40 +00:00
Argo
79778a0f81 !1536 doc(#I3YZMG): add auto render after change Items parameter sample code
* doc: 更新 Table 数据源变化示例
* feat: 支持 Items 属性变化时更新 UI
* refactor: 更新 Table 内部 Items 逻辑区分 Items 与 Query 结果
* doc: 移除不使用的方法
2021-07-03 15:17:15 +00:00
Argo
cbf28f292e !1535 feat(#I3VXUH): support auto render UI after Items has changed
* feat: 支持 Items 属性变化时更新 UI
* refactor: 更新 Table 内部 Items 逻辑区分 Items 与 Query 结果
* doc: 移除不使用的方法
2021-07-03 15:14:13 +00:00
Argo
35a9fa857c !1534 feat(#I3VXUA): DateTime default set Value to DateTime.Now when equals DateTime.MinValue
* doc: 更新菜单状态
* doc: 更新 DatetimePicker 示例
* feat: 时间组件不允许为空时如果时间为最小时间默认当前时间
2021-07-02 16:24:05 +00:00
Argo
0e929ab2c1 !1533 fix(#I3YX2M): resolve the delete button on CardUpload not working
* release: bumb version to 5.0.38-beta01
* fix: 修复删除按钮未刷新 UI 问题
2021-07-02 11:41:10 +00:00
Argo
b40f10f731 !1532 fix(#I3Y4XW): resolve show upload card when set IsSingle to true
* fix: 修复设置 IsSignle 后仍然显示上传框问题
2021-07-02 11:37:16 +00:00
Argo
0100cd6750 !1531 refactor(#I3YTYH): update logic for IDynamicObject datasource on Table component
* refactor: 更新 Table 组件动态类型获取 GetItems 逻辑
2021-07-02 05:40:17 +00:00
Argo
4d963f7683 !1530 feat(#I3YTWL): ValidateForm support dynamic assembly check
* feat: 验证表单组件支持动态程序集判断
2021-07-02 05:33:33 +00:00
Argo
92cff04cb8 !1529 feat(#I3YTVC): Utility extensions method support dynamic assembly
* refactor: Utility 资源文件判断是否为动态程序集
* refactor: 移除 ICloneable 接口
* refactor: 格式化代码
2021-07-02 05:24:03 +00:00
Argo
a5524670ae !1528 doc(#I3YTTE): update IsOnlyRenderActiveTab sample code
* doc: 更新菜单状态
* doc: 增加 Tab 仅渲染当前标签页方法
* feat: 增加仅渲染当前 Tab 标签页控制参数 IsOnlyRenderActiveTab
2021-07-02 05:06:29 +00:00
Argo-Tianyi
b6ac4a612f chore: bump version to 5.0.37 2021-07-01 23:06:47 +08:00
Argo
54d3eca9f4 !1527 feat(#I3YRJ9): add IsOnlyRenderActiveTab parameter on Tab
* feat: 增加仅渲染当前 Tab 标签页控制参数 IsOnlyRenderActiveTab
2021-07-01 14:56:28 +00:00
Argo
ba2b33da46 !1526 feat(#I3YF5T): allow subclass of TModel of EditorForm from ValidateForm
* feat: EditorForm 级联模型判定更新允许使用子类
2021-06-29 16:38:52 +00:00
Argo
1974d083d6 !1525 feat(#I3YF59): add EmitHelper static class
* feat: 更新 EmitHelper 操作类
* feat: 增加动态类型逻辑
* feat: 增加动态类生成辅助类
2021-06-29 16:09:23 +00:00
Argo
3ae8e3938d !1524 refactor(#I3YEPI): ToastBox should inherit IDispose interface
* feat: 增加 IDispose 接口
2021-06-29 12:45:03 +00:00
Argo
e670269d0c !1523 fix(#I3YB14): not render when delete tab which the last tab not active
* chore: bump version to 5.0.37-beta04
* fix: 修复 Tab 选中中间标签删除时 UI 未刷新问题
2021-06-29 05:14:38 +00:00
Argo
ffb796b65e !1522 fix(#I3Y8M6): update style for InCell edit on TableSize is Compact
* chore: bump version to 5.0.37-beta03
* fix: 修复紧凑版 InCell 编辑模式样式
* refactor: 修复 InCell 模式取消按钮图标
2021-06-28 17:30:35 +00:00
Argo
1dc90525b2 !1521 doc(#I3Y3LG): add DataTable as data source used in Table component sample code
* doc: 更新示例代码
* feat: 内置 DataTable 自动获取 Items 功能
* refactor: DynamicObject 类移除虚类关键字
* refactor: 删除 Base 基类
* doc: 更新示例
* refactor: 重构代码
* doc: 增加 DataTable 支持示例
* feat: 增加 DataTable 支持
* refactor: 移除不使用的命名空间
2021-06-28 05:18:23 +00:00
Argo
a2ba55fb54 !1520 feat(#I3Y3L8): table component support DataTable as data source
* feat: Table 组件未设置数据源时动态数据自动生成
* feat: Table 组件支持动态对象 DataTable
* feat: 增加动态对象与上下文
* doc: remove unused namespace
2021-06-28 05:15:32 +00:00
Argo
2f4b9c0a2f !1519 refactor(#I3XZ71): improve Items inside Table component logic
* refactor: 优化 Items 逻辑
2021-06-27 01:45:37 +00:00
Argo
6a0fb7023e !1518 doc(#I3XYYS): add submit form async sample code
* refactor: 重构代码消除警告信息
* chore: bump version to 5.0.37-beta02
* doc: 更新验证表单菜单标志
* doc: 更新异步提交表单示例
2021-06-26 16:54:56 +00:00
Argo
b828b49351 !1517 perf(#I3XYYL): improve ValidateForm performace
* perf: 优化 ValidateForm 内部逻辑提高性能
2021-06-26 16:49:05 +00:00
Argo
a72cc715b1 !1516 fix(#I3XY2H): resolve show bootstrap validate tooltip when set SkipValidate
* chore: bump version to 5.0.37-beta01
* fix: 修复设置 SkipValidate 后 bootstrap 仍然进行验证
2021-06-26 08:39:13 +00:00
大胃Q
03893365d6 !1515 feat(#I3XWCK): add lazy loading feature on Tree
* Tree  添加懒加载相关功能
2021-06-25 12:29:54 +00:00
Argo
248cdb3890 !1513 feat(#I3XPW2): add SkipValidate on IEditorItem interface
* feat: 增加 SkipValidate 参数
* refactor: 优化 Utility 操作类
* refactor: 重构 Clone 代码
2021-06-24 11:57:32 +00:00
Argo-Tianyi
853224f56b release: bump version to 5.0.36 2021-06-24 07:47:41 +08:00
Argo
539be91da6 !1512 perf(#I3XIF0): refactor header Checkbox improve table performace
* chore: bump version to 5.0.36-beta10
* refactor: 移除表头 Checkbox 设置状态逻辑优化性能
2021-06-23 15:02:56 +00:00
Argo
9ec5e38a1c !1511 perf(#I3XIEJ): improve Checkbox performace
* refactor: 优化 Checkbox 内部逻辑方式进入死循环
2021-06-23 14:58:15 +00:00
Argo
f3c49bfc70 !1510 fix(#I3XIDI): can not checked the Checkbox on Table when Items is IEnumerable<T>
* refactor: 组件内部 Items 使用 List
2021-06-23 14:53:07 +00:00
Argo
34173fecdc !1509 fix(#I3XAJN): resolve EditTemplate not work in EditInCell mode
* chore: bump version to 5.0.36-beta09
* doc: 更新 InCell 编辑使用模板示例
* fix: 修复 InCell 模式下编辑模板未生效问题
2021-06-22 23:42:45 +00:00
Argo
880bbc70d4 !1508 fix(#I3X8QR): add comma end of the style on Switch component
* chore: bump version to 5.0.36-beta08
* fix: 修复 Switch 组件 style 缺失结束符
* doc: 更新注释
2021-06-22 14:57:21 +00:00
Argo
6dc4cf0ace !1507 doc(#I3WROS): update DateTimePicker in ValidateForm sample code
* Merge branch 'dev' into dev-datetime
* chore: bump version to 5.0.36-beta07
* doc: 更新时间选择框组件客户端验证示例
* fix: 修复时间框验证失败时未弹出 Tooltip 问题
* doc: 整理代码
2021-06-21 23:15:09 +00:00
Argo
104fa0e9e4 !1506 fix(#I3WBE9): resolve not show tooltip when validate failed on DateTime component
* fix: 修复时间框验证失败时未弹出 Tooltip 问题
* doc: 整理代码
2021-06-21 23:10:53 +00:00
Argo
c939f88aa5 !1505 doc(#I3WCI4): add ShowHeaderCloseButton sample code
* doc: 增加禁用标题栏右侧按钮示例
* chore: 更新菜单标志
* chore: bump version to 5.0.36-beta06
* refactor: DialogParameters 更改为只读属性
* feat: ModalDilaog 增加 ShowHeaderCloseButton 参数
2021-06-21 00:09:52 +08:00
Argo
b05a5fb0a8 !1504 feat(#I3WCHU): add ShowHeaderCloseButton parameter on Dialog
* chore: bump version to 5.0.36-beta06
* refactor: DialogParameters 更改为只读属性
* feat: ModalDilaog 增加 ShowHeaderCloseButton 参数
2021-06-21 00:06:42 +08:00
Argo
6a7305640c !1503 feat(#I3WAWM): add HasChildrenCallback func on Table component
* chore: bump version to 5.0.36-beta05
* doc: update comment for HasChildrenCallback
* feat: 增加 HasChildrenCallback 回调委托方法
2021-06-20 10:20:39 +08:00
Argo
a34408db77 !1502 doc(#I3WAW4): update sample code for IsDetails parameter
* doc: 更新菜单状态
* doc: 增加 IsDetails 示例
* doc: 增加 IsDetail 说明文档
* doc: 增加明细行按钮资源文件
* refactor: update comment
2021-06-20 09:46:52 +08:00
Argo
343e2288b1 !1501 feat(#I3WABX): add IsDetails parameter on Table component
* fix: 修复错误
* feat: 更新 ShowDetails 逻辑
* chore: bump version to 5.0.36-beta03
* feat: Table 组件增加 IsDetail 属性
2021-06-19 19:29:19 +08:00
Nine
30e42d9607 !1498 fix(#I3VOT3): show content in advance search dialog
* fix: 修复高级弹窗无内容问题
2021-06-18 12:53:35 +08:00
爱吃油麦菜
b523e54728 !1497 feat(#I3V0D1): add color parameter on RadioList component
* doc: add sample code for radio list color
* feat: add color parameter on RadioList
2021-06-18 12:14:53 +08:00
Argo
221b33446f !1496 doc(#I3W46B): add sample code for editor form customer component type
* chore: bump version to 5.0.36-beta02
* doc: update component status
* doc: 增加 EditItem 指定 ComponentType 示例
2021-06-18 11:44:51 +08:00
Argo
53578f8a37 !1495 feat(#I3W44K): edit item support set ComponentType parameter inline
* fix: 增加 Select 组件额外设置
* fix: 修复 EditorForm 对 ComponentType 支持
* refactor: 移除集合属性 set 关键字
2021-06-18 11:38:45 +08:00
最后一页
73d6011d20 !1494 feat(#I3W34J): edit form auto generate support customer component Select<>
* lz
2021-06-18 10:12:04 +08:00
爱吃油麦菜
32562c59d7 !1493 fix(#I3W0JF): resolve empty body in advance search dialog
* fix: 修复搜索按钮不显示内容问题
* fix: 修复重置按钮文字不正确问题
* refactor: 重置按钮颜色更改为 Secondary
* fix: Reset 方法增加只读属性过滤
2021-06-17 20:36:16 +08:00
Argo-Tianyi
dcc056d56e Merge branch 'dev-EditInCell' into dev 2021-06-17 17:23:22 +08:00
Nine
69dd835ef2 !1492 单元格编辑功能
* feat: add edit in cell feature
2021-06-17 16:53:20 +08:00
Argo-Tianyi
69694bc6a6 chore: bump version to 5.0.35 2021-06-17 16:50:37 +08:00
Argo
f14b8e8cec !1491 feat(#I3V2K1): add edit in cell feature
* Merge branch 'dev' into dev-table-incell-edit
* fix: EditInCell 模式下更改选中项时自动取消正在编辑的数据
* fix: 修复 EditForm 未出现编辑框问题
* refactor: 重构代码服用 Value Change Expression
* feat: 增加行内编辑逻辑
* feat: 增加取消编辑逻辑
* doc: 增加更新按钮与取消按钮资源文件读取
* chore: 增加资源文件
* style: 更新编辑样式
* feat: 增加 InCell 编辑生成组件功能
* feat: 增加渲染单元格功能
* refactor: 移除未使用的代码
* refactor: 精简 AutoGenerateTemplate 方法
* refactor: 移动通过数据类型生成组件方法到工具类中
* doc: add InCell sample code
* feat: add InCell mode
* refactor: rename GenerateComponentType
* refactor: 移动 GenerateComponent 方法到 Utility 中
2021-06-16 19:05:03 +08:00
Argo
9d98418171 !1490 fix(#I3VTXW): remove EditInCell segment
* fix: comment EditInCell segment
2021-06-16 17:33:58 +08:00
Argo
53e61919b1 !1489 fix(#I3VPUY): resolve row status incorrect when switch edit row under edit in cell mode
* fix: EditInCell 模式下更改选中项时自动取消正在编辑的数据
2021-06-16 10:06:03 +08:00
Argo
3a3298ce4b !1488 fix(#I3VOT3): can't edit row when click edit button in toolbar on edit form mode
* fix: 修复 EditForm 未出现编辑框问题
2021-06-15 22:36:44 +08:00
Argo
b4b1357b49 !1486 doc(#I3VFRB): update route parameter sample code
* doc: 增加路由参数示例
* chore: 更新版本号
* doc: 增加为空检测代码
2021-06-12 16:59:35 +08:00
Argo
df89d34bca !1485 refactor(#I3VFCV): refactor code for remove !
* refactor: 增加可为空限定
* refactor: 重构 ServiceProviderHelper 类
* chore: remove ! synx
* docs: 更改 Bar Chart 示例
2021-06-12 13:05:54 +08:00
紫夜
166bb8d0a5 !1484 fix(#I3VFB5): resolve throw exception when call show after click X close modal 2021-06-12 13:00:01 +08:00
Argo
d05c7387dd !1483 refactor(#I3VBCQ): update EFCore extensions project configuration file
* refactor: 重构代码消除警告信息
* fix: 修复 EFCore 扩展组件条件
* refactor: 消除警告信息
2021-06-11 12:33:35 +08:00
Argo
193b2d6ef3 !1482 feat(#I3VBB7): enable hot reload
* feat: enable hot reload feature
* chore: 更新项目文件支持 net6.0-preview4
* chore: 增加配置文件
* chore: 恢复框架为 5.0
* wip: update target framework
* feat: enable hot reload
2021-06-11 12:12:56 +08:00
Argo
a8da97307c !1481 refactor(#I3VB64): resolve warning message
* feat: 更新 PV 消除警告信息
* chore: 更新工程配置文件
* chore: 移除警告信息
* refactor: 更新 KV 参数类型
* refactor: 消除警告信息
* refactor: 更新参数
2021-06-11 11:49:50 +08:00
Argo-Tianyi
6b521def1b chore: update dependence lib version 2021-06-10 13:06:30 +08:00
Argo-Tianyi
1128cd93a7 release: bump version to 5.0.34 2021-06-10 12:46:21 +08:00
Argo
fe263f1259 !1480 feat(#I3V0D1): add RadioList component
* chore: 适配其他组件
* refactor: 更新 Radio 组件
* refactor: 调整级联参数
* doc: 增加支持枚举类型示例文档
* feat: 增加枚举类型简化写法
* doc: 更新属性说明
* refactor: remove unuse namesapce
* chore: 增加垂直分布样式
* feat: 增加默认值逻辑
* feat: 支持复杂类型双向绑定
* doc: 增加 RadioList 示例
* feat: 增加 Radio 组件数据绑定功能
* doc: 更新示例
* refactor: 复用样式
* chore: 增加样式
2021-06-09 14:45:11 +08:00
Argo
6f66c5ad71 !1479 refactor(#I3UX1E): update checkbox component remove CheckboxBase
* refactor: 更新 Radio 组件
* refactor: 重构 Checkbox 组件移除基类
2021-06-08 21:59:16 +08:00
Argo-Tianyi
244f013811 chore: bump version to 5.0.34-beta03 2021-06-06 21:50:28 +08:00
Argo
6fc9278dda !1478 feat(#I3UIZ8): add color option for Chart component
* chore: bump version to 5.0.21-beta01
* chore: 更新颜色脚本
* feat: 增加颜色配置信息
2021-06-06 21:32:00 +08:00
Argo
504910210a !1476 doc(#I3UHVJ): update document for Lookup menu item
* Merge branch 'dev-ad' into dev-doc
* doc: 移动 ad 到顶端
* doc: 移动端强制隐藏 AD
* doc: 更改 Theme Tooltip 触发方式
* doc: 更新日志增加本地化功能
* doc: 增加更新日志资源文件
* doc: theme 切换增加 tooltip 提示
* doc: 更新 Lookup 菜单显示
2021-06-06 20:57:45 +08:00
Argo
4b05c8c701 !1477 doc(#I3UHVM): update Ad position
* doc: 移动 ad 到顶端
* doc: 移动端强制隐藏 AD
2021-06-06 20:57:45 +08:00
Argo
307f343a20 !1475 doc(#I3UFLA): add merge cell functon
* chore: bump version to 5.0.34
* Merge branch 'dev' into dev-table-cell
* doc: 增加合并单元格示例
* doc: 增加合并单元格菜单
* doc: 更新资源文件
* doc: 增加单元格示例
* doc: 更新菜单文档
* feat: 增加合并单元格功能
* doc: 删除不使用的 TablesBase 基类
* feat: 显示继承接口 Lookup 与 OnCellRender 方法
* feat: 增加 OnCellRender 回调方法
2021-06-06 20:57:45 +08:00
Argo
5d8f04c92a !1474 doc(#I3UFKY): add cell merge sample code
* doc: 增加单元格示例
* doc: 更新菜单文档
* feat: 增加合并单元格功能
* doc: 删除不使用的 TablesBase 基类
* feat: 显示继承接口 Lookup 与 OnCellRender 方法
* feat: 增加 OnCellRender 回调方法
2021-06-05 00:54:16 +08:00
Argo
ce1b73631a !1473 feat(#I3TGX6): add cell merge function
* feat: 增加合并单元格功能
* doc: 删除不使用的 TablesBase 基类
* feat: 显示继承接口 Lookup 与 OnCellRender 方法
* feat: 增加 OnCellRender 回调方法
2021-06-05 00:51:22 +08:00
Argo
696a9c158b !1472 fix(#I3UFKE): validation throw exception when use ResourceName and Type
* feat: 兼容 Blazor 多语言设置
2021-06-05 00:46:59 +08:00
Argo
1dc586c6b7 !1471 doc(#I3UFK7): update lookup menu
* doc: 增加 Lookup 菜单资源文件
2021-06-05 00:41:58 +08:00
Argo
264d56c4c0 !1470 fix(#I3U03U): column header not align under fix header mode
* fix: 修复固定表头后列扩展时表头不对齐问题
2021-06-05 00:38:59 +08:00
Argo
326d9575f5 !1469 fix(#I3U1EI): text ellipsis not work when fix header
* chore: bump version to 5.0.34-beta01
* fix: 固定表头时文本省略失效
2021-06-04 11:54:40 +08:00
Argo
f62be01628 !1468 doc(#I3UBMO): update Empty sample code
* doc: 更新 Empty 示例
2021-06-04 11:32:24 +08:00
Argo
944e7d5aa5 !1467 refactor(#I3UBL7): update Empty component add ChildContent parameter
* chore: 更新 Empty 样式文件
* refactor: 更新 Empty 组件内部逻辑
* chore: 更新 Empty.razor.cs.css 样式文件
* chore: 更新 Empty 组件资源文件
* doc: 移动默认图片到 shared 工程
2021-06-04 11:27:40 +08:00
Argo
bdd2cc9b5a !1466 doc(#I3UBJV): update Lookup sample code
* doc: 增加 Lookup 相关菜单
* doc: 增加 Lookup 相关示例
* doc: 更新 Lookup 资源文件
* feat: 增加 Lookup 属性继承逻辑
* refactor:  移动 Lookup 参数到 IEditorItem 上
* feat: 增加 Lookup 参数
2021-06-04 11:24:56 +08:00
Argo
118a45a5d0 !1465 feat(#I3UBID): add Lookup parameter on TableColumn
* feat: 增加 Lookup 属性继承逻辑
* refactor:  移动 Lookup 参数到 IEditorItem 上
* feat: 增加 Lookup 参数
2021-06-04 11:21:08 +08:00
Argo-Tianyi
3520c6e5bb release: bump version to 5.0.33 2021-06-03 12:43:30 +08:00
Argo
1ed26b667b !1463 doc(#I3U52Q): update pie/doughnut Angle parameter sample code
* doc: update Angle sample code for Chart
2021-06-03 11:21:25 +08:00
Argo
d24d6a0a07 !1462 feat(#I3U510): Pie/Doughnut support Angle parameter
* chore: bump version to 5.0.19-beta03
* feat: Chart 支持半圆模式
2021-06-03 11:16:22 +08:00
Argo
4d2519ba99 !1461 doc(#I3TZET): remove ms-learn link add update log
* style: update style for ms-lean element
* feat: 增加更新日志按钮
* chore: 减少时间间隔
* feat: 增加更新日志引导
* doc: 移除拖拽文字
* doc: 增加 Blazor 学习资料
* doc: 更改弹出窗所属分类
* feat: 增加 gitee 日志默认打开
* doc: update menu status
* chore: rename CI work name
2021-06-02 12:09:08 +08:00
Argo
44e203a8e3 !1460 feat(#I3TX21): add FooterTemplate on Table component
* chore: bump version to 5.0.33-beta06
* Merge branch 'dev' into dev-footer-template
* doc: 增加 FooterTemplate 示例
* feat: 增加 FooterTemplate 功能
* refactor: 精简代码
* fix: 修复 Average 聚合函数出错问题
* doc: 更新 Aggregate 示例
* feat: 增加聚合函数解析功能
2021-06-02 00:27:40 +08:00
Argo
aeed60961e !1459 feat(#I3TX1Z): Footer support Aggregate parameter on Table
* fix: 修复 Average 聚合函数出错问题
* doc: 更新 Aggregate 示例
* feat: 增加聚合函数解析功能
2021-06-02 00:22:35 +08:00
Argo
3af40e7948 !1458 doc(#I3TSE6): add aggregate sample code for table
* Merge branch 'dev' into dev-footer
* doc: 增加聚合函数示例
* feat: 增加聚合函数枚举类型
* chore: add condition for environmennt tag
* chore: add environment for AD
* doc: add footer align sample code
* chore: add json resource for footer align
2021-06-01 13:14:28 +08:00
Argo
410c3a6ac8 !1457 doc(#I3TQAQ): add sample code for table footer alignment
* chore: add condition for environmennt tag
* chore: add environment for AD
* doc: add footer align sample code
* chore: add json resource for footer align
2021-06-01 00:24:08 +08:00
Argo
589ae936ea !1456 feat(#I3TQ96): add Align parameter on Table footer
* feat: 增加 TableFooter 对齐功能
* refactor: 精简级联参数
2021-06-01 00:04:14 +08:00
Argo
9ab6b2aba4 !1455 fix(#I3TPCD): resolve show preview url after delete upload images
* chore: bump version to 5.0.33-beta05
* fix: 修复有预览图片时单页面情况下删除时仍然显示预览图片问题
2021-05-31 19:00:40 +08:00
Argo
a5db64a646 !1454 fix(#I3TP63): throw exception when DefaultFileList is null
* chore: bump version to 5.0.33-beta04
* fix: 修复默认预览集合为空导致异常问题
2021-05-31 18:31:19 +08:00
Argo
2cb3e1e186 !1453 feat(#I3TOW5): Upload component support DefaultFileList parameter dynamic update
* chore: bump version to 5.0.33-beta03
* Merge branch 'dev' into dev-upload
* Merge branch 'dev' into dev-upload
* doc: 更改 DefaultFileList 为 List 类型
* doc: 更新代码
* feat: 增加单页面组件基类
* feat: 增加 GetUploadFiles 方法
* refactor: 格式化代码
2021-05-31 18:06:31 +08:00
Argo
465143040d !1452 chore(#I3TOV3): bump chart version to 5.0.19-beta02
* chore: update dependence
* chore: bump version to 5.0.19-beta02
2021-05-31 18:00:44 +08:00
Argo
ec6b9f1f7d !1451 doc(#I3TJIJ): add line chart NaN value sample code
* doc: 增加 Line 图表支持 null 示例
* feat: Line 增加 NaN 数据虚线支持
2021-05-31 00:20:22 +08:00
Argo
234279bd0f !1450 doc(#I3TJHO): add no tension line chart sample code
* doc: 增加无曲率折线图示例
2021-05-31 00:17:07 +08:00
Argo
4575f060e5 !1449 doc(#I3TJHF): update docs.json file for chart sample code
* doc: 更新示例文档代码配置
* doc: 更正 doughnut 图表文件名
* chore: 移除不使用的依赖包
2021-05-31 00:14:11 +08:00
Argo
f1b454a433 !1448 doc(#I3TIRQ): update chart sample code
* chore: bump version to 5.0.33-beta02
* chore: remove supported platform section
* chore: update dependence to latest
* chore: bump chart version to 5.0.19-beta01
2021-05-30 15:57:44 +08:00
Argo
7c3fb1c747 !1447 feat(#I3TINL): bump chart.js version to the latest
* doc: 增加 ChartToast 组件到示例文档中
* feat: 增加 ChartToast 组件
* refactor: 更新 OnInit 未 OnInitAsync
* feat: 增加 Bubble 图示例
* feat: 增加 Doughout 图示例文档
* feat: 更新 Pie 图示例
* feat: 跟新 Pie 图
* feat: 更新 Bar 图示例
* feat: 增加折线曲率设置
* doc: 更新 OnAfterUpdateAsync 回调委托示例
* feat: 增加 OnAfterUpdateAsync 回调委托
* feat: 增加 Chart 组件 Title 相关设置
* feat: 增加数据集更新指令功能
* doc: 更新 Line 示例
* feat: 移除 DataSource 恢复 OnInit 方法
* feat: 增加 ChartAction 枚举类型
* Merge branch 'dev-chore' into dev-chart
* chore: 拆分配置提高可读性
* chore: 增加 source link 功能
* chore: 移动公共配置信息到 props 文件中
* docs: 更新 props 配置信息
* chore: 增加 source link 功能
* chore: 移动公共配置信息到 props 文件中
* docs: 更新 props 配置信息
* doc: 增加升级更新说明
* Merge branch 'dev' into dev-chart
* Merge branch 'dev' into dev-chart
* Merge branch 'dev' into dev-chart
* Merge branch 'dev-fa' into dev-chart
* refactor: 移动 fa 到 Server 工程中
* refactor: 移动 fa 到 Server 工程中
* style: 更新网站样式
* Merge branch 'dev' into dev-chart
* chore: 改造 Line 适配新版本
* chore: 更新打包配置文件
* chore: 更新脚本文件
* chore: 更新样式文件
* refactor: 移动 Line 页面位置
* feat: 增加 Line 折线图
* Merge branch 'dev' into dev-chart
* Merge branch 'dev' into dev-chart
* fix: 修复 Chart 资源文件无法加载问题
* feat: 增加 Index 简介页面
* feat: 增加 Utility 辅助类
* docs: 增加 Chart 简介页面
* docs: 移动 Charts 示例
* docs: 更新菜单拆分图表分类
* chore: 增加图表资源文件
* chore: 更新组件版本号
2021-05-30 15:09:00 +08:00
Argo
c55aa1da03 !1446 chore(#I3TGAH): update blazor project configuration
* chore: update project config
2021-05-29 12:33:57 +08:00
Argo
c2c7168a1b !1445 doc(#I3TFW0): improve set web title logic when click menu item
* Merge branch 'pack' into dev-menu
* fix: 修复点击父级菜单时网站 Title 变更问题
* perf: 有子菜单时取消对内置 Tab 联动
* chore: bump depedence version to latest
2021-05-29 10:06:38 +08:00
Argo
6fc88f4371 !1444 doc(#I3TF3M): toggle component split css
* chore: 拆分 Toggle 样式到组件中
2021-05-28 19:44:49 +08:00
Argo
a54e19436b !1443 fix(#I3TEWC): resolve highlight and redirect issue on Menu component
* chore: 移除对 linux.dockerfile 的引用
* scripts: 更新 Menu 脚本屏蔽 # 地址
* Revert "!1427 fix(#I3RGT7): resolve navigate wrong address after refresh page"
2021-05-28 19:07:01 +08:00
Argo
230dd408ab !1442 doc(#I3TBKB): update Empty component sample code
* refactor: 更新 Empty 示例代码
* doc: 移动 Empty 相关菜单到 Data 下
* refactor: 重构代码
2021-05-28 11:58:42 +08:00
Argo
ffea12352e !1441 fix(#I3TBFW): update docker images for fix run fail after CI
* chore: update base images
2021-05-28 11:40:11 +08:00
Argo
1a5cfdb8b7 !1440 fix(#I3T6Z8): resolve can not show modal again when close dialog use ESC keyboard
* doc: 更新 Modal 组件支持键盘示例
* feat: 更新 Keyboard 生成代码片段
* scripts: 更新 Modal 组件客户端脚本
2021-05-27 15:29:41 +08:00
Argo
a0b1ed8230 !1439 doc(#I3T6VZ): add sample code for dialog support ESC keyboard
* docs: 增加 Dialog 组件支持键盘 ESC 示例
2021-05-27 15:23:53 +08:00
Argo
a3d3f99669 !1438 feat(#I3T6GQ): dialog component support ESC keyboard
* feat: Dialog 组件支持 IsKeyboard 参数
2021-05-27 14:38:00 +08:00
Argo
7b08b126bb !1437 perf(#I3T62J): remove font-awesome from BB
* docs: 更新样式文档
* refactor: 组件移除内置 fontawesome 图标
2021-05-27 13:47:24 +08:00
Argo-Tianyi
64b360881e docs: add friends link 2021-05-27 12:54:53 +08:00
668 changed files with 43431 additions and 67959 deletions

View File

@@ -88,9 +88,10 @@ dotnet_naming_symbols.constant_fields.required_modifiers = const
# var preferences
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
csharp_style_var_elsewhere = true:silent
csharp_prefer_static_local_function= true:silent
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_methods = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent

110
.filenesting.json Normal file
View File

@@ -0,0 +1,110 @@
{
"help": "https://go.microsoft.com/fwlink/?linkid=866610",
"root": true,
"dependentFileProviders": {
"add": {
"addedExtension": {},
"pathSegment": {
"add": {
".*": [
".js",
".css",
".html",
".htm",
".less",
".scss",
".coffee",
".iced",
".config",
".cs",
".vb",
".json"
]
}
},
"extensionToExtension": {
"add": {
".js": [
".cs",
".razor",
".coffee",
".iced",
".ts",
".tsx",
".jsx"
],
".css": [
".cs",
".razor",
".less",
".scss",
".sass",
".styl"
],
".html": [
".md",
".mdown",
".markdown",
".mdwn"
],
".map": [
".js",
".css"
],
".svgz": [
".svg"
],
".designer.cs": [
".resx"
],
".cs.d.ts": [
".cs"
]
}
},
"fileToFile": {
"add": {
".bowerrc": [
"bower.json"
],
".npmrc": [
"package.json"
],
"npm-shrinkwrap.json": [
"package.json"
],
"yarn.lock": [
"package.json"
],
".yarnclean": [
"package.json"
],
".yarnignore": [
"package.json"
],
".yarn-integrity": [
"package.json"
],
".yarnrc": [
"package.json"
],
"package-lock.json": [
"package.json"
]
}
},
"fileSuffixToExtension": {
"add": {
"-vsdoc.js": [
".js"
]
}
},
"allExtensions": {
"add": {
}
}
}
}
}

View File

@@ -16,7 +16,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.202
dotnet-version: 5.0.400
- name: Build
env:

View File

@@ -4,6 +4,7 @@ on:
push:
branches:
- pack
- hotfix
jobs:
pack:
@@ -15,7 +16,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.202
dotnet-version: 5.0.400
- name: Publish to Nuget
env:

View File

@@ -15,7 +15,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.202
dotnet-version: 5.0.400
- name: Publish wasm
run: |

View File

@@ -1,4 +1,4 @@
name: Package to Nuget
name: Package Extensions to Nuget
on:
push:
@@ -15,7 +15,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.202
dotnet-version: 5.0.400
- name: Publish to Nuget
env:

View File

@@ -97,6 +97,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapBlazor.WebAssembly
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BootstrapBlazor.WebAssembly.ServerHost", "src\Wasm\BootstrapBlazor.WebAssembly.ServerHost\BootstrapBlazor.WebAssembly.ServerHost.csproj", "{FFFD2EB7-AE88-4DAD-A825-528B2CEFB4B5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{8AB9DB43-233A-4D49-99FA-FA540C2109F2}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.filenesting.json = .filenesting.json
.gitattributes = .gitattributes
.gitignore = .gitignore
.issuetracker = .issuetracker
appveyor.yml = appveyor.yml
Directory.Build.props = Directory.Build.props
NuGet.Config = NuGet.Config
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -163,6 +175,7 @@ Global
{F0754254-903C-411B-972C-EC91254B4A67} = {A627F6CC-94FC-4E48-B3CC-F0EA16700527}
{B84D315E-967D-4FBF-9B72-1F3128155CB0} = {A627F6CC-94FC-4E48-B3CC-F0EA16700527}
{190F25CF-C6F9-4964-97E9-F6A912D527AE} = {7C1D79F1-87BC-42C1-BD5A-CDE4044AC1BD}
{22328011-53B3-447A-B781-AC3C196B2847} = {A2182155-43ED-44C1-BF6F-1B70EBD2DFFE}
{C8E79F4C-8C55-4E13-96B5-3D2BD6A07B74} = {A2182155-43ED-44C1-BF6F-1B70EBD2DFFE}
{CD062AB6-244D-402A-8F33-C37DAC5856CC} = {22328011-53B3-447A-B781-AC3C196B2847}
{56FEFF09-85FC-408D-A397-6E264E68414E} = {22328011-53B3-447A-B781-AC3C196B2847}

View File

@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="azure" value="https://nuget.cdn.azure.cn/v3/index.json" />
<add key="cnblogs" value="https://nuget.cnblogs.com/v3/index.json" />
<add key="huawei" value="https://repo.huaweicloud.com/repository/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="Blazor" value="https://nuget.blazor.zone/v3/index.json" />
</packageSources>
</configuration>

View File

@@ -37,6 +37,12 @@ Blazor 是一个使用 .NET 生成交互式客户端 Web UI 的框架:
本项目是利用 Bootstrap 样式进行封装的 UI 组件库
## 生态伙伴
WTM 快速开发框架设计的核心理念就是”尽一切可能提高开发效率“。WTM框架把常规编码结构化重复编码自动化它不仅是一个框架它是强有力的生产力工具目前 WTM 快速开发框架已深度集成 Blazor 欢迎大家使用 [传送门](https://wtmdoc.walkingtec.cn)
<a href="https://wtmdoc.walkingtec.cn" target="_blank"><img src="http://images.gitee.com/uploads/images/2021/0718/194451_5b6cff04_554725.png" width="100px" /></a>
## 开发环境搭建
1. 安装 .net core sdk 最新版 [官方网址](http://www.microsoft.com/net/download)
2. 安装 Visual Studio 2019 最新版 [官方网址](https://visualstudio.microsoft.com/vs/getting-started/)

View File

@@ -5,19 +5,7 @@
</PropertyGroup>
<ItemGroup>
<None Remove="Linux.Dockerfile" />
</ItemGroup>
<ItemGroup>
<Content Include="Linux.Dockerfile" />
</ItemGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Longbow.Tasks" Version="5.0.1" />
<PackageReference Include="Longbow.Tasks" Version="5.*" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,7 +1,7 @@
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80

View File

@@ -1,19 +0,0 @@
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /
COPY . .
WORKDIR "src/BootstrapBlazor.Server"
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "BootstrapBlazor.Server.dll"]

View File

@@ -21,6 +21,7 @@
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="favicon.png">
<base href="~/">
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css" asp-append-version="true">
<link rel="stylesheet" href="_content/BootstrapBlazor.Chart/css/bootstrap.blazor.chart.bundle.min.css" asp-append-version="true">
<link rel="stylesheet" href="_content/BootstrapBlazor.Markdown/css/bootstrap.blazor.markdown.min.css" asp-append-version="true">
@@ -44,16 +45,17 @@
</app>
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
<span>
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
</span>
<a href="" class="reload">Reload</a>
<a class="dismiss"><i class="fa fa-times"></i></a>
</div>
<div class="wwads-cn wwads-horizontal" data-id="72" style="max-width:350px"></div>
<script src="_content/BootstrapBlazor/js/bootstrap.blazor.bundle.min.js" asp-append-version="true"></script>
<script src="_content/BootstrapBlazor.Chart/js/bootstrap.blazor.chart.bundle.min.js" asp-append-version="true"></script>
<script src="_content/BootstrapBlazor.TableExport/js/export.min.js" asp-append-version="true"></script>
@@ -62,6 +64,5 @@
<script src="_content/BootstrapBlazor.Shared/lib/summernote/summernote-zh-CN.min.js" asp-append-version="true"></script>
<script src="_content/BootstrapBlazor.Shared/js/common.js" asp-append-version="true"></script>
<script src="_framework/blazor.server.js" asp-append-version="true"></script>
<script src="https://wwads.cn/js/makemoney.js" type="text/javascript" async></script>
</body>
</html>

View File

@@ -1,4 +1,4 @@
{
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
@@ -29,4 +29,4 @@
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}"
}
}
}
}

View File

@@ -3,8 +3,10 @@
// Website: https://www.blazor.zone or https://argozhang.github.io/
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using Microsoft.JSInterop;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared
@@ -14,12 +16,14 @@ namespace BootstrapBlazor.Shared
/// </summary>
public sealed partial class App
{
/// <summary>
///
/// </summary>
[Inject]
[NotNull]
private IJSRuntime? JSRuntime { get; set; }
[Inject]
[NotNull]
private IStringLocalizer<App>? Localizer { get; set; }
/// <summary>
///
/// </summary>
@@ -28,9 +32,9 @@ namespace BootstrapBlazor.Shared
{
await base.OnAfterRenderAsync(firstRender);
if (firstRender && OperatingSystem.IsBrowser() && JSRuntime != null)
if (firstRender)
{
await JSRuntime.InvokeVoidAsync("$.loading");
await JSRuntime.InvokeVoidAsync("$.loading", OperatingSystem.IsBrowser(), Localizer["ErrorMessage"].Value, Localizer["Reload"].Value);
}
}
}

View File

@@ -17,10 +17,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="BootstrapBlazor.Chart" Version="5.0.18" />
<PackageReference Include="BootstrapBlazor.Markdown" Version="5.0.18" />
<PackageReference Include="BootstrapBlazor.TableExport" Version="5.0.18" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
<PackageReference Include="BootstrapBlazor.Chart" Version="5.*" />
<PackageReference Include="BootstrapBlazor.Markdown" Version="5.*" />
<PackageReference Include="BootstrapBlazor.TableExport" Version="5.*" />
</ItemGroup>
<ItemGroup>

View File

@@ -54,6 +54,11 @@ namespace BootstrapBlazor.Shared
/// </summary>
public string RepositoryUrl { get; set; } = "https://gitee.com/LongbowEnterprise/BootstrapBlazor/raw/dev/src/BootstrapBlazor.Shared/Pages/Samples/";
/// <summary>
///
/// </summary>
public string WikiUrl { get; set; } = "https://gitee.com/LongbowEnterprise/BootstrapBlazor/wikis/%E6%9B%B4%E6%96%B0%E6%97%A5%E5%BF%97?sort_id=4062034";
/// <summary>
/// 获得 QQ 1 群链接地址
/// </summary>

View File

@@ -1,11 +1,160 @@
{
"BootstrapBlazor.Shared.App": {
"Title": "Bootstrap of Blazor"
"Reload": "Reload",
"ErrorMessage": "An unhandled exception has occurred. See browser dev tools for details."
},
"BootstrapBlazor.Shared.Pages.Index": {
"BodyClassString": "welcome-body-en",
"Title": "Bootstrap Blazor enterprise-level UI component library",
"HeaderTitle": "Bootstrap style Blazor UI component library",
"HeaderDesc": "Based on the <code>Bootstrap</code> style library, it is carefully built, and {0} a variety of commonly used components have been added to bring you an extraordinary feeling for rapid development projects",
"HeaderBody": "The ",
"HeaderBody1": "native Blazor components library on the market",
"DynamicText": "best to use",
"DynamicText1": "best looking",
"DynamicText2": "most simple and practical",
"TagTitle": "Component",
"Span1": "Tree",
"Span2": "Menu",
"Span3": "Tag",
"Span4": "Table",
"Span5": "Layout",
"Span6": "Notification",
"Span7": "Upload",
"Span8": "Switch",
"CarouselH1": "Chart Component",
"CarouselP1": "Provide a variety of commonly used chart components",
"CarouselH2": "Chart IconComponent",
"CarouselP2": "Multi-dimensional data comparison",
"CarouselH3": "Full-featured table component",
"CarouselP3": "With all functions of adding, deleting, modifying, searching, paging, and sorting",
"CarouselH4": "Super timeline function",
"CarouselP4": "Custom nodes display arbitrary components",
"ContainerH1": "Rich Components",
"ContainerD1": "This set of components library contains more than {0} multiple components, from simple buttons to complex page-level components",
"ContainerH2": "Performance",
"ContainerD2": "Each control has been fine-tuned to optimize the refresh logic between parent and child components to avoid multiple loop updates",
"ContainerH3": "Easy to use",
"ContainerD3": "Easily grasp how to use components and quickly incorporate BootstrapBlazor controls into the project",
"ContainerH4": "Free and open source",
"ContainerD4": "Simple, direct, free to use, no dependent components, dependent on jQuery Bootstrap are all built-in",
"ContainerH5": "Demos and examples",
"ContainerD5": "Detailed documentation and online demonstration, simple function setting, direct copy code out of the box",
"ContainerH6": "Continually updated",
"ContainerD6": "Gitee platform hosting open source, never closed source, continuous update, timely response to questions and feedback",
"DonateH1": "Donate",
"DonateH2": "Scan the code to donate and invite the author to have a cup of coffee"
},
"BootstrapBlazor.Shared.Shared.HomeLayout": {
"FooterH1": "Related Works",
"FooterLi1": "Slider verification code",
"FriendLink": "Links",
"FriendLi1": "Lin Dexi's Blog",
"FriendLi2": "CCFlow",
"Community": "Community",
"CommunityLi1": "Contribution guide",
"CommunityLi2": "Join us",
"CommunityLi3": "Contact details",
"SpecialAcknowledgements": "Special Thanks",
"Footer": "Gitee Hosting Platform"
},
"BootstrapBlazor.Shared.Pages.labels": {
"Title": "Component label",
"P1": "This set of components includes <code>ValidateForm</code> <code>EditorForm</code> and a variety of <b>Form components</b> inherited from <code>ValidateBase&lt;TValue&gt;</code>. Among these components There is a special set of display front label logic, now lets sort it out in a unified way:",
"UlLi1": "The <a href='/validateforms' target='_blank'>ValidateForm</a> component is a <b>verifiable</b> form component. The form component in this component will automatically perform data compliance checks. If Data non-compliance will prevent the <b>Submit</b> action, which is the most frequently used component in data submission",
"UlLi2": "The <a href='/editorforms' target='_blank'>EditorForm</a> component is an ordinary form component. After this component is bound to the <code>Model</code>, the entire form can be automatically generated, which greatly reduces repetition Code, put the <code>ValidateForm</code> on the outside to open the <b>data compliance check</b> very convenient, concise and efficient",
"P2": "Take the <a href='inputs' target='_blank'>BootstrapInput</a> input box component as an example to explain whether to display the <code>Label</code> logic",
"Tips": "The logic of <code>ShowLabel</code> is the principle of proximity. The closer the setting is to itself, the setting takes effect. For example, the form component is built into the <code>ValidateForm</code> component, even if <code>ValidateForm</code> is set to <code> >ShowLabel=true</code>, when the form component itself sets <code>ShowLabel=false</code>, the final result of the label is <b>not displayed</b>",
"Block1Title": "Use alone",
"Block1Intro": "Suitable for data entry",
"Block1P1": "When two-way binding is not used",
"Block1Li1": "<code>Label</code> will not be displayed by default",
"Block1Li2": "Control whether to display through the <code>ShowLabel</code> property",
"Block1Li3": "Display content when setting <code>DisplayText</code>",
"Block1Li4": "When not set, render a contentless <code>label</code> component as a placeholder",
"GroupBox1Title": "No two-way binding",
"GroupBox1D1": "No settings in the first text box, no label",
"GroupBox1D2": "The second text box setting <code>ShowLabel='true' DisplayText=``</code> displays a placeholder label without content",
"GroupBox1D3": "The third text box setting <code>ShowLabel='true' DisplayText='Name'</code> shows the set content label",
"GroupBox1D4": "The fourth text box setting <code>ShowLabel='true' DisplayText='@@null'</code> displays a placeholder label without content",
"P3": "When using two-way binding",
"GroupBox2Title": "Two-way binding",
"GroupBox2D1": "The first text box is set to <code>@@bind-Value='Dummy.Name'</code>, no label is displayed",
"GroupBox2D2": "The second text box setting <code>@@bind-Value='Dummy.Name' ShowLabel='true' DisplayText='@@Localizer[nameof(Foo.Address)]'</code> Display the contents of the setting",
"GroupBox2D3": "The third text box setting <code>@@bind-Value='Dummy.Name' ShowLabel='true' DisplayText=``</code> Show no content placeholder label",
"GroupBox2D4": "The fourth text box setting <code>@@bind-Value='Dummy.Name' ShowLabel='true' DisplayText='@@null'</code> Display the label content under the resource file mechanism<code>Label</code> code>",
"Block2Title": "Used in EditorForm",
"Block2Intro": "Not used in <code>ValidateForm</code>",
"P4": "<b>Show label</b><div>The <code>ShowLabel</code> property of the <coe>EditorForm</coe> component is not set. If it is not set, it is equivalent to set to <code>true</code>. All components <b>display</b> tags</div>",
"P5": "<b>Do not display labels</b><div>Set <code>ShowLabel='false'</code>, all form components in the component <b>Do not display</b> tags</div>",
"Block3Title": "Use in EditorForm built-in ValidateForm",
"Block3Intro": "Used in external <code>ValidateForm</code>",
"P6": "<b>Show label</b><div>The <code>ShowLabel</code> property of the <coe>EditorForm</coe> component is not set. If it is not set, it is equivalent to set to <code>true</code>. All components <b>display</b> tags</div>",
"P7": "<b>Do not display labels</b><div>Set <code>ShowLabel='false'</code>, all form components in the component <b>Do not display</b> tags</div>",
"Block4Title": "Used in ValidateForm",
"Block4Intro": "Show labels are automatically turned on by default",
"P8": "<b>Show label</b><div>The <code>ShowLabel</code> property of the <coe>EditorForm</coe> component is not set. If it is not set, it is equivalent to set to <code>true</code>. All components <b>display</b> tags</div>",
"P9": "<b>Do not display labels</b><div>Set <code>ShowLabel='false'</code>, all form components in the component <b>Do not display</b> tags</div>"
},
"BootstrapBlazor.Shared.Pages.Install": {
"InstallTitle": "Install",
"GitP1": "There are many kinds of Git tools that everyone is familiar with, here I introduce two Git client tools",
"GitP2": "It is recommended to use the <a href='https://fork.dev'>Fork</a> tool to install, it can better and <a href='https://visualstudio.microsoft.com/vs/getting- started/' target='_blank'>Visutal Studio</a> to use with development tools.",
"NugetInstall": "Nuget Install",
"NugetP1": "Use <a href='https://www.nuget.org/packages?q=BootstrapBlazor' target='_blank'>nuget.org</a> to install BootstrapBlazor components",
"EnvBuildTitle": "Project Environment Construction",
"EnvLi1": "Install .net core sdk <a href='http://www.microsoft.com/net/download' target='_blan'>Official Website</a>",
"EnvLi2": "Install Visual Studio 2019 and above <a href='https://visualstudio.microsoft.com/vs/getting-started' target='_blank'>Official website",
"EnvLi3": "Pull the project code BootstrapBlazor <a href='https://gitee.com/LongbowEnterprise/BootstrapBlazor' target='_blank'>Warehouse URL</a>"
},
"BootstrapBlazor.Shared.Pages.Template": {
"Title": "Project Template",
"SubTitle": "Bootstrap Blazor App Template",
"P1": "In order to make it easier for everyone to use this set of components to quickly build projects, the author has made <b>Project Templates</code></b>, using <code>dotnet new</code> command line mode, using Proceed as follows:",
"P2": "1. Install the project template",
"P3": "2. Create project",
"P4": "After the project is created, the <code>BootstrapBlazorApp</code> solution will be generated in the current folder, and the <code>src</code> directory contains <code>Server-Side</code> <code>Wasm</code> Both types of projects can be run directly with <kbd>F5</kbd>",
"P5": "3. Uninstall project template",
"SubTitle1": "Bootstrap Blazor App Extension",
"P6": "In order to facilitate the use of the <code>Bootstrap Blazor</code> component library, the author has created the <b>Project Template (<code>Bootstrap Blazor Project Template</code>)</b> extension plug-in, which can be installed through <code >Visual Studio 2019 IDE</code> When creating a new project, select the <code>Bootstrap Blazor project template</code>, and the solution is built in two types: <code>Server-Side</code> and <cide>wasm</cide> project"
},
"BootstrapBlazor.Shared.Pages.Golbalization": {
"Title": "Globalization",
"SubTitle": "ASP.NET Core Blazor Globalization",
"P1": "Please check <a href='https://docs.microsoft.com/zh-cn/aspnet/core/blazor/globalization-localization?view=aspnetcore-3.1' target='_blank'> before reading the following knowledge points Official document</a>"
},
"BootstrapBlazor.Shared.Pages.Components.InstallContent": {
"H1": "Component reference",
"P1": "There are many ways to reference components, please refer to <a href='install'>Class Library Installation</a>",
"H2": "CSS file",
"P2": "Add the Bootstrap CSS file in the form of <code>&lt;link&gt;</code> tags to the <code>@HostFile</code> file <code>&lt;head&gt;</code> tags, and place them in all Before other style sheets.",
"Tips": "After this set of components version <b>5.0.32</b> remove the built-in <code>font-awesome</code> icon, please download it yourself or use the <b>CDN</b> acceleration service",
"Pre": "&lt;link href='https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet'&gt;&lt;link href='_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css' rel='stylesheet'&gt;",
"Tips2": "If you use the <code>Blazor App</code> template to create a project, please remove the default <code>Bootstrap</code> style link <code>&lt;link rel='stylesheet' href='css/bootstrap/bootstrap .min.css' /&gt;</code>",
"H3": "JS file",
"P3": "Many components provided by Bootstrap rely on JavaScript to run. Specifically, these components rely on jQuery, Popper.js, and our own JavaScript plug-ins. Put the following <code>&lt;script&gt;</code> tag at the end of the <code>@HostFile</code> file and before the <code>&lt;/body&gt;</code> tag, it will work.",
"Pre2": "&lt;script src='_content/BootstrapBlazor/js/bootstrap.blazor.bundle.min.js'&gt;&lt;/script&gt;",
"H4": "Add the namespace to the <code>_Imports.razor</code> file",
"H5": "Registration Service",
"H6": "Use components",
"P4": "Reference the <code>BootstrapBlazor</code> component in the <code>razor</code> component",
"Pre3": "&lt;Button Color='Color.Primary'&gt;Button&lt;/Button&gt;"
},
"BootstrapBlazor.Shared.Pages.Install_Server": {
"Title": "Server Side",
"CodeComment": "Add this line of code"
},
"BootstrapBlazor.Shared.Pages.Install_wasm": {
"Title": "Client Side",
"CodeComment": "Add this line of code"
},
"BootstrapBlazor.Shared.Pages.Components.Block": {
"Title": "",
"SubTitle": "Demo"
},
"BootstrapBlazor.Shared.Pages.Components.Tips": {
"Title": "Tips"
},
"BootstrapBlazor.Shared.Pages.Components.AttributeTable": {
"Title": "Attributes"
},
@@ -56,6 +205,11 @@
"ShowBarUsageText": "With Bar",
"IntroText4": "Show <code>Tip</code>"
},
"BootstrapBlazor.Shared.Pages.DateTimePickers": {
"SubmitText": "Save",
"ModelValidateValue": "ModelValidateValue",
"ModelValidateValue.Required": "{0} is required."
},
"BootstrapBlazor.Shared.Pages.Selects": {
"PlaceHolder": "Not Select"
},
@@ -92,7 +246,9 @@
"Foo.Name": "Zhangsan {0}",
"Foo.Address": "Lane {0} of Jinshajiang Road, Putuo District, Shanghai",
"Foo.Address2": "Earth, China, Lane {0} of Jinshajiang Road, Putuo District, Shanghai. Here is an example of super long cell",
"Foo.BindValue": "BindValue"
"Foo.BindValue": "BindValue",
"True": "Pass",
"False": "Failed"
},
"BootstrapBlazor.Shared.Pages.ValidateForms.ComplexFoo": {
"Name": "Name",
@@ -131,10 +287,11 @@
"FlowText": "Workflow",
"InstallAppText": "Install PWA App",
"InstallText": "Install",
"CancelText": "Cancel"
"CancelText": "Cancel",
"Title": "View update log"
},
"BootstrapBlazor.Shared.Shared.NavMenu": {
"GetStarted": "GETTINGSTARTED",
"GetStarted": "GETTING STARTED",
"Introduction": "Introduction",
"Install": "Install",
"ProjectTemplate": "Template",
@@ -190,6 +347,7 @@
"DateTimeRange": "DateTimeRange",
"Editor": "Editor",
"EditorForm": "EditorForm",
"FloatingLabel": "FloatingLabel",
"Input": "Input",
"InputNumber": "InputNumber",
"Markdown": "Markdown",
@@ -213,7 +371,6 @@
"Camera": "Camera",
"Captcha": "Captcha",
"Carousel": "Carousel",
"Chart": "Chart",
"Circle": "Circle",
"Collapse": "Collapse",
"Display": "Display",
@@ -234,7 +391,9 @@
"TableBase": "Base",
"TableRow": "Row",
"TableColumn": "Column",
"TableCell": "Cell",
"TableDetail": "Detail",
"TableDynamic": "Dynamic",
"TableSearch": "Search",
"TableFilter": "Sort/Filter",
"TableFixHeader": "FixHeader",
@@ -251,9 +410,18 @@
"TableWrap": "Wrap",
"TableTree": "Table-Tree",
"TableLaoding": "Table-Loading",
"TableLookup": "Lookup",
"MenuAccordion": "Accordion",
"MenuExpandAll": "Expand",
"Empty": "Empty"
"Empty": "Empty",
"Charts": "Chart",
"ChartSummary": "Introduction",
"ChartLine": "Line",
"ChartBar": "Bar",
"ChartPie": "Pie",
"ChartDoughnut": "Doughnut",
"ChartBubble": "Bubble",
"Transition": "Transition"
},
"BootstrapBlazor.Shared.Pages.Menus": {
"System": "System",
@@ -282,7 +450,59 @@
"SubMenu41": "Sub Menu 41",
"SubMenu42": "Sub Menu 42"
},
"BootstrapBlazor.Shared.Pages.Empty": {
"BootstrapBlazor.Shared.Pages.Empties": {
"Title": "Empty",
"SubTitle": "Sub Title PlaceHolder"
},
"BootstrapBlazor.Shared.Pages.Table.TablesFooter": {
"Left": "Left",
"Center": "Center",
"Right": "Right"
},
"BootstrapBlazor.Shared.Pages.Table.TablesDetailRow": {
"DetailTextTrue": "Enable",
"DetailTextFalse": "Disable"
},
"BootstrapBlazor.Shared.Pages.Table.Tables": {
"RefreshText": "Refresh",
"ButtonAddColumnText": "Add Column",
"ButtonRemoveColumnText": "Remove Column"
},
"BootstrapBlazor.Shared.Pages.Introduction": {
"Title": "Introduction",
"P1": "BootstrapBlazor is an enterprise-level component library based on Bootstrap and Blazor, which can be considered as the Blazor version of the Bootstrap project.",
"P2": "The dependency isBootstrapBlazor > Bootstrap > jQuery",
"P3": "In the latest <a href='template' target='_blank'>Project Template</a> ,the above dependencies are packaged and bundled, which greatly simplifies use",
"UpdateTitle": "Update Log",
"P4": "This component may be released every day <b><code>beta</code></b> version, every <b><code>Thursday</code></b> release <b><code>official version </code></b> <a id='log' data-bs-toggle='popover' title='Update log' data-bs-content='This component may have <b><code >beta</code></b> version released, every <b><code>Thursday</code></b> release <b><code>official version</code></b> update log' data-bs-html='true' href='{0}' target='_blank'>Update log</a>",
"LearnTitle": "Learning materials",
"LearnLi1": "Blazor Official Document",
"LearnLi2": "Use Blazor WebAssembly and Visual Studio Code to generate web applications",
"LearnLi3": "What is Blazor",
"LearnLi4": "Exercise-Configure the development environment",
"LearnLi5": "Blazor Components",
"LearnLi6": "Exercise-Add Components",
"LeanrnLi7": "Data binding and events",
"LearnLi8": "Exercise-Data binding and Events",
"Summarize": "Summarize",
"ProjectsShow": "Gllery",
"P5": "The largest code hosting collaborative development platform in China <b><a href='{0}' target='_blank'>Gitee</a></b> C# The highest star in the sector <a href='{1}'><img src='{2}' alt='star' style='margin-bottom',: '1px;' ></a> Works <b><a href='{3}' target=''_blank'>Universal background management system BootstrapAdmin</a></b> Ready to use this component to achieve all functions",
"ShowWebSiteTitle": "Demo Site",
"GetStarted": "Get Started",
"QuikStart": "Quick Start",
"Features": "Features of Components",
"P6": "The Bootstrap Blazor UI component library provides everything from basic <code>Button</code> components to advanced web-level <code>SmartPage</code> components",
"Advantage": "Advantage",
"AdvantageLi1": "No need to write <code>Javascript</code> to use components",
"AdvantageLi2": "The component supports all <code>html</code> features",
"AdvantageLi3": "The component supports two-way data binding",
"AdvantageLi4": "Components support automatic client verification",
"AdvantageLi5": "Component support combination",
"Community": "Community"
},
"BootstrapBlazor.Shared.Pages.Components.QQGroup": {
"Group": "QQ Group",
"Status": " Full",
"Welcome": "Welcome to join the group discussion"
}
}

View File

@@ -1,11 +1,160 @@
{
"BootstrapBlazor.Shared.App": {
"Title": "Bootstrap Blazor - 企业级 UI 组件库"
"Reload": "重新加载",
"ErrorMessage": "发生了未处理的异常。有关详细信息,请参见浏览器开发工具。"
},
"BootstrapBlazor.Shared.Pages.Index": {
"BodyClassString": "welcome-body",
"Title": "Bootstrap Blazor - 企业级 UI 组件库",
"HeaderTitle": "Bootstrap 风格的 Blazor UI 组件库",
"HeaderDesc": "基于 <code>Bootstrap</code> 样式库精心打造,并且额外增加了 {0} 多种常用的组件,为您快速开发项目带来非一般的感觉",
"HeaderBody": "致力于打造全网",
"HeaderBody1": "最好玩的组件库",
"DynamicText": "最好用的",
"DynamicText1": "最好看的",
"DynamicText2": "最简单实用的",
"TagTitle": "组件",
"Span1": "树形组件",
"Span2": "菜单组件",
"Span3": "标签组件",
"Span4": "表格组件",
"Span5": "布局组件",
"Span6": "通知组件",
"Span7": "上传组件",
"Span8": "开关组件",
"CarouselH1": "Chart 图表组件",
"CarouselP1": "提供常用的多种图表组件",
"CarouselH2": "Chart 图标组件",
"CarouselP2": "多维度数据对比",
"CarouselH3": "全功能表格组件",
"CarouselP3": "具备增删改查搜、分页、排序所有功能",
"CarouselH4": "超强时间线功能",
"CarouselP4": "自定义节点显示任意组件",
"ContainerH1": "丰富组件",
"ContainerD1": "本套组件库包含超过 {0} 多个组件,从简单的按钮到复杂的整页面级别的组件",
"ContainerH2": "性能",
"ContainerD2": "每个控件都经过微调,优化父子组件之间刷新逻辑,避免多次循环更新",
"ContainerH3": "简单易用",
"ContainerD3": "轻松掌握组件使用方法,快速将 BootstrapBlazor 控件融入到项目中",
"ContainerH4": "免费开源",
"ContainerD4": "简单、直接、免费使用、无依赖组件,依赖 jQuery Bootstrap 均已内置",
"ContainerH5": "演示与示例",
"ContainerD5": "详细文档与在线演示,功能设置简单,直接拷贝代码开箱即用",
"ContainerH6": "持续更新",
"ContainerD6": "码云平台托管开源,永不闭源,持续更新,及时响应问题与反馈",
"DonateH1": "捐助",
"DonateH2": "扫码捐助请作者喝一杯咖啡"
},
"BootstrapBlazor.Shared.Shared.HomeLayout": {
"FooterH1": "相关作品",
"FooterLi1": "滑块验证码",
"FriendLink": "友情链接",
"FriendLi1": "林德熙的博客",
"FriendLi2": "驰骋工作流",
"Community": "社区",
"CommunityLi1": "贡献指南",
"CommunityLi2": "加入我们",
"CommunityLi3": "联系方式",
"SpecialAcknowledgements": "特别鸣谢",
"Footer": "码云托管平台"
},
"BootstrapBlazor.Shared.Pages.labels": {
"Title": "组件标签",
"P1": "本套组件中有 <code>ValidateForm</code> <code>EditorForm</code> 以及多种继承 <code>ValidateBase&lt;TValue&gt;</code> 的 <b>表单组件</b>,这些组件中有一套特殊的显示前置标签逻辑,现在我们统一的梳理一下:",
"UlLi1": "<a href='/validateforms' target='_blank'>ValidateForm</a> 组件是 <b>可验证的</b> 表单组件,此组件内的表单组件会自动进行数据合规性检查,如果数据不合规将会阻止 <b>提交(Submit)</b> 动作,是数据提交中使用最最最频繁的组件",
"UlLi2": "<a href='/editorforms' target='_blank'>EditorForm</a> 组件是普通的表单组件,此组件绑定 <code>Model</code> 后即可自动生成整个表单,大大减少重复性编码,外面套上 <code>ValidateForm</code> 即可开启 <b>数据合规性检查</b> 非常方便、简洁、高效",
"P2": "以 <a href='inputs' target='_blank'>BootstrapInput</a> 输入框组件为例,阐述一下是否显示 <code>Label</code> 逻辑",
"Tips": "<code>ShowLabel</code> 的逻辑即就近原则,离自身越近的设置生效,如表单组件内置到 <code>ValidateForm</code> 组件中,即使 <code>ValidateForm</code> 设置 <code>ShowLabel=true</code>,表单组件自身设置 <code>ShowLabel=false</code> 时,标签最终结果为 <b>不显示</b>",
"Block1Title": "单独使用",
"Block1Intro": "适用于数据录入",
"Block1P1": "未使用双向绑定时",
"Block1Li1": "默认不会显示 <code>Label</code>",
"Block1Li2": "通过 <code>ShowLabel</code> 属性进行控制是否显示",
"Block1Li3": "设置 <code>DisplayText</code> 时显示内容",
"Block1Li4": "未设置时渲染一个无内容的 <code>label</code> 组件进行占位",
"GroupBox1Title": "未双向绑定",
"GroupBox1D1": "第一个文本框未进行任何设置,不显示标签",
"GroupBox1D2": "第二个文本框设置 <code>ShowLabel='true' DisplayText=''</code> 显示无内容的占位标签",
"GroupBox1D3": "第三个文本框设置 <code>ShowLabel='true' DisplayText='Name'</code> 显示设置的内容标签",
"GroupBox1D4": "第四个文本框设置 <code>ShowLabel='true' DisplayText='@@null'</code> 显示无内容的占位标签",
"P3": "使用双向绑定时",
"GroupBox2Title": "双向绑定",
"GroupBox2D1": "第一个文本框设置 <code>@@bind-Value='Dummy.Name'</code>,不显示标签",
"GroupBox2D2": "第二个文本框设置 <code>@@bind-Value='Dummy.Name' ShowLabel='true' DisplayText='@@Localizer[nameof(Foo.Address)]'</code> 显示设置的内容",
"GroupBox2D3": "第三个文本框设置 <code>@@bind-Value='Dummy.Name' ShowLabel='true' DisplayText=''</code> 显示无内容占位标签",
"GroupBox2D4": "第四个文本框设置 <code>@@bind-Value='Dummy.Name' ShowLabel='true' DisplayText='@@null'</code> 显示资源文件机制下的标签内容 <code>Label</code>",
"Block2Title": "EditorForm 中使用",
"Block2Intro": "未套 <code>ValidateForm</code> 中使用",
"P4": "<b>显示标签</b><div>未设置 <coe>EditorForm</coe> 组件的 <code>ShowLabel</code> 属性,未设置时等同于设置为 <code>true</code>,所有组件 <b>显示</b> 标签</div>",
"P5": "<b>不显示标签</b><div>设置 <code>ShowLabel='false'</code>,组件内的所有表单组件 <b>不显示</b> 标签</div>",
"Block3Title": "EditorForm 内置 ValidateForm 中使用",
"Block3Intro": "外置 <code>ValidateForm</code> 中使用",
"P6": "<b>显示标签</b><div>未设置 <coe>EditorForm</coe> 组件的 <code>ShowLabel</code> 属性,未设置时等同于设置为 <code>true</code>,所有组件 <b>显示</b> 标签</div>",
"P7": "<b>不显示标签</b><div>设置 <code>ShowLabel='false'</code>,组件内的所有表单组件 <b>不显示</b> 标签</div>",
"Block4Title": "ValidateForm 中使用",
"Block4Intro": "默认自动开启显示标签",
"P8": "<b>显示标签</b><div>未设置 <coe>EditorForm</coe> 组件的 <code>ShowLabel</code> 属性,未设置时等同于设置为 <code>true</code>,所有组件 <b>显示</b> 标签</div>",
"P9": "<b>不显示标签</b><div>设置 <code>ShowLabel='false'</code>,组件内的所有表单组件 <b>不显示</b> 标签</div>"
},
"BootstrapBlazor.Shared.Pages.Components.Block": {
"Title": "未设置",
"SubTitle": "示例"
},
"BootstrapBlazor.Shared.Pages.Install": {
"InstallTitle": "安装",
"GitP1": "Git 工具有很多种大家比较熟悉的,这里我介绍两款 Git 客户端工具",
"GitP2": "推荐使用 <a href='https://fork.dev'>Fork</a> 工具进行安装,它能更好地和 <a href='https://visualstudio.microsoft.com/vs/getting-started/' target='_blank'>Visutal Studio</a> 开发工具配合使用。",
"NugetInstall": "Nuget 安装",
"NugetP1": "使用 <a href='https://www.nuget.org/packages?q=BootstrapBlazor' target='_blank'>nuget.org</a> 进行 BootstrapBlazor 组件的安装",
"EnvBuildTitle": "项目环境搭建",
"EnvLi1": "安装 .net core sdk <a href='http://www.microsoft.com/net/download' target='_blan'>官方网址</a>",
"EnvLi2": "安装 Visual Studio 2019 以上 <a href='https://visualstudio.microsoft.com/vs/getting-started' target='_blank'>官方网址</a>",
"EnvLi3": "拉取项目代码 BootstrapBlazor <a href='https://gitee.com/LongbowEnterprise/BootstrapBlazor' target='_blank'>仓库网址</a>"
},
"BootstrapBlazor.Shared.Pages.Template": {
"Title": "项目模板",
"SubTitle": "Bootstrap Blazor App 模板",
"P1": "为了方便大家利用这套组件快速搭建项目,作者制作了 <b>项目模板(<code>Project Templates</code></b>,使用 <code>dotnet new</code> 命令行模式,使用步骤如下:",
"P2": "1. 安装项目模板",
"P3": "2. 创建工程",
"P4": "创建工程后在当前文件夹内会生成 <code>BootstrapBlazorApp</code> 解决方案,<code>src</code> 目录内包含 <code>Server-Side</code> <code>Wasm</code> 两种类型的工程,均可以直接 <kbd>F5</kbd> 运行",
"P5": "3. 卸载项目模板",
"SubTitle1": "Bootstrap Blazor App Extension 扩展插件",
"p6": "为了方便使用 <code>Bootstrap Blazor</code> 组件库,作者制作了 <b>项目模板(<code>Bootstrap Blazor Project Template</code></b> 扩展插件,安装此插件可通过 <code>Visual Studio 2019 IDE</code> 新建项目时选择 <code>Bootstrap Blazor 项目模板</code>,解决方案内置 <code>Server-Side</code> 与 <cide>wasm</cide> 两种类型工程"
},
"BootstrapBlazor.Shared.Pages.Golbalization": {
"Title": "全球化",
"SubTitle": "ASP.NET Core Blazor 全球化",
"P1": "阅读以下知识点前请先查看 <a href='https://docs.microsoft.com/zh-cn/aspnet/core/blazor/globalization-localization?view=aspnetcore-3.1' target='_blank'>微软官方文档</a>"
},
"BootstrapBlazor.Shared.Pages.Components.InstallContent": {
"H1": "组件引用",
"P1": "组件引用有多种方法,可以参阅 <a href='install'>类库安装</a>",
"H2": "CSS 文件",
"P2": "将 Bootstrap 的 CSS 文件以 <code>&lt;link&gt;</code> 标签的形式添加到 <code>@HostFile</code> 文件 <code>&lt;head&gt;</code> 标签中,并放置在所有其它样式表之前。",
"Tips": "本套组件 <b>5.0.32</b> 版本后移除内置 <code>font-awesome</code> 图标,请自行下载或者使用 <b>CDN</b> 加速服务",
"Pre": "&lt;link href='https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet'&gt;&lt;link href='_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css' rel='stylesheet'&gt;",
"Tips2": "如果是使用 <code>Blazor App</code> 模板创建的工程请移除默认的 <code>Bootstrap</code> 样式链接 <code>&lt;link rel='stylesheet' href='css/bootstrap/bootstrap.min.css' /&gt;</code>",
"H3": "JS 文件",
"P3": "Bootstrap 所提供的许多组件都依赖 JavaScript 才能运行。具体来说,这些组件都依赖 jQuery、Popper.js 以及我们自己的 JavaScript 插件。将以下 <code>&lt;script&gt;</code> 标签放到 <code>@HostFile</code> 文件尾部且在 <code>&lt;/body&gt;</code> 标签之前即可起作用。",
"Pre2": "&lt;script src='_content/BootstrapBlazor/js/bootstrap.blazor.bundle.min.js'&gt;&lt;/script&gt;",
"H4": "添加命名空间到 <code>_Imports.razor</code> 文件",
"H5": "注册服务",
"H6": "使用组件",
"P4": "在 <code>razor</code>组件中引用 <code>BootstrapBlazor</code> 组件",
"Pre3": "&lt;Button Color='Color.Primary'&gt;主要按钮&lt;/Button&gt;"
},
"BootstrapBlazor.Shared.Pages.Install_Server": {
"Title": "服务端渲染模式",
"CodeComment": "添加本行代码"
},
"BootstrapBlazor.Shared.Pages.Install_wasm": {
"Title": "客户端渲染模式",
"CodeComment": "添加本行代码"
},
"BootstrapBlazor.Shared.Pages.Components.Tips": {
"Title": "小提示"
},
"BootstrapBlazor.Shared.Pages.Components.AttributeTable": {
"Title": "Attributes 属性"
},
@@ -56,6 +205,11 @@
"ShowBarUsageText": "显示左侧 Bar",
"IntroText4": "作为 <code>Tip</code> 使用"
},
"BootstrapBlazor.Shared.Pages.DateTimePickers": {
"SubmitText": "保存",
"ModelValidateValue": "属性",
"ModelValidateValue.Required": "{0}为必填项"
},
"BootstrapBlazor.Shared.Pages.Selects": {
"PlaceHolder": "未选择"
},
@@ -92,7 +246,9 @@
"Foo.Name": "张三 {0}",
"Foo.Address": "上海市普陀区金沙江路 {0} 弄",
"Foo.Address2": "地球、中国、上海市普陀区金沙江路 {0} 弄 这里是超长单元格示例",
"Foo.BindValue": "绑定值"
"Foo.BindValue": "绑定值",
"True": "通过",
"False": "未通过"
},
"BootstrapBlazor.Shared.Pages.ValidateForms.ComplexFoo": {
"Name": "姓名",
@@ -131,7 +287,8 @@
"FlowText": "工作流",
"InstallAppText": "安装小程序",
"InstallText": "安装",
"CancelText": "取消"
"CancelText": "取消",
"Title": "点击查看更新日志"
},
"BootstrapBlazor.Shared.Shared.NavMenu": {
"GetStarted": "快速上手",
@@ -169,6 +326,7 @@
"Dialog": "对话框 Dialog",
"Drawer": "抽屉 Drawer",
"EditDialog": "编辑弹窗 EditDialog",
"FloatingLabel": "悬浮标签 FloatingLabel",
"Message": "消息框 Message",
"Modal": "模态框 Modal",
"Light": "指示灯 Light",
@@ -213,7 +371,6 @@
"Camera": "摄像头 Camera",
"Captcha": "验证码 Captcha",
"Carousel": "走马灯 Carousel",
"Chart": "图表 Chart",
"Circle": "进度环 Circle",
"Collapse": "折叠 Collapse",
"Display": "数据显示 Display",
@@ -234,7 +391,9 @@
"TableBase": "基本功能",
"TableRow": "行设置",
"TableColumn": "列设置",
"TableCell": "单元格",
"TableDetail": "明细行",
"TableDynamic": "动态表格",
"TableSearch": "搜索功能",
"TableFilter": "筛选和排序",
"TableFixHeader": "固定表头",
@@ -251,9 +410,18 @@
"TableWrap": "折行演示",
"TableTree": "树形数据",
"TableLaoding": "数据加载",
"TableLookup": "外键数据源",
"MenuAccordion": "手风琴效果",
"MenuExpandAll": "全部展开",
"Empty": "空状态 Empty"
"Empty": "空状态 Empty",
"Charts": "图表 Chart",
"ChartSummary": "简介",
"ChartLine": "折线图",
"ChartBar": "柱状图",
"ChartPie": "饼图",
"ChartDoughnut": "圆环图",
"ChartBubble": "气泡图",
"Transition": "过渡效果"
},
"BootstrapBlazor.Shared.Pages.Menus": {
"System": "系统设置",
@@ -282,8 +450,59 @@
"SubMenu41": "曾曾孙菜单 41",
"SubMenu42": "曾曾孙菜单 42"
},
"BootstrapBlazor.Shared.Pages.Emptys": {
"BootstrapBlazor.Shared.Pages.Empties": {
"Title": "Empty 空状态",
"subTitle": "空状态时的展示占位图"
"SubTitle": "空状态时的展示占位图"
},
"BootstrapBlazor.Shared.Pages.Table.TablesFooter": {
"Left": "左对齐",
"Center": "居中",
"Right": "右对齐"
},
"BootstrapBlazor.Shared.Pages.Table.TablesDetailRow": {
"DetailTextTrue": "关闭明细行",
"DetailTextFalse": "开启明细行"
},
"BootstrapBlazor.Shared.Pages.Table.Tables": {
"RefreshText": "刷新",
"ButtonAddColumnText": "增加列",
"ButtonRemoveColumnText": "移除列"
},
"BootstrapBlazor.Shared.Pages.Introduction": {
"Title": "简介",
"P1": "BootstrapBlazor 是一套基于 Bootstrap 和 Blazor 的企业级组件库,可以认为是 Bootstrap 项目的 Blazor 版实现。",
"P2": "依赖关系为BootstrapBlazor > Bootstrap > jQuery",
"P3": "最新 <a href='template' target='_blank'>项目模板</a> 中将以上依赖进行了打包捆绑大大简化使用",
"UpdateTitle": "更新日志",
"P4": "本组件目前每天可能有 <b><code>beta</code></b> 版本发布,每 <b><code>周四</code></b> 发布 <b><code>正式版</code></b> 更新日志 <a id='log' data-bs-toggle='popover' title='更新日志' data-bs-content='本组件目前每天可能有 <b><code>beta</code></b> 版本发布,每 <b><code>周四</code></b> 发布 <b><code>正式版</code></b> 更新日志' data-bs-html='true' href='{0}' target='_blank'>[传送门]</a>",
"LearnTitle": "学习资料",
"LearnLi1": "Blazor 官方文档",
"LearnLi2": "使用 Blazor WebAssembly 和 Visual Studio Code 生成 Web 应用",
"LearnLi3": "什么是 Blazor",
"LearnLi4": "练习 - 配置开发环境",
"LearnLi5": "Blazor 组件",
"LearnLi6": "练习 - 添加组件",
"LeanrnLi7": "数据绑定和事件",
"LearnLi8": "练习 - 数据绑定和事件",
"Summarize": "总结",
"ProjectsShow": "作品展示",
"P5": "国内最大代码托管协作开发平台 <b><a href='{0}' target='_blank'>码云</a></b> C# 板块最高星 <a href='{1}'><img src={2}' alt='star' style='margin-bottom',: '1px;' ></a> 作品 <b><a href='{3}' target=''_blank'>通用后台管理系统 BootstrapAdmin</a></b> 准备使用本组件实现全部功能",
"ShowWebSiteTitle": "演示网站",
"GetStarted": "快速上手",
"QuikStart": "快速入门",
"Features": "组件特色",
"P6": "Bootstrap Blazor UI 组件库提供了从基本的 <code>Button</code> 组件到高级的网页级 <code>SmartPage</code> 组件",
"Advantage": "优势",
"AdvantageLi1": "使用组件无需编写 <code>Javascript</code>",
"AdvantageLi2": "组件支持所有 <code>html</code> 特性",
"AdvantageLi3": "组件支持数据双向绑定",
"AdvantageLi4": "组件支持自动客户端验证",
"AdvantageLi5": "组件支持组合",
"Community": "交流群"
},
"BootstrapBlazor.Shared.Pages.Components.QQGroup": {
"Group": "QQ群",
"Status": "满",
"Welcome": "欢迎加群讨论"
}
}

View File

@@ -0,0 +1,82 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.JSInterop;
using System;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages.Components
{
/// <summary>
///
/// </summary>
public partial class ChartToast : ComponentBase, IDisposable
{
/// <summary>
///
/// </summary>
[Inject]
private ToastService? ToastService { get; set; }
[Inject]
private IJSRuntime? JSRuntime { get; set; }
private JSInterop<ChartToast>? Interope { get; set; }
/// <summary>
/// BuildRenderTree 方法
/// </summary>
/// <param name="builder"></param>
protected override void BuildRenderTree(RenderTreeBuilder builder)
{
builder.OpenComponent<Toast>(0);
builder.CloseComponent();
}
/// <summary>
/// OnAfterRenderAsync 方法
/// </summary>
/// <param name="firstRender"></param>
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnAfterRenderAsync(firstRender);
if (firstRender && JSRuntime != null)
{
if (Interope == null) Interope = new JSInterop<ChartToast>(JSRuntime);
await Interope.InvokeVoidAsync(this, "", "_initChart", nameof(ShowToast));
}
}
/// <summary>
///
/// </summary>
[JSInvokable]
public void ShowToast()
{
ToastService?.Show(new ToastOption() { Title = "友情提示", Content = "屏幕宽度过小,如果是手机请横屏观看" });
}
/// <summary>
///
/// </summary>
/// <param name="disposing"></param>
private void Dispose(bool disposing)
{
if (disposing) Interope?.Dispose();
}
/// <summary>
///
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}

View File

@@ -15,7 +15,7 @@ namespace BootstrapBlazor.Shared.Pages.Components
{
private string ImageUrl => $"_content/BootstrapBlazor.Shared/images/{Image}";
private string? ClassString => CssBuilder.Default("form-group col-12 col-sm-6 col-md-4 col-lg-3")
private string? ClassString => CssBuilder.Default("col-12 col-sm-6 col-md-4 col-lg-3")
.AddClass("d-none", !string.IsNullOrEmpty(SearchText) && !Text.Contains(SearchText, System.StringComparison.OrdinalIgnoreCase))
.Build();

View File

@@ -5,8 +5,8 @@
<h4>@Desc</h4>
<div class="form-inline coms-demo">
<div class="row flex-fill">
<div class="coms-demo">
<div class="row g-3">
<CascadingValue Value="this" IsFixed="true">
@ChildContent
</CascadingValue>

View File

@@ -1,10 +1,8 @@
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">
<Select TValue="string" Items="@Items3" OnSelectedItemChanged="@OnCascadeBindSelectClick" />
</div>
<div class="form-group col-12 col-sm-6">
<Select TValue="string" Items="@Items2" />
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<Select TValue="string" Items="@Items3" OnSelectedItemChanged="@OnCascadeBindSelectClick" />
</div>
<div class="col-12 col-sm-6">
<Select TValue="string" Items="@Items2" />
</div>
</div>

View File

@@ -0,0 +1 @@
改变标题栏中下拉框此处会更改: @Value

View File

@@ -0,0 +1,35 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages.Components
{
/// <summary>
///
/// </summary>
public partial class DialogBodyFoo
{
private string? Value { get; set; }
private List<SelectedItem> Items { get; } = new(new[]
{
new SelectedItem("beijing", "北京"),
new SelectedItem("shanghai", "上海")
});
/// <summary>
///
/// </summary>
public Task UpdateAsync(string val)
{
Value = Items.First(i => i.Value == val).Text;
StateHasChanged();
return Task.CompletedTask;
}
}
}

View File

@@ -0,0 +1,4 @@
<h5 class="modal-title">自定义 Header</h5>
<div class="d-flex flex-fill justify-content-end me-3">
<Select TValue="string" Items="Items" Value="Value" OnSelectedItemChanged="OnSelectedItemChanged" style="max-width: 120px;" />
</div>

View File

@@ -0,0 +1,57 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages.Components
{
/// <summary>
///
/// </summary>
public partial class DialogHeaderFoo
{
[NotNull]
private IEnumerable<SelectedItem>? Items { get; set; }
/// <summary>
///
/// </summary>
[Parameter]
public string? Value { get; set; }
/// <summary>
///
/// </summary>
[Parameter]
public Func<string, Task>? OnValueChanged { get; set; }
/// <summary>
///
/// </summary>
protected override void OnInitialized()
{
base.OnInitialized();
Items = new[]
{
new SelectedItem("beijing", "北京"),
new SelectedItem("shanghai", "上海")
};
}
private async Task OnSelectedItemChanged(SelectedItem item)
{
Value = item.Value;
if (OnValueChanged != null)
{
await OnValueChanged(Value);
}
}
}
}

View File

@@ -1,40 +1,43 @@
@using Microsoft.Extensions.DependencyInjection
@using Microsoft.Extensions.DependencyInjection
@inject NugetVersionService VersionManager
@inject IStringLocalizer<InstallContent> Localizer
<h3>@Title</h3>
<h4>组件引用</h4>
<h4>@Localizer["H1"]</h4>
<p>组件引用有多种方法,可以参阅 <a href="install">类库安装</a></p>
<p>@Localizer["P1"]</p>
<div class="code-label">.NET CLI</div>
<Pre class="no-highlight">dotnet add package BootstrapBlazor --version @Version</Pre>
<h5>CSS 文件</h5>
<h5>@Localizer["H2"]</h5>
<p>将 Bootstrap 的 CSS 文件以 <code>&lt;link&gt;</code> 标签的形式添加到 <code>@HostFile</code> 文件 <code>&lt;head&gt;</code> 标签中,并放置在所有其它样式表之前。</p>
<Pre>&lt;link href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css" rel="stylesheet"&gt;</Pre>
<p>@((MarkupString)Localizer["P2"].Value)</p>
<Tips>
<p>如果是使用 <code>Blazozr App</code> 模板创建的工程请移除默认的 <code>Bootstrap</code> 样式链接 <code>&lt;link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" /&gt;</code></p>
<p>@((MarkupString)Localizer["Tips"].Value)</p>
</Tips>
<Pre>@((MarkupString)Localizer["Pre"].Value)</Pre>
<Tips>
<p>@((MarkupString)Localizer["Tips2"].Value)</p>
</Tips>
<h5>JS 文件</h5>
<h5>@Localizer["H3"]</h5>
<p>Bootstrap 所提供的许多组件都依赖 JavaScript 才能运行。具体来说,这些组件都依赖 jQuery、Popper.js 以及我们自己的 JavaScript 插件。将以下 <code>&lt;script&gt;</code> 标签放到 <code>@HostFile</code> 文件尾部且在 <code>&lt;/body&gt;</code> 标签之前即可起作用。</p>
<Pre>&lt;script src="_content/BootstrapBlazor/js/bootstrap.blazor.bundle.min.js"&gt;&lt;/script&gt;
</Pre>
<p>@((MarkupString)Localizer["P3"].Value)</p>
<Pre>@((MarkupString)Localizer["Pre2"].Value)</Pre>
<h4>添加命名空间到 <code>_Imports.razor</code> 文件</h4>
<h4>@((MarkupString)Localizer["H4"].Value)</h4>
<Pre>@@using BootstrapBlazor.Components</Pre>
<h4>注册服务</h4>
<h4>@Localizer["H5"]</h4>
@ChildContent
<h4>使用组件</h4>
<h4>@Localizer["H6"]</h4>
<p>在 <code>razor</code>组件中引用 <code>BootstrapBlazor</code> 组件</p>
<Pre>&lt;Button Color="Color.Primary"&gt;主要按钮&lt;/Button&gt;</Pre>
<p>@((MarkupString)Localizer["P4"].Value)</p>
<Pre>@((MarkupString)Localizer["Pre3"].Value)</Pre>

View File

@@ -8,7 +8,7 @@
<pre @attributes="@AdditionalAttributes" class="@ClassName"><code>@ChildContent</code></pre>
@if (CanCopy)
{
<button type="button" class="btn-clipboard" data-toggle="tooltip" title="点击复制代码">Copy</button>
<button type="button" class="btn-clipboard" data-bs-toggle="tooltip" data-bs-placement="left" title="点击复制代码">Copy</button>
}
}
</div>

View File

@@ -1,16 +1,17 @@
@inject IOptions<WebsiteOptions> WebsiteOption
@inject IStringLocalizer<QQGroup> Localzier
<div>
QQ群BootstrapAdmin & Blazor
@Localzier["Group"]BootstrapAdmin & Blazor
<a class="mx-1" target="_blank" href="@WebsiteOption.Value.QQGroup1Link">
<span class="text-danger fa fa-qq">
<span class="ml-1"><b>795206915()</b></span>
<span class="ms-1"><b>795206915(@Localzier["Status"])</b></span>
</span>
</a>
<a class="mx-1" target="_blank" href="@WebsiteOption.Value.QQGroup2Link">
<span class="text-success fa fa-qq">
<span class="ml-1"><b>675147445</b></span>
<span class="ms-1"><b>675147445</b></span>
</span>
</a>
欢迎加群讨论
@Localzier["Welcome"]
</div>

View File

@@ -1,18 +1,18 @@
@if (IsNew)
{
<span class="badge badge-danger">
<span>NEW</span>
</span>
<Badge Color="Color.Danger" IsPill="true">
NEW
</Badge>
}
@if (IsUpdate)
{
<span class="badge badge-success">
<span>Upd</span>
</span>
<Badge Color="Color.Success" IsPill="true">
Upd
</Badge>
}
@if (Count > 0)
{
<Badge Color="@BootstrapBlazor.Components.Color.Info" IsPill="true">
<Badge Color="Color.Info" IsPill="true">
@Count
</Badge>
}

View File

@@ -1,7 +1,7 @@
@inherits BootstrapComponentBase
<div @ref="@ThemeElement" class="theme">
<div class="btn btn-theme" data-toggle="tooltip" title="@Title" data-placement="left">
<div class="btn btn-theme" data-bs-toggle="tooltip" title="@Title" data-bs-placement="left">
<div class="theme-bar">
<span class="theme-color bg-danger"></span>
<span class="theme-color bg-success"></span>

View File

@@ -1,16 +1,12 @@
@inherits BootstrapComponentBase
@inject IStringLocalizer<Tips> Localizer
<Alert AdditionalAttributes="@AdditionalAttributes" ShowBar="true" Color="@Color">
<h4><i class="@Icon"></i>@Title</h4>
<h4><i class="@Icon"></i>@Localizer["Title"]</h4>
@ChildContent
</Alert>
@code {
/// <summary>
/// 获得/设置 显示文本
/// </summary>
[Parameter]
public string Title { get; set; } = "小技巧";
/// <summary>
/// 获得/设置 图标

View File

@@ -0,0 +1,60 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using System.Collections.Generic;
using System.Linq;
namespace BootstrapBlazor.Shared.Pages.Components
{
class TreeDataFoo
{
public string? Code { get; set; }
public string? ParentCode { get; set; }
public string? Text { get; set; }
public string Icon { get; set; } = "fa fa-fa";
/// <summary>
///
/// </summary>
/// <returns></returns>
public static List<TreeItem> GetTreeItems()
{
var items = new List<TreeDataFoo>();
items.Add(new TreeDataFoo() { Text = "导航一", Code = "1010" });
items.Add(new TreeDataFoo() { Text = "导航二", Code = "1020" });
items.Add(new TreeDataFoo() { Text = "导航三", Code = "1030" });
items.Add(new TreeDataFoo() { Text = "子菜单一", Code = "1040", ParentCode = "1020" });
items.Add(new TreeDataFoo() { Text = "子菜单二", Code = "1050", ParentCode = "1020" });
items.Add(new TreeDataFoo() { Text = "子菜单三", Code = "1060", ParentCode = "1020" });
items.Add(new TreeDataFoo() { Text = "孙菜单一", Code = "1070", ParentCode = "1050" });
items.Add(new TreeDataFoo() { Text = "孙菜单二", Code = "1080", ParentCode = "1050" });
items.Add(new TreeDataFoo() { Text = "孙菜单三", Code = "1090", ParentCode = "1050" });
items.Add(new TreeDataFoo() { Text = "曾孙菜单一", Code = "1100", ParentCode = "1080" });
items.Add(new TreeDataFoo() { Text = "曾孙菜单二", Code = "1110", ParentCode = "1080" });
items.Add(new TreeDataFoo() { Text = "曾孙菜单三", Code = "1120", ParentCode = "1080" });
items.Add(new TreeDataFoo() { Text = "曾曾孙菜单一", Code = "1130", ParentCode = "1100" });
items.Add(new TreeDataFoo() { Text = "曾曾孙菜单二", Code = "1140", ParentCode = "1100" });
items.Add(new TreeDataFoo() { Text = "曾曾孙菜单三", Code = "1150", ParentCode = "1100" });
// 算法获取属性结构数据
return GetSubItems(null, items).ToList();
}
private static List<TreeItem> GetSubItems(string? parentCode, IEnumerable<TreeDataFoo> foos)
{
var subData = foos.Where(i => i.ParentCode == parentCode);
return subData.Select(i => new TreeItem() { Text = i.Text, Items = GetSubItems(i.Code, foos) }).ToList();
}
}
}

View File

@@ -8,7 +8,7 @@
}
else
{
<a class="fa fa-video-camera mb-3" href="@VideoUrl" target="_blank"><span class="ml-2">[传送门]</span></a>
<a class="fa fa-video-camera mb-3" href="@VideoUrl" target="_blank"><span class="ms-2">[传送门]</span></a>
}
@code {

View File

@@ -1,4 +1,4 @@
<DropdownWidget class="text-right flex-fill px-3">
<DropdownWidget class="text-end flex-fill px-3">
<DropdownWidgetItem Icon="fa fa-envelope-o" BadgeNumber="4">
<HeaderTemplate>
<span>您有 4 个未读消息</span>
@@ -10,7 +10,7 @@
<div style="width: 40px; height: 40px;">
<Avatar Url="_content/BootstrapBlazor.Shared/images/Argo-C.png" IsCircle="true" Size="Size.Small" />
</div>
<div class="ml-2">
<div class="ms-2">
<div class="d-flex position-relative">
<h4>Argo Zhang</h4>
<small><i class="fa fa-clock-o"></i> @(4 + index) mins</small>
@@ -33,7 +33,7 @@
{
<a class="dropdown-item d-flex align-items-center" href="#" @onclick:preventDefault>
<i class="fa fa-users text-primary"></i>
<div class="ml-2">5 new members joined</div>
<div class="ms-2">5 new members joined</div>
</a>
}
</BodyTemplate>

View File

@@ -1,7 +1,7 @@
@page "/components"
<div class="coms-search form-inline">
<div class="row flex-fill">
<div class="coms-search">
<div class="row">
<div class="col-12">
<Search IgnoreCase="true" IsLikeMatch="true" PlaceHolder="搜索想要的组件" Items="@ComponentItems" OnSearch="@OnSearch"></Search>
</div>

View File

@@ -1,7 +1,8 @@
@page "/globalization"
@inject IStringLocalizer<Golbalization> Localizer
<h3>全球化</h3>
<h3>@Localizer["Title"]</h3>
<h4>ASP.NET Core Blazor 全球化</h4>
<h4>@Localizer["SubTitle"]</h4>
<p>阅读以下知识点前请先查看 <a href="https://docs.microsoft.com/zh-cn/aspnet/core/blazor/globalization-localization?view=aspnetcore-3.1" target="_blank">微软官方文档</a></p>
<p>@((MarkupString)Localizer["P1"].Value)</p>

View File

@@ -7,184 +7,179 @@
<section class="home-section">
<div class="welcome container">
<div class="form-inline">
<div class="row">
<div class="col-12 col-lg-6">
<div class="welcome-header">
<h4>
Bootstrap 风格的 Blazor UI 组件库
</h4>
<div>基于 <code>Bootstrap</code> 样式库精心打造,并且额外增加了 @Options.Value.TotalCount 多种常用的组件,为您快速开发项目带来非一般的感觉</div>
<div class="welcome-body">
致力于打造全网<span @ref="TypeElement" class="typed"></span><span class="typed-cursor">|</span>
<div>最好玩的组件库</div>
</div>
</div>
<div class="welcome-footer">
<div class="d-flex flex-wrap">
<span role="alert" class="tag alert fade show alert-primary" data-toggle="tooltip" title="Tree 组件">
树形组件
</span>
<span role="alert" class="tag alert fade show alert-success" data-toggle="tooltip" title="Menu 组件">
菜单组件
</span>
<span role="alert" class="tag alert fade show alert-warning" data-toggle="tooltip" title="Tab Tag Alert 组件">
标签组件
</span>
<span role="alert" class="tag alert fade show alert-secondary" data-toggle="tooltip" title="Table 组件">
表格组件
</span>
</div>
<div class="d-flex flex-wrap">
<span role="alert" class="tag alert fade show alert-danger" data-toggle="tooltip" title="Layout Split 组件">
布局组件
</span>
<span role="alert" class="tag alert fade show alert-info" data-toggle="tooltip" title="Dialog Message Toast 组件">
通知组件
</span>
<span role="alert" class="tag alert fade show alert-dark" data-toggle="tooltip" title="Upload 组件">
上传组件
</span>
<span role="alert" class="tag alert fade show alert-success" data-toggle="tooltip" title="Swith Toogle 组件">
开关组件
</span>
</div>
<div class="row g-3">
<div class="col-12 col-lg-6 position-relative">
<div class="welcome-header">
<h4>
@Localizer["HeaderTitle"]
</h4>
<div>@((MarkupString)Localizer["HeaderDesc", Options.Value.TotalCount].Value)</div>
<div class="@BodyClassString">
@Localizer["HeaderBody"]<span @ref="TypeElement" class="typed"></span><span class="typed-cursor">|</span>
<div>@Localizer["HeaderBody1"]</div>
</div>
</div>
<div class="col-12 col-lg-6">
<div id="carouselExampleCaptions" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleCaptions" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleCaptions" data-slide-to="1"></li>
<li data-target="#carouselExampleCaptions" data-slide-to="2"></li>
<li data-target="#carouselExampleCaptions" data-slide-to="3"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="bar">
<div class="carousel-img">
<img src="_content/BootstrapBlazor.Shared/images/bar.gif" />
</div>
<div class="carousel-caption">
<h5>Chart 图表组件</h5>
<p>提供常用的多种图表组件</p>
</div>
<div class="welcome-footer">
<div class="d-flex flex-wrap">
<span role="alert" class="tag alert fade show alert-primary" data-bs-toggle="tooltip" title="Tree @Localizer["TagTitle"]">
@Localizer["Span1"]
</span>
<span role="alert" class="tag alert fade show alert-success" data-bs-toggle="tooltip" title="Menu @Localizer["TagTitle"]">
@Localizer["Span2"]
</span>
<span role="alert" class="tag alert fade show alert-warning" data-bs-toggle="tooltip" title="Tab Tag Alert @Localizer["TagTitle"]">
@Localizer["Span3"]
</span>
<span role="alert" class="tag alert fade show alert-secondary" data-bs-toggle="tooltip" title="Table @Localizer["TagTitle"]">
@Localizer["Span4"]
</span>
</div>
<div class="d-flex flex-wrap">
<span role="alert" class="tag alert fade show alert-danger" data-bs-toggle="tooltip" title="Layout Split @Localizer["TagTitle"]">
@Localizer["Span5"]
</span>
<span role="alert" class="tag alert fade show alert-info" data-bs-toggle="tooltip" title="Dialog Message Toast @Localizer["TagTitle"]">
@Localizer["Span6"]
</span>
<span role="alert" class="tag alert fade show alert-dark" data-bs-toggle="tooltip" title="Upload @Localizer["TagTitle"]">
@Localizer["Span7"]
</span>
<span role="alert" class="tag alert fade show alert-success" data-bs-toggle="tooltip" title="Swith Toogle @Localizer["TagTitle"]">
@Localizer["Span8"]
</span>
</div>
</div>
</div>
<div class="col-12 col-lg-6">
<div id="carouselExampleCaptions" class="carousel slide" data-bs-ride="carousel">
<ol class="carousel-indicators">
<li data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0" class="active"></li>
<li data-bs-target="#carouselExampleCaptions" data-bs-slide-to="1"></li>
<li data-bs-target="#carouselExampleCaptions" data-bs-slide-to="2"></li>
<li data-bs-target="#carouselExampleCaptions" data-bs-slide-to="3"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="bar">
<div class="carousel-img">
<img src="_content/BootstrapBlazor.Shared/images/bar.gif" />
</div>
</div>
<div class="carousel-item">
<div class="bar">
<div class="carousel-img">
<img src="_content/BootstrapBlazor.Shared/images/dought.gif" />
</div>
<div class="carousel-caption">
<h5>Chart 图标组件</h5>
<p>多维度数据对比</p>
</div>
</div>
</div>
<div class="carousel-item">
<div class="bar">
<div class="carousel-img">
<img src="_content/BootstrapBlazor.Shared/images/table.png" />
</div>
<div class="carousel-caption">
<h5>全功能表格组件</h5>
<p>具备增删改查搜、分页、排序所有功能</p>
</div>
</div>
</div>
<div class="carousel-item">
<div class="bar">
<div class="carousel-img">
<img src="_content/BootstrapBlazor.Shared/images/timeline.png" />
</div>
<div class="carousel-caption">
<h5>超强时间线功能</h5>
<p>自定义节点显示任意组件</p>
</div>
<div class="carousel-caption">
<h5>@Localizer["CarouselH1"]</h5>
<p>@Localizer["CarouselP1"]</p>
</div>
</div>
</div>
<div class="carousel-item">
<div class="bar">
<div class="carousel-img">
<img src="_content/BootstrapBlazor.Shared/images/dought.gif" />
</div>
<div class="carousel-caption">
<h5>@Localizer["CarouselH2"]</h5>
<p>@Localizer["CarouselP2"]</p>
</div>
</div>
</div>
<div class="carousel-item">
<div class="bar">
<div class="carousel-img">
<img src="_content/BootstrapBlazor.Shared/images/table.png" />
</div>
<div class="carousel-caption">
<h5>@Localizer["CarouselH3"]</h5>
<p>@Localizer["CarouselP3"]</p>
</div>
</div>
</div>
<div class="carousel-item">
<div class="bar">
<div class="carousel-img">
<img src="_content/BootstrapBlazor.Shared/images/timeline.png" />
</div>
<div class="carousel-caption">
<h5>@Localizer["CarouselH4"]</h5>
<p>@Localizer["CarouselP4"]</p>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleCaptions" role="button"
data-slide="prev">
<i class="fa fa-angle-left"></i>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleCaptions" role="button"
data-slide="next">
<i class="fa fa-angle-right"></i>
<span class="sr-only">Next</span>
</a>
</div>
<a class="carousel-control-prev" href="#carouselExampleCaptions" role="button"
data-bs-slide="prev">
<i class="fa fa-angle-left"></i>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleCaptions" role="button"
data-bs-slide="next">
<i class="fa fa-angle-right"></i>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
</div>
<div class="intro container">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6 col-md-4">
<div class="card border-success">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/components.svg" alt="components" />
</p>
<h3>丰富组件</h3>
<div>本套组件库包含超过 @Options.Value.TotalCount 多个组件,从简单的按钮到复杂的整页面级别的组件</div>
</div>
<div class="row g-3">
<div class="col-12 col-sm-6 col-md-4">
<div class="card border-success">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/components.svg" alt="components" />
</p>
<h3>@Localizer["ContainerH1"]</h3>
<div>@((MarkupString)Localizer["ContainerD1", Options.Value.TotalCount].Value)</div>
</div>
<div class="form-group col-12 col-sm-6 col-md-4">
<div class="card border-primary">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/performance.svg" alt="components" />
</p>
<h3>性能</h3>
<div>
每个控件都经过微调,优化父子组件之间刷新逻辑,避免多次循环更新
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4">
<div class="card border-primary">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/performance.svg" alt="components" />
</p>
<h3>@Localizer["ContainerH2"]</h3>
<div>@Localizer["ContainerD2"]</div>
</div>
<div class="form-group col-12 col-sm-6 col-md-4">
<div class="card border-info">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/ease-of-use.svg" alt="components" />
</p>
<h3>简单易用</h3>
<div>轻松掌握组件使用方法,快速将 BootstrapBlazor 控件融入到项目中</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4">
<div class="card border-info">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/ease-of-use.svg" alt="components" />
</p>
<h3>@Localizer["ContainerH3"]</h3>
<div>@Localizer["ContainerD3"]</div>
</div>
<div class="form-group col-12 col-sm-6 col-md-4">
<div class="card border-danger">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/hassel-free-licensing.svg" alt="components" />
</p>
<h3>免费开源</h3>
<div>简单、直接、免费使用、无依赖组件,依赖 jQuery Bootstrap 均已内置</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4">
<div class="card border-danger">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/hassel-free-licensing.svg" alt="components" />
</p>
<h3>@Localizer["ContainerH4"]</h3>
<div>@Localizer["ContainerD4"]</div>
</div>
<div class="form-group col-12 col-sm-6 col-md-4">
<div class="card border-warning">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/demo-and-training.svg" alt="components" />
</p>
<h3>演示与示例</h3>
<div>详细文档与在线演示,功能设置简单,直接拷贝代码开箱即用</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4">
<div class="card border-warning">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/demo-and-training.svg" alt="components" />
</p>
<h3>@Localizer["ContainerH5"]</h3>
<div>@Localizer["ContainerD5"]</div>
</div>
<div class="form-group col-12 col-sm-6 col-md-4">
<div class="card border-secondary">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/frequent-updates.svg" alt="components" />
</p>
<h3>持续更新</h3>
<div>码云平台托管开源,永不闭源,持续更新,及时响应问题与反馈</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4">
<div class="card border-secondary">
<p class="d-none d-sm-block">
<img src="_content/BootstrapBlazor.Shared/images/frequent-updates.svg" alt="components" />
</p>
<h3>@Localizer["ContainerH6"]</h3>
<div>@Localizer["ContainerD6"]</div>
</div>
</div>
</div>
</div>
<div class="donate">
<h3>捐助</h3>
<h5 class="d-none d-sm-block mb-3">扫码捐助请作者喝一杯咖啡</h5>
<h3>@Localizer["DonateH1"]</h3>
<h5 class="d-none d-sm-block mb-3">@Localizer["DonateH2"]</h5>
<img class="barcode" src="https://gitee.com/LongbowEnterprise/Pictures/raw/master/WeChat/BarCode@2x.png" />
<div class="wwads-cn wwads-horizontal" data-id="72" style="max-width:350px"></div>
</div>
</section>

View File

@@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
@@ -18,12 +19,15 @@ namespace BootstrapBlazor.Shared.Pages
{
private ElementReference TypeElement { get; set; }
private string? BodyClassString => CssBuilder.Default(Localizer["BodyClassString"])
.Build();
[Inject]
private IJSRuntime? JSRuntime { get; set; }
[Inject]
[NotNull]
private IStringLocalizer<App>? Localizer { get; set; }
private IStringLocalizer<Index>? Localizer { get; set; }
[Inject]
[NotNull]
@@ -40,7 +44,7 @@ namespace BootstrapBlazor.Shared.Pages
if (firstRender && JSRuntime != null)
{
await JSRuntime.InvokeVoidAsync("$.indexTyper", TypeElement);
await JSRuntime.InvokeVoidAsync("$.indexTyper", TypeElement, Localizer["DynamicText"].Value.ToCharArray(), Localizer["DynamicText1"].Value.ToCharArray(), Localizer["DynamicText2"].Value.ToCharArray());
}
}
}

View File

@@ -1,11 +1,12 @@
@page "/install"
@inject NugetVersionService VersionManager
@inject IStringLocalizer<Install> Localizer
<h3>安装</h3>
<h3>@Localizer["InstallTitle"]</h3>
<h4>Git</h4>
<p>Git 工具有很多种大家比较熟悉的,这里我介绍两款 Git 客户端工具</p>
<p>@Localizer["GitP1"]</p>
<div class="row mb-sm-3">
<div class="git col-12 col-sm-6 mb-3 mb-sm-0">
@@ -19,11 +20,11 @@
</div>
</div>
<p>推荐使用 <a href="https://fork.dev">Fork</a> 工具进行安装,它能更好地和 <a href="https://visualstudio.microsoft.com/vs/getting-started/" target="_blank">Visutal Studio</a> 开发工具配合使用。</p>
<p>@((MarkupString)Localizer["GitP2"].Value)</p>
<h4>Nuget 包安装</h4>
<h4>@Localizer["NugetInstall"]</h4>
<p>使用 <a href="https://www.nuget.org/packages?q=BootstrapBlazor" target="_blank">nuget.org</a> 进行 BootstrapBlazor 组件的安装</p>
<p>@((MarkupString)Localizer["NugetP1"].Value)</p>
<div class="code-label">.NET CLI</div>
<Pre class="no-highlight">dotnet add package BootstrapBlazor --version @Version</Pre>
@@ -34,12 +35,12 @@
<div class="code-label">Package Manager</div>
<Pre class="no-highlight">Install-Package BootstrapBlazor -Version @Version</Pre>
<h4>项目环境搭建</h4>
<h4>@Localizer["EnvBuildTitle"]</h4>
<ol>
<li>安装 .net core sdk <a href="http://www.microsoft.com/net/download" target="_blank">官方网址</a></li>
<li>安装 Visual Studio 2019 以上 <a href="https://visualstudio.microsoft.com/vs/getting-started" target="_blank">官方网址</a></li>
<li>拉取项目代码 BootstrapBlazor <a href="https://gitee.com/LongbowEnterprise/BootstrapBlazor" target="_blank">仓库网址</a></li>
<li>@((MarkupString)Localizer["EnvLi1"].Value)</li>
<li>@((MarkupString)Localizer["EnvLi2"].Value)</li>
<li>@((MarkupString)Localizer["EnvLi3"].Value)</li>
</ol>
<Pre class="no-highlight">git clone https://gitee.com/LongbowEnterprise/BootstrapBlazor</Pre>

View File

@@ -1,12 +1,13 @@
@page "/install-server"
@inject IStringLocalizer<Install_Server> Localizer
<InstallContent>
<InstallContent Title="@Localizer["Title"]">
<Pre>public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddServerSideBlazor();
// 添加本行代码
// @Localizer["CodeComment"]
services.AddBootstrapBlazor();
}</Pre>
</InstallContent>

View File

@@ -1,6 +1,7 @@
@page "/install-wasm"
@inject IStringLocalizer<Install_wasm> Localizer
<InstallContent Title="客户端渲染模式" HostFile="wwwroot/index.html">
<InstallContent Title="@Localizer["Title"]" HostFile="wwwroot/index.html">
<Pre>public class Program
{
public static async Task Main(string[] args)
@@ -9,7 +10,7 @@
builder.RootComponents.Add&lt;App&gt;("app");
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
// 添加本行代码
// @Localizer["CodeComment"]
builder.Services.AddBootstrapBlazor();
await builder.Build().RunAsync();

View File

@@ -1,47 +1,70 @@
@page "/docs"
@page "/introduction"
@inject IOptions<WebsiteOptions> WebsiteOption
<h3>简介</h3>
<h3>@Localizer["Title"]</h3>
<p>BootstrapBlazor 是一套基于 Bootstrap 和 Blazor 的企业级组件库,可以认为是 Bootstrap 项目的 Blazor 版实现。</p>
<p>@Localizer["P1"]</p>
<p>由于 Bootstrap UI 框架目前版本对 jQuery 有依赖,所以我们的 BootstrapBlazor 对 jQuery 也是有依赖</p>
<p>@Localizer["P2"]</p>
<p>依赖关系为BootstrapBlazor > Bootstrap > jQuery</p>
<p>@((MarkupString)Localizer["P3"].Value)</p>
<p>最新 <a href="template" target="_blank">项目模板</a> 中将以上依赖进行了打包捆绑大大简化使用</p>
<h3>@Localizer["UpdateTitle"]</h3>
<h3>学习资料</h3>
<p>@((MarkupString)Localizer["P4", WebsiteOption.Value.WikiUrl].Value)</p>
<h3>@Localizer["LearnTitle"]</h3>
<ul class="ul-demo mt-3">
<li><a href="https://docs.microsoft.com/zh-cn/aspnet/core/blazor/?WT.mc_id=DT-MVP-5004174" target="_blank">Blazor 官方文档</a></li>
<li><a href="https://docs.microsoft.com/zh-cn/learn/modules/build-blazor-webassembly-visual-studio-code/?WT.mc_id=DT-MVP-5004174" target="_blank">使用 Blazor WebAssembly 和 Visual Studio Code 生成 Web 应用</a></li>
<li><a href="https://docs.microsoft.com/zh-cn/aspnet/core/blazor/?WT.mc_id=DT-MVP-5004174" target="_blank">@Localizer["LearnLi1"]</a></li>
<li><a href="https://docs.microsoft.com/zh-cn/learn/modules/build-blazor-webassembly-visual-studio-code/?WT.mc_id=DT-MVP-5004174" target="_blank">@Localizer["LearnLi2"]</a></li>
<li class="learn-item">
<a target="_blank" href="https://docs.microsoft.com/zh-cn/learn/modules/build-blazor-webassembly-visual-studio-code/2-understand-blazor-webassembly?WT.mc_id=DT-MVP-5004174">@Localizer["LearnLi3"]</a>
</li>
<li class="learn-item">
<a target="_blank" href="https://docs.microsoft.com/zh-cn/learn/modules/build-blazor-webassembly-visual-studio-code/3-exercise-configure-enviromnent?WT.mc_id=DT-MVP-5004174">@Localizer["LearnLi4"]</a>
</li>
<li class="learn-item">
<a target="_blank" href="https://docs.microsoft.com/zh-cn/learn/modules/build-blazor-webassembly-visual-studio-code/4-blazor-components?WT.mc_id=DT-MVP-5004174">@Localizer["LearnLi5"]</a>
</li>
<li class="learn-item">
<a target="_blank" href="https://docs.microsoft.com/zh-cn/learn/modules/build-blazor-webassembly-visual-studio-code/5-exercise-add-component?WT.mc_id=DT-MVP-5004174">@Localizer["Learn6"]</a>
</li>
<li class="learn-item">
<a target="_blank" href="https://docs.microsoft.com/zh-cn/learn/modules/build-blazor-webassembly-visual-studio-code/6-csharp-razor-binding?WT.mc_id=DT-MVP-5004174">@Localizer["LeanrnLi7"]</a>
</li>
<li class="learn-item">
<a target="_blank" href="https://docs.microsoft.com/zh-cn/learn/modules/build-blazor-webassembly-visual-studio-code/7-exercise-razor-binding?WT.mc_id=DT-MVP-5004174">@Localizer["LearnLi8"]</a>
</li>
<li class="learn-item">
<a target="_blank" href="https://docs.microsoft.com/zh-cn/learn/modules/build-blazor-webassembly-visual-studio-code/8-summary?WT.mc_id=DT-MVP-5004174">@Localizer["Summarize"]</a>
</li>
</ul>
<h3>作品展示</h3>
<h3>@Localizer["ProjectsShow"]</h3>
<p>国内最大代码托管协作开发平台 <b><a href="@WebsiteOption.Value.BootstrapBlazorLink" target="_blank">码云</a></b> C# 板块最高星 <a href='@WebsiteOption.Value.BootstrapAdminLink/stargazers'><img src='@WebsiteOption.Value.BootstrapAdminLink/badge/star.svg?theme=gvp' alt='star' style="margin-bottom: 1px;" /></a> 作品 <b><a href="@WebsiteOption.Value.BootstrapAdminLink" target="_blank">通用后台管理系统 BootstrapAdmin</a></b> 准备使用本组件实现全部功能</p>
<p>@((MarkupString)Localizer["P5", LocalizerUrls].Value)</p>
<p>演示网站<a href="@($"{WebsiteOption.Value.AdminUrl}/Pages")" target="_blank">@WebsiteOption.Value.AdminUrl</a></p>
<p>@Localizer["ShowWebSiteTitle"]<a href="@($"{WebsiteOption.Value.AdminUrl}/Pages")" target="_blank">@WebsiteOption.Value.AdminUrl</a></p>
<h4>快速上手</h4>
<h4>@Localizer["GetStarted"]</h4>
<p><a href="https://v4.bootcss.com/docs/getting-started/introduction/" target="_blank">Bootstrap 快速入门</a></p>
<p><a href="https://v5.bootcss.com/docs/getting-started/introduction/" target="_blank">Bootstrap @Localizer["QuikStart"]</a></p>
<h4>组件特色</h4>
<h4>@Localizer["Features"]</h4>
<p>Bootstrap Blazor UI 组件库提供了从基本的 <code>Button</code> 组件到高级的网页级 <code>SmartPage</code> 组件</p>
<p>@((MarkupString)Localizer["P6"].Value)</p>
<p class="code-label">优势</p>
<p class="code-label">@Localizer["Advantage"]</p>
<ul>
<li>使用组件无需编写 <code>Javascript</code></li>
<li>组件支持所有 <code>html</code> 特性</li>
<li>组件支持数据双向绑定</li>
<li>组件支持自动客户端验证</li>
<li>组件支持组合</li>
<li>@((MarkupString)Localizer["AdvantageLi1"].Value)</li>
<li>@((MarkupString)Localizer["AdvantageLi2"].Value)</li>
<li>@Localizer["AdvantageLi3"]</li>
<li>@Localizer["AdvantageLi4"]</li>
<li>@Localizer["AdvantageLi5"]</li>
</ul>
<p class="code-label">交流群</p>
<p class="code-label">@Localizer["Community"]</p>
<QQGroup />

View File

@@ -0,0 +1,88 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using Microsoft.JSInterop;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages
{
/// <summary>
///
/// </summary>
public partial class Introduction : IAsyncDisposable
{
/// <summary>
///
/// </summary>
[Inject]
[NotNull]
private IOptions<WebsiteOptions>? WebsiteOption { get; set; }
/// <summary>
///
/// </summary>
[Inject]
[NotNull]
private IStringLocalizer<Introduction>? Localizer { get; set; }
[Inject]
[NotNull]
private IJSRuntime? JSRuntime { get; set; }
[NotNull]
private string[]? LocalizerUrls { get; set; }
/// <summary>
///
/// </summary>
protected override void OnInitialized()
{
base.OnInitialized();
LocalizerUrls = new string[]
{
WebsiteOption.Value.BootstrapBlazorLink,
WebsiteOption.Value.BootstrapBlazorLink + "/stargazers",
WebsiteOption.Value.BootstrapBlazorLink + "/badge/star.svg?theme=gvp",
WebsiteOption.Value.BootstrapAdminLink
};
}
private bool IsRender { get; set; }
/// <summary>
///
/// </summary>
/// <param name="firstRender"></param>
/// <returns></returns>
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnAfterRenderAsync(firstRender);
if (firstRender)
{
IsRender = true;
await JSRuntime.InvokeVoidAsync("$.bb_open");
}
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public async ValueTask DisposeAsync()
{
if (IsRender)
{
await JSRuntime.InvokeVoidAsync("$.bb_open", "dispose");
}
GC.SuppressFinalize(this);
}
}
}

View File

@@ -15,15 +15,13 @@
</Block>
<Block Title="@CloseButtonUsageText" Introduction="@IntroText2">
<div>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Primary">@AlertPrimaryText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Secondary">@AlertSecondaryText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Success">@AlertSuccessText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Danger">@AlertDangerText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Warning">@AlertWarningText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Info">@AlertInfoText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Dark">@AlertDarkText</Alert>
</div>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Primary">@AlertPrimaryText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Secondary">@AlertSecondaryText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Success">@AlertSuccessText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Danger">@AlertDangerText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Warning">@AlertWarningText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Info">@AlertInfoText</Alert>
<Alert ShowDismiss="true" OnDismiss="@DismissClick" Color="Color.Dark">@AlertDarkText</Alert>
<Logger @ref="Trace" class="mt-3" />
</Block>

View File

@@ -48,8 +48,8 @@ namespace BootstrapBlazor.Shared.Pages
SubTitle ??= Localizer[nameof(SubTitle)];
BaseUsageText ??= Localizer[nameof(BaseUsageText)];
IntroText1 ??= Localizer[nameof(IntroText1)];
IntroText2 = new MarkupString(Localizer[nameof(IntroText2)] ?? "");
ContentText1 = new MarkupString(Localizer[nameof(ContentText1)] ?? "");
IntroText2 = new MarkupString(Localizer[nameof(IntroText2)]?.Value ?? "");
ContentText1 = new MarkupString(Localizer[nameof(ContentText1)]?.Value ?? "");
}
@@ -57,7 +57,7 @@ namespace BootstrapBlazor.Shared.Pages
/// 获得属性方法
/// </summary>
/// <returns></returns>
private IEnumerable<AttributeItem> GetAttributes() => new AttributeItem[]
private static IEnumerable<AttributeItem> GetAttributes() => new[]
{
// TODO: 移动到数据库中
new AttributeItem() {

View File

@@ -35,29 +35,13 @@
<Block Title="显示标签" Introduction="组件双向绑定时会根据条件自动判断是否显示标签文字">
<p>前置标签显式规则与 <code>BootstrapInput</code> 组件一致 <a href="inputs">[传送门]</a></p>
<Divider Text="双向绑定显示标签" Alignment="Alignment.Left" style="margin: 2rem 0;"></Divider>
<ValidateForm class="form-inline" Model="@Model">
<div class="row">
<div class="form-group col-12">
<AutoComplete Items="@StaticItems" @bind-Value="@Model.Name" ShowLabel="true" />
</div>
</div>
<ValidateForm Model="@Model">
<AutoComplete Items="@StaticItems" @bind-Value="@Model.Name" ShowLabel="true" />
</ValidateForm>
<Divider Text="双向绑定不显示标签" Alignment="Alignment.Left" style="margin: 2rem 0;" />
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<AutoComplete Items="@StaticItems" @bind-Value="@Model.Name" ShowLabel="false" />
</div>
</div>
</div>
<AutoComplete Items="@StaticItems" @bind-Value="@Model.Name" ShowLabel="false" />
<Divider Text="自定义 DisplayText" Alignment="Alignment.Left" style="margin: 2rem 0;"></Divider>
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<AutoComplete Items="@StaticItems" @bind-Value="@Model.Name" DisplayText="自定义城市" ShowLabel="true" />
</div>
</div>
</div>
<AutoComplete Items="@StaticItems" @bind-Value="@Model.Name" DisplayText="自定义城市" ShowLabel="true" />
</Block>
<AttributeTable Items="@GetAttributes()" />

View File

@@ -67,6 +67,13 @@ namespace BootstrapBlazor.Shared.Pages
ValueList = " — ",
DefaultValue = "无匹配数据"
},
new AttributeItem() {
Name = "DisplayCount",
Description = "匹配数据时显示的数量",
Type = "int?",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "ValueChanged",
Description = "文本框值变化时回调委托方法",
@@ -89,6 +96,14 @@ namespace BootstrapBlazor.Shared.Pages
ValueList = "true|false",
DefaultValue = "true"
},
new AttributeItem()
{
Name = "CustomFilter",
Description = "自定义集合过滤规则",
Type = "Func<Task<IEnumerable<string>>>",
ValueList = " — ",
DefaultValue = " — "
}
};
}
}

View File

@@ -5,53 +5,47 @@
<h4>出现在按钮、图标旁的数字或状态标记</h4>
<Block Title="基础用法" Introduction="提供各种颜色的徽章小挂件组件">
<div class="form-inline">
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Primary">primary</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Secondary">secondary</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Success">success</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Danger">danger</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Warning">warning</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Info">info</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Dark">dark</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Light">light</Badge></div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Primary">primary</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Secondary">secondary</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Success">success</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Danger">danger</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Warning">warning</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Info">info</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Dark">dark</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge Color="Color.Light">light</Badge></div>
</div>
</div>
</Block>
<Block Title="胶囊徽章" Introduction='通过属性 <code>IsPill="true"</code> 设置圆角的徽章挂件'>
<div class="form-inline">
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Primary">primary</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Secondary">secondary</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Success">success</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Danger">danger</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Warning">warning</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Info">info</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Dark">dark</Badge></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Light">light</Badge></div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Primary">primary</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Secondary">secondary</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Success">success</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Danger">danger</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Warning">warning</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Info">info</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Dark">dark</Badge></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Badge IsPill="true" Color="Color.Light">light</Badge></div>
</div>
</div>
</Block>
<Block Title="按钮内徽章" Introduction="按钮内部徽章">
<div class="form-inline">
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto">
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto">
<Button Color="Color.Primary">
<i class="fa fa-tv"></i>
<span>主要按钮</span>
<Badge Color="Color.Danger">1</Badge>
</Button>
</div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto">
<div class="badge-widget">
<i class="fa fa-tv"></i>
<Badge Color="Color.Success"><span style="padding: 0 2px;">8</span></Badge>
</div>
</div>
</div>
</div>
</Block>
<AttributeTable Items="@GetAttributes()" />

View File

@@ -5,91 +5,81 @@
<h4>常用的操作按钮。</h4>
<Block Title="基础用法" Introduction="基础的按钮用法。">
<div class="form-inline">
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Primary">要按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Secondary">次要按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Success">成功按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Danger">危险按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Warning">警告按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Info">信息按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Dark">黑暗按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Light">高亮按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Link">链接按钮</Button></div>
</div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Primary">主要按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Secondary">要按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Success">成功按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Danger">危险按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Warning">警告按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Info">信息按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Dark">黑暗按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Light">高亮按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button @onclick="@ButtonClick" Color="Color.Link">链接按钮</Button></div>
</div>
<Logger @ref="Trace" class="mt-3" />
</Block>
<Block Title="不同风格" Introduction="通过设置 <code>ButtonStyle</code> 来显示不同的按钮风格">
<div class="form-inline">
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Round" Color="Color.Primary">主要按钮</Button>
</div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Round" Color="Color.Secondary">次要按钮</Button>
</div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Round" Color="Color.Success">成功按钮</Button>
</div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Round" Color="Color.Danger">危险按钮</Button>
</div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Round" Color="Color.Warning">警告按钮</Button>
</div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Circle" Icon="fa fa-fw fa-cubes">
</Button>
</div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Round" Color="Color.Primary">主要按钮</Button>
</div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Round" Color="Color.Secondary">次要按钮</Button>
</div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Round" Color="Color.Success">成功按钮</Button>
</div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Round" Color="Color.Danger">危险按钮</Button>
</div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Round" Color="Color.Warning">警告按钮</Button>
</div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto">
<Button ButtonStyle="ButtonStyle.Circle" Icon="fa fa-fw fa-cubes">
</Button>
</div>
</div>
</Block>
<Block Title="Outline 按钮" Introduction='通过设置 <code>IsOutline="true"</code> 设置按钮边框颜色样式。'>
<div class="form-inline">
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Primary">要按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Secondary">次要按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Success">成功按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Danger">危险按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Warning">警告按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Info">信息按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Dark">黑暗按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Light">高亮按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Link">链接按钮</Button></div>
</div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Primary">主要按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Secondary">要按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Success">成功按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Danger">危险按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Warning">警告按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Info">信息按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Dark">黑暗按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Light">高亮按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsOutline="true" Color="Color.Link">链接按钮</Button></div>
</div>
</Block>
<Block Title="不同尺寸" Introduction='Button 组件提供除了默认值以外的多种尺寸,通过设置 <code>Size</code> 属性可以在不同场景下选择合适的按钮尺寸。'>
<div class="form-inline">
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.ExtraSmall" Color="Color.Primary">小按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.Small" Color="Color.Secondary">按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.None" Color="Color.Info">按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.Medium" Color="Color.Success">中等按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.Large" Color="Color.Danger">大按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.ExtraLarge" Color="Color.Warning">超大按钮</Button></div>
<div class="form-group col-12"><Button IsBlock="true" Color="Color.Primary">Block 按钮</Button></div>
</div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.ExtraSmall" Color="Color.Primary">超小按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.Small" Color="Color.Secondary">小按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.None" Color="Color.Info">按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.Medium" Color="Color.Success">中等按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.Large" Color="Color.Danger">大按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button Size="Size.ExtraLarge" Color="Color.Warning">大按钮</Button></div>
<div class="col-12"><Button IsBlock="true" Color="Color.Primary">Block 按钮</Button></div>
</div>
</Block>
<Block Title="禁用状态" Introduction="按钮不可用状态。通过设置 <code>IsDisabled</code> 属性">
<div class="form-inline">
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Primary">要按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Secondary">次要按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Success">成功按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Danger">危险按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Warning">警告按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Info">信息按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Dark">黑暗按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Light">高亮按钮</Button></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Link">链接按钮</Button></div>
</div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Primary">主要按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Secondary">要按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Success">成功按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Danger">危险按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Warning">警告按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Info">信息按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Dark">黑暗按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Light">高亮按钮</Button></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Button IsDisabled="true" Color="Color.Link">链接按钮</Button></div>
</div>
<p class="mt-3">通过 <code>OnClick</code> 回调方法中设置自身 <code>IsDisabled</code> 属性,或者调用组件实例方法 <code>SetDisable</code> 均可实现按钮禁用效果</p>
@@ -100,67 +90,51 @@
<li>使用 <code>IsDisabled</code> 属性设置时本页面传输量为 <code>4.8K</code></li>
<li>使用 <code>SetDisable</code> 方法设置时本页面传输量为 <code>280B</code></li>
</ul>
<div class="form-inline">
<div class="form-row">
<div class="form-group col-12">
<Button Text="点击被禁用" OnClick="@ClickButton1" @ref="ButtonDisableDemo" IsDisabled="@IsDisable">
<Tooltip Title="点击按钮后由于被禁用 Tooltip 被销毁" Placement="Placement.Top" Trigger="hover" />
</Button>
<Button Color="Color.Info" Text="点击后使第一个按钮可用" OnClickWithoutRender="@ClickButton2" class="ml-3"></Button>
</div>
<div class="row g-3">
<div class="col-12">
<Button Text="点击被禁用" OnClick="@ClickButton1" @ref="ButtonDisableDemo" IsDisabled="@IsDisable">
<Tooltip Title="点击按钮后由于被禁用 Tooltip 被销毁" Placement="Placement.Top" Trigger="hover" />
</Button>
<Button Color="Color.Info" Text="点击后使第一个按钮可用" OnClickWithoutRender="@ClickButton2" class="ms-3"></Button>
</div>
</div>
</Block>
<Block Title="按钮组" Introduction="由多个按钮组成一个组合按钮">
<div class="form-inline">
<div class="row">
<div class="form-group col-auto">
<div class="btn-group" role="group">
<Button Color="Color.Primary">按钮一</Button>
<Button Color="Color.Success">按钮二</Button>
</div>
</div>
</div>
<div class="btn-group" role="group">
<Button Color="Color.Primary">按钮一</Button>
<Button Color="Color.Success">按钮二</Button>
</div>
</Block>
<Block Title="带图标的按钮" Introduction="通过设置 <code>Icon</code> 属性对按钮图标进行设置,图标为字体字符串如使用 <code>font-awesome</code> 图标时 <code>fa fa-fa</code>">
<div class="form-inline">
<div class="row">
<div class="form-group col-auto">
<Button Color="Color.Primary" Icon="fa fa-fa" Text="状态按钮"></Button>
</div>
<div class="form-group col-auto">
<Button Color="Color.Info" Icon="fa fa-spinner fa-spin fa-fw" Text="进度按钮"></Button>
</div>
<div class="row g-3">
<div class="col-auto">
<Button Color="Color.Primary" Icon="fa fa-fa" Text="状态按钮"></Button>
</div>
<div class="col-auto">
<Button Color="Color.Info" Icon="fa fa-spinner fa-spin fa-fw" Text="进度按钮"></Button>
</div>
</div>
</Block>
<Block Title="二次封装按钮" Introduction="通过设置 <code>WinButton</code> 组件的 <code>Text</code> 属性对按钮显示文字进行设置,点击按钮是右侧显示被点击按钮的文字">
<div class="form-inline">
<div class="row">
<div class="form-group col-auto">
<WinButton Text="按钮一" OnClick="@ClickButtonShowText"></WinButton>
</div>
<div class="form-group col-auto">
<WinButton Text="按钮二" OnClick="@ClickButtonShowText"></WinButton>
</div>
<div class="form-group col-auto">
@ButtonText
</div>
<div class="row g-3">
<div class="col-auto">
<WinButton Text="按钮一" OnClick="@ClickButtonShowText"></WinButton>
</div>
<div class="col-auto">
<WinButton Text="按钮二" OnClick="@ClickButtonShowText"></WinButton>
</div>
<div class="col-auto">
@ButtonText
</div>
</div>
</Block>
<Block Title="异步请求按钮" Introduction="通过设置 <code>IsAsync</code> 属性按钮是否为 <b>异步请求按钮</b>,默认为 <code>false</code>">
<p>当按钮为异步请求按钮时,点击按钮后自身状态会改变为禁用状态,同时显示 <code>Loading</code> 小图标,异步请求结束后恢复正常,本例中点击 <b>异步请求</b>按钮后显示请求加载动画5 秒后恢复正常</p>
<div class="row">
<div class="col">
<Button Text="异步请求" IsAsync="true" Icon="fa fa-fw fa-fa" OnClick="@ClickAsyncButton" />
</div>
</div>
<Button Text="异步请求" IsAsync="true" Icon="fa fa-fw fa-fa" OnClick="@ClickAsyncButton" />
</Block>
<AttributeTable Items="@GetAttributes()" />

View File

@@ -11,7 +11,7 @@
<Block Title="数据双向绑定" Introduction="日历框选择时间时数据自动更新文本框">
<Calendar @bind-Value="@BindValue" />
<BootstrapInput TItem="DateTime" @bind-Value="@BindValue" Formatter="@Formatter" style="margin-top: 1rem;" />
<BootstrapInput @bind-Value="@BindValue" Formatter="@Formatter" style="margin-top: 1rem;" />
</Block>
<Block Title="按周展示" Introduction="通过设置属性 <code></code>">

View File

@@ -5,7 +5,7 @@
<h4>将信息聚合在卡片容器中展示</h4>
<Block Title="Card 卡片组件" Introduction="Card简单示例">
<Card style="width: 18rem;">
<Card>
<CardBody>
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
@@ -47,70 +47,84 @@
</Block>
<Block Title="带有边框颜色的卡片" Introduction="通过设置,<code>Color</code> 使border和Body具有相应的颜色">
<div class="row flex">
<Card Color="Color.Primary" Class="ml-3 mt-2" IsCenter="true" style="width: 18rem;">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Primary card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
<Card Color="Color.Secondary" Class="ml-3 mt-2" IsCenter="true" style="width: 18rem;">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Success card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
<Card Color="Color.Success" Class="ml-3 mt-2" IsCenter="true" style="width: 18rem;">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Secondary card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
<Card Color="Color.Warning" Class="ml-3 mt-2" IsCenter="true" style="width: 18rem;">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Warning card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
<Card Color="Color.Danger" Class="ml-3 mt-2" IsCenter="true" style="width: 18rem;">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Danger card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
<Card Color="Color.Info" Class="ml-3 mt-2" IsCenter="true" style="width: 18rem;">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Info card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
<Card Color="Color.Dark" Class="ml-3 mt-2" IsCenter="true" style="width: 18rem;">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Dark card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
<div class="row g-3">
<div class="col-12 col-sm-6 col-lg-4 col-xl-2">
<Card Color="Color.Primary" IsCenter="true">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Primary card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
</div>
<div class="col-12 col-sm-6 col-lg-4 col-xl-2">
<Card Color="Color.Secondary" IsCenter="true">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Success card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
</div>
<div class="col-12 col-sm-6 col-lg-4 col-xl-2">
<Card Color="Color.Success" IsCenter="true">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Secondary card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
</div>
<div class="col-12 col-sm-6 col-lg-4 col-xl-2">
<Card Color="Color.Warning" IsCenter="true">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Warning card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
</div>
<div class="col-12 col-sm-6 col-lg-4 col-xl-2">
<Card Color="Color.Danger" IsCenter="true">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Danger card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
</div>
<div class="col-12 col-sm-6 col-lg-4 col-xl-2">
<Card Color="Color.Info" IsCenter="true">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Info card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
</div>
<div class="col-12 col-sm-6 col-lg-4 col-xl-2">
<Card Color="Color.Dark" IsCenter="true">
<CardHeader>
Header
</CardHeader>
<CardBody>
<h5 class="card-title">Dark card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</CardBody>
</Card>
</div>
</div>
</Block>

View File

@@ -5,33 +5,15 @@
<h4>在有限空间内,循环播放同一类型的图片、文字等内容</h4>
<Block Title="基础用法" Introduction="适用广泛的基础用法,通过设置 <code>Items</code> 属性值对组件进行图片的绑定,值为图片路径数组">
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<Carousel Images="@Images" Width="280"></Carousel>
</div>
</div>
</div>
<Carousel Images="@Images" Width="280"></Carousel>
</Block>
<Block Title="淡入淡出" Introduction="通过设置 <code>IsFade</code> 属性,图片切换时采用淡入淡出效果">
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<Carousel Images="@Images" Width="280" IsFade="true"></Carousel>
</div>
</div>
</div>
<Carousel Images="@Images" Width="280" IsFade="true"></Carousel>
</Block>
<Block Title="点击图片回调事件" Introduction="通过设置 <code>OnClick</code> 属性后,点击 <code>Image</code> 后触发 <code>OnClick</code> 回调委托">
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<Carousel Images="@Images" Width="280" IsFade="true" OnClick="@OnClick"></Carousel>
</div>
</div>
</div>
<Carousel Images="@Images" Width="280" IsFade="true" OnClick="@OnClick"></Carousel>
<Logger @ref="Trace" class="mt-3" />
</Block>

View File

@@ -2,85 +2,79 @@
<h3>Cascader 级联选择</h3>
<Block Title="Cascader 级联选择" Introduction="提供各种颜色的下拉选择框">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Items="@Items" OnValueChanged="@OnItemChanged"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Primary" Items="@Items" OnValueChanged="@OnItemChanged"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Success" Items="@Items" OnValueChanged="@OnItemChanged"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Danger" Items="@Items" OnValueChanged="@OnItemChanged"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Warning" Items="@Items" OnValueChanged="@OnItemChanged"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Info" Items="@Items" OnValueChanged="@OnItemChanged"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Secondary" Items="@Items" OnValueChanged="@OnItemChanged"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Dark" Items="@Items" OnValueChanged="@OnItemChanged"></Cascader>
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<Cascader TValue="string" Items="@Items" OnSelectedItemChanged="@OnItemChanged"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Primary" Items="@Items" OnSelectedItemChanged="@OnItemChanged"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Success" Items="@Items" OnSelectedItemChanged="@OnItemChanged"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Danger" Items="@Items" OnSelectedItemChanged="@OnItemChanged"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Warning" Items="@Items" OnSelectedItemChanged="@OnItemChanged"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Info" Items="@Items" OnSelectedItemChanged="@OnItemChanged"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Secondary" Items="@Items" OnSelectedItemChanged="@OnItemChanged"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Dark" Items="@Items" OnSelectedItemChanged="@OnItemChanged"></Cascader>
</div>
</div>
<Logger @ref="Trace" class="mt-3" />
</Block>
<Block Title="Cascader 禁用级联选择" Introduction="级联选择不可用状态">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Primary" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Success" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Danger" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Warning" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Info" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Secondary" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Dark" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Primary" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Success" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Danger" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Warning" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Info" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Secondary" Items="@Items" IsDisabled="true"></Cascader>
</div>
<div class="col-12 col-sm-6">
<Cascader TValue="string" Color="Color.Dark" Items="@Items" IsDisabled="true"></Cascader>
</div>
</div>
</Block>
<Block Title="Cascader 双向绑定" Introduction="通过 <code>Select</code> 组件绑定 <code>Value</code> 属性,改变级联选择选项时,文本框内的数值随之改变。">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">
<Cascader Color="Color.Primary" Items="@Items" @bind-Value="@Value"></Cascader>
</div>
<div class="form-group col-12 col-sm-6">
<BootstrapInput readonly @bind-Value="@Value" />
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<Cascader Color="Color.Primary" Items="@Items" @bind-Value="@Value"></Cascader>
</div>
<div class="col-12 col-sm-6">
<BootstrapInput readonly @bind-Value="@Value" />
</div>
</div>
</Block>
<Block Title="Select 客户端验证" Introduction="级联选择未选择时,点击提交按钮时拦截。">
<ValidateForm class="form-inline" Model="@Model">
<div class="row">
<div class="form-group col-12 col-sm-6">
<Block Title="Cascader 客户端验证" Introduction="级联选择未选择时,点击提交按钮时拦截。">
<ValidateForm Model="@Model">
<div class="row g-3">
<div class="col-12 col-sm-6">
<Cascader Items="@Items" @bind-Value="@Model.Address"></Cascader>
</div>
<div class="form-group col-12 col-sm-6 align-items-end">
<div class="col-12 col-sm-6 align-items-end">
<Button ButtonType="ButtonType.Submit">提交</Button>
</div>
</div>
@@ -88,11 +82,11 @@
</Block>
<Block Title="绑定泛型为 Guid 结构" Introduction="组件绑定值为 Guid 结构体示例">
<div class="row">
<div class="form-group col-12 col-sm-3">
<div class="row g-3">
<div class="col-12 col-sm-6">
<Cascader Color="Color.Primary" Items="@GuidItems" @bind-Value="@CurrentGuid" />
</div>
<div class="form-group col-12 col-sm-9">
<div class="col-12 col-sm-6">
<div class="form-control">@CurrentGuid</div>
</div>
</div>
@@ -101,31 +95,15 @@
<Block Title="显示标签" Introduction="组件双向绑定时会根据条件自动判断是否显示标签文字">
<p>前置标签显式规则与 <code>BootstrapInput</code> 组件一致 <a href="inputs">[传送门]</a></p>
<Divider Text="双向绑定显示标签" Alignment="Alignment.Left" style="margin: 2rem 0;"></Divider>
<ValidateForm class="form-inline" Model="@Model">
<div class="row">
<div class="form-group col-12">
<Cascader Color="Color.Primary" Items="@Items" @bind-Value="@Model.Address" />
</div>
</div>
<ValidateForm Model="@Model">
<Cascader Color="Color.Primary" Items="@Items" @bind-Value="@Model.Address" />
</ValidateForm>
<Divider Text="双向绑定不显示标签" Alignment="Alignment.Left" style="margin: 2rem 0;" />
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<Cascader Color="Color.Primary" Items="@Items" @bind-Value="@Model.Address" />
</div>
</div>
</div>
<Cascader Color="Color.Primary" Items="@Items" @bind-Value="@Model.Address" />
<Divider Text="自定义 DisplayText" Alignment="Alignment.Left" style="margin: 2rem 0;"></Divider>
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<Cascader Color="Color.Primary" Items="@Items" @bind-Value="@Model.Address" DisplayText="自定义城市" ShowLabel="true" />
</div>
</div>
</div>
<Cascader Color="Color.Primary" Items="@Items" @bind-Value="@Model.Address" DisplayText="自定义城市" ShowLabel="true" />
</Block>
<AttributeTable Items="@GetAttributes()" />
<EventTable Items="@GetEvents()" />
<EventTable Items="@GetEvents()" />

View File

@@ -84,7 +84,7 @@ namespace BootstrapBlazor.Shared.Pages
{
new EventItem()
{
Name = "OnValueChanged",
Name = nameof(Cascader<string>.OnSelectedItemChanged),
Description="级联选择选项改变时触发此事件",
Type ="Func<CascaderItem[], Task>"
}
@@ -148,4 +148,4 @@ namespace BootstrapBlazor.Shared.Pages
}
};
}
}
}

View File

@@ -1,152 +0,0 @@
@page "/charts"
@using Microsoft.Extensions.DependencyInjection
@implements IDisposable
@inherits ComponentBase
@inject NugetVersionService VersionManager
<h3>Chart 图表</h3>
<h4>通过给定数据,绘画各种图表的组件</h4>
<p>本组件依赖于 <a href="https://www.nuget.org/packages?q=BootstrapBlazor.Chart" target="_blank"><code>BootstrapBlazor.Chart</code></a>,使用本组件时需要引用其组件包</p>
<p><b>Nuget 包安装</b></p>
<p>使用 <a href="https://www.nuget.org/packages?q=BootstrapBlazor.Chart" target="_blank">nuget.org</a> 进行 <code>BootstrapBlazor.Chart</code> 组件的安装</p>
<div class="code-label">.NET CLI</div>
<Pre class="no-highlight">dotnet add package BootstrapBlazor.Chart --version @Version</Pre>
<div class="code-label">PackageReference</div>
<Pre class="no-highlight">&lt;PackageReference Include="BootstrapBlazor.Chart" Version="@Version" /&gt;</Pre>
<div class="code-label">Package Manager</div>
<Pre class="no-highlight">Install-Package BootstrapBlazor.Chart -Version @Version</Pre>
<h4>CSS 文件</h4>
<Pre>&lt;link rel="stylesheet" href="_content/BootstrapBlazor.Chart/css/bootstrap.blazor.chart.bundle.min.css" /&gt;</Pre>
<h4>JS 文件</h4>
<Pre>&lt;script src="_content/BootstrapBlazor.Chart/js/bootstrap.blazor.chart.bundle.min.js"&gt;&lt;/script&gt;</Pre>
<p>组件数据在 <code>OnInit</code> 回调委托中进行设置即可</p>
<Block Title="Line 图" Introduction="使用 <code>OnInit</code> 回调委托方法,对初始化数据进行赋值后,即可进行绘图操作">
<Chart OnInit="@(() => OnInit(LineDatasetCount, LineDataCount))" @ref="LineChart" />
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-primary" @onclick="e => RandomData(LineChart)"><i class="fa fa-line-chart"></i><span>随机数据</span></button>
<button class="btn btn-primary" @onclick="e => AddDataSet(LineChart, ref LineDatasetCount)"><i class="fa fa-plus-circle"></i><span>添加数据集</span></button>
<button class="btn btn-primary" @onclick="e => RemoveDataSet(LineChart, ref LineDatasetCount)"><i class="fa fa-minus-circle"></i><span>移除数据集</span></button>
<button class="btn btn-primary" @onclick="e => AddData(LineChart, ref LineDataCount)"><i class="fa fa-plus"></i><span>添加数据</span></button>
<button class="btn btn-primary" @onclick="e => RemoveData(LineChart, ref LineDataCount)"><i class="fa fa-minus"></i><span>移除数据</span></button>
</div>
</div>
</Block>
<Block Title="Bar 图" Introduction="通过设置 <code>ChartType</code> 更改图表为 <code>bar</code> 图">
<Chart ChartType="ChartType.Bar" OnInit="@(() => OnInit(BarDatasetCount, BarDataCount))" @ref="BarChart" />
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-info" data-method="play" @onclick="@OnPlayChart">
<i class="fa fa-play-circle"></i>
<span>开启动画</span>
</button>
<button class="btn btn-info" data-method="stop" @onclick="@OnStopChart">
<i class="fa fa-stop-circle"></i>
<span>关闭动画</span>
</button>
</div>
</div>
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-primary" @onclick="e => RandomData(BarChart)"><i class="fa fa-bar-chart"></i><span>随机数据</span></button>
<button class="btn btn-primary" @onclick="e => AddDataSet(BarChart, ref BarDatasetCount)"><i class="fa fa-plus-circle"></i><span>添加数据集</span></button>
<button class="btn btn-primary" @onclick="e => RemoveDataSet(BarChart, ref BarDatasetCount)"><i class="fa fa-minus-circle"></i><span>移除数据集</span></button>
<button class="btn btn-primary" @onclick="e => AddData(BarChart, ref BarDataCount)"><i class="fa fa-plus"></i><span>添加数据</span></button>
<button class="btn btn-primary" @onclick="e => RemoveData(BarChart, ref BarDataCount)"><i class="fa fa-minus"></i><span>移除数据</span></button>
</div>
</div>
</Block>
<Block Title="Pie 图" Introduction="通过设置 <code>ChartType</code> 更改图表为 <code>pie</code> 图">
<Chart ChartType="ChartType.Pie" OnInit="@(() => OnPieInit(PieDatasetCount, PieDataCount))" @ref="PieChart" />
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-primary" @onclick="e => RandomData(PieChart)"><i class="fa fa-pie-chart"></i><span>随机数据</span></button>
<button class="btn btn-primary" @onclick="e => AddDataSet(PieChart, ref PieDatasetCount)"><i class="fa fa-plus-circle"></i><span>添加数据集</span></button>
<button class="btn btn-primary" @onclick="e => RemoveDataSet(PieChart, ref PieDatasetCount)"><i class="fa fa-minus-circle"></i><span>移除数据集</span></button>
<button class="btn btn-primary" @onclick="e => AddData(PieChart, ref PieDataCount)"><i class="fa fa-plus"></i><span>添加数据</span></button>
<button class="btn btn-primary" @onclick="e => RemoveData(PieChart, ref PieDataCount)"><i class="fa fa-minus"></i><span>移除数据</span></button>
</div>
</div>
</Block>
<Block Title="Doughnut 图" Introduction="通过设置 <code>ChartType</code> 更改图表为 <code>doughnut</code> 图">
<Chart ChartType="ChartType.Doughnut" OnInit="@(() => OnPieInit(DoughnutDatasetCount, DoughnutDataCount))" @ref="DoughnutChart" />
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-primary" @onclick="e => RandomData(DoughnutChart)"><i class="fa fa-slack"></i><span>随机数据</span></button>
<button class="btn btn-primary" @onclick="e => AddDataSet(DoughnutChart, ref DoughnutDatasetCount)"><i class="fa fa-plus-circle"></i><span>添加数据集</span></button>
<button class="btn btn-primary" @onclick="e => RemoveDataSet(DoughnutChart, ref DoughnutDatasetCount)"><i class="fa fa-minus-circle"></i><span>移除数据集</span></button>
<button class="btn btn-primary" @onclick="e => AddData(DoughnutChart, ref DoughnutDataCount)"><i class="fa fa-plus"></i><span>添加数据</span></button>
<button class="btn btn-primary" @onclick="e => RemoveData(DoughnutChart, ref DoughnutDataCount)"><i class="fa fa-minus"></i><span>移除数据</span></button>
<button class="btn btn-primary" @onclick="@ToggleCircle"><i class="fa fa-circle-o-notch"></i><span>半圆/全圆</span></button>
</div>
</div>
</Block>
<Block Title="Bubble 图" Introduction="通过设置 <code>ChartType</code> 更改图表为 <code>bubble</code> 图">
<Chart ChartType="ChartType.Bubble" OnInit="@(() => OnBubbleInit(BubbleDatasetCount, BubbleDataCount))" @ref="BubbleChart" />
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-primary" @onclick="e => RandomData(BubbleChart)"><i class="fa fa-snowflake-o"></i><span>随机数据</span></button>
<button class="btn btn-primary" @onclick="e => AddDataSet(BubbleChart, ref BubbleDatasetCount)"><i class="fa fa-plus-circle"></i><span>添加数据集</span></button>
<button class="btn btn-primary" @onclick="e => RemoveDataSet(BubbleChart, ref BubbleDatasetCount)"><i class="fa fa-minus-circle"></i><span>移除数据集</span></button>
<button class="btn btn-primary" @onclick="e => AddData(BubbleChart, ref BubbleDataCount)"><i class="fa fa-plus"></i><span>添加数据</span></button>
<button class="btn btn-primary" @onclick="e => RemoveData(BubbleChart, ref BubbleDataCount)"><i class="fa fa-minus"></i><span>移除数据</span></button>
</div>
</div>
</Block>
<AttributeTable Items="@GetAttributes()" />
<EventTable Items="@GetEvents()" />
@code {
private int LineDatasetCount = 2;
private int BarDatasetCount = 2;
private int PieDatasetCount = 1;
private int DoughnutDatasetCount = 1;
private int BubbleDatasetCount = 2;
private int LineDataCount = 7;
private int BarDataCount = 7;
private int PieDataCount = 5;
private int DoughnutDataCount = 5;
private int BubbleDataCount = 7;
/// <summary>
/// 获得/设置 版本号字符串
/// </summary>
private string Version { get; set; } = "fetching";
/// <summary>
/// OnInitializedAsync 方法
/// </summary>
/// <returns></returns>
protected override async Task OnInitializedAsync()
{
Version = await VersionManager.GetVersionAsync("bootstrapblazor.chart");
}
}

View File

@@ -1,288 +0,0 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using BootstrapBlazor.Shared.Common;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages
{
/// <summary>
///
/// </summary>
public sealed partial class Charts
{
/// <summary>
///
/// </summary>
[Inject]
private ToastService? ToastService { get; set; }
[Inject]
private IJSRuntime? JSRuntime { get; set; }
private static Random Randomer { get; set; } = new Random();
private JSInterop<Charts>? Interope { get; set; }
private Chart? LineChart { get; set; }
private Chart? BarChart { get; set; }
private Chart? PieChart { get; set; }
private Chart? DoughnutChart { get; set; }
private Chart? BubbleChart { get; set; }
private bool IsCricle { get; set; }
private IEnumerable<string> Colors { get; set; } = new List<string>() { "Red", "Blue", "Green", "Orange", "Yellow", "Tomato", "Pink", "Violet" };
/// <summary>
///
/// </summary>
/// <param name="firstRender"></param>
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnAfterRenderAsync(firstRender);
if (firstRender && JSRuntime != null)
{
if (Interope == null) Interope = new JSInterop<Charts>(JSRuntime);
await Interope.InvokeVoidAsync(this, "", "_initChart", nameof(ShowToast));
}
}
private Task<ChartDataSource> OnInit(int dsCount, int daCount)
{
var ds = new ChartDataSource();
ds.Options.XAxes.Add(new ChartAxes() { LabelString = "天数" });
ds.Options.YAxes.Add(new ChartAxes() { LabelString = "数值" });
ds.Labels = Enumerable.Range(1, daCount).Select(i => i.ToString());
for (var index = 0; index < dsCount; index++)
{
ds.Data.Add(new ChartDataset()
{
Label = $"数据集 {index}",
Data = Enumerable.Range(1, daCount).Select(i => Randomer.Next(20, 37)).Cast<object>()
});
}
return Task.FromResult(ds);
}
private CancellationTokenSource _chartCancellationTokenSource = new CancellationTokenSource();
private Task OnPlayChart()
{
_chartCancellationTokenSource = new CancellationTokenSource();
return Task.Run(async () =>
{
while (!_chartCancellationTokenSource.IsCancellationRequested)
{
await Task.Delay(800, _chartCancellationTokenSource.Token);
if (!_chartCancellationTokenSource.IsCancellationRequested) RandomData(BarChart);
}
});
}
private void OnStopChart()
{
_chartCancellationTokenSource.Cancel();
}
private Task<ChartDataSource> OnPieInit(int dsCount, int daCount)
{
var ds = new ChartDataSource();
ds.Options.XAxes.Add(new ChartAxes() { LabelString = "天数" });
ds.Options.ShowXAxesLine = false;
ds.Options.YAxes.Add(new ChartAxes() { LabelString = "数值" });
ds.Options.ShowYAxesLine = false;
ds.Labels = Colors.Take(daCount);
for (var index = 0; index < dsCount; index++)
{
ds.Data.Add(new ChartDataset()
{
Label = $"数据集 {index}",
Data = Enumerable.Range(1, daCount).Select(i => Randomer.Next(20, 37)).Cast<object>()
});
}
return Task.FromResult(ds);
}
private Task<ChartDataSource> OnBubbleInit(int dsCount, int daCount)
{
var ds = new ChartDataSource
{
Labels = Enumerable.Range(1, daCount).Select(i => i.ToString())
};
for (var index = 0; index < dsCount; index++)
{
ds.Data.Add(new ChartDataset()
{
Label = $"数据集 {index}",
Data = Enumerable.Range(1, daCount).Select(i => new
{
x = Randomer.Next(10, 40),
y = Randomer.Next(10, 40),
r = Randomer.Next(1, 20)
})
});
}
return Task.FromResult(ds);
}
private void RandomData(Chart? chart)
{
chart?.Update();
}
private void AddDataSet(Chart? chart, ref int dsCount)
{
if (dsCount < Colors.Count())
{
dsCount++;
chart?.Update("addDataset");
}
}
private void RemoveDataSet(Chart? chart, ref int dsCount)
{
if (dsCount > 1)
{
dsCount--;
chart?.Update("removeDataset");
}
}
private void AddData(Chart? chart, ref int daCount)
{
var limit = (chart?.ChartType ?? ChartType.Line) switch
{
ChartType.Line => 14,
ChartType.Bar => 14,
ChartType.Bubble => 14,
_ => Colors.Count()
};
if (daCount < limit)
{
daCount++;
chart?.Update("addData");
}
}
private void RemoveData(Chart? chart, ref int daCount)
{
var limit = (chart?.ChartType ?? ChartType.Line) switch
{
ChartType.Line => 7,
ChartType.Bar => 7,
ChartType.Bubble => 4,
_ => 2
};
if (daCount > limit)
{
daCount--;
chart?.Update("removeData");
}
}
private void ToggleCircle()
{
IsCricle = !IsCricle;
DoughnutChart?.SetAngle(IsCricle ? 360 : 0);
DoughnutChart?.Update("setAngle");
}
/// <summary>
///
/// </summary>
[JSInvokable]
public void ShowToast()
{
ToastService?.Show(new ToastOption() { Title = "友情提示", Content = "屏幕宽度过小,如果是手机请横屏观看" });
}
/// <summary>
///
/// </summary>
/// <param name="disposing"></param>
private void Dispose(bool disposing)
{
if (disposing) Interope?.Dispose();
}
/// <summary>
///
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// 获得事件方法
/// </summary>
/// <returns></returns>
private IEnumerable<EventItem> GetEvents() => new EventItem[]
{
new EventItem()
{
Name = "OnInit",
Description="组件数据初始化委托方法",
Type ="Func<Task<ChartDataSource>>"
},
new EventItem()
{
Name = "OnAfterInit",
Description="客户端绘制图表完毕后回调此委托方法",
Type ="Action"
},
};
/// <summary>
/// 获得属性方法
/// </summary>
/// <returns></returns>
private IEnumerable<AttributeItem> GetAttributes() => new AttributeItem[]
{
// TODO: 移动到数据库中
new AttributeItem() {
Name = "Angle",
Description = "Bubble 模式下显示角度 180 为 半圆 360 为正圆",
Type = "int",
ValueList = " — ",
DefaultValue = " — ",
},
new AttributeItem() {
Name = "Width",
Description = "组件宽度支持单位 如: 100px 75%",
Type = "string",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "ChartType",
Description = "设置图表类型",
Type = "ChartType",
ValueList = "Line|Bar|Pie|Doughnut|Bubble",
DefaultValue = "Line"
},
};
}
}

View File

@@ -0,0 +1,33 @@
@page "/charts/bar"
<Block Title="Bar 图" Introduction="通过设置 <code>ChartType</code> 更改图表为 <code>bar</code> 图">
<Chart ChartType="ChartType.Bar" OnInitAsync="() => OnInit(false)" OnAfterInitAsync="@OnAfterInit" OnAfterUpdateAsync="@OnAfterUpdate" @ref="BarChart" />
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-info" data-method="play" @onclick="@OnPlayChart">
<i class="fa fa-play-circle"></i>
<span>开启动画</span>
</button>
<button class="btn btn-info" data-method="stop" @onclick="@OnStopChart">
<i class="fa fa-stop-circle"></i>
<span>关闭动画</span>
</button>
</div>
</div>
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-primary" @onclick="e => Utility.RandomData(BarChart)"><i class="fa fa-bar-chart"></i><span>随机数据</span></button>
<button class="btn btn-primary" @onclick="e => Utility.AddDataSet(BarChart, ref BarDatasetCount)"><i class="fa fa-plus-circle"></i><span>添加数据集</span></button>
<button class="btn btn-primary" @onclick="e => Utility.RemoveDataSet(BarChart, ref BarDatasetCount)"><i class="fa fa-minus-circle"></i><span>移除数据集</span></button>
<button class="btn btn-primary" @onclick="e => Utility.AddData(BarChart, ref BarDataCount)"><i class="fa fa-plus"></i><span>添加数据</span></button>
<button class="btn btn-primary" @onclick="e => Utility.RemoveData(BarChart, ref BarDataCount)"><i class="fa fa-minus"></i><span>移除数据</span></button>
</div>
</div>
<Logger @ref="Logger" class="mt-3" />
</Block>
<Block Title="Bar 图" Introduction="通过设置 X/Y 轴 <code>Stacked</code> 属性,控制是否堆砌排列">
<Chart ChartType="ChartType.Bar" OnInitAsync="() => OnInit(true)" />
</Block>
<ChartToast />

View File

@@ -0,0 +1,90 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using BootstrapBlazor.Shared.Pages.Components;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages.Charts
{
/// <summary>
///
/// </summary>
public partial class Bar
{
private Random Randomer { get; } = new Random();
private int BarDatasetCount = 2;
private int BarDataCount = 7;
[NotNull]
private Chart? BarChart { get; set; }
[NotNull]
private Logger? Logger { get; set; }
/// <summary>
///
/// </summary>
/// <param name="firstRender"></param>
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
if (firstRender)
{
Logger.Log("Bar 正在加载数据 ...");
}
}
private Task OnAfterInit()
{
Logger.Log("Bar 初始化完毕");
return Task.CompletedTask;
}
private Task OnAfterUpdate(ChartAction action) => InvokeAsync(() => Logger.Log($"Bar 图更新数据操作完毕 -- {action}"));
private Task<ChartDataSource> OnInit(bool stacked)
{
var ds = new ChartDataSource();
ds.Options.Title = "Bar 折线图";
ds.Options.X.Title = "天数";
ds.Options.Y.Title = "数值";
ds.Options.X.Stacked = stacked;
ds.Options.Y.Stacked = stacked;
ds.Labels = Enumerable.Range(1, BarDataCount).Select(i => i.ToString());
for (var index = 0; index < BarDatasetCount; index++)
{
ds.Data.Add(new ChartDataset()
{
Label = $"数据集 {index}",
Data = Enumerable.Range(1, BarDataCount).Select(i => Randomer.Next(20, 37)).Cast<object>()
});
}
return Task.FromResult(ds);
}
private CancellationTokenSource _chartCancellationTokenSource = new();
private Task OnPlayChart()
{
_chartCancellationTokenSource = new CancellationTokenSource();
return Task.Run(async () =>
{
while (!_chartCancellationTokenSource.IsCancellationRequested)
{
await Task.Delay(800, _chartCancellationTokenSource.Token);
if (!_chartCancellationTokenSource.IsCancellationRequested) await Utility.RandomData(BarChart);
}
});
}
private void OnStopChart() => _chartCancellationTokenSource.Cancel();
}
}

View File

@@ -0,0 +1,17 @@
@page "/charts/bubble"
<Block Title="Bubble 图" Introduction="通过设置 <code>ChartType</code> 更改图表为 <code>bubble</code> 图">
<Chart ChartType="ChartType.Bubble" OnInitAsync="@OnInit" OnAfterInitAsync="@OnAfterInit" OnAfterUpdateAsync="@OnAfterUpdate" @ref="BubbleChart" />
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-primary" @onclick="e => Utility.RandomData(BubbleChart)"><i class="fa fa-snowflake-o"></i><span>随机数据</span></button>
<button class="btn btn-primary" @onclick="e => Utility.AddDataSet(BubbleChart, ref BubbleDatasetCount)"><i class="fa fa-plus-circle"></i><span>添加数据集</span></button>
<button class="btn btn-primary" @onclick="e => Utility.RemoveDataSet(BubbleChart, ref BubbleDatasetCount)"><i class="fa fa-minus-circle"></i><span>移除数据集</span></button>
<button class="btn btn-primary" @onclick="e => Utility.AddData(BubbleChart, ref BubbleDataCount)"><i class="fa fa-plus"></i><span>添加数据</span></button>
<button class="btn btn-primary" @onclick="e => Utility.RemoveData(BubbleChart, ref BubbleDataCount)"><i class="fa fa-minus"></i><span>移除数据</span></button>
</div>
</div>
<Logger @ref="Logger" class="mt-3" />
</Block>
<ChartToast />

View File

@@ -0,0 +1,79 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using BootstrapBlazor.Shared.Pages.Components;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages.Charts
{
/// <summary>
///
/// </summary>
public partial class Bubble
{
private Random Randomer { get; } = new Random();
private int BubbleDatasetCount = 2;
private int BubbleDataCount = 7;
[NotNull]
private Chart? BubbleChart { get; set; }
[NotNull]
private Logger? Logger { get; set; }
/// <summary>
///
/// </summary>
/// <param name="firstRender"></param>
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
if (firstRender)
{
Logger.Log("Bubble 正在加载数据 ...");
}
}
private Task OnAfterInit()
{
Logger.Log("Bubble 初始化完毕");
return Task.CompletedTask;
}
private Task OnAfterUpdate(ChartAction action)
{
Logger.Log($"Bubble 图更新数据操作完毕 -- {action}");
return Task.CompletedTask;
}
private Task<ChartDataSource> OnInit()
{
var ds = new ChartDataSource
{
Labels = Enumerable.Range(1, BubbleDataCount).Select(i => i.ToString())
};
ds.Options.Title = "Bubble 折线图";
for (var index = 0; index < BubbleDatasetCount; index++)
{
ds.Data.Add(new ChartDataset()
{
Label = $"数据集 {index}",
Data = Enumerable.Range(1, BubbleDataCount).Select(i => new
{
x = Randomer.Next(10, 40),
y = Randomer.Next(10, 40),
r = Randomer.Next(1, 20)
})
});
}
return Task.FromResult(ds);
}
}
}

View File

@@ -0,0 +1,18 @@
@page "/charts/doughnut"
<Block Title="Doughnut 图" Introduction="通过设置 <code>ChartType</code> 更改图表为 <code>doughnut</code> 图">
<Chart ChartType="ChartType.Doughnut" Angle="@Angle" OnInitAsync="@OnInit" OnAfterInitAsync="@OnAfterInit" OnAfterUpdateAsync="@OnAfterUpdate" @ref="DoughnutChart" class="pie" />
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-primary" @onclick="e => Utility.RandomData(DoughnutChart)"><i class="fa fa-slack"></i><span>随机数据</span></button>
<button class="btn btn-primary" @onclick="e => Utility.AddDataSet(DoughnutChart, ref DoughnutDatasetCount)"><i class="fa fa-plus-circle"></i><span>添加数据集</span></button>
<button class="btn btn-primary" @onclick="e => Utility.RemoveDataSet(DoughnutChart, ref DoughnutDatasetCount)"><i class="fa fa-minus-circle"></i><span>移除数据集</span></button>
<button class="btn btn-primary" @onclick="e => Utility.AddData(DoughnutChart, ref DoughnutDataCount)"><i class="fa fa-plus"></i><span>添加数据</span></button>
<button class="btn btn-primary" @onclick="e => Utility.RemoveData(DoughnutChart, ref DoughnutDataCount)"><i class="fa fa-minus"></i><span>移除数据</span></button>
<button class="btn btn-primary" @onclick="@ToggleCircle"><i class="fa fa-circle-o-notch"></i><span>半圆/全圆</span></button>
</div>
</div>
<Logger @ref="Logger" class="mt-3" />
</Block>
<ChartToast />

View File

@@ -0,0 +1,80 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using BootstrapBlazor.Shared.Pages.Components;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages.Charts
{
/// <summary>
///
/// </summary>
public partial class Doughnut
{
private Random Randomer { get; } = new Random();
private int DoughnutDatasetCount = 1;
private int DoughnutDataCount = 5;
[NotNull]
private Chart? DoughnutChart { get; set; }
[NotNull]
private Logger? Logger { get; set; }
/// <summary>
///
/// </summary>
/// <param name="firstRender"></param>
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
if (firstRender)
{
Logger.Log("Doughnut 正在加载数据 ...");
}
}
private Task OnAfterInit()
{
Logger.Log("Doughnut 初始化完毕");
return Task.CompletedTask;
}
private Task OnAfterUpdate(ChartAction action)
{
Logger.Log($"Doughnut 图更新数据操作完毕 -- {action}");
return Task.CompletedTask;
}
private Task<ChartDataSource> OnInit()
{
var ds = new ChartDataSource();
ds.Options.Title = "Doughnut 折线图";
ds.Labels = Utility.Colors.Take(DoughnutDataCount);
for (var index = 0; index < DoughnutDatasetCount; index++)
{
ds.Data.Add(new ChartDataset()
{
Label = $"数据集 {index}",
Data = Enumerable.Range(1, DoughnutDataCount).Select(i => Randomer.Next(20, 37)).Cast<object>()
});
}
return Task.FromResult(ds);
}
private bool IsCircle { get; set; }
private int Angle { get; set; }
private async Task ToggleCircle()
{
IsCircle = !IsCircle;
Angle = IsCircle ? 360 : 0;
await DoughnutChart.Update(ChartAction.SetAngle);
}
}
}

View File

@@ -0,0 +1,39 @@
@page "/charts/index"
@layout MainLayout
<h3>Chart 图表</h3>
<h4>通过给定数据,绘画各种图表的组件</h4>
<p>本组件依赖于 <a href="https://www.nuget.org/packages?q=BootstrapBlazor.Chart" target="_blank"><code>BootstrapBlazor.Chart</code></a>,使用本组件时需要引用其组件包</p>
<Tips>
<div>本套组件 5.0.19 版本后 <code>chart.js</code> 脚本升级到 <code>3.3.0</code> 为了适配新版本脚本,有部分功能更新或者移除</div>
</Tips>
<p><b>Nuget 包安装</b></p>
<p>使用 <a href="https://www.nuget.org/packages?q=BootstrapBlazor.Chart" target="_blank">nuget.org</a> 进行 <code>BootstrapBlazor.Chart</code> 组件的安装</p>
<div class="code-label">.NET CLI</div>
<Pre class="no-highlight">dotnet add package BootstrapBlazor.Chart --version @Version</Pre>
<div class="code-label">PackageReference</div>
<Pre class="no-highlight">&lt;PackageReference Include="BootstrapBlazor.Chart" Version="@Version" /&gt;</Pre>
<div class="code-label">Package Manager</div>
<Pre class="no-highlight">Install-Package BootstrapBlazor.Chart -Version @Version</Pre>
<h4>CSS 文件</h4>
<Pre>&lt;link rel="stylesheet" href="_content/BootstrapBlazor.Chart/css/bootstrap.blazor.chart.bundle.min.css" /&gt;</Pre>
<h4>JS 文件</h4>
<Pre>&lt;script src="_content/BootstrapBlazor.Chart/js/bootstrap.blazor.chart.bundle.min.js"&gt;&lt;/script&gt;</Pre>
<p>组件数据在 <code>OnInit</code> 回调委托中进行设置即可</p>
<AttributeTable Items="@GetAttributes()" />
<EventTable Items="@GetEvents()" />

View File

@@ -0,0 +1,86 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using BootstrapBlazor.Shared.Common;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages.Charts
{
/// <summary>
///
/// </summary>
public sealed partial class Index
{
[Inject]
[NotNull]
private NugetVersionService? VersionManager { get; set; }
private string Version { get; set; } = "fetching";
/// <summary>
/// OnInitializedAsync 方法
/// </summary>
/// <returns></returns>
protected override async Task OnInitializedAsync()
{
Version = await VersionManager.GetVersionAsync("bootstrapblazor.chart");
}
/// <summary>
/// 获得事件方法
/// </summary>
/// <returns></returns>
private static IEnumerable<EventItem> GetEvents() => new EventItem[]
{
new EventItem()
{
Name = "OnInitAsync",
Description="组件数据初始化委托方法",
Type ="Func<Task<ChartDataSource>>"
},
new EventItem()
{
Name = "OnAfterInitAsync",
Description="客户端绘制图表完毕后回调此委托方法",
Type ="Func<Task>"
},
new EventItem()
{
Name = "OnAfterUpdateAsync",
Description="客户端更新图表完毕后回调此委托方法",
Type ="Func<ChartAction, Task>"
}
};
/// <summary>
/// 获得属性方法
/// </summary>
/// <returns></returns>
private static IEnumerable<AttributeItem> GetAttributes() => new AttributeItem[]
{
// TODO: 移动到数据库中
new AttributeItem() {
Name = "Width",
Description = "组件宽度支持单位 如: 100px 75%",
Type = "string",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "ChartType",
Description = "设置图表类型",
Type = "ChartType",
ValueList = "Line|Bar|Pie|Doughnut|Bubble",
DefaultValue = "Line"
}
};
}
}

View File

@@ -0,0 +1,25 @@
@page "/charts/line"
<Block Title="Line 图" Introduction="使用 <code>OnInit</code> 回调委托方法,对初始化数据进行赋值后,即可进行绘图操作">
<Chart @ref="LineChart" OnInitAsync="() => OnInit(0.4f, false)" OnAfterInitAsync="@OnAfterInit" OnAfterUpdateAsync="@OnAfterUpdate" />
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-primary" @onclick="e => Utility.RandomData(LineChart)"><i class="fa fa-line-chart"></i><span>随机数据</span></button>
<button class="btn btn-primary" @onclick="e => Utility.AddDataSet(LineChart, ref LineDatasetCount)"><i class="fa fa-plus-circle"></i><span>添加数据集</span></button>
<button class="btn btn-primary" @onclick="e => Utility.RemoveDataSet(LineChart, ref LineDatasetCount)"><i class="fa fa-minus-circle"></i><span>移除数据集</span></button>
<button class="btn btn-primary" @onclick="e => Utility.AddData(LineChart, ref LineDataCount)"><i class="fa fa-plus"></i><span>添加数据</span></button>
<button class="btn btn-primary" @onclick="e => Utility.RemoveData(LineChart, ref LineDataCount)"><i class="fa fa-minus"></i><span>移除数据</span></button>
</div>
</div>
<Logger @ref="Logger" class="mt-3" />
</Block>
<Block Title="Line 图" Introduction="使用设置 <code>ChartDataset</code> 实例的 <code>Tension</code> 参数,调整折线的曲率,默认位 <b>0.4f</b>">
<Chart OnInitAsync="() => OnInit(0f, false)" />
</Block>
<Block Title="Line 图" Introduction="使用设置 <code>ChartDataset</code> 实例的 <code>Data</code> 参数中含 <code>null</code>,折线图使用虚线连接">
<Chart OnInitAsync="() => OnInit(0f, true)" />
</Block>
<ChartToast />

View File

@@ -0,0 +1,74 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using BootstrapBlazor.Shared.Pages.Components;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages.Charts
{
/// <summary>
///
/// </summary>
public partial class Line
{
private Random Randomer { get; } = new Random();
private int LineDatasetCount = 2;
private int LineDataCount = 7;
[NotNull]
private Chart? LineChart { get; set; }
[NotNull]
private Logger? Logger { get; set; }
/// <summary>
///
/// </summary>
/// <param name="firstRender"></param>
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
if (firstRender)
{
Logger.Log("Line 正在加载数据 ...");
}
}
private Task OnAfterInit()
{
Logger.Log("Line 初始化完毕");
return Task.CompletedTask;
}
private Task OnAfterUpdate(ChartAction action)
{
Logger.Log($"Line 图更新数据操作完毕 -- {action}");
return Task.CompletedTask;
}
private Task<ChartDataSource> OnInit(float tension, bool hasNull)
{
var ds = new ChartDataSource();
ds.Options.Title = "Line 折线图";
ds.Options.X.Title = "天数";
ds.Options.Y.Title = "数值";
ds.Labels = Enumerable.Range(1, LineDataCount).Select(i => i.ToString());
for (var index = 0; index < LineDatasetCount; index++)
{
ds.Data.Add(new ChartDataset()
{
Tension = tension,
Label = $"数据集 {index}",
Data = Enumerable.Range(1, LineDataCount).Select((i, index) => (index == 2 && hasNull) ? null! : (object)Randomer.Next(20, 37))
});
}
return Task.FromResult(ds);
}
}
}

View File

@@ -0,0 +1,17 @@
@page "/charts/pie"
<Block Title="Pie 图" Introduction="通过设置 <code>ChartType</code> 更改图表为 <code>pie</code> 图">
<Chart ChartType="ChartType.Pie" OnInitAsync="@OnInit" OnAfterInitAsync="@OnAfterInit" OnAfterUpdateAsync="@OnAfterUpdate" @ref="PieChart" />
<div class="text-center mt-2 chart">
<div class="btn-group">
<button class="btn btn-primary" @onclick="e => Utility.RandomData(PieChart)"><i class="fa fa-pie-chart"></i><span>随机数据</span></button>
<button class="btn btn-primary" @onclick="e => Utility.AddDataSet(PieChart, ref PieDatasetCount)"><i class="fa fa-plus-circle"></i><span>添加数据集</span></button>
<button class="btn btn-primary" @onclick="e => Utility.RemoveDataSet(PieChart, ref PieDatasetCount)"><i class="fa fa-minus-circle"></i><span>移除数据集</span></button>
<button class="btn btn-primary" @onclick="e => Utility.AddData(PieChart, ref PieDataCount)"><i class="fa fa-plus"></i><span>添加数据</span></button>
<button class="btn btn-primary" @onclick="e => Utility.RemoveData(PieChart, ref PieDataCount)"><i class="fa fa-minus"></i><span>移除数据</span></button>
</div>
</div>
<Logger @ref="Logger" class="mt-3" />
</Block>
<ChartToast />

View File

@@ -0,0 +1,73 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using BootstrapBlazor.Shared.Pages.Components;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages.Charts
{
/// <summary>
///
/// </summary>
public partial class Pie
{
private Random Randomer { get; } = new Random();
private int PieDatasetCount = 1;
private int PieDataCount = 5;
[NotNull]
private Chart? PieChart { get; set; }
[NotNull]
private Logger? Logger { get; set; }
/// <summary>
///
/// </summary>
/// <param name="firstRender"></param>
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
if (firstRender)
{
Logger.Log("Pie 正在加载数据 ...");
}
}
private Task OnAfterInit()
{
Logger.Log("Pie 初始化完毕");
return Task.CompletedTask;
}
private Task OnAfterUpdate(ChartAction action)
{
Logger.Log($"Pie 图更新数据操作完毕 -- {action}");
return Task.CompletedTask;
}
private Task<ChartDataSource> OnInit()
{
var ds = new ChartDataSource();
ds.Options.Title = "Pie 折线图";
ds.Labels = Utility.Colors.Take(PieDataCount);
for (var index = 0; index < PieDatasetCount; index++)
{
ds.Data.Add(new ChartDataset()
{
Label = $"数据集 {index}",
Data = Enumerable.Range(1, PieDataCount).Select(i => Randomer.Next(20, 37)).Cast<object>()
});
}
return Task.FromResult(ds);
}
}
}

View File

@@ -0,0 +1,96 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Components;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages.Charts
{
/// <summary>
/// Chart 工具类
/// </summary>
internal static class Utility
{
public static IEnumerable<string> Colors { get; } = new List<string>() { "Red", "Blue", "Green", "Orange", "Yellow", "Tomato", "Pink", "Violet" };
/// <summary>
///
/// </summary>
/// <param name="chart"></param>
public static Task RandomData(Chart chart) => chart.Update(ChartAction.Update);
/// <summary>
///
/// </summary>
/// <param name="chart"></param>
/// <param name="dsCount"></param>
public static void AddDataSet(Chart chart, ref int dsCount)
{
if (dsCount < Colors.Count())
{
dsCount++;
_ = chart.Update(ChartAction.AddDataset);
}
}
/// <summary>
///
/// </summary>
/// <param name="chart"></param>
/// <param name="dsCount"></param>
public static void RemoveDataSet(Chart chart, ref int dsCount)
{
if (dsCount > 1)
{
dsCount--;
_ = chart.Update(ChartAction.RemoveDataset);
}
}
/// <summary>
///
/// </summary>
/// <param name="chart"></param>
/// <param name="daCount"></param>
public static void AddData(Chart chart, ref int daCount)
{
var limit = chart.ChartType switch
{
ChartType.Line => 14,
ChartType.Bar => 14,
ChartType.Bubble => 14,
_ => Colors.Count()
};
if (daCount < limit)
{
daCount++;
_ = chart.Update(ChartAction.AddData);
}
}
/// <summary>
///
/// </summary>
/// <param name="chart"></param>
/// <param name="daCount"></param>
public static void RemoveData(Chart chart, ref int daCount)
{
var limit = chart.ChartType switch
{
ChartType.Line => 7,
ChartType.Bar => 7,
ChartType.Bubble => 4,
_ => 2
};
if (daCount > limit)
{
daCount--;
_ = chart.Update(ChartAction.RemoveData);
}
}
}
}

View File

@@ -11,15 +11,9 @@
<li>通过 <code>Items</code> 设置候选数据源</li>
<li>通过 <code>OnSelectedChanged</code> 回调方法获取改变项实例</li>
</ul>
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<CheckboxList @bind-Value="@Value1" Items="@Items1" ShowLabel="true" DisplayText="@Localizer[nameof(Foo.Name)]"
OnSelectedChanged="@OnSelectedChanged"></CheckboxList>
</div>
</div>
</div>
<Logger @ref="Trace" />
<CheckboxList @bind-Value="@Value1" Items="@Items1" ShowLabel="true" DisplayText="@Localizer[nameof(Foo.Name)]"
OnSelectedChanged="@OnSelectedChanged"></CheckboxList>
<Logger class="mt-3" @ref="Trace" />
</Block>
<Block Title="客户端验证" Introduction="内置于 ValidateForm 中使用">
@@ -27,15 +21,13 @@
<p>本例中绑定模型 <code>BindItem</code> 的 <code>Name</code> 字段,通过勾选项自动更改模型数据</p>
<p>由于内置于 <code>ValidateForm</code> 表单内,本例中增加了 <code>RequiredAttribute</code> 必选要求验证,当取消所有选项后提示验证结果</p>
<ValidateForm Model="@Dummy">
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<CheckboxList @bind-Value="@Dummy.Name" Items="@Items2" />
</div>
<div class="form-group col-12">
<label class="control-label">@Localizer["Foo.BindValue"]</label>
<div class="form-control flex-fill">@Dummy.Name</div>
</div>
<div class="row g-3">
<div class="col-12">
<CheckboxList @bind-Value="@Dummy.Name" Items="@Items2" />
</div>
<div class="col-12">
<label class="form-label">@Localizer["Foo.BindValue"]</label>
<div class="form-control flex-fill">@Dummy.Name</div>
</div>
</div>
</ValidateForm>
@@ -43,42 +35,36 @@
<Block Title="双向绑定集合" Introduction="绑定值为集合">
<p>TValue 设置为 <code>IEnumerable&lt;int&gt;</code> 泛型集合,绑定集合的 <code>ValueField</code> 指定字段必须与泛型类型一致</p>
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<CheckboxList TValue="IEnumerable<int>" Items="@Items3" @bind-Value="@Value2" ShowLabel="true" DisplayText="@Localizer[nameof(Foo.Name)]" />
</div>
<div class="form-group col-12">
<label class="control-label">@Localizer["Foo.BindValue"]</label>
<div class="form-control">@(string.Join(",", Value2))</div>
</div>
<div class="row g-3">
<div class="col-12">
<CheckboxList TValue="IEnumerable<int>" Items="@Items3" @bind-Value="@Value2" ShowLabel="true" DisplayText="@Localizer[nameof(Foo.Name)]" />
</div>
<div class="col-12">
<label class="form-label">@Localizer["Foo.BindValue"]</label>
<div class="form-control">@(string.Join(",", Value2))</div>
</div>
</div>
<p class="mt-3">TValue 设置为 <code>IEnumerable&lt;string&gt;</code> 泛型集合</p>
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<CheckboxList TValue="IEnumerable<string>" Items="@Items4" @bind-Value="@Value3" ShowLabel="true" DisplayText="@Localizer[nameof(Foo.Name)]" />
</div>
<div class="form-group col-12">
<label class="control-label">@Localizer["Foo.BindValue"]</label>
<div class="form-control flex-fill">@(string.Join(",", Value3))</div>
</div>
<div class="row g-3">
<div class="col-12">
<CheckboxList TValue="IEnumerable<string>" Items="@Items4" @bind-Value="@Value3" ShowLabel="true" DisplayText="@Localizer[nameof(Foo.Name)]" />
</div>
<div class="col-12">
<label class="form-label">@Localizer["Foo.BindValue"]</label>
<div class="form-control flex-fill">@(string.Join(",", Value3))</div>
</div>
</div>
</Block>
<Block Title="双向绑定枚举" Introduction="绑定值为枚举">
<p>当 <code>CheckboxList</code> 绑定一个枚举集合时,<code>Items</code> 不需要指定,<code>Items</code> 会被自动设置成枚举里面所有的值,如果需要绑定部分值时,请自行提供枚举集合 <code>Items</code></p>
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<CheckboxList @bind-Value="@SelectedEnumValues" ShowLabel="true" DisplayText="@Localizer[nameof(Foo.Name)]" />
</div>
<div class="form-group col-12">
<label class="control-label">@Localizer["Foo.BindValue"]</label>
<div class="form-control">@(string.Join(",", SelectedEnumValues))</div>
</div>
<div class="row g-3">
<div class="col-12">
<CheckboxList @bind-Value="@SelectedEnumValues" ShowLabel="true" DisplayText="@Localizer[nameof(Foo.Name)]" />
</div>
<div class="col-12">
<label class="form-label">@Localizer["Foo.BindValue"]</label>
<div class="form-control">@(string.Join(",", SelectedEnumValues))</div>
</div>
</div>
</Block>
@@ -86,34 +72,16 @@
<Block Title="无边框" Introduction="通过设置 <code>ShowBorder=false</code> 不显示边框">
<p>当验证失败时显示红色边框</p>
<ValidateForm Model="@Dummy">
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<CheckboxList @bind-Value="@Dummy.Name" ShowBorder="false" Items="@Items2" />
</div>
</div>
</div>
<CheckboxList @bind-Value="@Dummy.Name" ShowBorder="false" Items="@Items2" />
</ValidateForm>
</Block>
<Block Title="竖向排列" Introduction="通过设置 <code>IsVertical=true</code> 使checkbox竖向排列">
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<CheckboxList @bind-Value="@Dummy.Name" IsVertical="true" ShowBorder="false" Items="@Items2" />
</div>
</div>
</div>
<CheckboxList @bind-Value="@Dummy.Name" IsVertical="true" ShowBorder="false" Items="@Items2" />
</Block>
<Block Title="禁用" Introduction="通过设置 <code>IsDisabled=true</code> 禁用">
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<CheckboxList @bind-Value="@Dummy.Name" IsDisabled="true" ShowBorder="false" Items="@Items2" />
</div>
</div>
</div>
<CheckboxList @bind-Value="@Dummy.Name" IsDisabled="true" ShowBorder="false" Items="@Items2" />
</Block>
<AttributeTable Items="@GetAttributes()" />

View File

@@ -135,7 +135,7 @@ namespace BootstrapBlazor.Shared.Pages
{
Name = "OnSelectedChanged",
Description="复选框状态改变时回调此方法",
Type ="EventCallback<IEnumerable<SelectedItem>, TValue, Task>"
Type ="Func<IEnumerable<SelectedItem>, TValue, Task>"
}
};
}

View File

@@ -5,91 +5,75 @@
<h4>一组备选项中进行多选</h4>
<Block Title="基础用法" Introduction="单独使用可以表示两种状态之间的切换,列头或者表头使用时可以表示三种状态之间的切换。组件支持泛型数据绑定,通过 <code>TValue</code> 设置绑定数据类型,通过 <code>State</code> 设置组件状态">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">
<Checkbox TValue="string" State="CheckboxState.Checked" OnStateChanged="@OnStateChanged" DisplayText="选中" ShowLabel="true"></Checkbox>
</div>
<div class="form-group col-12 col-sm-6">
<Checkbox TValue="string" State="CheckboxState.UnChecked" OnStateChanged="@OnStateChanged" DisplayText="未选" ShowLabel="true"></Checkbox>
</div>
<div class="row g-3 form-inline">
<div class="col-12 col-sm-6">
<Checkbox TValue="string" State="CheckboxState.Checked" OnStateChanged="@OnStateChanged" DisplayText="选中" ShowLabel="true"></Checkbox>
</div>
<div class="col-12 col-sm-6">
<Checkbox TValue="string" State="CheckboxState.UnChecked" OnStateChanged="@OnStateChanged" DisplayText="未选" ShowLabel="true"></Checkbox>
</div>
</div>
<Logger @ref="Trace" class="mt-3" />
</Block>
<Block Title="禁用复选框" Introduction="复选框不可用状态,通过 <code>IsDisabled</code> 设置组件是否可用">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" IsDisabled="true" DisplayText="选中" ShowLabel="true"></Checkbox>
</div>
<div class="form-group col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.UnChecked" IsDisabled="true" DisplayText="未选" ShowLabel="true"></Checkbox>
</div>
<div class="row g-3 form-inline">
<div class="col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" IsDisabled="true" DisplayText="选中" ShowLabel="true"></Checkbox>
</div>
<div class="col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.UnChecked" IsDisabled="true" DisplayText="未选" ShowLabel="true"></Checkbox>
</div>
</div>
</Block>
<Block Title="颜色" Introduction="通过设置 <code>Color</code> 属性改变组件背景色">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Primary"></Checkbox>
</div>
<div class="form-group col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Success"></Checkbox>
</div>
<div class="form-group col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Danger"></Checkbox>
</div>
<div class="form-group col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Info"></Checkbox>
</div>
<div class="form-group col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Warning"></Checkbox>
</div>
<div class="form-group col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Dark"></Checkbox>
</div>
<div class="row g-3 form-inline">
<div class="col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Primary"></Checkbox>
</div>
<div class="col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Success"></Checkbox>
</div>
<div class="col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Danger"></Checkbox>
</div>
<div class="col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Info"></Checkbox>
</div>
<div class="col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Warning"></Checkbox>
</div>
<div class="col-12 col-md-4">
<Checkbox TValue="string" State="CheckboxState.Checked" DisplayText="选中" ShowLabel="true" Color="@Color.Dark"></Checkbox>
</div>
</div>
</Block>
<Block Title="Label 文字" Introduction="复选框显示文字,通过 <code>DisplayText</code> 设置组件显示文本,点击显示文字时组件状态也会进行翻转">
<p>设置<code>DisplayText</code> 属性,或者通过双向绑定均可以显示文本信息</p>
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<Checkbox TValue="string" DisplayText="显示文字" ShowAfterLabel="true"></Checkbox>
</div>
</div>
</div>
<Checkbox TValue="string" DisplayText="显示文字" ShowAfterLabel="true"></Checkbox>
</Block>
<Block Title="双向绑定 boolean 数据" Introduction="绑定组件内变量,数据自动同步,绑定数据类型为 <code>boolean</code> 类型时自动翻转值">
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<Checkbox DisplayText="双向绑定" ShowLabel="true" @bind-Value="@BindValue" OnStateChanged="@OnItemChanged"></Checkbox>
</div>
<div class="form-group col-12">
<BootstrapInput @bind-Value="@BindValue" IsDisabled="true"></BootstrapInput>
</div>
<div class="row g-3 form-inline">
<div class="col-12">
<Checkbox DisplayText="双向绑定" ShowLabel="true" @bind-Value="@BindValue" OnStateChanged="@OnItemChanged"></Checkbox>
</div>
<div class="col-12">
<BootstrapInput @bind-Value="@BindValue" IsDisabled="true"></BootstrapInput>
</div>
</div>
<Logger @ref="BinderLog" class="mt-3" />
</Block>
<Block Title="双向绑定 string 数据" Introduction="绑定组件内变量,数据自动同步">
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<Checkbox DisplayText="双向绑定" ShowLabel="true" @bind-Value="@BindString" OnStateChanged="@OnItemChangedString"></Checkbox>
</div>
<div class="form-group col-12">
<BootstrapInput @bind-Value="@BindString"></BootstrapInput>
</div>
<div class="row g-3 form-inline">
<div class="col-12">
<Checkbox DisplayText="双向绑定" ShowLabel="true" @bind-Value="@BindString" OnStateChanged="@OnItemChangedString"></Checkbox>
</div>
<div class="col-12">
<BootstrapInput @bind-Value="@BindString"></BootstrapInput>
</div>
</div>
<Logger @ref="BinderLog" class="mt-3" />
@@ -97,12 +81,12 @@
<Block Title="表单中使用" Introduction="在表单中使用 <code>Checkbox</code> 时,显示标签文字会放置到组件前面">
<p>前置标签显式规则与 <code>BootstrapInput</code> 组件一致 <a href="inputs">[传送门]</a></p>
<ValidateForm class="form-inline" Model="@Model">
<div class="row">
<div class="form-group col-12 col-sm-6">
<ValidateForm Model="@Model">
<div class="row g-3 form-inline">
<div class="col-12 col-sm-6">
<Checkbox @bind-Value="@Model.BindValue" ShowLabel="true"></Checkbox>
</div>
<div class="form-group col-12 col-sm-6">
<div class="col-12 col-sm-6">
<Checkbox @bind-Value="@Model.BindValue" ShowLabel="true" DisplayText="手写标签"></Checkbox>
</div>
</div>

View File

@@ -29,32 +29,8 @@
<Logger @ref="Trace" class="mt-3" />
</Block>
<Block Title="指示箭头" Introduction="右侧显示指示箭头">
<Collapse ShowArrow="true">
<CollapseItems>
<CollapseItem Text="一致性 Consistency">
<div>与现实生活一致:与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念;</div>
<div>在界面中一致:所有的元素和结构需保持一致,比如:设计样式、图标和文本、元素的位置等。</div>
</CollapseItem>
<CollapseItem Text="反馈 Feedback" IsCollapsed="false">
<div>控制反馈:通过界面样式和交互动效让用户可以清晰的感知自己的操作;</div>
<div>页面反馈:操作后,通过页面元素的变化清晰地展现当前状态。</div>
</CollapseItem>
<CollapseItem Text="效率 Efficiency">
<div>简化流程:设计简洁直观的操作流程;</div>
<div>清晰明确:语言表达清晰且表意明确,让用户快速理解进而作出决策;</div>
<div>帮助用户识别:界面简单直白,让用户快速识别而非回忆,减少用户记忆负担。</div>
</CollapseItem>
<CollapseItem Text="可控 Controllability">
<div>用户决策:根据场景可给予用户操作建议或安全提示,但不能代替用户进行决策;</div>
<div>结果可控:用户可以自由的进行操作,包括撤销、回退和终止当前操作等。</div>
</CollapseItem>
</CollapseItems>
</Collapse>
</Block>
<Block Title="手风琴效果" Introduction="每次只能展开一个面板">
<Collapse ShowArrow="true" IsAccordion="true">
<Collapse IsAccordion="true">
<CollapseItems>
<CollapseItem Text="一致性 Consistency">
<div>与现实生活一致:与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念;</div>
@@ -78,7 +54,7 @@
</Block>
<Block Title="子项标题颜色" Introduction="每个面板设置不同颜色">
<Collapse ShowArrow="true" IsAccordion="true">
<Collapse IsAccordion="true">
<CollapseItems>
<CollapseItem Text="一致性 Consistency" TitleColor="Color.Primary">
<div>与现实生活一致:与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念;</div>

View File

@@ -39,13 +39,6 @@ namespace BootstrapBlazor.Shared.Pages
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "ShowArrow",
Description = "是否显示指示箭头",
Type = "bool",
ValueList = "true|false",
DefaultValue = "false"
},
new AttributeItem() {
Name = "IsAccordion",
Description = "是否手风琴效果",

View File

@@ -5,26 +5,32 @@
<h4>选择颜色使用</h4>
<Block Title="基本用法" Introduction="通过设置 <code>Value</code> 属性设定颜色值">
<ColorPicker Value="@Value1" ColorChanged="@OnColorChanged" ShowBar="false" />
<ColorPicker Value="@Value1" OnValueChanged="@OnColorChanged" />
<Logger @ref="Trace" class="mt-3" />
</Block>
<Block Title="设置初始值" Introduction="通过设置 <code>Value</code> 属性设定颜色值">
<p>设置 <code>Value="@Value2"</code> 初始化默认值</p>
<ColorPicker Value="@Value2" ShowBar="false" />
<ColorPicker Value="@Value2" />
</Block>
<Block Title="双向绑定" Introduction="通过设置 <code>Value</code> 属性设定颜色值">
<ColorPicker @bind-Value="@Value3" ShowBar="false" />
<ColorPicker @bind-Value="@Value3" />
<div class="mt-3">Value3: @Value3</div>
</Block>
<Block Title="显示颜色 Bar" Introduction="通过设置 <code>ShowBar</code> 属性开启右侧颜色预览框">
<ColorPicker Value="@Value4" ShowBar="true" />
<Block Title="禁用" Introduction="通过设置 <code>IsDisabled</code> 属性禁用此组件">
<ColorPicker Value="@Value5" IsDisabled="true" />
</Block>
<Block Title="用" Introduction="通过设置 <code>IsDisabled</code> 属性禁用此组件">
<ColorPicker Value="@Value5" ShowBar="true" IsDisabled="true" />
<Block Title="验证表单中使用" Introduction="内置于 <code>ValidateForm</code> 中使用">
<ValidateForm Model="Dummy">
<div class="row g-3 form-inline">
<div class="col-6">
<ColorPicker @bind-Value="@Dummy.Name" />
</div>
</div>
</ValidateForm>
</Block>
<AttributeTable Items="@GetAttributes()" />

View File

@@ -22,14 +22,17 @@ namespace BootstrapBlazor.Shared.Pages
private string? Value1 { get; set; }
private string Value2 { get; set; } = "#FFF";
private string Value2 { get; set; } = "#FFFFFF";
private string Value3 { get; set; } = "#DDD";
private string Value3 { get; set; } = "#DDDDDD";
private string? Value4 { get; set; }
private string? Value5 { get; set; }
[NotNull]
private Foo? Dummy { get; set; } = new Foo() { Name = "#dddddd" };
private Task OnColorChanged(string color)
{
Trace.Log($"Selected color: {color}");
@@ -42,16 +45,9 @@ namespace BootstrapBlazor.Shared.Pages
/// <returns></returns>
private static IEnumerable<AttributeItem> GetAttributes() => new AttributeItem[]
{
new AttributeItem(){
Name = "ShowBar",
Description = "是否显示右侧颜色预览框",
Type = "bool",
ValueList = "false/true",
DefaultValue = "true"
},
new AttributeItem()
{
Name = "ColorChanged",
Name = "OnValueChanged",
Description = "颜色改变回调委托方法",
Type = "Func<string, Task>",
ValueList = "",

View File

@@ -18,32 +18,41 @@
</Block>
<Block Title="数据双向绑定" Introduction="点击确认按钮时间选择框值与文本框值一致">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">
<div class="d-flex flex-column">
<div class="mb-1"><code>TimeSpan</code> 类型</div>
<TimePickerBody @bind-Value="@SpanValue" />
<BootstrapInput @bind-Value="@SpanValue" Formatter="@FormatterSpanString" style="width: 180px; margin-top: 0.5rem;" />
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<div class="d-flex flex-column">
<div class="mb-1"><code>TimeSpan</code> 类型</div>
<TimePickerBody @bind-Value="@SpanValue" />
<BootstrapInput @bind-Value="@SpanValue" Formatter="@FormatterSpanString" style="width: 180px; margin-top: 0.5rem;" />
</div>
<div class="form-group col-12 col-sm-6">
<div class="d-flex flex-column">
<div class="mb-1"><code>string</code> 类型</div>
<TimePickerBody Value="@TimeNow" ValueChanged="@OnValueChange" />
<BootstrapInput @bind-Value="@SpanValue2" style="width: 180px; margin-top: 0.5rem;" />
</div>
</div>
<div class="col-12 col-sm-6">
<div class="d-flex flex-column">
<div class="mb-1"><code>string</code> 类型</div>
<TimePickerBody Value="@TimeNow" ValueChanged="@OnValueChange" />
<BootstrapInput @bind-Value="@SpanValue2" style="width: 180px; margin-top: 0.5rem;" />
</div>
</div>
</div>
</Block>
<Block Title="点击弹出日期框" Introduction="以「日」为基本单位,基础的日期选择控件">
<div class="form-inline">
<div class="row">
<div class="form-group col-sm-4">
<DateTimePicker TValue="DateTime" Value="@DateTime.Today" />
<Block Title="客户端验证" Introduction="根据自定义验证规则进行数据有效性检查并自动提示">
<ValidateForm Model="this">
<div class="row g-3">
<div class="col-12 col-sm-auto">
<DateTimePicker @bind-Value="@this.ModelValidateValue" />
</div>
<div class="col-12 col-sm-auto align-self-end">
<Button ButtonType="ButtonType.Submit" Text="@SubmitText" Icon="fa fa-save" />
</div>
</div>
</ValidateForm>
</Block>
<Block Title="点击弹出日期框" Introduction="以「日」为基本单位,基础的日期选择控件">
<div class="row g-3">
<div class="col-sm-4">
<DateTimePicker TValue="DateTime" Value="@DateTime.Today" />
</div>
</div>
@@ -51,42 +60,29 @@
</Block>
<Block Title="数据双向绑定" Introduction="日期组件时间改变时文本框内的数值也跟着改变">
<div class="form-inline">
<div class="row">
<div class="form-group col-sm-6">
<DateTimePicker TValue="DateTime?" Value="@BindValue" ValueChanged="@DateTimeValueChanged" Placement="Placement.Right" />
</div>
<div class="form-group col-sm-6">
<input class="form-control" @bind="@BindValueString" />
</div>
<div class="form-group col-sm-12">
<Logger @ref="DateTimeLogger" class="mt-3" />
</div>
<div class="row g-3">
<div class="col-sm-6">
<DateTimePicker TValue="DateTime?" Value="@BindValue" ValueChanged="@DateTimeValueChanged" Placement="Placement.Right" />
</div>
<div class="col-sm-6">
<input class="form-control" @bind="@BindValueString" />
</div>
</div>
</Block>
<Block Title="带时间的选择器" Introduction="在同一个选择器里选择日期和时间,点击确认按钮后关闭弹窗">
<p>设置 <code>ViewModel</code> 属性值为 <code>DatePickerViewModel.DateTime</code></p>
<div class="form-inline">
<div class="row">
<div class="form-group col-sm-4">
<DateTimePicker TValue="DateTime" ViewModel="DatePickerViewModel.DateTime" />
</div>
</div>
</div>
<DateTimePicker TValue="DateTime" ViewModel="DatePickerViewModel.DateTime" />
</Block>
<Block Title="允许空时间" Introduction="多用于条件选择">
<p>绑定值为可为空类型 <code>DateTime?</code> 时自动出现 <b>清空</b> 按钮</p>
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-8">
<DateTimePicker TValue="DateTime?" @bind-Value="@BindNullValue" />
</div>
<div class="form-group col-12 col-sm-4">
<div class="form-control">@GetNullValueString</div>
</div>
<div class="row g-3">
<div class="col-12 col-sm-8">
<DateTimePicker TValue="DateTime?" @bind-Value="@BindNullValue" />
</div>
<div class="col-12 col-sm-4">
<div class="form-control">@GetNullValueString</div>
</div>
</div>
</Block>
@@ -94,42 +90,37 @@
<Block Title="显示标签" Introduction="作为表单组件时,显示组件前方标签">
<p>设置 <code>DisplayText</code> 属性值为 <code>选择时间</code></p>
<p>前置标签显式规则与 <code>BootstrapInput</code> 组件一致 <a href="inputs">[传送门]</a></p>
<div class="form-inline">
<div class="row">
<div class="form-group col-12">
<DateTimePicker TValue="DateTime?" @bind-Value="@BindNullValue" DisplayText="选择时间" ShowLabel="true" />
</div>
<div class="row g-3">
<div class="col-12">
<DateTimePicker TValue="DateTime?" @bind-Value="@BindNullValue" DisplayText="选择时间" ShowLabel="true" />
</div>
</div>
</Block>
<Block Title="禁用" Introduction="设置 <code>IsDisabled</code> 属性值为 <code>true</code> 时,组件禁止输入">
<div class="form-inline">
<div class="row">
<div class="col-12">
<DateTimePicker TValue="DateTime" IsDisabled="true" />
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<DateTimePicker TValue="DateTime" IsDisabled="IsDisabled" />
</div>
<div class="col-12 col-sm-6">
<Switch @bind-Value="@IsDisabled" />
</div>
</div>
</Block>
<Block Title="带快捷键侧边栏" Introduction="设置 <code>ShowSidebar</code> 属性值为 <code>true</code> 时,组件显示快捷方式侧边栏">
<div class="form-inline">
<div class="row">
<div class="col-12">
<DateTimePicker TValue="DateTime" ShowSidebar="true" ViewModel="DatePickerViewModel.DateTime" />
</div>
<div class="row g-3">
<div class="col-12">
<DateTimePicker TValue="DateTime" ShowSidebar="true" ViewModel="DatePickerViewModel.DateTime" />
</div>
</div>
</Block>
<Block Title="设置值范围" Introduction="设置 <code>MinValue</code> 属性值与 <code>MaxValue</code> 限制可选值范围">
<div class="form-inline">
<div class="row">
<div class="col-12">
<DateTimePicker TValue="DateTime" ViewModel="DatePickerViewModel.Date" Value="@(DateTime.Today.AddDays(3 - DateTime.Today.Day))"
MinValue="@(DateTime.Today.AddDays(1 - DateTime.Today.Day))" MaxValue="@(DateTime.Today.AddDays(14 - DateTime.Today.Day))" />
</div>
<Block Title="设置值范围" Introduction="设置 <code>MinValue</code> 属性值与 <code>MaxValue</code> 限制可选值范围,本例中设置范围为 <b>45</b> 天">
<div class="row g-3">
<div class="col-12">
<DateTimePicker TValue="DateTime" ViewModel="DatePickerViewModel.Date" Value="@(DateTime.Today.AddDays(3 - DateTime.Today.Day))"
MinValue="@(DateTime.Today.AddDays(1 - DateTime.Today.Day))" MaxValue="@(DateTime.Today.AddDays(46 - DateTime.Today.Day))" />
</div>
</div>
</Block>

View File

@@ -4,8 +4,12 @@
using BootstrapBlazor.Shared.Common;
using BootstrapBlazor.Shared.Pages.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
namespace BootstrapBlazor.Shared.Pages
@@ -15,40 +19,49 @@ namespace BootstrapBlazor.Shared.Pages
/// </summary>
public sealed partial class DateTimePickers
{
/// <summary>
///
/// </summary>
private TimeSpan SpanValue { get; set; } = DateTime.Now.Subtract(DateTime.Today);
/// <summary>
///
/// </summary>
private string SpanValue2 { get; set; } = DateTime.Now.ToString("HH:mm:ss");
/// <summary>
///
/// </summary>
[NotNull]
private Logger? DateLogger { get; set; }
/// <summary>
///
/// </summary>
[NotNull]
private Logger? TimeLogger { get; set; }
/// <summary>
///
/// </summary>
[NotNull]
private Logger? DateTimeLogger { get; set; }
/// <summary>
///
/// </summary>
private DateTime? BindValue { get; set; } = DateTime.Today;
private DateTime? BindNullValue { get; set; }
private bool IsDisabled { get; set; } = true;
/// <summary>
///
/// </summary>
[Required]
public DateTime? ModelValidateValue { get; set; }
private string? SubmitText { get; set; }
private string GetNullValueString => BindNullValue.HasValue ? BindNullValue.Value.ToString("yyyy-MM-dd") : "空值";
[Inject]
[NotNull]
private IStringLocalizer<DateTimePickers>? Localizer { get; set; }
/// <summary>
/// OnInitialized 方法
/// </summary>
protected override void OnInitialized()
{
base.OnInitialized();
SubmitText ??= Localizer[nameof(SubmitText)];
}
/// <summary>
///
/// </summary>
@@ -77,7 +90,7 @@ namespace BootstrapBlazor.Shared.Pages
/// <param name="d"></param>
private Task DateValueChanged(DateTime d)
{
DateLogger?.Log($"选择的日期为: {d:yyyy-MM-dd}");
DateLogger.Log($"选择的日期为: {d:yyyy-MM-dd}");
return Task.CompletedTask;
}
@@ -94,7 +107,7 @@ namespace BootstrapBlazor.Shared.Pages
/// <param name="d"></param>
private void TimeValueChanged(TimeSpan d)
{
TimeLogger?.Log($"选择的时间为: {d:hh\\:mm\\:ss}");
TimeLogger.Log($"选择的时间为: {d:hh\\:mm\\:ss}");
}
/// <summary>
@@ -104,7 +117,6 @@ namespace BootstrapBlazor.Shared.Pages
private Task DateTimeValueChanged(DateTime? d)
{
BindValue = d;
DateTimeLogger?.Log($"选择的时间为: {d:yyyy-MM-dd}");
return Task.CompletedTask;
}

View File

@@ -10,57 +10,44 @@
</Block>
<Block Title="数据双向绑定" Introduction="点击确认按钮时间选择框值与文本框值一致">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">
<DateTimeRange @bind-Value="@DateTimeRangeValue2" />
</div>
<div class="form-group col-12 col-sm-6">
<div>
@if (DateTimeRangeValue2.Start != DateTime.MinValue)
{
<span>时间范围:</span> @DateTimeRangeValue2.Start.ToString("yyyy-MM-dd");
}
@if (DateTimeRangeValue2.End != DateTime.MinValue)
{
<span> - </span> @DateTimeRangeValue2.End.ToString("yyyy-MM-dd");
}
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<DateTimeRange @bind-Value="@DateTimeRangeValue2" />
</div>
<div class="col-12 col-sm-6">
<div>
@if (DateTimeRangeValue2.Start != DateTime.MinValue)
{
<span>时间范围:</span> @DateTimeRangeValue2.Start.ToString("yyyy-MM-dd");
}
@if (DateTimeRangeValue2.End != DateTime.MinValue)
{
<span> - </span> @DateTimeRangeValue2.End.ToString("yyyy-MM-dd");
}
</div>
</div>
</div>
</Block>
<Block Title="禁用" Introduction="设置 <code>IsDisabled</code> 属性值为 <code>true</code> 时,组件禁止输入">
<div class="form-inline">
<div class="row">
<div class="col-12">
<DateTimeRange Value="@DateTimeRangeValue3" IsDisabled="true" />
</div>
</div>
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<DateTimeRange Value="@DateTimeRangeValue3" IsDisabled="@IsDisabled" />
</div>
<div class="col-12 col-sm-6">
<Switch @bind-Value="@IsDisabled" />
</div>
</div>
</Block>
<Block Title="带快捷键侧边栏" Introduction="设置 <code>ShowSidebar</code> 属性值为 <code>true</code> 时,组件显示快捷方式侧边栏">
<p>通过设置 <code>ShowSidebar</code> 参数开启显示侧边栏快捷选项功能,通过设置 <code>SidebarItems</code> 参数集合替换组件内置的默认快捷项</p>
<div class="form-inline">
<div class="row">
<div class="col-12">
<DateTimeRange Value="@DateTimeRangeValue4" ShowSidebar="true" />
</div>
</div>
</div>
<DateTimeRange Value="@DateTimeRangeValue4" ShowSidebar="true" />
</Block>
<Block Title="显示今天按钮" Introduction="设置 <code>ShowToday</code> 属性值为 <code>true</code> 时,组件下方显示今天快捷按钮">
<p>点击 <code>今天</code> 按钮时,时间范围为 <code>yyyy-MM-dd 00:00:00 到 yyyy-MM-dd 23:59:59</code></p>
<div class="form-inline">
<div class="row">
<div class="col-12">
<DateTimeRange Value="@DateTimeRangeValue4" ShowToday="true" />
</div>
</div>
</div>
<DateTimeRange Value="@DateTimeRangeValue4" ShowToday="true" />
</Block>
<AttributeTable Items="@GetAttributes()" />

View File

@@ -28,6 +28,8 @@ namespace BootstrapBlazor.Shared.Pages
private DateTimeRangeValue DateTimeRangeValue4 { get; set; } = new DateTimeRangeValue();
private bool IsDisabled { get; set; } = true;
private Task OnConfirm(DateTimeRangeValue value)
{
DateLogger?.Log($"选择的时间范围是: {value.Start:yyyy-MM-dd} - {value.End:yyyy-MM-dd}");
@@ -51,7 +53,7 @@ namespace BootstrapBlazor.Shared.Pages
Name = "OnClearValue",
Description="清空按钮回调委托",
Type ="Action"
}
}
};
/// <summary>

View File

@@ -13,7 +13,17 @@
<Pre>&lt;Dialog /&gt;</Pre>
<Block Title="基本用法" Introduction="通过设置 <code>DialogOption</code> 属性对模态框进行基本属性设置">
<Button @onclick="@OnClick">点击打开 Dialog</Button>
<div>
<p>通过设置 <code>DialogOption</code> <code>IsKeyboard</code> 参数,开启弹窗是否支持 <kbd>ESC</kbd>,请点击后面按钮设置后再点击 <b>弹窗</b> 按钮测试效果</p>
<Button OnClick="@OnClick">点击打开 Dialog</Button>
<Button OnClick="@OnClickKeyboard" Text="@($"Keyboard: {IsKeyboard}")" class="ms-3" />
</div>
</Block>
<Block Title="自定义标题栏" Introduction="通过设置 <code>HeaderTemplate</code> 属性对模态框标题栏进行自定义设置">
<div>
<Button OnClick="@OnCustomerHeaderClick" Text="弹窗" />
</div>
</Block>
<Block Title="弹出复杂组件" Introduction="通过调用 <code>Show&lt;Counter&gt;()</code> 来弹出一个自定义组件">
@@ -31,27 +41,25 @@
</Block>
<Block Title="实战应用" Introduction="本例中通过传递一个主键,在弹窗内的组件通过此主键进行数据查询,并将结果显示在弹窗内">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">
<Select @bind-Value="@DataPrimaryId" DisplayText="主键参数" ShowLabel="true">
<Options>
<SelectOption Text="1" Value="1"></SelectOption>
<SelectOption Text="2" Value="2"></SelectOption>
<SelectOption Text="3" Value="3"></SelectOption>
<SelectOption Text="4" Value="4"></SelectOption>
<SelectOption Text="5" Value="5"></SelectOption>
<SelectOption Text="6" Value="6"></SelectOption>
<SelectOption Text="7" Value="7"></SelectOption>
<SelectOption Text="8" Value="8"></SelectOption>
<SelectOption Text="9" Value="9"></SelectOption>
<SelectOption Text="10" Value="10"></SelectOption>
</Options>
</Select>
</div>
<div class="form-group col-12 col-sm-6">
<Button @onclick="@OnClickShowDataById">弹窗</Button>
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<Select @bind-Value="@DataPrimaryId" DisplayText="主键参数" ShowLabel="true">
<Options>
<SelectOption Text="1" Value="1"></SelectOption>
<SelectOption Text="2" Value="2"></SelectOption>
<SelectOption Text="3" Value="3"></SelectOption>
<SelectOption Text="4" Value="4"></SelectOption>
<SelectOption Text="5" Value="5"></SelectOption>
<SelectOption Text="6" Value="6"></SelectOption>
<SelectOption Text="7" Value="7"></SelectOption>
<SelectOption Text="8" Value="8"></SelectOption>
<SelectOption Text="9" Value="9"></SelectOption>
<SelectOption Text="10" Value="10"></SelectOption>
</Options>
</Select>
</div>
<div class="col-12 col-sm-6 align-self-end">
<Button @onclick="@OnClickShowDataById">弹窗</Button>
</div>
</div>
</Block>
@@ -62,6 +70,12 @@
<Button @onclick="@Show">Dialog</Button>
</Block>
<Block Title="禁用 Header 中的关闭按钮" Introduction="本例讲解如何通过代码打开与关闭弹窗">
<p>设置参数 <code>ShowHeaderCloseButton</code> 禁止弹窗 <code>Header</code> 右侧显示 <b>关闭</b> 按钮</p>
<Button @onclick="@ShowNoHeaderCloseButtonDialog">Dialog</Button>
</Block>
<Block Title="多级弹窗" Introduction="点击弹窗内部按钮继续弹出对话窗">
<p>功能介绍</p>
<ul class="ul-demo">
@@ -97,14 +111,10 @@
<li>再次点击弹出模态弹窗时,组件内行选中状态保持一致</li>
<li>弹窗中未选择用户时禁止关闭弹窗</li>
</ul>
<div class="form-inline">
<label class="control-label">收件人:</label>
<div class="input-group flex-fill">
<BootstrapInput placeholder="请输入 ..." Value="@InputValue"></BootstrapInput>
<div class="input-group-append">
<Button Icon="fa fa-vcard-o" OnClick="@OnEmailButtonClick"></Button>
</div>
</div>
<label class="form-label">收件人:</label>
<div class="input-group">
<BootstrapInput placeholder="请输入 ..." Value="@InputValue"></BootstrapInput>
<Button Icon="fa fa-vcard-o" OnClick="@OnEmailButtonClick"></Button>
</div>
</Block>

View File

@@ -29,16 +29,48 @@ namespace BootstrapBlazor.Shared.Pages
[NotNull]
private DialogService? DialogService { get; set; }
private bool IsKeyboard { get; set; }
private void OnClickKeyboard()
{
IsKeyboard = !IsKeyboard;
}
private async Task TriggerUpdateBodyAsync(string val)
{
if (BodyFooComponent != null)
{
await BodyFooComponent.UpdateAsync(val);
}
}
private DialogBodyFoo? BodyFooComponent { get; set; }
private Task OnCustomerHeaderClick() => DialogService.Show(new DialogOption()
{
HeaderTemplate = BootstrapDynamicComponent.CreateComponent<DialogHeaderFoo>(new KeyValuePair<string, object>[]
{
new(nameof(DialogHeaderFoo.OnValueChanged), new Func<string, Task>(val => TriggerUpdateBodyAsync(val)))
}).Render(),
BodyTemplate = builder =>
{
builder.OpenComponent<DialogBodyFoo>(0);
builder.AddComponentReferenceCapture(1, obj => BodyFooComponent = (DialogBodyFoo)obj);
builder.CloseComponent();
},
});
/// <summary>
///
/// </summary>
/// <returns></returns>
private Task OnClick() => DialogService.Show(new DialogOption()
{
IsKeyboard = IsKeyboard,
Title = "我是服务创建的弹出框",
BodyTemplate = BootstrapDynamicComponent.CreateComponent<Button>(new[]
BodyTemplate = BootstrapDynamicComponent.CreateComponent<Button>(new KeyValuePair<string, object>[]
{
new KeyValuePair<string, object?>(nameof(Button.ChildContent), new RenderFragment(builder => builder.AddContent(0, "我是服务创建的按钮")))
new(nameof(Button.ChildContent), new RenderFragment(builder => builder.AddContent(0, "我是服务创建的按钮")))
})
.Render()
});
@@ -49,10 +81,25 @@ namespace BootstrapBlazor.Shared.Pages
{
Title = "利用代码关闭弹出框",
};
option.BodyTemplate = BootstrapDynamicComponent.CreateComponent<Button>(new[]
option.BodyTemplate = BootstrapDynamicComponent.CreateComponent<Button>(new KeyValuePair<string, object>[]
{
new KeyValuePair<string, object?>(nameof(Button.Text), "点击关闭弹窗"),
new KeyValuePair<string, object?>(nameof(Button.OnClick), EventCallback.Factory.Create<MouseEventArgs>(this, async () => await option.Dialog.Close()))
new(nameof(Button.Text), "点击关闭弹窗"),
new(nameof(Button.OnClick), EventCallback.Factory.Create<MouseEventArgs>(this, async () => await option.Dialog.Close()))
}).Render();
await DialogService.Show(option);
}
private async Task ShowNoHeaderCloseButtonDialog()
{
var option = new DialogOption()
{
Title = "Header 中无关闭按钮",
ShowHeaderCloseButton = false
};
option.BodyTemplate = BootstrapDynamicComponent.CreateComponent<Button>(new KeyValuePair<string, object>[]
{
new(nameof(Button.Text), "点击关闭弹窗"),
new(nameof(Button.OnClick), EventCallback.Factory.Create<MouseEventArgs>(this, async () => await option.Dialog.Close()))
}).Render();
await DialogService.Show(option);
}
@@ -93,7 +140,7 @@ namespace BootstrapBlazor.Shared.Pages
ShowFooter = false,
BodyContext = DataPrimaryId
};
op.BodyTemplate = BootstrapDynamicComponent.CreateComponent<DataDialogComponent>(new KeyValuePair<string, object?>[]
op.BodyTemplate = BootstrapDynamicComponent.CreateComponent<DataDialogComponent>(new KeyValuePair<string, object>[]
{
new(nameof(DataDialogComponent.OnClose), new Action(async () => await op.Dialog.Close()))
}).Render();
@@ -107,7 +154,7 @@ namespace BootstrapBlazor.Shared.Pages
var result = await DialogService.ShowModal<ResultDialogDemo>(new ResultDialogOption()
{
Title = "带返回值模态弹出框",
ComponentParamters = new KeyValuePair<string, object?>[]
ComponentParamters = new KeyValuePair<string, object>[]
{
new(nameof(ResultDialogDemo.Value), DemoValue1),
new(nameof(ResultDialogDemo.ValueChanged), EventCallback.Factory.Create<int>(this, v => DemoValue1 = v))
@@ -128,7 +175,7 @@ namespace BootstrapBlazor.Shared.Pages
BodyContext = new ResultDialogDemo2.FooContext() { Count = 10, Emails = InputValue },
ButtonYesText = "选择",
ButtonYesIcon = "fa fa-search",
ComponentParamters = new KeyValuePair<string, object?>[]
ComponentParamters = new KeyValuePair<string, object>[]
{
// 用于初始化已选择的用户邮件
new(nameof(ResultDialogDemo2.Emails), Emails),
@@ -173,6 +220,13 @@ namespace BootstrapBlazor.Shared.Pages
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "HeaderTemplate",
Description = "模态主体 ModalHeader 模板",
Type = "RenderFragment",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "BodyTemplate",
Description = "模态主体 ModalBody 组件",
@@ -208,6 +262,13 @@ namespace BootstrapBlazor.Shared.Pages
ValueList = "true|false",
DefaultValue = "true"
},
new AttributeItem() {
Name = "ShowHeaderCloseButton",
Description = "是否显示标题栏右侧关闭按钮",
Type = "boolean",
ValueList = "true|false",
DefaultValue = "true"
},
new AttributeItem() {
Name = "ShowFooter",
Description = "是否显示 Footer",

View File

@@ -5,7 +5,7 @@
<h4>显示静态文本数据</h4>
<Block Title="基础用法" Introduction="仅显示">
<div class="row">
<div class="row g-3">
<div class="col-auto col-form-label">
<span>基本用法</span>
</div>
@@ -17,112 +17,95 @@
<Block Title="双向绑定数据" Introduction="通过双向绑定可以自动获取资源文件中的显示标签">
<p><code>Display</code> 组件开启双向绑定时,会根据绑定的 <code>Model</code> 属性值去自动获取 <code>Display/DisplayName</code> 标签值并且显示为前置 <code>Label</code>,通过 <code>DisplayText</code> 属性可以自定义显示前置标签,或者通过 <code>ShowLabel</code> 属性关闭前置标签是否显示</p>
<div class="form-inline">
<div class="row">
<div class="row g-3">
<div class="col-12">
<Divider Text="自定义标签" />
<div class="form-group col-12">
<p>设置 <code>DisplayText</code> 值为 <b>自定义标签</b></p>
</div>
<div class="form-group col-12">
<Display @bind-Value="@Model.Name" DisplayText="自定义标签" ShowLabel="true" />
</div>
</div>
<div class="col-12">
<p>设置 <code>DisplayText</code> 值为 <b>自定义标签</b></p>
</div>
<div class="col-12 col-sm-6">
<Display @bind-Value="@Model.Name" DisplayText="自定义标签" ShowLabel="true" />
</div>
<div class="col-12">
<Divider Text="占位" />
<div class="form-group col-12">
<p>无论是否设置 <code>DisplayText</code> 值,当 <code>ShowLabel</code> 为 <code>true</code> 时均显示</p>
</div>
<div class="form-group col-12">
<Display @bind-Value="@Model.Name" ShowLabel="true" />
</div>
</div>
<div class="col-12">
<p>无论是否设置 <code>DisplayText</code> 值,当 <code>ShowLabel</code> 为 <code>true</code> 时均显示</p>
</div>
<div class="col-12 col-sm-6">
<Display @bind-Value="@Model.Name" ShowLabel="true" />
</div>
<div class="col-12">
<Divider Text="不占位" />
<div class="form-group col-12">
<p>无论是否设置 <code>DisplayText</code> 值,当 <code>ShowLabel</code> 为 <code>false</code> 时均不显示</p>
</div>
<div class="form-group col-12">
<Display @bind-Value="@Model.Name" />
</div>
</div>
<div class="col-12">
<p>无论是否设置 <code>DisplayText</code> 值,当 <code>ShowLabel</code> 为 <code>false</code> 时均不显示</p>
</div>
<div class="col-12 col-sm-6">
<Display @bind-Value="@Model.Name" />
</div>
</div>
</Block>
<Block Title="泛型绑定" Introduction="<code>Display</code> 组件内置对 <code>枚举</code> <code>集合</code> <code>数组</code> 进行处理,如不符合条件时,请自定义格式化或者回调委托方法">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">
<Display FormatString="000" @bind-Value="@Model.Count" ShowLabel="true" DisplayText="整型" />
</div>
<div class="form-group col-12 col-sm-6">
<Display @bind-Value="@Model.Education" ShowLabel="true" DisplayText="枚举" />
</div>
<div class="form-group col-12 col-sm-6">
<Display @bind-Value="@Model.Hobby" ShowLabel="true" DisplayText="集合" />
</div>
<div class="form-group col-12 col-sm-6">
<Display @bind-Value="@ByteArray" ShowLabel="true" DisplayText="数组" />
</div>
<div class="form-group col-12 col-sm-6">
<Display Value="@DateTime.Now" ShowLabel="true" DisplayText="DateTime" />
</div>
<div class="form-group col-12 col-sm-6">
<Display Value="@DateTimeOffset.Now" ShowLabel="true" DisplayText="DateTimeOffset" />
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">
<Display FormatString="000" @bind-Value="@Model.Count" ShowLabel="true" DisplayText="整型" />
</div>
<div class="col-12 col-sm-6">
<Display @bind-Value="@Model.Education" ShowLabel="true" DisplayText="枚举" />
</div>
<div class="col-12 col-sm-6">
<Display @bind-Value="@Model.Hobby" ShowLabel="true" DisplayText="集合" />
</div>
<div class="col-12 col-sm-6">
<Display @bind-Value="@ByteArray" ShowLabel="true" DisplayText="数组" />
</div>
<div class="col-12 col-sm-6">
<Display Value="@DateTime.Now" ShowLabel="true" DisplayText="DateTime" />
</div>
<div class="col-12 col-sm-6">
<Display Value="@DateTimeOffset.Now" ShowLabel="true" DisplayText="DateTimeOffset" />
</div>
</div>
</Block>
<Block Title="表单内使用" Introduction="<code>Display</code> 组件在表单组件 <code>EditorForm</code> 中使用,多用于明细页,不可编辑模式">
<p><b><code>form-inline form-group</code></b> 模式</p>
<EditorForm Model="@Model" ItemsPerRow="3" IsDisplay="true">
<FieldItems>
<EditorItem @bind-Field="@Model.Hobby" Data="@Hobbys" />
</FieldItems>
</EditorForm>
<p><b><code>form-inline</code></b> 模式</p>
<div class="form-inline">
<div class="row">
<div class="col-12 col-sm-6"><Display @bind-Value="@Model.Count" ShowLabel="true" DisplayText="整型" /></div>
<div class="col-12 col-sm-6"><Display @bind-Value="@Model.Education" ShowLabel="true" DisplayText="枚举" /></div>
</div>
</div>
</Block>
<Block Title="自定义格式" Introduction="设置 <code>FormatString</code> 属性值为 <code>yyyy-MM-dd</code> 时,组件显示的时间格式为年月日">
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">设置 <code class="ml-1">FormatString</code></div>
<div class="form-group col-12 col-sm-6">
<Display Value="DateTime.Now" FormatString="yyyy-MM-dd" />
</div>
<div class="form-group col-12 col-sm-6">设置 <code class="ml-1">Formatter</code></div>
<div class="form-group col-12 col-sm-6">
<Display Value="DateTime.Now" FormatterAsync="@DateTimeFormatter" />
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">设置 <code class="ms-1">FormatString</code></div>
<div class="col-12 col-sm-6">
<Display Value="DateTime.Now" FormatString="yyyy-MM-dd" />
</div>
<div class="col-12 col-sm-6">设置 <code class="ms-1">Formatter</code></div>
<div class="col-12 col-sm-6">
<Display Value="DateTime.Now" FormatterAsync="@DateTimeFormatter" />
</div>
</div>
<p class="mt-3"><code>Display</code> 组件绑定 <code>byte[]</code> 数组,格式化成 <code>base64</code> 编码字符串示例</p>
<div class="form-inline">
<div class="row">
<div class="form-group col-12 col-sm-6">设置 <code class="ml-1">Formatter</code></div>
<div class="form-group col-12 col-sm-6">
<Display Value="@ByteArray" FormatterAsync="@ByteArrayFormatter" />
</div>
<div class="row g-3">
<div class="col-12 col-sm-6">设置 <code class="ms-1">Formatter</code></div>
<div class="col-12 col-sm-6">
<Display Value="@ByteArray" FormatterAsync="@ByteArrayFormatter" />
</div>
</div>
</Block>
<Block Title="自动翻译为 Text" Introduction="设置 <code>Data</code> 值为 <code>IEnumerable&lt;SelectedItem&gt;</code> 集合,组件将通过此数据集,进行通过 <code>Value</code> 显示 <code>Text</code> 翻译工作">
<Block Title="自动翻译为 Text" Introduction="设置 <code>Lookup</code> 值为 <code>IEnumerable&lt;SelectedItem&gt;</code> 集合,组件将通过此数据集,进行通过 <code>Value</code> 显示 <code>Text</code> 翻译工作">
<p>
<div>本例中组件 <code>Value="@@IntValue"</code> 设置 <code>Data="@@IntValueSource"</code> 组件将 <code>Value</code> 值对应的 <code>Text</code> 显示出来</div>
<div>本例中组件 <code>Value="@@IntValue"</code> 设置 <code>Lookup="@@IntValueSource"</code> 组件将 <code>Value</code> 值对应的 <code>Text</code> 显示出来</div>
<div><b>InitValue</b>: 1,2,3</div>
<div><b>IntValueSource</b>: Text1,Text2,Text3</div>
</p>
<div class="form-inline">
<div class="row">
<div class="col-12 col-sm-6">
<Display Value="@IntValue" Data="@IntValueSource" />
</div>
</div>
</div>
<Display Value="@IntValue" Lookup="@IntValueSource" />
</Block>
<AttributeTable Items="@GetAttributes()" />

View File

@@ -6,7 +6,7 @@
<Block Title="基本用法" Introduction="呼出一个临时的侧边栏, 可以从多个方向呼出">
<p class="d-flex flex-wrap drawer-demo">
<Radio Items="@DrawerDirection" OnStateChanged="@OnStateChanged" />
<RadioList TValue="SelectedItem" Items="@DrawerDirection" OnSelectedChanged="@OnStateChanged" />
</p>
<p>
<button type="button" class="btn btn-primary" @onclick="@(e => IsOpen = true)">点我打开</button>

View File

@@ -23,7 +23,7 @@ namespace BootstrapBlazor.Shared.Pages
private Placement DrawerAlign { get; set; }
private Task OnStateChanged(CheckboxState state, SelectedItem val)
private Task OnStateChanged(IEnumerable<SelectedItem> values, SelectedItem val)
{
DrawerAlign = val.Value switch
{

View File

@@ -18,7 +18,7 @@
<div style="width: 40px; height: 40px;">
<Avatar IsCircle="true" IsIcon="true" Size="Size.Small" />
</div>
<div class="ml-2">
<div class="ms-2">
<div class="d-flex position-relative">
<h4>Argo Zhang</h4>
<small><i class="fa fa-clock-o"></i> @(4 + index) mins</small>
@@ -41,7 +41,7 @@
{
<a class="dropdown-item d-flex align-items-center" href="#" @onclick:preventDefault>
<i class="fa fa-users text-primary"></i>
<div class="ml-2">5 new members joined</div>
<div class="ms-2">5 new members joined</div>
</a>
}
</BodyTemplate>

View File

@@ -14,68 +14,69 @@
</Block>
<Block Title="带有颜色的下拉框" Introduction='提供各种颜色的警告信息框 引用 <code>Color="Color.Primary"</code> 等颜色及样式类来定义下拉菜单的外在表现'>
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Primary"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Secondary"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Info"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Warning"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Danger"></Dropdown></div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Primary"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Secondary"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Info"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Warning"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Danger"></Dropdown></div>
</div>
</Block>
<Block Title="分裂式按钮下拉菜单" Introduction='可用与单个按钮下拉菜单近似的标记创建分裂式下拉菜单,添加 ShowSplit="true"(使用分裂式组件时需要加上 <code>DropdownType="DropdownType.ButtonGroup </code>") 插入此符号为下拉选项作适当的间隔(距)处理。'>
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" DropdownType="DropdownType.ButtonGroup" Items="Items" ShowSplit="true" Color="Color.Primary"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" DropdownType="DropdownType.ButtonGroup" Items="Items" ShowSplit="true" Color="Color.Secondary"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" DropdownType="DropdownType.ButtonGroup" Items="Items" ShowSplit="true" Color="Color.Info"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" DropdownType="DropdownType.ButtonGroup" Items="Items" ShowSplit="true" Color="Color.Warning"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" DropdownType="DropdownType.ButtonGroup" Items="Items" ShowSplit="true" Color="Color.Danger"></Dropdown></div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" DropdownType="DropdownType.ButtonGroup" Items="Items" ShowSplit="true" Color="Color.Primary"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" DropdownType="DropdownType.ButtonGroup" Items="Items" ShowSplit="true" Color="Color.Secondary"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" DropdownType="DropdownType.ButtonGroup" Items="Items" ShowSplit="true" Color="Color.Info"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" DropdownType="DropdownType.ButtonGroup" Items="Items" ShowSplit="true" Color="Color.Warning"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" DropdownType="DropdownType.ButtonGroup" Items="Items" ShowSplit="true" Color="Color.Danger"></Dropdown></div>
</div>
</Block>
<Block Title="尺寸大小定义" Introduction="下拉菜单有各种大小规格可以选用 <code>Size</code> 属性,包括预设及分裂式按钮下拉菜单。">
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Size="Size.ExtraSmall"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Size="Size.Small"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Size="Size.Medium"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Size="Size.Large"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Size="Size.ExtraLarge"></Dropdown></div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Size="Size.ExtraSmall"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Size="Size.Small"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Size="Size.Medium"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Size="Size.Large"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Size="Size.ExtraLarge"></Dropdown></div>
</div>
</Block>
<Block Title="展开方向" Introduction='增加 <code>Direction="Direction.Dropup" </code> 样式,使下拉菜单向上展开。'>
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Direction="Direction.Dropleft"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Direction="Direction.Dropup"></Dropdown></div>
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Direction="Direction.Dropright"></Dropdown></div>
<div class="row g-3">
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Direction="Direction.Dropleft"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Direction="Direction.Dropup"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Direction="Direction.Dropright"></Dropdown></div>
</div>
</Block>
<Block Title="菜单对齐" Introduction='默认情况下一个下拉菜单自动从顶部和左侧的父级100定位。添加.dropdown-menu-right 到.dropdown-menu右侧轻松对齐下拉菜单。'>
<div class="row">
<div class="form-group col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Secondary" MenuAlignment="Alignment.Right"></Dropdown></div>
<div class="col-6 col-sm-4 col-md-3 col-lg-auto"><Dropdown TItem="string" Items="Items" Color="Color.Secondary" MenuAlignment="Alignment.Right"></Dropdown></div>
</div>
</Block>
<Block Title="绑定数据源" Introduction='点击右侧按钮时,下拉框内菜单项会增加'>
<div class="row">
<div class="form-group col-12 col-sm-6">
<div class="row g-3">
<div class="col-12 col-sm-6">
<Dropdown TItem="string" Items="@Foos">
</Dropdown>
</div>
<div class="form-group col-12 col-sm-6">
<div class="col-12 col-sm-6">
<Button @onclick="@AddItem">添加</Button>
<Button @onclick="@RemoveItem" Color="Color.Danger">删除</Button>
</div>
</div>
</Block>
<Block Title="绑定数据源" Introduction="改变选项时,下拉框内菜单项会增加">
<div class="row">
<div class="form-group col-12">
<Radio Items="@RadioItems" OnStateChanged="@OnRadioItemChanged">
</Radio>
<div class="row g-3">
<div class="col-12">
<RadioList TValue="SelectedItem" Items="@RadioItems" OnSelectedChanged="@OnRadioItemChanged">
</RadioList>
</div>
<div class="form-group col-12">
<div class="col-12">
<Dropdown TItem="string" Items="@RadioDropDownItems">
</Dropdown>
</div>

View File

@@ -58,7 +58,15 @@ namespace BootstrapBlazor.Shared.Pages
Foos.Add(new SelectedItem($"{Foos.Count()}", $"城市 {Foos.Count()}"));
}
private Task OnRadioItemChanged(CheckboxState state, SelectedItem item)
private void RemoveItem()
{
if (Foos.Any())
{
Foos.RemoveAt(0);
}
}
private Task OnRadioItemChanged(IEnumerable<SelectedItem> values, SelectedItem item)
{
RadioDropDownItems.Add(new SelectedItem($"{RadioDropDownItems.Count() + 1}", $"城市 {RadioDropDownItems.Count()}"));
StateHasChanged();

View File

@@ -7,12 +7,17 @@
<p><code>EditDialog</code> 组件是 <code>Dialog</code> 组件的扩展,适用于数据弹出窗编辑。</p>
<Tips>
<p>通过调用注入服务 <code>DialogService</code> 的 <code>ShowEditDialog</code> 方法直接弹出编辑对话框,大大减少代码量。<code>EditDialogOption</code> 配置类继承 <code>DialogOption</code>,更多参数设置请点击 <a href="dialogs" target="_blank">[传送门]</a></p>
<p>通过调用注入服务 <code>DialogService</code> 的 <code>ShowEditDialog</code> 方法直接弹出编辑对话框,大大减少代码量。<code>EditDialogOption</code> 配置类继承 <code>DialogOption</code>,更多参数设置请点击 <a href="dialogs" target="_blank">[传送门]</a></p>
</Tips>
<Block Title="基础用法" Introduction="通过绑定 <code>TModel</code> 数据模型,自动生成模型各个字段的可编辑表单">
<Button Text="点击弹出表单编辑弹窗" OnClickWithoutRender="@ShowDialog" />
<Logger @ref="Trace" class="mt-3" />
<Button Text="编辑弹窗(左对齐)" OnClickWithoutRender="@ShowDialog" />
<Button Text="编辑弹窗(右对齐)" OnClickWithoutRender="@ShowAlignDialog" />
<Logger @ref="Trace" class="mt-3" />
</Block>
<Block Title="设置绑定模型部分属性不显示" Introduction="通过设置 <code>IEditorItem</code> 实例的 <code>Editable=false</code>, 实现编辑弹窗不显示此属性">
<Button Text="弹窗" OnClickWithoutRender="@ShowEditDialog" />
</Block>
<AttributeTable Items="@GetAttributes()" Title="EditDialogOption 属性" />

View File

@@ -47,6 +47,71 @@ namespace BootstrapBlazor.Shared.Pages
Title = "编辑对话框",
Model = Model,
Items = items,
ItemsPerRow = 2,
RowType = RowType.Inline,
OnCloseAsync = () =>
{
Trace.Log("关闭按钮被点击");
return Task.CompletedTask;
},
OnSaveAsync = context =>
{
Trace.Log("保存按钮被点击");
return Task.FromResult(true);
}
};
await DialogService.ShowEditDialog(option);
}
private async Task ShowAlignDialog()
{
var items = EditorItem<Foo>.GenerateEditorItems();
var item = items.First(i => i.GetFieldName() == nameof(Foo.Hobby));
item.Data = Foo.GenerateHobbys(Localizer);
var option = new EditDialogOption<Foo>()
{
Title = "编辑对话框",
Model = Model,
Items = items,
ItemsPerRow = 2,
RowType = RowType.Inline,
LabelAlign = Alignment.Right,
OnCloseAsync = () =>
{
Trace.Log("关闭按钮被点击");
return Task.CompletedTask;
},
OnSaveAsync = context =>
{
Trace.Log("保存按钮被点击");
return Task.FromResult(true);
}
};
await DialogService.ShowEditDialog(option);
}
private async Task ShowEditDialog()
{
var items = EditorItem<Foo>.GenerateEditorItems();
var item = items.First(i => i.GetFieldName() == nameof(Foo.Hobby));
item.Data = Foo.GenerateHobbys(Localizer);
// 设置 地址与数量 不可编辑
item = items.First(i => i.GetFieldName() == nameof(Foo.Address));
item.Editable = false;
item = items.First(i => i.GetFieldName() == nameof(Foo.Count));
item.Editable = false;
var option = new EditDialogOption<Foo>()
{
Title = "编辑对话框",
Model = Model,
Items = items,
ItemsPerRow = 2,
RowType = RowType.Inline,
OnCloseAsync = () =>
{
Trace.Log("关闭按钮被点击");
@@ -117,6 +182,27 @@ namespace BootstrapBlazor.Shared.Pages
Type = "Func<Task>",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "ItemsPerRow",
Description = "每行显示组件数量",
Type = "int?",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "RowType",
Description = "设置组件布局方式",
Type = "RowType",
ValueList = "Row|Inline",
DefaultValue = "Row"
},
new AttributeItem() {
Name = "LabelAlign",
Description = "Inline 布局模式下标签对齐方式",
Type = "Alignment",
ValueList = "None|Left|Center|Right",
DefaultValue = "None"
}
};
}

View File

@@ -22,7 +22,7 @@
<EditorItem @bind-Field="@Model.Complete" Editable="false" />
<EditorItem @bind-Field="@Model.Hobby">
<EditTemplate Context="value">
<div class="form-group col-12">
<div class="col-12">
<CheckboxList @bind-Value="@Model.Hobby" Items="@Hobbys" />
</div>
</EditTemplate>
@@ -45,7 +45,7 @@
<EditorItem @bind-Field="@ValidateModel.DateTime" Readonly="true" />
<EditorItem @bind-Field="@ValidateModel.Hobby">
<EditTemplate Context="value">
<div class="form-group col-12">
<div class="col-12">
<CheckboxList @bind-Value="@ValidateModel.Hobby" Items="@Hobbys" />
</div>
</EditTemplate>
@@ -81,10 +81,10 @@
<EditorItem @bind-Field="@Model.Address" />
<EditorItem @bind-Field="@Model.Count">
<EditTemplate Context="value">
<div class="form-group col-6">
<div class="col-12 col-sm-6">
<Select SkipValidate="true" @bind-Value="@Model.Count" Items="@DummyItems" ShowSearch="true" />
</div>
<div class="form-group col-6">
<div class="col-12 col-sm-6">
<BootstrapInput Value="@Model.Count" readonly="true" />
</div>
</EditTemplate>
@@ -115,6 +115,25 @@
</GroupBox>
</Block>
<Block Title="自定义渲染组件类型" Introduction="通过设置 <code>CompnentType</code> 属性值来控制渲染组件类型">
<ul class="ul-demo">
<li><code>Inline</code> 布局模式下通过设置 <code>LabelAlign="Alignment.Right"</code> 使表单内标签右对齐</li>
<li><code>Buttons</code> 模板内可嵌套 <code>div</code> 并设置样式 <code>text-end</code> 使按钮右侧对齐</li>
</ul>
<ValidateForm Model="@Model">
<EditorForm Model="@Model" ItemsPerRow="2" RowType="RowType.Inline" LabelAlign="Alignment.Right">
<FieldItems>
<EditorItem @bind-Field="@Model.Hobby" Data="@Hobbys" />
</FieldItems>
<Buttons>
<div class="text-end">
<Button ButtonType="ButtonType.Submit" Icon="fa fa-save" Text="提交" />
</div>
</Buttons>
</EditorForm>
</ValidateForm>
</Block>
<AttributeTable Items="@GetAttributes()" />
<AttributeTable Title="EditorItem 属性" Items="@GetEditorItemAttributes()" />

View File

@@ -98,6 +98,27 @@ namespace BootstrapBlazor.Shared.Pages
Type = "bool",
ValueList = "true/false",
DefaultValue = "true"
},
new AttributeItem() {
Name = "ItemsPerRow",
Description = "每行显示组件数量",
Type = "int?",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "RowType",
Description = "设置组件布局方式",
Type = "RowType",
ValueList = "Row|Inline",
DefaultValue = "Row"
},
new AttributeItem() {
Name = "LabelAlign",
Description = "Inline 布局模式下标签对齐方式",
Type = "Alignment",
ValueList = "None|Left|Center|Right",
DefaultValue = "None"
}
};

View File

@@ -30,7 +30,7 @@
<p>通过 <code>bind-Value</code> 对 <code>EditorValue</code> 后台属性进行双向绑定,编辑框内进行编辑后点击 <b>完成</b> 按钮,下方文本框内即可显示编辑后结果</p>
<Editor @bind-Value="@EditorValue" OnValueChanged="@OnValueChanged"></Editor>
<label class="control-label mt-3">显示编辑内容:</label>
<label class="form-label mt-3">显示编辑内容:</label>
<textarea class="form-control mt-3">@EditorValue</textarea>
<div class="mt-3">
<Button OnClick="SetValue">Reset</Button>

View File

@@ -0,0 +1,24 @@
@page "/empties"
@inject NavigationManager NavigationManager
<h3>@Title</h3>
<h4>@SubTitle</h4>
<Block Title="基本用法" Introduction="添加 <code>Empty</code> 标签即可">
<Empty />
</Block>
<Block Title="设置空状态图片路径" Introduction="设置 <code>Image</code> 属性即可">
<Empty Image="https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg" Width="133" Text="暂无数据" />
</Block>
<Block Title="自定义空状态模板" Introduction="内套 <code>Template</code> 标签渲染自定义组件">
<Empty Image="_content/BootstrapBlazor.Shared/images/empty.svg">
<Template>
<Button OnClick="@(()=>NavigationManager.NavigateTo("components"))">返回上一页</Button>
</Template>
</Empty>
</Block>
<AttributeTable Items="@GetAttributes()" />

View File

@@ -13,7 +13,7 @@ namespace BootstrapBlazor.Shared.Pages
/// <summary>
///
/// </summary>
public sealed partial class Emptys
public partial class Empties
{
/// <summary>
@@ -26,14 +26,14 @@ namespace BootstrapBlazor.Shared.Pages
///
/// </summary>
[Parameter]
public string? subTitle { get; set; }
public string? SubTitle { get; set; }
/// <summary>
///
/// </summary>
[Inject]
[NotNull]
private IStringLocalizer<Emptys>? localizer { get; set; }
private IStringLocalizer<Empties>? Localizer { get; set; }
/// <summary>
///
@@ -42,15 +42,15 @@ namespace BootstrapBlazor.Shared.Pages
protected override void OnInitialized()
{
base.OnInitialized();
Title = localizer[nameof(Title)];
subTitle = localizer[nameof(subTitle)];
Title = Localizer[nameof(Title)];
SubTitle = Localizer[nameof(SubTitle)];
}
/// <summary>
/// 获得属性方法
/// </summary>
/// <returns></returns>
private IEnumerable<AttributeItem> GetAttributes() => new AttributeItem[]
private static IEnumerable<AttributeItem> GetAttributes() => new[]
{
// TODO: 移动到数据库中
new AttributeItem() {
@@ -61,11 +61,11 @@ namespace BootstrapBlazor.Shared.Pages
DefaultValue = " — "
},
new AttributeItem() {
Name = "Description",
Name = "Text",
Description = "自定义描述信息",
Type = "string",
ValueList = " — ",
DefaultValue = " 暂无描述 "
DefaultValue = "暂无描述"
},
new AttributeItem() {
Name = "Width",
@@ -82,11 +82,18 @@ namespace BootstrapBlazor.Shared.Pages
DefaultValue = " 100 "
},
new AttributeItem() {
Name = "Telemplate",
Name = "Template",
Description = "自定义模板",
Type = "RenderFragment",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "ChildContent",
Description = "子组件",
Type = "RenderFragment",
ValueList = " — ",
DefaultValue = " — "
}
};
}

View File

@@ -1,25 +0,0 @@
@page "/empty"
@namespace BootstrapBlazor.Shared.Pages
@inject NavigationManager NavigationManager
<h3>@Title</h3>
<h4>@subTitle</h4>
<Block Title="基本用法" Introduction="添加 <code>Empty</code> 标签即可">
<Empty />
</Block>
<Block Title="自定义空状态图片路径" Introduction="设置 <code>Image</code> 属性替换默认图片">
<Empty Image="https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg" Width="133" Description="暂无数据" />
</Block>
<Block Title="自定义空状态模板" Introduction="内套 <code>Telemplate</code> 标签渲染自定义组件">
<Empty>
<Telemplate>
<Button OnClick='(()=>NavigationManager.NavigateTo("components"))'>返回上一页</Button>
</Telemplate>
</Empty>
</Block>
<AttributeTable Items="@GetAttributes()" />

View File

@@ -0,0 +1,73 @@
@page "/floatinglabels"
@inject IStringLocalizer<Inputs> Localizer
<h3>FloatingLabel 输入框</h3>
<h4>通过鼠标或键盘输入字符</h4>
<Block Title="基础用法" Introduction="提供基本的文本录入组件">
<FloatingLabel LabelText="Text" TValue="string" />
</Block>
<Block Title="单向绑定数据" Introduction="显示组件内变量值">
<FloatingLabel LabelText="Text" Value="@Model.Name" />
</Block>
<Block Title="客户端验证" Introduction="根据自定义验证规则进行数据有效性检查并自动提示">
<ValidateForm Model="@Model">
<FloatingLabel LabelText="客户端验证" maxlength="5" @bind-Value="@Model.Name" />
</ValidateForm>
</Block>
<Block Title="密码框" Introduction="通过设置属性 <code>type</code> 值为 <code>password</code> 使输入文字后以 <code>*</code> 进行屏蔽的密码输入框">
<p>为了支持更多的文本框属性本组件可以直接写入 <code>type="email"</code> <code>type="number"</code> <code>type="phone"</code> 等 <code>html5</code> 新标准支持的全部属性值,组件未设置 <code>type</code> 值时使用默认的 <code>type="text"</code></p>
<FloatingLabel LabelText="密码框" TValue="string" type="password" maxlength="5" style="width: 200px;" />
</Block>
<Block Title="泛型绑定" Introduction="<code>BootstrapInput</code> 组件双向绑定值是泛型的,本例中双向绑定一个 int 类型数值">
<div class="row g-3">
<div class="col-12 col-sm-6">
<FloatingLabel LabelText="泛型绑定" FormatString="000" step="1" @bind-Value="@Model.Count" />
</div>
<div class="col-12 col-sm-6 align-self-center">
<div class="col-form-label">绑定数值: @Model.Count.ToString("000")</div>
</div>
</div>
</Block>
<Block Title="禁用" Introduction="设置 <code>IsDisabled</code> 属性值为 <code>true</code> 时,组件禁止输入">
<FloatingLabel LabelText="禁用" TValue="string" IsDisabled="true" />
</Block>
<Block Title="自定义格式" Introduction="设置 <code>FormatString</code> 属性值为 <code>yyyy-MM-dd</code> 时,组件显示的时间格式为年月日">
<div class="row g-3">
<div class="col-12 col-sm-6 col-form-label align-self-center">设置 <code class="ms-1">FormatString</code></div>
<div class="col-12 col-sm-6">
<FloatingLabel LabelText="FormatString" Value="DateTime.Now" FormatString="yyyy-MM-dd" IsDisabled="true" />
</div>
<div class="col-12 col-sm-6 col-form-label align-self-center">设置 <code class="ms-1">Formatter</code></div>
<div class="col-12 col-sm-6">
<FloatingLabel LabelText="Formatter" Value="DateTime.Now" Formatter="@DateTimeFormatter" IsDisabled="true" />
</div>
</div>
<p class="mt-3"><code>BootstrapInput</code> 组件绑定 <code>byte[]</code> 数组,格式化成 <code>base64</code> 编码字符串示例</p>
<div class="row g-3">
<div class="col-12 col-sm-6 col-form-label align-self-center">设置 <code class="ms-1">Formatter</code></div>
<div class="col-12 col-sm-6">
<FloatingLabel LabelText="字节数组" Value="@ByteArray" Formatter="@ByteArrayFormatter" IsDisabled="true" />
</div>
</div>
</Block>
<Block Title="密码框" Introduction="使用 <code>BootstrapPassword</code> 组件">
<div class="row g-3">
<div class="col-auto col-form-label align-self-center">
<span>基本用法</span>
</div>
<div class="col-6">
<FloatingLabel LabelText="请输入密码" type="password" TValue="string" />
</div>
</div>
</Block>
<AttributeTable Items="@GetAttributes()" />

View File

@@ -0,0 +1,92 @@
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using BootstrapBlazor.Shared.Common;
using BootstrapBlazor.Shared.Pages.Components;
using System;
using System.Collections.Generic;
namespace BootstrapBlazor.Shared.Pages
{
/// <summary>
///
/// </summary>
public partial class FloatingLabels
{
private string? PlaceHolderText { get; set; }
private byte[] ByteArray { get; set; } = new byte[] { 0x01, 0x12, 0x34, 0x56 };
private static string ByteArrayFormatter(byte[] source) => Convert.ToBase64String(source);
private Foo Model { get; set; } = new Foo() { Name = "张三" };
private static string DateTimeFormatter(DateTime source) => source.ToString("yyyy-MM-dd");
/// <summary>
///
/// </summary>
protected override void OnInitialized()
{
base.OnInitialized();
PlaceHolderText = Localizer["PlaceHolder"];
}
private static IEnumerable<AttributeItem> GetAttributes() => new[]
{
new AttributeItem() {
Name = "ChildContent",
Description = "验证控件",
Type = "RenderFragment",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "ShowLabel",
Description = "是否显示前置标签",
Type = "bool",
ValueList = "true|false",
DefaultValue = "false"
},
new AttributeItem() {
Name = "DisplayText",
Description = "前置标签显示文本",
Type = "string",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "FormatString",
Description = "数值格式化字符串",
Type = "string",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem() {
Name = "Formatter",
Description = "TableHeader 实例",
Type = "RenderFragment<TItem>",
ValueList = " — ",
DefaultValue = " — "
},
new AttributeItem()
{
Name = "type",
Description = "控件类型",
Type = "string",
ValueList = "text / number / email / url / password",
DefaultValue = "text"
},
new AttributeItem()
{
Name = "IsDisabled",
Description = "是否禁用 默认为 fasle",
Type = "bool",
ValueList = "true|false",
DefaultValue = "false"
}
};
}
}

Some files were not shown because too many files have changed in this diff Show More