UNPKG

primeng

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Join the chat at https://gitter.im/primefaces/primeng](https://badges.gitter.im/primefaces/primeng.svg)](https://gitter.im/primefaces/primeng?ut

608 lines 33.3 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); var core_1 = require("@angular/core"); var common_1 = require("@angular/common"); var button_1 = require("../button/button"); var shared_1 = require("../common/shared"); var domhandler_1 = require("../dom/domhandler"); var objectutils_1 = require("../utils/objectutils"); var PickList = /** @class */ (function () { function PickList(el, domHandler, objectUtils) { this.el = el; this.domHandler = domHandler; this.objectUtils = objectUtils; this.trackBy = function (index, item) { return item; }; this.showSourceFilter = true; this.showTargetFilter = true; this.metaKeySelection = true; this.showSourceControls = true; this.showTargetControls = true; this.disabled = false; this.onMoveToSource = new core_1.EventEmitter(); this.onMoveAllToSource = new core_1.EventEmitter(); this.onMoveAllToTarget = new core_1.EventEmitter(); this.onMoveToTarget = new core_1.EventEmitter(); this.onSourceReorder = new core_1.EventEmitter(); this.onTargetReorder = new core_1.EventEmitter(); this.onSourceSelect = new core_1.EventEmitter(); this.onTargetSelect = new core_1.EventEmitter(); this.selectedItemsSource = []; this.selectedItemsTarget = []; this.SOURCE_LIST = -1; this.TARGET_LIST = 1; } PickList.prototype.ngAfterContentInit = function () { var _this = this; this.templates.forEach(function (item) { switch (item.getType()) { case 'item': _this.itemTemplate = item.template; break; default: _this.itemTemplate = item.template; break; } }); }; PickList.prototype.ngAfterViewChecked = function () { if (this.movedUp || this.movedDown) { var listItems = this.domHandler.find(this.reorderedListElement, 'li.ui-state-highlight'); var listItem = void 0; if (this.movedUp) listItem = listItems[0]; else listItem = listItems[listItems.length - 1]; this.domHandler.scrollInView(this.reorderedListElement, listItem); this.movedUp = false; this.movedDown = false; this.reorderedListElement = null; } }; PickList.prototype.onItemClick = function (event, item, selectedItems, callback) { if (this.disabled) { return; } var index = this.findIndexInSelection(item, selectedItems); var selected = (index != -1); var metaSelection = this.itemTouched ? false : this.metaKeySelection; if (metaSelection) { var metaKey = (event.metaKey || event.ctrlKey); if (selected && metaKey) { selectedItems.splice(index, 1); } else { if (!metaKey) { selectedItems.length = 0; } selectedItems.push(item); } } else { if (selected) selectedItems.splice(index, 1); else selectedItems.push(item); } callback.emit({ originalEvent: event, items: selectedItems }); this.itemTouched = false; }; PickList.prototype.onSourceItemDblClick = function () { if (this.disabled) { return; } this.moveRight(); }; PickList.prototype.onTargetItemDblClick = function () { if (this.disabled) { return; } this.moveLeft(); }; PickList.prototype.onFilter = function (event, data, listType) { var query = event.target.value.trim().toLowerCase(); if (listType === this.SOURCE_LIST) this.filterValueSource = query; else this.filterValueTarget = query; this.activateFilter(data, listType); }; PickList.prototype.activateFilter = function (data, listType) { var searchFields = this.filterBy.split(','); if (listType === this.SOURCE_LIST) this.visibleOptionsSource = this.objectUtils.filter(data, searchFields, this.filterValueSource); else this.visibleOptionsTarget = this.objectUtils.filter(data, searchFields, this.filterValueTarget); }; PickList.prototype.isItemVisible = function (item, listType) { if (listType == this.SOURCE_LIST) return this.isVisibleInList(this.visibleOptionsSource, item, this.filterValueSource); else return this.isVisibleInList(this.visibleOptionsTarget, item, this.filterValueTarget); }; PickList.prototype.isVisibleInList = function (data, item, filterValue) { if (filterValue && filterValue.trim().length) { for (var i = 0; i < data.length; i++) { if (item == data[i]) { return true; } } } else { return true; } }; PickList.prototype.onItemTouchEnd = function (event) { if (this.disabled) { return; } this.itemTouched = true; }; PickList.prototype.sortByIndexInList = function (items, list) { var _this = this; return items.sort(function (item1, item2) { return _this.findIndexInList(item1, list) - _this.findIndexInList(item2, list); }); }; PickList.prototype.moveUp = function (listElement, list, selectedItems, callback) { if (selectedItems && selectedItems.length) { selectedItems = this.sortByIndexInList(selectedItems, list); for (var i = 0; i < selectedItems.length; i++) { var selectedItem = selectedItems[i]; var selectedItemIndex = this.findIndexInList(selectedItem, list); if (selectedItemIndex != 0) { var movedItem = list[selectedItemIndex]; var temp = list[selectedItemIndex - 1]; list[selectedItemIndex - 1] = movedItem; list[selectedItemIndex] = temp; } else { break; } } this.movedUp = true; this.reorderedListElement = listElement; callback.emit({ items: selectedItems }); } }; PickList.prototype.moveTop = function (listElement, list, selectedItems, callback) { if (selectedItems && selectedItems.length) { selectedItems = this.sortByIndexInList(selectedItems, list); for (var i = 0; i < selectedItems.length; i++) { var selectedItem = selectedItems[i]; var selectedItemIndex = this.findIndexInList(selectedItem, list); if (selectedItemIndex != 0) { var movedItem = list.splice(selectedItemIndex, 1)[0]; list.unshift(movedItem); } else { break; } } listElement.scrollTop = 0; callback.emit({ items: selectedItems }); } }; PickList.prototype.moveDown = function (listElement, list, selectedItems, callback) { if (selectedItems && selectedItems.length) { selectedItems = this.sortByIndexInList(selectedItems, list); for (var i = selectedItems.length - 1; i >= 0; i--) { var selectedItem = selectedItems[i]; var selectedItemIndex = this.findIndexInList(selectedItem, list); if (selectedItemIndex != (list.length - 1)) { var movedItem = list[selectedItemIndex]; var temp = list[selectedItemIndex + 1]; list[selectedItemIndex + 1] = movedItem; list[selectedItemIndex] = temp; } else { break; } } this.movedDown = true; this.reorderedListElement = listElement; callback.emit({ items: selectedItems }); } }; PickList.prototype.moveBottom = function (listElement, list, selectedItems, callback) { if (selectedItems && selectedItems.length) { selectedItems = this.sortByIndexInList(selectedItems, list); for (var i = selectedItems.length - 1; i >= 0; i--) { var selectedItem = selectedItems[i]; var selectedItemIndex = this.findIndexInList(selectedItem, list); if (selectedItemIndex != (list.length - 1)) { var movedItem = list.splice(selectedItemIndex, 1)[0]; list.push(movedItem); } else { break; } } listElement.scrollTop = listElement.scrollHeight; callback.emit({ items: selectedItems }); } }; PickList.prototype.moveRight = function () { if (this.selectedItemsSource && this.selectedItemsSource.length) { for (var i = 0; i < this.selectedItemsSource.length; i++) { var selectedItem = this.selectedItemsSource[i]; if (this.findIndexInList(selectedItem, this.target) == -1) { this.target.push(this.source.splice(this.findIndexInList(selectedItem, this.source), 1)[0]); } } this.onMoveToTarget.emit({ items: this.selectedItemsSource }); this.selectedItemsSource = []; } }; PickList.prototype.moveAllRight = function () { if (this.source) { var movedItems = []; for (var i = 0; i < this.source.length; i++) { if (this.isItemVisible(this.source[i], this.SOURCE_LIST)) { var removedItem = this.source.splice(i, 1)[0]; this.target.push(removedItem); movedItems.push(removedItem); i--; } } this.onMoveToTarget.emit({ items: movedItems }); this.onMoveAllToTarget.emit({ items: movedItems }); this.selectedItemsSource = []; } }; PickList.prototype.moveLeft = function () { if (this.selectedItemsTarget && this.selectedItemsTarget.length) { for (var i = 0; i < this.selectedItemsTarget.length; i++) { var selectedItem = this.selectedItemsTarget[i]; if (this.findIndexInList(selectedItem, this.source) == -1) { this.source.push(this.target.splice(this.findIndexInList(selectedItem, this.target), 1)[0]); } } this.onMoveToSource.emit({ items: this.selectedItemsTarget }); this.selectedItemsTarget = []; } }; PickList.prototype.moveAllLeft = function () { if (this.target) { var movedItems = []; for (var i = 0; i < this.target.length; i++) { if (this.isItemVisible(this.target[i], this.TARGET_LIST)) { var removedItem = this.target.splice(i, 1)[0]; this.source.push(removedItem); movedItems.push(removedItem); i--; } } this.onMoveToSource.emit({ items: movedItems }); this.onMoveAllToSource.emit({ items: movedItems }); this.selectedItemsTarget = []; } }; PickList.prototype.isSelected = function (item, selectedItems) { return this.findIndexInSelection(item, selectedItems) != -1; }; PickList.prototype.findIndexInSelection = function (item, selectedItems) { return this.findIndexInList(item, selectedItems); }; PickList.prototype.findIndexInList = function (item, list) { var index = -1; if (list) { for (var i = 0; i < list.length; i++) { if (list[i] == item) { index = i; break; } } } return index; }; PickList.prototype.onDragStart = function (event, index, listType) { this.dragging = true; this.fromListType = listType; if (listType === this.SOURCE_LIST) this.draggedItemIndexSource = index; else this.draggedItemIndexTarget = index; if (this.dragdropScope) { event.dataTransfer.setData("text", this.dragdropScope); } }; PickList.prototype.onDragOver = function (event, index, listType) { if (listType == this.SOURCE_LIST) { if (this.draggedItemIndexSource !== index && this.draggedItemIndexSource + 1 !== index || (this.fromListType === this.TARGET_LIST)) { this.dragOverItemIndexSource = index; event.preventDefault(); } } else { if (this.draggedItemIndexTarget !== index && this.draggedItemIndexTarget + 1 !== index || (this.fromListType === this.SOURCE_LIST)) { this.dragOverItemIndexTarget = index; event.preventDefault(); } } this.onListItemDroppoint = true; }; PickList.prototype.onDragLeave = function (event, listType) { this.dragOverItemIndexSource = null; this.dragOverItemIndexTarget = null; this.onListItemDroppoint = false; }; PickList.prototype.onDrop = function (event, index, listType) { if (this.onListItemDroppoint) { if (listType === this.SOURCE_LIST) { if (this.fromListType === this.TARGET_LIST) { this.insert(this.draggedItemIndexTarget, this.target, index, this.source, this.onMoveToSource); } else { this.objectUtils.reorderArray(this.source, this.draggedItemIndexSource, (this.draggedItemIndexSource > index) ? index : (index === 0) ? 0 : index - 1); this.onSourceReorder.emit({ items: this.source[this.draggedItemIndexSource] }); } this.dragOverItemIndexSource = null; } else { if (this.fromListType === this.SOURCE_LIST) { this.insert(this.draggedItemIndexSource, this.source, index, this.target, this.onMoveToTarget); } else { this.objectUtils.reorderArray(this.target, this.draggedItemIndexTarget, (this.draggedItemIndexTarget > index) ? index : (index === 0) ? 0 : index - 1); this.onTargetReorder.emit({ items: this.target[this.draggedItemIndexTarget] }); } this.dragOverItemIndexTarget = null; } this.listHighlightTarget = false; this.listHighlightSource = false; event.preventDefault(); } }; PickList.prototype.onDragEnd = function (event) { this.dragging = false; }; PickList.prototype.onListDrop = function (event, listType) { if (!this.onListItemDroppoint) { if (listType === this.SOURCE_LIST) { if (this.fromListType === this.TARGET_LIST) { this.insert(this.draggedItemIndexTarget, this.target, null, this.source, this.onMoveToSource); } } else { if (this.fromListType === this.SOURCE_LIST) { this.insert(this.draggedItemIndexSource, this.source, null, this.target, this.onMoveToTarget); } } this.listHighlightTarget = false; this.listHighlightSource = false; event.preventDefault(); } }; PickList.prototype.insert = function (fromIndex, fromList, toIndex, toList, callback) { var elementtomove = fromList[fromIndex]; if (toIndex === null) toList.push(fromList.splice(fromIndex, 1)[0]); else toList.splice(toIndex, 0, fromList.splice(fromIndex, 1)[0]); callback.emit({ items: [elementtomove] }); }; PickList.prototype.onListMouseMove = function (event, listType) { if (this.dragging) { var moveListType = (listType == 0 ? this.listViewSourceChild : this.listViewTargetChild); var offsetY = moveListType.nativeElement.getBoundingClientRect().top + document.body.scrollTop; var bottomDiff = (offsetY + moveListType.nativeElement.clientHeight) - event.pageY; var topDiff = (event.pageY - offsetY); if (bottomDiff < 25 && bottomDiff > 0) moveListType.nativeElement.scrollTop += 15; else if (topDiff < 25 && topDiff > 0) moveListType.nativeElement.scrollTop -= 15; } if (listType === this.SOURCE_LIST) { if (this.fromListType === this.TARGET_LIST) this.listHighlightSource = true; } else { if (this.fromListType === this.SOURCE_LIST) this.listHighlightTarget = true; } event.preventDefault(); }; PickList.prototype.onListDragLeave = function () { this.listHighlightTarget = false; this.listHighlightSource = false; }; PickList.prototype.resetFilter = function () { this.visibleOptionsSource = null; this.filterValueSource = null; this.visibleOptionsTarget = null; this.filterValueTarget = null; this.sourceFilterViewChild.nativeElement.value = ''; this.targetFilterViewChild.nativeElement.value = ''; }; __decorate([ core_1.Input(), __metadata("design:type", Array) ], PickList.prototype, "source", void 0); __decorate([ core_1.Input(), __metadata("design:type", Array) ], PickList.prototype, "target", void 0); __decorate([ core_1.Input(), __metadata("design:type", String) ], PickList.prototype, "sourceHeader", void 0); __decorate([ core_1.Input(), __metadata("design:type", String) ], PickList.prototype, "targetHeader", void 0); __decorate([ core_1.Input(), __metadata("design:type", Boolean) ], PickList.prototype, "responsive", void 0); __decorate([ core_1.Input(), __metadata("design:type", String) ], PickList.prototype, "filterBy", void 0); __decorate([ core_1.Input(), __metadata("design:type", Function) ], PickList.prototype, "trackBy", void 0); __decorate([ core_1.Input(), __metadata("design:type", Function) ], PickList.prototype, "sourceTrackBy", void 0); __decorate([ core_1.Input(), __metadata("design:type", Function) ], PickList.prototype, "targetTrackBy", void 0); __decorate([ core_1.Input(), __metadata("design:type", Boolean) ], PickList.prototype, "showSourceFilter", void 0); __decorate([ core_1.Input(), __metadata("design:type", Boolean) ], PickList.prototype, "showTargetFilter", void 0); __decorate([ core_1.Input(), __metadata("design:type", Boolean) ], PickList.prototype, "metaKeySelection", void 0); __decorate([ core_1.Input(), __metadata("design:type", Boolean) ], PickList.prototype, "dragdrop", void 0); __decorate([ core_1.Input(), __metadata("design:type", String) ], PickList.prototype, "dragdropScope", void 0); __decorate([ core_1.Input(), __metadata("design:type", Object) ], PickList.prototype, "style", void 0); __decorate([ core_1.Input(), __metadata("design:type", String) ], PickList.prototype, "styleClass", void 0); __decorate([ core_1.Input(), __metadata("design:type", Object) ], PickList.prototype, "sourceStyle", void 0); __decorate([ core_1.Input(), __metadata("design:type", Object) ], PickList.prototype, "targetStyle", void 0); __decorate([ core_1.Input(), __metadata("design:type", Boolean) ], PickList.prototype, "showSourceControls", void 0); __decorate([ core_1.Input(), __metadata("design:type", Boolean) ], PickList.prototype, "showTargetControls", void 0); __decorate([ core_1.Input(), __metadata("design:type", String) ], PickList.prototype, "sourceFilterPlaceholder", void 0); __decorate([ core_1.Input(), __metadata("design:type", String) ], PickList.prototype, "targetFilterPlaceholder", void 0); __decorate([ core_1.Input(), __metadata("design:type", Boolean) ], PickList.prototype, "disabled", void 0); __decorate([ core_1.Output(), __metadata("design:type", core_1.EventEmitter) ], PickList.prototype, "onMoveToSource", void 0); __decorate([ core_1.Output(), __metadata("design:type", core_1.EventEmitter) ], PickList.prototype, "onMoveAllToSource", void 0); __decorate([ core_1.Output(), __metadata("design:type", core_1.EventEmitter) ], PickList.prototype, "onMoveAllToTarget", void 0); __decorate([ core_1.Output(), __metadata("design:type", core_1.EventEmitter) ], PickList.prototype, "onMoveToTarget", void 0); __decorate([ core_1.Output(), __metadata("design:type", core_1.EventEmitter) ], PickList.prototype, "onSourceReorder", void 0); __decorate([ core_1.Output(), __metadata("design:type", core_1.EventEmitter) ], PickList.prototype, "onTargetReorder", void 0); __decorate([ core_1.Output(), __metadata("design:type", core_1.EventEmitter) ], PickList.prototype, "onSourceSelect", void 0); __decorate([ core_1.Output(), __metadata("design:type", core_1.EventEmitter) ], PickList.prototype, "onTargetSelect", void 0); __decorate([ core_1.ViewChild('sourcelist'), __metadata("design:type", core_1.ElementRef) ], PickList.prototype, "listViewSourceChild", void 0); __decorate([ core_1.ViewChild('targetlist'), __metadata("design:type", core_1.ElementRef) ], PickList.prototype, "listViewTargetChild", void 0); __decorate([ core_1.ViewChild('sourceFilter'), __metadata("design:type", core_1.ElementRef) ], PickList.prototype, "sourceFilterViewChild", void 0); __decorate([ core_1.ViewChild('targetFilter'), __metadata("design:type", core_1.ElementRef) ], PickList.prototype, "targetFilterViewChild", void 0); __decorate([ core_1.ContentChildren(shared_1.PrimeTemplate), __metadata("design:type", core_1.QueryList) ], PickList.prototype, "templates", void 0); PickList = __decorate([ core_1.Component({ selector: 'p-pickList', template: "\n <div [class]=\"styleClass\" [ngStyle]=\"style\" [ngClass]=\"{'ui-picklist ui-widget ui-helper-clearfix': true,'ui-picklist-responsive': responsive}\">\n <div class=\"ui-picklist-source-controls ui-picklist-buttons\" *ngIf=\"showSourceControls\">\n <div class=\"ui-picklist-buttons-cell\">\n <button type=\"button\" pButton icon=\"pi pi-angle-up\" [disabled]=\"disabled\" (click)=\"moveUp(sourcelist,source,selectedItemsSource,onSourceReorder)\"></button>\n <button type=\"button\" pButton icon=\"pi pi-angle-double-up\" [disabled]=\"disabled\" (click)=\"moveTop(sourcelist,source,selectedItemsSource,onSourceReorder)\"></button>\n <button type=\"button\" pButton icon=\"pi pi-angle-down\" [disabled]=\"disabled\" (click)=\"moveDown(sourcelist,source,selectedItemsSource,onSourceReorder)\"></button>\n <button type=\"button\" pButton icon=\"pi pi-angle-double-down\" [disabled]=\"disabled\" (click)=\"moveBottom(sourcelist,source,selectedItemsSource,onSourceReorder)\"></button>\n </div>\n </div>\n <div class=\"ui-picklist-listwrapper ui-picklist-source-wrapper\" [ngClass]=\"{'ui-picklist-listwrapper-nocontrols':!showSourceControls}\">\n <div class=\"ui-picklist-caption ui-widget-header ui-corner-tl ui-corner-tr\" *ngIf=\"sourceHeader\">{{sourceHeader}}</div>\n <div class=\"ui-picklist-filter-container ui-widget-content\" *ngIf=\"filterBy && showSourceFilter !== false\">\n <input #sourceFilter type=\"text\" role=\"textbox\" (keyup)=\"onFilter($event,source,SOURCE_LIST)\" class=\"ui-picklist-filter ui-inputtext ui-widget ui-state-default ui-corner-all\" [disabled]=\"disabled\" [attr.placeholder]=\"sourceFilterPlaceholder\">\n <span class=\"ui-picklist-filter-icon pi pi-search\"></span>\n </div>\n <ul #sourcelist class=\"ui-widget-content ui-picklist-list ui-picklist-source ui-corner-bottom\" [ngClass]=\"{'ui-picklist-highlight': listHighlightSource}\" [ngStyle]=\"sourceStyle\" (dragover)=\"onListMouseMove($event,SOURCE_LIST)\" (dragleave)=\"onListDragLeave()\" (drop)=\"onListDrop($event, SOURCE_LIST)\">\n <ng-template ngFor let-item [ngForOf]=\"source\" [ngForTrackBy]=\"sourceTrackBy || trackBy\" let-i=\"index\" let-l=\"last\">\n <li class=\"ui-picklist-droppoint\" *ngIf=\"dragdrop\" (dragover)=\"onDragOver($event, i, SOURCE_LIST)\" (drop)=\"onDrop($event, i, SOURCE_LIST)\" (dragleave)=\"onDragLeave($event, SOURCE_LIST)\"\n [ngClass]=\"{'ui-picklist-droppoint-highlight': (i === dragOverItemIndexSource)}\" [style.display]=\"isItemVisible(item, SOURCE_LIST) ? 'block' : 'none'\"></li>\n <li [ngClass]=\"{'ui-picklist-item':true,'ui-state-highlight':isSelected(item,selectedItemsSource), 'ui-state-disabled': disabled}\"\n (click)=\"onItemClick($event,item,selectedItemsSource,onSourceSelect)\" (dblclick)=\"onSourceItemDblClick()\" (touchend)=\"onItemTouchEnd($event)\"\n [style.display]=\"isItemVisible(item, SOURCE_LIST) ? 'block' : 'none'\"\n [draggable]=\"dragdrop\" (dragstart)=\"onDragStart($event, i, SOURCE_LIST)\" (dragend)=\"onDragEnd($event)\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: {$implicit: item, index: i}\"></ng-container>\n </li>\n <li class=\"ui-picklist-droppoint\" *ngIf=\"dragdrop&&l\" (dragover)=\"onDragOver($event, i + 1, SOURCE_LIST)\" (drop)=\"onDrop($event, i + 1, SOURCE_LIST)\" (dragleave)=\"onDragLeave($event, SOURCE_LIST)\"\n [ngClass]=\"{'ui-picklist-droppoint-highlight': (i + 1 === dragOverItemIndexSource)}\"></li>\n </ng-template>\n </ul>\n </div>\n <div class=\"ui-picklist-buttons\">\n <div class=\"ui-picklist-buttons-cell\">\n <button type=\"button\" pButton icon=\"pi pi-angle-right\" [disabled]=\"disabled\" (click)=\"moveRight()\"></button>\n <button type=\"button\" pButton icon=\"pi pi-angle-double-right\" [disabled]=\"disabled\" (click)=\"moveAllRight()\"></button>\n <button type=\"button\" pButton icon=\"pi pi-angle-left\" [disabled]=\"disabled\" (click)=\"moveLeft()\"></button>\n <button type=\"button\" pButton icon=\"pi pi-angle-double-left\" [disabled]=\"disabled\" (click)=\"moveAllLeft()\"></button>\n </div>\n </div>\n <div class=\"ui-picklist-listwrapper ui-picklist-target-wrapper\" [ngClass]=\"{'ui-picklist-listwrapper-nocontrols':!showTargetControls}\">\n <div class=\"ui-picklist-caption ui-widget-header ui-corner-tl ui-corner-tr\" *ngIf=\"targetHeader\">{{targetHeader}}</div>\n <div class=\"ui-picklist-filter-container ui-widget-content\" *ngIf=\"filterBy && showTargetFilter !== false\">\n <input #targetFilter type=\"text\" role=\"textbox\" (keyup)=\"onFilter($event,target,TARGET_LIST)\" class=\"ui-picklist-filter ui-inputtext ui-widget ui-state-default ui-corner-all\" [disabled]=\"disabled\" [attr.placeholder]=\"targetFilterPlaceholder\">\n <span class=\"ui-picklist-filter-icon pi pi-search\"></span>\n </div>\n <ul #targetlist class=\"ui-widget-content ui-picklist-list ui-picklist-target ui-corner-bottom\" [ngClass]=\"{'ui-picklist-highlight': listHighlightTarget}\" [ngStyle]=\"targetStyle\" (dragover)=\"onListMouseMove($event,TARGET_LIST)\" (dragleave)=\"onListDragLeave()\" (drop)=\"onListDrop($event,TARGET_LIST)\">\n <ng-template ngFor let-item [ngForOf]=\"target\" [ngForTrackBy]=\"targetTrackBy || trackBy\" let-i=\"index\" let-l=\"last\">\n <li class=\"ui-picklist-droppoint\" *ngIf=\"dragdrop\" (dragover)=\"onDragOver($event, i, TARGET_LIST)\" (drop)=\"onDrop($event, i, TARGET_LIST)\" (dragleave)=\"onDragLeave($event, TARGET_LIST)\"\n [ngClass]=\"{'ui-picklist-droppoint-highlight': (i === dragOverItemIndexTarget)}\" [style.display]=\"isItemVisible(item, TARGET_LIST) ? 'block' : 'none'\"></li>\n <li [ngClass]=\"{'ui-picklist-item':true,'ui-state-highlight':isSelected(item,selectedItemsTarget), 'ui-state-disabled': disabled}\"\n (click)=\"onItemClick($event,item,selectedItemsTarget,onTargetSelect)\" (dblclick)=\"onTargetItemDblClick()\" (touchend)=\"onItemTouchEnd($event)\"\n [style.display]=\"isItemVisible(item, TARGET_LIST) ? 'block' : 'none'\"\n [draggable]=\"dragdrop\" (dragstart)=\"onDragStart($event, i, TARGET_LIST)\" (dragend)=\"onDragEnd($event)\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: {$implicit: item, index: i}\"></ng-container>\n </li>\n <li class=\"ui-picklist-droppoint\" *ngIf=\"dragdrop&&l\" (dragover)=\"onDragOver($event, i + 1, TARGET_LIST)\" (drop)=\"onDrop($event, i + 1, TARGET_LIST)\" (dragleave)=\"onDragLeave($event, TARGET_LIST)\"\n [ngClass]=\"{'ui-picklist-droppoint-highlight': (i + 1 === dragOverItemIndexTarget)}\"></li>\n </ng-template>\n </ul>\n </div>\n <div class=\"ui-picklist-target-controls ui-picklist-buttons\" *ngIf=\"showTargetControls\">\n <div class=\"ui-picklist-buttons-cell\">\n <button type=\"button\" pButton icon=\"pi pi-angle-up\" [disabled]=\"disabled\" (click)=\"moveUp(targetlist,target,selectedItemsTarget,onTargetReorder)\"></button>\n <button type=\"button\" pButton icon=\"pi pi-angle-double-up\" [disabled]=\"disabled\" (click)=\"moveTop(targetlist,target,selectedItemsTarget,onTargetReorder)\"></button>\n <button type=\"button\" pButton icon=\"pi pi-angle-down\" [disabled]=\"disabled\" (click)=\"moveDown(targetlist,target,selectedItemsTarget,onTargetReorder)\"></button>\n <button type=\"button\" pButton icon=\"pi pi-angle-double-down\" [disabled]=\"disabled\" (click)=\"moveBottom(targetlist,target,selectedItemsTarget,onTargetReorder)\"></button>\n </div>\n </div>\n </div>\n ", providers: [domhandler_1.DomHandler, objectutils_1.ObjectUtils] }), __metadata("design:paramtypes", [core_1.ElementRef, domhandler_1.DomHandler, objectutils_1.ObjectUtils]) ], PickList); return PickList; }()); exports.PickList = PickList; var PickListModule = /** @class */ (function () { function PickListModule() { } PickListModule = __decorate([ core_1.NgModule({ imports: [common_1.CommonModule, button_1.ButtonModule, shared_1.SharedModule], exports: [PickList, shared_1.SharedModule], declarations: [PickList] }) ], PickListModule); return PickListModule; }()); exports.PickListModule = PickListModule; //# sourceMappingURL=picklist.js.map