@sebgroup/green-angular 5.4.0 → 5.4.1

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 (45) hide show
  1. package/esm2022/src/v-angular/alert/alert.component.mjs +3 -3
  2. package/esm2022/src/v-angular/dropdown/dropdown-list/dropdown-list.component.mjs +49 -32
  3. package/esm2022/src/v-angular/dropdown/dropdown.component.mjs +3 -3
  4. package/esm2022/src/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.mjs +3 -4
  5. package/esm2022/src/v-angular/input/input.component.mjs +2 -2
  6. package/esm2022/src/v-angular/modal/dialog/dialog.component.mjs +31 -9
  7. package/esm2022/src/v-angular/modal/slide-out/slide-out.component.mjs +3 -3
  8. package/esm2022/src/v-angular/table/table.component.mjs +2 -2
  9. package/esm2022/src/v-angular/textarea/textarea.component.mjs +2 -2
  10. package/esm2022/v-angular/alert/alert.component.mjs +3 -3
  11. package/esm2022/v-angular/core/core.globals.mjs +20 -0
  12. package/esm2022/v-angular/core/core.utils.mjs +62 -0
  13. package/esm2022/v-angular/core/index.mjs +3 -0
  14. package/esm2022/v-angular/dropdown/dropdown-list/dropdown-list.component.mjs +49 -32
  15. package/esm2022/v-angular/dropdown/dropdown.component.mjs +3 -3
  16. package/esm2022/v-angular/dropdown/typeahead/typeahead-input/typeahead-input.component.mjs +3 -4
  17. package/esm2022/v-angular/index.mjs +2 -1
  18. package/esm2022/v-angular/input/input.component.mjs +2 -2
  19. package/esm2022/v-angular/modal/dialog/dialog.component.mjs +31 -9
  20. package/esm2022/v-angular/modal/slide-out/slide-out.component.mjs +3 -3
  21. package/esm2022/v-angular/table/table.component.mjs +2 -2
  22. package/esm2022/v-angular/textarea/textarea.component.mjs +2 -2
  23. package/fesm2022/sebgroup-green-angular-src-v-angular-alert.mjs +2 -2
  24. package/fesm2022/sebgroup-green-angular-src-v-angular-alert.mjs.map +1 -1
  25. package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs +52 -36
  26. package/fesm2022/sebgroup-green-angular-src-v-angular-dropdown.mjs.map +1 -1
  27. package/fesm2022/sebgroup-green-angular-src-v-angular-input.mjs +2 -2
  28. package/fesm2022/sebgroup-green-angular-src-v-angular-input.mjs.map +1 -1
  29. package/fesm2022/sebgroup-green-angular-src-v-angular-modal.mjs +32 -11
  30. package/fesm2022/sebgroup-green-angular-src-v-angular-modal.mjs.map +1 -1
  31. package/fesm2022/sebgroup-green-angular-src-v-angular-table.mjs +2 -2
  32. package/fesm2022/sebgroup-green-angular-src-v-angular-table.mjs.map +1 -1
  33. package/fesm2022/sebgroup-green-angular-src-v-angular-textarea.mjs +2 -2
  34. package/fesm2022/sebgroup-green-angular-src-v-angular-textarea.mjs.map +1 -1
  35. package/fesm2022/sebgroup-green-angular-v-angular.mjs +169 -53
  36. package/fesm2022/sebgroup-green-angular-v-angular.mjs.map +1 -1
  37. package/package.json +2 -2
  38. package/src/v-angular/dropdown/dropdown-list/dropdown-list.component.d.ts +8 -0
  39. package/src/v-angular/modal/dialog/dialog.component.d.ts +10 -3
  40. package/v-angular/core/core.globals.d.ts +13 -0
  41. package/v-angular/core/core.utils.d.ts +23 -0
  42. package/v-angular/core/index.d.ts +2 -0
  43. package/v-angular/dropdown/dropdown-list/dropdown-list.component.d.ts +8 -0
  44. package/v-angular/index.d.ts +1 -0
  45. package/v-angular/modal/dialog/dialog.component.d.ts +10 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sebgroup/green-angular",
3
- "version": "5.4.0",
3
+ "version": "5.4.1",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": ">=17.3.10",
6
6
  "@angular/common": ">=17.3.12",
@@ -17,7 +17,7 @@
17
17
  "scroll-into-view-if-needed": "^2.2.31"
18
18
  },
19
19
  "dependencies": {
20
- "@sebgroup/green-core": "^1.68.1",
20
+ "@sebgroup/green-core": "^1.68.5",
21
21
  "@sebgroup/chlorophyll": "^3.6.16",
22
22
  "@sebgroup/extract": "^3.0.2",
23
23
  "tslib": "^2.3.1"
@@ -37,6 +37,10 @@ export declare class NggvDropdownListComponent implements OnInit, OnChanges {
37
37
  selectedValue?: Option<string, any>;
38
38
  /** Subscribe if dropdown expanded to listen to click outside to close dropdown. */
39
39
  protected onClickSubscription: Subscription | undefined;
40
+ /** Subscribe to to keyboard events only when list is open. */
41
+ private onKeyDownSubscription;
42
+ private onKeyUpSubscription;
43
+ private _flattenedOptions;
40
44
  constructor(translocoScope: TranslocoScope);
41
45
  ngOnInit(): void;
42
46
  ngOnChanges(changes: SimpleChanges): void;
@@ -86,6 +90,10 @@ export declare class NggvDropdownListComponent implements OnInit, OnChanges {
86
90
  * @param event fired containing which key was released.
87
91
  */
88
92
  onKeyUp(event: KeyboardEvent): void;
93
+ /** @internal */
94
+ subscribeToKeyUpEvents(): void;
95
+ /** @internal */
96
+ subscribeToKeyDownEvents(): void;
89
97
  /**
90
98
  * Scrolls focused result into view with a specified offset.
91
99
  * @param key the result index which to scroll to.
@@ -1,12 +1,16 @@
1
- import { ElementRef, EventEmitter, OnInit, Renderer2 } from '@angular/core';
1
+ import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
2
+ import { ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2 } from '@angular/core';
2
3
  import { DialogButtons } from '../modal.types';
3
4
  import * as i0 from "@angular/core";
4
5
  export interface DialogEvent<T = any> {
5
6
  original: Event | undefined;
6
7
  payload: T | undefined;
7
8
  }
8
- export declare class NggvDialogComponent implements OnInit {
9
+ export declare class NggvDialogComponent implements OnInit, OnDestroy {
9
10
  private renderer;
11
+ private ref;
12
+ private configurableFocusTrapFactory;
13
+ private configurableFocusTrap;
10
14
  dialogRef: ElementRef | undefined;
11
15
  /** Special property used for selecting DOM elements during automated UI testing. */
12
16
  thook: string | null | undefined;
@@ -50,7 +54,7 @@ export declare class NggvDialogComponent implements OnInit {
50
54
  protected _previous: HTMLElement | undefined;
51
55
  protected _firstFocusable: HTMLElement | undefined;
52
56
  protected _lastFocusable: HTMLElement | undefined;
53
- constructor(renderer: Renderer2);
57
+ constructor(renderer: Renderer2, ref: ElementRef<HTMLElement>, configurableFocusTrapFactory: ConfigurableFocusTrapFactory);
54
58
  ngOnInit(): void;
55
59
  onAction(event: Event, action: string): void;
56
60
  open(opener?: HTMLElement): boolean;
@@ -59,6 +63,9 @@ export declare class NggvDialogComponent implements OnInit {
59
63
  focusTrap(event: KeyboardEvent): void;
60
64
  private hideOverflow;
61
65
  private resetOverflow;
66
+ private enableFocusTrap;
67
+ private disableFocusTrap;
68
+ ngOnDestroy(): void;
62
69
  static ɵfac: i0.ɵɵFactoryDeclaration<NggvDialogComponent, never>;
63
70
  static ɵcmp: i0.ɵɵComponentDeclaration<NggvDialogComponent, "nggv-dialog", ["dialog"], { "thook": { "alias": "thook"; "required": false; }; "shown": { "alias": "shown"; "required": false; }; "initiallyShown": { "alias": "initiallyShown"; "required": false; }; "heading": { "alias": "heading"; "required": false; }; "title": { "alias": "title"; "required": false; }; "content": { "alias": "content"; "required": false; }; "autoClose": { "alias": "autoClose"; "required": false; }; "payload": { "alias": "payload"; "required": false; }; "dialogTitleId": { "alias": "dialogTitleId"; "required": false; }; "dialogBodyId": { "alias": "dialogBodyId"; "required": false; }; "closeModalOnEscape": { "alias": "closeModalOnEscape"; "required": false; }; "closeButtonAriaLabel": { "alias": "closeButtonAriaLabel"; "required": false; }; "buttons": { "alias": "buttons"; "required": false; }; }, { "nggvCloseEvent": "nggvCloseEvent"; "nggvPositiveEvent": "nggvPositiveEvent"; "nggvNeutralEvent": "nggvNeutralEvent"; "nggvNegativeEvent": "nggvNegativeEvent"; }, never, ["*"], false, never>;
64
71
  }
@@ -0,0 +1,13 @@
1
+ export {};
2
+ declare global {
3
+ interface Window {
4
+ /** Counter for unique identifiers */
5
+ nggv: {
6
+ ids: {
7
+ [namespace: string]: number;
8
+ default: number;
9
+ };
10
+ nextId: (namespace?: string) => string;
11
+ };
12
+ }
13
+ }
@@ -0,0 +1,23 @@
1
+ import * as i0 from "@angular/core";
2
+ export interface Option<K, V> {
3
+ key: K;
4
+ label: V;
5
+ disabled?: boolean;
6
+ }
7
+ export interface OptionGroup<T extends Option<any, any>> {
8
+ label: string;
9
+ options: T[];
10
+ disabled?: boolean;
11
+ }
12
+ export type OptionBase<T extends Option<any, any>> = T | OptionGroup<T>;
13
+ export declare class DropdownUtils<K = string | null, V = string, T extends Option<K, V> = Option<K, V>> {
14
+ flattenOptions(options: OptionBase<T>[] | undefined, mustHaveLabel: boolean): T[];
15
+ /**
16
+ * Returns true if argument is an {@link OptionGroup}.
17
+ * @param option the object to check.
18
+ */
19
+ isGroup(option: OptionBase<T>): option is OptionGroup<T>;
20
+ deepEqual(original: any, change: any): boolean;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<DropdownUtils<any, any, any>, never>;
22
+ static ɵprov: i0.ɵɵInjectableDeclaration<DropdownUtils<any, any, any>>;
23
+ }
@@ -0,0 +1,2 @@
1
+ export * from './core.globals';
2
+ export * from './core.utils';
@@ -37,6 +37,10 @@ export declare class NggvDropdownListComponent implements OnInit, OnChanges {
37
37
  selectedValue?: Option<string, any>;
38
38
  /** Subscribe if dropdown expanded to listen to click outside to close dropdown. */
39
39
  protected onClickSubscription: Subscription | undefined;
40
+ /** Subscribe to to keyboard events only when list is open. */
41
+ private onKeyDownSubscription;
42
+ private onKeyUpSubscription;
43
+ private _flattenedOptions;
40
44
  constructor(translocoScope: TranslocoScope);
41
45
  ngOnInit(): void;
42
46
  ngOnChanges(changes: SimpleChanges): void;
@@ -86,6 +90,10 @@ export declare class NggvDropdownListComponent implements OnInit, OnChanges {
86
90
  * @param event fired containing which key was released.
87
91
  */
88
92
  onKeyUp(event: KeyboardEvent): void;
93
+ /** @internal */
94
+ subscribeToKeyUpEvents(): void;
95
+ /** @internal */
96
+ subscribeToKeyDownEvents(): void;
89
97
  /**
90
98
  * Scrolls focused result into view with a specified offset.
91
99
  * @param key the result index which to scroll to.
@@ -4,6 +4,7 @@ export * from './base-control-value-accessor';
4
4
  export * from './breadcrumbs';
5
5
  export * from './button';
6
6
  export * from './card';
7
+ export * from './core';
7
8
  export * from './character-countdown';
8
9
  export * from './checkbox';
9
10
  export * from './datepicker';
@@ -1,12 +1,16 @@
1
- import { ElementRef, EventEmitter, OnInit, Renderer2 } from '@angular/core';
1
+ import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';
2
+ import { ElementRef, EventEmitter, OnDestroy, OnInit, Renderer2 } from '@angular/core';
2
3
  import { DialogButtons } from '../modal.types';
3
4
  import * as i0 from "@angular/core";
4
5
  export interface DialogEvent<T = any> {
5
6
  original: Event | undefined;
6
7
  payload: T | undefined;
7
8
  }
8
- export declare class NggvDialogComponent implements OnInit {
9
+ export declare class NggvDialogComponent implements OnInit, OnDestroy {
9
10
  private renderer;
11
+ private ref;
12
+ private configurableFocusTrapFactory;
13
+ private configurableFocusTrap;
10
14
  dialogRef: ElementRef | undefined;
11
15
  /** Special property used for selecting DOM elements during automated UI testing. */
12
16
  thook: string | null | undefined;
@@ -50,7 +54,7 @@ export declare class NggvDialogComponent implements OnInit {
50
54
  protected _previous: HTMLElement | undefined;
51
55
  protected _firstFocusable: HTMLElement | undefined;
52
56
  protected _lastFocusable: HTMLElement | undefined;
53
- constructor(renderer: Renderer2);
57
+ constructor(renderer: Renderer2, ref: ElementRef<HTMLElement>, configurableFocusTrapFactory: ConfigurableFocusTrapFactory);
54
58
  ngOnInit(): void;
55
59
  onAction(event: Event, action: string): void;
56
60
  open(opener?: HTMLElement): boolean;
@@ -59,6 +63,9 @@ export declare class NggvDialogComponent implements OnInit {
59
63
  focusTrap(event: KeyboardEvent): void;
60
64
  private hideOverflow;
61
65
  private resetOverflow;
66
+ private enableFocusTrap;
67
+ private disableFocusTrap;
68
+ ngOnDestroy(): void;
62
69
  static ɵfac: i0.ɵɵFactoryDeclaration<NggvDialogComponent, never>;
63
70
  static ɵcmp: i0.ɵɵComponentDeclaration<NggvDialogComponent, "nggv-dialog", ["dialog"], { "thook": { "alias": "thook"; "required": false; }; "shown": { "alias": "shown"; "required": false; }; "initiallyShown": { "alias": "initiallyShown"; "required": false; }; "heading": { "alias": "heading"; "required": false; }; "title": { "alias": "title"; "required": false; }; "content": { "alias": "content"; "required": false; }; "autoClose": { "alias": "autoClose"; "required": false; }; "payload": { "alias": "payload"; "required": false; }; "dialogTitleId": { "alias": "dialogTitleId"; "required": false; }; "dialogBodyId": { "alias": "dialogBodyId"; "required": false; }; "closeModalOnEscape": { "alias": "closeModalOnEscape"; "required": false; }; "closeButtonAriaLabel": { "alias": "closeButtonAriaLabel"; "required": false; }; "buttons": { "alias": "buttons"; "required": false; }; }, { "nggvCloseEvent": "nggvCloseEvent"; "nggvPositiveEvent": "nggvPositiveEvent"; "nggvNeutralEvent": "nggvNeutralEvent"; "nggvNegativeEvent": "nggvNegativeEvent"; }, never, ["*"], false, never>;
64
71
  }