@hmcts/rpx-xui-common-lib 1.6.10 → 1.6.13-search-judicial

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 (37) hide show
  1. package/bundles/hmcts-rpx-xui-common-lib.umd.js +543 -31
  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 +28 -26
  6. package/esm2015/lib/components/find-person/find-person.component.js +1 -1
  7. package/esm2015/lib/components/generic-filter/generic-filter.component.js +1 -2
  8. package/esm2015/lib/components/search-judicials/search-judicials.component.js +243 -0
  9. package/esm2015/lib/components/search-location/search-location.component.js +2 -2
  10. package/esm2015/lib/components/search-venue/search-venue.component.js +246 -0
  11. package/esm2015/lib/exui-common-lib.module.js +5 -1
  12. package/esm2015/lib/models/person.model.js +23 -1
  13. package/esm2015/lib/services/find-person/find-person.service.js +8 -1
  14. package/esm2015/lib/services/locations/location.service.js +11 -1
  15. package/esm5/hmcts-rpx-xui-common-lib.js +28 -26
  16. package/esm5/lib/components/find-person/find-person.component.js +1 -1
  17. package/esm5/lib/components/generic-filter/generic-filter.component.js +1 -2
  18. package/esm5/lib/components/search-judicials/search-judicials.component.js +284 -0
  19. package/esm5/lib/components/search-location/search-location.component.js +2 -2
  20. package/esm5/lib/components/search-venue/search-venue.component.js +290 -0
  21. package/esm5/lib/exui-common-lib.module.js +5 -1
  22. package/esm5/lib/models/person.model.js +23 -1
  23. package/esm5/lib/services/find-person/find-person.service.js +12 -1
  24. package/esm5/lib/services/locations/location.service.js +25 -1
  25. package/fesm2015/hmcts-rpx-xui-common-lib.js +417 -4
  26. package/fesm2015/hmcts-rpx-xui-common-lib.js.map +1 -1
  27. package/fesm5/hmcts-rpx-xui-common-lib.js +519 -5
  28. package/fesm5/hmcts-rpx-xui-common-lib.js.map +1 -1
  29. package/hmcts-rpx-xui-common-lib.d.ts +27 -25
  30. package/hmcts-rpx-xui-common-lib.metadata.json +1 -1
  31. package/lib/components/search-judicials/search-judicials.component.d.ts +36 -0
  32. package/lib/components/search-venue/search-venue.component.d.ts +37 -0
  33. package/lib/exui-common-lib.module.d.ts +3 -1
  34. package/lib/models/person.model.d.ts +10 -0
  35. package/lib/services/find-person/find-person.service.d.ts +2 -1
  36. package/lib/services/locations/location.service.d.ts +8 -0
  37. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/material'), require('@angular/material/autocomplete'), require('@angular/forms'), require('@angular/common/http'), require('launchdarkly-js-client-sdk'), require('@angular/common'), require('@angular/platform-browser'), require('@ng-idle/core'), require('@ng-idle/keepalive'), require('@angular/router'), require('@angular/core'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@hmcts/rpx-xui-common-lib', ['exports', '@angular/material', '@angular/material/autocomplete', '@angular/forms', '@angular/common/http', 'launchdarkly-js-client-sdk', '@angular/common', '@angular/platform-browser', '@ng-idle/core', '@ng-idle/keepalive', '@angular/router', '@angular/core', 'rxjs', 'rxjs/operators'], factory) :
4
- (factory((global.hmcts = global.hmcts || {}, global.hmcts['rpx-xui-common-lib'] = {}),global.ng.material,global.ng.material.autocomplete,global.ng.forms,global.ng.common.http,global.LDClient,global.ng.common,global.ng.platformBrowser,global.i1$1,global.i2$1,global.ng.router,global.ng.core,global.rxjs,global.rxjs.operators));
5
- }(this, (function (exports,material,autocomplete,forms,i1,LDClient,i4,i2,i1$1,i2$1,i2$2,i0,rxjs,operators) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/material'), require('@angular/material/autocomplete'), require('@angular/common/http'), require('@angular/forms'), require('launchdarkly-js-client-sdk'), require('@angular/common'), require('@angular/platform-browser'), require('@ng-idle/core'), require('@ng-idle/keepalive'), require('@angular/router'), require('@angular/core'), require('rxjs'), require('rxjs/operators')) :
3
+ typeof define === 'function' && define.amd ? define('@hmcts/rpx-xui-common-lib', ['exports', '@angular/material', '@angular/material/autocomplete', '@angular/common/http', '@angular/forms', 'launchdarkly-js-client-sdk', '@angular/common', '@angular/platform-browser', '@ng-idle/core', '@ng-idle/keepalive', '@angular/router', '@angular/core', 'rxjs', 'rxjs/operators'], factory) :
4
+ (factory((global.hmcts = global.hmcts || {}, global.hmcts['rpx-xui-common-lib'] = {}),global.ng.material,global.ng.material.autocomplete,global.ng.common.http,global.ng.forms,global.LDClient,global.ng.common,global.ng.platformBrowser,global.i1$1,global.i2$1,global.ng.router,global.ng.core,global.rxjs,global.rxjs.operators));
5
+ }(this, (function (exports,material,autocomplete,i1,forms,LDClient,i4,i2,i1$1,i2$1,i2$2,i0,rxjs,operators) { 'use strict';
6
6
 
7
7
  /**
8
8
  * @fileoverview added by tsickle
@@ -1130,7 +1130,6 @@
1130
1130
  */
1131
1131
  function (values, field) {
1132
1132
  var e_2, _a;
1133
- console.log('updatePersonControls', values, field);
1134
1133
  /** @type {?} */
1135
1134
  var keys;
1136
1135
  if (!values) {
@@ -3745,6 +3744,30 @@
3745
3744
  function (serviceIds, locationType, searchTerm) {
3746
3745
  return this.http.get("api/locations/getLocations?serviceIds=" + serviceIds + "&locationType=" + locationType + "&searchTerm=" + searchTerm);
3747
3746
  };
3747
+ /**
3748
+ * @description searchLocations from service Ids/location type/search term
3749
+ * @param serviceIds: BBA3 | BBA3,BFA1 split with ','
3750
+ * @param locationType: optional | hearing | case_management
3751
+ * @param searchTerm: any search term for postcode | site name | venue name |court name | court address etc.
3752
+ * @return Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
3753
+ */
3754
+ /**
3755
+ * \@description searchLocations from service Ids/location type/search term
3756
+ * @param {?} serviceIds
3757
+ * @param {?} locationType
3758
+ * @param {?} searchTerm
3759
+ * @return {?} Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
3760
+ */
3761
+ LocationService.prototype.searchLocations = /**
3762
+ * \@description searchLocations from service Ids/location type/search term
3763
+ * @param {?} serviceIds
3764
+ * @param {?} locationType
3765
+ * @param {?} searchTerm
3766
+ * @return {?} Observable<LocationByEPIMMSModel[]>: Array of locationModel in Observable
3767
+ */
3768
+ function (serviceIds, locationType, searchTerm) {
3769
+ return this.http.get("api/prd/location/getLocations?serviceIds=" + serviceIds + "&locationType=" + locationType + "&searchTerm=" + searchTerm);
3770
+ };
3748
3771
  LocationService.decorators = [
3749
3772
  { type: i0.Injectable, args: [{
3750
3773
  providedIn: 'root'
@@ -3948,7 +3971,7 @@
3948
3971
  SearchLocationComponent.decorators = [
3949
3972
  { type: i0.Component, args: [{
3950
3973
  selector: 'exui-search-location',
3951
- template: "<div class=\"auto-complete-container\">\n <input\n [formControl]=\"form.controls.searchTerm\"\n [matAutocomplete]=\"autoSearchLocation\"\n class=\"govuk-input\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLocation=\"matAutocomplete\">\n <mat-option *ngFor=\"let location of locations\"\n (onSelectionChange)=\"onSelectionChange(location)\">\n {{ location.site_name }}\n </mat-option>\n <mat-option *ngIf=\"!locations.length && showAutocomplete && term && term.length >= this.minSearchCharacters\">No results found</mat-option>\n </mat-autocomplete>\n</div>\n",
3974
+ template: "<div class=\"auto-complete-container\">\n <input\n id=\"inputLocationSearch\"\n [formControl]=\"form.controls.searchTerm\"\n [matAutocomplete]=\"autoSearchLocation\"\n class=\"govuk-input\"\n [attr.disabled]=\"disabled\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLocation=\"matAutocomplete\">\n <mat-option *ngFor=\"let location of locations\"\n (onSelectionChange)=\"onSelectionChange(location)\">\n {{ location.site_name }}\n </mat-option>\n <mat-option *ngIf=\"!locations.length && showAutocomplete && term && term.length >= this.minSearchCharacters\">No results found</mat-option>\n </mat-autocomplete>\n</div>\n",
3952
3975
  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:100%;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{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
3953
3976
  }] }
3954
3977
  ];
@@ -4797,6 +4820,17 @@
4797
4820
  * @return {?}
4798
4821
  */function (person) { return person && person.id !== _this.userId && person.id !== _this.assignedUser; }));
4799
4822
  };
4823
+ /**
4824
+ * @param {?} value
4825
+ * @return {?}
4826
+ */
4827
+ FindAPersonService.prototype.searchJudicial = /**
4828
+ * @param {?} value
4829
+ * @return {?}
4830
+ */
4831
+ function (value) {
4832
+ return this.http.post('api/prd/judicial/getJudicialUsersSearch', { searchString: value });
4833
+ };
4800
4834
  FindAPersonService.caseworkersKey = 'caseworkers';
4801
4835
  FindAPersonService.decorators = [
4802
4836
  { type: i0.Injectable, args: [{
@@ -5011,6 +5045,480 @@
5011
5045
  return FindPersonComponent;
5012
5046
  }());
5013
5047
 
5048
+ /**
5049
+ * @fileoverview added by tsickle
5050
+ * Generated from: lib/components/search-judicials/search-judicials.component.ts
5051
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5052
+ */
5053
+ var SearchJudicialsComponent = /** @class */ (function () {
5054
+ function SearchJudicialsComponent(judicialService, fb) {
5055
+ this.judicialService = judicialService;
5056
+ this.disabled = null;
5057
+ this.selectedJudicials = [];
5058
+ this.submitted = true;
5059
+ this.placeholderContent = '';
5060
+ this.showAutocomplete = false;
5061
+ this.judicialChanged = new i0.EventEmitter();
5062
+ this.idValue = '';
5063
+ this.errorMessage = 'You must select a name';
5064
+ this.minSearchCharacters = 3;
5065
+ this.keyUpSubject$ = new rxjs.Subject();
5066
+ this.searchInProgress = false;
5067
+ this.formGroup = fb.group({
5068
+ formControl: [null],
5069
+ selectedFormControl: [null]
5070
+ });
5071
+ }
5072
+ /**
5073
+ * @return {?}
5074
+ */
5075
+ SearchJudicialsComponent.prototype.ngOnInit = /**
5076
+ * @return {?}
5077
+ */
5078
+ function () {
5079
+ var _this = this;
5080
+ this.displayedJudicials = [];
5081
+ if (this.control) {
5082
+ if (this.formGroup && this.formGroup.controls) {
5083
+ this.formGroup.controls.selectedFormControl = this.control;
5084
+ }
5085
+ }
5086
+ this.keyUpSubject$.pipe(operators.debounceTime(500)).subscribe(( /**
5087
+ * @param {?} searchValue
5088
+ * @return {?}
5089
+ */function (searchValue) { return _this.search(( /** @type {?} */(searchValue))); }));
5090
+ };
5091
+ /**
5092
+ * @return {?}
5093
+ */
5094
+ SearchJudicialsComponent.prototype.onKeyDown = /**
5095
+ * @return {?}
5096
+ */
5097
+ function () {
5098
+ this.judicialChanged.emit();
5099
+ };
5100
+ /**
5101
+ * @param {?} event
5102
+ * @return {?}
5103
+ */
5104
+ SearchJudicialsComponent.prototype.onKeyUp = /**
5105
+ * @param {?} event
5106
+ * @return {?}
5107
+ */
5108
+ function (event) {
5109
+ this.showAutocomplete = false;
5110
+ this.keyUpSubject$.next(event.target.value);
5111
+ };
5112
+ /**
5113
+ * @return {?}
5114
+ */
5115
+ SearchJudicialsComponent.prototype.onFocus = /**
5116
+ * @return {?}
5117
+ */
5118
+ function () {
5119
+ this.showAutocomplete = false;
5120
+ };
5121
+ Object.defineProperty(SearchJudicialsComponent.prototype, "displayedJudicialsDuplicationFiltered", {
5122
+ get: /**
5123
+ * @return {?}
5124
+ */ function () {
5125
+ var _this = this;
5126
+ return this.displayedJudicials.filter(( /**
5127
+ * @param {?} judicial
5128
+ * @return {?}
5129
+ */function (judicial) {
5130
+ return !_this.selectedJudicials.map(( /**
5131
+ * @param {?} selectedJudicial
5132
+ * @return {?}
5133
+ */function (selectedJudicial) { return selectedJudicial.sidam_id; })).includes(judicial.sidam_id);
5134
+ }));
5135
+ },
5136
+ enumerable: true,
5137
+ configurable: true
5138
+ });
5139
+ /**
5140
+ * @param {?} term
5141
+ * @return {?}
5142
+ */
5143
+ SearchJudicialsComponent.prototype.filter = /**
5144
+ * @param {?} term
5145
+ * @return {?}
5146
+ */
5147
+ function (term) {
5148
+ var _this = this;
5149
+ this.searchJudicials(term).pipe(operators.mergeMap(( /**
5150
+ * @param {?} apiData
5151
+ * @return {?}
5152
+ */function (apiData) {
5153
+ /** @type {?} */
5154
+ var apiFilter = apiData.filter(( /**
5155
+ * @param {?} apiJudicial
5156
+ * @return {?}
5157
+ */function (apiJudicial) {
5158
+ return !_this.selectedJudicials.map(( /**
5159
+ * @param {?} selectedJudicial
5160
+ * @return {?}
5161
+ */function (selectedJudicial) { return selectedJudicial.sidam_id; })).includes(apiJudicial.sidam_id);
5162
+ }));
5163
+ _this.displayedJudicials = apiFilter;
5164
+ _this.searchInProgress = false;
5165
+ return apiFilter;
5166
+ }))).subscribe(( /**
5167
+ * @param {?} judicial
5168
+ * @return {?}
5169
+ */function (judicial) {
5170
+ if (term === judicial.known_as) {
5171
+ _this.formGroup.controls.selectedFormControl.setValue(judicial);
5172
+ _this.displayedJudicials = [];
5173
+ _this.judicialChanged.emit(judicial);
5174
+ _this.showAutocomplete = false;
5175
+ }
5176
+ _this.searchInProgress = false;
5177
+ }));
5178
+ };
5179
+ /**
5180
+ * @param {?=} selection
5181
+ * @return {?}
5182
+ */
5183
+ SearchJudicialsComponent.prototype.onSelectionChange = /**
5184
+ * @param {?=} selection
5185
+ * @return {?}
5186
+ */
5187
+ function (selection) {
5188
+ if (this.formGroup.controls.formControl instanceof forms.FormArray) {
5189
+ (( /** @type {?} */(this.formGroup.controls.selectedFormControl))).push(new forms.FormControl(selection.sidam_id));
5190
+ }
5191
+ else {
5192
+ this.formGroup.controls.selectedFormControl.setValue(selection);
5193
+ }
5194
+ this.judicialChanged.emit(selection);
5195
+ };
5196
+ /**
5197
+ * @param {?} currentValue
5198
+ * @return {?}
5199
+ */
5200
+ SearchJudicialsComponent.prototype.search = /**
5201
+ * @param {?} currentValue
5202
+ * @return {?}
5203
+ */
5204
+ function (currentValue) {
5205
+ this.searchInProgress = true;
5206
+ this.showAutocomplete = !!currentValue && (currentValue.length >= this.minSearchCharacters);
5207
+ if (!!currentValue) {
5208
+ this.formGroup.controls.selectedFormControl.markAsDirty();
5209
+ }
5210
+ else {
5211
+ this.formGroup.controls.selectedFormControl.reset();
5212
+ }
5213
+ if (this.showAutocomplete) {
5214
+ this.filter(currentValue);
5215
+ }
5216
+ else {
5217
+ this.searchInProgress = false;
5218
+ }
5219
+ };
5220
+ /**
5221
+ * @param {?} selectedJudicial
5222
+ * @return {?}
5223
+ */
5224
+ SearchJudicialsComponent.prototype.getDisplayName = /**
5225
+ * @param {?} selectedJudicial
5226
+ * @return {?}
5227
+ */
5228
+ function (selectedJudicial) {
5229
+ return selectedJudicial.known_as + " (" + selectedJudicial.email_id + ")";
5230
+ };
5231
+ /**
5232
+ * @param {?} term
5233
+ * @return {?}
5234
+ */
5235
+ SearchJudicialsComponent.prototype.searchJudicials = /**
5236
+ * @param {?} term
5237
+ * @return {?}
5238
+ */
5239
+ function (term) {
5240
+ return this.judicialService.searchJudicial(term);
5241
+ };
5242
+ /**
5243
+ * @return {?}
5244
+ */
5245
+ SearchJudicialsComponent.prototype.getControlValueDisplayText = /**
5246
+ * @return {?}
5247
+ */
5248
+ function () {
5249
+ return this.formGroup && this.formGroup.controls && this.formGroup.controls.selectedFormControl.value ?
5250
+ this.getDisplayName(( /** @type {?} */(this.formGroup.controls.selectedFormControl.value))) : '';
5251
+ };
5252
+ SearchJudicialsComponent.decorators = [
5253
+ { type: i0.Component, args: [{
5254
+ selector: 'xuilib-search-judicials',
5255
+ template: "<div class=\"govuk-form-group\">\n <input id=\"inputSelectPerson{{idValue}}\" [placeholder]=\"placeholderContent\" [formControl]=\"formGroup.controls.formControl\"\n [matAutocomplete]=\"autoComplete\" (keydown)=\"onKeyDown()\" (keyup)=\"onKeyUp($event)\" (focus)=\"onFocus()\"\n class=\"govuk-input\" [attr.disabled]=\"!disabled ? null: disabled\" [value]=\"getControlValueDisplayText()\"\n #inputSelection>\n <mat-autocomplete autoActiveFirstOption #autoComplete=\"matAutocomplete\">\n <mat-option *ngFor=\"let judicial of displayedJudicialsDuplicationFiltered\" class=\"select-option\"\n [value]=\"getDisplayName(judicial)\" (onSelectionChange)=\"onSelectionChange(judicial)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete}\">\n {{ getDisplayName(judicial) }}\n </mat-option>\n <mat-option class=\"select-option\"\n *ngIf=\"!displayedJudicialsDuplicationFiltered?.length && showAutocomplete && !searchInProgress\">\n {{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n</div>\n",
5256
+ styles: [".hide-autocomplete{display:none}.mat-option:hover{background:#2596be}.mat-option.select-option:hover{background:#1d70b8;color:#fff}"]
5257
+ }] }
5258
+ ];
5259
+ /** @nocollapse */
5260
+ SearchJudicialsComponent.ctorParameters = function () {
5261
+ return [
5262
+ { type: FindAPersonService },
5263
+ { type: forms.FormBuilder }
5264
+ ];
5265
+ };
5266
+ SearchJudicialsComponent.propDecorators = {
5267
+ control: [{ type: i0.Input }],
5268
+ disabled: [{ type: i0.Input }],
5269
+ selectedJudicials: [{ type: i0.Input }],
5270
+ submitted: [{ type: i0.Input }],
5271
+ placeholderContent: [{ type: i0.Input }],
5272
+ showAutocomplete: [{ type: i0.Input }],
5273
+ displayedJudicials: [{ type: i0.Input }],
5274
+ judicialChanged: [{ type: i0.Output }],
5275
+ idValue: [{ type: i0.Input }],
5276
+ errorMessage: [{ type: i0.Input }],
5277
+ autoCompleteInputBox: [{ type: i0.ViewChild, args: ['inputSelection', { read: i0.ElementRef },] }]
5278
+ };
5279
+ return SearchJudicialsComponent;
5280
+ }());
5281
+
5282
+ /**
5283
+ * @fileoverview added by tsickle
5284
+ * Generated from: lib/components/search-venue/search-venue.component.ts
5285
+ * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5286
+ */
5287
+ var SearchVenueComponent = /** @class */ (function () {
5288
+ function SearchVenueComponent(locationService, fb) {
5289
+ this.locationService = locationService;
5290
+ this.disabled = null;
5291
+ this.locationType = '';
5292
+ this.serviceIds = '';
5293
+ this.submitted = true;
5294
+ this.showAutocomplete = false;
5295
+ this.locationChanged = new i0.EventEmitter();
5296
+ this.minSearchCharacters = 3;
5297
+ this.keyUpSubject$ = new rxjs.Subject();
5298
+ this.readyAfterContent = false;
5299
+ this.searchInProgress = false;
5300
+ this.findLocationFormGroup = fb.group({
5301
+ findLocationFormControl: [null],
5302
+ locationSelectedFormControl: [null]
5303
+ });
5304
+ this.selectedLocations = [];
5305
+ }
5306
+ /**
5307
+ * @return {?}
5308
+ */
5309
+ SearchVenueComponent.prototype.ngAfterContentInit = /**
5310
+ * @return {?}
5311
+ */
5312
+ function () {
5313
+ this.readyAfterContent = true;
5314
+ };
5315
+ /**
5316
+ * @return {?}
5317
+ */
5318
+ SearchVenueComponent.prototype.ngOnInit = /**
5319
+ * @return {?}
5320
+ */
5321
+ function () {
5322
+ var _this = this;
5323
+ this.displayedLocations = [];
5324
+ if (this.control) {
5325
+ if (this.findLocationFormGroup && this.findLocationFormGroup.controls) {
5326
+ this.findLocationFormGroup.controls.locationSelectedFormControl = this.control;
5327
+ }
5328
+ }
5329
+ this.keyUpSubject$.pipe(operators.debounceTime(500)).subscribe(( /**
5330
+ * @param {?} searchValue
5331
+ * @return {?}
5332
+ */function (searchValue) { return _this.search(( /** @type {?} */(searchValue))); }));
5333
+ };
5334
+ /**
5335
+ * @return {?}
5336
+ */
5337
+ SearchVenueComponent.prototype.onKeyDown = /**
5338
+ * @return {?}
5339
+ */
5340
+ function () {
5341
+ this.locationChanged.emit();
5342
+ };
5343
+ /**
5344
+ * @param {?} event
5345
+ * @return {?}
5346
+ */
5347
+ SearchVenueComponent.prototype.onKeyUp = /**
5348
+ * @param {?} event
5349
+ * @return {?}
5350
+ */
5351
+ function (event) {
5352
+ this.showAutocomplete = false;
5353
+ this.keyUpSubject$.next(event.target.value);
5354
+ };
5355
+ /**
5356
+ * @return {?}
5357
+ */
5358
+ SearchVenueComponent.prototype.onFocus = /**
5359
+ * @return {?}
5360
+ */
5361
+ function () {
5362
+ this.showAutocomplete = false;
5363
+ };
5364
+ Object.defineProperty(SearchVenueComponent.prototype, "displayedLocationsDuplicationFiltered", {
5365
+ get: /**
5366
+ * @return {?}
5367
+ */ function () {
5368
+ var _this = this;
5369
+ return this.displayedLocations.filter(( /**
5370
+ * @param {?} location
5371
+ * @return {?}
5372
+ */function (location) {
5373
+ return !_this.selectedLocations.map(( /**
5374
+ * @param {?} selectedLocation
5375
+ * @return {?}
5376
+ */function (selectedLocation) { return selectedLocation.epimms_id; })).includes(location.epimms_id) && location.court_name;
5377
+ }));
5378
+ },
5379
+ enumerable: true,
5380
+ configurable: true
5381
+ });
5382
+ /**
5383
+ * @param {?} term
5384
+ * @return {?}
5385
+ */
5386
+ SearchVenueComponent.prototype.filter = /**
5387
+ * @param {?} term
5388
+ * @return {?}
5389
+ */
5390
+ function (term) {
5391
+ var _this = this;
5392
+ this.searchLocations(term).pipe(operators.mergeMap(( /**
5393
+ * @param {?} apiData
5394
+ * @return {?}
5395
+ */function (apiData) {
5396
+ /** @type {?} */
5397
+ var apiFilter = apiData.filter(( /**
5398
+ * @param {?} apiLocation
5399
+ * @return {?}
5400
+ */function (apiLocation) {
5401
+ return !_this.selectedLocations.map(( /**
5402
+ * @param {?} selectedLocation
5403
+ * @return {?}
5404
+ */function (selectedLocation) { return selectedLocation.epimms_id; })).includes(apiLocation.epimms_id);
5405
+ }));
5406
+ _this.displayedLocations = apiFilter;
5407
+ _this.searchInProgress = false;
5408
+ return apiFilter;
5409
+ }))).subscribe(( /**
5410
+ * @param {?} location
5411
+ * @return {?}
5412
+ */function (location) {
5413
+ if (term === location.court_name) {
5414
+ _this.findLocationFormGroup.controls.locationSelectedFormControl.setValue(location);
5415
+ _this.displayedLocations = [];
5416
+ _this.locationChanged.emit(location);
5417
+ _this.showAutocomplete = false;
5418
+ }
5419
+ _this.searchInProgress = false;
5420
+ }));
5421
+ };
5422
+ /**
5423
+ * @param {?=} selection
5424
+ * @return {?}
5425
+ */
5426
+ SearchVenueComponent.prototype.onSelectionChange = /**
5427
+ * @param {?=} selection
5428
+ * @return {?}
5429
+ */
5430
+ function (selection) {
5431
+ if (this.findLocationFormGroup.controls.findLocationFormControl instanceof forms.FormArray) {
5432
+ (( /** @type {?} */(this.findLocationFormGroup.controls.locationSelectedFormControl))).push(new forms.FormControl(selection.epimms_id));
5433
+ }
5434
+ else {
5435
+ this.findLocationFormGroup.controls.locationSelectedFormControl.setValue(selection);
5436
+ }
5437
+ this.locationChanged.emit(selection);
5438
+ };
5439
+ /**
5440
+ * @param {?} currentValue
5441
+ * @return {?}
5442
+ */
5443
+ SearchVenueComponent.prototype.search = /**
5444
+ * @param {?} currentValue
5445
+ * @return {?}
5446
+ */
5447
+ function (currentValue) {
5448
+ this.searchInProgress = true;
5449
+ this.showAutocomplete = !!currentValue && (currentValue.length >= this.minSearchCharacters);
5450
+ if (!currentValue || !currentValue.length) {
5451
+ this.findLocationFormGroup.controls.locationSelectedFormControl.markAsPristine();
5452
+ this.findLocationFormGroup.controls.locationSelectedFormControl.reset();
5453
+ }
5454
+ if (this.showAutocomplete) {
5455
+ this.filter(currentValue);
5456
+ }
5457
+ else {
5458
+ this.searchInProgress = false;
5459
+ }
5460
+ };
5461
+ /**
5462
+ * @param {?} selectedLocation
5463
+ * @return {?}
5464
+ */
5465
+ SearchVenueComponent.prototype.getDisplayName = /**
5466
+ * @param {?} selectedLocation
5467
+ * @return {?}
5468
+ */
5469
+ function (selectedLocation) {
5470
+ return selectedLocation.court_name;
5471
+ };
5472
+ /**
5473
+ * @param {?} term
5474
+ * @return {?}
5475
+ */
5476
+ SearchVenueComponent.prototype.searchLocations = /**
5477
+ * @param {?} term
5478
+ * @return {?}
5479
+ */
5480
+ function (term) {
5481
+ return this.locationService.searchLocations(this.serviceIds, this.locationType, term);
5482
+ };
5483
+ /**
5484
+ * @return {?}
5485
+ */
5486
+ SearchVenueComponent.prototype.getControlCourtNameValue = /**
5487
+ * @return {?}
5488
+ */
5489
+ function () {
5490
+ return this.findLocationFormGroup && this.findLocationFormGroup.controls && this.findLocationFormGroup.controls.locationSelectedFormControl.value ?
5491
+ (( /** @type {?} */(this.findLocationFormGroup.controls.locationSelectedFormControl.value))).court_name : '';
5492
+ };
5493
+ SearchVenueComponent.decorators = [
5494
+ { type: i0.Component, args: [{
5495
+ selector: 'xuilib-search-venue',
5496
+ template: "<div class=\"auto-complete-container\">\n <div *ngIf=\"readyAfterContent\" class=\"autocomplete__wrapper\">\n <input\n [formControl]=\"findLocationFormGroup.controls.findLocationFormControl\"\n [matAutocomplete]=\"autoSearchLocation\"\n (keydown)=\"onKeyDown()\"\n (keyup)=\"onKeyUp($event)\"\n (focus)=\"onFocus()\"\n class=\"autocomplete__input autocomplete__input--default search-box\"\n [attr.disabled]=\"!disabled ? null: disabled\"\n [value]=\"getControlCourtNameValue()\"\n #inputSelectedLocation>\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLocation=\"matAutocomplete\">\n <mat-option *ngFor=\"let location of displayedLocationsDuplicationFiltered\"\n [value]=\"getDisplayName(location)\"\n (onSelectionChange)=\"onSelectionChange(location)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete}\">\n {{ getDisplayName(location) }}\n </mat-option>\n <mat-option *ngIf=\"!displayedLocationsDuplicationFiltered?.length && showAutocomplete && !searchInProgress\">{{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n </div>\n</div>\n",
5497
+ styles: [".autocomplete__input{-webkit-appearance:none;border:2px solid #0b0c0c;border-radius:0;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;margin-bottom:0;width:100%;background-color:transparent;position:relative}.autocomplete__hint{color:#b1b4b6;position:absolute}.autocomplete__input--default{padding:5px}.autocomplete__input--focused{outline:#fd0 solid 3px;outline-offset:0;box-shadow:inset 0 0 0 2px}.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:100%;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{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}"]
5498
+ }] }
5499
+ ];
5500
+ /** @nocollapse */
5501
+ SearchVenueComponent.ctorParameters = function () {
5502
+ return [
5503
+ { type: LocationService },
5504
+ { type: forms.FormBuilder }
5505
+ ];
5506
+ };
5507
+ SearchVenueComponent.propDecorators = {
5508
+ control: [{ type: i0.Input }],
5509
+ disabled: [{ type: i0.Input }],
5510
+ locationType: [{ type: i0.Input }],
5511
+ selectedLocations: [{ type: i0.Input }],
5512
+ serviceIds: [{ type: i0.Input }],
5513
+ submitted: [{ type: i0.Input }],
5514
+ autoCompleteInputBox: [{ type: i0.ViewChild, args: ['inputSelectedLocation', { read: i0.ElementRef },] }],
5515
+ showAutocomplete: [{ type: i0.Input }],
5516
+ displayedLocations: [{ type: i0.Input }],
5517
+ locationChanged: [{ type: i0.Output }]
5518
+ };
5519
+ return SearchVenueComponent;
5520
+ }());
5521
+
5014
5522
  /**
5015
5523
  * @fileoverview added by tsickle
5016
5524
  * Generated from: lib/gov-ui/components/gov-uk-checkbox/gov-uk-checkbox.component.ts
@@ -6046,8 +6554,10 @@
6046
6554
  GenericFilterComponent,
6047
6555
  CookieBannerComponent,
6048
6556
  FindPersonComponent,
6557
+ SearchJudicialsComponent,
6049
6558
  FindLocationComponent,
6050
6559
  SearchLocationComponent,
6560
+ SearchVenueComponent,
6051
6561
  PaginationComponent
6052
6562
  ];
6053
6563
  /** @type {?} */
@@ -7165,15 +7675,17 @@
7165
7675
  exports.ɵbf = CookieBannerComponent;
7166
7676
  exports.ɵy = DueDateComponent;
7167
7677
  exports.ɵa = ExuiPageWrapperComponent;
7168
- exports.ɵbk = FindLocationComponent;
7678
+ exports.ɵbl = FindLocationComponent;
7169
7679
  exports.ɵbh = FindPersonComponent;
7170
7680
  exports.ɵbd = GenericFilterComponent;
7171
7681
  exports.ɵk = HmctsSessionDialogComponent;
7172
7682
  exports.ɵo = InviteUserFormComponent;
7173
7683
  exports.ɵn = InviteUserPermissionComponent;
7174
7684
  exports.ɵbc = LoadingSpinnerComponent;
7175
- exports.ɵbn = PaginationComponent;
7176
- exports.ɵbl = SearchLocationComponent;
7685
+ exports.ɵbp = PaginationComponent;
7686
+ exports.ɵbk = SearchJudicialsComponent;
7687
+ exports.ɵbm = SearchLocationComponent;
7688
+ exports.ɵbo = SearchVenueComponent;
7177
7689
  exports.ɵv = SelectedCaseConfirmComponent;
7178
7690
  exports.ɵt = SelectedCaseListComponent;
7179
7691
  exports.ɵu = SelectedCaseComponent;
@@ -7192,33 +7704,33 @@
7192
7704
  exports.ɵg = FeatureToggleDirective;
7193
7705
  exports.ɵi = LetContext;
7194
7706
  exports.ɵj = LetDirective;
7195
- exports.ɵbw = GovUkCheckboxComponent;
7196
- exports.ɵcc = GovUkCheckboxesComponent;
7197
- exports.ɵcb = GovUkDateComponent;
7198
- exports.ɵbz = GovUkErrorMessageComponent;
7199
- exports.ɵca = GovUkFieldsetComponent;
7200
- exports.ɵch = GovUkFileUploadComponent;
7201
- exports.ɵbx = GovUkFormGroupWrapperComponent;
7202
- exports.ɵbv = GovUkInputComponent;
7203
- exports.ɵby = GovUkLabelComponent;
7204
- exports.ɵcd = GovUkRadioComponent;
7205
- exports.ɵce = GovUkRadiosComponent;
7206
- exports.ɵcf = GovUkSelectComponent;
7207
- exports.ɵbu = GovukTableComponent;
7208
- exports.ɵcg = GovUkTextareaComponent;
7209
- exports.ɵbt = HmctsBannerComponent;
7210
- exports.ɵbr = HmctsErrorSummaryComponent;
7211
- exports.ɵbo = HmctsIdentityBarComponent;
7212
- exports.ɵbs = HmctsMainWrapperComponent;
7213
- exports.ɵbq = HmctsPrimaryNavigationComponent;
7214
- exports.ɵbp = HmctsSubNavigationComponent;
7215
- exports.ɵci = RemoveHostDirective;
7707
+ exports.ɵby = GovUkCheckboxComponent;
7708
+ exports.ɵce = GovUkCheckboxesComponent;
7709
+ exports.ɵcd = GovUkDateComponent;
7710
+ exports.ɵcb = GovUkErrorMessageComponent;
7711
+ exports.ɵcc = GovUkFieldsetComponent;
7712
+ exports.ɵcj = GovUkFileUploadComponent;
7713
+ exports.ɵbz = GovUkFormGroupWrapperComponent;
7714
+ exports.ɵbx = GovUkInputComponent;
7715
+ exports.ɵca = GovUkLabelComponent;
7716
+ exports.ɵcf = GovUkRadioComponent;
7717
+ exports.ɵcg = GovUkRadiosComponent;
7718
+ exports.ɵch = GovUkSelectComponent;
7719
+ exports.ɵbw = GovukTableComponent;
7720
+ exports.ɵci = GovUkTextareaComponent;
7721
+ exports.ɵbv = HmctsBannerComponent;
7722
+ exports.ɵbt = HmctsErrorSummaryComponent;
7723
+ exports.ɵbq = HmctsIdentityBarComponent;
7724
+ exports.ɵbu = HmctsMainWrapperComponent;
7725
+ exports.ɵbs = HmctsPrimaryNavigationComponent;
7726
+ exports.ɵbr = HmctsSubNavigationComponent;
7727
+ exports.ɵck = RemoveHostDirective;
7216
7728
  exports.ɵr = CaseSharingStateService;
7217
7729
  exports.ɵbg = CookieService;
7218
7730
  exports.ɵh = FeatureToggleService;
7219
7731
  exports.ɵbe = FilterService;
7220
7732
  exports.ɵbi = FindAPersonService;
7221
- exports.ɵbm = LocationService;
7733
+ exports.ɵbn = LocationService;
7222
7734
  exports.ɵbj = SessionStorageService;
7223
7735
 
7224
7736
  Object.defineProperty(exports, '__esModule', { value: true });