@yoozsoft/yoozsoft-ng 5.3.5 → 7.1.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.
- package/README.md +143 -24
- package/assets/js/UTIF.js-master/LICENSE +21 -21
- package/assets/js/UTIF.js-master/README.md +72 -72
- package/assets/js/UTIF.js-master/UTIF.js +1762 -1762
- package/assets/js/UTIF.js-master/package-lock.json +13 -13
- package/assets/js/UTIF.js-master/package.json +24 -0
- package/assets/styles/components/_ys-navbar.scss +22 -0
- package/assets/styles/components/_ys-pagination.scss +10 -0
- package/assets/styles/{ys-layout.scss → utilities/ys-layout.scss} +1 -1
- package/assets/styles/ys-styles.scss +2 -0
- package/autocomplete/package.json +4 -0
- package/date/package.json +4 -0
- package/datepicker/package.json +4 -0
- package/dropdown/package.json +4 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-autocomplete.mjs +257 -197
- package/fesm2022/yoozsoft-yoozsoft-ng-autocomplete.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-date.mjs +562 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-date.mjs.map +1 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-datepicker.mjs +600 -837
- package/fesm2022/yoozsoft-yoozsoft-ng-datepicker.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-dropdown.mjs +161 -151
- package/fesm2022/yoozsoft-yoozsoft-ng-dropdown.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-file-upload.mjs +93 -103
- package/fesm2022/yoozsoft-yoozsoft-ng-file-upload.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-footer.mjs +16 -21
- package/fesm2022/yoozsoft-yoozsoft-ng-footer.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-loading.mjs +20 -24
- package/fesm2022/yoozsoft-yoozsoft-ng-loading.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-navbar.mjs +60 -76
- package/fesm2022/yoozsoft-yoozsoft-ng-navbar.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-overlay.mjs +11 -15
- package/fesm2022/yoozsoft-yoozsoft-ng-overlay.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-pagination.mjs +61 -55
- package/fesm2022/yoozsoft-yoozsoft-ng-pagination.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-password-strength.mjs +142 -130
- package/fesm2022/yoozsoft-yoozsoft-ng-password-strength.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-pipes.mjs +44 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-pipes.mjs.map +1 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-progress.mjs +51 -34
- package/fesm2022/yoozsoft-yoozsoft-ng-progress.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-rating.mjs +155 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-rating.mjs.map +1 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-select.mjs +78 -80
- package/fesm2022/yoozsoft-yoozsoft-ng-select.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-sidebar.mjs +99 -99
- package/fesm2022/yoozsoft-yoozsoft-ng-sidebar.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-table.mjs +316 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-table.mjs.map +1 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-tiff-viewer.mjs +128 -114
- package/fesm2022/yoozsoft-yoozsoft-ng-tiff-viewer.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-toast.mjs +112 -62
- package/fesm2022/yoozsoft-yoozsoft-ng-toast.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-validators.mjs +37 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-validators.mjs.map +1 -0
- package/fesm2022/yoozsoft-yoozsoft-ng.mjs.map +1 -1
- package/file-upload/package.json +4 -0
- package/footer/package.json +4 -0
- package/loading/package.json +4 -0
- package/navbar/package.json +4 -0
- package/overlay/package.json +4 -0
- package/package.json +61 -38
- package/pagination/package.json +4 -0
- package/password-strength/package.json +4 -0
- package/pipes/package.json +4 -0
- package/progress/package.json +4 -0
- package/rating/package.json +4 -0
- package/select/package.json +4 -0
- package/sidebar/package.json +4 -0
- package/table/package.json +4 -0
- package/tiff-viewer/package.json +4 -0
- package/toast/package.json +4 -0
- package/types/yoozsoft-yoozsoft-ng-autocomplete.d.ts +79 -0
- package/types/yoozsoft-yoozsoft-ng-date.d.ts +118 -0
- package/types/yoozsoft-yoozsoft-ng-datepicker.d.ts +120 -0
- package/types/yoozsoft-yoozsoft-ng-dropdown.d.ts +76 -0
- package/types/yoozsoft-yoozsoft-ng-file-upload.d.ts +75 -0
- package/types/yoozsoft-yoozsoft-ng-footer.d.ts +26 -0
- package/types/yoozsoft-yoozsoft-ng-loading.d.ts +14 -0
- package/types/yoozsoft-yoozsoft-ng-navbar.d.ts +60 -0
- package/types/yoozsoft-yoozsoft-ng-overlay.d.ts +10 -0
- package/types/yoozsoft-yoozsoft-ng-pagination.d.ts +31 -0
- package/types/yoozsoft-yoozsoft-ng-password-strength.d.ts +73 -0
- package/types/yoozsoft-yoozsoft-ng-pipes.d.ts +11 -0
- package/types/yoozsoft-yoozsoft-ng-progress.d.ts +31 -0
- package/types/yoozsoft-yoozsoft-ng-rating.d.ts +56 -0
- package/types/yoozsoft-yoozsoft-ng-select.d.ts +43 -0
- package/types/yoozsoft-yoozsoft-ng-sidebar.d.ts +69 -0
- package/types/yoozsoft-yoozsoft-ng-table.d.ts +137 -0
- package/types/yoozsoft-yoozsoft-ng-tiff-viewer.d.ts +53 -0
- package/types/yoozsoft-yoozsoft-ng-toast.d.ts +66 -0
- package/types/yoozsoft-yoozsoft-ng-validators.d.ts +5 -0
- package/validators/package.json +4 -0
- package/autocomplete/index.d.ts +0 -71
- package/datepicker/index.d.ts +0 -291
- package/directives/index.d.ts +0 -17
- package/dropdown/index.d.ts +0 -62
- package/fesm2022/yoozsoft-yoozsoft-ng-directives.mjs +0 -57
- package/fesm2022/yoozsoft-yoozsoft-ng-directives.mjs.map +0 -1
- package/file-upload/index.d.ts +0 -72
- package/footer/index.d.ts +0 -25
- package/loading/index.d.ts +0 -13
- package/navbar/index.d.ts +0 -56
- package/overlay/index.d.ts +0 -11
- package/pagination/index.d.ts +0 -29
- package/password-strength/index.d.ts +0 -84
- package/progress/index.d.ts +0 -28
- package/select/index.d.ts +0 -39
- package/sidebar/index.d.ts +0 -94
- package/tiff-viewer/index.d.ts +0 -52
- package/toast/index.d.ts +0 -53
- /package/assets/styles/{ys-preloader-9.scss → preloaders/ys-preloader-9.scss} +0 -0
- /package/assets/styles/{ys-preloader.scss → preloaders/ys-preloader.scss} +0 -0
- /package/{index.d.ts → types/yoozsoft-yoozsoft-ng.d.ts} +0 -0
|
@@ -1,446 +1,380 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import * as i2 from '@
|
|
4
|
-
import { NgbDateParserFormatter, NgbDatepickerI18n, NgbCalendar, NgbDatepickerModule, NgbCalendarPersian, NgbDate } from '@ng-bootstrap/ng-bootstrap';
|
|
5
|
-
import * as i3 from '@angular/forms';
|
|
2
|
+
import { input, output, signal, effect, ChangeDetectionStrategy, Component, Injectable, inject, computed, forwardRef } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/forms';
|
|
6
4
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import * as i1 from '@ng-bootstrap/ng-bootstrap';
|
|
6
|
+
import { NgbDatepickerModule, NgbDatepickerI18n, NgbCalendar, NgbCalendarPersian, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
7
|
+
import { YsPersianDatePipe } from '@yoozsoft/yoozsoft-ng/pipes';
|
|
8
|
+
import { PERSIAN_WEEKDAYS_SHORT, PERSIAN_MONTHS, JalaliDate, compareDates } from '@yoozsoft/yoozsoft-ng/date';
|
|
7
9
|
|
|
8
|
-
class
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
10
|
+
class YsDatepickerGregorian {
|
|
11
|
+
value = input(null, /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
13
|
+
disabled = input(false, /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
15
|
+
firstDayOfWeek = input(1, /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
17
|
+
weekend = input([6, 7], /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "weekend" }] : /* istanbul ignore next */ []));
|
|
19
|
+
showFooter = input(true, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "showFooter" }] : /* istanbul ignore next */ []));
|
|
21
|
+
todayLabel = input('Today', /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "todayLabel" }] : /* istanbul ignore next */ []));
|
|
23
|
+
outsideDays = input('visible', /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "outsideDays" }] : /* istanbul ignore next */ []));
|
|
25
|
+
displayMonths = input(1, /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "displayMonths" }] : /* istanbul ignore next */ []));
|
|
27
|
+
valueChange = output();
|
|
28
|
+
model = signal(null, /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
30
|
+
/*------------Range fields */
|
|
31
|
+
rangeMode = input(false, /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "rangeMode" }] : /* istanbul ignore next */ []));
|
|
33
|
+
fromDate = input(null, /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "fromDate" }] : /* istanbul ignore next */ []));
|
|
35
|
+
toDate = input(null, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "toDate" }] : /* istanbul ignore next */ []));
|
|
37
|
+
hoveredDate = input(null, /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "hoveredDate" }] : /* istanbul ignore next */ []));
|
|
39
|
+
dateSelect = output();
|
|
40
|
+
dateHover = output();
|
|
41
|
+
/*------------Range fields */
|
|
42
|
+
constructor() {
|
|
43
|
+
effect(() => {
|
|
44
|
+
const value = this.value();
|
|
45
|
+
if (!value) {
|
|
46
|
+
this.model.set(null);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.model.set({
|
|
50
|
+
year: value.getFullYear(),
|
|
51
|
+
month: value.getMonth() + 1,
|
|
52
|
+
day: value.getDate()
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
valueChanged(date) {
|
|
57
|
+
this.model.set(date);
|
|
58
|
+
if (!date) {
|
|
59
|
+
this.valueChange.emit(null);
|
|
60
|
+
return;
|
|
47
61
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
this.valueChange.emit(new Date(date.year, date.month - 1, date.day));
|
|
63
|
+
}
|
|
64
|
+
setToday(dp) {
|
|
65
|
+
const today = new Date();
|
|
66
|
+
const model = {
|
|
67
|
+
year: today.getFullYear(),
|
|
68
|
+
month: today.getMonth() + 1,
|
|
69
|
+
day: today.getDate()
|
|
70
|
+
};
|
|
71
|
+
this.model.set(model);
|
|
72
|
+
this.valueChange.emit(today);
|
|
73
|
+
dp.navigateTo({
|
|
74
|
+
year: model.year,
|
|
75
|
+
month: model.month
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
isWeekend(date) {
|
|
79
|
+
const day = new Date(date.year, date.month - 1, date.day).getDay();
|
|
80
|
+
const weekday = day === 0
|
|
81
|
+
? 7
|
|
82
|
+
: day;
|
|
83
|
+
return this.weekend().includes(weekday);
|
|
84
|
+
}
|
|
85
|
+
/*------------Range helpers */
|
|
86
|
+
compare(a, b) {
|
|
87
|
+
if (a.year !== b.year) {
|
|
88
|
+
return a.year - b.year;
|
|
75
89
|
}
|
|
76
|
-
|
|
77
|
-
|
|
90
|
+
if (a.month !== b.month) {
|
|
91
|
+
return a.month - b.month;
|
|
78
92
|
}
|
|
79
|
-
|
|
80
|
-
var jd = j_day_no + 1;
|
|
81
|
-
return [jy, jm, jd];
|
|
93
|
+
return a.day - b.day;
|
|
82
94
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
month: parseInt(date[1], 10),
|
|
93
|
-
year: parseInt(date[2], 10),
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
return null;
|
|
95
|
+
isHovered(date) {
|
|
96
|
+
const hovered = this.hoveredDate();
|
|
97
|
+
const from = this.fromDate();
|
|
98
|
+
const to = this.toDate();
|
|
99
|
+
return !!(from &&
|
|
100
|
+
!to &&
|
|
101
|
+
hovered &&
|
|
102
|
+
this.compare(date, from) > 0 &&
|
|
103
|
+
this.compare(date, hovered) < 0);
|
|
97
104
|
}
|
|
98
|
-
|
|
99
|
-
|
|
105
|
+
isInside(date) {
|
|
106
|
+
const from = this.fromDate();
|
|
107
|
+
const to = this.toDate();
|
|
108
|
+
return !!(from &&
|
|
109
|
+
to &&
|
|
110
|
+
this.compare(date, from) > 0 &&
|
|
111
|
+
this.compare(date, to) < 0);
|
|
100
112
|
}
|
|
101
|
-
|
|
102
|
-
|
|
113
|
+
isRange(date) {
|
|
114
|
+
const from = this.fromDate();
|
|
115
|
+
const to = this.toDate();
|
|
116
|
+
return !!((from &&
|
|
117
|
+
date.year === from.year &&
|
|
118
|
+
date.month === from.month &&
|
|
119
|
+
date.day === from.day)
|
|
120
|
+
||
|
|
121
|
+
(to &&
|
|
122
|
+
date.year === to.year &&
|
|
123
|
+
date.month === to.month &&
|
|
124
|
+
date.day === to.day)
|
|
125
|
+
||
|
|
126
|
+
this.isInside(date)
|
|
127
|
+
||
|
|
128
|
+
this.isHovered(date));
|
|
129
|
+
}
|
|
130
|
+
isStart(date) {
|
|
131
|
+
const from = this.fromDate();
|
|
132
|
+
return !!(from &&
|
|
133
|
+
date.year === from.year &&
|
|
134
|
+
date.month === from.month &&
|
|
135
|
+
date.day === from.day);
|
|
136
|
+
}
|
|
137
|
+
isEnd(date) {
|
|
138
|
+
const to = this.toDate();
|
|
139
|
+
return !!(to &&
|
|
140
|
+
date.year === to.year &&
|
|
141
|
+
date.month === to.month &&
|
|
142
|
+
date.day === to.day);
|
|
143
|
+
}
|
|
144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepickerGregorian, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
145
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: YsDatepickerGregorian, isStandalone: true, selector: "ys-datepicker-gregorian", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, weekend: { classPropertyName: "weekend", publicName: "weekend", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, outsideDays: { classPropertyName: "outsideDays", publicName: "outsideDays", isSignal: true, isRequired: false, transformFunction: null }, displayMonths: { classPropertyName: "displayMonths", publicName: "displayMonths", isSignal: true, isRequired: false, transformFunction: null }, rangeMode: { classPropertyName: "rangeMode", publicName: "rangeMode", isSignal: true, isRequired: false, transformFunction: null }, fromDate: { classPropertyName: "fromDate", publicName: "fromDate", isSignal: true, isRequired: false, transformFunction: null }, toDate: { classPropertyName: "toDate", publicName: "toDate", isSignal: true, isRequired: false, transformFunction: null }, hoveredDate: { classPropertyName: "hoveredDate", publicName: "hoveredDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", dateSelect: "dateSelect", dateHover: "dateHover" }, ngImport: i0, template: "<ngb-datepicker #dp [navigation]=\"'select'\" [firstDayOfWeek]=\"firstDayOfWeek()\" [disabled]=\"disabled()\"\n [dayTemplate]=\"dayTemplate\" [footerTemplate]=\"footerTemplate\" [ngModel]=\"model()\"\n (ngModelChange)=\"valueChanged($event)\" [outsideDays]=\"outsideDays()\" [displayMonths]=\"displayMonths()\">\n</ngb-datepicker>\n\n<ng-template #dayTemplate let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-focused=\"focused\">\n\n <span class=\"ys-day\" [class.ys-selected]=\"selected\" [class.ys-focused]=\"focused\"\n [class.ys-weekend]=\"isWeekend(date)\" [class.ys-hidden]=\"date.month !== currentMonth\"\n [class.text-muted]=\"date.month !== currentMonth\" [class.ys-range]=\"rangeMode() && isRange(date)\"\n [class.ys-range-start]=\"rangeMode() && isStart(date)\" [class.ys-range-end]=\"rangeMode() && isEnd(date)\"\n (click)=\"dateSelect.emit(date)\" (mouseenter)=\"dateHover.emit(date)\">\n\n {{ date.day }}\n\n </span>\n\n</ng-template>\n\n<ng-template #footerTemplate>\n @if(showFooter()) {\n <div class=\"ys-datepicker-footer border-top\">\n\n <button type=\"button\" class=\"btn btn-sm btn-primary float-start mb-2\" [disabled]=\"disabled()\"\n (click)=\"setToday(dp)\">\n\n {{ todayLabel() }}\n\n </button>\n\n </div>\n }\n</ng-template>", styles: [".ys-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.ys-day:hover,.ys-focused{background:var(--bs-secondary-bg)}.ys-selected{background:var(--bs-primary);color:var(--bs-white)}.ys-selected.ys-day:hover{color:var(--bs-body-color)}.ys-weekend{color:var(--bs-danger)}.ys-hidden{opacity:.5}.ys-datepicker-footer{padding:.5rem}.ys-range{background-color:var(--bs-primary-bg-subtle);border-radius:0}.ys-range-start,.ys-range-end{background-color:var(--bs-primary);color:var(--bs-white)}.ys-range-start{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.ys-range-end{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.ys-range-start.ys-day:hover,.ys-range-end.ys-day:hover{color:var(--bs-body-color)}\n"], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "component", type: i1.NgbDatepicker, selector: "ngb-datepicker", inputs: ["contentTemplate", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "maxDate", "minDate", "navigation", "outsideDays", "showWeekNumbers", "startDate", "weekdays"], outputs: ["navigate", "dateSelect"], exportAs: ["ngbDatepicker"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
103
146
|
}
|
|
104
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
105
|
-
type:
|
|
106
|
-
args: [{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}] });
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepickerGregorian, decorators: [{
|
|
148
|
+
type: Component,
|
|
149
|
+
args: [{ selector: 'ys-datepicker-gregorian', imports: [
|
|
150
|
+
NgbDatepickerModule,
|
|
151
|
+
FormsModule
|
|
152
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ngb-datepicker #dp [navigation]=\"'select'\" [firstDayOfWeek]=\"firstDayOfWeek()\" [disabled]=\"disabled()\"\n [dayTemplate]=\"dayTemplate\" [footerTemplate]=\"footerTemplate\" [ngModel]=\"model()\"\n (ngModelChange)=\"valueChanged($event)\" [outsideDays]=\"outsideDays()\" [displayMonths]=\"displayMonths()\">\n</ngb-datepicker>\n\n<ng-template #dayTemplate let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-focused=\"focused\">\n\n <span class=\"ys-day\" [class.ys-selected]=\"selected\" [class.ys-focused]=\"focused\"\n [class.ys-weekend]=\"isWeekend(date)\" [class.ys-hidden]=\"date.month !== currentMonth\"\n [class.text-muted]=\"date.month !== currentMonth\" [class.ys-range]=\"rangeMode() && isRange(date)\"\n [class.ys-range-start]=\"rangeMode() && isStart(date)\" [class.ys-range-end]=\"rangeMode() && isEnd(date)\"\n (click)=\"dateSelect.emit(date)\" (mouseenter)=\"dateHover.emit(date)\">\n\n {{ date.day }}\n\n </span>\n\n</ng-template>\n\n<ng-template #footerTemplate>\n @if(showFooter()) {\n <div class=\"ys-datepicker-footer border-top\">\n\n <button type=\"button\" class=\"btn btn-sm btn-primary float-start mb-2\" [disabled]=\"disabled()\"\n (click)=\"setToday(dp)\">\n\n {{ todayLabel() }}\n\n </button>\n\n </div>\n }\n</ng-template>", styles: [".ys-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.ys-day:hover,.ys-focused{background:var(--bs-secondary-bg)}.ys-selected{background:var(--bs-primary);color:var(--bs-white)}.ys-selected.ys-day:hover{color:var(--bs-body-color)}.ys-weekend{color:var(--bs-danger)}.ys-hidden{opacity:.5}.ys-datepicker-footer{padding:.5rem}.ys-range{background-color:var(--bs-primary-bg-subtle);border-radius:0}.ys-range-start,.ys-range-end{background-color:var(--bs-primary);color:var(--bs-white)}.ys-range-start{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.ys-range-end{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.ys-range-start.ys-day:hover,.ys-range-end.ys-day:hover{color:var(--bs-body-color)}\n"] }]
|
|
153
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], weekend: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekend", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], outsideDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "outsideDays", required: false }] }], displayMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMonths", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], rangeMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeMode", required: false }] }], fromDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "fromDate", required: false }] }], toDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "toDate", required: false }] }], hoveredDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoveredDate", required: false }] }], dateSelect: [{ type: i0.Output, args: ["dateSelect"] }], dateHover: [{ type: i0.Output, args: ["dateHover"] }] } });
|
|
110
154
|
|
|
111
|
-
|
|
112
|
-
(function (LanguageType) {
|
|
113
|
-
LanguageType[LanguageType["en"] = 0] = "en";
|
|
114
|
-
LanguageType[LanguageType["fa"] = 1] = "fa";
|
|
115
|
-
LanguageType[LanguageType["fr"] = 2] = "fr";
|
|
116
|
-
})(LanguageType || (LanguageType = {}));
|
|
117
|
-
const I18N_VALUES = {
|
|
118
|
-
"en": {
|
|
119
|
-
weekdays: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
|
|
120
|
-
months: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
121
|
-
weekLabel: 'week'
|
|
122
|
-
},
|
|
123
|
-
"fa": {
|
|
124
|
-
weekdays: ['د', 'س', 'چ', 'پ', 'ج', 'ش', 'ی'],
|
|
125
|
-
months: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'],
|
|
126
|
-
weekLabel: 'هفته'
|
|
127
|
-
},
|
|
128
|
-
"fr": {
|
|
129
|
-
weekdays: ['Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa', 'Di'],
|
|
130
|
-
months: ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Aou', 'Sep', 'Oct', 'Nov', 'Déc'],
|
|
131
|
-
weekLabel: 'sem'
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
class I18n {
|
|
135
|
-
language = LanguageType[LanguageType.en];
|
|
136
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: I18n, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
137
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: I18n });
|
|
138
|
-
}
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: I18n, decorators: [{
|
|
140
|
-
type: Injectable
|
|
141
|
-
}] });
|
|
142
|
-
class YsDatepickerI18nService extends NgbDatepickerI18n {
|
|
143
|
-
_i18n = inject(I18n);
|
|
144
|
-
constructor() {
|
|
145
|
-
super();
|
|
146
|
-
}
|
|
155
|
+
class YsPersianDatepickerI18n extends NgbDatepickerI18n {
|
|
147
156
|
getWeekdayLabel(weekday) {
|
|
148
|
-
return
|
|
149
|
-
}
|
|
150
|
-
getWeekLabel() {
|
|
151
|
-
return I18N_VALUES[this._i18n.language].weekLabel;
|
|
157
|
+
return PERSIAN_WEEKDAYS_SHORT[weekday - 1];
|
|
152
158
|
}
|
|
153
159
|
getMonthShortName(month) {
|
|
154
|
-
return
|
|
160
|
+
return PERSIAN_MONTHS[month - 1];
|
|
155
161
|
}
|
|
156
162
|
getMonthFullName(month) {
|
|
157
|
-
return
|
|
163
|
+
return PERSIAN_MONTHS[month - 1];
|
|
158
164
|
}
|
|
159
165
|
getDayAriaLabel(date) {
|
|
160
|
-
return `${date.
|
|
166
|
+
return `${date.year}/${date.month}/${date.day}`;
|
|
161
167
|
}
|
|
162
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
163
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
168
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsPersianDatepickerI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
169
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsPersianDatepickerI18n });
|
|
164
170
|
}
|
|
165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
166
|
-
type: Injectable
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}]
|
|
170
|
-
}], ctorParameters: () => [] });
|
|
171
|
-
|
|
172
|
-
class YsDatepickerComponent {
|
|
173
|
-
i18N;
|
|
171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsPersianDatepickerI18n, decorators: [{
|
|
172
|
+
type: Injectable
|
|
173
|
+
}] });
|
|
174
|
+
class YsDatepickerJalali {
|
|
174
175
|
calendar = inject(NgbCalendar);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
registerOnTouched(fn) {
|
|
214
|
-
this.onTouched = fn;
|
|
215
|
-
}
|
|
216
|
-
setDisabledState(isDisabled) {
|
|
217
|
-
this.disabled = isDisabled;
|
|
218
|
-
}
|
|
219
|
-
markDisabled = (date, current) => date.month !== current?.month;
|
|
220
|
-
isWeekend = (date) => this.weekend.includes(this.calendar.getWeekday(date));
|
|
221
|
-
valueChanged(newDate) {
|
|
222
|
-
if (newDate) {
|
|
223
|
-
if (typeof newDate == 'string') {
|
|
224
|
-
let temp = newDate.split('/');
|
|
225
|
-
let res = new Date(+temp[0], (+temp[1]) - 1, +temp[2]);
|
|
226
|
-
this.onChange(res);
|
|
227
|
-
this.onTouched(res);
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
let res = new Date(newDate.year, newDate.month - 1, newDate.day);
|
|
231
|
-
this.onChange(res);
|
|
232
|
-
this.onTouched(res);
|
|
176
|
+
value = input(null, /* @ts-ignore */
|
|
177
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
178
|
+
disabled = input(false, /* @ts-ignore */
|
|
179
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
180
|
+
firstDayOfWeek = input(6, /* @ts-ignore */
|
|
181
|
+
...(ngDevMode ? [{ debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
182
|
+
weekend = input([5], /* @ts-ignore */
|
|
183
|
+
...(ngDevMode ? [{ debugName: "weekend" }] : /* istanbul ignore next */ []));
|
|
184
|
+
showFooter = input(true, /* @ts-ignore */
|
|
185
|
+
...(ngDevMode ? [{ debugName: "showFooter" }] : /* istanbul ignore next */ []));
|
|
186
|
+
todayLabel = input('امروز', /* @ts-ignore */
|
|
187
|
+
...(ngDevMode ? [{ debugName: "todayLabel" }] : /* istanbul ignore next */ []));
|
|
188
|
+
outsideDays = input('visible', /* @ts-ignore */
|
|
189
|
+
...(ngDevMode ? [{ debugName: "outsideDays" }] : /* istanbul ignore next */ []));
|
|
190
|
+
displayMonths = input(1, /* @ts-ignore */
|
|
191
|
+
...(ngDevMode ? [{ debugName: "displayMonths" }] : /* istanbul ignore next */ []));
|
|
192
|
+
valueChange = output();
|
|
193
|
+
model = signal(null, /* @ts-ignore */
|
|
194
|
+
...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
|
|
195
|
+
/*------------Range fields */
|
|
196
|
+
rangeMode = input(false, /* @ts-ignore */
|
|
197
|
+
...(ngDevMode ? [{ debugName: "rangeMode" }] : /* istanbul ignore next */ []));
|
|
198
|
+
fromDate = input(null, /* @ts-ignore */
|
|
199
|
+
...(ngDevMode ? [{ debugName: "fromDate" }] : /* istanbul ignore next */ []));
|
|
200
|
+
toDate = input(null, /* @ts-ignore */
|
|
201
|
+
...(ngDevMode ? [{ debugName: "toDate" }] : /* istanbul ignore next */ []));
|
|
202
|
+
hoveredDate = input(null, /* @ts-ignore */
|
|
203
|
+
...(ngDevMode ? [{ debugName: "hoveredDate" }] : /* istanbul ignore next */ []));
|
|
204
|
+
dateSelect = output();
|
|
205
|
+
dateHover = output();
|
|
206
|
+
/*------------Range fields */
|
|
207
|
+
constructor() {
|
|
208
|
+
effect(() => {
|
|
209
|
+
const value = this.value();
|
|
210
|
+
if (!value) {
|
|
211
|
+
this.model.set(null);
|
|
212
|
+
return;
|
|
233
213
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
{
|
|
247
|
-
provide: NG_VALUE_ACCESSOR,
|
|
248
|
-
useExisting: forwardRef(() => YsDatepickerComponent),
|
|
249
|
-
multi: true
|
|
250
|
-
},
|
|
251
|
-
I18n,
|
|
252
|
-
{ provide: NgbDatepickerI18n, useClass: YsDatepickerI18nService },
|
|
253
|
-
{ provide: NgbDateParserFormatter, useClass: YsDateParserFormatterService }
|
|
254
|
-
], ngImport: i0, template: "<ngb-datepicker #dp [(ngModel)]=\"value\" [firstDayOfWeek]=\"firstDayOfWeek\" [dayTemplate]=\"customDay\"\r\n [footerTemplate]=\"footerTemplate\" placeholder=\"yyyy/mm/dd\" [disabled]=\"disabled\"\r\n (ngModelChange)=\"valueChanged(value)\" />\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\" [class.bg-info]=\"selected\"\r\n [class.text-white]=\"selected\" [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"dp.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.custom-day:hover,.custom-day.focused{background-color:var(--bs-gray-300)}.hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "component", type: i2.NgbDatepicker, selector: "ngb-datepicker", inputs: ["contentTemplate", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "maxDate", "minDate", "navigation", "outsideDays", "showWeekNumbers", "startDate", "weekdays"], outputs: ["navigate", "dateSelect"], exportAs: ["ngbDatepicker"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
255
|
-
}
|
|
256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: YsDatepickerComponent, decorators: [{
|
|
257
|
-
type: Component,
|
|
258
|
-
args: [{ selector: 'ys-datepicker', imports: [NgbDatepickerModule, FormsModule], providers: [
|
|
259
|
-
{
|
|
260
|
-
provide: NG_VALUE_ACCESSOR,
|
|
261
|
-
useExisting: forwardRef(() => YsDatepickerComponent),
|
|
262
|
-
multi: true
|
|
263
|
-
},
|
|
264
|
-
I18n,
|
|
265
|
-
{ provide: NgbDatepickerI18n, useClass: YsDatepickerI18nService },
|
|
266
|
-
{ provide: NgbDateParserFormatter, useClass: YsDateParserFormatterService }
|
|
267
|
-
], template: "<ngb-datepicker #dp [(ngModel)]=\"value\" [firstDayOfWeek]=\"firstDayOfWeek\" [dayTemplate]=\"customDay\"\r\n [footerTemplate]=\"footerTemplate\" placeholder=\"yyyy/mm/dd\" [disabled]=\"disabled\"\r\n (ngModelChange)=\"valueChanged(value)\" />\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\" [class.bg-info]=\"selected\"\r\n [class.text-white]=\"selected\" [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"dp.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.custom-day:hover,.custom-day.focused{background-color:var(--bs-gray-300)}.hidden{display:none}\n"] }]
|
|
268
|
-
}], ctorParameters: () => [{ type: I18n }], propDecorators: { firstDayOfWeek: [{
|
|
269
|
-
type: Input
|
|
270
|
-
}], weekend: [{
|
|
271
|
-
type: Input
|
|
272
|
-
}], language: [{
|
|
273
|
-
type: Input
|
|
274
|
-
}], isFooter: [{
|
|
275
|
-
type: Input
|
|
276
|
-
}], todayLabel: [{
|
|
277
|
-
type: Input
|
|
278
|
-
}], footer: [{
|
|
279
|
-
type: Input
|
|
280
|
-
}], disabled: [{
|
|
281
|
-
type: Input
|
|
282
|
-
}] } });
|
|
283
|
-
|
|
284
|
-
class YsDatepickerPersianComponent {
|
|
285
|
-
i18N;
|
|
286
|
-
calendar = inject(NgbCalendar);
|
|
287
|
-
today = inject(NgbCalendar).getToday();
|
|
288
|
-
firstDayOfWeek = 6;
|
|
289
|
-
weekend = [5];
|
|
290
|
-
_language = LanguageType[LanguageType.fa];
|
|
291
|
-
get language() {
|
|
292
|
-
return this._language;
|
|
293
|
-
}
|
|
294
|
-
set language(value) {
|
|
295
|
-
this._language = value;
|
|
296
|
-
this.i18N.language = this._language;
|
|
297
|
-
}
|
|
298
|
-
isFooter = true;
|
|
299
|
-
todayLabel = "امروز";
|
|
300
|
-
footer = null;
|
|
301
|
-
_value = null;
|
|
302
|
-
get value() {
|
|
303
|
-
return this._value;
|
|
304
|
-
}
|
|
305
|
-
set value(val) {
|
|
306
|
-
this._value = val;
|
|
307
|
-
}
|
|
308
|
-
disabled = false;
|
|
309
|
-
onChange = () => { };
|
|
310
|
-
onTouched = () => { };
|
|
311
|
-
constructor(i18N) {
|
|
312
|
-
this.i18N = i18N;
|
|
313
|
-
this.language = LanguageType[LanguageType.fa];
|
|
314
|
-
}
|
|
315
|
-
writeValue(obj) {
|
|
316
|
-
if (!obj) {
|
|
317
|
-
this.value = null;
|
|
214
|
+
const jalali = JalaliDate.fromDate(value);
|
|
215
|
+
this.model.set({
|
|
216
|
+
year: jalali.year,
|
|
217
|
+
month: jalali.month,
|
|
218
|
+
day: jalali.day
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
valueChanged(date) {
|
|
223
|
+
this.model.set(date);
|
|
224
|
+
if (!date) {
|
|
225
|
+
this.valueChange.emit(null);
|
|
318
226
|
return;
|
|
319
227
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
this.
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
this.onChange(res);
|
|
348
|
-
this.onTouched(res);
|
|
349
|
-
}
|
|
228
|
+
const gregorian = JalaliDate.toDate({
|
|
229
|
+
year: date.year,
|
|
230
|
+
month: date.month,
|
|
231
|
+
day: date.day
|
|
232
|
+
});
|
|
233
|
+
this.valueChange.emit(gregorian);
|
|
234
|
+
}
|
|
235
|
+
setToday(dp) {
|
|
236
|
+
const today = this.calendar.getToday();
|
|
237
|
+
this.model.set(today);
|
|
238
|
+
this.valueChange.emit(JalaliDate.toDate({
|
|
239
|
+
year: today.year,
|
|
240
|
+
month: today.month,
|
|
241
|
+
day: today.day
|
|
242
|
+
}));
|
|
243
|
+
dp.navigateTo({
|
|
244
|
+
year: today.year,
|
|
245
|
+
month: today.month
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
isWeekend(date) {
|
|
249
|
+
return this.weekend().includes(JalaliDate.dayOfWeek(date.year, date.month, date.day));
|
|
250
|
+
}
|
|
251
|
+
/*------------Range helpers */
|
|
252
|
+
compare(a, b) {
|
|
253
|
+
if (a.year !== b.year) {
|
|
254
|
+
return a.year - b.year;
|
|
350
255
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
this.onTouched(null);
|
|
256
|
+
if (a.month !== b.month) {
|
|
257
|
+
return a.month - b.month;
|
|
354
258
|
}
|
|
259
|
+
return a.day - b.day;
|
|
355
260
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
this.
|
|
261
|
+
isHovered(date) {
|
|
262
|
+
const hovered = this.hoveredDate();
|
|
263
|
+
const from = this.fromDate();
|
|
264
|
+
const to = this.toDate();
|
|
265
|
+
return !!(from &&
|
|
266
|
+
!to &&
|
|
267
|
+
hovered &&
|
|
268
|
+
this.compare(date, from) > 0 &&
|
|
269
|
+
this.compare(date, hovered) < 0);
|
|
359
270
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
271
|
+
isInside(date) {
|
|
272
|
+
const from = this.fromDate();
|
|
273
|
+
const to = this.toDate();
|
|
274
|
+
return !!(from &&
|
|
275
|
+
to &&
|
|
276
|
+
this.compare(date, from) > 0 &&
|
|
277
|
+
this.compare(date, to) < 0);
|
|
278
|
+
}
|
|
279
|
+
isRange(date) {
|
|
280
|
+
const from = this.fromDate();
|
|
281
|
+
const to = this.toDate();
|
|
282
|
+
return !!((from &&
|
|
283
|
+
date.year === from.year &&
|
|
284
|
+
date.month === from.month &&
|
|
285
|
+
date.day === from.day)
|
|
286
|
+
||
|
|
287
|
+
(to &&
|
|
288
|
+
date.year === to.year &&
|
|
289
|
+
date.month === to.month &&
|
|
290
|
+
date.day === to.day)
|
|
291
|
+
||
|
|
292
|
+
this.isInside(date)
|
|
293
|
+
||
|
|
294
|
+
this.isHovered(date));
|
|
295
|
+
}
|
|
296
|
+
isStart(date) {
|
|
297
|
+
const from = this.fromDate();
|
|
298
|
+
return !!(from &&
|
|
299
|
+
date.year === from.year &&
|
|
300
|
+
date.month === from.month &&
|
|
301
|
+
date.day === from.day);
|
|
302
|
+
}
|
|
303
|
+
isEnd(date) {
|
|
304
|
+
const to = this.toDate();
|
|
305
|
+
return !!(to &&
|
|
306
|
+
date.year === to.year &&
|
|
307
|
+
date.month === to.month &&
|
|
308
|
+
date.day === to.day);
|
|
309
|
+
}
|
|
310
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepickerJalali, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
311
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: YsDatepickerJalali, isStandalone: true, selector: "ys-datepicker-jalali", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, weekend: { classPropertyName: "weekend", publicName: "weekend", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, outsideDays: { classPropertyName: "outsideDays", publicName: "outsideDays", isSignal: true, isRequired: false, transformFunction: null }, displayMonths: { classPropertyName: "displayMonths", publicName: "displayMonths", isSignal: true, isRequired: false, transformFunction: null }, rangeMode: { classPropertyName: "rangeMode", publicName: "rangeMode", isSignal: true, isRequired: false, transformFunction: null }, fromDate: { classPropertyName: "fromDate", publicName: "fromDate", isSignal: true, isRequired: false, transformFunction: null }, toDate: { classPropertyName: "toDate", publicName: "toDate", isSignal: true, isRequired: false, transformFunction: null }, hoveredDate: { classPropertyName: "hoveredDate", publicName: "hoveredDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", dateSelect: "dateSelect", dateHover: "dateHover" }, providers: [
|
|
368
312
|
{ provide: NgbCalendar, useClass: NgbCalendarPersian },
|
|
369
|
-
{ provide: NgbDatepickerI18n, useClass:
|
|
370
|
-
{
|
|
371
|
-
], ngImport: i0, template: "<ngb-datepicker #dp [(ngModel)]=\"value\" [firstDayOfWeek]=\"firstDayOfWeek\" [dayTemplate]=\"customDay\"\r\n [footerTemplate]=\"footerTemplate\" placeholder=\"yyyy/mm/dd\" [disabled]=\"disabled\"\r\n (ngModelChange)=\"valueChanged(value)\" />\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\" [class.bg-info]=\"selected\"\r\n [class.text-white]=\"selected\" [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"dp.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.custom-day:hover,.custom-day.focused{background-color:var(--bs-gray-300)}.hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "component", type: i2.NgbDatepicker, selector: "ngb-datepicker", inputs: ["contentTemplate", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "maxDate", "minDate", "navigation", "outsideDays", "showWeekNumbers", "startDate", "weekdays"], outputs: ["navigate", "dateSelect"], exportAs: ["ngbDatepicker"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
313
|
+
{ provide: NgbDatepickerI18n, useClass: YsPersianDatepickerI18n }
|
|
314
|
+
], ngImport: i0, template: "<ngb-datepicker #dp [navigation]=\"'select'\" [firstDayOfWeek]=\"firstDayOfWeek()\" [disabled]=\"disabled()\"\n [dayTemplate]=\"dayTemplate\" [footerTemplate]=\"footerTemplate\" [ngModel]=\"model()\"\n (ngModelChange)=\"valueChanged($event)\" [outsideDays]=\"outsideDays()\" [displayMonths]=\"displayMonths()\">\n</ngb-datepicker>\n\n<ng-template #dayTemplate let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-focused=\"focused\">\n\n <span class=\"ys-day\" [class.ys-selected]=\"selected\" [class.ys-focused]=\"focused\"\n [class.ys-weekend]=\"isWeekend(date)\" [class.ys-hidden]=\"date.month !== currentMonth\"\n [class.text-muted]=\"date.month !== currentMonth\" [class.ys-range]=\"rangeMode() && isRange(date)\"\n [class.ys-range-start]=\"rangeMode() && isStart(date)\" [class.ys-range-end]=\"rangeMode() && isEnd(date)\"\n (click)=\"dateSelect.emit(date)\" (mouseenter)=\"dateHover.emit(date)\">\n\n {{ date.day }}\n\n </span>\n\n</ng-template>\n\n<ng-template #footerTemplate>\n @if(showFooter()) {\n <div class=\"ys-datepicker-footer border-top\">\n\n <button type=\"button\" class=\"btn btn-sm btn-primary float-start mb-2\" [disabled]=\"disabled()\"\n (click)=\"setToday(dp)\">\n\n {{ todayLabel() }}\n\n </button>\n\n </div>\n }\n</ng-template>", styles: [".ys-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.ys-day:hover,.ys-focused{background:var(--bs-secondary-bg)}.ys-selected{background:var(--bs-primary);color:var(--bs-white)}.ys-selected.ys-day:hover{color:var(--bs-body-color)}.ys-weekend{color:var(--bs-danger)}.ys-hidden{opacity:.5}.ys-datepicker-footer{padding:.5rem}.ys-range{background-color:var(--bs-primary-bg-subtle);border-radius:0}.ys-range-start,.ys-range-end{background-color:var(--bs-primary);color:var(--bs-white)}.ys-range-start{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.ys-range-end{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.ys-range-start.ys-day:hover,.ys-range-end.ys-day:hover{color:var(--bs-body-color)}\n"], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "component", type: i1.NgbDatepicker, selector: "ngb-datepicker", inputs: ["contentTemplate", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "maxDate", "minDate", "navigation", "outsideDays", "showWeekNumbers", "startDate", "weekdays"], outputs: ["navigate", "dateSelect"], exportAs: ["ngbDatepicker"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
372
315
|
}
|
|
373
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepickerJalali, decorators: [{
|
|
374
317
|
type: Component,
|
|
375
|
-
args: [{ selector: 'ys-datepicker-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
multi: true
|
|
380
|
-
},
|
|
381
|
-
I18n,
|
|
318
|
+
args: [{ selector: 'ys-datepicker-jalali', imports: [
|
|
319
|
+
NgbDatepickerModule,
|
|
320
|
+
FormsModule
|
|
321
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
382
322
|
{ provide: NgbCalendar, useClass: NgbCalendarPersian },
|
|
383
|
-
{ provide: NgbDatepickerI18n, useClass:
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}], ctorParameters: () => [{ type: I18n }], propDecorators: { firstDayOfWeek: [{
|
|
387
|
-
type: Input
|
|
388
|
-
}], weekend: [{
|
|
389
|
-
type: Input
|
|
390
|
-
}], language: [{
|
|
391
|
-
type: Input
|
|
392
|
-
}], isFooter: [{
|
|
393
|
-
type: Input
|
|
394
|
-
}], todayLabel: [{
|
|
395
|
-
type: Input
|
|
396
|
-
}], footer: [{
|
|
397
|
-
type: Input
|
|
398
|
-
}], disabled: [{
|
|
399
|
-
type: Input
|
|
400
|
-
}] } });
|
|
323
|
+
{ provide: NgbDatepickerI18n, useClass: YsPersianDatepickerI18n }
|
|
324
|
+
], template: "<ngb-datepicker #dp [navigation]=\"'select'\" [firstDayOfWeek]=\"firstDayOfWeek()\" [disabled]=\"disabled()\"\n [dayTemplate]=\"dayTemplate\" [footerTemplate]=\"footerTemplate\" [ngModel]=\"model()\"\n (ngModelChange)=\"valueChanged($event)\" [outsideDays]=\"outsideDays()\" [displayMonths]=\"displayMonths()\">\n</ngb-datepicker>\n\n<ng-template #dayTemplate let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-focused=\"focused\">\n\n <span class=\"ys-day\" [class.ys-selected]=\"selected\" [class.ys-focused]=\"focused\"\n [class.ys-weekend]=\"isWeekend(date)\" [class.ys-hidden]=\"date.month !== currentMonth\"\n [class.text-muted]=\"date.month !== currentMonth\" [class.ys-range]=\"rangeMode() && isRange(date)\"\n [class.ys-range-start]=\"rangeMode() && isStart(date)\" [class.ys-range-end]=\"rangeMode() && isEnd(date)\"\n (click)=\"dateSelect.emit(date)\" (mouseenter)=\"dateHover.emit(date)\">\n\n {{ date.day }}\n\n </span>\n\n</ng-template>\n\n<ng-template #footerTemplate>\n @if(showFooter()) {\n <div class=\"ys-datepicker-footer border-top\">\n\n <button type=\"button\" class=\"btn btn-sm btn-primary float-start mb-2\" [disabled]=\"disabled()\"\n (click)=\"setToday(dp)\">\n\n {{ todayLabel() }}\n\n </button>\n\n </div>\n }\n</ng-template>", styles: [".ys-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.ys-day:hover,.ys-focused{background:var(--bs-secondary-bg)}.ys-selected{background:var(--bs-primary);color:var(--bs-white)}.ys-selected.ys-day:hover{color:var(--bs-body-color)}.ys-weekend{color:var(--bs-danger)}.ys-hidden{opacity:.5}.ys-datepicker-footer{padding:.5rem}.ys-range{background-color:var(--bs-primary-bg-subtle);border-radius:0}.ys-range-start,.ys-range-end{background-color:var(--bs-primary);color:var(--bs-white)}.ys-range-start{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.ys-range-end{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.ys-range-start.ys-day:hover,.ys-range-end.ys-day:hover{color:var(--bs-body-color)}\n"] }]
|
|
325
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], weekend: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekend", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], outsideDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "outsideDays", required: false }] }], displayMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMonths", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], rangeMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeMode", required: false }] }], fromDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "fromDate", required: false }] }], toDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "toDate", required: false }] }], hoveredDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoveredDate", required: false }] }], dateSelect: [{ type: i0.Output, args: ["dateSelect"] }], dateHover: [{ type: i0.Output, args: ["dateHover"] }] } });
|
|
401
326
|
|
|
402
|
-
class
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
this.
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
327
|
+
class YsDatepickerPopup {
|
|
328
|
+
calendarType = input('gregorian', /* @ts-ignore */
|
|
329
|
+
...(ngDevMode ? [{ debugName: "calendarType" }] : /* istanbul ignore next */ []));
|
|
330
|
+
disabled = input(false, /* @ts-ignore */
|
|
331
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
332
|
+
readonly = input(false, /* @ts-ignore */
|
|
333
|
+
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
334
|
+
placeholder = input('', /* @ts-ignore */
|
|
335
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
336
|
+
firstDayOfWeek = input(/* @ts-ignore */
|
|
337
|
+
...(ngDevMode ? [undefined, { debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
338
|
+
weekend = input(/* @ts-ignore */
|
|
339
|
+
...(ngDevMode ? [undefined, { debugName: "weekend" }] : /* istanbul ignore next */ []));
|
|
340
|
+
showFooter = input(true, /* @ts-ignore */
|
|
341
|
+
...(ngDevMode ? [{ debugName: "showFooter" }] : /* istanbul ignore next */ []));
|
|
342
|
+
todayLabel = input(/* @ts-ignore */
|
|
343
|
+
...(ngDevMode ? [undefined, { debugName: "todayLabel" }] : /* istanbul ignore next */ []));
|
|
344
|
+
outsideDays = input('visible', /* @ts-ignore */
|
|
345
|
+
...(ngDevMode ? [{ debugName: "outsideDays" }] : /* istanbul ignore next */ []));
|
|
346
|
+
displayMonths = input(1, /* @ts-ignore */
|
|
347
|
+
...(ngDevMode ? [{ debugName: "displayMonths" }] : /* istanbul ignore next */ []));
|
|
348
|
+
autoClose = input(true, /* @ts-ignore */
|
|
349
|
+
...(ngDevMode ? [{ debugName: "autoClose" }] : /* istanbul ignore next */ []));
|
|
350
|
+
container = input(null, /* @ts-ignore */
|
|
351
|
+
...(ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []));
|
|
352
|
+
calendarIconClass = input('fa fa-calendar', /* @ts-ignore */
|
|
353
|
+
...(ngDevMode ? [{ debugName: "calendarIconClass" }] : /* istanbul ignore next */ []));
|
|
354
|
+
clearIconClass = input('fa fa-xmark', /* @ts-ignore */
|
|
355
|
+
...(ngDevMode ? [{ debugName: "clearIconClass" }] : /* istanbul ignore next */ []));
|
|
356
|
+
disabledState = signal(false, /* @ts-ignore */
|
|
357
|
+
...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
358
|
+
isDisabled = computed(() => this.disabled() ||
|
|
359
|
+
this.disabledState(), /* @ts-ignore */
|
|
360
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
361
|
+
value = signal(null, /* @ts-ignore */
|
|
362
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
363
|
+
displayValue = computed(() => {
|
|
364
|
+
const value = this.value();
|
|
365
|
+
if (!value) {
|
|
366
|
+
return '';
|
|
440
367
|
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
368
|
+
if (this.calendarType() === 'jalali') {
|
|
369
|
+
return new YsPersianDatePipe().transform(value, 'shortDate');
|
|
370
|
+
}
|
|
371
|
+
return value.toLocaleDateString('en-CA');
|
|
372
|
+
}, /* @ts-ignore */
|
|
373
|
+
...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
374
|
+
onChange = (_) => { };
|
|
375
|
+
onTouched = () => { };
|
|
376
|
+
writeValue(value) {
|
|
377
|
+
this.value.set(value ?? null);
|
|
444
378
|
}
|
|
445
379
|
registerOnChange(fn) {
|
|
446
380
|
this.onChange = fn;
|
|
@@ -449,123 +383,89 @@ class YsDatepickerPopupPersianComponent {
|
|
|
449
383
|
this.onTouched = fn;
|
|
450
384
|
}
|
|
451
385
|
setDisabledState(isDisabled) {
|
|
452
|
-
this.
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
let convertedDate = JalaliDate.jalaliToGregorian(+temp[0], (+temp[1]) - 1, +temp[2]);
|
|
461
|
-
let res = new Date(+convertedDate[0], (+convertedDate[1]) - 1, +convertedDate[2]);
|
|
462
|
-
this.onChange(res);
|
|
463
|
-
this.onTouched(res);
|
|
464
|
-
}
|
|
465
|
-
else {
|
|
466
|
-
let convertedDate = JalaliDate.jalaliToGregorian(newDate.year, newDate.month, newDate.day);
|
|
467
|
-
var res = new Date(+convertedDate[0], +convertedDate[1] - 1, +convertedDate[2]);
|
|
468
|
-
this.onChange(res);
|
|
469
|
-
this.onTouched(res);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
else {
|
|
473
|
-
this.onChange(null);
|
|
474
|
-
this.onTouched(null);
|
|
386
|
+
this.disabledState.set(isDisabled);
|
|
387
|
+
}
|
|
388
|
+
valueChanged(value, dropdown) {
|
|
389
|
+
this.value.set(value);
|
|
390
|
+
this.onChange(value);
|
|
391
|
+
this.onTouched();
|
|
392
|
+
if (this.autoClose() && value) {
|
|
393
|
+
dropdown.close();
|
|
475
394
|
}
|
|
476
395
|
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
this.
|
|
396
|
+
clear(event) {
|
|
397
|
+
event.stopPropagation();
|
|
398
|
+
this.value.set(null);
|
|
399
|
+
this.onChange(null);
|
|
400
|
+
this.onTouched();
|
|
480
401
|
}
|
|
481
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
482
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
402
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepickerPopup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
403
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: YsDatepickerPopup, isStandalone: true, selector: "ys-datepicker-popup", inputs: { calendarType: { classPropertyName: "calendarType", publicName: "calendarType", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, weekend: { classPropertyName: "weekend", publicName: "weekend", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, outsideDays: { classPropertyName: "outsideDays", publicName: "outsideDays", isSignal: true, isRequired: false, transformFunction: null }, displayMonths: { classPropertyName: "displayMonths", publicName: "displayMonths", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, calendarIconClass: { classPropertyName: "calendarIconClass", publicName: "calendarIconClass", isSignal: true, isRequired: false, transformFunction: null }, clearIconClass: { classPropertyName: "clearIconClass", publicName: "clearIconClass", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
483
404
|
{
|
|
484
405
|
provide: NG_VALUE_ACCESSOR,
|
|
485
|
-
useExisting: forwardRef(() =>
|
|
406
|
+
useExisting: forwardRef(() => YsDatepickerPopup),
|
|
486
407
|
multi: true
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
{ provide: NgbCalendar, useClass: NgbCalendarPersian },
|
|
490
|
-
{ provide: NgbDatepickerI18n, useClass: YsDatepickerI18nService },
|
|
491
|
-
{ provide: NgbDateParserFormatter, useClass: YsDateParserFormatterService }
|
|
492
|
-
], ngImport: i0, template: "<form class=\"row row-cols-sm-auto\">\r\n <div class=\"col-12\">\r\n <div class=\"input-group\">\r\n <input class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dp\" [(ngModel)]=\"value\" ngbDatepicker\r\n #datepicker=\"ngbDatepicker\" [container]=\"container\" [markDisabled]=\"markDisabled\" [disabled]=\"disabled\"\r\n [footerTemplate]=\"footerTemplate\" [firstDayOfWeek]=\"firstDayOfWeek\" [dayTemplate]=\"customDay\"\r\n (ngModelChange)=\"valueChanged(value)\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\" [class.bg-info]=\"selected\"\r\n [class.text-white]=\"selected\" [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"datepicker.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n <button class=\"btn btn-secondary btn-sm m-2 float-end\" (click)=\"datepicker.close()\">{{closeLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.custom-day:hover,.custom-day.focused{background-color:var(--bs-gray-300)}.hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "directive", type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "contentTemplate", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
408
|
+
}
|
|
409
|
+
], ngImport: i0, template: "<div ngbDropdown #dropdown=\"ngbDropdown\" [container]=\"container()\" class=\"ys-datepicker-popup\">\n\n <div class=\"input-group\">\n\n <input type=\"text\" class=\"form-control\" [placeholder]=\"placeholder()\" [value]=\"displayValue()\"\n [readonly]=\"readonly()\" [disabled]=\"isDisabled()\" ngbDropdownToggle>\n\n @if(value()) {\n\n <button type=\"button\" class=\"btn btn-outline-secondary\" [disabled]=\"isDisabled()\" (click)=\"clear($event)\">\n <i [class]=\"clearIconClass()\"></i>\n </button>\n\n }\n\n <button type=\"button\" class=\"btn btn-outline-secondary\" [disabled]=\"isDisabled()\" ngbDropdownToggle>\n <i [class]=\"calendarIconClass()\"></i>\n </button>\n\n </div>\n\n <div ngbDropdownMenu class=\"p-0 border-0 shadow\">\n\n @if(calendarType() === 'jalali') {\n\n <ys-datepicker-jalali [value]=\"value()\" [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 6\"\n [weekend]=\"weekend() ?? [5]\" [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? '\u0627\u0645\u0631\u0648\u0632'\"\n (valueChange)=\"valueChanged($event, dropdown)\" [outsideDays]=\"outsideDays()\"\n [displayMonths]=\"displayMonths()\">\n </ys-datepicker-jalali>\n\n }\n\n @else {\n\n <ys-datepicker-gregorian [value]=\"value()\" [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 1\"\n [weekend]=\"weekend() ?? [6,7]\" [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? 'Today'\"\n (valueChange)=\"valueChanged($event, dropdown)\" [outsideDays]=\"outsideDays()\"\n [displayMonths]=\"displayMonths()\">\n </ys-datepicker-gregorian>\n\n }\n\n </div>\n\n</div>", styles: [":host{display:block}.ys-datepicker-popup{width:100%}.ys-datepicker-popup .dropdown-toggle:after{display:none}.form-control[readonly]{cursor:pointer}.ys-datepicker-popup .input-group>input.dropdown-toggle{border-start-end-radius:0;border-end-end-radius:0}\n"], dependencies: [{ kind: "ngmodule", type: NgbDropdownModule }, { kind: "directive", type: i1.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i1.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i1.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "component", type: YsDatepickerGregorian, selector: "ys-datepicker-gregorian", inputs: ["value", "disabled", "firstDayOfWeek", "weekend", "showFooter", "todayLabel", "outsideDays", "displayMonths", "rangeMode", "fromDate", "toDate", "hoveredDate"], outputs: ["valueChange", "dateSelect", "dateHover"] }, { kind: "component", type: YsDatepickerJalali, selector: "ys-datepicker-jalali", inputs: ["value", "disabled", "firstDayOfWeek", "weekend", "showFooter", "todayLabel", "outsideDays", "displayMonths", "rangeMode", "fromDate", "toDate", "hoveredDate"], outputs: ["valueChange", "dateSelect", "dateHover"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
493
410
|
}
|
|
494
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
411
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepickerPopup, decorators: [{
|
|
495
412
|
type: Component,
|
|
496
|
-
args: [{ selector: 'ys-datepicker-popup
|
|
413
|
+
args: [{ selector: 'ys-datepicker-popup', imports: [
|
|
414
|
+
NgbDropdownModule,
|
|
415
|
+
YsDatepickerGregorian,
|
|
416
|
+
YsDatepickerJalali,
|
|
417
|
+
YsPersianDatePipe
|
|
418
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
497
419
|
{
|
|
498
420
|
provide: NG_VALUE_ACCESSOR,
|
|
499
|
-
useExisting: forwardRef(() =>
|
|
421
|
+
useExisting: forwardRef(() => YsDatepickerPopup),
|
|
500
422
|
multi: true
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
{ provide: NgbDatepickerI18n, useClass: YsDatepickerI18nService },
|
|
505
|
-
{ provide: NgbDateParserFormatter, useClass: YsDateParserFormatterService }
|
|
506
|
-
], template: "<form class=\"row row-cols-sm-auto\">\r\n <div class=\"col-12\">\r\n <div class=\"input-group\">\r\n <input class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dp\" [(ngModel)]=\"value\" ngbDatepicker\r\n #datepicker=\"ngbDatepicker\" [container]=\"container\" [markDisabled]=\"markDisabled\" [disabled]=\"disabled\"\r\n [footerTemplate]=\"footerTemplate\" [firstDayOfWeek]=\"firstDayOfWeek\" [dayTemplate]=\"customDay\"\r\n (ngModelChange)=\"valueChanged(value)\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\" [class.bg-info]=\"selected\"\r\n [class.text-white]=\"selected\" [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"datepicker.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n <button class=\"btn btn-secondary btn-sm m-2 float-end\" (click)=\"datepicker.close()\">{{closeLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.custom-day:hover,.custom-day.focused{background-color:var(--bs-gray-300)}.hidden{display:none}\n"] }]
|
|
507
|
-
}], ctorParameters: () => [{ type: I18n }], propDecorators: { container: [{
|
|
508
|
-
type: Input
|
|
509
|
-
}], firstDayOfWeek: [{
|
|
510
|
-
type: Input
|
|
511
|
-
}], weekend: [{
|
|
512
|
-
type: Input
|
|
513
|
-
}], language: [{
|
|
514
|
-
type: Input
|
|
515
|
-
}], isFooter: [{
|
|
516
|
-
type: Input
|
|
517
|
-
}], closeLabel: [{
|
|
518
|
-
type: Input
|
|
519
|
-
}], todayLabel: [{
|
|
520
|
-
type: Input
|
|
521
|
-
}], footer: [{
|
|
522
|
-
type: Input
|
|
523
|
-
}], calendarIconClass: [{
|
|
524
|
-
type: Input
|
|
525
|
-
}], disabled: [{
|
|
526
|
-
type: Input
|
|
527
|
-
}] } });
|
|
423
|
+
}
|
|
424
|
+
], template: "<div ngbDropdown #dropdown=\"ngbDropdown\" [container]=\"container()\" class=\"ys-datepicker-popup\">\n\n <div class=\"input-group\">\n\n <input type=\"text\" class=\"form-control\" [placeholder]=\"placeholder()\" [value]=\"displayValue()\"\n [readonly]=\"readonly()\" [disabled]=\"isDisabled()\" ngbDropdownToggle>\n\n @if(value()) {\n\n <button type=\"button\" class=\"btn btn-outline-secondary\" [disabled]=\"isDisabled()\" (click)=\"clear($event)\">\n <i [class]=\"clearIconClass()\"></i>\n </button>\n\n }\n\n <button type=\"button\" class=\"btn btn-outline-secondary\" [disabled]=\"isDisabled()\" ngbDropdownToggle>\n <i [class]=\"calendarIconClass()\"></i>\n </button>\n\n </div>\n\n <div ngbDropdownMenu class=\"p-0 border-0 shadow\">\n\n @if(calendarType() === 'jalali') {\n\n <ys-datepicker-jalali [value]=\"value()\" [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 6\"\n [weekend]=\"weekend() ?? [5]\" [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? '\u0627\u0645\u0631\u0648\u0632'\"\n (valueChange)=\"valueChanged($event, dropdown)\" [outsideDays]=\"outsideDays()\"\n [displayMonths]=\"displayMonths()\">\n </ys-datepicker-jalali>\n\n }\n\n @else {\n\n <ys-datepicker-gregorian [value]=\"value()\" [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 1\"\n [weekend]=\"weekend() ?? [6,7]\" [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? 'Today'\"\n (valueChange)=\"valueChanged($event, dropdown)\" [outsideDays]=\"outsideDays()\"\n [displayMonths]=\"displayMonths()\">\n </ys-datepicker-gregorian>\n\n }\n\n </div>\n\n</div>", styles: [":host{display:block}.ys-datepicker-popup{width:100%}.ys-datepicker-popup .dropdown-toggle:after{display:none}.form-control[readonly]{cursor:pointer}.ys-datepicker-popup .input-group>input.dropdown-toggle{border-start-end-radius:0;border-end-end-radius:0}\n"] }]
|
|
425
|
+
}], propDecorators: { calendarType: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarType", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], weekend: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekend", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], outsideDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "outsideDays", required: false }] }], displayMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMonths", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClose", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], calendarIconClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarIconClass", required: false }] }], clearIconClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearIconClass", required: false }] }] } });
|
|
528
426
|
|
|
529
|
-
class
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
this.
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
onChange = () => { };
|
|
427
|
+
class YsDatepickerRange {
|
|
428
|
+
calendarType = input('gregorian', /* @ts-ignore */
|
|
429
|
+
...(ngDevMode ? [{ debugName: "calendarType" }] : /* istanbul ignore next */ []));
|
|
430
|
+
disabled = input(false, /* @ts-ignore */
|
|
431
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
432
|
+
firstDayOfWeek = input(/* @ts-ignore */
|
|
433
|
+
...(ngDevMode ? [undefined, { debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
434
|
+
weekend = input(/* @ts-ignore */
|
|
435
|
+
...(ngDevMode ? [undefined, { debugName: "weekend" }] : /* istanbul ignore next */ []));
|
|
436
|
+
showFooter = input(true, /* @ts-ignore */
|
|
437
|
+
...(ngDevMode ? [{ debugName: "showFooter" }] : /* istanbul ignore next */ []));
|
|
438
|
+
todayLabel = input(/* @ts-ignore */
|
|
439
|
+
...(ngDevMode ? [undefined, { debugName: "todayLabel" }] : /* istanbul ignore next */ []));
|
|
440
|
+
outsideDays = input('visible', /* @ts-ignore */
|
|
441
|
+
...(ngDevMode ? [{ debugName: "outsideDays" }] : /* istanbul ignore next */ []));
|
|
442
|
+
displayMonths = input(2, /* @ts-ignore */
|
|
443
|
+
...(ngDevMode ? [{ debugName: "displayMonths" }] : /* istanbul ignore next */ []));
|
|
444
|
+
disabledState = signal(false, /* @ts-ignore */
|
|
445
|
+
...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
446
|
+
isDisabled = computed(() => this.disabled() ||
|
|
447
|
+
this.disabledState(), /* @ts-ignore */
|
|
448
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
449
|
+
fromDate = signal(null, /* @ts-ignore */
|
|
450
|
+
...(ngDevMode ? [{ debugName: "fromDate" }] : /* istanbul ignore next */ []));
|
|
451
|
+
toDate = signal(null, /* @ts-ignore */
|
|
452
|
+
...(ngDevMode ? [{ debugName: "toDate" }] : /* istanbul ignore next */ []));
|
|
453
|
+
hoveredDate = signal(null, /* @ts-ignore */
|
|
454
|
+
...(ngDevMode ? [{ debugName: "hoveredDate" }] : /* istanbul ignore next */ []));
|
|
455
|
+
onChange = (_) => { };
|
|
558
456
|
onTouched = () => { };
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
if (!obj) {
|
|
564
|
-
this.value = null;
|
|
457
|
+
writeValue(value) {
|
|
458
|
+
if (!value) {
|
|
459
|
+
this.fromDate.set(null);
|
|
460
|
+
this.toDate.set(null);
|
|
565
461
|
return;
|
|
566
462
|
}
|
|
567
|
-
|
|
568
|
-
|
|
463
|
+
this.fromDate.set(value.from
|
|
464
|
+
? this.fromJsDate(value.from)
|
|
465
|
+
: null);
|
|
466
|
+
this.toDate.set(value.to
|
|
467
|
+
? this.fromJsDate(value.to)
|
|
468
|
+
: null);
|
|
569
469
|
}
|
|
570
470
|
registerOnChange(fn) {
|
|
571
471
|
this.onChange = fn;
|
|
@@ -574,131 +474,128 @@ class YsDatepickerPopupComponent {
|
|
|
574
474
|
this.onTouched = fn;
|
|
575
475
|
}
|
|
576
476
|
setDisabledState(isDisabled) {
|
|
577
|
-
this.
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
if (
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
let res = new Date(+temp[0], (+temp[1]) - 1, +temp[2]);
|
|
586
|
-
this.onChange(res);
|
|
587
|
-
this.onTouched(res);
|
|
588
|
-
}
|
|
589
|
-
else {
|
|
590
|
-
let res = new Date(newDate.year, newDate.month - 1, newDate.day);
|
|
591
|
-
this.onChange(res);
|
|
592
|
-
this.onTouched(res);
|
|
593
|
-
}
|
|
477
|
+
this.disabledState.set(isDisabled);
|
|
478
|
+
}
|
|
479
|
+
select(date) {
|
|
480
|
+
const from = this.fromDate();
|
|
481
|
+
const to = this.toDate();
|
|
482
|
+
if (!from) {
|
|
483
|
+
this.fromDate.set(date);
|
|
484
|
+
return;
|
|
594
485
|
}
|
|
595
|
-
|
|
596
|
-
this.
|
|
597
|
-
this.
|
|
486
|
+
if (from && !to && compareDates(date, from) >= 0) {
|
|
487
|
+
this.toDate.set(date);
|
|
488
|
+
this.emitValue();
|
|
489
|
+
return;
|
|
598
490
|
}
|
|
491
|
+
this.fromDate.set(date);
|
|
492
|
+
this.toDate.set(null);
|
|
493
|
+
}
|
|
494
|
+
hover(date) {
|
|
495
|
+
this.hoveredDate.set(date);
|
|
496
|
+
}
|
|
497
|
+
emitValue() {
|
|
498
|
+
this.onChange({
|
|
499
|
+
from: this.fromDate()
|
|
500
|
+
? this.toJsDate(this.fromDate())
|
|
501
|
+
: null,
|
|
502
|
+
to: this.toDate()
|
|
503
|
+
? this.toJsDate(this.toDate())
|
|
504
|
+
: null
|
|
505
|
+
});
|
|
506
|
+
this.onTouched();
|
|
507
|
+
}
|
|
508
|
+
fromJsDate(date) {
|
|
509
|
+
if (this.calendarType() === 'jalali') {
|
|
510
|
+
return JalaliDate.toNgbDateStruct(JalaliDate.fromDate(date));
|
|
511
|
+
}
|
|
512
|
+
return {
|
|
513
|
+
year: date.getFullYear(),
|
|
514
|
+
month: date.getMonth() + 1,
|
|
515
|
+
day: date.getDate()
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
toJsDate(date) {
|
|
519
|
+
if (this.calendarType() === 'jalali') {
|
|
520
|
+
return JalaliDate.toDate(JalaliDate.fromNgbDateStruct(date));
|
|
521
|
+
}
|
|
522
|
+
return new Date(date.year, date.month - 1, date.day);
|
|
599
523
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
this.valueChanged(this.value);
|
|
603
|
-
}
|
|
604
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: YsDatepickerPopupComponent, deps: [{ token: I18n }], target: i0.ɵɵFactoryTarget.Component });
|
|
605
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: YsDatepickerPopupComponent, isStandalone: true, selector: "ys-datepicker-popup", inputs: { container: "container", firstDayOfWeek: "firstDayOfWeek", weekend: "weekend", language: "language", isFooter: "isFooter", closeLabel: "closeLabel", todayLabel: "todayLabel", footer: "footer", calendarIconClass: "calendarIconClass", disabled: "disabled" }, providers: [
|
|
524
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepickerRange, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
525
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: YsDatepickerRange, isStandalone: true, selector: "ys-datepicker-range", inputs: { calendarType: { classPropertyName: "calendarType", publicName: "calendarType", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, weekend: { classPropertyName: "weekend", publicName: "weekend", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, outsideDays: { classPropertyName: "outsideDays", publicName: "outsideDays", isSignal: true, isRequired: false, transformFunction: null }, displayMonths: { classPropertyName: "displayMonths", publicName: "displayMonths", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
606
526
|
{
|
|
607
527
|
provide: NG_VALUE_ACCESSOR,
|
|
608
|
-
useExisting: forwardRef(() =>
|
|
528
|
+
useExisting: forwardRef(() => YsDatepickerRange),
|
|
609
529
|
multi: true
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
{ provide: NgbDatepickerI18n, useClass: YsDatepickerI18nService },
|
|
613
|
-
{ provide: NgbDateParserFormatter, useClass: YsDateParserFormatterService }
|
|
614
|
-
], ngImport: i0, template: "<form class=\"row row-cols-sm-auto\">\r\n <div class=\"col-12\">\r\n <div class=\"input-group\">\r\n <input class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dp\" [(ngModel)]=\"value\" ngbDatepicker\r\n #datepicker=\"ngbDatepicker\" [container]=\"container\" [markDisabled]=\"markDisabled\" [disabled]=\"disabled\"\r\n [footerTemplate]=\"footerTemplate\" [firstDayOfWeek]=\"firstDayOfWeek\" [dayTemplate]=\"customDay\"\r\n (ngModelChange)=\"valueChanged(value)\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\" [class.bg-info]=\"selected\"\r\n [class.text-white]=\"selected\" [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"datepicker.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n <button class=\"btn btn-secondary btn-sm m-2 float-end\" (click)=\"datepicker.close()\">{{closeLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.custom-day:hover,.custom-day.focused{background-color:var(--bs-gray-300)}.hidden{display:none}\n"], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "directive", type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "contentTemplate", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
530
|
+
}
|
|
531
|
+
], ngImport: i0, template: "@if(calendarType() === 'jalali') {\n\n<ys-datepicker-jalali [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 6\" [weekend]=\"weekend() ?? [5]\"\n [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? '\u0627\u0645\u0631\u0648\u0632'\" [rangeMode]=\"true\" [fromDate]=\"fromDate()\"\n [toDate]=\"toDate()\" [hoveredDate]=\"hoveredDate()\" (dateSelect)=\"select($event)\" (dateHover)=\"hover($event)\"\n [outsideDays]=\"outsideDays()\" [displayMonths]=\"displayMonths()\">\n</ys-datepicker-jalali>\n\n}\n\n@else {\n\n<ys-datepicker-gregorian [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 1\"\n [weekend]=\"weekend() ?? [6,7]\" [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? 'Today'\" [rangeMode]=\"true\"\n [fromDate]=\"fromDate()\" [toDate]=\"toDate()\" [hoveredDate]=\"hoveredDate()\" (dateSelect)=\"select($event)\"\n (dateHover)=\"hover($event)\" [outsideDays]=\"outsideDays()\" [displayMonths]=\"displayMonths()\">\n</ys-datepicker-gregorian>\n\n}", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: YsDatepickerGregorian, selector: "ys-datepicker-gregorian", inputs: ["value", "disabled", "firstDayOfWeek", "weekend", "showFooter", "todayLabel", "outsideDays", "displayMonths", "rangeMode", "fromDate", "toDate", "hoveredDate"], outputs: ["valueChange", "dateSelect", "dateHover"] }, { kind: "component", type: YsDatepickerJalali, selector: "ys-datepicker-jalali", inputs: ["value", "disabled", "firstDayOfWeek", "weekend", "showFooter", "todayLabel", "outsideDays", "displayMonths", "rangeMode", "fromDate", "toDate", "hoveredDate"], outputs: ["valueChange", "dateSelect", "dateHover"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
615
532
|
}
|
|
616
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
533
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepickerRange, decorators: [{
|
|
617
534
|
type: Component,
|
|
618
|
-
args: [{ selector: 'ys-datepicker-
|
|
535
|
+
args: [{ selector: 'ys-datepicker-range', imports: [
|
|
536
|
+
FormsModule,
|
|
537
|
+
YsDatepickerGregorian,
|
|
538
|
+
YsDatepickerJalali
|
|
539
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
619
540
|
{
|
|
620
541
|
provide: NG_VALUE_ACCESSOR,
|
|
621
|
-
useExisting: forwardRef(() =>
|
|
542
|
+
useExisting: forwardRef(() => YsDatepickerRange),
|
|
622
543
|
multi: true
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
{ provide: NgbDateParserFormatter, useClass: YsDateParserFormatterService }
|
|
627
|
-
], template: "<form class=\"row row-cols-sm-auto\">\r\n <div class=\"col-12\">\r\n <div class=\"input-group\">\r\n <input class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dp\" [(ngModel)]=\"value\" ngbDatepicker\r\n #datepicker=\"ngbDatepicker\" [container]=\"container\" [markDisabled]=\"markDisabled\" [disabled]=\"disabled\"\r\n [footerTemplate]=\"footerTemplate\" [firstDayOfWeek]=\"firstDayOfWeek\" [dayTemplate]=\"customDay\"\r\n (ngModelChange)=\"valueChanged(value)\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\" [class.bg-info]=\"selected\"\r\n [class.text-white]=\"selected\" [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"datepicker.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n <button class=\"btn btn-secondary btn-sm m-2 float-end\" (click)=\"datepicker.close()\">{{closeLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.custom-day:hover,.custom-day.focused{background-color:var(--bs-gray-300)}.hidden{display:none}\n"] }]
|
|
628
|
-
}], ctorParameters: () => [{ type: I18n }], propDecorators: { container: [{
|
|
629
|
-
type: Input
|
|
630
|
-
}], firstDayOfWeek: [{
|
|
631
|
-
type: Input
|
|
632
|
-
}], weekend: [{
|
|
633
|
-
type: Input
|
|
634
|
-
}], language: [{
|
|
635
|
-
type: Input
|
|
636
|
-
}], isFooter: [{
|
|
637
|
-
type: Input
|
|
638
|
-
}], closeLabel: [{
|
|
639
|
-
type: Input
|
|
640
|
-
}], todayLabel: [{
|
|
641
|
-
type: Input
|
|
642
|
-
}], footer: [{
|
|
643
|
-
type: Input
|
|
644
|
-
}], calendarIconClass: [{
|
|
645
|
-
type: Input
|
|
646
|
-
}], disabled: [{
|
|
647
|
-
type: Input
|
|
648
|
-
}] } });
|
|
544
|
+
}
|
|
545
|
+
], template: "@if(calendarType() === 'jalali') {\n\n<ys-datepicker-jalali [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 6\" [weekend]=\"weekend() ?? [5]\"\n [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? '\u0627\u0645\u0631\u0648\u0632'\" [rangeMode]=\"true\" [fromDate]=\"fromDate()\"\n [toDate]=\"toDate()\" [hoveredDate]=\"hoveredDate()\" (dateSelect)=\"select($event)\" (dateHover)=\"hover($event)\"\n [outsideDays]=\"outsideDays()\" [displayMonths]=\"displayMonths()\">\n</ys-datepicker-jalali>\n\n}\n\n@else {\n\n<ys-datepicker-gregorian [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 1\"\n [weekend]=\"weekend() ?? [6,7]\" [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? 'Today'\" [rangeMode]=\"true\"\n [fromDate]=\"fromDate()\" [toDate]=\"toDate()\" [hoveredDate]=\"hoveredDate()\" (dateSelect)=\"select($event)\"\n (dateHover)=\"hover($event)\" [outsideDays]=\"outsideDays()\" [displayMonths]=\"displayMonths()\">\n</ys-datepicker-gregorian>\n\n}" }]
|
|
546
|
+
}], propDecorators: { calendarType: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarType", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], weekend: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekend", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], outsideDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "outsideDays", required: false }] }], displayMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMonths", required: false }] }] } });
|
|
649
547
|
|
|
650
|
-
class
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
writeValue(obj) {
|
|
691
|
-
if (!obj) {
|
|
692
|
-
this.fromDate = null;
|
|
693
|
-
this.toDate = null;
|
|
694
|
-
return;
|
|
548
|
+
class YsDatepickerRangePopup {
|
|
549
|
+
calendarType = input('gregorian', /* @ts-ignore */
|
|
550
|
+
...(ngDevMode ? [{ debugName: "calendarType" }] : /* istanbul ignore next */ []));
|
|
551
|
+
disabled = input(false, /* @ts-ignore */
|
|
552
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
553
|
+
readonly = input(false, /* @ts-ignore */
|
|
554
|
+
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
555
|
+
placeholder = input('Select date range', /* @ts-ignore */
|
|
556
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
557
|
+
firstDayOfWeek = input(/* @ts-ignore */
|
|
558
|
+
...(ngDevMode ? [undefined, { debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
559
|
+
weekend = input(/* @ts-ignore */
|
|
560
|
+
...(ngDevMode ? [undefined, { debugName: "weekend" }] : /* istanbul ignore next */ []));
|
|
561
|
+
showFooter = input(true, /* @ts-ignore */
|
|
562
|
+
...(ngDevMode ? [{ debugName: "showFooter" }] : /* istanbul ignore next */ []));
|
|
563
|
+
todayLabel = input(/* @ts-ignore */
|
|
564
|
+
...(ngDevMode ? [undefined, { debugName: "todayLabel" }] : /* istanbul ignore next */ []));
|
|
565
|
+
outsideDays = input('visible', /* @ts-ignore */
|
|
566
|
+
...(ngDevMode ? [{ debugName: "outsideDays" }] : /* istanbul ignore next */ []));
|
|
567
|
+
displayMonths = input(2, /* @ts-ignore */
|
|
568
|
+
...(ngDevMode ? [{ debugName: "displayMonths" }] : /* istanbul ignore next */ []));
|
|
569
|
+
autoClose = input(true, /* @ts-ignore */
|
|
570
|
+
...(ngDevMode ? [{ debugName: "autoClose" }] : /* istanbul ignore next */ []));
|
|
571
|
+
container = input(null, /* @ts-ignore */
|
|
572
|
+
...(ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []));
|
|
573
|
+
calendarIconClass = input('fa fa-calendar', /* @ts-ignore */
|
|
574
|
+
...(ngDevMode ? [{ debugName: "calendarIconClass" }] : /* istanbul ignore next */ []));
|
|
575
|
+
clearIconClass = input('fa fa-xmark', /* @ts-ignore */
|
|
576
|
+
...(ngDevMode ? [{ debugName: "clearIconClass" }] : /* istanbul ignore next */ []));
|
|
577
|
+
disabledState = signal(false, /* @ts-ignore */
|
|
578
|
+
...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
579
|
+
isDisabled = computed(() => this.disabled() ||
|
|
580
|
+
this.disabledState(), /* @ts-ignore */
|
|
581
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
582
|
+
value = signal(null, /* @ts-ignore */
|
|
583
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
584
|
+
displayValue = computed(() => {
|
|
585
|
+
const range = this.value();
|
|
586
|
+
if (!range?.from) {
|
|
587
|
+
return '';
|
|
695
588
|
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
589
|
+
if (!range.to) {
|
|
590
|
+
return this.formatDate(range.from);
|
|
591
|
+
}
|
|
592
|
+
return `${this.formatDate(range.from)} - ${this.formatDate(range.to)}`;
|
|
593
|
+
}, /* @ts-ignore */
|
|
594
|
+
...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
595
|
+
onChange = (_) => { };
|
|
596
|
+
onTouched = () => { };
|
|
597
|
+
writeValue(value) {
|
|
598
|
+
this.value.set(value);
|
|
702
599
|
}
|
|
703
600
|
registerOnChange(fn) {
|
|
704
601
|
this.onChange = fn;
|
|
@@ -707,154 +604,81 @@ class YsDatepickerRangePopupPersianComponent {
|
|
|
707
604
|
this.onTouched = fn;
|
|
708
605
|
}
|
|
709
606
|
setDisabledState(isDisabled) {
|
|
710
|
-
this.
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
607
|
+
this.disabledState.set(isDisabled);
|
|
608
|
+
}
|
|
609
|
+
valueChanged(value, dropdown) {
|
|
610
|
+
this.value.set(value);
|
|
611
|
+
this.onChange(value);
|
|
612
|
+
this.onTouched();
|
|
613
|
+
if (this.autoClose() && value?.from && value?.to) {
|
|
614
|
+
dropdown.close();
|
|
718
615
|
}
|
|
719
|
-
else {
|
|
720
|
-
this.toDate = null;
|
|
721
|
-
this.fromDate = date;
|
|
722
|
-
}
|
|
723
|
-
this.valueChanged();
|
|
724
|
-
}
|
|
725
|
-
isHovered(date) {
|
|
726
|
-
return (this.fromDate && !this.toDate && this.hoveredDate && date.after(this.fromDate) && date.before(this.hoveredDate));
|
|
727
616
|
}
|
|
728
|
-
|
|
729
|
-
|
|
617
|
+
clear(event) {
|
|
618
|
+
event.stopPropagation();
|
|
619
|
+
this.value.set(null);
|
|
620
|
+
this.onChange(null);
|
|
621
|
+
this.onTouched();
|
|
730
622
|
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
this.isInside(date) ||
|
|
735
|
-
this.isHovered(date));
|
|
736
|
-
}
|
|
737
|
-
markDisabled = (date, current) => date.month !== current?.month;
|
|
738
|
-
isWeekend = (date) => this.weekend.includes(this.calendar.getWeekday(date));
|
|
739
|
-
validateInput(currentValue, input) {
|
|
740
|
-
const parsed = this.formatter.parse(input);
|
|
741
|
-
return parsed && this.calendar.isValid(NgbDate.from(parsed)) ? NgbDate.from(parsed) : currentValue;
|
|
742
|
-
}
|
|
743
|
-
valueChanged() {
|
|
744
|
-
let range = { fromDate: null, toDate: null };
|
|
745
|
-
if (this.fromDate) {
|
|
746
|
-
let fromDateConverted = JalaliDate.jalaliToGregorian(this.fromDate.year, this.fromDate.month, this.fromDate.day);
|
|
747
|
-
range.fromDate = new Date(fromDateConverted[0], fromDateConverted[1] - 1, fromDateConverted[2]);
|
|
748
|
-
}
|
|
749
|
-
if (this.toDate) {
|
|
750
|
-
let toDateConverted = JalaliDate.jalaliToGregorian(this.toDate.year, this.toDate.month, this.toDate.day);
|
|
751
|
-
range.toDate = new Date(toDateConverted[0], toDateConverted[1] - 1, toDateConverted[2]);
|
|
623
|
+
formatDate(value) {
|
|
624
|
+
if (this.calendarType() === 'jalali') {
|
|
625
|
+
return JalaliDate.format(value, 'yyyy/MM/dd');
|
|
752
626
|
}
|
|
753
|
-
|
|
754
|
-
|
|
627
|
+
const year = value.getFullYear();
|
|
628
|
+
const month = String(value.getMonth() + 1).padStart(2, '0');
|
|
629
|
+
const day = String(value.getDate()).padStart(2, '0');
|
|
630
|
+
return `${year}/${month}/${day}`;
|
|
755
631
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
this.toDate = this.today;
|
|
759
|
-
this.valueChanged();
|
|
760
|
-
}
|
|
761
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: YsDatepickerRangePopupPersianComponent, deps: [{ token: I18n }], target: i0.ɵɵFactoryTarget.Component });
|
|
762
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: YsDatepickerRangePopupPersianComponent, isStandalone: true, selector: "ys-datepicker-range-popup-persian", inputs: { container: "container", firstDayOfWeek: "firstDayOfWeek", weekend: "weekend", language: "language", isFooter: "isFooter", closeLabel: "closeLabel", todayLabel: "todayLabel", footer: "footer", calendarIconClass: "calendarIconClass", disabled: "disabled" }, providers: [
|
|
632
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepickerRangePopup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
633
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: YsDatepickerRangePopup, isStandalone: true, selector: "ys-datepicker-range-popup", inputs: { calendarType: { classPropertyName: "calendarType", publicName: "calendarType", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, weekend: { classPropertyName: "weekend", publicName: "weekend", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, outsideDays: { classPropertyName: "outsideDays", publicName: "outsideDays", isSignal: true, isRequired: false, transformFunction: null }, displayMonths: { classPropertyName: "displayMonths", publicName: "displayMonths", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, calendarIconClass: { classPropertyName: "calendarIconClass", publicName: "calendarIconClass", isSignal: true, isRequired: false, transformFunction: null }, clearIconClass: { classPropertyName: "clearIconClass", publicName: "clearIconClass", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
763
634
|
{
|
|
764
635
|
provide: NG_VALUE_ACCESSOR,
|
|
765
|
-
useExisting: forwardRef(() =>
|
|
636
|
+
useExisting: forwardRef(() => YsDatepickerRangePopup),
|
|
766
637
|
multi: true
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
{ provide: NgbCalendar, useClass: NgbCalendarPersian },
|
|
770
|
-
{ provide: NgbDatepickerI18n, useClass: YsDatepickerI18nService },
|
|
771
|
-
{ provide: NgbDateParserFormatter, useClass: YsDateParserFormatterService }
|
|
772
|
-
], ngImport: i0, template: "<form class=\"row row-cols-sm-auto\">\r\n <div class=\"col-12\">\r\n <div class=\"dp-hidden position-absolute\">\r\n <div class=\"input-group\">\r\n <input name=\"datepicker\" class=\"form-control\" ngbDatepicker #datepicker=\"ngbDatepicker\"\r\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\"\r\n [dayTemplate]=\"customDay\" outsideDays=\"hidden\" [startDate]=\"fromDate!\" tabindex=\"-1\"\r\n [container]=\"container\" [markDisabled]=\"markDisabled\" [disabled]=\"disabled\"\r\n [footerTemplate]=\"footerTemplate\" [firstDayOfWeek]=\"firstDayOfWeek\" readonly />\r\n </div>\r\n </div>\r\n <div class=\"input-group\">\r\n <input #dpFromDate class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dpFromDate\"\r\n [value]=\"formatter.format(fromDate)\" (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\"\r\n [disabled]=\"disabled\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"col-12\">\r\n <div class=\"input-group\">\r\n <input #dpToDate class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dpToDate\"\r\n [value]=\"formatter.format(toDate)\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\"\r\n [disabled]=\"disabled\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\"\r\n [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\" [class.range]=\"isRange(date)\"\r\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\r\n (mouseleave)=\"hoveredDate = null\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"datepicker.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n <button class=\"btn btn-secondary btn-sm m-2 float-end\" (click)=\"datepicker.close()\">{{closeLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.dp-hidden{width:0;margin:0;border:none;padding:0}.custom-day.focused{background-color:var(--bs-gray-300)}.custom-day.range,.custom-day:hover{background-color:var(--bs-info);color:var(--bs-white)}.custom-day.faded{background-color:var(--bs-info);opacity:.5}\n"], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "directive", type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "contentTemplate", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
638
|
+
}
|
|
639
|
+
], ngImport: i0, template: "<div ngbDropdown #dropdown=\"ngbDropdown\" class=\"ys-datepicker-range-popup\" [container]=\"container()\">\n\n <div class=\"input-group\">\n\n <input type=\"text\" class=\"form-control\" readonly ngbDropdownToggle [value]=\"displayValue()\"\n [readonly]=\"readonly()\" [placeholder]=\"placeholder()\" [disabled]=\"isDisabled()\" />\n\n @if(value()) {\n\n <button type=\"button\" class=\"btn btn-outline-secondary\" [disabled]=\"isDisabled()\" (click)=\"clear($event)\">\n <i [class]=\"clearIconClass()\"></i>\n </button>\n\n }\n\n <button type=\"button\" class=\"btn btn-outline-secondary\" [disabled]=\"isDisabled()\" ngbDropdownToggle>\n <i [class]=\"calendarIconClass()\"></i>\n </button>\n\n </div>\n\n <div ngbDropdownMenu class=\"p-0 border-0 shadow\">\n\n <ys-datepicker-range [calendarType]=\"calendarType()\" [disabled]=\"isDisabled()\"\n [firstDayOfWeek]=\"firstDayOfWeek()\" [weekend]=\"weekend()\" [showFooter]=\"showFooter()\"\n [todayLabel]=\"todayLabel()\" [ngModel]=\"value()\" (ngModelChange)=\"valueChanged($event, dropdown)\"\n [outsideDays]=\"outsideDays()\" [displayMonths]=\"displayMonths()\">\n </ys-datepicker-range>\n\n </div>\n\n</div>", styles: [":host{display:block}.ys-datepicker-range-popup{width:100%}.ys-datepicker-range-popup .dropdown-toggle:after{display:none}.input-group{width:100%}.form-control[readonly]{cursor:pointer}.ys-datepicker-range-popup .input-group>input.dropdown-toggle{border-start-end-radius:0;border-end-end-radius:0}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NgbDropdownModule }, { kind: "directive", type: i1.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i1.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i1.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "component", type: YsDatepickerRange, selector: "ys-datepicker-range", inputs: ["calendarType", "disabled", "firstDayOfWeek", "weekend", "showFooter", "todayLabel", "outsideDays", "displayMonths"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
773
640
|
}
|
|
774
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
641
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepickerRangePopup, decorators: [{
|
|
775
642
|
type: Component,
|
|
776
|
-
args: [{ selector: 'ys-datepicker-range-popup
|
|
643
|
+
args: [{ selector: 'ys-datepicker-range-popup', imports: [
|
|
644
|
+
FormsModule,
|
|
645
|
+
NgbDropdownModule,
|
|
646
|
+
YsDatepickerRange
|
|
647
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
777
648
|
{
|
|
778
649
|
provide: NG_VALUE_ACCESSOR,
|
|
779
|
-
useExisting: forwardRef(() =>
|
|
650
|
+
useExisting: forwardRef(() => YsDatepickerRangePopup),
|
|
780
651
|
multi: true
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
{ provide: NgbDatepickerI18n, useClass: YsDatepickerI18nService },
|
|
785
|
-
{ provide: NgbDateParserFormatter, useClass: YsDateParserFormatterService }
|
|
786
|
-
], template: "<form class=\"row row-cols-sm-auto\">\r\n <div class=\"col-12\">\r\n <div class=\"dp-hidden position-absolute\">\r\n <div class=\"input-group\">\r\n <input name=\"datepicker\" class=\"form-control\" ngbDatepicker #datepicker=\"ngbDatepicker\"\r\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\"\r\n [dayTemplate]=\"customDay\" outsideDays=\"hidden\" [startDate]=\"fromDate!\" tabindex=\"-1\"\r\n [container]=\"container\" [markDisabled]=\"markDisabled\" [disabled]=\"disabled\"\r\n [footerTemplate]=\"footerTemplate\" [firstDayOfWeek]=\"firstDayOfWeek\" readonly />\r\n </div>\r\n </div>\r\n <div class=\"input-group\">\r\n <input #dpFromDate class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dpFromDate\"\r\n [value]=\"formatter.format(fromDate)\" (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\"\r\n [disabled]=\"disabled\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"col-12\">\r\n <div class=\"input-group\">\r\n <input #dpToDate class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dpToDate\"\r\n [value]=\"formatter.format(toDate)\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\"\r\n [disabled]=\"disabled\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\"\r\n [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\" [class.range]=\"isRange(date)\"\r\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\r\n (mouseleave)=\"hoveredDate = null\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"datepicker.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n <button class=\"btn btn-secondary btn-sm m-2 float-end\" (click)=\"datepicker.close()\">{{closeLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.dp-hidden{width:0;margin:0;border:none;padding:0}.custom-day.focused{background-color:var(--bs-gray-300)}.custom-day.range,.custom-day:hover{background-color:var(--bs-info);color:var(--bs-white)}.custom-day.faded{background-color:var(--bs-info);opacity:.5}\n"] }]
|
|
787
|
-
}], ctorParameters: () => [{ type: I18n }], propDecorators: { container: [{
|
|
788
|
-
type: Input
|
|
789
|
-
}], firstDayOfWeek: [{
|
|
790
|
-
type: Input
|
|
791
|
-
}], weekend: [{
|
|
792
|
-
type: Input
|
|
793
|
-
}], language: [{
|
|
794
|
-
type: Input
|
|
795
|
-
}], isFooter: [{
|
|
796
|
-
type: Input
|
|
797
|
-
}], closeLabel: [{
|
|
798
|
-
type: Input
|
|
799
|
-
}], todayLabel: [{
|
|
800
|
-
type: Input
|
|
801
|
-
}], footer: [{
|
|
802
|
-
type: Input
|
|
803
|
-
}], calendarIconClass: [{
|
|
804
|
-
type: Input
|
|
805
|
-
}], disabled: [{
|
|
806
|
-
type: Input
|
|
807
|
-
}] } });
|
|
652
|
+
}
|
|
653
|
+
], template: "<div ngbDropdown #dropdown=\"ngbDropdown\" class=\"ys-datepicker-range-popup\" [container]=\"container()\">\n\n <div class=\"input-group\">\n\n <input type=\"text\" class=\"form-control\" readonly ngbDropdownToggle [value]=\"displayValue()\"\n [readonly]=\"readonly()\" [placeholder]=\"placeholder()\" [disabled]=\"isDisabled()\" />\n\n @if(value()) {\n\n <button type=\"button\" class=\"btn btn-outline-secondary\" [disabled]=\"isDisabled()\" (click)=\"clear($event)\">\n <i [class]=\"clearIconClass()\"></i>\n </button>\n\n }\n\n <button type=\"button\" class=\"btn btn-outline-secondary\" [disabled]=\"isDisabled()\" ngbDropdownToggle>\n <i [class]=\"calendarIconClass()\"></i>\n </button>\n\n </div>\n\n <div ngbDropdownMenu class=\"p-0 border-0 shadow\">\n\n <ys-datepicker-range [calendarType]=\"calendarType()\" [disabled]=\"isDisabled()\"\n [firstDayOfWeek]=\"firstDayOfWeek()\" [weekend]=\"weekend()\" [showFooter]=\"showFooter()\"\n [todayLabel]=\"todayLabel()\" [ngModel]=\"value()\" (ngModelChange)=\"valueChanged($event, dropdown)\"\n [outsideDays]=\"outsideDays()\" [displayMonths]=\"displayMonths()\">\n </ys-datepicker-range>\n\n </div>\n\n</div>", styles: [":host{display:block}.ys-datepicker-range-popup{width:100%}.ys-datepicker-range-popup .dropdown-toggle:after{display:none}.input-group{width:100%}.form-control[readonly]{cursor:pointer}.ys-datepicker-range-popup .input-group>input.dropdown-toggle{border-start-end-radius:0;border-end-end-radius:0}\n"] }]
|
|
654
|
+
}], propDecorators: { calendarType: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarType", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], weekend: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekend", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], outsideDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "outsideDays", required: false }] }], displayMonths: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMonths", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClose", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], calendarIconClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarIconClass", required: false }] }], clearIconClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearIconClass", required: false }] }] } });
|
|
808
655
|
|
|
809
|
-
class
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
}
|
|
832
|
-
set language(value) {
|
|
833
|
-
this._language = value;
|
|
834
|
-
this.i18N.language = this._language;
|
|
835
|
-
}
|
|
836
|
-
isFooter = true;
|
|
837
|
-
closeLabel = "Close";
|
|
838
|
-
todayLabel = "Today";
|
|
839
|
-
footer = null;
|
|
840
|
-
calendarIconClass = "fa-solid fa-calendar-days";
|
|
841
|
-
disabled = false;
|
|
842
|
-
onChange = () => { };
|
|
656
|
+
class YsDatepicker {
|
|
657
|
+
calendarType = input('gregorian', /* @ts-ignore */
|
|
658
|
+
...(ngDevMode ? [{ debugName: "calendarType" }] : /* istanbul ignore next */ []));
|
|
659
|
+
disabled = input(false, /* @ts-ignore */
|
|
660
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
661
|
+
firstDayOfWeek = input(/* @ts-ignore */
|
|
662
|
+
...(ngDevMode ? [undefined, { debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
663
|
+
weekend = input(/* @ts-ignore */
|
|
664
|
+
...(ngDevMode ? [undefined, { debugName: "weekend" }] : /* istanbul ignore next */ []));
|
|
665
|
+
showFooter = input(true, /* @ts-ignore */
|
|
666
|
+
...(ngDevMode ? [{ debugName: "showFooter" }] : /* istanbul ignore next */ []));
|
|
667
|
+
todayLabel = input(/* @ts-ignore */
|
|
668
|
+
...(ngDevMode ? [undefined, { debugName: "todayLabel" }] : /* istanbul ignore next */ []));
|
|
669
|
+
outsideDays = input('visible', /* @ts-ignore */
|
|
670
|
+
...(ngDevMode ? [{ debugName: "outsideDays" }] : /* istanbul ignore next */ []));
|
|
671
|
+
disabledState = signal(false, /* @ts-ignore */
|
|
672
|
+
...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
|
|
673
|
+
isDisabled = computed(() => this.disabled() ||
|
|
674
|
+
this.disabledState(), /* @ts-ignore */
|
|
675
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
676
|
+
value = signal(null, /* @ts-ignore */
|
|
677
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
678
|
+
onChange = (_) => { };
|
|
843
679
|
onTouched = () => { };
|
|
844
|
-
|
|
845
|
-
this.
|
|
846
|
-
}
|
|
847
|
-
writeValue(obj) {
|
|
848
|
-
if (!obj) {
|
|
849
|
-
this.fromDate = null;
|
|
850
|
-
this.toDate = null;
|
|
851
|
-
return;
|
|
852
|
-
}
|
|
853
|
-
let d = obj;
|
|
854
|
-
var fDate = d.fromDate;
|
|
855
|
-
this.fromDate = { year: fDate.getFullYear(), month: (fDate.getMonth() + 1), day: fDate.getDate() };
|
|
856
|
-
var tDate = d.toDate;
|
|
857
|
-
this.toDate = { year: tDate.getFullYear(), month: (tDate.getMonth() + 1), day: tDate.getDate() };
|
|
680
|
+
writeValue(value) {
|
|
681
|
+
this.value.set(value ?? null);
|
|
858
682
|
}
|
|
859
683
|
registerOnChange(fn) {
|
|
860
684
|
this.onChange = fn;
|
|
@@ -863,96 +687,35 @@ class YsDatepickerRangePopupComponent {
|
|
|
863
687
|
this.onTouched = fn;
|
|
864
688
|
}
|
|
865
689
|
setDisabledState(isDisabled) {
|
|
866
|
-
this.
|
|
690
|
+
this.disabledState.set(isDisabled);
|
|
867
691
|
}
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
else if (this.fromDate && !this.toDate && date && date.after(this.fromDate)) {
|
|
873
|
-
this.toDate = date;
|
|
874
|
-
}
|
|
875
|
-
else {
|
|
876
|
-
this.toDate = null;
|
|
877
|
-
this.fromDate = date;
|
|
878
|
-
}
|
|
879
|
-
this.valueChanged();
|
|
880
|
-
}
|
|
881
|
-
isHovered(date) {
|
|
882
|
-
return (this.fromDate && !this.toDate && this.hoveredDate && date.after(this.fromDate) && date.before(this.hoveredDate));
|
|
692
|
+
valueChanged(value) {
|
|
693
|
+
this.value.set(value);
|
|
694
|
+
this.onChange(value);
|
|
695
|
+
this.onTouched();
|
|
883
696
|
}
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
}
|
|
887
|
-
isRange(date) {
|
|
888
|
-
return (date.equals(this.fromDate) ||
|
|
889
|
-
(this.toDate && date.equals(this.toDate)) ||
|
|
890
|
-
this.isInside(date) ||
|
|
891
|
-
this.isHovered(date));
|
|
892
|
-
}
|
|
893
|
-
markDisabled = (date, current) => date.month !== current?.month;
|
|
894
|
-
isWeekend = (date) => this.weekend.includes(this.calendar.getWeekday(date));
|
|
895
|
-
validateInput(currentValue, input) {
|
|
896
|
-
const parsed = this.formatter.parse(input);
|
|
897
|
-
return parsed && this.calendar.isValid(NgbDate.from(parsed)) ? NgbDate.from(parsed) : currentValue;
|
|
898
|
-
}
|
|
899
|
-
valueChanged() {
|
|
900
|
-
const fromDateTemp = this.fromDate ? new Date(this.fromDate.year, this.fromDate.month - 1, this.fromDate.day) : null;
|
|
901
|
-
const toDateTemp = this.toDate ? new Date(this.toDate.year, this.toDate.month - 1, this.toDate.day) : null;
|
|
902
|
-
const res = { fromDate: fromDateTemp, toDate: toDateTemp };
|
|
903
|
-
this.onChange(res);
|
|
904
|
-
this.onTouched(res);
|
|
905
|
-
}
|
|
906
|
-
setToday() {
|
|
907
|
-
this.fromDate = this.today;
|
|
908
|
-
this.toDate = this.today;
|
|
909
|
-
this.valueChanged();
|
|
910
|
-
}
|
|
911
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: YsDatepickerRangePopupComponent, deps: [{ token: I18n }], target: i0.ɵɵFactoryTarget.Component });
|
|
912
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: YsDatepickerRangePopupComponent, isStandalone: true, selector: "ys-datepicker-range-popup", inputs: { container: "container", firstDayOfWeek: "firstDayOfWeek", weekend: "weekend", language: "language", isFooter: "isFooter", closeLabel: "closeLabel", todayLabel: "todayLabel", footer: "footer", calendarIconClass: "calendarIconClass", disabled: "disabled" }, providers: [
|
|
697
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
698
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: YsDatepicker, isStandalone: true, selector: "ys-datepicker", inputs: { calendarType: { classPropertyName: "calendarType", publicName: "calendarType", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, weekend: { classPropertyName: "weekend", publicName: "weekend", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, todayLabel: { classPropertyName: "todayLabel", publicName: "todayLabel", isSignal: true, isRequired: false, transformFunction: null }, outsideDays: { classPropertyName: "outsideDays", publicName: "outsideDays", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
913
699
|
{
|
|
914
700
|
provide: NG_VALUE_ACCESSOR,
|
|
915
|
-
useExisting: forwardRef(() =>
|
|
701
|
+
useExisting: forwardRef(() => YsDatepicker),
|
|
916
702
|
multi: true
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
{ provide: NgbDatepickerI18n, useClass: YsDatepickerI18nService },
|
|
920
|
-
{ provide: NgbDateParserFormatter, useClass: YsDateParserFormatterService }
|
|
921
|
-
], ngImport: i0, template: "<form class=\"row row-cols-sm-auto\">\r\n <div class=\"col-12\">\r\n <div class=\"dp-hidden position-absolute\">\r\n <div class=\"input-group\">\r\n <input name=\"datepicker\" class=\"form-control\" ngbDatepicker #datepicker=\"ngbDatepicker\"\r\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\"\r\n [dayTemplate]=\"customDay\" outsideDays=\"hidden\" [startDate]=\"fromDate!\" tabindex=\"-1\"\r\n [container]=\"container\" [markDisabled]=\"markDisabled\" [disabled]=\"disabled\"\r\n [footerTemplate]=\"footerTemplate\" [firstDayOfWeek]=\"firstDayOfWeek\" readonly />\r\n </div>\r\n </div>\r\n <div class=\"input-group\">\r\n <input #dpFromDate class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dpFromDate\"\r\n [value]=\"formatter.format(fromDate)\" (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\"\r\n [disabled]=\"disabled\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"col-12\">\r\n <div class=\"input-group\">\r\n <input #dpToDate class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dpToDate\"\r\n [value]=\"formatter.format(toDate)\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\"\r\n [disabled]=\"disabled\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\"\r\n [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\" [class.range]=\"isRange(date)\"\r\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\r\n (mouseleave)=\"hoveredDate = null\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"datepicker.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n <button class=\"btn btn-secondary btn-sm m-2 float-end\" (click)=\"datepicker.close()\">{{closeLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.dp-hidden{width:0;margin:0;border:none;padding:0}.custom-day.focused{background-color:var(--bs-gray-300)}.custom-day.range,.custom-day:hover{background-color:var(--bs-info);color:var(--bs-white)}.custom-day.faded{background-color:var(--bs-info);opacity:.5}\n"], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "directive", type: i2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "contentTemplate", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
703
|
+
}
|
|
704
|
+
], ngImport: i0, template: "@if(calendarType() === 'jalali') {\n\n<ys-datepicker-jalali [value]=\"value()\" [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 6\"\n [weekend]=\"weekend() ?? [5]\" [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? '\u0627\u0645\u0631\u0648\u0632'\"\n (valueChange)=\"valueChanged($event)\" [outsideDays]=\"outsideDays()\">\n</ys-datepicker-jalali>\n\n}\n@else {\n\n<ys-datepicker-gregorian [value]=\"value()\" [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 1\"\n [weekend]=\"weekend() ?? [6,7]\" [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? 'Today'\"\n (valueChange)=\"valueChanged($event)\" [outsideDays]=\"outsideDays()\">\n</ys-datepicker-gregorian>\n\n}", styles: [""], dependencies: [{ kind: "component", type: YsDatepickerGregorian, selector: "ys-datepicker-gregorian", inputs: ["value", "disabled", "firstDayOfWeek", "weekend", "showFooter", "todayLabel", "outsideDays", "displayMonths", "rangeMode", "fromDate", "toDate", "hoveredDate"], outputs: ["valueChange", "dateSelect", "dateHover"] }, { kind: "component", type: YsDatepickerJalali, selector: "ys-datepicker-jalali", inputs: ["value", "disabled", "firstDayOfWeek", "weekend", "showFooter", "todayLabel", "outsideDays", "displayMonths", "rangeMode", "fromDate", "toDate", "hoveredDate"], outputs: ["valueChange", "dateSelect", "dateHover"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
922
705
|
}
|
|
923
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsDatepicker, decorators: [{
|
|
924
707
|
type: Component,
|
|
925
|
-
args: [{ selector: 'ys-datepicker
|
|
708
|
+
args: [{ selector: 'ys-datepicker', imports: [
|
|
709
|
+
YsDatepickerGregorian,
|
|
710
|
+
YsDatepickerJalali
|
|
711
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
926
712
|
{
|
|
927
713
|
provide: NG_VALUE_ACCESSOR,
|
|
928
|
-
useExisting: forwardRef(() =>
|
|
714
|
+
useExisting: forwardRef(() => YsDatepicker),
|
|
929
715
|
multi: true
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
{ provide: NgbDateParserFormatter, useClass: YsDateParserFormatterService }
|
|
934
|
-
], template: "<form class=\"row row-cols-sm-auto\">\r\n <div class=\"col-12\">\r\n <div class=\"dp-hidden position-absolute\">\r\n <div class=\"input-group\">\r\n <input name=\"datepicker\" class=\"form-control\" ngbDatepicker #datepicker=\"ngbDatepicker\"\r\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\"\r\n [dayTemplate]=\"customDay\" outsideDays=\"hidden\" [startDate]=\"fromDate!\" tabindex=\"-1\"\r\n [container]=\"container\" [markDisabled]=\"markDisabled\" [disabled]=\"disabled\"\r\n [footerTemplate]=\"footerTemplate\" [firstDayOfWeek]=\"firstDayOfWeek\" readonly />\r\n </div>\r\n </div>\r\n <div class=\"input-group\">\r\n <input #dpFromDate class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dpFromDate\"\r\n [value]=\"formatter.format(fromDate)\" (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\"\r\n [disabled]=\"disabled\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"col-12\">\r\n <div class=\"input-group\">\r\n <input #dpToDate class=\"form-control\" placeholder=\"yyyy/mm/dd\" name=\"dpToDate\"\r\n [value]=\"formatter.format(toDate)\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\"\r\n [disabled]=\"disabled\" readonly />\r\n <button class=\"btn btn-outline-secondary\" (click)=\"datepicker.toggle()\" type=\"button\" [disabled]=\"disabled\">\r\n <i class=\"{{calendarIconClass}}\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <ng-template #customDay let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\"\r\n let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.weekend]=\"isWeekend(date)\" [class.focused]=\"focused\"\r\n [class.hidden]=\"date.month !== currentMonth\" [class.text-muted]=\"disabled\" [class.range]=\"isRange(date)\"\r\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\r\n (mouseleave)=\"hoveredDate = null\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n\r\n <ng-template #footerTemplate>\r\n @if (isFooter) {\r\n <span>\r\n <hr class=\"my-0\" />\r\n @if (footer) {\r\n <span>\r\n {{footer}}\r\n </span>\r\n }\r\n @if (!footer) {\r\n <span>\r\n <button class=\"btn btn-primary btn-sm m-2 float-start\" (click)=\"datepicker.navigateTo(); setToday();\"\r\n [disabled]=\"disabled\">{{todayLabel}}</button>\r\n <button class=\"btn btn-secondary btn-sm m-2 float-end\" (click)=\"datepicker.close()\">{{closeLabel}}</button>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </ng-template>", styles: ["::ng-deep html[dir=rtl] .ngb-dp-arrow-prev .ngb-dp-navigation-chevron{transform:rotate(45deg)}::ng-deep html[dir=rtl] .ngb-dp-arrow-next .ngb-dp-navigation-chevron{transform:rotate(-135deg)}::ng-deep html[dir=rtl] .form-select{background-position:left .75rem center}::ng-deep html[dir=rtl] .ngb-dp-month:first-child .ngb-dp-week{padding-right:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month:last-child .ngb-dp-week{padding-left:.25rem}::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,::ng-deep html[dir=rtl] .ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-right:1rem}::ng-deep html[dir=rtl] .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3),::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-control,::ng-deep html[dir=rtl] .input-group:not(.has-validation)>.form-floating:not(:last-child)>.form-select{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}::ng-deep html[dir=rtl] .input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback){margin-right:calc(var(--bs-border-width) * -1);border-top-left-radius:.375rem;border-bottom-left-radius:.375rem;border-top-right-radius:0;border-bottom-right-radius:0}::ng-deep .ngb-dp-day{display:flex;align-items:center}.custom-day{text-align:center;padding:.185rem .25rem;border-radius:.25rem;display:inline-block;width:2rem;height:2rem;line-height:1.7}.weekend{color:var(--bs-danger)}.dp-hidden{width:0;margin:0;border:none;padding:0}.custom-day.focused{background-color:var(--bs-gray-300)}.custom-day.range,.custom-day:hover{background-color:var(--bs-info);color:var(--bs-white)}.custom-day.faded{background-color:var(--bs-info);opacity:.5}\n"] }]
|
|
935
|
-
}], ctorParameters: () => [{ type: I18n }], propDecorators: { container: [{
|
|
936
|
-
type: Input
|
|
937
|
-
}], firstDayOfWeek: [{
|
|
938
|
-
type: Input
|
|
939
|
-
}], weekend: [{
|
|
940
|
-
type: Input
|
|
941
|
-
}], language: [{
|
|
942
|
-
type: Input
|
|
943
|
-
}], isFooter: [{
|
|
944
|
-
type: Input
|
|
945
|
-
}], closeLabel: [{
|
|
946
|
-
type: Input
|
|
947
|
-
}], todayLabel: [{
|
|
948
|
-
type: Input
|
|
949
|
-
}], footer: [{
|
|
950
|
-
type: Input
|
|
951
|
-
}], calendarIconClass: [{
|
|
952
|
-
type: Input
|
|
953
|
-
}], disabled: [{
|
|
954
|
-
type: Input
|
|
955
|
-
}] } });
|
|
716
|
+
}
|
|
717
|
+
], template: "@if(calendarType() === 'jalali') {\n\n<ys-datepicker-jalali [value]=\"value()\" [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 6\"\n [weekend]=\"weekend() ?? [5]\" [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? '\u0627\u0645\u0631\u0648\u0632'\"\n (valueChange)=\"valueChanged($event)\" [outsideDays]=\"outsideDays()\">\n</ys-datepicker-jalali>\n\n}\n@else {\n\n<ys-datepicker-gregorian [value]=\"value()\" [disabled]=\"isDisabled()\" [firstDayOfWeek]=\"firstDayOfWeek() ?? 1\"\n [weekend]=\"weekend() ?? [6,7]\" [showFooter]=\"showFooter()\" [todayLabel]=\"todayLabel() ?? 'Today'\"\n (valueChange)=\"valueChanged($event)\" [outsideDays]=\"outsideDays()\">\n</ys-datepicker-gregorian>\n\n}" }]
|
|
718
|
+
}], propDecorators: { calendarType: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarType", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], weekend: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekend", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], todayLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "todayLabel", required: false }] }], outsideDays: [{ type: i0.Input, args: [{ isSignal: true, alias: "outsideDays", required: false }] }] } });
|
|
956
719
|
|
|
957
720
|
/*
|
|
958
721
|
* Public API Surface of ys-datepicker
|
|
@@ -962,5 +725,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
|
|
|
962
725
|
* Generated bundle index. Do not edit.
|
|
963
726
|
*/
|
|
964
727
|
|
|
965
|
-
export {
|
|
728
|
+
export { YsDatepicker, YsDatepickerPopup, YsDatepickerRange, YsDatepickerRangePopup };
|
|
966
729
|
//# sourceMappingURL=yoozsoft-yoozsoft-ng-datepicker.mjs.map
|