Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(select): decouple from FAST Foundation (VIV-2025) #2039

Merged
merged 6 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions libs/components/src/lib/option/option.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import { applyMixins, FoundationElement } from '@microsoft/fast-foundation';
import { attr, observable, Observable } from '@microsoft/fast-element';
import { isHTMLElement } from '@microsoft/fast-web-utilities';
import { AffixIconWithTrailing } from '../../shared/patterns/affix';
import { ARIAGlobalStatesAndProperties } from '../../shared/foundation/patterns/aria-global';

/**
* Determines if the element is a {@link (ListboxOption:class)}
*
* @param element - the element to test.
* @public
*/
export function isListboxOption(el: Element): el is ListboxOption {
return (
isHTMLElement(el) &&
((el.getAttribute('role') as string) === 'option' ||
el instanceof HTMLOptionElement)
);
}
/**
* An Option Custom HTML Element.
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#option | ARIA option }.
Expand Down
10 changes: 10 additions & 0 deletions libs/components/src/lib/select/select.form-associated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { FormAssociated } from '@microsoft/fast-foundation';
import { Listbox } from '../../shared/foundation/listbox/listbox';

class _Select extends Listbox {}
// eslint-disable-next-line @typescript-eslint/naming-convention
interface _Select extends FormAssociated {}

export class FormAssociatedSelect extends FormAssociated(_Select) {
proxy = document.createElement('select');
}
Loading
Loading