cilog-lib 1.13.13 → 1.13.15

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.
@@ -1482,7 +1482,7 @@ class CilogGridComponent {
1482
1482
  if (params.data.readonly || params.data[params.colDef.field].readonly) {
1483
1483
  return false;
1484
1484
  }
1485
- let typeSaisie = params.data.typeSaisie != null ? params.data.typeSaisie : col.type;
1485
+ let typeSaisie = this.getTypeCellule(params.data, col);
1486
1486
  switch (typeSaisie) {
1487
1487
  case ColType.Button:
1488
1488
  case ColType.File:
@@ -1515,7 +1515,7 @@ class CilogGridComponent {
1515
1515
  cellEditorSelector: (params) => {
1516
1516
  if (!params.data)
1517
1517
  return undefined;
1518
- let typeSaisie = params.data.typeSaisie != null ? params.data.typeSaisie : col.type;
1518
+ let typeSaisie = this.getTypeCellule(params.data, col);
1519
1519
  switch (typeSaisie) {
1520
1520
  case ColType.Horaire:
1521
1521
  return { component: TimeMaskEditorComponent };
@@ -1535,11 +1535,11 @@ class CilogGridComponent {
1535
1535
  },
1536
1536
  valueSetter: (params) => {
1537
1537
  if (params.data[params.colDef.field].value != params.newValue) {
1538
- if (params.newValue == null || params.newValue == '') {
1538
+ if (params.newValue === null || params.newValue == '') {
1539
1539
  params.data[params.colDef.field].value = null;
1540
1540
  return true;
1541
1541
  }
1542
- let typeSaisie = params.data.typeSaisie != null ? params.data.typeSaisie : col.type;
1542
+ let typeSaisie = this.getTypeCellule(params.data, col);
1543
1543
  switch (typeSaisie) {
1544
1544
  case ColType.Horaire:
1545
1545
  const regexHeure = /^(([01]\d|2[0-3]):([0-5]\d)|24:00)$/;
@@ -1555,6 +1555,7 @@ class CilogGridComponent {
1555
1555
  case ColType.Number:
1556
1556
  const parsedValue = parseFloat(params.newValue);
1557
1557
  if (isNaN(parsedValue) || parsedValue < 0) {
1558
+ alert("Format invalide");
1558
1559
  params.data[params.colDef.field].value = params.oldValue;
1559
1560
  return false;
1560
1561
  }
@@ -1574,7 +1575,7 @@ class CilogGridComponent {
1574
1575
  return params.data[params.colDef.field].value;
1575
1576
  },
1576
1577
  valueFormatter: (params) => {
1577
- let typeSaisie = params.data.typeSaisie != null ? params.data.typeSaisie : col.type;
1578
+ let typeSaisie = this.getTypeCellule(params.data, col);
1578
1579
  switch (typeSaisie) {
1579
1580
  case ColType.Number:
1580
1581
  const rawValue = params.data[params.colDef.field]?.value;
@@ -1673,6 +1674,15 @@ class CilogGridComponent {
1673
1674
  }
1674
1675
  return cols;
1675
1676
  }, ...(ngDevMode ? [{ debugName: "colDefs" }] : /* istanbul ignore next */ []));
1677
+ getTypeCellule(row, col) {
1678
+ if (row[col.id].typeSaisie != null) {
1679
+ return row[col.id].typeSaisie;
1680
+ }
1681
+ if (row.typeSaisie != null) {
1682
+ return row.typeSaisie;
1683
+ }
1684
+ return col.type;
1685
+ }
1676
1686
  getRowId = (params) => {
1677
1687
  if (params.data && params.data.id != null) {
1678
1688
  return params.data.id.toString();