@luigi-project/core-modular 0.0.10-dev.202606240107 → 0.0.10-dev.202606260113

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.
@@ -0,0 +1,78 @@
1
+ import { GlobalSearchService } from '../services/global-search.service';
2
+ import { Luigi } from './luigi';
3
+ export interface GlobalSearchProvider {
4
+ customSearchResultItemRenderer?: (searchResultItem: any, slot: HTMLLIElement, searchApiObj: any) => object;
5
+ customSearchResultRenderer?: (searchResults: any[], slot: HTMLDivElement, searchApiObj: any) => object;
6
+ disableInputHandlers?: boolean;
7
+ inputPlaceholder?: any;
8
+ onEnter?: () => void;
9
+ onEscape?: () => void;
10
+ onInput?: () => void;
11
+ onSearchBtnClick?: () => void;
12
+ onSearchResultItemSelected?: (searchResultItem: any) => void;
13
+ searchFieldCentered?: boolean;
14
+ toggleSearch?: (element: HTMLInputElement, visible: boolean) => void;
15
+ }
16
+ export interface SearchResultItem {
17
+ description: string;
18
+ label: string;
19
+ pathObject: Record<string, any>;
20
+ }
21
+ export declare class GlobalSearch {
22
+ luigi: Luigi;
23
+ globalSearchService: GlobalSearchService;
24
+ constructor(luigi: Luigi);
25
+ /**
26
+ * Opens the global search field.
27
+ * @example Luigi.globalSearch().openSearchField();
28
+ */
29
+ openSearchField(): void;
30
+ /**
31
+ * Closes the global search field.
32
+ * @example Luigi.globalSearch().closeSearchField();
33
+ */
34
+ closeSearchField(): void;
35
+ /**
36
+ * Clears the global search field.
37
+ * @example Luigi.globalSearch().clearSearchField();
38
+ */
39
+ clearSearchField(): void;
40
+ /**
41
+ * Opens the global search result. By standard it is a popover.
42
+ * @param {Array<SearchResultItem>} searchResultItems
43
+ * @example
44
+ * let searchResultItem = {
45
+ * pathObject: {
46
+ * link,
47
+ * params: {}
48
+ * },
49
+ * label,
50
+ * description
51
+ * }
52
+ *
53
+ * Luigi.globalSearch().showSearchResult([searchResultItem1, searchResultItem2]);
54
+ */
55
+ showSearchResult(searchResultItems: SearchResultItem[]): void;
56
+ /**
57
+ * Closes the global search result. By standard it is rendered as a popover.
58
+ * @example Luigi.globalSearch().closeSearchResult();
59
+ */
60
+ closeSearchResult(): void;
61
+ /**
62
+ * Gets the value of the search input field.
63
+ * @example Luigi.globalSearch().getSearchString();
64
+ */
65
+ getSearchString(): string;
66
+ /**
67
+ * Sets the value of the search input field.
68
+ * @param searchString search value
69
+ * @example Luigi.globalSearch().setSearchString('searchString');
70
+ */
71
+ setSearchString(searchString: string): void;
72
+ /**
73
+ * Sets the value of the Placeholder search input field.
74
+ * @param placeholder placeholder value
75
+ * @example Luigi.globalSearch().setSearchInputPlaceholder('HERE input Placeholder');
76
+ */
77
+ setSearchInputPlaceholder(placeholder: string): void;
78
+ }
@@ -3,6 +3,7 @@ import { i18nService } from '../services/i18n.service';
3
3
  import { Elements } from './dom-elements';
4
4
  import { LuigiAuthClass } from './auth';
5
5
  import { FeatureToggles } from './feature-toggles';
6
+ import { GlobalSearch } from './global-search';
6
7
  import { Navigation } from './navigation';
7
8
  import { Routing } from './routing';
8
9
  import { Theming } from './theming';
@@ -14,6 +15,7 @@ export declare class Luigi {
14
15
  _customMessages?: CustomMessages;
15
16
  _store: any;
16
17
  _featureToggles?: FeatureToggles;
18
+ _globalSearch?: GlobalSearch;
17
19
  _i18n: i18nService;
18
20
  _theming?: Theming;
19
21
  _routing?: Routing;
@@ -111,6 +113,7 @@ export declare class Luigi {
111
113
  navigation: () => Navigation;
112
114
  ux: () => UX;
113
115
  featureToggles: () => FeatureToggles;
116
+ globalSearch: () => GlobalSearch;
114
117
  routing: () => Routing;
115
118
  theming: () => Theming;
116
119
  auth: () => LuigiAuthClass;