@indigina/ui-kit 1.1.348 → 1.1.349

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.
@@ -7143,7 +7143,7 @@ const kitFormatStringForSearch = (inputString) => {
7143
7143
  .join(' ');
7144
7144
  };
7145
7145
 
7146
- const kitBuildGridColumn = (field, title, type, sortable = true, hidden = false, width, filterType, excelFormat) => ({
7146
+ const kitBuildGridColumn = (field, title, type, sortable = true, hidden = false, width, filterType, excelFormat, apiField) => ({
7147
7147
  field,
7148
7148
  title,
7149
7149
  sortable,
@@ -7152,6 +7152,7 @@ const kitBuildGridColumn = (field, title, type, sortable = true, hidden = false,
7152
7152
  filterType,
7153
7153
  type,
7154
7154
  excelFormat,
7155
+ apiField,
7155
7156
  });
7156
7157
  const kitBuildGridDataResults = (data, loading, total) => ({
7157
7158
  results: {
@@ -7160,9 +7161,13 @@ const kitBuildGridDataResults = (data, loading, total) => ({
7160
7161
  },
7161
7162
  loading,
7162
7163
  });
7163
- const kitBuildSortString = (sort) => {
7164
+ const kitBuildSortString = (sort, columns) => {
7164
7165
  const sortString = sort?.filter(({ dir }) => dir)
7165
- .map(({ field, dir }) => `${field.split('.').join('/')} ${dir}`).join(', ');
7166
+ .map(({ field, dir }) => {
7167
+ const column = columns?.find(col => col.field === field);
7168
+ const targetField = column?.apiField ?? field;
7169
+ return `${targetField.split('.').join('/')} ${dir}`;
7170
+ }).join(', ');
7166
7171
  return sortString !== '' && sortString || undefined;
7167
7172
  };
7168
7173
  const kitFetchGridData = ({ store, destroyRef, isLoading, fetchAction, fetchFromIndexAction, hasArchiveToggle, }) => {
@@ -7180,12 +7185,12 @@ const kitFetchGridData = ({ store, destroyRef, isLoading, fetchAction, fetchFrom
7180
7185
  const action = isSearchMode && fetchFromIndexAction({ ...gridState, searchTerm }) || fetchAction(gridState);
7181
7186
  store.dispatch(action).pipe(takeUntilDestroyed(destroyRef)).subscribe(() => isLoading.set(false));
7182
7187
  };
7183
- const kitFetchExportGridData = ({ fetchAction, fetchIndexAction, total, sort, filter, search, }) => {
7188
+ const kitFetchExportGridData = ({ fetchAction, fetchIndexAction, total, sort, filter, search, columns, }) => {
7184
7189
  if (search) {
7185
7190
  const searchTerm = kitFormatStringForSearch(search);
7186
- return fetchIndexAction(0, total, kitBuildSortString(sort), kitBuildOdataFilter(kitBuildFilters(filter)), searchTerm);
7191
+ return fetchIndexAction(0, total, kitBuildSortString(sort, columns), kitBuildOdataFilter(kitBuildFilters(filter)), searchTerm);
7187
7192
  }
7188
- return fetchAction(0, total, kitBuildSortString(sort), kitBuildOdataFilter(kitBuildFilters(filter)));
7193
+ return fetchAction(0, total, kitBuildSortString(sort, columns), kitBuildOdataFilter(kitBuildFilters(filter)));
7189
7194
  };
7190
7195
 
7191
7196
  var KitGridViewType;
@@ -8787,7 +8792,7 @@ class KitGridFiltersComponent {
8787
8792
  buildFilterSelectorItem(item, filters) {
8788
8793
  return {
8789
8794
  title: item.title,
8790
- field: item.field,
8795
+ field: item.apiField ?? item.field,
8791
8796
  disabled: this.isFilterSelectorItemDisabled(item, filters),
8792
8797
  filterType: item.filterType,
8793
8798
  };