2023-05-24 12:19:17 +00:00
|
|
|
<script>
|
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
2023-10-02 10:46:09 +00:00
|
|
|
import KnobStyle from 'primevue/knob/style';
|
2024-03-28 14:26:59 +00:00
|
|
|
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,
|
2024-04-15 09:17:29 +00:00
|
|
|
default: () => {
|
|
|
|
return $dt('knob.value.background').variable;
|
|
|
|
}
|
2023-05-24 12:19:17 +00:00
|
|
|
},
|
|
|
|
rangeColor: {
|
|
|
|
type: String,
|
2024-04-15 09:17:29 +00:00
|
|
|
default: () => {
|
|
|
|
return $dt('knob.range.background').variable;
|
|
|
|
}
|
2023-05-24 12:19:17 +00:00
|
|
|
},
|
|
|
|
textColor: {
|
|
|
|
type: String,
|
2024-04-15 09:17:29 +00:00
|
|
|
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
|
|
|
|
},
|
2023-11-24 12:15:40 +00:00
|
|
|
ariaLabelledby: {
|
2023-05-24 12:19:17 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
2023-11-24 12:15:40 +00:00
|
|
|
ariaLabel: {
|
2023-05-24 12:19:17 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
2023-10-02 10:46:09 +00:00
|
|
|
style: KnobStyle,
|
2023-05-30 11:06:57 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
2024-04-25 01:26:06 +00:00
|
|
|
$pcKnob: this,
|
2023-05-30 11:06:57 +00:00
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-05-24 12:19:17 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|