@colijnit/corecomponents_v12 256.1.14 → 256.1.16
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 +23 -2
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/components/base/base-input.component.js +4 -1
- package/esm2015/lib/components/input-text/input-text.component.js +24 -4
- package/fesm2015/colijnit-corecomponents_v12.js +25 -2
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/base/base-input.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
|
@@ -1882,6 +1882,7 @@ class BaseInputComponent {
|
|
|
1882
1882
|
this.modelChange = new EventEmitter();
|
|
1883
1883
|
this.userModelChange = new EventEmitter();
|
|
1884
1884
|
this.hiddenChange = new EventEmitter();
|
|
1885
|
+
this.cancelClicked = new EventEmitter();
|
|
1885
1886
|
this.focused = false;
|
|
1886
1887
|
this.formInput = true;
|
|
1887
1888
|
this.customWidth = false;
|
|
@@ -2194,6 +2195,7 @@ class BaseInputComponent {
|
|
|
2194
2195
|
this.model = this._initialModel;
|
|
2195
2196
|
}
|
|
2196
2197
|
this.keepFocus = false;
|
|
2198
|
+
this.cancelClicked.emit();
|
|
2197
2199
|
}
|
|
2198
2200
|
showValidationError(error) {
|
|
2199
2201
|
this.validationError = error;
|
|
@@ -2621,6 +2623,7 @@ BaseInputComponent.propDecorators = {
|
|
|
2621
2623
|
modelChange: [{ type: Output }],
|
|
2622
2624
|
userModelChange: [{ type: Output }],
|
|
2623
2625
|
hiddenChange: [{ type: Output }],
|
|
2626
|
+
cancelClicked: [{ type: Output }],
|
|
2624
2627
|
focused: [{ type: HostBinding, args: ['class.cc-input-focused',] }],
|
|
2625
2628
|
formInput: [{ type: HostBinding, args: ['class.form-input',] }],
|
|
2626
2629
|
customWidth: [{ type: Input }, { type: HostBinding, args: ['class.custom-width',] }],
|
|
@@ -5688,9 +5691,10 @@ OverlayModule.decorators = [
|
|
|
5688
5691
|
];
|
|
5689
5692
|
|
|
5690
5693
|
class InputTextComponent extends BaseInputComponent {
|
|
5691
|
-
constructor(formComponent, changeDetector, overlayService, componentFactoryResolver, formUserChangeListener, ngZoneWrapper, elementRef) {
|
|
5694
|
+
constructor(formComponent, injector, changeDetector, overlayService, componentFactoryResolver, formUserChangeListener, ngZoneWrapper, elementRef) {
|
|
5692
5695
|
super(changeDetector, componentFactoryResolver, overlayService, formUserChangeListener, ngZoneWrapper, elementRef);
|
|
5693
5696
|
this.formComponent = formComponent;
|
|
5697
|
+
this.injector = injector;
|
|
5694
5698
|
this.changeDetector = changeDetector;
|
|
5695
5699
|
this.overlayService = overlayService;
|
|
5696
5700
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
@@ -5760,6 +5764,17 @@ class InputTextComponent extends BaseInputComponent {
|
|
|
5760
5764
|
get model() {
|
|
5761
5765
|
return super.model;
|
|
5762
5766
|
}
|
|
5767
|
+
get pipedModel() {
|
|
5768
|
+
if (this.formatPipe) {
|
|
5769
|
+
try {
|
|
5770
|
+
const pipe = new this.formatPipe(this);
|
|
5771
|
+
return pipe.transform(this.model);
|
|
5772
|
+
}
|
|
5773
|
+
catch (e) {
|
|
5774
|
+
}
|
|
5775
|
+
}
|
|
5776
|
+
return this.model;
|
|
5777
|
+
}
|
|
5763
5778
|
// exclude some non-digit characters, since input type 'number' still allows the characters -, + and e
|
|
5764
5779
|
excludeNonDigitChars(event) {
|
|
5765
5780
|
const excludedKeys = this.excludePlusMinus ? ['e', '-', '+'] : ['e'];
|
|
@@ -5835,7 +5850,13 @@ InputTextComponent.decorators = [
|
|
|
5835
5850
|
<div class="input-wrapper">
|
|
5836
5851
|
<label *ngIf="showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)"
|
|
5837
5852
|
[textContent]="placeholder"></label>
|
|
5838
|
-
<input
|
|
5853
|
+
<span class="input-text-formatted" *ngIf="!focused && !useContent && formatPipe"
|
|
5854
|
+
[class.show]="!focused && !useContent && formatPipe"
|
|
5855
|
+
[ngClass]="align"
|
|
5856
|
+
[textContent]="pipedModel"
|
|
5857
|
+
(click)="doFocus($event)"
|
|
5858
|
+
></span>
|
|
5859
|
+
<input [class.show]="focused || !formatPipe" #input
|
|
5839
5860
|
[class.input-input-hidden]="useContent"
|
|
5840
5861
|
[ngClass]="align"
|
|
5841
5862
|
[type]="(isFocusedOnDate || (hasValue && emptyPlace)) ? 'date' : (digitsOnly ? 'number' : (type === 'date' ? 'text' : type))"
|
|
@@ -5891,6 +5912,7 @@ InputTextComponent.decorators = [
|
|
|
5891
5912
|
];
|
|
5892
5913
|
InputTextComponent.ctorParameters = () => [
|
|
5893
5914
|
{ type: FormComponent, decorators: [{ type: Optional }] },
|
|
5915
|
+
{ type: Injector },
|
|
5894
5916
|
{ type: ChangeDetectorRef },
|
|
5895
5917
|
{ type: OverlayService },
|
|
5896
5918
|
{ type: ComponentFactoryResolver },
|
|
@@ -5903,6 +5925,7 @@ InputTextComponent.propDecorators = {
|
|
|
5903
5925
|
placeholder: [{ type: Input }],
|
|
5904
5926
|
align: [{ type: Input }],
|
|
5905
5927
|
type: [{ type: Input }],
|
|
5928
|
+
formatPipe: [{ type: Input }],
|
|
5906
5929
|
min: [{ type: Input }],
|
|
5907
5930
|
max: [{ type: Input }],
|
|
5908
5931
|
pattern: [{ type: Input }],
|