ngx-np-datepicker 0.0.1

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.
@@ -0,0 +1,664 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Pipe, forwardRef, Component, ViewEncapsulation, Input, HostListener, NgModule } from '@angular/core';
3
+ import * as i3 from '@angular/forms';
4
+ import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
5
+ import * as i2 from '@angular/common';
6
+ import { BrowserModule } from '@angular/platform-browser';
7
+
8
+ class NpDatePickerService {
9
+ constructor() {
10
+ this.englishMonths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
11
+ this.englishLeapMonths = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
12
+ this.nepaliMonths = [
13
+ [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
14
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
15
+ [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
16
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
17
+ [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
18
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
19
+ [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
20
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
21
+ [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
22
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
23
+ [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
24
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
25
+ [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
26
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
27
+ [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
28
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
29
+ [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
30
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
31
+ [31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
32
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
33
+ [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
34
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
35
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
36
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
37
+ [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
38
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
39
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
40
+ [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
41
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
42
+ [31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30],
43
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
44
+ [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
45
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
46
+ [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
47
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
48
+ [30, 32, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
49
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
50
+ [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
51
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
52
+ [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
53
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
54
+ [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
55
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
56
+ [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
57
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
58
+ [31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
59
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
60
+ [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
61
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
62
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
63
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
64
+ [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
65
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
66
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
67
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
68
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
69
+ [31, 31, 32, 31, 32, 30, 30, 29, 30, 29, 30, 30],
70
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
71
+ [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
72
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
73
+ [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
74
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
75
+ [30, 32, 31, 32, 31, 31, 29, 30, 29, 30, 29, 31],
76
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
77
+ [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
78
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
79
+ [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31],
80
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
81
+ [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
82
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
83
+ [31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30],
84
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
85
+ [31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30],
86
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31],
87
+ [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
88
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
89
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
90
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31],
91
+ [31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30],
92
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
93
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30],
94
+ [31, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30],
95
+ [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
96
+ [31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
97
+ [31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
98
+ [31, 32, 31, 32, 30, 31, 30, 30, 29, 30, 30, 30],
99
+ [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
100
+ [31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30],
101
+ [30, 31, 32, 32, 30, 31, 30, 30, 29, 30, 30, 30],
102
+ [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
103
+ [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
104
+ [31, 31, 32, 31, 31, 31, 30, 30, 29, 30, 30, 30],
105
+ [30, 31, 32, 32, 31, 30, 30, 30, 29, 30, 30, 30],
106
+ [30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
107
+ [31, 31, 32, 31, 31, 30, 30, 30, 29, 30, 30, 30],
108
+ [31, 31, 32, 31, 31, 31, 30, 29, 30, 30, 30, 30],
109
+ [30, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30],
110
+ [31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30],
111
+ [31, 31, 32, 31, 31, 31, 29, 30, 29, 30, 29, 31],
112
+ [31, 31, 32, 31, 31, 31, 30, 29, 29, 30, 30, 30], //2099
113
+ ];
114
+ this.format = '.';
115
+ var d = new Date();
116
+ }
117
+ setCurrentNepaliDate() {
118
+ var d = new Date();
119
+ return this.engToNepDate(d.getDate(), d.getMonth() + 1, d.getFullYear());
120
+ }
121
+ //English to Nepali date conversion
122
+ engToNepDate(date, month, year) {
123
+ if (!this.isEnglishRange(date, month, year))
124
+ console.log('Invalid date format.');
125
+ this.englishYear = year;
126
+ this.englishMonth = month;
127
+ this.englishDate = date;
128
+ //Setting nepali reference to 2000/1/1 with english date 1943/4/14
129
+ this.nepaliYear = 2000;
130
+ this.nepaliMonth = 1;
131
+ this.nepaliDate = 0;
132
+ var difference = this.getEnglishDateDifference(1943, 4, 14);
133
+ //Getting nepali year untill the difference remains less than 365
134
+ var index = 0;
135
+ while (difference >= this.nepaliYearDays(index)) {
136
+ this.nepaliYear++;
137
+ difference = difference - this.nepaliYearDays(index);
138
+ index++;
139
+ }
140
+ //Getting nepali month untill the difference remains less than 31
141
+ var i = 0;
142
+ while (difference >= this.nepaliMonths[index][i]) {
143
+ difference = difference - this.nepaliMonths[index][i];
144
+ this.nepaliMonth++;
145
+ i++;
146
+ }
147
+ //Remaning days is the date;
148
+ this.nepaliDate = this.nepaliDate + difference;
149
+ this.getDay();
150
+ return {
151
+ day: this.nepaliDate,
152
+ month: this.nepaliMonth,
153
+ year: this.nepaliYear
154
+ };
155
+ }
156
+ toEnglishString(format) {
157
+ if (typeof format === 'undefined')
158
+ format = '-';
159
+ return (this.englishYear + format + this.englishMonth + format + this.englishDate);
160
+ }
161
+ getEnglishDateDifference(year, month, date) {
162
+ //Getting difference from the current date with the date provided
163
+ var difference = this.countTotalEnglishDays(this.englishYear, this.englishMonth, this.englishDate) - this.countTotalEnglishDays(year, month, date);
164
+ return difference < 0 ? -difference : difference;
165
+ }
166
+ countTotalEnglishDays(year, month, date) {
167
+ var totalDays = year * 365 + date;
168
+ for (var i = 0; i < month - 1; i++)
169
+ totalDays = totalDays + this.englishMonths[i];
170
+ totalDays = totalDays + this.countleap(year, month);
171
+ return totalDays;
172
+ }
173
+ countleap(year, month) {
174
+ if (month <= 2)
175
+ year--;
176
+ return (Math.floor(year / 4) - Math.floor(year / 100) + Math.floor(year / 400));
177
+ }
178
+ isEnglishRange(date, month, year) {
179
+ if (year < 1944 || year > 2042)
180
+ return false;
181
+ if (month < 1 || month > 12)
182
+ return false;
183
+ if (date < 1 || date > 31)
184
+ return false;
185
+ return true;
186
+ }
187
+ isLeapYear(year) {
188
+ if (year % 4 === 0) {
189
+ return year % 100 === 0 ? year % 400 === 0 : true;
190
+ }
191
+ else
192
+ return false;
193
+ }
194
+ //Nepali to English conversion
195
+ nepToEngDate(date, month, year) {
196
+ if (!this.isNepaliRange(date, month, year)) {
197
+ console.log('Invalid Date Format');
198
+ // throw new Exception("Invalid date format.");
199
+ return;
200
+ }
201
+ this.nepaliYear = year;
202
+ this.nepaliMonth = month;
203
+ this.nepaliDate = date;
204
+ //Setting english reference to 1944/1/1 with nepali date 2000/9/17
205
+ this.englishYear = 1944;
206
+ this.englishMonth = 1;
207
+ this.englishDate = 1;
208
+ var difference = this.getNepaliDateDifference(2000, 9, 17);
209
+ //Getting english year untill the difference remains less than 365
210
+ while (difference >= (this.isLeapYear(this.englishYear) ? 366 : 365)) {
211
+ difference = difference - (this.isLeapYear(this.englishYear) ? 366 : 365);
212
+ this.englishYear++;
213
+ }
214
+ //Getting english month untill the difference remains less than 31
215
+ var monthDays = this.isLeapYear(this.englishYear)
216
+ ? this.englishLeapMonths
217
+ : this.englishMonths;
218
+ var i = 0;
219
+ while (difference >= monthDays[i]) {
220
+ this.englishMonth++;
221
+ difference = difference - monthDays[i];
222
+ i++;
223
+ }
224
+ //Remaning days is the date;
225
+ this.englishDate = this.englishDate + difference;
226
+ this.getDay();
227
+ return new Date(this.englishYear + '-' + this.englishMonth + '-' + this.englishDate);
228
+ }
229
+ toNepaliString(format) {
230
+ if (typeof format === 'undefined')
231
+ format = '-';
232
+ return (this.nepaliYear + format + this.nepaliMonth + format + this.nepaliDate);
233
+ }
234
+ getNepaliDateDifference(year, month, date) {
235
+ //Getting difference from the current date with the date provided
236
+ var difference = this.countTotalNepaliDays(this.nepaliYear, this.nepaliMonth, this.nepaliDate) - this.countTotalNepaliDays(year, month, date);
237
+ return difference < 0 ? -difference : difference;
238
+ }
239
+ countTotalNepaliDays(year, month, date) {
240
+ var total = 0;
241
+ if (year < 2000)
242
+ return 0;
243
+ total = total + (date - 1);
244
+ var yearIndex = year - 2000;
245
+ for (var i = 0; i < month - 1; i++)
246
+ total = total + this.nepaliMonths[yearIndex][i];
247
+ for (var i = 0; i < yearIndex; i++)
248
+ total = total + this.nepaliYearDays(i);
249
+ return total;
250
+ }
251
+ nepaliYearDays(index) {
252
+ var total = 0;
253
+ for (var i = 0; i < 12; i++)
254
+ total += this.nepaliMonths[index][i];
255
+ return total;
256
+ }
257
+ isNepaliRange(date, month, year) {
258
+ if (year < 2000 || year > 2099)
259
+ return false;
260
+ if (month < 1 || month > 12)
261
+ return false;
262
+ if (date < 1 || date > this.nepaliMonths[year - 2000][month - 1])
263
+ return false;
264
+ return true;
265
+ }
266
+ //Class Regular methods
267
+ getDay() {
268
+ //Reference date 1943/4/14 Wednesday
269
+ var difference = this.getEnglishDateDifference(1943, 4, 14);
270
+ this.weekDay = ((3 + (difference % 7)) % 7) + 1;
271
+ return this.weekDay;
272
+ }
273
+ getEnglishYear() {
274
+ return this.englishYear;
275
+ }
276
+ getEnglishMonth() {
277
+ return this.englishMonth;
278
+ }
279
+ getEnglishDate() {
280
+ return this.englishDate;
281
+ }
282
+ getNepaliYear() {
283
+ return this.nepaliYear;
284
+ }
285
+ getNepaliMonth() {
286
+ return this.nepaliMonth;
287
+ }
288
+ getNepaliDate() {
289
+ return this.nepaliDate;
290
+ }
291
+ }
292
+ NpDatePickerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: NpDatePickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
293
+ NpDatePickerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: NpDatePickerService, providedIn: 'root' });
294
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: NpDatePickerService, decorators: [{
295
+ type: Injectable,
296
+ args: [{
297
+ providedIn: 'root',
298
+ }]
299
+ }], ctorParameters: function () { return []; } });
300
+
301
+ const numberMapping = ['०', '१', '२', '३', '४', '५', '६', '७', '८', '९'];
302
+ const wordsMapping = {
303
+ year: 'साल',
304
+ month: 'महिना'
305
+ };
306
+ const daysMapping = {
307
+ en: {
308
+ default: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
309
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
310
+ },
311
+ ne: {
312
+ default: ['आइत', 'सोम', 'मंगल्', 'बुध', 'बिही', 'शुक्र', 'शनि'],
313
+ short: ['आ', 'सो', 'मं', 'बु', 'बि', 'शु', 'श']
314
+ }
315
+ };
316
+ const monthsMapping = {
317
+ en: {
318
+ default: [
319
+ 'Baisakh', 'Jestha', 'Asadh', 'Shrawan', 'Bhadra', 'Ashwin', 'Kartik', 'Mangsir', 'Poush', 'Marga', 'Falgun', 'Chaitra'
320
+ ],
321
+ modern: [
322
+ 'Baisakh', 'Jeth', 'Asaar', 'Saawn', 'Bhadau', 'Aashoj', 'Kartik', 'Mangsir', 'Push', 'Magh', 'Fagun', 'Chait'
323
+ ],
324
+ short: [
325
+ 'Bai', 'Jes', 'Asa', 'Shr', 'Bha', 'Ash', 'Kar', 'Man', 'Pou', 'Mar', 'Fal', 'Cha'
326
+ ]
327
+ },
328
+ ne: {
329
+ default: [
330
+ 'बैशाख', 'जेष्ठ', 'आषाढ', 'श्रवण', 'भाद्र', 'आश्विन', 'कार्तिक', 'मंसिर', 'पौष', 'मार्ग', 'फाल्गुन', 'चैत्र'
331
+ ],
332
+ modern: [
333
+ 'बैशाख', 'जेठ', 'असार', 'साउन', 'भदौ', 'अशोज', 'कार्तिक', 'मंसिर', 'पुष', 'माघ', 'फागुन', 'चैत'
334
+ ],
335
+ short: [
336
+ 'बै', 'जे', 'अ', 'श्रा', 'भा', 'आ', 'का', 'मं', 'पौ', 'मा', 'फा', 'चै'
337
+ ]
338
+ }
339
+ };
340
+
341
+ class ToNpPipe {
342
+ transform(value, language = 'ne', type = 'number') {
343
+ if (value) {
344
+ if (language === 'ne') {
345
+ switch (type) {
346
+ case 'number':
347
+ const split = value.toString().split('');
348
+ return split
349
+ .map((n) => {
350
+ if (n === ' ') {
351
+ return ' ';
352
+ }
353
+ return numberMapping[+n] ? numberMapping[+n] : n;
354
+ })
355
+ .join('');
356
+ case 'word':
357
+ let wrd = value.toString().toLowerCase();
358
+ if (wrd === 'month') {
359
+ return wordsMapping['month'];
360
+ }
361
+ else if (wrd === 'year') {
362
+ return wordsMapping['year'];
363
+ }
364
+ else {
365
+ return wrd;
366
+ }
367
+ default:
368
+ }
369
+ }
370
+ else {
371
+ return value;
372
+ }
373
+ }
374
+ else {
375
+ return '';
376
+ }
377
+ }
378
+ }
379
+ ToNpPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ToNpPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
380
+ ToNpPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ToNpPipe, name: "toNp" });
381
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: ToNpPipe, decorators: [{
382
+ type: Pipe,
383
+ args: [{
384
+ name: 'toNp',
385
+ }]
386
+ }] });
387
+
388
+ class NpDatePickerComponent {
389
+ constructor(_nepaliDate, eRef) {
390
+ this._nepaliDate = _nepaliDate;
391
+ this.eRef = eRef;
392
+ this.nepaliDateToday = { day: 0, month: 0, year: 0 };
393
+ this.currentNepaliDate = { day: 0, month: 0, year: 0 };
394
+ this.formattedDate = '';
395
+ this.years = [];
396
+ this.daysMapping = daysMapping;
397
+ this.monthsMapping = monthsMapping;
398
+ this.isOpen = false;
399
+ this.hideInput = false;
400
+ this.alwaysVisible = false;
401
+ this.language = 'ne';
402
+ this.monthDisplayType = 'modern';
403
+ this.dayDisplayType = 'short';
404
+ this.dateFormatter = (selectedDate) => {
405
+ const dd = selectedDate.day < 10 ? '0' + selectedDate.day : selectedDate.day;
406
+ const mm = selectedDate.month < 10 ? '0' + selectedDate.month : selectedDate.month;
407
+ return `${dd}/${mm}/${this.selectedDate.year}`;
408
+ };
409
+ this.propagateChange = (_) => { };
410
+ this.propagateTouch = (_) => { };
411
+ this.currentDate = new Date();
412
+ }
413
+ clickout(event) {
414
+ if (!this.eRef.nativeElement.contains(event.target)) {
415
+ this.close();
416
+ }
417
+ }
418
+ ngOnInit() {
419
+ this.nepaliDateToday = this._nepaliDate.setCurrentNepaliDate();
420
+ this.setCurrentDate();
421
+ this.populateYears();
422
+ this.setCurrentMonthData();
423
+ this.selectDate(this.currentNepaliDate.day);
424
+ }
425
+ populateYears() {
426
+ for (let i = 2001; i <= 2099; i++) {
427
+ this.years.push(i);
428
+ }
429
+ }
430
+ selectYear(e) {
431
+ this.currentNepaliDate.year = e.target.value;
432
+ const newDate = {
433
+ day: this.currentNepaliDate.day,
434
+ month: this.currentNepaliDate.month,
435
+ year: this.currentNepaliDate.year,
436
+ };
437
+ this.currentDate = this._nepaliDate.nepToEngDate(newDate.day, newDate.month + 1, newDate.year);
438
+ this.setCurrentMonthData();
439
+ }
440
+ selectMonth(e) {
441
+ let month = e.target.value;
442
+ let nep_month_index = this.monthsMapping[this.language][this.monthDisplayType]?.indexOf(month) ?? 0;
443
+ this.currentNepaliDate.month = nep_month_index;
444
+ const newNepaliDate = {
445
+ day: this.currentNepaliDate.day,
446
+ month: this.currentNepaliDate.month,
447
+ year: this.currentNepaliDate.year,
448
+ };
449
+ this.currentDate = this._nepaliDate.nepToEngDate(newNepaliDate.day, newNepaliDate.month + 1, newNepaliDate.year);
450
+ this.setCurrentMonthData();
451
+ }
452
+ resetCurrentMonthData() {
453
+ this.currentMonthData = {
454
+ 0: [],
455
+ 1: [],
456
+ 2: [],
457
+ 3: [],
458
+ 4: [],
459
+ 5: [],
460
+ 6: [],
461
+ };
462
+ }
463
+ formatValue() {
464
+ if (this.selectedDate) {
465
+ this.formattedDate = this.dateFormatter(this.selectedDate);
466
+ }
467
+ }
468
+ writeValue(value) {
469
+ if (value) {
470
+ this.selectedDate = value;
471
+ this.currentNepaliDate = value;
472
+ this.formatValue();
473
+ }
474
+ }
475
+ registerOnTouched() { }
476
+ registerOnChange(fn) {
477
+ this.propagateChange = fn;
478
+ }
479
+ setCurrentDate() {
480
+ if (!this.selectedDate) {
481
+ this.currentNepaliDate = this._nepaliDate.engToNepDate(this.currentDate.getDate(), this.currentDate.getMonth(), this.currentDate.getFullYear());
482
+ }
483
+ else {
484
+ const { day, month, year } = this.selectedDate;
485
+ this.currentNepaliDate = this._nepaliDate.engToNepDate(day, month, year);
486
+ this.currentDate = this._nepaliDate.nepToEngDate(this.selectedDate.year, this.selectedDate.month + 1, this.selectedDate.day);
487
+ }
488
+ }
489
+ setCurrentMonthData() {
490
+ this.resetCurrentMonthData();
491
+ // fill the currentMonthData with current date
492
+ let day = this.currentDate.getDay();
493
+ this.currentMonthData[day] = [this.currentNepaliDate.day];
494
+ // fill the currentMonthData with day before the current date
495
+ this.setMonthDataBefore(day - 1, this.currentNepaliDate.day - 1);
496
+ var currentMonthMaxValue = this._nepaliDate.nepaliMonths[this.currentNepaliDate.year - 2000][this.currentNepaliDate.month];
497
+ // fill the currentMonthData with day after the current date
498
+ this.setMonthDataAfter(day + 1, this.currentNepaliDate.day + 1, currentMonthMaxValue);
499
+ // we need some empty spaces in place so that the dates are shown in correct order
500
+ // eg if the 1st day starts on monday then we need 1 empty space for non existingn date on Sunday
501
+ this.createEmptySpaces();
502
+ }
503
+ setMonthDataBefore(day, date) {
504
+ if (date >= 1) {
505
+ if (day < 0) {
506
+ day = 6;
507
+ }
508
+ this.currentMonthData[day] = [date, ...this.currentMonthData[day]];
509
+ this.setMonthDataBefore(--day, --date);
510
+ }
511
+ }
512
+ setMonthDataAfter(day, date, currentMonthMaxValue) {
513
+ const nepaliDate = {
514
+ day: date,
515
+ month: this.currentNepaliDate.month,
516
+ year: this.currentNepaliDate.year,
517
+ };
518
+ // only add the data if the current month matches
519
+ if (date <= currentMonthMaxValue) {
520
+ if (day > 6) {
521
+ day = 0;
522
+ }
523
+ this.currentMonthData[day] = [...this.currentMonthData[day], date];
524
+ this.setMonthDataAfter(++day, ++date, currentMonthMaxValue);
525
+ }
526
+ }
527
+ createEmptySpaces() {
528
+ // first find out which day has the 1st
529
+ // if its a Sunday, then don't do anything else add 1 space on each previous day
530
+ let dayIndex = 0;
531
+ let value;
532
+ Object.values(this.currentMonthData).map((item, index) => {
533
+ value = item;
534
+ if (value.includes(1)) {
535
+ dayIndex = index;
536
+ }
537
+ return value.includes(1);
538
+ });
539
+ if (dayIndex) {
540
+ for (dayIndex; dayIndex > 0; dayIndex--) {
541
+ const monthData = this.currentMonthData[dayIndex - 1];
542
+ this.currentMonthData[dayIndex - 1] = [null, ...monthData];
543
+ }
544
+ }
545
+ }
546
+ selectDate(day) {
547
+ console.log(this.currentNepaliDate);
548
+ this.selectedDate = { ...this.currentNepaliDate, day };
549
+ console.log(this.selectedDate);
550
+ this.formatValue();
551
+ this.close();
552
+ this.propagateChange(this.selectedDate);
553
+ }
554
+ prevMonth() {
555
+ if (this.currentNepaliDate.month <= 0) {
556
+ this.currentNepaliDate.month = 11;
557
+ this.currentNepaliDate.year--;
558
+ }
559
+ else {
560
+ this.currentNepaliDate.month--;
561
+ }
562
+ const newNepaliDate = {
563
+ day: this.currentNepaliDate.day,
564
+ month: this.currentNepaliDate.month,
565
+ year: this.currentNepaliDate.year,
566
+ };
567
+ this.currentDate = this._nepaliDate.nepToEngDate(newNepaliDate.day, newNepaliDate.month + 1, newNepaliDate.year);
568
+ this.setCurrentMonthData();
569
+ }
570
+ nextMonth() {
571
+ if (this.currentNepaliDate.month >= 11) {
572
+ this.currentNepaliDate.month = 0;
573
+ this.currentNepaliDate.year++;
574
+ }
575
+ else {
576
+ this.currentNepaliDate.month++;
577
+ }
578
+ console.log(this.currentNepaliDate);
579
+ const newDate = {
580
+ day: this.currentNepaliDate.day,
581
+ month: this.currentNepaliDate.month,
582
+ year: this.currentNepaliDate.year,
583
+ };
584
+ this.currentDate = this._nepaliDate.nepToEngDate(newDate.day, newDate.month + 1, newDate.year);
585
+ this.setCurrentMonthData();
586
+ }
587
+ toggleOpen() {
588
+ if (!this.alwaysVisible) {
589
+ this.isOpen = !this.isOpen;
590
+ }
591
+ }
592
+ open() {
593
+ this.isOpen = true;
594
+ }
595
+ close() {
596
+ this.isOpen = false;
597
+ //this.setCurrentDate();
598
+ }
599
+ }
600
+ NpDatePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: NpDatePickerComponent, deps: [{ token: NpDatePickerService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
601
+ NpDatePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.3", type: NpDatePickerComponent, selector: "np-datepicker", inputs: { theme: "theme", language: "language", monthDisplayType: "monthDisplayType" }, host: { listeners: { "document:click": "clickout($event)" } }, providers: [
602
+ {
603
+ provide: NG_VALUE_ACCESSOR,
604
+ useExisting: forwardRef(() => NpDatePickerComponent),
605
+ multi: true,
606
+ },
607
+ ], ngImport: i0, template: "<div class=\"nepali-date-picker\" [ngClass]=\"theme\">\n \n <input\n class=\"np_datepicker_input\"\n type=\"text\"\n [value]=\"formattedDate\"\n (focus)=\"open()\"\n (keydown)=\"$event.preventDefault()\"\n aria-hidden=\"true\"\n [hidden]=\"hideInput\"\n />\n <a class=\"form-icon\" (click)=\"toggleOpen()\" [ngClass]=\"isOpen ? 'active' : ''\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\">\n <path\n d=\"M152 64H296V24C296 10.75 306.7 0 320 0C333.3 0 344 10.75 344 24V64H384C419.3 64 448 92.65 448 128V448C448 483.3 419.3 512 384 512H64C28.65 512 0 483.3 0 448V128C0 92.65 28.65 64 64 64H104V24C104 10.75 114.7 0 128 0C141.3 0 152 10.75 152 24V64zM48 448C48 456.8 55.16 464 64 464H384C392.8 464 400 456.8 400 448V192H48V448z\"\n />\n </svg>\n </a>\n <ng-container [ngTemplateOutlet]=\"dp\" *ngIf=\"isOpen\"></ng-container>\n</div>\n<!--.nepali-date-picker-->\n\n<ng-template #dp>\n <div class=\"datepicker__container\">\n <div class=\"datepicker__options-container\">\n <a class=\"prev-month\" (click)=\"prevMonth()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path\n d=\"M224 480c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25l192-192c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l169.4 169.4c12.5 12.5 12.5 32.75 0 45.25C240.4 476.9 232.2 480 224 480z\"\n />\n </svg>\n </a>\n <span class=\"datepicker__options-year-container\">\n <span> {{ \"Year\" | toNp: language:\"word\" }}: </span>\n <select (change)=\"selectYear($event)\">\n <option\n *ngFor=\"let year of years; index as i\"\n [value]=\"year\"\n [selected]=\"year == currentNepaliDate?.year\"\n >\n {{ year | toNp: language:\"number\" }}\n </option>\n </select>\n </span>\n <span class=\"datepicker__options-month-container\">\n <span>{{ \"Month\" | toNp: language:\"word\" }}: </span>\n <select (change)=\"selectMonth($event)\">\n <option\n *ngFor=\"\n let month of monthsMapping[language][monthDisplayType];\n index as i\n \"\n [value]=\"month\"\n [selected]=\" i === currentNepaliDate?.month\"\n >\n {{ month }}\n </option>\n </select>\n </span>\n <a class=\"next-month\" (click)=\"nextMonth()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path\n d=\"M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z\"\n />\n </svg>\n </a>\n </div>\n <div class=\"datepicker__days-container\">\n <div\n class=\"datepicker__days\"\n *ngFor=\"let day of daysMapping[language][dayDisplayType]; index as i\"\n >\n <div class=\"datepicker__weekday\">{{ day }}</div>\n <div\n class=\"datepicker__date-container\"\n *ngFor=\"let date of currentMonthData[i]\"\n >\n <div\n *ngIf=\"date\"\n class=\"datepicker__date\"\n [class.datepicker__date--active]=\"\n date === selectedDate?.day &&\n currentNepaliDate.month === selectedDate?.month &&\n currentNepaliDate.year === selectedDate?.year\n \"\n [class.datepicker__date--current-day]=\"\n date === nepaliDateToday.day &&\n currentNepaliDate.month === nepaliDateToday.month &&\n currentNepaliDate.year === nepaliDateToday.year\n \"\n (click)=\"selectDate(date)\"\n >\n {{ date | toNp: language:\"number\" }}\n </div>\n <div *ngIf=\"!date\" class=\"datepicker__date--disabled\">\n <span>&nbsp;</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: [".nepali-date-picker.nepali-date-picker{position:relative;display:inline-block;font-family:Arial,Helvetica,sans-serif;font-size:1em}.nepali-date-picker a.active svg{fill:#e45415;opacity:.9}.nepali-date-picker .form-icon svg{width:14px;opacity:.3;position:absolute;right:8px;top:12px;cursor:pointer}.datepicker__container{border:1px solid #eee;background:#fff;width:294px;box-shadow:#64646f33 0 7px 29px;position:absolute;z-index:99999}.datepicker__options-container{padding:18px 8px;border-bottom:1px solid #eee;display:flex;justify-content:space-between;background-color:#e45415;color:#fff;line-height:30px}.datepicker__days-container{display:flex;justify-content:space-evenly;color:#777}.datepicker__days{text-align:center;border:1px solid #eee}.datepicker__weekday{padding:10px;background-color:#f3f3f3;margin-bottom:1px;font-weight:700}.datepicker__date-container{width:40px;height:40px;line-height:40px;border-bottom:1px solid #eee}.datepicker__date{cursor:pointer}.datepicker__date:hover{background-color:#eee}.datepicker__date--active.datepicker__date--active{background-color:#e45415;color:#fff}.datepicker__options-container span{font-size:14px}select:focus,select:focus-visible{outline:1px solid #fff}select{border:none;color:#fff;background:none;font-size:14px}select option{color:#333}.np_datepicker_input{border:1px solid #eee;padding:10px;font-size:16px;color:#777}.np_datepicker_input:focus-visible{outline:2px solid #e45415}.prev-month,.next-month{padding:5px;width:20px;height:20px;display:block;opacity:.5;border-radius:50%;background:#f3f3f3;cursor:pointer;text-align:center;line-height:25px}.next-month:hover,.prev-month:hover{background:#ccc}.prev-month svg,.next-month svg{max-width:10px;height:auto}.prev-month{margin-right:5px}.next-month{margin-left:5px}.dark.nepali-date-picker a.active svg{fill:#000}.dark .datepicker__options-container{border-bottom:1px solid #000;background-color:#000;color:#fff}.dark select{color:#fff}.dark .datepicker__date--active.datepicker__date--active{background-color:#000;color:#fff}.dark .np_datepicker_input:focus-visible{outline:2px solid #000}.dark .datepicker__weekday{background-color:#111}.dark .datepicker__days{background-color:#333;border:1px solid #111}.dark .datepicker__date:hover{background-color:#111;color:#fff}.dark .datepicker__date-container{border-bottom:1px solid #222}.light.nepali-date-picker a.active svg{fill:#777}.light .datepicker__options-container{border-bottom:none;background-color:#fff;color:#777}.light select{color:#777}.light .datepicker__date--active.datepicker__date--active{background-color:#aaa;color:#fff}.light .np_datepicker_input:focus-visible{outline:1px solid #ddd}.lightblue.nepali-date-picker a.active svg{fill:#38c5f0da}.lightblue .datepicker__options-container{background-color:#38c5f0da;color:#fff}.lightblue select{color:#fff}.lightblue .datepicker__date--active.datepicker__date--active{background-color:#38c5f0da;color:#fff}.lightblue .np_datepicker_input:focus-visible{outline:2px solid #38c5f0da}.lightblue .np_datepicker_input:focus-visible{outline:1px solid #38c5f0da}\n"], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }], pipes: { "toNp": ToNpPipe }, encapsulation: i0.ViewEncapsulation.None });
608
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: NpDatePickerComponent, decorators: [{
609
+ type: Component,
610
+ args: [{ selector: 'np-datepicker', providers: [
611
+ {
612
+ provide: NG_VALUE_ACCESSOR,
613
+ useExisting: forwardRef(() => NpDatePickerComponent),
614
+ multi: true,
615
+ },
616
+ ], encapsulation: ViewEncapsulation.None, template: "<div class=\"nepali-date-picker\" [ngClass]=\"theme\">\n \n <input\n class=\"np_datepicker_input\"\n type=\"text\"\n [value]=\"formattedDate\"\n (focus)=\"open()\"\n (keydown)=\"$event.preventDefault()\"\n aria-hidden=\"true\"\n [hidden]=\"hideInput\"\n />\n <a class=\"form-icon\" (click)=\"toggleOpen()\" [ngClass]=\"isOpen ? 'active' : ''\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\">\n <path\n d=\"M152 64H296V24C296 10.75 306.7 0 320 0C333.3 0 344 10.75 344 24V64H384C419.3 64 448 92.65 448 128V448C448 483.3 419.3 512 384 512H64C28.65 512 0 483.3 0 448V128C0 92.65 28.65 64 64 64H104V24C104 10.75 114.7 0 128 0C141.3 0 152 10.75 152 24V64zM48 448C48 456.8 55.16 464 64 464H384C392.8 464 400 456.8 400 448V192H48V448z\"\n />\n </svg>\n </a>\n <ng-container [ngTemplateOutlet]=\"dp\" *ngIf=\"isOpen\"></ng-container>\n</div>\n<!--.nepali-date-picker-->\n\n<ng-template #dp>\n <div class=\"datepicker__container\">\n <div class=\"datepicker__options-container\">\n <a class=\"prev-month\" (click)=\"prevMonth()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path\n d=\"M224 480c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25l192-192c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l169.4 169.4c12.5 12.5 12.5 32.75 0 45.25C240.4 476.9 232.2 480 224 480z\"\n />\n </svg>\n </a>\n <span class=\"datepicker__options-year-container\">\n <span> {{ \"Year\" | toNp: language:\"word\" }}: </span>\n <select (change)=\"selectYear($event)\">\n <option\n *ngFor=\"let year of years; index as i\"\n [value]=\"year\"\n [selected]=\"year == currentNepaliDate?.year\"\n >\n {{ year | toNp: language:\"number\" }}\n </option>\n </select>\n </span>\n <span class=\"datepicker__options-month-container\">\n <span>{{ \"Month\" | toNp: language:\"word\" }}: </span>\n <select (change)=\"selectMonth($event)\">\n <option\n *ngFor=\"\n let month of monthsMapping[language][monthDisplayType];\n index as i\n \"\n [value]=\"month\"\n [selected]=\" i === currentNepaliDate?.month\"\n >\n {{ month }}\n </option>\n </select>\n </span>\n <a class=\"next-month\" (click)=\"nextMonth()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\">\n <path\n d=\"M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z\"\n />\n </svg>\n </a>\n </div>\n <div class=\"datepicker__days-container\">\n <div\n class=\"datepicker__days\"\n *ngFor=\"let day of daysMapping[language][dayDisplayType]; index as i\"\n >\n <div class=\"datepicker__weekday\">{{ day }}</div>\n <div\n class=\"datepicker__date-container\"\n *ngFor=\"let date of currentMonthData[i]\"\n >\n <div\n *ngIf=\"date\"\n class=\"datepicker__date\"\n [class.datepicker__date--active]=\"\n date === selectedDate?.day &&\n currentNepaliDate.month === selectedDate?.month &&\n currentNepaliDate.year === selectedDate?.year\n \"\n [class.datepicker__date--current-day]=\"\n date === nepaliDateToday.day &&\n currentNepaliDate.month === nepaliDateToday.month &&\n currentNepaliDate.year === nepaliDateToday.year\n \"\n (click)=\"selectDate(date)\"\n >\n {{ date | toNp: language:\"number\" }}\n </div>\n <div *ngIf=\"!date\" class=\"datepicker__date--disabled\">\n <span>&nbsp;</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n", styles: [".nepali-date-picker.nepali-date-picker{position:relative;display:inline-block;font-family:Arial,Helvetica,sans-serif;font-size:1em}.nepali-date-picker a.active svg{fill:#e45415;opacity:.9}.nepali-date-picker .form-icon svg{width:14px;opacity:.3;position:absolute;right:8px;top:12px;cursor:pointer}.datepicker__container{border:1px solid #eee;background:#fff;width:294px;box-shadow:#64646f33 0 7px 29px;position:absolute;z-index:99999}.datepicker__options-container{padding:18px 8px;border-bottom:1px solid #eee;display:flex;justify-content:space-between;background-color:#e45415;color:#fff;line-height:30px}.datepicker__days-container{display:flex;justify-content:space-evenly;color:#777}.datepicker__days{text-align:center;border:1px solid #eee}.datepicker__weekday{padding:10px;background-color:#f3f3f3;margin-bottom:1px;font-weight:700}.datepicker__date-container{width:40px;height:40px;line-height:40px;border-bottom:1px solid #eee}.datepicker__date{cursor:pointer}.datepicker__date:hover{background-color:#eee}.datepicker__date--active.datepicker__date--active{background-color:#e45415;color:#fff}.datepicker__options-container span{font-size:14px}select:focus,select:focus-visible{outline:1px solid #fff}select{border:none;color:#fff;background:none;font-size:14px}select option{color:#333}.np_datepicker_input{border:1px solid #eee;padding:10px;font-size:16px;color:#777}.np_datepicker_input:focus-visible{outline:2px solid #e45415}.prev-month,.next-month{padding:5px;width:20px;height:20px;display:block;opacity:.5;border-radius:50%;background:#f3f3f3;cursor:pointer;text-align:center;line-height:25px}.next-month:hover,.prev-month:hover{background:#ccc}.prev-month svg,.next-month svg{max-width:10px;height:auto}.prev-month{margin-right:5px}.next-month{margin-left:5px}.dark.nepali-date-picker a.active svg{fill:#000}.dark .datepicker__options-container{border-bottom:1px solid #000;background-color:#000;color:#fff}.dark select{color:#fff}.dark .datepicker__date--active.datepicker__date--active{background-color:#000;color:#fff}.dark .np_datepicker_input:focus-visible{outline:2px solid #000}.dark .datepicker__weekday{background-color:#111}.dark .datepicker__days{background-color:#333;border:1px solid #111}.dark .datepicker__date:hover{background-color:#111;color:#fff}.dark .datepicker__date-container{border-bottom:1px solid #222}.light.nepali-date-picker a.active svg{fill:#777}.light .datepicker__options-container{border-bottom:none;background-color:#fff;color:#777}.light select{color:#777}.light .datepicker__date--active.datepicker__date--active{background-color:#aaa;color:#fff}.light .np_datepicker_input:focus-visible{outline:1px solid #ddd}.lightblue.nepali-date-picker a.active svg{fill:#38c5f0da}.lightblue .datepicker__options-container{background-color:#38c5f0da;color:#fff}.lightblue select{color:#fff}.lightblue .datepicker__date--active.datepicker__date--active{background-color:#38c5f0da;color:#fff}.lightblue .np_datepicker_input:focus-visible{outline:2px solid #38c5f0da}.lightblue .np_datepicker_input:focus-visible{outline:1px solid #38c5f0da}\n"] }]
617
+ }], ctorParameters: function () { return [{ type: NpDatePickerService }, { type: i0.ElementRef }]; }, propDecorators: { theme: [{
618
+ type: Input
619
+ }], language: [{
620
+ type: Input
621
+ }], monthDisplayType: [{
622
+ type: Input
623
+ }], clickout: [{
624
+ type: HostListener,
625
+ args: ['document:click', ['$event']]
626
+ }] } });
627
+
628
+ class NepaliDatepickerModule {
629
+ }
630
+ NepaliDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: NepaliDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
631
+ NepaliDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: NepaliDatepickerModule, declarations: [ToNpPipe,
632
+ NpDatePickerComponent], imports: [BrowserModule,
633
+ FormsModule], exports: [NpDatePickerComponent] });
634
+ NepaliDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: NepaliDatepickerModule, imports: [[
635
+ BrowserModule,
636
+ FormsModule
637
+ ]] });
638
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.3", ngImport: i0, type: NepaliDatepickerModule, decorators: [{
639
+ type: NgModule,
640
+ args: [{
641
+ declarations: [
642
+ ToNpPipe,
643
+ NpDatePickerComponent
644
+ ],
645
+ imports: [
646
+ BrowserModule,
647
+ FormsModule
648
+ ],
649
+ exports: [
650
+ NpDatePickerComponent
651
+ ]
652
+ }]
653
+ }] });
654
+
655
+ /*
656
+ * Public API Surface of npx-np-datepicker
657
+ */
658
+
659
+ /**
660
+ * Generated bundle index. Do not edit.
661
+ */
662
+
663
+ export { NepaliDatepickerModule, NpDatePickerComponent, NpDatePickerService };
664
+ //# sourceMappingURL=ngx-np-datepicker.mjs.map