UNPKG

primevue

Version:

PrimeVue is a premium UI library for Vue featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock, wh

1,052 lines (1,046 loc) 43.3 kB
import AngleDoubleDown from '@primeicons/vue/angle-double-down'; import AngleDoubleLeft from '@primeicons/vue/angle-double-left'; import AngleDoubleRight from '@primeicons/vue/angle-double-right'; import AngleDoubleUp from '@primeicons/vue/angle-double-up'; import AngleDown from '@primeicons/vue/angle-down'; import AngleLeft from '@primeicons/vue/angle-left'; import AngleRight from '@primeicons/vue/angle-right'; import AngleUp from '@primeicons/vue/angle-up'; import { setAttribute, find } from '@primeuix/utils/dom'; import { isEmpty, findIndexInList } from '@primeuix/utils/object'; import Button from 'primevue/button'; import Listbox from 'primevue/listbox'; import Ripple from 'primevue/ripple'; import BaseComponent from '@primevue/core/basecomponent'; import PickListStyle from 'primevue/picklist/style'; import { resolveComponent, openBlock, createElementBlock, mergeProps, renderSlot, createVNode, withCtx, createCommentVNode, createElementVNode, createSlots, createBlock, resolveDynamicComponent } from 'vue'; var script$1 = { name: 'BasePickList', "extends": BaseComponent, props: { modelValue: { type: Array, "default": function _default() { return [[], []]; } }, selection: { type: Array, "default": function _default() { return [[], []]; } }, dataKey: { type: String, "default": null }, listStyle: { type: null, "default": null }, metaKeySelection: { type: Boolean, "default": false }, autoOptionFocus: { type: Boolean, "default": true }, focusOnHover: { type: Boolean, "default": true }, responsive: { type: Boolean, "default": true }, breakpoint: { type: String, "default": '960px' }, striped: { type: Boolean, "default": false }, scrollHeight: { type: String, "default": '14rem' }, filterBy: { type: [String, Array], "default": null }, filterLocale: { type: String, "default": undefined }, filterMatchMode: { type: String, "default": 'contains' }, showSourceFilter: { type: Boolean, "default": true }, showTargetFilter: { type: Boolean, "default": true }, sourceFilterPlaceholder: { type: String, "default": null }, targetFilterPlaceholder: { type: String, "default": null }, filterMessage: { type: String, "default": null }, emptyFilterMessage: { type: String, "default": null }, emptyMessage: { type: String, "default": null }, showSourceControls: { type: Boolean, "default": true }, showTargetControls: { type: Boolean, "default": true }, buttonProps: { type: Object, "default": function _default() { return { severity: 'secondary', iconOnly: true }; } }, moveUpButtonProps: { type: null, "default": null }, moveTopButtonProps: { type: null, "default": null }, moveDownButtonProps: { type: null, "default": null }, moveBottomButtonProps: { type: null, "default": null }, moveToTargetProps: { type: null, "default": null }, moveAllToTargetProps: { type: null, "default": null }, moveToSourceProps: { type: null, "default": null }, moveAllToSourceProps: { type: null, "default": null }, tabindex: { type: Number, "default": 0 }, disabled: { type: Boolean, "default": false } }, style: PickListStyle, provide: function provide() { return { $pcPickList: this, $parentInstance: this }; } }; function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = true, u = false; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = true, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } var script = { name: 'PickList', "extends": script$1, inheritAttrs: false, emits: ['update:modelValue', 'reorder', 'update:selection', 'selection-change', 'move-to-target', 'move-to-source', 'move-all-to-target', 'move-all-to-source', 'focus', 'blur', 'filter'], itemTouched: false, reorderDirection: null, reorderedListIndex: null, styleElement: null, media: null, mediaChangeListener: null, data: function data() { return { d_selection: this.selection, viewChanged: false }; }, watch: { selection: function selection(newValue) { this.d_selection = newValue; }, breakpoint: function breakpoint() { this.destroyMedia(); this.initMedia(); } }, updated: function updated() { if (this.reorderDirection) { this.updateListScroll(this.reorderedListIndex); this.reorderDirection = null; this.reorderedListIndex = null; } }, beforeUnmount: function beforeUnmount() { this.destroyStyle(); this.destroyMedia(); }, mounted: function mounted() { if (this.responsive) { this.createStyle(); this.initMedia(); } }, methods: { updateSelection: function updateSelection(event) { this.$emit('update:selection', this.d_selection); this.$emit('selection-change', { originalEvent: event, value: this.d_selection }); }, onChangeSelection: function onChangeSelection(params, listIndex) { this.d_selection[listIndex] = params.value; this.updateSelection(params.event); }, onListFocus: function onListFocus(event, listType) { this.$emit('focus', event, listType); }, onListBlur: function onListBlur(event, listType) { this.$emit('blur', event, listType); }, onFilter: function onFilter(event, type) { this.$emit('filter', { originalEvent: event.originalEvent, value: event.value, filterValue: event.filterValue, type: type }); }, onReorderUpdate: function onReorderUpdate(event, value, listIndex) { this.reorderedListIndex = listIndex; this.$emit('update:modelValue', value); this.$emit('reorder', { originalEvent: event, value: value, direction: this.reorderDirection, listIndex: listIndex }); }, onItemDblClick: function onItemDblClick(event, listIndex) { if (listIndex === 0) this.moveToTarget({ event: event.originalEvent });else if (listIndex === 1) this.moveToSource({ event: event.originalEvent }); }, moveUp: function moveUp(event, listIndex) { if (this.d_selection && this.d_selection[listIndex]) { var valueList = _toConsumableArray(this.modelValue[listIndex]); var selectionList = this.d_selection[listIndex]; var sortedSelection = this.sortByIndexInList(selectionList, valueList); var _iterator = _createForOfIteratorHelper(sortedSelection), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var selectedItem = _step.value; var selectedItemIndex = findIndexInList(selectedItem, valueList); if (selectedItemIndex > 0 && findIndexInList(valueList[selectedItemIndex - 1], selectionList) === -1) { var movedItem = valueList[selectedItemIndex]; var temp = valueList[selectedItemIndex - 1]; valueList[selectedItemIndex - 1] = movedItem; valueList[selectedItemIndex] = temp; } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } var value = _toConsumableArray(this.modelValue); value[listIndex] = valueList; this.reorderDirection = 'up'; this.onReorderUpdate(event, value, listIndex); } }, moveTop: function moveTop(event, listIndex) { if (this.d_selection && this.d_selection[listIndex]) { var valueList = _toConsumableArray(this.modelValue[listIndex]); var selectionList = this.d_selection[listIndex]; var sortedSelection = this.sortByIndexInList(selectionList, valueList).reverse(); var _iterator2 = _createForOfIteratorHelper(sortedSelection), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var selectedItem = _step2.value; var selectedItemIndex = findIndexInList(selectedItem, valueList); if (selectedItemIndex !== 0) { var movedItem = valueList.splice(selectedItemIndex, 1)[0]; valueList.unshift(movedItem); } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } var value = _toConsumableArray(this.modelValue); value[listIndex] = valueList; this.reorderDirection = 'top'; this.onReorderUpdate(event, value, listIndex); } }, moveDown: function moveDown(event, listIndex) { if (this.d_selection && this.d_selection[listIndex]) { var valueList = _toConsumableArray(this.modelValue[listIndex]); var selectionList = this.d_selection[listIndex]; var sortedSelection = this.sortByIndexInList(selectionList, valueList).reverse(); var _iterator3 = _createForOfIteratorHelper(sortedSelection), _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { var selectedItem = _step3.value; var selectedItemIndex = findIndexInList(selectedItem, valueList); if (selectedItemIndex < valueList.length - 1 && findIndexInList(valueList[selectedItemIndex + 1], selectionList) === -1) { var movedItem = valueList[selectedItemIndex]; var temp = valueList[selectedItemIndex + 1]; valueList[selectedItemIndex + 1] = movedItem; valueList[selectedItemIndex] = temp; } } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); } var value = _toConsumableArray(this.modelValue); value[listIndex] = valueList; this.reorderDirection = 'down'; this.onReorderUpdate(event, value, listIndex); } }, moveBottom: function moveBottom(event, listIndex) { if (this.d_selection && this.d_selection[listIndex]) { var valueList = _toConsumableArray(this.modelValue[listIndex]); var selectionList = this.d_selection[listIndex]; var sortedSelection = this.sortByIndexInList(selectionList, valueList); var _iterator4 = _createForOfIteratorHelper(sortedSelection), _step4; try { for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { var selectedItem = _step4.value; var selectedItemIndex = findIndexInList(selectedItem, valueList); if (selectedItemIndex !== valueList.length - 1) { var movedItem = valueList.splice(selectedItemIndex, 1)[0]; valueList.push(movedItem); } } } catch (err) { _iterator4.e(err); } finally { _iterator4.f(); } var value = _toConsumableArray(this.modelValue); value[listIndex] = valueList; this.reorderDirection = 'bottom'; this.onReorderUpdate(event, value, listIndex); } }, sortByIndexInList: function sortByIndexInList(items, list) { return _toConsumableArray(items).sort(function (a, b) { return findIndexInList(a, list) - findIndexInList(b, list); }); }, moveToTarget: function moveToTarget(event) { var selection = this.d_selection && this.d_selection[0] ? this.d_selection[0] : null; var sourceList = _toConsumableArray(this.modelValue[0]); var targetList = _toConsumableArray(this.modelValue[1]); if (selection) { for (var i = 0; i < selection.length; i++) { var selectedItem = selection[i]; if (findIndexInList(selectedItem, targetList) == -1) { targetList.push(sourceList.splice(findIndexInList(selectedItem, sourceList), 1)[0]); } } var value = _toConsumableArray(this.modelValue); value[0] = sourceList; value[1] = targetList; this.$emit('update:modelValue', value); this.$emit('move-to-target', { originalEvent: event, items: _toConsumableArray(new Set(selection)) }); this.d_selection[0] = []; this.updateSelection(event); } }, moveAllToTarget: function moveAllToTarget(event) { if (this.modelValue[0]) { var sourceList = _toConsumableArray(this.modelValue[0]); var targetList = _toConsumableArray(this.modelValue[1]); this.$emit('move-all-to-target', { originalEvent: event, items: sourceList }); targetList = [].concat(_toConsumableArray(targetList), _toConsumableArray(sourceList)); sourceList = []; var value = _toConsumableArray(this.modelValue); value[0] = sourceList; value[1] = targetList; this.$emit('update:modelValue', value); this.d_selection = [[], []]; this.updateSelection(event); } }, moveToSource: function moveToSource(event) { var selection = this.d_selection && this.d_selection[1] ? this.d_selection[1] : null; var sourceList = _toConsumableArray(this.modelValue[0]); var targetList = _toConsumableArray(this.modelValue[1]); if (selection) { for (var i = 0; i < selection.length; i++) { var selectedItem = selection[i]; if (findIndexInList(selectedItem, sourceList) == -1) { sourceList.push(targetList.splice(findIndexInList(selectedItem, targetList), 1)[0]); } } var value = _toConsumableArray(this.modelValue); value[0] = sourceList; value[1] = targetList; this.$emit('update:modelValue', value); this.$emit('move-to-source', { originalEvent: event, items: _toConsumableArray(new Set(selection)) }); this.d_selection[1] = []; this.updateSelection(event); } }, moveAllToSource: function moveAllToSource(event) { if (this.modelValue[1]) { var sourceList = _toConsumableArray(this.modelValue[0]); var targetList = _toConsumableArray(this.modelValue[1]); this.$emit('move-all-to-source', { originalEvent: event, items: targetList }); sourceList = [].concat(_toConsumableArray(sourceList), _toConsumableArray(targetList)); targetList = []; var value = _toConsumableArray(this.modelValue); value[0] = sourceList; value[1] = targetList; this.$emit('update:modelValue', value); this.d_selection = [[], []]; this.updateSelection(event); } }, onItemClick: function onItemClick(event, item, index, listIndex) { var listType = listIndex === 0 ? 'sourceList' : 'targetList'; this.itemTouched = false; var selectionList = this.d_selection[listIndex]; var selectedIndex = findIndexInList(item, selectionList); var selected = selectedIndex != -1; var metaSelection = this.itemTouched ? false : this.metaKeySelection; var selectedId = find(this.$refs[listType].$el, '[data-pc-section="item"]')[index].getAttribute('id'); this.focusedOptionIndex = selectedId; var _selection; if (metaSelection) { var metaKey = event.metaKey || event.ctrlKey; if (selected && metaKey) { _selection = selectionList.filter(function (val, index) { return index !== selectedIndex; }); } else { _selection = metaKey ? selectionList ? _toConsumableArray(selectionList) : [] : []; _selection.push(item); } } else { if (selected) { _selection = selectionList.filter(function (val, index) { return index !== selectedIndex; }); } else { _selection = selectionList ? _toConsumableArray(selectionList) : []; _selection.push(item); } } var newSelection = _toConsumableArray(this.d_selection); newSelection[listIndex] = _selection; this.d_selection = newSelection; this.updateSelection(event); }, updateListScroll: function updateListScroll(listIndex) { var _this = this; var listboxRef = listIndex === 0 ? this.$refs.sourceList : this.$refs.targetList; var selection = this.d_selection && this.d_selection[listIndex]; if (!listboxRef || !selection || !selection.length) { return; } var indexes = selection.map(function (item) { return findIndexInList(item, _this.modelValue[listIndex]); }); var targetIndex = this.reorderDirection === 'up' || this.reorderDirection === 'top' ? Math.min.apply(Math, _toConsumableArray(indexes)) : Math.max.apply(Math, _toConsumableArray(indexes)); listboxRef.scrollInView(targetIndex); }, initMedia: function initMedia() { this.media = window.matchMedia("(max-width: ".concat(this.breakpoint, ")")); this.viewChanged = this.media.matches; this.bindMediaChangeListener(); }, destroyMedia: function destroyMedia() { this.unbindMediaChangeListener(); }, bindMediaChangeListener: function bindMediaChangeListener() { var _this2 = this; if (this.media && !this.mediaChangeListener) { this.mediaChangeListener = function (event) { _this2.viewChanged = event.matches; }; this.media.addEventListener('change', this.mediaChangeListener); } }, unbindMediaChangeListener: function unbindMediaChangeListener() { if (this.media && this.mediaChangeListener) { this.media.removeEventListener('change', this.mediaChangeListener); this.mediaChangeListener = null; } }, createStyle: function createStyle() { if (!this.styleElement && !this.isUnstyled) { var _this$$primevue; this.styleElement = document.createElement('style'); this.styleElement.type = 'text/css'; setAttribute(this.styleElement, 'nonce', (_this$$primevue = this.$primevue) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.config) === null || _this$$primevue === void 0 || (_this$$primevue = _this$$primevue.csp) === null || _this$$primevue === void 0 ? void 0 : _this$$primevue.nonce); document.head.appendChild(this.styleElement); var innerHTML = "\n@media screen and (max-width: ".concat(this.breakpoint, ") {\n .p-picklist[").concat(this.$attrSelector, "] {\n flex-direction: column;\n }\n\n .p-picklist[").concat(this.$attrSelector, "] .p-picklist-controls {\n flex-direction: row;\n }\n}\n"); this.styleElement.innerHTML = innerHTML; } }, destroyStyle: function destroyStyle() { if (this.styleElement) { document.head.removeChild(this.styleElement); this.styleElement = null; } }, moveDisabled: function moveDisabled(index) { return this.disabled ? true : this.d_selection && (!this.d_selection[index] || !this.d_selection[index].length) ? true : false; }, moveAllDisabled: function moveAllDisabled(list) { return this.disabled ? true : isEmpty(this[list]); } }, computed: { filterFieldsValue: function filterFieldsValue() { if (!this.filterBy) return null; return Array.isArray(this.filterBy) ? this.filterBy : this.filterBy.split(',').map(function (field) { return field.trim(); }); }, idSource: function idSource() { return "".concat(this.$id, "_source"); }, idTarget: function idTarget() { return "".concat(this.$id, "_target"); }, sourceList: function sourceList() { return this.modelValue && this.modelValue[0] ? this.modelValue[0] : null; }, targetList: function targetList() { return this.modelValue && this.modelValue[1] ? this.modelValue[1] : null; }, moveUpAriaLabel: function moveUpAriaLabel() { return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveUp : undefined; }, moveTopAriaLabel: function moveTopAriaLabel() { return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveTop : undefined; }, moveDownAriaLabel: function moveDownAriaLabel() { return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveDown : undefined; }, moveBottomAriaLabel: function moveBottomAriaLabel() { return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveBottom : undefined; }, moveToTargetAriaLabel: function moveToTargetAriaLabel() { return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveToTarget : undefined; }, moveAllToTargetAriaLabel: function moveAllToTargetAriaLabel() { return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveAllToTarget : undefined; }, moveToSourceAriaLabel: function moveToSourceAriaLabel() { return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveToSource : undefined; }, moveAllToSourceAriaLabel: function moveAllToSourceAriaLabel() { return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.moveAllToSource : undefined; } }, components: { Listbox: Listbox, Button: Button, AngleRight: AngleRight, AngleLeft: AngleLeft, AngleDown: AngleDown, AngleUp: AngleUp, AngleDoubleRight: AngleDoubleRight, AngleDoubleLeft: AngleDoubleLeft, AngleDoubleDown: AngleDoubleDown, AngleDoubleUp: AngleDoubleUp }, directives: { ripple: Ripple } }; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function render(_ctx, _cache, $props, $setup, $data, $options) { var _component_AngleUp = resolveComponent("AngleUp"); var _component_Button = resolveComponent("Button"); var _component_AngleDoubleUp = resolveComponent("AngleDoubleUp"); var _component_AngleDown = resolveComponent("AngleDown"); var _component_AngleDoubleDown = resolveComponent("AngleDoubleDown"); var _component_Listbox = resolveComponent("Listbox"); return openBlock(), createElementBlock("div", mergeProps({ "class": _ctx.cx('root') }, _ctx.ptmi('root')), [_ctx.showSourceControls ? (openBlock(), createElementBlock("div", mergeProps({ key: 0, "class": _ctx.cx('sourceControls') }, _ctx.ptm('sourceControls'), { "data-pc-group-section": "controls" }), [renderSlot(_ctx.$slots, "sourcecontrolsstart"), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveUpAriaLabel, disabled: $options.moveDisabled(0), onClick: _cache[0] || (_cache[0] = function ($event) { return $options.moveUp($event, 0); }) }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveUpButtonProps), { pt: _ctx.ptm('pcSourceMoveUpButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "moveupicon", {}, function () { return [createVNode(_component_AngleUp, mergeProps(_ctx.ptm('pcSourceMoveUpButton')['icon'], { "data-pc-section": "moveupicon" }), null, 16)]; })]; }), _: 3 }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveTopAriaLabel, disabled: $options.moveDisabled(0), onClick: _cache[1] || (_cache[1] = function ($event) { return $options.moveTop($event, 0); }) }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveTopButtonProps), { pt: _ctx.ptm('pcSourceMoveTopButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "movetopicon", {}, function () { return [createVNode(_component_AngleDoubleUp, mergeProps(_ctx.ptm('pcSourceMoveTopButton')['icon'], { "data-pc-section": "movetopicon" }), null, 16)]; })]; }), _: 3 }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveDownAriaLabel, disabled: $options.moveDisabled(0), onClick: _cache[2] || (_cache[2] = function ($event) { return $options.moveDown($event, 0); }) }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveDownButtonProps), { pt: _ctx.ptm('pcSourceMoveDownButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "movedownicon", {}, function () { return [createVNode(_component_AngleDown, mergeProps(_ctx.ptm('pcSourceMoveDownButton')['icon'], { "data-pc-section": "movedownicon" }), null, 16)]; })]; }), _: 3 }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveBottomAriaLabel, disabled: $options.moveDisabled(0), onClick: _cache[3] || (_cache[3] = function ($event) { return $options.moveBottom($event, 0); }) }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveBottomButtonProps), { pt: _ctx.ptm('pcSourceMoveBottomButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "movebottomicon", {}, function () { return [createVNode(_component_AngleDoubleDown, mergeProps(_ctx.ptm('pcSourceMoveBottomButton')['icon'], { "data-pc-section": "movebottomicon" }), null, 16)]; })]; }), _: 3 }, 16, ["aria-label", "disabled", "pt", "unstyled"]), renderSlot(_ctx.$slots, "sourcecontrolsend")], 16)) : createCommentVNode("", true), createElementVNode("div", mergeProps({ "class": _ctx.cx('sourceListContainer') }, _ctx.ptm('sourceListContainer'), { "data-pc-group-section": "listcontainer" }), [createVNode(_component_Listbox, { ref: "sourceList", id: $options.idSource + '_list', modelValue: $data.d_selection[0], options: $options.sourceList, multiple: "", metaKeySelection: _ctx.metaKeySelection, listStyle: _ctx.listStyle, scrollHeight: _ctx.scrollHeight, tabindex: $options.sourceList && $options.sourceList.length > 0 ? _ctx.tabindex : -1, dataKey: _ctx.dataKey, autoOptionFocus: _ctx.autoOptionFocus, focusOnHover: _ctx.focusOnHover, striped: _ctx.striped, disabled: _ctx.disabled, filter: !!_ctx.filterBy && _ctx.showSourceFilter, filterPlaceholder: _ctx.sourceFilterPlaceholder, filterLocale: _ctx.filterLocale, filterMatchMode: _ctx.filterMatchMode, filterFields: $options.filterFieldsValue, filterMessage: _ctx.filterMessage, emptyFilterMessage: _ctx.emptyFilterMessage, emptyMessage: _ctx.emptyMessage, onFocus: _cache[4] || (_cache[4] = function ($event) { return $options.onListFocus($event, 'sourceList'); }), onBlur: _cache[5] || (_cache[5] = function ($event) { return $options.onListBlur($event, 'sourceList'); }), onChange: _cache[6] || (_cache[6] = function ($event) { return $options.onChangeSelection($event, 0); }), onItemDblclick: _cache[7] || (_cache[7] = function ($event) { return $options.onItemDblClick($event, 0); }), onFilter: _cache[8] || (_cache[8] = function ($event) { return $options.onFilter($event, 'source'); }), pt: _ctx.ptm('pcListbox'), unstyled: _ctx.unstyled, "data-pc-group-section": "list" }, createSlots({ option: withCtx(function (_ref) { var option = _ref.option, selected = _ref.selected, index = _ref.index; return [renderSlot(_ctx.$slots, "option", { item: option, option: option, selected: selected, index: index })]; }), _: 2 }, [_ctx.$slots.sourceheader ? { name: "header", fn: withCtx(function () { return [renderSlot(_ctx.$slots, "sourceheader")]; }), key: "0" } : undefined, _ctx.$slots.sourcefiltericon ? { name: "filtericon", fn: withCtx(function () { return [renderSlot(_ctx.$slots, "sourcefiltericon")]; }), key: "1" } : undefined, _ctx.$slots.sourceempty ? { name: "empty", fn: withCtx(function () { return [renderSlot(_ctx.$slots, "sourceempty")]; }), key: "2" } : undefined, _ctx.$slots.sourceemptyfilter ? { name: "emptyfilter", fn: withCtx(function () { return [renderSlot(_ctx.$slots, "sourceemptyfilter")]; }), key: "3" } : undefined, _ctx.$slots.sourcefooter ? { name: "footer", fn: withCtx(function () { return [renderSlot(_ctx.$slots, "sourcefooter")]; }), key: "4" } : undefined]), 1032, ["id", "modelValue", "options", "metaKeySelection", "listStyle", "scrollHeight", "tabindex", "dataKey", "autoOptionFocus", "focusOnHover", "striped", "disabled", "filter", "filterPlaceholder", "filterLocale", "filterMatchMode", "filterFields", "filterMessage", "emptyFilterMessage", "emptyMessage", "pt", "unstyled"])], 16), createElementVNode("div", mergeProps({ "class": _ctx.cx('transferControls') }, _ctx.ptm('transferControls'), { "data-pc-group-section": "controls" }), [renderSlot(_ctx.$slots, "movecontrolsstart"), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveToTargetAriaLabel, onClick: $options.moveToTarget, disabled: $options.moveDisabled(0) }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveToTargetProps), { pt: _ctx.ptm('pcMoveToTargetButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "movetotargeticon", { viewChanged: $data.viewChanged }, function () { return [(openBlock(), createBlock(resolveDynamicComponent($data.viewChanged ? 'AngleDown' : 'AngleRight'), mergeProps(_ctx.ptm('pcMoveToTargetButton')['icon'], { "data-pc-section": "movetotargeticon" }), null, 16))]; })]; }), _: 3 }, 16, ["aria-label", "onClick", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveAllToTargetAriaLabel, onClick: $options.moveAllToTarget, disabled: $options.moveAllDisabled('sourceList') }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveAllToTargetProps), { pt: _ctx.ptm('pcMoveAllToTargetButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "movealltotargeticon", { viewChanged: $data.viewChanged }, function () { return [(openBlock(), createBlock(resolveDynamicComponent($data.viewChanged ? 'AngleDoubleDown' : 'AngleDoubleRight'), mergeProps(_ctx.ptm('pcMoveAllToTargetButton')['icon'], { "data-pc-section": "movealltotargeticon" }), null, 16))]; })]; }), _: 3 }, 16, ["aria-label", "onClick", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveToSourceAriaLabel, onClick: $options.moveToSource, disabled: $options.moveDisabled(1) }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveToSourceProps), { pt: _ctx.ptm('pcMoveToSourceButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "movetosourceicon", { viewChanged: $data.viewChanged }, function () { return [(openBlock(), createBlock(resolveDynamicComponent($data.viewChanged ? 'AngleUp' : 'AngleLeft'), mergeProps(_ctx.ptm('pcMoveToSourceButton')['icon'], { "data-pc-section": "movetosourceicon" }), null, 16))]; })]; }), _: 3 }, 16, ["aria-label", "onClick", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveAllToSourceAriaLabel, onClick: $options.moveAllToSource, disabled: $options.moveAllDisabled('targetList') }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveAllToSourceProps), { pt: _ctx.ptm('pcMoveAllToSourceButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "movealltosourceicon", { viewChanged: $data.viewChanged }, function () { return [(openBlock(), createBlock(resolveDynamicComponent($data.viewChanged ? 'AngleDoubleUp' : 'AngleDoubleLeft'), mergeProps(_ctx.ptm('pcMoveAllToSourceButton')['icon'], { "data-pc-section": "movealltosourceicon" }), null, 16))]; })]; }), _: 3 }, 16, ["aria-label", "onClick", "disabled", "pt", "unstyled"]), renderSlot(_ctx.$slots, "movecontrolsend")], 16), createElementVNode("div", mergeProps({ "class": _ctx.cx('targetListContainer') }, _ctx.ptm('targetListContainer'), { "data-pc-group-section": "listcontainer" }), [createVNode(_component_Listbox, { ref: "targetList", id: $options.idTarget + '_list', modelValue: $data.d_selection[1], options: $options.targetList, multiple: "", metaKeySelection: _ctx.metaKeySelection, listStyle: _ctx.listStyle, scrollHeight: _ctx.scrollHeight, tabindex: $options.targetList && $options.targetList.length > 0 ? _ctx.tabindex : -1, dataKey: _ctx.dataKey, autoOptionFocus: _ctx.autoOptionFocus, focusOnHover: _ctx.focusOnHover, striped: _ctx.striped, disabled: _ctx.disabled, filter: !!_ctx.filterBy && _ctx.showTargetFilter, filterPlaceholder: _ctx.targetFilterPlaceholder, filterLocale: _ctx.filterLocale, filterMatchMode: _ctx.filterMatchMode, filterFields: $options.filterFieldsValue, filterMessage: _ctx.filterMessage, emptyFilterMessage: _ctx.emptyFilterMessage, emptyMessage: _ctx.emptyMessage, onFocus: _cache[9] || (_cache[9] = function ($event) { return $options.onListFocus($event, 'targetList'); }), onBlur: _cache[10] || (_cache[10] = function ($event) { return $options.onListBlur($event, 'targetList'); }), onChange: _cache[11] || (_cache[11] = function ($event) { return $options.onChangeSelection($event, 1); }), onItemDblclick: _cache[12] || (_cache[12] = function ($event) { return $options.onItemDblClick($event, 1); }), onFilter: _cache[13] || (_cache[13] = function ($event) { return $options.onFilter($event, 'target'); }), pt: _ctx.ptm('pcListbox'), unstyled: _ctx.unstyled, "data-pc-group-section": "list" }, createSlots({ option: withCtx(function (_ref2) { var option = _ref2.option, selected = _ref2.selected, index = _ref2.index; return [renderSlot(_ctx.$slots, "option", { item: option, option: option, selected: selected, index: index })]; }), _: 2 }, [_ctx.$slots.targetheader ? { name: "header", fn: withCtx(function () { return [renderSlot(_ctx.$slots, "targetheader")]; }), key: "0" } : undefined, _ctx.$slots.targetfiltericon ? { name: "filtericon", fn: withCtx(function () { return [renderSlot(_ctx.$slots, "targetfiltericon")]; }), key: "1" } : undefined, _ctx.$slots.targetempty ? { name: "empty", fn: withCtx(function () { return [renderSlot(_ctx.$slots, "targetempty")]; }), key: "2" } : undefined, _ctx.$slots.targetemptyfilter ? { name: "emptyfilter", fn: withCtx(function () { return [renderSlot(_ctx.$slots, "targetemptyfilter")]; }), key: "3" } : undefined, _ctx.$slots.targetfooter ? { name: "footer", fn: withCtx(function () { return [renderSlot(_ctx.$slots, "targetfooter")]; }), key: "4" } : undefined]), 1032, ["id", "modelValue", "options", "metaKeySelection", "listStyle", "scrollHeight", "tabindex", "dataKey", "autoOptionFocus", "focusOnHover", "striped", "disabled", "filter", "filterPlaceholder", "filterLocale", "filterMatchMode", "filterFields", "filterMessage", "emptyFilterMessage", "emptyMessage", "pt", "unstyled"])], 16), _ctx.showTargetControls ? (openBlock(), createElementBlock("div", mergeProps({ key: 1, "class": _ctx.cx('targetControls') }, _ctx.ptm('targetControls'), { "data-pc-group-section": "controls" }), [renderSlot(_ctx.$slots, "targetcontrolsstart"), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveUpAriaLabel, disabled: $options.moveDisabled(1), onClick: _cache[14] || (_cache[14] = function ($event) { return $options.moveUp($event, 1); }) }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveUpButtonProps), { pt: _ctx.ptm('pcTargetMoveUpButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "moveupicon", {}, function () { return [createVNode(_component_AngleUp, mergeProps(_ctx.ptm('pcTargetMoveUpButton')['icon'], { "data-pc-section": "moveupicon" }), null, 16)]; })]; }), _: 3 }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveTopAriaLabel, disabled: $options.moveDisabled(1), onClick: _cache[15] || (_cache[15] = function ($event) { return $options.moveTop($event, 1); }) }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveTopButtonProps), { pt: _ctx.ptm('pcTargetMoveTopButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "movetopicon", {}, function () { return [createVNode(_component_AngleDoubleUp, mergeProps(_ctx.ptm('pcTargetMoveTopButton')['icon'], { "data-pc-section": "movetopicon" }), null, 16)]; })]; }), _: 3 }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveDownAriaLabel, disabled: $options.moveDisabled(1), onClick: _cache[16] || (_cache[16] = function ($event) { return $options.moveDown($event, 1); }) }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveDownButtonProps), { pt: _ctx.ptm('pcTargetMoveDownButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "movedownicon", {}, function () { return [createVNode(_component_AngleDown, mergeProps(_ctx.ptm('pcTargetMoveDownButton')['icon'], { "data-pc-section": "movedownicon" }), null, 16)]; })]; }), _: 3 }, 16, ["aria-label", "disabled", "pt", "unstyled"]), createVNode(_component_Button, mergeProps({ "aria-label": $options.moveBottomAriaLabel, disabled: $options.moveDisabled(1), onClick: _cache[17] || (_cache[17] = function ($event) { return $options.moveBottom($event, 1); }) }, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.moveBottomButtonProps), { pt: _ctx.ptm('pcTargetMoveBottomButton'), unstyled: _ctx.unstyled }), { "default": withCtx(function () { return [renderSlot(_ctx.$slots, "movebottomicon", {}, function () { return [createVNode(_component_AngleDoubleDown, mergeProps(_ctx.ptm('pcTargetMoveBottomButton')['icon'], { "data-pc-section": "movebottomicon" }), null, 16)]; })]; }), _: 3 }, 16, ["aria-label", "disabled", "pt", "unstyled"]), renderSlot(_ctx.$slots, "targetcontrolsend")], 16)) : createCommentVNode("", true)], 16); } script.render = render; export { script as default };