Files
.Data
.vscode
Archive
Server
.vscode
ApiControllers
Controllers
Data
Models
Properties
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.Server.csproj
Program.cs
appsettings.Development.json
appsettings.json
compilerconfig.json
compilerconfig.json.defaults
Shared
Tests
View
.editorconfig
.gitignore
OI-Metrology.sln
README.md
azure-pipelines-server-development.yml
azure-pipelines-server.yml
package.json
oi-metrology/Server/wwwroot/igniteui/js/modules/infragistics.ui.splitbutton.js
2023-02-16 15:17:31 -07:00

18 lines
7.2 KiB
JavaScript

/*!@license
* Infragistics.Web.ClientUI SplitButton 19.1.20
*
* Copyright (c) 2011-2019 Infragistics Inc.
* <Licensing info>
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.9.1.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.util.js
* infragistics.util.jquery.js
* infragistics.ui.shared.js
* infragistics.ui.toolbarbutton.js
*/
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","jquery-ui","./infragistics.util","./infragistics.util.jquery","./infragistics.ui.toolbarbutton"],factory)}else{return factory(jQuery)}})(function($){$.widget("ui.igSplitButton",{options:{items:[{name:"button1",label:"Button 1",iconClass:"ui-icon-gear"}],defaultItemName:"button1",swapDefaultEnabled:false},events:{click:"click",expanded:"expanded",expanding:"expanding",collapsed:"collapsed",collapsing:"collapsing"},css:{container:"ui-splitbutton ui-widget ui-state-default",arrow:"ui-splitbutton-arrow",conrnersLeft:"ui-corner-left",conrnersRight:"ui-corner-right",hover:"ui-splitbutton-hover",active:"ui-state-active",focus:"ui-state-focus"},_id:function(id){return this.element[0].id+id},_renderDefaultBtn:function(){var options=this.options,defaultItem=this._getDefaultItem(options.defaultItemName);this._options.defaultButton=$('<div id="'+this._id("_"+options.defaultItemName)+'"></div>').appendTo(this.element).igToolbarButton({onlyIcons:true,labelText:"&nbsp;",title:defaultItem.label,icons:{primary:defaultItem.iconClass},name:options.defaultItemName,allowToggling:false}).addClass("ui-splitbutton-cleargaps "+this.css.conrnersLeft).removeClass("ui-corner-all")},_renderExpandBtn:function(){this._options.expandButton=$("<div id='"+this._id("_arrow")+"' class='"+this.css.arrow+"'></div>").igToolbarButton({onlyIcons:true,labelText:"&nbsp;",icons:{primary:"ui-icon-triangle-1-s"},allowToggling:false}).addClass("ui-splitbutton-cleargaps "+this.css.conrnersRight).removeClass("ui-corner-all").appendTo(this.element)},_setupElement:function(){this.element.addClass(this.css.container).attr("tabIndex",0)},_create:function(){this._options={defaultButton:null,expandButton:null,itemsList:null,isExpanded:false,justFocused:false};this._setupElement();this._renderDefaultBtn();this._renderExpandBtn();this._createItemsList();this._attachEvents()},_attachEvents:function(){var _opt=this._options;_opt.defaultButton.on("igtoolbarbuttonclick",$.proxy(this._onDefaultBtnClick,this));_opt.expandButton.on("focus",$.proxy(this._onExpandBtnFocus,this));_opt.expandButton.on("blur",$.proxy(this._onExpandBtnBlur,this));_opt.expandButton.on("igtoolbarbuttonclick",$.proxy(this._onExpandBtnClick,this));_opt.itemsList.on("igtoolbarbuttonclick","a",$.proxy(this._onItemClick,this));this.element.on("keypress",$.proxy(this._onEnterKeypress,this));this.element.hover($.proxy(this._onMouseEnter,this),$.proxy(this._onMouseLeave,this))},_onDefaultBtnClick:function(e){var self=this;e.stopPropagation();this._trigger(this.events.click,e,{name:self._options.defaultButton.igToolbarButton("option","name"),item:self.element})},_onExpandBtnClick:function(e){var _options=this._options;if(!_options.expandButton.is(":focus")){if(!_options.isExpanded){_options.expandButton.focus()}return}if(_options.justFocused){_options.justFocused=false}else{this.toggle(e)}},_onExpandBtnFocus:function(e){var noCancel;if(!this._options.isExpanded){noCancel=this._triggerExpanding(e);if(noCancel){this.expand(e);this._options.justFocused=true}}},_onExpandBtnBlur:function(e){var noCancel,self=this;if(this._options.isExpanded){setTimeout(function(){noCancel=self._triggerCollapsing(e);if(noCancel){self.collapse(e)}},150)}},_onItemClick:function(e){var $target=$(e.currentTarget);if(this.options.swapDefaultEnabled){this.switchToButton($target)}e.stopImmediatePropagation();this._trigger(this.events.click,e,{name:$target.igToolbarButton("option","name")})},_onEnterKeypress:function(e){if(e.which===$.ui.keyCode.ENTER){this.toggle(e)}},_onMouseEnter:function(){this.element.addClass(this.css.hover)},_onMouseLeave:function(){this.element.removeClass(this.css.hover)},_getDefaultItem:function(name){var options=this.options,i;for(i=0;i<options.items.length;i++){if(options.items[i].name===name){return options.items[i]}}},_createItemsList:function(){var list=$("<ul class='ui-splitbutton-list ui-menu ui-widget ui-widget-content ui-corner-all'></ul>"),options=this.options,i,item;for(i=0;i<options.items.length;i++){if(options.items[i].name!==options.defaultItemName){item=$('<a id="'+this._id("_"+options.items[i].name)+'" class="ui-corner-all" tabindex="-1"></a>').igToolbarButton({onlyIcons:true,labelText:"",title:options.items[i].label,icons:{primary:options.items[i].iconClass},name:options.items[i].name,allowToggling:false}).addClass("ui-splitbutton-cleargaps");$('<li class="ui-menu-item" role="menuitem"></li>').appendTo(list).append(item)}}this._options.itemsList=list.appendTo(this.element)},switchToButton:function(button){var defaultButton=this._options.defaultButton,targetButton=typeof button==="string"?$("#"+this._id("_"+button)):button,defBtnOpts=defaultButton.igToolbarButton("option"),defBtnId=defaultButton.attr("id"),targetBtnOpts=targetButton.igToolbarButton("option"),targetBtnId=targetButton.attr("id");targetButton.igToolbarButton("option",defBtnOpts).attr("id",defBtnId);defaultButton.igToolbarButton("option",targetBtnOpts).attr("id",targetBtnId).igToolbarButton("toggle")},_triggerCollapsing:function(){var args={owner:this};return this._trigger(this.events.collapsing,null,args)},_triggerCollapsed:function(){var args={owner:this};return this._trigger(this.events.collapsed,null,args)},_triggerExpanding:function(){var args={owner:this};return this._trigger(this.events.expanding,null,args)},_triggerExpanded:function(){var args={owner:this};return this._trigger(this.events.expanded,null,args)},widget:function(){return this.element},toggle:function(e){var noCancel,_options=this._options;if(_options.isExpanded){noCancel=this._triggerCollapsing(e);if(noCancel){this.collapse(e)}}else{noCancel=this._triggerExpanding(e);if(noCancel){this.expand(e)}}},collapse:function(e){var self=this,_opt=this._options,expandButton=_opt.expandButton;_opt.itemsList.hide(0,function(){self.element.removeClass(self.css.active);_opt.expandButton.removeClass(self.css.focus);_opt.isExpanded=false;if(e&&e.originalEvent){self._triggerCollapsed(e)}else if(expandButton.is(":focus")){expandButton.blur()}})},expand:function(e){var self=this,_opt=this._options,expandButton=_opt.expandButton;_opt.itemsList.show(0,function(){self.element.addClass(self.css.active);_opt.isExpanded=true;if(e&&e.originalEvent){self._triggerExpanded(e)}else if(!expandButton.is(":focus")){expandButton.focus()}})},destroy:function(){var _opt=this._options;$.Widget.prototype.destroy.apply(this,arguments);_opt.itemsList.off();this.element.find(":ui-igToolbarButton").igToolbarButton("destroy").end().off().removeClass(this.css.container).removeAttr("tabindex").empty();delete _opt.expandButton;delete _opt.itemsList},_setOption:function(key,value){var options=this.options,self=this;if(options[key]===value){return}this._superApply(arguments);switch(key){case"defaultItemName":var result=$("#"+self.element.attr("id")+"_"+value);if(result.length===1){self.switchToButton(result)}break}}});$.extend($.ui.igSplitButton,{version:"19.1.20"});return $});