@ngneers/controls 0.0.1-pre1 → 0.0.1-pre2
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/LICENSE +21 -0
- package/fesm2022/ngneers-controls-accordion.mjs +194 -0
- package/fesm2022/ngneers-controls-accordion.mjs.map +1 -0
- package/fesm2022/ngneers-controls-api-ng.mjs +668 -0
- package/fesm2022/ngneers-controls-api-ng.mjs.map +1 -0
- package/fesm2022/ngneers-controls-api.mjs +256 -227
- package/fesm2022/ngneers-controls-api.mjs.map +1 -1
- package/fesm2022/ngneers-controls-avatar.mjs +70 -0
- package/fesm2022/ngneers-controls-avatar.mjs.map +1 -0
- package/fesm2022/ngneers-controls-base.mjs +397 -0
- package/fesm2022/ngneers-controls-base.mjs.map +1 -0
- package/fesm2022/ngneers-controls-breadcrumb.mjs +74 -0
- package/fesm2022/ngneers-controls-breadcrumb.mjs.map +1 -0
- package/fesm2022/ngneers-controls-button-group.mjs +51 -0
- package/fesm2022/ngneers-controls-button-group.mjs.map +1 -0
- package/fesm2022/ngneers-controls-button.mjs +62 -0
- package/fesm2022/ngneers-controls-button.mjs.map +1 -0
- package/fesm2022/ngneers-controls-calendar-time-C7UnIFzU.mjs +63 -0
- package/fesm2022/ngneers-controls-calendar-time-C7UnIFzU.mjs.map +1 -0
- package/fesm2022/ngneers-controls-calendar.mjs +468 -0
- package/fesm2022/ngneers-controls-calendar.mjs.map +1 -0
- package/fesm2022/ngneers-controls-checkbox.mjs +58 -0
- package/fesm2022/ngneers-controls-checkbox.mjs.map +1 -0
- package/fesm2022/ngneers-controls-chip.mjs +52 -0
- package/fesm2022/ngneers-controls-chip.mjs.map +1 -0
- package/fesm2022/ngneers-controls-defer.mjs +43 -0
- package/fesm2022/ngneers-controls-defer.mjs.map +1 -0
- package/fesm2022/ngneers-controls-dialog.mjs +329 -33
- package/fesm2022/ngneers-controls-dialog.mjs.map +1 -1
- package/fesm2022/ngneers-controls-directives.mjs +443 -0
- package/fesm2022/ngneers-controls-directives.mjs.map +1 -0
- package/fesm2022/ngneers-controls-drawer.mjs +232 -0
- package/fesm2022/ngneers-controls-drawer.mjs.map +1 -0
- package/fesm2022/ngneers-controls-edit-inplace.mjs +120 -0
- package/fesm2022/ngneers-controls-edit-inplace.mjs.map +1 -0
- package/fesm2022/ngneers-controls-filter.mjs +516 -0
- package/fesm2022/ngneers-controls-filter.mjs.map +1 -0
- package/fesm2022/ngneers-controls-i18n-de-CdTPeBiR.mjs +87 -0
- package/fesm2022/ngneers-controls-i18n-de-CdTPeBiR.mjs.map +1 -0
- package/fesm2022/ngneers-controls-i18n-en-Cfp2pOLY.mjs +87 -0
- package/fesm2022/ngneers-controls-i18n-en-Cfp2pOLY.mjs.map +1 -0
- package/fesm2022/ngneers-controls-i18n.mjs +57 -0
- package/fesm2022/ngneers-controls-i18n.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-calendar-z5xA9wTT.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-calendar-z5xA9wTT.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-check-DdAQ9k-T.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-check-DdAQ9k-T.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-chevron_down-HO-z-xOr.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-chevron_down-HO-z-xOr.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-chevron_left-CC5psi16.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-chevron_left-CC5psi16.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-chevron_right-BRxlzx4G.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-chevron_right-BRxlzx4G.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-chevron_up-cqhPO7g2.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-chevron_up-cqhPO7g2.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-ellipsis-DXIGA1sk.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-ellipsis-DXIGA1sk.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-filter-oU7E6Xgr.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-filter-oU7E6Xgr.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-filter_solid-CqIKuR4N.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-filter_solid-CqIKuR4N.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-magnifying_glass-T4Hzbkig.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-magnifying_glass-T4Hzbkig.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-minus-oGDEFO4E.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-minus-oGDEFO4E.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-sort-CRD4tafz.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-sort-CRD4tafz.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-sort_down-DiFB1P6R.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-sort_down-DiFB1P6R.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-sort_up-Bq_q3hIi.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-sort_up-Bq_q3hIi.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon-xmark-BZKZORiu.mjs +4 -0
- package/fesm2022/ngneers-controls-icon-xmark-BZKZORiu.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon.mjs +60 -18
- package/fesm2022/ngneers-controls-icon.mjs.map +1 -1
- package/fesm2022/ngneers-controls-inplace.mjs +107 -0
- package/fesm2022/ngneers-controls-inplace.mjs.map +1 -0
- package/fesm2022/ngneers-controls-input-field.mjs +141 -0
- package/fesm2022/ngneers-controls-input-field.mjs.map +1 -0
- package/fesm2022/ngneers-controls-input-mask.mjs +282 -0
- package/fesm2022/ngneers-controls-input-mask.mjs.map +1 -0
- package/fesm2022/ngneers-controls-input.mjs +69 -0
- package/fesm2022/ngneers-controls-input.mjs.map +1 -0
- package/fesm2022/ngneers-controls-item-view.mjs +441 -0
- package/fesm2022/ngneers-controls-item-view.mjs.map +1 -0
- package/fesm2022/ngneers-controls-list-box.mjs +157 -53
- package/fesm2022/ngneers-controls-list-box.mjs.map +1 -1
- package/fesm2022/ngneers-controls-menu.mjs +332 -0
- package/fesm2022/ngneers-controls-menu.mjs.map +1 -0
- package/fesm2022/ngneers-controls-message.mjs +29 -0
- package/fesm2022/ngneers-controls-message.mjs.map +1 -0
- package/fesm2022/ngneers-controls-paginator.mjs +111 -0
- package/fesm2022/ngneers-controls-paginator.mjs.map +1 -0
- package/fesm2022/ngneers-controls-popover.mjs +129 -40
- package/fesm2022/ngneers-controls-popover.mjs.map +1 -1
- package/fesm2022/ngneers-controls-progress.mjs +82 -0
- package/fesm2022/ngneers-controls-progress.mjs.map +1 -0
- package/fesm2022/ngneers-controls-scroller.mjs +155 -78
- package/fesm2022/ngneers-controls-scroller.mjs.map +1 -1
- package/fesm2022/ngneers-controls-select-button.mjs +55 -0
- package/fesm2022/ngneers-controls-select-button.mjs.map +1 -0
- package/fesm2022/ngneers-controls-select.mjs +313 -103
- package/fesm2022/ngneers-controls-select.mjs.map +1 -1
- package/fesm2022/ngneers-controls-slider.mjs +155 -0
- package/fesm2022/ngneers-controls-slider.mjs.map +1 -0
- package/fesm2022/ngneers-controls-spinner.mjs +169 -0
- package/fesm2022/ngneers-controls-spinner.mjs.map +1 -0
- package/fesm2022/ngneers-controls-splitter.mjs +717 -0
- package/fesm2022/ngneers-controls-splitter.mjs.map +1 -0
- package/fesm2022/ngneers-controls-switch.mjs +39 -0
- package/fesm2022/ngneers-controls-switch.mjs.map +1 -0
- package/fesm2022/ngneers-controls-table.mjs +379 -0
- package/fesm2022/ngneers-controls-table.mjs.map +1 -0
- package/fesm2022/ngneers-controls-tabs.mjs +287 -0
- package/fesm2022/ngneers-controls-tabs.mjs.map +1 -0
- package/fesm2022/ngneers-controls-tag.mjs +29 -0
- package/fesm2022/ngneers-controls-tag.mjs.map +1 -0
- package/fesm2022/ngneers-controls-toast.mjs +184 -0
- package/fesm2022/ngneers-controls-toast.mjs.map +1 -0
- package/fesm2022/ngneers-controls-toggle-button.mjs +65 -0
- package/fesm2022/ngneers-controls-toggle-button.mjs.map +1 -0
- package/fesm2022/ngneers-controls-tooltip.mjs +454 -0
- package/fesm2022/ngneers-controls-tooltip.mjs.map +1 -0
- package/fesm2022/ngneers-controls-utils-ng.mjs +227 -0
- package/fesm2022/ngneers-controls-utils-ng.mjs.map +1 -0
- package/fesm2022/ngneers-controls-utils.mjs +217 -60
- package/fesm2022/ngneers-controls-utils.mjs.map +1 -1
- package/fesm2022/ngneers-controls.mjs.map +1 -1
- package/package.json +167 -32
- package/types/ngneers-controls-accordion.d.ts +114 -0
- package/types/ngneers-controls-api-ng.d.ts +291 -0
- package/types/ngneers-controls-api.d.ts +99 -0
- package/types/ngneers-controls-avatar.d.ts +50 -0
- package/types/ngneers-controls-base.d.ts +166 -0
- package/types/ngneers-controls-breadcrumb.d.ts +86 -0
- package/types/ngneers-controls-button-group.d.ts +30 -0
- package/types/ngneers-controls-button.d.ts +34 -0
- package/types/ngneers-controls-calendar.d.ts +275 -0
- package/types/ngneers-controls-checkbox.d.ts +38 -0
- package/types/ngneers-controls-chip.d.ts +37 -0
- package/types/ngneers-controls-defer.d.ts +22 -0
- package/types/ngneers-controls-dialog.d.ts +218 -0
- package/types/ngneers-controls-directives.d.ts +146 -0
- package/types/ngneers-controls-drawer.d.ts +220 -0
- package/types/ngneers-controls-edit-inplace.d.ts +182 -0
- package/types/ngneers-controls-filter.d.ts +304 -0
- package/types/ngneers-controls-i18n.d.ts +108 -0
- package/types/ngneers-controls-icon.d.ts +74 -0
- package/types/ngneers-controls-inplace.d.ts +95 -0
- package/types/ngneers-controls-input-field.d.ts +159 -0
- package/types/ngneers-controls-input-mask.d.ts +83 -0
- package/types/ngneers-controls-input.d.ts +27 -0
- package/types/ngneers-controls-item-view.d.ts +211 -0
- package/types/ngneers-controls-list-box.d.ts +216 -0
- package/types/ngneers-controls-menu.d.ts +178 -0
- package/types/ngneers-controls-message.d.ts +19 -0
- package/types/ngneers-controls-paginator.d.ts +162 -0
- package/types/ngneers-controls-popover.d.ts +101 -0
- package/types/ngneers-controls-progress.d.ts +44 -0
- package/types/ngneers-controls-scroller.d.ts +137 -0
- package/types/ngneers-controls-select-button.d.ts +37 -0
- package/types/ngneers-controls-select.d.ts +314 -0
- package/types/ngneers-controls-slider.d.ts +53 -0
- package/types/ngneers-controls-spinner.d.ts +105 -0
- package/types/ngneers-controls-splitter.d.ts +391 -0
- package/types/ngneers-controls-switch.d.ts +18 -0
- package/types/ngneers-controls-table.d.ts +157 -0
- package/types/ngneers-controls-tabs.d.ts +106 -0
- package/types/ngneers-controls-tag.d.ts +19 -0
- package/types/ngneers-controls-toast.d.ts +70 -0
- package/types/ngneers-controls-toggle-button.d.ts +46 -0
- package/types/ngneers-controls-tooltip.d.ts +188 -0
- package/types/ngneers-controls-utils-ng.d.ts +57 -0
- package/types/ngneers-controls-utils.d.ts +130 -0
- package/api/index.d.ts +0 -134
- package/custom-types/index.d.ts +0 -7
- package/dialog/index.d.ts +0 -43
- package/fesm2022/ngneers-controls-custom-types.mjs +0 -4
- package/fesm2022/ngneers-controls-custom-types.mjs.map +0 -1
- package/fesm2022/ngneers-controls-form-field.mjs +0 -33
- package/fesm2022/ngneers-controls-form-field.mjs.map +0 -1
- package/fesm2022/ngneers-controls-lazy-cacher.mjs +0 -30
- package/fesm2022/ngneers-controls-lazy-cacher.mjs.map +0 -1
- package/fesm2022/ngneers-controls-text-field.mjs +0 -23
- package/fesm2022/ngneers-controls-text-field.mjs.map +0 -1
- package/form-field/index.d.ts +0 -19
- package/icon/index.d.ts +0 -30
- package/lazy-cacher/index.d.ts +0 -14
- package/list-box/index.d.ts +0 -58
- package/popover/index.d.ts +0 -41
- package/scroller/index.d.ts +0 -95
- package/select/index.d.ts +0 -86
- package/text-field/index.d.ts +0 -10
- package/utils/index.d.ts +0 -36
- /package/{index.d.ts → types/ngneers-controls.d.ts} +0 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { viewChild, contentChild, input, computed, Directive, output, inject, viewChildren, ChangeDetectionStrategy, Component, booleanAttribute, linkedSignal } from '@angular/core';
|
|
4
|
+
import { templateTypesFn, Platform, NgnTemplate } from '@ngneers/controls/api/ng';
|
|
5
|
+
import { ValueControlBase, NgnPt, provideSelf } from '@ngneers/controls/base';
|
|
6
|
+
import { I18n } from '@ngneers/controls/i18n';
|
|
7
|
+
import { NgnIcon } from '@ngneers/controls/icon';
|
|
8
|
+
import { NgnInput } from '@ngneers/controls/input';
|
|
9
|
+
import { NgnInputField } from '@ngneers/controls/input-field';
|
|
10
|
+
import { NgnPopover } from '@ngneers/controls/popover';
|
|
11
|
+
import { throwExp, NgnError } from '@ngneers/controls/utils';
|
|
12
|
+
import { calendarControlTemplate } from '@ngneers/controls-themes/templates/calendar';
|
|
13
|
+
import { NgnButton } from '@ngneers/controls/button';
|
|
14
|
+
|
|
15
|
+
class CalendarTemplates extends ValueControlBase {
|
|
16
|
+
// Day template
|
|
17
|
+
_defaultDayTemplate = viewChild.required('defaultDayTemplate');
|
|
18
|
+
_userDayTemplate = contentChild('day', ...(ngDevMode ? [{ debugName: "_userDayTemplate" }] : []));
|
|
19
|
+
/**
|
|
20
|
+
* Set a custom template for a day.
|
|
21
|
+
* Can also be set using an `<ng-template>` element with `#day` template reference variable.
|
|
22
|
+
*/
|
|
23
|
+
templateDay = input(null, ...(ngDevMode ? [{ debugName: "templateDay" }] : []));
|
|
24
|
+
dayTemplate = computed(() => this._userDayTemplate() ?? this.templateDay() ?? this._defaultDayTemplate(), ...(ngDevMode ? [{ debugName: "dayTemplate" }] : []));
|
|
25
|
+
// Week day template
|
|
26
|
+
_defaultWeekDayTemplate = viewChild.required('defaultWeekDayTemplate');
|
|
27
|
+
_userWeekDayTemplate = contentChild('weekDay', ...(ngDevMode ? [{ debugName: "_userWeekDayTemplate" }] : []));
|
|
28
|
+
/**
|
|
29
|
+
* Set a custom template for a week day.
|
|
30
|
+
* Can also be set using an `<ng-template>` element with `#weekDay` template reference variable.
|
|
31
|
+
*/
|
|
32
|
+
templateWeekDay = input(null, ...(ngDevMode ? [{ debugName: "templateWeekDay" }] : []));
|
|
33
|
+
weekDayTemplate = computed(() => this._userWeekDayTemplate() ?? this.templateWeekDay() ?? this._defaultWeekDayTemplate(), ...(ngDevMode ? [{ debugName: "weekDayTemplate" }] : []));
|
|
34
|
+
// Month template
|
|
35
|
+
_defaultMonthTemplate = viewChild.required('defaultMonthTemplate');
|
|
36
|
+
_userMonthTemplate = contentChild('month', ...(ngDevMode ? [{ debugName: "_userMonthTemplate" }] : []));
|
|
37
|
+
/**
|
|
38
|
+
* Set a custom template for a month.
|
|
39
|
+
* Can also be set using an `<ng-template>` element with `#month` template reference variable.
|
|
40
|
+
*/
|
|
41
|
+
templateMonth = input(null, ...(ngDevMode ? [{ debugName: "templateMonth" }] : []));
|
|
42
|
+
monthTemplate = computed(() => this._userMonthTemplate() ?? this.templateMonth() ?? this._defaultMonthTemplate(), ...(ngDevMode ? [{ debugName: "monthTemplate" }] : []));
|
|
43
|
+
// Time template
|
|
44
|
+
_defaultTimeTemplate = viewChild.required('defaultTimeTemplate');
|
|
45
|
+
_userTimeTemplate = contentChild('time', ...(ngDevMode ? [{ debugName: "_userTimeTemplate" }] : []));
|
|
46
|
+
/**
|
|
47
|
+
* Set a custom template for the time input.
|
|
48
|
+
* Can also be set using an `<ng-template>` element with `#time` template reference variable.
|
|
49
|
+
*/
|
|
50
|
+
templateTime = input(null, ...(ngDevMode ? [{ debugName: "templateTime" }] : []));
|
|
51
|
+
timeTemplate = computed(() => this._userTimeTemplate() ?? this.templateTime() ?? this._defaultTimeTemplate(), ...(ngDevMode ? [{ debugName: "timeTemplate" }] : []));
|
|
52
|
+
// Year template
|
|
53
|
+
_defaultYearTemplate = viewChild.required('defaultYearTemplate');
|
|
54
|
+
_userYearTemplate = contentChild('year', ...(ngDevMode ? [{ debugName: "_userYearTemplate" }] : []));
|
|
55
|
+
/**
|
|
56
|
+
* Set a custom template for the year input.
|
|
57
|
+
* Can also be set using an `<ng-template>` element with `#year` template reference variable.
|
|
58
|
+
*/
|
|
59
|
+
templateYear = input(null, ...(ngDevMode ? [{ debugName: "templateYear" }] : []));
|
|
60
|
+
yearTemplate = computed(() => this._userYearTemplate() ?? this.templateYear() ?? this._defaultYearTemplate(), ...(ngDevMode ? [{ debugName: "yearTemplate" }] : []));
|
|
61
|
+
/**
|
|
62
|
+
* Types for the calendar templates.
|
|
63
|
+
*/
|
|
64
|
+
templateTypes = templateTypesFn();
|
|
65
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CalendarTemplates, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
66
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.0", type: CalendarTemplates, isStandalone: true, inputs: { templateDay: { classPropertyName: "templateDay", publicName: "templateDay", isSignal: true, isRequired: false, transformFunction: null }, templateWeekDay: { classPropertyName: "templateWeekDay", publicName: "templateWeekDay", isSignal: true, isRequired: false, transformFunction: null }, templateMonth: { classPropertyName: "templateMonth", publicName: "templateMonth", isSignal: true, isRequired: false, transformFunction: null }, templateTime: { classPropertyName: "templateTime", publicName: "templateTime", isSignal: true, isRequired: false, transformFunction: null }, templateYear: { classPropertyName: "templateYear", publicName: "templateYear", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_userDayTemplate", first: true, predicate: ["day"], descendants: true, isSignal: true }, { propertyName: "_userWeekDayTemplate", first: true, predicate: ["weekDay"], descendants: true, isSignal: true }, { propertyName: "_userMonthTemplate", first: true, predicate: ["month"], descendants: true, isSignal: true }, { propertyName: "_userTimeTemplate", first: true, predicate: ["time"], descendants: true, isSignal: true }, { propertyName: "_userYearTemplate", first: true, predicate: ["year"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_defaultDayTemplate", first: true, predicate: ["defaultDayTemplate"], descendants: true, isSignal: true }, { propertyName: "_defaultWeekDayTemplate", first: true, predicate: ["defaultWeekDayTemplate"], descendants: true, isSignal: true }, { propertyName: "_defaultMonthTemplate", first: true, predicate: ["defaultMonthTemplate"], descendants: true, isSignal: true }, { propertyName: "_defaultTimeTemplate", first: true, predicate: ["defaultTimeTemplate"], descendants: true, isSignal: true }, { propertyName: "_defaultYearTemplate", first: true, predicate: ["defaultYearTemplate"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
|
|
67
|
+
}
|
|
68
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CalendarTemplates, decorators: [{
|
|
69
|
+
type: Directive
|
|
70
|
+
}], propDecorators: { _defaultDayTemplate: [{ type: i0.ViewChild, args: ['defaultDayTemplate', { isSignal: true }] }], _userDayTemplate: [{ type: i0.ContentChild, args: ['day', { isSignal: true }] }], templateDay: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateDay", required: false }] }], _defaultWeekDayTemplate: [{ type: i0.ViewChild, args: ['defaultWeekDayTemplate', { isSignal: true }] }], _userWeekDayTemplate: [{ type: i0.ContentChild, args: ['weekDay', { isSignal: true }] }], templateWeekDay: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateWeekDay", required: false }] }], _defaultMonthTemplate: [{ type: i0.ViewChild, args: ['defaultMonthTemplate', { isSignal: true }] }], _userMonthTemplate: [{ type: i0.ContentChild, args: ['month', { isSignal: true }] }], templateMonth: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateMonth", required: false }] }], _defaultTimeTemplate: [{ type: i0.ViewChild, args: ['defaultTimeTemplate', { isSignal: true }] }], _userTimeTemplate: [{ type: i0.ContentChild, args: ['time', { isSignal: true }] }], templateTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateTime", required: false }] }], _defaultYearTemplate: [{ type: i0.ViewChild, args: ['defaultYearTemplate', { isSignal: true }] }], _userYearTemplate: [{ type: i0.ContentChild, args: ['year', { isSignal: true }] }], templateYear: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateYear", required: false }] }] } });
|
|
71
|
+
|
|
72
|
+
const MONTHS = [
|
|
73
|
+
'january',
|
|
74
|
+
'february',
|
|
75
|
+
'march',
|
|
76
|
+
'april',
|
|
77
|
+
'may',
|
|
78
|
+
'june',
|
|
79
|
+
'july',
|
|
80
|
+
'august',
|
|
81
|
+
'september',
|
|
82
|
+
'october',
|
|
83
|
+
'november',
|
|
84
|
+
'december',
|
|
85
|
+
];
|
|
86
|
+
const WEEK_DAYS = [
|
|
87
|
+
'sunday',
|
|
88
|
+
'monday',
|
|
89
|
+
'tuesday',
|
|
90
|
+
'wednesday',
|
|
91
|
+
'thursday',
|
|
92
|
+
'friday',
|
|
93
|
+
'saturday',
|
|
94
|
+
];
|
|
95
|
+
|
|
96
|
+
// Configuration: Number of weeks to show before and after the current month
|
|
97
|
+
const WEEKS_BEFORE = 1;
|
|
98
|
+
const WEEKS_AFTER = 1;
|
|
99
|
+
class CalendarDays {
|
|
100
|
+
component = input.required(...(ngDevMode ? [{ debugName: "component" }] : []));
|
|
101
|
+
theme = input.required(...(ngDevMode ? [{ debugName: "theme" }] : []));
|
|
102
|
+
year = input.required(...(ngDevMode ? [{ debugName: "year" }] : []));
|
|
103
|
+
month = input.required(...(ngDevMode ? [{ debugName: "month" }] : []));
|
|
104
|
+
currentValue = input.required(...(ngDevMode ? [{ debugName: "currentValue" }] : []));
|
|
105
|
+
firstDayOfWeek = input.required(...(ngDevMode ? [{ debugName: "firstDayOfWeek" }] : []));
|
|
106
|
+
dayTemplate = input.required(...(ngDevMode ? [{ debugName: "dayTemplate" }] : []));
|
|
107
|
+
weekDayTemplate = input.required(...(ngDevMode ? [{ debugName: "weekDayTemplate" }] : []));
|
|
108
|
+
timeTemplate = input.required(...(ngDevMode ? [{ debugName: "timeTemplate" }] : []));
|
|
109
|
+
yearTemplate = input.required(...(ngDevMode ? [{ debugName: "yearTemplate" }] : []));
|
|
110
|
+
monthTemplate = input.required(...(ngDevMode ? [{ debugName: "monthTemplate" }] : []));
|
|
111
|
+
showTime = input.required(...(ngDevMode ? [{ debugName: "showTime" }] : []));
|
|
112
|
+
showSeconds = input.required(...(ngDevMode ? [{ debugName: "showSeconds" }] : []));
|
|
113
|
+
previousMonth = output();
|
|
114
|
+
nextMonth = output();
|
|
115
|
+
daySelected = output();
|
|
116
|
+
yearSelected = output();
|
|
117
|
+
monthSelected = output();
|
|
118
|
+
timeChanged = output();
|
|
119
|
+
MONTHS = MONTHS;
|
|
120
|
+
i18n = inject(I18n).translations;
|
|
121
|
+
todaysDay = new Date().getDate();
|
|
122
|
+
todaysMonth = new Date().getMonth();
|
|
123
|
+
todaysYear = new Date().getFullYear();
|
|
124
|
+
doTimeChange = (t) => this.timeChanged.emit(t);
|
|
125
|
+
doYearChange = (t) => this.yearSelected.emit(t);
|
|
126
|
+
doMonthChange = (t) => this.monthSelected.emit(t);
|
|
127
|
+
weekDaysSorted = computed(() => WEEK_DAYS.slice(this._firstDayOfWeekIndex())
|
|
128
|
+
.concat(WEEK_DAYS.slice(0, this._firstDayOfWeekIndex()))
|
|
129
|
+
.map(day => ({
|
|
130
|
+
weekDay: day,
|
|
131
|
+
translation: this.i18n[`calendar_weekdaysShort_${day}`],
|
|
132
|
+
})), ...(ngDevMode ? [{ debugName: "weekDaysSorted" }] : []));
|
|
133
|
+
_dayButton = viewChildren('dayButton', ...(ngDevMode ? [{ debugName: "_dayButton" }] : []));
|
|
134
|
+
_firstDayOfWeekIndex = computed(() => WEEK_DAYS.indexOf(this.firstDayOfWeek()), ...(ngDevMode ? [{ debugName: "_firstDayOfWeekIndex" }] : []));
|
|
135
|
+
_daysInMonth = computed(() => new Date(this.year(), this.month() + 1, 0).getDate(), ...(ngDevMode ? [{ debugName: "_daysInMonth" }] : []));
|
|
136
|
+
_daysInPreviousMonth = computed(() => new Date(this.year(), this.month(), 0).getDate(), ...(ngDevMode ? [{ debugName: "_daysInPreviousMonth" }] : []));
|
|
137
|
+
_firstDayOfMonth = computed(() => new Date(this.year(), this.month(), 1).getDay(), ...(ngDevMode ? [{ debugName: "_firstDayOfMonth" }] : []));
|
|
138
|
+
monthModel = computed(() => {
|
|
139
|
+
const firstDayOfMonth = this._firstDayOfMonth();
|
|
140
|
+
const firstDayOfWeek = this._firstDayOfWeekIndex();
|
|
141
|
+
const daysInMonth = this._daysInMonth();
|
|
142
|
+
const daysInPreviousMonth = this._daysInPreviousMonth();
|
|
143
|
+
// Calculate starting point and total days needed
|
|
144
|
+
const firstDayOffset = (firstDayOfMonth - firstDayOfWeek + 7) % 7;
|
|
145
|
+
const daysFromPreviousMonth = firstDayOffset + WEEKS_BEFORE * 7;
|
|
146
|
+
const daysToNextMonth = (7 - ((daysFromPreviousMonth + daysInMonth) % 7)) % 7;
|
|
147
|
+
const totalDays = daysFromPreviousMonth + daysInMonth + daysToNextMonth + WEEKS_AFTER * 7;
|
|
148
|
+
const startDay = daysInPreviousMonth - daysFromPreviousMonth + 1;
|
|
149
|
+
// Build all days in one pass
|
|
150
|
+
const allDays = [];
|
|
151
|
+
let currentDate = startDay;
|
|
152
|
+
let currentMonth = -1; // -1 = previous, 0 = current, 1 = next
|
|
153
|
+
for (let i = 0; i < totalDays; i++) {
|
|
154
|
+
// Determine which month we're in
|
|
155
|
+
if (currentDate > daysInPreviousMonth && currentMonth === -1) {
|
|
156
|
+
currentDate = 1;
|
|
157
|
+
currentMonth = 0;
|
|
158
|
+
}
|
|
159
|
+
else if (currentDate > daysInMonth && currentMonth === 0) {
|
|
160
|
+
currentDate = 1;
|
|
161
|
+
currentMonth = 1;
|
|
162
|
+
}
|
|
163
|
+
allDays.push({
|
|
164
|
+
date: currentDate,
|
|
165
|
+
monthOffset: currentMonth,
|
|
166
|
+
});
|
|
167
|
+
currentDate++;
|
|
168
|
+
}
|
|
169
|
+
// Group into weeks
|
|
170
|
+
const weeks = [];
|
|
171
|
+
for (let i = 0; i < allDays.length; i += 7) {
|
|
172
|
+
weeks.push({
|
|
173
|
+
days: allDays.slice(i, i + 7),
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
return { weeks };
|
|
177
|
+
}, ...(ngDevMode ? [{ debugName: "monthModel" }] : []));
|
|
178
|
+
tabFocusDay = computed(() => {
|
|
179
|
+
const val = this.currentValue();
|
|
180
|
+
if (val && val.getMonth() === this.month() && val.getFullYear() === this.year()) {
|
|
181
|
+
return val.getDate();
|
|
182
|
+
}
|
|
183
|
+
return 1;
|
|
184
|
+
}, ...(ngDevMode ? [{ debugName: "tabFocusDay" }] : []));
|
|
185
|
+
prev() {
|
|
186
|
+
this.previousMonth.emit();
|
|
187
|
+
}
|
|
188
|
+
next() {
|
|
189
|
+
this.nextMonth.emit();
|
|
190
|
+
}
|
|
191
|
+
selectYear(year) {
|
|
192
|
+
this.yearSelected.emit(year);
|
|
193
|
+
}
|
|
194
|
+
dayKeydown(event, day) {
|
|
195
|
+
if (['ArrowRight', 'ArrowLeft', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
|
|
196
|
+
event.preventDefault();
|
|
197
|
+
const getCurrentMonthButtons = () => {
|
|
198
|
+
return this._dayButton()
|
|
199
|
+
.map(ref => ref.nativeElement)
|
|
200
|
+
.filter(x => !x.classList.contains(this.theme().class('day-other-month')));
|
|
201
|
+
};
|
|
202
|
+
const allDayButtons = getCurrentMonthButtons();
|
|
203
|
+
const index = allDayButtons.indexOf(day);
|
|
204
|
+
const daysInMonth = this._daysInMonth();
|
|
205
|
+
if (event.key === 'ArrowRight') {
|
|
206
|
+
if (index < daysInMonth - 1) {
|
|
207
|
+
allDayButtons[index + 1]?.focus();
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
this.next();
|
|
211
|
+
setTimeout(() => {
|
|
212
|
+
getCurrentMonthButtons()[0]?.focus();
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else if (event.key === 'ArrowLeft') {
|
|
217
|
+
if (index > 0) {
|
|
218
|
+
allDayButtons[index - 1]?.focus();
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
this.prev();
|
|
222
|
+
setTimeout(() => {
|
|
223
|
+
const buttons = getCurrentMonthButtons();
|
|
224
|
+
buttons[buttons.length - 1]?.focus();
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
else if (event.key === 'ArrowDown') {
|
|
229
|
+
if (index < daysInMonth - 7) {
|
|
230
|
+
allDayButtons[index + 7]?.focus();
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
this.next();
|
|
234
|
+
const nextIndex = (index + 7) % daysInMonth;
|
|
235
|
+
setTimeout(() => {
|
|
236
|
+
getCurrentMonthButtons()[nextIndex]?.focus();
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
else if (event.key === 'ArrowUp') {
|
|
241
|
+
if (index >= 7) {
|
|
242
|
+
allDayButtons[index - 7]?.focus();
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
this.prev();
|
|
246
|
+
setTimeout(() => {
|
|
247
|
+
const buttons = getCurrentMonthButtons();
|
|
248
|
+
const targetIndex = Math.min(buttons.length - 7 + index, buttons.length - 1);
|
|
249
|
+
buttons[targetIndex]?.focus();
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CalendarDays, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
256
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: CalendarDays, isStandalone: true, selector: "ngn-calendar-days", inputs: { component: { classPropertyName: "component", publicName: "component", isSignal: true, isRequired: true, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: true, transformFunction: null }, year: { classPropertyName: "year", publicName: "year", isSignal: true, isRequired: true, transformFunction: null }, month: { classPropertyName: "month", publicName: "month", isSignal: true, isRequired: true, transformFunction: null }, currentValue: { classPropertyName: "currentValue", publicName: "currentValue", isSignal: true, isRequired: true, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: true, transformFunction: null }, dayTemplate: { classPropertyName: "dayTemplate", publicName: "dayTemplate", isSignal: true, isRequired: true, transformFunction: null }, weekDayTemplate: { classPropertyName: "weekDayTemplate", publicName: "weekDayTemplate", isSignal: true, isRequired: true, transformFunction: null }, timeTemplate: { classPropertyName: "timeTemplate", publicName: "timeTemplate", isSignal: true, isRequired: true, transformFunction: null }, yearTemplate: { classPropertyName: "yearTemplate", publicName: "yearTemplate", isSignal: true, isRequired: true, transformFunction: null }, monthTemplate: { classPropertyName: "monthTemplate", publicName: "monthTemplate", isSignal: true, isRequired: true, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: true, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { previousMonth: "previousMonth", nextMonth: "nextMonth", daySelected: "daySelected", yearSelected: "yearSelected", monthSelected: "monthSelected", timeChanged: "timeChanged" }, viewQueries: [{ propertyName: "_dayButton", predicate: ["dayButton"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [ptInt]=\"component()\" [ptClass]=\"'details'\">\r\n <div [ptInt]=\"component()\" [ptClass]=\"'header'\">\r\n <div [ptInt]=\"component()\" [ptClass]=\"'navigation'\">\r\n <button\r\n ngnButton\r\n [kind]=\"'icon'\"\r\n [ptInt]=\"component()\"\r\n [ptClass]=\"'previous'\"\r\n (click)=\"prev()\"\r\n >\r\n <ngn-icon [defaultIcon]=\"'chevron_left'\" />\r\n </button>\r\n <button ngnButton [kind]=\"'icon'\" [ptInt]=\"component()\" [ptClass]=\"'next'\" (click)=\"next()\">\r\n <ngn-icon [defaultIcon]=\"'chevron_right'\" />\r\n </button>\r\n </div>\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n monthTemplate();\r\n context: {\r\n $implicit: {\r\n month: MONTHS[month()],\r\n change: doMonthChange,\r\n },\r\n }\r\n \"\r\n />\r\n\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n yearTemplate();\r\n context: {\r\n $implicit: {\r\n year: year(),\r\n change: doYearChange,\r\n },\r\n }\r\n \"\r\n />\r\n </div>\r\n <div class=\"ngn-calendar-days\">\r\n @for (weekDay of weekDaysSorted(); track weekDay) {\r\n <span [ptInt]=\"component()\" [ptClass]=\"'week-day'\">\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n weekDayTemplate();\r\n context: {\r\n $implicit: {\r\n weekDay: weekDay.weekDay,\r\n translation: weekDay.translation(),\r\n },\r\n }\r\n \"\r\n />\r\n </span>\r\n }\r\n @for (item of monthModel().weeks; track $index) {\r\n @for (day of item.days; track $index) {\r\n <button\r\n #dayButton\r\n [ptInt]=\"component()\"\r\n [ptClass]=\"{\r\n day: true,\r\n 'day-other-month': day.monthOffset !== 0,\r\n 'day-today':\r\n todaysMonth === month() + day.monthOffset &&\r\n todaysDay === day.date &&\r\n todaysYear === year(),\r\n 'day-selected':\r\n currentValue()?.getDate() === day.date &&\r\n currentValue()?.getMonth() === month() + day.monthOffset &&\r\n currentValue()?.getFullYear() === year(),\r\n }\"\r\n [tabIndex]=\"!day.monthOffset && tabFocusDay() === day.date ? 0 : -1\"\r\n type=\"button\"\r\n (click)=\"\r\n daySelected.emit({\r\n date: day.date,\r\n monthOffset: day.monthOffset,\r\n })\r\n \"\r\n (keydown)=\"dayKeydown($event, dayButton)\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n dayTemplate();\r\n context: {\r\n $implicit: {\r\n date: day.date,\r\n fromOtherMonth: day.monthOffset !== 0,\r\n selected:\r\n currentValue()?.getDate() === day.date &&\r\n currentValue()?.getMonth() === month() + day.monthOffset &&\r\n currentValue()?.getFullYear() === year(),\r\n today:\r\n todaysMonth === month() + day.monthOffset &&\r\n todaysDay === day.date &&\r\n todaysYear === year(),\r\n },\r\n }\r\n \"\r\n />\r\n </button>\r\n }\r\n }\r\n </div>\r\n @if (showTime()) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n timeTemplate();\r\n context: {\r\n $implicit: { time: currentValue(), showSeconds: showSeconds(), change: doTimeChange },\r\n }\r\n \"\r\n />\r\n }\r\n</div>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgnPt, selector: "[ptInt]", inputs: ["ptInt", "ptClass"] }, { kind: "directive", type: NgnButton, selector: "button[ngnButton], a[ngnButton]", inputs: ["inline"] }, { kind: "component", type: NgnIcon, selector: "ngn-icon", inputs: ["defaultIcon", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
257
|
+
}
|
|
258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CalendarDays, decorators: [{
|
|
259
|
+
type: Component,
|
|
260
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ngn-calendar-days', imports: [NgTemplateOutlet, NgnPt, NgnButton, NgnIcon], template: "<div [ptInt]=\"component()\" [ptClass]=\"'details'\">\r\n <div [ptInt]=\"component()\" [ptClass]=\"'header'\">\r\n <div [ptInt]=\"component()\" [ptClass]=\"'navigation'\">\r\n <button\r\n ngnButton\r\n [kind]=\"'icon'\"\r\n [ptInt]=\"component()\"\r\n [ptClass]=\"'previous'\"\r\n (click)=\"prev()\"\r\n >\r\n <ngn-icon [defaultIcon]=\"'chevron_left'\" />\r\n </button>\r\n <button ngnButton [kind]=\"'icon'\" [ptInt]=\"component()\" [ptClass]=\"'next'\" (click)=\"next()\">\r\n <ngn-icon [defaultIcon]=\"'chevron_right'\" />\r\n </button>\r\n </div>\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n monthTemplate();\r\n context: {\r\n $implicit: {\r\n month: MONTHS[month()],\r\n change: doMonthChange,\r\n },\r\n }\r\n \"\r\n />\r\n\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n yearTemplate();\r\n context: {\r\n $implicit: {\r\n year: year(),\r\n change: doYearChange,\r\n },\r\n }\r\n \"\r\n />\r\n </div>\r\n <div class=\"ngn-calendar-days\">\r\n @for (weekDay of weekDaysSorted(); track weekDay) {\r\n <span [ptInt]=\"component()\" [ptClass]=\"'week-day'\">\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n weekDayTemplate();\r\n context: {\r\n $implicit: {\r\n weekDay: weekDay.weekDay,\r\n translation: weekDay.translation(),\r\n },\r\n }\r\n \"\r\n />\r\n </span>\r\n }\r\n @for (item of monthModel().weeks; track $index) {\r\n @for (day of item.days; track $index) {\r\n <button\r\n #dayButton\r\n [ptInt]=\"component()\"\r\n [ptClass]=\"{\r\n day: true,\r\n 'day-other-month': day.monthOffset !== 0,\r\n 'day-today':\r\n todaysMonth === month() + day.monthOffset &&\r\n todaysDay === day.date &&\r\n todaysYear === year(),\r\n 'day-selected':\r\n currentValue()?.getDate() === day.date &&\r\n currentValue()?.getMonth() === month() + day.monthOffset &&\r\n currentValue()?.getFullYear() === year(),\r\n }\"\r\n [tabIndex]=\"!day.monthOffset && tabFocusDay() === day.date ? 0 : -1\"\r\n type=\"button\"\r\n (click)=\"\r\n daySelected.emit({\r\n date: day.date,\r\n monthOffset: day.monthOffset,\r\n })\r\n \"\r\n (keydown)=\"dayKeydown($event, dayButton)\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n dayTemplate();\r\n context: {\r\n $implicit: {\r\n date: day.date,\r\n fromOtherMonth: day.monthOffset !== 0,\r\n selected:\r\n currentValue()?.getDate() === day.date &&\r\n currentValue()?.getMonth() === month() + day.monthOffset &&\r\n currentValue()?.getFullYear() === year(),\r\n today:\r\n todaysMonth === month() + day.monthOffset &&\r\n todaysDay === day.date &&\r\n todaysYear === year(),\r\n },\r\n }\r\n \"\r\n />\r\n </button>\r\n }\r\n }\r\n </div>\r\n @if (showTime()) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n timeTemplate();\r\n context: {\r\n $implicit: { time: currentValue(), showSeconds: showSeconds(), change: doTimeChange },\r\n }\r\n \"\r\n />\r\n }\r\n</div>\r\n" }]
|
|
261
|
+
}], propDecorators: { component: [{ type: i0.Input, args: [{ isSignal: true, alias: "component", required: true }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: true }] }], year: [{ type: i0.Input, args: [{ isSignal: true, alias: "year", required: true }] }], month: [{ type: i0.Input, args: [{ isSignal: true, alias: "month", required: true }] }], currentValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentValue", required: true }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: true }] }], dayTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "dayTemplate", required: true }] }], weekDayTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekDayTemplate", required: true }] }], timeTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeTemplate", required: true }] }], yearTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "yearTemplate", required: true }] }], monthTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "monthTemplate", required: true }] }], showTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTime", required: true }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: true }] }], previousMonth: [{ type: i0.Output, args: ["previousMonth"] }], nextMonth: [{ type: i0.Output, args: ["nextMonth"] }], daySelected: [{ type: i0.Output, args: ["daySelected"] }], yearSelected: [{ type: i0.Output, args: ["yearSelected"] }], monthSelected: [{ type: i0.Output, args: ["monthSelected"] }], timeChanged: [{ type: i0.Output, args: ["timeChanged"] }], _dayButton: [{ type: i0.ViewChildren, args: ['dayButton', { isSignal: true }] }] } });
|
|
262
|
+
|
|
263
|
+
function generateYearOptions() {
|
|
264
|
+
const MAX_ITEMS = 200;
|
|
265
|
+
const currentYear = new Date().getFullYear();
|
|
266
|
+
return Array.from({ length: MAX_ITEMS }, (_, i) => ({
|
|
267
|
+
label: (currentYear - MAX_ITEMS / 2 + i).toString(),
|
|
268
|
+
value: currentYear - MAX_ITEMS / 2 + i,
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* @category control
|
|
273
|
+
*/
|
|
274
|
+
class NgnCalendar extends CalendarTemplates {
|
|
275
|
+
/**
|
|
276
|
+
* Set the first day of the week.
|
|
277
|
+
* @default 'monday'
|
|
278
|
+
*/
|
|
279
|
+
firstDayOfWeek = input('monday', ...(ngDevMode ? [{ debugName: "firstDayOfWeek" }] : []));
|
|
280
|
+
/**
|
|
281
|
+
* Whether to show the time input.
|
|
282
|
+
* @default false
|
|
283
|
+
*/
|
|
284
|
+
showTime = input(false, { ...(ngDevMode ? { debugName: "showTime" } : {}), transform: booleanAttribute });
|
|
285
|
+
/**
|
|
286
|
+
* Whether to show seconds in the time input.
|
|
287
|
+
* @default false
|
|
288
|
+
*/
|
|
289
|
+
showSeconds = input(false, { ...(ngDevMode ? { debugName: "showSeconds" } : {}), transform: booleanAttribute });
|
|
290
|
+
/**
|
|
291
|
+
* Whether to show the calendar inline instead of with a input field & popup.
|
|
292
|
+
* @default false
|
|
293
|
+
*/
|
|
294
|
+
inline = input(false, { ...(ngDevMode ? { debugName: "inline" } : {}), transform: booleanAttribute });
|
|
295
|
+
_popover = viewChild(NgnPopover, ...(ngDevMode ? [{ debugName: "_popover" }] : []));
|
|
296
|
+
_platform = inject(Platform);
|
|
297
|
+
i18n = inject(I18n).translations;
|
|
298
|
+
theme = this.injectThemeTemplate(calendarControlTemplate);
|
|
299
|
+
year = linkedSignal(() => this.value()?.getFullYear() || new Date().getFullYear(), ...(ngDevMode ? [{ debugName: "year" }] : []));
|
|
300
|
+
month = linkedSignal(() => this.value()?.getMonth() ?? new Date().getMonth(), ...(ngDevMode ? [{ debugName: "month" }] : []));
|
|
301
|
+
yearOptions = generateYearOptions();
|
|
302
|
+
monthOptions = computed(() => {
|
|
303
|
+
const months = Array.from({ length: 12 }, (_, i) => ({
|
|
304
|
+
label: this.i18n[`calendar_months_${MONTHS[i] ?? throwExp('calendar', 'invalid month index')}`],
|
|
305
|
+
value: MONTHS[i],
|
|
306
|
+
testId: `calendar-month-${MONTHS[i]}`,
|
|
307
|
+
}));
|
|
308
|
+
return months;
|
|
309
|
+
}, ...(ngDevMode ? [{ debugName: "monthOptions" }] : []));
|
|
310
|
+
valueStr = computed(() => {
|
|
311
|
+
const value = this.value();
|
|
312
|
+
if (!value) {
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
// Format as YYYY-MM-DD(THH:MM(:SS))
|
|
316
|
+
return `${String(value.getFullYear()).padStart(4, '0')}-${String(value.getMonth() + 1).padStart(2, '0')}-${String(value.getDate()).padStart(2, '0')}${this.showTime()
|
|
317
|
+
? `T${String(value.getHours()).padStart(2, '0')}:${String(value.getMinutes()).padStart(2, '0')}${this.showSeconds() ? `:${String(value.getSeconds()).padStart(2, '0')}` : ''}`
|
|
318
|
+
: ''}`;
|
|
319
|
+
}, ...(ngDevMode ? [{ debugName: "valueStr" }] : []));
|
|
320
|
+
previousMonth = () => {
|
|
321
|
+
const currentMonth = this.month();
|
|
322
|
+
const currentYear = this.year();
|
|
323
|
+
if (currentMonth === 0) {
|
|
324
|
+
this.year.set(currentYear - 1);
|
|
325
|
+
this.month.set(11); // December
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
this.month.set(currentMonth - 1);
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
nextMonth = () => {
|
|
332
|
+
const currentMonth = this.month();
|
|
333
|
+
const currentYear = this.year();
|
|
334
|
+
if (currentMonth === 11) {
|
|
335
|
+
this.year.set(currentYear + 1);
|
|
336
|
+
this.month.set(0); // January
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
this.month.set(currentMonth + 1);
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
previousYear = () => {
|
|
343
|
+
this.year.set(this.year() - 1);
|
|
344
|
+
};
|
|
345
|
+
nextYear = () => {
|
|
346
|
+
this.year.set(this.year() + 1);
|
|
347
|
+
};
|
|
348
|
+
selectMonth(month) {
|
|
349
|
+
this.month.set(MONTHS.indexOf(month));
|
|
350
|
+
}
|
|
351
|
+
selectYear(year) {
|
|
352
|
+
this.year.set(year);
|
|
353
|
+
}
|
|
354
|
+
selectDay(day) {
|
|
355
|
+
const newValue = new Date(this.value() || new Date());
|
|
356
|
+
newValue.setFullYear(this.year());
|
|
357
|
+
newValue.setMonth(this.month() + day.monthOffset);
|
|
358
|
+
newValue.setDate(day.date);
|
|
359
|
+
this.value.set(newValue);
|
|
360
|
+
}
|
|
361
|
+
changeTime(newTime) {
|
|
362
|
+
if (!newTime) {
|
|
363
|
+
this.value.set(null);
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
const currentValue = this.value();
|
|
367
|
+
if (currentValue) {
|
|
368
|
+
const newValue = new Date(currentValue);
|
|
369
|
+
newValue.setHours(newTime.getHours());
|
|
370
|
+
newValue.setMinutes(newTime.getMinutes());
|
|
371
|
+
newValue.setSeconds(newTime.getSeconds());
|
|
372
|
+
this.value.set(newValue);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Shows the calendar popup. Only works if `inline` is `false`.
|
|
377
|
+
*/
|
|
378
|
+
show() {
|
|
379
|
+
if (this.inline()) {
|
|
380
|
+
throw new NgnError('calendar', 'cannot open inline calendar');
|
|
381
|
+
}
|
|
382
|
+
if (this._platform.isTouchDevice() || this.disabled() || this.readonly()) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
const popover = this._popover();
|
|
386
|
+
if (!popover) {
|
|
387
|
+
throw new NgnError('calendar', 'popover not found despite inline being false');
|
|
388
|
+
}
|
|
389
|
+
popover.show();
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Hides the calendar popup. Only works if `inline` is `false`.
|
|
393
|
+
*/
|
|
394
|
+
hide() {
|
|
395
|
+
if (this.inline()) {
|
|
396
|
+
throw new NgnError('calendar', 'cannot close inline calendar');
|
|
397
|
+
}
|
|
398
|
+
const popover = this._popover();
|
|
399
|
+
if (!popover) {
|
|
400
|
+
throw new NgnError('calendar', 'popover not found despite inline being false');
|
|
401
|
+
}
|
|
402
|
+
popover.hide();
|
|
403
|
+
}
|
|
404
|
+
onKeyDown(event) {
|
|
405
|
+
// @todo: handle date selection with keys
|
|
406
|
+
// if event is not handled by the listbox, we can handle it here
|
|
407
|
+
if (event.key === 'Enter' && !this.inline()) {
|
|
408
|
+
const popover = this._popover();
|
|
409
|
+
if (!popover) {
|
|
410
|
+
throw new NgnError('calendar', 'popover not found despite inline being false');
|
|
411
|
+
}
|
|
412
|
+
popover.toggle();
|
|
413
|
+
event.stopPropagation();
|
|
414
|
+
event.preventDefault();
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
stringValueChange(newValue) {
|
|
418
|
+
if (!newValue) {
|
|
419
|
+
return true;
|
|
420
|
+
}
|
|
421
|
+
const date = new Date(newValue);
|
|
422
|
+
if (!isNaN(date.getTime())) {
|
|
423
|
+
if (!this.showTime()) {
|
|
424
|
+
date.setHours(this.value()?.getHours() || 0);
|
|
425
|
+
date.setMinutes(this.value()?.getMinutes() || 0);
|
|
426
|
+
date.setSeconds(this.value()?.getSeconds() || 0);
|
|
427
|
+
}
|
|
428
|
+
else if (!this.showSeconds()) {
|
|
429
|
+
date.setSeconds(this.value()?.getSeconds() || 0);
|
|
430
|
+
}
|
|
431
|
+
this.value.set(date);
|
|
432
|
+
}
|
|
433
|
+
return true;
|
|
434
|
+
}
|
|
435
|
+
potentiallyBlurred() {
|
|
436
|
+
setTimeout(() => {
|
|
437
|
+
if (this.element.nativeElement.contains(document.activeElement) || this._popover()?.open()) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
this.touched.set(true);
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgnCalendar, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
444
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: NgnCalendar, isStandalone: true, selector: "ngn-calendar", inputs: { firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideSelf(NgnCalendar)], viewQueries: [{ propertyName: "_popover", first: true, predicate: NgnPopover, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (inline()) {\r\n <ng-container *ngTemplateOutlet=\"calendar\"></ng-container>\r\n} @else {\r\n <ngn-input-field\r\n #field\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'input-field'\"\r\n (click)=\"show()\"\r\n (keydown)=\"onKeyDown($event)\"\r\n [label]=\"label()\"\r\n [inputId]=\"inputId()\"\r\n [invalid]=\"invalid()\"\r\n [labelledBy]=\"labelledBy()\"\r\n (focusout)=\"potentiallyBlurred()\"\r\n [disabled]=\"disabled()\"\r\n >\r\n <input\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'input'\"\r\n ngnInput\r\n #input\r\n (valueChange)=\"stringValueChange($event)\"\r\n [type]=\"showTime() ? 'datetime-local' : 'date'\"\r\n [value]=\"valueStr()\"\r\n [disabled]=\"disabled()\"\r\n [readOnly]=\"readonly()\"\r\n />\r\n <ngn-icon defaultIcon=\"calendar\" />\r\n </ngn-input-field>\r\n <ngn-popover\r\n #popover\r\n [anchor]=\"field.element.nativeElement\"\r\n [id]=\"inputId() + '_popover'\"\r\n (closing)=\"potentiallyBlurred()\"\r\n >\r\n <ng-template #lazy>\r\n <ng-container *ngTemplateOutlet=\"calendar\"></ng-container>\r\n </ng-template>\r\n </ngn-popover>\r\n}\r\n\r\n<ng-template #calendar>\r\n <div\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{\r\n root: true,\r\n inline: inline(),\r\n }\"\r\n >\r\n <ngn-calendar-days\r\n [component]=\"this\"\r\n [theme]=\"theme\"\r\n [year]=\"year()\"\r\n [month]=\"month()\"\r\n [currentValue]=\"value()\"\r\n [firstDayOfWeek]=\"firstDayOfWeek()\"\r\n (previousMonth)=\"previousMonth()\"\r\n (nextMonth)=\"nextMonth()\"\r\n (daySelected)=\"selectDay($event)\"\r\n (monthSelected)=\"selectMonth($event)\"\r\n (yearSelected)=\"selectYear($event)\"\r\n (timeChanged)=\"changeTime($event)\"\r\n [dayTemplate]=\"dayTemplate()\"\r\n [weekDayTemplate]=\"weekDayTemplate()\"\r\n [timeTemplate]=\"timeTemplate()\"\r\n [yearTemplate]=\"yearTemplate()\"\r\n [monthTemplate]=\"monthTemplate()\"\r\n [showTime]=\"showTime()\"\r\n [showSeconds]=\"showSeconds()\"\r\n (focusout)=\"potentiallyBlurred()\"\r\n />\r\n </div>\r\n</ng-template>\r\n<ng-template #defaultDayTemplate [ngnTemplate]=\"templateTypes.day\" let-day>\r\n {{ day.date }}\r\n</ng-template>\r\n\r\n<ng-template #defaultWeekDayTemplate [ngnTemplate]=\"templateTypes.weekDay\" let-weekDay>\r\n <span>\r\n {{ weekDay.translation }}\r\n </span>\r\n</ng-template>\r\n\r\n<ng-template #defaultTimeTemplate [ngnTemplate]=\"templateTypes.time\" let-time>\r\n @defer {\r\n <div [ptInt]=\"this\" [ptClass]=\"'time'\">\r\n <ngn-calendar-time\r\n [component]=\"this\"\r\n [currentValue]=\"time.time\"\r\n [showSeconds]=\"time.showSeconds\"\r\n (timeChange)=\"time.change($event)\"\r\n />\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #defaultYearTemplate [ngnTemplate]=\"templateTypes.year\" let-y>\r\n @defer {\r\n <ngn-select\r\n [editable]=\"true\"\r\n [value]=\"year() + ''\"\r\n (valueChange)=\"y.change(+($event || 0))\"\r\n [options]=\"yearOptions\"\r\n [virtual]=\"true\"\r\n [itemHeight]=\"40\"\r\n [popoverOptions]=\"{ sizeConstraints: { maxHeight: '300px' } }\"\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'current-year'\"\r\n [scrollToSelectedItemOnOpen]=\"'center'\"\r\n [editableAutoFilter]=\"false\"\r\n [tabindex]=\"-1\"\r\n >\r\n <input ngnInput type=\"number\" [attr.aria-label]=\"i18n['calendar_selectYear']()\" />\r\n </ngn-select>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #defaultMonthTemplate [ngnTemplate]=\"templateTypes.month\" let-m>\r\n @defer {\r\n <ngn-select\r\n [value]=\"m.month\"\r\n (valueChange)=\"m.change($event!)\"\r\n [options]=\"monthOptions()\"\r\n [popoverOptions]=\"{\r\n sizeConstraints: { maxHeight: '300px', width: '130px', maxWidth: '130px' },\r\n }\"\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'current-month'\"\r\n [scrollToSelectedItemOnOpen]=\"'center'\"\r\n [tabindex]=\"-1\"\r\n />\r\n }\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgnTemplate, selector: "ng-template[ngnTemplate]", inputs: ["ngnTemplate"] }, { kind: "directive", type: NgnPt, selector: "[ptInt]", inputs: ["ptInt", "ptClass"] }, { kind: "directive", type: NgnInput, selector: "input[ngnInput], textarea[ngnInput]", inputs: ["invalid", "value"], outputs: ["valueChange"] }, { kind: "component", type: NgnIcon, selector: "ngn-icon", inputs: ["defaultIcon", "icon"] }, { kind: "component", type: NgnInputField, selector: "ngn-input-field", inputs: ["label", "labelledBy", "labelKind", "inputId", "showClearButton", "iconClearButton", "tabindex", "invalid", "readonly", "disabled"] }, { kind: "component", type: NgnPopover, selector: "ngn-popover", inputs: ["open", "anchor", "options", "hasShrinkableContent", "closeBy"], outputs: ["closed", "closing", "openChange"] }, { kind: "component", type: CalendarDays, selector: "ngn-calendar-days", inputs: ["component", "theme", "year", "month", "currentValue", "firstDayOfWeek", "dayTemplate", "weekDayTemplate", "timeTemplate", "yearTemplate", "monthTemplate", "showTime", "showSeconds"], outputs: ["previousMonth", "nextMonth", "daySelected", "yearSelected", "monthSelected", "timeChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, deferBlockDependencies: [() => [NgnPt, import('./ngneers-controls-calendar-time-C7UnIFzU.mjs').then(m => m.CalendarTime)], () => [NgnPt,
|
|
445
|
+
NgnInput, import('@ngneers/controls/select').then(m => m.NgnSelect)], () => [NgnPt, import('@ngneers/controls/select').then(m => m.NgnSelect)]] });
|
|
446
|
+
}
|
|
447
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "21.1.0", ngImport: i0, type: NgnCalendar, resolveDeferredDeps: () => [import('./ngneers-controls-calendar-time-C7UnIFzU.mjs').then(m => m.CalendarTime), import('@ngneers/controls/select').then(m => m.NgnSelect)], resolveMetadata: (CalendarTime, NgnSelect) => ({ decorators: [{
|
|
448
|
+
type: Component,
|
|
449
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ngn-calendar', imports: [
|
|
450
|
+
NgTemplateOutlet,
|
|
451
|
+
NgnTemplate,
|
|
452
|
+
NgnPt,
|
|
453
|
+
NgnInput,
|
|
454
|
+
NgnIcon,
|
|
455
|
+
NgnInputField,
|
|
456
|
+
NgnSelect,
|
|
457
|
+
NgnPopover,
|
|
458
|
+
CalendarDays,
|
|
459
|
+
CalendarTime,
|
|
460
|
+
], providers: [provideSelf(NgnCalendar)], template: "@if (inline()) {\r\n <ng-container *ngTemplateOutlet=\"calendar\"></ng-container>\r\n} @else {\r\n <ngn-input-field\r\n #field\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'input-field'\"\r\n (click)=\"show()\"\r\n (keydown)=\"onKeyDown($event)\"\r\n [label]=\"label()\"\r\n [inputId]=\"inputId()\"\r\n [invalid]=\"invalid()\"\r\n [labelledBy]=\"labelledBy()\"\r\n (focusout)=\"potentiallyBlurred()\"\r\n [disabled]=\"disabled()\"\r\n >\r\n <input\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'input'\"\r\n ngnInput\r\n #input\r\n (valueChange)=\"stringValueChange($event)\"\r\n [type]=\"showTime() ? 'datetime-local' : 'date'\"\r\n [value]=\"valueStr()\"\r\n [disabled]=\"disabled()\"\r\n [readOnly]=\"readonly()\"\r\n />\r\n <ngn-icon defaultIcon=\"calendar\" />\r\n </ngn-input-field>\r\n <ngn-popover\r\n #popover\r\n [anchor]=\"field.element.nativeElement\"\r\n [id]=\"inputId() + '_popover'\"\r\n (closing)=\"potentiallyBlurred()\"\r\n >\r\n <ng-template #lazy>\r\n <ng-container *ngTemplateOutlet=\"calendar\"></ng-container>\r\n </ng-template>\r\n </ngn-popover>\r\n}\r\n\r\n<ng-template #calendar>\r\n <div\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{\r\n root: true,\r\n inline: inline(),\r\n }\"\r\n >\r\n <ngn-calendar-days\r\n [component]=\"this\"\r\n [theme]=\"theme\"\r\n [year]=\"year()\"\r\n [month]=\"month()\"\r\n [currentValue]=\"value()\"\r\n [firstDayOfWeek]=\"firstDayOfWeek()\"\r\n (previousMonth)=\"previousMonth()\"\r\n (nextMonth)=\"nextMonth()\"\r\n (daySelected)=\"selectDay($event)\"\r\n (monthSelected)=\"selectMonth($event)\"\r\n (yearSelected)=\"selectYear($event)\"\r\n (timeChanged)=\"changeTime($event)\"\r\n [dayTemplate]=\"dayTemplate()\"\r\n [weekDayTemplate]=\"weekDayTemplate()\"\r\n [timeTemplate]=\"timeTemplate()\"\r\n [yearTemplate]=\"yearTemplate()\"\r\n [monthTemplate]=\"monthTemplate()\"\r\n [showTime]=\"showTime()\"\r\n [showSeconds]=\"showSeconds()\"\r\n (focusout)=\"potentiallyBlurred()\"\r\n />\r\n </div>\r\n</ng-template>\r\n<ng-template #defaultDayTemplate [ngnTemplate]=\"templateTypes.day\" let-day>\r\n {{ day.date }}\r\n</ng-template>\r\n\r\n<ng-template #defaultWeekDayTemplate [ngnTemplate]=\"templateTypes.weekDay\" let-weekDay>\r\n <span>\r\n {{ weekDay.translation }}\r\n </span>\r\n</ng-template>\r\n\r\n<ng-template #defaultTimeTemplate [ngnTemplate]=\"templateTypes.time\" let-time>\r\n @defer {\r\n <div [ptInt]=\"this\" [ptClass]=\"'time'\">\r\n <ngn-calendar-time\r\n [component]=\"this\"\r\n [currentValue]=\"time.time\"\r\n [showSeconds]=\"time.showSeconds\"\r\n (timeChange)=\"time.change($event)\"\r\n />\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #defaultYearTemplate [ngnTemplate]=\"templateTypes.year\" let-y>\r\n @defer {\r\n <ngn-select\r\n [editable]=\"true\"\r\n [value]=\"year() + ''\"\r\n (valueChange)=\"y.change(+($event || 0))\"\r\n [options]=\"yearOptions\"\r\n [virtual]=\"true\"\r\n [itemHeight]=\"40\"\r\n [popoverOptions]=\"{ sizeConstraints: { maxHeight: '300px' } }\"\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'current-year'\"\r\n [scrollToSelectedItemOnOpen]=\"'center'\"\r\n [editableAutoFilter]=\"false\"\r\n [tabindex]=\"-1\"\r\n >\r\n <input ngnInput type=\"number\" [attr.aria-label]=\"i18n['calendar_selectYear']()\" />\r\n </ngn-select>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #defaultMonthTemplate [ngnTemplate]=\"templateTypes.month\" let-m>\r\n @defer {\r\n <ngn-select\r\n [value]=\"m.month\"\r\n (valueChange)=\"m.change($event!)\"\r\n [options]=\"monthOptions()\"\r\n [popoverOptions]=\"{\r\n sizeConstraints: { maxHeight: '300px', width: '130px', maxWidth: '130px' },\r\n }\"\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'current-month'\"\r\n [scrollToSelectedItemOnOpen]=\"'center'\"\r\n [tabindex]=\"-1\"\r\n />\r\n }\r\n</ng-template>\r\n" }]
|
|
461
|
+
}], ctorParameters: null, propDecorators: { firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], showTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTime", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }], _popover: [{ type: i0.ViewChild, args: [i0.forwardRef(() => NgnPopover), { isSignal: true }] }] } }) });
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Generated bundle index. Do not edit.
|
|
465
|
+
*/
|
|
466
|
+
|
|
467
|
+
export { MONTHS, NgnCalendar, WEEK_DAYS };
|
|
468
|
+
//# sourceMappingURL=ngneers-controls-calendar.mjs.map
|