parent
cf692f65c2
commit
cbe43376ba
|
@ -117,11 +117,19 @@ const SplitButtonEvents = [
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const SplitButtonSlots = [
|
||||||
|
{
|
||||||
|
name: 'menubuttonicon',
|
||||||
|
description: 'Custom menu button icon template.'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
splitbutton: {
|
splitbutton: {
|
||||||
name: 'SplitButton',
|
name: 'SplitButton',
|
||||||
description: 'SplitButton groups a set of commands in an overlay with a default command.',
|
description: 'SplitButton groups a set of commands in an overlay with a default command.',
|
||||||
props: SplitButtonProps,
|
props: SplitButtonProps,
|
||||||
events: SplitButtonEvents
|
events: SplitButtonEvents,
|
||||||
|
slots: SplitButtonSlots
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
<SDButton
|
<SDButton
|
||||||
type="button"
|
type="button"
|
||||||
:class="buttonClassName"
|
:class="buttonClassName"
|
||||||
:icon="iconClassName"
|
|
||||||
@click="onClick($event)"
|
@click="onClick($event)"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
@keydown="onTogglerKeydown"
|
@keydown="onTogglerKeydown"
|
||||||
|
@ -13,7 +12,10 @@
|
||||||
:aria-controls="id + '_list'"
|
:aria-controls="id + '_list'"
|
||||||
:aria-label="ariaLabel"
|
:aria-label="ariaLabel"
|
||||||
:aria-labelledby="ariaLabelledby"
|
:aria-labelledby="ariaLabelledby"
|
||||||
/>
|
>
|
||||||
|
<component v-if="d_visible && !!hideIcon" :is="hideIcon ? 'span' : 'PlusIcon'" :class="hideIcon" />
|
||||||
|
<component v-else :is="showIcon ? 'span' : 'PlusIcon'" :class="showIcon" />
|
||||||
|
</SDButton>
|
||||||
</slot>
|
</slot>
|
||||||
<ul :ref="listRef" :id="id + '_list'" class="p-speeddial-list" role="menu" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" :aria-activedescendant="focused ? focusedOptionId : undefined" tabindex="-1">
|
<ul :ref="listRef" :id="id + '_list'" class="p-speeddial-list" role="menu" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" :aria-activedescendant="focused ? focusedOptionId : undefined" tabindex="-1">
|
||||||
<template v-for="(item, index) of model" :key="index">
|
<template v-for="(item, index) of model" :key="index">
|
||||||
|
@ -45,6 +47,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Button from 'primevue/button';
|
import Button from 'primevue/button';
|
||||||
|
import PlusIcon from 'primevue/icon/plus';
|
||||||
import Ripple from 'primevue/ripple';
|
import Ripple from 'primevue/ripple';
|
||||||
import Tooltip from 'primevue/tooltip';
|
import Tooltip from 'primevue/tooltip';
|
||||||
import { DomHandler, UniqueComponentId } from 'primevue/utils';
|
import { DomHandler, UniqueComponentId } from 'primevue/utils';
|
||||||
|
@ -91,9 +94,12 @@ export default {
|
||||||
maskClass: null,
|
maskClass: null,
|
||||||
showIcon: {
|
showIcon: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'pi pi-plus'
|
default: undefined
|
||||||
|
},
|
||||||
|
hideIcon: {
|
||||||
|
type: String,
|
||||||
|
default: undefined
|
||||||
},
|
},
|
||||||
hideIcon: null,
|
|
||||||
rotateAnimation: {
|
rotateAnimation: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
@ -509,9 +515,6 @@ export default {
|
||||||
this.buttonClass
|
this.buttonClass
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
iconClassName() {
|
|
||||||
return this.d_visible && !!this.hideIcon ? this.hideIcon : this.showIcon;
|
|
||||||
},
|
|
||||||
maskClassName() {
|
maskClassName() {
|
||||||
return [
|
return [
|
||||||
'p-speeddial-mask',
|
'p-speeddial-mask',
|
||||||
|
@ -526,7 +529,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
SDButton: Button
|
SDButton: Button,
|
||||||
|
PlusIcon: PlusIcon
|
||||||
},
|
},
|
||||||
directives: {
|
directives: {
|
||||||
ripple: Ripple,
|
ripple: Ripple,
|
||||||
|
|
|
@ -111,6 +111,10 @@ export interface SplitButtonSlots {
|
||||||
* Button part of the content can easily be customized with the default slot instead of using the built-in modes.
|
* Button part of the content can easily be customized with the default slot instead of using the built-in modes.
|
||||||
*/
|
*/
|
||||||
default(): VNode[];
|
default(): VNode[];
|
||||||
|
/**
|
||||||
|
* Custom menu button icon template.
|
||||||
|
*/
|
||||||
|
menubuttonicon(): VNode[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
ref="button"
|
ref="button"
|
||||||
type="button"
|
type="button"
|
||||||
class="p-splitbutton-menubutton"
|
class="p-splitbutton-menubutton"
|
||||||
:icon="menuButtonIcon"
|
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
:aria-expanded="isExpanded"
|
:aria-expanded="isExpanded"
|
||||||
|
@ -15,13 +14,18 @@
|
||||||
@click="onDropdownButtonClick"
|
@click="onDropdownButtonClick"
|
||||||
@keydown="onDropdownKeydown"
|
@keydown="onDropdownKeydown"
|
||||||
v-bind="menuButtonProps"
|
v-bind="menuButtonProps"
|
||||||
/>
|
>
|
||||||
|
<slot name="menubuttonicon">
|
||||||
|
<component :is="menuButtonIcon ? 'span' : 'ChevronDownIcon'" :class="menuButtonIcon" />
|
||||||
|
</slot>
|
||||||
|
</PVSButton>
|
||||||
<PVSMenu ref="menu" :id="ariaId + '_overlay'" :model="model" :popup="true" :autoZIndex="autoZIndex" :baseZIndex="baseZIndex" :appendTo="appendTo" />
|
<PVSMenu ref="menu" :id="ariaId + '_overlay'" :model="model" :popup="true" :autoZIndex="autoZIndex" :baseZIndex="baseZIndex" :appendTo="appendTo" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Button from 'primevue/button';
|
import Button from 'primevue/button';
|
||||||
|
import ChevronDownIcon from 'primevue/icon/chevrondown';
|
||||||
import TieredMenu from 'primevue/tieredmenu';
|
import TieredMenu from 'primevue/tieredmenu';
|
||||||
import { UniqueComponentId } from 'primevue/utils';
|
import { UniqueComponentId } from 'primevue/utils';
|
||||||
|
|
||||||
|
@ -75,7 +79,7 @@ export default {
|
||||||
},
|
},
|
||||||
menuButtonIcon: {
|
menuButtonIcon: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'pi pi-chevron-down'
|
default: undefined
|
||||||
},
|
},
|
||||||
severity: {
|
severity: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -152,7 +156,8 @@ export default {
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
PVSButton: Button,
|
PVSButton: Button,
|
||||||
PVSMenu: TieredMenu
|
PVSMenu: TieredMenu,
|
||||||
|
ChevronDownIcon: ChevronDownIcon
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue