@hmcts/rpx-xui-common-lib 1.7.45 → 1.7.47-callback-apply-filter-v1

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 +387 -57
  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 +155 -13
  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 +59 -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 +171 -12
  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 +59 -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 +336 -56
  32. package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
  33. package/fesm5/hmcts-rpx-xui-common-lib.js +400 -57
  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 +26 -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 {?}
@@ -807,6 +822,9 @@ class GenericFilterComponent {
807
822
  else {
808
823
  this.emitFormErrors(form);
809
824
  }
825
+ if (this._config.applyButtonCallback) {
826
+ this._config.applyButtonCallback();
827
+ }
810
828
  }
811
829
  // when domain changes ensure that person field is reset
812
830
  /**
@@ -828,6 +846,11 @@ class GenericFilterComponent {
828
846
  * @return {?}
829
847
  */
830
848
  inputChanged(field) {
849
+ if (field.name === 'user-services') {
850
+ /** @type {?} */
851
+ const selectedServices = this.getSelectedValuesForFields(this.form.controls, field);
852
+ this.filterSkillsByServices(selectedServices, this.config);
853
+ }
831
854
  if (field.radioSelectionChange && typeof field.radioSelectionChange === 'string') {
832
855
  const [name, value] = field.enableCondition.split('=');
833
856
  this.form.get(name).patchValue(value);
@@ -846,6 +869,9 @@ class GenericFilterComponent {
846
869
  this.filterService.persist(settings, this.config.persistence);
847
870
  this.filterService.givenErrors.next(null);
848
871
  this.submitted = false;
872
+ if (this.config.cancelButtonCallback) {
873
+ this.config.cancelButtonCallback();
874
+ }
849
875
  }
850
876
  /**
851
877
  * @param {?} values
@@ -1030,9 +1056,9 @@ class GenericFilterComponent {
1030
1056
  const formArray = this.buildCheckBoxFormArray(field, settings);
1031
1057
  this.form.addControl(field.name, formArray);
1032
1058
  }
1033
- else if (field.type === 'find-location') {
1059
+ else if (field.type === 'find-location' || field.type === 'find-service') {
1034
1060
  /** @type {?} */
1035
- const formArray = this.buildFindLocationFormArray(field, settings);
1061
+ const formArray = this.buildFormArray(field, settings);
1036
1062
  this.form.addControl(field.name, formArray);
1037
1063
  }
1038
1064
  else {
@@ -1043,6 +1069,9 @@ class GenericFilterComponent {
1043
1069
  if (field.type === 'text-input') {
1044
1070
  validators.push(Validators.minLength(field.minSelected));
1045
1071
  }
1072
+ if (field.type === 'email-input') {
1073
+ validators.push(Validators.email);
1074
+ }
1046
1075
  }
1047
1076
  /** @type {?} */
1048
1077
  let defaultValue = null;
@@ -1076,7 +1105,7 @@ class GenericFilterComponent {
1076
1105
  });
1077
1106
  this.form.addControl(field.name, formGroup);
1078
1107
  }
1079
- else {
1108
+ else if (field.type !== 'group-title') {
1080
1109
  /** @type {?} */
1081
1110
  const control = new FormControl(defaultValue, validators);
1082
1111
  this.form.addControl(field.name, control);
@@ -1128,7 +1157,7 @@ class GenericFilterComponent {
1128
1157
  * @param {?} settings
1129
1158
  * @return {?}
1130
1159
  */
1131
- buildFindLocationFormArray(field, settings) {
1160
+ buildFormArray(field, settings) {
1132
1161
  /** @type {?} */
1133
1162
  const validators = GenericFilterComponent.addFormValidators(field);
1134
1163
  /** @type {?} */
@@ -1189,29 +1218,154 @@ class GenericFilterComponent {
1189
1218
  */
1190
1219
  emitFormErrors(form) {
1191
1220
  /** @type {?} */
1192
- const errors = [];
1221
+ let errors = [];
1193
1222
  for (const field of this.config.fields) {
1194
1223
  /** @type {?} */
1195
1224
  const formGroup = form.get(field.name);
1196
- if (formGroup && formGroup.errors && formGroup.errors.minlength) {
1225
+ if (formGroup && formGroup.errors && (formGroup.errors.minlength || formGroup.errors.required)) {
1197
1226
  errors.push({ name: field.name, error: field.minSelectedError });
1198
1227
  }
1199
- if (formGroup && formGroup.errors && formGroup.errors.maxLength) {
1200
- errors.push({ name: field.name, error: field.minSelectedError });
1228
+ if (formGroup && formGroup.errors && formGroup.errors.maxlength) {
1229
+ errors.push({ name: field.name, error: field.maxSelectedError });
1201
1230
  }
1202
1231
  }
1232
+ // remove duplicates
1233
+ errors = errors.filter((/**
1234
+ * @param {?} filterError
1235
+ * @param {?} i
1236
+ * @param {?} arr
1237
+ * @return {?}
1238
+ */
1239
+ (filterError, i, arr) => {
1240
+ return errors.indexOf(arr.find((/**
1241
+ * @param {?} item
1242
+ * @return {?}
1243
+ */
1244
+ item => item.name === filterError.name))) === i;
1245
+ }));
1203
1246
  if (errors.length) {
1204
1247
  this.filterService.givenErrors.next(errors);
1205
1248
  }
1206
1249
  }
1250
+ /**
1251
+ * @param {?} services
1252
+ * @param {?} config
1253
+ * @return {?}
1254
+ */
1255
+ filterSkillsByServices(services, config) {
1256
+ this.filteredSkillsByServices = [];
1257
+ /** @type {?} */
1258
+ const userSkillsField = config.fields.find((/**
1259
+ * @param {?} f
1260
+ * @return {?}
1261
+ */
1262
+ f => f.name === 'user-skills'));
1263
+ if (userSkillsField) {
1264
+ /** @type {?} */
1265
+ const userSkills = userSkillsField.groupOptions;
1266
+ if (!services || services.length === 0) {
1267
+ this.filteredSkillsByServices = userSkills;
1268
+ }
1269
+ else {
1270
+ services.forEach((/**
1271
+ * @param {?} s
1272
+ * @return {?}
1273
+ */
1274
+ s => {
1275
+ /** @type {?} */
1276
+ const groupOption = userSkills.find((/**
1277
+ * @param {?} u
1278
+ * @return {?}
1279
+ */
1280
+ u => u.group === s));
1281
+ if (groupOption) {
1282
+ this.filteredSkillsByServices.push(groupOption);
1283
+ }
1284
+ }));
1285
+ }
1286
+ }
1287
+ this.filteredSkillsByServices = this.sortGroupOptions(this.filteredSkillsByServices);
1288
+ return this.filteredSkillsByServices;
1289
+ }
1290
+ /**
1291
+ * @private
1292
+ * @param {?} formValues
1293
+ * @param {?} field
1294
+ * @return {?}
1295
+ */
1296
+ getSelectedValuesForFields(formValues, field) {
1297
+ /** @type {?} */
1298
+ const selectedValues = [];
1299
+ Object.keys(formValues).map((/**
1300
+ * @param {?} name
1301
+ * @return {?}
1302
+ */
1303
+ (name) => {
1304
+ /** @type {?} */
1305
+ const values = formValues[name].value;
1306
+ if (name === field.name) {
1307
+ values.forEach((/**
1308
+ * @param {?} v
1309
+ * @return {?}
1310
+ */
1311
+ (v) => {
1312
+ selectedValues.push(v.key);
1313
+ }));
1314
+ }
1315
+ }));
1316
+ return selectedValues;
1317
+ }
1318
+ /**
1319
+ * @private
1320
+ * @param {?} groupOptions
1321
+ * @return {?}
1322
+ */
1323
+ sortGroupOptions(groupOptions) {
1324
+ /** @type {?} */
1325
+ const sortedResults = [];
1326
+ /** @type {?} */
1327
+ const groups = groupOptions.map((/**
1328
+ * @param {?} go
1329
+ * @return {?}
1330
+ */
1331
+ go => go.group));
1332
+ groups.sort().forEach((/**
1333
+ * @param {?} g
1334
+ * @return {?}
1335
+ */
1336
+ g => {
1337
+ /** @type {?} */
1338
+ const options = groupOptions.find((/**
1339
+ * @param {?} go
1340
+ * @return {?}
1341
+ */
1342
+ (go) => go.group === g)).options;
1343
+ /** @type {?} */
1344
+ const sortedOptions = options.sort((/**
1345
+ * @param {?} a
1346
+ * @param {?} b
1347
+ * @return {?}
1348
+ */
1349
+ (a, b) => {
1350
+ return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
1351
+ }));
1352
+ /** @type {?} */
1353
+ const result = {
1354
+ group: g,
1355
+ options: sortedOptions
1356
+ };
1357
+ sortedResults.push(result);
1358
+ }));
1359
+ return sortedResults;
1360
+ }
1207
1361
  }
1208
1362
  GenericFilterComponent.decorators = [
1209
1363
  { type: Component, args: [{
1210
1364
  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",
1365
+ 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 [attr.maxlength]=\"field.maxlength ? field.maxlength : null\"\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
1366
  changeDetection: ChangeDetectionStrategy.OnPush,
1213
1367
  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%}"]
1368
+ 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
1369
  }] }
1216
1370
  ];
1217
1371
  /** @nocollapse */
@@ -3014,7 +3168,7 @@ LocationService.ctorParameters = () => [
3014
3168
 
3015
3169
  /**
3016
3170
  * @fileoverview added by tsickle
3017
- * Generated from: lib/services/session-storage/session-storage.service.ts
3171
+ * Generated from: lib/services/storage/session-storage/session-storage.service.ts
3018
3172
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3019
3173
  */
3020
3174
  class SessionStorageService {
@@ -3468,7 +3622,7 @@ class FindLocationComponent {
3468
3622
  FindLocationComponent.decorators = [
3469
3623
  { type: Component, args: [{
3470
3624
  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",
3625
+ 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
3626
  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
3627
  }] }
3474
3628
  ];
@@ -4123,36 +4277,140 @@ FindPersonComponent.propDecorators = {
4123
4277
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4124
4278
  */
4125
4279
  class FindServiceComponent {
4280
+ constructor() {
4281
+ this.services = [];
4282
+ this.selectedServices = [];
4283
+ this.enableAddServiceButton = true;
4284
+ this.disabled = false;
4285
+ this.serviceFieldChanged = new EventEmitter();
4286
+ this.tempSelectedService = null;
4287
+ }
4126
4288
  /**
4127
- * @param {?} fb
4289
+ * @return {?}
4128
4290
  */
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
- });
4291
+ ngOnInit() {
4292
+ this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter((/**
4293
+ * @param {?} service
4294
+ * @return {?}
4295
+ */
4296
+ (service) => service.key)) : [];
4297
+ this.SortAnOptions();
4137
4298
  }
4138
4299
  /**
4139
4300
  * @return {?}
4140
4301
  */
4141
4302
  addService() {
4142
- // Todo
4303
+ if (this.tempSelectedService === null) {
4304
+ return;
4305
+ }
4306
+ this.selectedServices = [...this.selectedServices, this.tempSelectedService];
4307
+ this.addSelectedServicesToForm([this.tempSelectedService]);
4308
+ this.services = this.services.filter((/**
4309
+ * @param {?} s
4310
+ * @return {?}
4311
+ */
4312
+ s => s.key !== this.tempSelectedService.key));
4313
+ this.tempSelectedService = null;
4314
+ this.serviceFieldChanged.emit();
4315
+ }
4316
+ /**
4317
+ * @param {?} service
4318
+ * @return {?}
4319
+ */
4320
+ removeService(service) {
4321
+ if (service.key) {
4322
+ this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter((/**
4323
+ * @param {?} selectedService
4324
+ * @return {?}
4325
+ */
4326
+ (selectedService) => selectedService.key !== service.key)) : [];
4327
+ /** @type {?} */
4328
+ const formArray = (/** @type {?} */ (this.form.get(this.field.name)));
4329
+ /** @type {?} */
4330
+ const index = (formArray.value).findIndex((/**
4331
+ * @param {?} selectedService
4332
+ * @return {?}
4333
+ */
4334
+ (selectedService) => selectedService.key === service.key));
4335
+ if (index > -1) {
4336
+ formArray.removeAt(index);
4337
+ this.services.splice(index, 0, service);
4338
+ this.SortAnOptions();
4339
+ }
4340
+ this.serviceFieldChanged.emit();
4341
+ }
4342
+ }
4343
+ /**
4344
+ * @param {?} service
4345
+ * @return {?}
4346
+ */
4347
+ onServiceSelected(service) {
4348
+ if (!service) {
4349
+ this.tempSelectedService = null;
4350
+ return;
4351
+ }
4352
+ if (this.field.maxSelected === 1) {
4353
+ this.removeSelectedValues();
4354
+ this.addSelectedServicesToForm([service]);
4355
+ }
4356
+ else {
4357
+ if (!this.selectedServices.find((/**
4358
+ * @param {?} s
4359
+ * @return {?}
4360
+ */
4361
+ s => s.key === service.key))) {
4362
+ if (service.key) {
4363
+ this.tempSelectedService = service;
4364
+ }
4365
+ }
4366
+ }
4367
+ }
4368
+ /**
4369
+ * @private
4370
+ * @return {?}
4371
+ */
4372
+ removeSelectedValues() {
4373
+ /** @type {?} */
4374
+ const formArray = (/** @type {?} */ (this.form.get(this.field.name)));
4375
+ for (let i = 0; i < formArray.length; i++) {
4376
+ formArray.removeAt(i);
4377
+ }
4378
+ this.selectedServices = [];
4379
+ }
4380
+ /**
4381
+ * @private
4382
+ * @param {?} services
4383
+ * @return {?}
4384
+ */
4385
+ addSelectedServicesToForm(services) {
4386
+ /** @type {?} */
4387
+ const formArray = (/** @type {?} */ (this.form.get(this.field.name)));
4388
+ for (const service of services) {
4389
+ formArray.push(new FormControl(service));
4390
+ }
4391
+ }
4392
+ /**
4393
+ * @private
4394
+ * @return {?}
4395
+ */
4396
+ SortAnOptions() {
4397
+ return this.services.sort((/**
4398
+ * @param {?} a
4399
+ * @param {?} b
4400
+ * @return {?}
4401
+ */
4402
+ (a, b) => {
4403
+ return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
4404
+ }));
4143
4405
  }
4144
4406
  }
4145
4407
  FindServiceComponent.decorators = [
4146
4408
  { type: Component, args: [{
4147
4409
  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",
4410
+ 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
4411
  styles: ["#add-service{background-color:#ddd}.search-service__input-container{display:flex}.search-service__input{flex:1 0 auto}"]
4150
4412
  }] }
4151
4413
  ];
4152
- /** @nocollapse */
4153
- FindServiceComponent.ctorParameters = () => [
4154
- { type: FormBuilder }
4155
- ];
4156
4414
  FindServiceComponent.propDecorators = {
4157
4415
  field: [{ type: Input }],
4158
4416
  fields: [{ type: Input }],
@@ -4160,9 +4418,9 @@ FindServiceComponent.propDecorators = {
4160
4418
  form: [{ type: Input }],
4161
4419
  services: [{ type: Input }],
4162
4420
  selectedServices: [{ type: Input }],
4163
- disabled: [{ type: Input }],
4164
4421
  enableAddServiceButton: [{ type: Input }],
4165
- disableInputField: [{ type: Input }]
4422
+ disabled: [{ type: Input }],
4423
+ serviceFieldChanged: [{ type: Output }]
4166
4424
  };
4167
4425
 
4168
4426
  /**
@@ -4372,37 +4630,33 @@ SearchJudicialsComponent.propDecorators = {
4372
4630
  */
4373
4631
  class SearchServiceComponent {
4374
4632
  constructor() {
4375
- this.showAutocomplete = false;
4376
- this.minSearchCharacters = 3;
4377
- this.term = '';
4378
- }
4379
- /**
4380
- * @return {?}
4381
- */
4382
- onInput() {
4383
- // Todo
4633
+ this.services = [];
4634
+ this.serviceChanged = new EventEmitter();
4384
4635
  }
4385
4636
  /**
4637
+ * @param {?} key
4386
4638
  * @return {?}
4387
4639
  */
4388
- onSelectionChange() {
4389
- // Todo
4640
+ onSelectionChanged(key) {
4641
+ /** @type {?} */
4642
+ const selectedService = this.services.find((/**
4643
+ * @param {?} s
4644
+ * @return {?}
4645
+ */
4646
+ s => s.key === key));
4647
+ this.serviceChanged.emit(selectedService);
4390
4648
  }
4391
4649
  }
4392
4650
  SearchServiceComponent.decorators = [
4393
4651
  { type: Component, args: [{
4394
4652
  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",
4653
+ 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
4654
  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
4655
  }] }
4398
4656
  ];
4399
4657
  SearchServiceComponent.propDecorators = {
4400
4658
  services: [{ type: Input }],
4401
- selectedServices: [{ type: Input }],
4402
- disabled: [{ type: Input }],
4403
- delay: [{ type: Input }],
4404
- form: [{ type: Input }],
4405
- showAutocomplete: [{ type: Input }]
4659
+ serviceChanged: [{ type: Output }]
4406
4660
  };
4407
4661
 
4408
4662
  /**
@@ -5550,6 +5804,26 @@ RemoveHostDirective.ctorParameters = () => [
5550
5804
  { type: ElementRef }
5551
5805
  ];
5552
5806
 
5807
+ /**
5808
+ * @fileoverview added by tsickle
5809
+ * Generated from: lib/pipes/capitalize.pipe.ts
5810
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5811
+ */
5812
+ class CapitalizePipe {
5813
+ /**
5814
+ * @param {?} value
5815
+ * @return {?}
5816
+ */
5817
+ transform(value) {
5818
+ /** @type {?} */
5819
+ const lowerCaseString = value.toLowerCase();
5820
+ return lowerCaseString.charAt(0).toUpperCase() + lowerCaseString.slice(1);
5821
+ }
5822
+ }
5823
+ CapitalizePipe.decorators = [
5824
+ { type: Pipe, args: [{ name: 'capitalize' },] }
5825
+ ];
5826
+
5553
5827
  /**
5554
5828
  * @fileoverview added by tsickle
5555
5829
  * Generated from: lib/exui-common-lib.module.ts
@@ -5619,6 +5893,10 @@ const GOV_UI_COMPONENTS = [
5619
5893
  GovUkFileUploadComponent,
5620
5894
  RemoveHostDirective
5621
5895
  ];
5896
+ /** @type {?} */
5897
+ const pipes = [
5898
+ CapitalizePipe
5899
+ ];
5622
5900
  const ɵ0 = windowProvider;
5623
5901
  class ExuiCommonLibModule {
5624
5902
  }
@@ -5626,7 +5904,8 @@ ExuiCommonLibModule.decorators = [
5626
5904
  { type: NgModule, args: [{
5627
5905
  declarations: [
5628
5906
  ...COMMON_COMPONENTS,
5629
- ...GOV_UI_COMPONENTS
5907
+ ...GOV_UI_COMPONENTS,
5908
+ ...pipes
5630
5909
  ],
5631
5910
  imports: [
5632
5911
  CommonModule,
@@ -5644,7 +5923,8 @@ ExuiCommonLibModule.decorators = [
5644
5923
  exports: [
5645
5924
  ...COMMON_COMPONENTS,
5646
5925
  ...GOV_UI_COMPONENTS,
5647
- PaginatePipe
5926
+ PaginatePipe,
5927
+ ...pipes
5648
5928
  ]
5649
5929
  },] }
5650
5930
  ];
@@ -6526,6 +6806,6 @@ LoadingService.decorators = [
6526
6806
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6527
6807
  */
6528
6808
 
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 };
6809
+ 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
6810
 
6531
6811
  //# sourceMappingURL=hmcts-rpx-xui-common-lib.js.map