chrv-components 1.12.206 → 1.12.208

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.
Binary file
@@ -10,10 +10,10 @@ import { CommonModule, AsyncPipe, DatePipe, formatDate, DATE_PIPE_DEFAULT_OPTION
10
10
  import * as i1$3 from '@angular/cdk/overlay';
11
11
  import { Overlay, CdkOverlayOrigin, CdkConnectedOverlay, CdkScrollable, CDK_CONNECTED_OVERLAY_DEFAULT_CONFIG } from '@angular/cdk/overlay';
12
12
  import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';
13
- import { Subject, Observable, map, BehaviorSubject, skip, debounceTime as debounceTime$1, distinctUntilChanged, skipWhile, from, mergeMap, toArray, timer, takeUntil as takeUntil$1, of, catchError, forkJoin, take, combineLatest, switchMap, merge, finalize, tap, interval } from 'rxjs';
13
+ import { Subject, Observable, map, BehaviorSubject, skip, debounceTime as debounceTime$1, distinctUntilChanged, skipWhile, from, mergeMap, toArray, timer, takeUntil as takeUntil$1, of, catchError, forkJoin, take, combineLatest, filter, startWith, switchMap, merge, finalize, tap, interval } from 'rxjs';
14
14
  import { debounceTime, takeUntil, finalize as finalize$1, concatMap, switchMap as switchMap$1, tap as tap$1, catchError as catchError$1 } from 'rxjs/operators';
15
15
  import * as i1$2 from '@angular/forms';
16
- import { NG_VALIDATORS, Validators, NgControl, ReactiveFormsModule, FormsModule, FormBuilder, FormControl } from '@angular/forms';
16
+ import { NG_VALIDATORS, Validators, NgControl, ReactiveFormsModule, FormsModule, FormBuilder, FormControl, TouchedChangeEvent, StatusChangeEvent } from '@angular/forms';
17
17
  import { isValid, isBefore, formatDate as formatDate$1 } from 'date-fns';
18
18
  import { NgxMaskDirective, provideNgxMask } from 'ngx-mask';
19
19
  import { MatError } from '@angular/material/form-field';
@@ -4450,16 +4450,22 @@ class ChrInputComponent {
4450
4450
  }
4451
4451
  configureEventListeners() {
4452
4452
  this.blur.subscribe((data) => {
4453
- // this.blur.emit();
4454
4453
  this.isFocused.set(false);
4454
+ this._onTouched();
4455
4455
  this.ensureState(this.ngControl()?.status || null);
4456
- // this.state.set(this._getState(this.ngControl()?.status || null));
4457
4456
  });
4458
4457
  this.focus.subscribe((data) => {
4459
- this._onTouched();
4460
4458
  this.isFocused.set(true);
4461
- this.isTouched.set(true);
4462
4459
  });
4460
+ this.ngControl()
4461
+ ?.control?.events.pipe(filter((e) => e instanceof TouchedChangeEvent), map((e) => e.touched),
4462
+ // Start with will inject a starting value, it MUST be used after eventual transformation (here Event -> boolean)
4463
+ // and contain the type of the final data
4464
+ startWith(this.ngControl()?.control?.touched ?? false))
4465
+ .subscribe((e) => this.isTouched.set(e));
4466
+ this.ngControl()
4467
+ ?.control?.events.pipe(filter((e) => e instanceof StatusChangeEvent), map((e) => e.status === 'DISABLED'), startWith(this.ngControl()?.control?.disabled ?? false))
4468
+ .subscribe((e) => this.isDisabled.set(e));
4463
4469
  this.ngControl()?.statusChanges?.subscribe((data) => {
4464
4470
  this.ensureState(data);
4465
4471
  });
@@ -4931,7 +4937,7 @@ class ChrPasswordInputComponent extends ChrInputComponent {
4931
4937
  };
4932
4938
  }
4933
4939
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ChrPasswordInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4934
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: ChrPasswordInputComponent, isStandalone: true, selector: "chr-password-input", usesInheritance: true, ngImport: i0, template: "<div class=\"search-select-input-wrapper\">\n <chr-input [id]=\"id()\" [name]=\"name()\" [type]=\"currentType()\" [label]=\"label()\" [(displayValue)]=\"displayValue\"\n (valueChange)=\"this.value.set($event)\" [ngControl]=\"ngControl()\">\n <chr-input-indicators>\n <ng-content select=\"chr-input-indicators\"></ng-content>\n <span class=\"material-symbols visibility-indicator error\" (mousedown)=\"setTypeText()\"\n (mouseup)=\"setTypePassword()\" (mouseleave)=\"setTypePassword()\">visibility</span>\n </chr-input-indicators>\n <chr-input-data-overlay>\n @if(isTouched()){\n @let error = getLastError();\n @if(error != null){\n <div class=\"error card glass\">\n {{getLastError() ?? null}}\n </div>\n }\n }\n <ng-content select=\"chr-input-data-overlay\">\n </ng-content>\n </chr-input-data-overlay>\n <chr-input-data>\n <ng-content select=\"chr-input-data\">\n <!-- Fallback to default projection-->\n <ng-content></ng-content>\n </ng-content>\n </chr-input-data>\n </chr-input>\n</div>", styles: [":host{display:flex;flex-direction:column;flex:1 1 auto;min-width:0}.visibility-indicator{cursor:pointer}\n"], dependencies: [{ kind: "component", type: ChrInputComponent, selector: "chr-input", inputs: ["label", "id", "name", "value", "displayValue", "type", "outputType", "step", "debounceTime", "isDisabled", "isFocused", "min", "max", "minLength", "maxLength", "ngControl", "tooltip", "isIndicatorsOpen", "tooltipPosition", "required", "state", "errors"], outputs: ["idChange", "nameChange", "valueChange", "displayValueChange", "outputTypeChange", "isDisabledChange", "isFocusedChange", "ngControlChange", "isIndicatorsOpenChange", "requiredChange", "stateChange", "input", "change", "debouncedInput", "focus", "enter", "blur"] }, { kind: "component", type: ChrInputIndicators, selector: "chr-input-indicators" }, { kind: "component", type: ChrInputDataOverlay, selector: "chr-input-data-overlay" }, { kind: "component", type: ChrInputData, selector: "chr-input-data" }] }); }
4940
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: ChrPasswordInputComponent, isStandalone: true, selector: "chr-password-input", usesInheritance: true, ngImport: i0, template: "<div class=\"search-select-input-wrapper\">\n <chr-input [id]=\"id()\" [name]=\"name()\" [type]=\"currentType()\" [label]=\"label()\" [(displayValue)]=\"displayValue\"\n (valueChange)=\"this.value.set($event)\">\n <chr-input-indicators>\n <ng-content select=\"chr-input-indicators\"></ng-content>\n <span class=\"material-symbols visibility-indicator error\" (mousedown)=\"setTypeText()\"\n (mouseup)=\"setTypePassword()\" (mouseleave)=\"setTypePassword()\">visibility</span>\n </chr-input-indicators>\n <chr-input-data-overlay>\n @if(isTouched()){\n @let error = getLastError();\n @if(error != null){\n <div class=\"error card glass\">\n {{getLastError() ?? null}}\n </div>\n }\n }\n <ng-content select=\"chr-input-data-overlay\">\n </ng-content>\n </chr-input-data-overlay>\n <chr-input-data>\n <ng-content select=\"chr-input-data\">\n <!-- Fallback to default projection-->\n <ng-content></ng-content>\n </ng-content>\n </chr-input-data>\n </chr-input>\n</div>", styles: [":host{display:flex;flex-direction:column;flex:1 1 auto;min-width:0}.visibility-indicator{cursor:pointer}\n"], dependencies: [{ kind: "component", type: ChrInputComponent, selector: "chr-input", inputs: ["label", "id", "name", "value", "displayValue", "type", "outputType", "step", "debounceTime", "isDisabled", "isFocused", "min", "max", "minLength", "maxLength", "ngControl", "tooltip", "isIndicatorsOpen", "tooltipPosition", "required", "state", "errors"], outputs: ["idChange", "nameChange", "valueChange", "displayValueChange", "outputTypeChange", "isDisabledChange", "isFocusedChange", "ngControlChange", "isIndicatorsOpenChange", "requiredChange", "stateChange", "input", "change", "debouncedInput", "focus", "enter", "blur"] }, { kind: "component", type: ChrInputIndicators, selector: "chr-input-indicators" }, { kind: "component", type: ChrInputDataOverlay, selector: "chr-input-data-overlay" }, { kind: "component", type: ChrInputData, selector: "chr-input-data" }] }); }
4935
4941
  }
4936
4942
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ChrPasswordInputComponent, decorators: [{
4937
4943
  type: Component,
@@ -4940,7 +4946,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
4940
4946
  ChrInputIndicators,
4941
4947
  ChrInputDataOverlay,
4942
4948
  ChrInputData,
4943
- ], template: "<div class=\"search-select-input-wrapper\">\n <chr-input [id]=\"id()\" [name]=\"name()\" [type]=\"currentType()\" [label]=\"label()\" [(displayValue)]=\"displayValue\"\n (valueChange)=\"this.value.set($event)\" [ngControl]=\"ngControl()\">\n <chr-input-indicators>\n <ng-content select=\"chr-input-indicators\"></ng-content>\n <span class=\"material-symbols visibility-indicator error\" (mousedown)=\"setTypeText()\"\n (mouseup)=\"setTypePassword()\" (mouseleave)=\"setTypePassword()\">visibility</span>\n </chr-input-indicators>\n <chr-input-data-overlay>\n @if(isTouched()){\n @let error = getLastError();\n @if(error != null){\n <div class=\"error card glass\">\n {{getLastError() ?? null}}\n </div>\n }\n }\n <ng-content select=\"chr-input-data-overlay\">\n </ng-content>\n </chr-input-data-overlay>\n <chr-input-data>\n <ng-content select=\"chr-input-data\">\n <!-- Fallback to default projection-->\n <ng-content></ng-content>\n </ng-content>\n </chr-input-data>\n </chr-input>\n</div>", styles: [":host{display:flex;flex-direction:column;flex:1 1 auto;min-width:0}.visibility-indicator{cursor:pointer}\n"] }]
4949
+ ], template: "<div class=\"search-select-input-wrapper\">\n <chr-input [id]=\"id()\" [name]=\"name()\" [type]=\"currentType()\" [label]=\"label()\" [(displayValue)]=\"displayValue\"\n (valueChange)=\"this.value.set($event)\">\n <chr-input-indicators>\n <ng-content select=\"chr-input-indicators\"></ng-content>\n <span class=\"material-symbols visibility-indicator error\" (mousedown)=\"setTypeText()\"\n (mouseup)=\"setTypePassword()\" (mouseleave)=\"setTypePassword()\">visibility</span>\n </chr-input-indicators>\n <chr-input-data-overlay>\n @if(isTouched()){\n @let error = getLastError();\n @if(error != null){\n <div class=\"error card glass\">\n {{getLastError() ?? null}}\n </div>\n }\n }\n <ng-content select=\"chr-input-data-overlay\">\n </ng-content>\n </chr-input-data-overlay>\n <chr-input-data>\n <ng-content select=\"chr-input-data\">\n <!-- Fallback to default projection-->\n <ng-content></ng-content>\n </ng-content>\n </chr-input-data>\n </chr-input>\n</div>", styles: [":host{display:flex;flex-direction:column;flex:1 1 auto;min-width:0}.visibility-indicator{cursor:pointer}\n"] }]
4944
4950
  }] });
4945
4951
 
4946
4952
  class ChrSearchSelectInputComponent extends ChrInputComponent {