@clr/angular 15.6.0 → 15.8.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.
@@ -4783,14 +4783,11 @@ class WrappedFormControl {
4783
4783
  this.subscriptions = [];
4784
4784
  this.renderer = renderer;
4785
4785
  this.el = el;
4786
- try {
4787
- this.ngControlService = injector.get(NgControlService);
4788
- this.ifControlStateService = injector.get(IfControlStateService);
4789
- this.controlClassService = injector.get(ControlClassService);
4790
- this.markControlService = injector.get(MarkControlService);
4791
- }
4792
- catch (e) {
4793
- // Swallow errors
4786
+ if (injector) {
4787
+ this.ngControlService = injector.get(NgControlService, null);
4788
+ this.ifControlStateService = injector.get(IfControlStateService, null);
4789
+ this.controlClassService = injector.get(ControlClassService, null);
4790
+ this.markControlService = injector.get(MarkControlService, null);
4794
4791
  }
4795
4792
  if (this.controlClassService) {
4796
4793
  this.controlClassService.initControlClass(renderer, el.nativeElement);
@@ -4818,15 +4815,10 @@ class WrappedFormControl {
4818
4815
  ngOnInit() {
4819
4816
  this._containerInjector = new HostWrapper(this.wrapperType, this.vcr, this.index);
4820
4817
  this.controlIdService = this._containerInjector.get(ControlIdService);
4821
- try {
4822
- this.containerIdService = this._containerInjector.get(ContainerIdService);
4823
- }
4824
- catch (_injectorError) {
4825
- /**
4826
- * We suppress error, not all containers will provide `ContainerIdService` so
4827
- * there could be exception that is not provided.
4828
- */
4829
- }
4818
+ /**
4819
+ * not all containers will provide `ContainerIdService`
4820
+ */
4821
+ this.containerIdService = this._containerInjector.get(ContainerIdService, null);
4830
4822
  if (this._id) {
4831
4823
  this.controlIdService.id = this._id;
4832
4824
  }
@@ -6644,10 +6636,15 @@ class ClrOptions {
6644
6636
  event.target !== this.focusHandler.textInput) {
6645
6637
  this.toggleService.open = false;
6646
6638
  }
6647
- }), this.items.changes.subscribe(() => {
6648
- setTimeout(() => {
6649
- this.focusHandler.focusFirstActive();
6650
- });
6639
+ }), this.items.changes.subscribe(items => {
6640
+ if (items.length) {
6641
+ setTimeout(() => {
6642
+ this.focusHandler.focusFirstActive();
6643
+ });
6644
+ }
6645
+ else {
6646
+ this.focusHandler.pseudoFocus.pop();
6647
+ }
6651
6648
  }));
6652
6649
  }
6653
6650
  ngOnDestroy() {
@@ -7457,6 +7454,7 @@ ClrDatalistContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", v
7457
7454
  <div class="clr-input-group" [class.clr-focus]="focus">
7458
7455
  <ng-content select="[clrDatalistInput]"></ng-content>
7459
7456
  <ng-content select="datalist"></ng-content>
7457
+ <cds-icon shape="angle" class="clr-datalist-caret" direction="down"></cds-icon>
7460
7458
  </div>
7461
7459
  <cds-icon
7462
7460
  *ngIf="showInvalid"
@@ -7490,6 +7488,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
7490
7488
  <div class="clr-input-group" [class.clr-focus]="focus">
7491
7489
  <ng-content select="[clrDatalistInput]"></ng-content>
7492
7490
  <ng-content select="datalist"></ng-content>
7491
+ <cds-icon shape="angle" class="clr-datalist-caret" direction="down"></cds-icon>
7493
7492
  </div>
7494
7493
  <cds-icon
7495
7494
  *ngIf="showInvalid"
@@ -13597,7 +13596,7 @@ class ClrSignpost {
13597
13596
  ClrSignpost.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrSignpost, deps: [{ token: ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component });
13598
13597
  ClrSignpost.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrSignpost, selector: "clr-signpost", host: { properties: { "class.signpost": "true" } }, providers: [SignpostFocusManager, SignpostIdService], queries: [{ propertyName: "customTrigger", first: true, predicate: ClrSignpostTrigger, descendants: true }], hostDirectives: [{ directive: ClrPopoverHostDirective }], ngImport: i0, template: `
13599
13598
  <ng-container *ngIf="!useCustomTrigger">
13600
- <button type="button" class="signpost-action btn btn-small btn-link" clrSignpostTrigger>
13599
+ <button type="button" class="signpost-action btn btn-small btn-icon btn-link" clrSignpostTrigger>
13601
13600
  <cds-icon shape="info-circle" [attr.title]="commonStrings.keys.info"></cds-icon>
13602
13601
  </button>
13603
13602
  </ng-container>
@@ -13610,7 +13609,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
13610
13609
  selector: 'clr-signpost',
13611
13610
  template: `
13612
13611
  <ng-container *ngIf="!useCustomTrigger">
13613
- <button type="button" class="signpost-action btn btn-small btn-link" clrSignpostTrigger>
13612
+ <button type="button" class="signpost-action btn btn-small btn-icon btn-link" clrSignpostTrigger>
13614
13613
  <cds-icon shape="info-circle" [attr.title]="commonStrings.keys.info"></cds-icon>
13615
13614
  </button>
13616
13615
  </ng-container>
@@ -17365,7 +17364,10 @@ class ClrStackBlock {
17365
17364
  addChild() {
17366
17365
  this.expandable = true;
17367
17366
  }
17368
- toggleExpand() {
17367
+ toggleExpand(event) {
17368
+ if (eventIsInputEvent(event)) {
17369
+ return;
17370
+ }
17369
17371
  if (this.expandable) {
17370
17372
  this.expanded = !this.expanded;
17371
17373
  this.expandedChange.emit(this.expanded);
@@ -17374,6 +17376,12 @@ class ClrStackBlock {
17374
17376
  getStackChildrenId() {
17375
17377
  return this.expanded ? `clr-stack-children-${this.uniqueId}` : null;
17376
17378
  }
17379
+ preventDefaultIfNotInputEvent(event) {
17380
+ if (eventIsInputEvent(event)) {
17381
+ return;
17382
+ }
17383
+ event.preventDefault();
17384
+ }
17377
17385
  }
17378
17386
  ClrStackBlock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrStackBlock, deps: [{ token: ClrStackBlock, optional: true, skipSelf: true }, { token: ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component });
17379
17387
  ClrStackBlock.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrStackBlock, selector: "clr-stack-block", inputs: { expanded: ["clrSbExpanded", "expanded"], expandable: ["clrSbExpandable", "expandable"], ariaLevel: ["clrStackViewLevel", "ariaLevel"], 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: `
@@ -17381,10 +17389,10 @@ ClrStackBlock.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version:
17381
17389
  from scrolling when a stack block is toggled via the space key. -->
17382
17390
  <div
17383
17391
  class="stack-block-label"
17384
- (click)="toggleExpand()"
17385
- (keyup.enter)="toggleExpand()"
17386
- (keyup.space)="toggleExpand()"
17387
- (keydown.space)="$event.preventDefault()"
17392
+ (click)="toggleExpand($event)"
17393
+ (keyup.enter)="toggleExpand($event)"
17394
+ (keyup.space)="toggleExpand($event)"
17395
+ (keydown.space)="preventDefaultIfNotInputEvent($event)"
17388
17396
  (focus)="focused = true"
17389
17397
  (blur)="focused = false"
17390
17398
  [id]="uniqueId"
@@ -17424,10 +17432,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
17424
17432
  from scrolling when a stack block is toggled via the space key. -->
17425
17433
  <div
17426
17434
  class="stack-block-label"
17427
- (click)="toggleExpand()"
17428
- (keyup.enter)="toggleExpand()"
17429
- (keyup.space)="toggleExpand()"
17430
- (keydown.space)="$event.preventDefault()"
17435
+ (click)="toggleExpand($event)"
17436
+ (keyup.enter)="toggleExpand($event)"
17437
+ (keyup.space)="toggleExpand($event)"
17438
+ (keydown.space)="preventDefaultIfNotInputEvent($event)"
17431
17439
  (focus)="focused = true"
17432
17440
  (blur)="focused = false"
17433
17441
  [id]="uniqueId"
@@ -17499,6 +17507,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
17499
17507
  type: HostBinding,
17500
17508
  args: ['class.on-focus']
17501
17509
  }] } });
17510
+ function eventIsInputEvent(event) {
17511
+ const targetElement = event?.target;
17512
+ return targetElement?.tagName === 'INPUT';
17513
+ }
17502
17514
 
17503
17515
  /*
17504
17516
  * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.