commons-shared-web-ui 0.0.23 → 0.0.24

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.
@@ -9234,6 +9234,7 @@ class SmartTableComponent {
9234
9234
  loading = false;
9235
9235
  // State
9236
9236
  activeSort = { key: '', direction: 'ASC' };
9237
+ isSortActive = false; // true only when orderBy is explicitly configured or user has sorted
9237
9238
  activeFilters = {};
9238
9239
  searchTerm = '';
9239
9240
  selectedRows = [];
@@ -9263,6 +9264,7 @@ class SmartTableComponent {
9263
9264
  }
9264
9265
  if (this.config.orderBy) {
9265
9266
  this.activeSort.direction = this.config.orderBy;
9267
+ this.isSortActive = true;
9266
9268
  }
9267
9269
  this.loadFilterOptions();
9268
9270
  this.loadData();
@@ -9325,8 +9327,8 @@ class SmartTableComponent {
9325
9327
  };
9326
9328
  if (this.activeSort.key)
9327
9329
  paramsObj['sortBy'] = this.activeSort.key;
9328
- // Note: Some APIs might use different keys for sort/order, can be extended later if needed
9329
- if (this.activeSort.direction)
9330
+ // Only include orderBy if explicitly configured or user has sorted a column
9331
+ if (this.isSortActive && this.activeSort.direction)
9330
9332
  paramsObj['orderBy'] = this.activeSort.direction;
9331
9333
  // Search Handling
9332
9334
  if (this.searchTerm) {
@@ -9377,7 +9379,9 @@ class SmartTableComponent {
9377
9379
  }
9378
9380
  if (this.activeSort.key) {
9379
9381
  paramsObj['sortBy'] = this.activeSort.key;
9380
- paramsObj['orderBy'] = this.activeSort.direction;
9382
+ // Only include orderBy if explicitly configured or user has sorted a column
9383
+ if (this.isSortActive)
9384
+ paramsObj['orderBy'] = this.activeSort.direction;
9381
9385
  }
9382
9386
  if (this.searchTerm) {
9383
9387
  const searchKey = this.config.searchConfig?.searchKey || 'search';
@@ -9485,6 +9489,7 @@ class SmartTableComponent {
9485
9489
  this.activeSort.key = col.key;
9486
9490
  this.activeSort.direction = 'ASC';
9487
9491
  }
9492
+ this.isSortActive = true; // User has actively sorted, include orderBy in API call
9488
9493
  this.loadData();
9489
9494
  }
9490
9495
  onSearch(event) {