novo-elements 5.2.10 → 5.5.1

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.
@@ -6305,6 +6305,7 @@ class MixedMultiPickerResults extends BasePickerResults {
6305
6305
  this.renderer = renderer;
6306
6306
  this.labels = labels;
6307
6307
  this.placeholder = '';
6308
+ this.emptyOptionsLabel = '';
6308
6309
  this.internalMap = new Map();
6309
6310
  }
6310
6311
  set term(value) {
@@ -6324,6 +6325,13 @@ class MixedMultiPickerResults extends BasePickerResults {
6324
6325
  if (this.keyboardSubscription) {
6325
6326
  this.keyboardSubscription.unsubscribe();
6326
6327
  }
6328
+ if (this.config.options) {
6329
+ this.config.options.forEach(option => {
6330
+ if (option.clearSecondaryOptions) {
6331
+ option.clearSecondaryOptions.unsubscribe();
6332
+ }
6333
+ });
6334
+ }
6327
6335
  }
6328
6336
  selectPrimaryOption(primaryOption, event) {
6329
6337
  if (this.keyboardSubscription) {
@@ -6372,6 +6380,18 @@ class MixedMultiPickerResults extends BasePickerResults {
6372
6380
  shouldShowSearchBox(primaryOption) {
6373
6381
  return !!(primaryOption && primaryOption.showSearchOnSecondaryOptions);
6374
6382
  }
6383
+ clearPrimaryOption(primaryOption) {
6384
+ var _a;
6385
+ if (this.internalMap.get(primaryOption.value)) {
6386
+ if (primaryOption.value === ((_a = this.selectedPrimaryOption) === null || _a === void 0 ? void 0 : _a.value)) {
6387
+ this.activeMatch = null;
6388
+ this.matches = [];
6389
+ this.selectedPrimaryOption = null;
6390
+ }
6391
+ this.internalMap.delete(primaryOption.value);
6392
+ this.ref.markForCheck();
6393
+ }
6394
+ }
6375
6395
  filterData() {
6376
6396
  if (this.selectedPrimaryOption) {
6377
6397
  if (this.selectedPrimaryOption.secondaryOptions) {
@@ -6414,6 +6434,11 @@ class MixedMultiPickerResults extends BasePickerResults {
6414
6434
  this.inputElement.nativeElement.focus();
6415
6435
  });
6416
6436
  });
6437
+ if (primaryOption.clearSecondaryOptions) {
6438
+ primaryOption.clearSecondaryOptions.subscribe(() => {
6439
+ this.clearPrimaryOption(primaryOption);
6440
+ });
6441
+ }
6417
6442
  }
6418
6443
  else {
6419
6444
  this.matches = this.filter(this.internalMap.get(primaryOption.value).items);
@@ -6465,7 +6490,7 @@ MixedMultiPickerResults.decorators = [
6465
6490
  </novo-list-item>
6466
6491
  </novo-list>
6467
6492
  <div class="mixed-multi-picker-no-results" *ngIf="matches.length === 0 && !isLoading && selectedPrimaryOption" data-automation-id="empty-message">
6468
- {{ labels.groupedMultiPickerEmpty }}
6493
+ {{ config.emptyOptionsLabel ? config.emptyOptionsLabel : labels.groupedMultiPickerEmpty }}
6469
6494
  </div>
6470
6495
  <div class="mixed-multi-picker-loading" *ngIf="isLoading" data-automation-id="loading-message">
6471
6496
  <novo-loading theme="line"></novo-loading>
@@ -31302,6 +31327,7 @@ class ControlConfig {
31302
31327
  constructor() {
31303
31328
  this.isEmbedded = false;
31304
31329
  this.isInlineEmbedded = false;
31330
+ this.highlighted = false;
31305
31331
  }
31306
31332
  }
31307
31333
  class BaseControl extends ControlConfig {
@@ -31346,6 +31372,7 @@ class BaseControl extends ControlConfig {
31346
31372
  this.startDate = config.startDate;
31347
31373
  this.endDate = config.endDate;
31348
31374
  this.restrictFieldInteractions = !!config.restrictFieldInteractions;
31375
+ this.highlighted = !!config.highlighted;
31349
31376
  if (!Helpers.isEmpty(config.warning)) {
31350
31377
  this.warning = config.warning;
31351
31378
  }
@@ -32595,7 +32622,7 @@ class FormUtils {
32595
32622
  else if (field.dataSpecialization === 'ALL_WORKFLOW_OPTIONS' && field.options) {
32596
32623
  return field.options;
32597
32624
  }
32598
- else if (field.workflowOptions && fieldData) {
32625
+ else if (field.workflowOptions) {
32599
32626
  return this.getWorkflowOptions(field.workflowOptions, fieldData);
32600
32627
  }
32601
32628
  else if (field.dataSpecialization === 'SPECIALIZED_OPTIONS' ||
@@ -32619,12 +32646,14 @@ class FormUtils {
32619
32646
  return null;
32620
32647
  }
32621
32648
  getWorkflowOptions(workflowOptions, fieldData) {
32622
- let currentValue;
32623
- if (fieldData.id) {
32649
+ let currentValue = null;
32650
+ let currentWorkflowOption = 'initial';
32651
+ if (fieldData === null || fieldData === void 0 ? void 0 : fieldData.id) {
32624
32652
  currentValue = { value: fieldData.id, label: fieldData.label ? fieldData.label : fieldData.id };
32653
+ currentWorkflowOption = fieldData.id;
32625
32654
  }
32626
- const currentWorkflowOption = fieldData.id ? fieldData.id : 'initial';
32627
32655
  const updateWorkflowOptions = workflowOptions[currentWorkflowOption] || [];
32656
+ // Ensure that the current value is added to the beginning of the options list
32628
32657
  if (currentValue && !updateWorkflowOptions.find((option) => option.value === currentValue.value)) {
32629
32658
  updateWorkflowOptions.unshift(currentValue);
32630
32659
  }
@@ -33401,6 +33430,13 @@ class FieldInteractionApi {
33401
33430
  this.triggerEvent({ controlKey: key, prop: 'required', value: required }, otherForm);
33402
33431
  }
33403
33432
  }
33433
+ highlight(key, isHighlighted, otherForm) {
33434
+ const control = this.getControl(key, otherForm);
33435
+ if (control && !control.restrictFieldInteractions) {
33436
+ control.highlighted = isHighlighted;
33437
+ this.triggerEvent({ controlKey: key, prop: 'highlight', value: isHighlighted }, otherForm);
33438
+ }
33439
+ }
33404
33440
  hide(key, clearValue = true, otherForm) {
33405
33441
  const control = this.getControl(key, otherForm);
33406
33442
  if (control && !control.restrictFieldInteractions) {
@@ -33619,9 +33655,9 @@ class FieldInteractionApi {
33619
33655
  removeStaticOption(key, optionToRemove, otherForm) {
33620
33656
  const control = this.getControl(key, otherForm);
33621
33657
  if (control && !control.restrictFieldInteractions) {
33622
- let currentOptions = this.getProperty(key, 'options');
33658
+ let currentOptions = this.getProperty(key, 'options', otherForm);
33623
33659
  if (!currentOptions || !currentOptions.length) {
33624
- const config = this.getProperty(key, 'config');
33660
+ const config = this.getProperty(key, 'config', otherForm);
33625
33661
  if (config) {
33626
33662
  currentOptions = config.options;
33627
33663
  if (currentOptions && Array.isArray(currentOptions)) {
@@ -33642,7 +33678,7 @@ class FieldInteractionApi {
33642
33678
  currentOptions.splice(index, 1);
33643
33679
  }
33644
33680
  config.options = [...currentOptions];
33645
- this.setProperty(key, 'config', config);
33681
+ this.setProperty(key, 'config', config, otherForm);
33646
33682
  }
33647
33683
  }
33648
33684
  }
@@ -33663,7 +33699,7 @@ class FieldInteractionApi {
33663
33699
  if (index !== -1) {
33664
33700
  currentOptions.splice(index, 1);
33665
33701
  }
33666
- this.setProperty(key, 'options', [...currentOptions]);
33702
+ this.setProperty(key, 'options', [...currentOptions], otherForm);
33667
33703
  }
33668
33704
  this.triggerEvent({ controlKey: key, prop: 'options', value: control.options }, otherForm);
33669
33705
  }
@@ -34429,7 +34465,7 @@ NovoControlElement.decorators = [
34429
34465
  [ngClass]="{'bhi-circle': !isValid, 'bhi-check': isValid}" *ngIf="!condensed || form.controls[control.key].required">
34430
34466
  </i>
34431
34467
  <!--Form Controls-->
34432
- <div class="novo-control-input {{ form.controls[control.key].controlType }}" [attr.data-automation-id]="control.key" [class.control-disabled]="form.controls[control.key].disabled">
34468
+ <div class="novo-control-input {{ form.controls[control.key].controlType }}" [attr.data-automation-id]="control.key" [class.control-disabled]="form.controls[control.key].disabled" [class.highlighted]="form.controls[control.key].highlighted">
34433
34469
  <!--TODO prefix/suffix on the control-->
34434
34470
  <ng-container *ngIf="templates">
34435
34471
  <ng-container *ngTemplateOutlet="templates[form.controls[control.key].controlType]; context: templateContext"></ng-container>
@@ -34636,8 +34672,6 @@ class NovoControlGroup {
34636
34672
  }
34637
34673
  else {
34638
34674
  this.form.addControl(this.key, this.fb.array([nestedFormGroup]));
34639
- // Ensure that field interaction changes for nested forms originating from outside the form will be reflected in the nested elements
34640
- nestedFormGroup.fieldInteractionEvents.subscribe(this.onFieldInteractionEvent.bind(this));
34641
34675
  }
34642
34676
  this.disabledArray.push({
34643
34677
  edit: true,
@@ -34649,6 +34683,8 @@ class NovoControlGroup {
34649
34683
  }
34650
34684
  this.currentIndex++;
34651
34685
  this.assignIndexes();
34686
+ // Ensure that field interaction changes for nested forms originating from outside the form will be reflected in the nested elements
34687
+ nestedFormGroup.fieldInteractionEvents.subscribe(this.onFieldInteractionEvent.bind(this));
34652
34688
  this.ref.markForCheck();
34653
34689
  }
34654
34690
  /**