@cnamts/vue-dot
Version:
Implementation of our Design System for the French Health Insurance
32 lines (25 loc) • 543 B
text/typescript
import Vue from 'vue';
import Component, { mixins } from 'vue-class-component';
const Props = Vue.extend({
props: {
mask: {
type: [String, Boolean],
default: undefined
}
}
});
const MixinsDeclaration = mixins(Props);
export class MaskValue extends MixinsDeclaration {
// DatePicker mixin
dateFormat!: string;
get maskValue(): string | undefined {
if (this.mask === false) {
return;
}
if (typeof this.mask === 'string') {
return this.mask;
}
return this.dateFormat.replace(/[a-z]/gmi, '#');
}
}