@clr/angular 12.0.5 → 12.0.9

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.
@@ -1389,7 +1389,8 @@
1389
1389
  singleSelectionAriaLabel: 'Single selection header',
1390
1390
  singleActionableAriaLabel: 'Single actionable header',
1391
1391
  detailExpandableAriaLabel: 'Toggle more row content',
1392
- datagridFilterAriaLabel: 'Toggle column filter',
1392
+ datagridFilterAriaLabel: 'Filter dialog',
1393
+ datagridFilterDialogAriaLabel: 'Toggle column filter',
1393
1394
  columnSeparatorAriaLabel: 'Column resize handle',
1394
1395
  columnSeparatorDescription: 'Not necessary to use this button',
1395
1396
  // Alert
@@ -10802,7 +10803,7 @@
10802
10803
  selector: 'clr-dg-filter',
10803
10804
  // We register this component as a CustomFilter, for the parent column to detect it.
10804
10805
  providers: [{ provide: CustomFilter, useExisting: ClrDatagridFilter }, UNIQUE_ID_PROVIDER],
10805
- template: "\n <button\n class=\"datagrid-filter-toggle\"\n type=\"button\"\n #anchor\n [attr.aria-label]=\"commonStrings.keys.datagridFilterAriaLabel\"\n [attr.aria-expanded]=\"ariaExpanded\"\n [attr.aria-controls]=\"popoverId\"\n clrPopoverAnchor\n clrPopoverOpenCloseButton\n [class.datagrid-filter-open]=\"open\"\n [class.datagrid-filtered]=\"active\"\n >\n <cds-icon\n [attr.status]=\"active ? 'info' : null\"\n [attr.shape]=\"active ? 'filter-grid-circle' : 'filter-grid'\"\n solid\n ></cds-icon>\n </button>\n\n <div\n class=\"datagrid-filter\"\n [id]=\"popoverId\"\n clrFocusTrap\n *clrPopoverContent=\"open; at: smartPosition; outsideClickToClose: true; scrollToClose: true\"\n >\n <div class=\"datagrid-filter-close-wrapper\">\n <button type=\"button\" class=\"close\" clrPopoverCloseButton>\n <cds-icon shape=\"window-close\" [attr.title]=\"commonStrings.keys.close\"></cds-icon>\n </button>\n </div>\n\n <ng-content></ng-content>\n </div>\n "
10806
+ template: "\n <button\n class=\"datagrid-filter-toggle\"\n type=\"button\"\n #anchor\n [attr.aria-label]=\"commonStrings.keys.datagridFilterAriaLabel\"\n [attr.aria-expanded]=\"ariaExpanded\"\n [attr.aria-controls]=\"popoverId\"\n clrPopoverAnchor\n clrPopoverOpenCloseButton\n [class.datagrid-filter-open]=\"open\"\n [class.datagrid-filtered]=\"active\"\n >\n <cds-icon\n [attr.status]=\"active ? 'info' : null\"\n [attr.shape]=\"active ? 'filter-grid-circle' : 'filter-grid'\"\n solid\n ></cds-icon>\n </button>\n\n <div\n class=\"datagrid-filter\"\n [id]=\"popoverId\"\n clrFocusTrap\n *clrPopoverContent=\"open; at: smartPosition; outsideClickToClose: true; scrollToClose: true\"\n role=\"dialog\"\n [attr.aria-label]=\"commonStrings.keys.datagridFilterDialogAriaLabel\"\n >\n <div class=\"datagrid-filter-close-wrapper\">\n <button type=\"button\" class=\"close\" clrPopoverCloseButton>\n <cds-icon shape=\"window-close\" [attr.title]=\"commonStrings.keys.close\"></cds-icon>\n </button>\n </div>\n\n <ng-content></ng-content>\n </div>\n "
10806
10807
  },] }
10807
10808
  ];
10808
10809
  ClrDatagridFilter.ctorParameters = function () { return [
@@ -12589,6 +12590,12 @@
12589
12590
  _this.focusOnClose();
12590
12591
  }
12591
12592
  }), this.signpostIdService.id.subscribe(function (idChange) { return (_this.ariaControl = idChange); }));
12593
+ this.addDefaultAriaLabel(this.el.nativeElement);
12594
+ };
12595
+ ClrSignpostTrigger.prototype.addDefaultAriaLabel = function (el) {
12596
+ if (!el.hasAttribute('aria-label')) {
12597
+ el.setAttribute('aria-label', this.commonStrings.keys.signpostToggle);
12598
+ }
12592
12599
  };
12593
12600
  ClrSignpostTrigger.prototype.focusOnClose = function () {
12594
12601
  if (!i1.isPlatformBrowser(this.platformId)) {
@@ -12618,7 +12625,6 @@
12618
12625
  selector: '[clrSignpostTrigger]',
12619
12626
  host: {
12620
12627
  class: 'signpost-trigger',
12621
- '[attr.aria-label]': 'commonStrings.keys.signpostToggle',
12622
12628
  '[attr.aria-expanded]': 'ariaExpanded',
12623
12629
  '[attr.aria-controls]': 'ariaControl',
12624
12630
  '[class.active]': 'isOpen',
@@ -17843,6 +17849,7 @@
17843
17849
  var _this = this;
17844
17850
  this.parentHost = parentHost;
17845
17851
  this.updateAnchor = false;
17852
+ this.recentlyOpened = false;
17846
17853
  this.popoverOptions = {};
17847
17854
  /*
17848
17855
  * Until https://github.com/angular/angular/issues/8785 is supported, we don't have any way to instantiate
@@ -17859,6 +17866,7 @@
17859
17866
  if (change) {
17860
17867
  _this.anchor();
17861
17868
  _this.attachESCListener();
17869
+ _this.setRecentlyOpened();
17862
17870
  }
17863
17871
  else {
17864
17872
  _this.release();
@@ -17868,6 +17876,7 @@
17868
17876
  if (this.toggleService.open) {
17869
17877
  this.anchor();
17870
17878
  this.attachESCListener();
17879
+ this.setRecentlyOpened();
17871
17880
  }
17872
17881
  }
17873
17882
  AbstractPopover.prototype.anchor = function () {
@@ -17933,7 +17942,7 @@
17933
17942
  this.ignoredElementClickListener = this.renderer.listen(this.ignoredElement, 'click', function (event) { return (_this.ignore = event); });
17934
17943
  }
17935
17944
  this.documentClickListener = this.renderer.listen('document', 'click', function (event) {
17936
- if (event === _this.ignore) {
17945
+ if (event === _this.ignore || _this.recentlyOpened) {
17937
17946
  delete _this.ignore;
17938
17947
  }
17939
17948
  else {
@@ -17958,6 +17967,13 @@
17958
17967
  }
17959
17968
  }
17960
17969
  };
17970
+ AbstractPopover.prototype.setRecentlyOpened = function () {
17971
+ var _this = this;
17972
+ this.recentlyOpened = true;
17973
+ setTimeout(function () {
17974
+ _this.recentlyOpened = false;
17975
+ });
17976
+ };
17961
17977
  return AbstractPopover;
17962
17978
  }());
17963
17979
  AbstractPopover.decorators = [
@@ -20362,7 +20378,7 @@
20362
20378
  { type: i0.Component, args: [{
20363
20379
  selector: 'clr-modal',
20364
20380
  viewProviders: [ScrollingService],
20365
- template: "<!--\n ~ Copyright (c) 2016-2021 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 clrFocusTrap class=\"modal\" *ngIf=\"_open\">\n <!--fixme: revisit when ngClass works with exit animation-->\n <div\n [@fadeDown]=\"skipAnimation\"\n (@fadeDown.done)=\"fadeDone($event)\"\n class=\"modal-dialog\"\n [class.modal-sm]=\"size == 'sm'\"\n [class.modal-lg]=\"size == 'lg'\"\n [class.modal-xl]=\"size == 'xl'\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-hidden]=\"!_open\"\n [attr.aria-labelledby]=\"modalId\"\n >\n <div class=\"clr-sr-only\">{{commonStrings.keys.modalContentStart}}</div>\n <div class=\"modal-content-wrapper\">\n <!-- only used in wizards -->\n <ng-content select=\".modal-nav\"></ng-content>\n\n <div class=\"modal-content\">\n <div class=\"modal-header--accessible\">\n <div class=\"modal-title-wrapper\" id=\"{{modalId}}\" clrFocusOnViewInit>\n <ng-content select=\".modal-title\"></ng-content>\n </div>\n <button\n type=\"button\"\n [attr.aria-label]=\"commonStrings.keys.close\"\n class=\"close\"\n *ngIf=\"closable\"\n (click)=\"close()\"\n >\n <cds-icon shape=\"window-close\"></cds-icon>\n </button>\n </div>\n <ng-content select=\".modal-body\"></ng-content>\n <ng-content select=\".modal-footer\"></ng-content>\n </div>\n </div>\n <div class=\"clr-sr-only\">{{commonStrings.keys.modalContentEnd}}</div>\n </div>\n\n <div [@fade] class=\"modal-backdrop\" aria-hidden=\"true\" (click)=\"staticBackdrop || close()\"></div>\n</div>\n",
20381
+ template: "<!--\n ~ Copyright (c) 2016-2022 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 clrFocusTrap class=\"modal\" *ngIf=\"_open\">\n <!--fixme: revisit when ngClass works with exit animation-->\n <div\n [@fadeDown]=\"skipAnimation\"\n (@fadeDown.done)=\"fadeDone($event)\"\n class=\"modal-dialog\"\n [class.modal-sm]=\"size == 'sm'\"\n [class.modal-lg]=\"size == 'lg'\"\n [class.modal-xl]=\"size == 'xl'\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-hidden]=\"!_open\"\n [attr.aria-labelledby]=\"modalId\"\n >\n <div class=\"clr-sr-only\">{{commonStrings.keys.modalContentStart}}</div>\n <div class=\"modal-content-wrapper\">\n <!-- only used in wizards -->\n <ng-content select=\".modal-nav\"></ng-content>\n\n <div class=\"modal-content\">\n <div class=\"modal-header--accessible\">\n <div class=\"modal-title-wrapper\" id=\"{{modalId}}\" clrFocusOnViewInit>\n <ng-content select=\".modal-title\"></ng-content>\n </div>\n <button\n type=\"button\"\n [attr.aria-label]=\"commonStrings.keys.close\"\n class=\"close\"\n *ngIf=\"closable\"\n (click)=\"close()\"\n >\n <cds-icon shape=\"window-close\"></cds-icon>\n </button>\n </div>\n <div class=\"modal-body-wrapper\">\n <ng-content select=\".modal-body\"></ng-content>\n </div>\n <ng-content select=\".modal-footer\"></ng-content>\n </div>\n </div>\n <div class=\"clr-sr-only\">{{commonStrings.keys.modalContentEnd}}</div>\n </div>\n\n <div [@fade] class=\"modal-backdrop\" aria-hidden=\"true\" (click)=\"staticBackdrop || close()\"></div>\n</div>\n",
20366
20382
  animations: [
20367
20383
  animations.trigger('fadeDown', [
20368
20384
  animations.transition('* => false', [animations.style({ opacity: 0, transform: 'translate(0, -25%)' }), animations.animate('0.2s ease-in-out')]),
@@ -20397,7 +20413,7 @@
20397
20413
  };
20398
20414
 
20399
20415
  /*
20400
- * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.
20416
+ * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
20401
20417
  * This software is released under MIT license.
20402
20418
  * The full license information can be found in LICENSE in the root directory of this project.
20403
20419
  */
@@ -20408,19 +20424,21 @@
20408
20424
  * the overflow scroll being focused.
20409
20425
  */
20410
20426
  var ClrModalBody = /** @class */ (function () {
20411
- function ClrModalBody(ngZone, renderer, host) {
20427
+ function ClrModalBody(renderer, host, ngZone) {
20412
20428
  var _this = this;
20429
+ this.renderer = renderer;
20430
+ this.host = host;
20413
20431
  this.tabindex = '0';
20414
20432
  this.unlisteners = [];
20415
- renderer.setAttribute(host.nativeElement, 'tabindex', this.tabindex);
20416
20433
  ngZone.runOutsideAngular(function () {
20417
- _this.unlisteners.push(renderer.listen(host.nativeElement, 'mouseup', function () {
20434
+ new ResizeObserver(function () { return _this.addOrRemoveTabIndex(); }).observe(_this.host.nativeElement);
20435
+ _this.unlisteners.push(_this.renderer.listen(_this.host.nativeElement, 'mouseup', function () {
20418
20436
  // set the tabindex binding back when click is completed with mouseup
20419
- renderer.setAttribute(host.nativeElement, 'tabindex', _this.tabindex);
20420
- }), renderer.listen(host.nativeElement, 'mousedown', function () {
20437
+ _this.addOrRemoveTabIndex();
20438
+ }), _this.renderer.listen(_this.host.nativeElement, 'mousedown', function () {
20421
20439
  // tabindex = 0 binding should be removed
20422
20440
  // so it won't be focused when click starts with mousedown
20423
- renderer.removeAttribute(host.nativeElement, 'tabindex');
20441
+ _this.removeTabIndex();
20424
20442
  }));
20425
20443
  });
20426
20444
  }
@@ -20429,15 +20447,30 @@
20429
20447
  this.unlisteners.pop()();
20430
20448
  }
20431
20449
  };
20450
+ ClrModalBody.prototype.addTabIndex = function () {
20451
+ this.renderer.setAttribute(this.host.nativeElement, 'tabindex', this.tabindex);
20452
+ };
20453
+ ClrModalBody.prototype.removeTabIndex = function () {
20454
+ this.renderer.removeAttribute(this.host.nativeElement, 'tabindex');
20455
+ };
20456
+ ClrModalBody.prototype.addOrRemoveTabIndex = function () {
20457
+ var modalBody = this.host.nativeElement.parentElement;
20458
+ if (modalBody.clientHeight < modalBody.scrollHeight) {
20459
+ this.addTabIndex();
20460
+ }
20461
+ else {
20462
+ this.removeTabIndex();
20463
+ }
20464
+ };
20432
20465
  return ClrModalBody;
20433
20466
  }());
20434
20467
  ClrModalBody.decorators = [
20435
20468
  { type: i0.Directive, args: [{ selector: '.modal-body' },] }
20436
20469
  ];
20437
20470
  ClrModalBody.ctorParameters = function () { return [
20438
- { type: i0.NgZone },
20439
20471
  { type: i0.Renderer2 },
20440
- { type: i0.ElementRef }
20472
+ { type: i0.ElementRef },
20473
+ { type: i0.NgZone }
20441
20474
  ]; };
20442
20475
 
20443
20476
  /*
@@ -23746,10 +23779,11 @@
23746
23779
  };
23747
23780
  AccordionModel.prototype.togglePanel = function (panelId, open) {
23748
23781
  var panelIsOpen = this._panels[panelId].open;
23749
- if (this.strategy === AccordionStrategy.Default) {
23782
+ var newOpenState = open !== undefined ? open : !panelIsOpen;
23783
+ if (newOpenState && this.strategy === AccordionStrategy.Default) {
23750
23784
  this.closeAllPanels();
23751
23785
  }
23752
- this._panels[panelId].open = open !== undefined ? open : !panelIsOpen;
23786
+ this._panels[panelId].open = newOpenState;
23753
23787
  };
23754
23788
  AccordionModel.prototype.disablePanel = function (panelId, disabled) {
23755
23789
  this._panels[panelId].disabled = disabled;