@apexara/ng-components 1.0.6-test.2 → 1.0.6-test.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/apexara-ng-components-carousel.mjs +5 -5
- package/fesm2022/apexara-ng-components-carousel.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-datepicker.mjs +109 -66
- package/fesm2022/apexara-ng-components-datepicker.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-select.mjs +13 -3
- package/fesm2022/apexara-ng-components-select.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-snackbar.mjs +5 -7
- package/fesm2022/apexara-ng-components-snackbar.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-table.mjs +1 -1
- package/fesm2022/apexara-ng-components-table.mjs.map +1 -1
- package/package.json +1 -1
- package/types/apexara-ng-components-carousel.d.ts +1 -1
- package/types/apexara-ng-components-snackbar.d.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Output, Input, Component, Injectable, ViewChild,
|
|
2
|
+
import { EventEmitter, signal, Output, Input, Component, Injectable, ViewChild, HostListener } from '@angular/core';
|
|
3
3
|
import { FormsModule, ReactiveFormsModule, TouchedChangeEvent } from '@angular/forms';
|
|
4
4
|
import { filter } from 'rxjs';
|
|
5
5
|
import * as i1$1 from '@apexara/ng-components/services';
|
|
@@ -49,9 +49,15 @@ class CalendarBody {
|
|
|
49
49
|
this.dragStarted = new EventEmitter();
|
|
50
50
|
/** Emits the date at the conclusion of a drag, or null if mouse was not released on a date. */
|
|
51
51
|
this.dragEnded = new EventEmitter();
|
|
52
|
+
/** The number of blank cells to put at the beginning for the first row. */
|
|
53
|
+
this.firstRowOffset = signal(0, ...(ngDevMode ? [{ debugName: "firstRowOffset" }] : []));
|
|
54
|
+
/** Padding for the individual date cells. */
|
|
55
|
+
this.cellPadding = signal('', ...(ngDevMode ? [{ debugName: "cellPadding" }] : []));
|
|
52
56
|
this.id = `calendar-body-${calendarBodyId++}`;
|
|
53
57
|
this.startDateLabelId = `${this.id}-start-date`;
|
|
54
58
|
this.endDateLabelId = `${this.id}-end-date`;
|
|
59
|
+
/** Width of an individual cell. */
|
|
60
|
+
this.cellWidth = signal('', ...(ngDevMode ? [{ debugName: "cellWidth" }] : []));
|
|
55
61
|
/**
|
|
56
62
|
* Used to focus the active cell after change detection has run.
|
|
57
63
|
*/
|
|
@@ -197,13 +203,13 @@ class CalendarBody {
|
|
|
197
203
|
const columnChanges = changes['numCols'];
|
|
198
204
|
const { rows, numCols } = this;
|
|
199
205
|
if (changes['rows'] || columnChanges) {
|
|
200
|
-
this.firstRowOffset
|
|
206
|
+
this.firstRowOffset.set(rows && rows.length && rows[0].length ? numCols - rows[0].length : 0);
|
|
201
207
|
}
|
|
202
|
-
if (changes['cellAspectRatio'] || columnChanges || !this.cellPadding) {
|
|
203
|
-
this.cellPadding
|
|
208
|
+
if (changes['cellAspectRatio'] || columnChanges || !this.cellPadding()) {
|
|
209
|
+
this.cellPadding.set(`${(50 * this.cellAspectRatio) / numCols}%`);
|
|
204
210
|
}
|
|
205
|
-
if (columnChanges || !this.cellWidth) {
|
|
206
|
-
this.cellWidth
|
|
211
|
+
if (columnChanges || !this.cellWidth()) {
|
|
212
|
+
this.cellWidth.set(`${100 / numCols}%`);
|
|
207
213
|
}
|
|
208
214
|
}
|
|
209
215
|
ngAfterViewChecked() {
|
|
@@ -250,7 +256,7 @@ class CalendarBody {
|
|
|
250
256
|
let cellNumber = rowIndex * this.numCols + colIndex;
|
|
251
257
|
// Account for the fact that the first row may not have as many cells.
|
|
252
258
|
if (rowIndex) {
|
|
253
|
-
cellNumber -= this.firstRowOffset;
|
|
259
|
+
cellNumber -= this.firstRowOffset();
|
|
254
260
|
}
|
|
255
261
|
return cellNumber == this.activeCell;
|
|
256
262
|
}
|
|
@@ -365,13 +371,13 @@ class CalendarBody {
|
|
|
365
371
|
return document.elementFromPoint(touchLocation.clientX, touchLocation.clientY);
|
|
366
372
|
}
|
|
367
373
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: CalendarBody, deps: [{ token: i0.NgZone }, { token: i1.Platform }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
368
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: CalendarBody, isStandalone: true, selector: "[calendar-body]", inputs: { label: "label", rows: "rows", todayValue: "todayValue", startValue: "startValue", endValue: "endValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", activeCell: "activeCell", isRange: "isRange", cellAspectRatio: "cellAspectRatio", comparisonStart: "comparisonStart", comparisonEnd: "comparisonEnd", previewStart: "previewStart", previewEnd: "previewEnd", startDateAccessibleName: "startDateAccessibleName", endDateAccessibleName: "endDateAccessibleName" }, outputs: { selectedValueChange: "selectedValueChange", previewChange: "previewChange", activeDateChange: "activeDateChange", dragStarted: "dragStarted", dragEnded: "dragEnded" }, host: { classAttribute: "calendar-body" }, usesOnChanges: true, ngImport: i0, template: "@if (firstRowOffset < labelMinRequiredCells) {\n <tr aria-hidden=\"true\">\n <td class=\"calendar-body-label\"\n [attr.colspan]=\"numCols\"\n [style.paddingTop]=\"cellPadding\"\n [style.paddingBottom]=\"cellPadding\">\n {{ label }}\n </td>\n </tr>\n}\n\n@for (row of rows; track trackRow(row); let rowIndex = $index) {\n <tr role=\"row\">\n @if (rowIndex === 0 && firstRowOffset) {\n <td\n class=\"calendar-body-label\"\n [attr.colspan]=\"firstRowOffset\"\n [style.paddingTop]=\"cellPadding\"\n [style.paddingBottom]=\"cellPadding\">\n {{ firstRowOffset >= labelMinRequiredCells ? label : ''}}\n </td>\n }\n\n @for (item of row; track item; let colIndex = $index) {\n <td\n role=\"gridcell\"\n class=\"calendar-body-cell-container\"\n [style.width]=\"cellWidth\"\n [style.paddingTop]=\"cellPadding\"\n [style.paddingBottom]=\"cellPadding\"\n [attr.data-row]=\"rowIndex\"\n [attr.data-col]=\"colIndex\"\n >\n <button\n type=\"button\"\n class=\"calendar-body-cell\"\n [tabindex]=\"isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [class.disabled]=\"!item.enabled\"\n [class.selected]=\"isSelected(item.compareValue)\"\n [class.active]=\"isActiveCell(rowIndex, colIndex)\"\n [class.today]=\"todayValue === item.compareValue\"\n [class.range-start]=\"isRangeStart(item.compareValue)\"\n [class.range-end]=\"isRangeEnd(item.compareValue)\"\n [class.in-range]=\"isCellInRange(item.compareValue)\"\n [class.in-preview]=\"isInPreview(item.compareValue)\"\n [class.preview-start]=\"isPreviewStart(item.compareValue)\"\n [class.preview-end]=\"isPreviewEnd(item.compareValue)\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n [attr.aria-pressed]=\"isSelected(item.compareValue)\"\n [attr.aria-current]=\"todayValue === item.compareValue ? 'date' : null\"\n [attr.aria-describedby]=\"getDescribedby(item.compareValue)\"\n (click)=\"cellClicked(item, $event)\"\n (focus)=\"emitActiveDateChange(item, $event)\">\n <span class=\"calendar-body-cell-content focus-indicator\">\n {{ item.displayValue }}\n </span>\n\n <span class=\"calendar-body-cell-preview\" aria-hidden=\"true\"></span>\n </button>\n </td>\n }\n </tr>\n}\n\n<span [id]=\"startDateLabelId\" class=\"calendar-body-hidden-label\">{{ startDateAccessibleName }}</span>\n\n<span [id]=\"endDateLabelId\" class=\"calendar-body-hidden-label\">{{ endDateAccessibleName }}</span>\n", styles: ["tr{height:40px}.calendar-body-label{height:0;line-height:0;text-align:start}.calendar-body-cell{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;text-align:center;color:var(--apex-calendar-body-cell-color, #0B1222);background:var(--apex-datepicker-calendar-body-cell-background-color, none);border:var(--apex-calendar-body-cell-border, none);margin:0}.calendar-body-hidden-label{display:none}.calendar-body-cell-container{position:relative;height:0;line-height:0}.calendar-body-cell:before,.calendar-body-cell:after,.calendar-body-cell-preview{height:100%;width:100%;display:block;position:absolute;top:0;left:0;content:\"\";box-sizing:border-box;z-index:0}.calendar-body-cell{border-radius:4px;transition:border-radius .1s ease-out}.calendar-body-cell:hover{color:var(--apex-calendar-body-cell-hover-color, white);background-color:var(--apex-calendar-body-cell-hover-background-color, #FFD2C6)}.today{border:var(--apex-calendar-body-today-cell-border, 1px solid #FFD2C6)}.in-preview,.calendar-body-cell.in-preview,.calendar-body-cell.in-range.in-preview{background-color:var(--apex-calendar-body-cell-in-preview-background-color, #FFD2C6);border-left:0px;border-right:0px;border-radius:0;border-top:var(--apex-calendar-body-cell-in-preview-border, 1px dashed #F96138);border-bottom:var(--apex-calendar-body-cell-in-preview-border, 1px dashed #F96138)}.calendar-body-cell.in-preview.preview-end{border-top-right-radius:20px;border-bottom-right-radius:20px;border-right:var(--apex-calendar-body-cell-preview-end-border, 1px dashed #F96138);background-color:var(--apex-calendar-body-cell-preview-end-background-color, #FFD2C6);color:var(--apex-calendar-body-cell-preview-end-color, #FFFFFF)}.calendar-body-cell.in-preview.preview-start{border-top-left-radius:20px;border-bottom-left-radius:20px;border-left:var(--apex-calendar-body-cell-preview-start-border, 1px dashed #F96138);background-color:var(--apex-calendar-body-cell-preview-start-background-color, #FFD2C6);color:var(--apex-calendar-body-cell-preview-start-color, #FFFFFF)}.calendar-body-cell:hover .in-preview,.calendar-body-cell:hover .in-range{border-radius:0 20px 20px 0/0px 20px 20px 0px}.active:focus{background-color:var(--apex-calendar-body-active-cell-background-color, #FFD2C6)}.calendar-body-cell.in-range{background-color:var(--apex-calendar-body-cell-in-range-background-color, #FFF2EF);border-left:0px;border-right:0px;border-radius:0;border-top:var(--apex-calendar-body-cell-in-range-border, 1px solid #F96138);border-bottom:var(--apex-calendar-body-cell-in-range-border, 1px solid #F96138)}.in-range.active{background-color:var(--apex-calendar-body-cell-in-range-active-background-color, #FFD2C6)}.in-range.range-start{border-top-left-radius:20px;border-bottom-left-radius:20px;color:var(--apex-calendar-body-cell-range-start-color, #FFFFFF);border-left:var(--apex-calendar-body-cell-range-start-border, 1px solid #F96138);background-color:var(--apex-calendar-body-cell-range-start-background-color, #F96138)}.in-range.range-end{border-top-right-radius:20px;border-bottom-right-radius:20px;color:var(--apex-calendar-body-cell-range-end-color, #FFFFFF);border-right:var(--apex-datepicker-calendar-body-cell-end-start-border, 1px solid #F96138);background-color:var(--apex-datepicker-calendar-body-cell-end-start-background-color, #F96138)}.calendar-body-cell.in-range.range-end,.calendar-body-cell.in-range.range-start{background-color:var(--apex-datepicker-calendar-body-cell-end-start-background-color, #F96138)}.active.in-range.range-end,.active.in-range.range-start{background-color:var(--apex-calendar-body-cell-active-in-range-start-end-background-color, #FFD2C6)}.calendar-body-cell.selected{color:var(--apex-calendar-body-cell-selected-color, #FFFFFF);background-color:var(--apex-calendar-body-cell-selected-background-color, #F96138)}.disabled{cursor:none;border:none;border-radius:0;pointer-events:none;background-color:var(--apex-calendar-body-cell-disabled-background-color, #E0DFDE)}\n"] }); }
|
|
374
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: CalendarBody, isStandalone: true, selector: "[calendar-body]", inputs: { label: "label", rows: "rows", todayValue: "todayValue", startValue: "startValue", endValue: "endValue", labelMinRequiredCells: "labelMinRequiredCells", numCols: "numCols", activeCell: "activeCell", isRange: "isRange", cellAspectRatio: "cellAspectRatio", comparisonStart: "comparisonStart", comparisonEnd: "comparisonEnd", previewStart: "previewStart", previewEnd: "previewEnd", startDateAccessibleName: "startDateAccessibleName", endDateAccessibleName: "endDateAccessibleName" }, outputs: { selectedValueChange: "selectedValueChange", previewChange: "previewChange", activeDateChange: "activeDateChange", dragStarted: "dragStarted", dragEnded: "dragEnded" }, host: { classAttribute: "calendar-body" }, usesOnChanges: true, ngImport: i0, template: "@if (firstRowOffset() < labelMinRequiredCells) {\n <tr aria-hidden=\"true\">\n <td class=\"calendar-body-label\"\n [attr.colspan]=\"numCols\"\n [style.paddingTop]=\"cellPadding()\"\n [style.paddingBottom]=\"cellPadding()\">\n {{ label }}\n </td>\n </tr>\n}\n\n@for (row of rows; track trackRow(row); let rowIndex = $index) {\n <tr role=\"row\">\n @if (rowIndex === 0 && firstRowOffset()) {\n <td\n class=\"calendar-body-label\"\n [attr.colspan]=\"firstRowOffset()\"\n [style.paddingTop]=\"cellPadding()\"\n [style.paddingBottom]=\"cellPadding()\">\n {{ firstRowOffset() >= labelMinRequiredCells ? label : ''}}\n </td>\n }\n\n @for (item of row; track item; let colIndex = $index) {\n <td\n role=\"gridcell\"\n class=\"calendar-body-cell-container\"\n [style.width]=\"cellWidth()\"\n [style.paddingTop]=\"cellPadding()\"\n [style.paddingBottom]=\"cellPadding()\"\n [attr.data-row]=\"rowIndex\"\n [attr.data-col]=\"colIndex\"\n >\n <button\n type=\"button\"\n class=\"calendar-body-cell\"\n [tabindex]=\"isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [class.disabled]=\"!item.enabled\"\n [class.selected]=\"isSelected(item.compareValue)\"\n [class.active]=\"isActiveCell(rowIndex, colIndex)\"\n [class.today]=\"todayValue === item.compareValue\"\n [class.range-start]=\"isRangeStart(item.compareValue)\"\n [class.range-end]=\"isRangeEnd(item.compareValue)\"\n [class.in-range]=\"isCellInRange(item.compareValue)\"\n [class.in-preview]=\"isInPreview(item.compareValue)\"\n [class.preview-start]=\"isPreviewStart(item.compareValue)\"\n [class.preview-end]=\"isPreviewEnd(item.compareValue)\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n [attr.aria-pressed]=\"isSelected(item.compareValue)\"\n [attr.aria-current]=\"todayValue === item.compareValue ? 'date' : null\"\n [attr.aria-describedby]=\"getDescribedby(item.compareValue)\"\n (click)=\"cellClicked(item, $event)\"\n (focus)=\"emitActiveDateChange(item, $event)\">\n <span class=\"calendar-body-cell-content focus-indicator\">\n {{ item.displayValue }}\n </span>\n\n <span class=\"calendar-body-cell-preview\" aria-hidden=\"true\"></span>\n </button>\n </td>\n }\n </tr>\n}\n\n<span [id]=\"startDateLabelId\" class=\"calendar-body-hidden-label\">{{ startDateAccessibleName }}</span>\n\n<span [id]=\"endDateLabelId\" class=\"calendar-body-hidden-label\">{{ endDateAccessibleName }}</span>\n", styles: ["tr{height:40px}.calendar-body-label{height:0;line-height:0;text-align:start}.calendar-body-cell{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;text-align:center;color:var(--apex-calendar-body-cell-color, #0B1222);background:var(--apex-datepicker-calendar-body-cell-background-color, none);border:var(--apex-calendar-body-cell-border, none);margin:0}.calendar-body-hidden-label{display:none}.calendar-body-cell-container{position:relative;height:0;line-height:0}.calendar-body-cell:before,.calendar-body-cell:after,.calendar-body-cell-preview{height:100%;width:100%;display:block;position:absolute;top:0;left:0;content:\"\";box-sizing:border-box;z-index:0}.calendar-body-cell{border-radius:4px;transition:border-radius .1s ease-out}.calendar-body-cell:hover{color:var(--apex-calendar-body-cell-hover-color, white);background-color:var(--apex-calendar-body-cell-hover-background-color, #FFD2C6)}.today{border:var(--apex-calendar-body-today-cell-border, 1px solid #FFD2C6)}.in-preview,.calendar-body-cell.in-preview,.calendar-body-cell.in-range.in-preview{background-color:var(--apex-calendar-body-cell-in-preview-background-color, #FFD2C6);border-left:0px;border-right:0px;border-radius:0;border-top:var(--apex-calendar-body-cell-in-preview-border, 1px dashed #F96138);border-bottom:var(--apex-calendar-body-cell-in-preview-border, 1px dashed #F96138)}.calendar-body-cell.in-preview.preview-end{border-top-right-radius:20px;border-bottom-right-radius:20px;border-right:var(--apex-calendar-body-cell-preview-end-border, 1px dashed #F96138);background-color:var(--apex-calendar-body-cell-preview-end-background-color, #FFD2C6);color:var(--apex-calendar-body-cell-preview-end-color, #FFFFFF)}.calendar-body-cell.in-preview.preview-start{border-top-left-radius:20px;border-bottom-left-radius:20px;border-left:var(--apex-calendar-body-cell-preview-start-border, 1px dashed #F96138);background-color:var(--apex-calendar-body-cell-preview-start-background-color, #FFD2C6);color:var(--apex-calendar-body-cell-preview-start-color, #FFFFFF)}.calendar-body-cell:hover .in-preview,.calendar-body-cell:hover .in-range{border-radius:0 20px 20px 0/0px 20px 20px 0px}.active:focus{background-color:var(--apex-calendar-body-active-cell-background-color, #FFD2C6)}.calendar-body-cell.in-range{background-color:var(--apex-calendar-body-cell-in-range-background-color, #FFF2EF);border-left:0px;border-right:0px;border-radius:0;border-top:var(--apex-calendar-body-cell-in-range-border, 1px solid #F96138);border-bottom:var(--apex-calendar-body-cell-in-range-border, 1px solid #F96138)}.in-range.active{background-color:var(--apex-calendar-body-cell-in-range-active-background-color, #FFD2C6)}.in-range.range-start{border-top-left-radius:20px;border-bottom-left-radius:20px;color:var(--apex-calendar-body-cell-range-start-color, #FFFFFF);border-left:var(--apex-calendar-body-cell-range-start-border, 1px solid #F96138);background-color:var(--apex-calendar-body-cell-range-start-background-color, #F96138)}.in-range.range-end{border-top-right-radius:20px;border-bottom-right-radius:20px;color:var(--apex-calendar-body-cell-range-end-color, #FFFFFF);border-right:var(--apex-datepicker-calendar-body-cell-end-start-border, 1px solid #F96138);background-color:var(--apex-datepicker-calendar-body-cell-end-start-background-color, #F96138)}.calendar-body-cell.in-range.range-end,.calendar-body-cell.in-range.range-start{background-color:var(--apex-datepicker-calendar-body-cell-end-start-background-color, #F96138)}.active.in-range.range-end,.active.in-range.range-start{background-color:var(--apex-calendar-body-cell-active-in-range-start-end-background-color, #FFD2C6)}.calendar-body-cell.selected{color:var(--apex-calendar-body-cell-selected-color, #FFFFFF);background-color:var(--apex-calendar-body-cell-selected-background-color, #F96138)}.disabled{cursor:none;border:none;border-radius:0;pointer-events:none;background-color:var(--apex-calendar-body-cell-disabled-background-color, #E0DFDE)}\n"] }); }
|
|
369
375
|
}
|
|
370
376
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: CalendarBody, decorators: [{
|
|
371
377
|
type: Component,
|
|
372
378
|
args: [{ selector: '[calendar-body]', host: {
|
|
373
379
|
'class': 'calendar-body',
|
|
374
|
-
}, template: "@if (firstRowOffset < labelMinRequiredCells) {\n <tr aria-hidden=\"true\">\n <td class=\"calendar-body-label\"\n [attr.colspan]=\"numCols\"\n [style.paddingTop]=\"cellPadding\"\n [style.paddingBottom]=\"cellPadding\">\n {{ label }}\n </td>\n </tr>\n}\n\n@for (row of rows; track trackRow(row); let rowIndex = $index) {\n <tr role=\"row\">\n @if (rowIndex === 0 && firstRowOffset) {\n <td\n class=\"calendar-body-label\"\n [attr.colspan]=\"firstRowOffset\"\n [style.paddingTop]=\"cellPadding\"\n [style.paddingBottom]=\"cellPadding\">\n {{ firstRowOffset >= labelMinRequiredCells ? label : ''}}\n </td>\n }\n\n @for (item of row; track item; let colIndex = $index) {\n <td\n role=\"gridcell\"\n class=\"calendar-body-cell-container\"\n [style.width]=\"cellWidth\"\n [style.paddingTop]=\"cellPadding\"\n [style.paddingBottom]=\"cellPadding\"\n [attr.data-row]=\"rowIndex\"\n [attr.data-col]=\"colIndex\"\n >\n <button\n type=\"button\"\n class=\"calendar-body-cell\"\n [tabindex]=\"isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [class.disabled]=\"!item.enabled\"\n [class.selected]=\"isSelected(item.compareValue)\"\n [class.active]=\"isActiveCell(rowIndex, colIndex)\"\n [class.today]=\"todayValue === item.compareValue\"\n [class.range-start]=\"isRangeStart(item.compareValue)\"\n [class.range-end]=\"isRangeEnd(item.compareValue)\"\n [class.in-range]=\"isCellInRange(item.compareValue)\"\n [class.in-preview]=\"isInPreview(item.compareValue)\"\n [class.preview-start]=\"isPreviewStart(item.compareValue)\"\n [class.preview-end]=\"isPreviewEnd(item.compareValue)\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n [attr.aria-pressed]=\"isSelected(item.compareValue)\"\n [attr.aria-current]=\"todayValue === item.compareValue ? 'date' : null\"\n [attr.aria-describedby]=\"getDescribedby(item.compareValue)\"\n (click)=\"cellClicked(item, $event)\"\n (focus)=\"emitActiveDateChange(item, $event)\">\n <span class=\"calendar-body-cell-content focus-indicator\">\n {{ item.displayValue }}\n </span>\n\n <span class=\"calendar-body-cell-preview\" aria-hidden=\"true\"></span>\n </button>\n </td>\n }\n </tr>\n}\n\n<span [id]=\"startDateLabelId\" class=\"calendar-body-hidden-label\">{{ startDateAccessibleName }}</span>\n\n<span [id]=\"endDateLabelId\" class=\"calendar-body-hidden-label\">{{ endDateAccessibleName }}</span>\n", styles: ["tr{height:40px}.calendar-body-label{height:0;line-height:0;text-align:start}.calendar-body-cell{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;text-align:center;color:var(--apex-calendar-body-cell-color, #0B1222);background:var(--apex-datepicker-calendar-body-cell-background-color, none);border:var(--apex-calendar-body-cell-border, none);margin:0}.calendar-body-hidden-label{display:none}.calendar-body-cell-container{position:relative;height:0;line-height:0}.calendar-body-cell:before,.calendar-body-cell:after,.calendar-body-cell-preview{height:100%;width:100%;display:block;position:absolute;top:0;left:0;content:\"\";box-sizing:border-box;z-index:0}.calendar-body-cell{border-radius:4px;transition:border-radius .1s ease-out}.calendar-body-cell:hover{color:var(--apex-calendar-body-cell-hover-color, white);background-color:var(--apex-calendar-body-cell-hover-background-color, #FFD2C6)}.today{border:var(--apex-calendar-body-today-cell-border, 1px solid #FFD2C6)}.in-preview,.calendar-body-cell.in-preview,.calendar-body-cell.in-range.in-preview{background-color:var(--apex-calendar-body-cell-in-preview-background-color, #FFD2C6);border-left:0px;border-right:0px;border-radius:0;border-top:var(--apex-calendar-body-cell-in-preview-border, 1px dashed #F96138);border-bottom:var(--apex-calendar-body-cell-in-preview-border, 1px dashed #F96138)}.calendar-body-cell.in-preview.preview-end{border-top-right-radius:20px;border-bottom-right-radius:20px;border-right:var(--apex-calendar-body-cell-preview-end-border, 1px dashed #F96138);background-color:var(--apex-calendar-body-cell-preview-end-background-color, #FFD2C6);color:var(--apex-calendar-body-cell-preview-end-color, #FFFFFF)}.calendar-body-cell.in-preview.preview-start{border-top-left-radius:20px;border-bottom-left-radius:20px;border-left:var(--apex-calendar-body-cell-preview-start-border, 1px dashed #F96138);background-color:var(--apex-calendar-body-cell-preview-start-background-color, #FFD2C6);color:var(--apex-calendar-body-cell-preview-start-color, #FFFFFF)}.calendar-body-cell:hover .in-preview,.calendar-body-cell:hover .in-range{border-radius:0 20px 20px 0/0px 20px 20px 0px}.active:focus{background-color:var(--apex-calendar-body-active-cell-background-color, #FFD2C6)}.calendar-body-cell.in-range{background-color:var(--apex-calendar-body-cell-in-range-background-color, #FFF2EF);border-left:0px;border-right:0px;border-radius:0;border-top:var(--apex-calendar-body-cell-in-range-border, 1px solid #F96138);border-bottom:var(--apex-calendar-body-cell-in-range-border, 1px solid #F96138)}.in-range.active{background-color:var(--apex-calendar-body-cell-in-range-active-background-color, #FFD2C6)}.in-range.range-start{border-top-left-radius:20px;border-bottom-left-radius:20px;color:var(--apex-calendar-body-cell-range-start-color, #FFFFFF);border-left:var(--apex-calendar-body-cell-range-start-border, 1px solid #F96138);background-color:var(--apex-calendar-body-cell-range-start-background-color, #F96138)}.in-range.range-end{border-top-right-radius:20px;border-bottom-right-radius:20px;color:var(--apex-calendar-body-cell-range-end-color, #FFFFFF);border-right:var(--apex-datepicker-calendar-body-cell-end-start-border, 1px solid #F96138);background-color:var(--apex-datepicker-calendar-body-cell-end-start-background-color, #F96138)}.calendar-body-cell.in-range.range-end,.calendar-body-cell.in-range.range-start{background-color:var(--apex-datepicker-calendar-body-cell-end-start-background-color, #F96138)}.active.in-range.range-end,.active.in-range.range-start{background-color:var(--apex-calendar-body-cell-active-in-range-start-end-background-color, #FFD2C6)}.calendar-body-cell.selected{color:var(--apex-calendar-body-cell-selected-color, #FFFFFF);background-color:var(--apex-calendar-body-cell-selected-background-color, #F96138)}.disabled{cursor:none;border:none;border-radius:0;pointer-events:none;background-color:var(--apex-calendar-body-cell-disabled-background-color, #E0DFDE)}\n"] }]
|
|
380
|
+
}, template: "@if (firstRowOffset() < labelMinRequiredCells) {\n <tr aria-hidden=\"true\">\n <td class=\"calendar-body-label\"\n [attr.colspan]=\"numCols\"\n [style.paddingTop]=\"cellPadding()\"\n [style.paddingBottom]=\"cellPadding()\">\n {{ label }}\n </td>\n </tr>\n}\n\n@for (row of rows; track trackRow(row); let rowIndex = $index) {\n <tr role=\"row\">\n @if (rowIndex === 0 && firstRowOffset()) {\n <td\n class=\"calendar-body-label\"\n [attr.colspan]=\"firstRowOffset()\"\n [style.paddingTop]=\"cellPadding()\"\n [style.paddingBottom]=\"cellPadding()\">\n {{ firstRowOffset() >= labelMinRequiredCells ? label : ''}}\n </td>\n }\n\n @for (item of row; track item; let colIndex = $index) {\n <td\n role=\"gridcell\"\n class=\"calendar-body-cell-container\"\n [style.width]=\"cellWidth()\"\n [style.paddingTop]=\"cellPadding()\"\n [style.paddingBottom]=\"cellPadding()\"\n [attr.data-row]=\"rowIndex\"\n [attr.data-col]=\"colIndex\"\n >\n <button\n type=\"button\"\n class=\"calendar-body-cell\"\n [tabindex]=\"isActiveCell(rowIndex, colIndex) ? 0 : -1\"\n [class.disabled]=\"!item.enabled\"\n [class.selected]=\"isSelected(item.compareValue)\"\n [class.active]=\"isActiveCell(rowIndex, colIndex)\"\n [class.today]=\"todayValue === item.compareValue\"\n [class.range-start]=\"isRangeStart(item.compareValue)\"\n [class.range-end]=\"isRangeEnd(item.compareValue)\"\n [class.in-range]=\"isCellInRange(item.compareValue)\"\n [class.in-preview]=\"isInPreview(item.compareValue)\"\n [class.preview-start]=\"isPreviewStart(item.compareValue)\"\n [class.preview-end]=\"isPreviewEnd(item.compareValue)\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-disabled]=\"!item.enabled || null\"\n [attr.aria-pressed]=\"isSelected(item.compareValue)\"\n [attr.aria-current]=\"todayValue === item.compareValue ? 'date' : null\"\n [attr.aria-describedby]=\"getDescribedby(item.compareValue)\"\n (click)=\"cellClicked(item, $event)\"\n (focus)=\"emitActiveDateChange(item, $event)\">\n <span class=\"calendar-body-cell-content focus-indicator\">\n {{ item.displayValue }}\n </span>\n\n <span class=\"calendar-body-cell-preview\" aria-hidden=\"true\"></span>\n </button>\n </td>\n }\n </tr>\n}\n\n<span [id]=\"startDateLabelId\" class=\"calendar-body-hidden-label\">{{ startDateAccessibleName }}</span>\n\n<span [id]=\"endDateLabelId\" class=\"calendar-body-hidden-label\">{{ endDateAccessibleName }}</span>\n", styles: ["tr{height:40px}.calendar-body-label{height:0;line-height:0;text-align:start}.calendar-body-cell{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;text-align:center;color:var(--apex-calendar-body-cell-color, #0B1222);background:var(--apex-datepicker-calendar-body-cell-background-color, none);border:var(--apex-calendar-body-cell-border, none);margin:0}.calendar-body-hidden-label{display:none}.calendar-body-cell-container{position:relative;height:0;line-height:0}.calendar-body-cell:before,.calendar-body-cell:after,.calendar-body-cell-preview{height:100%;width:100%;display:block;position:absolute;top:0;left:0;content:\"\";box-sizing:border-box;z-index:0}.calendar-body-cell{border-radius:4px;transition:border-radius .1s ease-out}.calendar-body-cell:hover{color:var(--apex-calendar-body-cell-hover-color, white);background-color:var(--apex-calendar-body-cell-hover-background-color, #FFD2C6)}.today{border:var(--apex-calendar-body-today-cell-border, 1px solid #FFD2C6)}.in-preview,.calendar-body-cell.in-preview,.calendar-body-cell.in-range.in-preview{background-color:var(--apex-calendar-body-cell-in-preview-background-color, #FFD2C6);border-left:0px;border-right:0px;border-radius:0;border-top:var(--apex-calendar-body-cell-in-preview-border, 1px dashed #F96138);border-bottom:var(--apex-calendar-body-cell-in-preview-border, 1px dashed #F96138)}.calendar-body-cell.in-preview.preview-end{border-top-right-radius:20px;border-bottom-right-radius:20px;border-right:var(--apex-calendar-body-cell-preview-end-border, 1px dashed #F96138);background-color:var(--apex-calendar-body-cell-preview-end-background-color, #FFD2C6);color:var(--apex-calendar-body-cell-preview-end-color, #FFFFFF)}.calendar-body-cell.in-preview.preview-start{border-top-left-radius:20px;border-bottom-left-radius:20px;border-left:var(--apex-calendar-body-cell-preview-start-border, 1px dashed #F96138);background-color:var(--apex-calendar-body-cell-preview-start-background-color, #FFD2C6);color:var(--apex-calendar-body-cell-preview-start-color, #FFFFFF)}.calendar-body-cell:hover .in-preview,.calendar-body-cell:hover .in-range{border-radius:0 20px 20px 0/0px 20px 20px 0px}.active:focus{background-color:var(--apex-calendar-body-active-cell-background-color, #FFD2C6)}.calendar-body-cell.in-range{background-color:var(--apex-calendar-body-cell-in-range-background-color, #FFF2EF);border-left:0px;border-right:0px;border-radius:0;border-top:var(--apex-calendar-body-cell-in-range-border, 1px solid #F96138);border-bottom:var(--apex-calendar-body-cell-in-range-border, 1px solid #F96138)}.in-range.active{background-color:var(--apex-calendar-body-cell-in-range-active-background-color, #FFD2C6)}.in-range.range-start{border-top-left-radius:20px;border-bottom-left-radius:20px;color:var(--apex-calendar-body-cell-range-start-color, #FFFFFF);border-left:var(--apex-calendar-body-cell-range-start-border, 1px solid #F96138);background-color:var(--apex-calendar-body-cell-range-start-background-color, #F96138)}.in-range.range-end{border-top-right-radius:20px;border-bottom-right-radius:20px;color:var(--apex-calendar-body-cell-range-end-color, #FFFFFF);border-right:var(--apex-datepicker-calendar-body-cell-end-start-border, 1px solid #F96138);background-color:var(--apex-datepicker-calendar-body-cell-end-start-background-color, #F96138)}.calendar-body-cell.in-range.range-end,.calendar-body-cell.in-range.range-start{background-color:var(--apex-datepicker-calendar-body-cell-end-start-background-color, #F96138)}.active.in-range.range-end,.active.in-range.range-start{background-color:var(--apex-calendar-body-cell-active-in-range-start-end-background-color, #FFD2C6)}.calendar-body-cell.selected{color:var(--apex-calendar-body-cell-selected-color, #FFFFFF);background-color:var(--apex-calendar-body-cell-selected-background-color, #F96138)}.disabled{cursor:none;border:none;border-radius:0;pointer-events:none;background-color:var(--apex-calendar-body-cell-disabled-background-color, #E0DFDE)}\n"] }]
|
|
375
381
|
}], ctorParameters: () => [{ type: i0.NgZone }, { type: i1.Platform }, { type: i0.ElementRef }], propDecorators: { label: [{
|
|
376
382
|
type: Input
|
|
377
383
|
}], rows: [{
|
|
@@ -685,6 +691,17 @@ class ApexCalendarYearView {
|
|
|
685
691
|
this.monthSelected = new EventEmitter();
|
|
686
692
|
/** Emits when any date is activated. */
|
|
687
693
|
this.activeDateChange = new EventEmitter();
|
|
694
|
+
/** Grid of calendar cells representing the months of the year. */
|
|
695
|
+
this.months = signal([], ...(ngDevMode ? [{ debugName: "months" }] : []));
|
|
696
|
+
/**
|
|
697
|
+
* The month in this year that the selected Date falls on.
|
|
698
|
+
* Null if the selected Date is in a different year.
|
|
699
|
+
*/
|
|
700
|
+
this.selectedMonth = signal(null, ...(ngDevMode ? [{ debugName: "selectedMonth" }] : []));
|
|
701
|
+
/** The label for this year (e.g. "2017"). */
|
|
702
|
+
this.yearLabel = signal('', ...(ngDevMode ? [{ debugName: "yearLabel" }] : []));
|
|
703
|
+
/** The month in this year that today falls on. Null if today is in a different year. */
|
|
704
|
+
this.todayMonth = signal(null, ...(ngDevMode ? [{ debugName: "todayMonth" }] : []));
|
|
688
705
|
this.dateFormats = {
|
|
689
706
|
dateInput: null,
|
|
690
707
|
display: {
|
|
@@ -739,12 +756,12 @@ class ApexCalendarYearView {
|
|
|
739
756
|
/** Initializes this year view. */
|
|
740
757
|
init() {
|
|
741
758
|
this.setSelectedMonth(this.selected);
|
|
742
|
-
this.todayMonth
|
|
743
|
-
this.yearLabel
|
|
759
|
+
this.todayMonth.set(this.getMonthInCurrentYear(this.datePickerService.today()));
|
|
760
|
+
this.yearLabel.set(this.datePickerService.getYearName(this.activeDate));
|
|
744
761
|
let monthNames = this.datePickerService.getMonthNames('short');
|
|
745
762
|
// First row of months only contains 5 elements so we can fit the year label on the same row.
|
|
746
|
-
this.months
|
|
747
|
-
.map(row => row.map(month => this.createCellForMonth(month, monthNames[month])));
|
|
763
|
+
this.months.set([[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]]
|
|
764
|
+
.map(row => row.map(month => this.createCellForMonth(month, monthNames[month]))));
|
|
748
765
|
}
|
|
749
766
|
/** Handles when a new month is selected. */
|
|
750
767
|
onMonthSelected(event) {
|
|
@@ -895,15 +912,14 @@ class ApexCalendarYearView {
|
|
|
895
912
|
/** Sets the currently-selected month based on a model value. */
|
|
896
913
|
setSelectedMonth(value) {
|
|
897
914
|
if (value instanceof DateRange) {
|
|
898
|
-
this.selectedMonth
|
|
899
|
-
this.getMonthInCurrentYear(value.start) || this.getMonthInCurrentYear(value.end);
|
|
915
|
+
this.selectedMonth.set(this.getMonthInCurrentYear(value.start) || this.getMonthInCurrentYear(value.end));
|
|
900
916
|
}
|
|
901
917
|
else {
|
|
902
|
-
this.selectedMonth
|
|
918
|
+
this.selectedMonth.set(this.getMonthInCurrentYear(value));
|
|
903
919
|
}
|
|
904
920
|
}
|
|
905
921
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexCalendarYearView, deps: [{ token: ApexDatepickerService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
906
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: ApexCalendarYearView, isStandalone: true, selector: "apex-calendar-year-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", monthSelected: "monthSelected", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "CalendarBody", first: true, predicate: CalendarBody, descendants: true }], ngImport: i0, template: "<table class=\"calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"calendar-table-header\">\n <tr>\n <th class=\"calendar-table-header-divider\" colspan=\"4\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [label]=\"yearLabel\"\n [rows]=\"months\"\n [todayValue]=\"todayMonth!\"\n [startValue]=\"selectedMonth!\"\n [endValue]=\"selectedMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"datePickerService.getMonth(activeDate)\"\n (selectedValueChange)=\"onMonthSelected($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: [":host{display:block}table{width:100%;padding:6px;border-collapse:separate}.calendar-table-header-divider{border-bottom:1px solid var(--apex-calendar-year-view-table-header-border-bottom-color, #C6C6C6)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: CalendarBody, selector: "[calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
|
|
922
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: ApexCalendarYearView, isStandalone: true, selector: "apex-calendar-year-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", monthSelected: "monthSelected", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "CalendarBody", first: true, predicate: CalendarBody, descendants: true }], ngImport: i0, template: "<table class=\"calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"calendar-table-header\">\n <tr>\n <th class=\"calendar-table-header-divider\" colspan=\"4\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [label]=\"yearLabel()\"\n [rows]=\"months()\"\n [todayValue]=\"todayMonth()!\"\n [startValue]=\"selectedMonth()!\"\n [endValue]=\"selectedMonth()!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"datePickerService.getMonth(activeDate)\"\n (selectedValueChange)=\"onMonthSelected($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: [":host{display:block}table{width:100%;padding:6px;border-collapse:separate}.calendar-table-header-divider{border-bottom:1px solid var(--apex-calendar-year-view-table-header-border-bottom-color, #C6C6C6)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: CalendarBody, selector: "[calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
|
|
907
923
|
}
|
|
908
924
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexCalendarYearView, decorators: [{
|
|
909
925
|
type: Component,
|
|
@@ -911,7 +927,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
911
927
|
FormsModule,
|
|
912
928
|
CalendarBody,
|
|
913
929
|
ReactiveFormsModule,
|
|
914
|
-
], template: "<table class=\"calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"calendar-table-header\">\n <tr>\n <th class=\"calendar-table-header-divider\" colspan=\"4\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [label]=\"yearLabel\"\n [rows]=\"months\"\n [todayValue]=\"todayMonth!\"\n [startValue]=\"selectedMonth!\"\n [endValue]=\"selectedMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"datePickerService.getMonth(activeDate)\"\n (selectedValueChange)=\"onMonthSelected($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: [":host{display:block}table{width:100%;padding:6px;border-collapse:separate}.calendar-table-header-divider{border-bottom:1px solid var(--apex-calendar-year-view-table-header-border-bottom-color, #C6C6C6)}\n"] }]
|
|
930
|
+
], template: "<table class=\"calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"calendar-table-header\">\n <tr>\n <th class=\"calendar-table-header-divider\" colspan=\"4\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [label]=\"yearLabel()\"\n [rows]=\"months()\"\n [todayValue]=\"todayMonth()!\"\n [startValue]=\"selectedMonth()!\"\n [endValue]=\"selectedMonth()!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"datePickerService.getMonth(activeDate)\"\n (selectedValueChange)=\"onMonthSelected($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: [":host{display:block}table{width:100%;padding:6px;border-collapse:separate}.calendar-table-header-divider{border-bottom:1px solid var(--apex-calendar-year-view-table-header-border-bottom-color, #C6C6C6)}\n"] }]
|
|
915
931
|
}], ctorParameters: () => [{ type: ApexDatepickerService }], propDecorators: { CalendarBody: [{
|
|
916
932
|
type: ViewChild,
|
|
917
933
|
args: [CalendarBody]
|
|
@@ -1021,6 +1037,22 @@ class ApexCalendarMonthView {
|
|
|
1021
1037
|
this.activeDateChange = new EventEmitter();
|
|
1022
1038
|
this.userSelection = new EventEmitter();
|
|
1023
1039
|
this.selectedChange = new EventEmitter();
|
|
1040
|
+
this.monthLabel = signal('', ...(ngDevMode ? [{ debugName: "monthLabel" }] : []));
|
|
1041
|
+
/** Grid of calendar cells representing the dates of the month. */
|
|
1042
|
+
this.weeks = signal([], ...(ngDevMode ? [{ debugName: "weeks" }] : []));
|
|
1043
|
+
/** Start value of the currently-shown date range. */
|
|
1044
|
+
this.rangeStart = signal(null, ...(ngDevMode ? [{ debugName: "rangeStart" }] : []));
|
|
1045
|
+
/** End value of the currently-shown date range. */
|
|
1046
|
+
this.rangeEnd = signal(null, ...(ngDevMode ? [{ debugName: "rangeEnd" }] : []));
|
|
1047
|
+
/** Start of the preview range. */
|
|
1048
|
+
this.previewStart = signal(null, ...(ngDevMode ? [{ debugName: "previewStart" }] : []));
|
|
1049
|
+
/** End of the preview range. */
|
|
1050
|
+
this.previewEnd = signal(null, ...(ngDevMode ? [{ debugName: "previewEnd" }] : []));
|
|
1051
|
+
/** Whether the user is currently selecting a range of dates. */
|
|
1052
|
+
this.isRange = signal(false, ...(ngDevMode ? [{ debugName: "isRange" }] : []));
|
|
1053
|
+
/** The date of the month that today falls on. Null if today is in another month. */
|
|
1054
|
+
this.todayDate = signal(null, ...(ngDevMode ? [{ debugName: "todayDate" }] : []));
|
|
1055
|
+
this.weekdays = signal([], ...(ngDevMode ? [{ debugName: "weekdays" }] : []));
|
|
1024
1056
|
this.uniqueIdCounter = 0;
|
|
1025
1057
|
this._activeDate = this.datepickerService.today();
|
|
1026
1058
|
}
|
|
@@ -1146,7 +1178,7 @@ class ApexCalendarMonthView {
|
|
|
1146
1178
|
return;
|
|
1147
1179
|
case 'Escape':
|
|
1148
1180
|
// Abort the current range selection if the user presses escape mid-selection.
|
|
1149
|
-
if (this.previewEnd != null && !hasModifierKey(event)) {
|
|
1181
|
+
if (this.previewEnd() != null && !hasModifierKey(event)) {
|
|
1150
1182
|
this.clearPreview();
|
|
1151
1183
|
// If a drag is in progress, cancel the drag without changing the
|
|
1152
1184
|
// current selection.
|
|
@@ -1179,13 +1211,13 @@ class ApexCalendarMonthView {
|
|
|
1179
1211
|
// events aren't fired for single date selections.
|
|
1180
1212
|
const value = (cell ? cell.rawValue : null);
|
|
1181
1213
|
const previewRange = this.rangeSelectionStartegy.createPreview(value, this.selected);
|
|
1182
|
-
this.previewStart
|
|
1183
|
-
this.previewEnd
|
|
1214
|
+
this.previewStart.set(this.getCellCompareValue(previewRange.start));
|
|
1215
|
+
this.previewEnd.set(this.getCellCompareValue(previewRange.end));
|
|
1184
1216
|
if (this.activeDrag && value) {
|
|
1185
1217
|
const dragRange = this.rangeSelectionStartegy.createDrag?.(this.activeDrag.value, this.selected, value);
|
|
1186
1218
|
if (dragRange) {
|
|
1187
|
-
this.previewStart
|
|
1188
|
-
this.previewEnd
|
|
1219
|
+
this.previewStart.set(this.getCellCompareValue(dragRange.start));
|
|
1220
|
+
this.previewEnd.set(this.getCellCompareValue(dragRange.end));
|
|
1189
1221
|
}
|
|
1190
1222
|
}
|
|
1191
1223
|
}
|
|
@@ -1202,7 +1234,8 @@ class ApexCalendarMonthView {
|
|
|
1202
1234
|
this.calendarBody.scheduleFocusActiveCellAfterViewChecked();
|
|
1203
1235
|
}
|
|
1204
1236
|
clearPreview() {
|
|
1205
|
-
this.previewStart
|
|
1237
|
+
this.previewStart.set(null);
|
|
1238
|
+
this.previewEnd.set(null);
|
|
1206
1239
|
}
|
|
1207
1240
|
/**
|
|
1208
1241
|
* Gets the date in this month that the given Date falls on.
|
|
@@ -1216,11 +1249,11 @@ class ApexCalendarMonthView {
|
|
|
1216
1249
|
init() {
|
|
1217
1250
|
this.setRanges(this.selected);
|
|
1218
1251
|
ApexDatepickerService;
|
|
1219
|
-
this.todayDate
|
|
1220
|
-
this.monthLabel
|
|
1252
|
+
this.todayDate.set(this.getCellCompareValue(this.datepickerService.today()));
|
|
1253
|
+
this.monthLabel.set(this.datepickerService.dateFormats.display.monthLabel
|
|
1221
1254
|
? this.datepickerService.formatDate(this.activeDate, this.datepickerService.dateFormats.display.monthLabel)
|
|
1222
1255
|
: this.datepickerService
|
|
1223
|
-
.getMonthNames('short')[this.datepickerService.getMonth(this.activeDate)].toLocaleUpperCase();
|
|
1256
|
+
.getMonthNames('short')[this.datepickerService.getMonth(this.activeDate)].toLocaleUpperCase());
|
|
1224
1257
|
let firstOfMonth = this.datepickerService.createDate(this.datepickerService.getYear(this.activeDate), this.datepickerService.getMonth(this.activeDate), 1);
|
|
1225
1258
|
this.firstWeekOffset =
|
|
1226
1259
|
(this.datepickerService.DAYS_PER_WEEK +
|
|
@@ -1232,13 +1265,15 @@ class ApexCalendarMonthView {
|
|
|
1232
1265
|
}
|
|
1233
1266
|
setRanges(selectedValue) {
|
|
1234
1267
|
if (selectedValue instanceof DateRange) {
|
|
1235
|
-
this.rangeStart
|
|
1236
|
-
this.rangeEnd
|
|
1237
|
-
this.isRange
|
|
1268
|
+
this.rangeStart.set(this.getCellCompareValue(selectedValue.start));
|
|
1269
|
+
this.rangeEnd.set(this.getCellCompareValue(selectedValue.end));
|
|
1270
|
+
this.isRange.set(true);
|
|
1238
1271
|
}
|
|
1239
1272
|
else if (selectedValue instanceof Date) {
|
|
1240
|
-
|
|
1241
|
-
this.
|
|
1273
|
+
const val = this.getCellCompareValue(selectedValue);
|
|
1274
|
+
this.rangeStart.set(val);
|
|
1275
|
+
this.rangeEnd.set(val);
|
|
1276
|
+
this.isRange.set(false);
|
|
1242
1277
|
}
|
|
1243
1278
|
}
|
|
1244
1279
|
getCellCompareValue(date) {
|
|
@@ -1260,22 +1295,23 @@ class ApexCalendarMonthView {
|
|
|
1260
1295
|
let weekdays = longWeekdays.map((long, i) => {
|
|
1261
1296
|
return { long, narrow: narrowWeekdays[i], id: this.uniqueIdCounter++ };
|
|
1262
1297
|
});
|
|
1263
|
-
this.weekdays
|
|
1298
|
+
this.weekdays.set(weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek)));
|
|
1264
1299
|
}
|
|
1265
1300
|
createWeekCells() {
|
|
1266
1301
|
const daysInMonth = this.datepickerService.getNumDaysInMonth(this.activeDate);
|
|
1267
1302
|
const dateNames = this.datepickerService.getDateNames();
|
|
1268
|
-
|
|
1303
|
+
const weeks = [[]];
|
|
1269
1304
|
for (let i = 0, cell = this.firstWeekOffset; i < daysInMonth; i++, cell++) {
|
|
1270
1305
|
if (cell == this.datepickerService.DAYS_PER_WEEK) {
|
|
1271
|
-
|
|
1306
|
+
weeks.push([]);
|
|
1272
1307
|
cell = 0;
|
|
1273
1308
|
}
|
|
1274
1309
|
const date = this.datepickerService.createDate(this.datepickerService.getYear(this.activeDate), this.datepickerService.getMonth(this.activeDate), i + 1);
|
|
1275
1310
|
const enabled = this.shouldEnableDate(date);
|
|
1276
1311
|
const ariaLabel = this.datepickerService.formatDate(date, this.datepickerService.dateFormats.display.dateA11yLabel);
|
|
1277
|
-
|
|
1312
|
+
weeks[weeks.length - 1].push(new CalendarCell(i + 1, dateNames[i], ariaLabel, enabled, this.getCellCompareValue(date), date));
|
|
1278
1313
|
}
|
|
1314
|
+
this.weeks.set(weeks);
|
|
1279
1315
|
}
|
|
1280
1316
|
hasSameMonthAndYear(firstDate, secondDate) {
|
|
1281
1317
|
return !!(firstDate &&
|
|
@@ -1307,13 +1343,13 @@ class ApexCalendarMonthView {
|
|
|
1307
1343
|
return this.datepickerService.createDate(this.datepickerService.getYear(this.activeDate), this.datepickerService.getMonth(this.activeDate), dayOfMonth);
|
|
1308
1344
|
}
|
|
1309
1345
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexCalendarMonthView, deps: [{ token: ApexDatepickerService }, { token: DefaultCalendarRangeStrategy }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1310
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexCalendarMonthView, isStandalone: true, selector: "apex-calendar-month-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", activeDrag: "activeDrag" }, outputs: { dragStarted: "dragStarted", dragEnded: "dragEnded", activeDateChange: "activeDateChange", userSelection: "userSelection", selectedChange: "selectedChange" }, viewQueries: [{ propertyName: "calendarBody", first: true, predicate: CalendarBody, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<table class=\"calendar-table\" role=\"grid\">\n <thead class=\"calendar-table-header\">\n <tr>\n @for (day of weekdays; track day.id) {\n <th scope=\"col\">\n <span class=\"cdk-visually-hidden\">{{ day.long }}</span>\n\n <span aria-hidden=\"true\">{{ day.narrow }}</span>\n </th>\n }\n </tr>\n\n <tr aria-hidden=\"true\">\n <th class=\"calendar-table-header-divider\" colspan=\"7\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [label]=\"monthLabel\"\n [rows]=\"weeks\"\n [todayValue]=\"todayDate!\"\n [startValue]=\"rangeStart!\"\n [endValue]=\"rangeEnd!\"\n [previewStart]=\"previewStart\"\n [previewEnd]=\"previewEnd\"\n [isRange]=\"isRange\"\n [activeCell]=\"getActiveCell()\"\n [labelMinRequiredCells]=\"2\"\n (dragStarted)=\"dragStarted.emit($event)\"\n (dragEnded)=\"onDragEnded($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (selectedValueChange)=\"dateSelected($event)\"\n (previewChange)=\"previewChanged($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: ["table{width:100%;border-spacing:0px 4px;border-collapse:separate;padding:6px}th{color:var(--apex-calendar-month-view-table-header-color, #C6C6C6)}.calendar-table-header-divider{border-bottom:1px solid var(--apex-datepicker-calendar-month-view-table-header-border-bottom-color, #C6C6C6)}\n"], dependencies: [{ kind: "component", type: CalendarBody, selector: "[calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"] }] }); }
|
|
1346
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexCalendarMonthView, isStandalone: true, selector: "apex-calendar-month-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", activeDrag: "activeDrag" }, outputs: { dragStarted: "dragStarted", dragEnded: "dragEnded", activeDateChange: "activeDateChange", userSelection: "userSelection", selectedChange: "selectedChange" }, viewQueries: [{ propertyName: "calendarBody", first: true, predicate: CalendarBody, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<table class=\"calendar-table\" role=\"grid\">\n <thead class=\"calendar-table-header\">\n <tr>\n @for (day of weekdays(); track day.id) {\n <th scope=\"col\">\n <span class=\"cdk-visually-hidden\">{{ day.long }}</span>\n\n <span aria-hidden=\"true\">{{ day.narrow }}</span>\n </th>\n }\n </tr>\n\n <tr aria-hidden=\"true\">\n <th class=\"calendar-table-header-divider\" colspan=\"7\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [label]=\"monthLabel()\"\n [rows]=\"weeks()\"\n [todayValue]=\"todayDate()!\"\n [startValue]=\"rangeStart()!\"\n [endValue]=\"rangeEnd()!\"\n [previewStart]=\"previewStart()\"\n [previewEnd]=\"previewEnd()\"\n [isRange]=\"isRange()\"\n [activeCell]=\"getActiveCell()\"\n [labelMinRequiredCells]=\"2\"\n (dragStarted)=\"dragStarted.emit($event)\"\n (dragEnded)=\"onDragEnded($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (selectedValueChange)=\"dateSelected($event)\"\n (previewChange)=\"previewChanged($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: ["table{width:100%;border-spacing:0px 4px;border-collapse:separate;padding:6px}th{color:var(--apex-calendar-month-view-table-header-color, #C6C6C6)}.calendar-table-header-divider{border-bottom:1px solid var(--apex-datepicker-calendar-month-view-table-header-border-bottom-color, #C6C6C6)}\n"], dependencies: [{ kind: "component", type: CalendarBody, selector: "[calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"] }] }); }
|
|
1311
1347
|
}
|
|
1312
1348
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexCalendarMonthView, decorators: [{
|
|
1313
1349
|
type: Component,
|
|
1314
1350
|
args: [{ selector: 'apex-calendar-month-view', imports: [
|
|
1315
1351
|
CalendarBody,
|
|
1316
|
-
], template: "<table class=\"calendar-table\" role=\"grid\">\n <thead class=\"calendar-table-header\">\n <tr>\n @for (day of weekdays; track day.id) {\n <th scope=\"col\">\n <span class=\"cdk-visually-hidden\">{{ day.long }}</span>\n\n <span aria-hidden=\"true\">{{ day.narrow }}</span>\n </th>\n }\n </tr>\n\n <tr aria-hidden=\"true\">\n <th class=\"calendar-table-header-divider\" colspan=\"7\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [label]=\"monthLabel\"\n [rows]=\"weeks\"\n [todayValue]=\"todayDate!\"\n [startValue]=\"rangeStart!\"\n [endValue]=\"rangeEnd!\"\n [previewStart]=\"previewStart\"\n [previewEnd]=\"previewEnd\"\n [isRange]=\"isRange\"\n [activeCell]=\"getActiveCell()\"\n [labelMinRequiredCells]=\"2\"\n (dragStarted)=\"dragStarted.emit($event)\"\n (dragEnded)=\"onDragEnded($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (selectedValueChange)=\"dateSelected($event)\"\n (previewChange)=\"previewChanged($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: ["table{width:100%;border-spacing:0px 4px;border-collapse:separate;padding:6px}th{color:var(--apex-calendar-month-view-table-header-color, #C6C6C6)}.calendar-table-header-divider{border-bottom:1px solid var(--apex-datepicker-calendar-month-view-table-header-border-bottom-color, #C6C6C6)}\n"] }]
|
|
1352
|
+
], template: "<table class=\"calendar-table\" role=\"grid\">\n <thead class=\"calendar-table-header\">\n <tr>\n @for (day of weekdays(); track day.id) {\n <th scope=\"col\">\n <span class=\"cdk-visually-hidden\">{{ day.long }}</span>\n\n <span aria-hidden=\"true\">{{ day.narrow }}</span>\n </th>\n }\n </tr>\n\n <tr aria-hidden=\"true\">\n <th class=\"calendar-table-header-divider\" colspan=\"7\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [label]=\"monthLabel()\"\n [rows]=\"weeks()\"\n [todayValue]=\"todayDate()!\"\n [startValue]=\"rangeStart()!\"\n [endValue]=\"rangeEnd()!\"\n [previewStart]=\"previewStart()\"\n [previewEnd]=\"previewEnd()\"\n [isRange]=\"isRange()\"\n [activeCell]=\"getActiveCell()\"\n [labelMinRequiredCells]=\"2\"\n (dragStarted)=\"dragStarted.emit($event)\"\n (dragEnded)=\"onDragEnded($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (selectedValueChange)=\"dateSelected($event)\"\n (previewChange)=\"previewChanged($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: ["table{width:100%;border-spacing:0px 4px;border-collapse:separate;padding:6px}th{color:var(--apex-calendar-month-view-table-header-color, #C6C6C6)}.calendar-table-header-divider{border-bottom:1px solid var(--apex-datepicker-calendar-month-view-table-header-border-bottom-color, #C6C6C6)}\n"] }]
|
|
1317
1353
|
}], ctorParameters: () => [{ type: ApexDatepickerService }, { type: DefaultCalendarRangeStrategy }], propDecorators: { calendarBody: [{
|
|
1318
1354
|
type: ViewChild,
|
|
1319
1355
|
args: [CalendarBody]
|
|
@@ -1348,6 +1384,12 @@ class ApexCalendarMultiYearView {
|
|
|
1348
1384
|
this.yearSelected = new EventEmitter();
|
|
1349
1385
|
/** Emits when any date is activated. */
|
|
1350
1386
|
this.activeDateChange = new EventEmitter();
|
|
1387
|
+
/** Grid of calendar cells representing the currently displayed years. */
|
|
1388
|
+
this._years = signal([], ...(ngDevMode ? [{ debugName: "_years" }] : []));
|
|
1389
|
+
/** The year that today falls on. */
|
|
1390
|
+
this._todayYear = signal(0, ...(ngDevMode ? [{ debugName: "_todayYear" }] : []));
|
|
1391
|
+
/** The year of the selected date. Null if the selected date is null. */
|
|
1392
|
+
this.selectedYear = signal(null, ...(ngDevMode ? [{ debugName: "selectedYear" }] : []));
|
|
1351
1393
|
this._activeDate = this.datePickerService.today();
|
|
1352
1394
|
}
|
|
1353
1395
|
/** The date to display in this multi-year view (everything other than the year is ignored). */
|
|
@@ -1393,7 +1435,7 @@ class ApexCalendarMultiYearView {
|
|
|
1393
1435
|
this.init();
|
|
1394
1436
|
}
|
|
1395
1437
|
init() {
|
|
1396
|
-
this._todayYear
|
|
1438
|
+
this._todayYear.set(this.datePickerService.getYear(this.datePickerService.today()));
|
|
1397
1439
|
// We want a range years such that we maximize the number of
|
|
1398
1440
|
// enabled dates visible at once. This prevents issues where the minimum year
|
|
1399
1441
|
// is the last item of a page OR the maximum year is the first item of a page.
|
|
@@ -1401,14 +1443,15 @@ class ApexCalendarMultiYearView {
|
|
|
1401
1443
|
// *actual* first rendered year in the multi-year view.
|
|
1402
1444
|
const activeYear = this.datePickerService.getYear(this._activeDate);
|
|
1403
1445
|
const minYearOfPage = activeYear - this.datePickerService.getActiveOffset(this.activeDate, this.minDate, this.maxDate);
|
|
1404
|
-
|
|
1446
|
+
const years = [];
|
|
1405
1447
|
for (let i = 0, row = []; i < this.datePickerService.yearsPerPage; i++) {
|
|
1406
1448
|
row.push(minYearOfPage + i);
|
|
1407
1449
|
if (row.length == this.datePickerService.yearsPerRow) {
|
|
1408
|
-
|
|
1450
|
+
years.push(row.map(year => this.createCellForYear(year)));
|
|
1409
1451
|
row = [];
|
|
1410
1452
|
}
|
|
1411
1453
|
}
|
|
1454
|
+
this._years.set(years);
|
|
1412
1455
|
}
|
|
1413
1456
|
/** Handles when a new year is selected. */
|
|
1414
1457
|
onYearSelected(event) {
|
|
@@ -1530,15 +1573,15 @@ class ApexCalendarMultiYearView {
|
|
|
1530
1573
|
}
|
|
1531
1574
|
/** Sets the currently-highlighted year based on a model value. */
|
|
1532
1575
|
setSelectedYear(value) {
|
|
1533
|
-
this.selectedYear
|
|
1576
|
+
this.selectedYear.set(null);
|
|
1534
1577
|
if (value instanceof DateRange) {
|
|
1535
1578
|
const displayValue = value.start || value.end;
|
|
1536
1579
|
if (displayValue) {
|
|
1537
|
-
this.selectedYear
|
|
1580
|
+
this.selectedYear.set(this.datePickerService.getYear(displayValue));
|
|
1538
1581
|
}
|
|
1539
1582
|
}
|
|
1540
1583
|
else if (value) {
|
|
1541
|
-
this.selectedYear
|
|
1584
|
+
this.selectedYear.set(this.datePickerService.getYear(value));
|
|
1542
1585
|
}
|
|
1543
1586
|
}
|
|
1544
1587
|
isSameMultiYearView(date1, date2, minDate, maxDate) {
|
|
@@ -1560,7 +1603,7 @@ class ApexCalendarMultiYearView {
|
|
|
1560
1603
|
return startingYear;
|
|
1561
1604
|
}
|
|
1562
1605
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexCalendarMultiYearView, deps: [{ token: ApexDatepickerService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1563
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: ApexCalendarMultiYearView, isStandalone: true, selector: "apex-calendar-multi-year-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", yearSelected: "yearSelected", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "calendarBody", first: true, predicate: CalendarBody, descendants: true }], ngImport: i0, template: "<table class=\"calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"calendar-table-header\">\n <tr>\n <th class=\"calendar-table-header-divider\" colspan=\"4\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [rows]=\"_years\"\n [todayValue]=\"_todayYear\"\n [startValue]=\"selectedYear!\"\n [endValue]=\"selectedYear!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"getActiveCell()\"\n (selectedValueChange)=\"onYearSelected($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: [":host{display:block}table{width:100%;padding:6px;border-collapse:separate}.calendar-table-header-divider{border-bottom:1px solid var(--apex-calendar-multi-year-view-table-header-border-bottom-color, #C6C6C6)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: CalendarBody, selector: "[calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
|
|
1606
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: ApexCalendarMultiYearView, isStandalone: true, selector: "apex-calendar-multi-year-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate" }, outputs: { selectedChange: "selectedChange", yearSelected: "yearSelected", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "calendarBody", first: true, predicate: CalendarBody, descendants: true }], ngImport: i0, template: "<table class=\"calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"calendar-table-header\">\n <tr>\n <th class=\"calendar-table-header-divider\" colspan=\"4\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [rows]=\"_years()\"\n [todayValue]=\"_todayYear()\"\n [startValue]=\"selectedYear()!\"\n [endValue]=\"selectedYear()!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"getActiveCell()\"\n (selectedValueChange)=\"onYearSelected($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: [":host{display:block}table{width:100%;padding:6px;border-collapse:separate}.calendar-table-header-divider{border-bottom:1px solid var(--apex-calendar-multi-year-view-table-header-border-bottom-color, #C6C6C6)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: CalendarBody, selector: "[calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
|
|
1564
1607
|
}
|
|
1565
1608
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexCalendarMultiYearView, decorators: [{
|
|
1566
1609
|
type: Component,
|
|
@@ -1568,7 +1611,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
1568
1611
|
FormsModule,
|
|
1569
1612
|
CalendarBody,
|
|
1570
1613
|
ReactiveFormsModule,
|
|
1571
|
-
], template: "<table class=\"calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"calendar-table-header\">\n <tr>\n <th class=\"calendar-table-header-divider\" colspan=\"4\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [rows]=\"_years\"\n [todayValue]=\"_todayYear\"\n [startValue]=\"selectedYear!\"\n [endValue]=\"selectedYear!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"getActiveCell()\"\n (selectedValueChange)=\"onYearSelected($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: [":host{display:block}table{width:100%;padding:6px;border-collapse:separate}.calendar-table-header-divider{border-bottom:1px solid var(--apex-calendar-multi-year-view-table-header-border-bottom-color, #C6C6C6)}\n"] }]
|
|
1614
|
+
], template: "<table class=\"calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"calendar-table-header\">\n <tr>\n <th class=\"calendar-table-header-divider\" colspan=\"4\"></th>\n </tr>\n </thead>\n\n <tbody calendar-body\n [rows]=\"_years()\"\n [todayValue]=\"_todayYear()\"\n [startValue]=\"selectedYear()!\"\n [endValue]=\"selectedYear()!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"getActiveCell()\"\n (selectedValueChange)=\"onYearSelected($event)\"\n (activeDateChange)=\"updateActiveDate($event)\"\n (keyup)=\"handleCalendarBodyKeyup($event)\"\n (keydown)=\"handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", styles: [":host{display:block}table{width:100%;padding:6px;border-collapse:separate}.calendar-table-header-divider{border-bottom:1px solid var(--apex-calendar-multi-year-view-table-header-border-bottom-color, #C6C6C6)}\n"] }]
|
|
1572
1615
|
}], ctorParameters: () => [{ type: ApexDatepickerService }], propDecorators: { activeDate: [{
|
|
1573
1616
|
type: Input
|
|
1574
1617
|
}], selected: [{
|
|
@@ -1612,9 +1655,9 @@ class ApexCalendarComponent {
|
|
|
1612
1655
|
this.selectedChange = new EventEmitter();
|
|
1613
1656
|
this.userSelection = new EventEmitter();
|
|
1614
1657
|
this.calendarClose = new EventEmitter();
|
|
1615
|
-
this.isButtonHidden = true;
|
|
1616
|
-
this.activeDateView = 'month';
|
|
1617
|
-
this.activeDrag = null;
|
|
1658
|
+
this.isButtonHidden = signal(true, ...(ngDevMode ? [{ debugName: "isButtonHidden" }] : []));
|
|
1659
|
+
this.activeDateView = signal('month', ...(ngDevMode ? [{ debugName: "activeDateView" }] : []));
|
|
1660
|
+
this.activeDrag = signal(null, ...(ngDevMode ? [{ debugName: "activeDrag" }] : []));
|
|
1618
1661
|
}
|
|
1619
1662
|
get activeDate() {
|
|
1620
1663
|
return this._activeDate;
|
|
@@ -1648,7 +1691,7 @@ class ApexCalendarComponent {
|
|
|
1648
1691
|
this._maxDate = this.datePickerService.getValidDateOrNull(this.datePickerService.deserialize(value));
|
|
1649
1692
|
}
|
|
1650
1693
|
calendarDateViewChange() {
|
|
1651
|
-
this.activeDateView
|
|
1694
|
+
this.activeDateView.set(this.activeDateView() == 'month' ? 'multi-year' : 'month');
|
|
1652
1695
|
}
|
|
1653
1696
|
onCalendarDateViewKeydown(event) {
|
|
1654
1697
|
if (event.code.startsWith('Arrow')) {
|
|
@@ -1660,15 +1703,15 @@ class ApexCalendarComponent {
|
|
|
1660
1703
|
}
|
|
1661
1704
|
goToPreviousView() {
|
|
1662
1705
|
this.activeDate =
|
|
1663
|
-
this.activeDateView == 'month'
|
|
1706
|
+
this.activeDateView() == 'month'
|
|
1664
1707
|
? this.datePickerService.addCalendarMonths(this.activeDate, -1)
|
|
1665
|
-
: this.datePickerService.addCalendarYears(this.activeDate, this.activeDateView == 'year' ? -1 : -this.datePickerService.yearsPerPage);
|
|
1708
|
+
: this.datePickerService.addCalendarYears(this.activeDate, this.activeDateView() == 'year' ? -1 : -this.datePickerService.yearsPerPage);
|
|
1666
1709
|
}
|
|
1667
1710
|
goToNextView() {
|
|
1668
1711
|
this.activeDate =
|
|
1669
|
-
this.activeDateView == 'month'
|
|
1712
|
+
this.activeDateView() == 'month'
|
|
1670
1713
|
? this.datePickerService.addCalendarMonths(this.activeDate, 1)
|
|
1671
|
-
: this.datePickerService.addCalendarYears(this.activeDate, this.activeDateView == 'year' ? 1 : this.datePickerService.yearsPerPage);
|
|
1714
|
+
: this.datePickerService.addCalendarYears(this.activeDate, this.activeDateView() == 'year' ? 1 : this.datePickerService.yearsPerPage);
|
|
1672
1715
|
}
|
|
1673
1716
|
onArrowKeydown(event, direction) {
|
|
1674
1717
|
if (event.code.startsWith('Arrow')) {
|
|
@@ -1693,32 +1736,32 @@ class ApexCalendarComponent {
|
|
|
1693
1736
|
return (!this.maxDate || !this.isSameView(this.activeDate, this.maxDate));
|
|
1694
1737
|
}
|
|
1695
1738
|
dragStarted(event) {
|
|
1696
|
-
this.activeDrag
|
|
1739
|
+
this.activeDrag.set(event);
|
|
1697
1740
|
}
|
|
1698
1741
|
/**
|
|
1699
1742
|
* Called when a drag completes. It may end in cancelation or in the selection
|
|
1700
1743
|
* of a new range.
|
|
1701
1744
|
*/
|
|
1702
1745
|
dragEnded(event) {
|
|
1703
|
-
if (!this.activeDrag)
|
|
1746
|
+
if (!this.activeDrag())
|
|
1704
1747
|
return;
|
|
1705
1748
|
if (event.value) {
|
|
1706
1749
|
this.userDragDrop.emit(event);
|
|
1707
1750
|
}
|
|
1708
|
-
this.activeDrag
|
|
1751
|
+
this.activeDrag.set(null);
|
|
1709
1752
|
}
|
|
1710
1753
|
get viewButtonText() {
|
|
1711
|
-
if (this.activeDateView === 'month') {
|
|
1754
|
+
if (this.activeDateView() === 'month') {
|
|
1712
1755
|
return this.getCurrentMonthAndYear(this.activeDate);
|
|
1713
1756
|
}
|
|
1714
|
-
if (this.activeDateView === 'year') {
|
|
1757
|
+
if (this.activeDateView() === 'year') {
|
|
1715
1758
|
return this.getCurrentYear(this.activeDate);
|
|
1716
1759
|
}
|
|
1717
1760
|
return this.formatYearRange(...this.formatMinAndMaxYearLabels());
|
|
1718
1761
|
}
|
|
1719
1762
|
goToDateInView(date, view) {
|
|
1720
1763
|
this.activeDate = date;
|
|
1721
|
-
this.activeDateView
|
|
1764
|
+
this.activeDateView.set(view);
|
|
1722
1765
|
}
|
|
1723
1766
|
monthSelectedInYearView(normalizedMonth) {
|
|
1724
1767
|
this.monthSelected.emit(normalizedMonth);
|
|
@@ -1736,10 +1779,10 @@ class ApexCalendarComponent {
|
|
|
1736
1779
|
}
|
|
1737
1780
|
toggleButtonVisibility(event) {
|
|
1738
1781
|
if (event.type === 'focusout') {
|
|
1739
|
-
this.isButtonHidden
|
|
1782
|
+
this.isButtonHidden.set(true);
|
|
1740
1783
|
}
|
|
1741
1784
|
else if (event.type === 'focusin') {
|
|
1742
|
-
this.isButtonHidden
|
|
1785
|
+
this.isButtonHidden.set(false);
|
|
1743
1786
|
}
|
|
1744
1787
|
}
|
|
1745
1788
|
getCurrentMonthAndYear(date) {
|
|
@@ -1766,18 +1809,18 @@ class ApexCalendarComponent {
|
|
|
1766
1809
|
return [minYearLabel, maxYearLabel];
|
|
1767
1810
|
}
|
|
1768
1811
|
isSameView(date1, date2) {
|
|
1769
|
-
if (this.activeDateView == 'month') {
|
|
1812
|
+
if (this.activeDateView() == 'month') {
|
|
1770
1813
|
return (this.datePickerService.getYear(date1) == this.datePickerService.getYear(date2) &&
|
|
1771
1814
|
this.datePickerService.getMonth(date1) == this.datePickerService.getMonth(date2));
|
|
1772
1815
|
}
|
|
1773
|
-
if (this.activeDateView == 'year') {
|
|
1816
|
+
if (this.activeDateView() == 'year') {
|
|
1774
1817
|
return this.datePickerService.getYear(date1) == this.datePickerService.getYear(date2);
|
|
1775
1818
|
}
|
|
1776
1819
|
// Otherwise we are in 'multi-year' view.
|
|
1777
1820
|
return this.datePickerService.isSameMultiYearView(date1, date2, this.minDate, this.maxDate);
|
|
1778
1821
|
}
|
|
1779
1822
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexCalendarComponent, deps: [{ token: ApexDatepickerService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1780
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexCalendarComponent, isStandalone: true, selector: "apex-calendar", inputs: { activeDate: "activeDate", minDate: "minDate", selected: "selected", maxDate: "maxDate", comparisonStart: "comparisonStart", comparisonEnd: "comparisonEnd", startDateAccessibleName: "startDateAccessibleName", endDateAccessibleName: "endDateAccessibleName" }, outputs: { monthSelected: "monthSelected", yearSelected: "yearSelected", activeDateChange: "activeDateChange", userDragDrop: "userDragDrop", selectedChange: "selectedChange", userSelection: "userSelection", calendarClose: "calendarClose" }, ngImport: i0, template: "<div class=\"container\">\n <div class=\"header\">\n <span \n tabindex=\"0\"\n class=\"active-date-view\"\n (click)=\"calendarDateViewChange()\"\n (keydown)=\"onCalendarDateViewKeydown($event)\">\n {{ viewButtonText }}\n </span>\n\n <div class=\"header-navigation\">\n <div class=\"chevron-wrapper\"\n tabindex=\"0\"\n [class.disabled]=\"!previousEnabled()\"\n (click)=\"goToPreviousView()\"\n (keydown)=\"onArrowKeydown($event, 'previous')\">\n <span class=\"chevron left\"></span>\n </div>\n\n <div class=\"chevron-wrapper\" \n tabindex=\"0\"\n [class.disabled]=\"!nextEnabled()\" \n (click)=\"goToNextView()\"\n (keydown)=\"onArrowKeydown($event, 'next')\">\n <span class=\"chevron right\"></span>\n </div>\n </div>\n </div>\n\n <div class=\"calendar\">\n @switch (activeDateView) {\n @case ('month') {\n <apex-calendar-month-view\n [(activeDate)]=\"activeDate\"\n [(selected)]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (userSelection)=\"dateSelected($event)\"\n (dragStarted)=\"dragStarted($event)\"\n (dragEnded)=\"dragEnded($event)\"\n [activeDrag]=\"activeDrag\">\n </apex-calendar-month-view>\n }\n\n @case ('year') {\n <apex-calendar-year-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (monthSelected)=\"monthSelectedInYearView($event)\"\n (selectedChange)=\"goToDateInView($event, 'month')\">\n </apex-calendar-year-view>\n }\n\n @case ('multi-year') {\n <apex-calendar-multi-year-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (yearSelected)=\"yearSelectedInMultiYearView($event)\"\n (selectedChange)=\"goToDateInView($event, 'year')\">\n </apex-calendar-multi-year-view>\n }\n }\n </div>\n</div>\n\n<apex-button\n [ariaLabel]=\"'Button for closing the calendar.'\" \n (clickChange)=\"calendarClose.emit($event)\" \n (focusChange)=\"toggleButtonVisibility($event)\"\n [class.cdk-visually-hidden]=\"isButtonHidden\">\n Close Calendar\n</apex-button>\n", styles: [":host{position:relative}.header{display:flex;justify-content:space-between;align-items:center;color:var(--apex-datepicker-header-text-color, #FF7955);padding:8px 8px 0}.active-date-view{cursor:pointer;border-radius:4px;padding:2px 4px}.active-date-view:focus{outline:none;color:var(--apex-calendar-header-active-date-view-focus-color, #FFFFFF);background-color:var(--apex-calendar-header-active-date-view-focus-background-color, #FF7955)}.active-date-view:hover{border-radius:4px;color:var(--apex-calendar-header-active-date-view-hover-color, #FFFFFF);background-color:var(--apex-calendar-header-active-date-view-hover-background-color, #FF7955)}.header-navigation{display:flex}.chevron-wrapper{display:flex;border-radius:50%}.chevron-wrapper:focus{outline:none}.chevron-wrapper:hover,.chevron-wrapper:focus:not(.disabled){color:var(--apex-calendar-header-chevron-hover-focus-color, #FFFFFF);background-color:var(--apex-calendar-header-chevron-hover-focus-background-color, #FF7955)}.chevron{width:24px;height:24px;padding:8px;position:relative;cursor:pointer}.chevron:after{inset:0;position:absolute;content:\"\";margin:15.5px;border:0 solid currentColor;border-top-width:2px;border-left-width:2px}.chevron.right{transform:rotate(135deg)}.chevron-wrapper.disabled{pointer-events:none;background-color:none;color:var(--apex-calendar-header-chevron-disabled-color, #5D6068)}.chevron.left{transform:rotate(-45deg)}apex-button{position:absolute;bottom:-50px}\n"], dependencies: [{ kind: "component", type: ApexButtonComponent, selector: "apex-button", inputs: ["link", "state", "options", "ariaLabel"], outputs: ["focusChange", "clickChange"] }, { kind: "component", type: ApexCalendarYearView, selector: "apex-calendar-year-view", inputs: ["activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "monthSelected", "activeDateChange"] }, { kind: "component", type: ApexCalendarMonthView, selector: "apex-calendar-month-view", inputs: ["activeDate", "selected", "minDate", "maxDate", "activeDrag"], outputs: ["dragStarted", "dragEnded", "activeDateChange", "userSelection", "selectedChange"] }, { kind: "component", type: ApexCalendarMultiYearView, selector: "apex-calendar-multi-year-view", inputs: ["activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "yearSelected", "activeDateChange"] }] }); }
|
|
1823
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexCalendarComponent, isStandalone: true, selector: "apex-calendar", inputs: { activeDate: "activeDate", minDate: "minDate", selected: "selected", maxDate: "maxDate", comparisonStart: "comparisonStart", comparisonEnd: "comparisonEnd", startDateAccessibleName: "startDateAccessibleName", endDateAccessibleName: "endDateAccessibleName" }, outputs: { monthSelected: "monthSelected", yearSelected: "yearSelected", activeDateChange: "activeDateChange", userDragDrop: "userDragDrop", selectedChange: "selectedChange", userSelection: "userSelection", calendarClose: "calendarClose" }, ngImport: i0, template: "<div class=\"container\">\n <div class=\"header\">\n <span \n tabindex=\"0\"\n class=\"active-date-view\"\n (click)=\"calendarDateViewChange()\"\n (keydown)=\"onCalendarDateViewKeydown($event)\">\n {{ viewButtonText }}\n </span>\n\n <div class=\"header-navigation\">\n <div class=\"chevron-wrapper\"\n tabindex=\"0\"\n [class.disabled]=\"!previousEnabled()\"\n (click)=\"goToPreviousView()\"\n (keydown)=\"onArrowKeydown($event, 'previous')\">\n <span class=\"chevron left\"></span>\n </div>\n\n <div class=\"chevron-wrapper\" \n tabindex=\"0\"\n [class.disabled]=\"!nextEnabled()\" \n (click)=\"goToNextView()\"\n (keydown)=\"onArrowKeydown($event, 'next')\">\n <span class=\"chevron right\"></span>\n </div>\n </div>\n </div>\n\n <div class=\"calendar\">\n @switch (activeDateView()) {\n @case ('month') {\n <apex-calendar-month-view\n [(activeDate)]=\"activeDate\"\n [(selected)]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (userSelection)=\"dateSelected($event)\"\n (dragStarted)=\"dragStarted($event)\"\n (dragEnded)=\"dragEnded($event)\"\n [activeDrag]=\"activeDrag()\">\n </apex-calendar-month-view>\n }\n\n @case ('year') {\n <apex-calendar-year-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (monthSelected)=\"monthSelectedInYearView($event)\"\n (selectedChange)=\"goToDateInView($event, 'month')\">\n </apex-calendar-year-view>\n }\n\n @case ('multi-year') {\n <apex-calendar-multi-year-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (yearSelected)=\"yearSelectedInMultiYearView($event)\"\n (selectedChange)=\"goToDateInView($event, 'year')\">\n </apex-calendar-multi-year-view>\n }\n }\n </div>\n</div>\n\n<apex-button\n [ariaLabel]=\"'Button for closing the calendar.'\" \n (clickChange)=\"calendarClose.emit($event)\" \n (focusChange)=\"toggleButtonVisibility($event)\"\n [class.cdk-visually-hidden]=\"isButtonHidden()\">\n Close Calendar\n</apex-button>\n", styles: [":host{position:relative}.header{display:flex;justify-content:space-between;align-items:center;color:var(--apex-datepicker-header-text-color, #FF7955);padding:8px 8px 0}.active-date-view{cursor:pointer;border-radius:4px;padding:2px 4px}.active-date-view:focus{outline:none;color:var(--apex-calendar-header-active-date-view-focus-color, #FFFFFF);background-color:var(--apex-calendar-header-active-date-view-focus-background-color, #FF7955)}.active-date-view:hover{border-radius:4px;color:var(--apex-calendar-header-active-date-view-hover-color, #FFFFFF);background-color:var(--apex-calendar-header-active-date-view-hover-background-color, #FF7955)}.header-navigation{display:flex}.chevron-wrapper{display:flex;border-radius:50%}.chevron-wrapper:focus{outline:none}.chevron-wrapper:hover,.chevron-wrapper:focus:not(.disabled){color:var(--apex-calendar-header-chevron-hover-focus-color, #FFFFFF);background-color:var(--apex-calendar-header-chevron-hover-focus-background-color, #FF7955)}.chevron{width:24px;height:24px;padding:8px;position:relative;cursor:pointer}.chevron:after{inset:0;position:absolute;content:\"\";margin:15.5px;border:0 solid currentColor;border-top-width:2px;border-left-width:2px}.chevron.right{transform:rotate(135deg)}.chevron-wrapper.disabled{pointer-events:none;background-color:none;color:var(--apex-calendar-header-chevron-disabled-color, #5D6068)}.chevron.left{transform:rotate(-45deg)}apex-button{position:absolute;bottom:-50px}\n"], dependencies: [{ kind: "component", type: ApexButtonComponent, selector: "apex-button", inputs: ["link", "state", "options", "ariaLabel"], outputs: ["focusChange", "clickChange"] }, { kind: "component", type: ApexCalendarYearView, selector: "apex-calendar-year-view", inputs: ["activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "monthSelected", "activeDateChange"] }, { kind: "component", type: ApexCalendarMonthView, selector: "apex-calendar-month-view", inputs: ["activeDate", "selected", "minDate", "maxDate", "activeDrag"], outputs: ["dragStarted", "dragEnded", "activeDateChange", "userSelection", "selectedChange"] }, { kind: "component", type: ApexCalendarMultiYearView, selector: "apex-calendar-multi-year-view", inputs: ["activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange", "yearSelected", "activeDateChange"] }] }); }
|
|
1781
1824
|
}
|
|
1782
1825
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexCalendarComponent, decorators: [{
|
|
1783
1826
|
type: Component,
|
|
@@ -1786,7 +1829,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
|
|
|
1786
1829
|
ApexCalendarYearView,
|
|
1787
1830
|
ApexCalendarMonthView,
|
|
1788
1831
|
ApexCalendarMultiYearView,
|
|
1789
|
-
], template: "<div class=\"container\">\n <div class=\"header\">\n <span \n tabindex=\"0\"\n class=\"active-date-view\"\n (click)=\"calendarDateViewChange()\"\n (keydown)=\"onCalendarDateViewKeydown($event)\">\n {{ viewButtonText }}\n </span>\n\n <div class=\"header-navigation\">\n <div class=\"chevron-wrapper\"\n tabindex=\"0\"\n [class.disabled]=\"!previousEnabled()\"\n (click)=\"goToPreviousView()\"\n (keydown)=\"onArrowKeydown($event, 'previous')\">\n <span class=\"chevron left\"></span>\n </div>\n\n <div class=\"chevron-wrapper\" \n tabindex=\"0\"\n [class.disabled]=\"!nextEnabled()\" \n (click)=\"goToNextView()\"\n (keydown)=\"onArrowKeydown($event, 'next')\">\n <span class=\"chevron right\"></span>\n </div>\n </div>\n </div>\n\n <div class=\"calendar\">\n @switch (activeDateView) {\n @case ('month') {\n <apex-calendar-month-view\n [(activeDate)]=\"activeDate\"\n [(selected)]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (userSelection)=\"dateSelected($event)\"\n (dragStarted)=\"dragStarted($event)\"\n (dragEnded)=\"dragEnded($event)\"\n [activeDrag]=\"activeDrag\">\n </apex-calendar-month-view>\n }\n\n @case ('year') {\n <apex-calendar-year-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (monthSelected)=\"monthSelectedInYearView($event)\"\n (selectedChange)=\"goToDateInView($event, 'month')\">\n </apex-calendar-year-view>\n }\n\n @case ('multi-year') {\n <apex-calendar-multi-year-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (yearSelected)=\"yearSelectedInMultiYearView($event)\"\n (selectedChange)=\"goToDateInView($event, 'year')\">\n </apex-calendar-multi-year-view>\n }\n }\n </div>\n</div>\n\n<apex-button\n [ariaLabel]=\"'Button for closing the calendar.'\" \n (clickChange)=\"calendarClose.emit($event)\" \n (focusChange)=\"toggleButtonVisibility($event)\"\n [class.cdk-visually-hidden]=\"isButtonHidden\">\n Close Calendar\n</apex-button>\n", styles: [":host{position:relative}.header{display:flex;justify-content:space-between;align-items:center;color:var(--apex-datepicker-header-text-color, #FF7955);padding:8px 8px 0}.active-date-view{cursor:pointer;border-radius:4px;padding:2px 4px}.active-date-view:focus{outline:none;color:var(--apex-calendar-header-active-date-view-focus-color, #FFFFFF);background-color:var(--apex-calendar-header-active-date-view-focus-background-color, #FF7955)}.active-date-view:hover{border-radius:4px;color:var(--apex-calendar-header-active-date-view-hover-color, #FFFFFF);background-color:var(--apex-calendar-header-active-date-view-hover-background-color, #FF7955)}.header-navigation{display:flex}.chevron-wrapper{display:flex;border-radius:50%}.chevron-wrapper:focus{outline:none}.chevron-wrapper:hover,.chevron-wrapper:focus:not(.disabled){color:var(--apex-calendar-header-chevron-hover-focus-color, #FFFFFF);background-color:var(--apex-calendar-header-chevron-hover-focus-background-color, #FF7955)}.chevron{width:24px;height:24px;padding:8px;position:relative;cursor:pointer}.chevron:after{inset:0;position:absolute;content:\"\";margin:15.5px;border:0 solid currentColor;border-top-width:2px;border-left-width:2px}.chevron.right{transform:rotate(135deg)}.chevron-wrapper.disabled{pointer-events:none;background-color:none;color:var(--apex-calendar-header-chevron-disabled-color, #5D6068)}.chevron.left{transform:rotate(-45deg)}apex-button{position:absolute;bottom:-50px}\n"] }]
|
|
1832
|
+
], template: "<div class=\"container\">\n <div class=\"header\">\n <span \n tabindex=\"0\"\n class=\"active-date-view\"\n (click)=\"calendarDateViewChange()\"\n (keydown)=\"onCalendarDateViewKeydown($event)\">\n {{ viewButtonText }}\n </span>\n\n <div class=\"header-navigation\">\n <div class=\"chevron-wrapper\"\n tabindex=\"0\"\n [class.disabled]=\"!previousEnabled()\"\n (click)=\"goToPreviousView()\"\n (keydown)=\"onArrowKeydown($event, 'previous')\">\n <span class=\"chevron left\"></span>\n </div>\n\n <div class=\"chevron-wrapper\" \n tabindex=\"0\"\n [class.disabled]=\"!nextEnabled()\" \n (click)=\"goToNextView()\"\n (keydown)=\"onArrowKeydown($event, 'next')\">\n <span class=\"chevron right\"></span>\n </div>\n </div>\n </div>\n\n <div class=\"calendar\">\n @switch (activeDateView()) {\n @case ('month') {\n <apex-calendar-month-view\n [(activeDate)]=\"activeDate\"\n [(selected)]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (userSelection)=\"dateSelected($event)\"\n (dragStarted)=\"dragStarted($event)\"\n (dragEnded)=\"dragEnded($event)\"\n [activeDrag]=\"activeDrag()\">\n </apex-calendar-month-view>\n }\n\n @case ('year') {\n <apex-calendar-year-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (monthSelected)=\"monthSelectedInYearView($event)\"\n (selectedChange)=\"goToDateInView($event, 'month')\">\n </apex-calendar-year-view>\n }\n\n @case ('multi-year') {\n <apex-calendar-multi-year-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (yearSelected)=\"yearSelectedInMultiYearView($event)\"\n (selectedChange)=\"goToDateInView($event, 'year')\">\n </apex-calendar-multi-year-view>\n }\n }\n </div>\n</div>\n\n<apex-button\n [ariaLabel]=\"'Button for closing the calendar.'\" \n (clickChange)=\"calendarClose.emit($event)\" \n (focusChange)=\"toggleButtonVisibility($event)\"\n [class.cdk-visually-hidden]=\"isButtonHidden()\">\n Close Calendar\n</apex-button>\n", styles: [":host{position:relative}.header{display:flex;justify-content:space-between;align-items:center;color:var(--apex-datepicker-header-text-color, #FF7955);padding:8px 8px 0}.active-date-view{cursor:pointer;border-radius:4px;padding:2px 4px}.active-date-view:focus{outline:none;color:var(--apex-calendar-header-active-date-view-focus-color, #FFFFFF);background-color:var(--apex-calendar-header-active-date-view-focus-background-color, #FF7955)}.active-date-view:hover{border-radius:4px;color:var(--apex-calendar-header-active-date-view-hover-color, #FFFFFF);background-color:var(--apex-calendar-header-active-date-view-hover-background-color, #FF7955)}.header-navigation{display:flex}.chevron-wrapper{display:flex;border-radius:50%}.chevron-wrapper:focus{outline:none}.chevron-wrapper:hover,.chevron-wrapper:focus:not(.disabled){color:var(--apex-calendar-header-chevron-hover-focus-color, #FFFFFF);background-color:var(--apex-calendar-header-chevron-hover-focus-background-color, #FF7955)}.chevron{width:24px;height:24px;padding:8px;position:relative;cursor:pointer}.chevron:after{inset:0;position:absolute;content:\"\";margin:15.5px;border:0 solid currentColor;border-top-width:2px;border-left-width:2px}.chevron.right{transform:rotate(135deg)}.chevron-wrapper.disabled{pointer-events:none;background-color:none;color:var(--apex-calendar-header-chevron-disabled-color, #5D6068)}.chevron.left{transform:rotate(-45deg)}apex-button{position:absolute;bottom:-50px}\n"] }]
|
|
1790
1833
|
}], ctorParameters: () => [{ type: ApexDatepickerService }], propDecorators: { activeDate: [{
|
|
1791
1834
|
type: Input
|
|
1792
1835
|
}], minDate: [{
|