@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
package/esm2015/index.js DELETED
@@ -1,32 +0,0 @@
1
- export * from './lib/modules/autocomplete/types/autocomplete-default-search-function-options';
2
- export * from './lib/modules/autocomplete/types/autocomplete-input-text-change';
3
- export * from './lib/modules/autocomplete/types/autocomplete-search-async-args';
4
- export * from './lib/modules/autocomplete/types/autocomplete-search-async-result';
5
- export * from './lib/modules/autocomplete/types/autocomplete-search-async-result-display-type';
6
- export * from './lib/modules/autocomplete/types/autocomplete-search-function';
7
- export * from './lib/modules/autocomplete/types/autocomplete-search-function-filter';
8
- export * from './lib/modules/autocomplete/types/autocomplete-search-function-response';
9
- export * from './lib/modules/autocomplete/types/autocomplete-selection-change';
10
- export * from './lib/modules/autocomplete/autocomplete.module';
11
- export * from './lib/modules/country-field/country-field.module';
12
- export * from './lib/modules/country-field/types/country';
13
- export * from './lib/modules/lookup/lookup.module';
14
- export * from './lib/modules/lookup/types/lookup-add-click-callback-args';
15
- export * from './lib/modules/lookup/types/lookup-add-click-event-args';
16
- export * from './lib/modules/lookup/types/lookup-select-mode';
17
- export * from './lib/modules/lookup/types/lookup-select-mode-type';
18
- export * from './lib/modules/lookup/types/lookup-show-more-config';
19
- export * from './lib/modules/lookup/types/lookup-show-more-custom-picker';
20
- export * from './lib/modules/lookup/types/lookup-show-more-custom-picker-context';
21
- export * from './lib/modules/lookup/types/lookup-show-more-native-picker-config';
22
- export * from './lib/modules/search/search.module';
23
- // The following exports are needed internally by @skyux/list-builder.
24
- // TODO: Find a way to remove them in the next major version release.
25
- export * from './lib/modules/search/search.component';
26
- // Components and directives must be exported to support Angular's "partial" Ivy compiler.
27
- // Obscure names are used to indicate types are not part of the public API.
28
- export { SkyAutocompleteInputDirective as λ1 } from './lib/modules/autocomplete/autocomplete-input.directive';
29
- export { SkyAutocompleteComponent as λ2 } from './lib/modules/autocomplete/autocomplete.component';
30
- export { SkyCountryFieldComponent as λ3 } from './lib/modules/country-field/country-field.component';
31
- export { SkyLookupComponent as λ4 } from './lib/modules/lookup/lookup.component';
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/lookup/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+EAA+E,CAAC;AAC9F,cAAc,iEAAiE,CAAC;AAChF,cAAc,iEAAiE,CAAC;AAChF,cAAc,mEAAmE,CAAC;AAClF,cAAc,gFAAgF,CAAC;AAC/F,cAAc,+DAA+D,CAAC;AAC9E,cAAc,sEAAsE,CAAC;AACrF,cAAc,wEAAwE,CAAC;AACvF,cAAc,gEAAgE,CAAC;AAC/E,cAAc,gDAAgD,CAAC;AAE/D,cAAc,kDAAkD,CAAC;AACjE,cAAc,2CAA2C,CAAC;AAE1D,cAAc,oCAAoC,CAAC;AACnD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wDAAwD,CAAC;AACvE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,mEAAmE,CAAC;AAClF,cAAc,kEAAkE,CAAC;AAEjF,cAAc,oCAAoC,CAAC;AAEnD,sEAAsE;AACtE,qEAAqE;AACrE,cAAc,uCAAuC,CAAC;AAEtD,0FAA0F;AAC1F,2EAA2E;AAC3E,OAAO,EAAE,6BAA6B,IAAI,EAAE,EAAE,MAAM,yDAAyD,CAAC;AAC9G,OAAO,EAAE,wBAAwB,IAAI,EAAE,EAAE,MAAM,mDAAmD,CAAC;AACnG,OAAO,EAAE,wBAAwB,IAAI,EAAE,EAAE,MAAM,qDAAqD,CAAC;AACrG,OAAO,EAAE,kBAAkB,IAAI,EAAE,EAAE,MAAM,uCAAuC,CAAC","sourcesContent":["export * from './lib/modules/autocomplete/types/autocomplete-default-search-function-options';\nexport * from './lib/modules/autocomplete/types/autocomplete-input-text-change';\nexport * from './lib/modules/autocomplete/types/autocomplete-search-async-args';\nexport * from './lib/modules/autocomplete/types/autocomplete-search-async-result';\nexport * from './lib/modules/autocomplete/types/autocomplete-search-async-result-display-type';\nexport * from './lib/modules/autocomplete/types/autocomplete-search-function';\nexport * from './lib/modules/autocomplete/types/autocomplete-search-function-filter';\nexport * from './lib/modules/autocomplete/types/autocomplete-search-function-response';\nexport * from './lib/modules/autocomplete/types/autocomplete-selection-change';\nexport * from './lib/modules/autocomplete/autocomplete.module';\n\nexport * from './lib/modules/country-field/country-field.module';\nexport * from './lib/modules/country-field/types/country';\n\nexport * from './lib/modules/lookup/lookup.module';\nexport * from './lib/modules/lookup/types/lookup-add-click-callback-args';\nexport * from './lib/modules/lookup/types/lookup-add-click-event-args';\nexport * from './lib/modules/lookup/types/lookup-select-mode';\nexport * from './lib/modules/lookup/types/lookup-select-mode-type';\nexport * from './lib/modules/lookup/types/lookup-show-more-config';\nexport * from './lib/modules/lookup/types/lookup-show-more-custom-picker';\nexport * from './lib/modules/lookup/types/lookup-show-more-custom-picker-context';\nexport * from './lib/modules/lookup/types/lookup-show-more-native-picker-config';\n\nexport * from './lib/modules/search/search.module';\n\n// The following exports are needed internally by @skyux/list-builder.\n// TODO: Find a way to remove them in the next major version release.\nexport * from './lib/modules/search/search.component';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of the public API.\nexport { SkyAutocompleteInputDirective as λ1 } from './lib/modules/autocomplete/autocomplete-input.directive';\nexport { SkyAutocompleteComponent as λ2 } from './lib/modules/autocomplete/autocomplete.component';\nexport { SkyCountryFieldComponent as λ3 } from './lib/modules/country-field/country-field.component';\nexport { SkyLookupComponent as λ4 } from './lib/modules/lookup/lookup.component';\n"]}
@@ -1,61 +0,0 @@
1
- import { Injectable, RendererFactory2, } from '@angular/core';
2
- import { SkyCoreAdapterService } from '@skyux/core';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@skyux/core";
5
- /**
6
- * @internal
7
- */
8
- export class SkyAutocompleteAdapterService {
9
- constructor(coreAdapterService, rendererFactory) {
10
- this.coreAdapterService = coreAdapterService;
11
- this.rendererFactory = rendererFactory;
12
- this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
13
- }
14
- /**
15
- * Adds the className for the provided element.
16
- */
17
- addCSSClass(element, className) {
18
- /* Sanity check */
19
- /* istanbul ignore else */
20
- if (element) {
21
- this.renderer.addClass(element, className);
22
- }
23
- }
24
- getOverlayFocusableElements(overlay) {
25
- return this.coreAdapterService.getFocusableChildren(
26
- /* Sanity check - calling function also has null check */
27
- /* istanbul ignore next */
28
- overlay === null || overlay === void 0 ? void 0 : overlay.componentRef.location.nativeElement, { ignoreTabIndex: true });
29
- }
30
- /**
31
- * Removes the className for the provided element.
32
- */
33
- removeCSSClass(element, className) {
34
- /* Sanity check */
35
- /* istanbul ignore else */
36
- if (element) {
37
- this.renderer.removeClass(element, className);
38
- }
39
- }
40
- setDropdownWidth(elementRef, dropdownRef, isInputBox) {
41
- const parentElement = isInputBox
42
- ? elementRef.nativeElement.closest('.sky-input-box')
43
- : elementRef.nativeElement;
44
- if (parentElement) {
45
- const width = parentElement.getBoundingClientRect().width;
46
- this.renderer.setStyle(dropdownRef.nativeElement, 'width', `${width}px`);
47
- }
48
- }
49
- /**
50
- * Sets the `tabIndex` of the `element` to the provided `tabIndex`.
51
- */
52
- setTabIndex(element, tabIndex) {
53
- element.tabIndex = tabIndex;
54
- }
55
- }
56
- SkyAutocompleteAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAutocompleteAdapterService, deps: [{ token: i1.SkyCoreAdapterService }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
57
- SkyAutocompleteAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAutocompleteAdapterService });
58
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAutocompleteAdapterService, decorators: [{
59
- type: Injectable
60
- }], ctorParameters: function () { return [{ type: i1.SkyCoreAdapterService }, { type: i0.RendererFactory2 }]; } });
61
- //# sourceMappingURL=autocomplete-adapter.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autocomplete-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lookup/src/lib/modules/autocomplete/autocomplete-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAsB,MAAM,aAAa,CAAC;;;AAExE;;GAEG;AAEH,MAAM,OAAO,6BAA6B;IAGxC,YACU,kBAAyC,EACzC,eAAiC;QADjC,uBAAkB,GAAlB,kBAAkB,CAAuB;QACzC,oBAAe,GAAf,eAAe,CAAkB;QAEzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,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A6B;kBADzC,UAAU","sourcesContent":["import {\n ElementRef,\n Injectable,\n Renderer2,\n RendererFactory2,\n} from '@angular/core';\nimport { SkyCoreAdapterService, SkyOverlayInstance } from '@skyux/core';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyAutocompleteAdapterService {\n private renderer: Renderer2;\n\n constructor(\n private coreAdapterService: SkyCoreAdapterService,\n private rendererFactory: RendererFactory2\n ) {\n this.renderer = this.rendererFactory.createRenderer(undefined, undefined);\n }\n\n /**\n * Adds the className for the provided element.\n */\n public addCSSClass(element: HTMLElement, className: string): void {\n /* Sanity check */\n /* istanbul ignore else */\n if (element) {\n this.renderer.addClass(element, className);\n }\n }\n\n public getOverlayFocusableElements(\n overlay: SkyOverlayInstance\n ): HTMLElement[] {\n return this.coreAdapterService.getFocusableChildren(\n /* Sanity check - calling function also has null check */\n /* istanbul ignore next */\n overlay?.componentRef.location.nativeElement,\n { ignoreTabIndex: true }\n );\n }\n\n /**\n * Removes the className for the provided element.\n */\n public removeCSSClass(element: HTMLElement, className: string): void {\n /* Sanity check */\n /* istanbul ignore else */\n if (element) {\n this.renderer.removeClass(element, className);\n }\n }\n\n public setDropdownWidth(\n elementRef: ElementRef,\n dropdownRef: ElementRef,\n isInputBox: boolean\n ): void {\n const parentElement = isInputBox\n ? elementRef.nativeElement.closest('.sky-input-box')\n : elementRef.nativeElement;\n if (parentElement) {\n const width = parentElement.getBoundingClientRect().width;\n this.renderer.setStyle(dropdownRef.nativeElement, 'width', `${width}px`);\n }\n }\n\n /**\n * Sets the `tabIndex` of the `element` to the provided `tabIndex`.\n */\n public setTabIndex(element: HTMLElement, tabIndex: number): void {\n element.tabIndex = tabIndex;\n }\n}\n"]}
@@ -1,39 +0,0 @@
1
- import { normalizeDiacritics } from '../shared/sky-lookup-string-utils';
2
- export function skyAutocompleteDefaultSearchFunction(options) {
3
- const filterData = function (searchText, data) {
4
- return data.filter((item) => {
5
- if (!options.searchFilters || !options.searchFilters.length) {
6
- return true;
7
- }
8
- // Find the first failing filter (we can skip the others if one fails).
9
- const failedFilter = options.searchFilters.find((filter) => {
10
- return !filter.call({}, searchText, item);
11
- });
12
- return failedFilter === undefined;
13
- });
14
- };
15
- const search = function (searchText, data) {
16
- const results = [];
17
- /* Sanity check - autocomplete will not call search with empty search text */
18
- /* istanbul ignore if */
19
- if (!searchText) {
20
- return results;
21
- }
22
- const searchTextNormalized = normalizeDiacritics(searchText).toUpperCase();
23
- const filteredData = filterData(searchText, data);
24
- for (let i = 0, n = filteredData.length; i < n; i++) {
25
- const result = filteredData[i];
26
- const isMatch = options.propertiesToSearch.find((property) => {
27
- let value = (result[property] || '').toString();
28
- value = normalizeDiacritics(value).toUpperCase();
29
- return value.indexOf(searchTextNormalized) > -1;
30
- });
31
- if (isMatch) {
32
- results.push(result);
33
- }
34
- }
35
- return results;
36
- };
37
- return search;
38
- }
39
- //# sourceMappingURL=autocomplete-default-search-function.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autocomplete-default-search-function.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lookup/src/lib/modules/autocomplete/autocomplete-default-search-function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAOxE,MAAM,UAAU,oCAAoC,CAClD,OAAoD;IAEpD,MAAM,UAAU,GAAG,UAAU,UAAkB,EAAE,IAAW;QAC1D,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE;YAC/B,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE;gBAC3D,OAAO,IAAI,CAAC;aACb;YAED,uEAAuE;YACvE,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAC7C,CAAC,MAA2C,EAAE,EAAE;gBAC9C,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;YAC5C,CAAC,CACF,CAAC;YAEF,OAAO,YAAY,KAAK,SAAS,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,UACb,UAAkB,EAClB,IAAW;QAEX,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,6EAA6E;QAC7E,wBAAwB;QACxB,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,OAAO,CAAC;SAChB;QAED,MAAM,oBAAoB,GAAG,mBAAmB,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;QAE3E,MAAM,YAAY,GAAG,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAElD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YACnD,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAgB,EAAE,EAAE;gBACnE,IAAI,KAAK,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAChD,KAAK,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;gBACjD,OAAO,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;YAClD,CAAC,CAAC,CAAC;YAEH,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACtB;SACF;QAED,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { normalizeDiacritics } from '../shared/sky-lookup-string-utils';\n\nimport { SkyAutocompleteDefaultSearchFunctionOptions } from './types/autocomplete-default-search-function-options';\nimport { SkyAutocompleteSearchFunction } from './types/autocomplete-search-function';\nimport { SkyAutocompleteSearchFunctionFilter } from './types/autocomplete-search-function-filter';\nimport { SkyAutocompleteSearchFunctionResponse } from './types/autocomplete-search-function-response';\n\nexport function skyAutocompleteDefaultSearchFunction(\n options: SkyAutocompleteDefaultSearchFunctionOptions\n): SkyAutocompleteSearchFunction {\n const filterData = function (searchText: string, data: any[]): any[] {\n return data.filter((item: any) => {\n if (!options.searchFilters || !options.searchFilters.length) {\n return true;\n }\n\n // Find the first failing filter (we can skip the others if one fails).\n const failedFilter = options.searchFilters.find(\n (filter: SkyAutocompleteSearchFunctionFilter) => {\n return !filter.call({}, searchText, item);\n }\n );\n\n return failedFilter === undefined;\n });\n };\n\n const search = function (\n searchText: string,\n data: any[]\n ): SkyAutocompleteSearchFunctionResponse {\n const results = [];\n\n /* Sanity check - autocomplete will not call search with empty search text */\n /* istanbul ignore if */\n if (!searchText) {\n return results;\n }\n\n const searchTextNormalized = normalizeDiacritics(searchText).toUpperCase();\n\n const filteredData = filterData(searchText, data);\n\n for (let i = 0, n = filteredData.length; i < n; i++) {\n const result = filteredData[i];\n const isMatch = options.propertiesToSearch.find((property: string) => {\n let value = (result[property] || '').toString();\n value = normalizeDiacritics(value).toUpperCase();\n return value.indexOf(searchTextNormalized) > -1;\n });\n\n if (isMatch) {\n results.push(result);\n }\n }\n\n return results;\n };\n\n return search;\n}\n"]}
@@ -1,221 +0,0 @@
1
- import { Directive, ElementRef, Input, Renderer2, forwardRef, } from '@angular/core';
2
- import { NG_VALIDATORS, NG_VALUE_ACCESSOR, } from '@angular/forms';
3
- import { Subject, fromEvent as observableFromEvent } from 'rxjs';
4
- import { takeUntil } from 'rxjs/operators';
5
- import * as i0 from "@angular/core";
6
- // tslint:disable:no-forward-ref no-use-before-declare
7
- const SKY_AUTOCOMPLETE_VALUE_ACCESSOR = {
8
- provide: NG_VALUE_ACCESSOR,
9
- useExisting: forwardRef(() => SkyAutocompleteInputDirective),
10
- multi: true,
11
- };
12
- const SKY_AUTOCOMPLETE_VALIDATOR = {
13
- provide: NG_VALIDATORS,
14
- useExisting: forwardRef(() => SkyAutocompleteInputDirective),
15
- multi: true,
16
- };
17
- // tslint:enable
18
- export class SkyAutocompleteInputDirective {
19
- constructor(elementRef, renderer) {
20
- this.elementRef = elementRef;
21
- this.renderer = renderer;
22
- this.isFirstChange = true;
23
- this.ngUnsubscribe = new Subject();
24
- this._blur = new Subject();
25
- this._disabled = false;
26
- this._focus = new Subject();
27
- this._textChanges = new Subject();
28
- // istanbul ignore next
29
- // eslint-disable-next-line @typescript-eslint/no-empty-function
30
- this.onValidatorChange = () => { };
31
- }
32
- /**
33
- * Specifies the value for the `autocomplete` attribute on the form input.
34
- * @default "off"
35
- */
36
- set autocompleteAttribute(value) {
37
- if (!value) {
38
- this._autocompleteAttribute = 'off';
39
- }
40
- else {
41
- this._autocompleteAttribute = value;
42
- }
43
- this.renderer.setAttribute(this.elementRef.nativeElement, 'autocomplete', this.autocompleteAttribute);
44
- }
45
- get autocompleteAttribute() {
46
- return this._autocompleteAttribute || 'off';
47
- }
48
- /**
49
- * Indicates whether to disable the autocomplete field.
50
- * @default false
51
- */
52
- set disabled(value) {
53
- this._disabled = value;
54
- this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', value);
55
- }
56
- get disabled() {
57
- return this._disabled;
58
- }
59
- get blur() {
60
- return this._blur.asObservable();
61
- }
62
- get displayWith() {
63
- return this._displayWith;
64
- }
65
- set displayWith(value) {
66
- this._displayWith = value;
67
- this.inputTextValue = this.getValueByKey();
68
- }
69
- /**
70
- * @internal
71
- */
72
- get inputElement() {
73
- return this.elementRef.nativeElement;
74
- }
75
- get focus() {
76
- return this._focus.asObservable();
77
- }
78
- get inputTextValue() {
79
- return this.elementRef.nativeElement.value;
80
- }
81
- set inputTextValue(value) {
82
- this.elementRef.nativeElement.value = value || '';
83
- }
84
- get textChanges() {
85
- return this._textChanges.asObservable();
86
- }
87
- get value() {
88
- return this._value;
89
- }
90
- set value(value) {
91
- const isNewValue = value !== this._value;
92
- /* istanbul ignore else */
93
- if (isNewValue) {
94
- this._value = value;
95
- this.inputTextValue = this.getValueByKey();
96
- this.onChange(this._value);
97
- // Do not mark the field as "dirty"
98
- // if the field has been initialized with a value.
99
- if (this.isFirstChange && this.control) {
100
- this.control.markAsPristine();
101
- }
102
- if (this.isFirstChange && this._value) {
103
- this.isFirstChange = false;
104
- }
105
- }
106
- }
107
- ngOnInit() {
108
- const element = this.elementRef.nativeElement;
109
- this.setAttributes(element);
110
- observableFromEvent(element, 'input')
111
- .pipe(takeUntil(this.ngUnsubscribe))
112
- .subscribe(() => {
113
- /** Sanity check */
114
- if (!this.disabled) {
115
- this._textChanges.next({
116
- value: this.elementRef.nativeElement.value,
117
- });
118
- }
119
- });
120
- observableFromEvent(element, 'blur')
121
- .pipe(takeUntil(this.ngUnsubscribe))
122
- .subscribe(() => {
123
- /** Sanity check */
124
- if (!this.disabled) {
125
- this._blur.next();
126
- }
127
- });
128
- observableFromEvent(element, 'focus')
129
- .pipe(takeUntil(this.ngUnsubscribe))
130
- .subscribe(() => {
131
- /** Sanity check */
132
- if (!this.disabled) {
133
- this._focus.next();
134
- }
135
- });
136
- observableFromEvent(element, 'change')
137
- .pipe(takeUntil(this.ngUnsubscribe))
138
- .subscribe(() => {
139
- /** Sanity check */
140
- /* istanbul ignore else */
141
- if (!this.disabled) {
142
- this.isFirstChange = false;
143
- }
144
- });
145
- }
146
- ngOnDestroy() {
147
- this._blur.complete();
148
- this._textChanges.complete();
149
- this.ngUnsubscribe.next();
150
- this.ngUnsubscribe.complete();
151
- this._blur = this._textChanges = this.ngUnsubscribe = undefined;
152
- }
153
- writeValue(value) {
154
- this.value = value;
155
- }
156
- registerOnChange(fn) {
157
- this.onChange = fn;
158
- }
159
- registerOnTouched(fn) {
160
- this.onTouched = fn;
161
- }
162
- registerOnValidatorChange(fn) {
163
- this.onValidatorChange = fn;
164
- }
165
- restoreInputTextValueToPreviousState() {
166
- const modelValue = this.getValueByKey();
167
- // If the search field contains text, make sure that the value
168
- // matches the selected descriptor key.
169
- if (this.inputTextValue !== modelValue) {
170
- this.inputTextValue = modelValue;
171
- }
172
- this.onTouched();
173
- }
174
- setDisabledState(disabled) {
175
- this.disabled = disabled;
176
- }
177
- validate(control) {
178
- if (!this.control) {
179
- this.control = control;
180
- }
181
- return;
182
- }
183
- // See: https://www.w3.org/TR/wai-aria-practices/#kbd_focus_activedescendant
184
- setActiveDescendant(descendantId) {
185
- if (descendantId) {
186
- this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-activedescendant', descendantId);
187
- }
188
- else {
189
- this.renderer.removeAttribute(this.elementRef.nativeElement, 'aria-activedescendant');
190
- }
191
- }
192
- // Angular automatically constructs these methods.
193
- // eslint-disable-next-line @typescript-eslint/no-empty-function
194
- onChange(value) { }
195
- // eslint-disable-next-line @typescript-eslint/no-empty-function
196
- onTouched() { }
197
- setAttributes(element) {
198
- this.renderer.setAttribute(element, 'autocomplete', this.autocompleteAttribute);
199
- this.renderer.setAttribute(element, 'autocapitalize', 'none');
200
- this.renderer.setAttribute(element, 'autocorrect', 'off');
201
- this.renderer.setAttribute(element, 'spellcheck', 'false');
202
- this.renderer.addClass(element, 'sky-form-control');
203
- }
204
- getValueByKey() {
205
- return this.value ? this.value[this.displayWith] : undefined;
206
- }
207
- }
208
- SkyAutocompleteInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAutocompleteInputDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
209
- SkyAutocompleteInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyAutocompleteInputDirective, selector: "input[skyAutocomplete], textarea[skyAutocomplete]", inputs: { autocompleteAttribute: "autocompleteAttribute", disabled: "disabled" }, providers: [SKY_AUTOCOMPLETE_VALUE_ACCESSOR, SKY_AUTOCOMPLETE_VALIDATOR], ngImport: i0 });
210
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAutocompleteInputDirective, decorators: [{
211
- type: Directive,
212
- args: [{
213
- selector: 'input[skyAutocomplete], textarea[skyAutocomplete]',
214
- providers: [SKY_AUTOCOMPLETE_VALUE_ACCESSOR, SKY_AUTOCOMPLETE_VALIDATOR],
215
- }]
216
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { autocompleteAttribute: [{
217
- type: Input
218
- }], disabled: [{
219
- type: Input
220
- }] } });
221
- //# sourceMappingURL=autocomplete-input.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autocomplete-input.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lookup/src/lib/modules/autocomplete/autocomplete-input.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,KAAK,EAGL,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,aAAa,EACb,iBAAiB,GAGlB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAc,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;;AAI3C,sDAAsD;AACtD,MAAM,+BAA+B,GAAG;IACtC,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC;IAC5D,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,MAAM,0BAA0B,GAAG;IACjC,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC;IAC5D,KAAK,EAAE,IAAI;CACZ,CAAC;AACF,gBAAgB;AAMhB,MAAM,OAAO,6BAA6B;IAyHxC,YAAoB,UAAsB,EAAU,QAAmB;QAAnD,eAAU,GAAV,UA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ent":["import {\n Directive,\n ElementRef,\n Input,\n OnDestroy,\n OnInit,\n Renderer2,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport { Observable, Subject, fromEvent as observableFromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyAutocompleteInputTextChange } from './types/autocomplete-input-text-change';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_AUTOCOMPLETE_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyAutocompleteInputDirective),\n multi: true,\n};\n\nconst SKY_AUTOCOMPLETE_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyAutocompleteInputDirective),\n multi: true,\n};\n// tslint:enable\n\n@Directive({\n selector: 'input[skyAutocomplete], textarea[skyAutocomplete]',\n providers: [SKY_AUTOCOMPLETE_VALUE_ACCESSOR, SKY_AUTOCOMPLETE_VALIDATOR],\n})\nexport class SkyAutocompleteInputDirective\n implements OnInit, OnDestroy, ControlValueAccessor, Validator\n{\n /**\n * Specifies the value for the `autocomplete` attribute on the form input.\n * @default \"off\"\n */\n @Input()\n public set autocompleteAttribute(value: string) {\n if (!value) {\n this._autocompleteAttribute = 'off';\n } else {\n this._autocompleteAttribute = value;\n }\n\n this.renderer.setAttribute(\n this.elementRef.nativeElement,\n 'autocomplete',\n this.autocompleteAttribute\n );\n }\n\n public get autocompleteAttribute(): string {\n return this._autocompleteAttribute || 'off';\n }\n\n /**\n * Indicates whether to disable the autocomplete field.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n this._disabled = value;\n this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', value);\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n public get blur(): Observable<void> {\n return this._blur.asObservable();\n }\n\n public get displayWith(): string {\n return this._displayWith;\n }\n\n public set displayWith(value: string) {\n this._displayWith = value;\n this.inputTextValue = this.getValueByKey();\n }\n\n /**\n * @internal\n */\n public get inputElement(): any {\n return this.elementRef.nativeElement;\n }\n\n public get focus(): Observable<void> {\n return this._focus.asObservable();\n }\n\n public get inputTextValue(): string {\n return this.elementRef.nativeElement.value;\n }\n\n public set inputTextValue(value: string) {\n this.elementRef.nativeElement.value = value || '';\n }\n\n public get textChanges(): Observable<SkyAutocompleteInputTextChange> {\n return this._textChanges.asObservable();\n }\n\n public get value(): any {\n return this._value;\n }\n\n public set value(value: any) {\n const isNewValue = value !== this._value;\n\n /* istanbul ignore else */\n if (isNewValue) {\n this._value = value;\n this.inputTextValue = this.getValueByKey();\n this.onChange(this._value);\n\n // Do not mark the field as \"dirty\"\n // if the field has been initialized with a value.\n if (this.isFirstChange && this.control) {\n this.control.markAsPristine();\n }\n\n if (this.isFirstChange && this._value) {\n this.isFirstChange = false;\n }\n }\n }\n\n private control: AbstractControl;\n\n private isFirstChange = true;\n\n private ngUnsubscribe = new Subject<void>();\n\n private _autocompleteAttribute: string;\n\n private _blur = new Subject<void>();\n\n private _disabled = false;\n\n private _displayWith: string;\n\n private _focus = new Subject<void>();\n\n private _textChanges = new Subject<SkyAutocompleteInputTextChange>();\n\n private _value: any;\n\n constructor(private elementRef: ElementRef, private renderer: Renderer2) {}\n\n public ngOnInit() {\n const element = this.elementRef.nativeElement;\n\n this.setAttributes(element);\n\n observableFromEvent(element, 'input')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n /** Sanity check */\n if (!this.disabled) {\n this._textChanges.next({\n value: this.elementRef.nativeElement.value,\n });\n }\n });\n\n observableFromEvent(element, 'blur')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n /** Sanity check */\n if (!this.disabled) {\n this._blur.next();\n }\n });\n\n observableFromEvent(element, 'focus')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n /** Sanity check */\n if (!this.disabled) {\n this._focus.next();\n }\n });\n\n observableFromEvent(element, 'change')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n /** Sanity check */\n /* istanbul ignore else */\n if (!this.disabled) {\n this.isFirstChange = false;\n }\n });\n }\n\n public ngOnDestroy(): void {\n this._blur.complete();\n this._textChanges.complete();\n\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n\n this._blur = this._textChanges = this.ngUnsubscribe = undefined;\n }\n\n public writeValue(value: any): void {\n this.value = value;\n }\n\n public registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n public registerOnValidatorChange(fn: () => void): void {\n this.onValidatorChange = fn;\n }\n\n public restoreInputTextValueToPreviousState(): void {\n const modelValue = this.getValueByKey();\n\n // If the search field contains text, make sure that the value\n // matches the selected descriptor key.\n if (this.inputTextValue !== modelValue) {\n this.inputTextValue = modelValue;\n }\n\n this.onTouched();\n }\n\n public setDisabledState(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n public validate(control: AbstractControl): ValidationErrors {\n if (!this.control) {\n this.control = control;\n }\n return;\n }\n\n // See: https://www.w3.org/TR/wai-aria-practices/#kbd_focus_activedescendant\n public setActiveDescendant(descendantId: string | null): void {\n if (descendantId) {\n this.renderer.setAttribute(\n this.elementRef.nativeElement,\n 'aria-activedescendant',\n descendantId\n );\n } else {\n this.renderer.removeAttribute(\n this.elementRef.nativeElement,\n 'aria-activedescendant'\n );\n }\n }\n\n // Angular automatically constructs these methods.\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n public onChange(value: any): void {}\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n public onTouched(): void {}\n // istanbul ignore next\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n public onValidatorChange = () => {};\n\n private setAttributes(element: any): void {\n this.renderer.setAttribute(\n element,\n 'autocomplete',\n this.autocompleteAttribute\n );\n this.renderer.setAttribute(element, 'autocapitalize', 'none');\n this.renderer.setAttribute(element, 'autocorrect', 'off');\n this.renderer.setAttribute(element, 'spellcheck', 'false');\n this.renderer.addClass(element, 'sky-form-control');\n }\n\n private getValueByKey(): string {\n return this.value ? this.value[this.displayWith] : undefined;\n }\n}\n"]}
@@ -1,19 +0,0 @@
1
- import { Pipe } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * @internal
5
- */
6
- export class SkyAutcompleteSearchAsyncDisabledPipe {
7
- transform(searchAsync, searchAsyncDisabled) {
8
- return searchAsyncDisabled || searchAsync.observers.length === 0;
9
- }
10
- }
11
- SkyAutcompleteSearchAsyncDisabledPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAutcompleteSearchAsyncDisabledPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
12
- SkyAutcompleteSearchAsyncDisabledPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAutcompleteSearchAsyncDisabledPipe, name: "skyAutocompleteSearchAsyncDisabled" });
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAutcompleteSearchAsyncDisabledPipe, decorators: [{
14
- type: Pipe,
15
- args: [{
16
- name: 'skyAutocompleteSearchAsyncDisabled',
17
- }]
18
- }] });
19
- //# sourceMappingURL=autocomplete-search-async-disabled.pipe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autocomplete-search-async-disabled.pipe.js","sourceRoot":"","sources":["../../../../../../../../libs/components/lookup/src/lib/modules/autocomplete/autocomplete-search-async-disabled.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,IAAI,EAAiB,MAAM,eAAe,CAAC;;AAIlE;;GAEG;AAIH,MAAM,OAAO,qCAAqC;IACzC,SAAS,CACd,WAAyD,EACzD,mBAA4B;QAE5B,OAAO,mBAAmB,IAAI,WAAW,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC;IACnE,CAAC;;mIANU,qCAAqC;iIAArC,qCAAqC;4FAArC,qCAAqC;kBAHjD,IAAI;mBAAC;oBACJ,IAAI,EAAE,oCAAoC;iBAC3C","sourcesContent":["import { EventEmitter, Pipe, PipeTransform } from '@angular/core';\n\nimport { SkyAutocompleteSearchAsyncArgs } from './types/autocomplete-search-async-args';\n\n/**\n * @internal\n */\n@Pipe({\n name: 'skyAutocompleteSearchAsyncDisabled',\n})\nexport class SkyAutcompleteSearchAsyncDisabledPipe implements PipeTransform {\n public transform(\n searchAsync: EventEmitter<SkyAutocompleteSearchAsyncArgs>,\n searchAsyncDisabled: boolean\n ): boolean {\n return searchAsyncDisabled || searchAsync.observers.length === 0;\n }\n}\n"]}