Open pgennoni opened 4 years ago
add the code of the file input-mask.js:
"use strict"; Object.defineProperty(exports, "esModule", { value: true }); var text_field_common_1 = require("tns-core-modules/ui/text-field/text-field-common"); var input_mask_common_1 = require("./input-mask.common"); var ListenerImpl = (function (_super) { extends(ListenerImpl, _super); function ListenerImpl() { return _super !== null && _super.apply(this, arguments) || this; } ListenerImpl.initWithOwner = function (owner) { var listener = ListenerImpl.new(); listener._owner = owner; return listener; }; ListenerImpl.prototype.textFieldDidFillMandatoryCharactersDidExtractValue = function (textField, complete, value) { var owner = this._owner.get(); if (owner) { input_mask_common_1.completedProperty.nativeValueChange(owner, complete); input_mask_common_1.extractedValueProperty.nativeValueChange(owner, value); } }; ListenerImpl.ObjCProtocols = [MaskedTextFieldDelegateListener]; return ListenerImpl; }(NSObject)); var InputMaskDelegateImpl = (function (_super) { extends(InputMaskDelegateImpl, _super); function InputMaskDelegateImpl() { return _super !== null && _super.apply(this, arguments) || this; } InputMaskDelegateImpl.initWithOwnerAndDefault = function (owner, defaultImpl) { var delegate = InputMaskDelegateImpl.new(); delegate._defaultImpl = defaultImpl; delegate._owner = owner; return delegate; }; InputMaskDelegateImpl.prototype.textFieldShouldBeginEditing = function (textField) { return this._defaultImpl.textFieldShouldBeginEditing(textField); }; InputMaskDelegateImpl.prototype.textFieldDidEndEditing = function (textField) { return this._defaultImpl.textFieldDidEndEditing(textField); }; InputMaskDelegateImpl.prototype.textFieldShouldClear = function (textField) { return this._defaultImpl.textFieldShouldClear(textField); }; InputMaskDelegateImpl.prototype.textFieldShouldReturn = function (textField) { return this._defaultImpl.textFieldShouldReturn(textField); }; InputMaskDelegateImpl.prototype.textFieldShouldChangeCharactersInRangeReplacementString = function (textField, range, replacementString) { var owner = this._owner.get(); _super.prototype.textFieldShouldChangeCharactersInRangeReplacementString.call(this, textField, range, replacementString); if (owner) { text_field_common_1.textProperty.nativeValueChange(owner, textField.text); } return false; }; InputMaskDelegateImpl.ObjCProtocols = [UITextFieldDelegate]; return InputMaskDelegateImpl; }(MaskedTextFieldDelegate)); var InputMask = (function (_super) { extends(InputMask, _super); function InputMask() { return _super !== null && _super.apply(this, arguments) || this; } InputMask.prototype.initNativeView = function () { _super.prototype.initNativeView.call(this); var owner = new WeakRef(this); this._delegate = InputMaskDelegateImpl.initWithOwnerAndDefault(owner, this._delegate); this._listener = ListenerImpl.initWithOwner(owner); this._delegate.listener = this._listener; }; InputMask.prototype.disposeNativeView = function () { this._delegate = null; this._listener = null; _super.prototype.disposeNativeView.call(this); }; InputMask.prototype[input_mask_common_1.completedProperty.setNative] = function (completed) { }; InputMask.prototype[input_mask_common_1.extractedValueProperty.setNative] = function (value) { }; InputMask.prototype[input_mask_common_1.maskProperty.setNative] = function (mask) { this._delegate.maskFormat = mask; thistext_field_common_1.textProperty.setNative; }; InputMask.prototype[text_field_common_1.textProperty.setNative] = function (text) { this._delegate.putWithTextInto(text, this.ios); }; return InputMask; }(input_mask_common_1.InputMaskBase)); exports.InputMask = InputMask; //# sourceMappingURL=input-mask.js.map
Im having this same error,
@pgennoni , what you did there? it not worked for me.
{
"nativescript": {
"id": "org.nativescript.ceonapp",
"tns-android": {
"version": "6.4.1"
},
"tns-ios": {
"version": "6.4.2"
}
},
"description": "NativeScript Ceon Application",
"license": "SEE LICENSE IN
Make sure to check the demo app(s) for sample usage
Make sure to check the existing issues in this repository
If the demo apps cannot help and there is no issue for your problem, tell us about it
Please, ensure your title is less than 63 characters long and starts with a capital letter.
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
node_modules/tns-core-modules/package.json
file in your project)"tns-android": 5.2.1
and"tns-ios"
:5.3.1Please, tell us how to recreate the issue in as much detail as possible.
when i enter into a "notificar pago component", i need to render a input-mask. this run perfect in android, but in ios this don't works.
Is there any code involved?
The code: <InputMask *ngIf="submitted" mask="[099999999]{,}[00]" (extractedValueChange)="onExtractedValueChange($event)" (completedChange)="onCompletedChange($event)" (loaded)="onLoaded($event)" [hint]="importe" keyboardType="phone">
the error is: CONSOLE WARN file:///app/tns_modules/nativescript-input-mask/input-mask.js:31:49: Class "InputMaskDelegateImpl" already implements the "UITextFieldDelegate" protocol.
Thanks!