@den4ik92/ng2-smart-table 19.1.3 → 19.1.4

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.
@@ -420,7 +420,7 @@ class Row {
420
420
  this.index = index;
421
421
  this.data = data;
422
422
  this._dataSet = _dataSet;
423
- this.pending = false;
423
+ this.pending = signal(false);
424
424
  this.isSelected = false;
425
425
  this.isInEditing = false;
426
426
  this.cells = [];
@@ -1578,7 +1578,7 @@ class TbodyCreateCancelComponent {
1578
1578
  }
1579
1579
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: TbodyCreateCancelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1580
1580
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: TbodyCreateCancelComponent, isStandalone: true, selector: "ng2-st-tbody-create-cancel", inputs: { grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: true, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null }, editConfirm: { classPropertyName: "editConfirm", publicName: "editConfirm", isSignal: true, isRequired: true, transformFunction: null }, editCancel: { classPropertyName: "editCancel", publicName: "editCancel", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
1581
- @if (!row().pending) {
1581
+ @if (!row().pending()) {
1582
1582
  <a
1583
1583
  href="#"
1584
1584
  [id]="'row-' + row().index + '_editing-confirm-button'"
@@ -1662,7 +1662,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
1662
1662
  args: [{
1663
1663
  selector: "ng2-st-tbody-create-cancel",
1664
1664
  template: `
1665
- @if (!row().pending) {
1665
+ @if (!row().pending()) {
1666
1666
  <a
1667
1667
  href="#"
1668
1668
  [id]="'row-' + row().index + '_editing-confirm-button'"
@@ -1934,11 +1934,11 @@ class Grid {
1934
1934
  row.isInEditing = true;
1935
1935
  }
1936
1936
  create(row, confirmEmitter) {
1937
- row.pending = true;
1937
+ row.pending.set(true);
1938
1938
  const deferred = new Deferred();
1939
1939
  deferred.promise
1940
1940
  .then((newData) => {
1941
- row.pending = false;
1941
+ row.pending.set(false);
1942
1942
  newData = newData || row.getNewData();
1943
1943
  this.source.prepend(newData).then(() => {
1944
1944
  this.createFormShown = false;
@@ -1946,9 +1946,9 @@ class Grid {
1946
1946
  });
1947
1947
  })
1948
1948
  .catch((err) => {
1949
- row.pending = false;
1949
+ row.pending.set(false);
1950
1950
  });
1951
- if (this.getSetting("add.confirmCreate")) {
1951
+ if (this.getSetting("add.confirmCreate", false)) {
1952
1952
  confirmEmitter.emit({
1953
1953
  newData: row.getNewData(),
1954
1954
  source: this.source,
@@ -1957,21 +1957,22 @@ class Grid {
1957
1957
  }
1958
1958
  else {
1959
1959
  deferred.resolve(false);
1960
+ row.pending.set(false);
1960
1961
  }
1961
1962
  }
1962
1963
  save(row, confirmEmitter) {
1963
- row.pending = true;
1964
+ row.pending.set(true);
1964
1965
  const deferred = new Deferred();
1965
1966
  deferred.promise
1966
1967
  .then((newData) => {
1967
- row.pending = false;
1968
+ row.pending.set(false);
1968
1969
  newData = newData || row.getNewData();
1969
1970
  this.source.update(row.getData(), newData).then(() => {
1970
1971
  row.isInEditing = false;
1971
1972
  });
1972
1973
  })
1973
- .catch((err) => {
1974
- row.pending = false;
1974
+ .catch(() => {
1975
+ row.pending.set(false);
1975
1976
  });
1976
1977
  if (this.getSetting("edit.confirmSave", false)) {
1977
1978
  confirmEmitter.emit({
@@ -1983,18 +1984,19 @@ class Grid {
1983
1984
  }
1984
1985
  else {
1985
1986
  deferred.resolve(false);
1987
+ row.pending.set(false);
1986
1988
  }
1987
1989
  }
1988
1990
  delete(row, confirmEmitter) {
1989
- row.pending = true;
1991
+ row.pending.set(true);
1990
1992
  const deferred = new Deferred();
1991
1993
  deferred.promise
1992
1994
  .then(() => {
1993
- row.pending = false;
1995
+ row.pending.set(false);
1994
1996
  this.source.remove(row.getData());
1995
1997
  })
1996
- .catch((err) => {
1997
- row.pending = false;
1998
+ .catch(() => {
1999
+ row.pending.set(false);
1998
2000
  // doing nothing
1999
2001
  });
2000
2002
  if (this.getSetting("delete.confirmDelete")) {
@@ -2006,6 +2008,7 @@ class Grid {
2006
2008
  }
2007
2009
  else {
2008
2010
  deferred.resolve(false);
2011
+ row.pending.set(false);
2009
2012
  }
2010
2013
  if (row.isSelected) {
2011
2014
  this.dataSet.selectRow(row, false);
@@ -2245,7 +2248,7 @@ class TbodyEditDeleteComponent {
2245
2248
  }
2246
2249
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: TbodyEditDeleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2247
2250
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: TbodyEditDeleteComponent, isStandalone: true, selector: "ng2-st-tbody-edit-delete", inputs: { grid: { classPropertyName: "grid", publicName: "grid", isSignal: true, isRequired: true, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null }, source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, deleteConfirm: { classPropertyName: "deleteConfirm", publicName: "deleteConfirm", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { edit: "edit", delete: "delete" }, ngImport: i0, template: `
2248
- @if (!row().pending) { @if (isActionEdit) {
2251
+ @if (!row().pending()) { @if (isActionEdit) {
2249
2252
  <a
2250
2253
  href="#"
2251
2254
  [id]="'row-' + row().index + '_action-edit-button'"
@@ -2333,7 +2336,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
2333
2336
  args: [{
2334
2337
  selector: "ng2-st-tbody-edit-delete",
2335
2338
  template: `
2336
- @if (!row().pending) { @if (isActionEdit) {
2339
+ @if (!row().pending()) { @if (isActionEdit) {
2337
2340
  <a
2338
2341
  href="#"
2339
2342
  [id]="'row-' + row().index + '_action-edit-button'"