hijri-date-time-picker 1.0.0 → 1.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/dist/demo.js CHANGED
@@ -9,6 +9,11 @@ import { bootstrapApplication } from '@angular/platform-browser';
9
9
  import { HijriDatePickerComponent } from './lib/hijri-date-picker.component';
10
10
  let DemoComponent = class DemoComponent {
11
11
  selectedDates = {};
12
+ // Date range examples
13
+ today = new Date();
14
+ minDate = new Date(new Date().setDate(new Date().getDate() - 30)); // 30 days ago
15
+ maxDate = new Date(); // Today
16
+ maxFutureDate = new Date(new Date().setDate(new Date().getDate() + 60)); // 60 days from now
12
17
  customStyles = {
13
18
  primaryColor: '#059669',
14
19
  secondaryColor: '#34d399',
@@ -27,180 +32,215 @@ DemoComponent = __decorate([
27
32
  selector: 'app-demo',
28
33
  standalone: true,
29
34
  imports: [HijriDatePickerComponent],
30
- template: `
31
- <div class="demo-container">
32
- <h1>Hijri Date Picker Demo</h1>
33
-
34
- <div class="demo-grid">
35
- <!-- Example 1: Basic Gregorian -->
36
- <div class="demo-card">
37
- <h2>Basic Gregorian</h2>
38
- <hijri-date-picker
39
- [mode]="'greg'"
40
- [locale]="'en'"
41
- [canChangeMode]="true"
42
- (dateSelected)="onDateSelected($event, 'basic')">
43
- </hijri-date-picker>
44
- <div class="output" *ngIf="selectedDates['basic']">
45
- <strong>Selected:</strong>
46
- <pre>{{ selectedDates['basic'] | json }}</pre>
47
- </div>
48
- </div>
49
-
50
- <!-- Example 2: Hijri with Arabic -->
51
- <div class="demo-card">
52
- <h2>Hijri Calendar (Arabic)</h2>
53
- <hijri-date-picker
54
- [mode]="'hijri'"
55
- [locale]="'ar'"
56
- [dir]="'rtl'"
57
- [canChangeMode]="true"
58
- [submitTextButton]="'تأكيد'"
59
- [todaysDateText]="'اليوم'"
60
- [yearSelectLabel]="'السنة'"
61
- [monthSelectLabel]="'الشهر'"
62
- (dateSelected)="onDateSelected($event, 'hijri')">
63
- </hijri-date-picker>
64
- <div class="output" *ngIf="selectedDates['hijri']">
65
- <strong>Selected:</strong>
66
- <pre>{{ selectedDates['hijri'] | json }}</pre>
67
- </div>
68
- </div>
69
-
70
- <!-- Example 3: Multiple Selection -->
71
- <div class="demo-card">
72
- <h2>Multiple Selection</h2>
73
- <hijri-date-picker
74
- [mode]="'greg'"
75
- [locale]="'en'"
76
- [multiple]="true"
77
- [showConfirmButton]="true"
78
- [submitTextButton]="'Confirm Selection'"
79
- (dateSelected)="onDateSelected($event, 'multiple')">
80
- </hijri-date-picker>
81
- <div class="output" *ngIf="selectedDates['multiple']">
82
- <strong>Selected Dates:</strong>
83
- <pre>{{ selectedDates['multiple'] | json }}</pre>
84
- </div>
85
- </div>
86
-
87
- <!-- Example 4: Custom Styling -->
88
- <div class="demo-card">
89
- <h2>Custom Theme</h2>
90
- <hijri-date-picker
91
- [mode]="'greg'"
92
- [locale]="'en'"
93
- [styles]="customStyles"
94
- [canChangeMode]="true"
95
- (dateSelected)="onDateSelected($event, 'custom')">
96
- </hijri-date-picker>
97
- <div class="output" *ngIf="selectedDates['custom']">
98
- <strong>Selected:</strong>
99
- <pre>{{ selectedDates['custom'] | json }}</pre>
100
- </div>
101
- </div>
102
-
103
- <!-- Example 5: Future Date Validation -->
104
- <div class="demo-card">
105
- <h2>No Future Dates</h2>
106
- <hijri-date-picker
107
- [mode]="'greg'"
108
- [locale]="'en'"
109
- [futureValidation]="true"
110
- [futureYearsLimit]="0"
111
- [todaysDateText]="'Select Today'"
112
- (dateSelected)="onDateSelected($event, 'validation')">
113
- </hijri-date-picker>
114
- <div class="output" *ngIf="selectedDates['validation']">
115
- <strong>Selected:</strong>
116
- <pre>{{ selectedDates['validation'] | json }}</pre>
117
- </div>
118
- </div>
119
-
120
- <!-- Example 6: Minimal UI -->
121
- <div class="demo-card">
122
- <h2>Minimal UI</h2>
123
- <hijri-date-picker
124
- [mode]="'greg'"
125
- [locale]="'en'"
126
- [canChangeMode]="false"
127
- [todaysDateSection]="false"
128
- [disableYearPicker]="true"
129
- [disableMonthPicker]="true"
130
- (dateSelected)="onDateSelected($event, 'minimal')">
131
- </hijri-date-picker>
132
- <div class="output" *ngIf="selectedDates['minimal']">
133
- <strong>Selected:</strong>
134
- <pre>{{ selectedDates['minimal'] | json }}</pre>
135
- </div>
136
- </div>
137
- </div>
138
- </div>
35
+ template: `
36
+ <div class="demo-container">
37
+ <h1>Hijri Date Picker Demo</h1>
38
+
39
+ <div class="demo-grid">
40
+ <!-- Example 1: Basic Gregorian -->
41
+ <div class="demo-card">
42
+ <h2>Basic Gregorian</h2>
43
+ <hijri-date-picker
44
+ [mode]="'greg'"
45
+ [locale]="'en'"
46
+ [canChangeMode]="true"
47
+ (dateSelected)="onDateSelected($event, 'basic')">
48
+ </hijri-date-picker>
49
+ <div class="output" *ngIf="selectedDates['basic']">
50
+ <strong>Selected:</strong>
51
+ <pre>{{ selectedDates['basic'] | json }}</pre>
52
+ </div>
53
+ </div>
54
+
55
+ <!-- Example 2: Hijri with Arabic -->
56
+ <div class="demo-card">
57
+ <h2>Hijri Calendar (Arabic)</h2>
58
+ <hijri-date-picker
59
+ [mode]="'hijri'"
60
+ [locale]="'ar'"
61
+ [dir]="'rtl'"
62
+ [canChangeMode]="true"
63
+ [submitTextButton]="'تأكيد'"
64
+ [todaysDateText]="'اليوم'"
65
+ [yearSelectLabel]="'السنة'"
66
+ [monthSelectLabel]="'الشهر'"
67
+ (dateSelected)="onDateSelected($event, 'hijri')">
68
+ </hijri-date-picker>
69
+ <div class="output" *ngIf="selectedDates['hijri']">
70
+ <strong>Selected:</strong>
71
+ <pre>{{ selectedDates['hijri'] | json }}</pre>
72
+ </div>
73
+ </div>
74
+
75
+ <!-- Example 3: Multiple Selection -->
76
+ <div class="demo-card">
77
+ <h2>Multiple Selection</h2>
78
+ <hijri-date-picker
79
+ [mode]="'greg'"
80
+ [locale]="'en'"
81
+ [multiple]="true"
82
+ [showConfirmButton]="true"
83
+ [submitTextButton]="'Confirm Selection'"
84
+ (dateSelected)="onDateSelected($event, 'multiple')">
85
+ </hijri-date-picker>
86
+ <div class="output" *ngIf="selectedDates['multiple']">
87
+ <strong>Selected Dates:</strong>
88
+ <pre>{{ selectedDates['multiple'] | json }}</pre>
89
+ </div>
90
+ </div>
91
+
92
+ <!-- Example 4: Custom Styling -->
93
+ <div class="demo-card">
94
+ <h2>Custom Theme</h2>
95
+ <hijri-date-picker
96
+ [mode]="'greg'"
97
+ [locale]="'en'"
98
+ [styles]="customStyles"
99
+ [canChangeMode]="true"
100
+ (dateSelected)="onDateSelected($event, 'custom')">
101
+ </hijri-date-picker>
102
+ <div class="output" *ngIf="selectedDates['custom']">
103
+ <strong>Selected:</strong>
104
+ <pre>{{ selectedDates['custom'] | json }}</pre>
105
+ </div>
106
+ </div>
107
+
108
+ <!-- Example 5: Future Date Validation -->
109
+ <div class="demo-card">
110
+ <h2>No Future Dates</h2>
111
+ <hijri-date-picker
112
+ [mode]="'greg'"
113
+ [locale]="'en'"
114
+ [futureValidation]="true"
115
+ [futureYearsLimit]="0"
116
+ [todaysDateText]="'Select Today'"
117
+ (dateSelected)="onDateSelected($event, 'validation')">
118
+ </hijri-date-picker>
119
+ <div class="output" *ngIf="selectedDates['validation']">
120
+ <strong>Selected:</strong>
121
+ <pre>{{ selectedDates['validation'] | json }}</pre>
122
+ </div>
123
+ </div>
124
+
125
+ <!-- Example 6: Minimal UI -->
126
+ <div class="demo-card">
127
+ <h2>Minimal UI</h2>
128
+ <hijri-date-picker
129
+ [mode]="'greg'"
130
+ [locale]="'en'"
131
+ [canChangeMode]="false"
132
+ [todaysDateSection]="false"
133
+ [disableYearPicker]="true"
134
+ [disableMonthPicker]="true"
135
+ (dateSelected)="onDateSelected($event, 'minimal')">
136
+ </hijri-date-picker>
137
+ <div class="output" *ngIf="selectedDates['minimal']">
138
+ <strong>Selected:</strong>
139
+ <pre>{{ selectedDates['minimal'] | json }}</pre>
140
+ </div>
141
+ </div>
142
+
143
+ <!-- Example 7: Date Range with minDate and maxDate -->
144
+ <div class="demo-card">
145
+ <h2>Date Range (Last 30 Days)</h2>
146
+ <hijri-date-picker
147
+ [mode]="'greg'"
148
+ [locale]="'en'"
149
+ [minDate]="minDate"
150
+ [maxDate]="maxDate"
151
+ [futureValidation]="false"
152
+ (dateSelected)="onDateSelected($event, 'range')">
153
+ </hijri-date-picker>
154
+ <div class="output" *ngIf="selectedDates['range']">
155
+ <strong>Selected:</strong>
156
+ <pre>{{ selectedDates['range'] | json }}</pre>
157
+ </div>
158
+ </div>
159
+
160
+ <!-- Example 8: Future Dates Only with minDate -->
161
+ <div class="demo-card">
162
+ <h2>Future Dates Only (Next 60 Days)</h2>
163
+ <hijri-date-picker
164
+ [mode]="'greg'"
165
+ [locale]="'en'"
166
+ [minDate]="today"
167
+ [maxDate]="maxFutureDate"
168
+ [futureValidation]="false"
169
+ [todaysDateText]="'Select Today or Future'"
170
+ (dateSelected)="onDateSelected($event, 'futureOnly')">
171
+ </hijri-date-picker>
172
+ <div class="output" *ngIf="selectedDates['futureOnly']">
173
+ <strong>Selected:</strong>
174
+ <pre>{{ selectedDates['futureOnly'] | json }}</pre>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ </div>
139
179
  `,
140
- styles: [`
141
- .demo-container {
142
- max-width: 1400px;
143
- margin: 0 auto;
144
- padding: 40px 20px;
145
- font-family: system-ui, -apple-system, sans-serif;
146
- }
147
-
148
- h1 {
149
- text-align: center;
150
- color: #1f2937;
151
- margin-bottom: 40px;
152
- font-size: 2.5rem;
153
- }
154
-
155
- .demo-grid {
156
- display: grid;
157
- grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
158
- gap: 30px;
159
- }
160
-
161
- .demo-card {
162
- background: white;
163
- border-radius: 12px;
164
- padding: 24px;
165
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
166
- }
167
-
168
- .demo-card h2 {
169
- margin-top: 0;
170
- margin-bottom: 20px;
171
- color: #374151;
172
- font-size: 1.25rem;
173
- border-bottom: 2px solid #e5e7eb;
174
- padding-bottom: 10px;
175
- }
176
-
177
- .output {
178
- margin-top: 20px;
179
- padding: 16px;
180
- background: #f9fafb;
181
- border-radius: 8px;
182
- border: 1px solid #e5e7eb;
183
- }
184
-
185
- .output strong {
186
- display: block;
187
- margin-bottom: 8px;
188
- color: #374151;
189
- }
190
-
191
- .output pre {
192
- margin: 0;
193
- font-size: 12px;
194
- color: #6b7280;
195
- white-space: pre-wrap;
196
- word-wrap: break-word;
197
- }
198
-
199
- @media (max-width: 768px) {
200
- .demo-grid {
201
- grid-template-columns: 1fr;
202
- }
203
- }
180
+ styles: [`
181
+ .demo-container {
182
+ max-width: 1400px;
183
+ margin: 0 auto;
184
+ padding: 40px 20px;
185
+ font-family: system-ui, -apple-system, sans-serif;
186
+ }
187
+
188
+ h1 {
189
+ text-align: center;
190
+ color: #1f2937;
191
+ margin-bottom: 40px;
192
+ font-size: 2.5rem;
193
+ }
194
+
195
+ .demo-grid {
196
+ display: grid;
197
+ grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
198
+ gap: 30px;
199
+ }
200
+
201
+ .demo-card {
202
+ background: white;
203
+ border-radius: 12px;
204
+ padding: 24px;
205
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
206
+ }
207
+
208
+ .demo-card h2 {
209
+ margin-top: 0;
210
+ margin-bottom: 20px;
211
+ color: #374151;
212
+ font-size: 1.25rem;
213
+ border-bottom: 2px solid #e5e7eb;
214
+ padding-bottom: 10px;
215
+ }
216
+
217
+ .output {
218
+ margin-top: 20px;
219
+ padding: 16px;
220
+ background: #f9fafb;
221
+ border-radius: 8px;
222
+ border: 1px solid #e5e7eb;
223
+ }
224
+
225
+ .output strong {
226
+ display: block;
227
+ margin-bottom: 8px;
228
+ color: #374151;
229
+ }
230
+
231
+ .output pre {
232
+ margin: 0;
233
+ font-size: 12px;
234
+ color: #6b7280;
235
+ white-space: pre-wrap;
236
+ word-wrap: break-word;
237
+ }
238
+
239
+ @media (max-width: 768px) {
240
+ .demo-grid {
241
+ grid-template-columns: 1fr;
242
+ }
243
+ }
204
244
  `]
205
245
  })
206
246
  ], DemoComponent);
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGlqcmktZGF0ZS10aW1lLXBpY2tlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9oaWpyaS1kYXRlLXRpbWUtcGlja2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
@@ -0,0 +1,3 @@
1
+ export { HijriDatePickerComponent } from './lib/hijri-date-picker.component';
2
+ export * from './lib/hijri-date-picker.types';
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDN0UsY0FBYywrQkFBK0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IEhpanJpRGF0ZVBpY2tlckNvbXBvbmVudCB9IGZyb20gJy4vbGliL2hpanJpLWRhdGUtcGlja2VyLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9oaWpyaS1kYXRlLXBpY2tlci50eXBlcyc7XG4iXX0=