cilog-lib 1.13.19 → 1.13.20

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.
@@ -1858,59 +1858,69 @@ class CilogGridComponent {
1858
1858
  rowsTotal.unshift({});
1859
1859
  indexTotalGeneral = 1;
1860
1860
  }
1861
- this.columns().forEach(col => {
1862
- let total = 0;
1863
- this.values().forEach(val => {
1864
- if (!val.exclusionTotal && !val[col.id].exclusionTotal) {
1865
- if (this.options().modeSelection != null) {
1866
- if (this.options().modeSelection == ModeSelection.Checkbox && this.options().totalBySelection == true) {
1867
- // if (this.selectedRows != null && this.selectedRows.find(row => row.id == val.id) != null) {
1868
- // total += (val[col.id].value != null ? val[col.id].value : 0);
1869
- // }
1861
+ this.columns().forEach((col, i) => {
1862
+ if (i == 0) {
1863
+ rowsTotal[indexTotalGeneral][col.id] = { value: 'TOTAL GÉNÉRAL' };
1864
+ if (this.options().filterable) {
1865
+ rowsTotal[0][col.id] = { value: 'TOTAL FILTRÉ' };
1866
+ }
1867
+ }
1868
+ else {
1869
+ let total = 0;
1870
+ this.values().forEach(val => {
1871
+ if (!val.exclusionTotal && !val[col.id].exclusionTotal) {
1872
+ if (this.options().modeSelection != null) {
1873
+ if (this.options().modeSelection == ModeSelection.Checkbox && this.options().totalBySelection == true) {
1874
+ // if (this.selectedRows != null && this.selectedRows.find(row => row.id == val.id) != null) {
1875
+ // total += (val[col.id].value != null ? val[col.id].value : 0);
1876
+ // }
1877
+ }
1878
+ else {
1879
+ total += (val[col.id].value != null ? val[col.id].value : 0);
1880
+ }
1870
1881
  }
1871
1882
  else {
1872
1883
  total += (val[col.id].value != null ? val[col.id].value : 0);
1873
1884
  }
1874
1885
  }
1875
- else {
1876
- total += (val[col.id].value != null ? val[col.id].value : 0);
1877
- }
1878
- }
1879
- });
1880
- rowsTotal[indexTotalGeneral][col.id] = { value: col.displayTotal ? total : null };
1881
- if (this.options().filterable) {
1882
- let totalFiltre = 0;
1883
- if (this.gridApi() != null) {
1884
- this.gridApi().forEachNodeAfterFilter(node => {
1885
- let val = node.data;
1886
- if (!val.exclusionTotal && !val[col.id].exclusionTotal) {
1887
- if (this.options().modeSelection != null) {
1888
- if (this.options().modeSelection == ModeSelection.Checkbox && this.options().totalBySelection == true) {
1889
- // if (this.selectedRows != null && this.selectedRows.find(row => row.id == val.id) != null) {
1890
- // totalFiltre += (val[col.id].value != null ? val[col.id].value : 0);
1891
- // }
1886
+ });
1887
+ rowsTotal[indexTotalGeneral][col.id] = { value: col.displayTotal ? total : null };
1888
+ if (this.options().filterable) {
1889
+ let totalFiltre = 0;
1890
+ if (this.gridApi() != null) {
1891
+ this.gridApi().forEachNodeAfterFilter(node => {
1892
+ let val = node.data;
1893
+ if (!val.exclusionTotal && !val[col.id].exclusionTotal) {
1894
+ if (this.options().modeSelection != null) {
1895
+ if (this.options().modeSelection == ModeSelection.Checkbox && this.options().totalBySelection == true) {
1896
+ // if (this.selectedRows != null && this.selectedRows.find(row => row.id == val.id) != null) {
1897
+ // totalFiltre += (val[col.id].value != null ? val[col.id].value : 0);
1898
+ // }
1899
+ }
1900
+ else {
1901
+ totalFiltre += (val[col.id].value != null ? val[col.id].value : 0);
1902
+ }
1892
1903
  }
1893
1904
  else {
1894
1905
  totalFiltre += (val[col.id].value != null ? val[col.id].value : 0);
1895
1906
  }
1896
1907
  }
1897
- else {
1898
- totalFiltre += (val[col.id].value != null ? val[col.id].value : 0);
1899
- }
1900
- }
1901
- });
1908
+ });
1909
+ }
1910
+ rowsTotal[0][col.id] = { value: col.displayTotal ? totalFiltre : null };
1902
1911
  }
1903
- rowsTotal[0][col.id] = { value: col.displayTotal ? totalFiltre : null };
1904
1912
  }
1905
1913
  });
1906
1914
  return rowsTotal;
1907
1915
  }, ...(ngDevMode ? [{ debugName: "totalRowData" }] : /* istanbul ignore next */ []));
1908
1916
  getRowStyle = (params) => {
1909
1917
  if (params.node.rowPinned === 'bottom') {
1918
+ const pinnedBottomCount = params.api.getPinnedBottomRowCount();
1919
+ const isFirstPinnedRow = params.node.rowIndex === 0;
1910
1920
  return {
1911
1921
  backgroundColor: '#f1f5f9',
1912
1922
  fontWeight: 'bold',
1913
- color: '#1e293b',
1923
+ color: pinnedBottomCount === 2 && isFirstPinnedRow ? '#7D745A' : '#1e293b',
1914
1924
  borderTop: '2px solid #cbd5e1',
1915
1925
  boxShadow: 'inset 0 1px 0 #cbd5e1'
1916
1926
  };