primevue-mirror/components/lib/knob/BaseKnob.vue

89 lines
1.9 KiB
Vue
Raw Normal View History

2023-05-24 12:19:17 +00:00
<script>
import BaseComponent from 'primevue/basecomponent';
import KnobStyle from 'primevue/knob/style';
import { $dt } from 'primevue/themes';
2023-05-24 12:19:17 +00:00
export default {
name: 'BaseKnob',
extends: BaseComponent,
props: {
modelValue: {
type: Number,
default: null
},
size: {
type: Number,
default: 100
},
disabled: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
},
step: {
type: Number,
default: 1
},
min: {
type: Number,
default: 0
},
max: {
type: Number,
default: 100
},
valueColor: {
type: String,
default: () => {
return $dt('knob.value.background').variable;
}
2023-05-24 12:19:17 +00:00
},
rangeColor: {
type: String,
default: () => {
return $dt('knob.range.background').variable;
}
2023-05-24 12:19:17 +00:00
},
textColor: {
type: String,
default: () => {
return $dt('knob.text.color').variable;
}
2023-05-24 12:19:17 +00:00
},
strokeWidth: {
type: Number,
default: 14
},
showValue: {
type: Boolean,
default: true
},
valueTemplate: {
type: String,
default: '{value}'
},
tabindex: {
type: Number,
default: 0
},
ariaLabelledby: {
2023-05-24 12:19:17 +00:00
type: String,
default: null
},
ariaLabel: {
2023-05-24 12:19:17 +00:00
type: String,
default: null
}
},
style: KnobStyle,
provide() {
return {
$parentInstance: this
};
2023-05-24 12:19:17 +00:00
}
};
</script>