@colijnit/corecomponents_v12 257.1.11 → 257.1.13

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.
@@ -6213,9 +6213,10 @@
6213
6213
 
6214
6214
  var InputTextComponent = /** @class */ (function (_super) {
6215
6215
  __extends(InputTextComponent, _super);
6216
- function InputTextComponent(formComponent, changeDetector, overlayService, componentFactoryResolver, formUserChangeListener, ngZoneWrapper, elementRef) {
6216
+ function InputTextComponent(formComponent, injector, changeDetector, overlayService, componentFactoryResolver, formUserChangeListener, ngZoneWrapper, elementRef) {
6217
6217
  var _this = _super.call(this, changeDetector, componentFactoryResolver, overlayService, formUserChangeListener, ngZoneWrapper, elementRef) || this;
6218
6218
  _this.formComponent = formComponent;
6219
+ _this.injector = injector;
6219
6220
  _this.changeDetector = changeDetector;
6220
6221
  _this.overlayService = overlayService;
6221
6222
  _this.componentFactoryResolver = componentFactoryResolver;
@@ -6302,6 +6303,21 @@
6302
6303
  enumerable: false,
6303
6304
  configurable: true
6304
6305
  });
6306
+ Object.defineProperty(InputTextComponent.prototype, "pipedModel", {
6307
+ get: function () {
6308
+ if (this.formatPipe) {
6309
+ try {
6310
+ var pipe = new this.formatPipe(this);
6311
+ return pipe.transform(this.model);
6312
+ }
6313
+ catch (e) {
6314
+ }
6315
+ }
6316
+ return this.model;
6317
+ },
6318
+ enumerable: false,
6319
+ configurable: true
6320
+ });
6305
6321
  // exclude some non-digit characters, since input type 'number' still allows the characters -, + and e
6306
6322
  InputTextComponent.prototype.excludeNonDigitChars = function (event) {
6307
6323
  var excludedKeys = this.excludePlusMinus ? ['e', '-', '+'] : ['e'];
@@ -6360,6 +6376,11 @@
6360
6376
  }
6361
6377
  this.isFocused.emit(false);
6362
6378
  };
6379
+ InputTextComponent.prototype.handleDoFocus = function (event) {
6380
+ if (!this.readonly) {
6381
+ this.doFocus(event);
6382
+ }
6383
+ };
6363
6384
  InputTextComponent.prototype.clearInput = function (event) {
6364
6385
  this.setModel(null);
6365
6386
  this.clearIconClick.emit(event);
@@ -6369,7 +6390,7 @@
6369
6390
  InputTextComponent.decorators = [
6370
6391
  { type: i0.Component, args: [{
6371
6392
  selector: 'co-input-text',
6372
- template: "\n <div class=\"input-text-wrapper\" overlayParent #parentForOverlay=\"overlayParent\">\n <co-icon *ngIf=\"leftIcon || leftIconData\" class=\"input-text-left-icon\" [icon]=\"leftIcon\" [iconData]=\"leftIconData\"\n (click)=\"handleLeftIconClick($event)\" (mousedown)=\"handleLeftIconMouseDown($event)\"\n (mouseup)=\"handleLeftIconMouseUp($event)\"></co-icon>\n <div *ngIf=\"leftIcon || leftIconData\" class=\"spacer left-icon\"></div>\n <div class=\"input-wrapper\">\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\"\n [textContent]=\"placeholder\"></label>\n <input #input\n [class.input-input-hidden]=\"useContent\"\n [ngClass]=\"align\"\n [type]=\"(isFocusedOnDate || (hasValue && emptyPlace)) ? 'date' : (digitsOnly ? 'number' : (type === 'date' ? 'text' : type))\"\n [placeholder]=\"type === 'date' && !isFocusedOnDate ? '' : ''\"\n [pattern]=\"type === 'date' ? pattern : undefined\"\n [ngModel]=\"model\"\n [min]=\"(type === 'number' || type === 'date') && this.min ? this.min : undefined\"\n [max]=\"(type === 'number' || type === 'date') && this.max ? this.max : undefined\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (keydown)=\"digitsOnly ? excludeNonDigitChars($event) : true\"\n (keyup)=\"keyUp.emit($event)\"\n (focusin)=\"handleInputFocus($event)\"\n (focusout)=\"handleBlur($event)\"\n >\n <ng-container *ngIf=\"useContent\">\n <div class=\"input-content-wrapper\">\n <ng-content></ng-content>\n </div>\n </ng-container>\n <co-icon [class.show]=\"showClearButton && hasValue && !readonly\" class=\"input-text-clear-button\"\n [icon]=\"icons.CrossSkinny\" (click)=\"clearInput($event)\"></co-icon>\n <div class=\"required-indicator\"></div>\n </div>\n <div *ngIf=\"rightIcon || rightIconData\" class=\"spacer right-icon\"></div>\n <co-icon *ngIf=\"rightIcon || rightIconData\" class=\"input-text-right-icon\" [icon]=\"rightIcon\"\n [iconData]=\"rightIconData\"\n (click)=\"handleRightIconClick($event)\" (mousedown)=\"handleRightIconMouseDown($event)\"\n (mouseup)=\"handleRightIconMouseUp($event)\"></co-icon>\n </div>\n <!--\n <co-commit-buttons *ngIf=\"showSaveCancel && focused && canSaveOrCancel\"\n [committing]=\"committing\"\n [commitFinished]=\"commitFinished\"\n (commitClick)=\"commitClick($event)\"\n (cancelClick)=\"cancelClick($event)\"\n >\n </co-commit-buttons>\n -->\n ",
6393
+ template: "\n <div class=\"input-text-wrapper\" overlayParent #parentForOverlay=\"overlayParent\">\n <co-icon *ngIf=\"leftIcon || leftIconData\" class=\"input-text-left-icon\" [icon]=\"leftIcon\" [iconData]=\"leftIconData\"\n (click)=\"handleLeftIconClick($event)\" (mousedown)=\"handleLeftIconMouseDown($event)\"\n (mouseup)=\"handleLeftIconMouseUp($event)\"></co-icon>\n <div *ngIf=\"leftIcon || leftIconData\" class=\"spacer left-icon\"></div>\n <div class=\"input-wrapper\">\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\"\n [textContent]=\"placeholder\"></label>\n <span class=\"input-text-formatted\" *ngIf=\"!focused && !useContent && formatPipe\"\n [class.show]=\"!focused && !useContent && formatPipe\"\n [ngClass]=\"align\"\n [textContent]=\"pipedModel\"\n (click)=\"handleDoFocus($event)\"\n ></span>\n <input [class.show]=\"focused || !formatPipe\" #input\n [class.input-input-hidden]=\"useContent\"\n [ngClass]=\"align\"\n [type]=\"(isFocusedOnDate || (hasValue && emptyPlace)) ? 'date' : (digitsOnly ? 'number' : (type === 'date' ? 'text' : type))\"\n [placeholder]=\"type === 'date' && !isFocusedOnDate ? '' : ''\"\n [pattern]=\"type === 'date' ? pattern : undefined\"\n [ngModel]=\"model\"\n [min]=\"(type === 'number' || type === 'date') && this.min ? this.min : undefined\"\n [max]=\"(type === 'number' || type === 'date') && this.max ? this.max : undefined\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (keydown)=\"digitsOnly ? excludeNonDigitChars($event) : true\"\n (keyup)=\"keyUp.emit($event)\"\n (focusin)=\"handleInputFocus($event)\"\n (focusout)=\"handleBlur($event)\"\n >\n <ng-container *ngIf=\"useContent\">\n <div class=\"input-content-wrapper\">\n <ng-content></ng-content>\n </div>\n </ng-container>\n <co-icon [class.show]=\"showClearButton && hasValue && !readonly\" class=\"input-text-clear-button\"\n [icon]=\"icons.CrossSkinny\" (click)=\"clearInput($event)\"></co-icon>\n <div class=\"required-indicator\"></div>\n </div>\n <div *ngIf=\"rightIcon || rightIconData\" class=\"spacer right-icon\"></div>\n <co-icon *ngIf=\"rightIcon || rightIconData\" class=\"input-text-right-icon\" [icon]=\"rightIcon\"\n [iconData]=\"rightIconData\"\n (click)=\"handleRightIconClick($event)\" (mousedown)=\"handleRightIconMouseDown($event)\"\n (mouseup)=\"handleRightIconMouseUp($event)\"></co-icon>\n </div>\n <!--\n <co-commit-buttons *ngIf=\"showSaveCancel && focused && canSaveOrCancel\"\n [committing]=\"committing\"\n [commitFinished]=\"commitFinished\"\n (commitClick)=\"commitClick($event)\"\n (cancelClick)=\"cancelClick($event)\"\n >\n </co-commit-buttons>\n -->\n ",
6373
6394
  providers: [
6374
6395
  OverlayService, {
6375
6396
  provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
@@ -6384,6 +6405,7 @@
6384
6405
  ];
6385
6406
  InputTextComponent.ctorParameters = function () { return [
6386
6407
  { type: FormComponent, decorators: [{ type: i0.Optional }] },
6408
+ { type: i0.Injector },
6387
6409
  { type: i0.ChangeDetectorRef },
6388
6410
  { type: OverlayService },
6389
6411
  { type: i0.ComponentFactoryResolver },
@@ -6396,6 +6418,7 @@
6396
6418
  placeholder: [{ type: i0.Input }],
6397
6419
  align: [{ type: i0.Input }],
6398
6420
  type: [{ type: i0.Input }],
6421
+ formatPipe: [{ type: i0.Input }],
6399
6422
  min: [{ type: i0.Input }],
6400
6423
  max: [{ type: i0.Input }],
6401
6424
  pattern: [{ type: i0.Input }],
@@ -8273,6 +8296,9 @@
8273
8296
  var enterKeys = ['Enter', 'NumpadEnter', 'Go'];
8274
8297
  if (enterKeys.includes(event.key)) {
8275
8298
  event.preventDefault();
8299
+ if (this.isMobileDevice()) {
8300
+ event.target.blur();
8301
+ }
8276
8302
  this.search.next(this.model);
8277
8303
  }
8278
8304
  };
@@ -8280,6 +8306,9 @@
8280
8306
  this.model = model;
8281
8307
  this.modelChange.next(this.model);
8282
8308
  };
8309
+ InputSearchComponent.prototype.isMobileDevice = function () {
8310
+ return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
8311
+ };
8283
8312
  return InputSearchComponent;
8284
8313
  }(BaseInputComponent));
8285
8314
  InputSearchComponent.decorators = [