carbon-components-angular
Version:
Next generation components
1 lines • 75.5 kB
JavaScript
"use strict";(self.webpackChunkcarbon_components_angular=self.webpackChunkcarbon_components_angular||[]).push([[5868],{"./src/search/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{o:()=>Search,t:()=>SearchModule});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.js"),search_componentngResource=__webpack_require__("./src/search/search.component.html?ngResource"),core=__webpack_require__("./node_modules/@angular/core/fesm2020/core.mjs"),fesm2020_forms=__webpack_require__("./node_modules/@angular/forms/fesm2020/forms.mjs"),i18n=__webpack_require__("./src/i18n/index.ts");let Search=class Search{constructor(elementRef,i18n){this.elementRef=elementRef,this.i18n=i18n,this.theme="dark",this.size="md",this.disabled=!1,this.toolbar=!1,this.expandable=!1,this.skeleton=!1,this.active=!1,this.tableSearch=!1,this.id=`search-${Search.searchCount}`,this.value="",this.autocomplete="on",this.label=this.i18n.get().SEARCH.LABEL,this.placeholder=this.i18n.get().SEARCH.PLACEHOLDER,this.clearButtonTitle=this.i18n.get().SEARCH.CLEAR_BUTTON,this.searchTitle="",this.fluid=!1,this.valueChange=new core.EventEmitter,this.open=new core.EventEmitter,this.clear=new core.EventEmitter,this.search=new core.EventEmitter,this.isComposing=!1,this.onTouched=()=>{},this.propagateChange=_=>{},Search.searchCount++}get containerClass(){return!(this.toolbar||this.expandable)}get fluidSkeletonClass(){return this.skeleton&&this.fluid}writeValue(value){this.value=value}registerOnChange(fn){this.propagateChange=fn}registerOnTouched(fn){this.onTouched=fn}onSearch(search){this.isComposing||(this.value=search,this.doValueChange())}onEnter(){this.search.emit(this.value)}clearSearch(){this.value="",this.doValueChange(),this.clear.emit()}doValueChange(){this.propagateChange(this.value),this.valueChange.emit(this.value)}openSearch(){this.active=!0,this.open.emit(this.active),setTimeout((()=>this.inputRef.nativeElement.focus()))}keyDown(event){(this.toolbar||this.expandable)&&("Escape"===event.key?""===this.value&&(this.active=!1,this.open.emit(this.active)):"Enter"===event.key&&this.openSearch()),"Escape"===event.key&&""!==this.value&&this.clearSearch()}focusOut(event){this.onTouched(),(this.expandable||this.toolbar)&&this.inputRef&&""===this.inputRef.nativeElement.value&&!this.elementRef.nativeElement.contains(event.relatedTarget)&&(this.active=!1,this.open.emit(this.active))}focusIn(event){this.onTouched(),!this.expandable&&!this.toolbar||!this.inputRef||event.relatedTarget||this.elementRef.nativeElement.contains(event.relatedTarget)||this.openSearch()}compositionStart(event){this.isComposing=!0}compositionEnd(event){this.isComposing=!1,this.onSearch(this.value+event.data)}};Search.searchCount=0,Search.ctorParameters=()=>[{type:core.ElementRef},{type:i18n.oc}],Search.propDecorators={containerClass:[{type:core.HostBinding,args:["class.cds--form-item"]}],fluidSkeletonClass:[{type:core.HostBinding,args:["class.cds--text-input--fluid__skeleton"]}],theme:[{type:core.Input}],size:[{type:core.Input}],disabled:[{type:core.Input}],toolbar:[{type:core.Input}],expandable:[{type:core.Input}],skeleton:[{type:core.Input}],active:[{type:core.Input}],tableSearch:[{type:core.Input}],name:[{type:core.Input}],id:[{type:core.Input}],required:[{type:core.Input}],value:[{type:core.Input}],autocomplete:[{type:core.Input}],label:[{type:core.Input}],placeholder:[{type:core.Input}],clearButtonTitle:[{type:core.Input}],searchTitle:[{type:core.Input}],ariaLabel:[{type:core.Input}],fluid:[{type:core.Input}],valueChange:[{type:core.Output}],open:[{type:core.Output}],clear:[{type:core.Output}],search:[{type:core.Output}],inputRef:[{type:core.ViewChild,args:["input"]}],keyDown:[{type:core.HostListener,args:["keydown",["$event"]]}],focusOut:[{type:core.HostListener,args:["focusout",["$event"]]}],focusIn:[{type:core.HostListener,args:["focusin",["$event"]]}],compositionStart:[{type:core.HostListener,args:["compositionstart",["$event"]]}],compositionEnd:[{type:core.HostListener,args:["compositionend",["$event"]]}]},Search=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-search, ibm-search",template:search_componentngResource,providers:[{provide:fesm2020_forms.JU,useExisting:Search,multi:!0}]})],Search);var common=__webpack_require__("./node_modules/@angular/common/fesm2020/common.mjs"),icon=__webpack_require__("./src/icon/index.ts");let SearchModule=class SearchModule{};SearchModule=(0,tslib_es6.gn)([(0,core.NgModule)({declarations:[Search],exports:[Search],imports:[fesm2020_forms.u5,common.CommonModule,i18n.LU,icon.QX]})],SearchModule)},"./src/table/index.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{iA:()=>Table,jr:()=>table_header_item_class.j,r8:()=>table_item_class.r,G0:()=>table_model_class.G,U$:()=>TableModule,SC:()=>TableRow});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.js"),core=__webpack_require__("./node_modules/@angular/core/fesm2020/core.mjs"),i18n=__webpack_require__("./src/i18n/index.ts");let TableToolbar=class TableToolbar{constructor(i18n){this.i18n=i18n,this.size="md",this.cancel=new core.EventEmitter,this.actionBarLabel=this.i18n.getOverridable("TABLE_TOOLBAR.ACTION_BAR"),this._cancelText=this.i18n.getOverridable("TABLE_TOOLBAR.CANCEL"),this._batchTextLegacy=this.i18n.getOverridable("TABLE_TOOLBAR.BATCH_TEXT"),this._batchTextSingle=this.i18n.getOverridable("TABLE_TOOLBAR.BATCH_TEXT_SINGLE"),this._batchTextMultiple=this.i18n.getOverridable("TABLE_TOOLBAR.BATCH_TEXT_MULTIPLE")}set batchText(value){"object"==typeof value?(this._batchTextSingle.override(value.SINGLE),this._batchTextMultiple.override(value.MULTIPLE)):this._batchTextLegacy.override(value)}set ariaLabel(value){this.actionBarLabel.override(value.ACTION_BAR)}set cancelText(value){this._cancelText.override(value.CANCEL)}get cancelText(){return{CANCEL:this._cancelText.value}}get count(){return this.model.totalDataLength>0?this.model.rowsSelected.reduce(((previous,current)=>previous+(current?1:0)),0):0}get selected(){return this.model.totalDataLength>0&&this.model.rowsSelected.some((item=>item))}onCancel(){this.model.selectAll(!1),this.cancel.emit()}};TableToolbar.ctorParameters=()=>[{type:i18n.oc}],TableToolbar.propDecorators={model:[{type:core.Input}],batchText:[{type:core.Input}],ariaLabel:[{type:core.Input}],cancelText:[{type:core.Input}],size:[{type:core.Input}],cancel:[{type:core.Output}]},TableToolbar=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-table-toolbar, ibm-table-toolbar",template:'\n\t<section\n\t\tclass="cds--table-toolbar"\n\t\t[ngClass]="{\'cds--table-toolbar--sm\' : size === \'sm\'}"\n\t\t[attr.aria-label]="actionBarLabel.subject | async">\n\t\t<div\n\t\t\t*ngIf="model"\n\t\t\tclass="cds--batch-actions"\n\t\t\t[ngClass]="{\n\t\t\t\t\'cds--batch-actions--active\': selected\n\t\t\t}">\n\t\t\t<div class="cds--batch-summary">\n\t\t\t\t<p class="cds--batch-summary__para" *ngIf="count as n">\n\t\t\t\t\t<ng-container *ngIf="_batchTextLegacy.subject | async as legacyText; else batchTextBlock">\n\t\t\t\t\t\t<span>{{n}}</span> {{legacyText}}\n\t\t\t\t\t</ng-container>\n\t\t\t\t\t<ng-template #batchTextBlock>\n\t\t\t\t\t\t<span *ngIf="n === 1">{{_batchTextSingle.subject | async}}</span>\n\t\t\t\t\t\t<span *ngIf="n !== 1">{{_batchTextMultiple.subject | i18nReplace: {count: n} | async}}</span>\n\t\t\t\t\t</ng-template>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div class="cds--action-list">\n\t\t\t\t<ng-content select="cds-table-toolbar-actions,ibm-table-toolbar-actions"></ng-content>\n\t\t\t\t<button\n\t\t\t\t\tcdsButton="primary"\n\t\t\t\t\tclass="cds--batch-summary__cancel"\n\t\t\t\t\t[tabindex]="selected ? 0 : -1"\n\t\t\t\t\t(click)="onCancel()">\n\t\t\t\t\t{{_cancelText.subject | async}}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\t\t<ng-content></ng-content>\n\t</section>\n\t'})],TableToolbar);let TableToolbarActions=class TableToolbarActions{};TableToolbarActions=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-table-toolbar-actions, ibm-table-toolbar-actions",template:"<ng-content></ng-content>"})],TableToolbarActions);var search_componentngResource=__webpack_require__("./src/search/search.component.html?ngResource"),search=__webpack_require__("./src/search/index.ts"),fesm2020_forms=__webpack_require__("./node_modules/@angular/forms/fesm2020/forms.mjs");let TableToolbarSearch=class TableToolbarSearch extends search.o{constructor(){super(...arguments),this.tableSearch=!0,this.size="lg",this.hostClass=!0}ngAfterViewInit(){setTimeout((()=>{this.value&&this.openSearch()}))}};TableToolbarSearch.propDecorators={hostClass:[{type:core.HostBinding,args:["class.cds--toolbar-content"]}]},TableToolbarSearch=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-table-toolbar-search, ibm-table-toolbar-search",template:search_componentngResource,providers:[{provide:fesm2020_forms.JU,useExisting:TableToolbarSearch,multi:!0}]})],TableToolbarSearch);let TableToolbarContent=class TableToolbarContent{constructor(){this.class=!0}};TableToolbarContent.propDecorators={class:[{type:core.HostBinding,args:["class.cds--toolbar-content"]}]},TableToolbarContent=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-table-toolbar-content, ibm-table-toolbar-content",template:"<ng-content></ng-content>"})],TableToolbarContent);let TableHeaderDescription=class TableHeaderDescription{constructor(){this.id="table-description-"+TableHeaderDescription.counter++,this.descriptionClass=!0}};TableHeaderDescription.counter=0,TableHeaderDescription.propDecorators={id:[{type:core.HostBinding,args:["attr.id"]},{type:core.Input}],descriptionClass:[{type:core.HostBinding,args:["class.cds--data-table-header__description"]}]},TableHeaderDescription=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsTableHeaderDescription], [ibmTableHeaderDescription]"})],TableHeaderDescription);let TableHeaderTitle=class TableHeaderTitle{constructor(){this.id="table-title-"+TableHeaderTitle.counter++,this.titleClass=!0}};TableHeaderTitle.counter=0,TableHeaderTitle.propDecorators={id:[{type:core.HostBinding,args:["attr.id"]},{type:core.Input}],titleClass:[{type:core.HostBinding,args:["class.cds--data-table-header__title"]}]},TableHeaderTitle=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsTableHeaderTitle], [ibmTableHeaderTitle]"})],TableHeaderTitle);var TableDomSpanDirection,Subscription=__webpack_require__("./node_modules/rxjs/dist/esm5/internal/Subscription.js"),fromEvent=__webpack_require__("./node_modules/rxjs/dist/esm5/internal/observable/fromEvent.js"),table_model_class=__webpack_require__("./src/table/table-model.class.ts"),table_header_item_class=__webpack_require__("./src/table/table-header-item.class.ts"),table_item_class=__webpack_require__("./src/table/table-item.class.ts"),tab_service=__webpack_require__("./src/common/tab.service.ts"),utils=__webpack_require__("./src/utils/index.ts"),BehaviorSubject=__webpack_require__("./node_modules/rxjs/dist/esm5/internal/BehaviorSubject.js"),combineLatest=__webpack_require__("./node_modules/rxjs/dist/esm5/internal/observable/combineLatest.js"),map=__webpack_require__("./node_modules/rxjs/dist/esm5/internal/operators/map.js");class DataGridInteractionModel{constructor(keyboardEventStream,clickEventStream,tableAdapter){this.keyboardEventStream=keyboardEventStream,this.clickEventStream=clickEventStream,this.tableAdapter=tableAdapter,this.rowSubject=new BehaviorSubject.X({current:0,previous:-1}),this.columnSubject=new BehaviorSubject.X({current:0,previous:-1}),this.rowIndex=this.rowSubject.asObservable(),this.columnIndex=this.columnSubject.asObservable(),this.position=(0,combineLatest.a)(this.rowIndex,this.columnIndex).pipe((0,map.U)((positions=>{const[row,column]=positions;return{current:[row.current,column.current],previous:[row.previous,column.previous]}}))),this.keyboardEventStream.subscribe(this.handleKeyboardEvent.bind(this)),this.clickEventStream.subscribe(this.handleClickEvent.bind(this))}get currentRow(){return this.rowSubject.getValue().current}get currentColumn(){return this.columnSubject.getValue().current}get lastColumn(){return this.tableAdapter.lastColumnIndex}get lastRow(){return this.tableAdapter.lastRowIndex}handleKeyboardEvent(event){const currentCell=this.tableAdapter.getCell(this.currentRow,this.currentColumn);let currentColumn=this.tableAdapter.findColumnIndex(currentCell),currentRow=this.tableAdapter.findRowIndex(currentCell);switch(event.key){case"ArrowRight":event.preventDefault(),this.goToColumn(currentColumn+currentCell.colSpan);break;case"ArrowLeft":event.preventDefault(),this.goToColumn(currentColumn-1);break;case"ArrowDown":event.preventDefault(),this.goToRow(currentRow+currentCell.rowSpan);break;case"ArrowUp":event.preventDefault(),this.goToRow(currentRow-1);break;case"Home":event.preventDefault(),event.ctrlKey?this.goTo({row:0,column:0}):this.goToColumn(0);break;case"End":event.preventDefault(),event.ctrlKey?this.goTo({row:this.lastRow,column:this.lastColumn}):this.goToColumn(this.lastColumn)}}handleClickEvent(event){const cell=event.target.closest("td, th"),[rowIndex,cellIndex]=this.tableAdapter.findIndex(cell);this.goTo({row:rowIndex,column:cellIndex})}goToColumn(index){index>this.lastColumn||index<0||this.goTo({row:this.currentRow,column:index})}goToRow(index){index>this.lastRow||index<0||this.goTo({row:index,column:this.currentColumn})}goTo({row,column}){this.rowSubject.next({current:row,previous:this.currentRow}),this.columnSubject.next({current:column,previous:this.currentColumn})}resetTabIndexes(newTabIndex=-1){for(let i=0;i<this.tableAdapter.lastRowIndex;i++){const row=this.tableAdapter.getRow(i);for(const cell of Array.from(row.cells)){(0,tab_service.ZW)(cell,tab_service.X9).forEach((node=>node.tabIndex=newTabIndex)),cell.tabIndex=newTabIndex}}this.reset()}reset(){this.rowSubject.next({current:0,previous:-1}),this.columnSubject.next({current:0,previous:-1})}}!function(TableDomSpanDirection){TableDomSpanDirection.colSpan="colSpan",TableDomSpanDirection.rowSpan="rowSpan"}(TableDomSpanDirection||(TableDomSpanDirection={}));class TableDomAdapter{constructor(tableElement){this.tableElement=tableElement}get lastColumnIndex(){return this.getRealRowLength(this.tableElement.rows[0])}get lastRowIndex(){return this.tableElement.rows.length-1}getCell(row,column){const col=this.getColumn(column);return this.findCellInColumn(col,row).cell}getColumn(column){const firstHeader=Array.from(this.tableElement.rows[0].cells),{cell:header,realIndex:realColumnIndex}=this.findCellInRow(firstHeader,column),linkedCells=[];for(let i=1;i<this.tableElement.rows.length;i++){const linkedRowCells=this.tableElement.rows[i].querySelectorAll(`[headers~='${header.id}']`);if(linkedRowCells.length>1){const{cell}=this.findCellInRow(Array.from(linkedRowCells),column-realColumnIndex);linkedCells.push(cell)}else linkedRowCells[0]&&linkedCells.push(linkedRowCells[0])}return linkedCells?[header,...linkedCells]:[]}getRow(row){return this.tableElement.rows[row]}findColumnIndex(cell){const row=this.getRow(this.findRowIndex(cell));if(!row)return;if(cell&&cell.headers){const ids=cell.headers.split(" "),headerRows=Array.from(this.tableElement.tHead.rows),indexes=[];for(const headerRow of headerRows.reverse()){const headerCells=Array.from(headerRow.cells),header=headerCells.find((headerCell=>ids.includes(headerCell.id)));if(header){let cellIndex=0;for(const c of headerCells){if(c===header)break;cellIndex+=c.colSpan}indexes.push(cellIndex)}}const firstIndex=indexes.sort(((a,b)=>b-a))[0];let similarCells=[];for(const id of ids){const rowCells=Array.from(row.querySelectorAll(`[headers~='${id}']`));for(const rowCell of rowCells)similarCells.includes(rowCell)||similarCells.push(rowCell)}return similarCells=similarCells.sort(((a,b)=>a.cellIndex-b.cellIndex)),firstIndex+similarCells.indexOf(cell)}let cellIndex=0;for(const c of Array.from(row.cells)){if(c===cell)break;cellIndex+=c.colSpan}return cellIndex}findRowIndex(cell){for(const row of Array.from(this.tableElement.rows))if(row.contains(cell))return row.rowIndex}findIndex(cell){return[this.findRowIndex(cell),this.findColumnIndex(cell)]}getRealRowLength(row){return Array.from(row.cells).reduce(((count,cell)=>count+cell.colSpan),-1)}findCell(cells,targetIndex,spanDirection){let realIndex=0;for(let i=0;i<targetIndex&&(i+=cells[realIndex][spanDirection],!(i>targetIndex));)realIndex++;return{cell:cells[realIndex],realIndex}}findCellInRow(row,index){return this.findCell(row,index,TableDomSpanDirection.colSpan)}findCellInColumn(col,index){return this.findCell(col,index,TableDomSpanDirection.rowSpan)}}let Table=class Table{constructor(elementRef,applicationRef,i18n){this.elementRef=elementRef,this.applicationRef=applicationRef,this.i18n=i18n,this.size="md",this.skeleton=!1,this.sortable=!0,this.noBorder=!0,this.showExpandAllToggle=!1,this.showSelectionColumn=!0,this.enableSingleSelect=!1,this.scrollLoadDistance=0,this.striped=!0,this.tableContent=!0,this.stickyHeader=!1,this.sort=new core.EventEmitter,this.selectAll=new core.EventEmitter,this.deselectAll=new core.EventEmitter,this.selectRow=new core.EventEmitter,this.deselectRow=new core.EventEmitter,this.rowClick=new core.EventEmitter,this.scrollLoad=new core.EventEmitter,this.selectAllCheckbox=!1,this.selectAllCheckboxSomeSelected=!1,this.isColumnDragging=!1,this.columnDraggedHoverIndex=-1,this.columnDraggedPosition="",this._isDataGrid=!1,this.isViewReady=!1,this.subscriptions=new Subscription.w0,this._expandButtonAriaLabel=this.i18n.getOverridable("TABLE.EXPAND_BUTTON"),this._sortDescendingLabel=this.i18n.getOverridable("TABLE.SORT_DESCENDING"),this._sortAscendingLabel=this.i18n.getOverridable("TABLE.SORT_ASCENDING"),this._checkboxHeaderLabel=this.i18n.getOverridable("TABLE.CHECKBOX_HEADER"),this._checkboxRowLabel=this.i18n.getOverridable("TABLE.CHECKBOX_ROW"),this._endOfDataText=this.i18n.getOverridable("TABLE.END_OF_DATA"),this._scrollTopText=this.i18n.getOverridable("TABLE.SCROLL_TOP"),this._filterTitle=this.i18n.getOverridable("TABLE.FILTER")}static skeletonModel(rowCount,columnCount){const model=new table_model_class.G;let header=new Array,data=new Array,row=new Array;for(let i=0;i<columnCount;i++)header.push(new table_header_item_class.j),row.push(new table_item_class.r);for(let i=0;i<rowCount-1;i++)data.push(row);return model.header=header,model.data=data,model}static setTabIndex(element,index){const focusElementList=(0,tab_service.ZW)(element,tab_service.X9);element.firstElementChild&&element.firstElementChild.classList.contains("cds--table-sort")&&focusElementList.length>1?focusElementList[1].tabIndex=index:focusElementList.length>0?focusElementList[0].tabIndex=index:element.tabIndex=index}static focus(element){const focusElementList=(0,tab_service.ZW)(element,tab_service.X9);element.firstElementChild?.classList.contains("cds--table-sort")&&focusElementList.length>1||focusElementList.length>0?focusElementList[0].focus():element.focus()}set model(m){this._model&&(this.subscriptions.unsubscribe(),this.subscriptions=new Subscription.w0),this._model=m;const rowsChange=this._model.rowsSelectedChange.subscribe((()=>this.updateSelectAllCheckbox())),dataChange=this._model.dataChange.subscribe((()=>{this.isDataGrid&&this.resetTabIndex(),this.updateSelectAllCheckbox()}));if(this.subscriptions.add(rowsChange),this.subscriptions.add(dataChange),this.isDataGrid){const expandedChange=this._model.rowsExpandedChange.subscribe((()=>{setTimeout((()=>{const expandedRows=this.elementRef.nativeElement.querySelectorAll(".cds--expandable-row:not(.cds--parent-row)");Array.from(expandedRows).forEach((row=>{void 0!==row.firstElementChild.tabIndex&&-1===row.firstElementChild.tabIndex||(row.firstElementChild.tabIndex=-1)}))}))}));this.subscriptions.add(expandedChange)}}get model(){return this._model}set isDataGrid(value){this._isDataGrid=value,this.isViewReady&&(value?this.enableDataGridInteractions():this.disableDataGridInteractions())}get isDataGrid(){return this._isDataGrid}set expandButtonAriaLabel(value){this._expandButtonAriaLabel.override(value)}get expandButtonAriaLabel(){return this._expandButtonAriaLabel.value}set sortDescendingLabel(value){this._sortDescendingLabel.override(value)}get sortDescendingLabel(){return this._sortDescendingLabel.value}set sortAscendingLabel(value){this._sortAscendingLabel.override(value)}get sortAscendingLabel(){return this._sortAscendingLabel.value}set translations(value){const valueWithDefaults=(0,utils.TS)(this.i18n.getMultiple("TABLE"),value);this._filterTitle.override(valueWithDefaults.FILTER),this._endOfDataText.override(valueWithDefaults.END_OF_DATA),this._scrollTopText.override(valueWithDefaults.SCROLL_TOP),this._checkboxHeaderLabel.override(valueWithDefaults.CHECKBOX_HEADER),this._checkboxRowLabel.override(valueWithDefaults.CHECKBOX_ROW)}get noData(){return!this.model.data||0===this.model.data.length||1===this.model.data.length&&0===this.model.data[0].length}ngOnInit(){this.updateSelectAllCheckbox()}ngAfterViewInit(){this.isViewReady=!0,this.isDataGrid&&this.enableDataGridInteractions()}ngOnDestroy(){this.subscriptions.unsubscribe(),this.positionSubscription&&this.positionSubscription.unsubscribe()}enableDataGridInteractions(){if(this.interactionModel)return;const table=this.elementRef.nativeElement.querySelector("table"),tableAdapter=new TableDomAdapter(table),keydownEventStream=(0,fromEvent.R)(table,"keydown"),clickEventStream=(0,fromEvent.R)(table,"click");this.interactionModel=new DataGridInteractionModel(keydownEventStream,clickEventStream,tableAdapter),this.positionSubscription=this.interactionModel.position.subscribe((event=>{const[currentRow,currentColumn]=event.current,[previousRow,previousColumn]=event.previous,currentElement=tableAdapter.getCell(currentRow,currentColumn);if(Table.setTabIndex(currentElement,0),-1!==previousRow&&-1!==previousColumn){if(previousRow!==currentRow||previousColumn!==currentColumn){const previousElement=tableAdapter.getCell(previousRow,previousColumn);Table.setTabIndex(previousElement,-1)}Table.focus(currentElement)}})),this.resetTabIndex()}disableDataGridInteractions(){this.positionSubscription&&this.positionSubscription.unsubscribe(),this.resetTabIndex(0),this.interactionModel=null}onSelectAll(){this.model.selectAll(!0),this.selectAll.emit(this.model)}onDeselectAll(){this.model.selectAll(!1),this.deselectAll.emit(this.model)}onSelectRow(event){Object.keys(event).includes("selectedRowIndex")?(this.enableSingleSelect&&this.model.selectAll(!1),this.model.selectRow(event.selectedRowIndex,!0),this.selectRow.emit(event)):(this.model.selectRow(event.deselectedRowIndex,!1),this.deselectRow.emit(event))}onRowClick(index){this.rowClick.emit(index)}updateSelectAllCheckbox(){const selectedRowsCount=this.model.selectedRowsCount();selectedRowsCount<=0?(this.selectAllCheckbox=!1,this.selectAllCheckboxSomeSelected=!1):selectedRowsCount<this.model.data.length?(this.selectAllCheckbox=!0,this.selectAllCheckboxSomeSelected=!0):(this.selectAllCheckbox=!0,this.selectAllCheckboxSomeSelected=!1)}resetTabIndex(newTabIndex=-1){setTimeout((()=>{const focusElementList=(0,tab_service.ZW)(this.elementRef.nativeElement,tab_service.X9);focusElementList&&focusElementList.forEach((tabbable=>{tabbable.tabIndex=newTabIndex})),this.interactionModel&&this.interactionModel.resetTabIndexes(newTabIndex)}))}columnResizeStart(event,column){this.columnResizeWidth=parseInt(column.style.width,10),this.columnResizeMouseX=event.clientX,event.preventDefault(),this.mouseMoveSubscription=(0,fromEvent.R)(document.body,"mousemove").subscribe((event=>{this.columnResizeProgress(event,column)})),this.mouseUpSubscription=(0,fromEvent.R)(document.body,"mouseup").subscribe((event=>{this.columnResizeEnd(event,column)}))}columnResizeProgress(event,column){const move=event.clientX-this.columnResizeMouseX;column.style.width=`${this.columnResizeWidth+move}px`}columnResizeEnd(event,column){this.mouseMoveSubscription.unsubscribe(),this.mouseUpSubscription.unsubscribe()}onScroll(event){event.target.scrollHeight-event.target.clientHeight-event.target.scrollTop<=this.scrollLoadDistance?this.scrollLoad.emit(this.model):this.model.isEnd=!1}columnDragStart(event,columnIndex){this.isColumnDragging=!0,this.columnDraggedHoverIndex=columnIndex,event.dataTransfer.setData("columnIndex",JSON.stringify(columnIndex))}columnDragEnd(event,columnIndex){this.isColumnDragging=!1,this.columnDraggedHoverIndex=-1}columnDragEnter(event,position,columnIndex){this.columnDraggedPosition=position,this.columnDraggedHoverIndex=columnIndex}columnDragLeave(event,position,columnIndex){this.columnDraggedPosition=""}columnDragover(event,position,columnIndex){this.columnDraggedHoverIndex=columnIndex,this.columnDraggedPosition=position,event.preventDefault()}columnDrop(event,position,columnIndex){this.isColumnDragging=!1,this.columnDraggedHoverIndex=-1,this.columnDraggedPosition="",this.model.moveColumn(parseInt(event.dataTransfer.getData("columnIndex"),10),columnIndex+("right"===position?1:0))}doSort(index){0===this.sort.observers.length&&(this.model.cycleSortState(index),this.model.sort(index)),this.sort.emit(index)}scrollToTop(event){event.target.parentElement.parentElement.parentElement.parentElement.children[1].scrollTop=0,this.model.isEnd=!1}getSelectionLabelValue(row){return this.selectionLabelColumn?{value:row[this.selectionLabelColumn].data}:{value:this.i18n.get().TABLE.ROW}}getExpandButtonAriaLabel(){return this._expandButtonAriaLabel.subject}getSortDescendingLabel(){return this._sortDescendingLabel.subject}getSortAscendingLabel(){return this._sortAscendingLabel.subject}getCheckboxHeaderLabel(){return this._checkboxHeaderLabel.subject}getCheckboxRowLabel(){return this._checkboxRowLabel.subject}getEndOfDataText(){return this._endOfDataText.subject}getScrollTopText(){return this._scrollTopText.subject}getFilterTitle(){return this._filterTitle.subject}};Table.ctorParameters=()=>[{type:core.ElementRef},{type:core.ApplicationRef},{type:i18n.oc}],Table.propDecorators={ariaLabelledby:[{type:core.Input}],ariaDescribedby:[{type:core.Input}],model:[{type:core.Input}],size:[{type:core.Input}],skeleton:[{type:core.Input}],isDataGrid:[{type:core.Input}],sortable:[{type:core.Input}],noBorder:[{type:core.Input}],showExpandAllToggle:[{type:core.Input}],showSelectionColumn:[{type:core.Input}],enableSingleSelect:[{type:core.Input}],scrollLoadDistance:[{type:core.Input}],expandButtonAriaLabel:[{type:core.Input}],sortDescendingLabel:[{type:core.Input}],sortAscendingLabel:[{type:core.Input}],translations:[{type:core.Input}],striped:[{type:core.Input}],tableContent:[{type:core.HostBinding,args:["class.cds--data-table-content"]}],stickyHeader:[{type:core.HostBinding,args:["class.cds--data-table_inner-container"]},{type:core.Input}],footerTemplate:[{type:core.Input}],selectionLabelColumn:[{type:core.Input}],sort:[{type:core.Output}],selectAll:[{type:core.Output}],deselectAll:[{type:core.Output}],selectRow:[{type:core.Output}],deselectRow:[{type:core.Output}],rowClick:[{type:core.Output}],scrollLoad:[{type:core.Output}]},Table=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-table, ibm-table",template:'\n\t<table\n\t\tcdsTable\n\t\t[sortable]="sortable"\n\t\t[noBorder]="noBorder"\n\t\t[ngClass]="{\'cds--data-table--sticky-header\': stickyHeader}"\n\t\t[size]="size"\n\t\t[striped]="striped"\n\t\t[skeleton]="skeleton"\n\t\t[attr.aria-labelledby]="ariaLabelledby"\n\t\t[attr.aria-describedby]="ariaDescribedby">\n\t\t<thead\n\t\t\tcdsTableHead\n\t\t\t[sortable]="sortable"\n\t\t\t(deselectAll)="onDeselectAll()"\n\t\t\t(selectAll)="onSelectAll()"\n\t\t\t(expandAllRows)="model.expandAllRows(true)"\n\t\t\t(collapseAllRows)="model.expandAllRows(false)"\n\t\t\t(sort)="doSort($event)"\n\t\t\t[checkboxHeaderLabel]="getCheckboxHeaderLabel()"\n\t\t\t[filterTitle]="getFilterTitle()"\n\t\t\t[model]="model"\n\t\t\t[selectAllCheckbox]="selectAllCheckbox"\n\t\t\t[selectAllCheckboxSomeSelected]="selectAllCheckboxSomeSelected"\n\t\t\t[showSelectionColumn]="showSelectionColumn"\n\t\t\t[enableSingleSelect]="enableSingleSelect"\n\t\t\t[showExpandAllToggle]="showExpandAllToggle"\n\t\t\t[skeleton]="skeleton"\n\t\t\t[sortAscendingLabel]="sortAscendingLabel"\n\t\t\t[sortDescendingLabel]="sortDescendingLabel"\n\t\t\t[stickyHeader]="stickyHeader">\n\t\t</thead>\n\t\t<tbody\n\t\t\tcdsTableBody\n\t\t\t(deselectRow)="onSelectRow($event)"\n\t\t\t(scroll)="onScroll($event)"\n\t\t\t(selectRow)="onSelectRow($event)"\n\t\t\t[checkboxRowLabel]="getCheckboxRowLabel()"\n\t\t\t[enableSingleSelect]="enableSingleSelect"\n\t\t\t(rowClick)="onRowClick($event)"\n\t\t\t[expandButtonAriaLabel]="expandButtonAriaLabel"\n\t\t\t[model]="model"\n\t\t\t[size]="size"\n\t\t\t[ngStyle]="{\'overflow-y\': \'scroll\'}"\n\t\t\t[selectionLabelColumn]="selectionLabelColumn"\n\t\t\t[showSelectionColumn]="showSelectionColumn"\n\t\t\t[skeleton]="skeleton"\n\t\t\t*ngIf="!noData; else noDataTemplate">\n\t\t</tbody>\n\t\t<ng-template #noDataTemplate><ng-content></ng-content></ng-template>\n\t\t<tfoot>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]="footerTemplate">\n\t\t\t</ng-template>\n\t\t\t<tr *ngIf="this.model.isLoading">\n\t\t\t\t<td class="table_loading-indicator">\n\t\t\t\t\t<div class="cds--loading cds--loading--small">\n\t\t\t\t\t\t<svg class="cds--loading__svg" viewBox="-75 -75 150 150">\n\t\t\t\t\t\t\t<circle class="cds--loading__stroke" cx="0" cy="0" r="37.5" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr *ngIf="this.model.isEnd">\n\t\t\t\t<td class="table_end-indicator">\n\t\t\t\t\t<h5>{{getEndOfDataText() | async}}</h5>\n\t\t\t\t\t<button (click)="scrollToTop($event)" class="btn--secondary-sm">\n\t\t\t\t\t\t{{getScrollTopText() | async}}\n\t\t\t\t\t</button>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tfoot>\n\t</table>\n\t',styles:["\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t}\n\t"]})],Table);let TableContainer=class TableContainer{constructor(){this.containerClass=!0}ngAfterContentInit(){this.table&&(this.table.ariaLabelledby=this.headerTitle?.id,this.table.ariaDescribedby=this.headerDescription?.id)}};TableContainer.propDecorators={containerClass:[{type:core.HostBinding,args:["class.cds--data-table-container"]}],headerTitle:[{type:core.ContentChild,args:[TableHeaderTitle]}],headerDescription:[{type:core.ContentChild,args:[TableHeaderDescription]}],table:[{type:core.ContentChild,args:[Table]}]},TableContainer=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-table-container, ibm-table-container",template:"<ng-content></ng-content>",styles:["\n\t\t:host { display: block }\n\t"]})],TableContainer);let TableHeader=class TableHeader{constructor(){this.headerClass=!0,this.displayStyle="block"}};TableHeader.propDecorators={headerClass:[{type:core.HostBinding,args:["class.cds--data-table-header"]}],displayStyle:[{type:core.HostBinding,args:["style.display"]}]},TableHeader=(0,tslib_es6.gn)([(0,core.Component)({selector:"cds-table-header, ibm-table-header",template:"\n\t\t<ng-content></ng-content>\n\t"})],TableHeader);let TableHeadCellLabel=class TableHeadCellLabel{constructor(){this.baseClass=!0}};TableHeadCellLabel.propDecorators={baseClass:[{type:core.HostBinding,args:["class.cds--table-header-label"]}]},TableHeadCellLabel=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsTableHeadCellLabel], [ibmTableHeadCellLabel]"})],TableHeadCellLabel);let ExpandedRowHover=class ExpandedRowHover{addHoverClass(event){event.target.previousElementSibling.classList.add("cds--expandable-row--hover")}removeHoverClass(event){event.target.previousElementSibling.classList.remove("cds--expandable-row--hover")}};ExpandedRowHover.propDecorators={addHoverClass:[{type:core.HostListener,args:["mouseenter",["$event"]]}],removeHoverClass:[{type:core.HostListener,args:["mouseleave",["$event"]]}]},ExpandedRowHover=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsExpandedRowHover], [ibmExpandedRowHover]"})],ExpandedRowHover);let TableDirective=class TableDirective{constructor(){this.sortable=!0,this.noBorder=!0,this.striped=!1,this.skeleton=!1,this.size="md",this.tableClass=!0}get extraSmallSize(){return"xs"===this.size}get smallSize(){return"sm"===this.size}get mediumSize(){return"md"===this.size}get LargeSize(){return"lg"===this.size}get extraLargeSize(){return"xl"===this.size}};TableDirective.propDecorators={sortable:[{type:core.Input},{type:core.HostBinding,args:["class.cds--data-table--sort"]}],noBorder:[{type:core.Input},{type:core.HostBinding,args:["class.cds--data-table--no-border"]}],striped:[{type:core.Input},{type:core.HostBinding,args:["class.cds--data-table--zebra"]}],skeleton:[{type:core.Input},{type:core.HostBinding,args:["class.cds--skeleton"]}],size:[{type:core.Input}],tableClass:[{type:core.HostBinding,args:["class.cds--data-table"]}],extraSmallSize:[{type:core.HostBinding,args:["class.cds--data-table--xs"]}],smallSize:[{type:core.HostBinding,args:["class.cds--data-table--sm"]}],mediumSize:[{type:core.HostBinding,args:["class.cds--data-table--md"]}],LargeSize:[{type:core.HostBinding,args:["class.cds--data-table--lg"]}],extraLargeSize:[{type:core.HostBinding,args:["class.cds--data-table--xl"]}]},TableDirective=(0,tslib_es6.gn)([(0,core.Directive)({selector:"[cdsTable], [ibmTable]"})],TableDirective);let TableHead=class TableHead{constructor(i18n){this.i18n=i18n,this.showSelectionColumn=!0,this.enableSingleSelect=!1,this.selectAllCheckboxSomeSelected=!1,this.selectAllCheckbox=!1,this.skeleton=!1,this.stickyHeader=!1,this.showExpandAllToggle=!1,this.sortable=!0,this.sort=new core.EventEmitter,this.selectAll=new core.EventEmitter,this.deselectAll=new core.EventEmitter,this.expandAllRows=new core.EventEmitter,this.collapseAllRows=new core.EventEmitter,this.scrollbarWidth=0,this._checkboxHeaderLabel=this.i18n.getOverridable("TABLE.CHECKBOX_HEADER"),this._sortDescendingLabel=this.i18n.getOverridable("TABLE.SORT_DESCENDING"),this._sortAscendingLabel=this.i18n.getOverridable("TABLE.SORT_ASCENDING"),this._filterTitle=this.i18n.getOverridable("TABLE.FILTER")}set checkboxHeaderLabel(value){this._checkboxHeaderLabel.override(value)}get checkboxHeaderLabel(){return this._checkboxHeaderLabel.value}set sortDescendingLabel(value){this._sortDescendingLabel.override(value)}get sortDescendingLabel(){return this._sortDescendingLabel.value}set sortAscendingLabel(value){this._sortAscendingLabel.override(value)}get sortAscendingLabel(){return this._sortAscendingLabel.value}set filterTitle(value){this._filterTitle.override(value)}get filterTitle(){return this._filterTitle.value}ngAfterViewInit(){setTimeout((()=>{this.scrollbarWidth=(0,utils.np)()}))}onSelectAllCheckboxChange(){this.selectAllCheckbox||this.selectAllCheckboxSomeSelected?this.deselectAll.emit(this.model):this.selectAll.emit(this.model)}onExpandAllRowsChange(expand){expand?this.expandAllRows.emit(this.model):this.collapseAllRows.emit(this.model)}getCheckboxHeaderLabel(){return this._checkboxHeaderLabel.subject}getSortDescendingLabel(){return this._sortDescendingLabel.subject}getSortAscendingLabel(){return this._sortAscendingLabel.subject}getFilterTitle(){return this._filterTitle.subject}};TableHead.ctorParameters=()=>[{type:i18n.oc}],TableHead.propDecorators={model:[{type:core.Input}],showSelectionColumn:[{type:core.Input}],enableSingleSelect:[{type:core.Input}],selectAllCheckboxSomeSelected:[{type:core.Input}],selectAllCheckbox:[{type:core.Input}],skeleton:[{type:core.Input}],stickyHeader:[{type:core.Input}],showExpandAllToggle:[{type:core.Input}],sortable:[{type:core.Input}],checkboxHeaderLabel:[{type:core.Input}],sortDescendingLabel:[{type:core.Input}],sortAscendingLabel:[{type:core.Input}],filterTitle:[{type:core.Input}],sort:[{type:core.Output}],selectAll:[{type:core.Output}],deselectAll:[{type:core.Output}],expandAllRows:[{type:core.Output}],collapseAllRows:[{type:core.Output}]},TableHead=(0,tslib_es6.gn)([(0,core.Component)({selector:"[cdsTableHead], [ibmTableHead]",template:'\n\t<ng-container *ngIf="model">\n\t\t<tr>\n\t\t\t<th\n\t\t\t\tcdsTableHeadExpand\n\t\t\t\t*ngIf="model.hasExpandableRows()"\n\t\t\t\tscope="col"\n\t\t\t\t[showExpandAllToggle]="showExpandAllToggle"\n\t\t\t\t[ngClass]="{\'cds--table-expand-v2\': stickyHeader}"\n\t\t\t\t[id]="model.getId(\'expand\')"\n\t\t\t\t[expanded]="model.expandableRowsCount() === model.expandedRowsCount()"\n\t\t\t\t(expandedChange)="onExpandAllRowsChange($event)">\n\t\t\t</th>\n\t\t\t<th\n\t\t\t\t*ngIf="!skeleton && showSelectionColumn && enableSingleSelect"\n\t\t\t\tscope="col"\n\t\t\t\t[id]="model.getId(\'select\')">\n\t\t\t\t\x3c!-- add width 0; since the carbon styles don\'t seem to constrain this headers width --\x3e\n\t\t\t</th>\n\t\t\t<th\n\t\t\t\tcdsTableHeadCheckbox\n\t\t\t\t*ngIf="!skeleton && showSelectionColumn && !enableSingleSelect"\n\t\t\t\tscope="col"\n\t\t\t\t[checked]="selectAllCheckbox"\n\t\t\t\t[indeterminate]="selectAllCheckboxSomeSelected"\n\t\t\t\t[ariaLabel]="getCheckboxHeaderLabel()"\n\t\t\t\t[skeleton]="skeleton"\n\t\t\t\t[name]="model.getHeaderId(\'select\')"\n\t\t\t\t(change)="onSelectAllCheckboxChange()"\n\t\t\t\t[id]="model.getId(\'select\')">\n\t\t\t</th>\n\t\t\t<ng-container *ngFor="let column of model.header; let i = index">\n\t\t\t\t<th\n\t\t\t\t\t*ngIf="column && column.visible"\n\t\t\t\t\t[ngStyle]="column.style"\n\t\t\t\t\tcdsTableHeadCell\n\t\t\t\t\tscope="col"\n\t\t\t\t\t[class]="column.className"\n\t\t\t\t\t[sortable]="sortable"\n\t\t\t\t\t[skeleton]="skeleton"\n\t\t\t\t\t[id]="model.getId(i)"\n\t\t\t\t\t[column]="column"\n\t\t\t\t\t[filterTitle]="getFilterTitle()"\n\t\t\t\t\t[attr.colspan]="column.colSpan"\n\t\t\t\t\t[attr.rowspan]="column.rowSpan"\n\t\t\t\t\t(sort)="sort.emit(i)">\n\t\t\t\t</th>\n\t\t\t</ng-container>\n\t\t\t<th *ngIf="!skeleton && stickyHeader && scrollbarWidth"\n\t\t\t\tscope="col"\n\t\t\t\t[ngStyle]="{\'width\': scrollbarWidth + \'px\', \'padding\': 0, \'border\': 0}">\n\t\t\t\t\x3c!--\n\t\t\t\t\tScrollbar pushes body to the left so this header column is added to push\n\t\t\t\t\tthe title bar the same amount and keep the header and body columns aligned.\n\t\t\t\t--\x3e\n\t\t\t</th>\n\t\t</tr>\n\t</ng-container>\n\t<ng-content></ng-content>\n\t',styles:["\n\t\t.cds--table-expand-v2 {\n\t\t\tpadding-left: 2.5rem;\n\t\t}\n\t"]})],TableHead);let TableHeadCell=class TableHeadCell{constructor(i18n){this.i18n=i18n,this.skeleton=!1,this.sortable=!0,this.sort=new core.EventEmitter,this.theadAction=!1,this._sortDescendingLabel=this.i18n.getOverridable("TABLE.SORT_DESCENDING"),this._sortAscendingLabel=this.i18n.getOverridable("TABLE.SORT_ASCENDING"),this._filterTitle=this.i18n.getOverridable("TABLE.FILTER")}set sortDescendingLabel(value){this._sortDescendingLabel.override(value)}get sortDescendingLabel(){return this._sortDescendingLabel.value}set sortAscendingLabel(value){this._sortAscendingLabel.override(value)}get sortAscendingLabel(){return this._sortAscendingLabel.value}set filterTitle(value){this._filterTitle.override(value)}get filterTitle(){return this._filterTitle.value}ngOnChanges(){this.theadAction=!!this.column.filterTemplate||this.sort.observers.length>0}getSortDescendingLabel(){return this._sortDescendingLabel.subject.pipe(this.sortLabelMap())}getSortAscendingLabel(){return this._sortAscendingLabel.subject.pipe(this.sortLabelMap())}onClick(){this.skeleton||this.sort.emit()}sortLabelMap(){return(0,map.U)((str=>this.column.ariaSortLabel?this.column.ariaSortLabel:this.column.formatSortLabel?this.column.formatSortLabel(str,this.column.ariaSortLabel):`${this.column.data} - ${str}`))}};TableHeadCell.ctorParameters=()=>[{type:i18n.oc}],TableHeadCell.propDecorators={column:[{type:core.Input}],skeleton:[{type:core.Input}],sortable:[{type:core.Input}],sortDescendingLabel:[{type:core.Input}],sortAscendingLabel:[{type:core.Input}],filterTitle:[{type:core.Input}],sort:[{type:core.Output}],theadAction:[{type:core.HostBinding,args:["class.thead_action"]}]},TableHeadCell=(0,tslib_es6.gn)([(0,core.Component)({selector:"[cdsTableHeadCell], [ibmTableHeadCell]",template:'\n\t\t<button\n\t\t\tclass="cds--table-sort"\n\t\t\t*ngIf="sortable && this.sort.observers.length > 0 && column.sortable"\n\t\t\t[attr.aria-label]="(column.sorted && column.ascending ? getSortDescendingLabel() : getSortAscendingLabel()) | async"\n\t\t\taria-live="polite"\n\t\t\t[ngClass]="{\n\t\t\t\t\'cds--table-sort--active\': column.sorted,\n\t\t\t\t\'cds--table-sort--descending\': column.ascending\n\t\t\t}"\n\t\t\t(click)="onClick()">\n\t\t\t<span\n\t\t\t\tclass="cds--table-sort__flex"\n\t\t\t\t[title]="column.title"\n\t\t\t\ttabindex="-1">\n\t\t\t\t<div *ngIf="!skeleton && !column.template" cdsTableHeadCellLabel>\n\t\t\t\t\t{{column.data}}\n\t\t\t\t</div>\n\t\t\t\t<ng-template\n\t\t\t\t\t*ngIf="!skeleton && column.template"\n\t\t\t\t\t[ngTemplateOutlet]="column.template"\n\t\t\t\t\t[ngTemplateOutletContext]="{data: column.data}">\n\t\t\t\t</ng-template>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf="!skeleton"\n\t\t\t\t\tfocusable="false"\n\t\t\t\t\tpreserveAspectRatio="xMidYMid meet"\n\t\t\t\t\tstyle="will-change: transform;"\n\t\t\t\t\txmlns="http://www.w3.org/2000/svg"\n\t\t\t\t\tclass="cds--table-sort__icon"\n\t\t\t\t\twidth="16"\n\t\t\t\t\theight="16"\n\t\t\t\t\tviewBox="0 0 16 16"\n\t\t\t\t\taria-hidden="true">\n\t\t\t\t\t<path d="M12.3 9.3l-3.8 3.8V1h-1v12.1L3.7 9.3 3 10l5 5 5-5z"></path>\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf="!skeleton"\n\t\t\t\t\tfocusable="false"\n\t\t\t\t\tpreserveAspectRatio="xMidYMid meet"\n\t\t\t\t\tstyle="will-change: transform;"\n\t\t\t\t\txmlns="http://www.w3.org/2000/svg"\n\t\t\t\t\tclass="cds--table-sort__icon-unsorted"\n\t\t\t\t\twidth="16"\n\t\t\t\t\theight="16"\n\t\t\t\t\tviewBox="0 0 16 16"\n\t\t\t\t\taria-hidden="true">\n\t\t\t\t\t<path d="M13.8 10.3L12 12.1V2h-1v10.1l-1.8-1.8-.7.7 3 3 3-3zM4.5 2l-3 3 .7.7L4 3.9V14h1V3.9l1.8 1.8.7-.7z"></path>\n\t\t\t\t</svg>\n\t\t\t</span>\n\t\t</button>\n\t\t<div\n\t\t\tclass="cds--table-header-label"\n\t\t\t*ngIf="!skeleton && this.sort.observers.length === 0 || (this.sort.observers.length > 0 && !column.sortable) || !sortable">\n\t\t\t<span *ngIf="!column.template" [title]="column.data">\n\t\t\t\t<ng-container *ngIf="!skeleton">\n\t\t\t\t\t{{column.data}}\n\t\t\t\t</ng-container>\n\t\t\t</span>\n\t\t\t<ng-template\n\t\t\t\t[ngTemplateOutlet]="column.template" [ngTemplateOutletContext]="{data: column.data}">\n\t\t\t</ng-template>\n\t\t</div>\n\t'})],TableHeadCell);let TableHeadCheckbox=class TableHeadCheckbox{constructor(i18n){this.i18n=i18n,this.checked=!1,this.indeterminate=!1,this.skeleton=!1,this.name="select-all-"+TableHeadCheckbox.tableSelectAllCount++,this.change=new core.EventEmitter,this.hostClass=!0,this._ariaLabel=this.i18n.getOverridable("TABLE.CHECKBOX_HEADER")}set ariaLabel(value){this._ariaLabel.override(value)}get ariaLabel(){return this._ariaLabel.value}getAriaLabel(){return this._ariaLabel.subject}};TableHeadCheckbox.tableSelectAllCount=0,TableHeadCheckbox.ctorParameters=()=>[{type:i18n.oc}],TableHeadCheckbox.propDecorators={checked:[{type:core.Input}],indeterminate:[{type:core.Input}],skeleton:[{type:core.Input}],name:[{type:core.Input}],ariaLabel:[{type:core.Input}],change:[{type:core.Output}],hostClass:[{type:core.HostBinding,args:["class.cds--table-column-checkbox"]}]},TableHeadCheckbox=(0,tslib_es6.gn)([(0,core.Component)({selector:"[cdsTableHeadCheckbox], [ibmTableHeadCheckbox]",template:'\n\t\t<cds-checkbox\n\t\t\t*ngIf="!skeleton"\n\t\t\tinline="true"\n\t\t\t[name]="name"\n\t\t\t[checked]="checked"\n\t\t\t[indeterminate]="indeterminate"\n\t\t\t(checkedChange)="change.emit()"\n\t\t\t[hideLabel]="true">\n\t\t\t\t{{getAriaLabel() | async}}\n\t\t</cds-checkbox>\n\t',styles:["\n :host { width: 10px; }\n "]})],TableHeadCheckbox);let TableHeadExpand=class TableHeadExpand{constructor(i18n){this.i18n=i18n,this.hostClass=!0,this.showExpandAllToggle=!1,this.expanded=!1,this.expandedChange=new core.EventEmitter,this._ariaLabel=this.i18n.getOverridable("TABLE.EXPAND_ALL_BUTTON")}get previousValue(){return this.expanded?"collapsed":null}getAriaLabel(){return this._ariaLabel.subject}};TableHeadExpand.ctorParameters=()=>[{type:i18n.oc}],TableHeadExpand.propDecorators={hostClass:[{type:core.HostBinding,args:["class.cds--table-expand"]}],showExpandAllToggle:[{type:core.Input}],expanded:[{type:core.Input}],expandedChange:[{type:core.Output}],previousValue:[{type:core.HostBinding,args:["attr.data-previous-value"]}]},TableHeadExpand=(0,tslib_es6.gn)([(0,core.Component)({selector:"[cdsTableHeadExpand], [ibmTableHeadExpand]",template:'\n\t\t<button\n\t\t\t*ngIf="showExpandAllToggle"\n\t\t\tclass="cds--table-expand__button"\n\t\t\t[attr.aria-label]="getAriaLabel() | async"\n\t\t\t(click)="expandedChange.emit(!expanded)">\n\t\t\t<svg cdsIcon="chevron--right" size="16" class="cds--table-expand__svg"></svg>\n\t\t</button>\n\t\t<ng-container *ngIf="!showExpandAllToggle">\n\t\t\t<ng-content></ng-content>\n\t\t</ng-container>\n\t'})],TableHeadExpand);let TableBody=class TableBody{constructor(i18n){this.i18n=i18n,this.enableSingleSelect=!1,this.showSelectionColumn=!0,this.size="md",this.skeleton=!1,this.selectRow=new core.EventEmitter,this.deselectRow=new core.EventEmitter,this.rowClick=new core.EventEmitter,this._checkboxRowLabel=this.i18n.getOverridable("TABLE.CHECKBOX_ROW"),this._expandButtonAriaLabel=this.i18n.getOverridable("TABLE.EXPAND_BUTTON")}set expandButtonAriaLabel(value){this._expandButtonAriaLabel.override(value)}get expandButtonAriaLabel(){return this._expandButtonAriaLabel.value}set checkboxRowLabel(value){this._checkboxRowLabel.override(value)}get checkboxRowLabel(){return this._checkboxRowLabel.value}onRowCheckboxChange(index){this.model.isRowSelected(index)?this.deselectRow.emit({model:this.model,deselectedRowIndex:index}):this.selectRow.emit({model:this.model,selectedRowIndex:index})}onRowClick(index){this.rowClick.emit(index)}getCheckboxRowLabel(){return this._checkboxRowLabel.subject}getExpandButtonAriaLabel(){return this._expandButtonAriaLabel.subject}firstExpandedDataInRow(row){const found=row.find((d=>d.expandedData));return found?found.expandedData:found}shouldExpandAsTable(row){return row.some((d=>d.expandAsTable))}};TableBody.ctorParameters=()=>[{type:i18n.oc}],TableBody.propDecorators={model:[{type:core.Input}],enableSingleSelect:[{type:core.Input}],expandButtonAriaLabel:[{type:core.Input}],checkboxRowLabel:[{type:core.Input}],showSelectionColumn:[{type:core.Input}],size:[{type:core.Input}],selectionLabelColumn:[{type:core.Input}],skeleton:[{type:core.Input}],selectRow:[{type:core.Output}],deselectRow:[{type:core.Output}],rowClick:[{type:core.Output}]},TableBody=(0,tslib_es6.gn)([(0,core.Component)({selector:"[cdsTableBody], [ibmTableBody]",template:'\n\t\t<ng-container *ngIf="model">\n\t\t\t<ng-container *ngFor="let row of model.data; let i = index">\n\t\t\t\t<tr\n\t\t\t\t\tcdsTableRow\n\t\t\t\t\t[model]="model"\n\t\t\t\t\t[row]="row"\n\t\t\t\t\t[size]="size"\n\t\t\t\t\t[selected]="model.isRowSelected(i)"\n\t\t\t\t\t[expandable]="model.isRowExpandable(i)"\n\t\t\t\t\t[expanded]="model.isRowExpanded(i)"\n\t\t\t\t\t[checkboxLabel]="getCheckboxRowLabel()"\n\t\t\t\t\t[expandButtonAriaLabel]="getExpandButtonAriaLabel()"\n\t\t\t\t\t[showSelectionColumn]="showSelectionColumn"\n\t\t\t\t\t[enableSingleSelect]="enableSingleSelect"\n\t\t\t\t\t[skeleton]="skeleton"\n\t\t\t\t\t(selectRow)="onRowCheckboxChange(i)"\n\t\t\t\t\t(deselectRow)="onRowCheckboxChange(i)"\n\t\t\t\t\t(expandRow)="model.expandRow(i, !model.isRowExpanded(i))"\n\t\t\t\t\t(rowClick)="onRowClick(i)"\n\t\t\t\t\t*ngIf="!model.isRowFiltered(i)"\n\t\t\t\t\t[class]="(model.rowsClass[i] ? model.rowsClass[i] : null)"\n\t\t\t\t\t[ngClass]="{\n\t\t\t\t\t\t\'tbody_row--success\': !model.isRowSelected(i) && model.getRowContext(i) === \'success\',\n\t\t\t\t\t\t\'tbody_row--warning\': !model.isRowSelected(i) && model.getRowContext(i) === \'warning\',\n\t\t\t\t\t\t\'tbody_row--info\': !model.isRowSelected(i) && model.getRowContext(i) === \'info\',\n\t\t\t\t\t\t\'tbody_row--error\': !model.isRowSelected(i) && model.getRowContext(i) === \'error\'\n\t\t\t\t\t}">\n\t\t\t\t</tr>\n\t\t\t\t<tr\n\t\t\t\t\t*ngIf="model.isRowExpandable(i) && !shouldExpandAsTable(row) && !model.isRowFiltered(i)"\n\t\t\t\t\tcdsTableExpandedRow\n\t\t\t\t\tcdsExpandedRowHover\n\t\t\t\t\t[row]="row"\n\t\t\t\t\t[expanded]="model.isRowExpanded(i)"\n\t\t\t\t\t[skeleton]="skeleton">\n\t\t\t\t</tr>\n\t\t\t\t<ng-container\n\t\t\t\t\t*ngIf="model.isRowExpandable(i) && shouldExpandAsTable(row) && model.isRowExpanded(i) && !model.isRowFiltered(i)">\n\t\t\t\t\t<tr\n\t\t\t\t\t\t*ngFor="let expandedDataRow of firstExpandedDataInRow(row)"\n\t\t\t\t\t\tcdsTableRow\n\t\t\t\t\t\t[model]="model"\n\t\t\t\t\t\t[showSelectionColumnCheckbox]="false"\n\t\t\t\t\t\t[showSelectionColumn]="showSelectionColumn"\n\t\t\t\t\t\t[row]="expandedDataRow"\n\t\t\t\t\t\t[size]="size"\n\t\t\t\t\t\t[skeleton]="skeleton">\n\t\t\t\t\t</tr>\n\t\t\t\t</ng-container>\n\t\t\t</ng-container>\n\t\t</ng-container>\n\t\t<ng-content></ng-content>\n\t'})],TableBody);let TableRowComponent=class TableRowComponent{constructor(i18n){this.i18n=i18n,this.expanded=!1,this.expandable=!1,this.selected=!1,this.size="md",this.enableSingleSelect=!1,this.showSelectionColumn=!0,this.showSelectionColumnCheckbox=!0,this.skeleton=!1,this.selectRow=new core.EventEmitter,this.deselectRow=new core.EventEmitter,this.expandRow=new core.EventEmitter,this.rowClick=new core.EventEmitter,this._checkboxLabel=this.i18n.getOverridable("TABLE.CHECKBOX_ROW"),this._expandButtonAriaLabel=this.i18n.getOverridable("TABLE.EXPAND_BUTTON")}set expandButtonAriaLabel(value){this._expandButtonAriaLabel.override(value)}get expandButtonAriaLabel(){return this._expandButtonAriaLabel.value}set checkboxLabel(value){this._checkboxLabel.override(value)}get checkboxLabel(){return this._checkboxLabel.value}get selectedClass(){return this.selected}get parentRowClass(){return this.expandable}get expandableRowClass(){return this.expanded}get selectableClass(){return!1}get isParentRow(){return!!this.expandable||null}get isAccessible(){return this.enabl