@den4ik92/ng2-smart-table 19.5.2 → 19.5.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.
@@ -346,13 +346,13 @@ class Cell {
346
346
  this.value = value;
347
347
  this.row = row;
348
348
  this.column = column;
349
- this.newValue = '';
349
+ this.newValue = signal(null);
350
350
  this.columnClass = '';
351
351
  this.styles = '';
352
352
  this.title = '';
353
353
  this.id = '';
354
354
  this.columnClass = column.class;
355
- this.newValue = value;
355
+ this.newValue.set(value);
356
356
  this.styles = column.styles;
357
357
  this.title = column.title;
358
358
  this.id = column.id;
@@ -364,8 +364,8 @@ class Cell {
364
364
  getNotPrepareValue() {
365
365
  return this.value;
366
366
  }
367
- setValue(value) {
368
- this.newValue = value;
367
+ setNewValue(value) {
368
+ this.newValue.set(value);
369
369
  }
370
370
  isEditable() {
371
371
  if (this.row.index === -1) {
@@ -447,7 +447,7 @@ class Row {
447
447
  }
448
448
  getNewData() {
449
449
  const values = Object.assign({}, this.rowData);
450
- this.cells().forEach((cell) => (values[cell.column.id] = cell.newValue));
450
+ this.cells().forEach((cell) => (values[cell.column.id] = cell.newValue()));
451
451
  return values;
452
452
  }
453
453
  setData(rowData) {
@@ -834,7 +834,7 @@ class CheckboxEditorComponent extends BaseEditorComponent {
834
834
  });
835
835
  }
836
836
  onChange(event) {
837
- this.cell().newValue = event.target.checked ? this.trueVal() : this.falseVal();
837
+ this.cell().setNewValue(event.target.checked ? this.trueVal() : this.falseVal());
838
838
  }
839
839
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: CheckboxEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
840
840
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: CheckboxEditorComponent, isStandalone: true, selector: "ng2-checkbox-editor", usesInheritance: true, ngImport: i0, template: `
@@ -866,9 +866,11 @@ class InputEditorComponent extends BaseEditorComponent {
866
866
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: InputEditorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
867
867
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: InputEditorComponent, isStandalone: true, selector: "ng2-input-editor", usesInheritance: true, ngImport: i0, template: `
868
868
  <input
869
+ type="text"
869
870
  [class]="inputClass()"
870
871
  class="form-control"
871
- [(ngModel)]="cell().newValue"
872
+ [ngModel]="cell().newValue()"
873
+ (ngModelChange)="cell().setNewValue($event)"
872
874
  [name]="cell().id"
873
875
  [placeholder]="cell().title"
874
876
  [disabled]="!cell().isEditable()" />
@@ -878,9 +880,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
878
880
  type: Component,
879
881
  args: [{ selector: 'ng2-input-editor', template: `
880
882
  <input
883
+ type="text"
881
884
  [class]="inputClass()"
882
885
  class="form-control"
883
- [(ngModel)]="cell().newValue"
886
+ [ngModel]="cell().newValue()"
887
+ (ngModelChange)="cell().setNewValue($event)"
884
888
  [name]="cell().id"
885
889
  [placeholder]="cell().title"
886
890
  [disabled]="!cell().isEditable()" />
@@ -893,7 +897,8 @@ class SelectEditorComponent extends BaseEditorComponent {
893
897
  <select
894
898
  [class]="inputClass()"
895
899
  class="form-control"
896
- [(ngModel)]="cell().newValue"
900
+ [ngModel]="cell().newValue()"
901
+ (ngModelChange)="cell().setNewValue($event)"
897
902
  [name]="cell().id"
898
903
  [disabled]="!cell().isEditable()">
899
904
  @for (option of cell().column.getEditorConfig()?.list; track $index) {
@@ -912,7 +917,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
912
917
  <select
913
918
  [class]="inputClass()"
914
919
  class="form-control"
915
- [(ngModel)]="cell().newValue"
920
+ [ngModel]="cell().newValue()"
921
+ (ngModelChange)="cell().setNewValue($event)"
916
922
  [name]="cell().id"
917
923
  [disabled]="!cell().isEditable()">
918
924
  @for (option of cell().column.getEditorConfig()?.list; track $index) {
@@ -933,7 +939,8 @@ class TextareaEditorComponent extends BaseEditorComponent {
933
939
  <textarea
934
940
  [class]="inputClass()"
935
941
  class="form-control"
936
- [(ngModel)]="cell().newValue"
942
+ [ngModel]="cell().newValue()"
943
+ (ngModelChange)="cell().setNewValue($event)"
937
944
  [name]="cell().id"
938
945
  [disabled]="!cell().isEditable()"
939
946
  [placeholder]="cell().title">
@@ -946,7 +953,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
946
953
  <textarea
947
954
  [class]="inputClass()"
948
955
  class="form-control"
949
- [(ngModel)]="cell().newValue"
956
+ [ngModel]="cell().newValue()"
957
+ (ngModelChange)="cell().setNewValue($event)"
950
958
  [name]="cell().id"
951
959
  [disabled]="!cell().isEditable()"
952
960
  [placeholder]="cell().title">