@clr/angular 16.3.5 → 16.3.7
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 +3 -1
- package/esm2020/button/button-group/button-group.mjs +3 -3
- package/esm2020/modal/modal-stack.service.mjs +4 -1
- package/esm2020/utils/animations/expandable-animation/expandable-animation.mjs +14 -6
- package/fesm2015/clr-angular.mjs +18 -7
- package/fesm2015/clr-angular.mjs.map +1 -1
- package/fesm2020/clr-angular.mjs +18 -7
- package/fesm2020/clr-angular.mjs.map +1 -1
- package/package.json +2 -2
- package/utils/animations/expandable-animation/expandable-animation.d.ts +4 -2
package/fesm2020/clr-angular.mjs
CHANGED
|
@@ -2939,15 +2939,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
2939
2939
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
2940
2940
|
*/
|
|
2941
2941
|
class ClrExpandableAnimation {
|
|
2942
|
-
constructor(element, domAdapter) {
|
|
2942
|
+
constructor(element, domAdapter, renderer) {
|
|
2943
2943
|
this.element = element;
|
|
2944
2944
|
this.domAdapter = domAdapter;
|
|
2945
|
+
this.renderer = renderer;
|
|
2945
2946
|
this.startHeight = 0;
|
|
2946
2947
|
}
|
|
2947
2948
|
get expandAnimation() {
|
|
2948
2949
|
return { value: this.clrExpandTrigger, params: { startHeight: this.startHeight } };
|
|
2949
2950
|
}
|
|
2951
|
+
animationStart() {
|
|
2952
|
+
this.renderer.setStyle(this.element.nativeElement, 'overflow', 'hidden');
|
|
2953
|
+
}
|
|
2950
2954
|
animationDone() {
|
|
2955
|
+
this.renderer.removeStyle(this.element.nativeElement, 'overflow');
|
|
2951
2956
|
// A "safe" auto-update of the height ensuring basic OOTB user experience .
|
|
2952
2957
|
// Prone to small jumps in initial animation height if data was changed in the meantime, window was resized, etc.
|
|
2953
2958
|
// For optimal behavior call manually updateStartHeight() from the parent component before initiating the update.
|
|
@@ -2957,8 +2962,8 @@ class ClrExpandableAnimation {
|
|
|
2957
2962
|
this.startHeight = this.domAdapter.computedHeight(this.element.nativeElement) || 0;
|
|
2958
2963
|
}
|
|
2959
2964
|
}
|
|
2960
|
-
ClrExpandableAnimation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrExpandableAnimation, deps: [{ token: i0.ElementRef }, { token: DomAdapter }], target: i0.ɵɵFactoryTarget.Component });
|
|
2961
|
-
ClrExpandableAnimation.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrExpandableAnimation, selector: "clr-expandable-animation", inputs: { clrExpandTrigger: "clrExpandTrigger" }, host: { listeners: { "@expandAnimation.done": "animationDone()" }, properties: { "@expandAnimation": "this.expandAnimation" } }, providers: [DomAdapter], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host{display:block
|
|
2965
|
+
ClrExpandableAnimation.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrExpandableAnimation, deps: [{ token: i0.ElementRef }, { token: DomAdapter }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
2966
|
+
ClrExpandableAnimation.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrExpandableAnimation, selector: "clr-expandable-animation", inputs: { clrExpandTrigger: "clrExpandTrigger" }, host: { listeners: { "@expandAnimation.start": "animationStart()", "@expandAnimation.done": "animationDone()" }, properties: { "@expandAnimation": "this.expandAnimation" } }, providers: [DomAdapter], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host{display:block}\n"], animations: [
|
|
2962
2967
|
trigger('expandAnimation', [
|
|
2963
2968
|
transition('true <=> false', [
|
|
2964
2969
|
style({ height: '{{startHeight}}px' }),
|
|
@@ -2975,12 +2980,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
2975
2980
|
animate('0.2s ease-in-out', style({ height: '*' })),
|
|
2976
2981
|
]),
|
|
2977
2982
|
]),
|
|
2978
|
-
], providers: [DomAdapter], styles: [":host{display:block
|
|
2979
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: DomAdapter }]; }, propDecorators: { clrExpandTrigger: [{
|
|
2983
|
+
], providers: [DomAdapter], styles: [":host{display:block}\n"] }]
|
|
2984
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: DomAdapter }, { type: i0.Renderer2 }]; }, propDecorators: { clrExpandTrigger: [{
|
|
2980
2985
|
type: Input
|
|
2981
2986
|
}], expandAnimation: [{
|
|
2982
2987
|
type: HostBinding,
|
|
2983
2988
|
args: ['@expandAnimation']
|
|
2989
|
+
}], animationStart: [{
|
|
2990
|
+
type: HostListener,
|
|
2991
|
+
args: ['@expandAnimation.start']
|
|
2984
2992
|
}], animationDone: [{
|
|
2985
2993
|
type: HostListener,
|
|
2986
2994
|
args: ['@expandAnimation.done']
|
|
@@ -3855,10 +3863,10 @@ class ClrButtonGroup {
|
|
|
3855
3863
|
}
|
|
3856
3864
|
}
|
|
3857
3865
|
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 }, { token: ButtonGroupFocusHandler }], target: i0.ɵɵFactoryTarget.Component });
|
|
3858
|
-
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, BUTTON_GROUP_FOCUS_HANDLER_PROVIDER, FOCUS_SERVICE_PROVIDER], queries: [{ propertyName: "buttons", predicate: ClrButton }], viewQueries: [{ propertyName: "menuToggle", first: true, predicate: ["menuToggle"], descendants: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true }], hostDirectives: [{ directive: ClrPopoverHostDirective }], 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-
|
|
3866
|
+
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, BUTTON_GROUP_FOCUS_HANDLER_PROVIDER, FOCUS_SERVICE_PROVIDER], queries: [{ propertyName: "buttons", predicate: ClrButton }], viewQueries: [{ propertyName: "menuToggle", first: true, predicate: ["menuToggle"], descendants: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true }], hostDirectives: [{ directive: ClrPopoverHostDirective }], 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-template *ngFor=\"let inlineButton of inlineButtons\" [ngTemplateOutlet]=\"inlineButton.templateRef\"></ng-template>\n\n<div *ngIf=\"menuButtons.length > 0\" class=\"btn-group-overflow open\" [ngClass]=\"menuPosition\">\n <button\n #menuToggle\n class=\"btn dropdown-toggle\"\n clrPopoverAnchor\n clrPopoverOpenCloseButton\n (keydown.arrowup)=\"openMenu($event, InitialFocus.LAST_ITEM)\"\n (keydown.arrowdown)=\"openMenu($event, InitialFocus.FIRST_ITEM)\"\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 #menu\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 *ngFor=\"let menuButton of menuButtons\" [ngTemplateOutlet]=\"menuButton.templateRef\"></ng-template>\n </div>\n</div>\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"] }] });
|
|
3859
3867
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrButtonGroup, decorators: [{
|
|
3860
3868
|
type: Component,
|
|
3861
|
-
args: [{ selector: 'clr-button-group', providers: [ButtonInGroupService, ClrDestroyService, BUTTON_GROUP_FOCUS_HANDLER_PROVIDER, FOCUS_SERVICE_PROVIDER], hostDirectives: [ClrPopoverHostDirective], 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-
|
|
3869
|
+
args: [{ selector: 'clr-button-group', providers: [ButtonInGroupService, ClrDestroyService, BUTTON_GROUP_FOCUS_HANDLER_PROVIDER, FOCUS_SERVICE_PROVIDER], hostDirectives: [ClrPopoverHostDirective], 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-template *ngFor=\"let inlineButton of inlineButtons\" [ngTemplateOutlet]=\"inlineButton.templateRef\"></ng-template>\n\n<div *ngIf=\"menuButtons.length > 0\" class=\"btn-group-overflow open\" [ngClass]=\"menuPosition\">\n <button\n #menuToggle\n class=\"btn dropdown-toggle\"\n clrPopoverAnchor\n clrPopoverOpenCloseButton\n (keydown.arrowup)=\"openMenu($event, InitialFocus.LAST_ITEM)\"\n (keydown.arrowdown)=\"openMenu($event, InitialFocus.FIRST_ITEM)\"\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 #menu\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 *ngFor=\"let menuButton of menuButtons\" [ngTemplateOutlet]=\"menuButton.templateRef\"></ng-template>\n </div>\n</div>\n" }]
|
|
3862
3870
|
}], ctorParameters: function () { return [{ type: ButtonInGroupService }, { type: ClrPopoverToggleService }, { type: ClrCommonStringsService }, { type: ClrDestroyService }, { type: ButtonGroupFocusHandler }]; }, propDecorators: { clrToggleButtonAriaLabel: [{
|
|
3863
3871
|
type: Input,
|
|
3864
3872
|
args: ['clrToggleButtonAriaLabel']
|
|
@@ -12265,6 +12273,9 @@ class ModalStackService {
|
|
|
12265
12273
|
}
|
|
12266
12274
|
onKeyUp(event) {
|
|
12267
12275
|
if (this.modalStack.length && normalizeKey(event.key) === Keys.Escape) {
|
|
12276
|
+
// We blur the active element because escaping with an input element in focus could cause
|
|
12277
|
+
// an ExpressionChangedAfterItHasBeenCheckedError for the touched state. (CDE-1662)
|
|
12278
|
+
document.activeElement.blur();
|
|
12268
12279
|
this.modalStack[0].close();
|
|
12269
12280
|
}
|
|
12270
12281
|
}
|