Hi, Very usefull component, great job! But I can't get to work PhonePLField

Hi,
Very usefull component, great job!
But I can’t get to work PhonePLFieldFormatter (Vaadin 14). When I use it:

new PhonePLFieldFormatter().extend(phoneField);

I get a JS error:

Error: [cleave.js] Please include phone-type-formatter.{country}.js lib

I can see than in node_modules there is cleave.js\dist\addons\cleave-phone.pl.js

I’ve even delete node_modules, package.json, package-lock.json and even webpack.xx.js, update maven project, run it. App start ok, but when field is rendered the upper error is shown.

NumeralFieldFormatter works fine.

What I’m doing wrong? Best regards!

Would you have a minimal example to produce?

No need for an example. I was able to reproduce it.

4.0.1 might fix your problems. With the beta version I tried to do naive code splitting with the separate classes for phone number locales. I now realized that it doesn’t work like that with Vaadin. Now there is only one PhoneI18nFieldFormatter class which you pass the region code as an argument.

Nice job! It works :) Both for PL region and null region (if I want to let the users input phone numbers from any region, not only PL).
Thank you!

Hello, im still having the “Error: [cleave.js]
Please include phone-type-formatter.{country}.js lib” popping up, i have updated to version 4.0.1 but the problem persists. Also, im getting two other errors besides the Please include error:

“TypeError: this.removeValueChangedFromParentElement is not a function”

“TypeError: pps.phoneFormatter.format is not a function”

code example:

TextField telephoneTF = new TextField();
    new PhoneI18nFieldFormatter(PhoneI18nFieldFormatter.REGION_BR).extend(telephoneTF);
    telephoneTF.setWidth("50%");
    return telephoneTF;

Strangely, if i try to wrap a different formatter, for example the Credit Card Formatter, it works flawlessly, but the phone formatter won’t work

A slight addendum, i updated Vaadin from 14.0.10 to 14.1.13, and now the PhoneI18nFieldFormatter works correctly