@hmcts/rpx-xui-common-lib 1.4.29-date-component-common-validation → 1.4.30-date-component-common-validation
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/hmcts-rpx-xui-common-lib.umd.js +18 -14
- package/bundles/hmcts-rpx-xui-common-lib.umd.js.map +1 -1
- package/bundles/hmcts-rpx-xui-common-lib.umd.min.js +1 -1
- package/bundles/hmcts-rpx-xui-common-lib.umd.min.js.map +1 -1
- package/esm2015/lib/components/generic-filter/generic-filter.component.js +7 -3
- package/esm2015/lib/components/search-location/search-location.component.js +14 -6
- package/esm2015/lib/gov-ui/components/gov-uk-date/gov-uk-date.component.js +4 -13
- package/esm2015/lib/models/filter.model.js +3 -1
- package/esm5/lib/components/generic-filter/generic-filter.component.js +7 -3
- package/esm5/lib/components/search-location/search-location.component.js +14 -6
- package/esm5/lib/gov-ui/components/gov-uk-date/gov-uk-date.component.js +4 -13
- package/esm5/lib/models/filter.model.js +3 -1
- package/fesm2015/hmcts-rpx-xui-common-lib.js +19 -15
- package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/fesm5/hmcts-rpx-xui-common-lib.js +18 -14
- package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
- package/lib/components/search-location/search-location.component.d.ts +2 -1
- package/lib/gov-ui/components/gov-uk-date/gov-uk-date.component.d.ts +1 -2
- package/lib/models/filter.model.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1017,7 +1017,9 @@
|
|
|
1017
1017
|
fields: this.getSelectedValues(form.value, this.config)
|
|
1018
1018
|
};
|
|
1019
1019
|
this.filterService.givenErrors.next(null);
|
|
1020
|
-
|
|
1020
|
+
/** @type {?} */
|
|
1021
|
+
var settings = __assign({}, this.settings, { reset: false });
|
|
1022
|
+
this.filterService.persist(settings, this.config.persistence);
|
|
1021
1023
|
}
|
|
1022
1024
|
else {
|
|
1023
1025
|
this.emitFormErrors(form);
|
|
@@ -1092,7 +1094,9 @@
|
|
|
1092
1094
|
if (this.config && this.config.cancelSetting) {
|
|
1093
1095
|
this._settings.fields = JSON.parse(JSON.stringify(this.config.cancelSetting.fields));
|
|
1094
1096
|
}
|
|
1095
|
-
|
|
1097
|
+
/** @type {?} */
|
|
1098
|
+
var settings = __assign({}, this.settings, { reset: true });
|
|
1099
|
+
this.filterService.persist(settings, this.config.persistence);
|
|
1096
1100
|
this.filterService.givenErrors.next(null);
|
|
1097
1101
|
};
|
|
1098
1102
|
/**
|
|
@@ -3698,7 +3702,7 @@
|
|
|
3698
3702
|
return !selectedLocations.map(( /**
|
|
3699
3703
|
* @param {?} selectedLocation
|
|
3700
3704
|
* @return {?}
|
|
3701
|
-
*/function (selectedLocation) { return selectedLocation.epims_id; })).includes(location.epims_id);
|
|
3705
|
+
*/function (selectedLocation) { return selectedLocation.epims_id; })).includes(location.epims_id) && location.court_name;
|
|
3702
3706
|
}));
|
|
3703
3707
|
})));
|
|
3704
3708
|
}))) : rxjs.of([]);
|
|
@@ -3762,6 +3766,10 @@
|
|
|
3762
3766
|
*/
|
|
3763
3767
|
function (currentValue) {
|
|
3764
3768
|
this.showAutocomplete = !!currentValue && (currentValue.length >= this.minSearchCharacters);
|
|
3769
|
+
if (!currentValue || !currentValue.length) {
|
|
3770
|
+
this.findLocationFormGroup.controls.locationSelectedFormControl.markAsPristine();
|
|
3771
|
+
this.findLocationFormGroup.controls.locationSelectedFormControl.reset();
|
|
3772
|
+
}
|
|
3765
3773
|
if (this.showAutocomplete) {
|
|
3766
3774
|
this.filter(currentValue);
|
|
3767
3775
|
}
|
|
@@ -3801,8 +3809,8 @@
|
|
|
3801
3809
|
SearchLocationComponent.decorators = [
|
|
3802
3810
|
{ type: i0.Component, args: [{
|
|
3803
3811
|
selector: 'exui-search-location',
|
|
3804
|
-
template: "<div class=\"auto-complete-container\">\n <div class=\"autocomplete__wrapper\"> \n <input \n [formControl]=\"findLocationFormGroup.controls.findLocationFormControl\"\n [matAutocomplete]=\"auto\"\n (keyup)=\"onKeyUp($event)\"\n aria-expanded=\"false\" \n aria-owns=\"input-selected-location__listbox\" \n aria-autocomplete=\"both\" \n autocomplete=\"off\" \n class=\"autocomplete__input autocomplete__input--default search-box\"\n [attr.disabled]=\"!disabled ? null: disabled\"\n [value]=\"getControlCourtNameValue()\"\n
|
|
3805
|
-
styles: [".autocomplete__input{-webkit-appearance:none;border:2px solid #0b0c0c;border-radius:0;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;margin-bottom:0;width:100%;background-color:transparent;position:relative}.autocomplete__hint{color:#b1b4b6;position:absolute}.autocomplete__input--default{padding:5px}.autocomplete__input--focused{outline:#fd0 solid 3px;outline-offset:0;box-shadow:inset 0 0 0 2px}.autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:rgba(0,0,0,.256863) 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:
|
|
3812
|
+
template: "<div class=\"auto-complete-container\">\n <div class=\"autocomplete__wrapper\"> \n <input \n [formControl]=\"findLocationFormGroup.controls.findLocationFormControl\"\n [matAutocomplete]=\"auto\"\n (keyup)=\"onKeyUp($event)\"\n aria-expanded=\"false\" \n aria-owns=\"input-selected-location__listbox\" \n aria-autocomplete=\"both\" \n autocomplete=\"off\" \n class=\"autocomplete__input autocomplete__input--default search-box\"\n [attr.disabled]=\"!disabled ? null: disabled\"\n [value]=\"getControlCourtNameValue()\"\n #inputSelectedLocation>\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let location of locationSource$ | async\"\n [value]=\"getDisplayName(location)\"\n (onSelectionChange)=\"onSelectionChange(location)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete}\">\n {{ getDisplayName(location) }}\n </mat-option>\n <mat-option *ngIf=\"!(locationSource$ | async)?.length && showAutocomplete\">{{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n </div>\n</div>\n",
|
|
3813
|
+
styles: [".autocomplete__input{-webkit-appearance:none;border:2px solid #0b0c0c;border-radius:0;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;margin-bottom:0;width:100%;background-color:transparent;position:relative}.autocomplete__hint{color:#b1b4b6;position:absolute}.autocomplete__input--default{padding:5px}.autocomplete__input--focused{outline:#fd0 solid 3px;outline-offset:0;box-shadow:inset 0 0 0 2px}.autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:rgba(0,0,0,.256863) 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
|
|
3806
3814
|
}] }
|
|
3807
3815
|
];
|
|
3808
3816
|
/** @nocollapse */
|
|
@@ -3818,7 +3826,9 @@
|
|
|
3818
3826
|
locationType: [{ type: i0.Input }],
|
|
3819
3827
|
selectedLocations$: [{ type: i0.Input }],
|
|
3820
3828
|
serviceIds: [{ type: i0.Input }],
|
|
3821
|
-
submitted: [{ type: i0.Input }]
|
|
3829
|
+
submitted: [{ type: i0.Input }],
|
|
3830
|
+
autoCompleteInputBox: [{ type: i0.ViewChild, args: ['inputSelectedLocation', { read: i0.ElementRef },] }],
|
|
3831
|
+
locations$: [{ type: i0.Input }]
|
|
3822
3832
|
};
|
|
3823
3833
|
return SearchLocationComponent;
|
|
3824
3834
|
}());
|
|
@@ -4600,26 +4610,20 @@
|
|
|
4600
4610
|
var year = _this.formGroup.get(_this.year).value;
|
|
4601
4611
|
/** @type {?} */
|
|
4602
4612
|
var isValid = _this.isValidDate(new Date(year, month, day), month);
|
|
4603
|
-
|
|
4604
|
-
return { isValid: false, errorType: 'DATE_VALIDATION_FAILED' };
|
|
4605
|
-
}
|
|
4606
|
-
else {
|
|
4607
|
-
return;
|
|
4608
|
-
}
|
|
4613
|
+
return !isValid ? { dateComponent: true } : null;
|
|
4609
4614
|
});
|
|
4610
4615
|
return res;
|
|
4611
4616
|
};
|
|
4612
4617
|
GovUkDateComponent.decorators = [
|
|
4613
4618
|
{ type: i0.Component, args: [{
|
|
4614
4619
|
selector: 'xuilib-gov-uk-date',
|
|
4615
|
-
template: "<div
|
|
4620
|
+
template: "<div class=\"govuk-form-group\" [ngClass]=\"{'govuk-form-group--error': errorMessage?.isInvalid}\" [formGroup]=\"formGroup\">\n <div class=\"date-input-container\">\n <xuilib-gov-uk-fieldset\n [config]=\"{\n legend: config.label || 'Date component',\n classes: config.classes || 'govuk-label--m',\n id: config.id,\n hint: config.hint != null ? config.hint : 'For example, 12 11 2007',\n isPageHeading: config.isPageHeading || false}\"\n [errorMessage]=\"errorMessage\">\n <xuilib-gov-uk-error-message\n [config]=\"{id: 'passport'}\"\n *ngIf=\"errorMessage\"\n [errorMessage]=\"errorMessage\">\n </xuilib-gov-uk-error-message>\n <div class=\"govuk-date-input\" [id]=\"config.id+'-date'\">\n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <xuilib-gov-label\n [config]=\"{label: 'Day', name: config.id+'-day', id: config.id+'-day', classes: 'govuk-date-input__label'}\">\n </xuilib-gov-label>\n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\"\n [ngClass]=\"{'govuk-input--error': errorMessage?.isInvalid}\"\n [id]=\"config.id\"\n [name]=\"config.id+'-day'\" type=\"number\" value=\"\" pattern=\"[0-9]*\"\n [formControlName]=\"config.id+'_day'\">\n </div>\n </div>\n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <xuilib-gov-label\n [config]=\"{label: 'Month', name: config.id+'-month', id: config.id+'-month', classes: 'govuk-date-input__label'}\">\n </xuilib-gov-label>\n <input class=\"govuk-input govuk-date-input__input govuk-input--width-2\"\n [ngClass]=\"{'govuk-input--error': errorMessage?.isInvalid}\"\n [id]=\"config.id+'-month'\"\n [name]=\"config.id+'-month'\" type=\"number\" value=\"\" pattern=\"[0-9]*\"\n [formControlName]=\"config.id+'_month'\">\n </div>\n </div>\n <div class=\"govuk-date-input__item\">\n <div class=\"govuk-form-group\">\n <xuilib-gov-label\n [config]=\"{label: 'Year', name: config.id+'-year', id: config.id+'-year', classes: 'govuk-date-input__label'}\">\n </xuilib-gov-label>\n <input class=\"govuk-input govuk-date-input__input govuk-input--width-4\"\n [ngClass]=\"{'govuk-input--error': errorMessage?.isInvalid}\"\n [id]=\"config.id+'-year'\"\n [name]=\"config.id+'-year'\" type=\"number\" value=\"\" pattern=\"[0-9]*\"\n [formControlName]=\"config.id+'_year'\">\n </div>\n </div>\n </div>\n </xuilib-gov-uk-fieldset>\n </div>\n</div>\n",
|
|
4616
4621
|
styles: [".govuk-form-group .date-input-container{margin-bottom:30px}.govuk-form-group .date-input-container .govuk-date-input .govuk-date-input__item .govuk-form-group{margin-bottom:0}"]
|
|
4617
4622
|
}] }
|
|
4618
4623
|
];
|
|
4619
4624
|
/** @nocollapse */
|
|
4620
4625
|
GovUkDateComponent.ctorParameters = function () { return []; };
|
|
4621
4626
|
GovUkDateComponent.propDecorators = {
|
|
4622
|
-
form: [{ type: i0.ViewChild, args: ['form',] }],
|
|
4623
4627
|
config: [{ type: i0.Input }],
|
|
4624
4628
|
errorMessage: [{ type: i0.Input }],
|
|
4625
4629
|
formGroup: [{ type: i0.Input }]
|