@clr/angular 13.18.2 → 13.18.3

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.
@@ -18691,7 +18691,10 @@ class ClrStackBlock {
18691
18691
  addChild() {
18692
18692
  this.expandable = true;
18693
18693
  }
18694
- toggleExpand() {
18694
+ toggleExpand(event) {
18695
+ if (eventIsInputEvent(event)) {
18696
+ return;
18697
+ }
18695
18698
  if (this.expandable) {
18696
18699
  this.expanded = !this.expanded;
18697
18700
  this.expandedChange.emit(this.expanded);
@@ -18700,6 +18703,12 @@ class ClrStackBlock {
18700
18703
  getStackChildrenId() {
18701
18704
  return this.expanded ? `clr-stack-children-${this.uniqueId}` : null;
18702
18705
  }
18706
+ preventDefaultIfNotInputEvent(event) {
18707
+ if (eventIsInputEvent(event)) {
18708
+ return;
18709
+ }
18710
+ event.preventDefault();
18711
+ }
18703
18712
  }
18704
18713
  ClrStackBlock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrStackBlock, deps: [{ token: ClrStackBlock, optional: true, skipSelf: true }, { token: ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component });
18705
18714
  ClrStackBlock.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ClrStackBlock, selector: "clr-stack-block", inputs: { expanded: ["clrSbExpanded", "expanded"], expandable: ["clrSbExpandable", "expandable"], ariaLevel: ["clrStackViewLevel", "ariaLevel"], ariaSetsize: ["clrStackViewSetsize", "ariaSetsize"], ariaPosinset: ["clrStackViewPosinset", "ariaPosinset"], setChangedValue: ["clrSbNotifyChange", "setChangedValue"] }, outputs: { expandedChange: "clrSbExpandedChange" }, host: { properties: { "class.stack-block": "true", "attr.role": "\"heading\"", "attr.aria-level": "headingLevel", "class.stack-block-expanded": "this.expanded", "class.stack-block-expandable": "this.expandable", "class.stack-block-changed": "this.getChangedValue", "class.on-focus": "this.onStackLabelFocus" } }, queries: [{ propertyName: "stackBlockTitle", first: true, predicate: ClrStackViewLabel, descendants: true }], ngImport: i0, template: `
@@ -18707,10 +18716,10 @@ ClrStackBlock.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version:
18707
18716
  from scrolling when a stack block is toggled via the space key. -->
18708
18717
  <div
18709
18718
  class="stack-block-label"
18710
- (click)="toggleExpand()"
18711
- (keyup.enter)="toggleExpand()"
18712
- (keyup.space)="toggleExpand()"
18713
- (keydown.space)="$event.preventDefault()"
18719
+ (click)="toggleExpand($event)"
18720
+ (keyup.enter)="toggleExpand($event)"
18721
+ (keyup.space)="toggleExpand($event)"
18722
+ (keydown.space)="preventDefaultIfNotInputEvent($event)"
18714
18723
  (focus)="focused = true"
18715
18724
  (blur)="focused = false"
18716
18725
  [id]="uniqueId"
@@ -18752,10 +18761,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
18752
18761
  from scrolling when a stack block is toggled via the space key. -->
18753
18762
  <div
18754
18763
  class="stack-block-label"
18755
- (click)="toggleExpand()"
18756
- (keyup.enter)="toggleExpand()"
18757
- (keyup.space)="toggleExpand()"
18758
- (keydown.space)="$event.preventDefault()"
18764
+ (click)="toggleExpand($event)"
18765
+ (keyup.enter)="toggleExpand($event)"
18766
+ (keyup.space)="toggleExpand($event)"
18767
+ (keydown.space)="preventDefaultIfNotInputEvent($event)"
18759
18768
  (focus)="focused = true"
18760
18769
  (blur)="focused = false"
18761
18770
  [id]="uniqueId"
@@ -18844,6 +18853,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
18844
18853
  type: HostBinding,
18845
18854
  args: ['class.on-focus']
18846
18855
  }] } });
18856
+ function eventIsInputEvent(event) {
18857
+ const targetElement = event?.target;
18858
+ return targetElement?.tagName === 'INPUT';
18859
+ }
18847
18860
 
18848
18861
  /*
18849
18862
  * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.