mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3965 - For InputMask
This commit is contained in:
parent
98599434e8
commit
c51d223526
3 changed files with 65 additions and 34 deletions
57
components/lib/inputmask/BaseInputMask.vue
Normal file
57
components/lib/inputmask/BaseInputMask.vue
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue