@fundamental-ngx/cdk 0.44.0 → 0.44.1-rc.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fundamental-ngx/cdk",
3
- "version": "0.44.0",
3
+ "version": "0.44.1-rc.0",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "description": "Fundamental Library for Angular - CDK",
6
6
  "license": "Apache-2.0",
@@ -23,7 +23,7 @@
23
23
  "rxjs": "^7.8.0"
24
24
  },
25
25
  "dependencies": {
26
- "@fundamental-ngx/i18n": "0.44.0",
26
+ "@fundamental-ngx/i18n": "0.44.1-rc.0",
27
27
  "@fundamental-styles/cx": "0.28.3",
28
28
  "@sap-theming/theming-base-content": "^11.6.0",
29
29
  "compare-versions": "^6.0.0",
@@ -1,15 +1,14 @@
1
1
  import { BooleanInput } from '@angular/cdk/coercion';
2
- import { AfterViewInit, DestroyRef, EventEmitter } from '@angular/core';
2
+ import { AfterViewInit, EventEmitter } from '@angular/core';
3
3
  import { Nullable } from '../../models/nullable';
4
- import { FocusableItemPosition } from '../focusable-item';
5
- import { FocusableListDirective, FocusableListPosition } from '../focusable-list';
4
+ import { FocusableItemPosition, FocusableListPosition } from '../focusable-item';
5
+ import { FocusableListDirective } from '../focusable-list';
6
6
  import * as i0 from "@angular/core";
7
7
  export interface FocusableCellPosition {
8
8
  rowIndex: number;
9
9
  colIndex: number;
10
10
  }
11
11
  export declare class FocusableGridDirective implements AfterViewInit {
12
- private readonly _destroyRef;
13
12
  /** Direction of the content. */
14
13
  contentDirection: 'ltr' | 'rtl' | null;
15
14
  /** Whether the item in the previous/next row should be selected when going out of the first/last cell in the row. Default is false. */
@@ -22,11 +21,11 @@ export declare class FocusableGridDirective implements AfterViewInit {
22
21
  /** Event emitted when whole row focused, contains row's position info. */
23
22
  readonly rowFocused: EventEmitter<FocusableListPosition>;
24
23
  /** @hidden */
25
- private _wrapHorizontally;
26
- /** @hidden */
27
24
  private readonly _focusableLists;
28
25
  /** @hidden */
29
- constructor(_destroyRef: DestroyRef);
26
+ private _wrapHorizontally;
27
+ /** @hidden */
28
+ private readonly _destroyRef;
30
29
  /** @hidden */
31
30
  ngAfterViewInit(): void;
32
31
  /**
@@ -1,9 +1,9 @@
1
1
  import { DestroyRef, ElementRef, EventEmitter, NgZone } from '@angular/core';
2
2
  import { BooleanInput } from '@angular/cdk/coercion';
3
- import { HasElementRef } from '../../interfaces';
4
3
  import { DeprecatedSelector } from '../../deprecated-selector.class';
5
4
  import { Subject } from 'rxjs';
6
5
  import { Nullable } from '../../models/nullable';
6
+ import { FocusableItem } from './focusable.item';
7
7
  import * as i0 from "@angular/core";
8
8
  export type CellFocusedEventAnnouncer = Nullable<(position: FocusableItemPosition) => string>;
9
9
  export interface FocusableItemPosition {
@@ -16,7 +16,7 @@ export declare class DeprecatedFocusableItemDirective extends DeprecatedSelector
16
16
  static ɵfac: i0.ɵɵFactoryDeclaration<DeprecatedFocusableItemDirective, never>;
17
17
  static ɵdir: i0.ɵɵDirectiveDeclaration<DeprecatedFocusableItemDirective, "[fnFocusableItem]", never, {}, {}, never, never, true, never, false>;
18
18
  }
19
- export declare class FocusableItemDirective implements HasElementRef {
19
+ export declare class FocusableItemDirective implements FocusableItem {
20
20
  /** Whether the item is focusable. Default is true. */
21
21
  set fdkFocusableItem(val: BooleanInput);
22
22
  get fdkFocusableItem(): boolean;
@@ -24,13 +24,15 @@ export declare class FocusableItemDirective implements HasElementRef {
24
24
  cellFocusedEventAnnouncer: CellFocusedEventAnnouncer;
25
25
  /** Event emitted when the cell receives focus, not being emitted when focus moves between item's children. */
26
26
  readonly cellFocused: EventEmitter<FocusableItemPosition>;
27
- /** Element reference. */
28
- readonly elementRef: ElementRef<HTMLElement>;
29
27
  /** @hidden */
30
- readonly _keydown$: Subject<KeyboardEvent>;
28
+ readonly keydown: Subject<KeyboardEvent>;
31
29
  /** @hidden */
32
30
  _position: FocusableItemPosition;
33
31
  /** @hidden */
32
+ get _tabindex(): number;
33
+ /** Element reference. */
34
+ readonly elementRef: ElementRef<HTMLElement>;
35
+ /** @hidden */
34
36
  protected readonly _destroyRef: DestroyRef;
35
37
  /** @hidden */
36
38
  protected readonly _zone: NgZone;
@@ -43,8 +45,6 @@ export declare class FocusableItemDirective implements HasElementRef {
43
45
  /** @hidden */
44
46
  private _timerId;
45
47
  /** @hidden */
46
- get _tabindex(): number;
47
- /** @hidden */
48
48
  private readonly _focusableObserver;
49
49
  /** @hidden */
50
50
  private readonly _tabbableElementService;
@@ -54,6 +54,12 @@ export declare class FocusableItemDirective implements HasElementRef {
54
54
  private readonly _document;
55
55
  /** @hidden */
56
56
  constructor();
57
+ /** @hidden */
58
+ element: () => HTMLElement;
59
+ /** @hidden */
60
+ isFocusable(): boolean;
61
+ /** @hidden */
62
+ focus(): void;
57
63
  /** Set tabbable state */
58
64
  setTabbable(state: boolean): void;
59
65
  /** @hidden */
@@ -0,0 +1,4 @@
1
+ export interface FocusableListPosition {
2
+ rowIndex: number;
3
+ totalRows: number;
4
+ }
@@ -0,0 +1,10 @@
1
+ import { FocusableOption } from '@angular/cdk/a11y';
2
+ import { Observable } from 'rxjs';
3
+ import { FocusableItemPosition } from './focusable-item.directive';
4
+ export interface FocusableItem extends FocusableOption {
5
+ _position?: FocusableItemPosition;
6
+ isFocusable: (() => boolean) | boolean;
7
+ keydown: Observable<KeyboardEvent>;
8
+ setTabbable: (tabbable: boolean) => void;
9
+ element: (() => HTMLElement) | HTMLElement;
10
+ }
@@ -0,0 +1,6 @@
1
+ import { FocusableItem } from './focusable.item';
2
+ /**
3
+ * Returns the element of the item.
4
+ * @param item
5
+ */
6
+ export declare function getItemElement(item?: FocusableItem): HTMLElement | null;
@@ -2,3 +2,6 @@ export * from './focusable-item.module';
2
2
  export * from './focusable-item.directive';
3
3
  export * from './focusable-item.tokens';
4
4
  export * from './focusable.observer';
5
+ export * from './focusable.item';
6
+ export * from './is-item-focusable';
7
+ export * from './focusable-list.position';
@@ -0,0 +1,6 @@
1
+ import { FocusableItem } from './focusable.item';
2
+ /**
3
+ * Returns true if the item configured to be focusable.
4
+ * @param item
5
+ */
6
+ export declare function isItemFocusable(item: FocusableItem): boolean;
@@ -1,17 +1,12 @@
1
1
  import { AfterViewInit, DestroyRef, EventEmitter, OnChanges, OnDestroy, QueryList, SimpleChanges } from '@angular/core';
2
- import { FocusableItemDirective, FocusableItemPosition } from '../focusable-item/focusable-item.directive';
2
+ import { FocusableItemPosition } from '../focusable-item/focusable-item.directive';
3
3
  import { DeprecatedSelector } from '../../deprecated-selector.class';
4
+ import { FocusableItem, FocusableListPosition } from '../focusable-item';
4
5
  import { Subject } from 'rxjs';
5
6
  import { Nullable } from '../../models/nullable';
6
- import { FocusableOption } from '@angular/cdk/a11y';
7
- import { HasElementRef } from '../../interfaces';
8
7
  import { BooleanInput } from '@angular/cdk/coercion';
9
8
  import { ScrollPosition } from './scroll';
10
9
  import * as i0 from "@angular/core";
11
- export interface FocusableListPosition {
12
- rowIndex: number;
13
- totalRows: number;
14
- }
15
10
  export interface FocusableListItemFocusedEvent {
16
11
  index: number;
17
12
  total: number;
@@ -21,11 +16,6 @@ export interface FocusableListKeydownEvent {
21
16
  event: KeyboardEvent;
22
17
  activeItemIndex: Nullable<number>;
23
18
  }
24
- export type FocusableItem = FocusableOption & HasElementRef & {
25
- index: number;
26
- focusable: (() => boolean) | boolean;
27
- keydown: Subject<KeyboardEvent>;
28
- };
29
19
  export declare class DeprecatedFocusableListDirective extends DeprecatedSelector {
30
20
  static ɵfac: i0.ɵɵFactoryDeclaration<DeprecatedFocusableListDirective, never>;
31
21
  static ɵdir: i0.ɵɵDirectiveDeclaration<DeprecatedFocusableListDirective, "[fnFocusableList]", never, {}, {}, never, never, true, never, false>;
@@ -47,11 +37,11 @@ export declare class FocusableListDirective implements OnChanges, AfterViewInit,
47
37
  /** Event emitted when list's item focused, contains item's position info. */
48
38
  readonly itemFocused: EventEmitter<FocusableListItemFocusedEvent>;
49
39
  /** @hidden */
50
- readonly _projectedFocusableItems: QueryList<FocusableItemDirective>;
40
+ readonly _projectedFocusableItems: QueryList<FocusableItem>;
51
41
  /** @hidden */
52
- get _focusableItems(): QueryList<FocusableItemDirective>;
42
+ get _focusableItems(): QueryList<FocusableItem>;
53
43
  /** @hidden */
54
- _items: QueryList<FocusableItemDirective> | undefined;
44
+ _items: QueryList<FocusableItem> | undefined;
55
45
  /** @hidden */
56
46
  readonly _gridItemFocused$: Subject<FocusableItemPosition>;
57
47
  /** @hidden */
@@ -61,10 +51,10 @@ export declare class FocusableListDirective implements OnChanges, AfterViewInit,
61
51
  /** @hidden */
62
52
  _isVisible: boolean;
63
53
  /** @hidden */
64
- protected _focusable: boolean;
65
- /** @hidden */
66
54
  protected readonly _destroyRef: DestroyRef;
67
55
  /** @hidden */
56
+ protected _focusable: boolean;
57
+ /** @hidden */
68
58
  private _gridPosition;
69
59
  /** @hidden */
70
60
  private _keyManager?;
@@ -97,7 +87,7 @@ export declare class FocusableListDirective implements OnChanges, AfterViewInit,
97
87
  /** @hidden */
98
88
  ngAfterViewInit(): void;
99
89
  /** Set items programmatically. */
100
- setItems(items: QueryList<FocusableItemDirective>): void;
90
+ setItems(items: QueryList<FocusableItem>): void;
101
91
  /** @hidden */
102
92
  ngOnDestroy(): void;
103
93
  /** Set active item in list */
@@ -115,9 +105,9 @@ export declare class FocusableListDirective implements OnChanges, AfterViewInit,
115
105
  /** @hidden */
116
106
  private _initializeFocusManager;
117
107
  /** @hidden */
118
- private _listenOnItems;
119
- /** @hidden */
120
108
  private _defaultListFocusedEventAnnouncer;
109
+ /** @hidden */
110
+ private _listenOnItems;
121
111
  static ɵfac: i0.ɵɵFactoryDeclaration<FocusableListDirective, never>;
122
112
  static ɵdir: i0.ɵɵDirectiveDeclaration<FocusableListDirective, "[fdkFocusableList]", ["fdkFocusableList"], { "focusable": { "alias": "focusable"; "required": false; }; "navigationDirection": { "alias": "navigationDirection"; "required": false; }; "contentDirection": { "alias": "contentDirection"; "required": false; }; "wrap": { "alias": "wrap"; "required": false; }; "listFocusedEventAnnouncer": { "alias": "listFocusedEventAnnouncer"; "required": false; }; }, { "itemFocused": "itemFocused"; }, ["_projectedFocusableItems"], never, true, never, false>;
123
113
  }
Binary file