@oneluiz/dual-datepicker 3.0.0 → 3.1.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/MIGRATION_V3.md DELETED
@@ -1,210 +0,0 @@
1
- # Migration Guide: v2.x → v3.0.0
2
-
3
- ## ⚠️ BREAKING CHANGES
4
-
5
- Version 3.0.0 is a major refactoring that removes deprecated features and translates all Spanish property names to English for better international adoption and code maintainability.
6
-
7
- ## 1. DateRange Interface Changes
8
-
9
- **All properties renamed from Spanish to English:**
10
-
11
- ### Before (v2.x):
12
- ```typescript
13
- interface DateRange {
14
- fechaInicio: string;
15
- fechaFin: string;
16
- rangoTexto: string;
17
- }
18
- ```
19
-
20
- ### After (v3.0.0):
21
- ```typescript
22
- interface DateRange {
23
- startDate: string;
24
- endDate: string;
25
- rangeText: string;
26
- }
27
- ```
28
-
29
- **Migration:**
30
- ```typescript
31
- // OLD
32
- const range: DateRange = {
33
- fechaInicio: '2026-01-01',
34
- fechaFin: '2026-01-31',
35
- rangoTexto: 'Jan 1 - Jan 31'
36
- };
37
- console.log(range.fechaInicio); // OLD
38
-
39
- // NEW
40
- const range: DateRange = {
41
- startDate: '2026-01-01',
42
- endDate: '2026-01-31',
43
- rangeText: 'Jan 1 - Jan 31'
44
- };
45
- console.log(range.startDate); // NEW
46
- ```
47
-
48
- ## 2. Component @Input Properties
49
-
50
- ### Before (v2.x):
51
- ```html
52
- <ngx-dual-datepicker
53
- [fechaInicio]="startValue"
54
- [fechaFin]="endValue">
55
- </ngx-dual-datepicker>
56
- ```
57
-
58
- ### After (v3.0.0):
59
- ```html
60
- <ngx-dual-datepicker
61
- [startDate]="startValue"
62
- [endDate]="endValue">
63
- </ngx-dual-datepicker>
64
- ```
65
-
66
- ## 3. PresetConfig - Removed Deprecated `daysAgo`
67
-
68
- **The deprecated `daysAgo` pattern has been completely removed.**
69
-
70
- ### Before (v2.x):
71
- ```typescript
72
- // This NO LONGER WORKS in v3.0.0
73
- presets: PresetConfig[] = [
74
- { label: 'Last 30 days', daysAgo: 30 } // ❌ REMOVED
75
- ];
76
- ```
77
-
78
- ### After (v3.0.0):
79
- ```typescript
80
- import { getLastNDays } from '@oneluiz/dual-datepicker';
81
-
82
- presets: PresetConfig[] = [
83
- { label: 'Last 30 days', getValue: () => getLastNDays(30) } // ✅ REQUIRED
84
- ];
85
- ```
86
-
87
- **Or use pre-built CommonPresets:**
88
- ```typescript
89
- import { CommonPresets } from '@oneluiz/dual-datepicker';
90
-
91
- presets = CommonPresets.dashboard; // ✅ Already uses getValue()
92
- ```
93
-
94
- ## 4. Event Handler Updates
95
-
96
- ### Before (v2.x):
97
- ```typescript
98
- onDateRangeChange(range: DateRange) {
99
- console.log('Start:', range.fechaInicio);
100
- console.log('End:', range.fechaFin);
101
- console.log('Text:', range.rangoTexto);
102
- }
103
- ```
104
-
105
- ### After (v3.0.0):
106
- ```typescript
107
- onDateRangeChange(range: DateRange) {
108
- console.log('Start:', range.startDate);
109
- console.log('End:', range.endDate);
110
- console.log('Text:', range.rangeText);
111
- }
112
- ```
113
-
114
- ## 5. Multi-Range Interface Updates
115
-
116
- ### Before (v2.x):
117
- ```typescript
118
- onMultiRangeChange(data: MultiDateRange) {
119
- data.ranges.forEach(range => {
120
- console.log(range.fechaInicio, range.fechaFin); // OLD
121
- });
122
- }
123
- ```
124
-
125
- ### After (v3.0.0):
126
- ```typescript
127
- onMultiRangeChange(data: MultiDateRange) {
128
- data.ranges.forEach(range => {
129
- console.log(range.startDate, range.endDate); // NEW
130
- });
131
- }
132
- ```
133
-
134
- ## 6. Reactive Forms / ControlValueAccessor
135
-
136
- ### Before (v2.x):
137
- ```typescript
138
- this.form.patchValue({
139
- dateRange: {
140
- fechaInicio: '2026-01-01',
141
- fechaFin: '2026-01-31',
142
- rangoTexto: 'Jan 1 - Jan 31'
143
- }
144
- });
145
- ```
146
-
147
- ### After (v3.0.0):
148
- ```typescript
149
- this.form.patchValue({
150
- dateRange: {
151
- startDate: '2026-01-01',
152
- endDate: '2026-01-31',
153
- rangeText: 'Jan 1 - Jan 31'
154
- }
155
- });
156
- ```
157
-
158
- ## Quick Migration Checklist
159
-
160
- - [ ] Replace `fechaInicio` with `startDate` in all templates
161
- - [ ] Replace `fechaFin` with `endDate` in all templates
162
- - [ ] Replace `rangoTexto` with `rangeText` in all templates
163
- - [ ] Update `@Input()` bindings: `[fechaInicio]` → `[startDate]`, `[fechaFin]` → `[endDate]`
164
- - [ ] Update all `DateRange` property references in TypeScript
165
- - [ ] Remove all `daysAgo` usage and replace with `getValue: () => getLastNDays(n)`
166
- - [ ] Update presets to use `getValue` functions or CommonPresets
167
- - [ ] Update event handlers accessing `DateRange` properties
168
- - [ ] Update form control value accessors
169
- - [ ] Test multi-range functionality if used
170
-
171
- ## Automated Migration (Find & Replace)
172
-
173
- You can use these find & replace patterns in your codebase:
174
-
175
- 1. **TypeScript files (*.ts):**
176
- - `fechaInicio` → `startDate`
177
- - `fechaFin` → `endDate`
178
- - `rangoTexto` → `rangeText`
179
- - `daysAgo:` → Remove and replace with `getValue: () => getLastNDays(...)`
180
-
181
- 2. **HTML Templates (*.html):**
182
- - `[fechaInicio]` → `[startDate]`
183
- - `[fechaFin]` → `[endDate]`
184
- - `range.fechaInicio` → `range.startDate`
185
- - `range.fechaFin` → `range.endDate`
186
- - `range.rangoTexto` → `range.rangeText`
187
-
188
- ## Why This Change?
189
-
190
- 1. **International Adoption**: English property names make the library more accessible globally
191
- 2. **Code Maintainability**: Consistent naming conventions across the codebase
192
- 3. **Professional Standard**: Aligns with TypeScript/Angular conventions
193
- 4. **Remove Technical Debt**: Eliminates deprecated `daysAgo` pattern
194
- 5. **Cleaner API**: More intuitive and self-documenting code
195
-
196
- ## Need Help?
197
-
198
- - 📖 [Full Documentation](https://oneluiz.github.io/ng-dual-datepicker/)
199
- - 🐛 [Report Issues](https://github.com/oneluiz/ng-dual-datepicker/issues)
200
- - 💬 [Discussions](https://github.com/oneluiz/ng-dual-datepicker/discussions)
201
-
202
- ## Rollback to v2.x
203
-
204
- If you need more time to migrate, you can stay on v2.7.0:
205
-
206
- ```bash
207
- npm install @oneluiz/dual-datepicker@2.7.0
208
- ```
209
-
210
- Version 2.7.0 will continue to work but will not receive new features.
package/angular.json DELETED
@@ -1,75 +0,0 @@
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 DELETED
@@ -1,21 +0,0 @@
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.