ngxsmk-datepicker 3.0.3 → 3.0.4-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,13 +2,31 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- **Last updated:** July 29, 2026 - **Current stable:** v3.0.3
5
+ **Last updated:** August 18, 2026 - **Current stable:** v3.0.4
6
6
 
7
7
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8
8
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [3.0.4] - 2026-08-18
13
+
14
+ ### Added
15
+
16
+ - **Built-in Angular Reactive Forms Validators**: Added type-safe Angular `ValidatorFn` utilities exported in the public API:
17
+ - `ngxsmkMinDateValidator(minDate)`: Validates single dates, ranges, and multiple date arrays against a minimum date.
18
+ - `ngxsmkMaxDateValidator(maxDate)`: Validates dates against a maximum date.
19
+ - `ngxsmkDateRangeValidator(options)`: Validates minimum/maximum range duration (`minDays`, `maxDays`) and complete range requirements (`requireBoth`).
20
+ - `ngxsmkBlockedDatesValidator(blocked)`: Validates that selected dates/ranges do not intersect blocked or blacklisted dates.
21
+ - **Built-in Range Presets UI (`[showPresets]`)**: Added `[showPresets]` input signal to display standard presets (*Today*, *Yesterday*, *Last 7 Days*, *Last 30 Days*, *This Month*, *Last Month*) when in range mode.
22
+ - **Datepicker Overlay Service**: Added and exported `DatepickerOverlayService` for automated viewport collision detection, auto-flipping, and responsive positioning.
23
+ - **Accessibility & Reduced Motion**: Enhanced `@media (prefers-reduced-motion: reduce)` across all popovers, drawers, and overlay panels; added `role="grid"` and `role="gridcell"` attributes on Year/Decade views; added visible month span announcements for multi-calendar navigation.
24
+
25
+ ### Fixed
26
+
27
+ - **Month & Year Select Sync on Clear (Issue #311)**: Fixed issue where clearing a date and re-opening the calendar or navigating months caused header dropdowns to desynchronize with the rendered days grid ([#311](https://github.com/NGXSMK/ngxsmk-datepicker/issues/311)).
28
+ - **Performance Optimization**: Implemented precomputed timestamp `Set<number>` lookups ($O(1)$) for disabled dates and parsed ranges, eliminating per-cell string parsing overhead during calendar grid rendering.
29
+
12
30
  ## [3.0.3] - 2026-07-29
13
31
 
14
32
  ### Added
package/MIGRATION.md CHANGED
@@ -2,11 +2,12 @@
2
2
 
3
3
  This document provides migration instructions for upgrading between major versions of ngxsmk-datepicker.
4
4
 
5
- **Last updated:** July 29, 2026 - **Current stable:** v3.0.3
5
+ **Last updated:** August 18, 2026 - **Current stable:** v3.0.4
6
6
 
7
7
  ## Table of Contents
8
8
 
9
- - [v2.4.0 → v3.0.3](#v240---v302)
9
+ - [v3.0.3 → v3.0.4](#v303---v304)
10
+ - [v2.4.0 → v3.0.3](#v240---v303)
10
11
  - [v2.2.15 → v2.3.1](#v2215---v231)
11
12
  - [v2.2.7 → v2.2.11](#v227---v228)
12
13
  - [v2.2.6 → v2.2.7](#v226---v227)
@@ -60,6 +61,17 @@ This document provides migration instructions for upgrading between major versio
60
61
  - [v1.8.0 → v1.9.0](#v180---v190)
61
62
  - [v1.7.0 → v1.8.0](#v170---v180)
62
63
 
64
+ ## v3.0.3 → v3.0.4
65
+
66
+ ### Changes
67
+
68
+ All new functionality is backwards-compatible and opt-in:
69
+ - **Built-in Reactive Forms Validators**: Added type-safe validators `ngxsmkMinDateValidator`, `ngxsmkMaxDateValidator`, `ngxsmkDateRangeValidator`, and `ngxsmkBlockedDatesValidator` in `@ngxsmk/datepicker` public API.
70
+ - **Built-in Range Presets (`[showPresets]`)**: Standard preset ranges for range picker mode (*Today*, *Yesterday*, *Last 7 Days*, *Last 30 Days*, *This Month*, *Last Month*).
71
+ - **Performance**: Precomputed lookup Set for disabled dates and parsed ranges, eliminating per-cell string parsing during calendar grid rendering.
72
+ - **Accessibility**: Reduced-motion styles across all overlay/drawer surfaces, and ARIA grid attributes for year/decade views.
73
+ - **Bug Fix**: Fixed Issue #311 (Month/year dropdowns desynchronize after clear).
74
+
63
75
  ## v2.4.0 → v3.0.3
64
76
 
65
77
  ### Changes
package/README.md CHANGED
@@ -11,16 +11,18 @@
11
11
  ### _The Gold Standard for Premium Angular Calendar Selection_
12
12
 
13
13
  [![npm version](https://img.shields.io/npm/v/ngxsmk-datepicker.svg?style=flat-square&color=6d28d9)](https://www.npmjs.com/package/ngxsmk-datepicker)
14
+ [![npm downloads](https://img.shields.io/npm/dm/ngxsmk-datepicker.svg?style=flat-square)](https://www.npmjs.com/package/ngxsmk-datepicker)
14
15
  [![CI](https://img.shields.io/github/actions/workflow/status/NGXSMK/ngxsmk-datepicker/ci.yml?branch=main&label=CI&style=flat-square)](https://github.com/NGXSMK/ngxsmk-datepicker/actions/workflows/ci.yml)
15
16
  [![Angular](https://img.shields.io/badge/Angular-17%2B-DD0031.svg?style=flat-square&logo=angular)](https://angular.io/)
16
17
  [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/NGXSMK/ngxsmk-datepicker/blob/main/LICENSE)
18
+ [![WhatsApp Channel](https://img.shields.io/badge/WhatsApp-Channel-25D366?style=flat-square&logo=whatsapp&logoColor=white)](https://whatsapp.com/channel/0029Vb8PWpz1XquUOnGPUM2p)
17
19
  [![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-toozuuu-orange?style=flat-square&logo=buy-me-a-coffee)](https://buymeacoffee.com/toozuuu)
18
20
  [![Bundle Size](https://img.shields.io/badge/bundle-~127KB-success.svg?style=flat-square)](https://bundlephobia.com/package/ngxsmk-datepicker)
19
21
  [![Zoneless](https://img.shields.io/badge/Zoneless-Ready-blueviolet.svg?style=flat-square)](https://angular.dev/guide/zoneless)
20
22
 
21
23
  **`npm i ngxsmk-datepicker`**
22
24
 
23
- [Live demo](https://ngxsmk.github.io/ngxsmk-datepicker/) • [StackBlitz (repo)](https://stackblitz.com/github/NGXSMK/ngxsmk-datepicker) • [API docs](https://github.com/NGXSMK/ngxsmk-datepicker/blob/main/projects/ngxsmk-datepicker/docs/API.md) • [Issues](https://github.com/NGXSMK/ngxsmk-datepicker/issues) • [Buy me a coffee](https://buymeacoffee.com/toozuuu)
25
+ [Live demo](https://ngxsmk.github.io/ngxsmk-datepicker/) • [WhatsApp Channel](https://whatsapp.com/channel/0029Vb8PWpz1XquUOnGPUM2p) • [StackBlitz (repo)](https://stackblitz.com/github/NGXSMK/ngxsmk-datepicker) • [API docs](https://github.com/NGXSMK/ngxsmk-datepicker/blob/main/projects/ngxsmk-datepicker/docs/API.md) • [Issues](https://github.com/NGXSMK/ngxsmk-datepicker/issues) • [Buy me a coffee](https://buymeacoffee.com/toozuuu)
24
26
 
25
27
  *StackBlitz:* after it boots, run `npm install` then `npm start` in the terminal to serve the demo app (`demo-app`).
26
28
 
@@ -28,15 +30,15 @@
28
30
 
29
31
  ---
30
32
 
31
- **Last updated:** July 29, 2026 - **Current stable:** v3.0.3
33
+ **Last updated:** August 18, 2026 - **Current stable:** v3.0.4
32
34
 
33
35
  ### **Overview**
34
36
 
35
37
  **ngxsmk-datepicker** is a high-performance, enterprise-ready date and range picker engineered for the modern Angular ecosystem (v17+). Built from the ground up with **Angular Signals**, it delivers a seamless, zoneless-ready experience for both desktop and mobile (Ionic) applications.
36
38
 
37
- > **Stable Release**: `v3.0.3` is the current stable release with compiled `fesm2022` output and type declarations.
39
+ > **Stable Release**: `v3.0.4` is the current stable release with compiled `fesm2022` output and type declarations.
38
40
  >
39
- > **Stable line**: v2.3.x includes side-by-side **`calendars`**, **natural language input**, searchable **timezone selection dropdown UI**, dynamic range presets, and warning range highlighting. Versions **2.0.10** and **2.0.11** were broken and have been **unpublished**; use **v2.1.1+** or current **v3.0.3** on npm.
41
+ > **Stable line**: v2.3.x includes side-by-side **`calendars`**, **natural language input**, searchable **timezone selection dropdown UI**, dynamic range presets, and warning range highlighting. Versions **2.0.10** and **2.0.11** were broken and have been **unpublished**; use **v2.1.1+** or current **v3.0.4** on npm.
40
42
 
41
43
  ---
42
44
 
@@ -186,7 +188,7 @@ ng add ngxsmk-datepicker
186
188
  The `ng add` schematic installs the package, adds the `luxon` peer dependency if it is missing, and prints a getting-started snippet. Plain npm works too:
187
189
 
188
190
  ```bash
189
- npm install ngxsmk-datepicker@3.0.3
191
+ npm install ngxsmk-datepicker@3.0.4
190
192
  ```
191
193
 
192
194
  ### Alternative installation
@@ -195,12 +197,12 @@ You can install without npm using any of these methods (peer dependencies must s
195
197
 
196
198
  | Method | Command |
197
199
  |--------|--------|
198
- | **Yarn** | `yarn add ngxsmk-datepicker@3.0.3` |
199
- | **pnpm** | `pnpm add ngxsmk-datepicker@3.0.3` |
200
- | **Bun** | `bun add ngxsmk-datepicker@3.0.3` |
201
- | **From Git** | `npm install github:NGXSMK/ngxsmk-datepicker#v3.0.3` (requires the repo to have built output or you build from source) |
200
+ | **Yarn** | `yarn add ngxsmk-datepicker@3.0.4` |
201
+ | **pnpm** | `pnpm add ngxsmk-datepicker@3.0.4` |
202
+ | **Bun** | `bun add ngxsmk-datepicker@3.0.4` |
203
+ | **From Git** | `npm install github:NGXSMK/ngxsmk-datepicker#v3.0.4` (requires the repo to have built output or you build from source) |
202
204
  | **Local path** | Build the library in the repo (`npx ng build ngxsmk-datepicker`), then `npm install /path/to/ngxsmk-datepicker/dist/ngxsmk-datepicker` |
203
- | **CDN (ESM)** | Use [unpkg](https://unpkg.com/ngxsmk-datepicker@3.0.3/) or [jsDelivr](https://cdn.jsdelivr.net/npm/ngxsmk-datepicker@3.0.3/) in your bundler or import map; peer dependencies (Angular, etc.) must be installed in your app. |
205
+ | **CDN (ESM)** | Use [unpkg](https://unpkg.com/ngxsmk-datepicker@3.0.4/) or [jsDelivr](https://cdn.jsdelivr.net/npm/ngxsmk-datepicker@3.0.4/) in your bundler or import map; peer dependencies (Angular, etc.) must be installed in your app. |
204
206
 
205
207
  For all options and caveats, see [docs/INSTALLATION.md](docs/INSTALLATION.md).
206
208
 
@@ -540,6 +542,38 @@ By default, the datepicker input is `readonly` to prevent invalid date strings a
540
542
  2. **Custom Validation Logic:**
541
543
  If you prefer the readonly behavior, ensure your form submission handler explicitly checks `form.invalid` before proceeding, as the browser won't stop the submit button click.
542
544
 
545
+ ### **Built-in Reactive Forms Validators**
546
+
547
+ `ngxsmk-datepicker` exports convenient, type-safe Angular `ValidatorFn` functions for standard form validation:
548
+
549
+ ```typescript
550
+ import { FormControl, FormGroup } from '@angular/forms';
551
+ import {
552
+ ngxsmkMinDateValidator,
553
+ ngxsmkMaxDateValidator,
554
+ ngxsmkDateRangeValidator,
555
+ ngxsmkBlockedDatesValidator
556
+ } from 'ngxsmk-datepicker';
557
+
558
+ const form = new FormGroup({
559
+ // Minimum date validator (Date, string, or dynamic factory)
560
+ arrivalDate: new FormControl(null, [ngxsmkMinDateValidator(new Date())]),
561
+
562
+ // Maximum date validator
563
+ departureDate: new FormControl(null, [ngxsmkMaxDateValidator(new Date(2026, 11, 31))]),
564
+
565
+ // Range validation: requires both dates, 2 to 14 days duration
566
+ tripRange: new FormControl(null, [
567
+ ngxsmkDateRangeValidator({ minDays: 2, maxDays: 14, requireBoth: true })
568
+ ]),
569
+
570
+ // Disallow weekends or specific blackout dates
571
+ bookingDate: new FormControl(null, [
572
+ ngxsmkBlockedDatesValidator((d: Date) => d.getDay() === 0 || d.getDay() === 6)
573
+ ]),
574
+ });
575
+ ```
576
+
543
577
  ## **⚙️ API Reference**
544
578
 
545
579
  ### **Inputs**
@@ -550,7 +584,8 @@ By default, the datepicker input is `readonly` to prevent invalid date strings a
550
584
  | inline | boolean \| 'always' \| 'auto' | false | Controls the display mode. `true` or `'always'` for inline, `'auto'` for responsive. |
551
585
  | locale | string | navigator.language | Sets the locale for language and regional formatting (e.g., 'en-US', 'de-DE'). |
552
586
  | theme | 'light' \| 'dark' | 'light' | The color theme. |
553
- | showRanges | boolean | true | If true, displays the predefined ranges panel when in 'range' mode. |
587
+ | showRanges | boolean | true | If true, displays custom predefined ranges panel when in 'range' mode. |
588
+ | showPresets | boolean | false | If true, displays standard quick presets (*Today*, *Yesterday*, *Last 7 Days*, *This Month*, etc.). |
554
589
  | minDate | DateInput | null | The earliest selectable date. |
555
590
  | maxDate | DateInput | null | The latest selectable date. |
556
591
  | isInvalidDate | (date: Date) => boolean | () => false | A function to programmatically disable specific dates. |
@@ -928,7 +963,7 @@ We welcome and appreciate contributions from the community! Whether it's reporti
928
963
 
929
964
  ## **📄 Changelog**
930
965
 
931
- **Recent:** Use **v3.0.3** on npm. The v2.3.x line adds side-by-side multi-calendar layouts, natural language typing, timezone selector UI dropdown, warning style selections, and strict TypeScript/AOT stability. Versions 2.0.10 and 2.0.11 are unpublished; use v2.1.1+ or **v3.0.3**.
966
+ **Recent:** Use **v3.0.4** on npm. The v2.3.x line adds side-by-side multi-calendar layouts, natural language typing, timezone selector UI dropdown, warning style selections, and strict TypeScript/AOT stability. Versions 2.0.10 and 2.0.11 are unpublished; use v2.1.1+ or **v3.0.4**.
932
967
 
933
968
  For the full list of changes, see [CHANGELOG.md](https://github.com/NGXSMK/ngxsmk-datepicker/blob/main/CHANGELOG.md).
934
969
 
@@ -960,15 +995,20 @@ The hosted **[live demo](https://ngxsmk.github.io/ngxsmk-datepicker/)** build sh
960
995
 
961
996
  - 📧 Email: [sachindilshan040@gmail.com](mailto:sachindilshan040@gmail.com)
962
997
  - 🐙 GitHub: [@toozuuu](https://github.com/toozuuu)
998
+ - 💬 WhatsApp Channel: [NGXSMK Channel](https://whatsapp.com/channel/0029Vb8PWpz1XquUOnGPUM2p)
963
999
  - 📦 NPM: [ngxsmk-datepicker](https://www.npmjs.com/package/ngxsmk-datepicker)
964
1000
  - 🌐 Website: [sachindilshan.com](https://www.sachindilshan.com/)
965
1001
  - 💼 LinkedIn: [sachindilshan](https://www.linkedin.com/in/sachindilshan/)
966
1002
 
967
- ## **⭐ Support**
1003
+ ## **⭐ Community & Support**
1004
+
1005
+ Stay connected and receive updates, release announcements, and tips via our official WhatsApp Channel:
1006
+ 👉 **[Join WhatsApp Channel](https://whatsapp.com/channel/0029Vb8PWpz1XquUOnGPUM2p)**
968
1007
 
969
1008
  If you find this library helpful, please consider:
970
1009
 
971
1010
  - ⭐ **Starring** the repository
1011
+ - 💬 **Joining** our [WhatsApp Channel](https://whatsapp.com/channel/0029Vb8PWpz1XquUOnGPUM2p)
972
1012
  - 🐛 **Reporting** bugs and issues
973
1013
  - 💡 **Suggesting** new features
974
1014
  - 🤝 **Contributing** code improvements