@mathstack/ui 0.0.1-beta.1 → 0.0.1-beta.2

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.
Files changed (38) hide show
  1. package/README.md +9 -0
  2. package/fesm2022/mathstack-ui.mjs +154 -155
  3. package/fesm2022/mathstack-ui.mjs.map +1 -1
  4. package/package.json +7 -7
  5. package/types/mathstack-ui.d.ts +618 -0
  6. package/index.d.ts +0 -5
  7. package/lib/combobox/combobox-label/combobox-label.component.d.ts +0 -11
  8. package/lib/combobox/combobox.component.d.ts +0 -20
  9. package/lib/combobox/combobox.module.d.ts +0 -15
  10. package/lib/combobox/combobox.service.d.ts +0 -124
  11. package/lib/combobox/editable-textbox/editable-textbox.component.d.ts +0 -39
  12. package/lib/combobox/index.d.ts +0 -11
  13. package/lib/combobox/listbox/active-index.service.d.ts +0 -32
  14. package/lib/combobox/listbox/listbox-filtering.service.d.ts +0 -12
  15. package/lib/combobox/listbox/listbox-scroll.service.d.ts +0 -11
  16. package/lib/combobox/listbox/listbox.component.d.ts +0 -58
  17. package/lib/combobox/listbox-group/listbox-group.component.d.ts +0 -16
  18. package/lib/combobox/listbox-label/listbox-label.component.d.ts +0 -12
  19. package/lib/combobox/listbox-option/listbox-option.component.d.ts +0 -52
  20. package/lib/combobox/select-all-listbox-option/select-all-listbox-option.component.d.ts +0 -24
  21. package/lib/combobox/textbox/textbox.component.d.ts +0 -41
  22. package/lib/directory/directory.component.d.ts +0 -44
  23. package/lib/directory/index.d.ts +0 -1
  24. package/lib/table/index.d.ts +0 -4
  25. package/lib/table/single-sort-header/single-sort-header.component.d.ts +0 -9
  26. package/lib/table/table-column.d.ts +0 -53
  27. package/lib/table/table.component.d.ts +0 -27
  28. package/lib/table/table.config.d.ts +0 -5
  29. package/lib/table/table.module.d.ts +0 -11
  30. package/lib/tabs/index.d.ts +0 -6
  31. package/lib/tabs/tab-body.component.d.ts +0 -8
  32. package/lib/tabs/tab-content.directive.d.ts +0 -15
  33. package/lib/tabs/tab-item.component.d.ts +0 -16
  34. package/lib/tabs/tab-label.component.d.ts +0 -10
  35. package/lib/tabs/tabs.component.d.ts +0 -24
  36. package/lib/tabs/tabs.module.d.ts +0 -11
  37. package/lib/tabs/tabs.service.d.ts +0 -9
  38. package/public-api.d.ts +0 -4
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "name": "@mathstack/ui",
3
3
  "license": "MIT",
4
4
  "peerDependencies": {
5
- "@angular/cdk": ">=19.0.0 <21.0.0",
6
- "@angular/common": ">=19.0.0 <21.0.0",
7
- "@angular/core": ">=19.0.0 <21.0.0",
8
- "@angular/material": ">=19.0.0 <21.0.0",
5
+ "@angular/cdk": ">=19.0.0 <22.0.0",
6
+ "@angular/common": ">=19.0.0 <22.0.0",
7
+ "@angular/core": ">=19.0.0 <22.0.0",
8
+ "@angular/material": ">=19.0.0 <22.0.0",
9
9
  "@mathstack/app-kit": "^1.0.0",
10
10
  "d3": "^7.8.5",
11
11
  "lodash-es": "^4.17.21",
@@ -21,15 +21,15 @@
21
21
  "directory": "libs/ui"
22
22
  },
23
23
  "module": "fesm2022/mathstack-ui.mjs",
24
- "typings": "index.d.ts",
24
+ "typings": "types/mathstack-ui.d.ts",
25
25
  "exports": {
26
26
  "./package.json": {
27
27
  "default": "./package.json"
28
28
  },
29
29
  ".": {
30
- "types": "./index.d.ts",
30
+ "types": "./types/mathstack-ui.d.ts",
31
31
  "default": "./fesm2022/mathstack-ui.mjs"
32
32
  }
33
33
  },
34
- "version": "0.0.1-beta.1"
34
+ "version": "0.0.1-beta.2"
35
35
  }
@@ -0,0 +1,618 @@
1
+ import * as i0 from '@angular/core';
2
+ import { TemplateRef, ElementRef, OnChanges, SimpleChanges, AfterContentInit, QueryList, AfterViewInit, OnInit, OnDestroy, DestroyRef, EventEmitter, NgZone, InjectionToken } from '@angular/core';
3
+ import * as rxjs from 'rxjs';
4
+ import { BehaviorSubject, Observable, Subject } from 'rxjs';
5
+ import { Platform } from '@angular/cdk/platform';
6
+ import { FormControl } from '@angular/forms';
7
+ import * as i3 from '@angular/common';
8
+ import * as i4 from '@angular/cdk/table';
9
+ import * as i5 from '@angular/material/icon';
10
+ import { MatTabContent } from '@angular/material/tabs';
11
+
12
+ declare class ListboxLabelComponent {
13
+ labelContent: TemplateRef<unknown>;
14
+ label: ElementRef<HTMLParagraphElement>;
15
+ id: string;
16
+ private service;
17
+ constructor();
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListboxLabelComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<ListboxLabelComponent, "hsi-ui-listbox-label", never, {}, {}, never, ["*"], true, never>;
20
+ }
21
+
22
+ interface ListboxOptionPropertyChange {
23
+ property: 'selected' | 'disabled';
24
+ value: boolean;
25
+ comboboxId: string;
26
+ id: number;
27
+ optionValue: string | number | boolean;
28
+ }
29
+ declare class ListboxOptionComponent implements OnChanges {
30
+ label: ElementRef<HTMLDivElement>;
31
+ template: TemplateRef<unknown>;
32
+ boxDisplayLabel: string;
33
+ value: any;
34
+ /** Whether the option is selected.
35
+ * If this property is changed during this component's lifecycle, no new value will be emitted from the listbox.
36
+ * Box label and select all button will respond to changes.
37
+ * @default false
38
+ */
39
+ selected: boolean;
40
+ /** Whether the option is selected.
41
+ * If this property is changed during this component's lifecycle, no new value will be emitted from the listbox.
42
+ * Box label and select all button will respond to changes.
43
+ * @default false
44
+ */
45
+ disabled: boolean;
46
+ ariaLabel: string;
47
+ id: number;
48
+ protected _selected: BehaviorSubject<boolean>;
49
+ selected$: rxjs.Observable<boolean>;
50
+ private _disabled;
51
+ disabled$: rxjs.Observable<boolean>;
52
+ private externalPropertyChanges;
53
+ externalPropertyChanges$: rxjs.Observable<ListboxOptionPropertyChange>;
54
+ protected service: ComboboxService;
55
+ get valueToEmit(): any | string;
56
+ ngOnChanges(changes: SimpleChanges): void;
57
+ isFirstChangeAndValueIsFalse(change: SimpleChanges, property: 'selected' | 'disabled'): boolean;
58
+ getPropertyChange(property: 'selected' | 'disabled'): ListboxOptionPropertyChange;
59
+ protected updateSelected(selected: boolean): void;
60
+ private updateDisabled;
61
+ select(): void;
62
+ deselect(): void;
63
+ toggleSelected(): void;
64
+ isSelected(): boolean;
65
+ isDisabled(): boolean;
66
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListboxOptionComponent, never>;
67
+ 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>;
68
+ }
69
+
70
+ declare class ListboxGroupComponent implements AfterContentInit {
71
+ label: ListboxLabelComponent;
72
+ options: QueryList<ListboxOptionComponent>;
73
+ options$: Observable<ListboxOptionComponent[]>;
74
+ service: ComboboxService;
75
+ ngAfterContentInit(): void;
76
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListboxGroupComponent, never>;
77
+ static ɵcmp: i0.ɵɵComponentDeclaration<ListboxGroupComponent, "hsi-ui-listbox-group", never, {}, {}, ["label", "options"], ["*"], true, never>;
78
+ }
79
+
80
+ declare class SelectAllListboxOptionComponent extends ListboxOptionComponent implements OnChanges {
81
+ boxDisplayLabel: string;
82
+ controlledOptions$: Observable<ListboxOptionComponent[]>;
83
+ controlledOptions: ListboxOptionComponent[];
84
+ service: ComboboxService;
85
+ private listboxComponent;
86
+ private destroyRef;
87
+ constructor();
88
+ ngOnChanges(): void;
89
+ protected updateSelected(selected: boolean): void;
90
+ setControlledOptions(): void;
91
+ getControlledOptionsFromGroups(groups: ListboxGroupComponent[]): ListboxOptionComponent[];
92
+ listenForOptionSelections(): void;
93
+ updateSelectAllSelected(controlledOptions: ListboxOptionComponent[]): void;
94
+ toggleSelected(): void;
95
+ static ɵfac: i0.ɵɵFactoryDeclaration<SelectAllListboxOptionComponent, never>;
96
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectAllListboxOptionComponent, "hsi-ui-select-all-listbox-option", never, { "boxDisplayLabel": { "alias": "boxDisplayLabel"; "required": false; }; }, {}, never, ["*", "[selectedIcon]", "[unselectedIcon]"], true, never>;
97
+ }
98
+
99
+ declare enum FocusTextbox {
100
+ default = "default",
101
+ includeMobile = "includeMobile"
102
+ }
103
+ interface KeyboardEventWithAutocomplete {
104
+ event: KeyboardEvent;
105
+ autoComplete: AutoComplete;
106
+ inputHasText: boolean;
107
+ }
108
+ declare enum Key {
109
+ ArrowDown = "ArrowDown",
110
+ ArrowUp = "ArrowUp",
111
+ End = "End",
112
+ Enter = "Enter",
113
+ Escape = "Escape",
114
+ Home = "Home",
115
+ LeftArrow = "ArrowLeft",
116
+ PageDown = "PageDown",
117
+ PageUp = "PageUp",
118
+ RightArrow = "ArrowRight",
119
+ Space = " ",
120
+ Tab = "Tab"
121
+ }
122
+ declare enum OptionAction {
123
+ first = "first",
124
+ last = "last",
125
+ next = "next",
126
+ nullActiveIndex = "nullActiveIndex",
127
+ pageDown = "pageDown",
128
+ pageUp = "pageUp",
129
+ previous = "previous",
130
+ select = "select",
131
+ zeroActiveIndex = "zeroActiveIndex"
132
+ }
133
+ declare enum ListboxAction {
134
+ close = "close",
135
+ open = "open",
136
+ closeSelect = "closeSelect"
137
+ }
138
+ declare enum TextboxAction {
139
+ focus = "focus",
140
+ setTextToValue = "setTextToValue",
141
+ cursorRight = "cursorRight",
142
+ cursorLeft = "cursorLeft",
143
+ cursorFirst = "cursorFirst",
144
+ cursorLast = "cursorLast",
145
+ addChar = "addChar",
146
+ type = "type"
147
+ }
148
+ declare enum AutoComplete {
149
+ none = "none",
150
+ list = "list",
151
+ both = "both",
152
+ inline = "inline"
153
+ }
154
+ type ComboboxAction = OptionAction | ListboxAction | TextboxAction;
155
+ declare class ComboboxService {
156
+ id: string;
157
+ scrollContainerId: string;
158
+ comboboxLabelId: string;
159
+ autoComplete: AutoComplete;
160
+ hasEditableTextbox: boolean;
161
+ ignoreBlur: boolean;
162
+ isMultiSelect: boolean;
163
+ nullActiveIdOnClose: boolean;
164
+ scrollWhenOpened: boolean;
165
+ shouldAutoSelectOnListboxClose: boolean;
166
+ activeDescendant$: Observable<string>;
167
+ allOptions: ListboxOptionComponent[];
168
+ allOptions$: Observable<ListboxOptionComponent[]>;
169
+ destroy$: Subject<void>;
170
+ groups$: Observable<ListboxGroupComponent[]>;
171
+ optionPropertyChanges$: Observable<ListboxOptionPropertyChange>;
172
+ private focusTextbox;
173
+ focusTextbox$: Observable<FocusTextbox>;
174
+ private isKeyboardEvent;
175
+ isKeyboardEvent$: Observable<boolean>;
176
+ private _isOpen;
177
+ isOpen$: Observable<boolean>;
178
+ private label;
179
+ label$: Observable<ComboboxLabelComponent>;
180
+ private optionAction;
181
+ optionAction$: Observable<string>;
182
+ private projectedContentIsInDOM;
183
+ projectedContentIsInDOM$: Observable<boolean>;
184
+ private selectedOptionsToEmit;
185
+ selectedOptionsToEmit$: Observable<ListboxOptionComponent[]>;
186
+ private textboxBlur;
187
+ textboxBlur$: Observable<void>;
188
+ private touched;
189
+ touched$: Observable<boolean>;
190
+ private platform;
191
+ get isOpen(): boolean;
192
+ initActiveDescendant(source$?: Observable<string>): void;
193
+ setLabel(label: ComboboxLabelComponent): void;
194
+ openListbox(): void;
195
+ closeListbox(): void;
196
+ toggleListbox(): void;
197
+ setProjectedContentIsInDOM(): void;
198
+ emitTextboxBlur(): void;
199
+ setTouched(): void;
200
+ emitTextboxFocus(focus?: FocusTextbox): void;
201
+ emitOptionAction(action: OptionAction | string): void;
202
+ isMobile(): boolean;
203
+ setProjectedContent(groups: QueryList<ListboxGroupComponent>, options: QueryList<ListboxOptionComponent>): void;
204
+ setGroups(groups: QueryList<ListboxGroupComponent>): void;
205
+ setAllOptions(groups: QueryList<ListboxGroupComponent>, options: QueryList<ListboxOptionComponent>): void;
206
+ setSelectedOptionsToEmit(selected: ListboxOptionComponent[]): void;
207
+ getSelectedOptions(options: ListboxOptionComponent[]): ListboxOptionComponent[];
208
+ isSelectAllListboxOption(option: ListboxOptionComponent): option is SelectAllListboxOptionComponent;
209
+ setIsKeyboardEvent(isKeyboardEvent: boolean): void;
210
+ destroy(): void;
211
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxService, never>;
212
+ static ɵprov: i0.ɵɵInjectableDeclaration<ComboboxService>;
213
+ }
214
+
215
+ declare class ComboboxLabelComponent implements AfterViewInit {
216
+ labelContent: TemplateRef<unknown>;
217
+ service: ComboboxService;
218
+ ngAfterViewInit(): void;
219
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxLabelComponent, never>;
220
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxLabelComponent, "hsi-ui-combobox-label", never, {}, {}, never, ["*"], true, never>;
221
+ }
222
+
223
+ declare class ComboboxComponent implements OnInit, OnDestroy {
224
+ labelComponent: ComboboxLabelComponent;
225
+ service: ComboboxService;
226
+ platform: Platform;
227
+ private zone;
228
+ private document;
229
+ private elRef;
230
+ private destroyRef;
231
+ ngOnInit(): void;
232
+ ngOnDestroy(): void;
233
+ handleOutsideClick(): void;
234
+ static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxComponent, never>;
235
+ static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxComponent, "hsi-ui-combobox", never, {}, {}, ["labelComponent"], ["*"], true, never>;
236
+ }
237
+
238
+ declare class ActiveIndexService {
239
+ private activeIndex;
240
+ activeIndex$: Observable<number>;
241
+ scrollContentRef: ElementRef<HTMLDivElement>;
242
+ private service;
243
+ private filtering;
244
+ private scrolling;
245
+ init(allOptions$: Observable<ListboxOptionComponent[]>, destroyRef: DestroyRef): void;
246
+ setScrollContentRef(scrollContentRef: ElementRef): void;
247
+ initActiveId(): void;
248
+ listenToActions(allOptions$: Observable<ListboxOptionComponent[]>, destroyRef: DestroyRef): void;
249
+ private setNextActiveIndex;
250
+ private setPrevActiveIndex;
251
+ setActiveIndex(index: number | null, actionIfDisabled: OptionAction.next | OptionAction.previous | null, options: ListboxOptionComponent[], scrollToIndex?: boolean): void;
252
+ handleActiveIndexWhenCannotBeSet(): void;
253
+ private handleScrollingForNewIndex;
254
+ private getIndexForAction;
255
+ actionIsTypingChar(action: OptionAction | string): boolean;
256
+ updateActiveIndexFromKeyChar(char: string, options: ListboxOptionComponent[]): void;
257
+ private setActiveDescendant;
258
+ setActiveIndexToFirstSelectedOrDefault(options: ListboxOptionComponent[]): void;
259
+ static ɵfac: i0.ɵɵFactoryDeclaration<ActiveIndexService, never>;
260
+ static ɵprov: i0.ɵɵInjectableDeclaration<ActiveIndexService>;
261
+ }
262
+
263
+ declare class ListboxFilteringService {
264
+ searchTimeout: ReturnType<typeof setTimeout>;
265
+ searchString: string;
266
+ updateSearchString(char: string): void;
267
+ resetSearch(): void;
268
+ getIndexByLetter(options: ListboxOptionComponent[], searchString: string, startIndex: number): number;
269
+ filterOptionsBySearchString(options: ListboxOptionComponent[], searchString: string, exclude?: ListboxOptionComponent[]): ListboxOptionComponent[];
270
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListboxFilteringService, never>;
271
+ static ɵprov: i0.ɵɵInjectableDeclaration<ListboxFilteringService>;
272
+ }
273
+
274
+ declare class ListboxScrollService {
275
+ private document;
276
+ isElementInView(element: HTMLElement): boolean;
277
+ isScrollable(element: HTMLElement): boolean;
278
+ maintainElementVisibility(activeElement: HTMLElement, scrollParent: HTMLElement): void;
279
+ scrollToTop(scrollParent: HTMLElement): void;
280
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListboxScrollService, never>;
281
+ static ɵprov: i0.ɵɵInjectableDeclaration<ListboxScrollService>;
282
+ }
283
+
284
+ type SelectedCountLabel = {
285
+ singular: string;
286
+ plural: string;
287
+ };
288
+ declare class ListboxComponent implements OnChanges, AfterContentInit, AfterViewInit {
289
+ ngFormControl: FormControl<any | any[]>;
290
+ findsOptionOnTyping: boolean;
291
+ isMultiSelect: boolean;
292
+ maxHeight: number;
293
+ valueChanges: EventEmitter<any>;
294
+ scrollableContentRef: ElementRef<HTMLDivElement>;
295
+ label: ListboxLabelComponent;
296
+ options: QueryList<ListboxOptionComponent>;
297
+ groups: QueryList<ListboxGroupComponent>;
298
+ service: ComboboxService;
299
+ activeIndex: ActiveIndexService;
300
+ protected filtering: ListboxFilteringService;
301
+ protected scrolling: ListboxScrollService;
302
+ protected destroyRef: DestroyRef;
303
+ ngOnChanges(changes: SimpleChanges): void;
304
+ ngAfterContentInit(): void;
305
+ ngAfterViewInit(): void;
306
+ setOnOptionChanges(): void;
307
+ setSelectedEmitting(): void;
308
+ emitValue(selections: any[]): void;
309
+ setOnBlurEvent(): void;
310
+ shouldAutoSelectOptionOnBlur(activeIndex: number, options: ListboxOptionComponent[]): boolean;
311
+ setOptionAction(): void;
312
+ actionIsTypingChar(action: OptionAction | string): boolean;
313
+ setResetOnClose(): void;
314
+ resetScroll(): void;
315
+ getListboxLabelAsBoxPlaceholder(): string;
316
+ selectOptionFromIndex(index: number, options: ListboxOptionComponent[]): void;
317
+ handleOptionClick(event: MouseEvent, optionIndex: number, groupIndex?: number): void;
318
+ handleOptionSelect(optionIndex: number, options: ListboxOptionComponent[], groupIndex?: number): void;
319
+ toggleOptionSelected(option: ListboxOptionComponent, options: ListboxOptionComponent[]): void;
320
+ updateSelectedOptionsToEmit(options: ListboxOptionComponent[]): void;
321
+ selectSingleSelectOption(option: ListboxOptionComponent, options: ListboxOptionComponent[]): void;
322
+ isSelectAllListboxOption(option: ListboxOptionComponent): option is SelectAllListboxOptionComponent;
323
+ getOptionIndexFromGroups(groupIndex: number, optionIndex: number): number;
324
+ getSelectedOptions(options: ListboxOptionComponent[]): ListboxOptionComponent[];
325
+ updateActiveIndexOnExternalChanges(): void;
326
+ handleOptionMousedown(): void;
327
+ static ɵfac: i0.ɵɵFactoryDeclaration<ListboxComponent, never>;
328
+ 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>;
329
+ }
330
+
331
+ declare class TextboxComponent implements OnInit, AfterViewInit {
332
+ ariaLabel: string;
333
+ selectedCountLabel?: SelectedCountLabel;
334
+ customLabel: (selectedOptions: ListboxOptionComponent[]) => string;
335
+ dynamicLabel: boolean;
336
+ findsOptionOnTyping: boolean;
337
+ box: ElementRef<HTMLDivElement>;
338
+ boxIcon: ElementRef<HTMLDivElement>;
339
+ openKeys: string[];
340
+ label: BehaviorSubject<string>;
341
+ label$: rxjs.Observable<string>;
342
+ protected destroyRef: DestroyRef;
343
+ service: ComboboxService;
344
+ private platform;
345
+ protected zone: NgZone;
346
+ ngOnInit(): void;
347
+ ngAfterViewInit(): void;
348
+ setFocusListener(): void;
349
+ focusBox(): void;
350
+ handleBlur(event: FocusEvent): void;
351
+ isHtmlElement(target: EventTarget): target is HTMLElement;
352
+ isMobile(): boolean;
353
+ handleClick(): void;
354
+ handleKeydown(event: KeyboardEvent): void;
355
+ onEscape(): void;
356
+ getActionFromKeydownEvent(event: KeyboardEvent): ComboboxAction;
357
+ isTypingCharacter(event: KeyboardEvent): boolean;
358
+ getActionFromKeyEventWhenOpen(event: KeyboardEvent): ComboboxAction;
359
+ handleKeyboardAction(action: ComboboxAction, event: KeyboardEvent): void;
360
+ setLabel(): void;
361
+ getComputedLabel(touched: boolean, options: ListboxOptionComponent[]): string;
362
+ getDefaultLabel(selectedOptions: ListboxOptionComponent[]): string;
363
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextboxComponent, never>;
364
+ 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, ["[boxLabel]", "[boxIcon]"], true, never>;
365
+ }
366
+
367
+ declare class EditableTextboxComponent extends TextboxComponent implements OnInit, AfterViewInit {
368
+ inputElRef: ElementRef<HTMLInputElement>;
369
+ autoSelect: boolean;
370
+ autoSelectTrigger: 'any' | 'character';
371
+ displaySelected: boolean;
372
+ initialValue: string;
373
+ inputType: 'text' | 'search';
374
+ ngFormControl: FormControl<string>;
375
+ placeholder: string;
376
+ clearOnClick: boolean;
377
+ valueChanges: EventEmitter<string>;
378
+ moveFocusToTextboxKeys: string[];
379
+ value: BehaviorSubject<string>;
380
+ value$: rxjs.Observable<string>;
381
+ openKeys: string[];
382
+ ngOnInit(): void;
383
+ ngAfterViewInit(): void;
384
+ setLabel(): void;
385
+ onSelectionChange(selectedOptions: ListboxOptionComponent[]): void;
386
+ onInputChange(value: string): void;
387
+ setAndEmitValue(value: string): void;
388
+ setValue(value: string): void;
389
+ emitValue(value: string): void;
390
+ handleClick(): void;
391
+ protected setAutoSelectWhenInputIsEmpty(): void;
392
+ onEscape(): void;
393
+ getActionFromKeydownEvent(event: KeyboardEvent): ComboboxAction;
394
+ getActionFromKeydownEventWhenOpen(event: KeyboardEvent): ComboboxAction;
395
+ handleKeyboardAction(action: string, event: KeyboardEvent): void;
396
+ isPrintableCharacter(str: string): RegExpMatchArray;
397
+ static ɵfac: i0.ɵɵFactoryDeclaration<EditableTextboxComponent, never>;
398
+ 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; }; "clearOnClick": { "alias": "clearOnClick"; "required": false; }; }, { "valueChanges": "valueChanges"; }, never, ["[boxIcon]"], true, never>;
399
+ }
400
+
401
+ declare class HsiUiComboboxModule {
402
+ static ɵfac: i0.ɵɵFactoryDeclaration<HsiUiComboboxModule, never>;
403
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HsiUiComboboxModule, never, [typeof ComboboxComponent, typeof ComboboxLabelComponent, typeof TextboxComponent, typeof ListboxComponent, typeof ListboxGroupComponent, typeof ListboxOptionComponent, typeof ListboxLabelComponent, typeof EditableTextboxComponent, typeof SelectAllListboxOptionComponent], [typeof ComboboxComponent, typeof ComboboxLabelComponent, typeof TextboxComponent, typeof ListboxComponent, typeof ListboxGroupComponent, typeof ListboxLabelComponent, typeof ListboxOptionComponent, typeof EditableTextboxComponent, typeof SelectAllListboxOptionComponent]>;
404
+ static ɵinj: i0.ɵɵInjectorDeclaration<HsiUiComboboxModule>;
405
+ }
406
+
407
+ interface HsiUiDirectoryItem {
408
+ name: string;
409
+ value?: string;
410
+ children?: HsiUiDirectoryItem[];
411
+ }
412
+ interface HsiUiDirectorySelection {
413
+ activePath: string;
414
+ selectedItem: string;
415
+ }
416
+ declare class HsiUiDirectoryComponent implements OnChanges {
417
+ items: HsiUiDirectoryItem[];
418
+ level: number;
419
+ path: string;
420
+ terminalItemsAreSelectable: boolean;
421
+ selectionElementRole: string;
422
+ /**
423
+ * Sets the activePath and selectedItem.
424
+ */
425
+ selection: HsiUiDirectorySelection;
426
+ /**
427
+ * Emits the activePath and selectedItem when a leaf item is selected.
428
+ *
429
+ * Constructed from the `value` of each item if provided, otherwise uses `name`.
430
+ */
431
+ selectionChanges: EventEmitter<HsiUiDirectorySelection>;
432
+ /**
433
+ * @internal
434
+ *
435
+ * Internal, will have no effect if provided at root level.
436
+ */
437
+ stateChanges: EventEmitter<HsiUiDirectorySelection>;
438
+ state: BehaviorSubject<HsiUiDirectorySelection>;
439
+ state$: rxjs.Observable<HsiUiDirectorySelection>;
440
+ open: {};
441
+ ngOnChanges(changes: SimpleChanges): void;
442
+ toggleOpen(key: string): void;
443
+ selectItem(item: HsiUiDirectoryItem): void;
444
+ setState(state: HsiUiDirectorySelection): void;
445
+ static ɵfac: i0.ɵɵFactoryDeclaration<HsiUiDirectoryComponent, never>;
446
+ 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>;
447
+ }
448
+
449
+ declare enum SortDirection {
450
+ asc = "asc",
451
+ desc = "desc"
452
+ }
453
+ type SortDirectionType = keyof typeof SortDirection;
454
+ type TableValue = string | number | boolean | Date;
455
+ type TableCellAlignment = 'left' | 'center' | 'right';
456
+ declare class TableColumn<Datum> {
457
+ /**
458
+ * The label of the column. Used in the table header.
459
+ * */
460
+ label: string;
461
+ /**
462
+ * Function to extract the value to be sorted on from the datum.
463
+ * If not provided, the formatted value will be used for sorting.
464
+ */
465
+ getSortValue: (x: Datum) => TableValue;
466
+ /**
467
+ * Function to format the value for display in the table.
468
+ */
469
+ getFormattedValue: (x: Datum) => string;
470
+ /**
471
+ * Function to determine the alignment of the cell content.
472
+ */
473
+ getAlignment: (x: Datum) => TableCellAlignment;
474
+ /**
475
+ * Width of the column. Can be a percentage or pixel value.
476
+ */
477
+ width: string;
478
+ /**
479
+ * Function to determine the sort order of the column.
480
+ * If not provided, sort with use d3.ascending on the getSortValue or getFormattedValue.
481
+ */
482
+ ascendingSortFunction: (a: Datum, b: Datum) => number;
483
+ sortDirection: SortDirectionType;
484
+ /**
485
+ * Whether the column is sortable.
486
+ */
487
+ sortable: boolean;
488
+ activelySorted: boolean;
489
+ /**
490
+ * The sort order of the column. Used to determine the order of sorting when multiple columns are sorted.
491
+ * Sorting tiebreaks are determined by increasing sortOrder number.
492
+ **/
493
+ sortOrder: number;
494
+ /**
495
+ * Whether the column is a row header.
496
+ */
497
+ isRowHeader: boolean;
498
+ readonly initialSortDirection: SortDirectionType;
499
+ constructor(init?: Partial<TableColumn<Datum>>);
500
+ defaultSort(a: Datum, b: Datum): number;
501
+ }
502
+
503
+ declare class HsiUiTableConfig<Datum> {
504
+ data: Datum[];
505
+ columns: TableColumn<Datum>[];
506
+ }
507
+
508
+ declare class TableComponent<Datum> implements OnInit {
509
+ config$: Observable<HsiUiTableConfig<Datum>>;
510
+ sortIcon: string;
511
+ data$: Observable<Datum[]>;
512
+ columns$: Observable<TableColumn<Datum>[]>;
513
+ tableHeaders$: Observable<string[]>;
514
+ sort: BehaviorSubject<TableColumn<Datum>>;
515
+ sort$: Observable<TableColumn<Datum>>;
516
+ private destroyRef;
517
+ ngOnInit(): void;
518
+ setTableData(): void;
519
+ getMinSortOrderColumn(columns: TableColumn<Datum>[]): TableColumn<Datum>;
520
+ getColumnsWithNewSortApplied(activeSortColumn: TableColumn<Datum>, columns: TableColumn<Datum>[], toggleSortDirection?: boolean): TableColumn<Datum>[];
521
+ setTableHeaders(): void;
522
+ validateRowHeaders(): void;
523
+ sortTableByColumn(column: TableColumn<Datum>): void;
524
+ sortData(data: Datum[], primaryColumnSort: TableColumn<Datum>, columns: TableColumn<Datum>[]): Datum[];
525
+ columnTrackingFunction(_: number, column: TableColumn<Datum>): string;
526
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent<any>, never>;
527
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any>, "hsi-ui-table", never, { "config$": { "alias": "config$"; "required": false; }; "sortIcon": { "alias": "sortIcon"; "required": false; }; }, {}, never, never, false, never>;
528
+ }
529
+
530
+ declare class SingleSortHeaderComponent<Datum> {
531
+ column: TableColumn<Datum>;
532
+ sortIcon: string;
533
+ getColumnSortClasses(): string[];
534
+ static ɵfac: i0.ɵɵFactoryDeclaration<SingleSortHeaderComponent<any>, never>;
535
+ 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>;
536
+ }
537
+
538
+ declare class TableModule {
539
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableModule, never>;
540
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TableModule, [typeof TableComponent, typeof SingleSortHeaderComponent], [typeof i3.CommonModule, typeof i4.CdkTableModule, typeof i5.MatIconModule], [typeof TableComponent]>;
541
+ static ɵinj: i0.ɵɵInjectorDeclaration<TableModule>;
542
+ }
543
+
544
+ declare class TabBodyComponent {
545
+ bodyContent: TemplateRef<HTMLElement>;
546
+ lazyLoadedContent: TemplateRef<any>;
547
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabBodyComponent, never>;
548
+ static ɵcmp: i0.ɵɵComponentDeclaration<TabBodyComponent, "hsi-ui-tab-body", never, {}, {}, ["lazyLoadedContent"], ["*"], true, never>;
549
+ }
550
+
551
+ declare const HSI_UI_TAB_CONTENT: InjectionToken<MatTabContent>;
552
+ /**
553
+ * 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.
554
+ *
555
+ * Has the same functionality as https://material.angular.io/components/tabs/overview#lazy-loading
556
+ */
557
+ declare class TabContentDirective {
558
+ /** Content for the tab. */
559
+ template: TemplateRef<any>;
560
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabContentDirective, never>;
561
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TabContentDirective, "[hsiUiTabContent]", never, {}, {}, never, never, true, never>;
562
+ }
563
+
564
+ declare class TabLabelComponent {
565
+ value: string;
566
+ labelElement: ElementRef<HTMLDivElement>;
567
+ labelContent: TemplateRef<unknown>;
568
+ id: string;
569
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabLabelComponent, never>;
570
+ static ɵcmp: i0.ɵɵComponentDeclaration<TabLabelComponent, "hsi-ui-tab-label", never, { "value": { "alias": "value"; "required": false; }; }, {}, never, ["*"], true, never>;
571
+ }
572
+
573
+ declare class TabItemComponent<T> implements OnChanges {
574
+ isActive: boolean;
575
+ value: T;
576
+ bodyComponent: TabBodyComponent;
577
+ labelComponent: TabLabelComponent;
578
+ private service;
579
+ ngOnChanges(): void;
580
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabItemComponent<any>, never>;
581
+ 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>;
582
+ }
583
+
584
+ declare class TabsService<T> {
585
+ activeTab: BehaviorSubject<TabItemComponent<T> | null>;
586
+ activeTab$: rxjs.Observable<TabItemComponent<T>>;
587
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabsService<any>, never>;
588
+ static ɵprov: i0.ɵɵInjectableDeclaration<TabsService<any>>;
589
+ }
590
+
591
+ declare class TabsComponent<T> implements AfterContentInit {
592
+ tabs: QueryList<TabItemComponent<T>>;
593
+ tabChange: EventEmitter<string | T>;
594
+ tabItems$: Observable<TabItemComponent<T>[]>;
595
+ tabChanges$: Observable<boolean[]>;
596
+ readonly service: TabsService<T>;
597
+ private destroyRef;
598
+ constructor();
599
+ ngAfterContentInit(): void;
600
+ initializeActiveTab(): void;
601
+ selectTab(tabItem: TabItemComponent<T>): void;
602
+ emitNewActiveTab(tabItem: TabItemComponent<T>): void;
603
+ handleKeydown(event: KeyboardEvent, tabItem: TabItemComponent<T>): void;
604
+ focusTab(tabItem: TabItemComponent<T>): void;
605
+ focusNextTab(tabIndex: number): void;
606
+ focusPreviousTab(tabIndex: number): void;
607
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabsComponent<any>, never>;
608
+ static ɵcmp: i0.ɵɵComponentDeclaration<TabsComponent<any>, "hsi-ui-tabs", never, {}, { "tabChange": "tabChange"; }, ["tabs"], never, true, never>;
609
+ }
610
+
611
+ declare class TabsModule {
612
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabsModule, never>;
613
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TabsModule, never, [typeof TabsComponent, typeof TabLabelComponent, typeof TabItemComponent, typeof TabBodyComponent, typeof TabContentDirective], [typeof TabsComponent, typeof TabLabelComponent, typeof TabItemComponent, typeof TabBodyComponent, typeof TabContentDirective]>;
614
+ static ɵinj: i0.ɵɵInjectorDeclaration<TabsModule>;
615
+ }
616
+
617
+ export { AutoComplete, ComboboxComponent, ComboboxLabelComponent, ComboboxService, EditableTextboxComponent, FocusTextbox, HSI_UI_TAB_CONTENT, HsiUiComboboxModule, HsiUiDirectoryComponent, HsiUiTableConfig, Key, ListboxAction, ListboxComponent, ListboxGroupComponent, ListboxLabelComponent, ListboxOptionComponent, OptionAction, SelectAllListboxOptionComponent, SortDirection, TabBodyComponent, TabContentDirective, TabItemComponent, TabLabelComponent, TableColumn, TableComponent, TableModule, TabsComponent, TabsModule, TextboxAction, TextboxComponent };
618
+ export type { ComboboxAction, HsiUiDirectoryItem, HsiUiDirectorySelection, KeyboardEventWithAutocomplete, ListboxOptionPropertyChange, SelectedCountLabel, SortDirectionType, TableCellAlignment, TableValue };
package/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@mathstack/ui" />
5
- export * from './public-api';
@@ -1,11 +0,0 @@
1
- import { AfterViewInit, TemplateRef } from '@angular/core';
2
- import { ComboboxService } from '../combobox.service';
3
- import * as i0 from "@angular/core";
4
- export declare class ComboboxLabelComponent implements AfterViewInit {
5
- service: ComboboxService;
6
- labelContent: TemplateRef<unknown>;
7
- constructor(service: ComboboxService);
8
- ngAfterViewInit(): void;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxLabelComponent, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxLabelComponent, "hsi-ui-combobox-label", never, {}, {}, never, ["*"], true, never>;
11
- }