Merge pull request #2739 from tugcekucukoglu/picklist

Fixed #2697 - PickList: Disable show source and target buttons
pull/2740/head
Tuğçe Küçükoğlu 2022-06-30 16:56:01 +03:00 committed by GitHub
commit 819da95142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 2 deletions

View File

@ -46,6 +46,18 @@ const PickListProps = [
type: "boolean",
default: "false",
description: "Whether to displays rows with alternating colors."
},
{
name: "showSourceControls",
type: "boolean",
default: "true",
description: "Whether to show buttons of source list."
},
{
name: "showTargetControls",
type: "boolean",
default: "true",
description: "Whether to show buttons of target list."
}
];

View File

@ -95,6 +95,14 @@ export interface PickListProps {
* Whether to displays rows with alternating colors.
*/
stripedRows?: boolean | undefined;
/**
* Whether to show buttons of source list.
*/
showSourceControls?: boolean | undefined;
/**
* Whether to show buttons of target list.
*/
showTargetControls?: boolean | undefined;
}
export interface PickListSlots {

View File

@ -1,6 +1,6 @@
<template>
<div :class="containerClass">
<div class="p-picklist-buttons p-picklist-source-controls">
<div class="p-picklist-buttons p-picklist-source-controls" v-if="showSourceControls">
<slot name="sourcecontrolsstart"></slot>
<PLButton type="button" icon="pi pi-angle-up" @click="moveUp($event, 0)"></PLButton>
<PLButton type="button" icon="pi pi-angle-double-up" @click="moveTop($event, 0)"></PLButton>
@ -44,7 +44,7 @@
</template>
</transition-group>
</div>
<div class="p-picklist-buttons p-picklist-target-controls">
<div class="p-picklist-buttons p-picklist-target-controls" v-if="showTargetControls">
<slot name="targetcontrolsstart"></slot>
<PLButton type="button" icon="pi pi-angle-up" @click="moveUp($event, 1)"></PLButton>
<PLButton type="button" icon="pi pi-angle-double-up" @click="moveTop($event, 1)"></PLButton>
@ -95,6 +95,14 @@ export default {
stripedRows: {
type: Boolean,
default: false
},
showSourceControls: {
type: Boolean,
default: true
},
showTargetControls: {
type: Boolean,
default: true
}
},
itemTouched: false,

View File

@ -142,6 +142,18 @@ import PickList from 'primevue/picklist';
<td>boolean</td>
<td>false</td>
<td>Whether to displays rows with alternating colors.</td>
</tr>
<tr>
<td>showSourceControls</td>
<td>boolean</td>
<td>true</td>
<td>Whether to show buttons of source list.</td>
</tr>
<tr>
<td>showTargetControls</td>
<td>boolean</td>
<td>true</td>
<td>Whether to show buttons of target list.</td>
</tr>
</tbody>
</table>