@colijnit/corecomponents_v12 257.1.1 → 257.1.12
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/bundles/colijnit-corecomponents_v12.umd.js +30 -8
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/components/input-search/input-search.component.js +11 -7
- package/esm2015/lib/components/input-text/input-text.component.js +24 -4
- package/fesm2015/colijnit-corecomponents_v12.js +32 -8
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/input-search/input-search.component.d.ts +1 -0
- package/lib/components/input-text/input-text.component.d.ts +5 -2
- package/lib/components/input-text/style/_layout.scss +6 -3
- package/package.json +1 -1
|
@@ -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'];
|
|
@@ -6369,7 +6385,7 @@
|
|
|
6369
6385
|
InputTextComponent.decorators = [
|
|
6370
6386
|
{ type: i0.Component, args: [{
|
|
6371
6387
|
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 ",
|
|
6388
|
+
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)=\"doFocus($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
6389
|
providers: [
|
|
6374
6390
|
OverlayService, {
|
|
6375
6391
|
provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
|
|
@@ -6384,6 +6400,7 @@
|
|
|
6384
6400
|
];
|
|
6385
6401
|
InputTextComponent.ctorParameters = function () { return [
|
|
6386
6402
|
{ type: FormComponent, decorators: [{ type: i0.Optional }] },
|
|
6403
|
+
{ type: i0.Injector },
|
|
6387
6404
|
{ type: i0.ChangeDetectorRef },
|
|
6388
6405
|
{ type: OverlayService },
|
|
6389
6406
|
{ type: i0.ComponentFactoryResolver },
|
|
@@ -6396,6 +6413,7 @@
|
|
|
6396
6413
|
placeholder: [{ type: i0.Input }],
|
|
6397
6414
|
align: [{ type: i0.Input }],
|
|
6398
6415
|
type: [{ type: i0.Input }],
|
|
6416
|
+
formatPipe: [{ type: i0.Input }],
|
|
6399
6417
|
min: [{ type: i0.Input }],
|
|
6400
6418
|
max: [{ type: i0.Input }],
|
|
6401
6419
|
pattern: [{ type: i0.Input }],
|
|
@@ -8270,18 +8288,22 @@
|
|
|
8270
8288
|
return true;
|
|
8271
8289
|
};
|
|
8272
8290
|
InputSearchComponent.prototype.handleKeyDown = function (event) {
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8291
|
+
var enterKeys = ['Enter', 'NumpadEnter', 'Go'];
|
|
8292
|
+
if (enterKeys.includes(event.key)) {
|
|
8293
|
+
event.preventDefault();
|
|
8294
|
+
if (this.isMobileDevice()) {
|
|
8295
|
+
event.target.blur();
|
|
8296
|
+
}
|
|
8297
|
+
this.search.next(this.model);
|
|
8279
8298
|
}
|
|
8280
8299
|
};
|
|
8281
8300
|
InputSearchComponent.prototype.handleModelChange = function (model) {
|
|
8282
8301
|
this.model = model;
|
|
8283
8302
|
this.modelChange.next(this.model);
|
|
8284
8303
|
};
|
|
8304
|
+
InputSearchComponent.prototype.isMobileDevice = function () {
|
|
8305
|
+
return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
8306
|
+
};
|
|
8285
8307
|
return InputSearchComponent;
|
|
8286
8308
|
}(BaseInputComponent));
|
|
8287
8309
|
InputSearchComponent.decorators = [
|