@hmcts/rpx-xui-common-lib 1.7.12 → 1.7.13-task-name-filter

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 (40) hide show
  1. package/bundles/hmcts-rpx-xui-common-lib.umd.js +254 -114
  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 +27 -26
  6. package/esm2015/lib/components/find-task-name/find-task-name.component.js +228 -0
  7. package/esm2015/lib/components/generic-filter/generic-filter.component.js +22 -2
  8. package/esm2015/lib/exui-common-lib.module.js +4 -4
  9. package/esm2015/lib/gov-ui/components/hmcts-sub-navigation/hmcts-sub-navigation.component.js +5 -2
  10. package/esm2015/lib/models/filter.model.js +5 -1
  11. package/esm2015/lib/models/pagination.model.js +1 -11
  12. package/esm2015/lib/models/task-name.model.js +16 -0
  13. package/esm2015/lib/services/task-name/task-name.service.js +65 -0
  14. package/esm5/hmcts-rpx-xui-common-lib.js +27 -26
  15. package/esm5/lib/components/find-task-name/find-task-name.component.js +243 -0
  16. package/esm5/lib/components/generic-filter/generic-filter.component.js +27 -2
  17. package/esm5/lib/exui-common-lib.module.js +4 -4
  18. package/esm5/lib/gov-ui/components/hmcts-sub-navigation/hmcts-sub-navigation.component.js +5 -2
  19. package/esm5/lib/models/filter.model.js +5 -1
  20. package/esm5/lib/models/pagination.model.js +1 -11
  21. package/esm5/lib/models/task-name.model.js +16 -0
  22. package/esm5/lib/services/task-name/task-name.service.js +70 -0
  23. package/fesm2015/hmcts-rpx-xui-common-lib.js +192 -62
  24. package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
  25. package/fesm5/hmcts-rpx-xui-common-lib.js +226 -86
  26. package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
  27. package/hmcts-rpx-xui-common-lib.d.ts +26 -25
  28. package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
  29. package/lib/components/find-task-name/find-task-name.component.d.ts +41 -0
  30. package/lib/components/generic-filter/generic-filter.component.d.ts +1 -0
  31. package/lib/exui-common-lib.module.d.ts +2 -1
  32. package/lib/gov-ui/components/hmcts-sub-navigation/hmcts-sub-navigation.component.d.ts +1 -0
  33. package/lib/models/filter.model.d.ts +3 -1
  34. package/lib/models/pagination.model.d.ts +0 -4
  35. package/lib/models/task-name.model.d.ts +4 -0
  36. package/lib/services/task-name/task-name.service.d.ts +13 -0
  37. package/package.json +1 -1
  38. package/esm2015/lib/components/pagination-v1/pagination.component.js +0 -130
  39. package/esm5/lib/components/pagination-v1/pagination.component.js +0 -144
  40. package/lib/components/pagination-v1/pagination.component.d.ts +0 -19
@@ -869,6 +869,26 @@ class GenericFilterComponent {
869
869
  }
870
870
  }
871
871
  }
872
+ /**
873
+ * @param {?} values
874
+ * @param {?} field
875
+ * @return {?}
876
+ */
877
+ updateTaskNameControls(values, field) {
878
+ // let keys;
879
+ // if (!values) {
880
+ // keys = Object.keys(this.form.get(field.name).value);
881
+ // } else {
882
+ // keys = Object.keys(values);
883
+ // }
884
+ // for (const key of keys) {
885
+ // if (this.form.get(field.name) && this.form.get(field.name).get(key)) {
886
+ // const value = values && values[key] ? values[key] : null;
887
+ // this.form.get(field.name).get(key).patchValue(value);
888
+ // }
889
+ // }
890
+ this.form.get(field.name).patchValue(values);
891
+ }
872
892
  /**
873
893
  * @param {?} event
874
894
  * @param {?} form
@@ -1199,7 +1219,7 @@ class GenericFilterComponent {
1199
1219
  GenericFilterComponent.decorators = [
1200
1220
  { type: Component, args: [{
1201
1221
  selector: 'xuilib-generic-filter',
1202
- 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?.maxLength)}\">\n <h3 *ngIf=\"field.title\" class=\"govuk-heading-s\">{{field.title}}</h3>\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMinSelectedError && submitted && form.get(field.name).errors?.minLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.minSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMaxSelectedError && submitted && form.get(field.name).errors?.maxLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.maxSelectedError}}\n </span>\n <div class=\"govuk-body\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"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.enableAddLocationButton\"\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 </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",
1222
+ 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?.maxLength)}\">\n <h3 *ngIf=\"field.title\" class=\"govuk-heading-s\">{{field.title}}</h3>\n <p class=\"govuk-body\" *ngIf=\"field.subTitle\">{{field.subTitle}}</p>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMinSelectedError && submitted && form.get(field.name).errors?.minLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.minSelectedError}}\n </span>\n <span [id]=\"field.name + '-error'\" class=\"govuk-error-message\" *ngIf=\"field.displayMaxSelectedError && submitted && form.get(field.name).errors?.maxLength\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{field.maxSelectedError}}\n </span>\n <div class=\"govuk-body\" [ngSwitch]=\"field.type\">\n <ng-container *ngSwitchCase=\"'select'\">\n <select class=\"govuk-select\" (change)=\"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.enableAddLocationButton\"\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-task-name'\">\n <xuilib-find-task-name subTitle=\"\" (taskNameSelected)=\"updateTaskNameControls($event, field)\"\n (taskNameFieldChanged)=\"inputChanged(field)\"\n [submitted]=\"submitted\"\n [disabled]=\"disabled(field, form)\"\n [domain]=\"form.get(field.domainField)?.value\"\n [findTaskNameGroup]=\"form\"\n [selectedTaskName]=\"form.get(field.name).value.taskName\"\n [userIncluded]=\"false\"\n ></xuilib-find-task-name>\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",
1203
1223
  changeDetection: ChangeDetectionStrategy.OnPush,
1204
1224
  encapsulation: ViewEncapsulation.None,
1205
1225
  styles: [".contain-classes .elevated-break{position:relative;top:-10px}.contain-classes .xui-generic-filter .select-all{margin-bottom:10px}.contain-classes .xui-generic-filter .govuk-checkboxes{display:flex;flex-wrap:wrap}.contain-classes .xui-generic-filter .govuk-checkboxes>div{flex-grow:1;flex-shrink:0}"]
@@ -4060,94 +4080,203 @@ FindPersonComponent.propDecorators = {
4060
4080
 
4061
4081
  /**
4062
4082
  * @fileoverview added by tsickle
4063
- * Generated from: lib/components/pagination-v1/pagination.component.ts
4083
+ * Generated from: lib/services/task-name/task-name.service.ts
4064
4084
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4065
4085
  */
4086
+ class TaskNameService {
4087
+ /**
4088
+ * @param {?} http
4089
+ * @param {?} sessionStorageService
4090
+ */
4091
+ constructor(http, sessionStorageService) {
4092
+ this.http = http;
4093
+ this.sessionStorageService = sessionStorageService;
4094
+ }
4095
+ /**
4096
+ * @return {?} Observable<any[]>: Array of taskName in Observable
4097
+ */
4098
+ getTaskName() {
4099
+ if (this.sessionStorageService.getItem(TaskNameService.taskNamesKey)) {
4100
+ /** @type {?} */
4101
+ const taskNames = JSON.parse(this.sessionStorageService.getItem(TaskNameService.taskNamesKey));
4102
+ return of((/** @type {?} */ (taskNames)));
4103
+ }
4104
+ return this.http.get(`/workallocation2/taskNames`).pipe(tap((/**
4105
+ * @param {?} taskNames
4106
+ * @return {?}
4107
+ */
4108
+ taskNames => this.sessionStorageService.setItem(TaskNameService.taskNamesKey, JSON.stringify(taskNames)))));
4109
+ }
4110
+ }
4111
+ TaskNameService.taskNamesKey = 'taskNames';
4112
+ TaskNameService.decorators = [
4113
+ { type: Injectable, args: [{
4114
+ providedIn: 'root'
4115
+ },] }
4116
+ ];
4117
+ /** @nocollapse */
4118
+ TaskNameService.ctorParameters = () => [
4119
+ { type: HttpClient },
4120
+ { type: SessionStorageService }
4121
+ ];
4122
+ /** @nocollapse */ TaskNameService.ngInjectableDef = defineInjectable({ factory: function TaskNameService_Factory() { return new TaskNameService(inject(HttpClient), inject(SessionStorageService)); }, token: TaskNameService, providedIn: "root" });
4123
+
4066
4124
  /**
4067
- * @param {?} input
4068
- * @return {?}
4125
+ * @fileoverview added by tsickle
4126
+ * Generated from: lib/components/find-task-name/find-task-name.component.ts
4127
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4069
4128
  */
4070
- function coerceToBoolean(input) {
4071
- return !!input && input !== 'false';
4072
- }
4073
- class PaginationV1Component {
4074
- constructor() {
4075
- this.maxSize = 7;
4076
- this.previousLabel = 'Previous';
4077
- this.nextLabel = 'Next';
4078
- this.screenReaderPaginationLabel = 'Pagination';
4079
- this.screenReaderPageLabel = 'page';
4080
- this.screenReaderCurrentLabel = `You're on page`;
4081
- this.pageChange = new EventEmitter();
4082
- this.pageBoundsCorrection = new EventEmitter();
4083
- // tslint:disable-next-line:variable-name
4084
- this._directionLinks = true;
4085
- // tslint:disable-next-line:variable-name
4086
- this._autoHide = false;
4087
- // tslint:disable-next-line:variable-name
4088
- this._responsive = false;
4089
- }
4129
+ class FindTaskNameComponent {
4090
4130
  /**
4091
- * @return {?}
4131
+ * @param {?} cd
4132
+ * @param {?} taskService
4092
4133
  */
4093
- get directionLinks() {
4094
- return this._directionLinks;
4134
+ constructor(cd, taskService) {
4135
+ this.cd = cd;
4136
+ this.taskService = taskService;
4137
+ this.taskNameSelected = new EventEmitter();
4138
+ this.taskNameFieldChanged = new EventEmitter();
4139
+ this.boldTitle = 'Find the task name';
4140
+ this.subTitle = 'Type the name of the task name and select them.';
4141
+ this.domain = PersonRole.ALL;
4142
+ this.findTaskNameGroup = new FormGroup({});
4143
+ this.submitted = true;
4144
+ this.userIncluded = false;
4145
+ this.placeholderContent = '';
4146
+ this.isNoResultsShown = true;
4147
+ this.showUpdatedColor = false;
4148
+ this.selectedTaskNames = [];
4149
+ this.errorMessage = 'You must select a name';
4150
+ this.idValue = '';
4151
+ this.services = ['IA'];
4152
+ this.disabled = null;
4153
+ this.showAutocomplete = false;
4154
+ this.filteredOptions = [];
4155
+ this.minSearchCharacters = 1;
4156
+ this.searchTerm = '';
4095
4157
  }
4096
4158
  /**
4097
- * @param {?} value
4098
4159
  * @return {?}
4099
4160
  */
4100
- set directionLinks(value) {
4101
- this._directionLinks = coerceToBoolean(value);
4161
+ ngOnDestroy() {
4162
+ if (this.sub) {
4163
+ this.sub.unsubscribe();
4164
+ }
4102
4165
  }
4103
4166
  /**
4104
4167
  * @return {?}
4105
4168
  */
4106
- get autoHide() {
4107
- return this._autoHide;
4169
+ ngOnChanges() {
4170
+ this.findTaskNameControl = new FormControl(this.selectedTaskName);
4171
+ this.findTaskNameGroup.addControl('findTaskNameControl', this.findTaskNameControl);
4172
+ this.sub = this.findTaskNameControl.valueChanges
4173
+ .pipe(tap((/**
4174
+ * @return {?}
4175
+ */
4176
+ () => this.showAutocomplete = false)), tap((/**
4177
+ * @return {?}
4178
+ */
4179
+ () => this.filteredOptions = [])), tap((/**
4180
+ * @param {?} term
4181
+ * @return {?}
4182
+ */
4183
+ (term) => this.searchTerm = term)), debounceTime(300), tap((/**
4184
+ * @param {?} searchTerm
4185
+ * @return {?}
4186
+ */
4187
+ (searchTerm) => {
4188
+ if (!searchTerm) {
4189
+ this.taskNameSelected.emit('');
4190
+ }
4191
+ return searchTerm;
4192
+ })),
4193
+ // tap((searchTerm) => typeof searchTerm === 'string' ? this.taskNameSelected.emit('null') : void 0),
4194
+ filter((/**
4195
+ * @param {?} searchTerm
4196
+ * @return {?}
4197
+ */
4198
+ (searchTerm) => searchTerm && searchTerm.length >= this.minSearchCharacters)), mergeMap((/**
4199
+ * @return {?}
4200
+ */
4201
+ () => this.getTaskName()))).subscribe((/**
4202
+ * @param {?} taskNameModel
4203
+ * @return {?}
4204
+ */
4205
+ (taskNameModel) => {
4206
+ this.filteredOptions = taskNameModel.map((/**
4207
+ * @param {?} task
4208
+ * @return {?}
4209
+ */
4210
+ task => task.taskName));
4211
+ if (this.searchTerm) {
4212
+ this.filteredOptions = this.filteredOptions.filter((/**
4213
+ * @param {?} taskName
4214
+ * @return {?}
4215
+ */
4216
+ (taskName) => taskName.toLocaleLowerCase().includes(this.searchTerm.toLocaleLowerCase()))).map((/**
4217
+ * @param {?} taskName
4218
+ * @return {?}
4219
+ */
4220
+ taskName => taskName));
4221
+ }
4222
+ this.cd.detectChanges();
4223
+ }));
4108
4224
  }
4109
4225
  /**
4110
- * @param {?} value
4111
4226
  * @return {?}
4112
4227
  */
4113
- set autoHide(value) {
4114
- this._autoHide = coerceToBoolean(value);
4228
+ getTaskName() {
4229
+ return this.taskService.getTaskName();
4115
4230
  }
4116
4231
  /**
4232
+ * @param {?} selectedTaskName
4117
4233
  * @return {?}
4118
4234
  */
4119
- get responsive() {
4120
- return this._responsive;
4235
+ onSelectionChange(selectedTaskName) {
4236
+ if (selectedTaskName) {
4237
+ this.taskNameSelected.emit(selectedTaskName);
4238
+ this.findTaskNameControl.setValue(selectedTaskName);
4239
+ }
4121
4240
  }
4122
4241
  /**
4123
- * @param {?} value
4124
4242
  * @return {?}
4125
4243
  */
4126
- set responsive(value) {
4127
- this._responsive = coerceToBoolean(value);
4244
+ onInput() {
4245
+ this.taskNameFieldChanged.emit();
4128
4246
  }
4129
4247
  }
4130
- PaginationV1Component.decorators = [
4248
+ FindTaskNameComponent.decorators = [
4131
4249
  { type: Component, args: [{
4132
- selector: 'xuilib-pagination-v1',
4133
- template: "<pagination-template #p=\"paginationApi\" [id]=\"id\" [maxSize]=\"maxSize\" (pageChange)=\"pageChange.emit($event)\"\n (pageBoundsCorrection)=\"pageBoundsCorrection.emit($event)\">\n <nav role=\"navigation\" aria-label=\"Pagination\">\n <ul class=\"ngx-pagination\" role=\"navigation\" [attr.aria-label]=\"screenReaderPaginationLabel\"\n [class.responsive]=\"responsive\" *ngIf=\"!(autoHide && p.pages.length <= 1)\">\n <li class=\"pagination-previous\" [class.disabled]=\"p.isFirstPage()\" *ngIf=\"directionLinks\">\n <a tabindex=\"0\" *ngIf=\"1 < p.getCurrent()\" (keyup.enter)=\"p.previous()\" (click)=\"p.previous()\"\n [attr.aria-label]=\"previousLabel + ' ' + screenReaderPageLabel\">\n {{ previousLabel }} <span class=\"show-for-sr\">{{ screenReaderPageLabel }}</span>\n </a>\n <span *ngIf=\"p.isFirstPage()\">\n {{ previousLabel }} <span class=\"show-for-sr\">{{ screenReaderPageLabel }}</span>\n </span>\n </li>\n <li class=\"small-screen\">\n {{ p.getCurrent() }} / {{ p.getLastPage() }}\n </li>\n <li [class.current]=\"p.getCurrent() === page.value\" [class.ellipsis]=\"page.label === '...'\"\n *ngFor=\"let page of p.pages\">\n <a tabindex=\"0\" (keyup.enter)=\"p.setCurrent(page.value)\" (click)=\"p.setCurrent(page.value)\"\n *ngIf=\"p.getCurrent() !== page.value\">\n <span class=\"show-for-sr\">{{ screenReaderPageLabel }} </span>\n <span>{{ (page.label === '...') ? page.label : (page.label | number:'') }}</span>\n </a>\n <ng-container *ngIf=\"p.getCurrent() === page.value\">\n <span class=\"show-for-sr\">{{ screenReaderCurrentLabel }} </span>\n <span>{{ (page.label === '...') ? page.label : (page.label | number:'') }}</span>\n </ng-container>\n </li>\n <li class=\"pagination-next\" [class.disabled]=\"p.isLastPage()\" *ngIf=\"directionLinks\">\n <a tabindex=\"0\" *ngIf=\"!p.isLastPage()\" (keyup.enter)=\"p.next()\" (click)=\"p.next()\"\n [attr.aria-label]=\"nextLabel + ' ' + screenReaderPageLabel\">\n {{ nextLabel }} <span class=\"show-for-sr\">{{ screenReaderPageLabel }}</span>\n </a>\n <span *ngIf=\"p.isLastPage()\">\n {{ nextLabel }} <span class=\"show-for-sr\">{{ screenReaderPageLabel }}</span>\n </span>\n </li>\n </ul>\n </nav>\n</pagination-template>\n",
4134
- styles: [".ngx-pagination{margin-left:0;margin-bottom:1rem;padding-top:25px;text-decoration:none;text-align:left;font-size:16px}.ngx-pagination::after,.ngx-pagination::before{content:\" \";display:table}.ngx-pagination::after{clear:both}.ngx-pagination li{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;margin-right:.0625rem;border-radius:0;display:inline-block}.ngx-pagination a,.ngx-pagination button{display:block;padding:.1875rem .625rem;border-radius:0;color:#005da6;cursor:pointer}.ngx-pagination a:hover,.ngx-pagination button:hover{background:#e6e6e6}.ngx-pagination .current{padding:.1875rem .625rem;background:#fff;color:#4c2c92;cursor:default;font-weight:900}.ngx-pagination .disabled{display:none}.ngx-pagination .disabled:hover{background:0 0}.ngx-pagination .pagination-previous a::before,.ngx-pagination .pagination-previous.disabled::before{margin-right:.5rem;display:inline-block;height:10px;width:10px;border-style:solid;color:#0a0a0a;background:0 0;transform:rotate(-45deg);content:\"\";border-width:3px 0 0 3px}.ngx-pagination .pagination-next a::after,.ngx-pagination .pagination-next.disabled::after{margin-left:.5rem;display:inline-block;height:10px;width:10px;border-style:solid;color:#0a0a0a;background:0 0;transform:rotate(-45deg);content:\"\";border-width:0 3px 3px 0}.ngx-pagination .show-for-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.ngx-pagination .small-screen{display:none}@media screen and (max-width:601px){.ngx-pagination.responsive .small-screen{display:inline-block}.ngx-pagination.responsive li:not(.small-screen):not(.pagination-previous):not(.pagination-next){display:none}}"]
4250
+ selector: 'xuilib-find-task-name',
4251
+ template: "<h1 class=\"govuk-heading-l\" *ngIf=\"title && title.length\">\n <span class=\"govuk-caption-l\">{{title}}</span>\n {{boldTitle}}\n</h1>\n<div class=\"govuk-form-group\" [formGroup]=\"findTaskNameGroup\"\n [ngClass]=\"{'form-group-error': findTaskNameGroup.get('findTaskNameControl')?.invalid && submitted}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"sub-title-hint\">\n <div id=\"sub-title-hint\" class=\"govuk-hint\" *ngIf=\"subTitle && subTitle.length\">\n {{subTitle}}\n </div>\n <span id=\"validation-error\" class=\"govuk-error-message\" *ngIf=\"findTaskNameGroup && findTaskNameGroup.errors\">\n <span class=\"govuk-visually-hidden\">Error:</span>{{findTaskNameGroup.errors.error ? findTaskNameGroup.errors.error : errorMessage}}\n </span>\n <input id=\"inputSelectTaskName{{idValue}}\" type=\"text\" aria-label=\"select a task name\"\n formControlName=\"findTaskNameControl\"\n [matAutocomplete]=\"auto\"\n class=\"govuk-input govuk-!-width-one-third\"\n [placeholder]=\"placeholderContent\"\n [attr.disabled]=\"disabled\"\n (input)=\"onInput()\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\" (optionSelected)=\"onSelectionChange($event.option.value)\">\n <mat-option *ngFor=\"let option of filteredOptions\"\n [value]=\"option\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete, 'select-option': showUpdatedColor}\">\n {{ option }}\n </mat-option>\n <mat-option [ngClass]=\"{'select-option': showUpdatedColor}\" *ngIf=\"isNoResultsShown && !filteredOptions.length && showAutocomplete\">No results found</mat-option>\n </mat-autocomplete>\n </fieldset>\n</div>\n",
4252
+ styles: [""]
4135
4253
  }] }
4136
4254
  ];
4137
- PaginationV1Component.propDecorators = {
4138
- visibilityLabel: [{ type: Input }],
4139
- id: [{ type: Input }],
4140
- maxSize: [{ type: Input }],
4141
- directionLinks: [{ type: Input }],
4142
- autoHide: [{ type: Input }],
4143
- responsive: [{ type: Input }],
4144
- previousLabel: [{ type: Input }],
4145
- nextLabel: [{ type: Input }],
4146
- screenReaderPaginationLabel: [{ type: Input }],
4147
- screenReaderPageLabel: [{ type: Input }],
4148
- screenReaderCurrentLabel: [{ type: Input }],
4149
- pageChange: [{ type: Output }],
4150
- pageBoundsCorrection: [{ type: Output }]
4255
+ /** @nocollapse */
4256
+ FindTaskNameComponent.ctorParameters = () => [
4257
+ { type: ChangeDetectorRef },
4258
+ { type: TaskNameService }
4259
+ ];
4260
+ FindTaskNameComponent.propDecorators = {
4261
+ taskNameSelected: [{ type: Output }],
4262
+ taskNameFieldChanged: [{ type: Output }],
4263
+ title: [{ type: Input }],
4264
+ boldTitle: [{ type: Input }],
4265
+ subTitle: [{ type: Input }],
4266
+ domain: [{ type: Input }],
4267
+ findTaskNameGroup: [{ type: Input }],
4268
+ selectedTaskName: [{ type: Input }],
4269
+ submitted: [{ type: Input }],
4270
+ userIncluded: [{ type: Input }],
4271
+ assignedUser: [{ type: Input }],
4272
+ placeholderContent: [{ type: Input }],
4273
+ isNoResultsShown: [{ type: Input }],
4274
+ showUpdatedColor: [{ type: Input }],
4275
+ selectedTaskNames: [{ type: Input }],
4276
+ errorMessage: [{ type: Input }],
4277
+ idValue: [{ type: Input }],
4278
+ services: [{ type: Input }],
4279
+ disabled: [{ type: Input }]
4151
4280
  };
4152
4281
 
4153
4282
  /**
@@ -5377,7 +5506,8 @@ class HmctsSubNavigationComponent {
5377
5506
  HmctsSubNavigationComponent.decorators = [
5378
5507
  { type: Component, args: [{
5379
5508
  selector: 'xuilib-hmcts-sub-navigation',
5380
- template: "<nav class=\"hmcts-sub-navigation\" attr.aria-label=\"{{label}}\" role=\"navigation\" *ngIf=\"items\">\n <ul class=\"hmcts-sub-navigation__list\">\n <li class=\"hmcts-sub-navigation__item\" *ngFor=\"let item of items\">\n <a data-selector=\"sub-nav-link\" class=\"hmcts-sub-navigation__link\" [routerLink]=\"item.href\"\n [attr.aria-current]=\"item.active ? 'page' : null\">\n {{item.text}}\n </a>\n </li>\n </ul>\n</nav>\n"
5509
+ template: "<nav class=\"hmcts-sub-navigation\" attr.aria-label=\"{{label}}\" role=\"navigation\" *ngIf=\"items\">\n <ul class=\"hmcts-sub-navigation__list\">\n <li class=\"hmcts-sub-navigation__item\" *ngFor=\"let item of items\">\n <a data-selector=\"sub-nav-link\" class=\"hmcts-sub-navigation__link\" [routerLink]=\"item.href\"\n [attr.aria-current]=\"item.active ? 'page' : null\">\n {{item.text}}\n\n <span *ngIf=\"item.roundel && item.roundel > 0 \" class=\"xui-alert-link__number\"> {{item.roundel}} </span>\n </a>\n </li>\n </ul>\n</nav>\n",
5510
+ styles: [".xui-alert-link__number{font-family:nta,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:.875rem;line-height:1.78571;border-radius:50%;background-color:#1d70b8;color:#fff;font-weight:700;width:25px;height:25px;margin-left:5px;text-align:center;display:inline-block;text-decoration:none}"]
5381
5511
  }] }
5382
5512
  ];
5383
5513
  HmctsSubNavigationComponent.propDecorators = {
@@ -5465,10 +5595,10 @@ const COMMON_COMPONENTS = [
5465
5595
  FindPersonComponent,
5466
5596
  SearchJudicialsComponent,
5467
5597
  FindLocationComponent,
5598
+ FindTaskNameComponent,
5468
5599
  SearchLocationComponent,
5469
5600
  SearchVenueComponent,
5470
- PaginationComponent,
5471
- PaginationV1Component
5601
+ PaginationComponent
5472
5602
  ];
5473
5603
  /** @type {?} */
5474
5604
  const GOV_UI_COMPONENTS = [
@@ -6397,6 +6527,6 @@ LoadingService.decorators = [
6397
6527
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6398
6528
  */
6399
6529
 
6400
- 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, 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, GenericFilterComponent as ɵbd, HmctsSessionDialogComponent as ɵk, InviteUserFormComponent as ɵo, InviteUserPermissionComponent as ɵn, LoadingSpinnerComponent as ɵbc, PaginationV1Component as ɵbq, PaginationComponent as ɵbp, SearchJudicialsComponent as ɵbk, SearchLocationComponent as ɵbm, SearchVenueComponent as ɵbo, 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 ɵca, GovUkCheckboxesComponent as ɵcg, GovUkDateComponent as ɵcf, GovUkErrorMessageComponent as ɵcd, GovUkFieldsetComponent as ɵce, GovUkFileUploadComponent as ɵcl, GovUkFormGroupWrapperComponent as ɵcb, GovUkInputComponent as ɵbz, GovUkLabelComponent as ɵcc, GovUkRadioComponent as ɵch, GovUkRadiosComponent as ɵci, GovUkSelectComponent as ɵcj, GovukTableComponent as ɵby, GovUkTextareaComponent as ɵck, HmctsBannerComponent as ɵbx, HmctsErrorSummaryComponent as ɵbv, HmctsIdentityBarComponent as ɵbr, HmctsMainWrapperComponent as ɵbw, HmctsPaginationComponent as ɵbs, HmctsPrimaryNavigationComponent as ɵbu, HmctsSubNavigationComponent as ɵbt, RemoveHostDirective as ɵcm, CaseSharingStateService as ɵr, CookieService as ɵbg, FeatureToggleService as ɵh, FilterService as ɵbe, FindAPersonService as ɵbi, LocationService as ɵbn, SessionStorageService as ɵbj };
6530
+ 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, 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, FindTaskNameComponent 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, 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, TaskNameService as ɵbp };
6401
6531
 
6402
6532
  //# sourceMappingURL=hmcts-rpx-xui-common-lib.js.map