@limetech/lime-elements 37.52.1 → 37.52.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.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/limel-table.cjs.entry.js +14 -5
- package/dist/cjs/limel-table.cjs.entry.js.map +1 -1
- package/dist/collection/components/table/table.js +15 -4
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/esm/limel-table.entry.js +14 -5
- package/dist/esm/limel-table.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-7f329090.entry.js → p-07963900.entry.js} +2 -2
- package/dist/lime-elements/p-07963900.entry.js.map +1 -0
- package/dist/types/components/table/table.d.ts +1 -0
- package/package.json +1 -1
- package/dist/lime-elements/p-7f329090.entry.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [37.52.2](https://github.com/Lundalogik/lime-elements/compare/v37.52.1...v37.52.2) (2024-06-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
* **table:** allow sorting to be updated after first render ([2e8650a](https://github.com/Lundalogik/lime-elements/commit/2e8650a1b98744e80ab119a3220e90cdb062a47a))
|
|
8
|
+
|
|
1
9
|
## [37.52.1](https://github.com/Lundalogik/lime-elements/compare/v37.52.0...v37.52.1) (2024-06-13)
|
|
2
10
|
|
|
3
11
|
|
|
@@ -24308,6 +24308,14 @@ const Table = class {
|
|
|
24308
24308
|
this.initTableSelection();
|
|
24309
24309
|
this.init();
|
|
24310
24310
|
}
|
|
24311
|
+
updateSorting(newValue, oldValue) {
|
|
24312
|
+
const newSorting = this.getColumnSorter(newValue);
|
|
24313
|
+
const oldSorting = this.getColumnSorter(oldValue);
|
|
24314
|
+
if (isEqual.isEqual(newSorting, oldSorting)) {
|
|
24315
|
+
return;
|
|
24316
|
+
}
|
|
24317
|
+
this.tabulator.setSort(newSorting);
|
|
24318
|
+
}
|
|
24311
24319
|
areSameColumns(newColumns, oldColumns) {
|
|
24312
24320
|
return (newColumns.length === oldColumns.length &&
|
|
24313
24321
|
newColumns.every((column) => oldColumns.includes(column)));
|
|
@@ -24370,14 +24378,14 @@ const Table = class {
|
|
|
24370
24378
|
(_a = this.tabulator) === null || _a === void 0 ? void 0 : _a.setMaxPage(this.calculatePageCount());
|
|
24371
24379
|
}
|
|
24372
24380
|
getOptions() {
|
|
24381
|
+
var _a;
|
|
24373
24382
|
const ajaxOptions = this.getAjaxOptions();
|
|
24374
24383
|
const paginationOptions = this.getPaginationOptions();
|
|
24375
24384
|
const columnOptions = this.getColumnOptions();
|
|
24376
|
-
|
|
24385
|
+
const initialSorting = (_a = this.currentSorting) !== null && _a !== void 0 ? _a : this.sorting;
|
|
24386
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ data: this.data, layout: mapLayout(this.layout), columns: this.getColumnDefinitions(), dataSorting: this.handleDataSorting, pageLoaded: this.handlePageLoaded }, ajaxOptions), paginationOptions), { rowClick: this.onClickRow, rowFormatter: this.formatRow, initialSort: this.getColumnSorter(initialSorting), nestedFieldSeparator: false }), columnOptions);
|
|
24377
24387
|
}
|
|
24378
|
-
getColumnSorter() {
|
|
24379
|
-
var _a;
|
|
24380
|
-
const sorting = (_a = this.currentSorting) !== null && _a !== void 0 ? _a : this.sorting;
|
|
24388
|
+
getColumnSorter(sorting) {
|
|
24381
24389
|
return sorting.map((sorter) => {
|
|
24382
24390
|
return {
|
|
24383
24391
|
column: String(sorter.column.field),
|
|
@@ -24593,7 +24601,8 @@ const Table = class {
|
|
|
24593
24601
|
"columns": ["updateColumns"],
|
|
24594
24602
|
"aggregates": ["updateAggregates"],
|
|
24595
24603
|
"selection": ["updateSelection"],
|
|
24596
|
-
"selectable": ["updateSelectable"]
|
|
24604
|
+
"selectable": ["updateSelectable"],
|
|
24605
|
+
"sorting": ["updateSorting"]
|
|
24597
24606
|
}; }
|
|
24598
24607
|
};
|
|
24599
24608
|
Table.style = tableCss;
|