@primer/view-components 0.27.1-rc.54e32349 → 0.28.0-rc.22557eac

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,15 +6,6 @@ type SelectedItem = {
6
6
  value: string | null | undefined;
7
7
  element: Element;
8
8
  };
9
- export type ItemActivatedEvent = {
10
- item: Element;
11
- checked: boolean;
12
- };
13
- declare global {
14
- interface HTMLElementEventMap {
15
- itemActivated: CustomEvent<ItemActivatedEvent>;
16
- }
17
- }
18
9
  export declare class ActionMenuElement extends HTMLElement {
19
10
  #private;
20
11
  includeFragment: IncludeFragmentElement;
@@ -0,0 +1,64 @@
1
+ import { IncludeFragmentElement } from '@github/include-fragment-element';
2
+ import type { AnchorAlignment, AnchorSide } from '@primer/behaviors';
3
+ import '@oddbird/popover-polyfill';
4
+ type SelectVariant = 'none' | 'single' | 'multiple' | null;
5
+ type SelectedItem = {
6
+ label: string | null | undefined;
7
+ value: string | null | undefined;
8
+ inputName: string | null | undefined;
9
+ element: SelectPanelItem;
10
+ };
11
+ export type SelectPanelItem = HTMLLIElement;
12
+ export type FilterFn = (item: SelectPanelItem, query: string) => boolean;
13
+ export declare class SelectPanelElement extends HTMLElement {
14
+ #private;
15
+ includeFragment: IncludeFragmentElement;
16
+ dialog: HTMLDialogElement;
17
+ filterInputTextField: HTMLInputElement;
18
+ remoteInput: HTMLElement;
19
+ list: HTMLElement;
20
+ ariaLiveContainer: HTMLElement;
21
+ noResults: HTMLElement;
22
+ fragmentErrorElement: HTMLElement;
23
+ bannerErrorElement: HTMLElement;
24
+ bodySpinner: HTMLElement;
25
+ filterFn?: FilterFn;
26
+ get open(): boolean;
27
+ get selectVariant(): SelectVariant;
28
+ get ariaSelectionType(): string;
29
+ set selectVariant(variant: SelectVariant);
30
+ get dynamicLabelPrefix(): string;
31
+ get dynamicAriaLabelPrefix(): string;
32
+ set dynamicLabelPrefix(value: string);
33
+ get dynamicLabel(): boolean;
34
+ set dynamicLabel(value: boolean);
35
+ get invokerElement(): HTMLButtonElement | null;
36
+ get closeButton(): HTMLButtonElement | null;
37
+ get invokerLabel(): HTMLElement | null;
38
+ get selectedItems(): SelectedItem[];
39
+ get align(): AnchorAlignment;
40
+ get side(): AnchorSide;
41
+ updateAnchorPosition(): void;
42
+ connectedCallback(): void;
43
+ disconnectedCallback(): void;
44
+ handleEvent(event: Event): void;
45
+ show(): void;
46
+ hide(): void;
47
+ get visibleItems(): SelectPanelItem[];
48
+ get items(): SelectPanelItem[];
49
+ get focusableItem(): HTMLElement | undefined;
50
+ getItemById(itemId: string): SelectPanelItem | null;
51
+ isItemDisabled(item: SelectPanelItem | null): boolean;
52
+ disableItem(item: SelectPanelItem | null): void;
53
+ enableItem(item: SelectPanelItem | null): void;
54
+ isItemHidden(item: SelectPanelItem | null): boolean;
55
+ isItemChecked(item: SelectPanelItem | null): boolean;
56
+ checkItem(item: SelectPanelItem | null): void;
57
+ uncheckItem(item: SelectPanelItem | null): void;
58
+ }
59
+ declare global {
60
+ interface Window {
61
+ SelectPanelElement: typeof SelectPanelElement;
62
+ }
63
+ }
64
+ export {};