@skyux/lookup 5.7.2 → 6.0.0-beta.2

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.
Files changed (172) hide show
  1. package/documentation.json +2 -2
  2. package/esm2020/index.mjs +32 -0
  3. package/esm2020/lib/modules/autocomplete/autocomplete-adapter.service.mjs +61 -0
  4. package/esm2020/lib/modules/autocomplete/autocomplete-default-search-function.mjs +39 -0
  5. package/esm2020/lib/modules/autocomplete/autocomplete-input.directive.mjs +221 -0
  6. package/esm2020/lib/modules/autocomplete/autocomplete-search-async-disabled.pipe.mjs +19 -0
  7. package/esm2020/lib/modules/autocomplete/autocomplete.component.mjs +739 -0
  8. package/esm2020/lib/modules/autocomplete/autocomplete.module.mjs +65 -0
  9. package/esm2020/lib/modules/autocomplete/types/autocomplete-default-search-function-options.mjs +2 -0
  10. package/esm2020/lib/modules/autocomplete/types/autocomplete-input-text-change.mjs +2 -0
  11. package/esm2020/lib/modules/autocomplete/types/autocomplete-message-type.mjs +15 -0
  12. package/esm2020/lib/modules/autocomplete/types/autocomplete-message.mjs +2 -0
  13. package/esm2020/lib/modules/autocomplete/types/autocomplete-search-async-args.mjs +2 -0
  14. package/esm2020/lib/modules/autocomplete/types/autocomplete-search-async-function.mjs +2 -0
  15. package/esm2020/lib/modules/autocomplete/types/autocomplete-search-async-result-display-type.mjs +2 -0
  16. package/esm2020/lib/modules/autocomplete/types/autocomplete-search-async-result.mjs +2 -0
  17. package/esm2020/lib/modules/autocomplete/types/autocomplete-search-function-filter.mjs +2 -0
  18. package/esm2020/lib/modules/autocomplete/types/autocomplete-search-function-response.mjs +2 -0
  19. package/esm2020/lib/modules/autocomplete/types/autocomplete-search-function.mjs +2 -0
  20. package/esm2020/lib/modules/autocomplete/types/autocomplete-selection-change.mjs +2 -0
  21. package/esm2020/lib/modules/autocomplete/types/autocomplete-show-more-args.mjs +2 -0
  22. package/esm2020/lib/modules/country-field/country-field.component.mjs +397 -0
  23. package/esm2020/lib/modules/country-field/country-field.module.mjs +49 -0
  24. package/esm2020/lib/modules/country-field/types/country.mjs +2 -0
  25. package/esm2020/lib/modules/lookup/lookup-adapter.service.mjs +21 -0
  26. package/esm2020/lib/modules/lookup/lookup-autocomplete-adapter.mjs +78 -0
  27. package/esm2020/lib/modules/lookup/lookup-item-selected.pipe.mjs +16 -0
  28. package/esm2020/lib/modules/lookup/lookup-show-more-async-modal.component.mjs +181 -0
  29. package/esm2020/lib/modules/lookup/lookup-show-more-modal.component.mjs +249 -0
  30. package/esm2020/lib/modules/lookup/lookup.component.mjs +601 -0
  31. package/esm2020/lib/modules/lookup/lookup.module.mjs +90 -0
  32. package/esm2020/lib/modules/lookup/types/lookup-add-click-callback-args.mjs +2 -0
  33. package/esm2020/lib/modules/lookup/types/lookup-add-click-event-args.mjs +2 -0
  34. package/esm2020/lib/modules/lookup/types/lookup-select-mode-type.mjs +2 -0
  35. package/esm2020/lib/modules/lookup/types/lookup-select-mode.mjs +16 -0
  36. package/esm2020/lib/modules/lookup/types/lookup-show-more-config.mjs +2 -0
  37. package/esm2020/lib/modules/lookup/types/lookup-show-more-custom-picker-context.mjs +7 -0
  38. package/esm2020/lib/modules/lookup/types/lookup-show-more-custom-picker.mjs +2 -0
  39. package/esm2020/lib/modules/lookup/types/lookup-show-more-native-picker-async-context.mjs +7 -0
  40. package/esm2020/lib/modules/lookup/types/lookup-show-more-native-picker-config.mjs +2 -0
  41. package/esm2020/lib/modules/lookup/types/lookup-show-more-native-picker-context.mjs +7 -0
  42. package/esm2020/lib/modules/search/search-adapter.service.mjs +45 -0
  43. package/esm2020/lib/modules/search/search.component.mjs +253 -0
  44. package/esm2020/lib/modules/search/search.module.mjs +46 -0
  45. package/esm2020/lib/modules/shared/sky-lookup-resources.module.mjs +72 -0
  46. package/esm2020/lib/modules/shared/sky-lookup-string-utils.mjs +8 -0
  47. package/esm2020/skyux-lookup.mjs +5 -0
  48. package/esm2020/testing/country-field/country-field-fixture.mjs +114 -0
  49. package/esm2020/testing/country-field/country-field-testing.module.mjs +15 -0
  50. package/esm2020/testing/public-api.mjs +5 -0
  51. package/esm2020/testing/search/search-fixture.mjs +57 -0
  52. package/esm2020/testing/search/search-testing.module.mjs +15 -0
  53. package/esm2020/testing/skyux-lookup-testing.mjs +5 -0
  54. package/fesm2015/{skyux-lookup-testing.js → skyux-lookup-testing.mjs} +9 -9
  55. package/fesm2015/skyux-lookup-testing.mjs.map +1 -0
  56. package/fesm2015/skyux-lookup.mjs +3153 -0
  57. package/fesm2015/skyux-lookup.mjs.map +1 -0
  58. package/fesm2020/skyux-lookup-testing.mjs +203 -0
  59. package/fesm2020/skyux-lookup-testing.mjs.map +1 -0
  60. package/fesm2020/skyux-lookup.mjs +3144 -0
  61. package/fesm2020/skyux-lookup.mjs.map +1 -0
  62. package/package.json +45 -21
  63. package/testing/package.json +5 -5
  64. package/bundles/skyux-lookup-testing.umd.js +0 -620
  65. package/bundles/skyux-lookup.umd.js +0 -3793
  66. package/esm2015/index.js +0 -32
  67. package/esm2015/index.js.map +0 -1
  68. package/esm2015/lib/modules/autocomplete/autocomplete-adapter.service.js +0 -61
  69. package/esm2015/lib/modules/autocomplete/autocomplete-adapter.service.js.map +0 -1
  70. package/esm2015/lib/modules/autocomplete/autocomplete-default-search-function.js +0 -39
  71. package/esm2015/lib/modules/autocomplete/autocomplete-default-search-function.js.map +0 -1
  72. package/esm2015/lib/modules/autocomplete/autocomplete-input.directive.js +0 -221
  73. package/esm2015/lib/modules/autocomplete/autocomplete-input.directive.js.map +0 -1
  74. package/esm2015/lib/modules/autocomplete/autocomplete-search-async-disabled.pipe.js +0 -19
  75. package/esm2015/lib/modules/autocomplete/autocomplete-search-async-disabled.pipe.js.map +0 -1
  76. package/esm2015/lib/modules/autocomplete/autocomplete.component.js +0 -745
  77. package/esm2015/lib/modules/autocomplete/autocomplete.component.js.map +0 -1
  78. package/esm2015/lib/modules/autocomplete/autocomplete.module.js +0 -65
  79. package/esm2015/lib/modules/autocomplete/autocomplete.module.js.map +0 -1
  80. package/esm2015/lib/modules/autocomplete/types/autocomplete-default-search-function-options.js +0 -2
  81. package/esm2015/lib/modules/autocomplete/types/autocomplete-default-search-function-options.js.map +0 -1
  82. package/esm2015/lib/modules/autocomplete/types/autocomplete-input-text-change.js +0 -2
  83. package/esm2015/lib/modules/autocomplete/types/autocomplete-input-text-change.js.map +0 -1
  84. package/esm2015/lib/modules/autocomplete/types/autocomplete-message-type.js +0 -15
  85. package/esm2015/lib/modules/autocomplete/types/autocomplete-message-type.js.map +0 -1
  86. package/esm2015/lib/modules/autocomplete/types/autocomplete-message.js +0 -2
  87. package/esm2015/lib/modules/autocomplete/types/autocomplete-message.js.map +0 -1
  88. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-async-args.js +0 -2
  89. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-async-args.js.map +0 -1
  90. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-async-function.js +0 -2
  91. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-async-function.js.map +0 -1
  92. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-async-result-display-type.js +0 -2
  93. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-async-result-display-type.js.map +0 -1
  94. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-async-result.js +0 -2
  95. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-async-result.js.map +0 -1
  96. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-function-filter.js +0 -2
  97. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-function-filter.js.map +0 -1
  98. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-function-response.js +0 -2
  99. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-function-response.js.map +0 -1
  100. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-function.js +0 -2
  101. package/esm2015/lib/modules/autocomplete/types/autocomplete-search-function.js.map +0 -1
  102. package/esm2015/lib/modules/autocomplete/types/autocomplete-selection-change.js +0 -2
  103. package/esm2015/lib/modules/autocomplete/types/autocomplete-selection-change.js.map +0 -1
  104. package/esm2015/lib/modules/autocomplete/types/autocomplete-show-more-args.js +0 -2
  105. package/esm2015/lib/modules/autocomplete/types/autocomplete-show-more-args.js.map +0 -1
  106. package/esm2015/lib/modules/country-field/country-field.component.js +0 -404
  107. package/esm2015/lib/modules/country-field/country-field.component.js.map +0 -1
  108. package/esm2015/lib/modules/country-field/country-field.module.js +0 -49
  109. package/esm2015/lib/modules/country-field/country-field.module.js.map +0 -1
  110. package/esm2015/lib/modules/country-field/types/country.js +0 -2
  111. package/esm2015/lib/modules/country-field/types/country.js.map +0 -1
  112. package/esm2015/lib/modules/lookup/lookup-adapter.service.js +0 -21
  113. package/esm2015/lib/modules/lookup/lookup-adapter.service.js.map +0 -1
  114. package/esm2015/lib/modules/lookup/lookup-autocomplete-adapter.js +0 -78
  115. package/esm2015/lib/modules/lookup/lookup-autocomplete-adapter.js.map +0 -1
  116. package/esm2015/lib/modules/lookup/lookup-item-selected.pipe.js +0 -16
  117. package/esm2015/lib/modules/lookup/lookup-item-selected.pipe.js.map +0 -1
  118. package/esm2015/lib/modules/lookup/lookup-show-more-async-modal.component.js +0 -186
  119. package/esm2015/lib/modules/lookup/lookup-show-more-async-modal.component.js.map +0 -1
  120. package/esm2015/lib/modules/lookup/lookup-show-more-modal.component.js +0 -258
  121. package/esm2015/lib/modules/lookup/lookup-show-more-modal.component.js.map +0 -1
  122. package/esm2015/lib/modules/lookup/lookup.component.js +0 -610
  123. package/esm2015/lib/modules/lookup/lookup.component.js.map +0 -1
  124. package/esm2015/lib/modules/lookup/lookup.module.js +0 -94
  125. package/esm2015/lib/modules/lookup/lookup.module.js.map +0 -1
  126. package/esm2015/lib/modules/lookup/types/lookup-add-click-callback-args.js +0 -2
  127. package/esm2015/lib/modules/lookup/types/lookup-add-click-callback-args.js.map +0 -1
  128. package/esm2015/lib/modules/lookup/types/lookup-add-click-event-args.js +0 -2
  129. package/esm2015/lib/modules/lookup/types/lookup-add-click-event-args.js.map +0 -1
  130. package/esm2015/lib/modules/lookup/types/lookup-select-mode-type.js +0 -2
  131. package/esm2015/lib/modules/lookup/types/lookup-select-mode-type.js.map +0 -1
  132. package/esm2015/lib/modules/lookup/types/lookup-select-mode.js +0 -16
  133. package/esm2015/lib/modules/lookup/types/lookup-select-mode.js.map +0 -1
  134. package/esm2015/lib/modules/lookup/types/lookup-show-more-config.js +0 -2
  135. package/esm2015/lib/modules/lookup/types/lookup-show-more-config.js.map +0 -1
  136. package/esm2015/lib/modules/lookup/types/lookup-show-more-custom-picker-context.js +0 -7
  137. package/esm2015/lib/modules/lookup/types/lookup-show-more-custom-picker-context.js.map +0 -1
  138. package/esm2015/lib/modules/lookup/types/lookup-show-more-custom-picker.js +0 -2
  139. package/esm2015/lib/modules/lookup/types/lookup-show-more-custom-picker.js.map +0 -1
  140. package/esm2015/lib/modules/lookup/types/lookup-show-more-native-picker-async-context.js +0 -7
  141. package/esm2015/lib/modules/lookup/types/lookup-show-more-native-picker-async-context.js.map +0 -1
  142. package/esm2015/lib/modules/lookup/types/lookup-show-more-native-picker-config.js +0 -2
  143. package/esm2015/lib/modules/lookup/types/lookup-show-more-native-picker-config.js.map +0 -1
  144. package/esm2015/lib/modules/lookup/types/lookup-show-more-native-picker-context.js +0 -7
  145. package/esm2015/lib/modules/lookup/types/lookup-show-more-native-picker-context.js.map +0 -1
  146. package/esm2015/lib/modules/search/search-adapter.service.js +0 -45
  147. package/esm2015/lib/modules/search/search-adapter.service.js.map +0 -1
  148. package/esm2015/lib/modules/search/search.component.js +0 -260
  149. package/esm2015/lib/modules/search/search.component.js.map +0 -1
  150. package/esm2015/lib/modules/search/search.module.js +0 -46
  151. package/esm2015/lib/modules/search/search.module.js.map +0 -1
  152. package/esm2015/lib/modules/shared/sky-lookup-resources.module.js +0 -72
  153. package/esm2015/lib/modules/shared/sky-lookup-resources.module.js.map +0 -1
  154. package/esm2015/lib/modules/shared/sky-lookup-string-utils.js +0 -8
  155. package/esm2015/lib/modules/shared/sky-lookup-string-utils.js.map +0 -1
  156. package/esm2015/skyux-lookup.js +0 -5
  157. package/esm2015/skyux-lookup.js.map +0 -1
  158. package/esm2015/testing/country-field/country-field-fixture.js +0 -123
  159. package/esm2015/testing/country-field/country-field-fixture.js.map +0 -1
  160. package/esm2015/testing/country-field/country-field-testing.module.js +0 -15
  161. package/esm2015/testing/country-field/country-field-testing.module.js.map +0 -1
  162. package/esm2015/testing/public-api.js +0 -5
  163. package/esm2015/testing/public-api.js.map +0 -1
  164. package/esm2015/testing/search/search-fixture.js +0 -57
  165. package/esm2015/testing/search/search-fixture.js.map +0 -1
  166. package/esm2015/testing/search/search-testing.module.js +0 -15
  167. package/esm2015/testing/search/search-testing.module.js.map +0 -1
  168. package/esm2015/testing/skyux-lookup-testing.js +0 -5
  169. package/esm2015/testing/skyux-lookup-testing.js.map +0 -1
  170. package/fesm2015/skyux-lookup-testing.js.map +0 -1
  171. package/fesm2015/skyux-lookup.js +0 -3191
  172. package/fesm2015/skyux-lookup.js.map +0 -1
@@ -1,610 +0,0 @@
1
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Optional, Output, Self, TemplateRef, ViewChild, ViewEncapsulation, } from '@angular/core';
2
- import { NgControl } from '@angular/forms';
3
- import { SkyAppWindowRef } from '@skyux/core';
4
- import { SkyInputBoxHostService } from '@skyux/forms';
5
- import { SkyLibResourcesService } from '@skyux/i18n';
6
- import { SkyTokensMessageType, } from '@skyux/indicators';
7
- import { SkyModalService } from '@skyux/modals';
8
- import { SkyThemeService } from '@skyux/theme';
9
- import { Subject, fromEvent as observableFromEvent } from 'rxjs';
10
- import { take, takeUntil } from 'rxjs/operators';
11
- import { SkyAutocompleteInputDirective } from '../autocomplete/autocomplete-input.directive';
12
- import { SkyAutocompleteMessageType } from '../autocomplete/types/autocomplete-message-type';
13
- import { SkyLookupAdapterService } from './lookup-adapter.service';
14
- import { SkyLookupAutocompleteAdapter } from './lookup-autocomplete-adapter';
15
- import { SkyLookupShowMoreAsyncModalComponent } from './lookup-show-more-async-modal.component';
16
- import { SkyLookupShowMoreModalComponent } from './lookup-show-more-modal.component';
17
- import { SkyLookupShowMoreNativePickerAsyncContext } from './types/lookup-show-more-native-picker-async-context';
18
- import { SkyLookupShowMoreNativePickerContext } from './types/lookup-show-more-native-picker-context';
19
- import * as i0 from "@angular/core";
20
- import * as i1 from "@skyux/core";
21
- import * as i2 from "@angular/forms";
22
- import * as i3 from "./lookup-adapter.service";
23
- import * as i4 from "@skyux/modals";
24
- import * as i5 from "@skyux/i18n";
25
- import * as i6 from "@skyux/forms";
26
- import * as i7 from "@skyux/theme";
27
- import * as i8 from "../autocomplete/autocomplete.component";
28
- import * as i9 from "@skyux/indicators";
29
- import * as i10 from "@angular/common";
30
- import * as i11 from "../autocomplete/autocomplete-input.directive";
31
- export class SkyLookupComponent extends SkyLookupAutocompleteAdapter {
32
- constructor(changeDetector, elementRef, windowRef, ngControl, adapter, modalService, resourcesService, inputBoxHostSvc, themeSvc) {
33
- super();
34
- this.changeDetector = changeDetector;
35
- this.elementRef = elementRef;
36
- this.windowRef = windowRef;
37
- this.adapter = adapter;
38
- this.modalService = modalService;
39
- this.resourcesService = resourcesService;
40
- this.inputBoxHostSvc = inputBoxHostSvc;
41
- this.themeSvc = themeSvc;
42
- /**
43
- * Indicates whether to disable the lookup field.
44
- */
45
- this.disabled = false;
46
- /**
47
- * Indicates whether to enable users to open a picker where they can view all options.
48
- */
49
- this.enableShowMore = false;
50
- /**
51
- * Indicates whether to display a button that lets users add options to the list.
52
- */
53
- this.showAddButton = false;
54
- /**
55
- * Fires when users select the button to add options to the list.
56
- */
57
- this.addClick = new EventEmitter();
58
- this.autocompleteController = new Subject();
59
- this.isInputFocused = false;
60
- this.tokensController = new Subject();
61
- this.ngUnsubscribe = new Subject();
62
- this.idle = new Subject();
63
- this.markForTokenFocusOnKeyUp = false;
64
- // Angular automatically constructs these methods.
65
- // eslint-disable-next-line @typescript-eslint/no-empty-function
66
- this.onChange = (value) => { };
67
- // eslint-disable-next-line @typescript-eslint/no-empty-function
68
- this.onTouched = () => { };
69
- ngControl.valueAccessor = this;
70
- }
71
- /**
72
- * Specifies a data source for the lookup component to search when users
73
- * enter text. You can specify static data such as an array of objects, or
74
- * you can pull data from a database.
75
- * @default []
76
- */
77
- set data(value) {
78
- this._data = value;
79
- if (this.openNativePicker && this.searchAsync.observers.length === 0) {
80
- this.openNativePicker.componentInstance.updateItemData(value);
81
- }
82
- }
83
- get data() {
84
- return this._data;
85
- }
86
- /**
87
- * Specifies whether users can select one option or multiple options.
88
- * @default "mulitple"
89
- */
90
- set selectMode(value) {
91
- const multipleToSingle = value === 'single' && this.selectMode === 'multiple';
92
- this._selectMode = value;
93
- this.updateForSelectMode();
94
- if (multipleToSingle) {
95
- if (this.value && this.value.length > 1) {
96
- // The `setTimeout` is needed to avoid a `ExpressionChangedAfterItHasBeenCheckedError` error in template forms.
97
- setTimeout(() => {
98
- this.writeValue([this.value[0]]);
99
- this.changeDetector.detectChanges();
100
- });
101
- }
102
- }
103
- }
104
- get selectMode() {
105
- return this._selectMode || 'multiple';
106
- }
107
- get tokens() {
108
- return this._tokens;
109
- }
110
- set tokens(value) {
111
- // Collapse the tokens into a single token if the user has selected many options.
112
- if (this.enableShowMore && this.value.length > 5) {
113
- this.resourcesService
114
- .getString('skyux_lookup_tokens_summary', this.value.length.toString())
115
- .pipe(take(1))
116
- .subscribe((label) => {
117
- this._tokens = [
118
- {
119
- value: { [this.descriptorProperty]: label },
120
- },
121
- ];
122
- this.changeDetector.markForCheck();
123
- });
124
- }
125
- else {
126
- this._tokens = value;
127
- this.changeDetector.markForCheck();
128
- }
129
- }
130
- get value() {
131
- return this._value ? this._value : [];
132
- }
133
- set value(newValue) {
134
- this._value = newValue;
135
- if (!this.openNativePicker) {
136
- this.tokens = this.parseTokens(newValue);
137
- }
138
- this.onChange(this._value);
139
- this.onTouched();
140
- }
141
- set autocompleteInputDirective(value) {
142
- this._autocompleteInputDirective = value;
143
- this.updateForSelectMode();
144
- }
145
- get autocompleteInputDirective() {
146
- return this._autocompleteInputDirective;
147
- }
148
- ngOnInit() {
149
- if (this.inputBoxHostSvc) {
150
- this.inputBoxHostSvc.populate({
151
- inputTemplate: this.inputTemplateRef,
152
- buttonsTemplate: this.enableShowMore
153
- ? this.showMoreButtonTemplateRef
154
- : undefined,
155
- iconsInsetTemplate: this.enableShowMore
156
- ? undefined
157
- : this.searchIconTemplateRef,
158
- });
159
- }
160
- /* istanbul ignore else */
161
- if (this.themeSvc) {
162
- // This is required for the autocomplete directive to be set after elements
163
- // are rearranged when switching themes.
164
- this.themeSvc.settingsChange
165
- .pipe(takeUntil(this.ngUnsubscribe))
166
- .subscribe(() => {
167
- this.changeDetector.markForCheck();
168
- });
169
- }
170
- }
171
- ngAfterViewInit() {
172
- if (!this.disabled) {
173
- this.addEventListeners();
174
- }
175
- }
176
- ngOnDestroy() {
177
- this.removeEventListeners();
178
- this.ngUnsubscribe.next();
179
- this.ngUnsubscribe.complete();
180
- this.tokensController.complete();
181
- }
182
- addButtonClicked() {
183
- this.addClick.emit({
184
- itemAdded: (args) => this.onAddButtonComplete(args),
185
- });
186
- }
187
- onAutocompleteSelectionChange(change) {
188
- /* istanbul ignore else */
189
- if (change.selectedItem) {
190
- this.addToSelected(change.selectedItem);
191
- }
192
- else if (this.selectMode === 'single') {
193
- this.writeValue([]);
194
- }
195
- }
196
- onAutocompleteBlur() {
197
- this.onTouched();
198
- }
199
- onTokensChange(change) {
200
- if (!change) {
201
- return;
202
- }
203
- if (this.tokens !== change) {
204
- if (change.length === 0) {
205
- this.focusInput();
206
- }
207
- // NOTE: We do this here instead of just using the `value` setter because we need to use the
208
- // set of tokens returned here for the purposes of setting focus (see `onTokensKeyUp`).
209
- this._value = change.map((token) => {
210
- return token.value;
211
- });
212
- this.tokens = change;
213
- this.sendAutocompleteMessage(SkyAutocompleteMessageType.RepositionDropdown);
214
- this.onChange(this._value);
215
- this.onTouched();
216
- }
217
- }
218
- onTokensFocusIndexOverRange() {
219
- this.windowRef.nativeWindow.setTimeout(() => {
220
- this.focusInput();
221
- });
222
- }
223
- onTokensKeyUp(event) {
224
- /* istanbul ignore else */
225
- if (this.selectMode !== 'single') {
226
- /* tslint:disable-next-line:switch-default */
227
- switch (event.key) {
228
- case 'Backspace':
229
- this.sendTokensMessage(SkyTokensMessageType.RemoveActiveToken);
230
- this.sendTokensMessage(SkyTokensMessageType.FocusPreviousToken);
231
- event.preventDefault();
232
- break;
233
- case 'Del':
234
- case 'Delete':
235
- this.sendTokensMessage(SkyTokensMessageType.RemoveActiveToken);
236
- this.windowRef.nativeWindow.setTimeout(() => {
237
- this.sendTokensMessage(SkyTokensMessageType.FocusActiveToken);
238
- });
239
- event.preventDefault();
240
- break;
241
- }
242
- }
243
- }
244
- writeValue(value) {
245
- this.value = value ? value : [];
246
- this.updateForSelectMode();
247
- }
248
- registerOnChange(fn) {
249
- this.onChange = fn;
250
- }
251
- registerOnTouched(fn) {
252
- this.onTouched = fn;
253
- }
254
- // Allows Angular to disable the input.
255
- setDisabledState(disabled) {
256
- this.removeEventListeners();
257
- if (!disabled) {
258
- this.addEventListeners();
259
- }
260
- this.disabled = disabled;
261
- this.changeDetector.markForCheck();
262
- }
263
- clearSearchText() {
264
- this.autocompleteInputDirective.value = undefined;
265
- this.autocompleteInputDirective.inputTextValue = undefined;
266
- }
267
- // Handles when to focus on the tokens.
268
- // Check for empty search text on keydown, before the escape key is fully pressed.
269
- // (Otherwise, a single character being escaped would register as empty on keyup.)
270
- // If empty on keydown, set a flag so that the appropriate action can be taken on keyup.
271
- inputKeydown(event, value) {
272
- /* Sanity check as this should only be called when in multiple select mode */
273
- /* istanbul ignore else */
274
- if (this.selectMode !== 'single') {
275
- switch (event.key) {
276
- case 'Enter':
277
- event.preventDefault();
278
- break;
279
- case 'ArrowLeft':
280
- case 'Backspace':
281
- case 'Left':
282
- if (value) {
283
- this.markForTokenFocusOnKeyUp = false;
284
- }
285
- else {
286
- this.markForTokenFocusOnKeyUp = true;
287
- }
288
- break;
289
- default:
290
- }
291
- }
292
- }
293
- inputKeyup(event) {
294
- /* Sanity check as this should only be called when in multiple select mode */
295
- /* istanbul ignore else */
296
- if (this.selectMode !== 'single') {
297
- switch (event.key) {
298
- case 'Esc':
299
- case 'Escape':
300
- this.clearSearchText();
301
- event.preventDefault();
302
- break;
303
- case 'ArrowLeft':
304
- case 'Backspace':
305
- case 'Left':
306
- /* istanbul ignore else */
307
- if (this.markForTokenFocusOnKeyUp) {
308
- this.sendTokensMessage(SkyTokensMessageType.FocusLastToken);
309
- event.preventDefault();
310
- }
311
- break;
312
- default:
313
- }
314
- event.stopPropagation();
315
- }
316
- }
317
- onSearchButtonClick() {
318
- /*istanbul ignore next*/
319
- if (this.disabled) {
320
- return;
321
- }
322
- this.sendAutocompleteMessage(SkyAutocompleteMessageType.CloseDropdown);
323
- let isValueInTextBox = false;
324
- if (this.selectMode === 'single') {
325
- isValueInTextBox =
326
- this.autocompleteInputDirective.value &&
327
- this.autocompleteInputDirective.inputTextValue ===
328
- this.autocompleteInputDirective.value[this.descriptorProperty];
329
- }
330
- this.openPicker(isValueInTextBox ? '' : this.autocompleteInputDirective.inputTextValue);
331
- this.autocompleteInputDirective.restoreInputTextValueToPreviousState();
332
- }
333
- onShowMoreClick(event) {
334
- /* Sanity check */
335
- /* istanbul ignore else*/
336
- if (event) {
337
- this.openPicker(event.inputValue);
338
- }
339
- }
340
- createNativePickerInstance(initialSearch) {
341
- var _a;
342
- const initialValue = this.value;
343
- const modalConfig = ((_a = this.showMoreConfig) === null || _a === void 0 ? void 0 : _a.nativePickerConfig) || {};
344
- if (!modalConfig.itemTemplate) {
345
- modalConfig.itemTemplate = this.searchResultTemplate;
346
- }
347
- let contextProviderType;
348
- let contextProviderValue;
349
- let modalComponentType;
350
- if (this.searchAsync.observers.length > 0) {
351
- contextProviderType = SkyLookupShowMoreNativePickerAsyncContext;
352
- modalComponentType = SkyLookupShowMoreAsyncModalComponent;
353
- contextProviderValue = new SkyLookupShowMoreNativePickerAsyncContext();
354
- contextProviderValue.idProperty = this.idProperty;
355
- contextProviderValue.searchAsync = (args) => {
356
- this.searchAsync.emit(args);
357
- return args.result;
358
- };
359
- }
360
- else {
361
- contextProviderType = SkyLookupShowMoreNativePickerContext;
362
- modalComponentType = SkyLookupShowMoreModalComponent;
363
- contextProviderValue = new SkyLookupShowMoreNativePickerContext();
364
- contextProviderValue.items = this.data;
365
- contextProviderValue.search = this.search;
366
- }
367
- contextProviderValue.descriptorProperty = this.descriptorProperty;
368
- contextProviderValue.initialSearch = initialSearch;
369
- contextProviderValue.initialValue = initialValue;
370
- contextProviderValue.selectMode = this.selectMode;
371
- contextProviderValue.showAddButton = this.showAddButton;
372
- contextProviderValue.userConfig = modalConfig;
373
- return this.modalService.open(modalComponentType, {
374
- providers: [
375
- {
376
- provide: contextProviderType,
377
- useValue: contextProviderValue,
378
- },
379
- ],
380
- wrapperClass: this.wrapperClass,
381
- });
382
- }
383
- openPicker(initialSearch) {
384
- var _a;
385
- if ((_a = this.showMoreConfig) === null || _a === void 0 ? void 0 : _a.customPicker) {
386
- this.showMoreConfig.customPicker.open({
387
- items: this.data,
388
- initialSearch: initialSearch,
389
- initialValue: this.value,
390
- });
391
- }
392
- else {
393
- const initialValue = this.value;
394
- this.openNativePicker = this.createNativePickerInstance(initialSearch);
395
- this.openNativePicker.componentInstance.addClick.subscribe(() => {
396
- this.addButtonClicked();
397
- });
398
- this.openNativePicker.closed.subscribe((closeArgs) => {
399
- this.openNativePicker = undefined;
400
- if (closeArgs.reason === 'save') {
401
- let selectedItems = [];
402
- if (this.searchAsync.observers.length > 0) {
403
- selectedItems = closeArgs.data.map((item) => item.itemData);
404
- }
405
- else {
406
- this.data.forEach((item, dataIndex) => {
407
- if (closeArgs.data.some((savedItem) => {
408
- return savedItem.index === dataIndex;
409
- })) {
410
- selectedItems.push(item);
411
- }
412
- });
413
- }
414
- this.writeValue(selectedItems);
415
- }
416
- else {
417
- this.writeValue(initialValue);
418
- }
419
- this.focusInput();
420
- this.changeDetector.markForCheck();
421
- });
422
- }
423
- }
424
- onSearchAsync(args) {
425
- this.searchAsync.emit(args);
426
- }
427
- addToSelected(item) {
428
- let selectedItems;
429
- if (this.selectMode === 'single') {
430
- selectedItems = [item];
431
- }
432
- else {
433
- selectedItems = this.value;
434
- // If items have a unique identifier, don't allow the same item to be added twice.
435
- if (!this.idProperty ||
436
- !this.value.some((existingItem) => existingItem[this.idProperty] === item[this.idProperty])) {
437
- selectedItems.push(item);
438
- }
439
- this.clearSearchText();
440
- }
441
- this.writeValue(selectedItems);
442
- }
443
- addEventListeners() {
444
- this.idle = new Subject();
445
- this.focusInputOnHostClick();
446
- }
447
- removeEventListeners() {
448
- this.idle.next();
449
- this.idle.complete();
450
- }
451
- focusInputOnHostClick() {
452
- let hostElement = !this.inputBoxHostSvc
453
- ? this.elementRef.nativeElement
454
- : this.lookupWrapperRef.nativeElement;
455
- const documentObj = this.windowRef.nativeWindow.document;
456
- // Handles focusing the input when the host is clicked.
457
- // The input should NOT be focused if other elements (tokens, etc.)
458
- // are currently focused or being tabbed through.
459
- observableFromEvent(documentObj, 'mousedown')
460
- .pipe(takeUntil(this.idle))
461
- .subscribe((event) => {
462
- hostElement = !this.inputBoxHostSvc
463
- ? this.elementRef.nativeElement
464
- : this.lookupWrapperRef.nativeElement;
465
- this.isInputFocused = hostElement.contains(event.target);
466
- this.changeDetector.markForCheck();
467
- });
468
- observableFromEvent(documentObj, 'focusin')
469
- .pipe(takeUntil(this.idle))
470
- .subscribe((event) => {
471
- hostElement = !this.inputBoxHostSvc
472
- ? this.elementRef.nativeElement
473
- : this.lookupWrapperRef.nativeElement;
474
- this.isInputFocused = hostElement.contains(event.target);
475
- this.changeDetector.markForCheck();
476
- });
477
- observableFromEvent(hostElement, 'mouseup')
478
- .pipe(takeUntil(this.idle))
479
- .subscribe(() => {
480
- const classList = documentObj.activeElement.classList;
481
- if (!classList || !classList.contains('sky-token')) {
482
- this.focusInput();
483
- }
484
- });
485
- }
486
- focusInput() {
487
- this.adapter.focusInput(this.lookupWrapperRef);
488
- }
489
- onAddButtonComplete(args) {
490
- if (args.data) {
491
- this.data = args.data;
492
- }
493
- if (this.data.indexOf(args.item) >= 0) {
494
- if (this.openNativePicker) {
495
- this.openNativePicker
496
- .componentInstance.onItemSelect(true, { value: args.item, selected: false });
497
- }
498
- else {
499
- let newValue = this.value;
500
- if (this.selectMode === 'multiple') {
501
- newValue = this.value.concat(args.item);
502
- }
503
- else {
504
- newValue = [args.item];
505
- }
506
- this.writeValue(newValue);
507
- }
508
- }
509
- }
510
- parseTokens(data) {
511
- return data.map((item) => {
512
- return {
513
- value: item,
514
- };
515
- });
516
- }
517
- sendAutocompleteMessage(type) {
518
- this.autocompleteController.next({ type });
519
- }
520
- sendTokensMessage(type) {
521
- this.tokensController.next({ type });
522
- }
523
- updateForSelectMode() {
524
- if (this.autocompleteInputDirective) {
525
- if (this.selectMode === 'single') {
526
- this.autocompleteInputDirective.value = this.value && this.value[0];
527
- }
528
- else {
529
- this.clearSearchText();
530
- }
531
- }
532
- }
533
- }
534
- SkyLookupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyLookupComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.SkyAppWindowRef }, { token: i2.NgControl, optional: true, self: true }, { token: i3.SkyLookupAdapterService }, { token: i4.SkyModalService }, { token: i5.SkyLibResourcesService }, { token: i6.SkyInputBoxHostService, optional: true }, { token: i7.SkyThemeService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
535
- SkyLookupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyLookupComponent, selector: "sky-lookup", inputs: { ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", autocompleteAttribute: "autocompleteAttribute", data: "data", disabled: "disabled", enableShowMore: "enableShowMore", placeholderText: "placeholderText", idProperty: "idProperty", showAddButton: "showAddButton", showMoreConfig: "showMoreConfig", selectMode: "selectMode", wrapperClass: "wrapperClass" }, outputs: { addClick: "addClick" }, providers: [SkyLookupAdapterService], viewQueries: [{ propertyName: "autocompleteInputDirective", first: true, predicate: SkyAutocompleteInputDirective, descendants: true, read: SkyAutocompleteInputDirective }, { propertyName: "showMoreButtonTemplateRef", first: true, predicate: ["showMoreButtonTemplateRef"], descendants: true, read: TemplateRef, static: true }, { propertyName: "inputTemplateRef", first: true, predicate: ["inputTemplateRef"], descendants: true, read: TemplateRef, static: true }, { propertyName: "lookupWrapperRef", first: true, predicate: ["lookupWrapper"], descendants: true, read: ElementRef }, { propertyName: "searchIconTemplateRef", first: true, predicate: ["searchIconTemplateRef"], descendants: true, read: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"!inputBoxHostSvc\">\n <ng-container *ngTemplateOutlet=\"inputTemplateRef\"></ng-container>\n</ng-container>\n\n<ng-template #inputTemplateRef>\n <div\n class=\"sky-lookup\"\n [ngClass]=\"{\n 'sky-lookup-focused': isInputFocused,\n 'sky-lookup-disabled': disabled,\n 'sky-lookup-single': selectMode === 'single'\n }\"\n #lookupWrapper\n >\n <sky-autocomplete\n [ariaLabelledBy]=\"ariaLabelledBy\"\n [data]=\"data\"\n [debounceTime]=\"debounceTime\"\n [descriptorProperty]=\"descriptorProperty\"\n [enableShowMore]=\"enableShowMore\"\n [messageStream]=\"autocompleteController\"\n [propertiesToSearch]=\"propertiesToSearch\"\n [search]=\"search\"\n [searchAsyncDisabled]=\"searchAsync.observers.length === 0\"\n [searchFilters]=\"searchFilters\"\n [searchResultsLimit]=\"searchResultsLimit\"\n [searchResultTemplate]=\"searchResultTemplate\"\n [searchTextMinimumCharacters]=\"searchTextMinimumCharacters\"\n [showAddButton]=\"showAddButton\"\n [wrapperClass]=\"wrapperClass\"\n (addClick)=\"addButtonClicked()\"\n (searchAsync)=\"onSearchAsync($event)\"\n (selectionChange)=\"onAutocompleteSelectionChange($event)\"\n (showMoreClick)=\"onShowMoreClick($event)\"\n >\n <div class=\"sky-lookup-search-flex-wrapper\">\n <div\n class=\"sky-lookup-search\"\n [ngClass]=\"{\n 'sky-field-status-active': isInputFocused && !disabled\n }\"\n >\n <sky-tokens\n *ngIf=\"selectMode === 'multiple'\"\n class=\"sky-lookup-tokens\"\n [disabled]=\"disabled\"\n [displayWith]=\"descriptorProperty\"\n [focusable]=\"false\"\n [messageStream]=\"tokensController\"\n [trackWith]=\"idProperty\"\n [tokens]=\"tokens\"\n (keyup)=\"onTokensKeyUp($event)\"\n (tokensChange)=\"onTokensChange($event)\"\n (tokenSelected)=\"enableShowMore ? openPicker(undefined) : undefined\"\n (focusIndexOverRange)=\"onTokensFocusIndexOverRange()\"\n >\n <textarea\n class=\"sky-form-control sky-lookup-input\"\n rows=\"1\"\n skyAutocomplete\n wrap=\"off\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.placeholder]=\"placeholderText\"\n [autocompleteAttribute]=\"autocompleteAttribute\"\n [disabled]=\"disabled\"\n (blur)=\"onAutocompleteBlur()\"\n (keydown)=\"inputKeydown($event, $event.target.value)\"\n (keyup)=\"inputKeyup($event)\"\n ></textarea>\n </sky-tokens>\n <div\n *ngIf=\"selectMode === 'single'\"\n class=\"sky-lookup-single-control\"\n >\n <textarea\n class=\"sky-form-control sky-lookup-input\"\n rows=\"1\"\n skyAutocomplete\n wrap=\"off\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.placeholder]=\"placeholderText\"\n [autocompleteAttribute]=\"autocompleteAttribute\"\n [disabled]=\"disabled\"\n (blur)=\"onAutocompleteBlur()\"\n ></textarea>\n </div>\n </div>\n <ng-container *ngIf=\"!inputBoxHostSvc && enableShowMore\">\n <ng-container\n *ngTemplateOutlet=\"showMoreButtonTemplateRef\"\n ></ng-container>\n </ng-container>\n <ng-container *ngIf=\"!inputBoxHostSvc && !enableShowMore\">\n <ng-container\n *ngTemplateOutlet=\"searchIconTemplateRef\"\n ></ng-container>\n </ng-container>\n </div>\n </sky-autocomplete>\n </div>\n</ng-template>\n\n<ng-template #showMoreButtonTemplateRef>\n <div class=\"sky-input-group-btn\">\n <button\n class=\"sky-btn sky-btn-default\"\n [disabled]=\"disabled\"\n [ngClass]=\"{ 'sky-btn-disabled': disabled }\"\n type=\"button\"\n [attr.aria-label]=\"\n 'skyux_lookup_search_button_show_more' | skyLibResources\n \"\n (click)=\"onSearchButtonClick()\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"search\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n iconType=\"skyux\"\n icon=\"search\"\n ></sky-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template #searchIconTemplateRef>\n <div\n class=\"sky-input-group-icon sky-input-box-icon-inset\"\n [ngClass]=\"{ 'sky-lookup-disabled': disabled }\"\n >\n <sky-icon\n *skyThemeIf=\"'default'\"\n icon=\"search\"\n [attr.aria-label]=\"'skyux_lookup_search_icon' | skyLibResources\"\n ></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n iconType=\"skyux\"\n icon=\"search\"\n [attr.aria-label]=\"'skyux_lookup_search_icon' | skyLibResources\"\n ></sky-icon>\n </div>\n</ng-template>\n", styles: [".sky-lookup .sky-lookup-input.sky-form-control{resize:none;border:0;box-sizing:content-box;height:1.428571429em;overflow:hidden;padding:0;background-color:transparent}.sky-lookup .sky-lookup-input.sky-form-control:focus{outline:none;box-shadow:none}.sky-lookup .sky-lookup-search-flex-wrapper{display:flex}.sky-lookup.sky-lookup-disabled .sky-lookup-search{background-color:#cdcfd2}.sky-lookup sky-tokens.sky-lookup-tokens:focus{outline:none}.sky-lookup sky-tokens.sky-lookup-tokens .sky-tokens{margin-top:-5px;margin-bottom:-5px}.sky-lookup sky-tokens.sky-lookup-tokens .sky-tokens .sky-tokens-content{padding-top:5px;padding-bottom:5px;padding-left:10px;flex-basis:100px}.sky-lookup .sky-lookup-single-control{display:inline-flex;padding-left:7px;width:100%}.sky-lookup-search{cursor:text;background-color:#fff;line-height:1.428571429em;padding:6px 12px 6px 3px;flex-grow:1}.sky-lookup-search:not(.sky-field-status-active){border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:1px solid #cdcfd2}.sky-lookup-disabled .sky-lookup-search{cursor:default}.sky-lookup-focused .sky-tokens-content{flex-basis:100px}.sky-lookup-single sky-tokens.sky-lookup-tokens sky-token{display:none}sky-lookup.ng-invalid.ng-touched .sky-lookup-search{box-shadow:0 0 8px #ef404499;border:1px solid #ef4044;outline:none}sky-input-box .sky-lookup{width:100%}sky-input-box .sky-lookup .sky-lookup-search{border:none;padding-bottom:5px;width:100%}:host-context(.sky-theme-modern) sky-tokens.sky-lookup-tokens .sky-tokens{margin-top:-6px}:host-context(.sky-theme-modern) sky-input-box .sky-lookup sky-tokens.sky-lookup-tokens .sky-tokens{margin-top:0;margin-bottom:0}:host-context(.sky-theme-modern) sky-input-box .sky-lookup sky-tokens.sky-lookup-tokens .sky-tokens sky-token{padding-bottom:0;padding-top:0}:host-context(.sky-theme-modern) sky-input-box .sky-lookup sky-tokens.sky-lookup-tokens .sky-tokens .sky-tokens-content{padding-bottom:0;padding-top:0}:host-context(.sky-theme-modern) sky-input-box .sky-lookup sky-tokens.sky-lookup-tokens .sky-tokens .sky-tokens-content:first-child{padding-left:0}:host-context(.sky-theme-modern) sky-input-box .sky-lookup.sky-lookup-single sky-tokens.sky-lookup-tokens .sky-tokens-content{padding-left:0}:host-context(.sky-theme-modern) sky-input-box .sky-lookup .sky-lookup-search{background-color:transparent;padding:0 0 0 15px}:host-context(.sky-theme-modern) sky-input-box .sky-lookup .sky-lookup-search.sky-field-status-active{box-shadow:none}:host-context(.sky-theme-modern) sky-input-box .sky-lookup textarea.sky-lookup-input.sky-form-control{padding-left:0;resize:none}:host-context(.sky-theme-modern) sky-input-box .sky-lookup .sky-lookup-single-control{padding-left:0}.sky-theme-modern sky-tokens.sky-lookup-tokens .sky-tokens{margin-top:-6px}.sky-theme-modern sky-input-box .sky-lookup sky-tokens.sky-lookup-tokens .sky-tokens{margin-top:0;margin-bottom:0}.sky-theme-modern sky-input-box .sky-lookup sky-tokens.sky-lookup-tokens .sky-tokens sky-token{padding-bottom:0;padding-top:0}.sky-theme-modern sky-input-box .sky-lookup sky-tokens.sky-lookup-tokens .sky-tokens .sky-tokens-content{padding-bottom:0;padding-top:0}.sky-theme-modern sky-input-box .sky-lookup sky-tokens.sky-lookup-tokens .sky-tokens .sky-tokens-content:first-child{padding-left:0}.sky-theme-modern sky-input-box .sky-lookup.sky-lookup-single sky-tokens.sky-lookup-tokens .sky-tokens-content{padding-left:0}.sky-theme-modern sky-input-box .sky-lookup .sky-lookup-search{background-color:transparent;padding:0 0 0 15px}.sky-theme-modern sky-input-box .sky-lookup .sky-lookup-search.sky-field-status-active{box-shadow:none}.sky-theme-modern sky-input-box .sky-lookup textarea.sky-lookup-input.sky-form-control{padding-left:0;resize:none}.sky-theme-modern sky-input-box .sky-lookup .sky-lookup-single-control{padding-left:0}\n"], components: [{ type: i8.SkyAutocompleteComponent, selector: "sky-autocomplete", inputs: ["ariaLabelledBy", "data", "debounceTime", "descriptorProperty", "enableShowMore", "messageStream", "wrapperClass", "propertiesToSearch", "search", "searchResultTemplate", "searchTextMinimumCharacters", "searchFilters", "searchResultsLimit", "showAddButton", "noResultsFoundText", "searchAsyncDisabled"], outputs: ["addClick", "showMoreClick", "selectionChange", "searchAsync"] }, { type: i9.λ13, selector: "sky-tokens", inputs: ["disabled", "dismissible", "displayWith", "trackWith", "focusable", "tokens", "messageStream"], outputs: ["focusIndexOverRange", "focusIndexUnderRange", "tokenSelected", "tokensChange"] }, { type: i9.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i11.SkyAutocompleteInputDirective, selector: "input[skyAutocomplete], textarea[skyAutocomplete]", inputs: ["autocompleteAttribute", "disabled"] }, { type: i7.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }], pipes: { "skyLibResources": i5.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
536
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyLookupComponent, decorators: [{
537
- type: Component,
538
- args: [{
539
- selector: 'sky-lookup',
540
- templateUrl: './lookup.component.html',
541
- styleUrls: ['./lookup.component.scss'],
542
- providers: [SkyLookupAdapterService],
543
- encapsulation: ViewEncapsulation.None,
544
- changeDetection: ChangeDetectionStrategy.OnPush,
545
- }]
546
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.SkyAppWindowRef }, { type: i2.NgControl, decorators: [{
547
- type: Self
548
- }, {
549
- type: Optional
550
- }] }, { type: i3.SkyLookupAdapterService }, { type: i4.SkyModalService }, { type: i5.SkyLibResourcesService }, { type: i6.SkyInputBoxHostService, decorators: [{
551
- type: Optional
552
- }] }, { type: i7.SkyThemeService, decorators: [{
553
- type: Optional
554
- }] }]; }, propDecorators: { ariaLabel: [{
555
- type: Input
556
- }], ariaLabelledBy: [{
557
- type: Input
558
- }], autocompleteAttribute: [{
559
- type: Input
560
- }], data: [{
561
- type: Input
562
- }], disabled: [{
563
- type: Input
564
- }], enableShowMore: [{
565
- type: Input
566
- }], placeholderText: [{
567
- type: Input
568
- }], idProperty: [{
569
- type: Input
570
- }], showAddButton: [{
571
- type: Input
572
- }], showMoreConfig: [{
573
- type: Input
574
- }], selectMode: [{
575
- type: Input
576
- }], wrapperClass: [{
577
- type: Input
578
- }], addClick: [{
579
- type: Output
580
- }], autocompleteInputDirective: [{
581
- type: ViewChild,
582
- args: [SkyAutocompleteInputDirective, {
583
- read: SkyAutocompleteInputDirective,
584
- static: false,
585
- }]
586
- }], showMoreButtonTemplateRef: [{
587
- type: ViewChild,
588
- args: ['showMoreButtonTemplateRef', {
589
- read: TemplateRef,
590
- static: true,
591
- }]
592
- }], inputTemplateRef: [{
593
- type: ViewChild,
594
- args: ['inputTemplateRef', {
595
- read: TemplateRef,
596
- static: true,
597
- }]
598
- }], lookupWrapperRef: [{
599
- type: ViewChild,
600
- args: ['lookupWrapper', {
601
- read: ElementRef,
602
- }]
603
- }], searchIconTemplateRef: [{
604
- type: ViewChild,
605
- args: ['searchIconTemplateRef', {
606
- read: TemplateRef,
607
- static: true,
608
- }]
609
- }] } });
610
- //# sourceMappingURL=lookup.component.js.map