Compare commits

...

1338 Commits

Author SHA1 Message Date
Vladimir Enchev
f3b706bcc2 themes updated 2023-02-13 14:37:36 +02:00
Vladimir Enchev
2a57af944f Version updated 2023-02-13 14:30:38 +02:00
Sergiu Ciudin
3f42b93300 Fixed DatePicker Kind getting lost when type is DateTime (#807)
* Update RadzenDatePicker.razor.cs

Fixed DatePicker Kind getting lost when type is DateTime

* Fixed DatePicker Kind getting lost when type is DateTime

* Update RadzenDatePicker.razor.cs

The right version

* Probably i should check type also
2023-02-13 14:27:50 +02:00
Vladimir Enchev
59a58eb886 DataGrid AllowFilterDateInput property added
Fix #811
2023-02-13 14:04:18 +02:00
yordanov
d91d5bcd9b Add new views to Scheduler demo 2023-02-13 12:01:49 +02:00
yordanov
c6a08c79e1 Fix scheduler planner view overflow 2023-02-13 12:00:52 +02:00
yordanov
d550b65bc7 Update other month and weekend slot styles 2023-02-13 10:34:12 +02:00
yordanov
42418ef393 Update year view styles in material theme 2023-02-13 10:34:12 +02:00
yordanov
12f4156ae0 Refactor year view styles 2023-02-13 10:34:12 +02:00
yordanov
ff58873fcb Refactor timeline view styles 2023-02-13 10:34:12 +02:00
yordanov
925c72f6aa Refactor planner view styles 2023-02-13 10:34:12 +02:00
Paul Ruston
345d853e2d Creation of new views for scheduler 2023-02-13 10:34:12 +02:00
Vladimir Enchev
10b064dc40 Added title to DataFilter with OData 2023-02-10 11:51:42 +02:00
Vladimir Enchev
75a7187a87 DataFilter OData page reworked for source edit 2023-02-10 10:15:18 +02:00
Vladimir Enchev
6182e00c31 code fixed 2023-02-10 10:13:40 +02:00
Vladimir Enchev
e3ba93a6b8 VirtualizationOverscanCount added to DropDown, DropDownDataGrid and ListBox 2023-02-10 09:28:49 +02:00
Vladimir Enchev
109d8cacbc code viewer fixed 2023-02-09 17:40:35 +02:00
Vladimir Enchev
3bcc18f035 DataGrid binding to IQueryable reworked 2023-02-09 17:22:11 +02:00
Vladimir Enchev
92baa1affb Version updated 2023-02-09 15:56:30 +02:00
Vladimir Enchev
32a9457de3 Fixed DataGrid filter popup will not open after column Visible change
`
2023-02-09 15:56:10 +02:00
Vladimir Enchev
32c147fa16 Title, subtitle and class attribute improved for all demos 2023-02-09 15:23:54 +02:00
Vladimir Enchev
d61d75f8bb PublishTrimmed set to false 2023-02-09 09:50:22 +02:00
Vladimir Enchev
eae6cd5396 themes updated 2023-02-09 09:26:04 +02:00
Vladimir Enchev
6f16f230d1 Version updated 2023-02-09 09:04:20 +02:00
Emil Nachev
f458a057e8 Last order date: From OrderByDescending take First (#801)
Last order date: 
From OrderByDescending take First item
or 
from OrderBy take Last item
2023-02-09 08:57:52 +02:00
yordanov
d013300fa3 Update example source tab text and title 2023-02-08 16:01:55 +02:00
yordanov
d6b8394044 Update Support page 2023-02-08 16:01:55 +02:00
yordanov
c1fa630602 Update Get Started page 2023-02-08 16:01:55 +02:00
Emil Nachev
28a03dadaf Update DataGridVirtualizationLoadDataPage.razor (#799) 2023-02-08 14:54:15 +02:00
Vladimir Enchev
29cfc2ea6b Fixed closing dialogs logic
Fix #791
2023-02-08 10:10:31 +02:00
Vladimir Enchev
f4c776f10e Fixed DataGrid filter popup no working correctly after column Visible change runtime 2023-02-07 14:57:15 +02:00
tecxx
04be6bc38b workaround for HTMLEditor innerHTML exception (#728) (#795)
Co-authored-by: Robert Rostek <robert@rostech.at>
2023-02-07 11:36:45 +02:00
Vladimir Enchev
4f0bbeeab0 Fixed DataGridColumn and DataFilterProperty FormatString logic 2023-02-07 11:18:53 +02:00
Vladimir Enchev
5a356a8d75 DataGrid ExpandRows() and CollapseRows() methods added 2023-02-07 09:31:20 +02:00
yordanov
7f35f46eaa Remove invalid --rz-paginator-button-size css variable. Resolves #794 2023-02-06 17:33:17 +02:00
yordanov
ea7be67d83 Update Support page 2023-02-06 16:48:05 +02:00
yordanov
8f0d65766d Update Colors page layout 2023-02-06 16:48:05 +02:00
yordanov
a140f318a2 Update MainLayout padding and remove TOC 2023-02-06 16:48:05 +02:00
yordanov
d0a2d1644f Add ComponentName parameter to RadzenExample 2023-02-06 16:48:05 +02:00
yordanov
e69b153e1c Add initial TOC styles 2023-02-06 16:48:05 +02:00
yordanov
d19d383738 Update Spacing page 2023-02-06 16:48:05 +02:00
yordanov
253f288323 Update Breakpoints page 2023-02-06 16:48:05 +02:00
yordanov
d6ce0536ca Update Button demo page 2023-02-06 16:48:05 +02:00
yordanov
0168c01915 Style RadzenExample tabs and source code editor 2023-02-06 16:48:05 +02:00
Atanas Korchev
7329fec67a Add copy button and error handling. 2023-02-06 16:48:05 +02:00
Atanas Korchev
5fea22294e Update branch name. 2023-02-06 16:48:05 +02:00
Atanas Korchev
669124a6b3 Runnable snippets. 2023-02-06 16:48:05 +02:00
Atanas Korchev
c44d141c07 Add monaco editor. 2023-02-06 16:48:05 +02:00
Atanas Korchev
0b30e00b8c Compile examples. 2023-02-06 16:48:05 +02:00
Vladimir Enchev
1e7bd1bf48 AsODataEnumerable() removed from the demo 2023-02-06 13:02:49 +02:00
Vladimir Enchev
c2c4d6aa02 Version updated 2023-02-06 11:27:07 +02:00
Vladimir Enchev
7e0c64191c DataGrid advanced filter mode reworked with form to handle submit on enter key 2023-02-06 11:24:26 +02:00
Vladimir Enchev
323e4e971a DataGrid advanced filter mode will apply filter on enter key
Fix #786
2023-02-06 10:07:50 +02:00
Vladimir Enchev
99b4f8f8fc Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-02-06 09:53:10 +02:00
Vladimir Enchev
7c1cf76c5c Fixed DialogOptions.CloseDialogOnEsc behavior
Fix #791
2023-02-06 09:52:53 +02:00
Atanas Korchev
305e1b7af6 Paste images as data URI if the UploadUrl property of RadzenHtmlEditor is not set. 2023-02-06 09:46:51 +02:00
Vladimir Enchev
6880a70227 Tabs component select with RenderMode Client should not set display:block
Fix #792
2023-02-06 09:41:39 +02:00
yordanov
0482969755 Add text transform utility css classes 2023-02-02 14:27:46 +02:00
Atanas Korchev
4c9b429dae Update performance demo. 2023-02-02 10:09:16 +02:00
Vladimir Enchev
60b8400e29 DataFilter OData demo should not inherit from DbContextPage 2023-02-01 15:36:01 +02:00
Vladimir Enchev
7260be98d6 Version updated 2023-02-01 15:25:07 +02:00
Vladimir Enchev
be94094de7 DataFilter OData support added 2023-02-01 14:23:06 +02:00
Vladimir Enchev
645077f39b DataGrid VirtualizationOverscanCount property added 2023-01-31 13:55:10 +02:00
Vladimir Enchev
b42940441d Version updated 2023-01-30 12:30:40 +02:00
yordanov
fc7071c04e Update main demos layouts 2023-01-27 19:01:27 +02:00
yordanov
de887a4e3f Generate display utility classes with responsive breakpoints 2023-01-27 15:59:25 +02:00
yordanov
7f629309c7 Add mixin for utility classes with responsive breakpoints 2023-01-27 15:59:25 +02:00
yordanov
fa45e209d5 Add text-align with responsive breakpoints and classes for white-space 2023-01-27 15:59:25 +02:00
Vladimir Enchev
40aec6cd0d Set FilterPopupRenderMode="PopupRenderMode.OnDemand" for various DataGrid examples 2023-01-27 13:58:35 +02:00
Vladimir Enchev
969ae7aeca DataGrid FilterPopupRenderMode Initial improved 2023-01-27 13:50:17 +02:00
Vladimir Enchev
a64bbd34f3 DataGrid advanced filtering demo updated 2023-01-27 13:42:02 +02:00
Vladimir Enchev
79acf83d6f Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-01-27 13:39:54 +02:00
Vladimir Enchev
786e8d0be1 FilterPopupRenderMode default value changed to Initial 2023-01-27 13:39:45 +02:00
Foitn
2757850f28 #748 Added methods to edit a range of rows and cancel a range of rows (#784)
Co-authored-by: DEMCON\MFE <marijn.feijten@demcon.com>
2023-01-27 13:36:48 +02:00
Vladimir Enchev
7c6f39f3b5 DataGrid FilterPopupRenderMode property added with OnDemand as default value 2023-01-27 12:04:00 +02:00
Vladimir Enchev
70723d0437 Fixed RadzenDataFilterProperty FilterTemplate context to be the underling Filter 2023-01-26 15:56:47 +02:00
Vladimir Enchev
bd9b0f798b Version updated 2023-01-26 10:52:35 +02:00
Bruno Silva
0c406b2ad8 Update DataGridInLineEditPage.razor (#783)
After inserting a new object the insert button was disabled.
2023-01-26 09:26:02 +02:00
Vladimir Enchev
822891541c check if event is present 2023-01-25 10:05:47 +02:00
Vladimir Enchev
bf064fd4e3 Added MarkupString support for Accordion item Text property 2023-01-24 15:55:22 +02:00
Vladimir Enchev
6c9e055d42 Added Template support for DropDown and DropDownDataGrid chips 2023-01-24 15:50:14 +02:00
Vladimir Enchev
7455d1bfb2 Fixed popups will steal focus in some cases
Fix #774
2023-01-24 10:29:09 +02:00
yordanov
7b923b6625 Add new series colors to chart's pastel color scheme 2023-01-23 09:59:34 +02:00
Vladimir Enchev
bcd18e9395 Version updated 2023-01-23 09:49:32 +02:00
yordanov
082d577834 Add more series colors 2023-01-23 09:43:33 +02:00
Vladimir Enchev
68bf4f9df3 DataGrid rz-data-row rz-state-disabled updated 2023-01-23 09:43:05 +02:00
Vladimir Enchev
9348698aac DataGrid rz-state-disabled added to rz-data-row 2023-01-23 09:40:14 +02:00
Vladimir Enchev
979025f7d9 Fixed DataGrid columns order not reset when Settings set to null 2023-01-23 09:27:20 +02:00
Vladimir Enchev
9aa09050da Fixed Autocomplete steals focus
#774
2023-01-20 16:29:00 +02:00
Vladimir Enchev
f331de4185 Fixed DataGrid AllowColumnReorder ignored when AllowGrouping is true 2023-01-20 13:38:18 +02:00
Vladimir Enchev
1ce067c854 DropDownDataGrid will render rz-state-disabled class for disabled items 2023-01-20 13:30:50 +02:00
Vladimir Enchev
e6d537f0f8 Set Gap and RowGap as px if specified just as number 2023-01-20 11:31:53 +02:00
Vladimir Enchev
6a69a8d21a Selection and more columns added to DataGrid dynamic data demo 2023-01-20 10:49:41 +02:00
Vladimir Enchev
415cc09a06 Fixed DataGrid will not populate pickable columns if AllowColumnPicking is initially false 2023-01-20 09:26:47 +02:00
Vladimir Enchev
fb482e133e DropDownBase select all should exclude disabled items 2023-01-20 09:13:05 +02:00
Vladimir Enchev
c8134ce2ec Disable select all CheckBox if AllowSelectAll is false 2023-01-20 08:59:37 +02:00
Vladimir Enchev
a59c062dda Version updated 2023-01-20 08:45:16 +02:00
Vladimir Enchev
fe604d3439 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-01-20 08:44:51 +02:00
Vladimir Enchev
53ad8466ad Fixed popups positioning in old and new Edge browsers 2023-01-20 08:44:39 +02:00
yordanov
9e3c844231 Change rz-col selector specificity. Resolves #779 2023-01-19 22:35:34 +02:00
Vladimir Enchev
85a10e7c72 DataList AllowVirtualization property added 2023-01-19 17:09:59 +02:00
Vladimir Enchev
902dc5bdd1 themes updated 2023-01-19 10:27:11 +02:00
yordanov
666cbc9e47 Add --rz-chart-legend-font-size 2023-01-19 10:18:19 +02:00
yordanov
745fae3f76 Update Column and Stack demos 2023-01-19 10:00:36 +02:00
Vladimir Enchev
bb2c4d4c3f Version updated 2023-01-19 09:46:34 +02:00
Vladimir Enchev
f8c8d6725c themes updated 2023-01-19 09:46:27 +02:00
yordanov
54747dc800 Enable wrapping in Stack/Row demo configs 2023-01-18 18:43:04 +02:00
Vladimir Enchev
63b6c0cab4 code fixed 2023-01-18 18:41:27 +02:00
Vladimir Enchev
92c85a0791 demo fixed 2023-01-18 18:37:15 +02:00
Vladimir Enchev
83f47bfe6e Stack demo updated 2023-01-18 18:33:32 +02:00
Vladimir Enchev
2f034e98c0 Stack Wrap property added 2023-01-18 18:29:26 +02:00
Vladimir Enchev
cb416c3583 RadzenRow, RadzenColumn and RadzenStack components added (#777)
* Stack and RadzenRow/RadzenCol components added

* Add responsive breakpoints scss map to utilities

* Add initial layout styles for RadzenRow and RadzenCol

* Update RadzenCol breakpoints and default css class

* Rename rz-col-gap to rz-gap

* RadzenCol Size property added

* RadzenRow Gap and RowGap properties added

* Add spacing utility css classes

* Add RadzenCol offset and order styles

* Update RadzenCol css class names

* Order properties updated to string

* Remove negative margin css classes

* Add zero offset option

* RadzenCol renamed to RadzenColumn

* Fix offset map name

* Add Row and Column demos

* Rename RadzenCol to RadzenColumn

* column order fixed

* RadzenColumn reworked

* Stack Spacing changed to Gap

* stack demo updated

* Add display: none utility class

* Add Breakpoints and Spacing demos and update Layout demos

* Add rz-stack css class and set default gap for stack to --rz-gap

* Update demos

Co-authored-by: yordanov <vasil@yordanov.info>
2023-01-18 18:11:17 +02:00
Vladimir Enchev
584353a240 DataGrid simple filter with menu will not update settings on column filter operator change 2023-01-17 13:10:29 +02:00
Vladimir Enchev
729456c2a0 DataGrid simple filter demo improved 2023-01-17 09:31:43 +02:00
Vladimir Enchev
a02a2e5332 Version updated 2023-01-16 15:58:44 +02:00
Vladimir Enchev
78f0204d86 DropDown/DropDownDataGrid Chips remove button should not be triggered by Form submit on enter 2023-01-16 15:43:32 +02:00
Vladimir Enchev
b76ef5ca80 Second argument added to DataGrid SelectRow() method specifying if RowSelect event should be raised
Fix #769
2023-01-16 09:31:04 +02:00
Vladimir Enchev
788fc01cfb DataGrid expand/collapse should not select the row 2023-01-13 13:19:07 +02:00
Vladimir Enchev
4dc9360b34 DropDownDataGrid Separator property fixed 2023-01-12 18:23:07 +02:00
Vladimir Enchev
6c0e1b7f01 RadzenPanelMenu Multiple property added 2023-01-12 15:55:14 +02:00
Vladimir Enchev
27b91642f2 version updated 2023-01-12 15:08:59 +02:00
Vladimir Enchev
0c7be4b2c7 DropDownDataGrid AllowFilteringByAllStringColumns fixed 2023-01-12 15:08:42 +02:00
Vladimir Enchev
e41ba71828 version updated 2023-01-12 09:27:55 +02:00
paulo-rico
2b2b6b98f1 RadzenDropDownDataGrid - Option to search by individual keywords seperated by a space as per forum entry https://forum.radzen.com/t/dropdowndatagrid-with-multiple-columns/3076 (#768)
Co-authored-by: Paul Ruston <paul.ruston@live.co.uk>
2023-01-11 16:42:16 +02:00
Atanas Korchev
8f6b20abd1 Add Text property to RadzenAlert. 2023-01-10 19:27:45 +02:00
Dave Bagler
21a69c4a61 Add child content example to label API docs. (#766)
This change adds an additional example to show the new child content property for the label component.
2023-01-10 16:06:35 +02:00
Vladimir Enchev
e7b671283a Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-01-10 10:54:17 +02:00
Vladimir Enchev
d46a7a50b5 Label tests fixed 2023-01-10 10:54:09 +02:00
Atanas Korchev
dfae4e0848 The category axis of a bar chart is not visible when the Visible property of the value axis is set to false. 2023-01-10 10:44:21 +02:00
Vladimir Enchev
a0f7e924e5 More Edge checks updated 2023-01-09 11:08:42 +02:00
Vladimir Enchev
fd2f3c7dbe Version updated 2023-01-09 10:42:32 +02:00
Vladimir Enchev
da442dc02b Label ChildContent property added 2023-01-09 09:42:01 +02:00
Magnus Warvik
eaea900100 Fix side dialog width + title (#759)
* Set max-width of left/right side dialogs to 100%

* Use MarkupString for side dialog title (same as normal dialog)
2023-01-09 09:31:06 +02:00
Vladimir Enchev
449662f858 Check for Edge updated 2023-01-09 07:25:10 +02:00
Vladimir Enchev
def2219f41 DataGrid ShowCellDataAsTooltip property added 2023-01-06 11:03:04 +02:00
Vladimir Enchev
4670fc477d DataGrid AllGroupsExpanded property added 2023-01-06 09:19:40 +02:00
Vladimir Enchev
cea4572843 Version updated 2023-01-05 10:51:17 +02:00
Vladimir Enchev
b769d4644a Performance demo update with loading indicator 2023-01-05 09:54:08 +02:00
Vladimir Enchev
3d9b117a74 themes updated 2023-01-05 09:00:34 +02:00
Vladimir Enchev
3b1a5f227e Fixed DropDownBase exception if ValueProperty is named after system type 2023-01-04 15:40:33 +02:00
Vladimir Enchev
a66a2d936e Drag visual not destroyed on group 2023-01-04 15:12:45 +02:00
yordanov
8b5c334d47 Update copyright year 2023-01-04 12:52:00 +02:00
Vladimir Enchev
5597cf6753 performance demo restored to IQueryable 2023-01-04 12:31:53 +02:00
Vladimir Enchev
9d2d83d8d1 demo updated with LoadData 2023-01-04 12:24:55 +02:00
Vladimir Enchev
bc695479fa less records selected for the performance demo 2023-01-04 12:11:29 +02:00
Vladimir Enchev
c0f7f2accd less records selected for the performance demo 2023-01-04 12:04:55 +02:00
Vladimir Enchev
08309d6162 demo code improved 2023-01-04 11:55:09 +02:00
Vladimir Enchev
b217036ad0 DataGrid performance demo added 2023-01-04 11:46:43 +02:00
Vladimir Enchev
a276652cbc added page render time 2023-01-04 11:08:03 +02:00
Vladimir Enchev
39f643330a alignment fixed 2023-01-04 10:47:40 +02:00
Vladimir Enchev
2967cc917c code simplified 2023-01-04 10:47:16 +02:00
Vladimir Enchev
78d22b3165 obsolete code removed 2023-01-04 10:19:20 +02:00
yordanov
989036bdf2 Fix font-size in Scheduler slots 2023-01-03 17:31:30 +02:00
Vladimir Enchev
926e9ff92c Version updated 2023-01-03 11:50:56 +02:00
Vladimir Enchev
4696567514 DataGrid EmptyTemplate not shown when AllowVirtualization is true 2023-01-03 10:57:13 +02:00
Vladimir Enchev
e153a30186 Fixed incorrect culture handling in RadzenDataGridColumn
Fix #755
2023-01-03 10:35:39 +02:00
Vladimir Enchev
e8bbd3dace Fixed Numeric will throw exception on value change with empty string as Format 2023-01-03 10:13:00 +02:00
Vladimir Enchev
d2d1344858 Single expand PanelMenu example added 2023-01-03 09:55:00 +02:00
Vladimir Enchev
6be828079d DataGrid will save Settings on Reset() 2022-12-30 04:59:15 +02:00
Atanas Korchev
7a07a5c646 Prevent text selection during column resizing and grouping. 2022-12-28 14:21:42 +02:00
yordanov
ee649ebeb9 Add MaterialSymbols icon font to demos and update icons demo 2022-12-21 16:41:07 +02:00
yordanov
67fe2a5a67 Add support for different icon fonts via --rz-icon-font-family 2022-12-21 16:38:07 +02:00
yordanov
6ac193c139 Update Material Icons font 2022-12-21 13:34:24 +02:00
Vladimir Enchev
b7492a6dfa Version updated 2022-12-19 16:06:46 +02:00
Atanas Korchev
224e86f673 Change the Min and Max property types of RadzenNumericRangeValidator. 2022-12-19 12:20:30 +02:00
Marco Papst
f014e155d6 Bugfix/side dialog positioning (#754)
* fix side dialog does not use full height when main content is scrollable

* allow scrolling the content of the side dialog in vertical direction
2022-12-19 09:00:03 +02:00
Vladimir Enchev
7aa37cd6cb DataGrid initial column sorting ignores column SortProperty 2022-12-16 16:55:10 +02:00
Vladimir Enchev
b1cc09fcb6 DateTime column added to DataGrid dynamic data demo 2022-12-16 08:58:18 +02:00
Vladimir Enchev
4717293666 Fixed DataGrid Template and EmptyTemplate rendering with composite columns 2022-12-14 18:22:22 +02:00
Vladimir Enchev
a80cd0720f Version updated 2022-12-13 15:27:31 +02:00
Vladimir Enchev
e238676efc Image demo updated 2022-12-13 15:24:44 +02:00
Marco Papst
e1df231137 Feature: Open a Dialog on the side (#739)
* implement side dialog based on DialogService

* extend Dialog sample

* add optional Mask and RIght/Left position for side dialog

* add OpenSideAsync to dialog documentation

* mark Dialog as updated in demos

* add top and bottom position for side dialog

* extend side dialog docs with details to only one open dialog

* reduce default height of top/bottom side dialog

* fix failing test in RadzenNumeric due to NullreferenceException

Co-authored-by: Marco Papst <papst@sma.de>
2022-12-13 13:48:23 +02:00
Vladimir Enchev
f40d10b35c Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2022-12-13 12:37:43 +02:00
Vladimir Enchev
ea20e5445e Check for format in Numeric before replacing digit placeholder 2022-12-13 12:37:35 +02:00
Atanas Korchev
4a6f2dbdc3 Default theme does not load. 2022-12-13 12:30:16 +02:00
Vladimir Enchev
11ff01bc61 Added support for custom numeric formats in Numeric 2022-12-13 11:20:34 +02:00
Atanas Korchev
2a292e6a82 Avoid duplicate CSS loading. 2022-12-13 11:03:02 +02:00
Maxim Becker
dc11242b77 Optimize rendering of chart tooltip (#745)
* Optimize rendering of chart tooltip

* Add performance test
2022-12-12 17:22:48 +02:00
Vladimir Enchev
4ec8f5fc28 Version updated 2022-12-12 15:22:59 +02:00
Vladimir Enchev
690f3ed87c Fixed self-reference hierarchy does not work in LoadData
Fix #740
2022-12-12 15:20:23 +02:00
Vladimir Enchev
04e8f6f2e3 DataGrid column LogicalFilterOperator not saved in Settings
Fix #746
2022-12-12 15:07:55 +02:00
Vladimir Enchev
e96ab86198 DataGrid column HeaderCssClass not applied to header cell 2022-12-12 11:35:26 +02:00
Igor Telheiro
eae010a23b Update RadzenScheduler.razor.cs
Currently there's no easy way to get the current selectedView. This is because the selectedView that gets updated is the field, and not the public property.
The Scheduler.IsSelected is not an easy way to get it, as you need to test every view to get the current one.
Please consider updating the SelectedIndex property or making that SelectedView getter public.
2022-12-12 09:00:25 +02:00
Atanas Korchev
d9d829e37d Change a bit theme registration so RBS can pick it up. 2022-12-09 10:47:50 +02:00
Vladimir Enchev
53680fc774 Version updated 2022-12-08 10:41:21 +02:00
Vladimir Enchev
46b8378297 Fixed virtualized DataGrid sort null ref. exception with bound Settings and LoadData
Fix #733
2022-12-08 10:40:55 +02:00
Vladimir Enchev
a26b4f779e Check for null elements to focus 2022-12-08 09:32:07 +02:00
Vladimir Enchev
c2e8c87f3b Fixed DropdownBase.SelectItem Invalid Cast Exception when using Value Property
Fix #734
2022-12-08 09:28:56 +02:00
yordanov
c99e82bd8e Fix DropDown alignment in Chromium 108 2022-12-07 22:21:15 +02:00
Atanas Korchev
1398e54896 FormSubmit sometimes does not trigger when the model is a record type. 2022-12-07 19:46:10 +02:00
yordanov
2d93e5bb1c Card css variables should be exposed at :root level 2022-12-07 18:46:10 +02:00
Vladimir Enchev
6b901d42f7 Fixed disabled DatePicker can be cleared
Fix #735
2022-12-07 16:57:12 +02:00
Vladimir Enchev
0cc8a968ed Fixed exception with example source code tab 2022-12-07 16:05:03 +02:00
Vladimir Enchev
3f2914c6fa DropDown multi select item inline style removed 2022-12-07 09:41:56 +02:00
Vladimir Enchev
9e01786278 Fixed Dialog el.computedStyleMap is not a function
Fix #732
2022-12-06 14:10:54 +02:00
Vladimir Enchev
78ec625cd5 Version updated 2022-12-05 19:58:42 +02:00
Vladimir Enchev
02855e3ac4 Fixed DataGrid will not display data if EmptyText is set 2022-12-05 19:58:22 +02:00
Vladimir Enchev
2fc65f135d Version updated 2022-12-05 11:36:42 +02:00
Atanas Korchev
88085ca5a6 Change the test to be more accurate. 2022-12-05 11:05:17 +02:00
Vladimir Enchev
fe26a82d66 Fixed RadzenDataGrid EmptyText causes ParameterView instance exception in MAUI
Fixed #https://github.com/radzenhq/radzen-blazor/issues/729
2022-12-05 10:31:19 +02:00
Joseph
e98678b1f7 Allow set language for speech recognition (#730) 2022-12-05 10:17:09 +02:00
Atanas Korchev
ef2b4d785a Support members that differ only in casing. 2022-12-03 19:55:33 +02:00
yordanov
b721f3e3ce Fix nested DataGrid footer background color 2022-12-01 18:02:28 +02:00
Vladimir Enchev
13cc0fc08c Fixed DropDown item can be selected using ENTER key even if disabled
Fix #727
2022-12-01 10:46:38 +02:00
Vladimir Enchev
65fe95d464 version updated 2022-11-30 20:56:17 +02:00
Vladimir Enchev
80a887b0d0 Fixed Radzen.closeAllPopups() 'Cannot read properties of undefined' error 2022-11-30 20:56:09 +02:00
yordanov
bed1915da4 Input should not change font-size under 768px max-width 2022-11-30 18:11:54 +02:00
yordanov
65cde0af99 Move responsive styles for body, header and footer under RadzenLayout component styles. Resolves #724 2022-11-30 18:10:37 +02:00
yordanov
a0a2b8b265 Remove root-font-size variable from scheduler styles 2022-11-30 16:45:56 +02:00
EkaterinaTikhomirova
ed01254c84 Reset DropDown list after selection (#726)
Co-authored-by: ekaterina.tikhomirova <ekaterina.tikhomirova@dsr-corporation.com>
2022-11-30 14:56:39 +02:00
Vladimir Enchev
e03864ac03 Version updated 2022-11-30 12:25:51 +02:00
Vladimir Enchev
83796c5aa4 Fixed DataGrid with 'AllowColumnPicking' and 'AllowColumnReorder' always allows groupings
Fix #725
2022-11-30 12:25:32 +02:00
Atanas Korchev
0e329def1a ColorPicker throws NullReferenceException if it cannot parse its value as a valid color. 2022-11-29 19:36:15 +02:00
Maxim Becker
27859cf183 Add interpolation in RadzenLineSeries to make rendering more generic (#722)
* Add interpolation in RadzenLineSeries to make rendering of them more generic

* Added new lines at end of new files

* Add interpolation in RadzenAreaSeries too

* Revert the Are and Line chart demos. Add a new one.

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2022-11-29 16:15:51 +02:00
Vladimir Enchev
5560e7ee3d DataGrid GridLines property added (#723)
* DataGridGridLines added

* Add initial styles for GridLines

* Use child combinator to style first-level gridlines only

* Add style selectors for gridlines with composite cells

Co-authored-by: yordanov <vasil@yordanov.info>
2022-11-29 15:56:05 +02:00
Vladimir Enchev
72bab915b1 Fixed DataGrid filter popup closes on scrolling of DataGrid placed in column FIlterTemplate 2022-11-29 15:54:29 +02:00
Greg Horvath
f5fefcdd55 Implemented stand alone speech to text component (#703)
* Implemented stand alone speech to text component radzenhq#699 radzenhq#700

* Addressed radzenhq#703 PR review comments.

* radzenhq#703 Changed position of default title and aria-label attributes so caller can override them.

* radzradzenhq#703 Added unit test for verify default title and aria-label can be overridden.

* radzradzenhq#703 Added speech recognication error handling.  Minor refactor to toggleDictation js function.

* Refactor the implementation of toggleDictation. Change the class name. Use the Reference inherited from RadzenComponent. Other smaller changes.

* Check what component started the speech recording.

* Update speech to text button styles

* Remove important rule

* Update demo and add it to main menu

* Add StopIcon, Title and StopTitle properties. Remove console logging.

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
Co-authored-by: yordanov <vasil@yordanov.info>
2022-11-29 15:06:37 +02:00
Atanas Korchev
160634ea38 Fix the installation article. 2022-11-29 13:59:12 +02:00
Vladimir Enchev
50fb5a96d8 DropDown enum example fixed to work in WASM 2022-11-29 13:10:54 +02:00
Vladimir Enchev
79c7ea16d8 DropDownBase will use Display attribute of Enum 2022-11-29 12:49:11 +02:00
Atanas Korchev
a166db0ea1 Revert "Add black friday banners"
This reverts commit 0c4e92ebec.
2022-11-29 08:24:58 +02:00
Vladimir Enchev
2b905615d1 test fixed 2022-11-28 20:30:06 +02:00
Vladimir Enchev
a18c1b5e0c version updated 2022-11-28 20:21:09 +02:00
Vladimir Enchev
c066043ceb Fixed Chart ValueProperty does not accept decimal
DynamicExpressionParser will be used for indexer only
2022-11-28 20:21:01 +02:00
Vladimir Enchev
41d64f1b7c Version updated 2022-11-28 13:03:44 +02:00
Vladimir Enchev
36023fdc35 Fixed DropDownBase exception with property names named after system types 2022-11-28 13:03:24 +02:00
Atanas Korchev
8437cf279d Update instructions for .NET 7. 2022-11-28 10:54:26 +02:00
Vladimir Enchev
d2e19cf3c7 DataFilter initial FilterOperator of filters added runtime fixed 2022-11-28 09:31:58 +02:00
Atanas Korchev
9a90be6e79 Create ci.yml 2022-11-26 09:02:52 +02:00
Atanas Korchev
903a4c78e2 Cannot select listbox item if ValueProperty is a string property. 2022-11-26 08:52:17 +02:00
Atanas Korchev
19049bfea8 Fix failing tests. 2022-11-26 08:51:50 +02:00
yordanov
0c4e92ebec Add black friday banners 2022-11-25 11:41:49 +02:00
Vladimir Enchev
aefe937adc DataGrid nested filter popups close fixed 2022-11-25 09:38:20 +02:00
Vladimir Enchev
63eda04815 DataGrid will display localized enum values in cells from Display attribute if present 2022-11-25 08:46:21 +02:00
Atanas Korchev
18c7783942 Reset the state during paging, sorting and filtering. 2022-11-25 06:57:28 +02:00
Vladimir Enchev
6c17e1e9c5 more broken links fixes 2022-11-24 21:51:47 +02:00
Vladimir Enchev
955355460e various broken links fixed 2022-11-24 21:43:06 +02:00
Vladimir Enchev
51a110b9a3 Fixed filtering of DataFilter with IEnumerable property 2022-11-24 15:26:14 +02:00
Atanas Korchev
43da6c3656 Compatibility with RBS. 2022-11-24 11:54:51 +02:00
Vladimir Enchev
411c916a26 RadzenLink ChildContent reworked 2022-11-24 11:31:25 +02:00
Vladimir Enchev
c0cc14ec99 Image url fixed 2022-11-24 11:23:21 +02:00
Vladimir Enchev
4f8dd8844c Link ChildContent support added 2022-11-24 11:23:10 +02:00
Vladimir Enchev
36f8f43aad Version updated 2022-11-24 10:00:24 +02:00
Zak Kohler
534d7f570e Fix typos in documentation (#718) 2022-11-23 07:26:59 +02:00
Vladimir Enchev
599e514afc DialogService.OpenAsync will not execute Radzen.openDialog() when options.ChildContent is set
Fix #717
2022-11-22 16:31:05 +02:00
Vladimir Enchev
42054827a2 seed reworked 2022-11-22 15:27:09 +02:00
Vladimir Enchev
bfe517ef75 docs links fixed 2022-11-22 10:07:02 +02:00
Vladimir Enchev
c585f3455d Component source links fixed 2022-11-22 09:56:27 +02:00
Vladimir Enchev
fe1d3dd82b Only RadzenExample Name property should be used to display source of the example page.
Source property should be used to link source code of the component.
2022-11-22 09:41:20 +02:00
yordanov
92d503335b Add scrollbar size. Resolves #675 2022-11-21 19:14:58 +02:00
Atanas Korchev
782f93169d Fix links to Dialog and Layout source. 2022-11-21 19:08:38 +02:00
Vladimir Enchev
0c12177091 Fixed focus lost with DropDown/DropDownDataGrid with AllowFiltering 2022-11-21 17:40:48 +02:00
Vladimir Enchev
cc90ff97e3 code fixed 2022-11-21 16:51:05 +02:00
Vladimir Enchev
525230cf2d RadioButtonList from HorizontalAlign enum demo added 2022-11-21 12:15:21 +02:00
Vladimir Enchev
2df9ef3fca Version updated 2022-11-21 11:55:57 +02:00
Vladimir Enchev
9de1b6d9d2 HtmlEditor not focused in dialog with AutoFocusFirstElement
Fix #714
2022-11-21 11:45:12 +02:00
yordanov
94b096259a Update docs templates and demos homepage 2022-11-18 15:22:02 +02:00
yordanov
4e7011f12b Update READMEs 2022-11-18 15:21:10 +02:00
yordanov
ff123ddcb4 Introducing Radzen Blazor Studio 2022-11-18 14:41:09 +02:00
aalex675
9d98fefdef Fix: PropertyAccess.Getter method doesn't allow access of array members. Change to use DynamicExpressionParser.ParseLambda from Linq. (#713)
Co-authored-by: Alden Alexander <aalexander@bachelorcontrols.com>
2022-11-18 10:54:40 +02:00
Atanas Korchev
573bddb1ae Cannot set the style of RadzenAccordion. 2022-11-18 08:58:07 +02:00
Vladimir Enchev
8386848e0e Fixed e.target.closest is not a function
Fix #712
2022-11-17 13:50:06 +02:00
Vladimir Enchev
5ba0220a74 Added CSS class "rz-group-row" to DataGrid group rows 2022-11-16 18:29:22 +02:00
Vladimir Enchev
d24cadcf00 Menu child items cannot be opened with click once closed when ClickToOpen=false 2022-11-16 14:18:24 +02:00
Vladimir Enchev
fbe53df424 Menu clickToOpen option removed from the demo 2022-11-16 13:28:42 +02:00
Vladimir Enchev
eb0347073e Version updated 2022-11-16 13:17:37 +02:00
for7raid
45907bdcca Split button improvements (#709) 2022-11-16 11:49:04 +02:00
Vladimir Enchev
b5b8aaf731 Menu ClickToOpen behavior fixed 2022-11-16 11:06:35 +02:00
Vladimir Enchev
d4eb749729 Version updated 2022-11-15 13:46:14 +02:00
Vladimir Enchev
3e09882b0c RadzenMenu ClickToOpen property added (#706) 2022-11-15 13:44:49 +02:00
Vladimir Enchev
a443b57ead Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2022-11-15 13:11:13 +02:00
Vladimir Enchev
3a430b3586 DataGrid load settings fixed with filter and paging 2022-11-15 13:11:05 +02:00
EkaterinaTikhomirova
f09f8ba4eb Add parameter in RadzenDropDown to clear search input after selection. (#705)
Co-authored-by: ekaterina.tikhomirova <ekaterina.tikhomirova@dsr-corporation.com>
2022-11-15 12:44:44 +02:00
Vladimir Enchev
c6a1560a0f DropDown item select in multi select changed from SPACE to ENTER key to allow entering space during filter 2022-11-15 12:42:55 +02:00
Vladimir Enchev
805f596f1f Fixed DataGrid second filter in advanced mode 2022-11-15 09:14:48 +02:00
Vladimir Enchev
bcee601d4c Exception fixed 2022-11-15 08:57:51 +02:00
Vladimir Enchev
ea009e802b Version updated 2022-11-14 17:36:58 +02:00
Vladimir Enchev
e421eaaf1a DataGrid group row expression fixed 2022-11-14 17:36:41 +02:00
Vladimir Enchev
997cd88db8 Employees images fixed 2022-11-14 16:48:13 +02:00
Vladimir Enchev
ccc8fbde05 Radzen.Blazor version updated 2022-11-14 13:19:42 +02:00
Vladimir Enchev
0fdf7721a7 readme updated 2022-11-14 13:19:09 +02:00
Vladimir Enchev
96f1863711 WebAssembly version of demos added (#704)
* Demos as WASM

* Copy the default wasm loading CSS.

* InMemory database instead SQLite

* DbContext filled with data

* Host project added

* Server renamed to Host

* Remove location.reload.

* Remove startup.

* Stop github caching to file. Use larger page size to improve load time.

* Display enum values.

* DbContext with static data

* Host DbContex added

* Examples and Sitemap added

* docker updated

* Theme changing.

* Update Dockerfile

* Set WORKDIR.

* Do not throw errors for duplicate assets.

* Do not inherit Index from DbContextPage

* Documentation works again.

* Sqlite removed from host

* DataGrid Save/Load settings fixed

* Demo source fixed

* Add loading.

* Add loading image

* Hide the loading with JS interop.

* Add the loading globally.

* Add server demos.

* Delete data files.

* Remove the db copy code from Dockerfile.

* DbContext seed fixed

* missing await added

* Separate solutions for all project, Blazor server and Blazor WebAssembly added

* tree demos data access fixed

* Avoid using Last() and First()

* Orders and OrderDetails data made smaller

* Update loading animation

* Move the loading to MainLayout.

* Update loading animation speed

* Seed() improved

* Revert "Move the loading to MainLayout."

This reverts commit f43ce050396b9483e8809af35493eb35531f254c.

* Fix homepage bg color with dark theme

* Revert "Revert "Move the loading to MainLayout.""

This reverts commit faee40d4ad92f474577434c61f31d847e6777a53.

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
Co-authored-by: yordanov <vasil@yordanov.info>
2022-11-14 13:14:47 +02:00
Vladimir Enchev
ea9c7543d9 Fixed class attribute should not override default Css class for Accordion, CheckBoxList and RadioButtonList items
Fix #698
2022-11-14 10:56:21 +02:00
Vladimir Enchev
b69a02c878 Fixed showing tooltip on RadionButtonListItem and CheckBoxListItem 2022-11-14 08:52:39 +02:00
msdevcode
4d9c792a25 LayoutPage - Tab "Source" fix (#693) 2022-11-11 17:43:08 +02:00
yordanov
7a6992845a Update Layout demo 2022-11-11 14:05:51 +02:00
Vladimir Enchev
f2deb8f402 Dynamic and version updated 2022-11-10 15:11:11 +02:00
Vladimir Enchev
c067b162b9 Fixed possible exception with SelectBar in .NET 7 2022-11-10 15:10:59 +02:00
Vladimir Enchev
f1415d7583 Fixed DropDown error on KeyPress "Delete"
Fix #691
2022-11-10 14:59:39 +02:00
Atanas Korchev
14f23e79f1 Demonstrate RadzenLayout 2022-11-10 11:51:42 +02:00
Atanas Korchev
a5a55e207c The argument of the ResetPassword event is empty. 2022-11-09 18:05:44 +02:00
Vladimir Enchev
990337e4f4 Version updated 2022-11-09 10:05:20 +02:00
Vladimir Enchev
c35cce7b34 Fixed onmouseenter incompatibility with .NET 7.0
Fix #689
2022-11-09 09:02:48 +02:00
Vladimir Enchev
cb36e60af7 sdk path changed 2022-11-08 19:19:24 +02:00
Vladimir Enchev
65baef92b1 .NET 7 support added 2022-11-08 19:16:34 +02:00
Vladimir Enchev
c624db6833 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2022-11-08 17:14:24 +02:00
Vladimir Enchev
8aed964f47 DatePicker current day "rz-datepicker-currentday" CSS class added
Fix #688
2022-11-08 17:13:44 +02:00
Daniel Nutu
3874cb93e1 fix quotation marks for alert component (#686)
Co-authored-by: DanielNutu <daniel.nutu@kyndryl.com>
2022-11-08 16:57:02 +02:00
Vladimir Enchev
f966d7ab99 Fixed DataGrid ignores sort order when data takes long to load
Fix #687
2022-11-08 16:56:20 +02:00
Vladimir Enchev
2079705626 DatePicker AM/PM buttons style fixed 2022-11-08 09:51:55 +02:00
Atanas Korchev
e0a56d350b Improve support for cases when all RadzenChart series values are negative. Fixes #685. 2022-11-08 09:24:35 +02:00
David Tosi
181aa4f43b Added click event support to the popup Notification Message. (#682)
Co-authored-by: David Tosi <davidtosi@inphonite.com>
2022-11-08 09:24:25 +02:00
Vladimir Enchev
302ba9be44 version updated 2022-11-07 09:56:33 +02:00
Vladimir Enchev
77422c8dda DropDown examples separated 2022-11-04 16:20:31 +02:00
Vladimir Enchev
eead43e0d9 Use getter instead reflection in DropDownBase 2022-11-04 15:09:13 +02:00
Vladimir Enchev
87927d04aa DataGrid settings not saved properly on simple DateTime filter 2022-11-04 14:44:59 +02:00
Vladimir Enchev
aa1b4b2785 Fixed SelectBar items will not show tooltip 2022-11-04 14:31:39 +02:00
Vladimir Enchev
a7f1d7181d DropDownBase will keep selected items by value if ValueProperty is set 2022-11-04 14:11:55 +02:00
Vladimir Enchev
c4a50efa43 version updated 2022-11-03 17:32:35 +02:00
Vladimir Enchev
b30f7d95e2 Dialog Draggable=true fixed 2022-11-03 17:32:13 +02:00
mafei1982
845b8aac1b Fix issue #680 (#681)
* fix issue #673 When trying to filter on a property from parent interface (Current Titem type is also an interface), the FilterPropertyType is null

* rename the private method

* Fix the refactor issue

* Fix issue #680
2022-11-03 13:52:19 +02:00
Vladimir Enchev
d449469a99 DialogService Alert dialog added 2022-11-03 11:28:56 +02:00
Vladimir Enchev
776ae01c7b Close all popups on dialog open 2022-11-03 09:38:58 +02:00
Vladimir Enchev
a9951fc624 DataGrid Save/Load settings with enum filtering fixed
Fix #677
2022-11-02 17:16:26 +02:00
Vladimir Enchev
d8dfcd9cf7 version updated 2022-11-02 09:01:09 +02:00
mafei1982
fac6744ead Fix the missing call to get the type of the property for the interface (#676)
* fix issue #673 When trying to filter on a property from parent interface (Current Titem type is also an interface), the FilterPropertyType is null

* rename the private method

* Fix the refactor issue
2022-11-02 08:39:26 +02:00
Vladimir Enchev
0a539d1328 DataGrid self-ref hierarchy filtering fixed 2022-11-01 20:03:25 +02:00
Vladimir Enchev
3e137d1c0e Tree item expanded state cannot be changed when bound to model
https://forum.radzen.com/t/ontreenodecollapse-backfires-to-ontreenodeexpand-immediately/12122
2022-11-01 16:19:40 +02:00
Vladimir Enchev
8391556f8f code refactored 2022-11-01 11:18:39 +02:00
mafei1982
365374e73e fix issue #673 When trying to filter on a property from parent interf… (#674)
* fix issue #673 When trying to filter on a property from parent interface (Current Titem type is also an interface), the FilterPropertyType is null

* rename the private method
2022-11-01 11:09:56 +02:00
Vladimir Enchev
19a118c096 themes updated 2022-10-31 16:32:15 +02:00
Vladimir Enchev
62a5505c9d disclaimer restored 2022-10-31 16:22:54 +02:00
Vladimir Enchev
60dcb66805 MaterialDark and Fluent themes updated 2022-10-31 16:20:23 +02:00
Vladimir Enchev
51e6306c19 Version updated 2022-10-31 12:01:23 +02:00
yordanov
683453f63a Update alert close button shades 2022-10-31 11:56:26 +02:00
yordanov
366e042c60 Add base-styles-map to dark theme 2022-10-31 11:56:26 +02:00
yordanov
e599d96b7f Update Alert message margins in different sizes 2022-10-31 11:56:26 +02:00
Vladimir Enchev
6f3fde82ef Close button size improved 2022-10-31 11:56:26 +02:00
yordanov
8ba561b55b Add --rz-alert-icon-size 2022-10-31 11:56:26 +02:00
Vladimir Enchev
79ac8e8cd8 Alert ShowIcon property added 2022-10-31 11:56:26 +02:00
yordanov
cb809156f2 Update Alert icons 2022-10-31 11:56:26 +02:00
Vladimir Enchev
d8aa4dde98 getIcon() fixed 2022-10-31 11:56:26 +02:00
yordanov
938fd759c1 Update Alert icons and close button colors 2022-10-31 11:56:26 +02:00
yordanov
2740f54331 Add base, light and dark styles to Alert 2022-10-31 11:56:26 +02:00
Vladimir Enchev
6f929e48b8 example name fixed and docs link removed 2022-10-31 11:56:26 +02:00
yordanov
308db7888a Add Alert Styling demo 2022-10-31 11:56:26 +02:00
yordanov
657a5c5416 Add AlertSize and update scss 2022-10-31 11:56:26 +02:00
Vladimir Enchev
d12f3921f9 code fixed 2022-10-31 11:56:26 +02:00
Vladimir Enchev
601957ba2a Alert Icon property added. Different Icon and close button depending on AlertStyle 2022-10-31 11:56:26 +02:00
yordanov
e12ffb1a75 Add more examples to Alert demo 2022-10-31 11:56:26 +02:00
yordanov
25543b363b Add initial Alert styling 2022-10-31 11:56:26 +02:00
yordanov
3e8ab559b2 Update Alert links in demos navigation 2022-10-31 11:56:26 +02:00
Vladimir Enchev
9059f3f60b Alert component added 2022-10-31 11:56:26 +02:00
Atanas Korchev
aa4ce25bda RadzenLogin does not fire the Login event. Fixes #670. 2022-10-28 20:59:13 +03:00
Atanas Korchev
5ecd9e0782 Setting Stroke of RadzenGridLines has no visual effect. Fixes #669. 2022-10-28 10:20:32 +03:00
Vladimir Enchev
ba84cc7ea6 DropDown/AutoComplete PopupStyle property added instead PopupHeight 2022-10-28 09:20:04 +03:00
Vladimir Enchev
7edae77736 DropDown/AutoComplete PopupHeight property added 2022-10-27 18:22:42 +03:00
Vladimir Enchev
b5f414623e version updated 2022-10-27 09:41:52 +03:00
yordanov
58c92c94f6 Fix 'remember me' margin in Login 2022-10-27 09:37:01 +03:00
yordanov
3f0509b0b9 Remove absolute position of rz-messages-error and width of components in rz-form 2022-10-27 09:23:14 +03:00
yordanov
33858d2679 Fix chart axis font-size 2022-10-26 16:01:40 +03:00
Vladimir Enchev
5d3b4fab0b re-subscribe to FilterValueChange on property change 2022-10-26 15:46:17 +03:00
Vladimir Enchev
6f998cffe9 Member access of interface properties fixed
Fix #665
2022-10-26 15:33:19 +03:00
yordanov
1f520b904f Add margin to remember me switch 2022-10-26 13:18:19 +03:00
yordanov
94c49deaf7 Fix Switch hover outline in material theme 2022-10-26 12:20:49 +03:00
yordanov
4360896634 Add vertical-align: middle to RadzenLabel 2022-10-26 12:16:58 +03:00
yordanov
8513edc118 Add vertical-align: middle to Switch 2022-10-26 12:16:27 +03:00
Atanas Korchev
6dc08ede91 Implement AllowRememberMe functionality in RadzenLogin. 2022-10-26 10:47:28 +03:00
Vladimir Enchev
8f05520c2f Fixed DropDownBase SelectItem() will not work properly in case of IEnummerable with nullable element type 2022-10-25 18:42:30 +03:00
yordanov
0c3878a8fc Improve dialog responsiveness and refactor styles 2022-10-25 09:58:08 +03:00
Vladimir Enchev
e0d9fa6e95 Fixed DataGrid Groups not loaded properly from settings
Fix #664
2022-10-25 09:00:48 +03:00
yordanov
ef5f613b0b Update material dialog content padding and title 2022-10-24 17:41:36 +03:00
Vladimir Enchev
8617557084 Version updated 2022-10-24 17:38:32 +03:00
Vladimir Enchev
55c0fe05cc Fixed virtualized DataGrid exception with LoadData 2022-10-24 17:38:14 +03:00
yordanov
bdaaa9643e Remove duplicate styles of rz-helper-hidden-accessible 2022-10-24 14:09:29 +03:00
yordanov
883ab83c91 Fix box-sizing and trimmed dropdown label with bootstrap 4.6. Resolves #662 2022-10-24 13:18:44 +03:00
Vladimir Enchev
6df9a499ef Version updated 2022-10-24 11:07:10 +03:00
yordanov
2bbb6919b6 Fix initial width of dropdown. Related to #662 2022-10-24 10:44:18 +03:00
Vladimir Enchev
44e0102073 Get first element type only for in-memory data 2022-10-24 09:55:00 +03:00
Vladimir Enchev
a772a2dd51 Fixed DropDownBase support for non generic IEnumerable
Fix #657
2022-10-24 09:26:11 +03:00
Vladimir Enchev
8cd812cf33 DataGrid PageSizeChanged event added 2022-10-24 09:14:10 +03:00
msdevcode
dbf30f4869 Tabindex depending on Disabled-property (#656) 2022-10-24 07:37:04 +03:00
Atanas Korchev
3b5ec52a06 Add ability to customize the scheduler week view header text. 2022-10-23 19:00:24 +03:00
Vladimir Enchev
740e39fb46 Social OnAfterRender changed to OnAfterRenderAsync 2022-10-21 16:34:10 +03:00
Vladimir Enchev
44fff4fc0a Version updated 2022-10-21 16:18:11 +03:00
Vladimir Enchev
acc3a0c9d4 DataFilter FilterProperty FilterOperator change fixed 2022-10-21 16:17:35 +03:00
yordanov
e9f7f9d027 Update width of pickers in datafilter 2022-10-21 15:38:14 +03:00
Vladimir Enchev
3ff9bcf853 Version updated 2022-10-21 10:18:46 +03:00
Vladimir Enchev
18dd011a84 Fixed DataGrid numeric filter will not save settings
Fix #654
2022-10-21 10:10:28 +03:00
Vladimir Enchev
5ccfd4e838 Fixed DataGrid raising twice RowClick/CellClick/RowSelect on double click 2022-10-21 10:00:13 +03:00
Vladimir Enchev
b0baad56e7 DropDown binding and rendering optimized 2022-10-20 19:10:39 +03:00
Vladimir Enchev
0732938d1d Version updated 2022-10-20 10:02:12 +03:00
yordanov
1df2d8da9b Use correct label padding scss variable in dropdown 2022-10-20 09:57:11 +03:00
Vladimir Enchev
dfdc7567f5 DropDownDataGrid chips rendering improved 2022-10-20 09:54:30 +03:00
Vladimir Enchev
3453b7f84c DataFilter FilterTemplate fixed 2022-10-19 13:47:04 +03:00
yordanov
59137196c6 Change dropdown display to inline-flex 2022-10-19 10:49:57 +03:00
Vladimir Enchev
8d686da3fb DataGrid in-line demo improved
Fix #652
2022-10-19 09:31:03 +03:00
Vladimir Enchev
10aa459ebd Fixed Tree will not hide expand/collapse icon when HasChildren changed runtime 2022-10-18 19:34:27 +03:00
msdevcode
a3737624fe Radzen.Blazor.Tests-Project fix (#649) 2022-10-17 21:31:57 +03:00
Vladimir Enchev
70dd7d8744 DataFilter documentation link removed 2022-10-17 15:44:21 +03:00
Vladimir Enchev
8d52a98504 Version updated 2022-10-17 14:47:48 +03:00
yordanov
994166c88f Fix gutter width in dark theme 2022-10-17 13:11:44 +03:00
yordanov
2a9252b53b Add borders to composite cells 2022-10-17 13:04:57 +03:00
Vladimir Enchev
e8ff2a36be Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2022-10-17 11:50:24 +03:00
Vladimir Enchev
9ac700b758 rz-grid-table-composite added in case of composite columns 2022-10-17 11:42:06 +03:00
yordanov
1bf994384d Fix spacing between css classes 2022-10-17 11:36:17 +03:00
yordanov
0258389b61 Update number of components 2022-10-17 11:06:11 +03:00
yordanov
8491807987 Update package tags 2022-10-17 10:54:03 +03:00
Vladimir Enchev
e95d07fee1 Fixed virtualized DataGrid bound with LoadData not scrolled to top on sort 2022-10-17 09:49:01 +03:00
Vladimir Enchev
7b0d07e116 DataGrid second filter value not saved properly in Settings 2022-10-17 09:18:19 +03:00
msdevcode
5228ed8543 RadzenSelectBar - RadzenSelectBarItem add disabled-property (#647) 2022-10-17 09:15:06 +03:00
Vladimir Enchev
8f5550576f Fixed DataGrid save settings in case of column FIlterTemplate 2022-10-14 10:09:19 +03:00
Vladimir Enchev
c51e4b5411 Fixed DataGrid paging with Settings when bound with LoadData and
Fix #644
2022-10-14 09:55:42 +03:00
yordanov
ef3918f50c Fix PanelMenu expand/collapse with ripple 2022-10-13 16:57:29 +03:00
Vladimir Enchev
2b29e5371d Version updated 2022-10-13 08:49:58 +03:00
Vladimir Enchev
249815607e Fixed DataGrid groups not saved properly in Settings
Fix #642
2022-10-13 08:48:58 +03:00
Vladimir Enchev
b9f9138ae4 DropDown with groups demo filtering fixed
Fix #641
2022-10-12 08:57:41 +03:00
Vladimir Enchev
00296bacf2 DataGrid grouping API demo improved 2022-10-11 12:05:13 +03:00
Vladimir Enchev
18e6771fcc Delay added to TooltipOptions 2022-10-11 10:21:59 +03:00
yordanov
0c8131ebb3 Fix icon alignment in fieldset legend 2022-10-10 15:27:39 +03:00
Vladimir Enchev
831f0209ae Map demo update with InfoWindow 2022-10-10 15:18:36 +03:00
Vladimir Enchev
488fc2719f Fixed collection was modified exception in DropDownDataGrid
Fix #639
2022-10-06 16:35:49 +03:00
yordanov
ba98d6dfef Show up down arrows in Numeric with text-align 2022-10-06 09:45:10 +03:00
Vladimir Enchev
45d9b69191 version updated 2022-10-06 09:41:19 +03:00
yordanov
5205c94c73 Update Dialog demos 2022-10-06 09:35:25 +03:00
Vladimir Enchev
953bc6370a Tree Collapse event added 2022-10-06 09:14:41 +03:00
Ernesto Roque
7ffd7b10f5 adding Chips support to DropDownDataGrid (#637) 2022-10-06 08:50:59 +03:00
Vladimir Enchev
2a054bce6e Numeric CSS classes fixed 2022-10-05 18:32:42 +03:00
yordanov
de1ed66aaa Fix numeric input right padding 2022-10-05 17:44:51 +03:00
yordanov
caeeee9109 Update validation styles in Login component 2022-10-05 17:31:24 +03:00
Vladimir Enchev
3c9368b05f DataGrid save/load Settings for PageSize change fixed
Fix #633
2022-10-04 09:58:39 +03:00
yordanov
e31567727a Update project icon 2022-10-04 09:39:46 +03:00
nanocortex
7b761c50d7 Add Separator parameter to Dropdown (#631) 2022-10-03 20:19:00 +03:00
Vladimir Enchev
11306a3ce5 Version updated 2022-10-03 17:18:18 +03:00
yordanov
9d23d4df1f Update DataGrid inline editing demo 2022-10-03 16:34:28 +03:00
yordanov
45c35d1d37 DataGrid Density styles and demo 2022-10-03 15:48:29 +03:00
Vladimir Enchev
7b1c7cbcb2 DataGrid Density property added 2022-10-03 15:05:28 +03:00
Vladimir Enchev
01b4431627 DataGrid simple filter row frozen cells class fixed 2022-10-03 14:39:41 +03:00
yordanov
70b478a4b7 Add ExtraSmall button size 2022-10-03 12:10:07 +03:00
Christian Gräfe
6e7d227504 Added Text-Align to RadzenNumeric (#627) 2022-10-03 10:33:35 +03:00
Charles-André Beaudry
962afaf613 [Docs] Fix miscellaneous annoyances in the docs (#622)
* Adjust indentation

* Remove html leftovers?
2022-10-03 10:32:37 +03:00
Vladimir Enchev
ad0ba5d3bf CheckBoxList AllowSelectAll and SelectAllText properties added
Fix #628
2022-10-03 10:31:35 +03:00
Vladimir Enchev
6c729deb77 Tooltip will execute TooltipService.Close when closing on outside click or duration 2022-09-30 11:15:59 +03:00
Vladimir Enchev
0e887d8b28 ContextMenu will execute ContextMenuService.Close event when clicking outside 2022-09-30 11:08:41 +03:00
Vladimir Enchev
8fdaf68707 Fixed DataGrid filtering by bool column will not save settings 2022-09-30 10:13:10 +03:00
Atanas Korchev
0bbbf70e81 Update premium themes. 2022-09-29 17:55:29 +03:00
yordanov
1342c306a3 Add updated tag to Menu demos 2022-09-29 17:38:26 +03:00
yordanov
8890ae4520 Fix tabs padding in material theme 2022-09-29 17:26:56 +03:00
yordanov
72d6fa5454 Set bootstrap grid-gutter-width value to 2rem 2022-09-29 16:07:35 +03:00
Vladimir Enchev
1f700a80bc Version updated 2022-09-29 15:05:17 +03:00
yordanov
d9a25c88e7 Make dropdown label right padding as smaller as possible 2022-09-29 13:51:55 +03:00
yordanov
e060b80b67 Update css selectors for DataGrid selection 2022-09-29 13:26:00 +03:00
yordanov
45687e665d Scope grid alternating rows to tbody only. Fixes #625 2022-09-29 13:10:38 +03:00
yordanov
5a3dffbc98 Update Menu demo page 2022-09-29 12:07:11 +03:00
yordanov
9e932f025f Reduce top item x-padding in material menu 2022-09-29 12:06:47 +03:00
yordanov
5ea729d0d0 Update Menu styling. Fixes #623 2022-09-29 11:12:43 +03:00
yordanov
67b6c52031 Fix sidebar z-index 2022-09-29 11:12:43 +03:00
yordanov
8b9c26c12b Fix grid data row class in table-reflow 2022-09-29 11:12:43 +03:00
Vladimir Enchev
bede7d3fc9 DataGrid settings saved on clear column filter 2022-09-29 11:06:46 +03:00
Vladimir Enchev
cf2d4b890a preventPopupDefault removed 2022-09-29 09:14:37 +03:00
Vladimir Enchev
3aa05efe9c Fixed cannot edit DatePicker time parts 2022-09-28 22:40:08 +03:00
Vladimir Enchev
ac00b513a8 DataGrid columns reset on Settings clear 2022-09-28 21:19:18 +03:00
Vladimir Enchev
7fb4f6de65 DataGrid column filter saved in settings cleared on filter 2022-09-28 21:07:48 +03:00
yordanov
26251a2158 Grid alternating rows inverted 2022-09-28 16:51:22 +03:00
Vladimir Enchev
4a0b1f8f10 DataGrid exception fixed on select/deselect all columns from column picker 2022-09-28 16:40:55 +03:00
Vladimir Enchev
d6cce4a11b Fixed Tree AllowCheckParents behavior
Fix #593
2022-09-28 16:32:05 +03:00
Vladimir Enchev
2ad79ea3d1 DataGrid self-ref items indent with multiple parent items on same level fixed
Fix #617
2022-09-28 12:30:47 +03:00
Vladimir Enchev
82ce761b88 DataGrid AllowPickAllColumns property added 2022-09-28 09:18:37 +03:00
Vladimir Enchev
d1241a6997 DropDown/ListBox AllowSelectAll property added 2022-09-28 09:07:32 +03:00
Vladimir Enchev
eb28720cd2 code fixed 2022-09-27 18:42:53 +03:00
Vladimir Enchev
436a36a704 Version updated 2022-09-27 18:30:54 +03:00
yordanov
c2298b2ae0 Fix selectable grid row hover styles 2022-09-27 17:30:01 +03:00
Vladimir Enchev
9bc1431291 rz-data-row class added to DataGrid data rows 2022-09-27 17:13:18 +03:00
yordanov
695a57153a Update standard base theme pager buttons and shadows 2022-09-27 16:00:35 +03:00
yordanov
b19ce01e2e Fix Pager selected button padding 2022-09-27 16:00:35 +03:00
Vladimir Enchev
d0c74b73dc DataGrid simple filter mode with nullable enums improved
Fix #620
2022-09-27 15:47:07 +03:00
yordanov
673fce5054 Fix background of menu top items with material theme 2022-09-27 15:26:22 +03:00
yordanov
9195f7ed31 Fix alignment of menu top items and reorder scss variables 2022-09-27 15:25:23 +03:00
yordanov
baf97b205f Fix steps widget content overflow 2022-09-27 13:23:34 +03:00
Vladimir Enchev
13da03396f Fixed touch keyboard closes popup in Windows 2022-09-27 09:05:00 +03:00
Vladimir Enchev
52846e3bf2 avoid null ref. exception on string filter 2022-09-26 21:47:24 +03:00
Vladimir Enchev
164c43e2e5 DataFilterProperty GetFilterOperators() made virtual and example added 2022-09-26 21:42:31 +03:00
Vladimir Enchev
3af93df990 Version updated 2022-09-26 16:40:44 +03:00
Vladimir Enchev
6026d27b18 LoadSettings code improved 2022-09-26 16:20:05 +03:00
Vladimir Enchev
ba8786c4fe DataGrid load settings fixed 2022-09-26 16:18:19 +03:00
Atanas Korchev
5650349868 Premium themes (#619)
* Show premium themes in the online demo.

* Set the id of the theme dropdown.

* Update colors in theme picker

* Style theme picker with Pro badges

* Update pro themes.

Co-authored-by: yordanov <vasil@yordanov.info>
2022-09-26 14:15:10 +03:00
yordanov
8bd3c32a65 Update logos 2022-09-26 12:05:56 +03:00
Vladimir Enchev
07623acf41 Save/load settings demo reworked to use ProtectedLocalStorage 2022-09-26 11:22:57 +03:00
Vladimir Enchev
446629b9f8 DataGridSettingsService deleted 2022-09-26 11:09:35 +03:00
Vladimir Enchev
21dca42e33 Save/Load settings demo reworked 2022-09-26 11:01:15 +03:00
Vladimir Enchev
7c5c9fc8be demo text updated 2022-09-26 09:59:48 +03:00
Vladimir Enchev
b2262ad4b8 Version updated 2022-09-26 09:54:22 +03:00
Vladimir Enchev
4f7aba1e4b PageSize added to DataGridSettings 2022-09-26 09:48:01 +03:00
Vladimir Enchev
2bfbc68df8 Save/Load DataGrid runtime settings added (#618) 2022-09-26 09:44:43 +03:00
yordanov
682ae2ed59 Update logos on demos homepage 2022-09-26 09:40:59 +03:00
yordanov
a13705c1fe Fix link text decoration in Panel, SplitButton and Steps with -base themes 2022-09-23 17:25:00 +03:00
yordanov
e4f4ba46f5 Add rz- prefix to all login CSS classes 2022-09-23 16:40:08 +03:00
yordanov
1f4b343a2e Update Login component CSS classes and styles 2022-09-23 16:36:10 +03:00
yordanov
f4e01f42c5 Add pointer cursor to rz-link 2022-09-23 16:36:10 +03:00
Vladimir Enchev
7416ea1a54 DropDownBase HasValue will check if value has items in case of multiple selection 2022-09-23 14:02:49 +03:00
yordanov
b9593b7b4c Add font-smoothing to demos 2022-09-23 10:12:28 +03:00
yordanov
43d7725522 Fix cards position 2022-09-23 10:12:28 +03:00
aaayd
d8d3a392b2 Implement Navigation on Filtered Sidebar (#612)
Implements navigation on the sidebar when filtered with navigation items which do not include children.
This will also implement the Icon for the navigation item.
2022-09-23 09:26:54 +03:00
starkuss
5a36e72616 enable possibility to add custom css class to dialog (#616) 2022-09-23 09:25:37 +03:00
Atanas Korchev
e9bfe72914 Update docs to use base themes instead of full. 2022-09-22 18:58:07 +03:00
Vladimir Enchev
db23f28388 Version updated 2022-09-22 17:09:32 +03:00
yordanov
46bd9a5324 Update demos to use Bootstrap 5 layout css classes 2022-09-22 16:48:22 +03:00
yordanov
d225b6d454 Scope base themes to style radzen components only 2022-09-22 16:48:22 +03:00
yordanov
17fb991744 Add theme's font-family to RadzenText component 2022-09-22 16:48:22 +03:00
yordanov
1035d413de Add --rz-text-font-family and --rz-body-background-color css variables 2022-09-22 16:48:22 +03:00
yordanov
9bbccb72e4 Fix fieldset legend float in Bootstrap 5 2022-09-22 16:48:22 +03:00
yordanov
4b525256fb Fix link text-decoration in components 2022-09-22 16:48:22 +03:00
Vladimir Enchev
960059e307 DataFilter should filter on operator change 2022-09-22 10:58:52 +03:00
Atanas Korchev
0941627527 Use full bootstrap and -base.css for the themes. 2022-09-22 10:18:13 +03:00
Vladimir Enchev
efea8c451b DataGrid self-reference filtering improved 2022-09-22 09:43:36 +03:00
Vladimir Enchev
d9811f4ff1 datafilter link fixed 2022-09-21 18:32:45 +03:00
Vladimir Enchev
11e6713f20 README.md path fixed 2022-09-21 17:43:48 +03:00
Vladimir Enchev
0d37538778 Version updated 2022-09-21 17:40:42 +03:00
yordanov
c88f8bb277 Update grid hieararchy demo tags 2022-09-21 17:29:40 +03:00
yordanov
cd8a8ba310 Update styles for alternating rows 2022-09-21 17:16:30 +03:00
yordanov
9cb81c5fb8 Update new/updated demo tags 2022-09-21 16:31:24 +03:00
Vladimir Enchev
e2d3dc1258 DataGrid AllowAlternatingRows property added 2022-09-21 16:26:51 +03:00
Vladimir Enchev
3c51397be8 SplitButton will close popup on default action 2022-09-21 16:09:21 +03:00
Vladimir Enchev
84d51bf653 RenderMode renamed to PopupRenderMode 2022-09-21 15:35:33 +03:00
Vladimir Enchev
70c541b06f DataGrid self-reference hierarchy support added (#613)
* DataGrid self-reference hierarchy added

* Self ref demo inherited from DbContextPage

* Update grid self reference demo

* rz-cell-toggle added

* rzi-grid-sort removed from expand icon

* Style rz-cell-toggle in DataGrid

Co-authored-by: yordanov <vasil@yordanov.info>
2022-09-21 15:27:56 +03:00
yordanov
79a7095739 Rename Text page 2022-09-21 12:28:40 +03:00
yordanov
cf7fbf0b83 Update Tabs demo 2022-09-21 12:28:35 +03:00
yordanov
f1bf807b67 Update Card demo 2022-09-21 12:26:12 +03:00
Vladimir Enchev
f02581d20a DatePicker PopupRenderMode property added (#611)
* Experiment with on demand popup rendering.

* Delay the open until the popup content has rendered.

* DatePicker PopupRenderMode property added

* DatePicker RenderMode.Initial improved

* ColorPicker PopupRenderMode added

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2022-09-21 11:14:51 +03:00
Vladimir Enchev
03450fc4f7 Fixed DropDown SelectAll InvalidCastException when bind-Value is IList
Fix #610
2022-09-21 08:44:52 +03:00
Atanas Korchev
5e0eaa529f Update theme instructions. 2022-09-20 19:35:23 +03:00
Vladimir Enchev
56184370a7 DataFilter nested filters fixed 2022-09-20 18:23:15 +03:00
yordanov
6fdc672dc4 Fix height of slots and events in Scheduler 2022-09-20 16:41:00 +03:00
yordanov
ec82a24910 Style labels in bootstrap forms 2022-09-20 16:27:16 +03:00
Atanas Korchev
06157a9e5c Add rz-form class to RadzenTemplateForm. 2022-09-20 16:18:02 +03:00
Vladimir Enchev
a53022bac0 DataFilter component added (#608)
* RadzenDataFilter added

* Add SplitButton Variants, ButtonStyles and Shades

* Add Flat variant to Button and Button gap

* Add SelectBar Size

* Add initial DataFilter styles

* rz-datafilter-group-item class added

* reset filter on property change

* missing rz-datafilter-group-item added

* rz-datafilter-group-item fixed

* inner filter add fixed

* code reworked

* Make datagrid's filter buttons flat

* Update filter node paths

Co-authored-by: yordanov <vasil@yordanov.info>
2022-09-20 14:59:15 +03:00
Vladimir Enchev
896c775fef DataGridCellSelect improved 2022-09-20 13:45:57 +03:00
Vladimir Enchev
f907d689e5 DataGridCellSelect demo improved 2022-09-20 13:28:44 +03:00
Vladimir Enchev
90a9850034 Cell selection color changed to rz-secondary-lighter 2022-09-20 12:19:13 +03:00
Vladimir Enchev
4418d348c5 DataGrid CellClick/CellDoubleClick events and example for cell selection added. 2022-09-20 11:36:36 +03:00
Vladimir Enchev
7ce93da521 DbContext demos reworked with DbContextFactory 2022-09-19 17:21:28 +03:00
Vladimir Enchev
aeb08616b5 DataGrid groups change event disposed 2022-09-19 11:07:04 +03:00
Vladimir Enchev
a10df3a133 reference disposed 2022-09-19 11:00:02 +03:00
Vladimir Enchev
c4039f5663 Force GC on example dispose 2022-09-19 10:50:51 +03:00
Vladimir Enchev
30df4a257a DataGrid column picker not updated when setting column Visible property with code 2022-09-16 19:00:29 +03:00
yordanov
6f0df065ad Update badge size in sidebar 2022-09-16 18:24:01 +03:00
yordanov
8cfc5567d1 Fix Badge bootstrap overrides 2022-09-16 18:24:01 +03:00
Vladimir Enchev
32defc6833 GoogleMap component should not reset zoom and center on marker update. Options property added. 2022-09-16 17:45:43 +03:00
yordanov
4485cf33df Fix border-radius of outlined buttons 2022-09-16 17:39:55 +03:00
Vladimir Enchev
d7638ea764 DataGrid multi sort column index indicator now is Badge 2022-09-16 15:36:15 +03:00
yordanov
d334a472ce Update grid header cell layout based on text-align 2022-09-16 15:15:38 +03:00
Vladimir Enchev
19672dba39 DataGrid column text-align fixed
Fix #606
2022-09-16 10:00:32 +03:00
Vladimir Enchev
24358eeb51 Readme added 2022-09-16 09:27:05 +03:00
Vladimir Enchev
c1a823cd42 Description updated 2022-09-16 09:18:52 +03:00
Vladimir Enchev
849c4982a8 Version updated 2022-09-15 16:07:40 +03:00
yordanov
032d6a1ae1 Update new and updated demo badges 2022-09-14 15:19:03 +03:00
yordanov
b012c48e62 Hide link to docs 2022-09-14 15:19:03 +03:00
yordanov
76aa0f70aa Use css color variables in conditional template 2022-09-14 15:19:03 +03:00
yordanov
1c3c525d2b Make rz-cell-data overflow visible if content is button or checkbox 2022-09-14 15:19:03 +03:00
yordanov
9042b16df4 Add fill color to rz-donut-title 2022-09-14 15:19:03 +03:00
yordanov
1f9198964b Fix z-index of fetching data panel in dashboard demo 2022-09-14 15:19:03 +03:00
yordanov
698513ea84 Update Badge child content demo 2022-09-14 15:19:03 +03:00
yordanov
0cb68d9b5d Fix rz-grid-filter padding 2022-09-14 15:19:03 +03:00
yordanov
221a0942ab Fix standard theme secondary color 2022-09-14 15:19:03 +03:00
yordanov
c83fcc4602 Add Dark styles, Shade styles, Outline and Text variants to Button and Badge 2022-09-14 15:19:03 +03:00
yordanov
b51abc68a8 Update DataList demo styles 2022-09-14 15:19:03 +03:00
yordanov
9040c32f52 Add Pager responsive styles 2022-09-14 15:19:03 +03:00
yordanov
dc81c7244a Update demos layouts and headings 2022-09-14 15:19:03 +03:00
yordanov
62debd3df4 Add functional text css variables 2022-09-14 15:19:03 +03:00
yordanov
a048cf0f23 Update support page 2022-09-14 15:19:03 +03:00
yordanov
50ed79c0b3 Fix content scroll in Steps and add padding to Steps prev next buttons 2022-09-14 15:19:03 +03:00
yordanov
b6963c7cab Remove text uppercase in lg button 2022-09-14 15:19:03 +03:00
yordanov
9f5af15987 Fix demo layouts 2022-09-14 15:19:03 +03:00
yordanov
5119048f33 Update heading styles 2022-09-14 15:19:03 +03:00
yordanov
090f45092c Remove checkbox and radio margin 2022-09-14 15:19:03 +03:00
yordanov
925e36e33b Fix demo layouts and typography 2022-09-14 15:19:03 +03:00
yordanov
720b64ff90 Update layout in dropdown demo 2022-09-14 15:19:03 +03:00
yordanov
4cd9f11f0b Fix padding of dropdown with chips 2022-09-14 15:19:03 +03:00
yordanov
1b54504165 Update console message styles 2022-09-14 15:19:03 +03:00
yordanov
080e514527 Remove unused css classes 2022-09-14 15:19:03 +03:00
yordanov
392ed8b517 Style Chips in DropDown 2022-09-14 15:19:03 +03:00
yordanov
546701894d CLose RadzenText in Upload demo 2022-09-14 15:19:03 +03:00
yordanov
b90139aee4 Fix title text overflow in demos header 2022-09-14 15:19:03 +03:00
yordanov
5d39b554e0 Fix background in ripple demo 2022-09-14 15:19:03 +03:00
yordanov
51b9ab3661 Update headings in steps demo 2022-09-14 15:19:03 +03:00
yordanov
b58672b8ec Update images in get started article 2022-09-14 15:19:03 +03:00
yordanov
4148b57819 Fix steps disabled state 2022-09-14 15:19:03 +03:00
yordanov
8a9f0ddd24 Add Material theme 2022-09-14 15:19:03 +03:00
yordanov
4ccc377f1c Update demos layouts and headings 2022-09-14 15:19:03 +03:00
yordanov
dc56d18595 Remove button-sizes from standard theme 2022-09-14 15:19:03 +03:00
yordanov
ff78f68443 Add button min-width in standard theme 2022-09-14 15:19:03 +03:00
yordanov
5b52b070d9 Fix h6 font-size 2022-09-14 15:19:03 +03:00
yordanov
8f28becd6c Fix validator callout and paddings 2022-09-14 15:19:03 +03:00
yordanov
14212a744a Fix calendar input padding-right 2022-09-14 15:19:03 +03:00
yordanov
cb0af54ab4 Update card box-shadow 2022-09-14 15:19:03 +03:00
yordanov
b6b737a0cd Add UI Fundamentals demos 2022-09-14 15:19:03 +03:00
yordanov
092ec1a8f0 Fix usege of --border-radius-* 2022-09-14 15:19:03 +03:00
yordanov
9476d8bbcd Add scss mixins and fill-in missing utility maps 2022-09-14 15:19:03 +03:00
yordanov
72e4a6ccc7 Fix naming and generation of border css variables 2022-09-14 15:19:03 +03:00
yordanov
73d2c83d8e Refactor generation of css variables and utility classes 2022-09-14 15:19:03 +03:00
yordanov
540b315213 Fix background colors in dark theme 2022-09-14 15:19:03 +03:00
yordanov
9594014358 Add link text-decoration variables and update border css classes 2022-09-14 15:19:03 +03:00
yordanov
d3e781607d Update font-weights of default headings 2022-09-14 15:19:03 +03:00
yordanov
e9d6874ff5 Add text-decoration, hover and focus styles to rz-link 2022-09-14 15:19:03 +03:00
yordanov
729b43cd54 Fix grid filter and date filter dropdown layouts 2022-09-14 15:19:03 +03:00
yordanov
5278060aaa Add background-color to rz-calendar-inline 2022-09-14 15:19:03 +03:00
yordanov
d25a1e8463 Add fill to rz-series-data-label and update chart tooltip padding 2022-09-14 15:19:03 +03:00
yordanov
24e260dc0d Update texts in Dashbboard example 2022-09-14 15:19:03 +03:00
yordanov
ea6a010c5e Fix variable font-sizes in typography headings 2022-09-14 15:19:03 +03:00
yordanov
07715fd541 Add CSS vars to RadzenText 2022-09-14 15:19:03 +03:00
yordanov
6b9e0e60c5 Add CSS classes for colors 2022-09-14 15:19:03 +03:00
yordanov
1040b041a4 Update scss variables in themes 2022-09-14 15:19:03 +03:00
yordanov
914dcced2b Close strong tag in title 2022-09-14 15:19:03 +03:00
yordanov
520d2bf0a8 Replace demo headings and paragraphs with RadzenText component 2022-09-14 15:19:03 +03:00
yordanov
886a09553f Update SCSS variables - names and values 2022-09-14 15:19:03 +03:00
yordanov
9436fa50b8 Set background color to files upload clear button in dark theme 2022-09-14 15:19:03 +03:00
yordanov
feae293d17 Add fieldset legend margin scss variable 2022-09-14 15:19:03 +03:00
yordanov
8eba025e02 Add rating ban icon color variable 2022-09-14 15:19:03 +03:00
yordanov
060f5dfd6c Add overflow hidden to listbox wrapper 2022-09-14 15:19:03 +03:00
yordanov
e3e3bb2731 Fix dropdown item border radius 2022-09-14 15:19:03 +03:00
yordanov
1082dd5aa4 Fix grid filter row background and padding 2022-09-14 15:19:03 +03:00
yordanov
aaba37325b Update dropdown min-width 2022-09-14 15:19:03 +03:00
yordanov
fe225efde5 Remove btn- css classes 2022-09-14 15:19:03 +03:00
yordanov
1726a45738 Fix colors of remove upload files button 2022-09-14 15:19:03 +03:00
yordanov
09f3ebec80 Remove sort icon color from standard theme 2022-09-14 15:19:03 +03:00
yordanov
f8a4534496 Add initial shadow values 2022-09-14 15:19:03 +03:00
yordanov
299833b974 Add button min-width 2022-09-14 15:19:03 +03:00
yordanov
317a1cd8ca Fix navigation link cursor 2022-09-14 15:19:03 +03:00
yordanov
81d7ecde04 Fix numeric button border radius 2022-09-14 15:19:03 +03:00
yordanov
1377769eff Fix LogicalFilterOperator dropdown width 2022-09-14 15:19:03 +03:00
yordanov
1cbde75953 Fix resize, sort, reorder and composite-cell behavior of grid header cells 2022-09-14 15:19:03 +03:00
yordanov
72d16e22be Add background and color to remove file button 2022-09-14 15:19:03 +03:00
yordanov
8fa6721a26 Add color variables for notification icons 2022-09-14 15:19:03 +03:00
yordanov
aeb2355d75 Remove cursor when hue and alpha pickers are active 2022-09-14 15:19:03 +03:00
yordanov
81a3adb483 Add background color to color picker button 2022-09-14 15:19:03 +03:00
yordanov
8298a22023 Fix content alignment in breadcrumb links 2022-09-14 15:19:03 +03:00
yordanov
c3612ec9a6 Update dropdown scss variables - new trigger-icon and item-border-radius 2022-09-14 15:19:03 +03:00
yordanov
c05f158663 Add box-shadow to slider handle and reorder variables 2022-09-14 15:19:03 +03:00
yordanov
671851f345 Reorder switch scss variables 2022-09-14 15:19:03 +03:00
yordanov
1611429d83 Fix transitions and border width between states of radio button 2022-09-14 15:19:03 +03:00
yordanov
a8593078ad Use vertical-offest instead of margin for second level menus 2022-09-14 15:19:03 +03:00
yordanov
6165c25976 Add CSS variables to set margin and border-radius to second level items in panel menu 2022-09-14 15:19:03 +03:00
yordanov
47598a9d7a Add line-height CSS variable to steps number 2022-09-14 15:19:03 +03:00
yordanov
09c727e91a Add color variables for icon in menu item 2022-09-14 15:19:03 +03:00
yordanov
0619557f05 Add border-radius to menu top item 2022-09-14 15:19:03 +03:00
yordanov
aa5a9c6c2d Fix navigation item active indicator margin 2022-09-14 15:19:03 +03:00
yordanov
e3ad81926e Add menu-item-border-radius var 2022-09-14 15:19:03 +03:00
yordanov
37abd6d5b8 Rename sidebar-toggle CSS class to rz-sidebar-toggle 2022-09-14 15:19:03 +03:00
yordanov
5a7499c80e Reorder sidebar-toggle scss variables 2022-09-14 15:19:03 +03:00
yordanov
ce3bb23b8c Add accordion header margin and border-top 2022-09-14 15:19:03 +03:00
yordanov
845d5b2351 Update demos layout 2022-09-14 15:19:03 +03:00
yordanov
08ee361c9c Add special color classes to utilities 2022-09-14 15:19:03 +03:00
yordanov
c6e6a4bd7d Fix FileInput delete button onclick 2022-09-14 15:19:03 +03:00
yordanov
85b571594c Refactor Button, Card and PanelMenu styles 2022-09-14 15:19:03 +03:00
Atanas Korchev
5088c94db5 Some documentation and default property values. 2022-09-14 15:19:03 +03:00
Atanas Korchev
2dc9e9e04c Allow tag name overriding. 2022-09-14 15:19:03 +03:00
Atanas Korchev
2752c641ed Add RadzenText. 2022-09-14 15:19:03 +03:00
yordanov
4c0b6bff9d Update grid columns' width 2022-09-14 15:19:03 +03:00
yordanov
5acebc3e44 Update title in dashboard example 2022-09-14 15:19:03 +03:00
yordanov
1e8c065fdb Update Typography page 2022-09-14 15:19:03 +03:00
yordanov
b35775b3e0 Update demos layout 2022-09-14 15:19:03 +03:00
yordanov
0693853c0a Fix button height 2022-09-14 15:19:03 +03:00
yordanov
6994d12eb6 Update demos layout to fixed width 2022-09-14 15:19:03 +03:00
yordanov
dc0dda35fc Fix event list button top position unit 2022-09-14 15:19:03 +03:00
yordanov
085fc2a764 Style scheduler event list button 2022-09-14 15:19:03 +03:00
yordanov
7ecae9e3a2 Style grid group header item 2022-09-14 15:19:03 +03:00
yordanov
61d687882f Add Large button size 2022-09-14 15:19:03 +03:00
yordanov
354eed23b9 Update humanistic theme vars 2022-09-14 15:19:03 +03:00
yordanov
99996613bc Update main color variables in dark theme 2022-09-14 15:19:03 +03:00
yordanov
c6e7b1d68a Fix shadow variable 2022-09-14 15:19:03 +03:00
yordanov
69e9823640 Add Typography demo 2022-09-14 15:19:03 +03:00
yordanov
6e74d02e95 Fix colorpicker hover state in editor 2022-09-14 15:19:03 +03:00
yordanov
397d3073c6 Add default typography styles 2022-09-14 15:19:03 +03:00
yordanov
ecba921352 Update github icon color 2022-09-14 15:19:03 +03:00
yordanov
bea36fdcb5 Update main theme color scss variables 2022-09-14 15:19:03 +03:00
yordanov
0379e0ee6d Fix slot header and slot title font-sizes 2022-09-14 15:19:03 +03:00
yordanov
787a48a795 Update chart color schemes with css vars 2022-09-14 15:19:03 +03:00
yordanov
ce257fcc95 Add scss variables for colors in notification 2022-09-14 15:19:03 +03:00
yordanov
becc50d2b8 Remove inline styles in time picker OK button 2022-09-14 15:19:03 +03:00
yordanov
673be6056c Fix toggle icon order in accordion 2022-09-14 15:19:03 +03:00
yordanov
5c7b19527d Update progressbar style scss vars 2022-09-14 15:19:03 +03:00
yordanov
4304099d3a Add more shadow variables 2022-09-14 15:19:03 +03:00
yordanov
5911968469 Fix numeric button alignment and spacing in pager 2022-09-14 15:19:03 +03:00
yordanov
6afde15a1d Reorder css rules 2022-09-14 15:19:03 +03:00
yordanov
ab578f499c Refactor pager scss variables 2022-09-14 15:19:03 +03:00
yordanov
e78c3bc6aa Refactor grid scss variables 2022-09-14 15:19:03 +03:00
yordanov
6394a8ee76 Refactor datalist scss variables 2022-09-14 15:19:03 +03:00
yordanov
5f4e62824f Add button size examples 2022-09-14 15:19:03 +03:00
yordanov
f1966f42de Refactor tree scss variables 2022-09-14 15:19:03 +03:00
yordanov
704039afc2 Remove inline styles of checkbox in tree 2022-09-14 15:19:03 +03:00
yordanov
b1c9b27f17 Refactor scheduler variables 2022-09-14 15:19:03 +03:00
yordanov
3a1c0a707a Use RadzenButton in nav-views 2022-09-14 15:19:03 +03:00
yordanov
781c28044a Remove icon css classes 2022-09-14 15:19:03 +03:00
yordanov
76346a435a Add rz-button-box container 2022-09-14 15:19:03 +03:00
yordanov
a4ebe3532b Update tabs variables 2022-09-14 15:19:03 +03:00
yordanov
189c8c5a2a Update switch background colors and sizing 2022-09-14 15:19:03 +03:00
yordanov
c1c50fcdb0 Add slider handle transitions 2022-09-14 15:19:03 +03:00
yordanov
aad91c32d1 Add radio border-width 2022-09-14 15:19:03 +03:00
yordanov
b80a84822e Update panel icon size 2022-09-14 15:19:03 +03:00
yordanov
3e4f86d5fe Update panel-menu styles 2022-09-14 15:19:03 +03:00
yordanov
3cb9fa6926 Add pager border-radius and button hover styles 2022-09-14 15:19:03 +03:00
yordanov
900fe003d4 FIx numeric input padding 2022-09-14 15:19:03 +03:00
yordanov
3c923f7a20 Fix input focus styles 2022-09-14 15:19:03 +03:00
yordanov
6d95c85719 Use proper icon size variable 2022-09-14 15:19:03 +03:00
yordanov
5a0bdb6358 Add checkbox border-width and fix background 2022-09-14 15:19:03 +03:00
yordanov
49f8d7ac56 Fix autocomplete background, transition and transform styles 2022-09-14 15:19:03 +03:00
yordanov
fd99d88510 Add Accordion toggle icon variables 2022-09-14 15:19:03 +03:00
yordanov
29f37bbe43 Add line-height to button 2022-09-14 15:19:03 +03:00
yordanov
1567dd6163 Remove inline style 2022-09-14 15:19:03 +03:00
yordanov
297d0b7466 Update DropDown styles 2022-09-14 15:19:03 +03:00
yordanov
7db378a8c8 Update filtering dropdown width 2022-09-14 15:19:03 +03:00
yordanov
3f5c73ca26 Remove inline margin 2022-09-14 15:19:03 +03:00
yordanov
53f7ddcb82 Add initial typography styles 2022-09-14 15:19:03 +03:00
yordanov
1f54a40147 Update font size 2022-09-14 15:19:03 +03:00
yordanov
4c3cdaf593 Update Roboto font 2022-09-14 15:19:03 +03:00
yordanov
af00eeaf2a Fix border-radius variable 2022-09-14 15:19:03 +03:00
yordanov
ed5629f7cf Add context menu padding 2022-09-14 15:19:03 +03:00
yordanov
88d1854b0d Update theme constants 2022-09-14 15:19:03 +03:00
yordanov
328cb3a4dc Add toggle icon font-size 2022-09-14 15:19:03 +03:00
yordanov
a1c83ebb10 Add font-size and icon-size variables 2022-09-14 15:19:03 +03:00
yordanov
d440a78c7b Update themes 2022-09-14 15:19:03 +03:00
yordanov
6e643d7cda Fix scss vars 2022-09-14 15:19:03 +03:00
yordanov
0f705bd755 Update dark theme 2022-09-14 15:19:03 +03:00
yordanov
f436e44233 Update base palette 2022-09-14 15:19:03 +03:00
yordanov
29f6c5907c Update color variables 2022-09-14 15:19:03 +03:00
yordanov
a4d5015875 Add font smoothing 2022-09-14 15:19:03 +03:00
yordanov
e8aa282a3a Update theme colors 2022-09-14 15:19:03 +03:00
yordanov
44dc55822d Update transitions 2022-09-14 15:19:03 +03:00
yordanov
473bc16384 Add transitions 2022-09-14 15:19:03 +03:00
yordanov
8984a1baf6 Add utilities and typography under components 2022-09-14 15:19:03 +03:00
yordanov
8fda96eabf Organize default global variables 2022-09-14 15:19:03 +03:00
yordanov
5110c5d248 Add css vars and update colors 2022-09-14 15:19:03 +03:00
yordanov
d23bdee6ed Add css vars and update colors 2022-09-14 15:19:03 +03:00
yordanov
2f2ecbbeb0 Add css vars and update colors 2022-09-14 15:19:03 +03:00
yordanov
867fe28c5f Add CSS vars and update colors 2022-09-14 15:19:03 +03:00
yordanov
958cdc627a Add css vars to input and badge 2022-09-14 15:19:03 +03:00
yordanov
473aa9c429 Add css vars to standard and default theme 2022-09-14 15:19:03 +03:00
yordanov
846dd24dde Add global css vars 2022-09-14 15:19:03 +03:00
yordanov
c01823024d Add selection and default body font-size 2022-09-14 15:19:03 +03:00
yordanov
1cba327f24 Remove sizing from standard theme 2022-09-14 15:19:03 +03:00
yordanov
c973edee05 Update typography 2022-09-14 15:19:03 +03:00
yordanov
6744926708 Update sizing 2022-09-14 15:19:03 +03:00
yordanov
a5f040d69d Update sizing 2022-09-14 15:19:03 +03:00
Vladimir Enchev
0507f25e86 DataGrid column ShowTimeForDateTimeFilter() virtual method added
Fix #601
2022-09-13 09:43:25 +03:00
Vladimir Enchev
f782f18f04 RadzenDataGridColumn GetFilterOperators() made virtual
Fix #601
2022-09-12 16:44:30 +03:00
Vladimir Enchev
ddb58f148d Fixed DateTime operators order in DataGrid simple filter mode
Fix #602
2022-09-12 16:14:57 +03:00
Vladimir Enchev
75904cf88c Version updated 2022-09-12 09:58:21 +03:00
Vladimir Enchev
522deec88b DropDownDataGrid AllowRowSelectOnRowClick behavior fixed 2022-09-12 09:57:17 +03:00
Vladimir Enchev
4c07d608c5 Pager GetPage() code fixed 2022-09-10 08:59:37 +03:00
Vladimir Enchev
c3490ac819 SSRSViewer Load event added 2022-09-08 16:35:00 +03:00
Vladimir Enchev
0ada1f2e46 DataGrid pager not recalculated properly when using Page event
Fix #598
2022-09-08 14:40:18 +03:00
Vladimir Enchev
6d7493c6e5 Version updated 2022-09-08 09:34:55 +03:00
Vladimir Enchev
3306d8a276 DropDown/AutoComplete scroll to selected item improved 2022-09-07 10:23:39 +03:00
Vladimir Enchev
d5b607eb72 DropDown item selection check improved 2022-09-07 10:11:41 +03:00
Vladimir Enchev
af22c74602 DropDown and DropDownDataGrid popup cannot be opened when nested in label
Fix #597
2022-09-07 09:30:10 +03:00
Vladimir Enchev
1822850835 DataGridColumn FilterPropertyType made public 2022-09-06 12:37:16 +03:00
Vladimir Enchev
f185b9c30d Numeric AutoComplete set to false by default 2022-09-06 11:06:17 +03:00
Vladimir Enchev
d6c39e05f9 RadzenSelectBarItem Template property added
Fix #595
2022-09-05 15:29:09 +03:00
GioeEng
d7abef33a6 RadzenAutoComplete with IEnumerable of strings (#596)
* feat: Dropdown with badges view

* Rename BadgesView to ChipsView and update styling

* Rename ChipsView to Chips. Do not set Multiple to true - require the developer to set it instead. Some cosmetic changes.

* Tag dropdown demo as updated.

* Reposition popup when chip is removed.

* fix: RadzenAutoComplete support IEnumerable of strings

Co-authored-by: yordanov <vasil@yordanov.info>
Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2022-09-05 14:16:22 +03:00
Vladimir Enchev
a0f6712c57 Version updated 2022-09-05 09:25:18 +03:00
Vladimir Enchev
e81acee86b AutoComplete Multiline property added 2022-09-02 16:05:47 +03:00
Vladimir Enchev
bbc9080cfa Upload ParameterName property added 2022-09-02 15:22:25 +03:00
Vladimir Enchev
2095280783 AutoComplete Template property added 2022-09-02 09:27:35 +03:00
Vladimir Enchev
d2b2e9a0d9 Version updated 2022-09-01 19:29:45 +03:00
Vladimir Enchev
e62adf9131 SelectBar item Icon and Image properties added 2022-09-01 19:29:24 +03:00
Vladimir Enchev
4f22a869b8 DropDown with groups example added 2022-09-01 15:22:12 +03:00
Vladimir Enchev
8cf5868a30 code fixed 2022-09-01 14:17:55 +03:00
Vladimir Enchev
f8d2b47006 Fixed virtualized DropDownBase not refreshed on data change
Fix #592
2022-09-01 14:15:48 +03:00
Vladimir Enchev
71f0f53cae DataGrid should be reset to first page on data change
Fix #591
2022-08-31 16:07:14 +03:00
Vladimir Enchev
5b1fe105ba Version updated 2022-08-30 07:44:14 +03:00
Vladimir Enchev
7f447ac21f Fixed ProgressBar Template 2022-08-30 06:52:23 +03:00
Atanas Korchev
425c7cd390 Fix the search textbox in the navigation. 2022-08-29 09:50:55 +03:00
Vladimir Enchev
7f72143ee7 Version updated 2022-08-29 07:58:49 +03:00
Vladimir Enchev
e743500d6c ProgressBar Template property added 2022-08-28 15:32:52 +03:00
Vladimir Enchev
77e3952849 DialogService Close() method made virtual
Fix #588
2022-08-26 15:02:58 +03:00
Vladimir Enchev
21dab1bf50 DropDownDataGrid clear button should not open popup 2022-08-26 12:08:45 +03:00
Vladimir Enchev
4e9aa726c6 Fixed big number exception in Numeric with nullables
Fix #586
2022-08-26 09:38:18 +03:00
Vladimir Enchev
004babb572 Version updated 2022-08-25 08:43:34 +03:00
Vladimir Enchev
256c048598 Added CloseTooltipOnDocumentClick to TooltipOptions
Fix #582
2022-08-25 08:43:00 +03:00
Vladimir Enchev
59b884f4e4 AutoComplete popup will not open on Android 2022-08-24 12:09:36 +03:00
Jimmy Ho
45ff535d31 Fix Grid width is wrong in responsive mode (#584)
* style: fix grid width is wrong in responsive mode

* style: adjust tbody layer under table
2022-08-24 07:59:44 +03:00
Atanas Korchev
4cd8c53645 Loading indicator appears below the headers of an empty RadzenDataGrid. 2022-08-22 17:33:11 +03:00
Vladimir Enchev
b856ef4ea6 Version updated 2022-08-22 16:15:33 +03:00
Vladimir Enchev
ea3d83962f Fixed exception when filtering virtualized DropDownDataGrid bound with LoadData 2022-08-22 16:13:34 +03:00
Atanas Korchev
1d79076e65 Allow custom bar and column series sizes. 2022-08-22 10:58:06 +03:00
Vladimir Enchev
1e6bae6801 Fixed DataGrid SimpleWithMenu mode IsNotEmpty
Fix #583
2022-08-22 10:38:55 +03:00
Vladimir Enchev
6cda51ebbe Demos navigation expanded state fixed 2022-08-22 09:23:01 +03:00
Vladimir Enchev
e4c4c1b964 Fixed too big number in Numeric will raise exception
Fix #580
2022-08-22 07:53:29 +03:00
Vladimir Enchev
939c8c6d0e PanelMenuItem ExpandedChange argument fixed
#581
2022-08-20 07:49:03 +03:00
GioeEng
33c3963f66 feat: Dropdown with badges view (#568)
* feat: Dropdown with badges view

* Rename BadgesView to ChipsView and update styling

* Rename ChipsView to Chips. Do not set Multiple to true - require the developer to set it instead. Some cosmetic changes.

* Tag dropdown demo as updated.

* Reposition popup when chip is removed.

Co-authored-by: yordanov <vasil@yordanov.info>
Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2022-08-18 19:42:46 +03:00
Vladimir Enchev
88bfaa532d Version updated 2022-08-17 17:14:51 +03:00
Vladimir Enchev
66e321ebea Added optional forceReload argument to PagedDataBoundComponent GoToPage() method 2022-08-17 10:41:02 +03:00
Vladimir Enchev
8d2838e928 Fixed Tooltip cannot be opened on first button click 2022-08-17 09:32:02 +03:00
Vladimir Enchev
98d896eb81 Fixed DataGrid pager not recalculated properly after Count change
#579
2022-08-17 08:57:01 +03:00
Vladimir Enchev
62bd56e70d DataGrid IsEmpty/IsNotEmpty filter expression should use double quotes 2022-08-17 08:25:15 +03:00
Vladimir Enchev
bbc7e0f648 Added support for IList value binding in DropDownBase 2022-08-16 17:08:50 +03:00
Vladimir Enchev
534c8e0bc3 Clear filter button added to DataGrid string columns in simple filter mode 2022-08-16 10:04:05 +03:00
Vladimir Enchev
1f9897e551 Fixed DataGrid frozen columns not properly stacked
Fix #577
2022-08-15 16:43:25 +03:00
Vladimir Enchev
eba54c8da3 Fixed missing attributes in RadzenSplitterPane 2022-08-15 07:51:24 +03:00
Vladimir Enchev
e47ac5b02d version updated 2022-08-11 08:20:48 +03:00
Nick Williams
9d134f8171 RadzenUpload proposed cancel functionality (#573)
* Change to DatePicker to optionally pad the time picker hour, minute or seconds components with leading zeros. Corresponding new boolean parameters are PadHours, PadMinutes and PadSeconds.

* Fixed issue with RadzenDialog where closing a nested dialog removed the 'no-scroll' class from the page body, allowing the background to scroll. The javascript 'closeDialog' function is now only invoked when the last dialog is closed.
Added a  potential impovement to RadzenDialog, whereby the dialog mask is only shown for the top most dialog, rather than the accumulative effect of multiple masks. This might be personal perference, but makes more sense to me.

* Added boolean Cancel property to UploadProgressArgs, allowing the underlying XMLHttpRequest to be aborted if required. Thereby cancelling the upload. Added boolean Cancelled property to UploadCompleteEventArgs, to determine if the request completed due to being canelled.
2022-08-11 05:54:54 +02:00
Vladimir Enchev
1ec477b5bc Catch possible exception with tooltip on dispose
Fix #572
2022-08-10 11:54:28 +02:00
Vladimir Enchev
022f203a2e Fixed DataGrid advanced filter popup when Property is not set
Fix #567
2022-08-10 09:41:58 +03:00
Vladimir Enchev
191f21bf50 DropDown aria-label fixed
Fix #566
2022-08-10 09:28:15 +03:00
Vladimir Enchev
98c4b37664 AutoComplete should open popup only on keypress not on focus 2022-08-10 09:23:46 +03:00
Atanas Korchev
2f2b40ca53 Pass the formatted text to the chart axis tick template. 2022-08-08 18:19:14 +03:00
Vladimir Enchev
8a8be30657 Version updated 2022-08-05 10:24:26 +03:00
GioeEng
0c0aafb956 fix: RadzenDropDownItem behavior on older versions of the blazor.js framework (#563) 2022-08-05 10:23:25 +03:00
Vladimir Enchev
c0bca5b923 Fixed FileInput reference not updated on Visible change 2022-08-05 10:17:02 +03:00
Vladimir Enchev
55ea356efd version updated 2022-08-04 18:16:44 +03:00
Vladimir Enchev
fbcd357b69 DropDownDataGrid string SelectedValue should not treated like IEnumerable 2022-08-04 18:16:20 +03:00
Vladimir Enchev
41db619e28 Fixed FileInput value cannot be cleared 2022-08-04 18:10:39 +03:00
Vladimir Enchev
1de8b11d75 version updated 2022-08-04 09:23:16 +03:00
Vladimir Enchev
b85f082d03 DropDownDataGrid multiple selection with LoadData improved
Fix #481
2022-08-04 09:22:37 +03:00
Vladimir Enchev
c2f08b47aa Fixed RadzenNumeric does not allow certain numbers to be entered when min and max are set 2022-08-04 08:39:51 +03:00
Vladimir Enchev
329784c9a7 DataGrid PickedColumnsChanged event added
Fix #557
2022-08-02 08:45:54 +03:00
Atanas Korchev
1d357aab0a Tooltip is not displayed for area and line series with a single value. 2022-08-01 21:51:12 +03:00
Vladimir Enchev
fe6deb559b DropDown ReadOnly property added
Fix #460
2022-08-01 15:32:21 +03:00
Vladimir Enchev
591ef4d1f9 net6.0 added to TargetFrameworks. NET5 preprocessor changed to NET5_0_OR_GREATER. 2022-08-01 14:12:45 +03:00
Vladimir Enchev
6a8a991f42 DataGrid OData demo with custom filter fixed to go to first page 2022-08-01 12:25:05 +03:00
Vladimir Enchev
87161cb97a DataGrid LoadData demo with custom filter fixed to go to first page 2022-08-01 12:21:53 +03:00
Vladimir Enchev
a28b667b38 Version updated 2022-08-01 09:48:06 +03:00
Vladimir Enchev
62c8b4b9e9 Fixed keyboard navigation for virtualized DropDownBase
Fix #556
2022-08-01 09:46:56 +03:00
GioeEng
bc0d5e2e7e feat: Dropdown disabled Items (#551)
fix: Dropdown keyboard selecting after filtering
2022-08-01 08:34:20 +03:00
Greg Horvath
a66ea60ae7 Implemented more consistent handling of DateTimeOffSet. See https://github.com/radzenhq/radzen-blazor/issues/554 (#555) 2022-08-01 08:31:08 +03:00
Nick Williams
80f908353f RadzenDialog Improvements (#550)
* Change to DatePicker to optionally pad the time picker hour, minute or seconds components with leading zeros. Corresponding new boolean parameters are PadHours, PadMinutes and PadSeconds.

* Fixed issue with RadzenDialog where closing a nested dialog removed the 'no-scroll' class from the page body, allowing the background to scroll. The javascript 'closeDialog' function is now only invoked when the last dialog is closed.
Added a  potential impovement to RadzenDialog, whereby the dialog mask is only shown for the top most dialog, rather than the accumulative effect of multiple masks. This might be personal perference, but makes more sense to me.
2022-08-01 08:30:27 +03:00
Atanas Korchev
a3a8ad87d3 Trend lines do not render in some cultures. 2022-07-28 19:10:04 +03:00
Vladimir Enchev
ea52a7a9ec Version updated 2022-07-28 08:30:37 +03:00
Vladimir Enchev
972042645c PagedDataBoundComponent FirstPage() method logic with forceReload fixed 2022-07-28 08:29:37 +03:00
Nick Williams
e01c8d4e13 Change to DatePicker to optionally pad the time picker hour, minute or seconds components with leading zeros. Corresponding new boolean parameters are PadHours, PadMinutes and PadSeconds. (#544) 2022-07-27 08:37:11 +03:00
Vladimir Enchev
351373aea5 Fixed Mask component will not apply mask initially 2022-07-26 19:55:05 +03:00
Vladimir Enchev
287680df87 Fixed DataGrid virtualization not working properly in Firefox 2022-07-26 15:13:21 +03:00
Vladimir Enchev
aa96a98722 Fixed validators not working in DataGrid in-line edit with grouping 2022-07-26 09:00:46 +03:00
Vladimir Enchev
58aa231cd2 Version updated 2022-07-25 08:58:02 +03:00
Vladimir Enchev
d0a59e9d6f DataGrid LoadData called twice on FirstPage() with top and bottom pagers 2022-07-25 08:46:00 +03:00
Vladimir Enchev
972c278356 Fixed DataGrid enum filtering
Fix #542
2022-07-25 08:28:25 +03:00
Vladimir Enchev
d3b236107b Version updated 2022-07-23 09:21:20 +03:00
Vladimir Enchev
ddd359afe0 Fixed DropDown multiple selection
Fix #540
2022-07-23 09:20:59 +03:00
Vladimir Enchev
0278777ff4 Version updated 2022-07-21 18:21:07 +03:00
Vladimir Enchev
c8b703778b page restored 2022-07-21 18:19:45 +03:00
Vladimir Enchev
a0d49f8c29 Fixed DropDown does not throw errors within an async Task set to the Change event
Fix #537
2022-07-21 18:19:28 +03:00
Marco Papst
93f9a318b0 allow override of Template with ChildContent in BreadCrumbItem (#536)
Co-authored-by: Marco Papst <papst@sma.de>
2022-07-21 08:54:02 +03:00
pigwing
bc6679505d add ShowEmptyMessage attribute (#535)
* add DisableEmptyText attribute fix when AllowPaging = true && LoadData.HasDelegate && Count == 0 DataGrid InLine Editing not working

* adopt a suggestion
2022-07-21 08:53:15 +03:00
Vladimir Enchev
5698e1a4fb Fixed Accrodion exception when set Visible property of the item 2022-07-21 08:51:26 +03:00
Vladimir Enchev
61c39a8919 Fixed numeric input with zero min/max
Fix #533
2022-07-19 17:09:57 +03:00
Vladimir Enchev
ae2e8b6abd Version updated 2022-07-19 09:23:53 +03:00
Vladimir Enchev
e1bce30ee3 DataGrid simple mode filtering by date will not show value if filter is not applied 2022-07-19 09:23:33 +03:00
Vladimir Enchev
44da884057 Fixed Numeric input and paste logic when min/max is set
Fix #532
2022-07-19 08:58:14 +03:00
Vladimir Enchev
7f9f05ae0e Version updated 2022-07-18 15:40:49 +03:00
Vladimir Enchev
4638d173b6 Order of FileInput events during file remove fixed 2022-07-18 14:46:47 +03:00
Vladimir Enchev
43bc3cee06 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2022-07-18 09:00:05 +03:00
Vladimir Enchev
2db68559d5 FileInput FileName and FileSize parameters added 2022-07-18 08:59:46 +03:00
glutio
122b07b757 Do not show trend tooltip if the line is not visible and fix line names (#531)
* Do not show trend tooltip if the line is not visible and fix line names
Revert accidental removal of commit 6b9d2c19a7 (FilterCleared event)

* Fixed trend lines length and contains() method
2022-07-15 14:32:01 +03:00
Atanas Korchev
d6760ca4b9 Having async code in Expand handler sometimes prevents RadzenTreeItem from rendering. 2022-07-15 14:26:02 +03:00
Vladimir Enchev
fe036e75a3 Version updated 2022-07-14 09:51:03 +03:00
Vladimir Enchev
a574e77f0a Numeric oninput and onpaste attributes fixed
Fix #524
2022-07-14 09:50:08 +03:00
Vladimir Enchev
b4c885067d Fixed FileInput will not select the same file if already removed 2022-07-14 09:10:03 +03:00
glutio
200fb9d9ee Chart overlays - data labels, trends and annotations. 2022-07-13 17:31:48 +03:00
Vladimir Enchev
ec06fdcda6 DropDownBase clear selection using delete key will respect AllowClear property 2022-07-13 14:01:06 +03:00
Atanas Korchev
fb31cc7268 Add missing comma 2022-07-12 16:53:38 +03:00
Atanas Korchev
afdbf2ac0b Set example titles. 2022-07-12 16:43:21 +03:00
Vladimir Enchev
4197230ffd Version updated 2022-07-12 07:24:01 +03:00
Vladimir Enchev
952e22367e Fix DropDownDataGrid selected value not displayed properly in some cases 2022-07-12 07:21:18 +03:00
Atanas Korchev
a497660c64 Prevent exceptions if the value entered in the numeric filter is invalid. Closes #523 and #522. 2022-07-11 16:17:17 +03:00
Vladimir Enchev
bd3f4e08b2 DropDownBase SelectedItems reverted 2022-07-08 18:43:11 +03:00
Vladimir Enchev
c2e5aba0e4 SelectedItems/SelectedItemsChanged added to DropDownBase 2022-07-08 17:45:43 +03:00
Vladimir Enchev
729cf2c033 Fixed DataGrid filtering with virtualization enabled not refreshing UI 2022-07-08 16:17:46 +03:00
Vladimir Enchev
2633bd46c3 Improved Numeric min/max validation 2022-07-08 09:06:11 +03:00
Vladimir Enchev
f6430d421e Fixed DatePicker AM/PM should be clicked multiple times in some cases 2022-07-08 08:14:02 +03:00
Vladimir Enchev
1045290320 Fixed DataGrid group header cell colspan not correct in case of Template defined 2022-07-08 08:00:28 +03:00
Vladimir Enchev
0416bb20b3 DataGrid advanced filtering more fixed with IsEmpty/IsNotEmpty 2022-07-07 16:03:47 +03:00
130nk3r5
cb7223dee1 RadzenDataGrid: Added Is Empty and Is not empty Filter operators (#514)
* Updated the RadzenDataGrid's filter operators too have a 'Is Empty' and 'Is not empty' Options

* IsNull/IsNotNull should work with null while IsEmpty/IsNotEmpty with empty string

Co-authored-by: Hugo Human <hugo@tangentsolutions.co.za>
Co-authored-by: Vladimir Enchev <vladimir.enchev@gmail.com>
2022-07-07 15:14:30 +03:00
Vladimir Enchev
59b535b0d8 Version updated 2022-07-07 10:27:11 +03:00
glutio
6b9d2c19a7 Add FilterCleared event to DataGrid to fire when filter is clered to allow custom logic to tell the difference between operator/value change and filter clear event. In my case it allows me to keep the operator even though it's reset to default in ClearFilter(). (#506)
Co-authored-by: Eugene Pistrak <evpistra@microsoft.com>
2022-07-07 10:25:26 +03:00
Vladimir Enchev
3d7fbefa24 Fixed DatePicker months and years drop downs not update on Min/Max change 2022-07-07 09:46:28 +03:00
Vladimir Enchev
24311c2e71 Fixed FileInput not showing file name and size if not image 2022-07-07 08:32:21 +03:00
Vladimir Enchev
93db8cc163 Fixed DataGrid column Type property not initialized correctly in some cases 2022-07-06 14:09:26 +03:00
Vladimir Enchev
bdd833e05b DataGrid dynamic data demo simplified 2022-07-05 11:13:52 +03:00
Vladimir Enchev
64bcb9b4c3 DataGrid demo with dynamic data reworked 2022-07-05 11:01:54 +03:00
Vladimir Enchev
6f2cf36ba6 Fixed Numeric value change with percent format 2022-07-04 09:52:13 +03:00
Vladimir Enchev
4828af7130 DataGrid Reset() method should respect FilterOperator for string and IEnumerable columns 2022-07-01 16:39:44 +03:00
Vladimir Enchev
0d0aa7c9a0 Do not attempt to filter collections with non valid comparison 2022-06-30 19:27:02 +03:00
Atanas Korchev
f0c962fde0 Toggling the Visible property of a form component breaks validation. 2022-06-30 18:25:13 +03:00
yordanov
a04197f145 Fix grid cell border-bottom in nested grids 2022-06-30 10:41:10 +03:00
Vladimir Enchev
530e9b05ef ListBox/DropDown select all CheckBox checked logic improved 2022-06-30 09:53:34 +03:00
Vladimir Enchev
5276b5f9f7 Version updated 2022-06-30 09:36:18 +03:00
Vladimir Enchev
9a8f5f7186 DataGrid column methods for get/set filter values and operators made public 2022-06-30 08:56:29 +03:00
Vladimir Enchev
7de2b3567d DropDown ValueTemplate property added 2022-06-29 17:14:00 +03:00
Vladimir Enchev
2a53fd6f13 DataGrid Filter event will be raised on clear filter from column filter menu 2022-06-28 08:40:47 +03:00
Vladimir Enchev
1092fd4198 Version updated 2022-06-23 12:16:20 +03:00
Vladimir Enchev
dd5619c1f9 Fixed DropDownDataGrid delegate to an instance method cannot have null 'this' 2022-06-23 12:16:05 +03:00
Vladimir Enchev
06cffc101f Version updated 2022-06-23 10:18:29 +03:00
Vladimir Enchev
5f17dae777 Fixed DropDownBase selected item cannot be removed 2022-06-23 10:04:55 +03:00
Vladimir Enchev
001a8a276f ListBox multiple selection fixed with virtualization enabled 2022-06-22 15:44:16 +03:00
Vladimir Enchev
16986f0f56 DataGrid clear filter added to the filtering menu 2022-06-22 11:09:30 +03:00
Vladimir Enchev
36ff2808bd Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2022-06-22 10:36:08 +03:00
Vladimir Enchev
b566e10847 Should execute DataGrid Reload() on LogicalFilterOperator and FilterCaseSensitivity change 2022-06-22 10:36:01 +03:00
TheNoNinja
1b4fbf17a8 Get total item count after loading the data into the datagrid (#500)
Co-authored-by: ChristiaanBrant <Christiaan.Brant@Notilyze.com>
2022-06-22 10:30:38 +03:00
Vladimir Enchev
1475b1a299 Fixed DataGrid will not clear all filters on Reset() 2022-06-22 10:22:59 +03:00
Vladimir Enchev
147c5455ff Fixed DropDownDataGrid will not clear selection when set @bind-Value to null 2022-06-22 10:18:36 +03:00
Vladimir Enchev
73bfd9b66c Fixed collection was modified exception with async data binding 2022-06-22 09:15:40 +03:00
Atanas Korchev
f5fa061392 Improve Chart tooltip positioning. Reduce the number of roundrips required to display a tooltip. 2022-06-21 14:57:26 +03:00
Atanas Korchev
71b50171de Delete unnecesary Category() call. Allow toggling the visibility of series in LegendClick. 2022-06-21 11:54:18 +03:00
Paul Ruston
a172caba24 LegendClick after fork recreate 202206181900 2022-06-21 11:54:18 +03:00
Vladimir Enchev
ab39c3bbdb ContextMenu removed from tree demo 2022-06-20 11:36:27 +03:00
Vladimir Enchev
29733cc474 ContextMenu example added to Tree demo 2022-06-20 11:35:29 +03:00
Vladimir Enchev
00a358cfb6 Radzen.Blazor PackageReference Version set to * 2022-06-20 10:39:50 +03:00
Vladimir Enchev
000475884d DropDownDataGrid CellRender and RowRender events added
Fix #496
2022-06-20 10:10:05 +03:00
Vladimir Enchev
49b2cda0c2 Fixed Chromium browsers will crash on popup open from frozen cell 2022-06-20 09:57:44 +03:00
Domen
fdf229400a Removed duplicated code from SCSS, Changed positionCSS 2022-06-17 10:12:22 +03:00
Domen
c79d485d69 Added TopRight and BottomRight position to TabPositon 2022-06-17 10:12:22 +03:00
Vladimir Enchev
3f9aa621d1 Version updated 2022-06-16 10:06:17 +03:00
Atanas Korchev
c94c00d933 Expose the EditContext property of RadzenTemplateForm as a parameter. 2022-06-15 13:36:47 +03:00
Max Reble
e540855bf9 fixes #471
if endtime is > 24h appointments now will be shown
2022-06-15 13:32:11 +03:00
Johan
e3d55f4e3d Possible to set placeholder for HtmlEditorFormatBlock 2022-06-14 16:03:07 +03:00
Johan
988fc92456 Possible to set placeholder for HtmlEditorFontSize 2022-06-14 16:03:07 +03:00
Johan
c02b153ef1 Possible to set placeholder for HtmlEditorFontName 2022-06-14 16:03:07 +03:00
Atanas Korchev
70ca4893ba Make the title inline. 2022-06-14 15:58:34 +03:00
Carsten Heinrich
4e15d3779c Change span to div to enable a valid <h..> inside 2022-06-14 15:58:34 +03:00
Atanas Korchev
f924a18d07 Temporarily use strings for categories. 2022-06-14 08:27:07 +03:00
Vladimir Enchev
bce1ec1c66 Version updated 2022-06-13 15:28:28 +03:00
Vladimir Enchev
7c4347ad9b Fixed error when navigating to route
Fix #485
2022-06-13 15:27:35 +03:00
Vladimir Enchev
820c594c1e Fixed low level example categories not expanded on filter 2022-06-13 10:45:25 +03:00
thedomingo
5c2d319b3a Add ProgressBarStyle to RadzenProgressBar (#482)
* Added ProgressBarStyle to ProgressBar

* Added test and demo

* Improved css, updated test, updated demo page
2022-06-13 09:21:17 +03:00
Instant.SC
ff62cc55c2 Fix right edge cropping of the filter button (#484) 2022-06-13 09:19:33 +03:00
Atanas Korchev
dee872fec2 Expose TickDistance to allow developers to set it. 2022-06-09 10:17:11 +03:00
Vladimir Enchev
87b670ca4e version updated 2022-06-09 09:15:54 +03:00
Vladimir Enchev
60c4c2f526 Fixed DataGrid infinite loop with LoadData and virtualization 2022-06-03 15:41:29 +03:00
yordanov
6fd03f826c Fix links alignment in breadcrumb 2022-06-03 14:30:09 +03:00
Vladimir Enchev
365cdb9fef Version updated 2022-06-02 09:15:39 +03:00
Vladimir Enchev
4342602202 Changing Tabs item visibility will reset selected tab to first in TabRenderMode.Client 2022-06-02 09:14:49 +03:00
Atanas Korchev
a168c10938 RadzenHtmlEditor sometimes does not allow specifying the text when the insert link tool is used. 2022-05-31 10:22:33 +03:00
Vladimir Enchev
09da6f870a Fixed DropDownDataGrid selection when AllowRowSelectOnRowClick is set to false 2022-05-30 11:32:14 +03:00
Vladimir Enchev
8a4b334d20 ContextMenu should not be closed when expanding child items 2022-05-27 15:40:11 +03:00
Atanas Korchev
4f6916a2df RadzenUpload can have an Icon. 2022-05-27 13:19:24 +03:00
Vladimir Enchev
14a9c94944 Export demo and controller updated 2022-05-26 11:41:56 +03:00
Atanas Korchev
6ad0fda364 Update documentation about .NET 6 and use Blazor Server and Blazor WebAssembly. 2022-05-26 10:20:27 +03:00
Atanas Korchev
491c124ac1 The HeadOutlet was not rendered correctly. 2022-05-26 10:20:27 +03:00
Vladimir Enchev
81cb7b4f84 Radzen.Blazor version updated 2022-05-26 10:07:53 +03:00
Vladimir Enchev
90c91c2b16 DataGrid group cannot be expanded when collapsed on first render in GroupRowRender
Fix #472
2022-05-26 09:57:17 +03:00
Vladimir Enchev
161d2810a3 Fixed DropDownDataGrid @bind-Value will not select item when bound using LoadData 2022-05-26 09:46:33 +03:00
Vladimir Enchev
9c0dae8d9a DataGrid boolean column filtering toggle fixed 2022-05-25 11:57:14 +03:00
Vladimir Enchev
6375be4d2c Virtualize panel will need double refresh when using LoadData :( 2022-05-25 11:37:00 +03:00
Atanas Korchev
64234815cc Do not check parent checkbox if AllowCheckParents is false. 2022-05-25 11:17:33 +03:00
Vladimir Enchev
b56d4d1ca3 Fixed virtualized DropDownDataGrid not reloaded properly on clear filter when bound using LoadData 2022-05-23 16:02:50 +03:00
Vladimir Enchev
8d31b287f2 Version updated 2022-05-23 09:31:16 +03:00
Vladimir Enchev
8e59d905ba Demos filtering fixed
#470
2022-05-23 09:30:16 +03:00
Vladimir Enchev
028661f9f8 Fixed DataGrid sorting when grouped 2022-05-20 10:26:05 +03:00
Vladimir Enchev
f6189c6d8a Version updated 2022-05-19 09:31:03 +03:00
Vladimir Enchev
ee677ced24 Fixed DropDownDataGrid selected item lost on paging when using LoadData binding 2022-05-18 09:40:16 +03:00
Vladimir Enchev
5f5c142d03 Fixed DropDownDataGrid will not select item on initial value set using @bind-Value 2022-05-18 09:18:54 +03:00
Benjamin Vertonghen
2a7fe455ad FIX GetDescription instead of Description for localization Enum Filter (#463) 2022-05-17 08:59:46 +03:00
Vladimir Enchev
047469de5b Version updated 2022-05-16 09:48:55 +03:00
Benjamin Vertonghen
7a61a68f00 Add Display Attribute and localization for Enum Filter (#455)
* Add Display Attribute and localization

* Fix simple mode and use actual value not string.
2022-05-12 16:01:23 +03:00
SUBRAHMANYA ORUGANTI
50f71390f8 Made RadzenDataGridColumn.GetValue as virtual 2022-05-09 14:25:13 +03:00
Vladimir Enchev
fba7bb68fe Version updated 2022-05-09 09:49:59 +03:00
Vladimir Enchev
2f6749bf5e DatePicker TimeOnly parse fixed 2022-05-04 08:52:08 +03:00
Vladimir Enchev
9253c6dd7b DataGrid enum filter enabled for Simple and SimpleWithMenu filtering modes. EnumFilterSelectText property added. 2022-05-03 13:31:14 +03:00
Vladimir Enchev
e23ad8239b Version updated 2022-05-02 12:38:25 +03:00
Vladimir Enchev
2f9e624c31 Drag demo deleted 2022-04-29 16:01:11 +03:00
Vladimir Enchev
a336b50e0f Drag Documentation and Heading turned off 2022-04-29 15:23:27 +03:00
Vladimir Enchev
5bc4a96e77 empty comit 2022-04-29 15:17:06 +03:00
Vladimir Enchev
113ba8223c Drag example added 2022-04-29 15:00:57 +03:00
Vladimir Enchev
a760150d75 Null ref. exception fixed 2022-04-29 09:27:28 +03:00
Vladimir Enchev
42a52dc606 DataGrid group by column will use ascending sort order if column is not sorted 2022-04-28 15:02:30 +03:00
Vladimir Enchev
b0c45c115e Fixed AutoComplete e.target.closest is not a function error 2022-04-28 14:55:09 +03:00
Vladimir Enchev
6a427a04ff DataGrid Groups.Clear() will not restore column visibility if HideGroupedColumn=true 2022-04-28 10:48:55 +03:00
Vladimir Enchev
1959c009fd version updated 2022-04-28 07:13:51 +03:00
Vladimir Enchev
35f5bdd483 DataGrid UpdatePickableColumn() exception fixed 2022-04-28 07:13:43 +03:00
Vladimir Enchev
ff422bae19 Version updated 2022-04-27 11:46:53 +03:00
Vladimir Enchev
f2e4d5cc1b Tooltip arrow render lag fixed 2022-04-27 11:45:26 +03:00
Vladimir Enchev
5fba69cad3 Context menu closed on item click 2022-04-27 10:19:12 +03:00
Vladimir Enchev
a1385956aa Step item Template property added 2022-04-27 10:08:11 +03:00
Atanas Korchev
9493cbc6ff RadzenUpload cannot upload files larger than 2GB. Breaking change if using the UploadProgressArgs class 2022-04-27 08:59:15 +03:00
Vladimir Enchev
0762841ef0 DataGrid enum filtering example added 2022-04-26 10:43:48 +03:00
Vladimir Enchev
e94fb73fd2 Numeric Format not applied if value is deleted and changed to the same
Fix #437
2022-04-26 09:25:39 +03:00
Atanas Korchev
6cb5f738d4 Certain component styles (info) do not work in tr-TR culture. 2022-04-25 11:21:29 +03:00
Benjamin Vertonghen
1b66d6fe4d DataGrid Filtering on Enum and Nullable Enum (#435)
* Enum Filtering

* Typo
2022-04-25 07:58:29 +02:00
Vladimir Enchev
3a9511a6b2 Radzen.Blazor version updated 2022-04-21 09:30:46 +03:00
Vladimir Enchev
70cfcda727 Fieldset should not render legend if not needed 2022-04-21 08:46:44 +03:00
Vladimir Enchev
ef7ab11078 DataGrid column picker not update on column Visible change
Fix #432
2022-04-20 09:36:23 +03:00
Vladimir Enchev
14ad9618d3 Dashboard DataGrid user filtering improved 2022-04-20 09:09:54 +03:00
Andrew Buchanan
41ce3d862c Add Minimum Date, Maximum Date, Initial Month/Year, and SameStyleForA… (#409)
* Add Minimum Date, Maximum Date, Initial Month/Year, and SameStyleForAllDays

* Rename DatePicker MinimumDate/MaximumDate Parameters to Min/Max.  Rename InitialMonth to InitialViewDate. Remove new SameStyles Parameter and replace it with a new class rz-datepicker-other-month.

Co-authored-by: Andrew Buchanan <andrew@addos.ca>
2022-04-19 16:04:06 +03:00
Vladimir Enchev
2ae9e8bb6f DataGrid groups expand/collapse fixed when GroupFootersAlwaysVisible=true
Fixed #430
2022-04-19 13:41:26 +03:00
Vladimir Enchev
8ebdaee97f Version updated 2022-04-18 09:06:25 +03:00
Vladimir Enchev
9dab0f0c03 Fixed TabIndex not properly working for RadzenDropDownDataGrid
Fix #427
2022-04-15 10:33:47 +03:00
Vladimir Enchev
3144a6b5fd Various DataGrid examples title fixed 2022-04-15 09:53:23 +03:00
Vladimir Enchev
f6ed045b8f Fixed Numeric spinner icon hiding value partially 2022-04-15 09:49:21 +03:00
Atanas Korchev
b31c29b440 Allow the user to set the style of a splitter pane. 2022-04-14 16:04:33 +03:00
Atanas Korchev
0bf4181056 Use self-hosted analytics. 2022-04-14 09:01:54 +03:00
Vladimir Enchev
ff3fc84563 Version updated 2022-04-13 09:51:42 +03:00
Vladimir Enchev
644af53193 DataGrid group row expand state not persisted when set in GroupRowRender FirstRender
Fix #425
2022-04-13 09:48:52 +03:00
yordanov
b52eb24e85 Add banner 2022-04-12 13:04:21 +03:00
douglassimaodev
b0ee04fab2 Fixing error when YearRange is set but from calledar arrow <, > was allowing changing to a different year (#423)
Co-authored-by: douglas <douglas.simao@sgs.com>
2022-04-12 08:59:20 +03:00
yordanov
0b01f5ec1c Update readme content 2022-04-11 17:34:14 +03:00
Vladimir Enchev
310a2f5443 DropDown and ListBox items key set improved 2022-04-11 16:49:15 +03:00
Vladimir Enchev
9c7de1a8fe empty commit 2022-04-11 10:38:41 +03:00
Vladimir Enchev
2ff2d55f25 Version updated 2022-04-11 10:20:20 +03:00
Vladimir Enchev
3d5e7be6b6 DataGrid not updated after column OrderIndex change runtime 2022-04-11 10:16:01 +03:00
Vladimir Enchev
4bce655cb6 DataGrid string columns IsNull/IsNotNull filtering fixed 2022-04-11 09:40:14 +03:00
Peter Egunjobi
f2aa01d23c Dropdown reinitialization fix (Resolves #419) (#420)
* Update RadzenListBox.razor.cs

```item``` is a reference object, and this is not situable to be used as a key, because it is likely to change even though the properties of the object remain unchanged. Instead, we should use the ```ValueProperty``` as the key. This is most likely to be a primitive and also unique. If it isn't provided, the ```item``` is used (from what I understand about the ```PropertyAccess.GetItemOrValueFromProperty()``` implementation.

* Update RadzenDropDown.razor.cs

```item``` is a reference object, and this is not situable to be used as a key, because it is likely to change even though the properties of the object remain unchanged. Instead, we should use the ```ValueProperty``` as the key. This is most likely to be a primitive and also unique. If it isn't provided, the ```item``` is used (from what I understand about the ```PropertyAccess.GetItemOrValueFromProperty()``` implementation.
2022-04-11 09:16:44 +03:00
Atanas Korchev
37907ed7f6 Set bar and column series tooltip border to Fill or Fills if specified. 2022-04-08 10:51:20 +03:00
yordanov
17d34ae443 Add link to component's source code 2022-04-07 16:35:35 +03:00
Vladimir Enchev
5e442d43aa Version updated 2022-04-07 07:22:30 +03:00
Atanas Korchev
3594c81b17 Introduce a Hidden property for chart series which allows the developer to hide a series bit still make it show later by clicking the corresponding label in the legend. 2022-04-06 18:38:14 +03:00
Atanas Korchev
221c830d60 Set line and area series border to stroke or fill if specified. 2022-04-06 18:27:13 +03:00
Atanas Korchev
962c2db587 RadzenChart sometimes displays a tooltip for the wrong series. 2022-04-06 18:19:31 +03:00
yordanov
e22d3367ba Update BreadCrumb styling and demo 2022-04-06 13:09:38 +03:00
Marco Papst
27df815529 fix parameter name in breadcrumb page demo 2022-04-06 11:33:02 +03:00
Marco Papst
64ad14ae80 revert files 2022-04-06 11:33:02 +03:00
Marco Papst
3de09dc8db fix code style 2022-04-06 11:33:02 +03:00
Marco Papst
170aede49f revert files 2022-04-06 11:33:02 +03:00
Marco Papst
9ab740e53b add Id to RadzenBreadcrumb 2022-04-06 11:33:02 +03:00
Marco Papst
ddd4a806e1 replace items with child content 2022-04-06 11:33:02 +03:00
Marco Papst
5b4b427589 add docs page 2022-04-06 11:33:02 +03:00
Marco Papst
67900764f0 format tests 2022-04-06 11:33:02 +03:00
Marco Papst
df3995f0bb rework RadzenBreadCrumb to allow Child Items 2022-04-06 11:33:02 +03:00
Marco Papst
96278eb6d4 rework RadzenBreadCrumb to allow child items 2022-04-06 11:33:02 +03:00
Marco Papst
b012abbffb add Bread Crum Examples 2022-04-06 11:33:02 +03:00
Marco Papst
cd52110e95 add BreadCrumb Tests 2022-04-06 11:33:02 +03:00
Marco Papst
eba00e0e26 add BreadCrumb Component 2022-04-06 11:33:02 +03:00
Atanas Korchev
baab38c7f6 Prevent out of range exceptions in pie and donut tooltips. 2022-04-05 10:09:13 +03:00
Vladimir Enchev
539530bcb9 DropDown cannot select item when OpenOnFocus is set to true and already focused 2022-04-04 08:03:00 +03:00
Vladimir Enchev
829cdec53c Version updated 2022-03-31 08:59:54 +03:00
Vladimir Enchev
1bbe89f962 DatePicker rz-datepicker-title inline style height removed 2022-03-31 08:50:58 +03:00
Vladimir Enchev
1ae9724d34 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2022-03-30 11:52:50 +03:00
Vladimir Enchev
d71142a253 OpenOnFocus checked when opening from click 2022-03-30 11:52:48 +03:00
Atanas Korchev
ca0437d765 RadzenScheduler events do not take MinutesPerSlot into account. 2022-03-30 10:30:17 +03:00
Vladimir Enchev
7e4619c2ae DropDown and DropDownDataGrid OpenOnFocus property added 2022-03-30 09:49:41 +03:00
Vladimir Enchev
65dd9e26e9 DropDownDataGrid open on ENTER key added 2022-03-30 09:40:37 +03:00
Vladimir Enchev
fe788ca5dc code fixed 2022-03-30 09:25:48 +03:00
Vladimir Enchev
4e3fd87481 Fixed SelectBar will not select item with null value 2022-03-30 09:21:18 +03:00
Trent Adams
6244663e80 Updated Index.md (#407)
Spelling issue in regards to support. Fixed "of you require" to "if you require..."
2022-03-30 09:00:50 +03:00
Vladimir Enchev
3bce988e12 DataGrid column GetVisible() made public 2022-03-29 16:55:07 +03:00
Vladimir Enchev
0fcc9e112a Version updated 2022-03-28 10:22:14 +03:00
Vladimir Enchev
d083ae6d0e Fixed DatePicker changing AM/PM not working in some cases 2022-03-28 09:44:57 +03:00
Vladimir Enchev
ddffc72e76 Fixed ContextMenu opens only once in WASM 2022-03-28 09:28:42 +03:00
Atanas Korchev
20d22fa036 CheckBox does not work inside <label> 2022-03-27 21:08:29 +03:00
Vladimir Enchev
ccb923ecc4 project updated 2022-03-25 15:31:09 +02:00
Vladimir Enchev
90f98c69c5 Version updated 2022-03-25 15:14:06 +02:00
acordts
2f273777b2 remove label attribute from span tag (fix #403) (#404)
Co-authored-by: Albrecht Ziegler-Cordts <albrecht.ziegler-cordts@t-systems.com>
2022-03-25 10:56:01 +02:00
Vladimir Enchev
3936960caf DataGrid OrderByDescending() method fixed
Fix #402
2022-03-25 10:08:52 +02:00
Vladimir Enchev
e32262a3b3 DataGrid HideGroupedColumn fixed to work with runtime add of GroupDescriptor 2022-03-25 10:00:31 +02:00
Vladimir Enchev
bc9d7f7c2a DatePicker exception with DateTime.MinValue fixed 2022-03-25 09:38:04 +02:00
mrossberg
71fe870b1d On Disposal of RadzenSplitButton: Close popup (#401) 2022-03-24 16:07:54 +02:00
Vladimir Enchev
28a0456fa7 Version updated 2022-03-24 09:42:11 +02:00
Vladimir Enchev
ad7e00add5 DataGrid ShowMultiColumnSortingIndex property added 2022-03-22 11:46:41 +02:00
Vladimir Enchev
6e5749063c DataGrid Group event and HideGroupedColumn property added 2022-03-22 10:27:09 +02:00
Vladimir Enchev
048de253a9 DataGrid Sort, Filter and Page events added 2022-03-22 10:05:11 +02:00
Vladimir Enchev
c6c9578691 version updated 2022-03-21 11:23:33 +02:00
Vladimir Enchev
b052c04749 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2022-03-21 09:35:22 +02:00
Vladimir Enchev
5085255f61 DataGrid column CloseFilter() method added 2022-03-21 09:35:14 +02:00
Atanas Korchev
cd306135ad Remove setTitle invocation. 2022-03-21 09:22:27 +02:00
Vladimir Enchev
fbb9cac178 Fixed DropDown item requires two clicks to select 2022-03-18 10:22:04 +02:00
Vladimir Enchev
291210aadf DataGrid columns picker text properties added 2022-03-18 09:30:38 +02:00
Vladimir Enchev
458a9b9907 DropDownDataGrid click to open popup area fixed 2022-03-17 17:51:24 +02:00
mmmmmarco
d210feab0d Datepicker footer placeholder (#400)
* Toevoegen footer template

* Add unit test

* Add demo

* Don't render footer if no footerTemplate is set
2022-03-17 14:45:45 +02:00
Vladimir Enchev
c3aaf78161 Version updated 2022-03-17 10:31:32 +02:00
Vladimir Enchev
a86c7c6c1e Reverted switch to default preprocessor constants 2022-03-17 10:31:07 +02:00
Vladimir Enchev
8f79204fbc Version updated 2022-03-17 10:05:46 +02:00
Vladimir Enchev
c21823c84e code fixed 2022-03-17 10:04:04 +02:00
Vladimir Enchev
c40f64a193 code fixed 2022-03-17 09:54:39 +02:00
Vladimir Enchev
f42cd221cc Version updated 2022-03-17 09:10:25 +02:00
Vladimir Enchev
a8dc2a07db Added MarkupString support for Notification message 2022-03-16 11:16:53 +02:00
Vladimir Enchev
93e27f318d Tree CheckedValues exception fixed 2022-03-14 17:04:38 +02:00
Vladimir Enchev
7ecb3ccf46 DatePicker StartDate handles DateTime.MinValue 2022-03-14 10:54:10 +02:00
Marcel Roozekrans
1dd48aa3f1 DatePicker: Added support for DateTime Min and Max. (#394) 2022-03-14 10:48:18 +02:00
Vladimir Enchev
9ee7c6809a various tests fixed
#396
2022-03-14 09:36:26 +02:00
Vladimir Enchev
4eec46012a Switched to default preprocessor constants 2022-03-08 15:34:10 +02:00
Vladimir Enchev
455edff025 version updated 2022-03-07 10:30:41 +02:00
Vladimir Enchev
79a43fe897 Fixed DataGrid with virtualization calls LoadData 5 times on initial creation
Fix #392
2022-03-04 10:13:26 +02:00
Vladimir Enchev
34306f023c Numeric paste improved to accept numbers from string 2022-03-03 14:06:05 +02:00
Vladimir Enchev
e42baf816c Version updated 2022-03-03 09:27:15 +02:00
Atanas Korchev
f4cf76bc8f The id attribute of RadzenDropDown is used when generating the id of its popup. Allows styling specific popups. 2022-03-01 14:46:21 +02:00
Vladimir Enchev
d7ef57a24e DataGrid numeric columns LoadData Filter expression fixed for IsNull/IsNotNull 2022-02-28 17:14:56 +02:00
Vladimir Enchev
a349a3390c page updated 2022-02-28 16:27:12 +02:00
Vladimir Enchev
eae6e6ed8d Version updated 2022-02-28 10:44:32 +02:00
david-alonso-su
14d87875ae readFileAsBase64: set canvas size same as new image size. (#388)
Remove unnecesary parameters.
2022-02-25 10:40:01 +02:00
Vladimir Enchev
62d997c85a demo fixed 2022-02-25 10:28:21 +02:00
Vladimir Enchev
02f37b2eeb Tree will not dispose children on collapse (#387)
* Tree AllowToggleChildrenOnClient added

* Tree expand reworked
2022-02-25 10:27:13 +02:00
Vladimir Enchev
636e6b82be demo improved 2022-02-25 09:24:12 +02:00
Vladimir Enchev
72c544a512 DataGrid FilterMode=SimpleWithMenu will apply style to filter icon in case of active filter 2022-02-25 09:05:04 +02:00
Vladimir Enchev
97c7a4db17 DataGrid FilterMode=SimpleWithMenu will disable inputs in case of IsNull/IsNotNull filters 2022-02-25 08:59:30 +02:00
Atanas Korchev
aa8b4881ce Update CONTRIBUTING.md 2022-02-25 08:41:24 +02:00
Vladimir Enchev
c6d37a4281 demo marked as updated 2022-02-24 10:16:22 +02:00
Vladimir Enchev
05b269c0cf Version updated 2022-02-24 10:05:24 +02:00
Vladimir Enchev
07d14cee67 DataGrid simple filter with menu added (#384)
* DataGrid FilterMode SimpleWithMenu added

* filter menu improved

* DoesNotContain fixed

* DatePicker will open popup on input click if AllowInput=false

* rz-readonly to DatePicker input

* rz-readonly to datepicker theme
2022-02-23 08:54:51 +02:00
yordanov
70fb35bd25 Update Material icons font 2022-02-22 11:18:12 +02:00
Atanas Korchev
574f4f90da DonutChart glitches in cultures that use comma as decimal separator. 2022-02-21 17:45:14 +02:00
Vladimir Enchev
6a951e1325 demo fixed 2022-02-21 14:52:42 +02:00
Vladimir Enchev
4a1abadd09 Version updated 2022-02-21 13:04:53 +02:00
Vladimir Enchev
84bd0af02e DataGrid column Visible fixed when AllowColumnPicking is true
Fix #382 #381
2022-02-21 13:01:56 +02:00
david-alonso-su
115b838d3c RadzenFileInput: Add MaxWith And MaxHeight to resize FileInput Image. (#379) 2022-02-21 09:43:21 +02:00
Ben Gavin
13032e726b Support for Remove/Clear to the RadzenUpload control #376 (#377)
* ADD:  Support for Remove/Clear to the RadzenUpload control #376
FIX:  Preview URLs generated during file selection are not freed on removal

* FIX:  Clear local preview files on file re-selection

Co-authored-by: Ben Gavin <ben.gavin@corebts.com>
2022-02-21 09:37:14 +02:00
Vladimir Enchev
cf6efbaa2d DropDownDataGrid demo improved 2022-02-21 09:37:02 +02:00
pigwing
580db415d6 add AllowRowSelectOnRowClick property at RadzenDropDownDataGrid (#383)
* added missing PageSizeText parameter

* add AllowRowSelectOnRowClick property at RadzenDropDownDataGrid,when use DropDown component in RadzenDropDownDataGridColumn template,change the DropDown value will trigger RadzenDataGrid.OnRowSelect
2022-02-21 09:24:33 +02:00
Vladimir Enchev
30b2d1d913 DropDownDataGrid ValueTemplate property added 2022-02-18 16:47:25 +02:00
Vladimir Enchev
510b2bcdd5 Handle defined in razor DataGrid column OrderIndex 2022-02-18 14:51:15 +02:00
Vladimir Enchev
30856325be DataGridColumnReoderPage updated 2022-02-18 14:27:04 +02:00
Vladimir Enchev
a5ab34b707 DropDown, DropDownDataGrid and ListBox AllowClear when Value is not bound fixed 2022-02-18 13:29:29 +02:00
Vladimir Enchev
90ee139265 DataGrid column OrderIndex property added 2022-02-18 11:58:30 +02:00
Vladimir Enchev
1e298edbdd DataGrid state not updated properly after column reorder in .NET 3.1 2022-02-18 10:07:52 +02:00
Vladimir Enchev
925afb70c3 version updated 2022-02-18 08:51:07 +02:00
Vladimir Enchev
c399b850c5 DropDownDataGrid not updated properly on Data change 2022-02-18 08:50:45 +02:00
Vladimir Enchev
8cf03e3ee3 Version updated 2022-02-17 09:21:51 +02:00
Atanas Korchev
e6ba1fc61b Disable the responsive mode of RadzenSidebar if it is not nested inside RadzenLayout. 2022-02-16 15:37:43 +02:00
Vladimir Enchev
a2a434d6fd comment removed 2022-02-16 10:09:35 +02:00
Vladimir Enchev
fe00182efd various warnings fixed 2022-02-16 09:40:33 +02:00
Vladimir Enchev
b00fcc25ea DialogOptions CloseDialogOnEsc property added 2022-02-15 17:28:32 +02:00
Vladimir Enchev
e9624ab6d6 Close dialog on ESC added 2022-02-15 17:03:03 +02:00
Vladimir Enchev
c2d129aaa6 DropDown, ListBox and DropDownDataGrid wrong selection on Data change fixed 2022-02-15 09:24:08 +02:00
Vladimir Enchev
6b3b7d6945 version updated 2022-02-14 15:22:08 +02:00
Vladimir Enchev
1889b840b1 Menu and ProfileMenu z-index raised
Related to f5057c2ac7
2022-02-14 13:32:52 +02:00
Atanas Korchev
bfb1a4ef23 Unsubscribe from event before subscribing to avoid memory leaks. 2022-02-14 12:34:10 +02:00
Atanas Korchev
f178f31248 Icons are missing if the Text property of a scheduler view is set. 2022-02-14 11:43:31 +02:00
Vladimir Enchev
9c13832307 DataGrid frozen column styles not regenerated when column Visible changed runtime
Fix #371
2022-02-14 10:57:19 +02:00
Vladimir Enchev
1c3f87165e DataGrid column Pickable property added 2022-02-14 10:36:02 +02:00
Vladimir Enchev
c6ce339d40 DataGrid column MinWidth property added 2022-02-11 08:37:36 +02:00
Vladimir Enchev
5a90b00e19 Version updated 2022-02-11 08:27:34 +02:00
Atanas Korchev
e6bf8b5321 Add Responsive property to RadzenSidebar. 2022-02-10 16:35:20 +02:00
Atanas Korchev
156e493a90 Invoke own StateHasChanged when the Refresh method of DialogService is called. Fixes #363. 2022-02-10 15:43:35 +02:00
Vladimir Enchev
2cf073495c version updated 2022-02-10 14:33:11 +02:00
Vladimir Enchev
43b193e965 DropDown and DropDownDataGrid multiple selected items label fixed 2022-02-10 14:32:51 +02:00
yordanov
b4b8dfb217 Fix light button colors 2022-02-10 12:12:57 +02:00
Vladimir Enchev
99051af886 DataGrid Column Picker added
Based on https://github.com/radzenhq/radzen-blazor/pull/344
2022-02-10 10:58:09 +02:00
Vladimir Enchev
768926fec3 code fixed 2022-02-10 10:48:37 +02:00
yordanov
a73042abc1 Update RadzenGrid simple filtering UI 2022-02-09 18:29:48 +02:00
Vladimir Enchev
da36e3c1fa IJSRuntime param added 2022-02-09 13:59:17 +02:00
Vladimir Enchev
0024e3e74d Version updated 2022-02-09 10:58:30 +02:00
yordanov
9b14caf300 Delete commented styles 2022-02-09 10:55:16 +02:00
yordanov
adee153190 Update UI for simple mode filtering 2022-02-09 10:55:16 +02:00
Vladimir Enchev
c476cd7f25 Fixed #366 2022-02-09 10:30:00 +02:00
Vladimir Enchev
d4da6b02a8 LengthValidator not not notified when DropDownDataGrid value is selected 2022-02-08 11:10:41 +02:00
yordanov
1d3f651846 Add rz-body css class 2022-02-07 14:51:45 +02:00
yordanov
d6af0ffc95 Set translateZ to rz-body 2022-02-07 14:50:05 +02:00
yordanov
c1ba96d395 Add min-width to Pager's page buttons 2022-02-07 14:18:19 +02:00
Vladimir Enchev
52f53e3410 DropDownDataGrid EmptyTemplate added
Fix #359
2022-02-07 10:51:41 +02:00
Vladimir Enchev
aba4875cf3 version updated 2022-02-04 15:00:10 +02:00
Vladimir Enchev
f5057c2ac7 Revert fix for #339 2022-02-04 14:59:58 +02:00
Marc Mauri
cfd5558765 Reset Password shall throw event with an empty username (#360)
Co-authored-by: Marc Mauri <marc@kaizenforpharma.com>
2022-02-04 09:37:59 +02:00
Vladimir Enchev
77bbeb6de0 version updated 2022-02-03 13:32:25 +02:00
Vladimir Enchev
bf3e22bf4c DropDown, DropDownDataGrid and ListBox Value binding improved 2022-02-03 13:29:23 +02:00
Vladimir Enchev
a5596ac8f6 CheckBox typo fixed 2022-02-03 11:23:14 +02:00
Vladimir Enchev
a3dddfa7f8 DataGrid GroupRowExpand/GroupRowCollapse events added 2022-02-01 22:09:14 +02:00
Vladimir Enchev
922abe8ba3 DataGrid IsNull/IsNotNull filtering not working properly on columns bound to string property 2022-02-01 21:58:09 +02:00
Vladimir Enchev
9b85f8673c DialogService Confirm AutoFocusFirstElement support added 2022-02-01 21:46:01 +02:00
Vladimir Enchev
b8e0bf92c2 DataGrid simple filtering should respect column FormatString or DataGrid FilterDateFormat
Close #279
2022-02-01 09:59:07 +02:00
Vladimir Enchev
05c7adbfee Version updated 2022-01-31 14:51:36 +02:00
Benjamin Vertonghen
4081802dc8 FIX: Menu in DataGrid shows incorrectly due to z-index (#356)
* FIX: Menu in DataGrid

* rz-navigation-menu z-index lowered from 20 to 2

Co-authored-by: Vladimir Enchev <vladimir.enchev@gmail.com>
2022-01-31 14:50:54 +02:00
Benjamin Vertonghen
45fb1cd801 Click on MenuItem (#354) 2022-01-31 12:21:10 +02:00
Vladimir Enchev
50ed4a6988 DataGrid header cell sorting outline border removed
We will try to provide better focus styles in our themes
2022-01-31 09:46:37 +02:00
Carsten Heinrich
96997e95a0 Enable sorting on RadzenDataGrid by keyboard (#351)
to increase the accessibility it is necassary to sort the RadzenDataGrid by keyboard

Co-authored-by: Carsten Heinrich <carsten.heinrich@t-systems.com>
2022-01-31 09:45:06 +02:00
Carsten Heinrich
9029a64a19 Insert additional header-attribute "aria-sort" so that the screen reader recognizes the sorting. (#358)
Co-authored-by: Carsten Heinrich <carsten.heinrich@t-systems.com>
2022-01-31 09:28:28 +02:00
Vladimir Enchev
cb6c9dd374 DataGrid cells colspan made recursive 2022-01-30 12:44:40 +02:00
Vladimir Enchev
5b1e9d3f16 DataGrid colspan fixed with multiple composite columns 2022-01-29 09:18:06 +02:00
Vladimir Enchev
ceb1f954ff DataGrid SecondFIlterValue not set to null on Reset() 2022-01-28 19:18:30 +02:00
Atanas Korchev
f67e4f953f DataGrid has gaps on desktop browsers in responsive mode. 2022-01-28 12:49:35 +02:00
Vladimir Enchev
76c071da14 FileInput ImageClick event added 2022-01-28 10:00:53 +02:00
Vladimir Enchev
c8dafae31d Version updated 2022-01-27 09:28:17 +02:00
Vladimir Enchev
1924056c02 Sidebar expand logic improved (#352)
* Add Sidebar expand and collapse CSS classes

* Initialize Expanded on load.

* Introduce RadzenMediaQuery.

* Use addListener instead of addEventListener to support older browsers.

* Fix redraw under WebKit

Co-authored-by: yordanov <vasil@yordanov.info>
Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2022-01-27 09:26:25 +02:00
Vladimir Enchev
257dd22345 DataGrid grouping will not apply sorting if GroupDescriptor SortOrder is null 2022-01-27 09:22:24 +02:00
Vladimir Enchev
4211259874 Dialog bottom option setting fixed 2022-01-26 19:59:44 +02:00
Vladimir Enchev
9fa7d0182d Menu and ProfileMenu items should be over DataGrid header 2022-01-26 15:00:45 +02:00
Vladimir Enchev
8a00736c8f Frozen composite columns disabled
until we find a way to calculate properly left for frozen cells in composite columns
2022-01-26 13:47:36 +02:00
Vladimir Enchev
f1fd6b6d8b DataGrid composite columns colspan logic fixed 2022-01-25 20:03:07 +02:00
Ben Gavin
b1adad5866 FIX: Close popup when 'Tab'ing from control (#349)
FIX: Styling/layout fixes for validated control

Co-authored-by: Ben Gavin <ben.gavin@corebts.com>
2022-01-25 09:37:27 +02:00
Vladimir Enchev
f8aaa21b39 categories marked as updated 2022-01-24 14:35:53 +02:00
Vladimir Enchev
6b207e29fc Various demos marked as updated 2022-01-24 14:27:39 +02:00
Vladimir Enchev
4effb7cfdd Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2022-01-24 13:53:33 +02:00
Vladimir Enchev
83f48ac009 version updated 2022-01-24 13:53:24 +02:00
acordts
6788612ab5 add tabnavigation tabindex depending on disabled flag (#347)
Co-authored-by: Albrecht Ziegler-Cordts <albrecht.ziegler-cordts@t-systems.com>
2022-01-24 13:52:12 +02:00
Vladimir Enchev
8329c38894 DataGrid GroupRowRender event added 2022-01-24 11:26:11 +02:00
Vladimir Enchev
5e96f69c52 FileInput keyboard navigation improved 2022-01-24 09:30:18 +02:00
Atanas Korchev
f4c6b4f08d Always build SASS. 2022-01-21 11:47:36 +02:00
Vladimir Enchev
95fef77042 DataGrid AllowRowSelectOnRowClick property added (#341)
* DataGrid AllowRowSelectOnRowClick property added

* AllowRowSelectOnRowClick comment fixed

* DataGridMultipleSelection demo improved
2022-01-21 09:41:08 +02:00
pigwing
9814f44ead added missing PageSizeText parameter (#340) 2022-01-21 09:34:48 +02:00
Vladimir Enchev
13189c6c6c DataGrid header not working properly with bootstrap modal
Fix #339
2022-01-21 09:33:17 +02:00
Vladimir Enchev
aed16dfec6 version and demo updated 2022-01-20 16:17:45 +02:00
Vladimir Enchev
3167399da9 DataGridPagerHorizontalAlign fixed 2022-01-20 15:59:12 +02:00
Vladimir Enchev
c6b77fe861 version updated 2022-01-20 15:38:36 +02:00
yordanov
aa1e4ecb7d Update pager horizontal align in demos 2022-01-20 15:35:17 +02:00
yordanov
1b677770b6 Add Datagrid pager horizontal align demo page 2022-01-20 15:35:17 +02:00
Vladimir Enchev
c707f20b3f DataGrid, DataList and DropDownDataGrid PagerHorizontalAlign and PagerAlwaysVisible properties added 2022-01-20 15:35:17 +02:00
Vladimir Enchev
c368e065b6 Pager HorizontalAlign property added 2022-01-20 15:35:17 +02:00
yordanov
90eab0573f Add page size description text to Pager 2022-01-20 15:35:17 +02:00
yordanov
35d7286eec Add styles for Pager horizontal alignment modes 2022-01-20 15:35:17 +02:00
Vladimir Enchev
b68fe58a23 Revert: Fixed DataGrid template row cell not spanned on all columns 2022-01-20 15:07:59 +02:00
Vladimir Enchev
ea133a96cd Fixed DataGrid template row cell not spanned on all columns 2022-01-20 15:02:24 +02:00
Vladimir Enchev
69e48c77a9 Composite Columns marked as new, Columns as updated 2022-01-20 14:46:21 +02:00
Vladimir Enchev
606fb38ae6 Version updated 2022-01-20 13:27:45 +02:00
Vladimir Enchev
b29955d191 DataGrid AllowCompositeDataCells property added 2022-01-20 13:27:10 +02:00
Vladimir Enchev
7539fb3699 DataGrid thead fixed to not scroll vertically 2022-01-20 12:48:05 +02:00
Vladimir Enchev
2d8911947a DataGrid composite column cells right border fixed 2022-01-20 12:05:41 +02:00
Vladimir Enchev
2044042973 DataGridCompositeColumns source fixed 2022-01-20 10:11:15 +02:00
Vladimir Enchev
dd02f890c2 Sorting and filtering disabled for DataGridConditionalTemplate 2022-01-20 09:23:55 +02:00
Vladimir Enchev
45ca2eaaca Version updated 2022-01-20 09:18:47 +02:00
Atanas Korchev
aaf535c33f RadzenPanelMenu always highlights an item with Path set to "/". 2022-01-20 08:57:35 +02:00
Vladimir Enchev
e9c6da2c11 DataGrid simple filter header cell tabindex="1" removed 2022-01-19 14:41:51 +02:00
Atanas Korchev
e2c8efe29f Do not dispose if the timer is null. 2022-01-19 14:28:35 +02:00
Vladimir Enchev
e76b789eb7 DataGrid composite columns support added (#334)
* composite columns

* headers cells render reworked

* composite columns render reworked again

* footer cells support added for composite columns

* code improved

* Row details template expand fixed

* Group, resize and reorder disabled for composite columns

* composite columns demo improved
2022-01-19 13:31:17 +02:00
Vladimir Enchev
75d1431e50 DataGrid GroupDescriptor SortOrder property added. Column SortOrder will be used when grouping. 2022-01-18 21:05:26 +02:00
yordanov
8a9da8a3ae Style badge for new and updated demos 2022-01-18 11:13:01 +02:00
Atanas Korchev
3b718b0461 Top level navigation items can have a badge too. 2022-01-18 10:24:16 +02:00
Atanas Korchev
65b0d1fc23 Navigation items support badges. 2022-01-18 10:13:13 +02:00
Atanas Korchev
c56ed37f7a Remove scrollToBottom. 2022-01-18 09:54:43 +02:00
Vladimir Enchev
340754d062 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2022-01-18 09:50:21 +02:00
Vladimir Enchev
db85c34e61 DataGrid will render rows when binding using LoadData if paging is disabled and no Count set 2022-01-18 09:49:35 +02:00
Atanas Korchev
807995fe8b Use PageTitle and HeadContent. Find nested examples. 2022-01-18 09:41:22 +02:00
Atanas Korchev
111120edaa Allow the developer to set the slot size in day and week view of RadzenScheduler. 2022-01-17 09:11:07 +02:00
Vladimir Enchev
0bac8d6ae3 Pager AlwaysVisible and DataGrid PagerAlwaysVisible properties added
Close #319
2022-01-17 09:05:49 +02:00
yordanov
2ba17d8d5b Update copyright year 2022-01-14 11:38:44 +02:00
yordanov
a61633194d Update copyright year 2022-01-14 11:31:26 +02:00
yordanov
caa86bb931 Update copyright year 2022-01-14 11:27:52 +02:00
Vladimir Enchev
cfe08bc542 Version updated 2022-01-13 09:07:11 +02:00
yordanov
4e55742219 Separate Upload Choose button styles from btn-secondary styles 2022-01-12 17:23:41 +02:00
Vladimir Enchev
f98ed62045 Fix #330 2022-01-12 13:23:11 +02:00
Vladimir Enchev
03653fb653 Various components item remove improved to check if component is disposed 2022-01-12 11:11:10 +02:00
Vladimir Enchev
240a89da2c DatePicker input name attribute missing 2022-01-12 10:40:34 +02:00
Vladimir Enchev
cfacd05578 Themes SASS with LibSassBuilder instead WebCompiler (#332)
* Use LibSassBuilder instead of WebCompiler.

* Remove dotnet-tools.json.

* Remove logging.

* Build SASS only once.

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2022-01-12 10:23:32 +02:00
Vladimir Enchev
c0ab5f955d Fixed #322 2022-01-11 11:54:52 +02:00
Atanas Korchev
f2346c5709 HtmlEditor does not allow pasting of plain text. 2022-01-11 09:20:32 +02:00
Vladimir Enchev
798bfc964c Version updated 2022-01-10 10:32:46 +02:00
Marco Papst
2af9014962 Add IconStyle Property to RadzenIcon (#324) 2022-01-10 10:11:14 +02:00
GioeEng
f8759278bc Fixes (#315)
* New splitter component

* New Splitter component

* Fixed code style and naming conventions

* themes implemented

* Splitter: Error in icon representation. Incorrect design compromised panel behavior

* 0

* Rename variables

Co-authored-by: lorenzo <lorenzo.muccioli@car-tech.com>
Co-authored-by: Vladimir Enchev <vladimir.enchev@gmail.com>
Co-authored-by: Vasil Yordanov <vasil@yordanov.info>
2022-01-07 12:22:37 +02:00
Lukas Grützmacher
abed1b0645 Wrap EmptyText in DataGrid (#323) 2022-01-07 09:27:14 +02:00
Vladimir Enchev
8999fc8fd6 Fixed RadzenNumeric error with unsigned integer types 2022-01-07 09:26:15 +02:00
Vladimir Enchev
a1f9db4114 Allow MarkupString to be used in Dialog Title 2022-01-07 09:20:53 +02:00
Vladimir Enchev
2336f1dc79 version updated 2022-01-06 09:32:54 +02:00
Atanas Korchev
335e177578 CheckBox uses click instead of mouseup. 2022-01-05 19:27:44 +02:00
Vladimir Enchev
a4434b16de DataGrid grouping support when virtualizing IQueryable 2022-01-05 10:46:48 +02:00
Vladimir Enchev
9b3624e818 Click on disabled date should not close the DatePicker
Fix #320
2022-01-04 09:53:35 +02:00
Vladimir Enchev
120a95f94d DataGrid will sort by grouped column 2022-01-04 08:57:40 +02:00
Atanas Korchev
db0a658be2 Cannot set the width of RadzenSplitButton. 2022-01-04 08:43:56 +02:00
yordanov
822a8afcb1 Add responsive styles to documentation-link 2021-12-30 16:11:18 +02:00
yordanov
eed371130f Rename link to component's docs 2021-12-30 16:11:18 +02:00
Vladimir Enchev
dd19c1040c Version updated 2021-12-30 09:25:10 +02:00
yordanov
54130e5ee7 Add responsive styles and icons to Scheduler nav views 2021-12-29 12:34:11 +02:00
Vladimir Enchev
827128d048 Slider will not calculate step properly when Min is set 2021-12-28 13:11:21 +02:00
Atanas Korchev
26c18562c4 PanelMenu matches URL which contain "-". Fixes #317. 2021-12-28 12:21:38 +02:00
Vladimir Enchev
0a847c8427 Version updated 2021-12-27 09:51:00 +02:00
yordanov
27a976fc53 DatePicker add cursor pointer to choosable dates - resolves #253 2021-12-24 15:59:21 +02:00
Atanas Korchev
73a3a881ca RadzenPanelMenu supports prefix matching. 2021-12-24 15:17:44 +02:00
Atanas Korchev
f07545285b Render theme stylesheet only once. 2021-12-24 15:05:57 +02:00
Vladimir Enchev
4d02883a48 ContextMenu should not show toggle button 2021-12-24 11:34:54 +02:00
yordanov
4eb9f0a0a4 Fix validator top padding in standard theme 2021-12-24 10:40:15 +02:00
Vladimir Enchev
1f630181d7 DataGrid filtering API demo updated 2021-12-23 19:55:11 +02:00
Vladimir Enchev
71a9b79527 version updated 2021-12-23 19:47:14 +02:00
Vladimir Enchev
b32d098d3b DataGrid column filter cannot be cleared even if specified in code 2021-12-23 19:47:06 +02:00
Vladimir Enchev
9118c1d64f version updated 2021-12-23 09:24:57 +02:00
Vladimir Enchev
8e4f7b0f08 DataGrid PageSize is wrong when using PageSizeOptions and LoadData
Fix #316
2021-12-23 09:24:46 +02:00
Vladimir Enchev
3acc0592b4 DataGrid HeaderCellRender and FooterCellRender events added 2021-12-21 11:14:58 +02:00
yordanov
dc5e24201c Update DataGrid loading indicator color and animation 2021-12-21 10:21:43 +02:00
yordanov
eda8f9ac86 Set tab panel border-radius with respect to TabPosition 2021-12-20 19:53:22 +02:00
Vladimir Enchev
ed19c9c534 Version updated 2021-12-20 16:39:33 +02:00
yordanov
c0ee0195e9 Add TabPosition to Tabs demo 2021-12-20 16:33:02 +02:00
yordanov
ffa35bed94 Add TabPosition styles to Tab Component 2021-12-20 16:31:40 +02:00
yordanov
9442be13f1 Render navigation item link content wrapper when Path is null or empty 2021-12-20 15:10:14 +02:00
Vladimir Enchev
a017803429 Tree AllowCheckChildren will not work when tree children are populated from RadzenTreeLevel settings 2021-12-20 11:51:56 +02:00
Vladimir Enchev
951e88f1c8 Tab component TabPosition property added 2021-12-20 10:19:05 +02:00
Atanas Korchev
de93247c5c ProfileMenu opens behind DataGrid when RadzenLayout is used. 2021-12-19 09:40:00 +02:00
Atanas Korchev
06038bc105 Bar series render in the opposite order. 2021-12-19 09:40:00 +02:00
Vladimir Enchev
43c5975524 Fixed DatePicker will raise exception with chars in time part 2021-12-17 15:01:43 +02:00
Vladimir Enchev
891f183f80 Switch component Toggle method made public and executed on click 2021-12-17 14:51:06 +02:00
yordanov
c126c28fa3 Fix loading panel z-index in sample dashboard 2021-12-17 14:15:16 +02:00
yordanov
fc99e46e0f Update DataList demo 2021-12-17 14:03:22 +02:00
yordanov
9543e10241 Update styles in Tree demos 2021-12-16 18:39:44 +02:00
yordanov
327bc47017 Align icon in treenode label 2021-12-16 16:48:04 +02:00
Vladimir Enchev
96ccc5d4f5 Version updated 2021-12-16 08:49:19 +02:00
Atanas Korchev
eef2b4eb58 Dialog content does not always refresh when DialogService.Refresh is called. 2021-12-15 20:47:55 +02:00
yordanov
26346c8acb Fix boolean filter checkbox background in DataGird 2021-12-15 16:11:19 +02:00
yordanov
565e77ef6d Fix CheckBox tri-state icon 2021-12-15 16:10:13 +02:00
Vladimir Enchev
84506a9340 Fixed virtualized DataGrid will raise exception with FilterTemplate 2021-12-15 11:50:46 +02:00
Vladimir Enchev
25298012f9 DataGrid LoadData will not populate Filters properly 2021-12-15 11:18:05 +02:00
Atanas Korchev
236e2f6d48 Reset the scroll position of RadzenBody after navigation. 2021-12-14 16:11:10 +02:00
yordanov
483283fdd1 Add icons to component groups 2021-12-14 14:34:25 +02:00
Vladimir Enchev
776c2f38f8 Add RadzenLayout. (#312)
Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2021-12-14 09:05:46 +02:00
yordanov
c20cc09959 Update layouts of feedback demos 2021-12-13 16:01:13 +02:00
yordanov
ce7d3f0324 Update layout of validator demos 2021-12-13 16:01:13 +02:00
Vladimir Enchev
55e85dbd74 version updated 2021-12-13 09:29:32 +02:00
Atanas Korchev
4c6f6d8b1c Fix typo in tree data-binding demo. 2021-12-13 08:35:16 +02:00
yordanov
651381c9d7 Style Charts configs 2021-12-10 15:53:34 +02:00
yordanov
146af5cf2d Update Upload demo layout 2021-12-10 15:40:49 +02:00
yordanov
49a7c80423 Update TextArea demo layout 2021-12-10 15:40:49 +02:00
yordanov
e770eb147a Update FileInput demo layout 2021-12-10 15:40:49 +02:00
yordanov
a08802df0a Update Fieldset demo layout 2021-12-10 15:40:49 +02:00
Atanas Korchev
61eba87de6 Do not try to parse null color. 2021-12-10 15:21:11 +02:00
Atanas Korchev
0e0a56ac38 Fixes in the tree guide. 2021-12-10 12:59:51 +02:00
Atanas Korchev
36e6c2fa25 Tree demo source tab fixes. 2021-12-10 12:59:51 +02:00
yordanov
0c157eee69 Update ColorPicker demo layout 2021-12-10 11:49:04 +02:00
yordanov
ba2ac37f6c Update DropDownDataGrid demo layout 2021-12-10 11:48:35 +02:00
yordanov
9a29db8c62 Update DropDown demo layout 2021-12-10 11:48:04 +02:00
yordanov
212ec834c8 Update DatePicker demo layout 2021-12-10 11:47:44 +02:00
Atanas Korchev
bd70d80f81 Do not add upload header without a name. 2021-12-10 09:57:30 +02:00
yordanov
55e2e3463d Format code 2021-12-09 16:46:51 +02:00
yordanov
2e16eba739 Remove typography styles for html elements from base themes 2021-12-09 16:46:51 +02:00
yordanov
35bf66ccf4 Add rz-label CSS class to RadzenLabel component 2021-12-09 16:46:51 +02:00
Vladimir Enchev
ec4679d85c Render optimizations of popups removed 2021-12-09 14:58:11 +02:00
Vladimir Enchev
15c4b0e5eb DropDownDataGrid rendering speed optimized by rendering popup on first click 2021-12-09 11:58:49 +02:00
Vladimir Enchev
5f170f0953 DataGrid rendering speed optimized by rendering advanced filter popups on first click 2021-12-09 11:40:13 +02:00
Vladimir Enchev
07a1e9311b DatePicker rendering speed optimized 2021-12-09 10:22:31 +02:00
Vladimir Enchev
7d1274af4b Version updated 2021-12-09 09:40:55 +02:00
Vladimir Enchev
9d096aed5d Tabs RenderMode.Client will cause exception on browser refresh
Fixed #309
2021-12-09 09:40:19 +02:00
yordanov
8477ad810a Update layouts in demos 2021-12-08 15:02:15 +02:00
Vladimir Enchev
60e3fb6f45 DatePicker will select wrong year when selecting days across years 2021-12-08 10:58:26 +02:00
yordanov
7efb9ec1de Update layouts in demos 2021-12-07 15:37:48 +02:00
Atanas Korchev
70c0a4b9e6 Fix smooth checkbox not working. 2021-12-07 15:26:11 +02:00
yordanov
d9b3474846 Move console below the demo 2021-12-07 10:19:31 +02:00
yordanov
97cb7fc2eb Update console styling 2021-12-07 10:19:31 +02:00
Vladimir Enchev
6394612630 xml comments warnings fixed 2021-12-06 11:35:27 +02:00
Vladimir Enchev
a78df50826 DropDownDataGrid AllowColumnResize property added 2021-12-06 11:21:42 +02:00
yordanov
59c1948e14 Update Steps demo layout 2021-12-06 11:01:47 +02:00
yordanov
e92fa3d615 Update Login page demo layout 2021-12-06 11:01:47 +02:00
Vladimir Enchev
faee5d0276 Version updated 2021-12-06 10:36:41 +02:00
Vladimir Enchev
f2b1e7becc DataGrid Responsive property added 2021-12-06 10:05:35 +02:00
yordanov
5352d55589 Update Tabs demo layout 2021-12-06 09:29:45 +02:00
yordanov
75386e55af Update Splitter demo layout 2021-12-06 09:29:45 +02:00
yordanov
fe2a28d013 Update panel demo layout 2021-12-06 09:29:45 +02:00
Vladimir Enchev
aa2e07d163 DataGrid grouping will check if the group key is null 2021-12-03 16:37:27 +02:00
yordanov
23c1c41415 Panel render text and icon wrapper only if Text or Icon are set 2021-12-03 15:50:59 +02:00
yordanov
8be6988e5b Update DataGrid demos 2021-12-03 14:57:40 +02:00
yordanov
262ccc2f11 Add instrucitons to ContextMenu demo 2021-12-03 14:57:40 +02:00
yordanov
09c3952a0a Update menu demo height 2021-12-03 14:57:40 +02:00
yordanov
ea9c4df4bc Update image demo 2021-12-03 14:57:40 +02:00
yordanov
43c95c24fe Update dialog demos 2021-12-03 14:57:40 +02:00
Vladimir Enchev
21a19dcf89 DataGrid will not go to the previous page if the last item is deleted 2021-12-03 10:45:26 +02:00
Vladimir Enchev
2b6cc3e52d DataGrid StateHasChanged will be executed after every column add 2021-12-02 16:21:59 +02:00
Vladimir Enchev
f639704d6d code removed temporary to avoid recursion 2021-12-02 16:21:37 +02:00
Vladimir Enchev
b93995081e DataGrid will not go to the first page if the last item is deleted on the second page 2021-12-02 16:11:00 +02:00
Atanas Korchev
0dc68b830c Show loading indicator in the LoadData demo. 2021-12-02 15:45:10 +02:00
Vladimir Enchev
5521b90aec DataGrid will show EmptyText/EmptyTemplate only if Count is 0 and Data is not null 2021-12-02 15:15:06 +02:00
yordanov
7f0a13b434 Make Scheduler full width 2021-12-02 13:23:49 +02:00
yordanov
c0e2445439 remove empty row in Pager demo 2021-12-02 13:23:49 +02:00
yordanov
6037b87b52 Update DataGrid column widths across demos 2021-12-02 13:23:49 +02:00
yordanov
b80c5d43e9 Update DataGrid export demo 2021-12-02 13:23:49 +02:00
yordanov
ed258e624d Update layout in cascading dropdowns DataGrid demo 2021-12-02 13:23:49 +02:00
yordanov
e1fd87b251 Update layout in DataGrid inline edit demo 2021-12-02 13:23:48 +02:00
yordanov
092cf6be4f Update DataGrid context menu demo 2021-12-02 13:19:09 +02:00
yordanov
a4286ea2de Update DataGrid master detail demos 2021-12-02 13:19:09 +02:00
yordanov
7ada2de54c Update empty DataGrid demo 2021-12-02 13:19:09 +02:00
yordanov
0f01f513eb Update DataGrid column demos 2021-12-02 13:19:09 +02:00
yordanov
4bebcec778 Reorder radzen banner buttons 2021-12-02 13:19:09 +02:00
Vladimir Enchev
6d2bf8402b demo updated 2021-12-02 09:23:47 +02:00
Vladimir Enchev
674f99d738 Firefox checks for virtualization removed 2021-12-02 09:06:41 +02:00
Roderick Micallef
f12c2d3a7c Update RadzenDataGrid.razor.cs (reordering columns issue) (#300)
* Update RadzenDataGrid.razor.cs

ColumnReorder returns oldIndex from only visible/JS columns, and newIndex from all columns. Proposal is to return indices from all columns for both cases.

* Update RadzenDataGrid.razor.cs

typo fix
2021-12-01 13:41:19 +02:00
Vladimir Enchev
8748b1e122 DataGrid and DropDown virtualization fixed to work properly in Firefox
Fix #275
2021-12-01 13:39:47 +02:00
Vladimir Enchev
b6e4206772 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2021-12-01 10:47:22 +02:00
Vladimir Enchev
2c6224d45e Upload Disabled property added
Fix #299
2021-12-01 10:47:10 +02:00
emumanu
a0c764d87c Fixes Error: System.NotSupportedException: Unable to cast the type 'BlazorRadzenTests.Country' to type 'System.Object'. LINQ to Entities only supports casting EDM primitive or enumeration types. (#298)
In order to fix the problem, we convert the IQueryable to IEnumerable, we perform the cast to IEnumerable<object> and then we call ToList()
2021-12-01 10:38:50 +02:00
620 changed files with 45468 additions and 14925 deletions

26
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Build
run: dotnet build Radzen.Blazor/Radzen.Blazor.csproj
- name: Test
run: dotnet test Radzen.Blazor.Tests/Radzen.Blazor.Tests.csproj

View File

@@ -5,23 +5,21 @@
This is a set of guidelines for contributing to Radzen.Blazor.
## Asking questions
Please don't open an issue to ask a question about using Radzen.Blazor components. You can check the following resources instead:
- [Online demos](https://blazor.radzen.com)
### [Online demos](https://blazor.radzen.com)
A showcase application that demonstrates all Radzen.Blazor components. You will find various use cases that demonstrate the component features and API. The source
of the demos is available [here](https://github.com/radzenhq/radzen-blazor/tree/master/RadzenBlazorDemos).
- [Documentation](https://www.radzen.com/documentation/blazor/accordion/)
### [Documentation](https://blazor.radzen.com/docs/)
Technical documentation and API reference.
- [Online forum](https://forum.radzen.com)
### [Community forum](https://forum.radzen.com)
You can ask your question here. Please use the [Radzen.Blazor Components](https://forum.radzen.com/c/blazor-components/10) category.
- Dedicated technical support
### Dedicated technical support
Radzen staff provides technical support with guaranteed response time to Radzen Professional and Enterprise subscribers. The pricing options are available [here](https://www.radzen.com/pricing/).
Radzen staff provides technical support with guaranteed response time to Radzen Professional and Enterprise subscribers. The pricing options are available [here](https://www.radzen.com/blazor-studio/pricing/).
## How Can I Contribute?
@@ -67,7 +65,8 @@ Explain the enhancement and include additional details:
If you want to contribute a new feature of fix a bug you can open a pull request.
Make sure you follow this procedure:
* **Important!!!** if you itent to make a lot of changes in a pull request open an issue to discuss this with us first. The Radzen Blazor Components have a lot of
moving parts and making big changes should be done with extra precautions.
* **Be sure that none of the existing tests** breaks after your changes. The test project is available [here](https://github.com/radzenhq/radzen-blazor/tree/master/Radzen.Blazor.Tests).
* **If possible add new tests that verify your fix or new feature**.
* **Follow the existing coding style** (to be described in detail later).

View File

@@ -13,18 +13,19 @@ RUN apt-get update && apt-get install unzip wget git -y && wget -q -P /tmp https
COPY Radzen.Blazor /app/Radzen.Blazor
COPY Radzen.DocFX /app/DocFX
COPY RadzenBlazorDemos /app/RadzenBlazorDemos
COPY RadzenBlazorDemos.Host /app/RadzenBlazorDemos.Host
WORKDIR /app
RUN docfx DocFX/docfx.json
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal
FROM mcr.microsoft.com/dotnet/sdk:7.0
COPY --from=0 /app/RadzenBlazorDemos /app
WORKDIR /app
COPY --from=0 /app/RadzenBlazorDemos.Host /app/RadzenBlazorDemos.Host
COPY --from=0 /app/RadzenBlazorDemos /app/RadzenBlazorDemos
WORKDIR /app/RadzenBlazorDemos.Host
RUN dotnet publish -c Release -o out
COPY RadzenBlazorDemos/northwind.db /app/out
COPY RadzenBlazorDemos/northwind.sql /app/out
ENV ASPNETCORE_URLS http://*:5000
WORKDIR /app/out
WORKDIR /app/RadzenBlazorDemos.Host/out
ENTRYPOINT ["dotnet", "RadzenBlazorDemos.dll"]
ENTRYPOINT ["dotnet", "RadzenBlazorDemos.Host.dll"]

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2018-2021 Radzen Ltd
Copyright (c) 2018-2023 Radzen Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

116
README.md
View File

@@ -1,43 +1,118 @@
# Radzen Blazor Components
![Radzen Blazor Components](RadzenBlazorDemos/wwwroot/images/radzen-blazor-components.png)
The home of the [Radzen Blazor components](https://blazor.radzen.com)
<h1 align="center">
Radzen Blazor Components
</h1>
## Commercial support
<p align="center">
A set of <strong>70+ free and open source</strong> native Blazor UI controls.
</p>
Paid support for the Radzen Blazor Components is available as part of the [Radzen Professional subscription](https://www.radzen.com/pricing/).
<div align="center">
Our flagship product Radzen provides tons of productivity features for Blazor developers:
- The first in the industry WYSIWYG Blazor design time canvas
[See Online Demos](https://blazor.radzen.com) or [Read the Docs](https://blazor.radzen.com/docs/)
</div>
---
<p align="center">
<a href="https://github.com/radzenhq/radzen-blazor/blob/master/LICENSE">
<img alt="License - MIT" src="https://img.shields.io/github/license/radzenhq/radzen-blazor?logo=github&style=for-the-badge" />
</a>
<a href="https://www.nuget.org/packages/Radzen.Blazor">
<img alt="Nuget Downloads" src="https://img.shields.io/nuget/dt/Radzen.Blazor?color=%232694F9&label=nuget%20downloads&logo=nuget&style=for-the-badge" />
</a>
<img alt="Last Commit" src="https://img.shields.io/github/last-commit/radzenhq/radzen-blazor?logo=github&style=for-the-badge" />
<a href="https://github.com/radzenhq/radzen-blazor/graphs/contributors">
<img alt="Github Contributors" src="https://img.shields.io/github/contributors/radzenhq/radzen-blazor?logo=github&style=for-the-badge" />
</a>
<a href="https://blazor.radzen.com">
<img alt="Radzen Blazor Components - Online Demos" src="https://img.shields.io/badge/demos-online-brightgreen?color=%232694F9&logo=blazor&style=for-the-badge" />
</a>
<a href="https://blazor.radzen.com/docs">
<img alt="Radzen Blazor Components - Documentation" src="https://img.shields.io/badge/docs-online-brightgreen?color=%232694F9&logo=blazor&style=for-the-badge" />
</a>
</p>
## Why choose Radzen Blazor Components?
### :sparkles: Free
Radzen Blazor Components are open source and free for commercial use. You can install them from [nuget](https://www.nuget.org/packages/Radzen.Blazor) or build your own copy from source.
Paid support is available as part of the [Radzen Professional subscription](https://www.radzen.com/blazor-studio/pricing/).
### :computer: Native
The components are implemented in C# and take full advantage of the Blazor framework. They do not depend on or wrap existing JavaScript frameworks or libraries.
Blazor Server and Blazor WebAssembly are fully supported.
### :seedling: Growing
We add new components and features on a regular basis.
Short development cycle. We release as soon as new stuff is available. No more quarterly releases.
## Support exceeding your expectations
### :speech_balloon: Community Support
Everybody is welcome to visit the [Radzen Community forum](https://forum.radzen.com/). Join the growing community and participate in the discussions!
### :dart: Dedicated Support
The Radzen team monitors the forum threads, but does not guarantee a response to every question. For guaranteed responses you may consider the dedicated support option.
Dedicated support for the Radzen Blazor Components is available as part of the [Radzen Professional subscription](https://www.radzen.com/blazor-studio/pricing/).
Our flagship product [Radzen Blazor Studio](https://www.radzen.com/blazor-studio/) provides tons of productivity features for Blazor developers:
- An industry-leading WYSIWYG Blazor design time canvas
- Scaffolding a complete CRUD applications from a database
- Built-in security - authentication and authorization
- Visual Studio Code and Professional support
- Deployment to IIS and Azure
- Dedicated support with 24 hour guaranteed response time
- Active community forum
## Get started with the Radzen Blazor Components
## Get started with Radzen Blazor Components
### Install
### 1. Install
Radzen Blazor Components are distributed as the Radzen.Blazor nuget package. You can add them to your project in one of the following ways
- Install the package from command line by running dotnet add package Radzen.Blazor
- Add the project from the Visual Nuget Package Manager
Radzen Blazor Components are distributed as a [Radzen.Blazor nuget package](https://www.nuget.org/packages/Radzen.Blazor). You can add them to your project in one of the following ways
- Install the package from command line by running `dotnet add package Radzen.Blazor`
- Add the project from the Visual Nuget Package Manager
- Manually edit the .csproj file and add a project reference
### Import the namespace
### 2. Import the namespace
Open the `_Imports.razor` file of your Blazor application and add this line `@using Radzen.Blazor`.
### Include a theme
### 3. Include a theme
Open the `_Host.cshtml` file (server-side Blazor) or `wwwroot/index.html` (client-side Blazor) and include a theme CSS file by adding this snippet `<link rel="stylesheet" href="_content/Radzen.Blazor/css/default.css">` or `<link rel="stylesheet" href="_content/Radzen.Blazor/css/default-base.css">` if you either include Bootstrap manually or don't use it at all.
Radzen Blazor components come with five free themes: Material, Standard, Default, Dark, Software and Humanistic.
### Include Radzen.Blazor.js
To use a theme
1. Pick a theme. The [online demos](https://blazor.radzen.com/colors) allow you to preview the available options via the theme dropdown located in the header. The Material theme is currently selected by default.
1. Include the theme CSS file in your Blazor application. Open `Pages\_Layout.cshtml` (Blazor Server .NET 6), `Pages\_Host.cshtml` (Blazor Server .NET 7) or `wwwroot/index.html` (Blazor WebAssembly) and include a theme CSS file by adding this snippet
```html
<link rel="stylesheet" href="_content/Radzen.Blazor/css/material-base.css">
```
Open the `_Host.cshtml` file (server-side Blazor) or `wwwroot/index.html` (client-side Blazor) and include this snippet `<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>`
To include a different theme (i.e. Standard) just change the name of the CSS file:
```
<link rel="stylesheet" href="_content/Radzen.Blazor/css/standard-base.css">
```
### Use a component
Use any Radzen Blazor component by typing its tag name in a Blazor page e.g.
### 4. Include Radzen.Blazor.js
Open `Pages\_Layout.cshtml` (Blazor Server .NET 6), `Pages\_Host.cshtml` (Blazor Server .NET 7) or `wwwroot/index.html` (Blazor WebAssembly) and include this snippet:
```html
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
```
### 5. Use a component
Use any Radzen Blazor component by typing its tag name in a Blazor page e.g.
```html
<RadzenButton Text="Hi"></RadzenButton>
```
@@ -62,3 +137,6 @@ Use any Radzen Blazor component by typing its tag name in a Blazor page e.g.
}
}
```
## Run demos locally
Use Radzen.Server.sln to open and run demos as Blazor server application or Radzen.WebAssembly.sln to open and run demos as Blazor WebAssembly application. Radzen.sln has reference to all projects including tests.

View File

@@ -0,0 +1,77 @@
using Bunit;
using Xunit;
namespace Radzen.Blazor.Tests
{
public class BreadCrumbTests
{
[Fact]
public void BreadCrumb_Renders_Items()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenBreadCrumb>();
component.SetParametersAndRender(parameters =>
{
parameters.Add(c => c.ChildContent, builder =>
{
builder.OpenComponent<RadzenBreadCrumbItem>(0);
builder.AddAttribute(1, nameof(RadzenBreadCrumbItem.Text), "Test");
builder.CloseComponent();
});
});
//@"<RadzenBreadCrumbItem Text=""Test"" />"
Assert.Contains(@"class=""rz-breadcrumb-item", component.Markup);
Assert.Contains(">Test</", component.Markup);
}
[Fact]
public void BreadCrumb_Renders_Icon()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenBreadCrumb>();
component.SetParametersAndRender(parameters =>
{
parameters.Add(c => c.ChildContent, builder =>
{
builder.OpenComponent<RadzenBreadCrumbItem>(0);
builder.AddAttribute(1, nameof(RadzenBreadCrumbItem.Text), "Test");
builder.AddAttribute(2, nameof(RadzenBreadCrumbItem.Icon), "add");
builder.CloseComponent();
});
});
//@"<RadzenBreadCrumbItem Text=""Test"" />"
Assert.Contains("<i", component.Markup);
Assert.Contains(">add</i>", component.Markup);
}
[Fact]
public void BreadCrumb_Renders_Link()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenBreadCrumb>();
component.SetParametersAndRender(parameters =>
{
parameters.Add(c => c.ChildContent, builder =>
{
builder.OpenComponent<RadzenBreadCrumbItem>(0);
builder.AddAttribute(1, nameof(RadzenBreadCrumbItem.Text), "Test");
builder.AddAttribute(2, nameof(RadzenBreadCrumbItem.Icon), "add");
builder.AddAttribute(3, nameof(RadzenBreadCrumbItem.Path), "/badge");
builder.CloseComponent();
});
});
//@"<RadzenBreadCrumbItem Text=""Test"" />"
Assert.Contains("<i", component.Markup);
Assert.Contains(">add</i>", component.Markup);
Assert.Contains("<a href=\"/badge", component.Markup);
}
}
}

View File

@@ -134,11 +134,11 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.ButtonStyle, ButtonStyle.Primary));
Assert.Contains(@$"btn-primary", component.Markup);
Assert.Contains(@$"rz-primary", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add(p => p.ButtonStyle, ButtonStyle.Secondary));
Assert.Contains(@$"btn-secondary", component.Markup);
Assert.Contains(@$"rz-secondary", component.Markup);
}
[Fact]

View File

@@ -0,0 +1,44 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Bunit;
using Radzen.Blazor.Rendering;
using Xunit;
namespace Radzen.Blazor.Tests;
public class ChartTests
{
[Fact(Timeout = 30000)]
public async Task Chart_Tooltip_Performance()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.Setup<Rect>("Radzen.createChart", _ => true).SetResult(new Rect {Left = 0, Top = 0, Width = 200, Height = 200});
var seriesData = Enumerable.Range(0, 5000).Select(i => new Point { X = i, Y = i });
var chart = ctx.RenderComponent<RadzenChart>(chartParameters =>
chartParameters
.AddChildContent<RadzenLineSeries<Point>>(seriesParameters =>
seriesParameters
.Add(p => p.CategoryProperty, nameof(Point.X))
.Add(p => p.ValueProperty, nameof(Point.Y))
.Add(p => p.Data, seriesData))
.AddChildContent<RadzenCategoryAxis>(axisParameters =>
axisParameters
.Add(p => p.Step, 100)
.Add(p => p.Formatter, x =>
{
Thread.Sleep(100);
return $"{x}";
})));
foreach (var _ in Enumerable.Range(0, 10))
{
await chart.InvokeAsync(() => chart.Instance.MouseMove(100, 100));
Assert.Contains("<div class=\"rz-chart-tooltip", chart.Markup);
await chart.InvokeAsync(() => chart.Instance.MouseMove(0, 0));
Assert.DoesNotContain("<div class=\"rz-chart-tooltip", chart.Markup);
}
}
}

View File

@@ -110,7 +110,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Change, args => { raised = true; }));
component.Find("div").MouseUp();
component.Find("div.rz-chkbox-box").Click();
Assert.True(raised);
}
@@ -126,7 +126,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.ValueChanged, args => { raised = true; }));
component.Find("div").MouseUp();
component.Find("div.rz-chkbox-box").Click();
Assert.True(raised);
}
@@ -141,21 +141,21 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.TriState, true));
component.Find("div").MouseUp();
component.Find("div.rz-chkbox-box").Click();
component.Render();
Assert.Contains(@$"rz-state-active", component.Markup);
Assert.Contains(@$"rzi-check", component.Markup);
component.Find("div").MouseUp();
component.Find("div.rz-chkbox-box").Click();
component.Render();
Assert.DoesNotContain(@$"rz-state-active", component.Markup);
Assert.DoesNotContain(@$"rzi-check", component.Markup);
component.Find("div").MouseUp();
component.Find("div.rz-chkbox-box").Click();
Assert.Contains(@$"rz-state-active", component.Markup);
Assert.Contains(@$"rzi-times", component.Markup);

View File

@@ -0,0 +1,16 @@
using Bunit;
using Xunit;
namespace Radzen.Blazor.Tests
{
public class ColorPickerTests
{
[Fact]
public void ColorPicker_ShouldAcceptInvalidValues()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenColorPicker>(ComponentParameter.CreateParameter("Value", "invalid"));
}
}
}

View File

@@ -1,98 +0,0 @@
using System;
using System.Linq;
using Xunit;
namespace Radzen.Blazor.Tests
{
public class DataGridColumnTests
{
class TestModel
{
public Guid Id { get; set; }
public string Name { get; set; }
public int Age { get; set; }
}
class Testable : RadzenDataGridColumn<TestModel>
{
public Testable()
{
Grid = new RadzenDataGrid<TestModel>();
}
public void PublicMorozov_OnInitialized()
{
OnInitialized();
}
public Type PublicMorozov_FilterPropertyType()
{
var propertyInfo = this.GetType()
.GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)
.FirstOrDefault(x => x.Name == "FilterPropertyType");
return propertyInfo?.GetValue(this) as Type;
}
}
[Fact]
public void FilterPropertyType_Assigned_From_Type_Parameter()
{
var column = new Testable()
{
Property = nameof(TestModel.Id),
Type = typeof(string),
FilterProperty = null
};
column.PublicMorozov_OnInitialized();
Assert.Equal(typeof(string), column.PublicMorozov_FilterPropertyType());
Assert.Equal(FilterOperator.Contains, column.FilterOperator);
}
[Fact]
public void FilterPropertyType_Assigned_From_FilterProperty_Parameter()
{
var column = new Testable()
{
Property = nameof(TestModel.Id),
Type = null,
FilterProperty = nameof(TestModel.Name)
};
column.PublicMorozov_OnInitialized();
Assert.Equal(typeof(string), column.PublicMorozov_FilterPropertyType());
Assert.Equal(FilterOperator.Contains, column.FilterOperator);
}
[Fact]
public void FilterPropertyType_Assigned_From_ColumnType()
{
var column = new Testable()
{
Property = nameof(TestModel.Id),
Type = null,
FilterProperty = null
};
column.PublicMorozov_OnInitialized();
Assert.Equal(typeof(Guid), column.PublicMorozov_FilterPropertyType());
Assert.Equal(FilterOperator.Equals, column.FilterOperator);
}
[Fact]
public void FilterPropertyType_Assigned_From_Type_If_FilterProperty_Is_Fake_Field()
{
var column = new Testable()
{
Property = nameof(TestModel.Id),
Type = typeof(decimal),
FilterProperty = "NotExistsField"
};
column.PublicMorozov_OnInitialized();
Assert.Equal(typeof(decimal), column.PublicMorozov_FilterPropertyType());
}
}
}

View File

@@ -74,11 +74,11 @@ namespace Radzen.Blazor.Tests
});
});
var markup = new Regex(@"\s\s+").Replace(component.Markup, "").Trim();
var data = component.FindAll(".rz-cell-data");
Assert.Contains(@$"<span class=""rz-cell-data"">1</span>", markup);
Assert.Contains(@$"<span class=""rz-cell-data"">2</span>", markup);
Assert.Contains(@$"<span class=""rz-cell-data"">3</span>", markup);
Assert.Equal("1", data[0].TextContent.Trim());
Assert.Equal("2", data[1].TextContent.Trim());
Assert.Equal("3", data[2].TextContent.Trim());
}
[Fact]
@@ -99,9 +99,8 @@ namespace Radzen.Blazor.Tests
});
});
var markup = new Regex(@"\s\s+").Replace(component.Markup, "").Trim();
Assert.Contains(@$"<span class=""rz-column-title"">MyId</span>", markup);
var title = component.Find(".rz-column-title");
Assert.Equal("MyId", title.TextContent.Trim());
}
[Fact]

View File

@@ -1,8 +1,7 @@
using Bunit;
using Radzen.Blazor.Rendering;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Xunit;
@@ -50,7 +49,7 @@ namespace Radzen.Blazor.Tests
var component = ctx.RenderComponent<RadzenDatePicker<DateTime>>();
component.SetParametersAndRender(parameters => {
component.SetParametersAndRender(parameters => {
parameters.Add<bool>(p => p.ShowTime, true);
parameters.Add<bool>(p => p.ShowSeconds, true);
});
@@ -94,7 +93,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => {
parameters.Add(p => p.DateFormat, format);
parameters.Add<object>(p => p.Value, DateTime.Now);
parameters.Add<object>(p => p.Value, DateTime.Now);
});
Assert.Contains(@$"value=""{string.Format("{0:" + format + "}", DateTime.Now)}""", component.Markup);
@@ -147,7 +146,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => {
parameters.Add<object>(p => p.Value, DateTime.Now);
parameters.Add<bool>(p => p.AllowClear, true);
parameters.Add<bool>(p => p.AllowClear, true);
});
Assert.Contains(@$"<i class=""rz-dropdown-clear-icon rzi rzi-times""", component.Markup);
@@ -231,7 +230,7 @@ namespace Radzen.Blazor.Tests
}
[Fact]
public void DatePicker_Raises_ChangeEventOnNextMonth()
public void DatePicker_NotRaises_ChangeEventOnNextMonth()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
@@ -248,12 +247,11 @@ namespace Radzen.Blazor.Tests
component.Find(".rz-datepicker-next-icon").Click();
Assert.True(raised);
Assert.True(((DateTime)newValue) > DateTime.Now);
Assert.False(raised);
}
[Fact]
public void DatePicker_Raises_ValueChangedEventOnNextMonth()
public void DatePicker_NotRaises_ValueChangedEventOnNextMonth()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
@@ -270,12 +268,11 @@ namespace Radzen.Blazor.Tests
component.Find(".rz-datepicker-next-icon").Click();
Assert.True(raised);
Assert.True(((DateTime)newValue) > DateTime.Now);
Assert.False(raised);
}
[Fact]
public void DatePicker_Raises_ChangeEventOnPrevMonth()
public void DatePicker_NotRaises_ChangeEventOnPrevMonth()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
@@ -292,12 +289,11 @@ namespace Radzen.Blazor.Tests
component.Find(".rz-datepicker-prev-icon").Click();
Assert.True(raised);
Assert.True(((DateTime)newValue) < DateTime.Now);
Assert.False(raised);
}
[Fact]
public void DatePicker_Raises_ValueChangedEventOnPrevMonth()
public void DatePicker_NotRaises_ValueChangedEventOnPrevMonth()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
@@ -314,8 +310,7 @@ namespace Radzen.Blazor.Tests
component.Find(".rz-datepicker-prev-icon").Click();
Assert.True(raised);
Assert.True(((DateTime)newValue) < DateTime.Now);
Assert.False(raised);
}
[Fact]
@@ -325,12 +320,12 @@ namespace Radzen.Blazor.Tests
DateTime previousDay = DateTime.Today.AddDays(-1);
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var component = ctx.RenderComponent<RadzenDatePicker<DateTime>>();
var raised = false;
object newValue = null;
object newValue = null;
component.SetParametersAndRender(parameters => {
parameters.Add(p => p.ValueChanged, args => { raised = true; newValue = args; })
@@ -383,7 +378,45 @@ namespace Radzen.Blazor.Tests
Assert.True(raised);
Assert.Null(newValue);
}
[Fact]
public void DatePicker_Respects_DateTimeMaxValue()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenDatePicker<DateTime>>(parameters =>
{
parameters.Add(p => p.Value, DateTime.MaxValue);
});
Assert.Contains(DateTime.MaxValue.ToString(component.Instance.DateFormat), component.Markup);
var exception = Record.Exception(() => component.Find(".rz-datepicker-next-icon")
.Click());
Assert.Null(exception);
}
[Fact]
public void DatePicker_Respects_DateTimeMinValue()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenDatePicker<DateTime>>(parameters =>
{
parameters.Add(p => p.Value, DateTime.MinValue);
});
Assert.Contains(DateTime.MinValue.ToString(component.Instance.DateFormat), component.Markup);
var exception = Record.Exception(() => component.Find(".rz-datepicker-prev-icon")
.Click());
Assert.Null(exception);
}
[Theory]
[InlineData(DateTimeKind.Local)]
[InlineData(DateTimeKind.Unspecified)]
@@ -414,5 +447,63 @@ namespace Radzen.Blazor.Tests
Assert.True(raised);
Assert.Equal(kind, ((DateTime)newValue).Kind);
}
[Fact]
public void DatePicker_Renders_FooterTemplate()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
string actionsTemplate = "<input type=\"button\" value=\"Test\" />";
var component = ctx.RenderComponent<RadzenDatePicker<DateTime>>(parameters =>
{
parameters.Add(p => p.Value, DateTime.MinValue);
parameters.Add(p => p.FooterTemplate, actionsTemplate);
});
Assert.Contains(actionsTemplate, component.Markup);
}
[Fact]
public void DatePicker_Converts_DateTimeOffSet_FromUtc_ToLocal()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var valueUtc = DateTimeOffset.UtcNow;
var kind = DateTimeKind.Local;
var component = ctx.RenderComponent<RadzenDatePicker<DateTimeOffset>>(parameters =>
{
parameters.Add(p => p.Kind, kind);
parameters.Add(p => p.Value, valueUtc);
});
Assert.Equal(kind, (component.Instance.Value as DateTime?)?.Kind);
Assert.Equal(valueUtc.LocalDateTime.ToString(CultureInfo.InvariantCulture), (component.Instance.Value as DateTime?)?.ToString(CultureInfo.InvariantCulture));
}
[Fact]
public void DatePicker_Converts_DateTimeOffSet_Local_ToUtc()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var valueUtc = DateTimeOffset.Now;
var kind = DateTimeKind.Utc;
var component = ctx.RenderComponent<RadzenDatePicker<DateTimeOffset>>(parameters =>
{
parameters.Add(p => p.Kind, kind);
parameters.Add(p => p.Value, valueUtc);
});
Assert.Equal(kind, (component.Instance.Value as DateTime?)?.Kind);
Assert.Equal(valueUtc.UtcDateTime.ToString(CultureInfo.InvariantCulture), (component.Instance.Value as DateTime?)?.ToString(CultureInfo.InvariantCulture));
}
}
}

View File

@@ -0,0 +1,144 @@
using System;
using System.Threading.Tasks;
using Bunit;
using Xunit;
namespace Radzen.Blazor.Tests
{
public class DropDownTests
{
class DataItem
{
public string Text { get; set; }
public int Id { get; set; }
}
private static IRenderedComponent<RadzenDropDown<T>> DropDown<T>(TestContext ctx, Action<ComponentParameterCollectionBuilder<RadzenDropDown<T>>> configure = null)
{
var data = new [] {
new DataItem { Text = "Item 1", Id = 1 },
new DataItem { Text = "Item 2", Id = 2 },
};
var component = ctx.RenderComponent<RadzenDropDown<T>>();
component.SetParametersAndRender(parameters => {
parameters.Add(p => p.Data, data);
parameters.Add(p => p.TextProperty, nameof(DataItem.Text));
if (configure != null)
{
configure.Invoke(parameters);
}
else
{
parameters.Add(p => p.ValueProperty, nameof(DataItem.Id));
}
});
return component;
}
[Fact]
public async Task Dropdown_SelectItem_Method_Should_Not_Throw()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var component = DropDown<int>(ctx);
var items = component.FindAll(".rz-dropdown-item");
Assert.Equal(2, items.Count);
//this throws
await component.InvokeAsync(async () => await component.Instance.SelectItem(1));
}
[Fact]
public void DropDown_RendersItems()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var component = DropDown<int>(ctx);
var items = component.FindAll(".rz-dropdown-item");
Assert.Equal(2, items.Count);
}
[Fact]
public void DropDown_AppliesSelectionStyleForIntValue()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var component = DropDown<int>(ctx);
var items = component.FindAll(".rz-dropdown-item");
items[0].Click();
component.Render();
items = component.FindAll(".rz-dropdown-item");
Assert.Contains("rz-state-highlight", items[0].ClassList);
}
[Fact]
public void DropDown_AppliesSelectionStyleForStringValue()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var component = DropDown<string>(ctx, parameters => {
parameters.Add(p => p.ValueProperty, nameof(DataItem.Text));
});
var items = component.FindAll(".rz-dropdown-item");
items[0].Click();
component.Render();
items = component.FindAll(".rz-dropdown-item");
Assert.Contains("rz-state-highlight", items[0].ClassList);
}
[Fact]
public void DropDown_AppliesSelectionStyleWhenMultipleSelectionIsEnabled()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var component = DropDown<string>(ctx, parameters => {
parameters.Add(p => p.ValueProperty, nameof(DataItem.Text));
parameters.Add(p => p.Multiple, true);
});
var items = component.FindAll(".rz-multiselect-item");
items[0].Click();
component.Render();
items = component.FindAll(".rz-multiselect-item");
items[1].Click();
component.Render();
var selectedItems = component.FindAll(".rz-state-highlight");
Assert.Equal(2, selectedItems.Count);
}
}
}

View File

@@ -17,7 +17,6 @@ namespace Radzen.Blazor.Tests
component.Render();
Assert.Contains(@$"rz-fieldset", component.Markup);
Assert.Contains(@$"rz-fieldset-legend", component.Markup);
Assert.Contains(@$"rz-fieldset-content-wrapper", component.Markup);
Assert.Contains(@$"rz-fieldset-content", component.Markup);
}

View File

@@ -17,7 +17,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Icon, icon));
Assert.Contains(@$">{icon}</i>", component.Markup);
Assert.Contains(@$"<i class=""rzi d-inline-flex justify-content-center align-items-center""", component.Markup);
Assert.Contains(@$"<i class=""rzi""", component.Markup);
}
[Fact]
@@ -45,5 +45,29 @@ namespace Radzen.Blazor.Tests
Assert.Contains(@$"autofocus", component.Markup);
}
[Fact]
public void Icon_Renders_IconStyleClass()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenIcon>();
component.SetParametersAndRender(parameters => parameters.Add(icon => icon.IconStyle, IconStyle.Primary));
Assert.Contains(@$"rzi-primary", component.Markup);
}
[Fact]
public void Icon_NotRenders_IconStyleClass_WhenNull()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenIcon>();
component.SetParametersAndRender(parameters => parameters.Add(icon => icon.IconStyle, null));
Assert.DoesNotContain(@$"rzi-primary", component.Markup);
}
}
}

View File

@@ -30,8 +30,10 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Text, text));
Assert.Contains(@$">{text}</span>", component.Markup);
Assert.Contains(@$"class=""rz-link-text""", component.Markup);
var textElement = component.Find(".rz-link-text");
Assert.NotNull(textElement);
Assert.Equal(text, textElement.TextContent.Trim());
}
[Fact]

View File

@@ -26,7 +26,12 @@ namespace Radzen.Blazor.Tests
var component = ctx.RenderComponent<RadzenLogin>();
Assert.Contains(@$"<label class=""col-sm-3 col-form-label"" for=""username"">Username</label>", component.Markup);
component.SetParametersAndRender(p => {
p.AddUnmatched("id", "login");
});
var label = component.Find($@"label[for=""login-username""]");
Assert.NotNull(label);
}
[Fact]
@@ -63,7 +68,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => {
parameters.Add(p => p.Username, "user");
parameters.Add(p => p.Password, "pwd");
parameters.Add(p => p.Login, args => { clicked = true; });
parameters.Add(p => p.Login, args => { clicked = true; });
});
component.Find("button").Click();
@@ -114,7 +119,7 @@ namespace Radzen.Blazor.Tests
parameters.Add(p => p.AllowResetPassword, true);
});
Assert.Contains(@$"Forgot password</a>", component.Markup);
Assert.Contains(@$"Forgot password?</a>", component.Markup);
}
[Fact]
@@ -190,7 +195,7 @@ namespace Radzen.Blazor.Tests
parameters.Add(p => p.Register, args => { clicked = true; });
});
component.Find(".register > button").Click();
component.Find(".rz-secondary").Click();
Assert.True(clicked);
}
@@ -216,7 +221,7 @@ namespace Radzen.Blazor.Tests
}
[Fact]
public void Login_NotRaises_ResetPasswordEvent_WhenEmptyUsername()
public void Login_Raises_ResetPasswordEvent_WhenEmptyUsername()
{
using var ctx = new TestContext();
@@ -231,7 +236,7 @@ namespace Radzen.Blazor.Tests
component.Find("a").Click();
Assert.True(!clicked);
Assert.True(clicked);
}
}
}

View File

@@ -0,0 +1,139 @@
using System;
using Bunit;
using Microsoft.AspNetCore.Components.Forms;
using Xunit;
namespace Radzen.Blazor.Tests
{
public class NumericRangeValidatorTests
{
class FormComponentTestDouble : IRadzenFormComponent
{
public bool IsBound => false;
public bool HasValue => true;
public string Name { get; set; }
public FieldIdentifier FieldIdentifier => throw new System.NotImplementedException();
public object GetValue()
{
return Value;
}
public object Value { get; set; }
}
class RadzenNumericRangeValidatorTestDouble : RadzenNumericRangeValidator
{
public bool Validate(object value)
{
return base.Validate(new FormComponentTestDouble { Value = value });
}
}
[Fact]
public void Throws_Exception_If_Min_And_Max_Are_Null()
{
var validator = new RadzenNumericRangeValidatorTestDouble();
Assert.Throws<System.ArgumentException>(() => validator.Validate(1));
}
[Fact]
public void Returns_False_If_Value_Is_Null()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenNumericRangeValidatorTestDouble>();
component.SetParametersAndRender(parameters =>
{
component.SetParametersAndRender(parameters => parameters.Add(p => p.Min, 0).Add(p => p.Max, 10));
});
Assert.False(component.Instance.Validate(null));
}
[Fact]
public void Returns_True_If_Value_Is_Greater_Than_Min()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenNumericRangeValidatorTestDouble>();
component.SetParametersAndRender(parameters => parameters.Add(p => p.Min, 0));
Assert.True(component.Instance.Validate(1));
}
[Fact]
public void Returns_True_If_Value_Is_Equal_To_Min()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenNumericRangeValidatorTestDouble>();
component.SetParametersAndRender(parameters => parameters.Add(p => p.Min, 0));
Assert.True(component.Instance.Validate(0));
}
[Fact]
public void Returns_True_If_Value_Is_Less_Than_Max()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenNumericRangeValidatorTestDouble>();
component.SetParametersAndRender(parameters => parameters.Add(p => p.Max, 10));
Assert.True(component.Instance.Validate(9));
}
[Fact]
public void Returns_True_If_Value_Is_Equal_To_Max()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenNumericRangeValidatorTestDouble>();
component.SetParametersAndRender(parameters => parameters.Add(p => p.Max, 10));
Assert.True(component.Instance.Validate(10));
}
[Fact]
public void Returns_True_If_Value_Is_Between_Min_And_Max()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenNumericRangeValidatorTestDouble>();
component.SetParametersAndRender(parameters => parameters.Add(p => p.Min, 0).Add(p => p.Max, 10));
Assert.True(component.Instance.Validate(5));
}
[Fact]
public void Returns_True_If_Value_Is_Between_Min_And_Max_And_They_Are_Nullable()
{
int? min = 0;
int? max = 10;
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenNumericRangeValidatorTestDouble>();
component.SetParametersAndRender(parameters => parameters.Add(p => p.Min, min).Add(p => p.Max, max));
Assert.True(component.Instance.Validate(5));
}
[Fact]
public void Returns_True_When_Value_Is_Of_DifferentType()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenNumericRangeValidatorTestDouble>();
component.SetParametersAndRender(parameters => parameters.Add(p => p.Min, 0m).Add(p => p.Max, 10m));
Assert.True(component.Instance.Validate(5));
}
[Fact]
public void Returns_False_If_Cannot_Conert_Value()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenNumericRangeValidatorTestDouble>();
component.SetParametersAndRender(parameters => parameters.Add(p => p.Min, 0m).Add(p => p.Max, 10m));
Assert.False(component.Instance.Validate(DateTime.Now));
}
}
}

View File

@@ -0,0 +1,98 @@
using Bunit;
using Bunit.TestDoubles;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Xunit;
namespace Radzen.Blazor.Tests
{
public class PanelMenuTests
{
class TestNavigationManager : NavigationManager
{
public TestNavigationManager(string uri)
{
Initialize("http://www.example.com/", uri);
}
protected override void NavigateToCore(string uri, bool forceLoad)
{
}
}
private static string CreatePanelMenu(string currentAbsoluteUrl, NavLinkMatch match, params string[] urls)
{
using var ctx = new TestContext();
ctx.Services.RemoveAll<NavigationManager>();
ctx.Services.TryAddSingleton<NavigationManager>(new TestNavigationManager(currentAbsoluteUrl));
var component = ctx.RenderComponent<RadzenPanelMenu>();
component.SetParametersAndRender(parameters => parameters.Add(p => p.Match, match).AddChildContent(builder =>
{
foreach (var url in urls)
{
builder.OpenComponent<RadzenPanelMenuItem>(0);
builder.AddAttribute(1, nameof(RadzenPanelMenuItem.Path), url);
builder.CloseComponent();
}
}));
return component.Markup;
}
[Fact]
public void RadzenPanelMenu_SetsOneActiveMenuItem()
{
var component = CreatePanelMenu("http://www.example.com/datagrid-dynamic", NavLinkMatch.All, "/datagrid", "/datagrid-dynamic");
var firstIndex = component.IndexOf("rz-navigation-item-wrapper-active");
var lastIndex = component.LastIndexOf("rz-navigation-item-wrapper-active");
Assert.NotEqual(-1, firstIndex);
Assert.Equal(firstIndex, lastIndex);
}
[Fact]
public void RadzenPanelMenu_MatchesQueryStringParameters()
{
var component = CreatePanelMenu("http://www.example.com/foo?bar", NavLinkMatch.Prefix, "/foo");
Assert.Contains("rz-navigation-item-wrapper-active", component);
}
[Fact]
public void RadzenPanelMenu_DoesNotMatchQueryStringParametersWhenExactMatchIsSpecified()
{
var component = CreatePanelMenu("http://www.example.com/foo?bar", NavLinkMatch.All, "/foo");
Assert.DoesNotContain("rz-navigation-item-wrapper-active", component);
}
[Fact]
public void RadzenPanelMenu_DoesNotMatchRootWithEverything()
{
var component = CreatePanelMenu("http://www.example.com/foo", NavLinkMatch.Prefix, "/");
Assert.DoesNotContain("rz-navigation-item-wrapper-active", component);
}
[Fact]
public void RadzenPanelMenu_MatchesRoot()
{
var component = CreatePanelMenu("http://www.example.com/", NavLinkMatch.Prefix, "/");
Assert.Contains("rz-navigation-item-wrapper-active", component);
}
[Fact]
public void RadzenPanelMenu_MatchesRootWithoutTrailingSlash()
{
var component = CreatePanelMenu("http://www.example.com", NavLinkMatch.Prefix, "/");
Assert.Contains("rz-navigation-item-wrapper-active", component);
}
}
}

View File

@@ -18,7 +18,9 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add<double>(p => p.Value, value));
Assert.Contains(@$"<div class=""rz-progressbar-label"">{value}", component.Markup);
Assert.Contains(@$"<div class=""rz-progressbar-label"">", component.Markup);
Assert.Contains(@$"{value}%", component.Markup);
Assert.Contains(@$"aria-valuenow=""{value}""", component.Markup);
Assert.Contains(@$"aria-valuemin=""0""", component.Markup);
}
@@ -50,13 +52,13 @@ namespace Radzen.Blazor.Tests
component.Render();
Assert.Contains(@$"%</div>", component.Markup);
Assert.Contains(@$"0%", component.Markup);
var value = "mm";
var unit = "mm";
component.SetParametersAndRender(parameters => parameters.Add(p => p.Unit, value));
component.SetParametersAndRender(parameters => parameters.Add(p => p.Unit, unit));
Assert.Contains(@$"{value}</div>", component.Markup);
Assert.Contains(@$"0{unit}", component.Markup);
}
[Fact]
@@ -118,5 +120,27 @@ namespace Radzen.Blazor.Tests
Assert.Contains(@$"style=""width: {Math.Min(value / max * 100, 100).ToInvariantString()}%;""", component.Markup);
}
[Fact]
public void ProgressBar_Renders_ProgressBarStyle()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenProgressBar>();
component.SetParametersAndRender(parameters=>parameters.Add(p=>p.ProgressBarStyle, ProgressBarStyle.Success));
Assert.Contains(@$"rz-progressbar-determinate-success", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add(p => p.ProgressBarStyle, ProgressBarStyle.Info));
Assert.Contains(@$"rz-progressbar-determinate-info", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add(p => p.ProgressBarStyle, ProgressBarStyle.Success));
component.SetParametersAndRender(parameters => parameters.Add(p => p.Mode, ProgressBarMode.Indeterminate));
Assert.Contains(@$"rz-progressbar-indeterminate-success", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add(p => p.ProgressBarStyle, ProgressBarStyle.Info));
component.SetParametersAndRender(parameters => parameters.Add(p => p.Mode, ProgressBarMode.Indeterminate));
Assert.Contains(@$"rz-progressbar-indeterminate-info", component.Markup);
}
}
}

View File

@@ -0,0 +1,120 @@
using AngleSharp.Css;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using Xunit;
namespace Radzen.Blazor.Tests
{
public class PropertyAccessTests
{
public partial class TestData
{
public string PROPERTY { get; set; }
public string Property { get; set; }
}
[Fact]
public void Getter_With_DifferentTargetType()
{
var o = new TestData { Property = "test" };
var getter = PropertyAccess.Getter<object, object>(nameof(TestData.Property), typeof(TestData));
var value = getter(o);
Assert.Equal(o.Property, value);
}
[Fact]
public void Getter_With_Members_That_Differ_Only_In_Casing()
{
var o = new TestData { PROPERTY = nameof(TestData.PROPERTY), Property = nameof(TestData.Property) };
var getter = PropertyAccess.Getter<TestData, string>(nameof(TestData.PROPERTY));
var value = getter(o);
Assert.Equal(nameof(TestData.PROPERTY), value);
}
[Fact]
public void Getter_Resolves_Property_On_Simple_Object()
{
var o = new SimpleObject() { Prop1 = "TestString" };
var getter = PropertyAccess.Getter<SimpleObject, string>("Prop1");
var value = getter(o);
Assert.Equal("TestString", value);
}
[Fact]
public void Getter_Resolves_Property_On_Simple_Object_QueryableType()
{
var _data = new List<SimpleObject>()
{
new SimpleObject() { Prop1 = "TestString" },
};
Func<object, object> getter = PropertyAccess.Getter<object, object>("Prop1", typeof(SimpleObject));
var value = getter(_data[0]);
Assert.Equal("TestString", value);
}
[Fact]
public void Getter_Resolves_Property_On_Nested_Object()
{
var o = new NestedObject() { Obj = new SimpleObject { Prop1 = "TestString" } };
var getter = PropertyAccess.Getter<NestedObject, string>("Obj.Prop1");
var value = getter(o);
Assert.Equal("TestString", value);
}
[Fact]
public void Getter_Resolves_Property_From_Array()
{
var o = new ArrayObject() { Values = new string[] { "1", "2", "3" } };
var getter = PropertyAccess.Getter<ArrayObject, string>("Values[1]");
var value = getter(o);
Assert.Equal("2", value);
}
[Fact]
public void Getter_Resolves_Property_From_Nested_Array()
{
var o = new NestedArrayObject() { Obj = new ArrayObject() { Values = new string[] { "1", "2", "3" } } };
var getter = PropertyAccess.Getter<NestedArrayObject, string>("Obj.Values[2]");
var value = getter(o);
Assert.Equal("3", value);
}
[Fact]
public void Getter_Resolves_Property_From_List()
{
var o = new ListObject() { Values = new List<string>() { "1", "2", "3" } };
var getter = PropertyAccess.Getter<ListObject, string>("Values[1]");
var value = getter(o);
Assert.Equal("2", value);
}
public class SimpleObject
{
public string Prop1 { get; set; }
}
public class NestedObject
{
public SimpleObject Obj { get; set; }
}
public class ArrayObject
{
public string[] Values { get; set; }
}
public class NestedArrayObject
{
public ArrayObject Obj { get; set; }
}
public class ListObject
{
public List<string> Values { get; set; }
}
}
}

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

View File

@@ -0,0 +1,25 @@
using System.Collections.Generic;
using Radzen.Blazor.Rendering;
using Xunit;
namespace Radzen.Blazor.Tests.Rendering;
public class StepGeneratorTests
{
[Fact]
public void Renders_Path_Correctly()
{
var data = new List<Point>
{
new() { X = 10, Y = 10 },
new() { X = 20, Y = 15 },
new() { X = 30, Y = 20 },
new() { X = 40, Y = 25 },
new() { X = 50, Y = 50 }
};
var path = new StepGenerator().Path(data);
Assert.Equal("10 10 H 20 V 15 H 30 V 20 H 40 V 25 H 50 V 50", path);
}
}

View File

@@ -38,8 +38,8 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add<int>(p => p.Value, value));
Assert.Contains(@$"style=""width: {(value / max * 100).ToInvariantString()}%;""", component.Markup);
Assert.Contains(@$"style=""left: {(value / max * 100).ToInvariantString()}%;""", component.Markup);
Assert.Contains(@$"style=""width: {Math.Round((value / max * 100)).ToInvariantString()}%;""", component.Markup);
Assert.Contains(@$"style=""left: {Math.Round((value / max * 100)).ToInvariantString()}%;""", component.Markup);
}
[Fact]
@@ -55,9 +55,9 @@ namespace Radzen.Blazor.Tests
parameters.Add<IEnumerable<int>>(p => p.Value, new int[] { 4, 30 });
});
Assert.Contains(@$"left: 4.00%", component.Markup);
Assert.Contains(@$"left: 30.0%", component.Markup);
Assert.Contains(@$"left: 4.00%; width: 26.00%;", component.Markup);
Assert.Contains(@$"left: 4%", component.Markup);
Assert.Contains(@$"left: 30%", component.Markup);
Assert.Contains(@$"left: 4%; width: 26%;", component.Markup);
}
[Fact]

View File

@@ -0,0 +1,197 @@
using Bunit;
using Xunit;
namespace Radzen.Blazor.Tests
{
public class SpeechToTextButtonTests
{
[Fact]
public void SpeechToTextButton_Renders_Record_Button_When_Visible()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenSpeechToTextButton>();
component.Render();
var recordButton = component.Find("button.rz-button-icon-only.rz-speech-to-text-button");
Assert.NotNull(recordButton);
}
[Fact]
public void SpeechToTextButton_Does_Not_Renders_Record_Button_When_Visible_False()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenSpeechToTextButton>();
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.Visible, false);
});
Assert.Throws<ElementNotFoundException>(() => component.Find("button.rz-button-icon-only.rz-speech-to-text-button"));
}
[Fact]
public void SpeechToTextButton_Renders_Additional_Css()
{
using var ctx = new TestContext();
var component =
ctx.RenderComponent<RadzenSpeechToTextButton>(ComponentParameter.CreateParameter("class", "another-class"));
var recordButton = component.Find("button.rz-button-icon-only.rz-speech-to-text-button.another-class");
Assert.NotNull(recordButton);
}
[Fact]
public void SpeechToTextButton_Can_Override_Default_Title_And_Aria_Label()
{
using var ctx = new TestContext();
var component =
ctx.RenderComponent<RadzenSpeechToTextButton>(
ComponentParameter.CreateParameter("title", "title override"),
ComponentParameter.CreateParameter("aria-label", "aria-label override"));
var recordButton = component.Find("button.rz-button-icon-only.rz-speech-to-text-button");
Assert.NotNull(recordButton);
Assert.Equal("title override", recordButton.GetAttribute("title"));
Assert.Equal("aria-label override", recordButton.GetAttribute("aria-label"));
}
[Fact]
public void SpeechToTextButton_Sets_Record_Button_Css_When_Record_Button_Clicked()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenSpeechToTextButton>();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
component.Render();
var recordButton = component.Find("button.rz-button-icon-only.rz-speech-to-text-button");
Assert.NotNull(recordButton);
recordButton.Click();
component.Render();
var blinkingRecordButton = component.Find("button.rz-button-icon-only.rz-speech-to-text-button-recording");
Assert.NotNull(blinkingRecordButton);
}
[Fact]
public void SpeechToTextButton_Sets_StopTitle_When_Record_Button_Clicked()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenSpeechToTextButton>();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
component.Render();
var recordButton = component.Find("button.rz-button-icon-only.rz-speech-to-text-button");
Assert.NotNull(recordButton);
recordButton.Click();
component.Render();
var blinkingRecordButton = component.Find("button.rz-button-icon-only.rz-speech-to-text-button-recording");
Assert.Equal(component.Instance.StopTitle, blinkingRecordButton.GetAttribute("title"));
}
[Fact]
public void SpeechToTextButton_ChangesIconWhen_When_Record_Button_Clicked()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenSpeechToTextButton>();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
component.Render();
var recordButton = component.Find("button.rz-button-icon-only.rz-speech-to-text-button");
Assert.NotNull(recordButton);
recordButton.Click();
component.Render();
var blinkingRecordButton = component.Find("button span");
Assert.Contains("stop", blinkingRecordButton.TextContent);
Assert.DoesNotContain("mic", blinkingRecordButton.TextContent);
}
[Fact]
public void SpeechToTextButton_UnSets_Record_Button_Css_When_Record_Button_Clicked_Twice()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenSpeechToTextButton>();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
component.Render();
var recordButton = component.Find("button.rz-button-icon-only.rz-speech-to-text-button");
Assert.NotNull(recordButton);
recordButton.Click();
component.Render();
const string blinkingRecordButtonSelector = "button.rz-button-icon-only.rz-speech-to-text-button-recording";
var blinkingRecordButton = component.Find(blinkingRecordButtonSelector);
Assert.NotNull(blinkingRecordButton);
blinkingRecordButton.Click();
component.Render();
Assert.Throws<ElementNotFoundException>(() => component.Find(blinkingRecordButtonSelector));
}
[Fact]
public void SpeechToTextButton_Invokes_OnResult_FromJs()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var component = ctx.RenderComponent<RadzenSpeechToTextButton>();
string resultsFromJs = null;
component.SetParametersAndRender(parameters => parameters.Add(p => p.Change, r => resultsFromJs = r));
var recordButton = component.Find("button.rz-button-icon-only.rz-speech-to-text-button");
Assert.NotNull(recordButton);
recordButton.Click();
const string speechResults = "results from js";
component.InvokeAsync(() => component.Instance.OnResult(speechResults));
Assert.Equal(speechResults, resultsFromJs);
}
}
}

View File

@@ -127,6 +127,8 @@ namespace Radzen.Blazor.Tests
public void SplitButton_Raises_ClickEvent()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenSplitButton>();

View File

@@ -110,7 +110,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Change, args => { raised = true; newValue = args; }));
component.Find("div").MouseUp();
component.Find("div").Click();
Assert.True(raised);
Assert.True(object.Equals(value, !(bool)newValue));
@@ -129,7 +129,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.ValueChanged, args => { raised = true; newValue = args; }));
component.Find("div").MouseUp();
component.Find("div").Click();
Assert.True(raised);
Assert.True(object.Equals(value, !(bool)newValue));

View File

@@ -1,12 +0,0 @@
{
"version": 1,
"isRoot": true,
"tools": {
"excubo.webcompiler": {
"version": "2.6.0",
"commands": [
"webcompiler"
]
}
}
}

View File

@@ -67,7 +67,13 @@ namespace Radzen.Blazor
/// <value>The ticks.</value>
public RadzenTicks Ticks { get; set; } = new RadzenTicks();
internal int TickDistance { get; set; } = 100;
/// <summary>
/// Gets or sets the pixel distance between axis ticks. It is used to calculate the number of visible ticks depending on the available space. Set to 100 by default;
/// Setting <see cref="Step" /> will override this value.
/// </summary>
/// <value>The desired pixel distance between ticks.</value>
[Parameter]
public int TickDistance { get; set; } = 100;
/// <summary>
/// Specifies the minimum value of the axis.

View File

@@ -5,6 +5,8 @@ using System.Linq;
using System.Linq.Dynamic.Core;
using Radzen.Blazor.Rendering;
using System.Threading.Tasks;
using System.Collections;
using Microsoft.AspNetCore.Components.Rendering;
namespace Radzen.Blazor
{
@@ -18,7 +20,7 @@ namespace Radzen.Blazor
/// Creates a getter function that returns a value from the specified category scale for the specified data item.
/// </summary>
/// <param name="scale">The scale.</param>
protected Func<TItem, double> Category(ScaleBase scale)
internal Func<TItem, double> Category(ScaleBase scale)
{
if (IsNumeric(CategoryProperty))
{
@@ -122,6 +124,18 @@ namespace Radzen.Blazor
[Parameter]
public RenderFragment<TItem> TooltipTemplate { get; set; }
/// <summary>
/// Gets the list of overlays.
/// </summary>
/// <value>The Overlays list.</value>
public IList<IChartSeriesOverlay> Overlays { get; } = new List<IChartSeriesOverlay>();
/// <summary>
/// Gets the coordinate system of the series.
/// </summary>
/// <value>Coordinate system enum value.</value>
public virtual CoordinateSystem CoordinateSystem => CoordinateSystem.Cartesian;
/// <summary>
/// The name of the property of <typeparamref name="TItem" /> that provides the X axis (a.k.a. category axis) values.
/// </summary>
@@ -130,11 +144,22 @@ namespace Radzen.Blazor
/// <summary>
/// Gets or sets a value indicating whether this <see cref="CartesianSeries{TItem}"/> is visible.
/// Invisible series do not appear in the legend and cannot be shown by the user.
/// Use the <c>Visible</c> property to programatically show or hide a series.
/// </summary>
/// <value><c>true</c> if visible; otherwise, <c>false</c>.</value>
[Parameter]
public bool Visible { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether this <see cref="CartesianSeries{TItem}"/> is hidden.
/// Hidden series are initially invisible and the user can show them by clicking on their label in the legend.
/// Use the <c>Hidden</c> property to hide certain series from your users but still allow them to see them.
/// </summary>
/// <value><c>true</c> if hidden; otherwise, <c>false</c>.</value>
[Parameter]
public bool Hidden { get; set; }
bool IsVisible { get; set; } = true;
bool IChartSeries.Visible
@@ -163,7 +188,7 @@ namespace Radzen.Blazor
/// </summary>
/// <value>The value.</value>
/// <exception cref="ArgumentException">ValueProperty should not be empty</exception>
protected Func<TItem, double> Value
internal Func<TItem, double> Value
{
get
{
@@ -217,6 +242,16 @@ namespace Radzen.Blazor
}
}
/// <summary>
/// Returns the category values
/// </summary>
protected virtual IList<object> GetCategories()
{
Func<TItem, object> category = String.IsNullOrEmpty(CategoryProperty) ? (item) => string.Empty : PropertyAccess.Getter<TItem, object>(CategoryProperty);
return Items.Select(category).ToList();
}
/// <inheritdoc />
public virtual ScaleBase TransformCategoryScale(ScaleBase scale)
{
@@ -244,9 +279,7 @@ namespace Radzen.Blazor
};
}
Func<TItem, object> category = String.IsNullOrEmpty(CategoryProperty) ? (item) => string.Empty : PropertyAccess.Getter<TItem, object>(CategoryProperty);
var data = Items.Select(category).ToList();
var data = GetCategories();
if (scale is OrdinalScale ordinal)
{
@@ -292,6 +325,23 @@ namespace Radzen.Blazor
/// <inheritdoc />
public abstract RenderFragment Render(ScaleBase categoryScale, ScaleBase valueScale);
/// <inheritdoc />
public RenderFragment RenderOverlays(ScaleBase categoryScale, ScaleBase valueScale)
{
return new RenderFragment(builder =>
{
builder.OpenRegion(0);
foreach (var overlay in Overlays)
{
if (overlay.Visible)
{
builder.AddContent(1, overlay.Render(categoryScale, valueScale));
}
}
builder.CloseRegion();
});
}
/// <inheritdoc />
public abstract string Color { get; }
@@ -300,9 +350,16 @@ namespace Radzen.Blazor
{
var shouldRefresh = parameters.DidParameterChange(nameof(Data), Data);
var visibleChanged = parameters.DidParameterChange(nameof(Visible), Visible);
var hiddenChanged = parameters.DidParameterChange(nameof(Hidden), Hidden);
await base.SetParametersAsync(parameters);
if (hiddenChanged)
{
IsVisible = !Hidden;
shouldRefresh = true;
}
if (visibleChanged)
{
IsVisible = Visible;
@@ -410,10 +467,7 @@ namespace Radzen.Blazor
builder.AddAttribute(1, nameof(ChartTooltip.X), x + marginLeft);
builder.AddAttribute(2, nameof(ChartTooltip.Y), y + marginTop);
if (TooltipTemplate != null)
{
builder.AddAttribute(3, nameof(ChartTooltip.ChildContent), TooltipTemplate(item));
}
builder.AddAttribute(3, nameof(ChartTooltip.ChildContent), TooltipTemplate?.Invoke(item));
builder.AddAttribute(4, nameof(ChartTooltip.Title), TooltipTitle(item));
builder.AddAttribute(5, nameof(ChartTooltip.Label), TooltipLabel(item));
@@ -482,9 +536,81 @@ namespace Radzen.Blazor
}
}
/// <inheritdoc />
public double GetMedian()
{
return Data.Select(e => Value(e)).OrderBy(e => e).Skip(Data.Count() / 2).FirstOrDefault();
}
/// <inheritdoc />
public double GetMean()
{
return Data.Select(e => Value(e)).Average();
}
/// <inheritdoc />
public double GetMode()
{
return Data.GroupBy(e => Value(e)).Select(g => new { Value = g.Key, Count = g.Count() }).OrderByDescending(e => e.Count).FirstOrDefault().Value;
}
/// <summary>
/// https://en.wikipedia.org/wiki/Simple_linear_regression#Fitting_the_regression_line
/// </summary>
public (double a, double b) GetTrend()
{
double a, b;
Func<TItem, double> X;
Func<TItem, double> Y;
if (Chart.ShouldInvertAxes())
{
X = e => Chart.CategoryScale.Scale(Value(e));
Y = e => Chart.ValueScale.Scale(Category(Chart.ValueScale)(e));
}
else
{
X = e => Chart.CategoryScale.Scale(Category(Chart.CategoryScale)(e));
Y = e => Chart.ValueScale.Scale(Value(e));
}
var avgX = Data.Select(e => X(e)).Average();
var avgY = Data.Select(e => Y(e)).Average();
var sumXY = Data.Sum(e => (X(e) - avgX) * (Y(e) - avgY));
if (Chart.ShouldInvertAxes())
{
var sumYSq = Data.Sum(e => (Y(e) - avgY) * (Y(e) - avgY));
b = sumXY / sumYSq;
a = avgX - b * avgY;
}
else
{
var sumXSq = Data.Sum(e => (X(e) - avgX) * (X(e) - avgX));
b = sumXY / sumXSq;
a = avgY - b * avgX;
}
return (a, b);
}
private async Task OnLegendItemClick()
{
IsVisible = !IsVisible;
if (Chart.LegendClick.HasDelegate)
{
var args = new LegendClickEventArgs
{
Data = this.Data,
Title = GetTitle(),
IsVisible = IsVisible,
};
await Chart.LegendClick.InvokeAsync(args);
IsVisible = args.IsVisible;
}
await Chart.Refresh();
}
@@ -527,7 +653,7 @@ namespace Radzen.Blazor
/// Gets the X coordinate of the tooltip of the specified item.
/// </summary>
/// <param name="item">The item.</param>
protected virtual double TooltipX(TItem item)
internal virtual double TooltipX(TItem item)
{
var category = Category(Chart.CategoryScale);
return Chart.CategoryScale.Scale(category(item), true);
@@ -537,7 +663,7 @@ namespace Radzen.Blazor
/// Gets the Y coordinate of the tooltip of the specified item.
/// </summary>
/// <param name="item">The item.</param>
protected virtual double TooltipY(TItem item)
internal virtual double TooltipY(TItem item)
{
return Chart.ValueScale.Scale(Value(item), true);
}
@@ -545,18 +671,34 @@ namespace Radzen.Blazor
/// <inheritdoc />
public virtual object DataAt(double x, double y)
{
var first = Items.FirstOrDefault();
var last = Items.LastOrDefault();
if (Items.Any())
{
return Items.Select(item =>
{
var distance = Math.Abs(TooltipX(item) - x);
return new { Item = item, Distance = distance };
}).Aggregate((a, b) => a.Distance < b.Distance ? a : b).Item;
}
var category = Category(Chart.CategoryScale);
return null;
}
var startX = Chart.CategoryScale.Scale(category(first), true);
var endX = Chart.CategoryScale.Scale(category(last), true);
/// <inheritdoc />
public virtual IEnumerable<ChartDataLabel> GetDataLabels(double offsetX, double offsetY)
{
var list = new List<ChartDataLabel>();
foreach (var d in Data)
{
list.Add(new ChartDataLabel
{
Position = new Point { X = TooltipX(d) + offsetX, Y = TooltipY(d) + offsetY },
TextAnchor = "middle",
Text = Chart.ValueAxis.Format(Chart.ValueScale, Value(d))
});
}
var count = Math.Max(Items.Count() - 1, 1);
var index = Convert.ToInt32((x - startX) / ((endX - startX) / count));
return Items.ElementAtOrDefault(index);
return list;
}
/// <summary>

File diff suppressed because it is too large Load Diff

View File

@@ -96,11 +96,8 @@ namespace Radzen
}
set
{
if (_form != value && value != null)
{
_form = value;
_form.AddComponent(this);
}
_form = value;
_form?.AddComponent(this);
}
}
@@ -150,7 +147,7 @@ namespace Radzen
/// Gets a value indicating whether this instance has value.
/// </summary>
/// <value><c>true</c> if this instance has value; otherwise, <c>false</c>.</value>
public bool HasValue
public virtual bool HasValue
{
get
{
@@ -219,7 +216,7 @@ namespace Radzen
/// <summary>
/// The search text
/// </summary>
protected string searchText;
internal string searchText;
/// <summary>
/// The view

View File

@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -36,19 +37,36 @@ namespace Radzen
/// </example>
public class DialogService : IDisposable
{
private DotNetObjectReference<DialogService> reference;
internal DotNetObjectReference<DialogService> Reference
{
get
{
if (reference == null)
{
reference = DotNetObjectReference.Create(this);
}
return reference;
}
}
/// <summary>
/// Gets or sets the URI helper.
/// </summary>
/// <value>The URI helper.</value>
NavigationManager UriHelper { get; set; }
IJSRuntime JSRuntime { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="DialogService"/> class.
/// </summary>
/// <param name="uriHelper">The URI helper.</param>
public DialogService(NavigationManager uriHelper)
/// <param name="jsRuntime">IJSRuntime instance.</param>
public DialogService(NavigationManager uriHelper, IJSRuntime jsRuntime)
{
UriHelper = uriHelper;
JSRuntime = jsRuntime;
if (UriHelper != null)
{
@@ -62,6 +80,11 @@ namespace Radzen
{
Close();
}
if (_sideDialogTask?.Task.IsCompleted == false)
{
CloseSide();
}
}
/// <summary>
@@ -79,6 +102,16 @@ namespace Radzen
/// </summary>
public event Action<string, Type, Dictionary<string, object>, DialogOptions> OnOpen;
/// <summary>
/// Raises the Close event for the side dialog
/// </summary>
public event Action<dynamic> OnSideClose;
/// <summary>
/// Raises the Open event for the side dialog
/// </summary>
public event Action<Type, Dictionary<string, object>, SideDialogOptions> OnSideOpen;
/// <summary>
/// Opens a dialog with the specified arguments.
/// </summary>
@@ -103,6 +136,7 @@ namespace Radzen
/// The tasks
/// </summary>
protected List<TaskCompletionSource<dynamic>> tasks = new List<TaskCompletionSource<dynamic>>();
private TaskCompletionSource<dynamic> _sideDialogTask;
/// <summary>
/// Opens a dialog with the specified arguments.
@@ -122,6 +156,42 @@ namespace Radzen
return task.Task;
}
/// <summary>
/// Opens a side dialog with the specified arguments
/// </summary>
/// <typeparam name="T">The type of Blazor component which will be displayed in the side dialog.</typeparam>
/// <param name="title">The text displayed in the title bar of the side dialog.</param>
/// <param name="parameters">The dialog parameters. Passed as property values of <typeparamref name="T"/></param>
/// <param name="options">The side dialog options.</param>
/// <returns>A task that completes when the dialog is closed or a new one opened</returns>
public Task<dynamic> OpenSideAsync<T>(string title, Dictionary<string, object> parameters = null, SideDialogOptions options = null)
where T : ComponentBase
{
CloseSide();
_sideDialogTask = new TaskCompletionSource<dynamic>();
if (options == null)
{
options = new SideDialogOptions();
}
options.Title = title;
OnSideOpen?.Invoke(typeof(T), parameters ?? new Dictionary<string, object>(), options);
return _sideDialogTask.Task;
}
/// <summary>
/// Closes the side dialog
/// </summary>
/// <param name="result">The result of the Dialog</param>
public void CloseSide(dynamic result = null)
{
if (_sideDialogTask?.Task.IsCompleted == false)
{
_sideDialogTask.TrySetResult(result);
OnSideClose?.Invoke(result);
}
}
/// <summary>
/// Opens a dialog with the specified content.
/// </summary>
@@ -171,6 +241,7 @@ namespace Radzen
Width = options != null && !string.IsNullOrEmpty(options.Width) ? options.Width : "600px",
Left = options != null && !string.IsNullOrEmpty(options.Left) ? options.Left : "",
Top = options != null && !string.IsNullOrEmpty(options.Top) ? options.Top : "",
Bottom = options != null && !string.IsNullOrEmpty(options.Bottom) ? options.Bottom : "",
Height = options != null && !string.IsNullOrEmpty(options.Height) ? options.Height : "",
ShowTitle = options != null ? options.ShowTitle : true,
ShowClose = options != null ? options.ShowClose : true,
@@ -180,6 +251,8 @@ namespace Radzen
Style = options != null ? options.Style : "",
AutoFocusFirstElement = options != null ? options.AutoFocusFirstElement : true,
CloseDialogOnOverlayClick = options != null ? options.CloseDialogOnOverlayClick : false,
CloseDialogOnEsc = options != null ? options.CloseDialogOnEsc : true,
CssClass = options != null ? options.CssClass : "",
});
}
@@ -187,7 +260,8 @@ namespace Radzen
/// Closes the last opened dialog with optional result.
/// </summary>
/// <param name="result">The result.</param>
public void Close(dynamic result = null)
[JSInvokable("DialogService.Close")]
public virtual void Close(dynamic result = null)
{
var dialog = dialogs.LastOrDefault();
@@ -208,6 +282,9 @@ namespace Radzen
/// <inheritdoc />
public void Dispose()
{
reference?.Dispose();
reference = null;
UriHelper.LocationChanged -= UriHelper_OnLocationChanged;
}
@@ -218,59 +295,114 @@ namespace Radzen
/// <param name="title">The text displayed in the title bar of the dialog.</param>
/// <param name="options">The options.</param>
/// <returns><c>true</c> if the user clicked the OK button, <c>false</c> otherwise.</returns>
public async Task<bool?> Confirm(string message = "Confirm?", string title = "Confirm", ConfirmOptions options = null) => await OpenAsync(title, ds => {
RenderFragment content = b =>
{
var i = 0;
b.OpenElement(i++, "div");
b.OpenElement(i++, "p");
b.AddAttribute(i++, "style", "margin-bottom: 20px;");
b.AddContent(i++, message);
b.CloseElement();
b.OpenElement(i++, "div");
b.AddAttribute(i++, "class", "row");
b.OpenElement(i++, "div");
b.AddAttribute(i++, "class", "col-md-12");
b.OpenComponent<Blazor.RadzenButton>(i++);
b.AddAttribute(i++, "Text", options != null ? options.OkButtonText : "Ok");
b.AddAttribute(i++, "Style", "margin-bottom: 10px; width: 150px");
b.AddAttribute(i++, "Click", EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, () => ds.Close(true)));
b.CloseComponent();
b.OpenComponent<Blazor.RadzenButton>(i++);
b.AddAttribute(i++, "Text", options != null ? options.CancelButtonText : "Cancel");
b.AddAttribute(i++, "ButtonStyle", ButtonStyle.Secondary);
b.AddAttribute(i++, "Style", "margin-bottom: 10px; margin-left: 10px; width: 150px");
b.AddAttribute(i++, "Click", EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, () => ds.Close(false)));
b.CloseComponent();
b.CloseElement();
b.CloseElement();
b.CloseElement();
};
return content;
}, new DialogOptions()
public async Task<bool?> Confirm(string message = "Confirm?", string title = "Confirm", ConfirmOptions options = null)
{
Width = options != null ? !string.IsNullOrEmpty(options.Width) ? options.Width : "355px" : "355px",
Height = options != null ? options.Height : null,
Left = options != null ? options.Left : null,
Top = options != null ? options.Top : null,
Bottom = options != null ? options.Bottom : null,
ChildContent = options != null ? options.ChildContent : null,
ShowTitle = options != null ? options.ShowTitle : true,
ShowClose = options != null ? options.ShowClose : true,
Resizable = options != null ? options.Resizable : false,
Draggable = options != null ? options.Draggable : false,
Style = options != null ? options.Style : "",
});
var dialogOptions = new DialogOptions()
{
Width = options != null ? !string.IsNullOrEmpty(options.Width) ? options.Width : "" : "",
Height = options != null ? options.Height : null,
Left = options != null ? options.Left : null,
Top = options != null ? options.Top : null,
Bottom = options != null ? options.Bottom : null,
ChildContent = options != null ? options.ChildContent : null,
ShowTitle = options != null ? options.ShowTitle : true,
ShowClose = options != null ? options.ShowClose : true,
Resizable = options != null ? options.Resizable : false,
Draggable = options != null ? options.Draggable : false,
Style = options != null ? options.Style : "",
AutoFocusFirstElement = options != null ? options.AutoFocusFirstElement : true,
CloseDialogOnOverlayClick = options != null ? options.CloseDialogOnOverlayClick : false,
CloseDialogOnEsc = options != null ? options.CloseDialogOnEsc : true,
CssClass = options != null ? $"rz-dialog-confirm {options.CssClass}" : "rz-dialog-confirm",
};
return await OpenAsync(title, ds =>
{
RenderFragment content = b =>
{
var i = 0;
b.OpenElement(i++, "p");
b.AddAttribute(i++, "class", "rz-dialog-confirm-message");
b.AddContent(i++, message);
b.CloseElement();
b.OpenElement(i++, "div");
b.AddAttribute(i++, "class", "rz-dialog-confirm-buttons");
b.OpenComponent<Blazor.RadzenButton>(i++);
b.AddAttribute(i++, "Text", options != null ? options.OkButtonText : "Ok");
b.AddAttribute(i++, "Click", EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, () => ds.Close(true)));
b.CloseComponent();
b.OpenComponent<Blazor.RadzenButton>(i++);
b.AddAttribute(i++, "Text", options != null ? options.CancelButtonText : "Cancel");
b.AddAttribute(i++, "ButtonStyle", ButtonStyle.Secondary);
b.AddAttribute(i++, "Click", EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, () => ds.Close(false)));
b.CloseComponent();
b.CloseElement();
};
return content;
}, dialogOptions);
}
/// <summary>
/// Displays a alert dialog.
/// </summary>
/// <param name="message">The message displayed to the user.</param>
/// <param name="title">The text displayed in the title bar of the dialog.</param>
/// <param name="options">The options.</param>
/// <returns><c>true</c> if the user clicked the OK button, <c>false</c> otherwise.</returns>
public async Task<bool?> Alert(string message = "", string title = "Message", AlertOptions options = null)
{
var dialogOptions = new DialogOptions()
{
Width = options != null ? !string.IsNullOrEmpty(options.Width) ? options.Width : "" : "",
Height = options != null ? options.Height : null,
Left = options != null ? options.Left : null,
Top = options != null ? options.Top : null,
Bottom = options != null ? options.Bottom : null,
ChildContent = options != null ? options.ChildContent : null,
ShowTitle = options != null ? options.ShowTitle : true,
ShowClose = options != null ? options.ShowClose : true,
Resizable = options != null ? options.Resizable : false,
Draggable = options != null ? options.Draggable : false,
Style = options != null ? options.Style : "",
AutoFocusFirstElement = options != null ? options.AutoFocusFirstElement : true,
CloseDialogOnOverlayClick = options != null ? options.CloseDialogOnOverlayClick : false,
CloseDialogOnEsc = options != null ? options.CloseDialogOnEsc : true,
CssClass = options != null ? $"rz-dialog-alert {options.CssClass}" : "rz-dialog-alert",
};
return await OpenAsync(title, ds =>
{
RenderFragment content = b =>
{
var i = 0;
b.OpenElement(i++, "p");
b.AddAttribute(i++, "class", "rz-dialog-alert-message");
b.AddContent(i++, message);
b.CloseElement();
b.OpenElement(i++, "div");
b.AddAttribute(i++, "class", "rz-dialog-alert-buttons");
b.OpenComponent<Blazor.RadzenButton>(i++);
b.AddAttribute(i++, "Text", options != null ? options.OkButtonText : "Ok");
b.AddAttribute(i++, "Click", EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, () => ds.Close(true)));
b.CloseComponent();
b.CloseElement();
};
return content;
}, dialogOptions);
}
}
/// <summary>
/// Class DialogOptions.
/// Base Class for dialog options
/// </summary>
public class DialogOptions
public abstract class DialogOptionsBase
{
/// <summary>
/// Gets or sets a value indicating whether to show the title bar. Set to <c>true</c> by default.
@@ -283,7 +415,83 @@ namespace Radzen
/// </summary>
/// <value><c>true</c> if the close button is shown; otherwise, <c>false</c>.</value>
public bool ShowClose { get; set; } = true;
/// <summary>
/// Gets or sets the width of the dialog.
/// </summary>
/// <value>The width.</value>
public string Width { get; set; }
/// <summary>
/// Gets or sets the height of the dialog.
/// </summary>
/// <value>The height.</value>
public string Height { get; set; }
/// <summary>
/// Gets or sets the CSS style of the dialog
/// </summary>
/// <value>The style.</value>
public string Style { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the dialog should be closed by clicking the overlay.
/// </summary>
/// <value><c>true</c> if closeable; otherwise, <c>false</c>.</value>
public bool CloseDialogOnOverlayClick { get; set; } = false;
/// <summary>
/// Gets or sets dialog box custom class
/// </summary>
public string CssClass { get; set; }
}
/// <summary>
/// Class SideDialogOptions
/// </summary>
public class SideDialogOptions : DialogOptionsBase
{
/// <summary>
/// The title displayed on the dialog.
/// </summary>
public string Title { get; set; }
/// <summary>
/// The Position on which the dialog will be positioned
/// </summary>
public DialogPosition Position { get; set; } = DialogPosition.Right;
/// <summary>
/// Whether to show a mask on the background or not
/// </summary>
public bool ShowMask { get; set; } = true;
}
/// <summary>
/// DialogPosition enum
/// </summary>
public enum DialogPosition
{
/// <summary>
/// Dialog will be positioned on the right side
/// </summary>
Right,
/// <summary>
/// Dialog will be positioned on the left side
/// </summary>
Left,
/// <summary>
/// Dialog will be positioned on the top of the page
/// </summary>
Top,
/// <summary>
/// Dialog will be positioned at the bottom of the page
/// </summary>
Bottom
}
/// <summary>
/// Class DialogOptions.
/// </summary>
public class DialogOptions : DialogOptionsBase
{
/// <summary>
/// Gets or sets a value indicating whether the dialog is resizable. Set to <c>false</c> by default.
/// </summary>
@@ -310,21 +518,6 @@ namespace Radzen
/// <value>The bottom.</value>
public string Bottom { get; set; }
/// <summary>
/// Gets or sets the width of the dialog.
/// </summary>
/// <value>The width.</value>
public string Width { get; set; }
/// <summary>
/// Gets or sets the height of the dialog.
/// </summary>
/// <value>The height.</value>
public string Height { get; set; }
/// <summary>
/// Gets or sets the CSS style of the dialog
/// </summary>
/// <value>The style.</value>
public string Style { get; set; }
/// <summary>
/// Gets or sets the child content.
/// </summary>
/// <value>The child content.</value>
@@ -333,23 +526,29 @@ namespace Radzen
/// Gets or sets a value indicating whether to focus the first focusable HTML element. Set to <c>true</c> by default.
/// </summary>
public bool AutoFocusFirstElement { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether the dialog should be closed by clicking the overlay.
/// Gets or sets a value indicating whether the dialog should be closed on ESC key press.
/// </summary>
/// <value><c>true</c> if closeable; otherwise, <c>false</c>.</value>
public bool CloseDialogOnOverlayClick { get; set; } = false;
public bool CloseDialogOnEsc { get; set; } = true;
}
/// <summary>
/// Class ConfirmOptions.
/// </summary>
public class ConfirmOptions : DialogOptions
public class AlertOptions : DialogOptions
{
/// <summary>
/// Gets or sets the text of the OK button.
/// </summary>
public string OkButtonText { get; set; }
}
/// <summary>
/// Class ConfirmOptions.
/// </summary>
public class ConfirmOptions : AlertOptions
{
/// <summary>
/// Gets or sets the text of the Cancel button.
/// </summary>

View File

@@ -16,7 +16,13 @@ namespace Radzen
/// <typeparam name="T"></typeparam>
public class DropDownBase<T> : DataBoundFormComponent<T>
{
#if NET5
#if NET5_0_OR_GREATER
/// <summary>
/// Gets or sets a value that determines how many additional items will be rendered before and after the visible region. This help to reduce the frequency of rendering during scrolling. However, higher values mean that more elements will be present in the page.
/// </summary>
[Parameter]
public int VirtualizationOverscanCount { get; set; }
internal Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<object> virtualize;
/// <summary>
@@ -30,19 +36,28 @@ namespace Radzen
}
}
List<object> virtualItems;
private async ValueTask<Microsoft.AspNetCore.Components.Web.Virtualization.ItemsProviderResult<object>> LoadItems(Microsoft.AspNetCore.Components.Web.Virtualization.ItemsProviderRequest request)
{
var data = Data != null ? Data.Cast<object>() : Enumerable.Empty<object>();
var view = (LoadData.HasDelegate ? data : View).Cast<object>().AsQueryable();
var totalItemsCount = LoadData.HasDelegate ? Count : view.Count();
var top = Math.Min(request.Count, totalItemsCount - request.StartIndex);
var top = request.Count;
if(top <= 0)
{
top = PageSize;
}
if (LoadData.HasDelegate)
{
await LoadData.InvokeAsync(new Radzen.LoadDataArgs() { Skip = request.StartIndex, Top = request.Count, Filter = await JSRuntime.InvokeAsync<string>("Radzen.getInputValue", search) });
}
return new Microsoft.AspNetCore.Components.Web.Virtualization.ItemsProviderResult<object>(LoadData.HasDelegate ? Data.Cast<object>() : view.Skip(request.StartIndex).Take(top), LoadData.HasDelegate ? Count : totalItemsCount);
virtualItems = (LoadData.HasDelegate ? Data : view.Skip(request.StartIndex).Take(top)).Cast<object>().ToList();
return new Microsoft.AspNetCore.Components.Web.Virtualization.ItemsProviderResult<object>(virtualItems, LoadData.HasDelegate ? Count : totalItemsCount);
}
/// <summary>
@@ -69,13 +84,22 @@ namespace Radzen
/// <returns><c>true</c> if virtualization is allowed; otherwise, <c>false</c>.</returns>
internal bool IsVirtualizationAllowed()
{
#if NET5
#if NET5_0_OR_GREATER
return AllowVirtualization;
#else
return false;
#endif
}
internal int GetVirtualizationOverscanCount()
{
#if NET5_0_OR_GREATER
return VirtualizationOverscanCount;
#else
return 0;
#endif
}
/// <summary>
/// Renders the items.
/// </summary>
@@ -84,7 +108,7 @@ namespace Radzen
{
return new RenderFragment(builder =>
{
#if NET5
#if NET5_0_OR_GREATER
if (AllowVirtualization)
{
builder.OpenComponent(0, typeof(Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<object>));
@@ -97,6 +121,11 @@ namespace Radzen
});
}));
if(VirtualizationOverscanCount != default(int))
{
builder.AddAttribute(3, "OverscanCount", VirtualizationOverscanCount);
}
builder.AddComponentReferenceCapture(7, c => { virtualize = (Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<object>)c; });
builder.CloseComponent();
@@ -117,6 +146,26 @@ namespace Radzen
});
}
/// <inheritdoc />
public override bool HasValue
{
get
{
if (typeof(T) == typeof(string))
{
return !string.IsNullOrEmpty($"{internalValue}");
}
else if (typeof(IEnumerable).IsAssignableFrom(typeof(T)))
{
return internalValue != null && ((IEnumerable)internalValue).Cast<object>().Any();
}
else
{
return internalValue != null;
}
}
}
/// <summary>
/// Renders the item.
/// </summary>
@@ -127,6 +176,23 @@ namespace Radzen
//
}
System.Collections.Generic.HashSet<object> keys = new System.Collections.Generic.HashSet<object>();
internal object GetKey(object item)
{
var value = GetItemOrValueFromProperty(item, ValueProperty);
if (!keys.Contains(value))
{
keys.Add(value);
return value;
}
else
{
return item;
}
}
/// <summary>
/// Gets or sets a value indicating whether filtering is allowed. Set to <c>false</c> by default.
/// </summary>
@@ -148,6 +214,13 @@ namespace Radzen
[Parameter]
public bool Multiple { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the user can select all values in multiple selection. Set to <c>true</c> by default.
/// </summary>
/// <value><c>true</c> if select all values is allowed; otherwise, <c>false</c>.</value>
[Parameter]
public bool AllowSelectAll { get; set; } = true;
/// <summary>
/// Gets or sets the template.
/// </summary>
@@ -162,6 +235,13 @@ namespace Radzen
[Parameter]
public string ValueProperty { get; set; }
/// <summary>
/// Gets or sets the disabled property.
/// </summary>
/// <value>The disabled property.</value>
[Parameter]
public string DisabledProperty { get; set; }
/// <summary>
/// Gets or sets the selected item changed.
/// </summary>
@@ -172,7 +252,7 @@ namespace Radzen
/// <summary>
/// The selected items
/// </summary>
protected List<object> selectedItems = new List<object>();
protected IList<object> selectedItems = new List<object>();
/// <summary>
/// The selected item
/// </summary>
@@ -188,10 +268,10 @@ namespace Radzen
return;
}
if (selectedItems.Count != View.Cast<object>().Count())
if (selectedItems.Count != View.Cast<object>().ToList().Where(i => disabledPropertyGetter != null ? disabledPropertyGetter(i) as bool? != true : true).Count())
{
selectedItems.Clear();
selectedItems = View.Cast<object>().ToList();
selectedItems = View.Cast<object>().ToList().Where(i => disabledPropertyGetter != null ? disabledPropertyGetter(i) as bool? != true : true).ToList();
}
else
{
@@ -201,21 +281,46 @@ namespace Radzen
if (!string.IsNullOrEmpty(ValueProperty))
{
System.Reflection.PropertyInfo pi = PropertyAccess.GetElementType(Data.GetType()).GetProperty(ValueProperty);
Value = selectedItems.Select(i => PropertyAccess.GetItemOrValueFromProperty(i, ValueProperty)).AsQueryable().Cast(pi.PropertyType);
internalValue = selectedItems.Select(i => GetItemOrValueFromProperty(i, ValueProperty)).AsQueryable().Cast(pi.PropertyType);
}
else
{
var type = typeof(T).IsGenericType ? typeof(T).GetGenericArguments()[0] : typeof(T);
Value = selectedItems.AsQueryable().Cast(type);
internalValue = selectedItems.AsQueryable().Cast(type);
}
await ValueChanged.InvokeAsync((T)Value);
if (typeof(IList).IsAssignableFrom(typeof(T)))
{
var list = (IList)Activator.CreateInstance(typeof(T));
foreach (var i in (IEnumerable)internalValue)
{
list.Add(i);
}
await ValueChanged.InvokeAsync((T)(object)list);
}
else
{
await ValueChanged.InvokeAsync((T)internalValue);
}
if (FieldIdentifier.FieldName != null) { EditContext?.NotifyFieldChanged(FieldIdentifier); }
await Change.InvokeAsync(Value);
await Change.InvokeAsync(internalValue);
StateHasChanged();
}
internal bool IsAllSelected()
{
if (LoadData.HasDelegate && !string.IsNullOrEmpty(ValueProperty))
{
return View != null && View.Cast<object>().ToList()
.Where(i => disabledPropertyGetter != null ? disabledPropertyGetter(i) as bool? != true : true)
.All(i => IsItemSelectedByValue(GetItemOrValueFromProperty(i, ValueProperty)));
}
return View != null && selectedItems.Count == View.Cast<object>().ToList()
.Where(i => disabledPropertyGetter != null ? disabledPropertyGetter(i) as bool? != true : true).Count();
}
/// <summary>
/// Resets this instance.
/// </summary>
@@ -236,16 +341,16 @@ namespace Radzen
searchText = null;
await JSRuntime.InvokeAsync<string>("Radzen.setInputValue", search, "");
Value = default(T);
internalValue = default(T);
selectedItem = null;
selectedItems.Clear();
selectedIndex = -1;
await ValueChanged.InvokeAsync((T)Value);
await ValueChanged.InvokeAsync((T)internalValue);
if (FieldIdentifier.FieldName != null) { EditContext?.NotifyFieldChanged(FieldIdentifier); }
await Change.InvokeAsync(Value);
await Change.InvokeAsync(internalValue);
await OnFilter(new ChangeEventArgs());
@@ -281,15 +386,94 @@ namespace Radzen
selectedItems.Clear();
}
SelectItemFromValue(Value);
OnDataChanged();
StateHasChanged();
InvokeAsync(OnDataChanged);
}
}
}
/// <inheritdoc/>
protected override void OnParametersSet()
{
base.OnParametersSet();
if (_data != null)
{
var query = _data.AsQueryable();
var type = query.ElementType;
if (type == typeof(object) && typeof(EnumerableQuery).IsAssignableFrom(query.GetType()) && query.Any())
{
type = query.FirstOrDefault().GetType();
}
if (!string.IsNullOrEmpty(ValueProperty))
{
valuePropertyGetter = PropertyAccess.Getter<object, object>(ValueProperty, type);
}
if (!string.IsNullOrEmpty(TextProperty))
{
textPropertyGetter = PropertyAccess.Getter<object, object>(TextProperty, type);
}
if (!string.IsNullOrEmpty(DisabledProperty))
{
disabledPropertyGetter = PropertyAccess.Getter<object, object>(DisabledProperty, type);
}
}
}
internal Func<object, object> valuePropertyGetter;
internal Func<object, object> textPropertyGetter;
internal Func<object, object> disabledPropertyGetter;
/// <summary>
/// Gets the item or value from property.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="property">The property.</param>
/// <returns>System.Object.</returns>
public object GetItemOrValueFromProperty(object item, string property)
{
if (item != null)
{
if (property == TextProperty && textPropertyGetter != null)
{
return textPropertyGetter(item);
}
else if (property == ValueProperty && valuePropertyGetter != null)
{
return valuePropertyGetter(item);
}
else if (property == DisabledProperty && disabledPropertyGetter != null)
{
return disabledPropertyGetter(item);
}
var enumValue = item as Enum;
if (enumValue != null)
{
return Radzen.Blazor.EnumExtensions.GetDisplayDescription(enumValue);
}
}
return item;
}
#if NET5_0_OR_GREATER
/// <inheritdoc/>
protected override async Task OnDataChanged()
{
await base.OnDataChanged();
if (AllowVirtualization && Virtualize != null && !LoadData.HasDelegate)
{
await InvokeAsync(Virtualize.RefreshDataAsync);
}
}
#endif
/// <summary>
/// Gets the popup identifier.
/// </summary>
@@ -298,7 +482,7 @@ namespace Radzen
{
get
{
return $"popup{UniqueID}";
return $"popup-{GetId()}";
}
}
@@ -310,7 +494,7 @@ namespace Radzen
{
get
{
return $"search{UniqueID}";
return $"search-{GetId()}";
}
}
@@ -356,7 +540,7 @@ namespace Radzen
/// <summary>
/// The list
/// </summary>
protected ElementReference list;
protected ElementReference? list;
/// <summary>
/// The selected index
/// </summary>
@@ -376,7 +560,10 @@ namespace Radzen
await JSRuntime.InvokeVoidAsync("Radzen.togglePopup", Element, PopupID, true);
await JSRuntime.InvokeVoidAsync("Radzen.focusElement", isFilter ? UniqueID : SearchID);
await JSRuntime.InvokeVoidAsync("Radzen.selectListItem", search, list, selectedIndex);
if (list != null)
{
await JSRuntime.InvokeVoidAsync("Radzen.selectListItem", search, list, selectedIndex);
}
}
/// <summary>
@@ -389,7 +576,28 @@ namespace Radzen
if (Disabled)
return;
var items = (LoadData.HasDelegate ? Data != null ? Data : Enumerable.Empty<object>() : (View != null ? View : Enumerable.Empty<object>())).Cast<object>();
List<object> items = Enumerable.Empty<object>().ToList();
if (LoadData.HasDelegate)
{
if (Data != null)
{
items = Data.Cast<object>().ToList();
}
}
else
{
if (IsVirtualizationAllowed())
{
#if NET5_0_OR_GREATER
items = virtualItems;
#endif
}
else
{
items = View.Cast<object>().ToList();
}
}
var key = args.Code != null ? args.Code : args.Key;
@@ -397,11 +605,13 @@ namespace Radzen
{
try
{
var newSelectedIndex = await JSRuntime.InvokeAsync<int>("Radzen.focusListItem", search, list, key == "ArrowDown" || key == "ArrowRight", selectedIndex);
var currentViewIndex = Multiple ? selectedIndex : items.IndexOf(selectedItem);
var newSelectedIndex = await JSRuntime.InvokeAsync<int>("Radzen.focusListItem", search, list, key == "ArrowDown" || key == "ArrowRight", currentViewIndex);
if (!Multiple)
{
if (newSelectedIndex != selectedIndex && newSelectedIndex >= 0 && newSelectedIndex <= items.Count() - 1)
if (newSelectedIndex != currentViewIndex && newSelectedIndex >= 0 && newSelectedIndex <= items.Count() - 1)
{
selectedIndex = newSelectedIndex;
await OnSelectItem(items.ElementAt(selectedIndex), true);
@@ -409,7 +619,7 @@ namespace Radzen
}
else
{
selectedIndex = await JSRuntime.InvokeAsync<int>("Radzen.focusListItem", search, list, key == "ArrowDown", selectedIndex);
selectedIndex = await JSRuntime.InvokeAsync<int>("Radzen.focusListItem", search, list, key == "ArrowDown", currentViewIndex);
}
}
catch (Exception)
@@ -417,7 +627,7 @@ namespace Radzen
//
}
}
else if (Multiple && key == "Space")
else if (Multiple && key == "Enter")
{
if (selectedIndex >= 0 && selectedIndex <= items.Count() - 1)
{
@@ -433,7 +643,7 @@ namespace Radzen
{
await JSRuntime.InvokeVoidAsync("Radzen.closePopup", PopupID);
}
else if (key == "Delete")
else if (key == "Delete" && AllowClear)
{
if (!Multiple && selectedItem != null)
{
@@ -446,7 +656,7 @@ namespace Radzen
Debounce(DebounceFilter, FilterDelay);
}
}
else if(AllowFiltering && isFilter)
else if (AllowFiltering && isFilter)
{
Debounce(DebounceFilter, FilterDelay);
}
@@ -472,13 +682,13 @@ namespace Radzen
_view = null;
if (IsVirtualizationAllowed())
{
#if NET5
#if NET5_0_OR_GREATER
if (virtualize != null)
{
await virtualize.RefreshDataAsync();
}
await InvokeAsync(() => { StateHasChanged(); });
#endif
#endif
}
else
{
@@ -489,20 +699,23 @@ namespace Radzen
{
if (IsVirtualizationAllowed())
{
#if NET5
#if NET5_0_OR_GREATER
if (virtualize != null)
{
await InvokeAsync(virtualize.RefreshDataAsync);
}
await InvokeAsync(() => { StateHasChanged(); });
#endif
#endif
}
else
{
await LoadData.InvokeAsync(await GetLoadDataArgs());
}
}
}
if (Multiple)
selectedIndex = -1;
await JSRuntime.InvokeAsync<string>("Radzen.repositionPopup", Element, PopupID);
}
@@ -540,7 +753,7 @@ namespace Radzen
/// <returns>LoadDataArgs.</returns>
internal virtual async System.Threading.Tasks.Task<LoadDataArgs> GetLoadDataArgs()
{
#if NET5
#if NET5_0_OR_GREATER
if (AllowVirtualization)
{
return new Radzen.LoadDataArgs() { Skip = 0, Top = PageSize, Filter = await JSRuntime.InvokeAsync<string>("Radzen.getInputValue", search) };
@@ -571,6 +784,14 @@ namespace Radzen
return base.OnAfterRenderAsync(firstRender);
}
/// <inheritdoc />
protected override void OnInitialized()
{
internalValue = Value;
base.OnInitialized();
}
/// <summary>
/// Set parameters as an asynchronous operation.
/// </summary>
@@ -578,7 +799,7 @@ namespace Radzen
/// <returns>A Task representing the asynchronous operation.</returns>
public override async Task SetParametersAsync(ParameterView parameters)
{
#if NET5
#if NET5_0_OR_GREATER
var pageSize = parameters.GetValueOrDefault<int>(nameof(PageSize));
if(pageSize != default(int))
{
@@ -599,6 +820,11 @@ namespace Radzen
shouldClose = !visible;
}
if (parameters.DidParameterChange(nameof(Value), Value))
{
internalValue = parameters.GetValueOrDefault<object>(nameof(Value));
}
await base.SetParametersAsync(parameters);
if (shouldClose && !firstRender)
@@ -613,7 +839,7 @@ namespace Radzen
/// <returns>Task.</returns>
protected override Task OnParametersSetAsync()
{
var valueAsEnumerable = Value as IEnumerable;
var valueAsEnumerable = internalValue as IEnumerable;
if (valueAsEnumerable != null)
{
@@ -623,7 +849,7 @@ namespace Radzen
}
}
SelectItemFromValue(Value);
SelectItemFromValue(internalValue);
return base.OnParametersSetAsync();
}
@@ -634,7 +860,7 @@ namespace Radzen
/// <param name="args">The <see cref="ChangeEventArgs"/> instance containing the event data.</param>
protected void OnChange(ChangeEventArgs args)
{
Value = args.Value;
internalValue = args.Value;
}
/// <summary>
@@ -642,15 +868,22 @@ namespace Radzen
/// </summary>
/// <param name="item">The item.</param>
/// <returns><c>true</c> if the specified item is selected; otherwise, <c>false</c>.</returns>
internal bool isSelected(object item)
internal bool IsSelected(object item)
{
if (Multiple)
if (!string.IsNullOrEmpty(ValueProperty))
{
return selectedItems.IndexOf(item) != -1;
return IsItemSelectedByValue(GetItemOrValueFromProperty(item, ValueProperty));
}
else
{
return item == selectedItem;
if (Multiple)
{
return selectedItems.IndexOf(item) != -1;
}
else
{
return object.Equals(item,selectedItem);
}
}
}
@@ -674,6 +907,13 @@ namespace Radzen
}
}
/// <summary>
/// Gets or sets the item separator for Multiple dropdown.
/// </summary>
/// <value>Item separator</value>
[Parameter]
public string Separator { get; set; } = ",";
/// <summary>
/// Gets the items.
/// </summary>
@@ -729,7 +969,7 @@ namespace Radzen
}
else
{
_view = (typeof(IQueryable).IsAssignableFrom(Data.GetType())) ? Query.Cast<object>().ToList().AsQueryable() : Query;
_view = (typeof(IQueryable).IsAssignableFrom(Data.GetType())) ? (Query as IEnumerable).Cast<object>().ToList().AsQueryable() : Query;
}
}
}
@@ -770,13 +1010,20 @@ namespace Radzen
await SelectItem(item, raiseChange);
}
internal object internalValue;
/// <summary>
/// Selects the item.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="raiseChange">if set to <c>true</c> [raise change].</param>
protected async System.Threading.Tasks.Task SelectItem(object item, bool raiseChange = true)
public async System.Threading.Tasks.Task SelectItem(object item, bool raiseChange = true)
{
if (disabledPropertyGetter != null && disabledPropertyGetter(item) as bool? == true)
{
return;
}
if (!Multiple)
{
if (object.Equals(item, selectedItem))
@@ -785,11 +1032,11 @@ namespace Radzen
selectedItem = item;
if (!string.IsNullOrEmpty(ValueProperty))
{
Value = PropertyAccess.GetItemOrValueFromProperty(item, ValueProperty);
internalValue = PropertyAccess.GetItemOrValueFromProperty(item, ValueProperty);
}
else
{
Value = item;
internalValue = item;
}
SetSelectedIndexFromSelectedItem();
@@ -798,43 +1045,94 @@ namespace Radzen
}
else
{
if (selectedItems.IndexOf(item) == -1)
{
selectedItems.Add(item);
}
else
{
selectedItems.Remove(item);
}
UpdateSelectedItems(item);
if (!string.IsNullOrEmpty(ValueProperty))
{
System.Reflection.PropertyInfo pi = PropertyAccess.GetElementType(Data.GetType()).GetProperty(ValueProperty);
Value = selectedItems.Select(i => PropertyAccess.GetItemOrValueFromProperty(i, ValueProperty)).AsQueryable().Cast(pi.PropertyType);
internalValue = selectedItems.Select(i => GetItemOrValueFromProperty(i, ValueProperty)).AsQueryable().Cast(pi.PropertyType);
}
else
{
var firstElement = Data.Cast<object>().FirstOrDefault();
var elementType = firstElement != null ? firstElement.GetType() : null;
var query = Data.AsQueryable();
var elementType = query.ElementType;
if (elementType == typeof(object) && typeof(EnumerableQuery).IsAssignableFrom(query.GetType()) && query.Any())
{
elementType = query.FirstOrDefault().GetType();
}
if (elementType != null)
{
Value = selectedItems.AsQueryable().Cast(elementType);
internalValue = selectedItems.AsQueryable().Cast(elementType);
}
else
{
Value = selectedItems;
internalValue = selectedItems;
}
}
}
if (raiseChange)
{
await ValueChanged.InvokeAsync(object.Equals(Value, null) ? default(T) : (T)Value);
if (ValueChanged.HasDelegate)
{
if (typeof(IList).IsAssignableFrom(typeof(T)))
{
if (object.Equals(internalValue, null))
{
await ValueChanged.InvokeAsync(default(T));
}
else
{
var list = (IList)Activator.CreateInstance(typeof(T));
foreach (var i in (IEnumerable)internalValue)
{
list.Add(i);
}
await ValueChanged.InvokeAsync((T)(object)list);
}
}
else
{
await ValueChanged.InvokeAsync(object.Equals(internalValue, null) ? default(T) : (T)internalValue);
}
}
if (FieldIdentifier.FieldName != null) { EditContext?.NotifyFieldChanged(FieldIdentifier); }
await Change.InvokeAsync(Value);
await Change.InvokeAsync(internalValue);
}
StateHasChanged();
}
internal void UpdateSelectedItems(object item)
{
if (!string.IsNullOrEmpty(ValueProperty))
{
var value = GetItemOrValueFromProperty(item, ValueProperty);
if (!IsItemSelectedByValue(value))
{
selectedItems.Add(item);
}
else
{
selectedItems = selectedItems.AsQueryable().Where($@"!object.Equals(it.{ValueProperty},@0)", value).ToList();
}
}
else
{
if (!selectedItems.Any(i => object.Equals(i, item)))
{
selectedItems.Add(item);
}
else
{
selectedItems = selectedItems.Where(i => !object.Equals(i, item)).ToList();
}
}
}
/// <summary>
/// Selects the item from value.
/// </summary>
@@ -849,7 +1147,7 @@ namespace Radzen
{
if (typeof(EnumerableQuery).IsAssignableFrom(View.GetType()))
{
SelectedItem = View.OfType<object>().Where(i => object.Equals(PropertyAccess.GetValue(i, ValueProperty), value)).FirstOrDefault();
SelectedItem = View.OfType<object>().Where(i => object.Equals(GetItemOrValueFromProperty(i, ValueProperty), value)).FirstOrDefault();
}
else
{
@@ -858,7 +1156,7 @@ namespace Radzen
}
else
{
selectedItem = Value;
selectedItem = internalValue;
}
SetSelectedIndexFromSelectedItem();
@@ -867,25 +1165,25 @@ namespace Radzen
}
else
{
var values = value as dynamic;
var values = value as IEnumerable;
if (values != null)
{
if (!string.IsNullOrEmpty(ValueProperty))
{
foreach (object v in values)
foreach (object v in values.ToDynamicList())
{
dynamic item;
if (typeof(EnumerableQuery).IsAssignableFrom(View.GetType()))
{
item = View.OfType<object>().Where(i => object.Equals(PropertyAccess.GetValue(i, ValueProperty), v)).FirstOrDefault();
item = View.OfType<object>().Where(i => object.Equals(GetItemOrValueFromProperty(i, ValueProperty), v)).FirstOrDefault();
}
else
{
item = View.AsQueryable().Where($@"{ValueProperty} == @0", v).FirstOrDefault();
}
if (!object.Equals(item, null) && selectedItems.IndexOf(item) == -1)
if (!object.Equals(item, null) && !selectedItems.AsQueryable().Where($@"object.Equals(it.{ValueProperty},@0)", v).Any())
{
selectedItems.Add(item);
}
@@ -904,5 +1202,28 @@ namespace Radzen
selectedItem = null;
}
}
internal bool IsItemSelectedByValue(object v)
{
switch (internalValue)
{
case string s:
return object.Equals(s, v);
case IEnumerable enumerable:
return enumerable.Cast<object>().Contains(v);
case null:
return false;
default:
return object.Equals(internalValue, v);
}
}
/// <inheritdoc />
public override void Dispose()
{
base.Dispose();
keys.Clear();
}
}
}

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
namespace Radzen.Blazor
{
/// <summary>
/// Class EnumExtensions.
/// </summary>
public static class EnumExtensions
{
/// <summary>
/// Gets enum description.
/// </summary>
public static string GetDisplayDescription(this Enum enumValue)
{
var enumValueAsString = enumValue.ToString();
var val = enumValue.GetType().GetMember(enumValueAsString).FirstOrDefault();
return val?.GetCustomAttribute<DisplayAttribute>()?.GetDescription() ?? enumValueAsString;
}
/// <summary>
/// Converts Enum to IEnumerable of Value/Text.
/// </summary>
public static IEnumerable<object> EnumAsKeyValuePair(Type enumType)
{
return Enum.GetValues(enumType).Cast<Enum>().Distinct().Select(val => new { Value = Convert.ToInt32(val), Text = val.GetDisplayDescription() });
}
}
}

View File

@@ -72,11 +72,8 @@ namespace Radzen
}
set
{
if (_form != value && value != null)
{
_form = value;
_form.AddComponent(this);
}
_form = value;
_form?.AddComponent(this);
}
}
@@ -170,6 +167,7 @@ namespace Radzen
if (EditContext != null && ValueExpression != null && FieldIdentifier.Model != EditContext.Model)
{
FieldIdentifier = FieldIdentifier.Create(ValueExpression);
EditContext.OnValidationStateChanged -= ValidationStateChanged;
EditContext.OnValidationStateChanged += ValidationStateChanged;
}

View File

@@ -1,5 +1,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Radzen.Blazor.Rendering;
namespace Radzen.Blazor
{
@@ -40,6 +44,13 @@ namespace Radzen.Blazor
/// <returns>RenderFragment.</returns>
RenderFragment Render(ScaleBase categoryScale, ScaleBase valueScale);
/// <summary>
/// Renders the series overlays with the specified category and value scales.
/// </summary>
/// <param name="categoryScale">The category scale.</param>
/// <param name="valueScale">The value scale.</param>
/// <returns>RenderFragment.</returns>
RenderFragment RenderOverlays(ScaleBase categoryScale, ScaleBase valueScale);
/// <summary>
/// Renders the series tooltip.
/// </summary>
/// <param name="data">The data.</param>
@@ -87,6 +98,34 @@ namespace Radzen.Blazor
/// <param name="y">The y.</param>
object DataAt(double x, double y);
/// <summary>
/// Returns data chart position
/// </summary>
IEnumerable<ChartDataLabel> GetDataLabels(double offsetX, double offsetY);
/// <summary>
/// Returns series median
/// </summary>
double GetMedian();
/// <summary>
/// Returns series mean
/// </summary>
double GetMean();
/// <summary>
/// Returns series mode
/// </summary>
double GetMode();
/// <summary>
/// Returns series trend
/// </summary>
(double a, double b) GetTrend();
/// <summary>
/// Series coordinate system
/// </summary>
CoordinateSystem CoordinateSystem { get; }
/// <summary>
/// Series overlays
/// </summary>
IList<IChartSeriesOverlay> Overlays{ get; }
/// <summary>
/// Gets or sets the title of the series. The title is displayed in tooltips and the legend.
/// </summary>
/// <value>The title.</value>

View File

@@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Components;
namespace Radzen.Blazor
{
/// <summary>
/// Interface for chart overlays
/// </summary>
public interface IChartSeriesOverlay
{
/// <summary>
/// Render overlay
/// </summary>
/// <param name="categoryScale"></param>
/// <param name="valueScale"></param>
/// <returns>RenderFragment</returns>
RenderFragment Render(ScaleBase categoryScale, ScaleBase valueScale);
/// <summary>
/// Gets overlay visibility state
/// </summary>
bool Visible { get; }
/// <summary>
/// Hit test
/// </summary>
bool Contains(double mouseX, double mouseY, int tolerance);
/// <summary>
/// Renders tooltip
/// </summary>
RenderFragment RenderTooltip(double mouseX, double mouseY, double marginLeft, double marginTop);
}
}

View File

@@ -8,6 +8,10 @@ namespace Radzen.Blazor
/// </summary>
public interface ISchedulerView
{
/// <summary>
/// Gets the icon of the view. It is displayed in the view switching UI.
/// </summary>
string Icon { get; }
/// <summary>
/// Gets the title of the view. It is displayed in the RadzenScheduler title area.
/// </summary>

View File

@@ -0,0 +1,22 @@
namespace Radzen.Blazor
{
/// <summary>
/// Specifies the interpolation mode of lines between data points. Used by <see cref="RadzenAreaSeries{TItem}"/> and <see cref="RadzenLineSeries{TItem}"/>.
/// </summary>
public enum Interpolation
{
/// <summary>
/// Points are connected by a straight line.
/// </summary>
Line,
/// <summary>
/// Points are connected by a smooth curve.
/// </summary>
Spline,
/// <summary>
/// Points are connected by horizontal and vertical lines only.
/// </summary>
Step
}
}

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2018-2021 Radzen Ltd
Copyright (c) 2018-2023 Radzen Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -65,7 +65,13 @@ namespace Radzen.Blazor
if (start == end)
{
start = 0;
end = end + NiceNumber(end / ticks, false);
end += NiceNumber(end / ticks, false);
}
if (Round && end < 0)
{
end = 0;
start += NiceNumber(start / ticks, false);
}
var range = end - start;

View File

@@ -1,4 +1,6 @@
using System;
using Microsoft.AspNetCore.Components;
using Radzen.Blazor;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
@@ -35,7 +37,10 @@ namespace Radzen
Severity = message.Severity,
Summary = message.Summary,
Detail = message.Detail,
Style = message.Style
Style = message.Style,
Click = message.Click,
CloseOnClick = message.CloseOnClick,
Payload = message.Payload
};
if (!Messages.Contains(newMessage))
@@ -44,21 +49,27 @@ namespace Radzen
}
}
/// <summary>
/// Notifies the specified severity.
/// </summary>
/// <param name="severity">The severity.</param>
/// <param name="summary">The summary.</param>
/// <param name="detail">The detail.</param>
/// <param name="duration">The duration.</param>
public void Notify(NotificationSeverity severity = NotificationSeverity.Info, string summary = "", string detail = "", double duration = 3000)
/// <summary>
/// Notifies the specified severity.
/// </summary>
/// <param name="severity">The severity.</param>
/// <param name="summary">The summary.</param>
/// <param name="detail">The detail.</param>
/// <param name="duration">The duration.</param>
/// <param name="click">The click event.</param>
/// <param name="closeOnClick">If true, then the notification will be closed when clicked on.</param>
/// <param name="payload">Used to store a custom payload that can be retreived later in the click event handler.</param>
public void Notify(NotificationSeverity severity = NotificationSeverity.Info, string summary = "", string detail = "", double duration = 3000, Action<NotificationMessage> click = null, bool closeOnClick = false, object payload = null)
{
var newMessage = new NotificationMessage()
{
Duration = duration,
Severity = severity,
Summary = summary,
Detail = detail
Detail = detail,
Click = click,
CloseOnClick = closeOnClick,
Payload = payload
};
if (!Messages.Contains(newMessage))
@@ -98,5 +109,20 @@ namespace Radzen
/// </summary>
/// <value>The style.</value>
public string Style { get; set; }
}
/// <summary>
/// Gets or sets the click event.
/// </summary>
/// <value>This event handler is called when the notification is clicked on.</value>
public Action<NotificationMessage> Click { get; set; }
/// <summary>
/// Gets or sets click on close action.
/// </summary>
/// <value>If true, then the notification will be closed when clicked on.</value>
public bool CloseOnClick { get; set; }
/// <summary>
/// Gets or sets notification payload.
/// </summary>
/// <value>Used to store a custom payload that can be retreived later in the click event handler.</value>
public object Payload { get; set; }
}
}

View File

@@ -21,6 +21,20 @@ namespace Radzen
[Parameter]
public PagerPosition PagerPosition { get; set; } = PagerPosition.Bottom;
/// <summary>
/// Gets or sets a value indicating whether pager is visible even when not enough data for paging.
/// </summary>
/// <value><c>true</c> if pager is visible even when not enough data for paging otherwise, <c>false</c>.</value>
[Parameter]
public bool PagerAlwaysVisible { get; set; }
/// <summary>
/// Gets or sets the horizontal align.
/// </summary>
/// <value>The horizontal align.</value>
[Parameter]
public HorizontalAlign PagerHorizontalAlign { get; set; } = HorizontalAlign.Justify;
/// <summary>
/// Gets or sets a value indicating whether paging is allowed. Set to <c>false</c> by default.
/// </summary>
@@ -28,12 +42,23 @@ namespace Radzen
[Parameter]
public bool AllowPaging { get; set; }
int _PageSize = 10;
/// <summary>
/// Gets or sets the size of the page.
/// </summary>
/// <value>The size of the page.</value>
[Parameter]
public int PageSize { get; set; } = 10;
public int PageSize
{
get
{
return pageSize ?? _PageSize;
}
set
{
_PageSize = value;
}
}
/// <summary>
/// Gets or sets the page numbers count.
@@ -93,26 +118,30 @@ namespace Radzen
/// </summary>
/// <value>The page size options.</value>
[Parameter]
public IEnumerable<int> PageSizeOptions { get; set; }
public IEnumerable<int> PageSizeOptions { get; set; }
/// <summary>
/// Gets or sets the page size description text.
/// </summary>
/// <value>The page size description text.</value>
[Parameter]
public string PageSizeText { get; set; } = "items per page";
/// <summary>
/// Gets or sets the pager summary visibility.
/// </summary>
/// <value>The pager summary visibility.</value>
[Parameter]
public bool ShowPagingSummary { get; set; } = false;
public bool ShowPagingSummary { get; set; } = false;
/// <summary>
/// Gets or sets the pager summary format.
/// </summary>
/// <value>The pager summary format.</value>
[Parameter]
/// <value>The pager summary format.</value>
[Parameter]
public string PagingSummaryFormat { get; set; } = "Page {0} of {1} ({2} items)";
/// <summary>
/// The view
/// </summary>
protected IQueryable<T> _view = null;
internal IQueryable<T> _view = null;
/// <summary>
/// Gets the paged view.
/// </summary>
@@ -185,7 +214,8 @@ namespace Radzen
/// <returns>A Task representing the asynchronous operation.</returns>
public override async Task SetParametersAsync(ParameterView parameters)
{
bool pageSizeChanged = parameters.DidParameterChange(nameof(PageSize), PageSize);
bool pageSizeChanged = parameters.DidParameterChange(nameof(PageSize), PageSize) &&
PageSize != pageSize;
await base.SetParametersAsync(parameters);
@@ -222,16 +252,25 @@ namespace Radzen
/// </summary>
/// <param name="firstRender">if set to <c>true</c> [first render].</param>
/// <returns>Task.</returns>
protected override Task OnAfterRenderAsync(bool firstRender)
protected override async Task OnAfterRenderAsync(bool firstRender)
{
this.firstRender = firstRender;
if (firstRender && Visible && (LoadData.HasDelegate && Data == null))
if (firstRender)
{
InvokeAsync(Reload);
StateHasChanged();
await ReloadOnFirstRender();
}
return base.OnAfterRenderAsync(firstRender);
await base.OnAfterRenderAsync(firstRender);
}
internal virtual async Task ReloadOnFirstRender()
{
if (firstRender && Visible && (LoadData.HasDelegate && Data == null))
{
await InvokeAsync(Reload);
StateHasChanged();
}
}
/// <summary>
@@ -248,6 +287,13 @@ namespace Radzen
/// </summary>
protected RadzenPager bottomPager;
/// <summary>
/// Gets or sets the page callback.
/// </summary>
/// <value>The page callback.</value>
[Parameter]
public EventCallback<PagerEventArgs> Page { get; set; }
/// <summary>
/// Handles the <see cref="E:PageChanged" /> event.
/// </summary>
@@ -256,16 +302,21 @@ namespace Radzen
{
skip = args.Skip;
CurrentPage = args.PageIndex;
await Page.InvokeAsync(args);
await InvokeAsync(Reload);
}
internal int? pageSize;
/// <summary>
/// Called when [page size changed].
/// </summary>
/// <param name="value">The value.</param>
protected async Task OnPageSizeChanged(int value)
protected virtual async Task OnPageSizeChanged(int value)
{
PageSize = value;
pageSize = value;
await InvokeAsync(Reload);
}
@@ -291,16 +342,17 @@ namespace Radzen
/// Goes to page.
/// </summary>
/// <param name="page">The page.</param>
public async Task GoToPage(int page)
/// <param name="forceReload">if set to <c>true</c> [force reload].</param>
public async Task GoToPage(int page, bool forceReload = false)
{
if (topPager != null)
{
await topPager.GoToPage(page);
await topPager.GoToPage(page, forceReload);
}
if (bottomPager != null)
{
await bottomPager.GoToPage(page);
await bottomPager.GoToPage(page, forceReload);
}
}
@@ -310,14 +362,21 @@ namespace Radzen
/// <param name="forceReload">if set to <c>true</c> [force reload].</param>
public async Task FirstPage(bool forceReload = false)
{
var shouldReload = forceReload && CurrentPage == 0;
if (topPager != null)
{
await topPager.FirstPage(forceReload);
await topPager.FirstPage();
}
if (bottomPager != null)
{
await bottomPager.FirstPage(forceReload);
await bottomPager.FirstPage();
}
if (shouldReload)
{
await InvokeAsync(Reload);
}
}

View File

@@ -45,7 +45,9 @@ namespace Radzen
{FilterOperator.Contains, "Contains"},
{FilterOperator.DoesNotContain, "DoesNotContain"},
{FilterOperator.IsNull, "=="},
{FilterOperator.IsNotNull, "!="}
{FilterOperator.IsEmpty, "=="},
{FilterOperator.IsNotNull, "!="},
{FilterOperator.IsNotEmpty, "!="}
};
/// <summary>
@@ -64,7 +66,9 @@ namespace Radzen
{FilterOperator.Contains, "contains"},
{FilterOperator.DoesNotContain, "DoesNotContain"},
{FilterOperator.IsNull, "eq"},
{FilterOperator.IsNotNull, "ne"}
{FilterOperator.IsEmpty, "eq"},
{FilterOperator.IsNotNull, "ne"},
{FilterOperator.IsNotEmpty, "ne"}
};
/// <summary>
@@ -140,8 +144,10 @@ namespace Radzen
public static string ToFilterString<T>(this IEnumerable<RadzenDataGridColumn<T>> columns)
{
Func<RadzenDataGridColumn<T>, bool> canFilter = (c) => c.Filterable && c.FilterPropertyType != null &&
(!(c.GetFilterValue() == null || c.GetFilterValue() as string == string.Empty) || c.GetFilterOperator() == FilterOperator.IsNotNull || c.GetFilterOperator() == FilterOperator.IsNull)
&& c.GetFilterProperty() != null;
(!(c.GetFilterValue() == null || c.GetFilterValue() as string == string.Empty) || c.GetFilterOperator() == FilterOperator.IsNotNull
|| c.GetFilterOperator() == FilterOperator.IsNull || c.GetFilterOperator() == FilterOperator.IsEmpty
|| c.GetFilterOperator() == FilterOperator.IsNotEmpty)
&& c.GetFilterProperty() != null;
if (columns.Where(canFilter).Any())
{
@@ -168,7 +174,18 @@ namespace Radzen
secondValue = sv is DateTime ? ((DateTime)sv).ToString("yyyy-MM-ddTHH:mm:ss.fffZ") : sv is DateTimeOffset ? ((DateTimeOffset)sv).UtcDateTime.ToString("yyyy-MM-ddTHH:mm:ss.fffZ") : "";
}
}
else if (typeof(IEnumerable).IsAssignableFrom(column.FilterPropertyType) && column.FilterPropertyType != typeof(string))
else if (PropertyAccess.IsEnum(column.FilterPropertyType) || PropertyAccess.IsNullableEnum(column.FilterPropertyType))
{
if (v != null)
{
value = ((int)v).ToString();
}
if (sv != null)
{
secondValue = ((int)sv).ToString();
}
}
else if (IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string))
{
var enumerableValue = ((IEnumerable)(v != null ? v : Enumerable.Empty<object>())).AsQueryable();
var enumerableSecondValue = ((IEnumerable)(sv != null ? sv : Enumerable.Empty<object>())).AsQueryable();
@@ -221,7 +238,10 @@ namespace Radzen
secondValue = (string)Convert.ChangeType(column.GetSecondFilterValue(), typeof(string));
}
if (!string.IsNullOrEmpty(value) || column.GetFilterOperator() == FilterOperator.IsNotNull || column.GetFilterOperator() == FilterOperator.IsNull)
if (!string.IsNullOrEmpty(value) || column.GetFilterOperator() == FilterOperator.IsNotNull
|| column.GetFilterOperator() == FilterOperator.IsNull
|| column.GetFilterOperator() == FilterOperator.IsEmpty
|| column.GetFilterOperator() == FilterOperator.IsNotEmpty)
{
var linqOperator = LinqFilterOperators[column.GetFilterOperator()];
if (linqOperator == null)
@@ -395,26 +415,49 @@ namespace Radzen
}
else if (columnFilterOperator == FilterOperator.IsNull)
{
return $@"({property} == null ? """" : {property}) == null";
return $@"np({property}) == null";
}
else if (columnFilterOperator == FilterOperator.IsEmpty)
{
return $@"np({property}) == """"";
}
else if (columnFilterOperator == FilterOperator.IsNotEmpty)
{
return $@"np({property}) != """"";
}
else if (columnFilterOperator == FilterOperator.IsNotNull)
{
return $@"({property} == null ? """" : {property}) != null";
return $@"np({property}) != null";
}
}
else if (PropertyAccess.IsNumeric(column.FilterPropertyType))
{
return $"{property} {linqOperator} {value}";
if (columnFilterOperator == FilterOperator.IsNull || columnFilterOperator == FilterOperator.IsNotNull)
{
return $"{property} {linqOperator} null";
}
else if (columnFilterOperator == FilterOperator.IsEmpty || columnFilterOperator == FilterOperator.IsNotEmpty)
{
return $@"{property} {linqOperator} """"";
}
else
{
return $"{property} {linqOperator} {value}";
}
}
else if (column.FilterPropertyType == typeof(DateTime) ||
column.FilterPropertyType == typeof(DateTime?) ||
column.FilterPropertyType == typeof(DateTimeOffset) ||
column.FilterPropertyType == typeof(DateTimeOffset?))
{
if (column.GetFilterOperator() == FilterOperator.IsNull || column.GetFilterOperator() == FilterOperator.IsNotNull)
if (columnFilterOperator == FilterOperator.IsNull || columnFilterOperator == FilterOperator.IsNotNull)
{
return $"{property} {linqOperator} null";
}
else if (columnFilterOperator == FilterOperator.IsEmpty || columnFilterOperator == FilterOperator.IsNotEmpty)
{
return $@"{property} {linqOperator} """"";
}
else
{
var dateTimeValue = DateTime.Parse(value, null, System.Globalization.DateTimeStyles.RoundtripKind);
@@ -431,10 +474,14 @@ namespace Radzen
}
else if (column.FilterPropertyType == typeof(Guid) || column.FilterPropertyType == typeof(Guid?))
{
if (column.GetFilterOperator() == FilterOperator.IsNull || column.GetFilterOperator() == FilterOperator.IsNotNull)
if (columnFilterOperator == FilterOperator.IsNull || columnFilterOperator == FilterOperator.IsNotNull)
{
return $"{property} {linqOperator} null";
}
else if (columnFilterOperator == FilterOperator.IsEmpty || columnFilterOperator == FilterOperator.IsNotEmpty)
{
return $@"{property} {linqOperator} """"";
}
else
{
return $@"{property} {linqOperator} Guid(""{value}"")";
@@ -545,7 +592,7 @@ namespace Radzen
var columnFilterOperator = !second ? column.GetFilterOperator() : column.GetSecondFilterOperator();
var odataFilterOperator = ODataFilterOperators[columnFilterOperator];
var value = typeof(IEnumerable).IsAssignableFrom(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) ? null :
var value = IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) ? null :
!second ? (string)Convert.ChangeType(column.GetFilterValue(), typeof(string)) :
(string)Convert.ChangeType(column.GetSecondFilterValue(), typeof(string));
@@ -596,8 +643,12 @@ namespace Radzen
{
return $"{property} {odataFilterOperator} null";
}
else if (columnFilterOperator == FilterOperator.IsEmpty || columnFilterOperator == FilterOperator.IsNotEmpty)
{
return $"{property} {odataFilterOperator} ''";
}
}
else if (typeof(IEnumerable).IsAssignableFrom(column.FilterPropertyType) && column.FilterPropertyType != typeof(string))
else if (IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string))
{
var v = !second ? column.GetFilterValue() : column.GetSecondFilterValue();
@@ -625,6 +676,10 @@ namespace Radzen
{
return $"{property} {odataFilterOperator} null";
}
else if (columnFilterOperator == FilterOperator.IsEmpty || columnFilterOperator == FilterOperator.IsNotEmpty)
{
return $"{property} {odataFilterOperator} ''";
}
else
{
return $"{property} eq {value.ToLower()}";
@@ -639,6 +694,10 @@ namespace Radzen
{
return $"{property} {odataFilterOperator} null";
}
else if (columnFilterOperator == FilterOperator.IsEmpty || columnFilterOperator == FilterOperator.IsNotEmpty)
{
return $"{property} {odataFilterOperator} ''";
}
else
{
return $"{property} {odataFilterOperator} {DateTime.Parse(value, null, System.Globalization.DateTimeStyles.RoundtripKind).ToString("yyyy-MM-ddTHH:mm:ss.fffZ")}";
@@ -715,8 +774,10 @@ namespace Radzen
public static string ToODataFilterString<T>(this IEnumerable<RadzenDataGridColumn<T>> columns)
{
Func<RadzenDataGridColumn<T>, bool> canFilter = (c) => c.Filterable && c.FilterPropertyType != null &&
(!(c.GetFilterValue() == null || c.GetFilterValue() as string == string.Empty) || c.GetFilterOperator() == FilterOperator.IsNotNull || c.GetFilterOperator() == FilterOperator.IsNull)
&& c.GetFilterProperty() != null;
(!(c.GetFilterValue() == null || c.GetFilterValue() as string == string.Empty)
|| c.GetFilterOperator() == FilterOperator.IsNotNull || c.GetFilterOperator() == FilterOperator.IsNull
|| c.GetFilterOperator() == FilterOperator.IsEmpty || c.GetFilterOperator() == FilterOperator.IsNotEmpty)
&& c.GetFilterProperty() != null;
if (columns.Where(canFilter).Any())
{
@@ -731,7 +792,8 @@ namespace Radzen
var value = column.GetFilterValue();
var secondValue = column.GetSecondFilterValue();
if (value != null || column.GetFilterOperator() == FilterOperator.IsNotNull || column.GetFilterOperator() == FilterOperator.IsNull)
if (value != null || column.GetFilterOperator() == FilterOperator.IsNotNull || column.GetFilterOperator() == FilterOperator.IsNull
|| column.GetFilterOperator() == FilterOperator.IsEmpty || column.GetFilterOperator() == FilterOperator.IsNotEmpty)
{
var linqOperator = ODataFilterOperators[column.GetFilterOperator()];
if (linqOperator == null)
@@ -841,6 +903,11 @@ namespace Radzen
return source;
}
private static bool IsEnumerable(Type type)
{
return typeof(IEnumerable).IsAssignableFrom(type) || typeof(IEnumerable<>).IsAssignableFrom(type);
}
/// <summary>
/// Wheres the specified columns.
/// </summary>
@@ -851,8 +918,10 @@ namespace Radzen
public static IQueryable<T> Where<T>(this IQueryable<T> source, IEnumerable<RadzenDataGridColumn<T>> columns)
{
Func<RadzenDataGridColumn<T>, bool> canFilter = (c) => c.Filterable && c.FilterPropertyType != null &&
(!(c.GetFilterValue() == null || c.GetFilterValue() as string == string.Empty) || c.GetFilterOperator() == FilterOperator.IsNotNull || c.GetFilterOperator() == FilterOperator.IsNull)
&& c.GetFilterProperty() != null;
(!(c.GetFilterValue() == null || c.GetFilterValue() as string == string.Empty)
|| c.GetFilterOperator() == FilterOperator.IsNotNull || c.GetFilterOperator() == FilterOperator.IsNull
|| c.GetFilterOperator() == FilterOperator.IsEmpty || c.GetFilterOperator() == FilterOperator.IsNotEmpty)
&& c.GetFilterProperty() != null;
if (columns.Where(canFilter).Any())
{
@@ -870,14 +939,18 @@ namespace Radzen
property = $"({property})";
}
if (column.FilterPropertyType == typeof(string))
if (column.FilterPropertyType == typeof(string) &&
!(column.GetFilterOperator() == FilterOperator.IsNotNull || column.GetFilterOperator() == FilterOperator.IsNull
|| column.GetFilterOperator() == FilterOperator.IsEmpty || column.GetFilterOperator() == FilterOperator.IsNotEmpty))
{
property = $@"({property} == null ? """" : {property})";
}
string filterCaseSensitivityOperator = column.FilterPropertyType == typeof(string)
&& column.GetFilterOperator() != FilterOperator.IsNotNull && column.GetFilterOperator() != FilterOperator.IsNull &&
column.Grid.FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive ? ".ToLower()" : "";
&& column.GetFilterOperator() != FilterOperator.IsNotNull && column.GetFilterOperator() != FilterOperator.IsNull
&& column.GetFilterOperator() != FilterOperator.IsEmpty && column.GetFilterOperator() != FilterOperator.IsNotEmpty
&& column.Grid.FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive ? ".ToLower()" : "";
var comparison = LinqFilterOperators[column.GetFilterOperator()];
@@ -887,7 +960,7 @@ namespace Radzen
{
if (comparison == "StartsWith" || comparison == "EndsWith" || comparison == "Contains")
{
if (typeof(IEnumerable).IsAssignableFrom(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) && comparison == "Contains")
if (IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) && comparison == "Contains")
{
whereList.Add($@"(@{index}).Contains({property})", new object[] { column.GetFilterValue() });
}
@@ -900,7 +973,7 @@ namespace Radzen
}
else if (comparison == "DoesNotContain")
{
if (typeof(IEnumerable).IsAssignableFrom(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) && comparison == "DoesNotContain")
if (IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) && comparison == "DoesNotContain")
{
whereList.Add($@"!(@{index}).Contains({property})", new object[] { column.GetFilterValue() });
}
@@ -911,7 +984,7 @@ namespace Radzen
index++;
}
else
else if (!(IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string)))
{
whereList.Add($@"{property}{filterCaseSensitivityOperator} {comparison} @{index}{filterCaseSensitivityOperator}", new object[] { column.GetFilterValue() });
index++;
@@ -921,7 +994,7 @@ namespace Radzen
{
var secondComparison = LinqFilterOperators[column.GetSecondFilterOperator()];
if (typeof(IEnumerable).IsAssignableFrom(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) &&
if (IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) &&
(comparison == "Contains" || comparison == "DoesNotContain") &&
(secondComparison == "Contains" || secondComparison == "DoesNotContain"))
{
@@ -952,12 +1025,277 @@ namespace Radzen
}
}
return source.Where(string.Join($" {gridBooleanOperator} ", whereList.Keys), whereList.Values.SelectMany(i => i.ToArray()).ToArray());
return whereList.Keys.Any() ?
source.Where(string.Join($" {gridBooleanOperator} ", whereList.Keys), whereList.Values.SelectMany(i => i.ToArray()).ToArray())
: source;
}
return source;
}
/// <summary>
/// Wheres the specified filters.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source">The source.</param>
/// <param name="dataFilter">The DataFilter.</param>
/// <returns>IQueryable&lt;T&gt;.</returns>
public static IQueryable<T> Where<T>(this IQueryable<T> source, RadzenDataFilter<T> dataFilter)
{
Func<CompositeFilterDescriptor, bool> canFilter = (c) => dataFilter.properties.Where(col => col.Property == c.Property).FirstOrDefault()?.FilterPropertyType != null &&
(!(c.FilterValue == null || c.FilterValue as string == string.Empty)
|| c.FilterOperator == FilterOperator.IsNotNull || c.FilterOperator == FilterOperator.IsNull
|| c.FilterOperator == FilterOperator.IsEmpty || c.FilterOperator == FilterOperator.IsNotEmpty)
&& c.Property != null;
if (dataFilter.Filters.Where(canFilter).Any())
{
var index = 0;
var filterExpressions = new List<string>();
var filterValues = new List<object[]>();
foreach (var filter in dataFilter.Filters)
{
AddWhereExpression(canFilter, filter, ref filterExpressions, ref filterValues, ref index, dataFilter);
}
return filterExpressions.Any() ?
source.Where(string.Join($" {dataFilter.LogicalFilterOperator.ToString().ToLower()} ", filterExpressions), filterValues.SelectMany(i => i.ToArray()).ToArray())
: source;
}
return source;
}
private static void AddWhereExpression<T>(Func<CompositeFilterDescriptor, bool> canFilter, CompositeFilterDescriptor filter, ref List<string> filterExpressions, ref List<object[]> filterValues, ref int index, RadzenDataFilter<T> dataFilter)
{
if (filter.Filters != null)
{
var innerFilterExpressions = new List<string>();
foreach (var f in filter.Filters)
{
AddWhereExpression(canFilter, f, ref innerFilterExpressions, ref filterValues, ref index, dataFilter);
}
if (innerFilterExpressions.Any())
{
filterExpressions.Add("(" + string.Join($" {filter.LogicalFilterOperator.ToString().ToLower()} ", innerFilterExpressions) + ")");
}
}
else
{
if (filter.Property == null || (filter.FilterValue == null &&
filter.FilterOperator != FilterOperator.IsNull && filter.FilterOperator != FilterOperator.IsNotNull))
{
return;
}
var property = PropertyAccess.GetProperty(filter.Property);
if (property.IndexOf(".") != -1)
{
property = $"({property})";
}
var column = dataFilter.properties.Where(c => c.Property == filter.Property).FirstOrDefault();
if (column == null) return;
if (column.FilterPropertyType == typeof(string) &&
!(filter.FilterOperator == FilterOperator.IsNotNull || filter.FilterOperator == FilterOperator.IsNull
|| filter.FilterOperator == FilterOperator.IsEmpty || filter.FilterOperator == FilterOperator.IsNotEmpty))
{
property = $@"({property} == null ? """" : {property})";
}
string filterCaseSensitivityOperator = column.FilterPropertyType == typeof(string)
&& filter.FilterOperator != FilterOperator.IsNotNull && filter.FilterOperator != FilterOperator.IsNull
&& filter.FilterOperator != FilterOperator.IsEmpty && filter.FilterOperator != FilterOperator.IsNotEmpty
&& dataFilter.FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive ? ".ToLower()" : "";
var comparison = LinqFilterOperators[filter.FilterOperator];
if (comparison == "StartsWith" || comparison == "EndsWith" || comparison == "Contains")
{
if (column.FilterPropertyType == typeof(string) && filter.FilterValue == null)
{
filter.FilterValue = "";
}
if (IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) && comparison == "Contains")
{
filterExpressions.Add($@"(@{index}).Contains({property})");
filterValues.Add(new object[] { filter.FilterValue });
}
else
{
filterExpressions.Add($@"{property}{filterCaseSensitivityOperator}.{comparison}(@{index}{filterCaseSensitivityOperator})");
filterValues.Add(new object[] { filter.FilterValue });
}
index++;
}
else if (comparison == "DoesNotContain")
{
if (column.FilterPropertyType == typeof(string) && filter.FilterValue == null)
{
filter.FilterValue = "";
}
if (IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) && comparison == "DoesNotContain")
{
filterExpressions.Add($@"!(@{index}).Contains({property})");
filterValues.Add(new object[] { filter.FilterValue });
}
else
{
filterExpressions.Add($@"!{property}{filterCaseSensitivityOperator}.Contains(@{index}{filterCaseSensitivityOperator})");
filterValues.Add(new object[] { filter.FilterValue });
}
index++;
}
else if (!(IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string)))
{
filterExpressions.Add($@"{property}{filterCaseSensitivityOperator} {comparison} @{index}{filterCaseSensitivityOperator}");
filterValues.Add(new object[] { filter.FilterValue });
index++;
}
}
}
/// <summary>
/// Converts to OData filter expression.
/// </summary>
/// <param name="dataFilter">The DataFilter.</param>
/// <returns>System.String.</returns>
public static string ToODataFilterString<T>(this RadzenDataFilter<T> dataFilter)
{
Func<CompositeFilterDescriptor, bool> canFilter = (c) => dataFilter.properties.Where(col => col.Property == c.Property).FirstOrDefault()?.FilterPropertyType != null &&
(!(c.FilterValue == null || c.FilterValue as string == string.Empty)
|| c.FilterOperator == FilterOperator.IsNotNull || c.FilterOperator == FilterOperator.IsNull
|| c.FilterOperator == FilterOperator.IsEmpty || c.FilterOperator == FilterOperator.IsNotEmpty)
&& c.Property != null;
if (dataFilter.Filters.Where(canFilter).Any())
{
var filterExpressions = new List<string>();
foreach (var filter in dataFilter.Filters)
{
AddODataExpression(canFilter, filter, ref filterExpressions, dataFilter);
}
return filterExpressions.Any() ?
string.Join($" {dataFilter.LogicalFilterOperator.ToString().ToLower()} ", filterExpressions)
: "";
}
return "";
}
private static void AddODataExpression<T>(Func<CompositeFilterDescriptor, bool> canFilter, CompositeFilterDescriptor filter, ref List<string> filterExpressions, RadzenDataFilter<T> dataFilter)
{
if (filter.Filters != null)
{
var innerFilterExpressions = new List<string>();
foreach (var f in filter.Filters)
{
AddODataExpression(canFilter, f, ref innerFilterExpressions, dataFilter);
}
if (innerFilterExpressions.Any())
{
filterExpressions.Add("(" + string.Join($" {filter.LogicalFilterOperator.ToString().ToLower()} ", innerFilterExpressions) + ")");
}
}
else
{
if (filter.Property == null || (filter.FilterValue == null &&
filter.FilterOperator != FilterOperator.IsNull && filter.FilterOperator != FilterOperator.IsNotNull))
{
return;
}
var property = filter.Property.Replace('.', '/');
var column = dataFilter.properties.Where(c => c.Property == filter.Property).FirstOrDefault();
if (column == null) return;
if (dataFilter.FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive && column.FilterPropertyType == typeof(string))
{
property = $"tolower({property})";
}
if (filter.FilterOperator == FilterOperator.StartsWith || filter.FilterOperator == FilterOperator.EndsWith
|| filter.FilterOperator == FilterOperator.Contains || filter.FilterOperator == FilterOperator.DoesNotContain)
{
if (IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string) &&
(filter.FilterOperator == FilterOperator.Contains || filter.FilterOperator == FilterOperator.DoesNotContain))
{
var enumerableValue = ((IEnumerable)(filter.FilterValue != null ? filter.FilterValue : Enumerable.Empty<object>())).AsQueryable();
var enumerableValueAsString = "(" + String.Join(",",
(enumerableValue.ElementType == typeof(string) ? enumerableValue.Cast<string>().Select(i => $@"'{i}'").Cast<object>() : enumerableValue.Cast<object>())) + ")";
if (enumerableValue.Any() && filter.FilterOperator == FilterOperator.Contains)
{
filterExpressions.Add($"{property} in {enumerableValueAsString}");
}
else if (enumerableValue.Any() && filter.FilterOperator == FilterOperator.DoesNotContain)
{
filterExpressions.Add($"not({property} in {enumerableValueAsString})");
}
}
else
{
var expression = dataFilter.FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive ?
$"{ODataFilterOperators[filter.FilterOperator]}({property}, tolower('{filter.FilterValue}'))" :
$"{ODataFilterOperators[filter.FilterOperator]}({property}, '{filter.FilterValue}')";
if (filter.FilterOperator == FilterOperator.DoesNotContain)
{
expression = $"not({expression})";
}
filterExpressions.Add(expression);
}
}
else
{
if (IsEnumerable(column.FilterPropertyType) && column.FilterPropertyType != typeof(string))
return;
var value = $"{filter.FilterValue}";
if (filter.FilterOperator == FilterOperator.IsNull || filter.FilterOperator == FilterOperator.IsNotNull)
{
value = $"null";
}
else if (filter.FilterOperator == FilterOperator.IsEmpty || filter.FilterOperator == FilterOperator.IsNotEmpty)
{
value = $"''";
}
else if (column.FilterPropertyType == typeof(string))
{
value = $"'{value}'";
}
else if (column.FilterPropertyType == typeof(DateTime) || column.FilterPropertyType == typeof(DateTime?))
{
value = $"{DateTime.Parse(value, null, System.Globalization.DateTimeStyles.RoundtripKind).ToString("yyyy-MM-ddTHH:mm:ss.fffZ")}";
}
else if (column.FilterPropertyType == typeof(bool) || column.FilterPropertyType == typeof(bool?))
{
value = $"{value?.ToLower()}";
}
filterExpressions.Add($@"{property} {ODataFilterOperators[filter.FilterOperator]} {value}");
}
}
}
/// <summary>
/// Ases the o data enumerable.
/// </summary>

105
Radzen.Blazor/README.md Normal file
View File

@@ -0,0 +1,105 @@
## Radzen Blazor is a set of 70+ free native Blazor UI controls packed with DataGrid, Scheduler, Charts and robust theming including Material design and Fluent UI.
![Radzen Blazor Components](https://raw.githubusercontent.com/radzenhq/radzen-blazor/master/RadzenBlazorDemos/wwwroot/images/radzen-blazor-components.png)
## Why choose Radzen Blazor Components?
### :sparkles: Free
Radzen Blazor Components are open source and free for commercial use. You can install them from [nuget](https://www.nuget.org/packages/Radzen.Blazor) or build your own copy from source.
Paid support is available as part of the [Radzen Professional subscription](https://www.radzen.com/blazor-studio/pricing/).
### :computer: Native
The components are implemented in C# and take full advantage of the Blazor framework. They do not depend on or wrap existing JavaScript frameworks or libraries.
Blazor Server and Blazor WebAssembly are fully supported.
### :seedling: Growing
We add new components and features on a regular basis.
Short development cycle. We release as soon as new stuff is available. No more quarterly releases.
## Support exceeding your expectations
### :speech_balloon: Community Support
Everybody is welcome to visit the [Radzen Community forum](https://forum.radzen.com/). Join the growing community and participate in the discussions!
### :dart: Dedicated Support
The Radzen team monitors the forum threads, but does not guarantee a response to every question. For guaranteed responses you may consider the dedicated support option.
Dedicated support for the Radzen Blazor Components is available as part of the [Radzen Professional subscription](https://www.radzen.com/blazor-studio/pricing/).
Our flagship product [Radzen Blazor Studio](https://www.radzen.com/blazor-studio/) provides tons of productivity features for Blazor developers:
- An industry-leading WYSIWYG Blazor design time canvas
- Scaffolding a complete CRUD applications from a database
- Built-in security - authentication and authorization
- Visual Studio Code and Professional support
- Deployment to IIS and Azure
- Dedicated support with 24 hour guaranteed response time
## Get started with Radzen Blazor Components
### 1. Install
Radzen Blazor Components are distributed as a [Radzen.Blazor nuget package](https://www.nuget.org/packages/Radzen.Blazor). You can add them to your project in one of the following ways
- Install the package from command line by running `dotnet add package Radzen.Blazor`
- Add the project from the Visual Nuget Package Manager
- Manually edit the .csproj file and add a project reference
### 2. Import the namespace
Open the `_Imports.razor` file of your Blazor application and add this line `@using Radzen.Blazor`.
### 3. Include a theme
Radzen Blazor components come with five free themes: Material, Standard, Default, Dark, Software and Humanistic.
To use a theme
1. Pick a theme. The [online demos](https://blazor.radzen.com/colors) allow you to preview the available options via the theme dropdown located in the header. The Material theme is currently selected by default.
1. Include the theme CSS file in your Blazor application. Open `Pages\_Layout.cshtml` (Blazor Server .NET 6), `Pages\_Host.cshtml` (Blazor Server .NET 7) or `wwwroot/index.html` (Blazor WebAssembly) and include a theme CSS file by adding this snippet
```html
<link rel="stylesheet" href="_content/Radzen.Blazor/css/material-base.css">
```
To include a different theme (i.e. Standard) just change the name of the CSS file:
```
<link rel="stylesheet" href="_content/Radzen.Blazor/css/standard-base.css">
```
### 4. Include Radzen.Blazor.js
Open `Pages\_Layout.cshtml` (Blazor Server .NET 6), `Pages\_Host.cshtml` (Blazor Server .NET 7) or `wwwroot/index.html` (Blazor WebAssembly) and include this snippet:
```html
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
```
### 5. Use a component
Use any Radzen Blazor component by typing its tag name in a Blazor page e.g.
```html
<RadzenButton Text="Hi"></RadzenButton>
```
#### Data-binding a property
```razor
<RadzenButton Text=@text />
<RadzenTextBox @bind-Value=@text />
@code {
string text = "Hi";
}
```
#### Handing events
```razor
<RadzenButton Click="@ButtonClicked" Text="Hi"></RadzenButton>
@code {
void ButtonClicked()
{
}
}
```

View File

@@ -1,18 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<NoWarn>BL9993</NoWarn>
<TargetFrameworks>netstandard2.1;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<RazorLangVersion>3.0</RazorLangVersion>
<LangVersion>7.3</LangVersion>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<PackageId>Radzen.Blazor</PackageId>
<Product>Radzen.Blazor</Product>
<Version>3.13.3</Version>
<Version>4.7.0</Version>
<Copyright>Radzen Ltd.</Copyright>
<Authors>Radzen Ltd.</Authors>
<Description>Native Blazor UI components by Radzen Ltd.</Description>
<PackageTags>blazor blazor-component blazor-grid blazor-datagrid</PackageTags>
<Description>Radzen Blazor is a set of 70+ free native Blazor UI controls packed with DataGrid, Scheduler, Charts and robust theming including Material design and Fluent UI.</Description>
<PackageTags>blazor material design fluent fluentui components datagrid scheduler charts</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://www.radzen.com</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
@@ -20,59 +21,55 @@
<RepositoryUrl>https://github.com/radzenhq/radzen-blazor</RepositoryUrl>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net5.0'">
<DefineConstants>NET5</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LibSassBuilder" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components" Condition="'$(TargetFramework)' == 'netstandard2.1'" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Condition="'$(TargetFramework)' == 'netstandard2.1'" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components" Condition="'$(TargetFramework)' == 'net5.0'" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Condition="'$(TargetFramework)' == 'net5.0'" Version="5.0.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.12" />
<PackageReference Include="Microsoft.AspNetCore.Components" Condition="'$(TargetFramework)' == 'net6.0'" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Condition="'$(TargetFramework)' == 'net6.0'" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components" Condition="'$(TargetFramework)' == 'net7.0'" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Condition="'$(TargetFramework)' == 'net7.0'" Version="7.0.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.22" />
</ItemGroup>
<ItemGroup>
<None Include="LICENSE.txt" Pack="true" PackagePath="" />
<None Include="icon.png" Pack="true" PackagePath="" />
<None Include="LICENSE.txt" Pack="true" PackagePath="" />
<None Include="icon.png" Pack="true" PackagePath="" />
<None Include="README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LinkerConfig.xml">
<LogicalName>$(MSBuildProjectName).xml</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="LinkerConfig.xml">
<LogicalName>$(MSBuildProjectName).xml</LogicalName>
</EmbeddedResource>
</ItemGroup>
<UsingTask TaskName="RemoveSourceMap" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<Task>
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Text" />
<Code Type="Fragment" Language="cs">
<![CDATA[
foreach (var file in Directory.EnumerateFiles("./wwwroot/css", "*.css"))
{
File.WriteAllText(file, File.ReadAllText(file).Replace("/*# sourceMappingURL=themes" + Path.DirectorySeparatorChar + Path.GetFileName(file) + ".map */", ""), Encoding.UTF8);
}
]]>
</Code>
</Task>
</UsingTask>
<Target Name="ToolRestore" BeforeTargets="PreBuildEvent">
<Exec Command="dotnet tool restore" StandardOutputImportance="high" />
<PropertyGroup>
<LibSassOutputStyle>expanded</LibSassOutputStyle>
<EnableDefaultSassItems>false</EnableDefaultSassItems>
</PropertyGroup>
<ItemGroup>
<Sass Include="$(MSBuildProjectDirectory)/themes/*.scss" Exclude="$(MSBuildProjectDirectory)/themes/_*.scss" Condition="'$(TargetFramework)' == 'net6.0'" />
</ItemGroup>
<Target Name="Sass" BeforeTargets="BeforeBuild" Condition="'$(TargetFramework)' == 'net6.0'">
<PropertyGroup>
<_SassFileList>@(Sass->'&quot;%(FullPath)&quot;', ' ')</_SassFileList>
<LibSassBuilderArgs>files $(_SassFileList) --outputstyle $(LibSassOutputStyle) --level $(LibSassOutputLevel)</LibSassBuilderArgs>
</PropertyGroup>
<Message Text="$(LibSassBuilderArgs)" Importance="$(LibSassMessageLevel)" />
<Message Text="Converted SassFile list to argument" Importance="$(LibSassMessageLevel)" />
</Target>
<Target Name="PreBuild" AfterTargets="ToolRestore">
<Exec Command="dotnet webcompiler -r themes -o wwwroot/css -z disable -m disable -p disable" StandardOutputImportance="high" />
<Target Name="MoveCss" AfterTargets="AfterCompile" Condition="'$(TargetFramework)' == 'net6.0'" >
<ItemGroup>
<CssFiles Include="$(MSBuildProjectDirectory)\themes\*.css" />
<CssFile Include="$(MSBuildProjectDirectory)/themes/*.css" />
</ItemGroup>
<ItemGroup>
<BootstrapFiles Include="$(MSBuildProjectDirectory)\wwwroot\css\bootstrap\**\*.*" />
</ItemGroup>
<Delete Files="@(CssFiles)" />
<Delete Files="@(BootstrapFiles)" />
<RemoveDir Directories="$(MSBuildProjectDirectory)\wwwroot\css\bootstrap" />
<RemoveSourceMap />
<Move SourceFiles="@(CssFile)" DestinationFolder="$(MSBuildProjectDirectory)/wwwroot/css/" />
</Target>
</Project>

View File

@@ -10,14 +10,14 @@
}
@if (Visible)
{
<div @ref="@Element" role="tablist" @attributes="Attributes" class="@GetCssClass()" id="@GetId()">
<div @ref="@Element" role="tablist" style=@Style @attributes="Attributes" class="@GetCssClass()" id="@GetId()">
@for (var i = 0; i < items.Count; i++)
{
var item = items[i];
if (!item.Visible)
continue;
<div class="rz-accordion-header" @attributes="item.Attributes" style="@item.Style">
<div @ref="@item.Element" id="@item.GetItemId()" @attributes="item.Attributes" class="@item.GetItemCssClass()" style="@item.Style">
<a @onclick="@((args) => SelectItem(item))" href="javascript:void(0)" role="tab" tabindex="0"
id="@($"rz-accordiontab-{items.IndexOf(item)}")" aria-controls="@($"rz-accordiontab-{items.IndexOf(item)}-content")" aria-expanded="true">
@if (IsSelected(i, item))
@@ -34,7 +34,7 @@
}
@if (!string.IsNullOrEmpty(item.Text))
{
<span>@item.Text</span>
<span>@((MarkupString)item.Text)</span>
}
</a>
</div>

View File

@@ -102,7 +102,10 @@ namespace Radzen.Blazor
if (items.Contains(item))
{
items.Remove(item);
try { InvokeAsync(StateHasChanged); } catch { }
if (!disposed)
{
try { InvokeAsync(StateHasChanged); } catch { }
}
}
}

View File

@@ -54,7 +54,10 @@ namespace Radzen.Blazor
if (_visible != value)
{
_visible = value;
Accordion.Refresh();
if (Accordion != null)
{
Accordion.Refresh();
}
}
}
}
@@ -106,5 +109,21 @@ namespace Radzen.Blazor
Accordion?.RemoveItem(this);
}
internal string GetItemId()
{
return GetId();
}
internal string GetItemCssClass()
{
return GetCssClass();
}
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return "rz-accordion-header";
}
}
}

View File

@@ -0,0 +1,89 @@
@inherits RadzenComponentWithChildren
@if (GetVisible())
{
<div @ref="@Element" style="@Style" @attributes="Attributes" class="@GetCssClass()" id="@GetId()" aria-live="polite">
<div class="rz-alert-item">
@if (ShowIcon)
{
<RadzenIcon Icon="@getIcon()" Class="rz-alert-icon" />
}
<div class="rz-alert-message">
@if (!string.IsNullOrEmpty(Title))
{
<div class="rz-alert-title">@Title</div>
}
<div class="rz-alert-content">
@if(ChildContent != null)
{
@ChildContent
}
else
{
@Text
}
</div>
</div>
</div>
@if (AllowClose)
{
if (Shade == Shade.Lighter)
{
if (AlertStyle == AlertStyle.Primary)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Primary" Shade="Shade.Dark" Size="@getCloseButtonSize()" />
}
else if (AlertStyle == AlertStyle.Secondary)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Secondary" Shade="Shade.Dark" Size="@getCloseButtonSize()" />
}
else if (AlertStyle == AlertStyle.Light)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Dark" Shade="Shade.Dark" Size="@getCloseButtonSize()" />
}
else if (AlertStyle == AlertStyle.Base)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Dark" Shade="Shade.Dark" Size="@getCloseButtonSize()" />
}
else if (AlertStyle == AlertStyle.Dark)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Light" Shade="Shade.Dark" Size="@getCloseButtonSize()" />
}
else if (AlertStyle == AlertStyle.Success)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Success" Shade="Shade.Dark" Size="@getCloseButtonSize()" />
}
else if (AlertStyle == AlertStyle.Danger)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Danger" Shade="Shade.Dark" Size="@getCloseButtonSize()" />
}
else if (AlertStyle == AlertStyle.Warning)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Warning" Shade="Shade.Dark" Size="@getCloseButtonSize()" />
}
else if (AlertStyle == AlertStyle.Info)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Info" Shade="Shade.Dark" Size="@getCloseButtonSize()" />
}
}
else
{
if (AlertStyle == AlertStyle.Light)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Dark" Size="@getCloseButtonSize()" />
}
else if (AlertStyle == AlertStyle.Base)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Dark" Size="@getCloseButtonSize()" />
}
else if (AlertStyle == AlertStyle.Dark)
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Light" Size="@getCloseButtonSize()" />
}
else
{
<RadzenButton Click=@Close Icon="close" Variant="Variant.Text" ButtonStyle="ButtonStyle.Light" Size="@getCloseButtonSize()" />
}
}
}
</div>
}

View File

@@ -0,0 +1,158 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using System;
using System.Threading.Tasks;
namespace Radzen.Blazor
{
/// <summary>
/// RadzenAlert component.
/// </summary>
/// <example>
/// <code>
/// &lt;RadzenAlert&gt;
/// &lt;ChildContent&gt;
/// Content
/// &lt;/ChildContent&gt;
/// &lt;/RadzenAlert&gt;
/// </code>
/// </example>
public partial class RadzenAlert : RadzenComponentWithChildren
{
private string getAlertSize()
{
return Size == AlertSize.Medium ? "md" : Size == AlertSize.Large ? "lg" : Size == AlertSize.Small ? "sm" : "xs";
}
/// <summary>
/// Gets or sets a value indicating whether close is allowed. Set to <c>true</c> by default.
/// </summary>
/// <value><c>true</c> if close is allowed; otherwise, <c>false</c>.</value>
[Parameter]
public bool AllowClose { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether icon should be shown. Set to <c>true</c> by default.
/// </summary>
/// <value><c>true</c> if icon is shown; otherwise, <c>false</c>.</value>
[Parameter]
public bool ShowIcon { get; set; } = true;
/// <summary>
/// Gets or sets the title.
/// </summary>
/// <value>The title.</value>
[Parameter]
public string Title { get; set; }
/// <summary>
/// Gets or sets the text of the alert. Overriden by <see cref="ChildContent" />.
/// </summary>
/// <value>The title.</value>
[Parameter]
public string Text { get; set; }
/// <summary>
/// Gets or sets the icon.
/// </summary>
/// <value>The icon.</value>
[Parameter]
public string Icon { get; set; }
/// <summary>
/// Gets or sets the severity.
/// </summary>
/// <value>The severity.</value>
[Parameter]
public AlertStyle AlertStyle { get; set; } = AlertStyle.Base;
/// <summary>
/// Gets or sets the design variant of the alert.
/// </summary>
/// <value>The variant of the alert.</value>
[Parameter]
public Variant Variant { get; set; } = Variant.Filled;
/// <summary>
/// Gets or sets the color shade of the alert.
/// </summary>
/// <value>The color shade of the alert.</value>
[Parameter]
public Shade Shade { get; set; } = Shade.Default;
/// <summary>
/// Gets or sets the size.
/// </summary>
/// <value>The size.</value>
[Parameter]
public AlertSize Size { get; set; } = AlertSize.Medium;
ButtonSize getCloseButtonSize()
{
return Size == AlertSize.ExtraSmall ? ButtonSize.ExtraSmall : ButtonSize.Small;
}
bool? visible;
bool GetVisible()
{
return visible ?? Visible;
}
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return $"rz-alert rz-alert-{getAlertSize()} rz-variant-{Enum.GetName(typeof(Variant), Variant).ToLowerInvariant()} rz-{Enum.GetName(typeof(AlertStyle), AlertStyle).ToLowerInvariant()} rz-shade-{Enum.GetName(typeof(Shade), Shade).ToLowerInvariant()}";
}
string getIcon()
{
if (!string.IsNullOrEmpty(Icon))
{
return Icon;
}
else if (AlertStyle == AlertStyle.Primary)
{
return "lightbulb_outline";
}
else if (AlertStyle == AlertStyle.Secondary)
{
return "lightbulb_outline";
}
else if (AlertStyle == AlertStyle.Light)
{
return "lightbulb_outline";
}
else if (AlertStyle == AlertStyle.Base)
{
return "lightbulb_outline";
}
else if (AlertStyle == AlertStyle.Dark)
{
return "lightbulb_outline";
}
else if (AlertStyle == AlertStyle.Success)
{
return "check_circle_outline";
}
else if (AlertStyle == AlertStyle.Danger)
{
return "error_outline";
}
else if (AlertStyle == AlertStyle.Warning)
{
return "warning_amber";
}
else if (AlertStyle == AlertStyle.Info)
{
return "info_outline";
}
return "";
}
void Close()
{
visible = false;
}
}
}

View File

@@ -12,16 +12,7 @@
var value = ComposeValue(valueScale);
IPathGenerator pathGenerator;
if (Smooth)
{
pathGenerator = new SplineGenerator();
}
else
{
pathGenerator = new LineGenerator();
}
var pathGenerator = GetPathGenerator();
var data = Items.Select(item =>
{

View File

@@ -1,5 +1,7 @@
using Microsoft.AspNetCore.Components;
using Radzen.Blazor.Rendering;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Radzen.Blazor
@@ -40,7 +42,17 @@ namespace Radzen.Blazor
/// Specifies whether to render a smooth line. Set to <c>false</c> by default.
/// </summary>
[Parameter]
public bool Smooth { get; set; }
public bool Smooth
{
get => Interpolation == Interpolation.Spline;
set => Interpolation = value ? Interpolation.Spline : Interpolation.Line;
}
/// <summary>
/// Specifies how to render lines between data points. Set to <see cref="Line"/> by default
/// </summary>
[Parameter]
public Interpolation Interpolation { get; set; } = Interpolation.Line;
/// <inheritdoc />
public override string Color
@@ -51,6 +63,26 @@ namespace Radzen.Blazor
}
}
/// <inheritdoc />
protected override string TooltipStyle(TItem item)
{
var style = base.TooltipStyle(item);
var index = Items.IndexOf(item);
if (index >= 0)
{
var color = Fill;
if (color != null)
{
style = $"{style}; border-color: {color};";
}
}
return style;
}
/// <inheritdoc />
public override bool Contains(double x, double y, double tolerance)
{
@@ -62,19 +94,17 @@ namespace Radzen.Blazor
var valueTicks = Chart.ValueScale.Ticks(Chart.ValueAxis.TickDistance);
var axisY = Chart.ValueScale.Scale(Math.Max(0, valueTicks.Start));
if (points.Any())
if (points.Length > 0)
{
for (var i = 0; i < points.Length - 1; i++)
if (points.Length == 1)
{
var start = points[i];
var end = points[i + 1];
var point = points[0];
var polygon = new[]
{
new Point { X = start.X, Y = start.Y - tolerance },
new Point { X = end.X, Y = end.Y - tolerance },
new Point { X = end.X, Y = axisY },
new Point { X = start.X, Y = axisY },
var polygon = new[] {
new Point { X = point.X - tolerance, Y = point.Y - tolerance },
new Point { X = point.X - tolerance, Y = point.Y + tolerance },
new Point { X = point.X + tolerance, Y = point.Y + tolerance },
new Point { X = point.X + tolerance, Y = point.Y - tolerance },
};
if (InsidePolygon(new Point { X = x, Y = y }, polygon))
@@ -82,9 +112,51 @@ namespace Radzen.Blazor
return true;
}
}
else
{
for (var i = 0; i < points.Length - 1; i++)
{
var start = points[i];
var end = points[i + 1];
var polygon = new[]
{
new Point { X = start.X, Y = start.Y - tolerance },
new Point { X = end.X, Y = end.Y - tolerance },
new Point { X = end.X, Y = axisY },
new Point { X = start.X, Y = axisY },
};
if (InsidePolygon(new Point { X = x, Y = y }, polygon))
{
return true;
}
}
}
}
return false;
}
/// <inheritdoc />
public override IEnumerable<ChartDataLabel> GetDataLabels(double offsetX, double offsetY)
{
return base.GetDataLabels(offsetX, offsetY - 16);
}
private IPathGenerator GetPathGenerator()
{
switch(Interpolation)
{
case Interpolation.Line:
return new LineGenerator();
case Interpolation.Spline:
return new SplineGenerator();
case Interpolation.Step:
return new StepGenerator();
default:
throw new NotSupportedException($"Interpolation {Interpolation} is not supported yet.");
}
}
}
}
}

View File

@@ -10,20 +10,39 @@
@if (Visible)
{
<div @ref="@Element" style="@($"{Style};display:inline-block;")" @attributes="Attributes" class="@GetCssClass()" id="@GetId()">
<span class="rz-autocomplete" style="width:100%">
@if (Multiline)
{
<textarea @ref="@search" @onkeydown="@OnFilterKeyPress" value="@Value" disabled="@Disabled"
oninput="@OpenScript()" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onchange="@OnChange"
aria-autocomplete="list" aria-haspopup="true" autocomplete="off" role="combobox"
class="@InputClassList" onblur="Radzen.activeElement = null"
id="@Name" aria-expanded="true" placeholder="@Placeholder" />
}
else
{
<input @ref="@search" @onkeydown="@OnFilterKeyPress" value="@Value" disabled="@Disabled"
onfocus="@OpenScript()" onkeypress="@OpenScript()" tabindex="@TabIndex" @onchange="@OnChange"
aria-autocomplete="list" aria-haspopup="true" autocomplete="off" role="combobox"
class="@InputClassList"
type="text" id="@Name" aria-expanded="true" placeholder="@Placeholder" />
</span><div id="@PopupID" class="rz-autocomplete-panel" style="display:none; transform: none; box-sizing: border-box; max-height: 200px;">
oninput="@OpenScript()" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onchange="@OnChange"
aria-autocomplete="list" aria-haspopup="true" autocomplete="off" role="combobox"
class="@InputClassList" onblur="Radzen.activeElement = null"
type="text" id="@Name" aria-expanded="true" placeholder="@Placeholder" />
}
<div id="@PopupID" class="rz-autocomplete-panel" style="@PopupStyle">
<ul @ref="@list" class="rz-autocomplete-items rz-autocomplete-list" role="listbox">
@if (!string.IsNullOrEmpty(searchText) || !string.IsNullOrEmpty(customSearchText))
{
@foreach (var item in LoadData.HasDelegate ? Data != null ? Data : Enumerable.Empty<object>() : (View != null ? View : Enumerable.Empty<object>()))
{
<li role="option" class="rz-autocomplete-list-item" @onclick="@(() => OnSelectItem(item))" onmousedown="Radzen.activeElement = null">
<span>@PropertyAccess.GetItemOrValueFromProperty(item, TextProperty)</span>
<span>
@if (Template != null)
{
@Template(item)
}
else
{
@PropertyAccess.GetItemOrValueFromProperty(item, TextProperty)
}
</span>
</li>
}
}

View File

@@ -22,6 +22,27 @@ namespace Radzen.Blazor
/// </example>
public partial class RadzenAutoComplete : DataBoundFormComponent<string>
{
/// <summary>
/// Gets or sets a value indicating whether this <see cref="RadzenAutoComplete"/> is multiline.
/// </summary>
/// <value><c>true</c> if multiline; otherwise, <c>false</c>.</value>
[Parameter]
public bool Multiline { get; set; }
/// <summary>
/// Gets or sets the Popup height.
/// </summary>
/// <value>The number Popup height.</value>
[Parameter]
public string PopupStyle { get; set; } = "display:none; transform: none; box-sizing: border-box; max-height: 200px;";
/// <summary>
/// Gets or sets the template.
/// </summary>
/// <value>The template.</value>
[Parameter]
public RenderFragment<dynamic> Template { get; set; }
/// <summary>
/// Gets or sets the minimum length.
/// </summary>
@@ -78,11 +99,11 @@ namespace Radzen.Blazor
selectedIndex = -1;
}
}
else if (key == "Escape")
else if (key == "Escape" || key == "Tab")
{
await JSRuntime.InvokeVoidAsync("Radzen.closePopup", PopupID);
}
else if(key != "Tab")
else
{
selectedIndex = -1;
@@ -148,7 +169,9 @@ namespace Radzen.Blazor
{
string filterCaseSensitivityOperator = FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive ? ".ToLower()" : "";
return Query.Where($"{TextProperty}{filterCaseSensitivityOperator}.{Enum.GetName(typeof(StringFilterOperator), FilterOperator)}(@0)",
string textProperty = string.IsNullOrEmpty(TextProperty) ? string.Empty : $".{TextProperty}";
return Query.Where($"o=>o{textProperty}{filterCaseSensitivityOperator}.{Enum.GetName(typeof(StringFilterOperator), FilterOperator)}(@0)",
FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive ? searchText.ToLower() : searchText);
}
@@ -203,7 +226,7 @@ namespace Radzen.Blazor
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return GetClassList("").ToString();
return GetClassList("rz-autocomplete").ToString();
}
/// <inheritdoc />

View File

@@ -19,7 +19,9 @@ namespace Radzen.Blazor
var classList = new List<string>();
classList.Add("rz-badge");
classList.Add($"rz-badge-{BadgeStyle.ToString().ToLower()}");
classList.Add($"rz-badge-{BadgeStyle.ToString().ToLowerInvariant()}");
classList.Add($"rz-variant-{Variant.ToString().ToLowerInvariant()}");
classList.Add($"rz-shade-{Shade.ToString().ToLowerInvariant()}");
if (IsPill)
{
@@ -50,6 +52,20 @@ namespace Radzen.Blazor
[Parameter]
public BadgeStyle BadgeStyle { get; set; }
/// <summary>
/// Gets or sets the badge variant.
/// </summary>
/// <value>The badge variant.</value>
[Parameter]
public Variant Variant { get; set; } = Variant.Filled;
/// <summary>
/// Gets or sets the badge shade color.
/// </summary>
/// <value>The badge shade color.</value>
[Parameter]
public Shade Shade { get; set; } = Shade.Default;
/// <summary>
/// Gets or sets a value indicating whether this instance is pill.
/// </summary>

View File

@@ -21,6 +21,13 @@ namespace Radzen.Blazor
[Parameter]
public double Margin { get; set; } = 10;
/// <summary>
/// Gets or sets the height of all bars in pixels. By default it is automatically calculated depending on the chart height.
/// </summary>
/// <value>The pixel height of the bar. By default set to <c>null</c></value>
[Parameter]
public double? Height { get; set;}
/// <inheritdoc />
protected override void Initialize()
{
@@ -30,7 +37,9 @@ namespace Radzen.Blazor
/// <inheritdoc />
protected override bool ShouldRefreshChart(ParameterView parameters)
{
return DidParameterChange(parameters, nameof(Radius), Radius) || DidParameterChange(parameters, nameof(Margin), Margin);
return DidParameterChange(parameters, nameof(Radius), Radius) ||
DidParameterChange(parameters, nameof(Height), Height) ||
DidParameterChange(parameters, nameof(Margin), Margin);
}
}
}

View File

@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using Radzen.Blazor.Rendering;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -9,7 +10,7 @@ namespace Radzen.Blazor
/// Renders bar series in <see cref="RadzenChart" />.
/// </summary>
/// <typeparam name="TItem">The type of the series data item.</typeparam>
public partial class RadzenBarSeries<TItem> : Radzen.Blazor.CartesianSeries<TItem>, IChartBarSeries
public partial class RadzenBarSeries<TItem> : CartesianSeries<TItem>, IChartBarSeries
{
/// <summary>
/// Specifies the fill (background color) of the bar series.
@@ -74,6 +75,12 @@ namespace Radzen.Blazor
return base.TransformCategoryScale(scale);
}
/// <inheritdoc />
protected override IList<object> GetCategories()
{
return base.GetCategories().Reverse().ToList();
}
private IList<IChartSeries> BarSeries
{
get
@@ -90,13 +97,42 @@ namespace Radzen.Blazor
}
}
/// <inheritdoc />
protected override string TooltipStyle(TItem item)
{
var style = base.TooltipStyle(item);
var index = Items.IndexOf(item);
if (index >= 0)
{
var color = PickColor(index, Fills, Fill);
if (color != null)
{
style = $"{style}; border-color: {color};";
}
}
return style;
}
private double BandHeight
{
get
{
var availableHeight = Chart.ValueScale.OutputSize; // - (Chart.ValueAxis.Padding * 2);
var bands = VisibleBarSeries.Cast<IChartBarSeries>().Max(series => series.Count) + 2;
return availableHeight / bands;
var barSeries = VisibleBarSeries;
if (Chart.BarOptions.Height.HasValue)
{
return Chart.BarOptions.Height.Value * barSeries.Count;
}
else
{
var availableHeight = Chart.ValueScale.OutputSize; // - (Chart.ValueAxis.Padding * 2);
var bands = barSeries.Cast<IChartBarSeries>().Max(series => series.Count) + 2;
return availableHeight / bands;
}
}
}
@@ -115,7 +151,7 @@ namespace Radzen.Blazor
}
/// <inheritdoc />
protected override double TooltipX(TItem item)
internal override double TooltipX(TItem item)
{
var value = Chart.CategoryScale.Compose(Value);
var x = value(item);
@@ -168,7 +204,7 @@ namespace Radzen.Blazor
}
/// <inheritdoc />
protected override double TooltipY(TItem item)
internal override double TooltipY(TItem item)
{
var category = ComposeCategory(Chart.ValueScale);
var barSeries = VisibleBarSeries;
@@ -180,5 +216,23 @@ namespace Radzen.Blazor
return y + height / 2;
}
/// <inheritdoc />
public override IEnumerable<ChartDataLabel> GetDataLabels(double offsetX, double offsetY)
{
var list = new List<ChartDataLabel>();
foreach (var d in Data)
{
list.Add(new ChartDataLabel
{
Position = new Point() { X = TooltipX(d) + offsetX + 8, Y = TooltipY(d) + offsetY },
TextAnchor = "start",
Text = Chart.ValueAxis.Format(Chart.CategoryScale, Value(d))
});
}
return list;
}
}
}

View File

@@ -1,5 +1,9 @@
using Microsoft.AspNetCore.Components;
using System.Linq;
using Radzen.Blazor.Rendering;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.JSInterop;
namespace Radzen.Blazor
{
@@ -8,17 +12,23 @@ namespace Radzen.Blazor
/// </summary>
public partial class RadzenBody : RadzenComponentWithChildren
{
private const string DefaultStyle = "margin-top: 51px; margin-bottom: 57px; margin-left:250px;";
/// <summary>
/// Gets or sets the style.
/// </summary>
/// <value>The style.</value>
[Parameter]
public override string Style { get; set; } = "margin-top: 51px; margin-bottom: 57px; margin-left:250px;";
public override string Style { get; set; } = DefaultStyle;
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return Expanded ? "body body-expanded" : "body";
var classList = ClassList.Create("rz-body")
.Add("body")
.Add("body-expanded", Expanded);
return classList.ToString();
}
/// <summary>
@@ -31,24 +41,45 @@ namespace Radzen.Blazor
StateHasChanged();
}
/// <summary>
/// The <see cref="RadzenLayout" /> this component is nested in.
/// </summary>
[CascadingParameter]
public RadzenLayout Layout { get; set; }
/// <summary>
/// Gets the style.
/// </summary>
/// <returns>System.String.</returns>
protected string GetStyle()
{
var marginLeft = 250;
if (!string.IsNullOrEmpty(Style))
if (Layout == null)
{
var marginLeftStyle = Style.Split(';').Where(i => i.Split(':')[0].Contains("margin-left")).FirstOrDefault();
if (!string.IsNullOrEmpty(marginLeftStyle) && marginLeftStyle.Contains("px"))
{
marginLeft = int.Parse(marginLeftStyle.Split(':')[1].Trim().Replace("px", "").Split('.')[0].Trim());
}
}
var marginLeft = 250;
var style = Style;
return $"{Style}; margin-left: {(Expanded ? 0 : marginLeft)}px";
if (!string.IsNullOrEmpty(Style))
{
var marginLeftStyle = Style.Split(';').Where(i => i.Split(':')[0].Contains("margin-left")).FirstOrDefault();
if (!string.IsNullOrEmpty(marginLeftStyle) && marginLeftStyle.Contains("px"))
{
marginLeft = int.Parse(marginLeftStyle.Split(':')[1].Trim().Replace("px", "").Split('.')[0].Trim());
}
}
return $"{Style}; margin-left: {(Expanded ? 0 : marginLeft)}px";
}
else
{
var style = Style;
if (!string.IsNullOrEmpty(style))
{
style = style.Replace(DefaultStyle, "");
}
return $"{style}";
}
}
/// <summary>
@@ -64,5 +95,32 @@ namespace Radzen.Blazor
/// <value>The expanded changed callback.</value>
[Parameter]
public EventCallback<bool> ExpandedChanged { get; set; }
[Inject]
NavigationManager NavigationManager { get; set; }
/// <inheritdoc />
protected override Task OnInitializedAsync()
{
NavigationManager.LocationChanged += OnLocationChanged;
return base.OnInitializedAsync();
}
private void OnLocationChanged(object sender, LocationChangedEventArgs e)
{
if (IsJSRuntimeAvailable && Layout != null)
{
JSRuntime.InvokeVoidAsync("eval", $"document.getElementById('{GetId()}').scrollTop = 0");
}
}
/// <inheritdoc />
public override void Dispose()
{
NavigationManager.LocationChanged -= OnLocationChanged;
base.Dispose();
}
}
}
}

View File

@@ -0,0 +1,13 @@
@inherits RadzenComponentWithChildren
<CascadingValue Value="@Template">
@if (Visible)
{
<div class="@GetCssClass()" style="@Style" @attributes="@Attributes" id="@GetId()">
@if (ChildContent != null)
{
@ChildContent
}
</div>
}
</CascadingValue>

View File

@@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Components;
namespace Radzen.Blazor
{
/// <summary>
/// A component to display a Bread Crumb style menu
/// </summary>
public partial class RadzenBreadCrumb : RadzenComponentWithChildren
{
/// <summary>
/// An optional RenderFragment that is rendered per Item
/// </summary>
[Parameter]
public RenderFragment<RadzenBreadCrumbItem> Template { get; set; }
/// <inheritdoc/>
protected override string GetComponentCssClass()
{
return "rz-breadcrumb";
}
}
}

View File

@@ -0,0 +1,30 @@
@inherits RadzenComponent
@if (Visible)
{
<div class="@GetCssClass()" id="@GetId()" style="@Style" @attributes="@Attributes">
@if (ChildContent != null)
{
@ChildContent
}
else if (Template != null)
{
@Template(this)
}
else
{
@if (!string.IsNullOrWhiteSpace(Path))
{
<RadzenLink Icon="@Icon" Path="@Path" Text="@Text" />
}
else
{
@if (!string.IsNullOrWhiteSpace(Icon))
{
<RadzenIcon Icon="@Icon" />
}
<RadzenLabel Text="@Text" />
}
}
</div>
}

View File

@@ -0,0 +1,47 @@
using Microsoft.AspNetCore.Components;
namespace Radzen.Blazor
{
/// <summary>
/// Bread Crumb Item Component
/// </summary>
public partial class RadzenBreadCrumbItem : RadzenComponent
{
/// <summary>
/// Cascaded Template Parameter from <see cref="RadzenBreadCrumb"/> Component
/// </summary>
[CascadingParameter]
public RenderFragment<RadzenBreadCrumbItem> Template { get; set; }
/// <summary>
/// The Displayed Text
/// </summary>
[Parameter]
public string Text { get; set; }
/// <summary>
/// An optional Link to be rendendered
/// </summary>
[Parameter]
public string Path { get; set; }
/// <summary>
/// An optional Icon to be rendered
/// </summary>
[Parameter]
public string Icon { get; set; }
/// <summary>
/// Template Parameter used only for this Item
/// Note: this overrides the <see cref="Template"/> Cascading Parameter
/// </summary>
[Parameter]
public RenderFragment ChildContent { get; set; }
/// <inheritdoc/>
protected override string GetComponentCssClass()
{
return "rz-breadcrumb-item";
}
}
}

View File

@@ -6,35 +6,37 @@
type="@Enum.GetName(typeof(ButtonType), ButtonType).ToLower()"
@attributes="Attributes" class="@GetCssClass()" id="@GetId()"
@onclick="@OnClick">
@if (ChildContent != null)
{
@ChildContent
}
else
{
@if (IsBusy)
<span class="rz-button-box">
@if (ChildContent != null)
{
<RadzenIcon Icon="refresh" Style="animation: rotation 700ms linear infinite" />
@if (!string.IsNullOrEmpty(BusyText))
{
<span class="rz-button-text">@BusyText</span>
}
@ChildContent
}
else
{
@if (!string.IsNullOrEmpty(@Icon))
@if (IsBusy)
{
<i class="rz-button-icon-left rzi">@((MarkupString)Icon)</i>
<RadzenIcon Icon="refresh" Style="animation: rotation 700ms linear infinite" />
@if (!string.IsNullOrEmpty(BusyText))
{
<span class="rz-button-text">@BusyText</span>
}
}
@if (!string.IsNullOrEmpty(Image))
else
{
<img class="rz-button-icon-left rzi" src="@Image" />
}
@if (!string.IsNullOrEmpty(Text))
{
<span class="rz-button-text">@Text</span>
@if (!string.IsNullOrEmpty(@Icon))
{
<i class="rz-button-icon-left rzi">@((MarkupString)Icon)</i>
}
@if (!string.IsNullOrEmpty(Image))
{
<img class="rz-button-icon-left rzi" src="@Image" />
}
@if (!string.IsNullOrEmpty(Text))
{
<span class="rz-button-text">@Text</span>
}
}
}
}
</span>
</button>
}

View File

@@ -17,7 +17,7 @@ namespace Radzen.Blazor
{
private string getButtonSize()
{
return Size == ButtonSize.Medium ? "md" : "sm";
return Size == ButtonSize.Medium ? "md" : Size == ButtonSize.Large ? "lg" : Size == ButtonSize.Small ? "sm" : "xs";
}
/// <summary>
@@ -62,6 +62,20 @@ namespace Radzen.Blazor
[Parameter]
public ButtonType ButtonType { get; set; } = ButtonType.Button;
/// <summary>
/// Gets or sets the design variant of the button.
/// </summary>
/// <value>The variant of the button.</value>
[Parameter]
public Variant Variant { get; set; } = Variant.Filled;
/// <summary>
/// Gets or sets the color shade of the button.
/// </summary>
/// <value>The color shade of the button.</value>
[Parameter]
public Shade Shade { get; set; } = Shade.Default;
/// <summary>
/// Gets or sets the size.
/// </summary>
@@ -131,7 +145,7 @@ namespace Radzen.Blazor
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return $"rz-button rz-button-{getButtonSize()} btn-{Enum.GetName(typeof(ButtonStyle), ButtonStyle).ToLower()}{(IsDisabled ? " rz-state-disabled" : "")}{(string.IsNullOrEmpty(Text) && !string.IsNullOrEmpty(Icon) ? " rz-button-icon-only" : "")}";
return $"rz-button rz-button-{getButtonSize()} rz-variant-{Enum.GetName(typeof(Variant), Variant).ToLowerInvariant()} rz-{Enum.GetName(typeof(ButtonStyle), ButtonStyle).ToLowerInvariant()} rz-shade-{Enum.GetName(typeof(Shade), Shade).ToLowerInvariant()}{(IsDisabled ? " rz-state-disabled" : "")}{(string.IsNullOrEmpty(Text) && !string.IsNullOrEmpty(Icon) ? " rz-button-icon-only" : "")}";
}
}
}

View File

@@ -13,7 +13,7 @@ namespace Radzen.Blazor
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return "rz-card card";
return "rz-card";
}
}
}

View File

@@ -26,6 +26,7 @@
@if (series.Visible)
{
@series.Render(CategoryScale, ValueScale);
@series.RenderOverlays(CategoryScale, ValueScale);
}
}
</g>
@@ -37,10 +38,13 @@
@donut.RenderTitle(MarginLeft, MarginTop)
}
}
@if (tooltip != null)
{
@tooltip
}
<ChartTooltipContainer @ref="@chartTooltipContainer">
@if (tooltip != null)
{
@tooltip
}
</ChartTooltipContainer>
</CascadingValue>
}
</div>

View File

@@ -47,6 +47,11 @@ namespace Radzen.Blazor
[Parameter]
public EventCallback<SeriesClickEventArgs> SeriesClick { get; set; }
/// <summary>
/// A callback that will be invoked when the user clicks on a legend.
/// </summary>
[Parameter]
public EventCallback<LegendClickEventArgs> LegendClick { get; set; }
double? Width { get; set; }
double? Height { get; set; }
@@ -202,12 +207,7 @@ namespace Radzen.Blazor
ValueScale.Fit(ValueAxis.TickDistance);
CategoryScale.Fit(CategoryAxis.TickDistance);
var stateHasChanged = false;
if (!ValueScale.IsEqualTo(valueScale))
{
stateHasChanged = true;
}
var stateHasChanged = !ValueScale.IsEqualTo(valueScale);
if (!CategoryScale.IsEqualTo(categoryScale))
{
@@ -249,6 +249,7 @@ namespace Radzen.Blazor
}
}
ChartTooltipContainer chartTooltipContainer;
RenderFragment tooltip;
object tooltipData;
double mouseX;
@@ -296,21 +297,39 @@ namespace Radzen.Blazor
{
if (Tooltip.Visible)
{
foreach (var series in Series)
{
if (series.Visible && series.Contains(mouseX - MarginLeft, mouseY - MarginTop, 25))
{
var data = series.DataAt(mouseX - MarginLeft, mouseY - MarginTop);
var orderedSeries = Series.OrderBy(s => s.RenderingOrder).Reverse();
if (data != tooltipData)
foreach (var series in orderedSeries)
{
if (series.Visible)
{
foreach (var overlay in series.Overlays.Reverse())
{
tooltipData = data;
tooltip = series.RenderTooltip(data, MarginLeft, MarginTop);
StateHasChanged();
await Task.Yield();
if (overlay.Visible && overlay.Contains(mouseX - MarginLeft, mouseY - MarginTop, 25))
{
tooltipData = null;
tooltip = overlay.RenderTooltip(mouseX, mouseY, MarginLeft, MarginTop);
chartTooltipContainer.Refresh();
await Task.Yield();
return;
}
}
return;
if (series.Contains(mouseX - MarginLeft, mouseY - MarginTop, 25))
{
var data = series.DataAt(mouseX - MarginLeft, mouseY - MarginTop);
if (data != tooltipData)
{
tooltipData = data;
tooltip = series.RenderTooltip(data, MarginLeft, MarginTop);
chartTooltipContainer.Refresh();
await Task.Yield();
}
return;
}
}
}
@@ -319,7 +338,7 @@ namespace Radzen.Blazor
tooltipData = null;
tooltip = null;
StateHasChanged();
chartTooltipContainer.Refresh();
await Task.Yield();
}
}
@@ -466,7 +485,7 @@ namespace Radzen.Blazor
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return $"rz-chart rz-scheme-{ColorScheme.ToString().ToLower()}";
return $"rz-chart rz-scheme-{ColorScheme.ToString().ToLowerInvariant()}";
}
}
}

View File

@@ -5,13 +5,12 @@
@inherits FormComponent<TValue>
@if (Visible)
{
<div @ref="@Element" @attributes="Attributes" class="@GetCssClass()" @onmouseup=@Toggle @onkeypress=@OnKeyPress
@onkeypress:preventDefault style="@Style" tabindex="@TabIndex" id="@GetId()">
<div @ref="@Element" @attributes="Attributes" class="@GetCssClass()" @onkeypress=@OnKeyPress @onkeypress:preventDefault style="@Style" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" id="@GetId()">
<div class="rz-helper-hidden-accessible">
<input type="checkbox" @onchange=@Toggle value=@CheckBoxValue name=@Name id=@Name checked=@CheckBoxChecked
tabindex="-1">
</div>
<div class=@BoxClassList>
<div class=@BoxClassList @onclick=@Toggle @onclick:preventDefault>
<span class=@IconClassList></span>
</div>
</div>

View File

@@ -15,10 +15,17 @@
@if (Visible)
{
<div @ref="@Element" style="@Style" @attributes="Attributes" class="@GetCssClass()" id="@GetId()">
@if (AllowSelectAll)
{
<div class="rz-multiselect-header rz-helper-clearfix" @onclick:preventDefault>
<RadzenCheckBox Name="SelectAll" TValue="bool?" Value="@IsAllSelected()" Change="@SelectAll" />
<RadzenLabel Component="SelectAll" Text="@SelectAllText" class="rz-chkbox-label" />
</div>
}
@foreach (var item in allItems.Where(i => i.Visible))
{
<div class="rz-checkbox" @onclick="@(args => SelectItem(item))" @attributes="item.Attributes" style="@item.Style">
<div class="rz-chkbox " @onkeypress="@(async args => { if (args.Code == "Space") { await SelectItem(item); } })" tabindex="@TabIndex">
<div @ref="@item.Element" id="@item.GetItemId()" @onclick="@(args => SelectItem(item))" @attributes="item.Attributes" class="@item.GetItemCssClass()" style="@item.Style">
<div class="rz-chkbox " @onkeypress="@(async args => { if (args.Code == "Space") { await SelectItem(item); } })" tabindex="@(Disabled || item.Disabled ? "-1" : $"{TabIndex}")">
<div class="rz-helper-hidden-accessible">
<input type="checkbox" name="@Name" value="@item.Value" disabled="@Disabled" tabindex="-1">
</div>

View File

@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Radzen.Blazor.Rendering;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@@ -59,6 +60,59 @@ namespace Radzen.Blazor
}
}
/// <summary>
/// Gets or sets a value indicating whether the user can select all values. Set to <c>false</c> by default.
/// </summary>
/// <value><c>true</c> if select all values is allowed; otherwise, <c>false</c>.</value>
[Parameter]
public bool AllowSelectAll { get; set; } = false;
/// <summary>
/// Gets or sets the select all text.
/// </summary>
/// <value>The select all text.</value>
[Parameter]
public string SelectAllText { get; set; }
async Task SelectAll(bool? value)
{
if (Disabled)
{
return;
}
if (value == true)
{
Value = items.Select(i => i.Value);
}
else if (value == false)
{
Value = null;
}
await ValueChanged.InvokeAsync(Value);
if (FieldIdentifier.FieldName != null) { EditContext?.NotifyFieldChanged(FieldIdentifier); }
await Change.InvokeAsync(Value);
StateHasChanged();
}
bool? IsAllSelected()
{
Func<RadzenCheckBoxListItem<TValue>, bool> predicate = i => Value != null && Value.Contains(i.Value);
var all = items.All(predicate);
var any = items.Any(predicate);
if (all)
{
return true;
}
else
{
return any ? null : (bool?)false;
}
}
IEnumerable _data = null;
/// <summary>
/// Gets or sets the data used to generate items.
@@ -137,7 +191,10 @@ namespace Radzen.Blazor
if (items.Contains(item))
{
items.Remove(item);
try { InvokeAsync(StateHasChanged); } catch { }
if (!disposed)
{
try { InvokeAsync(StateHasChanged); } catch { }
}
}
}

View File

@@ -70,5 +70,20 @@ namespace Radzen.Blazor
{
Value = value;
}
internal string GetItemId()
{
return GetId();
}
internal string GetItemCssClass()
{
return GetCssClass();
}
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return "rz-checkbox";
}
}
}

View File

@@ -12,7 +12,7 @@
}
<div class="rz-colorpicker-value" style="background-color: @Color" ></div>
<button type="button" tabindex="-1" class="rz-colorpicker-trigger" disabled=@Disabled @onclick:preventDefault><i class="rzi" /></button>
<Popup @ref=@Popup class="rz-colorpicker-popup" Close=@Close Open=@Open>
<Popup Lazy=@(PopupRenderMode == PopupRenderMode.OnDemand) @ref=@Popup class="rz-colorpicker-popup" Close=@Close Open=@Open>
@if (ShowHSV)
{
<Draggable class="rz-saturation-picker rz-colorpicker-section" style=@($"background-color: {HSV.ToRGB().ToCSS()}") Drag=@OnSaturationMove>

View File

@@ -321,6 +321,13 @@ namespace Radzen.Blazor
[Parameter]
public RenderFragment ChildContent { get; set; }
/// <summary>
/// Gets or sets the render mode.
/// </summary>
/// <value>The render mode.</value>
[Parameter]
public PopupRenderMode PopupRenderMode { get; set; } = PopupRenderMode.Initial;
double SaturationHandleLeft { get; set; }
double HueHandleLeft { get; set; }
double AlphaHandleLeft { get; set; } = 1;
@@ -359,7 +366,8 @@ namespace Radzen.Blazor
void Init()
{
var value = Value;
if (String.IsNullOrEmpty(Value))
if (String.IsNullOrEmpty(Value) || RGB.Parse(Value) == null)
{
value = "rgb(255, 255, 255)";
}

View File

@@ -0,0 +1,6 @@
@inherits RadzenComponentWithChildren
@if (Visible)
{
<div @ref="@Element" @attributes="Attributes" class="@GetCssClass()" style="@GetStyle()" id="@GetId()">@ChildContent</div>
}

View File

@@ -0,0 +1,245 @@
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
namespace Radzen.Blazor
{
/// <summary>
/// RadzenColumn component.
/// </summary>
public partial class RadzenColumn : RadzenComponentWithChildren
{
/// <summary>
/// Gets or sets the size.
/// </summary>
/// <value>The size.</value>
[Parameter]
public int? Size { get; set; }
/// <summary>
/// Gets or sets the XS size.
/// </summary>
/// <value>The XS size.</value>
[Parameter]
public int? SizeXS { get; set; }
/// <summary>
/// Gets or sets the SM size.
/// </summary>
/// <value>The SM size.</value>
[Parameter]
public int? SizeSM { get; set; }
/// <summary>
/// Gets or sets the MD size.
/// </summary>
/// <value>The MD size.</value>
[Parameter]
public int? SizeMD { get; set; }
/// <summary>
/// Gets or sets the LG size.
/// </summary>
/// <value>The LG size.</value>
[Parameter]
public int? SizeLG { get; set; }
/// <summary>
/// Gets or sets the XL size.
/// </summary>
/// <value>The XL size.</value>
[Parameter]
public int? SizeXL { get; set; }
/// <summary>
/// Gets or sets the XX size.
/// </summary>
/// <value>The XX size.</value>
[Parameter]
public int? SizeXX { get; set; }
/// <summary>
/// Gets or sets the offset.
/// </summary>
/// <value>The offset.</value>
[Parameter]
public int? Offset { get; set; }
/// <summary>
/// Gets or sets the XS offset.
/// </summary>
/// <value>The XS offset.</value>
[Parameter]
public int? OffsetXS { get; set; }
/// <summary>
/// Gets or sets the SM offset.
/// </summary>
/// <value>The SM offset.</value>
[Parameter]
public int? OffsetSM { get; set; }
/// <summary>
/// Gets or sets the MD offset.
/// </summary>
/// <value>The MD offset.</value>
[Parameter]
public int? OffsetMD { get; set; }
/// <summary>
/// Gets or sets the LG offset.
/// </summary>
/// <value>The LG offset.</value>
[Parameter]
public int? OffsetLG { get; set; }
/// <summary>
/// Gets or sets the XL offset.
/// </summary>
/// <value>The XL offset.</value>
[Parameter]
public int? OffsetXL { get; set; }
/// <summary>
/// Gets or sets the XX offset.
/// </summary>
/// <value>The XX offset.</value>
[Parameter]
public int? OffsetXX { get; set; }
/// <summary>
/// Gets or sets the order.
/// </summary>
/// <value>The order.</value>
[Parameter]
public string Order { get; set; }
/// <summary>
/// Gets or sets the XS order.
/// </summary>
/// <value>The XS order.</value>
[Parameter]
public string OrderXS { get; set; }
/// <summary>
/// Gets or sets the SM order.
/// </summary>
/// <value>The SM order.</value>
[Parameter]
public string OrderSM { get; set; }
/// <summary>
/// Gets or sets the MD order.
/// </summary>
/// <value>The MD order.</value>
[Parameter]
public string OrderMD { get; set; }
/// <summary>
/// Gets or sets the LG order.
/// </summary>
/// <value>The LG order.</value>
[Parameter]
public string OrderLG { get; set; }
/// <summary>
/// Gets or sets the XL order.
/// </summary>
/// <value>The XL order.</value>
[Parameter]
public string OrderXL { get; set; }
/// <summary>
/// Gets or sets the XX order.
/// </summary>
/// <value>The XX order.</value>
[Parameter]
public string OrderXX { get; set; }
/// <summary>
/// Gets the final CSS style rendered by the component. Combines it with a <c>style</c> custom attribute.
/// </summary>
protected string GetStyle()
{
if (Attributes != null && Attributes.TryGetValue("style", out var style) && !string.IsNullOrEmpty(Convert.ToString(@style)))
{
return $"{GetComponentStyle()} {@style}";
}
return GetComponentStyle();
}
/// <summary>
/// Gets the component CSS style.
/// </summary>
protected string GetComponentStyle()
{
return $"{Style}{(!string.IsNullOrEmpty(Style) && !Style.EndsWith(";") ? ";" : "")}";
}
/// <inheritdoc />
protected override string GetComponentCssClass()
{
var list = new List<string>
{
Size != null ? $"rz-col-{GetColumnValue("Size", Size)}" : "rz-col"
};
if (Offset != null)
{
list.Add($"rz-offset-{GetColumnValue("Offset", Offset)}");
}
if (!string.IsNullOrEmpty(Order))
{
list.Add($"rz-order-{GetOrderValue("Order", Order)}");
}
var breakPoints = new string[] { "xs", "sm", "md", "lg", "xl", "xx" };
var properties = GetType().GetProperties()
.Where(p => breakPoints.Any(bp => p.Name.ToLower().EndsWith(bp)))
.Select(p => new { p.Name, BreakPoint = string.Concat(p.Name.ToLower().TakeLast(2)), Value = p.GetValue(this) });
foreach (var p in properties)
{
if (p.Value != null)
{
list.Add($"rz-{(!p.Name.StartsWith("Size") ? p.Name.ToLower().Replace(p.BreakPoint, "") + "-" : "col-")}{p.BreakPoint}-{GetColumnValue(p.Name, p.Value)}");
}
}
return string.Join(" ", list);
}
string GetColumnValue(string name, object value)
{
if (name.StartsWith("Order"))
{
return GetOrderValue(name, value.ToString());
}
if ((int)value < 0 || (int)value > 12)
{
throw new Exception($"Property {name} value should be between 0 and 12.");
}
return $"{value}";
}
string GetOrderValue(string name, string value)
{
var orders = Enumerable.Range(0, 12).Select(i => $"{i}").ToArray().Concat(new string[] { "first", "last" });
if (!orders.Contains(value))
{
throw new Exception($"Property {name} value should be between 0 and 12 or first/last.");
}
return value;
}
}
}

View File

@@ -21,6 +21,13 @@ namespace Radzen.Blazor
[Parameter]
public double Margin { get; set; } = 10;
/// <summary>
/// Gets or sets the width of all columns in pixels. By default it is automatically calculated depending on the chart width.
/// </summary>
/// <value>The pixel width of the column. By default set to <c>null</c></value>
[Parameter]
public double? Width { get; set;}
/// <inheritdoc />
protected override void Initialize()
{
@@ -30,7 +37,9 @@ namespace Radzen.Blazor
/// <inheritdoc />
protected override bool ShouldRefreshChart(ParameterView parameters)
{
return DidParameterChange(parameters, nameof(Radius), Radius) || DidParameterChange(parameters, nameof(Margin), Margin);
return DidParameterChange(parameters, nameof(Radius), Radius) ||
DidParameterChange(parameters, nameof(Width), Width) ||
DidParameterChange(parameters, nameof(Margin), Margin);
}
}
}

View File

@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using Radzen.Blazor.Rendering;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -91,13 +92,42 @@ namespace Radzen.Blazor
}
}
/// <inheritdoc />
protected override string TooltipStyle(TItem item)
{
var style = base.TooltipStyle(item);
var index = Items.IndexOf(item);
if (index >= 0)
{
var color = PickColor(index, Fills, Fill);
if (color != null)
{
style = $"{style}; border-color: {color};";
}
}
return style;
}
private double BandWidth
{
get
{
var availableWidth = Chart.CategoryScale.OutputSize - (Chart.CategoryAxis.Padding * 2);
var bands = VisibleColumnSeries.Cast<IChartColumnSeries>().Max(series => series.Count) + 2;
return availableWidth / bands;
var columnSeries = VisibleColumnSeries;
if (Chart.ColumnOptions.Width.HasValue)
{
return Chart.ColumnOptions.Width.Value * columnSeries.Count + Chart.ColumnOptions.Margin * (columnSeries.Count - 1);
}
else
{
var availableWidth = Chart.CategoryScale.OutputSize - (Chart.CategoryAxis.Padding * 2);
var bands = columnSeries.Cast<IChartColumnSeries>().Max(series => series.Count) + 2;
return availableWidth / bands;
}
}
}
@@ -108,7 +138,7 @@ namespace Radzen.Blazor
}
/// <inheritdoc />
protected override double TooltipX(TItem item)
internal override double TooltipX(TItem item)
{
var columnSeries = VisibleColumnSeries;
var index = columnSeries.IndexOf(this);
@@ -122,7 +152,7 @@ namespace Radzen.Blazor
}
/// <inheritdoc />
protected override double TooltipY(TItem item)
internal override double TooltipY(TItem item)
{
var y = base.TooltipY(item);
var ticks = Chart.ValueScale.Ticks(Chart.ValueAxis.TickDistance);
@@ -143,7 +173,7 @@ namespace Radzen.Blazor
var index = columnSeries.IndexOf(this);
var padding = Chart.ColumnOptions.Margin;
var bandWidth = BandWidth;
var width = bandWidth / columnSeries.Count() - padding + padding / columnSeries.Count();
var width = Chart.ColumnOptions.Width ?? bandWidth / columnSeries.Count() - padding + padding / columnSeries.Count();
foreach (var data in Items)
{
@@ -161,5 +191,11 @@ namespace Radzen.Blazor
return null;
}
/// <inheritdoc />
public override IEnumerable<ChartDataLabel> GetDataLabels(double offsetX, double offsetY)
{
return base.GetDataLabels(offsetX, offsetY - 16);
}
}
}

View File

@@ -286,11 +286,15 @@ namespace Radzen
}
}
internal bool disposed = false;
/// <summary>
/// Detaches event handlers and disposes <see cref="Reference" />.
/// </summary>
public virtual void Dispose()
{
disposed = true;
reference?.Dispose();
reference = null;

View File

@@ -14,7 +14,7 @@
else if (menu.Options.Items != null && menu.Options.Items.Any())
{
<div class="rz-context-menu">
<RadzenMenu Click="@(args => { if (menu.Options.Click != null) { menu.Options.Click(args); } })">
<RadzenMenu Click="@(args => { if (menu.Options.Click != null) { menu.Options.Click(args); } })" Responsive="false">
@foreach (var item in menu.Options.Items)
{
<RadzenMenuItem Text="@item.Text" Value="@item.Value"></RadzenMenuItem>

View File

@@ -35,7 +35,7 @@ namespace Radzen.Blazor
/// }
/// </code>
/// </example>
public partial class RadzenContextMenu
public partial class RadzenContextMenu : IDisposable
{
/// <summary>
/// Gets or sets the unique identifier.
@@ -77,7 +77,28 @@ namespace Radzen.Blazor
await JSRuntime.InvokeVoidAsync("Radzen.openContextMenu",
menu.MouseEventArgs.ClientX,
menu.MouseEventArgs.ClientY,
UniqueID);
UniqueID,
Reference,
"RadzenContextMenu.CloseMenu");
}
}
private DotNetObjectReference<RadzenContextMenu> reference;
/// <summary>
/// Gets the reference for the current component.
/// </summary>
/// <value>The reference.</value>
protected DotNetObjectReference<RadzenContextMenu> Reference
{
get
{
if (reference == null)
{
reference = DotNetObjectReference.Create(this);
}
return reference;
}
}
@@ -96,9 +117,21 @@ namespace Radzen.Blazor
await InvokeAsync(() => { StateHasChanged(); });
}
/// <summary>
/// Closes this instance.
/// </summary>
[JSInvokable("RadzenContextMenu.CloseMenu")]
public void CloseMenu()
{
Service.Close();
}
/// <inheritdoc />
public void Dispose()
{
reference?.Dispose();
reference = null;
if (IsJSRuntimeAvailable)
{
JSRuntime.InvokeVoidAsync("Radzen.destroyPopup", UniqueID);

View File

@@ -0,0 +1,38 @@
@using System.Linq.Expressions
@typeparam TItem
@inherits RadzenComponent
@if (Properties != null)
{
<CascadingValue Value=this>
@Properties
</CascadingValue>
}
@if (Visible)
{
<div @ref="@Element" style="@Style" @attributes="Attributes" class="@GetCssClass()" id="@GetId()">
<RadzenSelectBar @bind-Value=LogicalFilterOperator Change="@((LogicalFilterOperator args) => { InvokeAsync(ChangeState); if(Auto) { InvokeAsync(Filter); } })" Size="ButtonSize.Small">
<Items>
<RadzenSelectBarItem Text="@AndOperatorText" Value="LogicalFilterOperator.And" title="@AndOperatorText" />
<RadzenSelectBarItem Text="@OrOperatorText" Value="LogicalFilterOperator.Or" title="@OrOperatorText" />
</Items>
</RadzenSelectBar>
<RadzenButton title="@ClearFilterText" class="rz-datafilter-item-clear" Icon="clear" Click="@(args => ClearFilters())" Visible=@(Filters.Any()) Variant="Variant.Text" Size="ButtonSize.Small" ButtonStyle="ButtonStyle.Dark" />
<ul class="rz-datafilter-group">
@foreach(var filter in Filters)
{
<li class="rz-datafilter-item @(filter.Filters != null ? "rz-datafilter-group-item" : "")">
<RadzenDataFilterItem DataFilter="@this" Filter="@filter" />
</li>
}
<li class="rz-datafilter-item rz-datafilter-bar">
<RadzenSplitButton Icon="add" Click="@(args => AddFilter(args?.Value == "group"))" Size="ButtonSize.Small" Variant="Variant.Flat" ButtonStyle="ButtonStyle.Primary" Shade="Shade.Lighter">
<RadzenSplitButtonItem Icon="add" Text="@AddFilterText" />
<RadzenSplitButtonItem Icon="playlist_add" Value="group" Text="@AddFilterGroupText" />
</RadzenSplitButton>
</li>
</ul>
</div>
}

View File

@@ -0,0 +1,378 @@
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Radzen.Blazor
{
/// <summary>
/// RadzenDataFilter component.
/// </summary>
/// <typeparam name="TItem">The type of the item.</typeparam>
public partial class RadzenDataFilter<TItem> : RadzenComponent
{
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return "rz-datafilter";
}
/// <summary>
/// Gets or sets the properties.
/// </summary>
/// <value>The properties.</value>
[Parameter]
public RenderFragment Properties { get; set; }
/// <summary>
/// The data
/// </summary>
IEnumerable<TItem> _data;
/// <summary>
/// Gets or sets the data.
/// </summary>
/// <value>The data.</value>
[Parameter]
public IEnumerable<TItem> Data
{
get
{
return _data;
}
set
{
if (_data != value)
{
_data = value;
StateHasChanged();
}
}
}
IQueryable<TItem> _view = null;
/// <summary>
/// Gets the view.
/// </summary>
/// <value>The view.</value>
public virtual IQueryable<TItem> View
{
get
{
if (_view == null)
{
_view = Data != null ? Data.AsQueryable().Where<TItem>(this) : Enumerable.Empty<TItem>().AsQueryable();
}
return _view;
}
}
/// <summary>
/// Gets or sets a value indicating whether this filter is automatic.
/// </summary>
/// <value><c>true</c> if filter automatic; otherwise, <c>false</c>.</value>
[Parameter]
public bool Auto { get; set; } = true;
/// <summary>
/// Gets or sets the filters.
/// </summary>
/// <value>The filters.</value>
public IEnumerable<CompositeFilterDescriptor> Filters { get; set; } = Enumerable.Empty<CompositeFilterDescriptor>();
/// <summary>
/// Gets or sets the logical filter operator.
/// </summary>
/// <value>The logical filter operator.</value>
[Parameter]
public LogicalFilterOperator LogicalFilterOperator { get; set; } = LogicalFilterOperator.And;
/// <summary>
/// Gets or sets the filter case sensitivity.
/// </summary>
/// <value>The filter case sensitivity.</value>
[Parameter]
public FilterCaseSensitivity FilterCaseSensitivity { get; set; } = FilterCaseSensitivity.Default;
/// <summary>
/// Gets or sets the filter text.
/// </summary>
/// <value>The filter text.</value>
[Parameter]
public string FilterText { get; set; } = "Filter";
/// <summary>
/// Gets or sets the enum filter select text.
/// </summary>
/// <value>The enum filter select text.</value>
[Parameter]
public string EnumFilterSelectText { get; set; } = "Select...";
/// <summary>
/// Gets or sets the and operator text.
/// </summary>
/// <value>The and operator text.</value>
[Parameter]
public string AndOperatorText { get; set; } = "And";
/// <summary>
/// Gets or sets the or operator text.
/// </summary>
/// <value>The or operator text.</value>
[Parameter]
public string OrOperatorText { get; set; } = "Or";
/// <summary>
/// Gets or sets the apply filter text.
/// </summary>
/// <value>The apply filter text.</value>
[Parameter]
public string ApplyFilterText { get; set; } = "Apply";
/// <summary>
/// Gets or sets the clear filter text.
/// </summary>
/// <value>The clear filter text.</value>
[Parameter]
public string ClearFilterText { get; set; } = "Clear all";
/// <summary>
/// Gets or sets the add filter text.
/// </summary>
/// <value>The add filter text.</value>
[Parameter]
public string AddFilterText { get; set; } = "Add filter";
/// <summary>
/// Gets or sets the remove filter text.
/// </summary>
/// <value>The remove filter text.</value>
[Parameter]
public string RemoveFilterText { get; set; } = "Remove filter";
/// <summary>
/// Gets or sets the add filter group text.
/// </summary>
/// <value>The add filter group text.</value>
[Parameter]
public string AddFilterGroupText { get; set; } = "Add filter group";
/// <summary>
/// Gets or sets the equals text.
/// </summary>
/// <value>The equals text.</value>
[Parameter]
public string EqualsText { get; set; } = "Equals";
/// <summary>
/// Gets or sets the not equals text.
/// </summary>
/// <value>The not equals text.</value>
[Parameter]
public string NotEqualsText { get; set; } = "Not equals";
/// <summary>
/// Gets or sets the less than text.
/// </summary>
/// <value>The less than text.</value>
[Parameter]
public string LessThanText { get; set; } = "Less than";
/// <summary>
/// Gets or sets the less than or equals text.
/// </summary>
/// <value>The less than or equals text.</value>
[Parameter]
public string LessThanOrEqualsText { get; set; } = "Less than or equals";
/// <summary>
/// Gets or sets the greater than text.
/// </summary>
/// <value>The greater than text.</value>
[Parameter]
public string GreaterThanText { get; set; } = "Greater than";
/// <summary>
/// Gets or sets the greater than or equals text.
/// </summary>
/// <value>The greater than or equals text.</value>
[Parameter]
public string GreaterThanOrEqualsText { get; set; } = "Greater than or equals";
/// <summary>
/// Gets or sets the ends with text.
/// </summary>
/// <value>The ends with text.</value>
[Parameter]
public string EndsWithText { get; set; } = "Ends with";
/// <summary>
/// Gets or sets the contains text.
/// </summary>
/// <value>The contains text.</value>
[Parameter]
public string ContainsText { get; set; } = "Contains";
/// <summary>
/// Gets or sets the does not contain text.
/// </summary>
/// <value>The does not contain text.</value>
[Parameter]
public string DoesNotContainText { get; set; } = "Does not contain";
/// <summary>
/// Gets or sets the starts with text.
/// </summary>
/// <value>The starts with text.</value>
[Parameter]
public string StartsWithText { get; set; } = "Starts with";
/// <summary>
/// Gets or sets the not null text.
/// </summary>
/// <value>The not null text.</value>
[Parameter]
public string IsNotNullText { get; set; } = "Is not null";
/// <summary>
/// Gets or sets the is null text.
/// </summary>
/// <value>The null text.</value>
[Parameter]
public string IsNullText { get; set; } = "Is null";
/// <summary>
/// Gets or sets the is empty text.
/// </summary>
/// <value>The empty text.</value>
[Parameter]
public string IsEmptyText { get; set; } = "Is empty";
/// <summary>
/// Gets or sets the is not empty text.
/// </summary>
/// <value>The not empty text.</value>
[Parameter]
public string IsNotEmptyText { get; set; } = "Is not empty";
internal List<RadzenDataFilterProperty<TItem>> properties = new List<RadzenDataFilterProperty<TItem>>();
internal void AddProperty(RadzenDataFilterProperty<TItem> property)
{
if (!properties.Contains(property))
{
properties.Add(property);
}
StateHasChanged();
}
internal void RemoveProperty(RadzenDataFilterProperty<TItem> property)
{
if (properties.Contains(property))
{
properties.Remove(property);
}
if (!disposed)
{
try { InvokeAsync(StateHasChanged); } catch { }
}
}
/// <summary>
/// Recreates View using current Filters.
/// </summary>
public async Task Filter()
{
_view = null;
await ViewChanged.InvokeAsync(View);
}
// <summary>
/// Gets or sets the view changed callback.
/// </summary>
/// <value>The view changed callback.</value>
[Parameter]
public EventCallback<IQueryable<TItem>> ViewChanged { get; set; }
internal async Task ChangeState()
{
await InvokeAsync(StateHasChanged);
}
/// <summary>
/// Gets or sets the filter date format.
/// </summary>
/// <value>The filter date format.</value>
[Parameter]
public string FilterDateFormat { get; set; }
internal async Task AddFilter(bool isGroup)
{
if (isGroup)
{
Filters = Filters.Concat(new CompositeFilterDescriptor[]
{
new CompositeFilterDescriptor()
{
Filters = Enumerable.Empty<CompositeFilterDescriptor>()
}
}
);
}
else
{
Filters = Filters.Concat(new CompositeFilterDescriptor[] { new CompositeFilterDescriptor() });
}
if (Auto)
{
await Filter();
}
}
/// <summary>
/// Clear filters.
/// </summary>
public async Task ClearFilters()
{
Filters = Enumerable.Empty<CompositeFilterDescriptor>();
if (Auto)
{
await Filter();
}
}
/// <summary>
/// Add filter.
/// </summary>
public async Task AddFilter(CompositeFilterDescriptor filter)
{
Filters = Filters.Concat(new CompositeFilterDescriptor[] { filter });
if (Auto)
{
await Filter();
}
}
/// <summary>
/// Remove filter.
/// </summary>
public async Task RemoveFilter(CompositeFilterDescriptor filter)
{
Filters = Filters.Where(f => f != filter);
if (Auto)
{
await Filter();
}
}
}
}

View File

@@ -0,0 +1,258 @@
@typeparam TItem
@if (Filter.Filters != null)
{
<RadzenSelectBar @bind-Value=Filter.LogicalFilterOperator Change="@((LogicalFilterOperator args) => { InvokeAsync(ChangeState); InvokeAsync(ApplyFilter); })" Size="ButtonSize.Small">
<Items>
<RadzenSelectBarItem Text="@DataFilter.AndOperatorText" Value="LogicalFilterOperator.And" title="@DataFilter.AndOperatorText" />
<RadzenSelectBarItem Text="@DataFilter.OrOperatorText" Value="LogicalFilterOperator.Or" title="@DataFilter.OrOperatorText" />
</Items>
</RadzenSelectBar>
<RadzenButton title="@DataFilter.RemoveFilterText" class="rz-datafilter-item-clear" Icon="clear" Click="@RemoveFilter" Variant="Variant.Text" Size="ButtonSize.Small" ButtonStyle="ButtonStyle.Dark"/>
<ul class="rz-datafilter-group">
@foreach(var filter in Filter.Filters)
{
<li class="rz-datafilter-item @(filter.Filters != null ? "rz-datafilter-group-item" : "")">
<RadzenDataFilterItem DataFilter="@this.DataFilter" Filter="@filter" Parent=@this />
</li>
}
<li class="rz-datafilter-item rz-datafilter-bar">
<RadzenSplitButton Icon="add" Click="@(args => AddFilter(args?.Value == "group"))" Size="ButtonSize.Small" Variant="Variant.Flat" ButtonStyle="ButtonStyle.Primary" Shade="Shade.Lighter">
<RadzenSplitButtonItem Icon="add" Text="@DataFilter.AddFilterText" />
<RadzenSplitButtonItem Icon="playlist_add" Value="group" Text="@DataFilter.AddFilterGroupText" />
</RadzenSplitButton>
</li>
</ul>
}
else
{
<RadzenDropDown @bind-Value="@Filter.Property" Data="@(DataFilter?.properties)" ValueProperty="Property" TValue="string" Change="@OnPropertyChange">
<Template>
@{
var property = (RadzenDataFilterProperty<TItem>)context;
}
@(property.Title ?? property.Property)
</Template>
</RadzenDropDown>
if (property != null)
{
<RadzenDropDown @onclick:preventDefault="true" Data="@(property.GetFilterOperators().Select(t => new { Value = property.GetFilterOperatorText(t), Key = t }))"
TextProperty="Value" ValueProperty="Key" TValue="FilterOperator" @bind-Value="@Filter.FilterOperator" Change="@OnOperatorChange" />
@if (property.FilterTemplate != null)
{
<div class="rz-datafilter-editor" style="display:flex">
@property.FilterTemplate(Filter)
</div>
}
else if (PropertyAccess.IsNullableEnum(property.FilterPropertyType) || PropertyAccess.IsEnum(property.FilterPropertyType))
{
<RadzenDropDown AllowClear="false" AllowFiltering="false" TValue="@object" class="rz-datafilter-editor"
@bind-Value=@Filter.FilterValue Multiple="false" Placeholder="@DataFilter.EnumFilterSelectText" TextProperty="Text" ValueProperty="Value"
Data=@EnumExtensions.EnumAsKeyValuePair(Nullable.GetUnderlyingType(property.FilterPropertyType) ?? property.FilterPropertyType) Change=@(args => InvokeAsync(ApplyFilter))/>
}
else if (PropertyAccess.IsNumeric(property.FilterPropertyType))
{
@(DrawNumericFilter())
}
else if (PropertyAccess.IsDate(property.FilterPropertyType))
{
<RadzenDatePicker @bind-Value=@Filter.FilterValue TValue="@object" ShowTime="true" class="rz-datafilter-editor"
ShowTimeOkButton="true" DateFormat="@getFilterDateFormat()" Change=@(args => InvokeAsync(ApplyFilter)) />
}
else if (property.FilterPropertyType == typeof(bool) || property.FilterPropertyType == typeof(bool?))
{
<RadzenCheckBox TriState="true" TValue="@object" @bind-Value=@Filter.FilterValue Change=@(args => InvokeAsync(ApplyFilter)) class="rz-datafilter-check" />
}
else
{
<RadzenTextBox class="rz-datafilter-editor" Value="@($"{Filter.FilterValue}")" Change=@(args => { Filter.FilterValue = args; InvokeAsync(ApplyFilter); }) />
}
<RadzenButton title="@DataFilter.RemoveFilterText" class="rz-datafilter-item-clear" Icon="clear" Click="@RemoveFilter" Variant="Variant.Text" Size="ButtonSize.Small" ButtonStyle="ButtonStyle.Dark"/>
}
}
@code {
[Parameter]
public RadzenDataFilter<TItem> DataFilter { get; set; }
[Parameter]
public RadzenDataFilterItem<TItem> Parent { get; set; }
CompositeFilterDescriptor _filter;
[Parameter]
public CompositeFilterDescriptor Filter
{
get
{
return _filter;
}
set
{
_filter = value;
if (property == null && Filter.Filters == null)
{
property = (Filter.Property != null ? DataFilter.properties
.Where(c => object.Equals(c.Property, Filter.Property)) : DataFilter.properties).FirstOrDefault();
if (property != null)
{
property.FilterValueChange -= OnFilterValueChange;
property.FilterValueChange += OnFilterValueChange;
Filter.Property = property.Property;
if (!property.GetFilterOperators().Contains(Filter.FilterOperator))
{
Filter.FilterOperator = property.GetFilterOperators().FirstOrDefault();
}
var v = property.GetFilterValue();
if (v != null)
{
Filter.FilterValue = v;
}
}
}
}
}
void OnFilterValueChange(object value)
{
if (property != null)
{
Filter.FilterValue = property.GetFilterValue();
}
}
RadzenDataFilterProperty<TItem> property;
async Task ApplyFilter()
{
if (DataFilter.Auto)
{
await DataFilter.Filter();
}
}
async Task OnPropertyChange(object p)
{
property.FilterValueChange -= OnFilterValueChange;
property = DataFilter.properties.Where(c => object.Equals(c.Property, p)).FirstOrDefault();
property.FilterValueChange += OnFilterValueChange;
Filter.FilterValue = null;
var defaultOperator = typeof(System.Collections.IEnumerable).IsAssignableFrom(property.FilterPropertyType) ? FilterOperator.Contains : default(FilterOperator);
Filter.FilterOperator = property.GetFilterOperators().Contains(defaultOperator) ? defaultOperator : property.GetFilterOperators().FirstOrDefault();
await ApplyFilter();
}
async Task OnOperatorChange(object p)
{
await ApplyFilter();
}
async Task AddFilter(bool isGroup)
{
if (isGroup)
{
Filter.Filters = Filter.Filters.Concat(new CompositeFilterDescriptor[]
{
new CompositeFilterDescriptor()
{
Filters = Enumerable.Empty<CompositeFilterDescriptor>()
}
}
);
}
else
{
Filter.Filters = Filter.Filters.Concat(new CompositeFilterDescriptor[] { new CompositeFilterDescriptor() });
}
if (DataFilter.Auto)
{
await DataFilter.Filter();
}
}
async Task RemoveFilter()
{
property = null;
if (Parent != null)
{
Parent.Filter.Filters = Parent.Filter.Filters.Where(f => f != Filter).ToList();
await Parent.ChangeState();
}
else
{
DataFilter.Filters = DataFilter.Filters.Where(f => f != Filter).ToList();
await DataFilter.ChangeState();
}
await ApplyFilter();
}
internal async Task ChangeState()
{
await InvokeAsync(StateHasChanged);
}
RenderFragment DrawNumericFilter()
{
return new RenderFragment(builder =>
{
var type = Nullable.GetUnderlyingType(property.FilterPropertyType) != null ?
property.FilterPropertyType : typeof(Nullable<>).MakeGenericType(property.FilterPropertyType);
var numericType = typeof(RadzenNumeric<>).MakeGenericType(type);
builder.OpenComponent(0, numericType);
builder.AddAttribute(1, "Value", Filter.FilterValue);
builder.AddAttribute(2, "class", "rz-datafilter-editor");
Action<object> action = args =>
{
Filter.FilterValue = args; InvokeAsync(ApplyFilter);
};
var eventCallbackGenericCreate = typeof(NumericFilterEventCallback).GetMethod("Create").MakeGenericMethod(type);
var eventCallbackGenericAction = typeof(NumericFilterEventCallback).GetMethod("Action").MakeGenericMethod(type);
builder.AddAttribute(3, "Change", eventCallbackGenericCreate.Invoke(this,
new object[] { this, eventCallbackGenericAction.Invoke(this, new object[] { action }) }));
builder.CloseComponent();
});
}
internal class NumericFilterEventCallback
{
public static EventCallback<T> Create<T>(object receiver, Action<T> action)
{
return EventCallback.Factory.Create<T>(receiver, action);
}
public static Action<T> Action<T>(Action<object> action)
{
return args => action(args);
}
}
internal string getFilterDateFormat()
{
if (property != null && !string.IsNullOrEmpty(property.FormatString))
{
return property.FormatString.Replace("{0:", "").Replace("}", "");
}
return DataFilter.FilterDateFormat;
}
}

View File

@@ -0,0 +1,405 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Common;
using System.Globalization;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
namespace Radzen.Blazor
{
/// <summary>
/// RadzenDataFilterProperty component.
/// Must be placed inside a <see cref="RadzenDataFilter{TItem}" />
/// </summary>
/// <typeparam name="TItem">The type of the DataFilter item.</typeparam>
public partial class RadzenDataFilterProperty<TItem> : ComponentBase, IDisposable
{
internal event Action<object> FilterValueChange;
/// <summary>
/// Gets or sets the DataFilter.
/// </summary>
/// <value>The DataFilter.</value>
[CascadingParameter]
public RadzenDataFilter<TItem> DataFilter { get; set; }
/// <summary>
/// Gets or sets the format string.
/// </summary>
/// <value>The format string.</value>
[Parameter]
public string FormatString { get; set; }
internal void RemoveColumn(RadzenDataFilterProperty<TItem> property)
{
if (DataFilter.properties.Contains(property))
{
DataFilter.properties.Remove(property);
if (!DataFilter.disposed)
{
try { InvokeAsync(StateHasChanged); } catch { }
}
}
}
/// <summary>
/// Called when initialized.
/// </summary>
protected override void OnInitialized()
{
if (DataFilter != null)
{
DataFilter.AddProperty(this);
var property = GetFilterProperty();
if (!string.IsNullOrEmpty(property) && Type == null)
{
if (!string.IsNullOrEmpty(property))
{
_filterPropertyType = PropertyAccess.GetPropertyType(typeof(TItem), property);
}
}
if (_filterPropertyType == null)
{
_filterPropertyType = Type;
}
else
{
propertyValueGetter = PropertyAccess.Getter<TItem, object>(Property);
}
if (_filterPropertyType == typeof(string))
{
FilterOperator = FilterOperator.Contains;
}
}
}
/// <summary>
/// Gets or sets a value indicating whether this <see cref="RadzenDataGridColumn{TItem}"/> is visible.
/// </summary>
/// <value><c>true</c> if visible; otherwise, <c>false</c>.</value>
[Parameter]
public bool Visible { get; set; } = true;
bool? _visible;
/// <summary>
/// Gets if the property is visible or not.
/// </summary>
/// <returns>System.Boolean.</returns>
public bool GetVisible()
{
return _visible ?? Visible;
}
internal void SetVisible(bool? value)
{
_visible = value;
}
/// <summary>
/// Gets or sets the title.
/// </summary>
/// <value>The title.</value>
[Parameter]
public string Title { get; set; }
/// <summary>
/// Gets or sets the property name.
/// </summary>
/// <value>The property name.</value>
[Parameter]
public string Property { get; set; }
/// <summary>
/// Gets or sets the filter value.
/// </summary>
/// <value>The filter value.</value>
[Parameter]
public object FilterValue { get; set; }
/// <summary>
/// Gets or sets the filter template.
/// </summary>
/// <value>The filter template.</value>
[Parameter]
public RenderFragment<CompositeFilterDescriptor> FilterTemplate { get; set; }
/// <summary>
/// Gets or sets the data type.
/// </summary>
/// <value>The data type.</value>
[Parameter]
public Type Type { get; set; }
Func<TItem, object> propertyValueGetter;
internal object GetHeader()
{
if (!string.IsNullOrEmpty(Title))
{
return Title;
}
else
{
return Property;
}
}
/// <summary>
/// Gets the filter property.
/// </summary>
/// <returns>System.String.</returns>
public string GetFilterProperty()
{
return Property;
}
Type _filterPropertyType;
/// <summary>
/// Gets the filter property type.
/// </summary>
public Type FilterPropertyType
{
get
{
return _filterPropertyType;
}
}
object filterValue;
FilterOperator? filterOperator;
LogicalFilterOperator? logicalFilterOperator;
/// <summary>
/// Set parameters as an asynchronous operation.
/// </summary>
/// <param name="parameters">The parameters.</param>
/// <returns>A Task representing the asynchronous operation.</returns>
public override async Task SetParametersAsync(ParameterView parameters)
{
if (parameters.DidParameterChange(nameof(FilterValue), FilterValue))
{
var value = parameters.GetValueOrDefault<object>(nameof(FilterValue));
if (filterValue != value)
{
filterValue = value;
if (FilterTemplate != null)
{
if (FilterValueChange != null)
{
FilterValueChange(filterValue);
}
await DataFilter.Filter();
return;
}
}
}
await base.SetParametersAsync(parameters);
}
/// <summary>
/// Get property filter value.
/// </summary>
public object GetFilterValue()
{
return filterValue ?? FilterValue;
}
/// <summary>
/// Get property filter operator.
/// </summary>
public FilterOperator GetFilterOperator()
{
return filterOperator ?? FilterOperator;
}
/// <summary>
/// Set property filter value.
/// </summary>
public void SetFilterValue(object value)
{
if ((FilterPropertyType == typeof(DateTimeOffset) || FilterPropertyType == typeof(DateTimeOffset?)) && value != null && value is DateTime?)
{
DateTimeOffset? offset = DateTime.SpecifyKind((DateTime)value, DateTimeKind.Utc);
value = offset;
}
filterValue = value;
}
internal bool CanSetFilterValue()
{
return GetFilterOperator() == FilterOperator.IsNull
|| GetFilterOperator() == FilterOperator.IsNotNull
|| GetFilterOperator() == FilterOperator.IsEmpty
|| GetFilterOperator() == FilterOperator.IsNotEmpty;
}
/// <summary>
/// Sets to default property filter values and operators.
/// </summary>
public void ClearFilters()
{
SetFilterValue(null);
SetFilterOperator(null);
FilterValue = null;
var defaultOperator = typeof(System.Collections.IEnumerable).IsAssignableFrom(FilterPropertyType) ? FilterOperator.Contains : default(FilterOperator);
FilterOperator = GetFilterOperators().Contains(defaultOperator) ? defaultOperator : GetFilterOperators().FirstOrDefault();
}
/// <summary>
/// Gets or sets the filter operator.
/// </summary>
/// <value>The filter operator.</value>
[Parameter]
public FilterOperator FilterOperator { get; set; }
/// <summary>
/// Set property filter operator.
/// </summary>
public void SetFilterOperator(FilterOperator? value)
{
if (value == FilterOperator.IsEmpty || value == FilterOperator.IsNotEmpty || value == FilterOperator.IsNull || value == FilterOperator.IsNotNull)
{
filterValue = value == FilterOperator.IsEmpty || value == FilterOperator.IsNotEmpty ? string.Empty : null;
}
filterOperator = value;
}
/// <summary>
/// Get possible property filter operators.
/// </summary>
public virtual IEnumerable<FilterOperator> GetFilterOperators()
{
if (PropertyAccess.IsEnum(FilterPropertyType))
return new FilterOperator[] { FilterOperator.Equals, FilterOperator.NotEquals };
if (PropertyAccess.IsNullableEnum(FilterPropertyType))
return new FilterOperator[] { FilterOperator.Equals, FilterOperator.NotEquals, FilterOperator.IsNull, FilterOperator.IsNotNull };
if ((typeof(IEnumerable).IsAssignableFrom(FilterPropertyType) || typeof(IEnumerable<>).IsAssignableFrom(FilterPropertyType))
&& FilterPropertyType != typeof(string))
{
return new FilterOperator[]
{
FilterOperator.Contains,
FilterOperator.DoesNotContain,
FilterOperator.Equals,
FilterOperator.NotEquals,
FilterOperator.IsNull,
FilterOperator.IsNotNull,
FilterOperator.IsEmpty,
FilterOperator.IsNotEmpty
};
}
return Enum.GetValues(typeof(FilterOperator)).Cast<FilterOperator>().Where(o => {
var isStringOperator = o == FilterOperator.Contains || o == FilterOperator.DoesNotContain
|| o == FilterOperator.StartsWith || o == FilterOperator.EndsWith || o == FilterOperator.IsEmpty || o == FilterOperator.IsNotEmpty;
return FilterPropertyType == typeof(string) ? isStringOperator
|| o == FilterOperator.Equals || o == FilterOperator.NotEquals
|| o == FilterOperator.IsNull || o == FilterOperator.IsNotNull
: !isStringOperator;
});
}
internal string GetFilterOperatorText(FilterOperator filterOperator)
{
switch (filterOperator)
{
case FilterOperator.Contains:
return DataFilter?.ContainsText;
case FilterOperator.DoesNotContain:
return DataFilter?.DoesNotContainText;
case FilterOperator.EndsWith:
return DataFilter?.EndsWithText;
case FilterOperator.Equals:
return DataFilter?.EqualsText;
case FilterOperator.GreaterThan:
return DataFilter?.GreaterThanText;
case FilterOperator.GreaterThanOrEquals:
return DataFilter?.GreaterThanOrEqualsText;
case FilterOperator.LessThan:
return DataFilter?.LessThanText;
case FilterOperator.LessThanOrEquals:
return DataFilter?.LessThanOrEqualsText;
case FilterOperator.StartsWith:
return DataFilter?.StartsWithText;
case FilterOperator.NotEquals:
return DataFilter?.NotEqualsText;
case FilterOperator.IsNull:
return DataFilter?.IsNullText;
case FilterOperator.IsEmpty:
return DataFilter?.IsEmptyText;
case FilterOperator.IsNotNull:
return DataFilter?.IsNotNullText;
case FilterOperator.IsNotEmpty:
return DataFilter?.IsNotEmptyText;
default:
return $"{filterOperator}";
}
}
internal string GetFilterOperatorSymbol(FilterOperator filterOperator)
{
var symbol = DataFilter.FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive ? "a" : "A";
switch (filterOperator)
{
case FilterOperator.Contains:
return $"*{symbol}*";
case FilterOperator.DoesNotContain:
return $"*{symbol}*";
case FilterOperator.StartsWith:
return $"{symbol}**";
case FilterOperator.EndsWith:
return $"**{symbol}";
case FilterOperator.Equals:
return "=";
case FilterOperator.GreaterThan:
return ">";
case FilterOperator.GreaterThanOrEquals:
return "≥";
case FilterOperator.LessThan:
return "<";
case FilterOperator.LessThanOrEquals:
return "≤";
case FilterOperator.NotEquals:
return "≠";
case FilterOperator.IsNull:
return "∅";
case FilterOperator.IsNotNull:
return "!∅";
case FilterOperator.IsEmpty:
return "= ''";
case FilterOperator.IsNotEmpty:
return "≠ ''";
default:
return $"{filterOperator}";
}
}
/// <summary>
/// Disposes this instance.
/// </summary>
public void Dispose()
{
DataFilter?.RemoveProperty(this);
}
}
}

View File

@@ -14,40 +14,59 @@
@if (Visible)
{
var visibleColumns = columns.Where(c => c.Visible).ToList();
var visibleColumns = columns.Where(c => c.GetVisible()).ToList();
<div @ref=@Element style="@Style" @attributes="Attributes" class="rz-data-grid @GetCssClass()" id="@GetId()">
@if(AllowGrouping)
@if(AllowGrouping || AllowColumnPicking)
{
<div class="rz-group-header" @onmouseup=@(args => EndColumnDropToGroup())>
@if(groups.Any())
{
@foreach(var gd in groups)
@if(AllowGrouping)
{
<div class="rz-group-header-item">
<span class="rz-group-header-item-title">@gd.GetTitle()</span>
<a href="javascript:void(0)" @onclick=@(args => { groups.Remove(gd); _groupedPagedView = null; }) role="button" class="rz-dialog-titlebar-icon rz-dialog-titlebar-close">
<span class="rzi rzi-times"></span>
</a>
@if(Groups.Any())
{
<div class="rz-group-header-items">
@foreach(var gd in Groups)
{
<div class="rz-group-header-item">
<span class="rz-group-header-item-title">@gd.GetTitle()</span>
<a href="javascript:void(0)" @onclick=@(async args => await RemoveGroupAsync(gd)) role="button" class="rz-dialog-titlebar-icon rz-dialog-titlebar-close">
<span class="rzi rzi-times"></span>
</a>
</div>
}
</div>
}
else
{
<div class="rz-group-header-drop">@GroupPanelText</div>
}
}
@if(AllowColumnPicking)
{
<div class="rz-column-picker">
<RadzenDropDown SelectAllText="@AllColumnsText" AllowSelectAll="@AllowPickAllColumns"
MaxSelectedLabels="2"
SelectedItemsText="@ColumnsShowingText" Change=@ToggleColumns
@bind-Value="@selectedColumns"
Multiple="true"
Placeholder="@ColumnsText"
Data="allPickableColumns"
TextProperty="Title" />
</div>
}
}
else
{
<div class="rz-group-header-drop">@GroupPanelText</div>
}
</div>
}
@if (AllowPaging && (PagerPosition == PagerPosition.Top || PagerPosition == PagerPosition.TopAndBottom))
{
<RadzenPager @ref="topPager" Count="@Count" PageSize="@PageSize" PageNumbersCount="@PageNumbersCount" PageChanged="@OnPageChanged" PageSizeChanged="@OnPageSizeChanged" PageSizeOptions="@PageSizeOptions" ShowPagingSummary="@ShowPagingSummary" PagingSummaryFormat="@PagingSummaryFormat" />
<RadzenPager HorizontalAlign="@PagerHorizontalAlign" AlwaysVisible="@PagerAlwaysVisible" @ref="topPager" Count="@Count" PageSize="@PageSize" PageNumbersCount="@PageNumbersCount" PageChanged="@ChangePage" PageSizeChanged="@OnPageSizeChanged" PageSizeOptions="@PageSizeOptions" ShowPagingSummary="@ShowPagingSummary" PagingSummaryFormat="@PagingSummaryFormat" PageSizeText="@PageSizeText" />
}
<div class="rz-data-grid-data">
<table class="rz-grid-table rz-grid-table-fixed">
<table class="rz-grid-table rz-grid-table-fixed @(AllowAlternatingRows ? "rz-grid-table-striped" : "") @(allColumns.Any(c => c.Parent != null) ? "rz-grid-table-composite" : "") @(getGridLinesCSSClass())">
<colgroup>
@foreach(var g in groups)
@foreach(var g in Groups)
{
<col>
}
@@ -61,154 +80,61 @@
}
</colgroup>
<thead>
@for(var i = 0; i < deepestChildColumnLevel + 1; i++)
{
<tr>
@foreach(var g in groups)
@foreach(var g in Groups)
{
<th class="rz-col-icon rz-unselectable-text" scope="col">
<th class="rz-col-icon rz-unselectable-text" scope="col" rowspan=@(deepestChildColumnLevel + 1)>
<span class="rz-column-title"></span>
</th>
}
@if (Template != null && ShowExpandColumn)
@if (Template != null && ShowExpandColumn && i == 0)
{
<th class="rz-col-icon rz-unselectable-text" scope="col">
<th class="rz-col-icon rz-unselectable-text" scope="col" rowspan=@(deepestChildColumnLevel + 1)>
<span class="rz-column-title"></span>
</th>
}
@foreach (var column in visibleColumns)
@for (var j = 0; j < visibleColumns.Count; j++)
{
var column = visibleColumns[j];
var cellAttr = HeaderCellAttributes(column);
object colspan;
cellAttr.TryGetValue("colspan", out colspan);
if (colspan != null)
{
j = j + (int)Convert.ChangeType(colspan, TypeCode.Int32) - 1;
}
var columnIndex = visibleColumns.IndexOf(column);
var sortableClass = AllowSorting && column.Sortable ? "rz-sortable-column" : "";
<th class="@($"rz-unselectable-text {sortableClass} {column.HeaderCssClass} {getFrozenColumnClass(column, visibleColumns)}")" scope="col" style="@column.GetStyle(true, true)" @onmouseup=@(args => EndColumnReorder(args, columnIndex))>
<div @onclick='@((args) => OnSort(args, column))' style="width:100%">
@if (AllowColumnReorder && column.Reorderable || AllowGrouping && column.Groupable)
{
<span id="@getColumnResizerId(columnIndex)" class="rz-column-drag"
@onclick:preventDefault="true" @onclick:stopPropagation="true"
@onmousedown=@(args => StartColumnReorder(args, columnIndex))>&nbsp;</span>
}
<span class="rz-column-title">
@if (column.HeaderTemplate != null)
{
@column.HeaderTemplate
}
else
{
@column.Title
}
</span>
@if (AllowSorting && column.Sortable)
{
@if (column.GetSortOrder() == SortOrder.Ascending)
{
<span class="rz-sortable-column-icon rzi-grid-sort rzi-sort rzi-sort-asc"></span>
}
else if (column.GetSortOrder() == SortOrder.Descending)
{
<span class="rz-sortable-column-icon rzi-grid-sort rzi-sort rzi-sort-desc"></span>
}
else
{
<span class="rz-sortable-column-icon rzi-grid-sort rzi-sort"></span>
}
}
@if (AllowColumnResize && column.Resizable)
{
<div id="@getColumnResizerId(columnIndex)" style="cursor:col-resize;float:right;"
@onclick:preventDefault="true" @onclick:stopPropagation="true" class="rz-column-resizer"
@onmousedown=@(args => StartColumnResize(args, columnIndex))>&nbsp;</div>
}
@if (AllowFiltering && column.Filterable && FilterMode == FilterMode.Advanced)
{
<i @onclick:stopPropagation="true" onclick="@($"Radzen.togglePopup(this, '{PopupID}{column.GetFilterProperty()}')")"
class="@getFilterIconCss(column)" />
<div id="@($"{PopupID}{column.GetFilterProperty()}")" class="rz-overlaypanel"
style="display:none;min-width:250px;" tabindex="0">
<div class="rz-grid-filter rz-overlaypanel-content">
@if (column.FilterTemplate != null)
{
@column.FilterTemplate(column)
}
else
{
<RadzenLabel Text="@FilterText" class="rz-grid-filter-label" />
<RadzenDropDown @onclick:preventDefault="true" Data="@(column.GetFilterOperators().Select(t => new { Value = column.GetFilterOperatorText(t), Key = t }))" TextProperty="Value" ValueProperty="Key" TValue="FilterOperator" Value="@column.GetFilterOperator()" Change="@(args => column.SetFilterOperator((FilterOperator)args))" />
@if (PropertyAccess.IsNumeric(column.FilterPropertyType))
{
@(DrawNumericFilter(column, false))
}
else if (PropertyAccess.IsDate(column.FilterPropertyType))
{
<RadzenDatePicker TValue="@object" ShowTime="true" ShowTimeOkButton="true" DateFormat="@getFilterDateFormat(column)"
Value="@column.GetFilterValue()" Change="@(args => column.SetFilterValue(args.Value))" />
}
else if (column.FilterPropertyType == typeof(bool) || column.FilterPropertyType == typeof(bool?))
{
<RadzenCheckBox TriState="true" TValue="@object" Value="@column.GetFilterValue()" Change="@(args => column.SetFilterValue(args))" />
}
else
{
<RadzenTextBox Value="@($"{column.GetFilterValue()}")" Change="@(args => column.SetFilterValue(args))" />
}
<RadzenDropDown @onclick:preventDefault="true" TextProperty="Text" ValueProperty="Value" Style="width: 80px"
Data="@(Enum.GetValues(typeof(LogicalFilterOperator)).Cast<LogicalFilterOperator>().Select(t => new { Text = t == LogicalFilterOperator.And ? AndOperatorText : OrOperatorText, Value = t }))" TValue="LogicalFilterOperator" Value="@column.LogicalFilterOperator" Change="@(args => column.SetLogicalFilterOperator((LogicalFilterOperator)args))" />
<RadzenDropDown @onclick:preventDefault="true" Data="@(column.GetFilterOperators().Select(t => new { Value = column.GetFilterOperatorText(t), Key = t }))" TextProperty="Value" ValueProperty="Key" TValue="FilterOperator" Value="@column.GetSecondFilterOperator()" Change="@(args => column.SetSecondFilterOperator((FilterOperator)args))" />
@if (PropertyAccess.IsNumeric(column.FilterPropertyType))
{
@(DrawNumericFilter(column, false, false))
}
else if (PropertyAccess.IsDate(column.FilterPropertyType))
{
<RadzenDatePicker TValue="@object"
ShowTime="true" ShowTimeOkButton="true" DateFormat="@getFilterDateFormat(column)"
Value="@column.GetSecondFilterValue()" Change="@(args => column.SetFilterValue(args.Value, false))" />
}
else if (column.FilterPropertyType == typeof(bool) || column.FilterPropertyType == typeof(bool?))
{
<RadzenCheckBox TriState="true" TValue="@object" Value="@column.GetSecondFilterValue()" Change="@(args => column.SetFilterValue(args, false))"/>
}
else
{
<RadzenTextBox Value="@($"{column.GetSecondFilterValue()}")" Change="@(args => column.SetFilterValue(args, false))" />
}
}
</div>
@if (column.FilterTemplate == null)
{
<div class="rz-grid-filter-buttons">
<RadzenButton ButtonStyle="ButtonStyle.Secondary" Text=@ClearFilterText Click="@((args) => ClearFilter(column, true))" />
<RadzenButton ButtonStyle="ButtonStyle.Primary" Text=@ApplyFilterText Click="@((args) => ApplyFilter(column, true))" />
</div>
}
</div>
}
</div>
</th>
<RadzenDataGridHeaderCell RowIndex="@i" Grid="@this" Column="@column" ColumnIndex="@columnIndex" CssClass="@($"rz-unselectable-text {sortableClass} {column.HeaderCssClass} {getFrozenColumnClass(column, visibleColumns)} {getCompositeCellCSSClass(column)} {getColumnAlignClass(column)}".Trim())" Attributes="@(cellAttr)" />
}
</tr>
@if (AllowFiltering && FilterMode == FilterMode.Simple && columns.Where(column => column.Filterable && (!string.IsNullOrEmpty(column.GetFilterProperty()) || column.FilterTemplate != null)).Any())
}
@if (AllowFiltering && (FilterMode == FilterMode.Simple || FilterMode == FilterMode.SimpleWithMenu) && columns.Where(column => column.Filterable && (!string.IsNullOrEmpty(column.GetFilterProperty()) || column.FilterTemplate != null)).Any())
{
<tr>
@foreach(var g in groups)
@foreach(var g in Groups)
{
<th class="rz-col-icon rz-unselectable-text" scope="col">
<th class="rz-col-icon rz-unselectable-text" scope="col" rowspan=@(deepestChildColumnLevel + 1)>
<span class="rz-column-title"></span>
</th>
}
@if (Template != null && ShowExpandColumn)
{
<th class="rz-col-icon rz-unselectable-text" scope="col">
<th class="rz-col-icon rz-unselectable-text" scope="col" rowspan=@(deepestChildColumnLevel + 1)>
<span class="rz-column-title"></span>
</th>
}
@foreach (var column in visibleColumns)
{
<th class="@($" rz-unselectable-text")" tabindex="1" scope="col" style="@column.GetStyle(true, true)">
@if (AllowFiltering && column.Filterable && (!string.IsNullOrEmpty(column.GetFilterProperty()) || column.FilterTemplate != null))
<th colspan="@column.GetColSpan()" class="@($"rz-unselectable-text {getFrozenColumnClass(column, visibleColumns)} {column.HeaderCssClass}")" scope="col" style="@column.GetStyle(true, true)">
@if (AllowFiltering && column.Filterable && column.Columns == null && (!string.IsNullOrEmpty(column.GetFilterProperty()) || column.FilterTemplate != null))
{
<div class="rz-cell-filter">
<div class="rz-cell-filter-content">
@@ -219,72 +145,130 @@
else
{
<label class="rz-cell-filter-label" style="height:35px" onclick="event.preventDefault()">
@if (column.FilterPropertyType == typeof(DateTime) || column.FilterPropertyType == typeof(DateTime?) || column.FilterPropertyType == typeof(DateTimeOffset) || column.FilterPropertyType == typeof(DateTimeOffset?))
@if (PropertyAccess.IsDate(column.FilterPropertyType))
{
<i onclick="@($"Radzen.togglePopup(this.parentNode, '{PopupID}{column.GetFilterProperty()}')")"
class="rzi">date_range</i>
@if (column.GetFilterValue() != null)
{
<span class="rz-current-filter">@column.GetFilterValue()</span>
<i @onclick="@((args) => ClearFilter(column))" class="rzi rz-cell-filter-clear">close</i>
}
<div id="@($"{PopupID}{column.GetFilterProperty()}")" class="rz-overlaypanel"
if (FilterMode == FilterMode.Simple)
{
<button class="rz-button rz-button-md rz-button-icon-only rz-variant-flat rz-light" onclick="@($"Radzen.togglePopup(this.parentNode, '{PopupID}{column.GetFilterProperty()}')")">
<i class="rzi">date_range</i>
</button>
var filterValue = column.GetFilterValue();
@if (filterValue != null && filters.Any(d => d.Property == column.GetFilterProperty()))
{
<span class="rz-current-filter">@string.Format("{0:" + getFilterDateFormat(column) + "}", filterValue)</span>
<i @onclick="@((args) => ClearFilter(column))" class="rzi rz-cell-filter-clear">close</i>
}
<div id="@($"{PopupID}{column.GetFilterProperty()}")" class="rz-overlaypanel"
style="display:none;width:550px;" tabindex="0">
<div class="rz-overlaypanel-content">
<div class="rz-overlaypanel-content">
<div class="rz-date-filter">
<div class="rz-date-filter">
<div class="rz-listbox rz-inputtext ">
<div class="rz-listbox-list-wrapper">
<ul class="rz-listbox-list">
@if (column.GetFilterOperators().Contains(FilterOperator.Equals))
{
<li class="@(DateFilterOperatorStyle(column, FilterOperator.Equals))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.Equals))" style="display: block;">
<span>@EqualsText</span>
</li>
}
@if (column.GetFilterOperators().Contains(FilterOperator.NotEquals))
{
<li class="@(DateFilterOperatorStyle(column, FilterOperator.NotEquals))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.NotEquals))" style="display: block;">
<span>@NotEqualsText</span>
</li>
}
@if (column.GetFilterOperators().Contains(FilterOperator.LessThan))
{
<li class="@(DateFilterOperatorStyle(column, FilterOperator.LessThan))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.LessThan))" style="display: block;">
<span>@LessThanText</span>
</li>
}
@if (column.GetFilterOperators().Contains(FilterOperator.LessThanOrEquals))
{
<li class="@(DateFilterOperatorStyle(column, FilterOperator.LessThanOrEquals))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.LessThanOrEquals))" style="display: block;">
<span>@LessThanOrEqualsText</span>
</li>
}
@if (column.GetFilterOperators().Contains(FilterOperator.GreaterThan))
{
<li class="@(DateFilterOperatorStyle(column, FilterOperator.GreaterThan))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.GreaterThan))" style="display: block;">
<span>@GreaterThanText</span>
</li>
}
@if (column.GetFilterOperators().Contains(FilterOperator.GreaterThanOrEquals))
{
<li class="@(DateFilterOperatorStyle(column, FilterOperator.GreaterThanOrEquals))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.GreaterThanOrEquals))" style="display: block;">
<span>@GreaterThanOrEqualsText</span>
</li>
}
@if (column.GetFilterOperators().Contains(FilterOperator.IsEmpty))
{
<li class="@(DateFilterOperatorStyle(column, FilterOperator.IsEmpty))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.IsEmpty))" style="display: block;">
<span>@IsEmptyText</span>
</li>
}
@if (column.GetFilterOperators().Contains(FilterOperator.IsNotEmpty))
{
<li class="@(DateFilterOperatorStyle(column, FilterOperator.IsNotEmpty))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.IsNotEmpty))" style="display: block;">
<span>@IsNotEmptyText</span>
</li>
}
@if (column.GetFilterOperators().Contains(FilterOperator.IsNull))
{
<li class="@(DateFilterOperatorStyle(column, FilterOperator.IsNull))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.IsNull))" style="display: block;">
<span>@IsNullText</span>
</li>
}
@if (column.GetFilterOperators().Contains(FilterOperator.IsNotNull))
{
<li class="@(DateFilterOperatorStyle(column, FilterOperator.IsNotNull))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.IsNotNull))" style="display: block;">
<span>@IsNotNullText</span>
</li>
}
</ul>
</div>
</div>
<RadzenDatePicker TValue="@object" AllowInput=@(AllowFilterDateInput)
ShowTime="@column.ShowTimeForDateTimeFilter()" ShowTimeOkButton="false" Inline="true" DateFormat="@getFilterDateFormat(column)"
Value="@column.GetFilterValue()" Change="@(args => { column.SetFilterValue(args.Value); SaveSettings(); })" />
<div class="rz-listbox rz-inputtext ">
<div class="rz-listbox-list-wrapper">
<ul class="rz-listbox-list">
<li class="@(DateFilterOperatorStyle(column, FilterOperator.Equals))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.Equals))" style="display: block;">
<span>@EqualsText</span>
</li>
<li class="@(DateFilterOperatorStyle(column, FilterOperator.NotEquals))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.NotEquals))" style="display: block;">
<span>@NotEqualsText</span>
</li>
<li class="@(DateFilterOperatorStyle(column, FilterOperator.LessThan))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.LessThan))" style="display: block;">
<span>@LessThanText</span>
</li>
<li class="@(DateFilterOperatorStyle(column, FilterOperator.LessThanOrEquals))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.LessThanOrEquals))" style="display: block;">
<span>@LessThanOrEqualsText</span>
</li>
<li class="@(DateFilterOperatorStyle(column, FilterOperator.GreaterThan))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.GreaterThan))" style="display: block;">
<span>@GreaterThanText</span>
</li>
<li class="@(DateFilterOperatorStyle(column, FilterOperator.GreaterThanOrEquals))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.GreaterThanOrEquals))" style="display: block;">
<span>@GreaterThanOrEqualsText</span>
</li>
<li class="@(DateFilterOperatorStyle(column, FilterOperator.IsNull))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.IsNull))" style="display: block;">
<span>@IsNullText</span>
</li>
<li class="@(DateFilterOperatorStyle(column, FilterOperator.IsNotNull))" @onclick="@((args) => ApplyDateFilterByFilterOperator(column, FilterOperator.IsNotNull))" style="display: block;">
<span>@IsNotNullText</span>
</li>
</ul>
</div>
<div class="rz-date-filter-buttons">
<button class="rz-button rz-clear-filter" @onclick="@((args) => ClearFilter(column, true))">
@ClearFilterText
</button>
<button class="rz-button rz-apply-filter" @onclick="@((args) => ApplyFilter(column, true))">
@ApplyFilterText
</button>
</div>
</div>
<RadzenDatePicker TValue="@object"
ShowTime="true" ShowTimeOkButton="false" Inline="true" DateFormat="@getFilterDateFormat(column)"
Value="@column.GetFilterValue()" Change="@(args => column.SetFilterValue(args.Value))" />
</div>
<div class="rz-date-filter-buttons">
<button class="rz-button rz-clear-filter" @onclick="@((args) => ClearFilter(column, true))">
@ClearFilterText
</button>
<button class="rz-button rz-apply-filter" @onclick="@((args) => ApplyFilter(column, true))">
@ApplyFilterText
</button>
</div>
</div>
</div>
}
else
{
<RadzenDataGridFilterMenu Grid="@this" Column="@column" />
<RadzenDatePicker Disabled=@column.CanSetFilterValue() TValue="@object" Style="width:100%" AllowInput=@(AllowFilterDateInput) AllowClear="true"
ShowTime="false" ShowTimeOkButton="false" DateFormat="@getFilterDateFormat(column)"
Value="@column.GetFilterValue()" Change="@(args => { if(!args.HasValue) { ClearFilter(column, true); } else {column.SetFilterValue(args.Value); ApplyFilter(column, true);} })" />
}
}
else if (PropertyAccess.IsNullableEnum(column.FilterPropertyType) || PropertyAccess.IsEnum(column.FilterPropertyType))
{
<RadzenDropDown Style="width:100%" AllowClear="true" AllowFiltering="false" TValue="@object"
Value=@column.GetFilterValue() Multiple="false" Placeholder="@EnumFilterSelectText" TextProperty="Text" ValueProperty="Value"
Data=@((PropertyAccess.IsNullableEnum(column.FilterPropertyType) ? new object[]{ new { Value = -1, Text = "<null>"}} : Enumerable.Empty<object>()).Concat(EnumExtensions.EnumAsKeyValuePair(Nullable.GetUnderlyingType(column.FilterPropertyType) ?? column.FilterPropertyType)))
Change="@(args => {column.SetFilterValue(args);column.SetFilterOperator(object.Equals(args, -1) ? FilterOperator.IsNull : FilterOperator.Equals);ApplyFilter(column, true);})" />
}
else if (PropertyAccess.IsNumeric(column.FilterPropertyType))
{
<i class="rzi">search</i>
if(FilterMode == FilterMode.SimpleWithMenu)
{
<RadzenDataGridFilterMenu Grid="@this" Column="@column" />
}
@(DrawNumericFilter(column))
}
else if (column.FilterPropertyType == typeof(bool) || column.FilterPropertyType == typeof(bool?))
@@ -295,8 +279,15 @@
}
else
{
<i class="rzi">search</i>
<input id="@(getFilterInputId(column))" @onchange="@((args) => OnFilter(args, column))" @onkeydown="@((args) => OnFilterKeyPress(args, column))" value="@column.GetFilterValue()" type="text" />
if(FilterMode == FilterMode.SimpleWithMenu)
{
<RadzenDataGridFilterMenu Grid="@this" Column="@column" />
}
<input disabled=@column.CanSetFilterValue() id="@(getFilterInputId(column))" @onchange="@((args) => OnFilter(args, column))" @onkeydown="@((args) => OnFilterKeyPress(args, column))" value="@column.GetFilterValue()" type="text" class="rz-textbox" style="width: 100%;" />
@if (column.GetFilterValue() != null && filters.Any(d => d.Property == column.GetFilterProperty()))
{
<i @onclick="@((args) => ClearFilter(column))" class="rzi rz-cell-filter-clear" style="position:absolute;right:10px;">close</i>
}
}
</label>
}
@@ -311,21 +302,24 @@
<tbody>
@if (Data != null)
{
@if (Count > 0 && columns.Count > 0)
@if (!ShowEmptyMessage || Count > 0 && (IsVirtualizationAllowed() ? Data.Any() : true) || !AllowPaging && LoadData.HasDelegate && Count == 0)
{
@DrawRows(visibleColumns)
if (columns.Count > 0)
{
@DrawRows(visibleColumns)
}
}
else
{
<tr class=" rz-datatable-emptymessage-row">
<td class="rz-datatable-emptymessage" colspan="@(visibleColumns.Count + (Template != null && ShowExpandColumn ? 1 : 0))">
<td class="rz-datatable-emptymessage" colspan="@(visibleColumns.Sum(c => c.GetColSpan()) + (Template != null && ShowExpandColumn ? 1 : 0))">
@if (EmptyTemplate != null)
{
@EmptyTemplate
}
else
{
<span>@EmptyText</span>
<span style="white-space: normal">@EmptyText</span>
}
</td>
</tr>
@@ -335,31 +329,40 @@
@if (visibleColumns.Where(c => c.FooterTemplate != null).Any())
{
<tfoot class="rz-datatable-tfoot">
@for(var i = 0; i < deepestChildColumnLevel + 1; i++)
{
<tr class="">
@foreach(var g in groups)
@foreach(var g in Groups)
{
<td class="rz-col-icon rz-unselectable-text" scope="col">
<td class="rz-col-icon rz-unselectable-text" scope="col" rowspan=@(deepestChildColumnLevel + 1)>
<span class="rz-column-title"></span>
</td>
}
@if (Template != null && ShowExpandColumn)
@if (Template != null && ShowExpandColumn && i == 0)
{
<td class="rz-col-icon rz-unselectable-text" scope="col">
<td class="rz-col-icon rz-unselectable-text" scope="col" rowspan=@(deepestChildColumnLevel + 1)>
<span class="rz-column-title"></span>
</td>
}
@foreach (var column in visibleColumns)
@for (var j = 0; j < visibleColumns.Count; j++)
{
<td class="@($" {column.FooterCssClass} {getFrozenColumnClass(column, visibleColumns)}")" style="@column.GetStyle(true, true)">
<span class="rz-column-footer">
@if (column.FooterTemplate != null)
{
@column.FooterTemplate
}
</span>
</td>
var column = visibleColumns[j];
var cellAttr = FooterCellAttributes(column);
object colspan;
cellAttr.TryGetValue("colspan", out colspan);
if (colspan != null)
{
j = j + (int)Convert.ChangeType(colspan, TypeCode.Int32) - 1;
}
<RadzenDataGridFooterCell RowIndex="@i" Grid="@this" Column="@column"
CssClass="@($"{column.FooterCssClass} {getFrozenColumnClass(column, visibleColumns)} {getCompositeCellCSSClass(column)}".Trim())"
Attributes="@(cellAttr)" />
}
</tr>
}
</tfoot>
}
</table>
@@ -375,7 +378,7 @@
@if (AllowPaging && (PagerPosition == PagerPosition.Bottom || PagerPosition == PagerPosition.TopAndBottom))
{
<RadzenPager @ref="bottomPager" Count="@Count" PageSize="@PageSize" PageNumbersCount="@PageNumbersCount" PageChanged="@OnPageChanged" PageSizeChanged="@OnPageSizeChanged" PageSizeOptions="@PageSizeOptions" ShowPagingSummary="@ShowPagingSummary" PagingSummaryFormat="@PagingSummaryFormat" />
<RadzenPager HorizontalAlign="@PagerHorizontalAlign" AlwaysVisible="@PagerAlwaysVisible" @ref="bottomPager" Count="@Count" PageSize="@PageSize" PageNumbersCount="@PageNumbersCount" PageChanged="@ChangePage" PageSizeChanged="@OnPageSizeChanged" PageSizeOptions="@PageSizeOptions" ShowPagingSummary="@ShowPagingSummary" PagingSummaryFormat="@PagingSummaryFormat" PageSizeText="@PageSizeText" />
}
</div>
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,69 @@
@typeparam TItem
<td @attributes="@Attributes" style="@GetStyle()" class="@GetCssClass()" @onclick="@OnClick" @ondblclick="@OnDblClick" @oncontextmenu="@OnContextMenu" @oncontextmenu:preventDefault="@Grid.CellContextMenu.HasDelegate">
@using Microsoft.AspNetCore.Components.Forms
<CascadingValue Value=@EditContext>
<CascadingValue Value=Row>
@if (Grid.AllowCompositeDataCells ? RowIndex == Column.GetLevel() : (Column.Parent != null && RowIndex == Column.GetLevel() || Column.Columns == null))
{
<td rowspan="@(Column.GetRowSpan(true))" colspan="@(Column.GetColSpan(true))" @attributes="@Attributes" style="@GetStyle()" class="@GetCssClass()" @onclick="@OnClick" @ondblclick="@OnDblClick" @oncontextmenu="@OnContextMenu" @oncontextmenu:preventDefault="@Grid.CellContextMenu.HasDelegate">
<CascadingValue Value=this>
@ChildContent
</CascadingValue>
</td>
}
else
{
@foreach(var column in Grid.childColumns.Where(c => c.GetVisible() && c.Parent == Column))
{
<RadzenDataGridCell Row=@Row EditContext=EditContext RowIndex="@RowIndex" Grid="@Grid" Column="@column" Item="@Item"
Style="@column.GetStyle(true)" CssClass="@(column.CssClass + " " + Grid.getFrozenColumnClass(column, Grid.ColumnsCollection) + " " + Grid.getCompositeCellCSSClass(column))" Attributes="@(Grid.CellAttributes(Item, column))">
@if (Grid.Responsive)
{
<span class="rz-column-title">
@if (column.HeaderTemplate != null)
{
@column.HeaderTemplate
}
else
{
@column.Title
}
</span>
}
<span class="rz-cell-data" title="@(column.Template == null && Grid.ShowCellDataAsTooltip ? column.GetValue(Item) : "")">
@if (Item != null)
{
@if (Grid.IsRowInEditMode(Item) && column.EditTemplate != null)
{
@column.EditTemplate(Item)
}
else if (column.Template != null)
{
@column.Template(Item)
}
else
{
@column.GetValue(Item)
}
}
</span>
</RadzenDataGridCell>
}
}
</CascadingValue>
</CascadingValue>
@code {
[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, object> Attributes { get; set; }
[Parameter]
public int RowIndex { get; set; }
[Parameter]
public RadzenDataGridRow<TItem> Row { get; set; }
[Parameter]
public EditContext EditContext { get; set; }
[Parameter]
public RenderFragment ChildContent { get; set; }
@@ -30,7 +86,7 @@
{
if (Grid != null)
{
#if NET5
#if NET5_0_OR_GREATER
await Grid.OnCellContextMenu(new DataGridCellMouseEventArgs<TItem>
{
Data = Item,
@@ -72,12 +128,58 @@
}
}
bool clicking;
async Task OnClick(MouseEventArgs args)
{
if (clicking)
{
return;
}
try
{
clicking = true;
if (Grid != null)
{
#if NET5
#if NET5_0_OR_GREATER
await Grid.OnCellClick(new DataGridCellMouseEventArgs<TItem>
{
Data = Item,
AltKey = args.AltKey,
Button = args.Button,
Buttons = args.Buttons,
ClientX = args.ClientX,
ClientY = args.ClientY,
CtrlKey = args.CtrlKey,
Detail = args.Detail,
MetaKey = args.MetaKey,
OffsetX = args.OffsetX,
OffsetY = args.OffsetY,
ScreenX = args.ScreenX,
ScreenY = args.ScreenY,
ShiftKey = args.ShiftKey,
Type = args.Type,
Column = Column
});
#else
await Grid.OnCellClick(new DataGridCellMouseEventArgs<TItem>
{
Data = Item,
AltKey = args.AltKey,
Button = args.Button,
Buttons = args.Buttons,
ClientX = args.ClientX,
ClientY = args.ClientY,
CtrlKey = args.CtrlKey,
Detail = args.Detail,
MetaKey = args.MetaKey,
ScreenX = args.ScreenX,
ScreenY = args.ScreenY,
ShiftKey = args.ShiftKey,
Type = args.Type,
Column = Column
});
#endif
#if NET5_0_OR_GREATER
await Grid.OnRowClick(new DataGridRowMouseEventArgs<TItem>
{
Data = Item,
@@ -114,6 +216,11 @@
Type = args.Type
});
#endif
}
}
finally
{
clicking = false;
}
}
@@ -121,7 +228,46 @@
{
if (Grid != null)
{
#if NET5
#if NET5_0_OR_GREATER
await Grid.OnCellDblClick(new DataGridCellMouseEventArgs<TItem>
{
Data = Item,
AltKey = args.AltKey,
Button = args.Button,
Buttons = args.Buttons,
ClientX = args.ClientX,
ClientY = args.ClientY,
CtrlKey = args.CtrlKey,
Detail = args.Detail,
MetaKey = args.MetaKey,
OffsetX = args.OffsetX,
OffsetY = args.OffsetY,
ScreenX = args.ScreenX,
ScreenY = args.ScreenY,
ShiftKey = args.ShiftKey,
Type = args.Type,
Column = Column
});
#else
await Grid.OnCellDblClick(new DataGridCellMouseEventArgs<TItem>
{
Data = Item,
AltKey = args.AltKey,
Button = args.Button,
Buttons = args.Buttons,
ClientX = args.ClientX,
ClientY = args.ClientY,
CtrlKey = args.CtrlKey,
Detail = args.Detail,
MetaKey = args.MetaKey,
ScreenX = args.ScreenX,
ScreenY = args.ScreenY,
ShiftKey = args.ShiftKey,
Type = args.Type,
Column = Column
});
#endif
#if NET5_0_OR_GREATER
await Grid.OnRowDblClick(new DataGridRowMouseEventArgs<TItem>
{
Data = Item,

View File

@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -22,6 +23,74 @@ namespace Radzen.Blazor
[CascadingParameter]
public RadzenDataGrid<TItem> Grid { get; set; }
/// <summary>
/// Gets or sets the columns.
/// </summary>
/// <value>The columns.</value>
[Parameter]
public RenderFragment Columns { get; set; }
/// <summary>
/// Gets or sets the parent column.
/// </summary>
/// <value>The parent column.</value>
[CascadingParameter]
public RadzenDataGridColumn<TItem> Parent { get; set; }
internal void RemoveColumn(RadzenDataGridColumn<TItem> column)
{
if (Grid.childColumns.Contains(column))
{
Grid.childColumns.Remove(column);
if (!Grid.disposed)
{
try { InvokeAsync(StateHasChanged); } catch { }
}
}
}
internal int GetLevel()
{
int i = 0;
var p = Parent;
while (p != null)
{
p = p.Parent;
i++;
}
return i;
}
internal int GetColSpan(bool isDataCell = false)
{
if (!Grid.AllowCompositeDataCells && isDataCell)
return 1;
var directChildColumns = Grid.childColumns.Where(c => c.GetVisible() && c.Parent == this);
if (Parent == null)
{
return Columns == null ? 1 : directChildColumns.Sum(c => c.GetColSpan());
}
return Columns == null ? 1 : directChildColumns.Count();
}
internal int GetRowSpan(bool isDataCell = false)
{
if (!Grid.AllowCompositeDataCells && isDataCell)
return 1;
if (Columns == null && Parent != null)
{
var level = this.GetLevel();
return level == Grid.deepestChildColumnLevel ? 1 : level + 1;
}
return Columns == null && Parent == null ? Grid.deepestChildColumnLevel + 1 : 1;
}
/// <summary>
/// Called when initialized.
/// </summary>
@@ -31,16 +100,16 @@ namespace Radzen.Blazor
{
Grid.AddColumn(this);
if (!string.IsNullOrEmpty(FilterProperty) || Type == null)
{
var property = GetFilterProperty();
var property = GetFilterProperty();
if (!string.IsNullOrEmpty(property) && Type == null)
{
if (!string.IsNullOrEmpty(property))
{
_filterPropertyType = PropertyAccess.GetPropertyType(typeof(TItem), property);
}
}
if (_filterPropertyType == null)
{
_filterPropertyType = Type;
@@ -57,6 +126,25 @@ namespace Radzen.Blazor
}
}
int? orderIndex;
/// <summary>
/// Gets or sets the order index.
/// </summary>
/// <value>The order index.</value>
[Parameter]
public int? OrderIndex { get; set; }
internal int? GetOrderIndex()
{
return orderIndex ?? OrderIndex;
}
internal void SetOrderIndex(int? value)
{
orderIndex = value;
}
/// <summary>
/// Gets or sets the sort order.
/// </summary>
@@ -64,12 +152,53 @@ namespace Radzen.Blazor
[Parameter]
public SortOrder? SortOrder { get; set; }
bool visible = true;
/// <summary>
/// Gets or sets a value indicating whether this <see cref="RadzenDataGridColumn{TItem}"/> is visible.
/// </summary>
/// <value><c>true</c> if visible; otherwise, <c>false</c>.</value>
[Parameter]
public bool Visible { get; set; } = true;
public bool Visible
{
get
{
return visible;
}
set
{
if (visible != value)
{
visible = value;
if (Grid != null)
{
Grid.UpdatePickableColumn(this, visible);
InvokeAsync(Grid.ChangeState);
}
}
}
}
bool? _visible;
/// <summary>
/// Gets if the column is visible or not.
/// </summary>
/// <returns>System.Boolean.</returns>
public bool GetVisible()
{
return _visible ?? Visible;
}
internal void SetVisible(bool? value)
{
_visible = value;
if (Grid != null)
{
Grid.UpdatePickableColumn(this, _visible == true);
}
}
/// <summary>
/// Gets or sets the title.
@@ -127,6 +256,13 @@ namespace Radzen.Blazor
[Parameter]
public string Width { get; set; }
/// <summary>
/// Gets or sets the min-width.
/// </summary>
/// <value>The min-width.</value>
[Parameter]
public string MinWidth { get; set; }
/// <summary>
/// Gets or sets the format string.
/// </summary>
@@ -204,6 +340,13 @@ namespace Radzen.Blazor
[Parameter]
public bool Groupable { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether this <see cref="RadzenDataGridColumn{TItem}"/> is pickable - listed when DataGrid AllowColumnPicking is set to true.
/// </summary>
/// <value><c>true</c> if pickable; otherwise, <c>false</c>.</value>
[Parameter]
public bool Pickable { get; set; } = true;
/// <summary>
/// Gets or sets the text align.
/// </summary>
@@ -274,11 +417,20 @@ namespace Radzen.Blazor
/// </summary>
/// <param name="item">The item.</param>
/// <returns>System.Object.</returns>
public object GetValue(TItem item)
public virtual object GetValue(TItem item)
{
var value = propertyValueGetter != null && !string.IsNullOrEmpty(Property) && !Property.Contains('.') ? propertyValueGetter(item) : !string.IsNullOrEmpty(Property) ? PropertyAccess.GetValue(item, Property) : "";
return !string.IsNullOrEmpty(FormatString) ? string.Format(FormatString, value, Grid?.Culture ?? CultureInfo.CurrentCulture) : Convert.ToString(value, Grid?.Culture ?? CultureInfo.CurrentCulture);
if ((PropertyAccess.IsEnum(FilterPropertyType) || PropertyAccess.IsNullableEnum(FilterPropertyType)) && value != null)
{
var enumValue = value as Enum;
if (enumValue != null)
{
value = EnumExtensions.GetDisplayDescription(enumValue);
}
}
return !string.IsNullOrEmpty(FormatString) ? string.Format(Grid?.Culture ?? CultureInfo.CurrentCulture, FormatString, value) : Convert.ToString(value, Grid?.Culture ?? CultureInfo.CurrentCulture);
}
internal object GetHeader()
@@ -323,10 +475,11 @@ namespace Radzen.Blazor
style.Add($"text-align:{Enum.GetName(typeof(TextAlign), TextAlign).ToLower()};");
}
if (forCell && Frozen)
if (forCell && IsFrozen())
{
var left = Grid.ColumnsCollection
.TakeWhile((c, i) => Grid.ColumnsCollection.IndexOf(this) > i && c.Frozen)
var visibleColumns = Grid.ColumnsCollection.Where(c => c.GetVisible()).ToList();
var left = visibleColumns
.Where((c, i) => visibleColumns.IndexOf(this) > i && c.IsFrozen())
.Sum(c => {
var w = !string.IsNullOrEmpty(c.GetWidth()) ? c.GetWidth() : Grid.ColumnWidth;
var cw = 200;
@@ -340,14 +493,24 @@ namespace Radzen.Blazor
style.Add($"left:{left}px");
}
if ((isHeaderOrFooterCell && Frozen || isHeaderOrFooterCell && !Frozen || !isHeaderOrFooterCell && Frozen) && Grid.ColumnsCollection.Where(c => c.Visible && c.Frozen).Any())
if ((isHeaderOrFooterCell && IsFrozen() || isHeaderOrFooterCell && !IsFrozen() || !isHeaderOrFooterCell && IsFrozen()) && Grid.ColumnsCollection.Where(c => c.GetVisible() && c.IsFrozen()).Any())
{
style.Add($"z-index:{(isHeaderOrFooterCell && Frozen ? 2 : 1)}");
style.Add($"z-index:{(isHeaderOrFooterCell && IsFrozen() ? 2 : 1)}");
}
if (!string.IsNullOrEmpty(MinWidth))
{
style.Add($"min-width:{MinWidth}");
}
return string.Join(";", style);
}
internal bool IsFrozen()
{
return Frozen && Parent == null && Columns == null;
}
/// <summary>
/// Gets the sort property.
/// </summary>
@@ -374,6 +537,42 @@ namespace Radzen.Blazor
}
internal void SetSortOrder(SortOrder? order)
{
var descriptor = Grid.sorts.Where(d => d.Property == GetSortProperty()).FirstOrDefault();
if (descriptor == null)
{
descriptor = new SortDescriptor() { Property = GetSortProperty() };
}
if (GetSortOrder() == null)
{
SetSortOrderInternal(Radzen.SortOrder.Ascending);
descriptor.SortOrder = Radzen.SortOrder.Ascending;
}
else if (GetSortOrder() == Radzen.SortOrder.Ascending)
{
SetSortOrderInternal(Radzen.SortOrder.Descending);
descriptor.SortOrder = Radzen.SortOrder.Descending;
}
else if (GetSortOrder() == Radzen.SortOrder.Descending)
{
SetSortOrderInternal(null);
if (Grid.sorts.Where(d => d.Property == GetSortProperty()).Any())
{
Grid.sorts.Remove(descriptor);
}
descriptor = null;
}
if (descriptor != null && !Grid.sorts.Where(d => d.Property == GetSortProperty()).Any())
{
Grid.sorts.Add(descriptor);
}
sortOrder = new SortOrder?[] { order };
}
internal void SetSortOrderInternal(SortOrder? order)
{
sortOrder = new SortOrder?[] { order };
}
@@ -417,7 +616,10 @@ namespace Radzen.Blazor
Type _filterPropertyType;
internal Type FilterPropertyType
/// <summary>
/// Gets the filter property type.
/// </summary>
public Type FilterPropertyType
{
get
{
@@ -444,22 +646,63 @@ namespace Radzen.Blazor
{
if (Grid != null)
{
Grid.UpdatePickableColumn(this, parameters.GetValueOrDefault<bool>(nameof(Visible)));
await Grid.ChangeState();
}
}
if (parameters.DidParameterChange(nameof(OrderIndex), OrderIndex))
{
var newOrderIndex = parameters.GetValueOrDefault<int?>(nameof(OrderIndex));
if (newOrderIndex != orderIndex)
{
SetOrderIndex(newOrderIndex);
if (Grid != null)
{
Grid.UpdateColumnsOrder();
await Grid.ChangeState();
}
}
}
if (parameters.DidParameterChange(nameof(SortOrder), SortOrder))
{
sortOrder = new SortOrder?[] { parameters.GetValueOrDefault<SortOrder?>(nameof(SortOrder)) };
if (Grid != null)
{
var descriptor = Grid.sorts.Where(d => d.Property == GetSortProperty()).FirstOrDefault();
if (descriptor == null)
{
Grid.sorts.Add(new SortDescriptor() { Property = GetSortProperty(), SortOrder = sortOrder.FirstOrDefault() });
Grid._view = null;
}
}
}
if (parameters.DidParameterChange(nameof(FilterValue), FilterValue))
{
filterValue = parameters.GetValueOrDefault<object>(nameof(FilterValue));
if (FilterTemplate != null)
{
FilterValue = filterValue;
await Grid.Reload();
Grid.SaveSettings();
if (Grid.IsVirtualizationAllowed())
{
#if NET5_0_OR_GREATER
if (Grid.virtualize != null)
{
await Grid.virtualize.RefreshDataAsync();
}
#endif
}
else
{
await Grid.Reload();
}
return;
}
}
@@ -487,37 +730,58 @@ namespace Radzen.Blazor
await base.SetParametersAsync(parameters);
}
internal SortOrder? GetSortOrder()
/// <summary>
/// Get column sort order.
/// </summary>
public SortOrder? GetSortOrder()
{
return sortOrder.Any() ? sortOrder.FirstOrDefault() : SortOrder;
}
internal object GetFilterValue()
/// <summary>
/// Get column filter value.
/// </summary>
public object GetFilterValue()
{
return filterValue ?? FilterValue;
}
internal FilterOperator GetFilterOperator()
/// <summary>
/// Get column filter operator.
/// </summary>
public FilterOperator GetFilterOperator()
{
return filterOperator ?? FilterOperator;
}
internal object GetSecondFilterValue()
/// <summary>
/// Get column second filter value.
/// </summary>
public object GetSecondFilterValue()
{
return secondFilterValue ?? SecondFilterValue;
}
internal FilterOperator GetSecondFilterOperator()
/// <summary>
/// Get column second filter operator.
/// </summary>
public FilterOperator GetSecondFilterOperator()
{
return secondFilterOperator ?? SecondFilterOperator;
}
internal LogicalFilterOperator GetLogicalFilterOperator()
/// <summary>
/// Get column logical filter operator.
/// </summary>
public LogicalFilterOperator GetLogicalFilterOperator()
{
return logicalFilterOperator ?? LogicalFilterOperator;
}
internal void SetFilterValue(object value, bool isFirst = true)
/// <summary>
/// Set column filter value.
/// </summary>
public void SetFilterValue(object value, bool isFirst = true)
{
if ((FilterPropertyType == typeof(DateTimeOffset) || FilterPropertyType == typeof(DateTimeOffset?)) && value != null && value is DateTime?)
{
@@ -535,6 +799,31 @@ namespace Radzen.Blazor
}
}
internal bool CanSetFilterValue()
{
return GetFilterOperator() == FilterOperator.IsNull
|| GetFilterOperator() == FilterOperator.IsNotNull
|| GetFilterOperator() == FilterOperator.IsEmpty
|| GetFilterOperator() == FilterOperator.IsNotEmpty;
}
/// <summary>
/// Sets to default column filter values and operators.
/// </summary>
public void ClearFilters()
{
SetFilterValue(null);
SetFilterValue(null, false);
SetFilterOperator(null);
SetSecondFilterOperator(null);
FilterValue = null;
SecondFilterValue = null;
FilterOperator = typeof(System.Collections.IEnumerable).IsAssignableFrom(FilterPropertyType) ? FilterOperator.Contains : default(FilterOperator);
SecondFilterOperator = default(FilterOperator);
LogicalFilterOperator = default(LogicalFilterOperator);
}
/// <summary>
/// Gets or sets the filter operator.
/// </summary>
@@ -549,40 +838,85 @@ namespace Radzen.Blazor
[Parameter]
public FilterOperator SecondFilterOperator { get; set; }
internal void SetFilterOperator(FilterOperator? value)
/// <summary>
/// Set column filter operator.
/// </summary>
public void SetFilterOperator(FilterOperator? value)
{
if (value == FilterOperator.IsEmpty || value == FilterOperator.IsNotEmpty || value == FilterOperator.IsNull || value == FilterOperator.IsNotNull)
{
filterValue = value == FilterOperator.IsEmpty || value == FilterOperator.IsNotEmpty ? string.Empty : null;
}
filterOperator = value;
}
internal void SetSecondFilterOperator(FilterOperator? value)
/// <summary>
/// Set column second filter operator.
/// </summary>
public void SetSecondFilterOperator(FilterOperator? value)
{
if (value == FilterOperator.IsEmpty || value == FilterOperator.IsNotEmpty || value == FilterOperator.IsNull || value == FilterOperator.IsNotNull)
{
secondFilterValue = value == FilterOperator.IsEmpty || value == FilterOperator.IsNotEmpty ? string.Empty : null;
}
secondFilterOperator = value;
}
internal void SetLogicalFilterOperator(LogicalFilterOperator value)
/// <summary>
/// Set column second logical operator.
/// </summary>
public void SetLogicalFilterOperator(LogicalFilterOperator value)
{
LogicalFilterOperator = value;
}
/// <summary>
/// Closes this column filter popup.
/// </summary>
public async Task CloseFilter()
{
await Grid.GetJSRuntime().InvokeVoidAsync("Radzen.closePopup", $"{Grid.PopupID}{GetFilterProperty()}");
}
string runtimeWidth;
internal void SetWidth(string value)
/// <summary>
/// Set column width.
/// </summary>
public void SetWidth(string value)
{
runtimeWidth = value;
}
internal string GetWidth()
/// <summary>
/// Get column width.
/// </summary>
public string GetWidth()
{
return !string.IsNullOrEmpty(runtimeWidth) ? runtimeWidth : Width;
}
internal IEnumerable<FilterOperator> GetFilterOperators()
/// <summary>
/// Get possible column filter operators.
/// </summary>
public virtual IEnumerable<FilterOperator> GetFilterOperators()
{
if (PropertyAccess.IsEnum(FilterPropertyType))
return new FilterOperator[] { FilterOperator.Equals, FilterOperator.NotEquals };
if (PropertyAccess.IsNullableEnum(FilterPropertyType))
return new FilterOperator[] { FilterOperator.Equals, FilterOperator.NotEquals, FilterOperator.IsNull, FilterOperator.IsNotNull };
return Enum.GetValues(typeof(FilterOperator)).Cast<FilterOperator>().Where(o => {
var isStringOperator = o == FilterOperator.Contains || o == FilterOperator.DoesNotContain || o == FilterOperator.StartsWith || o == FilterOperator.EndsWith;
var isStringOperator = o == FilterOperator.Contains || o == FilterOperator.DoesNotContain
|| o == FilterOperator.StartsWith || o == FilterOperator.EndsWith || o == FilterOperator.IsEmpty || o == FilterOperator.IsNotEmpty;
return FilterPropertyType == typeof(string) ? isStringOperator
|| o == FilterOperator.Equals || o == FilterOperator.NotEquals || o == FilterOperator.IsNull || o == FilterOperator.IsNotNull
: !isStringOperator;
|| o == FilterOperator.Equals || o == FilterOperator.NotEquals
|| o == FilterOperator.IsNull || o == FilterOperator.IsNotNull
: !isStringOperator;
});
}
@@ -612,13 +946,64 @@ namespace Radzen.Blazor
return Grid?.NotEqualsText;
case FilterOperator.IsNull:
return Grid?.IsNullText;
case FilterOperator.IsEmpty:
return Grid?.IsEmptyText;
case FilterOperator.IsNotNull:
return Grid?.IsNotNullText;
case FilterOperator.IsNotEmpty:
return Grid?.IsNotEmptyText;
default:
return $"{filterOperator}";
}
}
internal string GetFilterOperatorSymbol(FilterOperator filterOperator)
{
var symbol = Grid.FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive ? "a" : "A";
switch (filterOperator)
{
case FilterOperator.Contains:
return $"*{symbol}*";
case FilterOperator.DoesNotContain:
return $"*{symbol}*";
case FilterOperator.StartsWith:
return $"{symbol}**";
case FilterOperator.EndsWith:
return $"**{symbol}";
case FilterOperator.Equals:
return "=";
case FilterOperator.GreaterThan:
return ">";
case FilterOperator.GreaterThanOrEquals:
return "≥";
case FilterOperator.LessThan:
return "<";
case FilterOperator.LessThanOrEquals:
return "≤";
case FilterOperator.NotEquals:
return "≠";
case FilterOperator.IsNull:
return "∅";
case FilterOperator.IsNotNull:
return "!∅";
case FilterOperator.IsEmpty:
return "= ''";
case FilterOperator.IsNotEmpty:
return "≠ ''";
default:
return $"{filterOperator}";
}
}
/// <summary>
/// Gets value indicating if the user can specify time in DateTime column filter.
/// </summary>
public virtual bool ShowTimeForDateTimeFilter()
{
return true;
}
/// <summary>
/// Disposes this instance.
/// </summary>
@@ -627,4 +1012,4 @@ namespace Radzen.Blazor
Grid?.RemoveColumn(this);
}
}
}
}

View File

@@ -0,0 +1,11 @@
@typeparam TItem
@inherits ComponentBase
@if (Columns != null)
{
<CascadingValue Value=this.Grid>
<CascadingValue Value=this>
@Columns
</CascadingValue>
</CascadingValue>
}

View File

@@ -0,0 +1,181 @@
@typeparam TItem
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.JSInterop
@inject IJSRuntime JSRuntime
<button title=@Column.GetFilterOperatorText(Column.GetFilterOperator()) class="@FilterIconStyle()" onclick="@($"Radzen.togglePopup(this.parentNode, '{Grid.PopupID}{Column.GetFilterProperty()}')")">
<i class="rzi">filter_alt</i>
@if (Column.GetFilterOperator() == FilterOperator.DoesNotContain)
{
<s>@Column.GetFilterOperatorSymbol(Column.GetFilterOperator())</s>
}
else
{
@Column.GetFilterOperatorSymbol(Column.GetFilterOperator())
}
</button>
<div id="@($"{Grid.PopupID}{Column.GetFilterProperty()}")" class="rz-overlaypanel"
style="display:none;" tabindex="0">
<div class="rz-overlaypanel-content">
<ul class="rz-listbox-list">
@if (Column.FilterPropertyType == typeof(string))
{
@if (Column.GetFilterOperators().Contains(FilterOperator.Contains))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.Contains))" @onclick="@(args => ApplyFilter(FilterOperator.Contains))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.Contains)</span><span>@Grid.ContainsText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.DoesNotContain))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.DoesNotContain))" @onclick="@(args => ApplyFilter(FilterOperator.DoesNotContain))" style="display: block;">
<span class="rz-filter-menu-symbol"><s>@Column.GetFilterOperatorSymbol(FilterOperator.DoesNotContain)</s></span><span>@Grid.DoesNotContainText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.StartsWith))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.StartsWith))" @onclick="@(args => ApplyFilter(FilterOperator.StartsWith))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.StartsWith)</span><span>@Grid.StartsWithText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.EndsWith))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.EndsWith))" @onclick="@(args => ApplyFilter(FilterOperator.EndsWith))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.EndsWith)</span><span>@Grid.EndsWithText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.IsEmpty))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.IsEmpty))" @onclick="@(args => ApplyFilter(FilterOperator.IsEmpty))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.IsEmpty)</span><span>@Grid.IsEmptyText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.IsNotEmpty))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.IsNotEmpty))" @onclick="@(args => ApplyFilter(FilterOperator.IsNotEmpty))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.IsNotEmpty)</span><span>@Grid.IsNotEmptyText</span>
</li>
}
}
@if (Column.GetFilterOperators().Contains(FilterOperator.Equals))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.Equals))" @onclick="@(args => ApplyFilter(FilterOperator.Equals))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.Equals)</span><span>@Grid.EqualsText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.NotEquals))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.NotEquals))" @onclick="@(args => ApplyFilter(FilterOperator.NotEquals))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.NotEquals)</span><span>@Grid.NotEqualsText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.LessThan))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.LessThan))" @onclick="@(args => ApplyFilter(FilterOperator.LessThan))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.LessThan)</span><span>@Grid.LessThanText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.LessThanOrEquals))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.LessThanOrEquals))" @onclick="@(args => ApplyFilter(FilterOperator.LessThanOrEquals))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.LessThanOrEquals)</span><span>@Grid.LessThanOrEqualsText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.GreaterThan))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.GreaterThan))" @onclick="@(args => ApplyFilter(FilterOperator.GreaterThan))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.GreaterThan)</span><span>@Grid.GreaterThanText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.GreaterThanOrEquals))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.GreaterThanOrEquals))" @onclick="@(args => ApplyFilter(FilterOperator.GreaterThanOrEquals))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.GreaterThanOrEquals)</span><span>@Grid.GreaterThanOrEqualsText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.IsNull))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.IsNull))" @onclick="@(args => ApplyFilter(FilterOperator.IsNull))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.IsNull)</span><span>@Grid.IsNullText</span>
</li>
}
@if (Column.GetFilterOperators().Contains(FilterOperator.IsNotNull))
{
<li class="@(FilterOperatorStyle(Column, FilterOperator.IsNotNull))" @onclick="@(args => ApplyFilter(FilterOperator.IsNotNull))" style="display: block;">
<span class="rz-filter-menu-symbol">@Column.GetFilterOperatorSymbol(FilterOperator.IsNotNull)</span><span>@Grid.IsNotNullText</span>
</li>
}
<li class="rz-multiselect-item" @onclick="@(args => ClearFilter())" style="display:block;">
<span class="rz-filter-menu-symbol">x</span><span>@Grid.ClearFilterText</span>
</li>
</ul>
</div>
</div>
@code {
[Parameter]
public RadzenDataGridColumn<TItem> Column { get; set; }
[Parameter]
public RadzenDataGrid<TItem> Grid { get; set; }
protected string FilterOperatorStyle(RadzenDataGridColumn<TItem> column, FilterOperator value)
{
return column.GetFilterOperator() == value ?
"rz-multiselect-item rz-state-highlight" :
"rz-multiselect-item";
}
protected string FilterIconStyle()
{
var additionalStyle = Column.GetFilterValue() != null || Column.GetSecondFilterValue() != null ||
Column.GetFilterOperator() == FilterOperator.IsNotNull || Column.GetFilterOperator() == FilterOperator.IsNull
|| Column.GetFilterOperator() == FilterOperator.IsEmpty || Column.GetFilterOperator() == FilterOperator.IsNotEmpty
? "rz-grid-filter-active" : "";
return $"rz-filter-button rz-button rz-button-md rz-button-icon-only rz-variant-flat rz-light {additionalStyle}";
}
protected async Task ApplyFilter(FilterOperator value)
{
if (value == FilterOperator.IsNull || value == FilterOperator.IsNotNull
|| value == FilterOperator.IsEmpty || value == FilterOperator.IsNotEmpty)
{
Column.SetFilterValue(value == FilterOperator.IsEmpty || value == FilterOperator.IsNotEmpty ? string.Empty : null);
Column.SetFilterValue(null, false);
}
Column.SetFilterOperator(value);
Grid.SaveSettings();
await Grid.Filter.InvokeAsync(new DataGridColumnFilterEventArgs<TItem>()
{
Column = Column,
FilterValue = Column.GetFilterValue(),
SecondFilterValue = Column.GetSecondFilterValue(),
FilterOperator = Column.GetFilterOperator(),
SecondFilterOperator = Column.GetSecondFilterOperator(),
LogicalFilterOperator = Column.GetLogicalFilterOperator()
});
await JSRuntime.InvokeVoidAsync("Radzen.closePopup", $"{Grid.PopupID}{Column.GetFilterProperty()}");
await Grid.Reload();
}
protected async Task ClearFilter()
{
Column.ClearFilters();
await JSRuntime.InvokeVoidAsync("Radzen.closePopup", $"{Grid.PopupID}{Column.GetFilterProperty()}");
await Grid.FilterCleared.InvokeAsync(new DataGridColumnFilterEventArgs<TItem>()
{
Column = Column,
FilterValue = Column.GetFilterValue(),
SecondFilterValue = Column.GetSecondFilterValue(),
FilterOperator = Column.GetFilterOperator(),
SecondFilterOperator = Column.GetSecondFilterOperator(),
LogicalFilterOperator = Column.GetLogicalFilterOperator()
});
await Grid.Reload();
}
}

View File

@@ -0,0 +1,37 @@
@typeparam TItem
@if (RowIndex == Column.GetLevel())
{
<td rowspan="@(Column.GetRowSpan())" colspan="@(Column.GetColSpan())" @attributes="@Attributes" class="@CssClass" scope="col" style="@Column.GetStyle(true, true)">
<span class="rz-column-footer">
@if (Column.FooterTemplate != null)
{
@Column.FooterTemplate
}
</span>
</td>
}
else
{
@foreach(var column in Grid.childColumns.Where(c => c.GetVisible() && c.Parent == Column))
{
<RadzenDataGridFooterCell RowIndex="@RowIndex" Grid="@Grid" Column="@column"
CssClass="@($"{Column.FooterCssClass} {Grid.getFrozenColumnClass(column, Grid.ColumnsCollection.Where(c => c.GetVisible()).ToList())} {Grid.getCompositeCellCSSClass(column)}")"
Attributes="@(Attributes)" />
}
}
@code {
[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, object> Attributes { get; set; }
[Parameter]
public RadzenDataGridColumn<TItem> Column { get; set; }
[Parameter]
public int RowIndex { get; set; }
[Parameter]
public RadzenDataGrid<TItem> Grid { get; set; }
[Parameter]
public string CssClass { get; set; }
}

View File

@@ -1,6 +1,12 @@
@typeparam TItem
@using System.Linq.Dynamic.Core
<tr>
@if (Grid.Template != null && Grid.ShowExpandColumn)
{
<th class="rz-col-icon rz-unselectable-text" scope="col">
<span class="rz-column-title"></span>
</th>
}
@for(var i = 0; i < GetLevel(); i++)
{
<td class="rz-col-icon">
@@ -43,7 +49,7 @@
Group = new Group()
{
Level = level,
GroupDescriptor = Grid.groups[level],
GroupDescriptor = Grid.Groups[level],
Data = _groupResult
};
}

View File

@@ -1,41 +1,60 @@
@typeparam TItem
@using System.Linq.Dynamic.Core
<tr>
@for(var i = 0; i < GetLevel(); i++)
@{
var rowArgs = Grid?.GroupRowAttributes(this);
}
<tr class="rz-group-row" @attributes="@rowArgs.Item2">
@if (Group.GroupDescriptor != null)
{
<td class="rz-col-icon">
<span class="rz-column-title"></span>
</td>
@for (var i = 0; i < GetLevel(); i++)
{
<td class="rz-col-icon">
<span class="rz-column-title"></span>
</td>
}
}
<td class="rz-col-icon">
<span class="rz-column-title"></span>
<a href="javascript:void(0)" @onclick="@(_ => Grid.ExpandGroupItem(this))">
<span class="@(Grid.ExpandedGroupItemStyle(this))"></span>
<a href="javascript:void(0)" @onclick="@(_ => Grid.ExpandGroupItem(this, rowArgs.Item1.Expanded))">
<span class="@(Grid.ExpandedGroupItemStyle(this, Grid.allGroupsExpanded != null ? Grid.allGroupsExpanded : rowArgs.Item1.Expanded))"></span>
</a>
</td>
<td colspan="@(Columns.Count + Grid.groups.Count - 1 - Group.Level)">
<td colspan="@(Columns.Count + Grid.Groups.Count - 1 - Group.Level + (Grid.Template != null && Grid.ShowExpandColumn ? 1 : 0))">
<span class="rz-cell-data">
@if (Grid.GroupHeaderTemplate != null)
{
@Grid.GroupHeaderTemplate(Group)
}
else
else if(Group.GroupDescriptor != null)
{
@(Group.GroupDescriptor.GetTitle() + ": " + Group.Data.Key)
@(Group.GroupDescriptor.GetTitle() + ": " + (Group.Data.Key != null ? Group.Data.Key.ToString() : ""))
}
</span>
</td>
</tr>
@if(Grid != null)
{
if (Grid.IsGroupItemExpanded(this))
if (Grid.IsGroupItemExpanded(this) && rowArgs.Item1.Expanded != false && Grid.allGroupsExpanded != false)
{
@DrawDataRows()
}
else if(Grid.GroupFootersAlwaysVisible)
{
if (!Grid.collapsedGroupItems.Keys.Contains(this))
{
Grid.collapsedGroupItems.Add(this, true);
}
@DrawDataRows(true)
}
else
{
if (!Grid.collapsedGroupItems.Keys.Contains(this))
{
Grid.collapsedGroupItems.Add(this, true);
}
}
}
@code {
[Parameter]
@@ -59,7 +78,7 @@
Group = new Group()
{
Level = level,
GroupDescriptor = Grid.groups[level],
GroupDescriptor = Grid.Groups?.ElementAtOrDefault(level),
Data = _groupResult
};
}
@@ -106,6 +125,12 @@
builder.AddAttribute(4, "TItem", typeof(TItem));
builder.AddAttribute(5, "Item", item);
builder.AddAttribute(6, "InEditMode", Grid.IsRowInEditMode((TItem)item));
if (Grid.editContexts.ContainsKey((TItem)item))
{
builder.AddAttribute(7, nameof(RadzenDataGridRow<TItem>.EditContext), Grid.editContexts[(TItem)item]);
}
builder.CloseComponent();
i++;
}

View File

@@ -0,0 +1,234 @@
@typeparam TItem
@using Radzen.Blazor.Rendering
@if (RowIndex == Column.GetLevel())
{
<th rowspan="@(Column.GetRowSpan())" colspan="@(Column.GetColSpan())" @attributes="@Attributes" class="@CssClass" scope="col" style="@Column.GetStyle(true, true)" @onmouseup=@(args => Grid.EndColumnReorder(args, ColumnIndex)) >
<div @onclick='@((args) => Grid.OnSort(args, Column))' tabindex="@SortingTabIndex" @onkeydown="OnSortKeyPressed">
@if (Column.Parent == null && Column.Columns == null && (Grid.AllowColumnReorder && Column.Reorderable || Grid.AllowGrouping && Column.Groupable))
{
<span id="@Grid.getColumnResizerId(ColumnIndex)" class="rz-column-drag"
@onclick:preventDefault="true" @onclick:stopPropagation="true"
@onmousedown:preventDefault="true"
@onmousedown=@(args => Grid.StartColumnReorder(args, ColumnIndex))></span>
}
<span class="rz-column-title" title="@Column.Title">
@if (Column.HeaderTemplate != null)
{
<span class="rz-column-title-content">@Column.HeaderTemplate</span>
}
else
{
<span class="rz-column-title-content">@Column.Title</span>
}
@if (Grid.AllowSorting && Column.Sortable)
{
@if (Column.GetSortOrder() == SortOrder.Ascending)
{
<span class="rz-sortable-column-icon rzi-grid-sort rzi-sort rzi-sort-asc"></span>
@if(Grid.ShowMultiColumnSortingIndex)
{
<RadzenBadge BadgeStyle="BadgeStyle.Info" Shade="Shade.Lighter" IsPill=true Text="@getSortIndex()" />
}
}
else if (Column.GetSortOrder() == SortOrder.Descending)
{
<span class="rz-sortable-column-icon rzi-grid-sort rzi-sort rzi-sort-desc"></span>
@if(Grid.ShowMultiColumnSortingIndex)
{
<RadzenBadge BadgeStyle="BadgeStyle.Info" Shade="Shade.Lighter" IsPill=true Text="@getSortIndex()" />
}
}
else
{
<span class="rz-sortable-column-icon rzi-grid-sort rzi-sort"></span>
}
}
</span>
@if (Grid.AllowColumnResize && Column.Resizable && Column.Parent == null)
{
<div id="@Grid.getColumnResizerId(ColumnIndex)" style="cursor:col-resize;float:right;"
@onclick:preventDefault="true" @onclick:stopPropagation="true" class="rz-column-resizer"
@onmousedown:preventDefault="true"
@onmousedown=@(args => Grid.StartColumnResize(args, ColumnIndex))>&nbsp;</div>
}
@if (Grid.AllowFiltering && Column.Filterable && Grid.FilterMode == FilterMode.Advanced)
{
<i @ref=@filterButton @onclick:stopPropagation="true" @onmousedown=@ToggleFilter
class="@getFilterIconCss(Column)" onclick=@getFilterOpen() />
<Popup Lazy=@(Grid.FilterPopupRenderMode == PopupRenderMode.OnDemand) @ref=popup id="@($"{getColumnPopupID()}")" class="rz-overlaypanel"
style="display:none;min-width:250px;" tabindex="0">
<div class="rz-overlaypanel-content">
@if (Column.FilterTemplate != null)
{
@Column.FilterTemplate(Column)
}
else
{
<form id="@($"{getColumnPopupID()}-form")" @onsubmit="@(args => ApplyFilter())" class="rz-grid-filter">
<RadzenLabel Text="@Grid.FilterText" class="rz-grid-filter-label" />
<RadzenDropDown @onclick:preventDefault="true" Data="@(Column.GetFilterOperators().Select(t => new { Value = Column.GetFilterOperatorText(t), Key = t }))" TextProperty="Value" ValueProperty="Key" TValue="FilterOperator" Value="@Column.GetFilterOperator()" Change="@(args => Column.SetFilterOperator((FilterOperator)args))" />
@if (PropertyAccess.IsNullableEnum(Column.FilterPropertyType) || PropertyAccess.IsEnum(Column.FilterPropertyType))
{
<RadzenDropDown AllowClear="false" AllowFiltering="false" TValue="@object"
Value=@Column.GetFilterValue() Multiple="false" Placeholder="@Grid.EnumFilterSelectText" TextProperty="Text" ValueProperty="Value" Data=@EnumExtensions.EnumAsKeyValuePair(Nullable.GetUnderlyingType(Column.FilterPropertyType) ?? Column.FilterPropertyType)
Change="@(args => Column.SetFilterValue(args))" />
}
else if (PropertyAccess.IsNumeric(Column.FilterPropertyType))
{
@(Grid.DrawNumericFilter(Column, false))
}
else if (PropertyAccess.IsDate(Column.FilterPropertyType))
{
<RadzenDatePicker TValue="@object" ShowTime="true" ShowTimeOkButton="true" DateFormat="@Grid.getFilterDateFormat(Column)"
Value="@Column.GetFilterValue()" Change="@(args => Column.SetFilterValue(args.Value))" AllowInput=@(Grid.AllowFilterDateInput) />
}
else if (Column.FilterPropertyType == typeof(bool) || Column.FilterPropertyType == typeof(bool?))
{
<RadzenCheckBox TriState="true" TValue="@object" Value="@Column.GetFilterValue()" Change="@(args => { Column.FilterValue = null; Column.SetFilterValue(args); Grid.SaveSettings(); Grid.Reload(); })" />
}
else
{
<RadzenTextBox Value="@($"{Column.GetFilterValue()}")" Change="@(args => Column.SetFilterValue(args))" />
}
<RadzenDropDown @onclick:preventDefault="true" TextProperty="Text" ValueProperty="Value" Style="width: 90px"
Data="@(Enum.GetValues(typeof(LogicalFilterOperator)).Cast<LogicalFilterOperator>().Select(t => new { Text = t == LogicalFilterOperator.And ? Grid.AndOperatorText : Grid.OrOperatorText, Value = t }))" TValue="LogicalFilterOperator" Value="@Column.LogicalFilterOperator" Change="@(args => Column.SetLogicalFilterOperator((LogicalFilterOperator)args))" />
<RadzenDropDown @onclick:preventDefault="true" Data="@(Column.GetFilterOperators().Select(t => new { Value = Column.GetFilterOperatorText(t), Key = t }))" TextProperty="Value" ValueProperty="Key" TValue="FilterOperator" Value="@Column.GetSecondFilterOperator()" Change="@(args => Column.SetSecondFilterOperator((FilterOperator)args))" />
@if (PropertyAccess.IsNullableEnum(Column.FilterPropertyType) || PropertyAccess.IsEnum(Column.FilterPropertyType))
{
<RadzenDropDown AllowClear="false" AllowFiltering="false" TValue="@object"
Value=@Column.GetSecondFilterValue() Multiple="false" Placeholder="@Grid.EnumFilterSelectText" TextProperty="Text" ValueProperty="Value" Data=@EnumExtensions.EnumAsKeyValuePair(Nullable.GetUnderlyingType(Column.FilterPropertyType) ?? Column.FilterPropertyType)
Change="@(args => Column.SetFilterValue(args,false))" />
}
else if (PropertyAccess.IsNumeric(Column.FilterPropertyType))
{
@(Grid.DrawNumericFilter(Column, false, false))
}
else if (PropertyAccess.IsDate(Column.FilterPropertyType))
{
<RadzenDatePicker TValue="@object"
ShowTime="@Column.ShowTimeForDateTimeFilter()" ShowTimeOkButton="true" DateFormat="@Grid.getFilterDateFormat(Column)"
Value="@Column.GetSecondFilterValue()" Change="@(args => Column.SetFilterValue(args.Value, false))" AllowInput=@(Grid.AllowFilterDateInput) />
}
else if (Column.FilterPropertyType == typeof(bool) || Column.FilterPropertyType == typeof(bool?))
{
<RadzenCheckBox TriState="true" TValue="@object" Value="@Column.GetSecondFilterValue()" Change="@(args => { Column.SetFilterValue(args, false); Grid.SaveSettings(); })" />
}
else
{
<RadzenTextBox Value="@($"{Column.GetSecondFilterValue()}")" Change="@(args => Column.SetFilterValue(args, false))" />
}
</form>
}
</div>
@if (Column.FilterTemplate == null)
{
<div class="rz-grid-filter-buttons">
<RadzenButton ButtonStyle="ButtonStyle.Secondary" Text=@Grid.ClearFilterText Click="@ClearFilter" />
<RadzenButton form="@($"{getColumnPopupID()}-form")" ButtonType="ButtonType.Submit" ButtonStyle="ButtonStyle.Primary" Text=@Grid.ApplyFilterText Click="@ApplyFilter" />
</div>
}
</Popup>
}
</div>
</th>
}
else
{
@foreach(var column in Grid.childColumns.Where(c => c.GetVisible() && c.Parent == Column))
{
<RadzenDataGridHeaderCell RowIndex="@RowIndex" Grid="@Grid" Column="@column" ColumnIndex="@ColumnIndex"
CssClass="@($"rz-unselectable-text {(Grid.AllowSorting && column.Sortable ? "rz-sortable-column" : "")} {column.HeaderCssClass} {Grid.getFrozenColumnClass(column, Grid.ColumnsCollection.Where(c => c.GetVisible()).ToList())} {Grid.getCompositeCellCSSClass(column)} {Grid.getColumnAlignClass(column)}".Trim())" />
}
}
@code {
Radzen.Blazor.Rendering.Popup popup;
ElementReference filterButton;
string getFilterOpen()
{
return Grid.FilterPopupRenderMode == PopupRenderMode.Initial ? $"Radzen.togglePopup(this, '{getColumnPopupID()}')" : "";
}
async Task ToggleFilter()
{
if (Grid.FilterPopupRenderMode == PopupRenderMode.OnDemand)
{
await popup.ToggleAsync(filterButton);
}
}
async Task ClearFilter()
{
if (Grid.FilterPopupRenderMode == PopupRenderMode.OnDemand)
{
await popup.CloseAsync();
}
await Grid.ClearFilter(Column, true);
}
async Task ApplyFilter()
{
if (Grid.FilterPopupRenderMode == PopupRenderMode.OnDemand)
{
await popup.CloseAsync();
}
await Grid.ApplyFilter(Column, true);
}
[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, object> Attributes { get; set; }
[Parameter]
public RadzenDataGridColumn<TItem> Column { get; set; }
[Parameter]
public int ColumnIndex { get; set; }
[Parameter]
public int RowIndex { get; set; }
[Parameter]
public RadzenDataGrid<TItem> Grid { get; set; }
[Parameter]
public string CssClass { get; set; }
private int SortingTabIndex => Grid.AllowSorting && Column.Sortable ? 0 : -1;
private string getFilterIconCss(RadzenDataGridColumn<TItem> column)
{
var additionalStyle = column.GetFilterValue() != null || column.GetSecondFilterValue() != null ||
column.GetFilterOperator() == FilterOperator.IsNotNull || column.GetFilterOperator() == FilterOperator.IsNull
|| column.GetFilterOperator() == FilterOperator.IsEmpty || column.GetFilterOperator() == FilterOperator.IsNotEmpty
? "rz-grid-filter-active" : "";
return $"rzi rz-grid-filter-icon {additionalStyle}";
}
private void OnSortKeyPressed(KeyboardEventArgs args)
{
var key = args.Code ?? args.Key;
if (key == "Enter")
{
Grid.OnSort(args, Column);
}
}
string getSortIndex()
{
var descriptor = Grid.sorts.Where(s => s.Property == Column.GetSortProperty()).FirstOrDefault();
return descriptor != null ? $"{Grid.sorts.IndexOf(descriptor) + 1}" : "";
}
string getColumnPopupID()
{
var fiterProperty = Column.GetFilterProperty();
return $"{Grid.PopupID}{(string.IsNullOrEmpty(fiterProperty) ? Grid.allColumns.IndexOf(Column).ToString() : fiterProperty)}";
}
}

View File

@@ -2,27 +2,29 @@
@typeparam TItem
@implements IRadzenForm
@{var rowArgs = Grid?.RowAttributes(Item); }
@{var firstLevel = Grid.AllowCompositeDataCells ? 0 : Grid.deepestChildColumnLevel; }
@for(var i = firstLevel; i < Grid.deepestChildColumnLevel + 1; i++)
{
<tr class="@(Grid.RowStyle(Item, Index))" @attributes="@rowArgs.Item2">
@foreach(var g in Grid.groups)
@foreach(var g in Grid.Groups)
{
<td class="rz-col-icon">
<td class="rz-col-icon" rowspan="@(Grid.AllowCompositeDataCells ? (Grid.deepestChildColumnLevel + 1) : 1)">
<span class="rz-column-title"></span>
</td>
}
@if (Grid.Template != null && Grid.ShowExpandColumn)
@if (Grid.Template != null && Grid.ShowExpandColumn && i == firstLevel)
{
<td class="rz-col-icon">
<td class="rz-col-icon" rowspan="@(Grid.AllowCompositeDataCells ? (Grid.deepestChildColumnLevel + 1) : 1)">
<span class="rz-column-title"></span>
@if (rowArgs.Item1.Expandable)
{
<a href="javascript:void(0)" @onclick="@(_ => Grid.ExpandItem(Item))">
<a href="javascript:void(0)" @onclick="@(_ => Grid.ExpandItem(Item))" @onclick:stopPropagation>
<span class="@(Grid.ExpandedItemStyle(Item))"></span>
</a>
}
</td>
}
<CascadingValue Value=@EditContext>
<CascadingValue Value=this>
@for (var j = 0; j < Columns.Count; j++)
{
if (Grid.rowSpans.ContainsKey(j))
@@ -58,8 +60,48 @@
Grid.rowSpans.Add(j, (int)Convert.ChangeType(rowspan, TypeCode.Int32));
}
<RadzenDataGridCell Grid="@this.Grid" Item="@Item" Column="@column"
Style="@column.GetStyle(true)" CssClass="@(column.CssClass + " " + Grid.getFrozenColumnClass(column, Columns))" Attributes="@(cellAttr)">
<RadzenDataGridCell Row=@this EditContext=EditContext RowIndex="@i" Grid="@this.Grid" Item="@Item" Column="@column"
Style="@column.GetStyle(true)" CssClass="@(column.CssClass + " " + Grid.getFrozenColumnClass(column, Columns) + " " + Grid.getCompositeCellCSSClass(column))" Attributes="@(cellAttr)">
@if (Grid.Responsive)
{
<span class="rz-column-title">
@if (column.HeaderTemplate != null)
{
@column.HeaderTemplate
}
else
{
@column.Title
}
</span>
}
@if (Grid.LoadChildData.HasDelegate && Grid.ShowExpandColumn && Grid.allColumns.IndexOf(column) == 0)
{
<span class="rz-cell-toggle">
<a style="@(getExpandIconStyle(rowArgs.Item1.Expandable))" href="javascript:void(0)" @onclick="@(_ => Grid.ExpandItem(Item))" @onclick:stopPropagation>
<span class="@(Grid.ExpandedItemStyle(Item))"></span>
</a>
<span class="rz-cell-data" title="@(column.Template == null ? column.GetValue(Item) : "")">
@if (Item != null)
{
@if (Grid.IsRowInEditMode(Item) && column.EditTemplate != null)
{
@column.EditTemplate(Item)
}
else if (column.Template != null)
{
@column.Template(Item)
}
else
{
@column.GetValue(Item)
}
}
</span>
</span>
}
else
{
<span class="rz-cell-data" title="@(column.Template == null ? column.GetValue(Item) : "")">
@if (Item != null)
{
@@ -77,15 +119,17 @@
}
}
</span>
}
</RadzenDataGridCell>
}
</CascadingValue>
</CascadingValue>
</tr>
}
@if (Grid.Template != null && Grid.expandedItems.Keys.Contains(Item))
{
<tr class="rz-expanded-row-content">
<td colspan="@(Columns.Count + (Grid.ShowExpandColumn ? 1 : 0) + + Grid.groups.Count)">
<td colspan="@(Columns.Sum(c => c.GetColSpan()) + (Grid.ShowExpandColumn ? 1 : 0) + Grid.Groups.Count)">
<div class="rz-expanded-row-template" style="position:sticky">
@Grid.Template(Item)
</div>
@@ -151,4 +195,25 @@
{
return components.Where(component => component.Name == name).FirstOrDefault();
}
internal string getExpandIconStyle(bool expandable)
{
var rules = new List<string>();
if (!expandable)
{
rules.Add("visibility:hidden");
}
var child = Grid.childData.Any() ? Grid.childData.Where(c => c.Value?.Data?.Contains(Item) == true).FirstOrDefault() :
default(KeyValuePair<TItem, DataGridChildData<TItem>>);
var level = !object.Equals(child, default(KeyValuePair<TItem, DataGridChildData<TItem>>)) ? child.Value.Level : 0;
if (level > 0)
{
rules.Add($"margin-left: {level}rem");
}
return string.Join(';', rules);
}
}

View File

@@ -6,48 +6,24 @@
<div @ref="@Element" @attributes="Attributes" class="@GetCssClass()" style="@Style" id="@GetId()">
@if (AllowPaging && (PagerPosition == PagerPosition.Top || PagerPosition == PagerPosition.TopAndBottom))
{
<RadzenPager @ref="topPager" Count="@Count" PageSize="@PageSize" PageNumbersCount="@PageNumbersCount" PageChanged="@OnPageChanged" PageSizeChanged="@OnPageSizeChanged" PageSizeOptions="@PageSizeOptions" ShowPagingSummary="@ShowPagingSummary" PagingSummaryFormat="@PagingSummaryFormat" />
<RadzenPager HorizontalAlign="@PagerHorizontalAlign" AlwaysVisible="@PagerAlwaysVisible" @ref="topPager" Count="@Count" PageSize="@PageSize" PageNumbersCount="@PageNumbersCount" PageChanged="@OnPageChanged" PageSizeChanged="@OnPageSizeChanged" PageSizeOptions="@PageSizeOptions" ShowPagingSummary="@ShowPagingSummary" PagingSummaryFormat="@PagingSummaryFormat" PageSizeText="@PageSizeText" />
}
@if (Data != null)
{
@if (!WrapItems)
{
@foreach (var item in LoadData.HasDelegate ? Data : PagedView)
{
<ul class="rz-datalist-data">
<li>
@if (Template != null)
{
@Template(item)
}
else
{
<span>Template</span>
}
</li>
</ul>
}
@DrawDataListRows()
}
else
{
<div class="rz-g">
@foreach (var item in LoadData.HasDelegate ? Data : PagedView)
{
@if (Template != null)
{
@Template(item)
}
else
{
<span>Template</span>
}
}
@DrawDataListRows()
</div>
}
}
@if (AllowPaging && (PagerPosition == PagerPosition.Bottom || PagerPosition == PagerPosition.TopAndBottom))
{
<RadzenPager @ref="bottomPager" Count="@Count" PageSize="@PageSize" PageNumbersCount="@PageNumbersCount" PageChanged="@OnPageChanged" PageSizeChanged="@OnPageSizeChanged" PageSizeOptions="@PageSizeOptions" ShowPagingSummary="@ShowPagingSummary" PagingSummaryFormat="@PagingSummaryFormat" class="rz-paginator-bottom" />
<RadzenPager HorizontalAlign="@PagerHorizontalAlign" AlwaysVisible="@PagerAlwaysVisible" @ref="bottomPager" Count="@Count" PageSize="@PageSize" PageNumbersCount="@PageNumbersCount" PageChanged="@OnPageChanged" PageSizeChanged="@OnPageSizeChanged" PageSizeOptions="@PageSizeOptions" ShowPagingSummary="@ShowPagingSummary" PagingSummaryFormat="@PagingSummaryFormat" PageSizeText="@PageSizeText" class="rz-paginator-bottom" />
}
</div>
}

View File

@@ -1,4 +1,16 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Data.Common;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Text.Json;
using System.Threading.Tasks;
namespace Radzen.Blazor
{
@@ -29,5 +41,98 @@ namespace Radzen.Blazor
/// <value><c>true</c> if wrap items; otherwise, <c>false</c>.</value>
[Parameter]
public bool WrapItems { get; set; }
#if NET5_0_OR_GREATER
/// <summary>
/// Gets or sets a value indicating whether this instance is virtualized.
/// </summary>
/// <value><c>true</c> if this instance is virtualized; otherwise, <c>false</c>.</value>
[Parameter]
public bool AllowVirtualization { get; set; }
internal Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<TItem> virtualize;
/// <summary>
/// Gets Virtualize component reference.
/// </summary>
public Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<TItem> Virtualize
{
get
{
return virtualize;
}
}
private async ValueTask<Microsoft.AspNetCore.Components.Web.Virtualization.ItemsProviderResult<TItem>> LoadItems(Microsoft.AspNetCore.Components.Web.Virtualization.ItemsProviderRequest request)
{
var view = AllowPaging ? PagedView : View;
var top = request.Count;
if(top <= 0)
{
top = PageSize;
}
await LoadData.InvokeAsync(new Radzen.LoadDataArgs()
{
Skip = request.StartIndex,
Top = top
});
var totalItemsCount = LoadData.HasDelegate ? Count : view.Count();
var virtualDataItems = (LoadData.HasDelegate ? Data : view.Skip(request.StartIndex).Take(top))?.ToList();
return new Microsoft.AspNetCore.Components.Web.Virtualization.ItemsProviderResult<TItem>(virtualDataItems, totalItemsCount);
}
#endif
RenderFragment DrawDataListRows()
{
return new RenderFragment(builder =>
{
#if NET5_0_OR_GREATER
if (AllowVirtualization)
{
builder.OpenComponent(0, typeof(Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<TItem>));
builder.AddAttribute(1, "ItemsProvider", new Microsoft.AspNetCore.Components.Web.Virtualization.ItemsProviderDelegate<TItem>(LoadItems));
builder.AddAttribute(2, "ChildContent", (RenderFragment<TItem>)((context) =>
{
return (RenderFragment)((b) =>
{
DrawRow(b, context);
});
}));
builder.AddComponentReferenceCapture(4, c => { virtualize = (Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<TItem>)c; });
builder.CloseComponent();
}
else
{
DrawRows(builder);
}
#else
DrawRows(builder);
#endif
});
}
internal void DrawRows(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder builder)
{
foreach (var item in LoadData.HasDelegate ? Data : PagedView)
{
DrawRow(builder, item);
}
}
internal void DrawRow(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder builder, TItem item)
{
builder.OpenComponent<RadzenDataListRow<TItem>>(0);
builder.AddAttribute(1, "DataList", this);
builder.AddAttribute(2, "Item", item);
builder.SetKey(item);
builder.CloseComponent();
}
}
}

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