arengibook 3.1.283-main → 3.1.291-main

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -46
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -55361,7 +55361,6 @@ var SelfEditableCell = function SelfEditableCell(_ref11) {
55361
55361
  localValueRef.current = localValue;
55362
55362
  }, [localValue]);
55363
55363
  useEffect(function () {
55364
- console.log('[sync-effect] field=', col.field, '| isRowEditing=', isRowEditing, '| editing=', editing);
55365
55364
  if (isRowEditing && !editing) {
55366
55365
  committedRef.current = false;
55367
55366
  daySelectedRef.current = false;
@@ -55373,29 +55372,17 @@ var SelfEditableCell = function SelfEditableCell(_ref11) {
55373
55372
  // eslint-disable-next-line react-hooks/exhaustive-deps
55374
55373
  }, [isRowEditing]);
55375
55374
  var commit = useCallback(function (val) {
55376
- console.log('[commit] APPEL | val=', val, '| committedRef=', committedRef.current, '| editing=', editing, '| isRowEditing=', isRowEditing, '| field=', col.field);
55377
55375
  pendingValRef.current = val;
55378
55376
  clearTimeout(commitTimerRef.current);
55379
55377
  commitTimerRef.current = setTimeout(function () {
55380
- console.log('[commit:tick] | committedRef=', committedRef.current, '| pending=', pendingValRef.current, '| field=', col.field);
55381
- if (committedRef.current) {
55382
- console.log('[commit:tick] ⛔ AVALÉ (committedRef déjà true) | field=', col.field);
55383
- return;
55384
- }
55378
+ if (committedRef.current) return;
55385
55379
  committedRef.current = true;
55386
55380
  var v = pendingValRef.current;
55387
- console.log('[commit:tick] ✅ → onSave(', v, ') | field=', col.field);
55388
55381
  onSave(v);
55389
55382
  setLocalValue(v);
55390
- if (!isRowEditing) {
55391
- console.log('[commit:tick] → setEditing(false) | field=', col.field);
55392
- setEditing(false);
55393
- } else {
55394
- committedRef.current = false;
55395
- }
55383
+ if (!isRowEditing) setEditing(false);else committedRef.current = false;
55396
55384
  }, 0);
55397
- // eslint-disable-next-line react-hooks/exhaustive-deps
55398
- }, [isRowEditing, onSave, editing, col.field]);
55385
+ }, [isRowEditing, onSave]);
55399
55386
  useEffect(function () {
55400
55387
  if (!editing || isRowEditing || col.type === 'date') return;
55401
55388
  var handler = function handler(e) {
@@ -55414,7 +55401,6 @@ var SelfEditableCell = function SelfEditableCell(_ref11) {
55414
55401
  return /*#__PURE__*/React__default.createElement("div", {
55415
55402
  onClick: function onClick(e) {
55416
55403
  if (editable && !e.target.closest('.ghost-btnBox')) {
55417
- console.log('[open] CLIC ouverture | field=', col.field, '| committedRef reset→false, daySelectedRef reset→false');
55418
55404
  committedRef.current = false;
55419
55405
  daySelectedRef.current = false;
55420
55406
  setEditing(true);
@@ -55499,44 +55485,29 @@ var SelfEditableCell = function SelfEditableCell(_ref11) {
55499
55485
  var parsed = parseDateAuto(localValue);
55500
55486
  var dateObj = (_parsed$date = parsed === null || parsed === void 0 ? void 0 : parsed.date) !== null && _parsed$date !== void 0 ? _parsed$date : new Date();
55501
55487
  var primeFormat = col.dbDateFormat ? dbDateFormatToPrime(col.dbDateFormat) : (_parsed$primeFormat = parsed === null || parsed === void 0 ? void 0 : parsed.primeFormat) !== null && _parsed$primeFormat !== void 0 ? _parsed$primeFormat : 'dd/mm/yy';
55502
- console.log('[date:render] field=', col.field, '| localValue=', localValue, '| parsed=', parsed, '| primeFormat=', primeFormat, '| committedRef=', committedRef.current, '| daySelectedRef=', daySelectedRef.current);
55488
+ var commitDate = function commitDate(v) {
55489
+ // commit synchrone, sans setTimeout
55490
+ committedRef.current = true;
55491
+ onSave(v);
55492
+ setLocalValue(v);
55493
+ if (!isRowEditing) setEditing(false);else committedRef.current = false;
55494
+ };
55503
55495
  return /*#__PURE__*/React__default.createElement("div", {
55504
55496
  ref: containerRef
55505
55497
  }, /*#__PURE__*/React__default.createElement(DatePicker, {
55506
55498
  value: dateObj,
55507
55499
  dateFormat: primeFormat,
55508
- onChange: function onChange(e) {
55509
- console.log('[date:onChange] field=', col.field, '| e.value=', e.value, '| typeof=', _typeof$g(e.value), '| instanceof Date=', e.value instanceof Date);
55510
- if (e.value) {
55511
- daySelectedRef.current = true;
55512
- var iso = fmtDateISO(e.value, primeFormat);
55513
- console.log('[date:onChange] → commit(', iso, ')');
55514
- commit(iso);
55515
- } else {
55516
- console.log('[date:onChange] e.value falsy → aucun commit');
55517
- }
55518
- },
55519
55500
  onSelect: function onSelect(date, meta) {
55520
- console.log('[date:onSelect] field=', col.field, '| date=', date, '| meta=', meta);
55521
55501
  if ((meta === null || meta === void 0 ? void 0 : meta.type) === 'clear') {
55522
55502
  daySelectedRef.current = true;
55523
- console.log('[date:onSelect] clear → commit(null)');
55524
- commit(null);
55503
+ commitDate(null);
55525
55504
  } else if (date) {
55526
55505
  daySelectedRef.current = true;
55527
- var iso = fmtDateISO(date, primeFormat);
55528
- console.log('[date:onSelect] → commit(', iso, ')');
55529
- commit(iso);
55530
- } else {
55531
- console.log('[date:onSelect] ni clear ni date → rien');
55506
+ commitDate(fmtDateISO(date, primeFormat));
55532
55507
  }
55533
55508
  },
55534
55509
  onPanelHide: function onPanelHide() {
55535
- console.log('[date:onPanelHide] field=', col.field, '| daySelectedRef=', daySelectedRef.current, '| isRowEditing=', isRowEditing);
55536
- if (!daySelectedRef.current && !isRowEditing) {
55537
- console.log('[date:onPanelHide] → setEditing(false)');
55538
- setEditing(false);
55539
- }
55510
+ if (!daySelectedRef.current && !isRowEditing) setEditing(false);
55540
55511
  daySelectedRef.current = false;
55541
55512
  }
55542
55513
  }));
@@ -55810,12 +55781,10 @@ var Table$1 = function Table(_ref13) {
55810
55781
  });
55811
55782
  };
55812
55783
  var updateRow = useCallback(function (rowId, field, newVal) {
55813
- console.log('[updateRow] APPEL | rowId=', rowId, '| field=', field, '| newVal=', newVal);
55814
55784
  setData(function (prev) {
55815
55785
  var updated = prev.map(function (row) {
55816
55786
  return row.id === rowId ? _objectSpread2(_objectSpread2({}, row), {}, _defineProperty$g({}, field, newVal)) : row;
55817
55787
  });
55818
- console.log('[updateRow] → onChange?(updated) | typeof onChange=', _typeof$g(onChange));
55819
55788
  onChange === null || onChange === void 0 || onChange(updated);
55820
55789
  return updated;
55821
55790
  });
@@ -56969,7 +56938,6 @@ var Table$1 = function Table(_ref13) {
56969
56938
  isRowEditing: !!editingRows[rowData.id],
56970
56939
  onSave: function onSave(v) {
56971
56940
  var _onCellChangeRef$curr2;
56972
- console.log('[onSave inline] field=', col.field, '| v=', v, '| rowId=', rowData.id);
56973
56941
  var enrichedFields = _defineProperty$g({}, col.field, v);
56974
56942
  if (col.updates) {
56975
56943
  var _col$options8;
@@ -56989,7 +56957,6 @@ var Table$1 = function Table(_ref13) {
56989
56957
  var updated = prev.map(function (r) {
56990
56958
  return r.id === rowData.id ? _objectSpread2(_objectSpread2({}, r), enrichedFields) : r;
56991
56959
  });
56992
- console.log('[onSave inline] → onChange?(updated) | typeof onChange=', _typeof$g(onChange));
56993
56960
  onChange === null || onChange === void 0 || onChange(updated);
56994
56961
  return updated;
56995
56962
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "3.1.283-main",
4
+ "version": "3.1.291-main",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {