@hmcts/rpx-xui-common-lib 1.7.45 → 1.7.47-clear-stream-data-v2

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.
Files changed (49) hide show
  1. package/bundles/hmcts-rpx-xui-common-lib.umd.js +382 -55
  2. package/bundles/hmcts-rpx-xui-common-lib.umd.js.map +1 -1
  3. package/bundles/hmcts-rpx-xui-common-lib.umd.min.js +1 -1
  4. package/bundles/hmcts-rpx-xui-common-lib.umd.min.js.map +1 -1
  5. package/esm2015/hmcts-rpx-xui-common-lib.js +3 -2
  6. package/esm2015/lib/components/find-location/find-location.component.js +2 -2
  7. package/esm2015/lib/components/find-service/find-service.component.js +128 -27
  8. package/esm2015/lib/components/generic-filter/generic-filter-utils.js +1 -1
  9. package/esm2015/lib/components/generic-filter/generic-filter.component.js +150 -11
  10. package/esm2015/lib/components/search-location/search-location.component.js +2 -2
  11. package/esm2015/lib/components/search-service/search-service.component.js +16 -33
  12. package/esm2015/lib/exui-common-lib.module.js +10 -3
  13. package/esm2015/lib/models/filter.model.js +53 -3
  14. package/esm2015/lib/pipes/capitalize.pipe.js +21 -0
  15. package/esm2015/lib/services/filter/filter.service.js +19 -5
  16. package/esm2015/lib/services/find-person/find-person.service.js +3 -3
  17. package/esm2015/lib/services/storage/session-storage/session-storage.service.js +55 -0
  18. package/esm5/hmcts-rpx-xui-common-lib.js +3 -2
  19. package/esm5/lib/components/find-location/find-location.component.js +2 -2
  20. package/esm5/lib/components/find-service/find-service.component.js +166 -25
  21. package/esm5/lib/components/generic-filter/generic-filter-utils.js +1 -1
  22. package/esm5/lib/components/generic-filter/generic-filter.component.js +166 -10
  23. package/esm5/lib/components/search-location/search-location.component.js +2 -2
  24. package/esm5/lib/components/search-service/search-service.component.js +18 -37
  25. package/esm5/lib/exui-common-lib.module.js +8 -3
  26. package/esm5/lib/models/filter.model.js +53 -3
  27. package/esm5/lib/pipes/capitalize.pipe.js +29 -0
  28. package/esm5/lib/services/filter/filter.service.js +23 -5
  29. package/esm5/lib/services/find-person/find-person.service.js +3 -3
  30. package/esm5/lib/services/{session-storage → storage/session-storage}/session-storage.service.js +2 -2
  31. package/fesm2015/hmcts-rpx-xui-common-lib.js +331 -54
  32. package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
  33. package/fesm5/hmcts-rpx-xui-common-lib.js +395 -55
  34. package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
  35. package/hmcts-rpx-xui-common-lib.d.ts +2 -1
  36. package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
  37. package/lib/components/find-service/find-service.component.d.ts +15 -9
  38. package/lib/components/generic-filter/generic-filter-utils.d.ts +2 -5
  39. package/lib/components/generic-filter/generic-filter.component.d.ts +6 -2
  40. package/lib/components/search-location/search-location.component.d.ts +1 -1
  41. package/lib/components/search-service/search-service.component.d.ts +5 -11
  42. package/lib/exui-common-lib.module.d.ts +1 -2
  43. package/lib/models/filter.model.d.ts +24 -7
  44. package/lib/pipes/capitalize.pipe.d.ts +4 -0
  45. package/lib/services/filter/filter.service.d.ts +1 -0
  46. package/lib/services/find-person/find-person.service.d.ts +1 -1
  47. package/lib/services/{session-storage → storage/session-storage}/session-storage.service.d.ts +0 -0
  48. package/package.json +1 -1
  49. package/esm2015/lib/services/session-storage/session-storage.service.js +0 -55
@@ -9,7 +9,7 @@ import { Title } from '@angular/platform-browser';
9
9
  import { DocumentInterruptSource, Idle } from '@ng-idle/core';
10
10
  import { Keepalive } from '@ng-idle/keepalive';
11
11
  import { RouterModule, Router, NavigationEnd } from '@angular/router';
12
- import { Component, EventEmitter, Input, Output, ViewEncapsulation, Injectable, Directive, TemplateRef, ViewContainerRef, ElementRef, Inject, ViewChild, ChangeDetectorRef, InjectionToken, ChangeDetectionStrategy, defineInjectable, inject, NgModule } from '@angular/core';
12
+ import { Component, EventEmitter, Input, Output, ViewEncapsulation, Injectable, Pipe, Directive, TemplateRef, ViewContainerRef, ElementRef, Inject, ViewChild, ChangeDetectorRef, InjectionToken, ChangeDetectionStrategy, defineInjectable, inject, NgModule } from '@angular/core';
13
13
  import { BehaviorSubject, of, zip, Subject, combineLatest } from 'rxjs';
14
14
  import { distinctUntilChanged, map, debounceTime, filter, mergeMap, tap, catchError, switchMap, delay, skipWhile } from 'rxjs/operators';
15
15
 
@@ -493,10 +493,10 @@ class FilterService {
493
493
  return this.filterSettings[id];
494
494
  }
495
495
  if (sessionStorage.getItem(id)) {
496
- return JSON.parse(window.sessionStorage.getItem(id));
496
+ return JSON.parse(sessionStorage.getItem(id));
497
497
  }
498
498
  if (localStorage.getItem(id)) {
499
- return JSON.parse(window.localStorage.getItem(id));
499
+ return JSON.parse(localStorage.getItem(id));
500
500
  }
501
501
  return null;
502
502
  }
@@ -510,13 +510,27 @@ class FilterService {
510
510
  }
511
511
  return this.streams[id].asObservable();
512
512
  }
513
+ /**
514
+ * @param {?} id
515
+ * @return {?}
516
+ */
517
+ clearSessionAndLocalPersistance(id) {
518
+ sessionStorage.removeItem(id);
519
+ localStorage.removeItem(id);
520
+ if (this.filterSettings[id] !== undefined) {
521
+ this.filterSettings[id] = null;
522
+ }
523
+ if (this.streams[id] !== undefined) {
524
+ this.streams[id].next(null);
525
+ }
526
+ }
513
527
  /**
514
528
  * @private
515
529
  * @param {?} setting
516
530
  * @return {?}
517
531
  */
518
532
  persistLocal(setting) {
519
- window.localStorage.setItem(setting.id, JSON.stringify(setting));
533
+ localStorage.setItem(setting.id, JSON.stringify(setting));
520
534
  }
521
535
  /**
522
536
  * @private
@@ -524,7 +538,7 @@ class FilterService {
524
538
  * @return {?}
525
539
  */
526
540
  persistSession(setting) {
527
- window.sessionStorage.setItem(setting.id, JSON.stringify(setting));
541
+ sessionStorage.setItem(setting.id, JSON.stringify(setting));
528
542
  }
529
543
  /**
530
544
  * @private
@@ -677,10 +691,10 @@ class GenericFilterComponent {
677
691
  static addFormValidators(field) {
678
692
  /** @type {?} */
679
693
  const validators = [];
680
- if (field && field.minSelected) {
694
+ if (field && field.minSelected > 0) {
681
695
  validators.push(minSelectedValidator(field.minSelected));
682
696
  }
683
- if (field && field.maxSelected) {
697
+ if (field && field.maxSelected > 0) {
684
698
  validators.push(maxSelectedValidator(field.maxSelected));
685
699
  }
686
700
  return validators;
@@ -698,6 +712,7 @@ class GenericFilterComponent {
698
712
  * @return {?}
699
713
  */
700
714
  () => this.submitted = false));
715
+ this.filterSkillsByServices(null, this.config);
701
716
  }
702
717
  /**
703
718
  * @return {?}
@@ -828,6 +843,11 @@ class GenericFilterComponent {
828
843
  * @return {?}
829
844
  */
830
845
  inputChanged(field) {
846
+ if (field.name === 'user-services') {
847
+ /** @type {?} */
848
+ const selectedServices = this.getSelectedValuesForFields(this.form.controls, field);
849
+ this.filterSkillsByServices(selectedServices, this.config);
850
+ }
831
851
  if (field.radioSelectionChange && typeof field.radioSelectionChange === 'string') {
832
852
  const [name, value] = field.enableCondition.split('=');
833
853
  this.form.get(name).patchValue(value);
@@ -846,6 +866,9 @@ class GenericFilterComponent {
846
866
  this.filterService.persist(settings, this.config.persistence);
847
867
  this.filterService.givenErrors.next(null);
848
868
  this.submitted = false;
869
+ if (this.config.cancelButtonCallback) {
870
+ this.config.cancelButtonCallback();
871
+ }
849
872
  }
850
873
  /**
851
874
  * @param {?} values
@@ -1030,9 +1053,9 @@ class GenericFilterComponent {
1030
1053
  const formArray = this.buildCheckBoxFormArray(field, settings);
1031
1054
  this.form.addControl(field.name, formArray);
1032
1055
  }
1033
- else if (field.type === 'find-location') {
1056
+ else if (field.type === 'find-location' || field.type === 'find-service') {
1034
1057
  /** @type {?} */
1035
- const formArray = this.buildFindLocationFormArray(field, settings);
1058
+ const formArray = this.buildFormArray(field, settings);
1036
1059
  this.form.addControl(field.name, formArray);
1037
1060
  }
1038
1061
  else {
@@ -1043,6 +1066,9 @@ class GenericFilterComponent {
1043
1066
  if (field.type === 'text-input') {
1044
1067
  validators.push(Validators.minLength(field.minSelected));
1045
1068
  }
1069
+ if (field.type === 'email-input') {
1070
+ validators.push(Validators.email);
1071
+ }
1046
1072
  }
1047
1073
  /** @type {?} */
1048
1074
  let defaultValue = null;
@@ -1076,7 +1102,7 @@ class GenericFilterComponent {
1076
1102
  });
1077
1103
  this.form.addControl(field.name, formGroup);
1078
1104
  }
1079
- else {
1105
+ else if (field.type !== 'group-title') {
1080
1106
  /** @type {?} */
1081
1107
  const control = new FormControl(defaultValue, validators);
1082
1108
  this.form.addControl(field.name, control);
@@ -1128,7 +1154,7 @@ class GenericFilterComponent {
1128
1154
  * @param {?} settings
1129
1155
  * @return {?}
1130
1156
  */
1131
- buildFindLocationFormArray(field, settings) {
1157
+ buildFormArray(field, settings) {
1132
1158
  /** @type {?} */
1133
1159
  const validators = GenericFilterComponent.addFormValidators(field);
1134
1160
  /** @type {?} */
@@ -1189,29 +1215,154 @@ class GenericFilterComponent {
1189
1215
  */
1190
1216
  emitFormErrors(form) {
1191
1217
  /** @type {?} */
1192
- const errors = [];
1218
+ let errors = [];
1193
1219
  for (const field of this.config.fields) {
1194
1220
  /** @type {?} */
1195
1221
  const formGroup = form.get(field.name);
1196
- if (formGroup && formGroup.errors && formGroup.errors.minlength) {
1222
+ if (formGroup && formGroup.errors && (formGroup.errors.minlength || formGroup.errors.required)) {
1197
1223
  errors.push({ name: field.name, error: field.minSelectedError });
1198
1224
  }
1199
1225
  if (formGroup && formGroup.errors && formGroup.errors.maxLength) {
1200
1226
  errors.push({ name: field.name, error: field.minSelectedError });
1201
1227
  }
1202
1228
  }
1229
+ // remove duplicates
1230
+ errors = errors.filter((/**
1231
+ * @param {?} filterError
1232
+ * @param {?} i
1233
+ * @param {?} arr
1234
+ * @return {?}
1235
+ */
1236
+ (filterError, i, arr) => {
1237
+ return errors.indexOf(arr.find((/**
1238
+ * @param {?} item
1239
+ * @return {?}
1240
+ */
1241
+ item => item.name === filterError.name))) === i;
1242
+ }));
1203
1243
  if (errors.length) {
1204
1244
  this.filterService.givenErrors.next(errors);
1205
1245
  }
1206
1246
  }
1247
+ /**
1248
+ * @param {?} services
1249
+ * @param {?} config
1250
+ * @return {?}
1251
+ */
1252
+ filterSkillsByServices(services, config) {
1253
+ this.filteredSkillsByServices = [];
1254
+ /** @type {?} */
1255
+ const userSkillsField = config.fields.find((/**
1256
+ * @param {?} f
1257
+ * @return {?}
1258
+ */
1259
+ f => f.name === 'user-skills'));
1260
+ if (userSkillsField) {
1261
+ /** @type {?} */
1262
+ const userSkills = userSkillsField.groupOptions;
1263
+ if (!services || services.length === 0) {
1264
+ this.filteredSkillsByServices = userSkills;
1265
+ }
1266
+ else {
1267
+ services.forEach((/**
1268
+ * @param {?} s
1269
+ * @return {?}
1270
+ */
1271
+ s => {
1272
+ /** @type {?} */
1273
+ const groupOption = userSkills.find((/**
1274
+ * @param {?} u
1275
+ * @return {?}
1276
+ */
1277
+ u => u.group === s));
1278
+ if (groupOption) {
1279
+ this.filteredSkillsByServices.push(groupOption);
1280
+ }
1281
+ }));
1282
+ }
1283
+ }
1284
+ this.filteredSkillsByServices = this.sortGroupOptions(this.filteredSkillsByServices);
1285
+ return this.filteredSkillsByServices;
1286
+ }
1287
+ /**
1288
+ * @private
1289
+ * @param {?} formValues
1290
+ * @param {?} field
1291
+ * @return {?}
1292
+ */
1293
+ getSelectedValuesForFields(formValues, field) {
1294
+ /** @type {?} */
1295
+ const selectedValues = [];
1296
+ Object.keys(formValues).map((/**
1297
+ * @param {?} name
1298
+ * @return {?}
1299
+ */
1300
+ (name) => {
1301
+ /** @type {?} */
1302
+ const values = formValues[name].value;
1303
+ if (name === field.name) {
1304
+ values.forEach((/**
1305
+ * @param {?} v
1306
+ * @return {?}
1307
+ */
1308
+ (v) => {
1309
+ selectedValues.push(v.key);
1310
+ }));
1311
+ }
1312
+ }));
1313
+ return selectedValues;
1314
+ }
1315
+ /**
1316
+ * @private
1317
+ * @param {?} groupOptions
1318
+ * @return {?}
1319
+ */
1320
+ sortGroupOptions(groupOptions) {
1321
+ /** @type {?} */
1322
+ const sortedResults = [];
1323
+ /** @type {?} */
1324
+ const groups = groupOptions.map((/**
1325
+ * @param {?} go
1326
+ * @return {?}
1327
+ */
1328
+ go => go.group));
1329
+ groups.sort().forEach((/**
1330
+ * @param {?} g
1331
+ * @return {?}
1332
+ */
1333
+ g => {
1334
+ /** @type {?} */
1335
+ const options = groupOptions.find((/**
1336
+ * @param {?} go
1337
+ * @return {?}
1338
+ */
1339
+ (go) => go.group === g)).options;
1340
+ /** @type {?} */
1341
+ const sortedOptions = options.sort((/**
1342
+ * @param {?} a
1343
+ * @param {?} b
1344
+ * @return {?}
1345
+ */
1346
+ (a, b) => {
1347
+ return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
1348
+ }));
1349
+ /** @type {?} */
1350
+ const result = {
1351
+ group: g,
1352
+ options: sortedOptions
1353
+ };
1354
+ sortedResults.push(result);
1355
+ }));
1356
+ return sortedResults;
1357
+ }
1207
1358
  }
1208
1359
  GenericFilterComponent.decorators = [
1209
1360
  { type: Component, args: [{
1210
1361
  selector: 'xuilib-generic-filter',
1211
- 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 [id]=\"field.name\"\n [ngClass]=\"{'form-group-error': submitted && ((form.get(field.name).errors?.minlength || form.get(field.name).errors?.required) || 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 || form.get(field.name).errors?.required)\">\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)=\"fieldChanged(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=\"'checkbox-large'\">\n <div class=\"govuk-checkboxes\" [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)=\"fieldChanged(field, form)\"\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 (personFieldChanged)=\"inputChanged(field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n [userIncluded]=\"false\"\n ></xuilib-find-person>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-location'\">\n <xuilib-find-location (locationFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [locationTitle]=\"field.locationTitle\"\n [enableAddLocationButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [disableInputField]=\"field.disable\"\n [selectedLocations]=\"form.get(field.name)?.value\"\n [submitted]=\"submitted\"\n [services]=\"form.get(field.findLocationField)?.value\"\n [field]=\"field\"\n ></xuilib-find-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-service'\">\n <xuilib-find-service (serviceFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [title]=\"field.title\"\n [enableAddServiceButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [disableInputField]=\"field.disable\"\n [selectedServices]=\"form.get(field.name)?.value\"\n [field]=\"field\"\n ></xuilib-find-service>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text-input'\">\n <input class=\"govuk-input\" type=\"text\"\n [formControlName]=\"field.name\"\n [id]=\"field.name\"\n [attr.disabled]=\"disabled(field, form)\"\n (change)=\"fieldChanged(field, form)\"\n />\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 *ngIf=\"config.showCancelFilterButton\"\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",
1362
+ 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 elevated-break\">\n <ng-container [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'group-title'\">\n <div [class]=\"field.titleClasses ? field.titleClasses: 'govuk-label govuk-label--m govuk-!-margin-bottom-4'\">\n {{ field.name | capitalize }}\n </div>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <div class=\"govuk-form-group xui-generic-filter\"\n [hidden]=\"hidden(field, form)\"\n [id]=\"field.name\"\n [ngClass]=\"{'form-group-error': submitted && ((form.get(field.name).errors?.minlength || form.get(field.name).errors?.required) || form.get(field.name).errors?.maxLength || form.get(field.name).errors?.email)}\">\n\n <div *ngIf=\"field.title\" class=\"xui-generic-filter__field-title\">\n <h3 [class]=\"field.titleClasses ? field.titleClasses : 'govuk-heading-s'\" style=\"margin-bottom: 0!important\">\n {{field.title | capitalize}}\n </h3>\n\n <div *ngIf=\"field?.titleHint\" class=\"govuk-!-margin-left-2\">\n {{ field.titleHint }}\n </div>\n </div>\n\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\"\n *ngIf=\"field.displayMinSelectedError && submitted && (form.get(field.name).errors?.minlength || form.get(field.name).errors?.required)\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.minSelectedError}}\n </span>\n\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\"\n *ngIf=\"field.displayMaxSelectedError && submitted && form.get(field.name).errors?.maxLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.maxSelectedError}}\n </span>\n\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\"\n *ngIf=\"field.emailError && submitted && form.get(field.name).errors?.email\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.emailError}}\n </span>\n\n <div class=\"govuk-body\" [class.govuk-body--maxWidth480px]=\"field.maxWidth480px\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"fieldChanged(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=\"'group-select'\">\n <select class=\"govuk-select\" (change)=\"fieldChanged(field, form)\" [attr.disabled]=\"disabled(field, form)\" [name]=\"'select_' + field.name\" [id]=\"'select_' + field.name\" [formControlName]=\"field.name\">\n <option selected value=\"\">{{field.disabledText}}</option>\n <optgroup *ngFor = 'let grp of filteredSkillsByServices' label=\"{{grp.group | titlecase}}\">\n <option *ngFor = 'let item of grp.options' [value]=\"item.key\">{{item.label}}</option> \n </optgroup>\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=\"'checkbox-large'\">\n <div class=\"govuk-checkboxes\" [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)=\"fieldChanged(field, form)\"\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 (personFieldChanged)=\"inputChanged(field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findPersonGroup]=\"form\"\n [selectedPerson]=\"form.get(field.name)?.value?.email\"\n [userIncluded]=\"false\"\n ></xuilib-find-person>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-location'\">\n <xuilib-find-location (locationFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [fields]=\"config.fields\"\n [locationTitle]=\"field.locationTitle\"\n [enableAddLocationButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [disableInputField]=\"field.disable\"\n [selectedLocations]=\"form.get(field.name)?.value\"\n [submitted]=\"submitted\"\n [services]=\"form.get(field.findLocationField)?.value\"\n [field]=\"field\"\n ></xuilib-find-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"'find-service'\">\n <xuilib-find-service (serviceFieldChanged)=\"inputChanged(field)\"\n [form]=\"form\"\n [enableAddServiceButton]=\"field.enableAddButton\"\n [disabled]=\"disabled(field, form)\"\n [selectedServices]=\"form.get(field.name)?.value\"\n [services]=\"field.options\"\n [field]=\"field\"\n ></xuilib-find-service>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text-input'\">\n <input class=\"govuk-input\" type=\"text\"\n [formControlName]=\"field.name\"\n [id]=\"field.name\"\n [attr.disabled]=\"disabled(field, form)\"\n (change)=\"fieldChanged(field, form)\"\n />\n </ng-container>\n <ng-container *ngSwitchCase=\"'email-input'\">\n <input class=\"govuk-input\" type=\"email\"\n [formControlName]=\"field.name\"\n [id]=\"field.name\"\n [attr.disabled]=\"disabled(field, form)\"\n (change)=\"fieldChanged(field, form)\"\n />\n </ng-container>\n </div>\n </div>\n </ng-container>\n </ng-container>\n\n </div>\n <hr class=\"govuk-section-break govuk-section-break--m\"/>\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 *ngIf=\"config.showCancelFilterButton\"\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",
1212
1363
  changeDetection: ChangeDetectionStrategy.OnPush,
1213
1364
  encapsulation: ViewEncapsulation.None,
1214
- styles: [".contain-classes .elevated-break{margin-bottom:20px}@media (min-width:40.0625em){.contain-classes .elevated-break{margin-bottom:30px}}.contain-classes .xui-generic-filter .select-all{margin-bottom:10px}.contain-classes .xui-generic-filter .govuk-checkboxes{display:flex;flex-direction:column;flex-wrap:wrap}.contain-classes .xui-generic-filter .govuk-checkboxes>div{flex-grow:1;flex-shrink:0}.contain-classes .govuk-select{width:100%}"]
1365
+ styles: [".contain-classes .elevated-break{margin-bottom:20px}@media (min-width:40.0625em){.contain-classes .elevated-break{margin-bottom:30px}}.contain-classes .govuk-body--maxWidth480px{max-width:480px}.contain-classes .xui-generic-filter .select-all{margin-bottom:10px}.contain-classes .xui-generic-filter .govuk-checkboxes{display:flex;flex-direction:column;flex-wrap:wrap}.contain-classes .xui-generic-filter .govuk-checkboxes>div{flex-grow:1;flex-shrink:0}.contain-classes .xui-generic-filter__field-title{display:flex;align-items:center;margin-bottom:10px}.contain-classes .govuk-select{width:100%}"]
1215
1366
  }] }
1216
1367
  ];
1217
1368
  /** @nocollapse */
@@ -3014,7 +3165,7 @@ LocationService.ctorParameters = () => [
3014
3165
 
3015
3166
  /**
3016
3167
  * @fileoverview added by tsickle
3017
- * Generated from: lib/services/session-storage/session-storage.service.ts
3168
+ * Generated from: lib/services/storage/session-storage/session-storage.service.ts
3018
3169
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3019
3170
  */
3020
3171
  class SessionStorageService {
@@ -3468,7 +3619,7 @@ class FindLocationComponent {
3468
3619
  FindLocationComponent.decorators = [
3469
3620
  { type: Component, args: [{
3470
3621
  selector: 'xuilib-find-location',
3471
- template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\" *ngIf=\"locationTitle\">{{locationTitle}}</label>\n </div>\n\n <div class=\"search-location__input-container\">\n <exui-search-location class=\"search-location__input\"\n [locations]=\"locations\"\n [selectedLocations]=\"selectedLocations\"\n [singleMode]=\"field.maxSelected === 1\"\n [bookingCheck]=\"field.bookingCheckType\"\n [delay]=\"300\"\n [disabled]=\"disabled\"\n [serviceIds]=\"serviceIds\"\n (locationInputChanged)=\"onInputChanged($event)\"\n (locationSelected)=\"onLocationSelected($event)\"\n (searchLocationChanged)=\"onSearchInputChanged()\"\n [locationType]=\"'case-management'\"></exui-search-location>\n <a href=\"javascript:void(0)\" (click)=\"addLocation()\" class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\" data-module=\"govuk-button\" *ngIf=\"enableAddLocationButton\">\n Add\n </a>\n </div>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"location-selection\" *ngFor=\"let selection of selectedLocations\">\n <a class=\"hmcts-filter__tag\" (click)=\"removeLocation(selection)\" href=\"javascript:void(0)\">\n {{ selection.site_name }}\n </a>\n </li>\n </ul>\n</div>\n",
3622
+ template: "<div class=\"location-picker-custom\">\n <div class=\"search-location\">\n <div>\n <label id=\"input-selected-location-label\" *ngIf=\"locationTitle\">{{locationTitle}}</label>\n </div>\n\n <div class=\"search-location__input-container\">\n <exui-search-location class=\"search-location__input\"\n [locations]=\"locations\"\n [selectedLocations]=\"selectedLocations\"\n [singleMode]=\"field.maxSelected === 1\"\n [bookingCheck]=\"field.bookingCheckType\"\n [delay]=\"300\"\n [disabled]=\"disabled\"\n [serviceIds]=\"serviceIds\"\n (locationInputChanged)=\"onInputChanged($event)\"\n (locationSelected)=\"onLocationSelected($event)\"\n (searchLocationChanged)=\"onSearchInputChanged()\"\n [locationType]=\"'case-management'\"></exui-search-location>\n <a href=\"javascript:void(0)\" (click)=\"addLocation()\"\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\" data-module=\"govuk-button\"\n *ngIf=\"enableAddLocationButton\">\n Add\n </a>\n </div>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"location-selection\" *ngFor=\"let selection of selectedLocations\">\n <a class=\"hmcts-filter__tag\" (click)=\"removeLocation(selection)\" href=\"javascript:void(0)\">\n {{ selection.site_name }}\n </a>\n </li>\n </ul>\n</div>\n",
3472
3623
  styles: [".search-location__input-container{display:flex}.search-location .auto-complete-container{min-width:unset;width:calc(100% - 4px)}.search-location__input{flex:1 0 auto}.search-location .govuk-button--secondary{background-color:#ddd}"]
3473
3624
  }] }
3474
3625
  ];
@@ -4123,36 +4274,140 @@ FindPersonComponent.propDecorators = {
4123
4274
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4124
4275
  */
4125
4276
  class FindServiceComponent {
4277
+ constructor() {
4278
+ this.services = [];
4279
+ this.selectedServices = [];
4280
+ this.enableAddServiceButton = true;
4281
+ this.disabled = false;
4282
+ this.serviceFieldChanged = new EventEmitter();
4283
+ this.tempSelectedService = null;
4284
+ }
4126
4285
  /**
4127
- * @param {?} fb
4286
+ * @return {?}
4128
4287
  */
4129
- constructor(fb) {
4130
- this.fb = fb;
4131
- this.serviceTitle = 'Search for a service by name';
4132
- this.enableAddServiceButton = true;
4133
- this.disableInputField = false;
4134
- this.form = this.fb.group({
4135
- searchTerm: ['']
4136
- });
4288
+ ngOnInit() {
4289
+ this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter((/**
4290
+ * @param {?} service
4291
+ * @return {?}
4292
+ */
4293
+ (service) => service.key)) : [];
4294
+ this.SortAnOptions();
4137
4295
  }
4138
4296
  /**
4139
4297
  * @return {?}
4140
4298
  */
4141
4299
  addService() {
4142
- // Todo
4300
+ if (this.tempSelectedService === null) {
4301
+ return;
4302
+ }
4303
+ this.selectedServices = [...this.selectedServices, this.tempSelectedService];
4304
+ this.addSelectedServicesToForm([this.tempSelectedService]);
4305
+ this.services = this.services.filter((/**
4306
+ * @param {?} s
4307
+ * @return {?}
4308
+ */
4309
+ s => s.key !== this.tempSelectedService.key));
4310
+ this.tempSelectedService = null;
4311
+ this.serviceFieldChanged.emit();
4312
+ }
4313
+ /**
4314
+ * @param {?} service
4315
+ * @return {?}
4316
+ */
4317
+ removeService(service) {
4318
+ if (service.key) {
4319
+ this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter((/**
4320
+ * @param {?} selectedService
4321
+ * @return {?}
4322
+ */
4323
+ (selectedService) => selectedService.key !== service.key)) : [];
4324
+ /** @type {?} */
4325
+ const formArray = (/** @type {?} */ (this.form.get(this.field.name)));
4326
+ /** @type {?} */
4327
+ const index = (formArray.value).findIndex((/**
4328
+ * @param {?} selectedService
4329
+ * @return {?}
4330
+ */
4331
+ (selectedService) => selectedService.key === service.key));
4332
+ if (index > -1) {
4333
+ formArray.removeAt(index);
4334
+ this.services.splice(index, 0, service);
4335
+ this.SortAnOptions();
4336
+ }
4337
+ this.serviceFieldChanged.emit();
4338
+ }
4339
+ }
4340
+ /**
4341
+ * @param {?} service
4342
+ * @return {?}
4343
+ */
4344
+ onServiceSelected(service) {
4345
+ if (!service) {
4346
+ this.tempSelectedService = null;
4347
+ return;
4348
+ }
4349
+ if (this.field.maxSelected === 1) {
4350
+ this.removeSelectedValues();
4351
+ this.addSelectedServicesToForm([service]);
4352
+ }
4353
+ else {
4354
+ if (!this.selectedServices.find((/**
4355
+ * @param {?} s
4356
+ * @return {?}
4357
+ */
4358
+ s => s.key === service.key))) {
4359
+ if (service.key) {
4360
+ this.tempSelectedService = service;
4361
+ }
4362
+ }
4363
+ }
4364
+ }
4365
+ /**
4366
+ * @private
4367
+ * @return {?}
4368
+ */
4369
+ removeSelectedValues() {
4370
+ /** @type {?} */
4371
+ const formArray = (/** @type {?} */ (this.form.get(this.field.name)));
4372
+ for (let i = 0; i < formArray.length; i++) {
4373
+ formArray.removeAt(i);
4374
+ }
4375
+ this.selectedServices = [];
4376
+ }
4377
+ /**
4378
+ * @private
4379
+ * @param {?} services
4380
+ * @return {?}
4381
+ */
4382
+ addSelectedServicesToForm(services) {
4383
+ /** @type {?} */
4384
+ const formArray = (/** @type {?} */ (this.form.get(this.field.name)));
4385
+ for (const service of services) {
4386
+ formArray.push(new FormControl(service));
4387
+ }
4388
+ }
4389
+ /**
4390
+ * @private
4391
+ * @return {?}
4392
+ */
4393
+ SortAnOptions() {
4394
+ return this.services.sort((/**
4395
+ * @param {?} a
4396
+ * @param {?} b
4397
+ * @return {?}
4398
+ */
4399
+ (a, b) => {
4400
+ return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
4401
+ }));
4143
4402
  }
4144
4403
  }
4145
4404
  FindServiceComponent.decorators = [
4146
4405
  { type: Component, args: [{
4147
4406
  selector: 'xuilib-find-service',
4148
- template: "<div class=\"service-picker-custom\">\n <div class=\"search-service\">\n <div class=\"govuk-body\">\n <label id=\"input-selected-service-label\" *ngIf=\"serviceTitle\">{{serviceTitle}}</label>\n </div>\n <div class=\"search-service__input-container\">\n <exui-search-service class=\"search-service__input\"\n [services]=\"services\"\n [selectedServices]=\"selectedServices\"\n [delay]=\"300\"\n [disabled]=\"disabled\"></exui-search-service>\n <a href=\"javascript:void(0)\" (click)=\"addService()\" class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\"\n data-module=\"govuk-button\" *ngIf=\"enableAddServiceButton\" id=\"add-service\">\n Add\n </a>\n </div>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"service-selection\" *ngFor=\"let selection of selectedServices\">\n <a class=\"hmcts-filter__tag\" href=\"javascript:void(0)\">\n {{ selection.name }}\n </a>\n </li>\n </ul>\n</div>\n",
4407
+ template: "<div class=\"service-picker-custom\">\n <div class=\"search-service\">\n <div class=\"govuk-body\">\n <label id=\"selectServiceSearch-label\" for=\"serviceSearch__select\" *ngIf=\"serviceTitle\">\n {{ serviceTitle}}\n </label>\n </div>\n <div class=\"search-service__input-container\">\n <exui-search-service class=\"search-service__input\" [services]=\"services\"\n (serviceChanged)=\"onServiceSelected($event)\">\n </exui-search-service>\n <a href=\"javascript:void(0)\" (click)=\"addService()\"\n class=\"govuk-button govuk-button--secondary govuk-!-margin-bottom-0\" data-module=\"govuk-button\"\n *ngIf=\"enableAddServiceButton\" id=\"add-service\">\n Add\n </a>\n </div>\n </div>\n <ul class=\"hmcts-filter-tags selection-container\" *ngIf=\"field.maxSelected != 1\">\n <li class=\"location-selection\" *ngFor=\"let selection of selectedServices\">\n <a class=\"hmcts-filter__tag\" (click)=\"removeService(selection)\" href=\"javascript:void(0)\">\n {{ selection.label }}\n </a>\n </li>\n </ul>\n</div>",
4149
4408
  styles: ["#add-service{background-color:#ddd}.search-service__input-container{display:flex}.search-service__input{flex:1 0 auto}"]
4150
4409
  }] }
4151
4410
  ];
4152
- /** @nocollapse */
4153
- FindServiceComponent.ctorParameters = () => [
4154
- { type: FormBuilder }
4155
- ];
4156
4411
  FindServiceComponent.propDecorators = {
4157
4412
  field: [{ type: Input }],
4158
4413
  fields: [{ type: Input }],
@@ -4160,9 +4415,9 @@ FindServiceComponent.propDecorators = {
4160
4415
  form: [{ type: Input }],
4161
4416
  services: [{ type: Input }],
4162
4417
  selectedServices: [{ type: Input }],
4163
- disabled: [{ type: Input }],
4164
4418
  enableAddServiceButton: [{ type: Input }],
4165
- disableInputField: [{ type: Input }]
4419
+ disabled: [{ type: Input }],
4420
+ serviceFieldChanged: [{ type: Output }]
4166
4421
  };
4167
4422
 
4168
4423
  /**
@@ -4372,37 +4627,33 @@ SearchJudicialsComponent.propDecorators = {
4372
4627
  */
4373
4628
  class SearchServiceComponent {
4374
4629
  constructor() {
4375
- this.showAutocomplete = false;
4376
- this.minSearchCharacters = 3;
4377
- this.term = '';
4378
- }
4379
- /**
4380
- * @return {?}
4381
- */
4382
- onInput() {
4383
- // Todo
4630
+ this.services = [];
4631
+ this.serviceChanged = new EventEmitter();
4384
4632
  }
4385
4633
  /**
4634
+ * @param {?} key
4386
4635
  * @return {?}
4387
4636
  */
4388
- onSelectionChange() {
4389
- // Todo
4637
+ onSelectionChanged(key) {
4638
+ /** @type {?} */
4639
+ const selectedService = this.services.find((/**
4640
+ * @param {?} s
4641
+ * @return {?}
4642
+ */
4643
+ s => s.key === key));
4644
+ this.serviceChanged.emit(selectedService);
4390
4645
  }
4391
4646
  }
4392
4647
  SearchServiceComponent.decorators = [
4393
4648
  { type: Component, args: [{
4394
4649
  selector: 'exui-search-service',
4395
- template: "<div class=\"auto-complete-container\">\n <input\n id=\"inputServiceSearch\"\n (input)=\"onInput()\"\n [formControl]=\"form?.controls?.searchTerm\"\n [matAutocomplete]=\"autoSearchService\"\n class=\"govuk-input\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchService=\"matAutocomplete\">\n <mat-option *ngFor=\"let service of services\" (onSelectionChange)=\"onSelectionChange()\">\n {{ service.name }}\n </mat-option>\n <mat-option *ngIf=\"!services?.length && showAutocomplete && term && term.length >= this.minSearchCharacters\">No results found</mat-option>\n </mat-autocomplete>\n</div>\n",
4650
+ template: "<div class=\"govuk-form-group\">\n <select id=\"serviceSearch__select\" class=\"govuk-select\" name=\"serviceSearch__select\"\n (change)=\"onSelectionChanged($event.target.value)\">\n <option [value]=\"null\">All</option>\n <option *ngFor=\"let service of services\" [value]=\"service.key\">\n {{ service.label }}\n </option>\n </select>\n</div>",
4396
4651
  styles: [".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: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{width:calc(100% - 4px);display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
4397
4652
  }] }
4398
4653
  ];
4399
4654
  SearchServiceComponent.propDecorators = {
4400
4655
  services: [{ type: Input }],
4401
- selectedServices: [{ type: Input }],
4402
- disabled: [{ type: Input }],
4403
- delay: [{ type: Input }],
4404
- form: [{ type: Input }],
4405
- showAutocomplete: [{ type: Input }]
4656
+ serviceChanged: [{ type: Output }]
4406
4657
  };
4407
4658
 
4408
4659
  /**
@@ -5550,6 +5801,26 @@ RemoveHostDirective.ctorParameters = () => [
5550
5801
  { type: ElementRef }
5551
5802
  ];
5552
5803
 
5804
+ /**
5805
+ * @fileoverview added by tsickle
5806
+ * Generated from: lib/pipes/capitalize.pipe.ts
5807
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5808
+ */
5809
+ class CapitalizePipe {
5810
+ /**
5811
+ * @param {?} value
5812
+ * @return {?}
5813
+ */
5814
+ transform(value) {
5815
+ /** @type {?} */
5816
+ const lowerCaseString = value.toLowerCase();
5817
+ return lowerCaseString.charAt(0).toUpperCase() + lowerCaseString.slice(1);
5818
+ }
5819
+ }
5820
+ CapitalizePipe.decorators = [
5821
+ { type: Pipe, args: [{ name: 'capitalize' },] }
5822
+ ];
5823
+
5553
5824
  /**
5554
5825
  * @fileoverview added by tsickle
5555
5826
  * Generated from: lib/exui-common-lib.module.ts
@@ -5619,6 +5890,10 @@ const GOV_UI_COMPONENTS = [
5619
5890
  GovUkFileUploadComponent,
5620
5891
  RemoveHostDirective
5621
5892
  ];
5893
+ /** @type {?} */
5894
+ const pipes = [
5895
+ CapitalizePipe
5896
+ ];
5622
5897
  const ɵ0 = windowProvider;
5623
5898
  class ExuiCommonLibModule {
5624
5899
  }
@@ -5626,7 +5901,8 @@ ExuiCommonLibModule.decorators = [
5626
5901
  { type: NgModule, args: [{
5627
5902
  declarations: [
5628
5903
  ...COMMON_COMPONENTS,
5629
- ...GOV_UI_COMPONENTS
5904
+ ...GOV_UI_COMPONENTS,
5905
+ ...pipes
5630
5906
  ],
5631
5907
  imports: [
5632
5908
  CommonModule,
@@ -5644,7 +5920,8 @@ ExuiCommonLibModule.decorators = [
5644
5920
  exports: [
5645
5921
  ...COMMON_COMPONENTS,
5646
5922
  ...GOV_UI_COMPONENTS,
5647
- PaginatePipe
5923
+ PaginatePipe,
5924
+ ...pipes
5648
5925
  ]
5649
5926
  },] }
5650
5927
  ];
@@ -6526,6 +6803,6 @@ LoadingService.decorators = [
6526
6803
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6527
6804
  */
6528
6805
 
6529
- export { AccessibilityComponent, CheckboxListComponent, ContactDetailsComponent, DueDateComponent, GenericFilterComponent, HmctsSessionDialogComponent, InviteUserFormComponent, InviteUserPermissionComponent, LoadingSpinnerComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, SelectedCaseComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseConfirmComponent, ShareCaseComponent, TabComponent, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, UserDetailsComponent, UserListComponent, CookieBannerComponent, FindLocationComponent, SearchLocationComponent, PaginationComponent, FeatureToggleDirective, LetContext, LetDirective, COMMON_COMPONENTS, GOV_UI_COMPONENTS, ExuiCommonLibModule, GovUiService, checkboxesBeCheckedValidator, dateValidator, radioGroupValidator, HmctsSubNavigationComponent, BadgeColour, DateBadgeColour, SECONDS_IN_A_DAY, AnonymousFeatureUser, LoggedInFeatureUser, BookingCheckType, PersonRole, RoleCategory, RadioFilterFieldConfig, FeatureToggleGuard, FeatureToggleService, LaunchDarklyService, GoogleAnalyticsService, GoogleTagManagerService, ManageSessionServices, TimeoutNotificationsService, RoleMatching, RoleGuard, RoleService, CookieService, HasLoadingState, LoadingService, FilterService, windowProvider, windowToken, AccessibilityComponent as ɵx, CheckboxListComponent as ɵz, ContactDetailsComponent as ɵf, CookieBannerComponent as ɵbf, DueDateComponent as ɵy, ExuiPageWrapperComponent as ɵa, FindLocationComponent as ɵbl, FindPersonComponent as ɵbh, FindServiceComponent as ɵbo, GenericFilterComponent as ɵbd, HmctsSessionDialogComponent as ɵk, InviteUserFormComponent as ɵo, InviteUserPermissionComponent as ɵn, LoadingSpinnerComponent as ɵbc, PaginationComponent as ɵbr, SearchJudicialsComponent as ɵbk, SearchLocationComponent as ɵbm, SearchServiceComponent as ɵbp, SearchVenueComponent as ɵbq, SelectedCaseConfirmComponent as ɵv, SelectedCaseListComponent as ɵt, SelectedCaseComponent as ɵu, ServiceMessageComponent as ɵba, ServiceMessagesComponent as ɵbb, ShareCaseConfirmComponent as ɵs, ShareCaseComponent as ɵp, TabComponent as ɵw, TcConfirmComponent as ɵe, TcDisplayHtmlComponent as ɵc, TcDisplayPlainComponent as ɵd, TermsAndConditionsComponent as ɵb, UserDetailsComponent as ɵm, UserListComponent as ɵl, UserSelectComponent as ɵq, FeatureToggleDirective as ɵg, LetContext as ɵi, LetDirective as ɵj, GovUkCheckboxComponent as ɵcb, GovUkCheckboxesComponent as ɵch, GovUkDateComponent as ɵcg, GovUkErrorMessageComponent as ɵce, GovUkFieldsetComponent as ɵcf, GovUkFileUploadComponent as ɵcm, GovUkFormGroupWrapperComponent as ɵcc, GovUkInputComponent as ɵca, GovUkLabelComponent as ɵcd, GovUkRadioComponent as ɵci, GovUkRadiosComponent as ɵcj, GovUkSelectComponent as ɵck, GovukTableComponent as ɵbz, GovUkTextareaComponent as ɵcl, HmctsBannerComponent as ɵby, HmctsErrorSummaryComponent as ɵbw, HmctsIdentityBarComponent as ɵbs, HmctsMainWrapperComponent as ɵbx, HmctsPaginationComponent as ɵbt, HmctsPrimaryNavigationComponent as ɵbv, HmctsSubNavigationComponent as ɵbu, RemoveHostDirective as ɵcn, CaseSharingStateService as ɵr, CookieService as ɵbg, FeatureToggleService as ɵh, FilterService as ɵbe, FindAPersonService as ɵbi, LocationService as ɵbn, SessionStorageService as ɵbj };
6806
+ export { AccessibilityComponent, CheckboxListComponent, ContactDetailsComponent, DueDateComponent, GenericFilterComponent, HmctsSessionDialogComponent, InviteUserFormComponent, InviteUserPermissionComponent, LoadingSpinnerComponent, SelectedCaseConfirmComponent, SelectedCaseListComponent, SelectedCaseComponent, ServiceMessageComponent, ServiceMessagesComponent, ShareCaseConfirmComponent, ShareCaseComponent, TabComponent, TcConfirmComponent, TcDisplayHtmlComponent, TcDisplayPlainComponent, TermsAndConditionsComponent, UserDetailsComponent, UserListComponent, CookieBannerComponent, FindLocationComponent, SearchLocationComponent, PaginationComponent, FeatureToggleDirective, LetContext, LetDirective, COMMON_COMPONENTS, GOV_UI_COMPONENTS, ExuiCommonLibModule, GovUiService, checkboxesBeCheckedValidator, dateValidator, radioGroupValidator, HmctsSubNavigationComponent, BadgeColour, DateBadgeColour, SECONDS_IN_A_DAY, AnonymousFeatureUser, LoggedInFeatureUser, BookingCheckType, PersonRole, RoleCategory, RadioFilterFieldConfig, FeatureToggleGuard, FeatureToggleService, LaunchDarklyService, GoogleAnalyticsService, GoogleTagManagerService, ManageSessionServices, TimeoutNotificationsService, RoleMatching, RoleGuard, RoleService, CookieService, HasLoadingState, LoadingService, FilterService, windowProvider, windowToken, AccessibilityComponent as ɵx, CheckboxListComponent as ɵz, ContactDetailsComponent as ɵf, CookieBannerComponent as ɵbf, DueDateComponent as ɵy, ExuiPageWrapperComponent as ɵa, FindLocationComponent as ɵbl, FindPersonComponent as ɵbh, FindServiceComponent as ɵbo, GenericFilterComponent as ɵbd, HmctsSessionDialogComponent as ɵk, InviteUserFormComponent as ɵo, InviteUserPermissionComponent as ɵn, LoadingSpinnerComponent as ɵbc, PaginationComponent as ɵbr, SearchJudicialsComponent as ɵbk, SearchLocationComponent as ɵbm, SearchServiceComponent as ɵbp, SearchVenueComponent as ɵbq, SelectedCaseConfirmComponent as ɵv, SelectedCaseListComponent as ɵt, SelectedCaseComponent as ɵu, ServiceMessageComponent as ɵba, ServiceMessagesComponent as ɵbb, ShareCaseConfirmComponent as ɵs, ShareCaseComponent as ɵp, TabComponent as ɵw, TcConfirmComponent as ɵe, TcDisplayHtmlComponent as ɵc, TcDisplayPlainComponent as ɵd, TermsAndConditionsComponent as ɵb, UserDetailsComponent as ɵm, UserListComponent as ɵl, UserSelectComponent as ɵq, FeatureToggleDirective as ɵg, LetContext as ɵi, LetDirective as ɵj, GovUkCheckboxComponent as ɵcb, GovUkCheckboxesComponent as ɵch, GovUkDateComponent as ɵcg, GovUkErrorMessageComponent as ɵce, GovUkFieldsetComponent as ɵcf, GovUkFileUploadComponent as ɵcm, GovUkFormGroupWrapperComponent as ɵcc, GovUkInputComponent as ɵca, GovUkLabelComponent as ɵcd, GovUkRadioComponent as ɵci, GovUkRadiosComponent as ɵcj, GovUkSelectComponent as ɵck, GovukTableComponent as ɵbz, GovUkTextareaComponent as ɵcl, HmctsBannerComponent as ɵby, HmctsErrorSummaryComponent as ɵbw, HmctsIdentityBarComponent as ɵbs, HmctsMainWrapperComponent as ɵbx, HmctsPaginationComponent as ɵbt, HmctsPrimaryNavigationComponent as ɵbv, HmctsSubNavigationComponent as ɵbu, RemoveHostDirective as ɵcn, CapitalizePipe as ɵco, CaseSharingStateService as ɵr, CookieService as ɵbg, FeatureToggleService as ɵh, FilterService as ɵbe, FindAPersonService as ɵbi, LocationService as ɵbn, SessionStorageService as ɵbj };
6530
6807
 
6531
6808
  //# sourceMappingURL=hmcts-rpx-xui-common-lib.js.map