mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-11-03 21:34:30 +08:00
30 lines
660 B
JavaScript
30 lines
660 B
JavaScript
import { BFormInput } from "bootstrap-vue/src/components/form-input";
|
|
import { createMask } from "imask";
|
|
|
|
export default {
|
|
extends: BFormInput,
|
|
props: {
|
|
mask: {
|
|
type: String,
|
|
required: false,
|
|
default: "",
|
|
},
|
|
},
|
|
computed: {
|
|
masker() {
|
|
return createMask({
|
|
mask: this.mask,
|
|
});
|
|
},
|
|
},
|
|
methods: {
|
|
getFormatted(value) {
|
|
const result = this.stringifyValue(value);
|
|
if (this.mask.length) {
|
|
return this.masker.resolve(result);
|
|
}
|
|
return result;
|
|
},
|
|
},
|
|
};
|