@limetech/lime-elements 37.53.0 → 37.53.2

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 (50) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/cjs/lime-elements.cjs.js +1 -1
  4. package/dist/cjs/limel-date-picker.cjs.entry.js +5 -20
  5. package/dist/cjs/limel-date-picker.cjs.entry.js.map +1 -1
  6. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +24 -20
  7. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js.map +1 -1
  8. package/dist/cjs/limel-table.cjs.entry.js +32 -10
  9. package/dist/cjs/limel-table.cjs.entry.js.map +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/components/date-picker/date-picker.js +5 -24
  12. package/dist/collection/components/date-picker/date-picker.js.map +1 -1
  13. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +4 -1
  14. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js.map +1 -1
  15. package/dist/collection/components/date-picker/pickers/Picker.js +20 -19
  16. package/dist/collection/components/date-picker/pickers/Picker.js.map +1 -1
  17. package/dist/collection/components/table/table-selection.js +16 -8
  18. package/dist/collection/components/table/table-selection.js.map +1 -1
  19. package/dist/collection/components/table/table.js +24 -6
  20. package/dist/collection/components/table/table.js.map +1 -1
  21. package/dist/collection/components/table/table.types.js.map +1 -1
  22. package/dist/esm/index.js.map +1 -1
  23. package/dist/esm/lime-elements.js +1 -1
  24. package/dist/esm/limel-date-picker.entry.js +5 -20
  25. package/dist/esm/limel-date-picker.entry.js.map +1 -1
  26. package/dist/esm/limel-flatpickr-adapter.entry.js +24 -20
  27. package/dist/esm/limel-flatpickr-adapter.entry.js.map +1 -1
  28. package/dist/esm/limel-table.entry.js +32 -10
  29. package/dist/esm/limel-table.entry.js.map +1 -1
  30. package/dist/esm/loader.js +1 -1
  31. package/dist/lime-elements/index.esm.js.map +1 -1
  32. package/dist/lime-elements/lime-elements.esm.js +1 -1
  33. package/dist/lime-elements/lime-elements.esm.js.map +1 -1
  34. package/dist/lime-elements/p-5224d7bb.entry.js +2 -0
  35. package/dist/lime-elements/p-5224d7bb.entry.js.map +1 -0
  36. package/dist/lime-elements/{p-42b6ba6d.entry.js → p-5a035a41.entry.js} +3 -3
  37. package/dist/lime-elements/p-5a035a41.entry.js.map +1 -0
  38. package/dist/lime-elements/{p-cc5d8b3f.entry.js → p-852e7a2b.entry.js} +2 -2
  39. package/dist/lime-elements/p-852e7a2b.entry.js.map +1 -0
  40. package/dist/types/components/date-picker/date-picker.d.ts +0 -2
  41. package/dist/types/components/date-picker/pickers/Picker.d.ts +3 -2
  42. package/dist/types/components/table/table-selection.d.ts +4 -2
  43. package/dist/types/components/table/table.d.ts +4 -3
  44. package/dist/types/components/table/table.types.d.ts +7 -0
  45. package/dist/types/components.d.ts +4 -4
  46. package/package.json +1 -1
  47. package/dist/lime-elements/p-42b6ba6d.entry.js.map +0 -1
  48. package/dist/lime-elements/p-b76d8f4f.entry.js +0 -2
  49. package/dist/lime-elements/p-b76d8f4f.entry.js.map +0 -1
  50. package/dist/lime-elements/p-cc5d8b3f.entry.js.map +0 -1
@@ -24000,6 +24000,7 @@ class Selection {
24000
24000
  }
24001
24001
 
24002
24002
  const LIMEL_CHECKBOX = 'limel-checkbox';
24003
+ const getRowId = (data) => { var _a; return (_a = data.id) !== null && _a !== void 0 ? _a : data; };
24003
24004
  /**
24004
24005
  * Provides row selection to Tabulator with shift-click support for range selections
24005
24006
  */
@@ -24034,7 +24035,13 @@ class TableSelection {
24034
24035
  else {
24035
24036
  this.updateRowSelectors(this.selection.toggleSelection(rowPosition));
24036
24037
  }
24037
- this.selectEvent.emit(this.selection.items);
24038
+ this.selectEvent.emit(this.selection.items.map(this.getRowData));
24039
+ };
24040
+ this.getRowData = (item) => {
24041
+ if (typeof item === 'object') {
24042
+ return item;
24043
+ }
24044
+ return this.getTable().getRow(item).getData();
24038
24045
  };
24039
24046
  this.updateRowSelectors = (changeSet) => {
24040
24047
  changeSet.indexes
@@ -24058,7 +24065,7 @@ class TableSelection {
24058
24065
  this.getRowByIndex = (index) => {
24059
24066
  return this.getTable().getRowFromPosition(index, true);
24060
24067
  };
24061
- this.selection = new Selection((index) => this.getRowByIndex(index).getData());
24068
+ this.selection = new Selection((index) => getRowId(this.getRowByIndex(index).getData()));
24062
24069
  }
24063
24070
  /**
24064
24071
  * @returns Returns `true` when the selection is non-empty, otherwise `false`
@@ -24077,13 +24084,15 @@ class TableSelection {
24077
24084
  *
24078
24085
  * @param data - The selected items
24079
24086
  */
24080
- setSelection(data) {
24081
- if (isEqual.isEqual(this.selection.items, data)) {
24087
+ setSelection(data = []) {
24088
+ const newItems = data.map(getRowId);
24089
+ if (this.selection.size === data.length &&
24090
+ this.selection.items.every((oldItem, index) => oldItem === newItems[index])) {
24082
24091
  return;
24083
24092
  }
24084
- this.selection.items = data;
24093
+ this.selection.items = newItems;
24085
24094
  const rows = this.getActiveRows();
24086
- rows.forEach((row) => this.updateRowSelector(row, this.selection.has(row.getData())));
24095
+ rows.forEach((row) => this.updateRowSelector(row, this.selection.has(getRowId(row.getData()))));
24087
24096
  }
24088
24097
  /**
24089
24098
  * Prepends a checkbox column used for row selection to the given column definitions
@@ -24114,7 +24123,7 @@ class TableSelection {
24114
24123
  return (cell) => {
24115
24124
  const element = this.pool.get(LIMEL_CHECKBOX);
24116
24125
  setElementProperties(element, {
24117
- checked: this.selection.has(cell.getData()),
24126
+ checked: this.selection.has(getRowId(cell.getData())),
24118
24127
  });
24119
24128
  element.style.display = 'inline-block';
24120
24129
  return element;
@@ -24251,7 +24260,9 @@ const Table = class {
24251
24260
  this.formatRows();
24252
24261
  }
24253
24262
  updateData(newData = [], oldData = []) {
24254
- if (isEqual.isEqual(newData, oldData)) {
24263
+ const newIds = new Set(newData.map((item) => { var _a; return (_a = item.id) !== null && _a !== void 0 ? _a : item; }));
24264
+ if (oldData.every((item) => { var _a; return newIds.has((_a = item.id) !== null && _a !== void 0 ? _a : item); })) {
24265
+ this.tabulator.updateOrAddData(newData);
24255
24266
  return;
24256
24267
  }
24257
24268
  this.pool.releaseAll();
@@ -24530,7 +24541,7 @@ const Table = class {
24530
24541
  // Not a data row, probably a CalcComponent
24531
24542
  return;
24532
24543
  }
24533
- if (this.activeRow === row.getData()) {
24544
+ if (this.isActiveRow(row)) {
24534
24545
  this.activeRow = null;
24535
24546
  }
24536
24547
  else {
@@ -24542,7 +24553,7 @@ const Table = class {
24542
24553
  this.tabulator.getRows().forEach(this.formatRow);
24543
24554
  }
24544
24555
  formatRow(row) {
24545
- if (this.activeRow === row.getData()) {
24556
+ if (this.isActiveRow(row)) {
24546
24557
  row.getElement().classList.add('active');
24547
24558
  }
24548
24559
  else {
@@ -24557,6 +24568,17 @@ const Table = class {
24557
24568
  row.getElement().prepend(element);
24558
24569
  }
24559
24570
  }
24571
+ isActiveRow(row) {
24572
+ var _a;
24573
+ if (!this.activeRow) {
24574
+ return false;
24575
+ }
24576
+ const activeRowId = (_a = this.activeRow.id) !== null && _a !== void 0 ? _a : null;
24577
+ if (activeRowId !== null) {
24578
+ return activeRowId === row.getData().id;
24579
+ }
24580
+ return this.activeRow === row.getData();
24581
+ }
24560
24582
  calculatePageCount() {
24561
24583
  let total = this.totalRows;
24562
24584
  if (!total) {