@clr/angular 15.0.3 → 15.1.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/button/button-group/button-group.d.ts +2 -1
- package/clarity.api.md +11 -14
- package/data/datagrid/datagrid-column.d.ts +1 -6
- package/esm2020/button/button-group/button-group.mjs +8 -3
- package/esm2020/data/datagrid/built-in/filters/datagrid-numeric-filter.mjs +5 -1
- package/esm2020/data/datagrid/built-in/filters/datagrid-string-filter.mjs +3 -1
- package/esm2020/data/datagrid/datagrid-column.mjs +18 -29
- package/esm2020/data/tree-view/tree-node.mjs +3 -3
- package/esm2020/popover/dropdown/dropdown-item.mjs +17 -1
- package/esm2020/popover/dropdown/dropdown.mjs +9 -7
- package/esm2020/popover/dropdown/providers/dropdown-focus-handler.service.mjs +5 -5
- package/fesm2015/clr-angular.mjs +48 -30
- package/fesm2015/clr-angular.mjs.map +1 -1
- package/fesm2020/clr-angular.mjs +48 -30
- package/fesm2020/clr-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/popover/dropdown/dropdown-item.d.ts +1 -0
- package/popover/dropdown/dropdown.d.ts +4 -2
- package/popover/dropdown/providers/dropdown-focus-handler.service.d.ts +1 -1
package/fesm2020/clr-angular.mjs
CHANGED
|
@@ -2679,6 +2679,8 @@ class ClrButtonGroup {
|
|
|
2679
2679
|
this.toggleService = toggleService;
|
|
2680
2680
|
this.commonStrings = commonStrings;
|
|
2681
2681
|
this.destroy$ = destroy$;
|
|
2682
|
+
// Aria
|
|
2683
|
+
this.clrToggleButtonAriaLabel = this.commonStrings.keys.rowActions;
|
|
2682
2684
|
this.popoverId = uniqueIdFactory();
|
|
2683
2685
|
this.popoverPosition = ClrPopoverPositions['bottom-left'];
|
|
2684
2686
|
this.inlineButtons = [];
|
|
@@ -2765,13 +2767,16 @@ class ClrButtonGroup {
|
|
|
2765
2767
|
}
|
|
2766
2768
|
}
|
|
2767
2769
|
ClrButtonGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrButtonGroup, deps: [{ token: ButtonInGroupService }, { token: ClrPopoverToggleService }, { token: ClrCommonStringsService }, { token: ClrDestroyService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2768
|
-
ClrButtonGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrButtonGroup, selector: "clr-button-group", inputs: { menuPosition: ["clrMenuPosition", "menuPosition"] }, host: { properties: { "class.btn-group": "true" } }, providers: [ButtonInGroupService, ClrDestroyService], queries: [{ propertyName: "buttons", predicate: ClrButton }], hostDirectives: [{ directive: PopoverHostDirective }], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<ng-container *ngFor=\"let inlineButton of inlineButtons\">\n <ng-template [ngTemplateOutlet]=\"inlineButton.templateRef\"></ng-template>\n</ng-container>\n<ng-container *ngIf=\"menuButtons.length > 0\">\n <div class=\"btn-group-overflow open\" [ngClass]=\"menuPosition\" #anchor>\n <button\n class=\"btn dropdown-toggle\"\n clrPopoverAnchor\n clrPopoverOpenCloseButton\n [attr.aria-controls]=\"popoverId\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-label]=\"
|
|
2770
|
+
ClrButtonGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrButtonGroup, selector: "clr-button-group", inputs: { clrToggleButtonAriaLabel: "clrToggleButtonAriaLabel", menuPosition: ["clrMenuPosition", "menuPosition"] }, host: { properties: { "class.btn-group": "true" } }, providers: [ButtonInGroupService, ClrDestroyService], queries: [{ propertyName: "buttons", predicate: ClrButton }], hostDirectives: [{ directive: PopoverHostDirective }], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<ng-container *ngFor=\"let inlineButton of inlineButtons\">\n <ng-template [ngTemplateOutlet]=\"inlineButton.templateRef\"></ng-template>\n</ng-container>\n<ng-container *ngIf=\"menuButtons.length > 0\">\n <div class=\"btn-group-overflow open\" [ngClass]=\"menuPosition\" #anchor>\n <button\n class=\"btn dropdown-toggle\"\n clrPopoverAnchor\n clrPopoverOpenCloseButton\n [attr.aria-controls]=\"popoverId\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-label]=\"clrToggleButtonAriaLabel\"\n >\n <cds-icon shape=\"ellipsis-horizontal\" [attr.title]=\"commonStrings.keys.more\"></cds-icon>\n </button>\n <div\n role=\"menu\"\n class=\"dropdown-menu clr-button-group-menu\"\n [id]=\"popoverId\"\n [attr.id]=\"popoverId\"\n [attr.aria-hidden]=\"!open\"\n *clrPopoverContent=\"open at popoverPosition; outsideClickToClose: true; scrollToClose: true\"\n >\n <ng-template [ngTemplateOutlet]=\"ref\"></ng-template>\n </div>\n </div>\n</ng-container>\n<ng-template #ref>\n <ng-container *ngFor=\"let menuButton of menuButtons\">\n <ng-template [ngTemplateOutlet]=\"menuButton.templateRef\"></ng-template>\n </ng-container>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CdsIconCustomTag, selector: "cds-icon" }, { kind: "directive", type: ClrPopoverAnchor, selector: "[clrPopoverAnchor]" }, { kind: "directive", type: ClrPopoverOpenCloseButton, selector: "[clrPopoverOpenCloseButton]", outputs: ["clrPopoverOpenCloseChange"] }, { kind: "directive", type: ClrPopoverContent, selector: "[clrPopoverContent]", inputs: ["clrPopoverContent", "clrPopoverContentAt", "clrPopoverContentOutsideClickToClose", "clrPopoverContentScrollToClose"] }] });
|
|
2769
2771
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrButtonGroup, decorators: [{
|
|
2770
2772
|
type: Component,
|
|
2771
|
-
args: [{ selector: 'clr-button-group', providers: [ButtonInGroupService, ClrDestroyService], hostDirectives: [PopoverHostDirective], host: { '[class.btn-group]': 'true' }, template: "<!--\n ~ Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<ng-container *ngFor=\"let inlineButton of inlineButtons\">\n <ng-template [ngTemplateOutlet]=\"inlineButton.templateRef\"></ng-template>\n</ng-container>\n<ng-container *ngIf=\"menuButtons.length > 0\">\n <div class=\"btn-group-overflow open\" [ngClass]=\"menuPosition\" #anchor>\n <button\n class=\"btn dropdown-toggle\"\n clrPopoverAnchor\n clrPopoverOpenCloseButton\n [attr.aria-controls]=\"popoverId\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-label]=\"
|
|
2773
|
+
args: [{ selector: 'clr-button-group', providers: [ButtonInGroupService, ClrDestroyService], hostDirectives: [PopoverHostDirective], host: { '[class.btn-group]': 'true' }, template: "<!--\n ~ Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<ng-container *ngFor=\"let inlineButton of inlineButtons\">\n <ng-template [ngTemplateOutlet]=\"inlineButton.templateRef\"></ng-template>\n</ng-container>\n<ng-container *ngIf=\"menuButtons.length > 0\">\n <div class=\"btn-group-overflow open\" [ngClass]=\"menuPosition\" #anchor>\n <button\n class=\"btn dropdown-toggle\"\n clrPopoverAnchor\n clrPopoverOpenCloseButton\n [attr.aria-controls]=\"popoverId\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-label]=\"clrToggleButtonAriaLabel\"\n >\n <cds-icon shape=\"ellipsis-horizontal\" [attr.title]=\"commonStrings.keys.more\"></cds-icon>\n </button>\n <div\n role=\"menu\"\n class=\"dropdown-menu clr-button-group-menu\"\n [id]=\"popoverId\"\n [attr.id]=\"popoverId\"\n [attr.aria-hidden]=\"!open\"\n *clrPopoverContent=\"open at popoverPosition; outsideClickToClose: true; scrollToClose: true\"\n >\n <ng-template [ngTemplateOutlet]=\"ref\"></ng-template>\n </div>\n </div>\n</ng-container>\n<ng-template #ref>\n <ng-container *ngFor=\"let menuButton of menuButtons\">\n <ng-template [ngTemplateOutlet]=\"menuButton.templateRef\"></ng-template>\n </ng-container>\n</ng-template>\n" }]
|
|
2772
2774
|
}], ctorParameters: function () { return [{ type: ButtonInGroupService }, { type: ClrPopoverToggleService }, { type: ClrCommonStringsService }, { type: ClrDestroyService }]; }, propDecorators: { buttons: [{
|
|
2773
2775
|
type: ContentChildren,
|
|
2774
2776
|
args: [ClrButton]
|
|
2777
|
+
}], clrToggleButtonAriaLabel: [{
|
|
2778
|
+
type: Input,
|
|
2779
|
+
args: ['clrToggleButtonAriaLabel']
|
|
2775
2780
|
}], menuPosition: [{
|
|
2776
2781
|
type: Input,
|
|
2777
2782
|
args: ['clrMenuPosition']
|
|
@@ -11269,6 +11274,7 @@ DatagridNumericFilter.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0",
|
|
|
11269
11274
|
class="datagrid-numeric-filter-input"
|
|
11270
11275
|
#input_low
|
|
11271
11276
|
type="number"
|
|
11277
|
+
autocomplete="off"
|
|
11272
11278
|
name="low"
|
|
11273
11279
|
[(ngModel)]="low"
|
|
11274
11280
|
[placeholder]="minPlaceholderValue"
|
|
@@ -11279,6 +11285,7 @@ DatagridNumericFilter.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0",
|
|
|
11279
11285
|
class="datagrid-numeric-filter-input"
|
|
11280
11286
|
#input_high
|
|
11281
11287
|
type="number"
|
|
11288
|
+
autocomplete="off"
|
|
11282
11289
|
name="high"
|
|
11283
11290
|
[(ngModel)]="high"
|
|
11284
11291
|
[placeholder]="maxPlaceholderValue"
|
|
@@ -11297,6 +11304,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
11297
11304
|
class="datagrid-numeric-filter-input"
|
|
11298
11305
|
#input_low
|
|
11299
11306
|
type="number"
|
|
11307
|
+
autocomplete="off"
|
|
11300
11308
|
name="low"
|
|
11301
11309
|
[(ngModel)]="low"
|
|
11302
11310
|
[placeholder]="minPlaceholderValue"
|
|
@@ -11307,6 +11315,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
11307
11315
|
class="datagrid-numeric-filter-input"
|
|
11308
11316
|
#input_high
|
|
11309
11317
|
type="number"
|
|
11318
|
+
autocomplete="off"
|
|
11310
11319
|
name="high"
|
|
11311
11320
|
[(ngModel)]="high"
|
|
11312
11321
|
[placeholder]="maxPlaceholderValue"
|
|
@@ -11529,6 +11538,7 @@ DatagridStringFilter.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", v
|
|
|
11529
11538
|
<input
|
|
11530
11539
|
#input
|
|
11531
11540
|
type="text"
|
|
11541
|
+
autocomplete="off"
|
|
11532
11542
|
name="search"
|
|
11533
11543
|
[(ngModel)]="value"
|
|
11534
11544
|
class="clr-input"
|
|
@@ -11547,6 +11557,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
11547
11557
|
<input
|
|
11548
11558
|
#input
|
|
11549
11559
|
type="text"
|
|
11560
|
+
autocomplete="off"
|
|
11550
11561
|
name="search"
|
|
11551
11562
|
[(ngModel)]="value"
|
|
11552
11563
|
class="clr-input"
|
|
@@ -12300,13 +12311,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12300
12311
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
12301
12312
|
*/
|
|
12302
12313
|
class ClrDatagridColumn extends DatagridFilterRegistrar {
|
|
12303
|
-
constructor(_sort, filters, vcr, detailService, changeDetectorRef
|
|
12314
|
+
constructor(_sort, filters, vcr, detailService, changeDetectorRef) {
|
|
12304
12315
|
super(filters);
|
|
12305
12316
|
this._sort = _sort;
|
|
12306
12317
|
this.vcr = vcr;
|
|
12307
12318
|
this.detailService = detailService;
|
|
12308
12319
|
this.changeDetectorRef = changeDetectorRef;
|
|
12309
|
-
this.commonStrings = commonStrings;
|
|
12310
12320
|
this.showSeparator = true;
|
|
12311
12321
|
/**
|
|
12312
12322
|
* Subscription to the sort service changes
|
|
@@ -12490,15 +12500,6 @@ class ClrDatagridColumn extends DatagridFilterRegistrar {
|
|
|
12490
12500
|
this.customFilter = true;
|
|
12491
12501
|
}
|
|
12492
12502
|
}
|
|
12493
|
-
get filterStringPlaceholderValue() {
|
|
12494
|
-
return this.filterStringPlaceholder || this.commonStrings.keys.filterItems;
|
|
12495
|
-
}
|
|
12496
|
-
get filterNumberMaxPlaceholderValue() {
|
|
12497
|
-
return this.filterNumberMaxPlaceholder || this.commonStrings.keys.maxValue;
|
|
12498
|
-
}
|
|
12499
|
-
get filterNumberMinPlaceholderValue() {
|
|
12500
|
-
return this.filterNumberMinPlaceholder || this.commonStrings.keys.minValue;
|
|
12501
|
-
}
|
|
12502
12503
|
set updateFilterValue(newValue) {
|
|
12503
12504
|
if (this.filter) {
|
|
12504
12505
|
if (this.filter instanceof DatagridStringFilterImpl) {
|
|
@@ -12549,7 +12550,7 @@ class ClrDatagridColumn extends DatagridFilterRegistrar {
|
|
|
12549
12550
|
return this.wrappedInjector.get(WrappedColumn, this.vcr).columnView;
|
|
12550
12551
|
}
|
|
12551
12552
|
}
|
|
12552
|
-
ClrDatagridColumn.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridColumn, deps: [{ token: Sort }, { token: FiltersProvider }, { token: i0.ViewContainerRef }, { token: DetailService }, { token: i0.ChangeDetectorRef }
|
|
12553
|
+
ClrDatagridColumn.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridColumn, deps: [{ token: Sort }, { token: FiltersProvider }, { token: i0.ViewContainerRef }, { token: DetailService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
12553
12554
|
ClrDatagridColumn.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrDatagridColumn, selector: "clr-dg-column", inputs: { colType: ["clrDgColType", "colType"], field: ["clrDgField", "field"], sortBy: ["clrDgSortBy", "sortBy"], sortOrder: ["clrDgSortOrder", "sortOrder"], filterStringPlaceholder: ["clrFilterStringPlaceholder", "filterStringPlaceholder"], filterNumberMaxPlaceholder: ["clrFilterNumberMaxPlaceholder", "filterNumberMaxPlaceholder"], filterNumberMinPlaceholder: ["clrFilterNumberMinPlaceholder", "filterNumberMinPlaceholder"], updateFilterValue: ["clrFilterValue", "updateFilterValue"] }, outputs: { sortOrderChange: "clrDgSortOrderChange", filterValueChange: "clrFilterValueChange" }, host: { attributes: { "role": "columnheader" }, properties: { "class.datagrid-column": "true", "attr.aria-sort": "ariaSort" } }, queries: [{ propertyName: "projectedFilter", first: true, predicate: CustomFilter, descendants: true }], usesInheritance: true, usesOnChanges: true, hostDirectives: [{ directive: PopoverHostDirective }], ngImport: i0, template: `
|
|
12554
12555
|
<div class="datagrid-column-flex">
|
|
12555
12556
|
<button class="datagrid-column-title" *ngIf="sortable" (click)="sort()" type="button">
|
|
@@ -12567,15 +12568,15 @@ ClrDatagridColumn.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
12567
12568
|
|
|
12568
12569
|
<clr-dg-string-filter
|
|
12569
12570
|
*ngIf="field && !customFilter && colType == 'string'"
|
|
12570
|
-
[clrFilterPlaceholder]="
|
|
12571
|
+
[clrFilterPlaceholder]="filterStringPlaceholder"
|
|
12571
12572
|
[clrDgStringFilter]="registered"
|
|
12572
12573
|
[(clrFilterValue)]="filterValue"
|
|
12573
12574
|
></clr-dg-string-filter>
|
|
12574
12575
|
|
|
12575
12576
|
<clr-dg-numeric-filter
|
|
12576
12577
|
*ngIf="field && !customFilter && colType == 'number'"
|
|
12577
|
-
[clrFilterMaxPlaceholder]="
|
|
12578
|
-
[clrFilterMinPlaceholder]="
|
|
12578
|
+
[clrFilterMaxPlaceholder]="filterNumberMaxPlaceholder"
|
|
12579
|
+
[clrFilterMinPlaceholder]="filterNumberMinPlaceholder"
|
|
12579
12580
|
[clrDgNumericFilter]="registered"
|
|
12580
12581
|
[(clrFilterValue)]="filterValue"
|
|
12581
12582
|
></clr-dg-numeric-filter>
|
|
@@ -12612,15 +12613,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12612
12613
|
|
|
12613
12614
|
<clr-dg-string-filter
|
|
12614
12615
|
*ngIf="field && !customFilter && colType == 'string'"
|
|
12615
|
-
[clrFilterPlaceholder]="
|
|
12616
|
+
[clrFilterPlaceholder]="filterStringPlaceholder"
|
|
12616
12617
|
[clrDgStringFilter]="registered"
|
|
12617
12618
|
[(clrFilterValue)]="filterValue"
|
|
12618
12619
|
></clr-dg-string-filter>
|
|
12619
12620
|
|
|
12620
12621
|
<clr-dg-numeric-filter
|
|
12621
12622
|
*ngIf="field && !customFilter && colType == 'number'"
|
|
12622
|
-
[clrFilterMaxPlaceholder]="
|
|
12623
|
-
[clrFilterMinPlaceholder]="
|
|
12623
|
+
[clrFilterMaxPlaceholder]="filterNumberMaxPlaceholder"
|
|
12624
|
+
[clrFilterMinPlaceholder]="filterNumberMinPlaceholder"
|
|
12624
12625
|
[clrDgNumericFilter]="registered"
|
|
12625
12626
|
[(clrFilterValue)]="filterValue"
|
|
12626
12627
|
></clr-dg-numeric-filter>
|
|
@@ -12644,7 +12645,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12644
12645
|
},
|
|
12645
12646
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12646
12647
|
}]
|
|
12647
|
-
}], ctorParameters: function () { return [{ type: Sort }, { type: FiltersProvider }, { type: i0.ViewContainerRef }, { type: DetailService }, { type: i0.ChangeDetectorRef }
|
|
12648
|
+
}], ctorParameters: function () { return [{ type: Sort }, { type: FiltersProvider }, { type: i0.ViewContainerRef }, { type: DetailService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { colType: [{
|
|
12648
12649
|
type: Input,
|
|
12649
12650
|
args: ['clrDgColType']
|
|
12650
12651
|
}], field: [{
|
|
@@ -18279,7 +18280,7 @@ class ClrTreeNode {
|
|
|
18279
18280
|
}
|
|
18280
18281
|
}
|
|
18281
18282
|
ClrTreeNode.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrTreeNode, deps: [{ token: PLATFORM_ID }, { token: ClrTreeNode, optional: true, skipSelf: true }, { token: TreeFeaturesService }, { token: IfExpandService }, { token: ClrCommonStringsService }, { token: TreeFocusManagerService }, { token: i0.ElementRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
18282
|
-
ClrTreeNode.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrTreeNode, selector: "clr-tree-node", inputs: { selected: ["clrSelected", "selected"], expandable: ["clrExpandable", "expandable"], expanded: ["clrExpanded", "expanded"], clrForTypeAhead: "clrForTypeAhead" }, outputs: { selectedChange: "clrSelectedChange", expandedChange: "clrExpandedChange" }, host: { properties: { "class.clr-tree-node": "true" } }, providers: [TREE_FEATURES_PROVIDER, IfExpandService, { provide: LoadingListener, useExisting: IfExpandService }], queries: [{ propertyName: "treeNodeLinkList", predicate: ClrTreeNodeLink }], viewQueries: [{ propertyName: "contentContainer", first: true, predicate: ["contentContainer"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<div\n #contentContainer\n role=\"treeitem\"\n class=\"clr-tree-node-content-container\"\n tabindex=\"-1\"\n [attr.aria-expanded]=\"isExpandable() ? expanded : null\"\n [attr.aria-selected]=\"ariaSelected\"\n (keydown)=\"onKeyDown($event)\"\n (focus)=\"broadcastFocusOnContainer()\"\n>\n <button\n *ngIf=\"isExpandable() && !isModelLoading && !expandService.loading\"\n aria-hidden=\"true\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"clr-treenode-caret\"\n (click)=\"expandService.toggle();\"\n (focus)=\"focusTreeNode()\"\n >\n <cds-icon\n class=\"clr-treenode-caret-icon\"\n shape=\"angle\"\n [attr.direction]=\"expandService.expanded ? 'down' : 'right'\"\n ></cds-icon>\n </button>\n <div class=\"clr-treenode-spinner-container\" *ngIf=\"expandService.loading || isModelLoading\">\n <span class=\"clr-treenode-spinner spinner\"></span>\n </div>\n <div class=\"clr-checkbox-wrapper clr-treenode-checkbox\" *ngIf=\"featuresService.selectable\">\n <input\n aria-hidden=\"true\"\n type=\"checkbox\"\n id=\"{{nodeId}}-check\"\n class=\"clr-checkbox\"\n [checked]=\"_model.selected.value === STATES.SELECTED\"\n [indeterminate]=\"_model.selected.value === STATES.INDETERMINATE\"\n (change)=\"_model.toggleSelection(featuresService.eager)\"\n (focus)=\"focusTreeNode()\"\n tabindex=\"-1\"\n />\n <label for=\"{{nodeId}}-check\">\n <ng-container [ngTemplateOutlet]=\"treenodeContent\"></ng-container>\n </label>\n </div>\n <div class=\"clr-treenode-content\" (mousedown)=\"focusTreeNode()\" *ngIf=\"!featuresService.selectable\">\n <ng-container [ngTemplateOutlet]=\"treenodeContent\"></ng-container>\n </div>\n\n <ng-template #treenodeContent>\n <ng-content></ng-content>\n <div class=\"clr-sr-only\" *ngIf=\"featuresService.selectable || ariaSelected\">\n <span *ngIf=\"ariaSelected\"> selected</span>\n <span *ngIf=\"!ariaSelected\"> unselected</span>\n </div>\n </ng-template>\n</div>\n<div\n class=\"clr-treenode-children\"\n [@toggleChildrenAnim]=\"expandService.expanded ? 'expanded' : 'collapsed'\"\n [attr.role]=\"isExpandable() && !featuresService.recursion ? 'group' : null\"\n>\n <ng-content select=\"clr-tree-node\"></ng-content>\n <ng-content select=\"[clrIfExpanded]\"></ng-content>\n <clr-recursive-children [parent]=\"_model\"></clr-recursive-children>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CdsIconCustomTag, selector: "cds-icon" }, { kind: "component", type: RecursiveChildren, selector: "clr-recursive-children", inputs: ["parent", "children"] }], animations: [
|
|
18283
|
+
ClrTreeNode.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrTreeNode, selector: "clr-tree-node", inputs: { selected: ["clrSelected", "selected"], expandable: ["clrExpandable", "expandable"], expanded: ["clrExpanded", "expanded"], clrForTypeAhead: "clrForTypeAhead" }, outputs: { selectedChange: "clrSelectedChange", expandedChange: "clrExpandedChange" }, host: { properties: { "class.clr-tree-node": "true" } }, providers: [TREE_FEATURES_PROVIDER, IfExpandService, { provide: LoadingListener, useExisting: IfExpandService }], queries: [{ propertyName: "treeNodeLinkList", predicate: ClrTreeNodeLink }], viewQueries: [{ propertyName: "contentContainer", first: true, predicate: ["contentContainer"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<div\n #contentContainer\n role=\"treeitem\"\n class=\"clr-tree-node-content-container\"\n tabindex=\"-1\"\n [attr.aria-expanded]=\"isExpandable() ? expanded : null\"\n [attr.aria-selected]=\"ariaSelected\"\n (keydown)=\"onKeyDown($event)\"\n (focus)=\"broadcastFocusOnContainer()\"\n>\n <button\n *ngIf=\"isExpandable() && !isModelLoading && !expandService.loading\"\n aria-hidden=\"true\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"clr-treenode-caret\"\n (click)=\"expandService.toggle();\"\n (focus)=\"focusTreeNode()\"\n >\n <cds-icon\n class=\"clr-treenode-caret-icon\"\n shape=\"angle\"\n [attr.direction]=\"expandService.expanded ? 'down' : 'right'\"\n ></cds-icon>\n </button>\n <div class=\"clr-treenode-spinner-container\" *ngIf=\"expandService.loading || isModelLoading\">\n <span class=\"clr-treenode-spinner spinner\"></span>\n </div>\n <div class=\"clr-checkbox-wrapper clr-treenode-checkbox\" *ngIf=\"featuresService.selectable\">\n <input\n aria-hidden=\"true\"\n type=\"checkbox\"\n id=\"{{nodeId}}-check\"\n class=\"clr-checkbox\"\n [checked]=\"_model.selected.value === STATES.SELECTED\"\n [indeterminate]=\"_model.selected.value === STATES.INDETERMINATE\"\n (change)=\"_model.toggleSelection(featuresService.eager)\"\n (focus)=\"focusTreeNode()\"\n tabindex=\"-1\"\n />\n <label for=\"{{nodeId}}-check\" class=\"clr-control-label\">\n <ng-container [ngTemplateOutlet]=\"treenodeContent\"></ng-container>\n </label>\n </div>\n <div class=\"clr-treenode-content\" (mousedown)=\"focusTreeNode()\" *ngIf=\"!featuresService.selectable\">\n <ng-container [ngTemplateOutlet]=\"treenodeContent\"></ng-container>\n </div>\n\n <ng-template #treenodeContent>\n <ng-content></ng-content>\n <div class=\"clr-sr-only\" *ngIf=\"featuresService.selectable || ariaSelected\">\n <span *ngIf=\"ariaSelected\"> selected</span>\n <span *ngIf=\"!ariaSelected\"> unselected</span>\n </div>\n </ng-template>\n</div>\n<div\n class=\"clr-treenode-children\"\n [@toggleChildrenAnim]=\"expandService.expanded ? 'expanded' : 'collapsed'\"\n [attr.role]=\"isExpandable() && !featuresService.recursion ? 'group' : null\"\n>\n <ng-content select=\"clr-tree-node\"></ng-content>\n <ng-content select=\"[clrIfExpanded]\"></ng-content>\n <clr-recursive-children [parent]=\"_model\"></clr-recursive-children>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CdsIconCustomTag, selector: "cds-icon" }, { kind: "component", type: RecursiveChildren, selector: "clr-recursive-children", inputs: ["parent", "children"] }], animations: [
|
|
18283
18284
|
trigger('toggleChildrenAnim', [
|
|
18284
18285
|
transition('collapsed => expanded', [style({ height: 0 }), animate(200, style({ height: '*' }))]),
|
|
18285
18286
|
transition('expanded => collapsed', [style({ height: '*' }), animate(200, style({ height: 0 }))]),
|
|
@@ -18298,7 +18299,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
18298
18299
|
]),
|
|
18299
18300
|
], host: {
|
|
18300
18301
|
'[class.clr-tree-node]': 'true',
|
|
18301
|
-
}, template: "<!--\n ~ Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<div\n #contentContainer\n role=\"treeitem\"\n class=\"clr-tree-node-content-container\"\n tabindex=\"-1\"\n [attr.aria-expanded]=\"isExpandable() ? expanded : null\"\n [attr.aria-selected]=\"ariaSelected\"\n (keydown)=\"onKeyDown($event)\"\n (focus)=\"broadcastFocusOnContainer()\"\n>\n <button\n *ngIf=\"isExpandable() && !isModelLoading && !expandService.loading\"\n aria-hidden=\"true\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"clr-treenode-caret\"\n (click)=\"expandService.toggle();\"\n (focus)=\"focusTreeNode()\"\n >\n <cds-icon\n class=\"clr-treenode-caret-icon\"\n shape=\"angle\"\n [attr.direction]=\"expandService.expanded ? 'down' : 'right'\"\n ></cds-icon>\n </button>\n <div class=\"clr-treenode-spinner-container\" *ngIf=\"expandService.loading || isModelLoading\">\n <span class=\"clr-treenode-spinner spinner\"></span>\n </div>\n <div class=\"clr-checkbox-wrapper clr-treenode-checkbox\" *ngIf=\"featuresService.selectable\">\n <input\n aria-hidden=\"true\"\n type=\"checkbox\"\n id=\"{{nodeId}}-check\"\n class=\"clr-checkbox\"\n [checked]=\"_model.selected.value === STATES.SELECTED\"\n [indeterminate]=\"_model.selected.value === STATES.INDETERMINATE\"\n (change)=\"_model.toggleSelection(featuresService.eager)\"\n (focus)=\"focusTreeNode()\"\n tabindex=\"-1\"\n />\n <label for=\"{{nodeId}}-check\">\n <ng-container [ngTemplateOutlet]=\"treenodeContent\"></ng-container>\n </label>\n </div>\n <div class=\"clr-treenode-content\" (mousedown)=\"focusTreeNode()\" *ngIf=\"!featuresService.selectable\">\n <ng-container [ngTemplateOutlet]=\"treenodeContent\"></ng-container>\n </div>\n\n <ng-template #treenodeContent>\n <ng-content></ng-content>\n <div class=\"clr-sr-only\" *ngIf=\"featuresService.selectable || ariaSelected\">\n <span *ngIf=\"ariaSelected\"> selected</span>\n <span *ngIf=\"!ariaSelected\"> unselected</span>\n </div>\n </ng-template>\n</div>\n<div\n class=\"clr-treenode-children\"\n [@toggleChildrenAnim]=\"expandService.expanded ? 'expanded' : 'collapsed'\"\n [attr.role]=\"isExpandable() && !featuresService.recursion ? 'group' : null\"\n>\n <ng-content select=\"clr-tree-node\"></ng-content>\n <ng-content select=\"[clrIfExpanded]\"></ng-content>\n <clr-recursive-children [parent]=\"_model\"></clr-recursive-children>\n</div>\n" }]
|
|
18302
|
+
}, template: "<!--\n ~ Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<div\n #contentContainer\n role=\"treeitem\"\n class=\"clr-tree-node-content-container\"\n tabindex=\"-1\"\n [attr.aria-expanded]=\"isExpandable() ? expanded : null\"\n [attr.aria-selected]=\"ariaSelected\"\n (keydown)=\"onKeyDown($event)\"\n (focus)=\"broadcastFocusOnContainer()\"\n>\n <button\n *ngIf=\"isExpandable() && !isModelLoading && !expandService.loading\"\n aria-hidden=\"true\"\n type=\"button\"\n tabindex=\"-1\"\n class=\"clr-treenode-caret\"\n (click)=\"expandService.toggle();\"\n (focus)=\"focusTreeNode()\"\n >\n <cds-icon\n class=\"clr-treenode-caret-icon\"\n shape=\"angle\"\n [attr.direction]=\"expandService.expanded ? 'down' : 'right'\"\n ></cds-icon>\n </button>\n <div class=\"clr-treenode-spinner-container\" *ngIf=\"expandService.loading || isModelLoading\">\n <span class=\"clr-treenode-spinner spinner\"></span>\n </div>\n <div class=\"clr-checkbox-wrapper clr-treenode-checkbox\" *ngIf=\"featuresService.selectable\">\n <input\n aria-hidden=\"true\"\n type=\"checkbox\"\n id=\"{{nodeId}}-check\"\n class=\"clr-checkbox\"\n [checked]=\"_model.selected.value === STATES.SELECTED\"\n [indeterminate]=\"_model.selected.value === STATES.INDETERMINATE\"\n (change)=\"_model.toggleSelection(featuresService.eager)\"\n (focus)=\"focusTreeNode()\"\n tabindex=\"-1\"\n />\n <label for=\"{{nodeId}}-check\" class=\"clr-control-label\">\n <ng-container [ngTemplateOutlet]=\"treenodeContent\"></ng-container>\n </label>\n </div>\n <div class=\"clr-treenode-content\" (mousedown)=\"focusTreeNode()\" *ngIf=\"!featuresService.selectable\">\n <ng-container [ngTemplateOutlet]=\"treenodeContent\"></ng-container>\n </div>\n\n <ng-template #treenodeContent>\n <ng-content></ng-content>\n <div class=\"clr-sr-only\" *ngIf=\"featuresService.selectable || ariaSelected\">\n <span *ngIf=\"ariaSelected\"> selected</span>\n <span *ngIf=\"!ariaSelected\"> unselected</span>\n </div>\n </ng-template>\n</div>\n<div\n class=\"clr-treenode-children\"\n [@toggleChildrenAnim]=\"expandService.expanded ? 'expanded' : 'collapsed'\"\n [attr.role]=\"isExpandable() && !featuresService.recursion ? 'group' : null\"\n>\n <ng-content select=\"clr-tree-node\"></ng-content>\n <ng-content select=\"[clrIfExpanded]\"></ng-content>\n <clr-recursive-children [parent]=\"_model\"></clr-recursive-children>\n</div>\n" }]
|
|
18302
18303
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
18303
18304
|
type: Inject,
|
|
18304
18305
|
args: [PLATFORM_ID]
|
|
@@ -18519,7 +18520,7 @@ class DropdownFocusHandler {
|
|
|
18519
18520
|
this.platformId = platformId;
|
|
18520
18521
|
this.id = uniqueIdFactory();
|
|
18521
18522
|
this._unlistenFuncs = [];
|
|
18522
|
-
this.
|
|
18523
|
+
this.focusBackOnTriggerWhenClosed = false;
|
|
18523
18524
|
this.resetChildren();
|
|
18524
18525
|
this.moveToFirstItemWhenOpen();
|
|
18525
18526
|
if (!this.parent) {
|
|
@@ -18556,11 +18557,11 @@ class DropdownFocusHandler {
|
|
|
18556
18557
|
// We reset the state of the focus service both on initialization and when closing.
|
|
18557
18558
|
this.focusService.reset(this);
|
|
18558
18559
|
// But we only actively focus the trigger when closing, not on initialization.
|
|
18559
|
-
if (this.
|
|
18560
|
+
if (this.focusBackOnTriggerWhenClosed) {
|
|
18560
18561
|
this.focus();
|
|
18561
18562
|
}
|
|
18562
18563
|
}
|
|
18563
|
-
this.
|
|
18564
|
+
this.focusBackOnTriggerWhenClosed = open;
|
|
18564
18565
|
});
|
|
18565
18566
|
this._unlistenFuncs.push(() => subscription.unsubscribe());
|
|
18566
18567
|
}
|
|
@@ -18616,7 +18617,7 @@ class DropdownFocusHandler {
|
|
|
18616
18617
|
}
|
|
18617
18618
|
}
|
|
18618
18619
|
// We let the user move focus to where the want, we don't force the focus back on the trigger
|
|
18619
|
-
this.
|
|
18620
|
+
this.focusBackOnTriggerWhenClosed = false;
|
|
18620
18621
|
this.toggleService.open = false;
|
|
18621
18622
|
}));
|
|
18622
18623
|
}
|
|
@@ -18714,9 +18715,10 @@ const ROOT_DROPDOWN_PROVIDER = {
|
|
|
18714
18715
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
18715
18716
|
*/
|
|
18716
18717
|
class ClrDropdown {
|
|
18717
|
-
constructor(parent, toggleService, cdr, dropdownService) {
|
|
18718
|
+
constructor(parent, toggleService, focusHandler, cdr, dropdownService) {
|
|
18718
18719
|
this.parent = parent;
|
|
18719
18720
|
this.toggleService = toggleService;
|
|
18721
|
+
this.focusHandler = focusHandler;
|
|
18720
18722
|
this.cdr = cdr;
|
|
18721
18723
|
this.subscriptions = [];
|
|
18722
18724
|
this.isMenuClosable = true;
|
|
@@ -18727,7 +18729,7 @@ class ClrDropdown {
|
|
|
18727
18729
|
this.subscriptions.forEach(sub => sub.unsubscribe());
|
|
18728
18730
|
}
|
|
18729
18731
|
}
|
|
18730
|
-
ClrDropdown.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDropdown, deps: [{ token: ClrDropdown, optional: true, skipSelf: true }, { token: ClrPopoverToggleService }, { token: i0.ChangeDetectorRef }, { token: RootDropdownService }], target: i0.ɵɵFactoryTarget.Component });
|
|
18732
|
+
ClrDropdown.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDropdown, deps: [{ token: ClrDropdown, optional: true, skipSelf: true }, { token: ClrPopoverToggleService }, { token: DropdownFocusHandler }, { token: i0.ChangeDetectorRef }, { token: RootDropdownService }], target: i0.ɵɵFactoryTarget.Component });
|
|
18731
18733
|
ClrDropdown.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrDropdown, selector: "clr-dropdown", inputs: { isMenuClosable: ["clrCloseMenuOnItemClick", "isMenuClosable"] }, host: { properties: { "class.dropdown": "true", "class.open": "toggleService.open" } }, providers: [ROOT_DROPDOWN_PROVIDER, FOCUS_SERVICE_PROVIDER, DROPDOWN_FOCUS_HANDLER_PROVIDER], hostDirectives: [{ directive: PopoverHostDirective }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
18732
18734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDropdown, decorators: [{
|
|
18733
18735
|
type: Component,
|
|
@@ -18745,7 +18747,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
18745
18747
|
type: SkipSelf
|
|
18746
18748
|
}, {
|
|
18747
18749
|
type: Optional
|
|
18748
|
-
}] }, { type: ClrPopoverToggleService }, { type: i0.ChangeDetectorRef }, { type: RootDropdownService }]; }, propDecorators: { isMenuClosable: [{
|
|
18750
|
+
}] }, { type: ClrPopoverToggleService }, { type: DropdownFocusHandler }, { type: i0.ChangeDetectorRef }, { type: RootDropdownService }]; }, propDecorators: { isMenuClosable: [{
|
|
18749
18751
|
type: Input,
|
|
18750
18752
|
args: ['clrCloseMenuOnItemClick']
|
|
18751
18753
|
}] } });
|
|
@@ -18827,6 +18829,15 @@ class ClrDropdownItem {
|
|
|
18827
18829
|
return this.focusableItem.id;
|
|
18828
18830
|
}
|
|
18829
18831
|
onDropdownItemClick() {
|
|
18832
|
+
// Move focus back to the root dropdown trigger.
|
|
18833
|
+
// This is done BEFORE the dropdown is closed so that focus gets moved properly if a modal is opened.
|
|
18834
|
+
if (this.dropdown.isMenuClosable && !this.disabled && this.dropdown.toggleService.open) {
|
|
18835
|
+
const rootDropdown = this.findRootDropdown();
|
|
18836
|
+
rootDropdown.focusHandler.focus();
|
|
18837
|
+
// Prevent moving focus back to the trigger when the dropdown menu is closed.
|
|
18838
|
+
// Without this line, focus could be "stolen" from a modal that was opened from a dropdown item.
|
|
18839
|
+
rootDropdown.focusHandler.focusBackOnTriggerWhenClosed = false;
|
|
18840
|
+
}
|
|
18830
18841
|
// Ensure that the dropdown is closed after custom dropdown item click event handlers have run.
|
|
18831
18842
|
setTimeout(() => {
|
|
18832
18843
|
if (this.dropdown.isMenuClosable && !this.disabled) {
|
|
@@ -18845,6 +18856,13 @@ class ClrDropdownItem {
|
|
|
18845
18856
|
$event.stopImmediatePropagation();
|
|
18846
18857
|
}
|
|
18847
18858
|
}
|
|
18859
|
+
findRootDropdown() {
|
|
18860
|
+
let rootDropdown = this.dropdown;
|
|
18861
|
+
while (rootDropdown.parent) {
|
|
18862
|
+
rootDropdown = rootDropdown.parent;
|
|
18863
|
+
}
|
|
18864
|
+
return rootDropdown;
|
|
18865
|
+
}
|
|
18848
18866
|
}
|
|
18849
18867
|
ClrDropdownItem.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDropdownItem, deps: [{ token: ClrDropdown }, { token: RootDropdownService }, { token: FocusableItem }], target: i0.ɵɵFactoryTarget.Directive });
|
|
18850
18868
|
ClrDropdownItem.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.2", type: ClrDropdownItem, selector: "[clrDropdownItem]", inputs: { disabled: ["clrDisabled", "disabled"], dropdownItemId: ["id", "dropdownItemId"] }, host: { listeners: { "click": "onDropdownItemClick()", "keydown.space": "onSpaceKeydown($event)", "keydown.enter": "onEnterKeydown($event)" }, properties: { "class.disabled": "disabled", "class.dropdown-item": "true", "attr.role": "\"menuitem\"", "attr.aria-disabled": "disabled", "attr.id": "dropdownItemId" } }, providers: [BASIC_FOCUSABLE_ITEM_PROVIDER], ngImport: i0 });
|