Refactor #3965 - For InputMask

This commit is contained in:
Tuğçe Küçükoğlu 2023-05-24 13:28:20 +03:00
parent 98599434e8
commit c51d223526
3 changed files with 65 additions and 34 deletions

View file

@ -0,0 +1,57 @@
<script>
import BaseComponent from 'primevue/basecomponent';
import { useStyle } from 'primevue/usestyle';
const styles = `
`;
const classes = {
root: ({ instance }) => [
'p-inputmask p-inputtext p-component',
{
'p-filled': instance.filled
}
]
};
const { load: loadStyle, unload: unloadStyle } = useStyle(styles, { id: 'primevue_inputmask_style', manual: true });
export default {
name: 'BaseInputMask',
extends: BaseComponent,
props: {
modelValue: null,
slotChar: {
type: String,
default: '_'
},
mask: {
type: String,
default: null
},
autoClear: {
type: Boolean,
default: true
},
unmask: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
}
},
css: {
classes
},
watch: {
isUnstyled: {
immediate: true,
handler(newValue) {
!newValue && loadStyle();
}
}
}
};
</script>