primeng
Version:
PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB
1 lines • 130 kB
Source Map (JSON)
{"version":3,"file":"primeng-picklist.mjs","sources":["../../src/picklist/style/pickliststyle.ts","../../src/picklist/picklist.ts","../../src/picklist/primeng-picklist.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { BaseStyle } from 'primeng/base';\n\nconst theme = ({ dt }) => `\n.p-picklist {\n display: flex;\n gap: ${dt('picklist.gap')};\n}\n\n.p-picklist-controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: ${dt('picklist.controls.gap')};\n}\n\n.p-picklist-list-container {\n flex: 1 1 50%;\n}\n\n.p-picklist .p-listbox {\n height: 100%;\n}\n`;\n\nconst classes = {\n root: 'p-picklist p-component',\n sourceControls: 'p-picklist-controls p-picklist-source-controls',\n sourceListContainer: 'p-picklist-list-container p-picklist-source-list-container',\n transferControls: 'p-picklist-controls p-picklist-transfer-controls',\n targetListContainer: 'p-picklist-list-container p-picklist-target-list-container',\n targetControls: 'p-picklist-controls p-picklist-target-controls'\n};\n\n@Injectable()\nexport class PickListStyle extends BaseStyle {\n name = 'picklist';\n\n theme = theme;\n\n classes = classes;\n}\n\n/**\n *\n * PickList is used to reorder items between different lists.\n *\n * [Live Demo](https://www.primeng.org/picklist)\n *\n * @module pickliststyle\n *\n */\n\nexport enum PickListClasses {\n /**\n * Class name of the root element\n */\n root = 'p-picklist',\n /**\n * Class name of the source controls element\n */\n sourceControls = 'p-picklist-source-controls',\n /**\n * Class name of the source list container element\n */\n sourceListContainer = 'p-picklist-source-list-container',\n /**\n * Class name of the transfer controls element\n */\n transferControls = 'p-picklist-transfer-controls',\n /**\n * Class name of the target list container element\n */\n targetListContainer = 'p-picklist-target-list-container',\n /**\n * Class name of the target controls element\n */\n targetControls = 'p-picklist-target-controls'\n}\n\nexport interface PickListStyle extends BaseStyle {}\n","import { CdkDragDrop, DragDropModule, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';\nimport { CommonModule, isPlatformBrowser } from '@angular/common';\nimport {\n AfterContentInit,\n AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n NgModule,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n booleanAttribute,\n inject,\n numberAttribute\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { find, findIndexInList, findSingle, isEmpty, scrollInView, setAttribute, uuid } from '@primeuix/utils';\nimport { FilterService, PrimeTemplate, SharedModule } from 'primeng/api';\nimport { BaseComponent } from 'primeng/basecomponent';\nimport { ButtonDirective, ButtonProps } from 'primeng/button';\nimport { AngleDoubleDownIcon, AngleDoubleLeftIcon, AngleDoubleRightIcon, AngleDoubleUpIcon, AngleDownIcon, AngleLeftIcon, AngleRightIcon, AngleUpIcon } from 'primeng/icons';\nimport { Listbox } from 'primeng/listbox';\nimport { Ripple } from 'primeng/ripple';\nimport { Nullable, VoidListener } from 'primeng/ts-helpers';\nimport {\n PickListFilterOptions,\n PickListMoveAllToSourceEvent,\n PickListMoveAllToTargetEvent,\n PickListMoveToSourceEvent,\n PickListMoveToTargetEvent,\n PickListSourceFilterEvent,\n PickListSourceReorderEvent,\n PickListSourceSelectEvent,\n PickListTargetFilterEvent,\n PickListTargetReorderEvent,\n PickListTargetSelectEvent\n} from './picklist.interface';\nimport { PickListStyle } from './style/pickliststyle';\n\n/**\n * PickList is used to reorder items between different lists.\n * @group Components\n */\n@Component({\n selector: 'p-pickList, p-picklist, p-pick-list',\n standalone: true,\n imports: [CommonModule, ButtonDirective, Ripple, DragDropModule, AngleDoubleDownIcon, AngleDoubleLeftIcon, AngleDoubleRightIcon, AngleDoubleUpIcon, AngleDownIcon, AngleLeftIcon, AngleRightIcon, AngleUpIcon, Listbox, FormsModule, SharedModule],\n template: `\n <div [class]=\"styleClass\" [ngStyle]=\"style\" [ngClass]=\"{ 'p-picklist p-component': true }\" cdkDropListGroup [attr.data-pc-name]=\"'picklist'\" [attr.data-pc-section]=\"'root'\">\n <div class=\"p-picklist-controls p-picklist-source-controls\" *ngIf=\"showSourceControls\" [attr.data-pc-section]=\"'sourceControls'\" [attr.data-pc-group-section]=\"'controls'\">\n <button\n type=\"button\"\n [attr.aria-label]=\"moveUpAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"sourceMoveDisabled()\"\n (click)=\"moveUp(sourcelist, source, selectedItemsSource, onSourceReorder, SOURCE_LIST)\"\n [attr.data-pc-section]=\"'sourceMoveUpButton'\"\n [buttonProps]=\"getButtonProps('moveup')\"\n >\n <AngleUpIcon *ngIf=\"!moveUpIconTemplate && !_moveUpIconTemplate\" [attr.data-pc-section]=\"'moveupicon'\" />\n <ng-template *ngTemplateOutlet=\"moveUpIconTemplate || _moveUpIconTemplate\"></ng-template>\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"moveTopAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"sourceMoveDisabled()\"\n (click)=\"moveTop(sourcelist, source, selectedItemsSource, onSourceReorder, SOURCE_LIST)\"\n [attr.data-pc-section]=\"'sourceMoveTopButton'\"\n [buttonProps]=\"getButtonProps('movetop')\"\n >\n <AngleDoubleUpIcon *ngIf=\"!moveTopIconTemplate && !_moveTopIconTemplate\" [attr.data-pc-section]=\"'movetopicon'\" />\n <ng-template *ngTemplateOutlet=\"moveTopIconTemplate || _moveTopIconTemplate\"></ng-template>\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"moveDownAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"sourceMoveDisabled()\"\n (click)=\"moveDown(sourcelist, source, selectedItemsSource, onSourceReorder, SOURCE_LIST)\"\n [attr.data-pc-section]=\"'sourceMoveDownButton'\"\n [buttonProps]=\"getButtonProps('movedown')\"\n >\n <AngleDownIcon *ngIf=\"!moveDownIconTemplate && !_moveDownIconTemplate\" [attr.data-pc-section]=\"'movedownicon'\" />\n <ng-template *ngTemplateOutlet=\"moveDownIconTemplate || _moveDownIconTemplate\"></ng-template>\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"moveBottomAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"sourceMoveDisabled()\"\n (click)=\"moveBottom(sourcelist, source, selectedItemsSource, onSourceReorder, SOURCE_LIST)\"\n [attr.data-pc-section]=\"'sourceMoveBottomButton'\"\n [buttonProps]=\"getButtonProps('movebottom')\"\n >\n <AngleDoubleDownIcon *ngIf=\"!moveBottomIconTemplate || _moveBottomIconTemplate\" [attr.data-pc-section]=\"'movebottomicon'\" />\n <ng-template *ngTemplateOutlet=\"moveBottomIconTemplate || _moveBottomIconTemplate\"></ng-template>\n </button>\n </div>\n <div class=\"p-picklist-list-container p-picklist-source-list-container\" [attr.data-pc-section]=\"'sourceWrapper'\" [attr.data-pc-group-section]=\"'listWrapper'\">\n <p-listbox\n #sourcelist\n [multiple]=\"true\"\n [options]=\"source\"\n [(ngModel)]=\"selectedItemsSource\"\n optionLabel=\"name\"\n [id]=\"idSource + '_list'\"\n [ngStyle]=\"sourceStyle\"\n [striped]=\"stripedRows\"\n [tabindex]=\"tabindex\"\n (onFocus)=\"onListFocus($event, SOURCE_LIST)\"\n (onBlur)=\"onListBlur($event, SOURCE_LIST)\"\n (keydown)=\"onItemKeyDown($event, selectedItemsSource, onSourceSelect, SOURCE_LIST)\"\n (onDblClick)=\"onSourceItemDblClick()\"\n [disabled]=\"disabled\"\n [optionDisabled]=\"sourceOptionDisabled\"\n [metaKeySelection]=\"metaKeySelection\"\n [scrollHeight]=\"scrollHeight\"\n [autoOptionFocus]=\"autoOptionFocus\"\n [filter]=\"filterBy\"\n [filterBy]=\"filterBy\"\n [filterLocale]=\"filterLocale\"\n [filterMatchMode]=\"filterMatchMode\"\n [filterPlaceHolder]=\"sourceFilterPlaceholder\"\n [dragdrop]=\"dragdrop\"\n (onDrop)=\"onDrop($event, SOURCE_LIST)\"\n (onFilter)=\"onSourceFilter.emit($event)\"\n >\n <ng-container *ngIf=\"sourceHeaderTemplate || _sourceHeaderTemplate || sourceHeader\">\n <ng-template #header>\n <div class=\"p-picklist-title\" *ngIf=\"!sourceHeaderTemplate && !_sourceHeaderTemplate\">{{ sourceHeader }}</div>\n <ng-template *ngTemplateOutlet=\"sourceHeaderTemplate || _sourceHeaderTemplate\"></ng-template>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"sourceFilterTemplate || _sourceFilterTemplate\">\n <ng-template #filter>\n <ng-template *ngTemplateOutlet=\"sourceFilterTemplate || _sourceFilterTemplate; context: { options: sourceFilterOptions }\"></ng-template>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"sourceFilterIconTemplate || _sourceFilterIconTemplate\">\n <ng-container *ngTemplateOutlet=\"sourceFilterIconTemplate || _sourceFilterIconTemplate\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"itemTemplate || _itemTemplate\">\n <ng-template #item let-item let-index=\"index\" let-selected=\"selected\" let-disabled=\"disabled\">\n <ng-container *ngTemplateOutlet=\"itemTemplate || _itemTemplate; context: { $implicit: item, index: index, selected: selected, disabled: disabled }\"></ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"emptyMessageSourceTemplate || _emptyMessageSourceTemplate\">\n <ng-template #empty>\n <ng-container *ngTemplateOutlet=\"emptyMessageSourceTemplate || _emptyMessageSourceTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"emptyFilterMessageSourceTemplate || _emptyFilterMessageSourceTemplate\">\n <ng-template #emptyfilter>\n <ng-container *ngTemplateOutlet=\"emptyFilterMessageSourceTemplate || _emptyFilterMessageSourceTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n </p-listbox>\n </div>\n <div class=\"p-picklist-controls p-picklist-transfer-controls\" [attr.data-pc-section]=\"'buttons'\" [attr.data-pc-group-section]=\"'controls'\">\n <button\n type=\"button\"\n [attr.aria-label]=\"moveToTargetAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"moveRightDisabled()\"\n (click)=\"moveRight()\"\n [attr.data-pc-section]=\"'moveToTargetButton'\"\n [buttonProps]=\"getButtonProps('movetotarget')\"\n >\n <ng-container *ngIf=\"!moveToTargetIconTemplate && !_moveToTargetIconTemplate\">\n <AngleRightIcon *ngIf=\"!viewChanged\" [attr.data-pc-section]=\"'movetotargeticon'\" />\n <AngleDownIcon *ngIf=\"viewChanged\" [attr.data-pc-section]=\"'movetotargeticon'\" />\n </ng-container>\n <ng-template *ngTemplateOutlet=\"moveToTargetIconTemplate || _moveToTargetIconTemplate; context: { $implicit: viewChanged }\"></ng-template>\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"moveAllToTargetAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"moveAllRightDisabled()\"\n (click)=\"moveAllRight()\"\n [attr.data-pc-section]=\"'moveAllToTargetButton'\"\n [buttonProps]=\"getButtonProps('movealltotarget')\"\n >\n <ng-container *ngIf=\"!moveAllToTargetIconTemplate && !_moveAllToTargetIconTemplate\">\n <AngleDoubleRightIcon *ngIf=\"!viewChanged\" [attr.data-pc-section]=\"'movealltotargeticon'\" />\n <AngleDoubleDownIcon *ngIf=\"viewChanged\" [attr.data-pc-section]=\"'movealltotargeticon'\" />\n </ng-container>\n <ng-template *ngTemplateOutlet=\"moveAllToTargetIconTemplate || _moveAllToTargetIconTemplate; context: { $implicit: viewChanged }\"></ng-template>\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"moveToSourceAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"moveLeftDisabled()\"\n (click)=\"moveLeft()\"\n [attr.data-pc-section]=\"'moveToSourceButton'\"\n [buttonProps]=\"getButtonProps('movetosource')\"\n >\n <ng-container *ngIf=\"!moveToSourceIconTemplate && !_moveToSourceIconTemplate\">\n <AngleLeftIcon *ngIf=\"!viewChanged\" [attr.data-pc-section]=\"'movedownsourceticon'\" />\n <AngleUpIcon *ngIf=\"viewChanged\" [attr.data-pc-section]=\"'movedownsourceticon'\" />\n </ng-container>\n <ng-template *ngTemplateOutlet=\"moveToSourceIconTemplate || _moveToSourceIconTemplate; context: { $implicit: viewChanged }\"></ng-template>\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"moveAllToSourceAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"moveAllLeftDisabled()\"\n (click)=\"moveAllLeft()\"\n [attr.data-pc-section]=\"'moveAllToSourceButton'\"\n [buttonProps]=\"getButtonProps('movealltosource')\"\n >\n <ng-container *ngIf=\"!moveAllToSourceIconTemplate && !_moveAllToSourceIconTemplate\">\n <AngleDoubleLeftIcon *ngIf=\"!viewChanged\" [attr.data-pc-section]=\"'movealltosourceticon'\" />\n <AngleDoubleUpIcon *ngIf=\"viewChanged\" [attr.data-pc-section]=\"'movealltosourceticon'\" />\n </ng-container>\n <ng-template *ngTemplateOutlet=\"moveAllToSourceIconTemplate || _moveAllToSourceIconTemplate; context: { $implicit: viewChanged }\"></ng-template>\n </button>\n </div>\n <div class=\"p-picklist-list-container p-picklist-target-list-container\" [attr.data-pc-section]=\"'targetWrapper'\" [attr.data-pc-group-section]=\"'listwrapper'\">\n <p-listbox\n #targetlist\n [multiple]=\"true\"\n [options]=\"target\"\n [(ngModel)]=\"selectedItemsTarget\"\n optionLabel=\"name\"\n [id]=\"idTarget + '_list'\"\n [ngStyle]=\"targetStyle\"\n [striped]=\"stripedRows\"\n [tabindex]=\"tabindex\"\n (onFocus)=\"onListFocus($event, TARGET_LIST)\"\n (onBlur)=\"onListBlur($event, TARGET_LIST)\"\n (keydown)=\"onItemKeyDown($event, selectedItemsTarget, onTargetSelect, TARGET_LIST)\"\n (onDblClick)=\"onTargetItemDblClick()\"\n [disabled]=\"disabled\"\n [optionDisabled]=\"targetOptionDisabled\"\n [metaKeySelection]=\"metaKeySelection\"\n [scrollHeight]=\"scrollHeight\"\n [autoOptionFocus]=\"autoOptionFocus\"\n [filter]=\"filterBy\"\n [filterBy]=\"filterBy\"\n [filterLocale]=\"filterLocale\"\n [filterMatchMode]=\"filterMatchMode\"\n [filterPlaceHolder]=\"targetFilterPlaceholder\"\n [dragdrop]=\"dragdrop\"\n (onDrop)=\"onDrop($event, TARGET_LIST)\"\n (onFilter)=\"onTargetFilter.emit($event)\"\n >\n <ng-container *ngIf=\"targetHeaderTemplate || _targetHeaderTemplate || targetHeader\">\n <ng-template #header>\n <div class=\"p-picklist-title\" *ngIf=\"!targetHeaderTemplate && !_targetHeaderTemplate\">{{ targetHeader }}</div>\n <ng-template *ngTemplateOutlet=\"targetHeaderTemplate || _targetHeaderTemplate\"></ng-template>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"targetFilterTemplate || _targetFilterTemplate\">\n <ng-template #filter>\n <ng-template *ngTemplateOutlet=\"targetFilterTemplate || _targetFilterTemplate; context: { options: targetFilterOptions }\"></ng-template>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"targetFilterIconTemplate || _targetFilterIconTemplate\">\n <ng-container *ngTemplateOutlet=\"targetFilterIconTemplate || _targetFilterIconTemplate\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"itemTemplate || _itemTemplate\">\n <ng-template #item let-item let-index=\"index\" let-selected=\"selected\" let-disabled=\"disabled\">\n <ng-container *ngTemplateOutlet=\"itemTemplate || _itemTemplate; context: { $implicit: item, index: index, selected: selected, disabled: disabled }\"></ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"emptyMessageTargetTemplate || _emptyMessageTargetTemplate\">\n <ng-template #empty>\n <ng-container *ngTemplateOutlet=\"emptyMessageTargetTemplate || _emptyMessageTargetTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"emptyFilterMessageTargetTemplate || _emptyFilterMessageTargetTemplate\">\n <ng-template #emptyfilter>\n <ng-container *ngTemplateOutlet=\"emptyFilterMessageTargetTemplate || _emptyFilterMessageTargetTemplate\"></ng-container>\n </ng-template>\n </ng-container>\n </p-listbox>\n </div>\n <div class=\"p-picklist-controls p-picklist-target-controls\" *ngIf=\"showTargetControls\" [attr.data-pc-section]=\"'targetControls'\" [attr.data-pc-group-section]=\"'controls'\">\n <button\n type=\"button\"\n [attr.aria-label]=\"moveUpAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"targetMoveDisabled()\"\n (click)=\"moveUp(targetlist, target, selectedItemsTarget, onTargetReorder, TARGET_LIST)\"\n [attr.data-pc-section]=\"'targetMoveUpButton'\"\n [buttonProps]=\"getButtonProps('moveup')\"\n >\n <AngleUpIcon *ngIf=\"!moveUpIconTemplate && !_moveUpIconTemplate\" [attr.data-pc-section]=\"'moveupicon'\" />\n <ng-template *ngTemplateOutlet=\"moveUpIconTemplate || _moveUpIconTemplate\"></ng-template>\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"moveTopAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"targetMoveDisabled()\"\n (click)=\"moveTop(targetlist, target, selectedItemsTarget, onTargetReorder, TARGET_LIST)\"\n [attr.data-pc-section]=\"'targetMoveTopButton'\"\n [buttonProps]=\"getButtonProps('movetop')\"\n >\n <AngleDoubleUpIcon *ngIf=\"!moveTopIconTemplate && !_moveTopIconTemplate\" [attr.data-pc-section]=\"'movetopicon'\" />\n <ng-template *ngTemplateOutlet=\"moveTopIconTemplate || moveTopIconTemplate\"></ng-template>\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"moveDownAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"targetMoveDisabled()\"\n (click)=\"moveDown(targetlist, target, selectedItemsTarget, onTargetReorder, TARGET_LIST)\"\n [attr.data-pc-section]=\"'targetMoveDownButton'\"\n [buttonProps]=\"getButtonProps('movedown')\"\n >\n <AngleDownIcon *ngIf=\"!moveDownIconTemplate && !_moveDownIconTemplate\" [attr.data-pc-section]=\"'movedownicon'\" />\n <ng-template *ngTemplateOutlet=\"moveDownIconTemplate || _moveDownIconTemplate\"></ng-template>\n </button>\n <button\n type=\"button\"\n [attr.aria-label]=\"moveBottomAriaLabel\"\n pButton\n pRipple\n severity=\"secondary\"\n class=\"p-button-icon-only\"\n [disabled]=\"targetMoveDisabled()\"\n (click)=\"moveBottom(targetlist, target, selectedItemsTarget, onTargetReorder, TARGET_LIST)\"\n [attr.data-pc-section]=\"'targetMoveBottomButton'\"\n [buttonProps]=\"getButtonProps('movebottom')\"\n >\n <AngleDoubleDownIcon *ngIf=\"!moveBottomIconTemplate && !_moveBottomIconTemplate\" [attr.data-pc-section]=\"'movebottomicon'\" />\n <ng-template *ngTemplateOutlet=\"moveBottomIconTemplate || _moveBottomIconTemplate\"></ng-template>\n </button>\n </div>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [PickListStyle]\n})\nexport class PickList extends BaseComponent implements AfterViewChecked, AfterContentInit {\n /**\n * An array of objects for the source list.\n * @group Props\n */\n @Input() source: any[] | undefined;\n /**\n * An array of objects for the target list.\n * @group Props\n */\n @Input() target: any[] | undefined;\n /**\n * Text for the source list caption\n * @group Props\n */\n @Input() sourceHeader: string | undefined;\n /**\n * Index of the element in tabbing order.\n * @group Props\n */\n @Input({ transform: numberAttribute }) tabindex: number | undefined = 0;\n /**\n * Defines a string that labels the move to right button for accessibility.\n * @group Props\n */\n @Input() rightButtonAriaLabel: string | undefined;\n /**\n * Defines a string that labels the move to left button for accessibility.\n * @group Props\n */\n @Input() leftButtonAriaLabel: string | undefined;\n /**\n * Defines a string that labels the move to all right button for accessibility.\n * @group Props\n */\n @Input() allRightButtonAriaLabel: string | undefined;\n /**\n * Defines a string that labels the move to all left button for accessibility.\n * @group Props\n */\n @Input() allLeftButtonAriaLabel: string | undefined;\n /**\n * Defines a string that labels the move to up button for accessibility.\n * @group Props\n */\n @Input() upButtonAriaLabel: string | undefined;\n /**\n * Defines a string that labels the move to down button for accessibility.\n * @group Props\n */\n @Input() downButtonAriaLabel: string | undefined;\n /**\n * Defines a string that labels the move to top button for accessibility.\n * @group Props\n */\n @Input() topButtonAriaLabel: string | undefined;\n /**\n * Defines a string that labels the move to bottom button for accessibility.\n * @group Props\n */\n @Input() bottomButtonAriaLabel: string | undefined;\n /**\n * Text for the target list caption\n * @group Props\n */\n @Input() targetHeader: string | undefined;\n /**\n * When enabled orderlist adjusts its controls based on screen size.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) responsive: boolean | undefined;\n /**\n * When specified displays an input field to filter the items on keyup and decides which field to search (Accepts multiple fields with a comma).\n * @group Props\n */\n @Input() filterBy: string | undefined;\n /**\n * Locale to use in filtering. The default locale is the host environment's current locale.\n * @group Props\n */\n @Input() filterLocale: string | undefined;\n /**\n * Function to optimize the dom operations by delegating to ngForTrackBy, default algorithm checks for object identity. Use sourceTrackBy or targetTrackBy in case different algorithms are needed per list.\n * @group Props\n */\n @Input() trackBy: Function = (index: number, item: any) => item;\n /**\n * Function to optimize the dom operations by delegating to ngForTrackBy in source list, default algorithm checks for object identity.\n * @group Props\n */\n @Input() sourceTrackBy: Function | undefined;\n /**\n * Function to optimize the dom operations by delegating to ngForTrackBy in target list, default algorithm checks for object identity.\n * @group Props\n */\n @Input() targetTrackBy: Function | undefined;\n /**\n * Whether to show filter input for source list when filterBy is enabled.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) showSourceFilter: boolean = true;\n /**\n * Whether to show filter input for target list when filterBy is enabled.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) showTargetFilter: boolean = true;\n /**\n * Defines how multiple items can be selected, when true metaKey needs to be pressed to select or unselect an item and when set to false selection of each item can be toggled individually. On touch enabled devices, metaKeySelection is turned off automatically.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) metaKeySelection: boolean = false;\n /**\n * Whether to enable dragdrop based reordering.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) dragdrop: boolean = false;\n /**\n * Inline style of the component.\n * @group Props\n */\n @Input() style: { [klass: string]: any } | null | undefined;\n /**\n * Style class of the component.\n * @group Props\n */\n @Input() styleClass: string | undefined;\n /**\n * Inline style of the source list element.\n * @group Props\n */\n @Input() sourceStyle: any;\n /**\n * Inline style of the target list element.\n * @group Props\n */\n @Input() targetStyle: any;\n /**\n * Whether to show buttons of source list.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) showSourceControls: boolean = true;\n /**\n * Whether to show buttons of target list.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) showTargetControls: boolean = true;\n /**\n * Placeholder text on source filter input.\n * @group Props\n */\n @Input() sourceFilterPlaceholder: string | undefined;\n /**\n * Placeholder text on target filter input.\n * @group Props\n */\n @Input() targetFilterPlaceholder: string | undefined;\n /**\n * When present, it specifies that the component should be disabled.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) disabled: boolean = false;\n\n /**\n * Name of the disabled field of a target option or function to determine disabled state.\n * @group Props\n */\n @Input() sourceOptionDisabled: string | ((item: any) => boolean) | undefined;\n\n /**\n * Name of the disabled field of a target option or function to determine disabled state.\n * @group Props\n */\n @Input() targetOptionDisabled: string | ((item: any) => boolean) | undefined;\n\n /**\n * Defines a string that labels the filter input of source list.\n * @group Props\n */\n @Input() ariaSourceFilterLabel: string | undefined;\n /**\n * Defines a string that labels the filter input of target list.\n * @group Props\n */\n @Input() ariaTargetFilterLabel: string | undefined;\n /**\n * Defines how the items are filtered.\n * @group Props\n */\n @Input() filterMatchMode: 'contains' | 'startsWith' | 'endsWith' | 'equals' | 'notEquals' | 'in' | 'lt' | 'lte' | 'gt' | 'gte' | string = 'contains';\n /**\n * Whether to displays rows with alternating colors.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) stripedRows: boolean | undefined;\n /**\n * Keeps selection on the transfer list.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) keepSelection: boolean = false;\n /**\n * Height of the viewport, a scrollbar is defined if height of list exceeds this value.\n * @group Props\n */\n @Input() scrollHeight: string = '14rem';\n /**\n * Whether to focus on the first visible or selected element.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) autoOptionFocus: boolean = true;\n /**\n * Used to pass all properties of the ButtonProps to the Button component.\n * @group Props\n */\n @Input() buttonProps: ButtonProps = { severity: 'secondary' };\n /**\n * Used to pass all properties of the ButtonProps to the move up button inside the component.\n * @group Props\n */\n @Input() moveUpButtonProps: ButtonProps;\n /**\n * \tUsed to pass all properties of the ButtonProps to the move top button inside the component.\n * @group Props\n */\n @Input() moveTopButtonProps: ButtonProps;\n /**\n * \tUsed to pass all properties of the ButtonProps to the move down button inside the component.\n * @group Props\n */\n @Input() moveDownButtonProps: ButtonProps;\n /**\n * \tUsed to pass all properties of the ButtonProps to the move bottom button inside the component.\n * @group Props\n */\n @Input() moveBottomButtonProps: ButtonProps;\n /**\n * \tUsed to pass all properties of the ButtonProps to the move to target button inside the component.\n * @group Props\n */\n @Input() moveToTargetProps: ButtonProps;\n /**\n * \tUsed to pass all properties of the ButtonProps to the move all to target button inside the component.\n * @group Props\n */\n @Input() moveAllToTargetProps: ButtonProps;\n /**\n * Used to pass all properties of the ButtonProps to the move to source button inside the component.\n * @group Props\n */\n @Input() moveToSourceProps: ButtonProps;\n /**\n * Used to pass all properties of the ButtonProps to the move all to source button inside the component.\n * @group Props\n */\n @Input() moveAllToSourceProps: ButtonProps;\n\n /**\n * Indicates the width of the screen at which the component should change its behavior.\n * @group Props\n */\n @Input() get breakpoint(): string {\n return this._breakpoint;\n }\n set breakpoint(value: string) {\n if (value !== this._breakpoint) {\n this._breakpoint = value;\n if (isPlatformBrowser(this.platformId)) {\n this.destroyMedia();\n this.initMedia();\n }\n }\n }\n /**\n * Callback to invoke when items are moved from target to source.\n * @param {PickListMoveToSourceEvent} event - Custom move to source event.\n * @group Emits\n */\n @Output() onMoveToSource: EventEmitter<PickListMoveToSourceEvent> = new EventEmitter<PickListMoveToSourceEvent>();\n /**\n * Callback to invoke when all items are moved from target to source.\n * @param {PickListMoveAllToSourceEvent} event - Custom move all to source event.\n * @group Emits\n */\n @Output() onMoveAllToSource: EventEmitter<PickListMoveAllToSourceEvent> = new EventEmitter<PickListMoveAllToSourceEvent>();\n /**\n * Callback to invoke when all items are moved from source to target.\n * @param {PickListMoveAllToTargetEvent} event - Custom move all to target event.\n * @group Emits\n */\n @Output() onMoveAllToTarget: EventEmitter<PickListMoveAllToTargetEvent> = new EventEmitter<PickListMoveAllToTargetEvent>();\n /**\n * Callback to invoke when items are moved from source to target.\n * @param {PickListMoveToTargetEvent} event - Custom move to target event.\n * @group Emits\n */\n @Output() onMoveToTarget: EventEmitter<PickListMoveToTargetEvent> = new EventEmitter<PickListMoveToTargetEvent>();\n /**\n * Callback to invoke when items are reordered within source list.\n * @param {PickListSourceReorderEvent} event - Custom source reorder event.\n * @group Emits\n */\n @Output() onSourceReorder: EventEmitter<PickListSourceReorderEvent> = new EventEmitter<PickListSourceReorderEvent>();\n /**\n * Callback to invoke when items are reordered within target list.\n * @param {PickListTargetReorderEvent} event - Custom target reorder event.\n * @group Emits\n */\n @Output() onTargetReorder: EventEmitter<PickListTargetReorderEvent> = new EventEmitter<PickListTargetReorderEvent>();\n /**\n * Callback to invoke when items are selected within source list.\n * @param {PickListSourceSelectEvent} event - Custom source select event.\n * @group Emits\n */\n @Output() onSourceSelect: EventEmitter<PickListSourceSelectEvent> = new EventEmitter<PickListSourceSelectEvent>();\n /**\n * Callback to invoke when items are selected within target list.\n * @param {PickListTargetSelectEvent} event - Custom target select event.\n * @group Emits\n */\n @Output() onTargetSelect: EventEmitter<PickListTargetSelectEvent> = new EventEmitter<PickListTargetSelectEvent>();\n /**\n * Callback to invoke when the source list is filtered\n * @param {PickListSourceFilterEvent} event - Custom source filter event.\n * @group Emits\n */\n @Output() onSourceFilter: EventEmitter<PickListSourceFilterEvent> = new EventEmitter<PickListSourceFilterEvent>();\n /**\n * Callback to invoke when the target list is filtered\n * @param {PickListTargetFilterEvent} event - Custom target filter event.\n * @group Emits\n */\n @Output() onTargetFilter: EventEmitter<PickListTargetFilterEvent> = new EventEmitter<PickListTargetFilterEvent>();\n\n /**\n * Callback to invoke when the list is focused\n * @param {Event} event - Browser event.\n * @group Emits\n */\n @Output() onFocus: EventEmitter<Event> = new EventEmitter<Event>();\n\n /**\n * Callback to invoke when the list is blurred\n * @param {Event} event - Browser event.\n * @group Emits\n */\n @Output() onBlur: EventEmitter<Event> = new EventEmitter<Event>();\n\n @ViewChild('sourcelist') listViewSourceChild: Listbox;\n\n @ViewChild('targetlist') listViewTargetChild: Listbox;\n\n @ViewChild('sourceFilter') sourceFilterViewChild: Nullable<ElementRef>;\n\n @ViewChild('targetFilter') targetFilterViewChild: Nullable<ElementRef>;\n\n getButtonProps(direction: string) {\n switch (direction) {\n case 'moveup':\n return { ...this.buttonProps, ...this.moveUpButtonProps };\n case 'movetop':\n return { ...this.buttonProps, ...this.moveTopButtonProps };\n case 'movedown':\n return { ...this.buttonProps, ...this.moveDownButtonProps };\n case 'movebottom':\n return { ...this.buttonProps, ...this.moveBottomButtonProps };\n case 'movetotarget':\n return { ...this.buttonProps, ...this.moveToTargetProps };\n case 'movealltotarget':\n return { ...this.buttonProps, ...this.moveAllToTargetProps };\n case 'movetosource':\n return { ...this.buttonProps, ...this.moveToSourceProps };\n case 'movealltosource':\n return { ...this.buttonProps, ...this.moveAllToSourceProps };\n default:\n return this.buttonProps;\n }\n }\n\n get moveUpAriaLabel() {\n return this.upButtonAriaLabel ? this.upButtonAriaLabel : this.config.translation.aria ? this.config.translation.aria.moveUp : undefined;\n }\n\n get moveTopAriaLabel() {\n return this.topButtonAriaLabel ? this.topButtonAriaLabel : this.config.translation.aria ? this.config.translation.aria.moveTop : undefined;\n }\n\n get moveDownAriaLabel() {\n return this.downButtonAriaLabel ? this.downButtonAriaLabel : this.config.translation.aria ? this.config.translation.aria.moveDown : undefined;\n }\n\n get moveBottomAriaLabel() {\n return this.bottomButtonAriaLabel ? this.bottomButtonAriaLabel : this.config.translation.aria ? this.config.translation.aria.moveDown : undefined;\n }\n\n get moveToTargetAriaLabel() {\n return this.rightButtonAriaLabel ? this.rightButtonAriaLabel : this.config.translation.aria ? this.config.translation.aria.moveToTarget : undefined;\n }\n\n get moveAllToTargetAriaLabel() {\n return this.allRightButtonAriaLabel ? this.allRightButtonAriaLabel : this.config.translation.aria ? this.config.translation.aria.moveAllToTarget : undefined;\n }\n\n get moveToSourceAriaLabel() {\n return this.leftButtonAriaLabel ? this.leftButtonAriaLabel : this.config.translation.aria ? this.config.translation.aria.moveToSource : undefined;\n }\n\n get moveAllToSourceAriaLabel() {\n return this.allLeftButtonAriaLabel ? this.allLeftButtonAriaLabel : this.config.translation.aria ? this.config.translation.aria.moveAllToSource : undefined;\n }\n\n get idSource() {\n return this.id + '_source';\n }\n\n get idTarget() {\n return this.id + '_target';\n }\n\n get focusedOptionId() {\n return this.focusedOptionIndex !== -1 ? this.focusedOptionIndex : null;\n }\n\n _breakpoint: string = '960px';\n\n public visibleOptionsSource: any[] | undefined | null;\n\n public visibleOptionsTarget: any[] | undefined | null;\n\n selectedItemsSource: any[] = [];\n\n selectedItemsTarget: any[] = [];\n\n reorderedListElement: any;\n\n movedUp: Nullable<boolean>;\n\n movedDown: Nullable<boolean>;\n\n itemTouched: Nullable<boolean>;\n\n styleElement: any;\n\n id: string = uuid('pn_id_');\n\n filterValueSource: Nullable<string>;\n\n filterValueTarget: Nullable<string>;\n\n fromListType: Nullable<number>;\n\n sourceFilterOptions: Nullable<PickListFilterOptions>;\n\n targetFilterOptions: Nullable<PickListFilterOptions>;\n\n readonly SOURCE_LIST: number = -1;\n\n readonly TARGET_LIST: number = 1;\n\n window: Window;\n\n media: MediaQueryList | null | undefined;\n\n viewChanged: boolean | undefined;\n\n focusedOptionIndex: any = -1;\n\n focusedOption: any | undefined;\n\n focused: any = {\n sourceList: false,\n targetList: false\n };\n\n _componentStyle = inject(PickListStyle);\n\n mediaChangeListener: VoidListener;\n\n filterService = inject(FilterService);\n\n ngOnInit() {\n super.ngOnInit();\n if (this.responsive) {\n this.createStyle();\n this.initMedia();\n }\n\n if (this.filterBy) {\n this.sourceFilterOptions = {\n filter: (value) => this.filterSource(value),\n reset: () => this.resetSourceFilter()\n };\n\n this.targetFilterOptions = {\n filter: (value) => this.filterTarget(value),\n reset: () => this.resetTargetFilter()\n };\n }\n }\n\n /**\n * Custom item template.\n * @group Templates\n */\n @ContentChild('item', { descendants: false }) itemTemplate: TemplateRef<any>;\n\n /**\n * Custom source header template.\n * @group Templates\n */\n @ContentChild('sourceHeader', { descendants: false }) sourceHeaderTemplate: TemplateRef<any>;\n\n /**\n * Custom target header template.\n * @group Templates\n */\n @ContentChild('targetHeader', { descendants: false }) targetHeaderTemplate: TemplateRef<any>;\n\n /**\n * Custom source filter template.\n * @group Templates\n */\n @ContentChild('sourceFilter', { descendants: false }) sourceFilterTemplate: TemplateRef<{ options: PickListFilterOptions }>;\n\n /**\n * Custom target filter template.\n * @group Templates\n */\n @ContentChild('targetFilter', { descendants: false }) targetFilterTemplate: TemplateRef<{ options: PickListFilterOptions }>;\n\n /**\n * Custom empty message when source is empty template.\n * @group Templates\n */\n @ContentChild('emptymessagesource', { descendants: false }) emptyMessageSourceTemplate: TemplateRef<any>;\n\n /**\n * Custom empty filter message when source is empty template.\n * @group Templates\n */\n @ContentChild('emptyfiltermessagesource', { descendants: false }) emptyFilterMessageSourceTemplate: TemplateRef<any>;\n\n /**\n * Custom empty message when target is empty template.\n * @group Templates\n */\n @ContentChild('emptymessagetarget', { descendants: false }) emptyMessageTargetTemplate: TemplateRef<any>;\n\n /**\n * Custom empty filter message when target is empty template.\n * @group Templates\n */\n @ContentChild('emptyfiltermessagetarget', { descendants: false }) emptyFilterMessageTargetTemplate: TemplateRef<any>;\n\n /**\n * Custom move up icon template.\n * @group Templates\n */\n @ContentChild('moveupicon', { descendants: false }) moveUpIconTemplate: TemplateRef<{ $implicit: boolean }>;\n\n /**\n * Custom move top icon template.\n * @group Templates\n */\n @ContentChild('movetopicon', { descendants: false }) moveTopIconTemplate: TemplateRef<{ $implicit: boolean }>;\n\n /**\n * Custom move down icon template.\n * @group Templates\n */\n @ContentChild('movedownicon', { descendants: false }) moveDownIconTemplate: TemplateRef<{ $implicit: boolean }>;\n\n /**\n * Custom move bottom icon template.\n * @group Templates\n */\n @ContentChild('movebottomicon', { descendants: false }) moveBottomIconTemplate: TemplateRef<{ $implicit: boolean }>;\n\n /**\n * Custom move to target icon template.\n * @group Templates\n */\n @ContentChild('movetotargeticon', { descendants: false }) moveToTargetIconTemplate: TemplateRef<{ $implicit: boolean }>;\n\n /**\n * Custom move all to target icon template.\n * @group Templates\n */\n @ContentChild('movealltotargeticon', { descendants: false }) moveAllToTargetIconTemplate: TemplateRef<{ $implicit: boolean }>;\n\n /**\n * Custom move to source icon template.\n * @group Templates\n */\n @ContentChild('movetosourceicon', { descendants: false }) moveToSourceIconTemplate: TemplateRef<{ $implicit: boolean }>;\n\n /**\n * Custom move all to source icon template.\n * @group Templates\n */\n @ContentChild('movealltosourceicon', { descendants: false }) moveAllToSourceIconTemplate: TemplateRef<{ $implicit: boolean }>;\n\n /**\n * Custom target filter icon template.\n * @group Templates\n */\n @ContentChild('targetfiltericon', { descendants: false }) targetFilterIconTemplate: TemplateRef<{ options: PickListFilterOptions }>;\n\n /**\n * Custom source filter icon template.\n * @group Templates\n */\n @ContentChild('sourcefiltericon', { descendants: false }) sourceFilterIconTemplate: TemplateRef<{ options: PickListFilterOptions }>;\n\n @ContentChildren(PrimeTemplate) templates!: QueryList<PrimeTemplate>;\n\n _itemTemplate: TemplateRef<any> | undefined;\n\n _sourceHeaderTemplate: TemplateRef<any> | undefined;\n\n _targetHeaderTemplate: TemplateRef<any> | undefined;\n\n _sourceFilterTemplate: TemplateRef<any> | undefined;\n\n _targetFilterTemplate: TemplateRef<any> | undefined;\n\n _emptyMessageSourceTemplate: TemplateRef<any> | undefined;\n\n _emptyFilterMessageSourceTemplate: TemplateRef<any> | undefined;\n\n _emptyMessageTargetTemplate: TemplateRef<any> | undefined;\n\n _emptyFilterMessageTargetTemplate: TemplateRef<any> | undefined;\n\n _moveUpIconTemplate: TemplateRef<any> | undefined;\n\n _moveTopIconTemplate: TemplateRef<any> | undefined;\n\n _moveDownIconTemplate: TemplateRef<any> | undefined;\n\n _moveBottomIconTemplate: TemplateRef<any> | undefined;\n\n _moveToTargetIconTemplate: TemplateRef<any> | undefined;\n\n _moveAllToTargetIconTemplate: TemplateRef<any> | undefined;\n\n _moveToSourceIconTemplate: TemplateRef<any> | undefined;\n\n _moveAllToSourceIconTemplate: TemplateRef<any> | undefined;\n\n _targetFilterIconTemplate: TemplateRef<any> | undefined;\n\n _sourceFilterIconTemplate: TemplateRef<any> | undefined;\n\n ngAfterContentInit() {\n (this.templates as QueryList<PrimeTemplate>).forEach((item) => {\n switch (item.getType()) {\n case 'item':\n this._itemTemplate = item.template;\n break;\n\n case 'option':\n this._itemTemplate = item.template;\n break;\n\n case 'sourceHeader':\n this._sourceHeaderTemplate = item.template;\n break;\n\n case 'targetHeader':\n this._targetHeaderTemplate = item.template;\n break;\n\n case 'sourceFilter':\n this._sourceFilterTemplate = item.template;\n break;\n\n case 'targetFilter':\n this._targetFilterTemplate = item.template;\n break;\n\n case 'emptymessagesource':\n this._emptyMessageSourceTemplate = item.template;\n break;\n\n case 'emptyfiltermessagesource':\n this._emptyFilterMessageSourceTemplate = item.template;\n break;\n\n case 'emptymessagetarget':\n this._emptyMessageTargetTemplate = item.template;\n break;\n\n case 'emptyfiltermessagetarget':\n this._emptyFilterMessageTargetTemplate = item.template;\n