-
-
+
`
})
export class AccordionPanelComponent implements OnInit, OnDestroy {
/** Clickable text in accordion's group header, check `accordion heading` below for using html in header */
- @Input() public heading:string;
+ @Input() public heading: string;
/** Provides an ability to use Bootstrap's contextual panel classes (`panel-primary`, `panel-success`, `panel-info`, etc...). List of all available classes [link](http://getbootstrap.com/components/#panels-alternatives) */
- @Input() public panelClass:string;
+ @Input() public panelClass: string;
/** if
true
— disables accordion group */
- @Input() public isDisabled:boolean;
+ @Input() public isDisabled: boolean;
// Questionable, maybe .panel-open should be on child div.panel element?
/** Is accordion group open or closed */
@HostBinding('class.panel-open')
@Input()
- public get isOpen():boolean {
+ public get isOpen(): boolean {
return this._isOpen;
}
- public set isOpen(value:boolean) {
+ public set isOpen(value: boolean) {
this._isOpen = value;
if (value) {
this.accordion.closeOtherPanels(this);
}
}
- protected _isOpen:boolean;
- protected accordion:AccordionComponent;
+ public get isBs3(): boolean {
+ return isBs3();
+ }
+
+ protected _isOpen: boolean;
+ protected accordion: AccordionComponent;
- public constructor(@Inject(AccordionComponent) accordion:AccordionComponent) {
+ public constructor(@Inject(AccordionComponent) accordion: AccordionComponent) {
this.accordion = accordion;
}
- public ngOnInit():any {
+ public ngOnInit(): any {
this.panelClass = this.panelClass || 'panel-default';
this.accordion.addGroup(this);
}
- public ngOnDestroy():any {
+ public ngOnDestroy(): any {
this.accordion.removeGroup(this);
}
- public toggleOpen(event:Event):any {
+ public toggleOpen(event: Event): any {
event.preventDefault();
if (!this.isDisabled) {
this.isOpen = !this.isOpen;
diff --git a/src/accordion/accordion.component.ts b/src/accordion/accordion.component.ts
index cab03ab2e2..c4f6e4845f 100644
--- a/src/accordion/accordion.component.ts
+++ b/src/accordion/accordion.component.ts
@@ -7,7 +7,11 @@ import { AccordionConfig } from './accordion.config';
selector: 'accordion',
template: `
`,
// tslint:disable-next-line
- host: {'[class.panel-group]': 'true'}
+ host: {
+ '[class.panel-group]': 'true',
+ '[attr.aria-multiselectable]':'closeOthers',
+ role: 'tablist'
+ }
})
export class AccordionComponent {
/** if `true` expanding one item will close all others */
diff --git a/yarn.lock b/yarn.lock
index 9f43907f1c..aff642073a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -67,7 +67,7 @@
dependencies:
tsickle "^0.2"
-"@ngtools/webpack@^1.0.0":
+"@ngtools/webpack@1.2.1", "@ngtools/webpack@^1.0.0":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-1.2.1.tgz#b32a2cda4aabb14518b3a16840b30d6a0e2f131e"
dependencies:
@@ -1391,7 +1391,7 @@ codecov@1.0.1:
request ">=2.42.0"
urlgrey ">=0.4.0"
-codelyzer@~2.0.0-beta.1:
+codelyzer@~2.0.0-beta.4:
version "2.0.0-beta.4"
resolved "https://registry.yarnpkg.com/codelyzer/-/codelyzer-2.0.0-beta.4.tgz#644c5ffcdcc6c933991e3790a29c5085e80ae4ca"
dependencies:
@@ -3231,7 +3231,7 @@ got@^5.0.0:
unzip-response "^1.0.2"
url-parse-lax "^1.0.0"
-graceful-fs@4.1.10:
+graceful-fs@4.1.10, graceful-fs@^4.1.0, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
version "4.1.10"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.10.tgz#f2d720c22092f743228775c75e3612632501f131"
@@ -3241,10 +3241,6 @@ graceful-fs@^3.0.5:
dependencies:
natives "^1.1.0"
-graceful-fs@^4.1.0, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
- version "4.1.11"
- resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
-
graceful-fs@~1:
version "1.2.3"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364"
@@ -8104,6 +8100,6 @@ zone.js@0.7.2:
version "0.7.2"
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.2.tgz#1a62b6be4b24d1b935e4566b0b4386b66966d1a7"
-zone.js@^0.7.2:
+zone.js@^0.7.2, zone.js@^0.7.4:
version "0.7.4"
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.4.tgz#0e624fe5b724450ee433495deff15c02b3908ee0"