<!--
  Licensed to the Apache Software
	Foundation (ASF) under one or more contributor license agreements. See the
	NOTICE file distributed with this work for additional information regarding
	copyright ownership. The ASF licenses this file to You under the Apache License,
	Version 2.0 (the "License"); you may not use this file except in compliance
	with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software distributed
	under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
	OR CONDITIONS OF ANY KIND, either express or implied. See the License for
  the specific language governing permissions and limitations under the License.
-->
<div class='wrapper'>
    <div class="mrow">
        <div class="group mr-2"> Group By </div>
        <div class='container col mx-0 px-0' [dragula]='"group-bag"' [dragulaModel]='data' [dragulaOptions]="{direction: 'horizontal', removeOnSpill: false, ignoreInputTextSelection: false}">
            <div #dragEle class="group-by-items" *ngFor="let group of data" (click)="selectGroup(group)" [attr.data-name]="group.name"
                 data-animation="false" data-toggle="tooltip" data-placement="bottom" title="Drag to Sort"
                 [ngClass]="{'active': group.selected}">
                <div *ngIf="group.count <= maxGroupCount" class="count"> {{ group.count | number }}</div>
                <div *ngIf="group.count > maxGroupCount" class="count"> {{ maxGroupCount | number }} <sup>+</sup> </div>
                <div class="name"> {{ group.name | columnNameTranslate | centerEllipses:15 }}</div>
            </div>
        </div>
        <div class="ungroup ml-2" [ngClass]="{'disabled': !groupSelected}" (click)="unGroup()"><span class="ungroup-button"> UnGroup </span></div>
    </div>
</div>
