@oneluiz/dual-datepicker 2.0.0 → 2.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneluiz/dual-datepicker",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "A customizable dual-calendar date range picker component for Angular 17+",
5
5
  "keywords": [
6
6
  "angular",
@@ -28,25 +28,22 @@
28
28
  "@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
29
29
  "@angular/forms": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0"
30
30
  },
31
- "files": [
32
- "dist",
33
- "README.md",
34
- "LICENSE"
35
- ],
36
- "scripts": {
37
- "build": "ng-packagr -p ng-package.json",
38
- "prepare": "npm run build"
39
- },
40
- "devDependencies": {
41
- "@angular/common": "^17.3.12",
42
- "@angular/compiler": "^18.2.14",
43
- "@angular/compiler-cli": "^18.2.14",
44
- "@angular/core": "^17.3.12",
45
- "@angular/forms": "^17.3.12",
46
- "ng-packagr": "^18.2.1",
47
- "rxjs": "^7.8.2",
48
- "typescript": "5.5",
49
- "zone.js": "^0.14.10"
31
+ "packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad",
32
+ "module": "fesm2022/oneluiz-dual-datepicker.mjs",
33
+ "typings": "index.d.ts",
34
+ "exports": {
35
+ "./package.json": {
36
+ "default": "./package.json"
37
+ },
38
+ ".": {
39
+ "types": "./index.d.ts",
40
+ "esm2022": "./esm2022/oneluiz-dual-datepicker.mjs",
41
+ "esm": "./esm2022/oneluiz-dual-datepicker.mjs",
42
+ "default": "./fesm2022/oneluiz-dual-datepicker.mjs"
43
+ }
50
44
  },
51
- "packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad"
52
- }
45
+ "sideEffects": false,
46
+ "dependencies": {
47
+ "tslib": "^2.3.0"
48
+ }
49
+ }
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.
package/dist/README.md DELETED
@@ -1,280 +0,0 @@
1
- # @oneluiz/dual-datepicker
2
-
3
- A beautiful, customizable dual-calendar date range picker for Angular 17+. Built as a standalone component with full TypeScript support.
4
-
5
- ![npm version](https://img.shields.io/npm/v/@oneluiz/dual-datepicker)
6
- ![license](https://img.shields.io/npm/l/@ngx-tools/dual-datepicker)
7
- ![Angular](https://img.shields.io/badge/Angular-17%2B-red)
8
-
9
- ## ✨ Features
10
-
11
- - 📅 **Dual Calendar Display** - Side-by-side month view for easy range selection
12
- - 🎨 **Fully Customizable** - Color scheme, padding, and styling
13
- - ⚡ **Preset Ranges** - Configurable quick-select options
14
- - 🎯 **Standalone Component** - No module imports required
15
- - � **Zero Dependencies** - No Bootstrap or other CSS frameworks required
16
- - �📱 **Responsive Design** - Works on desktop and mobile
17
- - 🌐 **TypeScript** - Full type safety
18
- - ♿ **Accessible** - Keyboard navigation and ARIA labels
19
- - 🎭 **Flexible Behavior** - Control when the picker closes
20
-
21
- ## 📦 Installation
22
-
23
- ```bash
24
- npm install @oneluiz/dual-datepicker
25
- ```
26
-
27
- ## 🚀 Quick Start
28
-
29
- ### 1. Import the Component
30
-
31
- ```typescript
32
- import { Component } from '@angular/core';
33
- import { DualDatepickerComponent, DateRange } from '@oneluiz/dual-datepicker';
34
-
35
- @Component({
36
- selector: 'app-root',
37
- standalone: true,
38
- imports: [DualDatepickerComponent],
39
- template: `
40
- <ngx-dual-datepicker
41
- [(ngModel)]="dateRange"
42
- placeholder="Select date range">
43
- </ngx-dual-datepicker>
44
- `
45
- })
46
- export class AppComponent {
47
- dateRange: DateRange = { start: null, end: null };
48
- }
49
- ```
50
-
51
- ### 2. Use with Forms
52
-
53
- ```typescript
54
- import { Component } from '@angular/core';
55
- import { FormsModule } from '@angular/forms';
56
- import { DualDatepickerComponent } from '@oneluiz/dual-datepicker';
57
-
58
- @Component({
59
- selector: 'app-example',
60
- standalone: true,
61
- imports: [FormsModule, DualDatepickerComponent],
62
- template: `
63
- <ngx-dual-datepicker
64
- [(ngModel)]="selectedRange"
65
- [presets]="customPresets"
66
- (ngModelChange)="onDateChange($event)">
67
- </ngx-dual-datepicker>
68
- `
69
- })
70
- export class ExampleComponent {
71
- selectedRange = { start: null, end: null };
72
-
73
- customPresets = [
74
- { label: 'Last 7 days', daysAgo: 7 },
75
- { label: 'Last 30 days', daysAgo: 30 },
76
- { label: 'Last 90 days', daysAgo: 90 }
77
- ];
78
-
79
- onDateChange(range: any) {
80
- console.log('Date range selected:', range);
81
- }
82
- }
83
- ```
84
-
85
- ## 🎨 Customization
86
-
87
- ### Custom Colors (Bootstrap Style)
88
-
89
- ```typescript
90
- <ngx-dual-datepicker
91
- [(ngModel)]="dateRange"
92
- inputBackgroundColor="#ffffff"
93
- inputTextColor="#495057"
94
- inputBorderColor="#ced4da"
95
- inputBorderColorHover="#80bdff"
96
- inputBorderColorFocus="#80bdff"
97
- inputPadding="0.375rem 0.75rem">
98
- </ngx-dual-datepicker>
99
- ```
100
-
101
- ### Custom Colors (GitHub Style)
102
-
103
- ```typescript
104
- <ngx-dual-datepicker
105
- [(ngModel)]="dateRange"
106
- inputBackgroundColor="#f3f4f6"
107
- inputTextColor="#24292e"
108
- inputBorderColor="transparent"
109
- inputBorderColorHover="#d1d5db"
110
- inputBorderColorFocus="#80bdff"
111
- inputPadding="6px 10px">
112
- </ngx-dual-datepicker>
113
- ```
114
-
115
- ### Custom Presets
116
-
117
- ```typescript
118
- customPresets: PresetConfig[] = [
119
- { label: 'Last 15 days', daysAgo: 15 },
120
- { label: 'Last 3 months', daysAgo: 90 },
121
- { label: 'Last 6 months', daysAgo: 180 },
122
- { label: 'Last year', daysAgo: 365 }
123
- ];
124
- ```
125
-
126
- ```html
127
- <ngx-dual-datepicker
128
- [(ngModel)]="dateRange"
129
- [presets]="customPresets">
130
- </ngx-dual-datepicker>
131
- ```
132
-
133
- ## 📖 API Reference
134
-
135
- ### Inputs
136
-
137
- | Property | Type | Default | Description |
138
- |----------|------|---------|-------------|
139
- | `ngModel` | `DateRange` | `{ start: null, end: null }` | Two-way binding for selected date range |
140
- | `placeholder` | `string` | `'Select date range'` | Input placeholder text |
141
- | `presets` | `PresetConfig[]` | Default presets | Array of preset configurations |
142
- | `closeOnSelection` | `boolean` | `false` | Close picker when both dates selected |
143
- | `closeOnPresetSelection` | `boolean` | `false` | Close picker when preset is clicked |
144
- | `closeOnClickOutside` | `boolean` | `true` | Close picker when clicking outside |
145
- | `inputBackgroundColor` | `string` | `'#fff'` | Input background color |
146
- | `inputTextColor` | `string` | `'#495057'` | Input text color |
147
- | `inputBorderColor` | `string` | `'#ced4da'` | Input border color |
148
- | `inputBorderColorHover` | `string` | `'#9ca3af'` | Input border color on hover |
149
- | `inputBorderColorFocus` | `string` | `'#80bdff'` | Input border color on focus |
150
- | `inputPadding` | `string` | `'0.375rem 0.75rem'` | Input padding |
151
-
152
- ### Outputs
153
-
154
- | Event | Type | Description |
155
- |-------|------|-------------|
156
- | `ngModelChange` | `EventEmitter<DateRange>` | Emitted when date range changes |
157
-
158
- ### Types
159
-
160
- ```typescript
161
- interface DateRange {
162
- start: Date | null;
163
- end: Date | null;
164
- }
165
-
166
- interface PresetConfig {
167
- label: string;
168
- daysAgo: number;
169
- }
170
- ```
171
-
172
- ### Default Presets
173
-
174
- ```typescript
175
- [
176
- { label: 'Last month', daysAgo: 30 },
177
- { label: 'Last 6 months', daysAgo: 180 },
178
- { label: 'Last year', daysAgo: 365 }
179
- ]
180
- ```
181
-
182
- ## 🎯 Examples
183
-
184
- ### Minimal Usage
185
-
186
- ```html
187
- <ngx-dual-datepicker [(ngModel)]="dateRange"></ngx-dual-datepicker>
188
- ```
189
-
190
- ### With Auto-close
191
-
192
- ```html
193
- <ngx-dual-datepicker
194
- [(ngModel)]="dateRange"
195
- [closeOnSelection]="true"
196
- [closeOnPresetSelection]="true">
197
- </ngx-dual-datepicker>
198
- ```
199
-
200
- ### Custom Styling
201
-
202
- ```html
203
- <ngx-dual-datepicker
204
- [(ngModel)]="dateRange"
205
- placeholder="Pick your dates"
206
- inputBackgroundColor="#fef3c7"
207
- inputTextColor="#92400e"
208
- inputBorderColor="#fbbf24"
209
- inputBorderColorHover="#f59e0b"
210
- inputBorderColorFocus="#d97706"
211
- inputPadding="8px 12px">
212
- </ngx-dual-datepicker>
213
- ```
214
-
215
- ### With Event Handler
216
-
217
- ```typescript
218
- @Component({
219
- selector: 'app-example',
220
- template: `
221
- <ngx-dual-datepicker
222
- [(ngModel)]="dateRange"
223
- (ngModelChange)="onDateRangeChange($event)">
224
- </ngx-dual-datepicker>
225
-
226
- <div *ngIf="dateRange.start && dateRange.end">
227
- Selected: {{ formatDateRange() }}
228
- </div>
229
- `
230
- })
231
- export class ExampleComponent {
232
- dateRange: DateRange = { start: null, end: null };
233
-
234
- onDateRangeChange(range: DateRange) {
235
- console.log('Start:', range.start);
236
- console.log('End:', range.end);
237
-
238
- if (range.start && range.end) {
239
- // Both dates selected - do something
240
- this.fetchData(range.start, range.end);
241
- }
242
- }
243
-
244
- formatDateRange(): string {
245
- if (!this.dateRange.start || !this.dateRange.end) return '';
246
- return `${this.dateRange.start.toLocaleDateString()} - ${this.dateRange.end.toLocaleDateString()}`;
247
- }
248
-
249
- fetchData(start: Date, end: Date) {
250
- // Your API call here
251
- }
252
- }
253
- ```
254
-
255
- ## 🛠️ Requirements
256
-
257
- - Angular 17.0.0 or higher
258
- - Angular 18.0.0 or higher
259
- - Angular 19.0.0 or higher
260
- - Angular 20.0.0 or higher
261
-
262
- ## 📄 License
263
-
264
- MIT © Luis Cortes
265
-
266
- ## 🤝 Contributing
267
-
268
- Contributions are welcome! Please feel free to submit a Pull Request.
269
-
270
- ## 🐛 Issues
271
-
272
- Found a bug? Please [open an issue](https://github.com/oneluiz/ng-dual-datepicker/issues).
273
-
274
- ## ⭐ Support
275
-
276
- If you find this package useful, please give it a star on [GitHub](https://github.com/oneluiz/ng-dual-datepicker)!
277
-
278
- ---
279
-
280
- Made with ❤️ by [Luis Cortes](https://github.com/oneluiz)
File without changes
File without changes
File without changes