@den4ik92/ng2-smart-table 19.2.3 → 19.2.5

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.
@@ -465,7 +465,6 @@ var SmartTableOnChangedEventName;
465
465
  SmartTableOnChangedEventName["sort"] = "sort";
466
466
  SmartTableOnChangedEventName["add"] = "add";
467
467
  SmartTableOnChangedEventName["remove"] = "remove";
468
- SmartTableOnChangedEventName["append"] = "append";
469
468
  SmartTableOnChangedEventName["appendMany"] = "appendMany";
470
469
  SmartTableOnChangedEventName["prepend"] = "prepend";
471
470
  SmartTableOnChangedEventName["refresh"] = "refresh";
@@ -484,7 +483,7 @@ class DataSource {
484
483
  display: false,
485
484
  perPageSelect: [],
486
485
  });
487
- this.data = [];
486
+ this.data = signal([]);
488
487
  }
489
488
  refresh() {
490
489
  this.emitOnChanged({ action: SmartTableOnChangedEventName.refresh });
@@ -496,28 +495,23 @@ class DataSource {
496
495
  return this.onChangedSource.asObservable();
497
496
  }
498
497
  prepend(element) {
499
- this.data.unshift(element);
498
+ this.data.update((old) => [element, ...old]);
500
499
  this.emitOnChanged({ action: SmartTableOnChangedEventName.prepend, newItems: [element] });
501
500
  return Promise.resolve(true);
502
501
  }
503
502
  appendMany(elements) {
504
- this.data = [...this.data, ...elements];
505
- this.emitOnChanged({ action: SmartTableOnChangedEventName.appendMany, newItems: elements }, this.data);
506
- return Promise.resolve(true);
507
- }
508
- append(element) {
509
- this.data.push(element);
510
- this.emitOnChanged({ action: SmartTableOnChangedEventName.append, newItems: [element] });
503
+ this.data.update((old) => [...old, ...elements,]);
504
+ this.emitOnChanged({ action: SmartTableOnChangedEventName.appendMany, newItems: elements });
511
505
  return Promise.resolve(true);
512
506
  }
513
507
  add(element) {
514
- this.data.push(element);
508
+ this.data.update((old) => [...old, element,]);
515
509
  this.emitOnChanged({ action: SmartTableOnChangedEventName.add, newItems: [element] });
516
510
  return Promise.resolve(true);
517
511
  }
518
512
  remove(element) {
519
- this.data = this.data.filter((el) => el !== element);
520
- this.emitOnChanged({ action: SmartTableOnChangedEventName.remove, item: element }, this.data);
513
+ this.data.update((old) => old.filter((el) => el !== element));
514
+ this.emitOnChanged({ action: SmartTableOnChangedEventName.remove, item: element });
521
515
  return Promise.resolve(true);
522
516
  }
523
517
  update(oldItem, newItem) {
@@ -525,7 +519,7 @@ class DataSource {
525
519
  return Promise.resolve(true);
526
520
  }
527
521
  empty() {
528
- this.data = [];
522
+ this.data.set([]);
529
523
  this.emitOnChanged({ action: SmartTableOnChangedEventName.empty });
530
524
  return Promise.resolve(true);
531
525
  }
@@ -579,24 +573,17 @@ class DataSource {
579
573
  }
580
574
  }
581
575
  emitOnChanged(eventData, newElements) {
582
- const actionData = () => {
583
- const elements = newElements || this.data;
584
- const emitData = {
585
- ...eventData,
586
- elements,
587
- paging: this.pagingConf(),
588
- filters: this.getFilters(),
589
- sort: this.getSort(),
590
- };
591
- if (eventData.action === SmartTableOnChangedEventName.remove) {
592
- return {
593
- ...emitData,
594
- elements: elements.filter((el) => el !== eventData.item),
595
- };
596
- }
597
- return emitData;
576
+ const actionData = {
577
+ ...eventData,
578
+ elements: newElements || this.data(),
579
+ paging: this.pagingConf(),
580
+ filters: this.getFilters(),
581
+ sort: this.getSort(),
598
582
  };
599
- this.onChangedSource.next(actionData());
583
+ if (eventData.action === SmartTableOnChangedEventName.remove) {
584
+ actionData.elements = (newElements || this.data()).filter((el) => el !== eventData.item);
585
+ }
586
+ this.onChangedSource.next(actionData);
600
587
  }
601
588
  }
602
589
 
@@ -647,10 +634,10 @@ class LocalDataSource extends DataSource {
647
634
  super();
648
635
  this.filteredAndSorted = signal([]);
649
636
  this.count = computed(() => this.filteredAndSorted().length);
650
- this.data = data;
637
+ this.data.set(data);
651
638
  }
652
639
  load(data) {
653
- this.data = data;
640
+ this.data.set(data);
654
641
  this.emitOnChanged({ action: SmartTableOnChangedEventName.load });
655
642
  return Promise.resolve(true);
656
643
  }
@@ -662,12 +649,12 @@ class LocalDataSource extends DataSource {
662
649
  this.reset(true);
663
650
  return super.appendMany(elements);
664
651
  }
665
- append(element) {
652
+ add(element) {
666
653
  this.reset(true);
667
- return super.append(element);
654
+ return super.add(element);
668
655
  }
669
656
  getAll() {
670
- const data = this.data.slice(0);
657
+ const data = this.data().slice(0);
671
658
  return Promise.resolve(data);
672
659
  }
673
660
  reset(silent = false) {
@@ -693,8 +680,8 @@ class LocalDataSource extends DataSource {
693
680
  emitOnChanged(event) {
694
681
  let renderData = this.filteredAndSorted();
695
682
  const action = event.action;
696
- if (['filter', 'refresh', 'load'].includes(action)) {
697
- renderData = this.filter(this.data.slice(0));
683
+ if (['filter', 'refresh', 'load', 'add', 'prepend', 'appendMany'].includes(action)) {
684
+ renderData = this.filter(this.data().slice(0));
698
685
  this.filteredAndSorted.set(this.sort(renderData));
699
686
  renderData = this.filteredAndSorted();
700
687
  }
@@ -747,7 +734,7 @@ class ServerDataSource extends DataSource {
747
734
  this.requestFunction = requestFunction;
748
735
  }
749
736
  getAll() {
750
- return Promise.resolve(this.data);
737
+ return Promise.resolve(this.data());
751
738
  }
752
739
  getSort() {
753
740
  return this.sortConf;
@@ -771,7 +758,7 @@ class ServerDataSource extends DataSource {
771
758
  })
772
759
  .pipe(switchMap((params) => this.requestFunction(params)))
773
760
  .subscribe((res) => {
774
- this.data = res.data;
761
+ this.data.set(res.data);
775
762
  this.pagingConf.update((old) => ({ ...old, total: res.total }));
776
763
  super.emitOnChanged(eventData, res.data);
777
764
  });
@@ -1606,15 +1593,15 @@ class Grid {
1606
1593
  if (event.action === 'load') {
1607
1594
  this.dataSet.deselectAll();
1608
1595
  }
1609
- if (event.action !== 'update') {
1610
- this.dataSet.setData(event.elements);
1611
- }
1612
- else {
1596
+ if (event.action === 'update') {
1613
1597
  const changedRow = this.dataSet.findRowByData(event.oldItem);
1614
1598
  if (changedRow) {
1615
1599
  changedRow.setData(event.newItem || event.oldItem);
1616
1600
  }
1601
+ return;
1617
1602
  }
1603
+ console.log(event);
1604
+ this.dataSet.setData(event.elements);
1618
1605
  }
1619
1606
  prepareSource(source, initialSort, initialPaging) {
1620
1607
  const preparedSource = source || new LocalDataSource();
@@ -1761,14 +1748,15 @@ class TbodyCustomComponent {
1761
1748
  }
1762
1749
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: TbodyCustomComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1763
1750
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: TbodyCustomComponent, isStandalone: true, selector: "ng2-st-tbody-custom", inputs: { grid: "grid", row: "row", source: "source" }, outputs: { custom: "custom" }, ngImport: i0, template: `
1764
- @for (action of customActions(); track $index) {
1751
+ @for (action of customActions(); track $index) { @if(!action.hasPermissionFunction ? true :
1752
+ action.hasPermissionFunction(row.getData())) {
1765
1753
  <a
1766
1754
  [id]="'row-' + row.index + '_action-' + action.name + '-button'"
1767
1755
  href="#"
1768
1756
  class="ng2-smart-action ng2-smart-action-custom-custom"
1769
1757
  [innerHTML]="action.title"
1770
1758
  (click)="$event.stopPropagation(); $event.preventDefault(); onCustom(action)"></a>
1771
- }
1759
+ } }
1772
1760
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1773
1761
  }
1774
1762
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: TbodyCustomComponent, decorators: [{
@@ -1777,14 +1765,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
1777
1765
  selector: 'ng2-st-tbody-custom',
1778
1766
  changeDetection: ChangeDetectionStrategy.OnPush,
1779
1767
  template: `
1780
- @for (action of customActions(); track $index) {
1768
+ @for (action of customActions(); track $index) { @if(!action.hasPermissionFunction ? true :
1769
+ action.hasPermissionFunction(row.getData())) {
1781
1770
  <a
1782
1771
  [id]="'row-' + row.index + '_action-' + action.name + '-button'"
1783
1772
  href="#"
1784
1773
  class="ng2-smart-action ng2-smart-action-custom-custom"
1785
1774
  [innerHTML]="action.title"
1786
1775
  (click)="$event.stopPropagation(); $event.preventDefault(); onCustom(action)"></a>
1787
- }
1776
+ } }
1788
1777
  `,
1789
1778
  standalone: true,
1790
1779
  }]
@@ -1805,22 +1794,32 @@ class TbodyEditDeleteComponent {
1805
1794
  this.deleteConfirm = input.required();
1806
1795
  this.edit = output();
1807
1796
  this.delete = output();
1808
- this.isActionEdit = false;
1809
- this.isActionDelete = false;
1810
- this.isExternalMode = false;
1811
- this.editRowButtonContent = 'Edit';
1812
- this.deleteRowButtonContent = 'Delete';
1813
- effect(() => {
1814
- const settings = this.grid().settings();
1815
- const actions = settings.actions;
1816
- if (actions) {
1817
- this.isActionDelete = !!actions.delete;
1818
- this.isActionEdit = !!actions.edit;
1819
- }
1820
- this.isExternalMode = settings.mode === 'external';
1821
- this.editRowButtonContent = settings.edit ? settings.edit.editButtonContent || 'Edit' : 'Edit';
1822
- this.deleteRowButtonContent = settings.delete ? settings.delete.deleteButtonContent || 'Delete' : 'Delete';
1823
- this.cdr.detectChanges();
1797
+ this.isActionEdit = computed(() => {
1798
+ const actions = this.grid().settings().actions;
1799
+ return actions ? !!actions.edit : false;
1800
+ });
1801
+ this.isActionDelete = computed(() => {
1802
+ const actions = this.grid().settings().actions;
1803
+ return actions ? !!actions.delete : false;
1804
+ });
1805
+ this.isExternalMode = computed(() => {
1806
+ return this.grid().settings().mode === 'external';
1807
+ });
1808
+ this.canDeleteFunction = computed(() => {
1809
+ const deleteConfig = this.grid().settings().delete;
1810
+ return deleteConfig ? deleteConfig.hasPermissionFunction || ((data) => true) : (data) => true;
1811
+ });
1812
+ this.canEditFunction = computed(() => {
1813
+ const edit = this.grid().settings().edit;
1814
+ return edit ? edit.hasPermissionFunction || ((data) => true) : (data) => true;
1815
+ });
1816
+ this.editRowButtonContent = computed(() => {
1817
+ const edit = this.grid().settings().edit;
1818
+ return edit ? edit.editButtonContent || 'Edit' : 'Edit';
1819
+ });
1820
+ this.deleteRowButtonContent = computed(() => {
1821
+ const deleteConfig = this.grid().settings().delete;
1822
+ return deleteConfig ? deleteConfig.deleteButtonContent || 'Delete' : 'Delete';
1824
1823
  });
1825
1824
  }
1826
1825
  onEdit(event) {
@@ -1837,7 +1836,7 @@ class TbodyEditDeleteComponent {
1837
1836
  onDelete(event) {
1838
1837
  event.preventDefault();
1839
1838
  event.stopPropagation();
1840
- if (this.isExternalMode) {
1839
+ if (this.isExternalMode()) {
1841
1840
  this.delete.emit({
1842
1841
  data: this.row().getData(),
1843
1842
  source: this.source(),
@@ -1848,165 +1847,12 @@ class TbodyEditDeleteComponent {
1848
1847
  }
1849
1848
  }
1850
1849
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: TbodyEditDeleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1851
- 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: `
1852
- @if (!row().pending()) { @if (isActionEdit) {
1853
- <a
1854
- href="#"
1855
- [id]="'row-' + row().index + '_action-edit-button'"
1856
- class="ng2-smart-action ng2-smart-action-edit-edit"
1857
- [innerHTML]="editRowButtonContent"
1858
- (click)="onEdit($event)"></a>
1859
- } @if (isActionDelete) {
1860
- <a
1861
- href="#"
1862
- [id]="'row-' + row().index + '_action-delete-button'"
1863
- class="ng2-smart-action ng2-smart-action-delete-delete"
1864
- [innerHTML]="deleteRowButtonContent"
1865
- (click)="onDelete($event)"></a>
1866
- } } @else {
1867
- <div style="display: flex;">
1868
- @if (isActionEdit) {
1869
- <svg
1870
- role="none"
1871
- (click)="$event.stopPropagation()"
1872
- style="height: 2rem; width: 2rem;"
1873
- version="1.1"
1874
- id="L9"
1875
- xmlns="http://www.w3.org/2000/svg"
1876
- xmlns:xlink="http://www.w3.org/1999/xlink"
1877
- x="0px"
1878
- y="0px"
1879
- viewBox="0 0 100 100"
1880
- enable-background="new 0 0 0 0"
1881
- xml:space="preserve">
1882
- <path
1883
- fill="#e9e9e9"
1884
- d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
1885
- <animateTransform
1886
- attributeName="transform"
1887
- attributeType="XML"
1888
- type="rotate"
1889
- dur="1s"
1890
- from="0 50 50"
1891
- to="360 50 50"
1892
- repeatCount="indefinite" />
1893
- </path>
1894
- </svg>
1895
- } @if (isActionDelete) {
1896
- <svg
1897
- role="none"
1898
- (click)="$event.stopPropagation()"
1899
- style="height: 2rem; width: 2rem;"
1900
- version="1.1"
1901
- id="L9"
1902
- xmlns="http://www.w3.org/2000/svg"
1903
- xmlns:xlink="http://www.w3.org/1999/xlink"
1904
- x="0px"
1905
- y="0px"
1906
- viewBox="0 0 100 100"
1907
- enable-background="new 0 0 0 0"
1908
- xml:space="preserve">
1909
- <path
1910
- fill="#e9e9e9"
1911
- d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
1912
- <animateTransform
1913
- attributeName="transform"
1914
- attributeType="XML"
1915
- type="rotate"
1916
- dur="1s"
1917
- from="0 50 50"
1918
- to="360 50 50"
1919
- repeatCount="indefinite" />
1920
- </path>
1921
- </svg>
1922
- }
1923
- </div>
1924
- }
1925
- `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1850
+ 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: "@if (!row().pending()) { @if (isActionEdit() && canEditFunction()(row().getData())) {\n<a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-edit-button'\"\n class=\"ng2-smart-action ng2-smart-action-edit-edit\"\n [innerHTML]=\"editRowButtonContent()\"\n (click)=\"onEdit($event)\"></a>\n} @if (isActionDelete() && canDeleteFunction()(row().getData())) {\n<a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-delete-button'\"\n class=\"ng2-smart-action ng2-smart-action-delete-delete\"\n [innerHTML]=\"deleteRowButtonContent()\"\n (click)=\"onDelete($event)\"></a>\n} } @else {\n<div style=\"display: flex\">\n @if (isActionEdit()) {\n <svg\n role=\"none\"\n (click)=\"$event.stopPropagation()\"\n style=\"height: 2rem; width: 2rem\"\n version=\"1.1\"\n id=\"L9\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 100 100\"\n enable-background=\"new 0 0 0 0\"\n xml:space=\"preserve\">\n <path\n fill=\"#e9e9e9\"\n d=\"M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50\">\n <animateTransform\n attributeName=\"transform\"\n attributeType=\"XML\"\n type=\"rotate\"\n dur=\"1s\"\n from=\"0 50 50\"\n to=\"360 50 50\"\n repeatCount=\"indefinite\" />\n </path>\n </svg>\n } @if (isActionDelete()) {\n <svg\n role=\"none\"\n (click)=\"$event.stopPropagation()\"\n style=\"height: 2rem; width: 2rem\"\n version=\"1.1\"\n id=\"L9\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 100 100\"\n enable-background=\"new 0 0 0 0\"\n xml:space=\"preserve\">\n <path\n fill=\"#e9e9e9\"\n d=\"M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50\">\n <animateTransform\n attributeName=\"transform\"\n attributeType=\"XML\"\n type=\"rotate\"\n dur=\"1s\"\n from=\"0 50 50\"\n to=\"360 50 50\"\n repeatCount=\"indefinite\" />\n </path>\n </svg>\n }\n</div>\n}\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1926
1851
  }
1927
1852
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: TbodyEditDeleteComponent, decorators: [{
1928
1853
  type: Component,
1929
- args: [{
1930
- selector: 'ng2-st-tbody-edit-delete',
1931
- template: `
1932
- @if (!row().pending()) { @if (isActionEdit) {
1933
- <a
1934
- href="#"
1935
- [id]="'row-' + row().index + '_action-edit-button'"
1936
- class="ng2-smart-action ng2-smart-action-edit-edit"
1937
- [innerHTML]="editRowButtonContent"
1938
- (click)="onEdit($event)"></a>
1939
- } @if (isActionDelete) {
1940
- <a
1941
- href="#"
1942
- [id]="'row-' + row().index + '_action-delete-button'"
1943
- class="ng2-smart-action ng2-smart-action-delete-delete"
1944
- [innerHTML]="deleteRowButtonContent"
1945
- (click)="onDelete($event)"></a>
1946
- } } @else {
1947
- <div style="display: flex;">
1948
- @if (isActionEdit) {
1949
- <svg
1950
- role="none"
1951
- (click)="$event.stopPropagation()"
1952
- style="height: 2rem; width: 2rem;"
1953
- version="1.1"
1954
- id="L9"
1955
- xmlns="http://www.w3.org/2000/svg"
1956
- xmlns:xlink="http://www.w3.org/1999/xlink"
1957
- x="0px"
1958
- y="0px"
1959
- viewBox="0 0 100 100"
1960
- enable-background="new 0 0 0 0"
1961
- xml:space="preserve">
1962
- <path
1963
- fill="#e9e9e9"
1964
- d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
1965
- <animateTransform
1966
- attributeName="transform"
1967
- attributeType="XML"
1968
- type="rotate"
1969
- dur="1s"
1970
- from="0 50 50"
1971
- to="360 50 50"
1972
- repeatCount="indefinite" />
1973
- </path>
1974
- </svg>
1975
- } @if (isActionDelete) {
1976
- <svg
1977
- role="none"
1978
- (click)="$event.stopPropagation()"
1979
- style="height: 2rem; width: 2rem;"
1980
- version="1.1"
1981
- id="L9"
1982
- xmlns="http://www.w3.org/2000/svg"
1983
- xmlns:xlink="http://www.w3.org/1999/xlink"
1984
- x="0px"
1985
- y="0px"
1986
- viewBox="0 0 100 100"
1987
- enable-background="new 0 0 0 0"
1988
- xml:space="preserve">
1989
- <path
1990
- fill="#e9e9e9"
1991
- d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
1992
- <animateTransform
1993
- attributeName="transform"
1994
- attributeType="XML"
1995
- type="rotate"
1996
- dur="1s"
1997
- from="0 50 50"
1998
- to="360 50 50"
1999
- repeatCount="indefinite" />
2000
- </path>
2001
- </svg>
2002
- }
2003
- </div>
2004
- }
2005
- `,
2006
- standalone: true,
2007
- changeDetection: ChangeDetectionStrategy.OnPush,
2008
- }]
2009
- }], ctorParameters: () => [] });
1854
+ args: [{ selector: 'ng2-st-tbody-edit-delete', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!row().pending()) { @if (isActionEdit() && canEditFunction()(row().getData())) {\n<a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-edit-button'\"\n class=\"ng2-smart-action ng2-smart-action-edit-edit\"\n [innerHTML]=\"editRowButtonContent()\"\n (click)=\"onEdit($event)\"></a>\n} @if (isActionDelete() && canDeleteFunction()(row().getData())) {\n<a\n href=\"#\"\n [id]=\"'row-' + row().index + '_action-delete-button'\"\n class=\"ng2-smart-action ng2-smart-action-delete-delete\"\n [innerHTML]=\"deleteRowButtonContent()\"\n (click)=\"onDelete($event)\"></a>\n} } @else {\n<div style=\"display: flex\">\n @if (isActionEdit()) {\n <svg\n role=\"none\"\n (click)=\"$event.stopPropagation()\"\n style=\"height: 2rem; width: 2rem\"\n version=\"1.1\"\n id=\"L9\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 100 100\"\n enable-background=\"new 0 0 0 0\"\n xml:space=\"preserve\">\n <path\n fill=\"#e9e9e9\"\n d=\"M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50\">\n <animateTransform\n attributeName=\"transform\"\n attributeType=\"XML\"\n type=\"rotate\"\n dur=\"1s\"\n from=\"0 50 50\"\n to=\"360 50 50\"\n repeatCount=\"indefinite\" />\n </path>\n </svg>\n } @if (isActionDelete()) {\n <svg\n role=\"none\"\n (click)=\"$event.stopPropagation()\"\n style=\"height: 2rem; width: 2rem\"\n version=\"1.1\"\n id=\"L9\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 100 100\"\n enable-background=\"new 0 0 0 0\"\n xml:space=\"preserve\">\n <path\n fill=\"#e9e9e9\"\n d=\"M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50\">\n <animateTransform\n attributeName=\"transform\"\n attributeType=\"XML\"\n type=\"rotate\"\n dur=\"1s\"\n from=\"0 50 50\"\n to=\"360 50 50\"\n repeatCount=\"indefinite\" />\n </path>\n </svg>\n }\n</div>\n}\n" }]
1855
+ }] });
2010
1856
 
2011
1857
  class Ng2SmartTableTbodyComponent {
2012
1858
  constructor() {