legacy-autocomplete.mjs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. import * as i0 from '@angular/core';
  2. import { Component, ViewEncapsulation, ChangeDetectionStrategy, ContentChildren, forwardRef, Directive, NgModule } from '@angular/core';
  3. import { MAT_LEGACY_OPTION_PARENT_COMPONENT, MAT_LEGACY_OPTGROUP, MatLegacyOption, MatLegacyOptionModule } from '@angular/material/legacy-core';
  4. import { _MatAutocompleteBase, _MatAutocompleteTriggerBase, _MatAutocompleteOriginBase, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER } from '@angular/material/autocomplete';
  5. export { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS as MAT_LEGACY_AUTOCOMPLETE_DEFAULT_OPTIONS, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY as MAT_LEGACY_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY as MAT_LEGACY_AUTOCOMPLETE_SCROLL_STRATEGY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY as MAT_LEGACY_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER as MAT_LEGACY_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER, MatAutocompleteSelectedEvent as MatLegacyAutocompleteSelectedEvent, getMatAutocompleteMissingPanelError as getMatLegacyAutocompleteMissingPanelError } from '@angular/material/autocomplete';
  6. import * as i1 from '@angular/common';
  7. import { CommonModule } from '@angular/common';
  8. import { OverlayModule } from '@angular/cdk/overlay';
  9. import { MatCommonModule } from '@angular/material/core';
  10. import { CdkScrollableModule } from '@angular/cdk/scrolling';
  11. import { NG_VALUE_ACCESSOR } from '@angular/forms';
  12. /**
  13. * @deprecated Use `MatAutocomplete` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  14. * @breaking-change 17.0.0
  15. */
  16. class MatLegacyAutocomplete extends _MatAutocompleteBase {
  17. constructor() {
  18. super(...arguments);
  19. this._visibleClass = 'mat-autocomplete-visible';
  20. this._hiddenClass = 'mat-autocomplete-hidden';
  21. }
  22. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyAutocomplete, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
  23. static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: MatLegacyAutocomplete, selector: "mat-autocomplete", inputs: { disableRipple: "disableRipple" }, host: { attributes: { "ngSkipHydration": "" }, classAttribute: "mat-autocomplete" }, providers: [{ provide: MAT_LEGACY_OPTION_PARENT_COMPONENT, useExisting: MatLegacyAutocomplete }], queries: [{ propertyName: "optionGroups", predicate: MAT_LEGACY_OPTGROUP, descendants: true }, { propertyName: "options", predicate: MatLegacyOption, descendants: true }], exportAs: ["matAutocomplete"], usesInheritance: true, ngImport: i0, template: "<ng-template let-formFieldId=\"id\">\n <div class=\"mat-autocomplete-panel\"\n role=\"listbox\"\n [id]=\"id\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"_getPanelAriaLabelledby(formFieldId)\"\n [ngClass]=\"_classList\"\n #panel>\n <ng-content></ng-content>\n </div>\n</ng-template>\n", styles: [".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}.mat-autocomplete-panel-above .mat-autocomplete-panel{border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}.mat-autocomplete-panel .mat-divider-horizontal{margin-top:-1px}.cdk-high-contrast-active .mat-autocomplete-panel{outline:solid 1px}mat-autocomplete{display:none}"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
  24. }
  25. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyAutocomplete, decorators: [{
  26. type: Component,
  27. args: [{ selector: 'mat-autocomplete', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'matAutocomplete', inputs: ['disableRipple'], host: {
  28. 'class': 'mat-autocomplete',
  29. 'ngSkipHydration': '',
  30. }, providers: [{ provide: MAT_LEGACY_OPTION_PARENT_COMPONENT, useExisting: MatLegacyAutocomplete }], template: "<ng-template let-formFieldId=\"id\">\n <div class=\"mat-autocomplete-panel\"\n role=\"listbox\"\n [id]=\"id\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"_getPanelAriaLabelledby(formFieldId)\"\n [ngClass]=\"_classList\"\n #panel>\n <ng-content></ng-content>\n </div>\n</ng-template>\n", styles: [".mat-autocomplete-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;visibility:hidden;max-width:none;max-height:256px;position:relative;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.mat-autocomplete-panel.mat-autocomplete-visible{visibility:visible}.mat-autocomplete-panel.mat-autocomplete-hidden{visibility:hidden}.mat-autocomplete-panel-above .mat-autocomplete-panel{border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}.mat-autocomplete-panel .mat-divider-horizontal{margin-top:-1px}.cdk-high-contrast-active .mat-autocomplete-panel{outline:solid 1px}mat-autocomplete{display:none}"] }]
  31. }], propDecorators: { optionGroups: [{
  32. type: ContentChildren,
  33. args: [MAT_LEGACY_OPTGROUP, { descendants: true }]
  34. }], options: [{
  35. type: ContentChildren,
  36. args: [MatLegacyOption, { descendants: true }]
  37. }] } });
  38. /**
  39. * Provider that allows the autocomplete to register as a ControlValueAccessor.
  40. * @docs-private
  41. * @deprecated Use `MAT_AUTOCOMPLETE_VALUE_ACCESSOR` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  42. * @breaking-change 17.0.0
  43. */
  44. const MAT_LEGACY_AUTOCOMPLETE_VALUE_ACCESSOR = {
  45. provide: NG_VALUE_ACCESSOR,
  46. useExisting: forwardRef(() => MatLegacyAutocompleteTrigger),
  47. multi: true,
  48. };
  49. /**
  50. * @deprecated Use `MatAutocompleteTrigger` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  51. * @breaking-change 17.0.0
  52. */
  53. class MatLegacyAutocompleteTrigger extends _MatAutocompleteTriggerBase {
  54. constructor() {
  55. super(...arguments);
  56. this._aboveClass = 'mat-autocomplete-panel-above';
  57. }
  58. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyAutocompleteTrigger, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
  59. static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: MatLegacyAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", host: { listeners: { "focusin": "_handleFocus()", "blur": "_onTouched()", "input": "_handleInput($event)", "keydown": "_handleKeydown($event)", "click": "_handleClick()" }, properties: { "attr.autocomplete": "autocompleteAttribute", "attr.role": "autocompleteDisabled ? null : \"combobox\"", "attr.aria-autocomplete": "autocompleteDisabled ? null : \"list\"", "attr.aria-activedescendant": "(panelOpen && activeOption) ? activeOption.id : null", "attr.aria-expanded": "autocompleteDisabled ? null : panelOpen.toString()", "attr.aria-owns": "(autocompleteDisabled || !panelOpen) ? null : autocomplete?.id", "attr.aria-haspopup": "autocompleteDisabled ? null : \"listbox\"" }, classAttribute: "mat-autocomplete-trigger" }, providers: [MAT_LEGACY_AUTOCOMPLETE_VALUE_ACCESSOR], exportAs: ["matAutocompleteTrigger"], usesInheritance: true, ngImport: i0 }); }
  60. }
  61. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyAutocompleteTrigger, decorators: [{
  62. type: Directive,
  63. args: [{
  64. selector: `input[matAutocomplete], textarea[matAutocomplete]`,
  65. host: {
  66. 'class': 'mat-autocomplete-trigger',
  67. '[attr.autocomplete]': 'autocompleteAttribute',
  68. '[attr.role]': 'autocompleteDisabled ? null : "combobox"',
  69. '[attr.aria-autocomplete]': 'autocompleteDisabled ? null : "list"',
  70. '[attr.aria-activedescendant]': '(panelOpen && activeOption) ? activeOption.id : null',
  71. '[attr.aria-expanded]': 'autocompleteDisabled ? null : panelOpen.toString()',
  72. '[attr.aria-owns]': '(autocompleteDisabled || !panelOpen) ? null : autocomplete?.id',
  73. '[attr.aria-haspopup]': 'autocompleteDisabled ? null : "listbox"',
  74. // Note: we use `focusin`, as opposed to `focus`, in order to open the panel
  75. // a little earlier. This avoids issues where IE delays the focusing of the input.
  76. '(focusin)': '_handleFocus()',
  77. '(blur)': '_onTouched()',
  78. '(input)': '_handleInput($event)',
  79. '(keydown)': '_handleKeydown($event)',
  80. '(click)': '_handleClick()',
  81. },
  82. exportAs: 'matAutocompleteTrigger',
  83. providers: [MAT_LEGACY_AUTOCOMPLETE_VALUE_ACCESSOR],
  84. }]
  85. }] });
  86. /**
  87. * Directive applied to an element to make it usable
  88. * as a connection point for an autocomplete panel.
  89. * @deprecated Use `MatAutocompleteOrigin` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  90. * @breaking-change 17.0.0
  91. */
  92. class MatLegacyAutocompleteOrigin extends _MatAutocompleteOriginBase {
  93. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyAutocompleteOrigin, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
  94. static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: MatLegacyAutocompleteOrigin, selector: "[matAutocompleteOrigin]", exportAs: ["matAutocompleteOrigin"], usesInheritance: true, ngImport: i0 }); }
  95. }
  96. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyAutocompleteOrigin, decorators: [{
  97. type: Directive,
  98. args: [{
  99. selector: '[matAutocompleteOrigin]',
  100. exportAs: 'matAutocompleteOrigin',
  101. }]
  102. }] });
  103. /**
  104. * @deprecated Use `MatAutocompleteModule` from `@angular/material/autocomplete` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  105. * @breaking-change 17.0.0
  106. */
  107. class MatLegacyAutocompleteModule {
  108. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
  109. static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyAutocompleteModule, declarations: [MatLegacyAutocomplete, MatLegacyAutocompleteTrigger, MatLegacyAutocompleteOrigin], imports: [OverlayModule, MatLegacyOptionModule, MatCommonModule, CommonModule], exports: [MatLegacyAutocomplete,
  110. MatLegacyAutocompleteTrigger,
  111. MatLegacyAutocompleteOrigin,
  112. CdkScrollableModule,
  113. MatLegacyOptionModule,
  114. MatCommonModule] }); }
  115. static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyAutocompleteModule, providers: [MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [OverlayModule, MatLegacyOptionModule, MatCommonModule, CommonModule, CdkScrollableModule,
  116. MatLegacyOptionModule,
  117. MatCommonModule] }); }
  118. }
  119. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatLegacyAutocompleteModule, decorators: [{
  120. type: NgModule,
  121. args: [{
  122. imports: [OverlayModule, MatLegacyOptionModule, MatCommonModule, CommonModule],
  123. exports: [
  124. MatLegacyAutocomplete,
  125. MatLegacyAutocompleteTrigger,
  126. MatLegacyAutocompleteOrigin,
  127. CdkScrollableModule,
  128. MatLegacyOptionModule,
  129. MatCommonModule,
  130. ],
  131. declarations: [MatLegacyAutocomplete, MatLegacyAutocompleteTrigger, MatLegacyAutocompleteOrigin],
  132. providers: [MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER],
  133. }]
  134. }] });
  135. /**
  136. * Generated bundle index. Do not edit.
  137. */
  138. export { MAT_LEGACY_AUTOCOMPLETE_VALUE_ACCESSOR, MatLegacyAutocomplete, MatLegacyAutocompleteModule, MatLegacyAutocompleteOrigin, MatLegacyAutocompleteTrigger };
  139. //# sourceMappingURL=legacy-autocomplete.mjs.map