2023-05-24 11:03:56 +00:00
|
|
|
<script>
|
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
2023-10-02 10:46:09 +00:00
|
|
|
import InputNumberStyle from 'primevue/inputnumber/style';
|
2023-05-24 11:03:56 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'BaseInputNumber',
|
|
|
|
extends: BaseComponent,
|
|
|
|
props: {
|
|
|
|
modelValue: {
|
|
|
|
type: Number,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
format: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
|
|
|
showButtons: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
buttonLayout: {
|
|
|
|
type: String,
|
|
|
|
default: 'stacked'
|
|
|
|
},
|
|
|
|
incrementButtonClass: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
decrementButtonClass: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
incrementButtonIcon: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
decrementButtonIcon: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
locale: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
localeMatcher: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
mode: {
|
|
|
|
type: String,
|
|
|
|
default: 'decimal'
|
|
|
|
},
|
|
|
|
prefix: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
suffix: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
currency: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
currencyDisplay: {
|
|
|
|
type: String,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
useGrouping: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
|
|
|
minFractionDigits: {
|
|
|
|
type: Number,
|
|
|
|
default: undefined
|
|
|
|
},
|
|
|
|
maxFractionDigits: {
|
|
|
|
type: Number,
|
|
|
|
default: undefined
|
|
|
|
},
|
2023-12-22 00:24:57 +00:00
|
|
|
roundingMode: {
|
|
|
|
type: String,
|
|
|
|
default: 'halfExpand',
|
|
|
|
validator(value) {
|
2023-12-22 00:25:54 +00:00
|
|
|
return ['ceil', 'floor', 'expand', 'trunc', 'halfCeil', 'halfFloor', 'halfExpand', 'halfTrunc', 'halfEven'].includes(value);
|
2023-12-22 00:24:57 +00:00
|
|
|
}
|
|
|
|
},
|
2023-05-24 11:03:56 +00:00
|
|
|
min: {
|
|
|
|
type: Number,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
max: {
|
|
|
|
type: Number,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
step: {
|
|
|
|
type: Number,
|
|
|
|
default: 1
|
|
|
|
},
|
|
|
|
allowEmpty: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true
|
|
|
|
},
|
|
|
|
highlightOnFocus: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
readonly: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
2024-01-30 11:27:56 +00:00
|
|
|
},
|
2024-01-31 08:02:53 +00:00
|
|
|
variant: {
|
|
|
|
type: String,
|
2024-02-02 11:46:26 +00:00
|
|
|
default: null
|
2024-01-31 08:02:53 +00:00
|
|
|
},
|
2024-01-30 11:27:56 +00:00
|
|
|
invalid: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
2023-05-24 11:03:56 +00:00
|
|
|
},
|
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
placeholder: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputId: {
|
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputClass: {
|
|
|
|
type: [String, Object],
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputStyle: {
|
|
|
|
type: Object,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
inputProps: {
|
|
|
|
type: null,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
incrementButtonProps: {
|
|
|
|
type: null,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
decrementButtonProps: {
|
|
|
|
type: null,
|
|
|
|
default: null
|
|
|
|
},
|
2023-11-24 12:15:40 +00:00
|
|
|
ariaLabelledby: {
|
2023-05-24 11:03:56 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
},
|
2023-11-24 12:15:40 +00:00
|
|
|
ariaLabel: {
|
2023-05-24 11:03:56 +00:00
|
|
|
type: String,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
},
|
2023-10-02 10:46:09 +00:00
|
|
|
style: InputNumberStyle,
|
2023-05-30 11:06:57 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-05-24 11:03:56 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|