2286 Commits

Author SHA1 Message Date
James Yeung
259037d590 Changelog 1.5.0 (#4716)
* Changelog for 1.5.0

* fix(changelog): add breaking changes.
1.5.0
2025-11-03 11:50:53 +08:00
pankey888
ae914cbc2f fix(module: datepicker): Fix the exception when disposing the datepicker. (#4715) 2025-11-02 22:30:51 +08:00
shuangbaojun
e6228330ce fix(module: TreeSelect): throw Value cannot be null without FormItem.Name or @bind-Value assigned (#4714) 2025-11-02 22:30:18 +08:00
James Yeung
1f4b308950 refactor(module: modal): Update CreateConfirmAsync to return ConfirmResult instead of void (#4712) 2025-10-30 23:45:21 +08:00
James Yeung
c000ba4f39 Merge pull request #4711 from ant-design-blazor/merge/feature-1.5
Merge feature for v1.5.0
2025-10-30 17:45:25 +08:00
James
46abec12b0 Merge remote-tracking branch 'remotes/origin/master' into feature
refactor(module: select): Update ChildContent parameter to support generic RenderFragment

refactor(module: select): Remove ChildContent parameter from SelectOption and update documentation
2025-10-30 17:13:14 +08:00
shuangbaojun
803a4e85ae fix(module: select): When the Select component is in multiple selection mode, it throws an exception: “Value cannot be null.” #4708 (#4709) 2025-10-29 21:51:23 +08:00
Arash Zandi
a128a18b22 docs(module: icon): IconThemeType added to the copied Component (#4706) 2025-10-28 10:28:50 +08:00
shuangbaojun
2ff57a1c19 refactor(module: modal): ModalService.CreateComfirmAsync() would return the result directly and the delegates should be assigned to the options (#4704)
* Modal Services Bug #4676

* Change comments to English and modify Task<ConfirmRef<TResult>> to Task.

* adjust the format

* adjust the format  again
2025-10-28 00:41:22 +08:00
James Yeung
63ddb2f703 feat(module: select): Enhance SelectOption to support ChildContent rendering (#4662)
* feat(module: select): Add ChildContent support for SelectOption and refresh display on runtime changes

* refactor(module: select): Simplify SelectOption rendering and improve label template handling
2025-10-27 15:52:31 +08:00
shuangbaojun
5c8aea5c8c fix(module: reusetabs): The pin property of ReuseTabsPage is ineffective when the project has indirect references. (#4702) 2025-10-27 00:07:50 +08:00
shuangbaojun
a15bf9c273 fix(module: select): Select component throw Value cannot be null when FieldIdentifier is null (#4700)
Co-authored-by: James Yeung <shunjiey@hotmail.com>
2025-10-27 00:06:42 +08:00
Arash Zandi
cd46675f58 refactor(module: input): OnkeyDown, OnkeyDownAsync and OnkeyUp refactored (#4697) 2025-10-24 12:22:14 +08:00
James Yeung
f2f94ee3c9 feat(module: mentions): supports customizable prefixes (#4652)
* faat(module: mentions): supports customizable prefixes

- Added a new `Prefix` parameter for customizable prefix symbols (e.g., "@", "#") and introduced an `OnSearch` event callback for handling search actions based on the prefix.
- Modified internal logic to populate `ShowOptions` based on the current prefix and updated mention name extraction to return both name and prefix.
- Introduced a `Hidden` property in the `MentionsOption` component to control visibility based on the `ShowOptions` list.
- Enhanced the `Prefix` component to demonstrate the new functionality, binding the `Value` property and handling search events for user and tag options.

These changes improve the usability and functionality of the `Mentions` component, providing a more dynamic user experience.

* Improve .NET compatibility and optimize string handling

Updated `InitializePrefixes` to use conditional compilation for
.NET version-specific string splitting. For .NET 5.0 or greater,
added `StringSplitOptions.TrimEntries` for inline trimming.
Revised `_prefixes` initialization to modern syntax `["@"]`.
Optimized `Contains` method by switching from string `" "` to
character `' '` for better performance and clarity.

* fix test

* feat(module: mentions): enhance option rendering logic and simplify visibility condition

* feat(tests: mentions): add test for displaying all options when user types only prefix
2025-10-20 10:51:01 +08:00
Arash Zandi
c8fde02bc2 test: Missing Fact Attribute Has Been Added (#4695) 2025-10-12 17:47:26 +08:00
Arash Zandi
8e1c973d38 fix(module: input): RTL issues of input has been fixed (#4694) 2025-10-11 17:26:28 +08:00
Arash Zandi
ec6e5b9343 fix(module: input): Redundant ant-input-group-wrapper has been removed (#4689) 2025-10-09 14:58:48 +08:00
James Yeung
b363eabef9 feat(module: table): Supports controlling the closing of the custom filter panel (#4645) 2025-09-22 22:33:56 +08:00
James Yeung
7ce91d902b refactor(module: select): Refactor ValueName exception condition in Select (#4683)
Updated the condition for throwing an `ArgumentNullException`
for `ValueName` to check if `DataSource` contains elements
(`DataSource?.Any() == true`) instead of verifying if
`SelectOptions` is `null`. This ensures the exception is
triggered only when a valid `DataSource` exists and other
criteria are met.
2025-09-22 13:15:02 +08:00
Hervé PHILIPPE
a907378dd0 feat(module: table): support for hiding the adding button for FieldType filters when FilterMultiple is false. (#4684)
When `FilterMultiple` is `true`, show the `AddFilter` button, otherwise don't show it.
2025-09-22 13:11:40 +08:00
James Yeung
d1464b3dfd fix(module: tabs): avoid rerendering on tab was close (#4681)
Refactor `Tabs.razor` to use `tab.TabIndex` instead of `tab.GetHashCode()` for rendering content, ensuring proper tab order.

Remove manual reordering of `_tabs` in `Tabs.razor.cs`, as tabs are now rendered in the correct order directly.

Update the condition for activating the previous tab to use `_tabs.IndexOf(tab)` instead of `tab.TabIndex`, improving reliability and alignment with the collection's natural order.

These changes improve maintainability and address potential issues with tab ordering and activation.
1.5.0-alpha
2025-09-17 22:49:10 +08:00
James Yeung
1469521ab9 feat(module: upload): show image with ObjectURL (#4680) 2025-09-15 15:01:10 +08:00
James Yeung
e82cf491c5 feat(module: upload): supports paste upload (#4650)
* feat(module: upload): supports paste upload

* Add Trigger property to Upload component

Introduces a new `Trigger` property in the `Upload` component of `Upload.razor.cs`. This property, marked with the `[PublicApi("1.5.0")]` attribute, allows users to specify the upload trigger mode, defaulting to `UploadTrigger.Click`. This enhancement improves the component's functionality and usability.

* Refactor UploadTests to ensure consistent input element rendering

Updated the UploadTests.razor file to maintain consistent rendering of input elements within the upload component. This change enhances the clarity and reliability of the tests by ensuring that the input elements are consistently defined across different upload scenarios.

* feat(module: upload): support pasting files from both input and textarea
2025-09-15 12:32:56 +08:00
pankey888
ee8d39689a feat(module: table): Add ScrollItemIntoView to make a specified row visible in the view. (#4664)
* feat(module:table): Add `ScrollItemIntoView` to make a specified row visible in the view.

* Modify RowElementRef to be an internal property.
2025-09-15 00:46:12 +08:00
James Yeung
441ed41d9c feat(module: tabs): improve rendering stability and caching for tab panes (#4679) 2025-09-14 22:52:35 +08:00
Yusuf Temel
26e028cd2c fix(base): JsInvokeAsync: remove console output to prevent stack trace printing (#4669) 2025-08-21 16:37:08 +08:00
James Yeung
384ed51995 feat(module: table): Enhance query state deserialization for backend filter & sorter (#4658)
* feat(module: table): Enhance filtering and sorting mechanisms in query models

- Added a new method in `DefaultFieldFilterTypeResolver` for resolving field filter types.
- Updated `FilterModel<TField>` to include a `filterType` parameter and modified `OnFilter` property for better encapsulation.
- Introduced `BuildGetFieldExpression<TItem>()` in `ITableFilterModel` and `ITableSortModel` for post-deserialization initialization.
- Created `QueryModelJsonConverter` for improved JSON serialization/deserialization of `QueryModel` objects.
- Updated `QueryModel` to use the new JSON converter, streamlining JSON processing.
- Simplified `RestoreQueryState.razor` by removing custom converters, enhancing maintainability.
- Added `InitializeExpression()` in `QueryModel<TItem>` to ensure proper initialization of filter and sort models after deserialization.

* Update documentation for QueryModel in restore-query-state

Enhanced `restore-query-state.md` to clarify the functionality of `QueryModel`, including its convenient methods for executing queries and support for serialization with WebApi services. Improved clarity on the use of `ReloadData()` and `ResetData()` for managing table states, as well as the capabilities related to sorting, filtering, and paging data.
2025-07-31 13:14:28 +08:00
James Yeung
e5a3efeadf fix(module: badge): the BadgeSize enum missing namespace (#4660) 2025-07-29 13:41:44 +08:00
James Yeung
de70f88072 chore: update CHANGELOG for version 1.4.3 (#4656)
- InputNumber: enhance initial value handling for nullable inputs.
- Table: auto unselect the row which was removed in client-side mode.
- Checkbox: prevent unnecessary updates when the new value is the same as the current value.
- Docs: improve validation mode documentation clarity.
1.4.3
2025-07-14 01:04:31 +08:00
James Yeung
5d2c956e5d feat(module: input-number): enhance initial value handling for nullable inputs (#4654)
* feat(module: input-number): enhance initial value handling for nullable inputs

- Added a new method `GetInitialValue` to determine the initial value for nullable inputs when increasing or decreasing the value.
- Updated the `IncreaseDown` and `DecreaseUp` methods to utilize `GetInitialValue` for better handling of null values.
- Improved the logic for disabling the up and down buttons based on the nullable state of the input.

* test(module: input-number): add tests for initial value handling with nullable inputs

- Introduced a new test method to validate the initial value behavior of the InputNumber component when interacting with nullable values.
- Added scenarios for both increasing and decreasing the value, ensuring correct handling of minimum and maximum constraints.
- Enhanced test coverage for edge cases involving null values to improve reliability of the InputNumber component.

* refactor(module: input-number): streamline value handling for nullable inputs

- Refactored the `IncreaseDown` and `DecreaseDown` methods to improve the handling of nullable values.
- Consolidated logic to ensure early returns for maximum and minimum constraints, enhancing code clarity and maintainability.
- Ensured consistent behavior when interacting with null values, improving the overall reliability of the InputNumber component.

* test(module: input-number): simplify event simulation in InputNumber tests

- Refactored the test logic for simulating mouse events in the InputNumber component.
- Consolidated the up and down handler clicks into a single variable assignment for improved readability.
- Enhanced the clarity of the test by explicitly simulating mouse down and up events, ensuring accurate interaction representation.

* Refactor InputNumber value handling logic

Updated `InputNumber.razor.cs` to improve the handling of nullable values during increase and decrease operations. Introduced `IncreaseChangeValue` and `DecreaseChangeValue` methods to streamline logic and enhance readability. Modified the `OnKeyDown` method to utilize these new methods, reducing code duplication. Test cases in `InputNumberTests.razor` were also updated to ensure correct validation of behavior for keyboard and button interactions.
2025-07-13 23:19:57 +08:00
James Yeung
15c332de68 feat(module: table): auto unselect the row which was removed in client side mode (#4651) 2025-07-13 21:30:43 +08:00
James Yeung
297b641958 fix(module: checkbox): prevent unnecessary updates when the new value is the same as the current value (#4653)
Added early return checks in OnValueChange and ChangeValue methods to prevent unnecessary updates when the new value is the same as the current value. This optimization reduces redundant operations and ensures event handlers are only invoked on actual value changes.
2025-07-09 10:57:26 +08:00
James Yeung
87a4d2fe4e docs(module: form): update validation mode documentation and improve clarity (#4643)
- Revised the validation mode documentation for both Chinese and English to enhance clarity and consistency.
- Updated the terminology from "Validate Mode" to "Validation" in the English version and "验证模式" to "验证方式" in the Chinese version.
- Improved the descriptions of the two validation methods: Attribute and Rules, including use cases and benefits for each method.
- Clarified the capabilities of the `FormValidationRule` type for more flexible validation scenarios.
2025-07-01 17:57:18 +08:00
James Yeung
cf5dffe985 chore: update CHANGELOG for version 1.4.2 (#4640)
- Tabs: fix OnTabClick event trigger on tab activation; fix wrapper id error during ResetSizes
- Table: improve reflection performance with caching; fix zebra stripe display issue with fixed headers/columns; fix GroupFooterTemplate rendering
- Form: refactor numeric validation attributes; fix StringLengthAttribute validation message and add LengthAttribute validation
- Fix Overlay components not closing on quick mouse hover; fix Menu state not refreshing on inline collapse; fix Input key code compatibility; fix safe parsing of CSS values in manipulationHelper
- Add eu_ES Basque language support
- Update documentation with AI component links
1.4.2
2025-06-30 23:14:14 +08:00
James Yeung
ec631f75eb fix(module: overlay): closing incorrectly when mouse move over quickly (#4637)
- Eliminated unnecessary calls to SetMouseInOverlay in the OverlayTrigger component for hover and focus triggers, streamlining the show and hide logic for overlays.
2025-06-30 21:58:30 +08:00
James Yeung
8ac78e54a5 fix(module: menu): the inline collapsed state can't invoke correctly (#4636)
* fix(module: menu): the inline collapsed state can't invoke correctly

- Updated `Menu.razor.cs` to streamline internal state management by setting `InternalMode` and removing redundant calls.
- Modified `MenuItem.razor` to include a reference to `_tooltip` for improved tooltip manipulation.
- Introduced `_tooltip` field and `TooltipDisabled` property in `MenuItem.razor.cs` to enhance tooltip display logic based on menu state.
- Updated `OnParametersSet` to ensure tooltip rendering is responsive.
- Improved lifecycle management of tooltips within menu items for better performance.

* fix(module: menu): restore StateHasChanged calls for internal state updates

- Reintroduced StateHasChanged calls in Menu.razor.cs to ensure UI updates correctly reflect changes in internal state management.
- Streamlined the handling of inline collapsed and mode states for improved responsiveness.
2025-06-30 13:33:16 +08:00
James Yeung
b254a76c83 refactor(module: internal) namespace and access modifiers (#4631)
* Refactor AntDesign namespace and access modifiers

Removed licensing comments and changed several public classes and enums to internal, enhancing encapsulation. Updated namespaces to include ".Core" for better organization. Removed certain enums and classes, indicating a potential refactor or simplification of the codebase.

* Refactor namespace in EventHandlers.cs to simplify structure

Updated the namespace from AntDesign.Core to AntDesign, aligning with recent refactoring efforts to enhance code organization and encapsulation.
2025-06-30 11:33:09 +08:00
James Yeung
a719dd2fe1 docs: Add AI menu item and update image assets (#4635)
- Added new binary image files `x-cn.png` and `x-en.png`.
- Updated `HeaderMenu.razor` to include a new "AI" menu item linking to `https://x.antblazor.com/{CurrentLanguage}`.
- Removed footer item in `MainFooter.razor` linking to a domestic mirror site for Ant Design Blazor.
- Updated `recommend.en-US.json` with a new entry for "Ant Design X Blazor" and removed an older entry.
- Updated `recommend.zh-CN.json` with a new entry for "Ant Design X Blazor" and removed an older entry.
2025-06-28 11:05:46 +08:00
Qingmei16
4aead3a94e fix(module: input): Fix the enter key code of the input to improve compatibility (#4633)
* Update Input.cs

兼容对小键盘,及移动端的回车键响应

* Update Input.cs

兼容小键盘,移动端及组合键的回车事件响应

* Update Input.cs
2025-06-27 11:14:43 +08:00
James Yeung
3fe6bcabe6 fix(module: tabs): Ensure OnTabClick is fired correctly when tabs are clicked (#4634)
- Moved the check for active tab after the OnTabClick invocation to ensure the event is fired correctly for both active and inactive tabs.
- Added a new unit test to verify that OnTabClick is triggered when a tab is clicked, regardless of its active state.
2025-06-27 10:26:07 +08:00
James Yeung
563ddf8e43 fix(module: table): Adjust striped row background for fixed headers and columns (#4630)
* fix(module: table): Adjust striped row background for fixed headers and columns

* refactor(module: table): Remove redundant comments in striped row styling

* refactor(module: table): Simplify striped row styling by removing redundant background color rules for fixed cells
2025-06-26 10:17:29 +08:00
James Yeung
a74b5f0ac1 fix(module: tabs): Correct nav wrapper ID and enhance error handling in ResetSizes method (#4629)
* fix(module: tabs): Correct nav wrapper ID and enhance error handling in ResetSizes method

Updated the ID from "nav-warpper" to "nav-wrapper" in the Tabs component for consistency. Enhanced the ResetSizes method to gracefully handle missing or null dictionary keys during JS interop, ensuring the component remains stable and functional even in edge cases. Added unit tests to verify the handling of these scenarios.

* fix(tabs): Refactor error handling and streamline element reference retrieval in GetElementsDomInfo method

* test(tabs): Remove test for handling JS interop exceptions gracefully
2025-06-26 10:15:25 +08:00
James Yeung
e709a229f6 refactor(module: table): Optimize column generation logic in GenerateColumns component (#4627)
- Introduced a caching mechanism for column type information to improve performance.
- Replaced the dynamic property retrieval with a static array of type properties.
- Enhanced the instantiation of column types by using a compiled factory delegate.
- Updated rendering logic to utilize cached column type information, improving efficiency in rendering columns.
2025-06-25 23:09:46 +08:00
James Yeung
3524929de3 feat(module: select): add ChildContent parameter to SelectOption (#4628)
* feat(select): add ChildContent parameter to SelectOption for customizable rendering

- Introduced a new ChildContent parameter in SelectOption to allow users to specify custom content for options.
- Updated the rendering logic to prioritize ChildContent over ItemTemplate.
- Modified demo examples to utilize the new ChildContent feature for better clarity and usage demonstration.

* feat(select): add unit tests for SelectOption functionality

- Implemented tests to verify the behavior of SelectOption components, including handling disabled options, using custom item templates, updating labels, managing group names, and ensuring proper disposal of options.
- Enhanced test coverage to ensure reliable functionality and user experience in the Select component.

* refactor(select): simplify SelectOption rendering by removing ChildContent wrapper

- Removed the ChildContent wrapper from the SelectOption component to streamline rendering.
- Updated the rendering logic to directly display the custom template, enhancing clarity and performance.

* refactor(tests): remove redundant tests for SelectOption functionality

- Deleted tests for updating labels and handling group names in SelectOption, as they were deemed unnecessary for current coverage.
- Focused on maintaining essential tests to ensure reliability and performance of the Select component.
2025-06-25 23:03:59 +08:00
stfei
5aaba6743e feat(module: upload): defer upload (#4626)
* feat(module: upload):支持手动上传,并添加文档

* feat(module: upload):manual upload add Defer property

* add [PublicApi("1.5.0")]

---------

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2025-06-24 10:37:20 +08:00
James Yeung
6991a99966 feat(module: tabs): add swipe functionality for tab navigation (#4581)
* refactor(tabs): improve button and dropdown markup for better readability and maintainability

* feat(tabs): add swipe functionality for tab navigation

* feat(tabs): add EnableSwipe parameter to support swipe navigation
2025-06-24 00:40:30 +08:00
James Yeung
ede832d612 feat(module: carousel): implement touch swipe functionality (#4580)
* feat(carousel): implement touch swipe functionality

- Added touch event handling for swipe gestures in the Carousel component, allowing users to navigate slides by swiping left or right.
- Introduced a new JS interop module for touch event initialization and cleanup.
- Enhanced the Dispose method to ensure proper resource management and prevent memory leaks.
- Updated JSInteropConstants to include carousel-related methods.

* refactor(carousel): enhance touch swipe handling and remove deprecated JS interop

- Refactored touch swipe handling in the Carousel component to support vertical swipes in addition to horizontal.
- Replaced the previous carouselHelper with a new touchHelper for improved touch event management.
- Updated JS interop constants and removed the obsolete carouselHelper module.
- Ensured proper initialization and disposal of touch events to prevent memory leaks.

* refactor(touchHelper): improve code formatting and consistency

* feat(carousel): add EnableSwipe parameter to control swipe gestures

* feat(carousel): add PublicApi attribute for EnableSwipe parameter
2025-06-24 00:39:15 +08:00
James Yeung
685147437c feat(module: dom): Introduce manipulationHelper for safe CSS value parsing (#4619)
* feat(module: dom): Introduce manipulationHelper for safe CSS value parsing

- Added manipulationHelper class with parseNumericValue method to safely parse CSS numeric values, handling cases like 'auto', 'inherit', and 'initial'.
- Updated tableHelper and infoHelper to utilize manipulationHelper for margin and padding calculations, improving robustness against invalid CSS values.
- Enhanced tests for manipulationHelper to cover various edge cases and ensure correct behavior for auto, inherit, and initial values.

* Improve CSS property handling in manipulationHelper.ts

- Added checks for inline styles to handle empty values from getComputedStyle.
- Enhanced logic for special CSS values ('inherit', 'auto', 'initial', 'unset').
- Removed unnecessary calculateInitialValue method.
- Improved calculateInheritValue to recursively parse parent values.
- Made minor formatting adjustments for better readability.

* Refactor margin calculations in manipulationHelper.ts

- Updated margin calculation cases to use block scope for improved readability and maintainability.
- Ensured consistent handling of margin properties: marginTop, marginBottom, marginLeft, and marginRight.
2025-06-23 10:29:10 +08:00
LeaFrock
6ff07b2b5c perf(module: form): rewrite ValidationAttribute for number (#4624) 2025-06-21 22:56:24 +08:00
Ninety
7ab80156df fix(module: table): incorrectly GroupFooterTemplate rendering (#4623) 2025-06-21 22:32:46 +08:00