primeng 16.9.7-lts → 16.9.9-lts
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/api/treenode.d.ts +1 -0
- package/autofocus/autofocus.d.ts +8 -4
- package/calendar/calendar.d.ts +5 -2
- package/confirmdialog/confirmdialog.d.ts +1 -0
- package/dom/domhandler.d.ts +5 -1
- package/dropdown/dropdown.d.ts +1 -0
- package/dynamicdialog/dynamicdialog.d.ts +1 -0
- package/esm2022/api/treenode.mjs +1 -1
- package/esm2022/autofocus/autofocus.mjs +35 -18
- package/esm2022/calendar/calendar.mjs +84 -15
- package/esm2022/confirmdialog/confirmdialog.mjs +6 -5
- package/esm2022/dom/domhandler.mjs +65 -2
- package/esm2022/dropdown/dropdown.mjs +24 -13
- package/esm2022/dynamicdialog/dynamicdialog.mjs +5 -2
- package/esm2022/focustrap/focustrap.mjs +49 -25
- package/esm2022/inputnumber/inputnumber.interface.mjs +1 -1
- package/esm2022/inputnumber/inputnumber.mjs +15 -6
- package/esm2022/listbox/listbox.mjs +9 -2
- package/esm2022/multiselect/multiselect.mjs +7 -9
- package/esm2022/panelmenu/panelmenu.mjs +9 -2
- package/esm2022/picklist/picklist.mjs +9 -5
- package/esm2022/table/table.mjs +9 -4
- package/esm2022/tag/tag.mjs +15 -4
- package/esm2022/tooltip/tooltip.mjs +18 -8
- package/esm2022/treetable/treetable.mjs +204 -54
- package/fesm2022/primeng-autofocus.mjs +34 -17
- package/fesm2022/primeng-autofocus.mjs.map +1 -1
- package/fesm2022/primeng-calendar.mjs +83 -14
- package/fesm2022/primeng-calendar.mjs.map +1 -1
- package/fesm2022/primeng-confirmdialog.mjs +5 -4
- package/fesm2022/primeng-confirmdialog.mjs.map +1 -1
- package/fesm2022/primeng-dom.mjs +64 -1
- package/fesm2022/primeng-dom.mjs.map +1 -1
- package/fesm2022/primeng-dropdown.mjs +23 -12
- package/fesm2022/primeng-dropdown.mjs.map +1 -1
- package/fesm2022/primeng-dynamicdialog.mjs +4 -1
- package/fesm2022/primeng-dynamicdialog.mjs.map +1 -1
- package/fesm2022/primeng-focustrap.mjs +48 -24
- package/fesm2022/primeng-focustrap.mjs.map +1 -1
- package/fesm2022/primeng-inputnumber.mjs +14 -5
- package/fesm2022/primeng-inputnumber.mjs.map +1 -1
- package/fesm2022/primeng-listbox.mjs +8 -1
- package/fesm2022/primeng-listbox.mjs.map +1 -1
- package/fesm2022/primeng-multiselect.mjs +6 -8
- package/fesm2022/primeng-multiselect.mjs.map +1 -1
- package/fesm2022/primeng-panelmenu.mjs +8 -1
- package/fesm2022/primeng-panelmenu.mjs.map +1 -1
- package/fesm2022/primeng-picklist.mjs +8 -4
- package/fesm2022/primeng-picklist.mjs.map +1 -1
- package/fesm2022/primeng-table.mjs +8 -3
- package/fesm2022/primeng-table.mjs.map +1 -1
- package/fesm2022/primeng-tag.mjs +14 -3
- package/fesm2022/primeng-tag.mjs.map +1 -1
- package/fesm2022/primeng-tooltip.mjs +17 -7
- package/fesm2022/primeng-tooltip.mjs.map +1 -1
- package/fesm2022/primeng-treetable.mjs +203 -53
- package/fesm2022/primeng-treetable.mjs.map +1 -1
- package/focustrap/focustrap.d.ts +11 -3
- package/inputnumber/inputnumber.interface.d.ts +1 -1
- package/listbox/listbox.d.ts +6 -1
- package/package.json +66 -66
- package/panelmenu/panelmenu.d.ts +1 -0
- package/resources/components/dropdown/dropdown.css +4 -0
- package/tag/tag.d.ts +10 -2
- package/treetable/treetable.d.ts +25 -4
@@ -1,6 +1,6 @@
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
1
|
+
import { DOCUMENT, isPlatformBrowser, CommonModule } from '@angular/common';
|
2
2
|
import * as i0 from '@angular/core';
|
3
|
-
import { Directive, Input, NgModule } from '@angular/core';
|
3
|
+
import { inject, PLATFORM_ID, ElementRef, booleanAttribute, Directive, Input, NgModule } from '@angular/core';
|
4
4
|
import { DomHandler } from 'primeng/dom';
|
5
5
|
import { LicenseManager } from 'primeng/api';
|
6
6
|
|
@@ -9,20 +9,39 @@ import { LicenseManager } from 'primeng/api';
|
|
9
9
|
* @group Components
|
10
10
|
*/
|
11
11
|
class AutoFocus {
|
12
|
-
host;
|
13
|
-
constructor(host) {
|
14
|
-
this.host = host;
|
15
|
-
}
|
16
12
|
/**
|
17
13
|
* When present, it specifies that the component should automatically get focus on load.
|
18
14
|
* @group Props
|
19
15
|
*/
|
20
|
-
autofocus;
|
16
|
+
autofocus = false;
|
21
17
|
focused = false;
|
18
|
+
platformId = inject(PLATFORM_ID);
|
19
|
+
document = inject(DOCUMENT);
|
20
|
+
host = inject(ElementRef);
|
21
|
+
ngAfterViewInit() {
|
22
|
+
LicenseManager.check();
|
23
|
+
}
|
22
24
|
ngAfterContentChecked() {
|
25
|
+
// This sets the `attr.autofocus` which is different than the Input `autofocus` attribute.
|
26
|
+
if (this.autofocus === false) {
|
27
|
+
this.host.nativeElement.removeAttribute('autofocus');
|
28
|
+
}
|
29
|
+
else {
|
30
|
+
this.host.nativeElement.setAttribute('autofocus', true);
|
31
|
+
}
|
32
|
+
if (!this.focused) {
|
33
|
+
this.autoFocus();
|
34
|
+
}
|
35
|
+
}
|
36
|
+
ngAfterViewChecked() {
|
23
37
|
if (!this.focused) {
|
24
|
-
|
25
|
-
|
38
|
+
this.autoFocus();
|
39
|
+
}
|
40
|
+
}
|
41
|
+
autoFocus() {
|
42
|
+
if (isPlatformBrowser(this.platformId) && this.autofocus) {
|
43
|
+
setTimeout(() => {
|
44
|
+
const focusableElements = DomHandler.getFocusableElements(this.host?.nativeElement);
|
26
45
|
if (focusableElements.length === 0) {
|
27
46
|
this.host.nativeElement.focus();
|
28
47
|
}
|
@@ -30,14 +49,11 @@ class AutoFocus {
|
|
30
49
|
focusableElements[0].focus();
|
31
50
|
}
|
32
51
|
this.focused = true;
|
33
|
-
}
|
52
|
+
});
|
34
53
|
}
|
35
54
|
}
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: AutoFocus, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
40
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.0", type: AutoFocus, selector: "[pAutoFocus]", inputs: { autofocus: "autofocus" }, host: { classAttribute: "p-element" }, ngImport: i0 });
|
55
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: AutoFocus, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
56
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.0", type: AutoFocus, selector: "[pAutoFocus]", inputs: { autofocus: ["autofocus", "autofocus", booleanAttribute] }, host: { classAttribute: "p-element" }, ngImport: i0 });
|
41
57
|
}
|
42
58
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: AutoFocus, decorators: [{
|
43
59
|
type: Directive,
|
@@ -47,8 +63,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImpor
|
|
47
63
|
class: 'p-element'
|
48
64
|
}
|
49
65
|
}]
|
50
|
-
}],
|
51
|
-
type: Input
|
66
|
+
}], propDecorators: { autofocus: [{
|
67
|
+
type: Input,
|
68
|
+
args: [{ transform: booleanAttribute }]
|
52
69
|
}] } });
|
53
70
|
class AutoFocusModule {
|
54
71
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: AutoFocusModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"primeng-autofocus.mjs","sources":["../../src/app/components/autofocus/autofocus.ts","../../src/app/components/autofocus/primeng-autofocus.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Directive, ElementRef, Input, NgModule } from '@angular/core';\nimport { DomHandler } from 'primeng/dom';\nimport { LicenseManager } from 'primeng/api';\n/**\n * AutoFocus manages focus on focusable element on load.\n * @group Components\n */\n@Directive({\n selector: '[pAutoFocus]',\n host: {\n class: 'p-element'\n }\n})\nexport class AutoFocus {\n
|
1
|
+
{"version":3,"file":"primeng-autofocus.mjs","sources":["../../src/app/components/autofocus/autofocus.ts","../../src/app/components/autofocus/primeng-autofocus.ts"],"sourcesContent":["import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { Directive, ElementRef, Input, NgModule, PLATFORM_ID, booleanAttribute, inject } from '@angular/core';\nimport { DomHandler } from 'primeng/dom';\nimport { LicenseManager } from 'primeng/api';\n/**\n * AutoFocus manages focus on focusable element on load.\n * @group Components\n */\n@Directive({\n selector: '[pAutoFocus]',\n host: {\n class: 'p-element'\n }\n})\nexport class AutoFocus {\n /**\n * When present, it specifies that the component should automatically get focus on load.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) autofocus: boolean = false;\n\n focused: boolean = false;\n\n platformId = inject(PLATFORM_ID);\n\n document: Document = inject(DOCUMENT);\n\n host: ElementRef = inject(ElementRef);\n\n ngAfterViewInit() {\n LicenseManager.check();\n }\n\n ngAfterContentChecked() {\n // This sets the `attr.autofocus` which is different than the Input `autofocus` attribute.\n if (this.autofocus === false) {\n this.host.nativeElement.removeAttribute('autofocus');\n } else {\n this.host.nativeElement.setAttribute('autofocus', true);\n }\n\n if (!this.focused) {\n this.autoFocus();\n }\n }\n\n ngAfterViewChecked() {\n if (!this.focused) {\n this.autoFocus();\n }\n }\n\n autoFocus() {\n if (isPlatformBrowser(this.platformId) && this.autofocus) {\n setTimeout(() => {\n const focusableElements = DomHandler.getFocusableElements(this.host?.nativeElement);\n\n if (focusableElements.length === 0) {\n this.host.nativeElement.focus();\n }\n if (focusableElements.length > 0) {\n focusableElements[0].focus();\n }\n\n this.focused = true;\n });\n }\n }\n}\n\n@NgModule({\n imports: [CommonModule],\n exports: [AutoFocus],\n declarations: [AutoFocus]\n})\nexport class AutoFocusModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAIA;;;AAGG;AACH,MAMa,SAAS,CAAA;AAClB;;;AAGG;IACqC,SAAS,GAAY,KAAK,CAAC;IAEnE,OAAO,GAAY,KAAK,CAAC;AAEzB,IAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAEjC,IAAA,QAAQ,GAAa,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEtC,IAAA,IAAI,GAAe,MAAM,CAAC,UAAU,CAAC,CAAC;IAEtC,eAAe,GAAA;QACX,cAAc,CAAC,KAAK,EAAE,CAAC;KAC1B;IAED,qBAAqB,GAAA;;AAEjB,QAAA,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;AACxD,SAAA;AAAM,aAAA;YACH,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAC3D,SAAA;AAED,QAAA,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACf,IAAI,CAAC,SAAS,EAAE,CAAC;AACpB,SAAA;KACJ;IAED,kBAAkB,GAAA;AACd,QAAA,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACf,IAAI,CAAC,SAAS,EAAE,CAAC;AACpB,SAAA;KACJ;IAED,SAAS,GAAA;QACL,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE;YACtD,UAAU,CAAC,MAAK;AACZ,gBAAA,MAAM,iBAAiB,GAAG,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AAEpF,gBAAA,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE;AAChC,oBAAA,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACnC,iBAAA;AACD,gBAAA,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE;AAC9B,oBAAA,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AAChC,iBAAA;AAED,gBAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;AACxB,aAAC,CAAC,CAAC;AACN,SAAA;KACJ;uGArDQ,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,SAAS,4EAKE,gBAAgB,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAL3B,SAAS,EAAA,UAAA,EAAA,CAAA;kBANrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,IAAI,EAAE;AACF,wBAAA,KAAK,EAAE,WAAW;AACrB,qBAAA;AACJ,iBAAA,CAAA;8BAM2C,SAAS,EAAA,CAAA;sBAAhD,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;;AAmD1C,MAKa,eAAe,CAAA;uGAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EA7Df,YAAA,EAAA,CAAA,SAAS,CAyDR,EAAA,OAAA,EAAA,CAAA,YAAY,aAzDb,SAAS,CAAA,EAAA,CAAA,CAAA;AA6DT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YAJd,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAIb,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,SAAS,CAAC;oBACpB,YAAY,EAAE,CAAC,SAAS,CAAC;AAC5B,iBAAA,CAAA;;;AC1ED;;AAEG;;;;"}
|
@@ -603,6 +603,7 @@ class Calendar {
|
|
603
603
|
_view = 'date';
|
604
604
|
preventFocus;
|
605
605
|
_defaultDate;
|
606
|
+
_focusKey = null;
|
606
607
|
window;
|
607
608
|
get locale() {
|
608
609
|
return this._locale;
|
@@ -1016,6 +1017,12 @@ class Calendar {
|
|
1016
1017
|
}
|
1017
1018
|
return formattedValue;
|
1018
1019
|
}
|
1020
|
+
formatDateMetaToDate(dateMeta) {
|
1021
|
+
return new Date(dateMeta.year, dateMeta.month, dateMeta.day);
|
1022
|
+
}
|
1023
|
+
formatDateKey(date) {
|
1024
|
+
return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
|
1025
|
+
}
|
1019
1026
|
setCurrentHourPM(hours) {
|
1020
1027
|
if (this.hourFormat == '12') {
|
1021
1028
|
this.pm = hours > 11;
|
@@ -1036,7 +1043,7 @@ class Calendar {
|
|
1036
1043
|
this.alignOverlay();
|
1037
1044
|
}
|
1038
1045
|
selectDate(dateMeta) {
|
1039
|
-
let date =
|
1046
|
+
let date = this.formatDateMetaToDate(dateMeta);
|
1040
1047
|
if (this.showTime) {
|
1041
1048
|
if (this.hourFormat == '12') {
|
1042
1049
|
if (this.currentHour === 12)
|
@@ -1212,7 +1219,7 @@ class Calendar {
|
|
1212
1219
|
isDateBetween(start, end, dateMeta) {
|
1213
1220
|
let between = false;
|
1214
1221
|
if (ObjectUtils.isDate(start) && ObjectUtils.isDate(end)) {
|
1215
|
-
let date =
|
1222
|
+
let date = this.formatDateMetaToDate(dateMeta);
|
1216
1223
|
return start.getTime() <= date.getTime() && end.getTime() >= date.getTime();
|
1217
1224
|
}
|
1218
1225
|
return between;
|
@@ -1395,9 +1402,10 @@ class Calendar {
|
|
1395
1402
|
}
|
1396
1403
|
}
|
1397
1404
|
}
|
1398
|
-
onDateCellKeydown(event,
|
1405
|
+
onDateCellKeydown(event, dateMeta, groupIndex) {
|
1399
1406
|
const cellContent = event.currentTarget;
|
1400
1407
|
const cell = cellContent.parentElement;
|
1408
|
+
const currentDate = this.formatDateMetaToDate(dateMeta);
|
1401
1409
|
switch (event.which) {
|
1402
1410
|
//down arrow
|
1403
1411
|
case 40: {
|
@@ -1489,7 +1497,7 @@ class Calendar {
|
|
1489
1497
|
//space
|
1490
1498
|
case 13:
|
1491
1499
|
case 32: {
|
1492
|
-
this.onDateSelect(event,
|
1500
|
+
this.onDateSelect(event, dateMeta);
|
1493
1501
|
event.preventDefault();
|
1494
1502
|
break;
|
1495
1503
|
}
|
@@ -1507,6 +1515,48 @@ class Calendar {
|
|
1507
1515
|
}
|
1508
1516
|
break;
|
1509
1517
|
}
|
1518
|
+
// page up
|
1519
|
+
case 33: {
|
1520
|
+
cellContent.tabIndex = '-1';
|
1521
|
+
const dateToFocus = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, currentDate.getDate());
|
1522
|
+
const focusKey = this.formatDateKey(dateToFocus);
|
1523
|
+
this.navigateToMonth(true, groupIndex, `span[data-date='${focusKey}']:not(.p-disabled):not(.p-ink)`);
|
1524
|
+
event.preventDefault();
|
1525
|
+
break;
|
1526
|
+
}
|
1527
|
+
// page down
|
1528
|
+
case 34: {
|
1529
|
+
cellContent.tabIndex = '-1';
|
1530
|
+
const dateToFocus = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, currentDate.getDate());
|
1531
|
+
const focusKey = this.formatDateKey(dateToFocus);
|
1532
|
+
this.navigateToMonth(false, groupIndex, `span[data-date='${focusKey}']:not(.p-disabled):not(.p-ink)`);
|
1533
|
+
event.preventDefault();
|
1534
|
+
break;
|
1535
|
+
}
|
1536
|
+
//home
|
1537
|
+
case 36:
|
1538
|
+
cellContent.tabIndex = '-1';
|
1539
|
+
const firstDayDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
|
1540
|
+
const firstDayDateKey = this.formatDateKey(firstDayDate);
|
1541
|
+
const firstDayCell = DomHandler.findSingle(cellContent.offsetParent, `span[data-date='${firstDayDateKey}']:not(.p-disabled):not(.p-ink)`);
|
1542
|
+
if (firstDayCell) {
|
1543
|
+
firstDayCell.tabIndex = '0';
|
1544
|
+
firstDayCell.focus();
|
1545
|
+
}
|
1546
|
+
event.preventDefault();
|
1547
|
+
break;
|
1548
|
+
//end
|
1549
|
+
case 35:
|
1550
|
+
cellContent.tabIndex = '-1';
|
1551
|
+
const lastDayDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
|
1552
|
+
const lastDayDateKey = this.formatDateKey(lastDayDate);
|
1553
|
+
const lastDayCell = DomHandler.findSingle(cellContent.offsetParent, `span[data-date='${lastDayDateKey}']:not(.p-disabled):not(.p-ink)`);
|
1554
|
+
if (lastDayDate) {
|
1555
|
+
lastDayCell.tabIndex = '0';
|
1556
|
+
lastDayCell.focus();
|
1557
|
+
}
|
1558
|
+
event.preventDefault();
|
1559
|
+
break;
|
1510
1560
|
default:
|
1511
1561
|
//no op
|
1512
1562
|
break;
|
@@ -1658,30 +1708,46 @@ class Calendar {
|
|
1658
1708
|
break;
|
1659
1709
|
}
|
1660
1710
|
}
|
1661
|
-
navigateToMonth(prev, groupIndex) {
|
1711
|
+
navigateToMonth(prev, groupIndex, focusKey) {
|
1662
1712
|
if (prev) {
|
1663
1713
|
if (this.numberOfMonths === 1 || groupIndex === 0) {
|
1664
1714
|
this.navigationState = { backward: true };
|
1715
|
+
this._focusKey = focusKey;
|
1665
1716
|
this.navBackward(event);
|
1666
1717
|
}
|
1667
1718
|
else {
|
1668
1719
|
let prevMonthContainer = this.contentViewChild.nativeElement.children[groupIndex - 1];
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1720
|
+
if (focusKey) {
|
1721
|
+
const firstDayCell = DomHandler.findSingle(prevMonthContainer, focusKey);
|
1722
|
+
firstDayCell.tabIndex = '0';
|
1723
|
+
firstDayCell.focus();
|
1724
|
+
}
|
1725
|
+
else {
|
1726
|
+
let cells = DomHandler.find(prevMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
|
1727
|
+
let focusCell = cells[cells.length - 1];
|
1728
|
+
focusCell.tabIndex = '0';
|
1729
|
+
focusCell.focus();
|
1730
|
+
}
|
1673
1731
|
}
|
1674
1732
|
}
|
1675
1733
|
else {
|
1676
1734
|
if (this.numberOfMonths === 1 || groupIndex === this.numberOfMonths - 1) {
|
1677
1735
|
this.navigationState = { backward: false };
|
1736
|
+
this._focusKey = focusKey;
|
1678
1737
|
this.navForward(event);
|
1679
1738
|
}
|
1680
1739
|
else {
|
1681
1740
|
let nextMonthContainer = this.contentViewChild.nativeElement.children[groupIndex + 1];
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1741
|
+
if (focusKey) {
|
1742
|
+
const firstDayCell = DomHandler.findSingle(nextMonthContainer, focusKey);
|
1743
|
+
firstDayCell.tabIndex = '0';
|
1744
|
+
firstDayCell.focus();
|
1745
|
+
}
|
1746
|
+
else {
|
1747
|
+
let focusCell = DomHandler.findSingle(nextMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
|
1748
|
+
focusCell.tabIndex = '0';
|
1749
|
+
focusCell.focus();
|
1750
|
+
}
|
1685
1751
|
}
|
1686
1752
|
}
|
1687
1753
|
}
|
@@ -1705,7 +1771,7 @@ class Calendar {
|
|
1705
1771
|
cells = DomHandler.find(this.contentViewChild.nativeElement, '.p-yearpicker .p-yearpicker-year:not(.p-disabled)');
|
1706
1772
|
}
|
1707
1773
|
else {
|
1708
|
-
cells = DomHandler.find(this.contentViewChild.nativeElement, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
|
1774
|
+
cells = DomHandler.find(this.contentViewChild.nativeElement, this._focusKey || '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
|
1709
1775
|
}
|
1710
1776
|
if (cells && cells.length > 0) {
|
1711
1777
|
cell = cells[cells.length - 1];
|
@@ -1719,7 +1785,7 @@ class Calendar {
|
|
1719
1785
|
cell = DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-yearpicker .p-yearpicker-year:not(.p-disabled)');
|
1720
1786
|
}
|
1721
1787
|
else {
|
1722
|
-
cell = DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
|
1788
|
+
cell = DomHandler.findSingle(this.contentViewChild.nativeElement, this._focusKey || '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
|
1723
1789
|
}
|
1724
1790
|
}
|
1725
1791
|
if (cell) {
|
@@ -1728,6 +1794,7 @@ class Calendar {
|
|
1728
1794
|
}
|
1729
1795
|
}
|
1730
1796
|
this.navigationState = null;
|
1797
|
+
this._focusKey = null;
|
1731
1798
|
}
|
1732
1799
|
else {
|
1733
1800
|
this.initFocusableCell();
|
@@ -2947,6 +3014,7 @@ class Calendar {
|
|
2947
3014
|
[ngClass]="{ 'p-highlight': isSelected(date) && date.selectable, 'p-disabled': !date.selectable }"
|
2948
3015
|
(click)="onDateSelect($event, date)"
|
2949
3016
|
draggable="false"
|
3017
|
+
[attr.data-date]="formatDateKey(formatDateMetaToDate(date))"
|
2950
3018
|
(keydown)="onDateCellKeydown($event, date, i)"
|
2951
3019
|
pRipple
|
2952
3020
|
>
|
@@ -3325,6 +3393,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImpor
|
|
3325
3393
|
[ngClass]="{ 'p-highlight': isSelected(date) && date.selectable, 'p-disabled': !date.selectable }"
|
3326
3394
|
(click)="onDateSelect($event, date)"
|
3327
3395
|
draggable="false"
|
3396
|
+
[attr.data-date]="formatDateKey(formatDateMetaToDate(date))"
|
3328
3397
|
(keydown)="onDateCellKeydown($event, date, i)"
|
3329
3398
|
pRipple
|
3330
3399
|
>
|