@esfaenza/es-table 11.2.84 → 11.2.85

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.
@@ -4504,7 +4504,23 @@ class EsTableComponent {
4504
4504
  * @param {number} rowIndex Indice della riga
4505
4505
  */
4506
4506
  dbClickEditOrSingleClickRowSelection($event, rowItem, item, rowIndex) {
4507
- var _a;
4507
+ var _a, _b;
4508
+ // Modalità Editable, gestisco i doppi click senza però rallentare la modalità di selezione a range
4509
+ if (this.Editable) {
4510
+ // Secondo click: se il timer non è scaduto è un doppio click ed eseguo il resto
4511
+ if (this.cellDbClickTimer) {
4512
+ if (rowItem.PropertyName)
4513
+ this.setupUserEdit(rowItem, item);
4514
+ this.clearCellClickTimer();
4515
+ return;
4516
+ }
4517
+ // Primo click: non fa niente e se il tempo per il secondo click scade resetta tutto
4518
+ this.cellDbClickTimer = setTimeout(() => {
4519
+ this.clearCellClickTimer();
4520
+ if (!this.RangeSelection)
4521
+ this.handleRowClick($event, item, this.Selection, true);
4522
+ }, this.doubleClickBufferMs);
4523
+ }
4508
4524
  // In modalità a range la creazione del range è gestita dai mousedown, move ed up...
4509
4525
  // La selezione delle righe invece è gestita dalle caselline a sinistra
4510
4526
  if (this.RangeSelection)
@@ -4513,7 +4529,7 @@ class EsTableComponent {
4513
4529
  if ($event.ctrlKey)
4514
4530
  return;
4515
4531
  // Tutti i click su una cella già in edit non devono effettuare la selezione della riga
4516
- if ((this.DynamicRowColumnsDefinition.length > 0 && rowItem.edits && ((_a = rowItem.edits[item._hash]) === null || _a === void 0 ? void 0 : _a._editing)) ||
4532
+ if ((((_a = this.DynamicRowColumnsDefinition) === null || _a === void 0 ? void 0 : _a.length) > 0 && rowItem.edits && ((_b = rowItem.edits[item._hash]) === null || _b === void 0 ? void 0 : _b._editing)) ||
4517
4533
  rowItem._editing)
4518
4534
  return;
4519
4535
  // Per evitare di rallentare a prescindere
@@ -4521,18 +4537,6 @@ class EsTableComponent {
4521
4537
  this.handleRowClick($event, item, this.Selection, true);
4522
4538
  return;
4523
4539
  }
4524
- // Secondo click: se il timer non è scaduto è un doppio click ed eseguo il resto
4525
- if (this.cellDbClickTimer) {
4526
- if (this.Editable && rowItem.PropertyName)
4527
- this.setupUserEdit(rowItem, item);
4528
- this.clearCellClickTimer();
4529
- return;
4530
- }
4531
- // Primo click: non fa niente e se il tempo per il secondo click scade resetta tutto
4532
- this.cellDbClickTimer = setTimeout(() => {
4533
- this.clearCellClickTimer();
4534
- this.handleRowClick($event, item, this.Selection, true);
4535
- }, this.doubleClickBufferMs);
4536
4540
  }
4537
4541
  /** Evento che gestisce il comando "Copia" buttando i valori selezionati nella clipboard in base al loro tipo */
4538
4542
  handleCopy() {
@@ -4624,9 +4628,10 @@ class EsTableComponent {
4624
4628
  * @param {any} item Oggetto sopra il quale è stata attivata la modifica
4625
4629
  */
4626
4630
  setupUserEdit(rowItem, item) {
4631
+ var _a;
4627
4632
  this.selection_H.clearSelectionStatus();
4628
4633
  if (this.Editable && rowItem.PropertyName) {
4629
- if (this.DynamicRowColumnsDefinition.length > 0) {
4634
+ if (((_a = this.DynamicRowColumnsDefinition) === null || _a === void 0 ? void 0 : _a.length) > 0) {
4630
4635
  rowItem.edits[item._hash] = { _editing: true, old_value: item[rowItem.PropertyName] };
4631
4636
  }
4632
4637
  else {
@@ -4645,7 +4650,8 @@ class EsTableComponent {
4645
4650
  * @param {number} columnIndex Indice della colonna su cui è avvenuta la modifica
4646
4651
  */
4647
4652
  finalizeUserEdit(rowItem, item, columnIndex) {
4648
- let dynMode = this.DynamicRowColumnsDefinition.length > 0;
4653
+ var _a;
4654
+ let dynMode = ((_a = this.DynamicRowColumnsDefinition) === null || _a === void 0 ? void 0 : _a.length) > 0;
4649
4655
  let rowItm = dynMode ? (rowItem.edits[item._hash]) : rowItem;
4650
4656
  rowItm._editing = false;
4651
4657
  let old = rowItm.old_value;