Skip to content

Commit

Permalink
Merge pull request #2739 from tugcekucukoglu/picklist
Browse files Browse the repository at this point in the history
Fixed #2697 - PickList: Disable show source and target buttons
  • Loading branch information
tugcekucukoglu authored Jun 30, 2022
2 parents 7481e12 + acc4040 commit 819da95
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
12 changes: 12 additions & 0 deletions api-generator/components/picklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
];

Expand Down
8 changes: 8 additions & 0 deletions src/components/picklist/PickList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 10 additions & 2 deletions src/components/picklist/PickList.vue
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -95,6 +95,14 @@ export default {
stripedRows: {
type: Boolean,
default: false
},
showSourceControls: {
type: Boolean,
default: true
},
showTargetControls: {
type: Boolean,
default: true
}
},
itemTouched: false,
Expand Down
12 changes: 12 additions & 0 deletions src/views/picklist/PickListDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 819da95

Please sign in to comment.