Compare commits

..
Author SHA1 Message Date
Corentin THOMASSET 886d76feff Update src/tools/regex-tester/index.ts 2024-09-20 20:34:52 +02:00
Corentin THOMASSET 52d8f738ef Update src/tools/regex-memo/index.ts 2024-09-20 20:34:00 +02:00
ShareVB e2a1748fa9 feat(new tool): added Regex Cheatsheet 2024-09-14 15:02:17 +02:00
ShareVB f0a092f95a fix: svg style bug in @regexper/render
@regexper/render use a stylesheet in svg that cause bugs in whole site. So add regexper in a shadow root
2024-09-11 22:20:07 +02:00
sharevb 3993c8bb91 Merge branch 'main' into feat/regex-tester 2024-09-04 22:00:42 +02:00
ShareVB f1f2da79c0 Merge remote-tracking branch 'origin/main' into feat/regex-tester 2024-09-04 21:59:50 +02:00
ShareVB fa3a858bcf fix: deps 2024-07-14 23:22:25 +02:00
ShareVB 87d4e76e8b fix: update queryParams 2024-07-14 23:21:25 +02:00
ShareVB 4b42d55812 Merge remote-tracking branch 'origin/main' into feat/regex-tester 2024-07-14 23:21:10 +02:00
ShareVB c9f9bb1273 fix: refactor to service + add regex diagram + ui enhancements 2024-05-15 22:03:23 +02:00
sharevb f61db56abb feat(new tool): Regex Tester
Fix https://github.com/CorentinTh/it-tools/issues/1007, https://github.com/CorentinTh/it-tools/issues/991, https://github.com/CorentinTh/it-tools/issues/936, https://github.com/CorentinTh/it-tools/issues/761, https://github.com/CorentinTh/it-tools/issues/649
https://github.com/CorentinTh/it-tools/issues/644, https://github.com/CorentinTh/it-tools/issues/554
https://github.com/CorentinTh/it-tools/issues/308
2024-05-05 23:43:13 +02:00
8 changed files with 7 additions and 71 deletions

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

+1 -5
View File
@@ -1,8 +1,4 @@
<picture>
<source srcset="./.github/logo-dark.png" media="(prefers-color-scheme: light)">
<source srcset="./.github/logo-white.png" media="(prefers-color-scheme: dark)">
<img src="./.github/logo-dark.png" alt="logo">
</picture>
![logo](.github/logo.png)
Useful tools for developer and people working in IT. [Have a look !](https://it-tools.tech).
+2 -5
View File
@@ -129,10 +129,8 @@ declare module '@vue/runtime-core' {
MenuLayout: typeof import('./src/components/MenuLayout.vue')['default']
MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default']
MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default']
NA: typeof import('naive-ui')['NA']
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
NButton: typeof import('naive-ui')['NButton']
NCode: typeof import('naive-ui')['NCode']
NCheckbox: typeof import('naive-ui')['NCheckbox']
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDivider: typeof import('naive-ui')['NDivider']
@@ -143,8 +141,7 @@ declare module '@vue/runtime-core' {
NLayout: typeof import('naive-ui')['NLayout']
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
NMenu: typeof import('naive-ui')['NMenu']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSpin: typeof import('naive-ui')['NSpin']
NSpace: typeof import('naive-ui')['NSpace']
NTable: typeof import('naive-ui')['NTable']
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
+1 -1
View File
@@ -298,7 +298,7 @@ tools:
phone-parser-and-formatter:
title: Phone parser and formatter
description: Parse, validate and format phone numbers. Get information about the phone number, like the country code, type, etc. Forge link to send message in WhatsApp and SMS.
description: Parse, validate and format phone numbers. Get information about the phone number, like the country code, type, etc.
ipv4-subnet-calculator:
title: IPv4 subnet calculator
@@ -18,9 +18,6 @@ export const tool = defineTool({
'cell',
'international',
'national',
'whatsapp',
'sms',
'message',
],
component: () => import('./phone-parser-and-formatter.vue'),
icon: Phone,
@@ -9,10 +9,9 @@ import {
import { withDefaultOnError } from '@/utils/defaults';
import { booleanToHumanReadable } from '@/utils/boolean';
import { useValidation } from '@/composable/validation';
import { useQueryParamOrStorage } from '@/composable/queryParams';
const rawPhone = ref('');
const defaultCountryCode = useQueryParamOrStorage({ name: 'country', storageName: 'phone-parser:country', defaultValue: getDefaultCountryCode() });
const defaultCountryCode = ref(getDefaultCountryCode());
const validation = useValidation({
source: rawPhone,
rules: [
@@ -23,16 +22,13 @@ const validation = useValidation({
],
});
const parsedRaw = computed(() => {
const parsedDetails = computed(() => {
if (!validation.isValid) {
return undefined;
}
return withDefaultOnError(() => parsePhoneNumber(rawPhone.value, defaultCountryCode.value), undefined);
});
const parsed = withDefaultOnError(() => parsePhoneNumber(rawPhone.value, defaultCountryCode.value), undefined);
const parsedDetails = computed(() => {
const parsed = parsedRaw.value;
if (!parsed) {
return undefined;
}
@@ -85,27 +81,6 @@ const countriesOptions = getCountries().map(code => ({
label: `${lookup.byIso(code)?.country || code} (+${getCountryCallingCode(code)})`,
value: code,
}));
const messageToSend = ref('');
const whatsAppLink = computed(() => {
const parsed = parsedRaw.value;
if (!parsed) {
return undefined;
}
const internationalNoPunts = parsed.formatInternational().replace(/^\+0*/g, '').replace(/\D/g, '');
return `https://wa.me/${internationalNoPunts}?text=${encodeURIComponent(messageToSend.value)}`;
});
const smsLink = computed(() => {
const parsed = parsedRaw.value;
if (!parsed) {
return undefined;
}
const internationalNoSpaces = parsed.formatInternational().replace(/\s/g, '');
return `sms:${internationalNoSpaces}&body=${encodeURIComponent(messageToSend.value)}`;
});
</script>
<template>
@@ -135,34 +110,5 @@ const smsLink = computed(() => {
</tr>
</tbody>
</n-table>
<n-divider />
<c-input-text
v-model:value="messageToSend"
multiline
rows="4"
placeholder="Enter a message to send"
label="Message to send:"
mb-2
/>
<c-card v-if="whatsAppLink" title="WhatsApp Send link" mb-2>
<input-copyable :value="whatsAppLink" mb-2 />
<div flex justify-center>
<!-- //NOSONAR --><c-button :href="whatsAppLink" target="_blank">
Send via WhatsApp
</c-button>
</div>
</c-card>
<c-card v-if="smsLink" title="SMS Send link">
<input-copyable :value="smsLink" mb-2 />
<div flex justify-center>
<!-- //NOSONAR --><c-button :href="smsLink" target="_blank">
Send via SMS
</c-button>
</div>
</c-card>
</div>
</template>