Skip to content

Commit

Permalink
chore(combobox): decouples foundation (VIV-2021) (#2045)
Browse files Browse the repository at this point in the history
* chore: wip

* chore: decouples combobox

* chore: updated tests

* chore: update tests

* chore: formatting

* Use FormAssociated

* Increase coverage

---------

Co-authored-by: Richard Helm <[email protected]>
  • Loading branch information
TaylorJ76 and RichardHelm authored Dec 6, 2024
1 parent db952b1 commit 032c6b2
Show file tree
Hide file tree
Showing 5 changed files with 989 additions and 8 deletions.
15 changes: 15 additions & 0 deletions libs/components/src/lib/combobox/combobox.form-associated.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Listbox } from '../../shared/foundation/listbox/listbox';
import { FormAssociated } from '../../shared/foundation/form-associated/form-associated';

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

/**
* A form-associated base class for the {@link (Combobox:class)} component.
*
* @internal
*/
export class FormAssociatedCombobox extends FormAssociated(_Combobox) {
proxy = document.createElement('input');
}
17 changes: 17 additions & 0 deletions libs/components/src/lib/combobox/combobox.options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Autocomplete values for combobox.
* @public
*/
export const ComboboxAutocomplete = {
inline: 'inline',
list: 'list',
both: 'both',
none: 'none',
} as const;

/**
* Autocomplete type for combobox.
* @public
*/
export type ComboboxAutocomplete =
typeof ComboboxAutocomplete[keyof typeof ComboboxAutocomplete];
Loading

0 comments on commit 032c6b2

Please sign in to comment.