@gettrx/core-components-angular 1.0.9 → 1.0.11
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/esm2022/lib/molecules/calendar/calendar/gtr-calendar.component.mjs +8 -12
- package/esm2022/lib/molecules/calendar/calendar-month/gtr-calendar-class-day.pipe.mjs +2 -2
- package/esm2022/lib/molecules/calendar/calendar-month/gtr-calendar-day.directive.mjs +1 -1
- package/esm2022/lib/molecules/calendar/calendar-month/gtr-calendar-day.pipe.mjs +1 -1
- package/esm2022/lib/molecules/calendar/calendar-month/gtr-calendar-month.component.mjs +7 -15
- package/esm2022/lib/molecules/calendar/calendar-month/gtr-calendar-weekday.pipe.mjs +1 -1
- package/esm2022/lib/molecules/calendar/calendar-navigation/gtr-calendar-navigation.component.mjs +3 -6
- package/esm2022/lib/molecules/calendar/gtr-calendar.service.mjs +3 -5
- package/esm2022/lib/molecules/calendar/gtr-calendar.utils.mjs +12 -8
- package/esm2022/lib/molecules/date-picker/gtr-date-picker.component.mjs +4 -3
- package/esm2022/lib/molecules/date-picker/gtr-date-picker.module.mjs +5 -2
- package/esm2022/lib/molecules/date-range-picker/date-range-picker/gtr-custom-range-key.pipe.mjs +17 -0
- package/esm2022/lib/molecules/date-range-picker/date-range-picker/gtr-date-range-picker.component.mjs +87 -62
- package/esm2022/lib/molecules/date-range-picker/date-range-picker/gtr-date-range-picker.types.mjs +2 -0
- package/esm2022/lib/molecules/date-range-picker/gtr-date-range-picker.module.mjs +5 -2
- package/fesm2022/gettrx-core-components-angular.mjs +261 -229
- package/fesm2022/gettrx-core-components-angular.mjs.map +1 -1
- package/lib/molecules/calendar/calendar/gtr-calendar.component.d.ts +9 -9
- package/lib/molecules/calendar/calendar-month/gtr-calendar-day.pipe.d.ts +2 -2
- package/lib/molecules/calendar/calendar-month/gtr-calendar-month.component.d.ts +9 -9
- package/lib/molecules/calendar/calendar-month/gtr-calendar-weekday.pipe.d.ts +2 -2
- package/lib/molecules/calendar/calendar-navigation/gtr-calendar-navigation.component.d.ts +3 -4
- package/lib/molecules/calendar/gtr-calendar.service.d.ts +10 -10
- package/lib/molecules/calendar/gtr-calendar.utils.d.ts +3 -3
- package/lib/molecules/date-picker/gtr-date-picker.module.d.ts +2 -1
- package/lib/molecules/date-range-picker/date-range-picker/gtr-custom-range-key.pipe.d.ts +8 -0
- package/lib/molecules/date-range-picker/date-range-picker/gtr-date-range-picker.component.d.ts +16 -18
- package/lib/molecules/date-range-picker/date-range-picker/gtr-date-range-picker.types.d.ts +4 -0
- package/lib/molecules/date-range-picker/gtr-date-range-picker.module.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, Input, HostBinding, booleanAttribute, NgModule, Directive, EventEmitter, Optional, Self, Output, ViewChild, HostListener, Injectable, ContentChildren, Pipe, ViewChildren, forwardRef, ElementRef, Inject, ContentChild, ViewContainerRef, ViewEncapsulation, QueryList } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule, NgIf, NgStyle, NgClass, NgForOf, NgSwitch, NgSwitchCase, NgSwitchDefault, NgFor, DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import { CommonModule, NgIf, NgStyle, NgClass, NgForOf, NgSwitch, NgSwitchCase, NgSwitchDefault, NgFor, DOCUMENT, NgTemplateOutlet, registerLocaleData, formatDate } from '@angular/common';
|
|
5
5
|
import * as i1$1 from '@angular/forms';
|
|
6
6
|
import { FormsModule, NG_VALUE_ACCESSOR, FormGroup, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
7
7
|
import { Subject, Subscription, BehaviorSubject, throwError, takeUntil } from 'rxjs';
|
|
8
|
-
import { isValid, format } from 'date-fns';
|
|
9
8
|
import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
9
|
+
import localeEsUs from '@angular/common/locales/es-US';
|
|
10
10
|
import * as i1$2 from '@angular/cdk/layout';
|
|
11
|
-
import {
|
|
11
|
+
import { isValid } from 'date-fns';
|
|
12
12
|
import { filter } from 'rxjs/operators';
|
|
13
13
|
import { createPopper } from '@popperjs/core';
|
|
14
14
|
|
|
@@ -2089,141 +2089,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2089
2089
|
}]
|
|
2090
2090
|
}] });
|
|
2091
2091
|
|
|
2092
|
-
class GtrCalendarService {
|
|
2093
|
-
constructor(keyValueDiffers) {
|
|
2094
|
-
this.keyValueDiffers = keyValueDiffers;
|
|
2095
|
-
this.calendarStateObject = {
|
|
2096
|
-
calendarDate: new Date(),
|
|
2097
|
-
hoverDate: null,
|
|
2098
|
-
startDate: null,
|
|
2099
|
-
endDate: null,
|
|
2100
|
-
maxDate: null,
|
|
2101
|
-
minDate: null,
|
|
2102
|
-
disabledDates: [],
|
|
2103
|
-
range: false,
|
|
2104
|
-
view: 'days',
|
|
2105
|
-
type: 'days',
|
|
2106
|
-
locale: 'default',
|
|
2107
|
-
dateFilter: undefined,
|
|
2108
|
-
weekdayFormat: 'short',
|
|
2109
|
-
dayFormat: 'numeric',
|
|
2110
|
-
navYearFirst: false,
|
|
2111
|
-
showAdjacentDays: true,
|
|
2112
|
-
selectAdjacentDays: false,
|
|
2113
|
-
};
|
|
2114
|
-
this.calendarState = new BehaviorSubject(this.calendarStateObject);
|
|
2115
|
-
this.calendarState$ = this.calendarState.asObservable();
|
|
2116
|
-
this.differ = this.keyValueDiffers.find(this.calendarStateObject).create();
|
|
2117
|
-
}
|
|
2118
|
-
update(state) {
|
|
2119
|
-
const keys = Object.keys(state);
|
|
2120
|
-
for (const key of keys) {
|
|
2121
|
-
const entry = this.calendarStateObject[key];
|
|
2122
|
-
if (entry === state[key]) {
|
|
2123
|
-
continue;
|
|
2124
|
-
}
|
|
2125
|
-
// if (isValidDate(state[key]) && entry ? entry.getTime() === state[key]?.getTime() : false) {
|
|
2126
|
-
if (isValid(state[key]) && entry ? entry.getTime() === state[key]?.getTime() : false) {
|
|
2127
|
-
continue;
|
|
2128
|
-
}
|
|
2129
|
-
this.calendarStateObject[key] = state[key];
|
|
2130
|
-
}
|
|
2131
|
-
if (this.differ) {
|
|
2132
|
-
const changes = this.differ.diff(this.calendarStateObject);
|
|
2133
|
-
if (changes) {
|
|
2134
|
-
const newState = { ...this.calendarStateObject };
|
|
2135
|
-
changes.forEachChangedItem((item) => {
|
|
2136
|
-
newState[item.key] = item.currentValue;
|
|
2137
|
-
});
|
|
2138
|
-
this.calendarState.next(newState);
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
}
|
|
2142
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarService, deps: [{ token: i0.KeyValueDiffers }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2143
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarService }); }
|
|
2144
|
-
}
|
|
2145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarService, decorators: [{
|
|
2146
|
-
type: Injectable
|
|
2147
|
-
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }]; } });
|
|
2148
|
-
|
|
2149
|
-
class GtrCalendarNavigationComponent {
|
|
2150
|
-
constructor(calendarService) {
|
|
2151
|
-
this.calendarService = calendarService;
|
|
2152
|
-
this.addMonths = 0;
|
|
2153
|
-
this._calendarDate = new Date();
|
|
2154
|
-
this.navigation = true;
|
|
2155
|
-
this.navShowYear = false;
|
|
2156
|
-
this.navYearFirst = false;
|
|
2157
|
-
this.locale = 'default';
|
|
2158
|
-
this.view = 'days';
|
|
2159
|
-
this.type = 'days';
|
|
2160
|
-
this.navigationClick = new EventEmitter();
|
|
2161
|
-
this.calendarStateSubscribe();
|
|
2162
|
-
}
|
|
2163
|
-
set calendarDate(value) {
|
|
2164
|
-
this._calendarDate = value;
|
|
2165
|
-
}
|
|
2166
|
-
get calendarDate() {
|
|
2167
|
-
return this._calendarDate;
|
|
2168
|
-
}
|
|
2169
|
-
get date() {
|
|
2170
|
-
const addYears = this.view === 'months' ? this.addMonths : 0;
|
|
2171
|
-
const addMonths = this.view === 'days' ? this.addMonths : 0;
|
|
2172
|
-
return new Date(this.calendarDate.getFullYear() + addYears, this.calendarDate.getMonth() + addMonths);
|
|
2173
|
-
}
|
|
2174
|
-
get hostClasses() {
|
|
2175
|
-
return {
|
|
2176
|
-
'calendar-nav': true,
|
|
2177
|
-
};
|
|
2178
|
-
}
|
|
2179
|
-
ngOnDestroy() {
|
|
2180
|
-
this.calendarStateSubscribe(false);
|
|
2181
|
-
}
|
|
2182
|
-
calendarStateSubscribe(subscribe = true) {
|
|
2183
|
-
if (subscribe) {
|
|
2184
|
-
this.calendarStateSubscription = this.calendarService.calendarState$.subscribe((state) => {
|
|
2185
|
-
const keys = Object.keys(state);
|
|
2186
|
-
for (const key of keys) {
|
|
2187
|
-
if (key in this) {
|
|
2188
|
-
// @ts-ignore
|
|
2189
|
-
this[key] = state[key];
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
});
|
|
2193
|
-
return;
|
|
2194
|
-
}
|
|
2195
|
-
this.calendarStateSubscription?.unsubscribe();
|
|
2196
|
-
}
|
|
2197
|
-
setView(view) {
|
|
2198
|
-
this.view = view;
|
|
2199
|
-
this.calendarService.update({ view: view });
|
|
2200
|
-
}
|
|
2201
|
-
handleNavigationClick(direction, years = false) {
|
|
2202
|
-
this.navigationClick.emit({ direction, years: years });
|
|
2203
|
-
}
|
|
2204
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarNavigationComponent, deps: [{ token: GtrCalendarService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2205
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GtrCalendarNavigationComponent, isStandalone: true, selector: "gtr-calendar-navigation", inputs: { addMonths: "addMonths", calendarDate: "calendarDate", navigation: "navigation", navShowYear: "navShowYear", navYearFirst: "navYearFirst" }, outputs: { navigationClick: "navigationClick" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<div *ngIf=\"navigation\" class=\"calendar-nav-prev\">\n <button\n *ngIf=\"navShowYear || view !== 'days'\"\n (click)=\"handleNavigationClick('prev', true)\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevrons-left\"\n [size]=\"20\"></gtr-icon>\n </button>\n <button\n (click)=\"handleNavigationClick('prev')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevron-left\"\n [size]=\"20\"></gtr-icon>\n </button>\n</div>\n\n<div class=\"calendar-nav-date\" [ngStyle]=\"navYearFirst ? { display: 'flex', justifyContent: 'center' } : {}\">\n <button\n (click)=\"setView('months')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-date-button\"\n >\n {{ date.toLocaleDateString(locale, {month: 'long'}) }}\n </button>\n <button\n (click)=\"setView('years')\"\n *ngIf=\"view !== 'years'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n class=\"calendar-nav-date-button\"\n tabindex=\"0\"\n [ngStyle]=\"navYearFirst ? { order: '-1' } : {}\">\n {{ date.toLocaleDateString(locale, {year: 'numeric'}) }}\n </button>\n\n <button\n *ngIf=\"view === 'years'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n class=\"calendar-nav-date-button\"\n tabindex=\"0\">\n Year\n </button>\n</div>\n\n<div *ngIf=\"navigation\" class=\"calendar-nav-next\">\n <button\n (click)=\"handleNavigationClick('next')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevron-right\"\n [size]=\"20\"></gtr-icon>\n </button>\n <button\n *ngIf=\"navShowYear || view !== 'days'\"\n (click)=\"handleNavigationClick('next', true)\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevrons-right\"\n [size]=\"20\"></gtr-icon>\n </button>\n</div>\n\n", styles: [":root{--cui-calendar-nav-date-color: var(--gtr-color-base-black-60) !important;--gtr-color-base-button-icon-bg: rgba(75, 70, 92, .08);--gtr-color-base-button-icon-color: #6F6B7D}.calendar-nav-prev .calendar-nav-icon-button,.calendar-nav-next .calendar-nav-icon-button{border-radius:50%;background-color:var(--gtr-color-base-button-icon-bg);color:var(--gtr-color-base-button-icon-color);height:28px;width:28px;padding:4px;margin:0;border:none}.calendar-nav-date .calendar-nav-date-button{border:none}.calendar-nav-date .calendar-nav-date-button:hover{color:var(--gtr-color-base-primary-base)!important}\n"], dependencies: [{ kind: "directive", type: GtrButtonDirective, selector: "[gtrButton]", inputs: ["active", "color", "disabled", "shape", "size", "type", "variant"], exportAs: ["gtrButton"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: GtrIconModule }, { kind: "component", type: GtrIconComponent, selector: "gtr-icon", inputs: ["name", "weight", "color", "size", "iconId"] }] }); }
|
|
2206
|
-
}
|
|
2207
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarNavigationComponent, decorators: [{
|
|
2208
|
-
type: Component,
|
|
2209
|
-
args: [{ selector: 'gtr-calendar-navigation', standalone: true, imports: [GtrButtonDirective, NgIf, NgStyle, GtrIconModule], template: "<div *ngIf=\"navigation\" class=\"calendar-nav-prev\">\n <button\n *ngIf=\"navShowYear || view !== 'days'\"\n (click)=\"handleNavigationClick('prev', true)\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevrons-left\"\n [size]=\"20\"></gtr-icon>\n </button>\n <button\n (click)=\"handleNavigationClick('prev')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevron-left\"\n [size]=\"20\"></gtr-icon>\n </button>\n</div>\n\n<div class=\"calendar-nav-date\" [ngStyle]=\"navYearFirst ? { display: 'flex', justifyContent: 'center' } : {}\">\n <button\n (click)=\"setView('months')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-date-button\"\n >\n {{ date.toLocaleDateString(locale, {month: 'long'}) }}\n </button>\n <button\n (click)=\"setView('years')\"\n *ngIf=\"view !== 'years'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n class=\"calendar-nav-date-button\"\n tabindex=\"0\"\n [ngStyle]=\"navYearFirst ? { order: '-1' } : {}\">\n {{ date.toLocaleDateString(locale, {year: 'numeric'}) }}\n </button>\n\n <button\n *ngIf=\"view === 'years'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n class=\"calendar-nav-date-button\"\n tabindex=\"0\">\n Year\n </button>\n</div>\n\n<div *ngIf=\"navigation\" class=\"calendar-nav-next\">\n <button\n (click)=\"handleNavigationClick('next')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevron-right\"\n [size]=\"20\"></gtr-icon>\n </button>\n <button\n *ngIf=\"navShowYear || view !== 'days'\"\n (click)=\"handleNavigationClick('next', true)\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevrons-right\"\n [size]=\"20\"></gtr-icon>\n </button>\n</div>\n\n", styles: [":root{--cui-calendar-nav-date-color: var(--gtr-color-base-black-60) !important;--gtr-color-base-button-icon-bg: rgba(75, 70, 92, .08);--gtr-color-base-button-icon-color: #6F6B7D}.calendar-nav-prev .calendar-nav-icon-button,.calendar-nav-next .calendar-nav-icon-button{border-radius:50%;background-color:var(--gtr-color-base-button-icon-bg);color:var(--gtr-color-base-button-icon-color);height:28px;width:28px;padding:4px;margin:0;border:none}.calendar-nav-date .calendar-nav-date-button{border:none}.calendar-nav-date .calendar-nav-date-button:hover{color:var(--gtr-color-base-primary-base)!important}\n"] }]
|
|
2210
|
-
}], ctorParameters: function () { return [{ type: GtrCalendarService }]; }, propDecorators: { addMonths: [{
|
|
2211
|
-
type: Input
|
|
2212
|
-
}], calendarDate: [{
|
|
2213
|
-
type: Input
|
|
2214
|
-
}], navigation: [{
|
|
2215
|
-
type: Input
|
|
2216
|
-
}], navShowYear: [{
|
|
2217
|
-
type: Input
|
|
2218
|
-
}], navYearFirst: [{
|
|
2219
|
-
type: Input
|
|
2220
|
-
}], navigationClick: [{
|
|
2221
|
-
type: Output
|
|
2222
|
-
}], hostClasses: [{
|
|
2223
|
-
type: HostBinding,
|
|
2224
|
-
args: ['class']
|
|
2225
|
-
}] } });
|
|
2226
|
-
|
|
2227
2092
|
const convertToLocalDate = (d, locale, options = {}) => d.toLocaleDateString(locale, options);
|
|
2228
2093
|
const convertToLocalTime = (d, locale, options = {}) => d.toLocaleTimeString(locale, options);
|
|
2229
2094
|
const createGroupsInArray = (arr, numberOfGroups) => {
|
|
@@ -2389,9 +2254,9 @@ const isLastDayOfMonth = (date) => {
|
|
|
2389
2254
|
return test.getMonth() !== month;
|
|
2390
2255
|
};
|
|
2391
2256
|
const isSameDateAs = (date, date2) => {
|
|
2392
|
-
return (date
|
|
2393
|
-
date
|
|
2394
|
-
date
|
|
2257
|
+
return (date.getDate() == date2.getDate() &&
|
|
2258
|
+
date.getMonth() == date2.getMonth() &&
|
|
2259
|
+
date.getFullYear() == date2.getFullYear());
|
|
2395
2260
|
};
|
|
2396
2261
|
const isStartDate = (date, start, end) => {
|
|
2397
2262
|
return date && start && end && isSameDateAs(start, date) && start < end;
|
|
@@ -2411,13 +2276,18 @@ const isThisYear = (year) => {
|
|
|
2411
2276
|
return year == today.getFullYear();
|
|
2412
2277
|
};
|
|
2413
2278
|
const isValidDate = (date) => {
|
|
2414
|
-
|
|
2415
|
-
|
|
2279
|
+
if (date instanceof Date || typeof date === 'number' || typeof date === 'string') {
|
|
2280
|
+
// Try to create a Date object from Date or timestamp or string
|
|
2281
|
+
const dateObj = new Date(date);
|
|
2282
|
+
return !isNaN(dateObj.getTime());
|
|
2283
|
+
}
|
|
2284
|
+
// If none of the above conditions are met, it's not a valid date
|
|
2285
|
+
return false;
|
|
2416
2286
|
};
|
|
2417
2287
|
const tryDate = (value, propName = 'date') => {
|
|
2418
2288
|
let _value;
|
|
2419
2289
|
try {
|
|
2420
|
-
if (!
|
|
2290
|
+
if (!isValidDate(value)) {
|
|
2421
2291
|
throw value;
|
|
2422
2292
|
}
|
|
2423
2293
|
_value = new Date(value);
|
|
@@ -2519,6 +2389,137 @@ const isDateInRangeDisabled = (startDate, endDate, dates) => {
|
|
|
2519
2389
|
//
|
|
2520
2390
|
// // getDate('12/07/1997');
|
|
2521
2391
|
|
|
2392
|
+
class GtrCalendarService {
|
|
2393
|
+
constructor(keyValueDiffers) {
|
|
2394
|
+
this.keyValueDiffers = keyValueDiffers;
|
|
2395
|
+
this.calendarStateObject = {
|
|
2396
|
+
calendarDate: new Date(),
|
|
2397
|
+
hoverDate: null,
|
|
2398
|
+
startDate: null,
|
|
2399
|
+
endDate: null,
|
|
2400
|
+
maxDate: null,
|
|
2401
|
+
minDate: null,
|
|
2402
|
+
disabledDates: [],
|
|
2403
|
+
range: false,
|
|
2404
|
+
view: 'days',
|
|
2405
|
+
type: 'days',
|
|
2406
|
+
locale: 'default',
|
|
2407
|
+
dateFilter: undefined,
|
|
2408
|
+
weekdayFormat: 'short',
|
|
2409
|
+
dayFormat: 'numeric',
|
|
2410
|
+
navYearFirst: false,
|
|
2411
|
+
showAdjacentDays: true,
|
|
2412
|
+
selectAdjacentDays: false,
|
|
2413
|
+
};
|
|
2414
|
+
this.calendarState = new BehaviorSubject(this.calendarStateObject);
|
|
2415
|
+
this.calendarState$ = this.calendarState.asObservable();
|
|
2416
|
+
this.differ = this.keyValueDiffers.find(this.calendarStateObject).create();
|
|
2417
|
+
}
|
|
2418
|
+
update(state) {
|
|
2419
|
+
const keys = Object.keys(state);
|
|
2420
|
+
for (const key of keys) {
|
|
2421
|
+
const entry = this.calendarStateObject[key];
|
|
2422
|
+
if (entry === state[key]) {
|
|
2423
|
+
continue;
|
|
2424
|
+
}
|
|
2425
|
+
if (isValidDate(state[key]) && entry ? entry.getTime() === state[key]?.getTime() : false) {
|
|
2426
|
+
continue;
|
|
2427
|
+
}
|
|
2428
|
+
this.calendarStateObject[key] = state[key];
|
|
2429
|
+
}
|
|
2430
|
+
if (this.differ) {
|
|
2431
|
+
const changes = this.differ.diff(this.calendarStateObject);
|
|
2432
|
+
if (changes) {
|
|
2433
|
+
const newState = { ...this.calendarStateObject };
|
|
2434
|
+
changes.forEachChangedItem((item) => {
|
|
2435
|
+
newState[item.key] = item.currentValue;
|
|
2436
|
+
});
|
|
2437
|
+
this.calendarState.next(newState);
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarService, deps: [{ token: i0.KeyValueDiffers }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2442
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarService }); }
|
|
2443
|
+
}
|
|
2444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarService, decorators: [{
|
|
2445
|
+
type: Injectable
|
|
2446
|
+
}], ctorParameters: function () { return [{ type: i0.KeyValueDiffers }]; } });
|
|
2447
|
+
|
|
2448
|
+
class GtrCalendarNavigationComponent {
|
|
2449
|
+
constructor(calendarService) {
|
|
2450
|
+
this.calendarService = calendarService;
|
|
2451
|
+
this.addMonths = 0;
|
|
2452
|
+
this._calendarDate = new Date();
|
|
2453
|
+
this.navigation = true;
|
|
2454
|
+
this.navYearFirst = false;
|
|
2455
|
+
this.locale = 'default';
|
|
2456
|
+
this.view = 'days';
|
|
2457
|
+
this.type = 'days';
|
|
2458
|
+
this.navigationClick = new EventEmitter();
|
|
2459
|
+
this.calendarStateSubscribe();
|
|
2460
|
+
}
|
|
2461
|
+
set calendarDate(value) {
|
|
2462
|
+
this._calendarDate = value;
|
|
2463
|
+
}
|
|
2464
|
+
get calendarDate() {
|
|
2465
|
+
return this._calendarDate;
|
|
2466
|
+
}
|
|
2467
|
+
get date() {
|
|
2468
|
+
const addYears = this.view === 'months' ? this.addMonths : 0;
|
|
2469
|
+
const addMonths = this.view === 'days' ? this.addMonths : 0;
|
|
2470
|
+
return new Date(this.calendarDate.getFullYear() + addYears, this.calendarDate.getMonth() + addMonths);
|
|
2471
|
+
}
|
|
2472
|
+
get hostClasses() {
|
|
2473
|
+
return {
|
|
2474
|
+
'calendar-nav': true,
|
|
2475
|
+
};
|
|
2476
|
+
}
|
|
2477
|
+
ngOnDestroy() {
|
|
2478
|
+
this.calendarStateSubscribe(false);
|
|
2479
|
+
}
|
|
2480
|
+
calendarStateSubscribe(subscribe = true) {
|
|
2481
|
+
if (subscribe) {
|
|
2482
|
+
this.calendarStateSubscription = this.calendarService.calendarState$.subscribe((state) => {
|
|
2483
|
+
const keys = Object.keys(state);
|
|
2484
|
+
for (const key of keys) {
|
|
2485
|
+
if (key in this) {
|
|
2486
|
+
// @ts-ignore
|
|
2487
|
+
this[key] = state[key];
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
});
|
|
2491
|
+
return;
|
|
2492
|
+
}
|
|
2493
|
+
this.calendarStateSubscription?.unsubscribe();
|
|
2494
|
+
}
|
|
2495
|
+
setView(view) {
|
|
2496
|
+
this.view = view;
|
|
2497
|
+
this.calendarService.update({ view: view });
|
|
2498
|
+
}
|
|
2499
|
+
handleNavigationClick(direction, years = false) {
|
|
2500
|
+
this.navigationClick.emit({ direction, years: years });
|
|
2501
|
+
}
|
|
2502
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarNavigationComponent, deps: [{ token: GtrCalendarService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2503
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GtrCalendarNavigationComponent, isStandalone: true, selector: "gtr-calendar-navigation", inputs: { addMonths: "addMonths", calendarDate: "calendarDate", navigation: "navigation", navYearFirst: "navYearFirst" }, outputs: { navigationClick: "navigationClick" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<div *ngIf=\"navigation\" class=\"calendar-nav-prev\">\n <button\n *ngIf=\"view !== 'days'\"\n (click)=\"handleNavigationClick('prev', true)\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevrons-left\"\n [size]=\"20\"></gtr-icon>\n </button>\n <button\n (click)=\"handleNavigationClick('prev')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevron-left\"\n [size]=\"20\"></gtr-icon>\n </button>\n</div>\n<div class=\"calendar-nav-date\" [ngStyle]=\"navYearFirst ? { display: 'flex', justifyContent: 'center' } : {}\">\n <button\n (click)=\"setView('months')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-date-button\"\n >\n {{ date.toLocaleDateString(locale, { month: 'long' }) }}\n </button>\n <button\n (click)=\"setView('years')\"\n *ngIf=\"view !== 'years'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n class=\"calendar-nav-date-button\"\n tabindex=\"0\"\n [ngStyle]=\"navYearFirst ? { order: '-1' } : {}\">\n {{ date.toLocaleDateString(locale, { year: 'numeric' }) }}\n </button>\n\n <button\n *ngIf=\"view === 'years'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n class=\"calendar-nav-date-button\"\n tabindex=\"0\">\n Year\n </button>\n</div>\n\n<div *ngIf=\"navigation\" class=\"calendar-nav-next\">\n <button\n (click)=\"handleNavigationClick('next')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevron-right\"\n [size]=\"20\"></gtr-icon>\n </button>\n <button\n *ngIf=\"view !== 'days'\"\n (click)=\"handleNavigationClick('next', true)\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevrons-right\"\n [size]=\"20\"></gtr-icon>\n </button>\n</div>\n", styles: [":root{--gtr-calendar-nav-date-color: var(--gtr-color-base-black-60) !important;--gtr-color-base-button-icon-bg: rgba(75, 70, 92, .08);--gtr-color-base-button-icon-color: #6F6B7D}.calendar-nav-prev .calendar-nav-icon-button,.calendar-nav-next .calendar-nav-icon-button{border-radius:50%;background-color:var(--gtr-color-base-button-icon-bg);color:var(--gtr-color-base-button-icon-color);height:28px;width:28px;padding:4px;margin:0;border:none}.calendar-nav-date .calendar-nav-date-button{border:none}.calendar-nav-date .calendar-nav-date-button:hover{color:var(--gtr-color-base-primary-base)!important}\n"], dependencies: [{ kind: "directive", type: GtrButtonDirective, selector: "[gtrButton]", inputs: ["active", "color", "disabled", "shape", "size", "type", "variant"], exportAs: ["gtrButton"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: GtrIconModule }, { kind: "component", type: GtrIconComponent, selector: "gtr-icon", inputs: ["name", "weight", "color", "size", "iconId"] }] }); }
|
|
2504
|
+
}
|
|
2505
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarNavigationComponent, decorators: [{
|
|
2506
|
+
type: Component,
|
|
2507
|
+
args: [{ selector: 'gtr-calendar-navigation', standalone: true, imports: [GtrButtonDirective, NgIf, NgStyle, GtrIconModule], template: "<div *ngIf=\"navigation\" class=\"calendar-nav-prev\">\n <button\n *ngIf=\"view !== 'days'\"\n (click)=\"handleNavigationClick('prev', true)\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevrons-left\"\n [size]=\"20\"></gtr-icon>\n </button>\n <button\n (click)=\"handleNavigationClick('prev')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevron-left\"\n [size]=\"20\"></gtr-icon>\n </button>\n</div>\n<div class=\"calendar-nav-date\" [ngStyle]=\"navYearFirst ? { display: 'flex', justifyContent: 'center' } : {}\">\n <button\n (click)=\"setView('months')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-date-button\"\n >\n {{ date.toLocaleDateString(locale, { month: 'long' }) }}\n </button>\n <button\n (click)=\"setView('years')\"\n *ngIf=\"view !== 'years'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n class=\"calendar-nav-date-button\"\n tabindex=\"0\"\n [ngStyle]=\"navYearFirst ? { order: '-1' } : {}\">\n {{ date.toLocaleDateString(locale, { year: 'numeric' }) }}\n </button>\n\n <button\n *ngIf=\"view === 'years'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n class=\"calendar-nav-date-button\"\n tabindex=\"0\">\n Year\n </button>\n</div>\n\n<div *ngIf=\"navigation\" class=\"calendar-nav-next\">\n <button\n (click)=\"handleNavigationClick('next')\"\n *ngIf=\"view === 'days'\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevron-right\"\n [size]=\"20\"></gtr-icon>\n </button>\n <button\n *ngIf=\"view !== 'days'\"\n (click)=\"handleNavigationClick('next', true)\"\n gtrButton\n color=\"transparent\"\n size=\"sm\"\n tabindex=\"0\"\n class=\"calendar-nav-icon-button\"\n >\n <gtr-icon name=\"chevrons-right\"\n [size]=\"20\"></gtr-icon>\n </button>\n</div>\n", styles: [":root{--gtr-calendar-nav-date-color: var(--gtr-color-base-black-60) !important;--gtr-color-base-button-icon-bg: rgba(75, 70, 92, .08);--gtr-color-base-button-icon-color: #6F6B7D}.calendar-nav-prev .calendar-nav-icon-button,.calendar-nav-next .calendar-nav-icon-button{border-radius:50%;background-color:var(--gtr-color-base-button-icon-bg);color:var(--gtr-color-base-button-icon-color);height:28px;width:28px;padding:4px;margin:0;border:none}.calendar-nav-date .calendar-nav-date-button{border:none}.calendar-nav-date .calendar-nav-date-button:hover{color:var(--gtr-color-base-primary-base)!important}\n"] }]
|
|
2508
|
+
}], ctorParameters: function () { return [{ type: GtrCalendarService }]; }, propDecorators: { addMonths: [{
|
|
2509
|
+
type: Input
|
|
2510
|
+
}], calendarDate: [{
|
|
2511
|
+
type: Input
|
|
2512
|
+
}], navigation: [{
|
|
2513
|
+
type: Input
|
|
2514
|
+
}], navYearFirst: [{
|
|
2515
|
+
type: Input
|
|
2516
|
+
}], navigationClick: [{
|
|
2517
|
+
type: Output
|
|
2518
|
+
}], hostClasses: [{
|
|
2519
|
+
type: HostBinding,
|
|
2520
|
+
args: ['class']
|
|
2521
|
+
}] } });
|
|
2522
|
+
|
|
2522
2523
|
class GtrCalendarWeekdayPipe {
|
|
2523
2524
|
transform(date, weekdayFormat = 'short', locale = 'default') {
|
|
2524
2525
|
return typeof weekdayFormat === 'function'
|
|
@@ -2960,7 +2961,7 @@ class GtrCalendarMonthComponent {
|
|
|
2960
2961
|
ngOnInit() {
|
|
2961
2962
|
this.setListOfYears(this.date);
|
|
2962
2963
|
this.listOfMonths = createGroupsInArray(getMonthsNames(this.locale), 4);
|
|
2963
|
-
this.setMonthDetails(this.
|
|
2964
|
+
this.setMonthDetails(this.date);
|
|
2964
2965
|
}
|
|
2965
2966
|
setListOfYears(date) {
|
|
2966
2967
|
const addYears = this.view === 'years' ? this.addMonths * 12 : 0;
|
|
@@ -2974,8 +2975,8 @@ class GtrCalendarMonthComponent {
|
|
|
2974
2975
|
if (yearIsInView)
|
|
2975
2976
|
this.listOfYears = createGroupsInArray(years, 4);
|
|
2976
2977
|
}
|
|
2977
|
-
setMonthDetails(date = this.
|
|
2978
|
-
this._monthDetails = getMonthDetails(date.getFullYear(), date.getMonth()
|
|
2978
|
+
setMonthDetails(date = this.date) {
|
|
2979
|
+
this._monthDetails = getMonthDetails(date.getFullYear(), date.getMonth(), this.firstDayOfWeek);
|
|
2979
2980
|
}
|
|
2980
2981
|
yearNumber(year) {
|
|
2981
2982
|
return new Date(year, 0).toLocaleDateString(this.locale, {
|
|
@@ -3024,20 +3025,12 @@ class GtrCalendarMonthComponent {
|
|
|
3024
3025
|
this.handleYearCellClick(year);
|
|
3025
3026
|
return;
|
|
3026
3027
|
}
|
|
3027
|
-
if ($event.key === 'Tab') {
|
|
3028
|
-
this.handleYearCellMouseEnter(year);
|
|
3029
|
-
return;
|
|
3030
|
-
}
|
|
3031
3028
|
}
|
|
3032
|
-
handleMonthCellKeyUp($event,
|
|
3029
|
+
handleMonthCellKeyUp($event, i, idx) {
|
|
3033
3030
|
if ($event.key === 'Enter') {
|
|
3034
3031
|
this.handleMonthCellClick(i, idx);
|
|
3035
3032
|
return;
|
|
3036
3033
|
}
|
|
3037
|
-
if ($event.key === 'Tab') {
|
|
3038
|
-
this.handleMonthCellMouseEnter(date, i, idx);
|
|
3039
|
-
return;
|
|
3040
|
-
}
|
|
3041
3034
|
}
|
|
3042
3035
|
handleMonthCellClick(i, idx) {
|
|
3043
3036
|
this.setCalendarPage(0, 0, i * 3 + idx);
|
|
@@ -3138,7 +3131,7 @@ class GtrCalendarMonthComponent {
|
|
|
3138
3131
|
this.calendarStateSubscribe(false);
|
|
3139
3132
|
}
|
|
3140
3133
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarMonthComponent, deps: [{ token: GtrCalendarService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3141
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GtrCalendarMonthComponent, isStandalone: true, selector: "gtr-calendar-month", inputs: { addMonths: "addMonths", startDate: "startDate", endDate: "endDate", disabledDates: "disabledDates", firstDayOfWeek: "firstDayOfWeek", locale: "locale", range: "range", weekdayFormat: "weekdayFormat", view: "view", type: "type", maxDate: "maxDate", minDate: "minDate", calendarDate: "calendarDate" }, exportAs: ["gtrCalendarMonth"], ngImport: i0, template: "<table>\n <thead *ngIf=\"view === 'days'\">\n <tr>\n <th *ngFor=\"let weekDay of weekDays; index as i; count as cnt\" class=\"calendar-cell\">\n <div class=\"calendar-header-cell-inner\">\n {{ weekDay.date | gtrCalendarWeekday:weekdayFormat:locale }}\n </div>\n </th>\n </tr>\n </thead>\n <tbody (mouseleave)=\"handleCellMouseLeave()\" [ngSwitch]=\"view\">\n <ng-container *ngSwitchCase=\"'years'\">\n <tr *ngFor=\"let yearsRow of listOfYears; index as rowIdx\">\n <td\n (click)=\"handleYearCellClick(year)\"\n (keyup)=\"handleYearCellKeyUp($event, year)\"\n (mouseenter)=\"handleYearCellMouseEnter(year)\"\n gtrCalendarDay\n [gtrCalendarYear]=\"year\"\n *ngFor=\"let year of yearsRow; index as idx\"\n [ngClass]=\"year | gtrCalendarClassYear\"\n [tabindex]=\"0\"\n >\n <div class=\"calendar-cell-inner\">\n {{ yearNumber(year) }}\n </div>\n </td>\n </tr>\n </ng-container>\n <ng-container *ngSwitchCase=\"'months'\">\n <tr *ngFor=\"let monthsRow of listOfMonths; index as rowIdx\">\n <td\n (click)=\"handleMonthCellClick(rowIdx, idx)\"\n (keyup)=\"handleMonthCellKeyUp($event,
|
|
3134
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GtrCalendarMonthComponent, isStandalone: true, selector: "gtr-calendar-month", inputs: { addMonths: "addMonths", startDate: "startDate", endDate: "endDate", disabledDates: "disabledDates", firstDayOfWeek: "firstDayOfWeek", locale: "locale", range: "range", weekdayFormat: "weekdayFormat", view: "view", type: "type", maxDate: "maxDate", minDate: "minDate", calendarDate: "calendarDate" }, exportAs: ["gtrCalendarMonth"], ngImport: i0, template: "<table>\n <thead *ngIf=\"view === 'days'\">\n <tr>\n <th *ngFor=\"let weekDay of weekDays; index as i; count as cnt\" class=\"calendar-cell\">\n <div class=\"calendar-header-cell-inner\">\n {{ weekDay.date | gtrCalendarWeekday:weekdayFormat:locale }}\n </div>\n </th>\n </tr>\n </thead>\n <tbody (mouseleave)=\"handleCellMouseLeave()\" [ngSwitch]=\"view\">\n <ng-container *ngSwitchCase=\"'years'\">\n <tr *ngFor=\"let yearsRow of listOfYears; index as rowIdx\">\n <td\n (click)=\"handleYearCellClick(year)\"\n (keyup)=\"handleYearCellKeyUp($event, year)\"\n (mouseenter)=\"handleYearCellMouseEnter(year)\"\n gtrCalendarDay\n [gtrCalendarYear]=\"year\"\n *ngFor=\"let year of yearsRow; index as idx\"\n [ngClass]=\"year | gtrCalendarClassYear\"\n [tabindex]=\"0\"\n >\n <div class=\"calendar-cell-inner\">\n {{ yearNumber(year) }}\n </div>\n </td>\n </tr>\n </ng-container>\n <ng-container *ngSwitchCase=\"'months'\">\n <tr *ngFor=\"let monthsRow of listOfMonths; index as rowIdx\">\n <td\n (click)=\"handleMonthCellClick(rowIdx, idx)\"\n (keyup)=\"handleMonthCellKeyUp($event, rowIdx, idx)\"\n (mouseenter)=\"handleMonthCellMouseEnter(date, rowIdx, idx)\"\n gtrCalendarDay\n [gtrCalendarMonth]=\"date| gtrCalendarMonth:(rowIdx*3+idx)\"\n *ngFor=\"let month of monthsRow; index as idx\"\n [ngClass]=\"date | gtrCalendarClassMonth:(rowIdx*3+idx)\"\n [title]=\"date | gtrCalendarMonthTitle:(rowIdx*3+idx):locale\"\n [tabindex]=\"0\"\n >\n <div class=\"calendar-cell-inner\">\n {{ month }}\n </div>\n </td>\n </tr>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <tr *ngFor=\"let week of monthDetails; index as i\">\n <ng-container *ngFor=\"let dateObj of week; index as idx\">\n <td *ngIf=\"(dateObj.month === 'current' || showAdjacentDays); else emptyCell\"\n (click)=\"(dateObj.month === 'current' || selectAdjacentDays) && handleDayCellClick(dateObj.date)\"\n (keyup)=\"(dateObj.month === 'current' || selectAdjacentDays) && handleDayCellKeyUp($event, dateObj.date)\"\n (mouseenter)=\"(dateObj.month === 'current' || selectAdjacentDays) && handleCellMouseEnter(dateObj.date)\"\n [gtrCalendarDay]=\"dateObj\"\n [ngClass]=\"dateObj | gtrCalendarClassDay:{minDate, maxDate, disabledDates, dateFilter}\"\n [tabindex]=\"(dateObj.month === 'current' || selectAdjacentDays) && !isDateDisabled(dateObj.date) ? 0 : -1\"\n [title]=\"dateObj.date | gtrCalendarDayTitle:locale\"\n >\n <div class=\"calendar-cell-inner\">\n {{ dateObj.date | gtrCalendarDay:dayFormat:locale }}\n </div>\n </td>\n <ng-template #emptyCell>\n <td class=\"calendar-cell\"></td>\n </ng-template>\n </ng-container>\n </tr>\n </ng-container>\n </tbody>\n</table>\n\n\n", styles: [":root{--gtr-calendar-cell-selected-bg: var(--gtr-color-base-primary-base) !important}.calendar-header-cell-inner{color:var(--light-typography-color-heading-text, #4B465C);text-align:center;font-size:13px;font-style:normal;font-weight:600;line-height:14px}.calendar-cell.end.range.selected .calendar-cell-inner{border-radius:0 .375rem .375rem 0!important}.calendar-cell.start.range.selected .calendar-cell-inner{border-radius:.375rem 0 0 .375rem!important}.calendar-cell.selected:not(.previous):not(.next).end .calendar-cell-inner:before{border-radius:0 .375rem .375rem 0!important}.calendar-cell.selected:not(.previous):not(.next).start .calendar-cell-inner:before{border-radius:.375rem 0 0 .375rem!important}.calendar-cell.today .calendar-cell-inner{background-color:var(--gtr-color-base-success-20)!important;color:var(--gtr-color-base-success-100)!important;border-radius:.375rem!important}\n"], dependencies: [{ kind: "directive", type: GtrCalendarDayDirective, selector: "[gtrCalendarDay]", inputs: ["gtrCalendarDay", "gtrCalendarMonth", "gtrCalendarYear"] }, { kind: "pipe", type: GtrCalendarDayPipe, name: "gtrCalendarDay" }, { kind: "pipe", type: GtrCalendarDayTitlePipe, name: "gtrCalendarDayTitle" }, { kind: "pipe", type: GtrCalendarMonthTitlePipe, name: "gtrCalendarMonthTitle" }, { kind: "pipe", type: GtrCalendarMonthPipe, name: "gtrCalendarMonth" }, { kind: "pipe", type: GtrCalendarClassDayPipe, name: "gtrCalendarClassDay" }, { kind: "pipe", type: GtrCalendarClassMonthPipe, name: "gtrCalendarClassMonth" }, { kind: "pipe", type: GtrCalendarClassYearPipe, name: "gtrCalendarClassYear" }, { kind: "pipe", type: GtrCalendarWeekdayPipe, name: "gtrCalendarWeekday" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: NgSwitchDefault, selector: "[ngSwitchDefault]" }] }); }
|
|
3142
3135
|
}
|
|
3143
3136
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarMonthComponent, decorators: [{
|
|
3144
3137
|
type: Component,
|
|
@@ -3158,7 +3151,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3158
3151
|
NgSwitch,
|
|
3159
3152
|
NgSwitchCase,
|
|
3160
3153
|
NgSwitchDefault,
|
|
3161
|
-
], template: "<table>\n <thead *ngIf=\"view === 'days'\">\n <tr>\n <th *ngFor=\"let weekDay of weekDays; index as i; count as cnt\" class=\"calendar-cell\">\n <div class=\"calendar-header-cell-inner\">\n {{ weekDay.date | gtrCalendarWeekday:weekdayFormat:locale }}\n </div>\n </th>\n </tr>\n </thead>\n <tbody (mouseleave)=\"handleCellMouseLeave()\" [ngSwitch]=\"view\">\n <ng-container *ngSwitchCase=\"'years'\">\n <tr *ngFor=\"let yearsRow of listOfYears; index as rowIdx\">\n <td\n (click)=\"handleYearCellClick(year)\"\n (keyup)=\"handleYearCellKeyUp($event, year)\"\n (mouseenter)=\"handleYearCellMouseEnter(year)\"\n gtrCalendarDay\n [gtrCalendarYear]=\"year\"\n *ngFor=\"let year of yearsRow; index as idx\"\n [ngClass]=\"year | gtrCalendarClassYear\"\n [tabindex]=\"0\"\n >\n <div class=\"calendar-cell-inner\">\n {{ yearNumber(year) }}\n </div>\n </td>\n </tr>\n </ng-container>\n <ng-container *ngSwitchCase=\"'months'\">\n <tr *ngFor=\"let monthsRow of listOfMonths; index as rowIdx\">\n <td\n (click)=\"handleMonthCellClick(rowIdx, idx)\"\n (keyup)=\"handleMonthCellKeyUp($event,
|
|
3154
|
+
], template: "<table>\n <thead *ngIf=\"view === 'days'\">\n <tr>\n <th *ngFor=\"let weekDay of weekDays; index as i; count as cnt\" class=\"calendar-cell\">\n <div class=\"calendar-header-cell-inner\">\n {{ weekDay.date | gtrCalendarWeekday:weekdayFormat:locale }}\n </div>\n </th>\n </tr>\n </thead>\n <tbody (mouseleave)=\"handleCellMouseLeave()\" [ngSwitch]=\"view\">\n <ng-container *ngSwitchCase=\"'years'\">\n <tr *ngFor=\"let yearsRow of listOfYears; index as rowIdx\">\n <td\n (click)=\"handleYearCellClick(year)\"\n (keyup)=\"handleYearCellKeyUp($event, year)\"\n (mouseenter)=\"handleYearCellMouseEnter(year)\"\n gtrCalendarDay\n [gtrCalendarYear]=\"year\"\n *ngFor=\"let year of yearsRow; index as idx\"\n [ngClass]=\"year | gtrCalendarClassYear\"\n [tabindex]=\"0\"\n >\n <div class=\"calendar-cell-inner\">\n {{ yearNumber(year) }}\n </div>\n </td>\n </tr>\n </ng-container>\n <ng-container *ngSwitchCase=\"'months'\">\n <tr *ngFor=\"let monthsRow of listOfMonths; index as rowIdx\">\n <td\n (click)=\"handleMonthCellClick(rowIdx, idx)\"\n (keyup)=\"handleMonthCellKeyUp($event, rowIdx, idx)\"\n (mouseenter)=\"handleMonthCellMouseEnter(date, rowIdx, idx)\"\n gtrCalendarDay\n [gtrCalendarMonth]=\"date| gtrCalendarMonth:(rowIdx*3+idx)\"\n *ngFor=\"let month of monthsRow; index as idx\"\n [ngClass]=\"date | gtrCalendarClassMonth:(rowIdx*3+idx)\"\n [title]=\"date | gtrCalendarMonthTitle:(rowIdx*3+idx):locale\"\n [tabindex]=\"0\"\n >\n <div class=\"calendar-cell-inner\">\n {{ month }}\n </div>\n </td>\n </tr>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <tr *ngFor=\"let week of monthDetails; index as i\">\n <ng-container *ngFor=\"let dateObj of week; index as idx\">\n <td *ngIf=\"(dateObj.month === 'current' || showAdjacentDays); else emptyCell\"\n (click)=\"(dateObj.month === 'current' || selectAdjacentDays) && handleDayCellClick(dateObj.date)\"\n (keyup)=\"(dateObj.month === 'current' || selectAdjacentDays) && handleDayCellKeyUp($event, dateObj.date)\"\n (mouseenter)=\"(dateObj.month === 'current' || selectAdjacentDays) && handleCellMouseEnter(dateObj.date)\"\n [gtrCalendarDay]=\"dateObj\"\n [ngClass]=\"dateObj | gtrCalendarClassDay:{minDate, maxDate, disabledDates, dateFilter}\"\n [tabindex]=\"(dateObj.month === 'current' || selectAdjacentDays) && !isDateDisabled(dateObj.date) ? 0 : -1\"\n [title]=\"dateObj.date | gtrCalendarDayTitle:locale\"\n >\n <div class=\"calendar-cell-inner\">\n {{ dateObj.date | gtrCalendarDay:dayFormat:locale }}\n </div>\n </td>\n <ng-template #emptyCell>\n <td class=\"calendar-cell\"></td>\n </ng-template>\n </ng-container>\n </tr>\n </ng-container>\n </tbody>\n</table>\n\n\n", styles: [":root{--gtr-calendar-cell-selected-bg: var(--gtr-color-base-primary-base) !important}.calendar-header-cell-inner{color:var(--light-typography-color-heading-text, #4B465C);text-align:center;font-size:13px;font-style:normal;font-weight:600;line-height:14px}.calendar-cell.end.range.selected .calendar-cell-inner{border-radius:0 .375rem .375rem 0!important}.calendar-cell.start.range.selected .calendar-cell-inner{border-radius:.375rem 0 0 .375rem!important}.calendar-cell.selected:not(.previous):not(.next).end .calendar-cell-inner:before{border-radius:0 .375rem .375rem 0!important}.calendar-cell.selected:not(.previous):not(.next).start .calendar-cell-inner:before{border-radius:.375rem 0 0 .375rem!important}.calendar-cell.today .calendar-cell-inner{background-color:var(--gtr-color-base-success-20)!important;color:var(--gtr-color-base-success-100)!important;border-radius:.375rem!important}\n"] }]
|
|
3162
3155
|
}], ctorParameters: function () { return [{ type: GtrCalendarService }]; }, propDecorators: { addMonths: [{
|
|
3163
3156
|
type: Input
|
|
3164
3157
|
}], startDate: [{
|
|
@@ -3279,7 +3272,7 @@ class GtrCalendarComponent {
|
|
|
3279
3272
|
/**
|
|
3280
3273
|
* Set the format of day name.
|
|
3281
3274
|
* @default 'numeric'
|
|
3282
|
-
* @type
|
|
3275
|
+
* @type DayFormatType
|
|
3283
3276
|
*/
|
|
3284
3277
|
set dayFormat(value) {
|
|
3285
3278
|
this._dayFormat = value;
|
|
@@ -3365,10 +3358,8 @@ class GtrCalendarComponent {
|
|
|
3365
3358
|
* Max selectable date.
|
|
3366
3359
|
*/
|
|
3367
3360
|
set maxDate(value) {
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
this.calendarService.update({ maxDate: this._maxDate });
|
|
3371
|
-
}
|
|
3361
|
+
this._maxDate = !!value ? tryDate(value, 'maxDate') : null;
|
|
3362
|
+
this.calendarService.update({ maxDate: this._maxDate });
|
|
3372
3363
|
}
|
|
3373
3364
|
get maxDate() {
|
|
3374
3365
|
return this._maxDate;
|
|
@@ -3377,10 +3368,8 @@ class GtrCalendarComponent {
|
|
|
3377
3368
|
* Min selectable date.
|
|
3378
3369
|
*/
|
|
3379
3370
|
set minDate(value) {
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
this.calendarService.update({ minDate: this._minDate });
|
|
3383
|
-
}
|
|
3371
|
+
this._minDate = value ? tryDate(value, 'minDate') : null;
|
|
3372
|
+
this.calendarService.update({ minDate: this._minDate });
|
|
3384
3373
|
}
|
|
3385
3374
|
get minDate() {
|
|
3386
3375
|
return this._minDate;
|
|
@@ -3560,7 +3549,7 @@ class GtrCalendarComponent {
|
|
|
3560
3549
|
this.calendarService.update({ startDate: null });
|
|
3561
3550
|
}
|
|
3562
3551
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarComponent, deps: [{ token: GtrCalendarService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3563
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GtrCalendarComponent, isStandalone: true, selector: "gtr-calendar", inputs: { calendarDate: "calendarDate", calendars: "calendars", dayFormat: "dayFormat", disabledDates: "disabledDates", startDate: "startDate", endDate: "endDate", firstDayOfWeek: "firstDayOfWeek", locale: "locale", maxDate: "maxDate", minDate: "minDate", navigation: "navigation", navYearFirst: "navYearFirst", range: "range", view: "view", type: "type", weekdayFormat: "weekdayFormat", dateFilter: "dateFilter", selectAdjacentDays: "selectAdjacentDays", showAdjacentDays: "showAdjacentDays" }, outputs: { calendarCellHover: "calendarCellHover", calendarDateChange: "calendarDateChange", endDateChange: "endDateChange", startDateChange: "startDateChange", viewChange: "viewChange" }, host: { properties: { "class": "this.hostClasses" } }, providers: [GtrCalendarService], viewQueries: [{ propertyName: "calendarMonths", predicate: GtrCalendarMonthComponent, descendants: true }], exportAs: ["gtrCalendar"], ngImport: i0, template: "<ng-container *ngFor=\"let calendar of calendarsArray; let i=index;\">\n <div [ngClass]=\"view | gtrCalendarClassView\">\n <gtr-calendar-navigation\n [addMonths]=\"i\"\n [navigation]=\"navigation\"\n (navigationClick)=\"handleNavigationClick($event.direction, $event.years)\"\n ></gtr-calendar-navigation>\n\n <gtr-calendar-month\n [addMonths]=\"i\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [weekdayFormat]=\"weekdayFormat\"\n ></gtr-calendar-month>\n </div>\n</ng-container>\n\n", dependencies: [{ kind: "component", type: GtrCalendarNavigationComponent, selector: "gtr-calendar-navigation", inputs: ["addMonths", "calendarDate", "navigation", "
|
|
3552
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GtrCalendarComponent, isStandalone: true, selector: "gtr-calendar", inputs: { calendarDate: "calendarDate", calendars: "calendars", dayFormat: "dayFormat", disabledDates: "disabledDates", startDate: "startDate", endDate: "endDate", firstDayOfWeek: "firstDayOfWeek", locale: "locale", maxDate: "maxDate", minDate: "minDate", navigation: "navigation", navYearFirst: "navYearFirst", range: "range", view: "view", type: "type", weekdayFormat: "weekdayFormat", dateFilter: "dateFilter", selectAdjacentDays: "selectAdjacentDays", showAdjacentDays: "showAdjacentDays" }, outputs: { calendarCellHover: "calendarCellHover", calendarDateChange: "calendarDateChange", endDateChange: "endDateChange", startDateChange: "startDateChange", viewChange: "viewChange" }, host: { properties: { "class": "this.hostClasses" } }, providers: [GtrCalendarService], viewQueries: [{ propertyName: "calendarMonths", predicate: GtrCalendarMonthComponent, descendants: true }], exportAs: ["gtrCalendar"], ngImport: i0, template: "<ng-container *ngFor=\"let calendar of calendarsArray; let i=index;\">\n <div [ngClass]=\"view | gtrCalendarClassView\">\n <gtr-calendar-navigation\n [addMonths]=\"i\"\n [navigation]=\"navigation\"\n (navigationClick)=\"handleNavigationClick($event.direction, $event.years)\"\n ></gtr-calendar-navigation>\n\n <gtr-calendar-month\n [addMonths]=\"i\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [weekdayFormat]=\"weekdayFormat\"\n ></gtr-calendar-month>\n </div>\n</ng-container>\n\n", dependencies: [{ kind: "component", type: GtrCalendarNavigationComponent, selector: "gtr-calendar-navigation", inputs: ["addMonths", "calendarDate", "navigation", "navYearFirst"], outputs: ["navigationClick"] }, { kind: "pipe", type: GtrCalendarClassViewPipe, name: "gtrCalendarClassView" }, { kind: "component", type: GtrCalendarMonthComponent, selector: "gtr-calendar-month", inputs: ["addMonths", "startDate", "endDate", "disabledDates", "firstDayOfWeek", "locale", "range", "weekdayFormat", "view", "type", "maxDate", "minDate", "calendarDate"], exportAs: ["gtrCalendarMonth"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
|
3564
3553
|
}
|
|
3565
3554
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCalendarComponent, decorators: [{
|
|
3566
3555
|
type: Component,
|
|
@@ -6656,6 +6645,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
6656
6645
|
args: [GtrTemplateIdDirective, { descendants: true }]
|
|
6657
6646
|
}] } });
|
|
6658
6647
|
|
|
6648
|
+
class GtrCustomRangeKeyPipe {
|
|
6649
|
+
transform(customRange, ...args) {
|
|
6650
|
+
return customRange[0];
|
|
6651
|
+
}
|
|
6652
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCustomRangeKeyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
6653
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: GtrCustomRangeKeyPipe, isStandalone: true, name: "gtrCustomRangeKey" }); }
|
|
6654
|
+
}
|
|
6655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrCustomRangeKeyPipe, decorators: [{
|
|
6656
|
+
type: Pipe,
|
|
6657
|
+
args: [{
|
|
6658
|
+
name: 'gtrCustomRangeKey',
|
|
6659
|
+
standalone: true,
|
|
6660
|
+
}]
|
|
6661
|
+
}] });
|
|
6662
|
+
|
|
6663
|
+
registerLocaleData(localeEsUs);
|
|
6659
6664
|
/** Must be a valid date string */
|
|
6660
6665
|
// todo: validation
|
|
6661
6666
|
// export function invalidDateStringValidator(locale: string): ValidatorFn {
|
|
@@ -6665,7 +6670,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
6665
6670
|
// const dateShim = cvtDate(control.value, locale);
|
|
6666
6671
|
// // @ts-ignore
|
|
6667
6672
|
// // control.setValue(new Date(dateShim.year, dateShim.month, dateShim.day))
|
|
6673
|
+
// console.log('dateShim', dateShim, locale);
|
|
6668
6674
|
// const validDate = isValidDate(control.value);
|
|
6675
|
+
// console.log('invalidDateStringValidator', control, control.value, validDate);
|
|
6669
6676
|
// return validDate ? { invalidDateStringValidator: { value: control.value } } : null;
|
|
6670
6677
|
// };
|
|
6671
6678
|
// }
|
|
@@ -6678,13 +6685,12 @@ class GtrDateRangePickerComponent {
|
|
|
6678
6685
|
/**
|
|
6679
6686
|
* Set the format of day name.
|
|
6680
6687
|
* @default 'numeric'
|
|
6681
|
-
* @type
|
|
6688
|
+
* @type DayFormatType
|
|
6682
6689
|
*/
|
|
6683
6690
|
this.dayFormat = 'numeric';
|
|
6684
6691
|
this._calendars = 2;
|
|
6685
6692
|
this._cleaner = true;
|
|
6686
6693
|
this.#closeOnSelect = false;
|
|
6687
|
-
this._format = {};
|
|
6688
6694
|
this._indicator = true;
|
|
6689
6695
|
this._inputReadOnly = false;
|
|
6690
6696
|
this._navYearFirst = false;
|
|
@@ -6694,7 +6700,7 @@ class GtrDateRangePickerComponent {
|
|
|
6694
6700
|
* type string
|
|
6695
6701
|
*/
|
|
6696
6702
|
this.placeholder = ['Start date', 'End date'];
|
|
6697
|
-
this.
|
|
6703
|
+
this._rangesType = 'days';
|
|
6698
6704
|
/**
|
|
6699
6705
|
* Sets the color context of the cancel button to one of Gettrx’s themed colors.
|
|
6700
6706
|
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
@@ -6726,7 +6732,7 @@ class GtrDateRangePickerComponent {
|
|
|
6726
6732
|
this._value = {};
|
|
6727
6733
|
/**
|
|
6728
6734
|
* Set length or format of day name.
|
|
6729
|
-
* @type
|
|
6735
|
+
* @type WeekdayFormatType
|
|
6730
6736
|
* @default 'short'
|
|
6731
6737
|
*/
|
|
6732
6738
|
this.weekdayFormat = 'short';
|
|
@@ -6752,8 +6758,9 @@ class GtrDateRangePickerComponent {
|
|
|
6752
6758
|
this.templates = {};
|
|
6753
6759
|
this.dateChangeSubscriptions = [];
|
|
6754
6760
|
this.isMobile = true;
|
|
6755
|
-
this.
|
|
6756
|
-
this.
|
|
6761
|
+
this.showRanges = false;
|
|
6762
|
+
this._startDateValue = this.formatDate(this.startDate);
|
|
6763
|
+
this._endDateValue = this.formatDate(this.endDate);
|
|
6757
6764
|
// todo: validation
|
|
6758
6765
|
this.startDateInput = new FormControl({ value: this.startDateValue, disabled: this.disabled }, [
|
|
6759
6766
|
Validators.required,
|
|
@@ -6767,12 +6774,17 @@ class GtrDateRangePickerComponent {
|
|
|
6767
6774
|
// Validators.maxLength(10),
|
|
6768
6775
|
// invalidDateStringValidator(this.locale)
|
|
6769
6776
|
]);
|
|
6777
|
+
this.#breakpoints = {
|
|
6778
|
+
OneCalendarRanges: '(min-width: 480px)',
|
|
6779
|
+
TwoCalendars: '(max-width: 650px)',
|
|
6780
|
+
TwoCalendarsRanges: '(max-width: 810px)',
|
|
6781
|
+
};
|
|
6770
6782
|
this.setInputValue = (elementRef, date) => {
|
|
6771
6783
|
if (!elementRef) {
|
|
6772
6784
|
return;
|
|
6773
6785
|
}
|
|
6774
|
-
elementRef.nativeElement.value =
|
|
6775
|
-
//elementRef.nativeElement.valueAsDate = date;
|
|
6786
|
+
elementRef.nativeElement.value = this.formatDate(date);
|
|
6787
|
+
// elementRef.nativeElement.valueAsDate = date;
|
|
6776
6788
|
return;
|
|
6777
6789
|
};
|
|
6778
6790
|
this.onChange = (value) => { };
|
|
@@ -6812,20 +6824,6 @@ class GtrDateRangePickerComponent {
|
|
|
6812
6824
|
return this.#closeOnSelect;
|
|
6813
6825
|
}
|
|
6814
6826
|
#closeOnSelect;
|
|
6815
|
-
/**
|
|
6816
|
-
* Set date format.
|
|
6817
|
-
* We use date-fns to format dates. Visit https://date-fns.org/v2.28.0/docs/format to check accepted patterns.
|
|
6818
|
-
*/
|
|
6819
|
-
set format(value) {
|
|
6820
|
-
this._format = value;
|
|
6821
|
-
}
|
|
6822
|
-
get format() {
|
|
6823
|
-
if (this.rangesType === 'months')
|
|
6824
|
-
this._format = { month: 'long', year: 'numeric' };
|
|
6825
|
-
if (this.rangesType === 'years')
|
|
6826
|
-
this._format = { year: 'numeric' };
|
|
6827
|
-
return this._format;
|
|
6828
|
-
}
|
|
6829
6827
|
/**
|
|
6830
6828
|
* Toggle visibility or set the content of the input indicator.
|
|
6831
6829
|
* @type boolean
|
|
@@ -6866,6 +6864,20 @@ class GtrDateRangePickerComponent {
|
|
|
6866
6864
|
get alwaysOpen() {
|
|
6867
6865
|
return this._alwaysOpen;
|
|
6868
6866
|
}
|
|
6867
|
+
set rangesType(value) {
|
|
6868
|
+
if (value === 'months') {
|
|
6869
|
+
this.format = 'MMMM YYYY';
|
|
6870
|
+
this.locale = 'en-US';
|
|
6871
|
+
}
|
|
6872
|
+
if (value === 'years') {
|
|
6873
|
+
this.format = 'YYYY';
|
|
6874
|
+
this.locale = 'en-US';
|
|
6875
|
+
}
|
|
6876
|
+
this._rangesType = value;
|
|
6877
|
+
}
|
|
6878
|
+
get rangesType() {
|
|
6879
|
+
return this._rangesType;
|
|
6880
|
+
}
|
|
6869
6881
|
/**
|
|
6870
6882
|
* Default icon or character that separates two dates.
|
|
6871
6883
|
* @type boolean
|
|
@@ -6887,7 +6899,7 @@ class GtrDateRangePickerComponent {
|
|
|
6887
6899
|
}
|
|
6888
6900
|
get timepicker() {
|
|
6889
6901
|
return false;
|
|
6890
|
-
//
|
|
6902
|
+
// return this._timepicker;
|
|
6891
6903
|
}
|
|
6892
6904
|
/**
|
|
6893
6905
|
* Toggle the visibility of the dropdown date-picker component.
|
|
@@ -6904,7 +6916,7 @@ class GtrDateRangePickerComponent {
|
|
|
6904
6916
|
const prevDate = this._startDate ? new Date(this._startDate) : null;
|
|
6905
6917
|
this._startDate = value ? new Date(value) : null;
|
|
6906
6918
|
if (prevDate?.getTime() !== this._startDate?.getTime()) {
|
|
6907
|
-
this.startDateValue = this.
|
|
6919
|
+
this.startDateValue = this.formatDate(this._startDate);
|
|
6908
6920
|
this.startDateChange.emit(this._startDate);
|
|
6909
6921
|
}
|
|
6910
6922
|
}
|
|
@@ -6915,7 +6927,7 @@ class GtrDateRangePickerComponent {
|
|
|
6915
6927
|
const prevDate = this._endDate ? new Date(this._endDate ?? 0) : null;
|
|
6916
6928
|
this._endDate = value ? new Date(value) : null;
|
|
6917
6929
|
if (prevDate?.getTime() !== this._endDate?.getTime()) {
|
|
6918
|
-
this.endDateValue = this.
|
|
6930
|
+
this.endDateValue = this.formatDate(this._endDate);
|
|
6919
6931
|
this.endDateChange.emit(this._endDate);
|
|
6920
6932
|
}
|
|
6921
6933
|
}
|
|
@@ -6990,15 +7002,15 @@ class GtrDateRangePickerComponent {
|
|
|
6990
7002
|
#selectAdjacentDays;
|
|
6991
7003
|
subscribeDateChange(subscribe = true) {
|
|
6992
7004
|
if (subscribe) {
|
|
6993
|
-
//todo
|
|
6994
|
-
//this.dateChangeSubscriptions.push(this.startDateChange.subscribe(next => {
|
|
6995
|
-
//
|
|
6996
|
-
//
|
|
6997
|
-
//}));
|
|
6998
|
-
//this.dateChangeSubscriptions.push(this.startDateChange.subscribe(next => {
|
|
6999
|
-
//
|
|
7000
|
-
//
|
|
7001
|
-
//}));
|
|
7005
|
+
// todo
|
|
7006
|
+
// this.dateChangeSubscriptions.push(this.startDateChange.subscribe(next => {
|
|
7007
|
+
// this.startDate = next;
|
|
7008
|
+
// this.onChange(next);
|
|
7009
|
+
// }));
|
|
7010
|
+
// this.dateChangeSubscriptions.push(this.startDateChange.subscribe(next => {
|
|
7011
|
+
// this.endDate = next;
|
|
7012
|
+
// this.onChange(next);
|
|
7013
|
+
// }));
|
|
7002
7014
|
return;
|
|
7003
7015
|
}
|
|
7004
7016
|
this.dateChangeSubscriptions.forEach((subscription) => {
|
|
@@ -7042,27 +7054,41 @@ class GtrDateRangePickerComponent {
|
|
|
7042
7054
|
}
|
|
7043
7055
|
get datePickerClasses() {
|
|
7044
7056
|
return {
|
|
7045
|
-
'is-valid': this.valid === true,
|
|
7046
|
-
'is-invalid': this.valid === false,
|
|
7057
|
+
'is-valid': this.valid === true || this.invalid !== true,
|
|
7058
|
+
'is-invalid': this.valid === false || this.invalid === true,
|
|
7047
7059
|
};
|
|
7048
7060
|
}
|
|
7049
7061
|
formatDate(date) {
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7062
|
+
return !date || !isValidDate(date)
|
|
7063
|
+
? ''
|
|
7064
|
+
: this.format
|
|
7065
|
+
? formatDate(date, this.format, this.locale)
|
|
7066
|
+
: this.timepicker
|
|
7067
|
+
? date.toLocaleString(this.locale)
|
|
7068
|
+
: date.toLocaleDateString(this.locale);
|
|
7069
|
+
}
|
|
7070
|
+
#breakpoints;
|
|
7057
7071
|
ngOnInit() {
|
|
7072
|
+
this.customRanges = this.ranges ? Object.entries(this.ranges) : [];
|
|
7073
|
+
const breakpoints = this.#breakpoints;
|
|
7058
7074
|
this.layoutChanges = this.breakpointObserver
|
|
7059
|
-
.observe([
|
|
7075
|
+
.observe([
|
|
7076
|
+
breakpoints.OneCalendarRanges,
|
|
7077
|
+
breakpoints.TwoCalendars,
|
|
7078
|
+
breakpoints.TwoCalendarsRanges,
|
|
7079
|
+
])
|
|
7060
7080
|
.subscribe((result) => {
|
|
7061
|
-
|
|
7081
|
+
if (result.matches) {
|
|
7082
|
+
this.isMobile =
|
|
7083
|
+
(this.customRanges?.length > 0 && result.breakpoints[breakpoints.TwoCalendarsRanges]) ||
|
|
7084
|
+
result.breakpoints[breakpoints.TwoCalendars];
|
|
7085
|
+
if (this.customRanges?.length > 0) {
|
|
7086
|
+
this.showRanges = !result.breakpoints[breakpoints.OneCalendarRanges];
|
|
7087
|
+
}
|
|
7088
|
+
}
|
|
7062
7089
|
});
|
|
7063
|
-
this.
|
|
7064
|
-
this.
|
|
7065
|
-
this.endDateValue = this.endDate?.toLocaleDateString(this.locale, this.format) ?? '';
|
|
7090
|
+
this.startDateValue = this.formatDate(this.startDate);
|
|
7091
|
+
this.endDateValue = this.formatDate(this.endDate);
|
|
7066
7092
|
this.subscribeDateChange();
|
|
7067
7093
|
}
|
|
7068
7094
|
ngOnDestroy() {
|
|
@@ -7078,7 +7104,7 @@ class GtrDateRangePickerComponent {
|
|
|
7078
7104
|
}
|
|
7079
7105
|
ngOnChanges(changes) {
|
|
7080
7106
|
if (changes['date']) {
|
|
7081
|
-
//for date-picker component
|
|
7107
|
+
// for date-picker component
|
|
7082
7108
|
const date = this.convertValueToDate(changes['date']?.currentValue) ?? null;
|
|
7083
7109
|
this.handleStartDateChange(date);
|
|
7084
7110
|
this.calendarDate = date ?? this.calendarDate;
|
|
@@ -7092,6 +7118,10 @@ class GtrDateRangePickerComponent {
|
|
|
7092
7118
|
const date = this.convertValueToDate(changes['endDate']?.currentValue) ?? null;
|
|
7093
7119
|
this.handleEndDateChange(date);
|
|
7094
7120
|
}
|
|
7121
|
+
if (changes['locale']) {
|
|
7122
|
+
this.startDateValue = this.formatDate(this.startDate);
|
|
7123
|
+
this.endDateValue = this.formatDate(this.endDate);
|
|
7124
|
+
}
|
|
7095
7125
|
}
|
|
7096
7126
|
convertValueToDate(value) {
|
|
7097
7127
|
if (!value) {
|
|
@@ -7133,7 +7163,7 @@ class GtrDateRangePickerComponent {
|
|
|
7133
7163
|
handleStartDateChange(date) {
|
|
7134
7164
|
if (date?.getTime() !== this.startDate?.getTime()) {
|
|
7135
7165
|
this.startDate = date ?? null;
|
|
7136
|
-
this.startDateValue =
|
|
7166
|
+
this.startDateValue = this.formatDate(this.startDate);
|
|
7137
7167
|
this.inputStartHoverValue = null;
|
|
7138
7168
|
this.value = this.range
|
|
7139
7169
|
? { startDate: this.startDate, endDate: this.endDate }
|
|
@@ -7146,7 +7176,7 @@ class GtrDateRangePickerComponent {
|
|
|
7146
7176
|
return;
|
|
7147
7177
|
}
|
|
7148
7178
|
this.endDate = date ?? null;
|
|
7149
|
-
this.endDateValue =
|
|
7179
|
+
this.endDateValue = this.formatDate(this.endDate);
|
|
7150
7180
|
this.inputEndHoverValue = null;
|
|
7151
7181
|
this.value = this.range
|
|
7152
7182
|
? { startDate: this.startDate, endDate: this.endDate }
|
|
@@ -7220,7 +7250,7 @@ class GtrDateRangePickerComponent {
|
|
|
7220
7250
|
useExisting: forwardRef((() => GtrDateRangePickerComponent)),
|
|
7221
7251
|
multi: true,
|
|
7222
7252
|
},
|
|
7223
|
-
], queries: [{ propertyName: "contentTemplates", predicate: GtrTemplateIdDirective, descendants: true }], viewQueries: [{ propertyName: "calendarComponent", first: true, predicate: GtrCalendarComponent, descendants: true }, { propertyName: "startDateElementRef", first: true, predicate: ["startDateElementRef"], descendants: true }, { propertyName: "endDateElementRef", first: true, predicate: ["endDateElementRef"], descendants: true }], exportAs: ["gtrDateRangePicker"], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"alwaysOpen\">\n <div class=\"date-range-picker-input\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div class=\"date-range-picker-calendar\">\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"!alwaysOpen\">\n <gtr-dropdown #dropdown=\"gtrDropdown\"\n [autoClose]=\"'outside'\"\n class=\"date-picker picker\"\n [ngClass]=\"datePickerClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n\n <div gtrDropdownToggle\n [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div gtrDropdownMenu>\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n </gtr-dropdown>\n</ng-container>\n\n<ng-template #dateRangePickerInput>\n\n <gtr-input-group [sizing]=\"size ?? ''\"\n [invalid]=\"invalid\"\n class=\"picker-input-group\"\n >\n <input (change)=\"handleStartDateInputChange($event)\"\n [formControl]=\"startDateInput\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n gtrFormControl\n #startDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"range ? undefined : valid\"\n class=\"date-picker-input\"\n >\n <span *ngIf=\"range && separator !== false\" gtrInputGroupText>\n <span class=\"picker-input-group-icon date-picker-arrow-icon\"></span>\n </span>\n <input (change)=\"handleEndDateInputChange($event)\"\n *ngIf=\"range\"\n [formControl]=\"endDateInput\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n gtrFormControl\n #endDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"valid ?? undefined\"\n class=\"date-picker-input\"\n >\n\n <ng-container *ngIf=\"!alwaysOpen\">\n <span *ngIf=\"indicator || cleaner\" class=\"picker-input-group-icons\">\n <span *ngIf=\"indicator\" class=\"picker-input-group-indicator\">\n <gtr-icon name=\"chevron-down\" [size]=\"20\"></gtr-icon>\n </span>\n <span (click)=\"!disabled && handleClear($event)\"\n *ngIf=\"cleaner && startDateElementRef.value && !disabled\"\n class=\"picker-input-group-cleaner\" role=\"button\">\n <gtr-icon name=\"x\" [size]=\"20\"></gtr-icon>\n </span>\n </span>\n </ng-container>\n </gtr-input-group>\n</ng-template>\n\n<ng-template #dateRangePicker>\n\n <div class=\"date-picker-body\">\n <ng-template [ngIf]=\"!isMobile\">\n <div *ngIf=\"ranges\" class=\"date-picker-ranges\">\n <button (click)=\"setCustomRange(customRange)\"\n *ngFor=\"let customRange of customRanges\"\n [color]=\"rangesButtonsColor\"\n [size]=\"rangesButtonsSize\"\n [variant]=\"rangesButtonsVariant\"\n gtrButton>\n {{getCustomRangeKey(customRange)}}\n </button>\n </div>\n </ng-template>\n <gtr-calendar\n (calendarCellHover)=\"handleCalendarCellHover($event)\"\n (calendarDateChange)=\"handleCalendarDateChange($event)\"\n (endDateChange)=\"handleEndDateChange($event)\"\n (startDateChange)=\"handleStartDateChange($event)\"\n [calendarDate]=\"calendarDate\"\n [calendars]=\"isMobile ? 1 : calendars\"\n [dateFilter]=\"dateFilter\"\n [disabledDates]=\"disabledDates\"\n [endDate]=\"endDate\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [locale]=\"locale\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [navigation]=\"navigation\"\n [range]=\"range\"\n [startDate]=\"startDate\"\n [navYearFirst]=\"navYearFirst\"\n [dayFormat]=\"dayFormat\"\n [weekdayFormat]=\"weekdayFormat\"\n [selectAdjacentDays]=\"selectAdjacentDays\"\n [showAdjacentDays]=\"showAdjacentDays\"\n [type]=\"rangesType\"\n class=\"date-picker-calendars\"\n ></gtr-calendar>\n <div *ngIf=\"false && timepicker\" class=\"date-picker-timepickers\">\n <!-- todo-->\n <gtr-time-picker\n variant=\"select\"\n [locale]=\"locale\"\n [disabled]=\"!startDate\"\n [time]=\"startDate ?? undefined\"\n (timeChange)=\"handleStartTimeChange($event)\"\n ></gtr-time-picker>\n <gtr-time-picker\n *ngIf=\"range\"\n variant=\"select\"\n [locale]=\"locale\"\n [disabled]=\"!endDate\"\n [time]=\"endDate ?? undefined\"\n (timeChange)=\"handleEndTimeChange($event)\"\n ></gtr-time-picker>\n </div>\n </div>\n\n\n</ng-template>\n", styles: [".picker-input-group-indicator{color:var(--gtr-color-base-black-80)!important}.picker-input-group-icons{border:none;display:flex;align-items:center;padding:0 14px}.date-picker-input{border:none!important;outline:none!important;padding:7px 14px}.picker-input-group{outline:none!important;box-shadow:none!important;background-color:#fff!important;border-radius:6px!important;border:1px solid var(--light-solid-color-extra-divider, #DBDADE)!important;background:var(--light-solid-color-extra-card-background, #FFF)!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: GtrCalendarComponent, selector: "gtr-calendar", inputs: ["calendarDate", "calendars", "dayFormat", "disabledDates", "startDate", "endDate", "firstDayOfWeek", "locale", "maxDate", "minDate", "navigation", "navYearFirst", "range", "view", "type", "weekdayFormat", "dateFilter", "selectAdjacentDays", "showAdjacentDays"], outputs: ["calendarCellHover", "calendarDateChange", "endDateChange", "startDateChange", "viewChange"], exportAs: ["gtrCalendar"] }, { kind: "component", type: GtrTimePickerComponent, selector: "gtr-time-picker", inputs: ["cleaner", "dateTimeFormatOptions", "disabled", "filterHours", "filterMinutes", "filterSeconds", "indicator", "inputReadOnly", "locale", "placeholder", "seconds", "size", "time", "variant", "valid", "visible"], outputs: ["timeChange"], exportAs: ["cTimePicker"] }, { kind: "directive", type: GtrButtonDirective, selector: "[gtrButton]", inputs: ["active", "color", "disabled", "shape", "size", "type", "variant"], exportAs: ["gtrButton"] }, { kind: "component", type: GtrDropdownComponent, selector: "gtr-dropdown", inputs: ["alignment", "autoClose", "dark", "direction", "placement", "popper", "popperOptions", "variant", "visible"], outputs: ["visibleChange"], exportAs: ["gtrDropdown"] }, { kind: "directive", type: GtrDropdownToggleDirective, selector: "[gtrDropdownToggle]", inputs: ["dropdownComponent", "disabled", "caret", "split"], exportAs: ["gtrDropdownToggle"] }, { kind: "directive", type: GtrDropdownMenuDirective, selector: "[gtrDropdownMenu]", inputs: ["alignment", "visible", "dark"], exportAs: ["gtrDropdownMenu"] }, { kind: "component", type: GtrInputGroupComponent, selector: "gtr-input-group", inputs: ["sizing", "invalid"] }, { kind: "directive", type: GtrFormControlDirective, selector: "input[gtrFormControl], textarea[gtrFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }, { kind: "directive", type: GtrInputGroupTextDirective, selector: "[gtrInputGroupText]" }, { kind: "component", type: GtrIconComponent, selector: "gtr-icon", inputs: ["name", "weight", "color", "size", "iconId"] }] }); }
|
|
7253
|
+
], queries: [{ propertyName: "contentTemplates", predicate: GtrTemplateIdDirective, descendants: true }], viewQueries: [{ propertyName: "startDateElementRef", first: true, predicate: ["startDateElementRef"], descendants: true }, { propertyName: "endDateElementRef", first: true, predicate: ["endDateElementRef"], descendants: true }], exportAs: ["gtrDateRangePicker"], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"alwaysOpen\">\n <div class=\"date-range-picker-input\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div class=\"date-range-picker-calendar\">\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"!alwaysOpen\">\n <gtr-dropdown #dropdown=\"gtrDropdown\"\n [autoClose]=\"'outside'\"\n class=\"date-picker picker\"\n [ngClass]=\"datePickerClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n\n <div gtrDropdownToggle\n [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div gtrDropdownMenu>\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n </gtr-dropdown>\n</ng-container>\n\n<ng-template #dateRangePickerInput>\n\n <gtr-input-group [sizing]=\"size ?? ''\"\n [invalid]=\"invalid\"\n class=\"picker-input-group\"\n >\n <input (change)=\"handleStartDateInputChange($event)\"\n [formControl]=\"startDateInput\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n gtrFormControl\n #startDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"range ? undefined : valid\"\n class=\"date-picker-input\"\n >\n <span *ngIf=\"range && separator !== false\" gtrInputGroupText>\n <span class=\"picker-input-group-icon date-picker-arrow-icon\"></span>\n </span>\n <input (change)=\"handleEndDateInputChange($event)\"\n *ngIf=\"range\"\n [formControl]=\"endDateInput\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n gtrFormControl\n #endDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"valid ?? undefined\"\n class=\"date-picker-input\"\n >\n\n <ng-container *ngIf=\"!alwaysOpen\">\n <span *ngIf=\"indicator || cleaner\" class=\"picker-input-group-icons\">\n <span *ngIf=\"indicator\" class=\"picker-input-group-indicator\">\n <gtr-icon name=\"chevron-down\" [size]=\"20\"></gtr-icon>\n </span>\n <span (click)=\"!disabled && handleClear($event)\"\n *ngIf=\"cleaner && startDateElementRef.value && !disabled\"\n class=\"picker-input-group-cleaner\" role=\"button\">\n <gtr-icon name=\"x\" [size]=\"20\"></gtr-icon>\n </span>\n </span>\n </ng-container>\n </gtr-input-group>\n</ng-template>\n\n<ng-template #dateRangePicker>\n\n <div class=\"date-picker-body\">\n <ng-template [ngIf]=\"!showRanges\">\n <div *ngIf=\"ranges && customRanges.length > 0\" class=\"date-picker-ranges\">\n <button (click)=\"setCustomRange(customRange)\"\n *ngFor=\"let customRange of customRanges\"\n [color]=\"rangesButtonsColor\"\n [size]=\"rangesButtonsSize\"\n [variant]=\"rangesButtonsVariant\"\n gtrButton>\n {{customRange | gtrCustomRangeKey}}\n </button>\n </div>\n </ng-template>\n <gtr-calendar\n (calendarCellHover)=\"handleCalendarCellHover($event)\"\n (calendarDateChange)=\"handleCalendarDateChange($event)\"\n (endDateChange)=\"handleEndDateChange($event)\"\n (startDateChange)=\"handleStartDateChange($event)\"\n [calendarDate]=\"calendarDate\"\n [calendars]=\"isMobile ? 1 : calendars\"\n [dateFilter]=\"dateFilter\"\n [disabledDates]=\"disabledDates\"\n [endDate]=\"endDate\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [locale]=\"locale\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [navigation]=\"navigation\"\n [range]=\"range\"\n [startDate]=\"startDate\"\n [navYearFirst]=\"navYearFirst\"\n [dayFormat]=\"dayFormat\"\n [weekdayFormat]=\"weekdayFormat\"\n [selectAdjacentDays]=\"selectAdjacentDays\"\n [showAdjacentDays]=\"showAdjacentDays\"\n [type]=\"rangesType\"\n class=\"date-picker-calendars\"\n ></gtr-calendar>\n <div *ngIf=\"false && timepicker\" class=\"date-picker-timepickers\">\n <!-- todo-->\n <gtr-time-picker\n variant=\"select\"\n [locale]=\"locale\"\n [disabled]=\"!startDate\"\n [time]=\"startDate ?? undefined\"\n (timeChange)=\"handleStartTimeChange($event)\"\n ></gtr-time-picker>\n <gtr-time-picker\n *ngIf=\"range\"\n variant=\"select\"\n [locale]=\"locale\"\n [disabled]=\"!endDate\"\n [time]=\"endDate ?? undefined\"\n (timeChange)=\"handleEndTimeChange($event)\"\n ></gtr-time-picker>\n </div>\n </div>\n\n\n</ng-template>\n", styles: [".picker-input-group-indicator{color:var(--gtr-color-base-black-80)!important}.picker-input-group-icons{border:none;display:flex;align-items:center;padding:0 14px}.date-picker-input{border:none!important;outline:none!important;padding:7px 14px}.picker-input-group{outline:none!important;box-shadow:none!important;background-color:#fff!important;border-radius:6px!important;border:1px solid var(--light-solid-color-extra-divider, #DBDADE)!important;background:var(--light-solid-color-extra-card-background, #FFF)!important}.date-picker-calendars{background-color:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: GtrCalendarComponent, selector: "gtr-calendar", inputs: ["calendarDate", "calendars", "dayFormat", "disabledDates", "startDate", "endDate", "firstDayOfWeek", "locale", "maxDate", "minDate", "navigation", "navYearFirst", "range", "view", "type", "weekdayFormat", "dateFilter", "selectAdjacentDays", "showAdjacentDays"], outputs: ["calendarCellHover", "calendarDateChange", "endDateChange", "startDateChange", "viewChange"], exportAs: ["gtrCalendar"] }, { kind: "component", type: GtrTimePickerComponent, selector: "gtr-time-picker", inputs: ["cleaner", "dateTimeFormatOptions", "disabled", "filterHours", "filterMinutes", "filterSeconds", "indicator", "inputReadOnly", "locale", "placeholder", "seconds", "size", "time", "variant", "valid", "visible"], outputs: ["timeChange"], exportAs: ["cTimePicker"] }, { kind: "directive", type: GtrButtonDirective, selector: "[gtrButton]", inputs: ["active", "color", "disabled", "shape", "size", "type", "variant"], exportAs: ["gtrButton"] }, { kind: "component", type: GtrDropdownComponent, selector: "gtr-dropdown", inputs: ["alignment", "autoClose", "dark", "direction", "placement", "popper", "popperOptions", "variant", "visible"], outputs: ["visibleChange"], exportAs: ["gtrDropdown"] }, { kind: "directive", type: GtrDropdownToggleDirective, selector: "[gtrDropdownToggle]", inputs: ["dropdownComponent", "disabled", "caret", "split"], exportAs: ["gtrDropdownToggle"] }, { kind: "directive", type: GtrDropdownMenuDirective, selector: "[gtrDropdownMenu]", inputs: ["alignment", "visible", "dark"], exportAs: ["gtrDropdownMenu"] }, { kind: "component", type: GtrInputGroupComponent, selector: "gtr-input-group", inputs: ["sizing", "invalid"] }, { kind: "directive", type: GtrFormControlDirective, selector: "input[gtrFormControl], textarea[gtrFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }, { kind: "directive", type: GtrInputGroupTextDirective, selector: "[gtrInputGroupText]" }, { kind: "component", type: GtrIconComponent, selector: "gtr-icon", inputs: ["name", "weight", "color", "size", "iconId"] }, { kind: "pipe", type: GtrCustomRangeKeyPipe, name: "gtrCustomRangeKey" }] }); }
|
|
7224
7254
|
}
|
|
7225
7255
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrDateRangePickerComponent, decorators: [{
|
|
7226
7256
|
type: Component,
|
|
@@ -7230,7 +7260,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7230
7260
|
useExisting: forwardRef((() => GtrDateRangePickerComponent)),
|
|
7231
7261
|
multi: true,
|
|
7232
7262
|
},
|
|
7233
|
-
], template: "<ng-container *ngIf=\"alwaysOpen\">\n <div class=\"date-range-picker-input\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div class=\"date-range-picker-calendar\">\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"!alwaysOpen\">\n <gtr-dropdown #dropdown=\"gtrDropdown\"\n [autoClose]=\"'outside'\"\n class=\"date-picker picker\"\n [ngClass]=\"datePickerClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n\n <div gtrDropdownToggle\n [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div gtrDropdownMenu>\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n </gtr-dropdown>\n</ng-container>\n\n<ng-template #dateRangePickerInput>\n\n <gtr-input-group [sizing]=\"size ?? ''\"\n [invalid]=\"invalid\"\n class=\"picker-input-group\"\n >\n <input (change)=\"handleStartDateInputChange($event)\"\n [formControl]=\"startDateInput\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n gtrFormControl\n #startDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"range ? undefined : valid\"\n class=\"date-picker-input\"\n >\n <span *ngIf=\"range && separator !== false\" gtrInputGroupText>\n <span class=\"picker-input-group-icon date-picker-arrow-icon\"></span>\n </span>\n <input (change)=\"handleEndDateInputChange($event)\"\n *ngIf=\"range\"\n [formControl]=\"endDateInput\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n gtrFormControl\n #endDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"valid ?? undefined\"\n class=\"date-picker-input\"\n >\n\n <ng-container *ngIf=\"!alwaysOpen\">\n <span *ngIf=\"indicator || cleaner\" class=\"picker-input-group-icons\">\n <span *ngIf=\"indicator\" class=\"picker-input-group-indicator\">\n <gtr-icon name=\"chevron-down\" [size]=\"20\"></gtr-icon>\n </span>\n <span (click)=\"!disabled && handleClear($event)\"\n *ngIf=\"cleaner && startDateElementRef.value && !disabled\"\n class=\"picker-input-group-cleaner\" role=\"button\">\n <gtr-icon name=\"x\" [size]=\"20\"></gtr-icon>\n </span>\n </span>\n </ng-container>\n </gtr-input-group>\n</ng-template>\n\n<ng-template #dateRangePicker>\n\n <div class=\"date-picker-body\">\n <ng-template [ngIf]=\"!
|
|
7263
|
+
], template: "<ng-container *ngIf=\"alwaysOpen\">\n <div class=\"date-range-picker-input\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div class=\"date-range-picker-calendar\">\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"!alwaysOpen\">\n <gtr-dropdown #dropdown=\"gtrDropdown\"\n [autoClose]=\"'outside'\"\n class=\"date-picker picker\"\n [ngClass]=\"datePickerClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n\n <div gtrDropdownToggle\n [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div gtrDropdownMenu>\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n </gtr-dropdown>\n</ng-container>\n\n<ng-template #dateRangePickerInput>\n\n <gtr-input-group [sizing]=\"size ?? ''\"\n [invalid]=\"invalid\"\n class=\"picker-input-group\"\n >\n <input (change)=\"handleStartDateInputChange($event)\"\n [formControl]=\"startDateInput\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n gtrFormControl\n #startDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"range ? undefined : valid\"\n class=\"date-picker-input\"\n >\n <span *ngIf=\"range && separator !== false\" gtrInputGroupText>\n <span class=\"picker-input-group-icon date-picker-arrow-icon\"></span>\n </span>\n <input (change)=\"handleEndDateInputChange($event)\"\n *ngIf=\"range\"\n [formControl]=\"endDateInput\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n gtrFormControl\n #endDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"valid ?? undefined\"\n class=\"date-picker-input\"\n >\n\n <ng-container *ngIf=\"!alwaysOpen\">\n <span *ngIf=\"indicator || cleaner\" class=\"picker-input-group-icons\">\n <span *ngIf=\"indicator\" class=\"picker-input-group-indicator\">\n <gtr-icon name=\"chevron-down\" [size]=\"20\"></gtr-icon>\n </span>\n <span (click)=\"!disabled && handleClear($event)\"\n *ngIf=\"cleaner && startDateElementRef.value && !disabled\"\n class=\"picker-input-group-cleaner\" role=\"button\">\n <gtr-icon name=\"x\" [size]=\"20\"></gtr-icon>\n </span>\n </span>\n </ng-container>\n </gtr-input-group>\n</ng-template>\n\n<ng-template #dateRangePicker>\n\n <div class=\"date-picker-body\">\n <ng-template [ngIf]=\"!showRanges\">\n <div *ngIf=\"ranges && customRanges.length > 0\" class=\"date-picker-ranges\">\n <button (click)=\"setCustomRange(customRange)\"\n *ngFor=\"let customRange of customRanges\"\n [color]=\"rangesButtonsColor\"\n [size]=\"rangesButtonsSize\"\n [variant]=\"rangesButtonsVariant\"\n gtrButton>\n {{customRange | gtrCustomRangeKey}}\n </button>\n </div>\n </ng-template>\n <gtr-calendar\n (calendarCellHover)=\"handleCalendarCellHover($event)\"\n (calendarDateChange)=\"handleCalendarDateChange($event)\"\n (endDateChange)=\"handleEndDateChange($event)\"\n (startDateChange)=\"handleStartDateChange($event)\"\n [calendarDate]=\"calendarDate\"\n [calendars]=\"isMobile ? 1 : calendars\"\n [dateFilter]=\"dateFilter\"\n [disabledDates]=\"disabledDates\"\n [endDate]=\"endDate\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [locale]=\"locale\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [navigation]=\"navigation\"\n [range]=\"range\"\n [startDate]=\"startDate\"\n [navYearFirst]=\"navYearFirst\"\n [dayFormat]=\"dayFormat\"\n [weekdayFormat]=\"weekdayFormat\"\n [selectAdjacentDays]=\"selectAdjacentDays\"\n [showAdjacentDays]=\"showAdjacentDays\"\n [type]=\"rangesType\"\n class=\"date-picker-calendars\"\n ></gtr-calendar>\n <div *ngIf=\"false && timepicker\" class=\"date-picker-timepickers\">\n <!-- todo-->\n <gtr-time-picker\n variant=\"select\"\n [locale]=\"locale\"\n [disabled]=\"!startDate\"\n [time]=\"startDate ?? undefined\"\n (timeChange)=\"handleStartTimeChange($event)\"\n ></gtr-time-picker>\n <gtr-time-picker\n *ngIf=\"range\"\n variant=\"select\"\n [locale]=\"locale\"\n [disabled]=\"!endDate\"\n [time]=\"endDate ?? undefined\"\n (timeChange)=\"handleEndTimeChange($event)\"\n ></gtr-time-picker>\n </div>\n </div>\n\n\n</ng-template>\n", styles: [".picker-input-group-indicator{color:var(--gtr-color-base-black-80)!important}.picker-input-group-icons{border:none;display:flex;align-items:center;padding:0 14px}.date-picker-input{border:none!important;outline:none!important;padding:7px 14px}.picker-input-group{outline:none!important;box-shadow:none!important;background-color:#fff!important;border-radius:6px!important;border:1px solid var(--light-solid-color-extra-divider, #DBDADE)!important;background:var(--light-solid-color-extra-card-background, #FFF)!important}.date-picker-calendars{background-color:#fff}\n"] }]
|
|
7234
7264
|
}], ctorParameters: function () { return [{ type: i1$2.BreakpointObserver }]; }, propDecorators: { id: [{
|
|
7235
7265
|
type: Input
|
|
7236
7266
|
}], testid: [{
|
|
@@ -7260,7 +7290,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7260
7290
|
}], ranges: [{
|
|
7261
7291
|
type: Input
|
|
7262
7292
|
}], rangesType: [{
|
|
7263
|
-
type: Input
|
|
7293
|
+
type: Input,
|
|
7294
|
+
args: ['rangesType']
|
|
7264
7295
|
}], rangesButtonsColor: [{
|
|
7265
7296
|
type: Input
|
|
7266
7297
|
}], rangesButtonsSize: [{
|
|
@@ -7324,9 +7355,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7324
7355
|
type: Output
|
|
7325
7356
|
}], startDateChange: [{
|
|
7326
7357
|
type: Output
|
|
7327
|
-
}], calendarComponent: [{
|
|
7328
|
-
type: ViewChild,
|
|
7329
|
-
args: [GtrCalendarComponent]
|
|
7330
7358
|
}], startDateElementRef: [{
|
|
7331
7359
|
type: ViewChild,
|
|
7332
7360
|
args: ['startDateElementRef']
|
|
@@ -7398,7 +7426,8 @@ class GtrDateRangePickerModule {
|
|
|
7398
7426
|
GtrInputGroupComponent,
|
|
7399
7427
|
GtrFormControlDirective,
|
|
7400
7428
|
GtrInputGroupTextDirective,
|
|
7401
|
-
GtrIconModule
|
|
7429
|
+
GtrIconModule,
|
|
7430
|
+
GtrCustomRangeKeyPipe], exports: [GtrDateRangePickerComponent] }); }
|
|
7402
7431
|
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrDateRangePickerModule, imports: [ReactiveFormsModule,
|
|
7403
7432
|
GtrCalendarComponent,
|
|
7404
7433
|
GtrTimePickerComponent,
|
|
@@ -7424,6 +7453,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7424
7453
|
GtrFormControlDirective,
|
|
7425
7454
|
GtrInputGroupTextDirective,
|
|
7426
7455
|
GtrIconModule,
|
|
7456
|
+
GtrCustomRangeKeyPipe,
|
|
7427
7457
|
],
|
|
7428
7458
|
exports: [GtrDateRangePickerComponent],
|
|
7429
7459
|
}]
|
|
@@ -7475,7 +7505,7 @@ class GtrDatePickerComponent extends GtrDateRangePickerComponent {
|
|
|
7475
7505
|
useExisting: forwardRef((() => GtrDatePickerComponent)),
|
|
7476
7506
|
multi: true,
|
|
7477
7507
|
},
|
|
7478
|
-
], exportAs: ["gtrDatePicker"], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"alwaysOpen\">\n <div class=\"date-range-picker-input\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div class=\"date-range-picker-calendar\">\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"!alwaysOpen\">\n <gtr-dropdown #dropdown=\"gtrDropdown\"\n [autoClose]=\"'outside'\"\n class=\"date-picker picker\"\n [ngClass]=\"datePickerClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n\n <div gtrDropdownToggle\n [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div gtrDropdownMenu>\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n </gtr-dropdown>\n</ng-container>\n\n<ng-template #dateRangePickerInput>\n\n <gtr-input-group [sizing]=\"size ?? ''\"\n [invalid]=\"invalid\"\n class=\"picker-input-group\"\n >\n <input (change)=\"handleStartDateInputChange($event)\"\n [formControl]=\"startDateInput\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n gtrFormControl\n #startDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"range ? undefined : valid\"\n class=\"date-picker-input\"\n >\n <span *ngIf=\"range && separator !== false\" gtrInputGroupText>\n <span class=\"picker-input-group-icon date-picker-arrow-icon\"></span>\n </span>\n <input (change)=\"handleEndDateInputChange($event)\"\n *ngIf=\"range\"\n [formControl]=\"endDateInput\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n gtrFormControl\n #endDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"valid ?? undefined\"\n class=\"date-picker-input\"\n >\n\n <ng-container *ngIf=\"!alwaysOpen\">\n <span *ngIf=\"indicator || cleaner\" class=\"picker-input-group-icons\">\n <span *ngIf=\"indicator\" class=\"picker-input-group-indicator\">\n <gtr-icon name=\"chevron-down\" [size]=\"20\"></gtr-icon>\n </span>\n <span (click)=\"!disabled && handleClear($event)\"\n *ngIf=\"cleaner && startDateElementRef.value && !disabled\"\n class=\"picker-input-group-cleaner\" role=\"button\">\n <gtr-icon name=\"x\" [size]=\"20\"></gtr-icon>\n </span>\n </span>\n </ng-container>\n </gtr-input-group>\n</ng-template>\n\n<ng-template #dateRangePicker>\n\n <div class=\"date-picker-body\">\n <ng-template [ngIf]=\"!
|
|
7508
|
+
], exportAs: ["gtrDatePicker"], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"alwaysOpen\">\n <div class=\"date-range-picker-input\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div class=\"date-range-picker-calendar\">\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"!alwaysOpen\">\n <gtr-dropdown #dropdown=\"gtrDropdown\"\n [autoClose]=\"'outside'\"\n class=\"date-picker picker\"\n [ngClass]=\"datePickerClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n\n <div gtrDropdownToggle\n [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div gtrDropdownMenu>\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n </gtr-dropdown>\n</ng-container>\n\n<ng-template #dateRangePickerInput>\n\n <gtr-input-group [sizing]=\"size ?? ''\"\n [invalid]=\"invalid\"\n class=\"picker-input-group\"\n >\n <input (change)=\"handleStartDateInputChange($event)\"\n [formControl]=\"startDateInput\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n gtrFormControl\n #startDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"range ? undefined : valid\"\n class=\"date-picker-input\"\n >\n <span *ngIf=\"range && separator !== false\" gtrInputGroupText>\n <span class=\"picker-input-group-icon date-picker-arrow-icon\"></span>\n </span>\n <input (change)=\"handleEndDateInputChange($event)\"\n *ngIf=\"range\"\n [formControl]=\"endDateInput\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n gtrFormControl\n #endDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"valid ?? undefined\"\n class=\"date-picker-input\"\n >\n\n <ng-container *ngIf=\"!alwaysOpen\">\n <span *ngIf=\"indicator || cleaner\" class=\"picker-input-group-icons\">\n <span *ngIf=\"indicator\" class=\"picker-input-group-indicator\">\n <gtr-icon name=\"chevron-down\" [size]=\"20\"></gtr-icon>\n </span>\n <span (click)=\"!disabled && handleClear($event)\"\n *ngIf=\"cleaner && startDateElementRef.value && !disabled\"\n class=\"picker-input-group-cleaner\" role=\"button\">\n <gtr-icon name=\"x\" [size]=\"20\"></gtr-icon>\n </span>\n </span>\n </ng-container>\n </gtr-input-group>\n</ng-template>\n\n<ng-template #dateRangePicker>\n\n <div class=\"date-picker-body\">\n <ng-template [ngIf]=\"!showRanges\">\n <div *ngIf=\"ranges && customRanges.length > 0\" class=\"date-picker-ranges\">\n <button (click)=\"setCustomRange(customRange)\"\n *ngFor=\"let customRange of customRanges\"\n [color]=\"rangesButtonsColor\"\n [size]=\"rangesButtonsSize\"\n [variant]=\"rangesButtonsVariant\"\n gtrButton>\n {{customRange | gtrCustomRangeKey}}\n </button>\n </div>\n </ng-template>\n <gtr-calendar\n (calendarCellHover)=\"handleCalendarCellHover($event)\"\n (calendarDateChange)=\"handleCalendarDateChange($event)\"\n (endDateChange)=\"handleEndDateChange($event)\"\n (startDateChange)=\"handleStartDateChange($event)\"\n [calendarDate]=\"calendarDate\"\n [calendars]=\"isMobile ? 1 : calendars\"\n [dateFilter]=\"dateFilter\"\n [disabledDates]=\"disabledDates\"\n [endDate]=\"endDate\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [locale]=\"locale\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [navigation]=\"navigation\"\n [range]=\"range\"\n [startDate]=\"startDate\"\n [navYearFirst]=\"navYearFirst\"\n [dayFormat]=\"dayFormat\"\n [weekdayFormat]=\"weekdayFormat\"\n [selectAdjacentDays]=\"selectAdjacentDays\"\n [showAdjacentDays]=\"showAdjacentDays\"\n [type]=\"rangesType\"\n class=\"date-picker-calendars\"\n ></gtr-calendar>\n <div *ngIf=\"false && timepicker\" class=\"date-picker-timepickers\">\n <!-- todo-->\n <gtr-time-picker\n variant=\"select\"\n [locale]=\"locale\"\n [disabled]=\"!startDate\"\n [time]=\"startDate ?? undefined\"\n (timeChange)=\"handleStartTimeChange($event)\"\n ></gtr-time-picker>\n <gtr-time-picker\n *ngIf=\"range\"\n variant=\"select\"\n [locale]=\"locale\"\n [disabled]=\"!endDate\"\n [time]=\"endDate ?? undefined\"\n (timeChange)=\"handleEndTimeChange($event)\"\n ></gtr-time-picker>\n </div>\n </div>\n\n\n</ng-template>\n", styles: [".picker-input-group-indicator{color:var(--gtr-color-base-black-80)!important}.picker-input-group-icons{border:none;display:flex;align-items:center;padding:0 14px}.date-picker-input{border:none!important;outline:none!important;padding:7px 14px}.picker-input-group{outline:none!important;box-shadow:none!important;background-color:#fff!important;border-radius:6px!important;border:1px solid var(--light-solid-color-extra-divider, #DBDADE)!important;background:var(--light-solid-color-extra-card-background, #FFF)!important}.date-picker-calendars{background-color:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: GtrCalendarComponent, selector: "gtr-calendar", inputs: ["calendarDate", "calendars", "dayFormat", "disabledDates", "startDate", "endDate", "firstDayOfWeek", "locale", "maxDate", "minDate", "navigation", "navYearFirst", "range", "view", "type", "weekdayFormat", "dateFilter", "selectAdjacentDays", "showAdjacentDays"], outputs: ["calendarCellHover", "calendarDateChange", "endDateChange", "startDateChange", "viewChange"], exportAs: ["gtrCalendar"] }, { kind: "component", type: GtrTimePickerComponent, selector: "gtr-time-picker", inputs: ["cleaner", "dateTimeFormatOptions", "disabled", "filterHours", "filterMinutes", "filterSeconds", "indicator", "inputReadOnly", "locale", "placeholder", "seconds", "size", "time", "variant", "valid", "visible"], outputs: ["timeChange"], exportAs: ["cTimePicker"] }, { kind: "directive", type: GtrButtonDirective, selector: "[gtrButton]", inputs: ["active", "color", "disabled", "shape", "size", "type", "variant"], exportAs: ["gtrButton"] }, { kind: "component", type: GtrDropdownComponent, selector: "gtr-dropdown", inputs: ["alignment", "autoClose", "dark", "direction", "placement", "popper", "popperOptions", "variant", "visible"], outputs: ["visibleChange"], exportAs: ["gtrDropdown"] }, { kind: "directive", type: GtrDropdownToggleDirective, selector: "[gtrDropdownToggle]", inputs: ["dropdownComponent", "disabled", "caret", "split"], exportAs: ["gtrDropdownToggle"] }, { kind: "directive", type: GtrDropdownMenuDirective, selector: "[gtrDropdownMenu]", inputs: ["alignment", "visible", "dark"], exportAs: ["gtrDropdownMenu"] }, { kind: "component", type: GtrInputGroupComponent, selector: "gtr-input-group", inputs: ["sizing", "invalid"] }, { kind: "directive", type: GtrFormControlDirective, selector: "input[gtrFormControl], textarea[gtrFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }, { kind: "directive", type: GtrInputGroupTextDirective, selector: "[gtrInputGroupText]" }, { kind: "component", type: GtrIconComponent, selector: "gtr-icon", inputs: ["name", "weight", "color", "size", "iconId"] }, { kind: "pipe", type: GtrCustomRangeKeyPipe, name: "gtrCustomRangeKey" }] }); }
|
|
7479
7509
|
}
|
|
7480
7510
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrDatePickerComponent, decorators: [{
|
|
7481
7511
|
type: Component,
|
|
@@ -7485,7 +7515,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7485
7515
|
useExisting: forwardRef((() => GtrDatePickerComponent)),
|
|
7486
7516
|
multi: true,
|
|
7487
7517
|
},
|
|
7488
|
-
], template: "<ng-container *ngIf=\"alwaysOpen\">\n <div class=\"date-range-picker-input\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div class=\"date-range-picker-calendar\">\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"!alwaysOpen\">\n <gtr-dropdown #dropdown=\"gtrDropdown\"\n [autoClose]=\"'outside'\"\n class=\"date-picker picker\"\n [ngClass]=\"datePickerClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n\n <div gtrDropdownToggle\n [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div gtrDropdownMenu>\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n </gtr-dropdown>\n</ng-container>\n\n<ng-template #dateRangePickerInput>\n\n <gtr-input-group [sizing]=\"size ?? ''\"\n [invalid]=\"invalid\"\n class=\"picker-input-group\"\n >\n <input (change)=\"handleStartDateInputChange($event)\"\n [formControl]=\"startDateInput\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n gtrFormControl\n #startDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"range ? undefined : valid\"\n class=\"date-picker-input\"\n >\n <span *ngIf=\"range && separator !== false\" gtrInputGroupText>\n <span class=\"picker-input-group-icon date-picker-arrow-icon\"></span>\n </span>\n <input (change)=\"handleEndDateInputChange($event)\"\n *ngIf=\"range\"\n [formControl]=\"endDateInput\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n gtrFormControl\n #endDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"valid ?? undefined\"\n class=\"date-picker-input\"\n >\n\n <ng-container *ngIf=\"!alwaysOpen\">\n <span *ngIf=\"indicator || cleaner\" class=\"picker-input-group-icons\">\n <span *ngIf=\"indicator\" class=\"picker-input-group-indicator\">\n <gtr-icon name=\"chevron-down\" [size]=\"20\"></gtr-icon>\n </span>\n <span (click)=\"!disabled && handleClear($event)\"\n *ngIf=\"cleaner && startDateElementRef.value && !disabled\"\n class=\"picker-input-group-cleaner\" role=\"button\">\n <gtr-icon name=\"x\" [size]=\"20\"></gtr-icon>\n </span>\n </span>\n </ng-container>\n </gtr-input-group>\n</ng-template>\n\n<ng-template #dateRangePicker>\n\n <div class=\"date-picker-body\">\n <ng-template [ngIf]=\"!
|
|
7518
|
+
], template: "<ng-container *ngIf=\"alwaysOpen\">\n <div class=\"date-range-picker-input\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div class=\"date-range-picker-calendar\">\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n</ng-container>\n\n<ng-container *ngIf=\"!alwaysOpen\">\n <gtr-dropdown #dropdown=\"gtrDropdown\"\n [autoClose]=\"'outside'\"\n class=\"date-picker picker\"\n [ngClass]=\"datePickerClasses\"\n [(visible)]=\"visible\" [popperOptions]=\"popperjsOptions\">\n\n <div gtrDropdownToggle\n [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\">\n <ng-container *ngTemplateOutlet=\"dateRangePickerInput\"></ng-container>\n </div>\n <div gtrDropdownMenu>\n <ng-container *ngTemplateOutlet=\"dateRangePicker\"></ng-container>\n\n <div *ngIf=\"templates?.datePickerFooter\" class=\"picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\"></ng-container>\n </div>\n </div>\n <ng-content></ng-content>\n </gtr-dropdown>\n</ng-container>\n\n<ng-template #dateRangePickerInput>\n\n <gtr-input-group [sizing]=\"size ?? ''\"\n [invalid]=\"invalid\"\n class=\"picker-input-group\"\n >\n <input (change)=\"handleStartDateInputChange($event)\"\n [formControl]=\"startDateInput\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n gtrFormControl\n #startDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"range ? undefined : valid\"\n class=\"date-picker-input\"\n >\n <span *ngIf=\"range && separator !== false\" gtrInputGroupText>\n <span class=\"picker-input-group-icon date-picker-arrow-icon\"></span>\n </span>\n <input (change)=\"handleEndDateInputChange($event)\"\n *ngIf=\"range\"\n [formControl]=\"endDateInput\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n gtrFormControl\n #endDateElementRef\n [attr.tabindex]=\"disabled ? -1 : 0\"\n pattern=\"[1-9]*\"\n [readonly]=\"inputReadOnly ?? null\"\n [required]=\"required ?? null\"\n [valid]=\"valid ?? undefined\"\n class=\"date-picker-input\"\n >\n\n <ng-container *ngIf=\"!alwaysOpen\">\n <span *ngIf=\"indicator || cleaner\" class=\"picker-input-group-icons\">\n <span *ngIf=\"indicator\" class=\"picker-input-group-indicator\">\n <gtr-icon name=\"chevron-down\" [size]=\"20\"></gtr-icon>\n </span>\n <span (click)=\"!disabled && handleClear($event)\"\n *ngIf=\"cleaner && startDateElementRef.value && !disabled\"\n class=\"picker-input-group-cleaner\" role=\"button\">\n <gtr-icon name=\"x\" [size]=\"20\"></gtr-icon>\n </span>\n </span>\n </ng-container>\n </gtr-input-group>\n</ng-template>\n\n<ng-template #dateRangePicker>\n\n <div class=\"date-picker-body\">\n <ng-template [ngIf]=\"!showRanges\">\n <div *ngIf=\"ranges && customRanges.length > 0\" class=\"date-picker-ranges\">\n <button (click)=\"setCustomRange(customRange)\"\n *ngFor=\"let customRange of customRanges\"\n [color]=\"rangesButtonsColor\"\n [size]=\"rangesButtonsSize\"\n [variant]=\"rangesButtonsVariant\"\n gtrButton>\n {{customRange | gtrCustomRangeKey}}\n </button>\n </div>\n </ng-template>\n <gtr-calendar\n (calendarCellHover)=\"handleCalendarCellHover($event)\"\n (calendarDateChange)=\"handleCalendarDateChange($event)\"\n (endDateChange)=\"handleEndDateChange($event)\"\n (startDateChange)=\"handleStartDateChange($event)\"\n [calendarDate]=\"calendarDate\"\n [calendars]=\"isMobile ? 1 : calendars\"\n [dateFilter]=\"dateFilter\"\n [disabledDates]=\"disabledDates\"\n [endDate]=\"endDate\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [locale]=\"locale\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [navigation]=\"navigation\"\n [range]=\"range\"\n [startDate]=\"startDate\"\n [navYearFirst]=\"navYearFirst\"\n [dayFormat]=\"dayFormat\"\n [weekdayFormat]=\"weekdayFormat\"\n [selectAdjacentDays]=\"selectAdjacentDays\"\n [showAdjacentDays]=\"showAdjacentDays\"\n [type]=\"rangesType\"\n class=\"date-picker-calendars\"\n ></gtr-calendar>\n <div *ngIf=\"false && timepicker\" class=\"date-picker-timepickers\">\n <!-- todo-->\n <gtr-time-picker\n variant=\"select\"\n [locale]=\"locale\"\n [disabled]=\"!startDate\"\n [time]=\"startDate ?? undefined\"\n (timeChange)=\"handleStartTimeChange($event)\"\n ></gtr-time-picker>\n <gtr-time-picker\n *ngIf=\"range\"\n variant=\"select\"\n [locale]=\"locale\"\n [disabled]=\"!endDate\"\n [time]=\"endDate ?? undefined\"\n (timeChange)=\"handleEndTimeChange($event)\"\n ></gtr-time-picker>\n </div>\n </div>\n\n\n</ng-template>\n", styles: [".picker-input-group-indicator{color:var(--gtr-color-base-black-80)!important}.picker-input-group-icons{border:none;display:flex;align-items:center;padding:0 14px}.date-picker-input{border:none!important;outline:none!important;padding:7px 14px}.picker-input-group{outline:none!important;box-shadow:none!important;background-color:#fff!important;border-radius:6px!important;border:1px solid var(--light-solid-color-extra-divider, #DBDADE)!important;background:var(--light-solid-color-extra-card-background, #FFF)!important}.date-picker-calendars{background-color:#fff}\n"] }]
|
|
7489
7519
|
}], ctorParameters: function () { return [{ type: i1$2.BreakpointObserver }]; }, propDecorators: { placeholder: [{
|
|
7490
7520
|
type: Input
|
|
7491
7521
|
}], startDateChange: [{
|
|
@@ -7511,7 +7541,8 @@ class GtrDatePickerModule {
|
|
|
7511
7541
|
GtrInputGroupComponent,
|
|
7512
7542
|
GtrFormControlDirective,
|
|
7513
7543
|
GtrInputGroupTextDirective,
|
|
7514
|
-
GtrIconModule
|
|
7544
|
+
GtrIconModule,
|
|
7545
|
+
GtrCustomRangeKeyPipe], exports: [GtrDatePickerComponent] }); }
|
|
7515
7546
|
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GtrDatePickerModule, imports: [ReactiveFormsModule,
|
|
7516
7547
|
GtrCalendarComponent,
|
|
7517
7548
|
GtrTimePickerComponent,
|
|
@@ -7537,6 +7568,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7537
7568
|
GtrFormControlDirective,
|
|
7538
7569
|
GtrInputGroupTextDirective,
|
|
7539
7570
|
GtrIconModule,
|
|
7571
|
+
GtrCustomRangeKeyPipe,
|
|
7540
7572
|
],
|
|
7541
7573
|
exports: [GtrDatePickerComponent],
|
|
7542
7574
|
}]
|