diff --git a/src/demo/Demo.vue b/src/demo/Demo.vue
index 39a970c..ba6fb03 100644
--- a/src/demo/Demo.vue
+++ b/src/demo/Demo.vue
@@ -19,7 +19,7 @@ const examples = [
},
{
label: 'IP address with optional digits',
- code: ``
+ code: ``
},
{
label: 'Dynamic mask: CPF/CNPJ',
@@ -27,23 +27,27 @@ const examples = [
},
{
label: 'Cardholder name: via hook',
- code: `const options = {\n preProcess: (val) => val.toUpperCase()\n}\n\n`
+ code: `const options = {\n preProcess: val => val.toUpperCase()\n}\n\n`
},
{
label: 'Cardholder name: via token transform',
- code: `const options = {\n tokens: {\n A: {\n pattern: /[A-Z]/,\n multiple: true,\n transform: (chr) => chr.toUpperCase()\n }\n }\n}\n\n`
+ code: `const options = {\n tokens: {\n A: {\n pattern: /[A-Z]/,\n multiple: true,\n transform: chr => chr.toUpperCase()\n }\n }\n}\n\n`
},
{
label: 'Year: with current year as a limit',
- code: `const options = {\n postProcess: (val) => {\n const max = "" + new Date().getFullYear()\n return val > max ? max : val\n }\n}\n\n`
+ code: `const options = {\n postProcess: val => {\n const max = "" + new Date().getFullYear()\n return val > max ? max : val\n }\n}\n\n`
},
{
- label: 'Money format simple',
- code: ``
+ label: 'Money format: simple',
+ code: ``
},
{
- label: 'Money format with thousand separators',
- code: ``
+ label: 'Money format: full via hooks',
+ code: `const options = {\n preProcess: val => val.replace(/[$,]/g, ''),\n postProcess: val => {\n if (!val) return ''\n\n const sub = 3 - (val.includes('.') ? val.length - val.indexOf('.') : 0)\n\n return Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: 'USD'\n }).formatToParts(val)\n .map(v => v.value)\n .join('')\n .slice(0, sub ? -sub : undefined)\n }\n}\n\n`
+ },
+ {
+ label: 'Reversed number format with thousand separators',
+ code: ``
}
]