mis-crystal-design-system 2.2.5 → 2.3.3
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/bundles/mis-crystal-design-system-datepicker_v2.umd.js +654 -0
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.js.map +1 -0
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.min.js +16 -0
- package/bundles/mis-crystal-design-system-datepicker_v2.umd.min.js.map +1 -0
- package/datepicker_v2/datepicker-constants.d.ts +4 -0
- package/datepicker_v2/datepicker.module.d.ts +2 -0
- package/datepicker_v2/index.d.ts +1 -0
- package/datepicker_v2/mis-crystal-design-system-datepicker_v2.d.ts +7 -0
- package/datepicker_v2/mis-crystal-design-system-datepicker_v2.metadata.json +1 -0
- package/datepicker_v2/models/dp-config.model.d.ts +30 -0
- package/datepicker_v2/package.json +11 -0
- package/datepicker_v2/public_api.d.ts +3 -0
- package/datepicker_v2/tz-datepicker.directive.d.ts +29 -0
- package/datepicker_v2/tz-dp-container/tz-dp-container.component.d.ts +23 -0
- package/datepicker_v2/utils/index.d.ts +2 -0
- package/esm2015/datepicker/sub-components/tooltip/tooltip.config.js +2 -3
- package/esm2015/datepicker_v2/datepicker-constants.js +5 -0
- package/esm2015/datepicker_v2/datepicker.module.js +16 -0
- package/esm2015/datepicker_v2/index.js +2 -0
- package/esm2015/datepicker_v2/mis-crystal-design-system-datepicker_v2.js +7 -0
- package/esm2015/datepicker_v2/models/dp-config.model.js +2 -0
- package/esm2015/datepicker_v2/public_api.js +3 -0
- package/esm2015/datepicker_v2/tz-datepicker.directive.js +118 -0
- package/esm2015/datepicker_v2/tz-dp-container/tz-dp-container.component.js +123 -0
- package/esm2015/datepicker_v2/utils/index.js +45 -0
- package/fesm2015/mis-crystal-design-system-datepicker_v2.js +304 -0
- package/fesm2015/mis-crystal-design-system-datepicker_v2.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { InjectionToken, Component, Inject, EventEmitter, Injector, Directive, Self, Optional, ElementRef, ViewContainerRef, Input, Output, HostListener, NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { parseZone } from 'moment-timezone';
|
|
4
|
+
import { ToastService, ToastModule } from 'mis-crystal-design-system/toast';
|
|
5
|
+
import { OverlayConfig, ConnectionPositionPair, Overlay } from '@angular/cdk/overlay';
|
|
6
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
7
|
+
import { NgControl } from '@angular/forms';
|
|
8
|
+
import { take } from 'rxjs/operators';
|
|
9
|
+
|
|
10
|
+
/** @format */
|
|
11
|
+
const CONTAINER_DATA = new InjectionToken('CONTAINER_DATA');
|
|
12
|
+
const DATE_FORMAT = "DD-MM-YYYY";
|
|
13
|
+
|
|
14
|
+
const getMonth = (index) => {
|
|
15
|
+
let month;
|
|
16
|
+
switch (index) {
|
|
17
|
+
case 0:
|
|
18
|
+
month = 'January';
|
|
19
|
+
break;
|
|
20
|
+
case 1:
|
|
21
|
+
month = 'February';
|
|
22
|
+
break;
|
|
23
|
+
case 2:
|
|
24
|
+
month = 'March';
|
|
25
|
+
break;
|
|
26
|
+
case 3:
|
|
27
|
+
month = 'April';
|
|
28
|
+
break;
|
|
29
|
+
case 4:
|
|
30
|
+
month = 'May';
|
|
31
|
+
break;
|
|
32
|
+
case 5:
|
|
33
|
+
month = 'June';
|
|
34
|
+
break;
|
|
35
|
+
case 6:
|
|
36
|
+
month = 'July';
|
|
37
|
+
break;
|
|
38
|
+
case 7:
|
|
39
|
+
month = 'August';
|
|
40
|
+
break;
|
|
41
|
+
case 8:
|
|
42
|
+
month = 'September';
|
|
43
|
+
break;
|
|
44
|
+
case 9:
|
|
45
|
+
month = 'October';
|
|
46
|
+
break;
|
|
47
|
+
case 10:
|
|
48
|
+
month = 'November';
|
|
49
|
+
break;
|
|
50
|
+
case 11:
|
|
51
|
+
month = 'December';
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
return month;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
class TzDpContainerComponent {
|
|
60
|
+
constructor(data, toast) {
|
|
61
|
+
var _a, _b, _c, _d;
|
|
62
|
+
this.toast = toast;
|
|
63
|
+
this.parseZoneInstance = (...args) => {
|
|
64
|
+
return parseZone(...args);
|
|
65
|
+
};
|
|
66
|
+
this.rawWeekDays = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
|
|
67
|
+
this.weekDays = [];
|
|
68
|
+
this.currentMonthDates = [];
|
|
69
|
+
this.isPreviousMonthDisabled = false;
|
|
70
|
+
this.isNextMonthDisabled = false;
|
|
71
|
+
this.data = data;
|
|
72
|
+
if ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.dpConfig) === null || _b === void 0 ? void 0 : _b.timezone) {
|
|
73
|
+
this.parseZoneInstance = (...args) => {
|
|
74
|
+
return parseZone(...args).tz(this.data.dpConfig.timezone);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
this.currentMonthNumber = this.parseZoneInstance().month();
|
|
78
|
+
this.currentMonth = getMonth(this.currentMonthNumber);
|
|
79
|
+
this.currentYearNumber = this.parseZoneInstance().year();
|
|
80
|
+
this.weekDays = this.rawWeekDays.map((day, index) => ({
|
|
81
|
+
label: `${day[0]}${day.slice(1).toLowerCase()}`,
|
|
82
|
+
isCurrentDay: this.parseZoneInstance().day() === index,
|
|
83
|
+
}));
|
|
84
|
+
if (!((_d = (_c = this.data) === null || _c === void 0 ? void 0 : _c.dpConfig) === null || _d === void 0 ? void 0 : _d.format)) {
|
|
85
|
+
this.data.dpConfig = Object.assign(Object.assign({}, this.data.dpConfig), { format: DATE_FORMAT });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
ngOnInit() {
|
|
89
|
+
this.currentDateInstance();
|
|
90
|
+
this.calculateMinMaxDays();
|
|
91
|
+
}
|
|
92
|
+
currentDateInstance() {
|
|
93
|
+
const selectedDate = parseZone(this.data.date, this.data.dpConfig.format);
|
|
94
|
+
if (selectedDate.isValid()) {
|
|
95
|
+
this.currentYearNumber = selectedDate.year();
|
|
96
|
+
this.currentMonthNumber = selectedDate.month();
|
|
97
|
+
this.currentMonth = getMonth(this.currentMonthNumber);
|
|
98
|
+
}
|
|
99
|
+
this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);
|
|
100
|
+
}
|
|
101
|
+
calculateMinMaxDays() {
|
|
102
|
+
const currentInstance = this.parseZoneInstance().year(this.currentYearNumber).month(this.currentMonthNumber);
|
|
103
|
+
const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);
|
|
104
|
+
if (minDate.isValid()) {
|
|
105
|
+
this.isPreviousMonthDisabled = minDate.isSameOrAfter(currentInstance, 'month');
|
|
106
|
+
}
|
|
107
|
+
const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);
|
|
108
|
+
if (maxDate.isValid()) {
|
|
109
|
+
this.isNextMonthDisabled = maxDate.isSameOrBefore(currentInstance, 'month');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
navigateMonth(direction) {
|
|
113
|
+
let thisMonth = parseZone().year(this.currentYearNumber).month(this.currentMonthNumber);
|
|
114
|
+
if (direction === "NEXT") {
|
|
115
|
+
thisMonth = thisMonth.add(1, 'month');
|
|
116
|
+
}
|
|
117
|
+
else if (direction === "PREVIOUS") {
|
|
118
|
+
thisMonth = thisMonth.subtract(1, 'month');
|
|
119
|
+
}
|
|
120
|
+
this.currentMonthNumber = thisMonth.month();
|
|
121
|
+
this.currentMonth = getMonth(this.currentMonthNumber);
|
|
122
|
+
this.currentYearNumber = thisMonth.year();
|
|
123
|
+
this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);
|
|
124
|
+
this.calculateMinMaxDays();
|
|
125
|
+
}
|
|
126
|
+
generateDates(month, currentYearNumber) {
|
|
127
|
+
var _a;
|
|
128
|
+
let dates = [];
|
|
129
|
+
const thisMonth = parseZone().year(currentYearNumber).month(month);
|
|
130
|
+
for (let startDate = 1; startDate <= thisMonth.endOf('month').date(); startDate++) {
|
|
131
|
+
let isDisabledDay = this.data.datesDisabled.some(d => d === thisMonth.date(startDate).format(this.data.dpConfig.format));
|
|
132
|
+
const minDate = parseZone(this.data.dpConfig.minDate, this.data.dpConfig.format);
|
|
133
|
+
if (!isDisabledDay && minDate.isValid()) {
|
|
134
|
+
isDisabledDay = minDate.isAfter(thisMonth.date(startDate), 'day');
|
|
135
|
+
}
|
|
136
|
+
const maxDate = parseZone(this.data.dpConfig.maxDate, this.data.dpConfig.format);
|
|
137
|
+
if (!isDisabledDay && maxDate.isValid()) {
|
|
138
|
+
isDisabledDay = maxDate.isBefore(thisMonth.date(startDate), 'day');
|
|
139
|
+
}
|
|
140
|
+
dates.push({
|
|
141
|
+
date: startDate,
|
|
142
|
+
weekDay: thisMonth.date(startDate).day(),
|
|
143
|
+
isCurrentDay: this.parseZoneInstance().year(currentYearNumber).month(month).date(startDate).date(startDate).isSame(parseZone(), 'day'),
|
|
144
|
+
isSelectedDay: thisMonth.date(startDate).isSame(parseZone(this.data.date, this.data.dpConfig.format), 'day'),
|
|
145
|
+
toastMessage: ((_a = this.data.messages.find(q => thisMonth.date(startDate).isSame(parseZone(q.date, this.data.dpConfig.format), 'day'))) === null || _a === void 0 ? void 0 : _a.message) || '',
|
|
146
|
+
isDisabledDay,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
for (let i = dates[0].weekDay; i > 0; i--) {
|
|
150
|
+
dates.unshift({ date: 0, weekDay: i - 1 });
|
|
151
|
+
}
|
|
152
|
+
return dates;
|
|
153
|
+
}
|
|
154
|
+
selectDay(day) {
|
|
155
|
+
if (day.date <= 0)
|
|
156
|
+
return;
|
|
157
|
+
if (!day.isDisabledDay) {
|
|
158
|
+
this.data.dateChange(parseZone().year(this.currentYearNumber).month(this.currentMonthNumber).date(day.date).format(this.data.dpConfig.format));
|
|
159
|
+
}
|
|
160
|
+
if (day.toastMessage) {
|
|
161
|
+
this.toast.displayMsg(day.toastMessage, 4000);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
TzDpContainerComponent.decorators = [
|
|
166
|
+
{ type: Component, args: [{
|
|
167
|
+
selector: "mis-tz-dp",
|
|
168
|
+
template: "<div class=\"datepicker-container\">\n <div class=\"datepicker-container__header\">\n <div\n class=\"datepicker-container__arrow__icon\"\n (click)=\"!isPreviousMonthDisabled && navigateMonth('PREVIOUS')\"\n [ngClass]=\"{\n 'disabled-month': isPreviousMonthDisabled\n }\"\n >\n <svg\n width=\"20\"\n height=\"16\"\n viewBox=\"0 0 20 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M19.7071 8.70711C20.0976 8.31658 20.0976 7.68342 19.7071 7.29289L13.3431 0.928933C12.9526 0.538409 12.3195 0.538409 11.9289 0.928933C11.5384 1.31946 11.5384 1.95262 11.9289 2.34315L17.5858 8L11.9289 13.6569C11.5384 14.0474 11.5384 14.6805 11.9289 15.0711C12.3195 15.4616 12.9526 15.4616 13.3431 15.0711L19.7071 8.70711ZM-8.74228e-08 9L19 9L19 7L8.74228e-08 7L-8.74228e-08 9Z\"\n fill=\"#181F33\"\n ></path>\n </svg>\n </div>\n <span> {{ currentMonth }} {{ currentYearNumber }} </span>\n <div\n class=\"datepicker-container__arrow__icon\"\n (click)=\"!isNextMonthDisabled && navigateMonth('NEXT')\"\n [ngClass]=\"{\n 'disabled-month': isNextMonthDisabled\n }\"\n >\n <svg\n width=\"20\"\n height=\"16\"\n viewBox=\"0 0 20 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M19.7071 8.70711C20.0976 8.31658 20.0976 7.68342 19.7071 7.29289L13.3431 0.928933C12.9526 0.538409 12.3195 0.538409 11.9289 0.928933C11.5384 1.31946 11.5384 1.95262 11.9289 2.34315L17.5858 8L11.9289 13.6569C11.5384 14.0474 11.5384 14.6805 11.9289 15.0711C12.3195 15.4616 12.9526 15.4616 13.3431 15.0711L19.7071 8.70711ZM-8.74228e-08 9L19 9L19 7L8.74228e-08 7L-8.74228e-08 9Z\"\n fill=\"#181F33\"\n ></path>\n </svg>\n </div>\n </div>\n <div class=\"datepicker-container__body\">\n <div class=\"datepicker-container__weekdays\">\n <div\n class=\"datepicker-container__weekday\"\n *ngFor=\"let weekDay of weekDays\"\n >\n <span [ngClass]=\"{ 'current-day': weekDay.isCurrentDay }\">{{\n weekDay.label\n }}</span>\n </div>\n </div>\n <div class=\"datepicker-container__days\">\n <div\n class=\"datepicker-container__day\"\n [ngClass]=\"{\n 'selected-day': day.isSelectedDay,\n 'disabled-day': day.isDisabledDay,\n 'is-valid-date': day.date > 0 && !day.isSelectedDay\n }\"\n *ngFor=\"let day of currentMonthDates\"\n (click)=\"selectDay(day)\"\n >\n <span\n *ngIf=\"day.date > 0\"\n [ngClass]=\"{\n 'current-day': day.isCurrentDay,\n 'selected-day': day.isSelectedDay,\n 'disabled-day': day.isDisabledDay\n }\"\n >\n {{ day.date }}\n </span>\n </div>\n </div>\n </div>\n</div>\n",
|
|
169
|
+
styles: [".datepicker-container{background:#fff;border:1px solid #e0e0e0;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:12px;display:flex;flex-direction:column;padding:16px;font-family:Lato;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.datepicker-container .datepicker-container__header{display:flex;height:32px;justify-content:space-between;align-items:center;width:100%}.datepicker-container .datepicker-container__header span{font-size:16px;font-style:normal;font-weight:700;line-height:24px;letter-spacing:.2px;text-align:center}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon{height:20px;width:20px;display:flex;align-items:center;justify-content:center;border-radius:4px;padding:4px}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon.disabled-month{opacity:.5;cursor:not-allowed}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon:not(.disabled-month):hover{cursor:pointer;background-color:#cbddfb}.datepicker-container .datepicker-container__header .datepicker-container__arrow__icon:first-child{transform:rotate(180deg)}.datepicker-container .datepicker-container__body{height:100%;width:252px}.datepicker-container .datepicker-container__body .datepicker-container__weekdays{width:100%;display:flex;padding-bottom:10px}.datepicker-container .datepicker-container__body .datepicker-container__weekdays .datepicker-container__weekday{width:36px;height:18px;text-align:center}.datepicker-container .datepicker-container__body .datepicker-container__weekdays .datepicker-container__weekday span{font-size:12px;font-style:normal;font-weight:400;line-height:18px;letter-spacing:.2px;text-align:center;color:#6a737d}.datepicker-container .datepicker-container__body .datepicker-container__weekdays .datepicker-container__weekday span.current-day{font-weight:700;letter-spacing:.25px;color:#181f33}.datepicker-container .datepicker-container__body .datepicker-container__days{display:flex;flex-wrap:wrap;gap:2px}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:4px}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.selected-day{background-color:#0937b2;cursor:pointer}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.disabled-day{cursor:default}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.disabled-day:hover{background-color:transparent}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.is-valid-date:not(.disabled-day):hover{background-color:#cbddfb;cursor:pointer}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day.is-valid-date:not(.disabled-day):hover span.selected-day{color:#181f33!important}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span{font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.2px;text-align:center;color:#181f33}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span.current-day{font-weight:700;letter-spacing:.25px}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span.selected-day{color:#fff}.datepicker-container .datepicker-container__body .datepicker-container__days .datepicker-container__day span.disabled-day{color:#6a737d}"]
|
|
170
|
+
},] }
|
|
171
|
+
];
|
|
172
|
+
TzDpContainerComponent.ctorParameters = () => [
|
|
173
|
+
{ type: undefined, decorators: [{ type: Inject, args: [CONTAINER_DATA,] }] },
|
|
174
|
+
{ type: ToastService }
|
|
175
|
+
];
|
|
176
|
+
|
|
177
|
+
class TzDatepickerDirective {
|
|
178
|
+
constructor(control, element, overlay, viewContainerRef) {
|
|
179
|
+
this.control = control;
|
|
180
|
+
this.element = element;
|
|
181
|
+
this.overlay = overlay;
|
|
182
|
+
this.viewContainerRef = viewContainerRef;
|
|
183
|
+
this.dpConfig = {
|
|
184
|
+
format: DATE_FORMAT,
|
|
185
|
+
minDate: "",
|
|
186
|
+
maxDate: ""
|
|
187
|
+
};
|
|
188
|
+
this.dateMessages = [];
|
|
189
|
+
this.positionX = "center";
|
|
190
|
+
this.positionY = "bottom";
|
|
191
|
+
this.offsetX = 0;
|
|
192
|
+
this.offsetY = 0;
|
|
193
|
+
this.dateChange = new EventEmitter(true);
|
|
194
|
+
this.isOpen = false;
|
|
195
|
+
this.dpDisabledDates = [];
|
|
196
|
+
}
|
|
197
|
+
// dd-mm-yyyy 01-12-2022
|
|
198
|
+
set selectedDate(date) {
|
|
199
|
+
this.date = date;
|
|
200
|
+
}
|
|
201
|
+
set datesDisabled(dates) {
|
|
202
|
+
this.dpDisabledDates = dates;
|
|
203
|
+
}
|
|
204
|
+
toggleDatePicker() {
|
|
205
|
+
if (this.isOpen) {
|
|
206
|
+
this.close();
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
this.open();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
open() {
|
|
213
|
+
var _a;
|
|
214
|
+
this.isOpen = true;
|
|
215
|
+
const positionStrategy = this.overlay
|
|
216
|
+
.position()
|
|
217
|
+
.flexibleConnectedTo(this.element)
|
|
218
|
+
.withPositions(this.genPositionPairs())
|
|
219
|
+
.withPush(true);
|
|
220
|
+
const config = new OverlayConfig({
|
|
221
|
+
hasBackdrop: true,
|
|
222
|
+
positionStrategy,
|
|
223
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
224
|
+
backdropClass: "cdk-overlay-transparent-backdrop",
|
|
225
|
+
});
|
|
226
|
+
this.overlayRef = this.overlay.create(config);
|
|
227
|
+
const tempRef = new ComponentPortal(TzDpContainerComponent, this.viewContainerRef, Injector.create({
|
|
228
|
+
providers: [
|
|
229
|
+
{ provide: CONTAINER_DATA, useValue: { messages: this.dateMessages, date: ((_a = this.control) === null || _a === void 0 ? void 0 : _a.control.value) || this.date, dpConfig: this.dpConfig, datesDisabled: this.dpDisabledDates, dateChange: this.applyDate.bind(this) } },
|
|
230
|
+
]
|
|
231
|
+
}));
|
|
232
|
+
this.overlayRef.attach(tempRef);
|
|
233
|
+
this.overlayRef
|
|
234
|
+
.backdropClick()
|
|
235
|
+
.pipe(take(1))
|
|
236
|
+
.subscribe(() => {
|
|
237
|
+
this.close();
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
applyDate(date) {
|
|
241
|
+
var _a;
|
|
242
|
+
this.dateChange.emit(date);
|
|
243
|
+
(_a = this.control) === null || _a === void 0 ? void 0 : _a.control.patchValue(date);
|
|
244
|
+
this.date = date;
|
|
245
|
+
this.close();
|
|
246
|
+
}
|
|
247
|
+
close() {
|
|
248
|
+
this.isOpen = false;
|
|
249
|
+
this.overlayRef.detach();
|
|
250
|
+
this.overlayRef.dispose();
|
|
251
|
+
}
|
|
252
|
+
genPositionPairs() {
|
|
253
|
+
return [
|
|
254
|
+
new ConnectionPositionPair({ originX: this.positionX, originY: this.positionY }, { overlayX: this.positionX, overlayY: this.positionY === "bottom" ? "top" : "bottom" }, this.offsetX, this.offsetY),
|
|
255
|
+
new ConnectionPositionPair({ originX: "center", originY: "bottom" }, { overlayX: "center", overlayY: "top" }),
|
|
256
|
+
new ConnectionPositionPair({ originX: "center", originY: "top" }, { overlayX: "center", overlayY: "bottom" }),
|
|
257
|
+
new ConnectionPositionPair({ originX: "start", originY: "bottom" }, { overlayX: "start", overlayY: "top" }),
|
|
258
|
+
new ConnectionPositionPair({ originX: "start", originY: "top" }, { overlayX: "start", overlayY: "bottom" }),
|
|
259
|
+
new ConnectionPositionPair({ originX: "end", originY: "bottom" }, { overlayX: "end", overlayY: "top" }),
|
|
260
|
+
new ConnectionPositionPair({ originX: "end", originY: "top" }, { overlayX: "end", overlayY: "bottom" }),
|
|
261
|
+
];
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
TzDatepickerDirective.decorators = [
|
|
265
|
+
{ type: Directive, args: [{
|
|
266
|
+
selector: "input[misTzDp]",
|
|
267
|
+
},] }
|
|
268
|
+
];
|
|
269
|
+
TzDatepickerDirective.ctorParameters = () => [
|
|
270
|
+
{ type: NgControl, decorators: [{ type: Self }, { type: Optional }] },
|
|
271
|
+
{ type: ElementRef },
|
|
272
|
+
{ type: Overlay },
|
|
273
|
+
{ type: ViewContainerRef }
|
|
274
|
+
];
|
|
275
|
+
TzDatepickerDirective.propDecorators = {
|
|
276
|
+
dpConfig: [{ type: Input }],
|
|
277
|
+
selectedDate: [{ type: Input }],
|
|
278
|
+
datesDisabled: [{ type: Input }],
|
|
279
|
+
dateMessages: [{ type: Input }],
|
|
280
|
+
positionX: [{ type: Input }],
|
|
281
|
+
positionY: [{ type: Input }],
|
|
282
|
+
offsetX: [{ type: Input }],
|
|
283
|
+
offsetY: [{ type: Input }],
|
|
284
|
+
dateChange: [{ type: Output }],
|
|
285
|
+
toggleDatePicker: [{ type: HostListener, args: ["click",] }]
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
class DatepickerModuleV2 {
|
|
289
|
+
}
|
|
290
|
+
DatepickerModuleV2.decorators = [
|
|
291
|
+
{ type: NgModule, args: [{
|
|
292
|
+
declarations: [TzDpContainerComponent, TzDatepickerDirective],
|
|
293
|
+
imports: [CommonModule, ToastModule.forRoot()],
|
|
294
|
+
exports: [TzDpContainerComponent, TzDatepickerDirective],
|
|
295
|
+
entryComponents: [TzDpContainerComponent]
|
|
296
|
+
},] }
|
|
297
|
+
];
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Generated bundle index. Do not edit.
|
|
301
|
+
*/
|
|
302
|
+
|
|
303
|
+
export { DatepickerModuleV2, TzDatepickerDirective, TzDpContainerComponent as ɵb, CONTAINER_DATA as ɵc };
|
|
304
|
+
//# sourceMappingURL=mis-crystal-design-system-datepicker_v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-datepicker_v2.js","sources":["../../../projects/mis-components/datepicker_v2/datepicker-constants.ts","../../../projects/mis-components/datepicker_v2/utils/index.ts","../../../projects/mis-components/datepicker_v2/tz-dp-container/tz-dp-container.component.ts","../../../projects/mis-components/datepicker_v2/tz-datepicker.directive.ts","../../../projects/mis-components/datepicker_v2/datepicker.module.ts","../../../projects/mis-components/datepicker_v2/mis-crystal-design-system-datepicker_v2.ts"],"sourcesContent":["/** @format */\n\nimport { InjectionToken } from \"@angular/core\";\n\nexport const CONTAINER_DATA = new InjectionToken<{}>('CONTAINER_DATA');\nexport const DATE_FORMAT = \"DD-MM-YYYY\";","import { ICurrentMonth } from \"../models/dp-config.model\";\n\nexport const getMonth = (index: number): ICurrentMonth => {\n let month;\n switch (index) {\n case 0:\n month = 'January'\n break;\n case 1:\n month = 'February'\n break;\n case 2:\n month = 'March'\n break;\n case 3:\n month = 'April'\n break;\n case 4:\n month = 'May'\n break;\n case 5:\n month = 'June'\n break;\n case 6:\n month = 'July'\n break;\n case 7:\n month = 'August'\n break;\n case 8:\n month = 'September'\n break;\n case 9:\n month = 'October'\n break;\n case 10:\n month = 'November'\n break;\n case 11:\n month = 'December'\n break;\n default:\n break;\n }\n return month;\n}","import { Component, Inject, OnInit } from \"@angular/core\";\nimport { CONTAINER_DATA, DATE_FORMAT } from \"../datepicker-constants\";\nimport { ICurrentMonth, ICurrentMonthDates, IDatePickerData, IWeekDay } from \"../models/dp-config.model\";\nimport { parseZone, Moment } from 'moment-timezone';\nimport { getMonth } from \"../utils\";\nimport { ToastService } from 'mis-crystal-design-system/toast'\n\n@Component({\n selector: \"mis-tz-dp\",\n templateUrl: \"./tz-dp-container.component.html\",\n styleUrls: [\"./tz-dp-container.component.scss\"],\n})\nexport class TzDpContainerComponent implements OnInit {\n data: IDatePickerData;\n private parseZoneInstance = (...args) => {\n return parseZone(...args);\n };\n private rawWeekDays: string[] = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']\n weekDays: IWeekDay[] = [];\n currentMonthNumber: number;\n currentMonth: ICurrentMonth;\n currentYearNumber: number;\n currentMonthDates: ICurrentMonthDates[] = [];\n isPreviousMonthDisabled: boolean = false;\n isNextMonthDisabled: boolean = false;\n\n constructor(@Inject(CONTAINER_DATA) data: IDatePickerData, private toast: ToastService) {\n this.data = data;\n if (this.data?.dpConfig?.timezone) {\n this.parseZoneInstance = (...args) => {\n return parseZone(...args).tz(this.data.dpConfig.timezone);\n }\n }\n this.currentMonthNumber = this.parseZoneInstance().month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.currentYearNumber = this.parseZoneInstance().year();\n this.weekDays = this.rawWeekDays.map((day, index) => ({\n label: `${day[0]}${day.slice(1).toLowerCase()}`,\n isCurrentDay: this.parseZoneInstance().day() === index,\n }));\n if (!this.data?.dpConfig?.format) {\n this.data.dpConfig = {\n ...this.data.dpConfig,\n format: DATE_FORMAT,\n };\n }\n }\n\n ngOnInit(): void {\n this.currentDateInstance();\n this.calculateMinMaxDays();\n }\n\n private currentDateInstance(): void {\n const selectedDate = parseZone(this.data.date, this.data.dpConfig.format);\n if (selectedDate.isValid()) {\n this.currentYearNumber = selectedDate.year();\n this.currentMonthNumber = selectedDate.month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n }\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n }\n\n private calculateMinMaxDays() {\n const currentInstance = this.parseZoneInstance().year(this.currentYearNumber).month(this.currentMonthNumber);\n const minDate = this.parseZoneInstance(this.data.dpConfig.minDate, this.data.dpConfig.format);\n if (minDate.isValid()) {\n this.isPreviousMonthDisabled = minDate.isSameOrAfter(currentInstance, 'month');\n }\n const maxDate = this.parseZoneInstance(this.data.dpConfig.maxDate, this.data.dpConfig.format);\n if (maxDate.isValid()) {\n this.isNextMonthDisabled = maxDate.isSameOrBefore(currentInstance, 'month');\n }\n }\n\n navigateMonth(direction: \"NEXT\" | \"PREVIOUS\"): void {\n let thisMonth: Moment = parseZone().year(this.currentYearNumber).month(this.currentMonthNumber);\n if (direction === \"NEXT\") {\n thisMonth = thisMonth.add(1, 'month');\n } else if (direction === \"PREVIOUS\") {\n thisMonth = thisMonth.subtract(1, 'month');\n }\n this.currentMonthNumber = thisMonth.month();\n this.currentMonth = getMonth(this.currentMonthNumber);\n this.currentYearNumber = thisMonth.year();\n this.currentMonthDates = this.generateDates(this.currentMonthNumber, this.currentYearNumber);\n this.calculateMinMaxDays();\n }\n\n private generateDates(month: number, currentYearNumber: number): ICurrentMonthDates[] {\n let dates: ICurrentMonthDates[] = [];\n const thisMonth = parseZone().year(currentYearNumber).month(month);\n for (let startDate = 1; startDate <= thisMonth.endOf('month').date(); startDate++) {\n let isDisabledDay = this.data.datesDisabled.some(d => d === thisMonth.date(startDate).format(this.data.dpConfig.format));\n const minDate = parseZone(this.data.dpConfig.minDate, this.data.dpConfig.format);\n if (!isDisabledDay && minDate.isValid()) {\n isDisabledDay = minDate.isAfter(thisMonth.date(startDate), 'day');\n }\n const maxDate = parseZone(this.data.dpConfig.maxDate, this.data.dpConfig.format);\n if (!isDisabledDay && maxDate.isValid()) {\n isDisabledDay = maxDate.isBefore(thisMonth.date(startDate), 'day');\n }\n dates.push({\n date: startDate,\n weekDay: thisMonth.date(startDate).day(),\n isCurrentDay: this.parseZoneInstance().year(currentYearNumber).month(month).date(startDate).date(startDate).isSame(parseZone(), 'day'),\n isSelectedDay: thisMonth.date(startDate).isSame(parseZone(this.data.date, this.data.dpConfig.format), 'day'),\n toastMessage: this.data.messages.find(q => thisMonth.date(startDate).isSame(parseZone(q.date, this.data.dpConfig.format), 'day'))?.message || '',\n isDisabledDay,\n });\n }\n for (let i = dates[0].weekDay; i > 0; i--) {\n dates.unshift({ date: 0, weekDay: i - 1 });\n }\n return dates;\n }\n\n selectDay(day: ICurrentMonthDates) {\n if (day.date <= 0) return;\n if (!day.isDisabledDay) {\n this.data.dateChange(parseZone().year(this.currentYearNumber).month(this.currentMonthNumber).date(day.date).format(this.data.dpConfig.format));\n }\n if (day.toastMessage) {\n this.toast.displayMsg(day.toastMessage, 4000);\n }\n }\n\n}\n","import { ConnectionPositionPair, Overlay, OverlayConfig, OverlayRef, PositionStrategy } from \"@angular/cdk/overlay\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { Directive, ElementRef, EventEmitter, HostListener, Injector, Input, Optional, Output, Self, ViewContainerRef } from \"@angular/core\";\nimport { NgControl } from \"@angular/forms\";\nimport { take } from \"rxjs/operators\";\nimport { CONTAINER_DATA, DATE_FORMAT } from \"./datepicker-constants\";\nimport { IDatePickerConfig, IDatePickerToastText } from \"./models/dp-config.model\";\nimport { TzDpContainerComponent } from './tz-dp-container/tz-dp-container.component';\n\n@Directive({\n selector: \"input[misTzDp]\",\n})\nexport class TzDatepickerDirective {\n @Input() dpConfig: Partial<IDatePickerConfig> = {\n format: DATE_FORMAT,\n minDate: \"\",\n maxDate: \"\"\n };\n // dd-mm-yyyy 01-12-2022\n @Input() set selectedDate(date: string) {\n this.date = date;\n }\n @Input() set datesDisabled(dates: string[]) {\n this.dpDisabledDates = dates;\n }\n @Input() dateMessages: IDatePickerToastText[] = [];\n @Input() positionX: \"start\" | \"center\" | \"end\" = \"center\";\n @Input() positionY: \"top\" | \"center\" | \"bottom\" = \"bottom\";\n @Input() offsetX:number = 0;\n @Input() offsetY:number = 0;\n private overlayRef: OverlayRef;\n @Output() dateChange = new EventEmitter<string>(true);\n private isOpen = false;\n date: string;\n\n private dpDisabledDates: string[] = [];\n\n constructor(@Self() @Optional() private control: NgControl, private element: ElementRef, private overlay: Overlay, private viewContainerRef: ViewContainerRef) { }\n\n @HostListener(\"click\")\n toggleDatePicker() {\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n }\n\n private open() {\n this.isOpen = true;\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(this.genPositionPairs())\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: true,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n backdropClass: \"cdk-overlay-transparent-backdrop\",\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(TzDpContainerComponent, this.viewContainerRef, Injector.create({\n providers: [\n { provide: CONTAINER_DATA, useValue: { messages: this.dateMessages, date: this.control?.control.value || this.date, dpConfig: this.dpConfig, datesDisabled: this.dpDisabledDates, dateChange: this.applyDate.bind(this) } },\n ]\n }));\n this.overlayRef.attach(tempRef);\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.close();\n });\n }\n\n applyDate(date: string) {\n this.dateChange.emit(date);\n this.control?.control.patchValue(date);\n this.date = date;\n this.close();\n }\n\n private close() {\n this.isOpen = false;\n this.overlayRef.detach();\n this.overlayRef.dispose();\n }\n\n private genPositionPairs():ConnectionPositionPair[] {\n return [\n new ConnectionPositionPair(\n { originX: this.positionX, originY: this.positionY },\n { overlayX: this.positionX, overlayY: this.positionY === \"bottom\" ? \"top\" : \"bottom\" },\n this.offsetX,\n this.offsetY\n ),\n new ConnectionPositionPair({ originX: \"center\", originY: \"bottom\" }, { overlayX: \"center\", overlayY: \"top\" }),\n new ConnectionPositionPair({ originX: \"center\", originY: \"top\" }, { overlayX: \"center\", overlayY: \"bottom\" }),\n new ConnectionPositionPair({ originX: \"start\", originY: \"bottom\" }, { overlayX: \"start\", overlayY: \"top\" }),\n new ConnectionPositionPair({ originX: \"start\", originY: \"top\" }, { overlayX: \"start\", overlayY: \"bottom\" }),\n new ConnectionPositionPair({ originX: \"end\", originY: \"bottom\" }, { overlayX: \"end\", overlayY: \"top\" }),\n new ConnectionPositionPair({ originX: \"end\", originY: \"top\" }, { overlayX: \"end\", overlayY: \"bottom\" }),\n ];\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { TzDpContainerComponent } from \"./tz-dp-container/tz-dp-container.component\";\nimport { TzDatepickerDirective } from \"./tz-datepicker.directive\";\nimport { ToastModule } from 'mis-crystal-design-system/toast';\n@NgModule({\n declarations: [TzDpContainerComponent, TzDatepickerDirective],\n imports: [CommonModule, ToastModule.forRoot()],\n exports: [TzDpContainerComponent, TzDatepickerDirective],\n entryComponents: [TzDpContainerComponent]\n})\nexport class DatepickerModuleV2 {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {CONTAINER_DATA as ɵc} from './datepicker-constants';\nexport {IDatePickerData as ɵa} from './models/dp-config.model';\nexport {TzDpContainerComponent as ɵb} from './tz-dp-container/tz-dp-container.component';"],"names":[],"mappings":";;;;;;;;;AAAA;MAIa,cAAc,GAAG,IAAI,cAAc,CAAK,gBAAgB,EAAE;AAChE,MAAM,WAAW,GAAG,YAAY;;ACHhC,MAAM,QAAQ,GAAG,CAAC,KAAa;IAClC,IAAI,KAAK,CAAC;IACV,QAAQ,KAAK;QACT,KAAK,CAAC;YACF,KAAK,GAAG,SAAS,CAAA;YACjB,MAAM;QACV,KAAK,CAAC;YACF,KAAK,GAAG,UAAU,CAAA;YAClB,MAAM;QACV,KAAK,CAAC;YACF,KAAK,GAAG,OAAO,CAAA;YACf,MAAM;QACV,KAAK,CAAC;YACF,KAAK,GAAG,OAAO,CAAA;YACf,MAAM;QACV,KAAK,CAAC;YACF,KAAK,GAAG,KAAK,CAAA;YACb,MAAM;QACV,KAAK,CAAC;YACF,KAAK,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