refactor(module: select): Update ChildContent parameter to support generic RenderFragment
refactor(module: select): Remove ChildContent parameter from SelectOption and update documentation
* 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
* 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
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.
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.
* 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
* 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.
- 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.
* 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.
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.
- 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.
- Eliminated unnecessary calls to SetMouseInOverlay in the OverlayTrigger component for hover and focus triggers, streamlining the show and hide logic for overlays.
* 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.
* 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.
- 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.
- 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.
* 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
- 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.
* 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.
* 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
* 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
* 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.