componenteshospitais 1.8.2 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1500,17 +1500,14 @@ var InputField = function (_a) {
1500
1500
  };
1501
1501
  var appliedMaxLength = maxLength !== undefined ? maxLength : 524288;
1502
1502
  var handleChange = function (e) {
1503
- var newValue = e.target.value;
1504
- if ((maskType === 'phone' || maskType === 'telefone') && newValue.startsWith('0')) {
1505
- var numbersOnly = newValue.replace(/\D/g, '');
1506
- if (numbersOnly.length > 1) {
1507
- newValue = numbersOnly.slice(1);
1508
- }
1503
+ var inputValue = e.target.value;
1504
+ if (maskType === 'phone' || maskType === 'telefone') {
1505
+ inputValue = inputValue.replace(/^\(0/, '(');
1509
1506
  }
1510
1507
  if (type === 'number' && e.target.value.length > appliedMaxLength) {
1511
1508
  e.target.value = e.target.value.slice(0, appliedMaxLength);
1512
1509
  }
1513
- onChange(__assign(__assign({}, e), { target: __assign(__assign({}, e.target), { value: newValue }) }));
1510
+ onChange(__assign(__assign({}, e), { target: __assign(__assign({}, e.target), { value: inputValue }) }));
1514
1511
  };
1515
1512
  var mask = maskType === 'cpf' ? '999.999.999-99' :
1516
1513
  maskType === 'phone' ? '(99) 99999-9999' :