2023-05-24 14:26:41 +00:00
|
|
|
<script>
|
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
2023-10-02 10:46:09 +00:00
|
|
|
import ToggleButtonStyle from 'primevue/togglebutton/style';
|
2023-05-24 14:26:41 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'BaseToggleButton',
|
|
|
|
extends: BaseComponent,
|
|
|
|
props: {
|
|
|
|
modelValue: Boolean,
|
|
|
|
onIcon: String,
|
|
|
|
offIcon: String,
|
|
|
|
onLabel: {
|
|
|
|
type: String,
|
|
|
|
default: 'Yes'
|
|
|
|
},
|
|
|
|
offLabel: {
|
|
|
|
type: String,
|
|
|
|
default: 'No'
|
|
|
|
},
|
|
|
|
iconPos: {
|
|
|
|
type: String,
|
|
|
|
default: 'left'
|
|
|
|
},
|
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
tabindex: {
|
|
|
|
type: Number,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputId: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputClass: {
|
|
|
|
type: [String, Object],
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputStyle: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputProps: {
|
|
|
|
type: null,
|
|
|
|
default: null
|
|
|
|
},
|
2023-11-24 12:15:40 +00:00
|
|
|
ariaLabelledby: {
|
2023-05-24 14:26:41 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
2023-11-24 12:15:40 +00:00
|
|
|
ariaLabel: {
|
2023-05-24 14:26:41 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
2023-10-02 10:46:09 +00:00
|
|
|
style: ToggleButtonStyle,
|
2023-05-30 12:28:04 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-05-24 14:26:41 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|