Skip to content

Commit

Permalink
Fixed #1565 - Add indicator slot
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Sep 20, 2021
1 parent dfb679e commit e367eec
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 3 deletions.
4 changes: 4 additions & 0 deletions api-generator/components/cascadeselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ const CascadeSelectSlots = [
{
name: "option",
description: "Custom content for the item's option"
},
{
name: "indicator",
description: "Custom content for the cascade select indicator"
}
];

Expand Down
4 changes: 4 additions & 0 deletions api-generator/components/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ const DropdownSlots = [
{
name: "value",
description: "Custom content for the item's value"
},
{
name: "indicator",
description: "Custom content for the dropdown indicator"
}
];

Expand Down
4 changes: 4 additions & 0 deletions api-generator/components/multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ const MultiSelectSlots = [
{
name: "value",
description: "Custom content for the item value"
},
{
name: "indicator",
description: "Custom content for the multiselect indicator"
}
];

Expand Down
2 changes: 2 additions & 0 deletions src/components/cascadeselect/CascadeSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ declare class CascadeSelect extends Vue {
$emit(eventName: 'hide'): this;
$slot: {
option: VNode[];
value: VNode[];
indicator: VNode[];
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/components/cascadeselect/CascadeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
</slot>
</span>
<div class="p-cascadeselect-trigger" role="button" aria-haspopup="listbox" :aria-expanded="overlayVisible">
<span class="p-cascadeselect-trigger-icon pi pi-chevron-down"></span>
<slot name="indicator">
<span class="p-cascadeselect-trigger-icon pi pi-chevron-down"></span>
</slot>
</div>
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave">
<div ref="overlay" class="p-cascadeselect-panel p-component" v-if="overlayVisible">
Expand Down
2 changes: 2 additions & 0 deletions src/components/dropdown/Dropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ declare class Dropdown extends Vue {
$emit(eventName: 'filter', e: { originalEvent: Event, value: string }): this;
$slot: {
option: VNode[];
value: VNode[];
indicator: VNode[];
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/components/dropdown/Dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
</span>
<i v-if="showClear && value != null" class="p-dropdown-clear-icon pi pi-times" @click="onClearClick($event)"></i>
<div class="p-dropdown-trigger" role="button" aria-haspopup="listbox" :aria-expanded="overlayVisible">
<span class="p-dropdown-trigger-icon pi pi-chevron-down"></span>
<slot name="indicator">
<span class="p-dropdown-trigger-icon pi pi-chevron-down"></span>
</slot>
</div>
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave">
<div ref="overlay" class="p-dropdown-panel p-component" v-if="overlayVisible">
Expand Down
1 change: 1 addition & 0 deletions src/components/multiselect/MultiSelect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ declare class MultiSelect extends Vue {
$slots: {
value: VNode[];
option: VNode[];
indicator: VNode[];
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/components/multiselect/MultiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
</div>
</div>
<div class="p-multiselect-trigger">
<span class="p-multiselect-trigger-icon pi pi-chevron-down"></span>
<slot name="indicator">
<span class="p-multiselect-trigger-icon pi pi-chevron-down"></span>
</slot>
</div>
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave">
<div ref="overlay" class="p-multiselect-panel p-component" v-if="overlayVisible">
Expand Down
4 changes: 4 additions & 0 deletions src/views/cascadeselect/CascadeSelectDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ exports default {
<td>option</td>
<td>option: Option instance</td>
</tr>
<tr>
<td>indicator</td>
<td>-</td>
</tr>
</tbody>
</table>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/views/dropdown/DropdownDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ data() {
<td>value: Value of the component <br />
placeholder: Placeholder prop value</td>
</tr>
<tr>
<td>indicator</td>
<td>-</td>
</tr>
</tbody>
</table>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/views/multiselect/MultiSelectDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ data() {
<td>option: Option instance <br />
index: Index of the option</td>
</tr>
<tr>
<td>indicator</td>
<td>-</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit e367eec

Please sign in to comment.