import { ThemePalette } from '@angular/material/core'; import { OptionalSearchQuery, Result } from '@mtna/search-manager-ui'; import { MtnaResultTableOptions } from './result-table-options.model'; export interface MtnaSearchConfig extends Pick { /** Search page cta color. */ ctaColor?: ThemePalette; /** The default page size. */ defaultPageSize?: number; /** Optional initial search to run on feature component init. */ initialSearch?: OptionalSearchQuery; /** Optional target ID to initialize the `lastQuery` on the state with. This will get used on the first subsequent search. */ initialTarget?: string; /** * When the results table is navigable, i.e. clicking on a row should navigate to somewhere in the consuming application, * you can provide a calculated, meaningful aria label for the navigate button. * * An accessor function that given a search {@link Result} should return a string that will be the label and tooltip for the navigate icon button. * @param result the search result to determine the label from * @param locale the current app locale */ navButtonLabelAccessor?: (result: Result, locale: string) => string; /** Search page progress bar color. */ progressBarColor?: ThemePalette; /** * When the results table is navigable, i.e. clicking on a row should navigate to somewhere in the consuming application, * you will need to specify the base router commands that the result URI will be appened to. * * An array of URL fragments with which to construct the target URL. * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path * segments, followed by the parameters for each segment. * The fragments are applied to the current URL or the one provided in the `relativeTo` property * of the options object, if supplied. * This is an alternative to providing {@link routerCommandsAccessor}. */ routerCommands?: unknown[]; /** * When the results table is navigable, i.e. clicking on a row should navigate to somewhere in the consuming application, * you will need to specify the base router commands that the result URI will be appened to. * * An accessor function that given a search {@link Result} should return an array of router commands use to navigate. * This is an alternative to providing {@link routerCommands}. */ routerCommandsAccessor?: (result: Result) => unknown[]; /** Aria-label for the searchbox */ searchBoxAriaLabel?: string; /** Search page search box color. */ searchBoxColor?: ThemePalette; /** Placeholder for the searchbox */ searchBoxPlaceholder?: string; /** * When `selectable` is set to `true` and this text is not `undefined`, * a FAB will be present to click to do something with the selection, * this is the text to use for the button. */ selectButtonText?: string; /** Search page results table color. */ tableColor?: ThemePalette; /** Search page toolbar color. */ toolbarColor?: ThemePalette; }