@indigina/ui-kit 1.1.632 → 1.1.633

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.
@@ -5,7 +5,7 @@ import { Input, ChangeDetectionStrategy, Component, input, EventEmitter, Output,
5
5
  import * as i1 from '@progress/kendo-angular-buttons';
6
6
  import { ButtonModule, ButtonGroupModule } from '@progress/kendo-angular-buttons';
7
7
  import { HttpClient, HttpHeaders, HttpParams, HttpStatusCode } from '@angular/common/http';
8
- import { map, catchError, EMPTY, forkJoin, BehaviorSubject, filter, Subject, startWith, pairwise, takeUntil, combineLatest, tap, debounceTime, distinctUntilChanged, take, switchMap, of, finalize, throwError, merge } from 'rxjs';
8
+ import { map, catchError, EMPTY, forkJoin, BehaviorSubject, filter, Subject, startWith, pairwise, takeUntil, combineLatest, tap, debounceTime, distinctUntilChanged, of, take, switchMap, finalize, throwError, merge } from 'rxjs';
9
9
  import * as i1$1 from '@progress/kendo-angular-layout';
10
10
  import { ExpansionPanelComponent, ExpansionPanelModule, KENDO_LAYOUT, TileLayoutModule, DrawerComponent } from '@progress/kendo-angular-layout';
11
11
  import * as i1$3 from '@progress/kendo-angular-label';
@@ -9287,7 +9287,7 @@ class KitGlobalSearchComponent {
9287
9287
  };
9288
9288
  }
9289
9289
  documentClick(event) {
9290
- if (!this.popup()?.isPopupOpen) {
9290
+ if (!this.popup()?.isPopupOpen && !this.isLoading()) {
9291
9291
  return;
9292
9292
  }
9293
9293
  const eventTarget = event.target;
@@ -9527,23 +9527,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
9527
9527
  }] } });
9528
9528
 
9529
9529
  const mapGlobalSearchResult = (store, requiredPermission, dataFetcher, categoryName, routeConfig, itemMapper, layoutConfig) => {
9530
+ const fetchResult = () => dataFetcher().pipe(map(data => ({
9531
+ name: categoryName,
9532
+ total: data.total,
9533
+ routeConfig,
9534
+ layoutConfig,
9535
+ items: data.data.map(itemMapper),
9536
+ })), catchError(() => of({
9537
+ name: categoryName,
9538
+ total: 0,
9539
+ routeConfig,
9540
+ layoutConfig,
9541
+ items: [],
9542
+ })));
9543
+ if (!requiredPermission) {
9544
+ return fetchResult();
9545
+ }
9530
9546
  return store.select(KIT_USER_PERMISSIONS_STATE_TOKEN).pipe(tap(permissions => !Object.keys(permissions).length && store.dispatch(new FetchUserPermissions())), filter(permissions => !!Object.keys(permissions).length), take(1), switchMap(permissions => {
9531
9547
  if (!kitHasPermission(requiredPermission, permissions)) {
9532
9548
  return of(null);
9533
9549
  }
9534
- return dataFetcher().pipe(map(data => ({
9535
- name: categoryName,
9536
- total: data.total,
9537
- routeConfig,
9538
- layoutConfig,
9539
- items: data.data.map(itemMapper),
9540
- })), catchError(() => of({
9541
- name: categoryName,
9542
- total: 0,
9543
- routeConfig,
9544
- layoutConfig,
9545
- items: [],
9546
- })));
9550
+ return fetchResult();
9547
9551
  }));
9548
9552
  };
9549
9553
  const findMatches = (obj, translatePrefix, searchableKeys, search, translateValueResolver) => {
@@ -10608,11 +10612,11 @@ const kitBuildFilters = (filters) => ({
10608
10612
  });
10609
10613
 
10610
10614
  const nonIndexableCharacters = /[^A-Za-z0-9\-.:_,\\/]+/;
10611
- const kitFormatStringForSearch = (inputString) => {
10615
+ const kitFormatStringForSearch = (inputString, addWildcard = true) => {
10612
10616
  return inputString
10613
10617
  .split(nonIndexableCharacters)
10614
10618
  .filter(text => !!text)
10615
- .map(text => text + '*')
10619
+ .map(text => addWildcard ? text + '*' : text)
10616
10620
  .join(' ');
10617
10621
  };
10618
10622
 
@@ -10647,7 +10651,7 @@ const kitBuildSortString = (sort, columns) => {
10647
10651
  }).join(', ');
10648
10652
  return sortString !== '' && sortString || undefined;
10649
10653
  };
10650
- const kitFetchGridData = ({ store, destroyRef, isLoading, fetchAction, fetchFromIndexAction, hasArchiveToggle, error, }) => {
10654
+ const kitFetchGridData = ({ store, destroyRef, isLoading, fetchAction, fetchFromIndexAction, hasArchiveToggle, addSearchWildcard = true, error, }) => {
10651
10655
  isLoading.set(true);
10652
10656
  const { skip, take, sort, filter, search, archive, columns } = store.selectSnapshot(KIT_GRID_STATE_TOKEN);
10653
10657
  const gridState = {
@@ -10659,17 +10663,17 @@ const kitFetchGridData = ({ store, destroyRef, isLoading, fetchAction, fetchFrom
10659
10663
  };
10660
10664
  const isArchive = hasArchiveToggle && archive || false;
10661
10665
  const isSearchMode = hasArchiveToggle && !isArchive || !!search;
10662
- const searchTerm = search && kitFormatStringForSearch(search) || undefined;
10666
+ const searchTerm = search && kitFormatStringForSearch(search, addSearchWildcard) || undefined;
10663
10667
  const action = (isSearchMode && fetchFromIndexAction) ? fetchFromIndexAction({ ...gridState, searchTerm }) : fetchAction(gridState);
10664
10668
  store.dispatch(action).pipe(takeUntilDestroyed(destroyRef), finalize(() => isLoading.set(false))).subscribe({ error });
10665
10669
  };
10666
- const kitFetchExportGridData = ({ fetchAction, fetchIndexAction, sort, filter, search, columns, total, hasArchiveToggle = false, archiveModeEnabled = false, }) => {
10670
+ const kitFetchExportGridData = ({ fetchAction, fetchIndexAction, sort, filter, search, columns, total, hasArchiveToggle = false, archiveModeEnabled = false, addSearchWildcard = true, }) => {
10667
10671
  const isArchive = hasArchiveToggle && archiveModeEnabled || false;
10668
10672
  const isSearchMode = hasArchiveToggle && !isArchive || !!search;
10669
10673
  const sortString = kitBuildSortString(sort, columns);
10670
10674
  const filterString = kitBuildOdataFilter(kitBuildFilters(filter));
10671
10675
  if (isSearchMode) {
10672
- const searchTerm = search && kitFormatStringForSearch(search) || undefined;
10676
+ const searchTerm = search && kitFormatStringForSearch(search, addSearchWildcard) || undefined;
10673
10677
  return fetchIndexAction(0, total, sortString, filterString, searchTerm);
10674
10678
  }
10675
10679
  return fetchAction(0, total, sortString, filterString);