Compare commits

...

2016 Commits

Author SHA1 Message Date
Vladimir Enchev
5321c4d52b Version updated 2024-10-17 10:14:44 +03:00
Vladimir Enchev
0466912f3e Carousel Navigate() method will reset timer 2024-10-17 10:13:24 +03:00
Vladimir Enchev
3d3932e657 EmployeeTerritorysData added 2024-10-17 10:04:55 +03:00
Vladimir Enchev
d63117a17a DataGrid wrong column grouped in some cases with composite columns 2024-10-17 09:39:12 +03:00
Vladimir Enchev
ba06a72326 Carousel manual navigation should reset the auto-rotate timer
Fix #1741
2024-10-16 16:06:37 +03:00
Vladimir Enchev
2671f6ca61 Carousel pager not updated on auto rotate in some cases
Fix #1740
2024-10-16 15:26:07 +03:00
yordanov
8dddfcbc92 Remove obselete tabs styles. Resolves #1742 2024-10-16 14:58:05 +03:00
yordanov
ebc5793f36 Fix label overlapping when RadzenFileInput is in RadzenFormField. Resolves #1716 2024-10-16 11:17:59 +03:00
yordanov
4946221651 Fix rz-column-title overflow if it has a checkbox inside. Resolves #1683 2024-10-15 15:52:23 +03:00
Vladimir Enchev
de9817a97f DataGrid should not show two expand icons in case of both self-reference hierarchy and Template defined
Fix #1737
2024-10-14 16:36:08 +03:00
yordanov
1218c4f385 Disabled text color in material theme should be lighter. Resolves #1736 2024-10-14 11:07:52 +03:00
Vladimir Enchev
e9cee62d03 demo improved 2024-10-14 09:31:37 +03:00
yordanov
fa7cf37eab Update Documentation link to API reference 2024-10-14 09:25:29 +03:00
Vladimir Enchev
b9ecb7556f Version updated 2024-10-14 09:07:42 +03:00
Vladimir Enchev
661b38e1e6 DataGrid column picking demo improved with context menu option
Close #1735
2024-10-14 08:53:06 +03:00
Vladimir Enchev
769f4ba589 Tooltip smart position will take into account scrollbar width 2024-10-12 18:00:40 +03:00
Vladimir Enchev
6118253ebf DataFilter LoadData demo improved 2024-10-12 10:43:19 +03:00
Vladimir Enchev
0f7f717330 DataGrid/DataFilter ToFilterString() enumerable type discovery improved 2024-10-12 10:37:18 +03:00
yordanov
0b16f1eb97 Buttons in Tooltip position demo should wrap 2024-10-11 15:44:37 +03:00
Atanas Korchev
e733894c02 RadzenBody sometimes triggers JS exception after navigation. 2024-10-10 19:38:41 +03:00
Vladimir Enchev
c47dcfbe27 warnings fixed 2024-10-10 18:24:46 +03:00
Vladimir Enchev
8ae008ec9d Carousel component added (#1732)
* Carousel component added

* Carousel with Pager demo added

* Carousel demos improved

* Update carousel

* Carousel improved

* Carousel demos reworked with database data

* Add carousel pager overlay styles

* Update carousel demos

* Add Carousel to homepage and update icon

* Add Carousel styles to themes

* Update Carousel styles and demos

* Update Carousel markup and styles

* Update Carousel demos

* Update ExampleService

---------

Co-authored-by: yordanov <vasil@yordanov.info>
2024-10-10 18:21:22 +03:00
Vladimir Enchev
45ef0c78a3 docker updated 2024-10-10 15:33:05 +03:00
Vladimir Enchev
3ac46f239e Version updated 2024-10-10 14:56:48 +03:00
Vladimir Enchev
1e106f7ada DataPicker rz-readonly should be added only when ReadOnly=true 2024-10-10 14:56:32 +03:00
Vladimir Enchev
09738b2dd7 added version to blazor.web.js 2024-10-10 13:48:00 +03:00
Vladimir Enchev
dc67a0b0fc Version updated 2024-10-10 08:57:59 +03:00
Atanas Korchev
1258bbc770 RadzenDataAnnotationValidator supports nested properties. 2024-10-09 18:59:27 +03:00
Victor Ureta
5960318a60 Add same color to datepicker button as text (#1730)
* Update RadzenDatePicker.razor

* Update RadzenDatePicker.razor

* add ButtonClass
2024-10-09 13:33:37 +03:00
Vladimir Enchev
d4faf758f4 DataGrid will not render items when virtualized and grouped in some cases 2024-10-09 13:33:07 +03:00
Vladimir Enchev
f88216b9a0 ReadOnly Datepicker with PopupRenderMode Initial allows user to open popup and select date
Fix #1727
2024-10-09 11:41:04 +03:00
Vladimir Enchev
e21d648588 Closing tooltip should not try to restore focus 2024-10-09 09:04:33 +03:00
Vladimir Enchev
dbcbdc9bbc comment fixed
Fix #1729
2024-10-08 16:17:28 +03:00
Vladimir Enchev
c5d16e8381 FormatString added to DateTime column in Dialog demo 2024-10-08 16:13:36 +03:00
Vladimir Enchev
ac1aa6f3b1 dates updated 2024-10-08 16:09:20 +03:00
Vladimir Enchev
866c222c74 DropDown will not select item on Enter is some cases 2024-10-08 13:34:39 +03:00
Vladimir Enchev
06843477cb Index property added to DataGrid RowRenderEventArgs 2024-10-08 13:34:39 +03:00
Vladimir Enchev
9a7a6fc6ab DataGrid will group by wrong column in case of invisible columns 2024-10-08 13:34:38 +03:00
Atanas Korchev
4986da415f Some data grid grouping demos are not editable. 2024-10-08 08:10:09 +03:00
Vladimir Enchev
cdbd20b794 Version updated 2024-10-07 10:34:43 +03:00
Vladimir Enchev
49567ade65 DataGrid CheckBoxList filter values ordered by default 2024-10-06 10:23:28 +03:00
Vladimir Enchev
4d857449d2 DataGrid CheckBoxList filter boolean localization example added 2024-10-04 11:36:10 +03:00
Vladimir Enchev
dc03621a14 DataGrid column FormatString can be used to localize boolean in CheckBoxList filter 2024-10-04 09:03:16 +03:00
Vladimir Enchev
b83cca17e2 Fixed DropDown will focus disabled items in some cases 2024-10-03 15:06:49 +03:00
Vladimir Enchev
343afffd40 Fixed DatePicker can select disabled date if focused 2024-10-03 11:44:59 +03:00
Vladimir Enchev
163eac9511 Version updated 2024-10-03 10:11:32 +03:00
Vladimir Enchev
167bfcb0b3 Tabs focus logic with Visible=false tabs fixed
Fix #1722
2024-10-03 09:48:19 +03:00
Vladimir Enchev
f0f94eb84c Popup with DataGrid demo improved 2024-10-03 09:14:52 +03:00
Vladimir Enchev
7123c9ca12 SplitButton PopupID fixed 2024-10-03 09:01:23 +03:00
Vladimir Enchev
41e12d8e54 More focusTableRow improvements 2024-10-02 22:00:34 +03:00
Vladimir Enchev
473ab14ae6 focusTableRow improved 2024-10-02 21:57:43 +03:00
Vladimir Enchev
127ffd451c Keyboard navigation added to Popup with DataGrid demo 2024-10-02 18:16:53 +03:00
Vladimir Enchev
32bb43b66f DataFilter InText and NotInText added
Fix #1721
2024-10-02 17:53:31 +03:00
Vladimir Enchev
765f5acbcc Upload should not raise change if file is not selected 2024-10-01 16:54:22 +03:00
Vladimir Enchev
8ac137f22d Fixed FileInput error when canceled
Fix #1720
2024-10-01 16:51:07 +03:00
Vladimir Enchev
10bbf6b157 Version updated 2024-10-01 16:17:41 +03:00
ax-meyer
390dc0605b Use ToString() on property to filter in DataGrid CheckBoxList to check for empty strings (#1718)
The change in 35c9f55c41 broke filtering when the property to be filtered was not a string.
2024-10-01 16:17:06 +03:00
Vladimir Enchev
6fda9f0691 Version updated 2024-10-01 14:47:38 +03:00
Vladimir Enchev
0a1c5830d2 Fixed DataGrid enum filtering in simple mode 2024-10-01 14:47:21 +03:00
Vladimir Enchev
33efa2316d Version updated 2024-10-01 11:12:48 +03:00
Vladimir Enchev
b3de9374a7 Popup AutoFocusFirstElement property added
Popup demos updated.
2024-10-01 11:12:15 +03:00
Victor Ureta
1d869e8d2b Added AdditionalContent Parameter to Scheduler (#1717)
* feat: add AdditionalContent parameter for rendering custom content next to year, month, and day buttons in RadzenScheduler

* Change name variable
2024-10-01 08:49:10 +03:00
Atanas Korchev
56156dd5ff RadzenHtmlEditor applies valid and invalid classes during validation. 2024-09-30 20:01:23 +03:00
Vladimir Enchev
35c9f55c41 DataGrid CheckBoxList filter should use null instead empty string 2024-09-30 16:26:01 +03:00
Vladimir Enchev
e70e3559eb tests fixed 2024-09-30 10:26:58 +03:00
Vladimir Enchev
5957439475 Version updated 2024-09-30 10:13:44 +03:00
yordanov
322ed552ed Update premium themes 2024-09-30 09:37:59 +03:00
Antoine Gagné
bf848d5ef8 Fixed input width in RadzenFormFields (#1715) 2024-09-30 09:03:35 +03:00
Vladimir Enchev
285057a9df Filtering by nullable enum fixed 2024-09-30 07:58:15 +03:00
fallen576
4de62ffa55 Enum filtering using underlying types other than Int32 is now supported. (#1714) 2024-09-30 07:43:25 +03:00
Vladimir Enchev
f97fde1387 Update DataGridMixedAdvancedFilterPage.razor 2024-09-28 08:46:49 +03:00
Vladimir Enchev
8a5bba625c DataGrid will group wrong column in case of Visible=false columns 2024-09-27 08:07:04 +03:00
yordanov
108a209ac8 Update buttons' hover state in material3-dark. Resolves #1655 2024-09-26 17:10:34 +03:00
yordanov
8390a4aba9 Use forced-colors media query instead of -ms-high-contrast. Resolves #1712 2024-09-26 16:28:27 +03:00
yordanov
9740416e56 Hide unwanted focused outline around the table in RadzenDataGrid 2024-09-26 15:57:46 +03:00
yordanov
8cc82642f9 Update Popup demo 2024-09-26 14:40:30 +03:00
Vladimir Enchev
5f4804f4cf maps.googleapis.com added to font and styles csp exceptions 2024-09-25 13:35:44 +03:00
Vladimir Enchev
24dbee5d3d googleapis added to csp 2024-09-25 13:26:55 +03:00
Vladimir Enchev
298f84d25e DataGrid simple DateTime filter popup button will show active filter state 2024-09-25 10:02:46 +03:00
Vladimir Enchev
182c66f0a9 Added debug symbols to nuget package and updated the version 2024-09-24 15:44:41 +03:00
Vladimir Enchev
fd11c34646 Version updated 2024-09-24 15:20:16 +03:00
Vladimir Enchev
6bcc7388bb RadzenNumeric prevents tab out when up/down key pressed before
Fix #1711
2024-09-24 15:15:14 +03:00
Vladimir Enchev
60da0c0082 Added 'notranslate' CSS class to all icons 2024-09-24 15:11:09 +03:00
Vladimir Enchev
2b2b48bec4 DataGrid column filters not cleared properly 2024-09-24 13:24:01 +03:00
Vladimir Enchev
d579f79399 DatePicker with Inline=true should not close or toggle popup 2024-09-23 11:43:17 +03:00
Vladimir Enchev
bf85df68b3 DatePicker as calendar, disappears when press escape key
Fix #1706
2024-09-23 08:56:40 +03:00
Vladimir Enchev
e6e7ec49df Mask component value not updated on change in Safari 2024-09-20 09:34:27 +03:00
Vladimir Enchev
e7801e1222 Version updated 2024-09-19 10:11:28 +03:00
Vladimir Enchev
3327254022 DataGrid filter aria label properties misspelled 2024-09-19 10:10:49 +03:00
Vladimir Enchev
d53d09e358 Version updated 2024-09-19 08:54:23 +03:00
Vladimir Enchev
34c02ac391 Upload will unable to upload empty file
Fix #1702
2024-09-19 08:51:26 +03:00
Atanas Korchev
cf4eb0c9cd Chart series annotations are sometimes duplicated. 2024-09-18 16:22:42 +03:00
Atanas Korchev
ee6220b1fe DataGrid row drag and drop works in day and month view. 2024-09-18 14:43:51 +03:00
Vladimir Enchev
a264638726 demo improved 2024-09-18 10:47:32 +03:00
Atanas Korchev
3e6a10a57d DataAnnotationValidator throws exception when used with double properties. Fixes #1689. 2024-09-18 09:55:55 +03:00
Vladimir Enchev
5258816770 SecurityCode input not focused after count change
Close #1700
2024-09-18 09:27:41 +03:00
Vladimir Enchev
fb4457f9a1 Dialog closes on ESC even if CloseDialogOnEsc = false in some cases
Fix #1699
2024-09-17 20:01:25 +03:00
Vladimir Enchev
627a74038c demos improved 2024-09-17 14:59:47 +03:00
Tcsaba66
54c297e898 create optional parameters for radzenhtmleritorimage (#1691) 2024-09-17 14:22:08 +03:00
Vladimir Enchev
a4d7201f7d DataFilter ToFilterString() should traverse filters exactly like Where() extension method 2024-09-17 09:51:15 +03:00
Atanas Korchev
b04cf69b90 Change the documentation link to point to the API reference. 2024-09-16 17:26:56 +03:00
Atanas Korchev
ea654f0b8d Remove the guides and redirect to the demos. 2024-09-16 17:14:03 +03:00
Vladimir Enchev
9b16aaf9e4 Version updated 2024-09-16 16:16:50 +03:00
yordanov
87672de761 Add utility css classes for display, overflow, sizing and borders 2024-09-16 16:13:02 +03:00
Vladimir Enchev
171a8def6d DataGrid KeyDown event added 2024-09-16 16:07:32 +03:00
Equitis
f09179f4cd Insert NumpadDecimal at cursor position. (#1693)
Co-authored-by: Patrick Fuhr <p.fuhr@solutit.de>
2024-09-16 16:01:54 +03:00
Vladimir Enchev
03f62068b3 DatePicker year DropDown should respect Culture 2024-09-16 14:59:51 +03:00
Atanas Korchev
828b4230e3 Required validation triggers unnecessarily for RadzenHtmlEditor. 2024-09-16 14:45:55 +03:00
Vladimir Enchev
2b23e5d472 demo fixed 2024-09-16 12:56:40 +03:00
Vladimir Enchev
17dbe70460 Pager will focus clicked button if not disabled 2024-09-13 16:38:45 +03:00
Atanas Korchev
587c3a0647 Remove outdated getting started instructions from the documentation. 2024-09-13 13:49:08 +03:00
Vladimir Enchev
83f0879b11 demo update to use Change instead onblur event 2024-09-13 10:53:38 +03:00
Vladimir Enchev
212b741828 demo updated 2024-09-13 10:26:23 +03:00
Vladimir Enchev
ee81b608f9 AutoComplete property deleted. All cases will be supported trough custom attribute 2024-09-12 16:06:23 +03:00
Vladimir Enchev
ad17080ee8 AutoComplete parameter type changed from bool to object to comply with .NET9
In .NET 9 it's not longer possible to have custom attribute and parameter with similar names - casing is ignored.
Details: https://github.com/dotnet/razor/issues/8854
2024-09-12 15:01:51 +03:00
Atanas Korchev
6a8611c348 Implement UploadComplete event in RadzenHtmlEditor. 2024-09-12 13:06:47 +03:00
Vladimir Enchev
3ba3610b21 DataGrid CheckBoxList column filter not refreshed on search when AllowCheckBoxListVirtualization="false" 2024-09-12 10:36:02 +03:00
Vladimir Enchev
8deed23e01 PropertyAccess.GetDynamicPropertyExpression() method added 2024-09-11 17:04:11 +03:00
Monsieurvor
356106263b NumericRangeValidator: AllowNull (#1686)
* AllowNull range validator

* Change comment

* Add AllowNull test case

* Fix test assertion

* Update RadzenNumericRangeValidator.cs
2024-09-11 15:25:10 +03:00
Vladimir Enchev
0566244b61 CSP tab added 2024-09-11 11:02:47 +03:00
Vladimir Enchev
17d76b4e6f Version updated 2024-09-11 09:57:55 +03:00
Vladimir Enchev
9c3490f275 Content-Security-Policy added to demos 2024-09-11 09:56:24 +03:00
Vladimir Enchev
b1b6499d7c DataGrid column AllowCheckBoxListVirtualization property added 2024-09-10 18:07:51 +03:00
Vladimir Enchev
a36a74091f Fixed RadzenDataGrid Grouping very slow on the first render
Fix #1684
2024-09-10 17:16:12 +03:00
Vladimir Enchev
4dfbd676af Fixed DatePicker logic for HoursStep, MinutesStep and SecondsStep 2024-09-10 08:24:19 +03:00
Vladimir Enchev
f72f8b3e39 Version updated 2024-09-09 12:36:34 +03:00
Vladimir Enchev
45cc6880f9 DataGrid should close other columns filter popups when FilterPopupRenderMode == PopupRenderMode.OnDemand 2024-09-09 11:04:35 +03:00
Vladimir Enchev
17281cd3b1 Numeric inputmode attribute can be defined using InputAttributes 2024-09-09 10:28:47 +03:00
Vladimir Enchev
332b452b56 Numeric inputmode attribute support fixed 2024-09-09 09:32:44 +03:00
Vladimir Enchev
c647515186 DataFilter IsEmoty/IsNotEmpty operators logic fixed 2024-09-08 15:15:54 +03:00
Vladimir Enchev
6faf0ed9b9 DataFilter 'Is Null' & 'Is Not Null' filter options do not produce correct filter via ToFilterString()
Fix #1682
2024-09-08 15:08:53 +03:00
Lynkle
fad024d9bb fix(FileInput): Modified FileInput.razor to handle rendering the preview of an image correctly when using byte[] as the TValue instead of string. Added a corresponding demo to highlight this. (#1680) 2024-09-08 08:29:45 +03:00
Vladimir Enchev
67718df278 Version updated 2024-09-06 09:26:34 +03:00
Christoph
273c3283c2 Add Reload method to RadzenTree (#1678)
* Added demo to illustrate the refresh problem with dynamic loading.

* Added RadzenTree.Reload public API.

* Documentation added.
2024-09-06 09:24:01 +03:00
Vladimir Enchev
aa7306ebd1 DropDownDataGrid OpenOnFocus logic fixed 2024-09-06 09:16:27 +03:00
Vladimir Enchev
56cb173ad5 DataGrid will not render colgroup if there are child columns
Fix #1674
2024-09-05 14:50:06 +03:00
Vladimir Enchev
174f0a9393 demo updated 2024-09-05 09:26:50 +03:00
Vladimir Enchev
a1dbc1a6fb DataGrid exception when trying to filter DateTimeOffset 2024-09-04 09:02:39 +03:00
Vladimir Enchev
d9de2ee0bc Version updated 2024-09-03 17:45:31 +03:00
Vladimir Enchev
cf1e0eda27 Fixed DataGrid string column will always apply Contains for initial filter 2024-09-03 17:40:37 +03:00
Vladimir Enchev
ccc82e5a61 DropDownDataGrid @bind-SelectedItem can cause endless loop in some cases 2024-09-02 14:08:43 +03:00
Vladimir Enchev
0859f939dd DataGrid CheckBoxList filter breaks cells value from enum description 2024-09-02 10:25:11 +03:00
Atanas Korchev
519c133c0c Update the descriptions and content of the RadzenHtmlEditor demos. 2024-09-02 10:22:48 +03:00
Atanas Korchev
9f62860821 The user can insert images and links in RadzenHtmlEditor by pressing Enter. 2024-09-02 09:51:24 +03:00
Atanas Korchev
238ed1ac2c The user can select an image in RadzenHtmlEditor by clicking it. Then use the Insert image tool to set its attributes. Closes #1209. 2024-09-02 09:51:24 +03:00
Vladimir Enchev
cd5903b358 Version updated 2024-09-02 09:08:33 +03:00
Vladimir Enchev
f78125c4fb DropDownDataGrid focus of selected item fixed 2024-09-02 09:06:54 +03:00
Atanas Korchev
6394241b9f Shared tooltips do not work in some cases. 2024-09-01 20:54:57 +03:00
Vladimir Enchev
d4dfc9bbab Fixed Slider with Min="1" change value with click 2024-08-31 09:32:27 +03:00
Vladimir Enchev
cf668be964 Version updated 2024-08-30 18:41:03 +03:00
Vladimir Enchev
6ef443d724 DropDownDataGrid Cannot read properties of undefined (reading 'classList') error fixed 2024-08-30 18:40:36 +03:00
Vladimir Enchev
75af217864 demo title fixed 2024-08-30 11:46:48 +03:00
Vladimir Enchev
7a7343c3c8 demo updated 2024-08-30 11:39:59 +03:00
Vladimir Enchev
18bfa8f562 DataGrid will allow mixed Simple and SimpleWithMenu modes per column 2024-08-30 11:38:46 +03:00
Vladimir Enchev
a76a0815a0 DataGrid column FilterMode property added
Fix #1672
2024-08-30 11:07:18 +03:00
Vladimir Enchev
332f384a65 DropDown selected item not highlighted on initial popup open 2024-08-29 09:52:38 +03:00
Vladimir Enchev
3c5e1216c8 Version updated 2024-08-29 09:17:42 +03:00
Vladimir Enchev
c7c11a1c1e DropDownDataGrid keyboard navigation fixed 2024-08-29 09:17:23 +03:00
Vladimir Enchev
0dd993c1d0 version updated 2024-08-28 10:09:36 +03:00
Vladimir Enchev
c977e9b59c DropDownDataGrid row not selected on initial selection 2024-08-28 10:09:16 +03:00
Vladimir Enchev
81055b5500 DataGrid composite column GroupFooterTemplate fixed 2024-08-28 09:53:00 +03:00
Vladimir Enchev
c8df446846 demo fixed 2024-08-28 09:15:36 +03:00
Vladimir Enchev
97ac4621b9 DataList ShowEmptyMessage disabled by default 2024-08-26 13:07:38 +03:00
Vladimir Enchev
9346c474cf DataGrid simple filter input autocomplete disabled 2024-08-26 13:06:24 +03:00
Vladimir Enchev
d9a55965d3 DataList EmptyMessage, EmptyTemplate and ShowEmptyMessage added
Fix #1666
2024-08-26 13:03:10 +03:00
Vladimir Enchev
50306343a8 Version updated 2024-08-23 11:48:55 +03:00
Vladimir Enchev
08d7457620 Fixed Numeric floating-point value loss of precision
Fix #1667
2024-08-23 11:32:02 +03:00
Vladimir Enchev
b80a382d2f Fixed DropDown collapse when inside Popup 2024-08-23 09:58:38 +03:00
Vladimir Enchev
ab066bb441 DataGrid column FooterTemplate not rendered when only for composite columns 2024-08-23 09:20:03 +03:00
Vladimir Enchev
4a64260d6e Version updated 2024-08-22 07:51:39 +03:00
Vladimir Enchev
9390077007 DropDownDataGrid HeaderTemplate duplicated
Fix #1664
2024-08-22 07:44:34 +03:00
yordanov
baf5386e34 Hide RadzenButton's hover state on touchscreen devices 2024-08-21 10:27:31 +03:00
Vladimir Enchev
86e72b2f7f PanelMenu will use PanelMenuItem.Match if not default (#1662) 2024-08-21 10:06:35 +03:00
Vladimir Enchev
70bc02b12e DataGrid Bool and Bool? filters not handled correctly
Fix #1663
2024-08-21 10:05:56 +03:00
Vladimir Enchev
6bce8b0195 RadzenTreeItem rendering fixed
Close #1660
2024-08-20 16:31:14 +03:00
yordanov
dd4afb1d0a Fix DropDown chips padding within a flat or filled FormField. Resolves #1654 2024-08-16 08:56:29 +03:00
Vladimir Enchev
95493fe157 version updated 2024-08-16 07:54:09 +03:00
Vladimir Enchev
42b9ef3956 CheckBoxListItem does not update aria-checked selected
Fix #1653
2024-08-16 07:51:19 +03:00
Vladimir Enchev
97ee7b7a7a DatePicker not closed when date is picked without time 2024-08-16 07:26:33 +03:00
Atanas Korchev
230860f773 Preload the icon font to test loading. 2024-08-15 13:04:37 +03:00
Atanas Korchev
5f7f6d975e Update the Sparkline demo. 2024-08-15 12:58:17 +03:00
yordanov
e7c95fdcc1 Components are now more than 90 2024-08-15 11:24:13 +03:00
Vladimir Enchev
933367a685 Version updated 2024-08-15 10:03:51 +03:00
yordanov
4857307533 Update demos homepage 2024-08-15 09:53:06 +03:00
Atanas Korchev
1ee50e42ca Raise the Paste event when an image is pasted. Closes #1652. 2024-08-15 09:50:26 +03:00
Vladimir Enchev
5bbc108331 DropDown OpenOnFocus behavior improved 2024-08-15 09:05:50 +03:00
Vladimir Enchev
11d62516d9 DataGrid column FormatProvider property added
Fix #1649
2024-08-15 08:39:14 +03:00
yordanov
ef714a8bfc Update premium themes 2024-08-14 19:13:14 +03:00
yordanov
c6b8441a79 Update demos homepage 2024-08-14 19:13:14 +03:00
Atanas Korchev
200ad86575 Exception is thrown when using bar series with empty data. 2024-08-14 12:29:12 +03:00
Vasil Yordanov
54fe2f260f New Shared chart tooltips and Sparkline component (#1651)
* Implement shared tooltips.

* Style Chart tooltips.

* Initial Sparkline implementation.

* Support axes in the Sparkline.

* Add Sparkline demo.

---------

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2024-08-14 12:20:06 +03:00
Vasil Yordanov
e056cf743d Fix progressbar value color. Resolves #1641 (#1650)
* Fix progressbar value color
* Fix failing ProgressBar tests
2024-08-14 12:01:19 +03:00
yordanov
8dbc747928 Update icons on homepage 2024-08-13 17:40:14 +03:00
Vladimir Enchev
969b37e4e9 Version updated 2024-08-12 08:31:35 +03:00
Vladimir Enchev
79a111668e Fixed Splitter exception when all panes Resizable=false 2024-08-12 08:25:45 +03:00
yordanov
9c90e3110b Fix padding-inline-end spacing utility classes 2024-08-09 17:49:03 +03:00
yordanov
59237fb9c6 Improve links' focus state on homepage 2024-08-09 16:29:14 +03:00
yordanov
fc3705f019 Update demos homepage, icons and links 2024-08-09 16:00:27 +03:00
Vladimir Enchev
15adbc0823 Fixed DataFilter ToFilterString() wrong expression for dates
Fix #1642
2024-08-09 10:04:40 +03:00
Vladimir Enchev
ca6472f5f2 DropDownDataGrid HeaderTemplate and FooterTemplate support added
Fix #1643
2024-08-09 08:53:39 +03:00
Vladimir Enchev
de38322f34 DataGrid ColumnReordering event added
Fix #875
2024-08-08 18:54:26 +03:00
Vladimir Enchev
ed45d30639 Version updated 2024-08-08 14:06:19 +03:00
Vladimir Enchev
f99fc6f15f SideDialogOptions AutoFocusFirstElement added 2024-08-08 11:49:53 +03:00
Vladimir Enchev
56aaa082da DataGrid custom filtering demo fixed
Fix #1614
2024-08-08 10:51:02 +03:00
Vladimir Enchev
0aaa2f20bd ProfileMenu keyboard navigation improved
Fix #1636
2024-08-08 10:30:51 +03:00
Vladimir Enchev
bac589e3ec DataGrid column null propagation for filtering will be used only for nullable types
Fix #1633
2024-08-08 10:02:29 +03:00
Vladimir Enchev
1dc7b02a3c SplitButton not cleared from DOM after disposed
Fix #1630
2024-08-08 09:43:08 +03:00
Vladimir Enchev
83965afe68 DataGrid CheckBoxList Filter is not showing all values
Fix #1640
2024-08-07 17:57:50 +03:00
Wolfowy
0e9b110023 Check fireChangeEvent before invoking Change event in RadzenUpload (#1638) 2024-08-07 17:42:27 +03:00
yordanov
44f01a77fd Fix SplitButton spacing issue between icon and text. Resolves #1639 2024-08-07 17:18:27 +03:00
yordanov
58552b7a50 Fix Panel's toggle icon colors in Standard Dark theme 2024-08-07 16:43:07 +03:00
Vladimir Enchev
ddf3feac51 Version updated 2024-08-06 12:33:02 +03:00
Vladimir Enchev
c2d59fcee1 DatePicker should not close the popup when setting the day if ShowTimeOkButton is true 2024-08-06 12:31:41 +03:00
yordanov
ee3b2592aa Disable rz-ripple pointer events 2024-08-05 15:59:52 +03:00
yordanov
ed79dfb220 Fix TextAlign css class not properly applied to rz-numeric 2024-08-05 13:06:21 +03:00
yordanov
6fbb942ad9 Fix TextAlign not applied in RadzenNumeric 2024-08-05 12:47:13 +03:00
yordanov
94a9340ee3 Fix #1631 IconColor property not applied in RadzenSplitButtonItem 2024-08-02 19:02:34 +03:00
yordanov
ef6d2b7d2b Restrict box-sizing to .rz- selectors and their children, and disable box-sizing inheritance. Resolves #1632 2024-08-02 09:58:59 +03:00
Vladimir Enchev
7f0b603f60 version updated 2024-08-01 17:48:29 +03:00
Vladimir Enchev
04ec31ea5c GoogleMap custom marker fixed 2024-08-01 17:48:07 +03:00
Vladimir Enchev
d1ff36c44a . 2024-08-01 17:29:36 +03:00
Vladimir Enchev
d703443469 . 2024-08-01 16:48:53 +03:00
Vladimir Enchev
5455a02c4d version updated 2024-08-01 16:11:44 +03:00
yordanov
4bbb186f63 Fix disabled state of AutoComplete and DatePicker in FormField 2024-08-01 15:22:10 +03:00
Vladimir Enchev
b62e8bf976 DropDownBase should not raise ContextMenu event if disabled 2024-08-01 11:04:38 +03:00
Vladimir Enchev
7ccc4fe33a GoogleMap will use default marker label if not set custom 2024-08-01 08:08:33 +03:00
Vladimir Enchev
b52d1cf1e2 ApiKey and MapId info added 2024-08-01 07:58:44 +03:00
Vladimir Enchev
6ee9db0eb8 DataGrid CheckBoxList filtering support improved for collection sub properties 2024-07-29 16:42:16 +03:00
Vladimir Enchev
36ac2a5bfb Missing Include("Customer") added 2024-07-29 13:33:59 +03:00
Vladimir Enchev
e1841c652a Version updated 2024-07-29 10:04:01 +03:00
Vladimir Enchev
6fc2c88482 sorting disabled 2024-07-29 10:03:14 +03:00
Vladimir Enchev
b8a13a5ba4 Filtering sub properties demo added 2024-07-29 09:45:49 +03:00
Vladimir Enchev
d36623c1fb Added DataGrid Contains/DoesNotContain support for collection sub properties 2024-07-29 09:01:21 +03:00
Adam Hewitt
06ab88556c Set 'disabled' attribute on RadzenPager links when on the first/last page (#1627)
* Set 'disabled' attribute on RadzenPager buttons

* add tests

* fix pager test

---------

Co-authored-by: Adam Hewitt <ahewitt@glasswall.com>
2024-07-29 07:42:35 +03:00
Vladimir Enchev
b552790035 Added marker label content for GoogleMap demo
Fix #1624
2024-07-29 07:42:06 +03:00
Atanas Korchev
6610dd22df Show how to use CookieThemeService in .NET 6 & 7. 2024-07-26 19:22:45 +03:00
Atanas Korchev
04dddf92d8 Remove @code{} from the heading. 2024-07-26 17:49:10 +03:00
Atanas Korchev
bedd9c97c2 Add missing step for theme persistence. 2024-07-26 17:33:26 +03:00
Atanas Korchev
81c859ba31 Fix typo in cookie service registration. 2024-07-26 16:51:13 +03:00
Vladimir Enchev
041e662e07 Version updated 2024-07-26 16:14:18 +03:00
yordanov
65c7c66b50 Update premium themes 2024-07-26 16:07:47 +03:00
yordanov
287f2762f9 Update ThemeService demo 2024-07-26 11:39:53 +03:00
yordanov
3750e94ff5 Update icon demos 2024-07-26 10:34:26 +03:00
Atanas Korchev
e127d60345 Append the assembly version to CSS file url to prevent caching of old themes. 2024-07-26 10:21:17 +03:00
Atanas Korchev
5189298884 Add ThemeService demo. 2024-07-26 09:48:20 +03:00
Vladimir Enchev
5a9c370b29 Class changed to class 2024-07-26 08:50:50 +03:00
yordanov
ec4f370f29 Update changelog 2024-07-25 11:18:55 +03:00
yordanov
da194dd88d Update premium themes 2024-07-25 11:06:55 +03:00
yordanov
91e6b86eb3 Update sample dashboard layout 2024-07-25 10:55:58 +03:00
Cosmatevs
550e2d59b4 DataGrid: fix textbox and checkbox indents in simple filters (#1620)
* DataGrid: fix textbox and checkbox indents in simple filters

* use :has(.rz-filter-button) only to change elements other than .rz-filter-button
2024-07-25 10:15:51 +03:00
Vladimir Enchev
80b7ef08c8 TextArea demo updated with auto-resize example
Fix #1501
2024-07-24 10:15:41 +03:00
Vladimir Enchev
7c9ddf0c3f TextArea demo updated with char count example
Fix #1604
2024-07-24 09:53:22 +03:00
Vladimir Enchev
9abdb1d47b Readme updated 2024-07-24 09:16:29 +03:00
Vladimir Enchev
a5171dd9b4 Version updated 2024-07-24 08:31:50 +03:00
Vladimir Enchev
4e7c04efbe Warnings fixed 2024-07-24 08:31:31 +03:00
Vladimir Enchev
d3c66dc750 NET5_0_OR_GREATER preprocessor removed 2024-07-24 08:28:35 +03:00
Vladimir Enchev
7e14357902 Dialog Drag event fixed
Close #1612
2024-07-24 08:11:35 +03:00
Cosmatevs
92f6c2448f RadzenMask: fix string duplication on typing when a character allowed by the pattern (e.g. 2 is in [0-9]) is in the mask (e.g. "+22 *** *** ***") (#1618) 2024-07-24 07:38:35 +03:00
Vladimir Enchev
b05ebe8bdf GoogleMap MapId property added 2024-07-23 18:34:34 +03:00
Vladimir Enchev
0b62390a54 DataGrid CheckBoxList Filter Values repeat values when scroll down
Fix #1616
2024-07-23 18:17:39 +03:00
mayoismyfavoritespice
8c9b5f2a18 added disableSmartPosition option support to enforce style 'top' properties from being corrected automatically (#1613) 2024-07-23 07:21:17 +03:00
Vladimir Enchev
960894c329 Version updated 2024-07-22 18:23:25 +03:00
Vladimir Enchev
a5786ecccf DataGrid cannot insert new row when bound to empty collection
Fix #1610
2024-07-22 18:23:00 +03:00
Atanas Korchev
33a83928e7 Include getting-started as a URL. 2024-07-22 11:25:51 +03:00
Vladimir Enchev
149c6271b3 Made Dialog client-draggable to avoid unwanted content rendering during dragging.
Close #1590
2024-07-22 10:10:59 +03:00
Eric McGaha
031d23df0c HtmlEditor exception when editing previously uploaded image (#1605) (#1606) 2024-07-22 09:04:23 +03:00
Maks
30134bf3b5 Fixed the issue where the DatePicker popup not appeared in RadzenDatePicker when the ShowButton parameter was set to false. (#1607) 2024-07-22 08:46:54 +03:00
yordanov
7907150f17 Fix #1579 Right sidebar does not show on smaller screens and ignores Responsive attribute 2024-07-19 16:23:51 +03:00
yordanov
e5f9639d1e Remove unused css variables in RadzenPager. Resolves #1351 2024-07-19 12:01:01 +03:00
yordanov
47bad16b54 Update to latest Material Symbols Outlined font 2024-07-18 18:58:21 +03:00
yordanov
efa944ef8c Update drop style in DataGridRowDragScheduler demo 2024-07-18 18:00:43 +03:00
Atanas Korchev
68d4cfff16 Update the changelog. 2024-07-18 18:00:34 +03:00
Atanas Korchev
c9c6c4c5ea Remove hash parameters before parsing the query string. 2024-07-18 17:52:56 +03:00
Atanas Korchev
792b3a1267 Tell that AppearanceToggle requires RadzenTheme. 2024-07-18 17:50:01 +03:00
Atanas Korchev
5b64cf6925 Avoid NavigationException on first redirect. 2024-07-18 17:29:51 +03:00
Atanas Korchev
097878b4b2 Query string parsing does not work on Windows. 2024-07-18 17:11:49 +03:00
yordanov
32eca9aabf Update spacing on Get Started page 2024-07-18 16:45:57 +03:00
Vladimir Enchev
7a27432885 Version updated 2024-07-18 16:25:41 +03:00
Vladimir Enchev
92e4249eec 5.0 (#1603)
* Initial commit

Update spacing css classes in demos

Update spacing css classes in demos

Improve Notification layout and styles

Fix Notification with custom position in RTL mode

Update spacing css classes in demos

Add box-sizing: border-box to components

Remove bootstrap css from App.razor

Fix text-align in tabs demos

Rename CSS classes and update markup in RadzenDatePicker

Remove bootstrap scss

Tabs anchor element should inherit the text color

Update margins in typography

Remove bootstrap instructions from get started page

Remove bootstrap css from demos

Update premium themes

Add variable fonts

Remove legacy color tokens and token maps

Remove --rz-form-group-margin-bottom as it is not used

Add base color tokens

Add Base style values

Remove -styles scss map and use  and  styles maps instead

Remove -styles scss map and use  and  styles maps instead

Remove -styles scss map and use  and  styles maps instead

Remove -styles scss map and use  and  styles maps instead

Format button's styles

Reset body margin to 0

Splitter icons should use --rz-icon-font-family

Add styles for image and svg

Replace MaterialIcons font with MaterialSymbols variable font

Update RadzenButton's demos

Update RadzenBadge's demos

Update Colors demo page

Update RadzenProgressBars' demos

Use Base instead of Secondary button style in Confirm Dialog

Update DataGrid Hierarchy demos

Unify DataGrid filter buttons

Replace light with base button styles

Replace secondary with base button style

RadzenTheme, RadzenThemeSwitch and ThemeService.

Reorder base color variables

Add rtl mode animation to ProgressBar

Update SpeechToTextButton default button style and animation

Add CookieThemeService.

Fix base color variable value in software theme

Add Software Dark and Humanistic Dark themes

Update RadzenThemeSwitch

Default base text button should inherit color from its parent element

Update ColoPicker background for transparent color preview

Add Material Dark theme

Material Dark theme is now free

Remove ambiguous method name.

Update demos configurator

Update premium themes

Update the services to follow the options pattern for DI registration.

Improve RadzenThemeSwitch to use the current theme.

Rename ThemeSwitch to AppearanceToggle and add a demo page

Update SplitButton's dropdown icon demo

Create getting-started.html

Update getting-started.html

Update getting-started.html

Add --rz-grid-group-header-item-color and fix column footer color

Fix demos code snippet colors

Add changelog and update demo status badges

Update Changelog

Persist the current theme.

Update getting-started.html

Rename getting-started.html to md.

Render the theme CSS class at RadzenLayout level.

Hide the right sidebar by default.

Isolate CSS variables in a single rule

Revamp the getting started help article.

Remove nested README.md. Link getting started instructions.

Add Scheduler highlight background color css variable

Sidebar border right should be inline-end

Inputs should inherit font-family

Buttons in code viewer and event console should use base button style

Add Standard Dark theme

Update Changelog

Sidebar border right in themes should be inline-end

Render RadzenTheme only when needed.

Add cursor pointer to SidebarToggle

Fix AppearanceToggle margin

Update default theme colors

Update standard theme colors

Fix filter color in humanistic dark theme

Update software dark theme colors

Add humanistic dark wcag theme

Add software dark wcag theme

Add standard dark wcag theme

Buttons for add and remove now use base button style

Update Get Started styling

Update Dark WCAG theme colors

Update SideBar transition styles

Remove theme name css class

Add premium themes

code fixed

more code fixes

* Update Icon demo page content

* Fix --rz-grid-filter-buttons-background-color in Standard theme

* Remove obsolete fonts

* tests fixed

---------

Co-authored-by: yordanov <vasil@yordanov.info>
2024-07-18 16:24:20 +03:00
Vladimir Enchev
6fac0aa0f5 DataGrid filter popup should be always lazy if FilterMode == FilterMode.CheckBoxList 2024-07-18 14:28:05 +03:00
Vladimir Enchev
cd2ede5ce8 DataGrid CheckBoxList filter type filtering fixed 2024-07-18 13:32:08 +03:00
Vladimir Enchev
ac407375ab Dialog Resize and Drag events added 2024-07-18 10:32:18 +03:00
Vladimir Enchev
1730effc55 Version updated 2024-07-17 11:31:14 +03:00
Vladimir Enchev
21c063ac53 Fixed DropDown/ListBox select as you type selects second item first 2024-07-17 11:19:47 +03:00
Vladimir Enchev
2ba2ef9617 Version updated 2024-07-17 10:59:59 +03:00
Vladimir Enchev
cfe2424cff DataGrid LoadColumnFilterData event added to load column filter data for DataGrid FilterMode.CheckBoxList filter mode (#1600)
* DataGrid LoadColumnFilterData event added

* CheckBoxList with OData support added
2024-07-17 10:58:55 +03:00
Vladimir Enchev
397fe2a0c8 DataGrid EnumFilterTranslationFunc not applied to second filter
Fix #1599
2024-07-17 08:45:52 +03:00
TGasimov
e846cc532c RadzenCompareValidator fails when validated RadzenDatePicker value cleared (#1598)
Co-authored-by: Gasimov, Teymur <GasimovT@bv.com>
2024-07-16 16:47:05 +03:00
Vladimir Enchev
d273f99940 DataGrid column GetSortIndex() method added
Fix #1595
2024-07-16 14:07:29 +03:00
Vladimir Enchev
f0763c2b67 Version updated 2024-07-15 17:47:34 +03:00
Justyna Sienkiewicz
48d6293ab6 Fixed inserting to CurrentItems (#1596) 2024-07-15 17:46:37 +03:00
yordanov
0e270595df Add responsive styles to DataGrid simple filter mode with menu. Resolves #1586 2024-07-15 16:43:38 +03:00
yordanov
db6770159e Fix ability to set width and height of a SplitButton 2024-07-15 14:33:47 +03:00
Vladimir Enchev
e6bf1ed6f7 DataGrid CheckBoxList filter demo FilterPopupRenderMode set to PopupRenderMode.OnDemand 2024-07-12 10:53:06 +03:00
Vladimir Enchev
996dd11e24 Version updated 2024-07-11 11:12:04 +03:00
Krystian Szatan
4ea1f20022 RadzenSteps - Added AllowStepSelect parameter (#1591) 2024-07-11 11:10:16 +03:00
Vladimir Enchev
a56cfc5688 DropDown, DropDownDataGrid and ListBox code updated (#1593) 2024-07-11 10:58:33 +03:00
Paul Ruston
d71d05374f MonthSelect event on all Year Views (#1587)
* MonthSelect event on all Year Views in rendering

* Resolve initial PR oversights

* Resolve initial PR oversights 2
2024-07-10 17:59:29 +03:00
Barry
99b82b24d0 Add RadzenDataAnnotationValidator to Support Data Annotation Validation (#1588)
* implement data annotation validator

* Rebase to latest `master` branch. Update the demo. Use PropertyAccess.Getter instead of reflection.

---------

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2024-07-10 17:58:40 +03:00
Vladimir Enchev
5cfe624e25 Dialog focus trap will cycle between first and last focusable elements
Fix #1585
2024-07-10 11:29:40 +03:00
Vladimir Enchev
62066e04e3 PickList Disabled property added 2024-07-10 10:59:44 +03:00
Vincent Schmandt
5478c014f1 Add PackageLicenseExpression (#1578)
* Add PackageLicenseExpression

* Remove PackageLicenseFile as only PackageLicenseFile or PackageLicenseExpression can be provided

See also https://github.com/microsoft/vstest/issues/4816
2024-07-10 10:07:55 +03:00
Vladimir Enchev
aea3147454 DataGrid column col element width not reset properly
Fix #1582
2024-07-09 13:41:17 +03:00
Daniel Jonsson
e466de4d0e Fix a spelling error in StepsCanChange.razor (#1581) 2024-07-05 13:39:44 +01:00
Vladimir Enchev
0de3cf72b8 demo updated 2024-07-03 11:15:51 +03:00
Vladimir Enchev
41fa97994e Version updated 2024-07-03 10:21:05 +03:00
Vladimir Enchev
d03a563e0d Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2024-07-03 10:10:45 +03:00
Vladimir Enchev
0f89c0b112 Tree Checkable delegate fixed
Fix #1580
2024-07-03 10:10:42 +03:00
Atanas Korchev
07ae096af2 Ignore chart series radius if it exceeds the series size. Fixes #1576. 2024-07-01 18:52:59 +03:00
Zagidin Selimov
11e4d482f4 fix (#1575)
Co-authored-by: Zagidin Selimov <zselimov@adeptik.com>
2024-07-01 18:49:47 +03:00
Vladimir Enchev
f959e3b869 version updated 2024-07-01 17:33:16 +03:00
Vladimir Enchev
ec19bfb556 Dialog AutoFocusFirstElement will always focus first HtmlEditor 2024-07-01 17:31:10 +03:00
Vladimir Enchev
fa4edf9845 Drag from DataGrid to Scheduler demo added
Drag & Drop demos combined in separate category
2024-06-28 14:53:06 +03:00
Vladimir Enchev
ab52430846 DataGrid should clear filter values for other columns on ClearFilter 2024-06-28 10:50:50 +03:00
Vladimir Enchev
6045869260 Version updated 2024-06-28 10:18:04 +03:00
Vladimir Enchev
c08a598658 DataGrid CheckBoxList filter values collection will respect filters applied to other columns 2024-06-28 10:16:50 +03:00
Vladimir Enchev
340483bf7f DataGrid CheckBoxList filter should clear the column filter if no values are checked 2024-06-28 10:01:56 +03:00
Vladimir Enchev
87395e0ec4 Fixed DataGrid wrong column/rowspan in some cases with composite columns 2024-06-28 09:52:15 +03:00
Atanas Korchev
694194dd01 Allow developers to specify drag-and-drop events via SlotRender. 2024-06-28 09:23:38 +03:00
Vladimir Enchev
aa6935820d Version updated 2024-06-27 12:01:25 +03:00
Vladimir Enchev
57c038dca6 Added Checkable/CheckableProperty similar to Text/TextProperty in the RadzenTreeItem/RadzenTreeLevel 2024-06-27 12:00:57 +03:00
Vladimir Enchev
fe69b1419f Version updated 2024-06-27 11:36:21 +03:00
Vladimir Enchev
0cf7365755 Menu cannot open sub item with ClickToOpen=true 2024-06-27 11:35:54 +03:00
efinder2
7e96f776ff Changes aria-live regions for better screen reader (#1571)
* changed aria for screen reader

* fix div

* reverted RadzenAlert
2024-06-27 11:34:18 +03:00
Vladimir Enchev
e5ce3d46de Version updated 2024-06-26 10:15:11 +03:00
Vladimir Enchev
f097cb3c3a @nameof() used to set various property names across all demos 2024-06-26 10:13:54 +03:00
Vladimir Enchev
23aea7b794 Fixed DataGrid column picker filtering exception with columns without Title 2024-06-25 10:35:57 +03:00
Vladimir Enchev
c2839fdc29 Menu items not reachable in some case with ClickToOpen=false 2024-06-25 09:28:20 +03:00
Vladimir Enchev
3fbd64338c Fixed DataGrid UpdateRow() method for items with overridden Equals/GetHashCode() 2024-06-24 18:10:07 +03:00
Vladimir Enchev
36a2917b17 Version updated 2024-06-24 16:20:35 +03:00
Vladimir Enchev
9f3fc43791 DataGrid should not request all IQueryable data when virtualization is enabled in some cases 2024-06-24 16:20:10 +03:00
Vladimir Enchev
4774d2d1fd Version updated 2024-06-24 09:32:31 +03:00
Vladimir Enchev
91de8a5a8f Numeric tests fixed 2024-06-24 09:10:36 +03:00
Vladimir Enchev
652005264b Fixed DataGrid composite column wrong colspan when child column has no children
Fix #1568
2024-06-24 08:36:42 +03:00
Simon Pawlowski
98967410cb prevent numeric overflow on step up/down (#1570) 2024-06-24 08:16:03 +03:00
Vladimir Enchev
55b2e3f1ff Fixed Numeric overflow exception with byte as TValue
Fix #1567
2024-06-21 07:45:29 +03:00
Vladimir Enchev
cf8ddc98af DropDown and ListBox should not select items with SelectAll() if ReadOnly
Fix #1566
2024-06-21 07:33:58 +03:00
Atanas Korchev
f259fa85a5 Hide the right sidebar by default. 2024-06-19 16:24:12 +03:00
Atanas Korchev
5ea6c7739f Enable properly automatic layout of the Monaco editor. 2024-06-18 17:43:08 +03:00
Atanas Korchev
eac071af9d RadzenArcGauge does not use the Max scale value in some cases. 2024-06-18 17:37:03 +03:00
Vladimir Enchev
2b0f424af6 Version updated 2024-06-17 07:36:57 +03:00
Vladimir Enchev
fcbfd28025 DataGrid composite columns column span fixed in some cases 2024-06-17 07:36:36 +03:00
yordanov
37982fe416 Fix focus states in Scheduler day view 2024-06-14 12:10:49 +03:00
Vladimir Enchev
6824c85820 Fixed DataGrid advanced filter with empty/not empty operators 2024-06-14 09:02:32 +03:00
Vladimir Enchev
bd9f76222a DataGrid Conditional Columns render demo added 2024-06-13 11:32:44 +03:00
Paul Ruston
349e771f74 Fix DaySlotEvents rendering (#1531)
* Fix DaySlotEvents rendering

* Revert "Fix DaySlotEvents rendering"

This reverts commit 4982cd14bf.

* Day Rendering Process

* Updated comments regarding algorithm

* Changes as per https://github.com/radzenhq/radzen-blazor/pull/1531#issuecomment-2160029819
2024-06-13 11:23:43 +03:00
Vladimir Enchev
83c2993cef Version updated 2024-06-12 08:21:24 +03:00
Vladimir Enchev
dbb91fa140 AutoComplete OpenOnFocus added
Fix #1560
2024-06-12 08:09:11 +03:00
Vladimir Enchev
849ca6803d DataGrid should not set rowspan/colspan less than 1 2024-06-12 07:57:36 +03:00
bert-algoet
f41288f441 When using multiselect dropdown with chips, stop dropdown van repositioning when there is enough room below the dropdown. (#1559) 2024-06-12 07:55:20 +03:00
Robert McLaws
9e974d5c30 Adds CalculatedCssClass Func to RadzenDataGridColumn to allow users to style the cell based on properties of the underlying object. (#1561) 2024-06-12 07:55:02 +03:00
Vladimir Enchev
62d25ee917 DataGrid composite columns column span fixed 2024-06-11 19:13:53 +03:00
Milo Davis
652a5dd27d Add support for proper OData filtering of numeric data grid columns with null or not null options (#1558)
Co-authored-by: Milo Davis <DavisM@steelers.nfl.com>
2024-06-11 08:45:34 +03:00
Rudolf de Schipper
1051bfa661 Rename linq filtering data filter (#1557)
* Update QueryableExtension.cs to add ToLinqFilterString

Add ToLinqFilterString extension method plus 2 supporting methods, allowing RadzenDataFilter to create Linq-compatible filter strings

* Update QueryableExtension.cs - rename ToLinqFilterString

rename ToLinqFilterString into ToFilterString, to align with common practice.
2024-06-11 08:44:35 +03:00
Robert McLaws
3a3c481e3b [DataGrid] Enhanced DataGridColumn EditMode control (#1550)
* Adding RadzenGridColumn.IsInEditMode property, updating render check in RadzenDataGrid, and updating associated demo.

* Removed unnecessary usings.
2024-06-10 17:56:08 +03:00
Vladimir Enchev
9642c58d94 DataGrid CheckBoxList filter will check if Property/FilterProperty is defined 2024-06-10 17:55:06 +03:00
Sean Martz
72d37ab218 Add ability for RadzenDataGrid.Query to filter DateOnly datatypes (#1548)
Co-authored-by: seanmartz <smartz@smart-union.org>
2024-06-10 17:40:57 +03:00
Atanas Korchev
a2047f9498 RadzenHtmlEditor does not update the EditorContext state when its value changes. 2024-06-10 12:06:45 +03:00
Atanas Korchev
22a94130f2 Version updated 2024-06-07 15:04:43 +03:00
Vladimir Enchev
6a907ff0c2 Revert "Add filter capabilities for DateOnly in RadzenDataGrid (#1545)" (#1546)
This reverts commit 25572a9d57.
2024-06-07 14:43:45 +03:00
Vladimir Enchev
11e0ca29d4 Version updated 2024-06-07 09:05:08 +03:00
Vladimir Enchev
47cd4ef790 DataGrid CheckBoxList filtering improved 2024-06-07 09:04:43 +03:00
Sean Martz
25572a9d57 Add filter capabilities for DateOnly in RadzenDataGrid (#1545)
* Add DateOnly functionality

* Undo mass formatting

---------

Co-authored-by: seanmartz <smartz@smart-union.org>
2024-06-07 08:53:55 +03:00
Vladimir Enchev
02b94e5672 CheckBoxList should not select disabled items on select all 2024-06-07 07:41:04 +03:00
Vladimir Enchev
23790fefd6 DataGridCheckBoxListFilter demo updated 2024-06-06 16:48:13 +03:00
Vladimir Enchev
3c8e4a24c6 more obsolete code deleted 2024-06-06 16:39:22 +03:00
Vladimir Enchev
0f754055ab obsolete method removed 2024-06-06 16:37:52 +03:00
Vladimir Enchev
ac7c2612b2 DataGrid InCell Editing demo added
Fix #1543
2024-06-06 16:28:29 +03:00
Vladimir Enchev
7b54ff2046 DataGrid cannot expand/collapse group items when virtualized 2024-06-06 11:04:57 +03:00
Vladimir Enchev
c7743ffdbe DropDown grouping with multiple select demo imroved 2024-06-06 10:17:56 +03:00
Vladimir Enchev
7a604d39bd Version updated 2024-06-04 09:30:01 +03:00
nitrouscookies
7c67f8bba1 Add FilterOperator null check so SetParametersAsync doesn't override initial values (#1542)
Co-authored-by: dstillwell <dstillwell@moorheadschools.org>
2024-06-04 08:53:34 +03:00
Vladimir Enchev
6f2ca41eb6 Fix DropDownDataGrid Chips render to use ValueTemplate/Template if defined exactly like DropDown
Close #1539
2024-06-03 10:21:34 +03:00
Vladimir Enchev
b26ac16201 RadzenDropDownDataGrid Reset() does not work when Multiple= true
Fix #1540
2024-06-03 09:37:54 +03:00
Vladimir Enchev
71b7ba70d1 SecurityCode will use autocomplete="one-time-code" 2024-06-03 08:55:44 +03:00
bert-algoet
96bd62e0cc Check if SelectItem is null before calling disabledPropertyGetter (#1538) 2024-06-03 08:51:58 +03:00
Atanas Korchev
c2ce598d0f Update the SSRSViewer documentation. 2024-05-31 11:37:55 +03:00
Vladimir Enchev
cf56069804 Version updated 2024-05-31 10:54:25 +03:00
Vladimir Enchev
7834b535d6 DatePicker cannot set hour to 0 when bound to TimeOnly 2024-05-31 10:11:10 +03:00
Vladimir Enchev
4b440199a2 Demo style updated
Fix #1535
2024-05-30 14:51:43 +03:00
Vladimir Enchev
4facfa5c7a Added custom style for drag over DataGrid row 2024-05-30 09:59:16 +03:00
Vladimir Enchev
99ab247c06 Version updated 2024-05-29 15:50:39 +03:00
Kasun Jalitha
5cf12fced5 Modified the RadzenSplitButton to allow customizing its dropdown icon. (#1530)
* Modified the RadzenSplitButton to allow customizing its dropdown icon.

* Changed the text in demo page.
2024-05-29 15:49:41 +03:00
Vladimir Enchev
5abc92308a DatePicker DateTime Kind not set properly in some cases 2024-05-29 10:15:33 +03:00
Vladimir Enchev
ed50ca5b53 RadzenMask caret position kept during input
Fix #1529
2024-05-28 10:10:34 +03:00
Atanas Korchev
3e8eb1a6eb Implement TodaySelect event in RadzenScheduler 2024-05-26 10:54:03 +03:00
Vladimir Enchev
d360c584c1 Version updated 2024-05-24 12:34:58 +03:00
Vladimir Enchev
55482bf28a DataGrid CheckBoxList filtering fixed to work properly with enums and FilterTemplate 2024-05-24 12:33:59 +03:00
Vladimir Enchev
bcf5b4c1b2 unused demos deleted 2024-05-24 10:49:55 +03:00
Vladimir Enchev
7098e28532 code updated 2024-05-23 15:15:03 +03:00
Vladimir Enchev
ab8aa2e1ae demo fixed 2024-05-23 15:13:50 +03:00
Vladimir Enchev
97fc9a8b37 more demo updates 2024-05-23 15:12:42 +03:00
Vladimir Enchev
5f91a4561b DropDown demos group items start margin defined 2024-05-23 15:09:41 +03:00
Vladimir Enchev
b5dd56f187 ValueTemplate improved 2024-05-23 14:47:20 +03:00
Vladimir Enchev
819f0b7d7e Version updated 2024-05-23 13:11:20 +03:00
Vladimir Enchev
16399d4512 HeaderTemplate added to DropDownDataGrid, HeaderTemplate and ItemRender added to DropDown and ListBox
DropDown grouping demos improved, ListBox item Disabled fixed
2024-05-23 13:10:41 +03:00
Vladimir Enchev
86df184463 Cannot read properties of null (reading 'querySelector') at Object.createDatePicker
Fix #1523
2024-05-22 08:37:16 +03:00
Vladimir Enchev
a4a2d66b85 Version updated 2024-05-21 11:05:53 +03:00
Vladimir Enchev
1fb972cf2a DatePicker will not select with PopupRenderMode="PopupRenderMode.OnDemand"
Fix #1473
2024-05-21 09:35:28 +03:00
Krystian Szatan
f1ab0e3449 Added missing ContentCssClass set in DialogService (#1521)
* Dialog - custom container class

New parameter ContentCssClass

* Update DialogContainer.razor

* Revert rz-dialog-titlebar

* Update DialogService.cs

Added ContentCssClass
2024-05-21 09:33:02 +03:00
Vladimir Enchev
5032646090 Version updated 2024-05-20 15:17:58 +03:00
Atanas Korchev
2facce9633 Include text measurement data for cyrillic characters. Closes #1505. 2024-05-20 13:47:42 +03:00
Krystian Szatan
bce50b991e Dialog - custom container class (#1518)
* Dialog - custom container class

New parameter ContentCssClass

* Update DialogContainer.razor

* Revert rz-dialog-titlebar
2024-05-20 12:57:23 +03:00
Atanas Korchev
bd1a5ef046 Provide parsing config when using Dynamic Linq methods in order to improve initial performance. 2024-05-20 10:55:21 +03:00
stlufred
47e9b4b587 Fix exception if TreeLevel has no Text nor TextProperty (#1515)
This can happen when using template.
2024-05-19 17:21:16 +03:00
Vladimir Enchev
676e6127cd Version updated 2024-05-16 16:45:50 +03:00
Vladimir Enchev
7b192a4e14 demo updated 2024-05-16 16:15:22 +03:00
Vladimir Enchev
e3239ed0b3 Tree ItemContextMenu event added 2024-05-15 11:03:03 +03:00
Marco Papst
1423454191 Add a Footer template to RadzenDropZone (#1503)
* Add a Footer template to RadzenDropZone

* Add header over the Footer Template Demo

* rename FooterTemplate to Footer
2024-05-15 09:53:08 +03:00
Vladimir Enchev
285b6367ed RadzenDataGrid EmptyTemplate alignment/colspan is incorrect when Data Grid uses Grouping
Fix #1504
2024-05-15 09:52:02 +03:00
Vladimir Enchev
2907403f82 Version updated 2024-05-13 18:06:06 +03:00
Vladimir Enchev
9a735639d4 DataGrid crosstab example added 2024-05-13 12:00:10 +03:00
Vladimir Enchev
375e3c4636 SecurityCode backspace support added 2024-05-13 09:41:31 +03:00
Vladimir Enchev
ab3d7078bf demo updated 2024-05-10 16:09:06 +03:00
Vladimir Enchev
3b191b917b Tree drag & drop demo added 2024-05-10 15:46:57 +03:00
Vladimir Enchev
4be129917a DataGrid group should not be collapsed if set Expanded = true in GroupRowRender 2024-05-09 16:18:22 +03:00
Vladimir Enchev
507f508497 demo fixed 2024-05-09 15:20:41 +03:00
Vladimir Enchev
4b063b3493 Drag row between two DataGrids demo added 2024-05-09 10:43:46 +03:00
Vladimir Enchev
8e457a20bc DataGrid rows reorder demo updated 2024-05-08 18:28:31 +03:00
Vladimir Enchev
b9716cf2a3 DataGrid rows reorder demo added 2024-05-08 17:10:24 +03:00
Vladimir Enchev
b05a4ab83a version updated 2024-05-08 09:32:41 +03:00
Vladimir Enchev
ca75eb651d Fixed DropDownDataGrid steal focus in some cases 2024-05-08 09:32:17 +03:00
Vladimir Enchev
a6329fd3c0 Numeric and Android SecurityCode input improved 2024-05-07 12:11:30 +03:00
Atanas Korchev
89e33e984b Use the Culture set for RadzenScheduler when displaying the month name in year view. 2024-05-07 10:19:55 +03:00
Atanas Korchev
40c0b85a10 Use the Culture set for RadzenScheduler when displaying the title of the "More" dialog in month view. 2024-05-07 10:13:25 +03:00
Vladimir Enchev
7cdb199855 MaxFileCount default value changed to 10 2024-05-07 10:05:39 +03:00
Vladimir Enchev
8c165dc17f Upload MaxFileCount property added 2024-05-07 09:55:55 +03:00
Vladimir Enchev
43fe21a87d version updated 2024-05-06 17:50:19 +03:00
Vladimir Enchev
4b7559f2ec Various button title and aria-label attributes added 2024-05-06 16:52:29 +03:00
Vladimir Enchev
9e026034d7 DropDownBase EmptyAriaLabel property added 2024-05-06 16:24:10 +03:00
Vladimir Enchev
9466ccb12a Fixed "Anchor element found with no link content and no name and/or ID attribute." accessibility error 2024-05-06 11:09:57 +03:00
Vladimir Enchev
f53f314f0b Title set to DataGrid advanced filter apply and clear buttons 2024-05-06 09:59:30 +03:00
Vladimir Enchev
9b53a3a052 various input attributes added 2024-05-06 09:32:14 +03:00
Vladimir Enchev
7f8a95646a Fixed error in RadzenDataGrid FilterMode="FilterMode.CheckBoxList"
Fix #1498
2024-05-06 09:21:58 +03:00
Paul Ruston
88d452a9fa Don't set filterOperator if Custom (#1497) 2024-05-03 17:45:55 +03:00
Vladimir Enchev
ee2e1412d6 Version updated 2024-05-02 08:42:54 +03:00
melfon
f2ea6af1c3 Uses pointer event instead of mouse event to track splitter movements (#1496)
Co-authored-by: Tomas Wiell <tomas.wiell@scientaomicron.com>
2024-05-02 08:41:47 +03:00
Vladimir Enchev
76bd5d7518 DropDownBase indexer property binding imporved 2024-05-02 08:33:46 +03:00
Vladimir Enchev
70626ccb79 DropDownDataGrid should check column Type 2024-05-02 08:07:10 +03:00
Vladimir Enchev
124fca6d1f DropDownDataGrid selected row not cleared on value clear 2024-05-01 09:31:56 +03:00
Vladimir Enchev
37154cc1ef Version updated 2024-04-30 19:53:19 +03:00
Vladimir Enchev
9f42ad5746 DropDownDataGrid binding to dynamic data demo added 2024-04-30 19:53:00 +03:00
Vladimir Enchev
94c19c8724 DataGrid SetFilterValue for enums fixed
Fix #1493
2024-04-30 19:06:26 +03:00
Atanas Korchev
c3dd9a5f14 Uploading an image when UploadUrl is not set would insert the image as base64 encoded data. 2024-04-30 15:06:38 +03:00
yordanov
8f2a6acb7b Update DropZone demos 2024-04-30 09:37:19 +03:00
Vladimir Enchev
821817fc89 DropZone component added (#1492)
* DropZone component added

* DropZone and DropZoneItem rendering improved

* rz-can-drop/rz-no-drop css classes added

* Update DropZone styles and demo

* dragCssClass added

* Update DropZone styles and demo

* Update premium themes

* Update navigation items

* DropZoneCanDropNoDropStyles  demo added

* item styles added

* Allow drop over zone no matter if has items

* Update styles in DropDzone demos

* Use dragover instead dragenter to apply css class

---------

Co-authored-by: yordanov <vasil@yordanov.info>
2024-04-30 09:08:46 +03:00
Vladimir Enchev
0f3097590f Version updated 2024-04-29 16:18:04 +03:00
Vladimir Enchev
20826fff54 Drag and drop files to upload demo added 2024-04-29 14:39:31 +03:00
Vladimir Enchev
9067e1d8d1 Fixed Cast() exception with DataGrid FilterMode CheckBoxList 2024-04-29 13:32:52 +03:00
Vladimir Enchev
dbf983e287 DataGrid should not render <col> element for group expand column when ShowGroupExpandColumn=false
Fix #1490
2024-04-29 10:16:38 +03:00
Vladimir Enchev
f81043133a RadzenCompareValidator ValidateOnValueChange property added
Fix #1487
2024-04-29 10:04:02 +03:00
Vladimir Enchev
cab9b0bd1e Fixed DataGrid initial enum filter not selected in the filtering DropDown
Fix #1489
2024-04-29 09:28:08 +03:00
Vladimir Enchev
d9b42016dc Improved DataGrid grouping performance
Fix #1486
2024-04-26 09:30:59 +03:00
Vladimir Enchev
5ee5a23b29 Version updated 2024-04-25 10:06:07 +03:00
Vladimir Enchev
a1f33d93c1 Chart CartesianSeries DateOnly exception fixed
Fix #1484
2024-04-25 10:05:04 +03:00
Vladimir Enchev
1f9a19c37a Fixed virtualized DropDown null ref. exception on ENTER key press
Fix #1483
2024-04-24 19:23:51 +03:00
Vladimir Enchev
9e9d371a3f Version updated 2024-04-24 11:25:09 +03:00
Vladimir Enchev
b97136a606 Issue drag scrolling Dialog content on mobile after moving dialog
Fix #1480
2024-04-24 11:23:43 +03:00
Vladimir Enchev
f1df463a07 RadzenDropDown SelectedItemChanged keeps repeating forever
Fix #1479
2024-04-24 10:58:45 +03:00
Vladimir Enchev
e59c335cac DataGrid dynamic data demo updated with enum 2024-04-24 10:50:32 +03:00
Vladimir Enchev
a9280edf97 Version updated 2024-04-23 19:03:43 +03:00
Vladimir Enchev
68eca70a31 version updated 2024-04-23 19:01:39 +03:00
Vladimir Enchev
dd68c35295 DataGrid ungrouping in virtualized mode throws error 2024-04-23 19:01:16 +03:00
Vladimir Enchev
57530af792 DateOnly supported added to DataGrid component
Fix #1478
2024-04-23 10:32:32 +03:00
Vladimir Enchev
4947fa91ef Column FormatString used for Excel filter 2024-04-22 18:51:51 +03:00
Vladimir Enchev
c605cc77d5 GetFilterValues() improved 2024-04-22 18:51:29 +03:00
Vladimir Enchev
6fe6b681ac DataGrid FilterMode.CheckBoxList (Excel like) filtering added 2024-04-22 18:51:03 +03:00
Vladimir Enchev
08884af624 Version updated 2024-04-22 17:15:39 +03:00
Vladimir Enchev
2adfbb5169 Revert "Implement OpenPopup and ClosePopup Events for Radzen Dropdown (#1471)" (#1477)
This reverts commit f6e05a27d8.
2024-04-22 14:10:47 +03:00
Atanas Korchev
831c3c4fa4 Column and bar radius is not applied in some cases. Fixes #1464. 2024-04-22 12:52:19 +03:00
Vladimir Enchev
df87b51e63 ClosePopup() renamed to PopupClose 2024-04-22 11:03:41 +03:00
Atanas Korchev
a17fceac39 Stacked bar and column series do not work with negative values. Closes #1475. 2024-04-22 10:58:24 +03:00
luis507pty
f6e05a27d8 Implement OpenPopup and ClosePopup Events for Radzen Dropdown (#1471)
* Add Parameters OnOpenPopup and OnClosePopup to handler events

* Add CheckAndTriggerPopupStateChange method

* Add RadzenDropDown Action Methods OnOpenPopup And  OnClosePopup.

* Radzen.closePopup send DotNetObjectReference

* -Use EventCallBack
- Change property name OnOpenPopu to OpenPopupCallback
- Change property name OnClosePopup to ClosePopupCallback

* validate and invoke delegate

* -Change name the internal method OpenPopup to TogglePopup

---------

Co-authored-by: Desarrollador 04 04 <develop04@smrey.com>
2024-04-22 10:27:19 +03:00
Atanas Korchev
19cb4ee7a4 Stacked area series do not support negative values. 2024-04-22 10:23:52 +03:00
Vladimir Enchev
8d4f853432 Pager aria-current attribute added for current page 2024-04-19 11:17:15 +03:00
nielsNocore
76eaac5d31 add ability to add custom button content to a split button (#1470) 2024-04-19 09:46:43 +03:00
Atanas Korchev
5c02943ab3 Clicking a link in RadzenHtmlEditor sometimes navigates. Closes #1467. 2024-04-19 09:43:13 +03:00
Atanas Korchev
09a38e2dcd Exception is thrown when updating the data of pie or donut series and a tooltip is shown. 2024-04-19 09:29:20 +03:00
Vladimir Enchev
4a772953dd DropDownBase SelectedItemChanged changed from Action to EventCallback 2024-04-18 15:07:47 +03:00
Vladimir Enchev
be544e09cf Version updated 2024-04-18 11:52:24 +03:00
Vladimir Enchev
8a817980db Draggable requires single touch to start drag after first drag end
Fix #1469
2024-04-18 11:49:56 +03:00
Vladimir Enchev
1dbfbe5d5f Tab cannot be selected in some cases when TabRenderMode.Client after add/remove
Fix #1466
2024-04-18 10:47:55 +03:00
Vladimir Enchev
53ed0dc12d RadzenDropDownDataGrid is not displaying empty text
Fix #1465
2024-04-18 09:57:52 +03:00
nielsNocore
1bbff65f5d add method to collapse all items, which allow collapse all rows in a datagrid, whithout iterating all items in the page. (#1468)
small refactoring duplicate code to correctly collapse an aitem.
2024-04-18 09:49:44 +03:00
Vladimir Enchev
8e5e9ab517 CascadingTypeParameter added for DataFilter, DataList, DataGrid and TemplateForm components 2024-04-17 15:41:15 +03:00
yordanov
c2d37932e1 Replace padding in Scheduler's view header with auto scroll width 2024-04-16 17:33:00 +03:00
Vladimir Enchev
7e7bbd4591 Pager navigate to page with ENTER/SPACE index fixed 2024-04-15 14:28:05 +03:00
Vladimir Enchev
6d2d3c4c3b Version updated 2024-04-15 13:19:40 +03:00
yordanov
a1ba7f9e5f Pager focus styles should be visible only when needed 2024-04-12 12:57:49 +03:00
yordanov
b89949e361 Fix disabled state of DatePicker in FormField 2024-04-11 14:52:40 +03:00
yordanov
72ad111198 Remove redundant border property 2024-04-11 14:28:35 +03:00
yordanov
00b4e9a9b4 Fix disabled state of buttons in Upload and FileInput 2024-04-11 12:55:06 +03:00
Vladimir Enchev
a460fe12a1 DropDownBase should not loose focus on select all 2024-04-10 16:15:58 +03:00
yordanov
7e4fdcd9a3 Update Scheduler responsive styles. Adds container media queries and resolves #1445 2024-04-10 16:11:12 +03:00
Vladimir Enchev
0f4d06b4d4 Version updated 2024-04-10 10:26:39 +03:00
Marat Chiraev
bfbf6edc87 Fixed a bug where it was possible to apply a filter on an empty string (#1458) 2024-04-10 10:21:15 +03:00
Vladimir Enchev
5027e2f03a TextBox, TextArea and Password components will unable to show ContextMenu if Name is set 2024-04-10 10:20:25 +03:00
yordanov
70ea05c0ca Hide clear icon in disabled DropDown and DatePicker and unify disabled color of trigger icon 2024-04-09 18:06:15 +03:00
yordanov
5e9d9abe10 Fix DropDown and DatePicker icon and text colors in disabled and hover states 2024-04-09 17:36:19 +03:00
Vladimir Enchev
128495dd91 Version updated 2024-04-09 16:43:08 +03:00
Stefan
314a8c0741 Make MaxLength a parameter (#1456) 2024-04-09 08:59:08 +03:00
Vladimir Enchev
8c6ca6f8f7 PickList invalid cast exception fixed 2024-04-09 08:58:33 +03:00
yordanov
421bb3b701 Fix layout of SelectBar bind value demo 2024-04-08 15:47:59 +03:00
Vladimir Enchev
a8e9ef49f4 Fixed RadzenDropDown EnterKey ArgumentOutOfRangeException 2024-04-08 15:35:53 +03:00
Vladimir Enchev
2474ad8d1d Version updated 2024-04-08 15:15:51 +03:00
Vladimir Enchev
dd58ac01ed DataGrid simple filter mode by string properties fixed 2024-04-08 15:15:40 +03:00
Vladimir Enchev
fd4fc377a1 Version updated 2024-04-08 11:26:20 +03:00
Vladimir Enchev
3b31cec3e7 DataGrid will clear column filters on escape and will not allow set or filter value if empty operator type is selected
Close #1454
2024-04-08 10:08:49 +03:00
Vladimir Enchev
28fc95dd1f DataGrid Reset() should not call SaveSettings() 2024-04-08 09:28:16 +03:00
Vladimir Enchev
d7dc51980a Version updated 2024-04-04 09:41:44 +03:00
Vladimir Enchev
1fd1f08f33 DataGrid LoadSettings event should mark Settings as changed 2024-04-04 09:28:47 +03:00
Vladimir Enchev
f43ec50369 Update DataGridColumnResizingPage.razor 2024-04-03 17:12:06 +03:00
Vladimir Enchev
d4b6b5744d DatePicker will show popup when clicking on input field when AllowInput set to false
Fix #1449
2024-04-02 21:30:24 +03:00
Vladimir Enchev
3ae9ddf0f9 Version updated 2024-03-29 18:05:03 +02:00
Vladimir Enchev
4a61e5cbdb Fixed DropDownBase display description 2024-03-29 18:04:55 +02:00
Vladimir Enchev
44b031af15 Version raised 2024-03-29 13:47:07 +02:00
Vladimir Enchev
ad197f85de Version updated 2024-03-29 13:44:57 +02:00
Atanas Korchev
e7c2990b79 RadzenCompareValidator throws error when put inside RadzenFormField. 2024-03-29 12:40:25 +02:00
Vladimir Enchev
21aa33c862 demo updated 2024-03-29 10:50:40 +02:00
Vladimir Enchev
3f8cd143b6 Tree TreeItemRender event added 2024-03-28 19:06:30 +02:00
Vladimir Enchev
5d25fec242 Version updated 2024-03-28 16:13:21 +02:00
yordanov
8aec9f3f25 Update premium themes 2024-03-28 15:33:28 +02:00
Vladimir Enchev
81d14cbecc Selection in Dialog title disabled 2024-03-28 14:50:25 +02:00
Vladimir Enchev
6f1f4cc576 DropDownBase will fallback to PropertyAccess.GetItemOrValueFromProperty() if strongly typed property getters are not initialized 2024-03-28 14:35:55 +02:00
Vladimir Enchev
f81be0a075 RadzenCompareValidator should not validate on first render
Fix #1446
2024-03-28 14:29:00 +02:00
Vladimir Enchev
2aa57404f2 Close of nested popups fixed 2024-03-28 14:11:23 +02:00
Vladimir Enchev
d43cb4b097 Version updated 2024-03-27 16:38:17 +02:00
Vladimir Enchev
7d69100d2d DatePicker Disabled change not working properly when inside FormField 2024-03-27 16:37:58 +02:00
Vladimir Enchev
c04a975dba CompareValidator Value change logic improved 2024-03-27 10:46:56 +02:00
Vladimir Enchev
59f920445c CompareValidator should be revalidated on Value change 2024-03-27 10:28:48 +02:00
Marcel Siegel
72425b243b avoid add invalid items in InsertInCurrentItems (#1442)
Co-authored-by: Marcel Siegel <marcel@siegelnet.de>
2024-03-27 08:57:02 +02:00
MitchKuijpers
8af777fac4 Made it so the ValueTemplate will also be applied when using multiselect. (#1441) 2024-03-27 08:56:30 +02:00
yordanov
510d94b21c Tabs selected color and bg color should be applied to the same element. Addresses comments in #1303 2024-03-26 18:26:14 +02:00
Vladimir Enchev
476cfec461 Version updated 2024-03-26 11:29:16 +02:00
Vladimir Enchev
642869ffed PickList buttons disabled state fixed 2024-03-26 11:29:07 +02:00
Vladimir Enchev
4e6a552689 Version updated 2024-03-26 11:03:20 +02:00
Vladimir Enchev
707581f103 PickList invalid cast exception when selecting all items in multiple mode 2024-03-26 11:03:03 +02:00
Vladimir Enchev
ef68d43acb TextBox, Mask and Numeric aria-autocomplete custom attribute value support added
Close #1440
2024-03-26 09:50:16 +02:00
Vladimir Enchev
50f15f7539 RadioButtonListItem InputAttributes added 2024-03-25 15:45:30 +02:00
Vladimir Enchev
9f2ae92236 DatePicker popup should be destroyed only on Visible property change 2024-03-25 15:37:21 +02:00
Vladimir Enchev
854f14a014 version updated 2024-03-25 10:53:23 +02:00
Elias-Constantin Regber
cdeef6aae0 Fix (#1438) 2024-03-25 09:48:17 +02:00
Vladimir Enchev
5000a56620 Fixed wrong Tabs item selected after visible change when TabRenderMode.Client 2024-03-25 09:24:39 +02:00
Vladimir Enchev
e5438a7c37 DatePicker input will be focused on calendar tab key 2024-03-22 16:16:47 +02:00
Vladimir Enchev
ed984a0642 Version updated 2024-03-22 15:55:48 +02:00
Vladimir Enchev
077c88b778 upload demo layout improved 2024-03-22 15:55:24 +02:00
Vladimir Enchev
2077b0a35f Upload component support for client-side file read added (#1439)
* Upload component support for client-side file read added

* maxFileSize defined

* stream closed
2024-03-22 15:45:53 +02:00
Vladimir Enchev
8cbffd7c11 DatePicker keyboard navigation fixed 2024-03-22 15:36:20 +02:00
Vladimir Enchev
3bc3038c2f DatePicker should not focus first element in popup when opened from input 2024-03-22 10:31:22 +02:00
yordanov
ee3c54ecd0 Fix RadzenListBox and DropDown multiple selection item content not stretching to full width 2024-03-21 17:42:24 +02:00
Atanas Korchev
89b10a8ccf Pass the ListBox template directly to reduce duplication. 2024-03-21 13:16:59 +02:00
Atanas Korchev
31d702c550 Use latest available C# version. 2024-03-21 13:16:07 +02:00
warpor
a5f98cb46b Add the ability to change the text in the scheduler (#1434)
Add ability to change the popup text when clicking on a day with no events on the scheduler in year view
2024-03-21 13:05:45 +02:00
V45370
b88156a672 Scheduler drag and drop with mobile support (#1395)
* Appointment drag and drop functionality for Scheduler component.

* Added drag support for mobile devices.

* Remove DragDropTouch.js.

* Remove touch events. Set ondragstart as an attribute (required for mobile support).

* Remove some views.

---------

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2024-03-21 13:03:20 +02:00
Atanas Korchev
311a53e4ce Create SECURITY.md 2024-03-21 10:34:14 +02:00
Vladimir Enchev
bd55bb88b9 Version updated 2024-03-21 10:09:36 +02:00
Vladimir Enchev
7461c5ee1f SecuritCode FocusAsync fixed 2024-03-21 10:07:06 +02:00
Vladimir Enchev
6daf5b6afa SecurityCode OnValueChange should be invoked on paste 2024-03-20 21:07:26 +02:00
Vladimir Enchev
32c9678513 code improved 2024-03-20 21:03:19 +02:00
Vladimir Enchev
2f74296de6 Fixed RadzenSecurityCode form support 2024-03-20 20:23:37 +02:00
Vladimir Enchev
2d32d53075 Assembly version used for Radzezn.Blazor.js 2024-03-20 11:40:41 +02:00
Vladimir Enchev
9fa389bb99 Version updated 2024-03-20 10:30:32 +02:00
Vladimir Enchev
c9151306da DatePicker focused date not updated properly when interacting with mouse
Fix #1429
2024-03-20 10:29:45 +02:00
Vladimir Enchev
5d11777dd8 DatePicker PopupID will use id attribute of the component if set
Fix #1430
2024-03-20 10:17:45 +02:00
Vladimir Enchev
eab9ced72f Added support for SelectedIndex two-way binding to Accordion 2024-03-19 13:52:44 +02:00
Vladimir Enchev
929a72be79 obsolete code deleted 2024-03-19 12:50:52 +02:00
Vladimir Enchev
c62c8d338e SecurityCode should not update value if not needed 2024-03-19 12:43:06 +02:00
Vladimir Enchev
524af22cb0 summary fixed 2024-03-19 11:14:41 +02:00
Vladimir Enchev
b7f891ce39 Version updated 2024-03-19 11:11:33 +02:00
Vladimir Enchev
178a20c6d4 Custom autocomplete attribute support added to TextBox, Mask, Password and Numeric. AutoComplete properties reverted to boolean. 2024-03-19 11:11:11 +02:00
Vladimir Enchev
83e13ae782 SecurityCode input lost value if same value is entered 2024-03-18 18:05:02 +02:00
Vladimir Enchev
dc654b89fb version updated 2024-03-18 15:27:50 +02:00
yordanov
bee2e084ba Fix height of PickList target wrapper 2024-03-18 15:21:11 +02:00
yordanov
9ea3f9fd80 Update SecurityCode styles 2024-03-18 14:54:22 +02:00
Vladimir Enchev
5d78740f6f PickList ButtonJustifyContent default value set to Center 2024-03-18 14:31:13 +02:00
Vladimir Enchev
9cda942dea number of components updated 2024-03-18 14:23:05 +02:00
Atanas Korchev
2b728114a2 Change the rendering of RadzenStackedAreaSeries to no longer require RenderingOrder and cause overlaps. 2024-03-18 12:20:34 +02:00
Vladimir Enchev
6f1ab140a6 Version updated 2024-03-18 12:17:35 +02:00
Vladimir Enchev
8655349f00 Tab should not close DropDownDataGrid if on search input or search and add buttons
Fix #1426
2024-03-18 12:17:19 +02:00
Vladimir Enchev
d75edae498 Fixed DataGrid column resize sticking on after click
Close #1425
2024-03-18 11:50:18 +02:00
Vladimir Enchev
6d5970adcb SecurityCode component added (#1428)
* SecurityCode component added

* Methods for create/destroy SecurityCode improved

* Bind value demo added for SecurityCode

* SecurityCode will use space instead empty string for invalid value

* SecurityCode will use size=1 for inputs instead width

* text-align: center added for .rz-security-code-input

* padding: 0.3rem added to .rz-security-code-input

* Update SecurityCode styles

* Update SecurityCode demos

---------

Co-authored-by: yordanov <vasil@yordanov.info>
2024-03-18 11:38:10 +02:00
Vladimir Enchev
40f925e660 DatePicker will not use online scripts to open/close popup
Close #1427
2024-03-18 11:35:09 +02:00
Atanas Korchev
d9aab7db19 Update chart demos. 2024-03-15 19:00:20 +02:00
Vladimir Enchev
6f7a12c8be Splitter runtime size not updated on Size change 2024-03-15 16:27:17 +02:00
Vladimir Enchev
48d7d5a0b9 TextBox, Mask, Password, Numeric and Login components AutoComplete property made dynamic to allow custom string values
Close #1424
2024-03-15 12:09:22 +02:00
Vladimir Enchev
d459270d7d Fixed DataGrid with virtualization crashes when ungrouping 2024-03-15 10:54:30 +02:00
Vladimir Enchev
9e7a7ad920 Added aria-hidden="true" to CheckBoxList label 2024-03-15 10:01:27 +02:00
Vladimir Enchev
ffcd3aa3c2 Version updated 2024-03-14 19:21:44 +02:00
Vladimir Enchev
ecd933f94a Splitter mask not removed after first resize 2024-03-14 19:21:09 +02:00
Vladimir Enchev
9db8365930 Version updated 2024-03-14 14:33:46 +02:00
Vladimir Enchev
64187169a0 PickList component added (#1423)
* PickList component added

* Properties Buttons* changed to Button*

* PickList Multiple property added

* PickList ButtonJustifyContent added

* PickList demo improved

* PickList single selection fixed

* PickList SourceStyle and TargetStyle properties removed

* PickList buttons updated

* PickList main Stack Wrap set to FlexWrap.Wrap

* Wrap="FlexWrap.Wrap" removed

* PickList Multiple set to false by default

* PickList reworked to not use directly Source and Target parameter properties

* Update PickList demo

* Add PickList styles

* PickList Orientation property added

* Orientation bound

* Buttons Stack Orientation will depend on Orientation

* Update PickList styles

* Update PickList item in demos navigation

* PickList changing Multiple should reset selection

* Update premium themes

---------

Co-authored-by: yordanov <vasil@yordanov.info>
2024-03-14 14:30:07 +02:00
Vladimir Enchev
f016ba700c AutoComplete in RadzenTextBox not always working
Fix #1422
2024-03-12 18:37:38 +02:00
Vladimir Enchev
02076b680e Splitter mask added during resize to avoid problems with frames 2024-03-12 18:30:49 +02:00
Vladimir Enchev
a6e16ad99f file updated 2024-03-12 17:22:24 +02:00
Vladimir Enchev
3f2de363c9 Splitter IsResizing property added 2024-03-12 16:51:27 +02:00
Vladimir Enchev
511d8d0cb4 Version updated 2024-03-12 16:12:50 +02:00
Markus Lenz
4798d6b7e5 Correct using scheduler year view rz-other-month class (#1421) 2024-03-12 15:26:04 +02:00
Vladimir Enchev
47775d2758 DataGrid column HeaderTemplate should not propagate keydown event 2024-03-12 15:12:08 +02:00
Vladimir Enchev
789e22ea08 DataGrid RowSelect not raised when selecting a row with SPACE or ENTER keys 2024-03-11 18:25:58 +02:00
Vladimir Enchev
fb8badbfd9 RadzenSteps are not shown anymore, after hiding using Visible
Fix #1420
2024-03-11 15:09:17 +02:00
Vladimir Enchev
1c36f33a69 Potential null ref. exception fixed 2024-03-11 09:20:21 +02:00
Vladimir Enchev
58dd31611d Version updated 2024-03-11 09:02:07 +02:00
Vladimir Enchev
7d9033a212 Infinite reload loop in RadzenDataGrid with empty data when AllowVirtualization is true and Settings are applied.
Fix #1416
2024-03-11 09:01:34 +02:00
Vladimir Enchev
564255978d Null. ref. exception fixed 2024-03-09 09:50:53 +02:00
Vladimir Enchev
cc87b603fb unused code removed 2024-03-09 09:46:22 +02:00
Vladimir Enchev
118a0b4214 demo updated 2024-03-08 13:24:27 +02:00
Vladimir Enchev
b56580e3d1 DropDown will focus item starting with typed key 2024-03-08 11:12:38 +02:00
Vladimir Enchev
2a1b77ff6b Update RadzenDropDownDataGrid.razor.cs
NumpadEnter support added
2024-03-07 19:56:49 +02:00
Vladimir Enchev
d94a54e392 Update DropDownBase.cs
Fix #1415
2024-03-07 19:53:52 +02:00
Vladimir Enchev
1ab5db3183 version updated 2024-03-07 10:58:56 +02:00
Vladimir Enchev
560348fcfe Virtualized DropDownDataGrid not properly refreshed after search when scrolled 2024-03-07 10:56:43 +02:00
Vladimir Enchev
e9f74bfb4d DataGrid save/load settings will handle composite columns as well
Close #1412
2024-03-07 10:16:30 +02:00
Vladimir Enchev
13eec1c31a DataGrid keyboard navigation will scroll into view focused row/cell only if needed 2024-03-07 09:42:26 +02:00
Vladimir Enchev
aa64ca58f4 DataGrid columns state should not be reset on Data change if AllowColumnPicking, AllowColumnReorder or AllowColumnResize is true 2024-03-07 09:09:36 +02:00
Vladimir Enchev
018c3a1cc6 Filter by CompanyName added to demos 2024-03-05 16:48:42 +02:00
Vladimir Enchev
e0bf4394b7 DropDown virtualization with LoadData demo code imroved 2024-03-05 15:30:16 +02:00
Vladimir Enchev
d684a3ede2 DropDownDataGrid virtualization with LoadData demo code imroved 2024-03-05 15:25:22 +02:00
Vladimir Enchev
0bb1ab04d3 Version updated 2024-03-05 13:44:05 +02:00
Vladimir Enchev
f35f5ccfe4 Dialog mask will not receive pointer events only when CloseDialogOnOverlayClick=false 2024-03-05 13:43:33 +02:00
Vladimir Enchev
dc58737310 DataGrid column CustomFilterExpression inluded in save/load settings
Close #1408
2024-03-05 11:23:39 +02:00
Vladimir Enchev
f246415f27 Dialog mask should not receive mouse events 2024-03-05 11:17:58 +02:00
nielsNocore
e7badbf124 DatePicker add specific css selectors for week number (#1409)
* added specific scss selector for week number in the date picker
added unittest for the week number in date picker

* restored existing class name for calendarweeks for beter compatibility
made unit test more specifick to test the week number class name
2024-03-05 11:11:43 +02:00
Vladimir Enchev
caddb16b53 Input from the keyboard freezes inside RadzenLayout
Fix #1399
2024-03-05 11:11:03 +02:00
Vladimir Enchev
0d18206ae6 DatePicker Close() not working
Fix #1410
2024-03-05 10:03:37 +02:00
Vladimir Enchev
71c82c0f0d version updated 2024-03-04 06:41:45 +02:00
Vladimir Enchev
cc52fdcf5a RadzenDatePicker (Inline) throws error after picking date
Fix #1405
2024-03-04 06:40:21 +02:00
Marek
6d31991fda feat: ClearFilter has optional parameter should reload (#1398)
Co-authored-by: MICKA Marek (Cloud EXT ADM) <adm.cloud.ext.micka@drmaxglobal.onmicrosoft.com>
2024-03-04 07:08:15 +03:00
Vladimir Enchev
7988f8cc1b Update RadzenDatePicker.razor.cs 2024-03-01 17:05:24 +03:00
Vladimir Enchev
59366d6f33 Version updated 2024-02-29 11:20:50 +02:00
Marek
4f7970cb0e fix: filter icon styl (#1397)
Co-authored-by: MICKA Marek (Cloud EXT ADM) <adm.cloud.ext.micka@drmaxglobal.onmicrosoft.com>
2024-02-29 10:53:57 +02:00
Vladimir Enchev
5794b2e977 DataGrid should use In filter operator as default when FilterProperty is different from Property 2024-02-29 10:49:37 +02:00
Vladimir Enchev
291feff903 demo updated 2024-02-28 16:05:05 +02:00
Vladimir Enchev
19ce81e995 OrderDate filter not auto applied
Fix #1396
2024-02-28 15:49:19 +02:00
Vladimir Enchev
4b20d5b954 Tabs focus should excluded non visible tabs 2024-02-28 14:06:38 +02:00
Vladimir Enchev
90221a0e16 Version updated 2024-02-28 09:41:04 +02:00
Vladimir Enchev
085036bc93 DataGrid inserted row not validated when there is already edited item in multiple edit mode 2024-02-28 09:40:42 +02:00
Vladimir Enchev
21186d0858 Tab focused state not removed from previous selected/focused tab in server render mode 2024-02-28 09:23:08 +02:00
Vladimir Enchev
22e8d15f60 DataGrid PageUp/Down/Home/End support added for keyboard navigation when virtualized 2024-02-27 16:17:31 +02:00
Vladimir Enchev
f258e6d17f DatePicker with TimeOnly crashes on 00:00 value
Fix #1394
2024-02-27 15:05:29 +02:00
Vladimir Enchev
a6a4185585 Update RadzenDropDownDataGrid.razor.cs 2024-02-27 14:15:59 +02:00
Vladimir Enchev
9924a574a8 DropDownDataGrid will force inner DataGrid refresh on popup open if virtualized 2024-02-27 11:17:01 +02:00
Vladimir Enchev
7282d02c22 Cannot tab out from DropDownDataGrid after ESC or ENTER 2024-02-26 15:44:24 +02:00
Vladimir Enchev
1ea62c3c60 Version updated 2024-02-26 11:09:06 +02:00
Vladimir Enchev
5929a37d73 scrollIntoViewIfNeeded should not be used when virtual 2024-02-26 11:07:43 +02:00
Vladimir Enchev
f4a0ec30ec DataGrid keyboard navigation with virtualization improved 2024-02-26 11:01:42 +02:00
yordanov
c5c1e3c1ca Fix ProfileMenu bullet points in Safari 2024-02-26 10:47:17 +02:00
Vladimir Enchev
449c74eb66 Fixed various keyboard navigation problems in Firefox 2024-02-26 09:57:54 +02:00
yordanov
016717c8ef Fix day focused state in DatePicker 2024-02-26 09:20:31 +02:00
Marek
75bb80d343 chore: double iteration removed (#1390)
Co-authored-by: MICKA Marek (Cloud EXT ADM) <adm.cloud.ext.micka@drmaxglobal.onmicrosoft.com>
2024-02-26 09:00:34 +02:00
Krystian Szatan
c04c32e876 EventConsole - optional AlertStyle (#1391)
Now can log warnings, errors etc.
2024-02-26 08:59:16 +02:00
Vladimir Enchev
09025e0a8f DatePicker Value property setter comparing old and new value fixed 2024-02-26 08:54:53 +02:00
Vladimir Enchev
13e845a5da Version updated 2024-02-23 15:18:11 +02:00
Vladimir Enchev
2f4284f806 Fixed exception in TreeView expand/collapse
Fix #1389
2024-02-23 15:17:49 +02:00
Vladimir Enchev
d4af5926cb PanelMenu item not expanded on reload if selected 2024-02-23 14:51:05 +02:00
Vladimir Enchev
0ad2f463ab Fixed DatePicker focus lost on selection 2024-02-23 09:29:20 +02:00
Vladimir Enchev
3b49f9947f Fixed select all of unbound DropDown
Close #1388
2024-02-23 09:23:13 +02:00
Vladimir Enchev
514b536f57 Version updated 2024-02-22 16:39:34 +02:00
Vladimir Enchev
040143f557 Open menu on ArrowDown 2024-02-22 15:27:55 +02:00
Vladimir Enchev
c75d0cc989 Menu Toggle() and Close() methods fixed 2024-02-22 15:15:56 +02:00
yordanov
701ac3f85d Fix anchors 2024-02-22 14:41:24 +02:00
yordanov
f283cff6bc Add info for HighContrast color swatches 2024-02-22 14:40:12 +02:00
Vladimir Enchev
d8e62cc541 Tab focused state not removed from previous selected/focused tab properly 2024-02-22 14:36:32 +02:00
Vladimir Enchev
8853c8a124 version updated 2024-02-22 11:26:28 +02:00
Vladimir Enchev
027fa4119b Various components templates should not propagate keydown 2024-02-22 11:25:52 +02:00
Vladimir Enchev
5424375e0d Accordion templates should not propagate keydown 2024-02-22 11:08:14 +02:00
Vladimir Enchev
6007658c72 DataGrid special rows should not propagate keydown 2024-02-22 10:40:48 +02:00
Vladimir Enchev
e0916858a8 DataGrid filter row should not propagate onkeydown 2024-02-22 09:17:54 +02:00
Vladimir Enchev
1f397978d6 code fixed 2024-02-21 15:35:21 +02:00
Vladimir Enchev
518f58885e version updated 2024-02-21 15:30:08 +02:00
Vladimir Enchev
ece24fa24b RadzenAccordion item role fixed 2024-02-21 15:25:01 +02:00
Vladimir Enchev
6524eb2b55 Version updated 2024-02-21 14:55:00 +02:00
rauschp
b16a6b1ab1 Allow the icon in the ProfileMenu to be enabled/disabled (#1380)
* Add toggleable icon to the Profile menu

* Update the summary to better reflect the name

---------

Co-authored-by: Peter Rausch <peter@Peters-Air.attlocal.net>
2024-02-20 18:52:13 +02:00
Vladimir Enchev
cda2ca43dd demo fixed 2024-02-20 18:46:14 +02:00
Vladimir Enchev
3375d30fad tabindex set for various buttons 2024-02-20 18:26:41 +02:00
yordanov
6b61c462a0 Update tooltip templates in demos config 2024-02-20 17:59:43 +02:00
Vladimir Enchev
226fab5904 test fixed 2024-02-20 16:26:07 +02:00
Vladimir Enchev
be2791462e Version updated 2024-02-20 16:20:25 +02:00
Vladimir Enchev
9b38e6cb8f Stop propagation of keydown event in DataGrid cells 2024-02-20 15:35:13 +02:00
Vladimir Enchev
bce7830b86 Version updated 2024-02-20 14:55:23 +02:00
yordanov
4e6a3311a4 Update premium themes 2024-02-20 12:59:18 +02:00
yordanov
f8c1c87b01 Update sidebar toggle focus styles 2024-02-20 12:28:06 +02:00
Vladimir Enchev
94c3ae6533 Upload Choose button focus fixed 2024-02-20 09:44:33 +02:00
Vladimir Enchev
8ca1ed17d4 DataGrid column HeaderTooltip property added 2024-02-20 09:14:40 +02:00
Vladimir Enchev
a645363091 demo reload fixed 2024-02-19 11:34:23 +02:00
Vladimir Enchev
7db3c29e14 MenuItem Close() and Toggle() methods made public
Fix #906
2024-02-19 11:14:53 +02:00
Vladimir Enchev
4c28475c0d Give the UI time to react 2024-02-19 11:07:30 +02:00
Vladimir Enchev
c509f17789 DropDown RemoveChipTitle property added
Fix #1357
2024-02-19 10:57:55 +02:00
Vladimir Enchev
6690ea7c0e Fix #1114 2024-02-19 10:46:29 +02:00
Vladimir Enchev
347942668d Keyboard navigation and accessibility improvements added to all components (#1379)
* Components keyboard navigation improved

* Tree CheckBox TabIndex set to -1

* DataGrid and Pager keyboard navigation section added to first demo

* DataFilter keyboard navigation info added to first page

* Tree keyboard navigation info added to first page

* Scheduler keyboard navigation info added to first page

* DropDownDataGrid keyboard navigation info added to first page

* DatePicker keyboard navigation info added to first page

* FileInput keyboard navigation info added to first page

* demo updated

* SplitButton keyboard navigation info added to first page

* Upload keyboard navigation info added

* Chart keyboard navigation info added to first page

* demo updated

* focusTableRow() fixed

* more focusTableRow() fixes

* even more focusTableRow() fixes

* Update Accessibility page content

* Update anchors in navigation components demos and add keyboard navigation shortcuts

* Update MainLayout

* Update Scheduler focus styles

* Update keyboard navigation wording

* Appointments focus improved

* Update and document HTMLEditor shortcuts

* Appointment focus improvements for week view

* Replace ripple's background transition with background-size

* focus contentView on enter

* focus View on enter

* persist selected theme

* YearPlannerView keyboard navigation improved

* YearTimelineView keyboard navigation improved

* months focus state fixed

* days navigation fixed

* code fixed

* ScrollIntoView added

* Update anchors in components demos

* Update Scheduler focus styles

* Update premium themes

---------

Co-authored-by: yordanov <vasil@yordanov.info>
2024-02-19 10:31:27 +02:00
Atanas Korchev
1a3643d6f8 The id attribute of RadzenMenuItem is rendered twice. 2024-02-15 13:02:40 +02:00
Atanas Korchev
0af64210c5 The style of RadzenMenuItem does not render. 2024-02-15 12:16:31 +02:00
Paul Ruston
7989b8eb0e Add ImageStyle Property to MenuItem / ContextMenu (#1373) 2024-02-14 11:47:58 +02:00
Vladimir Enchev
4d902a03ca version updated 2024-02-13 09:35:59 +02:00
Josh
8af5b826b2 ensure nullable DateOnly and TimeOnly are parsed properly (#1372) 2024-02-13 09:10:35 +02:00
Atanas Korchev
953b8e4fb2 Chart trends throw InvalidOperationException when used with empty series. 2024-02-12 09:50:31 +02:00
David Kohout
95c4af6f84 Support for multiple inserts in DataGrid (#1369)
* Added support for multiple inserts in DataGrid

* Demo page DataGridInLineEdit updates.

Now allows for multiple edits and inserts.
Fixed issue when row is in insert mode and user starts to edit older row
2024-02-12 09:13:52 +02:00
Paul Ruston
f2be35ee94 Scheduler changes to set a start month for year views (#1366)
* Scheduler changes for Year views to set start month when rendering

* Change test for start month from integer to Enum

* Move SchedulteStartMonth from Scheduler to appropriate Views.

* Variable and Enum changes.
2024-02-09 16:03:36 +02:00
Vladimir Enchev
056bc1af22 source code fixed 2024-02-09 15:08:26 +02:00
Vladimir Enchev
46501093ce DataGrid header cell width style applied twice 2024-02-09 09:38:29 +02:00
Vladimir Enchev
0344e3f633 demo code improved 2024-02-07 10:00:31 +02:00
Vladimir Enchev
7882607c6e code improved 2024-02-07 09:53:23 +02:00
Vladimir Enchev
684c02b1c5 Version updated 2024-02-07 09:39:49 +02:00
Eric McGaha
7d8889d045 #1362 - DataFilter operator not being set using AddFilter. (#1363) 2024-02-07 09:32:04 +02:00
Josh
a05b293582 Feature: DatePicker, support for DateOnly/TimeOnly types (#1364)
* support DateOnly binding, by converting when assigning to Value

* support for TimeOnly, by converting when assigning to Value

* sample for DateOnly/TimeOnly binding

---------

Co-authored-by: Josh H <josh@inventivecoders.com>
2024-02-07 09:27:01 +02:00
Vladimir Enchev
c37085a1c7 demo improved 2024-02-06 17:16:52 +02:00
Chris Vanstone
bb8d7e2339 Handle DateTimeOffset and DateTimeOffset? in GetFilterValue (#1355) 2024-02-06 16:19:36 +02:00
Paul Ruston
84c87d2dee DataGrid Column Custom Command Filter (#1354)
* DataGrid Column Custom Command Filter

* Adjustment to Linq command in demo

* Rename CustomFilterCommand to CustomFilterExpression

* Changed name of a couple of variables in demo to match expression / command change.
2024-02-06 15:20:46 +02:00
Vladimir Enchev
710566e817 DropDownDataGrid shows blank data after clearing selections
Fix #1353
2024-02-06 09:31:30 +02:00
Vladimir Enchev
a1ca96017c version updated 2024-02-01 16:59:58 +02:00
Vladimir Enchev
686868519c Fixed virtualized DropDown with LoadData will not load items after clear
Fix #1352
2024-02-01 11:52:38 +02:00
yordanov
f16f0e7e08 Update premium themes 2024-02-01 10:17:48 +02:00
yordanov
f96bf404e6 Remove local source paths for Material fonts 2024-01-31 13:45:10 +02:00
Vladimir Enchev
6d6a80dd4d Collapsible RadzenFieldset IconColor fixed 2024-01-30 18:12:34 +02:00
Vladimir Enchev
94532e8598 version updated 2024-01-30 10:55:11 +02:00
Vladimir Enchev
254449ec1a RadzenNumeric does not respect step parameter properly in German culture
Fix #1350
2024-01-30 10:54:06 +02:00
nielsNocore
3c69021c6c enforce columnSize min width (#1348)
* shcnaged startColmresize to enforce the min widht property of a column in javascript

* fixed typo,
2024-01-30 10:05:53 +02:00
Vladimir Enchev
68955d67bb AutoComplete component is throwing 'Uncaught TypeError: Cannot read properties of undefined (reading 'instance')'
Fix #1349
2024-01-30 10:05:10 +02:00
Vladimir Enchev
bc1eadad26 Return null instead empty string for inputs value 2024-01-29 19:10:44 +02:00
Paul Ruston
ebe6245243 Add base type to filter array (#1347) 2024-01-29 18:32:09 +02:00
egans146
d12c624b23 change RadzenDatagrid OnSort to async (#1346)
fix for RadzenDataGrid displays incorrectly ordered data when using async LoadData #1345

Co-authored-by: Florent MARTIN <florent.martin@capgemini.com>
2024-01-28 09:43:55 +02:00
Vladimir Enchev
11c1668d65 Version updated 2024-01-26 11:11:38 +02:00
Vladimir Enchev
158c27e52b Numeric should not default to min value on nullable types 2024-01-26 11:09:26 +02:00
Marek
36b777da8f Can change added (#1317)
* Can change added

* demo added

* CanChange with EventCallback

* renamed

* Rename to follow existing naming conventions.

* Add description.

---------

Co-authored-by: Marek Mička <xmicka13@vutbr.cz>
Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2024-01-23 16:59:26 +02:00
Vladimir Enchev
012010957d Version updated 2024-01-22 17:36:47 +02:00
Vladimir Enchev
b0f041328d DataGrid sort API demo updated 2024-01-22 11:40:12 +02:00
David Johnston
94a12d9767 #1338 Reset pagination to first page, when column sorting occurs, retaining default behavior. (#1340)
* Reset pagers when sorting changes

* #1338 Rest to first page on column sorting

* Made backward compatible.

* Renamed to make intention clearer

* Moved code to more appropriate location
2024-01-22 11:36:03 +02:00
Vladimir Enchev
06cbb3e7f8 RadzenDataGrid displays incorrectly filtered data when using async LoadData
Fix #1341
2024-01-22 10:05:05 +02:00
Vladimir Enchev
47de40856b NotificationMessage DetailContent and SummaryContent added 2024-01-20 12:20:47 +02:00
Vladimir Enchev
c044fa2932 DialogCardPage added to two demos source editor 2024-01-19 17:06:31 +02:00
Vladimir Enchev
10f2145c15 Update DataGridSortApi.razor
Close #1339 #1338
2024-01-19 16:53:07 +02:00
nielsNocore
de89355b05 implemented: when numpad decimal seperator is used. the numeric input will use the current culture Decimal separator instead of a . (period) (#1337) 2024-01-19 11:14:56 +02:00
yordanov
54f9eed786 Rename odd striped row background css variable. Resolves #1335 2024-01-18 16:57:26 +02:00
David Johnston
d8e73e9cb4 #1335 Separate colour for odd striped row background 2024-01-18 16:43:54 +02:00
yordanov
ba7f07e1c8 Update premium themes 2024-01-18 09:21:16 +02:00
yordanov
9353015ddc Update code snippet background and text color 2024-01-18 09:21:16 +02:00
Vladimir Enchev
780e300815 Version updated 2024-01-18 09:13:22 +02:00
yordanov
4ed6464bbe Fix heading levels in demo pages 2024-01-17 18:24:51 +02:00
yordanov
8a9ed91051 Fix heading levels in EventConsole and MainLayout 2024-01-17 18:00:38 +02:00
yordanov
784fabc288 Update shades of Badges used in demos 2024-01-17 17:49:33 +02:00
yordanov
1a25d1b866 Update Tooltip text color in material theme 2024-01-17 16:14:02 +02:00
Vladimir Enchev
b4bd2c3785 DropDownDataGrid should be focused when selecting items with mouse 2024-01-17 10:12:20 +02:00
Vladimir Enchev
c72a18c7e4 Fixed RadzenDataGrid not loading on first render
Fix #1332
2024-01-17 10:00:55 +02:00
yordanov
51095f4a9f Update Pager button colors 2024-01-16 16:02:21 +02:00
yordanov
f2af835a02 Update ProgressBar severity colors 2024-01-16 15:48:48 +02:00
yordanov
fa8965f7bd Update Button base color 2024-01-16 15:48:11 +02:00
yordanov
e4da8a26b0 Update Checkbox checked color 2024-01-16 15:31:22 +02:00
yordanov
45351a504f Update DatePicker interaction state colors in standard theme 2024-01-16 15:09:47 +02:00
yordanov
48ce3fd4d0 Update DatePicker interaction state colors 2024-01-16 14:58:30 +02:00
yordanov
98825a7d5f Update DropDown interaction state colors 2024-01-16 14:42:10 +02:00
Vladimir Enchev
7011688812 DataFilter will get the filter operator from the property 2024-01-16 11:22:00 +02:00
yordanov
ea8a3049cd Update PanelMenu interaction state colors 2024-01-16 11:13:35 +02:00
yordanov
d2c1e7aca5 Update Editor button text colors 2024-01-16 10:59:02 +02:00
yordanov
2d80e831be Update Header and SidebarToggle colors 2024-01-16 10:52:24 +02:00
yordanov
c83e7b2b14 Fix Validator text color 2024-01-16 10:52:24 +02:00
Vladimir Enchev
c7c71bc785 Accordion HeaderTemplate renamed to Template 2024-01-16 10:40:14 +02:00
yordanov
8c0e27b83b Fix Grid interaction state colors 2024-01-16 10:35:43 +02:00
yordanov
d275837da5 Fix Menu item colors 2024-01-16 10:35:43 +02:00
djatkinsrealis
c1ecb703bf #1320 Cascade RadzenDataGrid class to all descendants (#1328) 2024-01-16 10:05:44 +02:00
djatkinsrealis
f804b56f92 #1329 Optional pagination text labels for PagedDataBoundComponent Prev and Next buttons (#1330) 2024-01-16 09:47:29 +02:00
Vladimir Enchev
d7a04c86f3 Accordion item HeaderTemplate added 2024-01-16 09:37:42 +02:00
yordanov
652b76ba50 Fix Numeric button color 2024-01-15 18:54:57 +02:00
yordanov
359de1a1e5 Fix Splitter bar active color 2024-01-15 18:38:10 +02:00
yordanov
eecec3106b Fix Switch circle color 2024-01-15 18:30:13 +02:00
yordanov
f233b23569 Fix Tooltip text color in themes 2024-01-15 18:22:52 +02:00
yordanov
0862a81322 Fix Tooltip text color 2024-01-15 18:22:52 +02:00
yordanov
6421fc9519 Fix Upload choose button colors 2024-01-15 18:22:52 +02:00
bert-algoet
b1ef59bff9 Missing css styling on RadzenCheckBoxListItem Template (#1331)
* Added a Template to the RadzenCheckBoxListItem

* missing css styling on RadzenCheckboxListItemTemplate
2024-01-15 16:08:07 +02:00
yordanov
cd7670ad11 Fix Tree text colors 2024-01-15 13:07:02 +02:00
yordanov
79fa482f70 Fix Slider handle color 2024-01-15 12:59:03 +02:00
yordanov
11705f7ccd Fix Steps number selected state color 2024-01-15 12:44:38 +02:00
yordanov
11da4794b5 Fix SelectBar selected state colors 2024-01-15 12:17:38 +02:00
yordanov
5cc6ae012a Fix Scheduler text colors 2024-01-15 11:45:40 +02:00
Vladimir Enchev
938c321a54 version updated 2024-01-15 10:47:14 +02:00
bert-algoet
867422a2d9 Added a Template to the RadzenCheckBoxListItem (#1327) 2024-01-15 10:40:42 +02:00
djatkinsrealis
8a547877b5 #1321 change PagerPosition enum to use flags (#1324) 2024-01-15 10:40:07 +02:00
djatkinsrealis
3e301af80c #1322 Add custom FooterTemplate to DataGrid (#1323) 2024-01-15 10:24:12 +02:00
Faenrig Kolkrabe
41ad6dc339 Added MaxLength attribute to RadzenAutoComplete (#1326)
Enhancement request due to forum post 'https://forum.radzen.com/t/radzenautocomplete-maxlength/16153'

Co-authored-by: jpk <j.p.kocherscheidt@protonmail.com>
2024-01-15 10:23:26 +02:00
Josh
2f17f0d4ae Support for IFormattable (#1318)
* Support IFormattable, if TValue implements it

* Include demo for custom numeric types

* improve method name

* In cases where the value is already of the correct type, do not perform conversion.  Refactor SetParametersAsync to honor custom numeric support

* perform the Min/Max check before the equality shortcut

* remove unnecessary type conversion logic

* fixup: if type implements IComparable, be sure to return value immediately, if in range

* PR feedback: this resolves the issue, in that the value is pushed to the dom via JS.  I couldn't understand why this existing statement had the other conditionals.  Why would you want to trigger the ValueChanged/Changed callbacks, if the value indeed hasn't changed, or if there's a Format.  However, admittedly I don't know the background of why it was this way.

https://github.com/radzenhq/radzen-blazor/pull/1318#issuecomment-1886478912

---------

Co-authored-by: Josh H <josh@inventivecoders.com>
2024-01-12 11:13:16 +02:00
Vladimir Enchev
f1f99a1d92 Version updated 2024-01-12 09:03:59 +02:00
Vladimir Enchev
ad6fbe2bf3 Fixed RadzenDatePicker doesn't gain focus with OnDemand PopupRenderMode
Fix #1307
2024-01-10 13:31:39 +02:00
Vladimir Enchev
e0bfad4807 DataGrid column resize improved
Fix #1308
2024-01-10 10:13:36 +02:00
Vladimir Enchev
3572ab9452 Check if dialog is resizable before observing size changes
Fix #1314
2024-01-10 09:36:28 +02:00
Josh
30ed285dcf Support for custom Numeric Types (#1315)
* add a test for the ConvertValue Parameter.  Update InternalValueChanged code with the following enhancements:

a) only perform the overhead associated with Min/Max bounds checking if needed
b) by doing a, custom types that wrap decimal work with the control and avoid attempted ChangeValue conversion

* move dollars to own file, and implement IComparable<decimal>, and a TypeConverter

* Support TypeConverter for conversions to/from decimal, for custom numeric types

* support for IComparable, for when Min/Max are used with custom numeric types

* move Max/Min null check inside CheckBounds

---------

Co-authored-by: Josh H <josh@inventivecoders.com>
2024-01-10 09:14:57 +02:00
Vladimir Enchev
2881491cc2 demo code imporved 2024-01-09 13:08:30 +02:00
Vladimir Enchev
96f4d3e136 Version updated 2024-01-09 12:05:17 +02:00
Vladimir Enchev
9e9ab6ae13 Dialog options TitleContent property added 2024-01-09 11:59:11 +02:00
Vladimir Enchev
029cad9224 Missing summary added 2024-01-09 11:58:50 +02:00
Vladimir Enchev
0029315c2e Update DataFilter IQueryable demo with filtering collection using In operator 2024-01-09 09:46:00 +02:00
Atanas Korchev
247c3b58ec Use AllowFloatingLabel in CurrentPlaceholder. 2024-01-09 09:45:06 +02:00
yordanov
7a165adfb8 Fix FormField label background color 2024-01-09 09:22:23 +02:00
yordanov
5777319bfa Add new AllowFloatingLabel property to RadzenFormField 2024-01-08 18:54:14 +02:00
adrianjcalvert
9219c5a1ad Update Radzen.Blazor.js (#1312)
withCredentials added to ajax object in upload method
2024-01-08 07:14:24 +02:00
Vladimir Enchev
096295d258 Popup component outside click
Fix #1310
2024-01-08 07:14:00 +02:00
yordanov
aa26e0c44d Fix --rz-tabs-tab-color and cursor in RadzenTabs - resolves #1303 2024-01-07 16:12:16 +02:00
yordanov
8fcd0c5e4c FormField label should float on top if DropDown placeholder is present 2024-01-07 15:51:41 +02:00
Vladimir Enchev
1a26487df3 TabsChange demo added 2024-01-06 06:40:30 +02:00
Vladimir Enchev
7afedf59bf DataFilter In/NotIn filter operators support added 2024-01-05 15:18:22 +02:00
Vladimir Enchev
e81267995d version updated 2024-01-04 16:51:12 +02:00
Vladimir Enchev
9c206629b1 DataGrid cell css class not applied correctly 2024-01-04 16:50:59 +02:00
Vladimir Enchev
1e8dcdf4ea DataGrid select all for OData demo updated 2024-01-04 12:08:30 +02:00
Vladimir Enchev
027e120c87 demo update with multiple selection 2024-01-04 11:41:33 +02:00
Vladimir Enchev
09de9e5fda Version updated 2024-01-04 09:04:55 +02:00
Vladimir Enchev
b1c64bbd98 FileInput and Upload will not upload properly when Name is specified 2024-01-04 09:03:06 +02:00
Vladimir Enchev
7ec6f6caad Fixed Draggable errors when ref is null on drag start 2024-01-04 08:54:06 +02:00
stlufred
85babbeb01 Fix null exception when expanding tree node (#1306)
If:
- Checkboxes enabled
- CheckedValues is null
2024-01-04 08:45:54 +02:00
yordanov
0006223494 Revert "End-of-year promotion"
This reverts commit 5f73d1e57a.
2024-01-04 08:36:00 +02:00
Vladimir Enchev
5f1bf408f7 Fixed query could not be translated excepton
Fix #1300
2024-01-03 15:49:54 +02:00
Vladimir Enchev
8e8fd019c3 GoogleMap demo description updated 2024-01-02 15:37:44 +02:00
Vladimir Enchev
c7b98005bb GoogleMap ApiKey added to demo 2024-01-02 15:27:25 +02:00
Vladimir Enchev
508e95b9d8 GoogleMap demo restored 2024-01-02 15:11:33 +02:00
Vladimir Enchev
5245df3ce3 GoogleMap demo removed from navigation 2024-01-02 15:05:51 +02:00
Vladimir Enchev
ec66dd5649 Version updated 2024-01-02 14:15:03 +02:00
Vladimir Enchev
d28c3f9ba3 Fixed SplitButton error on click
Fix #1304
2024-01-02 14:13:51 +02:00
Vladimir Enchev
64705b393a Added ShowCalendarWeek to DatePicker
Close #1293
2024-01-02 14:08:35 +02:00
Vladimir Enchev
42b4557de7 DataGrid grouping API demo updated with ShowGroupExpandColumn 2024-01-02 13:48:23 +02:00
CodePro.Tv
d089a06566 made toggle visibility column optional, added group header with toggle (#1298)
Co-authored-by: CodeProTv <burritostand@gmail.com>
2024-01-02 13:47:37 +02:00
Atanas Korchev
4bbfdf8e85 Update the custom dialog editor example. 2024-01-02 11:15:50 +02:00
yordanov
1e6db0f0a5 Update copyright year 2024-01-01 17:08:10 +02:00
Atanas Korchev
0778c150b6 Cannot show RadzenAlert after the user closes it. 2023-12-25 10:40:11 +02:00
Atanas Korchev
30a7170f50 Cannot set the style of RadzenRating. Fixes #1296. 2023-12-22 16:47:31 +02:00
Paul Ruston
b9ca828522 New property ShowMarkers on Line Series (#1287)
* New property ShowMarkers on Line Series

* Add checkbox to Show Markers on LineSeries demo

* Moved marker visibility to RadzenMarkers and added change to other series types  that render markers. Updated demo
2023-12-20 14:05:20 +02:00
yordanov
5f73d1e57a End-of-year promotion 2023-12-20 09:41:51 +02:00
yordanov
b0f4c4b8e0 Fix typo 2023-12-19 11:02:19 +02:00
Vladimir Enchev
10e343b8bb More DataGrid OnKeyDown improvments 2023-12-19 10:21:28 +02:00
Vladimir Enchev
0ab5630ebf DataGrid OnKeyDown improved 2023-12-19 10:00:30 +02:00
Piotr Stola
86a47ad533 #1288 NotificationService: Missing IEquatable<T> Implementation (#1291)
* #1288 NotificationService: Missing IEquatable<T> Implementation in NotificationMessage

* #1288 NotificationService: Missing IEquatable<T> Implementation in NotificationMessage - fix for GetHashCode
2023-12-19 09:32:31 +02:00
Vladimir Enchev
fecf36a7ff Version updated 2023-12-18 18:21:47 +02:00
Vladimir Enchev
16b392d360 Accordion expand/collapse events logic fixed 2023-12-18 18:21:22 +02:00
yordanov
dd6709c14a Add LinkedIn follow button 2023-12-18 15:21:23 +02:00
yordanov
69622ad25a Add how to video in themes demo page 2023-12-18 15:02:54 +02:00
yordanov
7e6a5642c1 Update quickstart video 2023-12-18 15:01:59 +02:00
yordanov
ed9923dbf9 Add open graph tags 2023-12-15 11:03:21 +02:00
yordanov
bb13d0b6f9 Update demos titles and descriptions 2023-12-15 09:58:50 +02:00
Vladimir Enchev
423e00eccd TabsWrap demo added 2023-12-14 18:46:23 +02:00
Vladimir Enchev
90ffa50718 Popups close logic fixed 2023-12-14 15:47:52 +02:00
Vladimir Enchev
4f0ed25e8e version updated 2023-12-14 13:40:00 +02:00
Vladimir Enchev
3f99cc7a6d Change theme added 2023-12-14 13:38:43 +02:00
Vladimir Enchev
a7e9d43411 WASM debugging fixed 2023-12-14 11:35:25 +02:00
Vladimir Enchev
c79bc6e32f DataGrid will hide column resizers when column reorder in-progress 2023-12-14 11:16:36 +02:00
Vladimir Enchev
a2b18aaec4 Fixed Accordion Expand/Collapse events not raised 2023-12-13 17:45:38 +02:00
Paul Ruston
886e96f5d6 Add new Bar and Column Series property 'ColorMode' (#1272)
* Column Chart - Position data labels above, level or below bar if positive, zero or negative, respectively.
Bar Chart - Position data labels right, level or left of bar if positive, zero or negative, respectively.

* Add new series property 'ColorMode'.

* Revert "Add new series property 'ColorMode'."

This reverts commit 07295350c6.

* ColorMode option 'Series' or 'PositiveNegative'.
Bar and Column Render methods improved.

* Make Render method a bit more concise. Change property name to ChartSeriesColorMode

* Code refactoring and property name change

* Refactoring and renaming

* Change the workings to generic ColorRanges rather than static PositiveNegative

* Remove ColorMode and redo PickColor to check for null Ranges instead. Apply to StackedSeries also.

* Removed colorMode XML Comment

* Tidied up code as per comments

* Rename val to itemValue and remove trailing spaces from files

* The ones I missed :)

* Create FillRange demo
2023-12-13 16:49:08 +02:00
decimvs
88388fc5b1 feature: added support to define a custom function to be called when datagrid enum filter is rendering enum filter menu to display a translated text by calling a custom function. It allows to use alternative I18N stacks. (#1282)
Co-authored-by: guillermoec <guillermoec>
2023-12-13 09:18:10 +02:00
Vladimir Enchev
7cd4dec4df demo fixed 2023-12-11 18:05:50 +02:00
Vladimir Enchev
567c43f2f0 Accordion selection with keyboard added 2023-12-11 16:20:15 +02:00
Vladimir Enchev
566a2509c9 Attribute aria-checked added to various components 2023-12-11 13:59:01 +02:00
Vladimir Enchev
dbaad2e169 Version updated 2023-12-11 09:53:05 +02:00
Vladimir Enchev
2fdf9f9a8c Styling chart demo fixed
Fix #1280
2023-12-11 09:33:47 +02:00
Vladimir Enchev
ebfcef12a7 Fixed DataGrid composite columns width logic
Fix #1273
2023-12-11 09:27:10 +02:00
Vladimir Enchev
a0fc26afd7 Dialog will stop render during drag 2023-12-08 18:09:57 +02:00
Vladimir Enchev
5c8c8b6502 DataGrid item cannot be deselected in case of multiple selection and LoadData binding 2023-12-08 15:12:21 +02:00
Vladimir Enchev
7e38749e40 version updated 2023-12-08 10:05:02 +02:00
Vladimir Enchev
e538336c5e DataGrid keyboard navigation fixed
Fix #1277
2023-12-08 10:04:45 +02:00
Justin Schweigert
f14b519756 Add ability to configure AutoComplete input type (#1274)
* Add ability to configure AutoComplete input type

* Rename property to InputType
2023-12-08 09:26:42 +02:00
Vladimir Enchev
034a1b3991 Version updated 2023-12-07 16:38:25 +02:00
Vladimir Enchev
a2144d21c2 Fixed redundant link WCAG warning
Removed href="javascript:void(0)" and added @onclick:preventDefault="true" instead
2023-12-07 16:04:56 +02:00
Vladimir Enchev
4a50a3161d Validator demos accessibility improved 2023-12-07 15:34:16 +02:00
Vladimir Enchev
d983b1f329 Alert demo accessibility improved 2023-12-07 15:22:36 +02:00
Vladimir Enchev
c1d5429245 Name/Component made unique 2023-12-07 15:14:34 +02:00
Vladimir Enchev
c094016c33 demos accessibility improved 2023-12-07 15:11:53 +02:00
Vladimir Enchev
5caf503784 demo accessibility improved 2023-12-07 15:08:14 +02:00
Vladimir Enchev
93cd9f6880 code fixed 2023-12-07 15:01:22 +02:00
Vladimir Enchev
7c7f5220da For changed to Component 2023-12-07 15:00:57 +02:00
Vladimir Enchev
09e916fe18 Upload accessibility improved 2023-12-07 14:55:05 +02:00
Vladimir Enchev
471d9eed35 demos accessibility improved 2023-12-07 13:53:32 +02:00
Vladimir Enchev
4457385281 Logic for id for TextBox. TextArea and Password fixed 2023-12-07 12:41:44 +02:00
Vladimir Enchev
c37d999ff3 TextBox, TextArea and Password should set Name as id if not set 2023-12-07 12:31:21 +02:00
Vladimir Enchev
6813b01c20 demos accessibility improved 2023-12-07 12:14:03 +02:00
Vladimir Enchev
2e6032f81b demo accessibility improved 2023-12-07 12:00:50 +02:00
Vladimir Enchev
001e9989b8 RadioButtonList accessibility improved 2023-12-07 11:52:38 +02:00
Vladimir Enchev
45dc0a2a72 Password demos accessibility improved 2023-12-07 11:48:41 +02:00
Vladimir Enchev
dbb511b2f9 Numeric demos accessibility improved 2023-12-07 11:46:37 +02:00
Vladimir Enchev
cbd13b49ef Mask demo accessibility improved 2023-12-07 11:42:38 +02:00
Vladimir Enchev
5902a7f113 ListBox accessibility improved 2023-12-07 11:39:39 +02:00
Vladimir Enchev
70e71fc1da HtmlEditor demo accessibility improved 2023-12-07 11:28:55 +02:00
Vladimir Enchev
91d941b663 FileInput accessibility improved 2023-12-07 11:24:54 +02:00
Vladimir Enchev
75ca1ff498 ColorPicker accessibility improved 2023-12-07 11:16:05 +02:00
Vladimir Enchev
b0e5ad3ef5 CheckBoxList accessibility improved 2023-12-07 11:11:58 +02:00
Vladimir Enchev
0c12ff7662 demo fixed 2023-12-07 11:05:55 +02:00
Vladimir Enchev
d44c6c593d ToggleButton demos accessibility improved 2023-12-07 11:04:23 +02:00
Vladimir Enchev
cdce35ec7a AutoComplete demos accessibility improved 2023-12-07 10:49:42 +02:00
Vladimir Enchev
20210d7d54 BreadCrumbItgem should not use orphaned label 2023-12-07 10:23:16 +02:00
Vladimir Enchev
8ade843108 Switch and ToggleButton InputAttributes added 2023-12-07 10:12:22 +02:00
Vladimir Enchev
faab0e841e SplitButton OpenAriaLabel and Tree SelectItemAriaLabel added 2023-12-06 17:09:54 +02:00
Vladimir Enchev
efae6afd5a demos accessibility improved 2023-12-06 16:44:09 +02:00
Vladimir Enchev
bb8f13d57b Demo accessibility improved 2023-12-06 16:26:08 +02:00
Vladimir Enchev
ff1903b1cc DataGrid filter aria labels exposed as properties 2023-12-06 16:20:00 +02:00
Vladimir Enchev
db193bd94a DataGrid filter accessibility improved 2023-12-06 16:04:41 +02:00
Vladimir Enchev
0ad1d57785 CheckBox InputAttributes added 2023-12-06 15:36:29 +02:00
Vladimir Enchev
0c340286ef various accessibility errors fixed 2023-12-06 14:39:07 +02:00
Vladimir Enchev
e60d681992 Added labels to all DatePicker demos 2023-12-06 11:27:40 +02:00
OndrejUzovic
fff48260be ref null reference fix (#1271) 2023-12-06 11:17:14 +02:00
Vladimir Enchev
2e7752559d various form components accessibility fixed 2023-12-06 10:40:19 +02:00
Vladimir Enchev
aa000e46ed FilterTemplate added to demo
Close #1269
2023-12-06 09:33:36 +02:00
Paul Ruston
8ed441d968 Column Chart - Position data labels above, level or below bar if positive, zero or negative, respectively. (#1270)
Bar Chart - Position data labels right, level or left of bar if positive, zero or negative, respectively.
2023-12-06 09:30:27 +02:00
Vladimir Enchev
c711a0c32c aria-label added to RadzenPanelMenuItem 2023-12-06 09:24:51 +02:00
Vladimir Enchev
2bdfe2e12a AlternateText set for various images 2023-12-05 15:45:34 +02:00
Vladimir Enchev
1023fd90f1 Missing form label and orphaned label accessibility errors fixed 2023-12-05 15:27:41 +02:00
Vladimir Enchev
059a59c746 RadzenLabel changed to span
Orphaned label accessibility error
2023-12-05 15:26:00 +02:00
Vladimir Enchev
2363a1fbb6 tests fixed 2023-12-05 15:24:55 +02:00
Vladimir Enchev
26b2cc816e DatePicker width fixed 2023-12-05 10:27:04 +02:00
Vladimir Enchev
93fc4950df Various AriaLabel properties added 2023-12-05 10:17:45 +02:00
Vladimir Enchev
f042076cab various images alt attribute added 2023-12-05 09:21:56 +02:00
Vladimir Enchev
9a6fd69885 ImageAlternateText property added to various components 2023-12-05 09:13:27 +02:00
yordanov
ffbf4b07f1 Update Scheduler demos 2023-12-01 13:16:33 +02:00
yordanov
88ac570031 Style content in Scheduler Tooltip demo 2023-12-01 11:26:57 +02:00
Atanas Korchev
70c5d4eb43 Set Delay to null. 2023-12-01 10:39:31 +02:00
Atanas Korchev
1899f97b1e Add support for tooltips in Scheduler appointments. 2023-12-01 10:24:08 +02:00
Vladimir Enchev
56cbb44f94 Microsoft.AspNetCore.Components versions updated
Fix https://github.com/radzenhq/radzen-blazor/security/dependabot/4
Fix https://github.com/radzenhq/radzen-blazor/security/dependabot/5
2023-12-01 10:04:25 +02:00
Vladimir Enchev
42c6b70f2b demo fixed 2023-12-01 10:00:39 +02:00
Atanas Korchev
f673a36ccd Wrong pie series tooltip displayed when some value is zero. Fixes #1264. 2023-12-01 09:39:53 +02:00
Vladimir Enchev
80f319311e DataGrid keyboard navigation and selection for rows added 2023-12-01 09:29:13 +02:00
Vladimir Enchev
d256d5f7da System.Linq.Dynamic.Core updated to latest
Fix #1263
2023-11-30 10:11:54 +02:00
liam-gray
0b7737a054 Stop all groups collapsing when switching to and from edit mode (#1265) 2023-11-30 08:50:15 +02:00
Vladimir Enchev
89f0c01acc Version updated 2023-11-29 11:47:40 +02:00
Vladimir Enchev
d66cde252d Editable DropDown demo added 2023-11-28 15:27:00 +02:00
Vladimir Enchev
c9103bd521 Dialog height not updated properly when multiple dialogs are chained 2023-11-28 09:19:22 +02:00
yordanov
d2e87b0e13 Update links 2023-11-28 08:41:38 +02:00
yordanov
a7eb042276 Stop "BlackFriday2023"
This reverts commit 9fd5220e8c.
2023-11-28 08:34:04 +02:00
Vladimir Enchev
114796006f version updated 2023-11-27 19:06:33 +02:00
Vladimir Enchev
38932f14cc DatePicker ShowDays property added to allow Year/Month selection only 2023-11-27 18:59:02 +02:00
Vladimir Enchev
3ee1286cf4 obsolete code deleted 2023-11-27 15:14:51 +02:00
Vladimir Enchev
ffef5923c6 Accordion Select item state fixed 2023-11-27 15:12:56 +02:00
Maks
e670c679df Added FilterString generation for the FilterOperator.In and FilterOperator.NotIn (Intersect/Except) operators for LoadData. (#1260)
Added the correct method for comparing objects supported by a collection, to correctly load the filter with the collection
2023-11-27 11:55:19 +02:00
Vladimir Enchev
06ba235947 demo fixed 2023-11-27 11:52:01 +02:00
Atanas Korchev
db72bb33f2 Stacked area (#1258)
* Stacked area rendering.

* Support markers and tooltips.
2023-11-23 12:54:10 +02:00
Vladimir Enchev
0c700cd1f8 version updated 2023-11-23 09:36:30 +02:00
Vladimir Enchev
721b63b197 DataGrid GroupDescriptor FormatString added 2023-11-22 16:55:10 +02:00
AlittaSakraf
41ca477b8a Update QueryableExtension.cs (#1256)
Bug: If you use a sub-property in the Column PropertyName (ex: "Data2.Name") and the filter is isNull / IsNotNull / Empty/ NotEmtpy  -> There will be an excepction: "Error: The 'np' (null-propagation) function requires the first argument to be a MemberExpression, ParameterExpression or MethodCallExpression (at index 0)
because of the dooble np(np()) in the Filter property....
2023-11-22 08:46:45 +02:00
yordanov
9fd5220e8c BlackFriday2023 2023-11-21 11:33:13 +02:00
Vladimir Enchev
65be8cd2ce Enabled arbitrary attributes for RadzenComponents 2023-11-20 16:02:08 +02:00
Vladimir Enchev
4b24ed4a21 .NET 8 Static @@rendermode info added 2023-11-20 15:54:52 +02:00
yordanov
93bdb4236e Fix frozen column background with disabled alternating rows. Resolves #1253 2023-11-17 11:08:54 +02:00
Vladimir Enchev
db82a14837 analytics restored 2023-11-16 17:12:32 +02:00
Vladimir Enchev
b6cb460085 Version updated 2023-11-16 15:16:08 +02:00
Vladimir Enchev
358bb18f8f Fixed DataGrid CellRender not raised for child columns
Fix #1252
2023-11-16 15:15:54 +02:00
Vladimir Enchev
bd2cc60aae Version updated 2023-11-16 10:08:20 +02:00
Vladimir Enchev
f00bd31eaf Fixed adding attributes in DataGrid CellRender event 2023-11-16 10:08:03 +02:00
yordanov
191ca88daa Fix FormField input disabled color 2023-11-15 14:20:12 +02:00
Vladimir Enchev
611571d566 Demos converted to .NET 8 Blazor Web app type (#1250)
* Demos converted to new Blazort Web .NET 8 app

* code edit fixed
2023-11-15 14:19:51 +02:00
Vladimir Enchev
11550edcd0 Version updated 2023-11-14 22:10:45 +02:00
Vladimir Enchev
3c51f44190 Change reverted
Reverted https://github.com/radzenhq/radzen-blazor/pull/1246
2023-11-14 22:09:34 +02:00
Vladimir Enchev
ee3fbcae78 8.0 restored 2023-11-14 22:02:24 +02:00
Vladimir Enchev
63ad119e63 version updated 2023-11-14 22:01:23 +02:00
Vladimir Enchev
bfcae3fc70 code removed 2023-11-14 21:57:48 +02:00
Vladimir Enchev
21b261b2d3 code fixed 2023-11-14 21:56:59 +02:00
Vladimir Enchev
9ac94167d2 attempt to clear 2023-11-14 21:55:43 +02:00
Vladimir Enchev
170c782ba2 code fixed 2023-11-14 21:53:21 +02:00
Vladimir Enchev
7465259340 docker updated 2023-11-14 21:52:41 +02:00
Vladimir Enchev
c871e8b64e docker updated to .NET 8 2023-11-14 18:49:48 +02:00
Vladimir Enchev
1dfaa93568 Version updated 2023-11-14 18:43:57 +02:00
Vladimir Enchev
866c480634 .NET8 added (#1248)
* net8 added

* Update ci.yml
2023-11-14 18:42:47 +02:00
Vladimir Enchev
ae6fbc1acb Panel expand/collapse icon position demo added
Close #1244
2023-11-14 15:22:08 +02:00
Vladimir Enchev
1cbf9c5eb8 Fixed virtualized DropDown will not raise LoadData when empty
Fix #1247
2023-11-14 14:35:37 +02:00
DanRogers99
210da6c94b Numeric Issue with Leading Zeros (#1245)
* Numeric Issue with Leading Zeros

* .
2023-11-14 14:18:09 +02:00
MicrosoftHawk
5be889d169 The EditRow doesn't use the same compare method as the CancelEditRow. (#1246)
Co-authored-by: Siebe Jan de Vries <siebejan.devries@axba.nl>
2023-11-14 14:08:27 +02:00
Vladimir Enchev
03f992bfc5 various warnings fixed 2023-11-14 10:38:25 +02:00
DanRogers99
db6afdbfbb Add Icon (#1243) 2023-11-14 08:43:39 +02:00
Vladimir Enchev
624c562c1f Menu item disabled property added (#1242)
* RadzenMenuItem Disabled property added

* code fixed

* Update premium themes

---------

Co-authored-by: yordanov <vasil@yordanov.info>
2023-11-13 21:13:29 +02:00
Derek Beattie
4809eccb9e Update DataGridColumnResizing.razor (#1241)
This demo demonstraes column resizing but the column lines aren't visible.
2023-11-13 09:07:27 +02:00
Vladimir Enchev
1f9f46175c Optimized DataGrid cell attributes 2023-11-12 12:38:42 +02:00
Vladimir Enchev
71b16e1824 Set DataGrid cell rowspan/colspan only when needed 2023-11-10 16:44:00 +02:00
Vladimir Enchev
3975b2c6e3 virtualization removed from demo 2023-11-10 11:59:14 +02:00
Vladimir Enchev
48bcb02f82 Added virtualization to performance demo 2023-11-10 11:48:05 +02:00
Vladimir Enchev
9fd83e56e2 Version updated 2023-11-10 07:14:27 +02:00
Vladimir Enchev
a40742a45c DataGrid RowDoubleClick not raised 2023-11-10 07:14:14 +02:00
Vladimir Enchev
4d10e7e290 Version updated 2023-11-09 21:49:28 +02:00
Vladimir Enchev
83f1a1ef8e DataGrid row selection fixed 2023-11-09 21:49:19 +02:00
Vladimir Enchev
47581eb453 AutoComplete will select item on TAB 2023-11-09 17:10:43 +02:00
Vladimir Enchev
045ac03837 Version updated 2023-11-09 16:19:32 +02:00
Vladimir Enchev
6439845d32 bootstrap CSS added 2023-11-08 13:59:25 +02:00
Vladimir Enchev
0b0721b9d3 bootstrap CSS added 2023-11-08 11:41:56 +02:00
Vladimir Enchev
f1ba65affa More DataGrid cell render optimizations 2023-11-07 16:33:37 +02:00
GeorgeKarlinzer
e60bdbf80c Make RadzenDataGrid.ItemEquals protected (#1239)
Co-authored-by: Heorhi Kupryianau <h.kupryianau@sente.pl>
2023-11-07 09:51:40 +02:00
Vladimir Enchev
2269b500f3 Fixed RadzenDropDownDataGrid not calling LoadData when virtualized and empty initially 2023-11-06 16:34:40 +02:00
Vladimir Enchev
089f2e964c Version updated 2023-11-06 11:26:42 +02:00
Vladimir Enchev
1e477f71ef Demo service changed to our OData service which support In operator 2023-11-06 11:25:03 +02:00
Vladimir Enchev
430e8efd42 DataGrid In/NotIn filter operators should be available only for IEnumerable
Opt
2023-11-06 11:17:00 +02:00
kSacred
bddd7e5417 Fix columns visibility when DataGrid Reset, columns visibility returns to its default state (#1233) 2023-11-06 10:21:55 +02:00
Paul Ruston
10deb4c51a Add property to SplitterPane to be able to hide Splitter Bar (#1238) 2023-11-06 10:21:02 +02:00
Victor Ureta
530c3a5576 Gets the currently selected RadzenTabsItem based on the selectedIndex (#1235) 2023-11-06 10:20:44 +02:00
Vladimir Enchev
4e5cb34051 cell render improved (#1234) 2023-11-03 18:36:39 +02:00
Vladimir Enchev
e7c5eb6bee DropDown and DropDownDataGrid InputAttributes added
Close #1016 #1232
2023-11-03 09:46:39 +02:00
Vladimir Enchev
f2cb6ed1a6 DropDownDataGrid keyboard row navigation added 2023-11-02 17:29:12 +02:00
yordanov
ce745204f7 Update product descriptions 2023-11-02 15:36:12 +02:00
yordanov
8b3c9f2f72 Update example reference 2023-11-02 10:52:50 +02:00
Vladimir Enchev
2aa1c85972 missing title added 2023-11-02 10:36:36 +02:00
Vladimir Enchev
766e5db363 Version updated 2023-11-02 10:16:12 +02:00
Vladimir Enchev
c1504e104d ToggleButton component added (#1231)
* Added ToggleButton component

* IconColor support added to ToggleButton

* ToggleButtonStyle and ToggleShade added

* toggleStyle fixed

* ToggleIcon added

* code improved

* Update ToggleButton demos

* use ToggleIcon only if specified

* ToggleShade imroved

* ToggleShade set to Shade.Default

* Shade.Darker for ToggleShade

* rz-shade-default removed when toggled

* buttonStyle replaced

* classes reworked

* base classes reworked

* Update ToggleButton demos

---------

Co-authored-by: yordanov <vasil@yordanov.info>
2023-11-02 10:12:56 +02:00
DanRogers99
3705b740c9 Close Nested Modals (#1227) 2023-10-31 09:34:12 +02:00
Vladimir Enchev
85889ee338 Added ContextMenu Support on RadzenMenuItem
Fix #1224
2023-10-30 16:13:10 +02:00
Atanas Korchev
32254fbed8 Display error if the example cannot be loaded. 2023-10-30 10:35:30 +02:00
Vladimir Enchev
62fbac2d19 Version updated 2023-10-30 09:41:19 +02:00
Vladimir Enchev
6b02bb973f DialogOptions.CloseDialogOnEsc behavior fixed
Fix #1221
2023-10-30 09:40:51 +02:00
Vladimir Enchev
1ad15035de Fixed RequiredValidator validation of DropDown with multiple selection. 2023-10-27 13:27:30 +03:00
Vladimir Enchev
dd7a21010a Fixed DataGrid LoadData filter when binding to OData with virtualization
Fix #1220
2023-10-26 16:58:31 +03:00
Atanas Korchev
f69ab641f7 Add mask to the full height overlay. 2023-10-25 13:21:52 +03:00
yordanov
27308b59ea Update tags in Layout demos 2023-10-25 13:03:22 +03:00
yordanov
f1aa9fe906 Style collapse button in sidebar 2023-10-25 12:43:31 +03:00
Atanas Korchev
112b28342a Layout demo improvements. 2023-10-25 12:05:23 +03:00
Vladimir Enchev
2f9fe92b6c multiple CaptureUnmatchedValues removed 2023-10-24 11:39:17 +03:00
Vladimir Enchev
4a45c78512 InputAttributes added to various form components
Fix #1212
2023-10-24 09:17:20 +03:00
Vladimir Enchev
0c78f66c21 Row keeps highlighted state after clearing DropDownDataGrid
Fix #1215
2023-10-24 08:58:24 +03:00
Dave Bagler
be6f934e7b Added expand/collapse title and aria-label attributes to panels. (#1217) 2023-10-24 08:36:19 +03:00
Vladimir Enchev
79fa11f2c9 demo improved 2023-10-23 14:32:11 +03:00
yordanov
349966a7c3 Update premium themes 2023-10-23 10:30:33 +03:00
Vladimir Enchev
4867825367 Version updated 2023-10-23 09:33:00 +03:00
kSacred
36686afe04 New parameter UniqueFilters in DataFilter. (#1199)
* New parameter Unique filters in DataFilter. If set to true, then only unique filters can be used, that is, one property can only be used once in a filter.
The IsSelected parameter has been added to DataFilterProperty. Indicates whether the property has already been selected in the DataFilter.

* merge master
2023-10-23 09:31:21 +03:00
Vladimir Enchev
9547896074 Second DataGrid frozen columns demo removed 2023-10-23 09:21:00 +03:00
Péter Vida
4ecb737ea7 Right side frozen columns for RadzenDataGrid (#1213)
* FrozenPosition added#

* Some improvements.

* Some improvements.

* Column demo improved.

* Styling fixes.

* _grid.scss update

* Cleanup.

* Cleanup.

* Demo exapmle message.

* ident fix.

---------

Co-authored-by: Péter Vida <vida.peter@vigapeta.com>
2023-10-23 09:20:19 +03:00
Guillermo Orue Marighetti
0147f398ec Catch JSRuntime invoke exceptions (#1210) 2023-10-23 08:55:06 +03:00
Guillermo Orue Marighetti
3fd0420b52 Add EmptyTemplate to RadzenDropdown (#1211)
* Add an empty template to RadzenDropdown

* Adapt validation from RadzenDatagrid structure

* Simplified validations
2023-10-23 08:54:07 +03:00
Atanas Korchev
decba39373 Trying to upload files in RadzenHtmlEditor sometimes throws JS exceptions "target.matches is not a function". 2023-10-20 21:50:10 +03:00
Atanas Korchev
15972a9203 Prevent memory leaks related to validation. 2023-10-20 13:41:14 +03:00
Dave Bagler
94c0a52824 Expand/Collapse aria-label and title attributes. (#1204)
* Adding aria-label and title attribute parameters to field sets and accordion items.

* Changing the Label parameters to AriaLabel
2023-10-20 08:56:18 +02:00
Dave Bagler
d583f52d7e Adding aria-label and title attributes to pager buttons. (#1205)
* Adding aria-label and title attributes to pager buttons.

* Changing the Label parameters to AriaLabel.
2023-10-20 08:55:25 +02:00
Dave Bagler
9b243f90ee Adding title and aria-label attributes to step buttons. (#1208) 2023-10-20 08:54:09 +02:00
GAUSS-LVS Dev
18168e4577 More Image properties (#1207)
* Added an Image property to RadzenLink

* Replaced Version with VersionPrefix in order to specify a VersionSuffix with dotnet pack

* Revert "Replaced Version with VersionPrefix in order to specify a VersionSuffix with dotnet pack"

This reverts commit 457a7b24b8.

* More Image properties
- Added in ContextMenuItem
- Used in RadzenContextMenu
- Added and used in RadzenProfileMenuItem

* Removed Parameter attribute

---------

Co-authored-by: pb <p.baumann@gauss-lvs.de>
2023-10-19 16:20:01 +03:00
GAUSS-LVS Dev
a18e5454ce Added an Image property for RadzenLink (#1203)
* Added an Image property to RadzenLink

* Replaced Version with VersionPrefix in order to specify a VersionSuffix with dotnet pack

* Revert "Replaced Version with VersionPrefix in order to specify a VersionSuffix with dotnet pack"

This reverts commit 457a7b24b8.

---------

Co-authored-by: pb <p.baumann@gauss-lvs.de>
2023-10-19 10:59:58 +03:00
kSacred
7bf16f2891 Added property Sorts to the Query, to obtain sorting in different services, for example during export. (#1206) 2023-10-19 10:59:27 +03:00
kSacred
8491387a15 Fixed loading datagrid filter settings with quotes. When loading the filter value from json, get the string value of the element. (#1202) 2023-10-18 16:03:36 +03:00
Vladimir Enchev
123ae18a64 Version updated 2023-10-18 11:19:58 +03:00
kSacred
f3a19597fc Set the filter operator specified in the code when adding a filter in DataFilter (#1198) 2023-10-18 11:16:29 +03:00
Vladimir Enchev
6c6ccbf07c Fixed exception when removing groups from virtualized DataGrid 2023-10-18 11:12:27 +03:00
Guillermo Orue Marighetti
09af9a2576 Add placeholder to dropdown filter (#1196)
* Add placeholder to dropdown filter

* Fix summary
2023-10-16 14:15:09 +03:00
kSacred
cf813d7eb4 Added the missing classes to the DataFilter elements, by analogy with the already existing rz-datafilter-* element classes. (#1197) 2023-10-16 14:14:37 +03:00
Vladimir Enchev
f0ca523dfb Version updated 2023-10-16 09:53:19 +03:00
Atanas Korchev
6a08443853 Override Dispose in the Monaco component. 2023-10-16 09:45:43 +03:00
DanielSugdenPhoenix
030b9b0c82 Added the ability to display smaller segmented pie charts (#1191)
* Added functionality to allow the changing of the starting angle of, and the number of degrees the pie and donut charts span

* Removed nullable on StartAngle and TotalAngle, added default values and removed unneeded checks

* Updated comment about default value of the StartAngle in RadzenPieSeries

* Refactor the implementation of StartAngle and TotalAngle.

* Fix for rendering segments greater than180 degrees

* Restore the demo.

* Revert "Restore the demo."

This reverts commit 3d44fa71b0.

---------

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-10-16 09:43:21 +03:00
yordanov
8a0b511649 Fix PanelMenu expand arrow position in item template 2023-10-16 09:40:01 +03:00
Marek
7853b830ae RadzenStepsItem can have own NextText and PreviousText (#1195)
Co-authored-by: Marek Mička <xmicka13@vutbr.cz>
2023-10-16 09:18:59 +03:00
Vladimir Enchev
77eb7f7821 SelectBarItem not updated on Disabled change 2023-10-13 11:49:06 +03:00
Atanas Korchev
65e71ac56f More styling fixes in the installation article. 2023-10-13 10:07:21 +03:00
Atanas Korchev
a2a1bcb77b Styling fixes in the installation article. 2023-10-13 09:55:55 +03:00
Atanas Korchev
e8fadc638c Upload documentation fixes. 2023-10-13 09:48:20 +03:00
Atanas Korchev
507a8330b7 .NET 8 documentation updates. 2023-10-13 09:48:13 +03:00
Vladimir Enchev
1dc1c99c33 Slider cannot reach the maximum when initial value is equal to Max 2023-10-12 15:53:59 +03:00
Vladimir Enchev
0cd89585e2 PageSizeOptions added to demo 2023-10-12 10:12:17 +03:00
Guillermo Orue Marighetti
c54148c291 Add placeholder to datagrid filter (#1192) 2023-10-12 08:54:34 +03:00
Vladimir Enchev
f7d7fa5031 Version updated 2023-10-10 15:19:04 +03:00
Vladimir Enchev
d959bd6c34 Tabs item Visible=false not working with TabRenderMode.Client
Fixed
2023-10-10 12:06:06 +03:00
Vladimir Enchev
92240d3e8b Check if grid is not null
Fix #1188
2023-10-10 09:28:42 +03:00
kSacred
0c634a4fa6 Added FilterOperator.Custom check to GetColumnFilter. (#1187)
With FilterOperator.Custom there is no need to generate a filterString, otherwise it throws an error.
2023-10-10 08:36:52 +03:00
Vladimir Enchev
c8e2414a70 RadzenComponents used in the demos 2023-10-09 14:50:42 +03:00
Vladimir Enchev
a6956b34db Version updated 2023-10-09 14:41:30 +03:00
Vladimir Enchev
055c2ec202 Ensure Google API is loaded when calling updateMap() 2023-10-09 14:41:20 +03:00
kSacred
1c0e03eadc Added a check for FilterOperator.Custom in ClearFilters so that the FilterOperator does not change and remains FilterOperator.Custom (#1186) 2023-10-09 14:17:16 +03:00
Vladimir Enchev
f8c44cf2d3 IconColor added to all components with Icon. Predefined theme colors added in Colors class. (#1185) 2023-10-06 11:18:29 +03:00
Vladimir Enchev
d99eeb1e1e RadzenComponents added to simplify adding of special components to layout 2023-10-05 11:16:35 +03:00
Vladimir Enchev
c42a4d9d1c Version updated 2023-10-04 10:07:40 +03:00
Nathan Stuller
2b8eb11bc3 Changing method modifiers so they can be overridden (#1178)
* Changing method modifiers so they can be overridden

* Removing the event handler for onkeydown is what really speeds it up

* Revert OnKeyDown change

---------

Co-authored-by: Nathan Stuller <stullern@hotmail.com>
2023-10-04 07:08:13 +03:00
kSacred
f4f62c6edf Fixed exception when set/load a filter with Nullable enum type in DataGrid (#1179) 2023-10-03 14:48:07 +03:00
kSacred
142f75e662 Added Filters to Query to be able to get filter data via grid.Query.Filters (#1177)
* Added Filters to Query to be able to get filter data via grid.Query.Filters

* Return FilterParameters
removed change for RadzenGrid.razor

* removed change for RadzenGrid.razor
2023-10-03 11:54:55 +03:00
Vladimir Enchev
1bc19921ff Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-09-29 09:24:51 +03:00
Vladimir Enchev
d901b795f7 Version updated 2023-09-29 09:24:48 +03:00
johnmiller86
de19e3abec Added a RadzenGoogleMap boolean parameter to zoom the map to fit marker bounds on update - JDM (#1176)
Co-authored-by: John Miller <JMiller@geo-blue.com>
2023-09-29 09:23:42 +03:00
kSacred
ee1ab72d0a Fix DataGrid not loading with settings if equal to default. (#1175) 2023-09-29 09:22:56 +03:00
Vladimir Enchev
c699dd71af Avoid Radzen is not defined error 2023-09-28 09:15:05 +03:00
Vladimir Enchev
3452bafd4b demo updated 2023-09-28 09:04:32 +03:00
kSacred
0aabac338d Added "Custom" to FilterOperator, for manually building a custom filter (#1169) 2023-09-28 08:56:21 +03:00
kSacred
a9a25a9197 Fixed pagination when set a filter via SetFilterValueAsync in FilterTemplate. (#1173) 2023-09-28 08:51:29 +03:00
Stuart Turner
aa295e9688 Add support for EditTemplate (#1171) 2023-09-27 16:41:01 +03:00
Vladimir Enchev
9cf21b1192 DataGrid multiple selection demo updated 2023-09-27 10:54:22 +03:00
Atanas Korchev
7efb6fc125 Update the scheduler demo to pass a copy of the appointment so cancelling works. 2023-09-24 11:50:38 +03:00
Atanas Korchev
a050af7985 Stacked charts sometimes render gaps. 2023-09-22 17:51:16 +03:00
Vladimir Enchev
25e3fd90c5 Version updated 2023-09-22 15:44:43 +03:00
Vladimir Enchev
e79384a3c4 DropDownBase multiple selection fixed
Fix #1163
2023-09-22 15:44:32 +03:00
Vladimir Enchev
c784af67da Version updated 2023-09-21 09:09:14 +03:00
Vladimir Enchev
74d4681f33 DropDown selected items should be cleared when retrieving from Value 2023-09-21 09:07:20 +03:00
yordanov
eaa939eda3 Update premium themes 2023-09-20 14:10:50 +03:00
Vasil Yordanov
a3b21debb0 Switch from LibSass to Dart Sass (#1161)
Replacing LibSass with Dart Sass. Resolves #1077
2023-09-20 13:59:19 +03:00
Vladimir Enchev
db9168e179 DropDownDataGrid inner DataGrid exposed as property 2023-09-20 09:10:47 +03:00
Vladimir Enchev
d68a5106a5 DataGrid RenderAsync event added
Fix #1160
2023-09-19 16:47:57 +03:00
TimChen
5244d7af1e add IsShowArrow (#1158)
* add IsShowArrow

* layout demo add IsShowArrow

* Modify ShowArrow name
2023-09-18 16:01:32 +03:00
Vladimir Enchev
0ee095617e DataGrid and DataList LoadingTemplate added 2023-09-18 15:58:09 +03:00
Vladimir Enchev
8d7d022576 FocusAsync() method added to all form components 2023-09-18 12:15:40 +03:00
Vladimir Enchev
098cf78753 AutoComplete FocusAsync() method added 2023-09-18 11:52:14 +03:00
Vladimir Enchev
4131811e32 Version updated 2023-09-18 11:21:30 +03:00
Vladimir Enchev
260cd62329 DataGrid RefreshDataAsync() method improved 2023-09-18 10:21:03 +03:00
Vladimir Enchev
b6b8ce55c6 Fixed DataFilter OData filter when selecting all elements of IEnumerable
Fix #1156
2023-09-18 09:11:46 +03:00
Vladimir Enchev
1d3e5a60e2 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-09-18 08:59:01 +03:00
Vladimir Enchev
b2397cfd54 Virtualized DataGrid sorting and cache improved 2023-09-18 08:58:51 +03:00
johanpolak
15ef3bdadb Allow Template in RadioButtonListItem (#1155)
Co-authored-by: Johan Polak | Camas IT bv <JohanPolak@camasit.nl>
2023-09-18 08:47:40 +03:00
Vladimir Enchev
c353e713cc Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-09-18 08:45:54 +03:00
Atanas Korchev
1eaaad320f Allow specific generic definitions. 2023-09-14 18:48:50 +03:00
Atanas Korchev
e0c0071d8b Enable RadzenComponentActivator only for .NET 5 or greater. 2023-09-14 18:35:56 +03:00
Atanas Korchev
0a7c274f33 Add component activator that allows replacing component intsances with custom ones. 2023-09-14 18:32:34 +03:00
yordanov
d4621f8b8a Update premium themes 2023-09-14 11:37:57 +03:00
yordanov
5b0c1fd16e Fix alignment in DataGrid column draggable hint 2023-09-14 11:31:58 +03:00
yordanov
6b5847f149 Update premium themes 2023-09-14 09:33:31 +03:00
yordanov
b227d89a01 Fix DataGrid group header spacing in compact mode 2023-09-14 09:24:48 +03:00
Vladimir Enchev
a4191556ea DataGrid RefreshDataAsync() method added 2023-09-14 05:24:12 +03:00
yordanov
a7d90c0b39 Fix Wrap option in RadzenStack demo 2023-09-13 19:37:22 +03:00
yordanov
6edef4ec97 Update premium themes 2023-09-13 19:00:10 +03:00
yordanov
17f7ae7daa Add today styles to DatePicker 2023-09-13 18:46:24 +03:00
Vladimir Enchev
03d33f2074 Version updated 2023-09-13 16:02:11 +03:00
Vladimir Enchev
8787d8ad43 DataGrid LoadSettings event added 2023-09-13 16:01:52 +03:00
Vladimir Enchev
69f98aa756 demo fixed 2023-09-13 15:20:24 +03:00
Vladimir Enchev
9620faafe1 version updated 2023-09-13 11:48:33 +03:00
Vladimir Enchev
2ba0b164fc DataGrid internal clear of the LoadData args cache imlemented 2023-09-13 11:48:11 +03:00
Vladimir Enchev
77b9b2e8ce DataGrid Reload() overload simplified 2023-09-13 10:50:42 +03:00
Vladimir Enchev
58be436aaa DataGrid LoadData args cache simplified 2023-09-13 10:21:32 +03:00
Vladimir Enchev
5995eb8b8e DataGrid should not call LoadData twice on first render when virtualized 2023-09-13 10:13:36 +03:00
Vladimir Enchev
0e4f942b15 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-09-12 17:16:56 +03:00
Vladimir Enchev
c14f773ed4 DataGrid Reload() method overload added with ability to clear the cache 2023-09-12 17:16:46 +03:00
TimChen
3ef08a53d1 add icon sidebar demo (#1153) 2023-09-12 17:06:09 +03:00
Vladimir Enchev
67d32c5a96 Version updated 2023-09-12 10:20:48 +03:00
Vladimir Enchev
e351793043 DataGrid LoadData event calls optimized when virtualization is on 2023-09-12 10:14:50 +03:00
Vladimir Enchev
f0a987e7a2 Fixed UTC dates to work with fi-FI and dk-DK cultures 2023-09-12 08:42:47 +03:00
AlittaSakraf
c0354961f7 Update RadzenNumeric.razor.cs (#1149)
There is a bug: Uncaught ReferenceError: False is not defined
at HTMLInputElement.onblur
2023-09-11 19:24:32 +03:00
TimChen
4c8c8dcdab panel menu item add display style (#1147)
* panel menu item add display style

* Remove unnecessary DisplayStyle attributes
2023-09-11 19:23:43 +03:00
Vladimir Enchev
cae80096e1 DatePicker day render refactored 2023-09-08 09:55:12 +03:00
Vladimir Enchev
45d4fcc0bf DataFilter will clear FilterValue and disable input if operator is set to empty/null 2023-09-08 09:30:10 +03:00
Marek
da5380a472 Added columnPickerTitle (#1144)
Co-authored-by: Marek Mička <xmicka13@vutbr.cz>
2023-09-07 17:53:17 +03:00
Vladimir Enchev
b27544663e Version updated 2023-09-07 11:06:19 +03:00
Vladimir Enchev
75c35aa9e5 Popup should not be destroyed on dispose 2023-09-07 11:05:37 +03:00
Vladimir Enchev
ad0fd8d5c8 Fixed DropDown ClearSearchAfterSelection behavior
Fix #1143
2023-09-07 09:07:48 +03:00
Vladimir Enchev
c60cd1fabb DataGrid settings save/load of arrays fixed
Fixed #1139
2023-09-06 16:36:40 +03:00
kSacred
7cfb6258d5 Fix calling DataGrid Reload when loading settings with filter and page greater than 1. (#1141) 2023-09-06 10:18:43 +03:00
Vladimir Enchev
ff1bc2577f Version updated 2023-09-04 16:20:00 +03:00
Vladimir Enchev
07ab3621b3 Popup toggle logic fixed 2023-09-04 16:17:54 +03:00
Vladimir Enchev
0af3f3fcce Fixed DatePicker closed immediately after selecting a month or year from the drop-down lists when using PopupRenderMode.OnDemand
Fix #1138
2023-09-04 13:33:11 +03:00
Vladimir Enchev
cb8a70744d Cannot toggle visibility of Steps item 2023-09-04 11:51:16 +03:00
Vladimir Enchev
c6a8d3e251 ExpandMode removed from DataGrid self-referenced hierarchy demo 2023-09-04 10:11:17 +03:00
TimChen
d871292d39 Add TabsModify Demo (#1133)
* Add TabsModify

* Fix the tabs modify example
2023-09-04 09:32:20 +03:00
Vladimir Enchev
255febcd70 Selected item not retrieved properly when bound using LoadData with custom filtering 2023-09-01 14:46:16 +03:00
Vladimir Enchev
c7d8f77fb4 Version updated 2023-09-01 10:16:21 +03:00
Vladimir Enchev
248de4ef0f AddRadzenComponents() method used across demos 2023-09-01 10:16:13 +03:00
Vladimir Enchev
56ae5d2c33 Tooltip close logic fixed to not show tooltips with delay if Close() is invoked 2023-09-01 10:11:06 +03:00
Vladimir Enchev
2cc575d74b Avoid acessing DataGrid PageSize directly when loading settings 2023-08-29 17:00:28 +03:00
yordanov
b0b68d16a4 Update premium themes 2023-08-29 16:29:48 +03:00
Vladimir Enchev
45fd510e15 AddRadzenComponents() extension method added 2023-08-29 11:16:34 +03:00
Vladimir Enchev
0376a58374 Version updated 2023-08-29 09:45:16 +03:00
Vladimir Enchev
b1d1d2c7f8 DataGrid will not call LoadData in simple filter with virtualization enabled 2023-08-29 09:45:00 +03:00
Vladimir Enchev
6de14c91e4 Clear selected rows button added 2023-08-28 16:23:40 +03:00
Vladimir Enchev
a04cbeba78 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-08-28 10:54:11 +03:00
Vladimir Enchev
82610e281d ContextMenu doesn't work for RadzenPanelMenuItem
Fix #1130
2023-08-28 10:54:02 +03:00
stlufred
e9b3213d8b Make icon used by data grid filter customizable (#1129) 2023-08-28 10:32:13 +03:00
mvoxland-MoorheadSchools
313ee50bf2 Indication for isNull/isNotNull in simple datagrid filter (#1127)
Added an Indication for when a datagrid (in simple mode)'s filter operator is set to either "is null" or "is not null". Before there was no way to see that any filters were applied until the popup was opened.
2023-08-28 10:26:22 +03:00
Vladimir Enchev
fca72e3fad Version updated 2023-08-24 10:12:54 +03:00
yordanov
97657da95d Update premium themes 2023-08-23 18:06:23 +03:00
Atanas Korchev
f32240ba65 RadzenHtmlEditor fires its Change event before updating the argument specified with @bind-Value. 2023-08-23 16:28:01 +03:00
yordanov
1d8d20a7d7 Keep base, light, and dark styles in a single base-styles-map for consistency across themes 2023-08-22 11:05:51 +03:00
Cosmatevs
5fba2685b1 Timeline: add missing light and dark styles (#1122) 2023-08-22 10:44:26 +03:00
AlittaSakraf
2c39551560 Update RadzenDataGridFilterMenu.razor (#1123)
If you use "FilterMode.SimpleWithMenu" and Grid Settings together, then the "Clear" button in the fitler menu, do not work, because there was a SaveSetting() calling in the ClearFilter function. (Always loaded the "last" settings, after the Clear button has pushed.
2023-08-22 09:31:58 +03:00
Vladimir Enchev
265ca8b433 themes updated 2023-08-21 15:36:25 +03:00
Vladimir Enchev
8c4b33ec17 Version updated 2023-08-21 15:28:40 +03:00
yordanov
937bf6f57a ShowValue should display ProgressBar label in Material and Fluent themes. Resolves #1119 2023-08-21 14:46:51 +03:00
Vladimir Enchev
e2f142ed28 DropDownDataGrid pager will not wrap if not needed 2023-08-21 13:44:08 +03:00
yordanov
9a835690aa Update Material Dark theme 2023-08-21 11:12:38 +03:00
Atanas Korchev
5f4ec1c446 Add the Appointment model in the demo. 2023-08-21 11:05:19 +03:00
Atanas Korchev
7b11516520 Update the MoreSelect documentation. 2023-08-21 11:05:19 +03:00
Atanas Korchev
4a6543b0c6 Add related files to the export demo. 2023-08-21 11:05:19 +03:00
Atanas Korchev
fa197c1b7f Dispose the editor and support csharp language syntax highlighting. 2023-08-21 11:05:19 +03:00
Cosmatevs
ab4ab7e63b Fix wobbly tab selection in Material theme – resolves #1116
To do: update Material Dark theme
2023-08-21 10:39:07 +03:00
Vladimir Enchev
b88a8e605a Test deleted since the DatePicker will treat now default(DateTime) as null 2023-08-21 10:08:53 +03:00
Vladimir Enchev
519d8fc64a DatePicker will treat default(DateTime) as null 2023-08-18 10:44:59 +03:00
Vladimir Enchev
8032fde262 demo updated 2023-08-18 09:06:23 +03:00
Vladimir Enchev
02b4b0b9b6 Version updated 2023-08-18 08:47:06 +03:00
Vladimir Enchev
933c820f20 RadzenNumeric defaults to min value on tab 2023-08-18 08:46:31 +03:00
Thorsten Liborius
8476fdb77f OpenAsync method signature changed to virtual to support unit testing (#1117)
Co-authored-by: Thorsten Liborius <thorsten.liborius@shkb.ch>
2023-08-18 08:05:31 +03:00
Vladimir Enchev
ae1f280062 DropDown, DropDownDataGrid and ListBox SearchText two-way binding support added 2023-08-17 16:38:48 +03:00
Vladimir Enchev
d58dd28051 AdditionalSourceCodePages set 2023-08-17 11:41:40 +03:00
Vladimir Enchev
a212382da6 DataGridFooterTotals demo improved 2023-08-17 11:33:34 +03:00
Vladimir Enchev
b1819ff755 Enabled warnings to be treated as errors
[BREAKING] DropDownDataGrid SearchText renamed to SearchTextPlaceholder
2023-08-16 12:20:55 +03:00
Cosmatevs
2317305f0e Switch: make clicking a label change a value of the corresponding switch (by Name property; as in the case of ordinary checkboxes) (#1115) 2023-08-15 16:28:26 +03:00
Vladimir Enchev
da5f7e27c4 Allow DataGrid settings to be loaded in OnInitialized() 2023-08-15 11:19:19 +03:00
Vladimir Enchev
4c4dd71195 Version updated 2023-08-11 08:48:22 +03:00
Vladimir Enchev
61c3d3c34a Virtualized DropDownDataGrid refresh after filter will not work properly in some cases 2023-08-11 08:45:10 +03:00
Vladimir Enchev
59d4e30469 Version updated 2023-08-11 07:59:19 +03:00
Cosmatevs
e0dd34df2b DataGrid: prevent sorting from being triggerred while resizing a reorderable column (#1109)
* DataGrid: give unique IDs to column resizers and column reorderers to avoid using wrong elements in js functions

* Typo fix
2023-08-11 07:58:47 +03:00
Cosmatevs
41366d9376 DataGrid: make headers and footers of frozen columns frozen just like cells are (fix to commit 2795413) (#1108) 2023-08-11 07:56:41 +03:00
Vladimir Enchev
1779b8d67e Version updated 2023-08-10 16:35:49 +03:00
Vladimir Enchev
b673cbe411 Load settings by Property/UniqueID improved 2023-08-10 16:35:41 +03:00
Vladimir Enchev
1a595c5043 DataGrid will no longer auto-generate column UniqueID and will save settings for columns only if Property or UniqueID is set 2023-08-10 16:30:52 +03:00
Vladimir Enchev
bce5ae88ee Version updated 2023-08-10 14:57:05 +03:00
Vladimir Enchev
b81d15cdef DataGrid will use column index instead GUID for UniqueID 2023-08-10 14:56:27 +03:00
Vladimir Enchev
ec6747ac09 Too early close of filter popup can cause improper filter 2023-08-10 13:51:45 +03:00
Vladimir Enchev
5cd35bbfb5 DatePicker should not allow dates outside of Min/Max on Ok button
Fix #1107
2023-08-10 11:10:27 +03:00
Vladimir Enchev
1b07509e18 Theme page simplified 2023-08-10 10:54:43 +03:00
Vladimir Enchev
35211b94db DataGrid CloseFilter() logic fixed with OnDemand FilterPopupRenderMode 2023-08-10 10:32:10 +03:00
yordanov
0e9338a0e4 Add Themes demo page 2023-08-10 09:07:40 +03:00
Vladimir Enchev
95b099d62c Added DataGrid self-reference hierarchy expanded class for indent
Fix #1104
2023-08-09 08:05:47 +03:00
yordanov
b295963d8d Update demos descriptions 2023-08-08 12:11:50 +03:00
Vladimir Enchev
884ca797d8 Version updated 2023-08-08 10:43:52 +03:00
Vasil Yordanov
3664b4acec Timeline component (#1103)
* Add RadzenTimeline component, styles and demos

---------

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-08-08 10:37:39 +03:00
Vladimir Enchev
95f33310bf Fixed RadzenTabs - selected tab styling incorrect with hidden tabs
Fix #1003
2023-08-07 11:41:17 +03:00
Vladimir Enchev
a1500051b9 Cascading data loaded on-demand 2023-08-07 11:24:51 +03:00
Vladimir Enchev
be1a6cc985 Added Save/Load settings support for DataGrid columns without Property
Fix #1058
2023-08-07 11:17:53 +03:00
Vladimir Enchev
32525a0204 RadzenNumeric inconsistently resets Value when out of Max/Min
Fixed #1098
2023-08-07 10:58:39 +03:00
Vladimir Enchev
8b64c8afd3 Fixed popup close logic
Fix #1086
2023-08-07 10:44:50 +03:00
stlufred
2795413fc1 Fix customizing style of in HeaderCellRender and FooterCellRender (#1102) 2023-08-07 10:11:48 +03:00
Vladimir Enchev
8db9fc3f17 other filtering demos improved to respect auto-filter setting in template filters 2023-08-01 11:08:49 +03:00
Vladimir Enchev
d7c2fb8a02 OrderID will respect auto-filter setting 2023-08-01 11:03:14 +03:00
Vladimir Enchev
6c9d09f6c3 Date only filtering demo added 2023-08-01 09:17:57 +03:00
Vladimir Enchev
1482fe3e1b RadzenNumeric added to DataGrid column filter template demo 2023-08-01 08:51:07 +03:00
Vladimir Enchev
c2f0422a68 Fixed DataGrid inner filter popups not closed properly 2023-07-31 17:17:04 +03:00
Vladimir Enchev
4b3a7af308 Version updated 2023-07-31 08:04:58 +03:00
Vladimir Enchev
7b2cd6e4b0 DataList Reload() fixed
Fix #1095
2023-07-31 08:04:28 +03:00
Vladimir Enchev
60dbe28dca Popup demo improved 2023-07-28 10:14:41 +03:00
Vladimir Enchev
3dde8c5905 Fixed DropDown, DropDownDataGrid and ListBox filtering input logic 2023-07-28 09:48:09 +03:00
Vladimir Enchev
9207ef357f Version updated 2023-07-27 10:58:49 +03:00
Vladimir Enchev
ce7ea27255 DataList Reload() fixed in case of virtualization 2023-07-27 10:54:36 +03:00
Vladimir Enchev
c3eb701c56 Search added to custom popup demo 2023-07-27 10:54:19 +03:00
Vladimir Enchev
180c1fe185 Popup component example added 2023-07-27 09:46:40 +03:00
Rogier Reedijk
9b3138102d Add ParseInput to DatePicker (#1090)
* Add ParseInput to DatePicker

* Add demo for DatePicker.ParseInput

---------

Co-authored-by: Rogier Reedijk <reedijkr@wigo4it.nl>
2023-07-26 18:02:51 +03:00
Thomas Knudsen
e43412c02f Use key directive for notifications (#1092)
Co-authored-by: Thomas H. Knudsen <thk@yco.dk>
2023-07-26 18:01:45 +03:00
Cosmatevs
a223fad28c RadzenDataGridColumn: handle non-px widths of frozen columns (#1076)
* DataGridColumn: handle non-px widths of frozen columns, simplify css style conditions

* DataGridColumn: simplify calculation of frozen column style
2023-07-25 20:32:30 +03:00
Vladimir Enchev
9ade31a813 Version updated 2023-07-25 10:08:37 +03:00
Vladimir Enchev
fd91024b8d DataFilter PropertiesCollection added similar to DataGrid ColumnsCollection 2023-07-25 09:30:36 +03:00
Vladimir Enchev
0d9526ed72 LoadStateAsync called multiple times in the demo
Fix #1083
2023-07-25 09:06:07 +03:00
Vladimir Enchev
d4e51a1b51 OData filtering of DateTime fixes for various cultures 2023-07-25 08:49:42 +03:00
nitrouscookies
ded26df5d0 DataFilter - Added AllowColumnFiltering (#1079)
Co-authored-by: dstillwell <dstillwell@moorheadschools.org>
2023-07-25 08:43:28 +03:00
kSacred
a3ba44771f Added "Show button" parameter to radzendatapicker. (#1075)
Allows to hide the button in the field and open popup datepicker when you click on the field with "input is allowed"

Co-authored-by: Sacred <s>
2023-07-25 08:43:07 +03:00
Cosmatevs
83f4ac980e DataGridColumnHeaderCell: make the resizing element fill the whole cell while resizing to prevent an accidental click on the cell and therefore an unexpected resort (#1082) 2023-07-25 08:40:49 +03:00
Ben Croughs
5da102c058 close event on x (#1085)
Co-authored-by: BC3 <bc3@telenet.be>
2023-07-25 08:39:20 +03:00
kSacred
27608327af Added SetFilterValueAsync method set column filter value and reload grid. Allows you to use the FilterTemplate without initializing an additional property. (#1087)
Co-authored-by: Sacred <s>
2023-07-25 08:38:56 +03:00
Vladimir Enchev
fcbbd53dd8 Version updated 2023-07-19 10:54:53 +03:00
Vladimir Enchev
76aaab319c Revert "switching from libsass to dartsass (#1068)"
This reverts commit f77ebe3af7.
2023-07-19 10:54:10 +03:00
yordanov
6ea6a46c15 Update premium themes 2023-07-19 09:47:34 +03:00
Victor Ureta
c0f3e62a10 Add MarkupString in RadzenFormField (#1071) 2023-07-18 19:56:41 +03:00
Vladimir Enchev
5f71660c7a version updated 2023-07-18 10:14:26 +03:00
Vladimir Enchev
e6b15de5a4 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-07-18 10:11:09 +03:00
Vladimir Enchev
bf74569906 themes updated 2023-07-18 10:11:06 +03:00
Atanas Korchev
b70f1f84be Change the implementation of NoTools and rename it to ShowToolbar. 2023-07-18 10:08:24 +03:00
Dave Bagler
a2209e73fc Htmledit on input (#1070)
* adding a paramter for allow for no-tool HTMLEditors.

* Adding input event to the HTMLEditor
2023-07-18 09:38:08 +03:00
Dave Bagler
f77ebe3af7 switching from libsass to dartsass (#1068) 2023-07-18 09:37:31 +03:00
Cosmatevs
8c4370780d Progress bar circular component + progress bar extension (#1044)
Add RadzenProgressBarCircular component
2023-07-17 19:29:58 +03:00
Cosmatevs
e4b352f1ce DataGridColumn: Add ShowUpDownForNumericFilter function; rename the class file for hierarchy (#1065)
Demos/GataGridFilterApi: Use override of ShowUpDownForNumericFilter
2023-07-17 19:13:03 +03:00
Jimmy Ho
a679e33d54 fix AddButton not enable (#1066)
click AddButton, then click Edit/Delete button on the other row, how ever save/cancel, the AddButton still disable
2023-07-17 19:11:15 +03:00
Vladimir Enchev
e477ce3d9a Version updated 2023-07-14 12:17:17 +03:00
kSacred
f15d7ac445 Fix: enum dropdown beyond the edge of the column (#1061) 2023-07-14 09:42:47 +03:00
kSacred
d36af364bf Added custom text for null enum value in filter. Default value "No value" instead of "<null>". (#1062)
Co-authored-by: Sacred <s>
2023-07-14 09:41:41 +03:00
Vladimir Enchev
b0ebcf86e6 DropDownBase filtering enum by description support added 2023-07-14 09:40:49 +03:00
Atanas Korchev
247ec75c9e Scheduler does not display certain events in day and week view. 2023-07-13 20:08:11 +03:00
Atanas Korchev
3b43bf3579 Cannot edit demos that use other pages. 2023-07-13 14:10:10 +03:00
atafra92
2be6d5cdef add isLoading property to dropdown datagrid component (#1054)
* add isLoading property to dropdown datagrid component

* Revert "add isLoading property to dropdown datagrid component"

This reverts commit 7299939f7c.

* added isLoading property to dropdown datagrid component
2023-07-13 09:47:35 +03:00
kSacred
fef7526af4 Fix search with quotes in RadzenDataGrid filter (#1051) 2023-07-12 14:57:46 +03:00
yordanov
88ee26ecf8 Fix typo. Resolves #1053 2023-07-12 09:47:57 +03:00
Atanas Korchev
947c602cb0 A visual glitch appears when using StrokeWidth in RadzenPieSeries. 2023-07-07 09:35:51 +03:00
Ben Croughs
fd0cf4e4e3 do not hide 2 notification when clicking close (#1047)
Co-authored-by: BC3 <bc3@telenet.be>
2023-07-06 21:08:14 +03:00
foerdi
0d11bffa82 fixed PropertyAccess.GetProperty for complex property expressions (#1048)
RadzenDataGrid could not be filtered or sorted by colums with advanced
proprty expressions like function calls

Co-authored-by: Ferdinand Lange <lange@iftc.uni-hannover.de>
2023-07-06 08:45:05 +03:00
Vladimir Enchev
c9a9c48de3 Version updated 2023-07-03 19:47:06 +03:00
Vladimir Enchev
fbbcb58e3f DataGrid INotifyCollectionChanged support added 2023-06-30 11:40:06 +03:00
yordanov
ed9dbea34a Add Quickstart image 2023-06-28 11:21:37 +03:00
yordanov
9ccca42011 Add a Quickstart video to Get started page 2023-06-28 11:19:47 +03:00
dependabot[bot]
d7bc92e465 Bump System.Linq.Dynamic.Core from 1.2.22 to 1.3.0 in /Radzen.Blazor (#1041)
Bumps [System.Linq.Dynamic.Core](https://github.com/zzzprojects/System.Linq.Dynamic.Core) from 1.2.22 to 1.3.0.
- [Release notes](https://github.com/zzzprojects/System.Linq.Dynamic.Core/releases)
- [Changelog](https://github.com/zzzprojects/System.Linq.Dynamic.Core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zzzprojects/System.Linq.Dynamic.Core/compare/v1.2.22...v1.3.0)

---
updated-dependencies:
- dependency-name: System.Linq.Dynamic.Core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-28 10:48:38 +03:00
yordanov
5d29ebfde2 Update see in action link 2023-06-28 10:16:12 +03:00
Vladimir Enchev
efa14f2dcd DatePicker FormattedValue do not respect specified Culture 2023-06-26 14:47:07 +03:00
Vladimir Enchev
2e07802a05 Version updated 2023-06-26 11:13:05 +03:00
Vladimir Enchev
34a83a46d9 DataGrid column picker not closed properly when FilterPopupRenderMode=OnDemand
Fix #1039
2023-06-26 10:11:48 +03:00
Atanas Korchev
9db5c68a64 Fix wrong tag name in HelpPrerequirements.razor. 2023-06-26 09:18:58 +03:00
Atanas Korchev
5dac84c511 Add FocusAsync method to RadzenHtmlEditor. 2023-06-26 09:18:58 +03:00
yordanov
ce834c9b18 Update DataGrid footer totals and template demos 2023-06-23 18:20:07 +03:00
Atanas Korchev
0af5f626bc Make the anchors in RadzenText scroll the page. 2023-06-22 12:47:13 +03:00
Atanas Korchev
0d68186dfe The remember me text is missing when FormFieldVariant is set of RadzenLogin. 2023-06-22 10:15:29 +03:00
Vladimir Enchev
65e226d02d Version updated 2023-06-20 14:37:16 +03:00
Vladimir Enchev
15d0654cd7 FocusTrap not working on Dialog when last focusable component is RadzenDatePicker
Fix #1024
2023-06-20 14:36:43 +03:00
Vladimir Enchev
f7c36efab8 Not possible to close multiple nested dialogs using the Escape key
Fix #1026
2023-06-20 10:58:28 +03:00
Vladimir Enchev
09e372f37b dialogResizer disposed 2023-06-20 10:37:23 +03:00
Vladimir Enchev
a020e06c3d Dialog height/width should not be changed on drag but only on resize
Close #1032
2023-06-20 10:33:31 +03:00
Atanas Korchev
650f2caf42 Improve RadzenScheduler rendering algorithm to handle more cases. 2023-06-19 17:32:32 +03:00
Vladimir Enchev
bfaa5a9878 Fixed DataGrid doesn't show empty message with empty Data
Fix #1034
2023-06-19 09:55:49 +03:00
Vladimir Enchev
7d22fc727b PagedDataBoundComponent should not raise PageSizeChanged on firs render
Fix #1030
2023-06-19 09:50:27 +03:00
ChristianA1992
e78db0d549 Method to replace only the first occurence of a string (#1028)
There is a bug, if you column is called something like Car.ApiCar.Brand.
When the GetPropertyType method is run, it replaces all occurences of Car. which makes it so the column can't be filtered.
2023-06-16 15:13:45 +03:00
Vladimir Enchev
4a610d9868 Example fixed 2023-06-15 18:03:17 +03:00
yordanov
2c08ab1e52 Update premium themes 2023-06-15 17:24:38 +03:00
Vladimir Enchev
70c26493c4 text fixed 2023-06-15 17:18:45 +03:00
Vladimir Enchev
e5f45550d4 Version updated 2023-06-15 17:07:15 +03:00
Vladimir Enchev
80c196d863 DataFilter LoadData demo added 2023-06-15 17:06:29 +03:00
Vladimir Enchev
516ee4b762 DatePicker doesn't render correctly with PopupRenderMode.OnDemand
Fix #1025
2023-06-15 11:32:02 +03:00
Vladimir Enchev
7371e15ebb Numeric FormattedValue demo fixed
Fix #1022
2023-06-14 16:01:28 +03:00
Vladimir Enchev
b6f6f79c00 DateFilter in DataGrid can not be cleared by using backspace/delete
Fix #1023
2023-06-14 15:50:26 +03:00
Vladimir Enchev
d8dd38dcdd DataGrid column picker filtering made case-insensitive 2023-06-14 11:44:38 +03:00
yordanov
1384c2b477 Update new and updated demo badges 2023-06-14 10:43:35 +03:00
Vladimir Enchev
2006a44fdd DataGrid LoadData executed twice on filter
Fix #1020
2023-06-14 09:53:49 +03:00
yordanov
f7c04c9f7e Card Variant property added 2023-06-14 08:57:45 +03:00
yordanov
1dbb36bd77 Fix accordion border radius. Resolves #1018 2023-06-14 08:45:03 +03:00
yordanov
54cabebbfa Fix FormField label line-height. Resolves #995 2023-06-13 15:26:54 +03:00
Vladimir Enchev
f31c2296dd Version updated 2023-06-13 11:35:11 +03:00
Vladimir Enchev
6f66fd9597 DataGrid column FilterValueTemplate and SecondFilterValueTemplate properties added
Easily customize default DataGrid advanced filter with custom components for FilterValue/SecondFIlterValue. More generic than #1015. Close #1015.
2023-06-13 11:32:54 +03:00
Vladimir Enchev
8c33bd828a example fixed 2023-06-13 10:06:46 +03:00
Vladimir Enchev
068352de91 Numeric should not default to min when value type is nullable 2023-06-13 09:15:49 +03:00
Vladimir Enchev
f5c166906b Fixed DataGrid filtering with In/NotIn in combination with other filter 2023-06-13 08:38:36 +03:00
Atanas Korchev
514772f5c2 Fix typo. 2023-06-12 12:39:53 +03:00
Vladimir Enchev
2e0c2aa8bc DataGrid multiple sorting order saved/restored in proper order from Settings
Fix #1010
2023-06-09 12:05:43 +03:00
Vladimir Enchev
bfd641f1b1 DataGrid ColumnsPickerAllowFiltering property added 2023-06-08 08:00:29 +03:00
Vladimir Enchev
1c45af855d Version updated 2023-06-07 11:27:17 +03:00
Vasil Yordanov
5d7cf75bed New Material 3, Material 3 Dark and Fluent UI Dark premium themes (#1009)
* Update Stack, Row, and Column demos
* Reorder themes in theme picker
* Update premium themes
---------
Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-06-07 11:26:29 +03:00
Vladimir Enchev
04ee23b7b5 DataGrid EmptyTemplate not shown with virtualization using LoadData
Fix #1008
2023-06-06 11:14:27 +03:00
yordanov
99c3c71be8 RadzenBody should have padding 2023-06-06 10:24:12 +03:00
yordanov
0c2fb54d14 Fix css selectors 2023-06-06 09:31:33 +03:00
yordanov
eaf875dfd5 Fix RadzenFormField label position with RadzenRadioButtonList or RadzenCheckBoxList inside 2023-06-06 09:14:02 +03:00
Victor Ureta
29e61087ac Add "Create" Button Functionality to RadzenDropDownDataGrid Component (#1007)
* Add

* Add

* Add

---------

Co-authored-by: Bikotoru Ryzen <you@example.com>
2023-06-06 09:02:44 +03:00
Vladimir Enchev
ef989e7909 Version updated 2023-06-05 16:21:59 +03:00
Vladimir Enchev
ab1fd464cf Fixed DataFilter remove filter 2023-06-05 16:21:13 +03:00
Vladimir Enchev
4a042b73b8 In/NotIn operators removed from DataFilter 2023-06-05 16:03:39 +03:00
Vladimir Enchev
b416a7de09 Use CultureInfo.InvariantCulture when parsing DateTime for OData 2023-06-05 15:29:52 +03:00
Vladimir Enchev
ebec631cde DataGrid Sorts collection exposed 2023-06-05 10:35:03 +03:00
Vladimir Enchev
cd6a751a68 DataGrid ColumnsPickerMaxSelectedLabels property added
Close #https://github.com/radzenhq/radzen-blazor/pull/1001
2023-06-02 09:40:37 +03:00
myfayyad
f90692b526 fix nested columns with grouping in datagrid (#998)
* Update RadzenDataGrid.razor to only show the collapse cell for first row not for nested columns rows header

* Update RadzenDataGridGroupRow.razor to have group record with colspan of visible columns and last leaf columns if nested

* Update RadzenDataGrid.razor remove unnecessary testing classes

* Update RadzenDataGridRow.razor fix nested columns grouping with allow composite cell

* Update RadzenDataGridHeaderCell.razor to allow grouping to composite cells

* fix count columns for colspan calcualtion if we have visible coulmns plus template columns

* modification to allow grouping "AllowCompositeDataCells, HideGroupedColumn" with composite columns when hidegroupedcolumn equal true and allowcompositecolumn equal true

* return example as it to not hide columns grouped by
2023-06-02 09:28:40 +03:00
Vladimir Enchev
b4ff72d424 demo fixed
Fix #999
2023-06-01 15:01:23 +03:00
yordanov
61de002e0e Update premium themes 2023-05-31 19:03:33 +03:00
yordanov
6c063c856c Update badge styles on demos homepage 2023-05-31 11:08:57 +03:00
yordanov
a075a0b29b Update text colors in Colors demo page 2023-05-31 11:04:35 +03:00
yordanov
0e85e70470 Fix rz-body padding 2023-05-31 10:45:57 +03:00
Vladimir Enchev
0e84d1dad1 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-05-30 15:01:04 +03:00
Vladimir Enchev
092b3bf9c2 Version updated 2023-05-30 15:00:49 +03:00
OndrejUzovic
87cf688e27 ColorPicker opens and immediately closes #990 (#992) 2023-05-30 14:58:47 +03:00
yordanov
892cab3adf Add --rz-text-selection CSS variables 2023-05-30 10:13:26 +03:00
stlufred
c547f50dc8 Fixed Chart Click method (#991)
* Fixed chart Click method

- Was not using x and y parameters
- Use the same maximum distance as the tooltip (so that click and tooltip returns the same thing)
- Fixed xDelta and yDelta that were not considering MarginLeft and MarginTop

* Add ClickTolerance and TooltipTolerance.

---------

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-05-30 09:51:49 +03:00
yordanov
952bcecb12 Add text color to AutoComplete input 2023-05-29 17:13:11 +03:00
yordanov
1da97c3cd6 Add variable for text color in RadzenSidebar --rz-sidebar-color 2023-05-29 16:55:29 +03:00
blake-fm
b9abc13364 Loop parameters once during SetParametersAsync (#989)
Down from 6.
2023-05-29 12:18:01 +03:00
Vladimir Enchev
fcd2ffa630 Added support for collection filter in DataGrid column Property/FilterProperty and In/Not operators
Close https://github.com/radzenhq/radzen-blazor/pull/987
2023-05-29 09:44:50 +03:00
Atanas Korchev
1f769bc7b5 RadzenHtmlEditor does not show its value if it is initially hidden. 2023-05-26 17:29:30 +03:00
yordanov
e84a5ad62a RadzenBody should have transparent background if only child in RadzenLayout 2023-05-26 10:57:50 +03:00
yordanov
5a481aeb5e Fix text color in outlined and text RadzenButton variants 2023-05-26 10:54:37 +03:00
yordanov
24cea1d8d2 Update Close button styles in RadzenAlert 2023-05-26 10:31:04 +03:00
Vladimir Enchev
134f368953 Numeric FormattedValue should use specified Culture 2023-05-26 08:53:35 +03:00
yordanov
8a6749e38b Add --rz-panel-menu-padding custom CSS property 2023-05-25 16:05:53 +03:00
yordanov
0722639001 Update CSS classes and variables in layout components 2023-05-25 16:05:53 +03:00
Vladimir Enchev
e372dd8ddf index column removed 2023-05-25 14:30:52 +03:00
Vladimir Enchev
c66022eaa8 code fixed 2023-05-25 14:29:50 +03:00
Vladimir Enchev
3b873fc06c Demos data variables update to IQueryable 2023-05-25 14:28:57 +03:00
Vladimir Enchev
f2ac7cca28 Fixed deleting all text in Numeric leads to no data shown
Fix #974
2023-05-25 10:09:27 +03:00
Vladimir Enchev
d21d909de6 DropDown/DropDownDataGrid trailing separator removed 2023-05-25 08:36:17 +03:00
Dave Bagler
7c476ec104 Dialog wrapper class option. (#985)
* Adding WrapperCSSClass parameter to the dialog service.

* Updating container rendering and adding demo.
2023-05-25 08:11:47 +03:00
Atanas Korchev
3716772a06 Tooltip is always visible in Pie and Donut series. 2023-05-24 19:01:03 +03:00
Vladimir Enchev
c1100a5c62 demo reworked 2023-05-23 16:44:23 +03:00
Vladimir Enchev
0ae1332480 Template fixed 2023-05-23 16:30:20 +03:00
Vladimir Enchev
222debc335 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-05-23 16:14:09 +03:00
Vladimir Enchev
7702ac5475 Version updated 2023-05-23 16:13:56 +03:00
stlufred
b4f4b10332 Improved chart tooltips (#976)
* Improved chart tooltips

- Show closest tooltip in line chart (instead of the first close enough)
- Improved speed
- Show it over or under to greatly reduce chances of tooltip being offscreen

* Moved caching into the Category method

* Reset categoryPropertyCache in SetParametersAsync.

* Revert tooltips to always show above

* Update _chart.scss

---------

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-05-23 16:05:54 +03:00
Vladimir Enchev
fb795a22c8 DataGrid support for In/NotIn filter operators added for OData 2023-05-23 14:33:57 +03:00
Vladimir Enchev
e5a4af88cc DataGrid support for In/NoIn filter operators added for IQueryable (#983)
* In and NotIt filter operators added

* FilterOperator fixed

* demo updated
2023-05-22 16:57:04 +03:00
yordanov
f68508a9ef Update colors in Card demo 2023-05-22 09:24:27 +03:00
yordanov
1e4adf115c Update EventConsole colors 2023-05-22 09:24:27 +03:00
yordanov
dbc8a2b7b2 Update Colors page layout 2023-05-22 09:24:27 +03:00
yordanov
f339bfe45d Add theming variable for chart marker stroke color 2023-05-22 09:24:27 +03:00
yordanov
a78b88c2a4 Update theme variables in RadzenPanelMenu 2023-05-22 09:24:27 +03:00
yordanov
4a338ad94e Update theme variables in RadzenNotification 2023-05-22 09:24:27 +03:00
yordanov
03d0e38f15 Update theme variables in RadzenUpload 2023-05-22 09:24:27 +03:00
yordanov
7da16b469c Update theme variables in RadzenAlert 2023-05-22 09:24:27 +03:00
Dave Bagler
c80fcc5494 Change DatePicker icon based on TimeOnly parameter. (#979)
* changing the icon to schedule when time only.

* added tests for the two icons
2023-05-19 16:44:44 +03:00
Vladimir Enchev
0286396175 missing host file added 2023-05-19 15:07:46 +03:00
Atanas Korchev
edf381c914 Address issues introduced by .NET 7.0.302. 2023-05-19 11:55:03 +03:00
Vladimir Enchev
58d85518f0 Version updated 2023-05-16 13:31:28 +03:00
Vladimir Enchev
32e8ebf4f8 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-05-16 13:30:55 +03:00
Vladimir Enchev
c8cba6ba91 Fixed DropDownDataGrid exception with multiple selection and filtering 2023-05-16 13:30:44 +03:00
AndrzejKl
fba5487231 Added CustomValidator component (source and Demo) (#968)
* Added CustomValidator component (source and Demo)

* ValidateNewEmail property as a Task

* Revert "ValidateNewEmail property as a Task"

This reverts commit 25640e45e5.

* Renaming property name from 'CheckIsValid' to 'IsValid'

* fixed typo on demo page

* Mark as new.

* Change the API to use Func<bool>

---------

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-05-16 13:30:08 +03:00
Vladimir Enchev
9d81fbcbcb Update radiobuttonlist.md 2023-05-16 09:42:23 +03:00
Vladimir Enchev
40c55b3515 DataGrid will go to previews page on reload if needed 2023-05-16 08:08:13 +03:00
Vladimir Enchev
e5aaaff32e Version updated 2023-05-15 11:39:49 +03:00
Vladimir Enchev
6071b138f0 Added support for HTML in RadzenDataGrid.PagingSummaryFormat 2023-05-15 11:06:00 +03:00
Atanas Korchev
71174f5d40 Improve the side dialog demo. 2023-05-15 09:28:41 +03:00
Cosmatevs
bb4ca4ff9e Dialog: fix width and height css style of side dialogs (missing semicolons) (#975) 2023-05-12 09:19:00 +03:00
Atanas Korchev
93f42e9a67 Stacked series throw exception when the data is empty. 2023-05-11 19:10:48 +03:00
yordanov
2b6c1ec771 Add --rz-on-[color] css variables for text colors 2023-05-10 16:45:05 +03:00
Cosmatevs
958546fd0c DatePicker: simplify 'ToggleAmPm' function, handle AM/PM formatted hour input consistently, fix possible out-of-range values of hour/minutes/seconds on input (#971) 2023-05-10 08:54:54 +03:00
sobaka06243
d263494229 methods ClearFilter and ApplyFilter changed from internal to public (#970)
* method GetFilterOperatorText() changed from internal to public

* methods ClearFilter and ApplyFilter changed from internal to public

---------

Co-authored-by: Ivan Kiselev <ivan.kiselev1999@outlook.com>
2023-05-09 10:15:58 +03:00
Vladimir Enchev
12d51318a8 copyrights added to themes 2023-05-09 10:15:08 +03:00
Vladimir Enchev
aa8861643f themes updated 2023-05-09 10:11:27 +03:00
Vladimir Enchev
0f0e4e35ce Version updated 2023-05-09 08:57:18 +03:00
Atanas Korchev
79f63a794d Document RadzenHtmlEditorSource. Closes #936. 2023-05-09 08:10:43 +03:00
Atanas Korchev
47e01dadb7 Implement UploadError event callback. Closes #775. 2023-05-09 08:10:43 +03:00
johanpolak
3bfa2bd9e4 Use method to get classes for RadzenStepsItem (#966)
* Use method to get classes for RadzenStepsItem

* Revert remove method

---------

Co-authored-by: Johan Polak | Camas IT bv <johanpolak@camasit.nl>
2023-05-09 07:15:08 +03:00
pigwing
b1aac49824 fix pageSize change datagrid not reload work (#962)
* fix ProgressBar template display error

* @see f5b7ddcf0e
PageSize changed should invoke Reload() only when needed
here if pageSize = value;
base.OnPageSizeChanged(value); await InvokeAsync(Reload);  will always false

* modify the method call order
2023-05-09 07:14:01 +03:00
sobaka06243
16fdfa3cb1 method GetFilterOperatorText() changed from internal to public (#969)
Co-authored-by: Ivan Kiselev <ivan.kiselev1999@outlook.com>
2023-05-09 07:13:19 +03:00
Atanas Korchev
9c43badbfc Remove warnings from FormComponent and RadzenAlert. 2023-05-08 15:24:05 +03:00
Atanas Korchev
96689b8e67 Remove some warnings by adding documentation or disabling them in the project settings. 2023-05-08 15:10:17 +03:00
Atanas Korchev
95b2a56f80 Add missing </code> 2023-05-08 12:54:53 +03:00
Atanas Korchev
6c33f6ff08 Add notest about nesting dialog, context menu, notification and tooltip. 2023-05-08 12:54:10 +03:00
Atanas Korchev
ab515920de OverflowException in RadzenNumericRangeValidator. 2023-05-08 12:28:44 +03:00
Vasil Yordanov
46fd65f98a Merge pull request #964 from Cosmatevs/radio-button-disabled-fix
Radio Button & Check Box: fix appearance of disabled state
2023-05-08 07:24:37 +03:00
Cosmatevs
e9986c9667 CheckBox: fix appearance of disabled state 2023-05-06 08:23:01 +02:00
Cosmatevs
fec40dd91c RadioButtonListItem: fix appearance of disabled state (to make it look like before the form field update) 2023-05-05 21:45:44 +02:00
Vladimir Enchev
e8bffd8dc6 Using InvariantCulture for filter strings 2023-05-05 15:54:10 +03:00
yordanov
59e6271373 Update logos 2023-05-05 11:06:16 +03:00
Cosmatevs
0dbb0b6e12 Autocomplete, Numeric: display focus state (#960) 2023-05-05 09:01:45 +03:00
Cosmatevs
5d1c166606 Color Picker: reset the color to the initial state when a popup with an 'ok' button was closed by clicking outside (#956) 2023-05-05 08:58:28 +03:00
Vladimir Enchev
366463ac4e Fixed DataGrid with saved settings raises an exception when filtering a column where TValue is float
Fix #961
2023-05-05 08:53:00 +03:00
AlittaSakraf
ed5d4f5fcd Update RadzenDataGridColumn.cs (#955)
Change the SetTitle() method to public.
Why? It's easier for developers because there are fewer properties in the source code, and if you have a common localization process for example:
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            foreach (var col in grd.ColumnsCollection.Where(x => x.Property != null && string.IsNullOrEmpty(x.Title)).ToList())
            {
                col.SetTitle(LocalizationHelper.Localizer( col.Property));        // out localization process
            }
        }
    }
...then all properties can be managed together in the system ("Name" = "Név" ,etc)
(ps:Unfortonatelly the "Title" property is not good, bevaous of "Component parameter should not be set outside of its component")
2023-05-05 08:42:43 +03:00
CoderJason123
787bc2243f add await on async call to OnFilter (#959)
When a filter is applied along with other properties, the lack of await might be causing something to fire out of order, losing the settings of the filter.
2023-05-05 08:41:52 +03:00
Vladimir Enchev
8b5fccdd0d Version updated 2023-05-04 15:51:41 +03:00
Vladimir Enchev
fa79467c19 Login component ShowLoginButton property added 2023-05-04 15:51:34 +03:00
trueMeon
5a4577b7ec [RadzenDatePicker] Renamed AbbreviatedDayNames to ShiftedAbbreviatedDayNames and fixed to react on the Culture property changes (#953) 2023-05-04 15:07:53 +03:00
AlittaSakraf
0c82c60c03 Update RadzenDataGridColumn.cs (#952)
This method has only one reference, in the RadzenDataGrid.razor.cs. 
It has to change the ordering of the column based on the parameter.
So, checking the SortOrder value by GetSortOrder() isn't good, because it is the "past". The "order" value is the right SortOrder value.
See: https://forum.radzen.com/t/radzendatagrid-and-default-sortorder-and-datagridsettings-bug/13938
2023-05-04 15:03:47 +03:00
Vladimir Enchev
84e33ec18a RadzenDataGridColumn ColumnsCollection property added 2023-05-04 14:59:20 +03:00
AndrzejKl
779be53910 Exposed SearchText property and added Action SearchTextChanged (#951)
* Exposed SearchText property and added Action SearchTextChanged

* Added StateHasChanged to refresh component

* Visual cosmetics on Demo page
2023-05-04 08:44:48 +03:00
GodzSky
cda6e3c204 Make DataGridColumn GetOrderIndex method from internal to public. (#949)
So can access 'orderIndex' variable, in case of discrepancy compared to OrderIndex

Co-authored-by: Elyes Ghoul <elyes.ghoul@bluenext.it>
2023-05-03 08:40:47 +03:00
Vladimir Enchev
c73aee1633 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-05-02 11:24:55 +03:00
Vladimir Enchev
d486b8b4cf Date filter in advanced mode doesn't use "ShowTimeForDateTimeFilter()"
Fix #948
2023-05-02 11:24:46 +03:00
yordanov
31909ba17b Fix typos 2023-05-02 11:19:03 +03:00
Vladimir Enchev
27dc30ca57 Version updated 2023-05-02 10:01:23 +03:00
Vladimir Enchev
f5b7ddcf0e PageSize changed should invoke Reload() only when needed 2023-05-02 09:53:18 +03:00
Vladimir Enchev
f1aac3e9e2 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-05-02 09:49:11 +03:00
Vladimir Enchev
0f626dada2 Clear filters on collapse 2023-05-02 09:49:00 +03:00
yordanov
74f4c74f47 Revert "Update banner"
This reverts commit 167030c15c.
2023-05-02 09:29:20 +03:00
GodzSky
3e93ab0fac fix (#942)
Co-authored-by: Elyes Ghoul <elyes.ghoul@bluenext.it>
2023-05-02 09:27:07 +03:00
Cosmatevs
4ac4ec58a8 Color Picker: HSV picker base color fix + alpha resetting fix (#946)
* Color Picker: Fix HSV saturation picker base color

* Color Picker: Make initial RGB and HSV consistent

* Color Picker: Get rid of inconsistent HSV property and always use handlers instead; fix alpha resetting or wrong shown value when changing HEX or choosing a predefined color

---------

Co-authored-by: Nopke <anopke@gmail.com>
2023-05-01 15:24:21 +03:00
Vladimir Enchev
af552414ac ContextMenu will not work properly when custom id attribute is set 2023-04-28 13:31:14 +03:00
yordanov
728d7c5d24 Improve design of CheckBox checked state in Standard theme. Resolves #940 2023-04-28 08:40:24 +03:00
yordanov
ee17b54872 Fix padding class name in Spacing demo 2023-04-28 08:06:26 +03:00
Vladimir Enchev
373a557ad2 DataGrid IsRowExpanded() method added 2023-04-27 15:36:33 +03:00
Vladimir Enchev
062eeb8ac0 Version updated 2023-04-27 10:37:05 +03:00
Vladimir Enchev
473a7fc647 RadzenDataGridColumn.GetStyle() made virtual
Fix #937
2023-04-27 10:36:22 +03:00
Vladimir Enchev
4ddd9dd874 DropDownBase FilterAsYouType property added 2023-04-25 14:51:56 +03:00
Vladimir Enchev
05dd048410 Fixed escape dialog close doesn't work with sequential dialogs
Fix #932
2023-04-25 09:42:19 +03:00
Vladimir Enchev
c2c4afa094 Update _paginator.scss 2023-04-21 11:50:48 +03:00
Jason Finch
be2567f478 docs: Add note about pre-requirements when using certain controls (#933) 2023-04-21 11:20:06 +03:00
Vladimir Enchev
e9e9c9f702 EscapeTabIndex renamed to CloseTabIndex 2023-04-21 11:14:53 +03:00
DanRogers99
1e3d653d1c Add support for setting tab index for escape button in dialogs (#915) 2023-04-21 11:13:09 +03:00
Vladimir Enchev
63f3f3899e Fixed MouseEnter event doesn't work on RadzenText
Fix #934
2023-04-21 11:08:54 +03:00
Vladimir Enchev
08362d1bb6 Version updated 2023-04-20 16:15:20 +03:00
Vladimir Enchev
f1d3d78f89 code fixed 2023-04-20 16:14:49 +03:00
Philip Jacobs
5f084b9d7c Fix JSDisconnectedException in RadzenContextMenu.razor.cs (#931)
On page refresh, the SignalR connection is already disrupted resulting in a JSDisconnectedExcepion. This will suppress the error in the console.
2023-04-20 16:11:37 +03:00
Vladimir Enchev
224d694ffa Login FormFieldVariant property added (#930)
* Added form fields for Login component

* Login buttons added to FormField part

* validators added

* RadzenSwitch should not be used inside FormField

* Login form field demo added
2023-04-20 12:05:40 +03:00
yordanov
1be4b06d33 Add optional .rz-scrollbars css class 2023-04-20 10:39:56 +03:00
Vladimir Enchev
155c3a4b50 RadzenCheckBoxList ReadOnlyProperty and DisabledProperty example added 2023-04-20 09:22:06 +03:00
Vladimir Enchev
371f912c1d CheckBoxListReadOnlyItem example added 2023-04-20 09:17:41 +03:00
johanpolak
41c47fbc58 Add ReadOnly property to CheckBoxList and CheckBoxListItem (#928)
* Add ReadOnly property to CheckBoxList and CheckBoxListItem

* Set tabindex for CheckBox to -1 if ReadOnly

* Add disabled and read-only property for checkboxlist populated from data

---------

Co-authored-by: Johan Polak | Camas IT bv <JohanPolak@camasit.nl>
2023-04-20 09:12:53 +03:00
yordanov
167030c15c Update banner 2023-04-19 08:52:27 +03:00
Vladimir Enchev
7403a07614 themes updated 2023-04-18 15:13:00 +03:00
Vladimir Enchev
fd0bad9a91 Version updated 2023-04-18 12:08:03 +03:00
yordanov
c2381ac3f5 Rename RadzenFormField class file 2023-04-18 11:45:57 +03:00
yordanov
ee18fbac19 Fix typo 2023-04-18 11:36:45 +03:00
yordanov
b83ec99e4f Update FormField rendering and styles 2023-04-18 11:16:38 +03:00
Vladimir Enchev
72bd03d368 code improved 2023-04-18 09:45:34 +03:00
Vladimir Enchev
a6ee68efe8 Dialog focus trap added
Fix #923
2023-04-18 09:38:14 +03:00
Vladimir Enchev
795ca64ac0 CheckBox ReadOnly property added
Based on https://github.com/radzenhq/radzen-blazor/pull/924. Close #https://github.com/radzenhq/radzen-blazor/pull/924/
2023-04-18 09:09:33 +03:00
Daniel Chalmers
ee26df3b68 Update README.md (#922) 2023-04-18 07:13:24 +03:00
Atanas Korchev
bc0cf84297 Show the correct stack bar source 2023-04-17 17:31:45 +03:00
sobaka06243
049f846980 Close all context menus on dispose (#920)
Co-authored-by: Ivan Kiselev <ivan.kiselev1999@outlook.com>
2023-04-17 09:31:07 +03:00
Jason Finch
67308b8e3a docs: Describe what Frozen=true does. (#919)
Co-authored-by: Jason Finch <jason.finch@epw.qld.gov.au>
2023-04-17 08:25:59 +03:00
Atanas Korchev
8c9cdb28d0 Pager dropdown items are numbers. 2023-04-14 10:03:13 +03:00
yordanov
dd30b30b34 Fix wrong source code for FormField helper text example 2023-04-13 22:09:03 +03:00
yordanov
6446097840 Fix border radius of ColorPicker value 2023-04-13 15:39:18 +03:00
Atanas Korchev
589cf2afd8 Bump up the version. 2023-04-12 15:46:18 +03:00
Atanas Korchev
fb1928d5ec Update premium themes. 2023-04-12 15:37:08 +03:00
Atanas Korchev
552b41f855 Update version. 2023-04-12 15:20:18 +03:00
Vasil Yordanov
e2a036192a Form field component (#913)
* RadzenFormField WIP.

* Add empty state class.

* Add more input components. Set placeholder so it can be used from CSS.

* Add blank input styles

* Update initial form field styles

* Update form field label position

* Add ellipsis to form field label

* Position form field label in different themes

* Fix form field hover and focus shadows

* Remove redundant blank input styles

* Fix form field start/end padding in material theme

* Update form field css variables

* Add helper placeholder under form field

* Fix vertical align

* Password uses CurrentPlaceholder.

* Support disabled state.

* Add Variant property to FormField

* Update FormField demo

* Fix hover in filled text field and bg colors in dark themes

* Use --rz-border-width instead of hardcoded pixel values

* Fix textarea top margin in filled and flat form fields

* Fix states of datepicker and textarea in a form field

* Style disabled form fields

* Fix focused disabled state

* Style should be applied to form field wrapper

* Update form field demos

* Fix helper padding in text form field

* Add more form field examples

* Update FormField demo

* Add for mfield validation example

* Update disabled form field example

* Toggle password visibility.

* Update form field examples

* Update form field helper example

* Add XML API reference.

* Update content in form field examples

---------

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-04-12 15:09:14 +03:00
Atanas Korchev
b6c5f670b3 Set the target to _top to prevent the Blazor router from navigating. 2023-04-12 13:53:02 +03:00
Atanas Korchev
ecac1c5b78 Use the Anchor property in the demos. 2023-04-12 13:29:51 +03:00
Atanas Korchev
1d3f124845 RadzenText can create anchors. 2023-04-12 13:06:12 +03:00
Evan Dixon
d0b39df3e2 Add ability to customize OData string by column (#908)
Co-authored-by: Dixon, Evan <edixon@mimeo.com>
2023-04-11 08:50:19 +03:00
Atanas Korchev
beb52670fa Add UploadUrl to the editor demo. 2023-04-07 14:13:49 +03:00
Vladimir Enchev
c924407569 ContextMenu separator example added 2023-04-05 10:39:34 +03:00
Vladimir Enchev
bb72002452 Version updated 2023-04-04 09:48:43 +03:00
Vladimir Enchev
78f045ddf2 DataList IsLoading added
Close https://github.com/radzenhq/radzen-blazor/pull/895
2023-04-04 09:48:12 +03:00
yordanov
ba49220e43 Update Switch demo 2023-04-03 19:04:55 +03:00
yordanov
857bceba76 Update layout in TemplateForm example 2023-04-03 18:00:24 +03:00
Vladimir Enchev
859280c2d7 Tree item label click should check the CheckBox 2023-04-03 16:56:04 +03:00
SGeorgeFramatome
e8ac5dbe8d Panel menu item click (#897)
* Add files via upload

Add Click event, as per RadzenMenu implementation

* Add files via upload

Alter example to show Click event on child
2023-04-03 16:31:46 +03:00
msdevcode
86ec75b05e RadzenAutoComplete - Close Popup if value is smaller than MinLength (#896) 2023-04-03 16:27:07 +03:00
yordanov
6b00fdb19e Update content in Dialog examples 2023-04-03 13:53:05 +03:00
msdevcode
b9707ea486 RadzenContextMenu Icon property added (#893) 2023-03-31 10:43:46 +03:00
sobaka06243
f9dd71c05a Close all tooltips on dispose (#894)
Co-authored-by: Ivan Kiselev <ivan.kiselev1999@outlook.com>
2023-03-31 10:43:08 +03:00
Paul Ruston
0720a9b8f0 Scheduler changes - Better handling of Yearview clicks and overridable MoreText event (#874)
* React to clicks in YearView better and create SelectMore Event to override default code.

* Remove unused method

* Revert "Remove unused method"

This reverts commit 646542c7bf.

* Revert "React to clicks in YearView better and create SelectMore Event to override default code."

This reverts commit 0f7bab5300.

* Scheduler DaySelect event. Also cleaned up some code (removed nested if...else...)

* Revert "Scheduler DaySelect event. Also cleaned up some code (removed nested if...else...)"

This reverts commit 1d15a8fa06.

* Extend SlotSelect to pass Appointments. Bit of code condense in YearView

* Added original SelectSlot method signature to IScheduler and RadzenScheduler

* Ignore this push

* Revert tabs in MonthView

* Revert "Revert tabs in MonthView"

This reverts commit d65a6ec490.

* Revert "Ignore this push"

This reverts commit 0c5fae70ed.

* Revert "Added original SelectSlot method signature to IScheduler and RadzenScheduler"

This reverts commit 320b353af6.

* Revert "Extend SlotSelect to pass Appointments. Bit of code condense in YearView"

This reverts commit e7cbebedc8.

* Extend SelectSlot to include list of appointments in slot

* Revert "Extend SelectSlot to include list of appointments in slot"

This reverts commit c901ec3b48.

* Implement ability to prevent default action on YearView ListClick. Add MoreSelect and offer same default prevention for Month, Planner and Timeline views. Extend SlotArgs to include list of appointments and current view.

* Do not allow add and edit in Year view.

---------

Co-authored-by: Paul Ruston <paul.ruston@live.co.uk>
Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-03-31 09:11:05 +03:00
Vladimir Enchev
0289733f7f themes updated 2023-03-30 16:55:47 +03:00
Vladimir Enchev
50ed8ad1e5 Version updated 2023-03-30 16:53:19 +03:00
yordanov
a10fabd927 Removed styles that override the appearance of small button in a DataGrid cell 2023-03-30 14:26:35 +03:00
Vladimir Enchev
0dd9fdf7e6 comment added 2023-03-30 12:03:26 +03:00
Vladimir Enchev
ade5f386b6 Numeric custom value convert support added (#889)
* Numeric custom convert value support added

* code reworked
2023-03-30 11:59:56 +03:00
msdevcode
315b135a3b RadzenDataList/RadzenGrid - Add Pager-Density Property (#883)
* DataList/Grid - Add Pager-Density Property

* DataGrid/DataList/Pager - Add Pager-Density tests
2023-03-29 16:32:19 +03:00
James723
bc3d1daf11 Add milliseconds to column filter string for DateTime. (#881)
Co-authored-by: James Turner <james.turner@mlp.com>
2023-03-29 13:46:09 +03:00
yordanov
50d738c7b6 Update sidebar toggle icon CSS classes 2023-03-29 11:06:00 +03:00
serkanaslan34
0a23ac1401 TooltipService Open with Four Position (#880) 2023-03-29 10:22:25 +03:00
Atanas Korchev
9cbfb4ccbe Split the scheduler demo to fix issues with sharing the reference. 2023-03-28 09:31:06 +03:00
Vladimir Enchev
7c1a76d38e Version updated 2023-03-27 16:36:53 +03:00
Johannes Henrich
b501b86656 Removed unnecessary curly brace in Link component (#876) 2023-03-27 16:32:00 +03:00
Vladimir Enchev
f118cff5c0 Version updated 2023-03-27 14:02:38 +03:00
Atanas Korchev
66d7a9e520 RadzenMenuItem, RadzenPanelMenuItem and RadzenProfileMenuItem can have empty string as Path. 2023-03-27 11:52:32 +03:00
msdevcode
a3424ce020 Link/MenuItem/PanelMenuItem/ProfileMenuItem - Add NavLink-Match Property (#873)
* Link/MenuItem/PanelMenuItem/ProfileMenuItem - Add NavLink-Match Property

* RadzenLink - keep the existing formatting
2023-03-27 09:08:46 +03:00
Vladimir Enchev
7cb72b25be Export should use only columns with defined Property 2023-03-24 15:14:26 +02:00
Vladimir Enchev
f3584b02ac Version updated 2023-03-24 09:40:44 +02:00
Vladimir Enchev
f2aaf9cc26 Microsoft.CSharp should be referenced for netstandard2.1 only 2023-03-24 09:29:31 +02:00
Vladimir Enchev
ea0bab5bd6 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-03-23 09:23:09 +02:00
Vladimir Enchev
78be6f9839 Version updated 2023-03-23 09:22:52 +02:00
Jason
a7df5c7fac Add datagrid parameter for enabling/disabling column title tooltip. (#869)
Co-authored-by: Jason Vos <jason.p.vos@nasa.gov>
2023-03-23 09:04:17 +02:00
Vladimir Enchev
516a6be98e DataGrid crashes when filter is applied to Decimal? field and loaded from Settings
Fix #871
2023-03-23 09:00:26 +02:00
yordanov
7077e30d94 Fix text align in Menu demo 2023-03-22 11:40:16 +02:00
yordanov
21b4053b8b Change ripple's pseudo-element 2023-03-22 11:30:23 +02:00
Vladimir Enchev
85c634480d Added MarkupString support for RadzenRadioButtonListItem Text and RadzenCheckBoxListItem Text
Fix #866
2023-03-22 10:04:15 +02:00
Atanas Korchev
54eefe2295 The code editor is missing certain changes. 2023-03-22 09:42:55 +02:00
yordanov
b32dbc3ac5 Update ContextMenu demo 2023-03-21 19:14:01 +02:00
yordanov
4a5d089e5d Update Accordion demo 2023-03-21 18:42:34 +02:00
yordanov
22cad5a2ab Update ListBox width in ListBox demos 2023-03-21 18:09:15 +02:00
yordanov
acbebd7102 Update DropDown width in DropDown demos 2023-03-21 18:09:15 +02:00
yordanov
301ae12169 Remove third-level icons 2023-03-21 18:09:15 +02:00
yordanov
f04bdcee69 Update HtmlEditor demos 2023-03-21 18:09:15 +02:00
Vladimir Enchev
d4b78fbf87 demo fixed 2023-03-21 16:39:21 +02:00
Vladimir Enchev
500fbc9190 ColumnWidth set to avoid squashed columns on edit 2023-03-21 10:00:37 +02:00
Vladimir Enchev
420f7e9b4e demo updated 2023-03-20 13:22:57 +02:00
Vladimir Enchev
b273c6083f DataGrid settings not loaded in there is a filtering that leads to empty collection 2023-03-20 13:16:05 +02:00
Vladimir Enchev
8877c705c5 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-03-20 10:03:14 +02:00
Vladimir Enchev
1e30f794fe Version updated 2023-03-20 10:03:03 +02:00
HieronymusBlaze
29ad82db7c coderub: DataGridInLineEditor (#863) 2023-03-20 10:02:03 +02:00
Matias Gonzalo Mena
a9046be00c Added NavLinkMatch property to RadzenMenuItem (#862) 2023-03-20 10:01:39 +02:00
Vladimir Enchev
a70efc95c6 Changing PageSize in DataGrid with bound Settings causes an infinite loop 2023-03-20 09:54:00 +02:00
Atanas Korchev
b4b8774110 RadzenLoging does not post the value of the "Remember me" switch. 2023-03-20 09:07:52 +02:00
Vladimir Enchev
d87e03b0cf DropDownBase support for ICollection<> added 2023-03-17 19:29:22 +02:00
Vladimir Enchev
af07ccb87e demo updated 2023-03-17 18:40:52 +02:00
yordanov
dc43918a77 Update CompareValidator demo 2023-03-17 18:17:12 +02:00
Eric
a04b131394 Updated confirm/alert methods to virtual in the dialog service to allow for mocking in unit tests (#860)
Co-authored-by: Eric Barke <ebarke@silvergate.com>
2023-03-17 10:34:04 +02:00
Atanas Korchev
874f18fa6a Setting the font size or font does not work in HtmlEditor. 2023-03-17 09:20:50 +02:00
Vladimir Enchev
fdc93e5130 Version updated 2023-03-16 10:00:17 +02:00
Atanas Korchev
6109e18fe6 The HtmlEditor view source button submits the parent form. Fixes #859. 2023-03-15 16:07:36 +02:00
Scott
27aca28523 Change RadzenComponent.Element setter to protected internal (#858)
* Change RadzenComponent.Element setter to protected

Changing this setter allows custom components inheriting the RadzenComponent class to reference the html element in @ref tags.

* Changing to protected internal to resolve compile issues.
2023-03-15 09:42:36 +02:00
yordanov
2ac4aacee5 Remove duplicated common styles 2023-03-14 13:46:10 +02:00
yordanov
824a741634 rz-helper-hidden-accessible should not use overflow hidden 2023-03-14 13:45:37 +02:00
Vladimir Enchev
819722e7da Version updated 2023-03-14 09:39:44 +02:00
Vladimir Enchev
959d442690 Check for enum before other types 2023-03-14 09:33:47 +02:00
mderoo
b20868328f Update RadzenDataGridColumn.cs (#856)
Setting the grid settings to null causes the selected column count to display a wrong number.
https://forum.radzen.com/t/radzen-datagrid-settings/13408
2023-03-14 09:31:13 +02:00
Vladimir Enchev
679c729985 Nullable enum check added 2023-03-13 17:24:25 +02:00
Vladimir Enchev
bc2ca273a5 Version updated 2023-03-13 10:57:08 +02:00
Vladimir Enchev
8a2612878d Fixed OData enum filter value should use single quotes 2023-03-13 10:51:57 +02:00
Vladimir Enchev
dd76d149ee Fixed DataGrid Query.OrderBy not populated with initial column sorting 2023-03-13 10:43:59 +02:00
Vladimir Enchev
2770d0fbec Dialog cannot be moved horizontally with CultureInfo "de-DE"
Fix #854
2023-03-13 10:18:30 +02:00
Vladimir Enchev
55b2c1e186 Fixed DataGrid column title not updated when changed runtime 2023-03-13 10:16:12 +02:00
Vladimir Enchev
c4c291056b DataGrid state will be updated after frozen column resize. 2023-03-13 10:02:59 +02:00
Vladimir Enchev
b80b81ada6 DataGrid will save in Settings only columns with defined Property 2023-03-13 08:59:45 +02:00
Vladimir Enchev
a0f3d44832 Fixed Tree parent item should not be part of CheckedValues if at least one child is unchecked
Fix #780
2023-03-09 17:00:29 +02:00
Vladimir Enchev
d9e4c00ccf themes updated 2023-03-09 11:07:02 +02:00
Vladimir Enchev
c34a186eaf version updated 2023-03-09 11:01:18 +02:00
Atanas Korchev
be27c930d3 Update legend title. 2023-03-08 18:49:27 +02:00
Atanas Korchev
66818872c2 Add required validator with dropdown example. 2023-03-08 18:47:06 +02:00
Khaled Sliman
cc1ac368b3 Created RadzenDataGridCustomHeader (#849)
* Created RadzenDataGridCustomHeader
Created DataGridCustomHeaderPage.razor
Created DataGridCustomHaderWithColumnPickerPageSamples
Update RadzenDataGrid.razor to display the render fragment for RadzenDataGridCustomHeader if it is not empty
Updated the ExampleService to have the menu options for RadzenDataGridCustomHeader

* Removed RadzenDataGridCustomHeader.razor as it was not needed per code review
Updated RadzenDataGrid to have HeaderTemplate property
Updated Demo pages for the grid to use the new property

---------

Co-authored-by: Khaled A Sliman <Khaled.Ah.Sliman>
2023-03-08 16:26:25 +02:00
cvanstone
03e22098ca Update OrderIndex for all Columns (#851)
Co-authored-by: Chris Vanstone <chris.vanstone@blugem.com>
2023-03-08 15:33:21 +02:00
Vladimir Enchev
724b5eb1e0 demo code fixed 2023-03-07 15:00:57 +02:00
Vladimir Enchev
45a1ce4b55 Version updated 2023-03-07 11:22:21 +02:00
Atanas Korchev
3e5cb2e30b Persist changes in the code editor. 2023-03-07 10:55:11 +02:00
yordanov
d0a4c6aaf1 Improve Button focus state 2023-03-07 10:44:19 +02:00
John Gold Inc
be4bcb7390 Add Density Parameter to DropDownDataGrid (#848)
Co-authored-by: John Gold <john.gold@haulerhub.com>
2023-03-07 08:54:07 +02:00
Vladimir Enchev
a63c3aa4c2 Fixed ContextMenu click event 2023-03-07 08:50:43 +02:00
yordanov
e8e43d97f2 Update ColorPicker demo 2023-03-06 16:49:28 +02:00
yordanov
9939ff4452 Fix ColorPicker disabled state. Resolves #803 2023-03-06 15:32:02 +02:00
Vladimir Enchev
b69bbc899e ColumnWidth and resizing enabled 2023-03-06 15:29:05 +02:00
Vladimir Enchev
f0cba24cc7 demo fixed 2023-03-06 15:07:53 +02:00
Vladimir Enchev
fd5fa0e798 attempt to fix online demo 2023-03-06 14:41:47 +02:00
yordanov
1ba1d53884 Remove LoginConfig page 2023-03-06 12:29:15 +02:00
yordanov
00a118b901 Update Login demo 2023-03-06 12:27:57 +02:00
Vladimir Enchev
ba2ea55884 demo fixed 2023-03-06 10:34:28 +02:00
Vladimir Enchev
70b4c3dd0f Version updated 2023-03-06 10:30:26 +02:00
Vladimir Enchev
412e19252c Demo updated with row index 2023-03-06 10:29:10 +02:00
Paul Ruston
73e1974583 Addition of a Source View for Html Editor (#838)
* Creation of a Source View for Html Editor

* Updated changes #1 as per conversations

* Make the view source tool last. Use the private mode field to track the state as parameters should not do that. View Source should blur the editor in order to update its state when switching modes. Simplify the CSS.

* Change GetMode() access to Public

* Add comment for GetMode() method

---------

Co-authored-by: Paul Ruston <paul.ruston@live.co.uk>
Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-03-06 09:07:30 +02:00
Vladimir Enchev
25c57d645b .rz-navigation-item-link added to checks 2023-03-03 11:46:00 +02:00
Vladimir Enchev
a6c6021923 version updated 2023-03-03 11:32:27 +02:00
Vladimir Enchev
2886ac9d7c DataGrid should not reset settings on Reset() if using LoadData 2023-03-03 11:32:02 +02:00
Vladimir Enchev
c121414767 Numeric demo source code fixed 2023-03-03 09:58:58 +02:00
Conduci
35f02ef7a9 Added SelectView(ISchedulerView) to RadzenScheduler which allows consumers to programatically change the selected view (#842) 2023-03-02 18:36:10 +02:00
Vladimir Enchev
ffeb972a82 demo improved 2023-03-02 17:15:08 +02:00
Vladimir Enchev
f20a74674f demo code improved 2023-03-02 16:50:51 +02:00
Vladimir Enchev
03396fbbe2 Fixed error with Tooltip and navigating to a page with a different layout 2023-03-02 16:36:24 +02:00
Vladimir Enchev
54a5c0805e demo fixed 2023-03-02 11:39:54 +02:00
Vladimir Enchev
486cb66b6c SplitButton demo updated 2023-03-02 10:28:31 +02:00
Vladimir Enchev
e5d7a344c7 Fixed SplitButton disabled state when Busy 2023-03-02 10:00:00 +02:00
Vladimir Enchev
60fe0ed25f SplitButton demos updated 2023-03-02 09:56:22 +02:00
Vladimir Enchev
04741c702a Version updated 2023-03-02 09:35:51 +02:00
Vladimir Enchev
6e190fe903 SplitButton demo updated 2023-03-02 09:33:54 +02:00
yordanov
5bb3e65eb9 Add Density property to RadzenPager 2023-03-02 08:23:20 +02:00
yordanov
c3b29ffcd1 Fix text align in ListBox 2023-03-01 17:33:14 +02:00
yordanov
a889c3e97b Document text wrap css classes 2023-03-01 17:17:59 +02:00
Vladimir Enchev
bd578ca7cd SplitButton IsBusy property added
Fix #802
2023-03-01 15:33:36 +02:00
Atanas Korchev
2a9a115c31 Stacked bar and column charts (#837)
* Initial stack column series.

* Better maximum. Rounded corners only on the last series.

* Tooltips.

* Fix the offset of the first series.

* Actually make it correct.

* Optimizations.

* Update the demo.

* Add stacked bar files.

* Stacked bar tooltip.

* Data labels.

* Update the headings.
2023-03-01 13:54:33 +02:00
Vladimir Enchev
4d1848a5e1 demo code fixed
Fix #836
2023-03-01 11:54:04 +02:00
Vladimir Enchev
4bd8f777e0 Dialog demo updated 2023-03-01 10:21:18 +02:00
yordanov
4654a9011b Fix text align of DropDown value 2023-02-28 18:12:01 +02:00
yordanov
22a5dc148a Fix white-space after RadzenLink 2023-02-28 17:25:48 +02:00
yordanov
88dc4c0607 Radzen link text should inherit vertical alignment from parent 2023-02-28 17:25:11 +02:00
yordanov
0a7c47fa70 Remove obsolete chart styles 2023-02-28 16:41:19 +02:00
yordanov
e6f311ebba Update code tag styles 2023-02-28 11:58:30 +02:00
yordanov
88d09f0fef Add Chart demos for Series, Axis, Legend, and Tooltip 2023-02-28 11:58:30 +02:00
Zak Kohler
7467d87e36 Allow for zero width stroke (#834) 2023-02-28 08:37:16 +02:00
yordanov
b50e793a9c Fix wrapping of badges 2023-02-27 11:12:09 +02:00
yordanov
1147390576 Add social badges to demos homepage and footer 2023-02-27 11:07:12 +02:00
Vladimir Enchev
539785f079 isLoading check added 2023-02-27 11:03:11 +02:00
Vladimir Enchev
b99b516346 demo fixed 2023-02-27 10:41:35 +02:00
Vladimir Enchev
c0dc4f4236 delay removed 2023-02-27 10:29:11 +02:00
Vladimir Enchev
5b8f664530 Version updated 2023-02-27 10:12:39 +02:00
Vladimir Enchev
cc490692ad Revert "Show arrow icon when ChildContent exists (#832)"
This reverts commit 582a9bae31.
2023-02-27 10:12:11 +02:00
Vladimir Enchev
5ef415c87d Revert "DataGrid SaveSettings made awaitable"
This reverts commit 95f51ed935.
2023-02-27 10:12:04 +02:00
Vladimir Enchev
ff3c67409d Version updated 2023-02-27 09:49:18 +02:00
Ben Ghaner
582a9bae31 Show arrow icon when ChildContent exists (#832) 2023-02-27 09:14:32 +02:00
Vladimir Enchev
95f51ed935 DataGrid SaveSettings made awaitable
Fix #831
2023-02-27 09:13:37 +02:00
yordanov
0dca22c219 Fix DataGrid frozen-cell hover and selection background colors 2023-02-24 16:25:59 +02:00
yordanov
eaf67e197b Update Area chart demo 2023-02-24 15:50:18 +02:00
Vladimir Enchev
b8db918348 DataGrid save/load settings with LoadData demo fixed
Fix #824
2023-02-24 15:29:35 +02:00
Vladimir Enchev
c865073605 DataGrid KeyProperty added 2023-02-24 14:31:51 +02:00
yordanov
192ccbec25 Update pager demo 2023-02-24 12:35:35 +02:00
yordanov
b8b3b29d01 Update DataFilter demos 2023-02-24 12:06:20 +02:00
yordanov
00ea9a4393 Update DataList demo 2023-02-24 12:06:20 +02:00
Vladimir Enchev
267392d0b7 Fixed Splitter cannot be expanded runtime if Collapsed set to true 2023-02-24 09:37:33 +02:00
Atanas Korchev
e5f041208f SeriesClick event is sometimes not fired when clicking a marker. 2023-02-23 17:58:39 +02:00
Atanas Korchev
82010353c6 Missing ; after clip-path in bar charts. 2023-02-23 17:58:39 +02:00
yordanov
7daf4d1f58 Add Chart to popular components list 2023-02-23 17:25:00 +02:00
Vladimir Enchev
ebb940ee0e DataGrid inline edit demo updated 2023-02-23 16:35:12 +02:00
Dave Bagler
1ce8c98837 Adding an autocomplete type parameter. (#827)
* Adding an autocomplete type parameter.

* Converting the static class to an enum with an extension method.

* undoing some file changes that shouldn't have been included in the last commit
2023-02-23 13:27:29 +02:00
mderoo
257948cbe1 RadzenRequiredValidator firing on duplicate property names (#829)
* Update ValidatorBase.cs

fix for:
https://forum.radzen.com/t/required-validator-issue/13224/3
https://github.com/radzenhq/radzen-blazor/issues/395

* Invert the if.

---------

Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-02-23 11:33:08 +02:00
Vladimir Enchev
8971e0aa1a Fixed DataGrid column visibility out of sync with column picker when Visible changed runtime 2023-02-23 09:46:36 +02:00
Vladimir Enchev
2209b050b0 Version updated 2023-02-23 08:59:44 +02:00
yordanov
b5a876a93e Improve responsiveness of demos homepage layout 2023-02-22 18:58:13 +02:00
Vladimir Enchev
4c64ee24d5 Added RadzenTreeItem support for arbitrary attributes 2023-02-22 18:36:09 +02:00
Vladimir Enchev
1a3376374f Fixed DataFilter error with DateTimeOffset 2023-02-22 15:53:11 +02:00
Vladimir Enchev
ee88560090 Fixed DataGrid is skipping to last page when PageSize option selected greater than data present.
Fix #828
2023-02-22 11:39:10 +02:00
Vladimir Enchev
aae7eba068 MarkupString support added for DialogService Confirm and Alert 2023-02-22 11:21:57 +02:00
Vladimir Enchev
6715bc34d8 SpeechToTextButton demo updated 2023-02-22 10:21:41 +02:00
Vladimir Enchev
55d0ea5e22 obsolete file deleted 2023-02-21 16:22:25 +02:00
Vladimir Enchev
11c692b146 Slider demo updated 2023-02-21 16:21:54 +02:00
Vladimir Enchev
ab47bd2e7b obsolete files deleted 2023-02-21 16:10:20 +02:00
Vladimir Enchev
6dd9933d55 SelectBar demo updated 2023-02-21 16:08:20 +02:00
Vladimir Enchev
d08d398b47 Rating demo updated 2023-02-21 15:26:27 +02:00
Vladimir Enchev
aa3903d8f0 Fixed DataGrid column SecondFilterValue not set correctly when using FilterTemplate
Fix #826
2023-02-21 15:16:05 +02:00
Vladimir Enchev
26f9030cef Fixed RadzenCheckBoxList AllowSelectAll doesn't work when using Data Property
Fix #823
2023-02-21 15:12:49 +02:00
tecxx
0500a10671 add ClearSelection method to RadzenTree (#822)
Co-authored-by: Robert Rostek <robert@rostech.at>
2023-02-21 15:02:31 +02:00
WoodyJ007
c3ae2d3eda Added option to stop auto focus on filter input on DropDownDatagrid. This improves user experience on mobile devices. (#825)
Co-authored-by: John Wood <john.wood@woodstarsoftware.co.uk>
2023-02-21 15:01:27 +02:00
Artur Madjidov
e502c51886 Add parameters for the example texts in RadzenHtmlEditorFormatBlock. (#821) 2023-02-21 12:15:40 +02:00
Vladimir Enchev
063c1aa6c0 Password updated 2023-02-21 11:25:51 +02:00
Vladimir Enchev
5e5db9193e Numeric demo updated 2023-02-21 10:40:46 +02:00
Vladimir Enchev
26a38fc56c RadioButtonList demo updated 2023-02-21 10:10:58 +02:00
Vladimir Enchev
aad0558a9c ListBox demo updated 2023-02-21 09:41:09 +02:00
yordanov
a911f975da Update Column demo 2023-02-20 20:12:04 +02:00
yordanov
a99c8fbc88 Update Image demo 2023-02-20 17:05:07 +02:00
yordanov
79525227a9 Update Gravatar demo 2023-02-20 17:05:07 +02:00
Vladimir Enchev
66b8eb72bf DropDownDataGrid demo updated 2023-02-20 16:39:00 +02:00
yordanov
1eff269b80 Update Tabs demo 2023-02-20 14:27:09 +02:00
Vladimir Enchev
2dc01b528c DropDownCustomObjects updated 2023-02-20 12:56:13 +02:00
Vladimir Enchev
30e200896d DropDownGrouping updated 2023-02-20 12:47:24 +02:00
Vladimir Enchev
7d2e827e6f DropDownFiltering demo updated 2023-02-20 12:38:35 +02:00
Vladimir Enchev
94e6b3086b DropDownVirtualization demo updated 2023-02-20 12:31:33 +02:00
Vladimir Enchev
0849e90574 DropDown multiple selection demo reworked 2023-02-20 11:10:48 +02:00
Vladimir Enchev
d3eef33371 DropDown single selection demo updated 2023-02-20 10:53:57 +02:00
yordanov
1cee0d10e5 Update Steps demo 2023-02-20 10:43:34 +02:00
Vladimir Enchev
3f044b407a DatePicker demo updated 2023-02-20 10:16:05 +02:00
Vladimir Enchev
b25ce3760b Obsolete demo removed 2023-02-20 09:44:54 +02:00
Vladimir Enchev
6e810761f8 CheckBoxList demo updated 2023-02-20 09:34:13 +02:00
yordanov
6dea80e13e Update PanelMenu demo 2023-02-17 15:36:59 +02:00
yordanov
a715616a6a Update ProfileMenu demo 2023-02-17 15:17:09 +02:00
yordanov
e87db432d5 Update Menu demo 2023-02-17 15:15:12 +02:00
yordanov
0b4b89dcbd Update Link description 2023-02-17 14:48:14 +02:00
yordanov
0e980051e3 Update Link demo 2023-02-17 14:46:35 +02:00
yordanov
4bd489a530 Update breadcrumb template description and remove config page 2023-02-17 14:18:03 +02:00
yordanov
ed02c0dbc1 Update BreadCrumb demo 2023-02-17 14:08:53 +02:00
yordanov
81e2432426 Update texts in Tooltip demo 2023-02-17 14:08:53 +02:00
Vladimir Enchev
3a14099831 Card removed from CheckBox demos 2023-02-17 12:55:51 +02:00
Vladimir Enchev
84712967b0 AutoCompleteConfig removed 2023-02-17 12:54:51 +02:00
yordanov
1fc70b7591 Update AutoComplete demos 2023-02-17 11:39:50 +02:00
Vladimir Enchev
b9f8345964 CheckBox demo reworked 2023-02-17 11:18:21 +02:00
yordanov
fcd9e674d5 Update Tooltip demo 2023-02-17 11:02:40 +02:00
Vladimir Enchev
2cf2dfaea5 AutoComplete reworked 2023-02-17 10:36:39 +02:00
yordanov
797be4e57c Update console log 2023-02-17 09:48:03 +02:00
yordanov
2478f1478f Update ProgressBar demo 2023-02-16 17:11:13 +02:00
Vladimir Enchev
58cd508be4 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-02-16 16:39:31 +02:00
Vladimir Enchev
9ca094f4f8 demo updated 2023-02-16 16:39:21 +02:00
yordanov
9ed9878193 Update Alert demos 2023-02-16 16:39:18 +02:00
Vladimir Enchev
c878a47f92 Save/Load settings demo category added 2023-02-16 16:21:15 +02:00
Vladimir Enchev
42d7a8860a DataGrid Save/Load settings with LoadData demo added 2023-02-16 15:41:20 +02:00
yordanov
718824f359 Revert body translateZ. Animations require a new stacking context under WebKit. 2023-02-16 12:16:12 +02:00
yordanov
3b5b649530 Remove will-change property from rz-body 2023-02-16 11:38:03 +02:00
Vladimir Enchev
8702af0c42 IsBusy added on run 2023-02-16 11:22:28 +02:00
yordanov
b038157f2f Remove rz-body translateZ transform to prevent new stacking context 2023-02-16 10:55:22 +02:00
Vladimir Enchev
0033bdd570 Heading and Documentation removed from all examples 2023-02-16 10:48:45 +02:00
Vladimir Enchev
99b40cac43 Version updated 2023-02-16 09:32:05 +02:00
Vladimir Enchev
7fa91f98c6 Extended Blazor server buffer size 2023-02-16 09:29:41 +02:00
yordanov
a6e3f48044 Update spacing in MainLayout sidebar 2023-02-15 19:00:06 +02:00
Vladimir Enchev
d25921f6c8 Look for inner filter expressions recursive 2023-02-15 18:16:35 +02:00
yordanov
e1986dc8eb Fix spacing in MainLayout 2023-02-15 17:03:30 +02:00
yordanov
ebba5b860f Introduce Radzden Blazor Studio 2023-02-15 16:58:36 +02:00
yordanov
4beff8932e Update Layout demo 2023-02-15 11:55:19 +02:00
yordanov
e26bd9adfb Update panel demo IDs 2023-02-15 11:55:19 +02:00
Vladimir Enchev
2eadc7b5ea code fixed 2023-02-15 10:58:18 +02:00
Vladimir Enchev
a15aeade6a RequiredValidator demo updated 2023-02-15 10:53:29 +02:00
Vladimir Enchev
1990b7fad5 NumericRangeValidator demo updated 2023-02-15 10:52:05 +02:00
Vladimir Enchev
d81d5a37f8 LengthValidator demo updated 2023-02-15 10:51:02 +02:00
Vladimir Enchev
1c1da0b080 EmailValidator demo updated 2023-02-15 10:49:45 +02:00
Vladimir Enchev
4063bce178 CompareValidator demo updated 2023-02-15 10:48:35 +02:00
Vladimir Enchev
b4d33c6472 Tooltip demo updated 2023-02-15 10:46:55 +02:00
Vladimir Enchev
44005c607d AlertStylingConfig demo updated 2023-02-15 10:45:33 +02:00
Vladimir Enchev
c17852a583 Alert demo updated 2023-02-15 10:44:26 +02:00
Vladimir Enchev
f94b22666b Notification demo updated 2023-02-15 10:43:09 +02:00
Vladimir Enchev
3c8c690a79 StylingGaugeConfig updated 2023-02-15 10:40:54 +02:00
Vladimir Enchev
6f416ffe79 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-02-15 10:39:22 +02:00
Vladimir Enchev
e4f8fe9ea2 ArcGauge demo updated 2023-02-15 10:39:14 +02:00
yordanov
003738149e Update Panel info 2023-02-15 10:38:18 +02:00
Vladimir Enchev
6f39223787 StylingChartConfig updated 2023-02-15 10:37:28 +02:00
Vladimir Enchev
06649c2207 ChartInterpolationConfig demo updated 2023-02-15 10:36:02 +02:00
Vladimir Enchev
18f51becd8 ChartTrendsConfig updated 2023-02-15 10:33:11 +02:00
Vladimir Enchev
916792abea PieChartConfig updated 2023-02-15 10:31:26 +02:00
Vladimir Enchev
c8f8e019f6 LineChartConfig updated 2023-02-15 10:30:09 +02:00
Vladimir Enchev
7b6c6bb930 DonutChartConfig updated 2023-02-15 10:28:52 +02:00
Vladimir Enchev
b826993a0d ColumnChartConfig updated 2023-02-15 10:27:36 +02:00
Vladimir Enchev
00385c8e15 BarChart demo updated 2023-02-15 10:26:11 +02:00
Vladimir Enchev
5b982766fb AreaChart demo updated 2023-02-15 10:24:34 +02:00
Vladimir Enchev
be27dfd918 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-02-15 10:22:10 +02:00
Vladimir Enchev
a82089aff3 HtmlEditorCustomTools updated 2023-02-15 10:22:00 +02:00
yordanov
215ba8bfbf Update Panel demo 2023-02-15 10:20:52 +02:00
Vladimir Enchev
7b1e9185f7 HtmlEditor demo updated 2023-02-15 10:20:20 +02:00
Vladimir Enchev
8c756e99c1 Upload demo updated 2023-02-15 10:18:13 +02:00
Vladimir Enchev
d2384e74cd TextBox demo updated 2023-02-15 10:17:03 +02:00
Vladimir Enchev
b2ff2852bd TextArea updated 2023-02-15 10:16:16 +02:00
Vladimir Enchev
3b4505af27 TemplateForm demo fixed 2023-02-15 10:11:42 +02:00
Vladimir Enchev
87eee126e5 Switch demo updated 2023-02-15 10:09:29 +02:00
Vladimir Enchev
6234f04457 SplitButton updated 2023-02-15 10:08:22 +02:00
Vladimir Enchev
c8e808082f SpeechToTextButton demo updated 2023-02-15 10:06:56 +02:00
Vladimir Enchev
b2f2642c82 Slider demo updated 2023-02-15 10:05:52 +02:00
Vladimir Enchev
0f77730011 SelectBar demo updated 2023-02-15 10:04:52 +02:00
Vladimir Enchev
b062d56928 Rating demo updated 2023-02-15 10:03:30 +02:00
Vladimir Enchev
a3f8552b80 RadioButtonList demo updated 2023-02-15 10:02:16 +02:00
Vladimir Enchev
8faf5a81ca Numeric demo updated 2023-02-15 10:01:03 +02:00
Vladimir Enchev
7d7c0ae320 Mask demo updated 2023-02-15 09:59:57 +02:00
Vladimir Enchev
2bd8b71927 ListBox demo updated 2023-02-15 09:58:54 +02:00
Vladimir Enchev
19a323ec77 DropDownDataGrid demo updated 2023-02-15 09:57:19 +02:00
Vladimir Enchev
29ee95165e DatePicker demo updated 2023-02-15 09:55:23 +02:00
Vladimir Enchev
c618a31e44 ColorPicker demo updated 2023-02-15 09:53:07 +02:00
Vladimir Enchev
f972de507f CheckBoxList demo updated 2023-02-15 09:51:45 +02:00
Vladimir Enchev
51a0be31d5 CheckBox demo updated 2023-02-15 09:50:18 +02:00
Vladimir Enchev
d986c12564 AutoComplete demo updated 2023-02-15 09:47:52 +02:00
Vladimir Enchev
1ae17b121e Steps demo updated 2023-02-15 09:41:41 +02:00
Vladimir Enchev
afb294f170 Login demo updated 2023-02-15 09:40:08 +02:00
Vladimir Enchev
2b63fa343a ContextMenu demo updated 2023-02-15 09:38:45 +02:00
Vladimir Enchev
35121f1141 BreadCrumb demo updated 2023-02-15 09:37:37 +02:00
Vladimir Enchev
9d0f26fede Accordion demo updated 2023-02-15 09:36:07 +02:00
Vladimir Enchev
f0289b73b8 Dialog demo updated 2023-02-15 09:34:38 +02:00
Vladimir Enchev
1009619ecd Column demo updated 2023-02-15 09:31:55 +02:00
Vladimir Enchev
f30b1b1e08 Row demo updated 2023-02-15 09:30:09 +02:00
Vladimir Enchev
d151f39a22 Stack demo updated 2023-02-15 09:28:30 +02:00
Vladimir Enchev
be6d4accff Layout demo updated 2023-02-15 09:26:19 +02:00
yordanov
69e71202ee Update Card demo 2023-02-15 09:09:31 +02:00
yordanov
fece284aee Update badge usage demo 2023-02-15 09:09:08 +02:00
yordanov
4bcb44bcb2 Update Badge demo 2023-02-14 20:04:15 +02:00
Paul Ruston
0891dbf5a8 Pie and Donut render errors (#813)
* Pie and Donut render errors

* Take into account negative values. Added property ItemsGreaterZero

* Moved ItemsGreaterZero to RadzenPieSeries

* Rename the property and set it once to avoid multiple allocations.

---------

Co-authored-by: Paul Ruston <paul.ruston@live.co.uk>
Co-authored-by: Atanas Korchev <akorchev@gmail.com>
2023-02-14 18:08:32 +02:00
Vladimir Enchev
b5b5a86025 Splitter demo updated 2023-02-14 16:43:05 +02:00
Vladimir Enchev
3fcbe831d7 Image demo updated 2023-02-14 16:39:52 +02:00
Vladimir Enchev
d253151296 Scheduler demo updated 2023-02-14 16:36:03 +02:00
Vladimir Enchev
4e9beb86b0 DropDown demo updated 2023-02-14 16:31:21 +02:00
Vladimir Enchev
7f85b49f3f DropDownVirtualization updated 2023-02-14 16:29:10 +02:00
Vladimir Enchev
1ea8c56631 DropDownMultiple updated 2023-02-14 16:27:48 +02:00
Vladimir Enchev
5d76cbee26 DropDownGrouping updated 2023-02-14 16:26:38 +02:00
Vladimir Enchev
682e4af619 DropDownFiltering updated 2023-02-14 16:25:32 +02:00
Vladimir Enchev
c446476fbc DropDownCustomObjects updated 2023-02-14 16:23:48 +02:00
Vladimir Enchev
e18a05001e RegexValidator updated 2023-02-14 16:19:51 +02:00
Vladimir Enchev
0685f8b9c0 TreeCheckBoxes updated 2023-02-14 16:16:45 +02:00
Vladimir Enchev
bdd1d4e8c1 TreeDataBinding updated 2023-02-14 16:15:50 +02:00
Vladimir Enchev
bf6923f909 TreeFileSystem demo reworked 2023-02-14 16:14:43 +02:00
Vladimir Enchev
faa37c3322 TreeSelection updated 2023-02-14 15:46:02 +02:00
Vladimir Enchev
1fe5b07f86 Tree demo updated 2023-02-14 15:44:44 +02:00
Vladimir Enchev
7a9ad3933b TemplateForm demo updated 2023-02-14 15:42:07 +02:00
Vladimir Enchev
df2e447362 Tabs demo updated 2023-02-14 15:39:25 +02:00
Vladimir Enchev
b2033f3dcd RadialGauge demo updated 2023-02-14 15:37:00 +02:00
Vladimir Enchev
186bce852d ProgressBar demo updated 2023-02-14 15:34:56 +02:00
Vladimir Enchev
e1494441b0 ProfileMenu demo updated 2023-02-14 15:33:28 +02:00
Vladimir Enchev
1b67c130c7 Password demo updated 2023-02-14 15:31:52 +02:00
yordanov
628b980655 Update Dashboard demo 2023-02-14 12:00:32 +02:00
Vladimir Enchev
0e04a17380 Panel demo updated 2023-02-14 11:53:16 +02:00
Vladimir Enchev
cee1a14ebd PanelMenu demo updated 2023-02-14 11:51:14 +02:00
Vladimir Enchev
3862205053 Pager demo updated 2023-02-14 11:49:35 +02:00
Vladimir Enchev
9696f044a0 Menu demo reworked 2023-02-14 11:46:53 +02:00
Vladimir Enchev
b61a0f2c94 Link demo updated 2023-02-14 11:44:23 +02:00
Vladimir Enchev
afb2e3a8a2 Card demo updated 2023-02-14 11:39:38 +02:00
Vladimir Enchev
65cc0a0ed5 ChartAnnotations updated 2023-02-14 11:37:47 +02:00
Vladimir Enchev
dba6f2ec6a GravatarConfig updated 2023-02-14 11:35:52 +02:00
Vladimir Enchev
b39ea03ba6 FileInputConfig reworked 2023-02-14 11:33:56 +02:00
Vladimir Enchev
528483b905 GoogleMapConfig reworked 2023-02-14 11:32:04 +02:00
Vladimir Enchev
fb7434f1b4 Fieldset demo updated 2023-02-14 11:26:58 +02:00
Vladimir Enchev
a239e6405b FieldsetConfig reworked 2023-02-14 11:25:37 +02:00
Vladimir Enchev
d5c00b81d7 ExportToExcelCsv reworked 2023-02-14 11:23:28 +02:00
Vladimir Enchev
590f6c8c8b CascadingDropDowns reworked 2023-02-14 11:22:05 +02:00
Vladimir Enchev
edf2495a9f DataGridMasterDetail reworked 2023-02-14 11:20:04 +02:00
Vladimir Enchev
ed0a034414 DataGridMasterDetailHierarchy reworked 2023-02-14 11:17:49 +02:00
Vladimir Enchev
3e33e0d0e1 DataGridMasterDetailHierarchyOnDemand reworked 2023-02-14 11:14:53 +02:00
Vladimir Enchev
c9e1c2711e code fixed 2023-02-14 11:11:39 +02:00
Vladimir Enchev
1f0420dc1f DataList page reworked 2023-02-14 10:52:48 +02:00
Vladimir Enchev
f0320c6ff9 DataGridVirtualization reworked 2023-02-14 10:49:29 +02:00
Vladimir Enchev
904eb1364c DataGridVirtualizationLoadData reworked 2023-02-14 10:48:31 +02:00
Vladimir Enchev
e5ef184515 DataGridSort reworked 2023-02-14 10:47:30 +02:00
Vladimir Enchev
2a4111643c DataGridSortApi reworked 2023-02-14 10:46:34 +02:00
Vladimir Enchev
53ffe057b2 DataGridSingleSelection reworked 2023-02-14 10:45:42 +02:00
Vladimir Enchev
b2632e1727 DataGridSimpleFilterWithMenu reworked 2023-02-14 10:44:51 +02:00
Vladimir Enchev
84554d6dea DataGridSimpleFilter reworked 2023-02-14 10:43:57 +02:00
Vladimir Enchev
6fd8f8380b DataGridSelfReferenceHierarchy reworked 2023-02-14 10:43:00 +02:00
Vladimir Enchev
5330929efd DataGridSaveSettings reworked 2023-02-14 10:41:30 +02:00
Vladimir Enchev
c67bc9938c DataGridPerformance reworked 2023-02-14 10:40:40 +02:00
Vladimir Enchev
f41f0e94be DataGridPagerPosition reworked 2023-02-14 10:39:45 +02:00
Vladimir Enchev
74b1c6f4ed DataGridPagerHorizontalAlign reworked 2023-02-14 10:38:51 +02:00
Vladimir Enchev
54d7e20baa DataGridPagerApi reworked 2023-02-14 10:38:02 +02:00
Vladimir Enchev
221d88c52c DataGridOData reworked 2023-02-14 10:37:00 +02:00
Vladimir Enchev
eb3c8050fe DataGridMultipleSort reworked 2023-02-14 10:36:01 +02:00
Vladimir Enchev
fdab854799 DataGridMultipleSelection reworked 2023-02-14 10:34:59 +02:00
Vladimir Enchev
ba32761a0c DataGridLoadData reworked 2023-02-14 10:33:53 +02:00
Vladimir Enchev
6d002838a5 DataGridInLineEdit reworked 2023-02-14 10:32:38 +02:00
Vladimir Enchev
d8f53db387 DataGridGroupingApi reworked 2023-02-14 10:31:15 +02:00
Vladimir Enchev
f15db1637e DataGridGroupHeaderTemplate reworked 2023-02-14 10:29:11 +02:00
Vladimir Enchev
5f98e2fdc5 DataGridGroupFooterTemplate reworked 2023-02-14 10:28:13 +02:00
Vladimir Enchev
603dc9f9c6 DataGridGridLines reworked 2023-02-14 10:27:11 +02:00
Vladimir Enchev
0692079384 DataGridFrozenColumns reworked 2023-02-14 10:24:51 +02:00
Vladimir Enchev
e046cdce45 DataGridFooterTotals reworked 2023-02-14 10:23:48 +02:00
Vladimir Enchev
595419df77 DataGridFilterApi reworked 2023-02-14 10:22:52 +02:00
Vladimir Enchev
1a641afaa8 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-02-14 10:21:37 +02:00
Vladimir Enchev
29c73ae90f DataGridEmpty reworked 2023-02-14 10:21:27 +02:00
yordanov
e055f99f63 Update spacing in UI fundamentals demos 2023-02-14 10:20:52 +02:00
Vladimir Enchev
888d4797d0 DataGridDynamicData reworked 2023-02-14 10:20:04 +02:00
Vladimir Enchev
b95d63e974 DataGridDensity reworked 2023-02-14 10:19:08 +02:00
Vladimir Enchev
195abb59ff DataGridConditionalTemplate reworked 2023-02-14 10:18:07 +02:00
Vladimir Enchev
306ceba474 DataGridCompositeColumns reworked 2023-02-14 10:17:04 +02:00
Vladimir Enchev
2be1476130 DataGridColumnTemplate reworked 2023-02-14 10:16:05 +02:00
Vladimir Enchev
ca80356c27 DataGridColumnResizing reworked 2023-02-14 10:15:03 +02:00
Vladimir Enchev
eed34d9b7d DataGridColumnReoder reworked 2023-02-14 10:14:00 +02:00
Vladimir Enchev
1144ab32b7 DataGridColumnPicking reworked 2023-02-14 10:12:55 +02:00
Vladimir Enchev
0061e609d4 Merge branch 'master' of https://github.com/radzenhq/radzen-blazor 2023-02-14 10:11:32 +02:00
Vladimir Enchev
680b64c98f DataGridColumnFilterTemplate reworked 2023-02-14 10:11:21 +02:00
yordanov
325048efcb Update RadzenText demo 2023-02-14 10:09:59 +02:00
Vladimir Enchev
aedb293d50 DataGridColumnEnumFilter example reworked 2023-02-14 10:09:45 +02:00
Vladimir Enchev
6cdc1943fb DataGrid cell select page reworked 2023-02-14 10:07:25 +02:00
Vladimir Enchev
9ff40875c2 DataGrid cell context menu demo reworked 2023-02-14 10:02:31 +02:00
Vladimir Enchev
3a851d59fe DataGrid advanced filter mode demo reworked 2023-02-14 09:46:50 +02:00
Vladimir Enchev
64de7abada DataFilter page updated 2023-02-14 09:42:31 +02:00
yordanov
6d9feebedd Update ripple demo 2023-02-14 09:15:12 +02:00
yordanov
441658eb7a Update shadows demo 2023-02-14 09:01:36 +02:00
yordanov
01a441a99c Update borders demo 2023-02-14 08:41:40 +02:00
yordanov
1d10141c1d Update icons demo 2023-02-13 19:51:05 +02:00
Vladimir Enchev
952313acee demo updated 2023-02-13 17:04:07 +02:00
Vladimir Enchev
d537b742dc Export demo update to handle sub properties as alias 2023-02-13 16:55:12 +02:00
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
1399 changed files with 69460 additions and 48962 deletions

View File

@@ -19,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Build
run: dotnet build Radzen.Blazor/Radzen.Blazor.csproj
- name: Test

View File

@@ -17,7 +17,7 @@ COPY RadzenBlazorDemos.Host /app/RadzenBlazorDemos.Host
WORKDIR /app
RUN docfx DocFX/docfx.json
FROM mcr.microsoft.com/dotnet/sdk:7.0
FROM mcr.microsoft.com/dotnet/sdk:8.0.400
COPY --from=0 /app/RadzenBlazorDemos.Host /app/RadzenBlazorDemos.Host
COPY --from=0 /app/RadzenBlazorDemos /app/RadzenBlazorDemos

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2018-2022 Radzen Ltd
Copyright (c) 2018-2024 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

103
README.md
View File

@@ -1,45 +1,19 @@
![Radzen Blazor Components](RadzenBlazorDemos/wwwroot/images/radzen-blazor-components.png)
![Radzen Blazor Components](https://raw.githubusercontent.com/radzenhq/radzen-blazor/master/RadzenBlazorDemos/wwwroot/images/radzen-blazor-components.png)
<h1 align="center">
Radzen Blazor Components
</h1>
Radzen Blazor Components
========================
<p align="center">
A set of <strong>70+ free and open source</strong> native Blazor UI controls.
</p>
A set of **90+ free and open source** native Blazor UI controls.
<div align="center">
See Online Demos or Read the Docs
[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>
[![License - MIT](https://img.shields.io/github/license/radzenhq/radzen-blazor?logo=github&style=for-the-badge)](https://github.com/radzenhq/radzen-blazor/blob/master/LICENSE)[![NuGet Downloads](https://img.shields.io/nuget/dt/Radzen.Blazor?color=%232694F9&label=nuget%20downloads&logo=nuget&style=for-the-badge) ](https://www.nuget.org/packages/Radzen.Blazor)![Last Commit](https://img.shields.io/github/last-commit/radzenhq/radzen-blazor?logo=github&style=for-the-badge) [![Github Contributors](https://img.shields.io/github/contributors/radzenhq/radzen-blazor?logo=github&style=for-the-badge) ](https://github.com/radzenhq/radzen-blazor/graphs/contributors)[![Radzen Blazor Components - Online Demos](https://img.shields.io/badge/demos-online-brightgreen?color=%232694F9&logo=blazor&style=for-the-badge) ](https://blazor.radzen.com)[![Radzen Blazor Components - Documentation](https://img.shields.io/badge/docs-online-brightgreen?color=%232694F9&logo=blazor&style=for-the-badge)](https://blazor.radzen.com/docs)
## 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.
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/).
@@ -76,67 +50,8 @@ Our flagship product [Radzen Blazor Studio](https://www.radzen.com/blazor-studio
## Get started with Radzen Blazor Components
### 1. Install
Check the [getting started](https://blazor.radzen.com/getting-started) instructions to start making awesome Blazor applications.
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()
{
}
}
```
## 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.
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,74 @@
using Xunit;
namespace Radzen.Blazor.Tests
{
public class AutoCompleteTests
{
[Fact]
public void AutoComplete_Enum_Converts_To_Attr_Value()
{
// Options
Assert.Equal("off", AutoCompleteType.Off.GetAutoCompleteValue());
Assert.Equal("on", AutoCompleteType.On.GetAutoCompleteValue());
Assert.Equal("name", AutoCompleteType.Name.GetAutoCompleteValue());
Assert.Equal("honorific-prefix", AutoCompleteType.HonorificPrefix.GetAutoCompleteValue());
Assert.Equal("given-name", AutoCompleteType.GivenName.GetAutoCompleteValue());
Assert.Equal("additional-name", AutoCompleteType.AdditionalName.GetAutoCompleteValue());
Assert.Equal("family-name", AutoCompleteType.FamilyName.GetAutoCompleteValue());
Assert.Equal("honorific-suffix", AutoCompleteType.HonorificSuffix.GetAutoCompleteValue());
Assert.Equal("nickname", AutoCompleteType.Nickname.GetAutoCompleteValue());
Assert.Equal("email", AutoCompleteType.Email.GetAutoCompleteValue());
Assert.Equal("username", AutoCompleteType.Username.GetAutoCompleteValue());
Assert.Equal("new-password", AutoCompleteType.NewPassword.GetAutoCompleteValue());
Assert.Equal("current-password", AutoCompleteType.CurrentPassword.GetAutoCompleteValue());
Assert.Equal("one-time-code", AutoCompleteType.OneTimeCode.GetAutoCompleteValue());
Assert.Equal("organization-title", AutoCompleteType.OrganizationTitle.GetAutoCompleteValue());
Assert.Equal("organization", AutoCompleteType.Organization.GetAutoCompleteValue());
Assert.Equal("street-address", AutoCompleteType.StreetAddress.GetAutoCompleteValue());
Assert.Equal("address-line1", AutoCompleteType.AddressLine1.GetAutoCompleteValue());
Assert.Equal("address-line2", AutoCompleteType.AddressLine2.GetAutoCompleteValue());
Assert.Equal("address-line3", AutoCompleteType.AddressLine3.GetAutoCompleteValue());
Assert.Equal("address-level1", AutoCompleteType.AddressLevel1.GetAutoCompleteValue());
Assert.Equal("address-level2", AutoCompleteType.AddressLevel2.GetAutoCompleteValue());
Assert.Equal("address-level3", AutoCompleteType.AddressLevel3.GetAutoCompleteValue());
Assert.Equal("address-level4", AutoCompleteType.AddressLevel4.GetAutoCompleteValue());
Assert.Equal("country", AutoCompleteType.Country.GetAutoCompleteValue());
Assert.Equal("country-name", AutoCompleteType.CountryName.GetAutoCompleteValue());
Assert.Equal("postal-code", AutoCompleteType.PostalCode.GetAutoCompleteValue());
Assert.Equal("cc-name", AutoCompleteType.CcName.GetAutoCompleteValue());
Assert.Equal("cc-given-name", AutoCompleteType.CcGivenName.GetAutoCompleteValue());
Assert.Equal("cc-additional-name", AutoCompleteType.CcAdditionalName.GetAutoCompleteValue());
Assert.Equal("cc-family-name", AutoCompleteType.CcFamilyName.GetAutoCompleteValue());
Assert.Equal("cc-number", AutoCompleteType.CcNumber.GetAutoCompleteValue());
Assert.Equal("cc-exp", AutoCompleteType.CcExp.GetAutoCompleteValue());
Assert.Equal("cc-exp-month", AutoCompleteType.CcExpMonth.GetAutoCompleteValue());
Assert.Equal("cc-exp-year", AutoCompleteType.CcExpYear.GetAutoCompleteValue());
Assert.Equal("cc-csc", AutoCompleteType.CcCsc.GetAutoCompleteValue());
Assert.Equal("cc-type", AutoCompleteType.CcType.GetAutoCompleteValue());
Assert.Equal("transaction-currency", AutoCompleteType.TransactionCurrency.GetAutoCompleteValue());
Assert.Equal("transaction-amount", AutoCompleteType.TransactionAmount.GetAutoCompleteValue());
Assert.Equal("language", AutoCompleteType.Language.GetAutoCompleteValue());
Assert.Equal("bday", AutoCompleteType.Bday.GetAutoCompleteValue());
Assert.Equal("bday-day", AutoCompleteType.BdayDay.GetAutoCompleteValue());
Assert.Equal("bday-month", AutoCompleteType.BdayMonth.GetAutoCompleteValue());
Assert.Equal("bday-year", AutoCompleteType.BdayYear.GetAutoCompleteValue());
Assert.Equal("sex", AutoCompleteType.Sex.GetAutoCompleteValue());
Assert.Equal("tel", AutoCompleteType.Tel.GetAutoCompleteValue());
Assert.Equal("tel-country-code", AutoCompleteType.TelCountryCode.GetAutoCompleteValue());
Assert.Equal("tel-national", AutoCompleteType.TelNational.GetAutoCompleteValue());
Assert.Equal("tel-area-code", AutoCompleteType.TelAreaCode.GetAutoCompleteValue());
Assert.Equal("tel-local", AutoCompleteType.TelLocal.GetAutoCompleteValue());
Assert.Equal("tel-extension", AutoCompleteType.TelExtension.GetAutoCompleteValue());
Assert.Equal("impp", AutoCompleteType.Impp.GetAutoCompleteValue());
Assert.Equal("url", AutoCompleteType.Url.GetAutoCompleteValue());
Assert.Equal("photo", AutoCompleteType.Photo.GetAutoCompleteValue());
// Synonyms
Assert.Equal("address-level1", AutoCompleteType.State.GetAutoCompleteValue());
Assert.Equal("address-level1", AutoCompleteType.Province.GetAutoCompleteValue());
Assert.Equal("postal-code", AutoCompleteType.ZipCode.GetAutoCompleteValue());
Assert.Equal("given-name", AutoCompleteType.FirstName.GetAutoCompleteValue());
Assert.Equal("additional-name", AutoCompleteType.MiddleName.GetAutoCompleteValue());
Assert.Equal("family-name", AutoCompleteType.LastName.GetAutoCompleteValue());
}
}
}

View File

@@ -30,7 +30,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Icon, icon));
Assert.Contains(@$"<i class=""rz-button-icon-left rzi"">{icon}</i>", component.Markup);
Assert.Contains(@$"<i class=""notranslate rz-button-icon-left rzi"">{icon}</i>", component.Markup);
}
[Fact]
@@ -48,7 +48,7 @@ namespace Radzen.Blazor.Tests
);
// does not render the actual icon when busy
Assert.DoesNotContain(@$"<i class=""rz-button-icon-left rzi"">{icon}</i>", component.Markup);
Assert.DoesNotContain(@$"<i class=""notranslate rz-button-icon-left rzi"">{icon}</i>", component.Markup);
// renders the icon with busy spin animation
Assert.Contains(@"<i style=""animation: rotation", component.Markup);
@@ -71,7 +71,7 @@ namespace Radzen.Blazor.Tests
parameters.Add(p => p.Icon, icon);
});
Assert.Contains(@$"<i class=""rz-button-icon-left rzi"">{icon}</i>", component.Markup);
Assert.Contains(@$"<i class=""notranslate rz-button-icon-left rzi"">{icon}</i>", component.Markup);
Assert.Contains(@$"<span class=""rz-button-text"">{text}</span>", component.Markup);
}
@@ -86,7 +86,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Image, image));
Assert.Contains(@$"<img class=""rz-button-icon-left rzi"" src=""{image}"" />", component.Markup);
Assert.Contains(@$"<img class=""notranslate rz-button-icon-left rzi"" src=""{image}"" alt=""button"" />", component.Markup);
}
[Fact]
@@ -103,9 +103,10 @@ namespace Radzen.Blazor.Tests
{
parameters.Add(p => p.Text, text);
parameters.Add(p => p.Image, image);
parameters.Add(p => p.ImageAlternateText, text);
});
Assert.Contains(@$"<img class=""rz-button-icon-left rzi"" src=""{image}"" />", component.Markup);
Assert.Contains(@$"<img class=""notranslate rz-button-icon-left rzi"" src=""{image}"" alt=""{text}"" />", component.Markup);
Assert.Contains(@$"<span class=""rz-button-text"">{text}</span>", component.Markup);
}

View File

@@ -0,0 +1,54 @@
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Bunit;
using Radzen.Blazor.Rendering;
using Xunit;
using Xunit.Abstractions;
namespace Radzen.Blazor.Tests;
public class ChartTests
{
private readonly ITestOutputHelper output;
public ChartTests(ITestOutputHelper output)
{
this.output = output;
}
[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}";
})));
var stopwatch = Stopwatch.StartNew();
foreach (var _ in Enumerable.Range(0, 10))
{
await chart.InvokeAsync(() => chart.Instance.MouseMove(100, 80));
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);
}
output.WriteLine($"Time took: {stopwatch.Elapsed}");
}
}

View File

@@ -160,5 +160,83 @@ namespace Radzen.Blazor.Tests
Assert.Contains(@$"rz-state-active", component.Markup);
Assert.Contains(@$"rzi-times", component.Markup);
}
[Fact]
public void CheckBox_Renders_ReadonlyParameter()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenCheckBox<bool>>();
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.ReadOnly, true));
Assert.Contains(@$"readonly", component.Markup);
}
[Fact]
public void CheckBox_DoesNotRaise_ChangedEvent_ReadonlyParameter()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenCheckBox<bool>>();
var raised = false;
component.SetParametersAndRender(parameters => parameters
.Add<bool>(p => p.ReadOnly, true)
.Add(p => p.Change, args => { raised = true; })
);
component.Find("div.rz-chkbox-box").Click();
Assert.False(raised);
}
[Fact]
public void CheckBox_DoesNotRaise_ValueChangedEvent_ReadonlyParameter()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenCheckBox<bool>>();
var raised = false;
component.SetParametersAndRender(parameters => parameters
.Add<bool>(p => p.ReadOnly, true)
.Add(p => p.ValueChanged, args => { raised = true; })
);
component.Find("div.rz-chkbox-box").Click();
Assert.False(raised);
}
[Fact]
public void CheckBox_ValueNotChanged_ReadonlyParameter()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenCheckBox<bool>>();
var value = true;
component.SetParametersAndRender(parameters => parameters
.Add<bool>(p => p.ReadOnly, true)
.Add<bool>(p => p.Value, value)
);
component.Find("div.rz-chkbox-box").Click();
Assert.Contains(@$"rz-state-active", component.Markup);
component.SetParametersAndRender(parameters => parameters
.Add<bool>(p => p.ReadOnly, !true)
.Add<bool>(p => p.Value, value)
);
component.Find("div.rz-chkbox-box").Click();
Assert.DoesNotContain(@$"rz-state-active", component.Markup);
}
}
}

View File

@@ -20,39 +20,29 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<dynamic>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, new[] { new { Id = 1 }, new { Id = 2 }, new { Id = 3 } });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<dynamic>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.CloseComponent();
});
});
// Main
Assert.Contains(@$"rz-datatable-scrollable-wrapper", component.Markup);
Assert.Contains(@$"rz-datatable-scrollable-view", component.Markup);
Assert.Contains(@$"rz-data-grid", component.Markup);
Assert.Contains(@$"rz-datatable", component.Markup);
Assert.Contains(@$"rz-datatable-scrollable", component.Markup);
// Header
Assert.Contains(@$"rz-datatable-scrollable-header", component.Markup);
Assert.Contains(@$"rz-datatable-scrollable-header-box", component.Markup);
Assert.Contains(@$"rz-datatable-thead", component.Markup);
Assert.Contains(@$"rz-datatable-scrollable-colgroup", component.Markup);
// Data
Assert.Contains(@$"rz-data-grid-data", component.Markup);
//Body
Assert.Contains(@$"rz-datatable-scrollable-body", component.Markup);
Assert.Contains(@$"rz-datatable-scrollable-table-wrapper", component.Markup);
Assert.Contains(@$"rz-datatable-data", component.Markup);
Assert.Contains(@$"rz-datatable-hoverable-rows", component.Markup);
// Footer
Assert.DoesNotContain(@$"rz-datatable-scrollable-footer", component.Markup);
Assert.DoesNotContain(@$"rz-datatable-scrollable-footer-box", component.Markup);
//Columns
Assert.DoesNotContain(@$"rz-sortable-column", component.Markup);
// Table
Assert.Contains(@$"rz-grid-table", component.Markup);
Assert.Contains(@$"rz-grid-table-fixed", component.Markup);
Assert.Contains(@$"rz-grid-table-striped", component.Markup);
}
// Columns tests
@@ -63,12 +53,12 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<dynamic>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, new[] { new { Id = 1 }, new { Id = 2 }, new { Id = 3 } });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<dynamic>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.CloseComponent();
});
@@ -88,12 +78,12 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<dynamic>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, new[] { new { Id = 1 }, new { Id = 2 }, new { Id = 3 } });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<dynamic>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Title", "MyId");
builder.CloseComponent();
});
@@ -103,6 +93,54 @@ namespace Radzen.Blazor.Tests
Assert.Equal("MyId", title.TextContent.Trim());
}
[Fact]
public void DataGrid_Renders_TitleAttribute()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add(p => p.ShowColumnTitleAsTooltip, true);
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, new[] { new { Id = 1 }, new { Id = 2 }, new { Id = 3 } });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Title", "MyId");
builder.CloseComponent();
});
});
var title = component.Find(".rz-column-title");
Assert.Equal("MyId", title.TextContent.Trim());
Assert.Equal("MyId", title.GetAttribute("title"));
}
[Fact]
public void DataGrid_DoesNotRender_TitleAttribute()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add(p => p.ShowColumnTitleAsTooltip, false);
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, new[] { new { Id = 1 }, new { Id = 2 }, new { Id = 3 } });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Title", "MyId");
builder.CloseComponent();
});
});
var title = component.Find(".rz-column-title");
Assert.Equal("MyId", title.TextContent.Trim());
Assert.Null(title.GetAttribute("title"));
}
[Fact]
public void DataGrid_Renders_AllowSortingParameter()
{
@@ -110,12 +148,12 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<dynamic>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, new[] { new { Id = 1 }, new { Id = 2 }, new { Id = 3 } });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<dynamic>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
@@ -140,12 +178,12 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<dynamic>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, new[] { new { Id = 1 }, new { Id = 2 }, new { Id = 3 } });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<dynamic>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.AddAttribute(3, "Sortable", false);
@@ -164,12 +202,12 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<dynamic>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, new[] { new { Id = 1 }, new { Id = 2 }, new { Id = 3 } });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<dynamic>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
@@ -177,14 +215,14 @@ namespace Radzen.Blazor.Tests
parameterBuilder.Add<bool>(p => p.AllowFiltering, true);
});
Assert.Contains(@$"rz-cell-filter", component.Markup);
Assert.Contains(@$"rz-grid-filter-icon", component.Markup);
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowFiltering, false);
});
Assert.DoesNotContain(@$"rz-cell-filter", component.Markup);
Assert.DoesNotContain(@$"rz-grid-filter-icon", component.Markup);
}
[Fact]
@@ -194,12 +232,12 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<dynamic>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, new[] { new { Id = 1 }, new { Id = 2 }, new { Id = 3 } });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<dynamic>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.AddAttribute(3, "Filterable", false);
@@ -218,12 +256,12 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<dynamic>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, new[] { new { Id = 1 }, new { Id = 2 }, new { Id = 3 } });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<dynamic>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
@@ -249,12 +287,12 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<int>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<int>>(p => p.Data, new[] { 1, 2, 3 });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<int>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<int>));
builder.AddAttribute(1, "HeaderTemplate", (RenderFragment)delegate (RenderTreeBuilder b)
{
@@ -275,12 +313,12 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<int>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<int>>(p => p.Data, new[] { 1, 2, 3 });
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<int>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<int>));
builder.AddAttribute(1, "FooterTemplate", (RenderFragment)delegate (RenderTreeBuilder b)
{
@@ -291,8 +329,8 @@ namespace Radzen.Blazor.Tests
});
});
Assert.Contains(@$"rz-datatable-scrollable-footer", component.Markup);
Assert.Contains(@$"rz-datatable-scrollable-footer-box", component.Markup);
Assert.Contains(@$"rz-datatable-tfoot", component.Markup);
Assert.Contains(@$"rz-column-footer", component.Markup);
Assert.Contains(@$"Footer", component.Markup);
}
@@ -304,12 +342,12 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<dynamic>>(parameterBuilder =>
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenGridColumn<dynamic>));
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
@@ -334,11 +372,20 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
});
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AllowPaging, true));
Assert.Contains(@$"rz-paginator-bottom", component.Markup);
Assert.Contains(@$"rz-pager", component.Markup);
}
[Fact]
@@ -348,16 +395,21 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
component.SetParametersAndRender(parameters =>
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<PagerPosition>(p => p.PagerPosition, PagerPosition.Top);
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
parameterBuilder.Add<PagerPosition>(p => p.PagerPosition, PagerPosition.Top);
});
Assert.Contains(@$"rz-paginator", component.Markup);
Assert.DoesNotContain(@$"rz-paginator-bottom", component.Markup);
Assert.Contains(@$"rz-pager", component.Markup);
}
[Fact]
@@ -367,16 +419,59 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
parameterBuilder.Add<PagerPosition>(p => p.PagerPosition, PagerPosition.TopAndBottom);
});
Assert.Contains(@$"rz-pager", component.Markup);
}
[Fact]
public void DataGrid_Renders_PagerDensityDefault()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenDataGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<PagerPosition>(p => p.PagerPosition, PagerPosition.TopAndBottom);
parameters.Add<PagerPosition>(p => p.PagerPosition, PagerPosition.Top);
parameters.Add<Density>(p => p.Density, Density.Default);
});
Assert.Contains(@$"rz-paginator", component.Markup);
Assert.Contains(@$"rz-paginator-bottom", component.Markup);
Assert.DoesNotContain(@$"rz-density-compact", component.Markup);
}
[Fact]
public void DataGrid_Renders_PagerDensityCompact()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenDataGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<PagerPosition>(p => p.PagerPosition, PagerPosition.Top);
parameters.Add<Density>(p => p.Density, Density.Compact);
});
Assert.Contains(@$"rz-density-compact", component.Markup);
}
[Fact]
@@ -386,7 +481,7 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Array.Empty<int>()));
var component = ctx.RenderComponent<RadzenDataGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Array.Empty<int>()));
component.Render();
Assert.Contains("No records to display.", component.Markup);
@@ -400,7 +495,7 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Array.Empty<int>()));
var component = ctx.RenderComponent<RadzenDataGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Array.Empty<int>()));
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.EmptyText, emptyText);
@@ -416,7 +511,7 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Array.Empty<int>()));
var component = ctx.RenderComponent<RadzenDataGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Array.Empty<int>()));
component.SetParametersAndRender(parameters =>
{
parameters.Add<RenderFragment>(p => p.EmptyTemplate, builder =>
@@ -437,18 +532,28 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
});
var raised = false;
LoadDataArgs newArgs = null;
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; newArgs = args; });
});
component.Find(".rz-paginator-next").Click();
component.Find(".rz-pager-next").Click();
Assert.True(raised);
Assert.True(newArgs.Skip == 10);
@@ -462,18 +567,28 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
});
var raised = false;
LoadDataArgs newArgs = null;
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; newArgs = args; });
});
component.Find(".rz-paginator-last").Click();
component.Find(".rz-pager-last").Click();
Assert.True(raised);
Assert.True(newArgs.Skip == 90);
@@ -487,19 +602,29 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
});
var raised = false;
LoadDataArgs newArgs = null;
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; newArgs = args; });
});
component.Find(".rz-paginator-next").Click();
component.Find(".rz-paginator-prev").Click();
component.Find(".rz-pager-next").Click();
component.Find(".rz-pager-prev").Click();
Assert.True(raised);
Assert.True(newArgs.Skip == 0);
@@ -513,19 +638,29 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
});
var raised = false;
LoadDataArgs newArgs = null;
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; newArgs = args; });
});
component.Find(".rz-paginator-next").Click();
component.Find(".rz-paginator-first").Click();
component.Find(".rz-pager-next").Click();
component.Find(".rz-pager-first").Click();
Assert.True(raised);
Assert.True(newArgs.Skip == 0);
@@ -539,17 +674,27 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
});
var raised = false;
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; });
});
component.Find(".rz-paginator-first").Click();
component.Find(".rz-pager-first").Click();
Assert.False(raised);
}
@@ -561,17 +706,27 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
});
var raised = false;
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; });
});
component.Find(".rz-paginator-prev").Click();
component.Find(".rz-pager-prev").Click();
Assert.False(raised);
}
@@ -583,23 +738,29 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
});
var raised = false;
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
});
component.Find(".rz-paginator-last").Click();
component.Find(".rz-pager-last").Click();
component.SetParametersAndRender(parameters =>
{
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; });
});
component.Find(".rz-paginator-last").Click();
component.Find(".rz-pager-last").Click();
Assert.False(raised);
}
@@ -611,23 +772,29 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
});
var raised = false;
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
});
component.Find(".rz-paginator-last").Click();
component.Find(".rz-pager-last").Click();
component.SetParametersAndRender(parameters =>
{
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; });
});
component.Find(".rz-paginator-next").Click();
component.Find(".rz-pager-next").Click();
Assert.False(raised);
}
@@ -639,19 +806,29 @@ namespace Radzen.Blazor.Tests
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenGrid<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
var component = ctx.RenderComponent<RadzenDataGrid<dynamic>>(parameterBuilder =>
{
parameterBuilder.Add<IEnumerable<dynamic>>(p => p.Data, Enumerable.Range(0, 100).Select(i => new { Id = i }));
parameterBuilder.Add<RenderFragment>(p => p.Columns, builder =>
{
builder.OpenComponent(0, typeof(RadzenDataGridColumn<dynamic>));
builder.AddAttribute(1, "Property", "Id");
builder.AddAttribute(2, "Title", "Id");
builder.CloseComponent();
});
parameterBuilder.Add<bool>(p => p.AllowPaging, true);
});
var raised = false;
LoadDataArgs newArgs = null;
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<int>(p => p.PageSize, 20);
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; newArgs = args; });
});
component.Find(".rz-paginator-next").Click();
component.Find(".rz-pager-next").Click();
Assert.True(raised);
Assert.True(newArgs.Skip == 20);

View File

@@ -29,7 +29,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AllowPaging, true));
Assert.Contains(@$"rz-paginator-bottom", component.Markup);
Assert.Contains(@$"rz-pager-bottom", component.Markup);
}
[Fact]
@@ -44,8 +44,8 @@ namespace Radzen.Blazor.Tests
parameters.Add<PagerPosition>(p => p.PagerPosition, PagerPosition.Top);
});
Assert.Contains(@$"rz-paginator", component.Markup);
Assert.DoesNotContain(@$"rz-paginator-bottom", component.Markup);
Assert.Contains(@$"rz-pager", component.Markup);
Assert.DoesNotContain(@$"rz-pager-bottom", component.Markup);
}
[Fact]
@@ -60,8 +60,42 @@ namespace Radzen.Blazor.Tests
parameters.Add<PagerPosition>(p => p.PagerPosition, PagerPosition.TopAndBottom);
});
Assert.Contains(@$"rz-paginator", component.Markup);
Assert.Contains(@$"rz-paginator-bottom", component.Markup);
Assert.Contains(@$"rz-pager", component.Markup);
Assert.Contains(@$"rz-pager-bottom", component.Markup);
}
[Fact]
public void DataList_Renders_PagerDensityDefault()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenDataList<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<PagerPosition>(p => p.PagerPosition, PagerPosition.Top);
parameters.Add<Density>(p => p.Density, Density.Default);
});
Assert.DoesNotContain(@$"rz-density-compact", component.Markup);
}
[Fact]
public void DataList_Renders_PagerDensityCompact()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenDataList<int>>(parameterBuilder => parameterBuilder.Add<IEnumerable<int>>(p => p.Data, Enumerable.Range(0, 100)));
component.SetParametersAndRender(parameters =>
{
parameters.Add<bool>(p => p.AllowPaging, true);
parameters.Add<PagerPosition>(p => p.PagerPosition, PagerPosition.Top);
parameters.Add<Density>(p => p.Density, Density.Compact);
});
Assert.Contains(@$"rz-density-compact", component.Markup);
}
[Fact]
@@ -93,7 +127,7 @@ namespace Radzen.Blazor.Tests
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; newArgs = args; });
});
component.Find(".rz-paginator-next").Click();
component.Find(".rz-pager-next").Click();
Assert.True(raised);
Assert.True(newArgs.Skip == 10);
@@ -115,7 +149,7 @@ namespace Radzen.Blazor.Tests
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; newArgs = args; });
});
component.Find(".rz-paginator-last").Click();
component.Find(".rz-pager-last").Click();
Assert.True(raised);
Assert.True(newArgs.Skip == 90);
@@ -137,8 +171,8 @@ namespace Radzen.Blazor.Tests
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; newArgs = args; });
});
component.Find(".rz-paginator-next").Click();
component.Find(".rz-paginator-prev").Click();
component.Find(".rz-pager-next").Click();
component.Find(".rz-pager-prev").Click();
Assert.True(raised);
Assert.True(newArgs.Skip == 0);
@@ -160,8 +194,8 @@ namespace Radzen.Blazor.Tests
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; newArgs = args; });
});
component.Find(".rz-paginator-next").Click();
component.Find(".rz-paginator-first").Click();
component.Find(".rz-pager-next").Click();
component.Find(".rz-pager-first").Click();
Assert.True(raised);
Assert.True(newArgs.Skip == 0);
@@ -182,7 +216,7 @@ namespace Radzen.Blazor.Tests
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; });
});
component.Find(".rz-paginator-first").Click();
component.Find(".rz-pager-first").Click();
Assert.False(raised);
}
@@ -201,7 +235,7 @@ namespace Radzen.Blazor.Tests
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; });
});
component.Find(".rz-paginator-prev").Click();
component.Find(".rz-pager-prev").Click();
Assert.False(raised);
}
@@ -219,13 +253,13 @@ namespace Radzen.Blazor.Tests
parameters.Add<bool>(p => p.AllowPaging, true);
});
component.Find(".rz-paginator-last").Click();
component.Find(".rz-pager-last").Click();
component.SetParametersAndRender(parameters => {
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; });
});
component.Find(".rz-paginator-last").Click();
component.Find(".rz-pager-last").Click();
Assert.False(raised);
}
@@ -243,13 +277,13 @@ namespace Radzen.Blazor.Tests
parameters.Add<bool>(p => p.AllowPaging, true);
});
component.Find(".rz-paginator-last").Click();
component.Find(".rz-pager-last").Click();
component.SetParametersAndRender(parameters => {
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; });
});
component.Find(".rz-paginator-next").Click();
component.Find(".rz-pager-next").Click();
Assert.False(raised);
}
@@ -270,7 +304,7 @@ namespace Radzen.Blazor.Tests
parameters.Add<LoadDataArgs>(p => p.LoadData, args => { raised = true; newArgs = args; });
});
component.Find(".rz-paginator-next").Click();
component.Find(".rz-pager-next").Click();
Assert.True(raised);
Assert.True(newArgs.Skip == 20);

View File

@@ -18,10 +18,10 @@ namespace Radzen.Blazor.Tests
var component = ctx.RenderComponent<RadzenDatePicker<DateTime>>();
Assert.Contains(@$"rz-datepicker", component.Markup);
Assert.Contains(@$"rz-calendar", component.Markup);
Assert.Contains(@$"rz-datepicker-group", component.Markup);
Assert.Contains(@$"rz-datepicker-header", component.Markup);
Assert.Contains(@$"rz-datepicker-calendar", component.Markup);
Assert.Contains(@$"rz-calendar-header", component.Markup);
Assert.Contains(@$"rz-calendar-view", component.Markup);
}
[Fact]
@@ -49,7 +49,8 @@ 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);
});
@@ -69,7 +70,8 @@ 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.ShowTimeOkButton, true);
});
@@ -91,7 +93,8 @@ namespace Radzen.Blazor.Tests
var format = "d";
component.SetParametersAndRender(parameters => {
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.DateFormat, format);
parameters.Add<object>(p => p.Value, DateTime.Now);
});
@@ -108,7 +111,8 @@ 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(p => p.HourFormat, "12");
});
@@ -127,12 +131,13 @@ 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.TimeOnly, true);
});
Assert.DoesNotContain(@$"rz-datepicker-header", component.Markup);
Assert.DoesNotContain(@$"rz-calendar-header", component.Markup);
}
[Fact]
@@ -144,12 +149,13 @@ namespace Radzen.Blazor.Tests
var component = ctx.RenderComponent<RadzenDatePicker<DateTime>>();
component.SetParametersAndRender(parameters => {
component.SetParametersAndRender(parameters =>
{
parameters.Add<object>(p => p.Value, DateTime.Now);
parameters.Add<bool>(p => p.AllowClear, true);
});
Assert.Contains(@$"<i class=""rz-dropdown-clear-icon rzi rzi-times""", component.Markup);
Assert.Contains(@$"<i class=""notranslate rz-dropdown-clear-icon rzi rzi-times""", component.Markup);
}
[Fact]
@@ -212,7 +218,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Style, value));
Assert.Contains(@$"style=""display: inline-block;{value}""", component.Markup);
Assert.Contains(@$"style=""{value}""", component.Markup);
}
[Fact]
@@ -241,11 +247,12 @@ namespace Radzen.Blazor.Tests
var raised = false;
object newValue = null;
component.SetParametersAndRender(parameters => {
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.Change, args => { raised = true; newValue = args; });
});
component.Find(".rz-datepicker-next-icon").Click();
component.Find(".rz-calendar-next-icon").Click();
Assert.False(raised);
}
@@ -262,11 +269,12 @@ namespace Radzen.Blazor.Tests
var raised = false;
object newValue = null;
component.SetParametersAndRender(parameters => {
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.ValueChanged, args => { raised = true; newValue = args; });
});
component.Find(".rz-datepicker-next-icon").Click();
component.Find(".rz-calendar-next-icon").Click();
Assert.False(raised);
}
@@ -283,11 +291,12 @@ namespace Radzen.Blazor.Tests
var raised = false;
object newValue = null;
component.SetParametersAndRender(parameters => {
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.Change, args => { raised = true; newValue = args; });
});
component.Find(".rz-datepicker-prev-icon").Click();
component.Find(".rz-calendar-prev-icon").Click();
Assert.False(raised);
}
@@ -304,11 +313,12 @@ namespace Radzen.Blazor.Tests
var raised = false;
object newValue = null;
component.SetParametersAndRender(parameters => {
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.ValueChanged, args => { raised = true; newValue = args; });
});
component.Find(".rz-datepicker-prev-icon").Click();
component.Find(".rz-calendar-prev-icon").Click();
Assert.False(raised);
}
@@ -327,7 +337,8 @@ namespace Radzen.Blazor.Tests
var raised = false;
object newValue = null;
component.SetParametersAndRender(parameters => {
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.ValueChanged, args => { raised = true; newValue = args; })
.Add(p => p.DateRender, args => { args.Disabled = dates.Contains(args.Date); });
});
@@ -360,7 +371,8 @@ namespace Radzen.Blazor.Tests
var raised = false;
object newValue = null;
component.SetParametersAndRender(parameters => {
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.ValueChanged, args => { raised = true; newValue = args; })
.Add(p => p.DateRender, args => { args.Disabled = dates.Contains(args.Date); });
});
@@ -379,6 +391,72 @@ namespace Radzen.Blazor.Tests
Assert.Null(newValue);
}
[Fact]
public void DatePicker_Parses_Input_Using_DateFormat()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var component = ctx.RenderComponent<RadzenDatePicker<DateTime?>>();
var raised = false;
object newValue = null;
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.DateFormat, "ddMM");
parameters.Add(p => p.ValueChanged, args => { raised = true; newValue = args; });
});
var inputElement = component.Find(".rz-inputtext");
string input = "3012";
ctx.JSInterop.Setup<string>("Radzen.getInputValue", invocation => true).SetResult(input);
inputElement.Change(input);
Assert.True(raised);
Assert.Equal(new DateTime(DateTime.Now.Year, 12, 30), newValue);
}
[Fact]
public void DatePicker_Parses_Input_Using_ParseInput()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var component = ctx.RenderComponent<RadzenDatePicker<DateTime?>>();
Func<string, DateTime?> customParseInput = (input) =>
{
if (DateTime.TryParseExact(input, "ddMM", null, DateTimeStyles.None, out var result))
{
return result;
}
return null;
};
var raised = false;
object newValue = null;
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.ParseInput, customParseInput);
parameters.Add(p => p.ValueChanged, args => { raised = true; newValue = args; });
});
var inputElement = component.Find(".rz-inputtext");
string input = "3012";
ctx.JSInterop.Setup<string>("Radzen.getInputValue", invocation => true).SetResult(input);
inputElement.Change(input);
Assert.True(raised);
Assert.Equal(new DateTime(DateTime.Now.Year, 12, 30), newValue);
}
[Fact]
public void DatePicker_Respects_DateTimeMaxValue()
{
@@ -393,26 +471,7 @@ namespace Radzen.Blazor.Tests
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")
var exception = Record.Exception(() => component.Find(".rz-calendar-next-icon")
.Click());
Assert.Null(exception);
}
@@ -441,7 +500,7 @@ namespace Radzen.Blazor.Tests
parameters.Add(p => p.Change, args => { raised = true; newValue = args; });
});
component.Find(".rz-datepicker-next-icon").Click();
component.Find(".rz-calendar-next-icon").Click();
component.FindAll(".rz-button-text").First(x => x.TextContent == "Ok").Click();
Assert.True(raised);
@@ -505,5 +564,145 @@ namespace Radzen.Blazor.Tests
Assert.Equal(kind, (component.Instance.Value as DateTime?)?.Kind);
Assert.Equal(valueUtc.UtcDateTime.ToString(CultureInfo.InvariantCulture), (component.Instance.Value as DateTime?)?.ToString(CultureInfo.InvariantCulture));
}
[Fact]
public void DatePicker_Displays_Calender_Icon()
{
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>>();
Assert.Contains(@$"rzi-calendar", component.Markup);
}
[Fact]
public void DatePicker_Displays_Schedule_Icon()
{
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.TimeOnly, true);
});
Assert.Contains(@$"rzi-time", component.Markup);
}
[Fact]
public void DatePicker_Supports_DateOnly()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
DateOnly? dateOnly = new DateOnly(2024, 1, 31);
DateOnly? valueChangedValue = null!;
var component = ctx.RenderComponent<RadzenDatePicker<DateOnly?>>(parameters =>
{
parameters.Add(p => p.Value, dateOnly);
parameters.Add(p => p.ValueChanged, args => { valueChangedValue = args; });
});
Assert.False(component.Instance.ShowTime);
var input = component.Find("input");
input.GetAttribute("value").MarkupMatches(dateOnly.ToString());
// update to new value
var inputElement = component.Find(".rz-inputtext");
DateOnly? enteredValue = new DateOnly(2024, 2, 28);
ctx.JSInterop.Setup<string>("Radzen.getInputValue", invocation => true).SetResult(enteredValue.Value.ToShortDateString());
inputElement.Change(enteredValue);
input.GetAttribute("value").MarkupMatches(enteredValue.ToString());
Assert.Equal(enteredValue, component.Instance.Value);
Assert.Equal(enteredValue, valueChangedValue);
}
[Fact]
public void DatePicker_Supports_TimeOnly()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
TimeOnly? timeOnly = new TimeOnly(23, 59, 59);
TimeOnly? valueChangedValue = null!;
var component = ctx.RenderComponent<RadzenDatePicker<TimeOnly>>(parameters =>
{
parameters.Add(p => p.Value, timeOnly);
parameters.Add(p => p.ValueChanged, args => { valueChangedValue = args; });
});
Assert.True(component.Instance.TimeOnly);
Assert.True(component.Instance.ShowTime);
var input = component.Find("input");
input.GetAttribute("value").MarkupMatches(timeOnly.ToString());
// update to new value
var inputElement = component.Find(".rz-inputtext");
TimeOnly? enteredValue = new TimeOnly(1, 4, 5);
ctx.JSInterop.Setup<string>("Radzen.getInputValue", invocation => true).SetResult(enteredValue.Value.ToLongTimeString());
inputElement.Change(enteredValue);
input.GetAttribute("value").MarkupMatches(enteredValue.ToString());
Assert.Equal(enteredValue, component.Instance.Value);
Assert.Equal(enteredValue, valueChangedValue);
}
[Fact]
public void DatePicker_ShowCalendarWeek_WeekNumberAddedInAdditionalColumn()
{
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>>(parameter =>
{
parameter.Add(p => p.ShowCalendarWeek, true);
});
Assert.Contains(@$"rz-calendar-week-number", component.Markup);
Assert.Equal(8, component.FindAll(".rz-calendar-view th").Count());
// check header and week number column
Assert.Single(component.FindAll("th.rz-datepicker-week-number"));
Assert.Equal(6, component.FindAll("td.rz-calendar-week-number").Count());
}
[Fact]
public void DatePicker_ShowCalendarWeekFalse_NoAdditionalColumn()
{
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>>(parameter =>
{
parameter.Add(p => p.ShowCalendarWeek, false);
});
Assert.DoesNotContain(@$"rz-calendar-week-number", component.Markup);
Assert.Equal(7, component.FindAll(".rz-calendar-view th").Count());
}
[Fact]
public void DatePicker_ShowCalendarWeekWithCustomTitle_TitleCorrectlyRendered()
{
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>>(parameter =>
{
parameter.Add(p => p.ShowCalendarWeek, true);
parameter.Add(p => p.CalendarWeekTitle, "Wk");
});
var weekNumberHeader = component.Find(".rz-calendar-view th.rz-datepicker-week-number");
Assert.Contains("Wk", weekNumberHeader.InnerHtml);
}
}
}

View File

@@ -0,0 +1,58 @@
using System;
using System.ComponentModel;
using System.Globalization;
namespace Radzen.Blazor.Tests;
[TypeConverter(typeof(DollarsTypeConverter))]
public readonly record struct Dollars(decimal Amount) : IComparable<decimal>
{
public int CompareTo(decimal other)
{
return Amount.CompareTo(other);
}
public string ToString(string format, CultureInfo culture = null) => Amount.ToString(format, culture ?? CultureInfo.CreateSpecificCulture("en-US"));
public override string ToString() => Amount.ToString("F2", CultureInfo.CreateSpecificCulture("en-US"));
}
public class DollarsTypeConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(decimal) ||
sourceType == typeof(string))
{
return true;
}
return base.CanConvertFrom(context, sourceType);
}
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(decimal))
return true;
return base.CanConvertTo(context, destinationType);
}
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value is decimal d)
return new Dollars(d);
if (value is string s)
return decimal.TryParse(s, out var val) ? new Dollars(val) : null;
return base.ConvertFrom(context, culture, value);
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(decimal) && value is Dollars d)
return d.Amount;
return base.ConvertTo(context, culture, value, destinationType);
}
}

View File

@@ -1,5 +1,8 @@
using System;
using System.Threading.Tasks;
using AngleSharp.Dom;
using Bunit;
using Microsoft.AspNetCore.Components;
using Xunit;
namespace Radzen.Blazor.Tests
@@ -38,6 +41,23 @@ namespace Radzen.Blazor.Tests
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()
{
@@ -122,5 +142,108 @@ namespace Radzen.Blazor.Tests
Assert.Equal(2, selectedItems.Count);
}
[Fact]
public void DropDown_AppliesValueTemplateOnMultipleSelection()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var valueTemplateFragment = (RenderFragment<dynamic>)(_context =>
builder =>
{
builder.AddContent(0, $"value: {_context.Text}");
});
var component = DropDown<string>(ctx, parameters =>
{
parameters.Add(p => p.Multiple, true)
.Add(p => p.ValueTemplate, valueTemplateFragment);
});
var items = component.FindAll(".rz-multiselect-item");
items[0].Click();
items[1].Click();
component.Render();
var selectedItems = component.Find(".rz-inputtext");
Assert.Contains("value: Item 1,value: Item 2", selectedItems.Text());
}
[Fact]
public void DropDown_AppliesValueTemplateWhenTepmlateDefined()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var valueTemplateFragment = (RenderFragment<dynamic>)(_context =>
builder =>
{
builder.AddContent(0, $"value: {_context.Text}");
});
var templateFragment = (RenderFragment<dynamic>)(_context =>
builder =>
{
builder.AddContent(0, $"template: {_context.Text}");
});
var component = DropDown<string>(ctx, parameters =>
{
parameters.Add(p => p.Multiple, true)
.Add(p => p.ValueTemplate, valueTemplateFragment)
.Add(p => p.Template, templateFragment);
});
var items = component.FindAll(".rz-multiselect-item");
items[0].Click();
items[1].Click();
component.Render();
var selectedItems = component.Find(".rz-inputtext");
var itemsText = component.FindAll(".rz-multiselect-item-content");
Assert.Collection(itemsText, item => Assert.Contains("template: Item 1", item.Text()), item => Assert.Contains("template: Item 2", item.Text()));
Assert.Contains("value: Item 1,value: Item 2", selectedItems.Text());
}
[Fact]
public void DropDown_AppliesValueTemplateOnMultipleSelectionChips()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
var valueTemplateFragment = (RenderFragment<dynamic>)(_context =>
builder =>
{
builder.AddContent(0, $"value: {_context.Text}");
});
var component = DropDown<string>(ctx, parameters =>
{
parameters.Add(p => p.Multiple, true)
.Add(p => p.ValueTemplate, valueTemplateFragment)
.Add(p => p.Chips, true);
});
var items = component.FindAll(".rz-multiselect-item");
items[0].Click();
items[1].Click();
component.Render();
var selectedItems = component.FindAll(".rz-chip-text");
Assert.Collection(selectedItems, item => Assert.Contains("value: Item 1", item.Text()), item => Assert.Contains("value: Item 2", item.Text()));
}
}
}

View File

@@ -46,7 +46,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Icon, value));
Assert.Contains(@$"<i class=""rzi"">{value}</i>", component.Markup);
Assert.Contains(@$"<i class=""notranslate rzi"">{value}</i>", component.Markup);
}
[Fact]
@@ -104,11 +104,11 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AllowCollapse, true));
Assert.Contains(@"<span class=""rz-fieldset-toggler rzi rzi-w rzi-minus""></span>", component.Markup);
Assert.Contains(@"<span class=""notranslate rz-fieldset-toggler rzi rzi-w rzi-minus""></span>", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.Collapsed, true));
Assert.Contains(@"<span class=""rz-fieldset-toggler rzi rzi-w rzi-plus""></span>", component.Markup);
Assert.Contains(@"<span class=""notranslate rz-fieldset-toggler rzi rzi-w rzi-plus""></span>", component.Markup);
}
[Fact]

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""", component.Markup);
Assert.Contains(@$"class=""notranslate rzi""", component.Markup);
}
[Fact]
@@ -58,6 +58,18 @@ namespace Radzen.Blazor.Tests
Assert.Contains(@$"rzi-primary", component.Markup);
}
[Fact]
public void Icon_Renders_IconColor()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenIcon>();
component.SetParametersAndRender(parameters => parameters.Add(icon => icon.IconColor, Colors.Primary));
Assert.Contains(@$"color:", component.Markup);
}
[Fact]
public void Icon_NotRenders_IconStyleClass_WhenNull()
{
@@ -69,5 +81,17 @@ namespace Radzen.Blazor.Tests
Assert.DoesNotContain(@$"rzi-primary", component.Markup);
}
[Fact]
public void Icon_NotRenders_IconColor_WhenNull()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenIcon>();
component.SetParametersAndRender(parameters => parameters.Add(icon => icon.IconColor, null));
Assert.DoesNotContain(@$"color:", component.Markup);
}
}
}

View File

@@ -47,7 +47,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Icon, icon));
Assert.Contains(@$"<i class=""rzi"">{icon}</i>", component.Markup);
Assert.Contains(@$"<i class=""notranslate rzi"">{icon}</i>", component.Markup);
}
[Fact]

View File

@@ -119,13 +119,54 @@ namespace Radzen.Blazor.Tests
var component = ctx.RenderComponent<RadzenMask>();
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AutoComplete, false));
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
Assert.Contains(@$"autocomplete=""off""", component.Markup);
Assert.Contains(@$"aria-autocomplete=""none""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
Assert.Contains(@$"autocomplete=""on""", component.Markup);
Assert.DoesNotContain(@$"aria-autocomplete", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("autocomplete", "custom"));
Assert.Contains(@$"autocomplete=""custom""", component.Markup);
Assert.DoesNotContain(@$"aria-autocomplete", component.Markup);
component.Instance.DefaultAutoCompleteAttribute = "autocomplete-custom";
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
Assert.Contains(@$"autocomplete=""autocomplete-custom""", component.Markup);
Assert.Contains(@$"aria-autocomplete=""none""", component.Markup);
}
[Fact]
public void Mask_Renders_TypedAutoCompleteParameter()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenMask>();
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.On));
Assert.Contains(@$"autocomplete=""off""", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AutoComplete, true));
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.Off));
Assert.Contains(@$"autocomplete=""on""", component.Markup);
Assert.Contains(@$"autocomplete=""off""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.AdditionalName));
Assert.Contains(@$"autocomplete=""{AutoCompleteType.AdditionalName.GetAutoCompleteValue()}""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.Email));
Assert.Contains(@$"autocomplete=""{AutoCompleteType.Email.GetAutoCompleteValue()}""", component.Markup);
}
[Fact]

View File

@@ -0,0 +1,214 @@
using System;
using System.Linq;
using Xunit;
namespace Radzen.Blazor.Tests
{
public class NotificationServiceTests
{
[Fact]
public void NotificationService_IsMessageIsNull_ExceptionExpected()
{
NotificationService notificationService = new NotificationService();
NotificationMessage notificationMessage = null;
var exception = Record.Exception(() => notificationService.Notify(notificationMessage));
Assert.IsType<ArgumentNullException>(exception);
}
[Fact]
public void NotificationService_CheckAreTwoMessages_Equals()
{
var messageOne = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
};
var messageTwo = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
};
Assert.True(messageOne.Equals(messageTwo));
}
[Fact]
public void NotificationService_CheckAreTwoMessages_NotEquals()
{
var messageOne = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
};
var messageTwo = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary Two",
Detail = "Info Detail Two",
Duration = 6000
};
Assert.False(messageOne.Equals(messageTwo));
}
[Fact]
public void NotificationService_CheckAreTwoMessages_EqualsByReference()
{
var messageOne = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
};
var messageTwo = messageOne;
Assert.True(messageOne.Equals(messageTwo));
}
[Fact]
public void NotificationService_CheckAreTwoMessages_EqualsByOperator()
{
var messageOne = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
};
var messageTwo = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
};
Assert.True(messageOne == messageTwo);
}
[Fact]
public void NotificationService_CheckAreTwoMessages_NotEqualsByOperator()
{
var messageOne = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
};
var messageTwo = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary Two",
Detail = "Info Detail Two",
Duration = 6000
};
Assert.True(messageOne != messageTwo);
}
[Fact]
public void NotificationService_CheckAreTwoMessages_EqualsByHashCode()
{
var messageOne = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
};
var messageTwo = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
};
var messageOneHashCode = messageOne.GetHashCode();
var messageTwoHashCode = messageTwo.GetHashCode();
Assert.Equal(messageOneHashCode, messageTwoHashCode);
}
[Fact]
public void NotificationService_CheckAreTwoMessages_NotEqualsByHashCode()
{
var messageOne = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
};
var messageTwo = new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary Two",
Detail = "Info Detail Tow",
Duration = 5000
};
var messageOneHashCode = messageOne.GetHashCode();
var messageTwoHashCode = messageTwo.GetHashCode();
Assert.NotEqual(messageOneHashCode, messageTwoHashCode);
}
[Fact]
public void NotificationService_MessagesCount_AfterAddingMessages()
{
NotificationService notificationService = new NotificationService();
//Messages are the same so only one should be added
notificationService.Notify(NotificationSeverity.Info, "Info Summary", "Info Detail", 4000);
notificationService.Notify(new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
});
int expectedMessagesNumber = 1;
Assert.Equal(expectedMessagesNumber, notificationService.Messages.Count);
}
[Fact]
public void NotificationService_MessagesCount_AfterAddingTwoDifferentMessages()
{
NotificationService notificationService = new NotificationService();
//Messages are the same so only one should be added
notificationService.Notify(NotificationSeverity.Info, "Info Summary 2", "Info Detail 2", 6000);
notificationService.Notify(new NotificationMessage()
{
Severity = NotificationSeverity.Info,
Summary = "Info Summary",
Detail = "Info Detail",
Duration = 4000
});
int expectedMessagesNumber = 2;
Assert.Equal(expectedMessagesNumber, notificationService.Messages.Count);
}
}
}

View File

@@ -0,0 +1,172 @@
using System;
using System.Threading.Tasks;
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 ValueTask FocusAsync()
{
throw new NotImplementedException();
}
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_Null_And_AllowNull_Is_True()
{
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).Add(p => p.AllowNull, true));
});
Assert.True(component.Instance.Validate(null));
}
[Fact]
public void Returns_False_If_Value_Overflows()
{
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(long.MaxValue));
}
[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

@@ -1,4 +1,6 @@
using System;
using Bunit;
using Newtonsoft.Json.Linq;
using Xunit;
namespace Radzen.Blazor.Tests
@@ -14,9 +16,9 @@ namespace Radzen.Blazor.Tests
component.Render();
Assert.Contains(@$"rz-spinner", component.Markup);
Assert.Contains(@$"rz-spinner-up", component.Markup);
Assert.Contains(@$"rz-spinner-down", component.Markup);
Assert.Contains(@$"rz-numeric", component.Markup);
Assert.Contains(@$"rz-numeric-up", component.Markup);
Assert.Contains(@$"rz-numeric-down", component.Markup);
}
[Fact]
@@ -52,11 +54,41 @@ namespace Radzen.Blazor.Tests
parameters.Add<decimal?>(p => p.Min, minValue);
});
component.Find(".rz-spinner-down").Click();
component.Find(".rz-numeric-down").Click();
Assert.False(raised, $"Numeric value should Change event if value is less than min value.");
}
[Fact]
public void Numeric_Respect_Nullable_With_MinParameter()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenNumeric<double?>>();
var raised = false;
var value = 3.5;
object newValue = null;
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.Change, args => { raised = true; newValue = args; });
parameters.Add<decimal?>(p => p.Min, 1);
});
component.Find("input").Change(value);
Assert.True(raised);
Assert.True(object.Equals(value, newValue));
component.Find("input").Change("");
Assert.True(raised);
Assert.True(object.Equals(null, newValue));
}
[Fact]
public void Numeric_Respect_MaxParameter()
{
@@ -76,7 +108,7 @@ namespace Radzen.Blazor.Tests
parameters.Add<decimal?>(p => p.Max, maxValue);
});
component.Find(".rz-spinner-up").Click();
component.Find(".rz-numeric-up").Click();
Assert.False(raised, $"Numeric value should Change event if value is less than min value.");
}
@@ -184,13 +216,54 @@ namespace Radzen.Blazor.Tests
var component = ctx.RenderComponent<RadzenNumeric<double>>();
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AutoComplete, false));
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
Assert.Contains(@$"autocomplete=""off""", component.Markup);
Assert.Contains(@$"aria-autocomplete=""none""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
Assert.Contains(@$"autocomplete=""on""", component.Markup);
Assert.DoesNotContain(@$"aria-autocomplete", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("autocomplete", "custom"));
Assert.Contains(@$"autocomplete=""custom""", component.Markup);
Assert.DoesNotContain(@$"aria-autocomplete", component.Markup);
component.Instance.DefaultAutoCompleteAttribute = "autocomplete-custom";
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
Assert.Contains(@$"autocomplete=""autocomplete-custom""", component.Markup);
Assert.Contains(@$"aria-autocomplete=""none""", component.Markup);
}
[Fact]
public void Numeric_Renders_TypedAutoCompleteParameter()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenNumeric<double>>();
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.On));
Assert.Contains(@$"autocomplete=""off""", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AutoComplete, true));
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.Off));
Assert.Contains(@$"autocomplete=""on""", component.Markup);
Assert.Contains(@$"autocomplete=""off""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.BdayMonth));
Assert.Contains(@$"autocomplete=""{AutoCompleteType.BdayMonth.GetAutoCompleteValue()}""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.BdayYear));
Assert.Contains(@$"autocomplete=""{AutoCompleteType.BdayYear.GetAutoCompleteValue()}""", component.Markup);
}
[Fact]
@@ -256,7 +329,7 @@ namespace Radzen.Blazor.Tests
parameters.Add(p => p.Change, args => { raised = true; newValue = args; });
});
component.Find(".rz-spinner-up").Click();
component.Find(".rz-numeric-up").Click();
Assert.True(raised, "Numeric Change should be raised on step up");
Assert.True(object.Equals(expectedValue, newValue), $"Numeric value should be incremented on step up. Expected value: {expectedValue}, value: {newValue}");
@@ -265,7 +338,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.ValueChanged, args => { raised = true; }));
component.Find(".rz-spinner-up").Click();
component.Find(".rz-numeric-up").Click();
Assert.True(raised, "Numeric ValueChanged should be raised on step up");
}
@@ -291,7 +364,7 @@ namespace Radzen.Blazor.Tests
parameters.Add(p => p.Change, args => { raised = true; newValue = args; });
});
component.Find(".rz-spinner-down").Click();
component.Find(".rz-numeric-down").Click();
Assert.True(raised, "Numeric Change should be raised on step up");
Assert.True(object.Equals(expectedValue, newValue), $"Numeric value should be incremented on step up. Expected value: {expectedValue}, value: {newValue}");
@@ -300,7 +373,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.ValueChanged, args => { raised = true; }));
component.Find(".rz-spinner-down").Click();
component.Find(".rz-numeric-down").Click();
Assert.True(raised, "Numeric ValueChanged should be raised on step up");
}
@@ -314,9 +387,9 @@ namespace Radzen.Blazor.Tests
component.Render();
Assert.Contains(@$"rz-spinner-button-icon", component.Markup);
Assert.Contains(@$"rz-spinner-up", component.Markup);
Assert.Contains(@$"rz-spinner-down", component.Markup);
Assert.Contains(@$"rz-numeric-button-icon", component.Markup);
Assert.Contains(@$"rz-numeric-up", component.Markup);
Assert.Contains(@$"rz-numeric-down", component.Markup);
}
[Fact]
@@ -328,9 +401,9 @@ namespace Radzen.Blazor.Tests
component.Render();
Assert.DoesNotContain(@$"rz-spinner-button-icon", component.Markup);
Assert.DoesNotContain(@$"rz-spinner-up", component.Markup);
Assert.DoesNotContain(@$"rz-spinner-down", component.Markup);
Assert.DoesNotContain(@$"rz-numeric-button-icon", component.Markup);
Assert.DoesNotContain(@$"rz-numeric-up", component.Markup);
Assert.DoesNotContain(@$"rz-numeric-down", component.Markup);
}
[Fact]
@@ -350,5 +423,124 @@ namespace Radzen.Blazor.Tests
Assert.Contains($" value=\"{valueToTest.ToString(format)}\"", component.Markup);
}
public static TheoryData<decimal, decimal> NumericFormatterPreservesLeadingZerosData =>
new()
{
{ 10.000m, 100.000m },
{ 100.000m, 10.000m }
};
[Theory]
[MemberData(nameof(NumericFormatterPreservesLeadingZerosData))]
public void Numeric_Formatter_PreservesLeadingZeros(decimal oldValue, decimal newValue)
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
string format = "0.000";
var component = ctx.RenderComponent<RadzenNumeric<decimal>>(
ComponentParameter.CreateParameter(nameof(RadzenNumeric<decimal>.Format), format),
ComponentParameter.CreateParameter(nameof(RadzenNumeric<decimal>.Value), oldValue)
);
component.Render();
Assert.Contains($" value=\"{oldValue.ToString(format)}\"", component.Markup);
component.Find("input").Change(newValue);
Assert.Contains($" value=\"{newValue.ToString(format)}\"", component.Markup);
}
[Fact]
public void Numeric_Uses_ConvertValue()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var value = new Dollars(11m);
Dollars? ConvertFunc(string s) => decimal.TryParse(s, out var val) ? new Dollars(val) : null;
var component = ctx.RenderComponent<RadzenNumeric<Dollars?>>(
ComponentParameter.CreateParameter(nameof(RadzenNumeric<Dollars?>.ConvertValue), (Func<string, Dollars?>)ConvertFunc),
ComponentParameter.CreateParameter(nameof(RadzenNumeric<Dollars?>.Value), value)
);
component.Render();
Assert.Contains($" value=\"{value.ToString()}\"", component.Markup);
var newValue = new Dollars(13.53m);
component.Find("input").Change("13.53");
Assert.Contains($" value=\"{newValue.ToString()}\"", component.Markup);
}
[Fact]
public void Numeric_Supports_TypeConverter()
{
using var ctx = new TestContext();
var valueToTest = new Dollars(100.234m);
string format = "0.00";
var component = ctx.RenderComponent<RadzenNumeric<Dollars>>(
ComponentParameter.CreateParameter(nameof(RadzenNumeric<Dollars>.Format), format),
ComponentParameter.CreateParameter(nameof(RadzenNumeric<Dollars>.Value), valueToTest)
);
component.Render();
Assert.Contains($" value=\"{valueToTest.ToString(format)}\"", component.Markup);
}
[Fact]
public void Numeric_Supports_IComparable()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenNumeric<Dollars>>();
var maxValue = 2;
component.SetParametersAndRender(parameters =>
{
component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.Value, new Dollars(1m));
parameters.Add(p => p.Max, maxValue);
});
});
component.Find("input").Change("13.53");
var maxDollars = new Dollars(2);
Assert.Contains($" value=\"{maxDollars.ToString()}\"", component.Markup);
Assert.Equal(component.Instance.Value, maxDollars);
}
[Fact]
public void Numeric_Supports_IFormattable()
{
using var ctx = new TestContext();
var valueToTest = new Temperature(60.23m);
const string format = "F";
var component = ctx.RenderComponent<RadzenNumeric<Temperature>>(
ComponentParameter.CreateParameter(nameof(RadzenNumeric<Temperature>.Format), format),
ComponentParameter.CreateParameter(nameof(RadzenNumeric<Temperature>.Value), valueToTest)
);
component.Render();
var input = component.Find("input").GetAttribute("value");
input.MarkupMatches(valueToTest.ToString(format));
}
}
}

View File

@@ -23,14 +23,14 @@ namespace Radzen.Blazor.Tests
component.Render();
Assert.Contains(@$"rz-paginator", component.Markup);
Assert.Contains(@$"rz-pager", component.Markup);
component.SetParametersAndRender(parameters =>
{
parameters.Add<int>(p => p.PageSize, 101);
parameters.Add<int>(p => p.Count, 100);
});
Assert.DoesNotContain(@$"rz-paginator", component.Markup);
Assert.DoesNotContain(@$"rz-pager", component.Markup);
}
[Fact]
@@ -49,7 +49,7 @@ namespace Radzen.Blazor.Tests
component.Render();
Assert.Contains(@$"rz-paginator", component.Markup);
Assert.Contains(@$"rz-pager", component.Markup);
Assert.Contains(@$"rz-dropdown-trigger", component.Markup);
}
@@ -67,14 +67,93 @@ namespace Radzen.Blazor.Tests
await component.Instance.GoToPage(2);
component.Render();
Assert.Contains(@$"rz-paginator-summary", component.Markup);
Assert.Contains(@$"rz-pager-summary", component.Markup);
Assert.Contains(@$"Page 3 of 10 (100 items)", component.Markup);
component.SetParametersAndRender(parameters => {
parameters.Add<bool>(p => p.ShowPagingSummary, false);
});
Assert.DoesNotContain(@$"rz-paginator-summary", component.Markup);
Assert.DoesNotContain(@$"rz-pager-summary", component.Markup);
}
[Fact]
public void RadzenPager_Renders_PagerDensityDefault()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenPager>(parameters =>
{
parameters.Add<int>(p => p.PageSize, 20);
parameters.Add<int>(p => p.Count, 100);
parameters.Add<Density>(p => p.Density, Density.Default);
});
Assert.DoesNotContain(@$"rz-density-compact", component.Markup);
}
[Fact]
public void RadzenPager_Renders_PagerDensityCompact()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenPager>(parameters =>
{
parameters.Add<int>(p => p.PageSize, 20);
parameters.Add<int>(p => p.Count, 100);
parameters.Add<Density>(p => p.Density, Density.Compact);
});
Assert.Contains(@$"rz-density-compact", component.Markup);
}
[Fact]
public async void RadzenPager_First_And_Prev_Buttons_Are_Disabled_When_On_The_First_Page()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenPager>(parameters => {
parameters.Add<int>(p => p.PageSize, 10);
parameters.Add<int>(p => p.Count, 100);
parameters.Add<bool>(p => p.ShowPagingSummary, true);
});
await component.Instance.GoToPage(0);
component.Render();
var firstPageButton = component.Find("a.rz-pager-first");
Assert.True(firstPageButton.HasAttribute("disabled"));
var prevPageButton = component.Find("a.rz-pager-prev");
Assert.True(prevPageButton.HasAttribute("disabled"));
}
[Fact]
public async void RadzenPager_Last_And_Next_Buttons_Are_Disabled_When_On_The_Last_Page()
{
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.JSInterop.SetupModule("_content/Radzen.Blazor/Radzen.Blazor.js");
var component = ctx.RenderComponent<RadzenPager>(parameters => {
parameters.Add<int>(p => p.PageSize, 10);
parameters.Add<int>(p => p.Count, 100);
parameters.Add<bool>(p => p.ShowPagingSummary, true);
});
await component.Instance.GoToPage(9);
component.Render();
var lastPageButton = component.Find("a.rz-pager-last");
Assert.True(lastPageButton.HasAttribute("disabled"));
var nextPageButton = component.Find("a.rz-pager-next");
Assert.True(nextPageButton.HasAttribute("disabled"));
}
}
}

View File

@@ -47,7 +47,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Icon, value));
Assert.Contains(@$"<i class=""rzi"">{value}</i>", component.Markup);
Assert.Contains(@$"<i class=""notranslate rzi"">{value}</i>", component.Markup);
}
[Fact]
@@ -119,11 +119,11 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AllowCollapse, true));
Assert.Contains(@"<span class=""rzi rzi-minus""></span>", component.Markup);
Assert.Contains(@"<span class=""notranslate rzi rzi-minus""></span>", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.Collapsed, true));
Assert.Contains(@"<span class=""rzi rzi-plus""></span>", component.Markup);
Assert.Contains(@"<span class=""notranslate rzi rzi-plus""></span>", component.Markup);
}
[Fact]

View File

@@ -119,13 +119,45 @@ namespace Radzen.Blazor.Tests
var component = ctx.RenderComponent<RadzenPassword>();
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AutoComplete, false));
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
Assert.Contains(@$"autocomplete=""new-password""", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AutoComplete, true));
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
Assert.Contains(@$"autocomplete=""on""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("autocomplete", "custom"));
Assert.Contains(@$"autocomplete=""custom""", component.Markup);
}
[Fact]
public void Password_Renders_TypedAutoCompleteParameter()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenPassword>();
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.On));
Assert.Contains(@$"autocomplete=""new-password""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.Off));
Assert.Contains(@$"autocomplete=""off""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.CurrentPassword));
Assert.Contains(@$"autocomplete=""{AutoCompleteType.CurrentPassword.GetAutoCompleteValue()}""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.NewPassword));
Assert.Contains(@$"autocomplete=""{AutoCompleteType.NewPassword.GetAutoCompleteValue()}""", component.Markup);
}
[Fact]

View File

@@ -72,7 +72,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Style, value));
Assert.Contains(@$"style=""{value}""", component.Markup);
Assert.Contains(@$"style=""--rz-progressbar-value: 0%;{value}""", component.Markup);
}
[Fact]
@@ -118,7 +118,7 @@ namespace Radzen.Blazor.Tests
parameters.Add<double>(p => p.Max, max);
});
Assert.Contains(@$"style=""width: {Math.Min(value / max * 100, 100).ToInvariantString()}%;""", component.Markup);
Assert.Contains(@$"style=""--rz-progressbar-value: {Math.Min(value / max * 100, 100).ToInvariantString()}%;""", component.Markup);
}
[Fact]
@@ -129,18 +129,18 @@ namespace Radzen.Blazor.Tests
var component = ctx.RenderComponent<RadzenProgressBar>();
component.SetParametersAndRender(parameters=>parameters.Add(p=>p.ProgressBarStyle, ProgressBarStyle.Success));
Assert.Contains(@$"rz-progressbar-determinate-success", component.Markup);
Assert.Contains(@$"rz-progressbar-success", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add(p => p.ProgressBarStyle, ProgressBarStyle.Info));
Assert.Contains(@$"rz-progressbar-determinate-info", component.Markup);
Assert.Contains(@$"rz-progressbar-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);
Assert.Contains(@$"rz-progressbar-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);
Assert.Contains(@$"rz-progressbar-info", component.Markup);
}
}
}

View File

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

View File

@@ -39,7 +39,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add<int>(p => p.Value, value));
Assert.Contains(@$"style=""width: {Math.Round((value / max * 100)).ToInvariantString()}%;""", component.Markup);
Assert.Contains(@$"style=""left: {Math.Round((value / max * 100)).ToInvariantString()}%;""", component.Markup);
Assert.Contains(@$"style=""inset-inline-start: {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%", component.Markup);
Assert.Contains(@$"left: 30%", component.Markup);
Assert.Contains(@$"left: 4%; width: 26%;", component.Markup);
Assert.Contains(@$"inset-inline-start: 4%", component.Markup);
Assert.Contains(@$"inset-inline-start: 30%", component.Markup);
Assert.Contains(@$"inset-inline-start: 4%; width: 26%;", component.Markup);
}
[Fact]

View File

@@ -1,4 +1,5 @@
using Bunit;
using Microsoft.AspNetCore.Components;
using Xunit;
namespace Radzen.Blazor.Tests
@@ -44,7 +45,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Icon, icon));
Assert.Contains(@$"<i class=""rz-button-icon-left rzi"">{icon}</i>", component.Markup);
Assert.Contains(@$"<i class=""notranslate rz-button-icon-left rzi"">{icon}</i>", component.Markup);
}
[Fact]
@@ -59,10 +60,10 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => {
parameters.Add(p => p.Text, text);
parameters.Add(p => p.Icon, icon);
parameters.Add(p => p.Icon, icon);
});
Assert.Contains(@$"<i class=""rz-button-icon-left rzi"">{icon}</i>", component.Markup);
Assert.Contains(@$"<i class=""notranslate rz-button-icon-left rzi"">{icon}</i>", component.Markup);
Assert.Contains(@$"<span class=""rz-button-text"">{text}</span>", component.Markup);
}
@@ -77,7 +78,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Image, image));
Assert.Contains(@$"<img class=""rz-button-icon-left rzi"" src=""{image}"" />", component.Markup);
Assert.Contains(@$"<img class=""notranslate rz-button-icon-left rzi"" src=""{image}"" alt=""image"" />", component.Markup);
}
[Fact]
@@ -93,12 +94,29 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => {
parameters.Add(p => p.Text, text);
parameters.Add(p => p.Image, image);
parameters.Add(p => p.ImageAlternateText, text);
});
Assert.Contains(@$"<img class=""rz-button-icon-left rzi"" src=""{image}"" />", component.Markup);
Assert.Contains(@$"<img class=""notranslate rz-button-icon-left rzi"" src=""{image}"" alt=""{text}"" />", component.Markup);
Assert.Contains(@$"<span class=""rz-button-text"">{text}</span>", component.Markup);
}
[Fact]
public void SplitButton_Renders_ButtonContent()
{
using var ctx = new TestContext();
RenderFragment buttonContent = (builder) => builder.AddMarkupContent(0, "<strong>Custom button content</strong>");
var text = "Test";
var component = ctx.RenderComponent<RadzenSplitButton>(parameters => parameters
.Add(p => p.ButtonContent, buttonContent)
.Add(p => p.Text, text));
Assert.Contains(@$"<strong>Custom button content</strong>", component.Markup);
Assert.DoesNotContain(@$"<span class=""rz-button-text"">{text}</span>", component.Markup);
}
[Fact]
public void SplitButton_Renders_DisabledParameter()
{

View File

@@ -41,7 +41,7 @@ namespace Radzen.Blazor.Tests
component.SetParametersAndRender(parameters => parameters.Add(p => p.Style, value));
Assert.Contains(@$"style=""outline: 0 none;{value}""", component.Markup);
Assert.Contains(@$"style=""{value}""", component.Markup);
}
[Fact]

View File

@@ -0,0 +1,35 @@
using System;
using System.Globalization;
namespace Radzen.Blazor.Tests;
public record struct Temperature(decimal DegreesCelsius)
: IFormattable
{
public decimal Celsius => DegreesCelsius;
public decimal Fahrenheit => DegreesCelsius * 9 / 5 + 32;
public decimal Kelvin => DegreesCelsius + 273.15m;
public override string ToString() => ToString("G");
public string ToString(string format) => ToString(format, CultureInfo.CurrentCulture);
public string ToString(string format, IFormatProvider provider)
{
provider ??= CultureInfo.CurrentCulture;
if (string.IsNullOrEmpty(format))
format = "G";
switch (format.ToUpperInvariant())
{
case "G":
case "C":
return $"{Celsius.ToString("F2", provider)} °C";
case "F":
return $"{Fahrenheit.ToString("F2", provider)} °F";
case "K":
return $"{Kelvin.ToString("F2", provider)} K";
default:
throw new FormatException($"The {format} format string is not supported.");
}
}
}

View File

@@ -119,13 +119,54 @@ namespace Radzen.Blazor.Tests
var component = ctx.RenderComponent<RadzenTextBox>();
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AutoComplete, false));
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
Assert.Contains(@$"autocomplete=""off""", component.Markup);
Assert.Contains(@$"aria-autocomplete=""none""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
Assert.Contains(@$"autocomplete=""on""", component.Markup);
Assert.DoesNotContain(@$"aria-autocomplete", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("autocomplete", "custom"));
Assert.Contains(@$"autocomplete=""custom""", component.Markup);
Assert.DoesNotContain(@$"aria-autocomplete", component.Markup);
component.Instance.DefaultAutoCompleteAttribute = "autocomplete-custom";
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
Assert.Contains(@$"autocomplete=""autocomplete-custom""", component.Markup);
Assert.Contains(@$"aria-autocomplete=""none""", component.Markup);
}
[Fact]
public void TextBox_Renders_TypedAutoCompleteParameter()
{
using var ctx = new TestContext();
var component = ctx.RenderComponent<RadzenTextBox>();
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", false));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.On));
Assert.Contains(@$"autocomplete=""off""", component.Markup);
component.SetParametersAndRender(parameters => parameters.Add<bool>(p => p.AutoComplete, true));
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.Off));
Assert.Contains(@$"autocomplete=""on""", component.Markup);
Assert.Contains(@$"autocomplete=""off""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.AdditionalName));
Assert.Contains(@$"autocomplete=""{AutoCompleteType.AdditionalName.GetAutoCompleteValue()}""", component.Markup);
component.SetParametersAndRender(parameters => parameters.AddUnmatched("AutoComplete", true));
component.SetParametersAndRender(parameters => parameters.Add<AutoCompleteType>(p => p.AutoCompleteType, AutoCompleteType.FamilyName));
Assert.Contains(@$"autocomplete=""{AutoCompleteType.FamilyName.GetAutoCompleteValue()}""", component.Markup);
}
[Fact]

View File

@@ -0,0 +1,138 @@
namespace Radzen.Blazor
{
/// <summary>
/// The <c>AutomCompleteType</c> is a string-associated enum of
/// browser-supported autocomplete attribute values.
/// </summary>
/// <remarks>
/// This class lists the autocomplete attirbute options allowing
/// developers to provide the browser with guidance on how to pre-populate
/// the form fields. It is a class rather than a simpler enum to associate
/// each option with the string the browser expects. For more information
/// please review the list of options (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
/// and the spec (https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
/// </remarks>
public enum AutoCompleteType
{
/// <summary>Autocomplete is disabled. </summary>
Off,
/// <summary>Autocomplete is enabled. The browser chooses what values to suggest. </summary>
On,
/// <summary>The field expects the value to be a person's full name.</summary>
Name,
/// <summary>The prefix or title, such as "Mrs.", "Mr.", "Miss", "Ms.", "Dr." etc.</summary>
HonorificPrefix,
/// <summary>The given (or "first") name.</summary>
GivenName,
/// <summary>The middle name.</summary>
AdditionalName,
/// <summary>The family (or "last") name.</summary>
FamilyName,
/// <summary>The suffix, such as "Jr.", "B.Sc.", "PhD.", "MBASW", etc.</summary>
HonorificSuffix,
/// <summary>The nickname or handle.</summary>
Nickname,
/// <summary>The email address.</summary>
Email,
/// <summary>The username or account name.</summary>
Username,
/// <summary>A new password. When creating a new account or changing passwords.</summary>
NewPassword,
/// <summary>A current password. When filling in an existing password.</summary>
CurrentPassword,
/// <summary>A one-time code used for verifying user identity.</summary>
OneTimeCode,
/// <summary>A job title, or the title a person has within an organization, such as "Senior Technical Writer", "President", or "Assistant Troop Leader".</summary>
OrganizationTitle,
/// <summary>A company, business, or organization name.</summary>
Organization,
/// <summary>A street address. Use multiple address lines when more space is needed.</summary>
StreetAddress,
/// <summary>The line 1 of a street address. For example, "1234 Main Street".</summary>
AddressLine1,
/// <summary>The line 2 of a street address. For example, "Apartment 123".</summary>
AddressLine2,
/// <summary>The line 3 of a street address. For example, "c/o Jane Doe".</summary>
AddressLine3,
/// <summary>The city or locality.</summary>
AddressLevel1,
/// <summary>The state, province, prefecture, or region.</summary>
AddressLevel2,
/// <summary>The zip code or postal code.</summary>
AddressLevel3,
/// <summary>The country name.</summary>
AddressLevel4,
/// <summary>The country code.</summary>
Country,
/// <summary>The country name.</summary>
CountryName,
/// <summary>The postal code.</summary>
PostalCode,
/// <summary>The full name as printed on or associated with a payment instrument such as a credit card.</summary>
CcName,
/// <summary>The given (or "first") name as printed on or associated with a payment instrument such as a credit card.</summary>
CcGivenName,
/// <summary>The middle name as printed on or associated with a payment instrument such as a credit card.</summary>
CcAdditionalName,
/// <summary>The family (or "last") name as printed on or associated with a payment instrument such as a credit card.</summary>
CcFamilyName,
/// <summary>A credit card number or other number identifying a payment method, such as an account number.</summary>
CcNumber,
/// <summary>A payment method expiration date, typically in the form "MM/YY" or "MM/YYYY".</summary>
CcExp,
/// <summary>A payment method expiration month, typically in numeric form (MM).</summary>
CcExpMonth,
/// <summary>A payment method expiration year, typically in numeric form (YYYY).</summary>
CcExpYear,
/// <summary>The security code for your payment method, such as the CVV code.</summary>
CcCsc,
/// <summary>The type of payment instrument, such as "Visa", "Master Card", "Checking", or "Savings".</summary>
CcType,
/// <summary>The currency in which the transaction was completed. Use the ISO 4217 currency codes, such as "USD" for the US dollar.</summary>
TransactionCurrency,
/// <summary>The amount, in the currency specified by the transaction currency attribute, of the transaction completed.</summary>
TransactionAmount,
/// <summary>The language in which the transaction was completed. Use the relevant BCP 47 language tag.</summary>
Language,
/// <summary>A birth date, as a full date.</summary>
Bday,
/// <summary>The day of the month of a birth date.</summary>
BdayDay,
/// <summary>The month of the year of a birth date.</summary>
BdayMonth,
/// <summary>The year of a birth date.</summary>
BdayYear,
/// <summary>A gender identity (such as "Female", "Fa'afafine", "Hijra", "Male", "Nonbinary"), as freeform text without newlines.</summary>
Sex,
/// <summary>A full telephone number, including the country code. </summary>
Tel,
/// <summary>A country code, such as "1" for the United States, Canada, and other areas in North America and parts of the Caribbean.</summary>
TelCountryCode,
/// <summary>The entire phone number without the country code component, including a country-internal prefix.</summary>
TelNational,
/// <summary>The area code, with any country-internal prefix applied if appropriate.</summary>
TelAreaCode,
/// <summary>The phone number without the country or area code.</summary>
TelLocal,
/// <summary>The extension number, if applicable.</summary>
TelExtension,
/// <summary>A URL for an instant messaging protocol endpoint, such as "xmpp:username@example.net".</summary>
Impp,
/// <summary>A URL, such as a home page or company website address as appropriate given the context of the other fields in the form.</summary>
Url,
/// <summary>The URL of an image representing the person, company, or contact information given in the other fields in the form.</summary>
Photo,
/// <summary>State.</summary>
State,
/// <summary>Province.</summary>
Province,
/// <summary>Zip code.</summary>
ZipCode,
/// <summary>Firs name.</summary>
FirstName,
/// <summary>Middle name.</summary>
MiddleName,
/// <summary>Last name.</summary>
LastName,
}
}

View File

@@ -5,7 +5,7 @@ using System.Linq;
using System.Linq.Dynamic.Core;
using Radzen.Blazor.Rendering;
using System.Threading.Tasks;
using System.Collections;
using System.Net.Mime;
using Microsoft.AspNetCore.Components.Rendering;
namespace Radzen.Blazor
@@ -16,22 +16,34 @@ namespace Radzen.Blazor
/// <typeparam name="TItem">The type of the series data.</typeparam>
public abstract class CartesianSeries<TItem> : RadzenChartComponentBase, IChartSeries, IDisposable
{
/// <summary>
/// Cache for the value returned by <see cref="Category"/> when that value is only dependent on
/// <see cref="CategoryProperty"/>.
/// </summary>
Func<TItem, double> categoryPropertyCache;
/// <summary>
/// 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>
internal Func<TItem, double> Category(ScaleBase scale)
{
if (categoryPropertyCache != null)
{
return categoryPropertyCache;
}
if (IsNumeric(CategoryProperty))
{
return PropertyAccess.Getter<TItem, double>(CategoryProperty);
categoryPropertyCache = PropertyAccess.Getter<TItem, double>(CategoryProperty);
return categoryPropertyCache;
}
if (IsDate(CategoryProperty))
{
var category = PropertyAccess.Getter<TItem, DateTime>(CategoryProperty);
return (item) => category(item).Ticks;
categoryPropertyCache = (item) => category(item).Ticks;
return categoryPropertyCache;
}
if (scale is OrdinalScale ordinal)
@@ -80,6 +92,12 @@ namespace Radzen.Blazor
throw new ArgumentException($"Property {propertyName} does not exist");
}
#if NET6_0_OR_GREATER
if(PropertyAccess.IsDateOnly(property))
{
return false;
}
#endif
return PropertyAccess.IsDate(property);
}
@@ -351,6 +369,7 @@ namespace Radzen.Blazor
var shouldRefresh = parameters.DidParameterChange(nameof(Data), Data);
var visibleChanged = parameters.DidParameterChange(nameof(Visible), Visible);
var hiddenChanged = parameters.DidParameterChange(nameof(Hidden), Hidden);
var categoryChanged = parameters.DidParameterChange(nameof(CategoryProperty), CategoryProperty);
await base.SetParametersAsync(parameters);
@@ -366,6 +385,11 @@ namespace Radzen.Blazor
shouldRefresh = true;
}
if (categoryChanged || shouldRefresh)
{
categoryPropertyCache = null;
}
if (Data != null && Data.Count() != Items.Count)
{
shouldRefresh = true;
@@ -386,7 +410,7 @@ namespace Radzen.Blazor
if (IsDate(CategoryProperty) || IsNumeric(CategoryProperty))
{
Items = Items.AsQueryable().OrderBy(CategoryProperty).ToList();
Items = Items.AsQueryable().OrderBy(DynamicLinqCustomTypeProvider.ParsingConfig, CategoryProperty).ToList();
}
}
@@ -454,7 +478,7 @@ namespace Radzen.Blazor
}
/// <inheritdoc />
public virtual RenderFragment RenderTooltip(object data, double marginLeft, double marginTop)
public virtual RenderFragment RenderTooltip(object data, double marginLeft, double marginTop, double chartHeight)
{
var item = (TItem)data;
@@ -463,18 +487,62 @@ namespace Radzen.Blazor
return builder =>
{
builder.OpenComponent<ChartTooltip>(0);
builder.AddAttribute(1, nameof(ChartTooltip.X), x + marginLeft);
builder.AddAttribute(2, nameof(ChartTooltip.Y), y + marginTop);
builder.AddAttribute(3, nameof(ChartTooltip.ChildContent), TooltipTemplate == null ? null : TooltipTemplate(item));
if (Chart.Tooltip.Shared)
{
var category = PropertyAccess.GetValue(item, CategoryProperty);
builder.OpenComponent<ChartSharedTooltip>(0);
builder.AddAttribute(1, nameof(ChartSharedTooltip.X), x + marginLeft);
builder.AddAttribute(2, nameof(ChartSharedTooltip.Y), y + marginTop);
builder.AddAttribute(3, nameof(ChartSharedTooltip.Class), TooltipClass(item));
builder.AddAttribute(4, nameof(ChartSharedTooltip.Title), TooltipTitle(item));
builder.AddAttribute(4, nameof(ChartSharedTooltip.ChildContent), RenderSharedTooltipItems(category));
builder.CloseComponent();
}
else
{
builder.OpenComponent<ChartTooltip>(0);
builder.AddAttribute(1, nameof(ChartTooltip.X), x + marginLeft);
builder.AddAttribute(2, nameof(ChartTooltip.Y), y + marginTop);
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));
builder.AddAttribute(6, nameof(ChartTooltip.Value), TooltipValue(item));
builder.AddAttribute(7, nameof(ChartTooltip.Class), TooltipClass(item));
builder.AddAttribute(8, nameof(ChartTooltip.Style), TooltipStyle(item));
builder.CloseComponent();
}
};
}
builder.AddAttribute(4, nameof(ChartTooltip.Title), TooltipTitle(item));
builder.AddAttribute(5, nameof(ChartTooltip.Label), TooltipLabel(item));
builder.AddAttribute(6, nameof(ChartTooltip.Value), TooltipValue(item));
builder.AddAttribute(7, nameof(ChartTooltip.Class), TooltipClass(item));
builder.AddAttribute(8, nameof(ChartTooltip.Style), TooltipStyle(item));
builder.CloseComponent();
private RenderFragment RenderSharedTooltipItems(object category)
{
return builder =>
{
var visibleSeries = Chart.Series.Where(s => s.Visible).ToList();
foreach (var series in visibleSeries)
{
builder.AddContent(1, series.RenderSharedTooltipItem(category));
}
};
}
/// <inheritdoc />
public virtual RenderFragment RenderSharedTooltipItem(object category)
{
return builder =>
{
var item = Items.FirstOrDefault(i => object.Equals(PropertyAccess.GetValue(i, CategoryProperty), category));
if (item != null)
{
builder.OpenComponent<ChartSharedTooltipItem>(0);
builder.AddAttribute(1, nameof(ChartSharedTooltipItem.Value), TooltipValue(item));
builder.AddAttribute(2, nameof(ChartSharedTooltipItem.ChildContent), TooltipTemplate?.Invoke(item));
builder.AddAttribute(3, nameof(ChartSharedTooltipItem.LegendItem), RenderLegendItem(false));
builder.CloseComponent();
}
};
}
@@ -498,6 +566,14 @@ namespace Radzen.Blazor
/// <inheritdoc />
public virtual RenderFragment RenderLegendItem()
{
return RenderLegendItem(true);
}
/// <summary>
/// Renders the legend item for this series.
/// </summary>
protected virtual RenderFragment RenderLegendItem(bool clickable)
{
var style = new List<string>();
@@ -516,6 +592,7 @@ namespace Radzen.Blazor
builder.AddAttribute(5, nameof(LegendItem.MarkerSize), MarkerSize);
builder.AddAttribute(6, nameof(LegendItem.Text), GetTitle());
builder.AddAttribute(7, nameof(LegendItem.Click), EventCallback.Factory.Create(this, OnLegendItemClick));
builder.AddAttribute(8, nameof(LegendItem.Clickable), clickable);
builder.CloseComponent();
};
}
@@ -545,13 +622,13 @@ namespace Radzen.Blazor
/// <inheritdoc />
public double GetMean()
{
return Data.Select(e => Value(e)).Average();
return Data.Select(e => Value(e)).DefaultIfEmpty(double.NaN).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;
return Data.Any() ? Data.GroupBy(e => Value(e)).Select(g => new { Value = g.Key, Count = g.Count() }).OrderByDescending(e => e.Count).FirstOrDefault().Value : double.NaN;
}
/// <summary>
@@ -559,35 +636,38 @@ namespace Radzen.Blazor
/// </summary>
public (double a, double b) GetTrend()
{
double a, b;
double a = double.NaN, b = double.NaN;
Func<TItem, double> X;
Func<TItem, double> Y;
if (Chart.ShouldInvertAxes())
if (Data.Any())
{
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));
}
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;
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);
@@ -669,29 +749,32 @@ namespace Radzen.Blazor
}
/// <inheritdoc />
public virtual object DataAt(double x, double y)
public virtual (object, Point) DataAt(double x, double y)
{
if (Items.Any())
{
return Items.Select(item =>
var retObject = 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;
return (retObject,
new Point() { X = TooltipX(retObject), Y = TooltipY(retObject)});
}
return null;
return (null, null);
}
/// <inheritdoc />
public virtual IEnumerable<ChartDataLabel> GetDataLabels(double offsetX, double offsetY)
{
var list = new List<ChartDataLabel>();
foreach (var d in Data)
{
list.Add(new ChartDataLabel
{
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))
@@ -707,16 +790,25 @@ namespace Radzen.Blazor
/// <param name="index">The index.</param>
/// <param name="colors">The colors.</param>
/// <param name="defaultValue">The default value.</param>
protected string PickColor(int index, IEnumerable<string> colors, string defaultValue = null)
/// <param name="colorRange">The color range value.</param>
/// <param name="value">The value of the item.</param>
protected string PickColor(int index, IEnumerable<string> colors, string defaultValue = null, IList<SeriesColorRange> colorRange = null, double value = 0.0)
{
if (colors == null || !colors.Any())
if (colorRange != null)
{
return defaultValue;
var result = colorRange.Where(r => r.Min <= value && r.Max >= value).FirstOrDefault<SeriesColorRange>();
return result != null ? result.Color : defaultValue;
}
else
{
if (colors == null || !colors.Any())
{
return defaultValue;
}
return colors.ElementAt(index % colors.Count());
return colors.ElementAt(index % colors.Count());
}
}
/// <inheritdoc />
public void Dispose()
{

File diff suppressed because it is too large Load Diff

View File

@@ -199,5 +199,30 @@ namespace Radzen
/// </summary>
/// <value>The value.</value>
public object Value { get; set; }
/// <summary>
/// Gets or sets the icon.
/// </summary>
/// <value>The icon.</value>
public string Icon { get; set; }
/// <summary>
/// Gets or sets the icon color.
/// </summary>
/// <value>The icon color.</value>
public string IconColor { get; set; }
/// <summary>
/// Gets or sets the image.
/// </summary>
/// <value>The image.</value>
public string Image { get; set; }
/// <summary>
/// Gets or sets the image style.
/// </summary>
/// <value>The image style.</value>
public string ImageStyle { get; set; }
/// <summary>
/// Gets a value indicating whether this instance is disabled.
/// </summary>
/// <value><c>true</c> if this instance is disabled; otherwise, <c>false</c>.</value>
public bool Disabled { get; set; }
}
}

View File

@@ -0,0 +1,110 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.JSInterop;
namespace Radzen
{
/// <summary>
/// Options for the <see cref="CookieThemeService" />.
/// </summary>
public class CookieThemeServiceOptions
{
/// <summary>
/// Gets or sets the cookie name.
/// </summary>
public string Name { get; set; } = "Theme";
/// <summary>
/// Gets or sets the cookie duration.
/// </summary>
public TimeSpan Duration { get; set; } = TimeSpan.FromDays(365);
}
/// <summary>
/// Persist the current theme in a cookie. Requires <see cref="ThemeService" /> to be registered in the DI container.
/// </summary>
public class CookieThemeService
{
private readonly CookieThemeServiceOptions options;
private readonly IJSRuntime jsRuntime;
private readonly ThemeService themeService;
/// <summary>
/// Initializes a new instance of the <see cref="CookieThemeService" /> class.
/// </summary>
public CookieThemeService(IJSRuntime jsRuntime, ThemeService themeService, IOptions<CookieThemeServiceOptions> options)
{
this.jsRuntime = jsRuntime;
this.themeService = themeService;
this.options = options.Value;
themeService.ThemeChanged += OnThemeChanged;
_ = InitializeAsync();
}
private async Task InitializeAsync()
{
try
{
var cookies = await jsRuntime.InvokeAsync<string>("eval", "document.cookie");
var themeCookie = cookies?.Split("; ").Select(x =>
{
var parts = x.Split("=");
return (Key: parts[0], Value: parts[1]);
})
.FirstOrDefault(x => x.Key == options.Name);
var theme = themeCookie?.Value;
if (!string.IsNullOrEmpty(theme) && themeService.Theme != theme)
{
themeService.SetTheme(theme);
}
}
catch (InvalidOperationException)
{
}
}
private void OnThemeChanged()
{
var expiration = DateTime.Now.Add(options.Duration);
_ = jsRuntime.InvokeVoidAsync("eval", $"document.cookie = \"{options.Name}={themeService.Theme}; expires={expiration:R}; path=/\"");
}
}
/// <summary>
/// Extension methods to register the <see cref="CookieThemeService" />.
/// </summary>
public static class CookieThemeServiceCollectionExtensions
{
/// <summary>
/// Adds the <see cref="CookieThemeService" /> to the service collection.
/// </summary>
public static IServiceCollection AddRadzenCookieThemeService(this IServiceCollection services)
{
services.AddOptions<CookieThemeServiceOptions>();
services.AddScoped<CookieThemeService>();
return services;
}
/// <summary>
/// Adds the <see cref="CookieThemeService" /> to the service collection with the specified configuration.
/// </summary>
public static IServiceCollection AddRadzenCookieThemeService(this IServiceCollection services, Action<CookieThemeServiceOptions> configure)
{
services.Configure(configure);
services.AddScoped<CookieThemeService>();
return services;
}
}
}

View File

@@ -1,14 +1,16 @@
using System;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Web;
using Radzen.Blazor;
using Radzen.Blazor.Rendering;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Radzen.Blazor;
using Radzen.Blazor.Rendering;
namespace Radzen
{
@@ -213,6 +215,32 @@ namespace Radzen
}
}
/// <summary>
/// Gets or sets the search text
/// </summary>
[Parameter]
public string SearchText
{
get
{
return searchText;
}
set
{
if (searchText != value)
{
searchText = value;
}
}
}
/// <summary>
/// Gets or sets the search text changed.
/// </summary>
/// <value>The search text changed.</value>
[Parameter]
public EventCallback<string> SearchTextChanged { get; set; }
/// <summary>
/// The search text
/// </summary>
@@ -250,7 +278,7 @@ namespace Radzen
query.Add($"{Enum.GetName(typeof(StringFilterOperator), FilterOperator)}(@0)");
_view = Query.Where(String.Join(".", query), ignoreCase ? searchText.ToLower() : searchText);
_view = Query.Where(DynamicLinqCustomTypeProvider.ParsingConfig, string.Join(".", query), ignoreCase ? searchText.ToLower() : searchText);
}
else
{
@@ -288,20 +316,35 @@ namespace Radzen
/// <returns>A Task representing the asynchronous operation.</returns>
public override async Task SetParametersAsync(ParameterView parameters)
{
var searchTextChanged = parameters.DidParameterChange(nameof(SearchText), SearchText);
if (searchTextChanged)
{
searchText = parameters.GetValueOrDefault<string>(SearchText);
}
var dataChanged = parameters.DidParameterChange(nameof(Data), Data);
if (dataChanged)
{
await OnDataChanged();
}
var disabledChanged = parameters.DidParameterChange(nameof(Disabled), Disabled);
var result = base.SetParametersAsync(parameters);
if (EditContext != null && ValueExpression != null && FieldIdentifier.Model != EditContext.Model)
{
FieldIdentifier = FieldIdentifier.Create(ValueExpression);
EditContext.OnValidationStateChanged -= ValidationStateChanged;
EditContext.OnValidationStateChanged += ValidationStateChanged;
}
if (disabledChanged)
{
FormFieldContext?.DisabledChanged(Disabled);
}
await result;
}
@@ -334,7 +377,7 @@ namespace Radzen
/// Gets the value.
/// </summary>
/// <returns>System.Object.</returns>
public object GetValue()
public virtual object GetValue()
{
return Value;
}
@@ -347,6 +390,35 @@ namespace Radzen
/// <returns>ClassList.</returns>
protected ClassList GetClassList(string className) => ClassList.Create(className)
.AddDisabled(Disabled)
.Add(FieldIdentifier, EditContext);
.Add(FieldIdentifier, EditContext)
.Add("rz-state-empty", !HasValue);
/// <inheritdoc/>
public virtual async ValueTask FocusAsync()
{
await Element.FocusAsync();
}
/// <summary> Provides support for RadzenFormField integration. </summary>
[CascadingParameter]
public IFormFieldContext FormFieldContext { get; set; }
/// <summary> Gets the current placeholder. Returns empty string if this component is inside a RadzenFormField.</summary>
protected string CurrentPlaceholder => FormFieldContext?.AllowFloatingLabel == true ? " " : Placeholder;
/// <summary>
/// Handles the <see cref="E:ContextMenu" /> event.
/// </summary>
/// <param name="args">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
/// <returns>Task.</returns>
public override Task OnContextMenu(MouseEventArgs args)
{
if (!Disabled)
{
return base.OnContextMenu(args);
}
return Task.CompletedTask;
}
}
}

View File

@@ -2,6 +2,7 @@
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
@@ -24,7 +25,7 @@ namespace Radzen
/// &lt;div class="row"&gt;
/// &lt;div class="col-md-12"&gt;
/// &lt;RadzenButton Text="Ok" Click="() =&gt; ds.Close(true)" Style="margin-bottom: 10px; width: 150px" /&gt;
/// &lt;RadzenButton Text="Cancel" Click="() =&gt; ds.Close(false)" ButtonStyle="ButtonStyle.Secondary" Style="margin-bottom: 10px; width: 150px"/&gt;
/// &lt;RadzenButton Text="Cancel" Click="() =&gt; ds.Close(false)" ButtonStyle="ButtonStyle.Base" Style="margin-bottom: 10px; width: 150px"/&gt;
/// &lt;RadzenButton Text="Refresh" Click="(() =&gt; { orderID = 10249; ds.Refresh(); })" ButtonStyle="ButtonStyle.Info" Style="margin-bottom: 10px; width: 150px"/&gt;
/// Order ID: @orderID
/// &lt;/div&gt;
@@ -76,10 +77,15 @@ namespace Radzen
private void UriHelper_OnLocationChanged(object sender, Microsoft.AspNetCore.Components.Routing.LocationChangedEventArgs e)
{
if (dialogs.Count > 0)
while (dialogs.Any())
{
Close();
}
if (_sideDialogTask?.Task.IsCompleted == false)
{
CloseSide();
}
}
/// <summary>
@@ -97,6 +103,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>
@@ -104,7 +120,7 @@ namespace Radzen
/// <param name="title">The text displayed in the title bar of the dialog.</param>
/// <param name="parameters">The dialog parameters. Passed as property values of <typeparamref name="T" />.</param>
/// <param name="options">The dialog options.</param>
public void Open<T>(string title, Dictionary<string, object> parameters = null, DialogOptions options = null) where T : ComponentBase
public virtual void Open<T>(string title, Dictionary<string, object> parameters = null, DialogOptions options = null) where T : ComponentBase
{
OpenDialog<T>(title, parameters, options);
}
@@ -121,6 +137,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.
@@ -130,7 +147,7 @@ namespace Radzen
/// <param name="parameters">The dialog parameters. Passed as property values of <typeparamref name="T" />.</param>
/// <param name="options">The dialog options.</param>
/// <returns>The value passed as argument to <see cref="Close" />.</returns>
public Task<dynamic> OpenAsync<T>(string title, Dictionary<string, object> parameters = null, DialogOptions options = null) where T : ComponentBase
public virtual Task<dynamic> OpenAsync<T>(string title, Dictionary<string, object> parameters = null, DialogOptions options = null) where T : ComponentBase
{
var task = new TaskCompletionSource<dynamic>();
tasks.Add(task);
@@ -140,6 +157,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>
@@ -147,7 +200,7 @@ namespace Radzen
/// <param name="childContent">The content displayed in the dialog.</param>
/// <param name="options">The dialog options.</param>
/// <returns>The value passed as argument to <see cref="Close" />.</returns>
public Task<dynamic> OpenAsync(string title, RenderFragment<DialogService> childContent, DialogOptions options = null)
public virtual Task<dynamic> OpenAsync(string title, RenderFragment<DialogService> childContent, DialogOptions options = null)
{
var task = new TaskCompletionSource<dynamic>();
tasks.Add(task);
@@ -161,13 +214,36 @@ namespace Radzen
return task.Task;
}
/// <summary>
/// Opens a dialog with the specified content.
/// </summary>
/// <param name="titleContent">The content displayed in the title bar of the dialog.</param>
/// <param name="childContent">The content displayed in the dialog.</param>
/// <param name="options">The dialog options.</param>
/// <returns>The value passed as argument to <see cref="Close" />.</returns>
public virtual Task<dynamic> OpenAsync(RenderFragment<DialogService> titleContent, RenderFragment<DialogService> childContent, DialogOptions options = null)
{
var task = new TaskCompletionSource<dynamic>();
tasks.Add(task);
options = options ?? new DialogOptions();
options.ChildContent = childContent;
options.TitleContent = titleContent;
OpenDialog<object>(null, null, options);
return task.Task;
}
/// <summary>
/// Opens a dialog with the specified content.
/// </summary>
/// <param name="title">The text displayed in the title bar of the dialog.</param>
/// <param name="childContent">The content displayed in the dialog.</param>
/// <param name="options">The dialog options.</param>
public void Open(string title, RenderFragment<DialogService> childContent, DialogOptions options = null)
public virtual void Open(string title, RenderFragment<DialogService> childContent, DialogOptions options = null)
{
options = options ?? new DialogOptions();
@@ -196,11 +272,17 @@ namespace Radzen
Resizable = options != null ? options.Resizable : false,
Draggable = options != null ? options.Draggable : false,
ChildContent = options?.ChildContent,
TitleContent = options?.TitleContent,
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 : "",
WrapperCssClass = options != null ? options.WrapperCssClass : "",
CloseTabIndex = options != null ? options.CloseTabIndex : 0,
ContentCssClass = options != null ? options.ContentCssClass : "",
Resize = options?.Resize,
Drag = options?.Drag
});
}
@@ -243,7 +325,7 @@ 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)
public virtual async Task<bool?> Confirm(string message = "Confirm?", string title = "Confirm", ConfirmOptions options = null)
{
var dialogOptions = new DialogOptions()
{
@@ -262,6 +344,8 @@ namespace Radzen
CloseDialogOnOverlayClick = options != null ? options.CloseDialogOnOverlayClick : false,
CloseDialogOnEsc = options != null ? options.CloseDialogOnEsc : true,
CssClass = options != null ? $"rz-dialog-confirm {options.CssClass}" : "rz-dialog-confirm",
WrapperCssClass = options != null ? $"rz-dialog-wrapper {options.WrapperCssClass}" : "rz-dialog-wrapper",
CloseTabIndex = options != null ? options.CloseTabIndex : 0,
};
return await OpenAsync(title, ds =>
@@ -271,7 +355,7 @@ namespace Radzen
var i = 0;
b.OpenElement(i++, "p");
b.AddAttribute(i++, "class", "rz-dialog-confirm-message");
b.AddContent(i++, message);
b.AddContent(i++, (MarkupString)message);
b.CloseElement();
b.OpenElement(i++, "div");
@@ -284,7 +368,7 @@ namespace Radzen
b.OpenComponent<Blazor.RadzenButton>(i++);
b.AddAttribute(i++, "Text", options != null ? options.CancelButtonText : "Cancel");
b.AddAttribute(i++, "ButtonStyle", ButtonStyle.Secondary);
b.AddAttribute(i++, "ButtonStyle", ButtonStyle.Base);
b.AddAttribute(i++, "Click", EventCallback.Factory.Create<Microsoft.AspNetCore.Components.Web.MouseEventArgs>(this, () => ds.Close(false)));
b.CloseComponent();
@@ -301,7 +385,7 @@ 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?> Alert(string message = "", string title = "Message", AlertOptions options = null)
public virtual async Task<bool?> Alert(string message = "", string title = "Message", AlertOptions options = null)
{
var dialogOptions = new DialogOptions()
{
@@ -320,6 +404,9 @@ namespace Radzen
CloseDialogOnOverlayClick = options != null ? options.CloseDialogOnOverlayClick : false,
CloseDialogOnEsc = options != null ? options.CloseDialogOnEsc : true,
CssClass = options != null ? $"rz-dialog-alert {options.CssClass}" : "rz-dialog-alert",
WrapperCssClass = options != null ? $"rz-dialog-wrapper {options.WrapperCssClass}" : "rz-dialog-wrapper",
ContentCssClass = options != null ? $"rz-dialog-content {options.ContentCssClass}" : "rz-dialog-content",
CloseTabIndex = options != null ? options.CloseTabIndex : 0,
};
return await OpenAsync(title, ds =>
@@ -329,7 +416,7 @@ namespace Radzen
var i = 0;
b.OpenElement(i++, "p");
b.AddAttribute(i++, "class", "rz-dialog-alert-message");
b.AddContent(i++, message);
b.AddContent(i++, (MarkupString)message);
b.CloseElement();
b.OpenElement(i++, "div");
@@ -348,9 +435,9 @@ namespace Radzen
}
/// <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.
@@ -363,17 +450,127 @@ 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>
/// Gets or sets the CSS classes added to the dialog's wrapper element.
/// </summary>
public string WrapperCssClass { get; set; }
/// <summary>
/// Gets or sets the CSS classes added to the dialog's content element.
/// </summary>
public string ContentCssClass { get; set; }
/// <summary>
/// Gets or sets a value the dialog escape tabindex. Set to <c>0</c> by default.
/// </summary>
public int CloseTabIndex { get; set; } = 0;
}
/// <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>
/// 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; } = false;
}
/// <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>
/// <value><c>true</c> if resizable; otherwise, <c>false</c>.</value>
public bool Resizable { get; set; } = false;
/// <summary>
/// Gets or sets the change.
/// </summary>
/// <value>The change.</value>
public Action<Size> Resize { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the dialog is draggable. Set to <c>false</c> by default.
/// </summary>
/// <value><c>true</c> if draggable; otherwise, <c>false</c>.</value>
public bool Draggable { get; set; } = false;
/// <summary>
/// Gets or sets the change.
/// </summary>
/// <value>The change.</value>
public Action<Point> Drag { get; set; }
/// <summary>
/// Gets or sets the X coordinate of the dialog. Maps to the <c>left</c> CSS attribute.
/// </summary>
@@ -390,46 +587,24 @@ 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>
public RenderFragment<DialogService> ChildContent { get; set; }
/// <summary>
/// Gets or sets the title content.
/// </summary>
/// <value>The title content.</value>
public RenderFragment<DialogService> TitleContent { get; set; }
/// <summary>
/// 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.
/// </summary>
/// <value><c>true</c> if closeable; otherwise, <c>false</c>.</value>
public bool CloseDialogOnOverlayClick { get; set; } = false;
/// <summary>
/// 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 CloseDialogOnEsc { get; set; } = true;
/// <summary>
/// Gets or sets dialog box custom class
/// </summary>
public string CssClass { get; set; }
}
/// <summary>

View File

@@ -1,12 +1,13 @@
using System;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.JSInterop;
using Radzen.Blazor;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.JSInterop;
namespace Radzen
{
@@ -16,7 +17,12 @@ namespace Radzen
/// <typeparam name="T"></typeparam>
public class DropDownBase<T> : DataBoundFormComponent<T>
{
#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>
@@ -39,14 +45,14 @@ namespace Radzen
var totalItemsCount = LoadData.HasDelegate ? Count : view.Count();
var top = request.Count;
if(top <= 0)
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) });
await LoadData.InvokeAsync(new Radzen.LoadDataArgs() { Skip = request.StartIndex, Top = top, Filter = searchText });
}
virtualItems = (LoadData.HasDelegate ? Data : view.Skip(request.StartIndex).Take(top)).Cast<object>().ToList();
@@ -71,18 +77,19 @@ namespace Radzen
/// </summary>
[Parameter]
public int PageSize { get; set; } = 5;
#endif
/// <summary>
/// Determines whether virtualization is allowed.
/// </summary>
/// <returns><c>true</c> if virtualization is allowed; otherwise, <c>false</c>.</returns>
internal bool IsVirtualizationAllowed()
{
#if NET5_0_OR_GREATER
return AllowVirtualization;
#else
return false;
#endif
}
internal int GetVirtualizationOverscanCount()
{
return VirtualizationOverscanCount;
}
/// <summary>
@@ -93,7 +100,6 @@ namespace Radzen
{
return new RenderFragment(builder =>
{
#if NET5_0_OR_GREATER
if (AllowVirtualization)
{
builder.OpenComponent(0, typeof(Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<object>));
@@ -106,6 +112,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,12 +128,6 @@ namespace Radzen
RenderItem(builder, item);
}
}
#else
foreach (var item in LoadData.HasDelegate ? Data : View)
{
RenderItem(builder, item);
}
#endif
});
}
@@ -173,6 +178,13 @@ namespace Radzen
}
}
/// <summary>
/// Gets or sets the header template.
/// </summary>
/// <value>The header template.</value>
[Parameter]
public RenderFragment HeaderTemplate { get; set; }
/// <summary>
/// Gets or sets a value indicating whether filtering is allowed. Set to <c>false</c> by default.
/// </summary>
@@ -180,6 +192,13 @@ namespace Radzen
[Parameter]
public virtual bool AllowFiltering { get; set; }
/// <summary>
/// Gets or sets a value indicating whether filtering is allowed as you type. Set to <c>true</c> by default.
/// </summary>
/// <value><c>true</c> if filtering is allowed; otherwise, <c>false</c>.</value>
[Parameter]
public virtual bool FilterAsYouType { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether the user can clear the value. Set to <c>false</c> by default.
/// </summary>
@@ -222,12 +241,33 @@ namespace Radzen
[Parameter]
public string DisabledProperty { get; set; }
/// <summary>
/// Gets or sets the remove chip button title.
/// </summary>
/// <value>The remove chip button title.</value>
[Parameter]
public string RemoveChipTitle { get; set; } = "Remove";
/// <summary>
/// Gets or sets the search aria label text.
/// </summary>
/// <value>The search aria label text.</value>
[Parameter]
public string SearchAriaLabel { get; set; } = "Search";
/// <summary>
/// Gets or sets the empty value aria label text.
/// </summary>
/// <value>The empty value aria label text.</value>
[Parameter]
public string EmptyAriaLabel { get; set; } = "Empty";
/// <summary>
/// Gets or sets the selected item changed.
/// </summary>
/// <value>The selected item changed.</value>
[Parameter]
public Action<object> SelectedItemChanged { get; set; }
public EventCallback<object> SelectedItemChanged { get; set; }
/// <summary>
/// The selected items
@@ -241,17 +281,17 @@ namespace Radzen
/// <summary>
/// Selects all.
/// </summary>
protected async System.Threading.Tasks.Task SelectAll()
protected virtual async System.Threading.Tasks.Task SelectAll()
{
if (Disabled)
{
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
{
@@ -278,6 +318,15 @@ namespace Radzen
}
await ValueChanged.InvokeAsync((T)(object)list);
}
else if (typeof(T).IsGenericType && typeof(ICollection<>).MakeGenericType(typeof(T).GetGenericArguments()[0]).IsAssignableFrom(typeof(T)))
{
var list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(typeof(T).GetGenericArguments()[0]));
foreach (var i in (IEnumerable)internalValue)
{
list.Add(i);
}
await ValueChanged.InvokeAsync((T)(object)list);
}
else
{
await ValueChanged.InvokeAsync((T)internalValue);
@@ -286,16 +335,21 @@ namespace Radzen
await Change.InvokeAsync(internalValue);
StateHasChanged();
await JSRuntime.InvokeVoidAsync("Radzen.focusElement", GetId());
}
internal bool IsAllSelected()
{
if (LoadData.HasDelegate && !string.IsNullOrEmpty(ValueProperty))
{
return View != null && View.Cast<object>().All(i => IsItemSelectedByValue(GetItemOrValueFromProperty(i, 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>().Count();
return View != null && selectedItems.Count == View.Cast<object>().ToList()
.Where(i => disabledPropertyGetter != null ? disabledPropertyGetter(i) as bool? != true : true).Count();
}
/// <summary>
@@ -316,6 +370,7 @@ namespace Radzen
return;
searchText = null;
await SearchTextChanged.InvokeAsync(searchText);
await JSRuntime.InvokeAsync<string>("Radzen.setInputValue", search, "");
internalValue = default(T);
@@ -386,21 +441,34 @@ namespace Radzen
if (!string.IsNullOrEmpty(ValueProperty))
{
valuePropertyGetter = PropertyAccess.Getter<object, object>(ValueProperty, type);
valuePropertyGetter = GetGetter(ValueProperty, type);
}
if (!string.IsNullOrEmpty(TextProperty))
{
textPropertyGetter = PropertyAccess.Getter<object, object>(TextProperty, type);
textPropertyGetter = GetGetter(TextProperty, type);
}
if (!string.IsNullOrEmpty(DisabledProperty))
{
disabledPropertyGetter = PropertyAccess.Getter<object, object>(DisabledProperty, type);
disabledPropertyGetter = GetGetter(DisabledProperty, type);
}
}
}
Func<object, object> GetGetter(string propertyName, Type type)
{
if (propertyName?.Contains("[") == true)
{
var getter = typeof(PropertyAccess).GetMethod("Getter", [typeof(string), typeof(Type)]);
var getterMethod = getter.MakeGenericMethod([type, typeof(object)]);
return (i) => getterMethod.Invoke(i, [propertyName, type]);
}
return PropertyAccess.Getter<object, object>(propertyName, type);
}
internal Func<object, object> valuePropertyGetter;
internal Func<object, object> textPropertyGetter;
internal Func<object, object> disabledPropertyGetter;
@@ -415,30 +483,29 @@ namespace Radzen
{
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);
}
if (property == TextProperty)
{
return textPropertyGetter != null ? textPropertyGetter(item) : PropertyAccess.GetItemOrValueFromProperty(item, property);
}
else if (property == ValueProperty)
{
return valuePropertyGetter != null ? valuePropertyGetter(item) : PropertyAccess.GetItemOrValueFromProperty(item, property);
}
else if (property == DisabledProperty)
{
return disabledPropertyGetter != null ? disabledPropertyGetter(item) : PropertyAccess.GetItemOrValueFromProperty(item, property);
}
}
return item;
}
#if NET5_0_OR_GREATER
/// <inheritdoc/>
protected override async Task OnDataChanged()
{
@@ -449,7 +516,6 @@ namespace Radzen
await InvokeAsync(Virtualize.RefreshDataAsync);
}
}
#endif
/// <summary>
/// Gets the popup identifier.
@@ -467,7 +533,7 @@ namespace Radzen
/// Gets the search identifier.
/// </summary>
/// <value>The search identifier.</value>
protected string SearchID
public string SearchID
{
get
{
@@ -543,12 +609,15 @@ namespace Radzen
}
}
internal bool preventKeydown = false;
/// <summary>
/// Handles the key press.
/// </summary>
/// <param name="args">The <see cref="Microsoft.AspNetCore.Components.Web.KeyboardEventArgs"/> instance containing the event data.</param>
/// <param name="isFilter">if set to <c>true</c> [is filter].</param>
private async System.Threading.Tasks.Task HandleKeyPress(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args, bool isFilter = false)
/// <param name="shouldSelectOnChange">Should select item on item change with keyboard.</param>
protected virtual async System.Threading.Tasks.Task HandleKeyPress(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args, bool isFilter = false, bool? shouldSelectOnChange = null)
{
if (Disabled)
return;
@@ -566,9 +635,7 @@ namespace Radzen
{
if (IsVirtualizationAllowed())
{
#if NET5_0_OR_GREATER
items = virtualItems;
#endif
items = virtualItems ?? Enumerable.Empty<object>().ToList();
}
else
{
@@ -580,48 +647,72 @@ namespace Radzen
if (!args.AltKey && (key == "ArrowDown" || key == "ArrowLeft" || key == "ArrowUp" || key == "ArrowRight"))
{
preventKeydown = true;
try
{
var currentViewIndex = Multiple ? selectedIndex : items.IndexOf(selectedItem);
selectedIndex = await JSRuntime.InvokeAsync<int>("Radzen.focusListItem", search, list, key == "ArrowDown" || key == "ArrowRight", selectedIndex);
var newSelectedIndex = await JSRuntime.InvokeAsync<int>("Radzen.focusListItem", search, list, key == "ArrowDown" || key == "ArrowRight", currentViewIndex);
var popupOpened = await JSRuntime.InvokeAsync<bool>("Radzen.popupOpened", PopupID);
if (!Multiple)
if (!Multiple && !popupOpened && shouldSelectOnChange != false)
{
if (newSelectedIndex != currentViewIndex && newSelectedIndex >= 0 && newSelectedIndex <= items.Count() - 1)
var itemToSelect = items.ElementAtOrDefault(selectedIndex);
if (itemToSelect != null)
{
selectedIndex = newSelectedIndex;
await OnSelectItem(items.ElementAt(selectedIndex), true);
await OnSelectItem(itemToSelect, true);
}
}
else
{
selectedIndex = await JSRuntime.InvokeAsync<int>("Radzen.focusListItem", search, list, key == "ArrowDown", currentViewIndex);
}
}
catch (Exception)
{
//
}
}
else if (Multiple && key == "Enter")
else if (key == "Enter" || key == "NumpadEnter")
{
preventKeydown = true;
if (selectedIndex >= 0 && selectedIndex <= items.Count() - 1)
{
var itemToSelect = items.ElementAtOrDefault(selectedIndex);
await JSRuntime.InvokeAsync<string>("Radzen.setInputValue", search, $"{searchText}".Trim());
await OnSelectItem(items.ElementAt(selectedIndex), true);
if (itemToSelect != null)
{
await OnSelectItem(itemToSelect, true);
}
}
var popupOpened = await JSRuntime.InvokeAsync<bool>("Radzen.popupOpened", PopupID);
if (!popupOpened)
{
await OpenPopup(key, isFilter);
}
else
{
if (!Multiple)
{
await ClosePopup(key);
}
}
}
else if (key == "Enter" || (args.AltKey && key == "ArrowDown"))
else if (args.AltKey && key == "ArrowDown")
{
preventKeydown = true;
await OpenPopup(key, isFilter);
}
else if (key == "Escape" || key == "Tab")
{
await JSRuntime.InvokeVoidAsync("Radzen.closePopup", PopupID);
await ClosePopup(key);
}
else if (key == "Delete" && AllowClear)
{
preventKeydown = true;
if (!Multiple && selectedItem != null)
{
selectedIndex = -1;
@@ -633,12 +724,58 @@ namespace Radzen
Debounce(DebounceFilter, FilterDelay);
}
}
else if (AllowFiltering && isFilter)
else if (AllowFiltering && isFilter && FilterAsYouType)
{
preventKeydown = true;
Debounce(DebounceFilter, FilterDelay);
}
else
{
var filteredItems = Query.Where(TextProperty, args.Key, StringFilterOperator.StartsWith, FilterCaseSensitivity.CaseInsensitive)
.Cast<object>()
.ToList();
if (previousKey != args.Key)
{
previousKey = args.Key;
itemIndex = -1;
}
itemIndex = itemIndex + 1 >= filteredItems.Count() ? 0 : itemIndex + 1;
var itemToSelect = filteredItems.ElementAtOrDefault(itemIndex);
if (itemToSelect != null)
{
if (!Multiple)
{
await SelectItem(itemToSelect);
}
var result = items.Select((x, i) => new { Item = x, Index = i }).FirstOrDefault(itemWithIndex => object.Equals(itemWithIndex.Item, itemToSelect));
if (result != null)
{
if (!Multiple)
{
selectedIndex = result.Index;
}
await JSRuntime.InvokeVoidAsync("Radzen.selectListItem", list, list, result.Index);
}
}
preventKeydown = false;
}
}
internal virtual async Task ClosePopup(string key)
{
await JSRuntime.InvokeVoidAsync("Radzen.closePopup", PopupID);
}
int itemIndex;
string previousKey;
/// <summary>
/// Handles the <see cref="E:FilterKeyPress" /> event.
/// </summary>
@@ -655,17 +792,14 @@ namespace Radzen
{
if (!LoadData.HasDelegate)
{
searchText = await JSRuntime.InvokeAsync<string>("Radzen.getInputValue", search);
_view = null;
if (IsVirtualizationAllowed())
{
#if NET5_0_OR_GREATER
if (virtualize != null)
{
await virtualize.RefreshDataAsync();
}
await InvokeAsync(() => { StateHasChanged(); });
#endif
}
else
{
@@ -676,13 +810,15 @@ namespace Radzen
{
if (IsVirtualizationAllowed())
{
#if NET5_0_OR_GREATER
if (virtualize != null)
{
await InvokeAsync(virtualize.RefreshDataAsync);
}
else
{
await LoadData.InvokeAsync(await GetLoadDataArgs());
}
await InvokeAsync(() => { StateHasChanged(); });
#endif
}
else
{
@@ -694,15 +830,17 @@ namespace Radzen
selectedIndex = -1;
await JSRuntime.InvokeAsync<string>("Radzen.repositionPopup", Element, PopupID);
await SearchTextChanged.InvokeAsync(SearchText);
}
/// <summary>
/// Handles the <see cref="E:KeyPress" /> event.
/// </summary>
/// <param name="args">The <see cref="Microsoft.AspNetCore.Components.Web.KeyboardEventArgs"/> instance containing the event data.</param>
protected async System.Threading.Tasks.Task OnKeyPress(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args)
/// <param name="shouldSelectOnChange">Should select item on item change with keyboard.</param>
protected virtual async System.Threading.Tasks.Task OnKeyPress(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args, bool? shouldSelectOnChange = null)
{
await HandleKeyPress(args);
await HandleKeyPress(args, false, shouldSelectOnChange);
}
/// <summary>
@@ -730,18 +868,14 @@ namespace Radzen
/// <returns>LoadDataArgs.</returns>
internal virtual async System.Threading.Tasks.Task<LoadDataArgs> GetLoadDataArgs()
{
#if NET5_0_OR_GREATER
if (AllowVirtualization)
{
return new Radzen.LoadDataArgs() { Skip = 0, Top = PageSize, Filter = await JSRuntime.InvokeAsync<string>("Radzen.getInputValue", search) };
return await Task.FromResult(new Radzen.LoadDataArgs() { Skip = 0, Top = PageSize, Filter = searchText });
}
else
{
return new Radzen.LoadDataArgs() { Filter = await JSRuntime.InvokeAsync<string>("Radzen.getInputValue", search) };
return await Task.FromResult(new Radzen.LoadDataArgs() { Filter = searchText });
}
#else
return new Radzen.LoadDataArgs() { Filter = await JSRuntime.InvokeAsync<string>("Radzen.getInputValue", search) };
#endif
}
/// <summary>
@@ -776,13 +910,12 @@ namespace Radzen
/// <returns>A Task representing the asynchronous operation.</returns>
public override async Task SetParametersAsync(ParameterView parameters)
{
#if NET5_0_OR_GREATER
var pageSize = parameters.GetValueOrDefault<int>(nameof(PageSize));
if(pageSize != default(int))
if (pageSize != default(int))
{
PageSize = pageSize;
}
#endif
var selectedItemChanged = parameters.DidParameterChange(nameof(SelectedItem), SelectedItem);
if (selectedItemChanged)
{
@@ -820,7 +953,7 @@ namespace Radzen
if (valueAsEnumerable != null)
{
if (valueAsEnumerable.OfType<object>().Count() != selectedItems.Count)
if (!valueAsEnumerable.Cast<object>().SequenceEqual(selectedItems.Select(i => string.IsNullOrEmpty(ValueProperty) ? i : GetItemOrValueFromProperty(i, ValueProperty))))
{
selectedItems.Clear();
}
@@ -859,7 +992,7 @@ namespace Radzen
}
else
{
return object.Equals(item,selectedItem);
return object.Equals(item, selectedItem);
}
}
}
@@ -913,42 +1046,7 @@ namespace Radzen
{
if (_view == null && Query != null)
{
if (!string.IsNullOrEmpty(searchText))
{
var ignoreCase = FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive;
var query = new List<string>();
if (!string.IsNullOrEmpty(TextProperty))
{
query.Add(TextProperty);
}
if (typeof(EnumerableQuery).IsAssignableFrom(Query.GetType()))
{
query.Add("ToString()");
}
if (ignoreCase)
{
query.Add("ToLower()");
}
query.Add($"{Enum.GetName(typeof(StringFilterOperator), FilterOperator)}(@0)");
_view = Query.Where(String.Join(".", query), ignoreCase ? searchText.ToLower() : searchText);
}
else
{
if (IsVirtualizationAllowed())
{
_view = Query;
}
else
{
_view = (typeof(IQueryable).IsAssignableFrom(Data.GetType())) ? (Query as IEnumerable).Cast<object>().ToList().AsQueryable() : Query;
}
}
_view = Query.Where(TextProperty, searchText, FilterOperator, FilterCaseSensitivity);
}
return _view;
@@ -996,7 +1094,7 @@ namespace Radzen
/// <param name="raiseChange">if set to <c>true</c> [raise change].</param>
public async System.Threading.Tasks.Task SelectItem(object item, bool raiseChange = true)
{
if (disabledPropertyGetter != null && disabledPropertyGetter(item) as bool? == true)
if (disabledPropertyGetter != null && item != null && disabledPropertyGetter(item) as bool? == true)
{
return;
}
@@ -1009,7 +1107,7 @@ namespace Radzen
selectedItem = item;
if (!string.IsNullOrEmpty(ValueProperty))
{
internalValue = GetItemOrValueFromProperty(item, ValueProperty);
internalValue = PropertyAccess.GetItemOrValueFromProperty(item, ValueProperty);
}
else
{
@@ -1018,7 +1116,7 @@ namespace Radzen
SetSelectedIndexFromSelectedItem();
SelectedItemChanged?.Invoke(selectedItem);
await SelectedItemChanged.InvokeAsync(selectedItem);
}
else
{
@@ -1069,6 +1167,22 @@ namespace Radzen
await ValueChanged.InvokeAsync((T)(object)list);
}
}
else if (typeof(T).IsGenericType && typeof(ICollection<>).MakeGenericType(typeof(T).GetGenericArguments()[0]).IsAssignableFrom(typeof(T)))
{
if (object.Equals(internalValue, null))
{
await ValueChanged.InvokeAsync(default(T));
}
else
{
var list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(typeof(T).GetGenericArguments()[0]));
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);
@@ -1082,6 +1196,12 @@ namespace Radzen
StateHasChanged();
}
/// <inheritdoc />
public override object GetValue()
{
return internalValue;
}
internal void UpdateSelectedItems(object item)
{
if (!string.IsNullOrEmpty(ValueProperty))
@@ -1094,7 +1214,7 @@ namespace Radzen
}
else
{
selectedItems = selectedItems.AsQueryable().Where($@"!object.Equals({ValueProperty},@0)", value).ToList();
selectedItems = selectedItems.AsQueryable().Where(DynamicLinqCustomTypeProvider.ParsingConfig, $@"!object.Equals(it.{ValueProperty},@0)", value).ToList();
}
}
else
@@ -1116,19 +1236,20 @@ namespace Radzen
/// <param name="value">The value.</param>
protected virtual void SelectItemFromValue(object value)
{
if (value != null && View != null)
var view = LoadData.HasDelegate ? Data : View;
if (value != null && view != null)
{
if (!Multiple)
{
if (!string.IsNullOrEmpty(ValueProperty))
{
if (typeof(EnumerableQuery).IsAssignableFrom(View.GetType()))
if (typeof(EnumerableQuery).IsAssignableFrom(view.GetType()))
{
SelectedItem = View.OfType<object>().Where(i => object.Equals(GetItemOrValueFromProperty(i, ValueProperty), value)).FirstOrDefault();
SelectedItem = view.OfType<object>().Where(i => object.Equals(GetItemOrValueFromProperty(i, ValueProperty), value)).FirstOrDefault();
}
else
{
SelectedItem = View.AsQueryable().Where($@"{ValueProperty} == @0", value).FirstOrDefault();
SelectedItem = view.AsQueryable().Where(DynamicLinqCustomTypeProvider.ParsingConfig, $@"{ValueProperty} == @0", value).FirstOrDefault();
}
}
else
@@ -1137,8 +1258,6 @@ namespace Radzen
}
SetSelectedIndexFromSelectedItem();
SelectedItemChanged?.Invoke(selectedItem);
}
else
{
@@ -1151,16 +1270,16 @@ namespace Radzen
{
dynamic item;
if (typeof(EnumerableQuery).IsAssignableFrom(View.GetType()))
if (typeof(EnumerableQuery).IsAssignableFrom(view.GetType()))
{
item = View.OfType<object>().Where(i => object.Equals(GetItemOrValueFromProperty(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();
item = view.AsQueryable().Where(DynamicLinqCustomTypeProvider.ParsingConfig, $@"{ValueProperty} == @0", v).FirstOrDefault();
}
if (!object.Equals(item, null) && !selectedItems.AsQueryable().Where($@"object.Equals({ValueProperty},@0)", v).Any())
if (!object.Equals(item, null) && !selectedItems.AsQueryable().Where(DynamicLinqCustomTypeProvider.ParsingConfig, $@"object.Equals(it.{ValueProperty},@0)", v).Any())
{
selectedItems.Add(item);
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq.Dynamic.Core;
using System.Linq.Dynamic.Core.CustomTypeProviders;
using System.Reflection;
namespace Radzen.Blazor
{
class DynamicLinqCustomTypeProvider : IDynamicLinkCustomTypeProvider
{
static readonly HashSet<Type> empty = [];
public HashSet<Type> GetCustomTypes() => empty;
public Dictionary<Type, List<MethodInfo>> GetExtensionMethods() => throw new NotSupportedException();
public Type ResolveType(string typeName) => throw new NotSupportedException();
public Type ResolveTypeBySimpleName(string simpleTypeName) => throw new NotSupportedException();
public static ParsingConfig ParsingConfig = new() { CustomTypeProvider = new DynamicLinqCustomTypeProvider() };
}
}

View File

@@ -1,8 +1,12 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Text.RegularExpressions;
using System.Xml.Linq;
namespace Radzen.Blazor
{
@@ -14,22 +18,57 @@ namespace Radzen.Blazor
/// <summary>
/// Gets enum description.
/// </summary>
public static string GetDisplayDescription(this Enum enumValue)
public static string GetDisplayDescription(this Enum enumValue, Func<string, string> translationFunction = null)
{
var enumValueAsString = enumValue.ToString();
var val = enumValue.GetType().GetMember(enumValueAsString).FirstOrDefault();
var enumVal = val?.GetCustomAttribute<DisplayAttribute>()?.GetDescription() ?? enumValueAsString;
return val?.GetCustomAttribute<DisplayAttribute>()?.GetDescription() ?? enumValueAsString;
if (translationFunction != null)
return translationFunction(enumVal);
return enumVal;
}
/// <summary>
/// Converts Enum to IEnumerable of Value/Text.
/// </summary>
public static IEnumerable<object> EnumAsKeyValuePair(Type enumType)
public static IEnumerable<object> EnumAsKeyValuePair(Type enumType, Func<string, string> translationFunction = null)
{
return Enum.GetValues(enumType).Cast<Enum>().Distinct().Select(val => new { Value = Convert.ToInt32(val), Text = val.GetDisplayDescription() });
Type underlyingType = Enum.GetUnderlyingType(enumType);
return Enum.GetValues(enumType).Cast<Enum>().Distinct().Select(val => new { Value = Convert.ChangeType(val, underlyingType), Text = val.GetDisplayDescription(translationFunction) });
}
/// <summary>
/// Converts the autocomplete type enum value to the expected
/// autocomplete attribute value.
/// </summary>
/// <returns>The autocomplete attribute string value.</returns>
public static string GetAutoCompleteValue(this AutoCompleteType typeValue)
{
// Handle synonyms.
switch (typeValue)
{
case AutoCompleteType.FirstName:
return "given-name";
case AutoCompleteType.LastName:
return "family-name";
case AutoCompleteType.MiddleName:
return "additional-name";
case AutoCompleteType.ZipCode:
return "postal-code";
case AutoCompleteType.Province:
return "address-level1";
case AutoCompleteType.State:
return "address-level1";
}
// Handle standard values.
var value = typeValue.ToString();
value = Regex.Replace(value, "([^A-Z])([A-Z])", "$1-$2");
return Regex.Replace(value, "([A-Z]+)([A-Z][^A-Z$])", "$1-$2")
.Trim().ToLower();
}
}
}

View File

@@ -1,14 +1,80 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Web;
using Radzen.Blazor;
using Radzen.Blazor.Rendering;
namespace Radzen
{
/// <summary>
/// Class FormComponentWithAutoComplete.
/// </summary>
public class FormComponentWithAutoComplete<T> : FormComponent<T>
{
/// <summary>
/// Gets or sets a value indicating the type of built-in autocomplete
/// the browser should use.
/// <see cref="Blazor.AutoCompleteType" />
/// </summary>
/// <value>
/// The type of built-in autocomplete.
/// </value>
[Parameter]
public virtual AutoCompleteType AutoCompleteType { get; set; } = AutoCompleteType.On;
/// <summary>
/// Gets the autocomplete attribute's string value.
/// </summary>
/// <value>
/// <c>off</c> if the AutoComplete parameter is false or the
/// AutoCompleteType parameter is "off". When the AutoComplete
/// parameter is true, the value is <c>on</c> or, if set, the value of
/// AutoCompleteType.</value>
public virtual string AutoCompleteAttribute
{
get => Attributes != null && Attributes.ContainsKey("AutoComplete") && $"{Attributes["AutoComplete"]}".ToLower() == "false" ? DefaultAutoCompleteAttribute :
Attributes != null && Attributes.ContainsKey("AutoComplete") ? Attributes["AutoComplete"] as string ?? AutoCompleteType.GetAutoCompleteValue() : AutoCompleteType.GetAutoCompleteValue();
}
/// <summary>
/// Gets or sets the default autocomplete attribute's string value.
/// </summary>
public virtual string DefaultAutoCompleteAttribute { get; set; } = "off";
object ariaAutoComplete;
/// <inheritdoc />
public override async Task SetParametersAsync(ParameterView parameters)
{
parameters = parameters.TryGetValue("aria-autocomplete", out ariaAutoComplete) ?
ParameterView.FromDictionary(parameters
.ToDictionary().Where(i => i.Key != "aria-autocomplete").ToDictionary(i => i.Key, i => i.Value)
.ToDictionary(i => i.Key, i => i.Value))
: parameters;
await base.SetParametersAsync(parameters);
}
/// <summary>
/// Gets or sets the default aria-autocomplete attribute's string value.
/// </summary>
public virtual string DefaultAriaAutoCompleteAttribute { get; set; } = "none";
/// <summary>
/// Gets the aria-autocomplete attribute's string value.
/// </summary>
public virtual string AriaAutoCompleteAttribute
{
get => AutoCompleteAttribute == DefaultAutoCompleteAttribute ? DefaultAriaAutoCompleteAttribute : ariaAutoComplete as string;
}
}
/// <summary>
/// Class FormComponent.
/// Implements the <see cref="Radzen.RadzenComponent" />
@@ -162,6 +228,8 @@ namespace Radzen
/// <returns>Task.</returns>
public override Task SetParametersAsync(ParameterView parameters)
{
var disabledChanged = parameters.DidParameterChange(nameof(Disabled), Disabled);
var result = base.SetParametersAsync(parameters);
if (EditContext != null && ValueExpression != null && FieldIdentifier.Model != EditContext.Model)
@@ -171,6 +239,11 @@ namespace Radzen
EditContext.OnValidationStateChanged += ValidationStateChanged;
}
if (disabledChanged)
{
FormFieldContext?.DisabledChanged(Disabled);
}
return result;
}
@@ -230,6 +303,20 @@ namespace Radzen
/// <returns>ClassList.</returns>
protected ClassList GetClassList(string className) => ClassList.Create(className)
.AddDisabled(Disabled)
.Add(FieldIdentifier, EditContext);
.Add(FieldIdentifier, EditContext)
.Add("rz-state-empty", !HasValue);
/// <summary> Provides support for RadzenFormField integration. </summary>
[CascadingParameter]
public IFormFieldContext FormFieldContext { get; set; }
/// <summary> Gets the current placeholder. Returns empty string if this component is inside a RadzenFormField.</summary>
protected string CurrentPlaceholder => FormFieldContext?.AllowFloatingLabel == true ? " " : Placeholder;
/// <inheritdoc/>
public virtual async ValueTask FocusAsync()
{
await Element.FocusAsync();
}
}
}

View File

@@ -56,8 +56,13 @@ namespace Radzen.Blazor
/// <param name="data">The data.</param>
/// <param name="marginLeft">The left margin.</param>
/// <param name="marginTop">The right margin.</param>
/// <param name="chartHeight">Height of the whole char area.</param>
/// <returns>RenderFragment.</returns>
RenderFragment RenderTooltip(object data, double marginLeft, double marginTop);
RenderFragment RenderTooltip(object data, double marginLeft, double marginTop, double chartHeight);
/// <summary>
/// Renders a tooltip item with the specified data to be displayed in a shared tooltip
/// </summary>
RenderFragment RenderSharedTooltipItem(object category);
/// <summary>
/// Renders the legend item.
/// </summary>
@@ -96,7 +101,7 @@ namespace Radzen.Blazor
/// </summary>
/// <param name="x">The x.</param>
/// <param name="y">The y.</param>
object DataAt(double x, double y);
(object, Point) DataAt(double x, double y);
/// <summary>
/// Returns data chart position
/// </summary>

View File

@@ -0,0 +1,26 @@
using System.Collections.Generic;
namespace Radzen.Blazor
{
/// <summary>
/// Marker interface for <see cref="RadzenStackedAreaSeries{TItem}" />.
/// </summary>
public interface IChartStackedAreaSeries
{
/// <summary>
/// Gets the count.
/// </summary>
/// <value>The count.</value>
int Count { get; }
/// <summary>
/// Gets the values for category.
/// </summary>
IEnumerable<double> ValuesForCategory(double category);
/// <summary>
/// Gets the value at the specified index.
/// </summary>
double ValueAt(int index);
}
}

View File

@@ -0,0 +1,26 @@
using System.Collections.Generic;
namespace Radzen.Blazor
{
/// <summary>
/// Marker interface for <see cref="RadzenStackedBarSeries{TItem}" />.
/// </summary>
public interface IChartStackedBarSeries : IChartBarSeries
{
/// <summary>
/// Gets the value at the specified index.
/// </summary>
double ValueAt(int index);
/// <summary>
/// Gets the values for category.
/// </summary>
IEnumerable<double> ValuesForCategory(double category);
/// <summary>
/// Gets the items for category.
/// </summary>
/// <param name="category"></param>
/// <returns></returns>
IEnumerable<object> ItemsForCategory(double category);
}
}

View File

@@ -0,0 +1,33 @@
using System.Collections.Generic;
namespace Radzen.Blazor
{
/// <summary>
/// Marker interface for <see cref="RadzenStackedColumnSeries{TItem}" />.
/// </summary>
public interface IChartStackedColumnSeries
{
/// <summary>
/// Gets the count.
/// </summary>
/// <value>The count.</value>
int Count { get; }
/// <summary>
/// Gets the values for category.
/// </summary>
IEnumerable<double> ValuesForCategory(double category);
/// <summary>
/// Gets the items for category.
/// </summary>
/// <param name="category"></param>
/// <returns></returns>
IEnumerable<object> ItemsForCategory(double category);
/// <summary>
/// Gets the value at the specified index.
/// </summary>
double ValueAt(int index);
}
}

View File

@@ -11,6 +11,11 @@ namespace Radzen.Blazor
/// </summary>
public interface IScheduler
{
/// <summary>
/// Gets or sets the appointment move event callback.
/// </summary>
/// <value>The appointment move event callback.</value>
EventCallback<SchedulerAppointmentMoveEventArgs> AppointmentMove { get; set; }
/// <summary>
/// Gets the appointments in the specified range.
/// </summary>
@@ -59,6 +64,26 @@ namespace Radzen.Blazor
/// <param name="end">The end.</param>
Task SelectSlot(DateTime start, DateTime end);
/// <summary>
/// Selects the specified slot.
/// </summary>
/// <param name="start">The start.</param>
/// <param name="end">The end.</param>
/// <param name="appointments">The appointments for this range.</param>
Task<bool> SelectSlot(DateTime start, DateTime end, IEnumerable<AppointmentData> appointments);
/// <summary>
/// Selects the specified month.
/// </summary>
/// <param name="monthStart">The start of the month.</param>
/// <param name="appointments">The appointments for this range.</param>
Task SelectMonth(DateTime monthStart, IEnumerable<AppointmentData> appointments);
/// <summary>
/// Selects the specified more link.
/// </summary>
/// <param name="start">The start.</param>
/// <param name="end">The end.</param>
/// <param name="appointments">The appointments for this range.</param>
Task<bool> SelectMore(DateTime start, DateTime end, IEnumerable<AppointmentData> appointments);
/// <summary>
/// Gets the appointment HTML attributes.
/// </summary>
/// <param name="item">The appointment.</param>
@@ -77,6 +102,31 @@ namespace Radzen.Blazor
/// <param name="item">The item.</param>
/// <returns>RenderFragment.</returns>
RenderFragment RenderAppointment(AppointmentData item);
/// <summary>
/// Notifies the scheduler that the user has moved the mouse over the specified appointment.
/// </summary>
/// <param name="reference"></param>
/// <param name="data"></param>
Task MouseEnterAppointment(ElementReference reference, AppointmentData data);
/// <summary>
/// Returns true if the scheduler has a mouse enter appointment listener.
/// </summary>
bool HasMouseEnterAppointmentDelegate();
/// <summary>
/// Returns true if the scheduler has an AppointmentMove listener.
/// </summary>
bool HasAppointmentMoveDelegate();
/// <summary>
/// Notifies the scheduler that the user has moved the mouse out of the specified appointment.
/// </summary>
/// <param name="reference"></param>
/// <param name="data"></param>
/// <returns></returns>
Task MouseLeaveAppointment(ElementReference reference, AppointmentData data);
/// <summary>
/// Reloads this instance.
/// </summary>

View File

@@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
namespace Radzen.Blazor
@@ -49,5 +50,11 @@ namespace Radzen.Blazor
/// Gets the end date.
/// </summary>
DateTime EndDate { get; }
/// <summary>
/// Handles appointent move event.
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
Task OnAppointmentMove(SchedulerAppointmentMoveEventArgs data);
}
}

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2018-2022 Radzen Ltd
Copyright (c) 2018-2024 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

@@ -88,11 +88,6 @@ namespace Radzen.Blazor
if (Step is IConvertible)
{
step = Convert.ToDouble(Step);
if (step <= 0)
{
throw new ArgumentOutOfRangeException("Step must be greater than zero");
}
}
}
@@ -102,7 +97,7 @@ namespace Radzen.Blazor
end = Math.Ceiling(end / step) * step;
}
if (!Double.IsFinite(Input.Start) && !Double.IsFinite(Input.End))
if (!double.IsFinite(Input.Start) || !double.IsFinite(Input.End))
{
Input.Start = start = 0;
Input.End = end = 2;
@@ -110,7 +105,7 @@ namespace Radzen.Blazor
Round = false;
}
if (!Double.IsFinite(start) && !Double.IsFinite(end))
if (!double.IsFinite(start) || !double.IsFinite(end))
{
Input.Start = start = 0;
Input.End = end = 2;
@@ -118,6 +113,11 @@ namespace Radzen.Blazor
Round = false;
}
if (step <= 0)
{
throw new ArgumentOutOfRangeException("Step must be greater than zero");
}
return (start, end, step);
}
}

View File

@@ -31,35 +31,29 @@ namespace Radzen
/// <param name="message">The message.</param>
public void Notify(NotificationMessage message)
{
var newMessage = new NotificationMessage()
if (message is null)
{
Duration = message != null && message.Duration.HasValue ? message.Duration : 3000,
Severity = message.Severity,
Summary = message.Summary,
Detail = message.Detail,
Style = message.Style,
Click = message.Click,
CloseOnClick = message.CloseOnClick,
Payload = message.Payload
};
throw new ArgumentNullException(nameof(message));
}
if (!Messages.Contains(newMessage))
if (!Messages.Contains(message))
{
Messages.Add(newMessage);
Messages.Add(message);
}
}
/// <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)
/// <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>
/// <param name="close">Action to be executed on close.</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, Action<NotificationMessage> close = null)
{
var newMessage = new NotificationMessage()
{
@@ -68,6 +62,7 @@ namespace Radzen
Summary = summary,
Detail = detail,
Click = click,
Close = close,
CloseOnClick = closeOnClick,
Payload = payload
};
@@ -82,38 +77,42 @@ namespace Radzen
/// <summary>
/// Class NotificationMessage.
/// </summary>
public class NotificationMessage
public class NotificationMessage : IEquatable<NotificationMessage>
{
/// <summary>
/// Gets or sets the duration.
/// </summary>
/// <value>The duration.</value>
public double? Duration { get; set; }
public double? Duration { get; set; } = 3000;
/// <summary>
/// Gets or sets the severity.
/// </summary>
/// <value>The severity.</value>
public NotificationSeverity Severity { get; set; }
public NotificationSeverity Severity { get; set; } = NotificationSeverity.Info;
/// <summary>
/// Gets or sets the summary.
/// </summary>
/// <value>The summary.</value>
public string Summary { get; set; }
public string Summary { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the detail.
/// </summary>
/// <value>The detail.</value>
public string Detail { get; set; }
public string Detail { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the style.
/// </summary>
/// <value>The style.</value>
public string Style { get; set; }
public string Style { get; set; } = string.Empty;
/// <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; }
public Action<NotificationMessage> Click { get; set; }
/// <summary>
/// Get or set the event for when the notification is closed
/// </summary>
public Action<NotificationMessage> Close { get; set; }
/// <summary>
/// Gets or sets click on close action.
/// </summary>
@@ -124,5 +123,90 @@ namespace Radzen
/// </summary>
/// <value>Used to store a custom payload that can be retreived later in the click event handler.</value>
public object Payload { get; set; }
}
/// <summary>
/// Gets or sets the detail content.
/// </summary>
/// <value>The detail content.</value>
public RenderFragment<NotificationService> DetailContent { get; set; }
/// <summary>
/// Gets or sets the summary content.
/// </summary>
/// <value>The summary content.</value>
public RenderFragment<NotificationService> SummaryContent { get; set; }
#region Implementation of IEquatable<NotificationMessage> and operators overloading
/// <summary>
/// Check if NotificationMessage instance is equal to current instance.
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public bool Equals(NotificationMessage other)
{
if(other == null) return false;
if(object.ReferenceEquals(this, other)) return true;
return this.Severity == other.Severity
&& this.Summary == other.Summary
&& this.Detail == other.Detail
&& this.Duration == other.Duration
&& this.Style == other.Style
&& this.Click == other.Click
&& this.Close == other.Close
&& this.CloseOnClick == other.CloseOnClick
&& this.Payload == other.Payload
&& this.DetailContent == other.DetailContent
&& this.SummaryContent == other.SummaryContent;
}
/// <summary>
/// Check if object instance is equal to current instance.
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public override bool Equals(object obj) => Equals(obj as NotificationMessage);
/// <summary>
/// Return a hash code for the current object
/// </summary>
/// <returns></returns>
public override int GetHashCode() => (Summary, Detail, Duration, Style, Click, Close, CloseOnClick, Payload, SummaryContent, DetailContent).GetHashCode();
/// <summary>
/// Overloading == operator for NotificationMessage.
/// </summary>
/// <param name="message"></param>
/// <param name="otherMessage"></param>
/// <returns></returns>
public static bool operator ==(NotificationMessage message, NotificationMessage otherMessage)
{
if (message is null)
{
if (otherMessage is null)
{
return true;
}
return false;
}
return message.Equals(otherMessage);
}
/// <summary>
/// Overloading != operator for NotificationMessage.
/// </summary>
/// <param name="message"></param>
/// <param name="otherMessage"></param>
/// <returns></returns>
public static bool operator !=(NotificationMessage message, NotificationMessage otherMessage)
{
return !(message == otherMessage);
}
#endregion
}
}

View File

@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Web;
using System.Globalization;
namespace Radzen
{
@@ -211,7 +212,7 @@ namespace Radzen
/// <param name="options">The options.</param>
public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options)
{
writer.WriteStringValue(value.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"));
writer.WriteStringValue(value.ToString("yyyy-MM-ddTHH:mm:ss.fffZ", CultureInfo.InvariantCulture));
}
}
@@ -230,9 +231,10 @@ namespace Radzen
/// <param name="orderby">The orderby.</param>
/// <param name="expand">The expand.</param>
/// <param name="select">The select.</param>
/// <param name="apply">The apply.</param>
/// <param name="count">if set to <c>true</c> [count].</param>
/// <returns>Uri.</returns>
public static Uri GetODataUri(this Uri uri, string filter = null, int? top = null, int? skip = null, string orderby = null, string expand = null, string select = null, bool? count = null)
public static Uri GetODataUri(this Uri uri, string filter = null, int? top = null, int? skip = null, string orderby = null, string expand = null, string select = null, string apply = null, bool? count = null)
{
var uriBuilder = new UriBuilder(uri);
var queryString = HttpUtility.ParseQueryString(uriBuilder.Query);
@@ -267,6 +269,11 @@ namespace Radzen
queryString["$select"] = $"{select}";
}
if (!string.IsNullOrEmpty(apply))
{
queryString["$apply"] = $"{apply}";
}
if (count != null)
{
queryString["$count"] = $"{count}".ToLower();

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
@@ -35,6 +36,12 @@ namespace Radzen
[Parameter]
public HorizontalAlign PagerHorizontalAlign { get; set; } = HorizontalAlign.Justify;
/// <summary>
/// Gets or sets a value indicating pager density.
/// </summary>
[Parameter]
public Density Density { get; set; } = Density.Default;
/// <summary>
/// Gets or sets a value indicating whether paging is allowed. Set to <c>false</c> by default.
/// </summary>
@@ -56,10 +63,24 @@ namespace Radzen
}
set
{
_PageSize = value;
if (_PageSize != value)
{
_PageSize = value;
InvokeAsync(() => OnPageSizeChanged(value));
}
}
}
internal int GetPageSize()
{
return _PageSize;
}
internal void SetPageSize(int value)
{
_PageSize = value;
}
/// <summary>
/// Gets or sets the page numbers count.
/// </summary>
@@ -86,6 +107,13 @@ namespace Radzen
[Parameter]
public RenderFragment<T> Template { get; set; }
/// <summary>
/// Gets or sets the loading template.
/// </summary>
/// <value>The loading template.</value>
[Parameter]
public RenderFragment LoadingTemplate { get; set; }
/// <summary>
/// The data
/// </summary>
@@ -107,12 +135,37 @@ namespace Radzen
if (_data != value)
{
_data = value;
if (_data != null && _data is INotifyCollectionChanged)
{
((INotifyCollectionChanged)_data).CollectionChanged += OnCollectionChanged;
}
OnDataChanged();
StateHasChanged();
}
}
}
/// <summary>
/// Called when INotifyCollectionChanged CollectionChanged is raised.
/// </summary>
protected virtual void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs args)
{
}
/// <inheritdoc />
public override void Dispose()
{
base.Dispose();
if (_data != null && _data is INotifyCollectionChanged)
{
((INotifyCollectionChanged)_data).CollectionChanged -= OnCollectionChanged;
}
}
/// <summary>
/// Gets or sets the page size options.
/// </summary>
@@ -141,6 +194,78 @@ namespace Radzen
[Parameter]
public string PagingSummaryFormat { get; set; } = "Page {0} of {1} ({2} items)";
/// <summary>
/// Gets or sets the pager's first page button's title attribute.
/// </summary>
[Parameter]
public string FirstPageTitle { get; set; } = "First page.";
/// <summary>
/// Gets or sets the pager's first page button's aria-label attribute.
/// </summary>
[Parameter]
public string FirstPageAriaLabel { get; set; } = "Go to first page.";
/// <summary>
/// Gets or sets the pager's optional previous page button's label text.
/// </summary>
[Parameter]
public string PrevPageLabel { get; set; }
/// <summary>
/// Gets or sets the pager's previous page button's title attribute.
/// </summary>
[Parameter]
public string PrevPageTitle { get; set; } = "Previous page";
/// <summary>
/// Gets or sets the pager's previous page button's aria-label attribute.
/// </summary>
[Parameter]
public string PrevPageAriaLabel { get; set; } = "Go to previous page.";
/// <summary>
/// Gets or sets the pager's last page button's title attribute.
/// </summary>
[Parameter]
public string LastPageTitle { get; set; } = "Last page";
/// <summary>
/// Gets or sets the pager's last page button's aria-label attribute.
/// </summary>
[Parameter]
public string LastPageAriaLabel { get; set; } = "Go to last page.";
/// <summary>
/// Gets or sets the pager's optional next page button's label text.
/// </summary>
[Parameter]
public string NextPageLabel { get; set; }
/// <summary>
/// Gets or sets the pager's next page button's title attribute.
/// </summary>
[Parameter]
public string NextPageTitle { get; set; } = "Next page";
/// <summary>
/// Gets or sets the pager's next page button's aria-label attribute.
/// </summary>
[Parameter]
public string NextPageAriaLabel { get; set; } = "Go to next page.";
/// <summary>
/// Gets or sets the pager's numeric page number buttons' title attributes.
/// </summary>
[Parameter]
public string PageTitleFormat { get; set; } = "Page {0}";
/// <summary>
/// Gets or sets the pager's numeric page number buttons' aria-label attributes.
/// </summary>
[Parameter]
public string PageAriaLabelFormat { get; set; } = "Go to page {0}.";
internal IQueryable<T> _view = null;
/// <summary>
/// Gets the paged view.
@@ -316,8 +441,11 @@ namespace Radzen
/// <param name="value">The value.</param>
protected virtual async Task OnPageSizeChanged(int value)
{
pageSize = value;
await InvokeAsync(Reload);
if (pageSize != value && !this.firstRender)
{
pageSize = value;
await InvokeAsync(Reload);
}
}
/// <summary>

View File

@@ -0,0 +1,189 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using System.Web;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
namespace Radzen
{
/// <summary>
/// Options for the <see cref="QueryStringThemeService" />.
/// </summary>
public class QueryStringThemeServiceOptions
{
/// <summary>
/// Gets or sets the query string parameter for the theme.
/// </summary>
public string ThemeParameter { get; set; } = "theme";
/// <summary>
/// Gets or sets the query string parameter for the wcag compatible color theme.
/// </summary>
public string WcagParameter { get; set; } = "wcag";
/// <summary>
/// Gets or sets the query string parameter for the right to left theme.
/// </summary>
public string RightToLeftParameter { get; set; } = "rtl";
}
/// <summary>
/// Persist the current theme in the query string. Requires <see cref="ThemeService" /> to be registered in the DI container.
/// </summary>
public class QueryStringThemeService : IDisposable
{
private readonly NavigationManager navigationManager;
private readonly ThemeService themeService;
#if NET7_0_OR_GREATER
private readonly IDisposable registration;
#endif
private readonly QueryStringThemeServiceOptions options;
private readonly PropertyInfo hasAttachedJSRuntimeProperty;
/// <summary>
/// Initializes a new instance of the <see cref="QueryStringThemeService" /> class.
/// </summary>
public QueryStringThemeService(NavigationManager navigationManager, ThemeService themeService, IOptions<QueryStringThemeServiceOptions> options)
{
this.navigationManager = navigationManager;
this.themeService = themeService;
this.options = options.Value;
hasAttachedJSRuntimeProperty = navigationManager.GetType().GetProperty("HasAttachedJSRuntime");
var state = GetStateFromQueryString(navigationManager.Uri);
if (state.theme != null && RequiresChange(state))
{
themeService.SetTheme(new ThemeOptions
{
Theme = state.theme,
Wcag = state.wcag,
RightToLeft = state.rightToLeft,
TriggerChange = true
});
}
themeService.ThemeChanged += OnThemeChanged;
#if NET7_0_OR_GREATER
try
{
registration = navigationManager.RegisterLocationChangingHandler(OnLocationChanging);
}
catch (NotSupportedException)
{
// HttpNavigationManager does not support that
}
#endif
}
private bool RequiresChange((string theme, bool? wcag, bool? rightToLeft) state) =>
(state.theme != null && !string.Equals(themeService.Theme, state.theme, StringComparison.OrdinalIgnoreCase)) ||
themeService.Wcag != state.wcag || themeService.RightToLeft != state.rightToLeft;
#if NET7_0_OR_GREATER
private ValueTask OnLocationChanging(LocationChangingContext context)
{
var state = GetStateFromQueryString(context.TargetLocation);
if (RequiresChange(state))
{
context.PreventNavigation();
navigationManager.NavigateTo(GetUriWithStateQueryParameters(context.TargetLocation), replace: true);
}
return ValueTask.CompletedTask;
}
#endif
private (string theme, bool? wcag, bool? rightToLeft) GetStateFromQueryString(string uri)
{
var queryString = uri.Contains('?') ? uri[(uri.IndexOf('?') + 1)..] : string.Empty;
var query = HttpUtility.ParseQueryString(queryString.Contains('#') ? queryString[..queryString.IndexOf('#')] : queryString);
bool? wcag = query.Get(options.WcagParameter) != null ? query.Get(options.WcagParameter) == "true" : null;
bool? rtl = query.Get(options.RightToLeftParameter) != null ? query.Get(options.RightToLeftParameter) == "true" : null;
return (query.Get(options.ThemeParameter), wcag, rtl);
}
private string GetUriWithStateQueryParameters(string uri)
{
var parameters = new Dictionary<string, object>
{
{ options.ThemeParameter, themeService.Theme.ToLowerInvariant() },
};
if (themeService.Wcag.HasValue)
{
parameters.Add(options.WcagParameter, themeService.Wcag.Value ? "true" : "false");
}
if (themeService.RightToLeft.HasValue)
{
parameters.Add(options.RightToLeftParameter, themeService.RightToLeft.Value ? "true" : "false");
}
return navigationManager.GetUriWithQueryParameters(uri, parameters);
}
private void OnThemeChanged()
{
if (hasAttachedJSRuntimeProperty is null || hasAttachedJSRuntimeProperty.GetValue(navigationManager) is true)
{
var state = GetStateFromQueryString(navigationManager.Uri);
navigationManager.NavigateTo(GetUriWithStateQueryParameters(navigationManager.Uri),
forceLoad: state.rightToLeft != themeService.RightToLeft);
}
}
/// <inheritdoc />
public void Dispose()
{
themeService.ThemeChanged -= OnThemeChanged;
#if NET7_0_OR_GREATER
registration?.Dispose();
#endif
}
}
/// <summary>
/// Extension methods to register the <see cref="QueryStringThemeService" />.
/// </summary>
public static class QueryStringThemeServiceCollectionExtensions
{
/// <summary>
/// Adds the <see cref="QueryStringThemeService" /> to the service collection.
/// </summary>
public static IServiceCollection AddRadzenQueryStringThemeService(this IServiceCollection services)
{
services.AddOptions<QueryStringThemeServiceOptions>();
services.AddScoped<QueryStringThemeService>();
return services;
}
/// <summary>
/// Adds the <see cref="QueryStringThemeService" /> to the service collection with the specified condiguration.
/// </summary>
public static IServiceCollection AddRadzenQueryStringThemeService(this IServiceCollection services, Action<QueryStringThemeServiceOptions> configure)
{
services.Configure(configure);
services.AddScoped<QueryStringThemeService>();
return services;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,105 +0,0 @@
## 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,44 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<NoWarn>BL9993</NoWarn>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<RazorLangVersion>3.0</RazorLangVersion>
<LangVersion>7.3</LangVersion>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<NoWarn>BL9993;BL0007;BL0005</NoWarn>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<RazorLangVersion>7.0</RazorLangVersion>
<LangVersion>latest</LangVersion>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<PackageId>Radzen.Blazor</PackageId>
<Product>Radzen.Blazor</Product>
<Version>4.4.3</Version>
<Version>5.3.1</Version>
<Copyright>Radzen Ltd.</Copyright>
<Authors>Radzen Ltd.</Authors>
<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>
<Description>Radzen Blazor is a set of 90+ 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>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://www.radzen.com</PackageProjectUrl>
<PackageIcon>icon.png</PackageIcon>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Title>Radzen Components for Blazor</Title>
<RepositoryUrl>https://github.com/radzenhq/radzen-blazor</RepositoryUrl>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</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.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" />
<PackageReference Include="DartSassBuilder" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components" Condition="'$(TargetFramework)' == 'net6.0'" Version="6.0.25" />
<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.14" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Condition="'$(TargetFramework)' == 'net7.0'" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components" Condition="'$(TargetFramework)' == 'net8.0'" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Condition="'$(TargetFramework)' == 'net8.0'" Version="8.0.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.7" />
</ItemGroup>
<ItemGroup>
<None Include="LICENSE.txt" Pack="true" PackagePath="" />
<None Include="icon.png" Pack="true" PackagePath="" />
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
@@ -48,8 +47,8 @@
</ItemGroup>
<PropertyGroup>
<LibSassOutputStyle>expanded</LibSassOutputStyle>
<EnableDefaultSassItems>false</EnableDefaultSassItems>
<DartSassOutputStyle>expanded</DartSassOutputStyle>
<EnableDefaultSassItems>false</EnableDefaultSassItems>
</PropertyGroup>
<ItemGroup>
@@ -59,17 +58,17 @@
<Target Name="Sass" BeforeTargets="BeforeBuild" Condition="'$(TargetFramework)' == 'net6.0'">
<PropertyGroup>
<_SassFileList>@(Sass->'&quot;%(FullPath)&quot;', ' ')</_SassFileList>
<LibSassBuilderArgs>files $(_SassFileList) --outputstyle $(LibSassOutputStyle) --level $(LibSassOutputLevel)</LibSassBuilderArgs>
<DartSassBuilderArgs>files $(_SassFileList) --outputstyle $(DartSassOutputStyle) --level $(DartSassOutputLevel)</DartSassBuilderArgs>
</PropertyGroup>
<Message Text="$(LibSassBuilderArgs)" Importance="$(LibSassMessageLevel)" />
<Message Text="Converted SassFile list to argument" Importance="$(LibSassMessageLevel)" />
<Message Text="$(DartSassBuilderArgs)" Importance="$(DartSassMessageLevel)" />
<Message Text="Converted SassFile list to argument" Importance="$(DartSassMessageLevel)" />
</Target>
<Target Name="MoveCss" AfterTargets="AfterCompile" Condition="'$(TargetFramework)' == 'net6.0'" >
<Target Name="MoveCss" AfterTargets="AfterCompile" Condition="'$(TargetFramework)' == 'net6.0'">
<ItemGroup>
<CssFile Include="$(MSBuildProjectDirectory)/themes/*.css" />
</ItemGroup>
<Move SourceFiles="@(CssFile)" DestinationFolder="$(MSBuildProjectDirectory)/wwwroot/css/" />
</Target>
</Project>
</Project>

View File

@@ -10,31 +10,37 @@
}
@if (Visible)
{
<div @ref="@Element" role="tablist" style=@Style @attributes="Attributes" class="@GetCssClass()" id="@GetId()">
<div @ref="@Element" role="tablist" style=@Style @attributes="Attributes" class="@GetCssClass()" id="@GetId()"
tabindex="0" @onkeydown="@((args) => OnKeyPress(args))" @onkeydown:preventDefault=preventKeyPress @onkeydown:stopPropagation=preventKeyPress
@onfocus=@(args => focusedIndex = focusedIndex == -1 ? 0: focusedIndex)>
@for (var i = 0; i < items.Count; i++)
{
var item = items[i];
var item = items[i];
if (!item.Visible)
continue;
<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"
<div @ref="@item.Element" id="@item.GetItemId()" @attributes="item.Attributes" class="@item.GetItemCssClass()" style="@item.Style" @onkeydown:stopPropagation>
<a @onclick="@((args) => SelectItem(item))" aria-label="@ItemAriaLabel(i, item)" title="@ItemTitle(i, item)" @onclick:preventDefault="true" role="tab"
id="@($"rz-accordiontab-{items.IndexOf(item)}")" aria-controls="@($"rz-accordiontab-{items.IndexOf(item)}-content")" aria-expanded="true">
@if (IsSelected(i, item))
{
<span class="rz-accordion-toggle-icon rzi rzi-chevron-down"></span>
<span class="notranslate rz-accordion-toggle-icon rzi rzi-chevron-down"></span>
}
else
{
<span class="rz-accordion-toggle-icon rzi rzi-chevron-right"></span>
<span class="notranslate rz-accordion-toggle-icon rzi rzi-chevron-right"></span>
}
@if (!string.IsNullOrEmpty(item.Icon))
{
<i class="rzi">@((MarkupString)item.Icon)</i>
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(item.IconColor) ? $"color:{item.IconColor}" : null)">@((MarkupString)item.Icon)</i>
}
@if (!string.IsNullOrEmpty(item.Text))
@if (item.Template != null)
{
<span>@item.Text</span>
@item.Template
}
else if(!string.IsNullOrEmpty(item.Text))
{
<span>@((MarkupString)item.Text)</span>
}
</a>
</div>
@@ -42,7 +48,7 @@
{
<div class="rz-accordion-content-wrapper" role="tabpanel"
id="@($"rz-accordiontab-{items.IndexOf(item)}-content")" aria-hidden="false" aria-labelledby="@($"rz-accordiontab-{items.IndexOf(item)}")">
<div class="rz-accordion-content ">
<div class="rz-accordion-content" @onkeydown:stopPropagation>
@item.ChildContent
</div>
</div>

View File

@@ -1,6 +1,9 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Radzen.Blazor
{
@@ -41,7 +44,14 @@ namespace Radzen.Blazor
/// </summary>
/// <value>The index of the selected item.</value>
[Parameter]
public int SelectedIndex { get; set; } = 0;
public int SelectedIndex { get; set; }
/// <summary>
/// Gets or sets the value changed.
/// </summary>
/// <value>The value changed.</value>
[Parameter]
public EventCallback<int> SelectedIndexChanged { get; set; }
/// <summary>
/// Gets or sets a callback raised when the item is expanded.
@@ -74,18 +84,9 @@ namespace Radzen.Blazor
{
if (items.IndexOf(item) == -1)
{
if (item.Selected)
if (item.GetSelected())
{
SelectedIndex = items.Count;
if (!Multiple)
{
expandedIdexes.Clear();
}
if (!expandedIdexes.Contains(SelectedIndex))
{
expandedIdexes.Add(SelectedIndex);
}
SelectedIndexChanged.InvokeAsync(items.Count);
}
items.Add(item);
@@ -125,30 +126,63 @@ namespace Radzen.Blazor
/// <returns><c>true</c> if the specified index is selected; otherwise, <c>false</c>.</returns>
protected bool IsSelected(int index, RadzenAccordionItem item)
{
return expandedIdexes.Contains(index);
return item.GetSelected() == true;
}
List<int> expandedIdexes = new List<int>();
/// <summary>
/// Gets the item's title attribute value.
/// </summary>
/// <param name="index">The index.</param>
/// <param name="item">The item.</param>
/// <returns>The item's collapse or expand title value depending on if the item is expanded or collapsed.
/// If the relevant title is null or whitespace this method returns "Expand" or "Collapse".</returns>
protected string ItemTitle(int index, RadzenAccordionItem item)
{
if (IsSelected(index, item))
{
return string.IsNullOrWhiteSpace(item.CollapseTitle) ? "Collapse" : item.CollapseTitle;
}
return string.IsNullOrWhiteSpace(item.ExpandTitle) ? "Expand" : item.ExpandTitle;
}
internal async System.Threading.Tasks.Task SelectItem(RadzenAccordionItem item)
/// <summary>
/// Gets the item's aria-label attribute value.
/// </summary>
/// <param name="index">The index.</param>
/// <param name="item">The item.</param>
/// <returns>The item's collapse or expand aria-label value depending on if the item is expanded or collapsed.
/// If the relevant aria-label is null or whitespace this method returns "Expand" or "Collapse".</returns>
protected string ItemAriaLabel(int index, RadzenAccordionItem item)
{
if (IsSelected(index, item))
{
return string.IsNullOrWhiteSpace(item.CollapseAriaLabel) ? "Collapse" : item.CollapseAriaLabel;
}
return string.IsNullOrWhiteSpace(item.ExpandAriaLabel) ? "Expand" : item.ExpandAriaLabel;
}
internal async System.Threading.Tasks.Task SelectItem(RadzenAccordionItem item, bool? value = null)
{
await CollapseAll(item);
var itemIndex = items.IndexOf(item);
if (!expandedIdexes.Contains(itemIndex))
var selected = item.GetSelected();
if (selected)
{
expandedIdexes.Add(itemIndex);
await Expand.InvokeAsync(itemIndex);
await Collapse.InvokeAsync(itemIndex);
}
else
{
expandedIdexes.Remove(itemIndex);
await Collapse.InvokeAsync(itemIndex);
await Expand.InvokeAsync(itemIndex);
}
item.SetSelected(value ?? !selected);
if (!Multiple)
{
SelectedIndex = itemIndex;
await SelectedIndexChanged.InvokeAsync(itemIndex);
}
StateHasChanged();
@@ -160,14 +194,60 @@ namespace Radzen.Blazor
{
foreach (var i in items.Where(i => i != item))
{
var itemIndex = items.IndexOf(i);
if (expandedIdexes.Contains(itemIndex))
if (i.GetSelected())
{
expandedIdexes.Remove(itemIndex);
i.SetSelected(false);
await Collapse.InvokeAsync(items.IndexOf(i));
}
}
}
}
internal int focusedIndex = -1;
bool preventKeyPress = true;
async Task OnKeyPress(KeyboardEventArgs args)
{
var key = args.Code != null ? args.Code : args.Key;
if (key == "ArrowUp" || key == "ArrowDown")
{
preventKeyPress = true;
focusedIndex = Math.Clamp(focusedIndex + (key == "ArrowUp" ? -1 : 1), 0, items.Count - 1);
}
else if (key == "Space" || key == "Enter")
{
preventKeyPress = true;
if (focusedIndex >= 0 && focusedIndex < items.Count)
{
await SelectItem(items.Where(i => i.Visible).ElementAt(focusedIndex));
}
}
else
{
preventKeyPress = false;
}
}
internal bool IsFocused(RadzenAccordionItem item)
{
return items.Where(i => i.Visible).ToList().IndexOf(item) == focusedIndex && focusedIndex != -1;
}
/// <inheritdoc />
public override async Task SetParametersAsync(ParameterView parameters)
{
if (parameters.DidParameterChange(nameof(SelectedIndex), SelectedIndex))
{
var item = items.Where(i => i.Visible).ElementAtOrDefault(parameters.GetValueOrDefault<int>(nameof(SelectedIndex)));
if (item != null && !item.GetSelected())
{
await SelectItem(item);
}
}
await base.SetParametersAsync(parameters);
}
}
}

View File

@@ -22,6 +22,13 @@ namespace Radzen.Blazor
[Parameter]
public string Icon { get; set; }
/// <summary>
/// Gets or sets the icon color.
/// </summary>
/// <value>The icon color.</value>
[Parameter]
public string IconColor { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="RadzenAccordionItem"/> is selected.
/// </summary>
@@ -29,6 +36,34 @@ namespace Radzen.Blazor
[Parameter]
public bool Selected { get; set; }
/// <summary>
/// Gets or sets the title attribute of the expand button.
/// </summary>
/// <value>The title attribute value of the expand button.</value>
[Parameter]
public string ExpandTitle { get; set; }
/// <summary>
/// Gets or sets the title attribute of the collapse button.
/// </summary>
/// <value>The title attribute value of the collapse button.</value>
[Parameter]
public string CollapseTitle { get; set; }
/// <summary>
/// Gets or sets the aria-label attribute of the expand button.
/// </summary>
/// <value>The aria-label attribute value of the expand button.</value>
[Parameter]
public string ExpandAriaLabel { get; set; }
/// <summary>
/// Gets or sets the aria-label attribute of the collapse button.
/// </summary>
/// <value>The aria-label attribute value of the collapse button.</value>
[Parameter]
public string CollapseAriaLabel { get; set; }
/// <summary>
/// Gets or sets the child content.
/// </summary>
@@ -36,6 +71,12 @@ namespace Radzen.Blazor
[Parameter]
public RenderFragment ChildContent { get; set; }
/// <summary>
/// Gets or sets the header content.
/// </summary>
/// <value>The header content.</value>
[Parameter]
public RenderFragment Template { get; set; }
bool _visible = true;
/// <summary>
@@ -85,6 +126,17 @@ namespace Radzen.Blazor
}
}
bool? selected;
internal bool GetSelected()
{
return selected ?? Selected;
}
internal void SetSelected(bool? value)
{
selected = value;
}
/// <summary>
/// Set parameters as an asynchronous operation.
/// </summary>
@@ -94,7 +146,7 @@ namespace Radzen.Blazor
{
if (parameters.DidParameterChange(nameof(Selected), Selected))
{
Accordion?.SelectItem(this);
Accordion?.SelectItem(this, parameters.GetValueOrDefault<bool>(nameof(Selected)));
}
await base.SetParametersAsync(parameters);
@@ -117,7 +169,7 @@ namespace Radzen.Blazor
internal string GetItemCssClass()
{
return GetCssClass();
return $"{GetCssClass()} {(Accordion.IsFocused(this) ? "rz-state-focused" : "")}".Trim();
}
/// <inheritdoc />

View File

@@ -1,81 +1,32 @@
@inherits RadzenComponentWithChildren
@if (GetVisible())
@if (visible)
{
<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" />
<RadzenIcon Icon="@GetIcon()" IconColor="@IconColor" class="rz-alert-icon" />
}
<div class="rz-alert-message">
@if (!string.IsNullOrEmpty(Title))
{
@if (!string.IsNullOrEmpty(Title))
{
<div class="rz-alert-title">@Title</div>
}
<div class="rz-alert-content">@ChildContent</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()" />
}
}
<RadzenButton Click=@OnClose Icon="close" Variant="Variant.Text" ButtonStyle="@GetCloseButtonStyle()" Shade="@GetCloseButtonShade()" Size="@GetCloseButtonSize()" />
}
</div>
}

View File

@@ -19,11 +19,11 @@ namespace Radzen.Blazor
/// </example>
public partial class RadzenAlert : RadzenComponentWithChildren
{
private string getAlertSize()
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>
@@ -45,6 +45,13 @@ namespace Radzen.Blazor
[Parameter]
public string Title { get; set; }
/// <summary>
/// Gets or sets the text of the alert. Overriden by <see cref="RadzenComponentWithChildren.ChildContent" />.
/// </summary>
/// <value>The title.</value>
[Parameter]
public string Text { get; set; }
/// <summary>
/// Gets or sets the icon.
/// </summary>
@@ -52,6 +59,13 @@ namespace Radzen.Blazor
[Parameter]
public string Icon { get; set; }
/// <summary>
/// Gets or sets the icon color.
/// </summary>
/// <value>The icon color.</value>
[Parameter]
public string IconColor { get; set; }
/// <summary>
/// Gets or sets the severity.
/// </summary>
@@ -80,72 +94,131 @@ namespace Radzen.Blazor
[Parameter]
public AlertSize Size { get; set; } = AlertSize.Medium;
ButtonSize getCloseButtonSize()
ButtonSize GetCloseButtonSize()
{
return Size == AlertSize.ExtraSmall ? ButtonSize.ExtraSmall : ButtonSize.Small;
}
bool? visible;
bool GetVisible()
Shade GetCloseButtonShade()
{
return visible ?? Visible;
if (Shade == Shade.Light || Shade == Shade.Lighter)
{
return Shade.Darker;
}
else
{
return Shade.Default;
}
}
ButtonStyle GetCloseButtonStyle()
{
if (Shade == Shade.Light || Shade == Shade.Lighter)
{
switch (AlertStyle)
{
case AlertStyle.Success:
return ButtonStyle.Success;
case AlertStyle.Danger:
return ButtonStyle.Danger;
case AlertStyle.Warning:
return ButtonStyle.Warning;
case AlertStyle.Info:
return ButtonStyle.Info;
case AlertStyle.Primary:
return ButtonStyle.Primary;
case AlertStyle.Secondary:
return ButtonStyle.Secondary;
case AlertStyle.Light:
case AlertStyle.Base:
return ButtonStyle.Dark;
default:
return ButtonStyle.Light;
}
}
else
{
switch (AlertStyle)
{
case AlertStyle.Light:
case AlertStyle.Base:
return ButtonStyle.Dark;
default:
return ButtonStyle.Light;
}
}
}
bool visible;
/// <inheritdoc />
protected override void OnInitialized()
{
base.OnInitialized();
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()}";
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()
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 "";
switch (AlertStyle)
{
case AlertStyle.Success:
return "check_circle";
case AlertStyle.Danger:
return "error";
case AlertStyle.Warning:
return "warning_amber";
case AlertStyle.Info:
return "info";
default:
return "lightbulb";
}
}
void Close()
async Task OnClose()
{
visible = false;
await VisibleChanged.InvokeAsync(false);
await Close.InvokeAsync(null);
}
/// <summary>
/// Gets or sets the callback which is invoked when the alert is shown or hidden.
/// </summary>
[Parameter]
public EventCallback<bool> VisibleChanged { get; set; }
/// <summary>
/// Gets or sets the callback which is invoked when the alert is closed by the user.
/// </summary>
[Parameter]
public EventCallback Close { get; set; }
/// <inheritdoc />
public override async Task SetParametersAsync(ParameterView parameters)
{
var visibleChanged = parameters.DidParameterChange(nameof(Visible), Visible);
await base.SetParametersAsync(parameters);
if (visibleChanged)
{
visible = Visible;
}
}
}
}

View File

@@ -0,0 +1,2 @@
@inherits RadzenComponent
<RadzenToggleButton Visible=@Visible @attributes=@Attributes Icon=@Icon Change=@OnChange Value=@value Variant="Variant" ButtonStyle="ButtonStyle" ToggleButtonStyle="ToggleButtonStyle" ToggleShade="ToggleShade" />

View File

@@ -0,0 +1,112 @@
using System;
using System.Diagnostics;
using Microsoft.AspNetCore.Components;
namespace Radzen.Blazor
{
/// <summary>
/// Dark or light theme switch. Requires <see cref="ThemeService" /> to be registered in the DI container.
/// </summary>
public partial class RadzenAppearanceToggle : RadzenComponent
{
[Inject]
private ThemeService ThemeService { get; set; }
/// <summary>
/// Gets or sets the switch button variant.
/// </summary>
/// <value>The switch button variant.</value>
[Parameter]
public Variant Variant { get; set; } = Variant.Text;
/// <summary>
/// Gets or sets the switch button style.
/// </summary>
/// <value>The switch button style.</value>
[Parameter]
public ButtonStyle ButtonStyle { get; set; } = ButtonStyle.Base;
/// <summary>
/// Gets or sets the switch button toggled shade.
/// </summary>
/// <value>The switch button toggled shade.</value>
[Parameter]
public Shade ToggleShade { get; set; } = Shade.Default;
/// <summary>
/// Gets or sets the switch button toggled style.
/// </summary>
/// <value>The switch button toggled style.</value>
[Parameter]
public ButtonStyle ToggleButtonStyle { get; set; } = ButtonStyle.Base;
/// <summary>
/// Gets or sets the light theme. Not set by default - the component uses the light version of the current theme.
/// </summary>
[Parameter]
public string LightTheme { get; set; }
/// <summary>
/// Gets or sets the dark theme. Not set by default - the component uses the dark version of the current theme.
/// </summary>
[Parameter]
public string DarkTheme { get; set; }
private string CurrentLightTheme => LightTheme ?? ThemeService.Theme?.ToLowerInvariant() switch
{
"dark" => "default",
"material-dark" => "material",
"fluent-dark" => "fluent",
"material3-dark" => "material3",
"software-dark" => "software",
"humanistic-dark" => "humanistic",
"standard-dark" => "standard",
_ => ThemeService.Theme,
};
private string CurrentDarkTheme => DarkTheme ?? ThemeService.Theme?.ToLowerInvariant() switch
{
"default" => "dark",
"material" => "material-dark",
"fluent" => "fluent-dark",
"material3" => "material3-dark",
"software" => "software-dark",
"humanistic" => "humanistic-dark",
"standard" => "standard-dark",
_ => ThemeService.Theme,
};
private bool value;
/// <inheritdoc />
protected override void OnInitialized()
{
base.OnInitialized();
ThemeService.ThemeChanged += OnThemeChanged;
value = ThemeService.Theme != CurrentDarkTheme;
}
private void OnThemeChanged()
{
value = ThemeService.Theme != CurrentDarkTheme;
StateHasChanged();
}
void OnChange(bool value)
{
ThemeService.SetTheme(value ? CurrentLightTheme : CurrentDarkTheme);
}
private string Icon => value ? "dark_mode" : "light_mode";
/// <inheritdoc />
public override void Dispose()
{
base.Dispose();
ThemeService.ThemeChanged -= OnThemeChanged;
}
}
}

View File

@@ -14,19 +14,19 @@
var pathGenerator = GetPathGenerator();
var data = Items.Select(item =>
var data = Items.Select(item =>
{
var x = category(item);
var y = value(item);
return new Point { X = x, Y = y };
return new Point<TItem> { X = x, Y = y, Data = item };
});
var ticks = Chart.CategoryScale.Ticks(Chart.CategoryAxis.TickDistance);
var index = Chart.Series.IndexOf(this);
var className = $"rz-area-series rz-series-{index}";
return
return
@<g class="@className">
@if (Items.Any())
{
@@ -43,7 +43,7 @@
<path @key="@area" style="@style" d="@area" fill="@Fill" stroke="none"></path>
<Path @key="@line" D="@line" Stroke="@Stroke" StrokeWidth="@StrokeWidth" LineType="@LineType" Style="@style" Fill="none" />
}
<Markers Data="@Items" Category="@category" Value="@value" MarkerType="@MarkerType" Stroke="@Markers.Stroke" Fill="@(Markers.Fill ?? Stroke)" StrokeWidth="@Markers.StrokeWidth" Size="@Markers.Size" />
<Markers Visible="@Markers.Visible" Series="@this" Data="@data" MarkerType="@MarkerType" Stroke="@Markers.Stroke" Fill="@(Markers.Fill ?? Stroke)" StrokeWidth="@Markers.StrokeWidth" Size="@Markers.Size" />
</g>;
}
}

View File

@@ -49,7 +49,7 @@ namespace Radzen.Blazor
}
/// <summary>
/// Specifies how to render lines between data points. Set to <see cref="Line"/> by default
/// Specifies how to render lines between data points. Set to <see cref="Interpolation.Line"/> by default
/// </summary>
[Parameter]
public Interpolation Interpolation { get; set; } = Interpolation.Line;

View File

@@ -1,7 +1,6 @@
@using Radzen
@using Radzen.Blazor.Rendering
@using System.Collections
@using System.Linq.Dynamic.Core
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.JSInterop
@@ -12,19 +11,19 @@
<div @ref="@Element" style="@($"{Style};display:inline-block;")" @attributes="Attributes" class="@GetCssClass()" id="@GetId()">
@if (Multiline)
{
<textarea @ref="@search" @onkeydown="@OnFilterKeyPress" value="@Value" disabled="@Disabled"
oninput="@OpenScript()" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onchange="@OnChange"
<textarea @ref="@search" @attributes="InputAttributes" @onkeydown="@OnFilterKeyPress" value="@Value" disabled="@Disabled"
oninput="@OpenScript()" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onchange="@OnChange" onfocus="@(OpenOnFocus ? OpenScript() : null)"
aria-autocomplete="list" aria-haspopup="true" autocomplete="off" role="combobox"
class="@InputClassList"
id="@Name" aria-expanded="true" placeholder="@Placeholder" />
class="@InputClassList" onblur="Radzen.activeElement = null"
id="@Name" aria-expanded="true" placeholder="@CurrentPlaceholder" maxlength="@MaxLength" />
}
else
{
<input @ref="@search" @onkeydown="@OnFilterKeyPress" value="@Value" disabled="@Disabled"
oninput="@OpenScript()" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onchange="@OnChange"
<input @ref="@search" @attributes="InputAttributes" @onkeydown="@OnFilterKeyPress" value="@Value" disabled="@Disabled"
oninput="@OpenScript()" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" @onchange="@OnChange" onfocus="@(OpenOnFocus ? OpenScript() : null)"
aria-autocomplete="list" aria-haspopup="true" autocomplete="off" role="combobox"
class="@InputClassList"
type="text" id="@Name" aria-expanded="true" placeholder="@Placeholder" />
class="@InputClassList" onblur="Radzen.activeElement = null"
type="@InputType" id="@Name" aria-expanded="true" placeholder="@CurrentPlaceholder" maxlength="@MaxLength" />
}
<div id="@PopupID" class="rz-autocomplete-panel" style="@PopupStyle">
<ul @ref="@list" class="rz-autocomplete-items rz-autocomplete-list" role="listbox">

View File

@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Components.Web;
using System.Linq;
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Radzen.Blazor
{
@@ -22,6 +23,13 @@ namespace Radzen.Blazor
/// </example>
public partial class RadzenAutoComplete : DataBoundFormComponent<string>
{
/// <summary>
/// Specifies additional custom attributes that will be rendered by the input.
/// </summary>
/// <value>The attributes.</value>
[Parameter]
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="RadzenAutoComplete"/> is multiline.
/// </summary>
@@ -29,6 +37,13 @@ namespace Radzen.Blazor
[Parameter]
public bool Multiline { get; set; }
/// <summary>
/// Gets or sets a value indicating whether popup should open on focus. Set to <c>false</c> by default.
/// </summary>
/// <value><c>true</c> if popup should open on focus; otherwise, <c>false</c>.</value>
[Parameter]
public bool OpenOnFocus { get; set; }
/// <summary>
/// Gets or sets the Popup height.
/// </summary>
@@ -57,6 +72,23 @@ namespace Radzen.Blazor
[Parameter]
public int FilterDelay { get; set; } = 500;
/// <summary>
/// Gets or sets the underlying input type.
/// </summary>
/// <remarks>
/// This does not apply when <see cref="Multiline"/> is <c>true</c>.
/// </remarks>
/// <value>The input type.</value>
[Parameter]
public string InputType { get; set; } = "text";
/// <summary>
/// Gets or sets the underlying max length.
/// </summary>
/// <value>The max length value.</value>
[Parameter]
public long? MaxLength { get; set; }
/// <summary>
/// Gets search input reference.
/// </summary>
@@ -91,15 +123,20 @@ namespace Radzen.Blazor
//
}
}
else if (key == "Enter")
else if (key == "Enter" || key == "Tab")
{
if (selectedIndex >= 0 && selectedIndex <= items.Count() - 1)
{
await OnSelectItem(items.ElementAt(selectedIndex));
selectedIndex = -1;
}
if (key == "Tab")
{
await JSRuntime.InvokeVoidAsync("Radzen.closePopup", PopupID);
}
}
else if (key == "Escape" || key == "Tab")
else if (key == "Escape")
{
await JSRuntime.InvokeVoidAsync("Radzen.closePopup", PopupID);
}
@@ -115,8 +152,13 @@ namespace Radzen.Blazor
{
var value = await JSRuntime.InvokeAsync<string>("Radzen.getInputValue", search);
value = $"{value}";
if (value.Length < MinLength)
{
await JSRuntime.InvokeVoidAsync("Radzen.closePopup", PopupID);
return;
}
if (!LoadData.HasDelegate)
{
@@ -171,7 +213,7 @@ namespace Radzen.Blazor
string textProperty = string.IsNullOrEmpty(TextProperty) ? string.Empty : $".{TextProperty}";
return Query.Where($"o=>o{textProperty}{filterCaseSensitivityOperator}.{Enum.GetName(typeof(StringFilterOperator), FilterOperator)}(@0)",
return Query.Where(DynamicLinqCustomTypeProvider.ParsingConfig, $"o=>o{textProperty}{filterCaseSensitivityOperator}.{Enum.GetName(typeof(StringFilterOperator), FilterOperator)}(@0)",
FilterCaseSensitivity == FilterCaseSensitivity.CaseInsensitive ? searchText.ToLower() : searchText);
}
@@ -272,5 +314,13 @@ namespace Radzen.Blazor
await JSRuntime.InvokeVoidAsync("Radzen.destroyPopup", PopupID);
}
}
/// <summary>
/// Sets the focus on the input element.
/// </summary>
public override async ValueTask FocusAsync()
{
await search.FocusAsync();
}
}
}

View File

@@ -10,8 +10,8 @@
</CascadingValue>
@code {
public override RenderFragment Render(ScaleBase categoryScale, ScaleBase valueScale)
{
public override RenderFragment Render(ScaleBase categoryScale, ScaleBase valueScale)
{
var value = ComposeValue(categoryScale);
var category = ComposeCategory(valueScale);
var ticks = Chart.CategoryScale.Ticks(Chart.ValueAxis.TickDistance);
@@ -26,15 +26,17 @@
var height = barHeight / barSeries.Count() - padding + padding / barSeries.Count();;
var className = $"rz-bar-series rz-series-{Chart.Series.IndexOf(this)}";
return
return
@<g class="@className">
@foreach(var data in Items)
{
var y = category(data) - barHeight / 2 + index * height + index * padding;
var x = value(data);
var itemValue = Value(data);
var radius = Chart.BarOptions.Radius;
var width = Math.Abs(x0 - x);
if (radius > height / 2)
if (radius > height / 2 || radius > width)
{
radius = 0;
}
@@ -47,11 +49,11 @@
{
path = $"M {x0.ToInvariantString()} {y.ToInvariantString()} L {(x+radius).ToInvariantString()} {y.ToInvariantString()} A {r} {r} 0 0 0 {x.ToInvariantString()} {(y+radius).ToInvariantString()} L {x.ToInvariantString()} {(y+height-radius).ToInvariantString()} A {r} {r} 0 0 0 {(x+radius).ToInvariantString()} {(y + height).ToInvariantString()} L {x0.ToInvariantString()} {(y+height).ToInvariantString()} Z";
}
var fill = PickColor(Items.IndexOf(data), Fills, Fill);
var stroke = PickColor(Items.IndexOf(data), Strokes, Stroke);
var fill = PickColor(Items.IndexOf(data), Fills, Fill, FillRange, itemValue);
var stroke = PickColor(Items.IndexOf(data), Strokes, Stroke, StrokeRange, itemValue);
<Path @key="@path" D="@path" Stroke="@stroke" StrokeWidth="@StrokeWidth" Fill="@fill" LineType="@LineType" Style="@style" />
}
</g>;
}
}
}

View File

@@ -54,6 +54,20 @@ namespace Radzen.Blazor
[Parameter]
public LineType LineType { get; set; }
/// <summary>
/// Gets or sets the color range of the fill.
/// </summary>
/// <value>The color range of the fill.</value>
[Parameter]
public IList<SeriesColorRange> FillRange { get; set; }
/// <summary>
/// Gets or sets the color range of the stroke.
/// </summary>
/// <value>The color range of the stroke.</value>
[Parameter]
public IList<SeriesColorRange> StrokeRange { get; set; }
/// <inheritdoc />
public override string Color
{
@@ -106,7 +120,7 @@ namespace Radzen.Blazor
if (index >= 0)
{
var color = PickColor(index, Fills, Fill);
var color = PickColor(index, Fills, Fill, FillRange, Value(item));
if (color != null)
{
@@ -147,7 +161,7 @@ namespace Radzen.Blazor
/// <inheritdoc />
public override bool Contains(double x, double y, double tolerance)
{
return DataAt(x, y) != null;
return DataAt(x, y).Item1 != null;
}
/// <inheritdoc />
@@ -173,7 +187,7 @@ namespace Radzen.Blazor
}
/// <inheritdoc />
public override object DataAt(double x, double y)
public override (object, Point) DataAt(double x, double y)
{
var value = ComposeValue(Chart.CategoryScale);
var category = ComposeCategory(Chart.ValueScale);
@@ -196,11 +210,11 @@ namespace Radzen.Blazor
if (startX <= x && x <= endX && startY <= y && y <= endY)
{
return data;
return (data, new Point() { X = x, Y = y });
}
}
return null;
return (null, null);
}
/// <inheritdoc />
@@ -221,13 +235,17 @@ namespace Radzen.Blazor
public override IEnumerable<ChartDataLabel> GetDataLabels(double offsetX, double offsetY)
{
var list = new List<ChartDataLabel>();
(string Anchor, int Sign) position;
foreach (var d in Data)
{
list.Add(new ChartDataLabel
{
Position = new Point() { X = TooltipX(d) + offsetX + 8, Y = TooltipY(d) + offsetY },
TextAnchor = "start",
position = Value(d) < 0 ? ("end", -1) : Value(d) == 0 ? ("middle", 0) : ("start", 1);
list.Add(new ChartDataLabel
{
Position = new Point() { X = TooltipX(d) + offsetX + (8 * position.Sign), Y = TooltipY(d) + offsetY },
TextAnchor = position.Anchor,
Text = Chart.ValueAxis.Format(Chart.CategoryScale, Value(d))
});
}
@@ -235,4 +253,4 @@ namespace Radzen.Blazor
return list;
}
}
}
}

View File

@@ -4,6 +4,8 @@ using Radzen.Blazor.Rendering;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.JSInterop;
using System.Threading;
using System.Runtime.ExceptionServices;
namespace Radzen.Blazor
{
@@ -25,9 +27,8 @@ namespace Radzen.Blazor
protected override string GetComponentCssClass()
{
var classList = ClassList.Create("rz-body")
.Add("body")
.Add("body-expanded", Expanded);
.Add("rz-body-expanded", Expanded);
return classList.ToString();
}
@@ -111,7 +112,7 @@ namespace Radzen.Blazor
{
if (IsJSRuntimeAvailable && Layout != null)
{
JSRuntime.InvokeVoidAsync("eval", $"document.getElementById('{GetId()}').scrollTop = 0");
JSRuntime.InvokeVoidAsync("eval", $"try{{document.getElementById('{GetId()}').scrollTop = 0}}catch(e){{}}");
}
}

View File

@@ -15,15 +15,15 @@
{
@if (!string.IsNullOrWhiteSpace(Path))
{
<RadzenLink Icon="@Icon" Path="@Path" Text="@Text" />
<RadzenLink Icon="@Icon" IconColor="@IconColor" Path="@Path" Text="@Text" />
}
else
{
@if (!string.IsNullOrWhiteSpace(Icon))
{
<RadzenIcon Icon="@Icon" />
<RadzenIcon Icon="@Icon" IconColor="@IconColor" />
}
<RadzenLabel Text="@Text" />
<span class="rz-label">@Text</span>
}
}
</div>

View File

@@ -31,6 +31,13 @@ namespace Radzen.Blazor
[Parameter]
public string Icon { get; set; }
/// <summary>
/// Gets or sets the icon color.
/// </summary>
/// <value>The icon color.</value>
[Parameter]
public string IconColor { get; set; }
/// <summary>
/// Template Parameter used only for this Item
/// Note: this overrides the <see cref="Template"/> Cascading Parameter

View File

@@ -2,7 +2,7 @@
@if (Visible)
{
<button @ref="@Element" style="@Style" disabled="@IsDisabled"
<button @ref="@Element" style="@Style" disabled="@IsDisabled" tabindex="@(Disabled ? -1 : TabIndex)"
type="@Enum.GetName(typeof(ButtonType), ButtonType).ToLower()"
@attributes="Attributes" class="@GetCssClass()" id="@GetId()"
@onclick="@OnClick">
@@ -25,11 +25,11 @@
{
@if (!string.IsNullOrEmpty(@Icon))
{
<i class="rz-button-icon-left rzi">@((MarkupString)Icon)</i>
<i class="notranslate rz-button-icon-left rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@((MarkupString)Icon)</i>
}
@if (!string.IsNullOrEmpty(Image))
{
<img class="rz-button-icon-left rzi" src="@Image" />
<img class="notranslate rz-button-icon-left rzi" src="@Image" alt="@ImageAlternateText" />
}
@if (!string.IsNullOrEmpty(Text))
{

View File

@@ -15,7 +15,7 @@ namespace Radzen.Blazor
/// </example>
public partial class RadzenButton : RadzenComponent
{
private string getButtonSize()
internal string getButtonSize()
{
return Size == ButtonSize.Medium ? "md" : Size == ButtonSize.Large ? "lg" : Size == ButtonSize.Small ? "sm" : "xs";
}
@@ -27,6 +27,13 @@ namespace Radzen.Blazor
[Parameter]
public RenderFragment ChildContent { get; set; }
/// <summary>
/// Gets or sets the index of the tab.
/// </summary>
/// <value>The index of the tab.</value>
[Parameter]
public int TabIndex { get; set; } = 0;
/// <summary>
/// Gets or sets the text.
/// </summary>
@@ -34,6 +41,13 @@ namespace Radzen.Blazor
[Parameter]
public string Text { get; set; } = "";
/// <summary>
/// Gets or sets the text.
/// </summary>
/// <value>The text.</value>
[Parameter]
public string ImageAlternateText { get; set; } = "button";
/// <summary>
/// Gets or sets the icon.
/// </summary>
@@ -41,6 +55,13 @@ namespace Radzen.Blazor
[Parameter]
public string Icon { get; set; }
/// <summary>
/// Gets or sets the icon color.
/// </summary>
/// <value>The icon color.</value>
[Parameter]
public string IconColor { get; set; }
/// <summary>
/// Gets or sets the image.
/// </summary>
@@ -123,7 +144,7 @@ namespace Radzen.Blazor
/// Handles the <see cref="E:Click" /> event.
/// </summary>
/// <param name="args">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
public async Task OnClick(MouseEventArgs args)
public virtual async Task OnClick(MouseEventArgs args)
{
if (clicking)
{

View File

@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Components.Web;
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Radzen.Blazor
{
@@ -13,7 +14,18 @@ namespace Radzen.Blazor
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return "rz-card";
var classList = new List<string>();
classList.Add("rz-card");
classList.Add($"rz-variant-{Variant.ToString().ToLowerInvariant()}");
return string.Join(" ", classList);
}
/// <summary>
/// Gets or sets the card variant.
/// </summary>
/// <value>The card variant.</value>
[Parameter]
public Variant Variant { get; set; } = Variant.Filled;
}
}
}

View File

@@ -0,0 +1,40 @@
@inherits RadzenComponent
@using System.Linq
@using Microsoft.JSInterop
<CascadingValue Value=this>
@if (Visible)
{
<section @ref=@Element style=@Style @attributes=@Attributes class=@GetCssClass() id=@GetId() tabindex="0">
@if(AllowPaging && (PagerPosition == PagerPosition.Top || PagerPosition == PagerPosition.TopAndBottom))
{
<RadzenStack class="rz-carousel-pager rz-carousel-pager-top" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Center" Wrap="FlexWrap.Wrap">
@foreach (var item in items)
{
var index = items.IndexOf(item);
<a @onclick="@(args => Navigate(index))" class="rz-carousel-pager-button @(index == selectedIndex ? "rz-state-active" : "")"></a>
}
</RadzenStack>
}
@if(AllowNavigation)
{
<RadzenButton class="rz-carousel-prev" Icon="@PrevIcon" Text="@PrevText" ButtonStyle="@ButtonStyle" Size="@ButtonSize" Variant="@ButtonVariant" Shade="@ButtonShade"
Click=@Prev />
<RadzenButton class="rz-carousel-next" Icon="@NextIcon" Text="@NextText" ButtonStyle="@ButtonStyle" Size="@ButtonSize" Variant="@ButtonVariant" Shade="@ButtonShade"
Click=@Next/>
}
<ul class="rz-carousel-items">
@Items
</ul>
@if(AllowPaging && (PagerPosition == PagerPosition.Bottom || PagerPosition == PagerPosition.TopAndBottom))
{
<RadzenStack class="rz-carousel-pager rz-carousel-pager-bottom" Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.Center" Wrap="FlexWrap.Wrap">
@foreach (var item in items)
{
var index = items.IndexOf(item);
<a @onclick="@(args => Navigate(index))" class="rz-carousel-pager-button @(index == selectedIndex ? "rz-state-active" : "")"></a>
}
</RadzenStack>
}
</section>
}
</CascadingValue>

View File

@@ -0,0 +1,319 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.JSInterop;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
namespace Radzen.Blazor
{
/// <summary>
/// RadzenCarousel component.
/// </summary>
/// <example>
/// <code>
/// &lt;RadzenCarousel Change=@(args => Console.WriteLine($"Selected index is: {args}"))&gt;
/// &lt;Items&gt;
/// &lt;RadzenCarouselItem&gt;
/// Details for Orders
/// &lt;/RadzenCarouselItem&gt;
/// &lt;RadzenCarousel&gt;
/// Details for Employees
/// &lt;/RadzenCarouselItem&gt;
/// &lt;/Items&gt;
/// &lt;/RadzenCarousel&gt;
/// </code>
/// </example>
public partial class RadzenCarousel : RadzenComponent
{
/// <summary>
/// Gets or sets the items.
/// </summary>
/// <value>The items.</value>
[Parameter]
public RenderFragment Items { get; set; }
internal List<RadzenCarouselItem> items = new List<RadzenCarouselItem>();
/// <summary>
/// Adds the item.
/// </summary>
/// <param name="item">The item.</param>
public void AddItem(RadzenCarouselItem item)
{
if (!items.Contains(item))
{
items.Add(item);
StateHasChanged();
}
}
/// <summary>
/// Removes the item.
/// </summary>
/// <param name="item">The item.</param>
public void RemoveItem(RadzenCarouselItem item)
{
if (items.Contains(item))
{
items.Remove(item);
if (!disposed)
{
try { InvokeAsync(StateHasChanged); } catch { }
}
}
}
/// <inheritdoc />
protected override string GetComponentCssClass()
{
return $"rz-carousel {(AllowNavigation ? "" : "rz-carousel-no-navigation")} {(PagerOverlay ? "rz-carousel-pager-overlay" : "")}".Trim();
}
/// <summary>
/// Navigates to specific index.
/// </summary>
public async Task Navigate(int index)
{
if (Auto)
{
await Reset();
}
await GoTo(index);
}
async Task Prev()
{
await Navigate(selectedIndex == 0 ? items.Count - 1 : selectedIndex - 1);
}
async Task Next()
{
await Navigate(selectedIndex == items.Count - 1 ? 0 : selectedIndex + 1);
}
async Task GoTo(int index)
{
if (selectedIndex != index)
{
selectedIndex = index == items.Count ? 0 : index;
await SelectedIndexChanged.InvokeAsync(selectedIndex);
await Change.InvokeAsync(selectedIndex);
await JSRuntime.InvokeVoidAsync("Radzen.scrollCarouselItem", items[selectedIndex].element);
StateHasChanged();
}
}
/// <summary>
/// Stops the auto-cycle timer.
/// </summary>
public void Stop()
{
timer?.Change(Timeout.Infinite, Timeout.Infinite);
}
/// <summary>
/// Starts the auto-cycle timer.
/// </summary>
public void Start()
{
timer?.Change(TimeSpan.FromMilliseconds(Interval), TimeSpan.Zero);
}
/// <summary>
/// Resets the auto-cycle timer.
/// </summary>
public async Task Reset()
{
Stop();
Start();
await Task.CompletedTask;
}
/// <summary>
/// Gets or sets the selected index.
/// </summary>
/// <value>The selected index.</value>
[Parameter]
public int SelectedIndex { get; set; }
private int selectedIndex;
/// <summary>
/// Gets or sets the selected index changed callback.
/// </summary>
/// <value>The selected index changed callback.</value>
[Parameter]
public EventCallback<int> SelectedIndexChanged { get; set; }
/// <summary>
/// Gets or sets the change callback.
/// </summary>
/// <value>The change callback.</value>
[Parameter]
public EventCallback<int> Change { get; set; }
/// <inheritdoc />
public override async Task SetParametersAsync(ParameterView parameters)
{
var shouldUpdate = false;
if (parameters.DidParameterChange(nameof(SelectedIndex), SelectedIndex))
{
selectedIndex = parameters.GetValueOrDefault<int>(nameof(SelectedIndex));
shouldUpdate = true;
}
if (parameters.DidParameterChange(nameof(Auto), Auto) ||
parameters.DidParameterChange(nameof(Interval), Interval))
{
if (parameters.GetValueOrDefault<bool>(nameof(Auto)))
{
await Reset();
}
else
{
Stop();
}
}
await base.SetParametersAsync(parameters);
if (shouldUpdate)
{
await JSRuntime.InvokeVoidAsync("Radzen.scrollCarouselItem", items[selectedIndex].element);
}
}
/// <summary>
/// Gets or sets a value indicating whether this <see cref="RadzenCarousel"/> cycle is automatic.
/// </summary>
/// <value><c>true</c> if cycle automatic; otherwise, <c>false</c>.</value>
[Parameter]
public bool Auto { get; set; } = true;
/// <summary>
/// Gets or sets the auto-cycle interval in milliseconds.
/// </summary>
[Parameter]
public double Interval { get; set; } = 4000;
/// <summary>
/// Gets or sets the pager position. Set to <c>PagerPosition.Bottom</c> by default.
/// </summary>
/// <value>The pager position.</value>
[Parameter]
public PagerPosition PagerPosition { get; set; } = PagerPosition.Bottom;
/// <summary>
/// Gets or sets a value indicating whether pager overlays the carousel items. Set to <c>true</c> by default.
/// </summary>
/// <value><c>true</c> if pager overlay is allowed; otherwise, <c>false</c>.</value>
[Parameter]
public bool PagerOverlay { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether paging is allowed. Set to <c>true</c> by default.
/// </summary>
/// <value><c>true</c> if paging is allowed; otherwise, <c>false</c>.</value>
[Parameter]
public bool AllowPaging { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether previous/next navigation is allowed. Set to <c>true</c> by default.
/// </summary>
/// <value><c>true</c> if previous/next navigation is allowed; otherwise, <c>false</c>.</value>
[Parameter]
public bool AllowNavigation { get; set; } = true;
/// <summary>
/// Gets or sets the buttons style
/// </summary>
/// <value>The buttons style.</value>
[Parameter]
public ButtonStyle ButtonStyle { get; set; } = ButtonStyle.Base;
/// <summary>
/// Gets or sets the design variant of the buttons.
/// </summary>
/// <value>The variant of the buttons.</value>
[Parameter]
public Variant ButtonVariant { get; set; } = Variant.Text;
/// <summary>
/// Gets or sets the color shade of the buttons.
/// </summary>
/// <value>The color shade of the buttons.</value>
[Parameter]
public Shade ButtonShade { get; set; } = Shade.Lighter;
/// <summary>
/// Gets or sets the buttons size.
/// </summary>
/// <value>The buttons size.</value>
[Parameter]
public ButtonSize ButtonSize { get; set; } = ButtonSize.Large;
/// <summary>
/// Gets or sets the next button text.
/// </summary>
/// <value>The next button text.</value>
[Parameter]
public string NextText { get; set; } = "";
/// <summary>
/// Gets or sets the previous button text.
/// </summary>
/// <value>The previous button text.</value>
[Parameter]
public string PrevText { get; set; } = "";
/// <summary>
/// Gets or sets the next button icon.
/// </summary>
/// <value>The next button icon.</value>
[Parameter]
public string NextIcon { get; set; } = "arrow_forward_ios";
/// <summary>
/// Gets or sets the previous button icon.
/// </summary>
/// <value>The previous button icon.</value>
[Parameter]
public string PrevIcon { get; set; } = "arrow_back_ios_new";
System.Threading.Timer timer;
/// <inheritdoc />
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnAfterRenderAsync(firstRender);
if (firstRender)
{
var ts = TimeSpan.FromMilliseconds(Interval);
timer = new System.Threading.Timer(state => InvokeAsync(() => GoTo(selectedIndex + 1)),
null, Auto ? ts : Timeout.InfiniteTimeSpan, ts);
}
}
/// <inheritdoc />
public override void Dispose()
{
base.Dispose();
if (timer != null)
{
timer.Dispose();
timer = null;
}
}
}
}

View File

@@ -0,0 +1,8 @@
@using Microsoft.JSInterop
@implements IDisposable
@inject IJSRuntime JSRuntime
<li @ref="element" @attributes=@Attributes class=@ClassList tabindex="0">
@ChildContent
<div class="rz-carousel-snapper"></div>
</li>

View File

@@ -0,0 +1,63 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using Radzen.Blazor.Rendering;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Radzen.Blazor
{
/// <summary>
/// RadzenCarouselItem component.
/// </summary>
public partial class RadzenCarouselItem : IDisposable
{
/// <summary>
/// Gets the class list.
/// </summary>
/// <value>The class list.</value>
ClassList ClassList => ClassList.Create()
.Add("rz-carousel-item")
.Add(Attributes);
/// <summary>
/// Gets or sets the arbitrary attributes.
/// </summary>
/// <value>The arbitrary attributes.</value>
[Parameter(CaptureUnmatchedValues = true)]
public IDictionary<string, object> Attributes { get; set; }
/// <summary>
/// Gets or sets the child content.
/// </summary>
/// <value>The child content.</value>
[Parameter]
public RenderFragment ChildContent { get; set; }
/// <summary>
/// Gets or sets the tabs.
/// </summary>
/// <value>The tabs.</value>
[CascadingParameter]
public RadzenCarousel Carousel { get; set; }
/// <inheritdoc />
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
Carousel.AddItem(this);
itemIndex = Carousel.items.IndexOf(this);
}
/// <inheritdoc />
public void Dispose()
{
Carousel?.RemoveItem(this);
}
int itemIndex;
internal ElementReference element;
}
}

View File

@@ -38,10 +38,13 @@
@donut.RenderTitle(MarginLeft, MarginTop)
}
}
@if (tooltip != null)
{
@tooltip
}
<ChartTooltipContainer @ref="@chartTooltipContainer">
@if (tooltip != null)
{
@tooltip
}
</ChartTooltipContainer>
</CascadingValue>
}
</div>

View File

@@ -42,27 +42,46 @@ namespace Radzen.Blazor
public ColorScheme ColorScheme { get; set; }
/// <summary>
/// A callback that will be invoked when the user clicks on a series.
/// A callback that will be invoked when the user clicks on a series.
/// </summary>
[Parameter]
public EventCallback<SeriesClickEventArgs> SeriesClick { get; set; }
/// <summary>
/// A callback that will be invoked when the user clicks on a legend.
/// 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; }
/// <summary>
/// Gets the runtime width of the chart.
/// </summary>
protected double? Width { get; set; }
double MarginTop { get; set; }
/// <summary>
/// Gets the runtime height of the chart.
/// </summary>
protected double? Height { get; set; }
double MarginLeft { get; set; }
/// <summary>
/// Gets or sets the top margin of the plot area.
/// </summary>
protected double MarginTop { get; set; }
double MarginRight { get; set; }
/// <summary>
/// Gets or sets the left margin of the plot area.
/// </summary>
protected double MarginLeft { get; set; }
double MarginBottom { get; set; }
/// <summary>
/// Gets or sets the right margin of the plot area.
/// </summary>
protected double MarginRight { get; set; }
/// <summary>
/// Gets or sets the bottom margin of the plot area.
/// </summary>
protected double MarginBottom { get; set; }
/// <summary>
/// Gets or sets the child content. Used to specify series and other configuration.
@@ -93,7 +112,11 @@ namespace Radzen.Blazor
Series.Remove(series);
}
private bool ShouldRenderAxes()
/// <summary>
/// Returns whether the chart should render axes.
/// </summary>
/// <returns></returns>
protected bool ShouldRenderAxes()
{
var pieType = typeof(RadzenPieSeries<>);
var donutType = typeof(RadzenDonutSeries<>);
@@ -111,7 +134,11 @@ namespace Radzen.Blazor
return Series.Count > 0 && Series.All(series => series is IChartBarSeries);
}
private bool UpdateScales()
/// <summary>
/// Updates the scales based on the configuration.
/// </summary>
/// <returns></returns>
protected virtual bool UpdateScales()
{
var valueScale = ValueScale;
var categoryScale = CategoryScale;
@@ -207,12 +234,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))
{
@@ -254,6 +276,7 @@ namespace Radzen.Blazor
}
}
ChartTooltipContainer chartTooltipContainer;
RenderFragment tooltip;
object tooltipData;
double mouseX;
@@ -273,6 +296,18 @@ namespace Radzen.Blazor
await DisplayTooltip();
}
/// <summary>
/// The minimum pixel distance from a data point to the mouse cursor required for the SeriesClick event to fire. Set to 25 by default.
/// </summary>
[Parameter]
public int ClickTolerance { get; set; } = 25;
/// <summary>
/// The minimum pixel distance from a data point to the mouse cursor required by the tooltip to show. Set to 25 by default.
/// </summary>
[Parameter]
public int TooltipTolerance { get; set; } = 25;
/// <summary>
/// Invoked via interop when the user clicks the RadzenChart. Raises the <see cref="SeriesClick" /> handler.
/// </summary>
@@ -281,20 +316,37 @@ namespace Radzen.Blazor
[JSInvokable]
public async Task Click(double x, double y)
{
IChartSeries closestSeries = null;
object closestSeriesData = null;
double closestSeriesDistanceSquared = ClickTolerance * ClickTolerance;
var queryX = x - MarginLeft;
var queryY = y - MarginTop;
foreach (var series in Series)
{
if (series.Visible && series.Contains(mouseX - MarginLeft, mouseY - MarginTop, 5))
if (series.Visible)
{
var data = series.DataAt(mouseX - MarginLeft, mouseY - MarginTop);
if (data != null)
var (seriesData, seriesDataPoint) = series.DataAt(queryX, queryY);
if (seriesData != null)
{
await series.InvokeClick(SeriesClick, data);
double xDelta = queryX - seriesDataPoint.X;
double yDelta = queryY - seriesDataPoint.Y;
double squaredDistance = xDelta * xDelta + yDelta * yDelta;
if (squaredDistance < closestSeriesDistanceSquared)
{
closestSeries = series;
closestSeriesData = seriesData;
closestSeriesDistanceSquared = squaredDistance;
}
}
return;
}
}
if (closestSeriesData != null)
{
await closestSeries.InvokeClick(SeriesClick, closestSeriesData);
}
}
internal async Task DisplayTooltip()
@@ -302,6 +354,12 @@ namespace Radzen.Blazor
if (Tooltip.Visible)
{
var orderedSeries = Series.OrderBy(s => s.RenderingOrder).Reverse();
IChartSeries closestSeries = null;
object closestSeriesData = null;
double closestSeriesDistanceSquared = TooltipTolerance * TooltipTolerance;
var queryX = mouseX - MarginLeft;
var queryY = mouseY - MarginTop;
foreach (var series in orderedSeries)
{
@@ -309,40 +367,51 @@ namespace Radzen.Blazor
{
foreach (var overlay in series.Overlays.Reverse())
{
if (overlay.Visible && overlay.Contains(mouseX - MarginLeft, mouseY - MarginTop, 25))
if (overlay.Visible && overlay.Contains(mouseX - MarginLeft, mouseY - MarginTop, TooltipTolerance))
{
tooltipData = null;
tooltip = overlay.RenderTooltip(mouseX, mouseY, MarginLeft, MarginTop);
StateHasChanged();
chartTooltipContainer.Refresh();
await Task.Yield();
return;
}
}
if (series.Contains(mouseX - MarginLeft, mouseY - MarginTop, 25))
var (seriesData, seriesDataPoint) = series.DataAt(queryX, queryY);
if (seriesData != null)
{
var data = series.DataAt(mouseX - MarginLeft, mouseY - MarginTop);
if (data != tooltipData)
double xDelta = queryX - seriesDataPoint.X;
double yDelta = queryY - seriesDataPoint.Y;
double squaredDistance = xDelta * xDelta + yDelta * yDelta;
if (squaredDistance < closestSeriesDistanceSquared)
{
tooltipData = data;
tooltip = series.RenderTooltip(data, MarginLeft, MarginTop);
StateHasChanged();
await Task.Yield();
closestSeries = series;
closestSeriesData = seriesData;
closestSeriesDistanceSquared = squaredDistance;
}
return;
}
}
}
if (closestSeriesData != null)
{
if (closestSeriesData != tooltipData)
{
tooltipData = closestSeriesData;
tooltip = closestSeries.RenderTooltip(closestSeriesData, MarginLeft, MarginTop, Height ?? 0);
chartTooltipContainer.Refresh();
await Task.Yield();
}
return;
}
if (tooltip != null)
{
tooltipData = null;
tooltip = null;
StateHasChanged();
chartTooltipContainer.Refresh();
await Task.Yield();
}
}

View File

@@ -8,7 +8,7 @@ namespace Radzen.Blazor
public partial class RadzenChartTooltipOptions : RadzenChartComponentBase
{
/// <summary>
/// Gets or sets a value indicating whether to show tooltips. By defaults RadzenChart displays tooltips.
/// Gets or sets a value indicating whether to show tooltips. By default RadzenChart displays tooltips.
/// </summary>
/// <value><c>true</c> to display tooltips; otherwise, <c>false</c>.</value>
[Parameter]
@@ -21,6 +21,12 @@ namespace Radzen.Blazor
[Parameter]
public string Style { get; set; }
/// <summary>
/// Enable or disable shared tooltips (one tooltip displaying data for all values for the same category). By default set to false (a separate tooltip is shown for each point in the category).
/// </summary>
[Parameter]
public bool Shared { get; set; }
/// <inheritdoc />
protected override void Initialize()
{

View File

@@ -5,10 +5,10 @@
@inherits FormComponent<TValue>
@if (Visible)
{
<div @ref="@Element" @attributes="Attributes" class="@GetCssClass()" @onkeypress=@OnKeyPress @onkeypress:preventDefault style="@Style" tabindex="@(Disabled ? "-1" : $"{TabIndex}")" id="@GetId()">
<div @ref="@Element" @attributes="Attributes" class="@GetCssClass()" @onkeypress=@OnKeyPress @onkeypress:preventDefault style="@Style" tabindex="@(Disabled || ReadOnly ? "-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">
<input type="checkbox" @onchange=@Toggle value=@CheckBoxValue name=@Name id=@Name checked=@CheckBoxChecked aria-checked="@((Value as bool? == true).ToString().ToLowerInvariant())" @attributes="InputAttributes"
tabindex="-1" readonly="@ReadOnly">
</div>
<div class=@BoxClassList @onclick=@Toggle @onclick:preventDefault>
<span class=@IconClassList></span>

View File

@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Radzen.Blazor.Rendering;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Radzen.Blazor
@@ -16,6 +17,13 @@ namespace Radzen.Blazor
/// </example>
public partial class RadzenCheckBox<TValue> : FormComponent<TValue>
{
/// <summary>
/// Specifies additional custom attributes that will be rendered by the input.
/// </summary>
/// <value>The attributes.</value>
[Parameter]
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
/// <summary>
/// Gets or sets a value indicating whether is tri-state (true, false or null).
/// </summary>
@@ -27,7 +35,7 @@ namespace Radzen.Blazor
.Add("rz-state-active", !object.Equals(Value, false))
.AddDisabled(Disabled);
ClassList IconClassList => ClassList.Create("rz-chkbox-icon")
ClassList IconClassList => ClassList.Create("notranslate rz-chkbox-icon")
.Add("rzi rzi-check", object.Equals(Value, true))
.Add("rzi rzi-times", object.Equals(Value, null));
@@ -49,9 +57,16 @@ namespace Radzen.Blazor
}
}
/// <summary>
/// Gets or sets a value indicating whether is read only.
/// </summary>
/// <value><c>true</c> if is read only; otherwise, <c>false</c>.</value>
[Parameter]
public bool ReadOnly { get; set; }
async Task Toggle()
{
if (Disabled)
if (Disabled || ReadOnly)
{
return;
}

View File

@@ -18,22 +18,32 @@
@if (AllowSelectAll)
{
<div class="rz-multiselect-header rz-helper-clearfix" @onclick:preventDefault>
<RadzenCheckBox Name="SelectAll" TValue="bool?" Value="@IsAllSelected()" Change="@SelectAll" />
<RadzenCheckBox ReadOnly="@ReadOnly" Disabled="@Disabled" Name="SelectAll" TValue="bool?" Value="@IsAllSelected()" Change="@SelectAll"
InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", SelectAllText }})" />
<RadzenLabel Component="SelectAll" Text="@SelectAllText" class="rz-chkbox-label" />
</div>
}
@foreach (var item in allItems.Where(i => i.Visible))
{
<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-chkbox" @onkeypress="@(args => OnKeyPress(args, SelectItem(item)))" @onkeypress:preventDefault=preventKeyPress @onkeypress:stopPropagation tabindex="@(Disabled || ReadOnly || item.Disabled || item.ReadOnly ? "-1" : $"{TabIndex}")">
<div class="rz-helper-hidden-accessible">
<input type="checkbox" name="@Name" value="@item.Value" disabled="@Disabled" tabindex="-1">
<input type="checkbox" name="@Name" value="@item.Value" disabled="@Disabled" readonly="@ReadOnly" tabindex="-1" aria-label="@(item.Text + " " + item.Value)" aria-checked="@(IsSelected(item).ToString().ToLowerInvariant())">
</div>
<div class=@ItemClassList(item)>
<span class=@IconClassList(item)></span>
</div>
</div>
<label class="rz-chkbox-label">@item.Text</label>
@if (item.Template != null)
{
<div class="rz-chkbox-template" @onkeydown:stopPropagation>
@item.Template(item)
</div>
}
else
{
<label class="rz-chkbox-label" aria-hidden="true">@((MarkupString)item.Text)</label>
}
</div>
}
</div>

View File

@@ -30,7 +30,7 @@ namespace Radzen.Blazor
.AddDisabled(Disabled || item.Disabled);
ClassList IconClassList(RadzenCheckBoxListItem<TValue> item) => ClassList.Create("rz-chkbox-icon")
.Add("rzi rzi-check", IsSelected(item));
.Add("notranslate rzi rzi-check", IsSelected(item));
/// <summary>
/// Gets or sets the value property.
@@ -46,6 +46,20 @@ namespace Radzen.Blazor
[Parameter]
public string TextProperty { 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 read-only property.
/// </summary>
/// <value>The read-only property.</value>
[Parameter]
public string ReadOnlyProperty { get; set; }
IEnumerable<RadzenCheckBoxListItem<TValue>> allItems
{
get
@@ -55,6 +69,17 @@ namespace Radzen.Blazor
var item = new RadzenCheckBoxListItem<TValue>();
item.SetText((string)PropertyAccess.GetItemOrValueFromProperty(i, TextProperty));
item.SetValue((TValue)PropertyAccess.GetItemOrValueFromProperty(i, ValueProperty));
if (DisabledProperty != null && PropertyAccess.TryGetItemOrValueFromProperty<bool>(i, DisabledProperty, out var disabledResult))
{
item.SetDisabled(disabledResult);
}
if (ReadOnlyProperty != null && PropertyAccess.TryGetItemOrValueFromProperty<bool>(i, ReadOnlyProperty, out var readOnlyResult))
{
item.SetReadOnly(readOnlyResult);
}
return item;
}));
}
@@ -76,14 +101,14 @@ namespace Radzen.Blazor
async Task SelectAll(bool? value)
{
if (Disabled)
if (Disabled || ReadOnly)
{
return;
}
if (value == true)
{
Value = items.Select(i => i.Value);
Value = allItems.Where(i => !i.Disabled).Select(i => i.Value);
}
else if (value == false)
{
@@ -100,8 +125,8 @@ namespace Radzen.Blazor
bool? IsAllSelected()
{
Func<RadzenCheckBoxListItem<TValue>, bool> predicate = i => Value != null && Value.Contains(i.Value);
var all = items.All(predicate);
var any = items.Any(predicate);
var all = allItems.All(predicate);
var any = allItems.Any(predicate);
if (all)
{
@@ -114,6 +139,7 @@ namespace Radzen.Blazor
}
IEnumerable _data = null;
/// <summary>
/// Gets or sets the data used to generate items.
/// </summary>
@@ -135,6 +161,13 @@ namespace Radzen.Blazor
}
}
/// <summary>
/// Gets or sets a value indicating whether is read only.
/// </summary>
/// <value><c>true</c> if is read only; otherwise, <c>false</c>.</value>
[Parameter]
public bool ReadOnly { get; set; }
/// <inheritdoc />
protected override string GetComponentCssClass()
{
@@ -214,7 +247,7 @@ namespace Radzen.Blazor
/// <param name="item">The item.</param>
protected async System.Threading.Tasks.Task SelectItem(RadzenCheckBoxListItem<TValue> item)
{
if (Disabled || item.Disabled)
if (Disabled || item.Disabled || ReadOnly || item.ReadOnly)
return;
List<TValue> selectedValues = new List<TValue>(Value != null ? Value : Enumerable.Empty<TValue>());
@@ -237,9 +270,21 @@ namespace Radzen.Blazor
StateHasChanged();
}
private string getDisabledState(RadzenCheckBoxListItem<TValue> item)
bool preventKeyPress = true;
async Task OnKeyPress(KeyboardEventArgs args, Task task)
{
return Disabled || item.Disabled ? " rz-state-disabled" : "";
var key = args.Code != null ? args.Code : args.Key;
if (key == "Space" || key == "Enter")
{
preventKeyPress = true;
await task;
}
else
{
preventKeyPress = false;
}
}
}
}

View File

@@ -15,6 +15,13 @@ namespace Radzen.Blazor
[Parameter]
public string Text { get; set; }
/// <summary>
/// Gets or sets the template.
/// </summary>
/// <value>The template.</value>
[Parameter]
public RenderFragment<RadzenCheckBoxListItem<TValue>> Template { get; set; }
/// <summary>
/// Gets or sets the value.
/// </summary>
@@ -29,6 +36,13 @@ namespace Radzen.Blazor
[Parameter]
public virtual bool Disabled { get; set; }
/// <summary>
/// Gets or sets a value indicating whether is read only.
/// </summary>
/// <value><c>true</c> if is read only; otherwise, <c>false</c>.</value>
[Parameter]
public bool ReadOnly { get; set; }
RadzenCheckBoxList<TValue> _checkBoxList;
/// <summary>
@@ -70,6 +84,17 @@ namespace Radzen.Blazor
{
Value = value;
}
internal void SetDisabled(bool value)
{
Disabled = value;
}
internal void SetReadOnly(bool value)
{
ReadOnly = value;
}
internal string GetItemId()
{
return GetId();

View File

@@ -5,28 +5,31 @@
@if (Visible)
{
<div @ref=@Element style=@Style @onclick=@Toggle @attributes=@Attributes class=@GetCssClass() id=@GetId()>
@if(Icon != null)
<div @ref=@Element style=@Style @onclick=@Toggle @attributes=@Attributes class=@GetCssClass() id=@GetId() tabindex="@(Disabled ? -1 : TabIndex)" @onkeypress="@(args => OnKeyPress(args, Toggle()))" @onkeypress:preventDefault=preventKeyPress @onkeypress:stopPropagation>
@if (Icon != null)
{
<i class="rzi">@Icon</i>
<i class="notranslate rzi" style="@(!string.IsNullOrEmpty(IconColor) ? $"color:{IconColor}" : null)">@Icon</i>
}
<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 Lazy=@(PopupRenderMode == PopupRenderMode.OnDemand) @ref=@Popup class="rz-colorpicker-popup" Close=@Close Open=@Open>
<div class="rz-colorpicker-value" style="background-color: @Value" ></div>
<button aria-label="@ToggleAriaLabel" type="button" tabindex="-1" class="rz-colorpicker-trigger" disabled=@Disabled @onclick:preventDefault><i class="notranslate rzi" /></button>
<Popup Lazy=@(PopupRenderMode == PopupRenderMode.OnDemand) @ref=@Popup class="rz-colorpicker-popup" Close=@OnClosePopup Open=@Open>
@if (ShowHSV)
{
<Draggable class="rz-saturation-picker rz-colorpicker-section" style=@($"background-color: {HSV.ToRGB().ToCSS()}") Drag=@OnSaturationMove>
<Draggable class="rz-saturation-picker rz-colorpicker-section" style=@($"background-color: hsl({(HueHandleLeft * 360).ToInvariantString()}, 100%, 50%)") Drag=@OnSaturationMove
id=@(GetId() + "hsl" ) tabindex="@(Disabled ? -1 : 0)" @onkeydown="@(args => OnHslKeyPress(args))">
<div class="rz-saturation-white">
<div class="rz-saturation-black"></div>
<div class="rz-saturation-handle" style=@($"top: {(SaturationHandleTop*100).ToInvariantString()}%; left: {(SaturationHandleLeft * 100).ToInvariantString()}%")></div>
<div class="rz-saturation-handle" style=@($"top: {(SaturationHandleTop * 100).ToInvariantString()}%; left: {(SaturationHandleLeft * 100).ToInvariantString()}%")></div>
</div>
</Draggable>
<div class="rz-colorpicker-preview-area rz-colorpicker-section">
<div class="rz-hue-and-alpha">
<Draggable class="rz-hue-picker" Drag=@OnHueMove>
<Draggable class="rz-hue-picker" Drag=@OnHueMove
id=@(GetId() + "hue" ) tabindex="@(Disabled ? -1 : 0)" @onkeydown="@(args => OnHueKeyPress(args))">
<div class="rz-hue-handle" style=@($"top: 0; left: {(HueHandleLeft * 100).ToInvariantString()}%")></div>
</Draggable>
<Draggable style=@($"background-image: linear-gradient(to right, {AlphaGradientStart} 0%, {AlphaGradientEnd} 100%)") class="rz-alpha-picker" Drag=@OnAlphaMove>
<Draggable style=@($"background-image: linear-gradient(to right, {AlphaGradientStart} 0%, {AlphaGradientEnd} 100%)") class="rz-alpha-picker" Drag=@OnAlphaMove
id=@(GetId() + "alpha" ) tabindex="@(Disabled ? -1 : 0)" @onkeydown="@(args => OnAlphaKeyPress(args))">
<div class="rz-alpha-handle" style=@($"top: 0; left: {(AlphaHandleLeft * 100).ToInvariantString()}%")></div>
</Draggable>
</div>
@@ -37,32 +40,32 @@
{
<div class="rz-colorpicker-rgba rz-colorpicker-section" @onmousedown:stopPropagation>
<div class="rz-color-box">
<RadzenTextBox Value=@Hex @oninput=@(args => ChangeRGB(args.Value)) />
<RadzenTextBox Value=@Hex @oninput=@(args => ChangeRGB(args.Value)) aria-label=@HexText />
@HexText
</div>
<div class="rz-color-box">
<RadzenNumeric TValue="double" Value=@Red Min="0" Max="255"
<RadzenNumeric TValue="double" Value=@Red Min="0" Max="255" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", RedText }})"
@oninput=@(args => ChangeColor(args.Value, (color, value) => color.Red = value))
Change=@(red => ChangeColor(red, (color, value) => color.Red = value))
/>
@RedText
</div>
<div class="rz-color-box">
<RadzenNumeric TValue="double" Value=@Green Min="0" Max="255"
<RadzenNumeric TValue="double" Value=@Green Min="0" Max="255" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", GreenText }})"
@oninput=@(args => ChangeColor(args.Value, (color, value) => color.Green = value))
Change=@(green => ChangeColor(green, (color, value) => color.Green = value))
/>
@GreenText
</div>
<div class="rz-color-box">
<RadzenNumeric TValue="double" Value=@Blue Min="0" Max="255"
<RadzenNumeric TValue="double" Value=@Blue Min="0" Max="255" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", BlueText }})"
@oninput=@(args => ChangeColor(args.Value, (color, value) => color.Blue = value))
Change=@(blue => ChangeColor(blue, (color, value) => color.Blue = value))
/>
@BlueText
</div>
<div class="rz-color-box">
<RadzenNumeric TValue="double" Value=@Alpha Min="0" Max="100"
<RadzenNumeric TValue="double" Value=@Alpha Min="0" Max="100" InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", AlphaText }})"
@oninput=@(args => ChangeAlpha(args.Value))
Change=@(alpha => ChangeAlpha(alpha))
/>
@@ -107,7 +110,7 @@
</div>
}
@if(ShowButton)
@if (ShowButton)
{
<div class="rz-colorpicker-button rz-colorpicker-section">
<RadzenButton ButtonStyle="ButtonStyle.Primary" Click=@OnClick Text=@ButtonText @onclick:preventDefault />

View File

@@ -1,8 +1,10 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Radzen.Blazor.Rendering;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.JSInterop;
namespace Radzen.Blazor
{
@@ -16,6 +18,13 @@ namespace Radzen.Blazor
/// </example>
public partial class RadzenColorPicker : FormComponent<string>
{
/// <summary>
/// Gets or sets the toggle popup aria label text.
/// </summary>
/// <value>The toggle popup aria label text.</value>
[Parameter]
public string ToggleAriaLabel { get; set; } = "Toggle";
/// <summary>
/// Gets or sets the open callback.
/// </summary>
@@ -37,6 +46,13 @@ namespace Radzen.Blazor
[Parameter]
public string Icon { get; set; }
/// <summary>
/// Gets or sets the icon color.
/// </summary>
/// <value>The icon color.</value>
[Parameter]
public string IconColor { get; set; }
/// <summary>
/// Gets or sets the hexadecimal color label text.
/// </summary>
@@ -151,16 +167,27 @@ namespace Radzen.Blazor
}
}
void UpdateColorUsingHsvHandles()
{
var hsv = new HSV {
Hue = HueHandleLeft,
Saturation = SaturationHandleLeft,
Value = 1 - SaturationHandleTop,
Alpha = AlphaHandleLeft
};
Color = hsv.ToRGB().ToCSS();
TriggerChange();
}
Rect lastHslRect;
void OnSaturationMove(DraggableEventArgs args)
{
lastHslRect = args.Rect; ;
SaturationHandleLeft = Math.Clamp((args.ClientX - args.Rect.Left) / args.Rect.Width, 0, 1);
SaturationHandleTop = Math.Clamp((args.ClientY - args.Rect.Top) / args.Rect.Height, 0, 1);
var hsv = new HSV { Hue = HSV.Hue, Saturation = SaturationHandleLeft, Value = 1 - SaturationHandleTop, Alpha = AlphaHandleLeft };
Color = hsv.ToRGB().ToCSS();
TriggerChange();
UpdateColorUsingHsvHandles();
}
void TriggerChange()
@@ -176,23 +203,17 @@ namespace Radzen.Blazor
void ChangeRGB(object value)
{
SetValue(value as string);
}
void SetValue(string value)
{
var rgb = RGB.Parse(value);
var rgb = RGB.Parse(value as string);
if (rgb != null)
{
Color = rgb.ToCSS();
rgb.Alpha = AlphaHandleLeft;
UpdateColor(rgb);
}
}
internal async Task SelectColor(string value)
{
SetValue(value);
UpdateColor(RGB.Parse(value));
if (!ShowButton)
{
@@ -204,11 +225,12 @@ namespace Radzen.Blazor
{
Color = rgb.ToCSS();
HSV = rgb.ToHSV();
var hsv = rgb.ToHSV();
SaturationHandleLeft = HSV.Saturation;
SaturationHandleTop = 1 - HSV.Value;
HueHandleLeft = HSV.Hue;
SaturationHandleLeft = hsv.Saturation;
SaturationHandleTop = 1 - hsv.Value;
HueHandleLeft = hsv.Hue;
AlphaHandleLeft = hsv.Alpha;
TriggerChange();
}
@@ -254,29 +276,24 @@ namespace Radzen.Blazor
}
}
Rect lastAlphaRect;
void OnAlphaMove(DraggableEventArgs args)
{
lastAlphaRect = args.Rect;
AlphaHandleLeft = Math.Round(Math.Clamp((args.ClientX - args.Rect.Left) / args.Rect.Width, 0, 1), 2);
HSV.Alpha = AlphaHandleLeft;
var hsv = new HSV { Hue = HSV.Hue, Saturation = SaturationHandleLeft, Value = 1 - SaturationHandleTop, Alpha = AlphaHandleLeft };
Color = hsv.ToRGB().ToCSS();
TriggerChange();
UpdateColorUsingHsvHandles();
}
Rect lastHueRect;
void OnHueMove(DraggableEventArgs args)
{
lastHueRect = args.Rect;
HueHandleLeft = Math.Clamp((args.ClientX - args.Rect.Left) / args.Rect.Width, 0, 1);
HSV.Hue = HueHandleLeft;
var hsv = new HSV { Hue = HSV.Hue, Saturation = SaturationHandleLeft, Value = 1 - SaturationHandleTop, Alpha = AlphaHandleLeft };
Color = hsv.ToRGB().ToCSS();
TriggerChange();
UpdateColorUsingHsvHandles();
}
async Task OnClick()
@@ -286,6 +303,15 @@ namespace Radzen.Blazor
await Popup.CloseAsync();
}
async Task OnClosePopup()
{
if (ShowButton)
{
SetInitialValue();
}
await Close.InvokeAsync(null);
}
/// <summary>
/// Gets or sets a value indicating whether button is shown.
/// </summary>
@@ -328,11 +354,10 @@ namespace Radzen.Blazor
[Parameter]
public PopupRenderMode PopupRenderMode { get; set; } = PopupRenderMode.Initial;
double SaturationHandleLeft { get; set; }
double HueHandleLeft { get; set; }
double SaturationHandleLeft { get; set; } = 0;
double SaturationHandleTop { get; set; } = 0;
double HueHandleLeft { get; set; } = 0;
double AlphaHandleLeft { get; set; } = 1;
double SaturationHandleTop { get; set; }
HSV HSV { get; set; } = new HSV { Hue = 0, Saturation = 1, Value = 1 };
string Color { get; set; } = "rgb(255, 255, 255)";
async Task Toggle()
@@ -349,7 +374,7 @@ namespace Radzen.Blazor
if (Disabled)
{
classList.Add("rz-disabled");
classList.Add("rz-state-disabled");
}
return string.Join(" ", classList);
@@ -358,12 +383,12 @@ namespace Radzen.Blazor
/// <inheritdoc />
protected override void OnInitialized()
{
Init();
SetInitialValue();
base.OnInitialized();
}
void Init()
void SetInitialValue()
{
var value = Value;
@@ -376,17 +401,11 @@ namespace Radzen.Blazor
{
Color = value;
HSV = RGB.Parse(Color).ToHSV();
SaturationHandleLeft = HSV.Saturation;
SaturationHandleTop = 1 - HSV.Value;
HSV.Saturation = 1;
HSV.Value = 1;
HueHandleLeft = HSV.Hue;
if (value.StartsWith("rgba"))
{
AlphaHandleLeft = HSV.Alpha;
}
var hsv = RGB.Parse(Color).ToHSV();
SaturationHandleLeft = hsv.Saturation;
SaturationHandleTop = 1 - hsv.Value;
HueHandleLeft = hsv.Hue;
AlphaHandleLeft = hsv.Alpha;
}
}
@@ -399,8 +418,115 @@ namespace Radzen.Blazor
if (valueChanged)
{
Init();
SetInitialValue();
}
}
async Task OnHueKeyPress(KeyboardEventArgs args)
{
var key = args.Code != null ? args.Code : args.Key;
if (key == "ArrowLeft" || key == "ArrowRight")
{
preventKeyPress = true;
if (lastHueRect == null)
{
lastHueRect = await JSRuntime.InvokeAsync<Rect>("Radzen.clientRect", (GetId() + "hue"));
}
OnHueMove(new DraggableEventArgs() { Rect = lastHueRect, ClientX = lastHueRect.Left + lastHueRect.Width * HueHandleLeft + (key == "ArrowLeft" ? -1 : 1) });
}
else if (key == "Escape")
{
await ClosePopup();
}
else
{
preventKeyPress = false;
}
}
async Task OnAlphaKeyPress(KeyboardEventArgs args)
{
var key = args.Code != null ? args.Code : args.Key;
if (key == "ArrowLeft" || key == "ArrowRight")
{
preventKeyPress = true;
if (lastAlphaRect == null)
{
lastAlphaRect = await JSRuntime.InvokeAsync<Rect>("Radzen.clientRect", (GetId() + "alpha"));
}
OnAlphaMove(new DraggableEventArgs() { Rect = lastAlphaRect, ClientX = lastAlphaRect.Left + lastAlphaRect.Width * AlphaHandleLeft + (key == "ArrowLeft" ? -3 : 3) });
}
else if (key == "Escape")
{
await ClosePopup();
}
else
{
preventKeyPress = false;
}
}
async Task OnHslKeyPress(KeyboardEventArgs args)
{
var key = args.Code != null ? args.Code : args.Key;
if (lastHslRect == null)
{
lastHslRect = await JSRuntime.InvokeAsync<Rect>("Radzen.clientRect", (GetId() + "hsl"));
}
if (key == "ArrowLeft" || key == "ArrowRight" || key == "ArrowUp" || key == "ArrowDown")
{
preventKeyPress = true;
OnSaturationMove(new DraggableEventArgs()
{
Rect = lastHslRect,
ClientX = lastHslRect.Left + lastHslRect.Width * SaturationHandleLeft + (key == "ArrowLeft" ? -1 : key == "ArrowRight" ? 1 : 0),
ClientY = lastHslRect.Top + lastHslRect.Height * SaturationHandleTop + (key == "ArrowUp" ? -1 : key == "ArrowDown" ? 1 : 0)
});
}
else if (key == "Escape")
{
await ClosePopup();
}
else
{
preventKeyPress = false;
}
}
bool preventKeyPress = false;
async Task OnKeyPress(KeyboardEventArgs args, Task task)
{
var key = args.Code != null ? args.Code : args.Key;
if (key == "Space" || key == "Enter")
{
preventKeyPress = true;
await task;
}
else if (key == "Escape")
{
await ClosePopup();
}
else
{
preventKeyPress = false;
}
}
internal async Task ClosePopup()
{
await Popup.CloseAsync();
await JSRuntime.InvokeVoidAsync("Radzen.focusElement", GetId());
}
}
}

View File

@@ -1,3 +1,4 @@
@using Radzen.Blazor.Rendering
<div class="rz-colorpicker-item" style="background-color: @Background" @onmousedown:preventDefault @onclick=@OnClick></div>
<div class="rz-colorpicker-item" style="background-color: @Background" @onmousedown:preventDefault @onclick=@OnClick
tabindex="@(ColorPicker.Disabled ? -1 : 0)" @onkeypress="@(args => OnKeyPress(args, OnClick()))" @onkeypress:preventDefault=preventKeyPress @onkeypress:stopPropagation></div>

View File

@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Radzen.Blazor.Rendering;
using System.Threading.Tasks;
@@ -37,5 +38,26 @@ namespace Radzen.Blazor
{
await ColorPicker.SelectColor(Value);
}
bool preventKeyPress = false;
async Task OnKeyPress(KeyboardEventArgs args, Task task)
{
var key = args.Code != null ? args.Code : args.Key;
if (key == "Space" || key == "Enter")
{
preventKeyPress = true;
await task;
}
else if (key == "Escape")
{
await ColorPicker.ClosePopup();
}
else
{
preventKeyPress = false;
}
}
}
}

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

@@ -24,15 +24,17 @@
var width = bandWidth / columnSeries.Count() - padding + padding / columnSeries.Count();;
var className = $"rz-column-series rz-series-{Chart.Series.IndexOf(this)}";
return
return
@<g class="@className">
@foreach(var data in Items)
{
var x = category(data) - bandWidth / 2 + index * width + index * padding;
var y = value(data);
var itemValue = Value(data);
var radius = Chart.ColumnOptions.Radius;
var height = Math.Abs(y0 - y);
if (radius > width / 2)
if (radius > width / 2 || radius > height)
{
radius = 0;
}
@@ -43,11 +45,11 @@
{
path = $"M {x.ToInvariantString()} {y0.ToInvariantString()} L {(x+width).ToInvariantString()} {y0.ToInvariantString()} L {(x+width).ToInvariantString()} {(y-radius).ToInvariantString()} A {radius.ToInvariantString()} {radius.ToInvariantString()} 0 0 1 {(x + width - radius).ToInvariantString()} {y.ToInvariantString()} L {(x + radius).ToInvariantString()} {y.ToInvariantString()} A {radius.ToInvariantString()} {radius.ToInvariantString()} 0 0 1 {x.ToInvariantString()} {(y-radius).ToInvariantString()} L {x.ToInvariantString()} {y0.ToInvariantString()} Z";
}
var fill = PickColor(Items.IndexOf(data), Fills, Fill);
var stroke = PickColor(Items.IndexOf(data), Strokes, Stroke);
var fill = PickColor(Items.IndexOf(data), Fills, Fill, FillRange, itemValue);
var stroke = PickColor(Items.IndexOf(data), Strokes, Stroke, StrokeRange, itemValue);
<Path @key="@path" D="@path" Stroke="@stroke" StrokeWidth="@StrokeWidth" Fill="@fill" LineType="@LineType" Style="@style" />
}
</g>;
}
}
}

View File

@@ -54,6 +54,20 @@ namespace Radzen.Blazor
[Parameter]
public LineType LineType { get; set; }
/// <summary>
/// Gets or sets the color range of the fill.
/// </summary>
/// <value>The color range of the fill.</value>
[Parameter]
public IList<SeriesColorRange> FillRange { get; set; }
/// <summary>
/// Gets or sets the color range of the stroke.
/// </summary>
/// <value>The color range of the stroke.</value>
[Parameter]
public IList<SeriesColorRange> StrokeRange { get; set; }
/// <inheritdoc />
public override string Color
{
@@ -101,7 +115,7 @@ namespace Radzen.Blazor
if (index >= 0)
{
var color = PickColor(index, Fills, Fill);
var color = PickColor(index, Fills, Fill, FillRange, Value(item));
if (color != null)
{
@@ -134,7 +148,7 @@ namespace Radzen.Blazor
/// <inheritdoc />
public override bool Contains(double x, double y, double tolerance)
{
return DataAt(x, y) != null;
return DataAt(x, y).Item1 != null;
}
/// <inheritdoc />
@@ -154,15 +168,11 @@ namespace Radzen.Blazor
/// <inheritdoc />
internal override double TooltipY(TItem item)
{
var y = base.TooltipY(item);
var ticks = Chart.ValueScale.Ticks(Chart.ValueAxis.TickDistance);
var y0 = Chart.ValueScale.Scale(Math.Max(0, ticks.Start));
return Math.Min(y, y0);
return base.TooltipY(item);
}
/// <inheritdoc />
public override object DataAt(double x, double y)
public override (object, Point) DataAt(double x, double y)
{
var category = ComposeCategory(Chart.CategoryScale);
var value = ComposeValue(Chart.ValueScale);
@@ -185,17 +195,33 @@ namespace Radzen.Blazor
if (startX <= x && x <= endX && startY <= y && y <= endY)
{
return data;
return (data, new Point() { X = x, Y = y });
}
}
return null;
return (null, null);
}
/// <inheritdoc />
public override IEnumerable<ChartDataLabel> GetDataLabels(double offsetX, double offsetY)
{
return base.GetDataLabels(offsetX, offsetY - 16);
var list = new List<ChartDataLabel>();
int sign;
foreach (var d in Data)
{
sign = Value(d) < 0 ? -1 : Value(d) == 0 ? 0 : 1;
list.Add(new ChartDataLabel
{
Position = new Point() { X = TooltipX(d) + offsetX, Y = TooltipY(d) - offsetY - (16 * sign) },
TextAnchor = "middle",
Text = Chart.ValueAxis.Format(Chart.ValueScale, Value(d))
});
}
return list;
}
}
}
}

View File

@@ -1,5 +1,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
namespace Radzen.Blazor
{
@@ -51,7 +53,7 @@ namespace Radzen.Blazor
/// public string Password { get; set; }
/// public double Value { get; set; }
/// public string RepeatPassword { get; set; }
/// }
/// }
/// Model model = new Model();
/// }
/// </code>
@@ -76,6 +78,13 @@ namespace Radzen.Blazor
[Parameter]
public CompareOperator Operator { get; set; } = CompareOperator.Equal;
/// <summary>
/// Gets or sets a value indicating whether this <see cref="RadzenCompareValidator"/> should be validated on value change of the specified Component.
/// </summary>
/// <value><c>true</c> if should be validated; otherwise, <c>false</c>.</value>
[Parameter]
public virtual bool ValidateOnComponentValueChange { get; set; } = true;
private int Compare(object componentValue)
{
switch (componentValue)
@@ -88,6 +97,41 @@ namespace Radzen.Blazor
return 0;
}
}
/// <inheritdoc />
public override async Task SetParametersAsync(ParameterView parameters)
{
var valueChanged = parameters.DidParameterChange(nameof(Value), Value);
await base.SetParametersAsync(parameters);
if (ValidateOnComponentValueChange && valueChanged && !firstRender && Visible)
{
var component = Form.FindComponent(Component);
if (component != null && component.FieldIdentifier.FieldName != null)
{
IsValid = Validate(component);
messages?.Clear(component.FieldIdentifier);
if (!IsValid)
{
messages?.Add(component.FieldIdentifier, Text);
}
EditContext?.NotifyValidationStateChanged();
}
}
}
bool firstRender = true;
/// <inheritdoc />
protected override void OnAfterRender(bool firstRender)
{
this.firstRender = firstRender;
base.OnAfterRender(firstRender);
}
/// <inheritdoc />
protected override bool Validate(IRadzenFormComponent component)
{

View File

@@ -22,7 +22,7 @@ namespace Radzen
/// <summary>
/// Gets a reference to the HTML element rendered by the component.
/// </summary>
public ElementReference Element { get; internal set; }
public ElementReference Element { get; protected internal set; }
/// <summary>
/// A callback that will be invoked when the user hovers the component. Commonly used to display a tooltip via
@@ -119,7 +119,7 @@ namespace Radzen
/// Gets the unique identifier.
/// </summary>
/// <returns>Returns the <c>id</c> attribute (if specified) or generates a random one.</returns>
protected string GetId()
protected virtual string GetId()
{
if (Attributes != null && Attributes.TryGetValue("id", out var id) && !string.IsNullOrEmpty(Convert.ToString(@id)))
{
@@ -233,17 +233,17 @@ namespace Radzen
{
if (ContextMenu.HasDelegate)
{
await JSRuntime.InvokeVoidAsync("Radzen.addContextMenu", UniqueID, Reference);
await JSRuntime.InvokeVoidAsync("Radzen.addContextMenu", GetId(), Reference);
}
if (MouseEnter.HasDelegate)
{
await JSRuntime.InvokeVoidAsync("Radzen.addMouseEnter", UniqueID, Reference);
await JSRuntime.InvokeVoidAsync("Radzen.addMouseEnter", GetId(), Reference);
}
if (MouseLeave.HasDelegate)
{
await JSRuntime.InvokeVoidAsync("Radzen.addMouseLeave", UniqueID, Reference);
await JSRuntime.InvokeVoidAsync("Radzen.addMouseLeave", GetId(), Reference);
}
}
}
@@ -347,4 +347,4 @@ namespace Radzen
}
}
}
}
}

View File

@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Components;
namespace Radzen
{
/// <summary>
/// Allows the developer to replace a component with another. Useful to specify default values for component properties.
/// </summary>
/// <example>
/// <code>
/// var builder = WebApplication.CreateBuilder(args);
/// var activator = new RadzenComponentActivator();
/// // Replace RadzenButton with MyButton
/// activator.Override&lt;RadzenButton, MyButton&gt;();
/// // Replace RadzenDataGrid with MyDataGrid
/// activator.Override(typeof(RadzenDataGrid&lt;&gt;), typeof(MyDataGrid&lt;&gt;));
/// // Register the activator
/// builder.Services.AddSingleton&lt;IComponentActivator&gt;(activator);
/// </code>
/// </example>
public class RadzenComponentActivator : IComponentActivator
{
private readonly Dictionary<Type, Type> replacedTypes = new Dictionary<Type, Type>();
/// <summary>
/// Replaces the specified component type with another.
/// </summary>
/// <typeparam name="TOriginal"></typeparam>
/// <typeparam name="TOverride"></typeparam>
public void Override<TOriginal, TOverride>()
{
Override(typeof(TOriginal), typeof(TOverride));
}
/// <summary>
/// Replaces the specified component type with another.
/// </summary>
/// <param name="original"></param>
/// <param name="override"></param>
public void Override(Type original, Type @override)
{
replacedTypes.Add(original, @override);
}
/// <summary>
/// Creates a component of the specified type.
/// </summary>
/// <param name="componentType"></param>
/// <returns></returns>
/// <exception cref="ArgumentException"></exception>
public IComponent CreateInstance(Type componentType)
{
if (!typeof(IComponent).IsAssignableFrom(componentType))
{
throw new ArgumentException($"The type {componentType.FullName} does not implement {nameof(IComponent)}.", nameof(componentType));
}
if (replacedTypes.ContainsKey(componentType))
{
componentType = replacedTypes[componentType];
}
else if (componentType.IsGenericType)
{
var genericTypeDefinition = componentType.GetGenericTypeDefinition();
if (replacedTypes.ContainsKey(genericTypeDefinition))
{
componentType = replacedTypes[genericTypeDefinition].MakeGenericType(componentType.GetGenericArguments());
}
}
return (IComponent)Activator.CreateInstance(componentType);
}
}
}

View File

@@ -0,0 +1,13 @@
<RadzenDialog @attributes="Attributes" />
<RadzenNotification @attributes="Attributes" />
<RadzenContextMenu @attributes="Attributes" />
<RadzenTooltip @attributes="Attributes" />
@code {
/// <summary>
/// Specifies additional custom attributes that will be rendered by the component.
/// </summary>
/// <value>The attributes.</value>
[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, object> Attributes { get; set; }
}

View File

@@ -1,4 +1,4 @@
@implements IDisposable
@implements IAsyncDisposable
@using Microsoft.JSInterop
@inject IJSRuntime JSRuntime
@@ -17,7 +17,7 @@
<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>
<RadzenMenuItem Text="@item.Text" Value="@item.Value" Icon="@item.Icon" IconColor="@item.IconColor" Image="@item.Image" ImageStyle="@item.ImageStyle" Disabled=@item.Disabled></RadzenMenuItem>
}
</RadzenMenu>
</div>

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