@oneluiz/dual-datepicker 2.6.0 → 2.7.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/.angular/cache/18.2.21/demo/angular-compiler.db +0 -0
- package/.angular/cache/18.2.21/demo/angular-compiler.db-lock +0 -0
- package/.nojekyll +0 -0
- package/GITHUB_PAGES.md +82 -0
- package/README.md +69 -0
- package/angular.json +75 -0
- package/dist/LICENSE +21 -0
- package/dist/README.md +925 -0
- package/{dual-datepicker.component.d.ts → dist/dual-datepicker.component.d.ts} +13 -1
- package/dist/esm2022/dual-datepicker.component.mjs +466 -0
- package/{esm2022 → dist/esm2022}/public-api.mjs +1 -1
- package/{fesm2022 → dist/fesm2022}/oneluiz-dual-datepicker.mjs +128 -24
- package/dist/fesm2022/oneluiz-dual-datepicker.mjs.map +1 -0
- package/{public-api.d.ts → dist/public-api.d.ts} +1 -1
- package/ng-package.json +7 -0
- package/package.json +24 -20
- package/esm2022/dual-datepicker.component.mjs +0 -362
- package/fesm2022/oneluiz-dual-datepicker.mjs.map +0 -1
- /package/{date-adapter.d.ts → dist/date-adapter.d.ts} +0 -0
- /package/{esm2022 → dist/esm2022}/date-adapter.mjs +0 -0
- /package/{esm2022 → dist/esm2022}/native-date-adapter.mjs +0 -0
- /package/{esm2022 → dist/esm2022}/oneluiz-dual-datepicker.mjs +0 -0
- /package/{esm2022 → dist/esm2022}/preset-utils.mjs +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{native-date-adapter.d.ts → dist/native-date-adapter.d.ts} +0 -0
- /package/{preset-utils.d.ts → dist/preset-utils.d.ts} +0 -0
|
Binary file
|
|
Binary file
|
package/.nojekyll
ADDED
|
File without changes
|
package/GITHUB_PAGES.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# GitHub Pages Setup
|
|
2
|
+
|
|
3
|
+
This project includes a live demo hosted on GitHub Pages.
|
|
4
|
+
|
|
5
|
+
## 🚀 Viewing the Demo
|
|
6
|
+
|
|
7
|
+
Visit [https://oneluiz.github.io/ng-dual-datepicker/](https://oneluiz.github.io/ng-dual-datepicker/) to see the component in action.
|
|
8
|
+
|
|
9
|
+
## 🛠️ Building the Demo Locally
|
|
10
|
+
|
|
11
|
+
To build and preview the demo locally:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Install dependencies
|
|
15
|
+
npm install
|
|
16
|
+
|
|
17
|
+
# Serve the demo locally
|
|
18
|
+
npm run demo:serve
|
|
19
|
+
|
|
20
|
+
# Build the demo for production
|
|
21
|
+
npm run demo:build
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The built demo will be placed in the `docs/` directory, which is configured for GitHub Pages deployment.
|
|
25
|
+
|
|
26
|
+
## 📝 GitHub Pages Configuration
|
|
27
|
+
|
|
28
|
+
To enable GitHub Pages for this repository:
|
|
29
|
+
|
|
30
|
+
1. Go to your repository settings on GitHub
|
|
31
|
+
2. Navigate to **Pages** in the left sidebar
|
|
32
|
+
3. Under **Source**, select:
|
|
33
|
+
- **Branch**: `main` (or your default branch)
|
|
34
|
+
- **Folder**: `/docs`
|
|
35
|
+
4. Click **Save**
|
|
36
|
+
5. Your site will be published at `https://[username].github.io/ng-dual-datepicker/`
|
|
37
|
+
|
|
38
|
+
## 🔄 Updating the Demo
|
|
39
|
+
|
|
40
|
+
After making changes to the demo:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Rebuild the demo
|
|
44
|
+
npm run demo:build
|
|
45
|
+
|
|
46
|
+
# Move files from browser subfolder to docs root
|
|
47
|
+
cd docs && mv browser/* . && rm -r browser && cd ..
|
|
48
|
+
|
|
49
|
+
# Commit and push changes
|
|
50
|
+
git add docs/
|
|
51
|
+
git commit -m "Update demo"
|
|
52
|
+
git push
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
GitHub Pages will automatically deploy the updated demo within a few minutes.
|
|
56
|
+
|
|
57
|
+
## 📁 Project Structure
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
ng-dual-datepicker/
|
|
61
|
+
├── src/ # Source code for the component
|
|
62
|
+
├── demo/ # Demo application source
|
|
63
|
+
│ └── src/
|
|
64
|
+
│ ├── app/ # Demo app components
|
|
65
|
+
│ ├── index.html # Demo HTML template
|
|
66
|
+
│ └── styles.scss # Demo styles
|
|
67
|
+
├── docs/ # Built demo (GitHub Pages)
|
|
68
|
+
│ ├── .nojekyll # Tells GitHub not to use Jekyll
|
|
69
|
+
│ ├── index.html
|
|
70
|
+
│ └── *.js, *.css # Compiled assets
|
|
71
|
+
└── dist/ # Built library package
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## 🎨 Customizing the Demo
|
|
75
|
+
|
|
76
|
+
The demo source code is in `demo/src/app/`. You can:
|
|
77
|
+
|
|
78
|
+
- Edit `app.component.html` to change the layout
|
|
79
|
+
- Edit `app.component.ts` to add new examples
|
|
80
|
+
- Edit `app.component.scss` or `styles.scss` for styling
|
|
81
|
+
|
|
82
|
+
After making changes, rebuild with `npm run demo:build`.
|
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ npm install @oneluiz/dual-datepicker
|
|
|
22
22
|
| **Dependencies** | Zero | Requires @angular/material, @angular/cdk |
|
|
23
23
|
| **Standalone** | ✅ Native | ⚠️ Requires module setup |
|
|
24
24
|
| **Signals Support** | ✅ Built-in | ❌ Not yet |
|
|
25
|
+
| **Multi-Range Support** | ✅ NEW v2.7.0 | ❌ Not available |
|
|
25
26
|
| **Customization** | Full styling control | Theme-constrained |
|
|
26
27
|
| **Learning Curve** | Minimal | Requires Material knowledge |
|
|
27
28
|
| **Change Detection** | OnPush optimized | Default |
|
|
@@ -33,6 +34,7 @@ npm install @oneluiz/dual-datepicker
|
|
|
33
34
|
- 🎯 **Standalone Component** – No NgModule imports needed
|
|
34
35
|
- ⚡ **Angular Signals** – Modern reactive state management
|
|
35
36
|
- 🔄 **Reactive Forms** – Full ControlValueAccessor implementation
|
|
37
|
+
- 🔥 **Multi-Range Support** – Select multiple date ranges (NEW v2.7.0 - Material CAN'T do this!)
|
|
36
38
|
- 🎨 **Fully Customizable** – Every color, padding, border configurable
|
|
37
39
|
- 📦 **Lightweight** – ~60 KB gzipped total bundle
|
|
38
40
|
- 🚀 **Performance** – OnPush change detection + trackBy optimization
|
|
@@ -211,6 +213,73 @@ export class SignalsExampleComponent {
|
|
|
211
213
|
}
|
|
212
214
|
```
|
|
213
215
|
|
|
216
|
+
### 5. Multi-Range Support 🔥 NEW v2.7.0!
|
|
217
|
+
|
|
218
|
+
**Material CAN'T do this!** Select multiple date ranges in a single picker - perfect for booking systems, blackout periods, and complex scheduling.
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
import { Component } from '@angular/core';
|
|
222
|
+
import { DualDatepickerComponent, MultiDateRange } from '@oneluiz/dual-datepicker';
|
|
223
|
+
|
|
224
|
+
@Component({
|
|
225
|
+
selector: 'app-multi-range',
|
|
226
|
+
standalone: true,
|
|
227
|
+
imports: [DualDatepickerComponent],
|
|
228
|
+
template: `
|
|
229
|
+
<ngx-dual-datepicker
|
|
230
|
+
[multiRange]="true"
|
|
231
|
+
[showClearButton]="true"
|
|
232
|
+
(multiDateRangeChange)="onMultiRangeChange($event)">
|
|
233
|
+
</ngx-dual-datepicker>
|
|
234
|
+
|
|
235
|
+
@if (selectedRanges && selectedRanges.ranges.length > 0) {
|
|
236
|
+
<div class="selected-ranges">
|
|
237
|
+
<h3>Selected Ranges ({{ selectedRanges.ranges.length }})</h3>
|
|
238
|
+
@for (range of selectedRanges.ranges; track $index) {
|
|
239
|
+
<div class="range-item">
|
|
240
|
+
<strong>Range {{ $index + 1 }}:</strong> {{ range.rangoTexto }}
|
|
241
|
+
<br>
|
|
242
|
+
<span>{{ range.fechaInicio }} → {{ range.fechaFin }}</span>
|
|
243
|
+
</div>
|
|
244
|
+
}
|
|
245
|
+
</div>
|
|
246
|
+
}
|
|
247
|
+
`
|
|
248
|
+
})
|
|
249
|
+
export class MultiRangeExample {
|
|
250
|
+
selectedRanges: MultiDateRange | null = null;
|
|
251
|
+
|
|
252
|
+
onMultiRangeChange(ranges: MultiDateRange) {
|
|
253
|
+
this.selectedRanges = ranges;
|
|
254
|
+
console.log('Selected ranges:', ranges.ranges);
|
|
255
|
+
// Output example:
|
|
256
|
+
// [
|
|
257
|
+
// { fechaInicio: '2026-01-01', fechaFin: '2026-01-05', rangoTexto: 'Jan 1 – Jan 5' },
|
|
258
|
+
// { fechaInicio: '2026-01-10', fechaFin: '2026-01-15', rangoTexto: 'Jan 10 – Jan 15' },
|
|
259
|
+
// { fechaInicio: '2026-02-01', fechaFin: '2026-02-07', rangoTexto: 'Feb 1 – Feb 7' }
|
|
260
|
+
// ]
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
#### Perfect Use Cases
|
|
266
|
+
|
|
267
|
+
- 🏨 **Hotel Booking Systems** - Block multiple periods for reservations
|
|
268
|
+
- 📅 **Event Blackout Periods** - Mark multiple dates as unavailable
|
|
269
|
+
- 🔧 **Maintenance Windows** - Schedule multiple maintenance periods
|
|
270
|
+
- 📊 **Availability Calendars** - Show multiple available/unavailable periods
|
|
271
|
+
- 👷 **Shift Scheduling** - Select multiple work periods
|
|
272
|
+
- 💼 **Business Meetings** - Block out multiple date ranges
|
|
273
|
+
|
|
274
|
+
#### Key Features
|
|
275
|
+
|
|
276
|
+
- ✅ Select unlimited date ranges
|
|
277
|
+
- ✅ Visual feedback - all ranges highlighted in calendar
|
|
278
|
+
- ✅ Easy management - add/remove ranges with one click
|
|
279
|
+
- ✅ Separate events for multi-range (`multiDateRangeChange`, `multiDateRangeSelected`)
|
|
280
|
+
- ✅ Clear all ranges with one button
|
|
281
|
+
- ❌ **Angular Material CANNOT do this!**
|
|
282
|
+
|
|
214
283
|
## 🔌 Date Adapter System
|
|
215
284
|
|
|
216
285
|
The library supports custom date adapters, allowing you to use different date libraries (DayJS, date-fns, Luxon) or custom backend models instead of native JavaScript `Date` objects.
|
package/angular.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"demo": {
|
|
7
|
+
"projectType": "application",
|
|
8
|
+
"schematics": {
|
|
9
|
+
"@schematics/angular:component": {
|
|
10
|
+
"style": "scss"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"root": "demo",
|
|
14
|
+
"sourceRoot": "demo/src",
|
|
15
|
+
"prefix": "app",
|
|
16
|
+
"architect": {
|
|
17
|
+
"build": {
|
|
18
|
+
"builder": "@angular-devkit/build-angular:application",
|
|
19
|
+
"options": {
|
|
20
|
+
"outputPath": "docs",
|
|
21
|
+
"index": "demo/src/index.html",
|
|
22
|
+
"browser": "demo/src/main.ts",
|
|
23
|
+
"polyfills": [
|
|
24
|
+
"zone.js"
|
|
25
|
+
],
|
|
26
|
+
"tsConfig": "demo/tsconfig.app.json",
|
|
27
|
+
"inlineStyleLanguage": "scss",
|
|
28
|
+
"assets": [
|
|
29
|
+
"demo/src/favicon.svg"
|
|
30
|
+
],
|
|
31
|
+
"styles": [
|
|
32
|
+
"demo/src/styles.scss"
|
|
33
|
+
],
|
|
34
|
+
"scripts": []
|
|
35
|
+
},
|
|
36
|
+
"configurations": {
|
|
37
|
+
"production": {
|
|
38
|
+
"budgets": [
|
|
39
|
+
{
|
|
40
|
+
"type": "initial",
|
|
41
|
+
"maximumWarning": "500kB",
|
|
42
|
+
"maximumError": "1MB"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "anyComponentStyle",
|
|
46
|
+
"maximumWarning": "4kB",
|
|
47
|
+
"maximumError": "10kB"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"outputHashing": "all"
|
|
51
|
+
},
|
|
52
|
+
"development": {
|
|
53
|
+
"optimization": false,
|
|
54
|
+
"extractLicenses": false,
|
|
55
|
+
"sourceMap": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"defaultConfiguration": "production"
|
|
59
|
+
},
|
|
60
|
+
"serve": {
|
|
61
|
+
"builder": "@angular-devkit/build-angular:dev-server",
|
|
62
|
+
"configurations": {
|
|
63
|
+
"production": {
|
|
64
|
+
"buildTarget": "demo:build:production"
|
|
65
|
+
},
|
|
66
|
+
"development": {
|
|
67
|
+
"buildTarget": "demo:build:development"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"defaultConfiguration": "development"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
package/dist/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Luis Cortes
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|