feat: Add zoneless support, Signals and fix multiple issues (#213, #230, #231)#235
Conversation
Fixes danielmoncada#231 - Added inputmode="numeric" attribute to timer-box input field - This displays the numeric keyboard on mobile devices for hour/minute/second inputs - Improves mobile user experience by showing only number keys instead of full keyboard
) - Add provideAnimations() setup for standalone apps - Update "How to Use" section with standalone examples - Mark NgModule approach as legacy - Clarify animation configuration requirements - Add test case for issue danielmoncada#229 (null end date in range) Fixes danielmoncada#230: Users can now use the picker with provideAnimations() instead of the deprecated BrowserAnimationsModule
…lmoncada#213) - Modify formatString getter to include 'second: numeric' when showSecondsTimer is true - Applies to both 'timer' and 'both' picker types - Format is now dynamically created based on showSecondsTimer state Previously, even when showSecondsTimer was enabled and users could select seconds in the picker, the input field would only display HH:MM without seconds. Now it correctly displays HH:MM:SS when the seconds timer is enabled. Fixes danielmoncada#213
- Replace NgZone.runOutsideAngular() with afterNextRender() in all components - Remove NgZone imports and inject Injector instead - Update calendar-body.component.ts focusActiveCell() - Update calendar.component.ts focusActiveCell() - Update timer.component.ts focus() - Update date-time-picker.component.ts popup positioning - Add comprehensive zoneless documentation to README Benefits: - Works seamlessly in both zoned and zoneless Angular apps - Better performance without zone.js overhead - Smaller bundle size (~15KB saved) - Uses modern Angular APIs (afterNextRender) - Aligns with Angular's future direction The library now supports provideExperimentalZonelessChangeDetection() without any code changes required from users.
- Remove zone.js dependency from package.json - Add provideZonelessChangeDetection() to main.ts - Remove polyfills.ts file (no longer needed) - Update angular.json to remove polyfills references - Update tsconfig files to remove polyfills.ts - Add JsonPipe import to range-selection component for test case The demo app now runs in zoneless mode to demonstrate the library's full zoneless compatibility.
- Created comprehensive auto-select demo component - Demonstrates auto-close in popup mode with calendar-only picker - Shows comparison with time pickers (require OK) - Includes range selection auto-close after both dates selected - Compares dialog mode (always requires OK) - Shows inline mode (always auto-selects) - Added detailed summary table explaining when auto-select works This demo clarifies that pickerType="calendar" + pickerMode="popup" automatically closes after date selection without requiring OK button, just like inline mode behavior.
|
@Nesho-Developer appreciate the PR, but most (if not all) of this looks like AI generated with Claude. It can add a lot of unnecessary bloat as well. There are also various merge conflicts due to the amounts of refactoring, etc. Can you create one PR for only the fixes / with appropriate README updates? PR is just too massive to merge. What kind regression was done on this? |
|
@danielmoncada sure i used the ai to achieve what i want in short time, i pushed this pr to upgrade the lib because i used it many time and i always clone it and update it with my fix and used it as a lib in my mono-repo but this time i made this pr to help the community of this lib, so if you are going to accept it, i can fix the conflict if not acceptable just ignore it and thank you for your reply. |
|
|
||
| bootstrapApplication(AppComponent, { | ||
| providers: [ | ||
| provideExperimentalZonelessChangeDetection(), // Enable zoneless mode |
There was a problem hiding this comment.
zoneless is stable since angular v20.0.0 provideZonelessChangeDetection()
🚀 Add Zoneless Support & Fix Multiple Issues
Summary
This PR adds full zoneless mode support to the Angular DateTime Picker library, making it compatible with Angular's modern zoneless architecture. Additionally, it fixes several reported issues and improves the documentation for standalone app configuration.
✨ Major Features
1. Full Zoneless Support
NgZonedependencies from the libraryNgZone.runOutsideAngular()with modernafterNextRender()APIBenefits:
Files Changed:
calendar-body.component.ts- UpdatedfocusActiveCell()calendar.component.ts- UpdatedfocusActiveCell()timer.component.ts- Updatedfocus()date-time-picker.component.ts- Updated popup positioning2. Standalone App Documentation
provideAnimations()usage🐛 Bug Fixes
Fixed Issue #231 - Mobile UX Improvement
inputmode="numeric"to time picker inputsFixed Issue #230 - BrowserAnimationsModule Deprecation
provideAnimations()BrowserAnimationsModuleis deprecated in favor of provider functionsprovideNoopAnimations()for users who don't want animationsFixed Issue #213 - Seconds Display
formatStringgetter to include seconds whenshowSecondsTimeris enabledsecond: 'numeric'to format for both 'timer' and 'both' picker typesInvestigated Issue #229 - Null End Date in Range Mode
📚 Documentation Improvements
README Updates
New Demo: Auto-Select Behavior
pickerType="calendar"+pickerMode="popup"auto-close behavior🧪 Demo App Changes
📊 Commits Breakdown
refactor: convert to standalone with signals based- Foundation workfix: add inputmode="numeric" to time picker inputs- Issue Time popup should use numeric keyboard #231docs: update README with standalone app configuration- Issue Datepicker not working with if removing deprecated BrowserAnimationsModule #230fix: display seconds in input when showSecondsTimer is enabled- Issue Time Picker : -Not able to display seconds in input after selecting time from time picker #213feat: add full zoneless support by removing NgZone dependency- Main featurechore: enable zoneless mode in demo app- Demo updatesfeat: add auto-select demo- Documentation demo✅ Testing
📦 Migration Guide
For Users Already Using the Library
No changes required! The library works with both zoned and zoneless apps.
For Users Wanting Zoneless Mode
In your
main.ts:🔗 Related Issues
🤝 Contribution
This PR maintains full backward compatibility while adding modern Angular features. All changes follow Angular best practices and use official Angular APIs.