ng-primitives 0.117.2 → 0.119.0

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.
package/select/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { BooleanInput } from '@angular/cdk/coercion';
5
5
  import * as ng_primitives_internal from 'ng-primitives/internal';
6
6
  import * as ng_primitives_select from 'ng-primitives/select';
7
7
  import * as ng_primitives_portal from 'ng-primitives/portal';
8
- import { NgpOverlay, NgpFlip, NgpFlipInput } from 'ng-primitives/portal';
8
+ import { NgpOverlay, NgpFlip, NgpOffset, NgpFlipInput, NgpOffsetInput } from 'ng-primitives/portal';
9
9
  import * as ng_primitives_a11y from 'ng-primitives/a11y';
10
10
  import { Placement } from '@floating-ui/dom';
11
11
 
@@ -163,6 +163,12 @@ interface NgpSelectConfig {
163
163
  * @default true
164
164
  */
165
165
  flip: NgpFlip;
166
+ /**
167
+ * Define the offset of the select dropdown relative to the trigger.
168
+ * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.
169
+ * @default 0
170
+ */
171
+ offset: NgpOffset;
166
172
  }
167
173
  /**
168
174
  * Provide the default Select configuration
@@ -215,6 +221,12 @@ declare class NgpSelect {
215
221
  readonly container: _angular_core.InputSignal<string | HTMLElement | null>;
216
222
  /** Whether the dropdown should flip when there is not enough space. Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. */
217
223
  readonly flip: _angular_core.InputSignalWithTransform<NgpFlip, NgpFlipInput>;
224
+ /**
225
+ * Define the offset of the select dropdown relative to the trigger.
226
+ * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis.
227
+ * @default 0
228
+ */
229
+ readonly offset: _angular_core.InputSignalWithTransform<NgpOffset, NgpOffsetInput>;
218
230
  /**
219
231
  * A function that will scroll the active option into view. This can be overridden
220
232
  * for cases such as virtual scrolling where we cannot scroll the option directly because
@@ -266,9 +278,7 @@ declare class NgpSelect {
266
278
  id: _angular_core.Signal<string | undefined>;
267
279
  index: _angular_core.WritableSignal<number>;
268
280
  activateByIndex: (index: number, { scroll, origin }?: ng_primitives_a11y.ActivationOptions) => void;
269
- activateById: (id: string, options
270
- /** The value of the select. */
271
- ? /** The value of the select. */: ng_primitives_a11y.ActivationOptions) => void;
281
+ activateById: (id: string, options?: ng_primitives_a11y.ActivationOptions) => void;
272
282
  first: (options?: ng_primitives_a11y.ActivationOptions) => void;
273
283
  last: (options?: ng_primitives_a11y.ActivationOptions) => void;
274
284
  next: (options?: ng_primitives_a11y.ActivationOptions) => void;
@@ -289,6 +299,12 @@ declare class NgpSelect {
289
299
  * @internal
290
300
  */
291
301
  closeDropdown(): void;
302
+ /**
303
+ * Handles the dropdown being closed.
304
+ * Emits the openChange event and resets the active descendant.
305
+ * @internal
306
+ */
307
+ onOverlayClosed(): void;
292
308
  /**
293
309
  * Toggle the dropdown.
294
310
  * @internal
@@ -364,7 +380,7 @@ declare class NgpSelect {
364
380
  private scrollTo;
365
381
  private getOptionAtIndex;
366
382
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpSelect, never>;
367
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpSelect, "[ngpSelect]", ["ngpSelect"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "ngpSelectValue"; "required": false; "isSignal": true; }; "multiple": { "alias": "ngpSelectMultiple"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpSelectDisabled"; "required": false; "isSignal": true; }; "compareWith": { "alias": "ngpSelectCompareWith"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpSelectDropdownPlacement"; "required": false; "isSignal": true; }; "container": { "alias": "ngpSelectDropdownContainer"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpSelectDropdownFlip"; "required": false; "isSignal": true; }; "scrollToOption": { "alias": "ngpSelectScrollToOption"; "required": false; "isSignal": true; }; "allOptions": { "alias": "ngpSelectOptions"; "required": false; "isSignal": true; }; }, { "valueChange": "ngpSelectValueChange"; "openChange": "ngpSelectOpenChange"; }, never, never, true, never>;
383
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpSelect, "[ngpSelect]", ["ngpSelect"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "ngpSelectValue"; "required": false; "isSignal": true; }; "multiple": { "alias": "ngpSelectMultiple"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpSelectDisabled"; "required": false; "isSignal": true; }; "compareWith": { "alias": "ngpSelectCompareWith"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpSelectDropdownPlacement"; "required": false; "isSignal": true; }; "container": { "alias": "ngpSelectDropdownContainer"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpSelectDropdownFlip"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpSelectDropdownOffset"; "required": false; "isSignal": true; }; "scrollToOption": { "alias": "ngpSelectScrollToOption"; "required": false; "isSignal": true; }; "allOptions": { "alias": "ngpSelectOptions"; "required": false; "isSignal": true; }; }, { "valueChange": "ngpSelectValueChange"; "openChange": "ngpSelectOpenChange"; }, never, never, true, never>;
368
384
  }
369
385
 
370
386
  /**