@yourself.create/ngx-form-designer 0.0.6 → 0.0.7

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.
@@ -31946,20 +31946,20 @@ class DefaultDataProvider extends DataProvider {
31946
31946
  }
31947
31947
  async getValue(field, engine) {
31948
31948
  const cfg = getEffectiveDataConfig(field);
31949
+ const currentValue = this.getCurrentFieldValue(field, engine);
31949
31950
  if (cfg.type === 'static') {
31950
31951
  if (cfg.staticValue !== undefined)
31951
31952
  return cfg.staticValue;
31952
- return field.defaultValue;
31953
+ return currentValue !== undefined ? currentValue : field.defaultValue;
31953
31954
  }
31954
31955
  let rows = await this.getRawRows(cfg, field, engine);
31955
31956
  rows = this.resolveCollectionRows(rows, cfg, engine);
31956
31957
  rows = this.applyRowFilters(rows, cfg.filters, engine);
31957
31958
  if (!rows || rows.length === 0) {
31958
- return field.defaultValue;
31959
+ return currentValue !== undefined ? currentValue : field.defaultValue;
31959
31960
  }
31960
31961
  const selectedRow = this.selectScalarRow(rows, cfg, engine);
31961
31962
  if (cfg.rowSelectionMode === 'selected' && !selectedRow) {
31962
- const currentValue = field.name && engine ? engine.getValue(field.name) : undefined;
31963
31963
  return currentValue !== undefined ? currentValue : field.defaultValue;
31964
31964
  }
31965
31965
  const row = selectedRow ?? rows[0];
@@ -32007,6 +32007,9 @@ class DefaultDataProvider extends DataProvider {
32007
32007
  return [];
32008
32008
  }
32009
32009
  }
32010
+ getCurrentFieldValue(field, engine) {
32011
+ return field.name && engine ? engine.getValue(field.name) : undefined;
32012
+ }
32010
32013
  async getGlobalRows(cfg) {
32011
32014
  if (!cfg.datasourceId)
32012
32015
  return [];