mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-06-16 03:05:11 -04:00
refactor(ui): replaced some n-input with c-input-text
This commit is contained in:
parent
b3b6b7c46b
commit
f7fc779e63
10 changed files with 189 additions and 226 deletions
|
@ -1,16 +1,18 @@
|
|||
import { useValidation } from '@/composable/validation';
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
const macAddressValidationRules = [
|
||||
{
|
||||
message: 'Invalid MAC address',
|
||||
validator: (value: string) => value.trim().match(/^([0-9A-Fa-f]{2}[:-]){2,5}([0-9A-Fa-f]{2})$/),
|
||||
},
|
||||
];
|
||||
|
||||
function macAddressValidation(value: Ref) {
|
||||
return useValidation({
|
||||
source: value,
|
||||
rules: [
|
||||
{
|
||||
message: 'Invalid MAC address',
|
||||
validator: (value) => value.trim().match(/^([0-9A-Fa-f]{2}[:-]){2,5}([0-9A-Fa-f]{2})$/),
|
||||
},
|
||||
],
|
||||
rules: macAddressValidationRules,
|
||||
});
|
||||
}
|
||||
|
||||
export { macAddressValidation };
|
||||
export { macAddressValidation, macAddressValidationRules };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue