@fundamental-ngx/cdk 0.42.0-rc.2 → 0.42.0-rc.21
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/data-source/data-source.directive.d.ts +2 -2
- package/esm2020/data-source/data-source.directive.mjs +7 -3
- package/esm2020/forms/cva/cva.directive.mjs +3 -9
- package/esm2020/utils/decorators/apply-css-class.decorator.mjs +16 -15
- package/esm2020/utils/decorators/apply-css-style.decorator.mjs +5 -7
- package/esm2020/utils/directives/focusable-item/focusable-item.directive.mjs +44 -33
- package/esm2020/utils/directives/focusable-list/focusable-list.directive.mjs +43 -21
- package/esm2020/utils/directives/selectable-list/selectable-item.directive.mjs +4 -8
- package/esm2020/utils/directives/selectable-list/selectable-item.token.mjs +1 -1
- package/esm2020/utils/drag-and-drop/dnd-list/dnd-list.directive.mjs +7 -2
- package/esm2020/utils/dynamic-component/dynamic-component-container.mjs +3 -3
- package/esm2020/utils/helpers/get-native-element.mjs +6 -5
- package/esm2020/utils/interfaces/has-element-ref.interface.mjs +1 -1
- package/fesm2015/fundamental-ngx-cdk-data-source.mjs +6 -2
- package/fesm2015/fundamental-ngx-cdk-data-source.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-cdk-forms.mjs +3 -8
- package/fesm2015/fundamental-ngx-cdk-forms.mjs.map +1 -1
- package/fesm2015/fundamental-ngx-cdk-utils.mjs +117 -80
- package/fesm2015/fundamental-ngx-cdk-utils.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-cdk-data-source.mjs +6 -2
- package/fesm2020/fundamental-ngx-cdk-data-source.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-cdk-forms.mjs +3 -8
- package/fesm2020/fundamental-ngx-cdk-forms.mjs.map +1 -1
- package/fesm2020/fundamental-ngx-cdk-utils.mjs +117 -80
- package/fesm2020/fundamental-ngx-cdk-utils.mjs.map +1 -1
- package/forms/cva/cva.directive.d.ts +0 -2
- package/fundamental-ngx-cdk-v0.42.0-rc.21.tgz +0 -0
- package/package.json +3 -3
- package/utils/directives/focusable-item/focusable-item.directive.d.ts +20 -15
- package/utils/directives/focusable-list/focusable-list.directive.d.ts +28 -12
- package/utils/directives/selectable-list/selectable-item.directive.d.ts +2 -4
- package/utils/directives/selectable-list/selectable-item.token.d.ts +1 -1
- package/utils/drag-and-drop/dnd-list/dnd-list.directive.d.ts +3 -1
- package/utils/dynamic-component/dynamic-component-container.d.ts +2 -2
- package/utils/helpers/get-native-element.d.ts +3 -3
- package/utils/interfaces/has-element-ref.interface.d.ts +1 -1
- package/fundamental-ngx-cdk-v0.42.0-rc.2.tgz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Optional, Inject, isDevMode, inject, Directive, EventEmitter, Input, Output, HostListener, NgModule, ContentChildren, forwardRef, HostBinding, ElementRef, INJECTOR, ContentChild, Self, SkipSelf, PLATFORM_ID, QueryList, ViewContainerRef, Component, Injector, NgModuleFactory, Pipe, TemplateRef, ViewChild
|
|
2
|
+
import { InjectionToken, Injectable, Optional, Inject, isDevMode, inject, Directive, EventEmitter, Input, Output, HostListener, NgModule, ContentChildren, forwardRef, HostBinding, ElementRef, INJECTOR, ContentChild, NgZone, Renderer2, Self, SkipSelf, PLATFORM_ID, QueryList, ViewContainerRef, Component, Injector, NgModuleFactory, Pipe, TemplateRef, ViewChild } from '@angular/core';
|
|
3
3
|
import { DOCUMENT, CommonModule, AsyncPipe } from '@angular/common';
|
|
4
4
|
import { BehaviorSubject, Subject, ReplaySubject, Observable, fromEvent, NEVER, merge, Subscription, takeUntil as takeUntil$1, startWith as startWith$1, switchMap, combineLatest, firstValueFrom, filter as filter$1, isObservable, of, map as map$1, take as take$1 } from 'rxjs';
|
|
5
5
|
import * as i2 from '@angular/platform-browser';
|
|
@@ -9,7 +9,7 @@ import { takeUntil, filter, distinctUntilChanged, startWith, map, tap, take, deb
|
|
|
9
9
|
import { RIGHT_ARROW, DOWN_ARROW, LEFT_ARROW, UP_ARROW, SPACE, ESCAPE, DELETE, ENTER, MAC_ENTER, TAB, HOME, END, ALT, CONTROL, META, SHIFT, BACKSPACE, A, C, V, X, PAGE_UP, PAGE_DOWN, DASH, NUMPAD_MINUS, NUMPAD_ZERO, NUMPAD_ONE, NUMPAD_TWO, NUMPAD_THREE, NUMPAD_FOUR, NUMPAD_FIVE, NUMPAD_SIX, NUMPAD_SEVEN, NUMPAD_EIGHT, NUMPAD_NINE, F2, hasModifierKey } from '@angular/cdk/keycodes';
|
|
10
10
|
import { coerceBooleanProperty, coerceElement, coerceNumberProperty, coerceArray, coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
11
11
|
import * as i1$1 from '@angular/cdk/a11y';
|
|
12
|
-
import { FocusKeyManager } from '@angular/cdk/a11y';
|
|
12
|
+
import { FocusKeyManager, LiveAnnouncer } from '@angular/cdk/a11y';
|
|
13
13
|
import { createFocusTrap } from 'focus-trap';
|
|
14
14
|
import * as i1$2 from '@angular/cdk/observers';
|
|
15
15
|
import * as i1$3 from '@angular/cdk/overlay';
|
|
@@ -1348,16 +1348,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
|
1348
1348
|
*/
|
|
1349
1349
|
function getNativeElement(element) {
|
|
1350
1350
|
let coercible = element;
|
|
1351
|
-
if (
|
|
1352
|
-
coercible = element.elementRef
|
|
1351
|
+
if (hasElementRef(element)) {
|
|
1352
|
+
coercible = element.elementRef;
|
|
1353
1353
|
}
|
|
1354
1354
|
return coerceElement(coercible);
|
|
1355
1355
|
}
|
|
1356
1356
|
/**
|
|
1357
1357
|
* Checks whether object has element reference in it.
|
|
1358
1358
|
*/
|
|
1359
|
-
function
|
|
1360
|
-
return something &&
|
|
1359
|
+
function hasElementRef(something) {
|
|
1360
|
+
return something && something['elementRef'] instanceof ElementRef;
|
|
1361
1361
|
}
|
|
1362
1362
|
|
|
1363
1363
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
@@ -2941,12 +2941,7 @@ class FocusableItemDirective {
|
|
|
2941
2941
|
return this._tabbable ? 0 : -1;
|
|
2942
2942
|
}
|
|
2943
2943
|
/** @hidden */
|
|
2944
|
-
constructor(
|
|
2945
|
-
this._elementRef = _elementRef;
|
|
2946
|
-
this._focusableObserver = _focusableObserver;
|
|
2947
|
-
this._destroy$ = _destroy$;
|
|
2948
|
-
this._tabbableElementService = _tabbableElementService;
|
|
2949
|
-
this._liveAnnouncer = _liveAnnouncer;
|
|
2944
|
+
constructor() {
|
|
2950
2945
|
/** Function, which returns a string to be announced by screen-reader whenever an item which is in grid receives focus. */
|
|
2951
2946
|
this.cellFocusedEventAnnouncer = this._defaultItemFocusedEventAnnouncer;
|
|
2952
2947
|
/** Event emitted when the cell receives focus, not being emitted when focus moves between item's children. */
|
|
@@ -2959,18 +2954,45 @@ class FocusableItemDirective {
|
|
|
2959
2954
|
this._tabbableElements = new Map();
|
|
2960
2955
|
/** @hidden */
|
|
2961
2956
|
this._tabbable = true;
|
|
2957
|
+
/** Element reference. */
|
|
2958
|
+
this.elementRef = inject(ElementRef);
|
|
2959
|
+
/** @hidden */
|
|
2960
|
+
this._focusableObserver = inject(FocusableObserver);
|
|
2961
|
+
/** @hidden */
|
|
2962
|
+
this._destroy$ = inject(DestroyedService);
|
|
2963
|
+
/** @hidden */
|
|
2964
|
+
this._tabbableElementService = inject(TabbableElementService);
|
|
2965
|
+
/** @hidden */
|
|
2966
|
+
this._liveAnnouncer = inject(LiveAnnouncer);
|
|
2967
|
+
/** @hidden */
|
|
2968
|
+
this._zone = inject(NgZone);
|
|
2969
|
+
/** @hidden */
|
|
2970
|
+
this._document = inject(DOCUMENT);
|
|
2962
2971
|
this._focusableObserver
|
|
2963
|
-
.observe(this.
|
|
2972
|
+
.observe(this.elementRef, false)
|
|
2964
2973
|
.pipe(takeUntil$1(this._destroy$))
|
|
2965
2974
|
.subscribe((isFocusable) => {
|
|
2966
2975
|
if (!isFocusable && isFocusable !== this.fdkFocusableItem) {
|
|
2967
2976
|
this.fdkFocusableItem = isFocusable;
|
|
2968
2977
|
}
|
|
2969
2978
|
});
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2979
|
+
this._zone.runOutsideAngular(() => {
|
|
2980
|
+
fromEvent(this.elementRef.nativeElement, 'focusin')
|
|
2981
|
+
.pipe(takeUntil$1(this._destroy$))
|
|
2982
|
+
.subscribe(async () => {
|
|
2983
|
+
await this._onFocusin();
|
|
2984
|
+
});
|
|
2985
|
+
fromEvent(this.elementRef.nativeElement, 'focusout')
|
|
2986
|
+
.pipe(takeUntil$1(this._destroy$))
|
|
2987
|
+
.subscribe(() => {
|
|
2988
|
+
this._onFocusout();
|
|
2989
|
+
});
|
|
2990
|
+
fromEvent(this.elementRef.nativeElement, 'keydown')
|
|
2991
|
+
.pipe(takeUntil$1(this._destroy$))
|
|
2992
|
+
.subscribe((event) => {
|
|
2993
|
+
this._onKeydown(event);
|
|
2994
|
+
});
|
|
2995
|
+
});
|
|
2974
2996
|
}
|
|
2975
2997
|
/** Set tabbable state */
|
|
2976
2998
|
setTabbable(state) {
|
|
@@ -3013,18 +3035,18 @@ class FocusableItemDirective {
|
|
|
3013
3035
|
if (!this.fdkFocusableItem) {
|
|
3014
3036
|
return;
|
|
3015
3037
|
}
|
|
3016
|
-
const isFocused =
|
|
3038
|
+
const isFocused = this._document.activeElement === this.elementRef.nativeElement;
|
|
3017
3039
|
const shouldFocusChild = KeyUtil.isKeyCode(event, [ENTER, MAC_ENTER, F2]) && !event.shiftKey && isFocused;
|
|
3018
3040
|
const shouldFocusCell = ((KeyUtil.isKeyCode(event, F2) && event.shiftKey) || KeyUtil.isKeyCode(event, ESCAPE)) && !isFocused;
|
|
3019
3041
|
if (shouldFocusChild) {
|
|
3020
3042
|
event.stopPropagation();
|
|
3021
|
-
const tabbableElement = this._tabbableElementService.getTabbableElement(this.elementRef
|
|
3043
|
+
const tabbableElement = this._tabbableElementService.getTabbableElement(this.elementRef.nativeElement, false, true);
|
|
3022
3044
|
tabbableElement?.focus();
|
|
3023
3045
|
return;
|
|
3024
3046
|
}
|
|
3025
3047
|
else if (shouldFocusCell) {
|
|
3026
3048
|
event.stopPropagation();
|
|
3027
|
-
this.
|
|
3049
|
+
this.elementRef.nativeElement.focus();
|
|
3028
3050
|
return;
|
|
3029
3051
|
}
|
|
3030
3052
|
if (isFocused) {
|
|
@@ -3043,7 +3065,7 @@ class FocusableItemDirective {
|
|
|
3043
3065
|
_disableTabbableElements() {
|
|
3044
3066
|
// Since we cannot select by tabindex attribute (links, inputs, buttons might not have one but still can be focusable),
|
|
3045
3067
|
// Select all elements from the cell and filter by tabIndex property.
|
|
3046
|
-
Array.from(this.
|
|
3068
|
+
Array.from(this.elementRef.nativeElement.querySelectorAll('*'))
|
|
3047
3069
|
.filter((elm) => elm.tabIndex >= 0)
|
|
3048
3070
|
.forEach((elm) => {
|
|
3049
3071
|
this._tabbableElements.set(elm, elm.tabIndex);
|
|
@@ -3055,8 +3077,8 @@ class FocusableItemDirective {
|
|
|
3055
3077
|
return `Column ${position.colIndex + 1} of ${position.totalCols}, row: ${position.rowIndex + 1} of ${position.totalRows}`;
|
|
3056
3078
|
}
|
|
3057
3079
|
}
|
|
3058
|
-
FocusableItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FocusableItemDirective, deps: [
|
|
3059
|
-
FocusableItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: FocusableItemDirective, isStandalone: true, selector: "[fdkFocusableItem]", inputs: { fdkFocusableItem: "fdkFocusableItem", cellFocusedEventAnnouncer: "cellFocusedEventAnnouncer" }, outputs: { cellFocused: "cellFocused" }, host: {
|
|
3080
|
+
FocusableItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FocusableItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3081
|
+
FocusableItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: FocusableItemDirective, isStandalone: true, selector: "[fdkFocusableItem]", inputs: { fdkFocusableItem: "fdkFocusableItem", cellFocusedEventAnnouncer: "cellFocusedEventAnnouncer" }, outputs: { cellFocused: "cellFocused" }, host: { properties: { "attr.tabindex": "this._tabindex" } }, providers: [
|
|
3060
3082
|
{
|
|
3061
3083
|
provide: FDK_FOCUSABLE_ITEM_DIRECTIVE,
|
|
3062
3084
|
useExisting: FocusableItemDirective
|
|
@@ -3076,7 +3098,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
|
3076
3098
|
DestroyedService
|
|
3077
3099
|
]
|
|
3078
3100
|
}]
|
|
3079
|
-
}], ctorParameters: function () { return [
|
|
3101
|
+
}], ctorParameters: function () { return []; }, propDecorators: { fdkFocusableItem: [{
|
|
3080
3102
|
type: Input
|
|
3081
3103
|
}], cellFocusedEventAnnouncer: [{
|
|
3082
3104
|
type: Input
|
|
@@ -3085,15 +3107,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
|
3085
3107
|
}], _tabindex: [{
|
|
3086
3108
|
type: HostBinding,
|
|
3087
3109
|
args: ['attr.tabindex']
|
|
3088
|
-
}], _onFocusin: [{
|
|
3089
|
-
type: HostListener,
|
|
3090
|
-
args: ['focusin']
|
|
3091
|
-
}], _onFocusout: [{
|
|
3092
|
-
type: HostListener,
|
|
3093
|
-
args: ['focusout']
|
|
3094
|
-
}], _onKeydown: [{
|
|
3095
|
-
type: HostListener,
|
|
3096
|
-
args: ['keydown', ['$event']]
|
|
3097
3110
|
}] } });
|
|
3098
3111
|
|
|
3099
3112
|
class FocusableItemModule {
|
|
@@ -3365,16 +3378,15 @@ class FocusableListDirective {
|
|
|
3365
3378
|
return this._focusable;
|
|
3366
3379
|
}
|
|
3367
3380
|
/** @hidden */
|
|
3381
|
+
get _focusableItems() {
|
|
3382
|
+
return this._items ? this._items : this._projectedFocusableItems;
|
|
3383
|
+
}
|
|
3384
|
+
/** @hidden */
|
|
3368
3385
|
get _tabindex() {
|
|
3369
3386
|
return this._tabbable ? 0 : -1;
|
|
3370
3387
|
}
|
|
3371
3388
|
/** @hidden */
|
|
3372
|
-
constructor(
|
|
3373
|
-
this._renderer = _renderer;
|
|
3374
|
-
this._destroy$ = _destroy$;
|
|
3375
|
-
this._elementRef = _elementRef;
|
|
3376
|
-
this._liveAnnouncer = _liveAnnouncer;
|
|
3377
|
-
this._focusableObserver = _focusableObserver;
|
|
3389
|
+
constructor() {
|
|
3378
3390
|
/** @hidden */
|
|
3379
3391
|
this._focusable = false;
|
|
3380
3392
|
/** Direction of navigation. Should be set to 'grid' when list is a part of grid. */
|
|
@@ -3400,6 +3412,20 @@ class FocusableListDirective {
|
|
|
3400
3412
|
/** @hidden */
|
|
3401
3413
|
this._refreshItems$ = new Subject();
|
|
3402
3414
|
/** @hidden */
|
|
3415
|
+
this._refresh$ = new Subject();
|
|
3416
|
+
/** @hidden */
|
|
3417
|
+
this._renderer = inject(Renderer2);
|
|
3418
|
+
/** @hidden */
|
|
3419
|
+
this._destroy$ = inject(DestroyedService);
|
|
3420
|
+
/** @hidden */
|
|
3421
|
+
this._elementRef = inject(ElementRef);
|
|
3422
|
+
/** @hidden */
|
|
3423
|
+
this._liveAnnouncer = inject(LiveAnnouncer);
|
|
3424
|
+
/** @hidden */
|
|
3425
|
+
this._focusableObserver = inject(FocusableObserver);
|
|
3426
|
+
/** @hidden */
|
|
3427
|
+
this._document = inject(DOCUMENT);
|
|
3428
|
+
/** @hidden */
|
|
3403
3429
|
this._isVisible = false;
|
|
3404
3430
|
intersectionObservable(this._elementRef.nativeElement, { threshold: 0.25 })
|
|
3405
3431
|
.pipe(takeUntil(this._destroy$))
|
|
@@ -3427,13 +3453,24 @@ class FocusableListDirective {
|
|
|
3427
3453
|
}
|
|
3428
3454
|
/** @hidden */
|
|
3429
3455
|
ngAfterViewInit() {
|
|
3456
|
+
this._listenOnItems();
|
|
3457
|
+
}
|
|
3458
|
+
/** Set items programmatically. */
|
|
3459
|
+
setItems(items) {
|
|
3460
|
+
this._items = items;
|
|
3461
|
+
this._listenOnItems();
|
|
3462
|
+
}
|
|
3463
|
+
/** @hidden */
|
|
3464
|
+
_listenOnItems() {
|
|
3465
|
+
const refresh$ = merge(this._refresh$, this._destroy$);
|
|
3466
|
+
this._refresh$.next();
|
|
3430
3467
|
this._focusableItems.changes
|
|
3431
|
-
.pipe(startWith(
|
|
3468
|
+
.pipe(startWith(null), map(() => this._focusableItems.toArray()), tap((items) => {
|
|
3432
3469
|
const focusableItems = items.map((item, index) => ({
|
|
3433
3470
|
index,
|
|
3434
3471
|
focusable: () => item.fdkFocusableItem,
|
|
3435
|
-
elementRef:
|
|
3436
|
-
focus: () => item.elementRef
|
|
3472
|
+
elementRef: item.elementRef,
|
|
3473
|
+
focus: () => item.elementRef.nativeElement.focus(),
|
|
3437
3474
|
keydown: item._keydown$
|
|
3438
3475
|
}));
|
|
3439
3476
|
const direction = this.navigationDirection === 'grid' ? 'horizontal' : this.navigationDirection;
|
|
@@ -3442,7 +3479,7 @@ class FocusableListDirective {
|
|
|
3442
3479
|
contentDirection: this.contentDirection,
|
|
3443
3480
|
wrap: this.wrap
|
|
3444
3481
|
});
|
|
3445
|
-
}), takeUntil(
|
|
3482
|
+
}), takeUntil(refresh$))
|
|
3446
3483
|
.subscribe();
|
|
3447
3484
|
}
|
|
3448
3485
|
/** @hidden */
|
|
@@ -3455,7 +3492,7 @@ class FocusableListDirective {
|
|
|
3455
3492
|
if (event.defaultPrevented) {
|
|
3456
3493
|
return;
|
|
3457
3494
|
}
|
|
3458
|
-
const isFocused =
|
|
3495
|
+
const isFocused = this._document.activeElement === this._elementRef.nativeElement;
|
|
3459
3496
|
const shouldFocusChild = KeyUtil.isKeyCode(event, [ENTER, MAC_ENTER, F2]) && !event.shiftKey && isFocused;
|
|
3460
3497
|
const shouldFocusList = ((KeyUtil.isKeyCode(event, F2) && event.shiftKey) || KeyUtil.isKeyCode(event, ESCAPE)) && !isFocused;
|
|
3461
3498
|
if (shouldFocusChild) {
|
|
@@ -3481,7 +3518,7 @@ class FocusableListDirective {
|
|
|
3481
3518
|
return false;
|
|
3482
3519
|
});
|
|
3483
3520
|
if (availableIndex != null) {
|
|
3484
|
-
scrollIntoView(this._focusableItems.get(availableIndex)?.elementRef
|
|
3521
|
+
scrollIntoView(this._focusableItems.get(availableIndex)?.elementRef.nativeElement, scrollPosition);
|
|
3485
3522
|
this._keyManager?.setActiveItem(availableIndex);
|
|
3486
3523
|
}
|
|
3487
3524
|
}
|
|
@@ -3575,14 +3612,14 @@ class FocusableListDirective {
|
|
|
3575
3612
|
return `Row: ${position.rowIndex + 1} of ${position.totalRows}, use F2 button to dive in and focus list's item`;
|
|
3576
3613
|
}
|
|
3577
3614
|
}
|
|
3578
|
-
FocusableListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FocusableListDirective, deps: [
|
|
3615
|
+
FocusableListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FocusableListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3579
3616
|
FocusableListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: FocusableListDirective, isStandalone: true, selector: "[fdkFocusableList]", inputs: { focusable: "focusable", navigationDirection: "navigationDirection", contentDirection: "contentDirection", wrap: "wrap", listFocusedEventAnnouncer: "listFocusedEventAnnouncer" }, outputs: { itemFocused: "itemFocused" }, host: { listeners: { "keydown": "_onKeydown($event)", "focus": "_onFocus()" }, properties: { "attr.tabindex": "this._tabindex" } }, providers: [
|
|
3580
3617
|
{
|
|
3581
3618
|
provide: FDK_FOCUSABLE_LIST_DIRECTIVE,
|
|
3582
3619
|
useExisting: FocusableListDirective
|
|
3583
3620
|
},
|
|
3584
3621
|
DestroyedService
|
|
3585
|
-
], queries: [{ propertyName: "
|
|
3622
|
+
], queries: [{ propertyName: "_projectedFocusableItems", predicate: FDK_FOCUSABLE_ITEM_DIRECTIVE, descendants: true }], exportAs: ["fdkFocusableList"], usesOnChanges: true, ngImport: i0 });
|
|
3586
3623
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: FocusableListDirective, decorators: [{
|
|
3587
3624
|
type: Directive,
|
|
3588
3625
|
args: [{
|
|
@@ -3597,7 +3634,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
|
3597
3634
|
DestroyedService
|
|
3598
3635
|
]
|
|
3599
3636
|
}]
|
|
3600
|
-
}], ctorParameters: function () { return [
|
|
3637
|
+
}], ctorParameters: function () { return []; }, propDecorators: { focusable: [{
|
|
3601
3638
|
type: Input
|
|
3602
3639
|
}], navigationDirection: [{
|
|
3603
3640
|
type: Input
|
|
@@ -3609,7 +3646,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
|
3609
3646
|
type: Input
|
|
3610
3647
|
}], itemFocused: [{
|
|
3611
3648
|
type: Output
|
|
3612
|
-
}],
|
|
3649
|
+
}], _projectedFocusableItems: [{
|
|
3613
3650
|
type: ContentChildren,
|
|
3614
3651
|
args: [FDK_FOCUSABLE_ITEM_DIRECTIVE, { descendants: true }]
|
|
3615
3652
|
}], _tabindex: [{
|
|
@@ -4777,12 +4814,12 @@ class SelectableItemDirective {
|
|
|
4777
4814
|
(!this.readonly$ || !this.readonly$?.fdkReadonly));
|
|
4778
4815
|
}
|
|
4779
4816
|
/** @hidden */
|
|
4780
|
-
constructor(provider, disabled$, readonly$, selectionService,
|
|
4817
|
+
constructor(provider, disabled$, readonly$, selectionService, elementRef, _cd, _clicked) {
|
|
4781
4818
|
this.provider = provider;
|
|
4782
4819
|
this.disabled$ = disabled$;
|
|
4783
4820
|
this.readonly$ = readonly$;
|
|
4784
4821
|
this.selectionService = selectionService;
|
|
4785
|
-
this.
|
|
4822
|
+
this.elementRef = elementRef;
|
|
4786
4823
|
this._cd = _cd;
|
|
4787
4824
|
/** Event emitted when selection state being changed for selectable item. */
|
|
4788
4825
|
this.selected = new EventEmitter();
|
|
@@ -4807,7 +4844,7 @@ class SelectableItemDirective {
|
|
|
4807
4844
|
}
|
|
4808
4845
|
else {
|
|
4809
4846
|
this._selected = isSelected;
|
|
4810
|
-
const htmlElement = this.
|
|
4847
|
+
const htmlElement = this.elementRef.nativeElement;
|
|
4811
4848
|
const { classList } = htmlElement;
|
|
4812
4849
|
if (isSelected) {
|
|
4813
4850
|
classList.add('is-selected');
|
|
@@ -4820,10 +4857,6 @@ class SelectableItemDirective {
|
|
|
4820
4857
|
this.selected.emit(isSelected);
|
|
4821
4858
|
}
|
|
4822
4859
|
/** @hidden */
|
|
4823
|
-
elementRef() {
|
|
4824
|
-
return this._elementRef;
|
|
4825
|
-
}
|
|
4826
|
-
/** @hidden */
|
|
4827
4860
|
_listenToDisablingEvents() {
|
|
4828
4861
|
const disablingEvents$ = [];
|
|
4829
4862
|
if (this.disabled$) {
|
|
@@ -5196,6 +5229,8 @@ class DndListDirective {
|
|
|
5196
5229
|
this.itemsChange = new EventEmitter();
|
|
5197
5230
|
/** Event that is thrown when the item is dropped */
|
|
5198
5231
|
this.itemDropped = new EventEmitter();
|
|
5232
|
+
/** Event that is thrown when predicate function returned false. */
|
|
5233
|
+
this.dropCancelled = new EventEmitter();
|
|
5199
5234
|
/** @hidden */
|
|
5200
5235
|
this._closestItemIndex = null;
|
|
5201
5236
|
/** @hidden */
|
|
@@ -5335,6 +5370,7 @@ class DndListDirective {
|
|
|
5335
5370
|
this._closestItemIndex = null;
|
|
5336
5371
|
this._closestItemPosition = null;
|
|
5337
5372
|
if (!result) {
|
|
5373
|
+
this.dropCancelled.emit();
|
|
5338
5374
|
return;
|
|
5339
5375
|
}
|
|
5340
5376
|
if (draggedItemIndex !== replacedItemIndex) {
|
|
@@ -5470,7 +5506,7 @@ class DndListDirective {
|
|
|
5470
5506
|
}
|
|
5471
5507
|
}
|
|
5472
5508
|
DndListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DndListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5473
|
-
DndListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: DndListDirective, selector: "[fdkDndList], [fd-dnd-list]", inputs: { gridMode: "gridMode", dropMode: "dropMode", threshold: "threshold", replaceMode: "replaceMode", items: "items", draggable: "draggable", dropPredicate: "dropPredicate", dragoverPredicate: "dragoverPredicate" }, outputs: { dropPredicateCalculating: "dropPredicateCalculating", itemsChange: "itemsChange", itemDropped: "itemDropped" }, host: { properties: { "class": "this._initialClass" } }, providers: [{ provide: DND_LIST, useExisting: forwardRef(() => DndListDirective) }], queries: [{ propertyName: "dndItems", predicate: DND_ITEM }], ngImport: i0 });
|
|
5509
|
+
DndListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.8", type: DndListDirective, selector: "[fdkDndList], [fd-dnd-list]", inputs: { gridMode: "gridMode", dropMode: "dropMode", threshold: "threshold", replaceMode: "replaceMode", items: "items", draggable: "draggable", dropPredicate: "dropPredicate", dragoverPredicate: "dragoverPredicate" }, outputs: { dropPredicateCalculating: "dropPredicateCalculating", itemsChange: "itemsChange", itemDropped: "itemDropped", dropCancelled: "dropCancelled" }, host: { properties: { "class": "this._initialClass" } }, providers: [{ provide: DND_LIST, useExisting: forwardRef(() => DndListDirective) }], queries: [{ propertyName: "dndItems", predicate: DND_ITEM }], ngImport: i0 });
|
|
5474
5510
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: DndListDirective, decorators: [{
|
|
5475
5511
|
type: Directive,
|
|
5476
5512
|
args: [{
|
|
@@ -5499,6 +5535,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
|
5499
5535
|
type: Output
|
|
5500
5536
|
}], itemDropped: [{
|
|
5501
5537
|
type: Output
|
|
5538
|
+
}], dropCancelled: [{
|
|
5539
|
+
type: Output
|
|
5502
5540
|
}], dndItems: [{
|
|
5503
5541
|
type: ContentChildren,
|
|
5504
5542
|
args: [DND_ITEM]
|
|
@@ -6121,25 +6159,26 @@ function applyCssClass(target, propertyKey, descriptor) {
|
|
|
6121
6159
|
const originalMethod = descriptor.value;
|
|
6122
6160
|
descriptor.value = function () {
|
|
6123
6161
|
const self = this;
|
|
6124
|
-
if (!self
|
|
6162
|
+
if (!('elementRef' in self)) {
|
|
6125
6163
|
throw ELEMENT_REF_EXCEPTION;
|
|
6126
6164
|
}
|
|
6127
6165
|
const classListToApply = sanitize(originalMethod.apply(this));
|
|
6128
|
-
const elementRef = self.elementRef
|
|
6166
|
+
const elementRef = self.elementRef;
|
|
6129
6167
|
const nativeElement = elementRef?.nativeElement;
|
|
6130
|
-
if (nativeElement) {
|
|
6131
|
-
|
|
6132
|
-
nativeElement._classMap = {};
|
|
6133
|
-
}
|
|
6134
|
-
if (!self._uuidv4) {
|
|
6135
|
-
self._uuidv4 = uuidv4();
|
|
6136
|
-
}
|
|
6137
|
-
const currentClassList = Array.from(nativeElement.classList);
|
|
6138
|
-
const previousClassListToApply = nativeElement._classMap[self._uuidv4] || [];
|
|
6139
|
-
const newClassList = createComponentClassList(currentClassList, previousClassListToApply, classListToApply);
|
|
6140
|
-
nativeElement.className = newClassList.join(' ');
|
|
6141
|
-
nativeElement._classMap[self._uuidv4] = classListToApply;
|
|
6168
|
+
if (!nativeElement) {
|
|
6169
|
+
return classListToApply;
|
|
6142
6170
|
}
|
|
6171
|
+
if (!nativeElement._classMap) {
|
|
6172
|
+
nativeElement._classMap = {};
|
|
6173
|
+
}
|
|
6174
|
+
if (!self._uuidv4) {
|
|
6175
|
+
self._uuidv4 = uuidv4();
|
|
6176
|
+
}
|
|
6177
|
+
const currentClassList = Array.from(nativeElement.classList);
|
|
6178
|
+
const previousClassListToApply = nativeElement._classMap[self._uuidv4] || [];
|
|
6179
|
+
const newClassList = createComponentClassList(currentClassList, previousClassListToApply, classListToApply);
|
|
6180
|
+
nativeElement.className = newClassList.join(' ');
|
|
6181
|
+
nativeElement._classMap[self._uuidv4] = classListToApply;
|
|
6143
6182
|
return classListToApply;
|
|
6144
6183
|
};
|
|
6145
6184
|
}
|
|
@@ -6183,12 +6222,10 @@ function applyCssStyle(target, propertyKey, descriptor) {
|
|
|
6183
6222
|
throw ELEMENT_REF_EXCEPTION;
|
|
6184
6223
|
}
|
|
6185
6224
|
const _styles = originalMethod.apply(this);
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
});
|
|
6191
|
-
}
|
|
6225
|
+
const htmlElement = self.elementRef.nativeElement;
|
|
6226
|
+
Object.keys(_styles).forEach((key) => {
|
|
6227
|
+
htmlElement.style[key] = _styles[key];
|
|
6228
|
+
});
|
|
6192
6229
|
return _styles;
|
|
6193
6230
|
};
|
|
6194
6231
|
}
|
|
@@ -6239,8 +6276,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
|
6239
6276
|
|
|
6240
6277
|
class DynamicComponentContainer {
|
|
6241
6278
|
/** @hidden */
|
|
6242
|
-
constructor(
|
|
6243
|
-
this.
|
|
6279
|
+
constructor(elementRef, _injector, _cdr) {
|
|
6280
|
+
this.elementRef = elementRef;
|
|
6244
6281
|
this._injector = _injector;
|
|
6245
6282
|
this._cdr = _cdr;
|
|
6246
6283
|
/** @hidden */
|
|
@@ -7470,5 +7507,5 @@ class BaseToastDurationDismissibleConfig extends BaseToastConfig {
|
|
|
7470
7507
|
* Generated bundle index. Do not edit.
|
|
7471
7508
|
*/
|
|
7472
7509
|
|
|
7473
|
-
export { ANY_LANGUAGE_LETTERS_GROUP_REGEX, ANY_LANGUAGE_LETTERS_REGEX, AbstractFdNgxClass, AsyncOrSyncPipe, AttributeObserver, AutoCompleteDirective, AutoCompleteModule, BaseAnimatedToastConfig, BaseDismissibleToastService, BaseToastActionDismissibleRef, BaseToastConfig, BaseToastContainerComponent, BaseToastDurationDismissibleConfig, BaseToastDurationDismissibleContainerComponent, BaseToastDurationDismissibleRef, BaseToastOverlayContainer, BaseToastPosition, BaseToastRef, BaseToastService, BreakpointDirective, BreakpointModule, ClickedBehaviorModule, ClickedDirective, ContentDensityService, DECIMAL_NUMBER_UNICODE_GROUP_REGEX, DECIMAL_NUMBER_UNICODE_RANGE, DECIMAL_NUMBER_UNICODE_REGEX, DEFAULT_CONTENT_DENSITY, DND_ITEM, DND_LIST, DefaultReadonlyViewModifier, DeprecatedAutoCompleteDirective, DeprecatedClickedDirective, DeprecatedDisabledBehaviorDirective, DeprecatedFocusKeyManagerItemDirective, DeprecatedFocusKeyManagerListDirective, DeprecatedFocusableItemDirective, DeprecatedFocusableListDirective, DeprecatedIgnoreClickOnSelectionDirective, DeprecatedInitialFocusDirective, DeprecatedLineClampDirective, DeprecatedLineClampTargetDirective, DeprecatedOnlyDigitsDirective, DeprecatedOverflowListDirective, DeprecatedOverflowListItemDirective, DeprecatedReadonlyBehaviorDirective, DeprecatedRepeatDirective, DeprecatedResizeDirective, DeprecatedResizeHandleDirective, DeprecatedTemplateSelectorDirective, DeprecatedTruncateSelectorDirective, DestroyedService, DisabledBehaviorDirective, DisabledBehaviorModule, DisabledObserver, DisplayFnPipe, DndItemDirective, DndKeyboardGroupDirective, DndKeyboardItemDirective, DndListDirective, DragAndDropModule, DynamicComponentContainer, DynamicComponentInjector, DynamicComponentService, DynamicPortalComponent, ELEMENT_REF_EXCEPTION, FDK_DISABLED_DIRECTIVE, FDK_FOCUSABLE_GRID_DIRECTIVE, FDK_FOCUSABLE_ITEM_DIRECTIVE, FDK_FOCUSABLE_LIST_DIRECTIVE, FDK_READONLY_DIRECTIVE, FDK_SELECTABLE_ITEM_PROVIDER, FOCUSABLE_ITEM, FdkClickedProvider, FdkDisabledProvider, FdkReadonlyProvider, FilterStringsPipe, FocusKeyManagerHelpersModule, FocusKeyManagerItemDirective, FocusKeyManagerListDirective, FocusTrapService, FocusableGridDirective, FocusableGridModule, FocusableItemDirective, FocusableItemModule, FocusableListDirective, FocusableListModule, FocusableObserver, FunctionStrategy, INVALID_DATE_ERROR, IgnoreClickOnSelectionDirective, IgnoreClickOnSelectionDirectiveToken, IgnoreClickOnSelectionModule, InitialFocusDirective, InitialFocusModule, IsCompactDensityPipe, KeyUtil, KeyboardSupportService, LETTERS_UNICODE_RANGE, LIST_ITEM_COMPONENT, LineClampDirective, LineClampModule, LineClampTargetDirective, LocalStorageService, MOBILE_CONFIG_ERROR, MakeAsyncPipe, ModuleDeprecations, OVERFLOW_PRIORITY_SCORE, ObservableStrategy, OnlyDigitsDirective, OnlyDigitsModule, OverflowListDirective, OverflowListItemDirective, OverflowListModule, PipeModule, PromiseStrategy, RTL_LANGUAGE, RangeSelector, ReadonlyBehaviorDirective, ReadonlyBehaviorModule, ReadonlyObserver, RepeatDirective, RepeatModule, ResizeDirective, ResizeHandleDirective, ResizeModule, ResizeObserverFactory, ResizeObserverService, RtlService, SafePipe, SearchHighlightPipe, SelectComponentRootToken, SelectableItemDirective, SelectableItemToken, SelectableListDirective, SelectableListModule, SelectionService, THEME_SWITCHER_ROUTER_MISSING_ERROR, TabbableElementService, TemplateDirective, TemplateModule, ThemesService, ToastBottomCenterPosition, ToastBottomLeftPosition, ToastBottomRightPosition, ToastTopCenterPosition, ToastTopLeftPosition, ToastTopRightPosition, TruncateDirective, TruncateModule, TruncatePipe, TwoDigitsPipe, UtilsModule, ValueByPathPipe, ValueStrategy, ViewportSizeObservable, alternateSetter, applyCssClass, applyCssStyle, baseToastAnimations, coerceArraySafe, coerceBoolean, coerceCssPixel, consumerProviderFactory, getDocumentFontSize, getElementCapacity, getElementWidth, getNativeElement, getRandomColorAccent, intersectionObservable, isBlank, isBoolean, isCompactDensity, isFunction,
|
|
7510
|
+
export { ANY_LANGUAGE_LETTERS_GROUP_REGEX, ANY_LANGUAGE_LETTERS_REGEX, AbstractFdNgxClass, AsyncOrSyncPipe, AttributeObserver, AutoCompleteDirective, AutoCompleteModule, BaseAnimatedToastConfig, BaseDismissibleToastService, BaseToastActionDismissibleRef, BaseToastConfig, BaseToastContainerComponent, BaseToastDurationDismissibleConfig, BaseToastDurationDismissibleContainerComponent, BaseToastDurationDismissibleRef, BaseToastOverlayContainer, BaseToastPosition, BaseToastRef, BaseToastService, BreakpointDirective, BreakpointModule, ClickedBehaviorModule, ClickedDirective, ContentDensityService, DECIMAL_NUMBER_UNICODE_GROUP_REGEX, DECIMAL_NUMBER_UNICODE_RANGE, DECIMAL_NUMBER_UNICODE_REGEX, DEFAULT_CONTENT_DENSITY, DND_ITEM, DND_LIST, DefaultReadonlyViewModifier, DeprecatedAutoCompleteDirective, DeprecatedClickedDirective, DeprecatedDisabledBehaviorDirective, DeprecatedFocusKeyManagerItemDirective, DeprecatedFocusKeyManagerListDirective, DeprecatedFocusableItemDirective, DeprecatedFocusableListDirective, DeprecatedIgnoreClickOnSelectionDirective, DeprecatedInitialFocusDirective, DeprecatedLineClampDirective, DeprecatedLineClampTargetDirective, DeprecatedOnlyDigitsDirective, DeprecatedOverflowListDirective, DeprecatedOverflowListItemDirective, DeprecatedReadonlyBehaviorDirective, DeprecatedRepeatDirective, DeprecatedResizeDirective, DeprecatedResizeHandleDirective, DeprecatedTemplateSelectorDirective, DeprecatedTruncateSelectorDirective, DestroyedService, DisabledBehaviorDirective, DisabledBehaviorModule, DisabledObserver, DisplayFnPipe, DndItemDirective, DndKeyboardGroupDirective, DndKeyboardItemDirective, DndListDirective, DragAndDropModule, DynamicComponentContainer, DynamicComponentInjector, DynamicComponentService, DynamicPortalComponent, ELEMENT_REF_EXCEPTION, FDK_DISABLED_DIRECTIVE, FDK_FOCUSABLE_GRID_DIRECTIVE, FDK_FOCUSABLE_ITEM_DIRECTIVE, FDK_FOCUSABLE_LIST_DIRECTIVE, FDK_READONLY_DIRECTIVE, FDK_SELECTABLE_ITEM_PROVIDER, FOCUSABLE_ITEM, FdkClickedProvider, FdkDisabledProvider, FdkReadonlyProvider, FilterStringsPipe, FocusKeyManagerHelpersModule, FocusKeyManagerItemDirective, FocusKeyManagerListDirective, FocusTrapService, FocusableGridDirective, FocusableGridModule, FocusableItemDirective, FocusableItemModule, FocusableListDirective, FocusableListModule, FocusableObserver, FunctionStrategy, INVALID_DATE_ERROR, IgnoreClickOnSelectionDirective, IgnoreClickOnSelectionDirectiveToken, IgnoreClickOnSelectionModule, InitialFocusDirective, InitialFocusModule, IsCompactDensityPipe, KeyUtil, KeyboardSupportService, LETTERS_UNICODE_RANGE, LIST_ITEM_COMPONENT, LineClampDirective, LineClampModule, LineClampTargetDirective, LocalStorageService, MOBILE_CONFIG_ERROR, MakeAsyncPipe, ModuleDeprecations, OVERFLOW_PRIORITY_SCORE, ObservableStrategy, OnlyDigitsDirective, OnlyDigitsModule, OverflowListDirective, OverflowListItemDirective, OverflowListModule, PipeModule, PromiseStrategy, RTL_LANGUAGE, RangeSelector, ReadonlyBehaviorDirective, ReadonlyBehaviorModule, ReadonlyObserver, RepeatDirective, RepeatModule, ResizeDirective, ResizeHandleDirective, ResizeModule, ResizeObserverFactory, ResizeObserverService, RtlService, SafePipe, SearchHighlightPipe, SelectComponentRootToken, SelectableItemDirective, SelectableItemToken, SelectableListDirective, SelectableListModule, SelectionService, THEME_SWITCHER_ROUTER_MISSING_ERROR, TabbableElementService, TemplateDirective, TemplateModule, ThemesService, ToastBottomCenterPosition, ToastBottomLeftPosition, ToastBottomRightPosition, ToastTopCenterPosition, ToastTopLeftPosition, ToastTopRightPosition, TruncateDirective, TruncateModule, TruncatePipe, TwoDigitsPipe, UtilsModule, ValueByPathPipe, ValueStrategy, ViewportSizeObservable, alternateSetter, applyCssClass, applyCssStyle, baseToastAnimations, coerceArraySafe, coerceBoolean, coerceCssPixel, consumerProviderFactory, getDocumentFontSize, getElementCapacity, getElementWidth, getNativeElement, getRandomColorAccent, hasElementRef, intersectionObservable, isBlank, isBoolean, isCompactDensity, isFunction, isJsObject, isNumber, isObject, isOdd, isPresent, isPromise, isString, isStringMap, isSubscribable, isType, isValidContentDensity, moduleDeprecationsFactory, moduleDeprecationsProvider, parserFileSize, pxToNum, resizeObservable, scrollIntoView, scrollTop, selectStrategy, setDisabledState, setReadonlyState, toNativeElement, toastConnectedBottomLeftPosition, toastConnectedBottomPosition, toastConnectedBottomRightPosition, toastConnectedTopLeftPosition, toastConnectedTopPosition, toastConnectedTopRightPosition, uuidv4 };
|
|
7474
7511
|
//# sourceMappingURL=fundamental-ngx-cdk-utils.mjs.map
|