index.d.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. import { AnimationTriggerMetadata } from '@angular/animations';
  2. import { ConnectedPosition } from '@angular/cdk/overlay';
  3. import * as i0 from '@angular/core';
  4. import * as i2 from '@angular/common';
  5. import * as i3 from '@angular/cdk/overlay';
  6. import * as i4 from '@angular/material/legacy-core';
  7. import * as i5 from '@angular/material/core';
  8. import * as i6 from '@angular/cdk/scrolling';
  9. import * as i7 from '@angular/material/legacy-form-field';
  10. import { MAT_SELECT_CONFIG as MAT_LEGACY_SELECT_CONFIG } from '@angular/material/select';
  11. import { MAT_SELECT_SCROLL_STRATEGY as MAT_LEGACY_SELECT_SCROLL_STRATEGY } from '@angular/material/select';
  12. import { MAT_SELECT_SCROLL_STRATEGY_PROVIDER as MAT_LEGACY_SELECT_SCROLL_STRATEGY_PROVIDER } from '@angular/material/select';
  13. import { MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY as MAT_LEGACY_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY } from '@angular/material/select';
  14. import { MAT_SELECT_TRIGGER as MAT_LEGACY_SELECT_TRIGGER } from '@angular/material/select';
  15. import { MatLegacyOptgroup } from '@angular/material/legacy-core';
  16. import { MatLegacyOption } from '@angular/material/legacy-core';
  17. import { MatSelectConfig as MatLegacySelectConfig } from '@angular/material/select';
  18. import { _MatSelectBase } from '@angular/material/select';
  19. import { OnInit } from '@angular/core';
  20. import { QueryList } from '@angular/core';
  21. declare namespace i1 {
  22. export {
  23. SELECT_PANEL_MAX_HEIGHT,
  24. SELECT_PANEL_PADDING_X,
  25. SELECT_PANEL_INDENT_PADDING_X,
  26. SELECT_ITEM_HEIGHT_EM,
  27. SELECT_MULTIPLE_PANEL_PADDING_X,
  28. SELECT_PANEL_VIEWPORT_PADDING,
  29. MatLegacySelectChange,
  30. MatLegacySelectTrigger,
  31. MatLegacySelect
  32. }
  33. }
  34. export { MAT_LEGACY_SELECT_CONFIG }
  35. export { MAT_LEGACY_SELECT_SCROLL_STRATEGY }
  36. export { MAT_LEGACY_SELECT_SCROLL_STRATEGY_PROVIDER }
  37. export { MAT_LEGACY_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY }
  38. export { MAT_LEGACY_SELECT_TRIGGER }
  39. /**
  40. * @deprecated Use `MatSelect` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  41. * @breaking-change 17.0.0
  42. */
  43. export declare class MatLegacySelect extends _MatSelectBase<MatLegacySelectChange> implements OnInit {
  44. /** The scroll position of the overlay panel, calculated to center the selected option. */
  45. private _scrollTop;
  46. /** The last measured value for the trigger's client bounding rect. */
  47. private _triggerRect;
  48. /** The cached font-size of the trigger element. */
  49. _triggerFontSize: number;
  50. /** The value of the select panel's transform-origin property. */
  51. _transformOrigin: string;
  52. /**
  53. * The y-offset of the overlay panel in relation to the trigger's top start corner.
  54. * This must be adjusted to align the selected option text over the trigger text.
  55. * when the panel opens. Will change based on the y-position of the selected option.
  56. */
  57. _offsetY: number;
  58. options: QueryList<MatLegacyOption>;
  59. optionGroups: QueryList<MatLegacyOptgroup>;
  60. customTrigger: MatLegacySelectTrigger;
  61. _positions: ConnectedPosition[];
  62. /**
  63. * Calculates the scroll position of the select's overlay panel.
  64. *
  65. * Attempts to center the selected option in the panel. If the option is
  66. * too high or too low in the panel to be scrolled to the center, it clamps the
  67. * scroll position to the min or max scroll positions respectively.
  68. */
  69. _calculateOverlayScroll(selectedIndex: number, scrollBuffer: number, maxScroll: number): number;
  70. ngOnInit(): void;
  71. open(): void;
  72. /** Scrolls the active option into view. */
  73. protected _scrollOptionIntoView(index: number): void;
  74. protected _positioningSettled(): void;
  75. protected _panelDoneAnimating(isOpen: boolean): void;
  76. protected _getChangeEvent(value: any): MatLegacySelectChange;
  77. protected _getOverlayMinWidth(): number;
  78. /**
  79. * Sets the x-offset of the overlay panel in relation to the trigger's top start corner.
  80. * This must be adjusted to align the selected option text over the trigger text when
  81. * the panel opens. Will change based on LTR or RTL text direction. Note that the offset
  82. * can't be calculated until the panel has been attached, because we need to know the
  83. * content width in order to constrain the panel within the viewport.
  84. */
  85. private _calculateOverlayOffsetX;
  86. /**
  87. * Calculates the y-offset of the select's overlay panel in relation to the
  88. * top start corner of the trigger. It has to be adjusted in order for the
  89. * selected option to be aligned over the trigger when the panel opens.
  90. */
  91. private _calculateOverlayOffsetY;
  92. /**
  93. * Checks that the attempted overlay position will fit within the viewport.
  94. * If it will not fit, tries to adjust the scroll position and the associated
  95. * y-offset so the panel can open fully on-screen. If it still won't fit,
  96. * sets the offset back to 0 to allow the fallback position to take over.
  97. */
  98. private _checkOverlayWithinViewport;
  99. /** Adjusts the overlay panel up to fit in the viewport. */
  100. private _adjustPanelUp;
  101. /** Adjusts the overlay panel down to fit in the viewport. */
  102. private _adjustPanelDown;
  103. /** Calculates the scroll position and x- and y-offsets of the overlay panel. */
  104. private _calculateOverlayPosition;
  105. /** Sets the transform origin point based on the selected option. */
  106. private _getOriginBasedOnOption;
  107. /** Calculates the height of the select's options. */
  108. private _getItemHeight;
  109. /** Calculates the amount of items in the select. This includes options and group labels. */
  110. private _getItemCount;
  111. static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacySelect, never>;
  112. static ɵcmp: i0.ɵɵComponentDeclaration<MatLegacySelect, "mat-select", ["matSelect"], { "disabled": { "alias": "disabled"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; }, {}, ["customTrigger", "options", "optionGroups"], ["mat-select-trigger", "*"], false, never>;
  113. }
  114. /**
  115. * The following are all the animations for the mat-select component, with each
  116. * const containing the metadata for one animation.
  117. *
  118. * The values below match the implementation of the AngularJS Material mat-select animation.
  119. * @docs-private
  120. * @deprecated Use `matSelectAnimations` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  121. * @breaking-change 17.0.0
  122. */
  123. export declare const matLegacySelectAnimations: {
  124. readonly transformPanelWrap: AnimationTriggerMetadata;
  125. readonly transformPanel: AnimationTriggerMetadata;
  126. };
  127. /**
  128. * Change event object that is emitted when the select value has changed.
  129. * @deprecated Use `MatSelectChange` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  130. * @breaking-change 17.0.0
  131. */
  132. export declare class MatLegacySelectChange {
  133. /** Reference to the select that emitted the change event. */
  134. source: MatLegacySelect;
  135. /** Current value of the select that emitted the event. */
  136. value: any;
  137. constructor(
  138. /** Reference to the select that emitted the change event. */
  139. source: MatLegacySelect,
  140. /** Current value of the select that emitted the event. */
  141. value: any);
  142. }
  143. export { MatLegacySelectConfig }
  144. /**
  145. * @deprecated Use `MatSelectModule` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  146. * @breaking-change 17.0.0
  147. */
  148. export declare class MatLegacySelectModule {
  149. static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacySelectModule, never>;
  150. static ɵmod: i0.ɵɵNgModuleDeclaration<MatLegacySelectModule, [typeof i1.MatLegacySelect, typeof i1.MatLegacySelectTrigger], [typeof i2.CommonModule, typeof i3.OverlayModule, typeof i4.MatLegacyOptionModule, typeof i5.MatCommonModule], [typeof i6.CdkScrollableModule, typeof i7.MatLegacyFormFieldModule, typeof i1.MatLegacySelect, typeof i1.MatLegacySelectTrigger, typeof i4.MatLegacyOptionModule, typeof i5.MatCommonModule]>;
  151. static ɵinj: i0.ɵɵInjectorDeclaration<MatLegacySelectModule>;
  152. }
  153. /**
  154. * Allows the user to customize the trigger that is displayed when the select has a value.
  155. * @deprecated Use `MatSelectTrigger` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  156. * @breaking-change 17.0.0
  157. */
  158. export declare class MatLegacySelectTrigger {
  159. static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacySelectTrigger, never>;
  160. static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacySelectTrigger, "mat-select-trigger", never, {}, {}, never, never, false, never>;
  161. }
  162. /**
  163. * The height of the select items in `em` units.
  164. * @deprecated Use `SELECT_ITEM_HEIGHT_EM` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  165. * @breaking-change 17.0.0
  166. */
  167. declare const SELECT_ITEM_HEIGHT_EM = 3;
  168. /**
  169. * Distance between the panel edge and the option text in
  170. * multi-selection mode.
  171. *
  172. * Calculated as:
  173. * (SELECT_PANEL_PADDING_X * 1.5) + 16 = 40
  174. * The padding is multiplied by 1.5 because the checkbox's margin is half the padding.
  175. * The checkbox width is 16px.
  176. *
  177. * @deprecated Use `SELECT_MULTIPLE_PANEL_PADDING_X` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  178. * @breaking-change 17.0.0
  179. */
  180. declare const SELECT_MULTIPLE_PANEL_PADDING_X: number;
  181. /**
  182. * The panel's x axis padding if it is indented (e.g. there is an option group).
  183. * @deprecated Use `SELECT_PANEL_INDENT_PADDING_X` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  184. * @breaking-change 17.0.0
  185. */
  186. declare const SELECT_PANEL_INDENT_PADDING_X: number;
  187. /**
  188. * The max height of the select's overlay panel.
  189. * @deprecated Use `SELECT_PANEL_MAX_HEIGHT` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  190. * @breaking-change 17.0.0
  191. */
  192. declare const SELECT_PANEL_MAX_HEIGHT = 256;
  193. /**
  194. * The panel's padding on the x-axis.
  195. * @deprecated Use `SELECT_PANEL_PADDING_X` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  196. * @breaking-change 17.0.0
  197. */
  198. declare const SELECT_PANEL_PADDING_X = 16;
  199. /**
  200. * The select panel will only "fit" inside the viewport if it is positioned at
  201. * this value or more away from the viewport boundary.
  202. * @deprecated Use `SELECT_PANEL_VIEWPORT_PADDING` from `@angular/material/select` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
  203. * @breaking-change 17.0.0
  204. */
  205. declare const SELECT_PANEL_VIEWPORT_PADDING = 8;
  206. export { }