refactor(ui): replaced some n-input with c-input-text
This commit is contained in:
1 parent
b3b6b7c46b
commit
f7fc779e63
10 files changed
+189
-226
No files matched your search
@@ -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 };
|
||||
Reference in new issue
Block a user