@limetech/lime-elements 37.52.5 → 37.52.7

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 CHANGED
@@ -1,3 +1,19 @@
1
+ ## [37.52.7](https://github.com/Lundalogik/lime-elements/compare/v37.52.6...v37.52.7) (2024-06-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+
7
+ * **table:** apply correct sorting ([2771aea](https://github.com/Lundalogik/lime-elements/commit/2771aeaf5631cdaa47ce99f53a4ce68e68a19a2a))
8
+
9
+ ## [37.52.6](https://github.com/Lundalogik/lime-elements/compare/v37.52.5...v37.52.6) (2024-06-20)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+
15
+ * **table:** use latest available options on init ([bbbc2b8](https://github.com/Lundalogik/lime-elements/commit/bbbc2b85557773aae59226bb96035f20b657920e)), closes [Lundalogik/crm-feature#4186](https://github.com/Lundalogik/crm-feature/issues/4186)
16
+
1
17
  ## [37.52.5](https://github.com/Lundalogik/lime-elements/compare/v37.52.4...v37.52.5) (2024-06-20)
2
18
 
3
19
 
@@ -24330,9 +24330,8 @@ const Table = class {
24330
24330
  this.pool.releaseAll();
24331
24331
  this.tabulator.destroy();
24332
24332
  }
24333
- const options = this.getOptions();
24334
24333
  const table = this.host.shadowRoot.querySelector('#tabulator-table');
24335
- this.initTabulatorComponent(table, options);
24334
+ this.initTabulatorComponent(table);
24336
24335
  }
24337
24336
  /*
24338
24337
  * Tabulator requires that the html element it's rendered inside
@@ -24341,21 +24340,19 @@ const Table = class {
24341
24340
  * is never run).
24342
24341
  *
24343
24342
  * @param table {HTMLElement}
24344
- * @param options {Tabulator.Options}
24345
24343
  *
24346
-
24347
24344
  */
24348
- initTabulatorComponent(table, options) {
24345
+ initTabulatorComponent(table) {
24349
24346
  // Some browsers do not implement the ResizeObserver API...
24350
24347
  // If that's the case lets just create the table no
24351
24348
  // matter if its rendered or not.
24352
24349
  if (!('ResizeObserver' in window)) {
24353
- this.tabulator = new Tabulator(table, options);
24350
+ this.tabulator = new Tabulator(table, this.getOptions());
24354
24351
  this.setSelection();
24355
24352
  return;
24356
24353
  }
24357
24354
  const observer = new ResizeObserver(() => {
24358
- this.tabulator = new Tabulator(table, options);
24355
+ this.tabulator = new Tabulator(table, this.getOptions());
24359
24356
  this.setSelection();
24360
24357
  observer.unobserve(table);
24361
24358
  });
@@ -24378,12 +24375,16 @@ const Table = class {
24378
24375
  (_a = this.tabulator) === null || _a === void 0 ? void 0 : _a.setMaxPage(this.calculatePageCount());
24379
24376
  }
24380
24377
  getOptions() {
24381
- var _a;
24382
24378
  const ajaxOptions = this.getAjaxOptions();
24383
24379
  const paginationOptions = this.getPaginationOptions();
24384
24380
  const columnOptions = this.getColumnOptions();
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);
24381
+ 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.getInitialSorting(), nestedFieldSeparator: false }), columnOptions);
24382
+ }
24383
+ getInitialSorting() {
24384
+ if (this.currentSorting && this.currentSorting.length) {
24385
+ return this.getColumnSorter(this.currentSorting);
24386
+ }
24387
+ return this.getColumnSorter(this.sorting);
24387
24388
  }
24388
24389
  getColumnSorter(sorting) {
24389
24390
  return sorting.map((sorter) => {