@elderbyte/ngx-starter 13.7.7 → 13.7.8

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.
@@ -21077,6 +21077,7 @@ class ElderSelectComponent extends ElderSelectBase {
21077
21077
  ElderSelectFirstUtil.trySelectFirst(this);
21078
21078
  }
21079
21079
  updateValueByEntity(entity) {
21080
+ this._entity$.next(entity);
21080
21081
  this.updateValue(this.entityToValue(entity));
21081
21082
  }
21082
21083
  /***************************************************************************
@@ -21188,22 +21189,6 @@ class ElderSelectComponent extends ElderSelectBase {
21188
21189
  }
21189
21190
  super.writeToControl(value);
21190
21191
  }
21191
- /**
21192
- * @description
21193
- * Writes a new value to the element.
21194
- *
21195
- * This method is called by the forms API to write to the view when programmatic
21196
- * changes from model to view are requested.
21197
- *
21198
- * @param value The new value for the element
21199
- */
21200
- writeValue(value) {
21201
- // this.logger.debug('ElderSelectBase.writeValue(): Current value-id ' + this._valueId + ', new value: ', value);
21202
- super.writeValue(value);
21203
- }
21204
- isNullOrEmpty(value) {
21205
- return (value == null || value === '');
21206
- }
21207
21192
  }
21208
21193
  ElderSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ElderSelectComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
21209
21194
  ElderSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: ElderSelectComponent, selector: "elder-select", inputs: { nullDisplay: "nullDisplay", autocomplete: "autocomplete", allowNull: "allowNull", entity: "entity", entityId: "entityId", hintProperty: "hintProperty", hintPropertyResolver: "hintPropertyResolver" }, outputs: { entityIdChange: "entityIdChange", entityIdUpdated: "entityIdUpdated", entityChange: "entityChange", entityUpdated: "entityUpdated" }, providers: [
@@ -21314,13 +21299,22 @@ class ElderMultiSelectBase extends ElderSelectBase {
21314
21299
  this.entities$ = new BehaviorSubject([]);
21315
21300
  this.entityIdsChange = this.valueChange.pipe(map(values => this.entityIdsFromValues(values)));
21316
21301
  this.entityIdsUpdated = this.valueUpdated.pipe(map(values => this.entityIdsFromValues(values)));
21317
- this.entitiesUpdated = this.entityIdsUpdated.pipe(switchMap(entityId => this.awaitEntitiesWithId(entityId, this.timeoutAfterMs)), catchError(err => {
21302
+ this.entitiesUpdated = this.entityIdsUpdated.pipe(tap(entityIds => this.logger.debug('Awaiting entities with ids', entityIds)), switchMap(entityIds => this.awaitEntitiesWithId(entityIds, this.timeoutAfterMs)), catchError(err => {
21318
21303
  this.logger.warn(`awaitEntitiesWithId -> timed out after: ${this.timeoutAfterMs}`, err);
21319
21304
  return EMPTY;
21320
21305
  }));
21321
21306
  }
21322
21307
  awaitEntitiesWithId(entityIds, timeoutMs) {
21323
- return this.entities$.pipe(filter(entities => this.equalIds(this.getEntityIds(entities), entityIds)), take(1), timeout(timeoutMs));
21308
+ return this.entities$.pipe(tap(entities => this.logger.debug('Got entities for ids' + entityIds, entities)), filter(entities => this.equalIds(this.getEntityIds(entities), entityIds)), take(1), timeout(timeoutMs));
21309
+ }
21310
+ /***************************************************************************
21311
+ * *
21312
+ * Properties *
21313
+ * *
21314
+ **************************************************************************/
21315
+ updateValueByEntities(entities) {
21316
+ this.entities$.next(entities);
21317
+ this.updateValue(this.entitiesToValues(entities));
21324
21318
  }
21325
21319
  /***************************************************************************
21326
21320
  * *
@@ -21612,7 +21606,7 @@ class ElderMultiSelectChipsComponent extends ElderMultiSelectBase {
21612
21606
  }
21613
21607
  addLabels(labels) {
21614
21608
  const current = this.entities ? this.entities : [];
21615
- this.entities = [...current, ...labels];
21609
+ this.updateValueByEntities([...current, ...labels]);
21616
21610
  }
21617
21611
  addLabel(label) {
21618
21612
  this.addLabels([label]);
@@ -21620,7 +21614,7 @@ class ElderMultiSelectChipsComponent extends ElderMultiSelectBase {
21620
21614
  removeLabel(toRemove) {
21621
21615
  const remaining = this.entities
21622
21616
  .filter(l => !this.isEqual(l, toRemove));
21623
- this.entities = remaining;
21617
+ this.updateValueByEntities(remaining);
21624
21618
  }
21625
21619
  /***************************************************************************
21626
21620
  * *