pyno-datepicker 1.0.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/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # 🗓️ pyno-datepicker
2
+
3
+ A modern, standalone Angular datepicker component built entirely with Angular signals. It supports both Persian (Jalali/Shamsi) and Gregorian calendars, and can display a second calendar alongside the primary one — letting users see equivalent dates in both systems at a glance. With an inline or popup mode, a custom trigger element, and a flexible output that can be either a structured object or a formatted string, it adapts to a wide range of use cases. It's fully typed, tree-shakable, and designed for Angular 17+ applications.
4
+
5
+ ---
6
+ ## 📦 Installation
7
+ This package requires **pyno-date** as a peer dependency. Install both together:
8
+ ```bash
9
+ npm install pyno-date pyno-datepicker
10
+ ```
11
+ > Make sure `pyno-date` is installed in the same project, otherwise the datepicker will not work.
12
+
13
+ ## ✨ Features
14
+
15
+ ### 🗓️ Dual Calendar Support
16
+ - **Gregorian** and **Persian (Jalali/Shamsi)** calendars out of the box.
17
+ - Switch between calendars with a single input.
18
+ - Automatic **RTL layout** for the Jalali calendar.
19
+ - Optional **second calendar** display alongside the primary one — each day shows the equivalent date in the other calendar system.
20
+
21
+ ### ⚡ Built with Angular Signals
22
+ - Entire component state managed with **Angular signals** (`signal`, `computed`, `input`, `output`).
23
+ - Fully **standalone** — no NgModule required.
24
+ - Reactive and efficient change detection.
25
+ - Modern Angular 17+ API (`input()`, `output()`).
26
+
27
+ ### 🎛️ Three View Modes
28
+ - **Days view** – classic month grid with 42 cells.
29
+ - **Months view** – click the month name in the header to pick a month.
30
+ - **Years view** – paginated year selector (25 years per page) with next/previous navigation.
31
+
32
+ ### 🔄 Inline & Popup Modes
33
+ - **Inline mode** – embed the calendar directly in the page.
34
+ - **Popup mode** – attach to any element via `triggerFor` and open on click.
35
+ - Click-outside overlay to close the popup.
36
+
37
+ ### 🎨 Flexible Output
38
+ - Return the selected date as either a **structured object** (`PynoDatepickerDateObject`) or a **formatted string**.
39
+ - Custom date format via the `format` input.
40
+ - Separate `onInit` and `onSelect` outputs.
41
+
42
+ ### 🌐 Full Localization Support
43
+ - Customize the **first day of the week** via `setFirstDayOfWeek()`.
44
+ - Override **weekday names** via `setWeekdayName()`.
45
+ - Override **month names** via `setMonthName()`.
46
+ - Custom label for the "Today" button via `todayBtnText`.
47
+
48
+ ```typescript
49
+ this.pynoDatepicker.setFirstDayOfWeek('sunday');
50
+ this.pynoDatepicker.setWeekdayName('gregorian', 'saturday', 'Sat');
51
+ this.pynoDatepicker.setMonthName('gregorian', 9, 'Sep');
52
+ ```
53
+
54
+ ### 🎯 Rich Inputs
55
+
56
+ | Input | Type | Description |
57
+ |-------|------|------------------------------------------|
58
+ | `triggerFor` | `HTMLElement` | Element that opens the popup. |
59
+ | `inline` | `boolean` | Render inline instead of popup. |
60
+ | `initValue` | `string` | Initial selected date. |
61
+ | `secondCalendar` | `boolean` | Show the opposite calendar's day values. |
62
+ | `calendar` | `'gregorian' \| 'jalali'` | Primary calendar system. |
63
+ | `format` | `string` | Date format string. See [pyno-date](https://www.npmjs.com/package/pyno-date) for available format tokens. |
64
+ | `outputAs` | `'object' \| 'string'` | Output shape. |
65
+ | `todayBtnText` | `string` | Label for the today button. |
66
+
67
+ ### 📤 Outputs
68
+
69
+ | Output | Payload | Description |
70
+ |--------|---------|-------------|
71
+ | `onInit` | `PynoDatepickerDateObject \| string \| null` | Emitted on initialization. |
72
+ | `onSelect` | `PynoDatepickerDateObject \| string \| null` | Emitted when the user picks a date. |
73
+
74
+ ### ✨ UX Highlights
75
+ - Highlighted **today** and **selected date**.
76
+ - Visual distinction for **previous-month** and **next-month** days.
77
+ - Smooth enter/leave animations (`animate.enter`, `animate.leave`).
78
+ - "Today" shortcut button that jumps back to the current month.
79
+ - Fully typed API with exported interfaces and union types.
80
+
81
+ ### 🧩 Service API (`PynoDatepickerService`)
82
+ - Injectable, tree-shakable, `providedIn: 'root'`.
83
+ - Public methods for customization:
84
+ - `setFirstDayOfWeek(day)`
85
+ - `setWeekdayName(calendar, weekday, name)`
86
+ - `setMonthName(calendar, month, name)`
87
+ - Built-in month and weekday name dictionaries for both calendars.
88
+
89
+ ## 🎨 Styling & Theming
90
+
91
+ `pyno-datepicker` is fully themeable through **CSS custom properties** and **class overrides**, giving you complete control over its appearance without touching the library's source.
92
+
93
+ ### CSS Variables
94
+ All colors, spacing, radii, shadows, and transitions are exposed as CSS variables on the `:host`. Override any of them in your own stylesheet to instantly re-skin the datepicker:
95
+ ### Class Overrides
96
+ Every part of the datepicker has its own dedicated class (topbar, weekdays, days, months, years, today button, etc.). If CSS variables aren't enough, you can target any of these classes directly to fully customize the layout and presentation.
97
+
98
+ Combined, these two layers let you go from a simple color tweak to a completely custom-looking datepicker.
99
+
100
+ ---
101
+
102
+ ## 🧠 License
103
+
104
+ MIT
105
+
106
+ Designed & developed by [Amir Navidfar](https://github.com/amirhsnf)
@@ -0,0 +1,343 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable, input, signal, output, computed, Component } from '@angular/core';
3
+ import { PynoDateService } from 'pyno-date';
4
+
5
+ class PynoDatepickerService {
6
+ firstDayOfWeek = 'sunday';
7
+ date = inject(PynoDateService);
8
+ gWeekDays = {
9
+ sunday: 'Su',
10
+ monday: 'Mo',
11
+ tuesday: 'Te',
12
+ wednesday: 'We',
13
+ thursday: 'Th',
14
+ friday: 'Fr',
15
+ saturday: 'Sa',
16
+ };
17
+ jWeekDays = {
18
+ sunday: 'ی',
19
+ monday: 'د',
20
+ tuesday: 'س',
21
+ wednesday: 'چ',
22
+ thursday: 'پ',
23
+ friday: 'ج',
24
+ saturday: 'ش',
25
+ };
26
+ gMonths = {
27
+ 1: 'January',
28
+ 2: 'February',
29
+ 3: 'March',
30
+ 4: 'April',
31
+ 5: 'May',
32
+ 6: 'June',
33
+ 7: 'July',
34
+ 8: 'August',
35
+ 9: 'September',
36
+ 10: 'October',
37
+ 11: 'November',
38
+ 12: 'December',
39
+ };
40
+ jMonths = {
41
+ 1: 'فروردین',
42
+ 2: 'اردیبهشت',
43
+ 3: 'خرداد',
44
+ 4: 'تیر',
45
+ 5: 'مرداد',
46
+ 6: 'شهریور',
47
+ 7: 'مهر',
48
+ 8: 'آبان',
49
+ 9: 'آذر',
50
+ 10: 'دی',
51
+ 11: 'بهمن',
52
+ 12: 'اسفند',
53
+ };
54
+ setFirstDayOfWeek(day) {
55
+ this.firstDayOfWeek = day;
56
+ }
57
+ calcWeekdays(cal) {
58
+ const days = Object.keys((cal === 'gregorian' ? this.gWeekDays : this.jWeekDays));
59
+ while (days[0] !== this.firstDayOfWeek) {
60
+ const first = days.shift();
61
+ days.push(first);
62
+ }
63
+ return days;
64
+ }
65
+ getWeekdayName(item, cal) {
66
+ if (cal === 'gregorian')
67
+ return this.gWeekDays[item];
68
+ return this.jWeekDays[item];
69
+ }
70
+ calcDays(date, cal, weekdays) {
71
+ let firstDateTime = 0;
72
+ if (cal === 'gregorian') {
73
+ const firstDate = date.gYear + '-' + date.gMonth + '-01';
74
+ firstDateTime = this.date.strToTime(firstDate);
75
+ }
76
+ else {
77
+ const fdo = this.date.jalaliToGregorian(+date.jYear, +date.jMonth, 1);
78
+ firstDateTime = this.date.strToTime(fdo.gYear + '-' + fdo.gMonth + '-' + fdo.gDay);
79
+ }
80
+ const firstDateWeekday = this.date.gDate('l', firstDateTime).toLowerCase();
81
+ const numberOfPreDays = weekdays.findIndex((q) => q === firstDateWeekday);
82
+ const startingTime = firstDateTime - numberOfPreDays * 86400;
83
+ const output = [];
84
+ for (let i = 0; i < 42; i++) {
85
+ const time = startingTime + i * 86400;
86
+ output.push(this.getDateObject(time));
87
+ }
88
+ return output;
89
+ }
90
+ getDateObject(timestamp) {
91
+ const g = this.date.gDate('Y_n_j_l', timestamp).split('_');
92
+ const j = this.date.jDate('Y_n_j', timestamp).split('_');
93
+ return {
94
+ gYear: g[0],
95
+ gMonth: g[1],
96
+ gDay: g[2],
97
+ gDate: this.date.gDate('Y-m-d', timestamp),
98
+ jYear: j[0],
99
+ jMonth: j[1],
100
+ jDay: j[2],
101
+ jDate: this.date.jDate('Y/m/d', timestamp),
102
+ timestamp: timestamp,
103
+ weekday: g[3].toLowerCase(),
104
+ };
105
+ }
106
+ setWeekdayName(calendar, weekday, name) {
107
+ if (calendar === 'gregorian') {
108
+ this.gWeekDays[weekday] = name;
109
+ }
110
+ else {
111
+ this.jWeekDays[weekday] = name;
112
+ }
113
+ }
114
+ setMonthName(calendar, month, name) {
115
+ if (calendar === 'gregorain') {
116
+ if (month in this.gMonths) {
117
+ this.gMonths[month] = name;
118
+ }
119
+ }
120
+ else {
121
+ if (month in this.jMonths) {
122
+ this.jMonths[month] = name;
123
+ }
124
+ }
125
+ }
126
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PynoDatepickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
127
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PynoDatepickerService, providedIn: 'root' });
128
+ }
129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PynoDatepickerService, decorators: [{
130
+ type: Injectable,
131
+ args: [{
132
+ providedIn: 'root',
133
+ }]
134
+ }] });
135
+
136
+ class PynoDatepicker {
137
+ triggerFor = input(/* @ts-ignore */
138
+ ...(ngDevMode ? [undefined, { debugName: "triggerFor" }] : /* istanbul ignore next */ []));
139
+ inline = input(false, /* @ts-ignore */
140
+ ...(ngDevMode ? [{ debugName: "inline" }] : /* istanbul ignore next */ []));
141
+ initValue = input(/* @ts-ignore */
142
+ ...(ngDevMode ? [undefined, { debugName: "initValue" }] : /* istanbul ignore next */ []));
143
+ secondCalendar = input(false, /* @ts-ignore */
144
+ ...(ngDevMode ? [{ debugName: "secondCalendar" }] : /* istanbul ignore next */ []));
145
+ today;
146
+ selectedDate = signal(null, /* @ts-ignore */
147
+ ...(ngDevMode ? [{ debugName: "selectedDate" }] : /* istanbul ignore next */ []));
148
+ selectedMonth = signal('01', /* @ts-ignore */
149
+ ...(ngDevMode ? [{ debugName: "selectedMonth" }] : /* istanbul ignore next */ []));
150
+ selectedYear = signal('0001', /* @ts-ignore */
151
+ ...(ngDevMode ? [{ debugName: "selectedYear" }] : /* istanbul ignore next */ []));
152
+ isOpen = signal(false, /* @ts-ignore */
153
+ ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
154
+ calendar = input('gregorian', /* @ts-ignore */
155
+ ...(ngDevMode ? [{ debugName: "calendar" }] : /* istanbul ignore next */ []));
156
+ format = input('Y-m-d H:i:s', /* @ts-ignore */
157
+ ...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
158
+ weekdays = signal([], /* @ts-ignore */
159
+ ...(ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []));
160
+ monthDays = signal([], /* @ts-ignore */
161
+ ...(ngDevMode ? [{ debugName: "monthDays" }] : /* istanbul ignore next */ []));
162
+ outputAs = input('object', /* @ts-ignore */
163
+ ...(ngDevMode ? [{ debugName: "outputAs" }] : /* istanbul ignore next */ []));
164
+ onInit = output();
165
+ onSelect = output();
166
+ todayBtnText = input('Today', /* @ts-ignore */
167
+ ...(ngDevMode ? [{ debugName: "todayBtnText" }] : /* istanbul ignore next */ []));
168
+ mode = signal('days', /* @ts-ignore */
169
+ ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
170
+ yearPage = signal(0, /* @ts-ignore */
171
+ ...(ngDevMode ? [{ debugName: "yearPage" }] : /* istanbul ignore next */ []));
172
+ month = computed(() => {
173
+ const cal = this.calendar();
174
+ const month = this.selectedMonth();
175
+ if (cal === 'gregorian' && (+month) in this.datepickerService.gMonths) {
176
+ return this.datepickerService.gMonths[+month];
177
+ }
178
+ if ((+month) in this.datepickerService.jMonths)
179
+ return this.datepickerService.jMonths[+month];
180
+ return '';
181
+ }, /* @ts-ignore */
182
+ ...(ngDevMode ? [{ debugName: "month" }] : /* istanbul ignore next */ []));
183
+ isCurrentMonth = computed(() => {
184
+ const year = this.selectedYear();
185
+ const month = this.selectedMonth();
186
+ const cal = this.calendar();
187
+ console.log('sdsdsdsdsdsd');
188
+ if (cal === 'gregorian') {
189
+ const [cy, cm] = this.dateService.gDate('Y_m').split('_');
190
+ return +cm === +month && +cy === +year;
191
+ }
192
+ else {
193
+ const [cy, cm] = this.dateService.jDate('Y_m').split('_');
194
+ return +cm === +month && +cy === +year;
195
+ }
196
+ }, /* @ts-ignore */
197
+ ...(ngDevMode ? [{ debugName: "isCurrentMonth" }] : /* istanbul ignore next */ []));
198
+ datepickerService = inject(PynoDatepickerService);
199
+ dateService = inject(PynoDateService);
200
+ disableToday = input(false, /* @ts-ignore */
201
+ ...(ngDevMode ? [{ debugName: "disableToday" }] : /* istanbul ignore next */ []));
202
+ ngOnInit() {
203
+ if (this.inline())
204
+ this.init();
205
+ this.onInit.emit(this.output());
206
+ }
207
+ init() {
208
+ this.handleInitValue();
209
+ this.weekdays.set(this.datepickerService.calcWeekdays(this.calendar()));
210
+ this.today = signal(this.datepickerService.getDateObject(this.dateService.strToTime(this.dateService.gDate('Y-m-d'))), /* @ts-ignore */
211
+ ...(ngDevMode ? [{ debugName: "today" }] : /* istanbul ignore next */ []));
212
+ const fromObj = this.selectedDate() ?? this.today();
213
+ const cal = this.calendar();
214
+ this.selectedMonth.set(cal === 'gregorian' ? fromObj.gMonth : fromObj.jMonth);
215
+ this.selectedYear.set(cal === 'gregorian' ? fromObj.gYear : fromObj.jYear);
216
+ this.monthDays.set(this.datepickerService.calcDays(fromObj, this.calendar(), this.weekdays()));
217
+ console.log(this.monthDays());
218
+ }
219
+ handleInitValue() {
220
+ const initVal = this.initValue();
221
+ const cal = this.calendar();
222
+ if (initVal) {
223
+ const converted = this.dateService.convert(initVal, this.format(), cal === 'jalali' ? 'Y-m-d' : 'Y/m/d', cal, 'gregorian');
224
+ if (converted) {
225
+ this.selectedDate.set(this.datepickerService.getDateObject(this.dateService.strToTime(converted)));
226
+ }
227
+ }
228
+ }
229
+ ngAfterViewInit() {
230
+ const tf = this.triggerFor();
231
+ if (!tf)
232
+ return;
233
+ tf.addEventListener('click', () => this.open());
234
+ }
235
+ open() {
236
+ this.init();
237
+ this.isOpen.set(true);
238
+ }
239
+ close() {
240
+ this.isOpen.set(false);
241
+ }
242
+ onDate(item) {
243
+ this.selectedDate.set(item);
244
+ this.onInit.emit(this.output());
245
+ if (!this.inline())
246
+ this.close();
247
+ }
248
+ changeMonth(month, year) {
249
+ if (month > 12) {
250
+ month = 1;
251
+ year++;
252
+ }
253
+ else if (month < 1) {
254
+ month = 12;
255
+ year--;
256
+ }
257
+ this.selectedMonth.set(String(month).padStart(2, '0'));
258
+ this.selectedYear.set(String(year));
259
+ let from = '';
260
+ if (this.calendar() === 'gregorian') {
261
+ from = this.selectedYear() + '-' + this.selectedMonth() + '-' + '15';
262
+ }
263
+ else {
264
+ const jFrom = this.dateService.jalaliToGregorian(+this.selectedYear(), +this.selectedMonth(), 15);
265
+ from = jFrom.gYear + '-' + jFrom.gMonth + '-' + jFrom.gDay;
266
+ }
267
+ const fromTime = this.dateService.strToTime(from);
268
+ const fromObj = this.datepickerService.getDateObject(fromTime);
269
+ this.monthDays.set(this.datepickerService.calcDays(fromObj, this.calendar(), this.weekdays()));
270
+ }
271
+ getSecondMonth(number) {
272
+ const cal = this.calendar();
273
+ let val = '';
274
+ if (cal === 'gregorian') {
275
+ val = this.datepickerService.jMonths[number];
276
+ }
277
+ else {
278
+ val = this.datepickerService.gMonths[number];
279
+ }
280
+ return val.substring(0, 3);
281
+ }
282
+ output() {
283
+ const dateObj = this.selectedDate();
284
+ if (!dateObj)
285
+ return null;
286
+ if (this.outputAs() === 'object')
287
+ return dateObj;
288
+ const format = this.format();
289
+ const cal = this.calendar();
290
+ if (cal === 'gregorian')
291
+ return this.dateService.gDate(format, dateObj.timestamp);
292
+ return this.dateService.jDate(format, dateObj.timestamp);
293
+ }
294
+ goToCurrentMonth() {
295
+ const cal = this.calendar();
296
+ let [cy, cm] = ['', ''];
297
+ if (cal === 'gregorian') {
298
+ [cy, cm] = this.dateService.gDate('Y_m').split('_');
299
+ }
300
+ else {
301
+ [cy, cm] = this.dateService.jDate('Y_m').split('_');
302
+ }
303
+ this.changeMonth(+cm, +cy);
304
+ }
305
+ getMonths() {
306
+ const cal = this.calendar();
307
+ const months = cal === 'gregorian' ? this.datepickerService.gMonths : this.datepickerService.jMonths;
308
+ return Object.values(months).map((q, i) => {
309
+ return {
310
+ title: q,
311
+ val: i + 1,
312
+ };
313
+ });
314
+ }
315
+ years = computed(() => {
316
+ let offset = this.yearPage() * 25;
317
+ const year = +this.selectedYear() + offset;
318
+ const firstYear = Math.floor(year / 25) * 25;
319
+ return Array.from({ length: 25 }, (_, i) => firstYear + i);
320
+ }, /* @ts-ignore */
321
+ ...(ngDevMode ? [{ debugName: "years" }] : /* istanbul ignore next */ []));
322
+ selectYear(item) {
323
+ this.selectedYear.set(String(item).padStart(4, '0'));
324
+ this.mode.set('months');
325
+ }
326
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PynoDatepicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
327
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: PynoDatepicker, isStandalone: true, selector: "pyno-datepicker", inputs: { triggerFor: { classPropertyName: "triggerFor", publicName: "triggerFor", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, initValue: { classPropertyName: "initValue", publicName: "initValue", isSignal: true, isRequired: false, transformFunction: null }, secondCalendar: { classPropertyName: "secondCalendar", publicName: "secondCalendar", isSignal: true, isRequired: false, transformFunction: null }, calendar: { classPropertyName: "calendar", publicName: "calendar", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, outputAs: { classPropertyName: "outputAs", publicName: "outputAs", isSignal: true, isRequired: false, transformFunction: null }, todayBtnText: { classPropertyName: "todayBtnText", publicName: "todayBtnText", isSignal: true, isRequired: false, transformFunction: null }, disableToday: { classPropertyName: "disableToday", publicName: "disableToday", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onInit: "onInit", onSelect: "onSelect" }, ngImport: i0, template: "@if(isOpen() || inline()){\r\n @let cal = calendar();\r\n @if(!inline()){\r\n <div class=\"pdp-overlay\" (click)=\"close()\"></div>\r\n }\r\n <div class=\"pyno-datepicker {{inline() ? 'pdp-inline' : ''}} {{cal === 'jalali' ? 'pdp-rtl' : ''}}\" animate.enter=\"pdp-fade-in\" animate.leave=\"pdp-fade-out\">\r\n <div class=\"pdp-topbar\">\r\n <div class=\"pdp-topbar-btn-wrapper\">\r\n @if(mode() !== 'months'){\r\n <div class=\"pdp-topbar-btn\" (click)=\"mode() === 'days' ? changeMonth(+selectedMonth() - 1, +this.selectedYear()) : yearPage.set(yearPage() - 1)\"></div>\r\n }\r\n </div>\r\n <div class=\"pdp-month-year\">\r\n <div class=\"pdp-month pdp-select\" (click)=\"mode.set('months')\">\r\n {{month()}}\r\n </div>\r\n <div class=\"pdp-year pdp-select\" (click)=\"mode.set('years')\">\r\n {{selectedYear()}}\r\n </div>\r\n </div>\r\n <div class=\"pdp-topbar-btn-wrapper\">\r\n @if(mode() !== 'months'){\r\n <div class=\"pdp-topbar-btn pdp-topbar-btn-reverse\" (click)=\"mode() === 'days' ? changeMonth(+selectedMonth() + 1, +this.selectedYear()) : yearPage.set(yearPage() + 1)\"></div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if(mode() === 'days'){\r\n <div class=\"pdp-weekdays\">\r\n @for(item of weekdays(); track item){\r\n <div class=\"pdp-weekday pdp-weekday-{{item}}\">\r\n {{datepickerService.getWeekdayName(item, cal)}}\r\n </div>\r\n }\r\n </div>\r\n <div class=\"pdp-days\">\r\n @for(item of monthDays(); track item.timestamp){\r\n @if(($index < 40 && !this.isCurrentMonth()) || this.isCurrentMonth()){\r\n <div class=\"pdp-day-wrapper\">\r\n <div class=\"pdp-day pdp-{{item.weekday}} pdp-{{item.gDate}} pdp-{{item.jDate}}\"\r\n [class.pdp-today]=\"today().timestamp === item.timestamp\"\r\n [class.pdp-day-pre-month]=\"(cal === 'gregorian' && +item.gMonth < +selectedMonth()) || (cal === 'jalali' && +item.jMonth < +selectedMonth())\"\r\n [class.pdp-day-next-month]=\"(cal === 'gregorian' && +item.gMonth > +selectedMonth()) || (cal === 'jalali' && +item.jMonth > +selectedMonth())\"\r\n [class.pdp-day-selected]=\"item.timestamp === selectedDate()?.timestamp\"\r\n (click)=\"onDate(item)\"\r\n >\r\n <div class=\"pdp-day-main-value\">\r\n {{cal === 'gregorian' ? item.gDay : item.jDay}}\r\n @if(secondCalendar()){\r\n <div class=\"pdp-day-second-value\">\r\n @let secondVal = +(cal === 'gregorian' ? item.jDay : item.gDay);\r\n @if(secondVal === 1 || $index == 0 || $index == 41){\r\n {{getSecondMonth((cal === 'gregorian' ? +item.jMonth : +item.gMonth)) + ' ' + secondVal}}\r\n } @else {\r\n {{secondVal}}\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if(!this.isCurrentMonth()){\r\n <div class=\"pdp-today-btn-wrapper\" (click)=\"goToCurrentMonth()\">\r\n <div class=\"pdp-today-btn\">\r\n {{todayBtnText()}}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else if(mode() === 'months'){\r\n <div class=\"pdp-months\">\r\n @let months = getMonths();\r\n @for(item of months; track item.val){\r\n <div class=\"pdp-month-wrapper\">\r\n <div class=\"pdp-month-each\" [class.pdp-month-selected]=\"item.val === +selectedMonth()\" (click)=\"changeMonth(+item.val, +this.selectedYear()); mode.set('days')\">\r\n {{item.title}}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <div class=\"pdp-years\">\r\n @for(item of years(); track item){\r\n <div class=\"pdp-year-wrapper\">\r\n <div class=\"pdp-year-each\" [class.pdp-year-selected]=\"item === +selectedYear()\" (click)=\"selectYear(item)\">\r\n {{item}}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{--pdp-bg-color: white;--pdp-border-radius: 16px;--pdp-width: 350px;--pdp-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2);--pdp-transition: all .3s ease;--pdp-select-bg: transparent;--pdb-select-bg-hover: #eee;--pdp-select-color: #222;--pdp-topbar-btn-icon-color: #666;--pdb-topbar-btn-bg: transparent;--pdb-topbar-btn-bg-hover: #eee;--pdp-weekday-color: #666;--pdp-day-bg: transparent;--pdp-day-bg-hover: #eee;--pdp-day-color: #666;--pdp-today-bg: rgba(179, 179, 22, .15);--pdp-today-color: #222;--pdp-selected-bg: #857fe6;--pdp-selected-color: white;--pdp-selected-bg-hover: #7772cf;--pdp-selected-color-hover: white;--today-btn-bg: #eee;--today-btn-color: #666}.pdp-overlay{width:100vw;height:100vh;position:fixed;top:0;left:0;z-index:9998}.pyno-datepicker{background-color:var(--pdp-bg-color);border-radius:var(--pdp-border-radius);width:var(--pdp-width);box-shadow:var(--pdp-shadow);overflow:hidden;font-family:inherit;z-index:9999;position:absolute}.pdp-fade-in{opacity:0;animation:pdp-fade-in ease-in .2s}.pdp-fade-out{opacity:1;animation:pdp-fade-in ease-out .2s reverse}@keyframes pdp-fade-in{0%{opacity:0}to{opacity:1}}.pyno-datepicker *{box-sizing:border-box}.pdp-rtl{direction:rtl}.pdp-inline{position:relative}.pdp-topbar{display:flex;height:50px;align-items:center}.pdp-topbar-btn-wrapper{width:50px;height:50px;padding:10px}.pdp-topbar-btn{width:100%;height:100%;background-color:var(--pdb-topbar-btn-bg);border-radius:6px;position:relative;cursor:pointer;transition:var(--pdp-transition)}.pdp-topbar-btn:hover{background-color:var(--pdb-topbar-btn-bg-hover)}.pdp-topbar-btn:before{content:\"\";display:inline-block;-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 700 700'%3E%3Cpath d='M491.42,526.78l-176.78-176.78,176.78-176.78c19.53-19.53,19.53-51.18,0-70.71h0c-19.53-19.53-51.18-19.53-70.71,0l-212.13,212.13h0c-19.53,19.53-19.53,51.18,0,70.71h0l212.13,212.13c19.53,19.53,51.18,19.53,70.71,0h0c19.53-19.53,19.53-51.18,0-70.71Z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 700 700'%3E%3Cpath d='M491.42,526.78l-176.78-176.78,176.78-176.78c19.53-19.53,19.53-51.18,0-70.71h0c-19.53-19.53-51.18-19.53-70.71,0l-212.13,212.13h0c-19.53,19.53-19.53,51.18,0,70.71h0l212.13,212.13c19.53,19.53,51.18,19.53,70.71,0h0c19.53-19.53,19.53-51.18,0-70.71Z'/%3E%3C/svg%3E\");-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;background-color:var(--pdp-topbar-btn-icon-color);width:16px;height:16px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.pdp-rtl .pdp-topbar-btn:before{transform:translate(-50%,-50%) scaleX(-1)}.pdp-topbar-btn-reverse:before{transform:translate(-50%,-50%) scaleX(-1)}.pdp-rtl .pdp-topbar-btn-reverse:before{transform:translate(-50%,-50%)}.pdp-month-year{display:flex;align-items:center;justify-content:center;width:calc(100% - 100px);gap:2px}.pdp-select{background-color:var(--pdp-select-bg);border-radius:6px;padding:5px 10px;font-weight:700;cursor:pointer;transition:var(--pdp-transition);font-size:14px;color:var(--pdp-select-color)}.pdp-select:hover{background-color:var(--pdb-select-bg-hover)}.pdp-weekdays{display:flex;height:30px;align-items:center;padding:2px}.pdp-weekday{width:14.2857%;text-align:center;font-size:12px;font-weight:700;color:var(--pdp-weekday-color)}.pdp-days{display:flex;width:100%;flex-wrap:wrap;padding:2px;position:relative}.pdp-day-wrapper{width:14.2857%;padding:2px;aspect-ratio:1/1}.pdp-day{width:100%;height:100%;background-color:var(--pdp-day-bg);color:var(--pdp-day-color);position:relative;border-radius:6px;cursor:pointer;transition:var(--pdp-transition)}.pdp-day:hover{background-color:var(--pdp-day-bg-hover)}.pdp-day-main-value{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:14px;font-weight:700;text-align:center;width:100%}.pdp-day-second-value{font-size:10px;font-weight:700;opacity:.5;line-height:1;width:100%}.pdp-day-pre-month,.pdp-day-next-month{opacity:.4}.pdp-today{background-color:var(--pdp-today-bg);color:var(--pdp-today-color)}.pdp-day-selected{background-color:var(--pdp-selected-bg);color:var(--pdp-selected-color);border-radius:50%}.pdp-day-selected:hover{background-color:var(--pdp-selected-bg-hover);color:var(--pdp-selected-color-hover)}.pdp-today-btn-wrapper{width:28.5714%;padding:5px}.pdp-today-btn{background-color:var(--today-btn-bg);height:100%;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:700;border-radius:12px;cursor:pointer;transition:var(--pdp-transition);color:var(--today-btn-color)}.pdp-today-btn:hover{opacity:.75}.pdp-months,.pdp-years{display:flex;width:100%;flex-wrap:wrap;padding:4px;position:relative}.pdp-month-wrapper{width:33.3333%;padding:2px}.pdp-month-each{width:100%;height:50px;background-color:var(--pdp-day-bg);position:relative;border-radius:6px;cursor:pointer;transition:var(--pdp-transition);text-align:center;font-size:14px;font-weight:700;display:flex;align-items:center;justify-content:center}.pdp-month-each:hover{background-color:var(--pdp-day-bg-hover)}.pdp-month-selected{background-color:var(--pdp-selected-bg);color:var(--pdp-selected-color)}.pdp-month-selected:hover{background-color:var(--pdp-selected-bg-hover);color:var(--pdp-selected-color-hover)}.pdp-year-wrapper{width:20%;padding:2px}.pdp-year-each{display:flex;height:50px;align-items:center;justify-content:center;font-size:14px;font-weight:700;background-color:var(--pdp-day-bg);transition:var(--pdp-transition);cursor:pointer;border-radius:6px}.pdp-year-each:hover{background-color:var(--pdp-day-bg-hover)}.pdp-year-selected{background-color:var(--pdp-selected-bg);color:var(--pdp-selected-color)}.pdp-year-selected:hover{background-color:var(--pdp-selected-bg-hover);color:var(--pdp-selected-color-hover)}\n", ""] });
328
+ }
329
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: PynoDatepicker, decorators: [{
330
+ type: Component,
331
+ args: [{ imports: [], selector: 'pyno-datepicker', template: "@if(isOpen() || inline()){\r\n @let cal = calendar();\r\n @if(!inline()){\r\n <div class=\"pdp-overlay\" (click)=\"close()\"></div>\r\n }\r\n <div class=\"pyno-datepicker {{inline() ? 'pdp-inline' : ''}} {{cal === 'jalali' ? 'pdp-rtl' : ''}}\" animate.enter=\"pdp-fade-in\" animate.leave=\"pdp-fade-out\">\r\n <div class=\"pdp-topbar\">\r\n <div class=\"pdp-topbar-btn-wrapper\">\r\n @if(mode() !== 'months'){\r\n <div class=\"pdp-topbar-btn\" (click)=\"mode() === 'days' ? changeMonth(+selectedMonth() - 1, +this.selectedYear()) : yearPage.set(yearPage() - 1)\"></div>\r\n }\r\n </div>\r\n <div class=\"pdp-month-year\">\r\n <div class=\"pdp-month pdp-select\" (click)=\"mode.set('months')\">\r\n {{month()}}\r\n </div>\r\n <div class=\"pdp-year pdp-select\" (click)=\"mode.set('years')\">\r\n {{selectedYear()}}\r\n </div>\r\n </div>\r\n <div class=\"pdp-topbar-btn-wrapper\">\r\n @if(mode() !== 'months'){\r\n <div class=\"pdp-topbar-btn pdp-topbar-btn-reverse\" (click)=\"mode() === 'days' ? changeMonth(+selectedMonth() + 1, +this.selectedYear()) : yearPage.set(yearPage() + 1)\"></div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if(mode() === 'days'){\r\n <div class=\"pdp-weekdays\">\r\n @for(item of weekdays(); track item){\r\n <div class=\"pdp-weekday pdp-weekday-{{item}}\">\r\n {{datepickerService.getWeekdayName(item, cal)}}\r\n </div>\r\n }\r\n </div>\r\n <div class=\"pdp-days\">\r\n @for(item of monthDays(); track item.timestamp){\r\n @if(($index < 40 && !this.isCurrentMonth()) || this.isCurrentMonth()){\r\n <div class=\"pdp-day-wrapper\">\r\n <div class=\"pdp-day pdp-{{item.weekday}} pdp-{{item.gDate}} pdp-{{item.jDate}}\"\r\n [class.pdp-today]=\"today().timestamp === item.timestamp\"\r\n [class.pdp-day-pre-month]=\"(cal === 'gregorian' && +item.gMonth < +selectedMonth()) || (cal === 'jalali' && +item.jMonth < +selectedMonth())\"\r\n [class.pdp-day-next-month]=\"(cal === 'gregorian' && +item.gMonth > +selectedMonth()) || (cal === 'jalali' && +item.jMonth > +selectedMonth())\"\r\n [class.pdp-day-selected]=\"item.timestamp === selectedDate()?.timestamp\"\r\n (click)=\"onDate(item)\"\r\n >\r\n <div class=\"pdp-day-main-value\">\r\n {{cal === 'gregorian' ? item.gDay : item.jDay}}\r\n @if(secondCalendar()){\r\n <div class=\"pdp-day-second-value\">\r\n @let secondVal = +(cal === 'gregorian' ? item.jDay : item.gDay);\r\n @if(secondVal === 1 || $index == 0 || $index == 41){\r\n {{getSecondMonth((cal === 'gregorian' ? +item.jMonth : +item.gMonth)) + ' ' + secondVal}}\r\n } @else {\r\n {{secondVal}}\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if(!this.isCurrentMonth()){\r\n <div class=\"pdp-today-btn-wrapper\" (click)=\"goToCurrentMonth()\">\r\n <div class=\"pdp-today-btn\">\r\n {{todayBtnText()}}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else if(mode() === 'months'){\r\n <div class=\"pdp-months\">\r\n @let months = getMonths();\r\n @for(item of months; track item.val){\r\n <div class=\"pdp-month-wrapper\">\r\n <div class=\"pdp-month-each\" [class.pdp-month-selected]=\"item.val === +selectedMonth()\" (click)=\"changeMonth(+item.val, +this.selectedYear()); mode.set('days')\">\r\n {{item.title}}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <div class=\"pdp-years\">\r\n @for(item of years(); track item){\r\n <div class=\"pdp-year-wrapper\">\r\n <div class=\"pdp-year-each\" [class.pdp-year-selected]=\"item === +selectedYear()\" (click)=\"selectYear(item)\">\r\n {{item}}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{--pdp-bg-color: white;--pdp-border-radius: 16px;--pdp-width: 350px;--pdp-shadow: 0 5px 10px 0 rgba(0, 0, 0, .2);--pdp-transition: all .3s ease;--pdp-select-bg: transparent;--pdb-select-bg-hover: #eee;--pdp-select-color: #222;--pdp-topbar-btn-icon-color: #666;--pdb-topbar-btn-bg: transparent;--pdb-topbar-btn-bg-hover: #eee;--pdp-weekday-color: #666;--pdp-day-bg: transparent;--pdp-day-bg-hover: #eee;--pdp-day-color: #666;--pdp-today-bg: rgba(179, 179, 22, .15);--pdp-today-color: #222;--pdp-selected-bg: #857fe6;--pdp-selected-color: white;--pdp-selected-bg-hover: #7772cf;--pdp-selected-color-hover: white;--today-btn-bg: #eee;--today-btn-color: #666}.pdp-overlay{width:100vw;height:100vh;position:fixed;top:0;left:0;z-index:9998}.pyno-datepicker{background-color:var(--pdp-bg-color);border-radius:var(--pdp-border-radius);width:var(--pdp-width);box-shadow:var(--pdp-shadow);overflow:hidden;font-family:inherit;z-index:9999;position:absolute}.pdp-fade-in{opacity:0;animation:pdp-fade-in ease-in .2s}.pdp-fade-out{opacity:1;animation:pdp-fade-in ease-out .2s reverse}@keyframes pdp-fade-in{0%{opacity:0}to{opacity:1}}.pyno-datepicker *{box-sizing:border-box}.pdp-rtl{direction:rtl}.pdp-inline{position:relative}.pdp-topbar{display:flex;height:50px;align-items:center}.pdp-topbar-btn-wrapper{width:50px;height:50px;padding:10px}.pdp-topbar-btn{width:100%;height:100%;background-color:var(--pdb-topbar-btn-bg);border-radius:6px;position:relative;cursor:pointer;transition:var(--pdp-transition)}.pdp-topbar-btn:hover{background-color:var(--pdb-topbar-btn-bg-hover)}.pdp-topbar-btn:before{content:\"\";display:inline-block;-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 700 700'%3E%3Cpath d='M491.42,526.78l-176.78-176.78,176.78-176.78c19.53-19.53,19.53-51.18,0-70.71h0c-19.53-19.53-51.18-19.53-70.71,0l-212.13,212.13h0c-19.53,19.53-19.53,51.18,0,70.71h0l212.13,212.13c19.53,19.53,51.18,19.53,70.71,0h0c19.53-19.53,19.53-51.18,0-70.71Z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 700 700'%3E%3Cpath d='M491.42,526.78l-176.78-176.78,176.78-176.78c19.53-19.53,19.53-51.18,0-70.71h0c-19.53-19.53-51.18-19.53-70.71,0l-212.13,212.13h0c-19.53,19.53-19.53,51.18,0,70.71h0l212.13,212.13c19.53,19.53,51.18,19.53,70.71,0h0c19.53-19.53,19.53-51.18,0-70.71Z'/%3E%3C/svg%3E\");-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;background-color:var(--pdp-topbar-btn-icon-color);width:16px;height:16px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.pdp-rtl .pdp-topbar-btn:before{transform:translate(-50%,-50%) scaleX(-1)}.pdp-topbar-btn-reverse:before{transform:translate(-50%,-50%) scaleX(-1)}.pdp-rtl .pdp-topbar-btn-reverse:before{transform:translate(-50%,-50%)}.pdp-month-year{display:flex;align-items:center;justify-content:center;width:calc(100% - 100px);gap:2px}.pdp-select{background-color:var(--pdp-select-bg);border-radius:6px;padding:5px 10px;font-weight:700;cursor:pointer;transition:var(--pdp-transition);font-size:14px;color:var(--pdp-select-color)}.pdp-select:hover{background-color:var(--pdb-select-bg-hover)}.pdp-weekdays{display:flex;height:30px;align-items:center;padding:2px}.pdp-weekday{width:14.2857%;text-align:center;font-size:12px;font-weight:700;color:var(--pdp-weekday-color)}.pdp-days{display:flex;width:100%;flex-wrap:wrap;padding:2px;position:relative}.pdp-day-wrapper{width:14.2857%;padding:2px;aspect-ratio:1/1}.pdp-day{width:100%;height:100%;background-color:var(--pdp-day-bg);color:var(--pdp-day-color);position:relative;border-radius:6px;cursor:pointer;transition:var(--pdp-transition)}.pdp-day:hover{background-color:var(--pdp-day-bg-hover)}.pdp-day-main-value{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:14px;font-weight:700;text-align:center;width:100%}.pdp-day-second-value{font-size:10px;font-weight:700;opacity:.5;line-height:1;width:100%}.pdp-day-pre-month,.pdp-day-next-month{opacity:.4}.pdp-today{background-color:var(--pdp-today-bg);color:var(--pdp-today-color)}.pdp-day-selected{background-color:var(--pdp-selected-bg);color:var(--pdp-selected-color);border-radius:50%}.pdp-day-selected:hover{background-color:var(--pdp-selected-bg-hover);color:var(--pdp-selected-color-hover)}.pdp-today-btn-wrapper{width:28.5714%;padding:5px}.pdp-today-btn{background-color:var(--today-btn-bg);height:100%;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:700;border-radius:12px;cursor:pointer;transition:var(--pdp-transition);color:var(--today-btn-color)}.pdp-today-btn:hover{opacity:.75}.pdp-months,.pdp-years{display:flex;width:100%;flex-wrap:wrap;padding:4px;position:relative}.pdp-month-wrapper{width:33.3333%;padding:2px}.pdp-month-each{width:100%;height:50px;background-color:var(--pdp-day-bg);position:relative;border-radius:6px;cursor:pointer;transition:var(--pdp-transition);text-align:center;font-size:14px;font-weight:700;display:flex;align-items:center;justify-content:center}.pdp-month-each:hover{background-color:var(--pdp-day-bg-hover)}.pdp-month-selected{background-color:var(--pdp-selected-bg);color:var(--pdp-selected-color)}.pdp-month-selected:hover{background-color:var(--pdp-selected-bg-hover);color:var(--pdp-selected-color-hover)}.pdp-year-wrapper{width:20%;padding:2px}.pdp-year-each{display:flex;height:50px;align-items:center;justify-content:center;font-size:14px;font-weight:700;background-color:var(--pdp-day-bg);transition:var(--pdp-transition);cursor:pointer;border-radius:6px}.pdp-year-each:hover{background-color:var(--pdp-day-bg-hover)}.pdp-year-selected{background-color:var(--pdp-selected-bg);color:var(--pdp-selected-color)}.pdp-year-selected:hover{background-color:var(--pdp-selected-bg-hover);color:var(--pdp-selected-color-hover)}\n"] }]
332
+ }], propDecorators: { triggerFor: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerFor", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], initValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initValue", required: false }] }], secondCalendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondCalendar", required: false }] }], calendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendar", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], outputAs: [{ type: i0.Input, args: [{ isSignal: true, alias: "outputAs", required: false }] }], onInit: [{ type: i0.Output, args: ["onInit"] }], onSelect: [{ type: i0.Output, args: ["onSelect"] }], todayBtnText: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayBtnText", required: false }] }], disableToday: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableToday", required: false }] }] } });
333
+
334
+ /*
335
+ * Public API Surface of pyno-datepicker
336
+ */
337
+
338
+ /**
339
+ * Generated bundle index. Do not edit.
340
+ */
341
+
342
+ export { PynoDatepicker, PynoDatepickerService };
343
+ //# sourceMappingURL=pyno-datepicker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pyno-datepicker.mjs","sources":["../../../projects/pyno-datepicker/src/lib/pyno-datepicker.service.ts","../../../projects/pyno-datepicker/src/lib/pyno-datepicker.ts","../../../projects/pyno-datepicker/src/lib/pyno-datepicker.html","../../../projects/pyno-datepicker/src/public-api.ts","../../../projects/pyno-datepicker/src/pyno-datepicker.ts"],"sourcesContent":["import {inject, Injectable} from '@angular/core';\r\nimport {PynoDatepickerDateObject, PynoDatepickerDayOfWeek} from './pyno-datepicker.type';\r\nimport {PynoDateService} from 'pyno-date';\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class PynoDatepickerService {\r\n private firstDayOfWeek: PynoDatepickerDayOfWeek = 'sunday';\r\n date = inject(PynoDateService);\r\n gWeekDays: Record<PynoDatepickerDayOfWeek, string> = {\r\n sunday: 'Su',\r\n monday: 'Mo',\r\n tuesday: 'Te',\r\n wednesday: 'We',\r\n thursday: 'Th',\r\n friday: 'Fr',\r\n saturday: 'Sa',\r\n };\r\n jWeekDays: Record<PynoDatepickerDayOfWeek, string> = {\r\n sunday: 'ی',\r\n monday: 'د',\r\n tuesday: 'س',\r\n wednesday: 'چ',\r\n thursday: 'پ',\r\n friday: 'ج',\r\n saturday: 'ش',\r\n };\r\n gMonths: Record<number, string> = {\r\n 1: 'January',\r\n 2: 'February',\r\n 3: 'March',\r\n 4: 'April',\r\n 5: 'May',\r\n 6: 'June',\r\n 7: 'July',\r\n 8: 'August',\r\n 9: 'September',\r\n 10: 'October',\r\n 11: 'November',\r\n 12: 'December',\r\n };\r\n jMonths: Record<number, string> = {\r\n 1: 'فروردین',\r\n 2: 'اردیبهشت',\r\n 3: 'خرداد',\r\n 4: 'تیر',\r\n 5: 'مرداد',\r\n 6: 'شهریور',\r\n 7: 'مهر',\r\n 8: 'آبان',\r\n 9: 'آذر',\r\n 10: 'دی',\r\n 11: 'بهمن',\r\n 12: 'اسفند',\r\n };\r\n setFirstDayOfWeek(day: PynoDatepickerDayOfWeek) {\r\n this.firstDayOfWeek = day;\r\n }\r\n calcWeekdays(cal: 'gregorian' | 'jalali') {\r\n const days: PynoDatepickerDayOfWeek[] = Object.keys(\r\n (cal === 'gregorian' ? this.gWeekDays: this.jWeekDays),\r\n ) as PynoDatepickerDayOfWeek[];\r\n while (days[0] !== this.firstDayOfWeek) {\r\n const first = days.shift()!;\r\n days.push(first);\r\n }\r\n return days;\r\n }\r\n getWeekdayName(item: PynoDatepickerDayOfWeek, cal: 'gregorian' | 'jalali') {\r\n if(cal === 'gregorian')\r\n return this.gWeekDays[item];\r\n return this.jWeekDays[item];\r\n }\r\n calcDays(\r\n date: PynoDatepickerDateObject,\r\n cal: 'gregorian' | 'jalali',\r\n weekdays: PynoDatepickerDayOfWeek[],\r\n ) {\r\n let firstDateTime = 0;\r\n if (cal === 'gregorian') {\r\n const firstDate = date.gYear + '-' + date.gMonth + '-01';\r\n firstDateTime = this.date.strToTime(firstDate)!;\r\n } else {\r\n const fdo = this.date.jalaliToGregorian(+date.jYear, +date.jMonth, 1);\r\n firstDateTime = this.date.strToTime(fdo.gYear + '-' + fdo.gMonth + '-' + fdo.gDay)!;\r\n }\r\n const firstDateWeekday = this.date.gDate('l', firstDateTime).toLowerCase();\r\n const numberOfPreDays = weekdays.findIndex((q: string) => q === firstDateWeekday);\r\n const startingTime = firstDateTime - numberOfPreDays * 86400;\r\n const output: PynoDatepickerDateObject[] = [];\r\n for (let i = 0; i < 42; i++) {\r\n const time = startingTime + i * 86400;\r\n output.push(this.getDateObject(time));\r\n }\r\n return output;\r\n }\r\n getDateObject(timestamp: number): PynoDatepickerDateObject {\r\n const g = this.date.gDate('Y_n_j_l', timestamp).split('_');\r\n const j = this.date.jDate('Y_n_j', timestamp).split('_');\r\n return {\r\n gYear: g[0],\r\n gMonth: g[1],\r\n gDay: g[2],\r\n gDate: this.date.gDate('Y-m-d', timestamp),\r\n jYear: j[0],\r\n jMonth: j[1],\r\n jDay: j[2],\r\n jDate: this.date.jDate('Y/m/d', timestamp),\r\n timestamp: timestamp,\r\n weekday: g[3].toLowerCase(),\r\n };\r\n }\r\n setWeekdayName(calendar: 'jalali' | 'gregorian', weekday: PynoDatepickerDayOfWeek, name: string){\r\n if(calendar === 'gregorian'){\r\n this.gWeekDays[weekday] = name;\r\n } else {\r\n this.jWeekDays[weekday] = name;\r\n }\r\n }\r\n setMonthName(calendar: 'jalali' | 'gregorain', month: number, name: string){\r\n if(calendar === 'gregorain'){\r\n if(month in this.gMonths){\r\n this.gMonths[month] = name;\r\n }\r\n } else {\r\n if (month in this.jMonths) {\r\n this.jMonths[month] = name;\r\n }\r\n }\r\n }\r\n}\r\n","import {\r\n AfterViewInit,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport {PynoDateService} from 'pyno-date';\r\nimport {PynoDatepickerService} from './pyno-datepicker.service';\r\nimport {PynoDatepickerDateObject, PynoDatepickerDayOfWeek} from './pyno-datepicker.type';\r\n\r\n@Component({\r\n imports: [],\r\n selector: 'pyno-datepicker',\r\n styles: ``,\r\n templateUrl: './pyno-datepicker.html',\r\n styleUrl: './pyno-datepicker.css',\r\n})\r\nexport class PynoDatepicker implements AfterViewInit {\r\n triggerFor = input<HTMLElement>();\r\n inline = input<boolean>(false);\r\n initValue = input<string | null | undefined>();\r\n secondCalendar = input<boolean>(false);\r\n today!: WritableSignal<PynoDatepickerDateObject>;\r\n selectedDate = signal<PynoDatepickerDateObject | null>(null);\r\n selectedMonth = signal('01');\r\n selectedYear = signal('0001');\r\n isOpen = signal(false);\r\n calendar = input<'gregorian' | 'jalali'>('gregorian');\r\n format = input('Y-m-d H:i:s');\r\n weekdays = signal<PynoDatepickerDayOfWeek[]>([]);\r\n monthDays = signal<PynoDatepickerDateObject[]>([]);\r\n outputAs = input<'object' | 'string'>('object');\r\n onInit = output<PynoDatepickerDateObject | string | null>();\r\n onSelect = output<PynoDatepickerDateObject | string>();\r\n todayBtnText = input<string>('Today');\r\n mode = signal<'days' | 'months' | 'years'>('days');\r\n yearPage = signal(0);\r\n month = computed(() => {\r\n const cal = this.calendar();\r\n const month = this.selectedMonth();\r\n if (cal === 'gregorian' && (+month) in this.datepickerService.gMonths) {\r\n return this.datepickerService.gMonths[+month];\r\n }\r\n if ((+month) in this.datepickerService.jMonths) return this.datepickerService.jMonths[+month];\r\n return '';\r\n });\r\n isCurrentMonth = computed(() => {\r\n const year = this.selectedYear();\r\n const month = this.selectedMonth();\r\n const cal = this.calendar();\r\n console.log('sdsdsdsdsdsd');\r\n if (cal === 'gregorian') {\r\n const [cy, cm] = this.dateService.gDate('Y_m').split('_');\r\n return +cm === +month && +cy === +year;\r\n } else {\r\n const [cy, cm] = this.dateService.jDate('Y_m').split('_');\r\n return +cm === +month && +cy === +year;\r\n }\r\n });\r\n datepickerService = inject(PynoDatepickerService);\r\n dateService = inject(PynoDateService);\r\n disableToday = input<boolean>(false);\r\n ngOnInit() {\r\n if (this.inline()) this.init();\r\n this.onInit.emit(this.output());\r\n }\r\n init() {\r\n this.handleInitValue();\r\n this.weekdays.set(this.datepickerService.calcWeekdays(this.calendar()));\r\n this.today = signal(\r\n this.datepickerService.getDateObject(\r\n this.dateService.strToTime(this.dateService.gDate('Y-m-d'))!,\r\n ),\r\n );\r\n const fromObj = this.selectedDate() ?? this.today();\r\n const cal = this.calendar();\r\n this.selectedMonth.set(cal === 'gregorian' ? fromObj.gMonth : fromObj.jMonth);\r\n this.selectedYear.set(cal === 'gregorian' ? fromObj.gYear : fromObj.jYear);\r\n this.monthDays.set(this.datepickerService.calcDays(fromObj, this.calendar(), this.weekdays()));\r\n console.log(this.monthDays());\r\n }\r\n\r\n private handleInitValue() {\r\n const initVal = this.initValue();\r\n const cal = this.calendar();\r\n if (initVal) {\r\n const converted = this.dateService.convert(\r\n initVal,\r\n this.format(),\r\n cal === 'jalali' ? 'Y-m-d' : 'Y/m/d',\r\n cal,\r\n 'gregorian',\r\n );\r\n if (converted) {\r\n this.selectedDate.set(\r\n this.datepickerService.getDateObject(this.dateService.strToTime(converted)!),\r\n );\r\n }\r\n }\r\n }\r\n ngAfterViewInit() {\r\n const tf = this.triggerFor();\r\n if (!tf) return;\r\n tf.addEventListener('click', () => this.open());\r\n }\r\n open() {\r\n this.init();\r\n this.isOpen.set(true);\r\n }\r\n close() {\r\n this.isOpen.set(false);\r\n }\r\n onDate(item: PynoDatepickerDateObject) {\r\n this.selectedDate.set(item);\r\n this.onInit.emit(this.output());\r\n if (!this.inline()) this.close();\r\n }\r\n changeMonth(month: number, year: number) {\r\n if (month > 12) {\r\n month = 1;\r\n year++;\r\n } else if (month < 1) {\r\n month = 12;\r\n year--;\r\n }\r\n this.selectedMonth.set(String(month).padStart(2, '0'));\r\n this.selectedYear.set(String(year));\r\n let from = '';\r\n if (this.calendar() === 'gregorian') {\r\n from = this.selectedYear() + '-' + this.selectedMonth() + '-' + '15';\r\n } else {\r\n const jFrom = this.dateService.jalaliToGregorian(\r\n +this.selectedYear(),\r\n +this.selectedMonth(),\r\n 15,\r\n );\r\n from = jFrom.gYear + '-' + jFrom.gMonth + '-' + jFrom.gDay;\r\n }\r\n const fromTime = this.dateService.strToTime(from)!;\r\n const fromObj = this.datepickerService.getDateObject(fromTime);\r\n this.monthDays.set(this.datepickerService.calcDays(fromObj, this.calendar(), this.weekdays()));\r\n }\r\n\r\n getSecondMonth(number: number) {\r\n const cal = this.calendar();\r\n let val = '';\r\n if (cal === 'gregorian') {\r\n val = this.datepickerService.jMonths[number];\r\n } else {\r\n val = this.datepickerService.gMonths[number];\r\n }\r\n return val.substring(0, 3);\r\n }\r\n output(): PynoDatepickerDateObject | string | null {\r\n const dateObj = this.selectedDate();\r\n if (!dateObj) return null;\r\n if (this.outputAs() === 'object') return dateObj;\r\n const format = this.format();\r\n const cal = this.calendar();\r\n if (cal === 'gregorian') return this.dateService.gDate(format, dateObj.timestamp);\r\n return this.dateService.jDate(format, dateObj.timestamp);\r\n }\r\n\r\n protected goToCurrentMonth() {\r\n const cal = this.calendar();\r\n let [cy, cm] = ['', ''];\r\n if (cal === 'gregorian') {\r\n [cy, cm] = this.dateService.gDate('Y_m').split('_');\r\n } else {\r\n [cy, cm] = this.dateService.jDate('Y_m').split('_');\r\n }\r\n this.changeMonth(+cm, +cy);\r\n }\r\n getMonths() {\r\n const cal = this.calendar();\r\n const months =\r\n cal === 'gregorian' ? this.datepickerService.gMonths : this.datepickerService.jMonths;\r\n return Object.values(months).map((q: string, i: number) => {\r\n return {\r\n title: q,\r\n val: i + 1,\r\n };\r\n });\r\n }\r\n years = computed(() => {\r\n let offset = this.yearPage() * 25;\r\n const year = +this.selectedYear() + offset;\r\n const firstYear = Math.floor(year / 25) * 25;\r\n return Array.from({length: 25}, (_, i) => firstYear + i);\r\n });\r\n\r\n protected selectYear(item: number) {\r\n this.selectedYear.set(String(item).padStart(4, '0'));\r\n this.mode.set('months');\r\n }\r\n}\r\n","@if(isOpen() || inline()){\r\n @let cal = calendar();\r\n @if(!inline()){\r\n <div class=\"pdp-overlay\" (click)=\"close()\"></div>\r\n }\r\n <div class=\"pyno-datepicker {{inline() ? 'pdp-inline' : ''}} {{cal === 'jalali' ? 'pdp-rtl' : ''}}\" animate.enter=\"pdp-fade-in\" animate.leave=\"pdp-fade-out\">\r\n <div class=\"pdp-topbar\">\r\n <div class=\"pdp-topbar-btn-wrapper\">\r\n @if(mode() !== 'months'){\r\n <div class=\"pdp-topbar-btn\" (click)=\"mode() === 'days' ? changeMonth(+selectedMonth() - 1, +this.selectedYear()) : yearPage.set(yearPage() - 1)\"></div>\r\n }\r\n </div>\r\n <div class=\"pdp-month-year\">\r\n <div class=\"pdp-month pdp-select\" (click)=\"mode.set('months')\">\r\n {{month()}}\r\n </div>\r\n <div class=\"pdp-year pdp-select\" (click)=\"mode.set('years')\">\r\n {{selectedYear()}}\r\n </div>\r\n </div>\r\n <div class=\"pdp-topbar-btn-wrapper\">\r\n @if(mode() !== 'months'){\r\n <div class=\"pdp-topbar-btn pdp-topbar-btn-reverse\" (click)=\"mode() === 'days' ? changeMonth(+selectedMonth() + 1, +this.selectedYear()) : yearPage.set(yearPage() + 1)\"></div>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if(mode() === 'days'){\r\n <div class=\"pdp-weekdays\">\r\n @for(item of weekdays(); track item){\r\n <div class=\"pdp-weekday pdp-weekday-{{item}}\">\r\n {{datepickerService.getWeekdayName(item, cal)}}\r\n </div>\r\n }\r\n </div>\r\n <div class=\"pdp-days\">\r\n @for(item of monthDays(); track item.timestamp){\r\n @if(($index < 40 && !this.isCurrentMonth()) || this.isCurrentMonth()){\r\n <div class=\"pdp-day-wrapper\">\r\n <div class=\"pdp-day pdp-{{item.weekday}} pdp-{{item.gDate}} pdp-{{item.jDate}}\"\r\n [class.pdp-today]=\"today().timestamp === item.timestamp\"\r\n [class.pdp-day-pre-month]=\"(cal === 'gregorian' && +item.gMonth < +selectedMonth()) || (cal === 'jalali' && +item.jMonth < +selectedMonth())\"\r\n [class.pdp-day-next-month]=\"(cal === 'gregorian' && +item.gMonth > +selectedMonth()) || (cal === 'jalali' && +item.jMonth > +selectedMonth())\"\r\n [class.pdp-day-selected]=\"item.timestamp === selectedDate()?.timestamp\"\r\n (click)=\"onDate(item)\"\r\n >\r\n <div class=\"pdp-day-main-value\">\r\n {{cal === 'gregorian' ? item.gDay : item.jDay}}\r\n @if(secondCalendar()){\r\n <div class=\"pdp-day-second-value\">\r\n @let secondVal = +(cal === 'gregorian' ? item.jDay : item.gDay);\r\n @if(secondVal === 1 || $index == 0 || $index == 41){\r\n {{getSecondMonth((cal === 'gregorian' ? +item.jMonth : +item.gMonth)) + ' ' + secondVal}}\r\n } @else {\r\n {{secondVal}}\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n }\r\n @if(!this.isCurrentMonth()){\r\n <div class=\"pdp-today-btn-wrapper\" (click)=\"goToCurrentMonth()\">\r\n <div class=\"pdp-today-btn\">\r\n {{todayBtnText()}}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else if(mode() === 'months'){\r\n <div class=\"pdp-months\">\r\n @let months = getMonths();\r\n @for(item of months; track item.val){\r\n <div class=\"pdp-month-wrapper\">\r\n <div class=\"pdp-month-each\" [class.pdp-month-selected]=\"item.val === +selectedMonth()\" (click)=\"changeMonth(+item.val, +this.selectedYear()); mode.set('days')\">\r\n {{item.title}}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <div class=\"pdp-years\">\r\n @for(item of years(); track item){\r\n <div class=\"pdp-year-wrapper\">\r\n <div class=\"pdp-year-each\" [class.pdp-year-selected]=\"item === +selectedYear()\" (click)=\"selectYear(item)\">\r\n {{item}}\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n}\r\n","/*\n * Public API Surface of pyno-datepicker\n */\n\nexport * from './lib/pyno-datepicker';\nexport * from './lib/pyno-datepicker.service'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAMa,qBAAqB,CAAA;IACxB,cAAc,GAA4B,QAAQ;AAC1D,IAAA,IAAI,GAAG,MAAM,CAAC,eAAe,CAAC;AAC9B,IAAA,SAAS,GAA4C;AACnD,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,SAAS,EAAE,IAAI;AACf,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,QAAQ,EAAE,IAAI;KACf;AACD,IAAA,SAAS,GAA4C;AACnD,QAAA,MAAM,EAAE,GAAG;AACX,QAAA,MAAM,EAAE,GAAG;AACX,QAAA,OAAO,EAAE,GAAG;AACZ,QAAA,SAAS,EAAE,GAAG;AACd,QAAA,QAAQ,EAAE,GAAG;AACb,QAAA,MAAM,EAAE,GAAG;AACX,QAAA,QAAQ,EAAE,GAAG;KACd;AACD,IAAA,OAAO,GAA2B;AAChC,QAAA,CAAC,EAAE,SAAS;AACZ,QAAA,CAAC,EAAE,UAAU;AACb,QAAA,CAAC,EAAE,OAAO;AACV,QAAA,CAAC,EAAE,OAAO;AACV,QAAA,CAAC,EAAE,KAAK;AACR,QAAA,CAAC,EAAE,MAAM;AACT,QAAA,CAAC,EAAE,MAAM;AACT,QAAA,CAAC,EAAE,QAAQ;AACX,QAAA,CAAC,EAAE,WAAW;AACd,QAAA,EAAE,EAAE,SAAS;AACb,QAAA,EAAE,EAAE,UAAU;AACd,QAAA,EAAE,E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A,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,cAAc,4zCCrB3B,myIA+FA,EAAA,MAAA,EAAA,CAAA,ktLAAA,EAAA,EAAA,CAAA,EAAA,CAAA;;2FD1Ea,cAAc,EAAA,UAAA,EAAA,CAAA;kBAP1B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA,EAAE,YACD,iBAAiB,EAAA,QAAA,EAAA,myIAAA,EAAA,MAAA,EAAA,CAAA,ktLAAA,CAAA,EAAA;;;AEhB7B;;AAEG;;ACFH;;AAEG;;"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "pyno-datepicker",
3
+ "version": "1.0.0",
4
+ "description": "A modern, standalone Angular datepicker with Persian and Gregorian calendar support.",
5
+ "keywords": [
6
+ "angular",
7
+ "datepicker",
8
+ "jalali",
9
+ "shamsi",
10
+ "persian-date",
11
+ "gregorian",
12
+ "calendar",
13
+ "date-picker"
14
+ ],
15
+ "author": "Amir Navidfar <amirhsnf@gmail.com> (https://github.com/amirhsnf)",
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/amirhsnf/pyno-datepicker"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/your-username/pyno-datepicker/issues"
23
+ },
24
+ "peerDependencies": {
25
+ "@angular/common": "^22.0.0",
26
+ "@angular/core": "^22.0.0",
27
+ "pyno-date": "^2.0.0"
28
+ },
29
+ "dependencies": {
30
+ "tslib": "^2.3.0"
31
+ },
32
+ "sideEffects": false,
33
+ "module": "fesm2022/pyno-datepicker.mjs",
34
+ "typings": "types/pyno-datepicker.d.ts",
35
+ "exports": {
36
+ "./package.json": {
37
+ "default": "./package.json"
38
+ },
39
+ ".": {
40
+ "types": "./types/pyno-datepicker.d.ts",
41
+ "default": "./fesm2022/pyno-datepicker.mjs"
42
+ }
43
+ },
44
+ "type": "module"
45
+ }
@@ -0,0 +1,83 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { AfterViewInit, WritableSignal } from '@angular/core';
3
+ import { PynoDateService } from 'pyno-date';
4
+
5
+ type PynoDatepickerDayOfWeek = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
6
+ type PynoDatepickerDateObject = {
7
+ gYear: string;
8
+ gMonth: string;
9
+ gDay: string;
10
+ gDate: string;
11
+ jYear: string;
12
+ jMonth: string;
13
+ jDay: string;
14
+ jDate: string;
15
+ timestamp: number;
16
+ weekday: string;
17
+ };
18
+
19
+ declare class PynoDatepickerService {
20
+ private firstDayOfWeek;
21
+ date: PynoDateService;
22
+ gWeekDays: Record<PynoDatepickerDayOfWeek, string>;
23
+ jWeekDays: Record<PynoDatepickerDayOfWeek, string>;
24
+ gMonths: Record<number, string>;
25
+ jMonths: Record<number, string>;
26
+ setFirstDayOfWeek(day: PynoDatepickerDayOfWeek): void;
27
+ calcWeekdays(cal: 'gregorian' | 'jalali'): PynoDatepickerDayOfWeek[];
28
+ getWeekdayName(item: PynoDatepickerDayOfWeek, cal: 'gregorian' | 'jalali'): string;
29
+ calcDays(date: PynoDatepickerDateObject, cal: 'gregorian' | 'jalali', weekdays: PynoDatepickerDayOfWeek[]): PynoDatepickerDateObject[];
30
+ getDateObject(timestamp: number): PynoDatepickerDateObject;
31
+ setWeekdayName(calendar: 'jalali' | 'gregorian', weekday: PynoDatepickerDayOfWeek, name: string): void;
32
+ setMonthName(calendar: 'jalali' | 'gregorain', month: number, name: string): void;
33
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PynoDatepickerService, never>;
34
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
35
+ }
36
+
37
+ declare class PynoDatepicker implements AfterViewInit {
38
+ triggerFor: _angular_core.InputSignal<HTMLElement | undefined>;
39
+ inline: _angular_core.InputSignal<boolean>;
40
+ initValue: _angular_core.InputSignal<string | null | undefined>;
41
+ secondCalendar: _angular_core.InputSignal<boolean>;
42
+ today: WritableSignal<PynoDatepickerDateObject>;
43
+ selectedDate: WritableSignal<PynoDatepickerDateObject | null>;
44
+ selectedMonth: WritableSignal<string>;
45
+ selectedYear: WritableSignal<string>;
46
+ isOpen: WritableSignal<boolean>;
47
+ calendar: _angular_core.InputSignal<"gregorian" | "jalali">;
48
+ format: _angular_core.InputSignal<string>;
49
+ weekdays: WritableSignal<PynoDatepickerDayOfWeek[]>;
50
+ monthDays: WritableSignal<PynoDatepickerDateObject[]>;
51
+ outputAs: _angular_core.InputSignal<"string" | "object">;
52
+ onInit: _angular_core.OutputEmitterRef<string | PynoDatepickerDateObject | null>;
53
+ onSelect: _angular_core.OutputEmitterRef<string | PynoDatepickerDateObject>;
54
+ todayBtnText: _angular_core.InputSignal<string>;
55
+ mode: WritableSignal<"days" | "months" | "years">;
56
+ yearPage: WritableSignal<number>;
57
+ month: _angular_core.Signal<string>;
58
+ isCurrentMonth: _angular_core.Signal<boolean>;
59
+ datepickerService: PynoDatepickerService;
60
+ dateService: PynoDateService;
61
+ disableToday: _angular_core.InputSignal<boolean>;
62
+ ngOnInit(): void;
63
+ init(): void;
64
+ private handleInitValue;
65
+ ngAfterViewInit(): void;
66
+ open(): void;
67
+ close(): void;
68
+ onDate(item: PynoDatepickerDateObject): void;
69
+ changeMonth(month: number, year: number): void;
70
+ getSecondMonth(number: number): string;
71
+ output(): PynoDatepickerDateObject | string | null;
72
+ protected goToCurrentMonth(): void;
73
+ getMonths(): {
74
+ title: string;
75
+ val: number;
76
+ }[];
77
+ years: _angular_core.Signal<number[]>;
78
+ protected selectYear(item: number): void;
79
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PynoDatepicker, never>;
80
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PynoDatepicker, "pyno-datepicker", never, { "triggerFor": { "alias": "triggerFor"; "required": false; "isSignal": true; }; "inline": { "alias": "inline"; "required": false; "isSignal": true; }; "initValue": { "alias": "initValue"; "required": false; "isSignal": true; }; "secondCalendar": { "alias": "secondCalendar"; "required": false; "isSignal": true; }; "calendar": { "alias": "calendar"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "outputAs": { "alias": "outputAs"; "required": false; "isSignal": true; }; "todayBtnText": { "alias": "todayBtnText"; "required": false; "isSignal": true; }; "disableToday": { "alias": "disableToday"; "required": false; "isSignal": true; }; }, { "onInit": "onInit"; "onSelect": "onSelect"; }, never, never, true, never>;
81
+ }
82
+
83
+ export { PynoDatepicker, PynoDatepickerService };