2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
|
|
|
'p-inputnumber p-component p-inputwrapper',
|
|
|
|
{
|
2023-11-09 18:33:48 +00:00
|
|
|
'p-inputwrapper-filled': instance.filled || props.allowEmpty === false,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-inputwrapper-focus': instance.focused,
|
|
|
|
'p-inputnumber-buttons-stacked': props.showButtons && props.buttonLayout === 'stacked',
|
|
|
|
'p-inputnumber-buttons-horizontal': props.showButtons && props.buttonLayout === 'horizontal',
|
2024-01-30 11:27:56 +00:00
|
|
|
'p-inputnumber-buttons-vertical': props.showButtons && props.buttonLayout === 'vertical',
|
2024-02-02 11:46:26 +00:00
|
|
|
'p-invalid': props.invalid
|
|
|
|
}
|
|
|
|
],
|
|
|
|
input: ({ props, instance }) => [
|
|
|
|
'p-inputnumber-input',
|
|
|
|
{
|
|
|
|
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled'
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
buttonGroup: 'p-inputnumber-button-group',
|
|
|
|
incrementButton: ({ instance, props }) => [
|
|
|
|
'p-inputnumber-button p-inputnumber-button-up',
|
|
|
|
{
|
|
|
|
'p-disabled': props.showButtons && props.max !== null && instance.maxBoundry()
|
|
|
|
}
|
|
|
|
],
|
|
|
|
decrementButton: ({ instance, props }) => [
|
|
|
|
'p-inputnumber-button p-inputnumber-button-down',
|
|
|
|
{
|
|
|
|
'p-disabled': props.showButtons && props.min !== null && instance.minBoundry()
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'inputnumber',
|
|
|
|
classes
|
|
|
|
});
|