Files
.Data
.vscode
Archive
Client
Server
Shared
Tests
Viewer
.vscode
ApiControllers
Controllers
Data
Models
Repositories
Services
Views
wwwroot
igniteui
css
js
extensions
i18n
modules
encoding
i18n
infragistics.barcode_core.js
infragistics.barcode_qrcodebarcode.js
infragistics.bulletgraph.js
infragistics.categorychart.js
infragistics.datachart_annotation.js
infragistics.datachart_category.js
infragistics.datachart_categorycore.js
infragistics.datachart_core.js
infragistics.datachart_domainChart.js
infragistics.datachart_extendedaxes.js
infragistics.datachart_extendedfinancial.js
infragistics.datachart_financial.js
infragistics.datachart_interactivity.js
infragistics.datachart_polar.js
infragistics.datachart_radial.js
infragistics.datachart_rangecategory.js
infragistics.datachart_scatter.js
infragistics.datachart_shape.js
infragistics.datachart_stacked.js
infragistics.datachart_verticalcategory.js
infragistics.datachart_visualdata.js
infragistics.datasource.js
infragistics.documents.core_core.js
infragistics.documents.core_openxml.js
infragistics.doughnutchart.js
infragistics.dv_core.js
infragistics.dv_dataseriesadapter.js
infragistics.dv_datasource.js
infragistics.dv_description.js
infragistics.dv_geo.js
infragistics.dv_geometry.js
infragistics.dv_interactivity.js
infragistics.dv_jquerydom.js
infragistics.dv_opd.js
infragistics.dv_visualdata.js
infragistics.dvcommonwidget.js
infragistics.excel_core.js
infragistics.excel_functions.js
infragistics.excel_serialization_biff8.js
infragistics.excel_serialization_openxml.js
infragistics.ext_collections.js
infragistics.ext_collectionsextended.js
infragistics.ext_core.js
infragistics.ext_io.js
infragistics.ext_text.js
infragistics.ext_threading.js
infragistics.ext_ui.js
infragistics.ext_web.js
infragistics.ext_xml.js
infragistics.financialchart.js
infragistics.funnelchart.js
infragistics.geographicmap_core.js
infragistics.gridexcelexporter.js
infragistics.legend.js
infragistics.lineargauge.js
infragistics.olap.js
infragistics.olapdatasource.doc.js
infragistics.olapflatdatasource.js
infragistics.olapxmladatasource.js
infragistics.piechart.js
infragistics.radialgauge.js
infragistics.radialmenu.js
infragistics.scheduler.core.js
infragistics.shapechart.js
infragistics.sparkline.js
infragistics.spreadsheet.js
infragistics.templating.js
infragistics.ui.barcode.js
infragistics.ui.basechart.js
infragistics.ui.bulletgraph.js
infragistics.ui.categorychart.js
infragistics.ui.chart.js
infragistics.ui.chart.template.js
infragistics.ui.chartlegend.js
infragistics.ui.colorpicker.js
infragistics.ui.colorpickersplitbutton.js
infragistics.ui.combo.js
infragistics.ui.dialog.js
infragistics.ui.doughnutchart.js
infragistics.ui.editors.js
infragistics.ui.financialchart.js
infragistics.ui.funnelchart.js
infragistics.ui.grid.appendrowsondemand.js
infragistics.ui.grid.cellmerging.js
infragistics.ui.grid.columnfixing.js
infragistics.ui.grid.columnmoving.js
infragistics.ui.grid.featurechooser.js
infragistics.ui.grid.filtering.js
infragistics.ui.grid.framework.js
infragistics.ui.grid.groupby.js
infragistics.ui.grid.hiding.js
infragistics.ui.grid.hierarchical.js
infragistics.ui.grid.multicolumnheaders.js
infragistics.ui.grid.paging.js
infragistics.ui.grid.resizing.js
infragistics.ui.grid.responsive.js
infragistics.ui.grid.rowselectors.js
infragistics.ui.grid.selection.js
infragistics.ui.grid.shared.js
infragistics.ui.grid.sorting.js
infragistics.ui.grid.summaries.js
infragistics.ui.grid.tooltips.js
infragistics.ui.grid.updating.js
infragistics.ui.htmleditor.js
infragistics.ui.layoutmanager.js
infragistics.ui.lineargauge.js
infragistics.ui.map.js
infragistics.ui.map.template.js
infragistics.ui.notifier.js
infragistics.ui.pivot.shared.js
infragistics.ui.pivotdataselector.js
infragistics.ui.pivotgrid.js
infragistics.ui.pivotview.js
infragistics.ui.popover.js
infragistics.ui.qrcodebarcode.js
infragistics.ui.radialgauge.js
infragistics.ui.radialmenu.js
infragistics.ui.rating.js
infragistics.ui.scheduler.core.js
infragistics.ui.scheduler.js
infragistics.ui.scroll.js
infragistics.ui.shapechart.js
infragistics.ui.shared.js
infragistics.ui.sparkline.js
infragistics.ui.splitbutton.js
infragistics.ui.splitter.js
infragistics.ui.spreadsheet.js
infragistics.ui.tilemanager.js
infragistics.ui.toolbar.js
infragistics.ui.toolbarbutton.js
infragistics.ui.tree.js
infragistics.ui.treegrid.columnfixing.js
infragistics.ui.treegrid.columnmoving.js
infragistics.ui.treegrid.filtering.js
infragistics.ui.treegrid.hiding.js
infragistics.ui.treegrid.js
infragistics.ui.treegrid.multicolumnheaders.js
infragistics.ui.treegrid.paging.js
infragistics.ui.treegrid.resizing.js
infragistics.ui.treegrid.rowselectors.js
infragistics.ui.treegrid.selection.js
infragistics.ui.treegrid.sorting.js
infragistics.ui.treegrid.tooltips.js
infragistics.ui.treegrid.updating.js
infragistics.ui.upload.js
infragistics.ui.validator.js
infragistics.ui.videoplayer.js
infragistics.ui.widget.js
infragistics.ui.zoombar.js
infragistics.ui.zoomslider.js
infragistics.undo.js
infragistics.util.jquery.js
infragistics.util.js
infragistics.xml.js
infragistics.zoomslider_core.js
infragistics.core.js
infragistics.dv.js
infragistics.excel-bundled.js
infragistics.loader.js
infragistics.lob.js
infragistics.scheduler-bundled.js
infragistics.spreadsheet-bundled.js
images
js
styles
ApiLoggingMiddleware.cs
OI.Metrology.Viewer.csproj
Program.cs
appsettings.Development.json
appsettings.json
compilerconfig.json
compilerconfig.json.defaults
.editorconfig
.gitignore
.groovy
Jenkinsfile
OI-Metrology.sln
README.md
azure-pipelines-client-development.yml
azure-pipelines-server-development.yml
package.json
oi-metrology/Viewer/wwwroot/igniteui/js/modules/infragistics.ui.grid.multicolumnheaders.js
Mike Phares b155863645 Added Viewer and
change to App Setting File from Constants
2022-07-27 10:47:57 -07:00

17 lines
13 KiB
JavaScript

/*!@license
* Infragistics.Web.ClientUI Grid Multi Headers 19.1.20
*
* Copyright (c) 2011-2019 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.9.1.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.ui.grid.framework.js
* infragistics.ui.shared.js
* infragistics.dataSource.js
* infragistics.util.js
*/
(function(factory){if(typeof define==="function"&&define.amd){define(["./infragistics.ui.grid.framework"],factory)}else{return factory(jQuery)}})(function($){$.widget("ui.igGridMultiColumnHeaders",$.ui.igWidget,{localeWidgetName:"igGridMultiColumnHeaders",css:{multiHeaderCell:"ui-iggrid-multiheader-cell",expandedHeaderIndicator:"ui-iggrid-multiheader-expanded",collapsedHeaderIndicator:"ui-iggrid-multiheader-collapsed",collapsibleIndicatorContainer:"ui-iggrid-indicatorcontainer ui-iggrid-collapsibleindicatorcontainer"},options:{inherit:false},events:{groupCollapsing:"groupCollapsing",groupCollapsed:"groupCollapsed",groupExpanding:"groupExpanding",groupExpanded:"groupExpanded"},_createWidget:function(){$.Widget.prototype._createWidget.apply(this,arguments)},changeLocale:function(){var self=this;this.grid.container().find("[data-expanded-state]").each(function(){self._changeLocaleForElement($(this))})},_registerWidget:$.noop,_unregisterWidget:$.noop,_renderingMultiColumnHeader:function(){this._renderHeaderColumns(this.grid._headerParent);this.grid._trigger(this.grid.events.headerRendered,null,{owner:this.grid,table:this.grid.headersTable()});this.grid._headerRenderCancel=false},_analyzeRowspanRows:function(oldCols,level){var i,col,groups=[],ml=this.grid._maxLevel-level,rowspan;for(i=0;i<oldCols.length;i++){rowspan=1;col=oldCols[i];col.rowspan=col.rowspan||col.rowSpan;if($.type(col.rowspan)==="string"){col.rowspan=parseInt(col.rowspan,10)}if(col.rowspan>0){rowspan=col.rowspan}if(col.group!==undefined&&col.group!==null){groups.push({group:col.group,level:level+rowspan})}else{if(col.level===0){if(col.rowspan===null||col.rowspan===undefined||isNaN(col.rowspan)){if(ml+1-col.level>0){col.rowspan=ml+1-col.level}}}}if(this._rows[ml]===undefined||this._rows[ml]===null){this._rows[ml]=[]}this._rows[ml].push(col)}for(i=0;i<groups.length;i++){this._analyzeRowspanRows(groups[i].group,groups[i].level)}},_renderRow:function(headerContainer,row,level){var col,i,$headerCell,$tr=$('<tr data-mch-level="'+level+'" role="row"></tr>').appendTo(headerContainer);for(i=0;i<row.length;i++){col=row[i];$headerCell=this._createHeaderColumnMarkup(col);$headerCell.appendTo($tr)}},_renderHeaderColumns:function($container){var $th,i,j,k,oldCols,parents,key,headersTable,parentCol,mchElement,$col,cols=this.grid.options.columns,mchChildren,isToHide,colsLength=cols.length,initHiddenCols=this.grid._initialHiddenColumns,gridId=this.grid.id(),$thead;this._arrayTargetRowspan=[];this._totalColumnsLength=$container.find("colgroup col").length;$thead=$container.find("thead");if($thead.length>0){$container=$thead.empty().attr("role","rowgroup")}else{$container=$('<thead role="rowgroup"></thead>').appendTo($container)}this._tr={};oldCols=this.grid._oldCols;this._rows={};this._analyzeRowspanRows(oldCols,0);for(i=this.grid._maxLevel;i>=0;i--){if(this._rows[i]!==null&&this._rows[i]!==undefined){this._renderRow($container,this._rows[i],i)}}for(i=0;i<colsLength;i++){$th=this.grid.container().find("#"+gridId+"_"+cols[i].key).data("columnIndex",i);$th.data("data-mch-order",i);this.grid._headerCells.push($th)}if(initHiddenCols){headersTable=this.grid.headersTable().find("thead");for(i=0;i<initHiddenCols.length;i++){key=initHiddenCols[i].key;this.grid.container().find("#"+gridId+"_"+key).css("display","none");$col=this.grid.headersTable().find(">colgroup>col").eq(this.grid.getVisibleIndexByKey(key,true));$col.remove();parents=this.grid._getParentsMultiHeader(key);for(j=0;j<parents.length;j++){parentCol=parents[j];if(parentCol.level>0){mchElement=this.grid._getMultiHeaderColumnById(parentCol.identifier);if(mchElement&&mchElement.children){mchChildren=mchElement.children;isToHide=true;if(mchElement.hidden!==true){for(k=0;k<mchChildren.length;k++){if(mchChildren[k].level===0){$th=this.grid.container().find("#"+gridId+"_"+mchChildren[k].key)}else{$th=headersTable.find("th[data-mch-id="+mchChildren[k].identifier+"]")}if(!$th.is(":visible")){isToHide=false;break}}}if(isToHide){headersTable.find("th[data-mch-id="+parentCol.identifier+"]").css("display","none")}}}}}}},_createHeaderColumnMarkup:function(col){var grid=this.grid,id,isMultiColumnHeader=true,headerClass=grid.css.headerClass,customClass=col.headerCssClass||"",$th=$("<th></th>"),$headerCell,childIds="",i,length;if(col.group){length=col.group.length;for(i=0;i<length;i++){childIds+=this.grid.element[0].id+"_"+col.group[i].key+(i===length-1?"":" ")}}else if(col.headerText===undefined){col.headerText=col.key}this._renderCollapsibleHeaderIndicator($th,col);$headerCell=$th.append('<span class="'+grid.css.headerTextClass+'">'+col.headerText+"</span>").attr({role:"columnheader","aria-label":col.headerText,tabIndex:grid.options.tabIndex}).addClass(headerClass).addClass(customClass);if(col.colspan>1){$th.attr("colspan",col.colspan)}if(col.rowspan>1){$headerCell.attr("rowspan",col.rowspan)}if(col.key){$headerCell.attr("id",this.grid.element[0].id+"_"+col.key)}if(col.level===0){id=col.key;isMultiColumnHeader=false;$headerCell.attr("data-isheadercell",true)}else{id=col.identifier;$headerCell.addClass(this.css.multiHeaderCell);$headerCell.attr("data-mch-id",col.identifier);if(childIds){$headerCell.attr("aria-owns",childIds)}}grid._trigger(grid.events.headerCellRendered,null,{owner:grid,th:$headerCell,columnKey:id,isMultiColumnHeader:isMultiColumnHeader});return $headerCell},_renderCollapsibleHeaderIndicator:function($th,col){var $container,$anchor,$button,self=this,shouldExpand=false,title;if(col&&col.groupOptions&&col.groupOptions.allowGroupCollapsing===true){shouldExpand=col.groupOptions.expanded===true;$container=$("<div></div>").addClass(self.css.collapsibleIndicatorContainer);title=shouldExpand?this._getLocaleValue("expandedColumnIconTooltip"):this._getLocaleValue("collapsedColumnIconTooltip");$anchor=$("<a></a>").attr("href","#").attr({title:title,"data-expanded-state":shouldExpand,"data-localeid":shouldExpand?"expandedColumnIconTooltip":"collapsedColumnIconTooltip","data-localeattr":"title"}).attr("tabindex",0).on({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._headerIndicatorClick(event)}}}).appendTo($container);$button=$("<span></span>").addClass(shouldExpand?this.css.expandedHeaderIndicator:this.css.collapsedHeaderIndicator).on({click:this._headerIndicatorClickHandler}).appendTo($anchor);$container.appendTo($th)}},expandGroup:function(groupKey,callback){this._setExpanded(groupKey,true,null,false,callback)},collapseGroup:function(groupKey,callback){this._setExpanded(groupKey,false,null,false,callback)},toggleGroup:function(groupKey,callback){this._setExpanded(groupKey,null,null,false,callback)},_setToggleButtonTooltip:function($button,expanded){var localeId=expanded?"expandedColumnIconTooltip":"collapsedColumnIconTooltip";$button.attr({title:this._getLocaleValue(localeId),"data-localeid":localeId,"data-expanded-state":expanded})},_setExpanded:function(groupKey,expanded,event,throwEvents,callback){var self=this,i,column,isExpanded,th,headerRows=self.grid.headersTable().find("thead > tr"),groupColumnsLength,noCancel,totalMchWidth=0,isFixedHeader=false,cw=this.grid.container().width(),fixing=this.grid.element.data("igGridColumnFixing");column=self.grid._getMultiHeaderColumnById(groupKey);if(!column||!column.groupOptions||column.groupOptions.allowGroupCollapsing===false||!column.group){return}isExpanded=column.groupOptions.expanded===true;if(isExpanded===expanded){return}if(this.grid.hasFixedColumns()){isFixedHeader=this.grid.fixedTable().find("th[data-mch-id='"+groupKey+"']").length?true:false;for(i=0;i<column.group.length;i++){totalMchWidth+=parseInt(column.group[i].width,10)}if(isFixedHeader){if(totalMchWidth>cw-fixing.options.minimalVisibleAreaWidth){throw new Error(this._getLocaleValue("cannotExpandMultiColumnHeader"))}}}if(expanded!==true&&expanded!==false){expanded=!isExpanded}th=headerRows.find("th[data-mch-id="+groupKey+"]");if(throwEvents===true){noCancel=self._trigger(expanded?self.events.groupExpanding:self.events.groupCollapsing,event,{owner:self,column:column,element:th});if(noCancel===false){return}}groupColumnsLength=column.group.length;self.grid._loadingIndicator.show();setTimeout(function(){column.groupOptions.expanded=!column.groupOptions.expanded;for(i=0;i<groupColumnsLength;i++){self._refreshMultiColumnHierarchyVisibility(column.group[i],column)}if(column.groupOptions.expanded){th.find("."+self.css.collapsedHeaderIndicator).removeClass(self.css.collapsedHeaderIndicator).addClass(self.css.expandedHeaderIndicator);self._setToggleButtonTooltip(th.find("[data-expanded-state]"),true)}else{th.find("."+self.css.expandedHeaderIndicator).removeClass(self.css.expandedHeaderIndicator).addClass(self.css.collapsedHeaderIndicator);self._setToggleButtonTooltip(th.find("[data-expanded-state]"),false)}self._updateHiddenColumns();if(throwEvents===true){self._trigger(column.groupOptions.expanded?self.events.groupExpanded:self.events.groupCollapsed,event,{owner:self,column:column,element:th})}self.grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback)}},0)},_headerIndicatorClick:function(event){var target=$(event.target),columnId=target.closest("th").attr("data-mch-id");this._setExpanded(columnId,null,event,true);event.preventDefault();event.stopPropagation()},_refreshMultiColumnHierarchyVisibility:function(col,parentCol){var i,parentAlowsGroupCollapsing=false,parentColExpanded=false,shouldHide=false;if(parentCol){parentAlowsGroupCollapsing=parentCol.groupOptions&&parentCol.groupOptions.allowGroupCollapsing===true;if(parentCol.groupOptions&&parentCol.groupOptions.expanded===false){parentColExpanded=false}else{parentColExpanded=true}}shouldHide=col.groupOptions&&(parentColExpanded===true&&(col.groupOptions.hidden==="always"||col.groupOptions.hidden==="parentexpanded")||parentColExpanded===false&&(col.groupOptions.hidden==="always"||col.groupOptions.hidden==="parentcollapsed"));if(parentCol&&parentAlowsGroupCollapsing&&shouldHide){if(col.group){for(i=0;i<col.children.length;i++){if(!col.children[i].hidden){this._colsToHide.push(col.children[i])}}}else{if(!col.hidden){this._colsToHide.push(col)}}}else{if(col.group){for(i=0;i<col.group.length;i++){this._refreshMultiColumnHierarchyVisibility(col.group[i],col)}}else{if(parentAlowsGroupCollapsing&&col.hidden){this._colsToShow.push(col)}}}},_validateGroup:function(col){var i,colsCountWhenExpanded,colsCountWhenCollapsed;if(!col.group){return}if(col.groupOptions&&col.groupOptions.allowGroupCollapsing===true){colsCountWhenExpanded=colsCountWhenCollapsed=0;for(i=0;i<col.group.length;i++){if(!col.group[i].groupOptions||col.group[i].groupOptions.hidden!=="always"&&col.group[i].groupOptions.hidden!=="parentexpanded"){colsCountWhenExpanded++}if(!col.group[i].groupOptions||col.group[i].groupOptions.hidden!=="always"&&col.group[i].groupOptions.hidden!=="parentcollapsed"){colsCountWhenCollapsed++}}if(colsCountWhenCollapsed===0||colsCountWhenExpanded===0){throw new Error(this._getLocaleValue("atLeastOneColumnShouldBeShownWhenCollapseOrExpand"))}}for(i=0;i<col.group.length;i++){this._validateGroup(col.group[i],col)}},_updateHiddenColumns:function(){this.grid._setHiddenColumns(this._colsToHide,true,false);this.grid._setHiddenColumns(this._colsToShow,false,false);this._colsToHide=[];this._colsToShow=[]},_gridRendered:function(){var i;if(!this.grid._oldCols){return}for(i=0;i<this.grid._oldCols.length;i++){this._validateGroup(this.grid._oldCols[i])}for(i=0;i<this.grid._oldCols.length;i++){this._refreshMultiColumnHierarchyVisibility(this.grid._oldCols[i],null)}this._updateHiddenColumns()},getMultiColumnHeaders:function(){return this.grid._oldCols},_createHandlers:function(){this._headerIndicatorClickHandler=$.proxy(this._headerIndicatorClick,this)},_injectGrid:function(gridInstance){this.grid=gridInstance;this._createHandlers();this._colsToHide=this._colsToHide||[];this._colsToShow=this._colsToShow||[];if(this.grid.options.virtualizationMode!=="continuous"&&(this.grid.options.virtualization===true&&this.grid.options.width||this.grid.options.columnVirtualization===true)){throw new Error(this._getLocaleValue("multiColumnHeadersNotSupportedWithColumnVirtualization"))}},destroy:function(){var collapsibleHeaderIcons=this.grid.headersTable().find("div."+this.css.collapsibleIndicatorContainer.split(" ").join("."));if(collapsibleHeaderIcons.length>0){collapsibleHeaderIcons.find("> a").off("keydown").find("> span").off("click");collapsibleHeaderIcons.remove()}this._superApply(arguments);return this}});$.extend($.ui.igGridMultiColumnHeaders,{version:"19.1.20"});return $});