@mathstack/ui 0.0.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +30 -0
- package/fesm2022/mathstack-ui.mjs +2175 -0
- package/fesm2022/mathstack-ui.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/combobox/combobox-label/combobox-label.component.d.ts +11 -0
- package/lib/combobox/combobox.component.d.ts +20 -0
- package/lib/combobox/combobox.module.d.ts +15 -0
- package/lib/combobox/combobox.service.d.ts +124 -0
- package/lib/combobox/editable-textbox/editable-textbox.component.d.ts +39 -0
- package/lib/combobox/index.d.ts +11 -0
- package/lib/combobox/listbox/active-index.service.d.ts +32 -0
- package/lib/combobox/listbox/listbox-filtering.service.d.ts +12 -0
- package/lib/combobox/listbox/listbox-scroll.service.d.ts +11 -0
- package/lib/combobox/listbox/listbox.component.d.ts +58 -0
- package/lib/combobox/listbox-group/listbox-group.component.d.ts +16 -0
- package/lib/combobox/listbox-label/listbox-label.component.d.ts +12 -0
- package/lib/combobox/listbox-option/listbox-option.component.d.ts +52 -0
- package/lib/combobox/select-all-listbox-option/select-all-listbox-option.component.d.ts +24 -0
- package/lib/combobox/textbox/textbox.component.d.ts +41 -0
- package/lib/directory/directory.component.d.ts +44 -0
- package/lib/directory/index.d.ts +1 -0
- package/lib/table/index.d.ts +4 -0
- package/lib/table/single-sort-header/single-sort-header.component.d.ts +9 -0
- package/lib/table/table-column.d.ts +53 -0
- package/lib/table/table.component.d.ts +27 -0
- package/lib/table/table.config.d.ts +5 -0
- package/lib/table/table.module.d.ts +11 -0
- package/lib/tabs/index.d.ts +6 -0
- package/lib/tabs/tab-body.component.d.ts +8 -0
- package/lib/tabs/tab-content.directive.d.ts +15 -0
- package/lib/tabs/tab-item.component.d.ts +16 -0
- package/lib/tabs/tab-label.component.d.ts +10 -0
- package/lib/tabs/tabs.component.d.ts +24 -0
- package/lib/tabs/tabs.module.d.ts +11 -0
- package/lib/tabs/tabs.service.d.ts +9 -0
- package/package.json +35 -0
- package/public-api.d.ts +4 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
import { ComboboxAction } from '../combobox.service';
|
|
5
|
+
import { ListboxOptionComponent } from '../listbox-option/listbox-option.component';
|
|
6
|
+
import { TextboxComponent } from '../textbox/textbox.component';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class EditableTextboxComponent extends TextboxComponent implements OnInit, AfterViewInit {
|
|
9
|
+
inputElRef: ElementRef<HTMLInputElement>;
|
|
10
|
+
autoSelect: boolean;
|
|
11
|
+
autoSelectTrigger: 'any' | 'character';
|
|
12
|
+
displaySelected: boolean;
|
|
13
|
+
initialValue: string;
|
|
14
|
+
inputType: 'text' | 'search';
|
|
15
|
+
ngFormControl: FormControl<string>;
|
|
16
|
+
placeholder: string;
|
|
17
|
+
valueChanges: EventEmitter<string>;
|
|
18
|
+
moveFocusToTextboxKeys: string[];
|
|
19
|
+
value: BehaviorSubject<string>;
|
|
20
|
+
value$: import("rxjs").Observable<string>;
|
|
21
|
+
openKeys: string[];
|
|
22
|
+
ngOnInit(): void;
|
|
23
|
+
ngAfterViewInit(): void;
|
|
24
|
+
setLabel(): void;
|
|
25
|
+
onSelectionChange(selectedOptions: ListboxOptionComponent[]): void;
|
|
26
|
+
onInputChange(value: string): void;
|
|
27
|
+
setAndEmitValue(value: string): void;
|
|
28
|
+
setValue(value: string): void;
|
|
29
|
+
emitValue(value: string): void;
|
|
30
|
+
handleClick(): void;
|
|
31
|
+
protected setAutoSelectWhenInputIsEmpty(): void;
|
|
32
|
+
onEscape(): void;
|
|
33
|
+
getActionFromKeydownEvent(event: KeyboardEvent): ComboboxAction;
|
|
34
|
+
getActionFromKeydownEventWhenOpen(event: KeyboardEvent): ComboboxAction;
|
|
35
|
+
handleKeyboardAction(action: string, event: KeyboardEvent): void;
|
|
36
|
+
isPrintableCharacter(str: string): RegExpMatchArray;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditableTextboxComponent, never>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EditableTextboxComponent, "hsi-ui-editable-textbox", never, { "autoSelect": { "alias": "autoSelect"; "required": false; }; "autoSelectTrigger": { "alias": "autoSelectTrigger"; "required": false; }; "displaySelected": { "alias": "displaySelected"; "required": false; }; "initialValue": { "alias": "initialValue"; "required": false; }; "inputType": { "alias": "inputType"; "required": false; }; "ngFormControl": { "alias": "ngFormControl"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, { "valueChanges": "valueChanges"; }, never, ["[boxIcon]"], true, never>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './combobox-label/combobox-label.component';
|
|
2
|
+
export * from './combobox.component';
|
|
3
|
+
export * from './combobox.module';
|
|
4
|
+
export * from './combobox.service';
|
|
5
|
+
export * from './editable-textbox/editable-textbox.component';
|
|
6
|
+
export * from './listbox-group/listbox-group.component';
|
|
7
|
+
export * from './listbox-label/listbox-label.component';
|
|
8
|
+
export * from './listbox-option/listbox-option.component';
|
|
9
|
+
export * from './listbox/listbox.component';
|
|
10
|
+
export * from './select-all-listbox-option/select-all-listbox-option.component';
|
|
11
|
+
export * from './textbox/textbox.component';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DestroyRef, ElementRef } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ComboboxService, OptionAction } from '../combobox.service';
|
|
4
|
+
import { ListboxOptionComponent } from '../listbox-option/listbox-option.component';
|
|
5
|
+
import { ListboxFilteringService } from './listbox-filtering.service';
|
|
6
|
+
import { ListboxScrollService } from './listbox-scroll.service';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class ActiveIndexService {
|
|
9
|
+
private service;
|
|
10
|
+
private filtering;
|
|
11
|
+
private scrolling;
|
|
12
|
+
private activeIndex;
|
|
13
|
+
activeIndex$: Observable<number>;
|
|
14
|
+
scrollContentRef: ElementRef<HTMLDivElement>;
|
|
15
|
+
constructor(service: ComboboxService, filtering: ListboxFilteringService, scrolling: ListboxScrollService);
|
|
16
|
+
init(allOptions$: Observable<ListboxOptionComponent[]>, destroyRef: DestroyRef): void;
|
|
17
|
+
setScrollContentRef(scrollContentRef: ElementRef): void;
|
|
18
|
+
initActiveId(): void;
|
|
19
|
+
listenToActions(allOptions$: Observable<ListboxOptionComponent[]>, destroyRef: DestroyRef): void;
|
|
20
|
+
private setNextActiveIndex;
|
|
21
|
+
private setPrevActiveIndex;
|
|
22
|
+
setActiveIndex(index: number | null, actionIfDisabled: OptionAction.next | OptionAction.previous | null, options: ListboxOptionComponent[], scrollToIndex?: boolean): void;
|
|
23
|
+
handleActiveIndexWhenCannotBeSet(): void;
|
|
24
|
+
private handleScrollingForNewIndex;
|
|
25
|
+
private getIndexForAction;
|
|
26
|
+
actionIsTypingChar(action: OptionAction | string): boolean;
|
|
27
|
+
updateActiveIndexFromKeyChar(char: string, options: ListboxOptionComponent[]): void;
|
|
28
|
+
private setActiveDescendant;
|
|
29
|
+
setActiveIndexToFirstSelectedOrDefault(options: ListboxOptionComponent[]): void;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ActiveIndexService, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ActiveIndexService>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ListboxOptionComponent } from '../listbox-option/listbox-option.component';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ListboxFilteringService {
|
|
4
|
+
searchTimeout: ReturnType<typeof setTimeout>;
|
|
5
|
+
searchString: string;
|
|
6
|
+
updateSearchString(char: string): void;
|
|
7
|
+
resetSearch(): void;
|
|
8
|
+
getIndexByLetter(options: ListboxOptionComponent[], searchString: string, startIndex: number): number;
|
|
9
|
+
filterOptionsBySearchString(options: ListboxOptionComponent[], searchString: string, exclude?: ListboxOptionComponent[]): ListboxOptionComponent[];
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ListboxFilteringService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ListboxFilteringService>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class ListboxScrollService {
|
|
3
|
+
private document;
|
|
4
|
+
constructor(document: Document);
|
|
5
|
+
isElementInView(element: HTMLElement): boolean;
|
|
6
|
+
isScrollable(element: HTMLElement): boolean;
|
|
7
|
+
maintainElementVisibility(activeElement: HTMLElement, scrollParent: HTMLElement): void;
|
|
8
|
+
scrollToTop(scrollParent: HTMLElement): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ListboxScrollService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ListboxScrollService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AfterContentInit, AfterViewInit, DestroyRef, ElementRef, EventEmitter, OnChanges, QueryList, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { ComboboxService, OptionAction } from '../combobox.service';
|
|
4
|
+
import { ListboxGroupComponent } from '../listbox-group/listbox-group.component';
|
|
5
|
+
import { ListboxLabelComponent } from '../listbox-label/listbox-label.component';
|
|
6
|
+
import { ListboxOptionComponent } from '../listbox-option/listbox-option.component';
|
|
7
|
+
import { SelectAllListboxOptionComponent } from '../select-all-listbox-option/select-all-listbox-option.component';
|
|
8
|
+
import { ActiveIndexService } from './active-index.service';
|
|
9
|
+
import { ListboxFilteringService } from './listbox-filtering.service';
|
|
10
|
+
import { ListboxScrollService } from './listbox-scroll.service';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
export type SelectedCountLabel = {
|
|
13
|
+
singular: string;
|
|
14
|
+
plural: string;
|
|
15
|
+
};
|
|
16
|
+
export declare class ListboxComponent implements OnChanges, AfterContentInit, AfterViewInit {
|
|
17
|
+
service: ComboboxService;
|
|
18
|
+
activeIndex: ActiveIndexService;
|
|
19
|
+
protected filtering: ListboxFilteringService;
|
|
20
|
+
protected scrolling: ListboxScrollService;
|
|
21
|
+
protected destroyRef: DestroyRef;
|
|
22
|
+
ngFormControl: FormControl<any | any[]>;
|
|
23
|
+
findsOptionOnTyping: boolean;
|
|
24
|
+
isMultiSelect: boolean;
|
|
25
|
+
maxHeight: number;
|
|
26
|
+
valueChanges: EventEmitter<any>;
|
|
27
|
+
scrollableContentRef: ElementRef<HTMLDivElement>;
|
|
28
|
+
label: ListboxLabelComponent;
|
|
29
|
+
options: QueryList<ListboxOptionComponent>;
|
|
30
|
+
groups: QueryList<ListboxGroupComponent>;
|
|
31
|
+
constructor(service: ComboboxService, activeIndex: ActiveIndexService, filtering: ListboxFilteringService, scrolling: ListboxScrollService, destroyRef: DestroyRef);
|
|
32
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
33
|
+
ngAfterContentInit(): void;
|
|
34
|
+
ngAfterViewInit(): void;
|
|
35
|
+
setOnOptionChanges(): void;
|
|
36
|
+
setSelectedEmitting(): void;
|
|
37
|
+
emitValue(selections: any[]): void;
|
|
38
|
+
setOnBlurEvent(): void;
|
|
39
|
+
shouldAutoSelectOptionOnBlur(activeIndex: number, options: ListboxOptionComponent[]): boolean;
|
|
40
|
+
setOptionAction(): void;
|
|
41
|
+
actionIsTypingChar(action: OptionAction | string): boolean;
|
|
42
|
+
setResetOnClose(): void;
|
|
43
|
+
resetScroll(): void;
|
|
44
|
+
getListboxLabelAsBoxPlaceholder(): string;
|
|
45
|
+
selectOptionFromIndex(index: number, options: ListboxOptionComponent[]): void;
|
|
46
|
+
handleOptionClick(event: MouseEvent, optionIndex: number, groupIndex?: number): void;
|
|
47
|
+
handleOptionSelect(optionIndex: number, options: ListboxOptionComponent[], groupIndex?: number): void;
|
|
48
|
+
toggleOptionSelected(option: ListboxOptionComponent, options: ListboxOptionComponent[]): void;
|
|
49
|
+
updateSelectedOptionsToEmit(options: ListboxOptionComponent[]): void;
|
|
50
|
+
selectSingleSelectOption(option: ListboxOptionComponent, options: ListboxOptionComponent[]): void;
|
|
51
|
+
isSelectAllListboxOption(option: ListboxOptionComponent): option is SelectAllListboxOptionComponent;
|
|
52
|
+
getOptionIndexFromGroups(groupIndex: number, optionIndex: number): number;
|
|
53
|
+
getSelectedOptions(options: ListboxOptionComponent[]): ListboxOptionComponent[];
|
|
54
|
+
updateActiveIndexOnExternalChanges(): void;
|
|
55
|
+
handleOptionMousedown(): void;
|
|
56
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ListboxComponent, never>;
|
|
57
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ListboxComponent, "hsi-ui-listbox", never, { "ngFormControl": { "alias": "ngFormControl"; "required": false; }; "findsOptionOnTyping": { "alias": "findsOptionOnTyping"; "required": false; }; "isMultiSelect": { "alias": "isMultiSelect"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; }, { "valueChanges": "valueChanges"; }, ["label", "options", "groups"], never, true, never>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AfterContentInit, QueryList } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ComboboxService } from '../combobox.service';
|
|
4
|
+
import { ListboxLabelComponent } from '../listbox-label/listbox-label.component';
|
|
5
|
+
import { ListboxOptionComponent } from '../listbox-option/listbox-option.component';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class ListboxGroupComponent implements AfterContentInit {
|
|
8
|
+
service: ComboboxService;
|
|
9
|
+
label: ListboxLabelComponent;
|
|
10
|
+
options: QueryList<ListboxOptionComponent>;
|
|
11
|
+
options$: Observable<ListboxOptionComponent[]>;
|
|
12
|
+
constructor(service: ComboboxService);
|
|
13
|
+
ngAfterContentInit(): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ListboxGroupComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ListboxGroupComponent, "hsi-ui-listbox-group", never, {}, {}, ["label", "options"], ["*"], true, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ElementRef, TemplateRef } from '@angular/core';
|
|
2
|
+
import { ComboboxService } from '../combobox.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ListboxLabelComponent {
|
|
5
|
+
private service;
|
|
6
|
+
labelContent: TemplateRef<unknown>;
|
|
7
|
+
label: ElementRef<HTMLParagraphElement>;
|
|
8
|
+
id: string;
|
|
9
|
+
constructor(service: ComboboxService);
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ListboxLabelComponent, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ListboxLabelComponent, "hsi-ui-listbox-label", never, {}, {}, never, ["*"], true, never>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ElementRef, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { ComboboxService } from '../combobox.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface ListboxOptionPropertyChange {
|
|
6
|
+
property: 'selected' | 'disabled';
|
|
7
|
+
value: boolean;
|
|
8
|
+
comboboxId: string;
|
|
9
|
+
id: number;
|
|
10
|
+
optionValue: string | number | boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class ListboxOptionComponent implements OnChanges {
|
|
13
|
+
protected service: ComboboxService;
|
|
14
|
+
label: ElementRef<HTMLDivElement>;
|
|
15
|
+
template: TemplateRef<unknown>;
|
|
16
|
+
boxDisplayLabel: string;
|
|
17
|
+
value: any;
|
|
18
|
+
/** Whether the option is selected.
|
|
19
|
+
* If this property is changed during this component's lifecycle, no new value will be emitted from the listbox.
|
|
20
|
+
* Box label and select all button will respond to changes.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
selected: boolean;
|
|
24
|
+
/** Whether the option is selected.
|
|
25
|
+
* If this property is changed during this component's lifecycle, no new value will be emitted from the listbox.
|
|
26
|
+
* Box label and select all button will respond to changes.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
ariaLabel: string;
|
|
31
|
+
id: number;
|
|
32
|
+
protected _selected: BehaviorSubject<boolean>;
|
|
33
|
+
selected$: import("rxjs").Observable<boolean>;
|
|
34
|
+
private _disabled;
|
|
35
|
+
disabled$: import("rxjs").Observable<boolean>;
|
|
36
|
+
private externalPropertyChanges;
|
|
37
|
+
externalPropertyChanges$: import("rxjs").Observable<ListboxOptionPropertyChange>;
|
|
38
|
+
constructor(service: ComboboxService);
|
|
39
|
+
get valueToEmit(): any | string;
|
|
40
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
41
|
+
isFirstChangeAndValueIsFalse(change: SimpleChanges, property: 'selected' | 'disabled'): boolean;
|
|
42
|
+
getPropertyChange(property: 'selected' | 'disabled'): ListboxOptionPropertyChange;
|
|
43
|
+
protected updateSelected(selected: boolean): void;
|
|
44
|
+
private updateDisabled;
|
|
45
|
+
select(): void;
|
|
46
|
+
deselect(): void;
|
|
47
|
+
toggleSelected(): void;
|
|
48
|
+
isSelected(): boolean;
|
|
49
|
+
isDisabled(): boolean;
|
|
50
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ListboxOptionComponent, never>;
|
|
51
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ListboxOptionComponent, "hsi-ui-listbox-option", never, { "boxDisplayLabel": { "alias": "boxDisplayLabel"; "required": false; }; "value": { "alias": "value"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; }, {}, never, ["*", "[selectedIcon]", "[unselectedIcon]"], true, never>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DestroyRef, OnChanges } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ComboboxService } from '../combobox.service';
|
|
4
|
+
import { ListboxGroupComponent } from '../listbox-group/listbox-group.component';
|
|
5
|
+
import { ListboxOptionComponent } from '../listbox-option/listbox-option.component';
|
|
6
|
+
import { ListboxComponent } from '../listbox/listbox.component';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class SelectAllListboxOptionComponent extends ListboxOptionComponent implements OnChanges {
|
|
9
|
+
private listboxComponent;
|
|
10
|
+
private destroyRef;
|
|
11
|
+
boxDisplayLabel: string;
|
|
12
|
+
controlledOptions$: Observable<ListboxOptionComponent[]>;
|
|
13
|
+
controlledOptions: ListboxOptionComponent[];
|
|
14
|
+
constructor(service: ComboboxService, listboxComponent: ListboxComponent, destroyRef: DestroyRef);
|
|
15
|
+
ngOnChanges(): void;
|
|
16
|
+
protected updateSelected(selected: boolean): void;
|
|
17
|
+
setControlledOptions(): void;
|
|
18
|
+
getControlledOptionsFromGroups(groups: ListboxGroupComponent[]): ListboxOptionComponent[];
|
|
19
|
+
listenForOptionSelections(): void;
|
|
20
|
+
updateSelectAllSelected(controlledOptions: ListboxOptionComponent[]): void;
|
|
21
|
+
toggleSelected(): void;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectAllListboxOptionComponent, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectAllListboxOptionComponent, "hsi-ui-select-all-listbox-option", never, { "boxDisplayLabel": { "alias": "boxDisplayLabel"; "required": false; }; }, {}, never, ["*", "[selectedIcon]", "[unselectedIcon]"], true, never>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AfterViewInit, DestroyRef, ElementRef, NgZone, OnInit } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { ComboboxAction, ComboboxService } from '../combobox.service';
|
|
4
|
+
import { ListboxOptionComponent } from '../listbox-option/listbox-option.component';
|
|
5
|
+
import { SelectedCountLabel } from '../listbox/listbox.component';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class TextboxComponent implements OnInit, AfterViewInit {
|
|
8
|
+
ariaLabel: string;
|
|
9
|
+
selectedCountLabel?: SelectedCountLabel;
|
|
10
|
+
customLabel: (selectedOptions: ListboxOptionComponent[]) => string;
|
|
11
|
+
dynamicLabel: boolean;
|
|
12
|
+
findsOptionOnTyping: boolean;
|
|
13
|
+
box: ElementRef<HTMLDivElement>;
|
|
14
|
+
boxIcon: ElementRef<HTMLDivElement>;
|
|
15
|
+
openKeys: string[];
|
|
16
|
+
label: BehaviorSubject<string>;
|
|
17
|
+
label$: import("rxjs").Observable<string>;
|
|
18
|
+
protected destroyRef: DestroyRef;
|
|
19
|
+
service: ComboboxService;
|
|
20
|
+
private platform;
|
|
21
|
+
protected zone: NgZone;
|
|
22
|
+
ngOnInit(): void;
|
|
23
|
+
ngAfterViewInit(): void;
|
|
24
|
+
setFocusListener(): void;
|
|
25
|
+
focusBox(): void;
|
|
26
|
+
handleBlur(event: FocusEvent): void;
|
|
27
|
+
isHtmlElement(target: EventTarget): target is HTMLElement;
|
|
28
|
+
isMobile(): boolean;
|
|
29
|
+
handleClick(): void;
|
|
30
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
31
|
+
onEscape(): void;
|
|
32
|
+
getActionFromKeydownEvent(event: KeyboardEvent): ComboboxAction;
|
|
33
|
+
isTypingCharacter(event: KeyboardEvent): boolean;
|
|
34
|
+
getActionFromKeyEventWhenOpen(event: KeyboardEvent): ComboboxAction;
|
|
35
|
+
handleKeyboardAction(action: ComboboxAction, event: KeyboardEvent): void;
|
|
36
|
+
setLabel(): void;
|
|
37
|
+
getComputedLabel(touched: boolean, options: ListboxOptionComponent[]): string;
|
|
38
|
+
getDefaultLabel(selectedOptions: ListboxOptionComponent[]): string;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextboxComponent, never>;
|
|
40
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextboxComponent, "hsi-ui-textbox", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "selectedCountLabel": { "alias": "selectedCountLabel"; "required": false; }; "customLabel": { "alias": "customLabel"; "required": false; }; "dynamicLabel": { "alias": "dynamicLabel"; "required": false; }; "findsOptionOnTyping": { "alias": "findsOptionOnTyping"; "required": false; }; }, {}, never, ["[boxIcon]", "[boxLabel]"], true, never>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export interface HsiUiDirectoryItem {
|
|
5
|
+
name: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
children?: HsiUiDirectoryItem[];
|
|
8
|
+
}
|
|
9
|
+
export interface HsiUiDirectorySelection {
|
|
10
|
+
activePath: string;
|
|
11
|
+
selectedItem: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class HsiUiDirectoryComponent implements OnChanges {
|
|
14
|
+
items: HsiUiDirectoryItem[];
|
|
15
|
+
level: number;
|
|
16
|
+
path: string;
|
|
17
|
+
terminalItemsAreSelectable: boolean;
|
|
18
|
+
selectionElementRole: string;
|
|
19
|
+
/**
|
|
20
|
+
* Sets the activePath and selectedItem.
|
|
21
|
+
*/
|
|
22
|
+
selection: HsiUiDirectorySelection;
|
|
23
|
+
/**
|
|
24
|
+
* Emits the activePath and selectedItem when a leaf item is selected.
|
|
25
|
+
*
|
|
26
|
+
* Constructed from the `value` of each item if provided, otherwise uses `name`.
|
|
27
|
+
*/
|
|
28
|
+
selectionChanges: EventEmitter<HsiUiDirectorySelection>;
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*
|
|
32
|
+
* Internal, will have no effect if provided at root level.
|
|
33
|
+
*/
|
|
34
|
+
stateChanges: EventEmitter<HsiUiDirectorySelection>;
|
|
35
|
+
state: BehaviorSubject<HsiUiDirectorySelection>;
|
|
36
|
+
state$: import("rxjs").Observable<HsiUiDirectorySelection>;
|
|
37
|
+
open: {};
|
|
38
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
39
|
+
toggleOpen(key: string): void;
|
|
40
|
+
selectItem(item: HsiUiDirectoryItem): void;
|
|
41
|
+
setState(state: HsiUiDirectorySelection): void;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HsiUiDirectoryComponent, never>;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HsiUiDirectoryComponent, "hsi-ui-directory", never, { "items": { "alias": "items"; "required": false; }; "level": { "alias": "level"; "required": false; }; "path": { "alias": "path"; "required": false; }; "terminalItemsAreSelectable": { "alias": "terminalItemsAreSelectable"; "required": false; }; "selectionElementRole": { "alias": "selectionElementRole"; "required": false; }; "selection": { "alias": "selection"; "required": false; }; }, { "selectionChanges": "selectionChanges"; "stateChanges": "stateChanges"; }, never, never, true, never>;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './directory.component';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TableColumn } from '../table-column';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SingleSortHeaderComponent<Datum> {
|
|
4
|
+
column: TableColumn<Datum>;
|
|
5
|
+
sortIcon: string;
|
|
6
|
+
getColumnSortClasses(): string[];
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SingleSortHeaderComponent<any>, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SingleSortHeaderComponent<any>, "[hsi-ui-single-sort-header]", never, { "column": { "alias": "column"; "required": false; }; "sortIcon": { "alias": "sortIcon"; "required": false; }; }, {}, never, never, false, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare enum SortDirection {
|
|
2
|
+
asc = "asc",
|
|
3
|
+
desc = "desc"
|
|
4
|
+
}
|
|
5
|
+
export type SortDirectionType = keyof typeof SortDirection;
|
|
6
|
+
export type TableValue = string | number | boolean | Date;
|
|
7
|
+
export type TableCellAlignment = 'left' | 'center' | 'right';
|
|
8
|
+
export declare class TableColumn<Datum> {
|
|
9
|
+
/**
|
|
10
|
+
* The label of the column. Used in the table header.
|
|
11
|
+
* */
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* Function to extract the value to be sorted on from the datum.
|
|
15
|
+
* If not provided, the formatted value will be used for sorting.
|
|
16
|
+
*/
|
|
17
|
+
getSortValue: (x: Datum) => TableValue;
|
|
18
|
+
/**
|
|
19
|
+
* Function to format the value for display in the table.
|
|
20
|
+
*/
|
|
21
|
+
getFormattedValue: (x: Datum) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Function to determine the alignment of the cell content.
|
|
24
|
+
*/
|
|
25
|
+
getAlignment: (x: Datum) => TableCellAlignment;
|
|
26
|
+
/**
|
|
27
|
+
* Width of the column. Can be a percentage or pixel value.
|
|
28
|
+
*/
|
|
29
|
+
width: string;
|
|
30
|
+
/**
|
|
31
|
+
* Function to determine the sort order of the column.
|
|
32
|
+
* If not provided, sort with use d3.ascending on the getSortValue or getFormattedValue.
|
|
33
|
+
*/
|
|
34
|
+
ascendingSortFunction: (a: Datum, b: Datum) => number;
|
|
35
|
+
sortDirection: SortDirectionType;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the column is sortable.
|
|
38
|
+
*/
|
|
39
|
+
sortable: boolean;
|
|
40
|
+
activelySorted: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The sort order of the column. Used to determine the order of sorting when multiple columns are sorted.
|
|
43
|
+
* Sorting tiebreaks are determined by increasing sortOrder number.
|
|
44
|
+
**/
|
|
45
|
+
sortOrder: number;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the column is a row header.
|
|
48
|
+
*/
|
|
49
|
+
isRowHeader: boolean;
|
|
50
|
+
readonly initialSortDirection: SortDirectionType;
|
|
51
|
+
constructor(init?: Partial<TableColumn<Datum>>);
|
|
52
|
+
defaultSort(a: Datum, b: Datum): number;
|
|
53
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DestroyRef, OnInit } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject, Observable } from 'rxjs';
|
|
3
|
+
import { TableColumn } from './table-column';
|
|
4
|
+
import { HsiUiTableConfig } from './table.config';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class TableComponent<Datum> implements OnInit {
|
|
7
|
+
private destroyRef;
|
|
8
|
+
config$: Observable<HsiUiTableConfig<Datum>>;
|
|
9
|
+
sortIcon: string;
|
|
10
|
+
data$: Observable<Datum[]>;
|
|
11
|
+
columns$: Observable<TableColumn<Datum>[]>;
|
|
12
|
+
tableHeaders$: Observable<string[]>;
|
|
13
|
+
sort: BehaviorSubject<TableColumn<Datum>>;
|
|
14
|
+
sort$: Observable<TableColumn<Datum>>;
|
|
15
|
+
constructor(destroyRef: DestroyRef);
|
|
16
|
+
ngOnInit(): void;
|
|
17
|
+
setTableData(): void;
|
|
18
|
+
getMinSortOrderColumn(columns: TableColumn<Datum>[]): TableColumn<Datum>;
|
|
19
|
+
getColumnsWithNewSortApplied(activeSortColumn: TableColumn<Datum>, columns: TableColumn<Datum>[], toggleSortDirection?: boolean): TableColumn<Datum>[];
|
|
20
|
+
setTableHeaders(): void;
|
|
21
|
+
validateRowHeaders(): void;
|
|
22
|
+
sortTableByColumn(column: TableColumn<Datum>): void;
|
|
23
|
+
sortData(data: Datum[], primaryColumnSort: TableColumn<Datum>, columns: TableColumn<Datum>[]): Datum[];
|
|
24
|
+
columnTrackingFunction(_: number, column: TableColumn<Datum>): string;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent<any>, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any>, "hsi-ui-table", never, { "config$": { "alias": "config$"; "required": false; }; "sortIcon": { "alias": "sortIcon"; "required": false; }; }, {}, never, never, false, never>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./table.component";
|
|
3
|
+
import * as i2 from "./single-sort-header/single-sort-header.component";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "@angular/cdk/table";
|
|
6
|
+
import * as i5 from "@angular/material/icon";
|
|
7
|
+
export declare class TableModule {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TableModule, [typeof i1.TableComponent, typeof i2.SingleSortHeaderComponent], [typeof i3.CommonModule, typeof i4.CdkTableModule, typeof i5.MatIconModule], [typeof i1.TableComponent]>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<TableModule>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TabBodyComponent {
|
|
4
|
+
bodyContent: TemplateRef<HTMLElement>;
|
|
5
|
+
lazyLoadedContent: TemplateRef<any>;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabBodyComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabBodyComponent, "hsi-ui-tab-body", never, {}, {}, ["lazyLoadedContent"], ["*"], true, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InjectionToken, TemplateRef } from '@angular/core';
|
|
2
|
+
import { MatTabContent } from '@angular/material/tabs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare const HSI_UI_TAB_CONTENT: InjectionToken<MatTabContent>;
|
|
5
|
+
/**
|
|
6
|
+
* Allows a tab to be lazy-loaded when it is activated when used as a directive on an ng-template. It is recommended that this be used when the content of the tab requires calculations.
|
|
7
|
+
*
|
|
8
|
+
* Has the same functionality as https://material.angular.io/components/tabs/overview#lazy-loading
|
|
9
|
+
*/
|
|
10
|
+
export declare class TabContentDirective {
|
|
11
|
+
template: TemplateRef<any>;
|
|
12
|
+
constructor(/** Content for the tab. */ template: TemplateRef<any>);
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabContentDirective, never>;
|
|
14
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TabContentDirective, "[hsiUiTabContent]", never, {}, {}, never, never, true, never>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OnChanges } from '@angular/core';
|
|
2
|
+
import { TabBodyComponent } from './tab-body.component';
|
|
3
|
+
import { TabLabelComponent } from './tab-label.component';
|
|
4
|
+
import { TabsService } from './tabs.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class TabItemComponent<T> implements OnChanges {
|
|
7
|
+
private service;
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
value: T;
|
|
10
|
+
bodyComponent: TabBodyComponent;
|
|
11
|
+
labelComponent: TabLabelComponent;
|
|
12
|
+
constructor(service: TabsService<T>);
|
|
13
|
+
ngOnChanges(): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabItemComponent<any>, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabItemComponent<any>, "hsi-ui-tab-item", never, { "isActive": { "alias": "isActive"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, ["bodyComponent", "labelComponent"], ["*"], true, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ElementRef, TemplateRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TabLabelComponent {
|
|
4
|
+
value: string;
|
|
5
|
+
labelElement: ElementRef<HTMLDivElement>;
|
|
6
|
+
labelContent: TemplateRef<unknown>;
|
|
7
|
+
id: string;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabLabelComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabLabelComponent, "hsi-ui-tab-label", never, { "value": { "alias": "value"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AfterContentInit, DestroyRef, EventEmitter, QueryList } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { TabItemComponent } from './tab-item.component';
|
|
4
|
+
import { TabsService } from './tabs.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class TabsComponent<T> implements AfterContentInit {
|
|
7
|
+
service: TabsService<T>;
|
|
8
|
+
private destroyRef;
|
|
9
|
+
tabs: QueryList<TabItemComponent<T>>;
|
|
10
|
+
tabChange: EventEmitter<string | T>;
|
|
11
|
+
tabItems$: Observable<TabItemComponent<T>[]>;
|
|
12
|
+
tabChanges$: Observable<boolean[]>;
|
|
13
|
+
constructor(service: TabsService<T>, destroyRef: DestroyRef);
|
|
14
|
+
ngAfterContentInit(): void;
|
|
15
|
+
initializeActiveTab(): void;
|
|
16
|
+
selectTab(tabItem: TabItemComponent<T>): void;
|
|
17
|
+
emitNewActiveTab(tabItem: TabItemComponent<T>): void;
|
|
18
|
+
handleKeydown(event: KeyboardEvent, tabItem: TabItemComponent<T>): void;
|
|
19
|
+
focusTab(tabItem: TabItemComponent<T>): void;
|
|
20
|
+
focusNextTab(tabIndex: number): void;
|
|
21
|
+
focusPreviousTab(tabIndex: number): void;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabsComponent<any>, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TabsComponent<any>, "hsi-ui-tabs", never, {}, { "tabChange": "tabChange"; }, ["tabs"], never, true, never>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./tabs.component";
|
|
3
|
+
import * as i2 from "./tab-label.component";
|
|
4
|
+
import * as i3 from "./tab-item.component";
|
|
5
|
+
import * as i4 from "./tab-body.component";
|
|
6
|
+
import * as i5 from "./tab-content.directive";
|
|
7
|
+
export declare class TabsModule {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabsModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<TabsModule, never, [typeof i1.TabsComponent, typeof i2.TabLabelComponent, typeof i3.TabItemComponent, typeof i4.TabBodyComponent, typeof i5.TabContentDirective], [typeof i1.TabsComponent, typeof i2.TabLabelComponent, typeof i3.TabItemComponent, typeof i4.TabBodyComponent, typeof i5.TabContentDirective]>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<TabsModule>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import { TabItemComponent } from './tab-item.component';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TabsService<T> {
|
|
5
|
+
activeTab: BehaviorSubject<TabItemComponent<T> | null>;
|
|
6
|
+
activeTab$: import("rxjs").Observable<TabItemComponent<T>>;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TabsService<any>, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TabsService<any>>;
|
|
9
|
+
}
|