@hmcts/rpx-xui-common-lib 1.7.47-find-service-component → 1.7.47-text-input-capitalize-error

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 (47) hide show
  1. package/bundles/hmcts-rpx-xui-common-lib.umd.js +85 -218
  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-service/find-service.component.js +27 -140
  7. package/esm2015/lib/components/generic-filter/generic-filter-utils.js +1 -1
  8. package/esm2015/lib/components/generic-filter/generic-filter.component.js +7 -17
  9. package/esm2015/lib/components/search-location/search-location.component.js +2 -2
  10. package/esm2015/lib/components/search-service/search-service.component.js +33 -16
  11. package/esm2015/lib/exui-common-lib.module.js +10 -3
  12. package/esm2015/lib/models/filter.model.js +15 -13
  13. package/esm2015/lib/pipes/capitalize.pipe.js +21 -0
  14. package/esm2015/lib/services/filter/filter.service.js +8 -14
  15. package/esm2015/lib/services/find-person/find-person.service.js +3 -3
  16. package/esm2015/lib/services/storage/session-storage/session-storage.service.js +55 -0
  17. package/esm5/hmcts-rpx-xui-common-lib.js +3 -2
  18. package/esm5/lib/components/find-service/find-service.component.js +25 -182
  19. package/esm5/lib/components/generic-filter/generic-filter-utils.js +1 -1
  20. package/esm5/lib/components/generic-filter/generic-filter.component.js +7 -20
  21. package/esm5/lib/components/search-location/search-location.component.js +2 -2
  22. package/esm5/lib/components/search-service/search-service.component.js +37 -18
  23. package/esm5/lib/exui-common-lib.module.js +8 -3
  24. package/esm5/lib/models/filter.model.js +15 -13
  25. package/esm5/lib/pipes/capitalize.pipe.js +29 -0
  26. package/esm5/lib/services/filter/filter.service.js +8 -14
  27. package/esm5/lib/services/find-person/find-person.service.js +3 -3
  28. package/esm5/lib/services/{session-storage → storage/session-storage}/session-storage.service.js +2 -2
  29. package/fesm2015/hmcts-rpx-xui-common-lib.js +77 -175
  30. package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
  31. package/fesm5/hmcts-rpx-xui-common-lib.js +84 -221
  32. package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
  33. package/hmcts-rpx-xui-common-lib.d.ts +2 -1
  34. package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
  35. package/lib/components/find-service/find-service.component.d.ts +9 -17
  36. package/lib/components/generic-filter/generic-filter-utils.d.ts +5 -2
  37. package/lib/components/generic-filter/generic-filter.component.d.ts +2 -4
  38. package/lib/components/search-location/search-location.component.d.ts +1 -1
  39. package/lib/components/search-service/search-service.component.d.ts +11 -5
  40. package/lib/exui-common-lib.module.d.ts +2 -1
  41. package/lib/models/filter.model.d.ts +7 -6
  42. package/lib/pipes/capitalize.pipe.d.ts +4 -0
  43. package/lib/services/filter/filter.service.d.ts +1 -1
  44. package/lib/services/find-person/find-person.service.d.ts +1 -1
  45. package/lib/services/{session-storage → storage/session-storage}/session-storage.service.d.ts +0 -0
  46. package/package.json +1 -1
  47. package/esm2015/lib/services/session-storage/session-storage.service.js +0 -55
@@ -1758,10 +1758,10 @@
1758
1758
  return this.filterSettings[id];
1759
1759
  }
1760
1760
  if (sessionStorage.getItem(id)) {
1761
- return JSON.parse(window.sessionStorage.getItem(id));
1761
+ return JSON.parse(sessionStorage.getItem(id));
1762
1762
  }
1763
1763
  if (localStorage.getItem(id)) {
1764
- return JSON.parse(window.localStorage.getItem(id));
1764
+ return JSON.parse(localStorage.getItem(id));
1765
1765
  }
1766
1766
  return null;
1767
1767
  };
@@ -1783,19 +1783,13 @@
1783
1783
  * @param {?} id
1784
1784
  * @return {?}
1785
1785
  */
1786
- FilterService.prototype.clearStream = /**
1786
+ FilterService.prototype.clearSessionAndLocalPersistance = /**
1787
1787
  * @param {?} id
1788
1788
  * @return {?}
1789
1789
  */
1790
1790
  function (id) {
1791
- if (window.sessionStorage.getItem(id)) {
1792
- window.sessionStorage.removeItem(id);
1793
- }
1794
- if (window.localStorage.getItem(id)) {
1795
- window.localStorage.removeItem(id);
1796
- }
1797
- this.givenErrors.next(null);
1798
- delete this.streams[id];
1791
+ sessionStorage.removeItem(id);
1792
+ localStorage.removeItem(id);
1799
1793
  };
1800
1794
  /**
1801
1795
  * @private
@@ -1808,7 +1802,7 @@
1808
1802
  * @return {?}
1809
1803
  */
1810
1804
  function (setting) {
1811
- window.localStorage.setItem(setting.id, JSON.stringify(setting));
1805
+ localStorage.setItem(setting.id, JSON.stringify(setting));
1812
1806
  };
1813
1807
  /**
1814
1808
  * @private
@@ -1821,7 +1815,7 @@
1821
1815
  * @return {?}
1822
1816
  */
1823
1817
  function (setting) {
1824
- window.sessionStorage.setItem(setting.id, JSON.stringify(setting));
1818
+ sessionStorage.setItem(setting.id, JSON.stringify(setting));
1825
1819
  };
1826
1820
  /**
1827
1821
  * @private
@@ -1941,7 +1935,6 @@
1941
1935
  function GenericFilterComponent(filterService, fb) {
1942
1936
  this.filterService = filterService;
1943
1937
  this.fb = fb;
1944
- this.error = new i0.EventEmitter();
1945
1938
  this.submitted = false;
1946
1939
  }
1947
1940
  Object.defineProperty(GenericFilterComponent.prototype, "config", {
@@ -2484,9 +2477,9 @@
2484
2477
  var formArray = this_1.buildCheckBoxFormArray(field, settings);
2485
2478
  this_1.form.addControl(field.name, formArray);
2486
2479
  }
2487
- else if (field.type === 'find-location' || field.type === 'find-service') {
2480
+ else if (field.type === 'find-location') {
2488
2481
  /** @type {?} */
2489
- var formArray = this_1.buildFindLocationAndServiceFormArray(field, settings);
2482
+ var formArray = this_1.buildFindLocationFormArray(field, settings);
2490
2483
  this_1.form.addControl(field.name, formArray);
2491
2484
  }
2492
2485
  else {
@@ -2627,7 +2620,7 @@
2627
2620
  * @param {?} settings
2628
2621
  * @return {?}
2629
2622
  */
2630
- GenericFilterComponent.prototype.buildFindLocationAndServiceFormArray = /**
2623
+ GenericFilterComponent.prototype.buildFindLocationFormArray = /**
2631
2624
  * @private
2632
2625
  * @param {?} field
2633
2626
  * @param {?} settings
@@ -2763,22 +2756,13 @@
2763
2756
  this.filterService.givenErrors.next(errors);
2764
2757
  }
2765
2758
  };
2766
- /**
2767
- * @return {?}
2768
- */
2769
- GenericFilterComponent.prototype.setError = /**
2770
- * @return {?}
2771
- */
2772
- function () {
2773
- this.error.emit();
2774
- };
2775
2759
  GenericFilterComponent.decorators = [
2776
2760
  { type: i0.Component, args: [{
2777
2761
  selector: 'xuilib-generic-filter',
2778
- 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 }}\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 <h3 *ngIf=\"field.title\" [class]=\"field.titleClasses ? field.titleClasses : 'govuk-heading-s'\">{{field.title}}</h3>\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n\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\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\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *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=\"'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 (error)= \"setError()\"\n [form]=\"form\"\n [title]=\"field.title\"\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",
2762
+ 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?.minSelected === 0\" class=\"govuk-!-margin-left-2\">(optional)</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=\"'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 <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",
2779
2763
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
2780
2764
  encapsulation: i0.ViewEncapsulation.None,
2781
- 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 .govuk-select{width:100%}"]
2765
+ 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%}"]
2782
2766
  }] }
2783
2767
  ];
2784
2768
  /** @nocollapse */
@@ -2789,7 +2773,6 @@
2789
2773
  ];
2790
2774
  };
2791
2775
  GenericFilterComponent.propDecorators = {
2792
- error: [{ type: i0.Output }],
2793
2776
  config: [{ type: i0.Input }],
2794
2777
  settings: [{ type: i0.Input }]
2795
2778
  };
@@ -4824,7 +4807,7 @@
4824
4807
 
4825
4808
  /**
4826
4809
  * @fileoverview added by tsickle
4827
- * Generated from: lib/services/session-storage/session-storage.service.ts
4810
+ * Generated from: lib/services/storage/session-storage/session-storage.service.ts
4828
4811
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4829
4812
  */
4830
4813
  var SessionStorageService = /** @class */ (function () {
@@ -6100,29 +6083,15 @@
6100
6083
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6101
6084
  */
6102
6085
  var FindServiceComponent = /** @class */ (function () {
6103
- function FindServiceComponent() {
6104
- this.serviceTitle = 'Choose a service';
6105
- this.services = [];
6106
- this.selectedServices = [];
6086
+ function FindServiceComponent(fb) {
6087
+ this.fb = fb;
6088
+ this.serviceTitle = 'Search for a service by name';
6107
6089
  this.enableAddServiceButton = true;
6108
- this.disabled = false;
6109
- this.serviceFieldChanged = new i0.EventEmitter();
6110
- this.error = new i0.EventEmitter();
6111
- this.tempSelectedService = null;
6090
+ this.disableInputField = false;
6091
+ this.form = this.fb.group({
6092
+ searchTerm: ['']
6093
+ });
6112
6094
  }
6113
- /**
6114
- * @return {?}
6115
- */
6116
- FindServiceComponent.prototype.ngOnInit = /**
6117
- * @return {?}
6118
- */
6119
- function () {
6120
- this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter(( /**
6121
- * @param {?} service
6122
- * @return {?}
6123
- */function (service) { return service.key; })) : [];
6124
- this.SortAnOptions();
6125
- };
6126
6095
  /**
6127
6096
  * @return {?}
6128
6097
  */
@@ -6130,161 +6099,21 @@
6130
6099
  * @return {?}
6131
6100
  */
6132
6101
  function () {
6133
- var _this = this;
6134
- if (this.tempSelectedService === null) {
6135
- this.setServiceError();
6136
- return;
6137
- }
6138
- this.selectedServices = __spread(this.selectedServices, [this.tempSelectedService]);
6139
- this.addSelectedServicesToForm([this.tempSelectedService]);
6140
- this.services = this.services.filter(( /**
6141
- * @param {?} s
6142
- * @return {?}
6143
- */function (s) { return s.key !== _this.tempSelectedService.key; }));
6144
- this.tempSelectedService = null;
6145
- };
6146
- /**
6147
- * @param {?} service
6148
- * @return {?}
6149
- */
6150
- FindServiceComponent.prototype.removeService = /**
6151
- * @param {?} service
6152
- * @return {?}
6153
- */
6154
- function (service) {
6155
- if (service.key) {
6156
- this.selectedServices = this.selectedServices !== null ? this.selectedServices.filter(( /**
6157
- * @param {?} selectedService
6158
- * @return {?}
6159
- */function (selectedService) { return selectedService.key !== service.key; })) : [];
6160
- /** @type {?} */
6161
- var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
6162
- /** @type {?} */
6163
- var index = (formArray.value).findIndex(( /**
6164
- * @param {?} selectedService
6165
- * @return {?}
6166
- */function (selectedService) { return selectedService.key === service.key; }));
6167
- if (index > -1) {
6168
- formArray.removeAt(index);
6169
- this.services.splice(index, 0, service);
6170
- this.SortAnOptions();
6171
- }
6172
- }
6173
- };
6174
- /**
6175
- * @param {?} service
6176
- * @return {?}
6177
- */
6178
- FindServiceComponent.prototype.onServiceSelected = /**
6179
- * @param {?} service
6180
- * @return {?}
6181
- */
6182
- function (service) {
6183
- if (!service) {
6184
- this.tempSelectedService = null;
6185
- return;
6186
- }
6187
- if (this.field.maxSelected === 1) {
6188
- this.removeSelectedValues();
6189
- this.addSelectedServicesToForm([service]);
6190
- }
6191
- else {
6192
- if (!this.selectedServices.find(( /**
6193
- * @param {?} s
6194
- * @return {?}
6195
- */function (s) { return s.key === service.key; }))) {
6196
- if (service.key) {
6197
- this.tempSelectedService = service;
6198
- }
6199
- }
6200
- }
6201
- };
6202
- /**
6203
- * @private
6204
- * @return {?}
6205
- */
6206
- FindServiceComponent.prototype.removeSelectedValues = /**
6207
- * @private
6208
- * @return {?}
6209
- */
6210
- function () {
6211
- /** @type {?} */
6212
- var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
6213
- for (var i = 0; i < formArray.length; i++) {
6214
- formArray.removeAt(i);
6215
- }
6216
- this.selectedServices = [];
6217
- };
6218
- /**
6219
- * @private
6220
- * @param {?} services
6221
- * @return {?}
6222
- */
6223
- FindServiceComponent.prototype.addSelectedServicesToForm = /**
6224
- * @private
6225
- * @param {?} services
6226
- * @return {?}
6227
- */
6228
- function (services) {
6229
- var e_1, _a;
6230
- /** @type {?} */
6231
- var formArray = ( /** @type {?} */(this.form.get(this.field.name)));
6232
- try {
6233
- for (var services_1 = __values(services), services_1_1 = services_1.next(); !services_1_1.done; services_1_1 = services_1.next()) {
6234
- var service = services_1_1.value;
6235
- formArray.push(new forms.FormControl(service));
6236
- }
6237
- }
6238
- catch (e_1_1) {
6239
- e_1 = { error: e_1_1 };
6240
- }
6241
- finally {
6242
- try {
6243
- if (services_1_1 && !services_1_1.done && (_a = services_1.return))
6244
- _a.call(services_1);
6245
- }
6246
- finally {
6247
- if (e_1)
6248
- throw e_1.error;
6249
- }
6250
- }
6251
- };
6252
- /**
6253
- * @private
6254
- * @return {?}
6255
- */
6256
- FindServiceComponent.prototype.SortAnOptions = /**
6257
- * @private
6258
- * @return {?}
6259
- */
6260
- function () {
6261
- return this.services.sort(( /**
6262
- * @param {?} a
6263
- * @param {?} b
6264
- * @return {?}
6265
- */function (a, b) {
6266
- return a.label.toLowerCase() > b.label.toLowerCase() ? 1 : (b.label.toLowerCase() > a.label.toLowerCase() ? -1 : 0);
6267
- }));
6268
- };
6269
- /**
6270
- * @private
6271
- * @return {?}
6272
- */
6273
- FindServiceComponent.prototype.setServiceError = /**
6274
- * @private
6275
- * @return {?}
6276
- */
6277
- function () {
6278
- this.form.get(this.field.name).markAsDirty();
6279
- this.error.emit();
6102
+ // Todo
6280
6103
  };
6281
6104
  FindServiceComponent.decorators = [
6282
6105
  { type: i0.Component, args: [{
6283
6106
  selector: 'xuilib-find-service',
6284
- 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>",
6107
+ 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",
6285
6108
  styles: ["#add-service{background-color:#ddd}.search-service__input-container{display:flex}.search-service__input{flex:1 0 auto}"]
6286
6109
  }] }
6287
6110
  ];
6111
+ /** @nocollapse */
6112
+ FindServiceComponent.ctorParameters = function () {
6113
+ return [
6114
+ { type: forms.FormBuilder }
6115
+ ];
6116
+ };
6288
6117
  FindServiceComponent.propDecorators = {
6289
6118
  field: [{ type: i0.Input }],
6290
6119
  fields: [{ type: i0.Input }],
@@ -6292,10 +6121,9 @@
6292
6121
  form: [{ type: i0.Input }],
6293
6122
  services: [{ type: i0.Input }],
6294
6123
  selectedServices: [{ type: i0.Input }],
6295
- enableAddServiceButton: [{ type: i0.Input }],
6296
6124
  disabled: [{ type: i0.Input }],
6297
- serviceFieldChanged: [{ type: i0.Output }],
6298
- error: [{ type: i0.Output }]
6125
+ enableAddServiceButton: [{ type: i0.Input }],
6126
+ disableInputField: [{ type: i0.Input }]
6299
6127
  };
6300
6128
  return FindServiceComponent;
6301
6129
  }());
@@ -6546,35 +6374,42 @@
6546
6374
  */
6547
6375
  var SearchServiceComponent = /** @class */ (function () {
6548
6376
  function SearchServiceComponent() {
6549
- this.services = [];
6550
- this.serviceChanged = new i0.EventEmitter();
6377
+ this.showAutocomplete = false;
6378
+ this.minSearchCharacters = 3;
6379
+ this.term = '';
6551
6380
  }
6552
6381
  /**
6553
- * @param {?} key
6554
6382
  * @return {?}
6555
6383
  */
6556
- SearchServiceComponent.prototype.onSelectionChanged = /**
6557
- * @param {?} key
6384
+ SearchServiceComponent.prototype.onInput = /**
6558
6385
  * @return {?}
6559
6386
  */
6560
- function (key) {
6561
- /** @type {?} */
6562
- var selectedService = this.services.find(( /**
6563
- * @param {?} s
6564
- * @return {?}
6565
- */function (s) { return s.key === key; }));
6566
- this.serviceChanged.emit(selectedService);
6387
+ function () {
6388
+ // Todo
6389
+ };
6390
+ /**
6391
+ * @return {?}
6392
+ */
6393
+ SearchServiceComponent.prototype.onSelectionChange = /**
6394
+ * @return {?}
6395
+ */
6396
+ function () {
6397
+ // Todo
6567
6398
  };
6568
6399
  SearchServiceComponent.decorators = [
6569
6400
  { type: i0.Component, args: [{
6570
6401
  selector: 'exui-search-service',
6571
- 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\"></option>\n <option *ngFor=\"let service of services\" [value]=\"service.key\">\n {{ service.label }}\n </option>\n <option *ngIf=\"!services?.length\">No results found</option>\n </select>\n</div>",
6402
+ 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",
6572
6403
  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}"]
6573
6404
  }] }
6574
6405
  ];
6575
6406
  SearchServiceComponent.propDecorators = {
6576
6407
  services: [{ type: i0.Input }],
6577
- serviceChanged: [{ type: i0.Output }]
6408
+ selectedServices: [{ type: i0.Input }],
6409
+ disabled: [{ type: i0.Input }],
6410
+ delay: [{ type: i0.Input }],
6411
+ form: [{ type: i0.Input }],
6412
+ showAutocomplete: [{ type: i0.Input }]
6578
6413
  };
6579
6414
  return SearchServiceComponent;
6580
6415
  }());
@@ -7937,6 +7772,33 @@
7937
7772
  return RemoveHostDirective;
7938
7773
  }());
7939
7774
 
7775
+ /**
7776
+ * @fileoverview added by tsickle
7777
+ * Generated from: lib/pipes/capitalize.pipe.ts
7778
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7779
+ */
7780
+ var CapitalizePipe = /** @class */ (function () {
7781
+ function CapitalizePipe() {
7782
+ }
7783
+ /**
7784
+ * @param {?} value
7785
+ * @return {?}
7786
+ */
7787
+ CapitalizePipe.prototype.transform = /**
7788
+ * @param {?} value
7789
+ * @return {?}
7790
+ */
7791
+ function (value) {
7792
+ /** @type {?} */
7793
+ var lowerCaseString = value.toLowerCase();
7794
+ return lowerCaseString.charAt(0).toUpperCase() + lowerCaseString.slice(1);
7795
+ };
7796
+ CapitalizePipe.decorators = [
7797
+ { type: i0.Pipe, args: [{ name: 'capitalize' },] }
7798
+ ];
7799
+ return CapitalizePipe;
7800
+ }());
7801
+
7940
7802
  /**
7941
7803
  * @fileoverview added by tsickle
7942
7804
  * Generated from: lib/exui-common-lib.module.ts
@@ -8006,13 +7868,17 @@
8006
7868
  GovUkFileUploadComponent,
8007
7869
  RemoveHostDirective
8008
7870
  ];
7871
+ /** @type {?} */
7872
+ var pipes = [
7873
+ CapitalizePipe
7874
+ ];
8009
7875
  var ɵ0 = windowProvider;
8010
7876
  var ExuiCommonLibModule = /** @class */ (function () {
8011
7877
  function ExuiCommonLibModule() {
8012
7878
  }
8013
7879
  ExuiCommonLibModule.decorators = [
8014
7880
  { type: i0.NgModule, args: [{
8015
- declarations: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS),
7881
+ declarations: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS, pipes),
8016
7882
  imports: [
8017
7883
  i4.CommonModule,
8018
7884
  forms.FormsModule,
@@ -8028,7 +7894,7 @@
8028
7894
  ],
8029
7895
  exports: __spread(COMMON_COMPONENTS, GOV_UI_COMPONENTS, [
8030
7896
  ngxPagination.PaginatePipe
8031
- ])
7897
+ ], pipes)
8032
7898
  },] }
8033
7899
  ];
8034
7900
  return ExuiCommonLibModule;
@@ -8318,6 +8184,7 @@
8318
8184
  exports.ɵbv = HmctsPrimaryNavigationComponent;
8319
8185
  exports.ɵbu = HmctsSubNavigationComponent;
8320
8186
  exports.ɵcn = RemoveHostDirective;
8187
+ exports.ɵco = CapitalizePipe;
8321
8188
  exports.ɵbe = FilterService;
8322
8189
  exports.ɵr = CaseSharingStateService;
8323
8190
  exports.ɵbg = CookieService;