@clr/angular 13.4.1 → 13.4.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.
- package/clarity.api.md +0 -58
- package/esm2020/utils/index.mjs +1 -2
- package/fesm2015/clr-angular.mjs +2 -220
- package/fesm2015/clr-angular.mjs.map +1 -1
- package/fesm2020/clr-angular.mjs +2 -228
- package/fesm2020/clr-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/utils/index.d.ts +0 -1
- package/esm2020/utils/list-key-navigation/index.mjs +0 -10
- package/esm2020/utils/list-key-navigation/key-navigation-list.mjs +0 -120
- package/esm2020/utils/list-key-navigation/key-navigation-list.module.mjs +0 -24
- package/esm2020/utils/list-key-navigation/providers/focusable-items.mjs +0 -25
- package/esm2020/utils/list-key-navigation/providers/key-navigation-list.config.mjs +0 -19
- package/esm2020/utils/list-key-navigation/utils.mjs +0 -46
- package/utils/list-key-navigation/index.d.ts +0 -4
- package/utils/list-key-navigation/key-navigation-list.d.ts +0 -30
- package/utils/list-key-navigation/key-navigation-list.module.d.ts +0 -7
- package/utils/list-key-navigation/providers/focusable-items.d.ts +0 -3
- package/utils/list-key-navigation/providers/key-navigation-list.config.d.ts +0 -3
- package/utils/list-key-navigation/utils.d.ts +0 -11
package/clarity.api.md
CHANGED
|
@@ -48,7 +48,6 @@ import { Subscription } from 'rxjs';
|
|
|
48
48
|
import { TemplateRef } from '@angular/core';
|
|
49
49
|
import { TrackByFunction } from '@angular/core';
|
|
50
50
|
import { Type } from '@angular/core';
|
|
51
|
-
import { ValueProvider } from '@angular/core';
|
|
52
51
|
import { ViewContainerRef } from '@angular/core';
|
|
53
52
|
|
|
54
53
|
// @public (undocumented)
|
|
@@ -114,12 +113,6 @@ export const CLR_ICON_DIRECTIVES: Type<any>[];
|
|
|
114
113
|
// @public (undocumented)
|
|
115
114
|
export const CLR_LAYOUT_DIRECTIVES: Type<any>[];
|
|
116
115
|
|
|
117
|
-
// @public (undocumented)
|
|
118
|
-
export const CLR_LIST_KEY_NAVIGATION_COFNIG_PROVIDER: ValueProvider;
|
|
119
|
-
|
|
120
|
-
// @public (undocumented)
|
|
121
|
-
export const CLR_LIST_KEY_NAVIGATION_CONFIG: InjectionToken<unknown>;
|
|
122
|
-
|
|
123
116
|
// @public (undocumented)
|
|
124
117
|
export const CLR_LOADING_BUTTON_DIRECTIVES: Type<any>[];
|
|
125
118
|
|
|
@@ -2796,35 +2789,6 @@ class ClrKeyFocusModule {
|
|
|
2796
2789
|
static ɵmod: i0.ɵɵNgModuleDeclaration<ClrKeyFocusModule, [typeof i1_13.ClrKeyFocus, typeof i2_10.ClrRovingTabindex, typeof i3_10.ClrKeyFocusItem], [typeof i6.CommonModule], [typeof i1_13.ClrKeyFocus, typeof i2_10.ClrRovingTabindex, typeof i3_10.ClrKeyFocusItem]>;
|
|
2797
2790
|
}
|
|
2798
2791
|
|
|
2799
|
-
// @public (undocumented)
|
|
2800
|
-
export class ClrKeyNavigationList implements AfterViewInit {
|
|
2801
|
-
constructor(host: ElementRef<HTMLElement>, defaultConfig: KeyNavigationListConfig, focusableElementSelectors: string[]);
|
|
2802
|
-
// (undocumented)
|
|
2803
|
-
set configuration(config: Partial<KeyNavigationListConfig>);
|
|
2804
|
-
// (undocumented)
|
|
2805
|
-
ngAfterViewInit(): void;
|
|
2806
|
-
// (undocumented)
|
|
2807
|
-
onClick(e: Event): void;
|
|
2808
|
-
// (undocumented)
|
|
2809
|
-
onKeyDown(e: KeyboardEvent): void;
|
|
2810
|
-
// (undocumented)
|
|
2811
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ClrKeyNavigationList, "[clrKeyNavigationList]", never, { "configuration": "configuration"; }, {}, never>;
|
|
2812
|
-
// (undocumented)
|
|
2813
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ClrKeyNavigationList, never>;
|
|
2814
|
-
}
|
|
2815
|
-
|
|
2816
|
-
// @public (undocumented)
|
|
2817
|
-
export class ClrKeyNavigationListModule {
|
|
2818
|
-
// (undocumented)
|
|
2819
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ClrKeyNavigationListModule, never>;
|
|
2820
|
-
// (undocumented)
|
|
2821
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<ClrKeyNavigationListModule>;
|
|
2822
|
-
// Warning: (ae-forgotten-export) The symbol "i1" needs to be exported by the entry point index.d.ts
|
|
2823
|
-
//
|
|
2824
|
-
// (undocumented)
|
|
2825
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ClrKeyNavigationListModule, [typeof i1_50.ClrKeyNavigationList], never, [typeof i1_50.ClrKeyNavigationList]>;
|
|
2826
|
-
}
|
|
2827
|
-
|
|
2828
2792
|
// @public (undocumented)
|
|
2829
2793
|
export class ClrLabel implements OnInit, OnDestroy {
|
|
2830
2794
|
constructor(controlIdService: ControlIdService, layoutService: LayoutService, ngControlService: NgControlService, renderer: Renderer2, el: ElementRef);
|
|
@@ -5170,12 +5134,6 @@ export const FOCUS_ON_VIEW_INIT_DIRECTIVES: Type<any>[];
|
|
|
5170
5134
|
// @public (undocumented)
|
|
5171
5135
|
const FOCUS_TRAP_DIRECTIVES: Type<any>[];
|
|
5172
5136
|
|
|
5173
|
-
// @public (undocumented)
|
|
5174
|
-
export const FOCUSABLE_ELEMENT_SELECTORS: InjectionToken<unknown>;
|
|
5175
|
-
|
|
5176
|
-
// @public (undocumented)
|
|
5177
|
-
export const FOCUSABLE_ELEMENT_SELECTORS_PROVIDER: ValueProvider;
|
|
5178
|
-
|
|
5179
5137
|
// @public (undocumented)
|
|
5180
5138
|
const FOCUSABLES = "[href]:not([tabindex=\"-1\"]), button:not([disabled]):not([tabindex=\"-1\"]), input:not([disabled]):not([tabindex=\"-1\"]), select:not([disabled]):not([tabindex=\"-1\"]), textarea:not([disabled]):not([tabindex=\"-1\"]), [contenteditable=\"true\"]:not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"]) ";
|
|
5181
5139
|
|
|
@@ -5191,22 +5149,6 @@ export const IS_TOGGLE_PROVIDER: {
|
|
|
5191
5149
|
// @public (undocumented)
|
|
5192
5150
|
export function isToggleFactory(): BehaviorSubject<boolean>;
|
|
5193
5151
|
|
|
5194
|
-
// @public (undocumented)
|
|
5195
|
-
export interface KeyNavigationListConfig {
|
|
5196
|
-
// (undocumented)
|
|
5197
|
-
dir: string | null;
|
|
5198
|
-
// (undocumented)
|
|
5199
|
-
keyListItems: string;
|
|
5200
|
-
// (undocumented)
|
|
5201
|
-
layout: 'both' | 'horizontal' | 'vertical';
|
|
5202
|
-
// (undocumented)
|
|
5203
|
-
loop: boolean;
|
|
5204
|
-
// (undocumented)
|
|
5205
|
-
manageFocus: boolean;
|
|
5206
|
-
// (undocumented)
|
|
5207
|
-
manageTabindex: boolean;
|
|
5208
|
-
}
|
|
5209
|
-
|
|
5210
5152
|
// @public
|
|
5211
5153
|
export abstract class LoadingListener {
|
|
5212
5154
|
// (undocumented)
|
package/esm2020/utils/index.mjs
CHANGED
|
@@ -14,5 +14,4 @@ export * from './focus/focus-on-view-init/index';
|
|
|
14
14
|
export * from './focus-trap/index';
|
|
15
15
|
export * from './destroy';
|
|
16
16
|
export * from './for-type-ahead/index';
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyL3NyYy91dGlscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7OztHQUlHO0FBRUgsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGlC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mV4cG9ydCAqIGZyb20gJy4vYTExeS9pbmRleCc7XG5leHBvcnQgKiBmcm9tICcuL2RyYWctYW5kLWRyb3AvaW5kZXgnO1xuZXhwb3J0ICogZnJvbSAnLi9wb3BvdmVyL2luZGV4JztcbmV4cG9ydCAqIGZyb20gJy4vZm9jdXMvZm9jdXMtb24tdmlldy1pbml0L2luZGV4JztcbmV4cG9ydCAqIGZyb20gJy4vZm9jdXMtdHJhcC9pbmRleCc7XG5leHBvcnQgKiBmcm9tICcuL2Rlc3Ryb3knO1xuZXhwb3J0ICogZnJvbSAnLi9mb3ItdHlwZS1haGVhZC9pbmRleCc7XG4iXX0=
|
package/fesm2015/clr-angular.mjs
CHANGED
|
@@ -9,8 +9,8 @@ import { Subject, BehaviorSubject, fromEvent, isObservable, of, ReplaySubject, c
|
|
|
9
9
|
import { trigger, transition, style, animate, keyframes, state } from '@angular/animations';
|
|
10
10
|
import * as i1 from '@angular/forms';
|
|
11
11
|
import { FormControl, FormGroup, FormsModule, SelectMultipleControlValueAccessor } from '@angular/forms';
|
|
12
|
-
import { KeyNavigationCode, initializeKeyListItems, validKeyNavigationCode, setActiveKeyListItem, getFlattenedFocusableItems, focusElement, FocusTrapTrackerService, createId, isFocusable, isHTMLElement } from '@cds/core/internal';
|
|
13
12
|
import * as i1$1 from '@angular/router';
|
|
13
|
+
import { FocusTrapTrackerService, createId, isFocusable, isHTMLElement } from '@cds/core/internal';
|
|
14
14
|
import '@cds/core/internal-components/close-button/register.js';
|
|
15
15
|
import '@cds/core/icon/register';
|
|
16
16
|
|
|
@@ -16937,224 +16937,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImpor
|
|
|
16937
16937
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
16938
16938
|
*/
|
|
16939
16939
|
|
|
16940
|
-
/*
|
|
16941
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
16942
|
-
* This software is released under MIT license.
|
|
16943
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
16944
|
-
*/
|
|
16945
|
-
const FOCUSABLE_ELEMENT_SELECTORS = new InjectionToken('FocusableElements');
|
|
16946
|
-
const FOCUSABLE_ELEMENT_SELECTORS_PROVIDER = {
|
|
16947
|
-
provide: FOCUSABLE_ELEMENT_SELECTORS,
|
|
16948
|
-
useValue: [
|
|
16949
|
-
'a[href]',
|
|
16950
|
-
'area[href]',
|
|
16951
|
-
'input:not([disabled])',
|
|
16952
|
-
'button:not([disabled])',
|
|
16953
|
-
'select:not([disabled])',
|
|
16954
|
-
'textarea:not([disabled])',
|
|
16955
|
-
'iframe',
|
|
16956
|
-
'object',
|
|
16957
|
-
'embed',
|
|
16958
|
-
'*[tabindex]',
|
|
16959
|
-
'*[contenteditable=true]',
|
|
16960
|
-
'[role=button]:not([disabled])',
|
|
16961
|
-
],
|
|
16962
|
-
};
|
|
16963
|
-
|
|
16964
|
-
/*
|
|
16965
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
16966
|
-
* This software is released under MIT license.
|
|
16967
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
16968
|
-
*/
|
|
16969
|
-
const CLR_LIST_KEY_NAVIGATION_CONFIG = new InjectionToken('ClrListKeyNavigationConfig');
|
|
16970
|
-
const CLR_LIST_KEY_NAVIGATION_COFNIG_PROVIDER = {
|
|
16971
|
-
provide: CLR_LIST_KEY_NAVIGATION_CONFIG,
|
|
16972
|
-
useValue: {
|
|
16973
|
-
keyListItems: 'keyListItems',
|
|
16974
|
-
layout: 'vertical',
|
|
16975
|
-
manageFocus: true,
|
|
16976
|
-
manageTabindex: true,
|
|
16977
|
-
loop: false,
|
|
16978
|
-
dir: null,
|
|
16979
|
-
},
|
|
16980
|
-
};
|
|
16981
|
-
|
|
16982
|
-
/*
|
|
16983
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
16984
|
-
* This software is released under MIT license.
|
|
16985
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
16986
|
-
*/
|
|
16987
|
-
function getNextKeyListItem(item, items, config) {
|
|
16988
|
-
const { code, layout, loop, dir } = config;
|
|
16989
|
-
let i = items.indexOf(item);
|
|
16990
|
-
const previous = i;
|
|
16991
|
-
const inlineStart = dir === 'rtl' ? KeyNavigationCode.ArrowRight : KeyNavigationCode.ArrowLeft;
|
|
16992
|
-
const inlineEnd = dir === 'rtl' ? KeyNavigationCode.ArrowLeft : KeyNavigationCode.ArrowRight;
|
|
16993
|
-
const numOfItems = items.length - 1;
|
|
16994
|
-
if (layout !== 'horizontal' && code === KeyNavigationCode.ArrowUp && i !== 0) {
|
|
16995
|
-
i = i - 1;
|
|
16996
|
-
}
|
|
16997
|
-
else if (layout !== 'horizontal' && code === KeyNavigationCode.ArrowUp && i === 0 && loop) {
|
|
16998
|
-
i = numOfItems;
|
|
16999
|
-
}
|
|
17000
|
-
else if (layout !== 'horizontal' && code === KeyNavigationCode.ArrowDown && i < numOfItems) {
|
|
17001
|
-
i = i + 1;
|
|
17002
|
-
}
|
|
17003
|
-
else if (layout !== 'horizontal' && code === KeyNavigationCode.ArrowDown && i === numOfItems && loop) {
|
|
17004
|
-
i = 0;
|
|
17005
|
-
}
|
|
17006
|
-
else if (layout !== 'vertical' && code === inlineStart && i !== 0) {
|
|
17007
|
-
i = i - 1;
|
|
17008
|
-
}
|
|
17009
|
-
else if (layout !== 'vertical' && code === inlineEnd && i < numOfItems) {
|
|
17010
|
-
i = i + 1;
|
|
17011
|
-
}
|
|
17012
|
-
else if (code === KeyNavigationCode.End) {
|
|
17013
|
-
i = numOfItems;
|
|
17014
|
-
}
|
|
17015
|
-
else if (code === KeyNavigationCode.Home) {
|
|
17016
|
-
i = 0;
|
|
17017
|
-
}
|
|
17018
|
-
else if (code === KeyNavigationCode.PageUp) {
|
|
17019
|
-
i = i - 4 > 0 ? i - 4 : 0;
|
|
17020
|
-
}
|
|
17021
|
-
else if (code === KeyNavigationCode.PageDown) {
|
|
17022
|
-
i = i + 4 < numOfItems ? i + 4 : numOfItems;
|
|
17023
|
-
}
|
|
17024
|
-
return { next: i, previous };
|
|
17025
|
-
}
|
|
17026
|
-
|
|
17027
|
-
/*
|
|
17028
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
17029
|
-
* This software is released under MIT license.
|
|
17030
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
17031
|
-
*/
|
|
17032
|
-
class ClrKeyNavigationList {
|
|
17033
|
-
constructor(host, defaultConfig, focusableElementSelectors) {
|
|
17034
|
-
this.host = host;
|
|
17035
|
-
this.defaultConfig = defaultConfig;
|
|
17036
|
-
this.focusableElementSelectors = focusableElementSelectors;
|
|
17037
|
-
this.config = Object.assign(Object.assign({}, this.defaultConfig), { dir: this.getClosestDirAttribute() });
|
|
17038
|
-
}
|
|
17039
|
-
set configuration(config) {
|
|
17040
|
-
this.config = Object.assign(Object.assign(Object.assign({}, this.defaultConfig), { dir: this.getClosestDirAttribute() }), config);
|
|
17041
|
-
}
|
|
17042
|
-
ngAfterViewInit() {
|
|
17043
|
-
this.initializeTabIndex();
|
|
17044
|
-
}
|
|
17045
|
-
onClick(e) {
|
|
17046
|
-
this.clickItem(e);
|
|
17047
|
-
}
|
|
17048
|
-
onKeyDown(e) {
|
|
17049
|
-
this.focusItem(e);
|
|
17050
|
-
}
|
|
17051
|
-
initializeTabIndex() {
|
|
17052
|
-
if (this.config.manageFocus && this.config.manageTabindex) {
|
|
17053
|
-
initializeKeyListItems(this.getListItems());
|
|
17054
|
-
}
|
|
17055
|
-
}
|
|
17056
|
-
clickItem(e) {
|
|
17057
|
-
const activeItem = this.getActiveItem(e);
|
|
17058
|
-
if (activeItem) {
|
|
17059
|
-
this.setActiveItem(e, activeItem);
|
|
17060
|
-
}
|
|
17061
|
-
}
|
|
17062
|
-
focusItem(e) {
|
|
17063
|
-
if (validKeyNavigationCode(e)) {
|
|
17064
|
-
const activeItem = this.getActiveItem(e);
|
|
17065
|
-
if (activeItem) {
|
|
17066
|
-
const listItems = this.getListItems();
|
|
17067
|
-
const { next, previous } = getNextKeyListItem(activeItem, Array.from(listItems), Object.assign(Object.assign({}, this.config), { dir: this.getClosestDirAttribute(), code: e.code }));
|
|
17068
|
-
if (next !== previous) {
|
|
17069
|
-
this.setActiveItem(e, listItems[next], listItems[previous]);
|
|
17070
|
-
}
|
|
17071
|
-
}
|
|
17072
|
-
}
|
|
17073
|
-
}
|
|
17074
|
-
getActiveItem(e) {
|
|
17075
|
-
const listItems = this.getListItems();
|
|
17076
|
-
return Array.from(listItems).find(c => { var _a; return (_a = c === e.target.closest(listItems[0].tagName.toLocaleLowerCase())) !== null && _a !== void 0 ? _a : c === e.target; });
|
|
17077
|
-
}
|
|
17078
|
-
setActiveItem(e, activeItem, previousItem) {
|
|
17079
|
-
var _a;
|
|
17080
|
-
if (this.config.manageFocus) {
|
|
17081
|
-
if (this.config.manageTabindex) {
|
|
17082
|
-
setActiveKeyListItem(this.getListItems(), activeItem);
|
|
17083
|
-
}
|
|
17084
|
-
const items = getFlattenedFocusableItems(activeItem);
|
|
17085
|
-
const item = (_a = items[0]) !== null && _a !== void 0 ? _a : activeItem;
|
|
17086
|
-
focusElement(item);
|
|
17087
|
-
e.preventDefault();
|
|
17088
|
-
}
|
|
17089
|
-
activeItem.dispatchEvent(new CustomEvent('cdsKeyChange', {
|
|
17090
|
-
bubbles: true,
|
|
17091
|
-
detail: {
|
|
17092
|
-
activeItem,
|
|
17093
|
-
previousItem,
|
|
17094
|
-
code: e.code,
|
|
17095
|
-
metaKey: e.ctrlKey || e.metaKey,
|
|
17096
|
-
keyListItems: this.config.keyListItems,
|
|
17097
|
-
},
|
|
17098
|
-
}));
|
|
17099
|
-
}
|
|
17100
|
-
getListItems() {
|
|
17101
|
-
return this.host.nativeElement.querySelectorAll(this.focusableElementSelectors.join(','));
|
|
17102
|
-
}
|
|
17103
|
-
getClosestDirAttribute() {
|
|
17104
|
-
const el = this.host.nativeElement.closest('[dir]');
|
|
17105
|
-
return el ? el.getAttribute('dir') : null;
|
|
17106
|
-
}
|
|
17107
|
-
}
|
|
17108
|
-
ClrKeyNavigationList.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: ClrKeyNavigationList, deps: [{ token: i0.ElementRef }, { token: CLR_LIST_KEY_NAVIGATION_CONFIG }, { token: FOCUSABLE_ELEMENT_SELECTORS }], target: i0.ɵɵFactoryTarget.Directive });
|
|
17109
|
-
ClrKeyNavigationList.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.3", type: ClrKeyNavigationList, selector: "[clrKeyNavigationList]", inputs: { configuration: "configuration" }, host: { listeners: { "click": "onClick($event)", "keydown": "onKeyDown($event)" } }, ngImport: i0 });
|
|
17110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: ClrKeyNavigationList, decorators: [{
|
|
17111
|
-
type: Directive,
|
|
17112
|
-
args: [{
|
|
17113
|
-
selector: '[clrKeyNavigationList]',
|
|
17114
|
-
}]
|
|
17115
|
-
}], ctorParameters: function () {
|
|
17116
|
-
return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
17117
|
-
type: Inject,
|
|
17118
|
-
args: [CLR_LIST_KEY_NAVIGATION_CONFIG]
|
|
17119
|
-
}] }, { type: undefined, decorators: [{
|
|
17120
|
-
type: Inject,
|
|
17121
|
-
args: [FOCUSABLE_ELEMENT_SELECTORS]
|
|
17122
|
-
}] }];
|
|
17123
|
-
}, propDecorators: { configuration: [{
|
|
17124
|
-
type: Input
|
|
17125
|
-
}], onClick: [{
|
|
17126
|
-
type: HostListener,
|
|
17127
|
-
args: ['click', ['$event']]
|
|
17128
|
-
}], onKeyDown: [{
|
|
17129
|
-
type: HostListener,
|
|
17130
|
-
args: ['keydown', ['$event']]
|
|
17131
|
-
}] } });
|
|
17132
|
-
|
|
17133
|
-
/*
|
|
17134
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
17135
|
-
* This software is released under MIT license.
|
|
17136
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
17137
|
-
*/
|
|
17138
|
-
class ClrKeyNavigationListModule {
|
|
17139
|
-
}
|
|
17140
|
-
ClrKeyNavigationListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: ClrKeyNavigationListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
17141
|
-
ClrKeyNavigationListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: ClrKeyNavigationListModule, declarations: [ClrKeyNavigationList], exports: [ClrKeyNavigationList] });
|
|
17142
|
-
ClrKeyNavigationListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: ClrKeyNavigationListModule, providers: [CLR_LIST_KEY_NAVIGATION_COFNIG_PROVIDER, FOCUSABLE_ELEMENT_SELECTORS_PROVIDER] });
|
|
17143
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: ClrKeyNavigationListModule, decorators: [{
|
|
17144
|
-
type: NgModule,
|
|
17145
|
-
args: [{
|
|
17146
|
-
declarations: [ClrKeyNavigationList],
|
|
17147
|
-
exports: [ClrKeyNavigationList],
|
|
17148
|
-
providers: [CLR_LIST_KEY_NAVIGATION_COFNIG_PROVIDER, FOCUSABLE_ELEMENT_SELECTORS_PROVIDER],
|
|
17149
|
-
}]
|
|
17150
|
-
}] });
|
|
17151
|
-
|
|
17152
|
-
/*
|
|
17153
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
17154
|
-
* This software is released under MIT license.
|
|
17155
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
17156
|
-
*/
|
|
17157
|
-
|
|
17158
16940
|
/*
|
|
17159
16941
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
17160
16942
|
* This software is released under MIT license.
|
|
@@ -28060,5 +27842,5 @@ const CLR_MENU_POSITIONS = [
|
|
|
28060
27842
|
* Generated bundle index. Do not edit.
|
|
28061
27843
|
*/
|
|
28062
27844
|
|
|
28063
|
-
export { CLR_ALERT_DIRECTIVES, CLR_BUTTON_GROUP_DIRECTIVES, CLR_DATAGRID_DIRECTIVES, CLR_DATEPICKER_DIRECTIVES, CLR_DRAG_AND_DROP_DIRECTIVES, CLR_DROPDOWN_DIRECTIVES, CLR_ICON_DIRECTIVES, CLR_LAYOUT_DIRECTIVES,
|
|
27845
|
+
export { CLR_ALERT_DIRECTIVES, CLR_BUTTON_GROUP_DIRECTIVES, CLR_DATAGRID_DIRECTIVES, CLR_DATEPICKER_DIRECTIVES, CLR_DRAG_AND_DROP_DIRECTIVES, CLR_DROPDOWN_DIRECTIVES, CLR_ICON_DIRECTIVES, CLR_LAYOUT_DIRECTIVES, CLR_LOADING_BUTTON_DIRECTIVES, CLR_LOADING_DIRECTIVES, CLR_MENU_POSITIONS, CLR_MODAL_DIRECTIVES, CLR_NAVIGATION_DIRECTIVES, CLR_PROGRESS_BAR_DIRECTIVES, CLR_SIGNPOST_DIRECTIVES, CLR_SPINNER_DIRECTIVES, CLR_STACK_VIEW_DIRECTIVES, CLR_TABS_DIRECTIVES, CLR_TOOLTIP_DIRECTIVES, CLR_TREE_VIEW_DIRECTIVES, CLR_VERTICAL_NAV_DIRECTIVES, CLR_WIZARD_DIRECTIVES, CONDITIONAL_DIRECTIVES, CUSTOM_BUTTON_TYPES, CdsIconCustomTag, ClarityModule, ClrAbstractContainer, ClrAccordion, ClrAccordionContent, ClrAccordionDescription, ClrAccordionModule, ClrAccordionPanel, ClrAccordionTitle, ClrAlert, ClrAlertItem, ClrAlertModule, ClrAlertText, ClrAlerts, ClrAlertsPager, ClrAlignment, ClrAriaCurrentLink, ClrAriaLivePoliteness, ClrAriaLiveService, ClrAxis, ClrButton, ClrButtonGroup, ClrButtonGroupModule, ClrButtonModule, ClrCalendar, ClrCheckbox, ClrCheckboxContainer, ClrCheckboxModule, ClrCheckboxWrapper, ClrCombobox, ClrComboboxContainer, ClrComboboxModule, ClrCommonFormsModule, ClrCommonStringsService, ClrConditionalModule, ClrControl, ClrControlContainer, ClrControlError, ClrControlHelper, ClrControlSuccess, ClrDataModule, ClrDatagrid, ClrDatagridActionBar, ClrDatagridActionOverflow, ClrDatagridCell, ClrDatagridColumn, ClrDatagridColumnSeparator, ClrDatagridColumnToggle, ClrDatagridColumnToggleButton, ClrDatagridColumnToggleTitle, ClrDatagridDetail, ClrDatagridDetailBody, ClrDatagridDetailHeader, ClrDatagridFilter, ClrDatagridFooter, ClrDatagridHideableColumn, ClrDatagridItems, ClrDatagridItemsTrackBy, ClrDatagridModule, ClrDatagridPageSize, ClrDatagridPagination, ClrDatagridPlaceholder, ClrDatagridRow, ClrDatagridRowDetail, ClrDatagridSortOrder, ClrDatalist, ClrDatalistContainer, ClrDatalistInput, ClrDatalistModule, ClrDateContainer, ClrDateInput, ClrDatepickerModule, ClrDatepickerViewManager, ClrDay, ClrDaypicker, ClrDestroyService, ClrDragAndDropModule, ClrDragEvent, ClrDragHandle, ClrDraggable, ClrDraggableGhost, ClrDropdown, ClrDropdownItem, ClrDropdownMenu, ClrDropdownModule, ClrDropdownTrigger, ClrDroppable, ClrEmphasisModule, ClrExpandableAnimation, ClrFocusOnViewInit, ClrFocusOnViewInitModule, ClrForTypeAhead, ClrForTypeAheadModule, ClrForm, ClrFormLayout, ClrFormsModule, ClrHeader, ClrIconCustomTag, ClrIconModule, ClrIfActive, ClrIfDetail, ClrIfDragged, ClrIfError, ClrIfExpanded, ClrIfOpen, ClrIfSuccess, ClrInput, ClrInputContainer, ClrInputModule, ClrLabel, ClrLayout, ClrLayoutModule, ClrLoading, ClrLoadingButton, ClrLoadingButtonModule, ClrLoadingModule, ClrLoadingState, ClrMainContainer, ClrMainContainerModule, ClrModal, ClrModalBody, ClrModalModule, ClrMonthpicker, ClrNavLevel, ClrNavigationModule, ClrOption, ClrOptionItems, ClrOptionSelected, ClrOptions, ClrPassword, ClrPasswordContainer, ClrPasswordModule, ClrPopoverAnchor, ClrPopoverContent, ClrPopoverEventsService, ClrPopoverModule, ClrPopoverPositionService, ClrPopoverToggleService, ClrProgressBar, ClrProgressBarModule, ClrRadio, ClrRadioContainer, ClrRadioModule, ClrRadioWrapper, ClrRange, ClrRangeContainer, ClrRangeModule, ClrRecursiveForOf, ClrSelect, ClrSelectContainer, ClrSelectModule, ClrSelectedState, ClrSide, ClrSignpost, ClrSignpostContent, ClrSignpostModule, ClrSignpostTrigger, ClrSpinner, ClrSpinnerModule, ClrStackBlock, ClrStackContentInput, ClrStackHeader, ClrStackInput, ClrStackSelect, ClrStackView, ClrStackViewCustomTags, ClrStackViewLabel, ClrStackViewModule, ClrStepButton, ClrStepButtonType, ClrStepper, ClrStepperModule, ClrStepperPanel, ClrTab, ClrTabContent, ClrTabLink, ClrTabOverflowContent, ClrTabs, ClrTabsModule, ClrTextarea, ClrTextareaContainer, ClrTextareaModule, ClrTimeline, ClrTimelineLayout, ClrTimelineModule, ClrTimelineStep, ClrTimelineStepDescription, ClrTimelineStepHeader, ClrTimelineStepState, ClrTimelineStepTitle, ClrTooltip, ClrTooltipContent, ClrTooltipModule, ClrTooltipTrigger, ClrTree, ClrTreeNode, ClrTreeNodeLink, ClrTreeViewModule, ClrVerticalNav, ClrVerticalNavGroup, ClrVerticalNavGroupChildren, ClrVerticalNavIcon, ClrVerticalNavLink, ClrVerticalNavModule, ClrWizard, ClrWizardButton, ClrWizardCustomTags, ClrWizardHeaderAction, ClrWizardModule, ClrWizardPage, ClrWizardPageButtons, ClrWizardPageHeaderActions, ClrWizardPageNavTitle, ClrWizardPageTitle, ClrWizardStepnav, ClrWizardStepnavItem, ClrYearpicker, DEFAULT_BUTTON_TYPES, DatagridNumericFilter, DatagridPropertyComparator, DatagridPropertyNumericFilter, DatagridPropertyStringFilter, DatagridStringFilter, EXPANDABLE_ANIMATION_DIRECTIVES, FOCUS_ON_VIEW_INIT, FOCUS_ON_VIEW_INIT_DIRECTIVES, IS_TOGGLE, IS_TOGGLE_PROVIDER, LoadingListener, MainContainerWillyWonka, NavDetectionOompaLoompa, TOGGLE_SERVICE, TOGGLE_SERVICE_PROVIDER, ToggleServiceFactory, WrappedFormControl, collapse, commonStringsDefault, fade, fadeSlide, isToggleFactory, slide, AccordionOompaLoompa as ÇlrAccordionOompaLoompa, AccordionWillyWonka as ÇlrAccordionWillyWonka, ActionableOompaLoompa as ÇlrActionableOompaLoompa, ActiveOompaLoompa as ÇlrActiveOompaLoompa, ClrFocusTrapModule as ÇlrClrFocusTrapModule, ClrPopoverCloseButton as ÇlrClrPopoverCloseButton, ClrPopoverModuleNext as ÇlrClrPopoverModuleNext, ClrPopoverOpenCloseButton as ÇlrClrPopoverOpenCloseButton, DatagridCellRenderer as ÇlrDatagridCellRenderer, DatagridDetailRegisterer as ÇlrDatagridDetailRegisterer, DatagridHeaderRenderer as ÇlrDatagridHeaderRenderer, DatagridMainRenderer as ÇlrDatagridMainRenderer, DatagridRowRenderer as ÇlrDatagridRowRenderer, DatagridWillyWonka as ÇlrDatagridWillyWonka, ExpandableOompaLoompa as ÇlrExpandableOompaLoompa, FocusTrapDirective as ÇlrFocusTrapDirective, FocusTrapTracker as ÇlrFocusTrapTracker, StepperOompaLoompa as ÇlrStepperOompaLoompa, StepperWillyWonka as ÇlrStepperWillyWonka, TabsWillyWonka as ÇlrTabsWillyWonka, WrappedCell as ÇlrWrappedCell, WrappedColumn as ÇlrWrappedColumn, WrappedRow as ÇlrWrappedRow };
|
|
28064
27846
|
//# sourceMappingURL=clr-angular.mjs.map
|