mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 22:09:08 +08:00
feat(core): support draft filter (#12400)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for draft mode and completion callbacks across filter components, enabling stepwise filter creation and editing. - Enhanced filter menus and editors with external control via refs and new callback props for open/close state management. - Introduced new filter option group component for multi-step filter interactions. - Expanded tag filter methods for more granular filtering options. - Enabled controlled open state and close event handling for desktop and mobile menus. - Added programmatic control and completion callbacks to member selector and tags inline editors. - **Improvements** - Updated filter and tag editors with improved UI layouts and added "Done" buttons for easier completion. - Improved menu and editor accessibility by allowing programmatic open/close and completion event handling. - Refactored date filter components for modularity and consistent draft handling. - Separated draft filter state management in filter UI for clearer user interactions. - **Bug Fixes** - Refined date filter logic for more accurate "after" and "before" comparisons. - **Style** - Adjusted styles for draft filters and editor layouts to enhance visual clarity and user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -139,8 +139,8 @@ function isAfter(
|
||||
: referenceDate;
|
||||
|
||||
return (
|
||||
targetYear >= refYear ||
|
||||
(targetYear === refYear && targetMonth >= refMonth) ||
|
||||
targetYear > refYear ||
|
||||
(targetYear === refYear && targetMonth > refMonth) ||
|
||||
(targetYear === refYear && targetMonth === refMonth && targetDay >= refDay)
|
||||
);
|
||||
}
|
||||
@@ -153,8 +153,8 @@ function isBefore(
|
||||
const [refYear, refMonth, refDay] = referenceDate;
|
||||
|
||||
return (
|
||||
targetYear <= refYear ||
|
||||
(targetYear === refYear && targetMonth <= refMonth) ||
|
||||
targetYear < refYear ||
|
||||
(targetYear === refYear && targetMonth < refMonth) ||
|
||||
(targetYear === refYear && targetMonth === refMonth && targetDay <= refDay)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user