@bcgov/nr-ngx-component-lib 21.1.0 → 21.1.1

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.
@@ -835,10 +835,12 @@ const DATE_FORMATS = {
835
835
  class FilterDateComponent extends NrclBase {
836
836
  constructor() {
837
837
  super(...arguments);
838
- this.label = '[label]]';
838
+ this.label = '[label]';
839
839
  this.placeholder = 'Select...';
840
840
  this.value = moment().format(DATE_FORMATS.datePickerInput);
841
841
  this.clear = true;
842
+ this.minErrorMessage = 'Date is too soon';
843
+ this.maxErrorMessage = 'Date is too late';
842
844
  this.valueChange = new EventEmitter();
843
845
  }
844
846
  onDateChange(ev) {
@@ -863,7 +865,7 @@ class FilterDateComponent extends NrclBase {
863
865
  return !!this.value;
864
866
  }
865
867
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FilterDateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
866
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: FilterDateComponent, isStandalone: true, selector: "nrcl-filter-date", inputs: { label: "label", placeholder: "placeholder", hint: "hint", value: "value", wide: "wide", clear: ["clear", "clear", booleanAttribute] }, outputs: { valueChange: "valueChange" }, host: { properties: { "style.--nrcl-filter-date-width": "this.wide ? \"var( --nrcl-filter-width-\" + this.wide + \" )\" : null" } }, providers: [
868
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: FilterDateComponent, isStandalone: true, selector: "nrcl-filter-date", inputs: { label: "label", placeholder: "placeholder", hint: "hint", value: "value", wide: "wide", clear: ["clear", "clear", booleanAttribute], min: "min", minErrorMessage: "minErrorMessage", max: "max", maxErrorMessage: "maxErrorMessage" }, outputs: { valueChange: "valueChange" }, host: { properties: { "style.--nrcl-filter-date-width": "this.wide ? \"var( --nrcl-filter-width-\" + this.wide + \" )\" : null" } }, providers: [
867
869
  provideMomentDateAdapter({
868
870
  parse: {
869
871
  dateInput: 'YYYY-MM-DD'
@@ -875,7 +877,7 @@ class FilterDateComponent extends NrclBase {
875
877
  monthYearA11yLabel: 'MMMM YYYY',
876
878
  }
877
879
  })
878
- ], viewQueries: [{ propertyName: "picker", first: true, predicate: ["picker"], descendants: true }, { propertyName: "input", first: true, predicate: MatInput, descendants: true }], usesInheritance: true, ngImport: i0, template: "<mat-form-field\n floatLabel=\"auto\"\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n>\n <mat-label>{{ label }}</mat-label>\n\n <input matInput class=\"search-input\" readonly\n [ngModel]=\"value\"\n (ngModelChange)=\"onDateChange( $event )\"\n [placeholder]=\"placeholder\"\n maxlength=\"10\"\n (click)=\"onInputFocus()\"\n [matDatepicker]=\"picker\"\n >\n\n @if ( hint ) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <mat-datepicker #picker></mat-datepicker>\n</mat-form-field>\n\n@if ( isOpen || !hasValue || !clear ) {\n <nrcl-button tertiary\n icon=\"event\"\n (click)=\"picker.open()\"\n ></nrcl-button>\n}\n@else {\n <nrcl-button tertiary\n icon=\"close\"\n (click)=\"onCancelClick()\"\n ></nrcl-button>\n}\n", styles: ["::ng-deep :root{--nrcl-filter-date-width: var( --nrcl-filter-width-2 );--nrcl-filter-date-height: var( --nrcl-filter-height )}:host{--mat-form-field-container-height: calc( var( --nrcl-filter-date-height ) - 4px );--mat-form-field-container-vertical-padding: 8px;--mat-form-field-container-text-size: 15px;--mat-form-field-outlined-focus-label-text-color: black;--mat-form-field-outlined-hover-label-text-color: black;width:var(--nrcl-filter-date-width);display:block;position:relative}:host .nrcl-button{position:absolute;right:2px;top:2px;bottom:2px}:host ::ng-deep .mat-mdc-form-field{width:100%}:host ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper{background-color:#fff;height:var(--nrcl-filter-date-height)}:host ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{width:var(--nrcl-filter-date-width)}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i1$5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ButtonComponent, selector: "nrcl-button", inputs: ["label", "ariaLabel", "icon", "iconRight", "iconCompact", "tooltip", "compact", "small", "primary", "secondary", "tertiary", "disabled", "anchor"], outputs: ["click"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
880
+ ], viewQueries: [{ propertyName: "picker", first: true, predicate: ["picker"], descendants: true }, { propertyName: "input", first: true, predicate: MatInput, descendants: true }], usesInheritance: true, ngImport: i0, template: "<mat-form-field\n floatLabel=\"auto\"\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n>\n <mat-label>{{ label }}</mat-label>\n\n <input matInput class=\"search-input\" readonly\n [ngModel]=\"value\"\n (ngModelChange)=\"onDateChange( $event )\"\n [placeholder]=\"placeholder\"\n maxlength=\"10\"\n (click)=\"onInputFocus()\"\n [matDatepicker]=\"picker\"\n [min]=\"min\"\n [max]=\"max\"\n #filter=\"ngModel\"\n >\n\n @if ( filter.invalid && ( filter.dirty || filter.touched ) ) {\n @if ( filter.hasError( 'matDatepickerMin' ) ) {\n <mat-error>{{ minErrorMessage }}</mat-error>\n }\n\n @if ( filter.hasError( 'matDatepickerMax' ) ) {\n <mat-error>{{ maxErrorMessage }}</mat-error>\n }\n }\n\n @if ( hint ) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <mat-datepicker #picker></mat-datepicker>\n</mat-form-field>\n\n@if ( isOpen || !hasValue || !clear ) {\n <nrcl-button tertiary\n icon=\"event\"\n (click)=\"picker.open()\"\n ></nrcl-button>\n}\n@else {\n <nrcl-button tertiary\n icon=\"close\"\n (click)=\"onCancelClick()\"\n ></nrcl-button>\n}\n", styles: ["::ng-deep :root{--nrcl-filter-date-width: var( --nrcl-filter-width-2 );--nrcl-filter-date-height: var( --nrcl-filter-height )}:host{--mat-form-field-container-height: calc( var( --nrcl-filter-date-height ) - 4px );--mat-form-field-container-vertical-padding: 8px;--mat-form-field-container-text-size: 15px;--mat-form-field-outlined-focus-label-text-color: black;--mat-form-field-outlined-hover-label-text-color: black;width:var(--nrcl-filter-date-width);display:block;position:relative}:host .nrcl-button{position:absolute;right:2px;top:2px;bottom:2px}:host ::ng-deep .mat-mdc-form-field{width:100%}:host ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper{background-color:#fff;height:var(--nrcl-filter-date-height)}:host ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{width:var(--nrcl-filter-date-width)}:host ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-form-field-error{position:absolute;padding-top:4px;font-size:12px}\n"], dependencies: [{ kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1$5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i1$5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i1$5.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ButtonComponent, selector: "nrcl-button", inputs: ["label", "ariaLabel", "icon", "iconRight", "iconCompact", "tooltip", "compact", "small", "primary", "secondary", "tertiary", "disabled", "anchor"], outputs: ["click"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
879
881
  }
880
882
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FilterDateComponent, decorators: [{
881
883
  type: Component,
@@ -886,7 +888,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
886
888
  MatFormFieldModule,
887
889
  MatDatepickerModule,
888
890
  FormsModule,
889
- ButtonComponent
891
+ ButtonComponent,
890
892
  ], providers: [
891
893
  provideMomentDateAdapter({
892
894
  parse: {
@@ -899,7 +901,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
899
901
  monthYearA11yLabel: 'MMMM YYYY',
900
902
  }
901
903
  })
902
- ], template: "<mat-form-field\n floatLabel=\"auto\"\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n>\n <mat-label>{{ label }}</mat-label>\n\n <input matInput class=\"search-input\" readonly\n [ngModel]=\"value\"\n (ngModelChange)=\"onDateChange( $event )\"\n [placeholder]=\"placeholder\"\n maxlength=\"10\"\n (click)=\"onInputFocus()\"\n [matDatepicker]=\"picker\"\n >\n\n @if ( hint ) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <mat-datepicker #picker></mat-datepicker>\n</mat-form-field>\n\n@if ( isOpen || !hasValue || !clear ) {\n <nrcl-button tertiary\n icon=\"event\"\n (click)=\"picker.open()\"\n ></nrcl-button>\n}\n@else {\n <nrcl-button tertiary\n icon=\"close\"\n (click)=\"onCancelClick()\"\n ></nrcl-button>\n}\n", styles: ["::ng-deep :root{--nrcl-filter-date-width: var( --nrcl-filter-width-2 );--nrcl-filter-date-height: var( --nrcl-filter-height )}:host{--mat-form-field-container-height: calc( var( --nrcl-filter-date-height ) - 4px );--mat-form-field-container-vertical-padding: 8px;--mat-form-field-container-text-size: 15px;--mat-form-field-outlined-focus-label-text-color: black;--mat-form-field-outlined-hover-label-text-color: black;width:var(--nrcl-filter-date-width);display:block;position:relative}:host .nrcl-button{position:absolute;right:2px;top:2px;bottom:2px}:host ::ng-deep .mat-mdc-form-field{width:100%}:host ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper{background-color:#fff;height:var(--nrcl-filter-date-height)}:host ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{width:var(--nrcl-filter-date-width)}\n"] }]
904
+ ], template: "<mat-form-field\n floatLabel=\"auto\"\n appearance=\"outline\"\n subscriptSizing=\"dynamic\"\n>\n <mat-label>{{ label }}</mat-label>\n\n <input matInput class=\"search-input\" readonly\n [ngModel]=\"value\"\n (ngModelChange)=\"onDateChange( $event )\"\n [placeholder]=\"placeholder\"\n maxlength=\"10\"\n (click)=\"onInputFocus()\"\n [matDatepicker]=\"picker\"\n [min]=\"min\"\n [max]=\"max\"\n #filter=\"ngModel\"\n >\n\n @if ( filter.invalid && ( filter.dirty || filter.touched ) ) {\n @if ( filter.hasError( 'matDatepickerMin' ) ) {\n <mat-error>{{ minErrorMessage }}</mat-error>\n }\n\n @if ( filter.hasError( 'matDatepickerMax' ) ) {\n <mat-error>{{ maxErrorMessage }}</mat-error>\n }\n }\n\n @if ( hint ) {\n <mat-hint>{{ hint }}</mat-hint>\n }\n\n <mat-datepicker #picker></mat-datepicker>\n</mat-form-field>\n\n@if ( isOpen || !hasValue || !clear ) {\n <nrcl-button tertiary\n icon=\"event\"\n (click)=\"picker.open()\"\n ></nrcl-button>\n}\n@else {\n <nrcl-button tertiary\n icon=\"close\"\n (click)=\"onCancelClick()\"\n ></nrcl-button>\n}\n", styles: ["::ng-deep :root{--nrcl-filter-date-width: var( --nrcl-filter-width-2 );--nrcl-filter-date-height: var( --nrcl-filter-height )}:host{--mat-form-field-container-height: calc( var( --nrcl-filter-date-height ) - 4px );--mat-form-field-container-vertical-padding: 8px;--mat-form-field-container-text-size: 15px;--mat-form-field-outlined-focus-label-text-color: black;--mat-form-field-outlined-hover-label-text-color: black;width:var(--nrcl-filter-date-width);display:block;position:relative}:host .nrcl-button{position:absolute;right:2px;top:2px;bottom:2px}:host ::ng-deep .mat-mdc-form-field{width:100%}:host ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper{background-color:#fff;height:var(--nrcl-filter-date-height)}:host ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix{width:var(--nrcl-filter-date-width)}:host ::ng-deep .mat-mdc-form-field .mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-form-field-error{position:absolute;padding-top:4px;font-size:12px}\n"] }]
903
905
  }], propDecorators: { label: [{
904
906
  type: Input
905
907
  }], placeholder: [{
@@ -913,6 +915,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
913
915
  }], clear: [{
914
916
  type: Input,
915
917
  args: [{ transform: booleanAttribute }]
918
+ }], min: [{
919
+ type: Input
920
+ }], minErrorMessage: [{
921
+ type: Input
922
+ }], max: [{
923
+ type: Input
924
+ }], maxErrorMessage: [{
925
+ type: Input
916
926
  }], valueChange: [{
917
927
  type: Output
918
928
  }], picker: [{