@ardium-ui/ui 3.4.4 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/_internal/disablable-component.mjs +1 -1
- package/esm2022/lib/buttons/icon-button/icon-button.module.mjs +2 -2
- package/esm2022/lib/calendar/calendar.component.mjs +437 -0
- package/esm2022/lib/calendar/calendar.defaults.mjs +26 -0
- package/esm2022/lib/calendar/calendar.internal-types.mjs +2 -0
- package/esm2022/lib/calendar/calendar.module.mjs +24 -0
- package/esm2022/lib/calendar/calendar.types.mjs +6 -0
- package/esm2022/lib/calendar/index.mjs +5 -0
- package/esm2022/lib/calendar/views/days-view/days-view.component.mjs +282 -0
- package/esm2022/lib/calendar/views/days-view/days-view.helpers.mjs +65 -0
- package/esm2022/lib/calendar/views/months-view/months-view.component.mjs +245 -0
- package/esm2022/lib/calendar/views/months-view/months-view.helpers.mjs +22 -0
- package/esm2022/lib/calendar/views/years-view/years-view.component.mjs +244 -0
- package/esm2022/lib/calendar/views/years-view/years-view.helpers.mjs +14 -0
- package/esm2022/lib/inputs/date-input/date-input.component.mjs +357 -0
- package/esm2022/lib/inputs/date-input/date-input.defaults.mjs +38 -0
- package/esm2022/lib/inputs/date-input/date-input.directive.mjs +59 -0
- package/esm2022/lib/inputs/date-input/date-input.module.mjs +50 -0
- package/esm2022/lib/inputs/date-input/date-input.serializers.mjs +49 -0
- package/esm2022/lib/inputs/date-input/date-input.types.mjs +5 -0
- package/esm2022/lib/inputs/date-input/index.mjs +6 -0
- package/esm2022/public-api.mjs +3 -2
- package/fesm2022/ardium-ui-ui.mjs +1878 -52
- package/fesm2022/ardium-ui-ui.mjs.map +1 -1
- package/lib/_internal/disablable-component.d.ts +1 -1
- package/lib/calendar/calendar.component.d.ts +94 -0
- package/lib/calendar/calendar.defaults.d.ts +18 -0
- package/lib/calendar/calendar.internal-types.d.ts +4 -0
- package/lib/calendar/calendar.module.d.ts +14 -0
- package/lib/calendar/calendar.types.d.ts +83 -0
- package/lib/calendar/index.d.ts +4 -0
- package/lib/calendar/views/days-view/days-view.component.d.ts +68 -0
- package/lib/calendar/views/days-view/days-view.helpers.d.ts +20 -0
- package/lib/calendar/views/months-view/months-view.component.d.ts +61 -0
- package/lib/calendar/views/months-view/months-view.helpers.d.ts +3 -0
- package/lib/calendar/views/years-view/years-view.component.d.ts +59 -0
- package/lib/calendar/views/years-view/years-view.helpers.d.ts +3 -0
- package/lib/inputs/date-input/date-input.component.d.ts +95 -0
- package/lib/inputs/date-input/date-input.defaults.d.ts +30 -0
- package/lib/inputs/date-input/date-input.directive.d.ts +33 -0
- package/lib/inputs/date-input/date-input.module.d.ts +14 -0
- package/lib/inputs/date-input/date-input.serializers.d.ts +3 -0
- package/lib/inputs/date-input/date-input.types.d.ts +16 -0
- package/lib/inputs/date-input/index.d.ts +5 -0
- package/package.json +1 -1
- package/prebuilt-themes/default/calendar-OLD.css +294 -0
- package/prebuilt-themes/default/calendar-OLD.css.map +1 -0
- package/prebuilt-themes/default/calendar.css +100 -80
- package/prebuilt-themes/default/calendar.css.map +1 -1
- package/prebuilt-themes/default/inputs/date-input.css +68 -0
- package/prebuilt-themes/default/inputs/date-input.css.map +1 -0
- package/public-api.d.ts +2 -0
- package/themes/default/calendar-OLD.scss +183 -0
- package/themes/default/calendar.scss +120 -98
- package/themes/default/inputs/date-input.scss +32 -0
|
@@ -4,17 +4,17 @@ import * as i0 from '@angular/core';
|
|
|
4
4
|
import { input, signal, Directive, Input, HostBinding, computed, output, ViewChildren, inject, Injector, runInInjectionContext, InjectionToken, effect, viewChildren, forwardRef, Component, ViewEncapsulation, ChangeDetectionStrategy, Inject, NgModule, viewChild, contentChild, ViewContainerRef, TemplateRef, HostListener, Pipe, model, ElementRef, ChangeDetectorRef, ContentChildren, ViewChild, ContentChild, contentChildren, Renderer2, Injectable } from '@angular/core';
|
|
5
5
|
import { NgControl, Validators, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
6
|
import * as i4 from '@ardium-ui/devkit';
|
|
7
|
-
import { coerceBooleanProperty, coerceNumberProperty, coerceArrayProperty, ArdiumClickOutsideEventModule, ArdiumInnerHTMLModule, ArdiumFilesizePipeModule, ArdiumFilenamePipeModule, ArdiumFileextPipeModule, ArdiumHoldEventModule } from '@ardium-ui/devkit';
|
|
7
|
+
import { coerceBooleanProperty, coerceNumberProperty, coerceArrayProperty, ArdiumClickOutsideEventModule, ArdiumInnerHTMLModule, ArdiumFilesizePipeModule, ArdiumFilenamePipeModule, ArdiumFileextPipeModule, coerceDateProperty, ArdiumHoldEventModule } from '@ardium-ui/devkit';
|
|
8
8
|
import { toObservable } from '@angular/core/rxjs-interop';
|
|
9
9
|
import { map, Subject, merge, takeUntil, startWith, BehaviorSubject } from 'rxjs';
|
|
10
10
|
import { TakeChance } from 'take-chance';
|
|
11
11
|
import { isAnyString, isNull, isArray, isNumber, isFunction, isRegExp, isDefined, any, isPrimitive, isString, evaluate, isObject, isPromise } from 'simple-bool';
|
|
12
12
|
import * as i1 from '@angular/common';
|
|
13
|
-
import { CommonModule, DOCUMENT, DecimalPipe, AsyncPipe } from '@angular/common';
|
|
13
|
+
import { CommonModule, DatePipe, UpperCasePipe, DOCUMENT, DecimalPipe, AsyncPipe } from '@angular/common';
|
|
14
14
|
import { Overlay, ScrollStrategyOptions, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
15
15
|
import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
16
16
|
import { resolvePath } from 'resolve-object-path';
|
|
17
|
-
import { roundToPrecision, roundToMultiple } from 'more-rounding';
|
|
17
|
+
import { roundFromZero, roundToPrecision, roundToMultiple } from 'more-rounding';
|
|
18
18
|
import * as Color from 'color';
|
|
19
19
|
import { keyToString } from 'key-display-names';
|
|
20
20
|
import * as i4$1 from '@angular/cdk/a11y';
|
|
@@ -5292,6 +5292,1880 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
5292
5292
|
}]
|
|
5293
5293
|
}] });
|
|
5294
5294
|
|
|
5295
|
+
const ArdCalendarView = {
|
|
5296
|
+
Days: 'days',
|
|
5297
|
+
Months: 'months',
|
|
5298
|
+
Years: 'years',
|
|
5299
|
+
};
|
|
5300
|
+
|
|
5301
|
+
const DEFAULT_DATE_INPUT_SERIALIZE_FN = (value) => {
|
|
5302
|
+
if (value instanceof Date) {
|
|
5303
|
+
return `${value.getDate().toString().padStart(2, '0')}/${(value.getMonth() + 1)
|
|
5304
|
+
.toString()
|
|
5305
|
+
.padStart(2, '0')}/${value.getFullYear()}`;
|
|
5306
|
+
}
|
|
5307
|
+
return '';
|
|
5308
|
+
};
|
|
5309
|
+
const DEFAULT_DATE_INPUT_DESERIALIZE_FN = (value, prevValue) => {
|
|
5310
|
+
const trimmed = value.trim();
|
|
5311
|
+
// case: ISO string
|
|
5312
|
+
if (!trimmed.includes('/') && !isNaN(Date.parse(trimmed))) {
|
|
5313
|
+
const isoDate = new Date(trimmed);
|
|
5314
|
+
isoDate.setHours(0, 0, 0, 0);
|
|
5315
|
+
return isoDate;
|
|
5316
|
+
}
|
|
5317
|
+
const parts = trimmed.split('/');
|
|
5318
|
+
const currentYear = new Date().getFullYear();
|
|
5319
|
+
if (parts.length === 1) {
|
|
5320
|
+
// case: only year provided
|
|
5321
|
+
const year = parseInt(parts[0], 10);
|
|
5322
|
+
if (isNaN(year))
|
|
5323
|
+
return null;
|
|
5324
|
+
const date = new Date(year, 0, 1); // Jan 1st
|
|
5325
|
+
return date;
|
|
5326
|
+
}
|
|
5327
|
+
if (parts.length === 2) {
|
|
5328
|
+
// case: day/month, use current year
|
|
5329
|
+
const day = parseInt(parts[0], 10);
|
|
5330
|
+
const month = parseInt(parts[1], 10) - 1;
|
|
5331
|
+
if (isNaN(day) || isNaN(month))
|
|
5332
|
+
return null;
|
|
5333
|
+
const date = new Date(currentYear, month, day);
|
|
5334
|
+
return isNaN(date.getTime()) ? null : date;
|
|
5335
|
+
}
|
|
5336
|
+
if (parts.length === 3) {
|
|
5337
|
+
// case: full date
|
|
5338
|
+
const day = parseInt(parts[0], 10);
|
|
5339
|
+
const month = parseInt(parts[1], 10) - 1;
|
|
5340
|
+
const year = parseInt(parts[2], 10);
|
|
5341
|
+
if (isNaN(day) || isNaN(month) || isNaN(year))
|
|
5342
|
+
return null;
|
|
5343
|
+
const date = new Date(year, month, day);
|
|
5344
|
+
return isNaN(date.getTime()) ? null : date;
|
|
5345
|
+
}
|
|
5346
|
+
// invalid format
|
|
5347
|
+
return prevValue;
|
|
5348
|
+
};
|
|
5349
|
+
|
|
5350
|
+
const ArdDateInputMinMaxStrategy = {
|
|
5351
|
+
Allow: 'allow',
|
|
5352
|
+
Adjust: 'adjust',
|
|
5353
|
+
};
|
|
5354
|
+
|
|
5355
|
+
const _dateInputDefaults = {
|
|
5356
|
+
..._formFieldComponentDefaults,
|
|
5357
|
+
inputAttrs: {},
|
|
5358
|
+
placeholder: 'Choose a date',
|
|
5359
|
+
serializeFn: DEFAULT_DATE_INPUT_SERIALIZE_FN,
|
|
5360
|
+
deserializeFn: DEFAULT_DATE_INPUT_DESERIALIZE_FN,
|
|
5361
|
+
appearance: FormElementAppearance.Outlined,
|
|
5362
|
+
variant: FormElementVariant.Rounded,
|
|
5363
|
+
color: ComponentColor.Primary,
|
|
5364
|
+
compact: false,
|
|
5365
|
+
dropdownAppearance: DropdownPanelAppearance.Outlined,
|
|
5366
|
+
dropdownVariant: DropdownPanelVariant.Rounded,
|
|
5367
|
+
minMaxStrategy: ArdDateInputMinMaxStrategy.Adjust,
|
|
5368
|
+
// calendar defaults
|
|
5369
|
+
activeView: ArdCalendarView.Days,
|
|
5370
|
+
activeYear: new Date().getFullYear(),
|
|
5371
|
+
activeMonth: new Date().getMonth(),
|
|
5372
|
+
firstWeekday: 1,
|
|
5373
|
+
multipleYearPageChangeModifier: 5,
|
|
5374
|
+
min: null,
|
|
5375
|
+
max: null,
|
|
5376
|
+
filter: null,
|
|
5377
|
+
};
|
|
5378
|
+
const ARD_DATE_INPUT_DEFAULTS = new InjectionToken('ard-date-input-defaults', {
|
|
5379
|
+
factory: () => ({ ..._dateInputDefaults }),
|
|
5380
|
+
});
|
|
5381
|
+
function provideDateInputDefaults(config) {
|
|
5382
|
+
return { provide: ARD_DATE_INPUT_DEFAULTS, useValue: { ..._dateInputDefaults, ...config } };
|
|
5383
|
+
}
|
|
5384
|
+
|
|
5385
|
+
//public (exported)
|
|
5386
|
+
class ArdDateInputPrefixTemplateDirective {
|
|
5387
|
+
constructor(template) {
|
|
5388
|
+
this.template = template;
|
|
5389
|
+
}
|
|
5390
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdDateInputPrefixTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5391
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ArdDateInputPrefixTemplateDirective, selector: "ard-date-input > ng-template[ard-prefix-tmp]", ngImport: i0 }); }
|
|
5392
|
+
}
|
|
5393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdDateInputPrefixTemplateDirective, decorators: [{
|
|
5394
|
+
type: Directive,
|
|
5395
|
+
args: [{ selector: 'ard-date-input > ng-template[ard-prefix-tmp]' }]
|
|
5396
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
5397
|
+
class ArdDateInputSuffixTemplateDirective {
|
|
5398
|
+
constructor(template) {
|
|
5399
|
+
this.template = template;
|
|
5400
|
+
}
|
|
5401
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdDateInputSuffixTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5402
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ArdDateInputSuffixTemplateDirective, selector: "ard-date-input > ng-template[ard-suffix-tmp]", ngImport: i0 }); }
|
|
5403
|
+
}
|
|
5404
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdDateInputSuffixTemplateDirective, decorators: [{
|
|
5405
|
+
type: Directive,
|
|
5406
|
+
args: [{ selector: 'ard-date-input > ng-template[ard-suffix-tmp]' }]
|
|
5407
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
5408
|
+
class ArdDateInputValueTemplateDirective {
|
|
5409
|
+
constructor(template) {
|
|
5410
|
+
this.template = template;
|
|
5411
|
+
}
|
|
5412
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdDateInputValueTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5413
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ArdDateInputValueTemplateDirective, selector: "ard-date-input > ng-template[ard-value-tmp]", ngImport: i0 }); }
|
|
5414
|
+
}
|
|
5415
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdDateInputValueTemplateDirective, decorators: [{
|
|
5416
|
+
type: Directive,
|
|
5417
|
+
args: [{ selector: 'ard-date-input > ng-template[ard-value-tmp]' }]
|
|
5418
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
5419
|
+
class ArdDateInputCalendarIconTemplateDirective {
|
|
5420
|
+
constructor(template) {
|
|
5421
|
+
this.template = template;
|
|
5422
|
+
}
|
|
5423
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdDateInputCalendarIconTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5424
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ArdDateInputCalendarIconTemplateDirective, selector: "ard-date-input > ng-template[ard-calendar-icon-tmp]", ngImport: i0 }); }
|
|
5425
|
+
}
|
|
5426
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdDateInputCalendarIconTemplateDirective, decorators: [{
|
|
5427
|
+
type: Directive,
|
|
5428
|
+
args: [{ selector: 'ard-date-input > ng-template[ard-calendar-icon-tmp]' }]
|
|
5429
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
5430
|
+
class ArdDateInputAcceptButtonsTemplateDirective {
|
|
5431
|
+
constructor(template) {
|
|
5432
|
+
this.template = template;
|
|
5433
|
+
}
|
|
5434
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdDateInputAcceptButtonsTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5435
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ArdDateInputAcceptButtonsTemplateDirective, selector: "ard-date-input > ng-template[ard-accept-buttons-tmp]", ngImport: i0 }); }
|
|
5436
|
+
}
|
|
5437
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdDateInputAcceptButtonsTemplateDirective, decorators: [{
|
|
5438
|
+
type: Directive,
|
|
5439
|
+
args: [{ selector: 'ard-date-input > ng-template[ard-accept-buttons-tmp]' }]
|
|
5440
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
5441
|
+
|
|
5442
|
+
const _calendarDefaults = {
|
|
5443
|
+
..._ngModelComponentDefaults,
|
|
5444
|
+
color: ComponentColor.Primary,
|
|
5445
|
+
activeView: ArdCalendarView.Days,
|
|
5446
|
+
activeYear: new Date().getFullYear(),
|
|
5447
|
+
activeMonth: new Date().getMonth(),
|
|
5448
|
+
firstWeekday: 1,
|
|
5449
|
+
multipleYearPageChangeModifier: 5,
|
|
5450
|
+
autoFocus: false,
|
|
5451
|
+
min: null,
|
|
5452
|
+
max: null,
|
|
5453
|
+
filter: null,
|
|
5454
|
+
};
|
|
5455
|
+
const ARD_CALENDAR_DEFAULTS = new InjectionToken('ard-calendar-defaults', {
|
|
5456
|
+
factory: () => ({
|
|
5457
|
+
..._calendarDefaults,
|
|
5458
|
+
}),
|
|
5459
|
+
});
|
|
5460
|
+
function provideCalendarDefaults(config) {
|
|
5461
|
+
return { provide: ARD_CALENDAR_DEFAULTS, useValue: { ..._calendarDefaults, ...config } };
|
|
5462
|
+
}
|
|
5463
|
+
|
|
5464
|
+
/**
|
|
5465
|
+
* Generates a layout array to be used to create a calendar page for the given year and month.
|
|
5466
|
+
*
|
|
5467
|
+
* The returned object contains an array to create the layout from, the number of leading and trailing spaces in the layout, and the number of weeks (full or not) in the month.
|
|
5468
|
+
* @param year The year of the current active view
|
|
5469
|
+
* @param monthIndex The month index of the current active view
|
|
5470
|
+
* @param firstWeekday The index of the first weekday in the calendar layout. Starts at Sunday (index 0), ends with Saturday (index 6). Defaults to 1.
|
|
5471
|
+
* @returns A {@link CalendarData} object.
|
|
5472
|
+
*/
|
|
5473
|
+
function getCalendarDayData(year, monthIndex, firstWeekday = 1, min, max) {
|
|
5474
|
+
firstWeekday %= 7;
|
|
5475
|
+
const firstDayDate = new Date(year, monthIndex, 1);
|
|
5476
|
+
const firstDayWeekday = (firstDayDate.getDay() - firstWeekday + 7) % 7;
|
|
5477
|
+
const lastDayDate = new Date(firstDayDate);
|
|
5478
|
+
lastDayDate.setMonth(firstDayDate.getMonth() + 1); // advance the month by 1
|
|
5479
|
+
lastDayDate.setDate(0); // set the date to 0, which essentially means "the last day of the previous month"
|
|
5480
|
+
const lastDay = lastDayDate.getDate();
|
|
5481
|
+
const calendarArray = [];
|
|
5482
|
+
let currentDay = firstDayWeekday * -1; // how many empty spaces to add
|
|
5483
|
+
let trailingSpaces = 0;
|
|
5484
|
+
let totalWeeks = NaN;
|
|
5485
|
+
for (let week = 0; week < 6; week++) {
|
|
5486
|
+
const currentWeek = [];
|
|
5487
|
+
// add days for the whole week
|
|
5488
|
+
for (let weekday = 0; weekday < 7; weekday++) {
|
|
5489
|
+
currentDay++;
|
|
5490
|
+
// add empty space before the first day of the month
|
|
5491
|
+
if (currentDay < 1 || currentDay > lastDay) {
|
|
5492
|
+
currentWeek.push(null);
|
|
5493
|
+
trailingSpaces++;
|
|
5494
|
+
continue;
|
|
5495
|
+
}
|
|
5496
|
+
// add the day number
|
|
5497
|
+
currentWeek.push({
|
|
5498
|
+
value: currentDay,
|
|
5499
|
+
disabled: !!isDayOutOfRange(currentDay, monthIndex, year, min, max),
|
|
5500
|
+
});
|
|
5501
|
+
}
|
|
5502
|
+
calendarArray.push(currentWeek);
|
|
5503
|
+
if (currentDay > lastDay) {
|
|
5504
|
+
totalWeeks = week + 1;
|
|
5505
|
+
break;
|
|
5506
|
+
}
|
|
5507
|
+
}
|
|
5508
|
+
trailingSpaces -= firstDayWeekday;
|
|
5509
|
+
return {
|
|
5510
|
+
array: calendarArray,
|
|
5511
|
+
leadingSpaces: firstDayWeekday,
|
|
5512
|
+
trailingSpaces,
|
|
5513
|
+
weeks: totalWeeks,
|
|
5514
|
+
};
|
|
5515
|
+
}
|
|
5516
|
+
function getCalendarWeekdayArray(firstWeekday = 1) {
|
|
5517
|
+
return [0, 1, 2, 3, 4, 5, 6].map(v => (v + firstWeekday) % 7);
|
|
5518
|
+
}
|
|
5519
|
+
function isDayOutOfRange(day, month, year, min, max) {
|
|
5520
|
+
const date = new Date(year, month, day);
|
|
5521
|
+
if (isDefined(min) && date < min)
|
|
5522
|
+
return -1;
|
|
5523
|
+
if (isDefined(max) && date > max)
|
|
5524
|
+
return 1;
|
|
5525
|
+
return 0;
|
|
5526
|
+
}
|
|
5527
|
+
|
|
5528
|
+
function isMonthOutOfRange(month, year, min, max) {
|
|
5529
|
+
const dateForMinComparison = new Date(year, month + 1, 0); // last day of month
|
|
5530
|
+
if (isDefined(min) && dateForMinComparison < min)
|
|
5531
|
+
return -1;
|
|
5532
|
+
const dateForMaxComparison = new Date(year, month, 1); // first day of month
|
|
5533
|
+
if (isDefined(max) && dateForMaxComparison > max)
|
|
5534
|
+
return 1;
|
|
5535
|
+
return 0;
|
|
5536
|
+
}
|
|
5537
|
+
function getCalendarMonthsArray(year, min, max) {
|
|
5538
|
+
const months = [];
|
|
5539
|
+
for (let month = 0; month < 12; month++) {
|
|
5540
|
+
const monthData = {
|
|
5541
|
+
value: month,
|
|
5542
|
+
disabled: !!isMonthOutOfRange(month, year, min, max),
|
|
5543
|
+
};
|
|
5544
|
+
months.push(monthData);
|
|
5545
|
+
}
|
|
5546
|
+
return months;
|
|
5547
|
+
}
|
|
5548
|
+
|
|
5549
|
+
function getCalendarYearsArray(startYear, yearCount, min, max) {
|
|
5550
|
+
return new Array(yearCount).fill(startYear).map((v, i) => ({ value: v + i, disabled: !!isYearOutOfRange(v + i, min, max) }));
|
|
5551
|
+
}
|
|
5552
|
+
function isYearOutOfRange(year, min, max) {
|
|
5553
|
+
const dateForMinComparison = new Date(year, 11, 31);
|
|
5554
|
+
if (isDefined(min) && dateForMinComparison < min)
|
|
5555
|
+
return -1;
|
|
5556
|
+
const dateForMaxComparison = new Date(year, 0, 1);
|
|
5557
|
+
if (isDefined(max) && dateForMaxComparison > max)
|
|
5558
|
+
return 1;
|
|
5559
|
+
return 0;
|
|
5560
|
+
}
|
|
5561
|
+
|
|
5562
|
+
const ARD_ICON_BUTTON_DEFAULTS = new InjectionToken('ard-icon-button-defaults', {
|
|
5563
|
+
factory: () => _simpleButtonDefaults,
|
|
5564
|
+
});
|
|
5565
|
+
function provideIconButtonDefaults(config) {
|
|
5566
|
+
return { provide: ARD_ICON_BUTTON_DEFAULTS, useValue: { ..._simpleButtonDefaults, ...config } };
|
|
5567
|
+
}
|
|
5568
|
+
|
|
5569
|
+
class ArdiumIconButtonComponent extends _FocusableComponentBase {
|
|
5570
|
+
constructor(defaults) {
|
|
5571
|
+
super(defaults);
|
|
5572
|
+
this.wrapperClasses = input('');
|
|
5573
|
+
this.type = input(this._DEFAULTS.type);
|
|
5574
|
+
//! button settings
|
|
5575
|
+
this.color = input(this._DEFAULTS.color);
|
|
5576
|
+
this.lightColoring = input(this._DEFAULTS.lightColoring, { transform: v => coerceBooleanProperty(v) });
|
|
5577
|
+
this.compact = input(this._DEFAULTS.compact, { transform: v => coerceBooleanProperty(v) });
|
|
5578
|
+
this.ngClasses = computed(() => [
|
|
5579
|
+
'ard-appearance-transparent',
|
|
5580
|
+
`ard-color-${this.disabled() ? ComponentColor.None : this.color()}`,
|
|
5581
|
+
this.lightColoring() ? `ard-light-coloring` : '',
|
|
5582
|
+
this.compact() ? 'ard-compact' : '',
|
|
5583
|
+
].join(' '));
|
|
5584
|
+
}
|
|
5585
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonComponent, deps: [{ token: ARD_ICON_BUTTON_DEFAULTS }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5586
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: { wrapperClasses: { classPropertyName: "wrapperClasses", publicName: "wrapperClasses", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, lightColoring: { classPropertyName: "lightColoring", publicName: "lightColoring", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<button\n class=\"ard-icon-button\"\n [type]=\"type()\"\n [ngClass]=\"ngClasses()\"\n [tabindex]=\"tabIndex()\"\n (focus)=\"focusEvent.emit($event)\"\n (blur)=\"blurEvent.emit($event)\"\n>\n <div class=\"ard-focus-overlay\"></div>\n <div class=\"ard-button-content\">\n <ng-content></ng-content>\n </div>\n</button>\n", styles: [".ard-icon-button{display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.ard-icon-button .ard-button-content{max-height:100%;display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
5587
|
+
}
|
|
5588
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonComponent, decorators: [{
|
|
5589
|
+
type: Component,
|
|
5590
|
+
args: [{ selector: 'ard-icon-button', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n class=\"ard-icon-button\"\n [type]=\"type()\"\n [ngClass]=\"ngClasses()\"\n [tabindex]=\"tabIndex()\"\n (focus)=\"focusEvent.emit($event)\"\n (blur)=\"blurEvent.emit($event)\"\n>\n <div class=\"ard-focus-overlay\"></div>\n <div class=\"ard-button-content\">\n <ng-content></ng-content>\n </div>\n</button>\n", styles: [".ard-icon-button{display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.ard-icon-button .ard-button-content{max-height:100%;display:flex;align-items:center;justify-content:center}\n"] }]
|
|
5591
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
5592
|
+
type: Inject,
|
|
5593
|
+
args: [ARD_ICON_BUTTON_DEFAULTS]
|
|
5594
|
+
}] }] });
|
|
5595
|
+
|
|
5596
|
+
const TODAY$3 = new Date();
|
|
5597
|
+
function isLeapYear(year) {
|
|
5598
|
+
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
|
5599
|
+
}
|
|
5600
|
+
class DaysViewComponent {
|
|
5601
|
+
constructor() {
|
|
5602
|
+
this.tabIndex = input.required();
|
|
5603
|
+
this.readOnly = input.required();
|
|
5604
|
+
this.disabled = input.required();
|
|
5605
|
+
this.autoFocus = input.required();
|
|
5606
|
+
this._isUsingKeyboard = input.required();
|
|
5607
|
+
//! active year/month
|
|
5608
|
+
this.activeYear = input.required();
|
|
5609
|
+
this.activeMonth = input.required();
|
|
5610
|
+
this.selectedDate = input.required();
|
|
5611
|
+
this.min = input.required();
|
|
5612
|
+
this.max = input.required();
|
|
5613
|
+
this.isDayFilteredOut = input.required();
|
|
5614
|
+
this.highlightedDay = input.required();
|
|
5615
|
+
//! focusing
|
|
5616
|
+
this.focusableElement = viewChild.required('focusableElement');
|
|
5617
|
+
//! calendar data
|
|
5618
|
+
this.firstWeekday = input.required();
|
|
5619
|
+
this.activeCalendarData = computed(() => getCalendarDayData(this.activeYear(), this.activeMonth(), this.firstWeekday(), this.min(), this.max()));
|
|
5620
|
+
this.reserveTopRow = computed(() => this.activeCalendarData().leadingSpaces < 3);
|
|
5621
|
+
this.weekdayArray = computed(() => getCalendarWeekdayArray(this.firstWeekday()));
|
|
5622
|
+
this.currentAriaLabel = computed(() => {
|
|
5623
|
+
const day = this.highlightedDay();
|
|
5624
|
+
if (day === null) {
|
|
5625
|
+
return '';
|
|
5626
|
+
}
|
|
5627
|
+
return new Date(this.activeYear(), this.activeMonth(), day).toLocaleDateString(undefined, {
|
|
5628
|
+
weekday: 'long',
|
|
5629
|
+
year: 'numeric',
|
|
5630
|
+
month: 'long',
|
|
5631
|
+
day: 'numeric',
|
|
5632
|
+
});
|
|
5633
|
+
});
|
|
5634
|
+
//! outputs
|
|
5635
|
+
this.triggerOpenYearsView = output();
|
|
5636
|
+
this.triggerOpenMonthsView = output();
|
|
5637
|
+
this.triggerSelectDay = output();
|
|
5638
|
+
this.triggerChangeMonth = output();
|
|
5639
|
+
this.triggerChangeYear = output();
|
|
5640
|
+
this.triggerHighlightDay = output();
|
|
5641
|
+
this.triggerHighlightNextDay = output();
|
|
5642
|
+
this.triggerHighlightPreviousDay = output();
|
|
5643
|
+
this.triggerHighlightFirstDay = output();
|
|
5644
|
+
this.triggerHighlightLastDay = output();
|
|
5645
|
+
this.triggerHighlightSameDayPreviousPage = output();
|
|
5646
|
+
this.triggerHighlightSameDayNextPage = output();
|
|
5647
|
+
this.focusEvent = output({ alias: 'focus' });
|
|
5648
|
+
this.blurEvent = output({ alias: 'blur' });
|
|
5649
|
+
//! templates
|
|
5650
|
+
this.daysViewHeaderTemplate = input.required();
|
|
5651
|
+
this.floatingMonthTemplate = input.required();
|
|
5652
|
+
this.weekdayTemplate = input.required();
|
|
5653
|
+
this.dayTemplate = input.required();
|
|
5654
|
+
//! template contexts
|
|
5655
|
+
this.daysViewHeaderContext = computed(() => ({
|
|
5656
|
+
nextMonth: () => {
|
|
5657
|
+
this.triggerChangeMonth.emit(this.activeMonth() + 1);
|
|
5658
|
+
},
|
|
5659
|
+
prevMonth: () => {
|
|
5660
|
+
this.triggerChangeMonth.emit(this.activeMonth() - 1);
|
|
5661
|
+
},
|
|
5662
|
+
nextYear: () => {
|
|
5663
|
+
this.triggerChangeYear.emit(this.activeYear() + 1);
|
|
5664
|
+
},
|
|
5665
|
+
prevYear: () => {
|
|
5666
|
+
this.triggerChangeYear.emit(this.activeYear() - 1);
|
|
5667
|
+
},
|
|
5668
|
+
openYearsView: () => {
|
|
5669
|
+
this.triggerOpenYearsView.emit();
|
|
5670
|
+
},
|
|
5671
|
+
openMonthsView: () => {
|
|
5672
|
+
this.triggerOpenMonthsView.emit();
|
|
5673
|
+
},
|
|
5674
|
+
canGoToNextPage: !this.isMonthOutOfRange(this.activeMonth() + 1),
|
|
5675
|
+
canGoToPreviousPage: !this.isMonthOutOfRange(this.activeMonth() - 1),
|
|
5676
|
+
year: this.activeYear(),
|
|
5677
|
+
month: this.activeMonth(),
|
|
5678
|
+
$implicit: new Date(this.activeYear(), this.activeMonth(), 1, 0, 0, 0, 0),
|
|
5679
|
+
}));
|
|
5680
|
+
this.weekdayContext = computed(() => (dayIndex) => {
|
|
5681
|
+
const date = new Date(1970, 0, 4 + dayIndex);
|
|
5682
|
+
return {
|
|
5683
|
+
dayIndex,
|
|
5684
|
+
date,
|
|
5685
|
+
$implicit: date,
|
|
5686
|
+
};
|
|
5687
|
+
});
|
|
5688
|
+
this.floatingMonthContext = computed(() => {
|
|
5689
|
+
const date = new Date(this.activeYear(), this.activeMonth(), 1, 0, 0, 0, 0);
|
|
5690
|
+
return {
|
|
5691
|
+
month: this.activeMonth(),
|
|
5692
|
+
date,
|
|
5693
|
+
$implicit: date,
|
|
5694
|
+
};
|
|
5695
|
+
});
|
|
5696
|
+
this.dayContext = computed(() => (day) => {
|
|
5697
|
+
const date = new Date(this.activeYear(), this.activeMonth(), day);
|
|
5698
|
+
return {
|
|
5699
|
+
value: day,
|
|
5700
|
+
date,
|
|
5701
|
+
$implicit: day,
|
|
5702
|
+
select: (dayOrDate) => {
|
|
5703
|
+
this.triggerSelectDay.emit(dayOrDate instanceof Date ? dayOrDate.getDate() : dayOrDate);
|
|
5704
|
+
},
|
|
5705
|
+
};
|
|
5706
|
+
});
|
|
5707
|
+
}
|
|
5708
|
+
onMouseMove() {
|
|
5709
|
+
if (this._isUsingKeyboard())
|
|
5710
|
+
return;
|
|
5711
|
+
if (this.highlightedDay())
|
|
5712
|
+
this.triggerHighlightDay.emit(null);
|
|
5713
|
+
}
|
|
5714
|
+
ngAfterViewInit() {
|
|
5715
|
+
if (!this.autoFocus())
|
|
5716
|
+
return;
|
|
5717
|
+
this.focus();
|
|
5718
|
+
this.triggerHighlightDay.emit(1);
|
|
5719
|
+
}
|
|
5720
|
+
focus() {
|
|
5721
|
+
this.focusableElement().nativeElement.focus();
|
|
5722
|
+
}
|
|
5723
|
+
isDaySelected(day) {
|
|
5724
|
+
if (day instanceof Date)
|
|
5725
|
+
day = day.getDate();
|
|
5726
|
+
return (this.selectedDate() !== null &&
|
|
5727
|
+
this.activeYear() === this.selectedDate()?.getFullYear() &&
|
|
5728
|
+
this.activeMonth() === this.selectedDate()?.getMonth() &&
|
|
5729
|
+
day === this.selectedDate()?.getDate());
|
|
5730
|
+
}
|
|
5731
|
+
onCalendarDayMouseover(day) {
|
|
5732
|
+
if (this._isUsingKeyboard())
|
|
5733
|
+
return;
|
|
5734
|
+
if (this.disabled() || this.readOnly())
|
|
5735
|
+
return;
|
|
5736
|
+
if (day && this.isDayFilteredOut()(day))
|
|
5737
|
+
return;
|
|
5738
|
+
this.triggerHighlightDay.emit(day);
|
|
5739
|
+
}
|
|
5740
|
+
onCalendarDayClick(day) {
|
|
5741
|
+
if (this.disabled() || this.readOnly())
|
|
5742
|
+
return;
|
|
5743
|
+
if (day === null)
|
|
5744
|
+
return;
|
|
5745
|
+
if (this.isDayFilteredOut()(day))
|
|
5746
|
+
return;
|
|
5747
|
+
this.triggerHighlightDay.emit(day);
|
|
5748
|
+
this.focus();
|
|
5749
|
+
this.triggerSelectDay.emit(day);
|
|
5750
|
+
}
|
|
5751
|
+
onDayGridFocus() {
|
|
5752
|
+
if (this.disabled() || this.readOnly())
|
|
5753
|
+
return;
|
|
5754
|
+
this.triggerHighlightFirstDay.emit();
|
|
5755
|
+
}
|
|
5756
|
+
onDayGridBlur() {
|
|
5757
|
+
if (this.disabled() || this.readOnly())
|
|
5758
|
+
return;
|
|
5759
|
+
this.triggerHighlightDay.emit(null);
|
|
5760
|
+
}
|
|
5761
|
+
onDayGridClick() {
|
|
5762
|
+
if (this.disabled() || this.readOnly())
|
|
5763
|
+
return;
|
|
5764
|
+
if (this.highlightedDay() !== null)
|
|
5765
|
+
return;
|
|
5766
|
+
this.triggerHighlightFirstDay.emit();
|
|
5767
|
+
}
|
|
5768
|
+
//! helpers
|
|
5769
|
+
isDayToday(day) {
|
|
5770
|
+
return this.activeYear() === TODAY$3.getFullYear() && this.activeMonth() === TODAY$3.getMonth() && day === TODAY$3.getDate();
|
|
5771
|
+
}
|
|
5772
|
+
isMonthOutOfRange(month) {
|
|
5773
|
+
return isMonthOutOfRange(month, this.activeYear(), this.min(), this.max());
|
|
5774
|
+
}
|
|
5775
|
+
//! keyboard controls
|
|
5776
|
+
onMainGridKeydown(event) {
|
|
5777
|
+
if (this.disabled() || this.readOnly())
|
|
5778
|
+
return;
|
|
5779
|
+
switch (event.code) {
|
|
5780
|
+
case 'Space':
|
|
5781
|
+
case 'Enter':
|
|
5782
|
+
this._onEnterPress(event);
|
|
5783
|
+
break;
|
|
5784
|
+
case 'ArrowUp':
|
|
5785
|
+
this._onArrowUpPress(event);
|
|
5786
|
+
break;
|
|
5787
|
+
case 'ArrowDown':
|
|
5788
|
+
this._onArrowDownPress(event);
|
|
5789
|
+
break;
|
|
5790
|
+
case 'ArrowLeft':
|
|
5791
|
+
this._onArrowLeftPress(event);
|
|
5792
|
+
break;
|
|
5793
|
+
case 'ArrowRight':
|
|
5794
|
+
this._onArrowRightPress(event);
|
|
5795
|
+
break;
|
|
5796
|
+
case 'Home':
|
|
5797
|
+
this._onHomePress(event);
|
|
5798
|
+
break;
|
|
5799
|
+
case 'End':
|
|
5800
|
+
this._onEndPress(event);
|
|
5801
|
+
break;
|
|
5802
|
+
case 'PageUp':
|
|
5803
|
+
this._onPageUpPress(event);
|
|
5804
|
+
break;
|
|
5805
|
+
case 'PageDown':
|
|
5806
|
+
this._onPageDownPress(event);
|
|
5807
|
+
break;
|
|
5808
|
+
default:
|
|
5809
|
+
return;
|
|
5810
|
+
}
|
|
5811
|
+
}
|
|
5812
|
+
//select currently selected entry
|
|
5813
|
+
_onEnterPress(event) {
|
|
5814
|
+
event.preventDefault();
|
|
5815
|
+
this.triggerSelectDay.emit(this.highlightedDay());
|
|
5816
|
+
}
|
|
5817
|
+
//highlight the entry one line below
|
|
5818
|
+
_onArrowDownPress(event) {
|
|
5819
|
+
event.preventDefault();
|
|
5820
|
+
this.triggerHighlightNextDay.emit(7);
|
|
5821
|
+
}
|
|
5822
|
+
//highlight the entry one line above
|
|
5823
|
+
_onArrowUpPress(event) {
|
|
5824
|
+
event.preventDefault();
|
|
5825
|
+
this.triggerHighlightPreviousDay.emit(7);
|
|
5826
|
+
}
|
|
5827
|
+
//highlight next entry
|
|
5828
|
+
_onArrowRightPress(event) {
|
|
5829
|
+
event.preventDefault();
|
|
5830
|
+
this.triggerHighlightNextDay.emit(1);
|
|
5831
|
+
}
|
|
5832
|
+
//highlight previous entry
|
|
5833
|
+
_onArrowLeftPress(event) {
|
|
5834
|
+
event.preventDefault();
|
|
5835
|
+
this.triggerHighlightPreviousDay.emit(1);
|
|
5836
|
+
}
|
|
5837
|
+
//highlight first entry on the page
|
|
5838
|
+
_onHomePress(event) {
|
|
5839
|
+
event.preventDefault();
|
|
5840
|
+
this.triggerHighlightFirstDay.emit();
|
|
5841
|
+
}
|
|
5842
|
+
//highlight last entry on the page
|
|
5843
|
+
_onEndPress(event) {
|
|
5844
|
+
event.preventDefault();
|
|
5845
|
+
this.triggerHighlightLastDay.emit();
|
|
5846
|
+
}
|
|
5847
|
+
//alone: highlight same entry on the next page
|
|
5848
|
+
//with alt: highlight same entry multiple pages after (12 pages)
|
|
5849
|
+
_onPageDownPress(event) {
|
|
5850
|
+
event.preventDefault();
|
|
5851
|
+
this.triggerHighlightSameDayNextPage.emit(event.altKey);
|
|
5852
|
+
}
|
|
5853
|
+
//alone: highlight same entry on the previous page
|
|
5854
|
+
//with alt: highlight same entry multiple pages before (12 pages)
|
|
5855
|
+
_onPageUpPress(event) {
|
|
5856
|
+
event.preventDefault();
|
|
5857
|
+
this.triggerHighlightSameDayPreviousPage.emit(event.altKey);
|
|
5858
|
+
}
|
|
5859
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DaysViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5860
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DaysViewComponent, selector: "ard-days-view", inputs: { tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: true, transformFunction: null }, _isUsingKeyboard: { classPropertyName: "_isUsingKeyboard", publicName: "_isUsingKeyboard", isSignal: true, isRequired: true, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: true, transformFunction: null }, activeMonth: { classPropertyName: "activeMonth", publicName: "activeMonth", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, isDayFilteredOut: { classPropertyName: "isDayFilteredOut", publicName: "isDayFilteredOut", isSignal: true, isRequired: true, transformFunction: null }, highlightedDay: { classPropertyName: "highlightedDay", publicName: "highlightedDay", isSignal: true, isRequired: true, transformFunction: null }, firstWeekday: { classPropertyName: "firstWeekday", publicName: "firstWeekday", isSignal: true, isRequired: true, transformFunction: null }, daysViewHeaderTemplate: { classPropertyName: "daysViewHeaderTemplate", publicName: "daysViewHeaderTemplate", isSignal: true, isRequired: true, transformFunction: null }, floatingMonthTemplate: { classPropertyName: "floatingMonthTemplate", publicName: "floatingMonthTemplate", isSignal: true, isRequired: true, transformFunction: null }, weekdayTemplate: { classPropertyName: "weekdayTemplate", publicName: "weekdayTemplate", isSignal: true, isRequired: true, transformFunction: null }, dayTemplate: { classPropertyName: "dayTemplate", publicName: "dayTemplate", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { triggerOpenYearsView: "triggerOpenYearsView", triggerOpenMonthsView: "triggerOpenMonthsView", triggerSelectDay: "triggerSelectDay", triggerChangeMonth: "triggerChangeMonth", triggerChangeYear: "triggerChangeYear", triggerHighlightDay: "triggerHighlightDay", triggerHighlightNextDay: "triggerHighlightNextDay", triggerHighlightPreviousDay: "triggerHighlightPreviousDay", triggerHighlightFirstDay: "triggerHighlightFirstDay", triggerHighlightLastDay: "triggerHighlightLastDay", triggerHighlightSameDayPreviousPage: "triggerHighlightSameDayPreviousPage", triggerHighlightSameDayNextPage: "triggerHighlightSameDayNextPage", focusEvent: "focus", blurEvent: "blur" }, host: { listeners: { "mousemove": "onMouseMove()" } }, viewQueries: [{ propertyName: "focusableElement", first: true, predicate: ["focusableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ard-days-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultDaysViewHeaderTemplate\r\n let-currDate\r\n let-nextMonth=\"nextMonth\"\r\n let-prevMonth=\"prevMonth\"\r\n let-canGoToNextMonth=\"canGoToNextPage\"\r\n let-canGoToPreviousMonth=\"canGoToPreviousPage\"\r\n let-openYearsView=\"openYearsView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openYearsView()\"\r\n >\r\n {{ currDate | date : 'MMM YYYY' | uppercase }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div class=\"ard-calendar__arrows\">\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevMonth()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousMonth\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextMonth()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextMonth\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"daysViewHeaderTemplate() || defaultDaysViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"daysViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div class=\"ard-calendar__weekdays\">\r\n <ng-template\r\n #defaultWeekdayTemplate\r\n let-date\r\n >\r\n <div class=\"ard-calendar__weekday\">{{ date | date : 'EEEEE' }}</div>\r\n </ng-template>\r\n @for (weekdayIndex of weekdayArray(); track weekdayIndex) {\r\n <ng-template\r\n [ngTemplateOutlet]=\"weekdayTemplate() || defaultWeekdayTemplate\"\r\n [ngTemplateOutletContext]=\"weekdayContext()(weekdayIndex)\"\r\n ></ng-template>\r\n }\r\n </div>\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__days-grid\"\r\n [class.ard-reserve-top-row]=\"reserveTopRow()\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onDayGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onDayGridBlur()\"\r\n (click)=\"onDayGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n <div class=\"ard-calendar__floating-month\">\r\n <ng-template\r\n #defaultFloatingMonthTemplate\r\n let-date\r\n >\r\n {{ date | date : 'LLL' | uppercase }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"floatingMonthTemplate() || defaultFloatingMonthTemplate\"\r\n [ngTemplateOutletContext]=\"floatingMonthContext()\"\r\n ></ng-template>\r\n </div>\r\n @for (week of activeCalendarData().array; track $index) { @for (day of week; track day ? day :\r\n activeCalendarData().leadingSpaces - $index) { @if (day === null) {\r\n <div class=\"ard-calendar__entry ard-calendar__entry-empty\"></div>\r\n } @else {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedDay() === day.value\"\r\n [class.ard-calendar__entry-disabled]=\"day.disabled || isDayFilteredOut()(day.value)\"\r\n [class.ard-calendar__entry-selected]=\"isDaySelected(day.value)\"\r\n [class.ard-calendar-today]=\"isDayToday(day.value)\"\r\n (click)=\"onCalendarDayClick(day.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarDayMouseover(day.value)\"\r\n role=\"gridcell\"\r\n >\r\n <div class=\"ard-calendar__entry-button\">\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultDayTemplate\r\n let-day\r\n >\r\n {{ day }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"dayTemplate() || defaultDayTemplate\"\r\n [ngTemplateOutletContext]=\"dayContext()(day.value)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n } } }\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "color", "lightColoring", "compact"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }, { kind: "component", type: ArdiumButtonComponent, selector: "ard-button", inputs: ["icon", "variant", "alignIcon", "vertical"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5861
|
+
}
|
|
5862
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DaysViewComponent, decorators: [{
|
|
5863
|
+
type: Component,
|
|
5864
|
+
args: [{ selector: 'ard-days-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ard-days-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultDaysViewHeaderTemplate\r\n let-currDate\r\n let-nextMonth=\"nextMonth\"\r\n let-prevMonth=\"prevMonth\"\r\n let-canGoToNextMonth=\"canGoToNextPage\"\r\n let-canGoToPreviousMonth=\"canGoToPreviousPage\"\r\n let-openYearsView=\"openYearsView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n variant=\"pill\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openYearsView()\"\r\n >\r\n {{ currDate | date : 'MMM YYYY' | uppercase }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div class=\"ard-calendar__arrows\">\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevMonth()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousMonth\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextMonth()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextMonth\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"daysViewHeaderTemplate() || defaultDaysViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"daysViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div class=\"ard-calendar__weekdays\">\r\n <ng-template\r\n #defaultWeekdayTemplate\r\n let-date\r\n >\r\n <div class=\"ard-calendar__weekday\">{{ date | date : 'EEEEE' }}</div>\r\n </ng-template>\r\n @for (weekdayIndex of weekdayArray(); track weekdayIndex) {\r\n <ng-template\r\n [ngTemplateOutlet]=\"weekdayTemplate() || defaultWeekdayTemplate\"\r\n [ngTemplateOutletContext]=\"weekdayContext()(weekdayIndex)\"\r\n ></ng-template>\r\n }\r\n </div>\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__days-grid\"\r\n [class.ard-reserve-top-row]=\"reserveTopRow()\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onDayGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onDayGridBlur()\"\r\n (click)=\"onDayGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n <div class=\"ard-calendar__floating-month\">\r\n <ng-template\r\n #defaultFloatingMonthTemplate\r\n let-date\r\n >\r\n {{ date | date : 'LLL' | uppercase }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"floatingMonthTemplate() || defaultFloatingMonthTemplate\"\r\n [ngTemplateOutletContext]=\"floatingMonthContext()\"\r\n ></ng-template>\r\n </div>\r\n @for (week of activeCalendarData().array; track $index) { @for (day of week; track day ? day :\r\n activeCalendarData().leadingSpaces - $index) { @if (day === null) {\r\n <div class=\"ard-calendar__entry ard-calendar__entry-empty\"></div>\r\n } @else {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedDay() === day.value\"\r\n [class.ard-calendar__entry-disabled]=\"day.disabled || isDayFilteredOut()(day.value)\"\r\n [class.ard-calendar__entry-selected]=\"isDaySelected(day.value)\"\r\n [class.ard-calendar-today]=\"isDayToday(day.value)\"\r\n (click)=\"onCalendarDayClick(day.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarDayMouseover(day.value)\"\r\n role=\"gridcell\"\r\n >\r\n <div class=\"ard-calendar__entry-button\">\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultDayTemplate\r\n let-day\r\n >\r\n {{ day }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"dayTemplate() || defaultDayTemplate\"\r\n [ngTemplateOutletContext]=\"dayContext()(day.value)\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n } } }\r\n </div>\r\n</div>\r\n" }]
|
|
5865
|
+
}], propDecorators: { onMouseMove: [{
|
|
5866
|
+
type: HostListener,
|
|
5867
|
+
args: ['mousemove']
|
|
5868
|
+
}] } });
|
|
5869
|
+
|
|
5870
|
+
const TODAY$2 = new Date();
|
|
5871
|
+
class MonthsViewComponent {
|
|
5872
|
+
constructor() {
|
|
5873
|
+
this.tabIndex = input.required();
|
|
5874
|
+
this.readOnly = input.required();
|
|
5875
|
+
this.disabled = input.required();
|
|
5876
|
+
this.autoFocus = input.required();
|
|
5877
|
+
this._isUsingKeyboard = input.required();
|
|
5878
|
+
this.color = input.required();
|
|
5879
|
+
this.activeYear = input.required();
|
|
5880
|
+
this.activeMonth = input.required();
|
|
5881
|
+
this.selectedDate = input.required();
|
|
5882
|
+
this.min = input.required();
|
|
5883
|
+
this.max = input.required();
|
|
5884
|
+
this.monthsArray = computed(() => getCalendarMonthsArray(this.activeYear(), this.min(), this.max()));
|
|
5885
|
+
this.currentAriaLabel = computed(() => {
|
|
5886
|
+
const month = this.highlightedMonth();
|
|
5887
|
+
if (month === null) {
|
|
5888
|
+
return '';
|
|
5889
|
+
}
|
|
5890
|
+
return new Date(this.activeYear(), month, 1).toLocaleDateString(undefined, {
|
|
5891
|
+
year: 'numeric',
|
|
5892
|
+
month: 'long',
|
|
5893
|
+
});
|
|
5894
|
+
});
|
|
5895
|
+
//! outputs
|
|
5896
|
+
this.triggerOpenYearsView = output();
|
|
5897
|
+
this.triggerOpenDaysView = output();
|
|
5898
|
+
this.focusEvent = output({ alias: 'focus' });
|
|
5899
|
+
this.blurEvent = output({ alias: 'blur' });
|
|
5900
|
+
this.triggerSelectMonth = output();
|
|
5901
|
+
this.triggeChangeYear = output();
|
|
5902
|
+
this.triggerHighlightMonth = output();
|
|
5903
|
+
this.triggerHighlightNextMonth = output();
|
|
5904
|
+
this.triggerHighlightPreviousMonth = output();
|
|
5905
|
+
this.triggerHighlightFirstMonth = output();
|
|
5906
|
+
this.triggerHighlightLastMonth = output();
|
|
5907
|
+
this.triggerHighlightSameMonthPreviousPage = output();
|
|
5908
|
+
this.triggerHighlightSameMonthNextPage = output();
|
|
5909
|
+
//! calendar entry hover & click
|
|
5910
|
+
this.highlightedMonth = input.required();
|
|
5911
|
+
//! focusing
|
|
5912
|
+
this.focusableElement = viewChild.required('focusableElement');
|
|
5913
|
+
//! templates
|
|
5914
|
+
this.monthsViewHeaderTemplate = input.required();
|
|
5915
|
+
this.monthTemplate = input.required();
|
|
5916
|
+
//! template contexts
|
|
5917
|
+
this.monthsViewHeaderContext = computed(() => ({
|
|
5918
|
+
nextPage: () => {
|
|
5919
|
+
this.triggeChangeYear.emit(this.activeYear() + 1);
|
|
5920
|
+
},
|
|
5921
|
+
prevPage: () => {
|
|
5922
|
+
this.triggeChangeYear.emit(this.activeYear() - 1);
|
|
5923
|
+
},
|
|
5924
|
+
openYearsView: () => {
|
|
5925
|
+
this.triggerOpenYearsView.emit();
|
|
5926
|
+
},
|
|
5927
|
+
openDaysView: () => {
|
|
5928
|
+
this.triggerOpenDaysView.emit();
|
|
5929
|
+
},
|
|
5930
|
+
canGoToNextPage: !this.isYearOutOfRange(this.activeYear() + 1),
|
|
5931
|
+
canGoToPreviousPage: !this.isYearOutOfRange(this.activeYear() - 1),
|
|
5932
|
+
year: this.activeYear(),
|
|
5933
|
+
date: new Date(this.activeYear(), 0, 1),
|
|
5934
|
+
$implicit: this.activeYear(),
|
|
5935
|
+
}));
|
|
5936
|
+
this.monthContext = computed(() => (month) => {
|
|
5937
|
+
const date = new Date(this.activeYear(), month, 1);
|
|
5938
|
+
return {
|
|
5939
|
+
month,
|
|
5940
|
+
date,
|
|
5941
|
+
$implicit: date,
|
|
5942
|
+
select: (month) => {
|
|
5943
|
+
if (month instanceof Date)
|
|
5944
|
+
month = month.getMonth();
|
|
5945
|
+
this.triggerSelectMonth.emit(month);
|
|
5946
|
+
},
|
|
5947
|
+
};
|
|
5948
|
+
});
|
|
5949
|
+
}
|
|
5950
|
+
onMouseMove() {
|
|
5951
|
+
if (this._isUsingKeyboard())
|
|
5952
|
+
return;
|
|
5953
|
+
if (this.highlightedMonth())
|
|
5954
|
+
this.triggerHighlightMonth.emit(null);
|
|
5955
|
+
}
|
|
5956
|
+
ngAfterViewInit() {
|
|
5957
|
+
if (!this.autoFocus())
|
|
5958
|
+
return;
|
|
5959
|
+
this.focus();
|
|
5960
|
+
this.triggerHighlightMonth.emit(0);
|
|
5961
|
+
}
|
|
5962
|
+
onCalendarMonthMouseover(month) {
|
|
5963
|
+
if (this._isUsingKeyboard())
|
|
5964
|
+
return;
|
|
5965
|
+
if (this.disabled() || this.readOnly())
|
|
5966
|
+
return;
|
|
5967
|
+
this.triggerHighlightMonth.emit(month);
|
|
5968
|
+
}
|
|
5969
|
+
onCalendarMonthClick(month) {
|
|
5970
|
+
if (this.disabled() || this.readOnly())
|
|
5971
|
+
return;
|
|
5972
|
+
this.triggerSelectMonth.emit(month);
|
|
5973
|
+
}
|
|
5974
|
+
onMonthGridFocus() {
|
|
5975
|
+
if (this.disabled() || this.readOnly())
|
|
5976
|
+
return;
|
|
5977
|
+
this.triggerHighlightMonth.emit(0);
|
|
5978
|
+
}
|
|
5979
|
+
onMonthGridBlur() {
|
|
5980
|
+
if (this.disabled() || this.readOnly())
|
|
5981
|
+
return;
|
|
5982
|
+
this.triggerHighlightMonth.emit(null);
|
|
5983
|
+
}
|
|
5984
|
+
onMonthGridClick() {
|
|
5985
|
+
if (this.disabled() || this.readOnly())
|
|
5986
|
+
return;
|
|
5987
|
+
if (this.highlightedMonth() !== null)
|
|
5988
|
+
return;
|
|
5989
|
+
this.triggerHighlightMonth.emit(0);
|
|
5990
|
+
}
|
|
5991
|
+
focus() {
|
|
5992
|
+
this.focusableElement().nativeElement.focus();
|
|
5993
|
+
}
|
|
5994
|
+
//! keyboard controls
|
|
5995
|
+
onMainGridKeydown(event) {
|
|
5996
|
+
if (this.disabled() || this.readOnly())
|
|
5997
|
+
return;
|
|
5998
|
+
switch (event.code) {
|
|
5999
|
+
case 'Space':
|
|
6000
|
+
case 'Enter':
|
|
6001
|
+
this._onEnterPress(event);
|
|
6002
|
+
break;
|
|
6003
|
+
case 'ArrowUp':
|
|
6004
|
+
this._onArrowUpPress(event);
|
|
6005
|
+
break;
|
|
6006
|
+
case 'ArrowDown':
|
|
6007
|
+
this._onArrowDownPress(event);
|
|
6008
|
+
break;
|
|
6009
|
+
case 'ArrowLeft':
|
|
6010
|
+
this._onArrowLeftPress(event);
|
|
6011
|
+
break;
|
|
6012
|
+
case 'ArrowRight':
|
|
6013
|
+
this._onArrowRightPress(event);
|
|
6014
|
+
break;
|
|
6015
|
+
case 'Home':
|
|
6016
|
+
this._onHomePress(event);
|
|
6017
|
+
break;
|
|
6018
|
+
case 'End':
|
|
6019
|
+
this._onEndPress(event);
|
|
6020
|
+
break;
|
|
6021
|
+
case 'PageUp':
|
|
6022
|
+
this._onPageUpPress(event);
|
|
6023
|
+
break;
|
|
6024
|
+
case 'PageDown':
|
|
6025
|
+
this._onPageDownPress(event);
|
|
6026
|
+
break;
|
|
6027
|
+
default:
|
|
6028
|
+
return;
|
|
6029
|
+
}
|
|
6030
|
+
}
|
|
6031
|
+
//select currently selected entry
|
|
6032
|
+
_onEnterPress(event) {
|
|
6033
|
+
event.preventDefault();
|
|
6034
|
+
const month = this.highlightedMonth();
|
|
6035
|
+
if (isNull(month))
|
|
6036
|
+
return;
|
|
6037
|
+
this.triggerSelectMonth.emit(month);
|
|
6038
|
+
}
|
|
6039
|
+
//highlight the entry one line below
|
|
6040
|
+
_onArrowDownPress(event) {
|
|
6041
|
+
event.preventDefault();
|
|
6042
|
+
this.triggerHighlightNextMonth.emit(4); //4 months per line
|
|
6043
|
+
}
|
|
6044
|
+
//highlight the entry one line above
|
|
6045
|
+
_onArrowUpPress(event) {
|
|
6046
|
+
event.preventDefault();
|
|
6047
|
+
this.triggerHighlightPreviousMonth.emit(4); //4 months per line
|
|
6048
|
+
}
|
|
6049
|
+
//highlight next entry
|
|
6050
|
+
_onArrowRightPress(event) {
|
|
6051
|
+
event.preventDefault();
|
|
6052
|
+
this.triggerHighlightNextMonth.emit(1);
|
|
6053
|
+
}
|
|
6054
|
+
//highlight previous entry
|
|
6055
|
+
_onArrowLeftPress(event) {
|
|
6056
|
+
event.preventDefault();
|
|
6057
|
+
this.triggerHighlightPreviousMonth.emit(1);
|
|
6058
|
+
}
|
|
6059
|
+
//highlight first entry on the page
|
|
6060
|
+
_onHomePress(event) {
|
|
6061
|
+
event.preventDefault();
|
|
6062
|
+
this.triggerHighlightFirstMonth.emit();
|
|
6063
|
+
}
|
|
6064
|
+
//highlight last entry on the page
|
|
6065
|
+
_onEndPress(event) {
|
|
6066
|
+
event.preventDefault();
|
|
6067
|
+
this.triggerHighlightLastMonth.emit();
|
|
6068
|
+
}
|
|
6069
|
+
//alone: highlight same entry on the next page
|
|
6070
|
+
//with alt: highlight same entry multiple pages after (10 pages)
|
|
6071
|
+
_onPageDownPress(event) {
|
|
6072
|
+
event.preventDefault();
|
|
6073
|
+
this.triggerHighlightSameMonthNextPage.emit(event.altKey);
|
|
6074
|
+
}
|
|
6075
|
+
//alone: highlight same entry on the previous page
|
|
6076
|
+
//with alt: highlight same entry multiple pages before (10 pages)
|
|
6077
|
+
_onPageUpPress(event) {
|
|
6078
|
+
event.preventDefault();
|
|
6079
|
+
this.triggerHighlightSameMonthPreviousPage.emit(event.altKey);
|
|
6080
|
+
}
|
|
6081
|
+
//! helpers
|
|
6082
|
+
isMonthToday(month) {
|
|
6083
|
+
return this.activeYear() === TODAY$2.getFullYear() && month === TODAY$2.getMonth();
|
|
6084
|
+
}
|
|
6085
|
+
isMonthSelected(month) {
|
|
6086
|
+
if (month instanceof Date)
|
|
6087
|
+
month = month.getMonth();
|
|
6088
|
+
return (this.selectedDate() !== null &&
|
|
6089
|
+
this.activeYear() === this.selectedDate()?.getFullYear() &&
|
|
6090
|
+
month === this.selectedDate()?.getMonth());
|
|
6091
|
+
}
|
|
6092
|
+
isYearOutOfRange(year) {
|
|
6093
|
+
return isYearOutOfRange(year, this.min(), this.max());
|
|
6094
|
+
}
|
|
6095
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonthsViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6096
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: MonthsViewComponent, selector: "ard-months-view", inputs: { tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: true, transformFunction: null }, _isUsingKeyboard: { classPropertyName: "_isUsingKeyboard", publicName: "_isUsingKeyboard", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: true, transformFunction: null }, activeMonth: { classPropertyName: "activeMonth", publicName: "activeMonth", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, highlightedMonth: { classPropertyName: "highlightedMonth", publicName: "highlightedMonth", isSignal: true, isRequired: true, transformFunction: null }, monthsViewHeaderTemplate: { classPropertyName: "monthsViewHeaderTemplate", publicName: "monthsViewHeaderTemplate", isSignal: true, isRequired: true, transformFunction: null }, monthTemplate: { classPropertyName: "monthTemplate", publicName: "monthTemplate", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { triggerOpenYearsView: "triggerOpenYearsView", triggerOpenDaysView: "triggerOpenDaysView", focusEvent: "focus", blurEvent: "blur", triggerSelectMonth: "triggerSelectMonth", triggeChangeYear: "triggeChangeYear", triggerHighlightMonth: "triggerHighlightMonth", triggerHighlightNextMonth: "triggerHighlightNextMonth", triggerHighlightPreviousMonth: "triggerHighlightPreviousMonth", triggerHighlightFirstMonth: "triggerHighlightFirstMonth", triggerHighlightLastMonth: "triggerHighlightLastMonth", triggerHighlightSameMonthPreviousPage: "triggerHighlightSameMonthPreviousPage", triggerHighlightSameMonthNextPage: "triggerHighlightSameMonthNextPage" }, host: { listeners: { "mousemove": "onMouseMove()" } }, viewQueries: [{ propertyName: "focusableElement", first: true, predicate: ["focusableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ard-months-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultMonthsViewHeaderTemplate\r\n let-year\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-openDaysView=\"openDaysView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n [color]=\"color()\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n >\r\n {{ year }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div class=\"ard-calendar-arrows\">\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthsViewHeaderTemplate() || defaultMonthsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"monthsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onMonthGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onMonthGridBlur()\"\r\n (click)=\"onMonthGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (month of monthsArray(); track $index) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedMonth() === month.value\"\r\n [class.ard-calendar__entry-disabled]=\"month.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isMonthSelected(month.value)\"\r\n [class.ard-calendar-today]=\"isMonthToday(month.value)\"\r\n (click)=\"onCalendarMonthClick(month.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarMonthMouseover(month.value)\"\r\n role=\"gridcell\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"ard-calendar__entry-button\"\r\n tabindex=\"-1\"\r\n >\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultMonthTemplate\r\n let-month\r\n >\r\n {{ month | date : 'MMM' | uppercase }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthTemplate() || defaultMonthTemplate\"\r\n [ngTemplateOutletContext]=\"monthContext()(month.value)\"\r\n />\r\n </div>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "color", "lightColoring", "compact"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }, { kind: "component", type: ArdiumButtonComponent, selector: "ard-button", inputs: ["icon", "variant", "alignIcon", "vertical"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6097
|
+
}
|
|
6098
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MonthsViewComponent, decorators: [{
|
|
6099
|
+
type: Component,
|
|
6100
|
+
args: [{ selector: 'ard-months-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ard-months-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultMonthsViewHeaderTemplate\r\n let-year\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-openDaysView=\"openDaysView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n [color]=\"color()\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n >\r\n {{ year }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div class=\"ard-calendar-arrows\">\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthsViewHeaderTemplate() || defaultMonthsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"monthsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onMonthGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onMonthGridBlur()\"\r\n (click)=\"onMonthGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (month of monthsArray(); track $index) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedMonth() === month.value\"\r\n [class.ard-calendar__entry-disabled]=\"month.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isMonthSelected(month.value)\"\r\n [class.ard-calendar-today]=\"isMonthToday(month.value)\"\r\n (click)=\"onCalendarMonthClick(month.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarMonthMouseover(month.value)\"\r\n role=\"gridcell\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"ard-calendar__entry-button\"\r\n tabindex=\"-1\"\r\n >\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultMonthTemplate\r\n let-month\r\n >\r\n {{ month | date : 'MMM' | uppercase }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"monthTemplate() || defaultMonthTemplate\"\r\n [ngTemplateOutletContext]=\"monthContext()(month.value)\"\r\n />\r\n </div>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n" }]
|
|
6101
|
+
}], propDecorators: { onMouseMove: [{
|
|
6102
|
+
type: HostListener,
|
|
6103
|
+
args: ['mousemove']
|
|
6104
|
+
}] } });
|
|
6105
|
+
|
|
6106
|
+
const TODAY$1 = new Date();
|
|
6107
|
+
class YearsViewComponent {
|
|
6108
|
+
constructor() {
|
|
6109
|
+
this.tabIndex = input.required();
|
|
6110
|
+
this.readOnly = input.required();
|
|
6111
|
+
this.disabled = input.required();
|
|
6112
|
+
this.autoFocus = input.required();
|
|
6113
|
+
this._isUsingKeyboard = input.required();
|
|
6114
|
+
this.activeYear = input.required();
|
|
6115
|
+
this.selectedDate = input.required();
|
|
6116
|
+
this.min = input.required();
|
|
6117
|
+
this.max = input.required();
|
|
6118
|
+
this.currentYearRangeStart = input.required();
|
|
6119
|
+
this.yearsArray = computed(() => getCalendarYearsArray(this.currentYearRangeStart(), 24, this.min(), this.max()));
|
|
6120
|
+
this.currentAriaLabel = computed(() => {
|
|
6121
|
+
return this.highlightedYear()?.toString() ?? '';
|
|
6122
|
+
});
|
|
6123
|
+
//! outputs
|
|
6124
|
+
this.triggerOpenMonthsView = output();
|
|
6125
|
+
this.triggerOpenDaysView = output();
|
|
6126
|
+
this.focusEvent = output({ alias: 'focus' });
|
|
6127
|
+
this.blurEvent = output({ alias: 'blur' });
|
|
6128
|
+
this.triggerSelectYear = output();
|
|
6129
|
+
this.triggerChangeYearsViewPage = output();
|
|
6130
|
+
this.triggerHighlightYear = output();
|
|
6131
|
+
this.triggerHighlightNextYear = output();
|
|
6132
|
+
this.triggerHighlightPreviousYear = output();
|
|
6133
|
+
this.triggerHighlightFirstYear = output();
|
|
6134
|
+
this.triggerHighlightLastYear = output();
|
|
6135
|
+
this.triggerHighlightSameYearPreviousPage = output();
|
|
6136
|
+
this.triggerHighlightSameYearNextPage = output();
|
|
6137
|
+
//! calendar entry hover & click
|
|
6138
|
+
this.highlightedYear = input.required();
|
|
6139
|
+
//! focusing
|
|
6140
|
+
this.focusableElement = viewChild.required('focusableElement');
|
|
6141
|
+
//! templates
|
|
6142
|
+
this.yearsViewHeaderTemplate = input.required();
|
|
6143
|
+
this.yearTemplate = input.required();
|
|
6144
|
+
//! template contexts
|
|
6145
|
+
this.yearsViewHeaderContext = computed(() => {
|
|
6146
|
+
const yearRangeStart = this.currentYearRangeStart();
|
|
6147
|
+
const yearRangeEnd = yearRangeStart + 23;
|
|
6148
|
+
const dateRange = {
|
|
6149
|
+
low: new Date(yearRangeStart, 0, 1),
|
|
6150
|
+
high: new Date(yearRangeEnd, 0, 1),
|
|
6151
|
+
};
|
|
6152
|
+
const yearRange = {
|
|
6153
|
+
low: yearRangeStart,
|
|
6154
|
+
high: yearRangeEnd,
|
|
6155
|
+
};
|
|
6156
|
+
return {
|
|
6157
|
+
nextPage: () => {
|
|
6158
|
+
this.triggerChangeYearsViewPage.emit(1);
|
|
6159
|
+
},
|
|
6160
|
+
prevPage: () => {
|
|
6161
|
+
this.triggerChangeYearsViewPage.emit(-1);
|
|
6162
|
+
},
|
|
6163
|
+
openMonthsView: () => {
|
|
6164
|
+
this.triggerOpenMonthsView.emit();
|
|
6165
|
+
},
|
|
6166
|
+
openDaysView: () => {
|
|
6167
|
+
this.triggerOpenDaysView.emit();
|
|
6168
|
+
},
|
|
6169
|
+
canGoToNextPage: !this.isYearOutOfRange(yearRangeEnd + 1),
|
|
6170
|
+
canGoToPreviousPage: !this.isYearOutOfRange(yearRangeStart - 1),
|
|
6171
|
+
yearRange: yearRange,
|
|
6172
|
+
dateRange,
|
|
6173
|
+
$implicit: dateRange,
|
|
6174
|
+
};
|
|
6175
|
+
});
|
|
6176
|
+
this.yearContext = computed(() => {
|
|
6177
|
+
return (year) => {
|
|
6178
|
+
const date = new Date(year, 1, 1);
|
|
6179
|
+
return {
|
|
6180
|
+
value: year,
|
|
6181
|
+
date,
|
|
6182
|
+
$implicit: date,
|
|
6183
|
+
select: (year) => {
|
|
6184
|
+
this.triggerSelectYear.emit(year);
|
|
6185
|
+
},
|
|
6186
|
+
};
|
|
6187
|
+
};
|
|
6188
|
+
});
|
|
6189
|
+
}
|
|
6190
|
+
onMouseMove() {
|
|
6191
|
+
if (this._isUsingKeyboard())
|
|
6192
|
+
return;
|
|
6193
|
+
if (this.highlightedYear())
|
|
6194
|
+
this.triggerHighlightYear.emit(null);
|
|
6195
|
+
}
|
|
6196
|
+
ngAfterViewInit() {
|
|
6197
|
+
if (!this.autoFocus())
|
|
6198
|
+
return;
|
|
6199
|
+
this.focus();
|
|
6200
|
+
this.triggerHighlightYear.emit(this.currentYearRangeStart());
|
|
6201
|
+
}
|
|
6202
|
+
onCalendarYearMouseover(year) {
|
|
6203
|
+
if (this._isUsingKeyboard() || this.disabled() || this.readOnly())
|
|
6204
|
+
return;
|
|
6205
|
+
this.triggerHighlightYear.emit(year);
|
|
6206
|
+
}
|
|
6207
|
+
onCalendarYearClick(year) {
|
|
6208
|
+
if (this.disabled() || this.readOnly())
|
|
6209
|
+
return;
|
|
6210
|
+
this.triggerSelectYear.emit(year);
|
|
6211
|
+
}
|
|
6212
|
+
onYearGridFocus() {
|
|
6213
|
+
if (this.disabled() || this.readOnly())
|
|
6214
|
+
return;
|
|
6215
|
+
this.triggerHighlightFirstYear.emit();
|
|
6216
|
+
}
|
|
6217
|
+
onYearGridBlur() {
|
|
6218
|
+
if (this.disabled() || this.readOnly())
|
|
6219
|
+
return;
|
|
6220
|
+
this.triggerHighlightYear.emit(null);
|
|
6221
|
+
}
|
|
6222
|
+
onYearGridClick() {
|
|
6223
|
+
if (this.disabled() || this.readOnly())
|
|
6224
|
+
return;
|
|
6225
|
+
if (this.highlightedYear() !== null)
|
|
6226
|
+
return;
|
|
6227
|
+
this.triggerHighlightFirstYear.emit();
|
|
6228
|
+
}
|
|
6229
|
+
//! helpers
|
|
6230
|
+
isYearToday(year) {
|
|
6231
|
+
return year === TODAY$1.getFullYear();
|
|
6232
|
+
}
|
|
6233
|
+
isYearSelected(year) {
|
|
6234
|
+
if (year instanceof Date)
|
|
6235
|
+
year = year.getFullYear();
|
|
6236
|
+
return this.selectedDate() !== null && year === this.selectedDate()?.getFullYear();
|
|
6237
|
+
}
|
|
6238
|
+
isYearOutOfRange(year) {
|
|
6239
|
+
return isYearOutOfRange(year, this.min(), this.max());
|
|
6240
|
+
}
|
|
6241
|
+
focus() {
|
|
6242
|
+
this.focusableElement().nativeElement.focus();
|
|
6243
|
+
}
|
|
6244
|
+
//! keyboard controls
|
|
6245
|
+
onMainGridKeydown(event) {
|
|
6246
|
+
if (this.disabled() || this.readOnly())
|
|
6247
|
+
return;
|
|
6248
|
+
switch (event.code) {
|
|
6249
|
+
case 'Space':
|
|
6250
|
+
case 'Enter':
|
|
6251
|
+
this._onEnterPress(event);
|
|
6252
|
+
break;
|
|
6253
|
+
case 'ArrowUp':
|
|
6254
|
+
this._onArrowUpPress(event);
|
|
6255
|
+
break;
|
|
6256
|
+
case 'ArrowDown':
|
|
6257
|
+
this._onArrowDownPress(event);
|
|
6258
|
+
break;
|
|
6259
|
+
case 'ArrowLeft':
|
|
6260
|
+
this._onArrowLeftPress(event);
|
|
6261
|
+
break;
|
|
6262
|
+
case 'ArrowRight':
|
|
6263
|
+
this._onArrowRightPress(event);
|
|
6264
|
+
break;
|
|
6265
|
+
case 'Home':
|
|
6266
|
+
this._onHomePress(event);
|
|
6267
|
+
break;
|
|
6268
|
+
case 'End':
|
|
6269
|
+
this._onEndPress(event);
|
|
6270
|
+
break;
|
|
6271
|
+
case 'PageUp':
|
|
6272
|
+
this._onPageUpPress(event);
|
|
6273
|
+
break;
|
|
6274
|
+
case 'PageDown':
|
|
6275
|
+
this._onPageDownPress(event);
|
|
6276
|
+
break;
|
|
6277
|
+
default:
|
|
6278
|
+
return;
|
|
6279
|
+
}
|
|
6280
|
+
}
|
|
6281
|
+
//select currently selected entry
|
|
6282
|
+
_onEnterPress(event) {
|
|
6283
|
+
event.preventDefault();
|
|
6284
|
+
const year = this.highlightedYear();
|
|
6285
|
+
if (isNull(year))
|
|
6286
|
+
return;
|
|
6287
|
+
this.triggerSelectYear.emit(year);
|
|
6288
|
+
}
|
|
6289
|
+
//highlight the entry one line below
|
|
6290
|
+
_onArrowDownPress(event) {
|
|
6291
|
+
event.preventDefault();
|
|
6292
|
+
this.triggerHighlightNextYear.emit(4); //4 years per line
|
|
6293
|
+
}
|
|
6294
|
+
//highlight the entry one line above
|
|
6295
|
+
_onArrowUpPress(event) {
|
|
6296
|
+
event.preventDefault();
|
|
6297
|
+
this.triggerHighlightPreviousYear.emit(4); //4 years per line
|
|
6298
|
+
}
|
|
6299
|
+
//highlight next entry
|
|
6300
|
+
_onArrowRightPress(event) {
|
|
6301
|
+
event.preventDefault();
|
|
6302
|
+
this.triggerHighlightNextYear.emit(1);
|
|
6303
|
+
}
|
|
6304
|
+
//highlight previous entry
|
|
6305
|
+
_onArrowLeftPress(event) {
|
|
6306
|
+
event.preventDefault();
|
|
6307
|
+
this.triggerHighlightPreviousYear.emit(1);
|
|
6308
|
+
}
|
|
6309
|
+
//highlight first entry on the page
|
|
6310
|
+
_onHomePress(event) {
|
|
6311
|
+
event.preventDefault();
|
|
6312
|
+
this.triggerHighlightFirstYear.emit();
|
|
6313
|
+
}
|
|
6314
|
+
//highlight last entry on the page
|
|
6315
|
+
_onEndPress(event) {
|
|
6316
|
+
event.preventDefault();
|
|
6317
|
+
this.triggerHighlightLastYear.emit();
|
|
6318
|
+
}
|
|
6319
|
+
//alone: highlight same entry on the previous page
|
|
6320
|
+
//with alt: highlight same entry multiple pages before
|
|
6321
|
+
_onPageUpPress(event) {
|
|
6322
|
+
event.preventDefault();
|
|
6323
|
+
this.triggerHighlightSameYearPreviousPage.emit(event.altKey);
|
|
6324
|
+
}
|
|
6325
|
+
//alone: highlight same entry on the next page
|
|
6326
|
+
//with alt: highlight same entry multiple pages after
|
|
6327
|
+
_onPageDownPress(event) {
|
|
6328
|
+
event.preventDefault();
|
|
6329
|
+
this.triggerHighlightSameYearNextPage.emit(event.altKey);
|
|
6330
|
+
}
|
|
6331
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: YearsViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6332
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: YearsViewComponent, selector: "ard-years-view", inputs: { tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: true, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: true, transformFunction: null }, _isUsingKeyboard: { classPropertyName: "_isUsingKeyboard", publicName: "_isUsingKeyboard", isSignal: true, isRequired: true, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, currentYearRangeStart: { classPropertyName: "currentYearRangeStart", publicName: "currentYearRangeStart", isSignal: true, isRequired: true, transformFunction: null }, highlightedYear: { classPropertyName: "highlightedYear", publicName: "highlightedYear", isSignal: true, isRequired: true, transformFunction: null }, yearsViewHeaderTemplate: { classPropertyName: "yearsViewHeaderTemplate", publicName: "yearsViewHeaderTemplate", isSignal: true, isRequired: true, transformFunction: null }, yearTemplate: { classPropertyName: "yearTemplate", publicName: "yearTemplate", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { triggerOpenMonthsView: "triggerOpenMonthsView", triggerOpenDaysView: "triggerOpenDaysView", focusEvent: "focus", blurEvent: "blur", triggerSelectYear: "triggerSelectYear", triggerChangeYearsViewPage: "triggerChangeYearsViewPage", triggerHighlightYear: "triggerHighlightYear", triggerHighlightNextYear: "triggerHighlightNextYear", triggerHighlightPreviousYear: "triggerHighlightPreviousYear", triggerHighlightFirstYear: "triggerHighlightFirstYear", triggerHighlightLastYear: "triggerHighlightLastYear", triggerHighlightSameYearPreviousPage: "triggerHighlightSameYearPreviousPage", triggerHighlightSameYearNextPage: "triggerHighlightSameYearNextPage" }, host: { listeners: { "mousemove": "onMouseMove()" } }, viewQueries: [{ propertyName: "focusableElement", first: true, predicate: ["focusableElement"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ard-years-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultYearsViewHeaderTemplate\r\n let-dateRange=\"dateRange\"\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-openDaysView=\"openDaysView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n variant=\"pill\"\r\n >\r\n {{ dateRange.low | date : 'YYYY' }}\r\n —\r\n {{ dateRange.high | date : 'YYYY' }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div class=\"ard-calendar-arrows\">\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearsViewHeaderTemplate() || defaultYearsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"yearsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onYearGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onYearGridBlur()\"\r\n (click)=\"onYearGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (year of yearsArray(); track year) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedYear() === year.value\"\r\n [class.ard-calendar__entry-disabled]=\"year.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isYearSelected(year.value)\"\r\n [class.ard-calendar-today]=\"isYearToday(year.value)\"\r\n (click)=\"onCalendarYearClick(year.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarYearMouseover(year.value)\"\r\n role=\"gridcell\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"ard-calendar__entry-button\"\r\n tabindex=\"-1\"\r\n aria-hidden=\"true\"\r\n >\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultYearTemplate\r\n let-year\r\n >\r\n {{ year | date : 'YYYY' }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearTemplate() || defaultYearTemplate\"\r\n [ngTemplateOutletContext]=\"yearContext()(year.value)\"\r\n />\r\n </div>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "color", "lightColoring", "compact"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }, { kind: "component", type: ArdiumButtonComponent, selector: "ard-button", inputs: ["icon", "variant", "alignIcon", "vertical"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6333
|
+
}
|
|
6334
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: YearsViewComponent, decorators: [{
|
|
6335
|
+
type: Component,
|
|
6336
|
+
args: [{ selector: 'ard-years-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ard-years-view\">\r\n @if (!readOnly()) {\r\n <div class=\"ard-calendar__top-toolbar\">\r\n <ng-template\r\n #defaultYearsViewHeaderTemplate\r\n let-dateRange=\"dateRange\"\r\n let-nextPage=\"nextPage\"\r\n let-prevPage=\"prevPage\"\r\n let-canGoToNextPage=\"canGoToNextPage\"\r\n let-canGoToPreviousPage=\"canGoToPreviousPage\"\r\n let-openDaysView=\"openDaysView\"\r\n >\r\n <div class=\"ard-calendar__calendar-header\">\r\n <ard-button\r\n class=\"ard-calendar__header-button\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n [tabIndex]=\"tabIndex()\"\r\n (click)=\"openDaysView()\"\r\n variant=\"pill\"\r\n >\r\n {{ dateRange.low | date : 'YYYY' }}\r\n —\r\n {{ dateRange.high | date : 'YYYY' }}\r\n <div class=\"ard-dropdown-arrow\"></div>\r\n </ard-button>\r\n <div class=\"ard-calendar-arrows\">\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"prevPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToPreviousPage\"\r\n >\r\n <ard-icon>chevron_left</ard-icon>\r\n </ard-icon-button>\r\n <ard-icon-button\r\n size=\"small\"\r\n appearance=\"transparent\"\r\n color=\"none\"\r\n (click)=\"nextPage()\"\r\n [tabIndex]=\"tabIndex()\"\r\n [disabled]=\"!canGoToNextPage\"\r\n >\r\n <ard-icon>chevron_right</ard-icon>\r\n </ard-icon-button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearsViewHeaderTemplate() || defaultYearsViewHeaderTemplate\"\r\n [ngTemplateOutletContext]=\"yearsViewHeaderContext()\"\r\n />\r\n </div>\r\n }\r\n <div\r\n #focusableElement\r\n class=\"ard-calendar__simple-grid\"\r\n [tabindex]=\"tabIndex()\"\r\n [ariaLabel]=\"currentAriaLabel()\"\r\n (focus)=\"focusEvent.emit($event)\"\r\n (focus)=\"onYearGridFocus()\"\r\n (blur)=\"blurEvent.emit($event)\"\r\n (blur)=\"onYearGridBlur()\"\r\n (click)=\"onYearGridClick()\"\r\n (keydown)=\"onMainGridKeydown($event)\"\r\n role=\"grid\"\r\n >\r\n @for (year of yearsArray(); track year) {\r\n <div\r\n class=\"ard-calendar__entry\"\r\n [class.ard-calendar__entry-highlighted]=\"highlightedYear() === year.value\"\r\n [class.ard-calendar__entry-disabled]=\"year.disabled\"\r\n [class.ard-calendar__entry-selected]=\"isYearSelected(year.value)\"\r\n [class.ard-calendar-today]=\"isYearToday(year.value)\"\r\n (click)=\"onCalendarYearClick(year.value)\"\r\n (mousemove)=\"$event.stopPropagation()\"\r\n (mouseover)=\"onCalendarYearMouseover(year.value)\"\r\n role=\"gridcell\"\r\n >\r\n <button\r\n type=\"button\"\r\n class=\"ard-calendar__entry-button\"\r\n tabindex=\"-1\"\r\n aria-hidden=\"true\"\r\n >\r\n <div class=\"ard-focus-overlay\"></div>\r\n <div class=\"ard-button-content\">\r\n <ng-template\r\n #defaultYearTemplate\r\n let-year\r\n >\r\n {{ year | date : 'YYYY' }}\r\n </ng-template>\r\n <ng-template\r\n [ngTemplateOutlet]=\"yearTemplate() || defaultYearTemplate\"\r\n [ngTemplateOutletContext]=\"yearContext()(year.value)\"\r\n />\r\n </div>\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n" }]
|
|
6337
|
+
}], propDecorators: { onMouseMove: [{
|
|
6338
|
+
type: HostListener,
|
|
6339
|
+
args: ['mousemove']
|
|
6340
|
+
}] } });
|
|
6341
|
+
|
|
6342
|
+
const TODAY = new Date();
|
|
6343
|
+
class ArdiumCalendarComponent extends _NgModelComponentBase {
|
|
6344
|
+
constructor(defaults) {
|
|
6345
|
+
super(defaults);
|
|
6346
|
+
//! appearance
|
|
6347
|
+
this.color = input(this._DEFAULTS.color);
|
|
6348
|
+
this.ngClasses = computed(() => [`ard-color-${this.color()}`].join(' '));
|
|
6349
|
+
//! active view
|
|
6350
|
+
this.activeView = model(this._DEFAULTS.activeView);
|
|
6351
|
+
this.activeYear = model(this._DEFAULTS.activeYear);
|
|
6352
|
+
this.activeMonth = model(this._DEFAULTS.activeMonth);
|
|
6353
|
+
this.firstWeekday = input(this._DEFAULTS.firstWeekday, {
|
|
6354
|
+
transform: v => {
|
|
6355
|
+
const value = coerceNumberProperty(v, this._DEFAULTS.firstWeekday);
|
|
6356
|
+
if (!Number.isInteger(value)) {
|
|
6357
|
+
console.error(new Error(`ARD-NF2001A: [firstWeekday] must be a positive integer, got "${value}". Using default value instead.`));
|
|
6358
|
+
return 1;
|
|
6359
|
+
}
|
|
6360
|
+
if (value < 0 || value > 6) {
|
|
6361
|
+
console.error(new Error(`ARD-NF2001B: [firstWeekday] must be between 0 and 6, got "${value}". Using modulo operator to adjust the value.`));
|
|
6362
|
+
}
|
|
6363
|
+
return value % 7;
|
|
6364
|
+
},
|
|
6365
|
+
});
|
|
6366
|
+
this.multipleYearPageChangeModifier = input(this._DEFAULTS.multipleYearPageChangeModifier, {
|
|
6367
|
+
transform: v => {
|
|
6368
|
+
const value = coerceNumberProperty(v, this._DEFAULTS.multipleYearPageChangeModifier);
|
|
6369
|
+
if (!Number.isInteger(value) || value < 1) {
|
|
6370
|
+
console.error(new Error(`ARD-NF2002: [multipleYearPageChangeModifier] must be a positive integer, got "${value}". Using default value instead.`));
|
|
6371
|
+
return 5;
|
|
6372
|
+
}
|
|
6373
|
+
return value;
|
|
6374
|
+
},
|
|
6375
|
+
});
|
|
6376
|
+
this.autoFocus = input(this._DEFAULTS.autoFocus, { transform: v => coerceBooleanProperty(v) });
|
|
6377
|
+
//! value
|
|
6378
|
+
this.selectedDate = model(null, { alias: 'selected' });
|
|
6379
|
+
this.yearSelect = output();
|
|
6380
|
+
this.monthSelect = output();
|
|
6381
|
+
this.min = input(this._DEFAULTS.min, { transform: v => coerceDateProperty(v, this._DEFAULTS.min) });
|
|
6382
|
+
this.max = input(this._DEFAULTS.max, { transform: v => coerceDateProperty(v, this._DEFAULTS.max) });
|
|
6383
|
+
this.filter = input(this._DEFAULTS.filter);
|
|
6384
|
+
this.isDayFilteredOut = computed(() => {
|
|
6385
|
+
return (day, month = this.activeMonth(), year = this.activeYear()) => {
|
|
6386
|
+
const filter = this.filter();
|
|
6387
|
+
return filter?.(new Date(year, month, day)) ?? false;
|
|
6388
|
+
};
|
|
6389
|
+
});
|
|
6390
|
+
//! highlighting days
|
|
6391
|
+
this.__highlightedDay = signal(null);
|
|
6392
|
+
this.highlightedDay = this.__highlightedDay.asReadonly();
|
|
6393
|
+
//! highlighting months
|
|
6394
|
+
this.__highlightedMonth = signal(null);
|
|
6395
|
+
this.highlightedMonth = this.__highlightedMonth.asReadonly();
|
|
6396
|
+
//! highlighting years
|
|
6397
|
+
this.__highlightedYear = signal(null);
|
|
6398
|
+
this.highlightedYear = this.__highlightedYear.asReadonly();
|
|
6399
|
+
this.currentYearRangeStart = signal(TODAY.getFullYear() - (TODAY.getFullYear() % 4) - 8); // current year always in 3rd row
|
|
6400
|
+
//! internals
|
|
6401
|
+
this._isUsingKeyboard = signal(false);
|
|
6402
|
+
//! templates
|
|
6403
|
+
this.yearsViewHeaderTemplate = contentChild(TemplateRef);
|
|
6404
|
+
this.monthsViewHeaderTemplate = contentChild(TemplateRef);
|
|
6405
|
+
this.daysViewHeaderTemplate = contentChild(TemplateRef);
|
|
6406
|
+
this.floatingMonthTemplate = contentChild(TemplateRef);
|
|
6407
|
+
this.yearTemplate = contentChild(TemplateRef);
|
|
6408
|
+
this.monthTemplate = contentChild(TemplateRef);
|
|
6409
|
+
this.dayTemplate = contentChild(TemplateRef);
|
|
6410
|
+
this.weekdayTemplate = contentChild(TemplateRef);
|
|
6411
|
+
effect(() => {
|
|
6412
|
+
this.selectedDate(); // trigger effect
|
|
6413
|
+
this._emitChange();
|
|
6414
|
+
});
|
|
6415
|
+
}
|
|
6416
|
+
onTriggerOpenDaysView() {
|
|
6417
|
+
this.activeView.set(ArdCalendarView.Days);
|
|
6418
|
+
}
|
|
6419
|
+
onTriggerOpenMonthsView() {
|
|
6420
|
+
this.activeView.set(ArdCalendarView.Months);
|
|
6421
|
+
}
|
|
6422
|
+
onTriggerOpenYearsView() {
|
|
6423
|
+
this.activeView.set(ArdCalendarView.Years);
|
|
6424
|
+
}
|
|
6425
|
+
writeValue(v) {
|
|
6426
|
+
if (v instanceof Date) {
|
|
6427
|
+
this.selectedDate.set(v);
|
|
6428
|
+
}
|
|
6429
|
+
else if (!isDefined(v)) {
|
|
6430
|
+
this.selectedDate.set(null);
|
|
6431
|
+
}
|
|
6432
|
+
else {
|
|
6433
|
+
console.error(new Error(`ARD-NF2003: <ard-calendar> [writeValue] expected a Date or null, got "${v}".`));
|
|
6434
|
+
}
|
|
6435
|
+
}
|
|
6436
|
+
_emitChange() {
|
|
6437
|
+
this._onChangeRegistered?.(this.selectedDate());
|
|
6438
|
+
}
|
|
6439
|
+
//! selecting days
|
|
6440
|
+
isDaySelected(day) {
|
|
6441
|
+
if (day instanceof Date)
|
|
6442
|
+
day = day.getDate();
|
|
6443
|
+
return (this.selectedDate() !== null &&
|
|
6444
|
+
this.activeYear() === this.selectedDate()?.getFullYear() &&
|
|
6445
|
+
this.activeMonth() === this.selectedDate()?.getMonth() &&
|
|
6446
|
+
day === this.selectedDate()?.getDate());
|
|
6447
|
+
}
|
|
6448
|
+
isDayOutOfRange(day, month = this.activeMonth(), year = this.activeYear()) {
|
|
6449
|
+
return isDayOutOfRange(day, month, year, this.min(), this.max());
|
|
6450
|
+
}
|
|
6451
|
+
selectDay(day) {
|
|
6452
|
+
if (this.isDaySelected(day))
|
|
6453
|
+
return;
|
|
6454
|
+
if (isNull(day)) {
|
|
6455
|
+
if (!isDefined(this.selectedDate()))
|
|
6456
|
+
return;
|
|
6457
|
+
this.selectedDate.set(null);
|
|
6458
|
+
return;
|
|
6459
|
+
}
|
|
6460
|
+
if (day instanceof Date)
|
|
6461
|
+
day = day.getDate();
|
|
6462
|
+
if (day && this.isDayOutOfRange(day) || this.isDayFilteredOut()(day))
|
|
6463
|
+
return;
|
|
6464
|
+
this.selectedDate.set(new Date(this.activeYear(), this.activeMonth(), day, 0, 0, 0, 0));
|
|
6465
|
+
}
|
|
6466
|
+
selectCurrentlyHighlightedDay() {
|
|
6467
|
+
if (!isDefined(this.highlightedDay()))
|
|
6468
|
+
return;
|
|
6469
|
+
this.selectDay(this.highlightedDay());
|
|
6470
|
+
}
|
|
6471
|
+
setHighlightedDay(day, month = this.activeMonth(), year = this.activeYear()) {
|
|
6472
|
+
if (isNull(day)) {
|
|
6473
|
+
this.__highlightedDay.update(() => day);
|
|
6474
|
+
return;
|
|
6475
|
+
}
|
|
6476
|
+
const date = new Date(year, month, day);
|
|
6477
|
+
const outOfRange = this.isDayOutOfRange(day, month, year);
|
|
6478
|
+
if (outOfRange === -1) {
|
|
6479
|
+
this._highlightMinDay();
|
|
6480
|
+
return;
|
|
6481
|
+
}
|
|
6482
|
+
if (outOfRange === 1) {
|
|
6483
|
+
this._highlightMaxDay();
|
|
6484
|
+
return;
|
|
6485
|
+
}
|
|
6486
|
+
this.__highlightedDay.update(() => date.getDate());
|
|
6487
|
+
if (date.getFullYear() !== this.activeYear()) {
|
|
6488
|
+
this.activeYear.set(date.getFullYear());
|
|
6489
|
+
}
|
|
6490
|
+
if (date.getMonth() !== this.activeMonth()) {
|
|
6491
|
+
this.activeMonth.set(date.getMonth());
|
|
6492
|
+
}
|
|
6493
|
+
}
|
|
6494
|
+
_highlightMinDay() {
|
|
6495
|
+
const min = this.min();
|
|
6496
|
+
if (!isDefined(min))
|
|
6497
|
+
return;
|
|
6498
|
+
this.activeYear.set(min.getFullYear());
|
|
6499
|
+
this.activeMonth.set(min.getMonth());
|
|
6500
|
+
this.__highlightedDay.set(min.getDate());
|
|
6501
|
+
}
|
|
6502
|
+
_highlightMaxDay() {
|
|
6503
|
+
const max = this.max();
|
|
6504
|
+
if (!isDefined(max))
|
|
6505
|
+
return;
|
|
6506
|
+
this.activeYear.set(max.getFullYear());
|
|
6507
|
+
this.activeMonth.set(max.getMonth());
|
|
6508
|
+
this.__highlightedDay.set(max.getDate());
|
|
6509
|
+
}
|
|
6510
|
+
highlightNextDay(offset = 1) {
|
|
6511
|
+
const currentDay = this.highlightedDay();
|
|
6512
|
+
const newDay = isDefined(currentDay) ? currentDay + offset : 1;
|
|
6513
|
+
this.setHighlightedDay(newDay);
|
|
6514
|
+
}
|
|
6515
|
+
highlightPreviousDay(offset = 1) {
|
|
6516
|
+
this.highlightNextDay(offset * -1);
|
|
6517
|
+
}
|
|
6518
|
+
highlightFirstDay() {
|
|
6519
|
+
this.setHighlightedDay(1);
|
|
6520
|
+
}
|
|
6521
|
+
highlightLastDay() {
|
|
6522
|
+
const daysInMonth = new Date(this.activeYear(), this.activeMonth() + 1, 0).getDate();
|
|
6523
|
+
this.setHighlightedDay(daysInMonth);
|
|
6524
|
+
}
|
|
6525
|
+
highlightSameDayNextMonth() {
|
|
6526
|
+
const month = this.activeMonth();
|
|
6527
|
+
const year = this.activeYear();
|
|
6528
|
+
const newMonth = month + 1;
|
|
6529
|
+
const newYear = year + Math.floor(newMonth / 12);
|
|
6530
|
+
this.setHighlightedDay(this.highlightedDay(), newMonth % 12, newYear);
|
|
6531
|
+
}
|
|
6532
|
+
highlightSameDayPreviousMonth() {
|
|
6533
|
+
const month = this.activeMonth();
|
|
6534
|
+
const year = this.activeYear();
|
|
6535
|
+
const newMonth = month - 1;
|
|
6536
|
+
const newYear = year + Math.floor(newMonth / 12);
|
|
6537
|
+
this.setHighlightedDay(this.highlightedDay(), newMonth % 12, newYear);
|
|
6538
|
+
}
|
|
6539
|
+
highlightSameDayNextYear() {
|
|
6540
|
+
this.setHighlightedDay(this.highlightedDay(), this.activeMonth(), this.activeYear() + 1);
|
|
6541
|
+
}
|
|
6542
|
+
highlightSameDayPreviousYear() {
|
|
6543
|
+
this.setHighlightedDay(this.highlightedDay(), this.activeMonth(), this.activeYear() - 1);
|
|
6544
|
+
}
|
|
6545
|
+
//! selecting months
|
|
6546
|
+
isMonthSelected(month) {
|
|
6547
|
+
if (month instanceof Date)
|
|
6548
|
+
month = month.getMonth();
|
|
6549
|
+
return (this.selectedDate() !== null &&
|
|
6550
|
+
this.activeYear() === this.selectedDate()?.getFullYear() &&
|
|
6551
|
+
month === this.selectedDate()?.getMonth());
|
|
6552
|
+
}
|
|
6553
|
+
isMonthOutOfRange(month, year = this.activeYear()) {
|
|
6554
|
+
return isMonthOutOfRange(month, year, this.min(), this.max());
|
|
6555
|
+
}
|
|
6556
|
+
changeMonth(newMonth) {
|
|
6557
|
+
if (isNull(newMonth)) {
|
|
6558
|
+
this.activeMonth.set(TODAY.getMonth());
|
|
6559
|
+
return true;
|
|
6560
|
+
}
|
|
6561
|
+
if (this.isMonthOutOfRange(newMonth))
|
|
6562
|
+
return false;
|
|
6563
|
+
if (newMonth > 11) {
|
|
6564
|
+
this.activeMonth.set(0);
|
|
6565
|
+
this.activeYear.update(v => v + 1);
|
|
6566
|
+
}
|
|
6567
|
+
else if (newMonth < 0) {
|
|
6568
|
+
this.activeMonth.set(11);
|
|
6569
|
+
this.activeYear.update(v => v - 1);
|
|
6570
|
+
}
|
|
6571
|
+
else {
|
|
6572
|
+
this.activeMonth.set(newMonth);
|
|
6573
|
+
}
|
|
6574
|
+
return true;
|
|
6575
|
+
}
|
|
6576
|
+
selectMonth(newMonth) {
|
|
6577
|
+
if (isNull(newMonth) || this.isMonthOutOfRange(newMonth))
|
|
6578
|
+
return;
|
|
6579
|
+
const wasSuccessful = this.changeMonth(newMonth);
|
|
6580
|
+
if (!wasSuccessful)
|
|
6581
|
+
return;
|
|
6582
|
+
this.activeView.set(ArdCalendarView.Days);
|
|
6583
|
+
this.monthSelect.emit(newMonth);
|
|
6584
|
+
}
|
|
6585
|
+
selectCurrentlyHighlightedMonth() {
|
|
6586
|
+
if (!isDefined(this.highlightedMonth()))
|
|
6587
|
+
return;
|
|
6588
|
+
this.selectMonth(this.highlightedMonth());
|
|
6589
|
+
}
|
|
6590
|
+
setHighlightedMonth(month, year = this.activeYear()) {
|
|
6591
|
+
if (isNull(month)) {
|
|
6592
|
+
this.__highlightedMonth.update(() => month);
|
|
6593
|
+
return;
|
|
6594
|
+
}
|
|
6595
|
+
const date = new Date(year, month, 15);
|
|
6596
|
+
const outOfRange = this.isMonthOutOfRange(month, year);
|
|
6597
|
+
if (outOfRange === -1) {
|
|
6598
|
+
this._highlightMinMonth();
|
|
6599
|
+
return;
|
|
6600
|
+
}
|
|
6601
|
+
if (outOfRange === 1) {
|
|
6602
|
+
this._highlightMaxMonth();
|
|
6603
|
+
return;
|
|
6604
|
+
}
|
|
6605
|
+
this.__highlightedMonth.update(() => date.getMonth());
|
|
6606
|
+
if (date.getFullYear() !== this.activeYear()) {
|
|
6607
|
+
this.activeYear.set(date.getFullYear());
|
|
6608
|
+
}
|
|
6609
|
+
}
|
|
6610
|
+
_highlightMinMonth() {
|
|
6611
|
+
const min = this.min();
|
|
6612
|
+
if (!isDefined(min))
|
|
6613
|
+
return;
|
|
6614
|
+
this.activeYear.set(min.getFullYear());
|
|
6615
|
+
this.__highlightedMonth.set(min.getMonth());
|
|
6616
|
+
}
|
|
6617
|
+
_highlightMaxMonth() {
|
|
6618
|
+
const max = this.max();
|
|
6619
|
+
if (!isDefined(max))
|
|
6620
|
+
return;
|
|
6621
|
+
this.activeYear.set(max.getFullYear());
|
|
6622
|
+
this.__highlightedMonth.set(max.getMonth());
|
|
6623
|
+
}
|
|
6624
|
+
highlightNextMonth(offset = 1) {
|
|
6625
|
+
const currentMonth = this.highlightedMonth();
|
|
6626
|
+
const newMonth = isDefined(currentMonth) ? currentMonth + offset : 0;
|
|
6627
|
+
this.setHighlightedMonth(newMonth);
|
|
6628
|
+
}
|
|
6629
|
+
highlightPreviousMonth(offset = 1) {
|
|
6630
|
+
this.highlightNextMonth(offset * -1);
|
|
6631
|
+
}
|
|
6632
|
+
highlightFirstMonth() {
|
|
6633
|
+
this.setHighlightedMonth(0);
|
|
6634
|
+
}
|
|
6635
|
+
highlightLastMonth() {
|
|
6636
|
+
this.setHighlightedMonth(11);
|
|
6637
|
+
}
|
|
6638
|
+
highlightSameMonthNextYear(multiple) {
|
|
6639
|
+
this.setHighlightedMonth(this.highlightedMonth(), this.activeYear() + (multiple ? 10 : 1));
|
|
6640
|
+
}
|
|
6641
|
+
highlightSameMonthPreviousYear(multiple) {
|
|
6642
|
+
this.setHighlightedMonth(this.highlightedMonth(), this.activeYear() - (multiple ? 10 : 1));
|
|
6643
|
+
}
|
|
6644
|
+
//! selecting years
|
|
6645
|
+
isYearSelected(year) {
|
|
6646
|
+
if (year instanceof Date)
|
|
6647
|
+
year = year.getFullYear();
|
|
6648
|
+
return this.selectedDate() !== null && year === this.selectedDate()?.getFullYear();
|
|
6649
|
+
}
|
|
6650
|
+
isYearOutOfRange(year) {
|
|
6651
|
+
return isYearOutOfRange(year, this.min(), this.max());
|
|
6652
|
+
}
|
|
6653
|
+
changeYear(year) {
|
|
6654
|
+
if (isNull(year)) {
|
|
6655
|
+
this.activeYear.set(TODAY.getFullYear());
|
|
6656
|
+
return true;
|
|
6657
|
+
}
|
|
6658
|
+
if (this.isYearOutOfRange(year))
|
|
6659
|
+
return false;
|
|
6660
|
+
this.activeYear.set(year);
|
|
6661
|
+
return true;
|
|
6662
|
+
}
|
|
6663
|
+
selectYear(year) {
|
|
6664
|
+
if (isNull(year))
|
|
6665
|
+
return;
|
|
6666
|
+
if (year instanceof Date)
|
|
6667
|
+
year = year.getFullYear();
|
|
6668
|
+
const wasSuccessful = this.changeYear(year);
|
|
6669
|
+
if (!wasSuccessful)
|
|
6670
|
+
return;
|
|
6671
|
+
this.activeView.set(ArdCalendarView.Months);
|
|
6672
|
+
this.yearSelect.emit(year);
|
|
6673
|
+
}
|
|
6674
|
+
selectCurrentlyHighlightedYear() {
|
|
6675
|
+
if (!isDefined(this.highlightedYear()))
|
|
6676
|
+
return;
|
|
6677
|
+
this.selectYear(this.highlightedYear());
|
|
6678
|
+
}
|
|
6679
|
+
setHighlightedYear(year) {
|
|
6680
|
+
if (isNull(year)) {
|
|
6681
|
+
this.__highlightedYear.update(() => year);
|
|
6682
|
+
return;
|
|
6683
|
+
}
|
|
6684
|
+
const date = new Date(year, 0);
|
|
6685
|
+
const outOfRange = this.isYearOutOfRange(year);
|
|
6686
|
+
if (outOfRange === -1) {
|
|
6687
|
+
this._highlightMinYear();
|
|
6688
|
+
return;
|
|
6689
|
+
}
|
|
6690
|
+
if (outOfRange === 1) {
|
|
6691
|
+
this._highlightMaxYear();
|
|
6692
|
+
return;
|
|
6693
|
+
}
|
|
6694
|
+
const newYear = date.getFullYear();
|
|
6695
|
+
this.__highlightedYear.update(() => newYear);
|
|
6696
|
+
if (newYear < this.currentYearRangeStart() || newYear >= this.currentYearRangeStart() + 24) {
|
|
6697
|
+
// round the offset away from zero: 0.1 -> 1, -0.1 -> -1
|
|
6698
|
+
// this is to ensure the range start is always shifted by 24 years
|
|
6699
|
+
const offset = roundFromZero((newYear - this.currentYearRangeStart()) / 24);
|
|
6700
|
+
this.currentYearRangeStart.update(v => v + offset * 24);
|
|
6701
|
+
}
|
|
6702
|
+
}
|
|
6703
|
+
changeYearsViewPage(offset) {
|
|
6704
|
+
const newYearRangeStart = this.currentYearRangeStart() + offset * 24;
|
|
6705
|
+
this.currentYearRangeStart.set(newYearRangeStart);
|
|
6706
|
+
}
|
|
6707
|
+
_highlightMinYear() {
|
|
6708
|
+
const min = this.min();
|
|
6709
|
+
if (!isDefined(min))
|
|
6710
|
+
return;
|
|
6711
|
+
this.__highlightedYear.set(min.getFullYear());
|
|
6712
|
+
}
|
|
6713
|
+
_highlightMaxYear() {
|
|
6714
|
+
const max = this.max();
|
|
6715
|
+
if (!isDefined(max))
|
|
6716
|
+
return;
|
|
6717
|
+
this.__highlightedYear.set(max.getFullYear());
|
|
6718
|
+
}
|
|
6719
|
+
highlightNextYear(offset = 1) {
|
|
6720
|
+
const currentYear = this.highlightedYear();
|
|
6721
|
+
const newYear = isDefined(currentYear) ? currentYear + offset : null;
|
|
6722
|
+
this.setHighlightedYear(newYear);
|
|
6723
|
+
}
|
|
6724
|
+
highlightPreviousYear(offset = 1) {
|
|
6725
|
+
this.highlightNextYear(offset * -1);
|
|
6726
|
+
}
|
|
6727
|
+
highlightFirstYear() {
|
|
6728
|
+
this.setHighlightedYear(this.currentYearRangeStart());
|
|
6729
|
+
}
|
|
6730
|
+
highlightLastYear() {
|
|
6731
|
+
this.setHighlightedYear(this.currentYearRangeStart() + 23); // 24 years per page
|
|
6732
|
+
}
|
|
6733
|
+
highlightSameYearNextPage(multiple) {
|
|
6734
|
+
const year = this.highlightedYear() ?? this.currentYearRangeStart();
|
|
6735
|
+
this.setHighlightedYear(year + (multiple ? 60 : 24));
|
|
6736
|
+
}
|
|
6737
|
+
highlightSameYearPreviousPage(multiple) {
|
|
6738
|
+
const year = this.highlightedYear() ?? this.currentYearRangeStart();
|
|
6739
|
+
this.setHighlightedYear(year - (multiple ? 60 : 24));
|
|
6740
|
+
}
|
|
6741
|
+
onDocumentMousemove() {
|
|
6742
|
+
this._isUsingKeyboard.set(false);
|
|
6743
|
+
}
|
|
6744
|
+
onDocumentKeydown() {
|
|
6745
|
+
this._isUsingKeyboard.set(true);
|
|
6746
|
+
}
|
|
6747
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumCalendarComponent, deps: [{ token: ARD_CALENDAR_DEFAULTS }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6748
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ArdiumCalendarComponent, selector: "ard-calendar", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, activeView: { classPropertyName: "activeView", publicName: "activeView", isSignal: true, isRequired: false, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: false, transformFunction: null }, activeMonth: { classPropertyName: "activeMonth", publicName: "activeMonth", isSignal: true, isRequired: false, transformFunction: null }, firstWeekday: { classPropertyName: "firstWeekday", publicName: "firstWeekday", isSignal: true, isRequired: false, transformFunction: null }, multipleYearPageChangeModifier: { classPropertyName: "multipleYearPageChangeModifier", publicName: "multipleYearPageChangeModifier", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activeView: "activeViewChange", activeYear: "activeYearChange", activeMonth: "activeMonthChange", selectedDate: "selectedChange", yearSelect: "yearSelect", monthSelect: "monthSelect" }, host: { listeners: { "document:mousemove": "onDocumentMousemove()", "document:keydown": "onDocumentKeydown()" } }, queries: [{ propertyName: "yearsViewHeaderTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "monthsViewHeaderTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "daysViewHeaderTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "floatingMonthTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "yearTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "monthTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "dayTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "weekdayTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"ard-calendar\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @switch (activeView()) { @case ('days') {\r\n <ard-days-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectedDate()\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [highlightedDay]=\"highlightedDay()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [isDayFilteredOut]=\"isDayFilteredOut()\"\r\n [daysViewHeaderTemplate]=\"daysViewHeaderTemplate()\"\r\n [floatingMonthTemplate]=\"floatingMonthTemplate()\"\r\n [weekdayTemplate]=\"weekdayTemplate()\"\r\n [dayTemplate]=\"dayTemplate()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggerChangeMonth)=\"changeMonth($event)\"\r\n (triggerChangeYear)=\"changeYear($event)\"\r\n (triggerHighlightDay)=\"setHighlightedDay($event)\"\r\n (triggerHighlightFirstDay)=\"highlightFirstDay()\"\r\n (triggerHighlightLastDay)=\"highlightLastDay()\"\r\n (triggerHighlightNextDay)=\"highlightNextDay($event)\"\r\n (triggerHighlightPreviousDay)=\"highlightPreviousDay($event)\"\r\n (triggerHighlightSameDayNextPage)=\"$event ? highlightSameDayNextYear() : highlightSameDayNextMonth()\"\r\n (triggerHighlightSameDayPreviousPage)=\"$event ? highlightSameDayPreviousYear() : highlightSameDayPreviousMonth()\"\r\n (triggerSelectDay)=\"selectDay($event)\"\r\n />\r\n } @case ('months') {\r\n <ard-months-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [color]=\"color()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectedDate()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [highlightedMonth]=\"highlightedMonth()\"\r\n [monthsViewHeaderTemplate]=\"monthsViewHeaderTemplate()\"\r\n [monthTemplate]=\"monthTemplate()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggeChangeYear)=\"changeYear($event)\"\r\n (triggerSelectMonth)=\"selectMonth($event)\"\r\n (triggerHighlightMonth)=\"setHighlightedMonth($event)\"\r\n (triggerHighlightFirstMonth)=\"highlightFirstMonth()\"\r\n (triggerHighlightLastMonth)=\"highlightLastMonth()\"\r\n (triggerHighlightNextMonth)=\"highlightNextMonth($event)\"\r\n (triggerHighlightPreviousMonth)=\"highlightPreviousMonth($event)\"\r\n (triggerHighlightSameMonthNextPage)=\"highlightSameMonthNextYear($event)\"\r\n (triggerHighlightSameMonthPreviousPage)=\"highlightSameMonthPreviousYear($event)\"\r\n />\r\n } @case ('years') {\r\n <ard-years-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [highlightedYear]=\"highlightedYear()\"\r\n [currentYearRangeStart]=\"currentYearRangeStart()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectedDate()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [yearsViewHeaderTemplate]=\"yearsViewHeaderTemplate()\"\r\n [yearTemplate]=\"yearTemplate()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerSelectYear)=\"selectYear($event)\"\r\n (triggerChangeYearsViewPage)=\"changeYearsViewPage($event)\"\r\n (triggerHighlightYear)=\"setHighlightedYear($event)\"\r\n (triggerHighlightFirstYear)=\"highlightFirstYear()\"\r\n (triggerHighlightLastYear)=\"highlightLastYear()\"\r\n (triggerHighlightNextYear)=\"highlightNextYear($event)\"\r\n (triggerHighlightPreviousYear)=\"highlightPreviousYear($event)\"\r\n (triggerHighlightSameYearNextPage)=\"highlightSameYearNextPage($event)\"\r\n (triggerHighlightSameYearPreviousPage)=\"highlightSameYearPreviousPage($event)\"\r\n />\r\n } }\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: DaysViewComponent, selector: "ard-days-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "activeYear", "activeMonth", "selectedDate", "min", "max", "isDayFilteredOut", "highlightedDay", "firstWeekday", "daysViewHeaderTemplate", "floatingMonthTemplate", "weekdayTemplate", "dayTemplate"], outputs: ["triggerOpenYearsView", "triggerOpenMonthsView", "triggerSelectDay", "triggerChangeMonth", "triggerChangeYear", "triggerHighlightDay", "triggerHighlightNextDay", "triggerHighlightPreviousDay", "triggerHighlightFirstDay", "triggerHighlightLastDay", "triggerHighlightSameDayPreviousPage", "triggerHighlightSameDayNextPage", "focus", "blur"] }, { kind: "component", type: MonthsViewComponent, selector: "ard-months-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "color", "activeYear", "activeMonth", "selectedDate", "min", "max", "highlightedMonth", "monthsViewHeaderTemplate", "monthTemplate"], outputs: ["triggerOpenYearsView", "triggerOpenDaysView", "focus", "blur", "triggerSelectMonth", "triggeChangeYear", "triggerHighlightMonth", "triggerHighlightNextMonth", "triggerHighlightPreviousMonth", "triggerHighlightFirstMonth", "triggerHighlightLastMonth", "triggerHighlightSameMonthPreviousPage", "triggerHighlightSameMonthNextPage"] }, { kind: "component", type: YearsViewComponent, selector: "ard-years-view", inputs: ["tabIndex", "readOnly", "disabled", "autoFocus", "_isUsingKeyboard", "activeYear", "selectedDate", "min", "max", "currentYearRangeStart", "highlightedYear", "yearsViewHeaderTemplate", "yearTemplate"], outputs: ["triggerOpenMonthsView", "triggerOpenDaysView", "focus", "blur", "triggerSelectYear", "triggerChangeYearsViewPage", "triggerHighlightYear", "triggerHighlightNextYear", "triggerHighlightPreviousYear", "triggerHighlightFirstYear", "triggerHighlightLastYear", "triggerHighlightSameYearPreviousPage", "triggerHighlightSameYearNextPage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
6749
|
+
}
|
|
6750
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumCalendarComponent, decorators: [{
|
|
6751
|
+
type: Component,
|
|
6752
|
+
args: [{ selector: 'ard-calendar', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"ard-calendar\"\r\n [ngClass]=\"ngClasses()\"\r\n>\r\n @switch (activeView()) { @case ('days') {\r\n <ard-days-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectedDate()\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [highlightedDay]=\"highlightedDay()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [isDayFilteredOut]=\"isDayFilteredOut()\"\r\n [daysViewHeaderTemplate]=\"daysViewHeaderTemplate()\"\r\n [floatingMonthTemplate]=\"floatingMonthTemplate()\"\r\n [weekdayTemplate]=\"weekdayTemplate()\"\r\n [dayTemplate]=\"dayTemplate()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggerChangeMonth)=\"changeMonth($event)\"\r\n (triggerChangeYear)=\"changeYear($event)\"\r\n (triggerHighlightDay)=\"setHighlightedDay($event)\"\r\n (triggerHighlightFirstDay)=\"highlightFirstDay()\"\r\n (triggerHighlightLastDay)=\"highlightLastDay()\"\r\n (triggerHighlightNextDay)=\"highlightNextDay($event)\"\r\n (triggerHighlightPreviousDay)=\"highlightPreviousDay($event)\"\r\n (triggerHighlightSameDayNextPage)=\"$event ? highlightSameDayNextYear() : highlightSameDayNextMonth()\"\r\n (triggerHighlightSameDayPreviousPage)=\"$event ? highlightSameDayPreviousYear() : highlightSameDayPreviousMonth()\"\r\n (triggerSelectDay)=\"selectDay($event)\"\r\n />\r\n } @case ('months') {\r\n <ard-months-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [color]=\"color()\"\r\n [activeMonth]=\"activeMonth()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectedDate()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [highlightedMonth]=\"highlightedMonth()\"\r\n [monthsViewHeaderTemplate]=\"monthsViewHeaderTemplate()\"\r\n [monthTemplate]=\"monthTemplate()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenYearsView)=\"onTriggerOpenYearsView()\"\r\n (triggeChangeYear)=\"changeYear($event)\"\r\n (triggerSelectMonth)=\"selectMonth($event)\"\r\n (triggerHighlightMonth)=\"setHighlightedMonth($event)\"\r\n (triggerHighlightFirstMonth)=\"highlightFirstMonth()\"\r\n (triggerHighlightLastMonth)=\"highlightLastMonth()\"\r\n (triggerHighlightNextMonth)=\"highlightNextMonth($event)\"\r\n (triggerHighlightPreviousMonth)=\"highlightPreviousMonth($event)\"\r\n (triggerHighlightSameMonthNextPage)=\"highlightSameMonthNextYear($event)\"\r\n (triggerHighlightSameMonthPreviousPage)=\"highlightSameMonthPreviousYear($event)\"\r\n />\r\n } @case ('years') {\r\n <ard-years-view\r\n [tabIndex]=\"tabIndex()\"\r\n [readOnly]=\"readonly()\"\r\n [disabled]=\"disabled()\"\r\n [autoFocus]=\"autoFocus()\"\r\n [_isUsingKeyboard]=\"_isUsingKeyboard()\"\r\n [highlightedYear]=\"highlightedYear()\"\r\n [currentYearRangeStart]=\"currentYearRangeStart()\"\r\n [activeYear]=\"activeYear()\"\r\n [selectedDate]=\"selectedDate()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [yearsViewHeaderTemplate]=\"yearsViewHeaderTemplate()\"\r\n [yearTemplate]=\"yearTemplate()\"\r\n (focus)=\"onFocus($event)\"\r\n (blur)=\"onBlur($event)\"\r\n (triggerOpenDaysView)=\"onTriggerOpenDaysView()\"\r\n (triggerOpenMonthsView)=\"onTriggerOpenMonthsView()\"\r\n (triggerSelectYear)=\"selectYear($event)\"\r\n (triggerChangeYearsViewPage)=\"changeYearsViewPage($event)\"\r\n (triggerHighlightYear)=\"setHighlightedYear($event)\"\r\n (triggerHighlightFirstYear)=\"highlightFirstYear()\"\r\n (triggerHighlightLastYear)=\"highlightLastYear()\"\r\n (triggerHighlightNextYear)=\"highlightNextYear($event)\"\r\n (triggerHighlightPreviousYear)=\"highlightPreviousYear($event)\"\r\n (triggerHighlightSameYearNextPage)=\"highlightSameYearNextPage($event)\"\r\n (triggerHighlightSameYearPreviousPage)=\"highlightSameYearPreviousPage($event)\"\r\n />\r\n } }\r\n</div>\r\n" }]
|
|
6753
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
6754
|
+
type: Inject,
|
|
6755
|
+
args: [ARD_CALENDAR_DEFAULTS]
|
|
6756
|
+
}] }], propDecorators: { onDocumentMousemove: [{
|
|
6757
|
+
type: HostListener,
|
|
6758
|
+
args: ['document:mousemove']
|
|
6759
|
+
}], onDocumentKeydown: [{
|
|
6760
|
+
type: HostListener,
|
|
6761
|
+
args: ['document:keydown']
|
|
6762
|
+
}] } });
|
|
6763
|
+
|
|
6764
|
+
class ArdiumDateInputComponent extends _FormFieldComponentBase {
|
|
6765
|
+
constructor(defaults) {
|
|
6766
|
+
super(defaults);
|
|
6767
|
+
this.elementRef = inject((ElementRef));
|
|
6768
|
+
this.overlay = inject(Overlay);
|
|
6769
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
6770
|
+
this.scrollStrategyOpts = inject(ScrollStrategyOptions);
|
|
6771
|
+
this.inputAttrs = input(this._DEFAULTS.inputAttrs);
|
|
6772
|
+
this.placeholder = input(this._DEFAULTS.placeholder);
|
|
6773
|
+
this.inputReadOnly = input(false, { transform: v => coerceBooleanProperty(v) });
|
|
6774
|
+
this.calendarDisabled = input(false, { transform: v => coerceBooleanProperty(v) });
|
|
6775
|
+
this.calendarHidden = input(false, { transform: v => coerceBooleanProperty(v) });
|
|
6776
|
+
//! serialization/deserialization
|
|
6777
|
+
this.serializeFn = input(this._DEFAULTS.serializeFn);
|
|
6778
|
+
this.deserializeFn = input(this._DEFAULTS.deserializeFn);
|
|
6779
|
+
//! control value accessor
|
|
6780
|
+
this.value = model(null);
|
|
6781
|
+
this.dateInputValue = model('');
|
|
6782
|
+
//! output events
|
|
6783
|
+
this.isOpen = model(false);
|
|
6784
|
+
this.openEvent = output({ alias: 'open' });
|
|
6785
|
+
this.closeEvent = output({ alias: 'close' });
|
|
6786
|
+
//! date input event handlers
|
|
6787
|
+
this.dateInput = viewChild.required('dateInput');
|
|
6788
|
+
this.minMaxStrategy = input(this._DEFAULTS.minMaxStrategy);
|
|
6789
|
+
this._isDateInputFocused = signal(false);
|
|
6790
|
+
//! computed properties
|
|
6791
|
+
this.shouldDisplayPlaceholder = computed(() => {
|
|
6792
|
+
if (this._isDateInputFocused() && this.dateInputValue())
|
|
6793
|
+
return false;
|
|
6794
|
+
return isNull(this.value());
|
|
6795
|
+
});
|
|
6796
|
+
this.shouldDisplayValue = computed(() => {
|
|
6797
|
+
if (this._isDateInputFocused() && this.dateInputValue())
|
|
6798
|
+
return false;
|
|
6799
|
+
return this.value() instanceof Date;
|
|
6800
|
+
});
|
|
6801
|
+
this.shouldDisplayDateInput = computed(() => {
|
|
6802
|
+
return !this.inputReadOnly() && !this.shouldDisplayValue() && this._isDateInputFocused();
|
|
6803
|
+
});
|
|
6804
|
+
//! appearance
|
|
6805
|
+
this.appearance = input(this._DEFAULTS.appearance);
|
|
6806
|
+
this.variant = input(this._DEFAULTS.variant);
|
|
6807
|
+
this.color = input(this._DEFAULTS.color);
|
|
6808
|
+
this.compact = input(this._DEFAULTS.compact, { transform: v => coerceBooleanProperty(v) });
|
|
6809
|
+
this.ngClasses = computed(() => [
|
|
6810
|
+
//appearance and variant handled in ard-form-field-frame component
|
|
6811
|
+
//color handled in ard-calendar component
|
|
6812
|
+
this.compact() ? 'ard-compact' : '',
|
|
6813
|
+
this.isOpen() ? 'ard-dropdown-open' : '',
|
|
6814
|
+
this._isDateInputFocused() ? 'ard-date-input__date-input-focused' : '',
|
|
6815
|
+
].join(' '));
|
|
6816
|
+
this.dropdownAppearance = input(this._DEFAULTS.dropdownAppearance);
|
|
6817
|
+
this.dropdownAppearanceOrDefault = computed(() => {
|
|
6818
|
+
if (this.dropdownAppearance())
|
|
6819
|
+
return this.dropdownAppearance();
|
|
6820
|
+
if (this.appearance() === FormElementAppearance.Outlined)
|
|
6821
|
+
return DropdownPanelAppearance.Outlined;
|
|
6822
|
+
return DropdownPanelAppearance.Raised;
|
|
6823
|
+
});
|
|
6824
|
+
this.dropdownVariant = input(this._DEFAULTS.dropdownVariant);
|
|
6825
|
+
this.dropdownVariantOrDefault = computed(() => {
|
|
6826
|
+
if (this.dropdownVariant())
|
|
6827
|
+
return this.dropdownVariant();
|
|
6828
|
+
const variant = this.variant();
|
|
6829
|
+
if (variant === FormElementVariant.Pill)
|
|
6830
|
+
return DropdownPanelVariant.Rounded;
|
|
6831
|
+
return variant;
|
|
6832
|
+
});
|
|
6833
|
+
//! calendar attributes
|
|
6834
|
+
this.activeView = model(this._DEFAULTS.activeView);
|
|
6835
|
+
this.activeYear = model(this._DEFAULTS.activeYear);
|
|
6836
|
+
this.activeMonth = model(this._DEFAULTS.activeMonth);
|
|
6837
|
+
this.firstWeekday = input(this._DEFAULTS.firstWeekday, {
|
|
6838
|
+
transform: v => {
|
|
6839
|
+
const value = coerceNumberProperty(v, this._DEFAULTS.firstWeekday);
|
|
6840
|
+
if (!Number.isInteger(value)) {
|
|
6841
|
+
console.error(new Error(`ARD-NF0081A: [firstWeekday] must be a positive integer, got "${value}". Using default value instead.`));
|
|
6842
|
+
return 1;
|
|
6843
|
+
}
|
|
6844
|
+
if (value < 0 || value > 6) {
|
|
6845
|
+
console.error(new Error(`ARD-NF0081B: [firstWeekday] must be between 0 and 6, got "${value}". Using modulo operator to adjust the value.`));
|
|
6846
|
+
}
|
|
6847
|
+
return value % 7;
|
|
6848
|
+
},
|
|
6849
|
+
});
|
|
6850
|
+
this.multipleYearPageChangeModifier = input(this._DEFAULTS.multipleYearPageChangeModifier, {
|
|
6851
|
+
transform: v => {
|
|
6852
|
+
const value = coerceNumberProperty(v, this._DEFAULTS.multipleYearPageChangeModifier);
|
|
6853
|
+
if (!Number.isInteger(value) || value < 1) {
|
|
6854
|
+
console.error(new Error(`ARD-NF0082: [multipleYearPageChangeModifier] must be a positive integer, got "${value}". Using default value instead.`));
|
|
6855
|
+
return 5;
|
|
6856
|
+
}
|
|
6857
|
+
return value;
|
|
6858
|
+
},
|
|
6859
|
+
});
|
|
6860
|
+
this.min = input(this._DEFAULTS.min, { transform: v => coerceDateProperty(v, this._DEFAULTS.min) });
|
|
6861
|
+
this.max = input(this._DEFAULTS.max, { transform: v => coerceDateProperty(v, this._DEFAULTS.max) });
|
|
6862
|
+
this.filter = input(this._DEFAULTS.filter);
|
|
6863
|
+
//! calendar outputs
|
|
6864
|
+
this.yearSelect = output();
|
|
6865
|
+
this.monthSelect = output();
|
|
6866
|
+
//! calendar controls
|
|
6867
|
+
this.useAcceptButtonToSelect = input(false, { transform: v => coerceBooleanProperty(v) });
|
|
6868
|
+
this._valueToAccept = null;
|
|
6869
|
+
//! dropdown overlay
|
|
6870
|
+
this.dropdownHost = viewChild.required('dropdownHost');
|
|
6871
|
+
this.dropdownTemplate = viewChild.required('dropdownTemplate');
|
|
6872
|
+
this.dropdownPanel = viewChild.required(ArdiumDropdownPanelComponent);
|
|
6873
|
+
//! templates
|
|
6874
|
+
this.valueTemplate = contentChild(ArdDateInputValueTemplateDirective);
|
|
6875
|
+
this.calendarIconTemplate = contentChild(ArdDateInputCalendarIconTemplateDirective);
|
|
6876
|
+
this.acceptButtonsTemplate = contentChild(ArdDateInputAcceptButtonsTemplateDirective);
|
|
6877
|
+
this.prefixTemplate = contentChild(ArdDateInputPrefixTemplateDirective);
|
|
6878
|
+
this.suffixTemplate = contentChild(ArdDateInputSuffixTemplateDirective);
|
|
6879
|
+
//! context providers
|
|
6880
|
+
this.valueContext = computed(() => ({
|
|
6881
|
+
$implicit: this.value(),
|
|
6882
|
+
}));
|
|
6883
|
+
this.acceptButtonsContext = computed(() => ({
|
|
6884
|
+
$implicit: () => this.onAcceptButtonClick(),
|
|
6885
|
+
accept: () => this.onAcceptButtonClick(),
|
|
6886
|
+
cancel: () => this.onCancelButtonClick(),
|
|
6887
|
+
disabled: this.disabled() || this.calendarDisabled(),
|
|
6888
|
+
}));
|
|
6889
|
+
}
|
|
6890
|
+
writeValue(v) {
|
|
6891
|
+
if (v instanceof Date) {
|
|
6892
|
+
this.value.set(v);
|
|
6893
|
+
}
|
|
6894
|
+
else if (!isDefined(v)) {
|
|
6895
|
+
this.value.set(null);
|
|
6896
|
+
}
|
|
6897
|
+
else {
|
|
6898
|
+
console.error(new Error(`ARD-NF0083: <ard-date-input> writeValue expected a Date or null, got "${v}".`));
|
|
6899
|
+
}
|
|
6900
|
+
}
|
|
6901
|
+
//! change & touch event emitters
|
|
6902
|
+
_emitChange() {
|
|
6903
|
+
this._onChangeRegistered?.(this.value());
|
|
6904
|
+
}
|
|
6905
|
+
_onTouched() {
|
|
6906
|
+
this._onTouchedRegistered?.();
|
|
6907
|
+
}
|
|
6908
|
+
onDateInputInput(event) {
|
|
6909
|
+
const v = event.target.value;
|
|
6910
|
+
this.dateInputValue.set(v);
|
|
6911
|
+
}
|
|
6912
|
+
onDateInputFocus(event) {
|
|
6913
|
+
this.onFocus(event);
|
|
6914
|
+
this._isDateInputFocused.set(true);
|
|
6915
|
+
}
|
|
6916
|
+
onDateInputBlur(event) {
|
|
6917
|
+
this.onBlur(event);
|
|
6918
|
+
this._processDateInputText(this.dateInputValue());
|
|
6919
|
+
if (!this._isDateInputFocused())
|
|
6920
|
+
return;
|
|
6921
|
+
this._onTouched();
|
|
6922
|
+
this._isDateInputFocused.set(false);
|
|
6923
|
+
}
|
|
6924
|
+
onDateInputEnter(event) {
|
|
6925
|
+
if (event.key !== 'Enter')
|
|
6926
|
+
return;
|
|
6927
|
+
event.preventDefault();
|
|
6928
|
+
this.close();
|
|
6929
|
+
this.blur();
|
|
6930
|
+
this.focus();
|
|
6931
|
+
}
|
|
6932
|
+
_processDateInputText(value) {
|
|
6933
|
+
let date = this.deserializeFn()(value, this.value());
|
|
6934
|
+
if (this.minMaxStrategy() === ArdDateInputMinMaxStrategy.Adjust && date) {
|
|
6935
|
+
const min = this.min();
|
|
6936
|
+
const max = this.max();
|
|
6937
|
+
if (min && date < min) {
|
|
6938
|
+
date = new Date(min);
|
|
6939
|
+
}
|
|
6940
|
+
else if (max && date > max) {
|
|
6941
|
+
date = new Date(max);
|
|
6942
|
+
}
|
|
6943
|
+
}
|
|
6944
|
+
this.value.set(date);
|
|
6945
|
+
this.dateInputValue.set(this.serializeFn()(date));
|
|
6946
|
+
}
|
|
6947
|
+
_setDateInputAttributes() {
|
|
6948
|
+
const input = this.dateInput().nativeElement;
|
|
6949
|
+
const attributes = {
|
|
6950
|
+
type: 'text',
|
|
6951
|
+
autocorrect: 'off',
|
|
6952
|
+
autocapitalize: 'off',
|
|
6953
|
+
autocomplete: 'off',
|
|
6954
|
+
...this.inputAttrs(),
|
|
6955
|
+
};
|
|
6956
|
+
for (const key of Object.keys(attributes)) {
|
|
6957
|
+
input.setAttribute(key, attributes[key]);
|
|
6958
|
+
}
|
|
6959
|
+
}
|
|
6960
|
+
onCalendarSelectedChange(event) {
|
|
6961
|
+
if (this.useAcceptButtonToSelect()) {
|
|
6962
|
+
this._valueToAccept = event;
|
|
6963
|
+
return;
|
|
6964
|
+
}
|
|
6965
|
+
this._acceptSelectedDate(event);
|
|
6966
|
+
}
|
|
6967
|
+
_acceptSelectedDate(date) {
|
|
6968
|
+
this.value.set(date);
|
|
6969
|
+
this.dateInputValue.set(this.serializeFn()(date));
|
|
6970
|
+
this.close();
|
|
6971
|
+
}
|
|
6972
|
+
_cancelCalendarSelection() {
|
|
6973
|
+
this.close();
|
|
6974
|
+
}
|
|
6975
|
+
onAcceptButtonClick() {
|
|
6976
|
+
this._acceptSelectedDate(this._valueToAccept);
|
|
6977
|
+
this._valueToAccept = null;
|
|
6978
|
+
}
|
|
6979
|
+
onCancelButtonClick() {
|
|
6980
|
+
this._cancelCalendarSelection();
|
|
6981
|
+
}
|
|
6982
|
+
_createOverlay() {
|
|
6983
|
+
const strategy = this.overlay
|
|
6984
|
+
.position()
|
|
6985
|
+
.flexibleConnectedTo(this.dropdownHost())
|
|
6986
|
+
.withPositions([
|
|
6987
|
+
{
|
|
6988
|
+
originX: 'end',
|
|
6989
|
+
originY: 'top',
|
|
6990
|
+
overlayX: 'end',
|
|
6991
|
+
overlayY: 'bottom',
|
|
6992
|
+
},
|
|
6993
|
+
{
|
|
6994
|
+
originX: 'end',
|
|
6995
|
+
originY: 'bottom',
|
|
6996
|
+
overlayX: 'end',
|
|
6997
|
+
overlayY: 'top',
|
|
6998
|
+
},
|
|
6999
|
+
]);
|
|
7000
|
+
const config = new OverlayConfig({
|
|
7001
|
+
positionStrategy: strategy,
|
|
7002
|
+
scrollStrategy: this.scrollStrategyOpts.block(),
|
|
7003
|
+
hasBackdrop: false,
|
|
7004
|
+
});
|
|
7005
|
+
this.dropdownOverlay = this.overlay.create(config);
|
|
7006
|
+
const portal = new TemplatePortal(this.dropdownTemplate(), this.viewContainerRef);
|
|
7007
|
+
this.dropdownOverlay.attach(portal);
|
|
7008
|
+
}
|
|
7009
|
+
_destroyOverlay() {
|
|
7010
|
+
if (!this.dropdownOverlay)
|
|
7011
|
+
return;
|
|
7012
|
+
this.dropdownOverlay.dispose();
|
|
7013
|
+
delete this.dropdownOverlay;
|
|
7014
|
+
}
|
|
7015
|
+
//! hooks
|
|
7016
|
+
ngAfterViewInit() {
|
|
7017
|
+
this._setDateInputAttributes();
|
|
7018
|
+
}
|
|
7019
|
+
//! dropdown state handlers
|
|
7020
|
+
onGeneralClick(event) {
|
|
7021
|
+
const target = event.target;
|
|
7022
|
+
if (target.tagName !== 'INPUT') {
|
|
7023
|
+
event.preventDefault();
|
|
7024
|
+
}
|
|
7025
|
+
if (this.isOpen()) {
|
|
7026
|
+
this.close();
|
|
7027
|
+
}
|
|
7028
|
+
this.dateInput().nativeElement.focus();
|
|
7029
|
+
}
|
|
7030
|
+
onOutsideClick(event) {
|
|
7031
|
+
if (!this.isOpen())
|
|
7032
|
+
return;
|
|
7033
|
+
const target = event.target;
|
|
7034
|
+
if (this.elementRef.nativeElement.contains(target))
|
|
7035
|
+
return;
|
|
7036
|
+
this.close();
|
|
7037
|
+
}
|
|
7038
|
+
onCalendarButtonClick(event) {
|
|
7039
|
+
if (this.calendarDisabled())
|
|
7040
|
+
return;
|
|
7041
|
+
if (this.calendarHidden())
|
|
7042
|
+
return;
|
|
7043
|
+
event.preventDefault();
|
|
7044
|
+
event.stopPropagation();
|
|
7045
|
+
this.toggle();
|
|
7046
|
+
}
|
|
7047
|
+
toggle() {
|
|
7048
|
+
if (this.isOpen()) {
|
|
7049
|
+
this.close();
|
|
7050
|
+
return;
|
|
7051
|
+
}
|
|
7052
|
+
this.open();
|
|
7053
|
+
}
|
|
7054
|
+
open() {
|
|
7055
|
+
if (this.disabled() || this.isOpen())
|
|
7056
|
+
return;
|
|
7057
|
+
this.isOpen.set(true);
|
|
7058
|
+
this._createOverlay();
|
|
7059
|
+
this.focus();
|
|
7060
|
+
this.openEvent.emit();
|
|
7061
|
+
}
|
|
7062
|
+
close() {
|
|
7063
|
+
if (!this.isOpen())
|
|
7064
|
+
return;
|
|
7065
|
+
this.isOpen.set(false);
|
|
7066
|
+
this._destroyOverlay();
|
|
7067
|
+
this._onTouched();
|
|
7068
|
+
this.closeEvent.emit();
|
|
7069
|
+
}
|
|
7070
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumDateInputComponent, deps: [{ token: ARD_DATE_INPUT_DEFAULTS }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7071
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: ArdiumDateInputComponent, selector: "ard-date-input", inputs: { inputAttrs: { classPropertyName: "inputAttrs", publicName: "inputAttrs", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inputReadOnly: { classPropertyName: "inputReadOnly", publicName: "inputReadOnly", isSignal: true, isRequired: false, transformFunction: null }, calendarDisabled: { classPropertyName: "calendarDisabled", publicName: "calendarDisabled", isSignal: true, isRequired: false, transformFunction: null }, calendarHidden: { classPropertyName: "calendarHidden", publicName: "calendarHidden", isSignal: true, isRequired: false, transformFunction: null }, serializeFn: { classPropertyName: "serializeFn", publicName: "serializeFn", isSignal: true, isRequired: false, transformFunction: null }, deserializeFn: { classPropertyName: "deserializeFn", publicName: "deserializeFn", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, dateInputValue: { classPropertyName: "dateInputValue", publicName: "dateInputValue", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, minMaxStrategy: { classPropertyName: "minMaxStrategy", publicName: "minMaxStrategy", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, dropdownAppearance: { classPropertyName: "dropdownAppearance", publicName: "dropdownAppearance", isSignal: true, isRequired: false, transformFunction: null }, dropdownVariant: { classPropertyName: "dropdownVariant", publicName: "dropdownVariant", isSignal: true, isRequired: false, transformFunction: null }, activeView: { classPropertyName: "activeView", publicName: "activeView", isSignal: true, isRequired: false, transformFunction: null }, activeYear: { classPropertyName: "activeYear", publicName: "activeYear", isSignal: true, isRequired: false, transformFunction: null }, activeMonth: { classPropertyName: "activeMonth", publicName: "activeMonth", isSignal: true, isRequired: false, transformFunction: null }, firstWeekday: { classPropertyName: "firstWeekday", publicName: "firstWeekday", isSignal: true, isRequired: false, transformFunction: null }, multipleYearPageChangeModifier: { classPropertyName: "multipleYearPageChangeModifier", publicName: "multipleYearPageChangeModifier", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, useAcceptButtonToSelect: { classPropertyName: "useAcceptButtonToSelect", publicName: "useAcceptButtonToSelect", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", dateInputValue: "dateInputValueChange", isOpen: "isOpenChange", openEvent: "open", closeEvent: "close", activeView: "activeViewChange", activeYear: "activeYearChange", activeMonth: "activeMonthChange", yearSelect: "yearSelect", monthSelect: "monthSelect" }, providers: [
|
|
7072
|
+
{
|
|
7073
|
+
provide: NG_VALUE_ACCESSOR,
|
|
7074
|
+
useExisting: forwardRef(() => ArdiumDateInputComponent),
|
|
7075
|
+
multi: true,
|
|
7076
|
+
},
|
|
7077
|
+
{
|
|
7078
|
+
provide: _FormFieldComponentBase,
|
|
7079
|
+
useExisting: ArdiumDateInputComponent,
|
|
7080
|
+
},
|
|
7081
|
+
], queries: [{ propertyName: "valueTemplate", first: true, predicate: ArdDateInputValueTemplateDirective, descendants: true, isSignal: true }, { propertyName: "calendarIconTemplate", first: true, predicate: ArdDateInputCalendarIconTemplateDirective, descendants: true, isSignal: true }, { propertyName: "acceptButtonsTemplate", first: true, predicate: ArdDateInputAcceptButtonsTemplateDirective, descendants: true, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: ArdDateInputPrefixTemplateDirective, descendants: true, isSignal: true }, { propertyName: "suffixTemplate", first: true, predicate: ArdDateInputSuffixTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "dateInput", first: true, predicate: ["dateInput"], descendants: true, isSignal: true }, { propertyName: "dropdownHost", first: true, predicate: ["dropdownHost"], descendants: true, isSignal: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, isSignal: true }, { propertyName: "dropdownPanel", first: true, predicate: ArdiumDropdownPanelComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ard-form-field-frame\r\n [appearance]=\"appearance()\"\r\n [variant]=\"variant()\"\r\n [compact]=\"compact()\"\r\n [isFocused]=\"isFocused()\"\r\n [hasError]=\"hasError()\"\r\n [isSuccess]=\"isSuccess()\"\r\n [prefixTemplate]=\"prefixTemplate()?.template\"\r\n [suffixTemplate]=\"suffixTemplate()?.template\"\r\n>\r\n <div\r\n class=\"ard-date-input\"\r\n #dropdownHost\r\n (click)=\"onGeneralClick($event)\"\r\n [class.ard-has-value]=\"!!value()\"\r\n [ngClass]=\"ngClasses()\"\r\n >\r\n <div class=\"ard-date-input__value-container ard-input-container\">\r\n <div\r\n class=\"ard-date-input__placeholder ard-placeholder\"\r\n [class.ard-date-input__placeholder-hidden]=\"!shouldDisplayPlaceholder()\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n <div\r\n class=\"ard-date-input__value\"\r\n [class.ard-date-input__value-hidden]=\"!shouldDisplayValue()\"\r\n >\r\n <ng-template\r\n #defaultValueTemplate\r\n let-date\r\n >\r\n {{ serializeFn()(date) }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"valueTemplate()?.template || defaultValueTemplate\"\r\n [ngTemplateOutletContext]=\"valueContext()\"\r\n />\r\n </div>\r\n <div\r\n class=\"ard-date-input__input-container\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-owns]=\"isOpen() ? htmlId() : null\"\r\n [class.ard-date-input__input-container-hidden]=\"!shouldDisplayDateInput()\"\r\n >\r\n <input\r\n #dateInput\r\n #focusableElement\r\n type=\"text\"\r\n class=\"ard-date-input__input\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n [value]=\"dateInputValue()\"\r\n [attr.aria-controls]=\"isOpen() ? htmlId() : null\"\r\n (input)=\"onDateInputInput($event)\"\r\n (change)=\"$event.stopPropagation()\"\r\n (focus)=\"onDateInputFocus($event)\"\r\n (blur)=\"onDateInputBlur($event)\"\r\n (keydown)=\"onDateInputEnter($event)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n @if (!calendarHidden()) {\r\n <ard-icon-button\r\n color=\"none\"\r\n [disabled]=\"calendarDisabled()\"\r\n (click)=\"onCalendarButtonClick($event)\"\r\n >\r\n <ng-template\r\n #defaultCalendarIconTemplate\r\n let-date\r\n >\r\n <ard-icon filled>today</ard-icon>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"calendarIconTemplate()?.template || defaultCalendarIconTemplate\" />\r\n </ard-icon-button>\r\n }\r\n </div>\r\n</ard-form-field-frame>\r\n\r\n<ng-template #dropdownTemplate>\r\n <ard-dropdown-panel\r\n class=\"ard-dropdown-panel ard-date-input__dropdown-panel\"\r\n [appearance]=\"dropdownAppearanceOrDefault()\"\r\n [variant]=\"dropdownVariantOrDefault()\"\r\n [isOpen]=\"true\"\r\n [panelId]=\"htmlId()\"\r\n [compact]=\"compact()\"\r\n (ardClickOutside)=\"onOutsideClick($event)\"\r\n >\r\n <ard-calendar\r\n class=\"ard-date-input__calendar\"\r\n [(activeMonth)]=\"activeMonth\"\r\n [(activeYear)]=\"activeYear\"\r\n [(activeView)]=\"activeView\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n autoFocus\r\n [multipleYearPageChangeModifier]=\"multipleYearPageChangeModifier()\"\r\n [color]=\"color()\"\r\n [disabled]=\"disabled() || calendarDisabled()\"\r\n [tabIndex]=\"tabIndex()\"\r\n (selectedChange)=\"onCalendarSelectedChange($event)\"\r\n (yearSelect)=\"yearSelect.emit($event)\"\r\n (monthSelect)=\"monthSelect.emit($event)\"\r\n />\r\n @if (useAcceptButtonToSelect()) {\r\n <div class=\"ard-date-input__accept-buttons-container\">\r\n <ng-template\r\n #defaultAcceptButtonsTemplate\r\n let-date\r\n >\r\n {{ serializeFn()(date) }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"acceptButtonsTemplate()?.template || defaultAcceptButtonsTemplate\"\r\n [ngTemplateOutletContext]=\"acceptButtonsContext()\"\r\n />\r\n </div>\r\n }\r\n </ard-dropdown-panel>\r\n</ng-template>\r\n", styles: [".ard-date-input .ard-date-input__placeholder.ard-date-input__placeholder-hidden,.ard-date-input .ard-date-input__value.ard-date-input__value-hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ArdiumFormFieldFrameComponent, selector: "ard-form-field-frame", inputs: ["hasError", "isSuccess", "isFocused", "appearance", "variant", "compact", "prefixTemplate", "suffixTemplate"] }, { kind: "component", type: ArdiumDropdownPanelComponent, selector: "ard-dropdown-panel", inputs: ["panelId", "headerTemplate", "footerTemplate", "filterValue", "appearance", "variant", "compact", "isOpen"], outputs: ["scroll", "scrollToEnd"] }, { kind: "directive", type: i4.ClickOutsideDirective, selector: "[ardClickOutside]", outputs: ["ardClickOutside"] }, { kind: "component", type: ArdiumCalendarComponent, selector: "ard-calendar", inputs: ["color", "activeView", "activeYear", "activeMonth", "firstWeekday", "multipleYearPageChangeModifier", "autoFocus", "selected", "min", "max", "filter"], outputs: ["activeViewChange", "activeYearChange", "activeMonthChange", "selectedChange", "yearSelect", "monthSelect"] }, { kind: "component", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: ["wrapperClasses", "type", "color", "lightColoring", "compact"] }, { kind: "component", type: ArdiumIconComponent, selector: "ard-icon", inputs: ["ariaLabel", "icon", "filled", "weight", "grade", "opticalSize"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
7082
|
+
}
|
|
7083
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumDateInputComponent, decorators: [{
|
|
7084
|
+
type: Component,
|
|
7085
|
+
args: [{ selector: 'ard-date-input', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
7086
|
+
{
|
|
7087
|
+
provide: NG_VALUE_ACCESSOR,
|
|
7088
|
+
useExisting: forwardRef(() => ArdiumDateInputComponent),
|
|
7089
|
+
multi: true,
|
|
7090
|
+
},
|
|
7091
|
+
{
|
|
7092
|
+
provide: _FormFieldComponentBase,
|
|
7093
|
+
useExisting: ArdiumDateInputComponent,
|
|
7094
|
+
},
|
|
7095
|
+
], template: "<ard-form-field-frame\r\n [appearance]=\"appearance()\"\r\n [variant]=\"variant()\"\r\n [compact]=\"compact()\"\r\n [isFocused]=\"isFocused()\"\r\n [hasError]=\"hasError()\"\r\n [isSuccess]=\"isSuccess()\"\r\n [prefixTemplate]=\"prefixTemplate()?.template\"\r\n [suffixTemplate]=\"suffixTemplate()?.template\"\r\n>\r\n <div\r\n class=\"ard-date-input\"\r\n #dropdownHost\r\n (click)=\"onGeneralClick($event)\"\r\n [class.ard-has-value]=\"!!value()\"\r\n [ngClass]=\"ngClasses()\"\r\n >\r\n <div class=\"ard-date-input__value-container ard-input-container\">\r\n <div\r\n class=\"ard-date-input__placeholder ard-placeholder\"\r\n [class.ard-date-input__placeholder-hidden]=\"!shouldDisplayPlaceholder()\"\r\n >\r\n {{ placeholder() }}\r\n </div>\r\n <div\r\n class=\"ard-date-input__value\"\r\n [class.ard-date-input__value-hidden]=\"!shouldDisplayValue()\"\r\n >\r\n <ng-template\r\n #defaultValueTemplate\r\n let-date\r\n >\r\n {{ serializeFn()(date) }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"valueTemplate()?.template || defaultValueTemplate\"\r\n [ngTemplateOutletContext]=\"valueContext()\"\r\n />\r\n </div>\r\n <div\r\n class=\"ard-date-input__input-container\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-owns]=\"isOpen() ? htmlId() : null\"\r\n [class.ard-date-input__input-container-hidden]=\"!shouldDisplayDateInput()\"\r\n >\r\n <input\r\n #dateInput\r\n #focusableElement\r\n type=\"text\"\r\n class=\"ard-date-input__input\"\r\n [attr.tabindex]=\"tabIndex()\"\r\n [value]=\"dateInputValue()\"\r\n [attr.aria-controls]=\"isOpen() ? htmlId() : null\"\r\n (input)=\"onDateInputInput($event)\"\r\n (change)=\"$event.stopPropagation()\"\r\n (focus)=\"onDateInputFocus($event)\"\r\n (blur)=\"onDateInputBlur($event)\"\r\n (keydown)=\"onDateInputEnter($event)\"\r\n />\r\n </div>\r\n </div>\r\n\r\n @if (!calendarHidden()) {\r\n <ard-icon-button\r\n color=\"none\"\r\n [disabled]=\"calendarDisabled()\"\r\n (click)=\"onCalendarButtonClick($event)\"\r\n >\r\n <ng-template\r\n #defaultCalendarIconTemplate\r\n let-date\r\n >\r\n <ard-icon filled>today</ard-icon>\r\n </ng-template>\r\n\r\n <ng-template [ngTemplateOutlet]=\"calendarIconTemplate()?.template || defaultCalendarIconTemplate\" />\r\n </ard-icon-button>\r\n }\r\n </div>\r\n</ard-form-field-frame>\r\n\r\n<ng-template #dropdownTemplate>\r\n <ard-dropdown-panel\r\n class=\"ard-dropdown-panel ard-date-input__dropdown-panel\"\r\n [appearance]=\"dropdownAppearanceOrDefault()\"\r\n [variant]=\"dropdownVariantOrDefault()\"\r\n [isOpen]=\"true\"\r\n [panelId]=\"htmlId()\"\r\n [compact]=\"compact()\"\r\n (ardClickOutside)=\"onOutsideClick($event)\"\r\n >\r\n <ard-calendar\r\n class=\"ard-date-input__calendar\"\r\n [(activeMonth)]=\"activeMonth\"\r\n [(activeYear)]=\"activeYear\"\r\n [(activeView)]=\"activeView\"\r\n [firstWeekday]=\"firstWeekday()\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n autoFocus\r\n [multipleYearPageChangeModifier]=\"multipleYearPageChangeModifier()\"\r\n [color]=\"color()\"\r\n [disabled]=\"disabled() || calendarDisabled()\"\r\n [tabIndex]=\"tabIndex()\"\r\n (selectedChange)=\"onCalendarSelectedChange($event)\"\r\n (yearSelect)=\"yearSelect.emit($event)\"\r\n (monthSelect)=\"monthSelect.emit($event)\"\r\n />\r\n @if (useAcceptButtonToSelect()) {\r\n <div class=\"ard-date-input__accept-buttons-container\">\r\n <ng-template\r\n #defaultAcceptButtonsTemplate\r\n let-date\r\n >\r\n {{ serializeFn()(date) }}\r\n </ng-template>\r\n\r\n <ng-template\r\n [ngTemplateOutlet]=\"acceptButtonsTemplate()?.template || defaultAcceptButtonsTemplate\"\r\n [ngTemplateOutletContext]=\"acceptButtonsContext()\"\r\n />\r\n </div>\r\n }\r\n </ard-dropdown-panel>\r\n</ng-template>\r\n", styles: [".ard-date-input .ard-date-input__placeholder.ard-date-input__placeholder-hidden,.ard-date-input .ard-date-input__value.ard-date-input__value-hidden{display:none}\n"] }]
|
|
7096
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
7097
|
+
type: Inject,
|
|
7098
|
+
args: [ARD_DATE_INPUT_DEFAULTS]
|
|
7099
|
+
}] }] });
|
|
7100
|
+
|
|
7101
|
+
class ArdiumIconButtonModule {
|
|
7102
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
7103
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonModule, declarations: [ArdiumIconButtonComponent], imports: [CommonModule], exports: [ArdiumIconButtonComponent] }); }
|
|
7104
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonModule, imports: [CommonModule] }); }
|
|
7105
|
+
}
|
|
7106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonModule, decorators: [{
|
|
7107
|
+
type: NgModule,
|
|
7108
|
+
args: [{
|
|
7109
|
+
declarations: [ArdiumIconButtonComponent],
|
|
7110
|
+
imports: [CommonModule],
|
|
7111
|
+
exports: [ArdiumIconButtonComponent],
|
|
7112
|
+
}]
|
|
7113
|
+
}] });
|
|
7114
|
+
|
|
7115
|
+
class ArdiumCalendarModule {
|
|
7116
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumCalendarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
7117
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ArdiumCalendarModule, declarations: [ArdiumCalendarComponent, DaysViewComponent, MonthsViewComponent, YearsViewComponent], imports: [CommonModule, DatePipe, UpperCasePipe, ArdiumIconButtonModule, ArdiumIconModule, ArdiumButtonModule], exports: [ArdiumCalendarComponent] }); }
|
|
7118
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumCalendarModule, imports: [CommonModule, ArdiumIconButtonModule, ArdiumIconModule, ArdiumButtonModule] }); }
|
|
7119
|
+
}
|
|
7120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumCalendarModule, decorators: [{
|
|
7121
|
+
type: NgModule,
|
|
7122
|
+
args: [{
|
|
7123
|
+
declarations: [ArdiumCalendarComponent, DaysViewComponent, MonthsViewComponent, YearsViewComponent],
|
|
7124
|
+
imports: [CommonModule, DatePipe, UpperCasePipe, ArdiumIconButtonModule, ArdiumIconModule, ArdiumButtonModule],
|
|
7125
|
+
exports: [ArdiumCalendarComponent],
|
|
7126
|
+
}]
|
|
7127
|
+
}] });
|
|
7128
|
+
|
|
7129
|
+
class ArdiumDateInputModule {
|
|
7130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumDateInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
7131
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ArdiumDateInputModule, declarations: [ArdiumDateInputComponent], imports: [CommonModule,
|
|
7132
|
+
ArdiumFormFieldFrameModule,
|
|
7133
|
+
ArdiumDropdownPanelModule,
|
|
7134
|
+
ArdiumClickOutsideEventModule,
|
|
7135
|
+
ArdiumCalendarModule,
|
|
7136
|
+
ArdiumIconButtonModule,
|
|
7137
|
+
ArdiumIconModule], exports: [ArdiumDateInputComponent] }); }
|
|
7138
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumDateInputModule, imports: [CommonModule,
|
|
7139
|
+
ArdiumFormFieldFrameModule,
|
|
7140
|
+
ArdiumDropdownPanelModule,
|
|
7141
|
+
ArdiumClickOutsideEventModule,
|
|
7142
|
+
ArdiumCalendarModule,
|
|
7143
|
+
ArdiumIconButtonModule,
|
|
7144
|
+
ArdiumIconModule] }); }
|
|
7145
|
+
}
|
|
7146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumDateInputModule, decorators: [{
|
|
7147
|
+
type: NgModule,
|
|
7148
|
+
args: [{
|
|
7149
|
+
declarations: [
|
|
7150
|
+
ArdiumDateInputComponent,
|
|
7151
|
+
//template directives
|
|
7152
|
+
],
|
|
7153
|
+
imports: [
|
|
7154
|
+
CommonModule,
|
|
7155
|
+
ArdiumFormFieldFrameModule,
|
|
7156
|
+
ArdiumDropdownPanelModule,
|
|
7157
|
+
ArdiumClickOutsideEventModule,
|
|
7158
|
+
ArdiumCalendarModule,
|
|
7159
|
+
ArdiumIconButtonModule,
|
|
7160
|
+
ArdiumIconModule,
|
|
7161
|
+
],
|
|
7162
|
+
exports: [
|
|
7163
|
+
ArdiumDateInputComponent,
|
|
7164
|
+
//tempalate directives
|
|
7165
|
+
],
|
|
7166
|
+
}]
|
|
7167
|
+
}] });
|
|
7168
|
+
|
|
5295
7169
|
const CaseTransformerType = {
|
|
5296
7170
|
NoChange: 'nochange',
|
|
5297
7171
|
Uppercase: 'uppercase',
|
|
@@ -5967,54 +7841,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
5967
7841
|
}]
|
|
5968
7842
|
}] });
|
|
5969
7843
|
|
|
5970
|
-
const ARD_ICON_BUTTON_DEFAULTS = new InjectionToken('ard-icon-button-defaults', {
|
|
5971
|
-
factory: () => _simpleButtonDefaults,
|
|
5972
|
-
});
|
|
5973
|
-
function provideIconButtonDefaults(config) {
|
|
5974
|
-
return { provide: ARD_ICON_BUTTON_DEFAULTS, useValue: { ..._simpleButtonDefaults, ...config } };
|
|
5975
|
-
}
|
|
5976
|
-
|
|
5977
|
-
class ArdiumIconButtonComponent extends _FocusableComponentBase {
|
|
5978
|
-
constructor(defaults) {
|
|
5979
|
-
super(defaults);
|
|
5980
|
-
this.wrapperClasses = input('');
|
|
5981
|
-
this.type = input(this._DEFAULTS.type);
|
|
5982
|
-
//! button settings
|
|
5983
|
-
this.color = input(this._DEFAULTS.color);
|
|
5984
|
-
this.lightColoring = input(this._DEFAULTS.lightColoring, { transform: v => coerceBooleanProperty(v) });
|
|
5985
|
-
this.compact = input(this._DEFAULTS.compact, { transform: v => coerceBooleanProperty(v) });
|
|
5986
|
-
this.ngClasses = computed(() => [
|
|
5987
|
-
'ard-appearance-transparent',
|
|
5988
|
-
`ard-color-${this.disabled() ? ComponentColor.None : this.color()}`,
|
|
5989
|
-
this.lightColoring() ? `ard-light-coloring` : '',
|
|
5990
|
-
this.compact() ? 'ard-compact' : '',
|
|
5991
|
-
].join(' '));
|
|
5992
|
-
}
|
|
5993
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonComponent, deps: [{ token: ARD_ICON_BUTTON_DEFAULTS }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5994
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: ArdiumIconButtonComponent, selector: "ard-icon-button", inputs: { wrapperClasses: { classPropertyName: "wrapperClasses", publicName: "wrapperClasses", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, lightColoring: { classPropertyName: "lightColoring", publicName: "lightColoring", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<button\n class=\"ard-icon-button\"\n [type]=\"type()\"\n [ngClass]=\"ngClasses()\"\n [tabindex]=\"tabIndex()\"\n (focus)=\"focusEvent.emit($event)\"\n (blur)=\"blurEvent.emit($event)\"\n>\n <div class=\"ard-focus-overlay\"></div>\n <div class=\"ard-button-content\">\n <ng-content></ng-content>\n </div>\n</button>\n", styles: [".ard-icon-button{display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.ard-icon-button .ard-button-content{max-height:100%;display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
5995
|
-
}
|
|
5996
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonComponent, decorators: [{
|
|
5997
|
-
type: Component,
|
|
5998
|
-
args: [{ selector: 'ard-icon-button', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n class=\"ard-icon-button\"\n [type]=\"type()\"\n [ngClass]=\"ngClasses()\"\n [tabindex]=\"tabIndex()\"\n (focus)=\"focusEvent.emit($event)\"\n (blur)=\"blurEvent.emit($event)\"\n>\n <div class=\"ard-focus-overlay\"></div>\n <div class=\"ard-button-content\">\n <ng-content></ng-content>\n </div>\n</button>\n", styles: [".ard-icon-button{display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.ard-icon-button .ard-button-content{max-height:100%;display:flex;align-items:center;justify-content:center}\n"] }]
|
|
5999
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
6000
|
-
type: Inject,
|
|
6001
|
-
args: [ARD_ICON_BUTTON_DEFAULTS]
|
|
6002
|
-
}] }] });
|
|
6003
|
-
|
|
6004
|
-
class ArdiumIconButtonModule {
|
|
6005
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
6006
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonModule, declarations: [ArdiumIconButtonComponent], imports: [CommonModule], exports: [ArdiumIconButtonComponent] }); }
|
|
6007
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonModule, imports: [CommonModule] }); }
|
|
6008
|
-
}
|
|
6009
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ArdiumIconButtonModule, decorators: [{
|
|
6010
|
-
type: NgModule,
|
|
6011
|
-
args: [{
|
|
6012
|
-
declarations: [ArdiumIconButtonComponent],
|
|
6013
|
-
imports: [CommonModule],
|
|
6014
|
-
exports: [ArdiumIconButtonComponent],
|
|
6015
|
-
}]
|
|
6016
|
-
}] });
|
|
6017
|
-
|
|
6018
7844
|
const _checkboxDefaults = {
|
|
6019
7845
|
..._booleanComponentDefaults,
|
|
6020
7846
|
color: SimpleComponentColor.Primary,
|
|
@@ -11904,5 +13730,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
11904
13730
|
* Generated bundle index. Do not edit.
|
|
11905
13731
|
*/
|
|
11906
13732
|
|
|
11907
|
-
export { ARD_BADGE_DEFAULTS, ARD_BUTTON_DEFAULTS, ARD_CARD_DEFAULTS, ARD_CHECKBOX_DEFAULTS, ARD_CHECKBOX_LIST_DEFAULTS, ARD_CHIP_DEFAULTS, ARD_COLOR_DISPLAY_DEFAULTS, ARD_DELETABLE_CHIP_DEFAULTS, ARD_DIALOG_DEFAULTS, ARD_DIGIT_INPUT_DEFAULTS, ARD_DIVIDER_DEFAULTS, ARD_DROPDOWN_PANEL_DEFAULTS, ARD_FAB_DEFAULTS, ARD_FILE_DROP_AREA_DEFAULTS, ARD_FILE_INPUT_DEFAULTS, ARD_FORM_FIELD_FRAME_DEFAULTS, ARD_HEX_INPUT_DEFAULTS, ARD_ICON_BUTTON_DEFAULTS, ARD_ICON_DEFAULTS, ARD_KBD_DEFAULTS, ARD_KBD_SHORTCUT_DEFAULTS, ARD_MODAL_DEFAULTS, ARD_NUMBER_INPUT_DEFAULTS, ARD_PASSWORD_INPUT_DEFAULTS, ARD_PROGRESS_BAR_DEFAULTS, ARD_PROGRESS_CIRCLE_DEFAULTS, ARD_RADIO_DEFAULTS, ARD_SEGMENT_DEFAULTS, ARD_SELECTABLE_CHIP_DEFAULTS, ARD_SELECT_DEFAULTS, ARD_SIMPLE_INPUT_DEFAULTS, ARD_SLIDER_DEFAULTS, ARD_SLIDE_TOGGLE_DEFAULTS, ARD_SNACKBAR_ANIMATION_LENGTH, ARD_SNACKBAR_DATA, ARD_SNACKBAR_DEFAULTS, ARD_SPINNER_DEFAULTS, ARD_STAR_BUTTON_DEFAULTS, ARD_STAR_DEFAULTS, ARD_STAR_DISPLAY_DEFAULTS, ARD_STAR_INPUT_DEFAULTS, ARD_STATEBOX_DEFAULTS, ARD_TABBER_DEFAULTS, ARD_TABLE_DEFAULTS, ARD_TABLE_FROM_CSV_DEFAULTS, ARD_TABLE_PAGINATION_DEFAULTS, ARD_TAB_DEFAULTS, ArdAddCustomTemplateDirective, ArdDialogButtonsTemplateDirective, ArdDropdownFooterTemplateDirective, ArdDropdownHeaderTemplateDirective, ArdFileInputPlaceholderTemplateDirective, ArdFileInputPrefixTemplateDirective, ArdFileInputSuffixTemplateDirective, ArdFormFieldPrefixTemplateDirective, ArdFormFieldSuffixTemplateDirective, ArdHexInputPlaceholderTemplateDirective, ArdHexInputPrefixTemplateDirective, ArdHexInputSuffixTemplateDirective, ArdInputLoadingTemplateDirective, ArdInputPlaceholderTemplateDirective, ArdInputPrefixTemplateDirective, ArdInputSuffixTemplateDirective, ArdInputSuggestionTemplateDirective, ArdItemDisplayLimitTemplateDirective, ArdItemLimitReachedTemplateDirective, ArdLoadingPlaceholderTemplateDirective, ArdLoadingSpinnerTemplateDirective, ArdNoItemsFoundTemplateDirective, ArdNumberInputPlaceholderTemplateDirective, ArdOptgroupTemplateDirective, ArdOptionTemplateDirective, ArdPanelPosition, ArdPasswordInputPlaceholderTemplateDirective, ArdPasswordInputPrefixTemplateDirective, ArdPasswordInputRevealButtonTemplateDirective, ArdPasswordInputSuffixTemplateDirective, ArdProgressBarValueTemplateDirective, ArdProgressCircleValueTemplateDirective, searchFunctions as ArdSearchFunction, ArdSegmentOptionTemplateDirective, ArdSelectPlaceholderTemplateDirective, ArdSelectPrefixTemplateDirective, ArdSelectSuffixTemplateDirective, ArdSimpleInputPlaceholderTemplateDirective, ArdSimpleInputPrefixTemplateDirective, ArdSimpleInputSuffixTemplateDirective, ArdSlideToggleAppearance, ArdSliderTooltipDirective, ArdSnackbarAlignment, ArdSnackbarOriginRelation, ArdSnackbarQueueHandling, ArdSnackbarRef, ArdSnackbarType, ArdValueChipTemplateDirective, ArdValueTemplateDirective, ArdiumBadgeDirective, ArdiumBadgeModule, ArdiumButtonComponent, ArdiumButtonModule, ArdiumCardActionButtonsDirective, ArdiumCardAvatarDirective, ArdiumCardComponent, ArdiumCardContentDirective, ArdiumCardDirective, ArdiumCardFooterDirective, ArdiumCardHeaderComponent, ArdiumCardImageDirective, ArdiumCardModule, ArdiumCardSubtitleDirective, ArdiumCardTitleDirective, ArdiumCheckboxComponent, ArdiumCheckboxListComponent, ArdiumCheckboxListModule, ArdiumCheckboxModule, ArdiumChipComponent, ArdiumChipModule, ArdiumColorDisplayComponent, ArdiumColorDisplayModule, ArdiumDeletableChipComponent, ArdiumDialogComponent, ArdiumDialogModule, ArdiumDigitInputComponent, ArdiumDigitInputModule, ArdiumDividerComponent, ArdiumDividerModule, ArdiumDropdownPanelComponent, ArdiumDropdownPanelModule, ArdiumErrorComponent, ArdiumErrorDirective, ArdiumFabComponent, ArdiumFabModule, ArdiumFileDropAreaComponent, ArdiumFileDropAreaDragoverContentTemplateDirective, ArdiumFileDropAreaIdleContentTemplateDirective, ArdiumFileDropAreaModule, ArdiumFileDropAreaUploadedContentTemplateDirective, ArdiumFileInputComponent, ArdiumFileInputDragoverContentTemplateDirective, ArdiumFileInputIdleContentTemplateDirective, ArdiumFileInputModule, ArdiumFileInputUploadedContentTemplateDirective, ArdiumFormFieldComponent, ArdiumFormFieldFrameComponent, ArdiumFormFieldFrameModule, ArdiumFormFieldModule, ArdiumHexInputComponent, ArdiumHexInputModule, ArdiumHintComponent, ArdiumHintDirective, ArdiumHorizontalFormFieldComponent, ArdiumIconButtonComponent, ArdiumIconButtonModule, ArdiumIconComponent, ArdiumIconModule, ArdiumIconPipe, ArdiumInputComponent, ArdiumInputModule, ArdiumKbdComponent, ArdiumKbdDirective, ArdiumKbdModule, ArdiumKbdPipe, ArdiumKbdShortcutComponent, ArdiumKbdShortcutModule, ArdiumLabelComponent, ArdiumModalComponent, ArdiumModalModule, ArdiumNumberInputComponent, ArdiumNumberInputModule, ArdiumOptionComponent, ArdiumOptionModule, ArdiumPasswordInputComponent, ArdiumPasswordInputModule, ArdiumProgressBarComponent, ArdiumProgressBarModule, ArdiumProgressCircleComponent, ArdiumProgressCircleModule, ArdiumRadioComponent, ArdiumRadioGroupComponent, ArdiumRadioModule, ArdiumRangeSliderComponent, ArdiumRangeSliderModule, ArdiumSegmentComponent, ArdiumSegmentModule, ArdiumSelectComponent, ArdiumSelectModule, ArdiumSelectableChipComponent, ArdiumSimpleInputComponent, ArdiumSimpleInputModule, ArdiumSlideToggleComponent, ArdiumSlideToggleModule, ArdiumSliderComponent, ArdiumSliderModule, ArdiumSnackbarService, ArdiumSpinnerComponent, ArdiumSpinnerModule, ArdiumStarButtonComponent, ArdiumStarButtonModule, ArdiumStarComponent, ArdiumStarDisplayComponent, ArdiumStarDisplayModule, ArdiumStarInputComponent, ArdiumStarInputModule, ArdiumStarModule, ArdiumStateboxComponent, ArdiumStateboxModule, ArdiumTabComponent, ArdiumTabberComponent, ArdiumTabberModule, ArdiumTableCaptionTemplateDirective, ArdiumTableCheckboxTemplateDirective, ArdiumTableComponent, ArdiumTableFromCsvComponent, ArdiumTableFromCsvModule, ArdiumTableHeaderCheckboxTemplateDirective, ArdiumTableModule, ArdiumTablePaginationComponent, ArdiumTablePaginationModule, ArdiumTablePaginationTemplateDirective, ArdiumTableTemplateDirective, ArdiumTextListComponent, ArdiumTextListModule, ArdiumTextListPipe, BadgePosition, BadgeSize, ButtonAppearance, ButtonVariant, CardAppearance, CardVariant, CheckboxListAlignType, CheckboxState, ClickStrategy, ColorDisplayAppearance, ComponentColor, DecorationElementAppearance, DialogResult, DigitInputPrimitiveOption, DigitInputShape, DropdownPanelAppearance, DropdownPanelVariant, FabSize, FormElementAppearance, FormElementVariant, OneAxisAlignment, OutlinedAppearance, PaginationAlign, PanelAppearance, PanelVariant, ProgressBarAppearance, ProgressBarMode, ProgressBarSize, ProgressBarVariant, ProgressCircleAppearance, ProgressCircleVariant, SegmentAppearance, SegmentVariant, SimpleComponentColor, SimpleOneAxisAlignment, SliderDecorationPosition, SliderTooltipBehavior, SortType, StarColor, StarFillMode, TableAlignType, TableAppearance, TablePaginationStrategy, TableVariant, TransformType, _chipDefaults, _modalDefaults, provideBadgeDefaults, provideButtonDefaults, provideCardDefaults, provideCheckboxDefaults, provideCheckboxListDefaults, provideChipDefaults, provideColorDisplayDefaults, provideDeletableChipDefaults, provideDialogDefaults, provideDigitInputDefaults, provideDividerDefaults, provideDropdownPanelDefaults, provideFabDefaults, provideFileDropAreaDefaults, provideFileInputDefaults, provideFormFieldFrameDefaults, provideHexInputDefaults, provideIconButtonDefaults, provideIconDefaults, provideKbdDefaults, provideKbdShortcutDefaults, provideModalDefaults, provideNumberInputDefaults, providePasswordInputDefaults, provideProgressBarDefaults, provideProgressCircleDefaults, provideRadioDefaults, provideSegmentDefaults, provideSelectDefaults, provideSelectableChipDefaults, provideSimpleInputDefaults, provideSlideToggleDefaults, provideSliderDefaults, provideSnackbarDefaults, provideSpinnerDefaults, provideStarButtonDefaults, provideStarDefaults, provideStarDisplayDefaults, provideStarInputDefaults, provideStateboxDefaults, provideTabDefaults, provideTabberDefaults, provideTableDefaults, provideTableFromCsvDefaults, provideTablePaginationDefaults, searchInString };
|
|
13733
|
+
export { ARD_BADGE_DEFAULTS, ARD_BUTTON_DEFAULTS, ARD_CALENDAR_DEFAULTS, ARD_CARD_DEFAULTS, ARD_CHECKBOX_DEFAULTS, ARD_CHECKBOX_LIST_DEFAULTS, ARD_CHIP_DEFAULTS, ARD_COLOR_DISPLAY_DEFAULTS, ARD_DATE_INPUT_DEFAULTS, ARD_DELETABLE_CHIP_DEFAULTS, ARD_DIALOG_DEFAULTS, ARD_DIGIT_INPUT_DEFAULTS, ARD_DIVIDER_DEFAULTS, ARD_DROPDOWN_PANEL_DEFAULTS, ARD_FAB_DEFAULTS, ARD_FILE_DROP_AREA_DEFAULTS, ARD_FILE_INPUT_DEFAULTS, ARD_FORM_FIELD_FRAME_DEFAULTS, ARD_HEX_INPUT_DEFAULTS, ARD_ICON_BUTTON_DEFAULTS, ARD_ICON_DEFAULTS, ARD_KBD_DEFAULTS, ARD_KBD_SHORTCUT_DEFAULTS, ARD_MODAL_DEFAULTS, ARD_NUMBER_INPUT_DEFAULTS, ARD_PASSWORD_INPUT_DEFAULTS, ARD_PROGRESS_BAR_DEFAULTS, ARD_PROGRESS_CIRCLE_DEFAULTS, ARD_RADIO_DEFAULTS, ARD_SEGMENT_DEFAULTS, ARD_SELECTABLE_CHIP_DEFAULTS, ARD_SELECT_DEFAULTS, ARD_SIMPLE_INPUT_DEFAULTS, ARD_SLIDER_DEFAULTS, ARD_SLIDE_TOGGLE_DEFAULTS, ARD_SNACKBAR_ANIMATION_LENGTH, ARD_SNACKBAR_DATA, ARD_SNACKBAR_DEFAULTS, ARD_SPINNER_DEFAULTS, ARD_STAR_BUTTON_DEFAULTS, ARD_STAR_DEFAULTS, ARD_STAR_DISPLAY_DEFAULTS, ARD_STAR_INPUT_DEFAULTS, ARD_STATEBOX_DEFAULTS, ARD_TABBER_DEFAULTS, ARD_TABLE_DEFAULTS, ARD_TABLE_FROM_CSV_DEFAULTS, ARD_TABLE_PAGINATION_DEFAULTS, ARD_TAB_DEFAULTS, ArdAddCustomTemplateDirective, ArdCalendarView, ArdDateInputAcceptButtonsTemplateDirective, ArdDateInputCalendarIconTemplateDirective, ArdDateInputMinMaxStrategy, ArdDateInputPrefixTemplateDirective, ArdDateInputSuffixTemplateDirective, ArdDateInputValueTemplateDirective, ArdDialogButtonsTemplateDirective, ArdDropdownFooterTemplateDirective, ArdDropdownHeaderTemplateDirective, ArdFileInputPlaceholderTemplateDirective, ArdFileInputPrefixTemplateDirective, ArdFileInputSuffixTemplateDirective, ArdFormFieldPrefixTemplateDirective, ArdFormFieldSuffixTemplateDirective, ArdHexInputPlaceholderTemplateDirective, ArdHexInputPrefixTemplateDirective, ArdHexInputSuffixTemplateDirective, ArdInputLoadingTemplateDirective, ArdInputPlaceholderTemplateDirective, ArdInputPrefixTemplateDirective, ArdInputSuffixTemplateDirective, ArdInputSuggestionTemplateDirective, ArdItemDisplayLimitTemplateDirective, ArdItemLimitReachedTemplateDirective, ArdLoadingPlaceholderTemplateDirective, ArdLoadingSpinnerTemplateDirective, ArdNoItemsFoundTemplateDirective, ArdNumberInputPlaceholderTemplateDirective, ArdOptgroupTemplateDirective, ArdOptionTemplateDirective, ArdPanelPosition, ArdPasswordInputPlaceholderTemplateDirective, ArdPasswordInputPrefixTemplateDirective, ArdPasswordInputRevealButtonTemplateDirective, ArdPasswordInputSuffixTemplateDirective, ArdProgressBarValueTemplateDirective, ArdProgressCircleValueTemplateDirective, searchFunctions as ArdSearchFunction, ArdSegmentOptionTemplateDirective, ArdSelectPlaceholderTemplateDirective, ArdSelectPrefixTemplateDirective, ArdSelectSuffixTemplateDirective, ArdSimpleInputPlaceholderTemplateDirective, ArdSimpleInputPrefixTemplateDirective, ArdSimpleInputSuffixTemplateDirective, ArdSlideToggleAppearance, ArdSliderTooltipDirective, ArdSnackbarAlignment, ArdSnackbarOriginRelation, ArdSnackbarQueueHandling, ArdSnackbarRef, ArdSnackbarType, ArdValueChipTemplateDirective, ArdValueTemplateDirective, ArdiumBadgeDirective, ArdiumBadgeModule, ArdiumButtonComponent, ArdiumButtonModule, ArdiumCalendarComponent, ArdiumCalendarModule, ArdiumCardActionButtonsDirective, ArdiumCardAvatarDirective, ArdiumCardComponent, ArdiumCardContentDirective, ArdiumCardDirective, ArdiumCardFooterDirective, ArdiumCardHeaderComponent, ArdiumCardImageDirective, ArdiumCardModule, ArdiumCardSubtitleDirective, ArdiumCardTitleDirective, ArdiumCheckboxComponent, ArdiumCheckboxListComponent, ArdiumCheckboxListModule, ArdiumCheckboxModule, ArdiumChipComponent, ArdiumChipModule, ArdiumColorDisplayComponent, ArdiumColorDisplayModule, ArdiumDateInputComponent, ArdiumDateInputModule, ArdiumDeletableChipComponent, ArdiumDialogComponent, ArdiumDialogModule, ArdiumDigitInputComponent, ArdiumDigitInputModule, ArdiumDividerComponent, ArdiumDividerModule, ArdiumDropdownPanelComponent, ArdiumDropdownPanelModule, ArdiumErrorComponent, ArdiumErrorDirective, ArdiumFabComponent, ArdiumFabModule, ArdiumFileDropAreaComponent, ArdiumFileDropAreaDragoverContentTemplateDirective, ArdiumFileDropAreaIdleContentTemplateDirective, ArdiumFileDropAreaModule, ArdiumFileDropAreaUploadedContentTemplateDirective, ArdiumFileInputComponent, ArdiumFileInputDragoverContentTemplateDirective, ArdiumFileInputIdleContentTemplateDirective, ArdiumFileInputModule, ArdiumFileInputUploadedContentTemplateDirective, ArdiumFormFieldComponent, ArdiumFormFieldFrameComponent, ArdiumFormFieldFrameModule, ArdiumFormFieldModule, ArdiumHexInputComponent, ArdiumHexInputModule, ArdiumHintComponent, ArdiumHintDirective, ArdiumHorizontalFormFieldComponent, ArdiumIconButtonComponent, ArdiumIconButtonModule, ArdiumIconComponent, ArdiumIconModule, ArdiumIconPipe, ArdiumInputComponent, ArdiumInputModule, ArdiumKbdComponent, ArdiumKbdDirective, ArdiumKbdModule, ArdiumKbdPipe, ArdiumKbdShortcutComponent, ArdiumKbdShortcutModule, ArdiumLabelComponent, ArdiumModalComponent, ArdiumModalModule, ArdiumNumberInputComponent, ArdiumNumberInputModule, ArdiumOptionComponent, ArdiumOptionModule, ArdiumPasswordInputComponent, ArdiumPasswordInputModule, ArdiumProgressBarComponent, ArdiumProgressBarModule, ArdiumProgressCircleComponent, ArdiumProgressCircleModule, ArdiumRadioComponent, ArdiumRadioGroupComponent, ArdiumRadioModule, ArdiumRangeSliderComponent, ArdiumRangeSliderModule, ArdiumSegmentComponent, ArdiumSegmentModule, ArdiumSelectComponent, ArdiumSelectModule, ArdiumSelectableChipComponent, ArdiumSimpleInputComponent, ArdiumSimpleInputModule, ArdiumSlideToggleComponent, ArdiumSlideToggleModule, ArdiumSliderComponent, ArdiumSliderModule, ArdiumSnackbarService, ArdiumSpinnerComponent, ArdiumSpinnerModule, ArdiumStarButtonComponent, ArdiumStarButtonModule, ArdiumStarComponent, ArdiumStarDisplayComponent, ArdiumStarDisplayModule, ArdiumStarInputComponent, ArdiumStarInputModule, ArdiumStarModule, ArdiumStateboxComponent, ArdiumStateboxModule, ArdiumTabComponent, ArdiumTabberComponent, ArdiumTabberModule, ArdiumTableCaptionTemplateDirective, ArdiumTableCheckboxTemplateDirective, ArdiumTableComponent, ArdiumTableFromCsvComponent, ArdiumTableFromCsvModule, ArdiumTableHeaderCheckboxTemplateDirective, ArdiumTableModule, ArdiumTablePaginationComponent, ArdiumTablePaginationModule, ArdiumTablePaginationTemplateDirective, ArdiumTableTemplateDirective, ArdiumTextListComponent, ArdiumTextListModule, ArdiumTextListPipe, BadgePosition, BadgeSize, ButtonAppearance, ButtonVariant, CardAppearance, CardVariant, CheckboxListAlignType, CheckboxState, ClickStrategy, ColorDisplayAppearance, ComponentColor, DecorationElementAppearance, DialogResult, DigitInputPrimitiveOption, DigitInputShape, DropdownPanelAppearance, DropdownPanelVariant, FabSize, FormElementAppearance, FormElementVariant, OneAxisAlignment, OutlinedAppearance, PaginationAlign, PanelAppearance, PanelVariant, ProgressBarAppearance, ProgressBarMode, ProgressBarSize, ProgressBarVariant, ProgressCircleAppearance, ProgressCircleVariant, SegmentAppearance, SegmentVariant, SimpleComponentColor, SimpleOneAxisAlignment, SliderDecorationPosition, SliderTooltipBehavior, SortType, StarColor, StarFillMode, TableAlignType, TableAppearance, TablePaginationStrategy, TableVariant, TransformType, _chipDefaults, _modalDefaults, provideBadgeDefaults, provideButtonDefaults, provideCalendarDefaults, provideCardDefaults, provideCheckboxDefaults, provideCheckboxListDefaults, provideChipDefaults, provideColorDisplayDefaults, provideDateInputDefaults, provideDeletableChipDefaults, provideDialogDefaults, provideDigitInputDefaults, provideDividerDefaults, provideDropdownPanelDefaults, provideFabDefaults, provideFileDropAreaDefaults, provideFileInputDefaults, provideFormFieldFrameDefaults, provideHexInputDefaults, provideIconButtonDefaults, provideIconDefaults, provideKbdDefaults, provideKbdShortcutDefaults, provideModalDefaults, provideNumberInputDefaults, providePasswordInputDefaults, provideProgressBarDefaults, provideProgressCircleDefaults, provideRadioDefaults, provideSegmentDefaults, provideSelectDefaults, provideSelectableChipDefaults, provideSimpleInputDefaults, provideSlideToggleDefaults, provideSliderDefaults, provideSnackbarDefaults, provideSpinnerDefaults, provideStarButtonDefaults, provideStarDefaults, provideStarDisplayDefaults, provideStarInputDefaults, provideStateboxDefaults, provideTabDefaults, provideTabberDefaults, provideTableDefaults, provideTableFromCsvDefaults, provideTablePaginationDefaults, searchInString };
|
|
11908
13734
|
//# sourceMappingURL=ardium-ui-ui.mjs.map
|