@energycap/components 0.39.16-ECAP-23124-menu-item-divider-improvements.20240516-1629 → 0.39.16-ECAP-23124-menu-item-divider-improvements.20240523-1101
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/esm2020/lib/controls/checkbox/checkbox.component.mjs +5 -4
- package/esm2020/lib/controls/combobox/combobox.component.mjs +35 -42
- package/esm2020/lib/controls/file-upload/file-upload.component.mjs +3 -3
- package/esm2020/lib/controls/form-control-base.mjs +10 -2
- package/esm2020/lib/controls/form-group/form-group.component.mjs +12 -3
- package/esm2020/lib/controls/menu/menu.component.mjs +67 -39
- package/esm2020/lib/controls/numericbox/numericbox.component.mjs +5 -4
- package/esm2020/lib/controls/radio-button/radio-button.component.mjs +5 -4
- package/esm2020/lib/controls/select/select.component.mjs +5 -4
- package/esm2020/lib/controls/textbox/textbox.component.mjs +4 -3
- package/fesm2015/energycap-components.mjs +1184 -1148
- package/fesm2015/energycap-components.mjs.map +1 -1
- package/fesm2020/energycap-components.mjs +1549 -1514
- package/fesm2020/energycap-components.mjs.map +1 -1
- package/lib/controls/combobox/combobox.component.d.ts +5 -0
- package/lib/controls/form-control-base.d.ts +10 -1
- package/lib/controls/form-group/form-group.component.d.ts +10 -1
- package/lib/controls/menu/menu.component.d.ts +25 -11
- package/package.json +1 -1
@@ -212,6 +212,11 @@ export declare class ComboboxComponent extends FormControlBase implements OnInit
|
|
212
212
|
* Number of filtered options to display in the footer. Excludes headings.
|
213
213
|
*/
|
214
214
|
filteredOptionCount: number;
|
215
|
+
/**
|
216
|
+
* Flat list of selectable items in the combobox.
|
217
|
+
* Does not include headings or divider-section items.
|
218
|
+
*/
|
219
|
+
private selectableItems;
|
215
220
|
/**
|
216
221
|
* Index of the currently-selected options
|
217
222
|
*/
|
@@ -3,6 +3,7 @@ import { AbstractControl } from "@angular/forms";
|
|
3
3
|
import { Subject } from "rxjs";
|
4
4
|
import { ValidationMessageService } from "../core/validation-message.service";
|
5
5
|
import { FormGroupHelper } from '../shared/form-group.helper';
|
6
|
+
import { PopoverContentPosition } from './popover/popover.component';
|
6
7
|
import * as i0 from "@angular/core";
|
7
8
|
export type ControlLabelPosition = "top" | "bottom" | "left";
|
8
9
|
/**
|
@@ -54,6 +55,14 @@ export declare abstract class FormControlBase implements OnInit, OnDestroy, OnCh
|
|
54
55
|
* Conditionally show a tooltip on the form control's input.
|
55
56
|
*/
|
56
57
|
tooltip?: string;
|
58
|
+
/**
|
59
|
+
* Conditionally show a help popover next to the controls label.
|
60
|
+
*/
|
61
|
+
helpPopover?: string;
|
62
|
+
/**
|
63
|
+
* When a help popover is present, allows the popover to be positioned in different locations.
|
64
|
+
*/
|
65
|
+
helpPopoverPosition?: PopoverContentPosition;
|
57
66
|
/**
|
58
67
|
* All current validation errors
|
59
68
|
*/
|
@@ -97,5 +106,5 @@ export declare abstract class FormControlBase implements OnInit, OnDestroy, OnCh
|
|
97
106
|
*/
|
98
107
|
protected translateValidationMessages(data?: any): Promise<void>;
|
99
108
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormControlBase, never>;
|
100
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<FormControlBase, never, never, { "autofocus": "autofocus"; "formModel": "formModel"; "label": "label"; "labelPosition": "labelPosition"; "id": "id"; "pending": "pending"; "required": "required"; "tabindex": "tabindex"; "readonly": "readonly"; "tooltip": "tooltip"; }, {}, never, never, false, never>;
|
109
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FormControlBase, never, never, { "autofocus": "autofocus"; "formModel": "formModel"; "label": "label"; "labelPosition": "labelPosition"; "id": "id"; "pending": "pending"; "required": "required"; "tabindex": "tabindex"; "readonly": "readonly"; "tooltip": "tooltip"; "helpPopover": "helpPopover"; "helpPopoverPosition": "helpPopoverPosition"; }, {}, never, never, false, never>;
|
101
110
|
}
|
@@ -3,6 +3,7 @@ import { UntypedFormGroup, UntypedFormArray, AbstractControl } from "@angular/fo
|
|
3
3
|
import { TranslateService } from "@ngx-translate/core";
|
4
4
|
import { ValidationMessageService } from "../../core/validation-message.service";
|
5
5
|
import { ControlLabelPosition } from "../form-control-base";
|
6
|
+
import { PopoverContentPosition } from "../popover/popover.component";
|
6
7
|
import * as i0 from "@angular/core";
|
7
8
|
/** Function to iterate over form controls and
|
8
9
|
* ensure they contain unique values. If any are duplicated all offending
|
@@ -61,6 +62,14 @@ export declare class FormGroupComponent implements OnInit {
|
|
61
62
|
/**An optional flag to hide the validation messages.
|
62
63
|
*/
|
63
64
|
hideValidationMessage?: boolean;
|
65
|
+
/**
|
66
|
+
* Conditionally show a help popover next to the controls label.
|
67
|
+
*/
|
68
|
+
helpPopover?: string;
|
69
|
+
/**
|
70
|
+
* When a help popover is present, allows the popover to be positioned in different locations.
|
71
|
+
*/
|
72
|
+
helpPopoverPosition?: PopoverContentPosition;
|
64
73
|
/**
|
65
74
|
* All current validation errors
|
66
75
|
*
|
@@ -92,5 +101,5 @@ export declare class FormGroupComponent implements OnInit {
|
|
92
101
|
*/
|
93
102
|
private translateValidationMessages;
|
94
103
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormGroupComponent, never>;
|
95
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormGroupComponent, "ec-form-group", never, { "id": "id"; "label": "label"; "formGroup": "formGroup"; "labelPosition": "labelPosition"; "overrideValidationError": "overrideValidationError"; "hideValidationMessage": "hideValidationMessage"; }, {}, never, ["*"], false, never>;
|
104
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormGroupComponent, "ec-form-group", never, { "id": "id"; "label": "label"; "formGroup": "formGroup"; "labelPosition": "labelPosition"; "overrideValidationError": "overrideValidationError"; "hideValidationMessage": "hideValidationMessage"; "helpPopover": "helpPopover"; "helpPopoverPosition": "helpPopoverPosition"; }, {}, never, ["*"], false, never>;
|
96
105
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AfterContentInit, ElementRef, EventEmitter, OnDestroy, Renderer2, TemplateRef } from '@angular/core';
|
1
|
+
import { AfterContentInit, ElementRef, EventEmitter, OnChanges, OnDestroy, Renderer2, SimpleChanges, TemplateRef } from '@angular/core';
|
2
2
|
import { ScrollService } from '../../core/scroll.service';
|
3
3
|
import { WindowService } from '../../core/window.service';
|
4
4
|
import { LinkTarget } from '../../display/tags/tag';
|
@@ -11,7 +11,7 @@ export interface MenuItem<TValue = any, SItems = any> extends NavItem {
|
|
11
11
|
caption?: string;
|
12
12
|
items?: MenuItem<SItems>[];
|
13
13
|
checked?: boolean;
|
14
|
-
display?: 'default' | 'heading' | 'divider' | '
|
14
|
+
display?: 'default' | 'heading' | 'divider' | 'divided-section';
|
15
15
|
value?: TValue;
|
16
16
|
classList?: string;
|
17
17
|
disabled?: boolean;
|
@@ -29,7 +29,7 @@ export declare const menuAnimationSpeed = 350;
|
|
29
29
|
*
|
30
30
|
* @export
|
31
31
|
*/
|
32
|
-
export declare class MenuComponent implements AfterContentInit, OnDestroy {
|
32
|
+
export declare class MenuComponent implements AfterContentInit, OnDestroy, OnChanges {
|
33
33
|
private el;
|
34
34
|
private renderer;
|
35
35
|
private windowService;
|
@@ -162,7 +162,29 @@ export declare class MenuComponent implements AfterContentInit, OnDestroy {
|
|
162
162
|
* This allows us to prevent double-calls to selectItem() with the same input.
|
163
163
|
*/
|
164
164
|
private lastSelected;
|
165
|
+
/**
|
166
|
+
* Flattened array of all selectable items in the menu. Makes it easier to keep track of the currently highlighted item for keyboard navigation.
|
167
|
+
*/
|
168
|
+
private selectableItems;
|
169
|
+
/**
|
170
|
+
* Helper function to return a flat list of all selectable items in the provided menu items. Filters out headings and divided-sections.
|
171
|
+
* This makes it much easier to keep track of currently highlighted items for keyboard navigation.
|
172
|
+
*/
|
173
|
+
static getSelectableItems(items: MenuItem[]): MenuItem[];
|
174
|
+
/**
|
175
|
+
* Returns an ID for the provided item based on its index in the provided items array. This mimics the behavior of the MenuComponent's
|
176
|
+
* generated IDs for items that don't have provided IDs. This is used in MenuComponent and ComboboxComponent to scroll to specific items.
|
177
|
+
* NOTE: If the items array does not match what is displayed in the menu, this function will not return the correct ID.
|
178
|
+
*
|
179
|
+
* Returns null if the not found
|
180
|
+
* @param items The MenuItems array to search through.
|
181
|
+
* @param item The item to generate the ID for.
|
182
|
+
* @param menuComponentId Used to prefix the generated ID. This should be the ID of the menu component the item is present in.
|
183
|
+
* @memberof MenuComponent
|
184
|
+
*/
|
185
|
+
static getIndexedItemId(items: MenuItem[], item?: MenuItem | null, menuComponentId?: string): string | null;
|
165
186
|
constructor(el: ElementRef, renderer: Renderer2, windowService: WindowService, scrollService: ScrollService);
|
187
|
+
ngOnChanges(changes: SimpleChanges): void;
|
166
188
|
/**
|
167
189
|
* Sets & displays the interalized template based on
|
168
190
|
* the set template.
|
@@ -216,14 +238,6 @@ export declare class MenuComponent implements AfterContentInit, OnDestroy {
|
|
216
238
|
*/
|
217
239
|
private scrollMenu;
|
218
240
|
private scrollToHighlightedItem;
|
219
|
-
/**
|
220
|
-
* Find a given item's index in the filtered items array.
|
221
|
-
*
|
222
|
-
* Returns -1 if not found
|
223
|
-
* @param itemToFind The matching item to find in the items array.
|
224
|
-
* @memberof MenuComponent
|
225
|
-
*/
|
226
|
-
private findItemIndex;
|
227
241
|
private addKeydownListener;
|
228
242
|
/**
|
229
243
|
* Sets the menu item ids using its index if item doesn't already have one
|
package/package.json
CHANGED