Skip to content

Commit

Permalink
fix(fast-foundation): ensure global aria attrs are applied (microsoft…
Browse files Browse the repository at this point in the history
…#4172)

* fix(fast-foundation): ensure global aria attrs are applied

Note: This is a temporary fix. We hope to provide a new feature in fast-element to allow templates to hook into observation of built-in attribute changes without re-defining the aria properties like this.

* fix(foundation): merge interfaces for mixins

Co-authored-by: Nicholas Rice <3213292+nicholasrice@users.noreply.github.com>
  • Loading branch information
EisenbergEffect and nicholasrice authored Dec 8, 2020
1 parent 93b6d87 commit dd3a1c9
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 5 deletions.
12 changes: 11 additions & 1 deletion packages/web-components/fast-foundation/src/anchor/anchor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class Anchor extends FASTElement {
*
* @public
*/
export class DelegatesARIALink extends ARIAGlobalStatesAndProperties {
export class DelegatesARIALink {
/**
* See {@link https://www.w3.org/WAI/PF/aria/roles#link} for more information
* @public
Expand All @@ -98,6 +98,16 @@ export class DelegatesARIALink extends ARIAGlobalStatesAndProperties {
public ariaExpanded: "true" | "false" | undefined;
}

/**
* Mark internal because exporting class and interface of the same name
* confuses API documenter.
* TODO: https://github.com/microsoft/fast/issues/3317
* @internal
*/
/* eslint-disable-next-line */
export interface DelegatesARIALink extends ARIAGlobalStatesAndProperties {}
applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties);

/**
* Mark internal because exporting class and interface of the same name
* confuses API documenter.
Expand Down
12 changes: 11 additions & 1 deletion packages/web-components/fast-foundation/src/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class Button extends FormAssociatedButton {
*
* @public
*/
export class DelegatesARIAButton extends ARIAGlobalStatesAndProperties {
export class DelegatesARIAButton {
/**
* See {@link https://www.w3.org/WAI/PF/aria/roles#button} for more information
* @public
Expand All @@ -210,6 +210,16 @@ export class DelegatesARIAButton extends ARIAGlobalStatesAndProperties {
public ariaPressed: "true" | "false" | "mixed" | undefined;
}

/**
* Mark internal because exporting class and interface of the same name
* confuses API documenter.
* TODO: https://github.com/microsoft/fast/issues/3317
* @internal
*/
/* eslint-disable-next-line */
export interface DelegatesARIAButton extends ARIAGlobalStatesAndProperties {}
applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);

/**
* Mark internal because exporting class and interface of the same name
* confuses API documenter.
Expand Down
12 changes: 11 additions & 1 deletion packages/web-components/fast-foundation/src/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export class Listbox extends FASTElement {
*
* @public
*/
export class DelegatesARIAListbox extends ARIAGlobalStatesAndProperties {
export class DelegatesARIAListbox {
/**
* See {@link https://www.w3.org/WAI/PF/aria/roles#button} for more information
* @public
Expand All @@ -367,6 +367,16 @@ export class DelegatesARIAListbox extends ARIAGlobalStatesAndProperties {
public ariaExpanded: "true" | "false" | undefined;
}

/**
* Mark internal because exporting class and interface of the same name
* confuses API documenter.
* TODO: https://github.com/microsoft/fast/issues/3317
* @internal
*/
/* eslint-disable-next-line */
export interface DelegatesARIAListbox extends ARIAGlobalStatesAndProperties {}
applyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties);

/**
* @internal
*/
Expand Down
12 changes: 11 additions & 1 deletion packages/web-components/fast-foundation/src/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class Select extends FormAssociatedSelect {
*
* @public
*/
export class DelegatesARIASelect extends ARIAGlobalStatesAndProperties {
export class DelegatesARIASelect {
/**
* See {@link https://www.w3.org/WAI/PF/aria/roles#button} for more information
* @public
Expand All @@ -247,6 +247,16 @@ export class DelegatesARIASelect extends ARIAGlobalStatesAndProperties {
public ariaExpanded: "true" | "false" | undefined;
}

/**
* Mark internal because exporting class and interface of the same name
* confuses API documenter.
* TODO: https://github.com/microsoft/fast/issues/3317
* @internal
*/
/* eslint-disable-next-line */
export interface DelegatesARIASelect extends ARIAGlobalStatesAndProperties {}
applyMixins(DelegatesARIASelect, ARIAGlobalStatesAndProperties);

/**
* @internal
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,17 @@ export class TextField extends FormAssociatedTextField {
*
* @public
*/
export class DelegatesARIATextbox extends ARIAGlobalStatesAndProperties {}
export class DelegatesARIATextbox {}

/**
* Mark internal because exporting class and interface of the same name
* confuses API documenter.
* TODO: https://github.com/microsoft/fast/issues/3317
* @internal
*/
/* eslint-disable-next-line */
export interface DelegatesARIATextbox extends ARIAGlobalStatesAndProperties {}
applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);

/**
* Mark internal because exporting class and interface of the same name
Expand Down

0 comments on commit dd3a1c9

Please sign in to comment.