mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-11 16:41:36 -04:00
Merge branch 'main' into feat/base64-url-encode-option
* main: refactor(ui): replaced some n-input with c-input-text chore(version): release 2023.05.14-77f2efc docs(changelog): update changelog for 2023.05.14-77f2efc refactor(ui): replaced some n-input with c-input-text ui-lib(new-component): added text input component in the c-lib ui-lib(button): size variants chore(issues): updated new tool request issue template # Conflicts: # src/tools/base64-string-converter/base64-string-converter.vue
This commit is contained in:
commit
12f3697d53
52 changed files with 1298 additions and 587 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 };
|
||||
|
|
|
@ -18,4 +18,14 @@ const shuffleArray = <T>(array: T[]): T[] => shuffleArrayMutate([...array]);
|
|||
|
||||
const shuffleString = (str: string, delimiter = ''): string => shuffleArrayMutate(str.split(delimiter)).join(delimiter);
|
||||
|
||||
export { randFromArray, randIntFromInterval, random, shuffleArray, shuffleArrayMutate, shuffleString };
|
||||
const generateRandomId = () => `id-${random().toString(36).substring(2, 12)}`;
|
||||
|
||||
export {
|
||||
randFromArray,
|
||||
randIntFromInterval,
|
||||
random,
|
||||
shuffleArray,
|
||||
shuffleArrayMutate,
|
||||
shuffleString,
|
||||
generateRandomId,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue