UNPKG

carbon-components-angular

Version:
1 lines 26.2 kB
"use strict";(self.webpackChunkcarbon_components_angular=self.webpackChunkcarbon_components_angular||[]).push([[8446],{"./src/ai-label/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{zb:()=>AILabelActions,UD:()=>AILabelComponent,q:()=>AILabelContent,uV:()=>AILabelModule});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.js"),core=__webpack_require__("./node_modules/@angular/core/fesm2020/core.mjs");let AILabelActions=class AILabelActions{constructor(){this.toggletipActions=!0,this.aiLabelActions=!0}};AILabelActions.propDecorators={toggletipActions:[{type:core.HostBinding,args:["class.cds--toggletip-actions"]}],aiLabelActions:[{type:core.HostBinding,args:["class.cds--ai-label-actions"]}]},AILabelActions=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsAILabelActions], [ibmAILabelActions]"})],AILabelActions);let AILabelContent=class AILabelContent{};AILabelContent=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsAILabelContent], [ibmAILabelContent]"})],AILabelContent);var popover=__webpack_require__("./src/popover/index.ts");let AILabelPopoverDirective=class AILabelPopoverDirective extends popover.OI{constructor(elementRef,ngZone,renderer,changeDetectorRef){super(elementRef,ngZone,renderer,changeDetectorRef),this.elementRef=elementRef,this.ngZone=ngZone,this.renderer=renderer,this.changeDetectorRef=changeDetectorRef,this.highContrast=!0,this.dropShadow=!1}initializeReferences(){this.updateAlignmentClass(this._align),this.bindPopoverRefs(),this.handleChange(this.isOpen)}ngOnChanges(changes){const originalState=this.isOpen;this.handleChange(!1),changes.autoAlign&&!changes.autoAlign.firstChange&&(this.popoverContentRef?.setAttribute("style",""),this.bindPopoverRefs()),this.handleChange(originalState)}bindPopoverRefs(){const panel=this.elementRef.nativeElement.querySelector(":scope > span.cds--popover");panel&&(this.popoverContentRef=panel.querySelector(":scope > span.cds--popover-content"),this.caretRef=this.resolveCaretRef(panel))}resolveCaretRef(panel){return this.autoAlign?panel.querySelector("span.cds--popover-content > span.cds--popover-caret.cds--popover--auto-align"):panel.querySelector(":scope > span.cds--popover-caret")}};AILabelPopoverDirective.ctorParameters=()=>[{type:core.ElementRef},{type:core.NgZone},{type:core.Renderer2},{type:core.ChangeDetectorRef}],AILabelPopoverDirective=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsAILabelPopover]"})],AILabelPopoverDirective);let AILabelComponent=class AILabelComponent{constructor(elementRef){this.elementRef=elementRef,this.aiLabelClass=!0,this.caret=!0,this.dropShadow=!1,this.highContrast=!0,this.autoAlign=!1,this.isOpen=!1,this.onClose=new core.EventEmitter,this.onOpen=new core.EventEmitter,this.isOpenChange=new core.EventEmitter,this.id="ai-label-"+AILabelComponent.labelCounter++,this.aiText="AI",this.kind="default",this.size="xs",this.revertActive=!1,this.revertLabel="Revert to AI input",this.ariaLabel="Show information",this.revertClick=new core.EventEmitter,this.documentClick=this.handleOutsideClick.bind(this)}get revertClass(){return this.revertActive}get alignmentAxisOffset(){return["mini","2xs","xs"].includes(this.size)?-24:0}onPopoverIsOpenChange(open){this.isOpen=open,this.isOpenChange.emit(open)}get triggerClasses(){return{"cds--toggletip-button":!0,"cds--ai-label__button":!0,[`cds--ai-label__button--${this.size}`]:!0,[`cds--ai-label__button--${this.kind}`]:!0,"cds--ai-label__button--inline-with-content":"inline"===this.kind&&!!this.textLabel}}get computedAriaLabel(){const suffix="inline"===this.kind&&this.textLabel?this.textLabel:this.ariaLabel;return`${this.aiText} ${suffix}`}ngAfterViewInit(){this.isOpen&&document.addEventListener("click",this.documentClick)}ngOnChanges(changes){changes.revertActive&&!changes.revertActive.firstChange&&changes.revertActive.currentValue&&(this.isOpen=!1,document.removeEventListener("click",this.documentClick))}ngOnDestroy(){document.removeEventListener("click",this.documentClick)}onTriggerClick(event){const opening=!this.isOpen;opening?document.addEventListener("click",this.documentClick):document.removeEventListener("click",this.documentClick),this.aiLabelPopover?.handleChange(opening,event)}onRevertButtonClick(event){this.revertClick.emit(event)}hostkeys(event){this.isOpen&&"Escape"===event.key&&(event.stopPropagation(),document.removeEventListener("click",this.documentClick),this.aiLabelPopover?.handleChange(!1,event))}handleOutsideClick(event){this.elementRef.nativeElement.contains(event.target)||(this.aiLabelPopover?.handleChange(!1,event),document.removeEventListener("click",this.documentClick))}};AILabelComponent.labelCounter=0,AILabelComponent.ctorParameters=()=>[{type:core.ElementRef}],AILabelComponent.propDecorators={aiLabelClass:[{type:core.HostBinding,args:["class.cds--ai-label"]}],revertClass:[{type:core.HostBinding,args:["class.cds--ai-label--revert"]}],align:[{type:core.Input}],caret:[{type:core.Input}],dropShadow:[{type:core.Input}],highContrast:[{type:core.Input}],autoAlign:[{type:core.Input}],isOpen:[{type:core.Input}],onClose:[{type:core.Output}],onOpen:[{type:core.Output}],isOpenChange:[{type:core.Output}],id:[{type:core.Input}],aiText:[{type:core.Input}],textLabel:[{type:core.Input}],kind:[{type:core.Input}],size:[{type:core.Input}],revertActive:[{type:core.Input}],revertLabel:[{type:core.Input}],ariaLabel:[{type:core.Input}],revertClick:[{type:core.Output}],aiLabelPopover:[{type:core.ViewChild,args:["aiLabelPopoverHost",{read:AILabelPopoverDirective}]}],hostkeys:[{type:core.HostListener,args:["keyup",["$event"]]}]},AILabelComponent=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-ai-label, ibm-ai-label",changeDetection:core.ChangeDetectionStrategy.OnPush,template:'\n\t\t<ng-container *ngIf="!revertActive">\n\t\t\t<span\n\t\t\t\t#aiLabelPopoverHost\n\t\t\t\tcdsAILabelPopover\n\t\t\t\tclass="cds--toggletip"\n\t\t\t\t[isOpen]="isOpen"\n\t\t\t\t(isOpenChange)="onPopoverIsOpenChange($event)"\n\t\t\t\t(onOpen)="onOpen.emit($event)"\n\t\t\t\t(onClose)="onClose.emit($event)"\n\t\t\t\t[align]="align"\n\t\t\t\t[caret]="caret"\n\t\t\t\t[dropShadow]="dropShadow"\n\t\t\t\t[highContrast]="highContrast"\n\t\t\t\t[autoAlign]="autoAlign"\n\t\t\t\t[alignmentAxisOffset]="alignmentAxisOffset">\n\t\t\t\t<button\n\t\t\t\t\ttype="button"\n\t\t\t\t\t[attr.aria-label]="computedAriaLabel"\n\t\t\t\t\t[attr.aria-expanded]="isOpen"\n\t\t\t\t\t[attr.aria-controls]="id"\n\t\t\t\t\t[ngClass]="triggerClasses"\n\t\t\t\t\t(click)="onTriggerClick($event)">\n\t\t\t\t\t<span class="cds--ai-label__text">{{aiText}}</span>\n\t\t\t\t\t<span *ngIf="kind === \'inline\' && textLabel" class="cds--ai-label__additional-text">{{textLabel}}</span>\n\t\t\t\t</button>\n\n\t\t\t\t<span\n\t\t\t\t\t[id]="id"\n\t\t\t\t\tclass="cds--popover"\n\t\t\t\t\taria-live="polite">\n\t\t\t\t\t<span class="cds--popover-content cds--ai-label-content">\n\t\t\t\t\t\t<div class="cds--toggletip-content">\n\t\t\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span *ngIf="autoAlign" class="cds--popover-caret cds--popover--auto-align"></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span *ngIf="!autoAlign" class="cds--popover-caret"></span>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</ng-container>\n\n\t\t<cds-icon-button\n\t\t\t*ngIf="revertActive"\n\t\t\tkind="ghost"\n\t\t\tsize="sm"\n\t\t\t[description]="revertLabel"\n\t\t\t[autoAlign]="autoAlign"\n\t\t\t[buttonAttributes]="{ \'aria-label\': revertLabel }"\n\t\t\t(click)="onRevertButtonClick($event)">\n\t\t\t<svg cdsIcon="undo" size="16"></svg>\n\t\t</cds-icon-button>\n\t'})],AILabelComponent);var common=__webpack_require__("./node_modules/@angular/common/fesm2020/common.mjs"),src_button=__webpack_require__("./src/button/index.ts"),icon=__webpack_require__("./src/icon/index.ts");let AILabelModule=class AILabelModule{};AILabelModule=(0,tslib_es6.gn)([(0,core.NgModule)({declarations:[AILabelComponent,AILabelPopoverDirective,AILabelContent,AILabelActions],exports:[AILabelComponent,AILabelContent,AILabelActions],imports:[common.CommonModule,src_button.hJ,icon.QX,popover.UU]})],AILabelModule)},"./src/layer/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>LayerDirective,D:()=>LayerModule});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.js"),core=__webpack_require__("./node_modules/@angular/core/fesm2020/core.mjs");let LayerDirective=class LayerDirective{set ibmLayer(level){this.cdsLayer=level}set cdsLayer(level){"number"==typeof level&&(this._passedLevel=level,this.layer=level)}get cdsLayer(){return this._passedLevel}set layer(level){"number"==typeof level&&(this._level=Math.max(0,Math.min(level,2)),this.layerChildren&&this.layerChildren.forEach((layer=>{layer!==this&&(layer.layer="number"==typeof layer._passedLevel?layer._passedLevel:this.layer+1)})))}get layer(){return this._level}get layerOneClass(){return 0===this.layer}get layerTwoClass(){return 1===this.layer}get layerThreeClass(){return 2===this.layer}ngAfterContentInit(){"number"!=typeof this.cdsLayer&&(this.layer=1)}};LayerDirective.propDecorators={ibmLayer:[{type:core.Input}],cdsLayer:[{type:core.Input}],layerOneClass:[{type:core.HostBinding,args:["class.cds--layer-one"]}],layerTwoClass:[{type:core.HostBinding,args:["class.cds--layer-two"]}],layerThreeClass:[{type:core.HostBinding,args:["class.cds--layer-three"]}],layerChildren:[{type:core.ContentChildren,args:[LayerDirective,{descendants:!1}]}]},LayerDirective=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsLayer], [ibmLayer]",exportAs:"layer"})],LayerDirective);var common=__webpack_require__("./node_modules/@angular/common/fesm2020/common.mjs");let LayerModule=class LayerModule{};LayerModule=(0,tslib_es6.gn)([(0,core.NgModule)({declarations:[LayerDirective],exports:[LayerDirective],imports:[common.CommonModule]})],LayerModule)},"./src/link/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{rU:()=>Link,LO:()=>LinkModule});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.js"),core=__webpack_require__("./node_modules/@angular/core/fesm2020/core.mjs");let Link=class Link{constructor(){this.baseClass=!0,this.inline=!1,this.visited=!1}get sizeSm(){return"sm"===this.size}get sizeMd(){return"md"===this.size}get sizeLg(){return"lg"===this.size}set disabled(disabled){this._disabled=disabled,this.tabindex=this.disabled?-1:null}get disabled(){return this._disabled}};Link.propDecorators={baseClass:[{type:core.HostBinding,args:["class.cds--link"]}],tabindex:[{type:core.HostBinding,args:["attr.tabindex"]}],inline:[{type:core.Input},{type:core.HostBinding,args:["class.cds--link--inline"]}],size:[{type:core.Input}],sizeSm:[{type:core.HostBinding,args:["class.cds--link--sm"]}],sizeMd:[{type:core.HostBinding,args:["class.cds--link--md"]}],sizeLg:[{type:core.HostBinding,args:["class.cds--link--lg"]}],visited:[{type:core.Input},{type:core.HostBinding,args:["class.cds--link--visited"]}],disabled:[{type:core.Input},{type:core.HostBinding,args:["attr.aria-disabled"]},{type:core.HostBinding,args:["class.cds--link--disabled"]}]},Link=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsLink], [ibmLink]"})],Link);let LinkIconDirective=class LinkIconDirective{constructor(){this.iconClass=!0}};LinkIconDirective.propDecorators={iconClass:[{type:core.HostBinding,args:["class.cds--link__icon"]}]},LinkIconDirective=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[ibmLinkIcon], [cdsLinkIcon]"})],LinkIconDirective);var common=__webpack_require__("./node_modules/@angular/common/fesm2020/common.mjs");let LinkModule=class LinkModule{};LinkModule=(0,tslib_es6.gn)([(0,core.NgModule)({declarations:[Link,LinkIconDirective],exports:[Link,LinkIconDirective],imports:[common.CommonModule]})],LinkModule)},"./src/tiles/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Oh:()=>ClickableTile,wN:()=>ExpandableTile,G9:()=>SelectionTile,n9:()=>Tile,B4:()=>TileGroup,i$:()=>TilesModule});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.js"),core=__webpack_require__("./node_modules/@angular/core/fesm2020/core.mjs");let ClickableTileIconDirective=class ClickableTileIconDirective{constructor(){this.icon=!0}};ClickableTileIconDirective.propDecorators={icon:[{type:core.HostBinding,args:["class.cds--tile--icon"]}]},ClickableTileIconDirective=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsClickableTileIcon], [ibmClickableTileIcon]"})],ClickableTileIconDirective);var router=__webpack_require__("./node_modules/@angular/router/fesm2020/router.mjs");let ClickableTile=class ClickableTile{constructor(router){this.router=router,this.theme="dark",this.href="#",this.disabled=!1,this.hasRoundedCorners=!1,this.navigation=new core.EventEmitter}navigate(event){if(this.router&&this.route&&!this.disabled){event.preventDefault();const status=this.router.navigate(this.route,this.routeExtras);this.navigation.emit(status)}}};ClickableTile.ctorParameters=()=>[{type:router.F0,decorators:[{type:core.Optional}]}],ClickableTile.propDecorators={theme:[{type:core.Input}],href:[{type:core.Input}],target:[{type:core.Input}],rel:[{type:core.Input}],disabled:[{type:core.Input}],decorator:[{type:core.Input}],hasRoundedCorners:[{type:core.Input}],route:[{type:core.Input}],routeExtras:[{type:core.Input}],navigation:[{type:core.Output}]},ClickableTile=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-clickable-tile, ibm-clickable-tile",template:'\n\t<a\n\t\tcdsLink\n\t\tclass="cds--tile cds--tile--clickable"\n\t\t[ngClass]="{\n\t\t\t\'cds--tile--light\': theme === \'light\',\n\t\t\t\'cds--tile--disabled cds--link--disabled\' : disabled,\n\t\t\t\'cds--tile--decorator\': !!decorator,\n\t\t\t\'cds--tile--decorator-rounded\': !!decorator && hasRoundedCorners\n\t\t}"\n\t\ttabindex="0"\n\t\t(click)="navigate($event)"\n\t\t[attr.href]="disabled ? null : href"\n\t\t[attr.target]="target"\n\t\t[attr.rel]="rel ? rel : null"\n\t\t[attr.aria-disabled]="disabled">\n\t\t<ng-content></ng-content>\n\t\t<ng-container *ngIf="decorator">\n\t\t\t<div class="cds--tile--inner-decorator">\n\t\t\t\t<ng-template [ngTemplateOutlet]="decorator"></ng-template>\n\t\t\t</div>\n\t\t</ng-container>\n\t</a>'})],ClickableTile);var i18n=__webpack_require__("./src/i18n/index.ts"),utils=__webpack_require__("./src/utils/index.ts");let ExpandableTile=class ExpandableTile{constructor(i18n,element){this.i18n=i18n,this.element=element,this.theme="dark",this.expanded=!1,this.interactive=!1,this.hasRoundedCorners=!1,this.tileMaxHeight=0,this.currentExpandedHeight=0,this.expand=this.i18n.getOverridable("TILES.EXPAND"),this.collapse=this.i18n.getOverridable("TILES.COLLAPSE")}set translations(value){const valueWithDefaults=(0,utils.TS)(this.i18n.getMultiple("TILES"),value);this.expand.override(valueWithDefaults.EXPAND),this.collapse.override(valueWithDefaults.COLLAPSE)}ngAfterViewInit(){this.updateMaxHeight()}get expandedHeight(){const tile=this.element.nativeElement.querySelector(".cds--tile"),tilePadding=parseInt(getComputedStyle(tile).paddingBottom,10)+parseInt(getComputedStyle(tile).paddingTop,10),expandedHeight=this.tileMaxHeight+tilePadding;return isNaN(expandedHeight)||(this.currentExpandedHeight=expandedHeight),this.currentExpandedHeight}updateMaxHeight(){this.expanded?this.tileMaxHeight=this.tileContainer.nativeElement.getBoundingClientRect().height:this.tileMaxHeight=this.element.nativeElement.querySelector(".cds--tile-content__above-the-fold").getBoundingClientRect().height}onClick(){this.expanded=!this.expanded,this.updateMaxHeight()}};ExpandableTile.ctorParameters=()=>[{type:i18n.oc},{type:core.ElementRef}],ExpandableTile.propDecorators={theme:[{type:core.Input}],expanded:[{type:core.Input}],interactive:[{type:core.Input}],decorator:[{type:core.Input}],hasRoundedCorners:[{type:core.Input}],translations:[{type:core.Input}],tileContainer:[{type:core.ViewChild,args:["container"]}]},ExpandableTile=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-expandable-tile, ibm-expandable-tile",template:'\n\t\t<button\n\t\t\t*ngIf="!interactive"\n\t\t\tclass="cds--tile cds--tile--expandable"\n\t\t\t[ngClass]="{\n\t\t\t\t\'cds--tile--is-expanded\' : expanded,\n\t\t\t\t\'cds--tile--light\': theme === \'light\'\n\t\t\t}"\n\t\t\t[ngStyle]="{\'max-height\': expandedHeight + \'px\'}"\n\t\t\ttype="button"\n\t\t\t(click)="onClick()"\n\t\t\t[attr.aria-expanded]="expanded"\n\t\t\t[attr.title]="(expanded ? collapse.subject : expand.subject) | async">\n\t\t\t\t<ng-container *ngTemplateOutlet="expandableTileContent"></ng-container>\n\t\t</button>\n\n\t\t<div\n\t\t\t*ngIf="interactive"\n\t\t\tclass="cds--tile cds--tile--expandable cds--tile--expandable--interactive"\n\t\t\t[ngClass]="{\n\t\t\t\t\'cds--tile--is-expanded\' : expanded,\n\t\t\t\t\'cds--tile--light\': theme === \'light\',\n\t\t\t\t\'cds--tile--decorator\': !!decorator,\n\t\t\t\t\'cds--tile--decorator-rounded\': !!decorator && hasRoundedCorners\n\t\t\t}"\n\t\t\t[ngStyle]="{\'max-height\': expandedHeight + \'px\'}"\n\t\t\t[attr.title]="(expanded ? collapse.subject : expand.subject) | async">\n\t\t\t<ng-container *ngTemplateOutlet="expandableTileContent"></ng-container>\n\t\t</div>\n\n\t\t<ng-template #chevronIcon>\n\t\t\t<svg cdsIcon="chevron--down" size="16"></svg>\n\t\t</ng-template>\n\n\t\t<ng-template #expandableTileContent>\n\t\t\t<div #container>\n\t\t\t\t<ng-container *ngIf="interactive && decorator">\n\t\t\t\t\t<div class="cds--tile--inner-decorator">\n\t\t\t\t\t\t<ng-template [ngTemplateOutlet]="decorator"></ng-template>\n\t\t\t\t\t</div>\n\t\t\t\t</ng-container>\n\t\t\t\t<div class="cds--tile-content">\n\t\t\t\t\t<ng-content select="[cdsAboveFold],[ibmAboveFold],.cds--tile-content__above-the-fold"></ng-content>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf="!interactive" class="cds--tile__chevron">\n\t\t\t\t\t<ng-container *ngTemplateOutlet="chevronIcon"></ng-container>\n\t\t\t\t</div>\n\t\t\t\t<button\n\t\t\t\t\t*ngIf="interactive"\n\t\t\t\t\tclass="cds--tile__chevron cds--tile__chevron--interactive"\n\t\t\t\t\ttype="button"\n\t\t\t\t\t(click)="onClick()"\n\t\t\t\t\t[attr.aria-expanded]="expanded"\n\t\t\t\t\t[attr.aria-label]="(expanded ? collapse.subject : expand.subject) | async">\n\t\t\t\t\t<ng-container *ngTemplateOutlet="chevronIcon"></ng-container>\n\t\t\t\t</button>\n\t\t\t\t<div class="cds--tile-content">\n\t\t\t\t\t<ng-content select="[cdsBelowFold],[ibmBelowFold],.cds--tile-content__below-the-fold"></ng-content>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</ng-template>\n\t'})],ExpandableTile);let ExpandableTileAboveFoldDirective=class ExpandableTileAboveFoldDirective{constructor(){this.aboveFold=!0}};ExpandableTileAboveFoldDirective.propDecorators={aboveFold:[{type:core.HostBinding,args:["class.cds--tile-content__above-the-fold"]}]},ExpandableTileAboveFoldDirective=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsAboveFold], [ibmAboveFold]"})],ExpandableTileAboveFoldDirective);let ExpandableTileBelowFoldDirective=class ExpandableTileBelowFoldDirective{constructor(){this.belowFold=!0}};ExpandableTileBelowFoldDirective.propDecorators={belowFold:[{type:core.HostBinding,args:["class.cds--tile-content__below-the-fold"]}]},ExpandableTileBelowFoldDirective=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsBelowFold], [ibmBelowFold]"})],ExpandableTileBelowFoldDirective);let SelectionTile=class SelectionTile{constructor(i18n){this.i18n=i18n,this.theme="dark",this.id=`tile-${SelectionTile.tileCount}`,this.change=new core.EventEmitter,this.disabled=!1,this.hasRoundedCorners=!1,this.name="tile-group-unbound",this.multiple=!0,this._selected=null,SelectionTile.tileCount++}set selected(value){this._selected=!!value||null,this.input&&(this.input.nativeElement.checked=this._selected)}get selected(){return!!this.input&&this.input.nativeElement.checked}ngAfterViewInit(){this.input&&setTimeout((()=>{this.input.nativeElement.checked=this._selected}))}keyboardInput(event){"Enter"!==event.key&&"Spacebar"!==event.key&&" "!==event.key||(this.selected=!this.selected,this.change.emit(event))}onChange(event){this.change.emit(event)}};SelectionTile.tileCount=0,SelectionTile.ctorParameters=()=>[{type:i18n.oc}],SelectionTile.propDecorators={theme:[{type:core.Input}],id:[{type:core.Input}],selected:[{type:core.Input}],value:[{type:core.Input}],change:[{type:core.Output}],disabled:[{type:core.Input}],decorator:[{type:core.Input}],hasRoundedCorners:[{type:core.Input}],input:[{type:core.ViewChild,args:["input",{static:!0}]}],keyboardInput:[{type:core.HostListener,args:["keydown",["$event"]]}]},SelectionTile=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-selection-tile, ibm-selection-tile",template:'\n\t\t<input\n\t\t\t#input\n\t\t\t[attr.tabindex]="disabled ? null : 0"\n\t\t\tclass="cds--tile-input"\n\t\t\t[id]="id"\n\t\t\t[disabled]="disabled"\n\t\t\t[type]="(multiple ? \'checkbox\': \'radio\')"\n\t\t\t[value]="value"\n\t\t\t[name]="name"\n\t\t\t(change)="onChange($event)"/>\n\t\t<label\n\t\t\tclass="cds--tile cds--tile--selectable"\n\t\t\t[for]="id"\n\t\t\t[ngClass]="{\n\t\t\t\t\'cds--tile--is-selected\' : selected,\n\t\t\t\t\'cds--tile--light\': theme === \'light\',\n\t\t\t\t\'cds--tile--disabled\' : disabled,\n\t\t\t\t\'cds--tile--decorator\': !!decorator,\n\t\t\t\t\'cds--tile--decorator-rounded\': !!decorator && hasRoundedCorners\n\t\t\t}"\n\t\t\t[attr.aria-label]="i18n.get(\'TILES.TILE\') | async">\n\t\t\t<div class="cds--tile__checkmark"\n\t\t\t\t[class.cds--tile__checkmark--persistent]="multiple">\n\t\t\t\t<svg *ngIf="!selected; else selectedIcon"\n\t\t\t\t\t[cdsIcon]="multiple ? \'checkbox\' : \'checkmark\'"\n\t\t\t\t\tsize="16">\n\t\t\t\t</svg>\n\t\t\t\t<ng-template #selectedIcon>\n\t\t\t\t\t<svg [cdsIcon]="multiple ? \'checkbox--checked--filled\' : \'checkmark--filled\'" size="16"></svg>\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t\t<div class="cds--tile-content">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</div>\n\t\t\t<ng-container *ngIf="decorator">\n\t\t\t\t<div class="cds--tile--inner-decorator">\n\t\t\t\t\t<ng-template [ngTemplateOutlet]="decorator"></ng-template>\n\t\t\t\t</div>\n\t\t\t</ng-container>\n\t\t</label>\n\t'})],SelectionTile);var fesm2020_forms=__webpack_require__("./node_modules/@angular/forms/fesm2020/forms.mjs"),Subject=__webpack_require__("./node_modules/rxjs/dist/esm5/internal/Subject.js"),takeUntil=__webpack_require__("./node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js");let TileGroup=class TileGroup{constructor(){this.name=`tile-group-${TileGroup.tileGroupCount}`,this.multiple=!1,this.selected=new core.EventEmitter,this.tileGroupClass=!0,this.unsubscribe$=new Subject.x,this.unsubscribeTiles$=new Subject.x,this.onChange=_=>{},this.onTouched=()=>{},TileGroup.tileGroupCount++}ngAfterContentInit(){const updateTiles=()=>{this.unsubscribeTiles$.next(),setTimeout((()=>{this.selectionTiles.forEach((tile=>{tile.name=this.name,tile.change.pipe((0,takeUntil.R)(this.unsubscribeTiles$)).subscribe((()=>{this.selected.emit({value:tile.value,selected:tile.selected,name:this.name}),this.onChange(tile.value)})),tile.multiple=this.multiple}))}))};updateTiles(),this.selectionTiles.changes.pipe((0,takeUntil.R)(this.unsubscribe$)).subscribe((_=>updateTiles()))}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete(),this.unsubscribeTiles$.next(),this.unsubscribeTiles$.complete()}writeValue(value){this.selectionTiles&&this.selectionTiles.forEach((tile=>{tile.value===value?tile.selected=!0:tile.selected=!1}))}registerOnChange(fn){this.onChange=fn}registerOnTouched(fn){this.onTouched=fn}isTemplate(value){return value instanceof core.TemplateRef}};TileGroup.tileGroupCount=0,TileGroup.ctorParameters=()=>[],TileGroup.propDecorators={name:[{type:core.Input}],multiple:[{type:core.Input}],legend:[{type:core.Input}],selected:[{type:core.Output}],tileGroupClass:[{type:core.HostBinding,args:["class.cds--tile-group"]}],selectionTiles:[{type:core.ContentChildren,args:[SelectionTile]}]},TileGroup=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-tile-group, ibm-tile-group",template:'\n\t\t<fieldset>\n\t\t\t<legend *ngIf="legend" class="cds--label">\n\t\t\t\t<ng-template *ngIf="isTemplate(legend); else legendLabel;" [ngTemplateOutlet]="legend"></ng-template>\n\t\t\t\t<ng-template #legendLabel>{{legend}}</ng-template>\n\t\t\t</legend>\n\t\t\t<ng-content select="ibm-selection-tile,cds-selection-tile"></ng-content>\n\t\t</fieldset>',providers:[{provide:fesm2020_forms.JU,useExisting:TileGroup,multi:!0}]})],TileGroup);let Tile=class Tile{constructor(){this.tileClass=!0,this.hasRoundedCorners=!1,this.theme="dark"}get lightThemeEnabled(){return"light"===this.theme}get hasDecorator(){return!!this.decorator}get decoratorRounded(){return!!this.decorator&&this.hasRoundedCorners}};Tile.propDecorators={tileClass:[{type:core.HostBinding,args:["class.cds--tile"]}],lightThemeEnabled:[{type:core.HostBinding,args:["class.cds--tile--light"]}],hasDecorator:[{type:core.HostBinding,args:["class.cds--tile--decorator"]}],decoratorRounded:[{type:core.HostBinding,args:["class.cds--tile--decorator-rounded"]}],decorator:[{type:core.Input}],hasRoundedCorners:[{type:core.Input}],theme:[{type:core.Input}]},Tile=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-tile, ibm-tile",template:'\n\t\t<ng-content></ng-content>\n\t\t<ng-container *ngIf="decorator">\n\t\t\t<div class="cds--tile--inner-decorator">\n\t\t\t\t<ng-template [ngTemplateOutlet]="decorator"></ng-template>\n\t\t\t</div>\n\t\t</ng-container>\n\t'})],Tile);var common=__webpack_require__("./node_modules/@angular/common/fesm2020/common.mjs"),icon=__webpack_require__("./src/icon/index.ts"),src_link=__webpack_require__("./src/link/index.ts");let TilesModule=class TilesModule{};TilesModule=(0,tslib_es6.gn)([(0,core.NgModule)({declarations:[Tile,ClickableTile,ClickableTileIconDirective,ExpandableTileAboveFoldDirective,ExpandableTileBelowFoldDirective,ExpandableTile,SelectionTile,TileGroup],exports:[Tile,ClickableTile,ClickableTileIconDirective,ExpandableTileAboveFoldDirective,ExpandableTileBelowFoldDirective,ExpandableTile,SelectionTile,TileGroup],imports:[common.CommonModule,i18n.LU,icon.QX,src_link.LO]})],TilesModule)}}]);