@sumaris-net/ngx-components 1.23.55 → 1.23.57

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.
@@ -12179,7 +12179,7 @@ class EntityStore {
12179
12179
  constructor(name, storage, policy) {
12180
12180
  this.name = name;
12181
12181
  this.storage = storage;
12182
- this._onChange = new BehaviorSubject(false);
12182
+ this._onChange = new BehaviorSubject(true);
12183
12183
  this._dirty = false;
12184
12184
  this.policy = policy || {};
12185
12185
  this.reset({ emitEvent: false });
@@ -12232,9 +12232,7 @@ class EntityStore {
12232
12232
  console.warn('[entity-store] WARN: Watching full entities, splited by id in entity store. This can be long! Please make sure you need full entities here.');
12233
12233
  return this._onChange
12234
12234
  .pipe(
12235
- // Wait data loaded
12236
- filter(_ => this._loaded),
12237
- // Apply filter and sort
12235
+ // Apply filter on cache
12238
12236
  map((_) => this.reduceAndSort(this._cache, variables)),
12239
12237
  // Then convert into full entities (using parallel jobs - /!\ can use lot of memory)
12240
12238
  mergeMap((res) => Promise.all((res.data || [])
@@ -12245,11 +12243,7 @@ class EntityStore {
12245
12243
  }
12246
12244
  // Load using entities array
12247
12245
  return this._onChange
12248
- .pipe(
12249
- // Wait data loaded
12250
- filter(_ => this._loaded),
12251
- // Apply filter and sort
12252
- map((_) => this.reduceAndSort(this._cache, variables)));
12246
+ .pipe(map((_) => this.reduceAndSort(this._cache, variables)));
12253
12247
  }
12254
12248
  /**
12255
12249
  * WIll apply a filter, then a sort, then a page slice
@@ -12306,7 +12300,7 @@ class EntityStore {
12306
12300
  let result;
12307
12301
  console.info(`[entity-storage] Saving ${entities.length} ${this.name}(s)`);
12308
12302
  // First save, or reset using given entities
12309
- if (!this._loaded || !this._cache || (opts === null || opts === void 0 ? void 0 : opts.reset)) {
12303
+ if (isEmptyArray(this._cache) || (opts && opts.reset)) {
12310
12304
  this.setEntities(entities, { emitEvent: false });
12311
12305
  }
12312
12306
  else {
@@ -23471,6 +23465,8 @@ class AppTable {
23471
23465
  }
23472
23466
  confirmAndForward(event, row) {
23473
23467
  var _a;
23468
+ if (!this.inlineEdition)
23469
+ return false;
23474
23470
  row = row || this.editedRow;
23475
23471
  if (!this.confirmEditCreate(event, row)) {
23476
23472
  // If pending: Wait end of validation, then loop
@@ -23955,7 +23951,7 @@ class AppTable {
23955
23951
  }
23956
23952
  /* -- protected method -- */
23957
23953
  editRow(event, row, opts) {
23958
- if (!this._enabled)
23954
+ if (!this._enabled || !this.inlineEdition)
23959
23955
  return false;
23960
23956
  if (this.editedRow === row)
23961
23957
  return true; // Already the edited row
@@ -24244,7 +24240,8 @@ class AppTable {
24244
24240
  console.warn('[table] Cannot add new row, because the previous edited row cannot be confirmed');
24245
24241
  return undefined;
24246
24242
  }
24247
- const row = yield this._dataSource.createNew(insertAt, { editing: opts === null || opts === void 0 ? void 0 : opts.editing });
24243
+ const editing = this.inlineEdition && (!opts || opts.editing !== false); // true by default, if inlineEdition
24244
+ const row = yield this._dataSource.createNew(insertAt, { editing });
24248
24245
  if (!row)
24249
24246
  return undefined;
24250
24247
  if (row.editing) {