@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
@@ -1186,6 +1186,31 @@
1186
1186
  }
1187
1187
  }
1188
1188
  };
1189
+ /**
1190
+ * @param {?} values
1191
+ * @param {?} field
1192
+ * @return {?}
1193
+ */
1194
+ GenericFilterComponent.prototype.updateTaskNameControls = /**
1195
+ * @param {?} values
1196
+ * @param {?} field
1197
+ * @return {?}
1198
+ */
1199
+ function (values, field) {
1200
+ // let keys;
1201
+ // if (!values) {
1202
+ // keys = Object.keys(this.form.get(field.name).value);
1203
+ // } else {
1204
+ // keys = Object.keys(values);
1205
+ // }
1206
+ // for (const key of keys) {
1207
+ // if (this.form.get(field.name) && this.form.get(field.name).get(key)) {
1208
+ // const value = values && values[key] ? values[key] : null;
1209
+ // this.form.get(field.name).get(key).patchValue(value);
1210
+ // }
1211
+ // }
1212
+ this.form.get(field.name).patchValue(values);
1213
+ };
1189
1214
  /**
1190
1215
  * @param {?} event
1191
1216
  * @param {?} form
@@ -1645,7 +1670,7 @@
1645
1670
  GenericFilterComponent.decorators = [
1646
1671
  { type: i0.Component, args: [{
1647
1672
  selector: 'xuilib-generic-filter',
1648
- 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",
1673
+ 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",
1649
1674
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
1650
1675
  encapsulation: i0.ViewEncapsulation.None,
1651
1676
  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}"]
@@ -5133,101 +5158,214 @@
5133
5158
 
5134
5159
  /**
5135
5160
  * @fileoverview added by tsickle
5136
- * Generated from: lib/components/pagination-v1/pagination.component.ts
5161
+ * Generated from: lib/services/task-name/task-name.service.ts
5137
5162
  * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5138
5163
  */
5164
+ var TaskNameService = /** @class */ (function () {
5165
+ function TaskNameService(http, sessionStorageService) {
5166
+ this.http = http;
5167
+ this.sessionStorageService = sessionStorageService;
5168
+ }
5169
+ /**
5170
+ * @return Observable<any[]>: Array of taskName in Observable
5171
+ */
5172
+ /**
5173
+ * @return {?} Observable<any[]>: Array of taskName in Observable
5174
+ */
5175
+ TaskNameService.prototype.getTaskName = /**
5176
+ * @return {?} Observable<any[]>: Array of taskName in Observable
5177
+ */
5178
+ function () {
5179
+ var _this = this;
5180
+ if (this.sessionStorageService.getItem(TaskNameService.taskNamesKey)) {
5181
+ /** @type {?} */
5182
+ var taskNames = JSON.parse(this.sessionStorageService.getItem(TaskNameService.taskNamesKey));
5183
+ return rxjs.of(( /** @type {?} */(taskNames)));
5184
+ }
5185
+ return this.http.get("/workallocation2/taskNames").pipe(operators.tap(( /**
5186
+ * @param {?} taskNames
5187
+ * @return {?}
5188
+ */function (taskNames) { return _this.sessionStorageService.setItem(TaskNameService.taskNamesKey, JSON.stringify(taskNames)); })));
5189
+ };
5190
+ TaskNameService.taskNamesKey = 'taskNames';
5191
+ TaskNameService.decorators = [
5192
+ { type: i0.Injectable, args: [{
5193
+ providedIn: 'root'
5194
+ },] }
5195
+ ];
5196
+ /** @nocollapse */
5197
+ TaskNameService.ctorParameters = function () {
5198
+ return [
5199
+ { type: i1.HttpClient },
5200
+ { type: SessionStorageService }
5201
+ ];
5202
+ };
5203
+ /** @nocollapse */ TaskNameService.ngInjectableDef = i0.defineInjectable({ factory: function TaskNameService_Factory() { return new TaskNameService(i0.inject(i1.HttpClient), i0.inject(SessionStorageService)); }, token: TaskNameService, providedIn: "root" });
5204
+ return TaskNameService;
5205
+ }());
5206
+
5139
5207
  /**
5140
- * @param {?} input
5141
- * @return {?}
5208
+ * @fileoverview added by tsickle
5209
+ * Generated from: lib/components/find-task-name/find-task-name.component.ts
5210
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5142
5211
  */
5143
- function coerceToBoolean(input) {
5144
- return !!input && input !== 'false';
5145
- }
5146
- var PaginationV1Component = /** @class */ (function () {
5147
- function PaginationV1Component() {
5148
- this.maxSize = 7;
5149
- this.previousLabel = 'Previous';
5150
- this.nextLabel = 'Next';
5151
- this.screenReaderPaginationLabel = 'Pagination';
5152
- this.screenReaderPageLabel = 'page';
5153
- this.screenReaderCurrentLabel = "You're on page";
5154
- this.pageChange = new i0.EventEmitter();
5155
- this.pageBoundsCorrection = new i0.EventEmitter();
5156
- // tslint:disable-next-line:variable-name
5157
- this._directionLinks = true;
5158
- // tslint:disable-next-line:variable-name
5159
- this._autoHide = false;
5160
- // tslint:disable-next-line:variable-name
5161
- this._responsive = false;
5212
+ var FindTaskNameComponent = /** @class */ (function () {
5213
+ function FindTaskNameComponent(cd, taskService) {
5214
+ this.cd = cd;
5215
+ this.taskService = taskService;
5216
+ this.taskNameSelected = new i0.EventEmitter();
5217
+ this.taskNameFieldChanged = new i0.EventEmitter();
5218
+ this.boldTitle = 'Find the task name';
5219
+ this.subTitle = 'Type the name of the task name and select them.';
5220
+ this.domain = PersonRole.ALL;
5221
+ this.findTaskNameGroup = new forms.FormGroup({});
5222
+ this.submitted = true;
5223
+ this.userIncluded = false;
5224
+ this.placeholderContent = '';
5225
+ this.isNoResultsShown = true;
5226
+ this.showUpdatedColor = false;
5227
+ this.selectedTaskNames = [];
5228
+ this.errorMessage = 'You must select a name';
5229
+ this.idValue = '';
5230
+ this.services = ['IA'];
5231
+ this.disabled = null;
5232
+ this.showAutocomplete = false;
5233
+ this.filteredOptions = [];
5234
+ this.minSearchCharacters = 1;
5235
+ this.searchTerm = '';
5162
5236
  }
5163
- Object.defineProperty(PaginationV1Component.prototype, "directionLinks", {
5164
- get: /**
5165
- * @return {?}
5166
- */ function () {
5167
- return this._directionLinks;
5168
- },
5169
- set: /**
5170
- * @param {?} value
5171
- * @return {?}
5172
- */ function (value) {
5173
- this._directionLinks = coerceToBoolean(value);
5174
- },
5175
- enumerable: true,
5176
- configurable: true
5177
- });
5178
- Object.defineProperty(PaginationV1Component.prototype, "autoHide", {
5179
- get: /**
5180
- * @return {?}
5181
- */ function () {
5182
- return this._autoHide;
5183
- },
5184
- set: /**
5185
- * @param {?} value
5186
- * @return {?}
5187
- */ function (value) {
5188
- this._autoHide = coerceToBoolean(value);
5189
- },
5190
- enumerable: true,
5191
- configurable: true
5192
- });
5193
- Object.defineProperty(PaginationV1Component.prototype, "responsive", {
5194
- get: /**
5195
- * @return {?}
5196
- */ function () {
5197
- return this._responsive;
5198
- },
5199
- set: /**
5200
- * @param {?} value
5237
+ /**
5238
+ * @return {?}
5239
+ */
5240
+ FindTaskNameComponent.prototype.ngOnDestroy = /**
5241
+ * @return {?}
5242
+ */
5243
+ function () {
5244
+ if (this.sub) {
5245
+ this.sub.unsubscribe();
5246
+ }
5247
+ };
5248
+ /**
5249
+ * @return {?}
5250
+ */
5251
+ FindTaskNameComponent.prototype.ngOnChanges = /**
5252
+ * @return {?}
5253
+ */
5254
+ function () {
5255
+ var _this = this;
5256
+ this.findTaskNameControl = new forms.FormControl(this.selectedTaskName);
5257
+ this.findTaskNameGroup.addControl('findTaskNameControl', this.findTaskNameControl);
5258
+ this.sub = this.findTaskNameControl.valueChanges
5259
+ .pipe(operators.tap(( /**
5201
5260
  * @return {?}
5202
- */ function (value) {
5203
- this._responsive = coerceToBoolean(value);
5204
- },
5205
- enumerable: true,
5206
- configurable: true
5207
- });
5208
- PaginationV1Component.decorators = [
5261
+ */function () { return _this.showAutocomplete = false; })), operators.tap(( /**
5262
+ * @return {?}
5263
+ */function () { return _this.filteredOptions = []; })), operators.tap(( /**
5264
+ * @param {?} term
5265
+ * @return {?}
5266
+ */function (term) { return _this.searchTerm = term; })), operators.debounceTime(300), operators.tap(( /**
5267
+ * @param {?} searchTerm
5268
+ * @return {?}
5269
+ */function (searchTerm) {
5270
+ if (!searchTerm) {
5271
+ _this.taskNameSelected.emit('');
5272
+ }
5273
+ return searchTerm;
5274
+ })),
5275
+ // tap((searchTerm) => typeof searchTerm === 'string' ? this.taskNameSelected.emit('null') : void 0),
5276
+ operators.filter(( /**
5277
+ * @param {?} searchTerm
5278
+ * @return {?}
5279
+ */function (searchTerm) { return searchTerm && searchTerm.length >= _this.minSearchCharacters; })), operators.mergeMap(( /**
5280
+ * @return {?}
5281
+ */function () { return _this.getTaskName(); }))).subscribe(( /**
5282
+ * @param {?} taskNameModel
5283
+ * @return {?}
5284
+ */function (taskNameModel) {
5285
+ _this.filteredOptions = taskNameModel.map(( /**
5286
+ * @param {?} task
5287
+ * @return {?}
5288
+ */function (task) { return task.taskName; }));
5289
+ if (_this.searchTerm) {
5290
+ _this.filteredOptions = _this.filteredOptions.filter(( /**
5291
+ * @param {?} taskName
5292
+ * @return {?}
5293
+ */function (taskName) { return taskName.toLocaleLowerCase().includes(_this.searchTerm.toLocaleLowerCase()); })).map(( /**
5294
+ * @param {?} taskName
5295
+ * @return {?}
5296
+ */function (taskName) { return taskName; }));
5297
+ }
5298
+ _this.cd.detectChanges();
5299
+ }));
5300
+ };
5301
+ /**
5302
+ * @return {?}
5303
+ */
5304
+ FindTaskNameComponent.prototype.getTaskName = /**
5305
+ * @return {?}
5306
+ */
5307
+ function () {
5308
+ return this.taskService.getTaskName();
5309
+ };
5310
+ /**
5311
+ * @param {?} selectedTaskName
5312
+ * @return {?}
5313
+ */
5314
+ FindTaskNameComponent.prototype.onSelectionChange = /**
5315
+ * @param {?} selectedTaskName
5316
+ * @return {?}
5317
+ */
5318
+ function (selectedTaskName) {
5319
+ if (selectedTaskName) {
5320
+ this.taskNameSelected.emit(selectedTaskName);
5321
+ this.findTaskNameControl.setValue(selectedTaskName);
5322
+ }
5323
+ };
5324
+ /**
5325
+ * @return {?}
5326
+ */
5327
+ FindTaskNameComponent.prototype.onInput = /**
5328
+ * @return {?}
5329
+ */
5330
+ function () {
5331
+ this.taskNameFieldChanged.emit();
5332
+ };
5333
+ FindTaskNameComponent.decorators = [
5209
5334
  { type: i0.Component, args: [{
5210
- selector: 'xuilib-pagination-v1',
5211
- 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",
5212
- 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}}"]
5335
+ selector: 'xuilib-find-task-name',
5336
+ 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",
5337
+ styles: [""]
5213
5338
  }] }
5214
5339
  ];
5215
- PaginationV1Component.propDecorators = {
5216
- visibilityLabel: [{ type: i0.Input }],
5217
- id: [{ type: i0.Input }],
5218
- maxSize: [{ type: i0.Input }],
5219
- directionLinks: [{ type: i0.Input }],
5220
- autoHide: [{ type: i0.Input }],
5221
- responsive: [{ type: i0.Input }],
5222
- previousLabel: [{ type: i0.Input }],
5223
- nextLabel: [{ type: i0.Input }],
5224
- screenReaderPaginationLabel: [{ type: i0.Input }],
5225
- screenReaderPageLabel: [{ type: i0.Input }],
5226
- screenReaderCurrentLabel: [{ type: i0.Input }],
5227
- pageChange: [{ type: i0.Output }],
5228
- pageBoundsCorrection: [{ type: i0.Output }]
5340
+ /** @nocollapse */
5341
+ FindTaskNameComponent.ctorParameters = function () {
5342
+ return [
5343
+ { type: i0.ChangeDetectorRef },
5344
+ { type: TaskNameService }
5345
+ ];
5346
+ };
5347
+ FindTaskNameComponent.propDecorators = {
5348
+ taskNameSelected: [{ type: i0.Output }],
5349
+ taskNameFieldChanged: [{ type: i0.Output }],
5350
+ title: [{ type: i0.Input }],
5351
+ boldTitle: [{ type: i0.Input }],
5352
+ subTitle: [{ type: i0.Input }],
5353
+ domain: [{ type: i0.Input }],
5354
+ findTaskNameGroup: [{ type: i0.Input }],
5355
+ selectedTaskName: [{ type: i0.Input }],
5356
+ submitted: [{ type: i0.Input }],
5357
+ userIncluded: [{ type: i0.Input }],
5358
+ assignedUser: [{ type: i0.Input }],
5359
+ placeholderContent: [{ type: i0.Input }],
5360
+ isNoResultsShown: [{ type: i0.Input }],
5361
+ showUpdatedColor: [{ type: i0.Input }],
5362
+ selectedTaskNames: [{ type: i0.Input }],
5363
+ errorMessage: [{ type: i0.Input }],
5364
+ idValue: [{ type: i0.Input }],
5365
+ services: [{ type: i0.Input }],
5366
+ disabled: [{ type: i0.Input }]
5229
5367
  };
5230
- return PaginationV1Component;
5368
+ return FindTaskNameComponent;
5231
5369
  }());
5232
5370
 
5233
5371
  /**
@@ -6686,7 +6824,8 @@
6686
6824
  HmctsSubNavigationComponent.decorators = [
6687
6825
  { type: i0.Component, args: [{
6688
6826
  selector: 'xuilib-hmcts-sub-navigation',
6689
- 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"
6827
+ 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",
6828
+ 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}"]
6690
6829
  }] }
6691
6830
  ];
6692
6831
  HmctsSubNavigationComponent.propDecorators = {
@@ -6779,10 +6918,10 @@
6779
6918
  FindPersonComponent,
6780
6919
  SearchJudicialsComponent,
6781
6920
  FindLocationComponent,
6921
+ FindTaskNameComponent,
6782
6922
  SearchLocationComponent,
6783
6923
  SearchVenueComponent,
6784
- PaginationComponent,
6785
- PaginationV1Component
6924
+ PaginationComponent
6786
6925
  ];
6787
6926
  /** @type {?} */
6788
6927
  var GOV_UI_COMPONENTS = [
@@ -7905,16 +8044,16 @@
7905
8044
  exports.ɵa = ExuiPageWrapperComponent;
7906
8045
  exports.ɵbl = FindLocationComponent;
7907
8046
  exports.ɵbh = FindPersonComponent;
8047
+ exports.ɵbo = FindTaskNameComponent;
7908
8048
  exports.ɵbd = GenericFilterComponent;
7909
8049
  exports.ɵk = HmctsSessionDialogComponent;
7910
8050
  exports.ɵo = InviteUserFormComponent;
7911
8051
  exports.ɵn = InviteUserPermissionComponent;
7912
8052
  exports.ɵbc = LoadingSpinnerComponent;
7913
- exports.ɵbq = PaginationV1Component;
7914
- exports.ɵbp = PaginationComponent;
8053
+ exports.ɵbr = PaginationComponent;
7915
8054
  exports.ɵbk = SearchJudicialsComponent;
7916
8055
  exports.ɵbm = SearchLocationComponent;
7917
- exports.ɵbo = SearchVenueComponent;
8056
+ exports.ɵbq = SearchVenueComponent;
7918
8057
  exports.ɵv = SelectedCaseConfirmComponent;
7919
8058
  exports.ɵt = SelectedCaseListComponent;
7920
8059
  exports.ɵu = SelectedCaseComponent;
@@ -7933,28 +8072,28 @@
7933
8072
  exports.ɵg = FeatureToggleDirective;
7934
8073
  exports.ɵi = LetContext;
7935
8074
  exports.ɵj = LetDirective;
7936
- exports.ɵca = GovUkCheckboxComponent;
7937
- exports.ɵcg = GovUkCheckboxesComponent;
7938
- exports.ɵcf = GovUkDateComponent;
7939
- exports.ɵcd = GovUkErrorMessageComponent;
7940
- exports.ɵce = GovUkFieldsetComponent;
7941
- exports.ɵcl = GovUkFileUploadComponent;
7942
- exports.ɵcb = GovUkFormGroupWrapperComponent;
7943
- exports.ɵbz = GovUkInputComponent;
7944
- exports.ɵcc = GovUkLabelComponent;
7945
- exports.ɵch = GovUkRadioComponent;
7946
- exports.ɵci = GovUkRadiosComponent;
7947
- exports.ɵcj = GovUkSelectComponent;
7948
- exports.ɵby = GovukTableComponent;
7949
- exports.ɵck = GovUkTextareaComponent;
7950
- exports.ɵbx = HmctsBannerComponent;
7951
- exports.ɵbv = HmctsErrorSummaryComponent;
7952
- exports.ɵbr = HmctsIdentityBarComponent;
7953
- exports.ɵbw = HmctsMainWrapperComponent;
7954
- exports.ɵbs = HmctsPaginationComponent;
7955
- exports.ɵbu = HmctsPrimaryNavigationComponent;
7956
- exports.ɵbt = HmctsSubNavigationComponent;
7957
- exports.ɵcm = RemoveHostDirective;
8075
+ exports.ɵcb = GovUkCheckboxComponent;
8076
+ exports.ɵch = GovUkCheckboxesComponent;
8077
+ exports.ɵcg = GovUkDateComponent;
8078
+ exports.ɵce = GovUkErrorMessageComponent;
8079
+ exports.ɵcf = GovUkFieldsetComponent;
8080
+ exports.ɵcm = GovUkFileUploadComponent;
8081
+ exports.ɵcc = GovUkFormGroupWrapperComponent;
8082
+ exports.ɵca = GovUkInputComponent;
8083
+ exports.ɵcd = GovUkLabelComponent;
8084
+ exports.ɵci = GovUkRadioComponent;
8085
+ exports.ɵcj = GovUkRadiosComponent;
8086
+ exports.ɵck = GovUkSelectComponent;
8087
+ exports.ɵbz = GovukTableComponent;
8088
+ exports.ɵcl = GovUkTextareaComponent;
8089
+ exports.ɵby = HmctsBannerComponent;
8090
+ exports.ɵbw = HmctsErrorSummaryComponent;
8091
+ exports.ɵbs = HmctsIdentityBarComponent;
8092
+ exports.ɵbx = HmctsMainWrapperComponent;
8093
+ exports.ɵbt = HmctsPaginationComponent;
8094
+ exports.ɵbv = HmctsPrimaryNavigationComponent;
8095
+ exports.ɵbu = HmctsSubNavigationComponent;
8096
+ exports.ɵcn = RemoveHostDirective;
7958
8097
  exports.ɵr = CaseSharingStateService;
7959
8098
  exports.ɵbg = CookieService;
7960
8099
  exports.ɵh = FeatureToggleService;
@@ -7962,6 +8101,7 @@
7962
8101
  exports.ɵbi = FindAPersonService;
7963
8102
  exports.ɵbn = LocationService;
7964
8103
  exports.ɵbj = SessionStorageService;
8104
+ exports.ɵbp = TaskNameService;
7965
8105
 
7966
8106
  Object.defineProperty(exports, '__esModule', { value: true });
7967
8107