Skip to content

Releases: CodeCornTech/euro-plate-validator

v1.0.14

20 Oct 04:44

Choose a tag to compare

@codecorn/euro-plate-validator — 1.0.14

Highlights

  • Lowercase accepted on all letter tokens → coerced to UPPERCASE via custom L token.
  • Inputmask definitions: safe merge (no dry override of defaults; A/9 preserved).
  • Immediate mask apply on country change (applyMaskNow) to avoid debounce races.
  • Finalized placeholders for all layouts; test script scripts/test-placeholders.mjs.
  • Centralized logging (imLog, imPreLog, imMounted, imError) routed to BADGE/LOG when debug: true.
  • Docs: CDN bumped to 1.0.14; examples updated (autoload deps incl. jQuery/Toastr, useToastrLogger).

Breaking changes

  • None. If you were overriding A/9 in custom masks, remove that override and define only custom tokens (L, H, C, …).

Upgrade notes

  • Update your CDN imports to @1.0.14.
  • If you want toast-style logs, set useToastrLogger: true and debug: true in client options.

Thanks

  • Thanks for stress-testing FR/IT/NL masks and the placeholder test suite. 💚

v1.0.13

20 Oct 00:16

Choose a tag to compare

release notes - v1.0.13

TL;DR Allineata la UI di stato con la validazione reale, niente “✓ fantasma” su blur a campo vuoto. Migliorata la gestione Inputmask quando si cambia paese. Nuovi preset per status inline (icon/pill, left/right, con/senza testo) con riserva di spazio automatica via :has().

✨ Novità

  • Status inline configurabile

    • statusMode: "inline" | "block" | "off"
    • statusIcon: "none" | "icon" | "pill"
    • showStatusText: boolean
    • iconPosition: "left" | "right"
  • Riserva spazio automatica nell’input solo quando c’è stato ([data-state]) → niente sovrapposizioni del testo.

🛠️ Fix

  • Campo vuoto / testo parziale: non viene più mostrato alcuno stato; rimosso data-state in idle.
  • Cambio paese: non si blocca più la digitazione; maschera e validazione si riallineano al nuovo paese senza impedire input vuoto/parziale.
  • Inputmask definitions: merge corretto di A/H/9 con le definizioni specifiche del paese; niente override “distruttivi”.
  • FR/IT: rimozione glitch quando si passa da IT→FR con input non completo.

🔧 Modifiche interne

  • clearStatusUI(input, statusEl, wrapperEl) per riportare lo stato a neutro (rimuove classi/aria e data-state).
  • setValidityUI è l’unica funzione che imposta data-state="ok|err"; in idle lo rimuove.
  • Logging: confermata integrazione con ensureBadgeLogger (prefix [EPL:<id>]).

⚠️ Breaking?

No. Le nuove opzioni sono additive. Se non configuri nulla, comportamento retro-compatibile.

👣 Migrazione / Upgrade

  1. Aggiorna il bundle alla v1.0.13.

  2. (Opzionale) Attiva l’inline status:

    createEuroPlate(EuroMod, {
      ui: { statusMode: "inline", statusIcon: "pill", showStatusText: true, iconPosition: "left" },
    });
  3. Assicurati di includere il CSS con i selettori :has([data-state]).

✅ QA suggeriti

  • Campo vuoto → focus+blur: nessuna icona, nessun padding extra.
  • Digitazione “FF-456-” in FR: mostra “err”, si può continuare a scrivere.
  • Cambia FR→IT con input parziale: nessun blocco, stato neutro finché non è valido.
  • AUTO con testo ≲2 char → neutro; ≥3 → validazione.

v1.0.12

18 Oct 22:42

Choose a tag to compare

🚀 Euro Plate Validator — v1.0.12

@codecorn/euro-plate-validator — European license plate validator (Russia excluded)
Works in Node.js, TypeScript, and the browser (with a lightweight UI client).


✨ Highlights

  • 🆕 autoFocusOnInit → prevent automatic focus on init.
  • 🆕 preserveInputAttrs → keeps external input id / name intact.
  • 🧠 Smart regex engine per-country (car / motorcycle aware).
  • 🌐 Built-in i18n (🇮🇹 IT / 🇬🇧 EN / AUTO from browser locale).
  • 🎨 CSS namespace renamed from .iti__*.epv__*.
  • ⚡ Debounce system and dynamic placeholders.
  • 🔗 Dependencies: auto-loads Inputmask UMD via CDN, supports manual injection and CDN override.
  • 🧩 Client SDK (createEuroPlate) — full UI component (flag + input + dropdown + status).
  • 🪶 Lightweight and CDN-ready builds (ESM / IIFE / CJS).
  • ✅ Multi-country validation (25+ EU / EEA, Russia excluded).

🌍 CDN Distribution (jsDelivr)

Core module

# ESM
https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/browser/index.esm.js
# IIFE
https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/browser/index.iife.min.js

Client SDK (UI)

# ESM
https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/index.mjs
# CJS
https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/client/europlate.client.cjs

CSS

https://cdn.jsdelivr.net/npm/@codecorn/euro-plate-validator@1.0.12/dist/assets/css/styles.css

🧠 Core API

import { validatePlate } from "@codecorn/euro-plate-validator";

validatePlate("AB 123 CD", ["IT"], { vehicleType: "car" });
// → { isValid: true, matches: [{ country: "IT", name: "Italy" }], checked: ["IT"] }

Browser Client

import { createEuroPlate } from "@codecorn/euro-plate-validator/client";

createEuroPlate(EuroMod, {
  wrapper: "#plateBox",
  i18n: "AUTO",
  debug: true,
  autoFocusOnInit: false,
});

💻 CLI Tool

npx @codecorn/euro-plate-validator "AB 123 CD" --countries IT,FR,DE --type car --pretty

Exit codes:
0 valid • 1 invalid • 2 bad arguments


🧾 Changelog summary

Version Notes
1.0.12 new autofocus & preserveInputAttrs, CDN Inputmask autoload, IT/EN i18n, CSS refactor
1.0.10–11 Client SDK + docs consolidation
1.0.9– early beta

🧑‍💻 Maintainer

Federico Girolami — Full-Stack Developer • System Integrator • Digital Solution Architect
🌐 codecorn.it
📧 f.girolami@codecorn.it


🪄 Powered by CodeCorn™ • Pytorchia Edition

v1.0.7

10 Oct 09:45

Choose a tag to compare

• Multi-country EU plates (car & IT motorcycle)
• CLI: npx @codecorn/euro-plate-validator "AB 123 CD" --countries IT --type car
• PHP variant in php_variant/
• Build ignores php_variant, bin, node_modules, dist

v1.0.1

04 Oct 15:58

Choose a tag to compare

• Multi-country EU plates (car & IT motorcycle)
• CLI: npx @codecorn/euro-plate-validator "AB 123 CD" --countries IT --type car
• PHP variant in php_variant/
• Build ignores php_variant, bin, node_modules, dist