@sme.up/ketchup 11.0.9 → 11.0.11

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 (69) hide show
  1. package/dist/cjs/kup-autocomplete_30.cjs.entry.js +63 -45
  2. package/dist/collection/components/kup-data-table/kup-data-table.js +63 -45
  3. package/dist/components/kup-accordion.js +1 -1
  4. package/dist/components/kup-activity-timeline.js +1 -1
  5. package/dist/components/kup-autocomplete.js +1 -1
  6. package/dist/components/kup-badge.js +1 -1
  7. package/dist/components/kup-box.js +1 -1
  8. package/dist/components/kup-button-list.js +1 -1
  9. package/dist/components/kup-button.js +1 -1
  10. package/dist/components/kup-calendar.js +1 -1
  11. package/dist/components/kup-card-list.js +2 -2
  12. package/dist/components/kup-card.js +1 -1
  13. package/dist/components/kup-cell.js +1 -1
  14. package/dist/components/kup-chart.js +1 -1
  15. package/dist/components/kup-checkbox.js +1 -1
  16. package/dist/components/kup-chip.js +1 -1
  17. package/dist/components/kup-color-picker.js +1 -1
  18. package/dist/components/kup-combobox.js +1 -1
  19. package/dist/components/kup-dashboard.js +1 -1
  20. package/dist/components/kup-data-table.js +1 -1
  21. package/dist/components/kup-date-picker.js +1 -1
  22. package/dist/components/kup-dialog.js +1 -1
  23. package/dist/components/kup-drawer.js +1 -1
  24. package/dist/components/kup-dropdown-button.js +1 -1
  25. package/dist/components/kup-echart.js +1 -1
  26. package/dist/components/kup-editor.js +1 -1
  27. package/dist/components/kup-family-tree.js +2 -2
  28. package/dist/components/kup-file-upload.js +1 -1
  29. package/dist/components/kup-form.js +1 -1
  30. package/dist/components/kup-gauge.js +1 -1
  31. package/dist/components/kup-grid.js +1 -1
  32. package/dist/components/kup-htm.js +1 -1
  33. package/dist/components/kup-iframe.js +1 -1
  34. package/dist/components/kup-image-list.js +1 -1
  35. package/dist/components/kup-image.js +1 -1
  36. package/dist/components/kup-input-panel.js +2 -2
  37. package/dist/components/kup-lazy.js +1 -1
  38. package/dist/components/kup-list.js +1 -1
  39. package/dist/components/kup-magic-box.js +3 -3
  40. package/dist/components/kup-nav-bar.js +1 -1
  41. package/dist/components/kup-numeric-picker.js +1 -1
  42. package/dist/components/kup-object-field.js +1 -1
  43. package/dist/components/kup-planner.js +1 -1
  44. package/dist/components/kup-probe.js +1 -1
  45. package/dist/components/kup-progress-bar.js +1 -1
  46. package/dist/components/kup-qlik.js +1 -1
  47. package/dist/components/kup-radio.js +1 -1
  48. package/dist/components/kup-rating.js +1 -1
  49. package/dist/components/kup-snackbar.js +1 -1
  50. package/dist/components/kup-spinner.js +1 -1
  51. package/dist/components/kup-switch.js +1 -1
  52. package/dist/components/kup-tab-bar.js +1 -1
  53. package/dist/components/kup-text-field.js +1 -1
  54. package/dist/components/kup-time-picker.js +1 -1
  55. package/dist/components/kup-toolbar.js +1 -1
  56. package/dist/components/kup-tree.js +1 -1
  57. package/dist/components/kup-txt.js +1 -1
  58. package/dist/components/kup-typography-list.js +1 -1
  59. package/dist/components/kup-typography.js +1 -1
  60. package/dist/components/{p-a2c4836f.js → p-1b4df416.js} +1 -1
  61. package/dist/components/{p-b8f7c6b2.js → p-3af86b4f.js} +1 -1
  62. package/dist/components/{p-644714c4.js → p-47e215d3.js} +1 -1
  63. package/dist/components/{p-a0fb0405.js → p-ad48e240.js} +63 -45
  64. package/dist/components/{p-acb805d5.js → p-d18420d7.js} +1 -1
  65. package/dist/esm/kup-autocomplete_30.entry.js +63 -45
  66. package/dist/ketchup/ketchup.esm.js +1 -1
  67. package/dist/ketchup/p-e6906751.entry.js +8 -0
  68. package/package.json +1 -1
  69. package/dist/ketchup/p-8a13ee24.entry.js +0 -8
@@ -8745,7 +8745,7 @@ var __classPrivateFieldSet$4 = (undefined && undefined.__classPrivateFieldSet) |
8745
8745
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
8746
8746
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8747
8747
  };
8748
- var _KupDataTable_instances, _KupDataTable_checkUpdateState, _KupDataTable_initialized, _KupDataTable_cellToFocus, _KupDataTable_rows, _KupDataTable_rowsLength, _KupDataTable_paginatedRows, _KupDataTable_paginatedRowsLength, _KupDataTable_footer, _KupDataTable_kupManager, _KupDataTable_renderedRows, _KupDataTable_loadMoreEventCounter, _KupDataTable_loadMoreEventPreviousQuantity, _KupDataTable_theadRef, _KupDataTable_tableRef, _KupDataTable_originalData, _KupDataTable_originalDataLoaded, _KupDataTable_originalDataLoadedMaxId, _KupDataTable_insertedRowIds, _KupDataTable_modifiedRowsIds, _KupDataTable_tableAreaRef, _KupDataTable_stickyTheadRef, _KupDataTable_lastPointerDetails, _KupDataTable_customizeTopButtonRef, _KupDataTable_customizeTopPanelRef, _KupDataTable_sizedColumns, _KupDataTable_intObserver, _KupDataTable_navBarHeight, _KupDataTable_theadIntersecting, _KupDataTable_tableIntersecting, _KupDataTable_isSafariBrowser, _KupDataTable_isRestoringState, _KupDataTable_globalFilterTimeout, _KupDataTable_totalMenuCoords, _KupDataTable_clickTimeout, _KupDataTable_thRefs, _KupDataTable_rowsRefs, _KupDataTable_oldWidth, _KupDataTable_hold, _KupDataTable_interactableDrag, _KupDataTable_interactableDrop, _KupDataTable_interactableResize, _KupDataTable_interactableTouch, _KupDataTable_dropareaRef, _KupDataTable_removeDropareaRef, _KupDataTable_groupsDropareaRef, _KupDataTable_clickCb, _KupDataTable_clickCbCustomPanel, _KupDataTable_clickCbDropCard, _KupDataTable_resizeTimeout, _KupDataTable_columnMenuInstance, _KupDataTable_filtersColumnMenuInstance, _KupDataTable_filtersRowsInstance, _KupDataTable_detailCard, _KupDataTable_insertCard, _KupDataTable_actionsCard, _KupDataTable_confirmDeleteCard, _KupDataTable_confirmDeleteDialog, _KupDataTable_columnMenuCard, _KupDataTable_columnDropCard, _KupDataTable_columnDropCardAnchor, _KupDataTable_dropDownActionCardAnchor, _KupDataTable_insertCount, _KupDataTable_lastFocusedColumn, _KupDataTable_lastFocusedCell, _KupDataTable_lastFocusedRow, _KupDataTable_maxRowsPerPage, _KupDataTable_readyPromise, _KupDataTable_readyResolve, _KupDataTable_BUTTON_CANCEL_ID, _KupDataTable_BUTTON_SUBMIT_ID, _KupDataTable_FIELDS_FORM_ID, _KupDataTable_MESSAGE_ID, _KupDataTable_MESSAGE_WRAPPER_ID, _KupDataTable_INSERT_PREFIX, _KupDataTable_DEFAULT_ROWS_FOR_GLOBAL_FILTER, _KupDataTable_insertNewColumnInVisibleColumnsList, _KupDataTable_closeDropCard, _KupDataTable_createDropCard, _KupDataTable_calculateData, _KupDataTable_getRow, _KupDataTable__getRow, _KupDataTable_getTransposedData, _KupDataTable_setTransposedData, _KupDataTable_stickyHeaderPosition, _KupDataTable_updateStickyHeaderSize, _KupDataTable_setObserver, _KupDataTable_didLoadInteractables, _KupDataTable_didRenderInteractables, _KupDataTable_didLoadObservers, _KupDataTable_didRenderObservers, _KupDataTable_didLoadEventHandling, _KupDataTable_scrollStickyHeader, _KupDataTable_checkScrollOnHover, _KupDataTable_customizePanelPosition, _KupDataTable_rowsPointLength, _KupDataTable_paginatedRowsPointLength, _KupDataTable__rowsLength, _KupDataTable_resetSelectedRows, _KupDataTable_getSizedColumns, _KupDataTable_rowDetail, _KupDataTable_dropDownActions, _KupDataTable_createDropDownActionsCard, _KupDataTable_clearSearchActionsCard, _KupDataTable_filterRowActionsCard, _KupDataTable_closeRowActionsCard, _KupDataTable_closeColumnMenuCard, _KupDataTable_prepareDataForActionsCard, _KupDataTable_rowInsertForm, _KupDataTable_rowsDelete, _KupDataTable_getEventDetails, _KupDataTable_getEventDetailsForCurrentSelection, _KupDataTable_getSourceElementCoordsForCurrentSelection, _KupDataTable_clickHandler, _KupDataTable_cellActionsMenuHandler, _KupDataTable_contextMenuHandler, _KupDataTable_tooltipRequestHandler, _KupDataTable_contextMenuHandlerDetailsManager, _KupDataTable_dblClickHandler, _KupDataTable_initRows, _KupDataTable_filterRows, _KupDataTable_isGrouping, _KupDataTable_hasRowActions, _KupDataTable_removeGroup, _KupDataTable_hasTotals, _KupDataTable_tableHasAutoWidth, _KupDataTable_forceGroupExpansion, _KupDataTable_forceRowGroupExpansion, _KupDataTable_adjustPaginator, _KupDataTable_getCellEditability, _KupDataTable_composeFixedCellStyleAndClass, _KupDataTable_updateFixedRowsAndColumnsCssVariables, _KupDataTable_horNav, _KupDataTable_verNav, _KupDataTable_onKupKeyDown, _KupDataTable_onColumnSort, _KupDataTable_onRemoveFilter, _KupDataTable_getFilterValueForTooltip, _KupDataTable_onGlobalFilterChange, _KupDataTable_handlePageChange, _KupDataTable_handleRowsPerPageChange, _KupDataTable_onRowClick, _KupDataTable_selectColumn, _KupDataTable_deselectColumn, _KupDataTable_onRowActionExpanderClick, _KupDataTable_handleRowSelect, _KupDataTable_onRowExpand, _KupDataTable_onSelectAll, _KupDataTable_openTotalMenu, _KupDataTable_closeTotalMenu, _KupDataTable_isOpenedTotalMenuForColumn, _KupDataTable_groupRows, _KupDataTable_onLoadMoreClick, _KupDataTable_adjustGroupState, _KupDataTable_adjustGroupStateFromRow, _KupDataTable_sortRows, _KupDataTable_getSortIcon, _KupDataTable_getSortDecode, _KupDataTable_calculateColspan, _KupDataTable_isGroupExpanded, _KupDataTable_handleColumnSort, _KupDataTable_moveSortedColumns, _KupDataTable_handleUpdateClick, _KupDataTable_onBlurHandler, _KupDataTable_applyLineBreaks, _KupDataTable_composeHeaderCellClassAndStyle, _KupDataTable_renderHeader, _KupDataTable_renderStickyHeader, _KupDataTable_totalMenuPosition, _KupDataTable_onTotalMenuOpen, _KupDataTable_renderRow, _KupDataTable_onCustomSettingsClick, _KupDataTable_openCustomSettings, _KupDataTable_closeCustomSettings, _KupDataTable_renderPaginator, _KupDataTable_columnRemoveArea, _KupDataTable_columnGroupArea, _KupDataTable_hideShowColumnDropArea, _KupDataTable_handleColumnGroup, _KupDataTable_transcodeItem, _KupDataTable_createListData, _KupDataTable_FONTSIZE_CODES, _KupDataTable_FONTSIZE_DECODES, _KupDataTable_FONTSIZE_ICONS, _KupDataTable_getFontSizeCodeFromDecode, _KupDataTable_renderFontSizePanel, _KupDataTable_DENSITY_DECODES, _KupDataTable_DENSITY_ICONS, _KupDataTable_getDensityCodeFromDecode, _KupDataTable_renderDensityPanel, _KupDataTable_GRID_CODES, _KupDataTable_GRID_DECODES, _KupDataTable_GRID_ICONS, _KupDataTable_getGridCodeFromDecode, _KupDataTable_renderTransposeSwitch, _KupDataTable_renderGridPanel, _KupDataTable_renderCommandButton, _KupDataTable_handleChipsContextMenu, _KupDataTable_renderCommandDropDownButton, _KupDataTable_renderOtherButtons, _KupDataTable_addRowHandler, _KupDataTable_createRowWithInputFields, _KupDataTable_renderUpdateButtons, _KupDataTable_createDeletePayload, _KupDataTable_isRowInserted, _KupDataTable_isRowModified, _KupDataTable_arraysContainSameElements;
8748
+ var _KupDataTable_instances, _KupDataTable_checkUpdateState, _KupDataTable_initialized, _KupDataTable_cellToFocus, _KupDataTable_rows, _KupDataTable_rowsLength, _KupDataTable_paginatedRows, _KupDataTable_paginatedRowsLength, _KupDataTable_footer, _KupDataTable_kupManager, _KupDataTable_renderedRows, _KupDataTable_loadMoreEventCounter, _KupDataTable_loadMoreEventPreviousQuantity, _KupDataTable_theadRef, _KupDataTable_tableRef, _KupDataTable_originalData, _KupDataTable_originalDataLoaded, _KupDataTable_originalDataLoadedMaxId, _KupDataTable_insertedRowIds, _KupDataTable_modifiedRowsIds, _KupDataTable_tableAreaRef, _KupDataTable_stickyTheadRef, _KupDataTable_lastPointerDetails, _KupDataTable_customizeTopButtonRef, _KupDataTable_customizeTopPanelRef, _KupDataTable_sizedColumns, _KupDataTable_intObserver, _KupDataTable_navBarHeight, _KupDataTable_theadIntersecting, _KupDataTable_tableIntersecting, _KupDataTable_isSafariBrowser, _KupDataTable_isRestoringState, _KupDataTable_globalFilterTimeout, _KupDataTable_totalMenuCoords, _KupDataTable_clickTimeout, _KupDataTable_thRefs, _KupDataTable_rowsRefs, _KupDataTable_oldWidth, _KupDataTable_hold, _KupDataTable_interactableDrag, _KupDataTable_interactableDrop, _KupDataTable_interactableResize, _KupDataTable_interactableTouch, _KupDataTable_dropareaRef, _KupDataTable_removeDropareaRef, _KupDataTable_groupsDropareaRef, _KupDataTable_clickCb, _KupDataTable_clickCbCustomPanel, _KupDataTable_clickCbDropCard, _KupDataTable_resizeTimeout, _KupDataTable_columnMenuInstance, _KupDataTable_filtersColumnMenuInstance, _KupDataTable_filtersRowsInstance, _KupDataTable_detailCard, _KupDataTable_insertCard, _KupDataTable_actionsCard, _KupDataTable_confirmDeleteCard, _KupDataTable_confirmDeleteDialog, _KupDataTable_columnMenuCard, _KupDataTable_columnDropCard, _KupDataTable_columnDropCardAnchor, _KupDataTable_dropDownActionCardAnchor, _KupDataTable_insertCount, _KupDataTable_lastFocusedColumn, _KupDataTable_lastFocusedCell, _KupDataTable_lastFocusedRow, _KupDataTable_maxRowsPerPage, _KupDataTable_readyPromise, _KupDataTable_readyResolve, _KupDataTable_BUTTON_CANCEL_ID, _KupDataTable_BUTTON_SUBMIT_ID, _KupDataTable_FIELDS_FORM_ID, _KupDataTable_MESSAGE_ID, _KupDataTable_MESSAGE_WRAPPER_ID, _KupDataTable_INSERT_PREFIX, _KupDataTable_DEFAULT_ROWS_FOR_GLOBAL_FILTER, _KupDataTable_insertNewColumnInVisibleColumnsList, _KupDataTable_closeDropCard, _KupDataTable_createDropCard, _KupDataTable_calculateData, _KupDataTable_getRow, _KupDataTable__getRow, _KupDataTable_getTransposedData, _KupDataTable_setTransposedData, _KupDataTable_stickyHeaderPosition, _KupDataTable_updateStickyHeaderSize, _KupDataTable_setObserver, _KupDataTable_didLoadInteractables, _KupDataTable_didRenderInteractables, _KupDataTable_didLoadObservers, _KupDataTable_didRenderObservers, _KupDataTable_didLoadEventHandling, _KupDataTable_scrollStickyHeader, _KupDataTable_checkScrollOnHover, _KupDataTable_customizePanelPosition, _KupDataTable_rowsPointLength, _KupDataTable_paginatedRowsPointLength, _KupDataTable__rowsLength, _KupDataTable_resetSelectedRows, _KupDataTable_getSizedColumns, _KupDataTable_rowDetail, _KupDataTable_dropDownActions, _KupDataTable_createDropDownActionsCard, _KupDataTable_clearSearchActionsCard, _KupDataTable_filterRowActionsCard, _KupDataTable_closeRowActionsCard, _KupDataTable_closeColumnMenuCard, _KupDataTable_prepareDataForActionsCard, _KupDataTable_rowInsertForm, _KupDataTable_rowsDelete, _KupDataTable_getEventDetails, _KupDataTable_getEventDetailsForCurrentSelection, _KupDataTable_getSourceElementCoordsForCurrentSelection, _KupDataTable_clickHandler, _KupDataTable_cellActionsMenuHandler, _KupDataTable_contextMenuHandler, _KupDataTable_tooltipRequestHandler, _KupDataTable_contextMenuHandlerDetailsManager, _KupDataTable_dblClickHandler, _KupDataTable_initRows, _KupDataTable_filterRows, _KupDataTable_isGrouping, _KupDataTable_hasRowActions, _KupDataTable_removeGroup, _KupDataTable_hasTotals, _KupDataTable_tableHasAutoWidth, _KupDataTable_forceGroupExpansion, _KupDataTable_forceRowGroupExpansion, _KupDataTable_adjustPaginator, _KupDataTable_getCellEditability, _KupDataTable_composeFixedCellStyleAndClass, _KupDataTable_updateFixedRowsAndColumnsCssVariables, _KupDataTable_horNav, _KupDataTable_verNav, _KupDataTable_onKupKeyDown, _KupDataTable_onColumnSort, _KupDataTable_onRemoveFilter, _KupDataTable_getFilterValueForTooltip, _KupDataTable_onGlobalFilterChange, _KupDataTable_handlePageChange, _KupDataTable_handleRowsPerPageChange, _KupDataTable_onRowClick, _KupDataTable_selectColumn, _KupDataTable_deselectColumn, _KupDataTable_onRowActionExpanderClick, _KupDataTable_handleRowSelect, _KupDataTable_onRowExpand, _KupDataTable_onSelectAll, _KupDataTable_openTotalMenu, _KupDataTable_closeTotalMenu, _KupDataTable_isOpenedTotalMenuForColumn, _KupDataTable_groupRows, _KupDataTable_onLoadMoreClick, _KupDataTable_adjustGroupState, _KupDataTable_adjustGroupStateFromRow, _KupDataTable_sortRows, _KupDataTable_getSortIcon, _KupDataTable_getSortDecode, _KupDataTable_calculateColspan, _KupDataTable_isGroupExpanded, _KupDataTable_handleColumnSort, _KupDataTable_moveSortedColumns, _KupDataTable_handleUpdateClick, _KupDataTable_onBlurHandler, _KupDataTable_applyLineBreaks, _KupDataTable_composeHeaderCellClassAndStyle, _KupDataTable_renderHeader, _KupDataTable_renderStickyHeader, _KupDataTable_totalMenuPosition, _KupDataTable_onTotalMenuOpen, _KupDataTable_renderRow, _KupDataTable_onCustomSettingsClick, _KupDataTable_openCustomSettings, _KupDataTable_closeCustomSettings, _KupDataTable_renderPaginator, _KupDataTable_columnRemoveArea, _KupDataTable_columnGroupArea, _KupDataTable_hideShowColumnDropArea, _KupDataTable_handleColumnGroup, _KupDataTable_transcodeItem, _KupDataTable_createListData, _KupDataTable_FONTSIZE_CODES, _KupDataTable_FONTSIZE_DECODES, _KupDataTable_FONTSIZE_ICONS, _KupDataTable_getFontSizeCodeFromDecode, _KupDataTable_renderFontSizePanel, _KupDataTable_DENSITY_DECODES, _KupDataTable_DENSITY_ICONS, _KupDataTable_getDensityCodeFromDecode, _KupDataTable_renderDensityPanel, _KupDataTable_GRID_CODES, _KupDataTable_GRID_DECODES, _KupDataTable_GRID_ICONS, _KupDataTable_getGridCodeFromDecode, _KupDataTable_renderTransposeSwitch, _KupDataTable_renderGridPanel, _KupDataTable_renderCommandButton, _KupDataTable_handleChipsContextMenu, _KupDataTable_renderCommandDropDownButton, _KupDataTable_renderOtherButtons, _KupDataTable_addRowHandler, _KupDataTable_createRowWithInputFields, _KupDataTable_renderUpdateButtons, _KupDataTable_createDeletePayload, _KupDataTable_isRowInserted, _KupDataTable_isRowModified;
8749
8749
  const dom$2 = document.documentElement;
8750
8750
  const KupDataTable = class {
8751
8751
  constructor(hostRef) {
@@ -9015,28 +9015,40 @@ const KupDataTable = class {
9015
9015
  'grid_off',
9016
9016
  ]);
9017
9017
  _KupDataTable_addRowHandler.set(this, async (row) => {
9018
- var _a, _b;
9019
- var _c;
9020
9018
  let newRow;
9019
+ // Retrieves the currently selected rows, if any. They will be used as a
9020
+ // template for the new row when available.
9021
9021
  const selectedRows = await this.getSelectedRows();
9022
9022
  if (selectedRows.length > 0) {
9023
- newRow = JSON.parse(JSON.stringify(selectedRows[0]));
9024
- }
9025
- else if (((_b = (_a = __classPrivateFieldGet$8(this, _KupDataTable_originalDataLoaded, "f")) === null || _a === void 0 ? void 0 : _a.rows) === null || _b === void 0 ? void 0 : _b.length) > 0 && !row) {
9026
- newRow = JSON.parse(JSON.stringify(__classPrivateFieldGet$8(this, _KupDataTable_originalDataLoaded, "f").rows[0]));
9023
+ newRow = __classPrivateFieldGet$8(this, _KupDataTable_createRowWithInputFields, "f").call(this, selectedRows[0]);
9027
9024
  }
9028
9025
  else if (row) {
9026
+ // An explicit row was provided: build the new row from it, applying
9027
+ // the column input-field configuration.
9029
9028
  newRow = __classPrivateFieldGet$8(this, _KupDataTable_createRowWithInputFields, "f").call(this, row);
9030
9029
  }
9031
9030
  else {
9031
+ // Nothing to copy from: build a blank row with input fields based on
9032
+ // the current column definitions.
9032
9033
  newRow = __classPrivateFieldGet$8(this, _KupDataTable_createRowWithInputFields, "f").call(this);
9033
9034
  }
9035
+ // When no template was used (no selection and no explicit row), reset the
9036
+ // value of every cell so the new record is empty and ready for input.
9034
9037
  Object.values(newRow.cells).forEach((cell) => {
9035
- if (selectedRows.length == 0 && !row) {
9038
+ var _a;
9039
+ if (selectedRows.length === 0 && !row) {
9036
9040
  cell.value = '';
9041
+ if ((_a = cell === null || cell === void 0 ? void 0 : cell.data) === null || _a === void 0 ? void 0 : _a.initialValue) {
9042
+ cell.data.initialValue = '';
9043
+ }
9037
9044
  }
9038
9045
  });
9039
- newRow.id = (__classPrivateFieldGet$8(this, _KupDataTable_originalDataLoadedMaxId, "f") + __classPrivateFieldSet$4(this, _KupDataTable_insertCount, (_c = __classPrivateFieldGet$8(this, _KupDataTable_insertCount, "f"), ++_c), "f")).toString();
9046
+ // Assigns an id to the new row. The id is always the highest id
9047
+ // currently present in the data plus one, so inserted rows are always
9048
+ // ordered (0, 1, 2, 3, ...) regardless of insertions or deletions.
9049
+ const currentMaxId = this.data.rows.reduce((max, r) => Math.max(max, parseInt(r.id) || 0), __classPrivateFieldGet$8(this, _KupDataTable_originalDataLoadedMaxId, "f"));
9050
+ newRow.id = (currentMaxId + 1).toString();
9051
+ // Tracks the new row as inserted and prepends it to the table data.
9040
9052
  __classPrivateFieldGet$8(this, _KupDataTable_insertedRowIds, "f").push(newRow.id);
9041
9053
  this.insertNewRow(newRow, true);
9042
9054
  });
@@ -9045,18 +9057,22 @@ const KupDataTable = class {
9045
9057
  const row = { cells: {} };
9046
9058
  (_a = this.data) === null || _a === void 0 ? void 0 : _a.columns.forEach((c) => {
9047
9059
  var _a, _b, _c;
9060
+ const columnData = Object.assign(Object.assign({}, c === null || c === void 0 ? void 0 : c['data']), (c['length'] && c['maxLength']
9061
+ ? {
9062
+ size: c['length'],
9063
+ maxLength: c['maxLength'],
9064
+ }
9065
+ : {}));
9048
9066
  const cell = ((_a = rowToCopy === null || rowToCopy === void 0 ? void 0 : rowToCopy.cells) === null || _a === void 0 ? void 0 : _a[c.name])
9049
- ? structuredClone(rowToCopy.cells[c.name])
9067
+ ? (() => {
9068
+ const clonedCell = JSON.parse(JSON.stringify(rowToCopy.cells[c.name]));
9069
+ return Object.assign(Object.assign({}, clonedCell), { data: Object.assign(Object.assign({}, columnData), clonedCell === null || clonedCell === void 0 ? void 0 : clonedCell.data) });
9070
+ })()
9050
9071
  : {
9051
9072
  shape: (_b = c.shape) !== null && _b !== void 0 ? _b : kupManager$2.FCellShapes.TEXT_FIELD,
9052
9073
  obj: Object.assign({}, c.obj),
9053
9074
  isEditable: (_c = c.isEditable) !== null && _c !== void 0 ? _c : true,
9054
- data: c['length'] && c['maxLength']
9055
- ? {
9056
- size: c['length'],
9057
- maxLength: c['maxLength'],
9058
- }
9059
- : {},
9075
+ data: columnData,
9060
9076
  };
9061
9077
  row.cells[c.name] = cell;
9062
9078
  });
@@ -9164,7 +9180,6 @@ const KupDataTable = class {
9164
9180
  this.showFilters = state.showFilters;
9165
9181
  this.showGroups = state.showGroups;
9166
9182
  this.showHeader = state.showHeader;
9167
- this.showLoadMore = state.showLoadMore;
9168
9183
  this.showPaginator = state.showPaginator;
9169
9184
  this.hiddenSubmitButton = state.hiddenSubmitButton;
9170
9185
  this.sortEnabled = state.sortEnabled;
@@ -9277,7 +9292,9 @@ const KupDataTable = class {
9277
9292
  if (originalDataRowIndex > -1) {
9278
9293
  this.data.rows[originalDataRowIndex].cells =
9279
9294
  structuredClone(row.cells);
9280
- __classPrivateFieldGet$8(this, _KupDataTable_modifiedRowsIds, "f").push(`${originalDataRowIndex}`);
9295
+ // Track the row by its id (consistent with the other
9296
+ // places where #modifiedRowsIds is populated).
9297
+ __classPrivateFieldGet$8(this, _KupDataTable_modifiedRowsIds, "f").push(row.id);
9281
9298
  }
9282
9299
  else {
9283
9300
  __classPrivateFieldGet$8(this, _KupDataTable_addRowHandler, "f").call(this, row);
@@ -9392,6 +9409,10 @@ const KupDataTable = class {
9392
9409
  }
9393
9410
  if (deletedRows.length > 0) {
9394
9411
  this.data.rows = newRows;
9412
+ // Clean up the tracking arrays so deleted rows are no longer
9413
+ // considered inserted or modified.
9414
+ __classPrivateFieldSet$4(this, _KupDataTable_insertedRowIds, __classPrivateFieldGet$8(this, _KupDataTable_insertedRowIds, "f").filter((id) => !ids.includes(id)), "f");
9415
+ __classPrivateFieldSet$4(this, _KupDataTable_modifiedRowsIds, __classPrivateFieldGet$8(this, _KupDataTable_modifiedRowsIds, "f").filter((id) => !ids.includes(id)), "f");
9395
9416
  await this.refresh(true);
9396
9417
  }
9397
9418
  return deletedRows;
@@ -10338,7 +10359,7 @@ const KupDataTable = class {
10338
10359
  __classPrivateFieldSet$4(this, _KupDataTable_sizedColumns, __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_getSizedColumns).call(this), "f");
10339
10360
  let rows = null;
10340
10361
  if (__classPrivateFieldGet$8(this, _KupDataTable_paginatedRowsLength, "f") === 0) {
10341
- rows = (index.h("tr", { key: 'f987c3f6366b22e863c8d4e8a3610ad2685fcb0b', ref: (el) => __classPrivateFieldGet$8(this, _KupDataTable_rowsRefs, "f").push(el) }, index.h("td", { key: 'c607b07b802da55e185482d138ba06fc222fef4a', colSpan: __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_calculateColspan).call(this) }, this.emptyDataLabel)));
10362
+ rows = (index.h("tr", { key: '5d5bc9d717045ebacf203981e4cb82dc5e6743b3', ref: (el) => __classPrivateFieldGet$8(this, _KupDataTable_rowsRefs, "f").push(el) }, index.h("td", { key: 'edc985270001e7d4792aed4cadaf3b6ae8a9b16b', colSpan: __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_calculateColspan).call(this) }, this.emptyDataLabel)));
10342
10363
  }
10343
10364
  else {
10344
10365
  rows = [];
@@ -10414,7 +10435,7 @@ const KupDataTable = class {
10414
10435
  __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_handleChipsContextMenu).call(this, chipArg.id, e);
10415
10436
  });
10416
10437
  }
10417
- groupChips = index.h(fChip.FChip, Object.assign({ key: 'f33962278b5236b40270b87ce88a4832958a76b5' }, props));
10438
+ groupChips = index.h(fChip.FChip, Object.assign({ key: 'ebf94e6578476caaf11d9b33d020c07444cebcb4' }, props));
10418
10439
  }
10419
10440
  }
10420
10441
  const tableClass = {
@@ -10446,7 +10467,7 @@ const KupDataTable = class {
10446
10467
  if (this.headerIsPersistent &&
10447
10468
  this.tableHeight === undefined &&
10448
10469
  this.tableWidth === undefined) {
10449
- stickyEl = (index.h("sticky-header", { key: '0a8286472752256a549a59fec6d6a212db97e47e', class: "hover-scrolling-child", hidden: !this.showHeader, ref: (el) => (__classPrivateFieldSet$4(this, _KupDataTable_stickyTheadRef, el, "f")) }, index.h("thead-sticky", { key: 'd865f5e7f109cc2efd79345d011d485177f2a5fa' }, index.h("tr-sticky", { key: 'f13831067c2d0176cfb6e92b97f97478979bb7e2' }, stickyHeader))));
10470
+ stickyEl = (index.h("sticky-header", { key: 'adbf7ea77dd2538152d896c57f48aee731ec4bd0', class: "hover-scrolling-child", hidden: !this.showHeader, ref: (el) => (__classPrivateFieldSet$4(this, _KupDataTable_stickyTheadRef, el, "f")) }, index.h("thead-sticky", { key: '65884ef4206bcf998229298e1c947b45985455a6' }, index.h("tr-sticky", { key: '2c77fb6204cc5eec25b7d445491f32525246b334' }, stickyHeader))));
10450
10471
  }
10451
10472
  let belowClass = 'below-wrapper';
10452
10473
  if (!!this.tableHeight || !!this.tableWidth) {
@@ -10492,7 +10513,7 @@ const KupDataTable = class {
10492
10513
  const useGlobalFilter = !this.legacyLook &&
10493
10514
  (this.globalFilter ||
10494
10515
  this.getRows().length > __classPrivateFieldGet$8(this, _KupDataTable_DEFAULT_ROWS_FOR_GLOBAL_FILTER, "f"));
10495
- const compCreated = (index.h(index.Host, { key: 'cd4443e818e0cfec25dbab371f0956fdc11c8b2b', "onKup-drop": (e) => {
10516
+ const compCreated = (index.h(index.Host, { key: '002d8689464677ac797f2c221e6f6498b5b7876c', "onKup-drop": (e) => {
10496
10517
  this.kupDataTableDrop.emit(e.detail);
10497
10518
  }, "onKup-cell-input": (e) => {
10498
10519
  autoselectOnAction(e);
@@ -10511,11 +10532,11 @@ const KupDataTable = class {
10511
10532
  this.kupDataTableObjectFieldOpenSearchMenu.emit(e.detail);
10512
10533
  }, "onKup-objectfield-selectedmenuitem": (e) => {
10513
10534
  this.kupDataTableObjectFieldSelectedMenuItem.emit(e.detail);
10514
- } }, index.h("style", { key: 'a8cf226a460cdb0e03037ba8148318d5e9569bb6' }, __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").theme.setKupStyle(this.rootElement)), this.updatableData ? __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_renderUpdateButtons).call(this) : null, __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_renderOtherButtons).call(this), index.h("div", { key: '6cf2fbb93971c046094c38a4b97dea93ef5ad283', id: GenericVariables.componentWrapperId, class: wrapClass }, index.h("div", { key: '2c1f7ec7bea3116071b985ac6972e4f95340e3b3', class: "group-wrapper" }, groupChips), index.h("div", { key: 'e254306c9791c62583a3b460b54e795e8bd456c5', class: "actions-wrapper", style: actionWrapperWidth }, useGlobalFilter ? (index.h("div", { id: "global-filter" }, index.h(fTextField.FTextField, { fullWidth: true, icon: kupManager$2.KupThemeIconValues.SEARCH, label: __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").language.translate(kupManager$2.KupLanguageSearch.SEARCH), sizing: kupManager$2.KupComponentSizing.EXTRA_SMALL, value: this.globalFilterValue, onInput: (event) => {
10535
+ } }, index.h("style", { key: '969e09953a0852ddfb4f8cc09ae5c5eeaa7b31c1' }, __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").theme.setKupStyle(this.rootElement)), this.updatableData ? __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_renderUpdateButtons).call(this) : null, __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_renderOtherButtons).call(this), index.h("div", { key: '2ef668f26fc73d8da695997815f8aefe31d622b8', id: GenericVariables.componentWrapperId, class: wrapClass }, index.h("div", { key: 'f0b8d082c5b090e42a06805fde6a40ef7f320c1a', class: "group-wrapper" }, groupChips), index.h("div", { key: '1f6bf7d73994e3cfc0c923899e2eda527addb1bf', class: "actions-wrapper", style: actionWrapperWidth }, useGlobalFilter ? (index.h("div", { id: "global-filter" }, index.h(fTextField.FTextField, { fullWidth: true, icon: kupManager$2.KupThemeIconValues.SEARCH, label: __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").language.translate(kupManager$2.KupLanguageSearch.SEARCH), sizing: kupManager$2.KupComponentSizing.EXTRA_SMALL, value: this.globalFilterValue, onInput: (event) => {
10515
10536
  const t = event.target;
10516
10537
  window.clearTimeout(__classPrivateFieldGet$8(this, _KupDataTable_globalFilterTimeout, "f"));
10517
10538
  __classPrivateFieldSet$4(this, _KupDataTable_globalFilterTimeout, window.setTimeout(() => __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_onGlobalFilterChange).call(this, t), 600, t), "f");
10518
- } }))) : null, paginatorTop && (index.h("div", { key: 'b4e8ed279b3b90d408c1e17a268cf85a559ac127', class: "above-wrapper paginator-top" }, paginatorTop)), this.insertMode !== '' &&
10539
+ } }))) : null, paginatorTop && (index.h("div", { key: '0a20b56290794f7affeefd8160852c29187157e1', class: "above-wrapper paginator-top" }, paginatorTop)), this.insertMode !== '' &&
10519
10540
  this.selectedRows.length > 0 ? (index.h(fButton.FButton, { icon: "save", onClick: () => {
10520
10541
  this.kupSave.emit({
10521
10542
  comp: this,
@@ -10565,9 +10586,9 @@ const KupDataTable = class {
10565
10586
  this.data.rows.unshift(row);
10566
10587
  await this.refresh(true);
10567
10588
  }
10568
- }, sizing: kupManager$2.KupComponentSizing.MEDIUM, styling: fButtonDeclarations.FButtonStyling.RAISED, title: "Insert row", wrapperClass: "insert-button" })) : null), index.h("div", { key: '94e8f33892a6386d98d4b5f62eca219bab2e70f0', class: "droparea", ref: (el) => (__classPrivateFieldSet$4(this, _KupDataTable_dropareaRef, el, "f")) }, this.showGroups ? __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_columnGroupArea).call(this) : null, this.removableColumns
10589
+ }, sizing: kupManager$2.KupComponentSizing.MEDIUM, styling: fButtonDeclarations.FButtonStyling.RAISED, title: "Insert row", wrapperClass: "insert-button" })) : null), index.h("div", { key: 'cd25a52b1e91a96422b093fdc5bf04ee19550002', class: "droparea", ref: (el) => (__classPrivateFieldSet$4(this, _KupDataTable_dropareaRef, el, "f")) }, this.showGroups ? __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_columnGroupArea).call(this) : null, this.removableColumns
10569
10590
  ? __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_columnRemoveArea).call(this)
10570
- : null), index.h("div", { key: '67a27df5ebeac81fd972ba8fe2ca22bc499ed53a', style: elStyle, class: belowClass, ref: (el) => (__classPrivateFieldSet$4(this, _KupDataTable_tableAreaRef, el, "f")) }, this.showCustomization
10591
+ : null), index.h("div", { key: '5fb2e944ff0d5380133194a808c3a501510384da', style: elStyle, class: belowClass, ref: (el) => (__classPrivateFieldSet$4(this, _KupDataTable_tableAreaRef, el, "f")) }, this.showCustomization
10571
10592
  ? [
10572
10593
  index.h("div", { class: "settings-trigger", onClick: () => {
10573
10594
  __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_onCustomSettingsClick).call(this);
@@ -10576,7 +10597,7 @@ const KupDataTable = class {
10576
10597
  } }, index.h(fImage.FImage, { color: `var(${kupManager$2.KupThemeColorValues.TITLE})`, resource: "settings", sizeX: "10px" })),
10577
10598
  this.renderCustomizePanel(),
10578
10599
  ]
10579
- : null, index.h("table", { key: '273203f59396660c0ce7d1832bfc1648ee5130c5', class: tableClass, ref: (el) => (__classPrivateFieldSet$4(this, _KupDataTable_tableRef, el, "f")), onKeyDown: (e) => __classPrivateFieldGet$8(this, _KupDataTable_onKupKeyDown, "f").call(this, e), onMouseLeave: (ev) => {
10600
+ : null, index.h("table", { key: '666019cd7acb30ee4b5599969a09def220a6ad38', class: tableClass, ref: (el) => (__classPrivateFieldSet$4(this, _KupDataTable_tableRef, el, "f")), onKeyDown: (e) => __classPrivateFieldGet$8(this, _KupDataTable_onKupKeyDown, "f").call(this, e), onMouseLeave: (ev) => {
10580
10601
  ev.stopPropagation();
10581
10602
  }, onPointerDown: (e) => {
10582
10603
  __classPrivateFieldSet$4(this, _KupDataTable_lastPointerDetails, __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_getEventDetails).call(this, __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").getEventPath(e.target, this.rootElement), e), "f");
@@ -10584,7 +10605,7 @@ const KupDataTable = class {
10584
10605
  __classPrivateFieldSet$4(this, _KupDataTable_lastPointerDetails, __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_getEventDetails).call(this, __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").getEventPath(e.target, this.rootElement), e), "f");
10585
10606
  }, onContextMenu: (e) => {
10586
10607
  e.preventDefault();
10587
- } }, index.h("thead", { key: '384006d2bea506ec695ea05839da4e258920410d', hidden: !this.showHeader, ref: (el) => (__classPrivateFieldSet$4(this, _KupDataTable_theadRef, el, "f")) }, index.h("tr", { key: '48f8ee4f1af3ff927e513fc6e6cf865e665ebe1a' }, header)), index.h("tbody", { key: 'dd03070931cc4a2327c9bb4432f0e8719cb1de6d' }, rows), this.showFooter && this.renderFooter()), stickyEl), paginatorBottom)));
10608
+ } }, index.h("thead", { key: '86df3ea65b8bb4bb5f825bb0f4b2603397cf2959', hidden: !this.showHeader, ref: (el) => (__classPrivateFieldSet$4(this, _KupDataTable_theadRef, el, "f")) }, index.h("tr", { key: '50526a28db9536067341093310a8ee1d5aa0802e' }, header)), index.h("tbody", { key: '96ca0e2643e0c8a6c9634893c292a083dcc86890' }, rows), this.showFooter && this.renderFooter()), stickyEl), paginatorBottom)));
10588
10609
  __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").perfMonitoring.measure('componentRender', 'kup-data-table');
10589
10610
  return compCreated;
10590
10611
  }
@@ -10730,10 +10751,6 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_cellToFocus = new WeakM
10730
10751
  this.state.showHeader = this.showHeader;
10731
10752
  somethingChanged = true;
10732
10753
  }
10733
- if (!__classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").objects.deepEqual(this.state.showLoadMore, this.showLoadMore)) {
10734
- this.state.showLoadMore = this.showLoadMore;
10735
- somethingChanged = true;
10736
- }
10737
10754
  if (!__classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").objects.deepEqual(this.state.showPaginator, this.showPaginator)) {
10738
10755
  this.state.showPaginator = this.showPaginator;
10739
10756
  somethingChanged = true;
@@ -12922,7 +12939,7 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_cellToFocus = new WeakM
12922
12939
  }
12923
12940
  // Renders plain rows cells
12924
12941
  const cells = visibleColumns.map((currentColumn, cellIndex) => {
12925
- var _a, _b, _c;
12942
+ var _a, _b, _c, _d, _e, _f, _g;
12926
12943
  const { name, hideValuesRepetitions } = currentColumn;
12927
12944
  const indend = [];
12928
12945
  if (cellIndex === 0) {
@@ -12942,14 +12959,20 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_cellToFocus = new WeakM
12942
12959
  cell.isEditable = __classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_getCellEditability).call(this, currentColumn, row, cell);
12943
12960
  cell.data = Object.assign(Object.assign({}, cell.data), { legacyLook: this.legacyLook, sizing: this.density === 'extra_dense'
12944
12961
  ? 'extra-small'
12945
- : (_a = cell.data) === null || _a === void 0 ? void 0 : _a.sizing });
12962
+ : (_a = cell.data) === null || _a === void 0 ? void 0 : _a.sizing, maxLength: ((_b = cell.data) === null || _b === void 0 ? void 0 : _b.maxLength) !== null &&
12963
+ ((_c = cell.data) === null || _c === void 0 ? void 0 : _c.maxLength) !== undefined
12964
+ ? cell.data['maxLength']
12965
+ : currentColumn === null || currentColumn === void 0 ? void 0 : currentColumn['maxLength'], size: ((_d = cell.data) === null || _d === void 0 ? void 0 : _d.length) !== null &&
12966
+ ((_e = cell.data) === null || _e === void 0 ? void 0 : _e.length) !== undefined
12967
+ ? cell.data['length']
12968
+ : currentColumn === null || currentColumn === void 0 ? void 0 : currentColumn['length'] });
12946
12969
  if (!cell.isEditable) {
12947
12970
  cell.cssClass =
12948
12971
  __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").data.cell.getObjectRelatedStyleClasses(Object.assign(Object.assign({}, cell.obj), { k: cell.value }), cell.cssClass);
12949
12972
  }
12950
12973
  const fcell = Object.assign(Object.assign({}, __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").data.cell.buildFCell(cell, currentColumn, row)), { component: this, density: this.density, editable: this.editableData || this.updatableData, indents: indend, previousValue: hideValuesRepetitions && previousRow
12951
- ? (_b = previousRow.cells[name].decode) !== null && _b !== void 0 ? _b : previousRow.cells[name].value
12952
- : undefined, renderKup: this.lazyLoadCells, cellActionIcon: __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").data.cell.hasActionCell(cell, (_c = this.commands) !== null && _c !== void 0 ? _c : [])
12974
+ ? ((_f = previousRow.cells[name].decode) !== null && _f !== void 0 ? _f : previousRow.cells[name].value)
12975
+ : undefined, renderKup: this.lazyLoadCells, cellActionIcon: __classPrivateFieldGet$8(this, _KupDataTable_kupManager, "f").data.cell.hasActionCell(cell, (_g = this.commands) !== null && _g !== void 0 ? _g : [])
12953
12976
  ? {
12954
12977
  onClick: (e) => {
12955
12978
  this.kupCellActionIconClick.emit({
@@ -13315,9 +13338,10 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_cellToFocus = new WeakM
13315
13338
  onClickHandler: () => {
13316
13339
  const selectedRowsIds = this.selectedRows.map((row) => row.id);
13317
13340
  const insertedRowsIds = __classPrivateFieldGet$8(this, _KupDataTable_insertedRowIds, "f");
13318
- if (__classPrivateFieldGet$8(this, _KupDataTable_instances, "m", _KupDataTable_arraysContainSameElements).call(this, selectedRowsIds, insertedRowsIds)) {
13319
- //If the only rows to delete are the ones inserted by the user
13320
- //AND NOT CONFIRMED, avoid calling the update
13341
+ // If every selected row is an inserted (unconfirmed) row,
13342
+ // delete them locally without calling the update.
13343
+ const allSelectedAreInserted = selectedRowsIds.every((id) => insertedRowsIds.includes(id));
13344
+ if (allSelectedAreInserted) {
13321
13345
  this.deleteRows(selectedRowsIds);
13322
13346
  }
13323
13347
  else {
@@ -13351,12 +13375,6 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_cellToFocus = new WeakM
13351
13375
  return __classPrivateFieldGet$8(this, _KupDataTable_insertedRowIds, "f").includes(rowId);
13352
13376
  }, _KupDataTable_isRowModified = function _KupDataTable_isRowModified(rowId) {
13353
13377
  return __classPrivateFieldGet$8(this, _KupDataTable_modifiedRowsIds, "f").includes(rowId);
13354
- }, _KupDataTable_arraysContainSameElements = function _KupDataTable_arraysContainSameElements(arr1, arr2) {
13355
- if (arr1.length !== arr2.length)
13356
- return false;
13357
- const sorted1 = [...arr1].sort();
13358
- const sorted2 = [...arr2].sort();
13359
- return sorted1.every((val, index) => val === sorted2[index]);
13360
13378
  };
13361
13379
  KupDataTable.style = KupDataTableStyle0;
13362
13380
 
@@ -14,7 +14,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
14
14
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
15
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
16
  };
17
- var _KupDataTable_instances, _KupDataTable_checkUpdateState, _KupDataTable_initialized, _KupDataTable_cellToFocus, _KupDataTable_rows, _KupDataTable_rowsLength, _KupDataTable_paginatedRows, _KupDataTable_paginatedRowsLength, _KupDataTable_footer, _KupDataTable_kupManager, _KupDataTable_renderedRows, _KupDataTable_loadMoreEventCounter, _KupDataTable_loadMoreEventPreviousQuantity, _KupDataTable_theadRef, _KupDataTable_tableRef, _KupDataTable_originalData, _KupDataTable_originalDataLoaded, _KupDataTable_originalDataLoadedMaxId, _KupDataTable_insertedRowIds, _KupDataTable_modifiedRowsIds, _KupDataTable_tableAreaRef, _KupDataTable_stickyTheadRef, _KupDataTable_lastPointerDetails, _KupDataTable_customizeTopButtonRef, _KupDataTable_customizeTopPanelRef, _KupDataTable_sizedColumns, _KupDataTable_intObserver, _KupDataTable_navBarHeight, _KupDataTable_theadIntersecting, _KupDataTable_tableIntersecting, _KupDataTable_isSafariBrowser, _KupDataTable_isRestoringState, _KupDataTable_globalFilterTimeout, _KupDataTable_totalMenuCoords, _KupDataTable_clickTimeout, _KupDataTable_thRefs, _KupDataTable_rowsRefs, _KupDataTable_oldWidth, _KupDataTable_hold, _KupDataTable_interactableDrag, _KupDataTable_interactableDrop, _KupDataTable_interactableResize, _KupDataTable_interactableTouch, _KupDataTable_dropareaRef, _KupDataTable_removeDropareaRef, _KupDataTable_groupsDropareaRef, _KupDataTable_clickCb, _KupDataTable_clickCbCustomPanel, _KupDataTable_clickCbDropCard, _KupDataTable_resizeTimeout, _KupDataTable_columnMenuInstance, _KupDataTable_filtersColumnMenuInstance, _KupDataTable_filtersRowsInstance, _KupDataTable_detailCard, _KupDataTable_insertCard, _KupDataTable_actionsCard, _KupDataTable_confirmDeleteCard, _KupDataTable_confirmDeleteDialog, _KupDataTable_columnMenuCard, _KupDataTable_columnDropCard, _KupDataTable_columnDropCardAnchor, _KupDataTable_dropDownActionCardAnchor, _KupDataTable_insertCount, _KupDataTable_lastFocusedColumn, _KupDataTable_lastFocusedCell, _KupDataTable_lastFocusedRow, _KupDataTable_maxRowsPerPage, _KupDataTable_readyPromise, _KupDataTable_readyResolve, _KupDataTable_BUTTON_CANCEL_ID, _KupDataTable_BUTTON_SUBMIT_ID, _KupDataTable_FIELDS_FORM_ID, _KupDataTable_MESSAGE_ID, _KupDataTable_MESSAGE_WRAPPER_ID, _KupDataTable_INSERT_PREFIX, _KupDataTable_DEFAULT_ROWS_FOR_GLOBAL_FILTER, _KupDataTable_insertNewColumnInVisibleColumnsList, _KupDataTable_closeDropCard, _KupDataTable_createDropCard, _KupDataTable_calculateData, _KupDataTable_getRow, _KupDataTable__getRow, _KupDataTable_getTransposedData, _KupDataTable_setTransposedData, _KupDataTable_stickyHeaderPosition, _KupDataTable_updateStickyHeaderSize, _KupDataTable_setObserver, _KupDataTable_didLoadInteractables, _KupDataTable_didRenderInteractables, _KupDataTable_didLoadObservers, _KupDataTable_didRenderObservers, _KupDataTable_didLoadEventHandling, _KupDataTable_scrollStickyHeader, _KupDataTable_checkScrollOnHover, _KupDataTable_customizePanelPosition, _KupDataTable_rowsPointLength, _KupDataTable_paginatedRowsPointLength, _KupDataTable__rowsLength, _KupDataTable_resetSelectedRows, _KupDataTable_getSizedColumns, _KupDataTable_rowDetail, _KupDataTable_dropDownActions, _KupDataTable_createDropDownActionsCard, _KupDataTable_clearSearchActionsCard, _KupDataTable_filterRowActionsCard, _KupDataTable_closeRowActionsCard, _KupDataTable_closeColumnMenuCard, _KupDataTable_prepareDataForActionsCard, _KupDataTable_rowInsertForm, _KupDataTable_rowsDelete, _KupDataTable_getEventDetails, _KupDataTable_getEventDetailsForCurrentSelection, _KupDataTable_getSourceElementCoordsForCurrentSelection, _KupDataTable_clickHandler, _KupDataTable_cellActionsMenuHandler, _KupDataTable_contextMenuHandler, _KupDataTable_tooltipRequestHandler, _KupDataTable_contextMenuHandlerDetailsManager, _KupDataTable_dblClickHandler, _KupDataTable_initRows, _KupDataTable_filterRows, _KupDataTable_isGrouping, _KupDataTable_hasRowActions, _KupDataTable_removeGroup, _KupDataTable_hasTotals, _KupDataTable_tableHasAutoWidth, _KupDataTable_forceGroupExpansion, _KupDataTable_forceRowGroupExpansion, _KupDataTable_adjustPaginator, _KupDataTable_getCellEditability, _KupDataTable_composeFixedCellStyleAndClass, _KupDataTable_updateFixedRowsAndColumnsCssVariables, _KupDataTable_horNav, _KupDataTable_verNav, _KupDataTable_onKupKeyDown, _KupDataTable_onColumnSort, _KupDataTable_onRemoveFilter, _KupDataTable_getFilterValueForTooltip, _KupDataTable_onGlobalFilterChange, _KupDataTable_handlePageChange, _KupDataTable_handleRowsPerPageChange, _KupDataTable_onRowClick, _KupDataTable_selectColumn, _KupDataTable_deselectColumn, _KupDataTable_onRowActionExpanderClick, _KupDataTable_handleRowSelect, _KupDataTable_onRowExpand, _KupDataTable_onSelectAll, _KupDataTable_openTotalMenu, _KupDataTable_closeTotalMenu, _KupDataTable_isOpenedTotalMenuForColumn, _KupDataTable_groupRows, _KupDataTable_onLoadMoreClick, _KupDataTable_adjustGroupState, _KupDataTable_adjustGroupStateFromRow, _KupDataTable_sortRows, _KupDataTable_getSortIcon, _KupDataTable_getSortDecode, _KupDataTable_calculateColspan, _KupDataTable_isGroupExpanded, _KupDataTable_handleColumnSort, _KupDataTable_moveSortedColumns, _KupDataTable_handleUpdateClick, _KupDataTable_onBlurHandler, _KupDataTable_applyLineBreaks, _KupDataTable_composeHeaderCellClassAndStyle, _KupDataTable_renderHeader, _KupDataTable_renderStickyHeader, _KupDataTable_totalMenuPosition, _KupDataTable_onTotalMenuOpen, _KupDataTable_renderRow, _KupDataTable_onCustomSettingsClick, _KupDataTable_openCustomSettings, _KupDataTable_closeCustomSettings, _KupDataTable_renderPaginator, _KupDataTable_columnRemoveArea, _KupDataTable_columnGroupArea, _KupDataTable_hideShowColumnDropArea, _KupDataTable_handleColumnGroup, _KupDataTable_transcodeItem, _KupDataTable_createListData, _KupDataTable_FONTSIZE_CODES, _KupDataTable_FONTSIZE_DECODES, _KupDataTable_FONTSIZE_ICONS, _KupDataTable_getFontSizeCodeFromDecode, _KupDataTable_renderFontSizePanel, _KupDataTable_DENSITY_DECODES, _KupDataTable_DENSITY_ICONS, _KupDataTable_getDensityCodeFromDecode, _KupDataTable_renderDensityPanel, _KupDataTable_GRID_CODES, _KupDataTable_GRID_DECODES, _KupDataTable_GRID_ICONS, _KupDataTable_getGridCodeFromDecode, _KupDataTable_renderTransposeSwitch, _KupDataTable_renderGridPanel, _KupDataTable_renderCommandButton, _KupDataTable_handleChipsContextMenu, _KupDataTable_renderCommandDropDownButton, _KupDataTable_renderOtherButtons, _KupDataTable_addRowHandler, _KupDataTable_createRowWithInputFields, _KupDataTable_renderUpdateButtons, _KupDataTable_createDeletePayload, _KupDataTable_isRowInserted, _KupDataTable_isRowModified, _KupDataTable_arraysContainSameElements;
17
+ var _KupDataTable_instances, _KupDataTable_checkUpdateState, _KupDataTable_initialized, _KupDataTable_cellToFocus, _KupDataTable_rows, _KupDataTable_rowsLength, _KupDataTable_paginatedRows, _KupDataTable_paginatedRowsLength, _KupDataTable_footer, _KupDataTable_kupManager, _KupDataTable_renderedRows, _KupDataTable_loadMoreEventCounter, _KupDataTable_loadMoreEventPreviousQuantity, _KupDataTable_theadRef, _KupDataTable_tableRef, _KupDataTable_originalData, _KupDataTable_originalDataLoaded, _KupDataTable_originalDataLoadedMaxId, _KupDataTable_insertedRowIds, _KupDataTable_modifiedRowsIds, _KupDataTable_tableAreaRef, _KupDataTable_stickyTheadRef, _KupDataTable_lastPointerDetails, _KupDataTable_customizeTopButtonRef, _KupDataTable_customizeTopPanelRef, _KupDataTable_sizedColumns, _KupDataTable_intObserver, _KupDataTable_navBarHeight, _KupDataTable_theadIntersecting, _KupDataTable_tableIntersecting, _KupDataTable_isSafariBrowser, _KupDataTable_isRestoringState, _KupDataTable_globalFilterTimeout, _KupDataTable_totalMenuCoords, _KupDataTable_clickTimeout, _KupDataTable_thRefs, _KupDataTable_rowsRefs, _KupDataTable_oldWidth, _KupDataTable_hold, _KupDataTable_interactableDrag, _KupDataTable_interactableDrop, _KupDataTable_interactableResize, _KupDataTable_interactableTouch, _KupDataTable_dropareaRef, _KupDataTable_removeDropareaRef, _KupDataTable_groupsDropareaRef, _KupDataTable_clickCb, _KupDataTable_clickCbCustomPanel, _KupDataTable_clickCbDropCard, _KupDataTable_resizeTimeout, _KupDataTable_columnMenuInstance, _KupDataTable_filtersColumnMenuInstance, _KupDataTable_filtersRowsInstance, _KupDataTable_detailCard, _KupDataTable_insertCard, _KupDataTable_actionsCard, _KupDataTable_confirmDeleteCard, _KupDataTable_confirmDeleteDialog, _KupDataTable_columnMenuCard, _KupDataTable_columnDropCard, _KupDataTable_columnDropCardAnchor, _KupDataTable_dropDownActionCardAnchor, _KupDataTable_insertCount, _KupDataTable_lastFocusedColumn, _KupDataTable_lastFocusedCell, _KupDataTable_lastFocusedRow, _KupDataTable_maxRowsPerPage, _KupDataTable_readyPromise, _KupDataTable_readyResolve, _KupDataTable_BUTTON_CANCEL_ID, _KupDataTable_BUTTON_SUBMIT_ID, _KupDataTable_FIELDS_FORM_ID, _KupDataTable_MESSAGE_ID, _KupDataTable_MESSAGE_WRAPPER_ID, _KupDataTable_INSERT_PREFIX, _KupDataTable_DEFAULT_ROWS_FOR_GLOBAL_FILTER, _KupDataTable_insertNewColumnInVisibleColumnsList, _KupDataTable_closeDropCard, _KupDataTable_createDropCard, _KupDataTable_calculateData, _KupDataTable_getRow, _KupDataTable__getRow, _KupDataTable_getTransposedData, _KupDataTable_setTransposedData, _KupDataTable_stickyHeaderPosition, _KupDataTable_updateStickyHeaderSize, _KupDataTable_setObserver, _KupDataTable_didLoadInteractables, _KupDataTable_didRenderInteractables, _KupDataTable_didLoadObservers, _KupDataTable_didRenderObservers, _KupDataTable_didLoadEventHandling, _KupDataTable_scrollStickyHeader, _KupDataTable_checkScrollOnHover, _KupDataTable_customizePanelPosition, _KupDataTable_rowsPointLength, _KupDataTable_paginatedRowsPointLength, _KupDataTable__rowsLength, _KupDataTable_resetSelectedRows, _KupDataTable_getSizedColumns, _KupDataTable_rowDetail, _KupDataTable_dropDownActions, _KupDataTable_createDropDownActionsCard, _KupDataTable_clearSearchActionsCard, _KupDataTable_filterRowActionsCard, _KupDataTable_closeRowActionsCard, _KupDataTable_closeColumnMenuCard, _KupDataTable_prepareDataForActionsCard, _KupDataTable_rowInsertForm, _KupDataTable_rowsDelete, _KupDataTable_getEventDetails, _KupDataTable_getEventDetailsForCurrentSelection, _KupDataTable_getSourceElementCoordsForCurrentSelection, _KupDataTable_clickHandler, _KupDataTable_cellActionsMenuHandler, _KupDataTable_contextMenuHandler, _KupDataTable_tooltipRequestHandler, _KupDataTable_contextMenuHandlerDetailsManager, _KupDataTable_dblClickHandler, _KupDataTable_initRows, _KupDataTable_filterRows, _KupDataTable_isGrouping, _KupDataTable_hasRowActions, _KupDataTable_removeGroup, _KupDataTable_hasTotals, _KupDataTable_tableHasAutoWidth, _KupDataTable_forceGroupExpansion, _KupDataTable_forceRowGroupExpansion, _KupDataTable_adjustPaginator, _KupDataTable_getCellEditability, _KupDataTable_composeFixedCellStyleAndClass, _KupDataTable_updateFixedRowsAndColumnsCssVariables, _KupDataTable_horNav, _KupDataTable_verNav, _KupDataTable_onKupKeyDown, _KupDataTable_onColumnSort, _KupDataTable_onRemoveFilter, _KupDataTable_getFilterValueForTooltip, _KupDataTable_onGlobalFilterChange, _KupDataTable_handlePageChange, _KupDataTable_handleRowsPerPageChange, _KupDataTable_onRowClick, _KupDataTable_selectColumn, _KupDataTable_deselectColumn, _KupDataTable_onRowActionExpanderClick, _KupDataTable_handleRowSelect, _KupDataTable_onRowExpand, _KupDataTable_onSelectAll, _KupDataTable_openTotalMenu, _KupDataTable_closeTotalMenu, _KupDataTable_isOpenedTotalMenuForColumn, _KupDataTable_groupRows, _KupDataTable_onLoadMoreClick, _KupDataTable_adjustGroupState, _KupDataTable_adjustGroupStateFromRow, _KupDataTable_sortRows, _KupDataTable_getSortIcon, _KupDataTable_getSortDecode, _KupDataTable_calculateColspan, _KupDataTable_isGroupExpanded, _KupDataTable_handleColumnSort, _KupDataTable_moveSortedColumns, _KupDataTable_handleUpdateClick, _KupDataTable_onBlurHandler, _KupDataTable_applyLineBreaks, _KupDataTable_composeHeaderCellClassAndStyle, _KupDataTable_renderHeader, _KupDataTable_renderStickyHeader, _KupDataTable_totalMenuPosition, _KupDataTable_onTotalMenuOpen, _KupDataTable_renderRow, _KupDataTable_onCustomSettingsClick, _KupDataTable_openCustomSettings, _KupDataTable_closeCustomSettings, _KupDataTable_renderPaginator, _KupDataTable_columnRemoveArea, _KupDataTable_columnGroupArea, _KupDataTable_hideShowColumnDropArea, _KupDataTable_handleColumnGroup, _KupDataTable_transcodeItem, _KupDataTable_createListData, _KupDataTable_FONTSIZE_CODES, _KupDataTable_FONTSIZE_DECODES, _KupDataTable_FONTSIZE_ICONS, _KupDataTable_getFontSizeCodeFromDecode, _KupDataTable_renderFontSizePanel, _KupDataTable_DENSITY_DECODES, _KupDataTable_DENSITY_ICONS, _KupDataTable_getDensityCodeFromDecode, _KupDataTable_renderDensityPanel, _KupDataTable_GRID_CODES, _KupDataTable_GRID_DECODES, _KupDataTable_GRID_ICONS, _KupDataTable_getGridCodeFromDecode, _KupDataTable_renderTransposeSwitch, _KupDataTable_renderGridPanel, _KupDataTable_renderCommandButton, _KupDataTable_handleChipsContextMenu, _KupDataTable_renderCommandDropDownButton, _KupDataTable_renderOtherButtons, _KupDataTable_addRowHandler, _KupDataTable_createRowWithInputFields, _KupDataTable_renderUpdateButtons, _KupDataTable_createDeletePayload, _KupDataTable_isRowInserted, _KupDataTable_isRowModified;
18
18
  import { forceUpdate, h, Host, } from "@stencil/core";
19
19
  import { FixedCellsClasses, FixedCellsCSSVarsBase, GroupLabelDisplayMode, LoadMoreMode, PaginatorPos, ShowGrid, SortMode, TotalMode, TotalLabel, KupDataTableProps, fieldColumn, iconColumn, keyColumn, SelectionMode, DataTableAreasEnum, TypesToDuplicate, } from "./kup-data-table-declarations";
20
20
  import { getColumnByName, getValueForDisplay, isNegativeNumber, } from "../../utils/cell-utils";
@@ -288,28 +288,40 @@ export class KupDataTable {
288
288
  'grid_off',
289
289
  ]);
290
290
  _KupDataTable_addRowHandler.set(this, async (row) => {
291
- var _a, _b;
292
- var _c;
293
291
  let newRow;
292
+ // Retrieves the currently selected rows, if any. They will be used as a
293
+ // template for the new row when available.
294
294
  const selectedRows = await this.getSelectedRows();
295
295
  if (selectedRows.length > 0) {
296
- newRow = JSON.parse(JSON.stringify(selectedRows[0]));
297
- }
298
- else if (((_b = (_a = __classPrivateFieldGet(this, _KupDataTable_originalDataLoaded, "f")) === null || _a === void 0 ? void 0 : _a.rows) === null || _b === void 0 ? void 0 : _b.length) > 0 && !row) {
299
- newRow = JSON.parse(JSON.stringify(__classPrivateFieldGet(this, _KupDataTable_originalDataLoaded, "f").rows[0]));
296
+ newRow = __classPrivateFieldGet(this, _KupDataTable_createRowWithInputFields, "f").call(this, selectedRows[0]);
300
297
  }
301
298
  else if (row) {
299
+ // An explicit row was provided: build the new row from it, applying
300
+ // the column input-field configuration.
302
301
  newRow = __classPrivateFieldGet(this, _KupDataTable_createRowWithInputFields, "f").call(this, row);
303
302
  }
304
303
  else {
304
+ // Nothing to copy from: build a blank row with input fields based on
305
+ // the current column definitions.
305
306
  newRow = __classPrivateFieldGet(this, _KupDataTable_createRowWithInputFields, "f").call(this);
306
307
  }
308
+ // When no template was used (no selection and no explicit row), reset the
309
+ // value of every cell so the new record is empty and ready for input.
307
310
  Object.values(newRow.cells).forEach((cell) => {
308
- if (selectedRows.length == 0 && !row) {
311
+ var _a;
312
+ if (selectedRows.length === 0 && !row) {
309
313
  cell.value = '';
314
+ if ((_a = cell === null || cell === void 0 ? void 0 : cell.data) === null || _a === void 0 ? void 0 : _a.initialValue) {
315
+ cell.data.initialValue = '';
316
+ }
310
317
  }
311
318
  });
312
- newRow.id = (__classPrivateFieldGet(this, _KupDataTable_originalDataLoadedMaxId, "f") + __classPrivateFieldSet(this, _KupDataTable_insertCount, (_c = __classPrivateFieldGet(this, _KupDataTable_insertCount, "f"), ++_c), "f")).toString();
319
+ // Assigns an id to the new row. The id is always the highest id
320
+ // currently present in the data plus one, so inserted rows are always
321
+ // ordered (0, 1, 2, 3, ...) regardless of insertions or deletions.
322
+ const currentMaxId = this.data.rows.reduce((max, r) => Math.max(max, parseInt(r.id) || 0), __classPrivateFieldGet(this, _KupDataTable_originalDataLoadedMaxId, "f"));
323
+ newRow.id = (currentMaxId + 1).toString();
324
+ // Tracks the new row as inserted and prepends it to the table data.
313
325
  __classPrivateFieldGet(this, _KupDataTable_insertedRowIds, "f").push(newRow.id);
314
326
  this.insertNewRow(newRow, true);
315
327
  });
@@ -318,18 +330,22 @@ export class KupDataTable {
318
330
  const row = { cells: {} };
319
331
  (_a = this.data) === null || _a === void 0 ? void 0 : _a.columns.forEach((c) => {
320
332
  var _a, _b, _c;
333
+ const columnData = Object.assign(Object.assign({}, c === null || c === void 0 ? void 0 : c['data']), (c['length'] && c['maxLength']
334
+ ? {
335
+ size: c['length'],
336
+ maxLength: c['maxLength'],
337
+ }
338
+ : {}));
321
339
  const cell = ((_a = rowToCopy === null || rowToCopy === void 0 ? void 0 : rowToCopy.cells) === null || _a === void 0 ? void 0 : _a[c.name])
322
- ? structuredClone(rowToCopy.cells[c.name])
340
+ ? (() => {
341
+ const clonedCell = JSON.parse(JSON.stringify(rowToCopy.cells[c.name]));
342
+ return Object.assign(Object.assign({}, clonedCell), { data: Object.assign(Object.assign({}, columnData), clonedCell === null || clonedCell === void 0 ? void 0 : clonedCell.data) });
343
+ })()
323
344
  : {
324
345
  shape: (_b = c.shape) !== null && _b !== void 0 ? _b : FCellShapes.TEXT_FIELD,
325
346
  obj: Object.assign({}, c.obj),
326
347
  isEditable: (_c = c.isEditable) !== null && _c !== void 0 ? _c : true,
327
- data: c['length'] && c['maxLength']
328
- ? {
329
- size: c['length'],
330
- maxLength: c['maxLength'],
331
- }
332
- : {},
348
+ data: columnData,
333
349
  };
334
350
  row.cells[c.name] = cell;
335
351
  });
@@ -437,7 +453,6 @@ export class KupDataTable {
437
453
  this.showFilters = state.showFilters;
438
454
  this.showGroups = state.showGroups;
439
455
  this.showHeader = state.showHeader;
440
- this.showLoadMore = state.showLoadMore;
441
456
  this.showPaginator = state.showPaginator;
442
457
  this.hiddenSubmitButton = state.hiddenSubmitButton;
443
458
  this.sortEnabled = state.sortEnabled;
@@ -550,7 +565,9 @@ export class KupDataTable {
550
565
  if (originalDataRowIndex > -1) {
551
566
  this.data.rows[originalDataRowIndex].cells =
552
567
  structuredClone(row.cells);
553
- __classPrivateFieldGet(this, _KupDataTable_modifiedRowsIds, "f").push(`${originalDataRowIndex}`);
568
+ // Track the row by its id (consistent with the other
569
+ // places where #modifiedRowsIds is populated).
570
+ __classPrivateFieldGet(this, _KupDataTable_modifiedRowsIds, "f").push(row.id);
554
571
  }
555
572
  else {
556
573
  __classPrivateFieldGet(this, _KupDataTable_addRowHandler, "f").call(this, row);
@@ -665,6 +682,10 @@ export class KupDataTable {
665
682
  }
666
683
  if (deletedRows.length > 0) {
667
684
  this.data.rows = newRows;
685
+ // Clean up the tracking arrays so deleted rows are no longer
686
+ // considered inserted or modified.
687
+ __classPrivateFieldSet(this, _KupDataTable_insertedRowIds, __classPrivateFieldGet(this, _KupDataTable_insertedRowIds, "f").filter((id) => !ids.includes(id)), "f");
688
+ __classPrivateFieldSet(this, _KupDataTable_modifiedRowsIds, __classPrivateFieldGet(this, _KupDataTable_modifiedRowsIds, "f").filter((id) => !ids.includes(id)), "f");
668
689
  await this.refresh(true);
669
690
  }
670
691
  return deletedRows;
@@ -1613,7 +1634,7 @@ export class KupDataTable {
1613
1634
  __classPrivateFieldSet(this, _KupDataTable_sizedColumns, __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_getSizedColumns).call(this), "f");
1614
1635
  let rows = null;
1615
1636
  if (__classPrivateFieldGet(this, _KupDataTable_paginatedRowsLength, "f") === 0) {
1616
- rows = (h("tr", { key: 'f987c3f6366b22e863c8d4e8a3610ad2685fcb0b', ref: (el) => __classPrivateFieldGet(this, _KupDataTable_rowsRefs, "f").push(el) }, h("td", { key: 'c607b07b802da55e185482d138ba06fc222fef4a', colSpan: __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_calculateColspan).call(this) }, this.emptyDataLabel)));
1637
+ rows = (h("tr", { key: '5d5bc9d717045ebacf203981e4cb82dc5e6743b3', ref: (el) => __classPrivateFieldGet(this, _KupDataTable_rowsRefs, "f").push(el) }, h("td", { key: 'edc985270001e7d4792aed4cadaf3b6ae8a9b16b', colSpan: __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_calculateColspan).call(this) }, this.emptyDataLabel)));
1617
1638
  }
1618
1639
  else {
1619
1640
  rows = [];
@@ -1689,7 +1710,7 @@ export class KupDataTable {
1689
1710
  __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_handleChipsContextMenu).call(this, chipArg.id, e);
1690
1711
  });
1691
1712
  }
1692
- groupChips = h(FChip, Object.assign({ key: 'f33962278b5236b40270b87ce88a4832958a76b5' }, props));
1713
+ groupChips = h(FChip, Object.assign({ key: 'ebf94e6578476caaf11d9b33d020c07444cebcb4' }, props));
1693
1714
  }
1694
1715
  }
1695
1716
  const tableClass = {
@@ -1721,7 +1742,7 @@ export class KupDataTable {
1721
1742
  if (this.headerIsPersistent &&
1722
1743
  this.tableHeight === undefined &&
1723
1744
  this.tableWidth === undefined) {
1724
- stickyEl = (h("sticky-header", { key: '0a8286472752256a549a59fec6d6a212db97e47e', class: "hover-scrolling-child", hidden: !this.showHeader, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_stickyTheadRef, el, "f")) }, h("thead-sticky", { key: 'd865f5e7f109cc2efd79345d011d485177f2a5fa' }, h("tr-sticky", { key: 'f13831067c2d0176cfb6e92b97f97478979bb7e2' }, stickyHeader))));
1745
+ stickyEl = (h("sticky-header", { key: 'adbf7ea77dd2538152d896c57f48aee731ec4bd0', class: "hover-scrolling-child", hidden: !this.showHeader, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_stickyTheadRef, el, "f")) }, h("thead-sticky", { key: '65884ef4206bcf998229298e1c947b45985455a6' }, h("tr-sticky", { key: '2c77fb6204cc5eec25b7d445491f32525246b334' }, stickyHeader))));
1725
1746
  }
1726
1747
  let belowClass = 'below-wrapper';
1727
1748
  if (!!this.tableHeight || !!this.tableWidth) {
@@ -1767,7 +1788,7 @@ export class KupDataTable {
1767
1788
  const useGlobalFilter = !this.legacyLook &&
1768
1789
  (this.globalFilter ||
1769
1790
  this.getRows().length > __classPrivateFieldGet(this, _KupDataTable_DEFAULT_ROWS_FOR_GLOBAL_FILTER, "f"));
1770
- const compCreated = (h(Host, { key: 'cd4443e818e0cfec25dbab371f0956fdc11c8b2b', "onKup-drop": (e) => {
1791
+ const compCreated = (h(Host, { key: '002d8689464677ac797f2c221e6f6498b5b7876c', "onKup-drop": (e) => {
1771
1792
  this.kupDataTableDrop.emit(e.detail);
1772
1793
  }, "onKup-cell-input": (e) => {
1773
1794
  autoselectOnAction(e);
@@ -1786,11 +1807,11 @@ export class KupDataTable {
1786
1807
  this.kupDataTableObjectFieldOpenSearchMenu.emit(e.detail);
1787
1808
  }, "onKup-objectfield-selectedmenuitem": (e) => {
1788
1809
  this.kupDataTableObjectFieldSelectedMenuItem.emit(e.detail);
1789
- } }, h("style", { key: 'a8cf226a460cdb0e03037ba8148318d5e9569bb6' }, __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").theme.setKupStyle(this.rootElement)), this.updatableData ? __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_renderUpdateButtons).call(this) : null, __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_renderOtherButtons).call(this), h("div", { key: '6cf2fbb93971c046094c38a4b97dea93ef5ad283', id: componentWrapperId, class: wrapClass }, h("div", { key: '2c1f7ec7bea3116071b985ac6972e4f95340e3b3', class: "group-wrapper" }, groupChips), h("div", { key: 'e254306c9791c62583a3b460b54e795e8bd456c5', class: "actions-wrapper", style: actionWrapperWidth }, useGlobalFilter ? (h("div", { id: "global-filter" }, h(FTextField, { fullWidth: true, icon: KupThemeIconValues.SEARCH, label: __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").language.translate(KupLanguageSearch.SEARCH), sizing: KupComponentSizing.EXTRA_SMALL, value: this.globalFilterValue, onInput: (event) => {
1810
+ } }, h("style", { key: '969e09953a0852ddfb4f8cc09ae5c5eeaa7b31c1' }, __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").theme.setKupStyle(this.rootElement)), this.updatableData ? __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_renderUpdateButtons).call(this) : null, __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_renderOtherButtons).call(this), h("div", { key: '2ef668f26fc73d8da695997815f8aefe31d622b8', id: componentWrapperId, class: wrapClass }, h("div", { key: 'f0b8d082c5b090e42a06805fde6a40ef7f320c1a', class: "group-wrapper" }, groupChips), h("div", { key: '1f6bf7d73994e3cfc0c923899e2eda527addb1bf', class: "actions-wrapper", style: actionWrapperWidth }, useGlobalFilter ? (h("div", { id: "global-filter" }, h(FTextField, { fullWidth: true, icon: KupThemeIconValues.SEARCH, label: __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").language.translate(KupLanguageSearch.SEARCH), sizing: KupComponentSizing.EXTRA_SMALL, value: this.globalFilterValue, onInput: (event) => {
1790
1811
  const t = event.target;
1791
1812
  window.clearTimeout(__classPrivateFieldGet(this, _KupDataTable_globalFilterTimeout, "f"));
1792
1813
  __classPrivateFieldSet(this, _KupDataTable_globalFilterTimeout, window.setTimeout(() => __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_onGlobalFilterChange).call(this, t), 600, t), "f");
1793
- } }))) : null, paginatorTop && (h("div", { key: 'b4e8ed279b3b90d408c1e17a268cf85a559ac127', class: "above-wrapper paginator-top" }, paginatorTop)), this.insertMode !== '' &&
1814
+ } }))) : null, paginatorTop && (h("div", { key: '0a20b56290794f7affeefd8160852c29187157e1', class: "above-wrapper paginator-top" }, paginatorTop)), this.insertMode !== '' &&
1794
1815
  this.selectedRows.length > 0 ? (h(FButton, { icon: "save", onClick: () => {
1795
1816
  this.kupSave.emit({
1796
1817
  comp: this,
@@ -1840,9 +1861,9 @@ export class KupDataTable {
1840
1861
  this.data.rows.unshift(row);
1841
1862
  await this.refresh(true);
1842
1863
  }
1843
- }, sizing: KupComponentSizing.MEDIUM, styling: FButtonStyling.RAISED, title: "Insert row", wrapperClass: "insert-button" })) : null), h("div", { key: '94e8f33892a6386d98d4b5f62eca219bab2e70f0', class: "droparea", ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_dropareaRef, el, "f")) }, this.showGroups ? __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_columnGroupArea).call(this) : null, this.removableColumns
1864
+ }, sizing: KupComponentSizing.MEDIUM, styling: FButtonStyling.RAISED, title: "Insert row", wrapperClass: "insert-button" })) : null), h("div", { key: 'cd25a52b1e91a96422b093fdc5bf04ee19550002', class: "droparea", ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_dropareaRef, el, "f")) }, this.showGroups ? __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_columnGroupArea).call(this) : null, this.removableColumns
1844
1865
  ? __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_columnRemoveArea).call(this)
1845
- : null), h("div", { key: '67a27df5ebeac81fd972ba8fe2ca22bc499ed53a', style: elStyle, class: belowClass, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_tableAreaRef, el, "f")) }, this.showCustomization
1866
+ : null), h("div", { key: '5fb2e944ff0d5380133194a808c3a501510384da', style: elStyle, class: belowClass, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_tableAreaRef, el, "f")) }, this.showCustomization
1846
1867
  ? [
1847
1868
  h("div", { class: "settings-trigger", onClick: () => {
1848
1869
  __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_onCustomSettingsClick).call(this);
@@ -1851,7 +1872,7 @@ export class KupDataTable {
1851
1872
  } }, h(FImage, { color: `var(${KupThemeColorValues.TITLE})`, resource: "settings", sizeX: "10px" })),
1852
1873
  this.renderCustomizePanel(),
1853
1874
  ]
1854
- : null, h("table", { key: '273203f59396660c0ce7d1832bfc1648ee5130c5', class: tableClass, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_tableRef, el, "f")), onKeyDown: (e) => __classPrivateFieldGet(this, _KupDataTable_onKupKeyDown, "f").call(this, e), onMouseLeave: (ev) => {
1875
+ : null, h("table", { key: '666019cd7acb30ee4b5599969a09def220a6ad38', class: tableClass, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_tableRef, el, "f")), onKeyDown: (e) => __classPrivateFieldGet(this, _KupDataTable_onKupKeyDown, "f").call(this, e), onMouseLeave: (ev) => {
1855
1876
  ev.stopPropagation();
1856
1877
  }, onPointerDown: (e) => {
1857
1878
  __classPrivateFieldSet(this, _KupDataTable_lastPointerDetails, __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_getEventDetails).call(this, __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").getEventPath(e.target, this.rootElement), e), "f");
@@ -1859,7 +1880,7 @@ export class KupDataTable {
1859
1880
  __classPrivateFieldSet(this, _KupDataTable_lastPointerDetails, __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_getEventDetails).call(this, __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").getEventPath(e.target, this.rootElement), e), "f");
1860
1881
  }, onContextMenu: (e) => {
1861
1882
  e.preventDefault();
1862
- } }, h("thead", { key: '384006d2bea506ec695ea05839da4e258920410d', hidden: !this.showHeader, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_theadRef, el, "f")) }, h("tr", { key: '48f8ee4f1af3ff927e513fc6e6cf865e665ebe1a' }, header)), h("tbody", { key: 'dd03070931cc4a2327c9bb4432f0e8719cb1de6d' }, rows), this.showFooter && this.renderFooter()), stickyEl), paginatorBottom)));
1883
+ } }, h("thead", { key: '86df3ea65b8bb4bb5f825bb0f4b2603397cf2959', hidden: !this.showHeader, ref: (el) => (__classPrivateFieldSet(this, _KupDataTable_theadRef, el, "f")) }, h("tr", { key: '50526a28db9536067341093310a8ee1d5aa0802e' }, header)), h("tbody", { key: '96ca0e2643e0c8a6c9634893c292a083dcc86890' }, rows), this.showFooter && this.renderFooter()), stickyEl), paginatorBottom)));
1863
1884
  __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").perfMonitoring.measure('componentRender', 'kup-data-table');
1864
1885
  return compCreated;
1865
1886
  }
@@ -4819,10 +4840,6 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_cellToFocus = new WeakM
4819
4840
  this.state.showHeader = this.showHeader;
4820
4841
  somethingChanged = true;
4821
4842
  }
4822
- if (!__classPrivateFieldGet(this, _KupDataTable_kupManager, "f").objects.deepEqual(this.state.showLoadMore, this.showLoadMore)) {
4823
- this.state.showLoadMore = this.showLoadMore;
4824
- somethingChanged = true;
4825
- }
4826
4843
  if (!__classPrivateFieldGet(this, _KupDataTable_kupManager, "f").objects.deepEqual(this.state.showPaginator, this.showPaginator)) {
4827
4844
  this.state.showPaginator = this.showPaginator;
4828
4845
  somethingChanged = true;
@@ -7018,7 +7035,7 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_cellToFocus = new WeakM
7018
7035
  }
7019
7036
  // Renders plain rows cells
7020
7037
  const cells = visibleColumns.map((currentColumn, cellIndex) => {
7021
- var _a, _b, _c;
7038
+ var _a, _b, _c, _d, _e, _f, _g;
7022
7039
  const { name, hideValuesRepetitions } = currentColumn;
7023
7040
  const indend = [];
7024
7041
  if (cellIndex === 0) {
@@ -7038,14 +7055,20 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_cellToFocus = new WeakM
7038
7055
  cell.isEditable = __classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_getCellEditability).call(this, currentColumn, row, cell);
7039
7056
  cell.data = Object.assign(Object.assign({}, cell.data), { legacyLook: this.legacyLook, sizing: this.density === 'extra_dense'
7040
7057
  ? 'extra-small'
7041
- : (_a = cell.data) === null || _a === void 0 ? void 0 : _a.sizing });
7058
+ : (_a = cell.data) === null || _a === void 0 ? void 0 : _a.sizing, maxLength: ((_b = cell.data) === null || _b === void 0 ? void 0 : _b.maxLength) !== null &&
7059
+ ((_c = cell.data) === null || _c === void 0 ? void 0 : _c.maxLength) !== undefined
7060
+ ? cell.data['maxLength']
7061
+ : currentColumn === null || currentColumn === void 0 ? void 0 : currentColumn['maxLength'], size: ((_d = cell.data) === null || _d === void 0 ? void 0 : _d.length) !== null &&
7062
+ ((_e = cell.data) === null || _e === void 0 ? void 0 : _e.length) !== undefined
7063
+ ? cell.data['length']
7064
+ : currentColumn === null || currentColumn === void 0 ? void 0 : currentColumn['length'] });
7042
7065
  if (!cell.isEditable) {
7043
7066
  cell.cssClass =
7044
7067
  __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").data.cell.getObjectRelatedStyleClasses(Object.assign(Object.assign({}, cell.obj), { k: cell.value }), cell.cssClass);
7045
7068
  }
7046
7069
  const fcell = Object.assign(Object.assign({}, __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").data.cell.buildFCell(cell, currentColumn, row)), { component: this, density: this.density, editable: this.editableData || this.updatableData, indents: indend, previousValue: hideValuesRepetitions && previousRow
7047
- ? (_b = previousRow.cells[name].decode) !== null && _b !== void 0 ? _b : previousRow.cells[name].value
7048
- : undefined, renderKup: this.lazyLoadCells, cellActionIcon: __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").data.cell.hasActionCell(cell, (_c = this.commands) !== null && _c !== void 0 ? _c : [])
7070
+ ? ((_f = previousRow.cells[name].decode) !== null && _f !== void 0 ? _f : previousRow.cells[name].value)
7071
+ : undefined, renderKup: this.lazyLoadCells, cellActionIcon: __classPrivateFieldGet(this, _KupDataTable_kupManager, "f").data.cell.hasActionCell(cell, (_g = this.commands) !== null && _g !== void 0 ? _g : [])
7049
7072
  ? {
7050
7073
  onClick: (e) => {
7051
7074
  this.kupCellActionIconClick.emit({
@@ -7415,9 +7438,10 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_cellToFocus = new WeakM
7415
7438
  onClickHandler: () => {
7416
7439
  const selectedRowsIds = this.selectedRows.map((row) => row.id);
7417
7440
  const insertedRowsIds = __classPrivateFieldGet(this, _KupDataTable_insertedRowIds, "f");
7418
- if (__classPrivateFieldGet(this, _KupDataTable_instances, "m", _KupDataTable_arraysContainSameElements).call(this, selectedRowsIds, insertedRowsIds)) {
7419
- //If the only rows to delete are the ones inserted by the user
7420
- //AND NOT CONFIRMED, avoid calling the update
7441
+ // If every selected row is an inserted (unconfirmed) row,
7442
+ // delete them locally without calling the update.
7443
+ const allSelectedAreInserted = selectedRowsIds.every((id) => insertedRowsIds.includes(id));
7444
+ if (allSelectedAreInserted) {
7421
7445
  this.deleteRows(selectedRowsIds);
7422
7446
  }
7423
7447
  else {
@@ -7451,10 +7475,4 @@ _KupDataTable_initialized = new WeakMap(), _KupDataTable_cellToFocus = new WeakM
7451
7475
  return __classPrivateFieldGet(this, _KupDataTable_insertedRowIds, "f").includes(rowId);
7452
7476
  }, _KupDataTable_isRowModified = function _KupDataTable_isRowModified(rowId) {
7453
7477
  return __classPrivateFieldGet(this, _KupDataTable_modifiedRowsIds, "f").includes(rowId);
7454
- }, _KupDataTable_arraysContainSameElements = function _KupDataTable_arraysContainSameElements(arr1, arr2) {
7455
- if (arr1.length !== arr2.length)
7456
- return false;
7457
- const sorted1 = [...arr1].sort();
7458
- const sorted2 = [...arr2].sort();
7459
- return sorted1.every((val, index) => val === sorted2[index]);
7460
7478
  };