Commit Graph

920 Commits

Author SHA1 Message Date
Arash Zandi
cd46675f58 refactor(module: input): OnkeyDown, OnkeyDownAsync and OnkeyUp refactored (#4697) 2025-10-24 12:22:14 +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
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
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
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
ZNH
f9169163ac docs: Fix Spelling Errors (#4605)
Fix Spelling Errors
2025-06-15 15:53:49 +08:00
James Yeung
2321f92b26 fix(module: select): the default selected templated options didn't display on initialize (#4607)
* Refactor Select and SelectBase components

This commit introduces significant refactoring of the `Select` and `SelectBase` components in the AntDesign library. Key changes include the addition of an `AddOptionItem` method for managing option items, the removal of `await` from several method calls to shift to synchronous execution, and the modification of `SetInitialValuesAsync` to accept a `SelectOptionItem` parameter. The handling of selected options has been streamlined, and the `SelectOption` component now interacts more directly with `SelectParent`. These improvements enhance performance, maintainability, and clarity in managing option items.

* Refactor Select components in Basic.razor

Updated <Select> components to use ItemValue and ItemLabel
instead of ValueProperty and LabelProperty. Changed the
default value of _selectedValue6 from "Lucy" to "lucy".
Added DisabledPredicate to conditionally disable options
based on the key being "Disabled". These changes improve
data binding and selection behavior.
2025-06-12 16:07:53 +08:00
James Yeung
bb522cdeea fix(module: tabs): Add StandaloneInCard parameter to avoid content conflicts (#4608)
Introduce a new `StandaloneInCard` parameter to the `Tabs` component, enabling independent rendering within a `Card` to avoid content conflicts. Update component logic to incorporate the `IsTabbedCard` boolean for conditional rendering. Revise documentation and examples in `Tabs1.razor` and `Test.razor` to showcase the new functionality.
2025-06-12 14:18:04 +08:00
James Yeung
aaedb887ec refactor(module: select): Add ChildContent as an alias of the SelectOptions renderfargment (#4603)
* refactor(module: select): Add ChildContent as an alias of the SelectOptions renderfargment

This commit introduces new parameters `ChildContent` and `SelectOptions` to the `Cascader`, `Select`, `SelectBase`, and `TreeSelect` components, allowing for more flexible content rendering. The `Select` component now includes an alias for `SelectOptions`, improving usability. Updates to `SelectBase` ensure proper handling of these parameters, and the `Basic.razor` file has been modified to showcase the new functionality with additional `SelectOption` entries. These changes enhance the component API and customization capabilities for developers.

* Refactor Cascader content rendering and clean HTML

Updated the `TriggerContent` property in `Cascader.razor.cs` to utilize the `ChildContent` parameter for improved flexibility in content rendering. Additionally, removed unnecessary whitespace from the `<a>` tag in `CustomTrigger.razor` to enhance HTML formatting.
2025-06-10 22:05:09 +08:00
James Yeung
ee8589f14a feat(module: input): Support combination key for OnPressEnter handling (#4585)
* Enhance Enter key handling with PressEnterEventArgs

Introduced a new `PressEnterEventArgs` class to extend `KeyboardEventArgs`, enabling detailed handling of Enter key presses, including the ability to prevent line breaks. Updated the `Input` and `TextArea` components to utilize this new event argument for more specific event handling. Modified methods to check for the `Code` property and updated callbacks accordingly. Added `ForceUpdateValueString` to improve value updates in `AntInputComponentBase`. These changes enhance input handling capabilities across components.

* Refactor TextArea newline handling logic

Removed the temporary trimming of trailing newlines
when `ShouldPreventLineBreak` is true. The logic
to append a newline if the input string does not
end with one remains intact.

* Refactor input handling in TextArea component

Renamed `OnPress` to `OnInput` in `TextArea.razor.cs`.
Removed logic that appended a newline character when the
input string ended with a newline. The new implementation
focuses on updating the input string without adding line
breaks, streamlining the input handling process and
enhancing user experience.

* Add chat submission toggle and update documentation

- Implemented a `Switch` in `ChatBox.razor` to toggle
  between submitting messages with Enter or Ctrl + Enter.
- Modified `OnPressEnter` method to handle new submission
  behaviors and updated placeholder text accordingly.
- Removed submission logic from `TextAreaBasic.razor` for
  simplified input handling.
- Updated `chatbox.md` documentation in both Chinese and
  English to explain the new functionality and usage of
  `PreventLineBreak()`.

* Update FluentAssertions to version 7.1.0 and add new tests for Input and Search components

- Upgraded the FluentAssertions package in the test project.
- Added multiple tests for the Input component to verify Enter key behavior, including triggering callbacks and handling keyboard events.
- Introduced a new SearchTests.razor file with tests for the Search component, ensuring correct callback invocation on Enter key press and value passing.
- Enhanced TextAreaTests.razor with additional tests for Enter key handling, including preventing line breaks and allowing new lines with Ctrl key.

* Refactor TextArea tests to improve Enter key handling and ensure new line addition
2025-06-01 11:28:54 +08:00
James Yeung
b8bf64a0ff feat: add carbon ads script to Components and Docs pages (#4593) 2025-05-30 15:34:15 +08:00
James Yeung
360ad4c3be refactor(jsinterop): add asynchronous support (#4573)
* feat(jsinterop): enhance DomEventListener with exclusive and shared event handling

- Added AddExclusive and AddShared methods to DomEventListener for handling events with asynchronous callbacks.
- Updated DomEventSubscription to include an IsAsync property to differentiate between synchronous and asynchronous subscriptions.
- Modified IDomEventListener interface to support the new asynchronous event handling methods.
- Improved event management by allowing multiple subscriptions for shared events.

* feat(jsinterop): add asynchronous support for ResizeObserver in DomEventListener

- Introduced asynchronous overloads for AddResizeObserver and RemoveResizeObserver methods in DomEventListener to handle callbacks with Task return types.
- Updated IDomEventListener interface to include the new asynchronous methods for managing resize observer subscriptions.
- Enhanced test implementations to support the new asynchronous functionality for resize observers.

* refactor: update event handler signatures to use Task instead of void

- Changed event handler methods across multiple components to return Task instead of void, enabling better asynchronous handling and avoiding potential issues with unobserved exceptions.
- Updated methods in components such as Affix, Anchor, AutoComplete, and others to ensure consistency in asynchronous programming practices.
2025-05-05 12:11:35 +08:00
James Yeung
ab9b89d31f feat: add splitter component (#4555)
* feat(module: splitter): add component splitter

* add more features

* collapse style

* feat(module: splitter): enhance splitter functionality with collapse button visibility and size management

* feat(module: splitter): refine button visibility logic and improve position calculations for edge detection

- Updated the threshold for showing/hiding buttons from 20px to 2px for better edge detection.
- Enhanced position calculations to be relative to the container, improving responsiveness during resizing.
- Adjusted state management to ensure accurate position tracking for horizontal and vertical orientations.

* docs(splitter): add notice about panel support limitations in documentation

- Updated English and Chinese documentation to include a notice that currently only two panels are supported, with plans to add support for multiple panels in the future.

* refactor(module: splitter): streamline event listener management and improve button visibility logic

* refactor(service: demo): simplify pre-fetch methods by removing async/await and improving readability

- Changed PreFetch and PreFetchDemoMenuItems methods from async to synchronous to streamline the pre-fetching process.
- Removed unnecessary task list and simplified the method calls for better clarity and performance.
2025-05-05 11:48:26 +08:00
James Yeung
d01dd86641 feat(module: table): implement sticky scroll functionality for table component (#4566)
- Added support for sticky scrolling in the table component, allowing the sticky scroll bar to appear when the table content is scrollable and the bottom of the table is not visible.
- Introduced methods for enabling and updating the sticky scroll behavior, including mouse drag functionality for the sticky scroll bar.
- Updated the table header and body to accommodate the new sticky scroll feature, ensuring proper styling and visibility.
- Enhanced the ColumnBase and ITable interfaces to support sticky positioning.
- Modified Table.razor to conditionally render the sticky scroll elements based on the new IsSticky property.
2025-04-28 00:51:19 +08:00
James Yeung
0d179778de feat(module: message): update IMessageService to support synchronous and asynchronous message methods (#4548)
- Added synchronous methods for Error, Info, Loading, Open, Success, and Warning in IMessageService.
- Updated existing asynchronous methods to follow the new naming convention (e.g., ErrorAsync, InfoAsync).
- Modified MessageService to handle the new synchronous methods and adjusted the PreOpen method to support animation options.
- Updated related demo files to reflect the changes in method calls from asynchronous to synchronous where applicable.
2025-04-26 23:11:09 +08:00
James Yeung
54b43a6e69 feat(module: table): Add EllipsisShowTitle property for columns (#4565)
Introduce `EllipsisShowTitle` to control the native title attribute for ellipsis text. Update logic for displaying ellipsis in table cells based on `Ellipsis` and `EllipsisShowTitle`. Modify comments for clarity and update example usage in `Ellipsis.razor`.
2025-04-26 22:42:48 +08:00
James Yeung
1dc182dac4 feat(module: collapse): supports two-way binding for activing panels (#4564)
- Added `ActiveKeys` and `ActiveKeysChanged` parameters for external control of active panels.
- Introduced `_internalActiveKeys` for improved state management.
- Replaced `Click` method with `TogglePanelState` for clarity and functionality.
- Updated `Activate` and `Deactivate` methods to utilize new active keys logic.
- Modified header click handling in `Panel.razor.cs` to align with changes.
- Removed unnecessary translations from `KnownChineseTranslations.json`.
- Added example in `ControlledActiveKeys.razor` for using `@bind-ActiveKeys`.
- Updated documentation in `controlled-activekeys.md` for new feature guidance.
2025-04-26 22:41:58 +08:00
James Yeung
87c897d14c docs(module: upload): add a demo for drag-and-drop inputfile support (#4546) 2025-04-11 18:03:30 +08:00
James Yeung
90d14c4653 feat(module: upload): add support for batch file uploads (#4544) 2025-04-11 00:45:58 +08:00
Maksim
0e29073ca0 docs: fix broken components search (#4530) 2025-04-06 00:03:37 +08:00
James Yeung
6d9a3497c2 refactor(modue: form): custom validation attribute (#4523) 2025-03-31 19:22:32 +08:00
James Yeung
0a498303ac docs: add commercial customers (#4517) 2025-03-30 00:59:24 +08:00
James Yeung
9656d254b7 fix(module: table): avoid duplicated expand button while both RowExpandable and OnExpand was set (#4508) 2025-03-23 22:38:29 +08:00
Pat Hartl
35aaef98b6 feat(module: menu): add Target parameter for link (#4502)
* Add parameter to specify HTML target attribute

* Remove "None" unused target

* Add `Target` to API docs

* fix build

---------

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2025-03-22 22:25:54 +08:00
Shoming
2721bd7ad4 feat(module: message): Implement LoadingWhen API for IMessageService (#4493)
* feat(module: message): Implement LoadingWhen API for IMessageService

* docs(module: message): update document and add demo of LoadingWhen

* feat(module: message): Set the Duration of the content to 0 if content is MessageConfig
2025-03-05 14:07:29 +08:00
James Yeung
40db405c7d fix(module: table): prevert trigger SelectedRowsChanged when the SelectedRows was changed outside (#4486)
* fix(module: table): prevert trigger SelectedRowsChanged when the SelectedRows was changed outside

* update demo
2025-02-26 17:50:53 +08:00
James Yeung
ff32982722 docs: add support doc (#4482) 2025-02-25 21:51:12 +08:00
James Yeung
f9d8f73c95 Merge pull request #4462 from ant-design-blazor/feature
merge feature to master
2025-02-02 14:13:26 +08:00
Pat Hartl
50ef47cd34 feat(module: flex): add Vertical property on Flex to Direction (#4410)
* Refactor Vertical property on Flex to Direction

* Update docs
2025-02-01 23:41:15 +08:00
James Yeung
33fd9886c7 feat(module: table): dynamic column support recognizes the type of filter by the object column type (#4439)
* feat(module: table): ynamic column support recognizes the type of filter

* convert object type

* fix

* update demo
2025-01-22 16:55:20 +08:00
James Yeung
4121e38986 docs: fix codebox expand (#4430)
* docs: remove delay for loading demos

* fix codebox expand

* recover the delay

* revert delay
2025-01-14 23:30:33 +08:00
James Yeung
1b93c1423d fix(module: timeline): color incorrectly (#4433) 2025-01-14 17:05:48 +08:00
James Yeung
ca8ee0072d fix(module: breadcrumb): auto-generating should be matched against the MenuItem's RouterMatch (#4428) 2025-01-13 11:07:52 +08:00
James Yeung
76316b25aa docs: add peter cat (#4420)
* docs: add peter cat

* fix link

* fix link

* fix js

* fix js
2025-01-10 18:35:55 +08:00
ElderJames
69eec75218 Merge branch 'master' into feature
# Conflicts:
#	CHANGELOG.en-US.md
#	CHANGELOG.zh-CN.md
#	components/cascader/Cascader.razor
#	site/AntDesign.Docs.Wasm/wwwroot/index.html
#	site/AntDesign.Docs/Routes.razor
2025-01-08 21:14:37 +08:00
James Yeung
3ea9d3ee18 Changelog 1.1.2 (#4419)
* Change log 1.1.2

* move sposor notice to layout

* add preview script

* fix link

* Revert "move sposor notice to layout"

This reverts commit beb87c0e7f4bb9853c2f14c7faf03ddb60dfcd0e.

* fix sponsor notice
2025-01-08 20:59:45 +08:00
James Yeung
a17016002c fix(module: menu): wrong layout of submenu (#4417)
* fix(module: menu): wrong layout of submenu

* add tests

* fix test
2025-01-08 15:41:18 +08:00
James Yeung
295440eaaf fix(module: table): default sort directions was wrong (#4411) 2025-01-07 12:32:58 +08:00
James Yeung
31b423c16e docs: fix docsearch undefined error (#4406) 2025-01-05 21:49:48 +08:00
James Yeung
b7daef8c1b feat(module: cascader): support custom trigger (#4404)
(cherry picked from commit 6e6369e89e)

# Conflicts:
#	components/cascader/Cascader.razor
2025-01-05 21:47:29 +08:00
Arash Zandi
e45012f301 docs: Unused Dropdown has been removed (#4401) 2025-01-04 16:22:03 +08:00
James Yeung
daa6adf77a fix(module: reusetabs): parameter update for singleton page (#4399)
* fix(module: reuse-tabs): parameter updating for singleton pages

* add update page demo

* update doc
2025-01-03 22:26:36 +08:00
James Yeung
53a8df5e81 docs(module: table): update treedata demo and orders (#4398)
* docs(module: table): update  treedata demo and orders

* mack ColumnContext protected

* add table faq about onchange
2025-01-03 22:18:42 +08:00
James Yeung
48a19b70bd refactor(module: auto-complete): make ShowPanel obsoleted (#4393) 2025-01-03 22:17:21 +08:00
James Yeung
89561a41a0 Changelog 1.1.1 & site update (#4392)
* djust js loading order

* add changelog

* add docs

* remove some data

* fix docsearchjs

* add sponsorship notice
2025-01-02 23:38:30 +08:00
ElderJames
f2fd97b057 add sponsorship notice 2025-01-02 23:07:12 +08:00
ElderJames
ffd82b268f fix docsearchjs 2025-01-02 20:50:31 +08:00
ElderJames
da9a65d522 remove some data 2025-01-02 20:26:58 +08:00