@bridgeline-digital/hawksearch-handlebars-ui 5.0.13 → 5.1.0-beta.0

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,38 @@
1
+ import { BaseComponent } from '@components';
2
+ import { HawkSearchComponents, SearchFieldComponentConfig } from '@configuration';
3
+ import { SearchFieldComponentModel, SearchResponse } from '@models';
4
+ /**
5
+ * The Search component contains a text input element which triggers the {@link Components.AutocompleteComponent | Autocomplete component} as the user types and executes a new search when the user hits the `enter` key.
6
+ *
7
+ * ## Tag
8
+ * The tag for this component is `<hawksearch-conceptearch-field>`.
9
+ *
10
+ * ## Event-Binding Attributes
11
+ * | Name | Value |
12
+ * | :- | :- |
13
+ * | hawksearch-input | |
14
+ *
15
+ * Input elements with this attribute will trigger {@link Components.AutocompleteComponent | Autocomplete} functionality when the user types and executes a new search when the user hits the `enter` key.
16
+ *
17
+ * ## Default Template
18
+ * The following is the default Handlebars template for this component. To create a custom template, it is recommended to use this as a starting point.
19
+ * {@embed ./conceptsearch-field.component.hbs}
20
+ *
21
+ * @category Search
22
+ */
23
+ export declare class ConceptSearchFieldComponent extends BaseComponent<SearchFieldComponentConfig, SearchResponse, SearchFieldComponentModel> {
24
+ protected componentName: keyof HawkSearchComponents;
25
+ protected defaultHtml: any;
26
+ protected bindFromEvent: boolean;
27
+ private clickEventHandler;
28
+ private defaultAutocompleteResponse?;
29
+ private previousAutocompleteResponse?;
30
+ private previousValue;
31
+ private get recommendationsEnabled();
32
+ connectedCallback(): void;
33
+ disconnectedCallback(): void;
34
+ protected getContentModel(): SearchFieldComponentModel;
35
+ protected onRender(): void;
36
+ private toggleAutocomplete;
37
+ private displayDefaultAutocomplete;
38
+ }
@@ -7,6 +7,7 @@ export * from './page-size/page-size.component';
7
7
  export * from './pagination/pagination.component';
8
8
  export * from './query-suggestions/query-suggestions.component';
9
9
  export * from './search-field/search-field.component';
10
+ export * from './conceptsearch-field/conceptsearch-field.component';
10
11
  export * from './search-results-item/search-results-item.component';
11
12
  export * from './search-results-list/search-results-list.component';
12
13
  export * from './search-results/search-results.component';
@@ -226,6 +226,7 @@ export interface HawkSearchComponents {
226
226
  'recent-searches-facet'?: RecentSearchesFacetComponentConfig;
227
227
  'related-searches-facet'?: RelatedSearchesFacetComponentConfig;
228
228
  'search-field'?: SearchFieldComponentConfig;
229
+ 'conceptsearch-field'?: SearchFieldComponentConfig;
229
230
  'search-results'?: SearchResultsComponentConfig;
230
231
  'search-results-item'?: SearchResultsItemComponentConfig;
231
232
  'search-results-list'?: SearchResultsListComponentConfig;
@@ -437,6 +438,13 @@ export interface HawkSearchConfig {
437
438
  * `false`
438
439
  */
439
440
  decodeFacetValues?: boolean;
441
+ /**
442
+ * Sets RequestType field to toggle ImageSearch or ConceptSearch
443
+ *
444
+ * #### Default Value
445
+ * `['ConceptSearch', 'ImageSearch']`
446
+ */
447
+ requestType?: string;
440
448
  };
441
449
  recommendations?: {
442
450
  /**
@@ -0,0 +1,52 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>HawkSearch Demo (default)</title>
6
+ <meta name="description" content="This is a demo of the HawkSearch Handlebars UI" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
8
+ <style type="text/css">
9
+ body {
10
+ font-family: Arial, Helvetica, sans-serif;
11
+ font-size: 16px;
12
+ }
13
+
14
+ .layout-container {
15
+ margin: 0 auto;
16
+ min-width: 340px;
17
+ max-width: 1280px;
18
+ }
19
+ </style>
20
+ <script type="text/javascript">
21
+ var HawkSearch = HawkSearch || {};
22
+
23
+ HawkSearch.config = {
24
+ clientId: '59d7b9ce967d4fdf8262d1a49392b8be',
25
+ search: {
26
+ url: '',
27
+ requestType: 'ConceptSearch'
28
+ },
29
+ autocomplete: {
30
+ recommendationsEnabled: false
31
+ },
32
+ urlPrefixes: {
33
+ assets: '//dev.hawksearch.net',
34
+ content: '//preview-dev.hawksearch.net/elasticdemo'
35
+ }
36
+ };
37
+ </script>
38
+ <script defer src="index.js"></script></head>
39
+
40
+ <body>
41
+ <div class="layout-container">
42
+ <h1>HawkSearch Demo (default)</h1>
43
+ <!-- <div style="margin: 0 0 30px 0; display: none;" >
44
+ <hawksearch-search-field></hawksearch-search-field>
45
+ </div> -->
46
+ <div style="margin: 0 0 30px 0">
47
+ <hawksearch-conceptsearch-field></hawksearch-conceptsearch-field>
48
+ </div>
49
+ <hawksearch-search-results></hawksearch-search-results>
50
+ </div>
51
+ </body>
52
+ </html>