<md-toolbar layout="row" class="md-toolbar-tools md-whiteframe-4dp small-toolbar" >
   	<h5 style="width:150px">Distinte banca</h5>
    	<div flex layout="row" ng-if="ctrl.largeScreen()" layout-align="space-between center">
    	
	     	<md-switch ng-if="ctrl.appVariables.profiloLocale!='DF'"  style="font-size:smaller"" ng-model="ctrl.filter.vistaGenerale"  ng-change="ctrl.getDistinte()"  ng-disabled="ctrl.ricercaInCorso" aria-label="Vista generale" >
	     		Vista generale
     		</md-switch>  
    	
<!--         
    		<md-checkbox ng-if="ctrl.appVariables.profiloLocale!='DF'" ng-model="ctrl.filter.vistaGenerale" style="font-size:smaller">Vista generale</md-checkbox>
-->    	
<!--  
    		
    	<h5 style="margin-left:16px;margin-right:8px">Tipologie:</h5>
        <md-select multiple ng-model="ctrl.tipologieSelezionate" ng-change="ctrl.aggiornaFiltro()" placeholder="Tipologie" flex style="color:white">
        	<md-option ng-repeat="tipologia in ctrl.filtriTipologie" ng-value="tipologia.id">{{tipologia.label}}</md-option>
        </md-select>
        
	     	
	     	<md-select ng-model="ctrl.filter.provenienza" style="margin-left:8px;margin-top:26px;font-size:smaller">
		     	<md-option></md-option>
				<md-option ng-repeat="item in ctrl.provenienza" value="{{item}}">{{item}}</md-option>
	     	</md-select>
 -->    	    	
 
			 <span flex></span>
	     	<md-switch style="font-size:smaller"" ng-model="ctrl.filteredView"  ng-change="ctrl.eseguiRicerca()"  ng-disabled="ctrl.ricercaInCorso" aria-label="Attiva filtri" >
	     		<span ng-if="ctrl.filteredView">Disattiva filtro</span><span ng-if="!ctrl.filteredView">Attiva filtro</span>
     		</md-switch>  
     		<md-button ng-if="ctrl.filteredView" ng-click="ctrl.visualizzaFiltro()" style="text-align:center;white-space:normal"  layout="row" layout-align="center center" tooltip="Visualizza filtro">
	 				<md-icon md-font-icon="fa fa-filter" class="fa"></md-icon>
 				</md-button>
	     </div>
	     
    <md-menu md-offset="0 50" ng-if="!largeScreen()" style="margin-top: -8px;">
        <md-button aria-label="menu" class="md-icon-button" ng-click="ctrl.openMenu($mdMenu,$event)">
        	<md-icon  md-font-icon="fa-ellipsis-v" class="fa"></md-icon>
      		<md-tooltip>Opzioni</md-tooltip>      		
        </md-button>
		<md-menu-content width="4">
	        <md-checkbox ng-if="ctrl.appVariables.profiloLocale!='DF'" ng-model="ctrl.filter.vistaGenerale">Vista generale</md-checkbox>
<!-- 
	        
	         <md-select multiple ng-model="ctrl.tipologieSelezionate" ng-change="ctrl.aggiornaFiltro()"  placeholder="Tipologie">
	        	<md-option value="sdd">SDD</md-option>
	        	<md-option value="seda">SEDA</md-option>
	        	<md-option value="sct">SCT</md-option>
	        	<md-option value="dom">DOM</md-option>
	        	<md-option value="sct_int">SCT INT</md-option>
	        	<md-option value="sct_inps">SCT INPS</md-option>
	        	<md-option value="sdd_esteri">SCT ESTERI</md-option>
	        	<md-option value="assegni_intesa">Assegni Intesa</md-option>
	        </md-select>
-->

			<span flex></span>
	     	<md-switch style="font-size:smaller"" ng-model="ctrl.filteredView"  ng-change="ctrl.eseguiRicerca($event)"  ng-disabled="ctrl.ricercaInCorso" aria-label="Attiva filtri" >
	     		<span ng-if="ctrl.filteredView">Disattiva filtro</span><span ng-if="!ctrl.filteredView">Attiva filtro</span>
     		</md-switch>  
     	</md-menu-content>
	</md-menu>
 </md-toolbar>
 
 <div layout="row" flex="100" style="width:100%;overflow:scroll">
 	<md-list id="list" flex >
 		<md-subheader layout="row" style="width:2104px">
 			<div flex="100" layout="row" id="header" ng-if="ctrl.largeScreen()">
 				<span style="width:20px" ng-if="ctrl.largeScreen()">&nbsp;</span>
	 		 	<md-button ng-click="ctrl.setOrderField('iddistintaBanca')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(0)" layout="row" layout-align="center center">
	 				Dist.
	 				<md-icon md-font-icon="fa fa-sort" class="fa"></md-icon>
 				</md-button>
		 		<md-button ng-click="ctrl.setOrderField('tipologiaDbgrid')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(1)" layout="row" layout-align="center center">
		 			Tipologia
		 			<md-icon md-font-icon="fa fa-sort" class="fa"></md-icon>
	 			</md-button>
		 		
		 		<md-button ng-click="ctrl.setOrderField('codiceAbiOrdinante')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(2)" layout="row" layout-align="center center">
		 			ABI
		 			<md-icon md-font-icon="fa fa-sort" class="fa"></md-icon>
		 		</md-button>
		 		<md-button ng-click="ctrl.setOrderField('cabOrdinante')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(3)" layout="row" layout-align="center center">
		 			CAB
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('contoOrdinante')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(4)" layout="row "layout-align="center center">
		 			Conto
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('dataValutaDestinatario')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(5)" layout="row" layout-align="center center">
		 			Valuta benef.
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('statoDistinta')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(6)" layout="row" layout-align="center center">
		 			Stato distinta
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('numeroDisposizioni')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(7)" layout="row" layout-align="center center">
		 			N. disp<md-tooltip>Numero disposizioni nella distinta</md-tooltip>		
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('importoDisposizioni')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(8)" layout="row" layout-align="center center">
		 			Importo
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('dataCreazione')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(9)" layout="row" layout-align="center center">
		 			Creazione
		 			<i class="fa fa-sort"></i>
	 			</md-button>
				<md-button ng-click="ctrl.setOrderField('requiresFirmatario')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(10)" layout="row" layout-align="center center">
		 			Rich, firma
		 			<i class="fa fa-sort"></i>
		 		</md-button>
		 		<md-button ng-click="ctrl.setOrderField('flagChiusuraPartitaSep')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(12)" layout="row" layout-align="center center">
		 			Exp. TASC
		 			<i class="fa fa-sort"></i>
	 			</md-button>
		 		<md-button ng-click="ctrl.setOrderField('nomeSupportoCBI')" style="text-align:center;white-space:normal" ng-style="ctrl.getColumnWidth(13)" layout="row" layout-align="center center">
		 			Nome supporto
		 			<i class="fa fa-sort"></i>
	 			</md-button>
		 		<md-button ng-click="ctrl.setOrderField('msgId')" style="text-align:center!important;white-space:normal" ng-style="ctrl.getColumnWidth(14)" layout="row" layout-align="center center">
		 			Payment information ID
		 			<i class="fa fa-sort"></i>
	 			</md-button>
 			</div>
 			
 			<!--  small screen headers -->
 			<div flex="100" layout="column" id="header" ng-if="!ctrl.largeScreen()">
 				<div flex="100" layout="row" >
		 		 	<a href="" layout="row" ng-click="ctrl.setOrderField('iddistintaBanca')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(0)">
		 				Dist.
		 				<md-icon md-font-icon="fa fa-sort" class="fa"></md-icon>
	 				</a>
			 		<a href=""  ng-click="ctrl.setOrderField('tipologiaDbgrid')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(1)">
			 			Tipologia
			 			<md-icon md-font-icon="fa fa-sort" class="fa"></md-icon>
		 			</a>
					<a href=""  ng-click="ctrl.setOrderField('numeroDisposizioni')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(7)" layout="row">
			 			N. disp<md-tooltip>Numero disposizioni nella distinta</md-tooltip>		
			 			<i class="fa fa-sort"></i>
		 			</a>
			 		<a href=""   ng-click="ctrl.setOrderField('codiceAbiOrdinante')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(2)" layout="row">
			 			ABI
			 			<md-icon md-font-icon="fa fa-sort" class="fa"></md-icon>
			 		</a>
			 		<a href=""   ng-click="ctrl.setOrderField('cabOrdinante')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(3)" layout="row" layout-align="center center">
			 			CAB
			 			<i class="fa fa-sort"></i>
		 			</s>
					<a href=""   ng-click="ctrl.setOrderField('contoOrdinante')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(4)" layout="row "layout-align="center center">
			 			Conto
			 			<i class="fa fa-sort"></i>
		 			</a>
					<a href=""   ng-click="ctrl.setOrderField('dataValutaDestinatario')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(5)" layout="row" layout-align="center center">
			 			Valuta benef.
			 			<i class="fa fa-sort"></i>
		 			</a>
					<a href=""   ng-click="ctrl.setOrderField('requiresFirmatario')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(10)" layout="row" layout-align="center center">
			 			Rich, firma
			 			<i class="fa fa-sort"></i>
			 		</a>
			 		<a href=""   ng-click="ctrl.setOrderField('flagChiusuraPartitaSep')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(12)" layout="row" layout-align="center center">
			 			Exp. TASC
			 			<i class="fa fa-sort"></i>
		 			</a>
			 		<a href=""   ng-click="ctrl.setOrderField('nomeSupportoCBI')" style="text-align:left!important" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(13)" layout="row" layout-align="center center">
			 			Nome supporto
			 			<i class="fa fa-sort"></i>
		 			</a>
			 		<a href=""   ng-click="ctrl.setOrderField('msgId')" style="text-align:left!important" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(14)" layout="row" layout-align="center center">
			 			Payment information ID
			 			<i class="fa fa-sort"></i>
		 			</a>
	 			</div>
	 			<div flex="100" layout="row" >
					<a href="" ng-click="ctrl.setOrderField('statoDistinta')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(6)" layout="row">
			 			Stato
			 			<i class="fa fa-sort"></i>
		 			</a>
					<a href="" ng-click="ctrl.setOrderField('dataCreazione')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(9)" layout="row" >
			 			Creazione
			 			<i style="text-align_right" class="fa fa-sort"></i>
		 			</a>
					<a href="" layout="row" ng-click="ctrl.setOrderField('importoDisposizioni')" class="small-screen-col-title" ng-style="ctrl.getColumnWidth(8)">
			 			Importo
			 			<i style="text-align_right" class="fa fa-sort"></i>
		 			</a>
	 			</div>
 			</div> 			
		</md-subheader>
 		
		<div class="virtualRepeatVerticalUsage" id="container" ng-style="ctrl.getListHeight()" ng-style="ctrl.getMaxListWidth()">
			<md-virtual-repeat-container id="vertical-container" ng-style="ctrl.getMaxListWidth()">
			     <div class="md-1-line hilight"  md-on-demand md-virtual-repeat="data in ctrl.infiniteItems" layout="row" md-item-size="25" a-style="margin-left:30px" ng-style="ctrl.getMaxListWidth()"  md-top-index="ctrl.topIndex">
				     <div ng-if="ctrl.largeScreen()" class="md-1-line hilight" ng-style="ctrl.getGridItemHeight()" layout="row"   
				     		ng-class="{'odd-row':$index%2==1,'even-row':$index%2==0, 'selectedRow': ctrl.selectedIndex===$index,
				     					'distinta-predisposta':data.statoDistinta=='Predisposta',
							     		'distinta-autorizzata':data.statoDistinta=='Autorizzata',
				     					'distinta-annullata':data.statoDistinta=='Annullata',
				     					'distinta-in-generazione':data.statoDistinta=='In Generazione',
				     					'distinta-disposta':data.statoDistinta=='Disposta',
				     					'distinta-validata':data.statoDistinta=='Validata',
				     					'distinta-inviata':data.statoDistinta=='Inviata',
				     					'distinta-scartata':data.statoDistinta=='Scartata'}"
				     		 layout-align="start center"  
				     		 ng-click="ctrl.showCommands(data, $index, $event)"><!-- ng-click="ctrl.setSelected($index)" -->
						<div style="width:0" ng-style="ctrl.getGridItemHeight()"></div>
				     	<div ng-style="ctrl.getColumnWidth(0)" style="text-align:right"><span >{{data.iddistintaBanca}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(1)" style="text-align:center"><span >{{data.tipologiaDbgrid}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(2)" style="text-align:center"><span >{{data.codiceAbiOrdinante}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(3)" style="text-align:center"><span >{{data.cabOrdinante}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(4)" style="text-align:center"><span >{{data.contoOrdinante}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(5)" style="text-align:center"><span >{{data.dataValutaDestinatario.formatAsDate()}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(6)" 	ng-class="{ 'distinta-autorizzata':data.statoDistinta=='Autorizzata',
				     					'distinta-predisposta':data.statoDistinta=='Predisposta',
				     					'distinta-annullata':data.statoDistinta=='Annullata',
				     					'distinta-in-generazione':data.statoDistinta=='In Generazione',
				     					'distinta-disposta':data.statoDistinta=='Disposta',
				     					'distinta-validata':data.statoDistinta=='Validata',
				     					'distinta-inviata':data.statoDistinta=='Inviata',
				     					'distinta-scartata':data.statoDistinta=='Scartata'}">
		     					<span >{{data.statoDistinta}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(7)" style="text-align:right"><span>{{data.numeroDisposizioni}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(8)" style="text-align:right"><span>{{data.importoDisposizioni}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(9)" style="text-align:center"><span >{{data.dataCreazione.formatAsDate()}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(10)" style="text-align:center"><span ><i class="fa fa-check" ng-if="data.requiresFirmatario==1"></i></span></div>
				     	<div ng-style="ctrl.getColumnWidth(12)" style="text-align:center"><span><i class="fa fa-check" ng-if="data.flagChiusuraPartitaSep"></i></span></div>
				     	<div ng-style="ctrl.getColumnWidth(13)"><span >{{data.nomeSupportoCBI}}</span></div>
				     	<div ng-style="ctrl.getColumnWidth(14)"><span >{{data.msgId}}</span></div>
				     </div>
				     
				     <!-- small screen layout --> 
				     
				     <div ng-if="!ctrl.largeScreen()" class="hilight" ng-style="ctrl.getGridItemHeight()" layout="column"   
				     		ng-class="{'odd-row':$index%2==1,'even-row':$index%2==0, 'selectedRow': ctrl.selectedIndex===$index,
				     		 'distinta-autorizzata':data.statoDistinta=='Autorizzata',
				     					'distinta-predisposta':data.statoDistinta=='Predisposta',
				     					'distinta-annullata':data.statoDistinta=='Annullata',
				     					'distinta-in-generazione':data.statoDistinta=='In Generazione',
				     					'distinta-disposta':data.statoDistinta=='Disposta',
				     					'distinta-validata':data.statoDistinta=='Validata',
				     					'distinta-inviata':data.statoDistinta=='Inviata',
				     					'distinta-scartata':data.statoDistinta=='Scartata'}"
				     		 	  
				     		 	ng-click="ctrl.showCommands(data, $index, $event)">
				     		<div layout="row" style="height:20px">
						     	<div ng-style="ctrl.getColumnWidth(0)" style="text-align:right"><span >{{data.iddistintaBanca}}</span></div>
						     	<div ng-style="ctrl.getColumnWidth(1)" style="text-align:center"><span >{{data.tipologiaDbgrid}}</span></div>
						     	<div ng-style="ctrl.getColumnWidth(7)" style="text-align:right"><span>{{data.numeroDisposizioni}}</span></div>
						     	<div ng-style="ctrl.getColumnWidth(2)" style="text-align:center"><span >{{data.codiceAbiOrdinante}}</span></div>
						     	<div ng-style="ctrl.getColumnWidth(3)" style="text-align:center"><span >{{data.cabOrdinante}}</span></div>
						     	<div ng-style="ctrl.getColumnWidth(4)" style="text-align:center"><span >{{data.contoOrdinante}}</span></div>
						     	<div ng-style="ctrl.getColumnWidth(5)" style="text-align:center"><span >{{data.dataValutaDestinatario.formatAsDate()}}</span></div>
						     	<div ng-style="ctrl.getColumnWidth(10)" style="text-align:center"><span ><i class="fa fa-check" ng-if="data.requiresFirmatario==1"></i></span></div>
						     	<div ng-style="ctrl.getColumnWidth(12)" style="text-align:center"><span><i class="fa fa-check" ng-if="data.flagChiusuraPartitaSep"></i></span></div>
						     	<div ng-style="ctrl.getColumnWidth(13)"><span >{{data.nomeSupportoCBI}}</span></div>
						     	<div ng-style="ctrl.getColumnWidth(14)"><span >{{data.msgId}}</span></div>
					     	</div>
	   				     	<div layout="row" style="height:20px">
						     	<div ng-style="ctrl.getColumnWidth(6)"><span>{{data.statoDistinta}}</span></div>
				     			<div ng-style="ctrl.getColumnWidth(9)" style="text-align:center"><span >{{data.dataCreazione.formatAsDate()}}</span></div>
   				     			<div ng-style="ctrl.getColumnWidth(8)" style="text-align:right"><span>{{data.importoDisposizioni}}</span></div>
				   			</div>
			   		</div>
			   	</div>	
			   	
		     </md-virtual-repeat-container>
	     </div>
			 	
 	</md-list>
	<nav mfb-menu position="br" effect="zoomin" label="Azioni" active-icon="fa fa-arrow-down" resting-icon="fa fa-bars" toggling-method="hover">
	 	<button mfb-button icon="fa fa-arrows-alt" label="Estrai distinta" ng-if="ctrl.isNotDelegatoFirma()" ng-click="ctrl.espandiDistinta()"></button>
		<button mfb-button icon="fa fa-print" label="Stampa distinta" ng-click="ctrl.stampaDistinta()"></button>
		<button mfb-button icon="fa fa-file-excel-o" label="Esporta distinte banca -> TASC" ng-click="ctrl.exportDistinte(null, $event)" ng-disabled="ctrl.selectedIndex===-1"></button>
	</nav> 
</div>
 
