@@ -11,31 +11,83 @@
Loading
11 11
  SkyAutocompleteSearchFunctionFilter
12 12
} from '../autocomplete/types/autocomplete-search-function-filter';
13 13
14 +
/**
15 +
 * @internal
16 +
 */
14 17
export class SkyLookupAutocompleteAdapter {
18 +
19 +
/**
20 +
 * Specifies a data source for the lookup component to search when users
21 +
 * enter text. You can specify static data such as an array of objects, or
22 +
 * you can pull data from a database.
23 +
 * @default []
24 +
 */
15 25
  @Input()
16 26
  public data: any[];
17 27
28 +
/**
29 +
 * Specifies how many milliseconds to wait before searching while users
30 +
 * enter text in the lookup field.
31 +
 * @default 0
32 +
 */
18 33
  @Input()
19 34
  public debounceTime: number;
20 35
36 +
/**
37 +
 * Specifies an object property to display in the text input after users
38 +
 * select an item in the dropdown list.
39 +
 * @default name
40 +
 */
21 41
  @Input()
22 42
  public descriptorProperty: string;
23 43
44 +
/**
45 +
 * Specifies an array of object properties to search.
46 +
 * @default ['name']
47 +
 */
24 48
  @Input()
25 49
  public propertiesToSearch: string[];
26 50
51 +
/**
52 +
 * Specifies a function to dynamically manage the data source when users
53 +
 * change the text in the lookup field. The search function must return
54 +
 * an array or a promise of an array. The `search` property is particularly
55 +
 * useful when the data source does not live in the source code.
56 +
 */
27 57
  @Input()
28 58
  public search: SkyAutocompleteSearchFunction;
29 59
60 +
/**
61 +
 * Specifies a template to format each search result in the dropdown list.
62 +
 * The lookup component injects search result values into the template as
63 +
 * `item` variables that reference all of the object properties of the search results.
64 +
 */
30 65
  @Input()
31 66
  public searchResultTemplate: TemplateRef<any>;
32 67
68 +
/**
69 +
 * Specifies the minimum number of characters that users must enter before
70 +
 * the lookup component searches the data source and displays search results
71 +
 * in the dropdown list.
72 +
 * @default 1
73 +
 */
33 74
  @Input()
34 75
  public searchTextMinimumCharacters: number;
35 76
77 +
/**
78 +
 * Specifies an array of functions to call against each search result in order
79 +
 * to filter the search results when using the default search function. When
80 +
 * using a custom search function via the `search` property filters must be
81 +
 * applied manually inside that function. The function must return `true` or
82 +
 * `false` for each result to indicate whether to display it in the dropdown list.
83 +
 */
36 84
  @Input()
37 85
  public searchFilters: SkyAutocompleteSearchFunctionFilter[];
38 86
87 +
/**
88 +
 * Specifies the maximum number of search results to display in the dropdown
89 +
 * list. By default, the lookup component displays all matching results.
90 +
 */
39 91
  @Input()
40 92
  public searchResultsLimit: number;
41 93
}

@@ -5,6 +5,9 @@
Loading
5 5
  RendererFactory2
6 6
} from '@angular/core';
7 7
8 +
/**
9 +
 * @internal
10 +
 */
8 11
@Injectable()
9 12
export class SkyAutocompleteAdapterService {
10 13
  private renderer: Renderer2;

@@ -55,9 +55,17 @@
Loading
55 55
  extends SkyLookupAutocompleteAdapter
56 56
  implements AfterViewInit, OnDestroy, ControlValueAccessor {
57 57
58 +
/**
59 +
 * Defines a string value to label the typeahead search input for accessibility.
60 +
 * If a label is visible on the screen, use the `ariaLabelledBy` property instead.
61 +
 */
58 62
  @Input()
59 63
  public ariaLabel: string;
60 64
65 +
/**
66 +
 * Identifies the element that defines a label for the typeahead search input.
67 +
 * If a label is not visible on the screen, use the `ariaLabel` property instead.
68 +
 */
61 69
  @Input()
62 70
  public ariaLabelledBy: string;
63 71
@@ -68,9 +76,15 @@
Loading
68 76
  @Input()
69 77
  public autocompleteAttribute: string;
70 78
79 +
/**
80 +
 * Indicates whether to disable the lookup field.
81 +
 */
71 82
  @Input()
72 83
  public disabled = false;
73 84
85 +
/**
86 +
 * Specifies placeholder text to display in the lookup field.
87 +
 */
74 88
  @Input()
75 89
  public placeholderText: string;
76 90

@@ -79,7 +79,7 @@
Loading
79 79
80 80
  /**
81 81
   * Indicates whether to disable the autocomplete field.
82 -
   * @default "false"
82 +
   * @default false
83 83
   */
84 84
  @Input()
85 85
  public set disabled(value: boolean) {

@@ -48,6 +48,9 @@
Loading
48 48
import { SkyAutocompleteInputDirective } from './autocomplete-input.directive';
49 49
import { skyAutocompleteDefaultSearchFunction } from './autocomplete-default-search-function';
50 50
51 +
/**
52 +
 * @internal
53 +
 */
51 54
interface SkyAutocompleteSearchResult {
52 55
  elementId: string;
53 56
  data: any;
@@ -66,9 +69,17 @@
Loading
66 69
67 70
  //#region public_api
68 71
72 +
/**
73 +
 * Identifies the element that defines a label for the text input.
74 +
 */
69 75
  @Input()
70 76
  public ariaLabelledBy: string;
71 77
78 +
/**
79 +
 * Specifies a static data source for the autocomplete component to search
80 +
 * when users enter text. For a dynamic data source such as an array that
81 +
 * changes due to server calls, use the `search` property instead.
82 +
 */
72 83
  @Input()
73 84
  public set data(value: any[]) {
74 85
    this._data = value;
@@ -78,6 +89,11 @@
Loading
78 89
    return this._data || [];
79 90
  }
80 91
92 +
/**
93 +
 * Specifies how many milliseconds to wait before searching while users
94 +
 * enter text in the autocomplete field.
95 +
 * @default 0
96 +
 */
81 97
  @Input()
82 98
  public set debounceTime(value: number) {
83 99
    this._debounceTime = value;
@@ -87,6 +103,11 @@
Loading
87 103
    return this._debounceTime || 0;
88 104
  }
89 105
106 +
/**
107 +
 * Specifies an object property to display in the text input after users
108 +
 * select an item in the dropdown list.
109 +
 * @default name
110 +
 */
90 111
  @Input()
91 112
  public set descriptorProperty(value: string) {
92 113
    this._descriptorProperty = value;
@@ -96,6 +117,10 @@
Loading
96 117
    return this._descriptorProperty || 'name';
97 118
  }
98 119
120 +
/**
121 +
 * Specifies the object properties to search.
122 +
 * @default ['name']
123 +
 */
99 124
  @Input()
100 125
  public set propertiesToSearch(value: string[]) {
101 126
    this._propertiesToSearch = value;
@@ -105,6 +130,12 @@
Loading
105 130
    return this._propertiesToSearch || ['name'];
106 131
  }
107 132
133 +
/**
134 +
 * Specifies a function to dynamically manage the data source when users
135 +
 * change the text in the autocomplete field. The search function must return
136 +
 * an array or a promise of an array. The `search` property is particularly
137 +
 * useful when the data source does not live in the source code.
138 +
 */
108 139
  @Input()
109 140
  public set search(value: SkyAutocompleteSearchFunction) {
110 141
    this._search = value;
@@ -118,6 +149,11 @@
Loading
118 149
    });
119 150
  }
120 151
152 +
/**
153 +
 * Specifies a template to format each search result in the dropdown list.
154 +
 * The autocomplete component injects search result values into the template
155 +
 * as `item` variables that reference all of the object properties of the search results.
156 +
 */
121 157
  @Input()
122 158
  public set searchResultTemplate(value: TemplateRef<any>) {
123 159
    this._searchResultTemplate = value;
@@ -127,6 +163,12 @@
Loading
127 163
    return this._searchResultTemplate || this.defaultSearchResultTemplate;
128 164
  }
129 165
166 +
/**
167 +
 * Specifies the minimum number of characters that users must enter before
168 +
 * the autocomplete component searches the data source and displays search
169 +
 * results in the dropdown list.
170 +
 * @default 1
171 +
 */
130 172
  @Input()
131 173
  public set searchTextMinimumCharacters(value: number) {
132 174
    this._searchTextMinimumCharacters = value;
@@ -137,15 +179,33 @@
Loading
137 179
      ? this._searchTextMinimumCharacters : 1;
138 180
  }
139 181
182 +
/**
183 +
 * Specifies an array of functions to call against each search result in order
184 +
 * to filter the search results when using the default search function. When
185 +
 * using the `search` property to specify a custom search function, you must
186 +
 * manually apply filters inside that function. The function must return `true`
187 +
 * or `false` for each result to indicate whether to display it in the dropdown list.
188 +
 */
140 189
  @Input()
141 190
  public searchFilters: SkyAutocompleteSearchFunctionFilter[];
142 191
192 +
/**
193 +
 * Specifies the maximum number of search results to display in the dropdown list.
194 +
 * By default, the component displays all matching results.
195 +
 */
143 196
  @Input()
144 197
  public searchResultsLimit: number;
145 198
199 +
/**
200 +
 * Specifies the text to play when no search results are found.
201 +
 * @default No matching items found
202 +
 */
146 203
  @Input()
147 204
  public noResultsFoundText: string;
148 205
206 +
/**
207 +
 * Fires when users select items in the dropdown list.
208 +
 */
149 209
  @Output()
150 210
  public get selectionChange(): EventEmitter<SkyAutocompleteSelectionChange> {
151 211
    return this._selectionChange;

@@ -70,24 +70,51 @@
Loading
70 70
})
71 71
export class SkySearchComponent implements OnDestroy, OnInit, OnChanges {
72 72
73 +
/**
74 +
 * Fires when the search text is applied.
75 +
 */
73 76
  @Output()
74 77
  public searchApply = new EventEmitter<string>();
75 78
79 +
/**
80 +
 * Fires when the search text is changed.
81 +
 */
76 82
  @Output()
77 83
  public searchChange = new EventEmitter<string>();
78 84
85 +
/**
86 +
 * Fires when the search text is cleared.
87 +
 */
79 88
  @Output()
80 89
  public searchClear = new EventEmitter<void>();
81 90
91 +
/**
92 +
 * Specifies default search criteria for the input.
93 +
 */
82 94
  @Input()
83 95
  public searchText: string;
84 96
97 +
/**
98 +
 * Specifies the expand mode for the search input. The valid options
99 +
 * include `responsive` to collapse the search input into a button on
100 +
 * mobile devices, `none` to *not* collapse the search input on mobile
101 +
 * devices, and `fit` to extend the search input to fit the width of its container.
102 +
 * @default responsive
103 +
 */
85 104
  @Input()
86 105
  public expandMode: string = EXPAND_MODE_RESPONSIVE;
87 106
107 +
/**
108 +
 * Specifies how many milliseconds to wait before searching after users enter text in the search input.
109 +
 * @default 0
110 +
 */
88 111
  @Input()
89 112
  public debounceTime: number = 0;
90 113
114 +
/**
115 +
 * Indicates whether to disable the filter button.
116 +
 * @default false
117 +
 */
91 118
  @Input()
92 119
  public disabled: boolean = false;
93 120
@@ -95,6 +122,11 @@
Loading
95 122
96 123
  public isCollapsible: boolean = true;
97 124
125 +
/**
126 +
 * Specifies placeholder text to display in the search input until users
127 +
 * enter search criteria.
128 +
 * @default Find in this list
129 +
 */
98 130
  @Input()
99 131
  public placeholderText: string;
100 132

@@ -4,6 +4,9 @@
Loading
4 4
  Renderer2
5 5
} from '@angular/core';
6 6
7 +
/**
8 +
 * @internal
9 +
 */
7 10
@Injectable()
8 11
export class SkySearchAdapterService {
9 12
Files Coverage
src/app/public 100.00%
Project Totals (15 files) 100.00%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading