@hmcts/rpx-xui-common-lib 1.6.0-rc2 → 1.6.2-refactoring-search-location
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 +552 -51
- 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/hmcts-rpx-xui-common-lib.js +26 -23
- package/esm2015/lib/components/find-person/find-person.component.js +20 -4
- package/esm2015/lib/components/generic-filter/generic-filter.component.js +88 -5
- package/esm2015/lib/components/index.js +2 -2
- package/esm2015/lib/components/pagination/pagination.component.js +50 -0
- package/esm2015/lib/components/public_api.js +3 -1
- package/esm2015/lib/components/search-location/search-location.component.js +231 -0
- package/esm2015/lib/components/share-case/share-case.component.js +1 -13
- package/esm2015/lib/exui-common-lib.module.js +6 -2
- package/esm2015/lib/gov-ui/components/gov-uk-date/gov-uk-date.component.js +80 -9
- package/esm2015/lib/models/filter.model.js +3 -1
- package/esm2015/lib/models/location.model.js +108 -0
- package/esm2015/lib/models/search-options.model.js +3 -1
- package/esm2015/lib/services/find-person/find-person.service.js +26 -4
- package/esm2015/lib/services/locations/location.service.js +45 -0
- package/esm2015/public-api.js +2 -2
- package/esm5/hmcts-rpx-xui-common-lib.js +26 -23
- package/esm5/lib/components/find-person/find-person.component.js +20 -4
- package/esm5/lib/components/generic-filter/generic-filter.component.js +95 -5
- package/esm5/lib/components/index.js +2 -2
- package/esm5/lib/components/pagination/pagination.component.js +58 -0
- package/esm5/lib/components/public_api.js +3 -1
- package/esm5/lib/components/search-location/search-location.component.js +272 -0
- package/esm5/lib/components/share-case/share-case.component.js +1 -13
- package/esm5/lib/exui-common-lib.module.js +6 -2
- package/esm5/lib/gov-ui/components/gov-uk-date/gov-uk-date.component.js +94 -8
- package/esm5/lib/models/filter.model.js +3 -1
- package/esm5/lib/models/location.model.js +108 -0
- package/esm5/lib/models/search-options.model.js +3 -1
- package/esm5/lib/services/find-person/find-person.service.js +26 -4
- package/esm5/lib/services/locations/location.service.js +58 -0
- package/esm5/public-api.js +2 -2
- package/fesm2015/hmcts-rpx-xui-common-lib.js +459 -36
- package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/fesm5/hmcts-rpx-xui-common-lib.js +539 -35
- package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
- package/hmcts-rpx-xui-common-lib.d.ts +24 -21
- package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
- package/lib/components/find-person/find-person.component.d.ts +4 -0
- package/lib/components/generic-filter/generic-filter.component.d.ts +5 -0
- package/lib/components/pagination/pagination.component.d.ts +10 -0
- package/lib/components/public_api.d.ts +2 -0
- package/lib/components/search-location/search-location.component.d.ts +35 -0
- package/lib/exui-common-lib.module.d.ts +2 -1
- package/lib/gov-ui/components/gov-uk-date/gov-uk-date.component.d.ts +8 -0
- package/lib/models/filter.model.d.ts +2 -0
- package/lib/models/location.model.d.ts +49 -0
- package/lib/models/search-options.model.d.ts +1 -0
- package/lib/services/find-person/find-person.service.d.ts +1 -0
- package/lib/services/locations/location.service.d.ts +15 -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,10 @@
|
|
|
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);
|
|
1100
|
+
this.filterService.givenErrors.next(null);
|
|
1096
1101
|
};
|
|
1097
1102
|
/**
|
|
1098
1103
|
* @param {?} values
|
|
@@ -1130,6 +1135,85 @@
|
|
|
1130
1135
|
}
|
|
1131
1136
|
}
|
|
1132
1137
|
};
|
|
1138
|
+
/**
|
|
1139
|
+
* @param {?} event
|
|
1140
|
+
* @param {?} form
|
|
1141
|
+
* @param {?} item
|
|
1142
|
+
* @param {?} field
|
|
1143
|
+
* @return {?}
|
|
1144
|
+
*/
|
|
1145
|
+
GenericFilterComponent.prototype.toggleSelectAll = /**
|
|
1146
|
+
* @param {?} event
|
|
1147
|
+
* @param {?} form
|
|
1148
|
+
* @param {?} item
|
|
1149
|
+
* @param {?} field
|
|
1150
|
+
* @return {?}
|
|
1151
|
+
*/
|
|
1152
|
+
function (event, form, item, field) {
|
|
1153
|
+
/** @type {?} */
|
|
1154
|
+
var isChecked = event.target.checked;
|
|
1155
|
+
/** @type {?} */
|
|
1156
|
+
var formArray = ( /** @type {?} */(form.get(field.name)));
|
|
1157
|
+
if (!item.selectAll) {
|
|
1158
|
+
/** @type {?} */
|
|
1159
|
+
var allChecked = formArray.controls.every(( /**
|
|
1160
|
+
* @param {?} control
|
|
1161
|
+
* @return {?}
|
|
1162
|
+
*/function (control) { return control.value; }));
|
|
1163
|
+
/** @type {?} */
|
|
1164
|
+
var index_1 = null;
|
|
1165
|
+
/** @type {?} */
|
|
1166
|
+
var hasSelectAllOption = field.options.find(( /**
|
|
1167
|
+
* @param {?} option
|
|
1168
|
+
* @param {?} i
|
|
1169
|
+
* @return {?}
|
|
1170
|
+
*/function (option, i) {
|
|
1171
|
+
if (option.hasOwnProperty('selectAll')) {
|
|
1172
|
+
index_1 = i;
|
|
1173
|
+
return true;
|
|
1174
|
+
}
|
|
1175
|
+
return false;
|
|
1176
|
+
}));
|
|
1177
|
+
// tslint:disable-next-line:variable-name
|
|
1178
|
+
/** @type {?} */
|
|
1179
|
+
var isAllCheckedExcludingTheSelectAllOption = formArray.controls.filter(( /**
|
|
1180
|
+
* @param {?} _control
|
|
1181
|
+
* @param {?} i
|
|
1182
|
+
* @return {?}
|
|
1183
|
+
*/function (_control, i) { return i !== index_1; }))
|
|
1184
|
+
.every(( /**
|
|
1185
|
+
* @param {?} control
|
|
1186
|
+
* @return {?}
|
|
1187
|
+
*/function (control) { return control.value; }));
|
|
1188
|
+
if (!allChecked && hasSelectAllOption && !isChecked) {
|
|
1189
|
+
formArray.controls.forEach(( /**
|
|
1190
|
+
* @param {?} control
|
|
1191
|
+
* @param {?} i
|
|
1192
|
+
* @return {?}
|
|
1193
|
+
*/function (control, i) {
|
|
1194
|
+
if (index_1 === i) {
|
|
1195
|
+
control.patchValue(false);
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1198
|
+
}));
|
|
1199
|
+
}
|
|
1200
|
+
else if (hasSelectAllOption && !allChecked && isChecked && isAllCheckedExcludingTheSelectAllOption) {
|
|
1201
|
+
formArray.controls[index_1].patchValue(true);
|
|
1202
|
+
}
|
|
1203
|
+
return;
|
|
1204
|
+
}
|
|
1205
|
+
formArray.controls.forEach(( /**
|
|
1206
|
+
* @param {?} control
|
|
1207
|
+
* @return {?}
|
|
1208
|
+
*/function (control) {
|
|
1209
|
+
if (isChecked) {
|
|
1210
|
+
control.patchValue(true);
|
|
1211
|
+
}
|
|
1212
|
+
else {
|
|
1213
|
+
control.patchValue(false);
|
|
1214
|
+
}
|
|
1215
|
+
}));
|
|
1216
|
+
};
|
|
1133
1217
|
/**
|
|
1134
1218
|
* @private
|
|
1135
1219
|
* @param {?} filter
|
|
@@ -1409,10 +1493,10 @@
|
|
|
1409
1493
|
GenericFilterComponent.decorators = [
|
|
1410
1494
|
{ type: i0.Component, args: [{
|
|
1411
1495
|
selector: 'xuilib-generic-filter',
|
|
1412
|
-
template: "<form [formGroup]=\"form\" (ngSubmit)=\"applyFilter(form)\">\n <div class=\"contain-classes\" *ngFor=\"let field of config.fields\">\n <hr *ngIf=\"field.lineBreakBefore\" class=\"govuk-section-break govuk-section-break--visible elevated-break\">\n <div class=\"govuk-form-group xui-generic-filter\"\n [hidden]=\"hidden(field, form)\"\n [ngClass]=\"{'form-group-error': submitted && (form.get(field.name).errors?.minLength || form.get(field.name).errors?.maxLength)}\">\n <h3 *ngIf=\"field.title\" class=\"govuk-heading-s\">{{field.title}}</h3>\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n <div class=\"govuk-body\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"selectChanged(field, form)\" [attr.disabled]=\"disabled(field, form)\" [name]=\"'select_' + field.name\" [id]=\"'select_' + field.name\" [formControlName]=\"field.name\">\n <option disabled selected hidden value=\"\">{{field.disabledText}}</option>\n <option class=\"govuk-radios__item\" *ngFor=\"let item of field.options\" [value]=\"item.key\">{{item.label}}</option>\n </select>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div class=\"govuk-checkboxes govuk-checkboxes--small\" [formGroupName]=\"field.name\">\n <div *ngFor=\"let item of field.options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n [value]=\"item.key\" [id]=\"'checkbox_' + item.key\"\n [name]=\"'checkbox_' + item.key\"\n />\n <label
|
|
1496
|
+
template: "<form [formGroup]=\"form\" (ngSubmit)=\"applyFilter(form)\">\n <div class=\"contain-classes\" *ngFor=\"let field of config.fields\">\n <hr *ngIf=\"field.lineBreakBefore\" class=\"govuk-section-break govuk-section-break--visible elevated-break\">\n <div class=\"govuk-form-group xui-generic-filter\"\n [hidden]=\"hidden(field, form)\"\n [ngClass]=\"{'form-group-error': submitted && (form.get(field.name).errors?.minLength || form.get(field.name).errors?.maxLength)}\">\n <h3 *ngIf=\"field.title\" class=\"govuk-heading-s\">{{field.title}}</h3>\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMinSelectedError && submitted && form.get(field.name).errors?.minLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.minSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMaxSelectedError && submitted && form.get(field.name).errors?.maxLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.maxSelectedError}}\n </span>\n <div class=\"govuk-body\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"selectChanged(field, form)\" [attr.disabled]=\"disabled(field, form)\" [name]=\"'select_' + field.name\" [id]=\"'select_' + field.name\" [formControlName]=\"field.name\">\n <option disabled selected hidden value=\"\">{{field.disabledText}}</option>\n <option class=\"govuk-radios__item\" *ngFor=\"let item of field.options\" [value]=\"item.key\">{{item.label}}</option>\n </select>\n </ng-container>\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div class=\"govuk-checkboxes govuk-checkboxes--small\" [formGroupName]=\"field.name\" [attr.field]=\"field.name\" [id]=\"'checkbox_' + field.name\">\n <div *ngFor=\"let item of field.options; let i = index\" class=\"govuk-checkboxes__item\">\n <input type=\"checkbox\" class=\"govuk-checkboxes__input\"\n [attr.disabled]=\"disabled(field, form)\"\n [formControlName]=\"i\"\n (change)=\"toggleSelectAll($event, form, item, field)\"\n [value]=\"item.key\" [id]=\"'checkbox_' + item.key\"\n [name]=\"'checkbox_' + item.key\"\n />\n <label\n [for]=\"'checkbox_' + item.key\"\n class=\"govuk-label govuk-checkboxes__label\"\n [ngClass]=\"{'govuk-!-font-weight-bold': item.selectAll}\"\n >{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'radio'\">\n <div class=\"govuk-radios\">\n <div *ngFor=\"let item of field.options\" class=\"govuk-radios__item\">\n <input type=\"radio\"\n [formControlName]=\"field.name\"\n [id]=\"'radio_' + item.key\"\n [attr.disabled]=\"disabled(field, form)\"\n [checked]=\"item.key === form.get(field.name).value\"\n class=\"govuk-radios__input\"\n [value]=\"item.key\"\n (change)=\"radiosChanged(field)\"\n />\n <label [for]=\"'radio_' + item.key\" class=\"govuk-label govuk-radios__label\">{{item.label}}</label>\n </div>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-person'\">\n <xuilib-find-person subTitle=\"\" (personSelected)=\"updatePersonControls($event, field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"field.domain\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n [userIncluded]=\"false\"\n ></xuilib-find-person>\n </ng-container>\n </div>\n </div>\n </div>\n <hr class=\"govuk-section-break govuk-section-break--m govuk-section-break--visible\"/>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <button\n class=\"govuk-button govuk-!-margin-right-1 govuk-!-margin-bottom-0\"\n type=\"submit\"\n id=\"applyFilter\"\n [disabled]=\"config.enableDisabledButton && form.invalid\"\n >{{config.applyButtonText || 'Apply'}}</button>\n <button\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\"\n type=\"button\"\n id=\"cancelFilter\"\n (click)=\"cancelFilter()\">{{ config.cancelButtonText || 'Cancel'}}</button>\n </div>\n </div>\n</form>\n",
|
|
1413
1497
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1414
1498
|
encapsulation: i0.ViewEncapsulation.None,
|
|
1415
|
-
styles: [".contain-classes .elevated-break{position:relative;top:-10px}.contain-classes .xui-generic-filter .select-all{margin-bottom:10px}.contain-classes .xui-generic-filter .govuk-checkboxes{display:flex;flex-wrap:wrap}.contain-classes .xui-generic-filter .govuk-checkboxes>div{flex-grow:1;flex-shrink:0
|
|
1499
|
+
styles: [".contain-classes .elevated-break{position:relative;top:-10px}.contain-classes .xui-generic-filter .select-all{margin-bottom:10px}.contain-classes .xui-generic-filter .govuk-checkboxes{display:flex;flex-wrap:wrap}.contain-classes .xui-generic-filter .govuk-checkboxes>div{flex-grow:1;flex-shrink:0}"]
|
|
1416
1500
|
}] }
|
|
1417
1501
|
];
|
|
1418
1502
|
/** @nocollapse */
|
|
@@ -2864,18 +2948,6 @@
|
|
|
2864
2948
|
* @return {?}
|
|
2865
2949
|
*/
|
|
2866
2950
|
function (user) {
|
|
2867
|
-
if (user.email) {
|
|
2868
|
-
user.email = user.email.trim();
|
|
2869
|
-
}
|
|
2870
|
-
if (user.firstName) {
|
|
2871
|
-
user.firstName = user.firstName.trim();
|
|
2872
|
-
}
|
|
2873
|
-
if (user.lastName) {
|
|
2874
|
-
user.lastName = user.lastName.trim();
|
|
2875
|
-
}
|
|
2876
|
-
if (user.idamId) {
|
|
2877
|
-
user.idamId = user.idamId.trim();
|
|
2878
|
-
}
|
|
2879
2951
|
this.selectedUser = user;
|
|
2880
2952
|
};
|
|
2881
2953
|
/**
|
|
@@ -3511,6 +3583,324 @@
|
|
|
3511
3583
|
return CookieBannerComponent;
|
|
3512
3584
|
}());
|
|
3513
3585
|
|
|
3586
|
+
/**
|
|
3587
|
+
* @fileoverview added by tsickle
|
|
3588
|
+
* Generated from: lib/services/locations/location.service.ts
|
|
3589
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3590
|
+
*/
|
|
3591
|
+
var LocationService = /** @class */ (function () {
|
|
3592
|
+
function LocationService(http) {
|
|
3593
|
+
this.http = http;
|
|
3594
|
+
}
|
|
3595
|
+
/**
|
|
3596
|
+
* @description getAllLocations from service Ids/location type/search term
|
|
3597
|
+
* @param serviceIds: SSCS | SSCS,IA split with ','
|
|
3598
|
+
* @param locationType: optional | hearing | case_management
|
|
3599
|
+
* @param searchTerm: any search term for postcode | site name | venue name |court name | court address etc.
|
|
3600
|
+
* @return Observable<LocationByEPIMSModel[]>: Array of locationModel in Observable
|
|
3601
|
+
*/
|
|
3602
|
+
/**
|
|
3603
|
+
* \@description getAllLocations from service Ids/location type/search term
|
|
3604
|
+
* @param {?} serviceIds
|
|
3605
|
+
* @param {?} locationType
|
|
3606
|
+
* @param {?} searchTerm
|
|
3607
|
+
* @return {?} Observable<LocationByEPIMSModel[]>: Array of locationModel in Observable
|
|
3608
|
+
*/
|
|
3609
|
+
LocationService.prototype.getAllLocations = /**
|
|
3610
|
+
* \@description getAllLocations from service Ids/location type/search term
|
|
3611
|
+
* @param {?} serviceIds
|
|
3612
|
+
* @param {?} locationType
|
|
3613
|
+
* @param {?} searchTerm
|
|
3614
|
+
* @return {?} Observable<LocationByEPIMSModel[]>: Array of locationModel in Observable
|
|
3615
|
+
*/
|
|
3616
|
+
function (serviceIds, locationType, searchTerm) {
|
|
3617
|
+
return this.http.get("api/locations/getLocations?serviceIds=" + serviceIds + "&locationType=" + locationType + "&searchTerm=" + searchTerm);
|
|
3618
|
+
};
|
|
3619
|
+
LocationService.decorators = [
|
|
3620
|
+
{ type: i0.Injectable, args: [{
|
|
3621
|
+
providedIn: 'root'
|
|
3622
|
+
},] }
|
|
3623
|
+
];
|
|
3624
|
+
/** @nocollapse */
|
|
3625
|
+
LocationService.ctorParameters = function () {
|
|
3626
|
+
return [
|
|
3627
|
+
{ type: i1.HttpClient }
|
|
3628
|
+
];
|
|
3629
|
+
};
|
|
3630
|
+
/** @nocollapse */ LocationService.ngInjectableDef = i0.defineInjectable({ factory: function LocationService_Factory() { return new LocationService(i0.inject(i1.HttpClient)); }, token: LocationService, providedIn: "root" });
|
|
3631
|
+
return LocationService;
|
|
3632
|
+
}());
|
|
3633
|
+
|
|
3634
|
+
/**
|
|
3635
|
+
* @fileoverview added by tsickle
|
|
3636
|
+
* Generated from: lib/components/search-location/search-location.component.ts
|
|
3637
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3638
|
+
*/
|
|
3639
|
+
var SearchLocationComponent = /** @class */ (function () {
|
|
3640
|
+
function SearchLocationComponent(locationService, fb) {
|
|
3641
|
+
this.locationService = locationService;
|
|
3642
|
+
this.disabled = null;
|
|
3643
|
+
this.locationType = '';
|
|
3644
|
+
this.serviceIds = '';
|
|
3645
|
+
this.submitted = true;
|
|
3646
|
+
this.showAutocomplete = false;
|
|
3647
|
+
this.locationChanged = new i0.EventEmitter();
|
|
3648
|
+
this.minSearchCharacters = 3;
|
|
3649
|
+
this.keyUpSubject$ = new rxjs.Subject();
|
|
3650
|
+
this.readyAfterContent = false;
|
|
3651
|
+
this.findLocationFormGroup = fb.group({
|
|
3652
|
+
findLocationFormControl: [null],
|
|
3653
|
+
locationSelectedFormControl: [null]
|
|
3654
|
+
});
|
|
3655
|
+
this.selectedLocations = [];
|
|
3656
|
+
}
|
|
3657
|
+
/**
|
|
3658
|
+
* @return {?}
|
|
3659
|
+
*/
|
|
3660
|
+
SearchLocationComponent.prototype.ngAfterContentInit = /**
|
|
3661
|
+
* @return {?}
|
|
3662
|
+
*/
|
|
3663
|
+
function () {
|
|
3664
|
+
this.readyAfterContent = true;
|
|
3665
|
+
};
|
|
3666
|
+
/**
|
|
3667
|
+
* @return {?}
|
|
3668
|
+
*/
|
|
3669
|
+
SearchLocationComponent.prototype.ngOnInit = /**
|
|
3670
|
+
* @return {?}
|
|
3671
|
+
*/
|
|
3672
|
+
function () {
|
|
3673
|
+
var _this = this;
|
|
3674
|
+
this.locationsDisplayedInDrop = [];
|
|
3675
|
+
if (this.control) {
|
|
3676
|
+
if (this.findLocationFormGroup && this.findLocationFormGroup.controls) {
|
|
3677
|
+
this.findLocationFormGroup.controls.locationSelectedFormControl = this.control;
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
this.keyUpSubject$.pipe(operators.debounceTime(500)).subscribe(( /**
|
|
3681
|
+
* @param {?} searchValue
|
|
3682
|
+
* @return {?}
|
|
3683
|
+
*/function (searchValue) { return _this.search(( /** @type {?} */(searchValue))); }));
|
|
3684
|
+
};
|
|
3685
|
+
/**
|
|
3686
|
+
* @return {?}
|
|
3687
|
+
*/
|
|
3688
|
+
SearchLocationComponent.prototype.onKeyDown = /**
|
|
3689
|
+
* @return {?}
|
|
3690
|
+
*/
|
|
3691
|
+
function () {
|
|
3692
|
+
this.locationChanged.emit();
|
|
3693
|
+
};
|
|
3694
|
+
/**
|
|
3695
|
+
* @param {?} event
|
|
3696
|
+
* @return {?}
|
|
3697
|
+
*/
|
|
3698
|
+
SearchLocationComponent.prototype.onKeyUp = /**
|
|
3699
|
+
* @param {?} event
|
|
3700
|
+
* @return {?}
|
|
3701
|
+
*/
|
|
3702
|
+
function (event) {
|
|
3703
|
+
this.keyUpSubject$.next(event.target.value);
|
|
3704
|
+
};
|
|
3705
|
+
Object.defineProperty(SearchLocationComponent.prototype, "locationsDisplayedInDropDuplicationFiltered", {
|
|
3706
|
+
get: /**
|
|
3707
|
+
* @return {?}
|
|
3708
|
+
*/ function () {
|
|
3709
|
+
var _this = this;
|
|
3710
|
+
return this.locationsDisplayedInDrop.filter(( /**
|
|
3711
|
+
* @param {?} location
|
|
3712
|
+
* @return {?}
|
|
3713
|
+
*/function (location) {
|
|
3714
|
+
return !_this.selectedLocations.map(( /**
|
|
3715
|
+
* @param {?} selectedLocation
|
|
3716
|
+
* @return {?}
|
|
3717
|
+
*/function (selectedLocation) { return selectedLocation.epims_id; })).includes(location.epims_id) && location.court_name;
|
|
3718
|
+
}));
|
|
3719
|
+
},
|
|
3720
|
+
enumerable: true,
|
|
3721
|
+
configurable: true
|
|
3722
|
+
});
|
|
3723
|
+
/**
|
|
3724
|
+
* @param {?} term
|
|
3725
|
+
* @return {?}
|
|
3726
|
+
*/
|
|
3727
|
+
SearchLocationComponent.prototype.filter = /**
|
|
3728
|
+
* @param {?} term
|
|
3729
|
+
* @return {?}
|
|
3730
|
+
*/
|
|
3731
|
+
function (term) {
|
|
3732
|
+
var _this = this;
|
|
3733
|
+
this.getLocations(term).pipe(operators.mergeMap(( /**
|
|
3734
|
+
* @param {?} apiData
|
|
3735
|
+
* @return {?}
|
|
3736
|
+
*/function (apiData) {
|
|
3737
|
+
/** @type {?} */
|
|
3738
|
+
var apiFilter = apiData.filter(( /**
|
|
3739
|
+
* @param {?} apiLocation
|
|
3740
|
+
* @return {?}
|
|
3741
|
+
*/function (apiLocation) {
|
|
3742
|
+
return !_this.selectedLocations.map(( /**
|
|
3743
|
+
* @param {?} selectedLocation
|
|
3744
|
+
* @return {?}
|
|
3745
|
+
*/function (selectedLocation) { return selectedLocation.epims_id; })).includes(apiLocation.epims_id);
|
|
3746
|
+
}));
|
|
3747
|
+
console.log('apiDataFiltered', apiFilter.length);
|
|
3748
|
+
_this.locationsDisplayedInDrop = apiFilter;
|
|
3749
|
+
return apiFilter;
|
|
3750
|
+
}))).subscribe(( /**
|
|
3751
|
+
* @param {?} location
|
|
3752
|
+
* @return {?}
|
|
3753
|
+
*/function (location) {
|
|
3754
|
+
if (term === location.court_name) {
|
|
3755
|
+
_this.findLocationFormGroup.controls.locationSelectedFormControl.setValue(location);
|
|
3756
|
+
_this.locationsDisplayedInDrop = [];
|
|
3757
|
+
_this.locationChanged.emit(location);
|
|
3758
|
+
_this.showAutocomplete = false;
|
|
3759
|
+
}
|
|
3760
|
+
}));
|
|
3761
|
+
};
|
|
3762
|
+
/**
|
|
3763
|
+
* @param {?=} selection
|
|
3764
|
+
* @return {?}
|
|
3765
|
+
*/
|
|
3766
|
+
SearchLocationComponent.prototype.onSelectionChange = /**
|
|
3767
|
+
* @param {?=} selection
|
|
3768
|
+
* @return {?}
|
|
3769
|
+
*/
|
|
3770
|
+
function (selection) {
|
|
3771
|
+
if (this.findLocationFormGroup.controls.findLocationFormControl instanceof forms.FormArray) {
|
|
3772
|
+
(( /** @type {?} */(this.findLocationFormGroup.controls.locationSelectedFormControl))).push(new forms.FormControl(selection.epims_id));
|
|
3773
|
+
}
|
|
3774
|
+
else {
|
|
3775
|
+
this.findLocationFormGroup.controls.locationSelectedFormControl.setValue(selection);
|
|
3776
|
+
}
|
|
3777
|
+
this.locationChanged.emit(selection);
|
|
3778
|
+
};
|
|
3779
|
+
/**
|
|
3780
|
+
* @param {?} currentValue
|
|
3781
|
+
* @return {?}
|
|
3782
|
+
*/
|
|
3783
|
+
SearchLocationComponent.prototype.search = /**
|
|
3784
|
+
* @param {?} currentValue
|
|
3785
|
+
* @return {?}
|
|
3786
|
+
*/
|
|
3787
|
+
function (currentValue) {
|
|
3788
|
+
this.showAutocomplete = !!currentValue && (currentValue.length >= this.minSearchCharacters);
|
|
3789
|
+
if (!currentValue || !currentValue.length) {
|
|
3790
|
+
this.findLocationFormGroup.controls.locationSelectedFormControl.markAsPristine();
|
|
3791
|
+
this.findLocationFormGroup.controls.locationSelectedFormControl.reset();
|
|
3792
|
+
}
|
|
3793
|
+
if (this.showAutocomplete) {
|
|
3794
|
+
this.filter(currentValue);
|
|
3795
|
+
}
|
|
3796
|
+
};
|
|
3797
|
+
/**
|
|
3798
|
+
* @param {?} selectedLocation
|
|
3799
|
+
* @return {?}
|
|
3800
|
+
*/
|
|
3801
|
+
SearchLocationComponent.prototype.getDisplayName = /**
|
|
3802
|
+
* @param {?} selectedLocation
|
|
3803
|
+
* @return {?}
|
|
3804
|
+
*/
|
|
3805
|
+
function (selectedLocation) {
|
|
3806
|
+
return selectedLocation.court_name;
|
|
3807
|
+
};
|
|
3808
|
+
/**
|
|
3809
|
+
* @param {?} term
|
|
3810
|
+
* @return {?}
|
|
3811
|
+
*/
|
|
3812
|
+
SearchLocationComponent.prototype.getLocations = /**
|
|
3813
|
+
* @param {?} term
|
|
3814
|
+
* @return {?}
|
|
3815
|
+
*/
|
|
3816
|
+
function (term) {
|
|
3817
|
+
return this.locationService.getAllLocations(this.serviceIds, this.locationType, term);
|
|
3818
|
+
};
|
|
3819
|
+
/**
|
|
3820
|
+
* @return {?}
|
|
3821
|
+
*/
|
|
3822
|
+
SearchLocationComponent.prototype.getControlCourtNameValue = /**
|
|
3823
|
+
* @return {?}
|
|
3824
|
+
*/
|
|
3825
|
+
function () {
|
|
3826
|
+
return this.findLocationFormGroup && this.findLocationFormGroup.controls && this.findLocationFormGroup.controls.locationSelectedFormControl.value ?
|
|
3827
|
+
(( /** @type {?} */(this.findLocationFormGroup.controls.locationSelectedFormControl.value))).court_name : '';
|
|
3828
|
+
};
|
|
3829
|
+
SearchLocationComponent.decorators = [
|
|
3830
|
+
{ type: i0.Component, args: [{
|
|
3831
|
+
selector: 'exui-search-location',
|
|
3832
|
+
template: "<div class=\"auto-complete-container\">\n <div *ngIf=\"readyAfterContent\" class=\"autocomplete__wrapper\">\n <input\n [formControl]=\"findLocationFormGroup.controls.findLocationFormControl\"\n [matAutocomplete]=\"autoSearchLocation\"\n (keydown)=\"onKeyDown()\"\n (keyup)=\"onKeyUp($event)\"\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 #autoSearchLocation=\"matAutocomplete\">\n <mat-option *ngFor=\"let location of locationsDisplayedInDropDuplicationFiltered\"\n [value]=\"getDisplayName(location)\"\n (onSelectionChange)=\"onSelectionChange(location)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete}\">\n {{ getDisplayName(location) }}\n </mat-option>\n <mat-option *ngIf=\"!locationsDisplayedInDropDuplicationFiltered?.length && showAutocomplete\">{{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n </div>\n</div>",
|
|
3833
|
+
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}"]
|
|
3834
|
+
}] }
|
|
3835
|
+
];
|
|
3836
|
+
/** @nocollapse */
|
|
3837
|
+
SearchLocationComponent.ctorParameters = function () {
|
|
3838
|
+
return [
|
|
3839
|
+
{ type: LocationService },
|
|
3840
|
+
{ type: forms.FormBuilder }
|
|
3841
|
+
];
|
|
3842
|
+
};
|
|
3843
|
+
SearchLocationComponent.propDecorators = {
|
|
3844
|
+
control: [{ type: i0.Input }],
|
|
3845
|
+
disabled: [{ type: i0.Input }],
|
|
3846
|
+
locationType: [{ type: i0.Input }],
|
|
3847
|
+
selectedLocations: [{ type: i0.Input }],
|
|
3848
|
+
serviceIds: [{ type: i0.Input }],
|
|
3849
|
+
submitted: [{ type: i0.Input }],
|
|
3850
|
+
autoCompleteInputBox: [{ type: i0.ViewChild, args: ['inputSelectedLocation', { read: i0.ElementRef },] }],
|
|
3851
|
+
showAutocomplete: [{ type: i0.Input }],
|
|
3852
|
+
locationsDisplayedInDrop: [{ type: i0.Input }],
|
|
3853
|
+
locationChanged: [{ type: i0.Output }]
|
|
3854
|
+
};
|
|
3855
|
+
return SearchLocationComponent;
|
|
3856
|
+
}());
|
|
3857
|
+
|
|
3858
|
+
/**
|
|
3859
|
+
* @fileoverview added by tsickle
|
|
3860
|
+
* Generated from: lib/components/pagination/pagination.component.ts
|
|
3861
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3862
|
+
*/
|
|
3863
|
+
var PaginationComponent = /** @class */ (function () {
|
|
3864
|
+
function PaginationComponent() {
|
|
3865
|
+
this.previousPage = new i0.EventEmitter();
|
|
3866
|
+
this.nextPage = new i0.EventEmitter();
|
|
3867
|
+
}
|
|
3868
|
+
/**
|
|
3869
|
+
* @return {?}
|
|
3870
|
+
*/
|
|
3871
|
+
PaginationComponent.prototype.onPrevious = /**
|
|
3872
|
+
* @return {?}
|
|
3873
|
+
*/
|
|
3874
|
+
function () {
|
|
3875
|
+
this.previousPage.emit(null);
|
|
3876
|
+
};
|
|
3877
|
+
/**
|
|
3878
|
+
* @return {?}
|
|
3879
|
+
*/
|
|
3880
|
+
PaginationComponent.prototype.onNext = /**
|
|
3881
|
+
* @return {?}
|
|
3882
|
+
*/
|
|
3883
|
+
function () {
|
|
3884
|
+
this.nextPage.emit(null);
|
|
3885
|
+
};
|
|
3886
|
+
PaginationComponent.decorators = [
|
|
3887
|
+
{ type: i0.Component, args: [{
|
|
3888
|
+
selector: 'xuilib-pagination',
|
|
3889
|
+
template: "<nav class=\"hmcts-pagination\" id=\"pagination-label\">\n\n <p class=\"govuk-visually-hidden\" aria-labelledby=\"pagination-label\">Pagination navigation</p>\n\n <ul class=\"hmcts-pagination__list\">\n <li class=\"hmcts-pagination__item hmcts-pagination__item--prev\">\n <a *ngIf=\"firstRecord > 1; else noPrevious\" class=\"hmcts-pagination__link\" (click)=\"onPrevious()\" href=\"javascript:void(0)\">\n Previous page\n </a>\n <ng-template #noPrevious>\n <span class=\"hmcts-pagination__link\">Previous page</span>\n </ng-template>\n </li>\n\n <li class=\"hmcts-pagination__item hmcts-pagination__item--next\">\n <a *ngIf=\"moreItems; else noNext\" class=\"hmcts-pagination__link\" (click)=\"onNext()\" href=\"javascript:void(0)\">Next page</a>\n <ng-template #noNext>\n <span class=\"hmcts-pagination__link\">Next page</span>\n </ng-template>\n </li>\n </ul>\n</nav>\n",
|
|
3890
|
+
styles: ["span.hmcts-pagination__link:hover{color:revert}"]
|
|
3891
|
+
}] }
|
|
3892
|
+
];
|
|
3893
|
+
/** @nocollapse */
|
|
3894
|
+
PaginationComponent.ctorParameters = function () { return []; };
|
|
3895
|
+
PaginationComponent.propDecorators = {
|
|
3896
|
+
moreItems: [{ type: i0.Input }],
|
|
3897
|
+
firstRecord: [{ type: i0.Input }],
|
|
3898
|
+
previousPage: [{ type: i0.Output }],
|
|
3899
|
+
nextPage: [{ type: i0.Output }]
|
|
3900
|
+
};
|
|
3901
|
+
return PaginationComponent;
|
|
3902
|
+
}());
|
|
3903
|
+
|
|
3514
3904
|
/**
|
|
3515
3905
|
* @fileoverview added by tsickle
|
|
3516
3906
|
* Generated from: lib/components/public_api.ts
|
|
@@ -3871,7 +4261,14 @@
|
|
|
3871
4261
|
* @return {?}
|
|
3872
4262
|
*/
|
|
3873
4263
|
function (searchOptions) {
|
|
3874
|
-
|
|
4264
|
+
/** @type {?} */
|
|
4265
|
+
var userInfoStr = this.sessionStorageService.getItem('userDetails');
|
|
4266
|
+
if (userInfoStr && !searchOptions.userIncluded) {
|
|
4267
|
+
/** @type {?} */
|
|
4268
|
+
var userInfo = JSON.parse(userInfoStr);
|
|
4269
|
+
this.userId = userInfo.id ? userInfo.id : userInfo.uid;
|
|
4270
|
+
}
|
|
4271
|
+
return this.http.post('/workallocation2/findPerson', { searchOptions: searchOptions, userId: this.userId });
|
|
3875
4272
|
};
|
|
3876
4273
|
/**
|
|
3877
4274
|
* @param {?} searchOptions
|
|
@@ -3883,6 +4280,13 @@
|
|
|
3883
4280
|
*/
|
|
3884
4281
|
function (searchOptions) {
|
|
3885
4282
|
var _this = this;
|
|
4283
|
+
/** @type {?} */
|
|
4284
|
+
var userInfoStr = this.sessionStorageService.getItem('userDetails');
|
|
4285
|
+
if (userInfoStr) {
|
|
4286
|
+
/** @type {?} */
|
|
4287
|
+
var userInfo = JSON.parse(userInfoStr);
|
|
4288
|
+
this.userId = userInfo.id ? userInfo.id : userInfo.uid;
|
|
4289
|
+
}
|
|
3886
4290
|
if (!this.sessionStorageService.getItem(FindAPersonService.caseworkersKey)) {
|
|
3887
4291
|
this.http.get('/workallocation2/caseworker').pipe(operators.tap(( /**
|
|
3888
4292
|
* @param {?} caseworkerList
|
|
@@ -3900,10 +4304,15 @@
|
|
|
3900
4304
|
var people = caseworkers ? this.mapCaseworkers(caseworkers, roleCategory) : [];
|
|
3901
4305
|
/** @type {?} */
|
|
3902
4306
|
var searchTerm = searchOptions && searchOptions.searchTerm ? searchOptions.searchTerm.toLowerCase() : '';
|
|
3903
|
-
|
|
4307
|
+
/** @type {?} */
|
|
4308
|
+
var finalPeopleList = people.filter(( /**
|
|
4309
|
+
* @param {?} person
|
|
4310
|
+
* @return {?}
|
|
4311
|
+
*/function (person) { return person && person.name && person.name.toLowerCase().includes(searchTerm); }));
|
|
4312
|
+
return searchOptions.userIncluded ? rxjs.of(finalPeopleList) : rxjs.of(finalPeopleList.filter(( /**
|
|
3904
4313
|
* @param {?} person
|
|
3905
4314
|
* @return {?}
|
|
3906
|
-
*/function (person) { return person && person.
|
|
4315
|
+
*/function (person) { return person && person.id !== _this.userId; })));
|
|
3907
4316
|
};
|
|
3908
4317
|
/**
|
|
3909
4318
|
* @param {?} caseworkers
|
|
@@ -3966,6 +4375,10 @@
|
|
|
3966
4375
|
this.domain = PersonRole.ALL;
|
|
3967
4376
|
this.submitted = true;
|
|
3968
4377
|
this.disabled = null;
|
|
4378
|
+
this.userIncluded = false;
|
|
4379
|
+
this.placeholderContent = '';
|
|
4380
|
+
this.isNoResultsShown = false;
|
|
4381
|
+
this.showUpdatedColor = false;
|
|
3969
4382
|
this.showAutocomplete = false;
|
|
3970
4383
|
this.findPersonControl = new forms.FormControl();
|
|
3971
4384
|
this.minSearchCharacters = 2;
|
|
@@ -4080,8 +4493,8 @@
|
|
|
4080
4493
|
FindPersonComponent.decorators = [
|
|
4081
4494
|
{ type: i0.Component, args: [{
|
|
4082
4495
|
selector: 'xuilib-find-person',
|
|
4083
|
-
template: "<h1 class=\"govuk-heading-l\" *ngIf=\"title && title.length\">\n <span class=\"govuk-caption-l\">{{title}}</span>\n {{boldTitle}}\n</h1>\n<div class=\"govuk-form-group\" [formGroup]=\"findPersonGroup\"\n [ngClass]=\"{'form-group-error': !findPersonGroup.valid && submitted}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"sub-title-hint\">\n <div id=\"sub-title-hint\" class=\"govuk-hint\" *ngIf=\"subTitle && subTitle.length\">\n {{subTitle}}\n </div>\n <span id=\"validation-error\" class=\"govuk-error-message\" *ngIf=\"findPersonGroup && findPersonGroup.errors\">\n <span class=\"govuk-visually-hidden\">Error:</span>You must select a name\n </span>\n <input id=\"inputSelectPerson\" type=\"text\" aria-label=\"select a person\" matInput\n formControlName=\"findPersonControl\"\n [matAutocomplete]=\"auto\"\n class=\"govuk-input govuk-!-width-one-third\"\n (ngModelChange)=\"updatedVal($event)\"\n [attr.disabled]=\"disabled\"\n [value]=\"selectedPerson\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of filteredOptions | async\"\n [value]=\"getDisplayName(option)\"\n (onSelectionChange)=\"onSelectionChange(option)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete}\">\n {{getDisplayName(option)}}\n </mat-option>\n </mat-autocomplete>\n </fieldset>\n</div>\n",
|
|
4084
|
-
styles: [".mat-option:hover{background:#2596be}.hide-autocomplete{display:none}"]
|
|
4496
|
+
template: "<h1 class=\"govuk-heading-l\" *ngIf=\"title && title.length\">\n <span class=\"govuk-caption-l\">{{title}}</span>\n {{boldTitle}}\n</h1>\n<div class=\"govuk-form-group\" [formGroup]=\"findPersonGroup\"\n [ngClass]=\"{'form-group-error': !findPersonGroup.valid && submitted}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"sub-title-hint\">\n <div id=\"sub-title-hint\" class=\"govuk-hint\" *ngIf=\"subTitle && subTitle.length\">\n {{subTitle}}\n </div>\n <span id=\"validation-error\" class=\"govuk-error-message\" *ngIf=\"findPersonGroup && findPersonGroup.errors\">\n <span class=\"govuk-visually-hidden\">Error:</span>You must select a name\n </span>\n <input id=\"inputSelectPerson\" type=\"text\" aria-label=\"select a person\" matInput\n formControlName=\"findPersonControl\"\n [matAutocomplete]=\"auto\"\n class=\"govuk-input govuk-!-width-one-third\"\n (ngModelChange)=\"updatedVal($event)\"\n [placeholder]=\"placeholderContent\"\n [attr.disabled]=\"disabled\"\n [value]=\"selectedPerson\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of filteredOptions | async\"\n [value]=\"getDisplayName(option)\"\n (onSelectionChange)=\"onSelectionChange(option)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete, 'select-option': showUpdatedColor}\">\n {{getDisplayName(option)}}\n </mat-option>\n <mat-option [ngClass]=\"{'select-option': showUpdatedColor}\" *ngIf=\"isNoResultsShown && !(filteredOptions | async)?.length && showAutocomplete\">{{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n </fieldset>\n</div>\n",
|
|
4497
|
+
styles: [".mat-option:hover{background:#2596be}.mat-option.select-option:hover{background:#1d70b8;color:#fff}.hide-autocomplete{display:none}"]
|
|
4085
4498
|
}] }
|
|
4086
4499
|
];
|
|
4087
4500
|
/** @nocollapse */
|
|
@@ -4099,7 +4512,11 @@
|
|
|
4099
4512
|
findPersonGroup: [{ type: i0.Input }],
|
|
4100
4513
|
selectedPerson: [{ type: i0.Input }],
|
|
4101
4514
|
submitted: [{ type: i0.Input }],
|
|
4102
|
-
disabled: [{ type: i0.Input }]
|
|
4515
|
+
disabled: [{ type: i0.Input }],
|
|
4516
|
+
userIncluded: [{ type: i0.Input }],
|
|
4517
|
+
placeholderContent: [{ type: i0.Input }],
|
|
4518
|
+
isNoResultsShown: [{ type: i0.Input }],
|
|
4519
|
+
showUpdatedColor: [{ type: i0.Input }]
|
|
4103
4520
|
};
|
|
4104
4521
|
return FindPersonComponent;
|
|
4105
4522
|
}());
|
|
@@ -4181,13 +4598,14 @@
|
|
|
4181
4598
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4182
4599
|
*/
|
|
4183
4600
|
/*
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4601
|
+
* Gov UK Date Component
|
|
4602
|
+
* Responsible for displaying 3 input fields:
|
|
4603
|
+
* day / month / year
|
|
4604
|
+
* displaying errorMessage messages
|
|
4605
|
+
* */
|
|
4189
4606
|
var GovUkDateComponent = /** @class */ (function () {
|
|
4190
4607
|
function GovUkDateComponent() {
|
|
4608
|
+
this.isOptional = false;
|
|
4191
4609
|
}
|
|
4192
4610
|
/**
|
|
4193
4611
|
* @return {?}
|
|
@@ -4196,11 +4614,86 @@
|
|
|
4196
4614
|
* @return {?}
|
|
4197
4615
|
*/
|
|
4198
4616
|
function () {
|
|
4617
|
+
this.day = this.config.id + "_day";
|
|
4618
|
+
this.month = this.config.id + "_month";
|
|
4619
|
+
this.year = this.config.id + "_year";
|
|
4620
|
+
/** @type {?} */
|
|
4621
|
+
var dateValidator = this.DateValidator();
|
|
4622
|
+
this.formGroup.get(this.day).setValidators(dateValidator);
|
|
4623
|
+
};
|
|
4624
|
+
/**
|
|
4625
|
+
* @private
|
|
4626
|
+
* @param {?} d
|
|
4627
|
+
* @param {?} month
|
|
4628
|
+
* @param {?} year
|
|
4629
|
+
* @return {?}
|
|
4630
|
+
*/
|
|
4631
|
+
GovUkDateComponent.prototype.isValidDate = /**
|
|
4632
|
+
* @private
|
|
4633
|
+
* @param {?} d
|
|
4634
|
+
* @param {?} month
|
|
4635
|
+
* @param {?} year
|
|
4636
|
+
* @return {?}
|
|
4637
|
+
*/
|
|
4638
|
+
function (d, month, year) {
|
|
4639
|
+
/** @type {?} */
|
|
4640
|
+
var dateCheck = !isNaN(d.getTime());
|
|
4641
|
+
// Month mismatch occurs if the provided day or month are invalid, or either is omitted. **Note:** This is insufficient for
|
|
4642
|
+
// checking date validity when the year is omitted because it defaults to 1900 - an extra check is required
|
|
4643
|
+
/** @type {?} */
|
|
4644
|
+
var monthMatch = d.getMonth() === month;
|
|
4645
|
+
/** @type {?} */
|
|
4646
|
+
var yearMatch = d.getFullYear() === year;
|
|
4647
|
+
return dateCheck && monthMatch && yearMatch;
|
|
4648
|
+
};
|
|
4649
|
+
/**
|
|
4650
|
+
* @private
|
|
4651
|
+
* @param {?} value
|
|
4652
|
+
* @return {?}
|
|
4653
|
+
*/
|
|
4654
|
+
GovUkDateComponent.prototype.isEmpty = /**
|
|
4655
|
+
* @private
|
|
4656
|
+
* @param {?} value
|
|
4657
|
+
* @return {?}
|
|
4658
|
+
*/
|
|
4659
|
+
function (value) {
|
|
4660
|
+
// Note: Intentional use of == to check for null or undefined
|
|
4661
|
+
/* eslint-disable eqeqeq */
|
|
4662
|
+
/* tslint:disable:triple-equals */
|
|
4663
|
+
// NaN and < 0 checks required for month field
|
|
4664
|
+
return value == null || value === '' || isNaN(value) || value < 0;
|
|
4665
|
+
/* eslint-enable eqeqeq */
|
|
4666
|
+
/* tslint:enable:triple-equals */
|
|
4667
|
+
};
|
|
4668
|
+
/**
|
|
4669
|
+
* @return {?}
|
|
4670
|
+
*/
|
|
4671
|
+
GovUkDateComponent.prototype.DateValidator = /**
|
|
4672
|
+
* @return {?}
|
|
4673
|
+
*/
|
|
4674
|
+
function () {
|
|
4675
|
+
var _this = this;
|
|
4676
|
+
return ( /**
|
|
4677
|
+
* @return {?}
|
|
4678
|
+
*/function () {
|
|
4679
|
+
/** @type {?} */
|
|
4680
|
+
var day = _this.formGroup.get(_this.day).value;
|
|
4681
|
+
/** @type {?} */
|
|
4682
|
+
var month = _this.formGroup.get(_this.month).value - 1;
|
|
4683
|
+
/** @type {?} */
|
|
4684
|
+
var year = _this.formGroup.get(_this.year).value;
|
|
4685
|
+
// Validation should pass if the date field is optional and day, month, and year are all empty
|
|
4686
|
+
if (_this.isOptional && _this.isEmpty(day) && _this.isEmpty(month) && _this.isEmpty(year)) {
|
|
4687
|
+
return null;
|
|
4688
|
+
}
|
|
4689
|
+
// + to coerce year to a number
|
|
4690
|
+
return !_this.isValidDate(new Date(year, month, day), month, +year) ? { dateComponent: true } : null;
|
|
4691
|
+
});
|
|
4199
4692
|
};
|
|
4200
4693
|
GovUkDateComponent.decorators = [
|
|
4201
4694
|
{ type: i0.Component, args: [{
|
|
4202
4695
|
selector: 'xuilib-gov-uk-date',
|
|
4203
|
-
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
|
|
4696
|
+
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",
|
|
4204
4697
|
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}"]
|
|
4205
4698
|
}] }
|
|
4206
4699
|
];
|
|
@@ -4209,7 +4702,8 @@
|
|
|
4209
4702
|
GovUkDateComponent.propDecorators = {
|
|
4210
4703
|
config: [{ type: i0.Input }],
|
|
4211
4704
|
errorMessage: [{ type: i0.Input }],
|
|
4212
|
-
formGroup: [{ type: i0.Input }]
|
|
4705
|
+
formGroup: [{ type: i0.Input }],
|
|
4706
|
+
isOptional: [{ type: i0.Input }]
|
|
4213
4707
|
};
|
|
4214
4708
|
return GovUkDateComponent;
|
|
4215
4709
|
}());
|
|
@@ -5061,7 +5555,9 @@
|
|
|
5061
5555
|
LoadingSpinnerComponent,
|
|
5062
5556
|
GenericFilterComponent,
|
|
5063
5557
|
CookieBannerComponent,
|
|
5064
|
-
FindPersonComponent
|
|
5558
|
+
FindPersonComponent,
|
|
5559
|
+
SearchLocationComponent,
|
|
5560
|
+
PaginationComponent
|
|
5065
5561
|
];
|
|
5066
5562
|
/** @type {?} */
|
|
5067
5563
|
var GOV_UI_COMPONENTS = [
|
|
@@ -6133,6 +6629,8 @@
|
|
|
6133
6629
|
exports.UserDetailsComponent = UserDetailsComponent;
|
|
6134
6630
|
exports.UserListComponent = UserListComponent;
|
|
6135
6631
|
exports.CookieBannerComponent = CookieBannerComponent;
|
|
6632
|
+
exports.SearchLocationComponent = SearchLocationComponent;
|
|
6633
|
+
exports.PaginationComponent = PaginationComponent;
|
|
6136
6634
|
exports.FeatureToggleDirective = FeatureToggleDirective;
|
|
6137
6635
|
exports.LetContext = LetContext;
|
|
6138
6636
|
exports.LetDirective = LetDirective;
|
|
@@ -6180,6 +6678,8 @@
|
|
|
6180
6678
|
exports.ɵo = InviteUserFormComponent;
|
|
6181
6679
|
exports.ɵn = InviteUserPermissionComponent;
|
|
6182
6680
|
exports.ɵbc = LoadingSpinnerComponent;
|
|
6681
|
+
exports.ɵbm = PaginationComponent;
|
|
6682
|
+
exports.ɵbk = SearchLocationComponent;
|
|
6183
6683
|
exports.ɵv = SelectedCaseConfirmComponent;
|
|
6184
6684
|
exports.ɵt = SelectedCaseListComponent;
|
|
6185
6685
|
exports.ɵu = SelectedCaseComponent;
|
|
@@ -6198,32 +6698,33 @@
|
|
|
6198
6698
|
exports.ɵg = FeatureToggleDirective;
|
|
6199
6699
|
exports.ɵi = LetContext;
|
|
6200
6700
|
exports.ɵj = LetDirective;
|
|
6201
|
-
exports.ɵ
|
|
6202
|
-
exports.ɵ
|
|
6203
|
-
exports.ɵ
|
|
6204
|
-
exports.ɵ
|
|
6205
|
-
exports.ɵ
|
|
6206
|
-
exports.ɵ
|
|
6207
|
-
exports.ɵ
|
|
6208
|
-
exports.ɵ
|
|
6209
|
-
exports.ɵ
|
|
6210
|
-
exports.ɵ
|
|
6211
|
-
exports.ɵ
|
|
6212
|
-
exports.ɵ
|
|
6213
|
-
exports.ɵ
|
|
6214
|
-
exports.ɵ
|
|
6215
|
-
exports.ɵ
|
|
6216
|
-
exports.ɵ
|
|
6217
|
-
exports.ɵ
|
|
6218
|
-
exports.ɵ
|
|
6219
|
-
exports.ɵ
|
|
6220
|
-
exports.ɵ
|
|
6221
|
-
exports.ɵ
|
|
6701
|
+
exports.ɵbv = GovUkCheckboxComponent;
|
|
6702
|
+
exports.ɵcb = GovUkCheckboxesComponent;
|
|
6703
|
+
exports.ɵca = GovUkDateComponent;
|
|
6704
|
+
exports.ɵby = GovUkErrorMessageComponent;
|
|
6705
|
+
exports.ɵbz = GovUkFieldsetComponent;
|
|
6706
|
+
exports.ɵcg = GovUkFileUploadComponent;
|
|
6707
|
+
exports.ɵbw = GovUkFormGroupWrapperComponent;
|
|
6708
|
+
exports.ɵbu = GovUkInputComponent;
|
|
6709
|
+
exports.ɵbx = GovUkLabelComponent;
|
|
6710
|
+
exports.ɵcc = GovUkRadioComponent;
|
|
6711
|
+
exports.ɵcd = GovUkRadiosComponent;
|
|
6712
|
+
exports.ɵce = GovUkSelectComponent;
|
|
6713
|
+
exports.ɵbt = GovukTableComponent;
|
|
6714
|
+
exports.ɵcf = GovUkTextareaComponent;
|
|
6715
|
+
exports.ɵbs = HmctsBannerComponent;
|
|
6716
|
+
exports.ɵbq = HmctsErrorSummaryComponent;
|
|
6717
|
+
exports.ɵbn = HmctsIdentityBarComponent;
|
|
6718
|
+
exports.ɵbr = HmctsMainWrapperComponent;
|
|
6719
|
+
exports.ɵbp = HmctsPrimaryNavigationComponent;
|
|
6720
|
+
exports.ɵbo = HmctsSubNavigationComponent;
|
|
6721
|
+
exports.ɵch = RemoveHostDirective;
|
|
6222
6722
|
exports.ɵr = CaseSharingStateService;
|
|
6223
6723
|
exports.ɵbg = CookieService;
|
|
6224
6724
|
exports.ɵh = FeatureToggleService;
|
|
6225
6725
|
exports.ɵbe = FilterService;
|
|
6226
6726
|
exports.ɵbi = FindAPersonService;
|
|
6727
|
+
exports.ɵbl = LocationService;
|
|
6227
6728
|
exports.ɵbj = SessionStorageService;
|
|
6228
6729
|
|
|
6229
6730
|
Object.defineProperty(exports, '__esModule', { value: true });
|