@hmcts/rpx-xui-common-lib 1.5.4-judge-selection → 1.5.5-autocomplete-error

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3647,12 +3647,22 @@
3647
3647
  this.locationChanged = new i0.EventEmitter();
3648
3648
  this.minSearchCharacters = 3;
3649
3649
  this.keyUpSubject$ = new rxjs.Subject();
3650
+ this.readyAfterContent = false;
3650
3651
  this.findLocationFormGroup = fb.group({
3651
3652
  findLocationFormControl: [null],
3652
3653
  locationSelectedFormControl: [null]
3653
3654
  });
3654
3655
  this.selectedLocations$ = rxjs.of([]);
3655
3656
  }
3657
+ /**
3658
+ * @return {?}
3659
+ */
3660
+ SearchLocationComponent.prototype.ngAfterContentInit = /**
3661
+ * @return {?}
3662
+ */
3663
+ function () {
3664
+ this.readyAfterContent = true;
3665
+ };
3656
3666
  /**
3657
3667
  * @return {?}
3658
3668
  */
@@ -3826,7 +3836,7 @@
3826
3836
  SearchLocationComponent.decorators = [
3827
3837
  { type: i0.Component, args: [{
3828
3838
  selector: 'exui-search-location',
3829
- template: "<div class=\"auto-complete-container\">\n <div class=\"autocomplete__wrapper\">\n <input\n [formControl]=\"findLocationFormGroup.controls.findLocationFormControl\"\n [matAutocomplete]=\"auto\"\n (keydown)=\"onKeyDown()\"\n (keyup)=\"onKeyUp($event)\"\n aria-expanded=\"false\"\n aria-owns=\"input-selected-location__listbox\"\n aria-autocomplete=\"both\"\n autocomplete=\"off\"\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 #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let location of locationSource$ | async\"\n [value]=\"getDisplayName(location)\"\n (onSelectionChange)=\"onSelectionChange(location)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete}\">\n {{ getDisplayName(location) }}\n </mat-option>\n <mat-option *ngIf=\"!(locationSource$ | async)?.length && showAutocomplete\">{{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n </div>\n</div>",
3839
+ 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 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 locationSource$ | async\"\n [value]=\"getDisplayName(location)\"\n (onSelectionChange)=\"onSelectionChange(location)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete}\">\n {{ getDisplayName(location) }}\n </mat-option>\n <mat-option *ngIf=\"!(locationSource$ | async)?.length && showAutocomplete\">{{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n </div>\n</div>",
3830
3840
  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}"]
3831
3841
  }] }
3832
3842
  ];
@@ -4376,9 +4386,7 @@
4376
4386
  this.placeholderContent = '';
4377
4387
  this.isNoResultsShown = false;
4378
4388
  this.showUpdatedColor = false;
4379
- this.selectedPersons = [];
4380
4389
  this.showAutocomplete = false;
4381
- this.currentInputValue = '';
4382
4390
  this.findPersonControl = new forms.FormControl();
4383
4391
  this.minSearchCharacters = 2;
4384
4392
  }
@@ -4417,9 +4425,6 @@
4417
4425
  this.findPersonControl.setValue(null);
4418
4426
  this.selectedPerson = null;
4419
4427
  }
4420
- if (changes['selectedPerson'] && changes['selectedPerson'].currentValue === '') {
4421
- this.currentInputValue = '';
4422
- }
4423
4428
  };
4424
4429
  /**
4425
4430
  * @param {?} searchTerm
@@ -4430,7 +4435,6 @@
4430
4435
  * @return {?}
4431
4436
  */
4432
4437
  function (searchTerm) {
4433
- var _this = this;
4434
4438
  /** @type {?} */
4435
4439
  var findJudicialPeople = this.findPersonService.find({ searchTerm: searchTerm, jurisdiction: this.domain });
4436
4440
  /** @type {?} */
@@ -4438,26 +4442,7 @@
4438
4442
  if (searchTerm && searchTerm.length > this.minSearchCharacters) {
4439
4443
  switch (this.domain) {
4440
4444
  case PersonRole.JUDICIAL: {
4441
- return findJudicialPeople.pipe(operators.map(( /**
4442
- * @param {?} persons
4443
- * @return {?}
4444
- */function (persons) {
4445
- /** @type {?} */
4446
- var ids = _this.selectedPersons.map(( /**
4447
- * @param {?} __0
4448
- * @return {?}
4449
- */function (_a) {
4450
- var id = _a.id;
4451
- return id;
4452
- }));
4453
- return persons.filter(( /**
4454
- * @param {?} __0
4455
- * @return {?}
4456
- */function (_a) {
4457
- var id = _a.id;
4458
- return !ids.includes(id);
4459
- }));
4460
- })));
4445
+ return findJudicialPeople;
4461
4446
  }
4462
4447
  case PersonRole.ALL: {
4463
4448
  return rxjs.zip(findJudicialPeople, findCaseworkersOrAdmins).pipe(operators.map(( /**
@@ -4496,7 +4481,6 @@
4496
4481
  * @return {?}
4497
4482
  */
4498
4483
  function (currentValue) {
4499
- this.currentInputValue = currentValue;
4500
4484
  this.showAutocomplete = !!currentValue && (currentValue.length > this.minSearchCharacters);
4501
4485
  };
4502
4486
  /**
@@ -4516,7 +4500,7 @@
4516
4500
  FindPersonComponent.decorators = [
4517
4501
  { type: i0.Component, args: [{
4518
4502
  selector: 'xuilib-find-person',
4519
- 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]=\"findPersonGroup\"\n [ngClass]=\"{'form-group-error': !findPersonGroup.valid && 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=\"findPersonGroup && findPersonGroup.errors\">\n <span class=\"govuk-visually-hidden\">Error:</span>You must select a name\n </span>\n <input id=\"inputSelectPerson\" type=\"text\" aria-label=\"select a person\" matInput\n formControlName=\"findPersonControl\"\n [matAutocomplete]=\"auto\"\n class=\"govuk-input govuk-!-width-one-third\"\n (ngModelChange)=\"updatedVal($event)\"\n [placeholder]=\"placeholderContent\"\n [attr.disabled]=\"disabled\"\n [value]=\"selectedPerson\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of filteredOptions | async\"\n [value]=\"getDisplayName(option)\"\n (onSelectionChange)=\"onSelectionChange(option)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete, 'select-option': showUpdatedColor}\">\n {{getDisplayName(option)}}\n </mat-option>\n <mat-option [ngClass]=\"{'select-option': showUpdatedColor}\" *ngIf=\"isNoResultsShown && currentInputValue.length && !(filteredOptions | async)?.length && showAutocomplete\">{{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n </fieldset>\n</div>\n",
4503
+ 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]=\"findPersonGroup\"\n [ngClass]=\"{'form-group-error': !findPersonGroup.valid && 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=\"findPersonGroup && findPersonGroup.errors\">\n <span class=\"govuk-visually-hidden\">Error:</span>You must select a name\n </span>\n <input id=\"inputSelectPerson\" type=\"text\" aria-label=\"select a person\" matInput\n formControlName=\"findPersonControl\"\n [matAutocomplete]=\"auto\"\n class=\"govuk-input govuk-!-width-one-third\"\n (ngModelChange)=\"updatedVal($event)\"\n [placeholder]=\"placeholderContent\"\n [attr.disabled]=\"disabled\"\n [value]=\"selectedPerson\">\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n <mat-option *ngFor=\"let option of filteredOptions | async\"\n [value]=\"getDisplayName(option)\"\n (onSelectionChange)=\"onSelectionChange(option)\"\n [ngClass]=\"{'hide-autocomplete': !showAutocomplete, 'select-option': showUpdatedColor}\">\n {{getDisplayName(option)}}\n </mat-option>\n <mat-option [ngClass]=\"{'select-option': showUpdatedColor}\" *ngIf=\"isNoResultsShown && !(filteredOptions | async)?.length && showAutocomplete\">{{ 'No results found' }}</mat-option>\n </mat-autocomplete>\n </fieldset>\n</div>\n",
4520
4504
  styles: [".mat-option:hover{background:#2596be}.mat-option.select-option:hover{background:#1d70b8;color:#fff}.hide-autocomplete{display:none}"]
4521
4505
  }] }
4522
4506
  ];
@@ -4539,8 +4523,7 @@
4539
4523
  userIncluded: [{ type: i0.Input }],
4540
4524
  placeholderContent: [{ type: i0.Input }],
4541
4525
  isNoResultsShown: [{ type: i0.Input }],
4542
- showUpdatedColor: [{ type: i0.Input }],
4543
- selectedPersons: [{ type: i0.Input }]
4526
+ showUpdatedColor: [{ type: i0.Input }]
4544
4527
  };
4545
4528
  return FindPersonComponent;
4546
4529
  }());